New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

syncpack

Package Overview
Dependencies
Maintainers
1
Versions
92
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

syncpack - npm Package Compare versions

Comparing version 5.7.11 to 5.8.12

dist/bin-lint-semver-ranges.d.ts

14

CHANGELOG.md

@@ -0,1 +1,15 @@

## [5.8.12](https://github.com/JamieMason/syncpack/compare/5.7.11...5.8.12) (2021-08-01)
### Bug Fixes
* **npm:** update dependencies ([91254f6](https://github.com/JamieMason/syncpack/commit/91254f6aa283afcc0b32163864468359dd4f888f))
### Features
* **core:** add lint-semver-ranges command ([b4209f0](https://github.com/JamieMason/syncpack/commit/b4209f076344a9d59830d3bbd75569de9e19b4b3)), closes [#56](https://github.com/JamieMason/syncpack/issues/56)
## [5.7.11](https://github.com/JamieMason/syncpack/compare/5.6.10...5.7.11) (2021-01-29)

@@ -2,0 +16,0 @@

40

dist/bin-fix-mismatches.js

@@ -23,5 +23,6 @@ #!/usr/bin/env node

};
var __spread = (this && this.__spread) || function () {
for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));
return ar;
var __spreadArray = (this && this.__spreadArray) || function (to, from) {
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
to[j] = from[i];
return to;
};

@@ -37,22 +38,23 @@ var __importDefault = (this && this.__importDefault) || function (mod) {

var get_config_1 = require("./lib/get-config");
var program = require("commander");
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 () {
var commander_1 = require("commander");
commander_1.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/, ''));
commander_1.program.on('--help', function () {
console.log(chalk_1["default"](templateObject_1 || (templateObject_1 = __makeTemplateObject(["\nResolving Packages:\n 1. If {yellow --source} globs are provided, use those.\n 2. If using Pnpm Workspaces, read {yellow packages} from {yellow pnpm-workspace.yaml} in the root of the project.\n 3. If using Yarn Workspaces, read {yellow workspaces} from {yellow package.json}.\n 4. If using Lerna, read {yellow packages} from {yellow lerna.json}.\n 5. Default to {yellow \"package.json\"} and {yellow \"packages/*/package.json\"}.\n\nExamples:\n {dim # uses defaults for resolving packages}\n syncpack fix-mismatches\n {dim # uses packages defined by --source when provided}\n syncpack fix-mismatches --source {yellow \"apps/*/package.json\"}\n {dim # multiple globs can be provided like this}\n syncpack fix-mismatches --source {yellow \"apps/*/package.json\"} --source {yellow \"core/*/package.json\"}\n {dim # uses dependencies regular expression defined by --filter when provided}\n syncpack fix-mismatches --filter {yellow \"typescript|tslint\"}\n {dim # only inspect \"devDependencies\"}\n syncpack fix-mismatches --dev\n {dim # only inspect \"devDependencies\" and \"peerDependencies\"}\n syncpack fix-mismatches --dev --peer\n {dim # indent package.json with 4 spaces instead of 2}\n syncpack fix-mismatches --indent {yellow \" \"}\n\nReference:\n globs {blue.underline https://github.com/isaacs/node-glob#glob-primer}\n lerna.json {blue.underline https://github.com/lerna/lerna#lernajson}\n Yarn Workspaces {blue.underline https://yarnpkg.com/lang/en/docs/workspaces}\n Pnpm Workspaces {blue.underline https://pnpm.js.org/en/workspaces}\n"], ["\nResolving Packages:\n 1. If {yellow --source} globs are provided, use those.\n 2. If using Pnpm Workspaces, read {yellow packages} from {yellow pnpm-workspace.yaml} in the root of the project.\n 3. If using Yarn Workspaces, read {yellow workspaces} from {yellow package.json}.\n 4. If using Lerna, read {yellow packages} from {yellow lerna.json}.\n 5. Default to {yellow \"package.json\"} and {yellow \"packages/*/package.json\"}.\n\nExamples:\n {dim # uses defaults for resolving packages}\n syncpack fix-mismatches\n {dim # uses packages defined by --source when provided}\n syncpack fix-mismatches --source {yellow \"apps/*/package.json\"}\n {dim # multiple globs can be provided like this}\n syncpack fix-mismatches --source {yellow \"apps/*/package.json\"} --source {yellow \"core/*/package.json\"}\n {dim # uses dependencies regular expression defined by --filter when provided}\n syncpack fix-mismatches --filter {yellow \"typescript|tslint\"}\n {dim # only inspect \"devDependencies\"}\n syncpack fix-mismatches --dev\n {dim # only inspect \"devDependencies\" and \"peerDependencies\"}\n syncpack fix-mismatches --dev --peer\n {dim # indent package.json with 4 spaces instead of 2}\n syncpack fix-mismatches --indent {yellow \" \"}\n\nReference:\n globs {blue.underline https://github.com/isaacs/node-glob#glob-primer}\n lerna.json {blue.underline https://github.com/lerna/lerna#lernajson}\n Yarn Workspaces {blue.underline https://yarnpkg.com/lang/en/docs/workspaces}\n Pnpm Workspaces {blue.underline https://pnpm.js.org/en/workspaces}\n"]))));
});
(_a = (_b = (_c = (_d = (_e = program
.option.apply(program, __spread(constants_1.option.source)))
.option.apply(_e, __spread(constants_1.option.prod)))
.option.apply(_d, __spread(constants_1.option.dev)))
.option.apply(_c, __spread(constants_1.option.peer)))
.option.apply(_b, __spread(constants_1.option.filter)))
.option.apply(_a, __spread(constants_1.option.indent)).parse(process.argv);
(_a = (_b = (_c = (_d = (_e = commander_1.program
.option.apply(commander_1.program, __spreadArray([], __read(constants_1.option.source))))
.option.apply(_e, __spreadArray([], __read(constants_1.option.prod))))
.option.apply(_d, __spreadArray([], __read(constants_1.option.dev))))
.option.apply(_c, __spreadArray([], __read(constants_1.option.peer))))
.option.apply(_b, __spreadArray([], __read(constants_1.option.filter))))
.option.apply(_a, __spreadArray([], __read(constants_1.option.indent))).parse(process.argv);
var args = commander_1.program;
fix_mismatches_1.fixMismatchesToDisk(get_config_1.getConfig({
dev: program.dev,
filter: program.filter,
indent: program.indent,
peer: program.peer,
prod: program.prod,
source: program.source
dev: args.dev,
filter: args.filter,
indent: args.indent,
peer: args.peer,
prod: args.prod,
source: args.source
}));
var templateObject_1;

@@ -23,5 +23,6 @@ #!/usr/bin/env node

};
var __spread = (this && this.__spread) || function () {
for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));
return ar;
var __spreadArray = (this && this.__spreadArray) || function (to, from) {
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
to[j] = from[i];
return to;
};

