@contentful/experience-design-system-cli 2.42.1-dev-build-8fa38033.0 → 2.42.1-dev-build-15c351c1.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 +11 -40
- package/dist/index.js +11 -42
- 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/package.json +3 -3
package/dist/app.js
CHANGED
|
@@ -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({
|
|
@@ -31855,14 +31833,7 @@ function App({ importOptions, inkClear }) {
|
|
|
31855
31833
|
return /* @__PURE__ */ jsx66(ErrorStep, { stepName: extraction.result.step, message: extraction.result.message, onExit: leaveImport });
|
|
31856
31834
|
}
|
|
31857
31835
|
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
|
-
);
|
|
31836
|
+
return /* @__PURE__ */ jsx66(ExtractionScreen, { progress: extraction.progress, agent: extractionRun.input.agent });
|
|
31866
31837
|
}
|
|
31867
31838
|
return /* @__PURE__ */ jsx66(Fragment22, {});
|
|
31868
31839
|
}
|
package/dist/index.js
CHANGED
|
@@ -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({
|
|
@@ -35714,14 +35690,7 @@ function App({ importOptions, inkClear }) {
|
|
|
35714
35690
|
return /* @__PURE__ */ jsx66(ErrorStep, { stepName: extraction.result.step, message: extraction.result.message, onExit: leaveImport });
|
|
35715
35691
|
}
|
|
35716
35692
|
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
|
-
);
|
|
35693
|
+
return /* @__PURE__ */ jsx66(ExtractionScreen, { progress: extraction.progress, agent: extractionRun.input.agent });
|
|
35725
35694
|
}
|
|
35726
35695
|
return /* @__PURE__ */ jsx66(Fragment22, {});
|
|
35727
35696
|
}
|
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 {};
|
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-15c351c1.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-15c351c1.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-15c351c1.0"
|
|
63
63
|
},
|
|
64
64
|
"repository": {
|
|
65
65
|
"type": "git",
|