@contentful/experience-design-system-cli 2.37.1-dev-build-350476b2.0 → 2.37.1-dev-build-f137cd4b.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentful/experience-design-system-cli",
3
- "version": "2.37.1-dev-build-350476b2.0",
3
+ "version": "2.37.1-dev-build-f137cd4b.0",
4
4
  "description": "Contentful Experiences design system import CLI",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -0,0 +1,17 @@
1
+ import { type ImportTarget } from './logic.js';
2
+ export declare const PREFLIGHT_CONTROLS: readonly [{
3
+ readonly keys: "↑/↓";
4
+ readonly label: "Choose";
5
+ }, {
6
+ readonly keys: "Enter";
7
+ readonly label: "Continue";
8
+ }, {
9
+ readonly keys: "Esc";
10
+ readonly label: "Back to menu";
11
+ }];
12
+ export declare function usePreflightControls(handlers: {
13
+ focus: number;
14
+ onFocus: (focus: number) => void;
15
+ onChoose: (target: ImportTarget) => void;
16
+ onQuit: () => void;
17
+ }): void;
@@ -0,0 +1,17 @@
1
+ export type ImportTarget = 'both' | 'tokens' | 'components';
2
+ export declare const IMPORT_TARGET_OPTIONS: ReadonlyArray<{
3
+ target: ImportTarget;
4
+ label: string;
5
+ description: string;
6
+ }>;
7
+ export type ImportStepId = 'project' | 'token-file' | 'path-validation' | 'credentials' | 'component-extraction' | 'token-generation' | 'scope-gate' | 'generation' | 'review' | 'save-push';
8
+ export declare function stepsFor(target: ImportTarget): readonly ImportStepId[];
9
+ /** The screen Back goes to from `current`: the one before it in this mode, or the preflight from the first step. */
10
+ export declare function previousStep(target: ImportTarget, current: ImportStepId): ImportStepId | 'preflight';
11
+ interface FocusKey {
12
+ upArrow: boolean;
13
+ downArrow: boolean;
14
+ }
15
+ /** The option focused after a key: arrows move through the list and wrap around. */
16
+ export declare function moveFocus(focus: number, key: FocusKey, count: number): number;
17
+ export {};
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import { type ImportTarget } from './logic.js';
3
+ interface PreflightScreenProps {
4
+ onChoose: (target: ImportTarget) => void;
5
+ onQuit: () => void;
6
+ }
7
+ export declare function PreflightScreen({ onChoose, onQuit }: PreflightScreenProps): React.ReactElement;
8
+ export {};
@@ -6,6 +6,6 @@ export declare const WELCOME_CONTROLS: readonly [{
6
6
  readonly label: "Clear";
7
7
  }, {
8
8
  readonly keys: "Esc";
9
- readonly label: "Back to menu";
9
+ readonly label: "Back";
10
10
  }];
11
11
  export declare function useWelcomeControls(onQuit: () => void): void;
@@ -1,6 +1,14 @@
1
+ import type { ImportTarget } from '../00-preflight/logic.js';
1
2
  interface QuitKey {
2
3
  escape: boolean;
3
4
  }
5
+ interface OverviewStep {
6
+ description: string;
7
+ /** Whether the step uses the user's local AI agent. */
8
+ ai: boolean;
9
+ }
10
+ /** The steps the user is about to go through, as the welcome screen lists them, for what they chose to generate. */
11
+ export declare function overviewFor(target: ImportTarget): readonly OverviewStep[];
4
12
  export declare function shouldQuit(key: QuitKey): boolean;
5
13
  export declare function toProjectPath(value: string): string | null;
6
14
  export {};
@@ -1,8 +1,10 @@
1
1
  import React from 'react';
2
+ import type { ImportTarget } from '../00-preflight/logic.js';
2
3
  interface WelcomeScreenProps {
4
+ target: ImportTarget;
3
5
  onContinue: (projectPath: string) => void;
4
6
  onQuit: () => void;
5
7
  initialPath?: string;
6
8
  }
7
- export declare function WelcomeScreen({ onContinue, onQuit, initialPath }: WelcomeScreenProps): React.ReactElement;
9
+ export declare function WelcomeScreen({ target, onContinue, onQuit, initialPath, }: WelcomeScreenProps): React.ReactElement;
8
10
  export {};
@@ -13,10 +13,3 @@ interface InspectInput {
13
13
  cache: boolean;
14
14
  }
15
15
  export declare function inspectTokens({ rawTokensPath, contentfulDir, cache }: InspectInput): Promise<TokensState>;
