@contentful/experience-design-system-cli 2.35.1-dev-build-61f85bdf.0 → 2.35.1-dev-build-2acd1126.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 +57 -90
- package/dist/index.js +57 -91
- package/dist/package.json +1 -1
- package/dist/src/tui/import/steps/01-welcome/screen.d.ts +1 -2
- package/dist/src/tui/import/steps/02-token-input/screen.d.ts +1 -2
- package/dist/src/tui/settings/contentful-configuration/config-store.d.ts +0 -2
- package/legacy/dist/src/analyze/select/tui/theme.d.ts +3 -0
- package/legacy/dist/src/import/tui/steps/DoneStep.d.ts +1 -1
- package/legacy/dist/src/import/tui/steps/RunningStep.d.ts +9 -1
- package/legacy/dist/src/index.js +749 -725
- package/legacy/dist/src/tui/use-timed-spinner.d.ts +1 -2
- package/legacy/package.json +1 -1
- package/package.json +2 -2
package/dist/app.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// packages/experience-design-system-cli/app.tsx
|
|
2
|
-
import {
|
|
2
|
+
import { useState as useState10 } from "react";
|
|
3
3
|
|
|
4
4
|
// packages/experience-design-system-cli/src/tui/home/home.tsx
|
|
5
5
|
import { useEffect as useEffect2, useState as useState2 } from "react";
|
|
@@ -269,8 +269,8 @@ var OVERVIEW = [
|
|
|
269
269
|
{ label: "Step 4", description: "Review generated definitions" },
|
|
270
270
|
{ label: "Step 5", description: "Push to Contentful" }
|
|
271
271
|
];
|
|
272
|
-
function WelcomeScreen({ onContinue, onQuit
|
|
273
|
-
const [projectPath, setProjectPath] = useState3(
|
|
272
|
+
function WelcomeScreen({ onContinue, onQuit }) {
|
|
273
|
+
const [projectPath, setProjectPath] = useState3("");
|
|
274
274
|
useWelcomeControls(projectPath, onQuit);
|
|
275
275
|
const submit = (value) => {
|
|
276
276
|
const path = toProjectPath(value);
|
|
@@ -374,13 +374,8 @@ function validateTokenPath(rawPath) {
|
|
|
374
374
|
|
|
375
375
|
// packages/experience-design-system-cli/src/tui/import/steps/02-token-input/screen.tsx
|
|
376
376
|
import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
377
|
-
function TokenInputScreen({
|
|
378
|
-
|
|
379
|
-
onSkip,
|
|
380
|
-
onBack,
|
|
381
|
-
initialPath = ""
|
|
382
|
-
}) {
|
|
383
|
-
const [tokenPath, setTokenPath] = useState4(initialPath);
|
|
377
|
+
function TokenInputScreen({ onConfirm, onSkip, onBack }) {
|
|
378
|
+
const [tokenPath, setTokenPath] = useState4("");
|
|
384
379
|
const [failure, setFailure] = useState4(null);
|
|
385
380
|
useTokenInputControls(tokenPath, onSkip, onBack);
|
|
386
381
|
const change = (value) => {
|
|
@@ -756,7 +751,6 @@ function SettingsScreen({
|
|
|
756
751
|
// packages/experience-design-system-cli/src/tui/settings/contentful-configuration/ContentfulConfigScreen.tsx
|
|
757
752
|
import { useEffect as useEffect4, useState as useState6 } from "react";
|
|
758
753
|
import { Box as Box7, Text as Text7, useInput as useInput7 } from "ink";
|
|
759
|
-
import TextInput3 from "ink-text-input";
|
|
760
754
|
|
|
761
755
|
// packages/experience-design-system-cli/src/tui/settings/utils/v1-store.ts
|
|
762
756
|
var readV1Store = readSettings;
|
|
@@ -769,9 +763,7 @@ async function readCredentials() {
|
|
|
769
763
|
spaceId: store.spaceId || "",
|
|
770
764
|
environmentId: store.environmentId || "",
|
|
771
765
|
cmaToken: store.cmaToken || "",
|
|
772
|
-
host: store.host || ""
|
|
773
|
-
defaultComponentDir: store.defaultComponentDir || "",
|
|
774
|
-
defaultTokenFile: store.defaultTokenFile || ""
|
|
766
|
+
host: store.host || ""
|
|
775
767
|
};
|
|
776
768
|
}
|
|
777
769
|
async function writeCredentials(config) {
|
|
@@ -788,40 +780,26 @@ async function writeCredentials(config) {
|
|
|
788
780
|
|
|
789
781
|
// packages/experience-design-system-cli/src/tui/settings/contentful-configuration/ContentfulConfigScreen.tsx
|
|
790
782
|
import { Fragment, jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
791
|
-
var FIELD_ORDER = [
|
|
792
|
-
"spaceId",
|
|
793
|
-
"environmentId",
|
|
794
|
-
"cmaToken",
|
|
795
|
-
"host",
|
|
796
|
-
"defaultComponentDir",
|
|
797
|
-
"defaultTokenFile"
|
|
798
|
-
];
|
|
783
|
+
var FIELD_ORDER = ["spaceId", "environmentId", "cmaToken", "host"];
|
|
799
784
|
function debugFields(config) {
|
|
800
785
|
return {
|
|
801
786
|
space_id: config?.spaceId ?? "",
|
|
802
787
|
environment_id: config?.environmentId ?? "",
|
|
803
788
|
cma_token: config?.cmaToken ?? "",
|
|
804
|
-
host: config?.host ?? ""
|
|
805
|
-
default_component_dir: config?.defaultComponentDir ?? "",
|
|
806
|
-
default_token_file: config?.defaultTokenFile ?? ""
|
|
789
|
+
host: config?.host ?? ""
|
|
807
790
|
};
|
|
808
791
|
}
|
|
809
792
|
var FIELD_LABELS = {
|
|
810
793
|
spaceId: "Space ID",
|
|
811
794
|
environmentId: "Environment ID",
|
|
812
795
|
cmaToken: "CMA Token",
|
|
813
|
-
host: "API Host (optional)"
|
|
814
|
-
defaultComponentDir: "Default component directory (optional)",
|
|
815
|
-
defaultTokenFile: "Default token file (optional)"
|
|
796
|
+
host: "API Host (optional)"
|
|
816
797
|
};
|
|
817
798
|
function ConfigurationScreen({ onDone }) {
|
|
818
799
|
const [stage, setStage] = useState6("loading");
|
|
819
800
|
const [config, setConfig] = useState6(null);
|
|
820
801
|
const [activeField, setActiveField] = useState6("spaceId");
|
|
821
|
-
const [
|
|
822
|
-
const [lastSaved, setLastSaved] = useState6(null);
|
|
823
|
-
const [editing, setEditing] = useState6(false);
|
|
824
|
-
const [valueBeforeEdit, setValueBeforeEdit] = useState6("");
|
|
802
|
+
const [message, setMessage] = useState6(null);
|
|
825
803
|
useEffect4(() => {
|
|
826
804
|
readCredentials().then((cfg) => {
|
|
827
805
|
setConfig(cfg);
|
|
@@ -841,46 +819,31 @@ function ConfigurationScreen({ onDone }) {
|
|
|
841
819
|
function setFieldValue(field, value) {
|
|
842
820
|
if (!config) return;
|
|
843
821
|
setConfig({ ...config, [field]: value });
|
|
844
|
-
setNotice(null);
|
|
845
822
|
}
|
|
846
823
|
function handleSave() {
|
|
847
824
|
if (!config) return;
|
|
848
825
|
setStage("saving");
|
|
849
|
-
|
|
826
|
+
setMessage(null);
|
|
850
827
|
writeCredentials(config).then(() => {
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
setStage("form");
|
|
828
|
+
setStage("saved");
|
|
829
|
+
setMessage("Configuration saved");
|
|
854
830
|
}).catch((err) => {
|
|
855
|
-
|
|
831
|
+
setMessage(err instanceof Error ? err.message : "Failed to save");
|
|
856
832
|
setStage("form");
|
|
857
833
|
});
|
|
858
834
|
}
|
|
859
|
-
function quit() {
|
|
860
|
-
void finishDebugRun(
|
|
861
|
-
lastSaved ? { outputs: debugFields(lastSaved), status: "success", exitMethod: "saved" } : { outputs: {}, status: "success", exitMethod: "discarded" }
|
|
862
|
-
);
|
|
863
|
-
onDone();
|
|
864
|
-
}
|
|
865
835
|
useInput7((input, key) => {
|
|
866
836
|
if (stage === "loading" || stage === "saving") return;
|
|
867
|
-
if (
|
|
868
|
-
if (key.escape) {
|
|
869
|
-
|
|
870
|
-
|
|
837
|
+
if (stage === "saved") {
|
|
838
|
+
if (key.return || key.escape || input === "q") {
|
|
839
|
+
void finishDebugRun({ outputs: debugFields(config), status: "success", exitMethod: "saved" });
|
|
840
|
+
onDone();
|
|
871
841
|
}
|
|
872
842
|
return;
|
|
873
843
|
}
|
|
874
844
|
if (key.escape || input === "q") {
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
}
|
|
878
|
-
if (input === "s") {
|
|
879
|
-
handleSave();
|
|
880
|
-
return;
|
|
881
|
-
}
|
|
882
|
-
if (input === "c") {
|
|
883
|
-
setFieldValue(activeField, "");
|
|
845
|
+
void finishDebugRun({ outputs: {}, status: "success", exitMethod: "discarded" });
|
|
846
|
+
onDone();
|
|
884
847
|
return;
|
|
885
848
|
}
|
|
886
849
|
if (key.tab || key.downArrow) {
|
|
@@ -894,8 +857,21 @@ function ConfigurationScreen({ onDone }) {
|
|
|
894
857
|
return;
|
|
895
858
|
}
|
|
896
859
|
if (key.return) {
|
|
897
|
-
|
|
898
|
-
|
|
860
|
+
const idx = FIELD_ORDER.indexOf(activeField);
|
|
861
|
+
if (idx < FIELD_ORDER.length - 1) {
|
|
862
|
+
setActiveField(FIELD_ORDER[idx + 1]);
|
|
863
|
+
} else {
|
|
864
|
+
handleSave();
|
|
865
|
+
}
|
|
866
|
+
return;
|
|
867
|
+
}
|
|
868
|
+
if (key.backspace || key.delete) {
|
|
869
|
+
const current = fieldValue(activeField);
|
|
870
|
+
setFieldValue(activeField, current.slice(0, -1));
|
|
871
|
+
return;
|
|
872
|
+
}
|
|
873
|
+
if (input && !key.ctrl && !key.meta) {
|
|
874
|
+
setFieldValue(activeField, fieldValue(activeField) + input);
|
|
899
875
|
}
|
|
900
876
|
});
|
|
901
877
|
if (stage === "loading") {
|
|
@@ -905,9 +881,23 @@ function ConfigurationScreen({ onDone }) {
|
|
|
905
881
|
/* @__PURE__ */ jsx7(Text7, { color: PALETTE.accent, children: "Loading..." })
|
|
906
882
|
] });
|
|
907
883
|
}
|
|
884
|
+
if (stage === "saved") {
|
|
885
|
+
return /* @__PURE__ */ jsxs7(Box7, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
886
|
+
/* @__PURE__ */ jsx7(Text7, { bold: true, children: "Configuration" }),
|
|
887
|
+
/* @__PURE__ */ jsx7(Text7, { children: " " }),
|
|
888
|
+
/* @__PURE__ */ jsxs7(Text7, { color: PALETTE.success, children: [
|
|
889
|
+
"\u2713 ",
|
|
890
|
+
message
|
|
891
|
+
] }),
|
|
892
|
+
/* @__PURE__ */ jsx7(Text7, { children: " " }),
|
|
893
|
+
/* @__PURE__ */ jsx7(Text7, { dimColor: true, children: "[Enter] Back to Settings" })
|
|
894
|
+
] });
|
|
895
|
+
}
|
|
908
896
|
return /* @__PURE__ */ jsxs7(Box7, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
909
897
|
/* @__PURE__ */ jsx7(Text7, { bold: true, children: "Configuration" }),
|
|
910
898
|
/* @__PURE__ */ jsx7(Text7, { children: " " }),
|
|
899
|
+
/* @__PURE__ */ jsx7(Text7, { children: "Contentful API Credentials" }),
|
|
900
|
+
/* @__PURE__ */ jsx7(Text7, { children: " " }),
|
|
911
901
|
/* @__PURE__ */ jsx7(Box7, { flexDirection: "column", children: FIELD_ORDER.map((field) => {
|
|
912
902
|
const isActive = activeField === field;
|
|
913
903
|
const value = fieldValue(field);
|
|
@@ -918,27 +908,18 @@ function ConfigurationScreen({ onDone }) {
|
|
|
918
908
|
FIELD_LABELS[field],
|
|
919
909
|
":"
|
|
920
910
|
] }),
|
|
921
|
-
|
|
922
|
-
TextInput3,
|
|
923
|
-
{
|
|
924
|
-
value,
|
|
925
|
-
onChange: (next) => setFieldValue(field, next),
|
|
926
|
-
onSubmit: () => setEditing(false),
|
|
927
|
-
mask: field === "cmaToken" ? "\u2022" : void 0
|
|
928
|
-
}
|
|
929
|
-
) : /* @__PURE__ */ jsx7(Text7, { children: display || /* @__PURE__ */ jsx7(Text7, { dimColor: true, children: "(empty)" }) })
|
|
911
|
+
/* @__PURE__ */ jsx7(Text7, { children: display || /* @__PURE__ */ jsx7(Text7, { dimColor: true, children: "(empty)" }) })
|
|
930
912
|
] }, field);
|
|
931
913
|
}) }),
|
|
932
|
-
|
|
914
|
+
message && /* @__PURE__ */ jsxs7(Fragment, { children: [
|
|
933
915
|
/* @__PURE__ */ jsx7(Text7, { children: " " }),
|
|
934
|
-
/* @__PURE__ */ jsxs7(Text7, { color:
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
notice.text
|
|
916
|
+
/* @__PURE__ */ jsxs7(Text7, { color: PALETTE.error, children: [
|
|
917
|
+
"\u2717 ",
|
|
918
|
+
message
|
|
938
919
|
] })
|
|
939
920
|
] }),
|
|
940
921
|
/* @__PURE__ */ jsx7(Text7, { children: " " }),
|
|
941
|
-
/* @__PURE__ */ jsx7(Text7, { dimColor: true, children:
|
|
922
|
+
/* @__PURE__ */ jsx7(Text7, { dimColor: true, children: "[\u2191/\u2193] Switch field \xB7 [Enter] Save/Next \xB7 [Esc/q] Back" })
|
|
942
923
|
] });
|
|
943
924
|
}
|
|
944
925
|
|
|
@@ -1130,22 +1111,12 @@ function DebugModeScreen({ onDone }) {
|
|
|
1130
1111
|
}
|
|
1131
1112
|
|
|
1132
1113
|
// packages/experience-design-system-cli/app.tsx
|
|
1133
|
-
import {
|
|
1114
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
1134
1115
|
function App({ onLaunchImport, importExitCode }) {
|
|
1135
1116
|
const returnedFromImport = importExitCode !== void 0;
|
|
1136
1117
|
const [screen, setScreen] = useState10(returnedFromImport ? "import" : "start");
|
|
1137
1118
|
const [showImportResult, setShowImportResult] = useState10(returnedFromImport);
|
|
1138
1119
|
const [projectPath, setProjectPath] = useState10();
|
|
1139
|
-
const [importDefaults, setImportDefaults] = useState10();
|
|
1140
|
-
useEffect8(() => {
|
|
1141
|
-
if (screen !== "import") {
|
|
1142
|
-
setImportDefaults(void 0);
|
|
1143
|
-
return;
|
|
1144
|
-
}
|
|
1145
|
-
void readCredentials().then(
|
|
1146
|
-
(saved) => setImportDefaults({ componentDir: saved.defaultComponentDir ?? "", tokenFile: saved.defaultTokenFile ?? "" })
|
|
1147
|
-
);
|
|
1148
|
-
}, [screen]);
|
|
1149
1120
|
const goToStart = () => setScreen("start");
|
|
1150
1121
|
const goToSettings = () => setScreen("settings");
|
|
1151
1122
|
const finishImportResult = () => {
|
|
@@ -1160,14 +1131,10 @@ function App({ onLaunchImport, importExitCode }) {
|
|
|
1160
1131
|
switch (screen) {
|
|
1161
1132
|
case "import":
|
|
1162
1133
|
if (showImportResult) return /* @__PURE__ */ jsx11(ImportScreen, { exitCode: importExitCode, onDone: finishImportResult });
|
|
1163
|
-
if (
|
|
1164
|
-
if (projectPath === void 0) {
|
|
1165
|
-
return /* @__PURE__ */ jsx11(WelcomeScreen, { onContinue: setProjectPath, onQuit: leaveImport, initialPath: importDefaults.componentDir });
|
|
1166
|
-
}
|
|
1134
|
+
if (projectPath === void 0) return /* @__PURE__ */ jsx11(WelcomeScreen, { onContinue: setProjectPath, onQuit: leaveImport });
|
|
1167
1135
|
return /* @__PURE__ */ jsx11(
|
|
1168
1136
|
TokenInputScreen,
|
|
1169
1137
|
{
|
|
1170
|
-
initialPath: importDefaults.tokenFile,
|
|
1171
1138
|
onConfirm: (tokens) => onLaunchImport?.({ project: projectPath, tokens }),
|
|
1172
1139
|
onSkip: () => onLaunchImport?.({ project: projectPath }),
|
|
1173
1140
|
onBack: () => setProjectPath(void 0)
|
package/dist/index.js
CHANGED
|
@@ -336,8 +336,8 @@ import { useState as useState3 } from "react";
|
|
|
336
336
|
import { Box as Box3, Text as Text3 } from "ink";
|
|
337
337
|
import TextInput from "ink-text-input";
|
|
338
338
|
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
339
|
-
function WelcomeScreen({ onContinue, onQuit
|
|
340
|
-
const [projectPath, setProjectPath] = useState3(
|
|
339
|
+
function WelcomeScreen({ onContinue, onQuit }) {
|
|
340
|
+
const [projectPath, setProjectPath] = useState3("");
|
|
341
341
|
useWelcomeControls(projectPath, onQuit);
|
|
342
342
|
const submit = (value) => {
|
|
343
343
|
const path = toProjectPath(value);
|
|
@@ -471,13 +471,8 @@ import { useState as useState4 } from "react";
|
|
|
471
471
|
import { Box as Box4, Text as Text4 } from "ink";
|
|
472
472
|
import TextInput2 from "ink-text-input";
|
|
473
473
|
import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
474
|
-
function TokenInputScreen({
|
|
475
|
-
|
|
476
|
-
onSkip,
|
|
477
|
-
onBack,
|
|
478
|
-
initialPath = ""
|
|
479
|
-
}) {
|
|
480
|
-
const [tokenPath, setTokenPath] = useState4(initialPath);
|
|
474
|
+
function TokenInputScreen({ onConfirm, onSkip, onBack }) {
|
|
475
|
+
const [tokenPath, setTokenPath] = useState4("");
|
|
481
476
|
const [failure, setFailure] = useState4(null);
|
|
482
477
|
useTokenInputControls(tokenPath, onSkip, onBack);
|
|
483
478
|
const change = (value) => {
|
|
@@ -907,9 +902,7 @@ async function readCredentials() {
|
|
|
907
902
|
spaceId: store.spaceId || "",
|
|
908
903
|
environmentId: store.environmentId || "",
|
|
909
904
|
cmaToken: store.cmaToken || "",
|
|
910
|
-
host: store.host || ""
|
|
911
|
-
defaultComponentDir: store.defaultComponentDir || "",
|
|
912
|
-
defaultTokenFile: store.defaultTokenFile || ""
|
|
905
|
+
host: store.host || ""
|
|
913
906
|
};
|
|
914
907
|
}
|
|
915
908
|
async function writeCredentials(config) {
|
|
@@ -933,26 +926,20 @@ var init_config_store = __esm({
|
|
|
933
926
|
// packages/experience-design-system-cli/src/tui/settings/contentful-configuration/ContentfulConfigScreen.tsx
|
|
934
927
|
import { useEffect as useEffect4, useState as useState6 } from "react";
|
|
935
928
|
import { Box as Box7, Text as Text7, useInput as useInput7 } from "ink";
|
|
936
|
-
import TextInput3 from "ink-text-input";
|
|
937
929
|
import { Fragment, jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
938
930
|
function debugFields(config) {
|
|
939
931
|
return {
|
|
940
932
|
space_id: config?.spaceId ?? "",
|
|
941
933
|
environment_id: config?.environmentId ?? "",
|
|
942
934
|
cma_token: config?.cmaToken ?? "",
|
|
943
|
-
host: config?.host ?? ""
|
|
944
|
-
default_component_dir: config?.defaultComponentDir ?? "",
|
|
945
|
-
default_token_file: config?.defaultTokenFile ?? ""
|
|
935
|
+
host: config?.host ?? ""
|
|
946
936
|
};
|
|
947
937
|
}
|
|
948
938
|
function ConfigurationScreen({ onDone }) {
|
|
949
939
|
const [stage, setStage] = useState6("loading");
|
|
950
940
|
const [config, setConfig] = useState6(null);
|
|
951
941
|
const [activeField, setActiveField] = useState6("spaceId");
|
|
952
|
-
const [
|
|
953
|
-
const [lastSaved, setLastSaved] = useState6(null);
|
|
954
|
-
const [editing, setEditing] = useState6(false);
|
|
955
|
-
const [valueBeforeEdit, setValueBeforeEdit] = useState6("");
|
|
942
|
+
const [message, setMessage] = useState6(null);
|
|
956
943
|
useEffect4(() => {
|
|
957
944
|
readCredentials().then((cfg) => {
|
|
958
945
|
setConfig(cfg);
|
|
@@ -972,46 +959,31 @@ function ConfigurationScreen({ onDone }) {
|
|
|
972
959
|
function setFieldValue(field, value) {
|
|
973
960
|
if (!config) return;
|
|
974
961
|
setConfig({ ...config, [field]: value });
|
|
975
|
-
setNotice(null);
|
|
976
962
|
}
|
|
977
963
|
function handleSave() {
|
|
978
964
|
if (!config) return;
|
|
979
965
|
setStage("saving");
|
|
980
|
-
|
|
966
|
+
setMessage(null);
|
|
981
967
|
writeCredentials(config).then(() => {
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
setStage("form");
|
|
968
|
+
setStage("saved");
|
|
969
|
+
setMessage("Configuration saved");
|
|
985
970
|
}).catch((err) => {
|
|
986
|
-
|
|
971
|
+
setMessage(err instanceof Error ? err.message : "Failed to save");
|
|
987
972
|
setStage("form");
|
|
988
973
|
});
|
|
989
974
|
}
|
|
990
|
-
function quit() {
|
|
991
|
-
void finishDebugRun(
|
|
992
|
-
lastSaved ? { outputs: debugFields(lastSaved), status: "success", exitMethod: "saved" } : { outputs: {}, status: "success", exitMethod: "discarded" }
|
|
993
|
-
);
|
|
994
|
-
onDone();
|
|
995
|
-
}
|
|
996
975
|
useInput7((input, key) => {
|
|
997
976
|
if (stage === "loading" || stage === "saving") return;
|
|
998
|
-
if (
|
|
999
|
-
if (key.escape) {
|
|
1000
|
-
|
|
1001
|
-
|
|
977
|
+
if (stage === "saved") {
|
|
978
|
+
if (key.return || key.escape || input === "q") {
|
|
979
|
+
void finishDebugRun({ outputs: debugFields(config), status: "success", exitMethod: "saved" });
|
|
980
|
+
onDone();
|
|
1002
981
|
}
|
|
1003
982
|
return;
|
|
1004
983
|
}
|
|
1005
984
|
if (key.escape || input === "q") {
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
}
|
|
1009
|
-
if (input === "s") {
|
|
1010
|
-
handleSave();
|
|
1011
|
-
return;
|
|
1012
|
-
}
|
|
1013
|
-
if (input === "c") {
|
|
1014
|
-
setFieldValue(activeField, "");
|
|
985
|
+
void finishDebugRun({ outputs: {}, status: "success", exitMethod: "discarded" });
|
|
986
|
+
onDone();
|
|
1015
987
|
return;
|
|
1016
988
|
}
|
|
1017
989
|
if (key.tab || key.downArrow) {
|
|
@@ -1025,8 +997,21 @@ function ConfigurationScreen({ onDone }) {
|
|
|
1025
997
|
return;
|
|
1026
998
|
}
|
|
1027
999
|
if (key.return) {
|
|
1028
|
-
|
|
1029
|
-
|
|
1000
|
+
const idx = FIELD_ORDER.indexOf(activeField);
|
|
1001
|
+
if (idx < FIELD_ORDER.length - 1) {
|
|
1002
|
+
setActiveField(FIELD_ORDER[idx + 1]);
|
|
1003
|
+
} else {
|
|
1004
|
+
handleSave();
|
|
1005
|
+
}
|
|
1006
|
+
return;
|
|
1007
|
+
}
|
|
1008
|
+
if (key.backspace || key.delete) {
|
|
1009
|
+
const current = fieldValue(activeField);
|
|
1010
|
+
setFieldValue(activeField, current.slice(0, -1));
|
|
1011
|
+
return;
|
|
1012
|
+
}
|
|
1013
|
+
if (input && !key.ctrl && !key.meta) {
|
|
1014
|
+
setFieldValue(activeField, fieldValue(activeField) + input);
|
|
1030
1015
|
}
|
|
1031
1016
|
});
|
|
1032
1017
|
if (stage === "loading") {
|
|
@@ -1036,9 +1021,23 @@ function ConfigurationScreen({ onDone }) {
|
|
|
1036
1021
|
/* @__PURE__ */ jsx7(Text7, { color: PALETTE.accent, children: "Loading..." })
|
|
1037
1022
|
] });
|
|
1038
1023
|
}
|
|
1024
|
+
if (stage === "saved") {
|
|
1025
|
+
return /* @__PURE__ */ jsxs7(Box7, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
1026
|
+
/* @__PURE__ */ jsx7(Text7, { bold: true, children: "Configuration" }),
|
|
1027
|
+
/* @__PURE__ */ jsx7(Text7, { children: " " }),
|
|
1028
|
+
/* @__PURE__ */ jsxs7(Text7, { color: PALETTE.success, children: [
|
|
1029
|
+
"\u2713 ",
|
|
1030
|
+
message
|
|
1031
|
+
] }),
|
|
1032
|
+
/* @__PURE__ */ jsx7(Text7, { children: " " }),
|
|
1033
|
+
/* @__PURE__ */ jsx7(Text7, { dimColor: true, children: "[Enter] Back to Settings" })
|
|
1034
|
+
] });
|
|
1035
|
+
}
|
|
1039
1036
|
return /* @__PURE__ */ jsxs7(Box7, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
1040
1037
|
/* @__PURE__ */ jsx7(Text7, { bold: true, children: "Configuration" }),
|
|
1041
1038
|
/* @__PURE__ */ jsx7(Text7, { children: " " }),
|
|
1039
|
+
/* @__PURE__ */ jsx7(Text7, { children: "Contentful API Credentials" }),
|
|
1040
|
+
/* @__PURE__ */ jsx7(Text7, { children: " " }),
|
|
1042
1041
|
/* @__PURE__ */ jsx7(Box7, { flexDirection: "column", children: FIELD_ORDER.map((field) => {
|
|
1043
1042
|
const isActive = activeField === field;
|
|
1044
1043
|
const value = fieldValue(field);
|
|
@@ -1049,27 +1048,18 @@ function ConfigurationScreen({ onDone }) {
|
|
|
1049
1048
|
FIELD_LABELS[field],
|
|
1050
1049
|
":"
|
|
1051
1050
|
] }),
|
|
1052
|
-
|
|
1053
|
-
TextInput3,
|
|
1054
|
-
{
|
|
1055
|
-
value,
|
|
1056
|
-
onChange: (next) => setFieldValue(field, next),
|
|
1057
|
-
onSubmit: () => setEditing(false),
|
|
1058
|
-
mask: field === "cmaToken" ? "\u2022" : void 0
|
|
1059
|
-
}
|
|
1060
|
-
) : /* @__PURE__ */ jsx7(Text7, { children: display || /* @__PURE__ */ jsx7(Text7, { dimColor: true, children: "(empty)" }) })
|
|
1051
|
+
/* @__PURE__ */ jsx7(Text7, { children: display || /* @__PURE__ */ jsx7(Text7, { dimColor: true, children: "(empty)" }) })
|
|
1061
1052
|
] }, field);
|
|
1062
1053
|
}) }),
|
|
1063
|
-
|
|
1054
|
+
message && /* @__PURE__ */ jsxs7(Fragment, { children: [
|
|
1064
1055
|
/* @__PURE__ */ jsx7(Text7, { children: " " }),
|
|
1065
|
-
/* @__PURE__ */ jsxs7(Text7, { color:
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
notice.text
|
|
1056
|
+
/* @__PURE__ */ jsxs7(Text7, { color: PALETTE.error, children: [
|
|
1057
|
+
"\u2717 ",
|
|
1058
|
+
message
|
|
1069
1059
|
] })
|
|
1070
1060
|
] }),
|
|
1071
1061
|
/* @__PURE__ */ jsx7(Text7, { children: " " }),
|
|
1072
|
-
/* @__PURE__ */ jsx7(Text7, { dimColor: true, children:
|
|
1062
|
+
/* @__PURE__ */ jsx7(Text7, { dimColor: true, children: "[\u2191/\u2193] Switch field \xB7 [Enter] Save/Next \xB7 [Esc/q] Back" })
|
|
1073
1063
|
] });
|
|
1074
1064
|
}
|
|
1075
1065
|
var FIELD_ORDER, FIELD_LABELS;
|
|
@@ -1079,21 +1069,12 @@ var init_ContentfulConfigScreen = __esm({
|
|
|
1079
1069
|
init_home_theme();
|
|
1080
1070
|
init_config_store();
|
|
1081
1071
|
init_debug_store();
|
|
1082
|
-
FIELD_ORDER = [
|
|
1083
|
-
"spaceId",
|
|
1084
|
-
"environmentId",
|
|
1085
|
-
"cmaToken",
|
|
1086
|
-
"host",
|
|
1087
|
-
"defaultComponentDir",
|
|
1088
|
-
"defaultTokenFile"
|
|
1089
|
-
];
|
|
1072
|
+
FIELD_ORDER = ["spaceId", "environmentId", "cmaToken", "host"];
|
|
1090
1073
|
FIELD_LABELS = {
|
|
1091
1074
|
spaceId: "Space ID",
|
|
1092
1075
|
environmentId: "Environment ID",
|
|
1093
1076
|
cmaToken: "CMA Token",
|
|
1094
|
-
host: "API Host (optional)"
|
|
1095
|
-
defaultComponentDir: "Default component directory (optional)",
|
|
1096
|
-
defaultTokenFile: "Default token file (optional)"
|
|
1077
|
+
host: "API Host (optional)"
|
|
1097
1078
|
};
|
|
1098
1079
|
}
|
|
1099
1080
|
});
|
|
@@ -1319,23 +1300,13 @@ var app_exports = {};
|
|
|
1319
1300
|
__export(app_exports, {
|
|
1320
1301
|
runApp: () => runApp
|
|
1321
1302
|
});
|
|
1322
|
-
import {
|
|
1323
|
-
import {
|
|
1303
|
+
import { useState as useState10 } from "react";
|
|
1304
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
1324
1305
|
function App({ onLaunchImport, importExitCode }) {
|
|
1325
1306
|
const returnedFromImport = importExitCode !== void 0;
|
|
1326
1307
|
const [screen, setScreen] = useState10(returnedFromImport ? "import" : "start");
|
|
1327
1308
|
const [showImportResult, setShowImportResult] = useState10(returnedFromImport);
|
|
1328
1309
|
const [projectPath, setProjectPath] = useState10();
|
|
1329
|
-
const [importDefaults, setImportDefaults] = useState10();
|
|
1330
|
-
useEffect8(() => {
|
|
1331
|
-
if (screen !== "import") {
|
|
1332
|
-
setImportDefaults(void 0);
|
|
1333
|
-
return;
|
|
1334
|
-
}
|
|
1335
|
-
void readCredentials().then(
|
|
1336
|
-
(saved) => setImportDefaults({ componentDir: saved.defaultComponentDir ?? "", tokenFile: saved.defaultTokenFile ?? "" })
|
|
1337
|
-
);
|
|
1338
|
-
}, [screen]);
|
|
1339
1310
|
const goToStart = () => setScreen("start");
|
|
1340
1311
|
const goToSettings = () => setScreen("settings");
|
|
1341
1312
|
const finishImportResult = () => {
|
|
@@ -1350,14 +1321,10 @@ function App({ onLaunchImport, importExitCode }) {
|
|
|
1350
1321
|
switch (screen) {
|
|
1351
1322
|
case "import":
|
|
1352
1323
|
if (showImportResult) return /* @__PURE__ */ jsx11(ImportScreen, { exitCode: importExitCode, onDone: finishImportResult });
|
|
1353
|
-
if (
|
|
1354
|
-
if (projectPath === void 0) {
|
|
1355
|
-
return /* @__PURE__ */ jsx11(WelcomeScreen, { onContinue: setProjectPath, onQuit: leaveImport, initialPath: importDefaults.componentDir });
|
|
1356
|
-
}
|
|
1324
|
+
if (projectPath === void 0) return /* @__PURE__ */ jsx11(WelcomeScreen, { onContinue: setProjectPath, onQuit: leaveImport });
|
|
1357
1325
|
return /* @__PURE__ */ jsx11(
|
|
1358
1326
|
TokenInputScreen,
|
|
1359
1327
|
{
|
|
1360
|
-
initialPath: importDefaults.tokenFile,
|
|
1361
1328
|
onConfirm: (tokens) => onLaunchImport?.({ project: projectPath, tokens }),
|
|
1362
1329
|
onSkip: () => onLaunchImport?.({ project: projectPath }),
|
|
1363
1330
|
onBack: () => setProjectPath(void 0)
|
|
@@ -1420,7 +1387,6 @@ var init_app = __esm({
|
|
|
1420
1387
|
init_screen3();
|
|
1421
1388
|
init_PageContainer4();
|
|
1422
1389
|
init_screen4();
|
|
1423
|
-
init_config_store();
|
|
1424
1390
|
}
|
|
1425
1391
|
});
|
|
1426
1392
|
|
package/dist/package.json
CHANGED
|
@@ -2,7 +2,6 @@ import React from 'react';
|
|
|
2
2
|
interface WelcomeScreenProps {
|
|
3
3
|
onContinue: (projectPath: string) => void;
|
|
4
4
|
onQuit: () => void;
|
|
5
|
-
initialPath?: string;
|
|
6
5
|
}
|
|
7
|
-
export declare function WelcomeScreen({ onContinue, onQuit
|
|
6
|
+
export declare function WelcomeScreen({ onContinue, onQuit }: WelcomeScreenProps): React.ReactElement;
|
|
8
7
|
export {};
|
|
@@ -3,7 +3,6 @@ interface TokenInputScreenProps {
|
|
|
3
3
|
onConfirm: (tokensPath: string) => void;
|
|
4
4
|
onSkip: () => void;
|
|
5
5
|
onBack: () => void;
|
|
6
|
-
initialPath?: string;
|
|
7
6
|
}
|
|
8
|
-
export declare function TokenInputScreen({ onConfirm, onSkip, onBack
|
|
7
|
+
export declare function TokenInputScreen({ onConfirm, onSkip, onBack }: TokenInputScreenProps): React.ReactElement;
|
|
9
8
|
export {};
|
|
@@ -11,4 +11,7 @@ export declare const PALETTE: {
|
|
|
11
11
|
readonly subtle: "#DDE5EC";
|
|
12
12
|
readonly bg: "#EFF2F6";
|
|
13
13
|
};
|
|
14
|
+
export declare const INK_UI_THEME: {
|
|
15
|
+
components: Record<string, import("@inkjs/ui").ComponentTheme>;
|
|
16
|
+
};
|
|
14
17
|
export declare function statusPaletteColor(status: ReviewComponentStatus, validationErrorCount: number, validationWarningCount: number): string;
|
|
@@ -24,5 +24,5 @@ type DoneStepProps = {
|
|
|
24
24
|
}>;
|
|
25
25
|
onExit: () => void;
|
|
26
26
|
};
|
|
27
|
-
export declare function DoneStep({ componentTypes, designTokens, summary, spaceId, environmentId, host,
|
|
27
|
+
export declare function DoneStep({ componentTypes, designTokens, summary, spaceId, environmentId, host, failures, onExit, }: DoneStepProps): React.ReactElement;
|
|
28
28
|
export {};
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
type Progress = {
|
|
3
|
+
done: number;
|
|
4
|
+
total: number;
|
|
5
|
+
};
|
|
2
6
|
type RunningStepProps = {
|
|
3
7
|
stepNumber: number;
|
|
4
8
|
totalSteps: number;
|
|
@@ -6,10 +10,14 @@ type RunningStepProps = {
|
|
|
6
10
|
description: string;
|
|
7
11
|
detail?: string;
|
|
8
12
|
detailComplete?: boolean;
|
|
13
|
+
/** Progress for the detail row (displays as progress bar + ratio). */
|
|
14
|
+
detailProgress?: Progress;
|
|
9
15
|
/** Optional second progress line (own spinner) — e.g. composition resolution
|
|
10
16
|
* running after the file scan on the extracting screen. */
|
|
11
17
|
secondaryDetail?: string;
|
|
12
18
|
secondaryComplete?: boolean;
|
|
19
|
+
/** Progress for the secondary detail row (displays as progress bar + ratio). */
|
|
20
|
+
secondaryProgress?: Progress;
|
|
13
21
|
/** Optional third progress line for another concurrent stage. */
|
|
14
22
|
tertiaryDetail?: string;
|
|
15
23
|
tertiaryComplete?: boolean;
|
|
@@ -20,5 +28,5 @@ type RunningStepProps = {
|
|
|
20
28
|
quinaryDetail?: string;
|
|
21
29
|
quinaryComplete?: boolean;
|
|
22
30
|
};
|
|
23
|
-
export declare function RunningStep({ stepNumber, totalSteps, title, description, detail, detailComplete, secondaryDetail, secondaryComplete, tertiaryDetail, tertiaryComplete, quaternaryDetail, quaternaryComplete, quinaryDetail, quinaryComplete, }: RunningStepProps): React.ReactElement;
|
|
31
|
+
export declare function RunningStep({ stepNumber, totalSteps, title, description, detail, detailComplete, detailProgress, secondaryDetail, secondaryComplete, secondaryProgress, tertiaryDetail, tertiaryComplete, quaternaryDetail, quaternaryComplete, quinaryDetail, quinaryComplete, }: RunningStepProps): React.ReactElement;
|
|
24
32
|
export {};
|