rolldown-pnpm-config 1.0.11 → 2.0.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/ui/ansi.js DELETED
@@ -1,20 +0,0 @@
1
- import { paint, tagSuffix } from "./styled.js";
2
-
3
- //#region src/cli/ui/ansi.ts
4
- /**
5
- * Render styled lines to a string. Each line is
6
- * `<gutter><space><2-space-indent><painted segments><tag>`.
7
- * Pure: color is decided by the caller, never read from the environment.
8
- *
9
- * @internal
10
- */
11
- function toAnsi(lines, opts) {
12
- return lines.map((l) => {
13
- const indent = " ".repeat(l.indent);
14
- const body = l.segments.map((s) => paint(s.text, s.style, opts.color)).join("");
15
- return `${l.gutter} ${indent}${body}${tagSuffix(l.tag, opts.color)}`;
16
- }).join("\n");
17
- }
18
-
19
- //#endregion
20
- export { toAnsi };
package/cli/ui/env.js DELETED
@@ -1,18 +0,0 @@
1
- import { hasTTY, isAgent, isCI, isColorSupported } from "std-env";
2
-
3
- //#region src/cli/ui/env.ts
4
- /**
5
- * Detect color / interactivity once, at the command edge.
6
- * The render layer consumes the returned flags and never reads the environment.
7
- *
8
- * @internal
9
- */
10
- function detectCapabilities() {
11
- return {
12
- color: isColorSupported,
13
- interactive: hasTTY && !isCI && !isAgent
14
- };
15
- }
16
-
17
- //#endregion
18
- export { detectCapabilities };
package/cli/ui/legend.js DELETED
@@ -1,80 +0,0 @@
1
- //#region src/cli/ui/legend.ts
2
- /**
3
- * The color legend for the config diff (the `preview` command and
4
- * `export --dry-run`). A single styled line whose swatches each carry the
5
- * matching `ChangeStyle`, so the legend automatically tracks the palette.
6
- * Callers prepend it only when color is on — with color off the swatches are
7
- * indistinguishable and the legend is just noise.
8
- *
9
- * @internal
10
- */
11
- function legendLines() {
12
- return [{
13
- indent: 0,
14
- gutter: " ",
15
- segments: [
16
- {
17
- text: "Legend: ",
18
- style: "plain"
19
- },
20
- {
21
- text: "■ added ",
22
- style: "added"
23
- },
24
- {
25
- text: "■ removed ",
26
- style: "removed"
27
- },
28
- {
29
- text: "■ modified ",
30
- style: "changed"
31
- },
32
- {
33
- text: "■ unchanged ",
34
- style: "unchanged"
35
- },
36
- {
37
- text: "■ unmanaged",
38
- style: "unmanaged"
39
- }
40
- ]
41
- }];
42
- }
43
- /**
44
- * The legend for the Simulated view. That view is not a diff — nothing is added
45
- * or removed — so it gets its own vocabulary: how each field is combined
46
- * (`merge`/`overwrite`) and how divergence is enforced (`warn`/`error`).
47
- *
48
- * @internal
49
- */
50
- function simulatedLegendLines() {
51
- return [{
52
- indent: 0,
53
- gutter: " ",
54
- segments: [
55
- {
56
- text: "Legend: ",
57
- style: "plain"
58
- },
59
- {
60
- text: "■ merge ",
61
- style: "merge"
62
- },
63
- {
64
- text: "■ overwrite ",
65
- style: "overwrite"
66
- },
67
- {
68
- text: "■ warn ",
69
- style: "changed"
70
- },
71
- {
72
- text: "■ error",
73
- style: "warn"
74
- }
75
- ]
76
- }];
77
- }
78
-
79
- //#endregion
80
- export { legendLines, simulatedLegendLines };
@@ -1,22 +0,0 @@
1
- import { Preview } from "./Preview.js";
2
- import { Effect } from "effect";
3
- import { render } from "ink";
4
- import { createElement } from "react";
5
-
6
- //#region src/cli/ui/run-preview.ts
7
- /**
8
- * Render the interactive Preview inside an Effect, resolving once the user
9
- * exits and Ink has fully torn down. An Ink crash rejects `waitUntilExit()`,
10
- * which `Effect.promise` surfaces as a defect rather than a hung fiber.
11
- *
12
- * @internal
13
- */
14
- function runPreview(views) {
15
- return Effect.promise(() => render(createElement(Preview, {
16
- views,
17
- onExit: () => {}
18
- })).waitUntilExit());
19
- }
20
-
21
- //#endregion
22
- export { runPreview };
@@ -1,33 +0,0 @@
1
- import { Walk } from "./Walk.js";
2
- import { Effect } from "effect";
3
- import { render } from "ink";
4
- import { createElement } from "react";
5
-
6
- //#region src/cli/ui/run-walk.ts
7
- /**
8
- * Render the interactive table inside an Effect, resolving with the collected
9
- * decisions once the user submits (or with an empty list when they cancel with
10
- * Esc, or when no rows are actionable), after Ink has fully exited. An Ink
11
- * crash rejects `waitUntilExit()`, which `Effect.promise` surfaces as a
12
- * defect rather than a hung fiber.
13
- *
14
- * @internal
15
- */
16
- function runWalk(items, dryRun = false, unresolved = [], interopModels = /* @__PURE__ */ new Map()) {
17
- return Effect.promise(async () => {
18
- let collected = [];
19
- await render(createElement(Walk, {
20
- items,
21
- dryRun,
22
- unresolved,
23
- interopModels,
24
- onDone: (d) => {
25
- collected = d;
26
- }
27
- })).waitUntilExit();
28
- return [...collected];
29
- });
30
- }
31
-
32
- //#endregion
33
- export { runWalk };
package/cli/ui/styled.js DELETED
@@ -1,36 +0,0 @@
1
- //#region src/cli/ui/styled.ts
2
- /** SGR open/close codes per style (close is always 0=reset for simplicity). @internal */
3
- const ANSI_OPEN = {
4
- added: "\x1B[32m",
5
- removed: "\x1B[31m",
6
- changed: "\x1B[33m",
7
- warn: "\x1B[31m",
8
- local: "\x1B[35m",
9
- unmanaged: "\x1B[38;5;240m",
10
- unchanged: "\x1B[2m",
11
- plain: "",
12
- merge: "\x1B[36m",
13
- overwrite: "\x1B[35m"
14
- };
15
- const ANSI_RESET = "\x1B[0m";
16
- /** Apply (or omit) the SGR code for a style. @internal */
17
- function paint(text, style, color) {
18
- if (!color || style === "plain" || ANSI_OPEN[style] === "") return text;
19
- return `${ANSI_OPEN[style]}${text}${ANSI_RESET}`;
20
- }
21
- /**
22
- * The trailing annotation for a tag, e.g. " (local)". With color on, the
23
- * `unmanaged` tag is dropped — the dedicated gray shade plus the legend already
24
- * convey it — but it is kept when color is off, where the shade is invisible and
25
- * the tag is the only signal (the tags-stay-meaningful-without-color contract).
26
- *
27
- * @internal
28
- */
29
- function tagSuffix(tag, color) {
30
- if (tag === "local") return " (local)";
31
- if (tag === "unmanaged") return color ? "" : " (unmanaged)";
32
- return "";
33
- }
34
-
35
- //#endregion
36
- export { ANSI_OPEN, paint, tagSuffix };