16
- export declare function gateText({ tokensPath, sourceChanged }: {
17
- tokensPath: string;
18
- sourceChanged: boolean;
19
- }): {
20
- summary: string;
21
- context?: string;
22
- };
@@ -0,0 +1,31 @@
1
+ import { checkAgentAuth, runGenerateTokensSession } from '@contentful/experience-design-system-backend-pipeline';
2
+ export interface TokensOnlyInput {
3
+ rawTokensPath: string;
4
+ /** Where tokens.json is written: this import run's folder. */
5
+ outDir: string;
6
+ agent: string;
7
+ agentModel?: string;
8
+ promptOverrides: string[];
9
+ noCache: boolean;
10
+ }
11
+ export type TokensOnlyResult = {
12
+ ok: true;
13
+ tokensPath: string;
14
+ tokenSessionId: string | null;
15
+ tokenCount: number;
16
+ } | {
17
+ ok: false;
18
+ step: 'generate tokens' | `${string} auth check`;
19
+ message: string;
20
+ };
21
+ /** The outside world the stage talks to, so it can be tested without an agent. */
22
+ export interface TokensOnlyDeps {
23
+ checkAgentAuth: typeof checkAgentAuth;
24
+ runGenerateTokensSession: typeof runGenerateTokensSession;
25
+ }
26
+ /**
27
+ * The extraction stage for an import that only generates tokens: the same auth check and token generation the full stage
28
+ * runs, without scanning components, composing them or selecting. The full stage fails when it finds no components, so it
29
+ * cannot be used for this.
30
+ */
31
+ export declare function runTokensOnly(input: TokensOnlyInput, deps?: TokensOnlyDeps): Promise<TokensOnlyResult>;
@@ -0,0 +1,12 @@
1
+ import { type TokensOnlyInput, type TokensOnlyResult } from './run-tokens-only.js';
2
+ export type TokensOnlyState = {
3
+ status: 'running';
4
+ } | {
5
+ status: 'done';
6
+ result: TokensOnlyResult;
7
+ };
8
+ /**
9
+ * Runs the tokens-only stage once for the given input. Passing nothing leaves it idle. A run that finishes after the
10
+ * input changed or the screen went away is ignored.
11
+ */
12
+ export declare function useTokensOnly(input: TokensOnlyInput | undefined): TokensOnlyState | undefined;
@@ -17,5 +17,6 @@ export declare function buildFlowStart(input: {
17
17
  handoff: ImportHandoff;
18
18
  saved?: SavedCredentials;
19
19
  generatePromptPath?: string;
20
+ tokensOnly?: FlowStart['tokensOnly'];
20
21
  }): FlowStart;
21
22
  export {};
@@ -17,6 +17,13 @@ export interface FlowStart {
17
17
  cmaToken: string;
18
18
  host: string;
19
19
  };
20
+ /** Set when the import only generates tokens: there is no extraction or generation, so the flow starts at saving. */
21
+ tokensOnly?: {
22
+ tokensPath: string;
23
+ tokenSessionId: string | null;
24
+ tokenCount: number;
25
+ outDir: string;
26
+ };
20
27
  /** A custom prompt for `generate components`, shown as a warning above every step. */
21
28
  generatePromptPath?: string;
22
29
  }
@@ -1,6 +1,6 @@
1
+ export { PreflightScreen } from './00-preflight/screen.js';
1
2
  export { WelcomeScreen } from './01-welcome/screen.js';
2
3
  export { TokenInputScreen } from './02-token-input/screen.js';
3
4
  export { PathValidationScreen } from './03-path-validation/screen.js';
4
5
  export { CredentialsScreen } from './04-credentials/screen.js';
5
- export { TokenReuseScreen } from './05-token-reuse/screen.js';
6
6
  export { ExtractionScreen } from './06-extraction/screen.js';
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-350476b2.0",
3
+ "version": "2.37.1-dev-build-f137cd4b.0",
4
4
  "description": "Contentful Experiences design system import CLI",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -45,8 +45,8 @@
45
45
  "ts-morph": "^27.0.2",
46
46
  "typescript": "^5.9.3",
47
47
  "zod": "^4.6.5",
48
- "@contentful/experience-design-system-backend-pipeline": "2.37.1-dev-build-350476b2.0",
49
- "@contentful/experience-design-system-types": "2.37.1-dev-build-350476b2.0"
48
+ "@contentful/experience-design-system-backend-pipeline": "2.37.1-dev-build-f137cd4b.0",
49
+ "@contentful/experience-design-system-types": "2.37.1-dev-build-f137cd4b.0"
50
50
  },
51
51
  "devDependencies": {
52
52
  "@tsconfig/node24": "^24.0.4",
@@ -1,10 +0,0 @@
1
- import React from 'react';
2
- interface TokenReuseScreenProps {
3
- tokensPath: string;
4
- sourceChanged: boolean;
5
- onReuse: () => void;
6
- onRegenerate: () => void;
7
- onQuit: () => void;
8
- }
9
- export declare function TokenReuseScreen({ tokensPath, sourceChanged, onReuse, onRegenerate, onQuit, }: TokenReuseScreenProps): React.ReactElement;
10
- export {};