Comparing version 3.4.0 to 3.5.0
@@ -0,1 +1,10 @@ | ||
<a name="3.5.0"></a> | ||
# [3.5.0](https://github.com/JamieMason/syncpack/compare/3.4.0...3.5.0) (2018-10-29) | ||
### Features | ||
- **cli:** improve --help output and examples | ||
([dfe6274](https://github.com/JamieMason/syncpack/commit/dfe6274)) | ||
<a name="3.4.0"></a> | ||
@@ -7,3 +16,5 @@ | ||
- **cli:** read sources from lerna.json if present ([77b90eb](https://github.com/JamieMason/syncpack/commit/77b90eb)), closes [#11](https://github.com/JamieMason/syncpack/issues/11) | ||
- **cli:** read sources from lerna.json if present | ||
([77b90eb](https://github.com/JamieMason/syncpack/commit/77b90eb)), closes | ||
[#11](https://github.com/JamieMason/syncpack/issues/11) | ||
@@ -16,9 +27,16 @@ <a name="3.3.0"></a> | ||
- **cli:** specify dependency types as options ([ec5ef6b](https://github.com/JamieMason/syncpack/commit/ec5ef6b)), closes [#10](https://github.com/JamieMason/syncpack/issues/10) | ||
- **cli:** specify indentation as option ([8b408bd](https://github.com/JamieMason/syncpack/commit/8b408bd)), closes [#12](https://github.com/JamieMason/syncpack/issues/12) | ||
- **format:** sort contributors alphabetically ([935ffcf](https://github.com/JamieMason/syncpack/commit/935ffcf)) | ||
- **cli:** specify dependency types as options | ||
([ec5ef6b](https://github.com/JamieMason/syncpack/commit/ec5ef6b)), closes | ||
[#10](https://github.com/JamieMason/syncpack/issues/10) | ||
- **cli:** specify indentation as option | ||
([8b408bd](https://github.com/JamieMason/syncpack/commit/8b408bd)), closes | ||
[#12](https://github.com/JamieMason/syncpack/issues/12) | ||
- **format:** sort contributors alphabetically | ||
([935ffcf](https://github.com/JamieMason/syncpack/commit/935ffcf)) | ||
### Performance Improvements | ||
- **npm:** move [@types](https://github.com/types) to devDependencies ([ad5951c](https://github.com/JamieMason/syncpack/commit/ad5951c)), closes [#13](https://github.com/JamieMason/syncpack/issues/13) | ||
- **npm:** move [@types](https://github.com/types) to devDependencies | ||
([ad5951c](https://github.com/JamieMason/syncpack/commit/ad5951c)), closes | ||
[#13](https://github.com/JamieMason/syncpack/issues/13) | ||
@@ -31,8 +49,11 @@ <a name="3.0.0"></a> | ||
- **bin:** override package locations using repeatable --source options ([5dbcfd4](https://github.com/JamieMason/syncpack/commit/5dbcfd4)) | ||
- **list-mismatches:** return exit code on finding mismatches ([06958c6](https://github.com/JamieMason/syncpack/commit/06958c6)) | ||
- **bin:** override package locations using repeatable --source options | ||
([5dbcfd4](https://github.com/JamieMason/syncpack/commit/5dbcfd4)) | ||
- **list-mismatches:** return exit code on finding mismatches | ||
([06958c6](https://github.com/JamieMason/syncpack/commit/06958c6)) | ||
### BREAKING CHANGES | ||
- **bin:** Previously the location of package.json files could be overridden like so: | ||
- **bin:** Previously the location of package.json files could be overridden | ||
like so: | ||
@@ -58,3 +79,4 @@ ``` | ||
- **core:** ensure pattern overrides are read ([7513ba5](https://github.com/JamieMason/syncpack/commit/7513ba5)) | ||
- **core:** ensure pattern overrides are read | ||
([7513ba5](https://github.com/JamieMason/syncpack/commit/7513ba5)) | ||
@@ -67,3 +89,6 @@ <a name="2.0.0"></a> | ||
- **core:** support multiple glob patterns ([a2b5af0](https://github.com/JamieMason/syncpack/commit/a2b5af0)), closes [#5](https://github.com/JamieMason/syncpack/issues/5) [#6](https://github.com/JamieMason/syncpack/issues/6) | ||
- **core:** support multiple glob patterns | ||
([a2b5af0](https://github.com/JamieMason/syncpack/commit/a2b5af0)), closes | ||
[#5](https://github.com/JamieMason/syncpack/issues/5) | ||
[#6](https://github.com/JamieMason/syncpack/issues/6) | ||
@@ -80,3 +105,4 @@ ### BREAKING CHANGES | ||
- **core:** add set-semver-ranges command ([4d206b9](https://github.com/JamieMason/syncpack/commit/4d206b9)) | ||
- **core:** add set-semver-ranges command | ||
([4d206b9](https://github.com/JamieMason/syncpack/commit/4d206b9)) | ||
@@ -89,4 +115,6 @@ <a name="1.2.2"></a> | ||
- **core:** add format command ([bae1133](https://github.com/JamieMason/syncpack/commit/bae1133)) | ||
- **core:** output current version ([e53cd99](https://github.com/JamieMason/syncpack/commit/e53cd99)) | ||
- **core:** add format command | ||
([bae1133](https://github.com/JamieMason/syncpack/commit/bae1133)) | ||
- **core:** output current version | ||
([e53cd99](https://github.com/JamieMason/syncpack/commit/e53cd99)) | ||
@@ -103,3 +131,4 @@ <a name="1.0.2"></a> | ||
- **core:** correct paths to binaries ([5682cd6](https://github.com/JamieMason/syncpack/commit/5682cd6)) | ||
- **core:** correct paths to binaries | ||
([5682cd6](https://github.com/JamieMason/syncpack/commit/5682cd6)) | ||
@@ -112,12 +141,19 @@ <a name="1.0.0"></a> | ||
- **core:** correctly check a file is package.json ([d1da609](https://github.com/JamieMason/syncpack/commit/d1da609)) | ||
- **core:** handle missing dependency maps ([372aa68](https://github.com/JamieMason/syncpack/commit/372aa68)) | ||
- **core:** handle semver ranges containing 1.x.x ([a0f8f56](https://github.com/JamieMason/syncpack/commit/a0f8f56)) | ||
- **core:** correctly check a file is package.json | ||
([d1da609](https://github.com/JamieMason/syncpack/commit/d1da609)) | ||
- **core:** handle missing dependency maps | ||
([372aa68](https://github.com/JamieMason/syncpack/commit/372aa68)) | ||
- **core:** handle semver ranges containing 1.x.x | ||
([a0f8f56](https://github.com/JamieMason/syncpack/commit/a0f8f56)) | ||
### Features | ||
- **core:** add fix-mismatches command ([4793f1f](https://github.com/JamieMason/syncpack/commit/4793f1f)) | ||
- **core:** add list command ([3b29176](https://github.com/JamieMason/syncpack/commit/3b29176)) | ||
- **core:** add list-mismatches command ([735ad2b](https://github.com/JamieMason/syncpack/commit/735ad2b)) | ||
- **core:** update command line API ([de8dcb2](https://github.com/JamieMason/syncpack/commit/de8dcb2)) | ||
- **core:** add fix-mismatches command | ||
([4793f1f](https://github.com/JamieMason/syncpack/commit/4793f1f)) | ||
- **core:** add list command | ||
([3b29176](https://github.com/JamieMason/syncpack/commit/3b29176)) | ||
- **core:** add list-mismatches command | ||
([735ad2b](https://github.com/JamieMason/syncpack/commit/735ad2b)) | ||
- **core:** update command line API | ||
([de8dcb2](https://github.com/JamieMason/syncpack/commit/de8dcb2)) | ||
@@ -134,3 +170,4 @@ ### BREAKING CHANGES | ||
- **copy-values:** write results to disk ([a641de4](https://github.com/JamieMason/syncpack/commit/a641de4)) | ||
- **copy-values:** write results to disk | ||
([a641de4](https://github.com/JamieMason/syncpack/commit/a641de4)) | ||
@@ -143,3 +180,4 @@ <a name="0.3.0"></a> | ||
- **cli:** add copy-values command ([b51a2c9](https://github.com/JamieMason/syncpack/commit/b51a2c9)) | ||
- **cli:** add copy-values command | ||
([b51a2c9](https://github.com/JamieMason/syncpack/commit/b51a2c9)) | ||
@@ -152,3 +190,4 @@ <a name="0.2.1"></a> | ||
- **core:** update dependencies, fix lint warnings ([a65eef7](https://github.com/JamieMason/syncpack/commit/a65eef7)) | ||
- **core:** update dependencies, fix lint warnings | ||
([a65eef7](https://github.com/JamieMason/syncpack/commit/a65eef7)) | ||
@@ -161,3 +200,4 @@ <a name="0.2.0"></a> | ||
- **sync:** synchronise versions across multiple package.json ([7d5848a](https://github.com/JamieMason/syncpack/commit/7d5848a)) | ||
- **sync:** synchronise versions across multiple package.json | ||
([7d5848a](https://github.com/JamieMason/syncpack/commit/7d5848a)) | ||
@@ -170,2 +210,3 @@ <a name="0.1.0"></a> | ||
- **cli:** create scaffold cli ([f6dada7](https://github.com/JamieMason/syncpack/commit/f6dada7)) | ||
- **cli:** create scaffold cli | ||
([f6dada7](https://github.com/JamieMason/syncpack/commit/f6dada7)) |
#!/usr/bin/env node | ||
"use strict"; | ||
exports.__esModule = true; | ||
var chalk_1 = require("chalk"); | ||
var program = require("commander"); | ||
var fix_mismatches_1 = require("./fix-mismatches"); | ||
program.description("\n Ensure that multiple packages requiring the same dependency define the same\n version, so that every package requires eg. react@16.4.2, instead of a\n combination of react@16.4.2, react@0.15.9, and react@16.0.0.".replace(/^\n/, '')); | ||
program.on('--help', function () { | ||
console.log(''); | ||
console.log("Examples:\n " + chalk_1["default"].grey('# uses packages defined in lerna.json by default') + "\n syncpack fix-mismatches\n " + chalk_1["default"].grey('# uses packages defined by --source when provided') + "\n syncpack fix-mismatches --source " + chalk_1["default"].yellow('"apps/*/package.json"') + "\n " + chalk_1["default"].grey('# multiple globs can be provided like this') + "\n syncpack fix-mismatches --source " + chalk_1["default"].yellow('"apps/*/package.json"') + " --source " + chalk_1["default"].yellow('"core/*/package.json"') + "\n " + chalk_1["default"].grey('# only fix "devDependencies"') + "\n syncpack fix-mismatches --dev\n " + chalk_1["default"].grey('# only fix "devDependencies" and "peerDependencies"') + "\n syncpack fix-mismatches --dev --peer\n " + chalk_1["default"].grey('# indent package.json with 4 spaces instead of 2') + "\n syncpack fix-mismatches --indent " + chalk_1["default"].yellow('" "') + "\n "); | ||
console.log("Reference:\n lerna.json\n " + chalk_1["default"].blue.underline('https://github.com/lerna/lerna#lernajson') + "\n globs\n " + chalk_1["default"].blue.underline('https://github.com/isaacs/node-glob#glob-primer')); | ||
}); | ||
fix_mismatches_1.run(program); |
#!/usr/bin/env node | ||
"use strict"; | ||
exports.__esModule = true; | ||
var chalk_1 = require("chalk"); | ||
var program = require("commander"); | ||
var format_1 = require("./format"); | ||
program.description("\n Organise package.json files according to a conventional format, where fields\n appear in a predictable order and nested fields are ordered alphabetically.\n Shorthand properties are used where available, such as the \"repository\" and\n \"bugs\" fields.".replace(/^\n/, '')); | ||
program.on('--help', function () { | ||
console.log(''); | ||
console.log("Examples:\n " + chalk_1["default"].grey('# uses packages defined in lerna.json by default') + "\n syncpack format\n " + chalk_1["default"].grey('# uses packages defined by --source when provided') + "\n syncpack format --source " + chalk_1["default"].yellow('"apps/*/package.json"') + "\n " + chalk_1["default"].grey('# multiple globs can be provided like this') + "\n syncpack format --source " + chalk_1["default"].yellow('"apps/*/package.json"') + " --source " + chalk_1["default"].yellow('"core/*/package.json"') + "\n " + chalk_1["default"].grey('# indent package.json with 4 spaces instead of 2') + "\n syncpack format --indent " + chalk_1["default"].yellow('" "') + "\n "); | ||
console.log("Reference:\n lerna.json\n " + chalk_1["default"].blue.underline('https://github.com/lerna/lerna#lernajson') + "\n globs\n " + chalk_1["default"].blue.underline('https://github.com/isaacs/node-glob#glob-primer')); | ||
}); | ||
format_1.run(program); |
#!/usr/bin/env node | ||
"use strict"; | ||
exports.__esModule = true; | ||
var chalk_1 = require("chalk"); | ||
var program = require("commander"); | ||
var list_mismatches_1 = require("./list-mismatches"); | ||
program.description("\n List dependencies which are required by multiple packages, where the version\n is not the same across every package.".replace(/^\n/, '')); | ||
program.on('--help', function () { | ||
console.log(''); | ||
console.log("Examples:\n " + chalk_1["default"].grey('# uses packages defined in lerna.json by default') + "\n syncpack list-mismatches\n " + chalk_1["default"].grey('# uses packages defined by --source when provided') + "\n syncpack list-mismatches --source " + chalk_1["default"].yellow('"apps/*/package.json"') + "\n " + chalk_1["default"].grey('# multiple globs can be provided like this') + "\n syncpack list-mismatches --source " + chalk_1["default"].yellow('"apps/*/package.json"') + " --source " + chalk_1["default"].yellow('"core/*/package.json"') + "\n " + chalk_1["default"].grey('# only list "devDependencies"') + "\n syncpack list-mismatches --dev\n " + chalk_1["default"].grey('# only list "devDependencies" and "peerDependencies"') + "\n syncpack list-mismatches --dev --peer\n "); | ||
console.log("Reference:\n lerna.json\n " + chalk_1["default"].blue.underline('https://github.com/lerna/lerna#lernajson') + "\n globs\n " + chalk_1["default"].blue.underline('https://github.com/isaacs/node-glob#glob-primer')); | ||
}); | ||
list_mismatches_1.run(program); |
#!/usr/bin/env node | ||
"use strict"; | ||
exports.__esModule = true; | ||
var chalk_1 = require("chalk"); | ||
var program = require("commander"); | ||
var list_1 = require("./list"); | ||
program.description("\n List all dependencies required by your packages.".replace(/^\n/, '')); | ||
program.on('--help', function () { | ||
console.log(''); | ||
console.log("Examples:\n " + chalk_1["default"].grey('# uses packages defined in lerna.json by default') + "\n syncpack list\n " + chalk_1["default"].grey('# uses packages defined by --source when provided') + "\n syncpack list --source " + chalk_1["default"].yellow('"apps/*/package.json"') + "\n " + chalk_1["default"].grey('# multiple globs can be provided like this') + "\n syncpack list --source " + chalk_1["default"].yellow('"apps/*/package.json"') + " --source " + chalk_1["default"].yellow('"core/*/package.json"') + "\n " + chalk_1["default"].grey('# only inspect "devDependencies"') + "\n syncpack list --dev\n " + chalk_1["default"].grey('# only inspect "devDependencies" and "peerDependencies"') + "\n syncpack list --dev --peer\n "); | ||
console.log("Reference:\n lerna.json\n " + chalk_1["default"].blue.underline('https://github.com/lerna/lerna#lernajson') + "\n globs\n " + chalk_1["default"].blue.underline('https://github.com/isaacs/node-glob#glob-primer')); | ||
}); | ||
list_1.run(program); |
#!/usr/bin/env node | ||
"use strict"; | ||
exports.__esModule = true; | ||
var chalk_1 = require("chalk"); | ||
var program = require("commander"); | ||
var set_semver_ranges_1 = require("./set-semver-ranges"); | ||
program.description("\n Ensure dependency versions used within \"dependencies\", \"devDependencies\", and\n \"peerDependencies\" follow a consistent format.".replace(/^\n/, '')); | ||
program.on('--help', function () { | ||
console.log(''); | ||
console.log("Examples:\n " + chalk_1["default"].grey('# uses packages defined in lerna.json by default') + "\n syncpack set-semver-ranges\n " + chalk_1["default"].grey('# uses packages defined by --source when provided') + "\n syncpack set-semver-ranges --source " + chalk_1["default"].yellow('"apps/*/package.json"') + "\n " + chalk_1["default"].grey('# multiple globs can be provided like this') + "\n syncpack set-semver-ranges --source " + chalk_1["default"].yellow('"apps/*/package.json"') + " --source " + chalk_1["default"].yellow('"core/*/package.json"') + "\n " + chalk_1["default"].grey('# use ~ range instead of default ""') + "\n syncpack set-semver-ranges --semver-range ~\n " + chalk_1["default"].grey('# set ~ range in "devDependencies"') + "\n syncpack set-semver-ranges --dev --semver-range ~\n " + chalk_1["default"].grey('# set ~ range in "devDependencies" and "peerDependencies"') + "\n syncpack set-semver-ranges --dev --peer --semver-range ~\n " + chalk_1["default"].grey('# indent package.json with 4 spaces instead of 2') + "\n syncpack set-semver-ranges --indent " + chalk_1["default"].yellow('" "') + "\n "); | ||
console.log("Supported Ranges:\n < " + chalk_1["default"].grey('<1.4.2') + "\n <= " + chalk_1["default"].grey('<=1.4.2') + "\n \"\" " + chalk_1["default"].grey('1.4.2') + "\n ~ " + chalk_1["default"].grey('~1.4.2') + "\n ^ " + chalk_1["default"].grey('^1.4.2') + "\n >= " + chalk_1["default"].grey('>=1.4.2') + "\n > " + chalk_1["default"].grey('>1.4.2') + "\n * " + chalk_1["default"].grey('*') + "\n "); | ||
console.log("Reference:\n lerna.json\n " + chalk_1["default"].blue.underline('https://github.com/lerna/lerna#lernajson') + "\n globs\n " + chalk_1["default"].blue.underline('https://github.com/isaacs/node-glob#glob-primer')); | ||
}); | ||
set_semver_ranges_1.run(program); |
{ | ||
"name": "syncpack", | ||
"description": "Manage multiple package.json files, such as in Lerna Monorepos", | ||
"version": "3.4.0", | ||
"version": "3.5.0", | ||
"author": "Jamie Mason <jamie@foldleft.io> (https://github.com/JamieMason)", | ||
@@ -6,0 +6,0 @@ "bin": { |
194
README.md
@@ -12,4 +12,7 @@ # syncpack | ||
Manage multiple `package.json` files, such as `packages/*/package.json` in [Lerna](https://lernajs.io) Monorepos. | ||
## Summary | ||
Manage multiple `package.json` files, such as `packages/*/package.json` in | ||
[Lerna](https://lernajs.io) Monorepos. | ||
## Installation | ||
@@ -21,37 +24,36 @@ | ||
## Usage | ||
## Commands | ||
``` | ||
Usage: syncpack [options] [command] | ||
### fix-mismatches | ||
Options: | ||
Ensure that multiple packages requiring the same dependency define the same | ||
version, so that every package requires eg. `react@16.4.2`, instead of a | ||
combination of `react@16.4.2`, `react@0.15.9`, and `react@16.0.0`. | ||
-V, --version output the version number | ||
-h, --help output usage information | ||
#### Options | ||
Commands: | ||
fix-mismatches set dependencies used with different versions to the same version | ||
format sort and shorten properties according to a convention | ||
list list every dependency used in your packages | ||
list-mismatches list every dependency used with different versions in your packages | ||
set-semver-ranges set semver ranges to the given format | ||
help [cmd] display help for [cmd] | ||
``` | ||
### fix-mismatches | ||
Set dependencies used with different versions to the same version. | ||
-s, --source [pattern] glob pattern for package.json files to read from | ||
-p, --prod include dependencies | ||
-d, --dev include devDependencies | ||
-P, --peer include peerDependencies | ||
-i, --indent [value] override indentation. defaults to " " | ||
-h, --help output usage information | ||
``` | ||
Usage: syncpack fix-mismatches [options] | ||
Options: | ||
#### Examples | ||
-s, --source [pattern] glob pattern for package.json files to read from | ||
-p, --prod include dependencies | ||
-d, --dev include devDependencies | ||
-P, --peer include peerDependencies | ||
-i, --indent [value] override indentation. defaults to " " | ||
-h, --help output usage information | ||
```bash | ||
# uses packages defined in lerna.json by default | ||
syncpack fix-mismatches | ||
# uses packages defined by --source when provided | ||
syncpack fix-mismatches --source "apps/*/package.json" | ||
# multiple globs can be provided like this | ||
syncpack fix-mismatches --source "apps/*/package.json" --source "core/*/package.json" | ||
# only fix "devDependencies" | ||
syncpack fix-mismatches --dev | ||
# only fix "devDependencies" and "peerDependencies" | ||
syncpack fix-mismatches --dev --peer | ||
# indent package.json with 4 spaces instead of 2 | ||
syncpack fix-mismatches --indent " " | ||
``` | ||
@@ -61,12 +63,26 @@ | ||
Sort and shorten properties according to a convention. | ||
Organise package.json files according to a conventional format, where fields | ||
appear in a predictable order and nested fields are ordered alphabetically. | ||
Shorthand properties are used where available, such as the `"repository"` and | ||
`"bugs"` fields. | ||
#### Options | ||
``` | ||
Usage: syncpack format [options] | ||
-s, --source [pattern] glob pattern for package.json files to read from | ||
-i, --indent [value] override indentation. defaults to " " | ||
-h, --help output usage information | ||
``` | ||
Options: | ||
#### Examples | ||
-s, --source [pattern] glob pattern for package.json files to read from | ||
-i, --indent [value] override indentation. defaults to " " | ||
-h, --help output usage information | ||
```bash | ||
# uses packages defined in lerna.json by default | ||
syncpack format | ||
# uses packages defined by --source when provided | ||
syncpack format --source "apps/*/package.json" | ||
# multiple globs can be provided like this | ||
syncpack format --source "apps/*/package.json" --source "core/*/package.json" | ||
# indent package.json with 4 spaces instead of 2 | ||
syncpack format --indent " " | ||
``` | ||
@@ -76,14 +92,27 @@ | ||
List every dependency used in your packages. | ||
List all dependencies required by your packages. | ||
#### Options | ||
``` | ||
Usage: syncpack list [options] | ||
-s, --source [pattern] glob pattern for package.json files to read from | ||
-p, --prod include dependencies | ||
-d, --dev include devDependencies | ||
-P, --peer include peerDependencies | ||
-h, --help output usage information | ||
``` | ||
Options: | ||
#### Examples | ||
-s, --source [pattern] glob pattern for package.json files to read from | ||
-p, --prod include dependencies | ||
-d, --dev include devDependencies | ||
-P, --peer include peerDependencies | ||
-h, --help output usage information | ||
```bash | ||
# uses packages defined in lerna.json by default | ||
syncpack list | ||
# uses packages defined by --source when provided | ||
syncpack list --source "apps/*/package.json" | ||
# multiple globs can be provided like this | ||
syncpack list --source "apps/*/package.json" --source "core/*/package.json" | ||
# only inspect "devDependencies" | ||
syncpack list --dev | ||
# only inspect "devDependencies" and "peerDependencies" | ||
syncpack list --dev --peer | ||
``` | ||
@@ -93,14 +122,28 @@ | ||
List every dependency used with different versions in your packages. | ||
List dependencies which are required by multiple packages, where the version is | ||
not the same across every package. | ||
#### Options | ||
``` | ||
Usage: syncpack list-mismatches [options] | ||
-s, --source [pattern] glob pattern for package.json files to read from | ||
-p, --prod include dependencies | ||
-d, --dev include devDependencies | ||
-P, --peer include peerDependencies | ||
-h, --help output usage information | ||
``` | ||
Options: | ||
#### Examples | ||
-s, --source [pattern] glob pattern for package.json files to read from | ||
-p, --prod include dependencies | ||
-d, --dev include devDependencies | ||
-P, --peer include peerDependencies | ||
-h, --help output usage information | ||
```bash | ||
# uses packages defined in lerna.json by default | ||
syncpack list-mismatches | ||
# uses packages defined by --source when provided | ||
syncpack list-mismatches --source "apps/*/package.json" | ||
# multiple globs can be provided like this | ||
syncpack list-mismatches --source "apps/*/package.json" --source "core/*/package.json" | ||
# only list "devDependencies" | ||
syncpack list-mismatches --dev | ||
# only list "devDependencies" and "peerDependencies" | ||
syncpack list-mismatches --dev --peer | ||
``` | ||
@@ -110,16 +153,47 @@ | ||
Set semver ranges to the given format. | ||
Ensure dependency versions used within `"dependencies"`, `"devDependencies"`, | ||
and `"peerDependencies"` follow a consistent format. | ||
#### Options | ||
``` | ||
Usage: syncpack set-semver-ranges [options] | ||
-r, --semver-range <range> <, <=, "", ~, ^, >=, >, or *. defaults to "" | ||
-s, --source [pattern] glob pattern for package.json files to read from | ||
-p, --prod include dependencies | ||
-d, --dev include devDependencies | ||
-P, --peer include peerDependencies | ||
-i, --indent [value] override indentation. defaults to " " | ||
-h, --help output usage information | ||
``` | ||
Options: | ||
#### Examples | ||
-r, --semver-range <range> <, <=, "", ~, ^, >=, >, or *. defaults to "" | ||
-s, --source [pattern] glob pattern for package.json files to read from | ||
-p, --prod include dependencies | ||
-d, --dev include devDependencies | ||
-P, --peer include peerDependencies | ||
-i, --indent [value] override indentation. defaults to " " | ||
-h, --help output usage information | ||
```bash | ||
# uses packages defined in lerna.json by default | ||
syncpack set-semver-ranges | ||
# uses packages defined by --source when provided | ||
syncpack set-semver-ranges --source "apps/*/package.json" | ||
# multiple globs can be provided like this | ||
syncpack set-semver-ranges --source "apps/*/package.json" --source "core/*/package.json" | ||
# use ~ range instead of default "" | ||
syncpack set-semver-ranges --semver-range ~ | ||
# set ~ range in "devDependencies" | ||
syncpack set-semver-ranges --dev --semver-range ~ | ||
# set ~ range in "devDependencies" and "peerDependencies" | ||
syncpack set-semver-ranges --dev --peer --semver-range ~ | ||
# indent package.json with 4 spaces instead of 2 | ||
syncpack set-semver-ranges --indent " " | ||
``` | ||
#### Supported Ranges | ||
``` | ||
< <1.4.2 | ||
<= <=1.4.2 | ||
"" 1.4.2 | ||
~ ~1.4.2 | ||
^ ^1.4.2 | ||
>= >=1.4.2 | ||
> >1.4.2 | ||
* * | ||
``` |
63731
930
194