@contentful/experience-design-system-cli 2.37.1-dev-build-97b615d3.0 → 2.37.1-dev-build-5bd13138.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 +442 -326
- package/dist/index.js +338 -262
- package/dist/package.json +1 -1
- package/dist/src/tui/debug-store.d.ts +6 -0
- package/dist/src/tui/import/debug-hooks.d.ts +17 -0
- package/dist/src/tui/import/steps/06-extraction/run.d.ts +3 -0
- package/dist/src/tui/import/steps/07-scope-gate/sidebar/components/CompactControlBar.d.ts +1 -1
- package/dist/src/tui/import/steps/10-flow/flow/controller.d.ts +3 -6
- package/dist/src/tui/import/steps/10-flow/flow/screen.d.ts +3 -1
- package/dist/src/tui/import/steps/10-flow/flow/use-flow.d.ts +1 -4
- package/legacy/bin/cli.js +0 -0
- package/legacy/dist/src/setup/steps/preferences/PreferencesMenu.d.ts +4 -4
- package/legacy/package.json +1 -1
- package/package.json +4 -4
package/dist/package.json
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
type Status = 'success' | 'error';
|
|
2
2
|
type ExitMethod = 'saved' | 'discarded' | 'crashed';
|
|
3
3
|
export declare function currentDebugSessionDir(): string;
|
|
4
|
+
/**
|
|
5
|
+
* Moves this session's logs to `<outDir>/debug/sessions/<session>/`, next to the CDF, and writes there from now on.
|
|
6
|
+
* Logs written before the project was known come along. Safe to call repeatedly; a different outDir moves them again.
|
|
7
|
+
* Fail-open like the rest of the logger: if the move fails the logs stay where they were.
|
|
8
|
+
*/
|
|
9
|
+
export declare function setDebugOutDir(outDir: string): Promise<void>;
|
|
4
10
|
export declare function startDebugRun({ flow, step, menuOption, inputs, }: {
|
|
5
11
|
flow: string;
|
|
6
12
|
step: string;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** What the import stages need from the TUI's debug store. */
|
|
2
|
+
export interface DebugHooks {
|
|
3
|
+
/** Moves this session's logs next to the CDF in `outDir`. */
|
|
4
|
+
setOutDir: (outDir: string) => Promise<void>;
|
|
5
|
+
start: (run: {
|
|
6
|
+
flow: string;
|
|
7
|
+
step: string;
|
|
8
|
+
menuOption: string;
|
|
9
|
+
inputs: Record<string, unknown>;
|
|
10
|
+
}) => void;
|
|
11
|
+
finish: (run: {
|
|
12
|
+
outputs: Record<string, unknown>;
|
|
13
|
+
status: 'success' | 'error';
|
|
14
|
+
exitMethod: 'saved' | 'discarded' | 'crashed';
|
|
15
|
+
}) => Promise<void>;
|
|
16
|
+
}
|
|
17
|
+
export declare const realDebugHooks: DebugHooks;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { checkAgentAuth, runExtractAndComposeSession, runGenerateTokensSession } from '@contentful/experience-design-system-backend-pipeline';
|
|
2
|
+
import { type DebugHooks } from '../../debug-hooks.js';
|
|
2
3
|
import { runSelection } from './selection.js';
|
|
3
4
|
import type { ExtractionInput, ExtractionProgress, ExtractionResult } from './types.js';
|
|
4
5
|
/** The outside world the stage talks to, so the order of events can be tested without a network, an agent or a CLI. */
|
|
@@ -8,6 +9,8 @@ export interface ExtractionDeps {
|
|
|
8
9
|
runExtractAndComposeSession: typeof runExtractAndComposeSession;
|
|
9
10
|
runGenerateTokensSession: typeof runGenerateTokensSession;
|
|
10
11
|
runSelection: typeof runSelection;
|
|
12
|
+
/** Debug-log hooks. Optional so tests do not write logs; the real ones live in the TUI's debug store. */
|
|
13
|
+
debug?: DebugHooks;
|
|
11
14
|
}
|
|
12
15
|
/**
|
|
13
16
|
* Runs the stage. The jobs overlap exactly as they did when extract was a
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type PreviewValidationError } from '@contentful/experience-design-system-backend-pipeline';
|
|
2
2
|
import type { ImportHandoff } from '@contentful/experience-design-system-types/handoff';
|
|
3
|
+
import { type DebugHooks } from '../../../debug-hooks.js';
|
|
3
4
|
import { type PreviewDeps } from './preview.js';
|
|
4
5
|
import { type PushDeps } from './push.js';
|
|
5
6
|
import { type SaveDeps } from './save.js';
|
|
@@ -38,12 +39,8 @@ export interface FlowDeps {
|
|
|
38
39
|
/** Writes one line of the wizard's step log. */
|
|
39
40
|
log: (entry: Record<string, unknown>) => void;
|
|
40
41
|
stderr: (text: string) => void;
|
|
41
|
-
/**
|
|
42
|
-
|
|
43
|
-
* here so the next screen is drawn on a clean one. It has to be before: Ink paints as soon as it is told, and a clear
|
|
44
|
-
* after the paint wipes a static screen like the done step, which nothing draws again.
|
|
45
|
-
*/
|
|
46
|
-
beforeStepChange?: () => void;
|
|
42
|
+
/** Debug-log hooks. Optional so tests do not write logs. */
|
|
43
|
+
debug?: DebugHooks;
|
|
47
44
|
}
|
|
48
45
|
export declare function startWizardLog(): void;
|
|
49
46
|
export declare function realFlowDeps(): FlowDeps;
|
|
@@ -8,10 +8,12 @@ interface FlowScreenProps {
|
|
|
8
8
|
generatePromptPath?: string;
|
|
9
9
|
/** Leaves the import with the exit code the wizard would have exited with. */
|
|
10
10
|
onExit: (exitCode: number) => void;
|
|
11
|
+
/** Called when the step changes so the host can clear Ink's render buffer without scrollback pollution. */
|
|
12
|
+
onStepChange?: () => void;
|
|
11
13
|
}
|
|
12
14
|
/** How many steps the import has, as the wizard counted them. */
|
|
13
15
|
export declare function totalStepsFor(state: Pick<FlowState, 'tokensPath' | 'rawTokensPath' | 'mapTokensEligible'>): number;
|
|
14
16
|
/** Whether the preview gate offers "[e] Edit definitions": only when the document has components to edit. */
|
|
15
17
|
export declare function canEditFromPreview(cdf: FlowState['cdf']): boolean;
|
|
16
|
-
export declare function FlowScreen({ state, controller, livePreview, generatePromptPath, onExit, }: FlowScreenProps): React.ReactElement;
|
|
18
|
+
export declare function FlowScreen({ state, controller, livePreview, generatePromptPath, onExit, onStepChange, }: FlowScreenProps): React.ReactElement;
|
|
17
19
|
export {};
|
|
@@ -3,10 +3,7 @@ import { type FlowController, type FlowDeps, type FlowStart } from './controller
|
|
|
3
3
|
* The flow for a start, once. `start` is undefined until the generation stage has finished, so the hook can be called
|
|
4
4
|
* unconditionally; the step log is started with the controller, as the wizard started it with its first render.
|
|
5
5
|
*/
|
|
6
|
-
export declare function useFlow(start: FlowStart | undefined,
|
|
7
|
-
beforeStepChange?: () => void;
|
|
8
|
-
deps?: () => FlowDeps;
|
|
9
|
-
}): {
|
|
6
|
+
export declare function useFlow(start: FlowStart | undefined, deps?: () => FlowDeps): {
|
|
10
7
|
controller: FlowController;
|
|
11
8
|
state: ReturnType<FlowController['getState']>;
|
|
12
9
|
} | undefined;
|
package/legacy/bin/cli.js
CHANGED
|
File without changes
|
|
@@ -6,19 +6,19 @@ type PreferenceScreenProps = {
|
|
|
6
6
|
export declare const PREFERENCE_OPTIONS: readonly [{
|
|
7
7
|
readonly key: "customPrompts";
|
|
8
8
|
readonly label: "Custom prompts";
|
|
9
|
-
readonly Screen: ({ onDone }: PreferenceScreenProps) =>
|
|
9
|
+
readonly Screen: ({ onDone }: PreferenceScreenProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
10
|
}, {
|
|
11
11
|
readonly key: "debug";
|
|
12
12
|
readonly label: "Debug logging";
|
|
13
|
-
readonly Screen: ({ onDone }: PreferenceScreenProps) =>
|
|
13
|
+
readonly Screen: ({ onDone }: PreferenceScreenProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
14
|
}, {
|
|
15
15
|
readonly key: "analytics";
|
|
16
16
|
readonly label: "Usage analytics";
|
|
17
|
-
readonly Screen: ({ onDone }: PreferenceScreenProps) =>
|
|
17
|
+
readonly Screen: ({ onDone }: PreferenceScreenProps) => import("react/jsx-runtime").JSX.Element;
|
|
18
18
|
}, {
|
|
19
19
|
readonly key: "noColor";
|
|
20
20
|
readonly label: "Terminal colors";
|
|
21
|
-
readonly Screen: ({ onDone }: PreferenceScreenProps) =>
|
|
21
|
+
readonly Screen: ({ onDone }: PreferenceScreenProps) => import("react/jsx-runtime").JSX.Element;
|
|
22
22
|
}];
|
|
23
23
|
export declare function PreferencesMenu({ onDone }: {
|
|
24
24
|
onDone: StepDone;
|
package/legacy/package.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentful/experience-design-system-cli",
|
|
3
|
-
"version": "2.37.1-dev-build-
|
|
3
|
+
"version": "2.37.1-dev-build-5bd13138.0",
|
|
4
4
|
"description": "Contentful Experiences design system import CLI",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -29,8 +29,6 @@
|
|
|
29
29
|
"skills/"
|
|
30
30
|
],
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@contentful/experience-design-system-backend-pipeline": "2.37.1-dev-build-97b615d3.0",
|
|
33
|
-
"@contentful/experience-design-system-types": "2.37.1-dev-build-97b615d3.0",
|
|
34
32
|
"@inkjs/ui": "^2.0.0",
|
|
35
33
|
"@segment/analytics-node": "^3.0.0",
|
|
36
34
|
"@vue/compiler-sfc": "^3.5.31",
|
|
@@ -46,7 +44,9 @@
|
|
|
46
44
|
"svelte": "^5.56.4",
|
|
47
45
|
"ts-morph": "^27.0.2",
|
|
48
46
|
"typescript": "^5.9.3",
|
|
49
|
-
"zod": "^4.6.5"
|
|
47
|
+
"zod": "^4.6.5",
|
|
48
|
+
"@contentful/experience-design-system-backend-pipeline": "2.37.1-dev-build-5bd13138.0",
|
|
49
|
+
"@contentful/experience-design-system-types": "2.37.1-dev-build-5bd13138.0"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@tsconfig/node24": "^24.0.4",
|