@contentful/experience-design-system-cli 2.43.1-dev-build-b2134432.0 → 2.43.1-dev-build-1205d418.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 +93 -46
- package/dist/index.js +109 -48
- package/dist/package.json +1 -1
- package/dist/src/tui/import/steps/00-preflight/logic.d.ts +2 -0
- package/dist/src/tui/import/steps/01-welcome/log.d.ts +13 -0
- package/dist/src/tui/import/steps/02-token-input/log.d.ts +24 -0
- package/dist/src/tui/import/steps/07-scope-gate/use-scope-gate.d.ts +1 -1
- package/package.json +3 -3
package/dist/app.js
CHANGED
|
@@ -2736,6 +2736,9 @@ var IMPORT_TARGET_OPTIONS = [
|
|
|
2736
2736
|
{ target: "tokens", label: "Design tokens only" },
|
|
2737
2737
|
{ target: "components", label: "Components only" }
|
|
2738
2738
|
];
|
|
2739
|
+
function importModeLabel(target) {
|
|
2740
|
+
return IMPORT_TARGET_OPTIONS.find((option) => option.target === target).label;
|
|
2741
|
+
}
|
|
2739
2742
|
var COMPONENTS_OVERVIEW = [
|
|
2740
2743
|
{ description: "Extract components from your codebase", ai: true },
|
|
2741
2744
|
{ description: "Review what was extracted", ai: false },
|
|
@@ -17642,9 +17645,8 @@ async function collectPreflightContext() {
|
|
|
17642
17645
|
}
|
|
17643
17646
|
function preflightLog(chosen, terminal, context) {
|
|
17644
17647
|
const { columns, rows } = terminal;
|
|
17645
|
-
const label = IMPORT_TARGET_OPTIONS.find((option) => option.target === chosen)?.label;
|
|
17646
17648
|
const summary = [
|
|
17647
|
-
|
|
17649
|
+
chosen ? `Chose: ${importModeLabel(chosen)}` : "Left the import without choosing",
|
|
17648
17650
|
columns && rows ? `Terminal: ${columns} \xD7 ${rows}` : "Terminal: size unknown"
|
|
17649
17651
|
];
|
|
17650
17652
|
if (context) {
|
|
@@ -18237,29 +18239,46 @@ function useWelcomeControls(onQuit) {
|
|
|
18237
18239
|
});
|
|
18238
18240
|
}
|
|
18239
18241
|
|
|
18242
|
+
// packages/experience-design-system-cli/src/tui/import/steps/01-welcome/log.ts
|
|
18243
|
+
function welcomeLog({
|
|
18244
|
+
mode,
|
|
18245
|
+
projectPath,
|
|
18246
|
+
initialPath,
|
|
18247
|
+
emptySubmits
|
|
18248
|
+
}) {
|
|
18249
|
+
const kept = projectPath !== null && initialPath.trim() !== "" && projectPath === initialPath.trim();
|
|
18250
|
+
const source = projectPath === null ? null : kept ? "prefilled" : "typed";
|
|
18251
|
+
const summary = [
|
|
18252
|
+
`Import mode: ${importModeLabel(mode)}`,
|
|
18253
|
+
projectPath === null ? "Project path: none (left the import)" : `Project path: ${projectPath}`,
|
|
18254
|
+
...source ? [`Path source: ${source === "prefilled" ? "pre-filled, kept as is" : "typed by the user"}`] : [],
|
|
18255
|
+
`Empty submits: ${emptySubmits}`
|
|
18256
|
+
];
|
|
18257
|
+
return {
|
|
18258
|
+
summary,
|
|
18259
|
+
data: { import_mode: mode, project_path: projectPath, path_source: source, empty_submits: emptySubmits }
|
|
18260
|
+
};
|
|
18261
|
+
}
|
|
18262
|
+
|
|
18240
18263
|
// packages/experience-design-system-cli/src/tui/import/steps/01-welcome/screen.tsx
|
|
18241
18264
|
import { jsx as jsx11, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
18242
18265
|
function WelcomeScreen({ mode, onContinue, onQuit, initialPath = "" }) {
|
|
18243
18266
|
const [projectPath, setProjectPath] = useState6(initialPath);
|
|
18244
18267
|
const visit = useRef3({ emptySubmits: 0 }).current;
|
|
18245
18268
|
useEffect6(() => {
|
|
18246
|
-
startDebugRun({
|
|
18247
|
-
flow: "import/welcome",
|
|
18248
|
-
step: "01-welcome",
|
|
18249
|
-
menuOption: "Welcome",
|
|
18250
|
-
inputs: { import_mode: mode, initial_path: initialPath }
|
|
18251
|
-
});
|
|
18269
|
+
startDebugRun({ flow: "import/welcome", step: "01-welcome", menuOption: "Welcome" });
|
|
18252
18270
|
}, []);
|
|
18253
|
-
const
|
|
18254
|
-
|
|
18255
|
-
|
|
18256
|
-
|
|
18257
|
-
|
|
18258
|
-
|
|
18259
|
-
},
|
|
18260
|
-
status: "success",
|
|
18261
|
-
exitMethod: "discarded"
|
|
18271
|
+
const finish = (path5) => {
|
|
18272
|
+
const { summary, data } = welcomeLog({
|
|
18273
|
+
mode,
|
|
18274
|
+
projectPath: path5,
|
|
18275
|
+
initialPath,
|
|
18276
|
+
emptySubmits: visit.emptySubmits
|
|
18262
18277
|
});
|
|
18278
|
+
void finishDebugRun({ summary, outputs: data, status: "success", exitMethod: path5 ? "saved" : "discarded" });
|
|
18279
|
+
};
|
|
18280
|
+
const quit = () => {
|
|
18281
|
+
finish(null);
|
|
18263
18282
|
onQuit();
|
|
18264
18283
|
};
|
|
18265
18284
|
useWelcomeControls(quit);
|
|
@@ -18269,15 +18288,7 @@ function WelcomeScreen({ mode, onContinue, onQuit, initialPath = "" }) {
|
|
|
18269
18288
|
visit.emptySubmits += 1;
|
|
18270
18289
|
return;
|
|
18271
18290
|
}
|
|
18272
|
-
|
|
18273
|
-
outputs: {
|
|
18274
|
-
project_path: path5,
|
|
18275
|
-
changed_from_initial: path5 !== initialPath.trim(),
|
|
18276
|
-
empty_submits: visit.emptySubmits
|
|
18277
|
-
},
|
|
18278
|
-
status: "success",
|
|
18279
|
-
exitMethod: "saved"
|
|
18280
|
-
});
|
|
18291
|
+
finish(path5);
|
|
18281
18292
|
onContinue(path5);
|
|
18282
18293
|
};
|
|
18283
18294
|
return /* @__PURE__ */ jsxs10(Box10, { flexDirection: "column", children: [
|
|
@@ -18325,6 +18336,40 @@ function useTokenInputControls(onBack) {
|
|
|
18325
18336
|
});
|
|
18326
18337
|
}
|
|
18327
18338
|
|
|
18339
|
+
// packages/experience-design-system-cli/src/tui/import/steps/02-token-input/log.ts
|
|
18340
|
+
function tokenInputLog({
|
|
18341
|
+
mode,
|
|
18342
|
+
tokenPath,
|
|
18343
|
+
enteredPath,
|
|
18344
|
+
initialPath,
|
|
18345
|
+
rejected,
|
|
18346
|
+
emptySubmits,
|
|
18347
|
+
endedOnError
|
|
18348
|
+
}) {
|
|
18349
|
+
const kept = tokenPath !== null && initialPath.trim() !== "" && enteredPath === initialPath.trim();
|
|
18350
|
+
const source = tokenPath === null ? null : kept ? "prefilled" : "typed";
|
|
18351
|
+
const summary = [
|
|
18352
|
+
`Import mode: ${importModeLabel(mode)}`,
|
|
18353
|
+
tokenPath === null ? "Token file: none (went back)" : `Token file: ${tokenPath}`,
|
|
18354
|
+
...source ? [`Path source: ${source === "prefilled" ? "pre-filled, kept as is" : "typed by the user"}`] : [],
|
|
18355
|
+
`Rejected paths: ${rejected.length}`,
|
|
18356
|
+
...rejected.map((attempt) => ` "${attempt.entered}" \u2192 ${attempt.error}`),
|
|
18357
|
+
`Empty submits: ${emptySubmits}`,
|
|
18358
|
+
...endedOnError ? [`Went back while this error was showing: ${endedOnError}`] : []
|
|
18359
|
+
];
|
|
18360
|
+
return {
|
|
18361
|
+
summary,
|
|
18362
|
+
data: {
|
|
18363
|
+
import_mode: mode,
|
|
18364
|
+
token_path: tokenPath,
|
|
18365
|
+
path_source: source,
|
|
18366
|
+
rejected_attempts: rejected,
|
|
18367
|
+
empty_submits: emptySubmits,
|
|
18368
|
+
...endedOnError ? { error: endedOnError } : {}
|
|
18369
|
+
}
|
|
18370
|
+
};
|
|
18371
|
+
}
|
|
18372
|
+
|
|
18328
18373
|
// packages/experience-design-system-cli/src/tui/import/steps/02-token-input/validate-path.ts
|
|
18329
18374
|
import { statSync as statSync5 } from "node:fs";
|
|
18330
18375
|
|
|
@@ -18376,20 +18421,29 @@ function TokenInputScreen({
|
|
|
18376
18421
|
const [tokenPath, setTokenPath] = useState7(initialPath);
|
|
18377
18422
|
const [failure, setFailure] = useState7(null);
|
|
18378
18423
|
const rejected = useRef4([]).current;
|
|
18424
|
+
const visit = useRef4({ emptySubmits: 0 }).current;
|
|
18379
18425
|
useEffect7(() => {
|
|
18380
|
-
startDebugRun({
|
|
18381
|
-
flow: "import/token-input",
|
|
18382
|
-
step: "02-token-input",
|
|
18383
|
-
menuOption: "Token input",
|
|
18384
|
-
inputs: { import_mode: mode, initial_path: initialPath }
|
|
18385
|
-
});
|
|
18426
|
+
startDebugRun({ flow: "import/token-input", step: "02-token-input", menuOption: "Token input" });
|
|
18386
18427
|
}, []);
|
|
18387
|
-
const
|
|
18428
|
+
const finish = (tokenPath2, enteredPath, endedOnError) => {
|
|
18429
|
+
const { summary, data } = tokenInputLog({
|
|
18430
|
+
mode,
|
|
18431
|
+
tokenPath: tokenPath2,
|
|
18432
|
+
enteredPath,
|
|
18433
|
+
initialPath,
|
|
18434
|
+
rejected,
|
|
18435
|
+
emptySubmits: visit.emptySubmits,
|
|
18436
|
+
endedOnError
|
|
18437
|
+
});
|
|
18388
18438
|
void finishDebugRun({
|
|
18389
|
-
|
|
18390
|
-
|
|
18391
|
-
|
|
18439
|
+
summary,
|
|
18440
|
+
outputs: data,
|
|
18441
|
+
status: endedOnError ? "error" : "success",
|
|
18442
|
+
exitMethod: tokenPath2 ? "saved" : "discarded"
|
|
18392
18443
|
});
|
|
18444
|
+
};
|
|
18445
|
+
const back = () => {
|
|
18446
|
+
finish(null, tokenPath, failure?.error);
|
|
18393
18447
|
onBack();
|
|
18394
18448
|
};
|
|
18395
18449
|
useTokenInputControls(back);
|
|
@@ -18410,7 +18464,8 @@ function TokenInputScreen({
|
|
|
18410
18464
|
const submit = (value) => {
|
|
18411
18465
|
const rawPath = toTokenPath(value);
|
|
18412
18466
|
if (!rawPath) {
|
|
18413
|
-
|
|
18467
|
+
visit.emptySubmits += 1;
|
|
18468
|
+
setFailure({ error: "Enter the path to your token file." });
|
|
18414
18469
|
return;
|
|
18415
18470
|
}
|
|
18416
18471
|
const check = validateTokenPath(rawPath);
|
|
@@ -18418,15 +18473,7 @@ function TokenInputScreen({
|
|
|
18418
18473
|
reject(rawPath, { error: check.error, resolvedPath: check.resolvedPath });
|
|
18419
18474
|
return;
|
|
18420
18475
|
}
|
|
18421
|
-
|
|
18422
|
-
outputs: {
|
|
18423
|
-
token_path: check.path,
|
|
18424
|
-
changed_from_initial: rawPath !== initialPath.trim(),
|
|
18425
|
-
rejected_attempts: rejected
|
|
18426
|
-
},
|
|
18427
|
-
status: "success",
|
|
18428
|
-
exitMethod: "saved"
|
|
18429
|
-
});
|
|
18476
|
+
finish(check.path, rawPath);
|
|
18430
18477
|
onConfirm(check.path);
|
|
18431
18478
|
};
|
|
18432
18479
|
return /* @__PURE__ */ jsxs11(Box11, { flexDirection: "column", children: [
|
package/dist/index.js
CHANGED
|
@@ -19758,6 +19758,9 @@ var init_debug_store = __esm({
|
|
|
19758
19758
|
});
|
|
19759
19759
|
|
|
19760
19760
|
// packages/experience-design-system-cli/src/tui/import/steps/00-preflight/logic.ts
|
|
19761
|
+
function importModeLabel(target) {
|
|
19762
|
+
return IMPORT_TARGET_OPTIONS.find((option) => option.target === target).label;
|
|
19763
|
+
}
|
|
19761
19764
|
function overviewFor(target) {
|
|
19762
19765
|
return target === "tokens" ? TOKENS_ONLY_OVERVIEW : COMPONENTS_OVERVIEW;
|
|
19763
19766
|
}
|
|
@@ -20154,9 +20157,8 @@ async function collectPreflightContext() {
|
|
|
20154
20157
|
}
|
|
20155
20158
|
function preflightLog(chosen, terminal, context) {
|
|
20156
20159
|
const { columns, rows } = terminal;
|
|
20157
|
-
const label = IMPORT_TARGET_OPTIONS.find((option) => option.target === chosen)?.label;
|
|
20158
20160
|
const summary = [
|
|
20159
|
-
|
|
20161
|
+
chosen ? `Chose: ${importModeLabel(chosen)}` : "Left the import without choosing",
|
|
20160
20162
|
columns && rows ? `Terminal: ${columns} \xD7 ${rows}` : "Terminal: size unknown"
|
|
20161
20163
|
];
|
|
20162
20164
|
if (context) {
|
|
@@ -20889,6 +20891,33 @@ var init_controls4 = __esm({
|
|
|
20889
20891
|
}
|
|
20890
20892
|
});
|
|
20891
20893
|
|
|
20894
|
+
// packages/experience-design-system-cli/src/tui/import/steps/01-welcome/log.ts
|
|
20895
|
+
function welcomeLog({
|
|
20896
|
+
mode,
|
|
20897
|
+
projectPath,
|
|
20898
|
+
initialPath,
|
|
20899
|
+
emptySubmits
|
|
20900
|
+
}) {
|
|
20901
|
+
const kept = projectPath !== null && initialPath.trim() !== "" && projectPath === initialPath.trim();
|
|
20902
|
+
const source = projectPath === null ? null : kept ? "prefilled" : "typed";
|
|
20903
|
+
const summary = [
|
|
20904
|
+
`Import mode: ${importModeLabel(mode)}`,
|
|
20905
|
+
projectPath === null ? "Project path: none (left the import)" : `Project path: ${projectPath}`,
|
|
20906
|
+
...source ? [`Path source: ${source === "prefilled" ? "pre-filled, kept as is" : "typed by the user"}`] : [],
|
|
20907
|
+
`Empty submits: ${emptySubmits}`
|
|
20908
|
+
];
|
|
20909
|
+
return {
|
|
20910
|
+
summary,
|
|
20911
|
+
data: { import_mode: mode, project_path: projectPath, path_source: source, empty_submits: emptySubmits }
|
|
20912
|
+
};
|
|
20913
|
+
}
|
|
20914
|
+
var init_log2 = __esm({
|
|
20915
|
+
"packages/experience-design-system-cli/src/tui/import/steps/01-welcome/log.ts"() {
|
|
20916
|
+
"use strict";
|
|
20917
|
+
init_logic();
|
|
20918
|
+
}
|
|
20919
|
+
});
|
|
20920
|
+
|
|
20892
20921
|
// packages/experience-design-system-cli/src/tui/import/steps/01-welcome/screen.tsx
|
|
20893
20922
|
import { useEffect as useEffect6, useRef as useRef3, useState as useState6 } from "react";
|
|
20894
20923
|
import { Box as Box10, Text as Text10 } from "ink";
|
|
@@ -20897,23 +20926,19 @@ function WelcomeScreen({ mode, onContinue, onQuit, initialPath = "" }) {
|
|
|
20897
20926
|
const [projectPath, setProjectPath] = useState6(initialPath);
|
|
20898
20927
|
const visit = useRef3({ emptySubmits: 0 }).current;
|
|
20899
20928
|
useEffect6(() => {
|
|
20900
|
-
startDebugRun({
|
|
20901
|
-
flow: "import/welcome",
|
|
20902
|
-
step: "01-welcome",
|
|
20903
|
-
menuOption: "Welcome",
|
|
20904
|
-
inputs: { import_mode: mode, initial_path: initialPath }
|
|
20905
|
-
});
|
|
20929
|
+
startDebugRun({ flow: "import/welcome", step: "01-welcome", menuOption: "Welcome" });
|
|
20906
20930
|
}, []);
|
|
20907
|
-
const
|
|
20908
|
-
|
|
20909
|
-
|
|
20910
|
-
|
|
20911
|
-
|
|
20912
|
-
|
|
20913
|
-
},
|
|
20914
|
-
status: "success",
|
|
20915
|
-
exitMethod: "discarded"
|
|
20931
|
+
const finish = (path5) => {
|
|
20932
|
+
const { summary, data } = welcomeLog({
|
|
20933
|
+
mode,
|
|
20934
|
+
projectPath: path5,
|
|
20935
|
+
initialPath,
|
|
20936
|
+
emptySubmits: visit.emptySubmits
|
|
20916
20937
|
});
|
|
20938
|
+
void finishDebugRun({ summary, outputs: data, status: "success", exitMethod: path5 ? "saved" : "discarded" });
|
|
20939
|
+
};
|
|
20940
|
+
const quit = () => {
|
|
20941
|
+
finish(null);
|
|
20917
20942
|
onQuit();
|
|
20918
20943
|
};
|
|
20919
20944
|
useWelcomeControls(quit);
|
|
@@ -20923,15 +20948,7 @@ function WelcomeScreen({ mode, onContinue, onQuit, initialPath = "" }) {
|
|
|
20923
20948
|
visit.emptySubmits += 1;
|
|
20924
20949
|
return;
|
|
20925
20950
|
}
|
|
20926
|
-
|
|
20927
|
-
outputs: {
|
|
20928
|
-
project_path: path5,
|
|
20929
|
-
changed_from_initial: path5 !== initialPath.trim(),
|
|
20930
|
-
empty_submits: visit.emptySubmits
|
|
20931
|
-
},
|
|
20932
|
-
status: "success",
|
|
20933
|
-
exitMethod: "saved"
|
|
20934
|
-
});
|
|
20951
|
+
finish(path5);
|
|
20935
20952
|
onContinue(path5);
|
|
20936
20953
|
};
|
|
20937
20954
|
return /* @__PURE__ */ jsxs10(Box10, { flexDirection: "column", children: [
|
|
@@ -20956,6 +20973,7 @@ var init_screen2 = __esm({
|
|
|
20956
20973
|
init_debug_store();
|
|
20957
20974
|
init_ClearableTextInput();
|
|
20958
20975
|
init_controls4();
|
|
20976
|
+
init_log2();
|
|
20959
20977
|
init_logic5();
|
|
20960
20978
|
init_ControlHints();
|
|
20961
20979
|
init_StepHeader();
|
|
@@ -20996,6 +21014,46 @@ var init_controls5 = __esm({
|
|
|
20996
21014
|
}
|
|
20997
21015
|
});
|
|
20998
21016
|
|
|
21017
|
+
// packages/experience-design-system-cli/src/tui/import/steps/02-token-input/log.ts
|
|
21018
|
+
function tokenInputLog({
|
|
21019
|
+
mode,
|
|
21020
|
+
tokenPath,
|
|
21021
|
+
enteredPath,
|
|
21022
|
+
initialPath,
|
|
21023
|
+
rejected,
|
|
21024
|
+
emptySubmits,
|
|
21025
|
+
endedOnError
|
|
21026
|
+
}) {
|
|
21027
|
+
const kept = tokenPath !== null && initialPath.trim() !== "" && enteredPath === initialPath.trim();
|
|
21028
|
+
const source = tokenPath === null ? null : kept ? "prefilled" : "typed";
|
|
21029
|
+
const summary = [
|
|
21030
|
+
`Import mode: ${importModeLabel(mode)}`,
|
|
21031
|
+
tokenPath === null ? "Token file: none (went back)" : `Token file: ${tokenPath}`,
|
|
21032
|
+
...source ? [`Path source: ${source === "prefilled" ? "pre-filled, kept as is" : "typed by the user"}`] : [],
|
|
21033
|
+
`Rejected paths: ${rejected.length}`,
|
|
21034
|
+
...rejected.map((attempt) => ` "${attempt.entered}" \u2192 ${attempt.error}`),
|
|
21035
|
+
`Empty submits: ${emptySubmits}`,
|
|
21036
|
+
...endedOnError ? [`Went back while this error was showing: ${endedOnError}`] : []
|
|
21037
|
+
];
|
|
21038
|
+
return {
|
|
21039
|
+
summary,
|
|
21040
|
+
data: {
|
|
21041
|
+
import_mode: mode,
|
|
21042
|
+
token_path: tokenPath,
|
|
21043
|
+
path_source: source,
|
|
21044
|
+
rejected_attempts: rejected,
|
|
21045
|
+
empty_submits: emptySubmits,
|
|
21046
|
+
...endedOnError ? { error: endedOnError } : {}
|
|
21047
|
+
}
|
|
21048
|
+
};
|
|
21049
|
+
}
|
|
21050
|
+
var init_log3 = __esm({
|
|
21051
|
+
"packages/experience-design-system-cli/src/tui/import/steps/02-token-input/log.ts"() {
|
|
21052
|
+
"use strict";
|
|
21053
|
+
init_logic();
|
|
21054
|
+
}
|
|
21055
|
+
});
|
|
21056
|
+
|
|
20999
21057
|
// packages/experience-design-system-cli/src/tui/import/resolve-user-path.ts
|
|
21000
21058
|
import { homedir as homedir3 } from "node:os";
|
|
21001
21059
|
import { resolve as resolve21 } from "node:path";
|
|
@@ -21057,20 +21115,29 @@ function TokenInputScreen({
|
|
|
21057
21115
|
const [tokenPath, setTokenPath] = useState7(initialPath);
|
|
21058
21116
|
const [failure, setFailure] = useState7(null);
|
|
21059
21117
|
const rejected = useRef4([]).current;
|
|
21118
|
+
const visit = useRef4({ emptySubmits: 0 }).current;
|
|
21060
21119
|
useEffect7(() => {
|
|
21061
|
-
startDebugRun({
|
|
21062
|
-
flow: "import/token-input",
|
|
21063
|
-
step: "02-token-input",
|
|
21064
|
-
menuOption: "Token input",
|
|
21065
|
-
inputs: { import_mode: mode, initial_path: initialPath }
|
|
21066
|
-
});
|
|
21120
|
+
startDebugRun({ flow: "import/token-input", step: "02-token-input", menuOption: "Token input" });
|
|
21067
21121
|
}, []);
|
|
21068
|
-
const
|
|
21122
|
+
const finish = (tokenPath2, enteredPath, endedOnError) => {
|
|
21123
|
+
const { summary, data } = tokenInputLog({
|
|
21124
|
+
mode,
|
|
21125
|
+
tokenPath: tokenPath2,
|
|
21126
|
+
enteredPath,
|
|
21127
|
+
initialPath,
|
|
21128
|
+
rejected,
|
|
21129
|
+
emptySubmits: visit.emptySubmits,
|
|
21130
|
+
endedOnError
|
|
21131
|
+
});
|
|
21069
21132
|
void finishDebugRun({
|
|
21070
|
-
|
|
21071
|
-
|
|
21072
|
-
|
|
21133
|
+
summary,
|
|
21134
|
+
outputs: data,
|
|
21135
|
+
status: endedOnError ? "error" : "success",
|
|
21136
|
+
exitMethod: tokenPath2 ? "saved" : "discarded"
|
|
21073
21137
|
});
|
|
21138
|
+
};
|
|
21139
|
+
const back = () => {
|
|
21140
|
+
finish(null, tokenPath, failure?.error);
|
|
21074
21141
|
onBack();
|
|
21075
21142
|
};
|
|
21076
21143
|
useTokenInputControls(back);
|
|
@@ -21091,7 +21158,8 @@ function TokenInputScreen({
|
|
|
21091
21158
|
const submit = (value) => {
|
|
21092
21159
|
const rawPath = toTokenPath(value);
|
|
21093
21160
|
if (!rawPath) {
|
|
21094
|
-
|
|
21161
|
+
visit.emptySubmits += 1;
|
|
21162
|
+
setFailure({ error: "Enter the path to your token file." });
|
|
21095
21163
|
return;
|
|
21096
21164
|
}
|
|
21097
21165
|
const check = validateTokenPath(rawPath);
|
|
@@ -21099,15 +21167,7 @@ function TokenInputScreen({
|
|
|
21099
21167
|
reject(rawPath, { error: check.error, resolvedPath: check.resolvedPath });
|
|
21100
21168
|
return;
|
|
21101
21169
|
}
|
|
21102
|
-
|
|
21103
|
-
outputs: {
|
|
21104
|
-
token_path: check.path,
|
|
21105
|
-
changed_from_initial: rawPath !== initialPath.trim(),
|
|
21106
|
-
rejected_attempts: rejected
|
|
21107
|
-
},
|
|
21108
|
-
status: "success",
|
|
21109
|
-
exitMethod: "saved"
|
|
21110
|
-
});
|
|
21170
|
+
finish(check.path, rawPath);
|
|
21111
21171
|
onConfirm(check.path);
|
|
21112
21172
|
};
|
|
21113
21173
|
return /* @__PURE__ */ jsxs11(Box11, { flexDirection: "column", children: [
|
|
@@ -21144,6 +21204,7 @@ var init_screen3 = __esm({
|
|
|
21144
21204
|
init_debug_store();
|
|
21145
21205
|
init_ClearableTextInput();
|
|
21146
21206
|
init_controls5();
|
|
21207
|
+
init_log3();
|
|
21147
21208
|
init_logic6();
|
|
21148
21209
|
init_validate_path();
|
|
21149
21210
|
init_ControlHints();
|
|
@@ -22745,7 +22806,7 @@ function scopeGateLogOutputs(components, decisions) {
|
|
|
22745
22806
|
};
|
|
22746
22807
|
}
|
|
22747
22808
|
var MAX_NAMES, capped;
|
|
22748
|
-
var
|
|
22809
|
+
var init_log4 = __esm({
|
|
22749
22810
|
"packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/log.ts"() {
|
|
22750
22811
|
"use strict";
|
|
22751
22812
|
MAX_NAMES = 20;
|
|
@@ -25644,7 +25705,7 @@ var init_screen8 = __esm({
|
|
|
25644
25705
|
"use strict";
|
|
25645
25706
|
init_debug_store();
|
|
25646
25707
|
init_StepHeader();
|
|
25647
|
-
|
|
25708
|
+
init_log4();
|
|
25648
25709
|
init_tokens_column();
|
|
25649
25710
|
init_load();
|
|
25650
25711
|
init_logic10();
|
package/dist/package.json
CHANGED
|
@@ -4,6 +4,8 @@ export declare const IMPORT_TARGET_OPTIONS: ReadonlyArray<{
|
|
|
4
4
|
target: ImportTarget;
|
|
5
5
|
label: string;
|
|
6
6
|
}>;
|
|
7
|
+
/** The words the user saw for a choice. The logs of the steps after the preflight say it, since it decides which steps run. */
|
|
8
|
+
export declare function importModeLabel(target: ImportTarget): string;
|
|
7
9
|
export declare function overviewFor(target: ImportTarget): readonly OverviewStep[];
|
|
8
10
|
export type ImportStepId = 'project' | 'token-file' | 'path-validation' | 'credentials' | 'component-extraction' | 'token-generation' | 'scope-gate' | 'generation' | 'review' | 'save-push';
|
|
9
11
|
export declare function stepsFor(target: ImportTarget): readonly ImportStepId[];
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type ImportTarget } from '../00-preflight/logic.js';
|
|
2
|
+
/** The log's two sections: `summary` for a person, `data` for AI, both carrying the same facts. */
|
|
3
|
+
export declare function welcomeLog({ mode, projectPath, initialPath, emptySubmits, }: {
|
|
4
|
+
mode: ImportTarget;
|
|
5
|
+
/** The path the user continued with, or null when they left the import. */
|
|
6
|
+
projectPath: string | null;
|
|
7
|
+
initialPath: string;
|
|
8
|
+
/** How many times Enter was pressed on an empty field, which does nothing and can look like a stuck screen. */
|
|
9
|
+
emptySubmits: number;
|
|
10
|
+
}): {
|
|
11
|
+
summary: string[];
|
|
12
|
+
data: Record<string, unknown>;
|
|
13
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type ImportTarget } from '../00-preflight/logic.js';
|
|
2
|
+
/** A path that was turned down, as typed, with the reason the user was shown. */
|
|
3
|
+
export type RejectedAttempt = {
|
|
4
|
+
entered: string;
|
|
5
|
+
error: string;
|
|
6
|
+
resolved_path?: string;
|
|
7
|
+
};
|
|
8
|
+
/** The log's two sections: `summary` for a person, `data` for AI, both carrying the same facts. */
|
|
9
|
+
export declare function tokenInputLog({ mode, tokenPath, enteredPath, initialPath, rejected, emptySubmits, endedOnError, }: {
|
|
10
|
+
mode: ImportTarget;
|
|
11
|
+
/** The token file the user continued with, or null when they went back. */
|
|
12
|
+
tokenPath: string | null;
|
|
13
|
+
/** What they typed to get there, before it was resolved. */
|
|
14
|
+
enteredPath: string;
|
|
15
|
+
initialPath: string;
|
|
16
|
+
rejected: readonly RejectedAttempt[];
|
|
17
|
+
/** How many times Enter was pressed on an empty field. Counted apart from the rejected paths. */
|
|
18
|
+
emptySubmits: number;
|
|
19
|
+
/** The error still showing when the user went back, if there was one. */
|
|
20
|
+
endedOnError: string | undefined;
|
|
21
|
+
}): {
|
|
22
|
+
summary: string[];
|
|
23
|
+
data: Record<string, unknown>;
|
|
24
|
+
};
|
|
@@ -31,7 +31,7 @@ export declare function useScopeGate({ components, tokenCount, tokensWidth, onCo
|
|
|
31
31
|
emptyMessage: string | undefined;
|
|
32
32
|
safeCursor: number;
|
|
33
33
|
scrollOffset: number;
|
|
34
|
-
selectionStateByKey: Map<string, "
|
|
34
|
+
selectionStateByKey: Map<string, "rejected" | "accepted" | "undecided">;
|
|
35
35
|
aiFlaggedByKey: Map<string, boolean>;
|
|
36
36
|
dimPredicate: ((componentKey: string) => boolean) | undefined;
|
|
37
37
|
columnOneView: "flat" | "grouped";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentful/experience-design-system-cli",
|
|
3
|
-
"version": "2.43.1-dev-build-
|
|
3
|
+
"version": "2.43.1-dev-build-1205d418.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.43.1-dev-build-
|
|
48
|
+
"@contentful/experience-design-system-types": "2.43.1-dev-build-1205d418.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.43.1-dev-build-
|
|
62
|
+
"@contentful/experience-design-system-backend-pipeline": "2.43.1-dev-build-1205d418.0"
|
|
63
63
|
},
|
|
64
64
|
"repository": {
|
|
65
65
|
"type": "git",
|