@contentful/experience-design-system-cli 2.37.1-dev-build-d8840d44.0 → 2.37.1-dev-build-33443a39.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 CHANGED
@@ -255,9 +255,8 @@ import TextInput from "ink-text-input";
255
255
  import { useInput as useInput3 } from "ink";
256
256
 
257
257
  // packages/experience-design-system-cli/src/tui/import/steps/01-welcome/logic.ts
258
- function shouldQuit(value, input, key) {
259
- if (key.escape) return true;
260
- return value === "" && input === "q" && !key.ctrl && !key.meta;
258
+ function shouldQuit(key) {
259
+ return key.escape;
261
260
  }
262
261
  function toProjectPath(value) {
263
262
  const projectPath = value.trim();
@@ -267,11 +266,11 @@ function toProjectPath(value) {
267
266
  // packages/experience-design-system-cli/src/tui/import/steps/01-welcome/controls.ts
268
267
  var WELCOME_CONTROLS = [
269
268
  { keys: "Enter", label: "Continue" },
270
- { keys: "Esc/q", label: "Back to menu" }
269
+ { keys: "Esc", label: "Back to menu" }
271
270
  ];
272
- function useWelcomeControls(projectPath, onQuit) {
273
- useInput3((input, key) => {
274
- if (shouldQuit(projectPath, input, key)) onQuit();
271
+ function useWelcomeControls(onQuit) {
272
+ useInput3((_input, key) => {
273
+ if (shouldQuit(key)) onQuit();
275
274
  });
276
275
  }
277
276
 
@@ -287,7 +286,7 @@ var OVERVIEW = [
287
286
  ];
288
287
  function WelcomeScreen({ onContinue, onQuit, initialPath = "" }) {
289
288
  const [projectPath, setProjectPath] = useState3(initialPath);
290
- useWelcomeControls(projectPath, onQuit);
289
+ useWelcomeControls(onQuit);
291
290
  const submit = (value) => {
292
291
  const path = toProjectPath(value);
293
292
  if (path) onContinue(path);
@@ -329,14 +328,8 @@ import TextInput2 from "ink-text-input";
329
328
  import { useInput as useInput4 } from "ink";
330
329
 
331
330
  // packages/experience-design-system-cli/src/tui/import/steps/02-token-input/logic.ts
332
- function isPlainKeyOnEmptyField(value, input, key, expected) {
333
- return value === "" && input === expected && !key.ctrl && !key.meta;
334
- }
335
- function shouldGoBack(value, input, key) {
336
- return key.escape || isPlainKeyOnEmptyField(value, input, key, "q");
337
- }
338
- function shouldSkip(value, input, key) {
339
- return isPlainKeyOnEmptyField(value, input, key, "s");
331
+ function shouldGoBack(key) {
332
+ return key.escape;
340
333
  }
341
334
  function toTokenPath(value) {
342
335
  const tokenPath = value.trim();
@@ -345,14 +338,12 @@ function toTokenPath(value) {
345
338
 
346
339
  // packages/experience-design-system-cli/src/tui/import/steps/02-token-input/controls.ts
347
340
  var TOKEN_INPUT_CONTROLS = [
348
- { keys: "Enter", label: "Continue (skips if empty)" },
349
- { keys: "s", label: "Skip" },
350
- { keys: "Esc/q", label: "Back" }
341
+ { keys: "Enter", label: "Continue" },
342
+ { keys: "Esc", label: "Back" }
351
343
  ];
352
- function useTokenInputControls(tokenPath, onSkip, onBack) {
353
- useInput4((input, key) => {
354
- if (shouldGoBack(tokenPath, input, key)) onBack();
355
- else if (shouldSkip(tokenPath, input, key)) onSkip();
344
+ function useTokenInputControls(onBack) {
345
+ useInput4((_input, key) => {
346
+ if (shouldGoBack(key)) onBack();
356
347
  });
357
348
  }
358
349
 
@@ -390,15 +381,10 @@ function validateTokenPath(rawPath) {
390
381
 
391
382
  // packages/experience-design-system-cli/src/tui/import/steps/02-token-input/screen.tsx
392
383
  import { jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
393
- function TokenInputScreen({
394
- onConfirm,
395
- onSkip,
396
- onBack,
397
- initialPath = ""
398
- }) {
384
+ function TokenInputScreen({ onConfirm, onBack, initialPath = "" }) {
399
385
  const [tokenPath, setTokenPath] = useState4(initialPath);
400
386
  const [failure, setFailure] = useState4(null);
401
- useTokenInputControls(tokenPath, onSkip, onBack);
387
+ useTokenInputControls(onBack);
402
388
  const change = (value) => {
403
389
  setTokenPath(value);
404
390
  setFailure(null);
@@ -406,7 +392,7 @@ function TokenInputScreen({
406
392
  const submit = (value) => {
407
393
  const rawPath = toTokenPath(value);
408
394
  if (!rawPath) {
409
- onSkip();
395
+ setFailure({ error: "Enter the path to your token file." });
410
396
  return;
411
397
  }
412
398
  const check = validateTokenPath(rawPath);
@@ -427,7 +413,7 @@ function TokenInputScreen({
427
413
  "\u2717 ",
428
414
  failure.error
429
415
  ] }),
430
- /* @__PURE__ */ jsxs4(Text5, { dimColor: true, children: [
416
+ failure.resolvedPath && /* @__PURE__ */ jsxs4(Text5, { dimColor: true, children: [
431
417
  " Resolved to: ",
432
418
  failure.resolvedPath
433
419
  ] })
@@ -1272,7 +1258,6 @@ function App({ onLaunchImport, importExitCode }) {
1272
1258
  {
1273
1259
  initialPath: importDefaults.tokenFile,
1274
1260
  onConfirm: (tokens) => onLaunchImport?.({ project: projectPath, tokens }),
1275
- onSkip: () => onLaunchImport?.({ project: projectPath }),
1276
1261
  onBack: () => setProjectPath(void 0)
1277
1262
  }
1278
1263
  );
package/dist/index.js CHANGED
@@ -321,9 +321,8 @@ var init_PageContainer = __esm({
321
321
  });
322
322
 
323
323
  // packages/experience-design-system-cli/src/tui/import/steps/01-welcome/logic.ts
324
- function shouldQuit(value, input, key) {
325
- if (key.escape) return true;
326
- return value === "" && input === "q" && !key.ctrl && !key.meta;
324
+ function shouldQuit(key) {
325
+ return key.escape;
327
326
  }
328
327
  function toProjectPath(value) {
329
328
  const projectPath = value.trim();
@@ -337,9 +336,9 @@ var init_logic = __esm({
337
336
 
338
337
  // packages/experience-design-system-cli/src/tui/import/steps/01-welcome/controls.ts
339
338
  import { useInput as useInput3 } from "ink";
340
- function useWelcomeControls(projectPath, onQuit) {
341
- useInput3((input, key) => {
342
- if (shouldQuit(projectPath, input, key)) onQuit();
339
+ function useWelcomeControls(onQuit) {
340
+ useInput3((_input, key) => {
341
+ if (shouldQuit(key)) onQuit();
343
342
  });
344
343
  }
345
344
  var WELCOME_CONTROLS;
@@ -349,7 +348,7 @@ var init_controls = __esm({
349
348
  init_logic();
350
349
  WELCOME_CONTROLS = [
351
350
  { keys: "Enter", label: "Continue" },
352
- { keys: "Esc/q", label: "Back to menu" }
351
+ { keys: "Esc", label: "Back to menu" }
353
352
  ];
354
353
  }
355
354
  });
@@ -361,7 +360,7 @@ import TextInput from "ink-text-input";
361
360
  import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
362
361
  function WelcomeScreen({ onContinue, onQuit, initialPath = "" }) {
363
362
  const [projectPath, setProjectPath] = useState3(initialPath);
364
- useWelcomeControls(projectPath, onQuit);
363
+ useWelcomeControls(onQuit);
365
364
  const submit = (value) => {
366
365
  const path = toProjectPath(value);
367
366
  if (path) onContinue(path);
@@ -412,14 +411,8 @@ var init_screen = __esm({
412
411
  });
413
412
 
414
413
  // packages/experience-design-system-cli/src/tui/import/steps/02-token-input/logic.ts
415
- function isPlainKeyOnEmptyField(value, input, key, expected) {
416
- return value === "" && input === expected && !key.ctrl && !key.meta;
417
- }
418
- function shouldGoBack(value, input, key) {
419
- return key.escape || isPlainKeyOnEmptyField(value, input, key, "q");
420
- }
421
- function shouldSkip(value, input, key) {
422
- return isPlainKeyOnEmptyField(value, input, key, "s");
414
+ function shouldGoBack(key) {
415
+ return key.escape;
423
416
  }
424
417
  function toTokenPath(value) {
425
418
  const tokenPath = value.trim();
@@ -433,10 +426,9 @@ var init_logic2 = __esm({
433
426
 
434
427
  // packages/experience-design-system-cli/src/tui/import/steps/02-token-input/controls.ts
435
428
  import { useInput as useInput4 } from "ink";
436
- function useTokenInputControls(tokenPath, onSkip, onBack) {
437
- useInput4((input, key) => {
438
- if (shouldGoBack(tokenPath, input, key)) onBack();
439
- else if (shouldSkip(tokenPath, input, key)) onSkip();
429
+ function useTokenInputControls(onBack) {
430
+ useInput4((_input, key) => {
431
+ if (shouldGoBack(key)) onBack();
440
432
  });
441
433
  }
442
434
  var TOKEN_INPUT_CONTROLS;
@@ -445,9 +437,8 @@ var init_controls2 = __esm({
445
437
  "use strict";
446
438
  init_logic2();
447
439
  TOKEN_INPUT_CONTROLS = [
448
- { keys: "Enter", label: "Continue (skips if empty)" },
449
- { keys: "s", label: "Skip" },
450
- { keys: "Esc/q", label: "Back" }
440
+ { keys: "Enter", label: "Continue" },
441
+ { keys: "Esc", label: "Back" }
451
442
  ];
452
443
  }
453
444
  });
@@ -494,15 +485,10 @@ import { useState as useState4 } from "react";
494
485
  import { Box as Box4, Text as Text5 } from "ink";
495
486
  import TextInput2 from "ink-text-input";
496
487
  import { jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
497
- function TokenInputScreen({
498
- onConfirm,
499
- onSkip,
500
- onBack,
501
- initialPath = ""
502
- }) {
488
+ function TokenInputScreen({ onConfirm, onBack, initialPath = "" }) {
503
489
  const [tokenPath, setTokenPath] = useState4(initialPath);
504
490
  const [failure, setFailure] = useState4(null);
505
- useTokenInputControls(tokenPath, onSkip, onBack);
491
+ useTokenInputControls(onBack);
506
492
  const change = (value) => {
507
493
  setTokenPath(value);
508
494
  setFailure(null);
@@ -510,7 +496,7 @@ function TokenInputScreen({
510
496
  const submit = (value) => {
511
497
  const rawPath = toTokenPath(value);
512
498
  if (!rawPath) {
513
- onSkip();
499
+ setFailure({ error: "Enter the path to your token file." });
514
500
  return;
515
501
  }
516
502
  const check = validateTokenPath(rawPath);
@@ -531,7 +517,7 @@ function TokenInputScreen({
531
517
  "\u2717 ",
532
518
  failure.error
533
519
  ] }),
534
- /* @__PURE__ */ jsxs4(Text5, { dimColor: true, children: [
520
+ failure.resolvedPath && /* @__PURE__ */ jsxs4(Text5, { dimColor: true, children: [
535
521
  " Resolved to: ",
536
522
  failure.resolvedPath
537
523
  ] })
@@ -1485,7 +1471,6 @@ function App({ onLaunchImport, importExitCode }) {
1485
1471
  {
1486
1472
  initialPath: importDefaults.tokenFile,
1487
1473
  onConfirm: (tokens) => onLaunchImport?.({ project: projectPath, tokens }),
1488
- onSkip: () => onLaunchImport?.({ project: projectPath }),
1489
1474
  onBack: () => setProjectPath(void 0)
1490
1475
  }
1491
1476
  );
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentful/experience-design-system-cli",
3
- "version": "2.37.1-dev-build-d8840d44.0",
3
+ "version": "2.37.1-dev-build-33443a39.0",
4
4
  "description": "Contentful Experiences design system import CLI",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -2,7 +2,7 @@ export declare const WELCOME_CONTROLS: readonly [{
2
2
  readonly keys: "Enter";
3
3
  readonly label: "Continue";
4
4
  }, {
5
- readonly keys: "Esc/q";
5
+ readonly keys: "Esc";
6
6
  readonly label: "Back to menu";
7
7
  }];
8
- export declare function useWelcomeControls(projectPath: string, onQuit: () => void): void;
8
+ export declare function useWelcomeControls(onQuit: () => void): void;
@@ -1,8 +1,6 @@
1
1
  interface QuitKey {
2
2
  escape: boolean;
3
- ctrl: boolean;
4
- meta: boolean;
5
3
  }
6
- export declare function shouldQuit(value: string, input: string, key: QuitKey): boolean;
4
+ export declare function shouldQuit(key: QuitKey): boolean;
7
5
  export declare function toProjectPath(value: string): string | null;
8
6
  export {};
@@ -1,11 +1,8 @@
1
1
  export declare const TOKEN_INPUT_CONTROLS: readonly [{
2
2
  readonly keys: "Enter";
3
- readonly label: "Continue (skips if empty)";
3
+ readonly label: "Continue";
4
4
  }, {
5
- readonly keys: "s";
6
- readonly label: "Skip";
7
- }, {
8
- readonly keys: "Esc/q";
5
+ readonly keys: "Esc";
9
6
  readonly label: "Back";
10
7
  }];
11
- export declare function useTokenInputControls(tokenPath: string, onSkip: () => void, onBack: () => void): void;
8
+ export declare function useTokenInputControls(onBack: () => void): void;
@@ -1,9 +1,6 @@
1
1
  interface Key {
2
2
  escape: boolean;
3
- ctrl: boolean;
4
- meta: boolean;
5
3
  }
6
- export declare function shouldGoBack(value: string, input: string, key: Key): boolean;
7
- export declare function shouldSkip(value: string, input: string, key: Key): boolean;
4
+ export declare function shouldGoBack(key: Key): boolean;
8
5
  export declare function toTokenPath(value: string): string | null;
9
6
  export {};
@@ -1,9 +1,8 @@
1
1
  import React from 'react';
2
2
  interface TokenInputScreenProps {
3
3
  onConfirm: (tokensPath: string) => void;
4
- onSkip: () => void;
5
4
  onBack: () => void;
6
5
  initialPath?: string;
7
6
  }
8
- export declare function TokenInputScreen({ onConfirm, onSkip, onBack, initialPath, }: TokenInputScreenProps): React.ReactElement;
7
+ export declare function TokenInputScreen({ onConfirm, onBack, initialPath }: TokenInputScreenProps): React.ReactElement;
9
8
  export {};
@@ -1,4 +1,4 @@
1
- export interface TokenPathFailure {
1
+ interface TokenPathFailure {
2
2
  error: string;
3
3
  resolvedPath: string;
4
4
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentful/experience-design-system-cli",
3
- "version": "2.37.1-dev-build-d8840d44.0",
3
+ "version": "2.37.1-dev-build-33443a39.0",
4
4
  "description": "Contentful Experiences design system import CLI",
5
5
  "license": "MIT",
6
6
  "type": "module",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentful/experience-design-system-cli",
3
- "version": "2.37.1-dev-build-d8840d44.0",
3
+ "version": "2.37.1-dev-build-33443a39.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.37.1-dev-build-d8840d44.0"
45
+ "@contentful/experience-design-system-types": "2.37.1-dev-build-33443a39.0"
46
46
  },
47
47
  "devDependencies": {
48
48
  "@tsconfig/node24": "^24.0.4",