@contentful/experience-design-system-cli 2.42.1-dev-build-c7f654e2.0 → 2.42.1-dev-build-25400cd0.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
@@ -1202,7 +1202,7 @@ var init_parse_map_token_prop_tool_calls = __esm({
1202
1202
  });
1203
1203
 
1204
1204
  // packages/experience-design-system-backend-pipeline/dist/src/agents/services/run-agent.js
1205
- import { spawn as spawn2 } from "node:child_process";
1205
+ import { spawn } from "node:child_process";
1206
1206
  function killProcessTree(pid, signal) {
1207
1207
  try {
1208
1208
  process.kill(-pid, signal);
@@ -1231,7 +1231,7 @@ async function runAgent(options) {
1231
1231
  });
1232
1232
  return new Promise((resolve29) => {
1233
1233
  const bedrockEnv = bedrock ? BEDROCK_ENV_BY_AGENT[agent] : void 0;
1234
- const child = spawn2(binary, args, {
1234
+ const child = spawn(binary, args, {
1235
1235
  stdio: ["pipe", "pipe", "pipe"],
1236
1236
  detached: true,
1237
1237
  ...bedrockEnv ? { env: { ...process.env, ...bedrockEnv } } : {}
@@ -1330,7 +1330,7 @@ var init_run_agent = __esm({
1330
1330
  });
1331
1331
 
1332
1332
  // packages/experience-design-system-backend-pipeline/dist/src/agents/services/check-agent-auth.js
1333
- import { spawn as spawn3 } from "node:child_process";
1333
+ import { spawn as spawn2 } from "node:child_process";
1334
1334
  async function checkAgentAuth(agent) {
1335
1335
  const binary = resolveBinary(agent);
1336
1336
  const binaryExists2 = await binaryIsOnPath(binary);
@@ -1339,7 +1339,7 @@ async function checkAgentAuth(agent) {
1339
1339
  if (agent !== "claude")
1340
1340
  return "ok";
1341
1341
  return new Promise((resolve29) => {
1342
- const child = spawn3(binary, ["auth", "status", "--json"], { stdio: ["ignore", "pipe", "pipe"] });
1342
+ const child = spawn2(binary, ["auth", "status", "--json"], { stdio: ["ignore", "pipe", "pipe"] });
1343
1343
  let stdout = "";
1344
1344
  let done = false;
1345
1345
  const timer = setTimeout(() => {
@@ -1376,7 +1376,7 @@ async function binaryIsOnPath(binary) {
1376
1376
  return fs.access(binary).then(() => true, () => false);
1377
1377
  }
1378
1378
  return new Promise((resolve29) => {
1379
- const child = spawn3(process.platform === "win32" ? "where" : "which", [binary], { stdio: "ignore" });
1379
+ const child = spawn2(process.platform === "win32" ? "where" : "which", [binary], { stdio: "ignore" });
1380
1380
  child.on("close", (code) => resolve29(code === 0));
1381
1381
  });
1382
1382
  }
@@ -2158,12 +2158,12 @@ var init_skill_files = __esm({
2158
2158
 
2159
2159
  // packages/experience-design-system-backend-pipeline/dist/src/agents/prompts/resolve-skill-path.js
2160
2160
  import { existsSync as existsSync3 } from "node:fs";
2161
- import { dirname as dirname6, join as join8, resolve as resolve4 } from "node:path";
2161
+ import { dirname as dirname5, join as join8, resolve as resolve4 } from "node:path";
2162
2162
  import { fileURLToPath as fileURLToPath2 } from "node:url";
2163
2163
  function resolveSkillPath(skill) {
2164
2164
  if (!(skill in SKILL_FILES))
2165
2165
  throw new Error(`Invalid skill: ${skill}`);
2166
- const thisDir = dirname6(fileURLToPath2(import.meta.url));
2166
+ const thisDir = dirname5(fileURLToPath2(import.meta.url));
2167
2167
  let dir = thisDir;
2168
2168
  for (; ; ) {
2169
2169
  const candidate = join8(dir, "skills");
@@ -2838,9 +2838,8 @@ import { Box as Box4, Text as Text4 } from "ink";
2838
2838
 
2839
2839
  // packages/experience-design-system-cli/src/tui/support-bundle.ts
2840
2840
  init_debug_store();
2841
- import { spawn } from "node:child_process";
2842
2841
  import { readdir as readdir2, readFile as readFile2, stat as stat2, writeFile as writeFile3 } from "node:fs/promises";
2843
- import { basename, dirname as dirname4, join as join6, sep } from "node:path";
2842
+ import { basename, join as join6, sep } from "node:path";
2844
2843
 
2845
2844
  // packages/experience-design-system-cli/src/tui/zip.ts
2846
2845
  import { crc32, deflateRawSync } from "node:zlib";
@@ -2926,26 +2925,17 @@ async function bundleDebugLogs() {
2926
2925
  return { status: "failed", folder: debugDir };
2927
2926
  }
2928
2927
  }
2929
- function openSupportBundle(bundle) {
2930
- if (bundle.status === "no-logs") return;
2931
- const target = bundle.status === "created" ? bundle.path : bundle.folder;
2932
- const command = process.platform === "darwin" ? { file: "open", args: bundle.status === "created" ? ["-R", target] : [target] } : process.platform === "win32" ? { file: "explorer.exe", args: bundle.status === "created" ? [`/select,${target}`] : [target] } : { file: "xdg-open", args: [bundle.status === "created" ? dirname4(target) : target] };
2933
- try {
2934
- const child = spawn(command.file, command.args, { stdio: "ignore", detached: true });
2935
- child.on("error", () => void 0);
2936
- child.unref();
2937
- } catch {
2938
- }
2939
- }
2940
2928
  function supportInstruction(bundle) {
2941
2929
  switch (bundle.status) {
2942
2930
  case "created":
2943
- return `Debug logs saved to ${bundle.path}
2944
- Send this file to Contentful support so they can look into it.`;
2931
+ return `The import hit an error. We zipped up your debug logs, you can find the file here:
2932
+ ${bundle.path}
2933
+ Send that zip file to Contentful support so they can look into it.`;
2945
2934
  case "no-logs":
2946
- return "No debug logs were recorded. To get help, turn on Debug Mode in Settings, run the import again and send the zip file it saves to Contentful support.";
2935
+ return "The import hit an error, but no debug logs were recorded. To get help, turn on Debug Mode in Settings, run the import again and send the zip file it saves to Contentful support.";
2947
2936
  case "failed":
2948
- return `Your debug logs are in ${bundle.folder}
2937
+ return `The import hit an error. We could not zip your debug logs, but you can find them here:
2938
+ ${bundle.folder}
2949
2939
  Zip that folder and send it to Contentful support so they can look into it.`;
2950
2940
  }
2951
2941
  }
@@ -2957,7 +2947,6 @@ import { useInput as useInput4 } from "ink";
2957
2947
  function errorAction(input, key, available) {
2958
2948
  if (key.return && available.canAcknowledge) return "acknowledge";
2959
2949
  if (input === "r" && available.canRetry) return "retry";
2960
- if (input === "o" && available.canOpen) return "open";
2961
2950
  if (key.return || key.escape) return "exit";
2962
2951
  return null;
2963
2952
  }
@@ -2965,8 +2954,7 @@ function errorControls(available) {
2965
2954
  return [
2966
2955
  available.canAcknowledge ? { keys: "Enter", label: "Acknowledge and apply" } : { keys: "Enter", label: "Exit" },
2967
2956
  ...available.canAcknowledge ? [{ keys: "Esc", label: "Exit" }] : [],
2968
- ...available.canRetry ? [{ keys: "r", label: "Re-enter credentials" }] : [],
2969
- ...available.canOpen ? [{ keys: "o", label: "Show debug logs in file manager" }] : []
2957
+ ...available.canRetry ? [{ keys: "r", label: "Re-enter credentials" }] : []
2970
2958
  ];
2971
2959
  }
2972
2960
 
@@ -2975,12 +2963,10 @@ function useErrorControls(handlers) {
2975
2963
  useInput4((input, key) => {
2976
2964
  const action = errorAction(input, key, {
2977
2965
  canRetry: handlers.onRetry !== void 0,
2978
- canAcknowledge: handlers.onAcknowledge !== void 0,
2979
- canOpen: handlers.onOpen !== void 0
2966
+ canAcknowledge: handlers.onAcknowledge !== void 0
2980
2967
  });
2981
2968
  if (action === "acknowledge") handlers.onAcknowledge?.();
2982
2969
  else if (action === "retry") handlers.onRetry?.();
2983
- else if (action === "open") handlers.onOpen?.();
2984
2970
  else if (action === "exit") handlers.onExit();
2985
2971
  });
2986
2972
  }
@@ -3010,18 +2996,11 @@ function ErrorStep({
3010
2996
  onRetryCredentials,
3011
2997
  onAcknowledgeBreakingChanges
3012
2998
  }) {
2999
+ useErrorControls({ onExit, onRetry: onRetryCredentials, onAcknowledge: onAcknowledgeBreakingChanges });
3013
3000
  const bundle = useSupportBundle();
3014
- const canOpen = bundle !== void 0 && bundle.status !== "no-logs";
3015
- useErrorControls({
3016
- onExit,
3017
- onRetry: onRetryCredentials,
3018
- onAcknowledge: onAcknowledgeBreakingChanges,
3019
- onOpen: canOpen ? () => openSupportBundle(bundle) : void 0
3020
- });
3021
3001
  const controls = errorControls({
3022
3002
  canRetry: onRetryCredentials !== void 0,
3023
- canAcknowledge: onAcknowledgeBreakingChanges !== void 0,
3024
- canOpen
3003
+ canAcknowledge: onAcknowledgeBreakingChanges !== void 0
3025
3004
  });
3026
3005
  return /* @__PURE__ */ jsxs4(Box4, { flexDirection: "column", gap: 1, paddingX: 2, paddingY: 1, children: [
3027
3006
  /* @__PURE__ */ jsxs4(Text4, { bold: true, color: PALETTE.error, children: [
@@ -3751,14 +3730,14 @@ import { createHash as createHash5 } from "node:crypto";
3751
3730
 
3752
3731
  // packages/experience-design-system-backend-pipeline/dist/src/persistence/src/session/helpers/config-root.js
3753
3732
  import { homedir as homedir3 } from "node:os";
3754
- import { dirname as dirname5, join as join7 } from "node:path";
3733
+ import { dirname as dirname4, join as join7 } from "node:path";
3755
3734
  function configRoot2() {
3756
3735
  return process.env["EDS_HOME"] || join7(homedir3(), ".contentful", "experience-design-system-cli");
3757
3736
  }
3758
3737
  var runsFilePath = () => join7(configRoot2(), "state", "runs.json");
3759
3738
 
3760
3739
  // packages/experience-design-system-backend-pipeline/dist/src/persistence/src/session/repositories/db.js
3761
- import { dirname as dirname7, resolve as resolve7 } from "node:path";
3740
+ import { dirname as dirname6, resolve as resolve7 } from "node:path";
3762
3741
 
3763
3742
  // packages/experience-design-system-backend-pipeline/dist/src/persistence/src/session/helpers/source-excerpt.js
3764
3743
  var ELLIPSIS_MARKER = "/* \u2026 */";
@@ -4535,7 +4514,7 @@ function getPipelineDbPath() {
4535
4514
  }
4536
4515
  function openPipelineDb(dbPath) {
4537
4516
  const path5 = dbPath ?? getPipelineDbPath();
4538
- mkdirSync(dirname7(path5), { recursive: true });
4517
+ mkdirSync(dirname6(path5), { recursive: true });
4539
4518
  try {
4540
4519
  const db = new DatabaseSync(path5);
4541
4520
  db.exec("PRAGMA busy_timeout = 5000");
@@ -5228,7 +5207,7 @@ async function resolveImportSpecifiers(sourceText, fromDir) {
5228
5207
  async function loadSiblingFiles(sourceText, sourcePath, propNames, candidateTypeNames = []) {
5229
5208
  const visited = /* @__PURE__ */ new Set([resolve7(sourcePath)]);
5230
5209
  const discovered = [];
5231
- let frontier = [{ text: sourceText, dir: dirname7(sourcePath) }];
5210
+ let frontier = [{ text: sourceText, dir: dirname6(sourcePath) }];
5232
5211
  for (let hop = 0; hop < MAX_SIBLING_DEPTH && discovered.length < MAX_SIBLING_CANDIDATES_EXPLORED; hop++) {
5233
5212
  const nextFrontier = [];
5234
5213
  for (const node of frontier) {
@@ -5248,7 +5227,7 @@ async function loadSiblingFiles(sourceText, sourcePath, propNames, candidateType
5248
5227
  continue;
5249
5228
  }
5250
5229
  discovered.push({ path: resolvedPath, content });
5251
- nextFrontier.push({ text: content, dir: dirname7(resolvedPath) });
5230
+ nextFrontier.push({ text: content, dir: dirname6(resolvedPath) });
5252
5231
  }
5253
5232
  }
5254
5233
  frontier = nextFrontier;
@@ -6044,7 +6023,7 @@ import { Project as Project2, Node as Node2, SyntaxKind as SyntaxKind2 } from "t
6044
6023
 
6045
6024
  // packages/experience-design-system-backend-pipeline/dist/src/steps/extraction/src/framework-adapters/shared/extract-tsx-components.js
6046
6025
  import { existsSync as existsSync4, readFileSync as readFileSync4 } from "node:fs";
6047
- import { dirname as dirname8, join as join9, resolve as resolve8 } from "node:path";
6026
+ import { dirname as dirname7, join as join9, resolve as resolve8 } from "node:path";
6048
6027
  import { Node, Project, SyntaxKind } from "ts-morph";
6049
6028
  import ts from "typescript";
6050
6029
  var packageRootByFilePathCache = /* @__PURE__ */ new Map();
@@ -6244,7 +6223,7 @@ function findNearestTsConfigPath(filePath) {
6244
6223
  if (nearestTsConfigPathCache.has(filePath)) {
6245
6224
  return nearestTsConfigPathCache.get(filePath) ?? void 0;
6246
6225
  }
6247
- let currentDir = dirname8(filePath);
6226
+ let currentDir = dirname7(filePath);
6248
6227
  while (true) {
6249
6228
  for (const candidateName of ["tsconfig.json", "jsconfig.json"]) {
6250
6229
  const candidatePath = join9(currentDir, candidateName);
@@ -6253,7 +6232,7 @@ function findNearestTsConfigPath(filePath) {
6253
6232
  return candidatePath;
6254
6233
  }
6255
6234
  }
6256
- const parentDir = dirname8(currentDir);
6235
+ const parentDir = dirname7(currentDir);
6257
6236
  if (parentDir === currentDir) {
6258
6237
  nearestTsConfigPathCache.set(filePath, null);
6259
6238
  return void 0;
@@ -6270,13 +6249,13 @@ function getTsConfigPaths(tsConfigPath) {
6270
6249
  tsConfigPathsCache.set(tsConfigPath, null);
6271
6250
  return void 0;
6272
6251
  }
6273
- const parsedConfig = ts.parseJsonConfigFileContent(configFile.config, ts.sys, dirname8(tsConfigPath));
6252
+ const parsedConfig = ts.parseJsonConfigFileContent(configFile.config, ts.sys, dirname7(tsConfigPath));
6274
6253
  const paths = parsedConfig.options.paths;
6275
6254
  if (!paths || Object.keys(paths).length === 0) {
6276
6255
  tsConfigPathsCache.set(tsConfigPath, null);
6277
6256
  return void 0;
6278
6257
  }
6279
- const baseUrl = parsedConfig.options.baseUrl ?? dirname8(tsConfigPath);
6258
+ const baseUrl = parsedConfig.options.baseUrl ?? dirname7(tsConfigPath);
6280
6259
  const result = { baseUrl, paths };
6281
6260
  tsConfigPathsCache.set(tsConfigPath, result);
6282
6261
  return result;
@@ -6377,13 +6356,13 @@ function findNearestPackageRootDir(filePath) {
6377
6356
  if (packageRootByFilePathCache.has(filePath)) {
6378
6357
  return packageRootByFilePathCache.get(filePath) ?? void 0;
6379
6358
  }
6380
- let currentDir = dirname8(filePath);
6359
+ let currentDir = dirname7(filePath);
6381
6360
  while (true) {
6382
6361
  if (existsSync4(join9(currentDir, "package.json"))) {
6383
6362
  packageRootByFilePathCache.set(filePath, currentDir);
6384
6363
  return currentDir;
6385
6364
  }
6386
- const parentDir = dirname8(currentDir);
6365
+ const parentDir = dirname7(currentDir);
6387
6366
  if (parentDir === currentDir) {
6388
6367
  packageRootByFilePathCache.set(filePath, null);
6389
6368
  return void 0;
@@ -9380,7 +9359,7 @@ function extractVueSlotsFromSetup(options) {
9380
9359
 
9381
9360
  // packages/experience-design-system-backend-pipeline/dist/src/steps/extraction/src/framework-adapters/vue/extract-vue-components.js
9382
9361
  import os from "node:os";
9383
- import { basename as basename2, dirname as dirname10, resolve as resolve10, join as join11 } from "node:path";
9362
+ import { basename as basename2, dirname as dirname9, resolve as resolve10, join as join11 } from "node:path";
9384
9363
  import { readFile as readFile8 } from "node:fs/promises";
9385
9364
  import { existsSync as existsSync6, readFileSync as readFileSync5, readdirSync as readdirSync2, statSync as statSync3 } from "node:fs";
9386
9365
  import { parse as parseSFC } from "@vue/compiler-sfc";
@@ -9388,9 +9367,9 @@ import { Project as Project3, Node as Node6 } from "ts-morph";
9388
9367
 
9389
9368
  // packages/experience-design-system-backend-pipeline/dist/src/steps/extraction/src/framework-adapters/shared/resolve-local-module.js
9390
9369
  import { existsSync as existsSync5, statSync as statSync2 } from "node:fs";
9391
- import { dirname as dirname9, join as join10, resolve as resolve9 } from "node:path";
9370
+ import { dirname as dirname8, join as join10, resolve as resolve9 } from "node:path";
9392
9371
  function resolveLocalModule(importingFilePath, specifier, options = {}) {
9393
- const basePath = resolve9(dirname9(importingFilePath), specifier);
9372
+ const basePath = resolve9(dirname8(importingFilePath), specifier);
9394
9373
  const candidates = [
9395
9374
  basePath,
9396
9375
  `${basePath}.js`,
@@ -9479,7 +9458,7 @@ function getVueComponentName(filePath) {
9479
9458
  if (fileName !== "index") {
9480
9459
  return fileName;
9481
9460
  }
9482
- const parentDirName = basename2(dirname10(filePath));
9461
+ const parentDirName = basename2(dirname9(filePath));
9483
9462
  return parentDirName || fileName;
9484
9463
  }
9485
9464
  async function extractOptionsComponent(filePath, scriptContent, fileWarnings, name, templateAst, sfcSource) {
@@ -9662,7 +9641,7 @@ function findWorkspaceRoot(startDir) {
9662
9641
  } catch {
9663
9642
  }
9664
9643
  }
9665
- const parent = dirname10(dir);
9644
+ const parent = dirname9(dir);
9666
9645
  if (parent === dir) {
9667
9646
  workspaceRootCache.set(startDir, null);
9668
9647
  return null;
@@ -9718,7 +9697,7 @@ function getWorkspacePackageDirs(workspaceRoot) {
9718
9697
  return packageMap;
9719
9698
  }
9720
9699
  function resolveWorkspaceVueImport(specifier, importingFilePath) {
9721
- const workspaceRoot = findWorkspaceRoot(dirname10(importingFilePath));
9700
+ const workspaceRoot = findWorkspaceRoot(dirname9(importingFilePath));
9722
9701
  if (!workspaceRoot)
9723
9702
  return null;
9724
9703
  const packageDirs = getWorkspacePackageDirs(workspaceRoot);
@@ -9810,7 +9789,7 @@ async function extractOptionsProps(filePath, scriptContent, visited = /* @__PURE
9810
9789
  if (specifier.startsWith(".")) {
9811
9790
  if (!specifier.endsWith(".vue"))
9812
9791
  continue;
9813
- localImports.set(defaultImport.getText(), resolve10(dirname10(resolvedFilePath), specifier));
9792
+ localImports.set(defaultImport.getText(), resolve10(dirname9(resolvedFilePath), specifier));
9814
9793
  } else {
9815
9794
  const resolvedVuePath = resolveWorkspaceVueImport(specifier, resolvedFilePath);
9816
9795
  if (resolvedVuePath) {
@@ -10187,7 +10166,7 @@ async function extractAstroComponents(filePaths, onProgress) {
10187
10166
  }
10188
10167
 
10189
10168
  // packages/experience-design-system-backend-pipeline/dist/src/steps/extraction/src/framework-adapters/web-components/extract-web-components.js
10190
- import { basename as basename4, dirname as dirname11, join as join12, resolve as resolve11 } from "node:path";
10169
+ import { basename as basename4, dirname as dirname10, join as join12, resolve as resolve11 } from "node:path";
10191
10170
  import { Project as Project5, Node as Node8, SyntaxKind as SyntaxKind6 } from "ts-morph";
10192
10171
  function normalizeComponentName(input) {
10193
10172
  return input.replace(/[^a-zA-Z0-9]/g, "").toLowerCase();
@@ -10832,7 +10811,7 @@ function getElementTagNameFromFastDefinition(classDecl, project) {
10832
10811
  }
10833
10812
  function resolveImportSourcePath2(fromFilePath, specifier) {
10834
10813
  if (specifier.startsWith(".")) {
10835
- const resolvedPath = resolve11(dirname11(fromFilePath), specifier);
10814
+ const resolvedPath = resolve11(dirname10(fromFilePath), specifier);
10836
10815
  if (resolvedPath.endsWith(".js")) {
10837
10816
  return `${resolvedPath.slice(0, -3)}.ts`;
10838
10817
  }
@@ -11002,7 +10981,7 @@ async function extractWebComponentDefinitions(filePaths) {
11002
10981
 
11003
10982
  // packages/experience-design-system-backend-pipeline/dist/src/steps/extraction/src/framework-adapters/svelte/extract-svelte-components.js
11004
10983
  import os3 from "node:os";
11005
- import { basename as basename5, dirname as dirname12, resolve as resolve12, join as join13 } from "node:path";
10984
+ import { basename as basename5, dirname as dirname11, resolve as resolve12, join as join13 } from "node:path";
11006
10985
  import { existsSync as existsSync7, readFileSync as readFileSync6 } from "node:fs";
11007
10986
  import { createRequire } from "node:module";
11008
10987
  import { parse as parseSvelte } from "svelte/compiler";
@@ -11239,7 +11218,7 @@ function findNearestTsconfig(startDir) {
11239
11218
  const candidate = join13(dir, "tsconfig.json");
11240
11219
  if (existsSync7(candidate))
11241
11220
  return candidate;
11242
- const parent = dirname12(dir);
11221
+ const parent = dirname11(dir);
11243
11222
  if (!parent || parent === dir)
11244
11223
  return null;
11245
11224
  dir = parent;
@@ -11369,7 +11348,7 @@ function locateDtsForSpecifier(req, specifier, parentFile) {
11369
11348
  } catch {
11370
11349
  resolvedJs = null;
11371
11350
  }
11372
- const seedDir = resolvedJs ? dirname12(resolvedJs) : dirname12(parentFile);
11351
+ const seedDir = resolvedJs ? dirname11(resolvedJs) : dirname11(parentFile);
11373
11352
  const pkgRoot = findPackageRootForSpecifier(seedDir, specifier);
11374
11353
  if (pkgRoot) {
11375
11354
  const pkgJsonPath = join13(pkgRoot, "package.json");
@@ -11422,7 +11401,7 @@ function findPackageRootForSpecifier(seedDir, specifier) {
11422
11401
  } catch {
11423
11402
  }
11424
11403
  }
11425
- const parent = dirname12(dir);
11404
+ const parent = dirname11(dir);
11426
11405
  if (!parent || parent === dir)
11427
11406
  return null;
11428
11407
  dir = parent;
@@ -11554,11 +11533,11 @@ async function extractFromSvelteFile(filePath, source) {
11554
11533
  var ANATOMY_FOLDERS = /* @__PURE__ */ new Set(["anatomy", "parts"]);
11555
11534
  function getSvelteComponentName(filePath) {
11556
11535
  const file = basename5(filePath, ".svelte");
11557
- const parentDir = basename5(dirname12(filePath));
11536
+ const parentDir = basename5(dirname11(filePath));
11558
11537
  if (file === "index")
11559
11538
  return toPascalCase(parentDir);
11560
11539
  if (ANATOMY_FOLDERS.has(parentDir)) {
11561
- const grandparent = basename5(dirname12(dirname12(filePath)));
11540
+ const grandparent = basename5(dirname11(dirname11(filePath)));
11562
11541
  if (grandparent && grandparent !== "." && grandparent !== "/") {
11563
11542
  return `${toPascalCase(grandparent)}${toPascalCase(file)}`;
11564
11543
  }
@@ -12687,7 +12666,7 @@ function extractProps2(cls, meta) {
12687
12666
  }
12688
12667
 
12689
12668
  // packages/experience-design-system-backend-pipeline/dist/src/steps/extraction/src/framework-adapters/angular/helpers/read-component-metadata.js
12690
- import { dirname as dirname13, resolve as resolve13 } from "node:path";
12669
+ import { dirname as dirname12, resolve as resolve13 } from "node:path";
12691
12670
 
12692
12671
  // packages/experience-design-system-backend-pipeline/dist/src/steps/extraction/src/framework-adapters/angular/helpers/resolution/normalize-component-name.js
12693
12672
  var SUFFIXES = ["Component", "Directive"];
@@ -12742,7 +12721,7 @@ function readComponentMetadata(cls, sourceFilePath) {
12742
12721
  const inlineTemplate = readDecoratorString(obj, "template");
12743
12722
  const templateUrlRel = readDecoratorString(obj, "templateUrl");
12744
12723
  const inputsArray = readDecoratorStringArray(obj, "inputs");
12745
- const templatePath = templateUrlRel ? resolve13(dirname13(sourceFilePath), templateUrlRel) : null;
12724
+ const templatePath = templateUrlRel ? resolve13(dirname12(sourceFilePath), templateUrlRel) : null;
12746
12725
  const decorator = cls.getDecorator("Component");
12747
12726
  const decoratorLine = decorator?.getStartLineNumber() ?? cls.getStartLineNumber();
12748
12727
  return {
@@ -13565,10 +13544,10 @@ function applyCompositionEdges(components, edges) {
13565
13544
 
13566
13545
  // packages/experience-design-system-backend-pipeline/dist/src/steps/composition/src/helpers/prompt/prompt-loader.js
13567
13546
  import { existsSync as existsSync8, readFileSync as readFileSync7 } from "node:fs";
13568
- import { dirname as dirname14, join as join14, resolve as resolve14 } from "node:path";
13547
+ import { dirname as dirname13, join as join14, resolve as resolve14 } from "node:path";
13569
13548
  import { fileURLToPath as fileURLToPath3 } from "node:url";
13570
13549
  function resolvePromptPath(fileName) {
13571
- const thisDir = dirname14(fileURLToPath3(import.meta.url));
13550
+ const thisDir = dirname13(fileURLToPath3(import.meta.url));
13572
13551
  let dir = thisDir;
13573
13552
  for (; ; ) {
13574
13553
  const candidate = join14(dir, "prompts");
@@ -13739,7 +13718,7 @@ ${fileDigest}`);
13739
13718
  }
13740
13719
 
13741
13720
  // packages/experience-design-system-backend-pipeline/dist/src/steps/composition/src/helpers/edges/manifest-doc-evidence.js
13742
- import { dirname as dirname15 } from "node:path";
13721
+ import { dirname as dirname14 } from "node:path";
13743
13722
  function kebabToPascal3(name) {
13744
13723
  return name.split("-").filter(Boolean).map((seg) => seg.charAt(0).toUpperCase() + seg.slice(1)).join("");
13745
13724
  }
@@ -13803,8 +13782,8 @@ function collectAgentsDocEdges(files, components, componentNames) {
13803
13782
  for (const file of files) {
13804
13783
  if (!file.path.endsWith("AGENTS.md"))
13805
13784
  continue;
13806
- const docDir = dirname15(file.path);
13807
- const parent = components.find((c2) => c2.sourcePath && dirname15(c2.sourcePath) === docDir)?.name;
13785
+ const docDir = dirname14(file.path);
13786
+ const parent = components.find((c2) => c2.sourcePath && dirname14(c2.sourcePath) === docDir)?.name;
13808
13787
  if (!parent || !componentNames.has(parent))
13809
13788
  continue;
13810
13789
  for (const line of file.content.split("\n")) {
@@ -14600,9 +14579,9 @@ async function readRunsFileMaybe() {
14600
14579
 
14601
14580
  // packages/experience-design-system-backend-pipeline/dist/src/persistence/src/runs/repositories/write-runs-file.js
14602
14581
  import { mkdir as mkdir4, rename as rename2, writeFile as writeFile6 } from "node:fs/promises";
14603
- import { dirname as dirname16 } from "node:path";
14582
+ import { dirname as dirname15 } from "node:path";
14604
14583
  async function writeRunsFileAtomic(file) {
14605
- await mkdir4(dirname16(runsFilePath()), { recursive: true });
14584
+ await mkdir4(dirname15(runsFilePath()), { recursive: true });
14606
14585
  const body = JSON.stringify(file, null, 2) + "\n";
14607
14586
  const tmp = `${runsFilePath()}.${process.pid}.${Date.now()}.tmp`;
14608
14587
  await writeFile6(tmp, body, { mode: 384 });
@@ -19164,10 +19143,10 @@ import { join as join21, resolve as resolve24 } from "node:path";
19164
19143
 
19165
19144
  // packages/experience-design-system-cli/src/tui/import/steps/06-extraction/find-skill-path.ts
19166
19145
  import { existsSync as existsSync10 } from "node:fs";
19167
- import { dirname as dirname17, join as join20, resolve as resolve22 } from "node:path";
19146
+ import { dirname as dirname16, join as join20, resolve as resolve22 } from "node:path";
19168
19147
  import { fileURLToPath as fileURLToPath4 } from "node:url";
19169
19148
  function findSkillPath(fileName) {
19170
- const thisDir = dirname17(fileURLToPath4(import.meta.url));
19149
+ const thisDir = dirname16(fileURLToPath4(import.meta.url));
19171
19150
  let dir = thisDir;
19172
19151
  for (; ; ) {
19173
19152
  const candidate = join20(dir, "skills", fileName);
@@ -28732,7 +28711,7 @@ function DoneStep({
28732
28711
  import { useState as useState29 } from "react";
28733
28712
  import { Box as Box42, Text as Text44 } from "ink";
28734
28713
  import { readdirSync as readdirSync4 } from "node:fs";
28735
- import { dirname as dirname18, basename as basename7, join as join23 } from "node:path";
28714
+ import { dirname as dirname17, basename as basename7, join as join23 } from "node:path";
28736
28715
 
28737
28716
  // packages/experience-design-system-cli/src/tui/import/steps/10-flow/support/path-utils.ts
28738
28717
  import { resolve as resolve26 } from "node:path";
@@ -28768,7 +28747,7 @@ import { jsx as jsx52, jsxs as jsxs42 } from "react/jsx-runtime";
28768
28747
  function autocomplete(partial) {
28769
28748
  if (!partial) return null;
28770
28749
  const normalized = normalizePath(partial);
28771
- const dir = dirname18(normalized);
28750
+ const dir = dirname17(normalized);
28772
28751
  const base = basename7(normalized);
28773
28752
  let entries;
28774
28753
  try {
package/dist/index.js CHANGED
@@ -19943,9 +19943,8 @@ var init_zip = __esm({
19943
19943
  });
19944
19944
 
19945
19945
  // packages/experience-design-system-cli/src/tui/support-bundle.ts
19946
- import { spawn as spawn4 } from "node:child_process";
19947
19946
  import { readdir as readdir3, readFile as readFile21, stat as stat5, writeFile as writeFile8 } from "node:fs/promises";
19948
- import { basename as basename6, dirname as dirname16, join as join20, sep } from "node:path";
19947
+ import { basename as basename6, join as join20, sep } from "node:path";
19949
19948
  async function bundleDebugLogs() {
19950
19949
  const session = currentSessionDir();
19951
19950
  const debugDir = currentDebugSessionDir();
@@ -19967,26 +19966,17 @@ async function bundleDebugLogs() {
19967
19966
  return { status: "failed", folder: debugDir };
19968
19967
  }
19969
19968
  }
19970
- function openSupportBundle(bundle) {
19971
- if (bundle.status === "no-logs") return;
19972
- const target = bundle.status === "created" ? bundle.path : bundle.folder;
19973
- const command = process.platform === "darwin" ? { file: "open", args: bundle.status === "created" ? ["-R", target] : [target] } : process.platform === "win32" ? { file: "explorer.exe", args: bundle.status === "created" ? [`/select,${target}`] : [target] } : { file: "xdg-open", args: [bundle.status === "created" ? dirname16(target) : target] };
19974
- try {
19975
- const child = spawn4(command.file, command.args, { stdio: "ignore", detached: true });
19976
- child.on("error", () => void 0);
19977
- child.unref();
19978
- } catch {
19979
- }
19980
- }
19981
19969
  function supportInstruction(bundle) {
19982
19970
  switch (bundle.status) {
19983
19971
  case "created":
19984
- return `Debug logs saved to ${bundle.path}
19985
- Send this file to Contentful support so they can look into it.`;
19972
+ return `The import hit an error. We zipped up your debug logs, you can find the file here:
19973
+ ${bundle.path}
19974
+ Send that zip file to Contentful support so they can look into it.`;
19986
19975
  case "no-logs":
19987
- return "No debug logs were recorded. To get help, turn on Debug Mode in Settings, run the import again and send the zip file it saves to Contentful support.";
19976
+ return "The import hit an error, but no debug logs were recorded. To get help, turn on Debug Mode in Settings, run the import again and send the zip file it saves to Contentful support.";
19988
19977
  case "failed":
19989
- return `Your debug logs are in ${bundle.folder}
19978
+ return `The import hit an error. We could not zip your debug logs, but you can find them here:
19979
+ ${bundle.folder}
19990
19980
  Zip that folder and send it to Contentful support so they can look into it.`;
19991
19981
  }
19992
19982
  }
@@ -20002,7 +19992,6 @@ var init_support_bundle = __esm({
20002
19992
  function errorAction(input, key, available) {
20003
19993
  if (key.return && available.canAcknowledge) return "acknowledge";
20004
19994
  if (input === "r" && available.canRetry) return "retry";
20005
- if (input === "o" && available.canOpen) return "open";
20006
19995
  if (key.return || key.escape) return "exit";
20007
19996
  return null;
20008
19997
  }
@@ -20010,8 +19999,7 @@ function errorControls(available) {
20010
19999
  return [
20011
20000
  available.canAcknowledge ? { keys: "Enter", label: "Acknowledge and apply" } : { keys: "Enter", label: "Exit" },
20012
20001
  ...available.canAcknowledge ? [{ keys: "Esc", label: "Exit" }] : [],
20013
- ...available.canRetry ? [{ keys: "r", label: "Re-enter credentials" }] : [],
20014
- ...available.canOpen ? [{ keys: "o", label: "Show debug logs in file manager" }] : []
20002
+ ...available.canRetry ? [{ keys: "r", label: "Re-enter credentials" }] : []
20015
20003
  ];
20016
20004
  }
20017
20005
  var init_logic2 = __esm({
@@ -20026,12 +20014,10 @@ function useErrorControls(handlers) {
20026
20014
  useInput4((input, key) => {
20027
20015
  const action = errorAction(input, key, {
20028
20016
  canRetry: handlers.onRetry !== void 0,
20029
- canAcknowledge: handlers.onAcknowledge !== void 0,
20030
- canOpen: handlers.onOpen !== void 0
20017
+ canAcknowledge: handlers.onAcknowledge !== void 0
20031
20018
  });
20032
20019
  if (action === "acknowledge") handlers.onAcknowledge?.();
20033
20020
  else if (action === "retry") handlers.onRetry?.();
20034
- else if (action === "open") handlers.onOpen?.();
20035
20021
  else if (action === "exit") handlers.onExit();
20036
20022
  });
20037
20023
  }
@@ -20074,18 +20060,11 @@ function ErrorStep({
20074
20060
  onRetryCredentials,
20075
20061
  onAcknowledgeBreakingChanges
20076
20062
  }) {
20063
+ useErrorControls({ onExit, onRetry: onRetryCredentials, onAcknowledge: onAcknowledgeBreakingChanges });
20077
20064
  const bundle = useSupportBundle();
20078
- const canOpen = bundle !== void 0 && bundle.status !== "no-logs";
20079
- useErrorControls({
20080
- onExit,
20081
- onRetry: onRetryCredentials,
20082
- onAcknowledge: onAcknowledgeBreakingChanges,
20083
- onOpen: canOpen ? () => openSupportBundle(bundle) : void 0
20084
- });
20085
20065
  const controls = errorControls({
20086
20066
  canRetry: onRetryCredentials !== void 0,
20087
- canAcknowledge: onAcknowledgeBreakingChanges !== void 0,
20088
- canOpen
20067
+ canAcknowledge: onAcknowledgeBreakingChanges !== void 0
20089
20068
  });
20090
20069
  return /* @__PURE__ */ jsxs4(Box4, { flexDirection: "column", gap: 1, paddingX: 2, paddingY: 1, children: [
20091
20070
  /* @__PURE__ */ jsxs4(Text4, { bold: true, color: PALETTE.error, children: [
@@ -22005,10 +21984,10 @@ var init_steps = __esm({
22005
21984
 
22006
21985
  // packages/experience-design-system-cli/src/tui/import/steps/06-extraction/find-skill-path.ts
22007
21986
  import { existsSync as existsSync11 } from "node:fs";
22008
- import { dirname as dirname17, join as join21, resolve as resolve22 } from "node:path";
21987
+ import { dirname as dirname16, join as join21, resolve as resolve22 } from "node:path";
22009
21988
  import { fileURLToPath as fileURLToPath4 } from "node:url";
22010
21989
  function findSkillPath(fileName) {
22011
- const thisDir = dirname17(fileURLToPath4(import.meta.url));
21990
+ const thisDir = dirname16(fileURLToPath4(import.meta.url));
22012
21991
  let dir = thisDir;
22013
21992
  for (; ; ) {
22014
21993
  const candidate = join21(dir, "skills", fileName);
@@ -32477,12 +32456,12 @@ var init_use_blinking_cursor = __esm({
32477
32456
  import { useState as useState29 } from "react";
32478
32457
  import { Box as Box42, Text as Text44 } from "ink";
32479
32458
  import { readdirSync as readdirSync4 } from "node:fs";
32480
- import { dirname as dirname18, basename as basename7, join as join24 } from "node:path";
32459
+ import { dirname as dirname17, basename as basename7, join as join24 } from "node:path";
32481
32460
  import { jsx as jsx52, jsxs as jsxs42 } from "react/jsx-runtime";
32482
32461
  function autocomplete(partial) {
32483
32462
  if (!partial) return null;
32484
32463
  const normalized = normalizePath(partial);
32485
- const dir = dirname18(normalized);
32464
+ const dir = dirname17(normalized);
32486
32465
  const base = basename7(normalized);
32487
32466
  let entries;
32488
32467
  try {
@@ -36136,7 +36115,7 @@ init_config();
36136
36115
  init_package_root();
36137
36116
  import { existsSync as existsSync12 } from "node:fs";
36138
36117
  import { mkdir as mkdir10, readFile as readFile22, rename as rename3, rmdir as rmdir2, unlink } from "node:fs/promises";
36139
- import { dirname as dirname19, join as join29 } from "node:path";
36118
+ import { dirname as dirname18, join as join29 } from "node:path";
36140
36119
  var PACKAGE_NAME3 = "@contentful/experience-design-system-cli";
36141
36120
  async function readJson(path5) {
36142
36121
  try {
@@ -36162,7 +36141,7 @@ async function migrateOldConfig() {
36162
36141
  if (Object.keys(migrated).length > 0) await updateSettings2({ ...migrated, ...await readSettings2() });
36163
36142
  if (existsSync12(oldRuns)) {
36164
36143
  if (!existsSync12(runsFilePath2())) {
36165
- await mkdir10(dirname19(runsFilePath2()), { recursive: true });
36144
+ await mkdir10(dirname18(runsFilePath2()), { recursive: true });
36166
36145
  await rename3(oldRuns, runsFilePath2());
36167
36146
  } else {
36168
36147
  await unlink(oldRuns);
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentful/experience-design-system-cli",
3
- "version": "2.42.1-dev-build-c7f654e2.0",
3
+ "version": "2.42.1-dev-build-25400cd0.0",
4
4
  "description": "Contentful Experiences design system import CLI",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -2,8 +2,6 @@ interface ErrorHandlers {
2
2
  onExit: () => void;
3
3
  onRetry?: () => void;
4
4
  onAcknowledge?: () => void;
5
- /** Set once there is something to show in the file manager. */
6
- onOpen?: () => void;
7
5
  }
8
6
  export declare function useErrorControls(handlers: ErrorHandlers): void;
9
7
  export {};
@@ -2,11 +2,10 @@ interface Key {
2
2
  return: boolean;
3
3
  escape: boolean;
4
4
  }
5
- export type ErrorAction = 'exit' | 'retry' | 'acknowledge' | 'open' | null;
5
+ export type ErrorAction = 'exit' | 'retry' | 'acknowledge' | null;
6
6
  interface Available {
7
7
  canRetry: boolean;
8
8
  canAcknowledge: boolean;
9
- canOpen: boolean;
10
9
  }
11
10
  export declare function errorAction(input: string, key: Key, available: Available): ErrorAction;
12
11
  export declare function errorControls(available: Available): {
@@ -19,7 +19,5 @@ export type SupportBundle = {
19
19
  * screen that explains an error, and must not replace that error with another.
20
20
  */
21
21
  export declare function bundleDebugLogs(): Promise<SupportBundle>;
22
- /** Shows the zip (or, if there is none, the debug folder) in Finder or File Explorer. Best effort: a failure is ignored. */
23
- export declare function openSupportBundle(bundle: SupportBundle): void;
24
22
  /** What the error screen says about the logs, in one short instruction. */
25
23
  export declare function supportInstruction(bundle: SupportBundle): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentful/experience-design-system-cli",
3
- "version": "2.42.1-dev-build-c7f654e2.0",
3
+ "version": "2.42.1-dev-build-25400cd0.0",
4
4
  "description": "Contentful Experiences design system import CLI",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -45,7 +45,7 @@
45
45
  "ts-morph": "^27.0.2",
46
46
  "typescript": "^5.9.3",
47
47
  "zod": "^4.6.5",
48
- "@contentful/experience-design-system-types": "2.42.1-dev-build-c7f654e2.0"
48
+ "@contentful/experience-design-system-types": "2.42.1-dev-build-25400cd0.0"
49
49
  },
50
50
  "devDependencies": {
51
51
  "@tsconfig/node24": "^24.0.4",
@@ -59,7 +59,7 @@
59
59
  "ink-testing-library": "^4.0.0",
60
60
  "typescript-eslint": "^8.67.0",
61
61
  "vitest": "^4.0.16",
62
- "@contentful/experience-design-system-backend-pipeline": "2.42.1-dev-build-c7f654e2.0"
62
+ "@contentful/experience-design-system-backend-pipeline": "2.42.1-dev-build-25400cd0.0"
63
63
  },
64
64
  "repository": {
65
65
  "type": "git",