@contentful/experience-design-system-cli 2.36.2-dev-build-450d231a.0 → 2.36.2-dev-build-81b9ff09.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 +14 -23
- package/dist/index.js +14 -23
- package/dist/package.json +1 -1
- package/dist/src/tui/import/steps/01-welcome/controls.d.ts +2 -2
- package/dist/src/tui/import/steps/01-welcome/logic.d.ts +1 -3
- package/dist/src/tui/import/steps/02-token-input/controls.d.ts +2 -5
- package/dist/src/tui/import/steps/02-token-input/logic.d.ts +1 -4
- package/legacy/package.json +1 -1
- package/package.json +2 -2
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(
|
|
259
|
-
|
|
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
|
|
269
|
+
{ keys: "Esc", label: "Back to menu" }
|
|
271
270
|
];
|
|
272
|
-
function useWelcomeControls(
|
|
273
|
-
useInput3((
|
|
274
|
-
if (shouldQuit(
|
|
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(
|
|
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
|
|
333
|
-
return
|
|
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();
|
|
@@ -346,13 +339,11 @@ function toTokenPath(value) {
|
|
|
346
339
|
// packages/experience-design-system-cli/src/tui/import/steps/02-token-input/controls.ts
|
|
347
340
|
var TOKEN_INPUT_CONTROLS = [
|
|
348
341
|
{ keys: "Enter", label: "Continue (skips if empty)" },
|
|
349
|
-
{ keys: "
|
|
350
|
-
{ keys: "Esc/q", label: "Back" }
|
|
342
|
+
{ keys: "Esc", label: "Back" }
|
|
351
343
|
];
|
|
352
|
-
function useTokenInputControls(
|
|
353
|
-
useInput4((
|
|
354
|
-
if (shouldGoBack(
|
|
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
|
|
|
@@ -398,7 +389,7 @@ function TokenInputScreen({
|
|
|
398
389
|
}) {
|
|
399
390
|
const [tokenPath, setTokenPath] = useState4(initialPath);
|
|
400
391
|
const [failure, setFailure] = useState4(null);
|
|
401
|
-
useTokenInputControls(
|
|
392
|
+
useTokenInputControls(onBack);
|
|
402
393
|
const change = (value) => {
|
|
403
394
|
setTokenPath(value);
|
|
404
395
|
setFailure(null);
|
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(
|
|
325
|
-
|
|
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(
|
|
341
|
-
useInput3((
|
|
342
|
-
if (shouldQuit(
|
|
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
|
|
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(
|
|
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
|
|
416
|
-
return
|
|
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(
|
|
437
|
-
useInput4((
|
|
438
|
-
if (shouldGoBack(
|
|
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;
|
|
@@ -446,8 +438,7 @@ var init_controls2 = __esm({
|
|
|
446
438
|
init_logic2();
|
|
447
439
|
TOKEN_INPUT_CONTROLS = [
|
|
448
440
|
{ keys: "Enter", label: "Continue (skips if empty)" },
|
|
449
|
-
{ keys: "
|
|
450
|
-
{ keys: "Esc/q", label: "Back" }
|
|
441
|
+
{ keys: "Esc", label: "Back" }
|
|
451
442
|
];
|
|
452
443
|
}
|
|
453
444
|
});
|
|
@@ -502,7 +493,7 @@ function TokenInputScreen({
|
|
|
502
493
|
}) {
|
|
503
494
|
const [tokenPath, setTokenPath] = useState4(initialPath);
|
|
504
495
|
const [failure, setFailure] = useState4(null);
|
|
505
|
-
useTokenInputControls(
|
|
496
|
+
useTokenInputControls(onBack);
|
|
506
497
|
const change = (value) => {
|
|
507
498
|
setTokenPath(value);
|
|
508
499
|
setFailure(null);
|
package/dist/package.json
CHANGED
|
@@ -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
|
|
5
|
+
readonly keys: "Esc";
|
|
6
6
|
readonly label: "Back to menu";
|
|
7
7
|
}];
|
|
8
|
-
export declare function useWelcomeControls(
|
|
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(
|
|
4
|
+
export declare function shouldQuit(key: QuitKey): boolean;
|
|
7
5
|
export declare function toProjectPath(value: string): string | null;
|
|
8
6
|
export {};
|
|
@@ -2,10 +2,7 @@ export declare const TOKEN_INPUT_CONTROLS: readonly [{
|
|
|
2
2
|
readonly keys: "Enter";
|
|
3
3
|
readonly label: "Continue (skips if empty)";
|
|
4
4
|
}, {
|
|
5
|
-
readonly keys: "
|
|
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(
|
|
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(
|
|
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 {};
|
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-81b9ff09.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-81b9ff09.0"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@tsconfig/node24": "^24.0.4",
|