@@ -37,14 +38,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {

var get_config_1 = require("./lib/get-config");
var program = require("commander");
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 () {
var commander_1 = require("commander");
commander_1.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/, ''));
commander_1.program.on('--help', function () {
console.log(chalk_1["default"](templateObject_1 || (templateObject_1 = __makeTemplateObject(["\nExamples:\n {dim # uses defaults for resolving packages}\n syncpack format\n {dim # uses packages defined by --source when provided}\n syncpack format --source {yellow \"apps/*/package.json\"}\n {dim # multiple globs can be provided like this}\n syncpack format --source {yellow \"apps/*/package.json\"} --source {yellow \"core/*/package.json\"}\n {dim # indent package.json with 4 spaces instead of 2}\n syncpack format --indent {yellow \" \"}\n\nResolving Packages:\n 1. If {yellow --source} globs are provided, use those.\n 2. If using Pnpm Workspaces, read {yellow packages} from {yellow pnpm-workspace.yaml} in the root of the project.\n 3. If using Yarn Workspaces, read {yellow workspaces} from {yellow package.json}.\n 4. If using Lerna, read {yellow packages} from {yellow lerna.json}.\n 5. Default to {yellow \"package.json\"} and {yellow \"packages/*/package.json\"}.\n\nReference:\n globs {blue.underline https://github.com/isaacs/node-glob#glob-primer}\n lerna.json {blue.underline https://github.com/lerna/lerna#lernajson}\n Yarn Workspaces {blue.underline https://yarnpkg.com/lang/en/docs/workspaces}\n Pnpm Workspaces {blue.underline https://pnpm.js.org/en/workspaces}\n"], ["\nExamples:\n {dim # uses defaults for resolving packages}\n syncpack format\n {dim # uses packages defined by --source when provided}\n syncpack format --source {yellow \"apps/*/package.json\"}\n {dim # multiple globs can be provided like this}\n syncpack format --source {yellow \"apps/*/package.json\"} --source {yellow \"core/*/package.json\"}\n {dim # indent package.json with 4 spaces instead of 2}\n syncpack format --indent {yellow \" \"}\n\nResolving Packages:\n 1. If {yellow --source} globs are provided, use those.\n 2. If using Pnpm Workspaces, read {yellow packages} from {yellow pnpm-workspace.yaml} in the root of the project.\n 3. If using Yarn Workspaces, read {yellow workspaces} from {yellow package.json}.\n 4. If using Lerna, read {yellow packages} from {yellow lerna.json}.\n 5. Default to {yellow \"package.json\"} and {yellow \"packages/*/package.json\"}.\n\nReference:\n globs {blue.underline https://github.com/isaacs/node-glob#glob-primer}\n lerna.json {blue.underline https://github.com/lerna/lerna#lernajson}\n Yarn Workspaces {blue.underline https://yarnpkg.com/lang/en/docs/workspaces}\n Pnpm Workspaces {blue.underline https://pnpm.js.org/en/workspaces}\n"]))));
});
(_a = program
.option.apply(program, __spread(constants_1.option.source)))
.option.apply(_a, __spread(constants_1.option.indent)).parse(process.argv);
(_a = commander_1.program
.option.apply(commander_1.program, __spreadArray([], __read(constants_1.option.source))))
.option.apply(_a, __spreadArray([], __read(constants_1.option.indent))).parse(process.argv);
var args = commander_1.program;
format_1.formatToDisk(get_config_1.getConfig({
indent: program.indent,
source: program.source
indent: args.indent,
source: args.source
}));
var templateObject_1;

