syncpack 10.0.0 → 10.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -0
- package/dist/bin-lint/index.d.ts +2 -0
- package/dist/bin-lint/index.js +39 -0
- package/dist/bin-lint/lint-cli.d.ts +3 -0
- package/dist/bin-lint/lint-cli.js +12 -0
- package/dist/bin.js +3 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -26,6 +26,11 @@ Organise package.json files according to a conventional format, where fields app
|
|
|
26
26
|
order and nested fields are ordered alphabetically. Shorthand properties are used where available,
|
|
27
27
|
such as the `"repository"` and `"bugs"` fields.
|
|
28
28
|
|
|
29
|
+
### [lint](https://jamiemason.github.io/syncpack/lint)
|
|
30
|
+
|
|
31
|
+
Lint all versions and ranges and exit with 0 or 1 based on whether all files match your Syncpack
|
|
32
|
+
configuration file.
|
|
33
|
+
|
|
29
34
|
### [lint-semver-ranges](https://jamiemason.github.io/syncpack/lint-semver-ranges)
|
|
30
35
|
|
|
31
36
|
Check whether dependency versions used within "dependencies", "devDependencies", etc follow a
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
+
};
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
8
|
+
const commander_1 = require("commander");
|
|
9
|
+
const disk_1 = require("../lib/disk");
|
|
10
|
+
const show_help_on_error_1 = require("../lib/show-help-on-error");
|
|
11
|
+
const option_1 = require("../option");
|
|
12
|
+
const lint_cli_1 = require("./lint-cli");
|
|
13
|
+
commander_1.program.description(' lint all versions and ranges');
|
|
14
|
+
commander_1.program.on('--help', () => {
|
|
15
|
+
console.log((0, chalk_1.default) `
|
|
16
|
+
Examples:
|
|
17
|
+
{dim # uses config file for resolving packages}
|
|
18
|
+
syncpack lint
|
|
19
|
+
{dim # uses config file defined by --config when provided}
|
|
20
|
+
syncpack lint --config {yellow ./config/.syncpackrc}
|
|
21
|
+
|
|
22
|
+
Resolving Packages:
|
|
23
|
+
1. If using Pnpm Workspaces, read {yellow packages} from {yellow pnpm-workspace.yaml} in the root of the project.
|
|
24
|
+
2. If using Yarn Workspaces, read {yellow workspaces} from {yellow package.json}.
|
|
25
|
+
3. If using Lerna, read {yellow packages} from {yellow lerna.json}.
|
|
26
|
+
4. Default to {yellow "package.json"} and {yellow "packages/*/package.json"}.
|
|
27
|
+
|
|
28
|
+
Reference:
|
|
29
|
+
globs {blue.underline https://github.com/isaacs/node-glob#glob-primer}
|
|
30
|
+
lerna.json {blue.underline https://github.com/lerna/lerna#lernajson}
|
|
31
|
+
Yarn Workspaces {blue.underline https://yarnpkg.com/lang/en/docs/workspaces}
|
|
32
|
+
Pnpm Workspaces {blue.underline https://pnpm.js.org/en/workspaces}
|
|
33
|
+
`);
|
|
34
|
+
});
|
|
35
|
+
(0, show_help_on_error_1.showHelpOnError)(commander_1.program);
|
|
36
|
+
commander_1.program.option(...option_1.option.config).parse(process.argv);
|
|
37
|
+
(0, lint_cli_1.lintCli)({
|
|
38
|
+
configPath: commander_1.program.opts().config,
|
|
39
|
+
}, disk_1.disk);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.lintCli = void 0;
|
|
4
|
+
const pipe_1 = require("tightrope/fn/pipe");
|
|
5
|
+
const lint_semver_ranges_1 = require("../bin-lint-semver-ranges/lint-semver-ranges");
|
|
6
|
+
const list_mismatches_1 = require("../bin-list-mismatches/list-mismatches");
|
|
7
|
+
const get_context_1 = require("../get-context");
|
|
8
|
+
const exit_if_invalid_1 = require("../lib/exit-if-invalid");
|
|
9
|
+
function lintCli(input, disk) {
|
|
10
|
+
(0, pipe_1.pipe)((0, get_context_1.getContext)(input, disk), list_mismatches_1.listMismatches, lint_semver_ranges_1.lintSemverRanges, exit_if_invalid_1.exitIfInvalid);
|
|
11
|
+
}
|
|
12
|
+
exports.lintCli = lintCli;
|
package/dist/bin.js
CHANGED
|
@@ -9,6 +9,9 @@ commander_1.program
|
|
|
9
9
|
})
|
|
10
10
|
.command('format', 'sort and shorten properties according to a convention', {
|
|
11
11
|
executableFile: './bin-format/index.js',
|
|
12
|
+
})
|
|
13
|
+
.command('lint', 'lint all versions and ranges', {
|
|
14
|
+
executableFile: './bin-lint/index.js',
|
|
12
15
|
})
|
|
13
16
|
.command('lint-semver-ranges', 'check dependency versions comply with the given semver range format', {
|
|
14
17
|
executableFile: './bin-lint-semver-ranges/index.js',
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "syncpack",
|
|
3
3
|
"description": "Consistent dependency versions in large JavaScript Monorepos",
|
|
4
|
-
"version": "10.
|
|
4
|
+
"version": "10.2.0",
|
|
5
5
|
"author": "Jamie Mason <jamie@foldleft.io> (https://github.com/JamieMason)",
|
|
6
6
|
"bin": {
|
|
7
7
|
"syncpack": "dist/bin.js",
|