Skip to content

Commit

Permalink
feat: improvements
Browse files Browse the repository at this point in the history
arthurfiorette committed Jan 15, 2025
1 parent 87bf339 commit 14d8b89
Showing 4 changed files with 47 additions and 37 deletions.
69 changes: 45 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,37 @@
# pnpmf
<h1 align="center">PNPMF</h1>

A dead simple pnpm group selector.
<p align="center">
<img src="./example.png" alt="PNPMF Example">
</p>

## Usage
A simple tool to run `pnpm` commands on selected groups of packages from your `pnpm-workspace.yaml`.

```bash
npm i -g pnpm
```
## Installation

Then, in your `pnpm-workspace.yaml`:

```yaml
packages:
# ...

# Define your groups as a list of valid pnpm filters
groups:
MyGroup:
- package1
- package2
Test:
- @org/*-ui # Select all packages that match the pattern
Build:
- core... # any kind of pnpm filter syntax works!
```
1. Install `pnpm` globally:

```bash
npm i -g pnpm
```

2. Define groups in your `pnpm-workspace.yaml`:

```yaml
# ...

groups:
MyGroup:
- package1
- package2
Test:
- '@org/*-ui' # any kind of pattern supported by pnpm is allowed
Build:
- pkg-core... # use X... to match dependencies of X or ...X to match dependents of X
```
## Usage
Then, you can replace you `pnpm` calls with `pnpmf` or `pf` to open a checkbox of groups to select from.
Instead of running `pnpm`, use `pnpmf` (or the shortcut `pf`) to select groups interactively.

```bash
# before
@@ -39,9 +45,24 @@ pf install
# before
pnpm --parallel build
# after
pf --parallel build
```

### How it works

1. When you run `pf`, it prompts you to select one or more groups.
2. It then passes the selected packages as filters to `pnpm`.

For example:

```bash
pf install # selects Test and MyGroup
# Equivalent to:
pnpm -F package1 -F package2 -F @org/*-ui install
```

## License

MIT
MIT
Binary file modified example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -5,8 +5,10 @@
"type": "git",
"url": "git+ssh://git@github.com/arthurfiorette/pnpmf.git"
},
"funding": "https://github.com/arthurfiorette/pnpmf?sponsor=1",
"license": "MIT",
"author": "Arthur Fiorette <me@arthur.place>",
"sideEffects": false,
"type": "module",
"main": "./index.js",
"bin": {
13 changes: 0 additions & 13 deletions pnpm-workspace.yaml

This file was deleted.

0 comments on commit 14d8b89

Please sign in to comment.