@@ -23,5 +23,6 @@ #!/usr/bin/env node

};
var __spread = (this && this.__spread) || function () {
for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));
return ar;
var __spreadArray = (this && this.__spreadArray) || function (to, from) {
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
to[j] = from[i];
return to;
};

@@ -37,20 +38,21 @@ var __importDefault = (this && this.__importDefault) || function (mod) {

var get_config_1 = require("./lib/get-config");
var program = require("commander");
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 () {
var commander_1 = require("commander");
commander_1.program.description("\n List dependencies which are required by multiple packages, where the version\n is not the same across every package.".replace(/^\n/, ''));
commander_1.program.on('--help', function () {
console.log(chalk_1["default"](templateObject_1 || (templateObject_1 = __makeTemplateObject(["\nExamples:\n {dim # uses defaults for resolving packages}\n syncpack list-mismatches\n {dim # uses packages defined by --source when provided}\n syncpack list-mismatches --source {yellow \"apps/*/package.json\"}\n {dim # multiple globs can be provided like this}\n syncpack list-mismatches --source {yellow \"apps/*/package.json\"} --source {yellow \"core/*/package.json\"}\n {dim # uses dependencies regular expression defined by --filter when provided}\n syncpack list-mismatches --filter {yellow \"typescript|tslint\"}\n {dim # only inspect \"devDependencies\"}\n syncpack list-mismatches --dev\n {dim # only inspect \"devDependencies\" and \"peerDependencies\"}\n syncpack list-mismatches --dev --peer\n\nResolving Packages:\n 1. If {yellow --source} globs are provided, use those.\n 2. If using Pnpm Workspaces, read {yellow packages} from {yellow pnpm-workspace.yaml} in the root of the project.\n 3. If using Yarn Workspaces, read {yellow workspaces} from {yellow package.json}.\n 4. If using Lerna, read {yellow packages} from {yellow lerna.json}.\n 5. Default to {yellow \"package.json\"} and {yellow \"packages/*/package.json\"}.\n\nReference:\n globs {blue.underline https://github.com/isaacs/node-glob#glob-primer}\n lerna.json {blue.underline https://github.com/lerna/lerna#lernajson}\n Yarn Workspaces {blue.underline https://yarnpkg.com/lang/en/docs/workspaces}\n Pnpm Workspaces {blue.underline https://pnpm.js.org/en/workspaces}\n"], ["\nExamples:\n {dim # uses defaults for resolving packages}\n syncpack list-mismatches\n {dim # uses packages defined by --source when provided}\n syncpack list-mismatches --source {yellow \"apps/*/package.json\"}\n {dim # multiple globs can be provided like this}\n syncpack list-mismatches --source {yellow \"apps/*/package.json\"} --source {yellow \"core/*/package.json\"}\n {dim # uses dependencies regular expression defined by --filter when provided}\n syncpack list-mismatches --filter {yellow \"typescript|tslint\"}\n {dim # only inspect \"devDependencies\"}\n syncpack list-mismatches --dev\n {dim # only inspect \"devDependencies\" and \"peerDependencies\"}\n syncpack list-mismatches --dev --peer\n\nResolving Packages:\n 1. If {yellow --source} globs are provided, use those.\n 2. If using Pnpm Workspaces, read {yellow packages} from {yellow pnpm-workspace.yaml} in the root of the project.\n 3. If using Yarn Workspaces, read {yellow workspaces} from {yellow package.json}.\n 4. If using Lerna, read {yellow packages} from {yellow lerna.json}.\n 5. Default to {yellow \"package.json\"} and {yellow \"packages/*/package.json\"}.\n\nReference:\n globs {blue.underline https://github.com/isaacs/node-glob#glob-primer}\n lerna.json {blue.underline https://github.com/lerna/lerna#lernajson}\n Yarn Workspaces {blue.underline https://yarnpkg.com/lang/en/docs/workspaces}\n Pnpm Workspaces {blue.underline https://pnpm.js.org/en/workspaces}\n"]))));
});
(_a = (_b = (_c = (_d = program
.option.apply(program, __spread(constants_1.option.source)))
.option.apply(_d, __spread(constants_1.option.prod)))
.option.apply(_c, __spread(constants_1.option.dev)))
.option.apply(_b, __spread(constants_1.option.peer)))
.option.apply(_a, __spread(constants_1.option.filter)).parse(process.argv);
(_a = (_b = (_c = (_d = commander_1.program
.option.apply(commander_1.program, __spreadArray([], __read(constants_1.option.source))))
.option.apply(_d, __spreadArray([], __read(constants_1.option.prod))))
.option.apply(_c, __spreadArray([], __read(constants_1.option.dev))))
.option.apply(_b, __spreadArray([], __read(constants_1.option.peer))))
.option.apply(_a, __spreadArray([], __read(constants_1.option.filter))).parse(process.argv);
var args = commander_1.program;
list_mismatches_1.listMismatchesFromDisk(get_config_1.getConfig({
dev: program.dev,
filter: program.filter,
peer: program.peer,
prod: program.prod,
source: program.source
dev: args.dev,
filter: args.filter,
peer: args.peer,
prod: args.prod,
source: args.source
}));
var templateObject_1;

@@ -23,5 +23,6 @@ #!/usr/bin/env node

};
var __spread = (this && this.__spread) || function () {
for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));
return ar;
var __spreadArray = (this && this.__spreadArray) || function (to, from) {
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
to[j] = from[i];
return to;
};

