@contentful/experience-design-system-cli 2.42.1-dev-build-35573a04.0 → 2.42.1-dev-build-62049584.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 +1171 -1000
- package/dist/index.js +1202 -1001
- package/dist/package.json +1 -1
- package/dist/src/tui/import/shared/running-step/activity-panel.d.ts +15 -0
- package/dist/src/tui/import/shared/running-step/activity.d.ts +26 -0
- package/dist/src/tui/import/shared/running-step/logic.d.ts +16 -0
- package/dist/src/tui/import/shared/running-step/running-step.d.ts +3 -1
- package/dist/src/tui/import/steps/06-extraction/logic.d.ts +6 -5
- package/dist/src/tui/import/steps/06-extraction/screen.d.ts +3 -1
- package/dist/src/tui/import/steps/06-extraction/use-extraction.d.ts +1 -0
- package/dist/src/tui/import/steps/08-generation/logic.d.ts +10 -8
- package/dist/src/tui/import/steps/08-generation/screen.d.ts +3 -1
- package/dist/src/tui/import/steps/08-generation/types.d.ts +8 -1
- package/dist/src/tui/import/steps/08-generation/use-generation.d.ts +1 -0
- package/dist/src/tui/import/steps/10-flow/support/push-progress.d.ts +20 -0
- package/package.json +3 -3
package/dist/package.json
CHANGED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type ActivityItem } from './activity.js';
|
|
3
|
+
/** A rolling log of what a long step has done, beside it on a wide terminal and under it on a narrow one. */
|
|
4
|
+
export declare function ActivityPanel({ title, items }: {
|
|
5
|
+
title: string;
|
|
6
|
+
items: readonly ActivityItem[];
|
|
7
|
+
}): React.ReactElement;
|
|
8
|
+
/**
|
|
9
|
+
* Lays out a step with its panel: the panel goes beside the step on a wide terminal and under it on a narrow one. A step
|
|
10
|
+
* with no panel is returned exactly as it is.
|
|
11
|
+
*/
|
|
12
|
+
export declare function AsideLayout({ aside, children, }: {
|
|
13
|
+
aside?: React.ReactNode;
|
|
14
|
+
children: React.ReactNode;
|
|
15
|
+
}): React.ReactElement;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
type ActivityState = 'running' | 'done' | 'failed';
|
|
2
|
+
export interface ActivityItem {
|
|
3
|
+
name: string;
|
|
4
|
+
state: ActivityState;
|
|
5
|
+
/** A short note after the name, for example "cached" or "create component". */
|
|
6
|
+
detail?: string;
|
|
7
|
+
/** How long it took, once it has finished. */
|
|
8
|
+
ms?: number;
|
|
9
|
+
/** Why it failed. */
|
|
10
|
+
error?: string;
|
|
11
|
+
/** When it started, so its time can be worked out when it finishes. */
|
|
12
|
+
startedAt?: number;
|
|
13
|
+
}
|
|
14
|
+
export declare const PANEL_COLUMNS = 46;
|
|
15
|
+
export declare function panelLayout(columns: number): 'beside' | 'below';
|
|
16
|
+
/**
|
|
17
|
+
* The entries that fit. A long run has far more entries than lines, and what a person needs is the failures and what is
|
|
18
|
+
* running now, so those are kept first and the newest finished entries fill what is left. The entries stay in the order
|
|
19
|
+
* they happened. `hidden` is how many were left out.
|
|
20
|
+
*/
|
|
21
|
+
export declare function visibleActivity(items: readonly ActivityItem[], max: number): {
|
|
22
|
+
shown: ActivityItem[];
|
|
23
|
+
hidden: number;
|
|
24
|
+
};
|
|
25
|
+
export declare function truncate(text: string, max: number): string;
|
|
26
|
+
export {};
|
|
@@ -5,7 +5,23 @@ 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';
|
|
8
10
|
progress?: Progress;
|
|
11
|
+
/** How long the row took, once it has finished. */
|
|
12
|
+
ms?: number;
|
|
9
13
|
}
|
|
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
|
+
/**
|
|
19
|
+
* How long each row took, by position, for the rows that have finished. A row's time is how long the run had been going
|
|
20
|
+
* when it was first seen finished, and it does not change after that. Rows keep their position for the whole run, so a row
|
|
21
|
+
* that appears later is added at the end.
|
|
22
|
+
*/
|
|
23
|
+
export declare function trackFinished(previous: ReadonlyArray<number | undefined>, rows: readonly RunningLine[], elapsedMs: number): Array<number | undefined>;
|
|
24
|
+
/** The rows with the time each finished row took, by position. */
|
|
25
|
+
export declare function withTimes(rows: RunningLine[], rowMs: ReadonlyArray<number | undefined>): RunningLine[];
|
|
10
26
|
export declare function progressPercent(progress: Progress): number;
|
|
11
27
|
export declare function formatElapsed(totalSeconds: number): string;
|
|
@@ -5,6 +5,8 @@ interface RunningStepProps {
|
|
|
5
5
|
step: ImportStepId;
|
|
6
6
|
description: string;
|
|
7
7
|
lines?: readonly RunningLine[];
|
|
8
|
+
/** A panel shown beside the step, or under it on a narrow terminal. */
|
|
9
|
+
aside?: React.ReactNode;
|
|
8
10
|
}
|
|
9
|
-
export declare function RunningStep({ step, description, lines, }: RunningStepProps): React.ReactElement;
|
|
11
|
+
export declare function RunningStep({ step, description, lines, aside, }: RunningStepProps): React.ReactElement;
|
|
10
12
|
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ExtractAndComposeProgress } from '@contentful/experience-design-system-backend-pipeline';
|
|
2
|
+
import { type RunningLine } from '../../shared/running-step/logic.js';
|
|
2
3
|
import type { ExtractionInput, ExtractionProgress, ExtractionResult } from './types.js';
|
|
3
4
|
/** Structured progress events emitted by the orchestrator (extraction + composition). */
|
|
4
5
|
export type ProgressEvent = ExtractAndComposeProgress;
|
|
@@ -24,11 +25,11 @@ export declare function initialProgress(input: {
|
|
|
24
25
|
hasRawTokens: boolean;
|
|
25
26
|
}): ExtractionProgress;
|
|
26
27
|
export declare function applyProgressEvent(progress: ExtractionProgress, event: ProgressEvent): ExtractionProgress;
|
|
27
|
-
/**
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
/**
|
|
29
|
+
* The rows the screen shows, in the order the wizard showed them. Rows that do not apply are left out. `rowMs` is how long
|
|
30
|
+
* each finished row took, by position (see `trackFinished`).
|
|
31
|
+
*/
|
|
32
|
+
export declare function progressRows(progress: ExtractionProgress, agent: string, rowMs?: ReadonlyArray<number | undefined>): RunningLine[];
|
|
32
33
|
/** True when every job is already done, so the screen would only flash. The wizard shows nothing in this case. */
|
|
33
34
|
export declare function isFullCacheHit(progress: ExtractionProgress): boolean;
|
|
34
35
|
export declare function noComponentsMessage(projectPath: string): string;
|
|
@@ -3,6 +3,8 @@ 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>;
|
|
6
8
|
}
|
|
7
|
-
export declare function ExtractionScreen({ progress, agent }: ExtractionScreenProps): React.ReactElement;
|
|
9
|
+
export declare function ExtractionScreen({ progress, agent, rowMs }: ExtractionScreenProps): React.ReactElement;
|
|
8
10
|
export {};
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import type { GenerateComponentsProgress } from '@contentful/experience-design-system-backend-pipeline';
|
|
2
|
+
import { type ActivityItem } from '../../shared/running-step/activity.js';
|
|
3
|
+
import { type RunningLine } from '../../shared/running-step/logic.js';
|
|
1
4
|
import type { GenerationInput, GenerationProgress, GenerationResult } from './types.js';
|
|
2
5
|
/** What the debug log says the stage started with. The counts are logged, not the lists of names. */
|
|
3
6
|
export declare function generationLogInputs(input: GenerationInput): Record<string, unknown>;
|
|
@@ -7,6 +10,11 @@ export declare function generationLogOutputs(result: GenerationResult, progress:
|
|
|
7
10
|
status: 'success' | 'error';
|
|
8
11
|
};
|
|
9
12
|
export declare function initialProgress(): GenerationProgress;
|
|
13
|
+
/**
|
|
14
|
+
* The panel's entries after one more event. Each component has one entry, in the order they began: it is running from
|
|
15
|
+
* when it starts, then done, cached or failed. A component the pipeline starts again for a retry keeps its entry.
|
|
16
|
+
*/
|
|
17
|
+
export declare function applyActivityEvent(event: GenerateComponentsProgress, previous: readonly ActivityItem[], now: number): ActivityItem[];
|
|
10
18
|
export declare function shouldRunMapTokens(counts: {
|
|
11
19
|
mappablePropCount: number;
|
|
12
20
|
rawTokenCount: number;
|
|
@@ -20,11 +28,5 @@ export declare function describeGeneration(input: {
|
|
|
20
28
|
agent: string;
|
|
21
29
|
hasTokens: boolean;
|
|
22
30
|
}): string;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
complete: boolean;
|
|
26
|
-
progress?: {
|
|
27
|
-
done: number;
|
|
28
|
-
total: number;
|
|
29
|
-
};
|
|
30
|
-
}>;
|
|
31
|
+
/** `rowMs` is how long each finished row took, by position (see `trackFinished`). */
|
|
32
|
+
export declare function progressRows(progress: GenerationProgress, agent: string, rowMs?: ReadonlyArray<number | undefined>): RunningLine[];
|
|
@@ -5,6 +5,8 @@ interface GenerationScreenProps {
|
|
|
5
5
|
agent: string;
|
|
6
6
|
acceptedCount: number;
|
|
7
7
|
hasTokens: boolean;
|
|
8
|
+
/** How long each finished row took, by position. */
|
|
9
|
+
rowMs?: ReadonlyArray<number | undefined>;
|
|
8
10
|
}
|
|
9
|
-
export declare function GenerationScreen({ progress, agent, acceptedCount, hasTokens, }: GenerationScreenProps): React.ReactElement;
|
|
11
|
+
export declare function GenerationScreen({ progress, agent, acceptedCount, hasTokens, rowMs, }: GenerationScreenProps): React.ReactElement;
|
|
10
12
|
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { GenerationHandoff } from '@contentful/experience-design-system-types/handoff';
|
|
2
|
+
import type { ActivityItem } from '../../shared/running-step/activity.js';
|
|
2
3
|
export interface GenerationInput {
|
|
3
4
|
/** The extraction session the scope was decided on. */
|
|
4
5
|
sessionId: string;
|
|
@@ -26,12 +27,18 @@ export interface GenerationInput {
|
|
|
26
27
|
}
|
|
27
28
|
/** One line per thing the screen shows, in the order it shows them. */
|
|
28
29
|
export interface GenerationProgress {
|
|
29
|
-
/**
|
|
30
|
+
/**
|
|
31
|
+
* Components finished, out of the total, and the one being worked on. `failed` counts the finished ones that failed: the
|
|
32
|
+
* run carries on through the rest and only fails at the end. Null until the first progress line.
|
|
33
|
+
*/
|
|
30
34
|
components: {
|
|
31
35
|
done: number;
|
|
32
36
|
total: number;
|
|
33
37
|
current: string;
|
|
38
|
+
failed: number;
|
|
34
39
|
} | null;
|
|
40
|
+
/** One entry for each component the run has started, in the order they began. Feeds the activity panel. */
|
|
41
|
+
activity: ActivityItem[];
|
|
35
42
|
mapTokens: 'idle' | 'running' | 'complete';
|
|
36
43
|
/** Whether token mapping will run at all; unknown until the generated components have been looked at. */
|
|
37
44
|
mapTokensEligible: boolean | null;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ActivityItem } from '../../../shared/running-step/activity.js';
|
|
1
2
|
export type PushProgress = {
|
|
2
3
|
kind: 'queued';
|
|
3
4
|
operationId: string;
|
|
@@ -5,5 +6,24 @@ export type PushProgress = {
|
|
|
5
6
|
kind: 'progress';
|
|
6
7
|
processed: number;
|
|
7
8
|
total: number;
|
|
9
|
+
failed: number;
|
|
8
10
|
current: string | null;
|
|
11
|
+
items: ActivityItem[];
|
|
9
12
|
} | null;
|
|
13
|
+
/** What the API reports for one entity in the push. */
|
|
14
|
+
interface OperationItem {
|
|
15
|
+
entityType: string;
|
|
16
|
+
action: string;
|
|
17
|
+
id: string;
|
|
18
|
+
status: string;
|
|
19
|
+
/** The API gives the reason as an object with a message, or as plain text. */
|
|
20
|
+
error?: string | {
|
|
21
|
+
message: string;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* The panel's entries for the entities the push has processed so far. An entity still waiting in the queue is left out,
|
|
26
|
+
* so the panel shows what has happened and not a list of everything that is yet to.
|
|
27
|
+
*/
|
|
28
|
+
export declare function activityFromItems(items: readonly OperationItem[]): ActivityItem[];
|
|
29
|
+
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-62049584.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-62049584.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-62049584.0"
|
|
63
63
|
},
|
|
64
64
|
"repository": {
|
|
65
65
|
"type": "git",
|