syncpack 12.3.3 → 12.4.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 +1 -2
- package/dist/bin-format/format.js +3 -2
- package/dist/bin-update/effects.d.ts +1 -1
- package/dist/bin-update/effects.js +4 -4
- package/dist/config/types.d.ts +2 -0
- package/dist/guards/can-add-to-group.js +6 -6
- package/dist/io/index.d.ts +0 -1
- package/dist/lib/with-logger.js +6 -5
- package/dist/schema.json +3 -0
- package/dist/specifier/delete.d.ts +2 -2
- package/package.json +32 -21
package/README.md
CHANGED
|
@@ -55,5 +55,4 @@ Interactively update packages to the latest versions from the npm registry, wher
|
|
|
55
55
|
- [](https://ko-fi.com/C0C4PY4P)
|
|
56
56
|
- [](https://www.npmjs.com/package/syncpack)
|
|
57
57
|
- [](https://www.npmjs.com/package/syncpack)
|
|
58
|
-
- [](https://codeclimate.com/github/JamieMason/syncpack/maintainability)
|
|
58
|
+
- [](https://github.com/JamieMason/syncpack/actions)
|
|
@@ -80,10 +80,11 @@ function sortObject(sortedKeys, obj) {
|
|
|
80
80
|
});
|
|
81
81
|
}
|
|
82
82
|
function sortAlphabetically(value) {
|
|
83
|
+
const localeComparison = (a, b) => a.localeCompare(b);
|
|
83
84
|
if (isArray(value)) {
|
|
84
|
-
value.sort();
|
|
85
|
+
value.sort(localeComparison);
|
|
85
86
|
}
|
|
86
87
|
else if (isObject(value)) {
|
|
87
|
-
sortObject(Object.keys(value).sort(), value);
|
|
88
|
+
sortObject(Object.keys(value).sort(localeComparison), value);
|
|
88
89
|
}
|
|
89
90
|
}
|
|
@@ -37,7 +37,7 @@ declare class NpmRegistryError extends NpmRegistryError_base<{
|
|
|
37
37
|
export declare const updateEffects: {
|
|
38
38
|
onFetchAllStart(): Effect.Effect<void, never, never>;
|
|
39
39
|
onFetchStart(instance: Instance, totalCount: number): Effect.Effect<void, never, never>;
|
|
40
|
-
onFetchEnd(instance: Instance, versions?: Releases[
|
|
40
|
+
onFetchEnd(instance: Instance, versions?: Releases["versions"]): Effect.Effect<void, never, never>;
|
|
41
41
|
/** After checking the registry, store this instance known to be up to date */
|
|
42
42
|
onUpToDate(instance: Instance): Effect.Effect<void, never, never>;
|
|
43
43
|
/** After checking the registry, store this instance known to have newer versions available */
|
|
@@ -71,7 +71,7 @@ export const updateEffects = {
|
|
|
71
71
|
if (latest) {
|
|
72
72
|
if (gtr(latest, String(instance.rawSpecifier.raw), true)) {
|
|
73
73
|
outdatedCount++;
|
|
74
|
-
mostRecent.push(chalk `${instance.name} {gray {red ${instance.rawSpecifier.raw}} ${ICON.rightArrow}} {green ${latest}}`);
|
|
74
|
+
mostRecent.push(chalk `${instance.name} {gray {red ${String(instance.rawSpecifier.raw)}} ${ICON.rightArrow}} {green ${latest}}`);
|
|
75
75
|
}
|
|
76
76
|
else {
|
|
77
77
|
mostRecent.push(chalk `{green ${instance.name}}`);
|
|
@@ -87,7 +87,7 @@ export const updateEffects = {
|
|
|
87
87
|
/** After checking the registry, store this instance known to have newer versions available */
|
|
88
88
|
onOutdated(instance, latest) {
|
|
89
89
|
outdatedCount++;
|
|
90
|
-
mostRecent.push(chalk `${instance.name} {gray {red ${instance.rawSpecifier.raw}} ${ICON.rightArrow}} {green ${latest}}`);
|
|
90
|
+
mostRecent.push(chalk `${instance.name} {gray {red ${String(instance.rawSpecifier.raw)}} ${ICON.rightArrow}} {green ${latest}}`);
|
|
91
91
|
return Effect.void;
|
|
92
92
|
},
|
|
93
93
|
/** As the last request completes, remove the progress information */
|
|
@@ -104,7 +104,7 @@ export const updateEffects = {
|
|
|
104
104
|
// parse and validate the specific data we expect
|
|
105
105
|
Effect.flatMap(Schema.decodeUnknownEither(Schema.Struct({
|
|
106
106
|
'dist-tags': Schema.Struct({ latest: Schema.String }),
|
|
107
|
-
'time': Schema.Record(Schema.String, Schema.String),
|
|
107
|
+
'time': Schema.Record({ key: Schema.String, value: Schema.String }),
|
|
108
108
|
'homepage': Schema.optional(Schema.String),
|
|
109
109
|
'repository': Schema.optional(Schema.Union(Schema.String, Schema.Struct({ url: Schema.optional(Schema.String) }))),
|
|
110
110
|
}))),
|
|
@@ -186,7 +186,7 @@ function promptForReleaseType(releaseType, doState) {
|
|
|
186
186
|
? chalk `${spacing} {white - ${updateable.repoUrl}}`
|
|
187
187
|
: '';
|
|
188
188
|
return {
|
|
189
|
-
title: chalk `${updateable.instance.name} {gray ${updateable.instance.rawSpecifier.raw} ${ICON.rightArrow}} {green ${updateable.versions.latest}} ${repoUrl}`,
|
|
189
|
+
title: chalk `${updateable.instance.name} {gray ${String(updateable.instance.rawSpecifier.raw)} ${ICON.rightArrow}} {green ${updateable.versions.latest}} ${repoUrl}`,
|
|
190
190
|
selected: true,
|
|
191
191
|
value: updateable,
|
|
192
192
|
};
|
package/dist/config/types.d.ts
CHANGED
|
@@ -92,6 +92,8 @@ export interface CliConfig {
|
|
|
92
92
|
readonly types: string;
|
|
93
93
|
}
|
|
94
94
|
export interface RcConfig {
|
|
95
|
+
/** @see https://jamiemason.github.io/syncpack/integrations/json-schema */
|
|
96
|
+
$schema?: string;
|
|
95
97
|
/** @see https://jamiemason.github.io/syncpack/config/custom-types */
|
|
96
98
|
customTypes: Record<string, CustomTypeConfig.Any>;
|
|
97
99
|
/** @see https://jamiemason.github.io/syncpack/config/dependency-types */
|
|
@@ -19,10 +19,7 @@ function matchesDependencies(packageJsonFilesByName, group, dependencies, instan
|
|
|
19
19
|
minimatch(instance.name, pattern));
|
|
20
20
|
}
|
|
21
21
|
function matchesPackages(packages, instance) {
|
|
22
|
-
|
|
23
|
-
if (!isNonEmptyArray(packages))
|
|
24
|
-
return true;
|
|
25
|
-
return packages.some((pattern) => minimatch(instance.pkgName, pattern));
|
|
22
|
+
return matchesKnownList(packages, instance.pkgName);
|
|
26
23
|
}
|
|
27
24
|
function matchesDependencyTypes(dependencyTypes, instance) {
|
|
28
25
|
return matchesKnownList(dependencyTypes, instance.strategy.name);
|
|
@@ -46,7 +43,10 @@ function matchesKnownList(values, value) {
|
|
|
46
43
|
positive.push(name);
|
|
47
44
|
}
|
|
48
45
|
});
|
|
49
|
-
if (isNonEmptyArray(negative) && !
|
|
46
|
+
if (isNonEmptyArray(negative) && !someMinimatch(value, negative))
|
|
50
47
|
return true;
|
|
51
|
-
return isNonEmptyArray(positive) &&
|
|
48
|
+
return isNonEmptyArray(positive) && someMinimatch(value, positive);
|
|
49
|
+
}
|
|
50
|
+
function someMinimatch(value, patterns) {
|
|
51
|
+
return patterns.some((pattern) => minimatch(value, pattern));
|
|
52
52
|
}
|
package/dist/io/index.d.ts
CHANGED
package/dist/lib/with-logger.js
CHANGED
|
@@ -2,20 +2,21 @@ import chalk from 'chalk-template';
|
|
|
2
2
|
import { Effect, Logger, LogLevel } from 'effect';
|
|
3
3
|
export function withLogger(program) {
|
|
4
4
|
const logger = Logger.make(({ logLevel, message }) => {
|
|
5
|
+
const args = Array.isArray(message) ? message : [message];
|
|
5
6
|
if (logLevel === LogLevel.Info) {
|
|
6
|
-
globalThis.console.info(
|
|
7
|
+
globalThis.console.info(...args);
|
|
7
8
|
}
|
|
8
9
|
else if (logLevel === LogLevel.Debug) {
|
|
9
|
-
globalThis.console.info(chalk `{magenta ? %s}`,
|
|
10
|
+
globalThis.console.info(chalk `{magenta ? %s}`, ...args);
|
|
10
11
|
}
|
|
11
12
|
else if (logLevel === LogLevel.Error) {
|
|
12
|
-
globalThis.console.error(chalk `{red ! %s}`,
|
|
13
|
+
globalThis.console.error(chalk `{red ! %s}`, ...args);
|
|
13
14
|
}
|
|
14
15
|
else if (logLevel === LogLevel.Warning) {
|
|
15
|
-
globalThis.console.warn(chalk `{yellow ! %s}`,
|
|
16
|
+
globalThis.console.warn(chalk `{yellow ! %s}`, ...args);
|
|
16
17
|
}
|
|
17
18
|
else {
|
|
18
|
-
globalThis.console.log(chalk `{cyan [%s] %s}`, logLevel,
|
|
19
|
+
globalThis.console.log(chalk `{cyan [%s] %s}`, logLevel, ...args);
|
|
19
20
|
}
|
|
20
21
|
});
|
|
21
22
|
const layer = Logger.replace(Logger.defaultLogger, logger);
|
package/dist/schema.json
CHANGED
|
@@ -11,7 +11,7 @@ export declare class DeleteSpecifier {
|
|
|
11
11
|
raw: Delete;
|
|
12
12
|
instance: Instance;
|
|
13
13
|
});
|
|
14
|
-
getSemver: (this: import("./index.js").Specifier.Any) => import("effect/Effect").Effect<string, import("./lib/non-semver-error.js").NonSemverError
|
|
15
|
-
setSemver: (this: import("./index.js").Specifier.Any, _version: string) => import("effect/Effect").Effect<import("./index.js").Specifier.Any, import("./lib/non-semver-error.js").NonSemverError
|
|
14
|
+
getSemver: (this: import("./index.js").Specifier.Any) => import("effect/Effect").Effect<string, import("./lib/non-semver-error.js").NonSemverError>;
|
|
15
|
+
setSemver: (this: import("./index.js").Specifier.Any, _version: string) => import("effect/Effect").Effect<import("./index.js").Specifier.Any, import("./lib/non-semver-error.js").NonSemverError>;
|
|
16
16
|
replaceWith: <T extends import("./index.js").Specifier.Any>(specifier: T) => T;
|
|
17
17
|
}
|
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": "12.
|
|
4
|
+
"version": "12.4.0",
|
|
5
5
|
"author": "Jamie Mason <jamie@foldleft.io> (https://github.com/JamieMason)",
|
|
6
6
|
"bin": {
|
|
7
7
|
"syncpack": "dist/bin.js",
|
|
@@ -17,64 +17,75 @@
|
|
|
17
17
|
},
|
|
18
18
|
"bugs": "https://github.com/JamieMason/syncpack/issues",
|
|
19
19
|
"contributors": [
|
|
20
|
+
"Adam Haglund (https://github.com/beeequeue)",
|
|
20
21
|
"Alex Hayton (https://github.com/AlexHayton)",
|
|
22
|
+
"Alex Trofimov (https://github.com/mctrafik)",
|
|
23
|
+
"Altay (https://github.com/altaywtf)",
|
|
24
|
+
"Andrew Njoo (https://github.com/adnjoo)",
|
|
25
|
+
"Angel de da Torre (https://github.com/ardelato)",
|
|
21
26
|
"Aparajita Fishman (https://github.com/aparajita)",
|
|
22
27
|
"Artur Wierzbicki (https://github.com/ArturWierzbicki)",
|
|
28
|
+
"Chase Holdren (https://github.com/chaseholdren)",
|
|
23
29
|
"Daniel Silva (https://github.com/dsilvasc)",
|
|
30
|
+
"Elchin Valiyev (https://github.com/evaliyev)",
|
|
31
|
+
"Gabriel Pereira Woitechen (https://github.com/wtchnm)",
|
|
24
32
|
"Jamie Haywood (https://github.com/jamiehaywood)",
|
|
25
33
|
"Jamie Mason (https://github.com/JamieMason)",
|
|
26
34
|
"Jody Heavener (https://github.com/jodyheavener)",
|
|
27
35
|
"Keyan Zhang (https://github.com/keyz)",
|
|
28
36
|
"Luis Vieira (https://github.com/luisvieiragmr)",
|
|
37
|
+
"Maksim Nesterenko (https://github.com/maksnester)",
|
|
29
38
|
"Marais Rossouw (https://github.com/maraisr)",
|
|
30
39
|
"Matt Sprague (https://github.com/uforic)",
|
|
40
|
+
"Max Rohde (https://github.com/mxro)",
|
|
31
41
|
"Michał Warać (https://github.com/auto200)",
|
|
42
|
+
"Nick Saunders (https://github.com/nsaunders)",
|
|
32
43
|
"Siraj (https://github.com/Syhner)",
|
|
33
44
|
"Tom Fletcher (https://github.com/tom-fletcher)"
|
|
34
45
|
],
|
|
35
46
|
"dependencies": {
|
|
36
|
-
"@effect/schema": "0.
|
|
47
|
+
"@effect/schema": "0.69.0",
|
|
37
48
|
"chalk": "5.3.0",
|
|
38
49
|
"chalk-template": "1.1.0",
|
|
39
|
-
"commander": "12.
|
|
50
|
+
"commander": "12.1.0",
|
|
40
51
|
"cosmiconfig": "9.0.0",
|
|
41
|
-
"effect": "3.
|
|
52
|
+
"effect": "3.5.7",
|
|
42
53
|
"enquirer": "2.4.1",
|
|
43
|
-
"fast-check": "3.
|
|
44
|
-
"globby": "14.0.
|
|
45
|
-
"minimatch": "
|
|
46
|
-
"npm-package-arg": "11.0.
|
|
54
|
+
"fast-check": "3.20.0",
|
|
55
|
+
"globby": "14.0.2",
|
|
56
|
+
"minimatch": "10.0.1",
|
|
57
|
+
"npm-package-arg": "11.0.3",
|
|
47
58
|
"ora": "8.0.1",
|
|
48
59
|
"prompts": "2.4.2",
|
|
49
60
|
"read-yaml-file": "2.1.0",
|
|
50
|
-
"semver": "7.6.
|
|
61
|
+
"semver": "7.6.3",
|
|
51
62
|
"tightrope": "0.2.0",
|
|
52
63
|
"ts-toolbelt": "9.6.0"
|
|
53
64
|
},
|
|
54
65
|
"devDependencies": {
|
|
55
66
|
"@release-it/conventional-changelog": "8.0.1",
|
|
56
67
|
"@tsconfig/node18": "18.2.4",
|
|
57
|
-
"@types/node": "20.12
|
|
68
|
+
"@types/node": "20.14.12",
|
|
58
69
|
"@types/npm-package-arg": "6.1.4",
|
|
59
70
|
"@types/prompts": "2.4.9",
|
|
60
71
|
"@types/semver": "7.5.8",
|
|
61
|
-
"@typescript-eslint/eslint-plugin": "
|
|
62
|
-
"@typescript-eslint/parser": "
|
|
63
|
-
"@vitest/coverage-v8": "
|
|
72
|
+
"@typescript-eslint/eslint-plugin": "7.17.0",
|
|
73
|
+
"@typescript-eslint/parser": "7.17.0",
|
|
74
|
+
"@vitest/coverage-v8": "2.0.4",
|
|
64
75
|
"auto-changelog": "2.4.0",
|
|
65
76
|
"eslint": "8.56.0",
|
|
66
77
|
"eslint-plugin-import": "2.29.1",
|
|
67
|
-
"memfs": "4.
|
|
68
|
-
"prettier": "3.
|
|
69
|
-
"prettier-plugin-astro": "0.
|
|
78
|
+
"memfs": "4.9.4",
|
|
79
|
+
"prettier": "3.3.3",
|
|
80
|
+
"prettier-plugin-astro": "0.14.1",
|
|
70
81
|
"quill-delta": "5.1.0",
|
|
71
|
-
"release-it": "17.
|
|
82
|
+
"release-it": "17.6.0",
|
|
72
83
|
"rxjs": "7.8.1",
|
|
73
84
|
"ts-node": "10.9.2",
|
|
74
|
-
"tslib": "2.6.
|
|
75
|
-
"typescript": "5.4
|
|
76
|
-
"typescript-json-schema": "0.
|
|
77
|
-
"vitest": "
|
|
85
|
+
"tslib": "2.6.3",
|
|
86
|
+
"typescript": "5.5.4",
|
|
87
|
+
"typescript-json-schema": "0.64.0",
|
|
88
|
+
"vitest": "2.0.4"
|
|
78
89
|
},
|
|
79
90
|
"engines": {
|
|
80
91
|
"node": ">=16"
|