@@ -37,20 +38,21 @@ var __importDefault = (this && this.__importDefault) || function (mod) {

var get_config_1 = require("./lib/get-config");
var program = require("commander");
program.description(' List all dependencies required by your packages.');
program.on('--help', function () {
var commander_1 = require("commander");
commander_1.program.description(' List all dependencies required by your packages.');
commander_1.program.on('--help', function () {
console.log(chalk_1["default"](templateObject_1 || (templateObject_1 = __makeTemplateObject(["\nExamples:\n {dim # uses defaults for resolving packages}\n syncpack list\n {dim # uses packages defined by --source when provided}\n syncpack list --source {yellow \"apps/*/package.json\"}\n {dim # multiple globs can be provided like this}\n syncpack list --source {yellow \"apps/*/package.json\"} --source {yellow \"core/*/package.json\"}\n {dim # uses dependencies regular expression defined by --filter when provided}\n syncpack list --filter {yellow \"typescript|tslint\"}\n {dim # only inspect \"devDependencies\"}\n syncpack list --dev\n {dim # only inspect \"devDependencies\" and \"peerDependencies\"}\n syncpack list --dev --peer\n\nResolving Packages:\n 1. If {yellow --source} globs are provided, use those.\n 2. If using Pnpm Workspaces, read {yellow packages} from {yellow pnpm-workspace.yaml} in the root of the project.\n 3. If using Yarn Workspaces, read {yellow workspaces} from {yellow package.json}.\n 4. If using Lerna, read {yellow packages} from {yellow lerna.json}.\n 5. Default to {yellow \"package.json\"} and {yellow \"packages/*/package.json\"}.\n\nReference:\n globs {blue.underline https://github.com/isaacs/node-glob#glob-primer}\n lerna.json {blue.underline https://github.com/lerna/lerna#lernajson}\n Yarn Workspaces {blue.underline https://yarnpkg.com/lang/en/docs/workspaces}\n Pnpm Workspaces {blue.underline https://pnpm.js.org/en/workspaces}\n"], ["\nExamples:\n {dim # uses defaults for resolving packages}\n syncpack list\n {dim # uses packages defined by --source when provided}\n syncpack list --source {yellow \"apps/*/package.json\"}\n {dim # multiple globs can be provided like this}\n syncpack list --source {yellow \"apps/*/package.json\"} --source {yellow \"core/*/package.json\"}\n {dim # uses dependencies regular expression defined by --filter when provided}\n syncpack list --filter {yellow \"typescript|tslint\"}\n {dim # only inspect \"devDependencies\"}\n syncpack list --dev\n {dim # only inspect \"devDependencies\" and \"peerDependencies\"}\n syncpack list --dev --peer\n\nResolving Packages:\n 1. If {yellow --source} globs are provided, use those.\n 2. If using Pnpm Workspaces, read {yellow packages} from {yellow pnpm-workspace.yaml} in the root of the project.\n 3. If using Yarn Workspaces, read {yellow workspaces} from {yellow package.json}.\n 4. If using Lerna, read {yellow packages} from {yellow lerna.json}.\n 5. Default to {yellow \"package.json\"} and {yellow \"packages/*/package.json\"}.\n\nReference:\n globs {blue.underline https://github.com/isaacs/node-glob#glob-primer}\n lerna.json {blue.underline https://github.com/lerna/lerna#lernajson}\n Yarn Workspaces {blue.underline https://yarnpkg.com/lang/en/docs/workspaces}\n Pnpm Workspaces {blue.underline https://pnpm.js.org/en/workspaces}\n"]))));
});
(_a = (_b = (_c = (_d = program
.option.apply(program, __spread(constants_1.option.source)))
.option.apply(_d, __spread(constants_1.option.prod)))
.option.apply(_c, __spread(constants_1.option.dev)))
.option.apply(_b, __spread(constants_1.option.peer)))
.option.apply(_a, __spread(constants_1.option.filter)).parse(process.argv);
(_a = (_b = (_c = (_d = commander_1.program
.option.apply(commander_1.program, __spreadArray([], __read(constants_1.option.source))))
.option.apply(_d, __spreadArray([], __read(constants_1.option.prod))))
.option.apply(_c, __spreadArray([], __read(constants_1.option.dev))))
.option.apply(_b, __spreadArray([], __read(constants_1.option.peer))))
.option.apply(_a, __spreadArray([], __read(constants_1.option.filter))).parse(process.argv);
var args = commander_1.program;
list_1.listFromDisk(get_config_1.getConfig({
dev: program.dev,
filter: program.filter,
peer: program.peer,
prod: program.prod,
source: program.source
dev: args.dev,
filter: args.filter,
peer: args.peer,
prod: args.prod,
source: args.source
}));
var templateObject_1;

@@ -23,5 +23,6 @@ #!/usr/bin/env node

};
var __spread = (this && this.__spread) || function () {
for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));
return ar;
var __spreadArray = (this && this.__spreadArray) || function (to, from) {
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
to[j] = from[i];
return to;
};

@@ -37,24 +38,25 @@ var __importDefault = (this && this.__importDefault) || function (mod) {

var get_config_1 = require("./lib/get-config");
var program = require("commander");
program.description("\n Ensure dependency versions used within \"dependencies\", \"devDependencies\", and\n \"peerDependencies\" follow a consistent format.".replace(/^\n/, ''));
program.on('--help', function () {
var commander_1 = require("commander");
commander_1.program.description("\n Ensure dependency versions used within \"dependencies\", \"devDependencies\", and\n \"peerDependencies\" follow a consistent format.".replace(/^\n/, ''));
commander_1.program.on('--help', function () {
console.log(chalk_1["default"](templateObject_1 || (templateObject_1 = __makeTemplateObject(["\nExamples:\n {dim # uses defaults for resolving packages}\n syncpack set-semver-ranges\n {dim # uses packages defined by --source when provided}\n syncpack set-semver-ranges --source {yellow \"apps/*/package.json\"}\n {dim # multiple globs can be provided like this}\n syncpack set-semver-ranges --source {yellow \"apps/*/package.json\"} --source {yellow \"core/*/package.json\"}\n {dim # uses dependencies regular expression defined by --filter when provided}\n syncpack set-semver-ranges --filter {yellow \"typescript|tslint\"}\n {dim # use ~ range instead of default \"\"}\n syncpack set-semver-ranges --semver-range ~\n {dim # set ~ range in \"devDependencies\"}\n syncpack set-semver-ranges --dev --semver-range ~\n {dim # set ~ range in \"devDependencies\" and \"peerDependencies\"}\n syncpack set-semver-ranges --dev --peer --semver-range ~\n {dim # indent package.json with 4 spaces instead of 2}\n syncpack set-semver-ranges --indent {yellow \" \"}\n\nSupported Ranges:\n < {dim <1.4.2}\n <= {dim <=1.4.2}\n \"\" {dim 1.4.2}\n ~ {dim ~1.4.2}\n ^ {dim ^1.4.2}\n >= {dim >=1.4.2}\n > {dim >1.4.2}\n * {dim *}\n\nResolving Packages:\n 1. If {yellow --source} globs are provided, use those.\n 2. If using Pnpm Workspaces, read {yellow packages} from {yellow pnpm-workspace.yaml} in the root of the project.\n 3. If using Yarn Workspaces, read {yellow workspaces} from {yellow package.json}.\n 4. If using Lerna, read {yellow packages} from {yellow lerna.json}.\n 5. Default to {yellow \"package.json\"} and {yellow \"packages/*/package.json\"}.\n\nReference:\n globs {blue.underline https://github.com/isaacs/node-glob#glob-primer}\n lerna.json {blue.underline https://github.com/lerna/lerna#lernajson}\n Yarn Workspaces {blue.underline https://yarnpkg.com/lang/en/docs/workspaces}\n Pnpm Workspaces {blue.underline https://pnpm.js.org/en/workspaces}\n"], ["\nExamples:\n {dim # uses defaults for resolving packages}\n syncpack set-semver-ranges\n {dim # uses packages defined by --source when provided}\n syncpack set-semver-ranges --source {yellow \"apps/*/package.json\"}\n {dim # multiple globs can be provided like this}\n syncpack set-semver-ranges --source {yellow \"apps/*/package.json\"} --source {yellow \"core/*/package.json\"}\n {dim # uses dependencies regular expression defined by --filter when provided}\n syncpack set-semver-ranges --filter {yellow \"typescript|tslint\"}\n {dim # use ~ range instead of default \"\"}\n syncpack set-semver-ranges --semver-range ~\n {dim # set ~ range in \"devDependencies\"}\n syncpack set-semver-ranges --dev --semver-range ~\n {dim # set ~ range in \"devDependencies\" and \"peerDependencies\"}\n syncpack set-semver-ranges --dev --peer --semver-range ~\n {dim # indent package.json with 4 spaces instead of 2}\n syncpack set-semver-ranges --indent {yellow \" \"}\n\nSupported Ranges:\n < {dim <1.4.2}\n <= {dim <=1.4.2}\n \"\" {dim 1.4.2}\n ~ {dim ~1.4.2}\n ^ {dim ^1.4.2}\n >= {dim >=1.4.2}\n > {dim >1.4.2}\n * {dim *}\n\nResolving Packages:\n 1. If {yellow --source} globs are provided, use those.\n 2. If using Pnpm Workspaces, read {yellow packages} from {yellow pnpm-workspace.yaml} in the root of the project.\n 3. If using Yarn Workspaces, read {yellow workspaces} from {yellow package.json}.\n 4. If using Lerna, read {yellow packages} from {yellow lerna.json}.\n 5. Default to {yellow \"package.json\"} and {yellow \"packages/*/package.json\"}.\n\nReference:\n globs {blue.underline https://github.com/isaacs/node-glob#glob-primer}\n lerna.json {blue.underline https://github.com/lerna/lerna#lernajson}\n Yarn Workspaces {blue.underline https://yarnpkg.com/lang/en/docs/workspaces}\n Pnpm Workspaces {blue.underline https://pnpm.js.org/en/workspaces}\n"]))));
});
(_a = (_b = (_c = (_d = (_e = (_f = program
.option.apply(program, __spread(constants_1.option.source)))
.option.apply(_f, __spread(constants_1.option.prod)))
.option.apply(_e, __spread(constants_1.option.dev)))
.option.apply(_d, __spread(constants_1.option.peer)))
.option.apply(_c, __spread(constants_1.option.filter)))
.option.apply(_b, __spread(constants_1.option.indent)))
.option.apply(_a, __spread(constants_1.option.semverRange)).parse(process.argv);
(_a = (_b = (_c = (_d = (_e = (_f = commander_1.program
.option.apply(commander_1.program, __spreadArray([], __read(constants_1.option.source))))
.option.apply(_f, __spreadArray([], __read(constants_1.option.prod))))
.option.apply(_e, __spreadArray([], __read(constants_1.option.dev))))
.option.apply(_d, __spreadArray([], __read(constants_1.option.peer))))
.option.apply(_c, __spreadArray([], __read(constants_1.option.filter))))
.option.apply(_b, __spreadArray([], __read(constants_1.option.indent))))
.option.apply(_a, __spreadArray([], __read(constants_1.option.semverRange))).parse(process.argv);
var args = commander_1.program;
set_semver_ranges_1.setSemverRangesToDisk(get_config_1.getConfig({
dev: program.dev,
filter: program.filter,
indent: program.indent,
peer: program.peer,
prod: program.prod,
semverRange: program.semverRange,
source: program.source
dev: args.dev,
filter: args.filter,
indent: args.indent,
peer: args.peer,
prod: args.prod,
semverRange: args.semverRange,
source: args.source
}));
var templateObject_1;
#!/usr/bin/env node
"use strict";
exports.__esModule = true;
var program = require("commander");
program
var commander_1 = require("commander");
commander_1.program
.version(require('../package.json').version)
.command('fix-mismatches', 'set dependencies used with different versions to the same version')
.command('format', 'sort and shorten properties according to a convention')
.command('lint-semver-ranges', 'check dependency versions comply with the given semver range format')
.command('list-mismatches', 'list every dependency used with different versions in your packages')
.command('list', 'list every dependency used in your packages', { isDefault: true })
.command('list-mismatches', 'list every dependency used with different versions in your packages')
.command('set-semver-ranges', 'set semver ranges to the given format')
.parse(process.argv);

@@ -18,5 +18,6 @@ "use strict";

};
var __spread = (this && this.__spread) || function () {
for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));
return ar;
var __spreadArray = (this && this.__spreadArray) || function (to, from) {
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
to[j] = from[i];
return to;
};

@@ -30,4 +31,4 @@ exports.__esModule = true;

}
return console.log.apply(console, __spread(args));
return console.log.apply(console, __spreadArray([], __read(args)));
};
exports.log = log;

