@contentful/experience-design-system-cli 2.37.1-dev-build-3a98127f.0 → 2.37.1-dev-build-758ea601.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 +82 -54
- package/dist/index.js +83 -55
- package/dist/package.json +1 -1
- package/dist/src/tui/import/steps/00-preflight/logic.d.ts +29 -2
- package/package.json +3 -3
package/dist/app.js
CHANGED
|
@@ -2636,9 +2636,10 @@ var STEPS = {
|
|
|
2636
2636
|
"review",
|
|
2637
2637
|
"save-push"
|
|
2638
2638
|
],
|
|
2639
|
-
// The component stages are skipped, and with them token mapping, which needs components to map to.
|
|
2640
|
-
// screen stays until it is known whether pushing tokens
|
|
2641
|
-
|
|
2639
|
+
// The component stages are skipped, and with them token mapping, which needs components to map to. There is no project
|
|
2640
|
+
// to ask for: the token file is the only input. The credentials screen stays until it is known whether pushing tokens
|
|
2641
|
+
// needs them.
|
|
2642
|
+
tokens: ["token-file", "credentials", "token-generation", "save-push"],
|
|
2642
2643
|
// No token file, so no token generation and no token mapping.
|
|
2643
2644
|
components: [
|
|
2644
2645
|
"project",
|
|
@@ -2651,14 +2652,39 @@ var STEPS = {
|
|
|
2651
2652
|
"save-push"
|
|
2652
2653
|
]
|
|
2653
2654
|
};
|
|
2654
|
-
function stepsFor(target) {
|
|
2655
|
-
return STEPS[target];
|
|
2656
|
-
}
|
|
2657
2655
|
function previousStep(target, current) {
|
|
2658
2656
|
const steps = STEPS[target];
|
|
2659
2657
|
const index = steps.indexOf(current);
|
|
2660
2658
|
return index > 0 ? steps[index - 1] : "preflight";
|
|
2661
2659
|
}
|
|
2660
|
+
var ANSWER_OF = {
|
|
2661
|
+
project: "projectPath",
|
|
2662
|
+
"token-file": "tokensPath",
|
|
2663
|
+
"path-validation": "scannedFiles"
|
|
2664
|
+
};
|
|
2665
|
+
function currentInputStep(target, answers) {
|
|
2666
|
+
for (const step of STEPS[target]) {
|
|
2667
|
+
const answer = ANSWER_OF[step];
|
|
2668
|
+
if (answer === void 0) return "credentials";
|
|
2669
|
+
if (answers[answer] === void 0) return step;
|
|
2670
|
+
}
|
|
2671
|
+
return "credentials";
|
|
2672
|
+
}
|
|
2673
|
+
function goBack(target, current, answers) {
|
|
2674
|
+
const previous = previousStep(target, current);
|
|
2675
|
+
if (previous === "preflight") return { to: "preflight" };
|
|
2676
|
+
const answer = ANSWER_OF[previous];
|
|
2677
|
+
if (answer === void 0) return { to: "step", answers };
|
|
2678
|
+
const { [answer]: _cleared, ...rest } = answers;
|
|
2679
|
+
return { to: "step", answers: rest };
|
|
2680
|
+
}
|
|
2681
|
+
function runBaseDir(input) {
|
|
2682
|
+
if (input.projectPath) return input.projectPath;
|
|
2683
|
+
if (input.configuredBaseDir) return input.configuredBaseDir;
|
|
2684
|
+
const tokensPath = input.tokensPath ?? "";
|
|
2685
|
+
const slash = tokensPath.lastIndexOf("/");
|
|
2686
|
+
return slash > 0 ? tokensPath.slice(0, slash) : ".";
|
|
2687
|
+
}
|
|
2662
2688
|
function moveFocus(focus, key, count) {
|
|
2663
2689
|
if (key.upArrow) return (focus - 1 + count) % count;
|
|
2664
2690
|
if (key.downArrow) return (focus + 1) % count;
|
|
@@ -29550,9 +29576,8 @@ function App({ importOptions, inkClear }) {
|
|
|
29550
29576
|
const [importExitCode, setImportExitCode] = useState38();
|
|
29551
29577
|
const showImportResult = importExitCode !== void 0;
|
|
29552
29578
|
const [target, setTarget] = useState38();
|
|
29553
|
-
const [
|
|
29554
|
-
const
|
|
29555
|
-
const [scannedFiles, setScannedFiles] = useState38();
|
|
29579
|
+
const [answers, setAnswers] = useState38({});
|
|
29580
|
+
const answer = (patch) => setAnswers((current) => ({ ...current, ...patch }));
|
|
29556
29581
|
const [extractionRun, setExtractionRun] = useState38();
|
|
29557
29582
|
const extraction = useExtraction(extractionRun?.input);
|
|
29558
29583
|
const [tokensOnlyRun, setTokensOnlyRun] = useState38();
|
|
@@ -29590,9 +29615,15 @@ function App({ importOptions, inkClear }) {
|
|
|
29590
29615
|
})
|
|
29591
29616
|
);
|
|
29592
29617
|
}, [screen]);
|
|
29593
|
-
const finishCredentials = async (result,
|
|
29618
|
+
const finishCredentials = async (result, collected) => {
|
|
29594
29619
|
if (!result.skipped) await writeCredentials({ ...result.credentials });
|
|
29595
|
-
const launch = {
|
|
29620
|
+
const launch = {
|
|
29621
|
+
// a tokens-only import has no project, so its files go where runBaseDir says
|
|
29622
|
+
projectPath: runBaseDir({ ...collected, configuredBaseDir: importDefaults?.credentials.contentfulBaseDir }),
|
|
29623
|
+
tokens: collected.tokensPath ?? "",
|
|
29624
|
+
filePaths: collected.scannedFiles ?? [],
|
|
29625
|
+
...importOptions
|
|
29626
|
+
};
|
|
29596
29627
|
if (target === "tokens") await startTokensOnly(launch, result);
|
|
29597
29628
|
else await startExtraction(launch, "generate", result);
|
|
29598
29629
|
};
|
|
@@ -29648,7 +29679,7 @@ function App({ importOptions, inkClear }) {
|
|
|
29648
29679
|
useEffect28(() => {
|
|
29649
29680
|
if (!tokensOnlyRun || tokensOnly?.status !== "done" || !tokensOnly.result.ok) return;
|
|
29650
29681
|
const { credentialsSkipped, input, tokens } = tokensOnlyRun;
|
|
29651
|
-
const { tokensPath
|
|
29682
|
+
const { tokensPath, tokenSessionId, tokenCount } = tokensOnly.result;
|
|
29652
29683
|
inkClear();
|
|
29653
29684
|
setTokensOnlyRun(void 0);
|
|
29654
29685
|
setFlowStart(
|
|
@@ -29656,7 +29687,7 @@ function App({ importOptions, inkClear }) {
|
|
|
29656
29687
|
extraction: input,
|
|
29657
29688
|
saved: importDefaults?.credentials,
|
|
29658
29689
|
handoff: { credentialsSkipped, tokens: { strategy: "generate" } },
|
|
29659
|
-
tokensOnly: { tokensPath
|
|
29690
|
+
tokensOnly: { tokensPath, tokenSessionId, tokenCount, outDir: tokens.outDir }
|
|
29660
29691
|
})
|
|
29661
29692
|
);
|
|
29662
29693
|
}, [tokensOnly, tokensOnlyRun]);
|
|
@@ -29707,9 +29738,7 @@ function App({ importOptions, inkClear }) {
|
|
|
29707
29738
|
const goToSettings = () => setScreen("settings");
|
|
29708
29739
|
const resetImport = (keepTarget = false) => {
|
|
29709
29740
|
if (!keepTarget) setTarget(void 0);
|
|
29710
|
-
|
|
29711
|
-
setTokensPath(void 0);
|
|
29712
|
-
setScannedFiles(void 0);
|
|
29741
|
+
setAnswers({});
|
|
29713
29742
|
setExtractionRun(void 0);
|
|
29714
29743
|
setTokensOnlyRun(void 0);
|
|
29715
29744
|
setScopeRun(void 0);
|
|
@@ -29727,11 +29756,9 @@ function App({ importOptions, inkClear }) {
|
|
|
29727
29756
|
};
|
|
29728
29757
|
const goBackFrom = (current) => {
|
|
29729
29758
|
if (!target) return;
|
|
29730
|
-
const
|
|
29731
|
-
if (
|
|
29732
|
-
else
|
|
29733
|
-
else if (previous === "token-file") setTokensPath(void 0);
|
|
29734
|
-
else if (previous === "path-validation") setScannedFiles(void 0);
|
|
29759
|
+
const back = goBack(target, current, answers);
|
|
29760
|
+
if (back.to === "preflight") setTarget(void 0);
|
|
29761
|
+
else setAnswers(back.answers);
|
|
29735
29762
|
};
|
|
29736
29763
|
switch (screen) {
|
|
29737
29764
|
case "import":
|
|
@@ -29751,38 +29778,39 @@ function App({ importOptions, inkClear }) {
|
|
|
29751
29778
|
if (target === void 0) {
|
|
29752
29779
|
return /* @__PURE__ */ jsx64(PreflightScreen, { onChoose: setTarget, onQuit: leaveImport });
|
|
29753
29780
|
}
|
|
29754
|
-
const
|
|
29755
|
-
if (
|
|
29756
|
-
|
|
29757
|
-
|
|
29758
|
-
|
|
29759
|
-
|
|
29760
|
-
|
|
29761
|
-
|
|
29762
|
-
|
|
29763
|
-
|
|
29764
|
-
|
|
29765
|
-
|
|
29766
|
-
|
|
29767
|
-
|
|
29768
|
-
|
|
29769
|
-
|
|
29770
|
-
|
|
29771
|
-
|
|
29772
|
-
|
|
29773
|
-
|
|
29774
|
-
|
|
29775
|
-
|
|
29776
|
-
|
|
29777
|
-
|
|
29778
|
-
|
|
29779
|
-
|
|
29780
|
-
|
|
29781
|
-
|
|
29782
|
-
|
|
29783
|
-
|
|
29784
|
-
|
|
29785
|
-
|
|
29781
|
+
const inputStep = currentInputStep(target, answers);
|
|
29782
|
+
if (!extractionRun && !tokensOnlyRun && inputStep !== "credentials") {
|
|
29783
|
+
switch (inputStep) {
|
|
29784
|
+
case "project":
|
|
29785
|
+
return /* @__PURE__ */ jsx64(
|
|
29786
|
+
WelcomeScreen,
|
|
29787
|
+
{
|
|
29788
|
+
target,
|
|
29789
|
+
onContinue: (projectPath) => answer({ projectPath }),
|
|
29790
|
+
onQuit: () => goBackFrom("project"),
|
|
29791
|
+
initialPath: importDefaults.componentDir
|
|
29792
|
+
}
|
|
29793
|
+
);
|
|
29794
|
+
case "token-file":
|
|
29795
|
+
return /* @__PURE__ */ jsx64(
|
|
29796
|
+
TokenInputScreen,
|
|
29797
|
+
{
|
|
29798
|
+
initialPath: importDefaults.tokenFile,
|
|
29799
|
+
onConfirm: (tokensPath) => answer({ tokensPath }),
|
|
29800
|
+
onBack: () => goBackFrom("token-file")
|
|
29801
|
+
}
|
|
29802
|
+
);
|
|
29803
|
+
case "path-validation":
|
|
29804
|
+
return /* @__PURE__ */ jsx64(
|
|
29805
|
+
PathValidationScreen,
|
|
29806
|
+
{
|
|
29807
|
+
projectPath: answers.projectPath ?? "",
|
|
29808
|
+
onConfirm: ({ filePaths }) => answer({ scannedFiles: filePaths }),
|
|
29809
|
+
onChangePath: () => resetImport(true),
|
|
29810
|
+
onBack: () => goBackFrom("path-validation")
|
|
29811
|
+
}
|
|
29812
|
+
);
|
|
29813
|
+
}
|
|
29786
29814
|
}
|
|
29787
29815
|
if (tokensOnlyRun) {
|
|
29788
29816
|
if (tokensOnly?.status === "done" && !tokensOnly.result.ok) {
|
|
@@ -29857,7 +29885,7 @@ function App({ importOptions, inkClear }) {
|
|
|
29857
29885
|
{
|
|
29858
29886
|
initial: importDefaults.credentials,
|
|
29859
29887
|
onBack: () => goBackFrom("credentials"),
|
|
29860
|
-
onDone: (result) => void finishCredentials(result,
|
|
29888
|
+
onDone: (result) => void finishCredentials(result, answers)
|
|
29861
29889
|
}
|
|
29862
29890
|
);
|
|
29863
29891
|
case "help":
|
package/dist/index.js
CHANGED
|
@@ -18516,20 +18516,40 @@ var init_PageContainer = __esm({
|
|
|
18516
18516
|
});
|
|
18517
18517
|
|
|
18518
18518
|
// packages/experience-design-system-cli/src/tui/import/steps/00-preflight/logic.ts
|
|
18519
|
-
function stepsFor(target) {
|
|
18520
|
-
return STEPS[target];
|
|
18521
|
-
}
|
|
18522
18519
|
function previousStep(target, current) {
|
|
18523
18520
|
const steps = STEPS[target];
|
|
18524
18521
|
const index = steps.indexOf(current);
|
|
18525
18522
|
return index > 0 ? steps[index - 1] : "preflight";
|
|
18526
18523
|
}
|
|
18524
|
+
function currentInputStep(target, answers) {
|
|
18525
|
+
for (const step of STEPS[target]) {
|
|
18526
|
+
const answer = ANSWER_OF[step];
|
|
18527
|
+
if (answer === void 0) return "credentials";
|
|
18528
|
+
if (answers[answer] === void 0) return step;
|
|
18529
|
+
}
|
|
18530
|
+
return "credentials";
|
|
18531
|
+
}
|
|
18532
|
+
function goBack(target, current, answers) {
|
|
18533
|
+
const previous = previousStep(target, current);
|
|
18534
|
+
if (previous === "preflight") return { to: "preflight" };
|
|
18535
|
+
const answer = ANSWER_OF[previous];
|
|
18536
|
+
if (answer === void 0) return { to: "step", answers };
|
|
18537
|
+
const { [answer]: _cleared, ...rest } = answers;
|
|
18538
|
+
return { to: "step", answers: rest };
|
|
18539
|
+
}
|
|
18540
|
+
function runBaseDir(input) {
|
|
18541
|
+
if (input.projectPath) return input.projectPath;
|
|
18542
|
+
if (input.configuredBaseDir) return input.configuredBaseDir;
|
|
18543
|
+
const tokensPath = input.tokensPath ?? "";
|
|
18544
|
+
const slash = tokensPath.lastIndexOf("/");
|
|
18545
|
+
return slash > 0 ? tokensPath.slice(0, slash) : ".";
|
|
18546
|
+
}
|
|
18527
18547
|
function moveFocus(focus, key, count) {
|
|
18528
18548
|
if (key.upArrow) return (focus - 1 + count) % count;
|
|
18529
18549
|
if (key.downArrow) return (focus + 1) % count;
|
|
18530
18550
|
return focus;
|
|
18531
18551
|
}
|
|
18532
|
-
var IMPORT_TARGET_OPTIONS, STEPS;
|
|
18552
|
+
var IMPORT_TARGET_OPTIONS, STEPS, ANSWER_OF;
|
|
18533
18553
|
var init_logic = __esm({
|
|
18534
18554
|
"packages/experience-design-system-cli/src/tui/import/steps/00-preflight/logic.ts"() {
|
|
18535
18555
|
"use strict";
|
|
@@ -18551,9 +18571,10 @@ var init_logic = __esm({
|
|
|
18551
18571
|
"review",
|
|
18552
18572
|
"save-push"
|
|
18553
18573
|
],
|
|
18554
|
-
// The component stages are skipped, and with them token mapping, which needs components to map to.
|
|
18555
|
-
// screen stays until it is known whether pushing tokens
|
|
18556
|
-
|
|
18574
|
+
// The component stages are skipped, and with them token mapping, which needs components to map to. There is no project
|
|
18575
|
+
// to ask for: the token file is the only input. The credentials screen stays until it is known whether pushing tokens
|
|
18576
|
+
// needs them.
|
|
18577
|
+
tokens: ["token-file", "credentials", "token-generation", "save-push"],
|
|
18557
18578
|
// No token file, so no token generation and no token mapping.
|
|
18558
18579
|
components: [
|
|
18559
18580
|
"project",
|
|
@@ -18566,6 +18587,11 @@ var init_logic = __esm({
|
|
|
18566
18587
|
"save-push"
|
|
18567
18588
|
]
|
|
18568
18589
|
};
|
|
18590
|
+
ANSWER_OF = {
|
|
18591
|
+
project: "projectPath",
|
|
18592
|
+
"token-file": "tokensPath",
|
|
18593
|
+
"path-validation": "scannedFiles"
|
|
18594
|
+
};
|
|
18569
18595
|
}
|
|
18570
18596
|
});
|
|
18571
18597
|
|
|
@@ -33171,9 +33197,8 @@ function App({ importOptions, inkClear }) {
|
|
|
33171
33197
|
const [importExitCode, setImportExitCode] = useState38();
|
|
33172
33198
|
const showImportResult = importExitCode !== void 0;
|
|
33173
33199
|
const [target, setTarget] = useState38();
|
|
33174
|
-
const [
|
|
33175
|
-
const
|
|
33176
|
-
const [scannedFiles, setScannedFiles] = useState38();
|
|
33200
|
+
const [answers, setAnswers] = useState38({});
|
|
33201
|
+
const answer = (patch) => setAnswers((current) => ({ ...current, ...patch }));
|
|
33177
33202
|
const [extractionRun, setExtractionRun] = useState38();
|
|
33178
33203
|
const extraction = useExtraction(extractionRun?.input);
|
|
33179
33204
|
const [tokensOnlyRun, setTokensOnlyRun] = useState38();
|
|
@@ -33211,9 +33236,15 @@ function App({ importOptions, inkClear }) {
|
|
|
33211
33236
|
})
|
|
33212
33237
|
);
|
|
33213
33238
|
}, [screen]);
|
|
33214
|
-
const finishCredentials = async (result,
|
|
33239
|
+
const finishCredentials = async (result, collected) => {
|
|
33215
33240
|
if (!result.skipped) await writeCredentials({ ...result.credentials });
|
|
33216
|
-
const launch = {
|
|
33241
|
+
const launch = {
|
|
33242
|
+
// a tokens-only import has no project, so its files go where runBaseDir says
|
|
33243
|
+
projectPath: runBaseDir({ ...collected, configuredBaseDir: importDefaults?.credentials.contentfulBaseDir }),
|
|
33244
|
+
tokens: collected.tokensPath ?? "",
|
|
33245
|
+
filePaths: collected.scannedFiles ?? [],
|
|
33246
|
+
...importOptions
|
|
33247
|
+
};
|
|
33217
33248
|
if (target === "tokens") await startTokensOnly(launch, result);
|
|
33218
33249
|
else await startExtraction(launch, "generate", result);
|
|
33219
33250
|
};
|
|
@@ -33269,7 +33300,7 @@ function App({ importOptions, inkClear }) {
|
|
|
33269
33300
|
useEffect28(() => {
|
|
33270
33301
|
if (!tokensOnlyRun || tokensOnly?.status !== "done" || !tokensOnly.result.ok) return;
|
|
33271
33302
|
const { credentialsSkipped, input, tokens } = tokensOnlyRun;
|
|
33272
|
-
const { tokensPath
|
|
33303
|
+
const { tokensPath, tokenSessionId, tokenCount } = tokensOnly.result;
|
|
33273
33304
|
inkClear();
|
|
33274
33305
|
setTokensOnlyRun(void 0);
|
|
33275
33306
|
setFlowStart(
|
|
@@ -33277,7 +33308,7 @@ function App({ importOptions, inkClear }) {
|
|
|
33277
33308
|
extraction: input,
|
|
33278
33309
|
saved: importDefaults?.credentials,
|
|
33279
33310
|
handoff: { credentialsSkipped, tokens: { strategy: "generate" } },
|
|
33280
|
-
tokensOnly: { tokensPath
|
|
33311
|
+
tokensOnly: { tokensPath, tokenSessionId, tokenCount, outDir: tokens.outDir }
|
|
33281
33312
|
})
|
|
33282
33313
|
);
|
|
33283
33314
|
}, [tokensOnly, tokensOnlyRun]);
|
|
@@ -33328,9 +33359,7 @@ function App({ importOptions, inkClear }) {
|
|
|
33328
33359
|
const goToSettings = () => setScreen("settings");
|
|
33329
33360
|
const resetImport = (keepTarget = false) => {
|
|
33330
33361
|
if (!keepTarget) setTarget(void 0);
|
|
33331
|
-
|
|
33332
|
-
setTokensPath(void 0);
|
|
33333
|
-
setScannedFiles(void 0);
|
|
33362
|
+
setAnswers({});
|
|
33334
33363
|
setExtractionRun(void 0);
|
|
33335
33364
|
setTokensOnlyRun(void 0);
|
|
33336
33365
|
setScopeRun(void 0);
|
|
@@ -33348,11 +33377,9 @@ function App({ importOptions, inkClear }) {
|
|
|
33348
33377
|
};
|
|
33349
33378
|
const goBackFrom = (current) => {
|
|
33350
33379
|
if (!target) return;
|
|
33351
|
-
const
|
|
33352
|
-
if (
|
|
33353
|
-
else
|
|
33354
|
-
else if (previous === "token-file") setTokensPath(void 0);
|
|
33355
|
-
else if (previous === "path-validation") setScannedFiles(void 0);
|
|
33380
|
+
const back = goBack(target, current, answers);
|
|
33381
|
+
if (back.to === "preflight") setTarget(void 0);
|
|
33382
|
+
else setAnswers(back.answers);
|
|
33356
33383
|
};
|
|
33357
33384
|
switch (screen) {
|
|
33358
33385
|
case "import":
|
|
@@ -33372,38 +33399,39 @@ function App({ importOptions, inkClear }) {
|
|
|
33372
33399
|
if (target === void 0) {
|
|
33373
33400
|
return /* @__PURE__ */ jsx64(PreflightScreen, { onChoose: setTarget, onQuit: leaveImport });
|
|
33374
33401
|
}
|
|
33375
|
-
const
|
|
33376
|
-
if (
|
|
33377
|
-
|
|
33378
|
-
|
|
33379
|
-
|
|
33380
|
-
|
|
33381
|
-
|
|
33382
|
-
|
|
33383
|
-
|
|
33384
|
-
|
|
33385
|
-
|
|
33386
|
-
|
|
33387
|
-
|
|
33388
|
-
|
|
33389
|
-
|
|
33390
|
-
|
|
33391
|
-
|
|
33392
|
-
|
|
33393
|
-
|
|
33394
|
-
|
|
33395
|
-
|
|
33396
|
-
|
|
33397
|
-
|
|
33398
|
-
|
|
33399
|
-
|
|
33400
|
-
|
|
33401
|
-
|
|
33402
|
-
|
|
33403
|
-
|
|
33404
|
-
|
|
33405
|
-
|
|
33406
|
-
|
|
33402
|
+
const inputStep = currentInputStep(target, answers);
|
|
33403
|
+
if (!extractionRun && !tokensOnlyRun && inputStep !== "credentials") {
|
|
33404
|
+
switch (inputStep) {
|
|
33405
|
+
case "project":
|
|
33406
|
+
return /* @__PURE__ */ jsx64(
|
|
33407
|
+
WelcomeScreen,
|
|
33408
|
+
{
|
|
33409
|
+
target,
|
|
33410
|
+
onContinue: (projectPath) => answer({ projectPath }),
|
|
33411
|
+
onQuit: () => goBackFrom("project"),
|
|
33412
|
+
initialPath: importDefaults.componentDir
|
|
33413
|
+
}
|
|
33414
|
+
);
|
|
33415
|
+
case "token-file":
|
|
33416
|
+
return /* @__PURE__ */ jsx64(
|
|
33417
|
+
TokenInputScreen,
|
|
33418
|
+
{
|
|
33419
|
+
initialPath: importDefaults.tokenFile,
|
|
33420
|
+
onConfirm: (tokensPath) => answer({ tokensPath }),
|
|
33421
|
+
onBack: () => goBackFrom("token-file")
|
|
33422
|
+
}
|
|
33423
|
+
);
|
|
33424
|
+
case "path-validation":
|
|
33425
|
+
return /* @__PURE__ */ jsx64(
|
|
33426
|
+
PathValidationScreen,
|
|
33427
|
+
{
|
|
33428
|
+
projectPath: answers.projectPath ?? "",
|
|
33429
|
+
onConfirm: ({ filePaths }) => answer({ scannedFiles: filePaths }),
|
|
33430
|
+
onChangePath: () => resetImport(true),
|
|
33431
|
+
onBack: () => goBackFrom("path-validation")
|
|
33432
|
+
}
|
|
33433
|
+
);
|
|
33434
|
+
}
|
|
33407
33435
|
}
|
|
33408
33436
|
if (tokensOnlyRun) {
|
|
33409
33437
|
if (tokensOnly?.status === "done" && !tokensOnly.result.ok) {
|
|
@@ -33478,7 +33506,7 @@ function App({ importOptions, inkClear }) {
|
|
|
33478
33506
|
{
|
|
33479
33507
|
initial: importDefaults.credentials,
|
|
33480
33508
|
onBack: () => goBackFrom("credentials"),
|
|
33481
|
-
onDone: (result) => void finishCredentials(result,
|
|
33509
|
+
onDone: (result) => void finishCredentials(result, answers)
|
|
33482
33510
|
}
|
|
33483
33511
|
);
|
|
33484
33512
|
case "help":
|
package/dist/package.json
CHANGED
|
@@ -5,8 +5,35 @@ export declare const IMPORT_TARGET_OPTIONS: ReadonlyArray<{
|
|
|
5
5
|
}>;
|
|
6
6
|
export type ImportStepId = 'project' | 'token-file' | 'path-validation' | 'credentials' | 'component-extraction' | 'token-generation' | 'scope-gate' | 'generation' | 'review' | 'save-push';
|
|
7
7
|
export declare function stepsFor(target: ImportTarget): readonly ImportStepId[];
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
export interface InputAnswers {
|
|
9
|
+
projectPath?: string;
|
|
10
|
+
tokensPath?: string;
|
|
11
|
+
scannedFiles?: string[];
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* The input screen to show: the first step of this mode whose answer is still missing, or 'credentials' once every
|
|
15
|
+
* earlier one is answered. A mode never shows a screen it does not list, so skipping one needs no special case.
|
|
16
|
+
*/
|
|
17
|
+
export declare function currentInputStep(target: ImportTarget, answers: InputAnswers): Extract<ImportStepId, 'project' | 'token-file' | 'path-validation' | 'credentials'>;
|
|
18
|
+
/**
|
|
19
|
+
* What Back from `current` does: leave for the preflight when it is the first screen of the mode, otherwise clear the
|
|
20
|
+
* previous step's answer so that screen shows again.
|
|
21
|
+
*/
|
|
22
|
+
export declare function goBack(target: ImportTarget, current: ImportStepId, answers: InputAnswers): {
|
|
23
|
+
to: 'preflight';
|
|
24
|
+
} | {
|
|
25
|
+
to: 'step';
|
|
26
|
+
answers: InputAnswers;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Where a run writes its files when it has no project to put them in: the Root Project Directory setting if there is
|
|
30
|
+
* one, otherwise the folder the token file is in. Components runs always have a project and use it.
|
|
31
|
+
*/
|
|
32
|
+
export declare function runBaseDir(input: {
|
|
33
|
+
projectPath?: string;
|
|
34
|
+
tokensPath?: string;
|
|
35
|
+
configuredBaseDir?: string;
|
|
36
|
+
}): string;
|
|
10
37
|
interface FocusKey {
|
|
11
38
|
upArrow: boolean;
|
|
12
39
|
downArrow: boolean;
|
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-758ea601.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-758ea601.0",
|
|
49
|
+
"@contentful/experience-design-system-types": "2.37.1-dev-build-758ea601.0"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@tsconfig/node24": "^24.0.4",
|