@contentful/experience-design-system-cli 2.36.2-dev-build-dc6fb2aa.0 → 2.36.2-dev-build-4fe2ee93.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 +73 -35
- package/dist/index.js +84 -35
- package/dist/package.json +1 -1
- package/dist/src/tui/debug-store.d.ts +1 -0
- package/dist/src/tui/help/help-info.d.ts +9 -0
- 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 { useEffect as useEffect8, useState as
|
|
2
|
+
import { useEffect as useEffect8, useState as useState11 } 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";
|
|
@@ -493,7 +493,7 @@ function startReadingTerminal() {
|
|
|
493
493
|
}
|
|
494
494
|
|
|
495
495
|
// packages/experience-design-system-cli/src/tui/help/PageContainer.tsx
|
|
496
|
-
import { useEffect as useEffect3 } from "react";
|
|
496
|
+
import { useEffect as useEffect3, useState as useState5 } from "react";
|
|
497
497
|
import { Box as Box5, Text as Text5, useInput as useInput5 } from "ink";
|
|
498
498
|
|
|
499
499
|
// packages/experience-design-system-cli/src/tui/debug-store.ts
|
|
@@ -571,6 +571,9 @@ var SESSION_ID = generateSessionId();
|
|
|
571
571
|
function sessionDebugDir() {
|
|
572
572
|
return join5(debugSessionsDir(), SESSION_ID);
|
|
573
573
|
}
|
|
574
|
+
function currentDebugSessionDir() {
|
|
575
|
+
return sessionDebugDir();
|
|
576
|
+
}
|
|
574
577
|
void isDebugModeEnabled().then((enabled) => {
|
|
575
578
|
if (!enabled) return void 0;
|
|
576
579
|
return mkdir2(sessionDebugDir(), { recursive: true });
|
|
@@ -678,11 +681,44 @@ process.once("SIGINT", () => {
|
|
|
678
681
|
});
|
|
679
682
|
});
|
|
680
683
|
|
|
684
|
+
// packages/experience-design-system-cli/src/tui/help/help-info.ts
|
|
685
|
+
async function readHelpInfo() {
|
|
686
|
+
const debugMode = await readDebugModeSetting();
|
|
687
|
+
return {
|
|
688
|
+
storage: [
|
|
689
|
+
{ label: "Config folder", value: configRoot() },
|
|
690
|
+
{ label: "Settings file", value: configFilePath() },
|
|
691
|
+
{ label: "Debug logs", value: debugSessionsDir() }
|
|
692
|
+
],
|
|
693
|
+
troubleshooting: [
|
|
694
|
+
{ label: "CLI version", value: readPackageVersion() },
|
|
695
|
+
{ label: "Node", value: process.version },
|
|
696
|
+
{ label: "Platform", value: `${process.platform} ${process.arch}` },
|
|
697
|
+
{ label: "Debug Mode", value: debugMode.enabled ? "on" : "off" },
|
|
698
|
+
{
|
|
699
|
+
label: "This session",
|
|
700
|
+
value: debugMode.enabled ? currentDebugSessionDir() : "no logs written while Debug Mode is off"
|
|
701
|
+
}
|
|
702
|
+
]
|
|
703
|
+
};
|
|
704
|
+
}
|
|
705
|
+
|
|
681
706
|
// packages/experience-design-system-cli/src/tui/help/PageContainer.tsx
|
|
682
|
-
import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
707
|
+
import { Fragment, jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
708
|
+
function Section({ title, rows }) {
|
|
709
|
+
return /* @__PURE__ */ jsxs5(Box5, { flexDirection: "column", children: [
|
|
710
|
+
/* @__PURE__ */ jsx5(Text5, { bold: true, color: PALETTE.accent, children: title }),
|
|
711
|
+
rows.map((row) => /* @__PURE__ */ jsxs5(Box5, { gap: 1, children: [
|
|
712
|
+
/* @__PURE__ */ jsx5(Box5, { width: 14, flexShrink: 0, children: /* @__PURE__ */ jsx5(Text5, { dimColor: true, children: row.label }) }),
|
|
713
|
+
/* @__PURE__ */ jsx5(Text5, { children: row.value })
|
|
714
|
+
] }, row.label))
|
|
715
|
+
] });
|
|
716
|
+
}
|
|
683
717
|
function HelpScreen({ onDone }) {
|
|
718
|
+
const [info, setInfo] = useState5();
|
|
684
719
|
useEffect3(() => {
|
|
685
720
|
startDebugRun({ flow: "help", step: "01-help", menuOption: "Help", inputs: {} });
|
|
721
|
+
void readHelpInfo().then(setInfo);
|
|
686
722
|
}, []);
|
|
687
723
|
const leave = (exitMethod) => {
|
|
688
724
|
void finishDebugRun({ outputs: {}, status: "success", exitMethod });
|
|
@@ -698,24 +734,26 @@ function HelpScreen({ onDone }) {
|
|
|
698
734
|
return;
|
|
699
735
|
}
|
|
700
736
|
});
|
|
701
|
-
return /* @__PURE__ */ jsxs5(Box5, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
737
|
+
return /* @__PURE__ */ jsxs5(Box5, { flexDirection: "column", paddingX: 2, paddingY: 1, gap: 1, children: [
|
|
702
738
|
/* @__PURE__ */ jsx5(Text5, { bold: true, children: "Help" }),
|
|
703
|
-
/* @__PURE__ */
|
|
704
|
-
|
|
705
|
-
|
|
739
|
+
info ? /* @__PURE__ */ jsxs5(Fragment, { children: [
|
|
740
|
+
/* @__PURE__ */ jsx5(Section, { title: "Where things are stored", rows: info.storage }),
|
|
741
|
+
/* @__PURE__ */ jsx5(Section, { title: "Troubleshooting", rows: info.troubleshooting }),
|
|
742
|
+
/* @__PURE__ */ jsx5(Text5, { dimColor: true, children: "Hit a problem? Turn on Debug Mode in Settings, reproduce it, then share the session folder above. The CMA token is redacted from those logs." })
|
|
743
|
+
] }) : /* @__PURE__ */ jsx5(Text5, { color: PALETTE.accent, children: "Loading..." }),
|
|
706
744
|
/* @__PURE__ */ jsx5(Text5, { dimColor: true, children: "[Enter] Complete [Esc/q] Exit \u2014 both return to Start" })
|
|
707
745
|
] });
|
|
708
746
|
}
|
|
709
747
|
|
|
710
748
|
// packages/experience-design-system-cli/src/tui/settings/PageContainer.tsx
|
|
711
|
-
import { useState as
|
|
749
|
+
import { useState as useState6 } from "react";
|
|
712
750
|
import { Box as Box6, Text as Text6, useInput as useInput6 } from "ink";
|
|
713
751
|
import { jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
714
752
|
function SettingsScreen({
|
|
715
753
|
onNavigate,
|
|
716
754
|
onBack
|
|
717
755
|
}) {
|
|
718
|
-
const [focusIdx, setFocusIdx] =
|
|
756
|
+
const [focusIdx, setFocusIdx] = useState6(0);
|
|
719
757
|
const items = [
|
|
720
758
|
{ label: "Configuration", screen: "settings-configuration" },
|
|
721
759
|
{ label: "Opt-in Analytics", screen: "settings-opt-in-analytics" },
|
|
@@ -754,7 +792,7 @@ function SettingsScreen({
|
|
|
754
792
|
}
|
|
755
793
|
|
|
756
794
|
// packages/experience-design-system-cli/src/tui/settings/contentful-configuration/ContentfulConfigScreen.tsx
|
|
757
|
-
import { useEffect as useEffect4, useState as
|
|
795
|
+
import { useEffect as useEffect4, useState as useState7 } from "react";
|
|
758
796
|
import { Box as Box7, Text as Text7, useInput as useInput7 } from "ink";
|
|
759
797
|
import TextInput3 from "ink-text-input";
|
|
760
798
|
|
|
@@ -787,7 +825,7 @@ async function writeCredentials(config) {
|
|
|
787
825
|
}
|
|
788
826
|
|
|
789
827
|
// packages/experience-design-system-cli/src/tui/settings/contentful-configuration/ContentfulConfigScreen.tsx
|
|
790
|
-
import { Fragment, jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
828
|
+
import { Fragment as Fragment2, jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
791
829
|
var FIELD_ORDER = [
|
|
792
830
|
"spaceId",
|
|
793
831
|
"environmentId",
|
|
@@ -815,13 +853,13 @@ var FIELD_LABELS = {
|
|
|
815
853
|
defaultTokenFile: "Default token file (optional)"
|
|
816
854
|
};
|
|
817
855
|
function ConfigurationScreen({ onDone }) {
|
|
818
|
-
const [stage, setStage] =
|
|
819
|
-
const [config, setConfig] =
|
|
820
|
-
const [activeField, setActiveField] =
|
|
821
|
-
const [notice, setNotice] =
|
|
822
|
-
const [lastSaved, setLastSaved] =
|
|
823
|
-
const [editing, setEditing] =
|
|
824
|
-
const [valueBeforeEdit, setValueBeforeEdit] =
|
|
856
|
+
const [stage, setStage] = useState7("loading");
|
|
857
|
+
const [config, setConfig] = useState7(null);
|
|
858
|
+
const [activeField, setActiveField] = useState7("spaceId");
|
|
859
|
+
const [notice, setNotice] = useState7(null);
|
|
860
|
+
const [lastSaved, setLastSaved] = useState7(null);
|
|
861
|
+
const [editing, setEditing] = useState7(false);
|
|
862
|
+
const [valueBeforeEdit, setValueBeforeEdit] = useState7("");
|
|
825
863
|
useEffect4(() => {
|
|
826
864
|
readCredentials().then((cfg) => {
|
|
827
865
|
setConfig(cfg);
|
|
@@ -929,7 +967,7 @@ function ConfigurationScreen({ onDone }) {
|
|
|
929
967
|
) : /* @__PURE__ */ jsx7(Text7, { children: display || /* @__PURE__ */ jsx7(Text7, { dimColor: true, children: "(empty)" }) })
|
|
930
968
|
] }, field);
|
|
931
969
|
}) }),
|
|
932
|
-
notice && /* @__PURE__ */ jsxs7(
|
|
970
|
+
notice && /* @__PURE__ */ jsxs7(Fragment2, { children: [
|
|
933
971
|
/* @__PURE__ */ jsx7(Text7, { children: " " }),
|
|
934
972
|
/* @__PURE__ */ jsxs7(Text7, { color: notice.kind === "success" ? PALETTE.success : PALETTE.error, children: [
|
|
935
973
|
notice.kind === "success" ? "\u2713" : "\u2717",
|
|
@@ -943,7 +981,7 @@ function ConfigurationScreen({ onDone }) {
|
|
|
943
981
|
}
|
|
944
982
|
|
|
945
983
|
// packages/experience-design-system-cli/src/tui/settings/opt-in-analytics/screen.tsx
|
|
946
|
-
import { useEffect as useEffect5, useState as
|
|
984
|
+
import { useEffect as useEffect5, useState as useState8 } from "react";
|
|
947
985
|
import { Box as Box8, Text as Text8, useInput as useInput8 } from "ink";
|
|
948
986
|
|
|
949
987
|
// packages/experience-design-system-cli/src/tui/settings/opt-in-analytics/analytics-store.ts
|
|
@@ -962,10 +1000,10 @@ async function writeAnalyticsSetting(setting) {
|
|
|
962
1000
|
}
|
|
963
1001
|
|
|
964
1002
|
// packages/experience-design-system-cli/src/tui/settings/opt-in-analytics/screen.tsx
|
|
965
|
-
import { Fragment as
|
|
1003
|
+
import { Fragment as Fragment3, jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
966
1004
|
function OptInAnalyticsScreen({ onDone }) {
|
|
967
|
-
const [loading, setLoading] =
|
|
968
|
-
const [enabled, setEnabled] =
|
|
1005
|
+
const [loading, setLoading] = useState8(true);
|
|
1006
|
+
const [enabled, setEnabled] = useState8(true);
|
|
969
1007
|
useEffect5(() => {
|
|
970
1008
|
readAnalyticsSetting().then((setting) => {
|
|
971
1009
|
setEnabled(setting.enabled);
|
|
@@ -996,7 +1034,7 @@ function OptInAnalyticsScreen({ onDone }) {
|
|
|
996
1034
|
return /* @__PURE__ */ jsxs8(Box8, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
997
1035
|
/* @__PURE__ */ jsx8(Text8, { bold: true, children: "Settings \u203A Opt-in Analytics" }),
|
|
998
1036
|
/* @__PURE__ */ jsx8(Text8, { children: " " }),
|
|
999
|
-
loading ? /* @__PURE__ */ jsx8(Text8, { color: PALETTE.muted, children: "Loading\u2026" }) : /* @__PURE__ */ jsxs8(
|
|
1037
|
+
loading ? /* @__PURE__ */ jsx8(Text8, { color: PALETTE.muted, children: "Loading\u2026" }) : /* @__PURE__ */ jsxs8(Fragment3, { children: [
|
|
1000
1038
|
/* @__PURE__ */ jsxs8(Text8, { children: [
|
|
1001
1039
|
"Share anonymous usage data:",
|
|
1002
1040
|
" ",
|
|
@@ -1012,12 +1050,12 @@ function OptInAnalyticsScreen({ onDone }) {
|
|
|
1012
1050
|
}
|
|
1013
1051
|
|
|
1014
1052
|
// packages/experience-design-system-cli/src/tui/upgrade/PageContainer.tsx
|
|
1015
|
-
import { useEffect as useEffect6, useState as
|
|
1053
|
+
import { useEffect as useEffect6, useState as useState9 } from "react";
|
|
1016
1054
|
import { Box as Box9, Text as Text9, useInput as useInput9 } from "ink";
|
|
1017
1055
|
import { jsx as jsx9, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1018
1056
|
var UPGRADE_COMMANDS = ["git pull", "pnpm install", "pnpm build"];
|
|
1019
1057
|
function UpgradeScreen({ onDone }) {
|
|
1020
|
-
const [upgradeCheck, setUpgradeCheck] =
|
|
1058
|
+
const [upgradeCheck, setUpgradeCheck] = useState9();
|
|
1021
1059
|
useEffect6(() => {
|
|
1022
1060
|
startDebugRun({
|
|
1023
1061
|
flow: "upgrade",
|
|
@@ -1083,12 +1121,12 @@ function renderBody(upgradeCheck) {
|
|
|
1083
1121
|
}
|
|
1084
1122
|
|
|
1085
1123
|
// packages/experience-design-system-cli/src/tui/settings/debug-mode/screen.tsx
|
|
1086
|
-
import { useEffect as useEffect7, useState as
|
|
1124
|
+
import { useEffect as useEffect7, useState as useState10 } from "react";
|
|
1087
1125
|
import { Box as Box10, Text as Text10, useInput as useInput10 } from "ink";
|
|
1088
1126
|
import { jsx as jsx10, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1089
1127
|
function DebugModeScreen({ onDone }) {
|
|
1090
|
-
const [loading, setLoading] =
|
|
1091
|
-
const [enabled, setEnabled] =
|
|
1128
|
+
const [loading, setLoading] = useState10(true);
|
|
1129
|
+
const [enabled, setEnabled] = useState10(true);
|
|
1092
1130
|
useEffect7(() => {
|
|
1093
1131
|
readDebugModeSetting().then((setting) => {
|
|
1094
1132
|
setEnabled(setting.enabled);
|
|
@@ -1130,13 +1168,13 @@ function DebugModeScreen({ onDone }) {
|
|
|
1130
1168
|
}
|
|
1131
1169
|
|
|
1132
1170
|
// packages/experience-design-system-cli/app.tsx
|
|
1133
|
-
import { Fragment as
|
|
1171
|
+
import { Fragment as Fragment4, jsx as jsx11 } from "react/jsx-runtime";
|
|
1134
1172
|
function App({ onLaunchImport, importExitCode }) {
|
|
1135
1173
|
const returnedFromImport = importExitCode !== void 0;
|
|
1136
|
-
const [screen, setScreen] =
|
|
1137
|
-
const [showImportResult, setShowImportResult] =
|
|
1138
|
-
const [projectPath, setProjectPath] =
|
|
1139
|
-
const [importDefaults, setImportDefaults] =
|
|
1174
|
+
const [screen, setScreen] = useState11(returnedFromImport ? "import" : "start");
|
|
1175
|
+
const [showImportResult, setShowImportResult] = useState11(returnedFromImport);
|
|
1176
|
+
const [projectPath, setProjectPath] = useState11();
|
|
1177
|
+
const [importDefaults, setImportDefaults] = useState11();
|
|
1140
1178
|
useEffect8(() => {
|
|
1141
1179
|
if (screen !== "import") {
|
|
1142
1180
|
setImportDefaults(void 0);
|
|
@@ -1160,7 +1198,7 @@ function App({ onLaunchImport, importExitCode }) {
|
|
|
1160
1198
|
switch (screen) {
|
|
1161
1199
|
case "import":
|
|
1162
1200
|
if (showImportResult) return /* @__PURE__ */ jsx11(ImportScreen, { exitCode: importExitCode, onDone: finishImportResult });
|
|
1163
|
-
if (importDefaults === void 0) return /* @__PURE__ */ jsx11(
|
|
1201
|
+
if (importDefaults === void 0) return /* @__PURE__ */ jsx11(Fragment4, {});
|
|
1164
1202
|
if (projectPath === void 0) {
|
|
1165
1203
|
return /* @__PURE__ */ jsx11(WelcomeScreen, { onContinue: setProjectPath, onQuit: leaveImport, initialPath: importDefaults.componentDir });
|
|
1166
1204
|
}
|
package/dist/index.js
CHANGED
|
@@ -684,6 +684,9 @@ function generateSessionId() {
|
|
|
684
684
|
function sessionDebugDir() {
|
|
685
685
|
return join5(debugSessionsDir(), SESSION_ID);
|
|
686
686
|
}
|
|
687
|
+
function currentDebugSessionDir() {
|
|
688
|
+
return sessionDebugDir();
|
|
689
|
+
}
|
|
687
690
|
async function isDebugModeEnabled() {
|
|
688
691
|
try {
|
|
689
692
|
return (await readDebugModeSetting()).enabled;
|
|
@@ -801,13 +804,55 @@ var init_debug_store = __esm({
|
|
|
801
804
|
}
|
|
802
805
|
});
|
|
803
806
|
|
|
807
|
+
// packages/experience-design-system-cli/src/tui/help/help-info.ts
|
|
808
|
+
async function readHelpInfo() {
|
|
809
|
+
const debugMode = await readDebugModeSetting();
|
|
810
|
+
return {
|
|
811
|
+
storage: [
|
|
812
|
+
{ label: "Config folder", value: configRoot() },
|
|
813
|
+
{ label: "Settings file", value: configFilePath() },
|
|
814
|
+
{ label: "Debug logs", value: debugSessionsDir() }
|
|
815
|
+
],
|
|
816
|
+
troubleshooting: [
|
|
817
|
+
{ label: "CLI version", value: readPackageVersion() },
|
|
818
|
+
{ label: "Node", value: process.version },
|
|
819
|
+
{ label: "Platform", value: `${process.platform} ${process.arch}` },
|
|
820
|
+
{ label: "Debug Mode", value: debugMode.enabled ? "on" : "off" },
|
|
821
|
+
{
|
|
822
|
+
label: "This session",
|
|
823
|
+
value: debugMode.enabled ? currentDebugSessionDir() : "no logs written while Debug Mode is off"
|
|
824
|
+
}
|
|
825
|
+
]
|
|
826
|
+
};
|
|
827
|
+
}
|
|
828
|
+
var init_help_info = __esm({
|
|
829
|
+
"packages/experience-design-system-cli/src/tui/help/help-info.ts"() {
|
|
830
|
+
"use strict";
|
|
831
|
+
init_config();
|
|
832
|
+
init_debug_store();
|
|
833
|
+
init_debug_mode_store();
|
|
834
|
+
init_version();
|
|
835
|
+
}
|
|
836
|
+
});
|
|
837
|
+
|
|
804
838
|
// packages/experience-design-system-cli/src/tui/help/PageContainer.tsx
|
|
805
|
-
import { useEffect as useEffect3 } from "react";
|
|
839
|
+
import { useEffect as useEffect3, useState as useState5 } from "react";
|
|
806
840
|
import { Box as Box5, Text as Text5, useInput as useInput5 } from "ink";
|
|
807
|
-
import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
841
|
+
import { Fragment, jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
842
|
+
function Section({ title, rows }) {
|
|
843
|
+
return /* @__PURE__ */ jsxs5(Box5, { flexDirection: "column", children: [
|
|
844
|
+
/* @__PURE__ */ jsx5(Text5, { bold: true, color: PALETTE.accent, children: title }),
|
|
845
|
+
rows.map((row) => /* @__PURE__ */ jsxs5(Box5, { gap: 1, children: [
|
|
846
|
+
/* @__PURE__ */ jsx5(Box5, { width: 14, flexShrink: 0, children: /* @__PURE__ */ jsx5(Text5, { dimColor: true, children: row.label }) }),
|
|
847
|
+
/* @__PURE__ */ jsx5(Text5, { children: row.value })
|
|
848
|
+
] }, row.label))
|
|
849
|
+
] });
|
|
850
|
+
}
|
|
808
851
|
function HelpScreen({ onDone }) {
|
|
852
|
+
const [info, setInfo] = useState5();
|
|
809
853
|
useEffect3(() => {
|
|
810
854
|
startDebugRun({ flow: "help", step: "01-help", menuOption: "Help", inputs: {} });
|
|
855
|
+
void readHelpInfo().then(setInfo);
|
|
811
856
|
}, []);
|
|
812
857
|
const leave = (exitMethod) => {
|
|
813
858
|
void finishDebugRun({ outputs: {}, status: "success", exitMethod });
|
|
@@ -823,30 +868,34 @@ function HelpScreen({ onDone }) {
|
|
|
823
868
|
return;
|
|
824
869
|
}
|
|
825
870
|
});
|
|
826
|
-
return /* @__PURE__ */ jsxs5(Box5, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
871
|
+
return /* @__PURE__ */ jsxs5(Box5, { flexDirection: "column", paddingX: 2, paddingY: 1, gap: 1, children: [
|
|
827
872
|
/* @__PURE__ */ jsx5(Text5, { bold: true, children: "Help" }),
|
|
828
|
-
/* @__PURE__ */
|
|
829
|
-
|
|
830
|
-
|
|
873
|
+
info ? /* @__PURE__ */ jsxs5(Fragment, { children: [
|
|
874
|
+
/* @__PURE__ */ jsx5(Section, { title: "Where things are stored", rows: info.storage }),
|
|
875
|
+
/* @__PURE__ */ jsx5(Section, { title: "Troubleshooting", rows: info.troubleshooting }),
|
|
876
|
+
/* @__PURE__ */ jsx5(Text5, { dimColor: true, children: "Hit a problem? Turn on Debug Mode in Settings, reproduce it, then share the session folder above. The CMA token is redacted from those logs." })
|
|
877
|
+
] }) : /* @__PURE__ */ jsx5(Text5, { color: PALETTE.accent, children: "Loading..." }),
|
|
831
878
|
/* @__PURE__ */ jsx5(Text5, { dimColor: true, children: "[Enter] Complete [Esc/q] Exit \u2014 both return to Start" })
|
|
832
879
|
] });
|
|
833
880
|
}
|
|
834
881
|
var init_PageContainer2 = __esm({
|
|
835
882
|
"packages/experience-design-system-cli/src/tui/help/PageContainer.tsx"() {
|
|
836
883
|
"use strict";
|
|
884
|
+
init_home_theme();
|
|
837
885
|
init_debug_store();
|
|
886
|
+
init_help_info();
|
|
838
887
|
}
|
|
839
888
|
});
|
|
840
889
|
|
|
841
890
|
// packages/experience-design-system-cli/src/tui/settings/PageContainer.tsx
|
|
842
|
-
import { useState as
|
|
891
|
+
import { useState as useState6 } from "react";
|
|
843
892
|
import { Box as Box6, Text as Text6, useInput as useInput6 } from "ink";
|
|
844
893
|
import { jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
845
894
|
function SettingsScreen({
|
|
846
895
|
onNavigate,
|
|
847
896
|
onBack
|
|
848
897
|
}) {
|
|
849
|
-
const [focusIdx, setFocusIdx] =
|
|
898
|
+
const [focusIdx, setFocusIdx] = useState6(0);
|
|
850
899
|
const items = [
|
|
851
900
|
{ label: "Configuration", screen: "settings-configuration" },
|
|
852
901
|
{ label: "Opt-in Analytics", screen: "settings-opt-in-analytics" },
|
|
@@ -931,10 +980,10 @@ var init_config_store = __esm({
|
|
|
931
980
|
});
|
|
932
981
|
|
|
933
982
|
// packages/experience-design-system-cli/src/tui/settings/contentful-configuration/ContentfulConfigScreen.tsx
|
|
934
|
-
import { useEffect as useEffect4, useState as
|
|
983
|
+
import { useEffect as useEffect4, useState as useState7 } from "react";
|
|
935
984
|
import { Box as Box7, Text as Text7, useInput as useInput7 } from "ink";
|
|
936
985
|
import TextInput3 from "ink-text-input";
|
|
937
|
-
import { Fragment, jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
986
|
+
import { Fragment as Fragment2, jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
938
987
|
function debugFields(config) {
|
|
939
988
|
return {
|
|
940
989
|
space_id: config?.spaceId ?? "",
|
|
@@ -946,13 +995,13 @@ function debugFields(config) {
|
|
|
946
995
|
};
|
|
947
996
|
}
|
|
948
997
|
function ConfigurationScreen({ onDone }) {
|
|
949
|
-
const [stage, setStage] =
|
|
950
|
-
const [config, setConfig] =
|
|
951
|
-
const [activeField, setActiveField] =
|
|
952
|
-
const [notice, setNotice] =
|
|
953
|
-
const [lastSaved, setLastSaved] =
|
|
954
|
-
const [editing, setEditing] =
|
|
955
|
-
const [valueBeforeEdit, setValueBeforeEdit] =
|
|
998
|
+
const [stage, setStage] = useState7("loading");
|
|
999
|
+
const [config, setConfig] = useState7(null);
|
|
1000
|
+
const [activeField, setActiveField] = useState7("spaceId");
|
|
1001
|
+
const [notice, setNotice] = useState7(null);
|
|
1002
|
+
const [lastSaved, setLastSaved] = useState7(null);
|
|
1003
|
+
const [editing, setEditing] = useState7(false);
|
|
1004
|
+
const [valueBeforeEdit, setValueBeforeEdit] = useState7("");
|
|
956
1005
|
useEffect4(() => {
|
|
957
1006
|
readCredentials().then((cfg) => {
|
|
958
1007
|
setConfig(cfg);
|
|
@@ -1060,7 +1109,7 @@ function ConfigurationScreen({ onDone }) {
|
|
|
1060
1109
|
) : /* @__PURE__ */ jsx7(Text7, { children: display || /* @__PURE__ */ jsx7(Text7, { dimColor: true, children: "(empty)" }) })
|
|
1061
1110
|
] }, field);
|
|
1062
1111
|
}) }),
|
|
1063
|
-
notice && /* @__PURE__ */ jsxs7(
|
|
1112
|
+
notice && /* @__PURE__ */ jsxs7(Fragment2, { children: [
|
|
1064
1113
|
/* @__PURE__ */ jsx7(Text7, { children: " " }),
|
|
1065
1114
|
/* @__PURE__ */ jsxs7(Text7, { color: notice.kind === "success" ? PALETTE.success : PALETTE.error, children: [
|
|
1066
1115
|
notice.kind === "success" ? "\u2713" : "\u2717",
|
|
@@ -1120,12 +1169,12 @@ var init_analytics_store = __esm({
|
|
|
1120
1169
|
});
|
|
1121
1170
|
|
|
1122
1171
|
// packages/experience-design-system-cli/src/tui/settings/opt-in-analytics/screen.tsx
|
|
1123
|
-
import { useEffect as useEffect5, useState as
|
|
1172
|
+
import { useEffect as useEffect5, useState as useState8 } from "react";
|
|
1124
1173
|
import { Box as Box8, Text as Text8, useInput as useInput8 } from "ink";
|
|
1125
|
-
import { Fragment as
|
|
1174
|
+
import { Fragment as Fragment3, jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1126
1175
|
function OptInAnalyticsScreen({ onDone }) {
|
|
1127
|
-
const [loading, setLoading] =
|
|
1128
|
-
const [enabled, setEnabled] =
|
|
1176
|
+
const [loading, setLoading] = useState8(true);
|
|
1177
|
+
const [enabled, setEnabled] = useState8(true);
|
|
1129
1178
|
useEffect5(() => {
|
|
1130
1179
|
readAnalyticsSetting().then((setting) => {
|
|
1131
1180
|
setEnabled(setting.enabled);
|
|
@@ -1156,7 +1205,7 @@ function OptInAnalyticsScreen({ onDone }) {
|
|
|
1156
1205
|
return /* @__PURE__ */ jsxs8(Box8, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
1157
1206
|
/* @__PURE__ */ jsx8(Text8, { bold: true, children: "Settings \u203A Opt-in Analytics" }),
|
|
1158
1207
|
/* @__PURE__ */ jsx8(Text8, { children: " " }),
|
|
1159
|
-
loading ? /* @__PURE__ */ jsx8(Text8, { color: PALETTE.muted, children: "Loading\u2026" }) : /* @__PURE__ */ jsxs8(
|
|
1208
|
+
loading ? /* @__PURE__ */ jsx8(Text8, { color: PALETTE.muted, children: "Loading\u2026" }) : /* @__PURE__ */ jsxs8(Fragment3, { children: [
|
|
1160
1209
|
/* @__PURE__ */ jsxs8(Text8, { children: [
|
|
1161
1210
|
"Share anonymous usage data:",
|
|
1162
1211
|
" ",
|
|
@@ -1180,11 +1229,11 @@ var init_screen3 = __esm({
|
|
|
1180
1229
|
});
|
|
1181
1230
|
|
|
1182
1231
|
// packages/experience-design-system-cli/src/tui/upgrade/PageContainer.tsx
|
|
1183
|
-
import { useEffect as useEffect6, useState as
|
|
1232
|
+
import { useEffect as useEffect6, useState as useState9 } from "react";
|
|
1184
1233
|
import { Box as Box9, Text as Text9, useInput as useInput9 } from "ink";
|
|
1185
1234
|
import { jsx as jsx9, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1186
1235
|
function UpgradeScreen({ onDone }) {
|
|
1187
|
-
const [upgradeCheck, setUpgradeCheck] =
|
|
1236
|
+
const [upgradeCheck, setUpgradeCheck] = useState9();
|
|
1188
1237
|
useEffect6(() => {
|
|
1189
1238
|
startDebugRun({
|
|
1190
1239
|
flow: "upgrade",
|
|
@@ -1260,12 +1309,12 @@ var init_PageContainer4 = __esm({
|
|
|
1260
1309
|
});
|
|
1261
1310
|
|
|
1262
1311
|
// packages/experience-design-system-cli/src/tui/settings/debug-mode/screen.tsx
|
|
1263
|
-
import { useEffect as useEffect7, useState as
|
|
1312
|
+
import { useEffect as useEffect7, useState as useState10 } from "react";
|
|
1264
1313
|
import { Box as Box10, Text as Text10, useInput as useInput10 } from "ink";
|
|
1265
1314
|
import { jsx as jsx10, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1266
1315
|
function DebugModeScreen({ onDone }) {
|
|
1267
|
-
const [loading, setLoading] =
|
|
1268
|
-
const [enabled, setEnabled] =
|
|
1316
|
+
const [loading, setLoading] = useState10(true);
|
|
1317
|
+
const [enabled, setEnabled] = useState10(true);
|
|
1269
1318
|
useEffect7(() => {
|
|
1270
1319
|
readDebugModeSetting().then((setting) => {
|
|
1271
1320
|
setEnabled(setting.enabled);
|
|
@@ -1319,14 +1368,14 @@ var app_exports = {};
|
|
|
1319
1368
|
__export(app_exports, {
|
|
1320
1369
|
runApp: () => runApp
|
|
1321
1370
|
});
|
|
1322
|
-
import { useEffect as useEffect8, useState as
|
|
1323
|
-
import { Fragment as
|
|
1371
|
+
import { useEffect as useEffect8, useState as useState11 } from "react";
|
|
1372
|
+
import { Fragment as Fragment4, jsx as jsx11 } from "react/jsx-runtime";
|
|
1324
1373
|
function App({ onLaunchImport, importExitCode }) {
|
|
1325
1374
|
const returnedFromImport = importExitCode !== void 0;
|
|
1326
|
-
const [screen, setScreen] =
|
|
1327
|
-
const [showImportResult, setShowImportResult] =
|
|
1328
|
-
const [projectPath, setProjectPath] =
|
|
1329
|
-
const [importDefaults, setImportDefaults] =
|
|
1375
|
+
const [screen, setScreen] = useState11(returnedFromImport ? "import" : "start");
|
|
1376
|
+
const [showImportResult, setShowImportResult] = useState11(returnedFromImport);
|
|
1377
|
+
const [projectPath, setProjectPath] = useState11();
|
|
1378
|
+
const [importDefaults, setImportDefaults] = useState11();
|
|
1330
1379
|
useEffect8(() => {
|
|
1331
1380
|
if (screen !== "import") {
|
|
1332
1381
|
setImportDefaults(void 0);
|
|
@@ -1350,7 +1399,7 @@ function App({ onLaunchImport, importExitCode }) {
|
|
|
1350
1399
|
switch (screen) {
|
|
1351
1400
|
case "import":
|
|
1352
1401
|
if (showImportResult) return /* @__PURE__ */ jsx11(ImportScreen, { exitCode: importExitCode, onDone: finishImportResult });
|
|
1353
|
-
if (importDefaults === void 0) return /* @__PURE__ */ jsx11(
|
|
1402
|
+
if (importDefaults === void 0) return /* @__PURE__ */ jsx11(Fragment4, {});
|
|
1354
1403
|
if (projectPath === void 0) {
|
|
1355
1404
|
return /* @__PURE__ */ jsx11(WelcomeScreen, { onContinue: setProjectPath, onQuit: leaveImport, initialPath: importDefaults.componentDir });
|
|
1356
1405
|
}
|
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.36.2-dev-build-
|
|
3
|
+
"version": "2.36.2-dev-build-4fe2ee93.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.36.2-dev-build-
|
|
45
|
+
"@contentful/experience-design-system-types": "2.36.2-dev-build-4fe2ee93.0"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@tsconfig/node24": "^24.0.4",
|