syncpack 12.4.0 → 14.0.0-alpha.1
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/index.js +48 -0
- package/package.json +17 -76
- package/schema.json +917 -0
- package/syncpack.d.ts +122 -0
- package/LICENSE +0 -20
- package/dist/bin-fix-mismatches/fix-mismatches.d.ts +0 -16
- package/dist/bin-fix-mismatches/fix-mismatches.js +0 -110
- package/dist/bin-fix-mismatches/index.d.ts +0 -2
- package/dist/bin-fix-mismatches/index.js +0 -64
- package/dist/bin-format/format.d.ts +0 -13
- package/dist/bin-format/format.js +0 -90
- package/dist/bin-format/index.d.ts +0 -2
- package/dist/bin-format/index.js +0 -53
- package/dist/bin-lint/index.d.ts +0 -2
- package/dist/bin-lint/index.js +0 -38
- package/dist/bin-lint/lint.d.ts +0 -11
- package/dist/bin-lint/lint.js +0 -52
- package/dist/bin-lint-semver-ranges/index.d.ts +0 -2
- package/dist/bin-lint-semver-ranges/index.js +0 -65
- package/dist/bin-lint-semver-ranges/lint-semver-ranges.d.ts +0 -16
- package/dist/bin-lint-semver-ranges/lint-semver-ranges.js +0 -91
- package/dist/bin-list/index.d.ts +0 -2
- package/dist/bin-list/index.js +0 -57
- package/dist/bin-list/list.d.ts +0 -14
- package/dist/bin-list/list.js +0 -147
- package/dist/bin-list-mismatches/index.d.ts +0 -2
- package/dist/bin-list-mismatches/index.js +0 -59
- package/dist/bin-list-mismatches/list-mismatches.d.ts +0 -18
- package/dist/bin-list-mismatches/list-mismatches.js +0 -218
- package/dist/bin-prompt/index.d.ts +0 -2
- package/dist/bin-prompt/index.js +0 -61
- package/dist/bin-prompt/prompt.d.ts +0 -11
- package/dist/bin-prompt/prompt.js +0 -93
- package/dist/bin-set-semver-ranges/index.d.ts +0 -2
- package/dist/bin-set-semver-ranges/index.js +0 -69
- package/dist/bin-set-semver-ranges/set-semver-ranges.d.ts +0 -11
- package/dist/bin-set-semver-ranges/set-semver-ranges.js +0 -58
- package/dist/bin-update/effects.d.ts +0 -52
- package/dist/bin-update/effects.js +0 -267
- package/dist/bin-update/index.d.ts +0 -2
- package/dist/bin-update/index.js +0 -54
- package/dist/bin-update/update.d.ts +0 -6
- package/dist/bin-update/update.js +0 -59
- package/dist/bin.d.ts +0 -2
- package/dist/bin.js +0 -37
- package/dist/config/get-custom-types.d.ts +0 -19
- package/dist/config/get-custom-types.js +0 -50
- package/dist/config/get-enabled-types.d.ts +0 -17
- package/dist/config/get-enabled-types.js +0 -94
- package/dist/config/get-filter.d.ts +0 -2
- package/dist/config/get-filter.js +0 -10
- package/dist/config/get-indent.d.ts +0 -2
- package/dist/config/get-indent.js +0 -9
- package/dist/config/get-sort-az.d.ts +0 -2
- package/dist/config/get-sort-az.js +0 -8
- package/dist/config/get-sort-exports.d.ts +0 -2
- package/dist/config/get-sort-exports.js +0 -8
- package/dist/config/get-sort-first.d.ts +0 -2
- package/dist/config/get-sort-first.js +0 -8
- package/dist/config/get-source.d.ts +0 -2
- package/dist/config/get-source.js +0 -8
- package/dist/config/tag.d.ts +0 -3
- package/dist/config/tag.js +0 -2
- package/dist/config/types.d.ts +0 -132
- package/dist/config/types.js +0 -1
- package/dist/constants.d.ts +0 -106
- package/dist/constants.js +0 -103
- package/dist/error-handlers/default-error-handlers.d.ts +0 -25
- package/dist/error-handlers/default-error-handlers.js +0 -80
- package/dist/get-context/index.d.ts +0 -23
- package/dist/get-context/index.js +0 -18
- package/dist/get-context/lib/key-by.d.ts +0 -6
- package/dist/get-context/lib/key-by.js +0 -12
- package/dist/get-instances/index.d.ts +0 -14
- package/dist/get-instances/index.js +0 -42
- package/dist/get-instances/instance.d.ts +0 -26
- package/dist/get-instances/instance.js +0 -31
- package/dist/get-package-json-files/get-file-paths.d.ts +0 -21
- package/dist/get-package-json-files/get-file-paths.js +0 -22
- package/dist/get-package-json-files/get-patterns/get-lerna-patterns.d.ts +0 -3
- package/dist/get-package-json-files/get-patterns/get-lerna-patterns.js +0 -10
- package/dist/get-package-json-files/get-patterns/get-pnpm-patterns.d.ts +0 -3
- package/dist/get-package-json-files/get-patterns/get-pnpm-patterns.js +0 -14
- package/dist/get-package-json-files/get-patterns/get-yarn-patterns.d.ts +0 -3
- package/dist/get-package-json-files/get-patterns/get-yarn-patterns.js +0 -16
- package/dist/get-package-json-files/get-patterns/index.d.ts +0 -8
- package/dist/get-package-json-files/get-patterns/index.js +0 -23
- package/dist/get-package-json-files/index.d.ts +0 -10
- package/dist/get-package-json-files/index.js +0 -8
- package/dist/get-package-json-files/package-json-file.d.ts +0 -47
- package/dist/get-package-json-files/package-json-file.js +0 -29
- package/dist/guards/can-add-to-group.d.ts +0 -5
- package/dist/guards/can-add-to-group.js +0 -52
- package/dist/guards/is-semver.d.ts +0 -2
- package/dist/guards/is-semver.js +0 -13
- package/dist/guards/is-valid-semver-range.d.ts +0 -3
- package/dist/guards/is-valid-semver-range.js +0 -14
- package/dist/index.d.ts +0 -2
- package/dist/index.js +0 -1
- package/dist/io/ask-for-choice.d.ts +0 -14
- package/dist/io/ask-for-choice.js +0 -17
- package/dist/io/ask-for-input.d.ts +0 -13
- package/dist/io/ask-for-input.js +0 -14
- package/dist/io/exit-if-invalid.d.ts +0 -4
- package/dist/io/exit-if-invalid.js +0 -9
- package/dist/io/glob-sync.d.ts +0 -11
- package/dist/io/glob-sync.js +0 -14
- package/dist/io/index.d.ts +0 -27
- package/dist/io/index.js +0 -26
- package/dist/io/read-config-file.d.ts +0 -7
- package/dist/io/read-config-file.js +0 -22
- package/dist/io/read-file-sync.d.ts +0 -12
- package/dist/io/read-file-sync.js +0 -9
- package/dist/io/read-json-file-sync.d.ts +0 -30
- package/dist/io/read-json-file-sync.js +0 -19
- package/dist/io/read-yaml-file-sync.d.ts +0 -12
- package/dist/io/read-yaml-file-sync.js +0 -9
- package/dist/io/to-json.d.ts +0 -9
- package/dist/io/to-json.js +0 -29
- package/dist/io/write-file-sync.d.ts +0 -12
- package/dist/io/write-file-sync.js +0 -10
- package/dist/io/write-if-changed.d.ts +0 -5
- package/dist/io/write-if-changed.js +0 -10
- package/dist/lib/format-repository-url.d.ts +0 -1
- package/dist/lib/format-repository-url.js +0 -37
- package/dist/lib/get-group-header.d.ts +0 -10
- package/dist/lib/get-group-header.js +0 -23
- package/dist/lib/get.d.ts +0 -11
- package/dist/lib/get.js +0 -36
- package/dist/lib/pad-start.d.ts +0 -1
- package/dist/lib/pad-start.js +0 -3
- package/dist/lib/ring-buffer.d.ts +0 -10
- package/dist/lib/ring-buffer.js +0 -20
- package/dist/lib/set-semver-range.d.ts +0 -3
- package/dist/lib/set-semver-range.js +0 -20
- package/dist/lib/show-help-on-error.d.ts +0 -2
- package/dist/lib/show-help-on-error.js +0 -32
- package/dist/lib/sort-by-name.d.ts +0 -5
- package/dist/lib/sort-by-name.js +0 -9
- package/dist/lib/with-logger.d.ts +0 -2
- package/dist/lib/with-logger.js +0 -29
- package/dist/option.d.ts +0 -10
- package/dist/option.js +0 -27
- package/dist/report.d.ts +0 -131
- package/dist/report.js +0 -129
- package/dist/schema.json +0 -544
- package/dist/semver-group/create-semver-groups.d.ts +0 -4
- package/dist/semver-group/create-semver-groups.js +0 -79
- package/dist/semver-group/disabled.d.ts +0 -26
- package/dist/semver-group/disabled.js +0 -28
- package/dist/semver-group/filtered-out.d.ts +0 -27
- package/dist/semver-group/filtered-out.js +0 -34
- package/dist/semver-group/ignored.d.ts +0 -22
- package/dist/semver-group/ignored.js +0 -24
- package/dist/semver-group/index.d.ts +0 -20
- package/dist/semver-group/index.js +0 -7
- package/dist/semver-group/with-range.d.ts +0 -22
- package/dist/semver-group/with-range.js +0 -45
- package/dist/specifier/alias.d.ts +0 -17
- package/dist/specifier/alias.js +0 -20
- package/dist/specifier/base.d.ts +0 -41
- package/dist/specifier/base.js +0 -54
- package/dist/specifier/delete.d.ts +0 -17
- package/dist/specifier/delete.js +0 -16
- package/dist/specifier/exact.d.ts +0 -20
- package/dist/specifier/exact.js +0 -21
- package/dist/specifier/file.d.ts +0 -8
- package/dist/specifier/file.js +0 -7
- package/dist/specifier/hosted-git.d.ts +0 -15
- package/dist/specifier/hosted-git.js +0 -22
- package/dist/specifier/index.d.ts +0 -28
- package/dist/specifier/index.js +0 -63
- package/dist/specifier/latest.d.ts +0 -19
- package/dist/specifier/latest.js +0 -20
- package/dist/specifier/lib/non-semver-error.d.ts +0 -11
- package/dist/specifier/lib/non-semver-error.js +0 -6
- package/dist/specifier/lib/parse-specifier.d.ts +0 -14
- package/dist/specifier/lib/parse-specifier.js +0 -16
- package/dist/specifier/lib/specific-registry-result.d.ts +0 -9
- package/dist/specifier/lib/specific-registry-result.js +0 -1
- package/dist/specifier/range.d.ts +0 -19
- package/dist/specifier/range.js +0 -20
- package/dist/specifier/tag.d.ts +0 -11
- package/dist/specifier/tag.js +0 -10
- package/dist/specifier/unsupported.d.ts +0 -7
- package/dist/specifier/unsupported.js +0 -7
- package/dist/specifier/url.d.ts +0 -8
- package/dist/specifier/url.js +0 -7
- package/dist/specifier/workspace-protocol.d.ts +0 -19
- package/dist/specifier/workspace-protocol.js +0 -34
- package/dist/strategy/lib/get-non-empty-string-prop.d.ts +0 -3
- package/dist/strategy/lib/get-non-empty-string-prop.js +0 -7
- package/dist/strategy/name-and-version-props.d.ts +0 -12
- package/dist/strategy/name-and-version-props.js +0 -60
- package/dist/strategy/named-version-string.d.ts +0 -11
- package/dist/strategy/named-version-string.js +0 -49
- package/dist/strategy/unnamed-version-string.d.ts +0 -11
- package/dist/strategy/unnamed-version-string.js +0 -45
- package/dist/strategy/versions-by-name.d.ts +0 -11
- package/dist/strategy/versions-by-name.js +0 -25
- package/dist/version-group/banned.d.ts +0 -17
- package/dist/version-group/banned.js +0 -26
- package/dist/version-group/create-version-groups.d.ts +0 -4
- package/dist/version-group/create-version-groups.js +0 -114
- package/dist/version-group/filtered-out.d.ts +0 -19
- package/dist/version-group/filtered-out.js +0 -30
- package/dist/version-group/ignored.d.ts +0 -17
- package/dist/version-group/ignored.js +0 -23
- package/dist/version-group/index.d.ts +0 -26
- package/dist/version-group/index.js +0 -7
- package/dist/version-group/lib/clean.d.ts +0 -2
- package/dist/version-group/lib/clean.js +0 -6
- package/dist/version-group/lib/delete.d.ts +0 -2
- package/dist/version-group/lib/delete.js +0 -1
- package/dist/version-group/lib/get-highest-version.d.ts +0 -6
- package/dist/version-group/lib/get-highest-version.js +0 -8
- package/dist/version-group/lib/get-lowest-version.d.ts +0 -6
- package/dist/version-group/lib/get-lowest-version.js +0 -8
- package/dist/version-group/lib/get-preferred-version.d.ts +0 -5
- package/dist/version-group/lib/get-preferred-version.js +0 -44
- package/dist/version-group/lib/get-range-score.d.ts +0 -2
- package/dist/version-group/lib/get-range-score.js +0 -18
- package/dist/version-group/lib/group-by.d.ts +0 -5
- package/dist/version-group/lib/group-by.js +0 -11
- package/dist/version-group/pinned.d.ts +0 -17
- package/dist/version-group/pinned.js +0 -26
- package/dist/version-group/same-range.d.ts +0 -19
- package/dist/version-group/same-range.js +0 -96
- package/dist/version-group/snapped-to.d.ts +0 -17
- package/dist/version-group/snapped-to.js +0 -69
- package/dist/version-group/standard.d.ts +0 -18
- package/dist/version-group/standard.js +0 -116
|
@@ -1,218 +0,0 @@
|
|
|
1
|
-
import chalk from 'chalk-template';
|
|
2
|
-
import { Context, Effect, pipe } from 'effect';
|
|
3
|
-
import { EOL } from 'os';
|
|
4
|
-
import { CliConfigTag } from '../config/tag.js';
|
|
5
|
-
import { ICON } from '../constants.js';
|
|
6
|
-
import { defaultErrorHandlers } from '../error-handlers/default-error-handlers.js';
|
|
7
|
-
import { getContext } from '../get-context/index.js';
|
|
8
|
-
import { getInstances } from '../get-instances/index.js';
|
|
9
|
-
import { exitIfInvalid } from '../io/exit-if-invalid.js';
|
|
10
|
-
import { IoTag } from '../io/index.js';
|
|
11
|
-
import { getVersionGroupHeader } from '../lib/get-group-header.js';
|
|
12
|
-
import { padStart } from '../lib/pad-start.js';
|
|
13
|
-
import { withLogger } from '../lib/with-logger.js';
|
|
14
|
-
export function listMismatches({ io, cli, errorHandlers = defaultErrorHandlers }) {
|
|
15
|
-
return pipe(getContext({ io, cli, errorHandlers }), Effect.flatMap((ctx) => pipeline(ctx, io, errorHandlers)), Effect.flatMap(exitIfInvalid), Effect.provide(pipe(Context.empty(), Context.add(CliConfigTag, cli), Context.add(IoTag, io))), withLogger);
|
|
16
|
-
}
|
|
17
|
-
/** Exported to be reused by `syncpack lint` */
|
|
18
|
-
export function pipeline(ctx, io, errorHandlers) {
|
|
19
|
-
return Effect.gen(function* ($) {
|
|
20
|
-
const { versionGroups } = yield* $(getInstances(ctx, io, errorHandlers));
|
|
21
|
-
let index = 0;
|
|
22
|
-
for (const group of versionGroups) {
|
|
23
|
-
const countByReportGroup = {
|
|
24
|
-
Excluded: 0,
|
|
25
|
-
Fixable: 0,
|
|
26
|
-
Unfixable: 0,
|
|
27
|
-
Valid: 0,
|
|
28
|
-
};
|
|
29
|
-
yield* $(Effect.logInfo(getVersionGroupHeader({ group, index })));
|
|
30
|
-
for (const groupReport of yield* $(group.inspectAll())) {
|
|
31
|
-
for (const report of groupReport.reports) {
|
|
32
|
-
countByReportGroup[report._tagGroup]++;
|
|
33
|
-
if (report.isInvalid)
|
|
34
|
-
ctx.isInvalid = true;
|
|
35
|
-
const logReport = onReportTag[report._tag];
|
|
36
|
-
if (logReport)
|
|
37
|
-
yield* $(logReport(report));
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
yield* $(onReportGroup.Valid(countByReportGroup.Valid));
|
|
41
|
-
yield* $(onReportGroup.Fixable(countByReportGroup.Fixable));
|
|
42
|
-
yield* $(onReportGroup.Unfixable(countByReportGroup.Unfixable));
|
|
43
|
-
yield* $(onReportGroup.Excluded(countByReportGroup.Excluded));
|
|
44
|
-
index++;
|
|
45
|
-
}
|
|
46
|
-
return ctx;
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
const onReportGroup = {
|
|
50
|
-
Excluded(amount) {
|
|
51
|
-
if (amount === 0)
|
|
52
|
-
return Effect.void;
|
|
53
|
-
const msg = chalk `{gray ${padStart(amount)} ${ICON.rightArrow} ignored}`;
|
|
54
|
-
return Effect.logInfo(msg);
|
|
55
|
-
},
|
|
56
|
-
Fixable(amount) {
|
|
57
|
-
if (amount === 0)
|
|
58
|
-
return Effect.void;
|
|
59
|
-
const msg = chalk `${padStart(amount)} {green ${ICON.tick}} can be auto-fixed`;
|
|
60
|
-
return Effect.logInfo(msg);
|
|
61
|
-
},
|
|
62
|
-
Unfixable(amount) {
|
|
63
|
-
if (amount === 0)
|
|
64
|
-
return Effect.void;
|
|
65
|
-
const msg = chalk `{red ${padStart(amount)} ${ICON.panic} can be fixed manually using} {blue syncpack prompt}`;
|
|
66
|
-
return Effect.logInfo(msg);
|
|
67
|
-
},
|
|
68
|
-
Valid(amount) {
|
|
69
|
-
if (amount === 0)
|
|
70
|
-
return Effect.void;
|
|
71
|
-
const msg = chalk `${padStart(amount)} {green ${ICON.tick}} already valid`;
|
|
72
|
-
return Effect.logInfo(msg);
|
|
73
|
-
},
|
|
74
|
-
};
|
|
75
|
-
const onReportTag = {
|
|
76
|
-
Banned(report) {
|
|
77
|
-
const _tag = report._tag;
|
|
78
|
-
const instance = report.fixable.instance;
|
|
79
|
-
const name = instance.name;
|
|
80
|
-
const jsonFile = instance.packageJsonFile.jsonFile;
|
|
81
|
-
const path = instance.strategy.path;
|
|
82
|
-
const shortPath = jsonFile.shortPath;
|
|
83
|
-
return Effect.logInfo(chalk `{red ${ICON.cross}} ${name} {red banned} {gray ${shortPath} > ${path}} {blue [${_tag}]}`);
|
|
84
|
-
},
|
|
85
|
-
Disabled(_report) {
|
|
86
|
-
return Effect.void;
|
|
87
|
-
},
|
|
88
|
-
FilteredOut(_report) {
|
|
89
|
-
return Effect.void;
|
|
90
|
-
},
|
|
91
|
-
HighestSemverMismatch(report) {
|
|
92
|
-
const _tag = report._tag;
|
|
93
|
-
const fixable = report.fixable;
|
|
94
|
-
const instance = fixable.instance;
|
|
95
|
-
const jsonFile = instance.packageJsonFile.jsonFile;
|
|
96
|
-
const actual = instance.rawSpecifier.raw;
|
|
97
|
-
const expected = fixable.raw;
|
|
98
|
-
const name = instance.name;
|
|
99
|
-
const path = instance.strategy.path;
|
|
100
|
-
const shortPath = jsonFile.shortPath;
|
|
101
|
-
return Effect.logInfo(chalk `{red ${ICON.cross}} ${name} {red ${actual}} {dim ${ICON.rightArrow}} {green ${expected}} {gray ${shortPath} > ${path}} {blue [${_tag}]}`);
|
|
102
|
-
},
|
|
103
|
-
Ignored(_report) {
|
|
104
|
-
return Effect.void;
|
|
105
|
-
},
|
|
106
|
-
LocalPackageMismatch(report) {
|
|
107
|
-
const _tag = report._tag;
|
|
108
|
-
const fixable = report.fixable;
|
|
109
|
-
const instance = fixable.instance;
|
|
110
|
-
const actual = instance.rawSpecifier.raw;
|
|
111
|
-
const expected = fixable.raw;
|
|
112
|
-
const name = instance.name;
|
|
113
|
-
const path = instance.strategy.path;
|
|
114
|
-
const shortPath = instance.packageJsonFile.jsonFile.shortPath;
|
|
115
|
-
return Effect.logInfo(chalk `{red ${ICON.cross}} ${name} {red ${actual}} {dim ${ICON.rightArrow}} {green ${expected}} {gray ${shortPath} > ${path}} {blue [${_tag}]}`);
|
|
116
|
-
},
|
|
117
|
-
LowestSemverMismatch(report) {
|
|
118
|
-
const _tag = report._tag;
|
|
119
|
-
const fixable = report.fixable;
|
|
120
|
-
const instance = fixable.instance;
|
|
121
|
-
const actual = instance.rawSpecifier.raw;
|
|
122
|
-
const expected = fixable.raw;
|
|
123
|
-
const name = instance.name;
|
|
124
|
-
const path = instance.strategy.path;
|
|
125
|
-
const shortPath = instance.packageJsonFile.jsonFile.shortPath;
|
|
126
|
-
return Effect.logInfo(chalk `{red ${ICON.cross}} ${name} {red ${actual}} {dim ${ICON.rightArrow}} {green ${expected}} {gray ${shortPath} > ${path}} {blue [${_tag}]}`);
|
|
127
|
-
},
|
|
128
|
-
MissingLocalVersion(report) {
|
|
129
|
-
const instance = report.unfixable;
|
|
130
|
-
const localPath = report.localInstance.packageJsonFile.jsonFile.shortPath;
|
|
131
|
-
const jsonFile = instance.packageJsonFile.jsonFile;
|
|
132
|
-
const actual = instance.rawSpecifier.raw;
|
|
133
|
-
const name = instance.name;
|
|
134
|
-
const path = instance.strategy.path;
|
|
135
|
-
const shortPath = jsonFile.shortPath;
|
|
136
|
-
return Effect.logInfo([
|
|
137
|
-
chalk `{red ${ICON.cross}} ${name} {red ${actual}} {dim ${ICON.rightArrow}} {red ???} {gray ${shortPath} > ${path}} {blue [MissingLocalVersion]}`,
|
|
138
|
-
chalk ` {red ${localPath} does not have a .version property which is exact semver}`,
|
|
139
|
-
].join(EOL));
|
|
140
|
-
},
|
|
141
|
-
MissingSnappedToMismatch(report) {
|
|
142
|
-
const instance = report.unfixable;
|
|
143
|
-
const jsonFile = instance.packageJsonFile.jsonFile;
|
|
144
|
-
const actual = instance.rawSpecifier.raw;
|
|
145
|
-
const name = instance.name;
|
|
146
|
-
const path = instance.strategy.path;
|
|
147
|
-
const shortPath = jsonFile.shortPath;
|
|
148
|
-
return Effect.logInfo([
|
|
149
|
-
chalk `{red ${ICON.cross}} ${name} {red ${actual}} {dim ${ICON.rightArrow}} {red ???} {gray ${shortPath} > ${path}} {blue [MissingSnappedToMismatch]}`,
|
|
150
|
-
chalk ` {red no package in this groups .snapTo array depend on ${name}}`,
|
|
151
|
-
].join(EOL));
|
|
152
|
-
},
|
|
153
|
-
PinnedMismatch(report) {
|
|
154
|
-
const _tag = report._tag;
|
|
155
|
-
const fixable = report.fixable;
|
|
156
|
-
const instance = fixable.instance;
|
|
157
|
-
const actual = instance.rawSpecifier.raw;
|
|
158
|
-
const expected = fixable.raw;
|
|
159
|
-
const name = instance.name;
|
|
160
|
-
const path = instance.strategy.path;
|
|
161
|
-
const shortPath = instance.packageJsonFile.jsonFile.shortPath;
|
|
162
|
-
return Effect.logInfo(chalk `{red ${ICON.cross}} ${name} {red ${actual}} {dim ${ICON.rightArrow}} {green ${expected}} {gray ${shortPath} > ${path}} {blue [${_tag}]}`);
|
|
163
|
-
},
|
|
164
|
-
SameRangeMismatch(report) {
|
|
165
|
-
const instance = report.unfixable;
|
|
166
|
-
const jsonFile = instance.packageJsonFile.jsonFile;
|
|
167
|
-
const actual = instance.rawSpecifier.raw;
|
|
168
|
-
const name = instance.name;
|
|
169
|
-
const path = instance.strategy.path;
|
|
170
|
-
const shortPath = jsonFile.shortPath;
|
|
171
|
-
const mismatches = report.mismatches;
|
|
172
|
-
return Effect.logInfo([
|
|
173
|
-
chalk `{red ${ICON.cross}} ${name} {red range ${actual} does not include ${mismatches.join(', ')}} {gray ${shortPath} > ${path}} {blue [SameRangeMismatch]}`,
|
|
174
|
-
chalk ` {gray use {blue syncpack prompt} to fix this manually}`,
|
|
175
|
-
].join(EOL));
|
|
176
|
-
},
|
|
177
|
-
SemverRangeMismatch(report) {
|
|
178
|
-
const _tag = report._tag;
|
|
179
|
-
const fixable = report.fixable;
|
|
180
|
-
const instance = fixable.instance;
|
|
181
|
-
const actual = instance.rawSpecifier.raw;
|
|
182
|
-
const expected = fixable.raw;
|
|
183
|
-
const name = instance.name;
|
|
184
|
-
const path = instance.strategy.path;
|
|
185
|
-
const shortPath = instance.packageJsonFile.jsonFile.shortPath;
|
|
186
|
-
return Effect.logInfo(chalk `{red ${ICON.cross}} ${name} {red ${actual}} {dim ${ICON.rightArrow}} {green ${expected}} {gray ${shortPath} > ${path}} {blue [${_tag}]}`);
|
|
187
|
-
},
|
|
188
|
-
SnappedToMismatch(report) {
|
|
189
|
-
const _tag = report._tag;
|
|
190
|
-
const fixable = report.fixable;
|
|
191
|
-
const instance = fixable.instance;
|
|
192
|
-
const actual = instance.rawSpecifier.raw;
|
|
193
|
-
const expected = fixable.raw;
|
|
194
|
-
const name = instance.name;
|
|
195
|
-
const path = instance.strategy.path;
|
|
196
|
-
const shortPath = instance.packageJsonFile.jsonFile.shortPath;
|
|
197
|
-
return Effect.logInfo(chalk `{red ${ICON.cross}} ${name} {red ${actual}} {dim ${ICON.rightArrow}} {green ${expected}} {gray ${shortPath} > ${path}} {blue [${_tag}]}`);
|
|
198
|
-
},
|
|
199
|
-
UnsupportedMismatch(report) {
|
|
200
|
-
const instance = report.unfixable;
|
|
201
|
-
const jsonFile = instance.packageJsonFile.jsonFile;
|
|
202
|
-
const actual = instance.rawSpecifier.raw;
|
|
203
|
-
const name = instance.name;
|
|
204
|
-
const path = instance.strategy.path;
|
|
205
|
-
const shortPath = jsonFile.shortPath;
|
|
206
|
-
return Effect.logInfo([
|
|
207
|
-
chalk `{red ${ICON.cross}} ${name} {red ${actual}} {dim ${ICON.rightArrow}} {red ???} {gray ${shortPath} > ${path}} {blue [UnsupportedMismatch]}`,
|
|
208
|
-
chalk ` {red use {blue syncpack prompt} to fix this manually}`,
|
|
209
|
-
].join(EOL));
|
|
210
|
-
},
|
|
211
|
-
Valid(_report) {
|
|
212
|
-
return Effect.void;
|
|
213
|
-
},
|
|
214
|
-
};
|
|
215
|
-
export const logMissingLocalVersion = onReportTag.MissingLocalVersion;
|
|
216
|
-
export const logMissingSnappedToMismatch = onReportTag.MissingSnappedToMismatch;
|
|
217
|
-
export const logUnsupportedMismatch = onReportTag.UnsupportedMismatch;
|
|
218
|
-
export const logSameRangeMismatch = onReportTag.SameRangeMismatch;
|
package/dist/bin-prompt/index.js
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import chalk from 'chalk-template';
|
|
3
|
-
import { program } from 'commander';
|
|
4
|
-
import { Effect } from 'effect';
|
|
5
|
-
import { io } from '../io/index.js';
|
|
6
|
-
import { showHelpOnError } from '../lib/show-help-on-error.js';
|
|
7
|
-
import { option } from '../option.js';
|
|
8
|
-
import { prompt } from './prompt.js';
|
|
9
|
-
program.description(' displays a series of prompts to fix mismatches which syncpack cannot fix automatically');
|
|
10
|
-
program.on('--help', () => {
|
|
11
|
-
console.log(chalk `
|
|
12
|
-
Examples:
|
|
13
|
-
{dim # uses defaults for resolving packages}
|
|
14
|
-
syncpack prompt
|
|
15
|
-
{dim # uses packages defined by --source when provided}
|
|
16
|
-
syncpack prompt --source {yellow "apps/*/package.json"}
|
|
17
|
-
{dim # multiple globs can be provided like this}
|
|
18
|
-
syncpack prompt --source {yellow "apps/*/package.json"} --source {yellow "core/*/package.json"}
|
|
19
|
-
{dim # uses dependencies regular expression defined by --filter when provided}
|
|
20
|
-
syncpack prompt --filter {yellow "typescript|tslint"}
|
|
21
|
-
{dim # only inspect "devDependencies"}
|
|
22
|
-
syncpack prompt --types dev
|
|
23
|
-
{dim # only inspect "devDependencies" and "peerDependencies"}
|
|
24
|
-
syncpack prompt --types dev,peer
|
|
25
|
-
{dim # indent package.json with 4 spaces instead of 2}
|
|
26
|
-
syncpack prompt --indent {yellow " "}
|
|
27
|
-
|
|
28
|
-
Resolving Packages:
|
|
29
|
-
1. If {yellow --source} globs are provided, use those.
|
|
30
|
-
2. If using Pnpm Workspaces, read {yellow packages} from {yellow pnpm-workspace.yaml} in the root of the project.
|
|
31
|
-
3. If using Yarn Workspaces, read {yellow workspaces} from {yellow package.json}.
|
|
32
|
-
4. If using Lerna, read {yellow packages} from {yellow lerna.json}.
|
|
33
|
-
5. Default to {yellow "package.json"} and {yellow "packages/*/package.json"}.
|
|
34
|
-
|
|
35
|
-
Reference:
|
|
36
|
-
globs {blue.underline https://github.com/isaacs/node-glob#glob-primer}
|
|
37
|
-
lerna.json {blue.underline https://github.com/lerna/lerna#lernajson}
|
|
38
|
-
Yarn Workspaces {blue.underline https://yarnpkg.com/lang/en/docs/workspaces}
|
|
39
|
-
Pnpm Workspaces {blue.underline https://pnpm.js.org/en/workspaces}
|
|
40
|
-
`);
|
|
41
|
-
});
|
|
42
|
-
showHelpOnError(program);
|
|
43
|
-
program
|
|
44
|
-
.option(...option.source)
|
|
45
|
-
.option(...option.filter)
|
|
46
|
-
.option(...option.config)
|
|
47
|
-
.option(...option.specs)
|
|
48
|
-
.option(...option.types)
|
|
49
|
-
.option(...option.indent)
|
|
50
|
-
.parse(process.argv);
|
|
51
|
-
Effect.runPromise(prompt({
|
|
52
|
-
io,
|
|
53
|
-
cli: {
|
|
54
|
-
configPath: program.opts().config,
|
|
55
|
-
filter: program.opts().filter,
|
|
56
|
-
source: program.opts().source,
|
|
57
|
-
specs: program.opts().specs,
|
|
58
|
-
types: program.opts().types,
|
|
59
|
-
indent: program.opts().indent,
|
|
60
|
-
},
|
|
61
|
-
}));
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Effect } from 'effect';
|
|
2
|
-
import { type CliConfig } from '../config/types.js';
|
|
3
|
-
import type { ErrorHandlers } from '../error-handlers/default-error-handlers.js';
|
|
4
|
-
import type { Io } from '../io/index.js';
|
|
5
|
-
interface Input {
|
|
6
|
-
io: Io;
|
|
7
|
-
cli: Partial<CliConfig>;
|
|
8
|
-
errorHandlers?: ErrorHandlers;
|
|
9
|
-
}
|
|
10
|
-
export declare function prompt({ io, cli, errorHandlers }: Input): Effect.Effect<unknown, never, never>;
|
|
11
|
-
export {};
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import chalk from 'chalk-template';
|
|
2
|
-
import { Context, Effect, flow, pipe } from 'effect';
|
|
3
|
-
import { uniq } from 'tightrope/array/uniq.js';
|
|
4
|
-
import { isString } from 'tightrope/guard/is-string.js';
|
|
5
|
-
import { logOtherCommands } from '../bin-list/list.js';
|
|
6
|
-
import { CliConfigTag } from '../config/tag.js';
|
|
7
|
-
import { ICON } from '../constants.js';
|
|
8
|
-
import { defaultErrorHandlers } from '../error-handlers/default-error-handlers.js';
|
|
9
|
-
import { getContext } from '../get-context/index.js';
|
|
10
|
-
import { getInstances } from '../get-instances/index.js';
|
|
11
|
-
import { askForChoice } from '../io/ask-for-choice.js';
|
|
12
|
-
import { askForInput } from '../io/ask-for-input.js';
|
|
13
|
-
import { exitIfInvalid } from '../io/exit-if-invalid.js';
|
|
14
|
-
import { IoTag } from '../io/index.js';
|
|
15
|
-
import { writeIfChanged } from '../io/write-if-changed.js';
|
|
16
|
-
import { getVersionGroupHeader } from '../lib/get-group-header.js';
|
|
17
|
-
import { withLogger } from '../lib/with-logger.js';
|
|
18
|
-
export function prompt({ io, cli, errorHandlers = defaultErrorHandlers }) {
|
|
19
|
-
return pipe(getContext({ io, cli, errorHandlers }), Effect.flatMap((ctx) => pipe(Effect.gen(function* ($) {
|
|
20
|
-
const { versionGroups } = yield* $(getInstances(ctx, io, errorHandlers));
|
|
21
|
-
let unfixableCount = 0;
|
|
22
|
-
let index = 0;
|
|
23
|
-
for (const group of versionGroups) {
|
|
24
|
-
const unfixable = [];
|
|
25
|
-
for (const groupReport of yield* $(group.inspectAll())) {
|
|
26
|
-
for (const report of groupReport.reports) {
|
|
27
|
-
if (isUnfixable(report)) {
|
|
28
|
-
unfixable.push(report);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
if (unfixable.length) {
|
|
32
|
-
unfixableCount += unfixable.length;
|
|
33
|
-
Effect.logInfo(getVersionGroupHeader({ group, index }));
|
|
34
|
-
yield* $(askForNextVersion(groupReport, unfixable));
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
index++;
|
|
38
|
-
}
|
|
39
|
-
if (unfixableCount) {
|
|
40
|
-
yield* $(writeIfChanged(ctx));
|
|
41
|
-
}
|
|
42
|
-
else {
|
|
43
|
-
const msg = chalk `{green ${ICON.tick}} no issues which syncpack cannot fix automatically`;
|
|
44
|
-
yield* $(Effect.logInfo(msg));
|
|
45
|
-
yield* $(logOtherCommands());
|
|
46
|
-
}
|
|
47
|
-
return ctx;
|
|
48
|
-
}), Effect.catchTags({
|
|
49
|
-
WriteFileError: flow(errorHandlers.WriteFileError, Effect.map(() => {
|
|
50
|
-
ctx.isInvalid = true;
|
|
51
|
-
return ctx;
|
|
52
|
-
})),
|
|
53
|
-
}), Effect.flatMap(exitIfInvalid))), Effect.provide(pipe(Context.empty(), Context.add(CliConfigTag, cli), Context.add(IoTag, io))), withLogger);
|
|
54
|
-
}
|
|
55
|
-
function isUnfixable(report) {
|
|
56
|
-
return (report._tag === 'MissingLocalVersion' ||
|
|
57
|
-
report._tag === 'MissingSnappedToMismatch' ||
|
|
58
|
-
report._tag === 'SameRangeMismatch' ||
|
|
59
|
-
report._tag === 'UnsupportedMismatch');
|
|
60
|
-
}
|
|
61
|
-
function askForNextVersion(groupReport, unfixable) {
|
|
62
|
-
return pipe(Effect.gen(function* ($) {
|
|
63
|
-
const choices = uniq(groupReport.reports.map((report) => report._tagGroup === 'Fixable'
|
|
64
|
-
? report.fixable.raw
|
|
65
|
-
: report._tagGroup === 'Unfixable'
|
|
66
|
-
? report.unfixable.rawSpecifier
|
|
67
|
-
: report._tagGroup === 'Valid'
|
|
68
|
-
? report.specifier.raw
|
|
69
|
-
: null)).filter(isString);
|
|
70
|
-
const OTHER = chalk `{dim Other}`;
|
|
71
|
-
const SKIP = chalk `{dim Skip}`;
|
|
72
|
-
const QUIT = chalk `{dim Quit}`;
|
|
73
|
-
// Ask user to choose a version to align on
|
|
74
|
-
const choice = yield* $(askForChoice({
|
|
75
|
-
message: groupReport.name,
|
|
76
|
-
choices: [...choices, OTHER, SKIP, QUIT],
|
|
77
|
-
}));
|
|
78
|
-
if (choice === SKIP)
|
|
79
|
-
return;
|
|
80
|
-
// @TODO: Learn https://www.effect.website/docs/data-types/exit
|
|
81
|
-
if (choice === QUIT)
|
|
82
|
-
return process.exit(0);
|
|
83
|
-
const nextVersion = choice === OTHER
|
|
84
|
-
? yield* $(askForInput({
|
|
85
|
-
message: chalk `${groupReport.name} {dim Enter a replacement version}`,
|
|
86
|
-
}))
|
|
87
|
-
: choice;
|
|
88
|
-
yield* $(pipe(unfixable, Effect.forEach((report) => report.unfixable.write(nextVersion))));
|
|
89
|
-
}), Effect.catchTags({
|
|
90
|
-
AskForChoiceError: Effect.logDebug,
|
|
91
|
-
AskForInputError: Effect.logDebug,
|
|
92
|
-
}));
|
|
93
|
-
}
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import chalk from 'chalk-template';
|
|
3
|
-
import { program } from 'commander';
|
|
4
|
-
import { Effect } from 'effect';
|
|
5
|
-
import { io } from '../io/index.js';
|
|
6
|
-
import { showHelpOnError } from '../lib/show-help-on-error.js';
|
|
7
|
-
import { option } from '../option.js';
|
|
8
|
-
import { setSemverRanges } from './set-semver-ranges.js';
|
|
9
|
-
program.description(chalk `
|
|
10
|
-
Ensure dependency versions within {yellow dependencies}, {yellow devDependencies},
|
|
11
|
-
{yellow peerDependencies}, {yellow overrides}, and {yellow resolutions} follow a consistent format.`.replace(/^\n/, ''));
|
|
12
|
-
program.on('--help', () => {
|
|
13
|
-
console.log(chalk `
|
|
14
|
-
Examples:
|
|
15
|
-
{dim # uses defaults for resolving packages}
|
|
16
|
-
syncpack set-semver-ranges
|
|
17
|
-
{dim # uses packages defined by --source when provided}
|
|
18
|
-
syncpack set-semver-ranges --source {yellow "apps/*/package.json"}
|
|
19
|
-
{dim # multiple globs can be provided like this}
|
|
20
|
-
syncpack set-semver-ranges --source {yellow "apps/*/package.json"} --source {yellow "core/*/package.json"}
|
|
21
|
-
{dim # uses dependencies regular expression defined by --filter when provided}
|
|
22
|
-
syncpack set-semver-ranges --filter {yellow "typescript|tslint"}
|
|
23
|
-
{dim # indent package.json with 4 spaces instead of 2}
|
|
24
|
-
syncpack set-semver-ranges --indent {yellow " "}
|
|
25
|
-
|
|
26
|
-
Supported Ranges:
|
|
27
|
-
< {dim <1.4.2}
|
|
28
|
-
<= {dim <=1.4.2}
|
|
29
|
-
"" {dim 1.4.2}
|
|
30
|
-
~ {dim ~1.4.2}
|
|
31
|
-
^ {dim ^1.4.2}
|
|
32
|
-
>= {dim >=1.4.2}
|
|
33
|
-
> {dim >1.4.2}
|
|
34
|
-
* {dim *}
|
|
35
|
-
|
|
36
|
-
Resolving Packages:
|
|
37
|
-
1. If {yellow --source} globs are provided, use those.
|
|
38
|
-
2. If using Pnpm Workspaces, read {yellow packages} from {yellow pnpm-workspace.yaml} in the root of the project.
|
|
39
|
-
3. If using Yarn Workspaces, read {yellow workspaces} from {yellow package.json}.
|
|
40
|
-
4. If using Lerna, read {yellow packages} from {yellow lerna.json}.
|
|
41
|
-
5. Default to {yellow "package.json"} and {yellow "packages/*/package.json"}.
|
|
42
|
-
|
|
43
|
-
Reference:
|
|
44
|
-
globs {blue.underline https://github.com/isaacs/node-glob#glob-primer}
|
|
45
|
-
lerna.json {blue.underline https://github.com/lerna/lerna#lernajson}
|
|
46
|
-
Yarn Workspaces {blue.underline https://yarnpkg.com/lang/en/docs/workspaces}
|
|
47
|
-
Pnpm Workspaces {blue.underline https://pnpm.js.org/en/workspaces}
|
|
48
|
-
`);
|
|
49
|
-
});
|
|
50
|
-
showHelpOnError(program);
|
|
51
|
-
program
|
|
52
|
-
.option(...option.source)
|
|
53
|
-
.option(...option.filter)
|
|
54
|
-
.option(...option.config)
|
|
55
|
-
.option(...option.specs)
|
|
56
|
-
.option(...option.types)
|
|
57
|
-
.option(...option.indent)
|
|
58
|
-
.parse(process.argv);
|
|
59
|
-
Effect.runPromise(setSemverRanges({
|
|
60
|
-
io,
|
|
61
|
-
cli: {
|
|
62
|
-
configPath: program.opts().config,
|
|
63
|
-
filter: program.opts().filter,
|
|
64
|
-
indent: program.opts().indent,
|
|
65
|
-
source: program.opts().source,
|
|
66
|
-
specs: program.opts().specs,
|
|
67
|
-
types: program.opts().types,
|
|
68
|
-
},
|
|
69
|
-
}));
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Effect } from 'effect';
|
|
2
|
-
import { type CliConfig } from '../config/types.js';
|
|
3
|
-
import type { ErrorHandlers } from '../error-handlers/default-error-handlers.js';
|
|
4
|
-
import type { Io } from '../io/index.js';
|
|
5
|
-
interface Input {
|
|
6
|
-
io: Io;
|
|
7
|
-
cli: Partial<CliConfig>;
|
|
8
|
-
errorHandlers?: ErrorHandlers;
|
|
9
|
-
}
|
|
10
|
-
export declare function setSemverRanges({ io, cli, errorHandlers }: Input): Effect.Effect<unknown, never, never>;
|
|
11
|
-
export {};
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { Context, Effect, flow, pipe } from 'effect';
|
|
2
|
-
import { isNonEmptyArray } from 'tightrope/guard/is-non-empty-array.js';
|
|
3
|
-
import { fixMismatch, logAlreadyValidSize, logFixedSize, logUnfixableSize, } from '../bin-fix-mismatches/fix-mismatches.js';
|
|
4
|
-
import { logSemverGroupsDisabledWarning } from '../bin-lint-semver-ranges/lint-semver-ranges.js';
|
|
5
|
-
import { logUnsupportedMismatch } from '../bin-list-mismatches/list-mismatches.js';
|
|
6
|
-
import { CliConfigTag } from '../config/tag.js';
|
|
7
|
-
import { defaultErrorHandlers } from '../error-handlers/default-error-handlers.js';
|
|
8
|
-
import { getContext } from '../get-context/index.js';
|
|
9
|
-
import { getInstances } from '../get-instances/index.js';
|
|
10
|
-
import { exitIfInvalid } from '../io/exit-if-invalid.js';
|
|
11
|
-
import { IoTag } from '../io/index.js';
|
|
12
|
-
import { writeIfChanged } from '../io/write-if-changed.js';
|
|
13
|
-
import { withLogger } from '../lib/with-logger.js';
|
|
14
|
-
export function setSemverRanges({ io, cli, errorHandlers = defaultErrorHandlers }) {
|
|
15
|
-
return pipe(getContext({ io, cli, errorHandlers }), Effect.flatMap((ctx) => pipe(Effect.gen(function* ($) {
|
|
16
|
-
// no semver groups have been configured, they are disabled by default
|
|
17
|
-
if (!isNonEmptyArray(ctx.config.rcFile.semverGroups)) {
|
|
18
|
-
ctx.isInvalid = true;
|
|
19
|
-
yield* $(logSemverGroupsDisabledWarning());
|
|
20
|
-
return ctx;
|
|
21
|
-
}
|
|
22
|
-
const { semverGroups } = yield* $(getInstances(ctx, io, errorHandlers));
|
|
23
|
-
let fixedCount = 0;
|
|
24
|
-
let unfixableCount = 0;
|
|
25
|
-
let validCount = 0;
|
|
26
|
-
for (const group of semverGroups) {
|
|
27
|
-
if (group._tag === 'WithRange') {
|
|
28
|
-
for (const instance of group.instances) {
|
|
29
|
-
const report = yield* $(group.inspect(instance));
|
|
30
|
-
const _tag = report._tag;
|
|
31
|
-
if (_tag === 'SemverRangeMismatch') {
|
|
32
|
-
yield* $(fixMismatch(report));
|
|
33
|
-
fixedCount++;
|
|
34
|
-
}
|
|
35
|
-
else if (_tag === 'UnsupportedMismatch') {
|
|
36
|
-
yield* $(logUnsupportedMismatch(report));
|
|
37
|
-
unfixableCount++;
|
|
38
|
-
}
|
|
39
|
-
else {
|
|
40
|
-
validCount++;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
if (validCount)
|
|
46
|
-
yield* $(logAlreadyValidSize(validCount));
|
|
47
|
-
if (fixedCount)
|
|
48
|
-
yield* $(logFixedSize(fixedCount));
|
|
49
|
-
if (unfixableCount)
|
|
50
|
-
yield* $(logUnfixableSize(unfixableCount));
|
|
51
|
-
return ctx;
|
|
52
|
-
}), Effect.flatMap(writeIfChanged), Effect.catchTags({
|
|
53
|
-
WriteFileError: flow(errorHandlers.WriteFileError, Effect.map(() => {
|
|
54
|
-
ctx.isInvalid = true;
|
|
55
|
-
return ctx;
|
|
56
|
-
})),
|
|
57
|
-
}), Effect.flatMap(exitIfInvalid))), Effect.provide(pipe(Context.empty(), Context.add(CliConfigTag, cli), Context.add(IoTag, io))), withLogger);
|
|
58
|
-
}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { Effect } from 'effect';
|
|
2
|
-
import type { Instance } from '../get-instances/instance.js';
|
|
3
|
-
declare const Releases_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => Readonly<A> & {
|
|
4
|
-
readonly _tag: "Releases";
|
|
5
|
-
};
|
|
6
|
-
/** full release history from the npm registry for a given package */
|
|
7
|
-
declare class Releases extends Releases_base<{
|
|
8
|
-
instance: Instance;
|
|
9
|
-
versions: {
|
|
10
|
-
all: string[];
|
|
11
|
-
latest: string;
|
|
12
|
-
};
|
|
13
|
-
repoUrl: string | undefined;
|
|
14
|
-
}> {
|
|
15
|
-
}
|
|
16
|
-
declare const PromptCancelled_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => Readonly<A> & {
|
|
17
|
-
readonly _tag: "PromptCancelled";
|
|
18
|
-
};
|
|
19
|
-
declare class PromptCancelled extends PromptCancelled_base<{
|
|
20
|
-
name: string;
|
|
21
|
-
}> {
|
|
22
|
-
}
|
|
23
|
-
declare const HttpError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => Readonly<A> & {
|
|
24
|
-
readonly _tag: "HttpError";
|
|
25
|
-
};
|
|
26
|
-
declare class HttpError extends HttpError_base<{
|
|
27
|
-
error: string;
|
|
28
|
-
}> {
|
|
29
|
-
}
|
|
30
|
-
declare const NpmRegistryError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => Readonly<A> & {
|
|
31
|
-
readonly _tag: "NpmRegistryError";
|
|
32
|
-
};
|
|
33
|
-
declare class NpmRegistryError extends NpmRegistryError_base<{
|
|
34
|
-
error: string;
|
|
35
|
-
}> {
|
|
36
|
-
}
|
|
37
|
-
export declare const updateEffects: {
|
|
38
|
-
onFetchAllStart(): Effect.Effect<void, never, never>;
|
|
39
|
-
onFetchStart(instance: Instance, totalCount: number): Effect.Effect<void, never, never>;
|
|
40
|
-
onFetchEnd(instance: Instance, versions?: Releases["versions"]): Effect.Effect<void, never, never>;
|
|
41
|
-
/** After checking the registry, store this instance known to be up to date */
|
|
42
|
-
onUpToDate(instance: Instance): Effect.Effect<void, never, never>;
|
|
43
|
-
/** After checking the registry, store this instance known to have newer versions available */
|
|
44
|
-
onOutdated(instance: Instance, latest: string): Effect.Effect<void, never, never>;
|
|
45
|
-
/** As the last request completes, remove the progress information */
|
|
46
|
-
onFetchAllEnd(): Effect.Effect<void, never, never>;
|
|
47
|
-
/** Fetch available versions for a given package from the npm registry */
|
|
48
|
-
fetchLatestVersions(instance: Instance): Effect.Effect<Releases, HttpError | NpmRegistryError>;
|
|
49
|
-
/** Given responses from npm, ask the user which they want */
|
|
50
|
-
promptForUpdates(outdated: Releases[]): Effect.Effect<void, PromptCancelled>;
|
|
51
|
-
};
|
|
52
|
-
export {};
|