syncpack 12.3.0 → 12.3.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.d.ts +9 -9
- package/dist/bin-fix-mismatches/fix-mismatches.js +43 -54
- package/dist/bin-fix-mismatches/index.js +26 -31
- package/dist/bin-format/format.d.ts +6 -6
- package/dist/bin-format/format.js +27 -32
- package/dist/bin-format/index.js +20 -25
- package/dist/bin-lint/index.js +15 -20
- package/dist/bin-lint/lint.d.ts +4 -4
- package/dist/bin-lint/lint.js +28 -35
- package/dist/bin-lint-semver-ranges/index.js +24 -29
- package/dist/bin-lint-semver-ranges/lint-semver-ranges.d.ts +8 -8
- package/dist/bin-lint-semver-ranges/lint-semver-ranges.js +34 -44
- package/dist/bin-list/index.js +24 -29
- package/dist/bin-list/list.d.ts +7 -7
- package/dist/bin-list/list.js +55 -64
- package/dist/bin-list-mismatches/index.js +24 -29
- package/dist/bin-list-mismatches/list-mismatches.d.ts +10 -10
- package/dist/bin-list-mismatches/list-mismatches.js +62 -70
- package/dist/bin-prompt/index.js +26 -31
- package/dist/bin-prompt/prompt.d.ts +4 -4
- package/dist/bin-prompt/prompt.js +41 -48
- package/dist/bin-set-semver-ranges/index.js +26 -31
- package/dist/bin-set-semver-ranges/set-semver-ranges.d.ts +4 -4
- package/dist/bin-set-semver-ranges/set-semver-ranges.js +26 -30
- package/dist/bin-update/effects.d.ts +18 -18
- package/dist/bin-update/effects.js +77 -106
- package/dist/bin-update/index.js +23 -28
- package/dist/bin-update/update.d.ts +5 -5
- package/dist/bin-update/update.js +37 -45
- package/dist/bin.js +8 -5
- package/dist/config/get-custom-types.d.ts +9 -9
- package/dist/config/get-custom-types.js +22 -27
- package/dist/config/get-enabled-types.d.ts +8 -8
- package/dist/config/get-enabled-types.js +42 -48
- package/dist/config/get-filter.d.ts +1 -1
- package/dist/config/get-filter.js +6 -10
- package/dist/config/get-indent.d.ts +1 -1
- package/dist/config/get-indent.js +6 -10
- package/dist/config/get-sort-az.d.ts +1 -1
- package/dist/config/get-sort-az.js +6 -10
- package/dist/config/get-sort-exports.d.ts +1 -1
- package/dist/config/get-sort-exports.js +6 -10
- package/dist/config/get-sort-first.d.ts +1 -1
- package/dist/config/get-sort-first.js +6 -10
- package/dist/config/get-source.d.ts +1 -1
- package/dist/config/get-source.js +4 -8
- package/dist/config/tag.d.ts +1 -1
- package/dist/config/tag.js +2 -5
- package/dist/config/types.d.ts +2 -5
- package/dist/config/types.js +1 -2
- package/dist/constants.js +7 -10
- package/dist/error-handlers/default-error-handlers.d.ts +10 -10
- package/dist/error-handlers/default-error-handlers.js +55 -61
- package/dist/get-context/index.d.ts +5 -5
- package/dist/get-context/index.js +13 -17
- package/dist/get-context/lib/key-by.js +1 -5
- package/dist/get-instances/index.d.ts +7 -7
- package/dist/get-instances/index.js +19 -23
- package/dist/get-instances/instance.d.ts +7 -7
- package/dist/get-instances/instance.js +4 -8
- package/dist/get-package-json-files/get-file-paths.d.ts +7 -7
- package/dist/get-package-json-files/get-file-paths.js +10 -15
- package/dist/get-package-json-files/get-patterns/get-lerna-patterns.d.ts +2 -2
- package/dist/get-package-json-files/get-patterns/get-lerna-patterns.js +8 -12
- package/dist/get-package-json-files/get-patterns/get-pnpm-patterns.d.ts +2 -2
- package/dist/get-package-json-files/get-patterns/get-pnpm-patterns.js +8 -12
- package/dist/get-package-json-files/get-patterns/get-yarn-patterns.d.ts +2 -2
- package/dist/get-package-json-files/get-patterns/get-yarn-patterns.js +14 -18
- package/dist/get-package-json-files/get-patterns/index.d.ts +3 -3
- package/dist/get-package-json-files/get-patterns/index.js +11 -15
- package/dist/get-package-json-files/index.d.ts +8 -8
- package/dist/get-package-json-files/index.js +6 -10
- package/dist/get-package-json-files/package-json-file.d.ts +6 -6
- package/dist/get-package-json-files/package-json-file.js +8 -12
- package/dist/guards/can-add-to-group.d.ts +4 -4
- package/dist/guards/can-add-to-group.js +10 -14
- package/dist/guards/is-semver.js +3 -7
- package/dist/guards/is-valid-semver-range.d.ts +1 -1
- package/dist/guards/is-valid-semver-range.js +12 -16
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -2
- package/dist/io/ask-for-choice.d.ts +5 -5
- package/dist/io/ask-for-choice.js +5 -9
- package/dist/io/ask-for-input.d.ts +5 -5
- package/dist/io/ask-for-input.js +5 -9
- package/dist/io/exit-if-invalid.d.ts +3 -3
- package/dist/io/exit-if-invalid.js +5 -9
- package/dist/io/glob-sync.d.ts +5 -5
- package/dist/io/glob-sync.js +4 -9
- package/dist/io/index.d.ts +8 -8
- package/dist/io/index.js +12 -38
- package/dist/io/read-config-file.d.ts +7 -0
- package/dist/io/read-config-file.js +22 -0
- package/dist/io/read-file-sync.d.ts +5 -5
- package/dist/io/read-file-sync.js +4 -9
- package/dist/io/read-json-file-sync.d.ts +8 -8
- package/dist/io/read-json-file-sync.js +10 -16
- package/dist/io/read-yaml-file-sync.d.ts +5 -5
- package/dist/io/read-yaml-file-sync.js +4 -8
- package/dist/io/to-json.d.ts +2 -2
- package/dist/io/to-json.js +8 -12
- package/dist/io/write-file-sync.d.ts +5 -5
- package/dist/io/write-file-sync.js +5 -10
- package/dist/io/write-if-changed.d.ts +4 -4
- package/dist/io/write-if-changed.js +9 -16
- package/dist/lib/format-repository-url.js +1 -5
- package/dist/lib/get-group-header.d.ts +2 -2
- package/dist/lib/get-group-header.js +4 -12
- package/dist/lib/get.d.ts +10 -10
- package/dist/lib/get.js +15 -19
- package/dist/lib/pad-start.js +1 -5
- package/dist/lib/ring-buffer.js +1 -5
- package/dist/lib/set-semver-range.d.ts +1 -1
- package/dist/lib/set-semver-range.js +8 -12
- package/dist/lib/show-help-on-error.js +3 -10
- package/dist/lib/sort-by-name.js +1 -5
- package/dist/lib/with-logger.d.ts +1 -1
- package/dist/lib/with-logger.js +17 -24
- package/dist/option.d.ts +1 -1
- package/dist/option.js +8 -14
- package/dist/report.d.ts +2 -2
- package/dist/report.js +2 -5
- package/dist/semver-group/create-semver-groups.d.ts +3 -3
- package/dist/semver-group/create-semver-groups.js +28 -32
- package/dist/semver-group/disabled.d.ts +11 -11
- package/dist/semver-group/disabled.js +6 -10
- package/dist/semver-group/filtered-out.d.ts +12 -12
- package/dist/semver-group/filtered-out.js +8 -12
- package/dist/semver-group/ignored.d.ts +11 -11
- package/dist/semver-group/ignored.js +6 -10
- package/dist/semver-group/index.d.ts +6 -7
- package/dist/semver-group/index.js +4 -7
- package/dist/semver-group/with-range.d.ts +11 -11
- package/dist/semver-group/with-range.js +13 -17
- package/dist/specifier/alias.d.ts +5 -5
- package/dist/specifier/alias.js +9 -13
- package/dist/specifier/base.d.ts +7 -7
- package/dist/specifier/base.js +9 -13
- package/dist/specifier/delete.d.ts +5 -5
- package/dist/specifier/delete.js +5 -9
- package/dist/specifier/exact.d.ts +6 -6
- package/dist/specifier/exact.js +7 -11
- package/dist/specifier/file.d.ts +1 -1
- package/dist/specifier/file.js +2 -6
- package/dist/specifier/hosted-git.d.ts +5 -5
- package/dist/specifier/hosted-git.js +9 -13
- package/dist/specifier/index.d.ts +13 -13
- package/dist/specifier/index.js +28 -31
- package/dist/specifier/latest.d.ts +6 -6
- package/dist/specifier/latest.js +7 -11
- package/dist/specifier/lib/non-semver-error.d.ts +5 -5
- package/dist/specifier/lib/non-semver-error.js +3 -7
- package/dist/specifier/lib/parse-specifier.d.ts +1 -1
- package/dist/specifier/lib/parse-specifier.js +4 -11
- package/dist/specifier/lib/specific-registry-result.js +1 -2
- package/dist/specifier/range.d.ts +6 -6
- package/dist/specifier/range.js +7 -11
- package/dist/specifier/tag.d.ts +2 -2
- package/dist/specifier/tag.js +2 -6
- package/dist/specifier/unsupported.d.ts +1 -1
- package/dist/specifier/unsupported.js +2 -6
- package/dist/specifier/url.d.ts +1 -1
- package/dist/specifier/url.js +2 -6
- package/dist/specifier/workspace-protocol.d.ts +7 -7
- package/dist/specifier/workspace-protocol.js +9 -13
- package/dist/strategy/lib/get-non-empty-string-prop.d.ts +2 -2
- package/dist/strategy/lib/get-non-empty-string-prop.js +6 -10
- package/dist/strategy/name-and-version-props.d.ts +4 -4
- package/dist/strategy/name-and-version-props.js +19 -23
- package/dist/strategy/named-version-string.d.ts +4 -4
- package/dist/strategy/named-version-string.js +20 -24
- package/dist/strategy/unnamed-version-string.d.ts +4 -4
- package/dist/strategy/unnamed-version-string.js +17 -21
- package/dist/strategy/versions-by-name.d.ts +4 -4
- package/dist/strategy/versions-by-name.js +11 -15
- package/dist/version-group/banned.d.ts +7 -7
- package/dist/version-group/banned.js +8 -12
- package/dist/version-group/create-version-groups.d.ts +3 -3
- package/dist/version-group/create-version-groups.js +34 -38
- package/dist/version-group/filtered-out.d.ts +8 -8
- package/dist/version-group/filtered-out.js +8 -12
- package/dist/version-group/ignored.d.ts +7 -7
- package/dist/version-group/ignored.js +6 -10
- package/dist/version-group/index.d.ts +9 -10
- package/dist/version-group/index.js +4 -7
- package/dist/version-group/lib/clean.js +4 -11
- package/dist/version-group/lib/delete.js +1 -4
- package/dist/version-group/lib/get-highest-version.d.ts +2 -2
- package/dist/version-group/lib/get-highest-version.js +3 -7
- package/dist/version-group/lib/get-lowest-version.d.ts +2 -2
- package/dist/version-group/lib/get-lowest-version.js +3 -7
- package/dist/version-group/lib/get-preferred-version.d.ts +4 -4
- package/dist/version-group/lib/get-preferred-version.js +17 -24
- package/dist/version-group/lib/get-range-score.js +13 -17
- package/dist/version-group/lib/group-by.js +1 -5
- package/dist/version-group/pinned.d.ts +7 -7
- package/dist/version-group/pinned.js +8 -12
- package/dist/version-group/same-range.d.ts +8 -8
- package/dist/version-group/same-range.js +23 -30
- package/dist/version-group/snapped-to.d.ts +7 -7
- package/dist/version-group/snapped-to.js +20 -24
- package/dist/version-group/standard.d.ts +7 -7
- package/dist/version-group/standard.js +29 -33
- package/package.json +30 -37
- package/dist/io/read-config-file-sync.d.ts +0 -7
- package/dist/io/read-config-file-sync.js +0 -26
package/dist/specifier/base.js
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const non_semver_error_1 = require("./lib/non-semver-error");
|
|
7
|
-
const parse_specifier_1 = require("./lib/parse-specifier");
|
|
8
|
-
class BaseSpecifier {
|
|
1
|
+
import { Effect, pipe } from 'effect';
|
|
2
|
+
import { Specifier } from './index.js';
|
|
3
|
+
import { NonSemverError } from './lib/non-semver-error.js';
|
|
4
|
+
import { parseSpecifier } from './lib/parse-specifier.js';
|
|
5
|
+
export class BaseSpecifier {
|
|
9
6
|
/** should be overridden by sub classes */
|
|
10
7
|
_tag = 'Base';
|
|
11
8
|
/** should be overridden by sub classes */
|
|
@@ -40,19 +37,18 @@ class BaseSpecifier {
|
|
|
40
37
|
const name = this.instance.name;
|
|
41
38
|
const raw = this.raw;
|
|
42
39
|
const packageJsonFile = this.instance.packageJsonFile;
|
|
43
|
-
return
|
|
40
|
+
return pipe(Effect.try(() => parseSpecifier(name, raw, packageJsonFile)), Effect.tapError(() => Effect.logError(`parseSpecifier threw on ${name}@${raw} at ${packageJsonFile.jsonFile.shortPath}`)));
|
|
44
41
|
}
|
|
45
42
|
/** Return the version portion if it is valid semver */
|
|
46
43
|
getSemver() {
|
|
47
|
-
return
|
|
44
|
+
return NonSemverError.asEffect(this);
|
|
48
45
|
}
|
|
49
46
|
/** Get a new `Specifier` from the given semver version applied to this one */
|
|
50
47
|
setSemver(_version) {
|
|
51
|
-
return
|
|
48
|
+
return NonSemverError.asEffect(this);
|
|
52
49
|
}
|
|
53
50
|
/** Apply the given specifier to a new one with this instance bound to it */
|
|
54
51
|
replaceWith(specifier) {
|
|
55
|
-
return
|
|
52
|
+
return Specifier.create(this.instance, specifier.raw);
|
|
56
53
|
}
|
|
57
54
|
}
|
|
58
|
-
exports.BaseSpecifier = BaseSpecifier;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Instance } from '../get-instances/instance';
|
|
2
|
-
import type { Delete } from '../version-group/lib/delete';
|
|
1
|
+
import type { Instance } from '../get-instances/instance.js';
|
|
2
|
+
import type { Delete } from '../version-group/lib/delete.js';
|
|
3
3
|
/** A instance which should be deleted */
|
|
4
4
|
export declare class DeleteSpecifier {
|
|
5
5
|
_tag: string;
|
|
@@ -11,7 +11,7 @@ export declare class DeleteSpecifier {
|
|
|
11
11
|
raw: Delete;
|
|
12
12
|
instance: Instance;
|
|
13
13
|
});
|
|
14
|
-
getSemver: (this: import(".").Specifier.Any) => import("effect/Effect").Effect<
|
|
15
|
-
setSemver: (this: import(".").Specifier.Any, _version: string) => import("effect/Effect").Effect<
|
|
16
|
-
replaceWith: <T extends import(".").Specifier.Any>(specifier: T) => T;
|
|
14
|
+
getSemver: (this: import("./index.js").Specifier.Any) => import("effect/Effect").Effect<string, import("./lib/non-semver-error.js").NonSemverError, never>;
|
|
15
|
+
setSemver: (this: import("./index.js").Specifier.Any, _version: string) => import("effect/Effect").Effect<import("./index.js").Specifier.Any, import("./lib/non-semver-error.js").NonSemverError, never>;
|
|
16
|
+
replaceWith: <T extends import("./index.js").Specifier.Any>(specifier: T) => T;
|
|
17
17
|
}
|
package/dist/specifier/delete.js
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DeleteSpecifier = void 0;
|
|
4
|
-
const base_1 = require("./base");
|
|
1
|
+
import { BaseSpecifier } from './base.js';
|
|
5
2
|
/** A instance which should be deleted */
|
|
6
|
-
class DeleteSpecifier {
|
|
3
|
+
export class DeleteSpecifier {
|
|
7
4
|
_tag = 'Delete';
|
|
8
5
|
/** The public name referenced in config */
|
|
9
6
|
name = 'delete';
|
|
@@ -13,8 +10,7 @@ class DeleteSpecifier {
|
|
|
13
10
|
this.raw = data.raw;
|
|
14
11
|
this.instance = data.instance;
|
|
15
12
|
}
|
|
16
|
-
getSemver =
|
|
17
|
-
setSemver =
|
|
18
|
-
replaceWith =
|
|
13
|
+
getSemver = BaseSpecifier.prototype.getSemver;
|
|
14
|
+
setSemver = BaseSpecifier.prototype.setSemver;
|
|
15
|
+
replaceWith = BaseSpecifier.prototype.replaceWith;
|
|
19
16
|
}
|
|
20
|
-
exports.DeleteSpecifier = DeleteSpecifier;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Effect } from 'effect';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { NonSemverError } from './lib/non-semver-error';
|
|
5
|
-
import type { SpecificRegistryResult } from './lib/specific-registry-result';
|
|
2
|
+
import { BaseSpecifier } from './base.js';
|
|
3
|
+
import { Specifier } from './index.js';
|
|
4
|
+
import { NonSemverError } from './lib/non-semver-error.js';
|
|
5
|
+
import type { SpecificRegistryResult } from './lib/specific-registry-result.js';
|
|
6
6
|
type T = SpecificRegistryResult<'version'>;
|
|
7
7
|
/**
|
|
8
8
|
* An exact semver version
|
|
@@ -13,8 +13,8 @@ export declare class ExactSpecifier extends BaseSpecifier<T> {
|
|
|
13
13
|
/** The public name referenced in config */
|
|
14
14
|
name: "exact";
|
|
15
15
|
/** Return the semver version */
|
|
16
|
-
getSemver(): Effect.Effect<
|
|
16
|
+
getSemver(): Effect.Effect<string, NonSemverError>;
|
|
17
17
|
/** Get a new `Specifier` from the given semver version applied to this one */
|
|
18
|
-
setSemver(version: string): Effect.Effect<
|
|
18
|
+
setSemver(version: string): Effect.Effect<Specifier.Any>;
|
|
19
19
|
}
|
|
20
20
|
export {};
|
package/dist/specifier/exact.js
CHANGED
|
@@ -1,25 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const _1 = require(".");
|
|
6
|
-
const base_1 = require("./base");
|
|
7
|
-
const non_semver_error_1 = require("./lib/non-semver-error");
|
|
1
|
+
import { Effect, pipe } from 'effect';
|
|
2
|
+
import { BaseSpecifier } from './base.js';
|
|
3
|
+
import { Specifier } from './index.js';
|
|
4
|
+
import { NonSemverError } from './lib/non-semver-error.js';
|
|
8
5
|
/**
|
|
9
6
|
* An exact semver version
|
|
10
7
|
* @example "1.4.4"
|
|
11
8
|
*/
|
|
12
|
-
class ExactSpecifier extends
|
|
9
|
+
export class ExactSpecifier extends BaseSpecifier {
|
|
13
10
|
_tag = 'Exact';
|
|
14
11
|
/** The public name referenced in config */
|
|
15
12
|
name = 'exact';
|
|
16
13
|
/** Return the semver version */
|
|
17
14
|
getSemver() {
|
|
18
|
-
return
|
|
15
|
+
return pipe(this.parse(), Effect.mapError(() => new NonSemverError({ specifier: this })), Effect.map((parsed) => parsed.fetchSpec));
|
|
19
16
|
}
|
|
20
17
|
/** Get a new `Specifier` from the given semver version applied to this one */
|
|
21
18
|
setSemver(version) {
|
|
22
|
-
return
|
|
19
|
+
return Effect.succeed(Specifier.create(this.instance, version));
|
|
23
20
|
}
|
|
24
21
|
}
|
|
25
|
-
exports.ExactSpecifier = ExactSpecifier;
|
package/dist/specifier/file.d.ts
CHANGED
package/dist/specifier/file.js
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FileSpecifier = void 0;
|
|
4
|
-
const base_1 = require("./base");
|
|
1
|
+
import { BaseSpecifier } from './base.js';
|
|
5
2
|
/** @example */
|
|
6
|
-
class FileSpecifier extends
|
|
3
|
+
export class FileSpecifier extends BaseSpecifier {
|
|
7
4
|
_tag = 'File';
|
|
8
5
|
/** The public name referenced in config */
|
|
9
6
|
name = 'file';
|
|
10
7
|
}
|
|
11
|
-
exports.FileSpecifier = FileSpecifier;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { Effect } from 'effect';
|
|
2
2
|
import type { HostedGitResult } from 'npm-package-arg';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { NonSemverError } from './lib/non-semver-error';
|
|
3
|
+
import { BaseSpecifier } from './base.js';
|
|
4
|
+
import { Specifier } from './index.js';
|
|
5
|
+
import { NonSemverError } from './lib/non-semver-error.js';
|
|
6
6
|
/** @example "git+https://github.com/user/foo" */
|
|
7
7
|
export declare class HostedGitSpecifier extends BaseSpecifier<HostedGitResult> {
|
|
8
8
|
_tag: string;
|
|
9
9
|
/** The public name referenced in config */
|
|
10
10
|
name: "hosted-git";
|
|
11
11
|
/** Return the git tag if it is valid semver */
|
|
12
|
-
getSemver(): Effect.Effect<
|
|
12
|
+
getSemver(): Effect.Effect<string, NonSemverError>;
|
|
13
13
|
/** Get a new `Specifier` from the given semver version applied to this one */
|
|
14
|
-
setSemver(version: string): Effect.Effect<
|
|
14
|
+
setSemver(version: string): Effect.Effect<Specifier.Any, NonSemverError>;
|
|
15
15
|
}
|
|
@@ -1,26 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const is_semver_1 = require("../guards/is-semver");
|
|
7
|
-
const base_1 = require("./base");
|
|
8
|
-
const non_semver_error_1 = require("./lib/non-semver-error");
|
|
1
|
+
import { Effect, pipe } from 'effect';
|
|
2
|
+
import { isSemver } from '../guards/is-semver.js';
|
|
3
|
+
import { BaseSpecifier } from './base.js';
|
|
4
|
+
import { Specifier } from './index.js';
|
|
5
|
+
import { NonSemverError } from './lib/non-semver-error.js';
|
|
9
6
|
/** @example "git+https://github.com/user/foo" */
|
|
10
|
-
class HostedGitSpecifier extends
|
|
7
|
+
export class HostedGitSpecifier extends BaseSpecifier {
|
|
11
8
|
_tag = 'HostedGit';
|
|
12
9
|
/** The public name referenced in config */
|
|
13
10
|
name = 'hosted-git';
|
|
14
11
|
/** Return the git tag if it is valid semver */
|
|
15
12
|
getSemver() {
|
|
16
|
-
return
|
|
13
|
+
return pipe(this.parse(), Effect.mapError(() => new NonSemverError({ specifier: this })), Effect.map((parsed) => parsed.gitCommittish || ''), Effect.flatMap((gitCommittish) => isSemver(gitCommittish) ? Effect.succeed(gitCommittish) : NonSemverError.asEffect(this)));
|
|
17
14
|
}
|
|
18
15
|
/** Get a new `Specifier` from the given semver version applied to this one */
|
|
19
16
|
setSemver(version) {
|
|
20
|
-
return
|
|
17
|
+
return pipe(this.parse(), Effect.mapError(() => new NonSemverError({ specifier: this })), Effect.map((parsed) => ({
|
|
21
18
|
gitCommittish: parsed.gitCommittish || '',
|
|
22
19
|
rawSpec: parsed.rawSpec || '',
|
|
23
|
-
})),
|
|
20
|
+
})), Effect.map(({ gitCommittish, rawSpec }) => rawSpec.replace(gitCommittish, version)), Effect.map((raw) => Specifier.create(this.instance, raw)));
|
|
24
21
|
}
|
|
25
22
|
}
|
|
26
|
-
exports.HostedGitSpecifier = HostedGitSpecifier;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import type { Instance } from '../get-instances/instance';
|
|
2
|
-
import { type Delete } from '../version-group/lib/delete';
|
|
3
|
-
import { AliasSpecifier } from './alias';
|
|
4
|
-
import { DeleteSpecifier } from './delete';
|
|
5
|
-
import { ExactSpecifier } from './exact';
|
|
6
|
-
import { FileSpecifier } from './file';
|
|
7
|
-
import { HostedGitSpecifier } from './hosted-git';
|
|
8
|
-
import { LatestSpecifier } from './latest';
|
|
9
|
-
import { RangeSpecifier } from './range';
|
|
10
|
-
import { TagSpecifier } from './tag';
|
|
11
|
-
import { UnsupportedSpecifier } from './unsupported';
|
|
12
|
-
import { UrlSpecifier } from './url';
|
|
13
|
-
import { WorkspaceProtocolSpecifier } from './workspace-protocol';
|
|
1
|
+
import type { Instance } from '../get-instances/instance.js';
|
|
2
|
+
import { type Delete } from '../version-group/lib/delete.js';
|
|
3
|
+
import { AliasSpecifier } from './alias.js';
|
|
4
|
+
import { DeleteSpecifier } from './delete.js';
|
|
5
|
+
import { ExactSpecifier } from './exact.js';
|
|
6
|
+
import { FileSpecifier } from './file.js';
|
|
7
|
+
import { HostedGitSpecifier } from './hosted-git.js';
|
|
8
|
+
import { LatestSpecifier } from './latest.js';
|
|
9
|
+
import { RangeSpecifier } from './range.js';
|
|
10
|
+
import { TagSpecifier } from './tag.js';
|
|
11
|
+
import { UnsupportedSpecifier } from './unsupported.js';
|
|
12
|
+
import { UrlSpecifier } from './url.js';
|
|
13
|
+
import { WorkspaceProtocolSpecifier } from './workspace-protocol.js';
|
|
14
14
|
export declare namespace Specifier {
|
|
15
15
|
const Alias: typeof AliasSpecifier;
|
|
16
16
|
const Delete: typeof DeleteSpecifier;
|
package/dist/specifier/index.js
CHANGED
|
@@ -1,41 +1,38 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
const url_1 = require("./url");
|
|
16
|
-
const workspace_protocol_1 = require("./workspace-protocol");
|
|
17
|
-
var Specifier;
|
|
1
|
+
import { DELETE } from '../version-group/lib/delete.js';
|
|
2
|
+
import { AliasSpecifier } from './alias.js';
|
|
3
|
+
import { DeleteSpecifier } from './delete.js';
|
|
4
|
+
import { ExactSpecifier } from './exact.js';
|
|
5
|
+
import { FileSpecifier } from './file.js';
|
|
6
|
+
import { HostedGitSpecifier } from './hosted-git.js';
|
|
7
|
+
import { LatestSpecifier } from './latest.js';
|
|
8
|
+
import { parseSpecifier } from './lib/parse-specifier.js';
|
|
9
|
+
import { RangeSpecifier } from './range.js';
|
|
10
|
+
import { TagSpecifier } from './tag.js';
|
|
11
|
+
import { UnsupportedSpecifier } from './unsupported.js';
|
|
12
|
+
import { UrlSpecifier } from './url.js';
|
|
13
|
+
import { WorkspaceProtocolSpecifier } from './workspace-protocol.js';
|
|
14
|
+
export var Specifier;
|
|
18
15
|
(function (Specifier) {
|
|
19
|
-
Specifier.Alias =
|
|
20
|
-
Specifier.Delete =
|
|
21
|
-
Specifier.Exact =
|
|
22
|
-
Specifier.File =
|
|
23
|
-
Specifier.HostedGit =
|
|
24
|
-
Specifier.Latest =
|
|
25
|
-
Specifier.Range =
|
|
26
|
-
Specifier.Tag =
|
|
27
|
-
Specifier.Unsupported =
|
|
28
|
-
Specifier.Url =
|
|
29
|
-
Specifier.WorkspaceProtocol =
|
|
16
|
+
Specifier.Alias = AliasSpecifier;
|
|
17
|
+
Specifier.Delete = DeleteSpecifier;
|
|
18
|
+
Specifier.Exact = ExactSpecifier;
|
|
19
|
+
Specifier.File = FileSpecifier;
|
|
20
|
+
Specifier.HostedGit = HostedGitSpecifier;
|
|
21
|
+
Specifier.Latest = LatestSpecifier;
|
|
22
|
+
Specifier.Range = RangeSpecifier;
|
|
23
|
+
Specifier.Tag = TagSpecifier;
|
|
24
|
+
Specifier.Unsupported = UnsupportedSpecifier;
|
|
25
|
+
Specifier.Url = UrlSpecifier;
|
|
26
|
+
Specifier.WorkspaceProtocol = WorkspaceProtocolSpecifier;
|
|
30
27
|
function create(instance, raw) {
|
|
31
|
-
if (raw ===
|
|
28
|
+
if (raw === DELETE)
|
|
32
29
|
return new Specifier.Delete({ instance, raw });
|
|
33
30
|
if (!raw)
|
|
34
31
|
return new Specifier.Unsupported({ instance, raw });
|
|
35
32
|
try {
|
|
36
33
|
if (raw === 'latest')
|
|
37
34
|
raw = '*';
|
|
38
|
-
const parsed =
|
|
35
|
+
const parsed = parseSpecifier(instance.name, raw, instance.packageJsonFile);
|
|
39
36
|
const type = parsed.type;
|
|
40
37
|
const data = { instance, raw };
|
|
41
38
|
if (raw === '*')
|
|
@@ -63,4 +60,4 @@ var Specifier;
|
|
|
63
60
|
}
|
|
64
61
|
}
|
|
65
62
|
Specifier.create = create;
|
|
66
|
-
})(Specifier || (
|
|
63
|
+
})(Specifier || (Specifier = {}));
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Effect } from 'effect';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { NonSemverError } from './lib/non-semver-error';
|
|
5
|
-
import type { SpecificRegistryResult } from './lib/specific-registry-result';
|
|
2
|
+
import { BaseSpecifier } from './base.js';
|
|
3
|
+
import { Specifier } from './index.js';
|
|
4
|
+
import { NonSemverError } from './lib/non-semver-error.js';
|
|
5
|
+
import type { SpecificRegistryResult } from './lib/specific-registry-result.js';
|
|
6
6
|
type T = SpecificRegistryResult<'range'>;
|
|
7
7
|
/**
|
|
8
8
|
* @example "*"
|
|
@@ -12,8 +12,8 @@ export declare class LatestSpecifier extends BaseSpecifier<T> {
|
|
|
12
12
|
/** The public name referenced in config */
|
|
13
13
|
name: "latest";
|
|
14
14
|
/** Return the semver version including the range */
|
|
15
|
-
getSemver(): Effect.Effect<
|
|
15
|
+
getSemver(): Effect.Effect<string, NonSemverError>;
|
|
16
16
|
/** Get a new `Specifier` from the given semver version applied to this one */
|
|
17
|
-
setSemver(version: string): Effect.Effect<
|
|
17
|
+
setSemver(version: string): Effect.Effect<Specifier.Any>;
|
|
18
18
|
}
|
|
19
19
|
export {};
|
package/dist/specifier/latest.js
CHANGED
|
@@ -1,24 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const _1 = require(".");
|
|
6
|
-
const base_1 = require("./base");
|
|
7
|
-
const non_semver_error_1 = require("./lib/non-semver-error");
|
|
1
|
+
import { Effect, pipe } from 'effect';
|
|
2
|
+
import { BaseSpecifier } from './base.js';
|
|
3
|
+
import { Specifier } from './index.js';
|
|
4
|
+
import { NonSemverError } from './lib/non-semver-error.js';
|
|
8
5
|
/**
|
|
9
6
|
* @example "*"
|
|
10
7
|
*/
|
|
11
|
-
class LatestSpecifier extends
|
|
8
|
+
export class LatestSpecifier extends BaseSpecifier {
|
|
12
9
|
_tag = 'Latest';
|
|
13
10
|
/** The public name referenced in config */
|
|
14
11
|
name = 'latest';
|
|
15
12
|
/** Return the semver version including the range */
|
|
16
13
|
getSemver() {
|
|
17
|
-
return
|
|
14
|
+
return pipe(this.parse(), Effect.mapError(() => new NonSemverError({ specifier: this })), Effect.map((parsed) => parsed.fetchSpec));
|
|
18
15
|
}
|
|
19
16
|
/** Get a new `Specifier` from the given semver version applied to this one */
|
|
20
17
|
setSemver(version) {
|
|
21
|
-
return
|
|
18
|
+
return Effect.succeed(Specifier.create(this.instance, version));
|
|
22
19
|
}
|
|
23
20
|
}
|
|
24
|
-
exports.LatestSpecifier = LatestSpecifier;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type { Specifier } from '
|
|
3
|
-
declare const NonSemverError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").Equals<
|
|
1
|
+
import { Effect } from 'effect';
|
|
2
|
+
import type { Specifier } from '../index.js';
|
|
3
|
+
declare const NonSemverError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => Readonly<A> & {
|
|
4
4
|
readonly _tag: "NonSemverError";
|
|
5
|
-
}
|
|
5
|
+
};
|
|
6
6
|
export declare class NonSemverError extends NonSemverError_base<{
|
|
7
7
|
specifier: Specifier.Any;
|
|
8
8
|
}> {
|
|
9
|
-
static asEffect<T>(specifier: Specifier.Any): Effect.Effect<
|
|
9
|
+
static asEffect<T>(specifier: Specifier.Any): Effect.Effect<T, NonSemverError>;
|
|
10
10
|
}
|
|
11
11
|
export {};
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.NonSemverError = void 0;
|
|
4
|
-
const effect_1 = require("effect");
|
|
5
|
-
class NonSemverError extends effect_1.Data.TaggedClass('NonSemverError') {
|
|
1
|
+
import { Data, Effect } from 'effect';
|
|
2
|
+
export class NonSemverError extends Data.TaggedClass('NonSemverError') {
|
|
6
3
|
static asEffect(specifier) {
|
|
7
|
-
return
|
|
4
|
+
return Effect.fail(new NonSemverError({ specifier }));
|
|
8
5
|
}
|
|
9
6
|
}
|
|
10
|
-
exports.NonSemverError = NonSemverError;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import npa from 'npm-package-arg';
|
|
2
|
-
import type { PackageJsonFile } from '../../get-package-json-files/package-json-file';
|
|
2
|
+
import type { PackageJsonFile } from '../../get-package-json-files/package-json-file.js';
|
|
3
3
|
/** Extends npm/npm-package-arg to support "workspace:*" */
|
|
4
4
|
export interface WorkspaceProtocolResult {
|
|
5
5
|
type: 'workspaceProtocol';
|
|
@@ -1,13 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.parseSpecifier = void 0;
|
|
7
|
-
const npm_package_arg_1 = __importDefault(require("npm-package-arg"));
|
|
8
|
-
function parseSpecifier(name, specifier, packageJsonFile) {
|
|
1
|
+
import npa from 'npm-package-arg';
|
|
2
|
+
export function parseSpecifier(name, specifier, packageJsonFile) {
|
|
9
3
|
if (specifier === 'workspace:*' || specifier === 'workspace:~' || specifier === 'workspace:^') {
|
|
10
|
-
const parsed =
|
|
4
|
+
const parsed = npa.resolve(name, packageJsonFile.jsonFile.dirPath, specifier.replace('workspace:', 'file:'));
|
|
11
5
|
return {
|
|
12
6
|
escapedName: parsed.escapedName,
|
|
13
7
|
name: parsed.name,
|
|
@@ -18,6 +12,5 @@ function parseSpecifier(name, specifier, packageJsonFile) {
|
|
|
18
12
|
type: 'workspaceProtocol',
|
|
19
13
|
};
|
|
20
14
|
}
|
|
21
|
-
return
|
|
15
|
+
return npa.resolve(name, specifier, packageJsonFile.jsonFile.dirPath);
|
|
22
16
|
}
|
|
23
|
-
exports.parseSpecifier = parseSpecifier;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Effect } from 'effect';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { NonSemverError } from './lib/non-semver-error';
|
|
5
|
-
import type { SpecificRegistryResult } from './lib/specific-registry-result';
|
|
2
|
+
import { BaseSpecifier } from './base.js';
|
|
3
|
+
import { Specifier } from './index.js';
|
|
4
|
+
import { NonSemverError } from './lib/non-semver-error.js';
|
|
5
|
+
import type { SpecificRegistryResult } from './lib/specific-registry-result.js';
|
|
6
6
|
type T = SpecificRegistryResult<'range'>;
|
|
7
7
|
/**
|
|
8
8
|
* @example "^1.2.3"
|
|
@@ -12,8 +12,8 @@ export declare class RangeSpecifier extends BaseSpecifier<T> {
|
|
|
12
12
|
/** The public name referenced in config */
|
|
13
13
|
name: "range";
|
|
14
14
|
/** Return the semver version including the range */
|
|
15
|
-
getSemver(): Effect.Effect<
|
|
15
|
+
getSemver(): Effect.Effect<string, NonSemverError>;
|
|
16
16
|
/** Get a new `Specifier` from the given semver version applied to this one */
|
|
17
|
-
setSemver(version: string): Effect.Effect<
|
|
17
|
+
setSemver(version: string): Effect.Effect<Specifier.Any>;
|
|
18
18
|
}
|
|
19
19
|
export {};
|
package/dist/specifier/range.js
CHANGED
|
@@ -1,24 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const _1 = require(".");
|
|
6
|
-
const base_1 = require("./base");
|
|
7
|
-
const non_semver_error_1 = require("./lib/non-semver-error");
|
|
1
|
+
import { Effect, pipe } from 'effect';
|
|
2
|
+
import { BaseSpecifier } from './base.js';
|
|
3
|
+
import { Specifier } from './index.js';
|
|
4
|
+
import { NonSemverError } from './lib/non-semver-error.js';
|
|
8
5
|
/**
|
|
9
6
|
* @example "^1.2.3"
|
|
10
7
|
*/
|
|
11
|
-
class RangeSpecifier extends
|
|
8
|
+
export class RangeSpecifier extends BaseSpecifier {
|
|
12
9
|
_tag = 'Range';
|
|
13
10
|
/** The public name referenced in config */
|
|
14
11
|
name = 'range';
|
|
15
12
|
/** Return the semver version including the range */
|
|
16
13
|
getSemver() {
|
|
17
|
-
return
|
|
14
|
+
return pipe(this.parse(), Effect.mapError(() => new NonSemverError({ specifier: this })), Effect.map((parsed) => parsed.fetchSpec));
|
|
18
15
|
}
|
|
19
16
|
/** Get a new `Specifier` from the given semver version applied to this one */
|
|
20
17
|
setSemver(version) {
|
|
21
|
-
return
|
|
18
|
+
return Effect.succeed(Specifier.create(this.instance, version));
|
|
22
19
|
}
|
|
23
20
|
}
|
|
24
|
-
exports.RangeSpecifier = RangeSpecifier;
|
package/dist/specifier/tag.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { BaseSpecifier } from './base';
|
|
2
|
-
import type { SpecificRegistryResult } from './lib/specific-registry-result';
|
|
1
|
+
import { BaseSpecifier } from './base.js';
|
|
2
|
+
import type { SpecificRegistryResult } from './lib/specific-registry-result.js';
|
|
3
3
|
/**
|
|
4
4
|
* @example "latest"
|
|
5
5
|
* @example "made-up-by-some-dev"
|
package/dist/specifier/tag.js
CHANGED
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TagSpecifier = void 0;
|
|
4
|
-
const base_1 = require("./base");
|
|
1
|
+
import { BaseSpecifier } from './base.js';
|
|
5
2
|
/**
|
|
6
3
|
* @example "latest"
|
|
7
4
|
* @example "made-up-by-some-dev"
|
|
8
5
|
*/
|
|
9
|
-
class TagSpecifier extends
|
|
6
|
+
export class TagSpecifier extends BaseSpecifier {
|
|
10
7
|
_tag = 'Tag';
|
|
11
8
|
/** The public name referenced in config */
|
|
12
9
|
name = 'tag';
|
|
13
10
|
}
|
|
14
|
-
exports.TagSpecifier = TagSpecifier;
|
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UnsupportedSpecifier = void 0;
|
|
4
|
-
const base_1 = require("./base");
|
|
1
|
+
import { BaseSpecifier } from './base.js';
|
|
5
2
|
/** A specifier not supported by the `npm` package manager */
|
|
6
|
-
class UnsupportedSpecifier extends
|
|
3
|
+
export class UnsupportedSpecifier extends BaseSpecifier {
|
|
7
4
|
_tag = 'Unsupported';
|
|
8
5
|
/** The public name referenced in config */
|
|
9
6
|
name = 'unsupported';
|
|
10
7
|
}
|
|
11
|
-
exports.UnsupportedSpecifier = UnsupportedSpecifier;
|
package/dist/specifier/url.d.ts
CHANGED
package/dist/specifier/url.js
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UrlSpecifier = void 0;
|
|
4
|
-
const base_1 = require("./base");
|
|
1
|
+
import { BaseSpecifier } from './base.js';
|
|
5
2
|
/** @example "http://x.com/foo.tgz" */
|
|
6
|
-
class UrlSpecifier extends
|
|
3
|
+
export class UrlSpecifier extends BaseSpecifier {
|
|
7
4
|
_tag = 'Url';
|
|
8
5
|
/** The public name referenced in config */
|
|
9
6
|
name = 'url';
|
|
10
7
|
}
|
|
11
|
-
exports.UrlSpecifier = UrlSpecifier;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Effect } from 'effect';
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import type { WorkspaceProtocolResult } from './lib/parse-specifier';
|
|
2
|
+
import type { Ctx } from '../get-context/index.js';
|
|
3
|
+
import { BaseSpecifier } from './base.js';
|
|
4
|
+
import { Specifier } from './index.js';
|
|
5
|
+
import type { WorkspaceProtocolResult } from './lib/parse-specifier.js';
|
|
6
6
|
/** Represents "workspace:*" and "workspace:~" */
|
|
7
7
|
export declare class WorkspaceProtocolSpecifier extends BaseSpecifier<WorkspaceProtocolResult> {
|
|
8
8
|
_tag: string;
|
|
@@ -13,7 +13,7 @@ export declare class WorkspaceProtocolSpecifier extends BaseSpecifier<WorkspaceP
|
|
|
13
13
|
* with tools which expect values which conform to the spec. This value is
|
|
14
14
|
* used only when sorting versions.
|
|
15
15
|
*/
|
|
16
|
-
getSemverEquivalent(ctx: Ctx): Effect.Effect<
|
|
17
|
-
getSemver(): Effect.Effect<
|
|
18
|
-
setSemver(version: string): Effect.Effect<
|
|
16
|
+
getSemverEquivalent(ctx: Ctx): Effect.Effect<string>;
|
|
17
|
+
getSemver(): Effect.Effect<string>;
|
|
18
|
+
setSemver(version: string): Effect.Effect<Specifier.Any>;
|
|
19
19
|
}
|