@contentful/experience-design-system-cli 2.35.1-dev-build-210d1941.0 → 2.35.1-dev-build-61f85bdf.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 +26 -14
- package/dist/index.js +26 -14
- package/dist/package.json +1 -1
- package/legacy/package.json +1 -1
- package/package.json +2 -2
package/dist/app.js
CHANGED
|
@@ -818,7 +818,8 @@ function ConfigurationScreen({ onDone }) {
|
|
|
818
818
|
const [stage, setStage] = useState6("loading");
|
|
819
819
|
const [config, setConfig] = useState6(null);
|
|
820
820
|
const [activeField, setActiveField] = useState6("spaceId");
|
|
821
|
-
const [
|
|
821
|
+
const [notice, setNotice] = useState6(null);
|
|
822
|
+
const [lastSaved, setLastSaved] = useState6(null);
|
|
822
823
|
const [editing, setEditing] = useState6(false);
|
|
823
824
|
const [valueBeforeEdit, setValueBeforeEdit] = useState6("");
|
|
824
825
|
useEffect4(() => {
|
|
@@ -840,19 +841,27 @@ function ConfigurationScreen({ onDone }) {
|
|
|
840
841
|
function setFieldValue(field, value) {
|
|
841
842
|
if (!config) return;
|
|
842
843
|
setConfig({ ...config, [field]: value });
|
|
844
|
+
setNotice(null);
|
|
843
845
|
}
|
|
844
|
-
function
|
|
846
|
+
function handleSave() {
|
|
845
847
|
if (!config) return;
|
|
846
848
|
setStage("saving");
|
|
847
|
-
|
|
849
|
+
setNotice(null);
|
|
848
850
|
writeCredentials(config).then(() => {
|
|
849
|
-
|
|
850
|
-
|
|
851
|
+
setLastSaved(config);
|
|
852
|
+
setNotice({ kind: "success", text: "Configuration saved" });
|
|
853
|
+
setStage("form");
|
|
851
854
|
}).catch((err) => {
|
|
852
|
-
|
|
855
|
+
setNotice({ kind: "error", text: err instanceof Error ? err.message : "Failed to save" });
|
|
853
856
|
setStage("form");
|
|
854
857
|
});
|
|
855
858
|
}
|
|
859
|
+
function quit() {
|
|
860
|
+
void finishDebugRun(
|
|
861
|
+
lastSaved ? { outputs: debugFields(lastSaved), status: "success", exitMethod: "saved" } : { outputs: {}, status: "success", exitMethod: "discarded" }
|
|
862
|
+
);
|
|
863
|
+
onDone();
|
|
864
|
+
}
|
|
856
865
|
useInput7((input, key) => {
|
|
857
866
|
if (stage === "loading" || stage === "saving") return;
|
|
858
867
|
if (editing) {
|
|
@@ -863,7 +872,11 @@ function ConfigurationScreen({ onDone }) {
|
|
|
863
872
|
return;
|
|
864
873
|
}
|
|
865
874
|
if (key.escape || input === "q") {
|
|
866
|
-
|
|
875
|
+
quit();
|
|
876
|
+
return;
|
|
877
|
+
}
|
|
878
|
+
if (input === "s") {
|
|
879
|
+
handleSave();
|
|
867
880
|
return;
|
|
868
881
|
}
|
|
869
882
|
if (input === "c") {
|
|
@@ -895,8 +908,6 @@ function ConfigurationScreen({ onDone }) {
|
|
|
895
908
|
return /* @__PURE__ */ jsxs7(Box7, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
896
909
|
/* @__PURE__ */ jsx7(Text7, { bold: true, children: "Configuration" }),
|
|
897
910
|
/* @__PURE__ */ jsx7(Text7, { children: " " }),
|
|
898
|
-
/* @__PURE__ */ jsx7(Text7, { children: "Contentful API Credentials" }),
|
|
899
|
-
/* @__PURE__ */ jsx7(Text7, { children: " " }),
|
|
900
911
|
/* @__PURE__ */ jsx7(Box7, { flexDirection: "column", children: FIELD_ORDER.map((field) => {
|
|
901
912
|
const isActive = activeField === field;
|
|
902
913
|
const value = fieldValue(field);
|
|
@@ -918,15 +929,16 @@ function ConfigurationScreen({ onDone }) {
|
|
|
918
929
|
) : /* @__PURE__ */ jsx7(Text7, { children: display || /* @__PURE__ */ jsx7(Text7, { dimColor: true, children: "(empty)" }) })
|
|
919
930
|
] }, field);
|
|
920
931
|
}) }),
|
|
921
|
-
|
|
932
|
+
notice && /* @__PURE__ */ jsxs7(Fragment, { children: [
|
|
922
933
|
/* @__PURE__ */ jsx7(Text7, { children: " " }),
|
|
923
|
-
/* @__PURE__ */ jsxs7(Text7, { color: PALETTE.error, children: [
|
|
924
|
-
"\
|
|
925
|
-
|
|
934
|
+
/* @__PURE__ */ jsxs7(Text7, { color: notice.kind === "success" ? PALETTE.success : PALETTE.error, children: [
|
|
935
|
+
notice.kind === "success" ? "\u2713" : "\u2717",
|
|
936
|
+
" ",
|
|
937
|
+
notice.text
|
|
926
938
|
] })
|
|
927
939
|
] }),
|
|
928
940
|
/* @__PURE__ */ jsx7(Text7, { children: " " }),
|
|
929
|
-
/* @__PURE__ */ jsx7(Text7, { dimColor: true, children: editing ? "[type] Edit \xB7 [\u2190/\u2192] Move cursor \xB7 [Enter] Done \xB7 [Esc] Cancel edit" : "[\u2191/\u2193] Switch field \xB7 [Enter] Edit \xB7 [c] Clear field \xB7 [Esc/q]
|
|
941
|
+
/* @__PURE__ */ jsx7(Text7, { dimColor: true, children: editing ? "[type] Edit \xB7 [\u2190/\u2192] Move cursor \xB7 [Enter] Done \xB7 [Esc] Cancel edit" : "[\u2191/\u2193] Switch field \xB7 [Enter] Edit \xB7 [c] Clear field \xB7 [s] Save \xB7 [Esc/q] Quit without saving" })
|
|
930
942
|
] });
|
|
931
943
|
}
|
|
932
944
|
|
package/dist/index.js
CHANGED
|
@@ -949,7 +949,8 @@ function ConfigurationScreen({ onDone }) {
|
|
|
949
949
|
const [stage, setStage] = useState6("loading");
|
|
950
950
|
const [config, setConfig] = useState6(null);
|
|
951
951
|
const [activeField, setActiveField] = useState6("spaceId");
|
|
952
|
-
const [
|
|
952
|
+
const [notice, setNotice] = useState6(null);
|
|
953
|
+
const [lastSaved, setLastSaved] = useState6(null);
|
|
953
954
|
const [editing, setEditing] = useState6(false);
|
|
954
955
|
const [valueBeforeEdit, setValueBeforeEdit] = useState6("");
|
|
955
956
|
useEffect4(() => {
|
|
@@ -971,19 +972,27 @@ function ConfigurationScreen({ onDone }) {
|
|
|
971
972
|
function setFieldValue(field, value) {
|
|
972
973
|
if (!config) return;
|
|
973
974
|
setConfig({ ...config, [field]: value });
|
|
975
|
+
setNotice(null);
|
|
974
976
|
}
|
|
975
|
-
function
|
|
977
|
+
function handleSave() {
|
|
976
978
|
if (!config) return;
|
|
977
979
|
setStage("saving");
|
|
978
|
-
|
|
980
|
+
setNotice(null);
|
|
979
981
|
writeCredentials(config).then(() => {
|
|
980
|
-
|
|
981
|
-
|
|
982
|
+
setLastSaved(config);
|
|
983
|
+
setNotice({ kind: "success", text: "Configuration saved" });
|
|
984
|
+
setStage("form");
|
|
982
985
|
}).catch((err) => {
|
|
983
|
-
|
|
986
|
+
setNotice({ kind: "error", text: err instanceof Error ? err.message : "Failed to save" });
|
|
984
987
|
setStage("form");
|
|
985
988
|
});
|
|
986
989
|
}
|
|
990
|
+
function quit() {
|
|
991
|
+
void finishDebugRun(
|
|
992
|
+
lastSaved ? { outputs: debugFields(lastSaved), status: "success", exitMethod: "saved" } : { outputs: {}, status: "success", exitMethod: "discarded" }
|
|
993
|
+
);
|
|
994
|
+
onDone();
|
|
995
|
+
}
|
|
987
996
|
useInput7((input, key) => {
|
|
988
997
|
if (stage === "loading" || stage === "saving") return;
|
|
989
998
|
if (editing) {
|
|
@@ -994,7 +1003,11 @@ function ConfigurationScreen({ onDone }) {
|
|
|
994
1003
|
return;
|
|
995
1004
|
}
|
|
996
1005
|
if (key.escape || input === "q") {
|
|
997
|
-
|
|
1006
|
+
quit();
|
|
1007
|
+
return;
|
|
1008
|
+
}
|
|
1009
|
+
if (input === "s") {
|
|
1010
|
+
handleSave();
|
|
998
1011
|
return;
|
|
999
1012
|
}
|
|
1000
1013
|
if (input === "c") {
|
|
@@ -1026,8 +1039,6 @@ function ConfigurationScreen({ onDone }) {
|
|
|
1026
1039
|
return /* @__PURE__ */ jsxs7(Box7, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
1027
1040
|
/* @__PURE__ */ jsx7(Text7, { bold: true, children: "Configuration" }),
|
|
1028
1041
|
/* @__PURE__ */ jsx7(Text7, { children: " " }),
|
|
1029
|
-
/* @__PURE__ */ jsx7(Text7, { children: "Contentful API Credentials" }),
|
|
1030
|
-
/* @__PURE__ */ jsx7(Text7, { children: " " }),
|
|
1031
1042
|
/* @__PURE__ */ jsx7(Box7, { flexDirection: "column", children: FIELD_ORDER.map((field) => {
|
|
1032
1043
|
const isActive = activeField === field;
|
|
1033
1044
|
const value = fieldValue(field);
|
|
@@ -1049,15 +1060,16 @@ function ConfigurationScreen({ onDone }) {
|
|
|
1049
1060
|
) : /* @__PURE__ */ jsx7(Text7, { children: display || /* @__PURE__ */ jsx7(Text7, { dimColor: true, children: "(empty)" }) })
|
|
1050
1061
|
] }, field);
|
|
1051
1062
|
}) }),
|
|
1052
|
-
|
|
1063
|
+
notice && /* @__PURE__ */ jsxs7(Fragment, { children: [
|
|
1053
1064
|
/* @__PURE__ */ jsx7(Text7, { children: " " }),
|
|
1054
|
-
/* @__PURE__ */ jsxs7(Text7, { color: PALETTE.error, children: [
|
|
1055
|
-
"\
|
|
1056
|
-
|
|
1065
|
+
/* @__PURE__ */ jsxs7(Text7, { color: notice.kind === "success" ? PALETTE.success : PALETTE.error, children: [
|
|
1066
|
+
notice.kind === "success" ? "\u2713" : "\u2717",
|
|
1067
|
+
" ",
|
|
1068
|
+
notice.text
|
|
1057
1069
|
] })
|
|
1058
1070
|
] }),
|
|
1059
1071
|
/* @__PURE__ */ jsx7(Text7, { children: " " }),
|
|
1060
|
-
/* @__PURE__ */ jsx7(Text7, { dimColor: true, children: editing ? "[type] Edit \xB7 [\u2190/\u2192] Move cursor \xB7 [Enter] Done \xB7 [Esc] Cancel edit" : "[\u2191/\u2193] Switch field \xB7 [Enter] Edit \xB7 [c] Clear field \xB7 [Esc/q]
|
|
1072
|
+
/* @__PURE__ */ jsx7(Text7, { dimColor: true, children: editing ? "[type] Edit \xB7 [\u2190/\u2192] Move cursor \xB7 [Enter] Done \xB7 [Esc] Cancel edit" : "[\u2191/\u2193] Switch field \xB7 [Enter] Edit \xB7 [c] Clear field \xB7 [s] Save \xB7 [Esc/q] Quit without saving" })
|
|
1061
1073
|
] });
|
|
1062
1074
|
}
|
|
1063
1075
|
var FIELD_ORDER, FIELD_LABELS;
|
package/dist/package.json
CHANGED
package/legacy/package.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentful/experience-design-system-cli",
|
|
3
|
-
"version": "2.35.1-dev-build-
|
|
3
|
+
"version": "2.35.1-dev-build-61f85bdf.0",
|
|
4
4
|
"description": "Contentful Experiences design system import CLI",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"svelte": "^5.56.4",
|
|
43
43
|
"ts-morph": "^27.0.2",
|
|
44
44
|
"typescript": "^5.9.3",
|
|
45
|
-
"@contentful/experience-design-system-types": "2.35.1-dev-build-
|
|
45
|
+
"@contentful/experience-design-system-types": "2.35.1-dev-build-61f85bdf.0"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@tsconfig/node24": "^24.0.4",
|