@contentful/experience-design-system-cli 2.36.2-dev-build-4fe2ee93.0 → 2.36.2-dev-build-c4497102.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 +187 -122
- package/dist/index.js +199 -122
- package/dist/package.json +1 -1
- package/dist/src/tui/control-hints.d.ts +7 -0
- package/legacy/package.json +1 -1
- package/package.json +2 -2
package/dist/app.js
CHANGED
|
@@ -3,7 +3,7 @@ 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";
|
|
6
|
-
import { Box, Text, useApp, useInput } from "ink";
|
|
6
|
+
import { Box, Text as Text2, useApp, useInput } from "ink";
|
|
7
7
|
|
|
8
8
|
// packages/experience-design-system-cli/src/tui/home/home.theme.ts
|
|
9
9
|
var BRAND = {
|
|
@@ -117,8 +117,15 @@ function useTerminalWidth() {
|
|
|
117
117
|
return columns;
|
|
118
118
|
}
|
|
119
119
|
|
|
120
|
+
// packages/experience-design-system-cli/src/tui/control-hints.tsx
|
|
121
|
+
import { Text } from "ink";
|
|
122
|
+
import { jsx } from "react/jsx-runtime";
|
|
123
|
+
function ControlHints({ hints }) {
|
|
124
|
+
return /* @__PURE__ */ jsx(Text, { color: PALETTE.muted, children: hints.map((hint) => `${hint.keys} ${hint.label}`).join(" \xB7 ") });
|
|
125
|
+
}
|
|
126
|
+
|
|
120
127
|
// packages/experience-design-system-cli/src/tui/home/home.tsx
|
|
121
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
128
|
+
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
122
129
|
var VERSION = readPackageVersion();
|
|
123
130
|
var HEADING = "Contentful Experiences";
|
|
124
131
|
var SUBTITLE = "Let's import your design system into Contentful";
|
|
@@ -171,27 +178,27 @@ function HomeScreen({ onNavigate }) {
|
|
|
171
178
|
});
|
|
172
179
|
if (tooNarrow) {
|
|
173
180
|
return /* @__PURE__ */ jsxs(Box, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
174
|
-
/* @__PURE__ */
|
|
175
|
-
/* @__PURE__ */
|
|
181
|
+
/* @__PURE__ */ jsx2(Text2, { bold: true, color: PALETTE.warning, children: "Terminal too small" }),
|
|
182
|
+
/* @__PURE__ */ jsx2(Text2, { color: PALETTE.muted, children: "Press q to quit, make your terminal full screen, then run experiences import again." })
|
|
176
183
|
] });
|
|
177
184
|
}
|
|
178
185
|
return /* @__PURE__ */ jsxs(Box, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
179
186
|
/* @__PURE__ */ jsxs(Box, { flexDirection: "column", alignItems: "center", children: [
|
|
180
|
-
/* @__PURE__ */
|
|
181
|
-
/* @__PURE__ */
|
|
182
|
-
/* @__PURE__ */
|
|
183
|
-
/* @__PURE__ */ jsxs(
|
|
187
|
+
/* @__PURE__ */ jsx2(Text2, { bold: true, color: PALETTE.heading, children: HEADING }),
|
|
188
|
+
/* @__PURE__ */ jsx2(Text2, { children: brandBar(HEADING.length).map((segment, i) => /* @__PURE__ */ jsx2(Text2, { color: segment.color, children: segment.text }, i)) }),
|
|
189
|
+
/* @__PURE__ */ jsx2(Text2, { color: PALETTE.muted, children: SUBTITLE }),
|
|
190
|
+
/* @__PURE__ */ jsxs(Text2, { color: PALETTE.muted, children: [
|
|
184
191
|
"v",
|
|
185
192
|
VERSION
|
|
186
193
|
] })
|
|
187
194
|
] }),
|
|
188
|
-
/* @__PURE__ */
|
|
195
|
+
/* @__PURE__ */ jsx2(Box, { marginTop: 1, justifyContent: "center", children: /* @__PURE__ */ jsx2(Box, { flexDirection: "column", children: START_ITEMS.map((item, i) => {
|
|
189
196
|
const focused = i === focusIdx;
|
|
190
197
|
const isUpgradeItem = item.screen === "upgrade";
|
|
191
198
|
const display = isUpgradeItem ? upgradeItemDisplay(upgradeCheck) : { label: item.label };
|
|
192
199
|
const dimmed = isUpgradeItem && upgradeDisabled;
|
|
193
200
|
return /* @__PURE__ */ jsxs(
|
|
194
|
-
|
|
201
|
+
Text2,
|
|
195
202
|
{
|
|
196
203
|
bold: focused && !dimmed,
|
|
197
204
|
dimColor: dimmed,
|
|
@@ -204,13 +211,22 @@ function HomeScreen({ onNavigate }) {
|
|
|
204
211
|
item.label
|
|
205
212
|
);
|
|
206
213
|
}) }) }),
|
|
207
|
-
/* @__PURE__ */
|
|
214
|
+
/* @__PURE__ */ jsx2(Box, { marginTop: 1, justifyContent: "center", children: /* @__PURE__ */ jsx2(
|
|
215
|
+
ControlHints,
|
|
216
|
+
{
|
|
217
|
+
hints: [
|
|
218
|
+
{ keys: "\u2191/\u2193", label: "move" },
|
|
219
|
+
{ keys: "\u23CE", label: "select" },
|
|
220
|
+
{ keys: "q", label: "quit" }
|
|
221
|
+
]
|
|
222
|
+
}
|
|
223
|
+
) })
|
|
208
224
|
] });
|
|
209
225
|
}
|
|
210
226
|
|
|
211
227
|
// packages/experience-design-system-cli/src/tui/import/PageContainer.tsx
|
|
212
|
-
import { Box as Box2, Text as
|
|
213
|
-
import { jsx as
|
|
228
|
+
import { Box as Box2, Text as Text3, useInput as useInput2 } from "ink";
|
|
229
|
+
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
214
230
|
function ImportScreen({ exitCode, onDone }) {
|
|
215
231
|
useInput2((input, key) => {
|
|
216
232
|
if (key.return || key.escape || input === "q") {
|
|
@@ -219,20 +235,20 @@ function ImportScreen({ exitCode, onDone }) {
|
|
|
219
235
|
});
|
|
220
236
|
const isSuccess = exitCode === 0;
|
|
221
237
|
return /* @__PURE__ */ jsxs2(Box2, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
222
|
-
/* @__PURE__ */
|
|
223
|
-
/* @__PURE__ */
|
|
224
|
-
isSuccess ? /* @__PURE__ */
|
|
238
|
+
/* @__PURE__ */ jsx3(Text3, { bold: true, children: "Import" }),
|
|
239
|
+
/* @__PURE__ */ jsx3(Text3, { children: " " }),
|
|
240
|
+
isSuccess ? /* @__PURE__ */ jsx3(Text3, { color: PALETTE.success, children: "\u2713 Import complete" }) : /* @__PURE__ */ jsxs2(Text3, { color: PALETTE.error, children: [
|
|
225
241
|
"\u2717 Import failed: process exited with code ",
|
|
226
242
|
exitCode ?? "unknown"
|
|
227
243
|
] }),
|
|
228
|
-
/* @__PURE__ */
|
|
229
|
-
/* @__PURE__ */
|
|
244
|
+
/* @__PURE__ */ jsx3(Text3, { children: " " }),
|
|
245
|
+
/* @__PURE__ */ jsx3(Text3, { dimColor: true, children: "[Enter] Back to Start" })
|
|
230
246
|
] });
|
|
231
247
|
}
|
|
232
248
|
|
|
233
249
|
// packages/experience-design-system-cli/src/tui/import/steps/01-welcome/screen.tsx
|
|
234
250
|
import { useState as useState3 } from "react";
|
|
235
|
-
import { Box as Box3, Text as
|
|
251
|
+
import { Box as Box3, Text as Text4 } from "ink";
|
|
236
252
|
import TextInput from "ink-text-input";
|
|
237
253
|
|
|
238
254
|
// packages/experience-design-system-cli/src/tui/import/steps/01-welcome/controls.ts
|
|
@@ -260,7 +276,7 @@ function useWelcomeControls(projectPath, onQuit) {
|
|
|
260
276
|
}
|
|
261
277
|
|
|
262
278
|
// packages/experience-design-system-cli/src/tui/import/steps/01-welcome/screen.tsx
|
|
263
|
-
import { jsx as
|
|
279
|
+
import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
264
280
|
var RULE = "\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500";
|
|
265
281
|
var OVERVIEW = [
|
|
266
282
|
{ label: "Step 1", description: "Extract components from your codebase" },
|
|
@@ -277,25 +293,25 @@ function WelcomeScreen({ onContinue, onQuit, initialPath = "" }) {
|
|
|
277
293
|
if (path) onContinue(path);
|
|
278
294
|
};
|
|
279
295
|
return /* @__PURE__ */ jsxs3(Box3, { flexDirection: "column", gap: 1, paddingX: 2, paddingY: 1, children: [
|
|
280
|
-
/* @__PURE__ */
|
|
281
|
-
/* @__PURE__ */
|
|
296
|
+
/* @__PURE__ */ jsx4(Text4, { bold: true, color: PALETTE.success, children: "\u{1F44B} Hey! Let's import your design system into Contentful." }),
|
|
297
|
+
/* @__PURE__ */ jsx4(Text4, { dimColor: true, children: "I'll walk you through 5 steps to get your components into Contentful ExO." }),
|
|
282
298
|
/* @__PURE__ */ jsxs3(Box3, { flexDirection: "column", marginTop: 1, children: [
|
|
283
|
-
/* @__PURE__ */
|
|
299
|
+
/* @__PURE__ */ jsx4(Text4, { dimColor: true, children: RULE }),
|
|
284
300
|
OVERVIEW.map((item) => /* @__PURE__ */ jsxs3(Box3, { gap: 1, children: [
|
|
285
|
-
/* @__PURE__ */
|
|
286
|
-
/* @__PURE__ */
|
|
301
|
+
/* @__PURE__ */ jsx4(Text4, { bold: true, children: item.label }),
|
|
302
|
+
/* @__PURE__ */ jsx4(Text4, { dimColor: true, children: item.description })
|
|
287
303
|
] }, item.label)),
|
|
288
|
-
/* @__PURE__ */
|
|
304
|
+
/* @__PURE__ */ jsx4(Text4, { dimColor: true, children: RULE })
|
|
289
305
|
] }),
|
|
290
306
|
/* @__PURE__ */ jsxs3(Box3, { flexDirection: "column", marginTop: 1, children: [
|
|
291
|
-
/* @__PURE__ */
|
|
307
|
+
/* @__PURE__ */ jsx4(Text4, { children: "Where is your component library?" }),
|
|
292
308
|
/* @__PURE__ */ jsxs3(Box3, { gap: 1, children: [
|
|
293
|
-
/* @__PURE__ */
|
|
294
|
-
/* @__PURE__ */
|
|
295
|
-
/* @__PURE__ */
|
|
309
|
+
/* @__PURE__ */ jsx4(Text4, { color: PALETTE.accent, children: "?" }),
|
|
310
|
+
/* @__PURE__ */ jsx4(Text4, { children: "Project path:" }),
|
|
311
|
+
/* @__PURE__ */ jsx4(TextInput, { value: projectPath, onChange: setProjectPath, onSubmit: submit })
|
|
296
312
|
] })
|
|
297
313
|
] }),
|
|
298
|
-
/* @__PURE__ */
|
|
314
|
+
/* @__PURE__ */ jsx4(Box3, { marginTop: 1, gap: 3, children: WELCOME_CONTROLS.map((control) => /* @__PURE__ */ jsxs3(Text4, { dimColor: true, children: [
|
|
299
315
|
"[",
|
|
300
316
|
control.keys,
|
|
301
317
|
"] ",
|
|
@@ -306,7 +322,7 @@ function WelcomeScreen({ onContinue, onQuit, initialPath = "" }) {
|
|
|
306
322
|
|
|
307
323
|
// packages/experience-design-system-cli/src/tui/import/steps/02-token-input/screen.tsx
|
|
308
324
|
import { useState as useState4 } from "react";
|
|
309
|
-
import { Box as Box4, Text as
|
|
325
|
+
import { Box as Box4, Text as Text5 } from "ink";
|
|
310
326
|
import TextInput2 from "ink-text-input";
|
|
311
327
|
|
|
312
328
|
// packages/experience-design-system-cli/src/tui/import/steps/02-token-input/controls.ts
|
|
@@ -373,7 +389,7 @@ function validateTokenPath(rawPath) {
|
|
|
373
389
|
}
|
|
374
390
|
|
|
375
391
|
// packages/experience-design-system-cli/src/tui/import/steps/02-token-input/screen.tsx
|
|
376
|
-
import { jsx as
|
|
392
|
+
import { jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
377
393
|
function TokenInputScreen({
|
|
378
394
|
onConfirm,
|
|
379
395
|
onSkip,
|
|
@@ -398,26 +414,26 @@ function TokenInputScreen({
|
|
|
398
414
|
else setFailure({ error: check.error, resolvedPath: check.resolvedPath });
|
|
399
415
|
};
|
|
400
416
|
return /* @__PURE__ */ jsxs4(Box4, { flexDirection: "column", gap: 1, paddingX: 2, paddingY: 1, children: [
|
|
401
|
-
/* @__PURE__ */
|
|
402
|
-
/* @__PURE__ */
|
|
417
|
+
/* @__PURE__ */ jsx5(Text5, { bold: true, children: "Design tokens" }),
|
|
418
|
+
/* @__PURE__ */ jsx5(Text5, { dimColor: true, children: "Point me to your raw token file (e.g. ~/design-tokens/tokens.json). You can use ~, relative, or absolute paths. Claude will map it to DTCG format." }),
|
|
403
419
|
/* @__PURE__ */ jsxs4(Box4, { flexDirection: "column", marginTop: 1, children: [
|
|
404
420
|
/* @__PURE__ */ jsxs4(Box4, { gap: 1, children: [
|
|
405
|
-
/* @__PURE__ */
|
|
406
|
-
/* @__PURE__ */
|
|
407
|
-
/* @__PURE__ */
|
|
421
|
+
/* @__PURE__ */ jsx5(Text5, { color: PALETTE.accent, children: "?" }),
|
|
422
|
+
/* @__PURE__ */ jsx5(Text5, { children: "Token path:" }),
|
|
423
|
+
/* @__PURE__ */ jsx5(TextInput2, { value: tokenPath, onChange: change, onSubmit: submit })
|
|
408
424
|
] }),
|
|
409
425
|
failure && /* @__PURE__ */ jsxs4(Box4, { flexDirection: "column", children: [
|
|
410
|
-
/* @__PURE__ */ jsxs4(
|
|
426
|
+
/* @__PURE__ */ jsxs4(Text5, { color: PALETTE.error, children: [
|
|
411
427
|
"\u2717 ",
|
|
412
428
|
failure.error
|
|
413
429
|
] }),
|
|
414
|
-
/* @__PURE__ */ jsxs4(
|
|
430
|
+
/* @__PURE__ */ jsxs4(Text5, { dimColor: true, children: [
|
|
415
431
|
" Resolved to: ",
|
|
416
432
|
failure.resolvedPath
|
|
417
433
|
] })
|
|
418
434
|
] })
|
|
419
435
|
] }),
|
|
420
|
-
/* @__PURE__ */
|
|
436
|
+
/* @__PURE__ */ jsx5(Box4, { marginTop: 1, gap: 3, children: TOKEN_INPUT_CONTROLS.map((control) => /* @__PURE__ */ jsxs4(Text5, { dimColor: true, children: [
|
|
421
437
|
"[",
|
|
422
438
|
control.keys,
|
|
423
439
|
"] ",
|
|
@@ -494,7 +510,7 @@ function startReadingTerminal() {
|
|
|
494
510
|
|
|
495
511
|
// packages/experience-design-system-cli/src/tui/help/PageContainer.tsx
|
|
496
512
|
import { useEffect as useEffect3, useState as useState5 } from "react";
|
|
497
|
-
import { Box as Box5, Text as
|
|
513
|
+
import { Box as Box5, Text as Text6, useInput as useInput5 } from "ink";
|
|
498
514
|
|
|
499
515
|
// packages/experience-design-system-cli/src/tui/debug-store.ts
|
|
500
516
|
import { mkdir as mkdir2, writeFile as writeFile2 } from "node:fs/promises";
|
|
@@ -704,13 +720,13 @@ async function readHelpInfo() {
|
|
|
704
720
|
}
|
|
705
721
|
|
|
706
722
|
// packages/experience-design-system-cli/src/tui/help/PageContainer.tsx
|
|
707
|
-
import { Fragment, jsx as
|
|
723
|
+
import { Fragment, jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
708
724
|
function Section({ title, rows }) {
|
|
709
725
|
return /* @__PURE__ */ jsxs5(Box5, { flexDirection: "column", children: [
|
|
710
|
-
/* @__PURE__ */
|
|
726
|
+
/* @__PURE__ */ jsx6(Text6, { bold: true, color: PALETTE.accent, children: title }),
|
|
711
727
|
rows.map((row) => /* @__PURE__ */ jsxs5(Box5, { gap: 1, children: [
|
|
712
|
-
/* @__PURE__ */
|
|
713
|
-
/* @__PURE__ */
|
|
728
|
+
/* @__PURE__ */ jsx6(Box5, { width: 14, flexShrink: 0, children: /* @__PURE__ */ jsx6(Text6, { dimColor: true, children: row.label }) }),
|
|
729
|
+
/* @__PURE__ */ jsx6(Text6, { children: row.value })
|
|
714
730
|
] }, row.label))
|
|
715
731
|
] });
|
|
716
732
|
}
|
|
@@ -735,20 +751,28 @@ function HelpScreen({ onDone }) {
|
|
|
735
751
|
}
|
|
736
752
|
});
|
|
737
753
|
return /* @__PURE__ */ jsxs5(Box5, { flexDirection: "column", paddingX: 2, paddingY: 1, gap: 1, children: [
|
|
738
|
-
/* @__PURE__ */
|
|
754
|
+
/* @__PURE__ */ jsx6(Text6, { bold: true, children: "Help" }),
|
|
739
755
|
info ? /* @__PURE__ */ jsxs5(Fragment, { children: [
|
|
740
|
-
/* @__PURE__ */
|
|
741
|
-
/* @__PURE__ */
|
|
742
|
-
/* @__PURE__ */
|
|
743
|
-
] }) : /* @__PURE__ */
|
|
744
|
-
/* @__PURE__ */
|
|
756
|
+
/* @__PURE__ */ jsx6(Section, { title: "Where things are stored", rows: info.storage }),
|
|
757
|
+
/* @__PURE__ */ jsx6(Section, { title: "Troubleshooting", rows: info.troubleshooting }),
|
|
758
|
+
/* @__PURE__ */ jsx6(Text6, { 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." })
|
|
759
|
+
] }) : /* @__PURE__ */ jsx6(Text6, { color: PALETTE.accent, children: "Loading..." }),
|
|
760
|
+
/* @__PURE__ */ jsx6(
|
|
761
|
+
ControlHints,
|
|
762
|
+
{
|
|
763
|
+
hints: [
|
|
764
|
+
{ keys: "\u23CE", label: "done" },
|
|
765
|
+
{ keys: "Esc/q", label: "back to start" }
|
|
766
|
+
]
|
|
767
|
+
}
|
|
768
|
+
)
|
|
745
769
|
] });
|
|
746
770
|
}
|
|
747
771
|
|
|
748
772
|
// packages/experience-design-system-cli/src/tui/settings/PageContainer.tsx
|
|
749
773
|
import { useState as useState6 } from "react";
|
|
750
|
-
import { Box as Box6, Text as
|
|
751
|
-
import { jsx as
|
|
774
|
+
import { Box as Box6, Text as Text7, useInput as useInput6 } from "ink";
|
|
775
|
+
import { jsx as jsx7, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
752
776
|
function SettingsScreen({
|
|
753
777
|
onNavigate,
|
|
754
778
|
onBack
|
|
@@ -780,20 +804,29 @@ function SettingsScreen({
|
|
|
780
804
|
}
|
|
781
805
|
});
|
|
782
806
|
return /* @__PURE__ */ jsxs6(Box6, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
783
|
-
/* @__PURE__ */
|
|
784
|
-
/* @__PURE__ */
|
|
785
|
-
items.map((item, i) => /* @__PURE__ */ jsxs6(
|
|
807
|
+
/* @__PURE__ */ jsx7(Text7, { bold: true, children: "Settings" }),
|
|
808
|
+
/* @__PURE__ */ jsx7(Text7, { children: " " }),
|
|
809
|
+
items.map((item, i) => /* @__PURE__ */ jsxs6(Text7, { color: i === focusIdx ? "cyan" : void 0, children: [
|
|
786
810
|
i === focusIdx ? "> " : " ",
|
|
787
811
|
item.label
|
|
788
812
|
] }, item.label)),
|
|
789
|
-
/* @__PURE__ */
|
|
790
|
-
/* @__PURE__ */
|
|
813
|
+
/* @__PURE__ */ jsx7(Text7, { children: " " }),
|
|
814
|
+
/* @__PURE__ */ jsx7(
|
|
815
|
+
ControlHints,
|
|
816
|
+
{
|
|
817
|
+
hints: [
|
|
818
|
+
{ keys: "\u2191/\u2193", label: "move" },
|
|
819
|
+
{ keys: "\u23CE", label: "select" },
|
|
820
|
+
{ keys: "Esc/q", label: "back" }
|
|
821
|
+
]
|
|
822
|
+
}
|
|
823
|
+
)
|
|
791
824
|
] });
|
|
792
825
|
}
|
|
793
826
|
|
|
794
827
|
// packages/experience-design-system-cli/src/tui/settings/contentful-configuration/ContentfulConfigScreen.tsx
|
|
795
828
|
import { useEffect as useEffect4, useState as useState7 } from "react";
|
|
796
|
-
import { Box as Box7, Text as
|
|
829
|
+
import { Box as Box7, Text as Text8, useInput as useInput7 } from "ink";
|
|
797
830
|
import TextInput3 from "ink-text-input";
|
|
798
831
|
|
|
799
832
|
// packages/experience-design-system-cli/src/tui/settings/utils/v1-store.ts
|
|
@@ -825,7 +858,7 @@ async function writeCredentials(config) {
|
|
|
825
858
|
}
|
|
826
859
|
|
|
827
860
|
// packages/experience-design-system-cli/src/tui/settings/contentful-configuration/ContentfulConfigScreen.tsx
|
|
828
|
-
import { Fragment as Fragment2, jsx as
|
|
861
|
+
import { Fragment as Fragment2, jsx as jsx8, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
829
862
|
var FIELD_ORDER = [
|
|
830
863
|
"spaceId",
|
|
831
864
|
"environmentId",
|
|
@@ -938,25 +971,25 @@ function ConfigurationScreen({ onDone }) {
|
|
|
938
971
|
});
|
|
939
972
|
if (stage === "loading") {
|
|
940
973
|
return /* @__PURE__ */ jsxs7(Box7, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
941
|
-
/* @__PURE__ */
|
|
942
|
-
/* @__PURE__ */
|
|
943
|
-
/* @__PURE__ */
|
|
974
|
+
/* @__PURE__ */ jsx8(Text8, { bold: true, children: "Configuration" }),
|
|
975
|
+
/* @__PURE__ */ jsx8(Text8, { children: " " }),
|
|
976
|
+
/* @__PURE__ */ jsx8(Text8, { color: PALETTE.accent, children: "Loading..." })
|
|
944
977
|
] });
|
|
945
978
|
}
|
|
946
979
|
return /* @__PURE__ */ jsxs7(Box7, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
947
|
-
/* @__PURE__ */
|
|
948
|
-
/* @__PURE__ */
|
|
949
|
-
/* @__PURE__ */
|
|
980
|
+
/* @__PURE__ */ jsx8(Text8, { bold: true, children: "Configuration" }),
|
|
981
|
+
/* @__PURE__ */ jsx8(Text8, { children: " " }),
|
|
982
|
+
/* @__PURE__ */ jsx8(Box7, { flexDirection: "column", children: FIELD_ORDER.map((field) => {
|
|
950
983
|
const isActive = activeField === field;
|
|
951
984
|
const value = fieldValue(field);
|
|
952
985
|
const display = field === "cmaToken" ? "\u2022".repeat(value.length) : value;
|
|
953
986
|
return /* @__PURE__ */ jsxs7(Box7, { gap: 1, children: [
|
|
954
|
-
/* @__PURE__ */
|
|
955
|
-
/* @__PURE__ */ jsxs7(
|
|
987
|
+
/* @__PURE__ */ jsx8(Text8, { color: isActive ? PALETTE.accent : void 0, children: isActive ? "\u276F" : " " }),
|
|
988
|
+
/* @__PURE__ */ jsxs7(Text8, { bold: isActive, children: [
|
|
956
989
|
FIELD_LABELS[field],
|
|
957
990
|
":"
|
|
958
991
|
] }),
|
|
959
|
-
isActive && editing ? /* @__PURE__ */
|
|
992
|
+
isActive && editing ? /* @__PURE__ */ jsx8(
|
|
960
993
|
TextInput3,
|
|
961
994
|
{
|
|
962
995
|
value,
|
|
@@ -964,25 +997,41 @@ function ConfigurationScreen({ onDone }) {
|
|
|
964
997
|
onSubmit: () => setEditing(false),
|
|
965
998
|
mask: field === "cmaToken" ? "\u2022" : void 0
|
|
966
999
|
}
|
|
967
|
-
) : /* @__PURE__ */
|
|
1000
|
+
) : /* @__PURE__ */ jsx8(Text8, { children: display || /* @__PURE__ */ jsx8(Text8, { dimColor: true, children: "(empty)" }) })
|
|
968
1001
|
] }, field);
|
|
969
1002
|
}) }),
|
|
970
1003
|
notice && /* @__PURE__ */ jsxs7(Fragment2, { children: [
|
|
971
|
-
/* @__PURE__ */
|
|
972
|
-
/* @__PURE__ */ jsxs7(
|
|
1004
|
+
/* @__PURE__ */ jsx8(Text8, { children: " " }),
|
|
1005
|
+
/* @__PURE__ */ jsxs7(Text8, { color: notice.kind === "success" ? PALETTE.success : PALETTE.error, children: [
|
|
973
1006
|
notice.kind === "success" ? "\u2713" : "\u2717",
|
|
974
1007
|
" ",
|
|
975
1008
|
notice.text
|
|
976
1009
|
] })
|
|
977
1010
|
] }),
|
|
978
|
-
/* @__PURE__ */
|
|
979
|
-
/* @__PURE__ */
|
|
1011
|
+
/* @__PURE__ */ jsx8(Text8, { children: " " }),
|
|
1012
|
+
/* @__PURE__ */ jsx8(
|
|
1013
|
+
ControlHints,
|
|
1014
|
+
{
|
|
1015
|
+
hints: editing ? [
|
|
1016
|
+
{ keys: "type", label: "edit" },
|
|
1017
|
+
{ keys: "\u2190/\u2192", label: "move cursor" },
|
|
1018
|
+
{ keys: "\u23CE", label: "done" },
|
|
1019
|
+
{ keys: "Esc", label: "cancel edit" }
|
|
1020
|
+
] : [
|
|
1021
|
+
{ keys: "\u2191/\u2193", label: "move" },
|
|
1022
|
+
{ keys: "\u23CE", label: "edit" },
|
|
1023
|
+
{ keys: "c", label: "clear" },
|
|
1024
|
+
{ keys: "s", label: "save" },
|
|
1025
|
+
{ keys: "Esc/q", label: "quit without saving" }
|
|
1026
|
+
]
|
|
1027
|
+
}
|
|
1028
|
+
)
|
|
980
1029
|
] });
|
|
981
1030
|
}
|
|
982
1031
|
|
|
983
1032
|
// packages/experience-design-system-cli/src/tui/settings/opt-in-analytics/screen.tsx
|
|
984
1033
|
import { useEffect as useEffect5, useState as useState8 } from "react";
|
|
985
|
-
import { Box as Box8, Text as
|
|
1034
|
+
import { Box as Box8, Text as Text9, useInput as useInput8 } from "ink";
|
|
986
1035
|
|
|
987
1036
|
// packages/experience-design-system-cli/src/tui/settings/opt-in-analytics/analytics-store.ts
|
|
988
1037
|
async function readAnalyticsSetting() {
|
|
@@ -1000,7 +1049,7 @@ async function writeAnalyticsSetting(setting) {
|
|
|
1000
1049
|
}
|
|
1001
1050
|
|
|
1002
1051
|
// packages/experience-design-system-cli/src/tui/settings/opt-in-analytics/screen.tsx
|
|
1003
|
-
import { Fragment as Fragment3, jsx as
|
|
1052
|
+
import { Fragment as Fragment3, jsx as jsx9, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1004
1053
|
function OptInAnalyticsScreen({ onDone }) {
|
|
1005
1054
|
const [loading, setLoading] = useState8(true);
|
|
1006
1055
|
const [enabled, setEnabled] = useState8(true);
|
|
@@ -1032,27 +1081,35 @@ function OptInAnalyticsScreen({ onDone }) {
|
|
|
1032
1081
|
}
|
|
1033
1082
|
});
|
|
1034
1083
|
return /* @__PURE__ */ jsxs8(Box8, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
1035
|
-
/* @__PURE__ */
|
|
1036
|
-
/* @__PURE__ */
|
|
1037
|
-
loading ? /* @__PURE__ */
|
|
1038
|
-
/* @__PURE__ */ jsxs8(
|
|
1084
|
+
/* @__PURE__ */ jsx9(Text9, { bold: true, children: "Settings \u203A Opt-in Analytics" }),
|
|
1085
|
+
/* @__PURE__ */ jsx9(Text9, { children: " " }),
|
|
1086
|
+
loading ? /* @__PURE__ */ jsx9(Text9, { color: PALETTE.muted, children: "Loading\u2026" }) : /* @__PURE__ */ jsxs8(Fragment3, { children: [
|
|
1087
|
+
/* @__PURE__ */ jsxs8(Text9, { children: [
|
|
1039
1088
|
"Share anonymous usage data:",
|
|
1040
1089
|
" ",
|
|
1041
|
-
/* @__PURE__ */
|
|
1090
|
+
/* @__PURE__ */ jsx9(Text9, { bold: true, color: enabled ? PALETTE.success : PALETTE.muted, children: enabled ? "On" : "Off" })
|
|
1042
1091
|
] }),
|
|
1043
|
-
/* @__PURE__ */
|
|
1044
|
-
/* @__PURE__ */
|
|
1045
|
-
/* @__PURE__ */
|
|
1092
|
+
/* @__PURE__ */ jsx9(Text9, { children: " " }),
|
|
1093
|
+
/* @__PURE__ */ jsx9(Text9, { dimColor: true, children: "Shares which CLI commands are used and where imports succeed or fail." }),
|
|
1094
|
+
/* @__PURE__ */ jsx9(Text9, { dimColor: true, children: "Never includes source code, file paths, credentials, or authored content." })
|
|
1046
1095
|
] }),
|
|
1047
|
-
/* @__PURE__ */
|
|
1048
|
-
/* @__PURE__ */
|
|
1096
|
+
/* @__PURE__ */ jsx9(Text9, { children: " " }),
|
|
1097
|
+
/* @__PURE__ */ jsx9(
|
|
1098
|
+
ControlHints,
|
|
1099
|
+
{
|
|
1100
|
+
hints: [
|
|
1101
|
+
{ keys: "\u23CE/Space", label: "toggle" },
|
|
1102
|
+
{ keys: "Esc/q", label: "back" }
|
|
1103
|
+
]
|
|
1104
|
+
}
|
|
1105
|
+
)
|
|
1049
1106
|
] });
|
|
1050
1107
|
}
|
|
1051
1108
|
|
|
1052
1109
|
// packages/experience-design-system-cli/src/tui/upgrade/PageContainer.tsx
|
|
1053
1110
|
import { useEffect as useEffect6, useState as useState9 } from "react";
|
|
1054
|
-
import { Box as Box9, Text as
|
|
1055
|
-
import { jsx as
|
|
1111
|
+
import { Box as Box9, Text as Text10, useInput as useInput9 } from "ink";
|
|
1112
|
+
import { jsx as jsx10, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1056
1113
|
var UPGRADE_COMMANDS = ["git pull", "pnpm install", "pnpm build"];
|
|
1057
1114
|
function UpgradeScreen({ onDone }) {
|
|
1058
1115
|
const [upgradeCheck, setUpgradeCheck] = useState9();
|
|
@@ -1077,11 +1134,11 @@ function UpgradeScreen({ onDone }) {
|
|
|
1077
1134
|
}
|
|
1078
1135
|
});
|
|
1079
1136
|
return /* @__PURE__ */ jsxs9(Box9, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
1080
|
-
/* @__PURE__ */
|
|
1081
|
-
/* @__PURE__ */
|
|
1137
|
+
/* @__PURE__ */ jsx10(Text10, { bold: true, children: "Upgrade" }),
|
|
1138
|
+
/* @__PURE__ */ jsx10(Text10, { children: " " }),
|
|
1082
1139
|
renderBody(upgradeCheck),
|
|
1083
|
-
/* @__PURE__ */
|
|
1084
|
-
/* @__PURE__ */ jsxs9(
|
|
1140
|
+
/* @__PURE__ */ jsx10(Text10, { children: " " }),
|
|
1141
|
+
/* @__PURE__ */ jsxs9(Text10, { bold: true, color: PALETTE.accent, children: [
|
|
1085
1142
|
FOCUS_MARKER,
|
|
1086
1143
|
" Go Back"
|
|
1087
1144
|
] })
|
|
@@ -1089,41 +1146,41 @@ function UpgradeScreen({ onDone }) {
|
|
|
1089
1146
|
}
|
|
1090
1147
|
function renderBody(upgradeCheck) {
|
|
1091
1148
|
if (!upgradeCheck) {
|
|
1092
|
-
return /* @__PURE__ */
|
|
1149
|
+
return /* @__PURE__ */ jsx10(Text10, { color: PALETTE.muted, children: "Checking for updates\u2026" });
|
|
1093
1150
|
}
|
|
1094
1151
|
if (upgradeCheck.status === "error") {
|
|
1095
|
-
return /* @__PURE__ */
|
|
1152
|
+
return /* @__PURE__ */ jsx10(Text10, { color: PALETTE.warning, children: "Couldn't check for updates \u2014 check your network connection and try again." });
|
|
1096
1153
|
}
|
|
1097
1154
|
if (upgradeCheck.status === "up-to-date") {
|
|
1098
|
-
return /* @__PURE__ */ jsxs9(
|
|
1155
|
+
return /* @__PURE__ */ jsxs9(Text10, { color: PALETTE.success, children: [
|
|
1099
1156
|
"You're already on the latest version (v",
|
|
1100
1157
|
upgradeCheck.current,
|
|
1101
1158
|
")."
|
|
1102
1159
|
] });
|
|
1103
1160
|
}
|
|
1104
1161
|
return /* @__PURE__ */ jsxs9(Box9, { flexDirection: "column", children: [
|
|
1105
|
-
/* @__PURE__ */ jsxs9(
|
|
1106
|
-
/* @__PURE__ */ jsxs9(
|
|
1162
|
+
/* @__PURE__ */ jsxs9(Text10, { color: PALETTE.muted, children: [
|
|
1163
|
+
/* @__PURE__ */ jsxs9(Text10, { bold: true, color: PALETTE.success, children: [
|
|
1107
1164
|
"v",
|
|
1108
1165
|
upgradeCheck.latest
|
|
1109
1166
|
] }),
|
|
1110
1167
|
" ",
|
|
1111
1168
|
"is available (you're on ",
|
|
1112
|
-
/* @__PURE__ */ jsxs9(
|
|
1169
|
+
/* @__PURE__ */ jsxs9(Text10, { bold: true, children: [
|
|
1113
1170
|
"v",
|
|
1114
1171
|
upgradeCheck.current
|
|
1115
1172
|
] }),
|
|
1116
1173
|
"). Exit this program, cd into the root of your local clone of contentful/experience-design-system-sdk-public, then run:"
|
|
1117
1174
|
] }),
|
|
1118
|
-
/* @__PURE__ */
|
|
1119
|
-
/* @__PURE__ */
|
|
1175
|
+
/* @__PURE__ */ jsx10(Text10, { children: " " }),
|
|
1176
|
+
/* @__PURE__ */ jsx10(Box9, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE.border, paddingX: 1, children: UPGRADE_COMMANDS.map((cmd) => /* @__PURE__ */ jsx10(Text10, { bold: true, children: cmd }, cmd)) })
|
|
1120
1177
|
] });
|
|
1121
1178
|
}
|
|
1122
1179
|
|
|
1123
1180
|
// packages/experience-design-system-cli/src/tui/settings/debug-mode/screen.tsx
|
|
1124
1181
|
import { useEffect as useEffect7, useState as useState10 } from "react";
|
|
1125
|
-
import { Box as Box10, Text as
|
|
1126
|
-
import { jsx as
|
|
1182
|
+
import { Box as Box10, Text as Text11, useInput as useInput10 } from "ink";
|
|
1183
|
+
import { jsx as jsx11, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1127
1184
|
function DebugModeScreen({ onDone }) {
|
|
1128
1185
|
const [loading, setLoading] = useState10(true);
|
|
1129
1186
|
const [enabled, setEnabled] = useState10(true);
|
|
@@ -1155,20 +1212,28 @@ function DebugModeScreen({ onDone }) {
|
|
|
1155
1212
|
}
|
|
1156
1213
|
});
|
|
1157
1214
|
return /* @__PURE__ */ jsxs10(Box10, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
1158
|
-
/* @__PURE__ */
|
|
1159
|
-
/* @__PURE__ */
|
|
1160
|
-
loading ? /* @__PURE__ */
|
|
1215
|
+
/* @__PURE__ */ jsx11(Text11, { bold: true, children: "Settings \u203A Debug Mode" }),
|
|
1216
|
+
/* @__PURE__ */ jsx11(Text11, { children: " " }),
|
|
1217
|
+
loading ? /* @__PURE__ */ jsx11(Text11, { color: PALETTE.muted, children: "Loading\u2026" }) : /* @__PURE__ */ jsxs10(Text11, { children: [
|
|
1161
1218
|
"Debug logging:",
|
|
1162
1219
|
" ",
|
|
1163
|
-
/* @__PURE__ */
|
|
1220
|
+
/* @__PURE__ */ jsx11(Text11, { bold: true, color: enabled ? PALETTE.success : PALETTE.muted, children: enabled ? "On" : "Off" })
|
|
1164
1221
|
] }),
|
|
1165
|
-
/* @__PURE__ */
|
|
1166
|
-
/* @__PURE__ */
|
|
1222
|
+
/* @__PURE__ */ jsx11(Text11, { children: " " }),
|
|
1223
|
+
/* @__PURE__ */ jsx11(
|
|
1224
|
+
ControlHints,
|
|
1225
|
+
{
|
|
1226
|
+
hints: [
|
|
1227
|
+
{ keys: "\u23CE/Space", label: "toggle" },
|
|
1228
|
+
{ keys: "Esc/q", label: "back" }
|
|
1229
|
+
]
|
|
1230
|
+
}
|
|
1231
|
+
)
|
|
1167
1232
|
] });
|
|
1168
1233
|
}
|
|
1169
1234
|
|
|
1170
1235
|
// packages/experience-design-system-cli/app.tsx
|
|
1171
|
-
import { Fragment as Fragment4, jsx as
|
|
1236
|
+
import { Fragment as Fragment4, jsx as jsx12 } from "react/jsx-runtime";
|
|
1172
1237
|
function App({ onLaunchImport, importExitCode }) {
|
|
1173
1238
|
const returnedFromImport = importExitCode !== void 0;
|
|
1174
1239
|
const [screen, setScreen] = useState11(returnedFromImport ? "import" : "start");
|
|
@@ -1197,12 +1262,12 @@ function App({ onLaunchImport, importExitCode }) {
|
|
|
1197
1262
|
};
|
|
1198
1263
|
switch (screen) {
|
|
1199
1264
|
case "import":
|
|
1200
|
-
if (showImportResult) return /* @__PURE__ */
|
|
1201
|
-
if (importDefaults === void 0) return /* @__PURE__ */
|
|
1265
|
+
if (showImportResult) return /* @__PURE__ */ jsx12(ImportScreen, { exitCode: importExitCode, onDone: finishImportResult });
|
|
1266
|
+
if (importDefaults === void 0) return /* @__PURE__ */ jsx12(Fragment4, {});
|
|
1202
1267
|
if (projectPath === void 0) {
|
|
1203
|
-
return /* @__PURE__ */
|
|
1268
|
+
return /* @__PURE__ */ jsx12(WelcomeScreen, { onContinue: setProjectPath, onQuit: leaveImport, initialPath: importDefaults.componentDir });
|
|
1204
1269
|
}
|
|
1205
|
-
return /* @__PURE__ */
|
|
1270
|
+
return /* @__PURE__ */ jsx12(
|
|
1206
1271
|
TokenInputScreen,
|
|
1207
1272
|
{
|
|
1208
1273
|
initialPath: importDefaults.tokenFile,
|
|
@@ -1212,25 +1277,25 @@ function App({ onLaunchImport, importExitCode }) {
|
|
|
1212
1277
|
}
|
|
1213
1278
|
);
|
|
1214
1279
|
case "help":
|
|
1215
|
-
return /* @__PURE__ */
|
|
1280
|
+
return /* @__PURE__ */ jsx12(HelpScreen, { onDone: goToStart });
|
|
1216
1281
|
case "upgrade":
|
|
1217
|
-
return /* @__PURE__ */
|
|
1282
|
+
return /* @__PURE__ */ jsx12(UpgradeScreen, { onDone: goToStart });
|
|
1218
1283
|
case "settings":
|
|
1219
|
-
return /* @__PURE__ */
|
|
1284
|
+
return /* @__PURE__ */ jsx12(SettingsScreen, { onNavigate: setScreen, onBack: goToStart });
|
|
1220
1285
|
case "settings-configuration":
|
|
1221
|
-
return /* @__PURE__ */
|
|
1286
|
+
return /* @__PURE__ */ jsx12(ConfigurationScreen, { onDone: goToSettings });
|
|
1222
1287
|
case "settings-opt-in-analytics":
|
|
1223
|
-
return /* @__PURE__ */
|
|
1288
|
+
return /* @__PURE__ */ jsx12(OptInAnalyticsScreen, { onDone: goToSettings });
|
|
1224
1289
|
case "settings-debug-mode":
|
|
1225
|
-
return /* @__PURE__ */
|
|
1290
|
+
return /* @__PURE__ */ jsx12(DebugModeScreen, { onDone: goToSettings });
|
|
1226
1291
|
case "start":
|
|
1227
|
-
return /* @__PURE__ */
|
|
1292
|
+
return /* @__PURE__ */ jsx12(HomeScreen, { onNavigate: setScreen });
|
|
1228
1293
|
}
|
|
1229
1294
|
}
|
|
1230
1295
|
async function renderUntilImportRequestedOrExit(renderApp, importExitCode) {
|
|
1231
1296
|
let requestedImport;
|
|
1232
1297
|
const instance = renderApp(
|
|
1233
|
-
/* @__PURE__ */
|
|
1298
|
+
/* @__PURE__ */ jsx12(
|
|
1234
1299
|
App,
|
|
1235
1300
|
{
|
|
1236
1301
|
importExitCode,
|