syncpack 12.0.0-alpha.0 → 12.0.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 +17 -26
- package/dist/bin-fix-mismatches/fix-mismatches.js +6 -1
- package/dist/bin-format/format.js +6 -1
- package/dist/bin-lint-semver-ranges/lint-semver-ranges.js +2 -2
- package/dist/bin-list/list.js +3 -3
- package/dist/bin-list-mismatches/list-mismatches.js +11 -11
- package/dist/bin-prompt/prompt.js +6 -1
- package/dist/bin-set-semver-ranges/set-semver-ranges.js +6 -1
- package/dist/bin-update/effects.d.ts +5 -4
- package/dist/bin-update/effects.js +29 -12
- package/dist/bin-update/update.js +6 -1
- package/dist/config/get-custom-types.d.ts +1 -1
- package/dist/config/get-enabled-types.d.ts +2 -2
- package/dist/constants.d.ts +0 -2
- package/dist/constants.js +1 -2
- package/dist/error-handlers/default-error-handlers.d.ts +0 -13
- package/dist/error-handlers/default-error-handlers.js +1 -20
- package/dist/get-instances/instance.js +14 -0
- package/dist/get-package-json-files/get-file-paths.d.ts +1 -1
- package/dist/get-package-json-files/package-json-file.js +8 -0
- package/dist/io/ask-for-choice.d.ts +2 -2
- package/dist/io/ask-for-choice.js +1 -2
- package/dist/io/ask-for-input.d.ts +2 -2
- package/dist/io/ask-for-input.js +1 -2
- package/dist/io/glob-sync.d.ts +1 -1
- package/dist/io/read-file-sync.d.ts +1 -1
- package/dist/io/read-json-file-sync.d.ts +2 -2
- package/dist/io/read-yaml-file-sync.d.ts +2 -2
- package/dist/io/read-yaml-file-sync.js +1 -2
- package/dist/io/write-file-sync.d.ts +1 -1
- package/dist/lib/format-repository-url.d.ts +1 -0
- package/dist/lib/format-repository-url.js +41 -0
- package/dist/lib/ring-buffer.js +2 -0
- package/dist/report.d.ts +15 -15
- package/dist/semver-group/disabled.d.ts +1 -1
- package/dist/semver-group/disabled.js +1 -1
- package/dist/semver-group/filtered-out.d.ts +1 -1
- package/dist/semver-group/filtered-out.js +1 -1
- package/dist/semver-group/ignored.d.ts +1 -1
- package/dist/semver-group/ignored.js +1 -1
- package/dist/semver-group/index.d.ts +1 -1
- package/dist/semver-group/with-range.d.ts +1 -1
- package/dist/semver-group/with-range.js +1 -1
- package/dist/specifier/alias.js +1 -4
- package/dist/specifier/base.js +20 -2
- package/dist/specifier/delete.js +6 -4
- package/dist/specifier/file.js +1 -4
- package/dist/specifier/hosted-git.js +1 -4
- package/dist/specifier/lib/non-semver-error.d.ts +1 -1
- package/dist/specifier/range.js +1 -4
- package/dist/specifier/tag.js +1 -4
- package/dist/specifier/unsupported.js +1 -4
- package/dist/specifier/url.js +1 -5
- package/dist/specifier/version.js +1 -4
- package/dist/specifier/workspace-protocol.js +1 -4
- package/dist/strategy/name-and-version-props.js +4 -1
- package/dist/strategy/named-version-string.js +3 -1
- package/dist/strategy/unnamed-version-string.js +3 -1
- package/dist/strategy/versions-by-name.js +3 -1
- package/dist/version-group/banned.d.ts +1 -1
- package/dist/version-group/banned.js +1 -1
- package/dist/version-group/filtered-out.d.ts +1 -1
- package/dist/version-group/filtered-out.js +1 -1
- package/dist/version-group/ignored.d.ts +1 -1
- package/dist/version-group/ignored.js +1 -1
- package/dist/version-group/index.d.ts +1 -1
- package/dist/version-group/pinned.d.ts +1 -1
- package/dist/version-group/pinned.js +1 -1
- package/dist/version-group/same-range.d.ts +1 -1
- package/dist/version-group/same-range.js +1 -1
- package/dist/version-group/snapped-to.d.ts +1 -1
- package/dist/version-group/snapped-to.js +1 -1
- package/dist/version-group/standard.d.ts +1 -1
- package/dist/version-group/standard.js +1 -1
- package/package.json +35 -35
- package/dist/create-program/effects.d.ts +0 -62
- package/dist/create-program/effects.js +0 -2
package/README.md
CHANGED
|
@@ -14,54 +14,45 @@ Full information can be found in the documentation at https://jamiemason.github.
|
|
|
14
14
|
|
|
15
15
|
## Commands
|
|
16
16
|
|
|
17
|
-
### [fix-mismatches](https://jamiemason.github.io/syncpack/fix-mismatches)
|
|
17
|
+
### [fix-mismatches](https://jamiemason.github.io/syncpack/command/fix-mismatches)
|
|
18
18
|
|
|
19
|
-
Ensure that multiple packages requiring the same dependency define the same version, so that every
|
|
20
|
-
package requires eg. `react@16.4.2`, instead of a combination of `react@16.4.2`, `react@0.15.9`, and
|
|
21
|
-
`react@16.0.0`.
|
|
19
|
+
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`.
|
|
22
20
|
|
|
23
|
-
### [format](https://jamiemason.github.io/syncpack/format)
|
|
21
|
+
### [format](https://jamiemason.github.io/syncpack/command/format)
|
|
24
22
|
|
|
25
|
-
Organise package.json files according to a conventional format, where fields appear in a predictable
|
|
26
|
-
order and nested fields are ordered alphabetically. Shorthand properties are used where available,
|
|
27
|
-
such as the `"repository"` and `"bugs"` fields.
|
|
23
|
+
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.
|
|
28
24
|
|
|
29
|
-
### [lint](https://jamiemason.github.io/syncpack/lint)
|
|
25
|
+
### [lint](https://jamiemason.github.io/syncpack/command/lint)
|
|
30
26
|
|
|
31
|
-
Lint all versions and ranges and exit with 0 or 1 based on whether all files match your Syncpack
|
|
32
|
-
configuration file.
|
|
27
|
+
Lint all versions and ranges and exit with 0 or 1 based on whether all files match your Syncpack configuration file.
|
|
33
28
|
|
|
34
|
-
### [lint-semver-ranges](https://jamiemason.github.io/syncpack/lint-semver-ranges)
|
|
29
|
+
### [lint-semver-ranges](https://jamiemason.github.io/syncpack/command/lint-semver-ranges)
|
|
35
30
|
|
|
36
|
-
Check whether dependency versions used within "dependencies", "devDependencies", etc follow a
|
|
37
|
-
consistent format.
|
|
31
|
+
Check whether dependency versions used within "dependencies", "devDependencies", etc follow a consistent format.
|
|
38
32
|
|
|
39
|
-
### [list](https://jamiemason.github.io/syncpack/list)
|
|
33
|
+
### [list](https://jamiemason.github.io/syncpack/command/list)
|
|
40
34
|
|
|
41
35
|
List all dependencies required by your packages.
|
|
42
36
|
|
|
43
|
-
### [list-mismatches](https://jamiemason.github.io/syncpack/list-mismatches)
|
|
37
|
+
### [list-mismatches](https://jamiemason.github.io/syncpack/command/list-mismatches)
|
|
44
38
|
|
|
45
|
-
List dependencies which are required by multiple packages, where the version is not the same across
|
|
46
|
-
every package.
|
|
39
|
+
List dependencies which are required by multiple packages, where the version is not the same across every package.
|
|
47
40
|
|
|
48
|
-
### [prompt](https://jamiemason.github.io/syncpack/prompt)
|
|
41
|
+
### [prompt](https://jamiemason.github.io/syncpack/command/prompt)
|
|
49
42
|
|
|
50
43
|
Displays a series of prompts to fix mismatches which syncpack cannot fix automatically.
|
|
51
44
|
|
|
52
|
-
### [set-semver-ranges](https://jamiemason.github.io/syncpack/set-semver-ranges)
|
|
45
|
+
### [set-semver-ranges](https://jamiemason.github.io/syncpack/command/set-semver-ranges)
|
|
53
46
|
|
|
54
|
-
Ensure dependency versions used within `"dependencies"`, `"devDependencies"` etc follow a consistent
|
|
55
|
-
format.
|
|
47
|
+
Ensure dependency versions used within `"dependencies"`, `"devDependencies"` etc follow a consistent format.
|
|
56
48
|
|
|
57
|
-
### [update](https://jamiemason.github.io/syncpack/update)
|
|
49
|
+
### [update](https://jamiemason.github.io/syncpack/command/update)
|
|
58
50
|
|
|
59
|
-
Interactively update packages to the latest versions from the npm registry, wherever they are in
|
|
60
|
-
your monorepo. You can update every dependency, just dev/peer/prod dependencies, just packages which
|
|
61
|
-
match a name filter, and more.
|
|
51
|
+
Interactively update packages to the latest versions from the npm registry, wherever they are in your monorepo. You can update every dependency, just dev/peer/prod dependencies, just packages which match a name filter, and more.
|
|
62
52
|
|
|
63
53
|
## Badges
|
|
64
54
|
|
|
55
|
+
- [](https://ko-fi.com/C0C4PY4P)
|
|
65
56
|
- [](https://www.npmjs.com/package/syncpack)
|
|
66
57
|
- [](https://www.npmjs.com/package/syncpack)
|
|
67
58
|
- [](https://github.com/JamieMason/syncpack/actions)
|
|
@@ -89,7 +89,12 @@ function fixMismatches({ io, cli, errorHandlers = default_error_handlers_1.defau
|
|
|
89
89
|
}
|
|
90
90
|
yield* $(removeEmptyObjects(ctx));
|
|
91
91
|
return ctx;
|
|
92
|
-
}), effect_1.Effect.flatMap(write_if_changed_1.writeIfChanged), effect_1.Effect.catchTags(
|
|
92
|
+
}), effect_1.Effect.flatMap(write_if_changed_1.writeIfChanged), effect_1.Effect.catchTags({
|
|
93
|
+
WriteFileError: (0, effect_1.flow)(errorHandlers.WriteFileError, effect_1.Effect.map(() => {
|
|
94
|
+
ctx.isInvalid = true;
|
|
95
|
+
return ctx;
|
|
96
|
+
})),
|
|
97
|
+
}), effect_1.Effect.flatMap(exit_if_invalid_1.exitIfInvalid))), effect_1.Effect.provide((0, effect_1.pipe)(effect_1.Context.empty(), effect_1.Context.add(tag_1.CliConfigTag, cli), effect_1.Context.add(io_1.IoTag, io))), with_logger_1.withLogger);
|
|
93
98
|
}
|
|
94
99
|
exports.fixMismatches = fixMismatches;
|
|
95
100
|
function fixMismatch(report) {
|
|
@@ -54,6 +54,11 @@ function format({ io, cli, errorHandlers = default_error_handlers_1.defaultError
|
|
|
54
54
|
sortObject(Object.keys(value).sort(), value);
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
|
-
}), effect_1.Effect.flatMap((ctx) => (0, effect_1.pipe)((0, write_if_changed_1.writeIfChanged)(ctx), effect_1.Effect.catchTags(
|
|
57
|
+
}), effect_1.Effect.flatMap((ctx) => (0, effect_1.pipe)((0, write_if_changed_1.writeIfChanged)(ctx), effect_1.Effect.catchTags({
|
|
58
|
+
WriteFileError: (0, effect_1.flow)(errorHandlers.WriteFileError, effect_1.Effect.map(() => {
|
|
59
|
+
ctx.isInvalid = true;
|
|
60
|
+
return ctx;
|
|
61
|
+
})),
|
|
62
|
+
}))), effect_1.Effect.flatMap(exit_if_invalid_1.exitIfInvalid), effect_1.Effect.provide((0, effect_1.pipe)(effect_1.Context.empty(), effect_1.Context.add(tag_1.CliConfigTag, cli), effect_1.Context.add(io_1.IoTag, io))), with_logger_1.withLogger);
|
|
58
63
|
}
|
|
59
64
|
exports.format = format;
|
|
@@ -88,7 +88,7 @@ function logSemverRangeMismatch(report) {
|
|
|
88
88
|
const expected = report.fixable.raw;
|
|
89
89
|
const propPath = instance.strategy.path;
|
|
90
90
|
const filePath = instance.packageJsonFile.jsonFile.shortPath;
|
|
91
|
-
return effect_1.Effect.logInfo((0, chalk_1.default) `{red ${constants_1.ICON.cross}} ${name} {red ${actual}} {dim ${constants_1.ICON.rightArrow}} {green ${expected}} {gray ${filePath} > ${propPath}} {
|
|
91
|
+
return effect_1.Effect.logInfo((0, chalk_1.default) `{red ${constants_1.ICON.cross}} ${name} {red ${actual}} {dim ${constants_1.ICON.rightArrow}} {green ${expected}} {gray ${filePath} > ${propPath}} {blue [${_tag}]}`);
|
|
92
92
|
}
|
|
93
93
|
function logUnsupportedMismatch(report) {
|
|
94
94
|
const _tag = report._tag;
|
|
@@ -97,5 +97,5 @@ function logUnsupportedMismatch(report) {
|
|
|
97
97
|
const actual = instance.rawSpecifier;
|
|
98
98
|
const propPath = instance.strategy.path;
|
|
99
99
|
const filePath = instance.packageJsonFile.jsonFile.shortPath;
|
|
100
|
-
return effect_1.Effect.logInfo((0, chalk_1.default) `{red ${constants_1.ICON.cross} name {white ${name}} or version {white ${actual}} are not supported} {gray ${filePath} > ${propPath}} {
|
|
100
|
+
return effect_1.Effect.logInfo((0, chalk_1.default) `{red ${constants_1.ICON.cross} name {white ${name}} or version {white ${actual}} are not supported} {gray ${filePath} > ${propPath}} {blue [${_tag}]}`);
|
|
101
101
|
}
|
package/dist/bin-list/list.js
CHANGED
|
@@ -55,7 +55,7 @@ function list({ io, cli, errorHandlers = default_error_handlers_1.defaultErrorHa
|
|
|
55
55
|
if (_tag === 'Valid') {
|
|
56
56
|
const actual = report.specifier.raw;
|
|
57
57
|
matches.add(report.specifier._tag === 'UnsupportedSpecifier'
|
|
58
|
-
? (0, chalk_1.default) `{gray ${actual}} {
|
|
58
|
+
? (0, chalk_1.default) `{gray ${actual}} {blue [UnsupportedMismatch]}`
|
|
59
59
|
: (0, chalk_1.default) `{gray ${actual}}`);
|
|
60
60
|
}
|
|
61
61
|
else if (_tag === 'HighestSemverMismatch' ||
|
|
@@ -106,12 +106,12 @@ function getLogForFixable(report) {
|
|
|
106
106
|
const _tag = report._tag;
|
|
107
107
|
const actual = report.fixable.instance.rawSpecifier;
|
|
108
108
|
const expected = report.fixable.raw;
|
|
109
|
-
return (0, chalk_1.default) `{red ${actual}} {gray ${constants_1.ICON.rightArrow}} {green ${expected}} {
|
|
109
|
+
return (0, chalk_1.default) `{red ${actual}} {gray ${constants_1.ICON.rightArrow}} {green ${expected}} {blue [${_tag}]}`;
|
|
110
110
|
}
|
|
111
111
|
function getLogForUnfixable(report) {
|
|
112
112
|
const _tag = report._tag;
|
|
113
113
|
const actual = report.unfixable.rawSpecifier;
|
|
114
|
-
return (0, chalk_1.default) `{red ${actual}} {gray ${constants_1.ICON.rightArrow}} {
|
|
114
|
+
return (0, chalk_1.default) `{red ${actual}} {gray ${constants_1.ICON.rightArrow}} {blue [${_tag}]}`;
|
|
115
115
|
}
|
|
116
116
|
function logOtherCommands() {
|
|
117
117
|
return effect_1.Effect.logInfo([
|
|
@@ -136,7 +136,7 @@ function logBanned(report) {
|
|
|
136
136
|
const jsonFile = instance.packageJsonFile.jsonFile;
|
|
137
137
|
const path = instance.strategy.path;
|
|
138
138
|
const shortPath = jsonFile.shortPath;
|
|
139
|
-
return effect_1.Effect.logInfo((0, chalk_1.default) `{red ${constants_1.ICON.cross}} ${name} {red banned} {gray ${shortPath} > ${path}} {
|
|
139
|
+
return effect_1.Effect.logInfo((0, chalk_1.default) `{red ${constants_1.ICON.cross}} ${name} {red banned} {gray ${shortPath} > ${path}} {blue [${_tag}]}`);
|
|
140
140
|
}
|
|
141
141
|
function logHighestSemverMismatch(report) {
|
|
142
142
|
const _tag = report._tag;
|
|
@@ -148,7 +148,7 @@ function logHighestSemverMismatch(report) {
|
|
|
148
148
|
const name = instance.name;
|
|
149
149
|
const path = instance.strategy.path;
|
|
150
150
|
const shortPath = jsonFile.shortPath;
|
|
151
|
-
return effect_1.Effect.logInfo((0, chalk_1.default) `{red ${constants_1.ICON.cross}} ${name} {red ${actual}} {dim ${constants_1.ICON.rightArrow}} {green ${expected}} {gray ${shortPath} > ${path}} {
|
|
151
|
+
return effect_1.Effect.logInfo((0, chalk_1.default) `{red ${constants_1.ICON.cross}} ${name} {red ${actual}} {dim ${constants_1.ICON.rightArrow}} {green ${expected}} {gray ${shortPath} > ${path}} {blue [${_tag}]}`);
|
|
152
152
|
}
|
|
153
153
|
function logLocalPackageMismatch(report) {
|
|
154
154
|
const _tag = report._tag;
|
|
@@ -159,7 +159,7 @@ function logLocalPackageMismatch(report) {
|
|
|
159
159
|
const name = instance.name;
|
|
160
160
|
const path = instance.strategy.path;
|
|
161
161
|
const shortPath = instance.packageJsonFile.jsonFile.shortPath;
|
|
162
|
-
return effect_1.Effect.logInfo((0, chalk_1.default) `{red ${constants_1.ICON.cross}} ${name} {red ${actual}} {dim ${constants_1.ICON.rightArrow}} {green ${expected}} {gray ${shortPath} > ${path}} {
|
|
162
|
+
return effect_1.Effect.logInfo((0, chalk_1.default) `{red ${constants_1.ICON.cross}} ${name} {red ${actual}} {dim ${constants_1.ICON.rightArrow}} {green ${expected}} {gray ${shortPath} > ${path}} {blue [${_tag}]}`);
|
|
163
163
|
}
|
|
164
164
|
function logLowestSemverMismatch(report) {
|
|
165
165
|
const _tag = report._tag;
|
|
@@ -170,7 +170,7 @@ function logLowestSemverMismatch(report) {
|
|
|
170
170
|
const name = instance.name;
|
|
171
171
|
const path = instance.strategy.path;
|
|
172
172
|
const shortPath = instance.packageJsonFile.jsonFile.shortPath;
|
|
173
|
-
return effect_1.Effect.logInfo((0, chalk_1.default) `{red ${constants_1.ICON.cross}} ${name} {red ${actual}} {dim ${constants_1.ICON.rightArrow}} {green ${expected}} {gray ${shortPath} > ${path}} {
|
|
173
|
+
return effect_1.Effect.logInfo((0, chalk_1.default) `{red ${constants_1.ICON.cross}} ${name} {red ${actual}} {dim ${constants_1.ICON.rightArrow}} {green ${expected}} {gray ${shortPath} > ${path}} {blue [${_tag}]}`);
|
|
174
174
|
}
|
|
175
175
|
function logPinnedMismatch(report) {
|
|
176
176
|
const _tag = report._tag;
|
|
@@ -181,7 +181,7 @@ function logPinnedMismatch(report) {
|
|
|
181
181
|
const name = instance.name;
|
|
182
182
|
const path = instance.strategy.path;
|
|
183
183
|
const shortPath = instance.packageJsonFile.jsonFile.shortPath;
|
|
184
|
-
return effect_1.Effect.logInfo((0, chalk_1.default) `{red ${constants_1.ICON.cross}} ${name} {red ${actual}} {dim ${constants_1.ICON.rightArrow}} {green ${expected}} {gray ${shortPath} > ${path}} {
|
|
184
|
+
return effect_1.Effect.logInfo((0, chalk_1.default) `{red ${constants_1.ICON.cross}} ${name} {red ${actual}} {dim ${constants_1.ICON.rightArrow}} {green ${expected}} {gray ${shortPath} > ${path}} {blue [${_tag}]}`);
|
|
185
185
|
}
|
|
186
186
|
function logSemverRangeMismatch(report) {
|
|
187
187
|
const _tag = report._tag;
|
|
@@ -192,7 +192,7 @@ function logSemverRangeMismatch(report) {
|
|
|
192
192
|
const name = instance.name;
|
|
193
193
|
const path = instance.strategy.path;
|
|
194
194
|
const shortPath = instance.packageJsonFile.jsonFile.shortPath;
|
|
195
|
-
return effect_1.Effect.logInfo((0, chalk_1.default) `{red ${constants_1.ICON.cross}} ${name} {red ${actual}} {dim ${constants_1.ICON.rightArrow}} {green ${expected}} {gray ${shortPath} > ${path}} {
|
|
195
|
+
return effect_1.Effect.logInfo((0, chalk_1.default) `{red ${constants_1.ICON.cross}} ${name} {red ${actual}} {dim ${constants_1.ICON.rightArrow}} {green ${expected}} {gray ${shortPath} > ${path}} {blue [${_tag}]}`);
|
|
196
196
|
}
|
|
197
197
|
function logSnappedToMismatch(report) {
|
|
198
198
|
const _tag = report._tag;
|
|
@@ -203,7 +203,7 @@ function logSnappedToMismatch(report) {
|
|
|
203
203
|
const name = instance.name;
|
|
204
204
|
const path = instance.strategy.path;
|
|
205
205
|
const shortPath = instance.packageJsonFile.jsonFile.shortPath;
|
|
206
|
-
return effect_1.Effect.logInfo((0, chalk_1.default) `{red ${constants_1.ICON.cross}} ${name} {red ${actual}} {dim ${constants_1.ICON.rightArrow}} {green ${expected}} {gray ${shortPath} > ${path}} {
|
|
206
|
+
return effect_1.Effect.logInfo((0, chalk_1.default) `{red ${constants_1.ICON.cross}} ${name} {red ${actual}} {dim ${constants_1.ICON.rightArrow}} {green ${expected}} {gray ${shortPath} > ${path}} {blue [${_tag}]}`);
|
|
207
207
|
}
|
|
208
208
|
function logMissingLocalVersion(report) {
|
|
209
209
|
const instance = report.unfixable;
|
|
@@ -214,7 +214,7 @@ function logMissingLocalVersion(report) {
|
|
|
214
214
|
const path = instance.strategy.path;
|
|
215
215
|
const shortPath = jsonFile.shortPath;
|
|
216
216
|
return effect_1.Effect.logInfo([
|
|
217
|
-
(0, chalk_1.default) `{red ${constants_1.ICON.cross}} ${name} {red ${actual}} {dim ${constants_1.ICON.rightArrow}} {red ???} {gray ${shortPath} > ${path}} {
|
|
217
|
+
(0, chalk_1.default) `{red ${constants_1.ICON.cross}} ${name} {red ${actual}} {dim ${constants_1.ICON.rightArrow}} {red ???} {gray ${shortPath} > ${path}} {blue [MissingLocalVersion]}`,
|
|
218
218
|
(0, chalk_1.default) ` {red ${localPath} does not have a .version property which is exact semver}`,
|
|
219
219
|
].join(os_1.EOL));
|
|
220
220
|
}
|
|
@@ -227,7 +227,7 @@ function logMissingSnappedToMismatch(report) {
|
|
|
227
227
|
const path = instance.strategy.path;
|
|
228
228
|
const shortPath = jsonFile.shortPath;
|
|
229
229
|
return effect_1.Effect.logInfo([
|
|
230
|
-
(0, chalk_1.default) `{red ${constants_1.ICON.cross}} ${name} {red ${actual}} {dim ${constants_1.ICON.rightArrow}} {red ???} {gray ${shortPath} > ${path}} {
|
|
230
|
+
(0, chalk_1.default) `{red ${constants_1.ICON.cross}} ${name} {red ${actual}} {dim ${constants_1.ICON.rightArrow}} {red ???} {gray ${shortPath} > ${path}} {blue [MissingSnappedToMismatch]}`,
|
|
231
231
|
(0, chalk_1.default) ` {red no package in this groups .snapTo array depend on ${name}}`,
|
|
232
232
|
].join(os_1.EOL));
|
|
233
233
|
}
|
|
@@ -240,7 +240,7 @@ function logUnsupportedMismatch(report) {
|
|
|
240
240
|
const path = instance.strategy.path;
|
|
241
241
|
const shortPath = jsonFile.shortPath;
|
|
242
242
|
return effect_1.Effect.logInfo([
|
|
243
|
-
(0, chalk_1.default) `{red ${constants_1.ICON.cross}} ${name} {red ${actual}} {dim ${constants_1.ICON.rightArrow}} {red ???} {gray ${shortPath} > ${path}} {
|
|
243
|
+
(0, chalk_1.default) `{red ${constants_1.ICON.cross}} ${name} {red ${actual}} {dim ${constants_1.ICON.rightArrow}} {red ???} {gray ${shortPath} > ${path}} {blue [UnsupportedMismatch]}`,
|
|
244
244
|
(0, chalk_1.default) ` {red use {blue syncpack prompt} to fix this manually}`,
|
|
245
245
|
].join(os_1.EOL));
|
|
246
246
|
}
|
|
@@ -254,7 +254,7 @@ function logSameRangeMismatch(report) {
|
|
|
254
254
|
const shortPath = jsonFile.shortPath;
|
|
255
255
|
const mismatches = report.mismatches;
|
|
256
256
|
return effect_1.Effect.logInfo([
|
|
257
|
-
(0, chalk_1.default) `{red ${constants_1.ICON.cross}} ${name} {red range ${actual} does not include ${mismatches.join(', ')}} {gray ${shortPath} > ${path}} {
|
|
257
|
+
(0, chalk_1.default) `{red ${constants_1.ICON.cross}} ${name} {red range ${actual} does not include ${mismatches.join(', ')}} {gray ${shortPath} > ${path}} {blue [SameRangeMismatch]}`,
|
|
258
258
|
(0, chalk_1.default) ` {gray use {blue syncpack prompt} to fix this manually}`,
|
|
259
259
|
].join(os_1.EOL));
|
|
260
260
|
}
|
|
@@ -51,7 +51,12 @@ function prompt({ io, cli, errorHandlers = default_error_handlers_1.defaultError
|
|
|
51
51
|
yield* $((0, list_1.logOtherCommands)());
|
|
52
52
|
}
|
|
53
53
|
return ctx;
|
|
54
|
-
}), effect_1.Effect.catchTags(
|
|
54
|
+
}), effect_1.Effect.catchTags({
|
|
55
|
+
WriteFileError: (0, effect_1.flow)(errorHandlers.WriteFileError, effect_1.Effect.map(() => {
|
|
56
|
+
ctx.isInvalid = true;
|
|
57
|
+
return ctx;
|
|
58
|
+
})),
|
|
59
|
+
}), effect_1.Effect.flatMap(exit_if_invalid_1.exitIfInvalid))), effect_1.Effect.provide((0, effect_1.pipe)(effect_1.Context.empty(), effect_1.Context.add(tag_1.CliConfigTag, cli), effect_1.Context.add(io_1.IoTag, io))), with_logger_1.withLogger);
|
|
55
60
|
}
|
|
56
61
|
exports.prompt = prompt;
|
|
57
62
|
function isUnfixable(report) {
|
|
@@ -52,6 +52,11 @@ function setSemverRanges({ io, cli, errorHandlers = default_error_handlers_1.def
|
|
|
52
52
|
if (unfixableCount)
|
|
53
53
|
yield* $((0, fix_mismatches_1.logUnfixableSize)(unfixableCount));
|
|
54
54
|
return ctx;
|
|
55
|
-
}), effect_1.Effect.flatMap(write_if_changed_1.writeIfChanged), effect_1.Effect.catchTags(
|
|
55
|
+
}), effect_1.Effect.flatMap(write_if_changed_1.writeIfChanged), effect_1.Effect.catchTags({
|
|
56
|
+
WriteFileError: (0, effect_1.flow)(errorHandlers.WriteFileError, effect_1.Effect.map(() => {
|
|
57
|
+
ctx.isInvalid = true;
|
|
58
|
+
return ctx;
|
|
59
|
+
})),
|
|
60
|
+
}), effect_1.Effect.flatMap(exit_if_invalid_1.exitIfInvalid))), effect_1.Effect.provide((0, effect_1.pipe)(effect_1.Context.empty(), effect_1.Context.add(tag_1.CliConfigTag, cli), effect_1.Context.add(io_1.IoTag, io))), with_logger_1.withLogger);
|
|
56
61
|
}
|
|
57
62
|
exports.setSemverRanges = setSemverRanges;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Data, Effect } from 'effect';
|
|
2
2
|
import type { Instance } from '../get-instances/instance';
|
|
3
|
-
declare const Releases_base: new <A extends Record<string, any
|
|
3
|
+
declare const Releases_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").Equals<Omit<A, keyof import("effect/Equal").Equal>, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" | keyof import("effect/Equal").Equal ? never : P]: A[P]; }) => Data.Data<Readonly<A> & {
|
|
4
4
|
readonly _tag: "Releases";
|
|
5
5
|
}>;
|
|
6
6
|
/** full release history from the npm registry for a given package */
|
|
@@ -10,23 +10,24 @@ declare class Releases extends Releases_base<{
|
|
|
10
10
|
all: string[];
|
|
11
11
|
latest: string;
|
|
12
12
|
};
|
|
13
|
+
repoUrl: string | undefined;
|
|
13
14
|
}> {
|
|
14
15
|
}
|
|
15
|
-
declare const PromptCancelled_base: new <A extends Record<string, any
|
|
16
|
+
declare const PromptCancelled_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").Equals<Omit<A, keyof import("effect/Equal").Equal>, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" | keyof import("effect/Equal").Equal ? never : P]: A[P]; }) => Data.Data<Readonly<A> & {
|
|
16
17
|
readonly _tag: "PromptCancelled";
|
|
17
18
|
}>;
|
|
18
19
|
declare class PromptCancelled extends PromptCancelled_base<{
|
|
19
20
|
name: string;
|
|
20
21
|
}> {
|
|
21
22
|
}
|
|
22
|
-
declare const HttpError_base: new <A extends Record<string, any
|
|
23
|
+
declare const HttpError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").Equals<Omit<A, keyof import("effect/Equal").Equal>, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" | keyof import("effect/Equal").Equal ? never : P]: A[P]; }) => Data.Data<Readonly<A> & {
|
|
23
24
|
readonly _tag: "HttpError";
|
|
24
25
|
}>;
|
|
25
26
|
declare class HttpError extends HttpError_base<{
|
|
26
27
|
error: string;
|
|
27
28
|
}> {
|
|
28
29
|
}
|
|
29
|
-
declare const NpmRegistryError_base: new <A extends Record<string, any
|
|
30
|
+
declare const NpmRegistryError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").Equals<Omit<A, keyof import("effect/Equal").Equal>, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" | keyof import("effect/Equal").Equal ? never : P]: A[P]; }) => Data.Data<Readonly<A> & {
|
|
30
31
|
readonly _tag: "NpmRegistryError";
|
|
31
32
|
}>;
|
|
32
33
|
declare class NpmRegistryError extends NpmRegistryError_base<{
|
|
@@ -39,6 +39,7 @@ const gtr_1 = __importDefault(require("semver/ranges/gtr"));
|
|
|
39
39
|
const is_array_1 = require("tightrope/guard/is-array");
|
|
40
40
|
const is_empty_object_1 = require("tightrope/guard/is-empty-object");
|
|
41
41
|
const constants_1 = require("../constants");
|
|
42
|
+
const format_repository_url_1 = require("../lib/format-repository-url");
|
|
42
43
|
const ring_buffer_1 = require("../lib/ring-buffer");
|
|
43
44
|
const set_semver_range_1 = require("../lib/set-semver-range");
|
|
44
45
|
const specifier_1 = require("../specifier");
|
|
@@ -133,15 +134,21 @@ exports.updateEffects = {
|
|
|
133
134
|
effect_1.Effect.flatMap(Schema.parse(Schema.struct({
|
|
134
135
|
'dist-tags': Schema.struct({ latest: Schema.string }),
|
|
135
136
|
'time': Schema.record(Schema.string, Schema.string),
|
|
137
|
+
'homepage': Schema.optional(Schema.string),
|
|
138
|
+
'repository': Schema.optional(Schema.union(Schema.string, Schema.struct({ url: Schema.optional(Schema.string) }))),
|
|
136
139
|
}))),
|
|
137
140
|
// transform it into something more appropriate
|
|
138
|
-
effect_1.Effect.map((struct) =>
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
141
|
+
effect_1.Effect.map((struct) => {
|
|
142
|
+
const rawRepoUrl = typeof struct.repository === 'object' ? struct.repository.url : struct.repository;
|
|
143
|
+
return new Releases({
|
|
144
|
+
instance,
|
|
145
|
+
versions: {
|
|
146
|
+
all: Object.keys(struct.time).filter((key) => key !== 'modified' && key !== 'created'),
|
|
147
|
+
latest: struct['dist-tags'].latest,
|
|
148
|
+
},
|
|
149
|
+
repoUrl: (0, format_repository_url_1.formatRepositoryUrl)(rawRepoUrl),
|
|
150
|
+
});
|
|
151
|
+
}),
|
|
145
152
|
// hide ParseErrors and just treat them as another kind of NpmRegistryError
|
|
146
153
|
effect_1.Effect.catchTags({
|
|
147
154
|
ParseError: () => effect_1.Effect.fail(new NpmRegistryError({ error: `Invalid response for ${instance.name}` })),
|
|
@@ -198,11 +205,21 @@ function promptForReleaseType(releaseType, doState) {
|
|
|
198
205
|
// @ts-expect-error optionsPerPage *does* exist https://github.com/terkelg/prompts#options-7
|
|
199
206
|
optionsPerPage,
|
|
200
207
|
message: `${releases.length} ${releaseType} updates`,
|
|
201
|
-
choices: releases.map((updateable) =>
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
208
|
+
choices: releases.map((updateable) => {
|
|
209
|
+
const spacingValue = 50 -
|
|
210
|
+
updateable.instance.name.length -
|
|
211
|
+
updateable.instance.rawSpecifier.length -
|
|
212
|
+
updateable.versions.latest.length;
|
|
213
|
+
const spacing = Array.from({ length: spacingValue }).fill(' ').join('');
|
|
214
|
+
const repoUrl = updateable.repoUrl
|
|
215
|
+
? (0, chalk_1.default) `${spacing} {white - ${updateable.repoUrl}}`
|
|
216
|
+
: '';
|
|
217
|
+
return {
|
|
218
|
+
title: (0, chalk_1.default) `${updateable.instance.name} {gray ${updateable.instance.rawSpecifier} ${constants_1.ICON.rightArrow}} {green ${updateable.versions.latest}} ${repoUrl}`,
|
|
219
|
+
selected: true,
|
|
220
|
+
value: updateable,
|
|
221
|
+
};
|
|
222
|
+
}),
|
|
206
223
|
}),
|
|
207
224
|
catch: effect_1.identity,
|
|
208
225
|
}),
|
|
@@ -56,6 +56,11 @@ function update(io, cli, effects = effects_1.updateEffects, errorHandlers = defa
|
|
|
56
56
|
// ask the user which updates they want
|
|
57
57
|
effect_1.Effect.flatMap(effects_1.updateEffects.promptForUpdates),
|
|
58
58
|
// if we think the user cancelled, say so
|
|
59
|
-
effect_1.Effect.catchTag('PromptCancelled', () => effect_1.Effect.logInfo((0, chalk_1.default) `{red ${constants_1.ICON.panic}} aborting after {blue syncpack update} was cancelled`)))), effect_1.Effect.flatMap(({ ctx }) => (0, effect_1.pipe)((0, write_if_changed_1.writeIfChanged)(ctx), effect_1.Effect.catchTags(
|
|
59
|
+
effect_1.Effect.catchTag('PromptCancelled', () => effect_1.Effect.logInfo((0, chalk_1.default) `{red ${constants_1.ICON.panic}} aborting after {blue syncpack update} was cancelled`)))), effect_1.Effect.flatMap(({ ctx }) => (0, effect_1.pipe)((0, write_if_changed_1.writeIfChanged)(ctx), effect_1.Effect.catchTags({
|
|
60
|
+
WriteFileError: (0, effect_1.flow)(errorHandlers.WriteFileError, effect_1.Effect.map(() => {
|
|
61
|
+
ctx.isInvalid = true;
|
|
62
|
+
return ctx;
|
|
63
|
+
})),
|
|
64
|
+
}))), effect_1.Effect.flatMap(exit_if_invalid_1.exitIfInvalid), effect_1.Effect.withConcurrency(10), effect_1.Effect.provide((0, effect_1.pipe)(effect_1.Context.empty(), effect_1.Context.add(tag_1.CliConfigTag, cli), effect_1.Context.add(io_1.IoTag, io))), with_logger_1.withLogger);
|
|
60
65
|
}
|
|
61
66
|
exports.update = update;
|
|
@@ -7,7 +7,7 @@ import { VersionsByNameStrategy } from '../strategy/versions-by-name';
|
|
|
7
7
|
export declare namespace Strategy {
|
|
8
8
|
type Any = NameAndVersionPropsStrategy | NamedVersionStringStrategy | UnnamedVersionStringStrategy | VersionsByNameStrategy;
|
|
9
9
|
}
|
|
10
|
-
declare const InvalidCustomTypeError_base: new <A extends Record<string, any
|
|
10
|
+
declare const InvalidCustomTypeError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").Equals<Omit<A, keyof import("effect/Equal").Equal>, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" | keyof import("effect/Equal").Equal ? never : P]: A[P]; }) => Data.Data<Readonly<A> & {
|
|
11
11
|
readonly _tag: "InvalidCustomTypeError";
|
|
12
12
|
}>;
|
|
13
13
|
export declare class InvalidCustomTypeError extends InvalidCustomTypeError_base<{
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { Data, Effect } from 'effect';
|
|
2
2
|
import type { Ctx } from '../get-context';
|
|
3
3
|
import type { InvalidCustomTypeError, Strategy } from './get-custom-types';
|
|
4
|
-
declare const DeprecatedTypesError_base: new <A extends Record<string, any
|
|
4
|
+
declare const DeprecatedTypesError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").Equals<Omit<A, keyof import("effect/Equal").Equal>, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" | keyof import("effect/Equal").Equal ? never : P]: A[P]; }) => Data.Data<Readonly<A> & {
|
|
5
5
|
readonly _tag: "DeprecatedTypesError";
|
|
6
6
|
}>;
|
|
7
7
|
export declare class DeprecatedTypesError extends DeprecatedTypesError_base<{
|
|
8
8
|
readonly types: string[];
|
|
9
9
|
}> {
|
|
10
10
|
}
|
|
11
|
-
declare const RenamedWorkspaceTypeError_base: new <A extends Record<string, any
|
|
11
|
+
declare const RenamedWorkspaceTypeError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").Equals<Omit<A, keyof import("effect/Equal").Equal>, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" | keyof import("effect/Equal").Equal ? never : P]: A[P]; }) => Data.Data<Readonly<A> & {
|
|
12
12
|
readonly _tag: "RenamedWorkspaceTypeError";
|
|
13
13
|
}>;
|
|
14
14
|
export declare class RenamedWorkspaceTypeError extends RenamedWorkspaceTypeError_base<Record<string, never>> {
|
package/dist/constants.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { SemverRange } from './config/types';
|
|
2
1
|
/** Single source of truth, intended to aid testing or to override */
|
|
3
2
|
export declare const CWD: string;
|
|
4
3
|
/** Single source of truth for icons used in output */
|
|
@@ -24,7 +23,6 @@ export declare const RANGE: {
|
|
|
24
23
|
readonly PATCH: "~";
|
|
25
24
|
readonly WORKSPACE: "workspace:";
|
|
26
25
|
};
|
|
27
|
-
export declare const FIXABLE_RANGES: SemverRange[];
|
|
28
26
|
export declare const INTERNAL_TYPES: readonly ["dev", "local", "overrides", "peer", "pnpmOverrides", "prod", "resolutions"];
|
|
29
27
|
export declare const DEFAULT_CONFIG: {
|
|
30
28
|
readonly dependencyTypes: readonly ["**"];
|
package/dist/constants.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DEFAULT_CONFIG = exports.INTERNAL_TYPES = exports.
|
|
3
|
+
exports.DEFAULT_CONFIG = exports.INTERNAL_TYPES = exports.RANGE = exports.ICON = exports.CWD = void 0;
|
|
4
4
|
/** Single source of truth, intended to aid testing or to override */
|
|
5
5
|
exports.CWD = process.env.MOCK_CWD || process.cwd();
|
|
6
6
|
/** Single source of truth for icons used in output */
|
|
@@ -26,7 +26,6 @@ exports.RANGE = {
|
|
|
26
26
|
PATCH: '~',
|
|
27
27
|
WORKSPACE: 'workspace:',
|
|
28
28
|
};
|
|
29
|
-
exports.FIXABLE_RANGES = [exports.RANGE.EXACT, exports.RANGE.MINOR, exports.RANGE.PATCH];
|
|
30
29
|
exports.INTERNAL_TYPES = [
|
|
31
30
|
'dev',
|
|
32
31
|
'local',
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Effect } from 'effect';
|
|
2
2
|
import type { InvalidCustomTypeError } from '../config/get-custom-types';
|
|
3
3
|
import type { DeprecatedTypesError, RenamedWorkspaceTypeError } from '../config/get-enabled-types';
|
|
4
|
-
import type { Ctx } from '../get-context';
|
|
5
4
|
import type { NoSourcesFoundError } from '../get-package-json-files/get-file-paths';
|
|
6
5
|
import type { GlobError } from '../io/glob-sync';
|
|
7
6
|
import type { ReadFileError } from '../io/read-file-sync';
|
|
@@ -22,17 +21,5 @@ export interface ErrorHandlers {
|
|
|
22
21
|
ReadFileError(err: ReadFileError): R;
|
|
23
22
|
WriteFileError(err: WriteFileError): R;
|
|
24
23
|
}
|
|
25
|
-
export declare function chainErrorHandlers(ctx: Ctx, errorHandlers: ErrorHandlers): {
|
|
26
|
-
DeprecatedTypesError: (err: DeprecatedTypesError) => Effect.Effect<never, never, Ctx>;
|
|
27
|
-
GlobError: (err: GlobError) => Effect.Effect<never, never, Ctx>;
|
|
28
|
-
InvalidCustomTypeError: (err: InvalidCustomTypeError) => Effect.Effect<never, never, Ctx>;
|
|
29
|
-
JsonParseError: (err: JsonParseError) => Effect.Effect<never, never, Ctx>;
|
|
30
|
-
NoSourcesFoundError: (err: NoSourcesFoundError) => Effect.Effect<never, never, Ctx>;
|
|
31
|
-
ReadFileError: (err: ReadFileError) => Effect.Effect<never, never, Ctx>;
|
|
32
|
-
RenamedWorkspaceTypeError: (err: RenamedWorkspaceTypeError) => Effect.Effect<never, never, Ctx>;
|
|
33
|
-
SemverGroupConfigError: (err: SemverGroup.ConfigError) => Effect.Effect<never, never, Ctx>;
|
|
34
|
-
VersionGroupConfigError: (err: VersionGroup.ConfigError) => Effect.Effect<never, never, Ctx>;
|
|
35
|
-
WriteFileError: (err: WriteFileError) => Effect.Effect<never, never, Ctx>;
|
|
36
|
-
};
|
|
37
24
|
export declare const defaultErrorHandlers: ErrorHandlers;
|
|
38
25
|
export {};
|
|
@@ -3,29 +3,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.defaultErrorHandlers =
|
|
6
|
+
exports.defaultErrorHandlers = void 0;
|
|
7
7
|
const chalk_1 = __importDefault(require("chalk"));
|
|
8
8
|
const effect_1 = require("effect");
|
|
9
9
|
const os_1 = require("os");
|
|
10
|
-
function chainErrorHandlers(ctx, errorHandlers) {
|
|
11
|
-
const markAsInvalid = effect_1.Effect.map(() => {
|
|
12
|
-
ctx.isInvalid = true;
|
|
13
|
-
return ctx;
|
|
14
|
-
});
|
|
15
|
-
return {
|
|
16
|
-
DeprecatedTypesError: (0, effect_1.flow)(errorHandlers.DeprecatedTypesError, markAsInvalid),
|
|
17
|
-
GlobError: (0, effect_1.flow)(errorHandlers.GlobError, markAsInvalid),
|
|
18
|
-
InvalidCustomTypeError: (0, effect_1.flow)(errorHandlers.InvalidCustomTypeError, markAsInvalid),
|
|
19
|
-
JsonParseError: (0, effect_1.flow)(errorHandlers.JsonParseError, markAsInvalid),
|
|
20
|
-
NoSourcesFoundError: (0, effect_1.flow)(errorHandlers.NoSourcesFoundError, markAsInvalid),
|
|
21
|
-
ReadFileError: (0, effect_1.flow)(errorHandlers.ReadFileError, markAsInvalid),
|
|
22
|
-
RenamedWorkspaceTypeError: (0, effect_1.flow)(errorHandlers.RenamedWorkspaceTypeError, markAsInvalid),
|
|
23
|
-
SemverGroupConfigError: (0, effect_1.flow)(errorHandlers.SemverGroupConfigError, markAsInvalid),
|
|
24
|
-
VersionGroupConfigError: (0, effect_1.flow)(errorHandlers.VersionGroupConfigError, markAsInvalid),
|
|
25
|
-
WriteFileError: (0, effect_1.flow)(errorHandlers.WriteFileError, markAsInvalid),
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
exports.chainErrorHandlers = chainErrorHandlers;
|
|
29
10
|
exports.defaultErrorHandlers = {
|
|
30
11
|
// getContext
|
|
31
12
|
GlobError(err) {
|
|
@@ -2,6 +2,20 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Instance = void 0;
|
|
4
4
|
class Instance {
|
|
5
|
+
/** The name of this dependency */
|
|
6
|
+
name;
|
|
7
|
+
/** The .name property of the package.json file of this instance */
|
|
8
|
+
pkgName;
|
|
9
|
+
/** The specifier as it is on disk before being fixed */
|
|
10
|
+
rawSpecifier;
|
|
11
|
+
/** The package this dependency is installed in this specific time */
|
|
12
|
+
packageJsonFile;
|
|
13
|
+
/** Locates where in the file this dependency is installed */
|
|
14
|
+
strategy;
|
|
15
|
+
/** The semver group this instance belongs to */
|
|
16
|
+
semverGroup;
|
|
17
|
+
/** The version group this instance belongs to */
|
|
18
|
+
versionGroup;
|
|
5
19
|
constructor(name, rawSpecifier, packageJsonFile, strategy) {
|
|
6
20
|
this.name = name;
|
|
7
21
|
this.pkgName = packageJsonFile.jsonFile.contents.name || 'PACKAGE_JSON_HAS_NO_NAME';
|
|
@@ -2,7 +2,7 @@ import { Data, Effect } from 'effect';
|
|
|
2
2
|
import type { Ctx } from '../get-context';
|
|
3
3
|
import type { Io } from '../io';
|
|
4
4
|
import type { GlobError } from '../io/glob-sync';
|
|
5
|
-
declare const NoSourcesFoundError_base: new <A extends Record<string, any
|
|
5
|
+
declare const NoSourcesFoundError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").Equals<Omit<A, keyof import("effect/Equal").Equal>, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" | keyof import("effect/Equal").Equal ? never : P]: A[P]; }) => Data.Data<Readonly<A> & {
|
|
6
6
|
readonly _tag: "NoSourcesFoundError";
|
|
7
7
|
}>;
|
|
8
8
|
export declare class NoSourcesFoundError extends NoSourcesFoundError_base<{
|
|
@@ -4,6 +4,14 @@ exports.PackageJsonFile = void 0;
|
|
|
4
4
|
const effect_1 = require("effect");
|
|
5
5
|
const instance_1 = require("../get-instances/instance");
|
|
6
6
|
class PackageJsonFile {
|
|
7
|
+
/** resolved configuration */
|
|
8
|
+
config;
|
|
9
|
+
/** ensure only one set of instances is ever created and shared */
|
|
10
|
+
_instances;
|
|
11
|
+
/** the wrapped package.json file */
|
|
12
|
+
jsonFile;
|
|
13
|
+
/** the .name property from the package.json file */
|
|
14
|
+
name;
|
|
7
15
|
constructor(jsonFile, config) {
|
|
8
16
|
this._instances = null;
|
|
9
17
|
this.config = config;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Data, Effect } from 'effect';
|
|
2
2
|
import type { Io } from '.';
|
|
3
|
-
declare const AskForChoiceError_base: new <A extends Record<string, any
|
|
3
|
+
declare const AskForChoiceError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").Equals<Omit<A, keyof import("effect/Equal").Equal>, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" | keyof import("effect/Equal").Equal ? never : P]: A[P]; }) => Data.Data<Readonly<A> & {
|
|
4
4
|
readonly _tag: "AskForChoiceError";
|
|
5
5
|
}>;
|
|
6
|
-
|
|
6
|
+
declare class AskForChoiceError extends AskForChoiceError_base<{
|
|
7
7
|
readonly error: string;
|
|
8
8
|
}> {
|
|
9
9
|
}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.askForChoice =
|
|
3
|
+
exports.askForChoice = void 0;
|
|
4
4
|
const effect_1 = require("effect");
|
|
5
5
|
const _1 = require(".");
|
|
6
6
|
class AskForChoiceError extends effect_1.Data.TaggedClass('AskForChoiceError') {
|
|
7
7
|
}
|
|
8
|
-
exports.AskForChoiceError = AskForChoiceError;
|
|
9
8
|
function askForChoice(opts) {
|
|
10
9
|
return (0, effect_1.pipe)(_1.IoTag, effect_1.Effect.flatMap((io) => effect_1.Effect.tryPromise({
|
|
11
10
|
try: () => io.enquirer
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Data, Effect } from 'effect';
|
|
2
2
|
import type { Io } from '.';
|
|
3
|
-
declare const AskForInputError_base: new <A extends Record<string, any
|
|
3
|
+
declare const AskForInputError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").Equals<Omit<A, keyof import("effect/Equal").Equal>, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" | keyof import("effect/Equal").Equal ? never : P]: A[P]; }) => Data.Data<Readonly<A> & {
|
|
4
4
|
readonly _tag: "AskForInputError";
|
|
5
5
|
}>;
|
|
6
|
-
|
|
6
|
+
declare class AskForInputError extends AskForInputError_base<{
|
|
7
7
|
readonly error: string;
|
|
8
8
|
}> {
|
|
9
9
|
}
|
package/dist/io/ask-for-input.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.askForInput =
|
|
3
|
+
exports.askForInput = void 0;
|
|
4
4
|
const effect_1 = require("effect");
|
|
5
5
|
const _1 = require(".");
|
|
6
6
|
class AskForInputError extends effect_1.Data.TaggedClass('AskForInputError') {
|
|
7
7
|
}
|
|
8
|
-
exports.AskForInputError = AskForInputError;
|
|
9
8
|
function askForInput(opts) {
|
|
10
9
|
return (0, effect_1.pipe)(_1.IoTag, effect_1.Effect.flatMap((io) => effect_1.Effect.tryPromise({
|
|
11
10
|
try: () => io.enquirer.prompt({
|