@contentful/experience-design-system-cli 2.37.1-dev-build-923f560a.0 → 2.37.1-dev-build-6d56b670.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 +2558 -3168
- package/dist/index.js +3040 -3718
- package/dist/package.json +1 -1
- package/dist/src/tui/import/shared/gate-step/gate-step.d.ts +3 -1
- package/dist/src/tui/import/shared/index.d.ts +1 -0
- package/dist/src/tui/import/shared/overview-box/overview-box.d.ts +10 -0
- package/dist/src/tui/import/shared/running-step/logic.d.ts +0 -1
- package/dist/src/tui/import/shared/running-step/running-step.d.ts +3 -4
- package/dist/src/tui/import/steps/00-preflight/controls.d.ts +17 -0
- package/dist/src/tui/import/steps/00-preflight/logic.d.ts +45 -0
- package/dist/src/tui/import/steps/00-preflight/screen.d.ts +8 -0
- package/dist/src/tui/import/steps/01-welcome/controls.d.ts +1 -1
- package/dist/src/tui/import/steps/03-path-validation/logic.d.ts +7 -1
- package/dist/src/tui/import/steps/03-path-validation/screen.d.ts +3 -1
- package/dist/src/tui/import/steps/04-credentials/logic.d.ts +6 -9
- package/dist/src/tui/import/steps/04-credentials/screen.d.ts +3 -1
- package/dist/src/tui/import/steps/06-extraction/logic.d.ts +1 -16
- package/dist/src/tui/import/steps/06-extraction/run-tokens-only.d.ts +31 -0
- package/dist/src/tui/import/steps/06-extraction/screen.d.ts +1 -3
- package/dist/src/tui/import/steps/06-extraction/types.d.ts +2 -5
- package/dist/src/tui/import/steps/06-extraction/use-tokens-only.d.ts +12 -0
- package/dist/src/tui/import/steps/07-scope-gate/sidebar/components/windowed-panel.d.ts +4 -0
- package/dist/src/tui/import/steps/08-generation/screen.d.ts +1 -3
- package/dist/src/tui/import/steps/10-flow/flow/build-flow-start.d.ts +1 -0
- package/dist/src/tui/import/steps/10-flow/flow/controller.d.ts +7 -0
- package/dist/src/tui/import/steps/10-flow/screens/DoneStep.d.ts +6 -1
- package/dist/src/tui/import/steps/10-flow/screens/PushingStep.d.ts +3 -3
- package/dist/src/tui/import/steps/10-flow/screens/WizardPreviewStep.d.ts +1 -3
- package/dist/src/tui/import/steps/10-flow/support/preview-diff.d.ts +1 -1
- package/dist/src/tui/import/steps/10-flow/support/produced.d.ts +15 -0
- package/dist/src/tui/import/steps/index.d.ts +1 -1
- package/dist/src/tui/shared/components/ControlHints.d.ts +9 -0
- package/dist/src/tui/{settings/shared → shared/components}/FieldForm.d.ts +7 -1
- package/dist/src/tui/shared/components/StepHeader.d.ts +26 -0
- package/dist/src/tui/theme.d.ts +2 -0
- package/package.json +3 -3
- package/dist/src/tui/control-hints.d.ts +0 -7
- package/dist/src/tui/import/steps/04-credentials/controls.d.ts +0 -21
- package/dist/src/tui/import/steps/05-token-reuse/logic.d.ts +0 -22
- package/dist/src/tui/import/steps/05-token-reuse/screen.d.ts +0 -10
- package/dist/src/tui/import/steps/07-scope-gate/sidebar/components/LegendEntry.d.ts +0 -2
- package/dist/src/tui/import/steps/07-scope-gate/sidebar/theme.d.ts +0 -8
- package/dist/src/tui/import/steps/10-flow/components/StepHeader.d.ts +0 -8
- /package/dist/src/tui/{ClearableTextInput.d.ts → shared/components/ClearableTextInput.d.ts} +0 -0
package/dist/package.json
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { type StepHeaderProps } from '@tui/shared/components/StepHeader.js';
|
|
2
3
|
interface GateStepProps {
|
|
3
4
|
message: string;
|
|
4
5
|
onContinue: () => void;
|
|
@@ -9,6 +10,7 @@ interface GateStepProps {
|
|
|
9
10
|
skipLabel?: string;
|
|
10
11
|
onSkip?: () => void;
|
|
11
12
|
intent?: 'success' | 'error';
|
|
13
|
+
step?: StepHeaderProps['step'];
|
|
12
14
|
}
|
|
13
|
-
export declare function GateStep({ message, onContinue, onQuit, summary, context, continueLabel, skipLabel, onSkip, intent, }: GateStepProps): React.ReactElement;
|
|
15
|
+
export declare function GateStep({ message, onContinue, onQuit, summary, context, continueLabel, skipLabel, onSkip, intent, step, }: GateStepProps): React.ReactElement;
|
|
14
16
|
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface OverviewStep {
|
|
3
|
+
description: string;
|
|
4
|
+
/** Whether the step uses the user's local AI agent. */
|
|
5
|
+
ai: boolean;
|
|
6
|
+
}
|
|
7
|
+
/** The framed list of the steps an import goes through, with the AI disclosure under it. Shown by the intro screens. */
|
|
8
|
+
export declare function OverviewBox({ steps }: {
|
|
9
|
+
steps: readonly OverviewStep[];
|
|
10
|
+
}): React.ReactElement;
|
|
@@ -9,4 +9,3 @@ export interface RunningLine {
|
|
|
9
9
|
}
|
|
10
10
|
export declare function progressPercent(progress: Progress): number;
|
|
11
11
|
export declare function formatElapsed(totalSeconds: number): string;
|
|
12
|
-
export declare function stepLabel(stepNumber: number, totalSteps: number, title: string): string;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type RunningLine } from './logic.js';
|
|
3
|
+
import type { ImportStepId } from '@tui/shared/components/StepHeader.js';
|
|
3
4
|
interface RunningStepProps {
|
|
4
|
-
|
|
5
|
-
totalSteps: number;
|
|
6
|
-
title: string;
|
|
5
|
+
step: ImportStepId;
|
|
7
6
|
description: string;
|
|
8
7
|
lines?: readonly RunningLine[];
|
|
9
8
|
}
|
|
10
|
-
export declare function RunningStep({
|
|
9
|
+
export declare function RunningStep({ step, description, lines, }: RunningStepProps): React.ReactElement;
|
|
11
10
|
export {};
|
|
@@ -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,45 @@
|
|
|
1
|
+
import type { OverviewStep } from '../../shared/index.js';
|
|
2
|
+
export type ImportTarget = 'both' | 'tokens' | 'components';
|
|
3
|
+
export declare const IMPORT_TARGET_OPTIONS: ReadonlyArray<{
|
|
4
|
+
target: ImportTarget;
|
|
5
|
+
label: string;
|
|
6
|
+
}>;
|
|
7
|
+
export declare function overviewFor(target: ImportTarget): readonly OverviewStep[];
|
|
8
|
+
export type ImportStepId = 'project' | 'token-file' | 'path-validation' | 'credentials' | 'component-extraction' | 'token-generation' | 'scope-gate' | 'generation' | 'review' | 'save-push';
|
|
9
|
+
export declare function stepsFor(target: ImportTarget): readonly ImportStepId[];
|
|
10
|
+
export interface InputAnswers {
|
|
11
|
+
projectPath?: string;
|
|
12
|
+
tokensPath?: string;
|
|
13
|
+
scannedFiles?: string[];
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* The input screen to show: the first step of this mode whose answer is still missing, or 'credentials' once every
|
|
17
|
+
* earlier one is answered. A mode never shows a screen it does not list, so skipping one needs no special case.
|
|
18
|
+
*/
|
|
19
|
+
export declare function currentInputStep(target: ImportTarget, answers: InputAnswers): Extract<ImportStepId, 'project' | 'token-file' | 'path-validation' | 'credentials'>;
|
|
20
|
+
/**
|
|
21
|
+
* What Back from `current` does: leave for the preflight when it is the first screen of the mode, otherwise clear the
|
|
22
|
+
* previous step's answer so that screen shows again.
|
|
23
|
+
*/
|
|
24
|
+
export declare function goBack(target: ImportTarget, current: ImportStepId, answers: InputAnswers): {
|
|
25
|
+
to: 'preflight';
|
|
26
|
+
} | {
|
|
27
|
+
to: 'step';
|
|
28
|
+
answers: InputAnswers;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Where a run writes its files when it has no project to put them in: the Root Project Directory setting if there is
|
|
32
|
+
* one, otherwise the folder the token file is in. Components runs always have a project and use it.
|
|
33
|
+
*/
|
|
34
|
+
export declare function runBaseDir(input: {
|
|
35
|
+
projectPath?: string;
|
|
36
|
+
tokensPath?: string;
|
|
37
|
+
configuredBaseDir?: string;
|
|
38
|
+
}): string;
|
|
39
|
+
interface FocusKey {
|
|
40
|
+
upArrow: boolean;
|
|
41
|
+
downArrow: boolean;
|
|
42
|
+
}
|
|
43
|
+
/** The option focused after a key: arrows move through the list and wrap around. */
|
|
44
|
+
export declare function moveFocus(focus: number, key: FocusKey, count: number): number;
|
|
45
|
+
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 {};
|
|
@@ -33,7 +33,13 @@ interface Key {
|
|
|
33
33
|
return: boolean;
|
|
34
34
|
}
|
|
35
35
|
export declare function describeFailure(failure: ScanFailureCode, path: string): FailureMessage;
|
|
36
|
-
|
|
36
|
+
/**
|
|
37
|
+
* The scan result as rows and a warning. When the import does not generate tokens (components only), `.json` files are
|
|
38
|
+
* not design tokens here, so the row says they are ignored and the warnings do not mention tokens.
|
|
39
|
+
*/
|
|
40
|
+
export declare function summarize(counts: FileCounts, { hasTokens }?: {
|
|
41
|
+
hasTokens?: boolean;
|
|
42
|
+
}): Summary;
|
|
37
43
|
export declare function phaseOf(scan: ScanResult | undefined): PathPhase;
|
|
38
44
|
export declare function keyAction(phase: PathPhase, input: string, key: Key): KeyAction | undefined;
|
|
39
45
|
export {};
|
|
@@ -7,6 +7,8 @@ interface PathValidationScreenProps {
|
|
|
7
7
|
}) => void;
|
|
8
8
|
onChangePath: () => void;
|
|
9
9
|
onBack: () => void;
|
|
10
|
+
/** False when the import does not generate tokens, so `.json` files are not described as design tokens. */
|
|
11
|
+
hasTokens?: boolean;
|
|
10
12
|
}
|
|
11
|
-
export declare function PathValidationScreen({ projectPath, onConfirm, onChangePath, onBack, }: PathValidationScreenProps): React.ReactElement;
|
|
13
|
+
export declare function PathValidationScreen({ projectPath, onConfirm, onChangePath, onBack, hasTokens, }: PathValidationScreenProps): React.ReactElement;
|
|
12
14
|
export {};
|
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
declare const FIELDS: readonly ["spaceId", "environmentId", "cmaToken", "host"];
|
|
2
2
|
export type CredentialField = (typeof FIELDS)[number];
|
|
3
3
|
export type CredentialValues = Record<CredentialField, string>;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export type KeyAction = 'back' | 'next-field' | 'skip' | null;
|
|
10
|
-
export declare function keyAction(input: string, key: Key): KeyAction;
|
|
11
|
-
export declare function nextField(field: CredentialField): CredentialField;
|
|
4
|
+
/**
|
|
5
|
+
* Why the space is asked for. Components are looked up in it before they are generated, so that is part of the reason
|
|
6
|
+
* unless the import only generates tokens, which has nothing to look up.
|
|
7
|
+
*/
|
|
8
|
+
export declare function credentialsPurpose(tokensOnly: boolean): string;
|
|
12
9
|
export declare function normalize(values: CredentialValues): CredentialValues;
|
|
13
10
|
export declare function missingField(values: CredentialValues): boolean;
|
|
14
11
|
export declare function isUnchanged(current: CredentialValues, initial: CredentialValues): boolean;
|
|
@@ -12,6 +12,8 @@ interface CredentialsScreenProps {
|
|
|
12
12
|
onBack: () => void;
|
|
13
13
|
initial?: Partial<CredentialValues>;
|
|
14
14
|
validate?: (values: CredentialValues) => Promise<ValidationResult>;
|
|
15
|
+
/** The import only generates tokens, so there are no components to look up in the space. */
|
|
16
|
+
tokensOnly?: boolean;
|
|
15
17
|
}
|
|
16
|
-
export declare function CredentialsScreen({ onDone, onBack, initial, validate, }: CredentialsScreenProps): React.ReactElement;
|
|
18
|
+
export declare function CredentialsScreen({ onDone, onBack, initial, validate, tokensOnly, }: CredentialsScreenProps): React.ReactElement;
|
|
17
19
|
export {};
|
|
@@ -4,13 +4,11 @@ import type { ExtractionProgress } from './types.js';
|
|
|
4
4
|
export type ProgressEvent = ExtractAndComposeProgress;
|
|
5
5
|
/**
|
|
6
6
|
* Every job the stage will run starts on the first frame, so no row appears later as a surprise. A job that does not
|
|
7
|
-
* apply stays 'idle' and has no row: existing entities need credentials, token definitions need a raw tokens file
|
|
8
|
-
* reused tokens are already complete.
|
|
7
|
+
* apply stays 'idle' and has no row: existing entities need credentials, and token definitions need a raw tokens file.
|
|
9
8
|
*/
|
|
10
9
|
export declare function initialProgress(input: {
|
|
11
10
|
hasCredentials: boolean;
|
|
12
11
|
hasRawTokens: boolean;
|
|
13
|
-
reuseTokens: boolean;
|
|
14
12
|
}): ExtractionProgress;
|
|
15
13
|
export declare function applyProgressEvent(progress: ExtractionProgress, event: ProgressEvent): ExtractionProgress;
|
|
16
14
|
/** The rows the screen shows, in the order the wizard showed them. Rows that do not apply are left out. */
|
|
@@ -20,19 +18,6 @@ export declare function progressRows(progress: ExtractionProgress, agent: string
|
|
|
20
18
|
}>;
|
|
21
19
|
/** True when every job is already done, so the screen would only flash. The wizard shows nothing in this case. */
|
|
22
20
|
export declare function isFullCacheHit(progress: ExtractionProgress): boolean;
|
|
23
|
-
/**
|
|
24
|
-
* The wizard's step counts: three fixed steps, one more when there is a token stage, two more when components are
|
|
25
|
-
* imported, and one more when the tokens can be mapped (not known yet at this stage, so it adds nothing here).
|
|
26
|
-
* Extraction is step 2 when there is a token stage, otherwise step 1.
|
|
27
|
-
*/
|
|
28
|
-
export declare function stepNumbers(input: {
|
|
29
|
-
hasRawTokens: boolean;
|
|
30
|
-
skipComponents?: boolean;
|
|
31
|
-
mapTokensEligible?: boolean | null;
|
|
32
|
-
}): {
|
|
33
|
-
stepNumber: number;
|
|
34
|
-
totalSteps: number;
|
|
35
|
-
};
|
|
36
21
|
export declare function noComponentsMessage(projectPath: string): string;
|
|
37
22
|
export declare function agentAuthMessage(agent: string, status: 'not-found' | 'unauthenticated'): string;
|
|
38
23
|
/**
|
|
@@ -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>;
|
|
@@ -3,8 +3,6 @@ import type { ExtractionProgress } from './types.js';
|
|
|
3
3
|
interface ExtractionScreenProps {
|
|
4
4
|
progress: ExtractionProgress;
|
|
5
5
|
agent: string;
|
|
6
|
-
stepNumber: number;
|
|
7
|
-
totalSteps: number;
|
|
8
6
|
}
|
|
9
|
-
export declare function ExtractionScreen({ progress, agent
|
|
7
|
+
export declare function ExtractionScreen({ progress, agent }: ExtractionScreenProps): React.ReactElement;
|
|
10
8
|
export {};
|
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
import type { ExtractionHandoff
|
|
2
|
-
export type TokenStrategy = ImportHandoff['tokens']['strategy'];
|
|
1
|
+
import type { ExtractionHandoff } from '@contentful/experience-design-system-types/handoff';
|
|
3
2
|
export interface ExtractionInput {
|
|
4
3
|
projectPath: string;
|
|
5
4
|
/** Where the stage writes tokens.json and the other files. Defaults to `<projectPath>/.contentful`. */
|
|
6
5
|
outDir?: string;
|
|
7
6
|
/** Absolute source files from the path-validation step (collectFiles output). */
|
|
8
7
|
filePaths: string[];
|
|
9
|
-
/** Raw tokens file the user pointed at
|
|
8
|
+
/** Raw tokens file the user pointed at. Empty when the import does not generate tokens (components only). */
|
|
10
9
|
rawTokensPath: string;
|
|
11
|
-
/** From the token reuse step. 'reuse' skips token generation entirely. */
|
|
12
|
-
tokenStrategy: TokenStrategy;
|
|
13
10
|
/** Null when the user skipped credentials: no existing-entities fetch happens. */
|
|
14
11
|
credentials: {
|
|
15
12
|
spaceId: string;
|
|
@@ -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;
|
|
@@ -25,6 +25,10 @@ export interface FixedPanelProps {
|
|
|
25
25
|
export declare function FixedPanel({ width, height, minHeight, focused, borderStyle, borderColor, paddingLeft, clipOverflow, children, }: FixedPanelProps): ReactElement;
|
|
26
26
|
/** Shared frame for panels whose viewport must not change with their contents. */
|
|
27
27
|
export declare function WindowedPanel({ width, height, title, focused, children }: WindowedPanelProps): ReactElement;
|
|
28
|
+
export declare function WindowFooter({ above, below }: {
|
|
29
|
+
above: number;
|
|
30
|
+
below: number;
|
|
31
|
+
}): ReactElement;
|
|
28
32
|
export declare function WindowIndicator({ direction, count }: {
|
|
29
33
|
direction: WindowDirection;
|
|
30
34
|
count: number;
|
|
@@ -5,8 +5,6 @@ interface GenerationScreenProps {
|
|
|
5
5
|
agent: string;
|
|
6
6
|
acceptedCount: number;
|
|
7
7
|
hasTokens: boolean;
|
|
8
|
-
stepNumber: number;
|
|
9
|
-
totalSteps: number;
|
|
10
8
|
}
|
|
11
|
-
export declare function GenerationScreen({ progress, agent, acceptedCount, hasTokens,
|
|
9
|
+
export declare function GenerationScreen({ progress, agent, acceptedCount, hasTokens, }: GenerationScreenProps): React.ReactElement;
|
|
12
10
|
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,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import type { Produced } from '../support/produced.js';
|
|
2
3
|
type EntityResult = {
|
|
3
4
|
created: number;
|
|
4
5
|
updated: number;
|
|
@@ -16,6 +17,10 @@ type DoneStepProps = {
|
|
|
16
17
|
spaceId: string;
|
|
17
18
|
environmentId: string;
|
|
18
19
|
host?: string;
|
|
20
|
+
/** What the import produced, so only the links to those things are offered. */
|
|
21
|
+
produced: Produced;
|
|
22
|
+
/** The user skipped the credentials, so nothing could be pushed: the files were only saved. */
|
|
23
|
+
credentialsSkipped?: boolean;
|
|
19
24
|
runTeaser?: string;
|
|
20
25
|
failures?: Array<{
|
|
21
26
|
entityType: string;
|
|
@@ -24,5 +29,5 @@ type DoneStepProps = {
|
|
|
24
29
|
}>;
|
|
25
30
|
onExit: () => void;
|
|
26
31
|
};
|
|
27
|
-
export declare function DoneStep({ componentTypes, designTokens, summary, spaceId, environmentId, host, failures, onExit, }: DoneStepProps): React.ReactElement;
|
|
32
|
+
export declare function DoneStep({ componentTypes, designTokens, summary, spaceId, environmentId, host, produced, credentialsSkipped, failures, onExit, }: DoneStepProps): React.ReactElement;
|
|
28
33
|
export {};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { PushProgress } from '../support/push-progress.js';
|
|
3
|
+
import { type Produced } from '../support/produced.js';
|
|
3
4
|
type PushingStepProps = {
|
|
4
|
-
stepNumber: number;
|
|
5
|
-
totalSteps: number;
|
|
6
5
|
progress: PushProgress;
|
|
6
|
+
produced: Produced;
|
|
7
7
|
};
|
|
8
|
-
export declare function PushingStep({
|
|
8
|
+
export declare function PushingStep({ progress, produced }: PushingStepProps): React.ReactElement;
|
|
9
9
|
export {};
|
|
@@ -4,11 +4,9 @@ type WizardPreviewStepProps = {
|
|
|
4
4
|
preview: ServerPreviewResponse;
|
|
5
5
|
spaceId: string;
|
|
6
6
|
environmentId: string;
|
|
7
|
-
stepNumber: number;
|
|
8
|
-
totalSteps: number;
|
|
9
7
|
onConfirm: (acknowledge: boolean) => void;
|
|
10
8
|
onEdit?: () => void;
|
|
11
9
|
onQuit: () => void;
|
|
12
10
|
};
|
|
13
|
-
export declare function WizardPreviewStep({ preview, spaceId, environmentId,
|
|
11
|
+
export declare function WizardPreviewStep({ preview, spaceId, environmentId, onConfirm, onEdit, onQuit, }: WizardPreviewStepProps): React.ReactElement;
|
|
14
12
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ChangeClassification, ComponentTypeSummary } from '@contentful/experience-design-system-types';
|
|
2
2
|
export interface PropertyDiffLine {
|
|
3
3
|
key: string;
|
|
4
|
-
color:
|
|
4
|
+
color: string;
|
|
5
5
|
text: string;
|
|
6
6
|
}
|
|
7
7
|
export declare function computeComponentDiffLines(current: ComponentTypeSummary, proposed: Record<string, unknown>, changeClassification?: ChangeClassification): PropertyDiffLine[];
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { FlowState } from '../flow/types.js';
|
|
2
|
+
/** What an import produced, so the screens after the work can describe what happened and not a fixed pair. */
|
|
3
|
+
export interface Produced {
|
|
4
|
+
components: boolean;
|
|
5
|
+
tokens: boolean;
|
|
6
|
+
}
|
|
7
|
+
/** Components exist when extraction ran; tokens exist when the token stage left a catalog or a session behind. */
|
|
8
|
+
export declare function producedOf(state: Pick<FlowState, 'extractSessionId' | 'tokensPath' | 'tokenSessionId'>): Produced;
|
|
9
|
+
/**
|
|
10
|
+
* How the saved file is described: the file is always named `components.json`, but when only tokens were generated it
|
|
11
|
+
* holds just the tokens, and calling it a components file would mislead.
|
|
12
|
+
*/
|
|
13
|
+
export declare function fileSummaryLabel({ components }: Produced): string;
|
|
14
|
+
/** "component types and design tokens", "design tokens", or "component types": the things this run writes. */
|
|
15
|
+
export declare function writtenThings({ components, tokens }: Produced): string;
|
|
@@ -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';
|
|
@@ -24,6 +24,8 @@ export type FormNotice = {
|
|
|
24
24
|
text: string;
|
|
25
25
|
};
|
|
26
26
|
interface FieldFormProps<K extends string> {
|
|
27
|
+
/** Shown above the form, outside its padding, such as the import's step header. */
|
|
28
|
+
header?: React.ReactNode;
|
|
27
29
|
title: string;
|
|
28
30
|
/** What this form is for, shown dimmed under the title. */
|
|
29
31
|
subtitle?: string;
|
|
@@ -31,8 +33,12 @@ interface FieldFormProps<K extends string> {
|
|
|
31
33
|
values: Record<K, string>;
|
|
32
34
|
onChange: (key: K, value: string) => void;
|
|
33
35
|
onSave: () => void;
|
|
36
|
+
/** What `s` does, in the control hints. */
|
|
37
|
+
saveLabel?: string;
|
|
34
38
|
/** Leaves without saving. */
|
|
35
39
|
onQuit: () => void;
|
|
40
|
+
/** What Esc does, in the control hints. */
|
|
41
|
+
quitLabel?: string;
|
|
36
42
|
/** Rows after the fields that are run, not edited. They share the cursor with the fields. */
|
|
37
43
|
actions?: readonly FormAction[];
|
|
38
44
|
notice?: FormNotice | null;
|
|
@@ -59,5 +65,5 @@ export declare function FormReadOnlyRow({ label, labelWidth, children, }: {
|
|
|
59
65
|
* While one is open, keys type into it (so a "q" in a path is just a "q"), and Esc closes it and restores the old value.
|
|
60
66
|
* Actions sit after the fields and take the same cursor: Enter runs one, and `c` does nothing on it.
|
|
61
67
|
*/
|
|
62
|
-
export declare function FieldForm<K extends string>({ title, subtitle, fields, values, onChange, onSave, onQuit, actions, notice, busy, children, }: FieldFormProps<K>): React.ReactElement;
|
|
68
|
+
export declare function FieldForm<K extends string>({ header, title, subtitle, fields, values, onChange, onSave, saveLabel, onQuit, quitLabel, actions, notice, busy, children, }: FieldFormProps<K>): React.ReactElement;
|
|
63
69
|
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare const IMPORT_STEPS: readonly [{
|
|
3
|
+
readonly id: "setup";
|
|
4
|
+
readonly label: "Setup";
|
|
5
|
+
}, {
|
|
6
|
+
readonly id: "extraction";
|
|
7
|
+
readonly label: "Extract";
|
|
8
|
+
}, {
|
|
9
|
+
readonly id: "scope-gate";
|
|
10
|
+
readonly label: "Select";
|
|
11
|
+
}, {
|
|
12
|
+
readonly id: "generation";
|
|
13
|
+
readonly label: "Generate";
|
|
14
|
+
}, {
|
|
15
|
+
readonly id: "review";
|
|
16
|
+
readonly label: "Review";
|
|
17
|
+
}, {
|
|
18
|
+
readonly id: "push";
|
|
19
|
+
readonly label: "Push";
|
|
20
|
+
}];
|
|
21
|
+
export type ImportStepId = (typeof IMPORT_STEPS)[number]['id'];
|
|
22
|
+
export interface StepHeaderProps {
|
|
23
|
+
step: ImportStepId | 'done';
|
|
24
|
+
}
|
|
25
|
+
export declare function StepHeader({ step }: StepHeaderProps): React.ReactElement;
|
|
26
|
+
export {};
|
package/dist/src/tui/theme.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export declare const PALETTE: {
|
|
|
5
5
|
readonly muted: "#aec1cc";
|
|
6
6
|
readonly border: "#aec1cc";
|
|
7
7
|
readonly accent: "#40a0ff";
|
|
8
|
+
readonly onAccent: "#111B2B";
|
|
8
9
|
readonly error: "#ff707d";
|
|
9
10
|
readonly success: "#5DB057";
|
|
10
11
|
readonly warning: "#FFC835";
|
|
@@ -13,6 +14,7 @@ export declare const PALETTE: {
|
|
|
13
14
|
readonly muted: "#5A657C";
|
|
14
15
|
readonly border: "#5A657C";
|
|
15
16
|
readonly accent: "#0059c8";
|
|
17
|
+
readonly onAccent: "#FFFFFF";
|
|
16
18
|
readonly error: "#bd002a";
|
|
17
19
|
readonly success: "#006D23";
|
|
18
20
|
readonly warning: "#CC4500";
|
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-6d56b670.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-
|
|
49
|
-
"@contentful/experience-design-system-types": "2.37.1-dev-build-
|
|
48
|
+
"@contentful/experience-design-system-backend-pipeline": "2.37.1-dev-build-6d56b670.0",
|
|
49
|
+
"@contentful/experience-design-system-types": "2.37.1-dev-build-6d56b670.0"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@tsconfig/node24": "^24.0.4",
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export declare const CREDENTIALS_CONTROLS: readonly [{
|
|
2
|
-
readonly keys: "Enter";
|
|
3
|
-
readonly label: "Next field / Continue";
|
|
4
|
-
}, {
|
|
5
|
-
readonly keys: "Tab";
|
|
6
|
-
readonly label: "Switch field";
|
|
7
|
-
}, {
|
|
8
|
-
readonly keys: "Ctrl+S";
|
|
9
|
-
readonly label: "Skip (no push)";
|
|
10
|
-
}, {
|
|
11
|
-
readonly keys: "Esc";
|
|
12
|
-
readonly label: "Back";
|
|
13
|
-
}];
|
|
14
|
-
interface CredentialsHandlers {
|
|
15
|
-
disabled: boolean;
|
|
16
|
-
onBack: () => void;
|
|
17
|
-
onNextField: () => void;
|
|
18
|
-
onSkip: () => void;
|
|
19
|
-
}
|
|
20
|
-
export declare function useCredentialsControls(handlers: CredentialsHandlers): void;
|
|
21
|
-
export {};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
export type { TokenStrategy } from '../06-extraction/types.js';
|
|
2
|
-
export type TokensState = {
|
|
3
|
-
kind: 'none';
|
|
4
|
-
} | {
|
|
5
|
-
kind: 'cached';
|
|
6
|
-
tokensPath: string;
|
|
7
|
-
sourceChanged: boolean;
|
|
8
|
-
};
|
|
9
|
-
interface InspectInput {
|
|
10
|
-
rawTokensPath: string;
|
|
11
|
-
/** The `.contentful` folder: the sessions' `dsi-import` folders sit inside it, and an older `tokens.json` may sit in it. */
|
|
12
|
-
contentfulDir: string;
|
|
13
|
-
cache: boolean;
|
|
14
|
-
}
|
|
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
|
-
};
|
|
@@ -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 {};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export declare const PALETTE: {
|
|
2
|
-
readonly info: "#40a0ff" | "#0059c8";
|
|
3
|
-
readonly success: "#5DB057" | "#006D23";
|
|
4
|
-
readonly error: "#ff707d" | "#bd002a";
|
|
5
|
-
readonly warning: "#FFC835" | "#CC4500";
|
|
6
|
-
readonly muted: "#aec1cc" | "#5A657C";
|
|
7
|
-
readonly border: "#aec1cc" | "#5A657C";
|
|
8
|
-
};
|