@contentful/experience-design-system-cli 2.35.1-dev-build-525507db.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 +55 -90
- package/dist/index.js +55 -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,6 +881,18 @@ 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: " " }),
|
|
@@ -920,27 +908,18 @@ function ConfigurationScreen({ onDone }) {
|
|
|
920
908
|
FIELD_LABELS[field],
|
|
921
909
|
":"
|
|
922
910
|
] }),
|
|
923
|
-
|
|
924
|
-
TextInput3,
|
|
925
|
-
{
|
|
926
|
-
value,
|
|
927
|
-
onChange: (next) => setFieldValue(field, next),
|
|
928
|
-
onSubmit: () => setEditing(false),
|
|
929
|
-
mask: field === "cmaToken" ? "\u2022" : void 0
|
|
930
|
-
}
|
|
931
|
-
) : /* @__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)" }) })
|
|
932
912
|
] }, field);
|
|
933
913
|
}) }),
|
|
934
|
-
|
|
914
|
+
message && /* @__PURE__ */ jsxs7(Fragment, { children: [
|
|
935
915
|
/* @__PURE__ */ jsx7(Text7, { children: " " }),
|
|
936
|
-
/* @__PURE__ */ jsxs7(Text7, { color:
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
notice.text
|
|
916
|
+
/* @__PURE__ */ jsxs7(Text7, { color: PALETTE.error, children: [
|
|
917
|
+
"\u2717 ",
|
|
918
|
+
message
|
|
940
919
|
] })
|
|
941
920
|
] }),
|
|
942
921
|
/* @__PURE__ */ jsx7(Text7, { children: " " }),
|
|
943
|
-
/* @__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" })
|
|
944
923
|
] });
|
|
945
924
|
}
|
|
946
925
|
|
|
@@ -1132,22 +1111,12 @@ function DebugModeScreen({ onDone }) {
|
|
|
1132
1111
|
}
|
|
1133
1112
|
|
|
1134
1113
|
// packages/experience-design-system-cli/app.tsx
|
|
1135
|
-
import {
|
|
1114
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
1136
1115
|
function App({ onLaunchImport, importExitCode }) {
|
|
1137
1116
|
const returnedFromImport = importExitCode !== void 0;
|
|
1138
1117
|
const [screen, setScreen] = useState10(returnedFromImport ? "import" : "start");
|
|
1139
1118
|
const [showImportResult, setShowImportResult] = useState10(returnedFromImport);
|
|
1140
1119
|
const [projectPath, setProjectPath] = useState10();
|
|
1141
|
-
const [importDefaults, setImportDefaults] = useState10();
|
|
1142
|
-
useEffect8(() => {
|
|
1143
|
-
if (screen !== "import") {
|
|
1144
|
-
setImportDefaults(void 0);
|
|
1145
|
-
return;
|
|
1146
|
-
}
|
|
1147
|
-
void readCredentials().then(
|
|
1148
|
-
(saved) => setImportDefaults({ componentDir: saved.defaultComponentDir ?? "", tokenFile: saved.defaultTokenFile ?? "" })
|
|
1149
|
-
);
|
|
1150
|
-
}, [screen]);
|
|
1151
1120
|
const goToStart = () => setScreen("start");
|
|
1152
1121
|
const goToSettings = () => setScreen("settings");
|
|
1153
1122
|
const finishImportResult = () => {
|
|
@@ -1162,14 +1131,10 @@ function App({ onLaunchImport, importExitCode }) {
|
|
|
1162
1131
|
switch (screen) {
|
|
1163
1132
|
case "import":
|
|
1164
1133
|
if (showImportResult) return /* @__PURE__ */ jsx11(ImportScreen, { exitCode: importExitCode, onDone: finishImportResult });
|
|
1165
|
-
if (
|
|
1166
|
-
if (projectPath === void 0) {
|
|
1167
|
-
return /* @__PURE__ */ jsx11(WelcomeScreen, { onContinue: setProjectPath, onQuit: leaveImport, initialPath: importDefaults.componentDir });
|
|
1168
|
-
}
|
|
1134
|
+
if (projectPath === void 0) return /* @__PURE__ */ jsx11(WelcomeScreen, { onContinue: setProjectPath, onQuit: leaveImport });
|
|
1169
1135
|
return /* @__PURE__ */ jsx11(
|
|
1170
1136
|
TokenInputScreen,
|
|
1171
1137
|
{
|
|
1172
|
-
initialPath: importDefaults.tokenFile,
|
|
1173
1138
|
onConfirm: (tokens) => onLaunchImport?.({ project: projectPath, tokens }),
|
|
1174
1139
|
onSkip: () => onLaunchImport?.({ project: projectPath }),
|
|
1175
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,6 +1021,18 @@ 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: " " }),
|
|
@@ -1051,27 +1048,18 @@ function ConfigurationScreen({ onDone }) {
|
|
|
1051
1048
|
FIELD_LABELS[field],
|
|
1052
1049
|
":"
|
|
1053
1050
|
] }),
|
|
1054
|
-
|
|
1055
|
-
TextInput3,
|
|
1056
|
-
{
|
|
1057
|
-
value,
|
|
1058
|
-
onChange: (next) => setFieldValue(field, next),
|
|
1059
|
-
onSubmit: () => setEditing(false),
|
|
1060
|
-
mask: field === "cmaToken" ? "\u2022" : void 0
|
|
1061
|
-
}
|
|
1062
|
-
) : /* @__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)" }) })
|
|
1063
1052
|
] }, field);
|
|
1064
1053
|
}) }),
|
|
1065
|
-
|
|
1054
|
+
message && /* @__PURE__ */ jsxs7(Fragment, { children: [
|
|
1066
1055
|
/* @__PURE__ */ jsx7(Text7, { children: " " }),
|
|
1067
|
-
/* @__PURE__ */ jsxs7(Text7, { color:
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
notice.text
|
|
1056
|
+
/* @__PURE__ */ jsxs7(Text7, { color: PALETTE.error, children: [
|
|
1057
|
+
"\u2717 ",
|
|
1058
|
+
message
|
|
1071
1059
|
] })
|
|
1072
1060
|
] }),
|
|
1073
1061
|
/* @__PURE__ */ jsx7(Text7, { children: " " }),
|
|
1074
|
-
/* @__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" })
|
|
1075
1063
|
] });
|
|
1076
1064
|
}
|
|
1077
1065
|
var FIELD_ORDER, FIELD_LABELS;
|
|
@@ -1081,21 +1069,12 @@ var init_ContentfulConfigScreen = __esm({
|
|
|
1081
1069
|
init_home_theme();
|
|
1082
1070
|
init_config_store();
|
|
1083
1071
|
init_debug_store();
|
|
1084
|
-
FIELD_ORDER = [
|
|
1085
|
-
"spaceId",
|
|
1086
|
-
"environmentId",
|
|
1087
|
-
"cmaToken",
|
|
1088
|
-
"host",
|
|
1089
|
-
"defaultComponentDir",
|
|
1090
|
-
"defaultTokenFile"
|
|
1091
|
-
];
|
|
1072
|
+
FIELD_ORDER = ["spaceId", "environmentId", "cmaToken", "host"];
|
|
1092
1073
|
FIELD_LABELS = {
|
|
1093
1074
|
spaceId: "Space ID",
|
|
1094
1075
|
environmentId: "Environment ID",
|
|
1095
1076
|
cmaToken: "CMA Token",
|
|
1096
|
-
host: "API Host (optional)"
|
|
1097
|
-
defaultComponentDir: "Default component directory (optional)",
|
|
1098
|
-
defaultTokenFile: "Default token file (optional)"
|
|
1077
|
+
host: "API Host (optional)"
|
|
1099
1078
|
};
|
|
1100
1079
|
}
|
|
1101
1080
|
});
|
|
@@ -1321,23 +1300,13 @@ var app_exports = {};
|
|
|
1321
1300
|
__export(app_exports, {
|
|
1322
1301
|
runApp: () => runApp
|
|
1323
1302
|
});
|
|
1324
|
-
import {
|
|
1325
|
-
import {
|
|
1303
|
+
import { useState as useState10 } from "react";
|
|
1304
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
1326
1305
|
function App({ onLaunchImport, importExitCode }) {
|
|
1327
1306
|
const returnedFromImport = importExitCode !== void 0;
|
|
1328
1307
|
const [screen, setScreen] = useState10(returnedFromImport ? "import" : "start");
|
|
1329
1308
|
const [showImportResult, setShowImportResult] = useState10(returnedFromImport);
|
|
1330
1309
|
const [projectPath, setProjectPath] = useState10();
|
|
1331
|
-
const [importDefaults, setImportDefaults] = useState10();
|
|
1332
|
-
useEffect8(() => {
|
|
1333
|
-
if (screen !== "import") {
|
|
1334
|
-
setImportDefaults(void 0);
|
|
1335
|
-
return;
|
|
1336
|
-
}
|
|
1337
|
-
void readCredentials().then(
|
|
1338
|
-
(saved) => setImportDefaults({ componentDir: saved.defaultComponentDir ?? "", tokenFile: saved.defaultTokenFile ?? "" })
|
|
1339
|
-
);
|
|
1340
|
-
}, [screen]);
|
|
1341
1310
|
const goToStart = () => setScreen("start");
|
|
1342
1311
|
const goToSettings = () => setScreen("settings");
|
|
1343
1312
|
const finishImportResult = () => {
|
|
@@ -1352,14 +1321,10 @@ function App({ onLaunchImport, importExitCode }) {
|
|
|
1352
1321
|
switch (screen) {
|
|
1353
1322
|
case "import":
|
|
1354
1323
|
if (showImportResult) return /* @__PURE__ */ jsx11(ImportScreen, { exitCode: importExitCode, onDone: finishImportResult });
|
|
1355
|
-
if (
|
|
1356
|
-
if (projectPath === void 0) {
|
|
1357
|
-
return /* @__PURE__ */ jsx11(WelcomeScreen, { onContinue: setProjectPath, onQuit: leaveImport, initialPath: importDefaults.componentDir });
|
|
1358
|
-
}
|
|
1324
|
+
if (projectPath === void 0) return /* @__PURE__ */ jsx11(WelcomeScreen, { onContinue: setProjectPath, onQuit: leaveImport });
|
|
1359
1325
|
return /* @__PURE__ */ jsx11(
|
|
1360
1326
|
TokenInputScreen,
|
|
1361
1327
|
{
|
|
1362
|
-
initialPath: importDefaults.tokenFile,
|
|
1363
1328
|
onConfirm: (tokens) => onLaunchImport?.({ project: projectPath, tokens }),
|
|
1364
1329
|
onSkip: () => onLaunchImport?.({ project: projectPath }),
|
|
1365
1330
|
onBack: () => setProjectPath(void 0)
|
|
@@ -1422,7 +1387,6 @@ var init_app = __esm({
|
|
|
1422
1387
|
init_screen3();
|
|
1423
1388
|
init_PageContainer4();
|
|
1424
1389
|
init_screen4();
|
|
1425
|
-
init_config_store();
|
|
1426
1390
|
}
|
|
1427
1391
|
});
|
|
1428
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 {};
|