padc
Version:
Wraps pnpm add and injects dependencies into pnpm-workspace.yaml catalogs
59 lines (41 loc) β’ 1.21 kB
Markdown
English | [δΈζ](https://github.com/CodingAndSleeping/padc/blob/main/README-zh.md)
# π§© padc
> π¦ CLI wrapper for `pnpm add` with automatic catalog injection for `pnpm-workspace.yaml`.
## β¨ Features
- π§ **Automatic catalog injection** into `pnpm-workspace.yaml`
- π¦ **References** packages in `package.json` using `catalog:<name>`
- π **Full `pnpm add` options passthrough** (e.g., `--save-dev`, `--filter`, etc.)
- π·οΈ **Custom or interactive catalog selection**
- β‘ **Parallel version resolution** for faster installs
## π Usage
### Install
```zsh
pnpm i -g padc
```
### Install a package into a catalog use `-c <catalog>`
```zsh
padc lodash -c utils
```
This will add `lodash` to the `utils` catalog in `pnpm-workspace.yaml` and inject `catalog:utils` into `package.json`.
### Install a package without specifying a catalog
```zsh
padc lodash
```
Youβll be prompted to:
- Select default catalog
- Or select an existing catalog
- Or create a new one
## π€ Result
```yaml
# pnpm-workspace.yaml
catalogs:
utils:
lodash: ^4.17.21
```
```json
{
"dependencies": {
"lodash": "catalog:utils"
}
}
```