@contentful/experience-design-system-cli 2.35.1-dev-build-beaac232.0 → 2.35.1-dev-build-3eb7b118.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 +43 -15
- package/dist/index.js +43 -15
- package/dist/package.json +1 -1
- package/legacy/package.json +1 -1
- package/package.json +2 -2
package/dist/app.js
CHANGED
|
@@ -756,7 +756,6 @@ function SettingsScreen({
|
|
|
756
756
|
// packages/experience-design-system-cli/src/tui/settings/contentful-configuration/ContentfulConfigScreen.tsx
|
|
757
757
|
import { useEffect as useEffect4, useState as useState6 } from "react";
|
|
758
758
|
import { Box as Box7, Text as Text7, useInput as useInput7 } from "ink";
|
|
759
|
-
import TextInput3 from "ink-text-input";
|
|
760
759
|
|
|
761
760
|
// packages/experience-design-system-cli/src/tui/settings/utils/v1-store.ts
|
|
762
761
|
var readV1Store = readSettings;
|
|
@@ -841,13 +840,13 @@ function ConfigurationScreen({ onDone }) {
|
|
|
841
840
|
if (!config) return;
|
|
842
841
|
setConfig({ ...config, [field]: value });
|
|
843
842
|
}
|
|
844
|
-
function
|
|
843
|
+
function handleSave() {
|
|
845
844
|
if (!config) return;
|
|
846
845
|
setStage("saving");
|
|
847
846
|
setMessage(null);
|
|
848
847
|
writeCredentials(config).then(() => {
|
|
849
|
-
|
|
850
|
-
|
|
848
|
+
setStage("saved");
|
|
849
|
+
setMessage("Configuration saved");
|
|
851
850
|
}).catch((err) => {
|
|
852
851
|
setMessage(err instanceof Error ? err.message : "Failed to save");
|
|
853
852
|
setStage("form");
|
|
@@ -855,15 +854,39 @@ function ConfigurationScreen({ onDone }) {
|
|
|
855
854
|
}
|
|
856
855
|
useInput7((input, key) => {
|
|
857
856
|
if (stage === "loading" || stage === "saving") return;
|
|
857
|
+
if (stage === "saved") {
|
|
858
|
+
if (key.return || key.escape || input === "q") {
|
|
859
|
+
void finishDebugRun({ outputs: debugFields(config), status: "success", exitMethod: "saved" });
|
|
860
|
+
onDone();
|
|
861
|
+
}
|
|
862
|
+
return;
|
|
863
|
+
}
|
|
858
864
|
if (editing) {
|
|
865
|
+
if (key.return) {
|
|
866
|
+
setEditing(false);
|
|
867
|
+
return;
|
|
868
|
+
}
|
|
859
869
|
if (key.escape) {
|
|
860
870
|
setFieldValue(activeField, valueBeforeEdit);
|
|
861
871
|
setEditing(false);
|
|
872
|
+
return;
|
|
873
|
+
}
|
|
874
|
+
if (key.backspace || key.delete) {
|
|
875
|
+
setFieldValue(activeField, fieldValue(activeField).slice(0, -1));
|
|
876
|
+
return;
|
|
877
|
+
}
|
|
878
|
+
if (input && !key.ctrl && !key.meta && !key.tab && !key.upArrow && !key.downArrow) {
|
|
879
|
+
setFieldValue(activeField, fieldValue(activeField) + input);
|
|
862
880
|
}
|
|
863
881
|
return;
|
|
864
882
|
}
|
|
865
883
|
if (key.escape || input === "q") {
|
|
866
|
-
|
|
884
|
+
void finishDebugRun({ outputs: {}, status: "success", exitMethod: "discarded" });
|
|
885
|
+
onDone();
|
|
886
|
+
return;
|
|
887
|
+
}
|
|
888
|
+
if (input === "s") {
|
|
889
|
+
handleSave();
|
|
867
890
|
return;
|
|
868
891
|
}
|
|
869
892
|
if (key.tab || key.downArrow) {
|
|
@@ -888,6 +911,18 @@ function ConfigurationScreen({ onDone }) {
|
|
|
888
911
|
/* @__PURE__ */ jsx7(Text7, { color: PALETTE.accent, children: "Loading..." })
|
|
889
912
|
] });
|
|
890
913
|
}
|
|
914
|
+
if (stage === "saved") {
|
|
915
|
+
return /* @__PURE__ */ jsxs7(Box7, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
916
|
+
/* @__PURE__ */ jsx7(Text7, { bold: true, children: "Configuration" }),
|
|
917
|
+
/* @__PURE__ */ jsx7(Text7, { children: " " }),
|
|
918
|
+
/* @__PURE__ */ jsxs7(Text7, { color: PALETTE.success, children: [
|
|
919
|
+
"\u2713 ",
|
|
920
|
+
message
|
|
921
|
+
] }),
|
|
922
|
+
/* @__PURE__ */ jsx7(Text7, { children: " " }),
|
|
923
|
+
/* @__PURE__ */ jsx7(Text7, { dimColor: true, children: "[Enter] Back to Settings" })
|
|
924
|
+
] });
|
|
925
|
+
}
|
|
891
926
|
return /* @__PURE__ */ jsxs7(Box7, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
892
927
|
/* @__PURE__ */ jsx7(Text7, { bold: true, children: "Configuration" }),
|
|
893
928
|
/* @__PURE__ */ jsx7(Text7, { children: " " }),
|
|
@@ -903,15 +938,8 @@ function ConfigurationScreen({ onDone }) {
|
|
|
903
938
|
FIELD_LABELS[field],
|
|
904
939
|
":"
|
|
905
940
|
] }),
|
|
906
|
-
isActive && editing ? /* @__PURE__ */ jsx7(
|
|
907
|
-
|
|
908
|
-
{
|
|
909
|
-
value,
|
|
910
|
-
onChange: (next) => setFieldValue(field, next),
|
|
911
|
-
onSubmit: () => setEditing(false),
|
|
912
|
-
mask: field === "cmaToken" ? "\u2022" : void 0
|
|
913
|
-
}
|
|
914
|
-
) : /* @__PURE__ */ jsx7(Text7, { children: display || /* @__PURE__ */ jsx7(Text7, { dimColor: true, children: "(empty)" }) })
|
|
941
|
+
/* @__PURE__ */ jsx7(Text7, { children: display || (isActive && editing ? "" : /* @__PURE__ */ jsx7(Text7, { dimColor: true, children: "(empty)" })) }),
|
|
942
|
+
isActive && editing && /* @__PURE__ */ jsx7(Text7, { color: PALETTE.accent, children: "\u258F" })
|
|
915
943
|
] }, field);
|
|
916
944
|
}) }),
|
|
917
945
|
message && /* @__PURE__ */ jsxs7(Fragment, { children: [
|
|
@@ -922,7 +950,7 @@ function ConfigurationScreen({ onDone }) {
|
|
|
922
950
|
] })
|
|
923
951
|
] }),
|
|
924
952
|
/* @__PURE__ */ jsx7(Text7, { children: " " }),
|
|
925
|
-
/* @__PURE__ */ jsx7(Text7, { dimColor: true, children: editing ? "[type] Edit
|
|
953
|
+
/* @__PURE__ */ jsx7(Text7, { dimColor: true, children: editing ? "[type] Edit value \xB7 [Enter] Done \xB7 [Esc] Cancel edit" : "[\u2191/\u2193] Switch field \xB7 [Enter] Edit \xB7 [s] Save \xB7 [Esc/q] Back" })
|
|
926
954
|
] });
|
|
927
955
|
}
|
|
928
956
|
|
package/dist/index.js
CHANGED
|
@@ -933,7 +933,6 @@ var init_config_store = __esm({
|
|
|
933
933
|
// packages/experience-design-system-cli/src/tui/settings/contentful-configuration/ContentfulConfigScreen.tsx
|
|
934
934
|
import { useEffect as useEffect4, useState as useState6 } from "react";
|
|
935
935
|
import { Box as Box7, Text as Text7, useInput as useInput7 } from "ink";
|
|
936
|
-
import TextInput3 from "ink-text-input";
|
|
937
936
|
import { Fragment, jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
938
937
|
function debugFields(config) {
|
|
939
938
|
return {
|
|
@@ -972,13 +971,13 @@ function ConfigurationScreen({ onDone }) {
|
|
|
972
971
|
if (!config) return;
|
|
973
972
|
setConfig({ ...config, [field]: value });
|
|
974
973
|
}
|
|
975
|
-
function
|
|
974
|
+
function handleSave() {
|
|
976
975
|
if (!config) return;
|
|
977
976
|
setStage("saving");
|
|
978
977
|
setMessage(null);
|
|
979
978
|
writeCredentials(config).then(() => {
|
|
980
|
-
|
|
981
|
-
|
|
979
|
+
setStage("saved");
|
|
980
|
+
setMessage("Configuration saved");
|
|
982
981
|
}).catch((err) => {
|
|
983
982
|
setMessage(err instanceof Error ? err.message : "Failed to save");
|
|
984
983
|
setStage("form");
|
|
@@ -986,15 +985,39 @@ function ConfigurationScreen({ onDone }) {
|
|
|
986
985
|
}
|
|
987
986
|
useInput7((input, key) => {
|
|
988
987
|
if (stage === "loading" || stage === "saving") return;
|
|
988
|
+
if (stage === "saved") {
|
|
989
|
+
if (key.return || key.escape || input === "q") {
|
|
990
|
+
void finishDebugRun({ outputs: debugFields(config), status: "success", exitMethod: "saved" });
|
|
991
|
+
onDone();
|
|
992
|
+
}
|
|
993
|
+
return;
|
|
994
|
+
}
|
|
989
995
|
if (editing) {
|
|
996
|
+
if (key.return) {
|
|
997
|
+
setEditing(false);
|
|
998
|
+
return;
|
|
999
|
+
}
|
|
990
1000
|
if (key.escape) {
|
|
991
1001
|
setFieldValue(activeField, valueBeforeEdit);
|
|
992
1002
|
setEditing(false);
|
|
1003
|
+
return;
|
|
1004
|
+
}
|
|
1005
|
+
if (key.backspace || key.delete) {
|
|
1006
|
+
setFieldValue(activeField, fieldValue(activeField).slice(0, -1));
|
|
1007
|
+
return;
|
|
1008
|
+
}
|
|
1009
|
+
if (input && !key.ctrl && !key.meta && !key.tab && !key.upArrow && !key.downArrow) {
|
|
1010
|
+
setFieldValue(activeField, fieldValue(activeField) + input);
|
|
993
1011
|
}
|
|
994
1012
|
return;
|
|
995
1013
|
}
|
|
996
1014
|
if (key.escape || input === "q") {
|
|
997
|
-
|
|
1015
|
+
void finishDebugRun({ outputs: {}, status: "success", exitMethod: "discarded" });
|
|
1016
|
+
onDone();
|
|
1017
|
+
return;
|
|
1018
|
+
}
|
|
1019
|
+
if (input === "s") {
|
|
1020
|
+
handleSave();
|
|
998
1021
|
return;
|
|
999
1022
|
}
|
|
1000
1023
|
if (key.tab || key.downArrow) {
|
|
@@ -1019,6 +1042,18 @@ function ConfigurationScreen({ onDone }) {
|
|
|
1019
1042
|
/* @__PURE__ */ jsx7(Text7, { color: PALETTE.accent, children: "Loading..." })
|
|
1020
1043
|
] });
|
|
1021
1044
|
}
|
|
1045
|
+
if (stage === "saved") {
|
|
1046
|
+
return /* @__PURE__ */ jsxs7(Box7, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
1047
|
+
/* @__PURE__ */ jsx7(Text7, { bold: true, children: "Configuration" }),
|
|
1048
|
+
/* @__PURE__ */ jsx7(Text7, { children: " " }),
|
|
1049
|
+
/* @__PURE__ */ jsxs7(Text7, { color: PALETTE.success, children: [
|
|
1050
|
+
"\u2713 ",
|
|
1051
|
+
message
|
|
1052
|
+
] }),
|
|
1053
|
+
/* @__PURE__ */ jsx7(Text7, { children: " " }),
|
|
1054
|
+
/* @__PURE__ */ jsx7(Text7, { dimColor: true, children: "[Enter] Back to Settings" })
|
|
1055
|
+
] });
|
|
1056
|
+
}
|
|
1022
1057
|
return /* @__PURE__ */ jsxs7(Box7, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
1023
1058
|
/* @__PURE__ */ jsx7(Text7, { bold: true, children: "Configuration" }),
|
|
1024
1059
|
/* @__PURE__ */ jsx7(Text7, { children: " " }),
|
|
@@ -1034,15 +1069,8 @@ function ConfigurationScreen({ onDone }) {
|
|
|
1034
1069
|
FIELD_LABELS[field],
|
|
1035
1070
|
":"
|
|
1036
1071
|
] }),
|
|
1037
|
-
isActive && editing ? /* @__PURE__ */ jsx7(
|
|
1038
|
-
|
|
1039
|
-
{
|
|
1040
|
-
value,
|
|
1041
|
-
onChange: (next) => setFieldValue(field, next),
|
|
1042
|
-
onSubmit: () => setEditing(false),
|
|
1043
|
-
mask: field === "cmaToken" ? "\u2022" : void 0
|
|
1044
|
-
}
|
|
1045
|
-
) : /* @__PURE__ */ jsx7(Text7, { children: display || /* @__PURE__ */ jsx7(Text7, { dimColor: true, children: "(empty)" }) })
|
|
1072
|
+
/* @__PURE__ */ jsx7(Text7, { children: display || (isActive && editing ? "" : /* @__PURE__ */ jsx7(Text7, { dimColor: true, children: "(empty)" })) }),
|
|
1073
|
+
isActive && editing && /* @__PURE__ */ jsx7(Text7, { color: PALETTE.accent, children: "\u258F" })
|
|
1046
1074
|
] }, field);
|
|
1047
1075
|
}) }),
|
|
1048
1076
|
message && /* @__PURE__ */ jsxs7(Fragment, { children: [
|
|
@@ -1053,7 +1081,7 @@ function ConfigurationScreen({ onDone }) {
|
|
|
1053
1081
|
] })
|
|
1054
1082
|
] }),
|
|
1055
1083
|
/* @__PURE__ */ jsx7(Text7, { children: " " }),
|
|
1056
|
-
/* @__PURE__ */ jsx7(Text7, { dimColor: true, children: editing ? "[type] Edit
|
|
1084
|
+
/* @__PURE__ */ jsx7(Text7, { dimColor: true, children: editing ? "[type] Edit value \xB7 [Enter] Done \xB7 [Esc] Cancel edit" : "[\u2191/\u2193] Switch field \xB7 [Enter] Edit \xB7 [s] Save \xB7 [Esc/q] Back" })
|
|
1057
1085
|
] });
|
|
1058
1086
|
}
|
|
1059
1087
|
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-3eb7b118.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-3eb7b118.0"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@tsconfig/node24": "^24.0.4",
|