rolldown-pnpm-config 2.4.0 → 2.4.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/cli/commands/export.js +4 -3
- package/cli/commands/preview.js +2 -2
- package/cli/commands/upgrade.js +4 -3
- package/cli/diff/render.js +1 -1
- package/cli/load-config.js +1 -1
- package/cli/main.js +1 -1
- package/cli/peer-range.js +12 -8
- package/cli/render/legend.js +1 -1
- package/cli/render/print.js +1 -1
- package/cli/render/report.js +1 -1
- package/cli/render/tone.js +1 -1
- package/cli/resolve.js +1 -1
- package/cli/root.js +1 -1
- package/cli/simulated-view.js +1 -1
- package/cli/summary.js +1 -1
- package/cli/ui/preview-screen.js +2 -2
- package/cli/ui/progress-view.js +2 -2
- package/cli/ui/screens.js +1 -1
- package/cli/ui/walk-screen.js +2 -2
- package/cli/version.js +1 -1
- package/cli/walk-reducer.js +1 -1
- package/cli/workspace-file.js +13 -23
- package/package.json +13 -12
- package/plugin/allowed-versions.js +8 -4
- package/plugin/freeze.js +1 -1
- package/plugin/overrides-from-catalogs.js +18 -15
package/cli/commands/export.js
CHANGED
|
@@ -14,11 +14,12 @@ import { failureDoc } from "../render/report.js";
|
|
|
14
14
|
import { findConfigFiles, pickConfigCandidate } from "../select-file.js";
|
|
15
15
|
import { canonicalize, writeWorkspace } from "../workspace-file.js";
|
|
16
16
|
import { overlayWorkspace } from "../workspace-overlay.js";
|
|
17
|
-
import { Data, Effect,
|
|
17
|
+
import { Data, Effect, Option, Predicate } from "effect";
|
|
18
18
|
import { dirname, relative } from "node:path";
|
|
19
|
-
import { CliDoc, CliMessage } from "@effected/cli";
|
|
19
|
+
import { CliDoc, CliMessage } from "@effected/cli-kit";
|
|
20
20
|
import { existsSync } from "node:fs";
|
|
21
21
|
import { Argument, Command, Flag } from "effect/cli";
|
|
22
|
+
import { AtomicFile } from "@effected/files";
|
|
22
23
|
|
|
23
24
|
// src/cli/commands/export.ts
|
|
24
25
|
/**
|
|
@@ -90,7 +91,7 @@ function runExport(opts) {
|
|
|
90
91
|
diff,
|
|
91
92
|
report
|
|
92
93
|
};
|
|
93
|
-
yield*
|
|
94
|
+
yield* AtomicFile.write(path, rendered).pipe(Effect.mapError(() => new ExportError({ message: `Cannot write ${path}` })));
|
|
94
95
|
return {
|
|
95
96
|
path,
|
|
96
97
|
rendered,
|
package/cli/commands/preview.js
CHANGED
|
@@ -11,9 +11,9 @@ import { previewScreen } from "../ui/screens.js";
|
|
|
11
11
|
import { WORKSPACE_FIELDS } from "./export.js";
|
|
12
12
|
import { Data, Effect, Option } from "effect";
|
|
13
13
|
import { dirname } from "node:path";
|
|
14
|
-
import { CliDoc, CliInteractive } from "@effected/cli";
|
|
14
|
+
import { CliDoc, CliInteractive } from "@effected/cli-kit";
|
|
15
15
|
import { Argument, Command } from "effect/cli";
|
|
16
|
-
import { CliUi } from "@effected/cli/ui";
|
|
16
|
+
import { CliUi } from "@effected/cli-kit/ui";
|
|
17
17
|
|
|
18
18
|
// src/cli/commands/preview.ts
|
|
19
19
|
/** Typed failure for the preview run. @internal */
|
package/cli/commands/upgrade.js
CHANGED
|
@@ -20,9 +20,10 @@ import { buildWalkItems } from "../walk-plan.js";
|
|
|
20
20
|
import { findWorkspaceRoot, makeWorkspaceResolver } from "../workspace-resolve.js";
|
|
21
21
|
import { Clock, Data, Effect, FileSystem, Option, Result } from "effect";
|
|
22
22
|
import { dirname } from "node:path";
|
|
23
|
-
import { CliDoc, CliExit, CliFormat, CliInteractive, CliMessage, Doc, Fmt } from "@effected/cli";
|
|
23
|
+
import { CliDoc, CliExit, CliFormat, CliInteractive, CliMessage, Doc, Fmt } from "@effected/cli-kit";
|
|
24
24
|
import { Argument, Command, Flag } from "effect/cli";
|
|
25
|
-
import {
|
|
25
|
+
import { AtomicFile } from "@effected/files";
|
|
26
|
+
import { CliUi } from "@effected/cli-kit/ui";
|
|
26
27
|
import { ReleaseAgeGate } from "@effected/npm";
|
|
27
28
|
|
|
28
29
|
// src/cli/commands/upgrade.ts
|
|
@@ -72,7 +73,7 @@ var CheckFailedError = class extends Data.TaggedError("CheckFailedError") {
|
|
|
72
73
|
};
|
|
73
74
|
/** Write the rewritten config source back to `file`. */
|
|
74
75
|
function writeSource(file, next) {
|
|
75
|
-
return
|
|
76
|
+
return AtomicFile.write(file, next).pipe(Effect.mapError(() => new UpgradeError({ message: `Cannot write ${file}` })));
|
|
76
77
|
}
|
|
77
78
|
/** Read a config file and statically discover its catalog entries. @internal */
|
|
78
79
|
function readCatalogSource(file) {
|
package/cli/diff/render.js
CHANGED
package/cli/load-config.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { evaluatePluginConfig } from "./evaluate.js";
|
|
2
2
|
import { parseWorkspace } from "./workspace-file.js";
|
|
3
3
|
import { Effect, FileSystem, Predicate } from "effect";
|
|
4
|
-
import { Fmt } from "@effected/cli";
|
|
4
|
+
import { Fmt } from "@effected/cli-kit";
|
|
5
5
|
|
|
6
6
|
// src/cli/load-config.ts
|
|
7
7
|
/**
|
package/cli/main.js
CHANGED
|
@@ -4,7 +4,7 @@ import { RegistryResolverLive } from "./resolve.js";
|
|
|
4
4
|
import { rootCommand } from "./root.js";
|
|
5
5
|
import { CLI_VERSION } from "./version.js";
|
|
6
6
|
import { Effect } from "effect";
|
|
7
|
-
import { CliAudience, CliRuntime } from "@effected/cli";
|
|
7
|
+
import { CliAudience, CliRuntime } from "@effected/cli-kit";
|
|
8
8
|
import { NodeRuntime, NodeServices } from "@effect/platform-node";
|
|
9
9
|
|
|
10
10
|
// src/cli/main.ts
|
package/cli/peer-range.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Data, Effect } from "effect";
|
|
2
|
-
import {
|
|
1
|
+
import { Data, Effect, Result } from "effect";
|
|
2
|
+
import { VersionSpecifier } from "@effected/semver";
|
|
3
3
|
|
|
4
4
|
// src/cli/peer-range.ts
|
|
5
5
|
/**
|
|
@@ -8,8 +8,12 @@ import { SemVer } from "@effected/semver";
|
|
|
8
8
|
* @internal
|
|
9
9
|
*/
|
|
10
10
|
var PeerRangeError = class extends Data.TaggedError("PeerRangeError") {};
|
|
11
|
-
/**
|
|
12
|
-
const
|
|
11
|
+
/** The operators a peer range can be derived from; `VersionSpecifier` also admits comparators such as `>=`. */
|
|
12
|
+
const DERIVABLE_OPERATORS = /* @__PURE__ */ new Set([
|
|
13
|
+
"^",
|
|
14
|
+
"~",
|
|
15
|
+
""
|
|
16
|
+
]);
|
|
13
17
|
/**
|
|
14
18
|
* Recompute a materialized peer range from a package range and a strategy.
|
|
15
19
|
* "lock" pins to the exact version; "lock-minor" floors the patch to .0.
|
|
@@ -34,10 +38,10 @@ const PREFIX_RE = /^(\^|~|)(\d.*)$/;
|
|
|
34
38
|
*/
|
|
35
39
|
function derivePeerRange(range, strategy) {
|
|
36
40
|
return Effect.gen(function* () {
|
|
37
|
-
const
|
|
38
|
-
if (!
|
|
39
|
-
const
|
|
40
|
-
const
|
|
41
|
+
const spec = Result.getOrNull(VersionSpecifier.parseResult(range));
|
|
42
|
+
if (spec === null || !DERIVABLE_OPERATORS.has(spec.operator)) return yield* Effect.fail(new PeerRangeError({ message: `Cannot derive peer range from "${range}"` }));
|
|
43
|
+
const { operator: prefix, version: parsed } = spec;
|
|
44
|
+
const version = range.slice(prefix.length);
|
|
41
45
|
if (strategy === "lock") return {
|
|
42
46
|
range: `${prefix}${version}`,
|
|
43
47
|
warning: null
|
package/cli/render/legend.js
CHANGED
package/cli/render/print.js
CHANGED
package/cli/render/report.js
CHANGED
package/cli/render/tone.js
CHANGED
package/cli/resolve.js
CHANGED
package/cli/root.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { exportCommand } from "./commands/export.js";
|
|
2
2
|
import { previewCommand } from "./commands/preview.js";
|
|
3
3
|
import { upgradeCommand } from "./commands/upgrade.js";
|
|
4
|
-
import { CliAudience } from "@effected/cli";
|
|
4
|
+
import { CliAudience } from "@effected/cli-kit";
|
|
5
5
|
import { Command } from "effect/cli";
|
|
6
6
|
|
|
7
7
|
// src/cli/root.ts
|
package/cli/simulated-view.js
CHANGED
|
@@ -2,7 +2,7 @@ import { scalarText } from "./diff/render.js";
|
|
|
2
2
|
import { row, tone } from "./render/tone.js";
|
|
3
3
|
import { canonicalize } from "./workspace-file.js";
|
|
4
4
|
import { Predicate } from "effect";
|
|
5
|
-
import { Doc } from "@effected/cli";
|
|
5
|
+
import { Doc } from "@effected/cli-kit";
|
|
6
6
|
|
|
7
7
|
// src/cli/simulated-view.ts
|
|
8
8
|
/**
|
package/cli/summary.js
CHANGED
package/cli/ui/preview-screen.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { legend, simulatedLegend } from "../render/legend.js";
|
|
2
|
-
import { Doc } from "@effected/cli";
|
|
3
|
-
import { DocView, KeyHelp, KeyTable, Styled, Tabs, Viewport, useKeys, useTerminalSize, useTheme } from "@effected/cli/ui";
|
|
2
|
+
import { Doc } from "@effected/cli-kit";
|
|
3
|
+
import { DocView, KeyHelp, KeyTable, Styled, Tabs, Viewport, useKeys, useTerminalSize, useTheme } from "@effected/cli-kit/ui";
|
|
4
4
|
import { Box, Text } from "ink";
|
|
5
5
|
import { useEffect, useState } from "react";
|
|
6
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
package/cli/ui/progress-view.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Status } from "@effected/cli";
|
|
2
|
-
import { Styled, useGlyphs, useTheme } from "@effected/cli/ui";
|
|
1
|
+
import { Status } from "@effected/cli-kit";
|
|
2
|
+
import { Styled, useGlyphs, useTheme } from "@effected/cli-kit/ui";
|
|
3
3
|
import { Text } from "ink";
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
|
package/cli/ui/screens.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { initialProgress, reduceProgress } from "./progress.js";
|
|
2
2
|
import { Effect, PubSub } from "effect";
|
|
3
|
-
import { CliUi } from "@effected/cli/ui";
|
|
3
|
+
import { CliUi } from "@effected/cli-kit/ui";
|
|
4
4
|
|
|
5
5
|
// src/cli/ui/screens.ts
|
|
6
6
|
/** The interactive upgrade table, loaded on mount. @internal */
|
package/cli/ui/walk-screen.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { computeGroupPeers } from "../interop-live.js";
|
|
2
2
|
import { TONES } from "../render/tone.js";
|
|
3
3
|
import { cellTone, displayCandidates, initTable, peerFor, tableDecisions, tableLayout, tableStep } from "../walk-reducer.js";
|
|
4
|
-
import { Fmt } from "@effected/cli";
|
|
5
|
-
import { KeyHelp, KeyTable, Styled, useKeys, useTerminalSize } from "@effected/cli/ui";
|
|
4
|
+
import { Fmt } from "@effected/cli-kit";
|
|
5
|
+
import { KeyHelp, KeyTable, Styled, useKeys, useTerminalSize } from "@effected/cli-kit/ui";
|
|
6
6
|
import { Box, Text } from "ink";
|
|
7
7
|
import { useRef, useState } from "react";
|
|
8
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|
package/cli/version.js
CHANGED
package/cli/walk-reducer.js
CHANGED
package/cli/workspace-file.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Option, Order, Predicate, Result } from "effect";
|
|
2
2
|
import { locateWorkspaceRootSync } from "@effected/workspaces";
|
|
3
3
|
import { nodeSyncOps } from "@effected/workspaces/node-sync";
|
|
4
|
-
import { Yaml, YamlDocument,
|
|
4
|
+
import { Yaml, YamlDocument, YamlFormat, YamlLint, YamlLintConfig, YamlStringifyOptions } from "@effected/yaml";
|
|
5
5
|
|
|
6
6
|
// src/cli/workspace-file.ts
|
|
7
7
|
const FILENAME = "pnpm-workspace.yaml";
|
|
@@ -289,24 +289,18 @@ function faithful(text, next) {
|
|
|
289
289
|
return Result.isSuccess(value) && sameValue(isMapping(value.success) ? value.success : {}, next);
|
|
290
290
|
}
|
|
291
291
|
/**
|
|
292
|
-
*
|
|
293
|
-
* quotes and trailing comment
|
|
294
|
-
*
|
|
295
|
-
*
|
|
296
|
-
* comment), so the splice is attempted unstyled and accepted only when every
|
|
297
|
-
* edit stays inside the target scalar. `None` means "not a splice" — the
|
|
298
|
-
* caller takes the styled path. Workaround for spencerbeggs/effected#1219.
|
|
292
|
+
* Whether a change puts a primitive over an existing scalar. `modify` splices
|
|
293
|
+
* that in place, keeping the scalar's own quotes and trailing comment, so it
|
|
294
|
+
* must not be re-quoted to match its siblings: the author's spelling of that
|
|
295
|
+
* one value stands.
|
|
299
296
|
*/
|
|
300
|
-
function
|
|
301
|
-
|
|
297
|
+
function replacesScalar(text, change) {
|
|
298
|
+
const { value } = change;
|
|
299
|
+
if (change.newKey || typeof value !== "string" && typeof value !== "number" && typeof value !== "boolean") return false;
|
|
302
300
|
const doc = YamlDocument.parseResult(text);
|
|
303
|
-
if (Result.isFailure(doc) || doc.success.contents === null) return
|
|
304
|
-
const target = doc.success.contents.find(path);
|
|
305
|
-
|
|
306
|
-
const { offset, length } = target.value;
|
|
307
|
-
const edits = YamlFormat.modifyResult(text, path, value);
|
|
308
|
-
if (Result.isFailure(edits)) return Option.none();
|
|
309
|
-
return edits.success.every((e) => e.offset >= offset && e.offset + e.length <= offset + length) ? Option.some(YamlEdit.applyAll(text, edits.success)) : Option.none();
|
|
301
|
+
if (Result.isFailure(doc) || doc.success.contents === null) return false;
|
|
302
|
+
const target = doc.success.contents.find(change.path);
|
|
303
|
+
return Option.isSome(target) && target.value._tag === "YamlScalar";
|
|
310
304
|
}
|
|
311
305
|
/** Apply every change as an edit; `None` when the editor refuses one. */
|
|
312
306
|
function applyChanges(source, changes, style) {
|
|
@@ -315,14 +309,10 @@ function applyChanges(source, changes, style) {
|
|
|
315
309
|
const quoteChar = style.quoteStyle ?? "single";
|
|
316
310
|
let text = source;
|
|
317
311
|
for (const change of changes) {
|
|
318
|
-
const
|
|
319
|
-
if (Option.isSome(spliced)) {
|
|
320
|
-
text = spliced.value;
|
|
321
|
-
continue;
|
|
322
|
-
}
|
|
312
|
+
const keepSpelling = replacesScalar(text, change);
|
|
323
313
|
const result = YamlFormat.modifyToStringResult(text, change.path, change.value, style);
|
|
324
314
|
if (Result.isFailure(result)) return Option.none();
|
|
325
|
-
text = requoteWritten(result.success, change, roles, quoteChar);
|
|
315
|
+
text = keepSpelling ? result.success : requoteWritten(result.success, change, roles, quoteChar);
|
|
326
316
|
}
|
|
327
317
|
return Option.some(text);
|
|
328
318
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rolldown-pnpm-config",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "A dogfooding example of our plugin",
|
|
6
6
|
"repository": {
|
|
@@ -35,18 +35,19 @@
|
|
|
35
35
|
"rolldown-pnpm-config": "bin/rolldown-pnpm-config.js"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@effect/platform-node": "~4.1.
|
|
39
|
-
"@effected/cli": "^0.
|
|
40
|
-
"@effected/env": "^0.
|
|
41
|
-
"@effected/
|
|
42
|
-
"@effected/
|
|
43
|
-
"@effected/
|
|
44
|
-
"@effected/
|
|
45
|
-
"@effected/
|
|
46
|
-
"@effected/
|
|
47
|
-
"
|
|
38
|
+
"@effect/platform-node": "~4.1.2",
|
|
39
|
+
"@effected/cli-kit": "^0.27.0",
|
|
40
|
+
"@effected/env": "^0.11.0",
|
|
41
|
+
"@effected/files": "^0.1.0",
|
|
42
|
+
"@effected/glob": "^0.19.0",
|
|
43
|
+
"@effected/npm": "^0.30.1",
|
|
44
|
+
"@effected/semver": "^0.22.0",
|
|
45
|
+
"@effected/walker": "^0.25.1",
|
|
46
|
+
"@effected/workspaces": "^0.43.0",
|
|
47
|
+
"@effected/yaml": "^0.29.0",
|
|
48
|
+
"effect": "~4.1.2",
|
|
48
49
|
"ink": "^8.0.0",
|
|
49
|
-
"oxc-parser": "^0.
|
|
50
|
+
"oxc-parser": "^0.157.0",
|
|
50
51
|
"react": "^19.3.1"
|
|
51
52
|
},
|
|
52
53
|
"peerDependencies": {
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import { rangeOf } from "../catalogs.js";
|
|
2
2
|
import { bareVersion } from "../semver-util.js";
|
|
3
|
-
import { Predicate } from "effect";
|
|
3
|
+
import { Predicate, Result } from "effect";
|
|
4
|
+
import { VersionSpecifier } from "@effected/semver";
|
|
4
5
|
|
|
5
6
|
// src/plugin/allowed-versions.ts
|
|
6
|
-
/** An exact version: no range operator, no wildcard — `X.Y.Z` with an optional prerelease. */
|
|
7
|
-
|
|
7
|
+
/** An exact version: no range operator, no wildcard, no build metadata — `X.Y.Z` with an optional prerelease. */
|
|
8
|
+
function isExactVersion(range) {
|
|
9
|
+
const spec = Result.getOrNull(VersionSpecifier.parseResult(range));
|
|
10
|
+
return spec !== null && spec.operator === "" && spec.version.build.length === 0;
|
|
11
|
+
}
|
|
8
12
|
/** Apply the `prefix` transform to a peer value: verbatim, re-prefixed, or stripped to exact. */
|
|
9
13
|
function applyPrefix(peerValue, prefix) {
|
|
10
14
|
if (prefix === void 0) return peerValue;
|
|
@@ -22,7 +26,7 @@ function deriveOne(catalogs, { catalog, peer, prefix }) {
|
|
|
22
26
|
for (const [name, spec] of Object.entries(decl.packages)) {
|
|
23
27
|
if (name === peer) continue;
|
|
24
28
|
const range = rangeOf(spec);
|
|
25
|
-
if (!
|
|
29
|
+
if (!isExactVersion(range)) continue;
|
|
26
30
|
table[`${name}@${range}>${peer}`] = value;
|
|
27
31
|
}
|
|
28
32
|
return table;
|
package/plugin/freeze.js
CHANGED
|
@@ -4,7 +4,7 @@ import { FIELD_REGISTRY } from "../registry.js";
|
|
|
4
4
|
import { resolvePeerDependencyRules } from "./allowed-versions.js";
|
|
5
5
|
import { resolveOverrides } from "./overrides-from-catalogs.js";
|
|
6
6
|
import { Data, Effect, Predicate, Schema } from "effect";
|
|
7
|
-
import { Fmt } from "@effected/cli";
|
|
7
|
+
import { Fmt } from "@effected/cli-kit";
|
|
8
8
|
|
|
9
9
|
// src/plugin/freeze.ts
|
|
10
10
|
/**
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import { rangeOf } from "../catalogs.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { Glob, Predicate, Result } from "effect";
|
|
3
|
+
import { VersionSpecifier } from "@effected/semver";
|
|
4
4
|
|
|
5
5
|
// src/plugin/overrides-from-catalogs.ts
|
|
6
|
-
/**
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
/** The simple operators that can pin: an optional `^`, `~`, `>=` or `=` on one version. */
|
|
7
|
+
const PINNABLE_OPERATORS = /* @__PURE__ */ new Set([
|
|
8
|
+
"^",
|
|
9
|
+
"~",
|
|
10
|
+
">=",
|
|
11
|
+
"=",
|
|
12
|
+
""
|
|
13
|
+
]);
|
|
10
14
|
/**
|
|
11
15
|
* The release line a plain version belongs to: `^X.0.0`, or `^0.Y.0` when the
|
|
12
16
|
* major is 0. A `0.0.Z` version has no caret line (`^0.0.0` admits only
|
|
@@ -14,8 +18,8 @@ const SIMPLE_RANGE = /^(?:\^|~|>=|=)?\s*\d/;
|
|
|
14
18
|
* `0.0.Z` request.
|
|
15
19
|
*/
|
|
16
20
|
function releaseLine(major, minor) {
|
|
17
|
-
if (major !==
|
|
18
|
-
return minor ===
|
|
21
|
+
if (major !== 0) return `^${major}.0.0`;
|
|
22
|
+
return minor === 0 ? "~0.0.0" : `^0.${minor}.0`;
|
|
19
23
|
}
|
|
20
24
|
/**
|
|
21
25
|
* Compile a filter list into a member predicate, throwing when an entry
|
|
@@ -40,13 +44,12 @@ function deriveOne(catalogs, { catalog, include, exclude = [], scope = "line" })
|
|
|
40
44
|
const table = {};
|
|
41
45
|
for (const [name, spec] of Object.entries(decl.packages)) {
|
|
42
46
|
if (!isIncluded(name) || isExcluded(name)) continue;
|
|
43
|
-
const
|
|
44
|
-
if (
|
|
45
|
-
const version =
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
table[selector] = version;
|
|
47
|
+
const parsed = Result.getOrNull(VersionSpecifier.parseResult(rangeOf(spec)));
|
|
48
|
+
if (parsed === null || !PINNABLE_OPERATORS.has(parsed.operator)) continue;
|
|
49
|
+
const { version } = parsed;
|
|
50
|
+
if (version.prerelease.length > 0 || version.build.length > 0) continue;
|
|
51
|
+
const selector = scope === "any" ? name : `${name}@${releaseLine(version.major, version.minor)}`;
|
|
52
|
+
table[selector] = version.toString();
|
|
50
53
|
}
|
|
51
54
|
return table;
|
|
52
55
|
}
|