@@ -0,4 +1,5 @@

import { SyncpackConfig } from '../../constants';
import { InstalledPackage } from './installations/get-dependencies';
export declare const matchesFilter: (options: {
filter: string;
}) => ({ name }: InstalledPackage) => boolean;
declare type Options = Pick<SyncpackConfig, 'filter'>;
export declare const matchesFilter: (options: Options) => ({ name }: InstalledPackage) => boolean;
export {};
"use strict";
exports.__esModule = true;
exports.matchesFilter = void 0;
var matchesFilter = function (options) { return function (_a) {
var name = _a.name;
return name.search(new RegExp(options.filter)) !== -1;
}; };
var matchesFilter = function (options) {
return function (_a) {
var name = _a.name;
return name.search(new RegExp(options.filter)) !== -1;
};
};
exports.matchesFilter = matchesFilter;
import { SyncpackConfig } from '../constants';
import { SourceWrapper } from './lib/get-wrappers';
declare type Options = Pick<SyncpackConfig, 'dev' | 'filter' | 'indent' | 'peer' | 'prod' | 'semverRange' | 'source'>;
export declare const setSemverRange: (range: string, version: string) => string;
export declare const setSemverRanges: (wrapper: SourceWrapper, options: Options) => void;
export declare const setSemverRangesToDisk: (options: Options) => void;
export {};

