@contentful/experience-design-system-cli 2.42.1-dev-build-8fa38033.0 → 2.42.1-dev-build-ff9cf9a5.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/dist/app.js +30 -64
- package/dist/index.js +30 -66
- package/dist/package.json +1 -1
- package/dist/src/tui/import/shared/running-step/logic.d.ts +0 -8
- package/dist/src/tui/import/steps/06-extraction/logic.d.ts +5 -12
- package/dist/src/tui/import/steps/06-extraction/screen.d.ts +1 -3
- package/dist/src/tui/import/steps/06-extraction/use-extraction.d.ts +0 -1
- package/dist/src/tui/import/steps/07-scope-gate/screen.d.ts +1 -1
- package/package.json +3 -3
package/dist/app.js
CHANGED
|
@@ -313,7 +313,7 @@ async function finishDebugRun({
|
|
|
313
313
|
if (!await isDebugModeEnabled()) return;
|
|
314
314
|
const durationMs = Date.now() - run.startedAt;
|
|
315
315
|
const log = {
|
|
316
|
-
|
|
316
|
+
folder: logFolder(run.flow, run.step),
|
|
317
317
|
menuOption: run.menuOption,
|
|
318
318
|
content: renderMarkdown(run, { outputs: redact(outputs), status, exitMethod, durationMs })
|
|
319
319
|
};
|
|
@@ -328,7 +328,7 @@ function logFolder(flow, step) {
|
|
|
328
328
|
return flow.startsWith("import/") && /^\d+-/.test(step) ? `import/${step}` : flow;
|
|
329
329
|
}
|
|
330
330
|
async function writeLog(root, log) {
|
|
331
|
-
const dir = join5(root, ...log.
|
|
331
|
+
const dir = join5(root, ...log.folder.split("/"));
|
|
332
332
|
await mkdir2(dir, { recursive: true });
|
|
333
333
|
const filename = nextAttemptFilename(dir, log.menuOption);
|
|
334
334
|
await writeFile2(join5(dir, filename), log.content, { mode: 384 });
|
|
@@ -3054,13 +3054,6 @@ import { Box as Box8, Text as Text8 } from "ink";
|
|
|
3054
3054
|
import { ProgressBar, Spinner, ThemeProvider } from "@inkjs/ui";
|
|
3055
3055
|
|
|
3056
3056
|
// packages/experience-design-system-cli/src/tui/import/shared/running-step/logic.ts
|
|
3057
|
-
function lineState(line) {
|
|
3058
|
-
if (line.state) return line.state;
|
|
3059
|
-
return line.complete ? "done" : "running";
|
|
3060
|
-
}
|
|
3061
|
-
function formatDuration(ms) {
|
|
3062
|
-
return ms < 1e3 ? "<1s" : formatElapsed(Math.round(ms / 1e3));
|
|
3063
|
-
}
|
|
3064
3057
|
function progressPercent(progress) {
|
|
3065
3058
|
if (progress.total <= 0) return 0;
|
|
3066
3059
|
return Math.min(100, Math.max(0, Math.round(progress.done / progress.total * 100)));
|
|
@@ -3096,8 +3089,6 @@ function useElapsed() {
|
|
|
3096
3089
|
|
|
3097
3090
|
// packages/experience-design-system-cli/src/tui/import/shared/running-step/running-step.tsx
|
|
3098
3091
|
import { jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
3099
|
-
var STATE_ICON = { done: "\u2713", warning: "!", failed: "\u2717" };
|
|
3100
|
-
var STATE_COLOR = { done: PALETTE.success, warning: PALETTE.warning, failed: PALETTE.error };
|
|
3101
3092
|
function Line({ line }) {
|
|
3102
3093
|
if (line.progress) {
|
|
3103
3094
|
return /* @__PURE__ */ jsxs8(Box8, { flexDirection: "column", gap: 1, children: [
|
|
@@ -3112,11 +3103,9 @@ function Line({ line }) {
|
|
|
3112
3103
|
/* @__PURE__ */ jsx8(Text8, { color: PALETTE.muted, children: line.text })
|
|
3113
3104
|
] });
|
|
3114
3105
|
}
|
|
3115
|
-
const state2 = lineState(line);
|
|
3116
3106
|
return /* @__PURE__ */ jsxs8(Box8, { gap: 1, children: [
|
|
3117
|
-
|
|
3118
|
-
/* @__PURE__ */ jsx8(Text8, { color:
|
|
3119
|
-
line.ms !== void 0 && /* @__PURE__ */ jsx8(Text8, { color: PALETTE.muted, children: formatDuration(line.ms) })
|
|
3107
|
+
line.complete ? /* @__PURE__ */ jsx8(Text8, { color: PALETTE.success, children: "\u2713" }) : /* @__PURE__ */ jsx8(Spinner, {}),
|
|
3108
|
+
/* @__PURE__ */ jsx8(Text8, { color: PALETTE.muted, children: line.text })
|
|
3120
3109
|
] });
|
|
3121
3110
|
}
|
|
3122
3111
|
function RunningStep({
|
|
@@ -18762,7 +18751,7 @@ function plural(count, noun) {
|
|
|
18762
18751
|
function compositionDone(progress) {
|
|
18763
18752
|
return progress.composition === "done" || progress.composition === "cache-hit";
|
|
18764
18753
|
}
|
|
18765
|
-
function progressRows(progress, agent
|
|
18754
|
+
function progressRows(progress, agent) {
|
|
18766
18755
|
const { scan, composition, selection, existingEntities, tokens } = progress;
|
|
18767
18756
|
const scanned = scan?.scanned ?? 0;
|
|
18768
18757
|
const scanComplete = (scan?.total ?? 0) > 0;
|
|
@@ -18783,23 +18772,16 @@ function progressRows(progress, agent, rowMs = []) {
|
|
|
18783
18772
|
if (existingEntities !== "idle") {
|
|
18784
18773
|
rows.push({
|
|
18785
18774
|
text: existingEntities === "running" ? "Fetching existing components and tokens..." : existingEntities === "complete" ? "Existing components and tokens ready" : "Existing entities unavailable; continuing without them",
|
|
18786
|
-
complete: existingEntities !== "running"
|
|
18787
|
-
// The import carries on without them, so this is not shown as a success.
|
|
18788
|
-
...existingEntities === "failed" ? { state: "warning" } : {}
|
|
18775
|
+
complete: existingEntities !== "running"
|
|
18789
18776
|
});
|
|
18790
18777
|
}
|
|
18791
18778
|
if (tokens !== "idle") {
|
|
18792
18779
|
rows.push({
|
|
18793
18780
|
text: tokens === "complete" ? "Token definitions ready" : tokens === "failed" ? "Token definition generation failed" : `Generating token definitions via ${agent}...`,
|
|
18794
|
-
complete: tokens === "complete"
|
|
18795
|
-
// A failed job is not still running.
|
|
18796
|
-
...tokens === "failed" ? { state: "failed" } : {}
|
|
18781
|
+
complete: tokens === "complete"
|
|
18797
18782
|
});
|
|
18798
18783
|
}
|
|
18799
|
-
return rows
|
|
18800
|
-
}
|
|
18801
|
-
function trackFinished(previous, rows, elapsedMs) {
|
|
18802
|
-
return rows.map((row, index) => previous[index] ?? (lineState(row) === "running" ? void 0 : elapsedMs));
|
|
18784
|
+
return rows;
|
|
18803
18785
|
}
|
|
18804
18786
|
function noComponentsMessage(projectPath) {
|
|
18805
18787
|
return `No components found in ${projectPath}.
|
|
@@ -18828,13 +18810,13 @@ function resolveAgentChoice(flag, stored) {
|
|
|
18828
18810
|
|
|
18829
18811
|
// packages/experience-design-system-cli/src/tui/import/steps/06-extraction/screen.tsx
|
|
18830
18812
|
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
18831
|
-
function ExtractionScreen({ progress, agent
|
|
18813
|
+
function ExtractionScreen({ progress, agent }) {
|
|
18832
18814
|
return /* @__PURE__ */ jsx16(
|
|
18833
18815
|
RunningStep,
|
|
18834
18816
|
{
|
|
18835
18817
|
step: "extraction",
|
|
18836
18818
|
description: "Extracting context from your source files.",
|
|
18837
|
-
lines: progressRows(progress, agent
|
|
18819
|
+
lines: progressRows(progress, agent)
|
|
18838
18820
|
}
|
|
18839
18821
|
);
|
|
18840
18822
|
}
|
|
@@ -19263,12 +19245,9 @@ function useExtraction(input) {
|
|
|
19263
19245
|
progress: initialProgress({
|
|
19264
19246
|
hasCredentials: input.credentials !== null,
|
|
19265
19247
|
hasRawTokens: input.rawTokensPath !== ""
|
|
19266
|
-
})
|
|
19267
|
-
rowMs: []
|
|
19248
|
+
})
|
|
19268
19249
|
});
|
|
19269
19250
|
let lastProgress;
|
|
19270
|
-
const startedAt = Date.now();
|
|
19271
|
-
let rowMs = [];
|
|
19272
19251
|
startDebugRun({
|
|
19273
19252
|
flow: "import/extraction",
|
|
19274
19253
|
step: "06-extraction",
|
|
@@ -19277,8 +19256,7 @@ function useExtraction(input) {
|
|
|
19277
19256
|
});
|
|
19278
19257
|
void runExtraction(input, (progress) => {
|
|
19279
19258
|
lastProgress = progress;
|
|
19280
|
-
|
|
19281
|
-
if (current.current === input) setState({ status: "running", progress, rowMs });
|
|
19259
|
+
if (current.current === input) setState({ status: "running", progress });
|
|
19282
19260
|
}).then((result) => {
|
|
19283
19261
|
if (current.current !== input) return;
|
|
19284
19262
|
void finishDebugRun({
|
|
@@ -21943,27 +21921,12 @@ var HELP_SECTIONS = [
|
|
|
21943
21921
|
]
|
|
21944
21922
|
}
|
|
21945
21923
|
];
|
|
21946
|
-
function ScopeGateScreen(
|
|
21947
|
-
|
|
21948
|
-
|
|
21949
|
-
|
|
21950
|
-
|
|
21951
|
-
|
|
21952
|
-
startDebugRun({
|
|
21953
|
-
flow: "import/scope-gate",
|
|
21954
|
-
step: "07-scope-gate",
|
|
21955
|
-
menuOption: "Scope gate",
|
|
21956
|
-
inputs: scopeGateLogInputs([], 0)
|
|
21957
|
-
});
|
|
21958
|
-
void finishDebugRun({
|
|
21959
|
-
outputs: { outcome: "nothing to decide", error: "No components were found for this session." },
|
|
21960
|
-
status: "error",
|
|
21961
|
-
exitMethod: "discarded"
|
|
21962
|
-
});
|
|
21963
|
-
}, []);
|
|
21964
|
-
return /* @__PURE__ */ jsx29(Box25, { paddingX: 2, paddingY: 1, children: /* @__PURE__ */ jsx29(Text26, { color: PALETTE.error, children: "Error: no components found for this session \u2014 please re-run analyze extract." }) });
|
|
21965
|
-
}
|
|
21966
|
-
function ScopeGateView({ components, tokensPath, onConfirm, onQuit }) {
|
|
21924
|
+
function ScopeGateScreen({
|
|
21925
|
+
components,
|
|
21926
|
+
tokensPath,
|
|
21927
|
+
onConfirm,
|
|
21928
|
+
onQuit
|
|
21929
|
+
}) {
|
|
21967
21930
|
const tokens = useMemo4(() => {
|
|
21968
21931
|
const loaded = tokensPath ? loadTokenRows(tokensPath) : void 0;
|
|
21969
21932
|
return loaded?.ok ? loaded.rows : [];
|
|
@@ -22649,6 +22612,14 @@ function entryErrors(node, prefix) {
|
|
|
22649
22612
|
const type = value["$type"];
|
|
22650
22613
|
const check = type === "component" ? validateComponentEntry : TOKEN_TYPE_SET3.has(type) ? validateTokenEntry : void 0;
|
|
22651
22614
|
if (!check) {
|
|
22615
|
+
if (type !== void 0) {
|
|
22616
|
+
errors.push({
|
|
22617
|
+
path: `${path5}/$type`,
|
|
22618
|
+
message: `Unknown $type "${String(type)}"`,
|
|
22619
|
+
expected: "component or a design token type",
|
|
22620
|
+
actual: String(type)
|
|
22621
|
+
});
|
|
22622
|
+
}
|
|
22652
22623
|
errors.push(...entryErrors(value, path5));
|
|
22653
22624
|
} else if (!check(value)) {
|
|
22654
22625
|
errors.push(...toValidationErrors(check.errors, path5));
|
|
@@ -26980,7 +26951,7 @@ function openReviewTrail(components, now) {
|
|
|
26980
26951
|
};
|
|
26981
26952
|
}
|
|
26982
26953
|
function recordReviewAction(trail, label) {
|
|
26983
|
-
const kind = label.split(":")[0]
|
|
26954
|
+
const kind = label.split(":")[0];
|
|
26984
26955
|
trail.kinds[kind] = (trail.kinds[kind] ?? 0) + 1;
|
|
26985
26956
|
if (trail.actions.length < MAX_ACTIONS) trail.actions.push(label);
|
|
26986
26957
|
}
|
|
@@ -29315,6 +29286,8 @@ function flowContext(state2) {
|
|
|
29315
29286
|
}
|
|
29316
29287
|
function arrive(trail, state2) {
|
|
29317
29288
|
const next = { ...trail, at: state2.step };
|
|
29289
|
+
delete next.failure;
|
|
29290
|
+
delete next.validation;
|
|
29318
29291
|
if (state2.step === "error") {
|
|
29319
29292
|
next.failure = { step: state2.errorStep, message: scrub(state2.errorMessage, state2) };
|
|
29320
29293
|
}
|
|
@@ -31855,14 +31828,7 @@ function App({ importOptions, inkClear }) {
|
|
|
31855
31828
|
return /* @__PURE__ */ jsx66(ErrorStep, { stepName: extraction.result.step, message: extraction.result.message, onExit: leaveImport });
|
|
31856
31829
|
}
|
|
31857
31830
|
if (extraction?.status === "running") {
|
|
31858
|
-
return /* @__PURE__ */ jsx66(
|
|
31859
|
-
ExtractionScreen,
|
|
31860
|
-
{
|
|
31861
|
-
progress: extraction.progress,
|
|
31862
|
-
agent: extractionRun.input.agent,
|
|
31863
|
-
rowMs: extraction.rowMs
|
|
31864
|
-
}
|
|
31865
|
-
);
|
|
31831
|
+
return /* @__PURE__ */ jsx66(ExtractionScreen, { progress: extraction.progress, agent: extractionRun.input.agent });
|
|
31866
31832
|
}
|
|
31867
31833
|
return /* @__PURE__ */ jsx66(Fragment22, {});
|
|
31868
31834
|
}
|
package/dist/index.js
CHANGED
|
@@ -19616,7 +19616,7 @@ async function finishDebugRun({
|
|
|
19616
19616
|
if (!await isDebugModeEnabled()) return;
|
|
19617
19617
|
const durationMs = Date.now() - run.startedAt;
|
|
19618
19618
|
const log = {
|
|
19619
|
-
|
|
19619
|
+
folder: logFolder(run.flow, run.step),
|
|
19620
19620
|
menuOption: run.menuOption,
|
|
19621
19621
|
content: renderMarkdown(run, { outputs: redact(outputs), status, exitMethod, durationMs })
|
|
19622
19622
|
};
|
|
@@ -19631,7 +19631,7 @@ function logFolder(flow, step) {
|
|
|
19631
19631
|
return flow.startsWith("import/") && /^\d+-/.test(step) ? `import/${step}` : flow;
|
|
19632
19632
|
}
|
|
19633
19633
|
async function writeLog(root, log) {
|
|
19634
|
-
const dir = join19(root, ...log.
|
|
19634
|
+
const dir = join19(root, ...log.folder.split("/"));
|
|
19635
19635
|
await mkdir7(dir, { recursive: true });
|
|
19636
19636
|
const filename = nextAttemptFilename(dir, log.menuOption);
|
|
19637
19637
|
await writeFile7(join19(dir, filename), log.content, { mode: 384 });
|
|
@@ -20138,13 +20138,6 @@ var init_overview_box = __esm({
|
|
|
20138
20138
|
});
|
|
20139
20139
|
|
|
20140
20140
|
// packages/experience-design-system-cli/src/tui/import/shared/running-step/logic.ts
|
|
20141
|
-
function lineState(line) {
|
|
20142
|
-
if (line.state) return line.state;
|
|
20143
|
-
return line.complete ? "done" : "running";
|
|
20144
|
-
}
|
|
20145
|
-
function formatDuration(ms) {
|
|
20146
|
-
return ms < 1e3 ? "<1s" : formatElapsed(Math.round(ms / 1e3));
|
|
20147
|
-
}
|
|
20148
20141
|
function progressPercent(progress) {
|
|
20149
20142
|
if (progress.total <= 0) return 0;
|
|
20150
20143
|
return Math.min(100, Math.max(0, Math.round(progress.done / progress.total * 100)));
|
|
@@ -20214,11 +20207,9 @@ function Line({ line }) {
|
|
|
20214
20207
|
/* @__PURE__ */ jsx8(Text8, { color: PALETTE.muted, children: line.text })
|
|
20215
20208
|
] });
|
|
20216
20209
|
}
|
|
20217
|
-
const state2 = lineState(line);
|
|
20218
20210
|
return /* @__PURE__ */ jsxs8(Box8, { gap: 1, children: [
|
|
20219
|
-
|
|
20220
|
-
/* @__PURE__ */ jsx8(Text8, { color:
|
|
20221
|
-
line.ms !== void 0 && /* @__PURE__ */ jsx8(Text8, { color: PALETTE.muted, children: formatDuration(line.ms) })
|
|
20211
|
+
line.complete ? /* @__PURE__ */ jsx8(Text8, { color: PALETTE.success, children: "\u2713" }) : /* @__PURE__ */ jsx8(Spinner, {}),
|
|
20212
|
+
/* @__PURE__ */ jsx8(Text8, { color: PALETTE.muted, children: line.text })
|
|
20222
20213
|
] });
|
|
20223
20214
|
}
|
|
20224
20215
|
function RunningStep({
|
|
@@ -20239,7 +20230,6 @@ function RunningStep({
|
|
|
20239
20230
|
] })
|
|
20240
20231
|
] });
|
|
20241
20232
|
}
|
|
20242
|
-
var STATE_ICON, STATE_COLOR;
|
|
20243
20233
|
var init_running_step = __esm({
|
|
20244
20234
|
"packages/experience-design-system-cli/src/tui/import/shared/running-step/running-step.tsx"() {
|
|
20245
20235
|
"use strict";
|
|
@@ -20248,8 +20238,6 @@ var init_running_step = __esm({
|
|
|
20248
20238
|
init_theme2();
|
|
20249
20239
|
init_StepHeader();
|
|
20250
20240
|
init_use_elapsed();
|
|
20251
|
-
STATE_ICON = { done: "\u2713", warning: "!", failed: "\u2717" };
|
|
20252
|
-
STATE_COLOR = { done: PALETTE.success, warning: PALETTE.warning, failed: PALETTE.error };
|
|
20253
20241
|
}
|
|
20254
20242
|
});
|
|
20255
20243
|
|
|
@@ -21547,7 +21535,7 @@ function plural(count, noun) {
|
|
|
21547
21535
|
function compositionDone(progress) {
|
|
21548
21536
|
return progress.composition === "done" || progress.composition === "cache-hit";
|
|
21549
21537
|
}
|
|
21550
|
-
function progressRows(progress, agent
|
|
21538
|
+
function progressRows(progress, agent) {
|
|
21551
21539
|
const { scan, composition, selection, existingEntities, tokens } = progress;
|
|
21552
21540
|
const scanned = scan?.scanned ?? 0;
|
|
21553
21541
|
const scanComplete = (scan?.total ?? 0) > 0;
|
|
@@ -21568,23 +21556,16 @@ function progressRows(progress, agent, rowMs = []) {
|
|
|
21568
21556
|
if (existingEntities !== "idle") {
|
|
21569
21557
|
rows.push({
|
|
21570
21558
|
text: existingEntities === "running" ? "Fetching existing components and tokens..." : existingEntities === "complete" ? "Existing components and tokens ready" : "Existing entities unavailable; continuing without them",
|
|
21571
|
-
complete: existingEntities !== "running"
|
|
21572
|
-
// The import carries on without them, so this is not shown as a success.
|
|
21573
|
-
...existingEntities === "failed" ? { state: "warning" } : {}
|
|
21559
|
+
complete: existingEntities !== "running"
|
|
21574
21560
|
});
|
|
21575
21561
|
}
|
|
21576
21562
|
if (tokens !== "idle") {
|
|
21577
21563
|
rows.push({
|
|
21578
21564
|
text: tokens === "complete" ? "Token definitions ready" : tokens === "failed" ? "Token definition generation failed" : `Generating token definitions via ${agent}...`,
|
|
21579
|
-
complete: tokens === "complete"
|
|
21580
|
-
// A failed job is not still running.
|
|
21581
|
-
...tokens === "failed" ? { state: "failed" } : {}
|
|
21565
|
+
complete: tokens === "complete"
|
|
21582
21566
|
});
|
|
21583
21567
|
}
|
|
21584
|
-
return rows
|
|
21585
|
-
}
|
|
21586
|
-
function trackFinished(previous, rows, elapsedMs) {
|
|
21587
|
-
return rows.map((row, index) => previous[index] ?? (lineState(row) === "running" ? void 0 : elapsedMs));
|
|
21568
|
+
return rows;
|
|
21588
21569
|
}
|
|
21589
21570
|
function noComponentsMessage(projectPath) {
|
|
21590
21571
|
return `No components found in ${projectPath}.
|
|
@@ -21615,19 +21596,18 @@ var init_logic9 = __esm({
|
|
|
21615
21596
|
"use strict";
|
|
21616
21597
|
init_src3();
|
|
21617
21598
|
init_debug_trail();
|
|
21618
|
-
init_logic4();
|
|
21619
21599
|
}
|
|
21620
21600
|
});
|
|
21621
21601
|
|
|
21622
21602
|
// packages/experience-design-system-cli/src/tui/import/steps/06-extraction/screen.tsx
|
|
21623
21603
|
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
21624
|
-
function ExtractionScreen({ progress, agent
|
|
21604
|
+
function ExtractionScreen({ progress, agent }) {
|
|
21625
21605
|
return /* @__PURE__ */ jsx16(
|
|
21626
21606
|
RunningStep,
|
|
21627
21607
|
{
|
|
21628
21608
|
step: "extraction",
|
|
21629
21609
|
description: "Extracting context from your source files.",
|
|
21630
|
-
lines: progressRows(progress, agent
|
|
21610
|
+
lines: progressRows(progress, agent)
|
|
21631
21611
|
}
|
|
21632
21612
|
);
|
|
21633
21613
|
}
|
|
@@ -22112,12 +22092,9 @@ function useExtraction(input) {
|
|
|
22112
22092
|
progress: initialProgress({
|
|
22113
22093
|
hasCredentials: input.credentials !== null,
|
|
22114
22094
|
hasRawTokens: input.rawTokensPath !== ""
|
|
22115
|
-
})
|
|
22116
|
-
rowMs: []
|
|
22095
|
+
})
|
|
22117
22096
|
});
|
|
22118
22097
|
let lastProgress;
|
|
22119
|
-
const startedAt = Date.now();
|
|
22120
|
-
let rowMs = [];
|
|
22121
22098
|
startDebugRun({
|
|
22122
22099
|
flow: "import/extraction",
|
|
22123
22100
|
step: "06-extraction",
|
|
@@ -22126,8 +22103,7 @@ function useExtraction(input) {
|
|
|
22126
22103
|
});
|
|
22127
22104
|
void runExtraction(input, (progress) => {
|
|
22128
22105
|
lastProgress = progress;
|
|
22129
|
-
|
|
22130
|
-
if (current.current === input) setState({ status: "running", progress, rowMs });
|
|
22106
|
+
if (current.current === input) setState({ status: "running", progress });
|
|
22131
22107
|
}).then((result) => {
|
|
22132
22108
|
if (current.current !== input) return;
|
|
22133
22109
|
void finishDebugRun({
|
|
@@ -25002,27 +24978,12 @@ var init_use_scope_gate = __esm({
|
|
|
25002
24978
|
import { useEffect as useEffect14, useMemo as useMemo4 } from "react";
|
|
25003
24979
|
import { Box as Box25, Text as Text26 } from "ink";
|
|
25004
24980
|
import { Fragment as Fragment5, jsx as jsx29, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
25005
|
-
function ScopeGateScreen(
|
|
25006
|
-
|
|
25007
|
-
|
|
25008
|
-
|
|
25009
|
-
|
|
25010
|
-
|
|
25011
|
-
startDebugRun({
|
|
25012
|
-
flow: "import/scope-gate",
|
|
25013
|
-
step: "07-scope-gate",
|
|
25014
|
-
menuOption: "Scope gate",
|
|
25015
|
-
inputs: scopeGateLogInputs([], 0)
|
|
25016
|
-
});
|
|
25017
|
-
void finishDebugRun({
|
|
25018
|
-
outputs: { outcome: "nothing to decide", error: "No components were found for this session." },
|
|
25019
|
-
status: "error",
|
|
25020
|
-
exitMethod: "discarded"
|
|
25021
|
-
});
|
|
25022
|
-
}, []);
|
|
25023
|
-
return /* @__PURE__ */ jsx29(Box25, { paddingX: 2, paddingY: 1, children: /* @__PURE__ */ jsx29(Text26, { color: PALETTE.error, children: "Error: no components found for this session \u2014 please re-run analyze extract." }) });
|
|
25024
|
-
}
|
|
25025
|
-
function ScopeGateView({ components, tokensPath, onConfirm, onQuit }) {
|
|
24981
|
+
function ScopeGateScreen({
|
|
24982
|
+
components,
|
|
24983
|
+
tokensPath,
|
|
24984
|
+
onConfirm,
|
|
24985
|
+
onQuit
|
|
24986
|
+
}) {
|
|
25026
24987
|
const tokens = useMemo4(() => {
|
|
25027
24988
|
const loaded = tokensPath ? loadTokenRows(tokensPath) : void 0;
|
|
25028
24989
|
return loaded?.ok ? loaded.rows : [];
|
|
@@ -25842,6 +25803,14 @@ function entryErrors(node, prefix) {
|
|
|
25842
25803
|
const type = value["$type"];
|
|
25843
25804
|
const check = type === "component" ? validateComponentEntry : TOKEN_TYPE_SET3.has(type) ? validateTokenEntry : void 0;
|
|
25844
25805
|
if (!check) {
|
|
25806
|
+
if (type !== void 0) {
|
|
25807
|
+
errors.push({
|
|
25808
|
+
path: `${path5}/$type`,
|
|
25809
|
+
message: `Unknown $type "${String(type)}"`,
|
|
25810
|
+
expected: "component or a design token type",
|
|
25811
|
+
actual: String(type)
|
|
25812
|
+
});
|
|
25813
|
+
}
|
|
25845
25814
|
errors.push(...entryErrors(value, path5));
|
|
25846
25815
|
} else if (!check(value)) {
|
|
25847
25816
|
errors.push(...toValidationErrors(check.errors, path5));
|
|
@@ -30551,7 +30520,7 @@ function openReviewTrail(components, now) {
|
|
|
30551
30520
|
};
|
|
30552
30521
|
}
|
|
30553
30522
|
function recordReviewAction(trail, label) {
|
|
30554
|
-
const kind = label.split(":")[0]
|
|
30523
|
+
const kind = label.split(":")[0];
|
|
30555
30524
|
trail.kinds[kind] = (trail.kinds[kind] ?? 0) + 1;
|
|
30556
30525
|
if (trail.actions.length < MAX_ACTIONS) trail.actions.push(label);
|
|
30557
30526
|
}
|
|
@@ -33042,6 +33011,8 @@ function flowContext(state2) {
|
|
|
33042
33011
|
}
|
|
33043
33012
|
function arrive(trail, state2) {
|
|
33044
33013
|
const next = { ...trail, at: state2.step };
|
|
33014
|
+
delete next.failure;
|
|
33015
|
+
delete next.validation;
|
|
33045
33016
|
if (state2.step === "error") {
|
|
33046
33017
|
next.failure = { step: state2.errorStep, message: scrub(state2.errorMessage, state2) };
|
|
33047
33018
|
}
|
|
@@ -35714,14 +35685,7 @@ function App({ importOptions, inkClear }) {
|
|
|
35714
35685
|
return /* @__PURE__ */ jsx66(ErrorStep, { stepName: extraction.result.step, message: extraction.result.message, onExit: leaveImport });
|
|
35715
35686
|
}
|
|
35716
35687
|
if (extraction?.status === "running") {
|
|
35717
|
-
return /* @__PURE__ */ jsx66(
|
|
35718
|
-
ExtractionScreen,
|
|
35719
|
-
{
|
|
35720
|
-
progress: extraction.progress,
|
|
35721
|
-
agent: extractionRun.input.agent,
|
|
35722
|
-
rowMs: extraction.rowMs
|
|
35723
|
-
}
|
|
35724
|
-
);
|
|
35688
|
+
return /* @__PURE__ */ jsx66(ExtractionScreen, { progress: extraction.progress, agent: extractionRun.input.agent });
|
|
35725
35689
|
}
|
|
35726
35690
|
return /* @__PURE__ */ jsx66(Fragment22, {});
|
|
35727
35691
|
}
|
package/dist/package.json
CHANGED
|
@@ -5,15 +5,7 @@ export interface Progress {
|
|
|
5
5
|
export interface RunningLine {
|
|
6
6
|
text: string;
|
|
7
7
|
complete?: boolean;
|
|
8
|
-
/** Set for a row that ended badly. A warning carries on without it; a failure does not. Otherwise `complete` decides. */
|
|
9
|
-
state?: 'warning' | 'failed';
|
|
10
8
|
progress?: Progress;
|
|
11
|
-
/** How long the row took, once it has finished. */
|
|
12
|
-
ms?: number;
|
|
13
9
|
}
|
|
14
|
-
export type LineState = 'running' | 'done' | 'warning' | 'failed';
|
|
15
|
-
/** What a row looks like. A row that ended badly is never shown as running or as done. */
|
|
16
|
-
export declare function lineState(line: RunningLine): LineState;
|
|
17
|
-
export declare function formatDuration(ms: number): string;
|
|
18
10
|
export declare function progressPercent(progress: Progress): number;
|
|
19
11
|
export declare function formatElapsed(totalSeconds: number): string;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { ExtractAndComposeProgress } from '@contentful/experience-design-system-backend-pipeline';
|
|
2
|
-
import { type RunningLine } from '../../shared/running-step/logic.js';
|
|
3
2
|
import type { ExtractionInput, ExtractionProgress, ExtractionResult } from './types.js';
|
|
4
3
|
/** Structured progress events emitted by the orchestrator (extraction + composition). */
|
|
5
4
|
export type ProgressEvent = ExtractAndComposeProgress;
|
|
@@ -25,17 +24,11 @@ export declare function initialProgress(input: {
|
|
|
25
24
|
hasRawTokens: boolean;
|
|
26
25
|
}): ExtractionProgress;
|
|
27
26
|
export declare function applyProgressEvent(progress: ExtractionProgress, event: ProgressEvent): ExtractionProgress;
|
|
28
|
-
/**
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* How long each row took, by position, for the rows that have finished. The jobs all start together, so a row's time is how
|
|
35
|
-
* long the run had been going when it was first seen finished, and it does not change after that. Rows keep their position
|
|
36
|
-
* for the whole run, since every job that applies is started up front.
|
|
37
|
-
*/
|
|
38
|
-
export declare function trackFinished(previous: ReadonlyArray<number | undefined>, rows: readonly RunningLine[], elapsedMs: number): Array<number | undefined>;
|
|
27
|
+
/** The rows the screen shows, in the order the wizard showed them. Rows that do not apply are left out. */
|
|
28
|
+
export declare function progressRows(progress: ExtractionProgress, agent: string): Array<{
|
|
29
|
+
text: string;
|
|
30
|
+
complete: boolean;
|
|
31
|
+
}>;
|
|
39
32
|
/** True when every job is already done, so the screen would only flash. The wizard shows nothing in this case. */
|
|
40
33
|
export declare function isFullCacheHit(progress: ExtractionProgress): boolean;
|
|
41
34
|
export declare function noComponentsMessage(projectPath: string): string;
|
|
@@ -3,8 +3,6 @@ import type { ExtractionProgress } from './types.js';
|
|
|
3
3
|
interface ExtractionScreenProps {
|
|
4
4
|
progress: ExtractionProgress;
|
|
5
5
|
agent: string;
|
|
6
|
-
/** How long each finished row took, by position. */
|
|
7
|
-
rowMs?: ReadonlyArray<number | undefined>;
|
|
8
6
|
}
|
|
9
|
-
export declare function ExtractionScreen({ progress, agent
|
|
7
|
+
export declare function ExtractionScreen({ progress, agent }: ExtractionScreenProps): React.ReactElement;
|
|
10
8
|
export {};
|
|
@@ -6,5 +6,5 @@ interface ScopeGateScreenProps {
|
|
|
6
6
|
onConfirm: (decisions: ScopeDecisions) => void;
|
|
7
7
|
onQuit: () => void;
|
|
8
8
|
}
|
|
9
|
-
export declare function ScopeGateScreen(
|
|
9
|
+
export declare function ScopeGateScreen({ components, tokensPath, onConfirm, onQuit, }: ScopeGateScreenProps): React.ReactElement;
|
|
10
10
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentful/experience-design-system-cli",
|
|
3
|
-
"version": "2.42.1-dev-build-
|
|
3
|
+
"version": "2.42.1-dev-build-ff9cf9a5.0",
|
|
4
4
|
"description": "Contentful Experiences design system import CLI",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"ts-morph": "^27.0.2",
|
|
46
46
|
"typescript": "^5.9.3",
|
|
47
47
|
"zod": "^4.6.5",
|
|
48
|
-
"@contentful/experience-design-system-types": "2.42.1-dev-build-
|
|
48
|
+
"@contentful/experience-design-system-types": "2.42.1-dev-build-ff9cf9a5.0"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@tsconfig/node24": "^24.0.4",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"ink-testing-library": "^4.0.0",
|
|
60
60
|
"typescript-eslint": "^8.67.0",
|
|
61
61
|
"vitest": "^4.0.16",
|
|
62
|
-
"@contentful/experience-design-system-backend-pipeline": "2.42.1-dev-build-
|
|
62
|
+
"@contentful/experience-design-system-backend-pipeline": "2.42.1-dev-build-ff9cf9a5.0"
|
|
63
63
|
},
|
|
64
64
|
"repository": {
|
|
65
65
|
"type": "git",
|