@contentful/experience-design-system-cli 2.35.1-dev-build-d5a8fc4d.0 → 2.35.1-dev-build-c4a4d1cd.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
@@ -251,52 +251,6 @@ ${candidates.join("\n")}`);
251
251
  return found;
252
252
  }
253
253
 
254
- // packages/experience-design-system-cli/src/tui/import/spawn-v1-import.ts
255
- function buildArgs(options) {
256
- const args = ["import"];
257
- if (options.project) {
258
- args.push("--project", options.project);
259
- }
260
- return args;
261
- }
262
- async function spawnV1Import(options = {}) {
263
- const cliPath = findLegacyCliPath();
264
- const args = buildArgs(options);
265
- return new Promise((resolvePromise) => {
266
- const child = spawn("node", [cliPath, ...args], {
267
- stdio: "inherit"
268
- });
269
- child.on("close", (code) => {
270
- resolvePromise({ exitCode: code ?? 1, result: void 0, stdout: "", stderr: "" });
271
- });
272
- child.on("error", (err) => {
273
- resolvePromise({ exitCode: 1, result: void 0, stdout: "", stderr: err.message });
274
- });
275
- });
276
- }
277
-
278
- // packages/experience-design-system-cli/src/tui/import/terminal-input.ts
279
- function getTerminalHandle() {
280
- return process.stdin._handle;
281
- }
282
- async function stopReadingTerminal() {
283
- await new Promise((resolve) => setImmediate(resolve));
284
- const handle = getTerminalHandle();
285
- if (!handle?.readStop) return;
286
- handle.reading = false;
287
- handle.readStop();
288
- }
289
- function startReadingTerminal() {
290
- const handle = getTerminalHandle();
291
- if (!handle?.readStart) return;
292
- handle.reading = true;
293
- handle.readStart();
294
- }
295
-
296
- // packages/experience-design-system-cli/src/tui/help/PageContainer.tsx
297
- import { useEffect as useEffect3 } from "react";
298
- import { Box as Box3, Text as Text3, useInput as useInput3 } from "ink";
299
-
300
254
  // packages/experience-design-system-cli/src/tui/debug-store.ts
301
255
  import { mkdir as mkdir2, writeFile as writeFile2 } from "node:fs/promises";
302
256
  import { existsSync as existsSync3, readdirSync } from "node:fs";
@@ -361,6 +315,9 @@ var SESSION_ID = generateSessionId();
361
315
  function sessionDebugDir() {
362
316
  return join5(sessionsRootDir(), SESSION_ID);
363
317
  }
318
+ async function debugSessionDirIfEnabled() {
319
+ return await isDebugModeEnabled() ? sessionDebugDir() : void 0;
320
+ }
364
321
  void isDebugModeEnabled().then((enabled) => {
365
322
  if (!enabled) return void 0;
366
323
  return mkdir2(sessionDebugDir(), { recursive: true });
@@ -468,7 +425,53 @@ process.once("SIGINT", () => {
468
425
  });
469
426
  });
470
427
 
428
+ // packages/experience-design-system-cli/src/tui/import/spawn-v1-import.ts
429
+ function buildArgs(options) {
430
+ const args = ["import"];
431
+ if (options.project) {
432
+ args.push("--project", options.project);
433
+ }
434
+ return args;
435
+ }
436
+ async function spawnV1Import(options = {}) {
437
+ const cliPath = findLegacyCliPath();
438
+ const args = buildArgs(options);
439
+ const debugSessionDir = await debugSessionDirIfEnabled();
440
+ return new Promise((resolvePromise) => {
441
+ const child = spawn("node", [cliPath, ...args], {
442
+ stdio: "inherit",
443
+ env: debugSessionDir ? { ...process.env, EDS_DEBUG_SESSION_DIR: debugSessionDir } : process.env
444
+ });
445
+ child.on("close", (code) => {
446
+ resolvePromise({ exitCode: code ?? 1, result: void 0, stdout: "", stderr: "" });
447
+ });
448
+ child.on("error", (err) => {
449
+ resolvePromise({ exitCode: 1, result: void 0, stdout: "", stderr: err.message });
450
+ });
451
+ });
452
+ }
453
+
454
+ // packages/experience-design-system-cli/src/tui/import/terminal-input.ts
455
+ function getTerminalHandle() {
456
+ return process.stdin._handle;
457
+ }
458
+ async function stopReadingTerminal() {
459
+ await new Promise((resolve) => setImmediate(resolve));
460
+ const handle = getTerminalHandle();
461
+ if (!handle?.readStop) return;
462
+ handle.reading = false;
463
+ handle.readStop();
464
+ }
465
+ function startReadingTerminal() {
466
+ const handle = getTerminalHandle();
467
+ if (!handle?.readStart) return;
468
+ handle.reading = true;
469
+ handle.readStart();
470
+ }
471
+
471
472
  // packages/experience-design-system-cli/src/tui/help/PageContainer.tsx
473
+ import { useEffect as useEffect3 } from "react";
474
+ import { Box as Box3, Text as Text3, useInput as useInput3 } from "ink";
472
475
  import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
473
476
  function HelpScreen({ onDone }) {
474
477
  useEffect3(() => {
package/dist/index.js CHANGED
@@ -297,60 +297,6 @@ var init_PageContainer = __esm({
297
297
  }
298
298
  });
299
299
 
300
- // packages/experience-design-system-cli/src/tui/import/spawn-v1-import.ts
301
- import { spawn as spawn2 } from "node:child_process";
302
- function buildArgs(options) {
303
- const args = ["import"];
304
- if (options.project) {
305
- args.push("--project", options.project);
306
- }
307
- return args;
308
- }
309
- async function spawnV1Import(options = {}) {
310
- const cliPath = findLegacyCliPath();
311
- const args = buildArgs(options);
312
- return new Promise((resolvePromise) => {
313
- const child = spawn2("node", [cliPath, ...args], {
314
- stdio: "inherit"
315
- });
316
- child.on("close", (code) => {
317
- resolvePromise({ exitCode: code ?? 1, result: void 0, stdout: "", stderr: "" });
318
- });
319
- child.on("error", (err) => {
320
- resolvePromise({ exitCode: 1, result: void 0, stdout: "", stderr: err.message });
321
- });
322
- });
323
- }
324
- var init_spawn_v1_import = __esm({
325
- "packages/experience-design-system-cli/src/tui/import/spawn-v1-import.ts"() {
326
- "use strict";
327
- init_legacy_cli_path();
328
- }
329
- });
330
-
331
- // packages/experience-design-system-cli/src/tui/import/terminal-input.ts
332
- function getTerminalHandle() {
333
- return process.stdin._handle;
334
- }
335
- async function stopReadingTerminal() {
336
- await new Promise((resolve) => setImmediate(resolve));
337
- const handle = getTerminalHandle();
338
- if (!handle?.readStop) return;
339
- handle.reading = false;
340
- handle.readStop();
341
- }
342
- function startReadingTerminal() {
343
- const handle = getTerminalHandle();
344
- if (!handle?.readStart) return;
345
- handle.reading = true;
346
- handle.readStart();
347
- }
348
- var init_terminal_input = __esm({
349
- "packages/experience-design-system-cli/src/tui/import/terminal-input.ts"() {
350
- "use strict";
351
- }
352
- });
353
-
354
300
  // packages/experience-design-system-cli/src/tui/settings/debug-mode/debug-mode-store.ts
355
301
  import { mkdir, readFile, writeFile } from "node:fs/promises";
356
302
  import { dirname as dirname2, join as join4 } from "node:path";
@@ -417,6 +363,9 @@ function generateSessionId() {
417
363
  function sessionDebugDir() {
418
364
  return join5(sessionsRootDir(), SESSION_ID);
419
365
  }
366
+ async function debugSessionDirIfEnabled() {
367
+ return await isDebugModeEnabled() ? sessionDebugDir() : void 0;
368
+ }
420
369
  async function isDebugModeEnabled() {
421
370
  try {
422
371
  return (await readDebugModeSetting()).enabled;
@@ -535,6 +484,63 @@ var init_debug_store = __esm({
535
484
  }
536
485
  });
537
486
 
487
+ // packages/experience-design-system-cli/src/tui/import/spawn-v1-import.ts
488
+ import { spawn as spawn2 } from "node:child_process";
489
+ function buildArgs(options) {
490
+ const args = ["import"];
491
+ if (options.project) {
492
+ args.push("--project", options.project);
493
+ }
494
+ return args;
495
+ }
496
+ async function spawnV1Import(options = {}) {
497
+ const cliPath = findLegacyCliPath();
498
+ const args = buildArgs(options);
499
+ const debugSessionDir = await debugSessionDirIfEnabled();
500
+ return new Promise((resolvePromise) => {
501
+ const child = spawn2("node", [cliPath, ...args], {
502
+ stdio: "inherit",
503
+ env: debugSessionDir ? { ...process.env, EDS_DEBUG_SESSION_DIR: debugSessionDir } : process.env
504
+ });
505
+ child.on("close", (code) => {
506
+ resolvePromise({ exitCode: code ?? 1, result: void 0, stdout: "", stderr: "" });
507
+ });
508
+ child.on("error", (err) => {
509
+ resolvePromise({ exitCode: 1, result: void 0, stdout: "", stderr: err.message });
510
+ });
511
+ });
512
+ }
513
+ var init_spawn_v1_import = __esm({
514
+ "packages/experience-design-system-cli/src/tui/import/spawn-v1-import.ts"() {
515
+ "use strict";
516
+ init_legacy_cli_path();
517
+ init_debug_store();
518
+ }
519
+ });
520
+
521
+ // packages/experience-design-system-cli/src/tui/import/terminal-input.ts
522
+ function getTerminalHandle() {
523
+ return process.stdin._handle;
524
+ }
525
+ async function stopReadingTerminal() {
526
+ await new Promise((resolve) => setImmediate(resolve));
527
+ const handle = getTerminalHandle();
528
+ if (!handle?.readStop) return;
529
+ handle.reading = false;
530
+ handle.readStop();
531
+ }
532
+ function startReadingTerminal() {
533
+ const handle = getTerminalHandle();
534
+ if (!handle?.readStart) return;
535
+ handle.reading = true;
536
+ handle.readStart();
537
+ }
538
+ var init_terminal_input = __esm({
539
+ "packages/experience-design-system-cli/src/tui/import/terminal-input.ts"() {
540
+ "use strict";
541
+ }
542
+ });
543
+
538
544
  // packages/experience-design-system-cli/src/tui/help/PageContainer.tsx
539
545
  import { useEffect as useEffect3 } from "react";
540
546
  import { Box as Box3, Text as Text3, useInput as useInput3 } from "ink";
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentful/experience-design-system-cli",
3
- "version": "2.35.1-dev-build-d5a8fc4d.0",
3
+ "version": "2.35.1-dev-build-c4a4d1cd.0",
4
4
  "description": "Contentful Experiences design system import CLI",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -1,5 +1,6 @@
1
1
  type Status = 'success' | 'error';
2
2
  type ExitMethod = 'saved' | 'discarded' | 'crashed';
3
+ export declare function debugSessionDirIfEnabled(): Promise<string | undefined>;
3
4
  export declare function startDebugRun({ flow, step, menuOption, inputs, }: {
4
5
  flow: string;
5
6
  step: string;
@@ -1213,8 +1213,8 @@ function makeSessionTimestamp() {
1213
1213
  const override = process.env["EDSI_DEBUG_TS"];
1214
1214
  if (override) return override;
1215
1215
  const now = /* @__PURE__ */ new Date();
1216
- const pad = (n, w = 2) => n.toString().padStart(w, "0");
1217
- return `${now.getUTCFullYear()}${pad(now.getUTCMonth() + 1)}${pad(now.getUTCDate())}T${pad(now.getUTCHours())}${pad(now.getUTCMinutes())}${pad(now.getUTCSeconds())}Z`;
1216
+ const pad3 = (n, w = 2) => n.toString().padStart(w, "0");
1217
+ return `${now.getUTCFullYear()}${pad3(now.getUTCMonth() + 1)}${pad3(now.getUTCDate())}T${pad3(now.getUTCHours())}${pad3(now.getUTCMinutes())}${pad3(now.getUTCSeconds())}Z`;
1218
1218
  }
1219
1219
  function initDebugLogger(opts) {
1220
1220
  if (singleton) return singleton;
@@ -9201,6 +9201,88 @@ var init_run_teaser = __esm({
9201
9201
  }
9202
9202
  });
9203
9203
 
9204
+ // packages/experience-design-system-cli-legacy/src/lib/push-debug-log.ts
9205
+ import { existsSync as existsSync3, mkdirSync as mkdirSync3, readdirSync, writeFileSync } from "node:fs";
9206
+ import { join as join10 } from "node:path";
9207
+ function scrub(_key, value) {
9208
+ if (/^cma_?token$/i.test(_key))
9209
+ return typeof value === "string" && value ? `[present, ${value.length} chars]` : "[not set]";
9210
+ if (typeof value === "string" && SECRET_VALUE.test(value)) return "[redacted]";
9211
+ return value;
9212
+ }
9213
+ function pad(n) {
9214
+ return String(n).padStart(2, "0");
9215
+ }
9216
+ function datePrefix(now) {
9217
+ return `${pad(now.getMonth() + 1)}-${pad(now.getDate())}-${now.getFullYear()}`;
9218
+ }
9219
+ function nextFilename(dir, now) {
9220
+ const today = datePrefix(now);
9221
+ const pattern = new RegExp(`^${today}-push-attempt-(\\d+)\\.md$`);
9222
+ const existing = existsSync3(dir) ? readdirSync(dir) : [];
9223
+ const max = existing.reduce((acc, entry) => {
9224
+ const match2 = pattern.exec(entry);
9225
+ return match2 ? Math.max(acc, Number(match2[1])) : acc;
9226
+ }, 0);
9227
+ return `${today}-push-attempt-${max + 1}.md`;
9228
+ }
9229
+ function render2(runId, inputs, outputs, status, durationMs, now) {
9230
+ return `# Debug Log
9231
+
9232
+ - Run ID: ${runId}
9233
+ - Flow: import
9234
+ - Step: 01 - push
9235
+ - Menu option: Push
9236
+ - Date: ${now.toISOString()}
9237
+ - CLI version: ${cliVersion()}
9238
+ - Platform: ${process.platform} / Node ${process.version}
9239
+ - Duration on screen: ${durationMs}ms
9240
+ - Status: ${status}
9241
+ - Exit method: completed
9242
+
9243
+ ## Inputs
9244
+ \`\`\`json
9245
+ ${JSON.stringify(inputs, scrub, 2)}
9246
+ \`\`\`
9247
+
9248
+ ## Outputs
9249
+ \`\`\`json
9250
+ ${JSON.stringify(outputs, scrub, 2)}
9251
+ \`\`\`
9252
+ `;
9253
+ }
9254
+ function startPushDebugRun(inputs) {
9255
+ const sessionDir = process.env[DEBUG_SESSION_DIR_ENV];
9256
+ if (!sessionDir) return NOOP_RUN;
9257
+ const startedAt = Date.now();
9258
+ let finished = false;
9259
+ return {
9260
+ finish(outputs, status) {
9261
+ if (finished) return;
9262
+ finished = true;
9263
+ try {
9264
+ const now = /* @__PURE__ */ new Date();
9265
+ const dir = join10(sessionDir, "import");
9266
+ mkdirSync3(dir, { recursive: true });
9267
+ const runId = `${now.getFullYear()}${pad(now.getMonth() + 1)}${pad(now.getDate())}-${pad(now.getHours())}${pad(now.getMinutes())}${pad(now.getSeconds())}`;
9268
+ const content = render2(runId, inputs, outputs, status, Date.now() - startedAt, now);
9269
+ writeFileSync(join10(dir, nextFilename(dir, now)), content, { mode: 384 });
9270
+ } catch {
9271
+ }
9272
+ }
9273
+ };
9274
+ }
9275
+ var DEBUG_SESSION_DIR_ENV, NOOP_RUN, SECRET_VALUE;
9276
+ var init_push_debug_log = __esm({
9277
+ "packages/experience-design-system-cli-legacy/src/lib/push-debug-log.ts"() {
9278
+ "use strict";
9279
+ init_client();
9280
+ DEBUG_SESSION_DIR_ENV = "EDS_DEBUG_SESSION_DIR";
9281
+ NOOP_RUN = { finish: () => void 0 };
9282
+ SECRET_VALUE = /CFPAT-[A-Za-z0-9_-]{20,}|^Bearer\s+\S+/;
9283
+ }
9284
+ });
9285
+
9204
9286
  // packages/experience-design-system-cli-legacy/src/tui/use-blinking-cursor.ts
