syncpack 10.9.3 → 11.2.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/dist/bin-fix-mismatches/fix-mismatches.js +2 -2
- package/dist/bin-format/format-cli.js +2 -2
- package/dist/bin-lint/lint.js +2 -2
- package/dist/bin-lint-semver-ranges/lint-semver-ranges.js +2 -2
- package/dist/bin-list/list.js +2 -2
- package/dist/bin-list-mismatches/list-mismatches.js +2 -2
- package/dist/bin-prompt/prompt.js +2 -2
- package/dist/bin-set-semver-ranges/set-semver-ranges.js +2 -2
- package/dist/bin-update/update.js +2 -2
- package/dist/config/get-enabled-types.d.ts +6 -1
- package/dist/config/get-enabled-types.js +62 -34
- package/dist/config/tag.d.ts +3 -0
- package/dist/config/tag.js +28 -0
- package/dist/config/types.d.ts +0 -2
- package/dist/config/types.js +0 -26
- package/dist/constants.d.ts +3 -4
- package/dist/constants.js +12 -13
- package/dist/create-program/semver-ranges.d.ts +2 -2
- package/dist/create-program/versions.d.ts +2 -2
- package/dist/env/default-env.js +14 -10
- package/dist/error-handlers/create-error-handlers.d.ts +2 -1
- package/dist/error-handlers/create-error-handlers.js +3 -0
- package/dist/error-handlers/default-error-handlers.js +5 -0
- package/dist/get-context/index.js +2 -2
- package/dist/get-package-json-files/get-patterns/index.js +1 -1
- package/dist/get-semver-groups/filtered-out.js +1 -1
- package/dist/get-semver-groups/index.d.ts +2 -2
- package/dist/get-semver-groups/with-range.js +1 -1
- package/dist/get-version-groups/filtered-out.js +1 -1
- package/dist/get-version-groups/index.d.ts +2 -2
- package/dist/get-version-groups/index.js +1 -1
- package/dist/get-version-groups/standard.js +1 -1
- package/dist/guards/can-add-to-group.js +35 -5
- package/dist/instance/index.d.ts +1 -1
- package/dist/schema.json +361 -0
- package/package.json +13 -11
|
@@ -27,7 +27,7 @@ exports.fixMismatches = void 0;
|
|
|
27
27
|
const Context = __importStar(require("@effect/data/Context"));
|
|
28
28
|
const Function_1 = require("@effect/data/Function");
|
|
29
29
|
const Effect = __importStar(require("@effect/io/Effect"));
|
|
30
|
-
const
|
|
30
|
+
const tag_1 = require("../config/tag");
|
|
31
31
|
const versions_1 = require("../create-program/versions");
|
|
32
32
|
const create_env_1 = require("../env/create-env");
|
|
33
33
|
const exit_if_invalid_1 = require("../env/exit-if-invalid");
|
|
@@ -38,6 +38,6 @@ const default_error_handlers_1 = require("../error-handlers/default-error-handle
|
|
|
38
38
|
const get_context_1 = require("../get-context");
|
|
39
39
|
const effects_1 = require("./effects");
|
|
40
40
|
function fixMismatches(cli, env) {
|
|
41
|
-
return (0, Function_1.pipe)((0, get_context_1.getContext)(), Effect.flatMap((ctx) => (0, versions_1.createVersionsProgram)(ctx, effects_1.fixMismatchesEffects)), Effect.flatMap(write_if_changed_1.writeIfChanged), Effect.flatMap(exit_if_invalid_1.exitIfInvalid), Effect.catchTags((0, create_error_handlers_1.createErrorHandlers)(default_error_handlers_1.defaultErrorHandlers)), Effect.provideContext((0, Function_1.pipe)(Context.empty(), Context.add(
|
|
41
|
+
return (0, Function_1.pipe)((0, get_context_1.getContext)(), Effect.flatMap((ctx) => (0, versions_1.createVersionsProgram)(ctx, effects_1.fixMismatchesEffects)), Effect.flatMap(write_if_changed_1.writeIfChanged), Effect.flatMap(exit_if_invalid_1.exitIfInvalid), Effect.catchTags((0, create_error_handlers_1.createErrorHandlers)(default_error_handlers_1.defaultErrorHandlers)), Effect.provideContext((0, Function_1.pipe)(Context.empty(), Context.add(tag_1.CliConfigTag, cli), Context.add(tags_1.EnvTag, (0, create_env_1.createEnv)(env)))));
|
|
42
42
|
}
|
|
43
43
|
exports.fixMismatches = fixMismatches;
|
|
@@ -27,7 +27,7 @@ exports.formatCli = void 0;
|
|
|
27
27
|
const Context = __importStar(require("@effect/data/Context"));
|
|
28
28
|
const Function_1 = require("@effect/data/Function");
|
|
29
29
|
const Effect = __importStar(require("@effect/io/Effect"));
|
|
30
|
-
const
|
|
30
|
+
const tag_1 = require("../config/tag");
|
|
31
31
|
const create_env_1 = require("../env/create-env");
|
|
32
32
|
const exit_if_invalid_1 = require("../env/exit-if-invalid");
|
|
33
33
|
const tags_1 = require("../env/tags");
|
|
@@ -37,6 +37,6 @@ const default_error_handlers_1 = require("../error-handlers/default-error-handle
|
|
|
37
37
|
const get_context_1 = require("../get-context");
|
|
38
38
|
const format_1 = require("./format");
|
|
39
39
|
function formatCli(cli, env) {
|
|
40
|
-
return (0, Function_1.pipe)((0, get_context_1.getContext)(), Effect.flatMap(format_1.format), Effect.flatMap(write_if_changed_1.writeIfChanged), Effect.flatMap(exit_if_invalid_1.exitIfInvalid), Effect.catchTags((0, create_error_handlers_1.createErrorHandlers)(default_error_handlers_1.defaultErrorHandlers)), Effect.provideContext((0, Function_1.pipe)(Context.empty(), Context.add(
|
|
40
|
+
return (0, Function_1.pipe)((0, get_context_1.getContext)(), Effect.flatMap(format_1.format), Effect.flatMap(write_if_changed_1.writeIfChanged), Effect.flatMap(exit_if_invalid_1.exitIfInvalid), Effect.catchTags((0, create_error_handlers_1.createErrorHandlers)(default_error_handlers_1.defaultErrorHandlers)), Effect.provideContext((0, Function_1.pipe)(Context.empty(), Context.add(tag_1.CliConfigTag, cli), Context.add(tags_1.EnvTag, (0, create_env_1.createEnv)(env)))));
|
|
41
41
|
}
|
|
42
42
|
exports.formatCli = formatCli;
|
package/dist/bin-lint/lint.js
CHANGED
|
@@ -29,7 +29,7 @@ const Function_1 = require("@effect/data/Function");
|
|
|
29
29
|
const Effect = __importStar(require("@effect/io/Effect"));
|
|
30
30
|
const effects_1 = require("../bin-lint-semver-ranges/effects");
|
|
31
31
|
const effects_2 = require("../bin-list-mismatches/effects");
|
|
32
|
-
const
|
|
32
|
+
const tag_1 = require("../config/tag");
|
|
33
33
|
const semver_ranges_1 = require("../create-program/semver-ranges");
|
|
34
34
|
const versions_1 = require("../create-program/versions");
|
|
35
35
|
const create_env_1 = require("../env/create-env");
|
|
@@ -39,6 +39,6 @@ const create_error_handlers_1 = require("../error-handlers/create-error-handlers
|
|
|
39
39
|
const default_error_handlers_1 = require("../error-handlers/default-error-handlers");
|
|
40
40
|
const get_context_1 = require("../get-context");
|
|
41
41
|
function lint(cli, env) {
|
|
42
|
-
return (0, Function_1.pipe)((0, get_context_1.getContext)(), Effect.flatMap((ctx) => (0, versions_1.createVersionsProgram)(ctx, effects_2.listMismatchesEffects)), Effect.flatMap((ctx) => (0, semver_ranges_1.createSemverRangesProgram)(ctx, effects_1.lintSemverRangesEffects)), Effect.flatMap(exit_if_invalid_1.exitIfInvalid), Effect.catchTags((0, create_error_handlers_1.createErrorHandlers)(default_error_handlers_1.defaultErrorHandlers)), Effect.provideContext((0, Function_1.pipe)(Context.empty(), Context.add(
|
|
42
|
+
return (0, Function_1.pipe)((0, get_context_1.getContext)(), Effect.flatMap((ctx) => (0, versions_1.createVersionsProgram)(ctx, effects_2.listMismatchesEffects)), Effect.flatMap((ctx) => (0, semver_ranges_1.createSemverRangesProgram)(ctx, effects_1.lintSemverRangesEffects)), Effect.flatMap(exit_if_invalid_1.exitIfInvalid), Effect.catchTags((0, create_error_handlers_1.createErrorHandlers)(default_error_handlers_1.defaultErrorHandlers)), Effect.provideContext((0, Function_1.pipe)(Context.empty(), Context.add(tag_1.CliConfigTag, cli), Context.add(tags_1.EnvTag, (0, create_env_1.createEnv)(env)))));
|
|
43
43
|
}
|
|
44
44
|
exports.lint = lint;
|
|
@@ -27,7 +27,7 @@ exports.lintSemverRanges = void 0;
|
|
|
27
27
|
const Context = __importStar(require("@effect/data/Context"));
|
|
28
28
|
const Function_1 = require("@effect/data/Function");
|
|
29
29
|
const Effect = __importStar(require("@effect/io/Effect"));
|
|
30
|
-
const
|
|
30
|
+
const tag_1 = require("../config/tag");
|
|
31
31
|
const semver_ranges_1 = require("../create-program/semver-ranges");
|
|
32
32
|
const create_env_1 = require("../env/create-env");
|
|
33
33
|
const exit_if_invalid_1 = require("../env/exit-if-invalid");
|
|
@@ -37,6 +37,6 @@ const default_error_handlers_1 = require("../error-handlers/default-error-handle
|
|
|
37
37
|
const get_context_1 = require("../get-context");
|
|
38
38
|
const effects_1 = require("./effects");
|
|
39
39
|
function lintSemverRanges(cli, env) {
|
|
40
|
-
return (0, Function_1.pipe)((0, get_context_1.getContext)(), Effect.flatMap((ctx) => (0, semver_ranges_1.createSemverRangesProgram)(ctx, effects_1.lintSemverRangesEffects)), Effect.flatMap(exit_if_invalid_1.exitIfInvalid), Effect.catchTags((0, create_error_handlers_1.createErrorHandlers)(default_error_handlers_1.defaultErrorHandlers)), Effect.provideContext((0, Function_1.pipe)(Context.empty(), Context.add(
|
|
40
|
+
return (0, Function_1.pipe)((0, get_context_1.getContext)(), Effect.flatMap((ctx) => (0, semver_ranges_1.createSemverRangesProgram)(ctx, effects_1.lintSemverRangesEffects)), Effect.flatMap(exit_if_invalid_1.exitIfInvalid), Effect.catchTags((0, create_error_handlers_1.createErrorHandlers)(default_error_handlers_1.defaultErrorHandlers)), Effect.provideContext((0, Function_1.pipe)(Context.empty(), Context.add(tag_1.CliConfigTag, cli), Context.add(tags_1.EnvTag, (0, create_env_1.createEnv)(env)))));
|
|
41
41
|
}
|
|
42
42
|
exports.lintSemverRanges = lintSemverRanges;
|
package/dist/bin-list/list.js
CHANGED
|
@@ -27,7 +27,7 @@ exports.list = void 0;
|
|
|
27
27
|
const Context = __importStar(require("@effect/data/Context"));
|
|
28
28
|
const Function_1 = require("@effect/data/Function");
|
|
29
29
|
const Effect = __importStar(require("@effect/io/Effect"));
|
|
30
|
-
const
|
|
30
|
+
const tag_1 = require("../config/tag");
|
|
31
31
|
const versions_1 = require("../create-program/versions");
|
|
32
32
|
const create_env_1 = require("../env/create-env");
|
|
33
33
|
const exit_if_invalid_1 = require("../env/exit-if-invalid");
|
|
@@ -37,6 +37,6 @@ const default_error_handlers_1 = require("../error-handlers/default-error-handle
|
|
|
37
37
|
const get_context_1 = require("../get-context");
|
|
38
38
|
const effects_1 = require("./effects");
|
|
39
39
|
function list(cli, env) {
|
|
40
|
-
return (0, Function_1.pipe)((0, get_context_1.getContext)(), Effect.flatMap((ctx) => (0, versions_1.createVersionsProgram)(ctx, effects_1.listEffects)), Effect.flatMap(exit_if_invalid_1.exitIfInvalid), Effect.catchTags((0, create_error_handlers_1.createErrorHandlers)(default_error_handlers_1.defaultErrorHandlers)), Effect.provideContext((0, Function_1.pipe)(Context.empty(), Context.add(
|
|
40
|
+
return (0, Function_1.pipe)((0, get_context_1.getContext)(), Effect.flatMap((ctx) => (0, versions_1.createVersionsProgram)(ctx, effects_1.listEffects)), Effect.flatMap(exit_if_invalid_1.exitIfInvalid), Effect.catchTags((0, create_error_handlers_1.createErrorHandlers)(default_error_handlers_1.defaultErrorHandlers)), Effect.provideContext((0, Function_1.pipe)(Context.empty(), Context.add(tag_1.CliConfigTag, cli), Context.add(tags_1.EnvTag, (0, create_env_1.createEnv)(env)))));
|
|
41
41
|
}
|
|
42
42
|
exports.list = list;
|
|
@@ -27,7 +27,7 @@ exports.listMismatches = void 0;
|
|
|
27
27
|
const Context = __importStar(require("@effect/data/Context"));
|
|
28
28
|
const Function_1 = require("@effect/data/Function");
|
|
29
29
|
const Effect = __importStar(require("@effect/io/Effect"));
|
|
30
|
-
const
|
|
30
|
+
const tag_1 = require("../config/tag");
|
|
31
31
|
const versions_1 = require("../create-program/versions");
|
|
32
32
|
const create_env_1 = require("../env/create-env");
|
|
33
33
|
const exit_if_invalid_1 = require("../env/exit-if-invalid");
|
|
@@ -37,6 +37,6 @@ const default_error_handlers_1 = require("../error-handlers/default-error-handle
|
|
|
37
37
|
const get_context_1 = require("../get-context");
|
|
38
38
|
const effects_1 = require("./effects");
|
|
39
39
|
function listMismatches(cli, env) {
|
|
40
|
-
return (0, Function_1.pipe)((0, get_context_1.getContext)(), Effect.flatMap((ctx) => (0, versions_1.createVersionsProgram)(ctx, effects_1.listMismatchesEffects)), Effect.flatMap(exit_if_invalid_1.exitIfInvalid), Effect.catchTags((0, create_error_handlers_1.createErrorHandlers)(default_error_handlers_1.defaultErrorHandlers)), Effect.provideContext((0, Function_1.pipe)(Context.empty(), Context.add(
|
|
40
|
+
return (0, Function_1.pipe)((0, get_context_1.getContext)(), Effect.flatMap((ctx) => (0, versions_1.createVersionsProgram)(ctx, effects_1.listMismatchesEffects)), Effect.flatMap(exit_if_invalid_1.exitIfInvalid), Effect.catchTags((0, create_error_handlers_1.createErrorHandlers)(default_error_handlers_1.defaultErrorHandlers)), Effect.provideContext((0, Function_1.pipe)(Context.empty(), Context.add(tag_1.CliConfigTag, cli), Context.add(tags_1.EnvTag, (0, create_env_1.createEnv)(env)))));
|
|
41
41
|
}
|
|
42
42
|
exports.listMismatches = listMismatches;
|
|
@@ -27,7 +27,7 @@ exports.prompt = void 0;
|
|
|
27
27
|
const Context = __importStar(require("@effect/data/Context"));
|
|
28
28
|
const Function_1 = require("@effect/data/Function");
|
|
29
29
|
const Effect = __importStar(require("@effect/io/Effect"));
|
|
30
|
-
const
|
|
30
|
+
const tag_1 = require("../config/tag");
|
|
31
31
|
const versions_1 = require("../create-program/versions");
|
|
32
32
|
const create_env_1 = require("../env/create-env");
|
|
33
33
|
const tags_1 = require("../env/tags");
|
|
@@ -37,6 +37,6 @@ const default_error_handlers_1 = require("../error-handlers/default-error-handle
|
|
|
37
37
|
const get_context_1 = require("../get-context");
|
|
38
38
|
const effects_1 = require("./effects");
|
|
39
39
|
function prompt(cli, env) {
|
|
40
|
-
return (0, Function_1.pipe)((0, get_context_1.getContext)(), Effect.flatMap((ctx) => (0, versions_1.createVersionsProgram)(ctx, effects_1.promptEffects)), Effect.flatMap(write_if_changed_1.writeIfChanged), Effect.catchTags((0, create_error_handlers_1.createErrorHandlers)(default_error_handlers_1.defaultErrorHandlers)), Effect.provideContext((0, Function_1.pipe)(Context.empty(), Context.add(
|
|
40
|
+
return (0, Function_1.pipe)((0, get_context_1.getContext)(), Effect.flatMap((ctx) => (0, versions_1.createVersionsProgram)(ctx, effects_1.promptEffects)), Effect.flatMap(write_if_changed_1.writeIfChanged), Effect.catchTags((0, create_error_handlers_1.createErrorHandlers)(default_error_handlers_1.defaultErrorHandlers)), Effect.provideContext((0, Function_1.pipe)(Context.empty(), Context.add(tag_1.CliConfigTag, cli), Context.add(tags_1.EnvTag, (0, create_env_1.createEnv)(env)))));
|
|
41
41
|
}
|
|
42
42
|
exports.prompt = prompt;
|
|
@@ -27,7 +27,7 @@ exports.setSemverRanges = void 0;
|
|
|
27
27
|
const Context = __importStar(require("@effect/data/Context"));
|
|
28
28
|
const Function_1 = require("@effect/data/Function");
|
|
29
29
|
const Effect = __importStar(require("@effect/io/Effect"));
|
|
30
|
-
const
|
|
30
|
+
const tag_1 = require("../config/tag");
|
|
31
31
|
const semver_ranges_1 = require("../create-program/semver-ranges");
|
|
32
32
|
const create_env_1 = require("../env/create-env");
|
|
33
33
|
const exit_if_invalid_1 = require("../env/exit-if-invalid");
|
|
@@ -38,6 +38,6 @@ const default_error_handlers_1 = require("../error-handlers/default-error-handle
|
|
|
38
38
|
const get_context_1 = require("../get-context");
|
|
39
39
|
const effects_1 = require("./effects");
|
|
40
40
|
function setSemverRanges(cli, env) {
|
|
41
|
-
return (0, Function_1.pipe)((0, get_context_1.getContext)(), Effect.flatMap((ctx) => (0, semver_ranges_1.createSemverRangesProgram)(ctx, effects_1.setSemverRangesEffects)), Effect.flatMap(write_if_changed_1.writeIfChanged), Effect.flatMap(exit_if_invalid_1.exitIfInvalid), Effect.catchTags((0, create_error_handlers_1.createErrorHandlers)(default_error_handlers_1.defaultErrorHandlers)), Effect.provideContext((0, Function_1.pipe)(Context.empty(), Context.add(
|
|
41
|
+
return (0, Function_1.pipe)((0, get_context_1.getContext)(), Effect.flatMap((ctx) => (0, semver_ranges_1.createSemverRangesProgram)(ctx, effects_1.setSemverRangesEffects)), Effect.flatMap(write_if_changed_1.writeIfChanged), Effect.flatMap(exit_if_invalid_1.exitIfInvalid), Effect.catchTags((0, create_error_handlers_1.createErrorHandlers)(default_error_handlers_1.defaultErrorHandlers)), Effect.provideContext((0, Function_1.pipe)(Context.empty(), Context.add(tag_1.CliConfigTag, cli), Context.add(tags_1.EnvTag, (0, create_env_1.createEnv)(env)))));
|
|
42
42
|
}
|
|
43
43
|
exports.setSemverRanges = setSemverRanges;
|
|
@@ -28,7 +28,7 @@ const Context = __importStar(require("@effect/data/Context"));
|
|
|
28
28
|
const Function_1 = require("@effect/data/Function");
|
|
29
29
|
const Effect = __importStar(require("@effect/io/Effect"));
|
|
30
30
|
// import { setSemverRangesEffects } from '../bin-set-semver-ranges/effects';
|
|
31
|
-
const
|
|
31
|
+
const tag_1 = require("../config/tag");
|
|
32
32
|
// import { createSemverRangesProgram } from '../create-program/semver-ranges';
|
|
33
33
|
const versions_1 = require("../create-program/versions");
|
|
34
34
|
const create_env_1 = require("../env/create-env");
|
|
@@ -42,6 +42,6 @@ const effects_1 = require("./effects");
|
|
|
42
42
|
function update(cli, env) {
|
|
43
43
|
return (0, Function_1.pipe)((0, get_context_1.getContext)(), Effect.flatMap((ctx) => (0, versions_1.createVersionsProgram)(ctx, effects_1.updateEffects)),
|
|
44
44
|
// Effect.flatMap((ctx) => createSemverRangesProgram(ctx, setSemverRangesEffects)),
|
|
45
|
-
Effect.flatMap(write_if_changed_1.writeIfChanged), Effect.flatMap(exit_if_invalid_1.exitIfInvalid), Effect.catchTags((0, create_error_handlers_1.createErrorHandlers)(default_error_handlers_1.defaultErrorHandlers)), Effect.withConcurrency(10), Effect.provideContext((0, Function_1.pipe)(Context.empty(), Context.add(
|
|
45
|
+
Effect.flatMap(write_if_changed_1.writeIfChanged), Effect.flatMap(exit_if_invalid_1.exitIfInvalid), Effect.catchTags((0, create_error_handlers_1.createErrorHandlers)(default_error_handlers_1.defaultErrorHandlers)), Effect.withConcurrency(10), Effect.provideContext((0, Function_1.pipe)(Context.empty(), Context.add(tag_1.CliConfigTag, cli), Context.add(tags_1.EnvTag, (0, create_env_1.createEnv)(env)))));
|
|
46
46
|
}
|
|
47
47
|
exports.update = update;
|
|
@@ -9,5 +9,10 @@ export declare class DeprecatedTypesError extends DeprecatedTypesError_base<{
|
|
|
9
9
|
readonly types: string[];
|
|
10
10
|
}> {
|
|
11
11
|
}
|
|
12
|
-
|
|
12
|
+
declare const RenamedWorkspaceTypeError_base: new <A extends Record<string, any>>(args: Data.IsEqualTo<Omit<A, keyof import("@effect/data/Equal").Equal>, {}> extends true ? void : Omit<A, keyof import("@effect/data/Equal").Equal>) => Data.Data<A & {
|
|
13
|
+
_tag: "RenamedWorkspaceTypeError";
|
|
14
|
+
}>;
|
|
15
|
+
export declare class RenamedWorkspaceTypeError extends RenamedWorkspaceTypeError_base<Record<string, never>> {
|
|
16
|
+
}
|
|
17
|
+
export declare function getEnabledTypes({ cli, rcFile, }: Ctx['config']): Effect.Effect<never, DeprecatedTypesError | RenamedWorkspaceTypeError, Strategy.Any[]>;
|
|
13
18
|
export {};
|
|
@@ -23,8 +23,9 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.getEnabledTypes = exports.DeprecatedTypesError = void 0;
|
|
26
|
+
exports.getEnabledTypes = exports.RenamedWorkspaceTypeError = exports.DeprecatedTypesError = void 0;
|
|
27
27
|
const Data = __importStar(require("@effect/data/Data"));
|
|
28
|
+
const ReadonlyArray_1 = require("@effect/data/ReadonlyArray");
|
|
28
29
|
const Effect = __importStar(require("@effect/io/Effect"));
|
|
29
30
|
const is_array_of_strings_1 = require("tightrope/guard/is-array-of-strings");
|
|
30
31
|
const is_boolean_1 = require("tightrope/guard/is-boolean");
|
|
@@ -37,46 +38,73 @@ const get_custom_types_1 = require("./get-custom-types");
|
|
|
37
38
|
class DeprecatedTypesError extends Data.TaggedClass('DeprecatedTypesError') {
|
|
38
39
|
}
|
|
39
40
|
exports.DeprecatedTypesError = DeprecatedTypesError;
|
|
40
|
-
|
|
41
|
-
|
|
41
|
+
class RenamedWorkspaceTypeError extends Data.TaggedClass('RenamedWorkspaceTypeError') {
|
|
42
|
+
}
|
|
43
|
+
exports.RenamedWorkspaceTypeError = RenamedWorkspaceTypeError;
|
|
42
44
|
function getEnabledTypes({ cli, rcFile, }) {
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
: (0, is_array_of_strings_1.isArrayOfStrings)(rcFile.dependencyTypes)
|
|
47
|
-
? rcFile.dependencyTypes
|
|
48
|
-
: []).filter(is_non_empty_string_1.isNonEmptyString);
|
|
49
|
-
const useDefaults = (0, is_empty_array_1.isEmptyArray)(enabledTypeNames);
|
|
50
|
-
const deprecatedTypes = constants_1.DEFAULT_CONFIG.dependencyTypes.filter((key) => (0, is_boolean_1.isBoolean)(rcFile[key]));
|
|
51
|
-
if (deprecatedTypes.length > 0) {
|
|
52
|
-
return Effect.fail(new DeprecatedTypesError({ types: deprecatedTypes }));
|
|
53
|
-
}
|
|
54
|
-
if (useDefaults || enabledTypeNames.includes('dev')) {
|
|
55
|
-
enabledTypes.push(new versions_by_name_1.VersionsByNameStrategy('dev', 'devDependencies'));
|
|
45
|
+
const deprecatedTypeProps = getDeprecatedTypeProps();
|
|
46
|
+
if (deprecatedTypeProps.length > 0) {
|
|
47
|
+
return Effect.fail(new DeprecatedTypesError({ types: deprecatedTypeProps }));
|
|
56
48
|
}
|
|
57
|
-
|
|
58
|
-
|
|
49
|
+
const allStrategiesByName = Object.fromEntries([
|
|
50
|
+
['dev', new versions_by_name_1.VersionsByNameStrategy('dev', 'devDependencies')],
|
|
51
|
+
['local', new name_and_version_props_1.NameAndVersionPropsStrategy('local', 'version', 'name')],
|
|
52
|
+
['overrides', new versions_by_name_1.VersionsByNameStrategy('overrides', 'overrides')],
|
|
53
|
+
['peer', new versions_by_name_1.VersionsByNameStrategy('peer', 'peerDependencies')],
|
|
54
|
+
['pnpmOverrides', new versions_by_name_1.VersionsByNameStrategy('pnpmOverrides', 'pnpm.overrides')],
|
|
55
|
+
['prod', new versions_by_name_1.VersionsByNameStrategy('prod', 'dependencies')],
|
|
56
|
+
['resolutions', new versions_by_name_1.VersionsByNameStrategy('resolutions', 'resolutions')],
|
|
57
|
+
...(0, get_custom_types_1.getCustomTypes)({ cli, rcFile }).map((customType) => [customType.name, customType]),
|
|
58
|
+
]);
|
|
59
|
+
const allStrategyNames = Object.keys(allStrategiesByName);
|
|
60
|
+
const names = {
|
|
61
|
+
provided: ((0, is_non_empty_string_1.isNonEmptyString)(cli.types)
|
|
62
|
+
? cli.types.split(',')
|
|
63
|
+
: (0, is_array_of_strings_1.isArrayOfStrings)(rcFile.dependencyTypes)
|
|
64
|
+
? rcFile.dependencyTypes
|
|
65
|
+
: []).filter(is_non_empty_string_1.isNonEmptyString),
|
|
66
|
+
enabled: [],
|
|
67
|
+
positive: [],
|
|
68
|
+
negative: [],
|
|
69
|
+
};
|
|
70
|
+
if ((0, is_empty_array_1.isEmptyArray)(names.provided) || names.provided.join('') === '**') {
|
|
71
|
+
return Effect.succeed(allStrategyNames.map(getStrategyByName));
|
|
59
72
|
}
|
|
60
|
-
|
|
61
|
-
|
|
73
|
+
names.provided.forEach((name) => {
|
|
74
|
+
if (name.startsWith('!')) {
|
|
75
|
+
names.negative.push(name.replace('!', ''));
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
names.positive.push(name);
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
if ((0, ReadonlyArray_1.isNonEmptyArray)(names.negative)) {
|
|
82
|
+
allStrategyNames.forEach((name) => {
|
|
83
|
+
if (!names.negative.includes(name)) {
|
|
84
|
+
names.enabled.push(name);
|
|
85
|
+
}
|
|
86
|
+
});
|
|
62
87
|
}
|
|
63
|
-
if (
|
|
64
|
-
|
|
88
|
+
if ((0, ReadonlyArray_1.isNonEmptyArray)(names.positive)) {
|
|
89
|
+
names.positive.forEach((name) => {
|
|
90
|
+
if (!names.enabled.includes(name)) {
|
|
91
|
+
names.enabled.push(name);
|
|
92
|
+
}
|
|
93
|
+
});
|
|
65
94
|
}
|
|
66
|
-
if (
|
|
67
|
-
|
|
95
|
+
if (names.enabled.includes('workspace')) {
|
|
96
|
+
return Effect.fail(new RenamedWorkspaceTypeError({}));
|
|
68
97
|
}
|
|
69
|
-
|
|
70
|
-
|
|
98
|
+
return Effect.succeed(names.enabled.map(getStrategyByName));
|
|
99
|
+
function getStrategyByName(type) {
|
|
100
|
+
return allStrategiesByName[type];
|
|
71
101
|
}
|
|
72
|
-
|
|
73
|
-
|
|
102
|
+
/**
|
|
103
|
+
* Look for dependency types defined using the old syntax of `{ prod: true }`
|
|
104
|
+
* which was deprecated in syncpack@9.0.0.
|
|
105
|
+
*/
|
|
106
|
+
function getDeprecatedTypeProps() {
|
|
107
|
+
return constants_1.INTERNAL_TYPES.filter((key) => (0, is_boolean_1.isBoolean)(rcFile[key]));
|
|
74
108
|
}
|
|
75
|
-
(0, get_custom_types_1.getCustomTypes)({ cli, rcFile }).forEach((customType) => {
|
|
76
|
-
if (useDefaults || enabledTypeNames.includes(customType.name)) {
|
|
77
|
-
enabledTypes.push(customType);
|
|
78
|
-
}
|
|
79
|
-
});
|
|
80
|
-
return Effect.succeed(enabledTypes);
|
|
81
109
|
}
|
|
82
110
|
exports.getEnabledTypes = getEnabledTypes;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.CliConfigTag = void 0;
|
|
27
|
+
const Context = __importStar(require("@effect/data/Context"));
|
|
28
|
+
exports.CliConfigTag = Context.Tag();
|
package/dist/config/types.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import * as Context from '@effect/data/Context';
|
|
2
1
|
import type { Union } from 'ts-toolbelt';
|
|
3
2
|
/**
|
|
4
3
|
* Aliases for semver range formats supported by syncpack
|
|
@@ -88,7 +87,6 @@ export interface CliConfig {
|
|
|
88
87
|
readonly source: string[];
|
|
89
88
|
readonly types: string;
|
|
90
89
|
}
|
|
91
|
-
export declare const CliConfigTag: Context.Tag<Partial<CliConfig>, Partial<CliConfig>>;
|
|
92
90
|
export interface RcConfig {
|
|
93
91
|
/** @see https://jamiemason.github.io/syncpack/config/custom-types */
|
|
94
92
|
customTypes: Record<string, CustomTypeConfig.Any>;
|
package/dist/config/types.js
CHANGED
|
@@ -1,28 +1,2 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.CliConfigTag = void 0;
|
|
27
|
-
const Context = __importStar(require("@effect/data/Context"));
|
|
28
|
-
exports.CliConfigTag = Context.Tag();
|
package/dist/constants.d.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
/** Single source of truth, intended to aid testing or to override */
|
|
2
2
|
export declare const CWD: string;
|
|
3
|
-
/** Where to search for packages if none are provided by the user */
|
|
4
|
-
export declare const DEFAULT_SOURCES: string[];
|
|
5
3
|
/** Single source of truth for icons used in output */
|
|
6
4
|
export declare const ICON: {
|
|
7
5
|
readonly cross: "✘";
|
|
@@ -23,14 +21,15 @@ export declare const RANGE: {
|
|
|
23
21
|
readonly PATCH: "~";
|
|
24
22
|
readonly WORKSPACE: "workspace:";
|
|
25
23
|
};
|
|
24
|
+
export declare const INTERNAL_TYPES: readonly ["dev", "local", "overrides", "peer", "pnpmOverrides", "prod", "resolutions"];
|
|
26
25
|
export declare const DEFAULT_CONFIG: {
|
|
27
|
-
readonly dependencyTypes: readonly ["
|
|
26
|
+
readonly dependencyTypes: readonly ["**"];
|
|
28
27
|
readonly filter: ".";
|
|
29
28
|
readonly indent: " ";
|
|
30
29
|
readonly semverGroups: readonly [];
|
|
31
30
|
readonly semverRange: "";
|
|
32
31
|
readonly sortAz: readonly ["contributors", "dependencies", "devDependencies", "keywords", "peerDependencies", "resolutions", "scripts"];
|
|
33
32
|
readonly sortFirst: readonly ["name", "description", "version", "author"];
|
|
34
|
-
readonly source:
|
|
33
|
+
readonly source: readonly ["package.json", "packages/*/package.json"];
|
|
35
34
|
readonly versionGroups: readonly [];
|
|
36
35
|
};
|
package/dist/constants.js
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DEFAULT_CONFIG = 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
|
-
/** Where to search for packages if none are provided by the user */
|
|
7
|
-
exports.DEFAULT_SOURCES = ['package.json', 'packages/*/package.json'];
|
|
8
6
|
/** Single source of truth for icons used in output */
|
|
9
7
|
exports.ICON = {
|
|
10
8
|
cross: '✘',
|
|
@@ -26,16 +24,17 @@ exports.RANGE = {
|
|
|
26
24
|
PATCH: '~',
|
|
27
25
|
WORKSPACE: 'workspace:',
|
|
28
26
|
};
|
|
27
|
+
exports.INTERNAL_TYPES = [
|
|
28
|
+
'dev',
|
|
29
|
+
'local',
|
|
30
|
+
'overrides',
|
|
31
|
+
'peer',
|
|
32
|
+
'pnpmOverrides',
|
|
33
|
+
'prod',
|
|
34
|
+
'resolutions',
|
|
35
|
+
];
|
|
29
36
|
exports.DEFAULT_CONFIG = {
|
|
30
|
-
dependencyTypes: [
|
|
31
|
-
'dev',
|
|
32
|
-
'overrides',
|
|
33
|
-
'peer',
|
|
34
|
-
'pnpmOverrides',
|
|
35
|
-
'prod',
|
|
36
|
-
'resolutions',
|
|
37
|
-
'workspace',
|
|
38
|
-
],
|
|
37
|
+
dependencyTypes: ['**'],
|
|
39
38
|
filter: '.',
|
|
40
39
|
indent: ' ',
|
|
41
40
|
semverGroups: [],
|
|
@@ -50,6 +49,6 @@ exports.DEFAULT_CONFIG = {
|
|
|
50
49
|
'scripts',
|
|
51
50
|
],
|
|
52
51
|
sortFirst: ['name', 'description', 'version', 'author'],
|
|
53
|
-
source:
|
|
52
|
+
source: ['package.json', 'packages/*/package.json'],
|
|
54
53
|
versionGroups: [],
|
|
55
54
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as Effect from '@effect/io/Effect';
|
|
2
|
-
import type { DeprecatedTypesError } from '../config/get-enabled-types';
|
|
2
|
+
import type { DeprecatedTypesError, RenamedWorkspaceTypeError } from '../config/get-enabled-types';
|
|
3
3
|
import type { Env } from '../env/create-env';
|
|
4
4
|
import type { Ctx } from '../get-context';
|
|
5
5
|
import type { SemverGroupConfigError } from '../get-semver-groups';
|
|
6
6
|
import type { SemverRangeEffects } from './effects';
|
|
7
|
-
export declare function createSemverRangesProgram<T extends SemverRangeEffects<any>>(ctx: Ctx, effects: T): Effect.Effect<Env, SemverGroupConfigError | DeprecatedTypesError, Ctx>;
|
|
7
|
+
export declare function createSemverRangesProgram<T extends SemverRangeEffects<any>>(ctx: Ctx, effects: T): Effect.Effect<Env, SemverGroupConfigError | DeprecatedTypesError | RenamedWorkspaceTypeError, Ctx>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as Effect from '@effect/io/Effect';
|
|
2
|
-
import type { DeprecatedTypesError } from '../config/get-enabled-types';
|
|
2
|
+
import type { DeprecatedTypesError, RenamedWorkspaceTypeError } from '../config/get-enabled-types';
|
|
3
3
|
import type { Env } from '../env/create-env';
|
|
4
4
|
import type { Ctx } from '../get-context';
|
|
5
5
|
import type { VersionGroupConfigError } from '../get-version-groups';
|
|
6
6
|
import type { VersionEffects } from './effects';
|
|
7
|
-
export declare function createVersionsProgram<T extends VersionEffects<any>>(ctx: Ctx, effects: T): Effect.Effect<Env, VersionGroupConfigError | DeprecatedTypesError, Ctx>;
|
|
7
|
+
export declare function createVersionsProgram<T extends VersionEffects<any>>(ctx: Ctx, effects: T): Effect.Effect<Env, VersionGroupConfigError | DeprecatedTypesError | RenamedWorkspaceTypeError, Ctx>;
|
package/dist/env/default-env.js
CHANGED
|
@@ -25,14 +25,21 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.defaultEnv = void 0;
|
|
27
27
|
const cosmiconfig_1 = require("cosmiconfig");
|
|
28
|
+
const pipe_1 = require("tightrope/fn/pipe");
|
|
29
|
+
const from_try_1 = require("tightrope/result/from-try");
|
|
30
|
+
const unwrap_or_else_1 = require("tightrope/result/unwrap-or-else");
|
|
28
31
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
29
32
|
// @ts-ignore Select *does* exist
|
|
30
33
|
const enquirer_1 = require("enquirer");
|
|
31
|
-
const
|
|
34
|
+
const fs_1 = require("fs");
|
|
32
35
|
const globby = __importStar(require("globby"));
|
|
33
36
|
const path_1 = require("path");
|
|
34
37
|
const readYamlFile = __importStar(require("read-yaml-file"));
|
|
35
38
|
const is_non_empty_object_1 = require("tightrope/guard/is-non-empty-object");
|
|
39
|
+
const result_1 = require("tightrope/result");
|
|
40
|
+
const filter_1 = require("tightrope/result/filter");
|
|
41
|
+
const map_1 = require("tightrope/result/map");
|
|
42
|
+
const map_err_1 = require("tightrope/result/map-err");
|
|
36
43
|
const constants_1 = require("../constants");
|
|
37
44
|
const log_verbose_1 = require("../lib/log-verbose");
|
|
38
45
|
exports.defaultEnv = {
|
|
@@ -59,18 +66,15 @@ exports.defaultEnv = {
|
|
|
59
66
|
process.exit(code);
|
|
60
67
|
},
|
|
61
68
|
readConfigFileSync(configPath) {
|
|
62
|
-
var _a;
|
|
63
69
|
(0, log_verbose_1.logVerbose)('readConfigFileSync(', configPath, ')');
|
|
64
70
|
const client = (0, cosmiconfig_1.cosmiconfigSync)('syncpack');
|
|
65
71
|
const result = configPath ? client.load(configPath) : client.search();
|
|
66
72
|
if (!(0, is_non_empty_object_1.isNonEmptyObject)(result)) {
|
|
67
73
|
const rcPath = (0, path_1.join)(constants_1.CWD, 'package.json');
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
(0, log_verbose_1.logVerbose)('no config file found');
|
|
73
|
-
return {};
|
|
74
|
+
return (0, pipe_1.pipe)((0, from_try_1.fromTry)(() => (0, fs_1.readFileSync)(rcPath, { encoding: 'utf8' })), (0, map_1.map)(JSON.parse), (0, map_1.map)((pjson) => { var _a; return (_a = pjson === null || pjson === void 0 ? void 0 : pjson.config) === null || _a === void 0 ? void 0 : _a.syncpack; }), (0, filter_1.filter)(is_non_empty_object_1.isNonEmptyObject, 'no config file found'), (0, map_err_1.mapErr)((err) => {
|
|
75
|
+
(0, log_verbose_1.logVerbose)('no config file found');
|
|
76
|
+
return err;
|
|
77
|
+
}), (0, unwrap_or_else_1.unwrapOrElse)(() => new result_1.Ok({})));
|
|
74
78
|
}
|
|
75
79
|
const rcPath = result.filepath;
|
|
76
80
|
const rcConfig = result.config;
|
|
@@ -81,7 +85,7 @@ exports.defaultEnv = {
|
|
|
81
85
|
/* istanbul ignore next */
|
|
82
86
|
readFileSync(filePath) {
|
|
83
87
|
(0, log_verbose_1.logVerbose)('readFileSync(', filePath, ')');
|
|
84
|
-
return (0,
|
|
88
|
+
return (0, fs_1.readFileSync)(filePath, { encoding: 'utf8' });
|
|
85
89
|
},
|
|
86
90
|
/* istanbul ignore next */
|
|
87
91
|
readYamlFileSync(filePath) {
|
|
@@ -91,6 +95,6 @@ exports.defaultEnv = {
|
|
|
91
95
|
/* istanbul ignore next */
|
|
92
96
|
writeFileSync(filePath, contents) {
|
|
93
97
|
(0, log_verbose_1.logVerbose)('writeFileSync(', filePath, contents, ')');
|
|
94
|
-
(0,
|
|
98
|
+
(0, fs_1.writeFileSync)(filePath, contents);
|
|
95
99
|
},
|
|
96
100
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as Effect from '@effect/io/Effect';
|
|
2
|
-
import type { DeprecatedTypesError } from '../config/get-enabled-types';
|
|
2
|
+
import type { DeprecatedTypesError, RenamedWorkspaceTypeError } from '../config/get-enabled-types';
|
|
3
3
|
import type { GlobError, ReadConfigFileError, ReadFileError, WriteFileError } from '../env/tags';
|
|
4
4
|
import type { NoSourcesFoundError } from '../get-package-json-files/get-file-paths';
|
|
5
5
|
import type { JsonParseError } from '../get-package-json-files/get-patterns/read-json-safe';
|
|
@@ -12,6 +12,7 @@ export interface ErrorHandlers<R = Effect.Effect<never, never, void>> {
|
|
|
12
12
|
NoSourcesFoundError(err: NoSourcesFoundError): R;
|
|
13
13
|
ReadConfigFileError(err: ReadConfigFileError): R;
|
|
14
14
|
ReadFileError(err: ReadFileError): R;
|
|
15
|
+
RenamedWorkspaceTypeError(err: RenamedWorkspaceTypeError): R;
|
|
15
16
|
SemverGroupConfigError(err: SemverGroupConfigError): R;
|
|
16
17
|
VersionGroupConfigError(err: VersionGroupConfigError): R;
|
|
17
18
|
WriteFileError(err: WriteFileError): R;
|
|
@@ -44,6 +44,9 @@ const createErrorHandlers = (errorHandlers) => ({
|
|
|
44
44
|
ReadFileError(err) {
|
|
45
45
|
return Effect.sync(() => errorHandlers.ReadFileError(err));
|
|
46
46
|
},
|
|
47
|
+
RenamedWorkspaceTypeError(err) {
|
|
48
|
+
return Effect.sync(() => errorHandlers.RenamedWorkspaceTypeError(err));
|
|
49
|
+
},
|
|
47
50
|
SemverGroupConfigError(err) {
|
|
48
51
|
return Effect.sync(() => errorHandlers.SemverGroupConfigError(err));
|
|
49
52
|
},
|
|
@@ -37,6 +37,11 @@ exports.defaultErrorHandlers = {
|
|
|
37
37
|
console.log(chalk_1.default.red(' File:', err.filePath));
|
|
38
38
|
console.log(chalk_1.default.red(' Error:', err.error));
|
|
39
39
|
},
|
|
40
|
+
RenamedWorkspaceTypeError() {
|
|
41
|
+
const url = 'https://github.com/JamieMason/syncpack/releases/tag/11.2.1';
|
|
42
|
+
console.log(chalk_1.default.red(constants_1.ICON.panic, `The "workspace" dependency type was renamed to "local" in ${url}`));
|
|
43
|
+
console.log(chalk_1.default.red(' Docs: https://jamiemason.github.io/syncpack/config/dependency-types'));
|
|
44
|
+
},
|
|
40
45
|
SemverGroupConfigError(err) {
|
|
41
46
|
console.log(chalk_1.default.red(constants_1.ICON.panic, 'Your semver group config contains an error'));
|
|
42
47
|
console.log(chalk_1.default.red(' Error:', err.error));
|
|
@@ -26,11 +26,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
26
26
|
exports.getContext = void 0;
|
|
27
27
|
const Function_1 = require("@effect/data/Function");
|
|
28
28
|
const Effect = __importStar(require("@effect/io/Effect"));
|
|
29
|
-
const
|
|
29
|
+
const tag_1 = require("../config/tag");
|
|
30
30
|
const tags_1 = require("../env/tags");
|
|
31
31
|
const get_package_json_files_1 = require("../get-package-json-files");
|
|
32
32
|
function getContext() {
|
|
33
|
-
return (0, Function_1.pipe)(Effect.Do, Effect.bind('cli', () =>
|
|
33
|
+
return (0, Function_1.pipe)(Effect.Do, Effect.bind('cli', () => tag_1.CliConfigTag), Effect.bind('env', () => tags_1.EnvTag), Effect.bind('rcFile', ({ cli, env }) => env.readConfigFileSync(cli.configPath)), Effect.bind('packageJsonFiles', get_package_json_files_1.getPackageJsonFiles), Effect.map(({ cli, rcFile, packageJsonFiles }) => ({
|
|
34
34
|
config: { cli, rcFile },
|
|
35
35
|
isInvalid: false,
|
|
36
36
|
packageJsonFiles,
|
|
@@ -40,7 +40,7 @@ const get_yarn_patterns_1 = require("./get-yarn-patterns");
|
|
|
40
40
|
* @returns `['./package.json', './packages/* /package.json']`
|
|
41
41
|
*/
|
|
42
42
|
function getPatterns(config) {
|
|
43
|
-
return (0, Function_1.pipe)(getCliPatterns(), Effect.flatMap((option) => (O.isSome(option) ? Effect.succeed(option) : (0, get_yarn_patterns_1.getYarnPatterns)())), Effect.flatMap((option) => (O.isSome(option) ? Effect.succeed(option) : (0, get_pnpm_patterns_1.getPnpmPatterns)())), Effect.flatMap((option) => (O.isSome(option) ? Effect.succeed(option) : (0, get_lerna_patterns_1.getLernaPatterns)())), Effect.map((option) => (0, Function_1.pipe)(option, O.map(addRootDir), O.map(limitToPackageJson), O.getOrElse(() => constants_1.
|
|
43
|
+
return (0, Function_1.pipe)(getCliPatterns(), Effect.flatMap((option) => (O.isSome(option) ? Effect.succeed(option) : (0, get_yarn_patterns_1.getYarnPatterns)())), Effect.flatMap((option) => (O.isSome(option) ? Effect.succeed(option) : (0, get_pnpm_patterns_1.getPnpmPatterns)())), Effect.flatMap((option) => (O.isSome(option) ? Effect.succeed(option) : (0, get_lerna_patterns_1.getLernaPatterns)())), Effect.map((option) => (0, Function_1.pipe)(option, O.map(addRootDir), O.map(limitToPackageJson), O.getOrElse(() => [...constants_1.DEFAULT_CONFIG.source]))));
|
|
44
44
|
function getCliPatterns() {
|
|
45
45
|
return (0, Function_1.pipe)(O.some((0, get_source_1.getSource)(config)), O.filter(is_array_of_strings_1.isArrayOfStrings), Effect.succeed);
|
|
46
46
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as Data from '@effect/data/Data';
|
|
2
2
|
import * as Effect from '@effect/io/Effect';
|
|
3
3
|
import type { Union } from 'ts-toolbelt';
|
|
4
|
-
import type { DeprecatedTypesError } from '../config/get-enabled-types';
|
|
4
|
+
import type { DeprecatedTypesError, RenamedWorkspaceTypeError } from '../config/get-enabled-types';
|
|
5
5
|
import type { Ctx } from '../get-context';
|
|
6
6
|
import type { Instance } from '../instance';
|
|
7
7
|
import { FilteredOutSemverGroup } from './filtered-out';
|
|
@@ -80,5 +80,5 @@ export declare class SemverGroupConfigError extends SemverGroupConfigError_base<
|
|
|
80
80
|
readonly error: string;
|
|
81
81
|
}> {
|
|
82
82
|
}
|
|
83
|
-
export declare function getSemverGroups(ctx: Ctx): Effect.Effect<never, SemverGroupConfigError | DeprecatedTypesError, AnySemverGroup[]>;
|
|
83
|
+
export declare function getSemverGroups(ctx: Ctx): Effect.Effect<never, SemverGroupConfigError | DeprecatedTypesError | RenamedWorkspaceTypeError, AnySemverGroup[]>;
|
|
84
84
|
export {};
|
|
@@ -49,7 +49,7 @@ class WithRangeSemverGroup extends Data.TaggedClass('WithRange') {
|
|
|
49
49
|
isValid: false,
|
|
50
50
|
}));
|
|
51
51
|
}
|
|
52
|
-
const isLocalPackageInstance = instance.strategy.name === '
|
|
52
|
+
const isLocalPackageInstance = instance.strategy.name === 'local';
|
|
53
53
|
const exactVersion = (0, set_semver_range_1.setSemverRange)('', instance.specifier);
|
|
54
54
|
const expectedVersion = (0, set_semver_range_1.setSemverRange)(this.config.range, instance.specifier);
|
|
55
55
|
if (isLocalPackageInstance && instance.specifier !== exactVersion) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as Data from '@effect/data/Data';
|
|
2
2
|
import * as Effect from '@effect/io/Effect';
|
|
3
3
|
import type { Union } from 'ts-toolbelt';
|
|
4
|
-
import type { DeprecatedTypesError } from '../config/get-enabled-types';
|
|
4
|
+
import type { DeprecatedTypesError, RenamedWorkspaceTypeError } from '../config/get-enabled-types';
|
|
5
5
|
import type { Ctx } from '../get-context';
|
|
6
6
|
import type { Instance } from '../instance';
|
|
7
7
|
import { BannedVersionGroup } from './banned';
|
|
@@ -183,5 +183,5 @@ export declare class VersionGroupConfigError extends VersionGroupConfigError_bas
|
|
|
183
183
|
readonly error: string;
|
|
184
184
|
}> {
|
|
185
185
|
}
|
|
186
|
-
export declare function getVersionGroups(ctx: Ctx): Effect.Effect<never, VersionGroupConfigError | DeprecatedTypesError, AnyVersionGroup[]>;
|
|
186
|
+
export declare function getVersionGroups(ctx: Ctx): Effect.Effect<never, VersionGroupConfigError | DeprecatedTypesError | RenamedWorkspaceTypeError, AnyVersionGroup[]>;
|
|
187
187
|
export {};
|
|
@@ -180,7 +180,7 @@ function createVersionGroups(ctx) {
|
|
|
180
180
|
const label = (0, is_non_empty_string_1.isNonEmptyString)(config.label) ? config.label : '';
|
|
181
181
|
const dependencyTypes = (0, is_array_of_strings_1.isArrayOfStrings)(config.dependencyTypes)
|
|
182
182
|
? config.dependencyTypes
|
|
183
|
-
: [];
|
|
183
|
+
: ['**'];
|
|
184
184
|
if (config.isBanned === true) {
|
|
185
185
|
versionGroups.push(Effect.succeed(new banned_1.BannedVersionGroup({
|
|
186
186
|
dependencies,
|
|
@@ -105,5 +105,5 @@ function hasNonSemverSpecifiers(instances) {
|
|
|
105
105
|
return instances.some((instance) => Option.isNone(instance.getSemverSpecifier()));
|
|
106
106
|
}
|
|
107
107
|
function getLocalPackageInstance(instances) {
|
|
108
|
-
return instances.find((instance) => instance.strategy.name === '
|
|
108
|
+
return instances.find((instance) => instance.strategy.name === 'local');
|
|
109
109
|
}
|
|
@@ -6,10 +6,40 @@ const is_non_empty_array_1 = require("tightrope/guard/is-non-empty-array");
|
|
|
6
6
|
function canAddToGroup(group, instance) {
|
|
7
7
|
const { dependencies, dependencyTypes, packages } = group.config;
|
|
8
8
|
return (group.canAdd(instance) &&
|
|
9
|
-
(
|
|
10
|
-
(
|
|
11
|
-
|
|
12
|
-
(!(0, is_non_empty_array_1.isNonEmptyArray)(dependencies) ||
|
|
13
|
-
dependencies.some((pattern) => (0, minimatch_1.minimatch)(instance.name, pattern))));
|
|
9
|
+
matchesDependencyTypes(dependencyTypes, instance) &&
|
|
10
|
+
matchesPackages(packages, instance) &&
|
|
11
|
+
matchesDependencies(dependencies, instance));
|
|
14
12
|
}
|
|
15
13
|
exports.canAddToGroup = canAddToGroup;
|
|
14
|
+
function matchesDependencies(dependencies, instance) {
|
|
15
|
+
// matches if not defined
|
|
16
|
+
if (!(0, is_non_empty_array_1.isNonEmptyArray)(dependencies))
|
|
17
|
+
return true;
|
|
18
|
+
return dependencies.some((pattern) => (0, minimatch_1.minimatch)(instance.name, pattern));
|
|
19
|
+
}
|
|
20
|
+
function matchesPackages(packages, instance) {
|
|
21
|
+
// matches if not defined
|
|
22
|
+
if (!(0, is_non_empty_array_1.isNonEmptyArray)(packages))
|
|
23
|
+
return true;
|
|
24
|
+
return packages.some((pattern) => (0, minimatch_1.minimatch)(instance.pkgName, pattern));
|
|
25
|
+
}
|
|
26
|
+
function matchesDependencyTypes(dependencyTypes, instance) {
|
|
27
|
+
// matches if not defined
|
|
28
|
+
if (!(0, is_non_empty_array_1.isNonEmptyArray)(dependencyTypes))
|
|
29
|
+
return true;
|
|
30
|
+
if (dependencyTypes.join('') === '**')
|
|
31
|
+
return true;
|
|
32
|
+
const negative = [];
|
|
33
|
+
const positive = [];
|
|
34
|
+
dependencyTypes.forEach((name) => {
|
|
35
|
+
if (name.startsWith('!')) {
|
|
36
|
+
negative.push(name.replace('!', ''));
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
positive.push(name);
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
if ((0, is_non_empty_array_1.isNonEmptyArray)(negative) && !negative.includes(instance.strategy.name))
|
|
43
|
+
return true;
|
|
44
|
+
return (0, is_non_empty_array_1.isNonEmptyArray)(positive) && positive.includes(instance.strategy.name);
|
|
45
|
+
}
|
package/dist/instance/index.d.ts
CHANGED
|
@@ -36,7 +36,7 @@ export declare namespace Instance {
|
|
|
36
36
|
* `RegistryResult` types from npm/npm-package-arg. Instead of grouping them
|
|
37
37
|
* together we are being more specific
|
|
38
38
|
*/
|
|
39
|
-
type SpecificRegistryResult<T extends RegistryResult['type'] | '
|
|
39
|
+
type SpecificRegistryResult<T extends RegistryResult['type'] | 'local'> = Omit<RegistryResult, 'type'> & {
|
|
40
40
|
type: T;
|
|
41
41
|
};
|
|
42
42
|
const FileInstance_base: new <A extends Record<string, any>>(args: Data.IsEqualTo<Omit<A, keyof import("@effect/data/Equal").Equal>, {}> extends true ? void : Omit<A, keyof import("@effect/data/Equal").Equal>) => Data.Data<A & {
|
package/dist/schema.json
ADDED
|
@@ -0,0 +1,361 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"additionalProperties": false,
|
|
4
|
+
"definitions": {
|
|
5
|
+
"Record<string,CustomTypeConfig.Any>": {
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"type": "object"
|
|
8
|
+
},
|
|
9
|
+
"SemverGroupConfig.Any": {
|
|
10
|
+
"anyOf": [
|
|
11
|
+
{
|
|
12
|
+
"$ref": "#/definitions/{isIgnored:true;dependencies:string[];dependencyTypes?:string[];label?:string;packages:string[];range?:never;}"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"$ref": "#/definitions/{range:SemverRange;dependencies:string[];dependencyTypes?:string[];label?:string;packages:string[];isIgnored?:never;}"
|
|
16
|
+
}
|
|
17
|
+
]
|
|
18
|
+
},
|
|
19
|
+
"SemverRange": {
|
|
20
|
+
"default": "",
|
|
21
|
+
"description": "Aliases for semver range formats supported by syncpack\n\nDefaults to `\"\"` to ensure that exact dependency versions are used\ninstead of loose ranges, but this can be overridden in your config file\nor via the `--semver-range` command line option.\n\n| Supported Range | Example |\n| --------------- | --------: |\n| `\"<\"` | `<1.4.2` |\n| `\"<=\"` | `<=1.4.2` |\n| `\"\"` | `1.4.2` |\n| `\"~\"` | `~1.4.2` |\n| `\"^\"` | `^1.4.2` |\n| `\">=\"` | `>=1.4.2` |\n| `\">\"` | `>1.4.2` |\n| `\"*\"` | `*` |",
|
|
22
|
+
"enum": [
|
|
23
|
+
"",
|
|
24
|
+
"*",
|
|
25
|
+
".x",
|
|
26
|
+
"<",
|
|
27
|
+
"<=",
|
|
28
|
+
">",
|
|
29
|
+
">=",
|
|
30
|
+
"^",
|
|
31
|
+
"~"
|
|
32
|
+
],
|
|
33
|
+
"type": "string"
|
|
34
|
+
},
|
|
35
|
+
"VersionGroupConfig.Any": {
|
|
36
|
+
"anyOf": [
|
|
37
|
+
{
|
|
38
|
+
"$ref": "#/definitions/{isBanned:true;dependencies:string[];dependencyTypes?:string[];label?:string;packages:string[];isIgnored?:never;pinVersion?:never;snapTo?:never;policy?:never;preferVersion?:never;}"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"$ref": "#/definitions/{isIgnored:true;dependencies:string[];dependencyTypes?:string[];label?:string;packages:string[];isBanned?:never;pinVersion?:never;snapTo?:never;policy?:never;preferVersion?:never;}"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"$ref": "#/definitions/{pinVersion:string;dependencies:string[];dependencyTypes?:string[];label?:string;packages:string[];isIgnored?:never;isBanned?:never;snapTo?:never;policy?:never;preferVersion?:never;}"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"$ref": "#/definitions/{snapTo:string[];dependencies:string[];dependencyTypes?:string[];label?:string;packages:string[];isIgnored?:never;isBanned?:never;pinVersion?:never;policy?:never;preferVersion?:never;}"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"$ref": "#/definitions/{policy:\"sameRange\";dependencies:string[];dependencyTypes?:string[];label?:string;packages:string[];isIgnored?:never;isBanned?:never;pinVersion?:never;snapTo?:never;preferVersion?:never;}"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"$ref": "#/definitions/{preferVersion?:\"highestSemver\"|\"lowestSemver\";dependencies:string[];dependencyTypes?:string[];label?:string;packages:string[];isIgnored?:never;isBanned?:never;pinVersion?:never;snapTo?:never;policy?:never;}"
|
|
54
|
+
}
|
|
55
|
+
]
|
|
56
|
+
},
|
|
57
|
+
"{isBanned:true;dependencies:string[];dependencyTypes?:string[];label?:string;packages:string[];isIgnored?:never;pinVersion?:never;snapTo?:never;policy?:never;preferVersion?:never;}": {
|
|
58
|
+
"additionalProperties": false,
|
|
59
|
+
"properties": {
|
|
60
|
+
"dependencies": {
|
|
61
|
+
"items": {
|
|
62
|
+
"type": "string"
|
|
63
|
+
},
|
|
64
|
+
"type": "array"
|
|
65
|
+
},
|
|
66
|
+
"dependencyTypes": {
|
|
67
|
+
"items": {
|
|
68
|
+
"type": "string"
|
|
69
|
+
},
|
|
70
|
+
"type": "array"
|
|
71
|
+
},
|
|
72
|
+
"isBanned": {
|
|
73
|
+
"const": true,
|
|
74
|
+
"type": "boolean"
|
|
75
|
+
},
|
|
76
|
+
"label": {
|
|
77
|
+
"type": "string"
|
|
78
|
+
},
|
|
79
|
+
"packages": {
|
|
80
|
+
"items": {
|
|
81
|
+
"type": "string"
|
|
82
|
+
},
|
|
83
|
+
"type": "array"
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
"type": "object"
|
|
87
|
+
},
|
|
88
|
+
"{isIgnored:true;dependencies:string[];dependencyTypes?:string[];label?:string;packages:string[];isBanned?:never;pinVersion?:never;snapTo?:never;policy?:never;preferVersion?:never;}": {
|
|
89
|
+
"additionalProperties": false,
|
|
90
|
+
"properties": {
|
|
91
|
+
"dependencies": {
|
|
92
|
+
"items": {
|
|
93
|
+
"type": "string"
|
|
94
|
+
},
|
|
95
|
+
"type": "array"
|
|
96
|
+
},
|
|
97
|
+
"dependencyTypes": {
|
|
98
|
+
"items": {
|
|
99
|
+
"type": "string"
|
|
100
|
+
},
|
|
101
|
+
"type": "array"
|
|
102
|
+
},
|
|
103
|
+
"isIgnored": {
|
|
104
|
+
"const": true,
|
|
105
|
+
"type": "boolean"
|
|
106
|
+
},
|
|
107
|
+
"label": {
|
|
108
|
+
"type": "string"
|
|
109
|
+
},
|
|
110
|
+
"packages": {
|
|
111
|
+
"items": {
|
|
112
|
+
"type": "string"
|
|
113
|
+
},
|
|
114
|
+
"type": "array"
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
"type": "object"
|
|
118
|
+
},
|
|
119
|
+
"{isIgnored:true;dependencies:string[];dependencyTypes?:string[];label?:string;packages:string[];range?:never;}": {
|
|
120
|
+
"additionalProperties": false,
|
|
121
|
+
"properties": {
|
|
122
|
+
"dependencies": {
|
|
123
|
+
"items": {
|
|
124
|
+
"type": "string"
|
|
125
|
+
},
|
|
126
|
+
"type": "array"
|
|
127
|
+
},
|
|
128
|
+
"dependencyTypes": {
|
|
129
|
+
"items": {
|
|
130
|
+
"type": "string"
|
|
131
|
+
},
|
|
132
|
+
"type": "array"
|
|
133
|
+
},
|
|
134
|
+
"isIgnored": {
|
|
135
|
+
"const": true,
|
|
136
|
+
"type": "boolean"
|
|
137
|
+
},
|
|
138
|
+
"label": {
|
|
139
|
+
"type": "string"
|
|
140
|
+
},
|
|
141
|
+
"packages": {
|
|
142
|
+
"items": {
|
|
143
|
+
"type": "string"
|
|
144
|
+
},
|
|
145
|
+
"type": "array"
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
"type": "object"
|
|
149
|
+
},
|
|
150
|
+
"{pinVersion:string;dependencies:string[];dependencyTypes?:string[];label?:string;packages:string[];isIgnored?:never;isBanned?:never;snapTo?:never;policy?:never;preferVersion?:never;}": {
|
|
151
|
+
"additionalProperties": false,
|
|
152
|
+
"properties": {
|
|
153
|
+
"dependencies": {
|
|
154
|
+
"items": {
|
|
155
|
+
"type": "string"
|
|
156
|
+
},
|
|
157
|
+
"type": "array"
|
|
158
|
+
},
|
|
159
|
+
"dependencyTypes": {
|
|
160
|
+
"items": {
|
|
161
|
+
"type": "string"
|
|
162
|
+
},
|
|
163
|
+
"type": "array"
|
|
164
|
+
},
|
|
165
|
+
"label": {
|
|
166
|
+
"type": "string"
|
|
167
|
+
},
|
|
168
|
+
"packages": {
|
|
169
|
+
"items": {
|
|
170
|
+
"type": "string"
|
|
171
|
+
},
|
|
172
|
+
"type": "array"
|
|
173
|
+
},
|
|
174
|
+
"pinVersion": {
|
|
175
|
+
"type": "string"
|
|
176
|
+
}
|
|
177
|
+
},
|
|
178
|
+
"type": "object"
|
|
179
|
+
},
|
|
180
|
+
"{policy:\"sameRange\";dependencies:string[];dependencyTypes?:string[];label?:string;packages:string[];isIgnored?:never;isBanned?:never;pinVersion?:never;snapTo?:never;preferVersion?:never;}": {
|
|
181
|
+
"additionalProperties": false,
|
|
182
|
+
"properties": {
|
|
183
|
+
"dependencies": {
|
|
184
|
+
"items": {
|
|
185
|
+
"type": "string"
|
|
186
|
+
},
|
|
187
|
+
"type": "array"
|
|
188
|
+
},
|
|
189
|
+
"dependencyTypes": {
|
|
190
|
+
"items": {
|
|
191
|
+
"type": "string"
|
|
192
|
+
},
|
|
193
|
+
"type": "array"
|
|
194
|
+
},
|
|
195
|
+
"label": {
|
|
196
|
+
"type": "string"
|
|
197
|
+
},
|
|
198
|
+
"packages": {
|
|
199
|
+
"items": {
|
|
200
|
+
"type": "string"
|
|
201
|
+
},
|
|
202
|
+
"type": "array"
|
|
203
|
+
},
|
|
204
|
+
"policy": {
|
|
205
|
+
"const": "sameRange",
|
|
206
|
+
"type": "string"
|
|
207
|
+
}
|
|
208
|
+
},
|
|
209
|
+
"type": "object"
|
|
210
|
+
},
|
|
211
|
+
"{preferVersion?:\"highestSemver\"|\"lowestSemver\";dependencies:string[];dependencyTypes?:string[];label?:string;packages:string[];isIgnored?:never;isBanned?:never;pinVersion?:never;snapTo?:never;policy?:never;}": {
|
|
212
|
+
"additionalProperties": false,
|
|
213
|
+
"properties": {
|
|
214
|
+
"dependencies": {
|
|
215
|
+
"items": {
|
|
216
|
+
"type": "string"
|
|
217
|
+
},
|
|
218
|
+
"type": "array"
|
|
219
|
+
},
|
|
220
|
+
"dependencyTypes": {
|
|
221
|
+
"items": {
|
|
222
|
+
"type": "string"
|
|
223
|
+
},
|
|
224
|
+
"type": "array"
|
|
225
|
+
},
|
|
226
|
+
"label": {
|
|
227
|
+
"type": "string"
|
|
228
|
+
},
|
|
229
|
+
"packages": {
|
|
230
|
+
"items": {
|
|
231
|
+
"type": "string"
|
|
232
|
+
},
|
|
233
|
+
"type": "array"
|
|
234
|
+
},
|
|
235
|
+
"preferVersion": {
|
|
236
|
+
"enum": [
|
|
237
|
+
"highestSemver",
|
|
238
|
+
"lowestSemver"
|
|
239
|
+
],
|
|
240
|
+
"type": "string"
|
|
241
|
+
}
|
|
242
|
+
},
|
|
243
|
+
"type": "object"
|
|
244
|
+
},
|
|
245
|
+
"{range:SemverRange;dependencies:string[];dependencyTypes?:string[];label?:string;packages:string[];isIgnored?:never;}": {
|
|
246
|
+
"additionalProperties": false,
|
|
247
|
+
"properties": {
|
|
248
|
+
"dependencies": {
|
|
249
|
+
"items": {
|
|
250
|
+
"type": "string"
|
|
251
|
+
},
|
|
252
|
+
"type": "array"
|
|
253
|
+
},
|
|
254
|
+
"dependencyTypes": {
|
|
255
|
+
"items": {
|
|
256
|
+
"type": "string"
|
|
257
|
+
},
|
|
258
|
+
"type": "array"
|
|
259
|
+
},
|
|
260
|
+
"label": {
|
|
261
|
+
"type": "string"
|
|
262
|
+
},
|
|
263
|
+
"packages": {
|
|
264
|
+
"items": {
|
|
265
|
+
"type": "string"
|
|
266
|
+
},
|
|
267
|
+
"type": "array"
|
|
268
|
+
},
|
|
269
|
+
"range": {
|
|
270
|
+
"$ref": "#/definitions/SemverRange"
|
|
271
|
+
}
|
|
272
|
+
},
|
|
273
|
+
"type": "object"
|
|
274
|
+
},
|
|
275
|
+
"{snapTo:string[];dependencies:string[];dependencyTypes?:string[];label?:string;packages:string[];isIgnored?:never;isBanned?:never;pinVersion?:never;policy?:never;preferVersion?:never;}": {
|
|
276
|
+
"additionalProperties": false,
|
|
277
|
+
"properties": {
|
|
278
|
+
"dependencies": {
|
|
279
|
+
"items": {
|
|
280
|
+
"type": "string"
|
|
281
|
+
},
|
|
282
|
+
"type": "array"
|
|
283
|
+
},
|
|
284
|
+
"dependencyTypes": {
|
|
285
|
+
"items": {
|
|
286
|
+
"type": "string"
|
|
287
|
+
},
|
|
288
|
+
"type": "array"
|
|
289
|
+
},
|
|
290
|
+
"label": {
|
|
291
|
+
"type": "string"
|
|
292
|
+
},
|
|
293
|
+
"packages": {
|
|
294
|
+
"items": {
|
|
295
|
+
"type": "string"
|
|
296
|
+
},
|
|
297
|
+
"type": "array"
|
|
298
|
+
},
|
|
299
|
+
"snapTo": {
|
|
300
|
+
"items": {
|
|
301
|
+
"type": "string"
|
|
302
|
+
},
|
|
303
|
+
"type": "array"
|
|
304
|
+
}
|
|
305
|
+
},
|
|
306
|
+
"type": "object"
|
|
307
|
+
}
|
|
308
|
+
},
|
|
309
|
+
"properties": {
|
|
310
|
+
"customTypes": {
|
|
311
|
+
"$ref": "#/definitions/Record<string,CustomTypeConfig.Any>"
|
|
312
|
+
},
|
|
313
|
+
"dependencyTypes": {
|
|
314
|
+
"items": {
|
|
315
|
+
"type": "string"
|
|
316
|
+
},
|
|
317
|
+
"type": "array"
|
|
318
|
+
},
|
|
319
|
+
"filter": {
|
|
320
|
+
"type": "string"
|
|
321
|
+
},
|
|
322
|
+
"indent": {
|
|
323
|
+
"type": "string"
|
|
324
|
+
},
|
|
325
|
+
"semverGroups": {
|
|
326
|
+
"items": {
|
|
327
|
+
"$ref": "#/definitions/SemverGroupConfig.Any"
|
|
328
|
+
},
|
|
329
|
+
"type": "array"
|
|
330
|
+
},
|
|
331
|
+
"semverRange": {
|
|
332
|
+
"$ref": "#/definitions/SemverRange"
|
|
333
|
+
},
|
|
334
|
+
"sortAz": {
|
|
335
|
+
"items": {
|
|
336
|
+
"type": "string"
|
|
337
|
+
},
|
|
338
|
+
"type": "array"
|
|
339
|
+
},
|
|
340
|
+
"sortFirst": {
|
|
341
|
+
"items": {
|
|
342
|
+
"type": "string"
|
|
343
|
+
},
|
|
344
|
+
"type": "array"
|
|
345
|
+
},
|
|
346
|
+
"source": {
|
|
347
|
+
"items": {
|
|
348
|
+
"type": "string"
|
|
349
|
+
},
|
|
350
|
+
"type": "array"
|
|
351
|
+
},
|
|
352
|
+
"versionGroups": {
|
|
353
|
+
"items": {
|
|
354
|
+
"$ref": "#/definitions/VersionGroupConfig.Any"
|
|
355
|
+
},
|
|
356
|
+
"type": "array"
|
|
357
|
+
}
|
|
358
|
+
},
|
|
359
|
+
"type": "object"
|
|
360
|
+
}
|
|
361
|
+
|
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": "
|
|
4
|
+
"version": "11.2.1",
|
|
5
5
|
"author": "Jamie Mason <jamie@foldleft.io> (https://github.com/JamieMason)",
|
|
6
6
|
"bin": {
|
|
7
7
|
"syncpack": "dist/bin.js",
|
|
@@ -32,14 +32,13 @@
|
|
|
32
32
|
],
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@effect/data": "0.17.1",
|
|
35
|
-
"@effect/io": "0.
|
|
36
|
-
"@effect/match": "0.
|
|
37
|
-
"@effect/schema": "0.
|
|
35
|
+
"@effect/io": "0.38.0",
|
|
36
|
+
"@effect/match": "0.32.0",
|
|
37
|
+
"@effect/schema": "0.33.1",
|
|
38
38
|
"chalk": "4.1.2",
|
|
39
39
|
"commander": "11.0.0",
|
|
40
40
|
"cosmiconfig": "8.2.0",
|
|
41
41
|
"enquirer": "2.4.1",
|
|
42
|
-
"fs-extra": "11.1.1",
|
|
43
42
|
"globby": "11.1.0",
|
|
44
43
|
"minimatch": "9.0.3",
|
|
45
44
|
"npm-package-arg": "10.1.0",
|
|
@@ -52,15 +51,14 @@
|
|
|
52
51
|
},
|
|
53
52
|
"devDependencies": {
|
|
54
53
|
"@tsconfig/node18": "18.2.0",
|
|
55
|
-
"@types/fs-extra": "11.0.1",
|
|
56
54
|
"@types/jest": "29.5.3",
|
|
57
55
|
"@types/node": "14.18.36",
|
|
58
56
|
"@types/npm-package-arg": "6.1.1",
|
|
59
57
|
"@types/prompts": "2.4.4",
|
|
60
58
|
"@types/semver": "7.5.0",
|
|
61
|
-
"@typescript-eslint/eslint-plugin": "6.
|
|
62
|
-
"@typescript-eslint/parser": "6.
|
|
63
|
-
"eslint": "8.
|
|
59
|
+
"@typescript-eslint/eslint-plugin": "6.3.0",
|
|
60
|
+
"@typescript-eslint/parser": "6.3.0",
|
|
61
|
+
"eslint": "8.47.0",
|
|
64
62
|
"eslint-plugin-import": "2.28.0",
|
|
65
63
|
"eslint-plugin-jest": "27.2.3",
|
|
66
64
|
"expect-more-jest": "5.5.0",
|
|
@@ -69,7 +67,8 @@
|
|
|
69
67
|
"rimraf": "5.0.1",
|
|
70
68
|
"ts-jest": "29.1.1",
|
|
71
69
|
"ts-node": "10.9.1",
|
|
72
|
-
"typescript": "5.1.6"
|
|
70
|
+
"typescript": "5.1.6",
|
|
71
|
+
"typescript-json-schema": "0.59.0"
|
|
73
72
|
},
|
|
74
73
|
"engines": {
|
|
75
74
|
"node": ">=16"
|
|
@@ -109,7 +108,10 @@
|
|
|
109
108
|
"wrap-ansi": "<8.0.0"
|
|
110
109
|
},
|
|
111
110
|
"scripts": {
|
|
112
|
-
"build": "
|
|
111
|
+
"build": "yarn clean && yarn build:source && yarn build:json-schema",
|
|
112
|
+
"build:json-schema": "typescript-json-schema --noExtraProps src/index.ts RcFile --out dist/schema.json",
|
|
113
|
+
"build:source": "tsc --project tsconfig.build.json",
|
|
114
|
+
"clean": "rm -rf ./dist",
|
|
113
115
|
"format": "yarn format:lint && yarn format:source",
|
|
114
116
|
"format:lint": "yarn lint --fix",
|
|
115
117
|
"format:source": "prettier --write .",
|