syncpack 13.0.1 → 14.0.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -3
- package/index.js +48 -0
- package/package.json +16 -73
- 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 -115
- package/dist/bin-fix-mismatches/index.d.ts +0 -2
- package/dist/bin-fix-mismatches/index.js +0 -33
- package/dist/bin-format/format.d.ts +0 -13
- package/dist/bin-format/format.js +0 -92
- package/dist/bin-format/index.d.ts +0 -2
- package/dist/bin-format/index.js +0 -28
- package/dist/bin-lint/index.d.ts +0 -2
- package/dist/bin-lint/index.js +0 -17
- 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 -30
- package/dist/bin-lint-semver-ranges/lint-semver-ranges.d.ts +0 -16
- package/dist/bin-lint-semver-ranges/lint-semver-ranges.js +0 -92
- package/dist/bin-list/index.d.ts +0 -2
- package/dist/bin-list/index.js +0 -27
- package/dist/bin-list/list.d.ts +0 -14
- package/dist/bin-list/list.js +0 -151
- package/dist/bin-list-mismatches/index.d.ts +0 -2
- package/dist/bin-list-mismatches/index.js +0 -29
- package/dist/bin-list-mismatches/list-mismatches.d.ts +0 -18
- package/dist/bin-list-mismatches/list-mismatches.js +0 -224
- package/dist/bin-prompt/index.d.ts +0 -2
- package/dist/bin-prompt/index.js +0 -29
- package/dist/bin-prompt/prompt.d.ts +0 -11
- package/dist/bin-prompt/prompt.js +0 -95
- package/dist/bin-set-semver-ranges/index.d.ts +0 -2
- package/dist/bin-set-semver-ranges/index.js +0 -32
- package/dist/bin-set-semver-ranges/set-semver-ranges.d.ts +0 -11
- package/dist/bin-set-semver-ranges/set-semver-ranges.js +0 -61
- package/dist/bin-update/effects.d.ts +0 -52
- package/dist/bin-update/effects.js +0 -282
- package/dist/bin-update/index.d.ts +0 -2
- package/dist/bin-update/index.js +0 -24
- 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 -57
- package/dist/config/get-enabled-types.d.ts +0 -17
- package/dist/config/get-enabled-types.js +0 -109
- 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 -9
- 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 -134
- 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 -35
- 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 -12
- 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 -54
- package/dist/get-package-json-files/package-json-file.js +0 -44
- package/dist/guards/can-add-to-group.d.ts +0 -5
- package/dist/guards/can-add-to-group.js +0 -58
- package/dist/guards/is-semver.d.ts +0 -2
- package/dist/guards/is-semver.js +0 -15
- 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 -24
- 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 -31
- package/dist/io/read-json-file-sync.js +0 -23
- 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-formatted-json.d.ts +0 -9
- package/dist/io/to-formatted-json.js +0 -32
- 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 -9
- package/dist/lib/format-repository-url.d.ts +0 -1
- package/dist/lib/format-repository-url.js +0 -40
- package/dist/lib/get-group-header.d.ts +0 -10
- package/dist/lib/get-group-header.js +0 -25
- package/dist/lib/get.d.ts +0 -11
- package/dist/lib/get.js +0 -44
- 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 -24
- 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 -28
- package/dist/option.d.ts +0 -10
- package/dist/option.js +0 -30
- package/dist/report.d.ts +0 -131
- package/dist/report.js +0 -129
- package/dist/schema.json +0 -614
- package/dist/semver-group/create-semver-groups.d.ts +0 -4
- package/dist/semver-group/create-semver-groups.js +0 -83
- 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 -21
- 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 -24
- package/dist/specifier/index.d.ts +0 -28
- package/dist/specifier/index.js +0 -75
- 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 -18
- 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 -35
- 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 -52
- 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 -27
- 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 -118
- 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 -53
- package/dist/version-group/lib/get-range-score.d.ts +0 -2
- package/dist/version-group/lib/get-range-score.js +0 -20
- 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 -71
- package/dist/version-group/standard.d.ts +0 -18
- package/dist/version-group/standard.js +0 -119
package/dist/bin.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import fs from 'node:fs';
|
|
3
|
-
import path from 'node:path';
|
|
4
|
-
import { fileURLToPath } from 'node:url';
|
|
5
|
-
import { program } from 'commander';
|
|
6
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
7
|
-
const __dirname = path.dirname(__filename);
|
|
8
|
-
program
|
|
9
|
-
.version(JSON.parse(fs.readFileSync(`${__dirname}/../package.json`, 'utf8')).version)
|
|
10
|
-
.command('fix-mismatches', 'set dependencies used with different versions to the same version', {
|
|
11
|
-
executableFile: './bin-fix-mismatches/index.js',
|
|
12
|
-
})
|
|
13
|
-
.command('format', 'sort and shorten properties according to a convention', {
|
|
14
|
-
executableFile: './bin-format/index.js',
|
|
15
|
-
})
|
|
16
|
-
.command('lint', 'lint all versions and ranges', {
|
|
17
|
-
executableFile: './bin-lint/index.js',
|
|
18
|
-
})
|
|
19
|
-
.command('lint-semver-ranges', 'check dependency versions comply with the given semver range format', {
|
|
20
|
-
executableFile: './bin-lint-semver-ranges/index.js',
|
|
21
|
-
})
|
|
22
|
-
.command('list-mismatches', 'list every dependency used with different versions in your packages', {
|
|
23
|
-
executableFile: './bin-list-mismatches/index.js',
|
|
24
|
-
})
|
|
25
|
-
.command('list', 'list every dependency used in your packages', {
|
|
26
|
-
executableFile: './bin-list/index.js',
|
|
27
|
-
})
|
|
28
|
-
.command('prompt', 'fix mismatches which syncpack cannot fix automatically', {
|
|
29
|
-
executableFile: './bin-prompt/index.js',
|
|
30
|
-
})
|
|
31
|
-
.command('set-semver-ranges', 'set semver ranges to the given format', {
|
|
32
|
-
executableFile: './bin-set-semver-ranges/index.js',
|
|
33
|
-
})
|
|
34
|
-
.command('update', 'update to the latest versions on the npm registry', {
|
|
35
|
-
executableFile: './bin-update/index.js',
|
|
36
|
-
})
|
|
37
|
-
.parse(process.argv);
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { Effect } from 'effect';
|
|
2
|
-
import type { Ctx } from '../get-context/index.js';
|
|
3
|
-
import { NameAndVersionPropsStrategy } from '../strategy/name-and-version-props.js';
|
|
4
|
-
import { NamedVersionStringStrategy } from '../strategy/named-version-string.js';
|
|
5
|
-
import { UnnamedVersionStringStrategy } from '../strategy/unnamed-version-string.js';
|
|
6
|
-
import { VersionsByNameStrategy } from '../strategy/versions-by-name.js';
|
|
7
|
-
export declare namespace Strategy {
|
|
8
|
-
type Any = NameAndVersionPropsStrategy | NamedVersionStringStrategy | UnnamedVersionStringStrategy | VersionsByNameStrategy;
|
|
9
|
-
}
|
|
10
|
-
declare const InvalidCustomTypeError_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> & {
|
|
11
|
-
readonly _tag: "InvalidCustomTypeError";
|
|
12
|
-
};
|
|
13
|
-
export declare class InvalidCustomTypeError extends InvalidCustomTypeError_base<{
|
|
14
|
-
readonly config: unknown;
|
|
15
|
-
readonly reason: string;
|
|
16
|
-
}> {
|
|
17
|
-
}
|
|
18
|
-
export declare function getCustomTypes({ rcFile, }: Ctx['config']): Effect.Effect<Strategy.Any[], InvalidCustomTypeError>;
|
|
19
|
-
export {};
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { Data, Effect } from 'effect';
|
|
2
|
-
import { isNonEmptyObject } from 'tightrope/guard/is-non-empty-object.js';
|
|
3
|
-
import { isNonEmptyString } from 'tightrope/guard/is-non-empty-string.js';
|
|
4
|
-
import { isObject } from 'tightrope/guard/is-object.js';
|
|
5
|
-
import { DEFAULT_CONFIG } from '../constants.js';
|
|
6
|
-
import { NameAndVersionPropsStrategy } from '../strategy/name-and-version-props.js';
|
|
7
|
-
import { NamedVersionStringStrategy } from '../strategy/named-version-string.js';
|
|
8
|
-
import { UnnamedVersionStringStrategy } from '../strategy/unnamed-version-string.js';
|
|
9
|
-
import { VersionsByNameStrategy } from '../strategy/versions-by-name.js';
|
|
10
|
-
export class InvalidCustomTypeError extends Data.TaggedClass('InvalidCustomTypeError') {
|
|
11
|
-
}
|
|
12
|
-
export function getCustomTypes({ rcFile, }) {
|
|
13
|
-
if (!isNonEmptyObject(rcFile.customTypes)) {
|
|
14
|
-
return Effect.succeed([]);
|
|
15
|
-
}
|
|
16
|
-
return Effect.all([
|
|
17
|
-
...Object.entries(rcFile.customTypes),
|
|
18
|
-
...Object.entries(DEFAULT_CONFIG.customTypes),
|
|
19
|
-
].map(([name, config]) => {
|
|
20
|
-
const errObj = 'Invalid customType';
|
|
21
|
-
const errPath = 'Invalid customType.path';
|
|
22
|
-
const errNamePath = 'Invalid customType.namePath';
|
|
23
|
-
const errStrategy = 'Invalid customType.strategy';
|
|
24
|
-
if (!isObject(config)) {
|
|
25
|
-
return createError(config, errObj);
|
|
26
|
-
}
|
|
27
|
-
if (!isNonEmptyString(config.path)) {
|
|
28
|
-
return createError(config, errPath);
|
|
29
|
-
}
|
|
30
|
-
const path = config.path;
|
|
31
|
-
const strategy = config.strategy;
|
|
32
|
-
switch (strategy) {
|
|
33
|
-
case 'name~version': {
|
|
34
|
-
const namePath = config.namePath;
|
|
35
|
-
if (!isNonEmptyString(namePath)) {
|
|
36
|
-
return createError(config, errNamePath);
|
|
37
|
-
}
|
|
38
|
-
return Effect.succeed(new NameAndVersionPropsStrategy(name, path, namePath));
|
|
39
|
-
}
|
|
40
|
-
case 'name@version': {
|
|
41
|
-
return Effect.succeed(new NamedVersionStringStrategy(name, path));
|
|
42
|
-
}
|
|
43
|
-
case 'version': {
|
|
44
|
-
return Effect.succeed(new UnnamedVersionStringStrategy(name, path));
|
|
45
|
-
}
|
|
46
|
-
case 'versionsByName': {
|
|
47
|
-
return Effect.succeed(new VersionsByNameStrategy(name, path));
|
|
48
|
-
}
|
|
49
|
-
default: {
|
|
50
|
-
return createError(config, errStrategy);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
}));
|
|
54
|
-
}
|
|
55
|
-
function createError(config, reason) {
|
|
56
|
-
return Effect.fail(new InvalidCustomTypeError({ config, reason }));
|
|
57
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Effect } from 'effect';
|
|
2
|
-
import type { Ctx } from '../get-context/index.js';
|
|
3
|
-
import type { InvalidCustomTypeError, Strategy } from './get-custom-types.js';
|
|
4
|
-
declare const DeprecatedTypesError_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> & {
|
|
5
|
-
readonly _tag: "DeprecatedTypesError";
|
|
6
|
-
};
|
|
7
|
-
export declare class DeprecatedTypesError extends DeprecatedTypesError_base<{
|
|
8
|
-
readonly types: string[];
|
|
9
|
-
}> {
|
|
10
|
-
}
|
|
11
|
-
declare const RenamedWorkspaceTypeError_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> & {
|
|
12
|
-
readonly _tag: "RenamedWorkspaceTypeError";
|
|
13
|
-
};
|
|
14
|
-
export declare class RenamedWorkspaceTypeError extends RenamedWorkspaceTypeError_base<Record<string, never>> {
|
|
15
|
-
}
|
|
16
|
-
export declare function getEnabledTypes({ cli, rcFile, }: Ctx['config']): Effect.Effect<Strategy.Any[], DeprecatedTypesError | InvalidCustomTypeError | RenamedWorkspaceTypeError>;
|
|
17
|
-
export {};
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
import { Data, Effect, pipe } from 'effect';
|
|
2
|
-
import { isArrayOfStrings } from 'tightrope/guard/is-array-of-strings.js';
|
|
3
|
-
import { isBoolean } from 'tightrope/guard/is-boolean.js';
|
|
4
|
-
import { isEmptyArray } from 'tightrope/guard/is-empty-array.js';
|
|
5
|
-
import { isNonEmptyArray } from 'tightrope/guard/is-non-empty-array.js';
|
|
6
|
-
import { isNonEmptyString } from 'tightrope/guard/is-non-empty-string.js';
|
|
7
|
-
import { INTERNAL_TYPES } from '../constants.js';
|
|
8
|
-
import { NameAndVersionPropsStrategy } from '../strategy/name-and-version-props.js';
|
|
9
|
-
import { VersionsByNameStrategy } from '../strategy/versions-by-name.js';
|
|
10
|
-
import { getCustomTypes } from './get-custom-types.js';
|
|
11
|
-
export class DeprecatedTypesError extends Data.TaggedClass('DeprecatedTypesError') {
|
|
12
|
-
}
|
|
13
|
-
export class RenamedWorkspaceTypeError extends Data.TaggedClass('RenamedWorkspaceTypeError') {
|
|
14
|
-
}
|
|
15
|
-
export function getEnabledTypes({ cli, rcFile, }) {
|
|
16
|
-
return pipe(
|
|
17
|
-
// Look for dependency types defined using the old `{ prod: true }` syntax
|
|
18
|
-
// deprecated in syncpack@9.0.0
|
|
19
|
-
Effect.succeed(INTERNAL_TYPES.filter(key => isBoolean(rcFile[key]))),
|
|
20
|
-
// Short-circuit and quit if deprecated config is used
|
|
21
|
-
Effect.flatMap(deprecatedTypeProps => deprecatedTypeProps.length > 0
|
|
22
|
-
? Effect.fail(new DeprecatedTypesError({ types: deprecatedTypeProps }))
|
|
23
|
-
: Effect.void), Effect.flatMap(() => pipe(Effect.Do,
|
|
24
|
-
// Get index of every available strategy, keyed by their names as
|
|
25
|
-
// they're referred to in config
|
|
26
|
-
Effect.bind('allStrategiesByName', () => pipe(
|
|
27
|
-
// Get custom types if any are defined, short-circuit and quit if
|
|
28
|
-
// any are invalid
|
|
29
|
-
getCustomTypes({ cli, rcFile }),
|
|
30
|
-
// Combine them with the default/internal dependency types
|
|
31
|
-
Effect.map((customTypes) => Object.fromEntries([
|
|
32
|
-
['dev', new VersionsByNameStrategy('dev', 'devDependencies')],
|
|
33
|
-
[
|
|
34
|
-
'local',
|
|
35
|
-
new NameAndVersionPropsStrategy('local', 'version', 'name'),
|
|
36
|
-
],
|
|
37
|
-
[
|
|
38
|
-
'overrides',
|
|
39
|
-
new VersionsByNameStrategy('overrides', 'overrides'),
|
|
40
|
-
],
|
|
41
|
-
[
|
|
42
|
-
'peer',
|
|
43
|
-
new VersionsByNameStrategy('peer', 'peerDependencies'),
|
|
44
|
-
],
|
|
45
|
-
[
|
|
46
|
-
'pnpmOverrides',
|
|
47
|
-
new VersionsByNameStrategy('pnpmOverrides', 'pnpm.overrides'),
|
|
48
|
-
],
|
|
49
|
-
['prod', new VersionsByNameStrategy('prod', 'dependencies')],
|
|
50
|
-
[
|
|
51
|
-
'resolutions',
|
|
52
|
-
new VersionsByNameStrategy('resolutions', 'resolutions'),
|
|
53
|
-
],
|
|
54
|
-
...customTypes.map(type => [type.name, type]),
|
|
55
|
-
])))),
|
|
56
|
-
// The names of every available strategy
|
|
57
|
-
Effect.bind('allStrategyNames', ({ allStrategiesByName }) => Effect.succeed(Object.keys(allStrategiesByName))),
|
|
58
|
-
// Create groupings to assign each provided dependencyType to
|
|
59
|
-
Effect.bind('strategyNamesByStatus', () => Effect.succeed({
|
|
60
|
-
provided: (isNonEmptyString(cli.types)
|
|
61
|
-
? cli.types.split(',')
|
|
62
|
-
: isArrayOfStrings(rcFile.dependencyTypes)
|
|
63
|
-
? rcFile.dependencyTypes
|
|
64
|
-
: []).filter(isNonEmptyString),
|
|
65
|
-
enabled: [],
|
|
66
|
-
positive: [],
|
|
67
|
-
negative: [],
|
|
68
|
-
})))), Effect.tap(({ strategyNamesByStatus }) => Effect.logDebug(`dependency types provided by user: ${JSON.stringify(strategyNamesByStatus.provided)}`)),
|
|
69
|
-
// Determine which dependencyTypes should be enabled based on:
|
|
70
|
-
// * which are defined
|
|
71
|
-
// * which were listed to be enabled
|
|
72
|
-
// * which were listed but !negated
|
|
73
|
-
// * etc.
|
|
74
|
-
Effect.flatMap(({ allStrategiesByName, allStrategyNames, strategyNamesByStatus }) => {
|
|
75
|
-
if (isEmptyArray(strategyNamesByStatus.provided) ||
|
|
76
|
-
strategyNamesByStatus.provided.join('') === '**') {
|
|
77
|
-
return Effect.succeed(allStrategyNames.map(getStrategyByName));
|
|
78
|
-
}
|
|
79
|
-
strategyNamesByStatus.provided.forEach(name => {
|
|
80
|
-
if (name.startsWith('!')) {
|
|
81
|
-
strategyNamesByStatus.negative.push(name.replace('!', ''));
|
|
82
|
-
}
|
|
83
|
-
else {
|
|
84
|
-
strategyNamesByStatus.positive.push(name);
|
|
85
|
-
}
|
|
86
|
-
});
|
|
87
|
-
if (isNonEmptyArray(strategyNamesByStatus.negative)) {
|
|
88
|
-
allStrategyNames.forEach(name => {
|
|
89
|
-
if (!strategyNamesByStatus.negative.includes(name)) {
|
|
90
|
-
strategyNamesByStatus.enabled.push(name);
|
|
91
|
-
}
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
if (isNonEmptyArray(strategyNamesByStatus.positive)) {
|
|
95
|
-
strategyNamesByStatus.positive.forEach(name => {
|
|
96
|
-
if (!strategyNamesByStatus.enabled.includes(name)) {
|
|
97
|
-
strategyNamesByStatus.enabled.push(name);
|
|
98
|
-
}
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
if (strategyNamesByStatus.enabled.includes('workspace')) {
|
|
102
|
-
return Effect.fail(new RenamedWorkspaceTypeError({}));
|
|
103
|
-
}
|
|
104
|
-
return Effect.succeed(strategyNamesByStatus.enabled.map(getStrategyByName));
|
|
105
|
-
function getStrategyByName(type) {
|
|
106
|
-
return allStrategiesByName[type];
|
|
107
|
-
}
|
|
108
|
-
}), Effect.tap(enabledTypes => Effect.logDebug(`enabled dependency types determined to be: ${JSON.stringify(enabledTypes)}`)));
|
|
109
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { isNonEmptyString } from 'tightrope/guard/is-non-empty-string.js';
|
|
2
|
-
import { DEFAULT_CONFIG } from '../constants.js';
|
|
3
|
-
export function getFilter({ cli, rcFile }) {
|
|
4
|
-
// @TODO Deprecate `filter` in .syncpackrc
|
|
5
|
-
return isNonEmptyString(cli.filter)
|
|
6
|
-
? cli.filter
|
|
7
|
-
: isNonEmptyString(rcFile.filter)
|
|
8
|
-
? rcFile.filter
|
|
9
|
-
: DEFAULT_CONFIG.filter;
|
|
10
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { isNonEmptyString } from 'tightrope/guard/is-non-empty-string.js';
|
|
2
|
-
import { DEFAULT_CONFIG } from '../constants.js';
|
|
3
|
-
export function getIndent({ cli, rcFile }) {
|
|
4
|
-
return isNonEmptyString(cli.indent)
|
|
5
|
-
? cli.indent.replaceAll('\\t', '\t')
|
|
6
|
-
: isNonEmptyString(rcFile.indent)
|
|
7
|
-
? rcFile.indent
|
|
8
|
-
: DEFAULT_CONFIG.indent;
|
|
9
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { isArrayOfStrings } from 'tightrope/guard/is-array-of-strings.js';
|
|
2
|
-
import { isEmptyArray } from 'tightrope/guard/is-empty-array.js';
|
|
3
|
-
import { DEFAULT_CONFIG } from '../constants.js';
|
|
4
|
-
export function getSortAz({ rcFile }) {
|
|
5
|
-
return isArrayOfStrings(rcFile.sortAz) || isEmptyArray(rcFile.sortAz)
|
|
6
|
-
? rcFile.sortAz
|
|
7
|
-
: DEFAULT_CONFIG.sortAz;
|
|
8
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { isArrayOfStrings } from 'tightrope/guard/is-array-of-strings.js';
|
|
2
|
-
import { isEmptyArray } from 'tightrope/guard/is-empty-array.js';
|
|
3
|
-
import { DEFAULT_CONFIG } from '../constants.js';
|
|
4
|
-
export function getSortExports({ rcFile }) {
|
|
5
|
-
return isArrayOfStrings(rcFile.sortExports) ||
|
|
6
|
-
isEmptyArray(rcFile.sortExports)
|
|
7
|
-
? rcFile.sortExports
|
|
8
|
-
: DEFAULT_CONFIG.sortExports;
|
|
9
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { isArrayOfStrings } from 'tightrope/guard/is-array-of-strings.js';
|
|
2
|
-
import { isEmptyArray } from 'tightrope/guard/is-empty-array.js';
|
|
3
|
-
import { DEFAULT_CONFIG } from '../constants.js';
|
|
4
|
-
export function getSortFirst({ rcFile }) {
|
|
5
|
-
return isArrayOfStrings(rcFile.sortFirst) || isEmptyArray(rcFile.sortFirst)
|
|
6
|
-
? rcFile.sortFirst
|
|
7
|
-
: DEFAULT_CONFIG.sortFirst;
|
|
8
|
-
}
|
package/dist/config/tag.d.ts
DELETED
package/dist/config/tag.js
DELETED
package/dist/config/types.d.ts
DELETED
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
import type { CUSTOM_TYPES } from '../constants.js';
|
|
2
|
-
import type { Specifier } from '../specifier/index.js';
|
|
3
|
-
/**
|
|
4
|
-
* Aliases for semver range formats supported by syncpack
|
|
5
|
-
*
|
|
6
|
-
* Defaults to `""` to ensure that exact dependency versions are used instead of
|
|
7
|
-
* loose ranges, but this can be overridden in your config file.
|
|
8
|
-
*
|
|
9
|
-
* | Supported Range | Example |
|
|
10
|
-
* | --------------- | --------: |
|
|
11
|
-
* | `"<"` | `<1.4.2` |
|
|
12
|
-
* | `"<="` | `<=1.4.2` |
|
|
13
|
-
* | `""` | `1.4.2` |
|
|
14
|
-
* | `"~"` | `~1.4.2` |
|
|
15
|
-
* | `"^"` | `^1.4.2` |
|
|
16
|
-
* | `">="` | `>=1.4.2` |
|
|
17
|
-
* | `">"` | `>1.4.2` |
|
|
18
|
-
* | `"*"` | `*` |
|
|
19
|
-
*
|
|
20
|
-
* @default ""
|
|
21
|
-
*/
|
|
22
|
-
export type SemverRange = '' | '*' | '>' | '>=' | '.x' | '<' | '<=' | '^' | '~' | 'workspace:';
|
|
23
|
-
type DefaultDependencyType = keyof typeof CUSTOM_TYPES;
|
|
24
|
-
export type DependencyType = DefaultDependencyType | `!${DefaultDependencyType}` | (string & {});
|
|
25
|
-
export type SpecifierType = Specifier.Any['name'] | `!${Specifier.Any['name']}` | (string & {});
|
|
26
|
-
export interface GroupConfig {
|
|
27
|
-
dependencies?: string[];
|
|
28
|
-
dependencyTypes?: DependencyType[];
|
|
29
|
-
label?: string;
|
|
30
|
-
packages?: string[];
|
|
31
|
-
specifierTypes?: SpecifierType[];
|
|
32
|
-
}
|
|
33
|
-
export declare namespace SemverGroupConfig {
|
|
34
|
-
interface Disabled extends GroupConfig {
|
|
35
|
-
isDisabled: true;
|
|
36
|
-
}
|
|
37
|
-
interface Ignored extends GroupConfig {
|
|
38
|
-
isIgnored: true;
|
|
39
|
-
}
|
|
40
|
-
interface WithRange extends GroupConfig {
|
|
41
|
-
range: SemverRange;
|
|
42
|
-
}
|
|
43
|
-
type Any = Disabled | Ignored | WithRange;
|
|
44
|
-
}
|
|
45
|
-
export declare namespace VersionGroupConfig {
|
|
46
|
-
interface Banned extends GroupConfig {
|
|
47
|
-
isBanned: true;
|
|
48
|
-
}
|
|
49
|
-
interface Ignored extends GroupConfig {
|
|
50
|
-
isIgnored: true;
|
|
51
|
-
}
|
|
52
|
-
interface Pinned extends GroupConfig {
|
|
53
|
-
pinVersion: string;
|
|
54
|
-
}
|
|
55
|
-
interface SnappedTo extends GroupConfig {
|
|
56
|
-
snapTo: string[];
|
|
57
|
-
}
|
|
58
|
-
interface SameRange extends GroupConfig {
|
|
59
|
-
policy: 'sameRange';
|
|
60
|
-
}
|
|
61
|
-
interface Standard extends GroupConfig {
|
|
62
|
-
preferVersion?: 'highestSemver' | 'lowestSemver';
|
|
63
|
-
}
|
|
64
|
-
type Any = Banned | Ignored | Pinned | SameRange | SnappedTo | Standard;
|
|
65
|
-
}
|
|
66
|
-
declare namespace CustomTypeConfig {
|
|
67
|
-
interface NameAndVersionProps {
|
|
68
|
-
namePath: string;
|
|
69
|
-
path: string;
|
|
70
|
-
strategy: 'name~version';
|
|
71
|
-
}
|
|
72
|
-
interface NamedVersionString {
|
|
73
|
-
path: string;
|
|
74
|
-
strategy: 'name@version';
|
|
75
|
-
}
|
|
76
|
-
interface UnnamedVersionString {
|
|
77
|
-
path: string;
|
|
78
|
-
strategy: 'version';
|
|
79
|
-
}
|
|
80
|
-
interface VersionsByName {
|
|
81
|
-
path: string;
|
|
82
|
-
strategy: 'versionsByName';
|
|
83
|
-
}
|
|
84
|
-
type Any = NameAndVersionProps | NamedVersionString | UnnamedVersionString | VersionsByName;
|
|
85
|
-
}
|
|
86
|
-
export interface CliConfig {
|
|
87
|
-
readonly configPath?: string;
|
|
88
|
-
readonly filter: string;
|
|
89
|
-
readonly indent: string;
|
|
90
|
-
readonly source: string[];
|
|
91
|
-
readonly specs: string;
|
|
92
|
-
readonly types: string;
|
|
93
|
-
}
|
|
94
|
-
export interface RcConfig {
|
|
95
|
-
/** @see https://jamiemason.github.io/syncpack/integrations/json-schema */
|
|
96
|
-
$schema?: string;
|
|
97
|
-
/** @see https://jamiemason.github.io/syncpack/config/custom-types */
|
|
98
|
-
customTypes: {
|
|
99
|
-
[name: string]: CustomTypeConfig.Any;
|
|
100
|
-
};
|
|
101
|
-
/** @see https://jamiemason.github.io/syncpack/config/dependency-types */
|
|
102
|
-
dependencyTypes: DependencyType[];
|
|
103
|
-
/** @see https://jamiemason.github.io/syncpack/config/filter */
|
|
104
|
-
filter: string;
|
|
105
|
-
/** @see https://jamiemason.github.io/syncpack/config/format-bugs */
|
|
106
|
-
formatBugs: boolean;
|
|
107
|
-
/** @see https://jamiemason.github.io/syncpack/config/format-repository */
|
|
108
|
-
formatRepository: boolean;
|
|
109
|
-
/** @see https://jamiemason.github.io/syncpack/config/indent */
|
|
110
|
-
indent: string;
|
|
111
|
-
/** @see https://jamiemason.github.io/syncpack/config/lint-formatting */
|
|
112
|
-
lintFormatting: boolean;
|
|
113
|
-
/** @see https://jamiemason.github.io/syncpack/config/lint-semver-ranges */
|
|
114
|
-
lintSemverRanges: boolean;
|
|
115
|
-
/** @see https://jamiemason.github.io/syncpack/config/lint-versions */
|
|
116
|
-
lintVersions: boolean;
|
|
117
|
-
/** @see https://jamiemason.github.io/syncpack/config/semver-groups */
|
|
118
|
-
semverGroups: SemverGroupConfig.Any[];
|
|
119
|
-
/** @see https://jamiemason.github.io/syncpack/config/sort-az */
|
|
120
|
-
sortAz: string[];
|
|
121
|
-
/** @see https://jamiemason.github.io/syncpack/config/sort-exports */
|
|
122
|
-
sortExports: string[];
|
|
123
|
-
/** @see https://jamiemason.github.io/syncpack/config/sort-first */
|
|
124
|
-
sortFirst: string[];
|
|
125
|
-
/** @see https://jamiemason.github.io/syncpack/config/sort-packages */
|
|
126
|
-
sortPackages: boolean;
|
|
127
|
-
/** @see https://jamiemason.github.io/syncpack/config/source */
|
|
128
|
-
source: string[];
|
|
129
|
-
/** @see https://jamiemason.github.io/syncpack/config/specifier-types */
|
|
130
|
-
specifierTypes: SpecifierType[];
|
|
131
|
-
/** @see https://jamiemason.github.io/syncpack/config/version-groups */
|
|
132
|
-
versionGroups: VersionGroupConfig.Any[];
|
|
133
|
-
}
|
|
134
|
-
export {};
|
package/dist/config/types.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/constants.d.ts
DELETED
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
/** Single source of truth, intended to aid testing or to override */
|
|
2
|
-
export declare const CWD: string;
|
|
3
|
-
/** Single source of truth for icons used in output */
|
|
4
|
-
export declare const ICON: {
|
|
5
|
-
readonly banned: "⦸";
|
|
6
|
-
readonly cross: "✘";
|
|
7
|
-
readonly debug: "?";
|
|
8
|
-
readonly info: "i";
|
|
9
|
-
readonly panic: "!";
|
|
10
|
-
readonly rightArrow: "→";
|
|
11
|
-
readonly skip: "-";
|
|
12
|
-
readonly tick: "✓";
|
|
13
|
-
};
|
|
14
|
-
export declare const RANGE: {
|
|
15
|
-
readonly ANY: "*";
|
|
16
|
-
readonly EXACT: "";
|
|
17
|
-
readonly GT: ">";
|
|
18
|
-
readonly GTE: ">=";
|
|
19
|
-
readonly LOOSE: ".x";
|
|
20
|
-
readonly LT: "<";
|
|
21
|
-
readonly LTE: "<=";
|
|
22
|
-
readonly MINOR: "^";
|
|
23
|
-
readonly PATCH: "~";
|
|
24
|
-
readonly WORKSPACE: "workspace:";
|
|
25
|
-
};
|
|
26
|
-
export declare const INTERNAL_TYPES: readonly ["dev", "local", "overrides", "peer", "pnpmOverrides", "prod", "resolutions"];
|
|
27
|
-
export declare const CUSTOM_TYPES: {
|
|
28
|
-
readonly dev: {
|
|
29
|
-
readonly strategy: "versionsByName";
|
|
30
|
-
readonly path: "devDependencies";
|
|
31
|
-
};
|
|
32
|
-
readonly local: {
|
|
33
|
-
readonly strategy: "name~version";
|
|
34
|
-
readonly namePath: "name";
|
|
35
|
-
readonly path: "version";
|
|
36
|
-
};
|
|
37
|
-
readonly overrides: {
|
|
38
|
-
readonly strategy: "versionsByName";
|
|
39
|
-
readonly path: "overrides";
|
|
40
|
-
};
|
|
41
|
-
readonly peer: {
|
|
42
|
-
readonly strategy: "versionsByName";
|
|
43
|
-
readonly path: "peerDependencies";
|
|
44
|
-
};
|
|
45
|
-
readonly pnpmOverrides: {
|
|
46
|
-
readonly strategy: "versionsByName";
|
|
47
|
-
readonly path: "pnpm.overrides";
|
|
48
|
-
};
|
|
49
|
-
readonly prod: {
|
|
50
|
-
readonly strategy: "versionsByName";
|
|
51
|
-
readonly path: "dependencies";
|
|
52
|
-
};
|
|
53
|
-
readonly resolutions: {
|
|
54
|
-
readonly strategy: "versionsByName";
|
|
55
|
-
readonly path: "resolutions";
|
|
56
|
-
};
|
|
57
|
-
};
|
|
58
|
-
export declare const DEFAULT_CONFIG: {
|
|
59
|
-
customTypes: {
|
|
60
|
-
readonly dev: {
|
|
61
|
-
readonly strategy: "versionsByName";
|
|
62
|
-
readonly path: "devDependencies";
|
|
63
|
-
};
|
|
64
|
-
readonly local: {
|
|
65
|
-
readonly strategy: "name~version";
|
|
66
|
-
readonly namePath: "name";
|
|
67
|
-
readonly path: "version";
|
|
68
|
-
};
|
|
69
|
-
readonly overrides: {
|
|
70
|
-
readonly strategy: "versionsByName";
|
|
71
|
-
readonly path: "overrides";
|
|
72
|
-
};
|
|
73
|
-
readonly peer: {
|
|
74
|
-
readonly strategy: "versionsByName";
|
|
75
|
-
readonly path: "peerDependencies";
|
|
76
|
-
};
|
|
77
|
-
readonly pnpmOverrides: {
|
|
78
|
-
readonly strategy: "versionsByName";
|
|
79
|
-
readonly path: "pnpm.overrides";
|
|
80
|
-
};
|
|
81
|
-
readonly prod: {
|
|
82
|
-
readonly strategy: "versionsByName";
|
|
83
|
-
readonly path: "dependencies";
|
|
84
|
-
};
|
|
85
|
-
readonly resolutions: {
|
|
86
|
-
readonly strategy: "versionsByName";
|
|
87
|
-
readonly path: "resolutions";
|
|
88
|
-
};
|
|
89
|
-
};
|
|
90
|
-
dependencyTypes: "**"[];
|
|
91
|
-
filter: string;
|
|
92
|
-
formatBugs: true;
|
|
93
|
-
formatRepository: true;
|
|
94
|
-
indent: string;
|
|
95
|
-
lintFormatting: true;
|
|
96
|
-
lintSemverRanges: true;
|
|
97
|
-
lintVersions: true;
|
|
98
|
-
semverGroups: never[];
|
|
99
|
-
sortAz: string[];
|
|
100
|
-
sortExports: string[];
|
|
101
|
-
sortFirst: string[];
|
|
102
|
-
sortPackages: true;
|
|
103
|
-
source: string[];
|
|
104
|
-
specifierTypes: "**"[];
|
|
105
|
-
versionGroups: never[];
|
|
106
|
-
};
|