@@ -14,44 +14,18 @@ "use strict";

exports.__esModule = true;
exports.setSemverRangesToDisk = exports.setSemverRanges = exports.setSemverRange = void 0;
var constants_1 = require("../constants");
exports.setSemverRangesToDisk = exports.setSemverRanges = void 0;
var get_wrappers_1 = require("./lib/get-wrappers");
var get_dependencies_1 = require("./lib/installations/get-dependencies");
var is_semver_1 = require("./lib/is-semver");
var get_installations_1 = require("./lib/installations/get-installations");
var set_semver_range_1 = require("./lib/set-semver-range");
var write_if_changed_1 = require("./lib/write-if-changed");
var setSemverRange = function (range, version) {
if (!is_semver_1.isSemver(version) || !is_semver_1.isValidSemverRange(range)) {
return version;
}
var nextVersion = is_semver_1.isLooseSemver(version) ? version.replace(/\.x/g, '.0') : version;
var from1stNumber = nextVersion.search(/[0-9]/);
var from1stDot = nextVersion.indexOf('.');
return range === constants_1.RANGE_LOOSE
? nextVersion.slice(from1stNumber, from1stDot) + ".x.x"
: "" + range + nextVersion.slice(from1stNumber);
};
exports.setSemverRange = setSemverRange;
var setSemverRanges = function (wrapper, options) {
var e_1, _a, e_2, _b;
var iterator = get_dependencies_1.getDependencies([wrapper], options);
var e_1, _a;
var installationsIterator = get_installations_1.getInstallations([wrapper], options);
var setSemverRange = set_semver_range_1.setSemverRange(options);
try {
for (var iterator_1 = __values(iterator), iterator_1_1 = iterator_1.next(); !iterator_1_1.done; iterator_1_1 = iterator_1.next()) {
var installedPackage = iterator_1_1.value;
if (installedPackage.name.search(new RegExp(options.filter)) !== -1) {
try {
for (var _c = (e_2 = void 0, __values(installedPackage.installations)), _d = _c.next(); !_d.done; _d = _c.next()) {
var installation = _d.value;
var name = installation.name, type = installation.type, version = installation.version;
var dependencies = installation.source.contents[type];
if (dependencies) {
dependencies[name] = exports.setSemverRange(options.semverRange, version);
}
}
}
catch (e_2_1) { e_2 = { error: e_2_1 }; }
finally {
try {
if (_d && !_d.done && (_b = _c["return"])) _b.call(_c);
}
finally { if (e_2) throw e_2.error; }
}
for (var installationsIterator_1 = __values(installationsIterator), installationsIterator_1_1 = installationsIterator_1.next(); !installationsIterator_1_1.done; installationsIterator_1_1 = installationsIterator_1.next()) {
var installation = installationsIterator_1_1.value;
var name = installation.name, type = installation.type, version = installation.version;
var dependencies = installation.source.contents[type];
if (dependencies) {
dependencies[name] = setSemverRange(version);
}

@@ -63,3 +37,3 @@ }

try {
if (iterator_1_1 && !iterator_1_1.done && (_a = iterator_1["return"])) _a.call(iterator_1);
if (installationsIterator_1_1 && !installationsIterator_1_1.done && (_a = installationsIterator_1["return"])) _a.call(installationsIterator_1);
}

@@ -66,0 +40,0 @@ finally { if (e_1) throw e_1.error; }

{
"name": "syncpack",
"description": "Manage multiple package.json files, such as in Lerna Monorepos and Yarn/Pnpm Workspaces",
"version": "5.7.11",
"version": "5.8.12",
"author": "Jamie Mason <jamie@foldleft.io> (https://github.com/JamieMason)",

@@ -10,4 +10,5 @@ "bin": {

"syncpack-format": "dist/bin-format.js",
"syncpack-lint-semver-ranges": "dist/bin-lint-semver-ranges.js",
"syncpack-list": "dist/bin-list.js",
"syncpack-list-mismatches": "dist/bin-list-mismatches.js",
"syncpack-list": "dist/bin-list.js",
"syncpack-set-semver-ranges": "dist/bin-set-semver-ranges.js"

@@ -19,2 +20,3 @@ },

"Aparajita Fishman (https://github.com/aparajita)",
"Artur Wierzbicki (https://github.com/ArturWierzbicki)",
"Jamie Mason (https://github.com/JamieMason)",

@@ -26,29 +28,29 @@ "Luis Vieira (https://github.com/luisvieiragmr)",

"dependencies": {
"chalk": "4.1.0",
"commander": "6.1.0",
"chalk": "4.1.2",
"commander": "8.1.0",
"cosmiconfig": "7.0.0",
"expect-more": "0.8.1",
"fs-extra": "9.1.0",
"glob": "7.1.6",
"read-yaml-file": "2.0.0",
"semver": "7.3.4"
"expect-more": "1.0.1",
"fs-extra": "10.0.0",
"glob": "7.1.7",
"read-yaml-file": "2.1.0",
"semver": "7.3.5"
},
"devDependencies": {
"@types/fs-extra": "9.0.6",
"@types/glob": "7.1.3",
"@types/jest": "26.0.20",
"@types/mock-fs": "4.13.0",
"@types/node": "14.14.22",
"@types/semver": "7.3.4",
"@typescript-eslint/eslint-plugin": "4.14.1",
"@typescript-eslint/parser": "4.14.1",
"eslint": "7.18.0",
"expect-more-jest": "5.2.1",
"jest": "26.6.3",
"mock-fs": "4.13.0",
"@types/fs-extra": "9.0.12",
"@types/glob": "7.1.4",
"@types/jest": "26.0.24",
"@types/mock-fs": "4.13.1",
"@types/node": "16.4.10",
"@types/semver": "7.3.8",
"@typescript-eslint/eslint-plugin": "4.28.5",
"@typescript-eslint/parser": "4.28.5",
"eslint": "7.32.0",
"expect-more-jest": "5.2.2",
"jest": "27.0.6",
"mock-fs": "5.0.0",
"organize-imports-cli": "0.8.0",
"prettier": "2.2.1",
"prettier": "2.3.2",
"rimraf": "3.0.2",
"ts-jest": "26.5.0",
"typescript": "4.1.3"
"ts-jest": "27.0.4",
"typescript": "4.3.5"
},

@@ -55,0 +57,0 @@ "engines": {

@@ -10,16 +10,2 @@ # syncpack

## Table of Contents
- [🌩 Installation](#-installation)
- [📝 Commands](#-commands)
- [fix-mismatches](#fix-mismatches)
- [format](#format)
- [list](#list)
- [list-mismatches](#list-mismatches)
- [set-semver-ranges](#set-semver-ranges)
- [🛠 Configuration File](#-configuration-file)
- [🕵🏾‍♀️ Resolving Packages](#️-resolving-packages)
- [🙋🏿‍♀️ Getting Help](#️-getting-help)
- [👀 Other Projects](#-other-projects)
## 🌩 Installation

@@ -41,9 +27,11 @@

-s, --source [pattern] glob pattern for package.json files to read from
-p, --prod include dependencies
-d, --dev include devDependencies
-P, --peer include peerDependencies
-f, --filter [pattern] regex for dependency filter
-i, --indent [value] override indentation. defaults to " "
-h, --help output usage information
```
-s, --source [pattern] glob pattern for package.json files to read from
-p, --prod include dependencies
-d, --dev include devDependencies
-P, --peer include peerDependencies
-f, --filter [pattern] regex for dependency filter
-i, --indent [value] override indentation. defaults to " "
-h, --help output usage information
```

@@ -83,5 +71,7 @@ </details>

-s, --source [pattern] glob pattern for package.json files to read from
-i, --indent [value] override indentation. defaults to " "
-h, --help output usage information
```
-s, --source [pattern] glob pattern for package.json files to read from
-i, --indent [value] override indentation. defaults to " "
-h, --help output usage information
```

@@ -106,5 +96,6 @@ </details>

### list
### lint-semver-ranges
List all dependencies required by your packages.
Check whether dependency versions used within "dependencies", "devDependencies", and "peerDependencies" follow a
consistent format.

@@ -114,8 +105,11 @@ <details>

-s, --source [pattern] glob pattern for package.json files to read from
-p, --prod include dependencies
-d, --dev include devDependencies
-P, --peer include peerDependencies
-f, --filter [pattern] regex for dependency filter
-h, --help output usage information
```
-s, --source [pattern] glob pattern for package.json files to read from (default: [])
-p, --prod include dependencies
-d, --dev include devDependencies
-P, --peer include peerDependencies
-f, --filter [pattern] regex for dependency filter
-r, --semver-range <range> see supported ranges below. defaults to ""
-h, --help display help for command
```

@@ -129,13 +123,15 @@ </details>

# uses defaults for resolving packages
syncpack list
syncpack lint-semver-ranges
# uses packages defined by --source when provided
syncpack list --source "apps/*/package.json"
syncpack lint-semver-ranges --source "apps/*/package.json"
# multiple globs can be provided like this
syncpack list --source "apps/*/package.json" --source "core/*/package.json"
syncpack lint-semver-ranges --source "apps/*/package.json" --source "core/*/package.json"
# uses dependencies regular expression defined by --filter when provided
syncpack list --filter "typescript|tslint"
# only inspect "devDependencies"
syncpack list --dev
# only inspect "devDependencies" and "peerDependencies"
syncpack list --dev --peer
syncpack lint-semver-ranges --filter "typescript|tslint"
# use ~ range instead of default ""
syncpack lint-semver-ranges --semver-range ~
# use ~ range in "devDependencies"
syncpack lint-semver-ranges --dev --semver-range ~
# use ~ range in "devDependencies" and "peerDependencies"
syncpack lint-semver-ranges --dev --peer --semver-range ~
```

@@ -154,8 +150,10 @@

-s, --source [pattern] glob pattern for package.json files to read from
-p, --prod include dependencies
-d, --dev include devDependencies
-P, --peer include peerDependencies
-f, --filter [pattern] regex for dependency filter
-h, --help output usage information
```
-s, --source [pattern] glob pattern for package.json files to read from
-p, --prod include dependencies
-d, --dev include devDependencies
-P, --peer include peerDependencies
-f, --filter [pattern] regex for dependency filter
-h, --help output usage information
```

@@ -184,2 +182,40 @@ </details>

### list
List all dependencies required by your packages.
<details>
<summary>Options</summary>
```
-s, --source [pattern] glob pattern for package.json files to read from
-p, --prod include dependencies
-d, --dev include devDependencies
-P, --peer include peerDependencies
-f, --filter [pattern] regex for dependency filter
-h, --help output usage information
```
</details>
<details>
<summary>Examples</summary>
```bash
# uses defaults for resolving packages
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"
# uses dependencies regular expression defined by --filter when provided
syncpack list --filter "typescript|tslint"
# only inspect "devDependencies"
syncpack list --dev
# only inspect "devDependencies" and "peerDependencies"
syncpack list --dev --peer
```
</details>
### set-semver-ranges

@@ -193,10 +229,12 @@

-s, --source [pattern] glob pattern for package.json files to read from
-p, --prod include dependencies
-d, --dev include devDependencies
-P, --peer include peerDependencies
-f, --filter [pattern] regex for dependency filter
-i, --indent [value] override indentation. defaults to " "
-r, --semver-range <range> see supported ranges below. defaults to ""
-h, --help output usage information
```
-s, --source [pattern] glob pattern for package.json files to read from
-p, --prod include dependencies
-d, --dev include devDependencies
-P, --peer include peerDependencies
-f, --filter [pattern] regex for dependency filter
-i, --indent [value] override indentation. defaults to " "
-r, --semver-range <range> see supported ranges below. defaults to ""
-h, --help output usage information
```

@@ -203,0 +241,0 @@ </details>

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc