syncpack 10.5.1 → 10.7.2
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 +8 -5
- package/dist/bin-fix-mismatches/effects.d.ts +2 -0
- package/dist/bin-fix-mismatches/effects.js +112 -0
- package/dist/bin-fix-mismatches/fix-mismatches.d.ts +4 -2
- package/dist/bin-fix-mismatches/fix-mismatches.js +38 -49
- package/dist/bin-fix-mismatches/index.js +28 -4
- package/dist/bin-format/format-cli.d.ts +4 -3
- package/dist/bin-format/format-cli.js +35 -4
- package/dist/bin-format/format.d.ts +3 -2
- package/dist/bin-format/format.js +25 -1
- package/dist/bin-format/index.js +27 -3
- package/dist/bin-lint/index.js +28 -4
- package/dist/bin-lint/lint.d.ts +4 -0
- package/dist/bin-lint/lint.js +44 -0
- package/dist/bin-lint-semver-ranges/effects.d.ts +2 -0
- package/dist/bin-lint-semver-ranges/effects.js +70 -0
- package/dist/bin-lint-semver-ranges/index.js +28 -4
- package/dist/bin-lint-semver-ranges/lint-semver-ranges.d.ts +4 -2
- package/dist/bin-lint-semver-ranges/lint-semver-ranges.js +14 -39
- package/dist/bin-list/effects.d.ts +2 -0
- package/dist/bin-list/effects.js +112 -0
- package/dist/bin-list/index.js +28 -4
- package/dist/bin-list/list.d.ts +4 -2
- package/dist/bin-list/list.js +14 -75
- package/dist/bin-list-mismatches/effects.d.ts +2 -0
- package/dist/bin-list-mismatches/effects.js +136 -0
- package/dist/bin-list-mismatches/index.js +28 -4
- package/dist/bin-list-mismatches/list-mismatches.d.ts +4 -2
- package/dist/bin-list-mismatches/list-mismatches.js +14 -87
- package/dist/bin-prompt/effects.d.ts +2 -0
- package/dist/bin-prompt/effects.js +110 -0
- package/dist/bin-prompt/index.js +28 -4
- package/dist/bin-prompt/prompt.d.ts +4 -0
- package/dist/bin-prompt/prompt.js +42 -0
- package/dist/bin-set-semver-ranges/effects.d.ts +2 -0
- package/dist/bin-set-semver-ranges/effects.js +61 -0
- package/dist/bin-set-semver-ranges/index.js +28 -4
- package/dist/bin-set-semver-ranges/set-semver-ranges.d.ts +4 -2
- package/dist/bin-set-semver-ranges/set-semver-ranges.js +39 -22
- package/dist/bin-update/effects.d.ts +11 -0
- package/dist/bin-update/effects.js +187 -0
- package/dist/bin-update/index.d.ts +2 -0
- package/dist/bin-update/index.js +80 -0
- package/dist/bin-update/update.d.ts +4 -0
- package/dist/bin-update/update.js +47 -0
- package/dist/bin.js +3 -0
- package/dist/config/get-custom-types.d.ts +2 -2
- package/dist/config/get-enabled-types.d.ts +12 -2
- package/dist/config/get-enabled-types.js +38 -4
- package/dist/config/get-filter.d.ts +2 -2
- package/dist/config/get-indent.d.ts +2 -2
- package/dist/config/get-semver-range.d.ts +2 -2
- package/dist/config/get-semver-range.js +4 -4
- package/dist/config/get-sort-az.d.ts +2 -2
- package/dist/config/get-sort-first.d.ts +2 -2
- package/dist/config/get-source.d.ts +2 -2
- package/dist/config/get-source.js +1 -2
- package/dist/config/types.d.ts +8 -6
- package/dist/config/types.js +26 -0
- package/dist/constants.d.ts +1 -1
- package/dist/constants.js +1 -1
- package/dist/create-program/effects.d.ts +40 -0
- package/dist/create-program/effects.js +2 -0
- package/dist/create-program/semver-ranges.d.ts +7 -0
- package/dist/create-program/semver-ranges.js +55 -0
- package/dist/create-program/versions.d.ts +7 -0
- package/dist/create-program/versions.js +70 -0
- package/dist/env/create-env.d.ts +21 -0
- package/dist/env/create-env.js +60 -0
- package/dist/env/default-env.d.ts +18 -0
- package/dist/env/default-env.js +95 -0
- package/dist/env/exit-if-invalid.d.ts +4 -0
- package/dist/env/exit-if-invalid.js +34 -0
- package/dist/env/tags.d.ts +58 -0
- package/dist/env/tags.js +50 -0
- package/dist/env/write-if-changed.d.ts +11 -0
- package/dist/env/write-if-changed.js +73 -0
- package/dist/error-handlers/create-error-handlers.d.ts +19 -0
- package/dist/error-handlers/create-error-handlers.js +57 -0
- package/dist/error-handlers/default-error-handlers.d.ts +2 -0
- package/dist/error-handlers/default-error-handlers.js +57 -0
- package/dist/get-context/index.d.ts +11 -8
- package/dist/get-context/index.js +31 -9
- package/dist/get-package-json-files/get-file-paths.d.ts +17 -8
- package/dist/get-package-json-files/get-file-paths.js +40 -20
- package/dist/get-package-json-files/get-patterns/get-lerna-patterns.d.ts +4 -3
- package/dist/get-package-json-files/get-patterns/get-lerna-patterns.js +31 -8
- package/dist/get-package-json-files/get-patterns/get-pnpm-patterns.d.ts +4 -3
- package/dist/get-package-json-files/get-patterns/get-pnpm-patterns.js +36 -14
- package/dist/get-package-json-files/get-patterns/get-yarn-patterns.d.ts +4 -3
- package/dist/get-package-json-files/get-patterns/get-yarn-patterns.js +37 -9
- package/dist/get-package-json-files/get-patterns/index.d.ts +4 -4
- package/dist/get-package-json-files/get-patterns/index.js +37 -18
- package/dist/get-package-json-files/get-patterns/read-json-safe.d.ts +15 -3
- package/dist/get-package-json-files/get-patterns/read-json-safe.js +36 -10
- package/dist/get-package-json-files/index.d.ts +7 -4
- package/dist/get-package-json-files/index.js +27 -9
- package/dist/get-package-json-files/instance.js +2 -2
- package/dist/get-package-json-files/package-json-file.d.ts +6 -10
- package/dist/get-package-json-files/package-json-file.js +5 -21
- package/dist/get-semver-groups/filtered-out.d.ts +12 -6
- package/dist/get-semver-groups/filtered-out.js +40 -14
- package/dist/get-semver-groups/ignored.d.ts +10 -4
- package/dist/get-semver-groups/ignored.js +34 -8
- package/dist/get-semver-groups/index.d.ts +80 -28
- package/dist/get-semver-groups/index.js +94 -42
- package/dist/get-semver-groups/with-range.d.ts +12 -5
- package/dist/get-semver-groups/with-range.js +49 -25
- package/dist/get-version-groups/banned.d.ts +10 -4
- package/dist/get-version-groups/banned.js +34 -8
- package/dist/get-version-groups/filtered-out.d.ts +12 -6
- package/dist/get-version-groups/filtered-out.js +40 -14
- package/dist/get-version-groups/ignored.d.ts +10 -4
- package/dist/get-version-groups/ignored.js +34 -8
- package/dist/get-version-groups/index.d.ts +131 -47
- package/dist/get-version-groups/index.js +123 -51
- package/dist/get-version-groups/lib/get-highest-version.js +2 -2
- package/dist/get-version-groups/lib/get-lowest-version.js +2 -2
- package/dist/get-version-groups/lib/get-range-score.js +1 -3
- package/dist/get-version-groups/lib/sort.js +3 -3
- package/dist/get-version-groups/pinned.d.ts +10 -4
- package/dist/get-version-groups/pinned.js +39 -16
- package/dist/get-version-groups/same-range.d.ts +10 -4
- package/dist/get-version-groups/same-range.js +38 -15
- package/dist/get-version-groups/snapped-to.d.ts +10 -4
- package/dist/get-version-groups/snapped-to.js +41 -16
- package/dist/get-version-groups/standard.d.ts +12 -5
- package/dist/get-version-groups/standard.js +63 -39
- package/dist/guards/can-add-to-group.d.ts +4 -0
- package/dist/guards/can-add-to-group.js +15 -0
- package/dist/guards/is-loose-semver.d.ts +1 -0
- package/dist/guards/is-loose-semver.js +9 -0
- package/dist/guards/is-semver.d.ts +1 -0
- package/dist/guards/is-semver.js +16 -0
- package/dist/guards/is-supported.d.ts +1 -0
- package/dist/guards/is-supported.js +17 -0
- package/dist/guards/is-valid-semver-range.d.ts +2 -0
- package/dist/guards/is-valid-semver-range.js +17 -0
- package/dist/lib/$R.js +2 -2
- package/dist/lib/log-group-header.d.ts +6 -0
- package/dist/lib/log-group-header.js +34 -0
- package/dist/lib/log-verbose.d.ts +1 -0
- package/dist/lib/log-verbose.js +24 -0
- package/dist/lib/set-semver-range.d.ts +1 -0
- package/dist/lib/set-semver-range.js +14 -6
- package/dist/option.js +1 -4
- package/dist/strategy/lib/get-non-empty-string-prop.js +2 -2
- package/dist/strategy/name-and-version-props.js +5 -5
- package/dist/strategy/named-version-string.js +4 -4
- package/dist/strategy/unnamed-version-string.js +4 -4
- package/dist/strategy/versions-by-name.js +3 -3
- package/package.json +28 -18
- package/dist/bin-fix-mismatches/fix-mismatches-cli.d.ts +0 -3
- package/dist/bin-fix-mismatches/fix-mismatches-cli.js +0 -12
- package/dist/bin-lint/lint-cli.d.ts +0 -3
- package/dist/bin-lint/lint-cli.js +0 -12
- package/dist/bin-lint-semver-ranges/lint-semver-ranges-cli.d.ts +0 -3
- package/dist/bin-lint-semver-ranges/lint-semver-ranges-cli.js +0 -11
- package/dist/bin-list/list-cli.d.ts +0 -3
- package/dist/bin-list/list-cli.js +0 -11
- package/dist/bin-list-mismatches/list-mismatches-cli.d.ts +0 -3
- package/dist/bin-list-mismatches/list-mismatches-cli.js +0 -11
- package/dist/bin-prompt/prompt-cli.d.ts +0 -3
- package/dist/bin-prompt/prompt-cli.js +0 -50
- package/dist/bin-set-semver-ranges/set-semver-ranges-cli.d.ts +0 -3
- package/dist/bin-set-semver-ranges/set-semver-ranges-cli.js +0 -11
- package/dist/get-package-json-files/get-patterns/read-yaml-safe.d.ts +0 -3
- package/dist/get-package-json-files/get-patterns/read-yaml-safe.js +0 -12
- package/dist/get-semver-groups/catch-all.d.ts +0 -4
- package/dist/get-semver-groups/catch-all.js +0 -11
- package/dist/get-version-groups/catch-all.d.ts +0 -4
- package/dist/get-version-groups/catch-all.js +0 -11
- package/dist/lib/disk.d.ts +0 -21
- package/dist/lib/disk.js +0 -79
- package/dist/lib/exit-if-invalid.d.ts +0 -2
- package/dist/lib/exit-if-invalid.js +0 -10
- package/dist/lib/is-semver.d.ts +0 -6
- package/dist/lib/is-semver.js +0 -49
- package/dist/lib/log.d.ts +0 -5
- package/dist/lib/log.js +0 -51
- package/dist/lib/newlines.d.ts +0 -6
- package/dist/lib/newlines.js +0 -24
- package/dist/lib/print-strings.d.ts +0 -1
- package/dist/lib/print-strings.js +0 -7
- package/dist/lib/write-if-changed.d.ts +0 -2
- package/dist/lib/write-if-changed.js +0 -21
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.7.2",
|
|
5
5
|
"author": "Jamie Mason <jamie@foldleft.io> (https://github.com/JamieMason)",
|
|
6
6
|
"bin": {
|
|
7
7
|
"syncpack": "dist/bin.js",
|
|
@@ -12,7 +12,8 @@
|
|
|
12
12
|
"syncpack-list": "dist/bin-list/index.js",
|
|
13
13
|
"syncpack-list-mismatches": "dist/bin-list-mismatches/index.js",
|
|
14
14
|
"syncpack-prompt": "dist/bin-prompt/index.js",
|
|
15
|
-
"syncpack-set-semver-ranges": "dist/bin-set-semver-ranges/index.js"
|
|
15
|
+
"syncpack-set-semver-ranges": "dist/bin-set-semver-ranges/index.js",
|
|
16
|
+
"syncpack-update": "dist/bin-update/index.js"
|
|
16
17
|
},
|
|
17
18
|
"bugs": "https://github.com/JamieMason/syncpack/issues",
|
|
18
19
|
"contributors": [
|
|
@@ -30,40 +31,46 @@
|
|
|
30
31
|
"Tom Fletcher (https://github.com/tom-fletcher)"
|
|
31
32
|
],
|
|
32
33
|
"dependencies": {
|
|
34
|
+
"@effect/data": "0.12.9",
|
|
35
|
+
"@effect/io": "0.27.0",
|
|
36
|
+
"@effect/match": "0.24.5",
|
|
37
|
+
"@effect/schema": "0.21.0",
|
|
33
38
|
"chalk": "4.1.2",
|
|
34
|
-
"commander": "
|
|
35
|
-
"cosmiconfig": "8.
|
|
39
|
+
"commander": "11.0.0",
|
|
40
|
+
"cosmiconfig": "8.2.0",
|
|
36
41
|
"enquirer": "2.3.6",
|
|
37
42
|
"fs-extra": "11.1.1",
|
|
38
|
-
"
|
|
39
|
-
"minimatch": "9.0.
|
|
43
|
+
"globby": "11.1.0",
|
|
44
|
+
"minimatch": "9.0.2",
|
|
45
|
+
"ora": "5.4.1",
|
|
46
|
+
"prompts": "2.4.2",
|
|
40
47
|
"read-yaml-file": "2.1.0",
|
|
41
|
-
"semver": "7.5.
|
|
48
|
+
"semver": "7.5.3",
|
|
42
49
|
"tightrope": "0.1.0",
|
|
43
50
|
"ts-toolbelt": "9.6.0"
|
|
44
51
|
},
|
|
45
52
|
"devDependencies": {
|
|
46
|
-
"@tsconfig/
|
|
53
|
+
"@tsconfig/node18": "18.2.0",
|
|
47
54
|
"@types/fs-extra": "11.0.1",
|
|
48
|
-
"@types/glob": "8.1.0",
|
|
49
55
|
"@types/jest": "29.5.2",
|
|
50
56
|
"@types/node": "14.18.36",
|
|
57
|
+
"@types/prompts": "2.4.4",
|
|
51
58
|
"@types/semver": "7.5.0",
|
|
52
|
-
"@typescript-eslint/eslint-plugin": "5.
|
|
53
|
-
"@typescript-eslint/parser": "5.
|
|
54
|
-
"eslint": "8.
|
|
59
|
+
"@typescript-eslint/eslint-plugin": "5.60.1",
|
|
60
|
+
"@typescript-eslint/parser": "5.60.1",
|
|
61
|
+
"eslint": "8.44.0",
|
|
55
62
|
"eslint-plugin-import": "2.27.5",
|
|
56
|
-
"eslint-plugin-jest": "27.2.
|
|
63
|
+
"eslint-plugin-jest": "27.2.2",
|
|
57
64
|
"expect-more-jest": "5.5.0",
|
|
58
65
|
"jest": "29.5.0",
|
|
59
66
|
"prettier": "2.8.8",
|
|
60
67
|
"rimraf": "5.0.1",
|
|
61
|
-
"ts-jest": "29.1.
|
|
68
|
+
"ts-jest": "29.1.1",
|
|
62
69
|
"ts-node": "10.9.1",
|
|
63
|
-
"typescript": "5.1.
|
|
70
|
+
"typescript": "5.1.6"
|
|
64
71
|
},
|
|
65
72
|
"engines": {
|
|
66
|
-
"node": ">=
|
|
73
|
+
"node": ">=18"
|
|
67
74
|
},
|
|
68
75
|
"files": [
|
|
69
76
|
"dist"
|
|
@@ -94,16 +101,19 @@
|
|
|
94
101
|
"repository": "JamieMason/syncpack",
|
|
95
102
|
"resolutions": {
|
|
96
103
|
"chalk": "4.1.2",
|
|
104
|
+
"globby": "11.1.0",
|
|
97
105
|
"string-width": "<5.0.0",
|
|
98
106
|
"strip-ansi": "<7.0.0",
|
|
99
107
|
"wrap-ansi": "<8.0.0"
|
|
100
108
|
},
|
|
101
109
|
"scripts": {
|
|
102
|
-
"build": "rm -rf ./dist && tsc --project .",
|
|
110
|
+
"build": "rm -rf ./dist && tsc --project tsconfig.build.json",
|
|
103
111
|
"format": "yarn format:lint && yarn format:source",
|
|
104
112
|
"format:lint": "yarn lint --fix",
|
|
105
113
|
"format:source": "prettier --write .",
|
|
106
|
-
"lint": "
|
|
114
|
+
"lint": "yarn lint:ts && yarn lint:eslint",
|
|
115
|
+
"lint:eslint": "eslint --ext .ts .",
|
|
116
|
+
"lint:ts": "tsc --noEmit --project tsconfig.json",
|
|
107
117
|
"prepack": "yarn build",
|
|
108
118
|
"test": "jest src test"
|
|
109
119
|
},
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.fixMismatchesCli = void 0;
|
|
4
|
-
const pipe_1 = require("tightrope/fn/pipe");
|
|
5
|
-
const get_context_1 = require("../get-context");
|
|
6
|
-
const exit_if_invalid_1 = require("../lib/exit-if-invalid");
|
|
7
|
-
const write_if_changed_1 = require("../lib/write-if-changed");
|
|
8
|
-
const fix_mismatches_1 = require("./fix-mismatches");
|
|
9
|
-
function fixMismatchesCli(input, disk) {
|
|
10
|
-
(0, pipe_1.pipe)((0, get_context_1.getContext)(input, disk), fix_mismatches_1.fixMismatches, write_if_changed_1.writeIfChanged, exit_if_invalid_1.exitIfInvalid);
|
|
11
|
-
}
|
|
12
|
-
exports.fixMismatchesCli = fixMismatchesCli;
|
|
@@ -1,12 +0,0 @@
|
|
|
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;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.lintSemverRangesCli = void 0;
|
|
4
|
-
const pipe_1 = require("tightrope/fn/pipe");
|
|
5
|
-
const get_context_1 = require("../get-context");
|
|
6
|
-
const exit_if_invalid_1 = require("../lib/exit-if-invalid");
|
|
7
|
-
const lint_semver_ranges_1 = require("./lint-semver-ranges");
|
|
8
|
-
function lintSemverRangesCli(input, disk) {
|
|
9
|
-
(0, pipe_1.pipe)((0, get_context_1.getContext)(input, disk), lint_semver_ranges_1.lintSemverRanges, exit_if_invalid_1.exitIfInvalid);
|
|
10
|
-
}
|
|
11
|
-
exports.lintSemverRangesCli = lintSemverRangesCli;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.listCli = void 0;
|
|
4
|
-
const pipe_1 = require("tightrope/fn/pipe");
|
|
5
|
-
const get_context_1 = require("../get-context");
|
|
6
|
-
const exit_if_invalid_1 = require("../lib/exit-if-invalid");
|
|
7
|
-
const list_1 = require("./list");
|
|
8
|
-
function listCli(input, disk) {
|
|
9
|
-
(0, pipe_1.pipe)((0, get_context_1.getContext)(input, disk), list_1.list, exit_if_invalid_1.exitIfInvalid);
|
|
10
|
-
}
|
|
11
|
-
exports.listCli = listCli;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.listMismatchesCli = void 0;
|
|
4
|
-
const pipe_1 = require("tightrope/fn/pipe");
|
|
5
|
-
const get_context_1 = require("../get-context");
|
|
6
|
-
const exit_if_invalid_1 = require("../lib/exit-if-invalid");
|
|
7
|
-
const list_mismatches_1 = require("./list-mismatches");
|
|
8
|
-
function listMismatchesCli(input, disk) {
|
|
9
|
-
(0, pipe_1.pipe)((0, get_context_1.getContext)(input, disk), list_mismatches_1.listMismatches, exit_if_invalid_1.exitIfInvalid);
|
|
10
|
-
}
|
|
11
|
-
exports.listMismatchesCli = listMismatchesCli;
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.promptCli = void 0;
|
|
7
|
-
const chalk_1 = __importDefault(require("chalk"));
|
|
8
|
-
const get_context_1 = require("../get-context");
|
|
9
|
-
const get_version_groups_1 = require("../get-version-groups");
|
|
10
|
-
const get_unique_versions_1 = require("../get-version-groups/lib/get-unique-versions");
|
|
11
|
-
const sort_by_name_1 = require("../lib/sort-by-name");
|
|
12
|
-
const write_if_changed_1 = require("../lib/write-if-changed");
|
|
13
|
-
async function promptCli(input, disk) {
|
|
14
|
-
const ctx = (0, get_context_1.getContext)(input, disk);
|
|
15
|
-
const versionGroups = (0, get_version_groups_1.getVersionGroups)(ctx);
|
|
16
|
-
for (const versionGroup of versionGroups) {
|
|
17
|
-
const reports = versionGroup.inspect().sort(sort_by_name_1.sortByName);
|
|
18
|
-
for (const report of reports) {
|
|
19
|
-
switch (report.status) {
|
|
20
|
-
case 'SAME_RANGE_MISMATCH':
|
|
21
|
-
case 'UNSUPPORTED_MISMATCH': {
|
|
22
|
-
const OTHER = chalk_1.default.dim('Other');
|
|
23
|
-
const SKIP = chalk_1.default.dim('Skip this dependency');
|
|
24
|
-
const chosenVersion = await disk.askForChoice({
|
|
25
|
-
message: (0, chalk_1.default) `${report.name} {dim Choose a version to replace the others}`,
|
|
26
|
-
choices: [...(0, get_unique_versions_1.getUniqueVersions)(report.instances), OTHER, SKIP],
|
|
27
|
-
});
|
|
28
|
-
if (chosenVersion === SKIP) {
|
|
29
|
-
continue;
|
|
30
|
-
}
|
|
31
|
-
else if (chosenVersion === OTHER) {
|
|
32
|
-
const newVersion = await disk.askForInput({
|
|
33
|
-
message: (0, chalk_1.default) `${report.name} {dim Enter a new version to replace the others}`,
|
|
34
|
-
});
|
|
35
|
-
report.instances.forEach((instance) => {
|
|
36
|
-
instance.setVersion(newVersion);
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
else {
|
|
40
|
-
report.instances.forEach((instance) => {
|
|
41
|
-
instance.setVersion(chosenVersion);
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
(0, write_if_changed_1.writeIfChanged)(ctx);
|
|
49
|
-
}
|
|
50
|
-
exports.promptCli = promptCli;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.setSemverRangesCli = void 0;
|
|
4
|
-
const pipe_1 = require("tightrope/fn/pipe");
|
|
5
|
-
const get_context_1 = require("../get-context");
|
|
6
|
-
const write_if_changed_1 = require("../lib/write-if-changed");
|
|
7
|
-
const set_semver_ranges_1 = require("./set-semver-ranges");
|
|
8
|
-
function setSemverRangesCli(input, disk) {
|
|
9
|
-
(0, pipe_1.pipe)((0, get_context_1.getContext)(input, disk), set_semver_ranges_1.setSemverRanges, write_if_changed_1.writeIfChanged);
|
|
10
|
-
}
|
|
11
|
-
exports.setSemverRangesCli = setSemverRangesCli;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.readYamlSafe = void 0;
|
|
4
|
-
const pipe_1 = require("tightrope/fn/pipe");
|
|
5
|
-
const from_try_1 = require("tightrope/result/from-try");
|
|
6
|
-
const map_err_1 = require("tightrope/result/map-err");
|
|
7
|
-
function readYamlSafe(disk) {
|
|
8
|
-
return function readYamlSafe(filePath) {
|
|
9
|
-
return (0, pipe_1.pipe)((0, from_try_1.fromTry)(() => disk.readYamlFileSync(filePath)), (0, map_err_1.mapErr)(() => new Error(`Failed to read YAML file at ${filePath}`)));
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
exports.readYamlSafe = readYamlSafe;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CatchAllSemverGroup = void 0;
|
|
4
|
-
const with_range_1 = require("./with-range");
|
|
5
|
-
class CatchAllSemverGroup extends with_range_1.WithRangeSemverGroup {
|
|
6
|
-
constructor() {
|
|
7
|
-
super(...arguments);
|
|
8
|
-
this._tag = 'CatchAll';
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
exports.CatchAllSemverGroup = CatchAllSemverGroup;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CatchAllVersionGroup = void 0;
|
|
4
|
-
const standard_1 = require("./standard");
|
|
5
|
-
class CatchAllVersionGroup extends standard_1.StandardVersionGroup {
|
|
6
|
-
constructor() {
|
|
7
|
-
super(...arguments);
|
|
8
|
-
this._tag = 'CatchAll';
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
exports.CatchAllVersionGroup = CatchAllVersionGroup;
|
package/dist/lib/disk.d.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { O } from 'ts-toolbelt';
|
|
2
|
-
import type { RcConfig } from '../config/types';
|
|
3
|
-
export type Disk = {
|
|
4
|
-
askForChoice: (opts: {
|
|
5
|
-
message: string;
|
|
6
|
-
choices: string[];
|
|
7
|
-
}) => Promise<string>;
|
|
8
|
-
askForInput: (opts: {
|
|
9
|
-
message: string;
|
|
10
|
-
}) => Promise<string>;
|
|
11
|
-
globSync: (pattern: string) => string[];
|
|
12
|
-
process: {
|
|
13
|
-
exit: (code: number) => void;
|
|
14
|
-
};
|
|
15
|
-
readConfigFileSync: (configPath?: string) => O.Partial<RcConfig, 'deep'>;
|
|
16
|
-
readFileSync: (filePath: string) => string;
|
|
17
|
-
readYamlFileSync: <T = unknown>(filePath: string) => T;
|
|
18
|
-
removeSync: (filePath: string) => void;
|
|
19
|
-
writeFileSync: (filePath: string, contents: string) => void;
|
|
20
|
-
};
|
|
21
|
-
export declare const disk: Disk;
|
package/dist/lib/disk.js
DELETED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.disk = void 0;
|
|
4
|
-
const cosmiconfig_1 = require("cosmiconfig");
|
|
5
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
6
|
-
// @ts-ignore Select *does* exist
|
|
7
|
-
const enquirer_1 = require("enquirer");
|
|
8
|
-
const fs_extra_1 = require("fs-extra");
|
|
9
|
-
const glob_1 = require("glob");
|
|
10
|
-
const path_1 = require("path");
|
|
11
|
-
const read_yaml_file_1 = require("read-yaml-file");
|
|
12
|
-
const is_non_empty_object_1 = require("tightrope/guard/is-non-empty-object");
|
|
13
|
-
const constants_1 = require("../constants");
|
|
14
|
-
const log_1 = require("./log");
|
|
15
|
-
const client = (0, cosmiconfig_1.cosmiconfigSync)('syncpack');
|
|
16
|
-
exports.disk = {
|
|
17
|
-
askForChoice({ message, choices }) {
|
|
18
|
-
return new enquirer_1.Select({ name: 'choice', message, choices })
|
|
19
|
-
.run()
|
|
20
|
-
.catch(console.error);
|
|
21
|
-
},
|
|
22
|
-
askForInput({ message }) {
|
|
23
|
-
return new enquirer_1.Input({ message }).run().catch(console.error);
|
|
24
|
-
},
|
|
25
|
-
globSync(pattern) {
|
|
26
|
-
(0, log_1.verbose)('globSync(', pattern, ')');
|
|
27
|
-
return (0, glob_1.sync)(pattern, {
|
|
28
|
-
ignore: '**/node_modules/**',
|
|
29
|
-
absolute: true,
|
|
30
|
-
cwd: constants_1.CWD,
|
|
31
|
-
});
|
|
32
|
-
},
|
|
33
|
-
process: {
|
|
34
|
-
exit(code) {
|
|
35
|
-
(0, log_1.verbose)('exit(', code, ')');
|
|
36
|
-
process.exit(code);
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
readConfigFileSync(configPath) {
|
|
40
|
-
(0, log_1.verbose)('readConfigFileSync(', configPath, ')');
|
|
41
|
-
try {
|
|
42
|
-
const result = configPath ? client.load(configPath) : client.search();
|
|
43
|
-
if (result === null) {
|
|
44
|
-
const rcPath = (0, path_1.join)(constants_1.CWD, 'package.json');
|
|
45
|
-
const pjson = (0, fs_extra_1.readJsonSync)(rcPath, { throws: false });
|
|
46
|
-
const rcConfig = pjson?.config?.syncpack;
|
|
47
|
-
if ((0, is_non_empty_object_1.isNonEmptyObject)(rcConfig))
|
|
48
|
-
return rcConfig;
|
|
49
|
-
(0, log_1.verbose)('no config file found');
|
|
50
|
-
return {};
|
|
51
|
-
}
|
|
52
|
-
const rcPath = result.filepath;
|
|
53
|
-
const rcConfig = result.config;
|
|
54
|
-
(0, log_1.verbose)('.syncpackrc path:', rcPath);
|
|
55
|
-
(0, log_1.verbose)('.syncpackrc contents:', rcConfig);
|
|
56
|
-
return rcConfig;
|
|
57
|
-
}
|
|
58
|
-
catch (err) {
|
|
59
|
-
(0, log_1.verbose)('no config file found at:', configPath);
|
|
60
|
-
return {};
|
|
61
|
-
}
|
|
62
|
-
},
|
|
63
|
-
readFileSync(filePath) {
|
|
64
|
-
(0, log_1.verbose)('readFileSync(', filePath, ')');
|
|
65
|
-
return (0, fs_extra_1.readFileSync)(filePath, { encoding: 'utf8' });
|
|
66
|
-
},
|
|
67
|
-
readYamlFileSync(filePath) {
|
|
68
|
-
(0, log_1.verbose)('readYamlFileSync(', filePath, ')');
|
|
69
|
-
return (0, read_yaml_file_1.sync)(filePath);
|
|
70
|
-
},
|
|
71
|
-
removeSync(filePath) {
|
|
72
|
-
(0, log_1.verbose)('removeSync(', filePath, ')');
|
|
73
|
-
(0, fs_extra_1.removeSync)(filePath);
|
|
74
|
-
},
|
|
75
|
-
writeFileSync(filePath, contents) {
|
|
76
|
-
(0, log_1.verbose)('writeFileSync(', filePath, contents, ')');
|
|
77
|
-
(0, fs_extra_1.writeFileSync)(filePath, contents);
|
|
78
|
-
},
|
|
79
|
-
};
|
package/dist/lib/is-semver.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { SemverRange } from '../config/types';
|
|
2
|
-
export declare function isValidSemverRange(value: unknown): value is SemverRange;
|
|
3
|
-
export declare function isSupported(version: unknown): version is string;
|
|
4
|
-
export declare function isWorkspaceProtocol(version: unknown): boolean;
|
|
5
|
-
export declare function isSemver(version: unknown): boolean;
|
|
6
|
-
export declare function isLooseSemver(version: unknown): boolean;
|
package/dist/lib/is-semver.js
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isLooseSemver = exports.isSemver = exports.isWorkspaceProtocol = exports.isSupported = exports.isValidSemverRange = void 0;
|
|
4
|
-
const is_string_1 = require("tightrope/guard/is-string");
|
|
5
|
-
const constants_1 = require("../constants");
|
|
6
|
-
function isValidSemverRange(value) {
|
|
7
|
-
return (value === constants_1.RANGE.ANY ||
|
|
8
|
-
value === constants_1.RANGE.EXACT ||
|
|
9
|
-
value === constants_1.RANGE.GT ||
|
|
10
|
-
value === constants_1.RANGE.GTE ||
|
|
11
|
-
value === constants_1.RANGE.LOOSE ||
|
|
12
|
-
value === constants_1.RANGE.LT ||
|
|
13
|
-
value === constants_1.RANGE.LTE ||
|
|
14
|
-
value === constants_1.RANGE.MINOR ||
|
|
15
|
-
value === constants_1.RANGE.PATCH ||
|
|
16
|
-
value === constants_1.RANGE.WORKSPACE);
|
|
17
|
-
}
|
|
18
|
-
exports.isValidSemverRange = isValidSemverRange;
|
|
19
|
-
function isSupported(version) {
|
|
20
|
-
return version === '*' || isSemver(version) || isWorkspaceProtocol(version);
|
|
21
|
-
}
|
|
22
|
-
exports.isSupported = isSupported;
|
|
23
|
-
function isWorkspaceProtocol(version) {
|
|
24
|
-
if (!(0, is_string_1.isString)(version))
|
|
25
|
-
return false;
|
|
26
|
-
if (!version.startsWith('workspace:'))
|
|
27
|
-
return false;
|
|
28
|
-
const value = version.replace(/^workspace:/, '');
|
|
29
|
-
return value === '*' || isSemver(value);
|
|
30
|
-
}
|
|
31
|
-
exports.isWorkspaceProtocol = isWorkspaceProtocol;
|
|
32
|
-
function isSemver(version) {
|
|
33
|
-
const range = '(~|\\^|>=|>|<=|<)?';
|
|
34
|
-
const ints = '[0-9]+';
|
|
35
|
-
const intsOrX = '([0-9]+|x)';
|
|
36
|
-
const dot = '\\.';
|
|
37
|
-
const major = new RegExp(`^${range}${ints}$`);
|
|
38
|
-
const minor = new RegExp(`^${range}${ints}${dot}${intsOrX}$`);
|
|
39
|
-
const patch = new RegExp(`^${range}${ints}${dot}${intsOrX}${dot}${intsOrX}$`);
|
|
40
|
-
return ((0, is_string_1.isString)(version) &&
|
|
41
|
-
(version.search(major) !== -1 ||
|
|
42
|
-
version.search(minor) !== -1 ||
|
|
43
|
-
version.search(patch) !== -1));
|
|
44
|
-
}
|
|
45
|
-
exports.isSemver = isSemver;
|
|
46
|
-
function isLooseSemver(version) {
|
|
47
|
-
return ((0, is_string_1.isString)(version) && isSemver(version) && version.search(/\.x(\.|$)/) !== -1);
|
|
48
|
-
}
|
|
49
|
-
exports.isLooseSemver = isLooseSemver;
|
package/dist/lib/log.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { AnySemverGroup } from '../get-semver-groups';
|
|
2
|
-
import type { AnyVersionGroup } from '../get-version-groups';
|
|
3
|
-
export declare function verbose(...values: unknown[]): void;
|
|
4
|
-
export declare function semverGroupHeader(group: AnySemverGroup, i: number): void;
|
|
5
|
-
export declare function versionGroupHeader(group: AnyVersionGroup, i: number): void;
|
package/dist/lib/log.js
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.versionGroupHeader = exports.semverGroupHeader = exports.verbose = void 0;
|
|
7
|
-
const chalk_1 = __importDefault(require("chalk"));
|
|
8
|
-
const is_string_1 = require("tightrope/guard/is-string");
|
|
9
|
-
const util_1 = require("util");
|
|
10
|
-
const constants_1 = require("../constants");
|
|
11
|
-
function verbose(...values) {
|
|
12
|
-
/* istanbul ignore if */
|
|
13
|
-
if (process.env.SYNCPACK_VERBOSE) {
|
|
14
|
-
console.info(chalk_1.default.yellow(constants_1.ICON.debug), ...values.map((value) => (0, is_string_1.isString)(value)
|
|
15
|
-
? chalk_1.default.yellow(value)
|
|
16
|
-
: (0, util_1.inspect)(value, {
|
|
17
|
-
colors: true,
|
|
18
|
-
compact: true,
|
|
19
|
-
depth: 20,
|
|
20
|
-
showHidden: false,
|
|
21
|
-
})));
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
exports.verbose = verbose;
|
|
25
|
-
function semverGroupHeader(group, i) {
|
|
26
|
-
logHeader(group, 'Semver', i);
|
|
27
|
-
}
|
|
28
|
-
exports.semverGroupHeader = semverGroupHeader;
|
|
29
|
-
function versionGroupHeader(group, i) {
|
|
30
|
-
logHeader(group, 'Version', i);
|
|
31
|
-
}
|
|
32
|
-
exports.versionGroupHeader = versionGroupHeader;
|
|
33
|
-
function logHeader(group, type, i) {
|
|
34
|
-
const customLabel = group.config.label;
|
|
35
|
-
const labelWhenDefault = group._tag === 'CatchAll' ? `Default ${type} Group` : '';
|
|
36
|
-
const anonymousLabel = `${type} Group ${i + 1}`;
|
|
37
|
-
const label = (customLabel || labelWhenDefault || anonymousLabel).trim();
|
|
38
|
-
const hasNewLines = label.search(/[\r\n]/) !== -1;
|
|
39
|
-
const header = hasNewLines ? formatMultiLine(label) : formatSingleLine(label);
|
|
40
|
-
console.log(chalk_1.default.blue(header));
|
|
41
|
-
}
|
|
42
|
-
function formatSingleLine(label) {
|
|
43
|
-
const leftSide = `= ${label} `;
|
|
44
|
-
const dividerWidth = 80 - leftSide.length;
|
|
45
|
-
const rightSide = dividerWidth > 0 ? '='.repeat(dividerWidth) : '';
|
|
46
|
-
return `${leftSide}${rightSide}`;
|
|
47
|
-
}
|
|
48
|
-
function formatMultiLine(label) {
|
|
49
|
-
const reindented = label.replace(/^\s+/gm, ' ');
|
|
50
|
-
return `= ${reindented}`;
|
|
51
|
-
}
|
package/dist/lib/newlines.d.ts
DELETED
package/dist/lib/newlines.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.newlines = void 0;
|
|
4
|
-
const os_1 = require("os");
|
|
5
|
-
const CR = '\r';
|
|
6
|
-
const CRLF = '\r\n';
|
|
7
|
-
const LF = '\n';
|
|
8
|
-
exports.newlines = {
|
|
9
|
-
detect(source) {
|
|
10
|
-
const cr = source.split(CR).length;
|
|
11
|
-
const lf = source.split(LF).length;
|
|
12
|
-
const crlf = source.split(CRLF).length;
|
|
13
|
-
if (cr + lf === 0)
|
|
14
|
-
return os_1.EOL;
|
|
15
|
-
if (crlf === cr && crlf === lf)
|
|
16
|
-
return CRLF;
|
|
17
|
-
if (cr > lf)
|
|
18
|
-
return CR;
|
|
19
|
-
return LF;
|
|
20
|
-
},
|
|
21
|
-
fix(source, lineEnding) {
|
|
22
|
-
return source.replace(/\r\n|\n|\r/g, lineEnding);
|
|
23
|
-
},
|
|
24
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function printStrings(strings: string[]): string;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.writeIfChanged = void 0;
|
|
7
|
-
const chalk_1 = __importDefault(require("chalk"));
|
|
8
|
-
const constants_1 = require("../constants");
|
|
9
|
-
function writeIfChanged(ctx) {
|
|
10
|
-
ctx.packageJsonFiles.forEach((packageJsonFile) => {
|
|
11
|
-
if (packageJsonFile.hasChanged()) {
|
|
12
|
-
packageJsonFile.write();
|
|
13
|
-
console.log((0, chalk_1.default) `{green ${constants_1.ICON.tick}}`, packageJsonFile.shortPath);
|
|
14
|
-
}
|
|
15
|
-
else {
|
|
16
|
-
console.log(chalk_1.default.dim(constants_1.ICON.skip), chalk_1.default.dim(packageJsonFile.shortPath));
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
return ctx;
|
|
20
|
-
}
|
|
21
|
-
exports.writeIfChanged = writeIfChanged;
|