9205
9287
  import { useEffect as useEffect2, useState as useState3 } from "react";
9206
9288
  function useBlinkingCursor() {
@@ -9220,8 +9302,8 @@ var init_use_blinking_cursor = __esm({
9220
9302
  // packages/experience-design-system-cli-legacy/src/runs/path-prompt.tsx
9221
9303
  import { useState as useState4 } from "react";
9222
9304
  import { Box as Box6, Text as Text7 } from "ink";
9223
- import { readdirSync } from "node:fs";
9224
- import { dirname as dirname5, basename as basename2, join as join10 } from "node:path";
9305
+ import { readdirSync as readdirSync2 } from "node:fs";
9306
+ import { dirname as dirname5, basename as basename2, join as join11 } from "node:path";
9225
9307
  import { jsx as jsx9, jsxs as jsxs6 } from "react/jsx-runtime";
9226
9308
  function autocomplete(partial) {
9227
9309
  if (!partial) return null;
@@ -9230,19 +9312,19 @@ function autocomplete(partial) {
9230
9312
  const base = basename2(normalized);
9231
9313
  let entries;
9232
9314
  try {
9233
- entries = readdirSync(dir);
9315
+ entries = readdirSync2(dir);
9234
9316
  } catch {
9235
9317
  return null;
9236
9318
  }
9237
9319
  const matches = entries.filter((e) => e.startsWith(base));
9238
9320
  if (matches.length === 0) return null;
9239
- if (matches.length === 1) return join10(dir, matches[0]);
9321
+ if (matches.length === 1) return join11(dir, matches[0]);
9240
9322
  let prefix = matches[0];
9241
9323
  for (const m of matches) {
9242
9324
  while (!m.startsWith(prefix)) prefix = prefix.slice(0, -1);
9243
9325
  if (!prefix) break;
9244
9326
  }
9245
- return prefix.length > base.length ? join10(dir, prefix) : null;
9327
+ return prefix.length > base.length ? join11(dir, prefix) : null;
9246
9328
  }
9247
9329
  function PathPrompt({
9248
9330
  defaultPath,
@@ -9307,12 +9389,12 @@ var init_path_prompt = __esm({
9307
9389
 
9308
9390
  // packages/experience-design-system-cli-legacy/src/runs/save-path-resolver.ts
9309
9391
  import { access as access4 } from "node:fs/promises";
9310
- import { join as join11 } from "node:path";
9392
+ import { join as join12 } from "node:path";
9311
9393
  async function listConflictingFiles(path) {
9312
9394
  const conflicts = [];
9313
9395
  for (const name of SAVE_FILES) {
9314
9396
  try {
9315
- await access4(join11(path, name));
9397
+ await access4(join12(path, name));
9316
9398
  conflicts.push(name);
9317
9399
  } catch {
9318
9400
  }
@@ -9332,7 +9414,7 @@ function buildTimestampedSubdir(base, now = /* @__PURE__ */ new Date()) {
9332
9414
  const hh = pad2(now.getHours());
9333
9415
  const mm = pad2(now.getMinutes());
9334
9416
  const ss = pad2(now.getSeconds());
9335
- return join11(base, `dsi-${y}${m}${d}-${hh}${mm}${ss}`);
9417
+ return join12(base, `dsi-${y}${m}${d}-${hh}${mm}${ss}`);
9336
9418
  }
9337
9419
  var SAVE_FILES;
9338
9420
  var init_save_path_resolver = __esm({
@@ -9344,7 +9426,7 @@ var init_save_path_resolver = __esm({
9344
9426
 
9345
9427
  // packages/experience-design-system-cli-legacy/src/runs/store.ts
9346
9428
  import { readFile as readFile12, writeFile as writeFile4, mkdir as mkdir4, rename } from "node:fs/promises";
9347
- import { join as join12 } from "node:path";
9429
+ import { join as join13 } from "node:path";
9348
9430
  import { homedir as homedir6 } from "node:os";
9349
9431
  import { randomBytes as randomBytes2 } from "node:crypto";
9350
9432
  function encodeBase32(bytes, length) {
@@ -9440,8 +9522,8 @@ var init_store = __esm({
9440
9522
  RUNS_FILE_VERSION = 3;
9441
9523
  RUNS_FILE_CAP = 200;
9442
9524
  READABLE_VERSIONS = /* @__PURE__ */ new Set([1, 2, 3]);
9443
- RUNS_DIR = join12(homedir6(), ".config", "experiences");
9444
- RUNS_PATH = join12(RUNS_DIR, "runs.json");
9525
+ RUNS_DIR = join13(homedir6(), ".config", "experiences");
9526
+ RUNS_PATH = join13(RUNS_DIR, "runs.json");
9445
9527
  CROCKFORD = "0123456789ABCDEFGHJKMNPQRSTVWXYZ";
9446
9528
  }
9447
9529
  });
@@ -9598,7 +9680,7 @@ var init_WelcomeStep = __esm({
9598
9680
  import { useState as useState6, useEffect as useEffect3 } from "react";
9599
9681
  import { Box as Box9, Text as Text10 } from "ink";
9600
9682
  import { promises as fs } from "node:fs";
9601
- import { join as join13 } from "node:path";
9683
+ import { join as join14 } from "node:path";
9602
9684
  import { jsx as jsx12, jsxs as jsxs9 } from "react/jsx-runtime";
9603
9685
  async function countFiles(dir) {
9604
9686
  const counts = {
@@ -9622,7 +9704,7 @@ async function countFiles(dir) {
9622
9704
  await Promise.all(
9623
9705
  entries.map(async (entry) => {
9624
9706
  if (IGNORE_DIRS.has(entry)) return;
9625
- const full = join13(current, entry);
9707
+ const full = join14(current, entry);
9626
9708
  let stat7;
9627
9709
  try {
9628
9710
  stat7 = await fs.stat(full);
@@ -11307,8 +11389,8 @@ var init_types = __esm({
11307
11389
  });
11308
11390
 
11309
11391
  // packages/experience-design-system-extraction/dist/src/extract/tsx-shared.js
11310
- import { existsSync as existsSync3, readFileSync as readFileSync5 } from "node:fs";
11311
- import { dirname as dirname6, join as join14, resolve as resolve12 } from "node:path";
11392
+ import { existsSync as existsSync4, readFileSync as readFileSync5 } from "node:fs";
11393
+ import { dirname as dirname6, join as join15, resolve as resolve12 } from "node:path";
11312
11394
  import { Node, Project, SyntaxKind } from "ts-morph";
11313
11395
  import ts from "typescript";
11314
11396
  function createTsxProject(filePaths) {
@@ -11507,8 +11589,8 @@ function findNearestTsConfigPath(filePath) {
11507
11589
  let currentDir = dirname6(filePath);
11508
11590
  while (true) {
11509
11591
  for (const candidateName of ["tsconfig.json", "jsconfig.json"]) {
11510
- const candidatePath = join14(currentDir, candidateName);
11511
- if (existsSync3(candidatePath)) {
11592
+ const candidatePath = join15(currentDir, candidateName);
11593
+ if (existsSync4(candidatePath)) {
11512
11594
  nearestTsConfigPathCache.set(filePath, candidatePath);
11513
11595
  return candidatePath;
11514
11596
  }
@@ -11564,12 +11646,12 @@ function resolveImportSourcePath(basePath) {
11564
11646
  `${basePath}.tsx`,
11565
11647
  `${basePath}.js`,
11566
11648
  `${basePath}.jsx`,
11567
- join14(basePath, "index.ts"),
11568
- join14(basePath, "index.tsx"),
11569
- join14(basePath, "index.js"),
11570
- join14(basePath, "index.jsx")
11649
+ join15(basePath, "index.ts"),
11650
+ join15(basePath, "index.tsx"),
11651
+ join15(basePath, "index.js"),
11652
+ join15(basePath, "index.jsx")
11571
11653
  ];
11572
- return candidates.find((candidatePath) => existsSync3(candidatePath));
11654
+ return candidates.find((candidatePath) => existsSync4(candidatePath));
11573
11655
  }
11574
11656
  function findProjectSourceFileByImportPath(project, resolvedPath) {
11575
11657
  const candidatePaths = [
@@ -11578,10 +11660,10 @@ function findProjectSourceFileByImportPath(project, resolvedPath) {
11578
11660
  `${resolvedPath}.tsx`,
11579
11661
  `${resolvedPath}.js`,
11580
11662
  `${resolvedPath}.jsx`,
11581
- join14(resolvedPath, "index.ts"),
11582
- join14(resolvedPath, "index.tsx"),
11583
- join14(resolvedPath, "index.js"),
11584
- join14(resolvedPath, "index.jsx")
11663
+ join15(resolvedPath, "index.ts"),
11664
+ join15(resolvedPath, "index.tsx"),
11665
+ join15(resolvedPath, "index.js"),
11666
+ join15(resolvedPath, "index.jsx")
11585
11667
  ];
11586
11668
  for (const candidatePath of candidatePaths) {
11587
11669
  const sourceFile = project.getSourceFile(candidatePath);
@@ -11602,10 +11684,10 @@ function findWorkspacePackageEntrySourceFile(originSourceFile, moduleSpecifier)
11602
11684
  if (!packageRootDir)
11603
11685
  return void 0;
11604
11686
  const preferredEntryPaths = [
11605
- join14(packageRootDir, "src/index.ts"),
11606
- join14(packageRootDir, "src/index.tsx"),
11607
- join14(packageRootDir, "index.ts"),
11608
- join14(packageRootDir, "index.tsx")
11687
+ join15(packageRootDir, "src/index.ts"),
11688
+ join15(packageRootDir, "src/index.tsx"),
11689
+ join15(packageRootDir, "index.ts"),
11690
+ join15(packageRootDir, "index.tsx")
11609
11691
  ];
11610
11692
  for (const entryPath of preferredEntryPaths) {
11611
11693
  const entrySourceFile = project.getSourceFile(entryPath);
@@ -11613,7 +11695,7 @@ function findWorkspacePackageEntrySourceFile(originSourceFile, moduleSpecifier)
11613
11695
  return entrySourceFile;
11614
11696
  }
11615
11697
  }
11616
- return candidateSourceFiles.find((sourceFile) => sourceFile.getDirectoryPath() === join14(packageRootDir, "src"));
11698
+ return candidateSourceFiles.find((sourceFile) => sourceFile.getDirectoryPath() === join15(packageRootDir, "src"));
11617
11699
  }
11618
11700
  function getWorkspacePackageManifestForSourceFile(sourceFile) {
11619
11701
  const packageRootDir = findNearestPackageRootDir(sourceFile.getFilePath());
@@ -11622,7 +11704,7 @@ function getWorkspacePackageManifestForSourceFile(sourceFile) {
11622
11704
  if (workspacePackageManifestCache.has(packageRootDir)) {
11623
11705
  return workspacePackageManifestCache.get(packageRootDir) ?? void 0;
11624
11706
  }
11625
- const packageJsonPath = join14(packageRootDir, "package.json");
11707
+ const packageJsonPath = join15(packageRootDir, "package.json");
11626
11708
  try {
11627
11709
  const packageJson = JSON.parse(readFileSync5(packageJsonPath, "utf8"));
11628
11710
  const manifest = typeof packageJson.name === "string" ? { name: packageJson.name, rootDir: packageRootDir } : null;
@@ -11639,7 +11721,7 @@ function findNearestPackageRootDir(filePath) {
11639
11721
  }
11640
11722
  let currentDir = dirname6(filePath);
11641
11723
  while (true) {
11642
- if (existsSync3(join14(currentDir, "package.json"))) {
11724
+ if (existsSync4(join15(currentDir, "package.json"))) {
11643
11725
  packageRootByFilePathCache.set(filePath, currentDir);
11644
11726
  return currentDir;
11645
11727
  }
@@ -14701,8 +14783,8 @@ var init_vue_tsx = __esm({
14701
14783
  });
14702
14784
 
14703
14785
  // packages/experience-design-system-extraction/dist/src/extract/resolve-local-module.js
14704
- import { existsSync as existsSync4, statSync as statSync2 } from "node:fs";
14705
- import { dirname as dirname7, join as join15, resolve as resolve13 } from "node:path";
14786
+ import { existsSync as existsSync5, statSync as statSync2 } from "node:fs";
14787
+ import { dirname as dirname7, join as join16, resolve as resolve13 } from "node:path";
14706
14788
  function resolveLocalModule(importingFilePath, specifier, options = {}) {
14707
14789
  const basePath = resolve13(dirname7(importingFilePath), specifier);
14708
14790
  const candidates = [
@@ -14711,18 +14793,18 @@ function resolveLocalModule(importingFilePath, specifier, options = {}) {
14711
14793
  `${basePath}.ts`,
14712
14794
  `${basePath}.mjs`,
14713
14795
  `${basePath}.cjs`,
14714
- join15(basePath, "index.js"),
14715
- join15(basePath, "index.ts"),
14716
- join15(basePath, "index.mjs"),
14717
- join15(basePath, "index.cjs")
14796
+ join16(basePath, "index.js"),
14797
+ join16(basePath, "index.ts"),
14798
+ join16(basePath, "index.mjs"),
14799
+ join16(basePath, "index.cjs")
14718
14800
  ];
14719
14801
  for (const candidate of candidates) {
14720
- if (existsSync4(candidate) && statSync2(candidate).isFile())
14802
+ if (existsSync5(candidate) && statSync2(candidate).isFile())
14721
14803
  return candidate;
14722
14804
  }
14723
14805
  if (options.allowJavaScriptExtensionFallback && basePath.endsWith(".js")) {
14724
14806
  const tsPath = `${basePath.slice(0, -".js".length)}.ts`;
14725
- if (existsSync4(tsPath) && statSync2(tsPath).isFile())
14807
+ if (existsSync5(tsPath) && statSync2(tsPath).isFile())
14726
14808
  return tsPath;
14727
14809
  }
14728
14810
  return null;
@@ -14753,9 +14835,9 @@ var init_resolve_type_property = __esm({
14753
14835
 
14754
14836
  // packages/experience-design-system-extraction/dist/src/extract/vue.js
14755
14837
  import os from "node:os";
14756
- import { basename as basename3, dirname as dirname8, resolve as resolve14, join as join16 } from "node:path";
14838
+ import { basename as basename3, dirname as dirname8, resolve as resolve14, join as join17 } from "node:path";
14757
14839
  import { readFile as readFile15 } from "node:fs/promises";
14758
- import { existsSync as existsSync5, readFileSync as readFileSync6, readdirSync as readdirSync2, statSync as statSync3 } from "node:fs";
14840
+ import { existsSync as existsSync6, readFileSync as readFileSync6, readdirSync as readdirSync3, statSync as statSync3 } from "node:fs";
14759
14841
  import { parse as parseSFC } from "@vue/compiler-sfc";
14760
14842
  import { Project as Project3, Node as Node6 } from "ts-morph";
14761
14843
  async function extractVueComponents(filePaths, onProgress) {
@@ -14968,11 +15050,11 @@ function findWorkspaceRoot(startDir) {
14968
15050
  return workspaceRootCache.get(startDir);
14969
15051
  let dir = startDir;
14970
15052
  while (true) {
14971
- const pkgJsonPath = join16(dir, "package.json");
14972
- if (existsSync5(pkgJsonPath)) {
15053
+ const pkgJsonPath = join17(dir, "package.json");
15054
+ if (existsSync6(pkgJsonPath)) {
14973
15055
  try {
14974
15056
  const pkg4 = JSON.parse(readFileSync6(pkgJsonPath, "utf8"));
14975
- if (pkg4.workspaces || existsSync5(join16(dir, "pnpm-workspace.yaml"))) {
15057
+ if (pkg4.workspaces || existsSync6(join17(dir, "pnpm-workspace.yaml"))) {
14976
15058
  workspaceRootCache.set(startDir, dir);
14977
15059
  return dir;
14978
15060
  }
@@ -14992,8 +15074,8 @@ function getWorkspacePackageDirs(workspaceRoot) {
14992
15074
  return workspacePackageDirsCache.get(workspaceRoot);
14993
15075
  }
14994
15076
  const packageMap = /* @__PURE__ */ new Map();
14995
- const packagesDir = join16(workspaceRoot, "packages");
14996
- if (!existsSync5(packagesDir)) {
15077
+ const packagesDir = join17(workspaceRoot, "packages");
15078
+ if (!existsSync6(packagesDir)) {
14997
15079
  workspacePackageDirsCache.set(workspaceRoot, packageMap);
14998
15080
  return packageMap;
14999
15081
  }
@@ -15002,12 +15084,12 @@ function getWorkspacePackageDirs(workspaceRoot) {
15002
15084
  return;
15003
15085
  let entries;
15004
15086
  try {
15005
- entries = readdirSync2(dir);
15087
+ entries = readdirSync3(dir);
15006
15088
  } catch {
15007
15089
  return;
15008
15090
  }
15009
- const pkgJsonPath = join16(dir, "package.json");
15010
- if (existsSync5(pkgJsonPath)) {
15091
+ const pkgJsonPath = join17(dir, "package.json");
15092
+ if (existsSync6(pkgJsonPath)) {
15011
15093
  try {
15012
15094
  const pkg4 = JSON.parse(readFileSync6(pkgJsonPath, "utf8"));
15013
15095
  if (typeof pkg4.name === "string") {
@@ -15019,7 +15101,7 @@ function getWorkspacePackageDirs(workspaceRoot) {
15019
15101
  for (const entry of entries) {
15020
15102
  if (entry === "node_modules" || entry === ".git" || entry.startsWith("."))
15021
15103
  continue;
15022
- const entryPath = join16(dir, entry);
15104
+ const entryPath = join17(dir, entry);
15023
15105
  try {
15024
15106
  const stat7 = statSync3(entryPath);
15025
15107
  if (stat7.isDirectory()) {
@@ -15059,28 +15141,28 @@ function resolveWorkspaceVueImport(specifier, importingFilePath) {
15059
15141
  const packageDir = packageDirs.get(packageName);
15060
15142
  if (!packageDir)
15061
15143
  return null;
15062
- const pkgJsonPath = join16(packageDir, "package.json");
15144
+ const pkgJsonPath = join17(packageDir, "package.json");
15063
15145
  try {
15064
15146
  const pkg4 = JSON.parse(readFileSync6(pkgJsonPath, "utf8"));
15065
15147
  if (pkg4.exports && subpath !== ".") {
15066
15148
  const exportValue = pkg4.exports[subpath];
15067
15149
  if (typeof exportValue === "string" && exportValue.endsWith(".vue")) {
15068
15150
  const resolved = resolve14(packageDir, exportValue);
15069
- if (existsSync5(resolved))
15151
+ if (existsSync6(resolved))
15070
15152
  return resolved;
15071
15153
  }
15072
15154
  }
15073
15155
  if (subpath !== ".") {
15074
15156
  const subDir = resolve14(packageDir, subpath.replace(/^\.\//, ""));
15075
- for (const base of [join16(packageDir, "src", subpath.replace(/^\.\//, "")), subDir]) {
15076
- const subPkgPath = join16(base, "package.json");
15077
- if (existsSync5(subPkgPath)) {
15157
+ for (const base of [join17(packageDir, "src", subpath.replace(/^\.\//, "")), subDir]) {
15158
+ const subPkgPath = join17(base, "package.json");
15159
+ if (existsSync6(subPkgPath)) {
15078
15160
  try {
15079
15161
  const subPkg = JSON.parse(readFileSync6(subPkgPath, "utf8"));
15080
15162
  const main = subPkg.main || subPkg.module;
15081
15163
  if (typeof main === "string" && main.endsWith(".vue")) {
15082
15164
  const resolved = resolve14(base, main);
15083
- if (existsSync5(resolved))
15165
+ if (existsSync6(resolved))
15084
15166
  return resolved;
15085
15167
  }
15086
15168
  } catch {
@@ -15092,7 +15174,7 @@ function resolveWorkspaceVueImport(specifier, importingFilePath) {
15092
15174
  const main = pkg4.main || pkg4.module;
15093
15175
  if (typeof main === "string" && main.endsWith(".vue")) {
15094
15176
  const resolved = resolve14(packageDir, main);
15095
- if (existsSync5(resolved))
15177
+ if (existsSync6(resolved))
15096
15178
  return resolved;
15097
15179
  }
15098
15180
  }
@@ -15534,7 +15616,7 @@ var init_astro = __esm({
15534
15616
  });
15535
15617
 
15536
15618
  // packages/experience-design-system-extraction/dist/src/extract/web-components.js
15537
- import { basename as basename5, dirname as dirname9, join as join17, resolve as resolve15 } from "node:path";
15619
+ import { basename as basename5, dirname as dirname9, join as join18, resolve as resolve15 } from "node:path";
15538
15620
  import { Project as Project5, Node as Node8, SyntaxKind as SyntaxKind6 } from "ts-morph";
15539
15621
  function normalizeComponentName(input) {
15540
15622
  return input.replace(/[^a-zA-Z0-9]/g, "").toLowerCase();
@@ -16187,14 +16269,14 @@ function resolveImportSourcePath2(fromFilePath, specifier) {
16187
16269
  if (!specifier.startsWith(spectrumPrefix)) {
16188
16270
  return null;
16189
16271
  }
16190
- const packagesMarker = `${join17("2nd-gen", "packages")}${fromFilePath.includes("\\") ? "\\" : "/"}`;
16272
+ const packagesMarker = `${join18("2nd-gen", "packages")}${fromFilePath.includes("\\") ? "\\" : "/"}`;
16191
16273
  const markerIndex = fromFilePath.lastIndexOf(packagesMarker);
16192
16274
  if (markerIndex === -1) {
16193
16275
  return null;
16194
16276
  }
16195
16277
  const packagesRoot = fromFilePath.slice(0, markerIndex + packagesMarker.length - 1);
16196
16278
  const componentPath = specifier.slice(spectrumPrefix.length);
16197
- return join17(packagesRoot, "core", "components", componentPath, "index.ts");
16279
+ return join18(packagesRoot, "core", "components", componentPath, "index.ts");
16198
16280
  }
16199
16281
  function getImportedBaseClass(classDecl, project, visitedFiles) {
16200
16282
  const extendsClause = classDecl.getHeritageClauses().find((clause) => clause.getToken() === SyntaxKind6.ExtendsKeyword);
@@ -16461,8 +16543,8 @@ var init_scoring = __esm({
16461
16543
 
16462
16544
  // packages/experience-design-system-extraction/dist/src/extract/svelte.js
16463
16545
  import os3 from "node:os";
16464
- import { basename as basename6, dirname as dirname10, resolve as resolve16, join as join18 } from "node:path";
16465
- import { existsSync as existsSync6, readFileSync as readFileSync7 } from "node:fs";
16546
+ import { basename as basename6, dirname as dirname10, resolve as resolve16, join as join19 } from "node:path";
16547
+ import { existsSync as existsSync7, readFileSync as readFileSync7 } from "node:fs";
16466
16548
  import { createRequire } from "node:module";
16467
16549
  import { parse as parseSvelte } from "svelte/compiler";
16468
16550
  import { Project as Project6, Node as Node9, ScriptTarget, ModuleKind, ts as ts2 } from "ts-morph";
@@ -16595,8 +16677,8 @@ async function maybeRunResolveUnreachableRetry(components, warnings, retryContex
16595
16677
  function findNearestTsconfig(startDir) {
16596
16678
  let dir = startDir;
16597
16679
  for (let i = 0; i < 16; i++) {
16598
- const candidate = join18(dir, "tsconfig.json");
16599
- if (existsSync6(candidate))
16680
+ const candidate = join19(dir, "tsconfig.json");
16681
+ if (existsSync7(candidate))
16600
16682
  return candidate;
16601
16683
  const parent = dirname10(dir);
16602
16684
  if (!parent || parent === dir)
@@ -16731,29 +16813,29 @@ function locateDtsForSpecifier(req, specifier, parentFile) {
16731
16813
  const seedDir = resolvedJs ? dirname10(resolvedJs) : dirname10(parentFile);
16732
16814
  const pkgRoot = findPackageRootForSpecifier(seedDir, specifier);
16733
16815
  if (pkgRoot) {
16734
- const pkgJsonPath = join18(pkgRoot, "package.json");
16735
- if (existsSync6(pkgJsonPath)) {
16816
+ const pkgJsonPath = join19(pkgRoot, "package.json");
16817
+ if (existsSync7(pkgJsonPath)) {
16736
16818
  try {
16737
16819
  const pkgRaw = readFileSync7(pkgJsonPath, "utf-8");
16738
16820
  const pkg4 = JSON.parse(pkgRaw);
16739
16821
  const typesField = pkg4.types ?? pkg4.typings;
16740
16822
  if (typeof typesField === "string") {
16741
16823
  const candidate = resolve16(pkgRoot, typesField);
16742
- if (existsSync6(candidate))
16824
+ if (existsSync7(candidate))
16743
16825
  return candidate;
16744
16826
  }
16745
16827
  const exportsTypes = extractTypesFromExports(pkg4.exports);
16746
16828
  if (exportsTypes) {
16747
16829
  const candidate = resolve16(pkgRoot, exportsTypes);
16748
- if (existsSync6(candidate))
16830
+ if (existsSync7(candidate))
16749
16831
  return candidate;
16750
16832
  }
16751
16833
  } catch {
16752
16834
  }
16753
16835
  }
16754
16836
  for (const entry of ["index.d.ts", "index.d.mts"]) {
16755
- const candidate = join18(pkgRoot, entry);
16756
- if (existsSync6(candidate))
16837
+ const candidate = join19(pkgRoot, entry);
16838
+ if (existsSync7(candidate))
16757
16839
  return candidate;
16758
16840
  }
16759
16841
  }
@@ -16761,7 +16843,7 @@ function locateDtsForSpecifier(req, specifier, parentFile) {
16761
16843
  const noExt = resolvedJs.replace(/\.(m?js|cjs)$/, "");
16762
16844
  for (const ext of [".d.ts", ".d.mts"]) {
16763
16845
  const candidate = `${noExt}${ext}`;
16764
- if (existsSync6(candidate))
16846
+ if (existsSync7(candidate))
16765
16847
  return candidate;
16766
16848
  }
16767
16849
  }
@@ -16770,9 +16852,9 @@ function locateDtsForSpecifier(req, specifier, parentFile) {
16770
16852
  function findPackageRootForSpecifier(seedDir, specifier) {
16771
16853
  let dir = seedDir;
16772
16854
  for (let i = 0; i < 32; i++) {
16773
- if (existsSync6(join18(dir, "package.json"))) {
16855
+ if (existsSync7(join19(dir, "package.json"))) {
16774
16856
  try {
16775
- const pkgRaw = readFileSync7(join18(dir, "package.json"), "utf-8");
16857
+ const pkgRaw = readFileSync7(join19(dir, "package.json"), "utf-8");
16776
16858
  const pkg4 = JSON.parse(pkgRaw);
16777
16859
  if (pkg4.name === specifier)
16778
16860
  return dir;
@@ -26866,7 +26948,7 @@ var init_fetch_existing_contentful_entities = __esm({
26866
26948
 
26867
26949
  // packages/experience-design-system-cli-legacy/src/helpers/fetch-and-persist-existing-contentful-entities.ts
26868
26950
  import { writeFile as writeFile5 } from "node:fs/promises";
26869
- import { join as join19 } from "node:path";
26951
+ import { join as join20 } from "node:path";
26870
26952
  async function fetchAndPersistExistingContentfulEntities(params) {
26871
26953
  const t0 = Date.now();
26872
26954
  try {
@@ -26878,7 +26960,7 @@ async function fetchAndPersistExistingContentfulEntities(params) {
26878
26960
  spaceId: params.spaceId,
26879
26961
  environmentId: params.environmentId
26880
26962
  });
26881
- const path = join19(params.outDir, ".existing-entities.json");
26963
+ const path = join20(params.outDir, ".existing-entities.json");
26882
26964
  await writeFile5(path, JSON.stringify(entities, null, 2), "utf8");
26883
26965
  return { ok: true, path, durationMs: Date.now() - t0, entities };
26884
26966
  } catch (error) {
@@ -27055,8 +27137,8 @@ __export(WizardApp_exports, {
27055
27137
  });
27056
27138
  import { useEffect as useEffect15, useRef as useRef10, useState as useState23 } from "react";
27057
27139
  import { Box as Box42, Text as Text46 } from "ink";
27058
- import { join as join20, resolve as resolve17 } from "node:path";
27059
- import { appendFileSync as appendFileSync2, writeFileSync } from "node:fs";
27140
+ import { join as join21, resolve as resolve17 } from "node:path";
27141
+ import { appendFileSync as appendFileSync2, writeFileSync as writeFileSync2 } from "node:fs";
27060
27142
  import { access as access7, stat as stat5, writeFile as writeFile6 } from "node:fs/promises";
27061
27143
  import { tmpdir } from "node:os";
27062
27144
  import { execFile as execFile2, spawn as spawn3 } from "node:child_process";
@@ -27196,7 +27278,7 @@ function WizardApp({
27196
27278
  const logInit = useRef10(false);
27197
27279
  const initialAgentAuthRef = useRef10(initialAgentAuth ?? null);
27198
27280
  if (!logInit.current) {
27199
- writeFileSync(WIZARD_LOG, `--- experiences import session ${(/* @__PURE__ */ new Date()).toISOString()} ---
27281
+ writeFileSync2(WIZARD_LOG, `--- experiences import session ${(/* @__PURE__ */ new Date()).toISOString()} ---
27200
27282
  `);
27201
27283
  logInit.current = true;
27202
27284
  }
@@ -27223,7 +27305,7 @@ function WizardApp({
27223
27305
  const rawTokensEntryReady = !!initialRawTokensPath;
27224
27306
  const effectiveNoCache = resolveNoCacheForGenerate({ cliNoCache: noCache });
27225
27307
  const initialStepResolved = rawTokensEntryReady ? initialProjectPath ? "path-validation" : "credentials" : initialProjectPath ? "token-input" : "welcome";
27226
- const initialOutDir = initialProjectPath ? join20(resolve17(initialProjectPath), ".contentful") : "";
27308
+ const initialOutDir = initialProjectPath ? join21(resolve17(initialProjectPath), ".contentful") : "";
27227
27309
  const [state, setState] = useState23({
27228
27310
  step: initialStepResolved,
27229
27311
  agent: initialAgent ?? "claude",
@@ -27421,7 +27503,7 @@ If you are using AWS Bedrock, run:
27421
27503
  }
27422
27504
  const sessionMatch = /^session=(.+)$/m.exec(result.stdout);
27423
27505
  const tokenSessionId = sessionMatch ? sessionMatch[1].trim() : null;
27424
- const tokensPath = join20(outDir, "tokens.json");
27506
+ const tokensPath = join21(outDir, "tokens.json");
27425
27507
  const printArgs = ["print", "tokens", "--out", tokensPath];
27426
27508
  if (tokenSessionId) printArgs.push("--session", tokenSessionId);
27427
27509
  const r = await runCli(printArgs);
@@ -27443,7 +27525,7 @@ If you are using AWS Bedrock, run:
27443
27525
  tokenGenerationStatus: "complete",
27444
27526
  skipComponents: true,
27445
27527
  acceptedCount: 0,
27446
- outDir: state.outDir || join20(process.cwd(), ".contentful")
27528
+ outDir: state.outDir || join21(process.cwd(), ".contentful")
27447
27529
  });
27448
27530
  update({ step: "credentials" });
27449
27531
  return true;
@@ -27584,7 +27666,7 @@ If you are using AWS Bedrock, run:
27584
27666
  return promise;
27585
27667
  };
27586
27668
  const runExtract = async (projectPath, showProgress = true) => {
27587
- const outDir = join20(resolve17(projectPath), ".contentful");
27669
+ const outDir = join21(resolve17(projectPath), ".contentful");
27588
27670
  const existingEntitiesExpected = !state.credentialsSkipped && Boolean(state.spaceId && state.environmentId && state.cmaToken && projectPath);
27589
27671
  update({
27590
27672
  ...showProgress ? { step: "extracting" } : {},
@@ -28436,6 +28518,28 @@ If using a custom host configuration, make sure the space exists on that host.`
28436
28518
  return;
28437
28519
  }
28438
28520
  update({ step: "pushing", pushProgress: null, errorAllowBreakingChangeAcknowledgment: false });
28521
+ const cdfEntries = Object.entries(cdf).filter(([key]) => !key.startsWith("$") && key !== "allowDeletions");
28522
+ const pushDebug = startPushDebugRun({
28523
+ space_id: spaceId,
28524
+ environment_id: environmentId,
28525
+ host: resolveWizardHost(host2),
28526
+ cma_token: cmaToken,
28527
+ acknowledge_breaking_changes: acknowledgeBreakingChanges,
28528
+ cdf_keys: cdfEntries.map(([key]) => key),
28529
+ cdf_entry_count: cdfEntries.length,
28530
+ preview: preview ? {
28531
+ components: {
28532
+ new: preview.components.new.length,
28533
+ changed: preview.components.changed.length,
28534
+ removed: preview.components.removed.length
28535
+ },
28536
+ tokens: {
28537
+ new: preview.tokens.new.length,
28538
+ changed: preview.tokens.changed.length,
28539
+ removed: preview.tokens.removed.length
28540
+ }
28541
+ } : null
28542
+ });
28439
28543
  try {
28440
28544
  const resolvedHost = resolveWizardHost(host2);
28441
28545
  const client2 = new ImportApiClient({
@@ -28568,6 +28672,27 @@ If using a custom host configuration, make sure the space exists on that host.`
28568
28672
  );
28569
28673
  }
28570
28674
  }
28675
+ pushDebug.finish(
28676
+ {
28677
+ operation_id: operation.sys.id,
28678
+ operation_status: operation.sys.status,
28679
+ summary: operation.summary,
28680
+ item_count: items.length,
28681
+ items: items.map((item) => ({
28682
+ entityType: item.entityType,
28683
+ id: item.id,
28684
+ action: item.action,
28685
+ status: item.status,
28686
+ ...item.error ? { error: formatEdsiError(item.error) } : {}
28687
+ })),
28688
+ push_result: {
28689
+ component_types: pushResult.componentTypes,
28690
+ design_tokens: pushResult.designTokens
28691
+ },
28692
+ succeeded: pushSucceeded
28693
+ },
28694
+ pushSucceeded ? "success" : "error"
28695
+ );
28571
28696
  update({ step: "done", pushResult });
28572
28697
  } catch (e) {
28573
28698
  let msg;
@@ -28578,6 +28703,13 @@ If using a custom host configuration, make sure the space exists on that host.`
28578
28703
  } else {
28579
28704
  msg = "Push failed";
28580
28705
  }
28706
+ pushDebug.finish(
28707
+ {
28708
+ error: msg,
28709
+ ...e instanceof ApiError ? { status: e.status, body: (e.body ?? "").slice(0, 2e3) } : {}
28710
+ },
28711
+ "error"
28712
+ );
28581
28713
  update({
28582
28714
  step: "error",
28583
28715
  errorStep: "apply",
@@ -28589,7 +28721,7 @@ If using a custom host configuration, make sure the space exists on that host.`
28589
28721
  };
28590
28722
  const runPrintFiles = async (extractSessionId, outDir, opts = {}) => {
28591
28723
  update({ step: "printing" });
28592
- const componentsPath = join20(outDir, "components.json");
28724
+ const componentsPath = join21(outDir, "components.json");
28593
28725
  try {
28594
28726
  const db = openPipelineDb();
28595
28727
  let components = [];
@@ -28692,7 +28824,7 @@ If using a custom host configuration, make sure the space exists on that host.`
28692
28824
  if (tokenReuseChecked.current) return;
28693
28825
  tokenReuseChecked.current = true;
28694
28826
  const tokenNextStep = state.projectPath ? "path-validation" : "credentials";
28695
- const existingTokensPath = join20(state.outDir, "tokens.json");
28827
+ const existingTokensPath = join21(state.outDir, "tokens.json");
28696
28828
  if (effectiveNoCache) {
28697
28829
  tokenGenerationPromiseRef.current = runAgentAuthCheck(tokenNextStep).then(
28698
28830
  (ok2) => ok2 ? runGenerateTokens(state.rawTokensPath, state.outDir) : false
@@ -28743,7 +28875,7 @@ If using a custom host configuration, make sure the space exists on that host.`
28743
28875
  {
28744
28876
  onContinue: (path) => {
28745
28877
  const projectPath = normalizePath(path);
28746
- const outDir = join20(projectPath, ".contentful");
28878
+ const outDir = join21(projectPath, ".contentful");
28747
28879
  update({ step: "token-input", projectPath, outDir });
28748
28880
  },
28749
28881
  onQuit: () => process.exit(0)
@@ -29241,6 +29373,7 @@ var init_WizardApp = __esm({
29241
29373
  init_theme();
29242
29374
  init_run_teaser();
29243
29375
  init_debug_logger();
29376
+ init_push_debug_log();
29244
29377
  init_credentials_store();
29245
29378
  init_path_prompt();
29246
29379
  init_save_path_resolver();
@@ -29285,7 +29418,7 @@ var init_WizardApp = __esm({
29285
29418
  init_use_terminal_size();
29286
29419
  init_render_with_goodbye();
29287
29420
  SAVE_CONFIRMATION_DELAY_MS = 1e3;
29288
- WIZARD_LOG = join20(tmpdir(), "experiences-import-wizard.log");
29421
+ WIZARD_LOG = join21(tmpdir(), "experiences-import-wizard.log");
29289
29422
  }
29290
29423
  });
29291
29424
 
@@ -29465,7 +29598,7 @@ var init_shell = __esm({
29465
29598
  });
29466
29599
 
29467
29600
  // packages/experience-design-system-cli-legacy/src/setup/lib/checks.ts
29468
- import { join as join21 } from "node:path";
29601
+ import { join as join22 } from "node:path";
29469
29602
  function checkNodeVersion(nodeVersion = process.versions.node) {
29470
29603
  const major = Number.parseInt(nodeVersion.split(".")[0], 10);
29471
29604
  return {
@@ -29479,7 +29612,7 @@ async function detectNodeVersionManagers(homeDir, deps = {
29479
29612
  binaryExists,
29480
29613
  pathExists: pathExists3
29481
29614
  }) {
29482
- const nvmScript = join21(homeDir, ".nvm", "nvm.sh");
29615
+ const nvmScript = join22(homeDir, ".nvm", "nvm.sh");
29483
29616
  return {
29484
29617
  nvm: await deps.binaryExists("nvm") || await deps.pathExists(nvmScript),
29485
29618
  fnm: await deps.binaryExists("fnm"),
@@ -29558,7 +29691,7 @@ var init_report = __esm({
29558
29691
 
29559
29692
  // packages/experience-design-system-cli-legacy/src/doctor/checks.ts
29560
29693
  import { homedir as homedir7 } from "node:os";
29561
- import { join as join22 } from "node:path";
29694
+ import { join as join23 } from "node:path";
29562
29695
  async function reportNode() {
29563
29696
  section("Checking Node.js version");
29564
29697
  const check = checkNodeVersion();
@@ -29609,12 +29742,12 @@ async function reportPnpm(pkgRoot) {
29609
29742
  }
29610
29743
  async function reportDependencies(pkgRoot) {
29611
29744
  section("Checking dependencies (pnpm install)");
29612
- if (!await pathExists3(join22(pkgRoot, "node_modules"))) {
29745
+ if (!await pathExists3(join23(pkgRoot, "node_modules"))) {
29613
29746
  info("node_modules not found \u2014 running pnpm install...");
29614
29747
  } else {
29615
29748
  info("Running pnpm install to ensure dependencies are up to date...");
29616
29749
  }
29617
- const check = await installDependencies(join22(pkgRoot, "..", ".."));
29750
+ const check = await installDependencies(join23(pkgRoot, "..", ".."));
29618
29751
  if (!check.passed) {
29619
29752
  fail("pnpm install failed");
29620
29753
  info("");
@@ -29631,7 +29764,7 @@ async function reportDependencies(pkgRoot) {
29631
29764
  async function reportBuild(pkgRoot) {
29632
29765
  section("Building CLI");
29633
29766
  info("Running pnpm build...");
29634
- const check = await buildCli(join22(pkgRoot, "..", ".."));
29767
+ const check = await buildCli(join23(pkgRoot, "..", ".."));
29635
29768
  if (!check.passed) {
29636
29769
  fail("Build failed");
29637
29770
  info("");
@@ -30846,9 +30979,9 @@ var init_SetupScreen = __esm({
30846
30979
 
30847
30980
  // packages/experience-design-system-cli-legacy/src/setup/command.ts
30848
30981
  import { readFileSync as readFileSync8 } from "node:fs";
30849
- import { join as join23 } from "node:path";
30982
+ import { join as join24 } from "node:path";
30850
30983
  function getCliVersion() {
30851
- const pkg4 = JSON.parse(readFileSync8(join23(findPkgRoot(), "package.json"), "utf8"));
30984
+ const pkg4 = JSON.parse(readFileSync8(join24(findPkgRoot(), "package.json"), "utf8"));
30852
30985
  return pkg4.version;
30853
30986
  }
30854
30987
  async function runSetup(opts) {
@@ -30860,7 +30993,7 @@ async function runSetup(opts) {
30860
30993
  const { renderWithGoodbye: renderWithGoodbye2 } = await Promise.resolve().then(() => (init_render_with_goodbye(), render_with_goodbye_exports));
30861
30994
  const { createElement: createElement6 } = await import("react");
30862
30995
  const { SetupScreen: SetupScreen2 } = await Promise.resolve().then(() => (init_SetupScreen(), SetupScreen_exports));
30863
- const repoRoot = join23(findPkgRoot(), "..", "..");
30996
+ const repoRoot = join24(findPkgRoot(), "..", "..");
30864
30997
  const completion = { outcome: null };
30865
30998
  let unmountInk = null;
30866
30999
  const { waitUntilExit, unmount } = renderWithGoodbye2(
@@ -31061,15 +31194,15 @@ var init_apply_mapping = __esm({
31061
31194
  });
31062
31195
 
31063
31196
  // packages/experience-design-system-cli-legacy/src/analyze/composition/prompt-loader.ts
31064
- import { existsSync as existsSync7, readFileSync as readFileSync9 } from "node:fs";
31065
- import { dirname as dirname11, join as join24, resolve as resolve18 } from "node:path";
31197
+ import { existsSync as existsSync8, readFileSync as readFileSync9 } from "node:fs";
31198
+ import { dirname as dirname11, join as join25, resolve as resolve18 } from "node:path";
31066
31199
  import { fileURLToPath as fileURLToPath3 } from "node:url";
31067
31200
  function resolvePromptPath(fileName) {
31068
31201
  const thisDir = dirname11(fileURLToPath3(import.meta.url));
31069
31202
  let dir = thisDir;
31070
31203
  for (; ; ) {
31071
- const candidate = join24(dir, "prompts");
31072
- if (existsSync7(candidate)) return join24(candidate, fileName);
31204
+ const candidate = join25(dir, "prompts");
31205
+ if (existsSync8(candidate)) return join25(candidate, fileName);
31073
31206
  const parent = resolve18(dir, "..");
31074
31207
  if (parent === dir) {
31075
31208
  throw new Error(
@@ -31337,7 +31470,7 @@ var init_manifest_doc_evidence = __esm({
31337
31470
 
31338
31471
  // packages/experience-design-system-cli-legacy/src/analyze/extract-command.ts
31339
31472
  import { mkdir as mkdir6, readdir as readdir3, readFile as readFile18, stat as stat6 } from "node:fs/promises";
31340
- import { isAbsolute as isAbsolute2, join as join25, relative as relative2, resolve as resolve19 } from "node:path";
31473
+ import { isAbsolute as isAbsolute2, join as join26, relative as relative2, resolve as resolve19 } from "node:path";
31341
31474
  function resolveExtractNoCache(opts) {
31342
31475
  return opts.noCache === true || opts.cache === false;
31343
31476
  }
@@ -31375,7 +31508,7 @@ async function collectSourceFiles(directory, onProgress) {
31375
31508
  const entries = await readdir3(currentDirectory, { withFileTypes: true });
31376
31509
  const subdirs = [];
31377
31510
  for (const entry of entries) {
31378
- const fullPath = join25(currentDirectory, entry.name);
31511
+ const fullPath = join26(currentDirectory, entry.name);
31379
31512
  if (entry.isDirectory()) {
31380
31513
  if (!IGNORED_DIRECTORY_NAMES.has(entry.name)) {
31381
31514
  subdirs.push(fullPath);
@@ -31459,7 +31592,7 @@ function registerInternalExtractCommand(program) {
31459
31592
  }
31460
31593
  }
31461
31594
  const projectRoot = resolve19(opts.project);
31462
- const outDir = join25(projectRoot, ".contentful");
31595
+ const outDir = join26(projectRoot, ".contentful");
31463
31596
  let sourceDirectory;
31464
31597
  if (opts.dir !== void 0) {
31465
31598
  sourceDirectory = resolveFromProjectRoot(projectRoot, opts.dir);
@@ -31864,7 +31997,7 @@ __export(program_exports, {
31864
31997
  });
31865
31998
  import { spawn as spawn5 } from "node:child_process";
31866
31999
  import { fileURLToPath as fileURLToPath4 } from "node:url";
31867
- import { dirname as dirname13, join as join26, resolve as resolve20 } from "node:path";
32000
+ import { dirname as dirname13, join as join27, resolve as resolve20 } from "node:path";
31868
32001
  import { readFileSync as readFileSync10 } from "node:fs";
31869
32002
  import { Command } from "commander";
31870
32003
  async function runBuild(opts) {
@@ -31964,7 +32097,7 @@ var init_program = __esm({
31964
32097
  init_analytics();
31965
32098
  init_credentials_store();
31966
32099
  init_cli_path();
31967
- pkg3 = JSON.parse(readFileSync10(join26(findPkgRoot(), "package.json"), "utf8"));
32100
+ pkg3 = JSON.parse(readFileSync10(join27(findPkgRoot(), "package.json"), "utf8"));
31968
32101
  }
31969
32102
  });
31970
32103
 
@@ -0,0 +1,11 @@
1
+ export declare const DEBUG_SESSION_DIR_ENV = "EDS_DEBUG_SESSION_DIR";
2
+ export type PushDebugStatus = 'success' | 'error';
3
+ export interface PushDebugRun {
4
+ finish(outputs: Record<string, unknown>, status: PushDebugStatus): void;
5
+ }
6
+ /**
7
+ * Records the inputs and outputs of the push step in the v2 debug session folder.
8
+ * It does nothing unless the v2 CLI set EDS_DEBUG_SESSION_DIR, which it only does
9
+ * when Debug Mode is on. Logging never throws.
10
+ */
11
+ export declare function startPushDebugRun(inputs: Record<string, unknown>): PushDebugRun;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentful/experience-design-system-cli",
3
- "version": "2.35.1-dev-build-d5a8fc4d.0",
3
+ "version": "2.35.1-dev-build-c4a4d1cd.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.35.1-dev-build-d5a8fc4d.0",
3
+ "version": "2.35.1-dev-build-c4a4d1cd.0",
4
4
  "description": "Contentful Experiences design system import CLI",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -41,7 +41,7 @@
41
41
  "svelte": "^5.56.4",
42
42
  "ts-morph": "^27.0.2",
43
43
  "typescript": "^5.9.3",
44
- "@contentful/experience-design-system-types": "2.35.1-dev-build-d5a8fc4d.0"
44
+ "@contentful/experience-design-system-types": "2.35.1-dev-build-c4a4d1cd.0"
45
45
  },
46
46
  "devDependencies": {
47
47
  "@tsconfig/node24": "^24.0.4",