Skip to content

Commit

Permalink
feat: Better cli args parsing, npm client detection, tag flag
Browse files Browse the repository at this point in the history
  • Loading branch information
Max committed Aug 9, 2019
1 parent b984eef commit e482248
Show file tree
Hide file tree
Showing 8 changed files with 6,556 additions and 54 deletions.
14 changes: 14 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Program",
"program": "${workspaceFolder}/index.js"
}
]
}
19 changes: 16 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,30 @@ CLI tool for updating multiple packages of the same scope simultaneously
## Usage

```
npx update-by-scope <scope> [npmClient=yarn] [npmClientCommand=upgrade]
npx update-by-scope <scope>
```

If you use Yarn, it's only enough to specify the scope, e.g. `npx update-by-scope @example`. It will find all the packages which name starts with provided `scope` value inside the `package.json` and will run `yarn upgrade @example/foo@latest @example/bar@latest ...`.

If you use NPM as a client, you will have to also provide `npm install` as a client name and command to use.
Tool tries to detect which NPM client you use, for example if it's Yarn, it will find all the packages which name starts with provided `scope` value inside the `package.json` and will run `yarn upgrade @example/foo@latest @example/bar@latest ...`.

If you want to manually specify an NPM client and command it should use, you can write it after scope argument or with `-n` and `-c` flags.

```
npx update-by-scope @example npm install
```

or

```
npx update-by-scope -n npm -c install @example
```

In this case it will run `npm install @example/foo@latest @example/bar@latest ...`

It's also possible to specify NPM tag with a flag `--tag` or `-t`:

```
npx update-by-scope -t next @example
```

*If you have any ideas on how to improve the tool, feel free to open an issue or a PR.*
File renamed without changes.
Loading

0 comments on commit e482248

Please sign in to comment.