@contentful/experience-design-system-cli 2.37.1-dev-build-a2454a09.0 → 2.37.1-dev-build-4ce44f69.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
@@ -2138,6 +2138,7 @@ var init_debug_mode_store = __esm({
2138
2138
  var debug_store_exports = {};
2139
2139
  __export(debug_store_exports, {
2140
2140
  currentDebugSessionDir: () => currentDebugSessionDir,
2141
+ currentSessionDir: () => currentSessionDir,
2141
2142
  finishDebugRun: () => finishDebugRun,
2142
2143
  startDebugRun: () => startDebugRun,
2143
2144
  startDebugSessionIn: () => startDebugSessionIn
@@ -2183,6 +2184,9 @@ function startSession(base, { replace }) {
2183
2184
  function currentDebugSessionDir() {
2184
2185
  return sessionDir && join20(sessionDir, "debug");
2185
2186
  }
2187
+ function currentSessionDir() {
2188
+ return sessionDir;
2189
+ }
2186
2190
  async function startDebugSessionIn(base, { replace = false } = {}) {
2187
2191
  try {
2188
2192
  if (!await isDebugModeEnabled()) return;
@@ -27813,6 +27817,9 @@ function startWizardLog() {
27813
27817
  writeFileSync(WIZARD_LOG, `--- experiences import session ${(/* @__PURE__ */ new Date()).toISOString()} ---
27814
27818
  `);
27815
27819
  }
27820
+ async function realSessionDir() {
27821
+ return (await Promise.resolve().then(() => (init_debug_store(), debug_store_exports))).currentSessionDir();
27822
+ }
27816
27823
  function realFlowDeps() {
27817
27824
  const log = (entry) => appendWizardLog(entry);
27818
27825
  return {
@@ -27834,7 +27841,8 @@ function realFlowDeps() {
27834
27841
  buildTimestampedSubdir,
27835
27842
  rejectComponentsByName,
27836
27843
  log,
27837
- stderr: (text) => process.stderr.write(text)
27844
+ stderr: (text) => process.stderr.write(text),
27845
+ sessionDir: realSessionDir
27838
27846
  };
27839
27847
  }
27840
27848
  function initialFlowState(start) {
@@ -27975,6 +27983,9 @@ function createFlowController(start, deps) {
27975
27983
  const startSave = (opts, patch = {}) => {
27976
27984
  pendingSave = opts;
27977
27985
  update({ ...patch, step: "path-prompt" });
27986
+ void deps.sessionDir?.().then((session) => {
27987
+ if (session && state.step === "path-prompt") update({ outDir: join24(session, "dsi-import") });
27988
+ });
27978
27989
  };
27979
27990
  const proceedToWrite = async (path5) => {
27980
27991
  update({ outDir: path5 });
@@ -28113,7 +28124,7 @@ async function readHelpInfo() {
28113
28124
  { label: "Debug Mode", value: debugMode.enabled ? "on" : "off" },
28114
28125
  {
28115
28126
  label: "This session",
28116
- value: !debugMode.enabled ? "no logs written while Debug Mode is off" : currentDebugSessionDir() ?? "not started: set the default project directory in Settings, or start an import"
28127
+ value: !debugMode.enabled ? "no logs written while Debug Mode is off" : currentDebugSessionDir() ?? "not started: set the Root Project Directory in Settings, or start an import"
28117
28128
  }
28118
28129
  ]
28119
28130
  };
@@ -28286,11 +28297,15 @@ var FIELD_LABELS = {
28286
28297
  spaceId: "Space ID",
28287
28298
  environmentId: "Environment ID",
28288
28299
  cmaToken: "CMA Token",
28289
- host: "API Host (optional)",
28290
- defaultComponentDir: "Default component directory (optional)",
28291
- defaultTokenFile: "Default token file (optional)",
28292
- contentfulBaseDir: "Default project directory, where .contentful goes (optional)"
28300
+ host: "API Host",
28301
+ defaultComponentDir: "Default component directory",
28302
+ defaultTokenFile: "Default token file",
28303
+ contentfulBaseDir: "Root Project Directory"
28304
+ };
28305
+ var FIELD_HINTS = {
28306
+ contentfulBaseDir: "(where .contentful goes)"
28293
28307
  };
28308
+ var LABEL_WIDTH = Math.max(...Object.values(FIELD_LABELS).map((label) => label.length));
28294
28309
  function ConfigurationScreen({ onDone }) {
28295
28310
  const [stage, setStage] = useState29("loading");
28296
28311
  const [config, setConfig] = useState29(null);
@@ -28392,10 +28407,7 @@ function ConfigurationScreen({ onDone }) {
28392
28407
  const display = field === "cmaToken" ? "\u2022".repeat(value.length) : value;
28393
28408
  return /* @__PURE__ */ jsxs45(Box44, { gap: 1, children: [
28394
28409
  /* @__PURE__ */ jsx55(Text46, { color: isActive ? PALETTE.accent : void 0, children: isActive ? "\u276F" : " " }),
28395
- /* @__PURE__ */ jsxs45(Text46, { bold: isActive, children: [
28396
- FIELD_LABELS[field],
28397
- ":"
28398
- ] }),
28410
+ /* @__PURE__ */ jsx55(Box44, { width: LABEL_WIDTH, flexShrink: 0, children: /* @__PURE__ */ jsx55(Text46, { bold: isActive, color: isActive ? PALETTE.accent : PALETTE.muted, children: FIELD_LABELS[field] }) }),
28399
28411
  isActive && editing ? /* @__PURE__ */ jsx55(
28400
28412
  TextInput4,
28401
28413
  {
@@ -28404,7 +28416,8 @@ function ConfigurationScreen({ onDone }) {
28404
28416
  onSubmit: () => setEditing(false),
28405
28417
  mask: field === "cmaToken" ? "\u2022" : void 0
28406
28418
  }
28407
- ) : /* @__PURE__ */ jsx55(Text46, { children: display || /* @__PURE__ */ jsx55(Text46, { color: PALETTE.muted, children: "(empty)" }) })
28419
+ ) : /* @__PURE__ */ jsx55(Text46, { bold: !!display, children: display || (FIELD_HINTS[field] ? "" : /* @__PURE__ */ jsx55(Text46, { color: PALETTE.muted, children: "(empty)" })) }),
28420
+ FIELD_HINTS[field] && /* @__PURE__ */ jsx55(Text46, { color: PALETTE.muted, children: FIELD_HINTS[field] })
28408
28421
  ] }, field);
28409
28422
  }) }),
28410
28423
  notice && /* @__PURE__ */ jsxs45(Fragment17, { children: [
package/dist/index.js CHANGED
@@ -20827,6 +20827,7 @@ var init_debug_mode_store = __esm({
20827
20827
  var debug_store_exports = {};
20828
20828
  __export(debug_store_exports, {
20829
20829
  currentDebugSessionDir: () => currentDebugSessionDir,
20830
+ currentSessionDir: () => currentSessionDir,
20830
20831
  finishDebugRun: () => finishDebugRun,
20831
20832
  startDebugRun: () => startDebugRun,
20832
20833
  startDebugSessionIn: () => startDebugSessionIn
@@ -20872,6 +20873,9 @@ function startSession(base, { replace }) {
20872
20873
  function currentDebugSessionDir() {
20873
20874
  return sessionDir && join22(sessionDir, "debug");
20874
20875
  }
20876
+ function currentSessionDir() {
20877
+ return sessionDir;
20878
+ }
20875
20879
  async function startDebugSessionIn(base, { replace = false } = {}) {
20876
20880
  try {
20877
20881
  if (!await isDebugModeEnabled()) return;
@@ -32007,6 +32011,9 @@ function startWizardLog() {
32007
32011
  writeFileSync(WIZARD_LOG, `--- experiences import session ${(/* @__PURE__ */ new Date()).toISOString()} ---
32008
32012
  `);
32009
32013
  }
32014
+ async function realSessionDir() {
32015
+ return (await Promise.resolve().then(() => (init_debug_store(), debug_store_exports))).currentSessionDir();
32016
+ }
32010
32017
  function realFlowDeps() {
32011
32018
  const log = (entry) => appendWizardLog(entry);
32012
32019
  return {
@@ -32028,7 +32035,8 @@ function realFlowDeps() {
32028
32035
  buildTimestampedSubdir,
32029
32036
  rejectComponentsByName,
32030
32037
  log,
32031
- stderr: (text) => process.stderr.write(text)
32038
+ stderr: (text) => process.stderr.write(text),
32039
+ sessionDir: realSessionDir
32032
32040
  };
32033
32041
  }
32034
32042
  function initialFlowState(start) {
@@ -32169,6 +32177,9 @@ function createFlowController(start, deps) {
32169
32177
  const startSave = (opts, patch = {}) => {
32170
32178
  pendingSave = opts;
32171
32179
  update({ ...patch, step: "path-prompt" });
32180
+ void deps.sessionDir?.().then((session) => {
32181
+ if (session && state.step === "path-prompt") update({ outDir: join26(session, "dsi-import") });
32182
+ });
32172
32183
  };
32173
32184
  const proceedToWrite = async (path5) => {
32174
32185
  update({ outDir: path5 });
@@ -32320,7 +32331,7 @@ async function readHelpInfo() {
32320
32331
  { label: "Debug Mode", value: debugMode.enabled ? "on" : "off" },
32321
32332
  {
32322
32333
  label: "This session",
32323
- value: !debugMode.enabled ? "no logs written while Debug Mode is off" : currentDebugSessionDir() ?? "not started: set the default project directory in Settings, or start an import"
32334
+ value: !debugMode.enabled ? "no logs written while Debug Mode is off" : currentDebugSessionDir() ?? "not started: set the Root Project Directory in Settings, or start an import"
32324
32335
  }
32325
32336
  ]
32326
32337
  };
@@ -32616,10 +32627,7 @@ function ConfigurationScreen({ onDone }) {
32616
32627
  const display = field === "cmaToken" ? "\u2022".repeat(value.length) : value;
32617
32628
  return /* @__PURE__ */ jsxs45(Box44, { gap: 1, children: [
32618
32629
  /* @__PURE__ */ jsx55(Text46, { color: isActive ? PALETTE.accent : void 0, children: isActive ? "\u276F" : " " }),
32619
- /* @__PURE__ */ jsxs45(Text46, { bold: isActive, children: [
32620
- FIELD_LABELS[field],
32621
- ":"
32622
- ] }),
32630
+ /* @__PURE__ */ jsx55(Box44, { width: LABEL_WIDTH, flexShrink: 0, children: /* @__PURE__ */ jsx55(Text46, { bold: isActive, color: isActive ? PALETTE.accent : PALETTE.muted, children: FIELD_LABELS[field] }) }),
32623
32631
  isActive && editing ? /* @__PURE__ */ jsx55(
32624
32632
  TextInput4,
32625
32633
  {
@@ -32628,7 +32636,8 @@ function ConfigurationScreen({ onDone }) {
32628
32636
  onSubmit: () => setEditing(false),
32629
32637
  mask: field === "cmaToken" ? "\u2022" : void 0
32630
32638
  }
32631
- ) : /* @__PURE__ */ jsx55(Text46, { children: display || /* @__PURE__ */ jsx55(Text46, { color: PALETTE.muted, children: "(empty)" }) })
32639
+ ) : /* @__PURE__ */ jsx55(Text46, { bold: !!display, children: display || (FIELD_HINTS[field] ? "" : /* @__PURE__ */ jsx55(Text46, { color: PALETTE.muted, children: "(empty)" })) }),
32640
+ FIELD_HINTS[field] && /* @__PURE__ */ jsx55(Text46, { color: PALETTE.muted, children: FIELD_HINTS[field] })
32632
32641
  ] }, field);
32633
32642
  }) }),
32634
32643
  notice && /* @__PURE__ */ jsxs45(Fragment17, { children: [
@@ -32659,7 +32668,7 @@ function ConfigurationScreen({ onDone }) {
32659
32668
  )
32660
32669
  ] });
32661
32670
  }
32662
- var FIELD_ORDER, FIELD_LABELS;
32671
+ var FIELD_ORDER, FIELD_LABELS, FIELD_HINTS, LABEL_WIDTH;
32663
32672
  var init_ContentfulConfigScreen = __esm({
32664
32673
  "packages/experience-design-system-cli/src/tui/settings/contentful-configuration/ContentfulConfigScreen.tsx"() {
32665
32674
  "use strict";
@@ -32680,11 +32689,15 @@ var init_ContentfulConfigScreen = __esm({
32680
32689
  spaceId: "Space ID",
32681
32690
  environmentId: "Environment ID",
32682
32691
  cmaToken: "CMA Token",
32683
- host: "API Host (optional)",
32684
- defaultComponentDir: "Default component directory (optional)",
32685
- defaultTokenFile: "Default token file (optional)",
32686
- contentfulBaseDir: "Default project directory, where .contentful goes (optional)"
32692
+ host: "API Host",
32693
+ defaultComponentDir: "Default component directory",
32694
+ defaultTokenFile: "Default token file",
32695
+ contentfulBaseDir: "Root Project Directory"
32696
+ };
32697
+ FIELD_HINTS = {
32698
+ contentfulBaseDir: "(where .contentful goes)"
32687
32699
  };
32700
+ LABEL_WIDTH = Math.max(...Object.values(FIELD_LABELS).map((label) => label.length));
32688
32701
  }
32689
32702
  });
32690
32703
 
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-a2454a09.0",
3
+ "version": "2.37.1-dev-build-4ce44f69.0",
4
4
  "description": "Contentful Experiences design system import CLI",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -1,6 +1,8 @@
1
1
  type Status = 'success' | 'error';
2
2
  type ExitMethod = 'saved' | 'discarded' | 'crashed';
3
3
  export declare function currentDebugSessionDir(): string | undefined;
4
+ /** This terminal session's folder, `<base>/.contentful/<session>/`, or undefined until it is known. */
5
+ export declare function currentSessionDir(): string | undefined;
4
6
  /**
5
7
  * Starts this terminal session's folder in `base`. The base directory setting being saved passes `replace` so the new
6
8
  * location wins; the import passes nothing and only starts a session when none exists yet. Fail-open like the rest of
@@ -38,6 +38,8 @@ export interface FlowDeps {
38
38
  /** Writes one line of the wizard's step log. */
39
39
  log: (entry: Record<string, unknown>) => void;
40
40
  stderr: (text: string) => void;
41
+ /** This terminal session's folder, when there is one; the saved files default to a `dsi-import` folder inside it. */
42
+ sessionDir?: () => Promise<string | undefined>;
41
43
  }
42
44
  export declare function startWizardLog(): void;
43
45
  export declare function realFlowDeps(): FlowDeps;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentful/experience-design-system-cli",
3
- "version": "2.37.1-dev-build-a2454a09.0",
3
+ "version": "2.37.1-dev-build-4ce44f69.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-a2454a09.0",
3
+ "version": "2.37.1-dev-build-4ce44f69.0",
4
4
  "description": "Contentful Experiences design system import CLI",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -45,8 +45,8 @@
45
45
  "ts-morph": "^27.0.2",
46
46
  "typescript": "^5.9.3",
47
47
  "zod": "^4.6.5",
48
- "@contentful/experience-design-system-backend-pipeline": "2.37.1-dev-build-a2454a09.0",
49
- "@contentful/experience-design-system-types": "2.37.1-dev-build-a2454a09.0"
48
+ "@contentful/experience-design-system-backend-pipeline": "2.37.1-dev-build-4ce44f69.0",
49
+ "@contentful/experience-design-system-types": "2.37.1-dev-build-4ce44f69.0"
50
50
  },
51
51
  "devDependencies": {
52
52
  "@tsconfig/node24": "^24.0.4",