@contentful/experience-design-system-cli 2.37.1-dev-build-2be54904.0 → 2.37.1-dev-build-283166e5.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 +2336 -1518
- package/dist/index.js +2473 -1550
- package/dist/package.json +1 -1
- package/dist/src/tui/import/steps/01-welcome/logic.d.ts +0 -5
- package/dist/src/tui/import/steps/02-token-input/logic.d.ts +0 -5
- package/dist/src/tui/import/steps/03-path-validation/logic.d.ts +0 -6
- package/dist/src/tui/shared/components/MenuScreen.d.ts +33 -0
- package/dist/src/tui/shared/components/PathStepScreen.d.ts +28 -0
- package/package.json +3 -3
- package/dist/src/tui/import/steps/01-welcome/controls.d.ts +0 -11
- package/dist/src/tui/import/steps/02-token-input/controls.d.ts +0 -11
- package/dist/src/tui/import/steps/03-path-validation/controls.d.ts +0 -13
package/dist/package.json
CHANGED
|
@@ -13,7 +13,6 @@ export type ScanResult = {
|
|
|
13
13
|
failure: ScanFailureCode;
|
|
14
14
|
};
|
|
15
15
|
export type PathPhase = 'scanning' | 'ready' | 'failed';
|
|
16
|
-
export type KeyAction = 'confirm' | 'change-path' | 'back';
|
|
17
16
|
export interface SummaryRow {
|
|
18
17
|
label: string;
|
|
19
18
|
count: number;
|
|
@@ -28,10 +27,6 @@ export interface FailureMessage {
|
|
|
28
27
|
headline: string;
|
|
29
28
|
hints: string[];
|
|
30
29
|
}
|
|
31
|
-
interface Key {
|
|
32
|
-
escape: boolean;
|
|
33
|
-
return: boolean;
|
|
34
|
-
}
|
|
35
30
|
export declare function describeFailure(failure: ScanFailureCode, path: string): FailureMessage;
|
|
36
31
|
/**
|
|
37
32
|
* The scan result as rows and a warning. When the import does not generate tokens (components only), `.json` files are
|
|
@@ -41,5 +36,4 @@ export declare function summarize(counts: FileCounts, { hasTokens }?: {
|
|
|
41
36
|
hasTokens?: boolean;
|
|
42
37
|
}): Summary;
|
|
43
38
|
export declare function phaseOf(scan: ScanResult | undefined): PathPhase;
|
|
44
|
-
export declare function keyAction(phase: PathPhase, input: string, key: Key): KeyAction | undefined;
|
|
45
39
|
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface MenuItem<C extends string> {
|
|
3
|
+
choice: C;
|
|
4
|
+
label: string;
|
|
5
|
+
/** What choosing it does, shown dimmed after the label. */
|
|
6
|
+
description: string;
|
|
7
|
+
}
|
|
8
|
+
interface MenuRow {
|
|
9
|
+
label: string;
|
|
10
|
+
/** Shown bold; an empty value shows "(empty)". */
|
|
11
|
+
value: string;
|
|
12
|
+
}
|
|
13
|
+
interface MenuScreenProps<C extends string> {
|
|
14
|
+
title: string;
|
|
15
|
+
subtitle?: string;
|
|
16
|
+
menu: readonly MenuItem<C>[];
|
|
17
|
+
/** Read-only values shown under the menu, lined up with it. */
|
|
18
|
+
rows?: readonly MenuRow[];
|
|
19
|
+
onChoose: (choice: C) => void;
|
|
20
|
+
/** What Esc does. */
|
|
21
|
+
onEscape: () => void;
|
|
22
|
+
escapeLabel?: string;
|
|
23
|
+
/** Ignores keys while something is in flight. */
|
|
24
|
+
busy?: boolean;
|
|
25
|
+
/** Shown after the rows, for read-only content that belongs to the same screen. */
|
|
26
|
+
children?: React.ReactNode;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* The layout the setup steps share: a title, a menu of actions on top, the read-only data below it and the key hints.
|
|
30
|
+
* Values are never edited here; an `Edit` item opens the step's own input instead.
|
|
31
|
+
*/
|
|
32
|
+
export declare function MenuScreen<C extends string>({ title, subtitle, menu, rows, onChoose, onEscape, escapeLabel, busy, children, }: MenuScreenProps<C>): React.ReactElement;
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
type PathCheck = {
|
|
3
|
+
ok: true;
|
|
4
|
+
path: string;
|
|
5
|
+
} | {
|
|
6
|
+
ok: false;
|
|
7
|
+
error: string;
|
|
8
|
+
resolvedPath?: string;
|
|
9
|
+
};
|
|
10
|
+
interface PathStepScreenProps {
|
|
11
|
+
title: string;
|
|
12
|
+
subtitle: string;
|
|
13
|
+
/** The label of the read-only value and of the input, such as "Project path". */
|
|
14
|
+
label: string;
|
|
15
|
+
initialPath?: string;
|
|
16
|
+
/** Trims the typed value; null when nothing was entered. */
|
|
17
|
+
toPath: (value: string) => string | null;
|
|
18
|
+
/** Runs when Continue is chosen. Its path is handed on; its error is shown under the path. */
|
|
19
|
+
check: (path: string) => PathCheck;
|
|
20
|
+
onContinue: (path: string) => void;
|
|
21
|
+
onBack: () => void;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* A step that asks for one path. A path that is already known opens read-only with the menu above it, like the
|
|
25
|
+
* credentials step; with none yet it opens straight in the input. `Edit` opens the input and Enter returns to the menu.
|
|
26
|
+
*/
|
|
27
|
+
export declare function PathStepScreen({ title, subtitle, label, initialPath, toPath, check, onContinue, onBack, }: PathStepScreenProps): React.ReactElement;
|
|
28
|
+
export {};
|
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-283166e5.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-
|
|
49
|
-
"@contentful/experience-design-system-
|
|
48
|
+
"@contentful/experience-design-system-types": "2.37.1-dev-build-283166e5.0",
|
|
49
|
+
"@contentful/experience-design-system-backend-pipeline": "2.37.1-dev-build-283166e5.0"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@tsconfig/node24": "^24.0.4",
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export declare const WELCOME_CONTROLS: readonly [{
|
|
2
|
-
readonly keys: "Enter";
|
|
3
|
-
readonly label: "Continue";
|
|
4
|
-
}, {
|
|
5
|
-
readonly keys: "Ctrl+D";
|
|
6
|
-
readonly label: "Clear";
|
|
7
|
-
}, {
|
|
8
|
-
readonly keys: "Esc";
|
|
9
|
-
readonly label: "Back";
|
|
10
|
-
}];
|
|
11
|
-
export declare function useWelcomeControls(onQuit: () => void): void;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export declare const TOKEN_INPUT_CONTROLS: readonly [{
|
|
2
|
-
readonly keys: "Enter";
|
|
3
|
-
readonly label: "Continue";
|
|
4
|
-
}, {
|
|
5
|
-
readonly keys: "Ctrl+D";
|
|
6
|
-
readonly label: "Clear";
|
|
7
|
-
}, {
|
|
8
|
-
readonly keys: "Esc";
|
|
9
|
-
readonly label: "Back";
|
|
10
|
-
}];
|
|
11
|
-
export declare function useTokenInputControls(onBack: () => void): void;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { type PathPhase } from './logic.js';
|
|
2
|
-
interface Control {
|
|
3
|
-
keys: string;
|
|
4
|
-
label: string;
|
|
5
|
-
}
|
|
6
|
-
interface PathValidationHandlers {
|
|
7
|
-
onConfirm: () => void;
|
|
8
|
-
onChangePath: () => void;
|
|
9
|
-
onBack: () => void;
|
|
10
|
-
}
|
|
11
|
-
export declare function controlsFor(phase: PathPhase): readonly Control[];
|
|
12
|
-
export declare function usePathValidationControls(phase: PathPhase, handlers: PathValidationHandlers): void;
|
|
13
|
-
export {};
|