rolldown-pnpm-config 2.2.1 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli/commands/export.js +3 -3
- package/cli/commands/preview.js +2 -2
- package/cli/commands/upgrade.js +6 -6
- package/cli/load-config.js +1 -1
- package/cli/preview-views.js +3 -3
- package/cli/simulated-view.js +2 -2
- package/cli/ui/walk-screen.js +1 -1
- package/cli/version.js +1 -1
- package/cli/walk-plan.js +2 -2
- package/index.d.ts +17 -1
- package/package.json +11 -11
- package/plugin/overrides-from-catalogs.js +20 -6
- package/runtime/strategies/table.js +1 -1
package/cli/commands/export.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { discoverOwnedPatches, withResolvedBuildPatches } from "../../patches/build.js";
|
|
2
1
|
import { DESCRIPTORS } from "../../descriptors/index.js";
|
|
2
|
+
import { discoverOwnedPatches, withResolvedBuildPatches } from "../../patches/build.js";
|
|
3
|
+
import { reconcilePatches } from "../../patches/reconcile.js";
|
|
3
4
|
import { freeze } from "../../plugin/freeze.js";
|
|
4
5
|
import { resolveRootName } from "../../runtime/ctx.js";
|
|
5
|
-
import { canonicalize, renderWorkspace } from "../workspace-file.js";
|
|
6
6
|
import { WorkingDirectory, resolveWorkspacePath } from "../cwd.js";
|
|
7
|
-
import { reconcilePatches } from "../../patches/reconcile.js";
|
|
8
7
|
import { buildDiff } from "../diff/build.js";
|
|
9
8
|
import { renderExportDiff } from "../diff/render.js";
|
|
10
9
|
import { effectiveManaged } from "../effective.js";
|
|
@@ -13,6 +12,7 @@ import { legend } from "../render/legend.js";
|
|
|
13
12
|
import { printView } from "../render/print.js";
|
|
14
13
|
import { failureDoc } from "../render/report.js";
|
|
15
14
|
import { findConfigFiles, pickConfigCandidate } from "../select-file.js";
|
|
15
|
+
import { canonicalize, renderWorkspace } from "../workspace-file.js";
|
|
16
16
|
import { overlayWorkspace } from "../workspace-overlay.js";
|
|
17
17
|
import { Data, Effect, FileSystem, Option, Predicate } from "effect";
|
|
18
18
|
import { dirname, relative } from "node:path";
|
package/cli/commands/preview.js
CHANGED
|
@@ -2,13 +2,13 @@ import { freeze } from "../../plugin/freeze.js";
|
|
|
2
2
|
import { resolveRootName } from "../../runtime/ctx.js";
|
|
3
3
|
import { WorkingDirectory, resolveWorkspacePath } from "../cwd.js";
|
|
4
4
|
import { loadConfigAndWorkspace } from "../load-config.js";
|
|
5
|
+
import { buildPreviewViews } from "../preview-views.js";
|
|
5
6
|
import { legend } from "../render/legend.js";
|
|
6
7
|
import { printView } from "../render/print.js";
|
|
7
8
|
import { failureDoc } from "../render/report.js";
|
|
8
9
|
import { findConfigFiles, pickConfigCandidate } from "../select-file.js";
|
|
9
|
-
import { WORKSPACE_FIELDS } from "./export.js";
|
|
10
|
-
import { buildPreviewViews } from "../preview-views.js";
|
|
11
10
|
import { previewScreen } from "../ui/screens.js";
|
|
11
|
+
import { WORKSPACE_FIELDS } from "./export.js";
|
|
12
12
|
import { Data, Effect, Option } from "effect";
|
|
13
13
|
import { dirname } from "node:path";
|
|
14
14
|
import { CliDoc, CliInteractive } from "@effected/cli";
|
package/cli/commands/upgrade.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { bareVersion } from "../../semver-util.js";
|
|
2
2
|
import { WorkingDirectory } from "../cwd.js";
|
|
3
|
-
import { RegistryResolver } from "../resolve.js";
|
|
4
|
-
import { evaluatePluginConfig } from "../evaluate.js";
|
|
5
|
-
import { failureDoc, warningDoc } from "../render/report.js";
|
|
6
3
|
import { discoverCatalogEntries } from "../discover.js";
|
|
7
|
-
import { filterEntriesByCatalog, findConfigFiles, pickConfigCandidate } from "../select-file.js";
|
|
8
|
-
import { walkScreen, withProgress } from "../ui/screens.js";
|
|
9
|
-
import { versionKeyOf } from "../version-key.js";
|
|
10
4
|
import { buildEdits, entryEdits } from "../edits.js";
|
|
5
|
+
import { evaluatePluginConfig } from "../evaluate.js";
|
|
11
6
|
import { buildInteropEdits, interopEntryChanged, makePeerFetcher, runInterop } from "../interop.js";
|
|
12
7
|
import { buildGroupModel, computeGroupPeers } from "../interop-live.js";
|
|
13
8
|
import { derivePeerRange } from "../peer-range.js";
|
|
14
9
|
import { defaultPick, planEntry } from "../plan.js";
|
|
15
10
|
import { parsePnpmGate, readConfigReleaseAge } from "../release-age.js";
|
|
11
|
+
import { failureDoc, warningDoc } from "../render/report.js";
|
|
12
|
+
import { RegistryResolver } from "../resolve.js";
|
|
16
13
|
import { applyEdits } from "../rewrite.js";
|
|
14
|
+
import { filterEntriesByCatalog, findConfigFiles, pickConfigCandidate } from "../select-file.js";
|
|
17
15
|
import { summaryDoc } from "../summary.js";
|
|
16
|
+
import { walkScreen, withProgress } from "../ui/screens.js";
|
|
18
17
|
import { validateEdits } from "../validate.js";
|
|
18
|
+
import { versionKeyOf } from "../version-key.js";
|
|
19
19
|
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";
|
package/cli/load-config.js
CHANGED
package/cli/preview-views.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { WORKSPACE_FIELDS } from "./commands/export.js";
|
|
2
2
|
import { buildDiff } from "./diff/build.js";
|
|
3
3
|
import { renderExportDiff } from "./diff/render.js";
|
|
4
4
|
import { effectiveManaged, vanillaManaged } from "./effective.js";
|
|
5
|
-
import { overlayWorkspace } from "./workspace-overlay.js";
|
|
6
|
-
import { WORKSPACE_FIELDS } from "./commands/export.js";
|
|
7
5
|
import { renderSimulated } from "./simulated-view.js";
|
|
6
|
+
import { canonicalize } from "./workspace-file.js";
|
|
7
|
+
import { overlayWorkspace } from "./workspace-overlay.js";
|
|
8
8
|
|
|
9
9
|
// src/cli/preview-views.ts
|
|
10
10
|
/**
|
package/cli/simulated-view.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { canonicalize } from "./workspace-file.js";
|
|
2
|
-
import { row, tone } from "./render/tone.js";
|
|
3
1
|
import { scalarText } from "./diff/render.js";
|
|
2
|
+
import { row, tone } from "./render/tone.js";
|
|
3
|
+
import { canonicalize } from "./workspace-file.js";
|
|
4
4
|
import { Predicate } from "effect";
|
|
5
5
|
import { Doc } from "@effected/cli";
|
|
6
6
|
|
package/cli/ui/walk-screen.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { TONES } from "../render/tone.js";
|
|
2
1
|
import { computeGroupPeers } from "../interop-live.js";
|
|
2
|
+
import { TONES } from "../render/tone.js";
|
|
3
3
|
import { cellTone, displayCandidates, initTable, peerFor, tableDecisions, tableLayout, tableStep } from "../walk-reducer.js";
|
|
4
4
|
import { Fmt } from "@effected/cli";
|
|
5
5
|
import { KeyHelp, KeyTable, Styled, useKeys, useTerminalSize } from "@effected/cli/ui";
|
package/cli/version.js
CHANGED
package/cli/walk-plan.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { detectPeerDrift } from "./drift.js";
|
|
2
2
|
import { derivePeerRange } from "./peer-range.js";
|
|
3
3
|
import { planEntry } from "./plan.js";
|
|
4
|
-
import {
|
|
4
|
+
import { versionKeyOf } from "./version-key.js";
|
|
5
5
|
import { Effect } from "effect";
|
|
6
6
|
|
|
7
7
|
// src/cli/walk-plan.ts
|
package/index.d.ts
CHANGED
|
@@ -83,12 +83,28 @@ interface AllowedVersionsFromCatalogs {
|
|
|
83
83
|
* authored by hand wins over a derived one on the same selector, and the
|
|
84
84
|
* consumer's own `overrides` still win over the plugin's at install time.
|
|
85
85
|
*
|
|
86
|
+
* `include` and `exclude` select which members are pinned, so one catalog can
|
|
87
|
+
* hold both a release family that is pinned graph-wide and packages that are
|
|
88
|
+
* not. Each entry is an exact package name or a glob pattern (`@effect/*`),
|
|
89
|
+
* matched with `effect/Glob` against the whole name; `*` stays within the
|
|
90
|
+
* scope or the bare name. A member matched by both lists is excluded. Every
|
|
91
|
+
* entry must match at least one member, and an empty `include` is rejected,
|
|
92
|
+
* so a typo throws instead of silently widening or narrowing the pin set.
|
|
93
|
+
*
|
|
86
94
|
* @public
|
|
87
95
|
*/
|
|
88
96
|
interface OverridesFromCatalogs {
|
|
89
97
|
/** The catalog whose members are pinned. */
|
|
90
98
|
readonly catalog: string;
|
|
91
|
-
/**
|
|
99
|
+
/**
|
|
100
|
+
* Members to pin, as exact names or glob patterns (`effect`, `@effect/*`);
|
|
101
|
+
* the rest are skipped. Omitted, every member is a candidate.
|
|
102
|
+
*/
|
|
103
|
+
readonly include?: readonly string[];
|
|
104
|
+
/**
|
|
105
|
+
* Members left out, as exact names or glob patterns, e.g. a tool that rides
|
|
106
|
+
* the catalog but is not part of the release family. Wins over `include`.
|
|
107
|
+
*/
|
|
92
108
|
readonly exclude?: readonly string[];
|
|
93
109
|
/**
|
|
94
110
|
* How each selector is scoped. `"line"` (the default) qualifies the package
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rolldown-pnpm-config",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "A dogfooding example of our plugin",
|
|
6
6
|
"repository": {
|
|
@@ -35,16 +35,16 @@
|
|
|
35
35
|
"rolldown-pnpm-config": "bin/rolldown-pnpm-config.js"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@effect/platform-node": "
|
|
39
|
-
"@effected/cli": "^0.
|
|
40
|
-
"@effected/env": "^0.
|
|
41
|
-
"@effected/glob": "^0.
|
|
42
|
-
"@effected/npm": "^0.
|
|
43
|
-
"@effected/semver": "^0.
|
|
44
|
-
"@effected/walker": "^0.
|
|
45
|
-
"@effected/workspaces": "^0.
|
|
46
|
-
"@effected/yaml": "^0.
|
|
47
|
-
"effect": "
|
|
38
|
+
"@effect/platform-node": "~4.1.1",
|
|
39
|
+
"@effected/cli": "^0.25.0",
|
|
40
|
+
"@effected/env": "^0.9.0",
|
|
41
|
+
"@effected/glob": "^0.17.0",
|
|
42
|
+
"@effected/npm": "^0.29.0",
|
|
43
|
+
"@effected/semver": "^0.20.0",
|
|
44
|
+
"@effected/walker": "^0.24.0",
|
|
45
|
+
"@effected/workspaces": "^0.41.0",
|
|
46
|
+
"@effected/yaml": "^0.27.0",
|
|
47
|
+
"effect": "~4.1.1",
|
|
48
48
|
"ink": "^8.0.0",
|
|
49
49
|
"oxc-parser": "^0.156.0",
|
|
50
50
|
"react": "^19.3.1"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { rangeOf } from "../catalogs.js";
|
|
2
2
|
import { bareVersion } from "../semver-util.js";
|
|
3
|
-
import { Predicate } from "effect";
|
|
3
|
+
import { Glob, Predicate } from "effect";
|
|
4
4
|
|
|
5
5
|
// src/plugin/overrides-from-catalogs.ts
|
|
6
6
|
/** A plain release version: `X.Y.Z`, no prerelease, no build metadata. */
|
|
@@ -17,15 +17,29 @@ function releaseLine(major, minor) {
|
|
|
17
17
|
if (major !== "0") return `^${major}.0.0`;
|
|
18
18
|
return minor === "0" ? "~0.0.0" : `^0.${minor}.0`;
|
|
19
19
|
}
|
|
20
|
-
/**
|
|
21
|
-
|
|
20
|
+
/**
|
|
21
|
+
* Compile a filter list into a member predicate, throwing when an entry
|
|
22
|
+
* matches no member (an exact name or a pattern alike).
|
|
23
|
+
*/
|
|
24
|
+
function compileFilter(entries, members, label, catalog) {
|
|
25
|
+
const globs = entries.map((entry) => {
|
|
26
|
+
const glob = Glob.make(entry);
|
|
27
|
+
if (!members.some((name) => Glob.match(glob, name))) throw new Error(`overridesFromCatalogs: ${label} member "${entry}" is not in catalog "${catalog}"`);
|
|
28
|
+
return glob;
|
|
29
|
+
});
|
|
30
|
+
return (name) => globs.some((glob) => Glob.match(glob, name));
|
|
31
|
+
}
|
|
32
|
+
/** Derive the overrides for one directive. Pure; throws when the catalog is absent or a filter entry matches nothing. */
|
|
33
|
+
function deriveOne(catalogs, { catalog, include, exclude = [], scope = "line" }) {
|
|
22
34
|
const decl = catalogs[catalog];
|
|
23
35
|
if (decl === void 0) throw new Error(`overridesFromCatalogs: catalog "${catalog}" is not declared`);
|
|
24
|
-
|
|
25
|
-
const
|
|
36
|
+
if (include?.length === 0) throw new Error(`overridesFromCatalogs: include for catalog "${catalog}" is empty, which would pin nothing`);
|
|
37
|
+
const members = Object.keys(decl.packages);
|
|
38
|
+
const isIncluded = include === void 0 ? () => true : compileFilter(include, members, "included", catalog);
|
|
39
|
+
const isExcluded = compileFilter(exclude, members, "excluded", catalog);
|
|
26
40
|
const table = {};
|
|
27
41
|
for (const [name, spec] of Object.entries(decl.packages)) {
|
|
28
|
-
if (
|
|
42
|
+
if (!isIncluded(name) || isExcluded(name)) continue;
|
|
29
43
|
const range = rangeOf(spec);
|
|
30
44
|
if (!SIMPLE_RANGE.test(range) || /\s/.test(range.trim())) continue;
|
|
31
45
|
const version = bareVersion(range);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { arrayRecordUnion, arrayUnion } from "./arrays.js";
|
|
2
|
-
import { overrides, peerDependencyRules } from "./overrides.js";
|
|
3
2
|
import { catalogs } from "./catalogs.js";
|
|
4
3
|
import { allowBuilds, mapChildWins } from "./maps.js";
|
|
4
|
+
import { overrides, peerDependencyRules } from "./overrides.js";
|
|
5
5
|
import { scalar, securityFlag, securityMin } from "./scalar.js";
|
|
6
6
|
|
|
7
7
|
// src/runtime/strategies/table.ts
|