@contentful/experience-design-system-cli 2.42.1-dev-build-c7f654e2.0 → 2.42.1-dev-build-2fb477e0.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 +464 -607
- package/dist/index.js +314 -475
- package/dist/package.json +1 -1
- package/dist/src/tui/debug-store.d.ts +1 -3
- package/dist/src/tui/import/shared/error-step/controls.d.ts +0 -2
- package/dist/src/tui/import/shared/error-step/logic.d.ts +1 -2
- package/dist/src/tui/import/steps/03-path-validation/logic.d.ts +12 -2
- package/package.json +3 -3
- package/dist/src/tui/import/shared/error-step/use-support-bundle.d.ts +0 -3
- package/dist/src/tui/support-bundle.d.ts +0 -25
- package/dist/src/tui/zip.d.ts +0 -7
package/dist/index.js
CHANGED
|
@@ -8318,8 +8318,8 @@ function getWorkspacePackageDirs(workspaceRoot) {
|
|
|
8318
8318
|
continue;
|
|
8319
8319
|
const entryPath = join5(dir, entry);
|
|
8320
8320
|
try {
|
|
8321
|
-
const
|
|
8322
|
-
if (
|
|
8321
|
+
const stat5 = statSync2(entryPath);
|
|
8322
|
+
if (stat5.isDirectory()) {
|
|
8323
8323
|
scanDir(entryPath, depth + 1);
|
|
8324
8324
|
}
|
|
8325
8325
|
} catch {
|
|
@@ -11834,11 +11834,11 @@ function getPathPreferenceScore(filePath) {
|
|
|
11834
11834
|
const normalized = filePath.replace(/\\/g, "/");
|
|
11835
11835
|
const segments = normalized.split("/").filter(Boolean);
|
|
11836
11836
|
const filename = segments.at(-1) ?? "";
|
|
11837
|
-
const
|
|
11837
|
+
const basename7 = filename.replace(/\.[^.]+$/, "");
|
|
11838
11838
|
let score = 0;
|
|
11839
11839
|
if (/^index\.[jt]sx?$/.test(filename))
|
|
11840
11840
|
score += 100;
|
|
11841
|
-
if (
|
|
11841
|
+
if (basename7 && segments.at(-2) === basename7)
|
|
11842
11842
|
score -= 10;
|
|
11843
11843
|
const componentsSegmentCount = segments.filter((segment) => segment === "components").length;
|
|
11844
11844
|
score -= componentsSegmentCount * 8;
|
|
@@ -13785,15 +13785,15 @@ import { statSync as statSync4 } from "node:fs";
|
|
|
13785
13785
|
import path4 from "node:path";
|
|
13786
13786
|
function collectFiles(root, options = {}) {
|
|
13787
13787
|
const resolved = path4.resolve(root);
|
|
13788
|
-
let
|
|
13788
|
+
let stat5;
|
|
13789
13789
|
try {
|
|
13790
|
-
|
|
13790
|
+
stat5 = statSync4(resolved);
|
|
13791
13791
|
} catch (err) {
|
|
13792
13792
|
return { ok: false, failure: classifyStatError(err.code), rootPath: resolved };
|
|
13793
13793
|
}
|
|
13794
|
-
if (
|
|
13794
|
+
if (stat5.isFile())
|
|
13795
13795
|
return { ok: false, failure: "is-file", rootPath: resolved };
|
|
13796
|
-
if (!
|
|
13796
|
+
if (!stat5.isDirectory())
|
|
13797
13797
|
return { ok: false, failure: "not-directory", rootPath: resolved };
|
|
13798
13798
|
const result = {
|
|
13799
13799
|
filePaths: [],
|
|
@@ -19501,7 +19501,6 @@ __export(debug_store_exports, {
|
|
|
19501
19501
|
currentSessionDir: () => currentSessionDir,
|
|
19502
19502
|
finishDebugRun: () => finishDebugRun,
|
|
19503
19503
|
setDebugRunProgress: () => setDebugRunProgress,
|
|
19504
|
-
settleDebugLogs: () => settleDebugLogs,
|
|
19505
19504
|
startDebugRun: () => startDebugRun,
|
|
19506
19505
|
startDebugSessionIn: () => startDebugSessionIn,
|
|
19507
19506
|
startImportRun: () => startImportRun
|
|
@@ -19606,19 +19605,7 @@ function startDebugRun({
|
|
|
19606
19605
|
function setDebugRunProgress(outputs) {
|
|
19607
19606
|
if (pendingRun) pendingRun.progress = outputs;
|
|
19608
19607
|
}
|
|
19609
|
-
function
|
|
19610
|
-
unsettled.add(work);
|
|
19611
|
-
const forget = () => void unsettled.delete(work);
|
|
19612
|
-
work.then(forget, forget);
|
|
19613
|
-
return work;
|
|
19614
|
-
}
|
|
19615
|
-
async function settleDebugLogs() {
|
|
19616
|
-
while (unsettled.size > 0) await Promise.allSettled([...unsettled]);
|
|
19617
|
-
}
|
|
19618
|
-
function finishDebugRun(args) {
|
|
19619
|
-
return track(finishRun(args));
|
|
19620
|
-
}
|
|
19621
|
-
async function finishRun({
|
|
19608
|
+
async function finishDebugRun({
|
|
19622
19609
|
outputs,
|
|
19623
19610
|
status,
|
|
19624
19611
|
exitMethod
|
|
@@ -19701,7 +19688,7 @@ ${JSON.stringify(finish.outputs, null, 2)}
|
|
|
19701
19688
|
function handleCrash() {
|
|
19702
19689
|
return finishDebugRun({ outputs: pendingRun?.progress ?? {}, status: "error", exitMethod: "crashed" });
|
|
19703
19690
|
}
|
|
19704
|
-
var pendingRun, sessionDir,
|
|
19691
|
+
var pendingRun, sessionDir, WAITING_LIMIT, waiting;
|
|
19705
19692
|
var init_debug_store = __esm({
|
|
19706
19693
|
"packages/experience-design-system-cli/src/tui/debug-store.ts"() {
|
|
19707
19694
|
"use strict";
|
|
@@ -19731,7 +19718,6 @@ var init_debug_store = __esm({
|
|
|
19731
19718
|
);
|
|
19732
19719
|
}
|
|
19733
19720
|
});
|
|
19734
|
-
unsettled = /* @__PURE__ */ new Set();
|
|
19735
19721
|
WAITING_LIMIT = 50;
|
|
19736
19722
|
waiting = [];
|
|
19737
19723
|
process.once("uncaughtException", (err) => {
|
|
@@ -19874,135 +19860,10 @@ var init_controls = __esm({
|
|
|
19874
19860
|
}
|
|
19875
19861
|
});
|
|
19876
19862
|
|
|
19877
|
-
// packages/experience-design-system-cli/src/tui/zip.ts
|
|
19878
|
-
import { crc32, deflateRawSync } from "node:zlib";
|
|
19879
|
-
function dosDateTime(date) {
|
|
19880
|
-
const year = Math.max(1980, date.getFullYear());
|
|
19881
|
-
return {
|
|
19882
|
-
day: year - 1980 << 9 | date.getMonth() + 1 << 5 | date.getDate(),
|
|
19883
|
-
time: date.getHours() << 11 | date.getMinutes() << 5 | date.getSeconds() >> 1
|
|
19884
|
-
};
|
|
19885
|
-
}
|
|
19886
|
-
function createZip(entries) {
|
|
19887
|
-
const body = [];
|
|
19888
|
-
const directory = [];
|
|
19889
|
-
let offset = 0;
|
|
19890
|
-
for (const entry of entries) {
|
|
19891
|
-
const name = Buffer.from(entry.name, "utf8");
|
|
19892
|
-
const compressed = deflateRawSync(entry.data);
|
|
19893
|
-
const checksum = crc32(entry.data);
|
|
19894
|
-
const { day, time } = dosDateTime(entry.modified);
|
|
19895
|
-
const local = Buffer.alloc(30);
|
|
19896
|
-
local.writeUInt32LE(LOCAL_HEADER, 0);
|
|
19897
|
-
local.writeUInt16LE(VERSION2, 4);
|
|
19898
|
-
local.writeUInt16LE(UTF8_NAMES, 6);
|
|
19899
|
-
local.writeUInt16LE(DEFLATE, 8);
|
|
19900
|
-
local.writeUInt16LE(time, 10);
|
|
19901
|
-
local.writeUInt16LE(day, 12);
|
|
19902
|
-
local.writeUInt32LE(checksum, 14);
|
|
19903
|
-
local.writeUInt32LE(compressed.length, 18);
|
|
19904
|
-
local.writeUInt32LE(entry.data.length, 22);
|
|
19905
|
-
local.writeUInt16LE(name.length, 26);
|
|
19906
|
-
body.push(local, name, compressed);
|
|
19907
|
-
const central = Buffer.alloc(46);
|
|
19908
|
-
central.writeUInt32LE(CENTRAL_HEADER, 0);
|
|
19909
|
-
central.writeUInt16LE(VERSION2, 4);
|
|
19910
|
-
central.writeUInt16LE(VERSION2, 6);
|
|
19911
|
-
central.writeUInt16LE(UTF8_NAMES, 8);
|
|
19912
|
-
central.writeUInt16LE(DEFLATE, 10);
|
|
19913
|
-
central.writeUInt16LE(time, 12);
|
|
19914
|
-
central.writeUInt16LE(day, 14);
|
|
19915
|
-
central.writeUInt32LE(checksum, 16);
|
|
19916
|
-
central.writeUInt32LE(compressed.length, 20);
|
|
19917
|
-
central.writeUInt32LE(entry.data.length, 24);
|
|
19918
|
-
central.writeUInt16LE(name.length, 28);
|
|
19919
|
-
central.writeUInt32LE(offset, 42);
|
|
19920
|
-
directory.push(central, name);
|
|
19921
|
-
offset += local.length + name.length + compressed.length;
|
|
19922
|
-
}
|
|
19923
|
-
const directoryBytes = Buffer.concat(directory);
|
|
19924
|
-
const end = Buffer.alloc(22);
|
|
19925
|
-
end.writeUInt32LE(END_OF_ARCHIVE, 0);
|
|
19926
|
-
end.writeUInt16LE(entries.length, 8);
|
|
19927
|
-
end.writeUInt16LE(entries.length, 10);
|
|
19928
|
-
end.writeUInt32LE(directoryBytes.length, 12);
|
|
19929
|
-
end.writeUInt32LE(offset, 16);
|
|
19930
|
-
return Buffer.concat([...body, directoryBytes, end]);
|
|
19931
|
-
}
|
|
19932
|
-
var LOCAL_HEADER, CENTRAL_HEADER, END_OF_ARCHIVE, VERSION2, UTF8_NAMES, DEFLATE;
|
|
19933
|
-
var init_zip = __esm({
|
|
19934
|
-
"packages/experience-design-system-cli/src/tui/zip.ts"() {
|
|
19935
|
-
"use strict";
|
|
19936
|
-
LOCAL_HEADER = 67324752;
|
|
19937
|
-
CENTRAL_HEADER = 33639248;
|
|
19938
|
-
END_OF_ARCHIVE = 101010256;
|
|
19939
|
-
VERSION2 = 20;
|
|
19940
|
-
UTF8_NAMES = 2048;
|
|
19941
|
-
DEFLATE = 8;
|
|
19942
|
-
}
|
|
19943
|
-
});
|
|
19944
|
-
|
|
19945
|
-
// packages/experience-design-system-cli/src/tui/support-bundle.ts
|
|
19946
|
-
import { spawn as spawn4 } from "node:child_process";
|
|
19947
|
-
import { readdir as readdir3, readFile as readFile21, stat as stat5, writeFile as writeFile8 } from "node:fs/promises";
|
|
19948
|
-
import { basename as basename6, dirname as dirname16, join as join20, sep } from "node:path";
|
|
19949
|
-
async function bundleDebugLogs() {
|
|
19950
|
-
const session = currentSessionDir();
|
|
19951
|
-
const debugDir = currentDebugSessionDir();
|
|
19952
|
-
if (!session || !debugDir) return { status: "no-logs" };
|
|
19953
|
-
try {
|
|
19954
|
-
await settleDebugLogs();
|
|
19955
|
-
const logs = (await readdir3(debugDir, { recursive: true })).filter((file) => file.endsWith(".md")).sort();
|
|
19956
|
-
if (logs.length === 0) return { status: "no-logs" };
|
|
19957
|
-
const entries = await Promise.all(
|
|
19958
|
-
logs.map(async (file) => {
|
|
19959
|
-
const path6 = join20(debugDir, file);
|
|
19960
|
-
return { name: file.split(sep).join("/"), data: await readFile21(path6), modified: (await stat5(path6)).mtime };
|
|
19961
|
-
})
|
|
19962
|
-
);
|
|
19963
|
-
const path5 = join20(session, `${basename6(session)}-debug-logs.zip`);
|
|
19964
|
-
await writeFile8(path5, createZip(entries), { mode: 384 });
|
|
19965
|
-
return { status: "created", path: path5, files: entries.length };
|
|
19966
|
-
} catch {
|
|
19967
|
-
return { status: "failed", folder: debugDir };
|
|
19968
|
-
}
|
|
19969
|
-
}
|
|
19970
|
-
function openSupportBundle(bundle) {
|
|
19971
|
-
if (bundle.status === "no-logs") return;
|
|
19972
|
-
const target = bundle.status === "created" ? bundle.path : bundle.folder;
|
|
19973
|
-
const command = process.platform === "darwin" ? { file: "open", args: bundle.status === "created" ? ["-R", target] : [target] } : process.platform === "win32" ? { file: "explorer.exe", args: bundle.status === "created" ? [`/select,${target}`] : [target] } : { file: "xdg-open", args: [bundle.status === "created" ? dirname16(target) : target] };
|
|
19974
|
-
try {
|
|
19975
|
-
const child = spawn4(command.file, command.args, { stdio: "ignore", detached: true });
|
|
19976
|
-
child.on("error", () => void 0);
|
|
19977
|
-
child.unref();
|
|
19978
|
-
} catch {
|
|
19979
|
-
}
|
|
19980
|
-
}
|
|
19981
|
-
function supportInstruction(bundle) {
|
|
19982
|
-
switch (bundle.status) {
|
|
19983
|
-
case "created":
|
|
19984
|
-
return `Debug logs saved to ${bundle.path}
|
|
19985
|
-
Send this file to Contentful support so they can look into it.`;
|
|
19986
|
-
case "no-logs":
|
|
19987
|
-
return "No debug logs were recorded. To get help, turn on Debug Mode in Settings, run the import again and send the zip file it saves to Contentful support.";
|
|
19988
|
-
case "failed":
|
|
19989
|
-
return `Your debug logs are in ${bundle.folder}
|
|
19990
|
-
Zip that folder and send it to Contentful support so they can look into it.`;
|
|
19991
|
-
}
|
|
19992
|
-
}
|
|
19993
|
-
var init_support_bundle = __esm({
|
|
19994
|
-
"packages/experience-design-system-cli/src/tui/support-bundle.ts"() {
|
|
19995
|
-
"use strict";
|
|
19996
|
-
init_debug_store();
|
|
19997
|
-
init_zip();
|
|
19998
|
-
}
|
|
19999
|
-
});
|
|
20000
|
-
|
|
20001
19863
|
// packages/experience-design-system-cli/src/tui/import/shared/error-step/logic.ts
|
|
20002
19864
|
function errorAction(input, key, available) {
|
|
20003
19865
|
if (key.return && available.canAcknowledge) return "acknowledge";
|
|
20004
19866
|
if (input === "r" && available.canRetry) return "retry";
|
|
20005
|
-
if (input === "o" && available.canOpen) return "open";
|
|
20006
19867
|
if (key.return || key.escape) return "exit";
|
|
20007
19868
|
return null;
|
|
20008
19869
|
}
|
|
@@ -20010,8 +19871,7 @@ function errorControls(available) {
|
|
|
20010
19871
|
return [
|
|
20011
19872
|
available.canAcknowledge ? { keys: "Enter", label: "Acknowledge and apply" } : { keys: "Enter", label: "Exit" },
|
|
20012
19873
|
...available.canAcknowledge ? [{ keys: "Esc", label: "Exit" }] : [],
|
|
20013
|
-
...available.canRetry ? [{ keys: "r", label: "Re-enter credentials" }] : []
|
|
20014
|
-
...available.canOpen ? [{ keys: "o", label: "Show debug logs in file manager" }] : []
|
|
19874
|
+
...available.canRetry ? [{ keys: "r", label: "Re-enter credentials" }] : []
|
|
20015
19875
|
];
|
|
20016
19876
|
}
|
|
20017
19877
|
var init_logic2 = __esm({
|
|
@@ -20026,12 +19886,10 @@ function useErrorControls(handlers) {
|
|
|
20026
19886
|
useInput4((input, key) => {
|
|
20027
19887
|
const action = errorAction(input, key, {
|
|
20028
19888
|
canRetry: handlers.onRetry !== void 0,
|
|
20029
|
-
canAcknowledge: handlers.onAcknowledge !== void 0
|
|
20030
|
-
canOpen: handlers.onOpen !== void 0
|
|
19889
|
+
canAcknowledge: handlers.onAcknowledge !== void 0
|
|
20031
19890
|
});
|
|
20032
19891
|
if (action === "acknowledge") handlers.onAcknowledge?.();
|
|
20033
19892
|
else if (action === "retry") handlers.onRetry?.();
|
|
20034
|
-
else if (action === "open") handlers.onOpen?.();
|
|
20035
19893
|
else if (action === "exit") handlers.onExit();
|
|
20036
19894
|
});
|
|
20037
19895
|
}
|
|
@@ -20042,28 +19900,6 @@ var init_controls2 = __esm({
|
|
|
20042
19900
|
}
|
|
20043
19901
|
});
|
|
20044
19902
|
|
|
20045
|
-
// packages/experience-design-system-cli/src/tui/import/shared/error-step/use-support-bundle.ts
|
|
20046
|
-
import { useEffect as useEffect3, useState as useState3 } from "react";
|
|
20047
|
-
function useSupportBundle() {
|
|
20048
|
-
const [bundle, setBundle] = useState3();
|
|
20049
|
-
useEffect3(() => {
|
|
20050
|
-
let active = true;
|
|
20051
|
-
void bundleDebugLogs().then((result) => {
|
|
20052
|
-
if (active) setBundle(result);
|
|
20053
|
-
});
|
|
20054
|
-
return () => {
|
|
20055
|
-
active = false;
|
|
20056
|
-
};
|
|
20057
|
-
}, []);
|
|
20058
|
-
return bundle;
|
|
20059
|
-
}
|
|
20060
|
-
var init_use_support_bundle = __esm({
|
|
20061
|
-
"packages/experience-design-system-cli/src/tui/import/shared/error-step/use-support-bundle.ts"() {
|
|
20062
|
-
"use strict";
|
|
20063
|
-
init_support_bundle();
|
|
20064
|
-
}
|
|
20065
|
-
});
|
|
20066
|
-
|
|
20067
19903
|
// packages/experience-design-system-cli/src/tui/import/shared/error-step/error-step.tsx
|
|
20068
19904
|
import { Box as Box4, Text as Text4 } from "ink";
|
|
20069
19905
|
import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
@@ -20074,18 +19910,10 @@ function ErrorStep({
|
|
|
20074
19910
|
onRetryCredentials,
|
|
20075
19911
|
onAcknowledgeBreakingChanges
|
|
20076
19912
|
}) {
|
|
20077
|
-
|
|
20078
|
-
const canOpen = bundle !== void 0 && bundle.status !== "no-logs";
|
|
20079
|
-
useErrorControls({
|
|
20080
|
-
onExit,
|
|
20081
|
-
onRetry: onRetryCredentials,
|
|
20082
|
-
onAcknowledge: onAcknowledgeBreakingChanges,
|
|
20083
|
-
onOpen: canOpen ? () => openSupportBundle(bundle) : void 0
|
|
20084
|
-
});
|
|
19913
|
+
useErrorControls({ onExit, onRetry: onRetryCredentials, onAcknowledge: onAcknowledgeBreakingChanges });
|
|
20085
19914
|
const controls = errorControls({
|
|
20086
19915
|
canRetry: onRetryCredentials !== void 0,
|
|
20087
|
-
canAcknowledge: onAcknowledgeBreakingChanges !== void 0
|
|
20088
|
-
canOpen
|
|
19916
|
+
canAcknowledge: onAcknowledgeBreakingChanges !== void 0
|
|
20089
19917
|
});
|
|
20090
19918
|
return /* @__PURE__ */ jsxs4(Box4, { flexDirection: "column", gap: 1, paddingX: 2, paddingY: 1, children: [
|
|
20091
19919
|
/* @__PURE__ */ jsxs4(Text4, { bold: true, color: PALETTE.error, children: [
|
|
@@ -20094,7 +19922,6 @@ function ErrorStep({
|
|
|
20094
19922
|
" failed"
|
|
20095
19923
|
] }),
|
|
20096
19924
|
/* @__PURE__ */ jsx4(Text4, { color: PALETTE.error, children: message }),
|
|
20097
|
-
bundle && /* @__PURE__ */ jsx4(Text4, { color: PALETTE.muted, children: supportInstruction(bundle) }),
|
|
20098
19925
|
/* @__PURE__ */ jsx4(Box4, { marginTop: 1, gap: 3, children: controls.map((control) => /* @__PURE__ */ jsxs4(Text4, { color: PALETTE.muted, children: [
|
|
20099
19926
|
"[",
|
|
20100
19927
|
control.keys,
|
|
@@ -20107,10 +19934,8 @@ var init_error_step = __esm({
|
|
|
20107
19934
|
"packages/experience-design-system-cli/src/tui/import/shared/error-step/error-step.tsx"() {
|
|
20108
19935
|
"use strict";
|
|
20109
19936
|
init_theme();
|
|
20110
|
-
init_support_bundle();
|
|
20111
19937
|
init_controls2();
|
|
20112
19938
|
init_logic2();
|
|
20113
|
-
init_use_support_bundle();
|
|
20114
19939
|
}
|
|
20115
19940
|
});
|
|
20116
19941
|
|
|
@@ -20361,10 +20186,10 @@ var init_theme2 = __esm({
|
|
|
20361
20186
|
});
|
|
20362
20187
|
|
|
20363
20188
|
// packages/experience-design-system-cli/src/tui/import/shared/running-step/use-elapsed.ts
|
|
20364
|
-
import { useEffect as
|
|
20189
|
+
import { useEffect as useEffect3, useState as useState3 } from "react";
|
|
20365
20190
|
function useElapsed() {
|
|
20366
|
-
const [seconds2, setSeconds] =
|
|
20367
|
-
|
|
20191
|
+
const [seconds2, setSeconds] = useState3(0);
|
|
20192
|
+
useEffect3(() => {
|
|
20368
20193
|
const timer = setInterval(() => setSeconds((current) => current + 1), 1e3);
|
|
20369
20194
|
return () => clearInterval(timer);
|
|
20370
20195
|
}, []);
|
|
@@ -20447,13 +20272,13 @@ var init_shared2 = __esm({
|
|
|
20447
20272
|
});
|
|
20448
20273
|
|
|
20449
20274
|
// packages/experience-design-system-cli/src/tui/import/steps/00-preflight/screen.tsx
|
|
20450
|
-
import { useEffect as
|
|
20275
|
+
import { useEffect as useEffect4, useRef, useState as useState4 } from "react";
|
|
20451
20276
|
import { Box as Box9, Text as Text9 } from "ink";
|
|
20452
20277
|
import { jsx as jsx9, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
20453
20278
|
function PreflightScreen({ onChoose, onQuit }) {
|
|
20454
|
-
const [focus, setFocus] =
|
|
20279
|
+
const [focus, setFocus] = useState4(0);
|
|
20455
20280
|
const viewed = useRef([optionAt(0)]).current;
|
|
20456
|
-
|
|
20281
|
+
useEffect4(() => {
|
|
20457
20282
|
startDebugRun({
|
|
20458
20283
|
flow: "import/preflight",
|
|
20459
20284
|
step: "00-preflight",
|
|
@@ -20578,13 +20403,13 @@ var init_controls4 = __esm({
|
|
|
20578
20403
|
});
|
|
20579
20404
|
|
|
20580
20405
|
// packages/experience-design-system-cli/src/tui/import/steps/01-welcome/screen.tsx
|
|
20581
|
-
import { useEffect as
|
|
20406
|
+
import { useEffect as useEffect5, useRef as useRef3, useState as useState5 } from "react";
|
|
20582
20407
|
import { Box as Box10, Text as Text10 } from "ink";
|
|
20583
20408
|
import { jsx as jsx11, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
20584
20409
|
function WelcomeScreen({ mode, onContinue, onQuit, initialPath = "" }) {
|
|
20585
|
-
const [projectPath, setProjectPath] =
|
|
20410
|
+
const [projectPath, setProjectPath] = useState5(initialPath);
|
|
20586
20411
|
const visit = useRef3({ emptySubmits: 0 }).current;
|
|
20587
|
-
|
|
20412
|
+
useEffect5(() => {
|
|
20588
20413
|
startDebugRun({
|
|
20589
20414
|
flow: "import/welcome",
|
|
20590
20415
|
step: "01-welcome",
|
|
@@ -20733,7 +20558,7 @@ var init_validate_path = __esm({
|
|
|
20733
20558
|
});
|
|
20734
20559
|
|
|
20735
20560
|
// packages/experience-design-system-cli/src/tui/import/steps/02-token-input/screen.tsx
|
|
20736
|
-
import { useEffect as
|
|
20561
|
+
import { useEffect as useEffect6, useRef as useRef4, useState as useState6 } from "react";
|
|
20737
20562
|
import { Box as Box11, Text as Text11 } from "ink";
|
|
20738
20563
|
import { jsx as jsx12, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
20739
20564
|
function TokenInputScreen({
|
|
@@ -20742,10 +20567,10 @@ function TokenInputScreen({
|
|
|
20742
20567
|
onBack,
|
|
20743
20568
|
initialPath = ""
|
|
20744
20569
|
}) {
|
|
20745
|
-
const [tokenPath, setTokenPath] =
|
|
20746
|
-
const [failure, setFailure] =
|
|
20570
|
+
const [tokenPath, setTokenPath] = useState6(initialPath);
|
|
20571
|
+
const [failure, setFailure] = useState6(null);
|
|
20747
20572
|
const rejected = useRef4([]).current;
|
|
20748
|
-
|
|
20573
|
+
useEffect6(() => {
|
|
20749
20574
|
startDebugRun({
|
|
20750
20575
|
flow: "import/token-input",
|
|
20751
20576
|
step: "02-token-input",
|
|
@@ -20897,9 +20722,14 @@ function scanReport(scan, path5, { hasTokens = true } = {}) {
|
|
|
20897
20722
|
...scan.warnings.length > 0 ? { scan_warnings: scan.warnings } : {}
|
|
20898
20723
|
};
|
|
20899
20724
|
}
|
|
20900
|
-
function
|
|
20725
|
+
function hasImportableFiles(counts, { hasTokens = true } = {}) {
|
|
20726
|
+
const componentFiles = COMPONENT_CATEGORIES.reduce((sum, category) => sum + counts[category], 0);
|
|
20727
|
+
return componentFiles > 0 || hasTokens && counts.json > 0;
|
|
20728
|
+
}
|
|
20729
|
+
function phaseOf(scan, { hasTokens = true } = {}) {
|
|
20901
20730
|
if (scan === void 0) return "scanning";
|
|
20902
|
-
|
|
20731
|
+
if (!scan.ok) return "failed";
|
|
20732
|
+
return hasImportableFiles(scan.counts, { hasTokens }) ? "ready" : "empty";
|
|
20903
20733
|
}
|
|
20904
20734
|
function keyAction(phase, input, key) {
|
|
20905
20735
|
if (key.escape) return "back";
|
|
@@ -20907,7 +20737,7 @@ function keyAction(phase, input, key) {
|
|
|
20907
20737
|
if (key.return) return "confirm";
|
|
20908
20738
|
if (input === "e") return "change-path";
|
|
20909
20739
|
}
|
|
20910
|
-
if (phase === "failed" && (key.return || input === "e")) return "change-path";
|
|
20740
|
+
if ((phase === "failed" || phase === "empty") && (key.return || input === "e")) return "change-path";
|
|
20911
20741
|
return void 0;
|
|
20912
20742
|
}
|
|
20913
20743
|
var COMPONENT_CATEGORIES, ROW_LABELS, ROW_ORDER;
|
|
@@ -20954,6 +20784,10 @@ var init_controls6 = __esm({
|
|
|
20954
20784
|
{ keys: "e", label: "Change path" },
|
|
20955
20785
|
{ keys: "Esc", label: "Back" }
|
|
20956
20786
|
],
|
|
20787
|
+
empty: [
|
|
20788
|
+
{ keys: "Enter/e", label: "Try a different path" },
|
|
20789
|
+
{ keys: "Esc", label: "Back" }
|
|
20790
|
+
],
|
|
20957
20791
|
failed: [
|
|
20958
20792
|
{ keys: "Enter/e", label: "Try a different path" },
|
|
20959
20793
|
{ keys: "Esc", label: "Back" }
|
|
@@ -20987,7 +20821,7 @@ var init_scan_files = __esm({
|
|
|
20987
20821
|
});
|
|
20988
20822
|
|
|
20989
20823
|
// packages/experience-design-system-cli/src/tui/import/steps/03-path-validation/screen.tsx
|
|
20990
|
-
import { useEffect as
|
|
20824
|
+
import { useEffect as useEffect7, useMemo, useState as useState7 } from "react";
|
|
20991
20825
|
import { Box as Box12, Text as Text12 } from "ink";
|
|
20992
20826
|
import { jsx as jsx13, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
20993
20827
|
function Row({ row }) {
|
|
@@ -21011,7 +20845,8 @@ function Failure({ scan, path: path5 }) {
|
|
|
21011
20845
|
function Summary({
|
|
21012
20846
|
scan,
|
|
21013
20847
|
path: path5,
|
|
21014
|
-
hasTokens
|
|
20848
|
+
hasTokens,
|
|
20849
|
+
empty
|
|
21015
20850
|
}) {
|
|
21016
20851
|
const { total, rows, warning } = summarize(scan.counts, { hasTokens });
|
|
21017
20852
|
return /* @__PURE__ */ jsxs12(Box12, { flexDirection: "column", gap: 1, children: [
|
|
@@ -21020,7 +20855,11 @@ function Summary({
|
|
|
21020
20855
|
/* @__PURE__ */ jsx13(Text12, { bold: true, children: path5 })
|
|
21021
20856
|
] }),
|
|
21022
20857
|
/* @__PURE__ */ jsxs12(Box12, { flexDirection: "column", children: [
|
|
21023
|
-
/* @__PURE__ */ jsxs12(Text12, { color: PALETTE.
|
|
20858
|
+
empty ? /* @__PURE__ */ jsxs12(Text12, { color: PALETTE.muted, children: [
|
|
20859
|
+
"Found ",
|
|
20860
|
+
total,
|
|
20861
|
+
" files:"
|
|
20862
|
+
] }) : /* @__PURE__ */ jsxs12(Text12, { color: PALETTE.success, children: [
|
|
21024
20863
|
"\u2713 Found ",
|
|
21025
20864
|
total,
|
|
21026
20865
|
" files:"
|
|
@@ -21031,7 +20870,7 @@ function Summary({
|
|
|
21031
20870
|
"\u26A0 ",
|
|
21032
20871
|
warning
|
|
21033
20872
|
] }),
|
|
21034
|
-
/* @__PURE__ */ jsx13(Text12, { children: "Does this look right?" })
|
|
20873
|
+
!empty && /* @__PURE__ */ jsx13(Text12, { children: "Does this look right?" })
|
|
21035
20874
|
] });
|
|
21036
20875
|
}
|
|
21037
20876
|
function PathValidationScreen({
|
|
@@ -21043,8 +20882,8 @@ function PathValidationScreen({
|
|
|
21043
20882
|
hasTokens = true
|
|
21044
20883
|
}) {
|
|
21045
20884
|
const resolvedPath = useMemo(() => resolveUserPath(projectPath), [projectPath]);
|
|
21046
|
-
const [scan, setScan] =
|
|
21047
|
-
|
|
20885
|
+
const [scan, setScan] = useState7();
|
|
20886
|
+
useEffect7(() => {
|
|
21048
20887
|
startDebugRun({
|
|
21049
20888
|
flow: "import/path-validation",
|
|
21050
20889
|
step: "03-path-validation",
|
|
@@ -21052,10 +20891,10 @@ function PathValidationScreen({
|
|
|
21052
20891
|
inputs: { import_mode: mode, project_path: projectPath, resolved_path: resolvedPath }
|
|
21053
20892
|
});
|
|
21054
20893
|
}, []);
|
|
21055
|
-
|
|
20894
|
+
useEffect7(() => {
|
|
21056
20895
|
setScan(scanFiles(resolvedPath));
|
|
21057
20896
|
}, [resolvedPath]);
|
|
21058
|
-
const phase = phaseOf(scan);
|
|
20897
|
+
const phase = phaseOf(scan, { hasTokens });
|
|
21059
20898
|
const finish = (outcome, exitMethod) => {
|
|
21060
20899
|
void finishDebugRun({
|
|
21061
20900
|
outputs: { outcome, ...scanReport(scan, resolvedPath, { hasTokens }) },
|
|
@@ -21087,7 +20926,7 @@ function PathValidationScreen({
|
|
|
21087
20926
|
"..."
|
|
21088
20927
|
] }),
|
|
21089
20928
|
scan?.ok === false && /* @__PURE__ */ jsx13(Failure, { scan, path: resolvedPath }),
|
|
21090
|
-
scan?.ok === true && /* @__PURE__ */ jsx13(Summary, { scan, path: resolvedPath, hasTokens }),
|
|
20929
|
+
scan?.ok === true && /* @__PURE__ */ jsx13(Summary, { scan, path: resolvedPath, hasTokens, empty: phase === "empty" }),
|
|
21091
20930
|
/* @__PURE__ */ jsx13(Box12, { marginTop: 1, children: /* @__PURE__ */ jsx13(ControlHints, { hints: controlsFor(phase) }) })
|
|
21092
20931
|
] })
|
|
21093
20932
|
] });
|
|
@@ -21107,7 +20946,7 @@ var init_screen4 = __esm({
|
|
|
21107
20946
|
});
|
|
21108
20947
|
|
|
21109
20948
|
// packages/experience-design-system-cli/src/tui/shared/components/FieldForm.tsx
|
|
21110
|
-
import { useState as
|
|
20949
|
+
import { useState as useState8 } from "react";
|
|
21111
20950
|
import { Box as Box13, Text as Text13, useInput as useInput10 } from "ink";
|
|
21112
20951
|
import { Fragment, jsx as jsx14, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
21113
20952
|
function formLabelWidth(rows) {
|
|
@@ -21143,9 +20982,9 @@ function FieldForm({
|
|
|
21143
20982
|
busy = false,
|
|
21144
20983
|
children
|
|
21145
20984
|
}) {
|
|
21146
|
-
const [active, setActive] =
|
|
21147
|
-
const [editing, setEditing] =
|
|
21148
|
-
const [valueBeforeEdit, setValueBeforeEdit] =
|
|
20985
|
+
const [active, setActive] = useState8(0);
|
|
20986
|
+
const [editing, setEditing] = useState8(false);
|
|
20987
|
+
const [valueBeforeEdit, setValueBeforeEdit] = useState8("");
|
|
21149
20988
|
const rowCount = fields2.length + actions.length;
|
|
21150
20989
|
const labelWidth = formLabelWidth([...fields2, ...actions]);
|
|
21151
20990
|
const currentField = active < fields2.length ? fields2[active] : void 0;
|
|
@@ -21429,7 +21268,7 @@ var init_validate4 = __esm({
|
|
|
21429
21268
|
});
|
|
21430
21269
|
|
|
21431
21270
|
// packages/experience-design-system-cli/src/tui/import/steps/04-credentials/screen.tsx
|
|
21432
|
-
import { useEffect as
|
|
21271
|
+
import { useEffect as useEffect8, useRef as useRef5, useState as useState9 } from "react";
|
|
21433
21272
|
import { Box as Box14, Text as Text14, useInput as useInput11 } from "ink";
|
|
21434
21273
|
import { Fragment as Fragment2, jsx as jsx15, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
21435
21274
|
function CredentialsScreen({
|
|
@@ -21448,16 +21287,16 @@ function CredentialsScreen({
|
|
|
21448
21287
|
host: initial.host ?? ""
|
|
21449
21288
|
})
|
|
21450
21289
|
).current;
|
|
21451
|
-
const [values, setValues] =
|
|
21452
|
-
const [notice, setNotice] =
|
|
21453
|
-
const [validating, setValidating] =
|
|
21290
|
+
const [values, setValues] = useState9(initialValues);
|
|
21291
|
+
const [notice, setNotice] = useState9(null);
|
|
21292
|
+
const [validating, setValidating] = useState9(false);
|
|
21454
21293
|
const prefilled = initialValues.spaceId !== "" && initialValues.cmaToken !== "";
|
|
21455
|
-
const [editing, setEditing] =
|
|
21456
|
-
const [focus, setFocus] =
|
|
21457
|
-
const [active, setActive] =
|
|
21458
|
-
const [beforeEdit, setBeforeEdit] =
|
|
21294
|
+
const [editing, setEditing] = useState9(!prefilled);
|
|
21295
|
+
const [focus, setFocus] = useState9(0);
|
|
21296
|
+
const [active, setActive] = useState9(0);
|
|
21297
|
+
const [beforeEdit, setBeforeEdit] = useState9(initialValues);
|
|
21459
21298
|
const visit = useRef5({ attempts: [], lastReason: "" }).current;
|
|
21460
|
-
|
|
21299
|
+
useEffect8(() => {
|
|
21461
21300
|
startDebugRun({
|
|
21462
21301
|
flow: "import/credentials",
|
|
21463
21302
|
step: "04-credentials",
|
|
@@ -21882,15 +21721,15 @@ var init_load = __esm({
|
|
|
21882
21721
|
});
|
|
21883
21722
|
|
|
21884
21723
|
// packages/experience-design-system-cli/src/tui/import/steps/05-token-review/screen.tsx
|
|
21885
|
-
import { useEffect as
|
|
21724
|
+
import { useEffect as useEffect9, useMemo as useMemo2, useState as useState10 } from "react";
|
|
21886
21725
|
import { Box as Box15, Text as Text15, useInput as useInput12 } from "ink";
|
|
21887
21726
|
import { jsx as jsx17, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
21888
21727
|
function TokenReviewScreen({ tokensPath, onContinue, onQuit }) {
|
|
21889
21728
|
const loaded = useMemo2(() => loadTokenRows(tokensPath), [tokensPath]);
|
|
21890
21729
|
const rows = loaded.ok ? loaded.rows : [];
|
|
21891
21730
|
const columns = useTerminalWidth();
|
|
21892
|
-
const [selected, setSelected] =
|
|
21893
|
-
|
|
21731
|
+
const [selected, setSelected] = useState10(0);
|
|
21732
|
+
useEffect9(() => {
|
|
21894
21733
|
startDebugRun({
|
|
21895
21734
|
flow: "import/token-review",
|
|
21896
21735
|
step: "05-token-review",
|
|
@@ -22005,13 +21844,13 @@ var init_steps = __esm({
|
|
|
22005
21844
|
|
|
22006
21845
|
// packages/experience-design-system-cli/src/tui/import/steps/06-extraction/find-skill-path.ts
|
|
22007
21846
|
import { existsSync as existsSync11 } from "node:fs";
|
|
22008
|
-
import { dirname as
|
|
21847
|
+
import { dirname as dirname16, join as join20, resolve as resolve22 } from "node:path";
|
|
22009
21848
|
import { fileURLToPath as fileURLToPath4 } from "node:url";
|
|
22010
21849
|
function findSkillPath(fileName) {
|
|
22011
|
-
const thisDir =
|
|
21850
|
+
const thisDir = dirname16(fileURLToPath4(import.meta.url));
|
|
22012
21851
|
let dir = thisDir;
|
|
22013
21852
|
for (; ; ) {
|
|
22014
|
-
const candidate =
|
|
21853
|
+
const candidate = join20(dir, "skills", fileName);
|
|
22015
21854
|
if (existsSync11(candidate)) return candidate;
|
|
22016
21855
|
const parent = resolve22(dir, "..");
|
|
22017
21856
|
if (parent === dir) {
|
|
@@ -22124,9 +21963,9 @@ var init_selection2 = __esm({
|
|
|
22124
21963
|
|
|
22125
21964
|
// packages/experience-design-system-cli/src/tui/import/steps/06-extraction/run.ts
|
|
22126
21965
|
import { mkdir as mkdir8 } from "node:fs/promises";
|
|
22127
|
-
import { join as
|
|
21966
|
+
import { join as join21, resolve as resolve24 } from "node:path";
|
|
22128
21967
|
async function runExtraction(input, onProgress, deps = realDeps) {
|
|
22129
|
-
const outDir = input.outDir ??
|
|
21968
|
+
const outDir = input.outDir ?? join21(resolve24(input.projectPath), ".contentful");
|
|
22130
21969
|
let progress = initialProgress({
|
|
22131
21970
|
hasCredentials: input.credentials !== null,
|
|
22132
21971
|
hasRawTokens: input.rawTokensPath !== ""
|
|
@@ -22276,11 +22115,11 @@ var init_run = __esm({
|
|
|
22276
22115
|
});
|
|
22277
22116
|
|
|
22278
22117
|
// packages/experience-design-system-cli/src/tui/import/steps/06-extraction/use-extraction.ts
|
|
22279
|
-
import { useEffect as
|
|
22118
|
+
import { useEffect as useEffect10, useRef as useRef6, useState as useState11 } from "react";
|
|
22280
22119
|
function useExtraction(input) {
|
|
22281
|
-
const [state2, setState] =
|
|
22120
|
+
const [state2, setState] = useState11();
|
|
22282
22121
|
const current = useRef6();
|
|
22283
|
-
|
|
22122
|
+
useEffect10(() => {
|
|
22284
22123
|
current.current = input;
|
|
22285
22124
|
if (!input) {
|
|
22286
22125
|
setState(void 0);
|
|
@@ -22370,11 +22209,11 @@ var init_run_tokens_only = __esm({
|
|
|
22370
22209
|
});
|
|
22371
22210
|
|
|
22372
22211
|
// packages/experience-design-system-cli/src/tui/import/steps/06-extraction/use-tokens-only.ts
|
|
22373
|
-
import { useEffect as
|
|
22212
|
+
import { useEffect as useEffect11, useRef as useRef7, useState as useState12 } from "react";
|
|
22374
22213
|
function useTokensOnly(input) {
|
|
22375
|
-
const [state2, setState] =
|
|
22214
|
+
const [state2, setState] = useState12();
|
|
22376
22215
|
const current = useRef7();
|
|
22377
|
-
|
|
22216
|
+
useEffect11(() => {
|
|
22378
22217
|
current.current = input;
|
|
22379
22218
|
if (!input) {
|
|
22380
22219
|
setState(void 0);
|
|
@@ -22628,32 +22467,32 @@ function CounterStrip(props) {
|
|
|
22628
22467
|
const labelAcc = condensed ? "Acc" : "Accepted";
|
|
22629
22468
|
const labelRej = condensed ? "Rej" : "Rejected";
|
|
22630
22469
|
const labelUnd = condensed ? "Und" : "Undecided";
|
|
22631
|
-
const
|
|
22470
|
+
const sep = condensed ? " | " : " ";
|
|
22632
22471
|
return /* @__PURE__ */ jsx23(Box20, { children: /* @__PURE__ */ jsxs20(Text20, { children: [
|
|
22633
22472
|
/* @__PURE__ */ jsxs20(Text20, { color: PALETTE.muted, children: [
|
|
22634
22473
|
labelGrp,
|
|
22635
22474
|
" "
|
|
22636
22475
|
] }),
|
|
22637
22476
|
/* @__PURE__ */ jsx23(Text20, { bold: true, children: counters.groups }),
|
|
22638
|
-
/* @__PURE__ */ jsx23(Text20, { color: PALETTE.muted, children:
|
|
22477
|
+
/* @__PURE__ */ jsx23(Text20, { color: PALETTE.muted, children: sep }),
|
|
22639
22478
|
/* @__PURE__ */ jsxs20(Text20, { color: PALETTE.muted, children: [
|
|
22640
22479
|
labelAcc,
|
|
22641
22480
|
" "
|
|
22642
22481
|
] }),
|
|
22643
22482
|
/* @__PURE__ */ jsx23(Text20, { bold: true, children: `${counters.accepted}/${counters.total}` }),
|
|
22644
|
-
/* @__PURE__ */ jsx23(Text20, { color: PALETTE.muted, children:
|
|
22483
|
+
/* @__PURE__ */ jsx23(Text20, { color: PALETTE.muted, children: sep }),
|
|
22645
22484
|
/* @__PURE__ */ jsxs20(Text20, { color: PALETTE.muted, children: [
|
|
22646
22485
|
labelRej,
|
|
22647
22486
|
" "
|
|
22648
22487
|
] }),
|
|
22649
22488
|
/* @__PURE__ */ jsx23(Text20, { bold: true, children: counters.rejected }),
|
|
22650
|
-
/* @__PURE__ */ jsx23(Text20, { color: PALETTE.muted, children:
|
|
22489
|
+
/* @__PURE__ */ jsx23(Text20, { color: PALETTE.muted, children: sep }),
|
|
22651
22490
|
/* @__PURE__ */ jsxs20(Text20, { color: PALETTE.muted, children: [
|
|
22652
22491
|
labelUnd,
|
|
22653
22492
|
" "
|
|
22654
22493
|
] }),
|
|
22655
22494
|
/* @__PURE__ */ jsx23(Text20, { bold: true, children: counters.undecided }),
|
|
22656
|
-
/* @__PURE__ */ jsx23(Text20, { color: PALETTE.muted, children:
|
|
22495
|
+
/* @__PURE__ */ jsx23(Text20, { color: PALETTE.muted, children: sep })
|
|
22657
22496
|
] }) });
|
|
22658
22497
|
}
|
|
22659
22498
|
var init_CounterStrip = __esm({
|
|
@@ -23684,7 +23523,7 @@ var init_useImmediateInput = __esm({
|
|
|
23684
23523
|
|
|
23685
23524
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/sidebar/hooks/use-terminal-size.ts
|
|
23686
23525
|
import { useStdout as useStdout2 } from "ink";
|
|
23687
|
-
import { useEffect as
|
|
23526
|
+
import { useEffect as useEffect12, useState as useState13 } from "react";
|
|
23688
23527
|
function readTerminalSize(stdout) {
|
|
23689
23528
|
return {
|
|
23690
23529
|
columns: stdout?.columns ?? 80,
|
|
@@ -23693,8 +23532,8 @@ function readTerminalSize(stdout) {
|
|
|
23693
23532
|
}
|
|
23694
23533
|
function useTerminalSize() {
|
|
23695
23534
|
const { stdout } = useStdout2();
|
|
23696
|
-
const [size, setSize] =
|
|
23697
|
-
|
|
23535
|
+
const [size, setSize] = useState13(() => readTerminalSize(stdout));
|
|
23536
|
+
useEffect12(() => {
|
|
23698
23537
|
const updateSize = () => setSize(readTerminalSize(stdout));
|
|
23699
23538
|
stdout?.on("resize", updateSize);
|
|
23700
23539
|
updateSize();
|
|
@@ -24421,15 +24260,15 @@ var init_group_collapse = __esm({
|
|
|
24421
24260
|
});
|
|
24422
24261
|
|
|
24423
24262
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/sidebar/hooks/sidebar-search-state.ts
|
|
24424
|
-
import { useState as
|
|
24263
|
+
import { useState as useState14 } from "react";
|
|
24425
24264
|
function useSidebarSearchState() {
|
|
24426
|
-
const [searchOpen, setSearchOpen] =
|
|
24427
|
-
const [searchQuery, setSearchQuery] =
|
|
24428
|
-
const [autocompleteCandidates, setAutocompleteCandidates] =
|
|
24429
|
-
const [jumpFilterTarget, setJumpFilterTarget] =
|
|
24430
|
-
const [columnOneView, setColumnOneView] =
|
|
24431
|
-
const [activeFilters, setActiveFilters] =
|
|
24432
|
-
const [showHelp, setShowHelp] =
|
|
24265
|
+
const [searchOpen, setSearchOpen] = useState14(false);
|
|
24266
|
+
const [searchQuery, setSearchQuery] = useState14("");
|
|
24267
|
+
const [autocompleteCandidates, setAutocompleteCandidates] = useState14([]);
|
|
24268
|
+
const [jumpFilterTarget, setJumpFilterTarget] = useState14(null);
|
|
24269
|
+
const [columnOneView, setColumnOneView] = useState14("grouped");
|
|
24270
|
+
const [activeFilters, setActiveFilters] = useState14(/* @__PURE__ */ new Set());
|
|
24271
|
+
const [showHelp, setShowHelp] = useState14(false);
|
|
24433
24272
|
return {
|
|
24434
24273
|
searchOpen,
|
|
24435
24274
|
setSearchOpen,
|
|
@@ -24454,10 +24293,10 @@ var init_sidebar_search_state = __esm({
|
|
|
24454
24293
|
});
|
|
24455
24294
|
|
|
24456
24295
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/sidebar/hooks/useOverlayPanel.ts
|
|
24457
|
-
import { useCallback, useState as
|
|
24296
|
+
import { useCallback, useState as useState15 } from "react";
|
|
24458
24297
|
function useOverlayPanel(opts) {
|
|
24459
24298
|
const { toggleKey, onClose } = opts;
|
|
24460
|
-
const [isOpen, setIsOpen] =
|
|
24299
|
+
const [isOpen, setIsOpen] = useState15(false);
|
|
24461
24300
|
const open = useCallback(() => {
|
|
24462
24301
|
setIsOpen(true);
|
|
24463
24302
|
}, []);
|
|
@@ -24696,23 +24535,23 @@ var init_state = __esm({
|
|
|
24696
24535
|
});
|
|
24697
24536
|
|
|
24698
24537
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/use-scope-gate.ts
|
|
24699
|
-
import { useEffect as
|
|
24538
|
+
import { useEffect as useEffect13, useMemo as useMemo3, useRef as useRef9, useState as useState16 } from "react";
|
|
24700
24539
|
function useScopeGate({ components, tokenCount, tokensWidth, onConfirm, onQuit }) {
|
|
24701
24540
|
const { columns: totalWidth, rows: terminalRows } = useTerminalSize();
|
|
24702
24541
|
const columnPlan = useMemo3(
|
|
24703
24542
|
() => computeColumnWidths(totalWidth, tokenCount > 0, tokensWidth),
|
|
24704
24543
|
[totalWidth, tokenCount, tokensWidth]
|
|
24705
24544
|
);
|
|
24706
|
-
const [decisions, setDecisions] =
|
|
24707
|
-
const [nav, setNav] =
|
|
24708
|
-
const [focusedColumn, setFocusedColumn] =
|
|
24709
|
-
const [tokensCursor, setTokensCursor] =
|
|
24710
|
-
const [showDependencies, setShowDependencies] =
|
|
24711
|
-
const [cyclesPanelOpen, setCyclesPanelOpen] =
|
|
24712
|
-
const [cyclesCursor, setCyclesCursor] =
|
|
24545
|
+
const [decisions, setDecisions] = useState16(/* @__PURE__ */ new Map());
|
|
24546
|
+
const [nav, setNav] = useState16({ cursor: 0, scrollOffset: 0 });
|
|
24547
|
+
const [focusedColumn, setFocusedColumn] = useState16("main");
|
|
24548
|
+
const [tokensCursor, setTokensCursor] = useState16(0);
|
|
24549
|
+
const [showDependencies, setShowDependencies] = useState16(false);
|
|
24550
|
+
const [cyclesPanelOpen, setCyclesPanelOpen] = useState16(false);
|
|
24551
|
+
const [cyclesCursor, setCyclesCursor] = useState16(0);
|
|
24713
24552
|
const aiRationalePanel = useOverlayPanel({ toggleKey: "x" });
|
|
24714
|
-
const [aiCursor, setAiCursor] =
|
|
24715
|
-
const [pendingRejectCascade, setPendingRejectCascade] =
|
|
24553
|
+
const [aiCursor, setAiCursor] = useState16(0);
|
|
24554
|
+
const [pendingRejectCascade, setPendingRejectCascade] = useState16(null);
|
|
24716
24555
|
const search = useSidebarSearchState();
|
|
24717
24556
|
const {
|
|
24718
24557
|
searchOpen,
|
|
@@ -24737,13 +24576,13 @@ function useScopeGate({ components, tokenCount, tokensWidth, onConfirm, onQuit }
|
|
|
24737
24576
|
() => slotCycles.map((c2, i) => ({ cycleIndex: i, jumpTarget: c2.path[0] })),
|
|
24738
24577
|
[slotCycles]
|
|
24739
24578
|
);
|
|
24740
|
-
const [expandedGroups, setExpandedGroups] =
|
|
24579
|
+
const [expandedGroups, setExpandedGroups] = useState16(() => {
|
|
24741
24580
|
const seed = new Set(closures.keys());
|
|
24742
24581
|
for (const p of cycleParticipants) seed.add(p);
|
|
24743
24582
|
return seed;
|
|
24744
24583
|
});
|
|
24745
24584
|
const seededGroupsRef = useRef9(closures.size > 0 || cycleParticipants.size > 0);
|
|
24746
|
-
|
|
24585
|
+
useEffect13(() => {
|
|
24747
24586
|
if (seededGroupsRef.current) return;
|
|
24748
24587
|
if (closures.size === 0 && cycleParticipants.size === 0) return;
|
|
24749
24588
|
seededGroupsRef.current = true;
|
|
@@ -24834,7 +24673,7 @@ function useScopeGate({ components, tokenCount, tokensWidth, onConfirm, onQuit }
|
|
|
24834
24673
|
entryCount: 0
|
|
24835
24674
|
});
|
|
24836
24675
|
const panelLayout = useMemo3(() => computePanelLayout(visibleCount), [visibleCount]);
|
|
24837
|
-
|
|
24676
|
+
useEffect13(() => {
|
|
24838
24677
|
setNav((prev) => {
|
|
24839
24678
|
const maxIdx = Math.max(0, visibleRows.length - 1);
|
|
24840
24679
|
const nextCursor = Math.min(prev.cursor, maxIdx);
|
|
@@ -25179,7 +25018,7 @@ var init_use_scope_gate = __esm({
|
|
|
25179
25018
|
});
|
|
25180
25019
|
|
|
25181
25020
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/screen.tsx
|
|
25182
|
-
import { useEffect as
|
|
25021
|
+
import { useEffect as useEffect14, useMemo as useMemo4 } from "react";
|
|
25183
25022
|
import { Box as Box25, Text as Text26 } from "ink";
|
|
25184
25023
|
import { Fragment as Fragment5, jsx as jsx29, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
25185
25024
|
function ScopeGateScreen({
|
|
@@ -25193,7 +25032,7 @@ function ScopeGateScreen({
|
|
|
25193
25032
|
return loaded?.ok ? loaded.rows : [];
|
|
25194
25033
|
}, [tokensPath]);
|
|
25195
25034
|
const longest = useMemo4(() => longestEntries(tokens), [tokens]);
|
|
25196
|
-
|
|
25035
|
+
useEffect14(() => {
|
|
25197
25036
|
startDebugRun({
|
|
25198
25037
|
flow: "import/scope-gate",
|
|
25199
25038
|
step: "07-scope-gate",
|
|
@@ -25426,13 +25265,13 @@ var init_load2 = __esm({
|
|
|
25426
25265
|
});
|
|
25427
25266
|
|
|
25428
25267
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/use-scope-gate-flow.ts
|
|
25429
|
-
import { useEffect as
|
|
25268
|
+
import { useEffect as useEffect15, useMemo as useMemo5, useRef as useRef10, useState as useState17 } from "react";
|
|
25430
25269
|
function useScopeGateFlow(input, deps = realDeps3) {
|
|
25431
25270
|
const sessionId = input?.sessionId;
|
|
25432
25271
|
const loaded = useMemo5(() => sessionId ? deps.load(sessionId) : void 0, [sessionId]);
|
|
25433
25272
|
const cacheCheck = useRef10(void 0);
|
|
25434
|
-
const [confirmed, setConfirmed] =
|
|
25435
|
-
|
|
25273
|
+
const [confirmed, setConfirmed] = useState17();
|
|
25274
|
+
useEffect15(() => {
|
|
25436
25275
|
if (!sessionId || !loaded || loaded.ok) return;
|
|
25437
25276
|
startDebugRun({
|
|
25438
25277
|
flow: "import/scope-gate",
|
|
@@ -25446,7 +25285,7 @@ function useScopeGateFlow(input, deps = realDeps3) {
|
|
|
25446
25285
|
exitMethod: "discarded"
|
|
25447
25286
|
});
|
|
25448
25287
|
}, [sessionId, loaded]);
|
|
25449
|
-
|
|
25288
|
+
useEffect15(() => {
|
|
25450
25289
|
if (!input || !loaded?.ok || cacheCheck.current) return;
|
|
25451
25290
|
cacheCheck.current = deps.checkCache(input.cache);
|
|
25452
25291
|
}, [input, loaded]);
|
|
@@ -25772,11 +25611,11 @@ var init_run2 = __esm({
|
|
|
25772
25611
|
});
|
|
25773
25612
|
|
|
25774
25613
|
// packages/experience-design-system-cli/src/tui/import/steps/08-generation/use-generation.ts
|
|
25775
|
-
import { useEffect as
|
|
25614
|
+
import { useEffect as useEffect16, useRef as useRef11, useState as useState18 } from "react";
|
|
25776
25615
|
function useGeneration(input) {
|
|
25777
|
-
const [state2, setState] =
|
|
25616
|
+
const [state2, setState] = useState18();
|
|
25778
25617
|
const current = useRef11();
|
|
25779
|
-
|
|
25618
|
+
useEffect16(() => {
|
|
25780
25619
|
current.current = input;
|
|
25781
25620
|
if (!input) {
|
|
25782
25621
|
setState(void 0);
|
|
@@ -25821,7 +25660,7 @@ var init_use_generation = __esm({
|
|
|
25821
25660
|
});
|
|
25822
25661
|
|
|
25823
25662
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/flow/build-flow-start.ts
|
|
25824
|
-
import { join as
|
|
25663
|
+
import { join as join22 } from "node:path";
|
|
25825
25664
|
function buildFlowStart(input) {
|
|
25826
25665
|
const { extraction, handoff, saved, generatePromptPath, tokensOnly } = input;
|
|
25827
25666
|
const credentials = extraction.credentials ?? {
|
|
@@ -25834,7 +25673,7 @@ function buildFlowStart(input) {
|
|
|
25834
25673
|
handoff,
|
|
25835
25674
|
agent: extraction.agent,
|
|
25836
25675
|
projectPath: extraction.projectPath,
|
|
25837
|
-
outDir: extraction.projectPath ?
|
|
25676
|
+
outDir: extraction.projectPath ? join22(extraction.projectPath, ".contentful") : "",
|
|
25838
25677
|
rawTokensPath: extraction.rawTokensPath,
|
|
25839
25678
|
credentials: {
|
|
25840
25679
|
spaceId: credentials.spaceId,
|
|
@@ -26866,7 +26705,7 @@ var init_scroll_offset = __esm({
|
|
|
26866
26705
|
});
|
|
26867
26706
|
|
|
26868
26707
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/components/FieldEditor.tsx
|
|
26869
|
-
import React13, { useEffect as
|
|
26708
|
+
import React13, { useEffect as useEffect17, useLayoutEffect as useLayoutEffect2, useState as useState19 } from "react";
|
|
26870
26709
|
import figures6 from "figures";
|
|
26871
26710
|
import { Box as Box26, measureElement, Text as Text27 } from "ink";
|
|
26872
26711
|
import { Fragment as Fragment6, jsx as jsx32, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
@@ -27543,11 +27382,11 @@ function FieldEditor({
|
|
|
27543
27382
|
headerHeight = 2
|
|
27544
27383
|
}) {
|
|
27545
27384
|
const { state: initialState, error: parseError } = parseToState(value);
|
|
27546
|
-
const [editorState, setEditorState] =
|
|
27547
|
-
const [parseErr] =
|
|
27548
|
-
const [listScrollStart, setListScrollStart] =
|
|
27385
|
+
const [editorState, setEditorState] = useState19(initialState);
|
|
27386
|
+
const [parseErr] = useState19(parseError);
|
|
27387
|
+
const [listScrollStart, setListScrollStart] = useState19(0);
|
|
27549
27388
|
const initialFocusScrollApplied = React13.useRef(false);
|
|
27550
|
-
const [rowHeights, setRowHeights] =
|
|
27389
|
+
const [rowHeights, setRowHeights] = useState19({});
|
|
27551
27390
|
const rowMeasureRefs = React13.useRef(/* @__PURE__ */ new Map());
|
|
27552
27391
|
const initialFocus = (() => {
|
|
27553
27392
|
if (initialFocusTarget?.kind === "description") {
|
|
@@ -27615,25 +27454,25 @@ function FieldEditor({
|
|
|
27615
27454
|
textCursor: 0
|
|
27616
27455
|
};
|
|
27617
27456
|
})();
|
|
27618
|
-
const [focusLevel, setFocusLevel] =
|
|
27619
|
-
const [propIdx, setPropIdx] =
|
|
27620
|
-
const [slotIdx, setSlotIdx] =
|
|
27621
|
-
const [inSlots, setInSlots] =
|
|
27622
|
-
const [inComponentDesc, setInComponentDesc] =
|
|
27623
|
-
const [activeField, setActiveField] =
|
|
27624
|
-
const [editingField, setEditingField] =
|
|
27625
|
-
const [textCursor, setTextCursor] =
|
|
27626
|
-
const [valueCursor, setValueCursor] =
|
|
27627
|
-
const [editingValue, setEditingValue] =
|
|
27628
|
-
const [valueText, setValueText] =
|
|
27629
|
-
const [pickerCursor, setPickerCursor] =
|
|
27630
|
-
const [validationError, setValidationError] =
|
|
27631
|
-
const [cursorVisible] =
|
|
27632
|
-
const [sourceOpen, setSourceOpen] =
|
|
27633
|
-
const [rationaleOpen, setRationaleOpen] =
|
|
27634
|
-
const [rationaleScrollOffset, setRationaleScrollOffset] =
|
|
27635
|
-
const [showHelp, setShowHelp] =
|
|
27636
|
-
const [pendingDelete, setPendingDelete] =
|
|
27457
|
+
const [focusLevel, setFocusLevel] = useState19(initialFocus.focusLevel);
|
|
27458
|
+
const [propIdx, setPropIdx] = useState19(initialFocus.propIdx);
|
|
27459
|
+
const [slotIdx, setSlotIdx] = useState19(initialFocus.slotIdx);
|
|
27460
|
+
const [inSlots, setInSlots] = useState19(initialFocus.inSlots);
|
|
27461
|
+
const [inComponentDesc, setInComponentDesc] = useState19(initialFocus.focusLevel === "componentDescription");
|
|
27462
|
+
const [activeField, setActiveField] = useState19(initialFocus.activeField);
|
|
27463
|
+
const [editingField, setEditingField] = useState19(false);
|
|
27464
|
+
const [textCursor, setTextCursor] = useState19(initialFocus.textCursor);
|
|
27465
|
+
const [valueCursor, setValueCursor] = useState19(0);
|
|
27466
|
+
const [editingValue, setEditingValue] = useState19(null);
|
|
27467
|
+
const [valueText, setValueText] = useState19("");
|
|
27468
|
+
const [pickerCursor, setPickerCursor] = useState19(0);
|
|
27469
|
+
const [validationError, setValidationError] = useState19(null);
|
|
27470
|
+
const [cursorVisible] = useState19(true);
|
|
27471
|
+
const [sourceOpen, setSourceOpen] = useState19(false);
|
|
27472
|
+
const [rationaleOpen, setRationaleOpen] = useState19(false);
|
|
27473
|
+
const [rationaleScrollOffset, setRationaleScrollOffset] = useState19(0);
|
|
27474
|
+
const [showHelp, setShowHelp] = useState19(false);
|
|
27475
|
+
const [pendingDelete, setPendingDelete] = useState19(null);
|
|
27637
27476
|
const props = editorState.props;
|
|
27638
27477
|
const slots = editorState.slots;
|
|
27639
27478
|
const contentPropIndexes = React13.useMemo(
|
|
@@ -28393,7 +28232,7 @@ function FieldEditor({
|
|
|
28393
28232
|
}
|
|
28394
28233
|
return Math.max(start + 1, end2);
|
|
28395
28234
|
};
|
|
28396
|
-
|
|
28235
|
+
useEffect17(() => {
|
|
28397
28236
|
if (focusLevel === "field" || selectedRowIdx < 0) return;
|
|
28398
28237
|
setListScrollStart((previous) => {
|
|
28399
28238
|
if (initialFocusTarget && !initialFocusScrollApplied.current) {
|
|
@@ -29788,7 +29627,7 @@ var init_FinalizeDialog = __esm({
|
|
|
29788
29627
|
});
|
|
29789
29628
|
|
|
29790
29629
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/use-finalize-preview.ts
|
|
29791
|
-
import { useEffect as
|
|
29630
|
+
import { useEffect as useEffect18, useRef as useRef12, useState as useState20 } from "react";
|
|
29792
29631
|
function useReviewFinalizePreview({
|
|
29793
29632
|
components,
|
|
29794
29633
|
...options
|
|
@@ -29800,12 +29639,12 @@ function useReviewFinalizePreview({
|
|
|
29800
29639
|
}
|
|
29801
29640
|
function useFinalizePreview(opts) {
|
|
29802
29641
|
const { open, extractSessionId, tokensPath, spaceId, environmentId, cmaToken, host, acceptedKeys } = opts;
|
|
29803
|
-
const [status, setStatus] =
|
|
29804
|
-
const [removed, setRemoved] =
|
|
29805
|
-
const [scrollOffset, setScrollOffset] =
|
|
29642
|
+
const [status, setStatus] = useState20("idle");
|
|
29643
|
+
const [removed, setRemoved] = useState20([]);
|
|
29644
|
+
const [scrollOffset, setScrollOffset] = useState20(0);
|
|
29806
29645
|
const generationRef = useRef12(0);
|
|
29807
29646
|
const acceptedKey = [...acceptedKeys].sort().join("\0");
|
|
29808
|
-
|
|
29647
|
+
useEffect18(() => {
|
|
29809
29648
|
if (!open) {
|
|
29810
29649
|
setStatus("idle");
|
|
29811
29650
|
setRemoved([]);
|
|
@@ -29857,16 +29696,16 @@ var init_use_finalize_preview = __esm({
|
|
|
29857
29696
|
});
|
|
29858
29697
|
|
|
29859
29698
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/use-review-session.ts
|
|
29860
|
-
import { useCallback as useCallback2, useEffect as
|
|
29699
|
+
import { useCallback as useCallback2, useEffect as useEffect19, useRef as useRef13, useState as useState21 } from "react";
|
|
29861
29700
|
function useReviewSession({
|
|
29862
29701
|
loadSession,
|
|
29863
29702
|
tokensPath,
|
|
29864
29703
|
onExtraLoaded
|
|
29865
29704
|
}) {
|
|
29866
|
-
const [components, setComponents] =
|
|
29867
|
-
const [loading, setLoading] =
|
|
29868
|
-
const [loadError, setLoadError] =
|
|
29869
|
-
const [availableTokens, setAvailableTokens] =
|
|
29705
|
+
const [components, setComponents] = useState21([]);
|
|
29706
|
+
const [loading, setLoading] = useState21(true);
|
|
29707
|
+
const [loadError, setLoadError] = useState21(null);
|
|
29708
|
+
const [availableTokens, setAvailableTokens] = useState21([]);
|
|
29870
29709
|
const loadInitialState = useCallback2(async () => {
|
|
29871
29710
|
const result = loadSession();
|
|
29872
29711
|
if (result.error || !tokensPath) return { result, catalog: result.tokens };
|
|
@@ -29876,7 +29715,7 @@ function useReviewSession({
|
|
|
29876
29715
|
}));
|
|
29877
29716
|
return { result, catalog };
|
|
29878
29717
|
}, [loadSession, tokensPath]);
|
|
29879
|
-
|
|
29718
|
+
useEffect19(() => {
|
|
29880
29719
|
let disposed = false;
|
|
29881
29720
|
void (async () => {
|
|
29882
29721
|
try {
|
|
@@ -29927,9 +29766,9 @@ function useReviewSession({
|
|
|
29927
29766
|
};
|
|
29928
29767
|
}
|
|
29929
29768
|
function useReviewMetadata({ components, selectedIdx, extractSessionId }) {
|
|
29930
|
-
const [reviewMetadata, setReviewMetadata] =
|
|
29931
|
-
const [componentRationale, setComponentRationale] =
|
|
29932
|
-
|
|
29769
|
+
const [reviewMetadata, setReviewMetadata] = useState21(null);
|
|
29770
|
+
const [componentRationale, setComponentRationale] = useState21(null);
|
|
29771
|
+
useEffect19(() => {
|
|
29933
29772
|
const current = components[selectedIdx];
|
|
29934
29773
|
if (!current) {
|
|
29935
29774
|
setReviewMetadata(null);
|
|
@@ -29967,7 +29806,7 @@ function useReviewHistory({
|
|
|
29967
29806
|
}) {
|
|
29968
29807
|
const historyRef = useRef13(null);
|
|
29969
29808
|
const historySeededRef = useRef13(false);
|
|
29970
|
-
|
|
29809
|
+
useEffect19(() => {
|
|
29971
29810
|
if (loading || historySeededRef.current) return;
|
|
29972
29811
|
historySeededRef.current = true;
|
|
29973
29812
|
historyRef.current = createHistoryStack(createSnapshot(components));
|
|
@@ -30054,7 +29893,7 @@ var init_token_suggestions = __esm({
|
|
|
30054
29893
|
});
|
|
30055
29894
|
|
|
30056
29895
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/use-review-editor.ts
|
|
30057
|
-
import { useEffect as
|
|
29896
|
+
import { useEffect as useEffect20, useRef as useRef14, useState as useState22 } from "react";
|
|
30058
29897
|
function parseReviewEntry(draftValue) {
|
|
30059
29898
|
const parsed = JSON.parse(draftValue);
|
|
30060
29899
|
const keys = Object.keys(parsed);
|
|
@@ -30074,21 +29913,21 @@ function useReviewEditor({
|
|
|
30074
29913
|
onEditSaved,
|
|
30075
29914
|
onTokenSaved
|
|
30076
29915
|
}) {
|
|
30077
|
-
const [panelOpen, setPanelOpen] =
|
|
30078
|
-
const [panelScrollOffset, setPanelScrollOffset] =
|
|
30079
|
-
const [jsonScrollOffset, setJsonScrollOffset] =
|
|
30080
|
-
const [textEntryActive, setTextEntryActive] =
|
|
30081
|
-
const [showJson, setShowJson] =
|
|
30082
|
-
const [showHiddenProps, setShowHiddenProps] =
|
|
30083
|
-
const [draftValue, setDraftValue] =
|
|
30084
|
-
const [saveError, setSaveError] =
|
|
30085
|
-
const [tokenReviewRow, setTokenReviewRow] =
|
|
30086
|
-
const [tokenReviewEditing, setTokenReviewEditing] =
|
|
30087
|
-
const [tokenReviewEditCursor, setTokenReviewEditCursor] =
|
|
30088
|
-
const [tokenReviewEditSelection, setTokenReviewEditSelection] =
|
|
29916
|
+
const [panelOpen, setPanelOpen] = useState22("none");
|
|
29917
|
+
const [panelScrollOffset, setPanelScrollOffset] = useState22(0);
|
|
29918
|
+
const [jsonScrollOffset, setJsonScrollOffset] = useState22(0);
|
|
29919
|
+
const [textEntryActive, setTextEntryActive] = useState22(false);
|
|
29920
|
+
const [showJson, setShowJson] = useState22(false);
|
|
29921
|
+
const [showHiddenProps, setShowHiddenProps] = useState22(false);
|
|
29922
|
+
const [draftValue, setDraftValue] = useState22("");
|
|
29923
|
+
const [saveError, setSaveError] = useState22(null);
|
|
29924
|
+
const [tokenReviewRow, setTokenReviewRow] = useState22(0);
|
|
29925
|
+
const [tokenReviewEditing, setTokenReviewEditing] = useState22(false);
|
|
29926
|
+
const [tokenReviewEditCursor, setTokenReviewEditCursor] = useState22(0);
|
|
29927
|
+
const [tokenReviewEditSelection, setTokenReviewEditSelection] = useState22(/* @__PURE__ */ new Set());
|
|
30089
29928
|
const tokenReviewSuggestedRef = useRef14(/* @__PURE__ */ new Map());
|
|
30090
29929
|
const pendingGRef = useRef14(false);
|
|
30091
|
-
|
|
29930
|
+
useEffect20(() => {
|
|
30092
29931
|
setTokenReviewRow(0);
|
|
30093
29932
|
setTokenReviewEditing(false);
|
|
30094
29933
|
setTokenReviewEditCursor(0);
|
|
@@ -30208,12 +30047,12 @@ var init_use_review_editor = __esm({
|
|
|
30208
30047
|
});
|
|
30209
30048
|
|
|
30210
30049
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/use-review-surface-state.ts
|
|
30211
|
-
import { useState as
|
|
30050
|
+
import { useState as useState23 } from "react";
|
|
30212
30051
|
function useReviewSurfaceState(initialFinalizeError = null) {
|
|
30213
|
-
const [sidebarFocused, setSidebarFocused] =
|
|
30214
|
-
const [showFinalize, setShowFinalize] =
|
|
30215
|
-
const [showQuit, setShowQuit] =
|
|
30216
|
-
const [finalizeError, setFinalizeError] =
|
|
30052
|
+
const [sidebarFocused, setSidebarFocused] = useState23(true);
|
|
30053
|
+
const [showFinalize, setShowFinalize] = useState23(false);
|
|
30054
|
+
const [showQuit, setShowQuit] = useState23(false);
|
|
30055
|
+
const [finalizeError, setFinalizeError] = useState23(initialFinalizeError);
|
|
30217
30056
|
return {
|
|
30218
30057
|
sidebarFocused,
|
|
30219
30058
|
setSidebarFocused,
|
|
@@ -30570,24 +30409,24 @@ var init_preview_annotations = __esm({
|
|
|
30570
30409
|
});
|
|
30571
30410
|
|
|
30572
30411
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/use-live-preview.ts
|
|
30573
|
-
import { useCallback as useCallback3, useEffect as
|
|
30412
|
+
import { useCallback as useCallback3, useEffect as useEffect21, useRef as useRef15, useState as useState24 } from "react";
|
|
30574
30413
|
function useLivePreview(opts) {
|
|
30575
30414
|
const debounceMs = opts.debounceMs ?? DEFAULT_DEBOUNCE_MS;
|
|
30576
|
-
const [status, setStatus] =
|
|
30577
|
-
const [disabled, setDisabled] =
|
|
30415
|
+
const [status, setStatus] = useState24("idle");
|
|
30416
|
+
const [disabled, setDisabled] = useState24(false);
|
|
30578
30417
|
const timerRef = useRef15(null);
|
|
30579
30418
|
const generationRef = useRef15(0);
|
|
30580
30419
|
const latestRef = useRef15(0);
|
|
30581
30420
|
const inflightRef = useRef15(0);
|
|
30582
30421
|
const optsRef = useRef15(opts);
|
|
30583
|
-
|
|
30422
|
+
useEffect21(() => {
|
|
30584
30423
|
optsRef.current = opts;
|
|
30585
30424
|
});
|
|
30586
30425
|
const disabledRef = useRef15(disabled);
|
|
30587
|
-
|
|
30426
|
+
useEffect21(() => {
|
|
30588
30427
|
disabledRef.current = disabled;
|
|
30589
30428
|
}, [disabled]);
|
|
30590
|
-
|
|
30429
|
+
useEffect21(() => {
|
|
30591
30430
|
return () => {
|
|
30592
30431
|
if (timerRef.current) {
|
|
30593
30432
|
clearTimeout(timerRef.current);
|
|
@@ -30668,7 +30507,7 @@ var init_use_live_preview = __esm({
|
|
|
30668
30507
|
});
|
|
30669
30508
|
|
|
30670
30509
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/use-review-preview.ts
|
|
30671
|
-
import { useCallback as useCallback4, useEffect as
|
|
30510
|
+
import { useCallback as useCallback4, useEffect as useEffect22, useState as useState25 } from "react";
|
|
30672
30511
|
function useReviewPreview({
|
|
30673
30512
|
components,
|
|
30674
30513
|
loading,
|
|
@@ -30682,8 +30521,8 @@ function useReviewPreview({
|
|
|
30682
30521
|
deleteAllComponents,
|
|
30683
30522
|
onResult
|
|
30684
30523
|
}) {
|
|
30685
|
-
const [previewAnnotations, setPreviewAnnotations] =
|
|
30686
|
-
const [removedComponents, setRemovedComponents] =
|
|
30524
|
+
const [previewAnnotations, setPreviewAnnotations] = useState25(/* @__PURE__ */ new Map());
|
|
30525
|
+
const [removedComponents, setRemovedComponents] = useState25([]);
|
|
30687
30526
|
const handleResult = useCallback4(
|
|
30688
30527
|
(response) => {
|
|
30689
30528
|
if (!response) return;
|
|
@@ -30709,14 +30548,14 @@ function useReviewPreview({
|
|
|
30709
30548
|
onResult: handleResult,
|
|
30710
30549
|
deleteAllComponents
|
|
30711
30550
|
});
|
|
30712
|
-
const [spinnerTick, setSpinnerTick] =
|
|
30713
|
-
|
|
30551
|
+
const [spinnerTick, setSpinnerTick] = useState25(0);
|
|
30552
|
+
useEffect22(() => {
|
|
30714
30553
|
if (livePreviewHook.status !== "running") return;
|
|
30715
30554
|
const id = setInterval(() => setSpinnerTick((tick) => tick + 1), 80);
|
|
30716
30555
|
return () => clearInterval(id);
|
|
30717
30556
|
}, [livePreviewHook.status]);
|
|
30718
30557
|
const livePreviewSpinner = SPINNER_FRAMES[spinnerTick % SPINNER_FRAMES.length];
|
|
30719
|
-
|
|
30558
|
+
useEffect22(() => {
|
|
30720
30559
|
if (loading) return;
|
|
30721
30560
|
if (!livePreview) return;
|
|
30722
30561
|
if (components.length === 0) return;
|
|
@@ -30801,7 +30640,7 @@ var init_review_log = __esm({
|
|
|
30801
30640
|
});
|
|
30802
30641
|
|
|
30803
30642
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/use-review-log.ts
|
|
30804
|
-
import { useEffect as
|
|
30643
|
+
import { useEffect as useEffect23, useRef as useRef16 } from "react";
|
|
30805
30644
|
function useReviewLog({
|
|
30806
30645
|
loading,
|
|
30807
30646
|
loadError,
|
|
@@ -30811,7 +30650,7 @@ function useReviewLog({
|
|
|
30811
30650
|
const started = useRef16(false);
|
|
30812
30651
|
const latest = useRef16(components);
|
|
30813
30652
|
latest.current = components;
|
|
30814
|
-
|
|
30653
|
+
useEffect23(() => {
|
|
30815
30654
|
if (loading || started.current) return;
|
|
30816
30655
|
started.current = true;
|
|
30817
30656
|
startDebugRun({ ...REVIEW_RUN, inputs: reviewInputs(components) });
|
|
@@ -30826,7 +30665,7 @@ function useReviewLog({
|
|
|
30826
30665
|
trail.current = openReviewTrail(components, Date.now());
|
|
30827
30666
|
setDebugRunProgress(reviewProgress(trail.current, components, Date.now()));
|
|
30828
30667
|
}, [loading, loadError, components]);
|
|
30829
|
-
|
|
30668
|
+
useEffect23(
|
|
30830
30669
|
() => () => {
|
|
30831
30670
|
const open = trail.current;
|
|
30832
30671
|
trail.current = void 0;
|
|
@@ -30894,7 +30733,7 @@ var init_LivePreviewSummary = __esm({
|
|
|
30894
30733
|
});
|
|
30895
30734
|
|
|
30896
30735
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/generate-review-step.tsx
|
|
30897
|
-
import { useCallback as useCallback5, useEffect as
|
|
30736
|
+
import { useCallback as useCallback5, useEffect as useEffect24, useMemo as useMemo6, useRef as useRef17, useState as useState26 } from "react";
|
|
30898
30737
|
import figures8 from "figures";
|
|
30899
30738
|
import { Box as Box38, Text as Text40 } from "ink";
|
|
30900
30739
|
import { Fragment as Fragment14, jsx as jsx48, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
@@ -31059,7 +30898,7 @@ function GenerateReviewStepView({
|
|
|
31059
30898
|
initialFinalizeError = null
|
|
31060
30899
|
}) {
|
|
31061
30900
|
const { columns: terminalWidth, rows: terminalRows } = useTerminalSize();
|
|
31062
|
-
const [slotCycles, setSlotCycles] =
|
|
30901
|
+
const [slotCycles, setSlotCycles] = useState26([]);
|
|
31063
30902
|
const setLoadedSlotCycles = useCallback5((cycles) => {
|
|
31064
30903
|
setSlotCycles(cycles ?? []);
|
|
31065
30904
|
}, []);
|
|
@@ -31092,7 +30931,7 @@ function GenerateReviewStepView({
|
|
|
31092
30931
|
onExtraLoaded: setLoadedSlotCycles
|
|
31093
30932
|
});
|
|
31094
30933
|
const reviewLog = useReviewLog({ loading, loadError, components });
|
|
31095
|
-
const [nav, setNav] =
|
|
30934
|
+
const [nav, setNav] = useState26({
|
|
31096
30935
|
cursorRowIdx: 0,
|
|
31097
30936
|
sidebarScrollOffset: 0
|
|
31098
30937
|
});
|
|
@@ -31108,10 +30947,10 @@ function GenerateReviewStepView({
|
|
|
31108
30947
|
finalizeError,
|
|
31109
30948
|
setFinalizeError
|
|
31110
30949
|
} = reviewSurface;
|
|
31111
|
-
const [removedBannerCollapsed, setRemovedBannerCollapsed] =
|
|
30950
|
+
const [removedBannerCollapsed, setRemovedBannerCollapsed] = useState26(false);
|
|
31112
30951
|
const removedBannerDefaultedRef = useRef17(false);
|
|
31113
|
-
const [cyclePanelScroll, setCyclePanelScroll] =
|
|
31114
|
-
const [cyclesCursor, setCyclesCursor] =
|
|
30952
|
+
const [cyclePanelScroll, setCyclePanelScroll] = useState26(0);
|
|
30953
|
+
const [cyclesCursor, setCyclesCursor] = useState26(0);
|
|
31115
30954
|
const cyclePanel = useOverlayPanel({
|
|
31116
30955
|
toggleKey: "c",
|
|
31117
30956
|
onClose: () => {
|
|
@@ -31126,9 +30965,9 @@ function GenerateReviewStepView({
|
|
|
31126
30965
|
setBreakConfirm(false);
|
|
31127
30966
|
}
|
|
31128
30967
|
});
|
|
31129
|
-
const [breakCursor, setBreakCursor] =
|
|
31130
|
-
const [breakConfirm, setBreakConfirm] =
|
|
31131
|
-
const [expandedGroups, setExpandedGroups] =
|
|
30968
|
+
const [breakCursor, setBreakCursor] = useState26(0);
|
|
30969
|
+
const [breakConfirm, setBreakConfirm] = useState26(false);
|
|
30970
|
+
const [expandedGroups, setExpandedGroups] = useState26(/* @__PURE__ */ new Set());
|
|
31132
30971
|
const seededGroupsRef = useRef17(false);
|
|
31133
30972
|
const {
|
|
31134
30973
|
searchOpen,
|
|
@@ -31147,14 +30986,14 @@ function GenerateReviewStepView({
|
|
|
31147
30986
|
setShowHelp
|
|
31148
30987
|
} = useSidebarSearchState();
|
|
31149
30988
|
const breakingPanel = useOverlayPanel({ toggleKey: "b", onClose: () => setBreakingDetailOpen(false) });
|
|
31150
|
-
const [breakingChanges, setBreakingChanges] =
|
|
31151
|
-
const [breakingCursor, setBreakingCursor] =
|
|
31152
|
-
const [breakingDetailOpen, setBreakingDetailOpen] =
|
|
31153
|
-
const [pendingEditorFocus, setPendingEditorFocus] =
|
|
31154
|
-
const [autoRejected, setAutoRejected] =
|
|
31155
|
-
const [undoSnapshot, setUndoSnapshot] =
|
|
30989
|
+
const [breakingChanges, setBreakingChanges] = useState26([]);
|
|
30990
|
+
const [breakingCursor, setBreakingCursor] = useState26(0);
|
|
30991
|
+
const [breakingDetailOpen, setBreakingDetailOpen] = useState26(false);
|
|
30992
|
+
const [pendingEditorFocus, setPendingEditorFocus] = useState26(null);
|
|
30993
|
+
const [autoRejected, setAutoRejected] = useState26([]);
|
|
30994
|
+
const [undoSnapshot, setUndoSnapshot] = useState26(null);
|
|
31156
30995
|
const autoRejectFiredRef = useRef17(false);
|
|
31157
|
-
const [showReloadDialog, setShowReloadDialog] =
|
|
30996
|
+
const [showReloadDialog, setShowReloadDialog] = useState26(false);
|
|
31158
30997
|
const acceptedCountForPreview = components.filter((c2) => c2.status === "accepted").length;
|
|
31159
30998
|
const { previewAnnotations, removedComponents, livePreviewHook, livePreviewSpinner } = useReviewPreview({
|
|
31160
30999
|
components,
|
|
@@ -31219,7 +31058,7 @@ function GenerateReviewStepView({
|
|
|
31219
31058
|
[components]
|
|
31220
31059
|
);
|
|
31221
31060
|
const closures = useMemo6(() => computeAllClosures(componentGraph), [componentGraph]);
|
|
31222
|
-
|
|
31061
|
+
useEffect24(() => {
|
|
31223
31062
|
if (seededGroupsRef.current) return;
|
|
31224
31063
|
if (closures.size === 0 && slotCycles.length === 0) return;
|
|
31225
31064
|
seededGroupsRef.current = true;
|
|
@@ -31246,7 +31085,7 @@ function GenerateReviewStepView({
|
|
|
31246
31085
|
suggestedBreak: cycle.edges.length > 0 ? suggestCycleBreakEdge2(cycle, cycleView.pushBlocking) : null
|
|
31247
31086
|
}));
|
|
31248
31087
|
}, [slotCycles, cycleView]);
|
|
31249
|
-
|
|
31088
|
+
useEffect24(() => {
|
|
31250
31089
|
const decision = computeAutoRejectDecision({
|
|
31251
31090
|
loading,
|
|
31252
31091
|
autoRejectFired: autoRejectFiredRef.current,
|
|
@@ -31291,7 +31130,7 @@ function GenerateReviewStepView({
|
|
|
31291
31130
|
onAction: reviewLog.record
|
|
31292
31131
|
});
|
|
31293
31132
|
const autoRejectPushedRef = useRef17(false);
|
|
31294
|
-
|
|
31133
|
+
useEffect24(() => {
|
|
31295
31134
|
if (loading) return;
|
|
31296
31135
|
if (!historySeededRef.current) return;
|
|
31297
31136
|
if (!autoRejectFiredRef.current) return;
|
|
@@ -31375,7 +31214,7 @@ function GenerateReviewStepView({
|
|
|
31375
31214
|
const panelHeight = leftPanelHeight + 2;
|
|
31376
31215
|
const panelContentHeight = Math.max(1, panelHeight - 3);
|
|
31377
31216
|
const cycleViewportHeight = Math.max(1, panelHeight - 4);
|
|
31378
|
-
|
|
31217
|
+
useEffect24(() => {
|
|
31379
31218
|
if (selectableRowPositions.length === 0) return;
|
|
31380
31219
|
const cursorInRange = selectableRowPositions.includes(cursorRowIdx);
|
|
31381
31220
|
const maxScroll = Math.max(0, visibleRowsMemo.length - visibleCount);
|
|
@@ -32458,10 +32297,10 @@ var init_path_utils = __esm({
|
|
|
32458
32297
|
});
|
|
32459
32298
|
|
|
32460
32299
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/support/use-blinking-cursor.ts
|
|
32461
|
-
import { useEffect as
|
|
32300
|
+
import { useEffect as useEffect25, useState as useState27 } from "react";
|
|
32462
32301
|
function useBlinkingCursor() {
|
|
32463
|
-
const [visible, setVisible] =
|
|
32464
|
-
|
|
32302
|
+
const [visible, setVisible] = useState27(true);
|
|
32303
|
+
useEffect25(() => {
|
|
32465
32304
|
const interval = setInterval(() => setVisible((current) => !current), 500);
|
|
32466
32305
|
return () => clearInterval(interval);
|
|
32467
32306
|
}, []);
|
|
@@ -32474,16 +32313,16 @@ var init_use_blinking_cursor = __esm({
|
|
|
32474
32313
|
});
|
|
32475
32314
|
|
|
32476
32315
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/screens/PathPrompt.tsx
|
|
32477
|
-
import { useState as
|
|
32316
|
+
import { useState as useState28 } from "react";
|
|
32478
32317
|
import { Box as Box42, Text as Text44 } from "ink";
|
|
32479
32318
|
import { readdirSync as readdirSync4 } from "node:fs";
|
|
32480
|
-
import { dirname as
|
|
32319
|
+
import { dirname as dirname17, basename as basename6, join as join23 } from "node:path";
|
|
32481
32320
|
import { jsx as jsx52, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
32482
32321
|
function autocomplete(partial) {
|
|
32483
32322
|
if (!partial) return null;
|
|
32484
32323
|
const normalized = normalizePath(partial);
|
|
32485
|
-
const dir =
|
|
32486
|
-
const base =
|
|
32324
|
+
const dir = dirname17(normalized);
|
|
32325
|
+
const base = basename6(normalized);
|
|
32487
32326
|
let entries;
|
|
32488
32327
|
try {
|
|
32489
32328
|
entries = readdirSync4(dir);
|
|
@@ -32492,13 +32331,13 @@ function autocomplete(partial) {
|
|
|
32492
32331
|
}
|
|
32493
32332
|
const matches = entries.filter((e) => e.startsWith(base));
|
|
32494
32333
|
if (matches.length === 0) return null;
|
|
32495
|
-
if (matches.length === 1) return
|
|
32334
|
+
if (matches.length === 1) return join23(dir, matches[0]);
|
|
32496
32335
|
let prefix = matches[0];
|
|
32497
32336
|
for (const m of matches) {
|
|
32498
32337
|
while (!m.startsWith(prefix)) prefix = prefix.slice(0, -1);
|
|
32499
32338
|
if (!prefix) break;
|
|
32500
32339
|
}
|
|
32501
|
-
return prefix.length > base.length ?
|
|
32340
|
+
return prefix.length > base.length ? join23(dir, prefix) : null;
|
|
32502
32341
|
}
|
|
32503
32342
|
function PathPrompt({
|
|
32504
32343
|
defaultPath,
|
|
@@ -32507,7 +32346,7 @@ function PathPrompt({
|
|
|
32507
32346
|
label = "Save to",
|
|
32508
32347
|
summary
|
|
32509
32348
|
}) {
|
|
32510
|
-
const [input, setInput] =
|
|
32349
|
+
const [input, setInput] = useState28("");
|
|
32511
32350
|
const cursorVisible = useBlinkingCursor();
|
|
32512
32351
|
useImmediateInput((rawInput, key) => {
|
|
32513
32352
|
if (key.return) {
|
|
@@ -32598,12 +32437,12 @@ var init_produced = __esm({
|
|
|
32598
32437
|
});
|
|
32599
32438
|
|
|
32600
32439
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/support/use-timed-spinner.tsx
|
|
32601
|
-
import { useEffect as
|
|
32440
|
+
import { useEffect as useEffect26, useState as useState29 } from "react";
|
|
32602
32441
|
import { Spinner as Spinner2 } from "@inkjs/ui";
|
|
32603
32442
|
import { jsx as jsx53 } from "react/jsx-runtime";
|
|
32604
32443
|
function useTimedSpinner() {
|
|
32605
|
-
const [elapsedSeconds, setElapsedSeconds] =
|
|
32606
|
-
|
|
32444
|
+
const [elapsedSeconds, setElapsedSeconds] = useState29(0);
|
|
32445
|
+
useEffect26(() => {
|
|
32607
32446
|
const timer = setInterval(() => setElapsedSeconds((current) => current + 1), 1e3);
|
|
32608
32447
|
return () => {
|
|
32609
32448
|
clearInterval(timer);
|
|
@@ -32876,7 +32715,7 @@ var init_preview_confirmation_input = __esm({
|
|
|
32876
32715
|
});
|
|
32877
32716
|
|
|
32878
32717
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/screens/WizardPreviewStep.tsx
|
|
32879
|
-
import { useEffect as
|
|
32718
|
+
import { useEffect as useEffect27, useState as useState30, useMemo as useMemo7 } from "react";
|
|
32880
32719
|
import { Box as Box44, Text as Text46 } from "ink";
|
|
32881
32720
|
import { Fragment as Fragment16, jsx as jsx55, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
32882
32721
|
function buildPreviewSummaryLines(preview) {
|
|
@@ -33070,8 +32909,8 @@ function WizardPreviewStep({
|
|
|
33070
32909
|
onQuit
|
|
33071
32910
|
}) {
|
|
33072
32911
|
const breakingWithImpact = hasBreakingChangesWithImpact(preview);
|
|
33073
|
-
const [diffExpanded, setDiffExpanded] =
|
|
33074
|
-
const [scrollOffset, setScrollOffset] =
|
|
32912
|
+
const [diffExpanded, setDiffExpanded] = useState30(false);
|
|
32913
|
+
const [scrollOffset, setScrollOffset] = useState30(0);
|
|
33075
32914
|
const { columns: terminalColumns, rows: terminalRows } = useTerminalSize();
|
|
33076
32915
|
const summaryLines = useMemo7(() => buildPreviewSummaryLines(preview), [preview]);
|
|
33077
32916
|
const diffLines = useMemo7(() => buildPreviewDiffLines(preview), [preview]);
|
|
@@ -33086,7 +32925,7 @@ function WizardPreviewStep({
|
|
|
33086
32925
|
const activeLines = diffExpanded ? diffLines : summaryLines;
|
|
33087
32926
|
const maxScroll = Math.max(0, activeLines.length - viewportHeight);
|
|
33088
32927
|
const boundedScrollOffset = Math.min(scrollOffset, maxScroll);
|
|
33089
|
-
|
|
32928
|
+
useEffect27(() => {
|
|
33090
32929
|
setScrollOffset((previous) => Math.min(previous, maxScroll));
|
|
33091
32930
|
}, [maxScroll]);
|
|
33092
32931
|
useImmediateInput((input, key) => {
|
|
@@ -33353,11 +33192,11 @@ var init_flow_log = __esm({
|
|
|
33353
33192
|
});
|
|
33354
33193
|
|
|
33355
33194
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/flow/use-flow-log.ts
|
|
33356
|
-
import { useEffect as
|
|
33195
|
+
import { useEffect as useEffect28, useRef as useRef18 } from "react";
|
|
33357
33196
|
function useFlowLog(state2) {
|
|
33358
33197
|
const trail = useRef18(void 0);
|
|
33359
33198
|
const previous = useRef18(void 0);
|
|
33360
|
-
|
|
33199
|
+
useEffect28(() => {
|
|
33361
33200
|
const before = previous.current;
|
|
33362
33201
|
previous.current = state2;
|
|
33363
33202
|
const moved = before !== void 0 && before.step !== state2.step;
|
|
@@ -33380,7 +33219,7 @@ function useFlowLog(state2) {
|
|
|
33380
33219
|
trail.current = open;
|
|
33381
33220
|
setDebugRunProgress(flowProgress(open, now));
|
|
33382
33221
|
}, [state2]);
|
|
33383
|
-
|
|
33222
|
+
useEffect28(
|
|
33384
33223
|
() => () => {
|
|
33385
33224
|
const open = trail.current;
|
|
33386
33225
|
trail.current = void 0;
|
|
@@ -33927,8 +33766,8 @@ var init_run_print_files_helpers = __esm({
|
|
|
33927
33766
|
});
|
|
33928
33767
|
|
|
33929
33768
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/flow/save.ts
|
|
33930
|
-
import { writeFile as
|
|
33931
|
-
import { join as
|
|
33769
|
+
import { writeFile as writeFile8 } from "node:fs/promises";
|
|
33770
|
+
import { join as join24 } from "node:path";
|
|
33932
33771
|
function buildSavedCDF(components, tokens, opts = {}) {
|
|
33933
33772
|
const cdf = buildCDF2(components, toCdfTokens(tokens), opts);
|
|
33934
33773
|
if (!cdf) throw new Error("nothing to save \u2014 no components or tokens resolved");
|
|
@@ -33940,7 +33779,7 @@ function buildSavedCDF(components, tokens, opts = {}) {
|
|
|
33940
33779
|
}
|
|
33941
33780
|
async function runPrintFiles(input, deps, onPatch) {
|
|
33942
33781
|
onPatch({ step: "printing" });
|
|
33943
|
-
const componentsPath =
|
|
33782
|
+
const componentsPath = join24(input.outDir, "components.json");
|
|
33944
33783
|
try {
|
|
33945
33784
|
const db = deps.openDb();
|
|
33946
33785
|
let components = [];
|
|
@@ -34029,7 +33868,7 @@ var init_save = __esm({
|
|
|
34029
33868
|
realSaveDeps = () => ({
|
|
34030
33869
|
openDb: openPipelineDb,
|
|
34031
33870
|
readTokens: (path5) => readTokensFromPath2({ flag: "tokens", path: path5 }),
|
|
34032
|
-
writeFile: (path5, contents) =>
|
|
33871
|
+
writeFile: (path5, contents) => writeFile8(path5, contents),
|
|
34033
33872
|
appendRun,
|
|
34034
33873
|
buildSourceFingerprint,
|
|
34035
33874
|
sleep: (ms) => new Promise((resolve29) => setTimeout(resolve29, ms)),
|
|
@@ -34054,7 +33893,7 @@ var init_types9 = __esm({
|
|
|
34054
33893
|
import { appendFileSync, writeFileSync } from "node:fs";
|
|
34055
33894
|
import { mkdir as mkdir9 } from "node:fs/promises";
|
|
34056
33895
|
import { tmpdir } from "node:os";
|
|
34057
|
-
import { join as
|
|
33896
|
+
import { join as join25, resolve as resolve27 } from "node:path";
|
|
34058
33897
|
function appendWizardLog(entry) {
|
|
34059
33898
|
appendFileSync(WIZARD_LOG, JSON.stringify({ ts: (/* @__PURE__ */ new Date()).toISOString(), ...entry }) + "\n");
|
|
34060
33899
|
}
|
|
@@ -34339,12 +34178,12 @@ var init_controller = __esm({
|
|
|
34339
34178
|
init_push();
|
|
34340
34179
|
init_save();
|
|
34341
34180
|
init_types9();
|
|
34342
|
-
WIZARD_LOG =
|
|
34181
|
+
WIZARD_LOG = join25(tmpdir(), "experiences-import-wizard.log");
|
|
34343
34182
|
}
|
|
34344
34183
|
});
|
|
34345
34184
|
|
|
34346
34185
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/flow/use-flow.ts
|
|
34347
|
-
import { useEffect as
|
|
34186
|
+
import { useEffect as useEffect29, useRef as useRef19, useSyncExternalStore } from "react";
|
|
34348
34187
|
function useFlow(start, options = {}) {
|
|
34349
34188
|
const controller = useRef19();
|
|
34350
34189
|
if (start && !controller.current) {
|
|
@@ -34363,7 +34202,7 @@ function useFlow(start, options = {}) {
|
|
|
34363
34202
|
(listener) => current?.subscribe(listener) ?? (() => void 0),
|
|
34364
34203
|
() => current?.getState()
|
|
34365
34204
|
);
|
|
34366
|
-
|
|
34205
|
+
useEffect29(() => {
|
|
34367
34206
|
if (!start) controller.current = void 0;
|
|
34368
34207
|
}, [start]);
|
|
34369
34208
|
return current && state2 ? { controller: current, state: state2 } : void 0;
|
|
@@ -34376,7 +34215,7 @@ var init_use_flow = __esm({
|
|
|
34376
34215
|
});
|
|
34377
34216
|
|
|
34378
34217
|
// packages/experience-design-system-cli/src/tui/help/file-locations.ts
|
|
34379
|
-
import { join as
|
|
34218
|
+
import { join as join26, resolve as resolve28 } from "node:path";
|
|
34380
34219
|
function describeFileLocations({
|
|
34381
34220
|
contentfulBaseDir,
|
|
34382
34221
|
debugModeEnabled,
|
|
@@ -34385,14 +34224,14 @@ function describeFileLocations({
|
|
|
34385
34224
|
if (!debugModeEnabled) {
|
|
34386
34225
|
return {
|
|
34387
34226
|
debugLogs: "none while Debug Mode is off",
|
|
34388
|
-
importFiles: `${
|
|
34227
|
+
importFiles: `${join26("<project>", ".contentful")}/ (tokens.json, components.json)`
|
|
34389
34228
|
};
|
|
34390
34229
|
}
|
|
34391
34230
|
const base = contentfulBaseDir ? resolve28(contentfulBaseDir) : "<project>";
|
|
34392
|
-
const session = currentSessionDir2 ??
|
|
34231
|
+
const session = currentSessionDir2 ?? join26(base, ".contentful", "<date>-session-<n>");
|
|
34393
34232
|
return {
|
|
34394
|
-
debugLogs:
|
|
34395
|
-
importFiles: `${
|
|
34233
|
+
debugLogs: join26(session, "debug"),
|
|
34234
|
+
importFiles: `${join26(session, "dsi-import-<n>")}/ (tokens.json, components.json)`
|
|
34396
34235
|
};
|
|
34397
34236
|
}
|
|
34398
34237
|
var init_file_locations = __esm({
|
|
@@ -34442,7 +34281,7 @@ var init_help_info = __esm({
|
|
|
34442
34281
|
});
|
|
34443
34282
|
|
|
34444
34283
|
// packages/experience-design-system-cli/src/tui/help/PageContainer.tsx
|
|
34445
|
-
import { useEffect as
|
|
34284
|
+
import { useEffect as useEffect30, useState as useState31 } from "react";
|
|
34446
34285
|
import { Box as Box46, Text as Text47, useInput as useInput13 } from "ink";
|
|
34447
34286
|
import { Fragment as Fragment17, jsx as jsx57, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
34448
34287
|
function Section({ title, rows }) {
|
|
@@ -34455,8 +34294,8 @@ function Section({ title, rows }) {
|
|
|
34455
34294
|
] });
|
|
34456
34295
|
}
|
|
34457
34296
|
function HelpScreen({ onDone }) {
|
|
34458
|
-
const [info, setInfo] =
|
|
34459
|
-
|
|
34297
|
+
const [info, setInfo] = useState31();
|
|
34298
|
+
useEffect30(() => {
|
|
34460
34299
|
startDebugRun({ flow: "help", step: "01-help", menuOption: "Help", inputs: {} });
|
|
34461
34300
|
void readHelpInfo().then(setInfo);
|
|
34462
34301
|
}, []);
|
|
@@ -34503,14 +34342,14 @@ var init_PageContainer2 = __esm({
|
|
|
34503
34342
|
});
|
|
34504
34343
|
|
|
34505
34344
|
// packages/experience-design-system-cli/src/tui/settings/PageContainer.tsx
|
|
34506
|
-
import { useState as
|
|
34345
|
+
import { useState as useState32 } from "react";
|
|
34507
34346
|
import { Box as Box47, Text as Text48, useInput as useInput14 } from "ink";
|
|
34508
34347
|
import { jsx as jsx58, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
34509
34348
|
function SettingsScreen({
|
|
34510
34349
|
onNavigate,
|
|
34511
34350
|
onBack
|
|
34512
34351
|
}) {
|
|
34513
|
-
const [focusIdx, setFocusIdx] =
|
|
34352
|
+
const [focusIdx, setFocusIdx] = useState32(0);
|
|
34514
34353
|
const items = [
|
|
34515
34354
|
{ label: "Configuration", screen: "settings-configuration" },
|
|
34516
34355
|
{ label: "Opt-in Analytics", screen: "settings-opt-in-analytics" },
|
|
@@ -34838,7 +34677,7 @@ var init_AgentStatusBadge = __esm({
|
|
|
34838
34677
|
});
|
|
34839
34678
|
|
|
34840
34679
|
// packages/experience-design-system-cli/src/tui/settings/configuration/agents/AgentDetail.tsx
|
|
34841
|
-
import { useEffect as
|
|
34680
|
+
import { useEffect as useEffect31, useState as useState33 } from "react";
|
|
34842
34681
|
import { Box as Box48, Text as Text50 } from "ink";
|
|
34843
34682
|
import { jsx as jsx60, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
34844
34683
|
function StatusHeading() {
|
|
@@ -34855,11 +34694,11 @@ function AgentDetail({
|
|
|
34855
34694
|
record: record3
|
|
34856
34695
|
}) {
|
|
34857
34696
|
const settings = config.agents[name];
|
|
34858
|
-
const [saving, setSaving] =
|
|
34859
|
-
const [testing, setTesting] =
|
|
34860
|
-
const [notice, setNotice] =
|
|
34861
|
-
const [checks, setChecks] =
|
|
34862
|
-
|
|
34697
|
+
const [saving, setSaving] = useState33(false);
|
|
34698
|
+
const [testing, setTesting] = useState33(false);
|
|
34699
|
+
const [notice, setNotice] = useState33(null);
|
|
34700
|
+
const [checks, setChecks] = useState33(void 0);
|
|
34701
|
+
useEffect31(() => {
|
|
34863
34702
|
let active = true;
|
|
34864
34703
|
setChecks(void 0);
|
|
34865
34704
|
const timer = setTimeout(() => {
|
|
@@ -34951,17 +34790,17 @@ var init_AgentDetail = __esm({
|
|
|
34951
34790
|
});
|
|
34952
34791
|
|
|
34953
34792
|
// packages/experience-design-system-cli/src/tui/settings/configuration/agents/AgentsScreen.tsx
|
|
34954
|
-
import { useEffect as
|
|
34793
|
+
import { useEffect as useEffect32, useRef as useRef20, useState as useState34 } from "react";
|
|
34955
34794
|
import { Box as Box49, Text as Text51, useInput as useInput15 } from "ink";
|
|
34956
34795
|
import { Fragment as Fragment18, jsx as jsx61, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
34957
34796
|
function AgentsScreen({ onDone }) {
|
|
34958
|
-
const [config, setConfig] =
|
|
34959
|
-
const [focus, setFocus] =
|
|
34960
|
-
const [open, setOpen] =
|
|
34961
|
-
const [notice, setNotice] =
|
|
34962
|
-
const [saving, setSaving] =
|
|
34963
|
-
const [loadError, setLoadError] =
|
|
34964
|
-
const [checks, setChecks] =
|
|
34797
|
+
const [config, setConfig] = useState34(null);
|
|
34798
|
+
const [focus, setFocus] = useState34(0);
|
|
34799
|
+
const [open, setOpen] = useState34(null);
|
|
34800
|
+
const [notice, setNotice] = useState34(null);
|
|
34801
|
+
const [saving, setSaving] = useState34(false);
|
|
34802
|
+
const [loadError, setLoadError] = useState34(null);
|
|
34803
|
+
const [checks, setChecks] = useState34({});
|
|
34965
34804
|
const visit = useRef20({
|
|
34966
34805
|
trail: createTrail(),
|
|
34967
34806
|
before: void 0,
|
|
@@ -34975,7 +34814,7 @@ function AgentsScreen({ onDone }) {
|
|
|
34975
34814
|
);
|
|
34976
34815
|
}
|
|
34977
34816
|
};
|
|
34978
|
-
|
|
34817
|
+
useEffect32(() => {
|
|
34979
34818
|
readAgentConfig().then((loaded) => {
|
|
34980
34819
|
setConfig(loaded);
|
|
34981
34820
|
inspectAll(loaded);
|
|
@@ -35201,7 +35040,7 @@ var init_project_store = __esm({
|
|
|
35201
35040
|
});
|
|
35202
35041
|
|
|
35203
35042
|
// packages/experience-design-system-cli/src/tui/settings/configuration/project/ProjectScreen.tsx
|
|
35204
|
-
import { useEffect as
|
|
35043
|
+
import { useEffect as useEffect33, useRef as useRef21, useState as useState35 } from "react";
|
|
35205
35044
|
import { Box as Box50, Text as Text52, useInput as useInput16 } from "ink";
|
|
35206
35045
|
import { Fragment as Fragment19, jsx as jsx62, jsxs as jsxs50 } from "react/jsx-runtime";
|
|
35207
35046
|
function debugFields(config) {
|
|
@@ -35216,10 +35055,10 @@ function debugFields(config) {
|
|
|
35216
35055
|
};
|
|
35217
35056
|
}
|
|
35218
35057
|
function ProjectScreen({ onDone }) {
|
|
35219
|
-
const [config, setConfig] =
|
|
35220
|
-
const [saving, setSaving] =
|
|
35221
|
-
const [notice, setNotice] =
|
|
35222
|
-
const [loadError, setLoadError] =
|
|
35058
|
+
const [config, setConfig] = useState35(null);
|
|
35059
|
+
const [saving, setSaving] = useState35(false);
|
|
35060
|
+
const [notice, setNotice] = useState35(null);
|
|
35061
|
+
const [loadError, setLoadError] = useState35(null);
|
|
35223
35062
|
const visit = useRef21({
|
|
35224
35063
|
trail: createTrail(),
|
|
35225
35064
|
before: void 0,
|
|
@@ -35227,7 +35066,7 @@ function ProjectScreen({ onDone }) {
|
|
|
35227
35066
|
error: ""
|
|
35228
35067
|
}).current;
|
|
35229
35068
|
const scrub2 = (err) => scrubError(err, [config?.cmaToken ?? ""]);
|
|
35230
|
-
|
|
35069
|
+
useEffect33(() => {
|
|
35231
35070
|
readCredentials().then((cfg) => {
|
|
35232
35071
|
setConfig(cfg);
|
|
35233
35072
|
visit.before = snapshotOf(cfg);
|
|
@@ -35348,12 +35187,12 @@ var init_ProjectScreen = __esm({
|
|
|
35348
35187
|
});
|
|
35349
35188
|
|
|
35350
35189
|
// packages/experience-design-system-cli/src/tui/settings/configuration/ConfigurationScreen.tsx
|
|
35351
|
-
import { useState as
|
|
35190
|
+
import { useState as useState36 } from "react";
|
|
35352
35191
|
import { Box as Box51, Text as Text53, useInput as useInput17 } from "ink";
|
|
35353
35192
|
import { jsx as jsx63, jsxs as jsxs51 } from "react/jsx-runtime";
|
|
35354
35193
|
function ConfigurationScreen({ onDone }) {
|
|
35355
|
-
const [focus, setFocus] =
|
|
35356
|
-
const [open, setOpen] =
|
|
35194
|
+
const [focus, setFocus] = useState36(0);
|
|
35195
|
+
const [open, setOpen] = useState36(null);
|
|
35357
35196
|
const close = () => setOpen(null);
|
|
35358
35197
|
useInput17((input, key) => {
|
|
35359
35198
|
if (open) return;
|
|
@@ -35414,13 +35253,13 @@ var init_ConfigurationScreen = __esm({
|
|
|
35414
35253
|
});
|
|
35415
35254
|
|
|
35416
35255
|
// packages/experience-design-system-cli/src/tui/settings/opt-in-analytics/screen.tsx
|
|
35417
|
-
import { useEffect as
|
|
35256
|
+
import { useEffect as useEffect34, useState as useState37 } from "react";
|
|
35418
35257
|
import { Box as Box52, Text as Text54, useInput as useInput18 } from "ink";
|
|
35419
35258
|
import { Fragment as Fragment20, jsx as jsx64, jsxs as jsxs52 } from "react/jsx-runtime";
|
|
35420
35259
|
function OptInAnalyticsScreen({ onDone }) {
|
|
35421
|
-
const [loading, setLoading] =
|
|
35422
|
-
const [enabled, setEnabled] =
|
|
35423
|
-
|
|
35260
|
+
const [loading, setLoading] = useState37(true);
|
|
35261
|
+
const [enabled, setEnabled] = useState37(true);
|
|
35262
|
+
useEffect34(() => {
|
|
35424
35263
|
readAnalyticsSetting().then((setting) => {
|
|
35425
35264
|
setEnabled(setting.enabled);
|
|
35426
35265
|
setLoading(false);
|
|
@@ -35483,18 +35322,18 @@ var init_screen12 = __esm({
|
|
|
35483
35322
|
});
|
|
35484
35323
|
|
|
35485
35324
|
// packages/experience-design-system-cli/src/tui/settings/debug-mode/screen.tsx
|
|
35486
|
-
import { useEffect as
|
|
35325
|
+
import { useEffect as useEffect35, useRef as useRef22, useState as useState38 } from "react";
|
|
35487
35326
|
import { Box as Box53, Text as Text55, useInput as useInput19 } from "ink";
|
|
35488
35327
|
import { Fragment as Fragment21, jsx as jsx65, jsxs as jsxs53 } from "react/jsx-runtime";
|
|
35489
35328
|
function DebugModeScreen({ onDone }) {
|
|
35490
|
-
const [setting, setSetting] =
|
|
35491
|
-
const [focus, setFocus] =
|
|
35492
|
-
const [pending, setPending] =
|
|
35329
|
+
const [setting, setSetting] = useState38(null);
|
|
35330
|
+
const [focus, setFocus] = useState38("enabled");
|
|
35331
|
+
const [pending, setPending] = useState38(
|
|
35493
35332
|
RETENTION_CHOICES[RETENTION_CHOICES.length - 1]
|
|
35494
35333
|
);
|
|
35495
|
-
const [notice, setNotice] =
|
|
35334
|
+
const [notice, setNotice] = useState38(null);
|
|
35496
35335
|
const visit = useRef22({ trail: createTrail(), before: void 0, error: "" }).current;
|
|
35497
|
-
|
|
35336
|
+
useEffect35(() => {
|
|
35498
35337
|
readDebugModeSetting().then((loaded) => {
|
|
35499
35338
|
setSetting(loaded);
|
|
35500
35339
|
setPending(loaded.retentionDays);
|
|
@@ -35635,21 +35474,21 @@ var app_exports = {};
|
|
|
35635
35474
|
__export(app_exports, {
|
|
35636
35475
|
runApp: () => runApp
|
|
35637
35476
|
});
|
|
35638
|
-
import { useEffect as
|
|
35477
|
+
import { useEffect as useEffect36, useState as useState39 } from "react";
|
|
35639
35478
|
import { Fragment as Fragment22, jsx as jsx66 } from "react/jsx-runtime";
|
|
35640
35479
|
function App({ importOptions, inkClear }) {
|
|
35641
|
-
const [screen, setScreen] =
|
|
35642
|
-
const [importExitCode, setImportExitCode] =
|
|
35480
|
+
const [screen, setScreen] = useState39("start");
|
|
35481
|
+
const [importExitCode, setImportExitCode] = useState39();
|
|
35643
35482
|
const showImportResult = importExitCode !== void 0;
|
|
35644
|
-
const [target, setTarget] =
|
|
35645
|
-
const [answers, setAnswers] =
|
|
35483
|
+
const [target, setTarget] = useState39();
|
|
35484
|
+
const [answers, setAnswers] = useState39({});
|
|
35646
35485
|
const answer = (patch) => setAnswers((current) => ({ ...current, ...patch }));
|
|
35647
|
-
const [extractionRun, setExtractionRun] =
|
|
35486
|
+
const [extractionRun, setExtractionRun] = useState39();
|
|
35648
35487
|
const extraction = useExtraction(extractionRun?.input);
|
|
35649
|
-
const [tokensOnlyRun, setTokensOnlyRun] =
|
|
35488
|
+
const [tokensOnlyRun, setTokensOnlyRun] = useState39();
|
|
35650
35489
|
const tokensOnly = useTokensOnly(tokensOnlyRun?.tokens);
|
|
35651
|
-
const [tokenReview, setTokenReview] =
|
|
35652
|
-
const [scopeRun, setScopeRun] =
|
|
35490
|
+
const [tokenReview, setTokenReview] = useState39();
|
|
35491
|
+
const [scopeRun, setScopeRun] = useState39();
|
|
35653
35492
|
const scopeFlow = useScopeGateFlow(
|
|
35654
35493
|
scopeRun && {
|
|
35655
35494
|
sessionId: scopeRun.extraction.sessionId,
|
|
@@ -35664,12 +35503,12 @@ function App({ importOptions, inkClear }) {
|
|
|
35664
35503
|
}
|
|
35665
35504
|
}
|
|
35666
35505
|
);
|
|
35667
|
-
const [generationInput, setGenerationInput] =
|
|
35506
|
+
const [generationInput, setGenerationInput] = useState39();
|
|
35668
35507
|
const generation = useGeneration(generationInput);
|
|
35669
|
-
const [flowStart, setFlowStart] =
|
|
35508
|
+
const [flowStart, setFlowStart] = useState39();
|
|
35670
35509
|
const flow = useFlow(flowStart, { beforeStepChange: inkClear });
|
|
35671
|
-
const [importDefaults, setImportDefaults] =
|
|
35672
|
-
|
|
35510
|
+
const [importDefaults, setImportDefaults] = useState39();
|
|
35511
|
+
useEffect36(() => {
|
|
35673
35512
|
if (screen !== "import") {
|
|
35674
35513
|
setImportDefaults(void 0);
|
|
35675
35514
|
return;
|
|
@@ -35742,7 +35581,7 @@ function App({ importOptions, inkClear }) {
|
|
|
35742
35581
|
}
|
|
35743
35582
|
});
|
|
35744
35583
|
};
|
|
35745
|
-
|
|
35584
|
+
useEffect36(() => {
|
|
35746
35585
|
if (!tokensOnlyRun || tokensOnly?.status !== "done" || !tokensOnly.result.ok) return;
|
|
35747
35586
|
const { credentialsSkipped, input, tokens } = tokensOnlyRun;
|
|
35748
35587
|
const { tokensPath, tokenSessionId, tokenCount } = tokensOnly.result;
|
|
@@ -35764,12 +35603,12 @@ function App({ importOptions, inkClear }) {
|
|
|
35764
35603
|
}
|
|
35765
35604
|
});
|
|
35766
35605
|
}, [tokensOnly, tokensOnlyRun]);
|
|
35767
|
-
|
|
35606
|
+
useEffect36(() => {
|
|
35768
35607
|
if (!extractionRun || extraction?.status !== "done" || !extraction.result.ok) return;
|
|
35769
35608
|
setExtractionRun(void 0);
|
|
35770
35609
|
setScopeRun({ ...extractionRun, extraction: extraction.result.extraction });
|
|
35771
35610
|
}, [extraction, extractionRun]);
|
|
35772
|
-
|
|
35611
|
+
useEffect36(() => {
|
|
35773
35612
|
if (!scopeRun || scopeFlow?.status !== "confirmed" || generationInput) return;
|
|
35774
35613
|
const { extraction: produced, input, generatePromptPath } = scopeRun;
|
|
35775
35614
|
setGenerationInput({
|
|
@@ -35787,7 +35626,7 @@ function App({ importOptions, inkClear }) {
|
|
|
35787
35626
|
...generatePromptPath ? { generatePromptPath } : {}
|
|
35788
35627
|
});
|
|
35789
35628
|
}, [scopeFlow, scopeRun, generationInput]);
|
|
35790
|
-
|
|
35629
|
+
useEffect36(() => {
|
|
35791
35630
|
if (!scopeRun || generation?.status !== "done" || !generation.result.ok) return;
|
|
35792
35631
|
const { credentialsSkipped, extraction: produced, input, generatePromptPath } = scopeRun;
|
|
35793
35632
|
inkClear();
|
|
@@ -36030,7 +35869,7 @@ var init_app = __esm({
|
|
|
36030
35869
|
// packages/experience-design-system-cli/program.ts
|
|
36031
35870
|
init_src3();
|
|
36032
35871
|
import { readFileSync as readFileSync10 } from "node:fs";
|
|
36033
|
-
import { join as
|
|
35872
|
+
import { join as join27 } from "node:path";
|
|
36034
35873
|
import { Command } from "commander";
|
|
36035
35874
|
|
|
36036
35875
|
// packages/experience-design-system-cli/src/commands/import-options.ts
|
|
@@ -36095,7 +35934,7 @@ init_analytics_store();
|
|
|
36095
35934
|
init_package_root();
|
|
36096
35935
|
var pkg = JSON.parse(
|
|
36097
35936
|
readFileSync10(
|
|
36098
|
-
|
|
35937
|
+
join27(findPackageRoot(import.meta.url, "@contentful/experience-design-system-cli"), "package.json"),
|
|
36099
35938
|
"utf8"
|
|
36100
35939
|
)
|
|
36101
35940
|
);
|
|
@@ -36135,21 +35974,21 @@ function createProgram() {
|
|
|
36135
35974
|
init_config();
|
|
36136
35975
|
init_package_root();
|
|
36137
35976
|
import { existsSync as existsSync12 } from "node:fs";
|
|
36138
|
-
import { mkdir as mkdir10, readFile as
|
|
36139
|
-
import { dirname as
|
|
35977
|
+
import { mkdir as mkdir10, readFile as readFile21, rename as rename3, rmdir as rmdir2, unlink } from "node:fs/promises";
|
|
35978
|
+
import { dirname as dirname18, join as join28 } from "node:path";
|
|
36140
35979
|
var PACKAGE_NAME3 = "@contentful/experience-design-system-cli";
|
|
36141
35980
|
async function readJson(path5) {
|
|
36142
35981
|
try {
|
|
36143
|
-
return JSON.parse(await
|
|
35982
|
+
return JSON.parse(await readFile21(path5, "utf8"));
|
|
36144
35983
|
} catch {
|
|
36145
35984
|
return void 0;
|
|
36146
35985
|
}
|
|
36147
35986
|
}
|
|
36148
35987
|
async function migrateOldConfig() {
|
|
36149
35988
|
try {
|
|
36150
|
-
const oldCredentials =
|
|
36151
|
-
const oldRuns =
|
|
36152
|
-
const oldDebugMode =
|
|
35989
|
+
const oldCredentials = join28(oldConfigDir2(), "credentials.json");
|
|
35990
|
+
const oldRuns = join28(oldConfigDir2(), "runs.json");
|
|
35991
|
+
const oldDebugMode = join28(
|
|
36153
35992
|
findPackageRoot(import.meta.url, PACKAGE_NAME3),
|
|
36154
35993
|
".contentful",
|
|
36155
35994
|
"config",
|
|
@@ -36162,7 +36001,7 @@ async function migrateOldConfig() {
|
|
|
36162
36001
|
if (Object.keys(migrated).length > 0) await updateSettings2({ ...migrated, ...await readSettings2() });
|
|
36163
36002
|
if (existsSync12(oldRuns)) {
|
|
36164
36003
|
if (!existsSync12(runsFilePath2())) {
|
|
36165
|
-
await mkdir10(
|
|
36004
|
+
await mkdir10(dirname18(runsFilePath2()), { recursive: true });
|
|
36166
36005
|
await rename3(oldRuns, runsFilePath2());
|
|
36167
36006
|
} else {
|
|
36168
36007
|
await unlink(oldRuns);
|