@contentful/experience-design-system-cli 2.37.1-dev-build-daf63213.0 → 2.37.1-dev-build-0b7e3e1f.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.d.ts +1 -1
- package/dist/app.js +64 -154
- package/dist/index.js +63 -162
- package/dist/package.json +1 -1
- package/package.json +3 -3
- package/dist/src/tui/upgrade/PageContainer.d.ts +0 -4
- /package/dist/src/tui/{upgrade → home}/version.d.ts +0 -0
package/dist/app.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ImportOptions } from './src/commands/import-options.js';
|
|
3
|
-
export type Screen = 'start' | 'import' | 'help' | 'settings' | 'settings-configuration' | 'settings-opt-in-analytics' | 'settings-debug-mode'
|
|
3
|
+
export type Screen = 'start' | 'import' | 'help' | 'settings' | 'settings-configuration' | 'settings-opt-in-analytics' | 'settings-debug-mode';
|
|
4
4
|
export declare function runApp(renderApp: (element: React.ReactElement) => {
|
|
5
5
|
waitUntilExit: () => Promise<unknown>;
|
|
6
6
|
clear?: () => void;
|
package/dist/app.js
CHANGED
|
@@ -32,7 +32,7 @@ var init_package_root = __esm({
|
|
|
32
32
|
}
|
|
33
33
|
});
|
|
34
34
|
|
|
35
|
-
// packages/experience-design-system-cli/src/tui/
|
|
35
|
+
// packages/experience-design-system-cli/src/tui/home/version.ts
|
|
36
36
|
import { readFileSync as readFileSync2 } from "node:fs";
|
|
37
37
|
import { join as join2 } from "node:path";
|
|
38
38
|
import semver from "semver";
|
|
@@ -65,7 +65,7 @@ async function checkForUpgrade() {
|
|
|
65
65
|
}
|
|
66
66
|
var PACKAGE_NAME, TAGS_URL;
|
|
67
67
|
var init_version = __esm({
|
|
68
|
-
"packages/experience-design-system-cli/src/tui/
|
|
68
|
+
"packages/experience-design-system-cli/src/tui/home/version.ts"() {
|
|
69
69
|
"use strict";
|
|
70
70
|
init_package_root();
|
|
71
71
|
PACKAGE_NAME = "@contentful/experience-design-system-cli";
|
|
@@ -2330,7 +2330,7 @@ var init_debug_store = __esm({
|
|
|
2330
2330
|
|
|
2331
2331
|
// packages/experience-design-system-cli/app.tsx
|
|
2332
2332
|
import { join as join26 } from "node:path";
|
|
2333
|
-
import { useEffect as
|
|
2333
|
+
import { useEffect as useEffect27, useState as useState36 } from "react";
|
|
2334
2334
|
|
|
2335
2335
|
// packages/experience-design-system-cli/src/tui/home/home.tsx
|
|
2336
2336
|
import { useEffect as useEffect2, useState as useState2 } from "react";
|
|
@@ -2431,18 +2431,14 @@ var SUBTITLE = "Let's import your design system into Contentful";
|
|
|
2431
2431
|
var MIN_TERMINAL_WIDTH = 164;
|
|
2432
2432
|
var START_ITEMS = [
|
|
2433
2433
|
{ label: "Import", screen: "import" },
|
|
2434
|
-
{ label: "Upgrade Version", screen: "upgrade" },
|
|
2435
2434
|
{ label: "Settings", screen: "settings" },
|
|
2436
2435
|
{ label: "Help", screen: "help" }
|
|
2437
2436
|
];
|
|
2438
|
-
function
|
|
2437
|
+
function versionStatus(upgradeCheck) {
|
|
2439
2438
|
if (upgradeCheck?.status === "update-available") {
|
|
2440
|
-
return {
|
|
2441
|
-
}
|
|
2442
|
-
if (upgradeCheck?.status === "up-to-date") {
|
|
2443
|
-
return { label: "Upgrade Version (up to date)", color: PALETTE.muted };
|
|
2439
|
+
return { text: ` (upgrade available v${upgradeCheck.latest})`, color: PALETTE.success };
|
|
2444
2440
|
}
|
|
2445
|
-
return
|
|
2441
|
+
return void 0;
|
|
2446
2442
|
}
|
|
2447
2443
|
function HomeScreen({ onNavigate }) {
|
|
2448
2444
|
const [focusIdx, setFocusIdx] = useState2(0);
|
|
@@ -2450,7 +2446,7 @@ function HomeScreen({ onNavigate }) {
|
|
|
2450
2446
|
const { exit } = useApp();
|
|
2451
2447
|
const terminalWidth = useTerminalWidth();
|
|
2452
2448
|
const tooNarrow = terminalWidth < MIN_TERMINAL_WIDTH;
|
|
2453
|
-
const
|
|
2449
|
+
const status = versionStatus(upgradeCheck);
|
|
2454
2450
|
useEffect2(() => {
|
|
2455
2451
|
checkForUpgrade().then(setUpgradeCheck).catch(() => setUpgradeCheck({ status: "error" }));
|
|
2456
2452
|
}, []);
|
|
@@ -2470,7 +2466,6 @@ function HomeScreen({ onNavigate }) {
|
|
|
2470
2466
|
}
|
|
2471
2467
|
if (key.return) {
|
|
2472
2468
|
const item = START_ITEMS[focusIdx];
|
|
2473
|
-
if (item.screen === "upgrade" && upgradeDisabled) return;
|
|
2474
2469
|
onNavigate(item.screen);
|
|
2475
2470
|
return;
|
|
2476
2471
|
}
|
|
@@ -2488,26 +2483,16 @@ function HomeScreen({ onNavigate }) {
|
|
|
2488
2483
|
/* @__PURE__ */ jsx2(Text2, { color: PALETTE.muted, children: SUBTITLE }),
|
|
2489
2484
|
/* @__PURE__ */ jsxs(Text2, { color: PALETTE.muted, children: [
|
|
2490
2485
|
"v",
|
|
2491
|
-
VERSION
|
|
2486
|
+
VERSION,
|
|
2487
|
+
status && /* @__PURE__ */ jsx2(Text2, { color: status.color, children: status.text })
|
|
2492
2488
|
] })
|
|
2493
2489
|
] }),
|
|
2494
2490
|
/* @__PURE__ */ jsx2(Box, { marginTop: 1, justifyContent: "center", children: /* @__PURE__ */ jsx2(Box, { flexDirection: "column", children: START_ITEMS.map((item, i) => {
|
|
2495
2491
|
const focused = i === focusIdx;
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
const dimmed = isUpgradeItem && upgradeDisabled;
|
|
2499
|
-
return /* @__PURE__ */ jsxs(
|
|
2500
|
-
Text2,
|
|
2501
|
-
{
|
|
2502
|
-
bold: focused && !dimmed,
|
|
2503
|
-
color: dimmed ? PALETTE.muted : focused ? PALETTE.accent : display.color,
|
|
2504
|
-
children: [
|
|
2505
|
-
focused ? `${FOCUS_MARKER} ` : " ",
|
|
2506
|
-
display.label
|
|
2507
|
-
]
|
|
2508
|
-
},
|
|
2492
|
+
return /* @__PURE__ */ jsxs(Text2, { bold: focused, color: focused ? PALETTE.accent : void 0, children: [
|
|
2493
|
+
focused ? `${FOCUS_MARKER} ` : " ",
|
|
2509
2494
|
item.label
|
|
2510
|
-
);
|
|
2495
|
+
] }, item.label);
|
|
2511
2496
|
}) }) }),
|
|
2512
2497
|
/* @__PURE__ */ jsx2(Box, { marginTop: 1, justifyContent: "center", children: /* @__PURE__ */ jsx2(
|
|
2513
2498
|
ControlHints,
|
|
@@ -29040,89 +29025,16 @@ function OptInAnalyticsScreen({ onDone }) {
|
|
|
29040
29025
|
] });
|
|
29041
29026
|
}
|
|
29042
29027
|
|
|
29043
|
-
// packages/experience-design-system-cli/src/tui/
|
|
29028
|
+
// packages/experience-design-system-cli/src/tui/settings/debug-mode/screen.tsx
|
|
29044
29029
|
import { useEffect as useEffect26, useState as useState35 } from "react";
|
|
29045
29030
|
import { Box as Box50, Text as Text53, useInput as useInput15 } from "ink";
|
|
29046
|
-
init_version();
|
|
29047
|
-
init_debug_store();
|
|
29048
|
-
import { jsx as jsx62, jsxs as jsxs51 } from "react/jsx-runtime";
|
|
29049
|
-
var UPGRADE_COMMANDS = ["git pull", "pnpm install", "pnpm build"];
|
|
29050
|
-
function UpgradeScreen({ onDone }) {
|
|
29051
|
-
const [upgradeCheck, setUpgradeCheck] = useState35();
|
|
29052
|
-
useEffect26(() => {
|
|
29053
|
-
startDebugRun({
|
|
29054
|
-
flow: "upgrade",
|
|
29055
|
-
step: "01-upgrade",
|
|
29056
|
-
menuOption: "Upgrade",
|
|
29057
|
-
inputs: { currentVersion: readPackageVersion() }
|
|
29058
|
-
});
|
|
29059
|
-
checkForUpgrade().then(setUpgradeCheck).catch(() => setUpgradeCheck({ status: "error" }));
|
|
29060
|
-
}, []);
|
|
29061
|
-
useInput15((_input, key) => {
|
|
29062
|
-
if (key.return) {
|
|
29063
|
-
void finishDebugRun({
|
|
29064
|
-
outputs: upgradeCheck ?? {},
|
|
29065
|
-
status: upgradeCheck?.status === "error" ? "error" : "success",
|
|
29066
|
-
exitMethod: "saved"
|
|
29067
|
-
});
|
|
29068
|
-
onDone();
|
|
29069
|
-
return;
|
|
29070
|
-
}
|
|
29071
|
-
});
|
|
29072
|
-
return /* @__PURE__ */ jsxs51(Box50, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
29073
|
-
/* @__PURE__ */ jsx62(Text53, { bold: true, children: "Upgrade" }),
|
|
29074
|
-
/* @__PURE__ */ jsx62(Text53, { children: " " }),
|
|
29075
|
-
renderBody(upgradeCheck),
|
|
29076
|
-
/* @__PURE__ */ jsx62(Text53, { children: " " }),
|
|
29077
|
-
/* @__PURE__ */ jsxs51(Text53, { bold: true, color: PALETTE.accent, children: [
|
|
29078
|
-
FOCUS_MARKER,
|
|
29079
|
-
" Go Back"
|
|
29080
|
-
] })
|
|
29081
|
-
] });
|
|
29082
|
-
}
|
|
29083
|
-
function renderBody(upgradeCheck) {
|
|
29084
|
-
if (!upgradeCheck) {
|
|
29085
|
-
return /* @__PURE__ */ jsx62(Text53, { color: PALETTE.muted, children: "Checking for updates\u2026" });
|
|
29086
|
-
}
|
|
29087
|
-
if (upgradeCheck.status === "error") {
|
|
29088
|
-
return /* @__PURE__ */ jsx62(Text53, { color: PALETTE.warning, children: "Couldn't check for updates \u2014 check your network connection and try again." });
|
|
29089
|
-
}
|
|
29090
|
-
if (upgradeCheck.status === "up-to-date") {
|
|
29091
|
-
return /* @__PURE__ */ jsxs51(Text53, { color: PALETTE.success, children: [
|
|
29092
|
-
"You're already on the latest version (v",
|
|
29093
|
-
upgradeCheck.current,
|
|
29094
|
-
")."
|
|
29095
|
-
] });
|
|
29096
|
-
}
|
|
29097
|
-
return /* @__PURE__ */ jsxs51(Box50, { flexDirection: "column", children: [
|
|
29098
|
-
/* @__PURE__ */ jsxs51(Text53, { color: PALETTE.muted, children: [
|
|
29099
|
-
/* @__PURE__ */ jsxs51(Text53, { bold: true, color: PALETTE.success, children: [
|
|
29100
|
-
"v",
|
|
29101
|
-
upgradeCheck.latest
|
|
29102
|
-
] }),
|
|
29103
|
-
" ",
|
|
29104
|
-
"is available (you're on ",
|
|
29105
|
-
/* @__PURE__ */ jsxs51(Text53, { bold: true, children: [
|
|
29106
|
-
"v",
|
|
29107
|
-
upgradeCheck.current
|
|
29108
|
-
] }),
|
|
29109
|
-
"). Exit this program, cd into the root of your local clone of contentful/experience-design-system-sdk-public, then run:"
|
|
29110
|
-
] }),
|
|
29111
|
-
/* @__PURE__ */ jsx62(Text53, { children: " " }),
|
|
29112
|
-
/* @__PURE__ */ jsx62(Box50, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE.border, paddingX: 1, children: UPGRADE_COMMANDS.map((cmd) => /* @__PURE__ */ jsx62(Text53, { bold: true, children: cmd }, cmd)) })
|
|
29113
|
-
] });
|
|
29114
|
-
}
|
|
29115
|
-
|
|
29116
|
-
// packages/experience-design-system-cli/src/tui/settings/debug-mode/screen.tsx
|
|
29117
|
-
import { useEffect as useEffect27, useState as useState36 } from "react";
|
|
29118
|
-
import { Box as Box51, Text as Text54, useInput as useInput16 } from "ink";
|
|
29119
29031
|
init_debug_mode_store();
|
|
29120
29032
|
init_debug_store();
|
|
29121
|
-
import { jsx as
|
|
29033
|
+
import { jsx as jsx62, jsxs as jsxs51 } from "react/jsx-runtime";
|
|
29122
29034
|
function DebugModeScreen({ onDone }) {
|
|
29123
|
-
const [loading, setLoading] =
|
|
29124
|
-
const [enabled, setEnabled] =
|
|
29125
|
-
|
|
29035
|
+
const [loading, setLoading] = useState35(true);
|
|
29036
|
+
const [enabled, setEnabled] = useState35(true);
|
|
29037
|
+
useEffect26(() => {
|
|
29126
29038
|
readDebugModeSetting().then((setting) => {
|
|
29127
29039
|
setEnabled(setting.enabled);
|
|
29128
29040
|
setLoading(false);
|
|
@@ -29134,7 +29046,7 @@ function DebugModeScreen({ onDone }) {
|
|
|
29134
29046
|
});
|
|
29135
29047
|
});
|
|
29136
29048
|
}, []);
|
|
29137
|
-
|
|
29049
|
+
useInput15((input, key) => {
|
|
29138
29050
|
if (loading) return;
|
|
29139
29051
|
if (key.return || input === " ") {
|
|
29140
29052
|
setEnabled((current) => {
|
|
@@ -29149,16 +29061,16 @@ function DebugModeScreen({ onDone }) {
|
|
|
29149
29061
|
onDone();
|
|
29150
29062
|
}
|
|
29151
29063
|
});
|
|
29152
|
-
return /* @__PURE__ */
|
|
29153
|
-
/* @__PURE__ */
|
|
29154
|
-
/* @__PURE__ */
|
|
29155
|
-
loading ? /* @__PURE__ */
|
|
29064
|
+
return /* @__PURE__ */ jsxs51(Box50, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
29065
|
+
/* @__PURE__ */ jsx62(Text53, { bold: true, children: "Settings \u203A Debug Mode" }),
|
|
29066
|
+
/* @__PURE__ */ jsx62(Text53, { children: " " }),
|
|
29067
|
+
loading ? /* @__PURE__ */ jsx62(Text53, { color: PALETTE.muted, children: "Loading\u2026" }) : /* @__PURE__ */ jsxs51(Text53, { children: [
|
|
29156
29068
|
"Debug logging:",
|
|
29157
29069
|
" ",
|
|
29158
|
-
/* @__PURE__ */
|
|
29070
|
+
/* @__PURE__ */ jsx62(Text53, { bold: true, color: enabled ? PALETTE.success : PALETTE.muted, children: enabled ? "On" : "Off" })
|
|
29159
29071
|
] }),
|
|
29160
|
-
/* @__PURE__ */
|
|
29161
|
-
/* @__PURE__ */
|
|
29072
|
+
/* @__PURE__ */ jsx62(Text53, { children: " " }),
|
|
29073
|
+
/* @__PURE__ */ jsx62(
|
|
29162
29074
|
ControlHints,
|
|
29163
29075
|
{
|
|
29164
29076
|
hints: [
|
|
@@ -29171,18 +29083,18 @@ function DebugModeScreen({ onDone }) {
|
|
|
29171
29083
|
}
|
|
29172
29084
|
|
|
29173
29085
|
// packages/experience-design-system-cli/app.tsx
|
|
29174
|
-
import { Fragment as Fragment20, jsx as
|
|
29086
|
+
import { Fragment as Fragment20, jsx as jsx63 } from "react/jsx-runtime";
|
|
29175
29087
|
function App({ importOptions, inkClear }) {
|
|
29176
|
-
const [screen, setScreen] =
|
|
29177
|
-
const [importExitCode, setImportExitCode] =
|
|
29088
|
+
const [screen, setScreen] = useState36("start");
|
|
29089
|
+
const [importExitCode, setImportExitCode] = useState36();
|
|
29178
29090
|
const showImportResult = importExitCode !== void 0;
|
|
29179
|
-
const [projectPath, setProjectPath] =
|
|
29180
|
-
const [tokensPath, setTokensPath] =
|
|
29181
|
-
const [scannedFiles, setScannedFiles] =
|
|
29182
|
-
const [pendingLaunch, setPendingLaunch] =
|
|
29183
|
-
const [extractionRun, setExtractionRun] =
|
|
29091
|
+
const [projectPath, setProjectPath] = useState36();
|
|
29092
|
+
const [tokensPath, setTokensPath] = useState36();
|
|
29093
|
+
const [scannedFiles, setScannedFiles] = useState36();
|
|
29094
|
+
const [pendingLaunch, setPendingLaunch] = useState36();
|
|
29095
|
+
const [extractionRun, setExtractionRun] = useState36();
|
|
29184
29096
|
const extraction = useExtraction(extractionRun?.input);
|
|
29185
|
-
const [scopeRun, setScopeRun] =
|
|
29097
|
+
const [scopeRun, setScopeRun] = useState36();
|
|
29186
29098
|
const scopeFlow = useScopeGateFlow(
|
|
29187
29099
|
scopeRun && {
|
|
29188
29100
|
sessionId: scopeRun.extraction.sessionId,
|
|
@@ -29197,12 +29109,12 @@ function App({ importOptions, inkClear }) {
|
|
|
29197
29109
|
}
|
|
29198
29110
|
}
|
|
29199
29111
|
);
|
|
29200
|
-
const [generationInput, setGenerationInput] =
|
|
29112
|
+
const [generationInput, setGenerationInput] = useState36();
|
|
29201
29113
|
const generation = useGeneration(generationInput);
|
|
29202
|
-
const [flowStart, setFlowStart] =
|
|
29114
|
+
const [flowStart, setFlowStart] = useState36();
|
|
29203
29115
|
const flow = useFlow(flowStart, { beforeStepChange: inkClear });
|
|
29204
|
-
const [importDefaults, setImportDefaults] =
|
|
29205
|
-
|
|
29116
|
+
const [importDefaults, setImportDefaults] = useState36();
|
|
29117
|
+
useEffect27(() => {
|
|
29206
29118
|
if (screen !== "import") {
|
|
29207
29119
|
setImportDefaults(void 0);
|
|
29208
29120
|
return;
|
|
@@ -29262,12 +29174,12 @@ function App({ importOptions, inkClear }) {
|
|
|
29262
29174
|
}
|
|
29263
29175
|
});
|
|
29264
29176
|
};
|
|
29265
|
-
|
|
29177
|
+
useEffect27(() => {
|
|
29266
29178
|
if (!extractionRun || extraction?.status !== "done" || !extraction.result.ok) return;
|
|
29267
29179
|
setExtractionRun(void 0);
|
|
29268
29180
|
setScopeRun({ ...extractionRun, extraction: extraction.result.extraction });
|
|
29269
29181
|
}, [extraction, extractionRun]);
|
|
29270
|
-
|
|
29182
|
+
useEffect27(() => {
|
|
29271
29183
|
if (!scopeRun || scopeFlow?.status !== "confirmed" || generationInput) return;
|
|
29272
29184
|
const { extraction: produced, input, generatePromptPath } = scopeRun;
|
|
29273
29185
|
setGenerationInput({
|
|
@@ -29285,7 +29197,7 @@ function App({ importOptions, inkClear }) {
|
|
|
29285
29197
|
...generatePromptPath ? { generatePromptPath } : {}
|
|
29286
29198
|
});
|
|
29287
29199
|
}, [scopeFlow, scopeRun, generationInput]);
|
|
29288
|
-
|
|
29200
|
+
useEffect27(() => {
|
|
29289
29201
|
if (!scopeRun || generation?.status !== "done" || !generation.result.ok) return;
|
|
29290
29202
|
const { credentialsSkipped, tokenStrategy, extraction: produced, input, generatePromptPath } = scopeRun;
|
|
29291
29203
|
inkClear();
|
|
@@ -29328,9 +29240,9 @@ function App({ importOptions, inkClear }) {
|
|
|
29328
29240
|
};
|
|
29329
29241
|
switch (screen) {
|
|
29330
29242
|
case "import":
|
|
29331
|
-
if (showImportResult) return /* @__PURE__ */
|
|
29243
|
+
if (showImportResult) return /* @__PURE__ */ jsx63(ImportScreen, { exitCode: importExitCode, onDone: finishImportResult });
|
|
29332
29244
|
if (flow && flowStart) {
|
|
29333
|
-
return /* @__PURE__ */
|
|
29245
|
+
return /* @__PURE__ */ jsx63(
|
|
29334
29246
|
FlowScreen,
|
|
29335
29247
|
{
|
|
29336
29248
|
state: flow.state,
|
|
@@ -29340,12 +29252,12 @@ function App({ importOptions, inkClear }) {
|
|
|
29340
29252
|
}
|
|
29341
29253
|
);
|
|
29342
29254
|
}
|
|
29343
|
-
if (importDefaults === void 0) return /* @__PURE__ */
|
|
29255
|
+
if (importDefaults === void 0) return /* @__PURE__ */ jsx63(Fragment20, {});
|
|
29344
29256
|
if (projectPath === void 0) {
|
|
29345
|
-
return /* @__PURE__ */
|
|
29257
|
+
return /* @__PURE__ */ jsx63(WelcomeScreen, { onContinue: setProjectPath, onQuit: leaveImport, initialPath: importDefaults.componentDir });
|
|
29346
29258
|
}
|
|
29347
29259
|
if (tokensPath === void 0) {
|
|
29348
|
-
return /* @__PURE__ */
|
|
29260
|
+
return /* @__PURE__ */ jsx63(
|
|
29349
29261
|
TokenInputScreen,
|
|
29350
29262
|
{
|
|
29351
29263
|
initialPath: importDefaults.tokenFile,
|
|
@@ -29355,7 +29267,7 @@ function App({ importOptions, inkClear }) {
|
|
|
29355
29267
|
);
|
|
29356
29268
|
}
|
|
29357
29269
|
if (scannedFiles === void 0) {
|
|
29358
|
-
return /* @__PURE__ */
|
|
29270
|
+
return /* @__PURE__ */ jsx63(
|
|
29359
29271
|
PathValidationScreen,
|
|
29360
29272
|
{
|
|
29361
29273
|
projectPath,
|
|
@@ -29367,10 +29279,10 @@ function App({ importOptions, inkClear }) {
|
|
|
29367
29279
|
}
|
|
29368
29280
|
if (extractionRun) {
|
|
29369
29281
|
if (extraction?.status === "done" && !extraction.result.ok) {
|
|
29370
|
-
return /* @__PURE__ */
|
|
29282
|
+
return /* @__PURE__ */ jsx63(ErrorStep, { stepName: extraction.result.step, message: extraction.result.message, onExit: leaveImport });
|
|
29371
29283
|
}
|
|
29372
29284
|
if (extraction?.status === "running") {
|
|
29373
|
-
return /* @__PURE__ */
|
|
29285
|
+
return /* @__PURE__ */ jsx63(
|
|
29374
29286
|
ExtractionScreen,
|
|
29375
29287
|
{
|
|
29376
29288
|
progress: extraction.progress,
|
|
@@ -29379,14 +29291,14 @@ function App({ importOptions, inkClear }) {
|
|
|
29379
29291
|
}
|
|
29380
29292
|
);
|
|
29381
29293
|
}
|
|
29382
|
-
return /* @__PURE__ */
|
|
29294
|
+
return /* @__PURE__ */ jsx63(Fragment20, {});
|
|
29383
29295
|
}
|
|
29384
29296
|
if (scopeRun && scopeFlow) {
|
|
29385
29297
|
if (scopeFlow.status === "failed") {
|
|
29386
|
-
return /* @__PURE__ */
|
|
29298
|
+
return /* @__PURE__ */ jsx63(ErrorStep, { stepName: "scope gate", message: scopeFlow.message, onExit: leaveImport });
|
|
29387
29299
|
}
|
|
29388
29300
|
if (scopeFlow.status === "deciding") {
|
|
29389
|
-
return /* @__PURE__ */
|
|
29301
|
+
return /* @__PURE__ */ jsx63(
|
|
29390
29302
|
ScopeGateScreen,
|
|
29391
29303
|
{
|
|
29392
29304
|
components: scopeFlow.load.components,
|
|
@@ -29396,7 +29308,7 @@ function App({ importOptions, inkClear }) {
|
|
|
29396
29308
|
);
|
|
29397
29309
|
}
|
|
29398
29310
|
if (generation?.status === "done" && !generation.result.ok) {
|
|
29399
|
-
return /* @__PURE__ */
|
|
29311
|
+
return /* @__PURE__ */ jsx63(ErrorStep, { stepName: generation.result.step, message: generation.result.message, onExit: leaveImport });
|
|
29400
29312
|
}
|
|
29401
29313
|
if (generation?.status === "running") {
|
|
29402
29314
|
const hasRawTokens = scopeRun.input.rawTokensPath !== "";
|
|
@@ -29404,7 +29316,7 @@ function App({ importOptions, inkClear }) {
|
|
|
29404
29316
|
hasRawTokens,
|
|
29405
29317
|
mapTokensEligible: generation.progress.mapTokensEligible
|
|
29406
29318
|
});
|
|
29407
|
-
return /* @__PURE__ */
|
|
29319
|
+
return /* @__PURE__ */ jsx63(
|
|
29408
29320
|
GenerationScreen,
|
|
29409
29321
|
{
|
|
29410
29322
|
progress: generation.progress,
|
|
@@ -29416,10 +29328,10 @@ function App({ importOptions, inkClear }) {
|
|
|
29416
29328
|
}
|
|
29417
29329
|
);
|
|
29418
29330
|
}
|
|
29419
|
-
return /* @__PURE__ */
|
|
29331
|
+
return /* @__PURE__ */ jsx63(Fragment20, {});
|
|
29420
29332
|
}
|
|
29421
29333
|
if (pendingLaunch?.cached) {
|
|
29422
|
-
return /* @__PURE__ */
|
|
29334
|
+
return /* @__PURE__ */ jsx63(
|
|
29423
29335
|
TokenReuseScreen,
|
|
29424
29336
|
{
|
|
29425
29337
|
tokensPath: pendingLaunch.cached.tokensPath,
|
|
@@ -29430,7 +29342,7 @@ function App({ importOptions, inkClear }) {
|
|
|
29430
29342
|
}
|
|
29431
29343
|
);
|
|
29432
29344
|
}
|
|
29433
|
-
return /* @__PURE__ */
|
|
29345
|
+
return /* @__PURE__ */ jsx63(
|
|
29434
29346
|
CredentialsScreen,
|
|
29435
29347
|
{
|
|
29436
29348
|
initial: importDefaults.credentials,
|
|
@@ -29439,19 +29351,17 @@ function App({ importOptions, inkClear }) {
|
|
|
29439
29351
|
}
|
|
29440
29352
|
);
|
|
29441
29353
|
case "help":
|
|
29442
|
-
return /* @__PURE__ */
|
|
29443
|
-
case "upgrade":
|
|
29444
|
-
return /* @__PURE__ */ jsx64(UpgradeScreen, { onDone: goToStart });
|
|
29354
|
+
return /* @__PURE__ */ jsx63(HelpScreen, { onDone: goToStart });
|
|
29445
29355
|
case "settings":
|
|
29446
|
-
return /* @__PURE__ */
|
|
29356
|
+
return /* @__PURE__ */ jsx63(SettingsScreen, { onNavigate: setScreen, onBack: goToStart });
|
|
29447
29357
|
case "settings-configuration":
|
|
29448
|
-
return /* @__PURE__ */
|
|
29358
|
+
return /* @__PURE__ */ jsx63(ConfigurationScreen, { onDone: goToSettings });
|
|
29449
29359
|
case "settings-opt-in-analytics":
|
|
29450
|
-
return /* @__PURE__ */
|
|
29360
|
+
return /* @__PURE__ */ jsx63(OptInAnalyticsScreen, { onDone: goToSettings });
|
|
29451
29361
|
case "settings-debug-mode":
|
|
29452
|
-
return /* @__PURE__ */
|
|
29362
|
+
return /* @__PURE__ */ jsx63(DebugModeScreen, { onDone: goToSettings });
|
|
29453
29363
|
case "start":
|
|
29454
|
-
return /* @__PURE__ */
|
|
29364
|
+
return /* @__PURE__ */ jsx63(HomeScreen, { onNavigate: setScreen });
|
|
29455
29365
|
}
|
|
29456
29366
|
}
|
|
29457
29367
|
async function runApp(renderApp, importOptions) {
|
|
@@ -29459,7 +29369,7 @@ async function runApp(renderApp, importOptions) {
|
|
|
29459
29369
|
instance.clear?.();
|
|
29460
29370
|
process.stdout.write("\x1B[H\x1B[0J");
|
|
29461
29371
|
};
|
|
29462
|
-
const instance = renderApp(/* @__PURE__ */
|
|
29372
|
+
const instance = renderApp(/* @__PURE__ */ jsx63(App, { importOptions, inkClear }));
|
|
29463
29373
|
await instance.waitUntilExit();
|
|
29464
29374
|
}
|
|
29465
29375
|
export {
|
package/dist/index.js
CHANGED
|
@@ -18308,7 +18308,7 @@ var init_home_theme = __esm({
|
|
|
18308
18308
|
}
|
|
18309
18309
|
});
|
|
18310
18310
|
|
|
18311
|
-
// packages/experience-design-system-cli/src/tui/
|
|
18311
|
+
// packages/experience-design-system-cli/src/tui/home/version.ts
|
|
18312
18312
|
import { readFileSync as readFileSync8 } from "node:fs";
|
|
18313
18313
|
import { join as join17 } from "node:path";
|
|
18314
18314
|
import semver from "semver";
|
|
@@ -18341,7 +18341,7 @@ async function checkForUpgrade() {
|
|
|
18341
18341
|
}
|
|
18342
18342
|
var PACKAGE_NAME2, TAGS_URL;
|
|
18343
18343
|
var init_version = __esm({
|
|
18344
|
-
"packages/experience-design-system-cli/src/tui/
|
|
18344
|
+
"packages/experience-design-system-cli/src/tui/home/version.ts"() {
|
|
18345
18345
|
"use strict";
|
|
18346
18346
|
init_package_root();
|
|
18347
18347
|
PACKAGE_NAME2 = "@contentful/experience-design-system-cli";
|
|
@@ -18395,14 +18395,11 @@ var init_control_hints = __esm({
|
|
|
18395
18395
|
import { useEffect as useEffect2, useState as useState2 } from "react";
|
|
18396
18396
|
import { Box, Text as Text2, useApp, useInput } from "ink";
|
|
18397
18397
|
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
18398
|
-
function
|
|
18398
|
+
function versionStatus(upgradeCheck) {
|
|
18399
18399
|
if (upgradeCheck?.status === "update-available") {
|
|
18400
|
-
return {
|
|
18400
|
+
return { text: ` (upgrade available v${upgradeCheck.latest})`, color: PALETTE.success };
|
|
18401
18401
|
}
|
|
18402
|
-
|
|
18403
|
-
return { label: "Upgrade Version (up to date)", color: PALETTE.muted };
|
|
18404
|
-
}
|
|
18405
|
-
return { label: "Upgrade Version" };
|
|
18402
|
+
return void 0;
|
|
18406
18403
|
}
|
|
18407
18404
|
function HomeScreen({ onNavigate }) {
|
|
18408
18405
|
const [focusIdx, setFocusIdx] = useState2(0);
|
|
@@ -18410,7 +18407,7 @@ function HomeScreen({ onNavigate }) {
|
|
|
18410
18407
|
const { exit } = useApp();
|
|
18411
18408
|
const terminalWidth = useTerminalWidth();
|
|
18412
18409
|
const tooNarrow = terminalWidth < MIN_TERMINAL_WIDTH;
|
|
18413
|
-
const
|
|
18410
|
+
const status = versionStatus(upgradeCheck);
|
|
18414
18411
|
useEffect2(() => {
|
|
18415
18412
|
checkForUpgrade().then(setUpgradeCheck).catch(() => setUpgradeCheck({ status: "error" }));
|
|
18416
18413
|
}, []);
|
|
@@ -18430,7 +18427,6 @@ function HomeScreen({ onNavigate }) {
|
|
|
18430
18427
|
}
|
|
18431
18428
|
if (key.return) {
|
|
18432
18429
|
const item = START_ITEMS[focusIdx];
|
|
18433
|
-
if (item.screen === "upgrade" && upgradeDisabled) return;
|
|
18434
18430
|
onNavigate(item.screen);
|
|
18435
18431
|
return;
|
|
18436
18432
|
}
|
|
@@ -18448,26 +18444,16 @@ function HomeScreen({ onNavigate }) {
|
|
|
18448
18444
|
/* @__PURE__ */ jsx2(Text2, { color: PALETTE.muted, children: SUBTITLE }),
|
|
18449
18445
|
/* @__PURE__ */ jsxs(Text2, { color: PALETTE.muted, children: [
|
|
18450
18446
|
"v",
|
|
18451
|
-
VERSION
|
|
18447
|
+
VERSION,
|
|
18448
|
+
status && /* @__PURE__ */ jsx2(Text2, { color: status.color, children: status.text })
|
|
18452
18449
|
] })
|
|
18453
18450
|
] }),
|
|
18454
18451
|
/* @__PURE__ */ jsx2(Box, { marginTop: 1, justifyContent: "center", children: /* @__PURE__ */ jsx2(Box, { flexDirection: "column", children: START_ITEMS.map((item, i) => {
|
|
18455
18452
|
const focused = i === focusIdx;
|
|
18456
|
-
|
|
18457
|
-
|
|
18458
|
-
const dimmed = isUpgradeItem && upgradeDisabled;
|
|
18459
|
-
return /* @__PURE__ */ jsxs(
|
|
18460
|
-
Text2,
|
|
18461
|
-
{
|
|
18462
|
-
bold: focused && !dimmed,
|
|
18463
|
-
color: dimmed ? PALETTE.muted : focused ? PALETTE.accent : display.color,
|
|
18464
|
-
children: [
|
|
18465
|
-
focused ? `${FOCUS_MARKER} ` : " ",
|
|
18466
|
-
display.label
|
|
18467
|
-
]
|
|
18468
|
-
},
|
|
18453
|
+
return /* @__PURE__ */ jsxs(Text2, { bold: focused, color: focused ? PALETTE.accent : void 0, children: [
|
|
18454
|
+
focused ? `${FOCUS_MARKER} ` : " ",
|
|
18469
18455
|
item.label
|
|
18470
|
-
);
|
|
18456
|
+
] }, item.label);
|
|
18471
18457
|
}) }) }),
|
|
18472
18458
|
/* @__PURE__ */ jsx2(Box, { marginTop: 1, justifyContent: "center", children: /* @__PURE__ */ jsx2(
|
|
18473
18459
|
ControlHints,
|
|
@@ -18496,7 +18482,6 @@ var init_home = __esm({
|
|
|
18496
18482
|
MIN_TERMINAL_WIDTH = 164;
|
|
18497
18483
|
START_ITEMS = [
|
|
18498
18484
|
{ label: "Import", screen: "import" },
|
|
18499
|
-
{ label: "Upgrade Version", screen: "upgrade" },
|
|
18500
18485
|
{ label: "Settings", screen: "settings" },
|
|
18501
18486
|
{ label: "Help", screen: "help" }
|
|
18502
18487
|
];
|
|
@@ -32603,95 +32588,14 @@ var init_screen11 = __esm({
|
|
|
32603
32588
|
}
|
|
32604
32589
|
});
|
|
32605
32590
|
|
|
32606
|
-
// packages/experience-design-system-cli/src/tui/
|
|
32591
|
+
// packages/experience-design-system-cli/src/tui/settings/debug-mode/screen.tsx
|
|
32607
32592
|
import { useEffect as useEffect26, useState as useState35 } from "react";
|
|
32608
32593
|
import { Box as Box50, Text as Text53, useInput as useInput15 } from "ink";
|
|
32609
32594
|
import { jsx as jsx62, jsxs as jsxs51 } from "react/jsx-runtime";
|
|
32610
|
-
function UpgradeScreen({ onDone }) {
|
|
32611
|
-
const [upgradeCheck, setUpgradeCheck] = useState35();
|
|
32612
|
-
useEffect26(() => {
|
|
32613
|
-
startDebugRun({
|
|
32614
|
-
flow: "upgrade",
|
|
32615
|
-
step: "01-upgrade",
|
|
32616
|
-
menuOption: "Upgrade",
|
|
32617
|
-
inputs: { currentVersion: readPackageVersion() }
|
|
32618
|
-
});
|
|
32619
|
-
checkForUpgrade().then(setUpgradeCheck).catch(() => setUpgradeCheck({ status: "error" }));
|
|
32620
|
-
}, []);
|
|
32621
|
-
useInput15((_input, key) => {
|
|
32622
|
-
if (key.return) {
|
|
32623
|
-
void finishDebugRun({
|
|
32624
|
-
outputs: upgradeCheck ?? {},
|
|
32625
|
-
status: upgradeCheck?.status === "error" ? "error" : "success",
|
|
32626
|
-
exitMethod: "saved"
|
|
32627
|
-
});
|
|
32628
|
-
onDone();
|
|
32629
|
-
return;
|
|
32630
|
-
}
|
|
32631
|
-
});
|
|
32632
|
-
return /* @__PURE__ */ jsxs51(Box50, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
32633
|
-
/* @__PURE__ */ jsx62(Text53, { bold: true, children: "Upgrade" }),
|
|
32634
|
-
/* @__PURE__ */ jsx62(Text53, { children: " " }),
|
|
32635
|
-
renderBody(upgradeCheck),
|
|
32636
|
-
/* @__PURE__ */ jsx62(Text53, { children: " " }),
|
|
32637
|
-
/* @__PURE__ */ jsxs51(Text53, { bold: true, color: PALETTE.accent, children: [
|
|
32638
|
-
FOCUS_MARKER,
|
|
32639
|
-
" Go Back"
|
|
32640
|
-
] })
|
|
32641
|
-
] });
|
|
32642
|
-
}
|
|
32643
|
-
function renderBody(upgradeCheck) {
|
|
32644
|
-
if (!upgradeCheck) {
|
|
32645
|
-
return /* @__PURE__ */ jsx62(Text53, { color: PALETTE.muted, children: "Checking for updates\u2026" });
|
|
32646
|
-
}
|
|
32647
|
-
if (upgradeCheck.status === "error") {
|
|
32648
|
-
return /* @__PURE__ */ jsx62(Text53, { color: PALETTE.warning, children: "Couldn't check for updates \u2014 check your network connection and try again." });
|
|
32649
|
-
}
|
|
32650
|
-
if (upgradeCheck.status === "up-to-date") {
|
|
32651
|
-
return /* @__PURE__ */ jsxs51(Text53, { color: PALETTE.success, children: [
|
|
32652
|
-
"You're already on the latest version (v",
|
|
32653
|
-
upgradeCheck.current,
|
|
32654
|
-
")."
|
|
32655
|
-
] });
|
|
32656
|
-
}
|
|
32657
|
-
return /* @__PURE__ */ jsxs51(Box50, { flexDirection: "column", children: [
|
|
32658
|
-
/* @__PURE__ */ jsxs51(Text53, { color: PALETTE.muted, children: [
|
|
32659
|
-
/* @__PURE__ */ jsxs51(Text53, { bold: true, color: PALETTE.success, children: [
|
|
32660
|
-
"v",
|
|
32661
|
-
upgradeCheck.latest
|
|
32662
|
-
] }),
|
|
32663
|
-
" ",
|
|
32664
|
-
"is available (you're on ",
|
|
32665
|
-
/* @__PURE__ */ jsxs51(Text53, { bold: true, children: [
|
|
32666
|
-
"v",
|
|
32667
|
-
upgradeCheck.current
|
|
32668
|
-
] }),
|
|
32669
|
-
"). Exit this program, cd into the root of your local clone of contentful/experience-design-system-sdk-public, then run:"
|
|
32670
|
-
] }),
|
|
32671
|
-
/* @__PURE__ */ jsx62(Text53, { children: " " }),
|
|
32672
|
-
/* @__PURE__ */ jsx62(Box50, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE.border, paddingX: 1, children: UPGRADE_COMMANDS.map((cmd) => /* @__PURE__ */ jsx62(Text53, { bold: true, children: cmd }, cmd)) })
|
|
32673
|
-
] });
|
|
32674
|
-
}
|
|
32675
|
-
var UPGRADE_COMMANDS;
|
|
32676
|
-
var init_PageContainer4 = __esm({
|
|
32677
|
-
"packages/experience-design-system-cli/src/tui/upgrade/PageContainer.tsx"() {
|
|
32678
|
-
"use strict";
|
|
32679
|
-
init_theme();
|
|
32680
|
-
init_home_theme();
|
|
32681
|
-
init_version();
|
|
32682
|
-
init_debug_store();
|
|
32683
|
-
UPGRADE_COMMANDS = ["git pull", "pnpm install", "pnpm build"];
|
|
32684
|
-
}
|
|
32685
|
-
});
|
|
32686
|
-
|
|
32687
|
-
// packages/experience-design-system-cli/src/tui/settings/debug-mode/screen.tsx
|
|
32688
|
-
import { useEffect as useEffect27, useState as useState36 } from "react";
|
|
32689
|
-
import { Box as Box51, Text as Text54, useInput as useInput16 } from "ink";
|
|
32690
|
-
import { jsx as jsx63, jsxs as jsxs52 } from "react/jsx-runtime";
|
|
32691
32595
|
function DebugModeScreen({ onDone }) {
|
|
32692
|
-
const [loading, setLoading] =
|
|
32693
|
-
const [enabled, setEnabled] =
|
|
32694
|
-
|
|
32596
|
+
const [loading, setLoading] = useState35(true);
|
|
32597
|
+
const [enabled, setEnabled] = useState35(true);
|
|
32598
|
+
useEffect26(() => {
|
|
32695
32599
|
readDebugModeSetting().then((setting) => {
|
|
32696
32600
|
setEnabled(setting.enabled);
|
|
32697
32601
|
setLoading(false);
|
|
@@ -32703,7 +32607,7 @@ function DebugModeScreen({ onDone }) {
|
|
|
32703
32607
|
});
|
|
32704
32608
|
});
|
|
32705
32609
|
}, []);
|
|
32706
|
-
|
|
32610
|
+
useInput15((input, key) => {
|
|
32707
32611
|
if (loading) return;
|
|
32708
32612
|
if (key.return || input === " ") {
|
|
32709
32613
|
setEnabled((current) => {
|
|
@@ -32718,16 +32622,16 @@ function DebugModeScreen({ onDone }) {
|
|
|
32718
32622
|
onDone();
|
|
32719
32623
|
}
|
|
32720
32624
|
});
|
|
32721
|
-
return /* @__PURE__ */
|
|
32722
|
-
/* @__PURE__ */
|
|
32723
|
-
/* @__PURE__ */
|
|
32724
|
-
loading ? /* @__PURE__ */
|
|
32625
|
+
return /* @__PURE__ */ jsxs51(Box50, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
32626
|
+
/* @__PURE__ */ jsx62(Text53, { bold: true, children: "Settings \u203A Debug Mode" }),
|
|
32627
|
+
/* @__PURE__ */ jsx62(Text53, { children: " " }),
|
|
32628
|
+
loading ? /* @__PURE__ */ jsx62(Text53, { color: PALETTE.muted, children: "Loading\u2026" }) : /* @__PURE__ */ jsxs51(Text53, { children: [
|
|
32725
32629
|
"Debug logging:",
|
|
32726
32630
|
" ",
|
|
32727
|
-
/* @__PURE__ */
|
|
32631
|
+
/* @__PURE__ */ jsx62(Text53, { bold: true, color: enabled ? PALETTE.success : PALETTE.muted, children: enabled ? "On" : "Off" })
|
|
32728
32632
|
] }),
|
|
32729
|
-
/* @__PURE__ */
|
|
32730
|
-
/* @__PURE__ */
|
|
32633
|
+
/* @__PURE__ */ jsx62(Text53, { children: " " }),
|
|
32634
|
+
/* @__PURE__ */ jsx62(
|
|
32731
32635
|
ControlHints,
|
|
32732
32636
|
{
|
|
32733
32637
|
hints: [
|
|
@@ -32754,19 +32658,19 @@ __export(app_exports, {
|
|
|
32754
32658
|
runApp: () => runApp
|
|
32755
32659
|
});
|
|
32756
32660
|
import { join as join27 } from "node:path";
|
|
32757
|
-
import { useEffect as
|
|
32758
|
-
import { Fragment as Fragment20, jsx as
|
|
32661
|
+
import { useEffect as useEffect27, useState as useState36 } from "react";
|
|
32662
|
+
import { Fragment as Fragment20, jsx as jsx63 } from "react/jsx-runtime";
|
|
32759
32663
|
function App({ importOptions, inkClear }) {
|
|
32760
|
-
const [screen, setScreen] =
|
|
32761
|
-
const [importExitCode, setImportExitCode] =
|
|
32664
|
+
const [screen, setScreen] = useState36("start");
|
|
32665
|
+
const [importExitCode, setImportExitCode] = useState36();
|
|
32762
32666
|
const showImportResult = importExitCode !== void 0;
|
|
32763
|
-
const [projectPath, setProjectPath] =
|
|
32764
|
-
const [tokensPath, setTokensPath] =
|
|
32765
|
-
const [scannedFiles, setScannedFiles] =
|
|
32766
|
-
const [pendingLaunch, setPendingLaunch] =
|
|
32767
|
-
const [extractionRun, setExtractionRun] =
|
|
32667
|
+
const [projectPath, setProjectPath] = useState36();
|
|
32668
|
+
const [tokensPath, setTokensPath] = useState36();
|
|
32669
|
+
const [scannedFiles, setScannedFiles] = useState36();
|
|
32670
|
+
const [pendingLaunch, setPendingLaunch] = useState36();
|
|
32671
|
+
const [extractionRun, setExtractionRun] = useState36();
|
|
32768
32672
|
const extraction = useExtraction(extractionRun?.input);
|
|
32769
|
-
const [scopeRun, setScopeRun] =
|
|
32673
|
+
const [scopeRun, setScopeRun] = useState36();
|
|
32770
32674
|
const scopeFlow = useScopeGateFlow(
|
|
32771
32675
|
scopeRun && {
|
|
32772
32676
|
sessionId: scopeRun.extraction.sessionId,
|
|
@@ -32781,12 +32685,12 @@ function App({ importOptions, inkClear }) {
|
|
|
32781
32685
|
}
|
|
32782
32686
|
}
|
|
32783
32687
|
);
|
|
32784
|
-
const [generationInput, setGenerationInput] =
|
|
32688
|
+
const [generationInput, setGenerationInput] = useState36();
|
|
32785
32689
|
const generation = useGeneration(generationInput);
|
|
32786
|
-
const [flowStart, setFlowStart] =
|
|
32690
|
+
const [flowStart, setFlowStart] = useState36();
|
|
32787
32691
|
const flow = useFlow(flowStart, { beforeStepChange: inkClear });
|
|
32788
|
-
const [importDefaults, setImportDefaults] =
|
|
32789
|
-
|
|
32692
|
+
const [importDefaults, setImportDefaults] = useState36();
|
|
32693
|
+
useEffect27(() => {
|
|
32790
32694
|
if (screen !== "import") {
|
|
32791
32695
|
setImportDefaults(void 0);
|
|
32792
32696
|
return;
|
|
@@ -32846,12 +32750,12 @@ function App({ importOptions, inkClear }) {
|
|
|
32846
32750
|
}
|
|
32847
32751
|
});
|
|
32848
32752
|
};
|
|
32849
|
-
|
|
32753
|
+
useEffect27(() => {
|
|
32850
32754
|
if (!extractionRun || extraction?.status !== "done" || !extraction.result.ok) return;
|
|
32851
32755
|
setExtractionRun(void 0);
|
|
32852
32756
|
setScopeRun({ ...extractionRun, extraction: extraction.result.extraction });
|
|
32853
32757
|
}, [extraction, extractionRun]);
|
|
32854
|
-
|
|
32758
|
+
useEffect27(() => {
|
|
32855
32759
|
if (!scopeRun || scopeFlow?.status !== "confirmed" || generationInput) return;
|
|
32856
32760
|
const { extraction: produced, input, generatePromptPath } = scopeRun;
|
|
32857
32761
|
setGenerationInput({
|
|
@@ -32869,7 +32773,7 @@ function App({ importOptions, inkClear }) {
|
|
|
32869
32773
|
...generatePromptPath ? { generatePromptPath } : {}
|
|
32870
32774
|
});
|
|
32871
32775
|
}, [scopeFlow, scopeRun, generationInput]);
|
|
32872
|
-
|
|
32776
|
+
useEffect27(() => {
|
|
32873
32777
|
if (!scopeRun || generation?.status !== "done" || !generation.result.ok) return;
|
|
32874
32778
|
const { credentialsSkipped, tokenStrategy, extraction: produced, input, generatePromptPath } = scopeRun;
|
|
32875
32779
|
inkClear();
|
|
@@ -32912,9 +32816,9 @@ function App({ importOptions, inkClear }) {
|
|
|
32912
32816
|
};
|
|
32913
32817
|
switch (screen) {
|
|
32914
32818
|
case "import":
|
|
32915
|
-
if (showImportResult) return /* @__PURE__ */
|
|
32819
|
+
if (showImportResult) return /* @__PURE__ */ jsx63(ImportScreen, { exitCode: importExitCode, onDone: finishImportResult });
|
|
32916
32820
|
if (flow && flowStart) {
|
|
32917
|
-
return /* @__PURE__ */
|
|
32821
|
+
return /* @__PURE__ */ jsx63(
|
|
32918
32822
|
FlowScreen,
|
|
32919
32823
|
{
|
|
32920
32824
|
state: flow.state,
|
|
@@ -32924,12 +32828,12 @@ function App({ importOptions, inkClear }) {
|
|
|
32924
32828
|
}
|
|
32925
32829
|
);
|
|
32926
32830
|
}
|
|
32927
|
-
if (importDefaults === void 0) return /* @__PURE__ */
|
|
32831
|
+
if (importDefaults === void 0) return /* @__PURE__ */ jsx63(Fragment20, {});
|
|
32928
32832
|
if (projectPath === void 0) {
|
|
32929
|
-
return /* @__PURE__ */
|
|
32833
|
+
return /* @__PURE__ */ jsx63(WelcomeScreen, { onContinue: setProjectPath, onQuit: leaveImport, initialPath: importDefaults.componentDir });
|
|
32930
32834
|
}
|
|
32931
32835
|
if (tokensPath === void 0) {
|
|
32932
|
-
return /* @__PURE__ */
|
|
32836
|
+
return /* @__PURE__ */ jsx63(
|
|
32933
32837
|
TokenInputScreen,
|
|
32934
32838
|
{
|
|
32935
32839
|
initialPath: importDefaults.tokenFile,
|
|
@@ -32939,7 +32843,7 @@ function App({ importOptions, inkClear }) {
|
|
|
32939
32843
|
);
|
|
32940
32844
|
}
|
|
32941
32845
|
if (scannedFiles === void 0) {
|
|
32942
|
-
return /* @__PURE__ */
|
|
32846
|
+
return /* @__PURE__ */ jsx63(
|
|
32943
32847
|
PathValidationScreen,
|
|
32944
32848
|
{
|
|
32945
32849
|
projectPath,
|
|
@@ -32951,10 +32855,10 @@ function App({ importOptions, inkClear }) {
|
|
|
32951
32855
|
}
|
|
32952
32856
|
if (extractionRun) {
|
|
32953
32857
|
if (extraction?.status === "done" && !extraction.result.ok) {
|
|
32954
|
-
return /* @__PURE__ */
|
|
32858
|
+
return /* @__PURE__ */ jsx63(ErrorStep, { stepName: extraction.result.step, message: extraction.result.message, onExit: leaveImport });
|
|
32955
32859
|
}
|
|
32956
32860
|
if (extraction?.status === "running") {
|
|
32957
|
-
return /* @__PURE__ */
|
|
32861
|
+
return /* @__PURE__ */ jsx63(
|
|
32958
32862
|
ExtractionScreen,
|
|
32959
32863
|
{
|
|
32960
32864
|
progress: extraction.progress,
|
|
@@ -32963,14 +32867,14 @@ function App({ importOptions, inkClear }) {
|
|
|
32963
32867
|
}
|
|
32964
32868
|
);
|
|
32965
32869
|
}
|
|
32966
|
-
return /* @__PURE__ */
|
|
32870
|
+
return /* @__PURE__ */ jsx63(Fragment20, {});
|
|
32967
32871
|
}
|
|
32968
32872
|
if (scopeRun && scopeFlow) {
|
|
32969
32873
|
if (scopeFlow.status === "failed") {
|
|
32970
|
-
return /* @__PURE__ */
|
|
32874
|
+
return /* @__PURE__ */ jsx63(ErrorStep, { stepName: "scope gate", message: scopeFlow.message, onExit: leaveImport });
|
|
32971
32875
|
}
|
|
32972
32876
|
if (scopeFlow.status === "deciding") {
|
|
32973
|
-
return /* @__PURE__ */
|
|
32877
|
+
return /* @__PURE__ */ jsx63(
|
|
32974
32878
|
ScopeGateScreen,
|
|
32975
32879
|
{
|
|
32976
32880
|
components: scopeFlow.load.components,
|
|
@@ -32980,7 +32884,7 @@ function App({ importOptions, inkClear }) {
|
|
|
32980
32884
|
);
|
|
32981
32885
|
}
|
|
32982
32886
|
if (generation?.status === "done" && !generation.result.ok) {
|
|
32983
|
-
return /* @__PURE__ */
|
|
32887
|
+
return /* @__PURE__ */ jsx63(ErrorStep, { stepName: generation.result.step, message: generation.result.message, onExit: leaveImport });
|
|
32984
32888
|
}
|
|
32985
32889
|
if (generation?.status === "running") {
|
|
32986
32890
|
const hasRawTokens = scopeRun.input.rawTokensPath !== "";
|
|
@@ -32988,7 +32892,7 @@ function App({ importOptions, inkClear }) {
|
|
|
32988
32892
|
hasRawTokens,
|
|
32989
32893
|
mapTokensEligible: generation.progress.mapTokensEligible
|
|
32990
32894
|
});
|
|
32991
|
-
return /* @__PURE__ */
|
|
32895
|
+
return /* @__PURE__ */ jsx63(
|
|
32992
32896
|
GenerationScreen,
|
|
32993
32897
|
{
|
|
32994
32898
|
progress: generation.progress,
|
|
@@ -33000,10 +32904,10 @@ function App({ importOptions, inkClear }) {
|
|
|
33000
32904
|
}
|
|
33001
32905
|
);
|
|
33002
32906
|
}
|
|
33003
|
-
return /* @__PURE__ */
|
|
32907
|
+
return /* @__PURE__ */ jsx63(Fragment20, {});
|
|
33004
32908
|
}
|
|
33005
32909
|
if (pendingLaunch?.cached) {
|
|
33006
|
-
return /* @__PURE__ */
|
|
32910
|
+
return /* @__PURE__ */ jsx63(
|
|
33007
32911
|
TokenReuseScreen,
|
|
33008
32912
|
{
|
|
33009
32913
|
tokensPath: pendingLaunch.cached.tokensPath,
|
|
@@ -33014,7 +32918,7 @@ function App({ importOptions, inkClear }) {
|
|
|
33014
32918
|
}
|
|
33015
32919
|
);
|
|
33016
32920
|
}
|
|
33017
|
-
return /* @__PURE__ */
|
|
32921
|
+
return /* @__PURE__ */ jsx63(
|
|
33018
32922
|
CredentialsScreen,
|
|
33019
32923
|
{
|
|
33020
32924
|
initial: importDefaults.credentials,
|
|
@@ -33023,19 +32927,17 @@ function App({ importOptions, inkClear }) {
|
|
|
33023
32927
|
}
|
|
33024
32928
|
);
|
|
33025
32929
|
case "help":
|
|
33026
|
-
return /* @__PURE__ */
|
|
33027
|
-
case "upgrade":
|
|
33028
|
-
return /* @__PURE__ */ jsx64(UpgradeScreen, { onDone: goToStart });
|
|
32930
|
+
return /* @__PURE__ */ jsx63(HelpScreen, { onDone: goToStart });
|
|
33029
32931
|
case "settings":
|
|
33030
|
-
return /* @__PURE__ */
|
|
32932
|
+
return /* @__PURE__ */ jsx63(SettingsScreen, { onNavigate: setScreen, onBack: goToStart });
|
|
33031
32933
|
case "settings-configuration":
|
|
33032
|
-
return /* @__PURE__ */
|
|
32934
|
+
return /* @__PURE__ */ jsx63(ConfigurationScreen, { onDone: goToSettings });
|
|
33033
32935
|
case "settings-opt-in-analytics":
|
|
33034
|
-
return /* @__PURE__ */
|
|
32936
|
+
return /* @__PURE__ */ jsx63(OptInAnalyticsScreen, { onDone: goToSettings });
|
|
33035
32937
|
case "settings-debug-mode":
|
|
33036
|
-
return /* @__PURE__ */
|
|
32938
|
+
return /* @__PURE__ */ jsx63(DebugModeScreen, { onDone: goToSettings });
|
|
33037
32939
|
case "start":
|
|
33038
|
-
return /* @__PURE__ */
|
|
32940
|
+
return /* @__PURE__ */ jsx63(HomeScreen, { onNavigate: setScreen });
|
|
33039
32941
|
}
|
|
33040
32942
|
}
|
|
33041
32943
|
async function runApp(renderApp, importOptions) {
|
|
@@ -33043,7 +32945,7 @@ async function runApp(renderApp, importOptions) {
|
|
|
33043
32945
|
instance.clear?.();
|
|
33044
32946
|
process.stdout.write("\x1B[H\x1B[0J");
|
|
33045
32947
|
};
|
|
33046
|
-
const instance = renderApp(/* @__PURE__ */
|
|
32948
|
+
const instance = renderApp(/* @__PURE__ */ jsx63(App, { importOptions, inkClear }));
|
|
33047
32949
|
await instance.waitUntilExit();
|
|
33048
32950
|
}
|
|
33049
32951
|
var init_app = __esm({
|
|
@@ -33069,7 +32971,6 @@ var init_app = __esm({
|
|
|
33069
32971
|
init_PageContainer3();
|
|
33070
32972
|
init_ConfigurationScreen();
|
|
33071
32973
|
init_screen11();
|
|
33072
|
-
init_PageContainer4();
|
|
33073
32974
|
init_screen12();
|
|
33074
32975
|
init_project_store();
|
|
33075
32976
|
}
|
package/dist/package.json
CHANGED
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-0b7e3e1f.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-0b7e3e1f.0",
|
|
49
|
+
"@contentful/experience-design-system-types": "2.37.1-dev-build-0b7e3e1f.0"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@tsconfig/node24": "^24.0.4",
|
|
File without changes
|