@contentful/experience-design-system-cli 2.35.1-dev-build-392cfefa.0 → 2.35.1-dev-build-76df9d03.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.
@@ -40,13 +40,10 @@ var init_host_utils = __esm({
40
40
  });
41
41
 
42
42
  // packages/experience-design-system-cli-legacy/src/credentials-store.ts
43
- import { readFile, writeFile, mkdir } from "node:fs/promises";
44
- import { join } from "node:path";
45
- import { homedir } from "node:os";
43
+ import { configFilePath, readSettings, writeSettings } from "@contentful/experience-design-system-types/config";
46
44
  async function readExperiencesCredentials() {
47
45
  try {
48
- const raw = await readFile(CREDENTIALS_PATH, "utf8");
49
- const parsed = JSON.parse(raw);
46
+ const parsed = await readSettings();
50
47
  const host = toConfiguredHost(parsed.host || process.env["EDS_HOST"]);
51
48
  return {
52
49
  spaceId: parsed.spaceId || process.env["CONTENTFUL_SPACE_ID"] || "",
@@ -71,38 +68,40 @@ async function readExperiencesCredentials() {
71
68
  }
72
69
  }
73
70
  async function writeExperiencesCredentials(creds) {
74
- const { host: _host, agent, agentModel, generatePromptPath, debug, noColor: noColor2, analyticsDisabled, ...rest } = creds;
71
+ const { host: _host, ...rest } = creds;
75
72
  const host = toConfiguredHost(creds.host);
76
- await mkdir(CREDENTIALS_DIR, { recursive: true });
77
- await writeFile(
78
- CREDENTIALS_PATH,
79
- JSON.stringify(
80
- {
81
- ...rest,
82
- ...host ? { host } : {},
83
- ...agent ? { agent } : {},
84
- ...agentModel ? { agentModel } : {},
85
- ...generatePromptPath ? { generatePromptPath } : {},
86
- ...typeof debug === "boolean" ? { debug } : {},
87
- ...typeof noColor2 === "boolean" ? { noColor: noColor2 } : {},
88
- ...typeof analyticsDisabled === "boolean" ? { analyticsDisabled } : {}
89
- },
90
- null,
91
- 2
92
- ) + "\n",
93
- { mode: 384 }
94
- );
73
+ const optional = Object.fromEntries(Object.entries(rest).filter(([, v]) => v !== void 0 && v !== ""));
74
+ const current = await readSettings();
75
+ for (const key of OWNED_KEYS) delete current[key];
76
+ await writeSettings({
77
+ ...current,
78
+ ...optional,
79
+ spaceId: rest.spaceId,
80
+ environmentId: rest.environmentId,
81
+ cmaToken: rest.cmaToken,
82
+ ...host ? { host } : {}
83
+ });
95
84
  }
96
85
  function experiencesCredentialsPath() {
97
- return CREDENTIALS_PATH;
86
+ return configFilePath();
98
87
  }
99
- var CREDENTIALS_DIR, CREDENTIALS_PATH;
88
+ var OWNED_KEYS;
100
89
  var init_credentials_store = __esm({
101
90
  "packages/experience-design-system-cli-legacy/src/credentials-store.ts"() {
102
91
  "use strict";
103
92
  init_host_utils();
104
- CREDENTIALS_DIR = join(homedir(), ".config", "experiences");
105
- CREDENTIALS_PATH = join(CREDENTIALS_DIR, "credentials.json");
93
+ OWNED_KEYS = [
94
+ "spaceId",
95
+ "environmentId",
96
+ "cmaToken",
97
+ "host",
98
+ "agent",
99
+ "agentModel",
100
+ "generatePromptPath",
101
+ "debug",
102
+ "noColor",
103
+ "analyticsDisabled"
104
+ ];
106
105
  }
107
106
  });
108
107
 
@@ -153,8 +152,8 @@ var init_validate_generation_request = __esm({
153
152
 
154
153
  // packages/experience-design-system-generation/dist/src/services/prompts/helpers/resolve-skill-file.js
155
154
  import { existsSync } from "node:fs";
156
- import { readFile as readFile2 } from "node:fs/promises";
157
- import { dirname, join as join2, resolve } from "node:path";
155
+ import { readFile } from "node:fs/promises";
156
+ import { dirname, join, resolve } from "node:path";
158
157
  import { fileURLToPath } from "node:url";
159
158
  function resolveSkillPath(skill) {
160
159
  if (!(skill in SKILL_FILES))
@@ -162,9 +161,9 @@ function resolveSkillPath(skill) {
162
161
  const thisDir = dirname(fileURLToPath(import.meta.url));
163
162
  let dir = thisDir;
164
163
  for (; ; ) {
165
- const candidate = join2(dir, "skills");
164
+ const candidate = join(dir, "skills");
166
165
  if (existsSync(candidate))
167
- return join2(candidate, SKILL_FILES[skill]);
166
+ return join(candidate, SKILL_FILES[skill]);
168
167
  const parent = resolve(dir, "..");
169
168
  if (parent === dir) {
170
169
  throw new Error(`skill file missing from CLI installation (could not locate skills/ directory from: ${thisDir})`);
@@ -182,14 +181,14 @@ async function readSkillFile(skill, override) {
182
181
  if (override) {
183
182
  const skillPath2 = resolve(override);
184
183
  try {
185
- return await readFile2(skillPath2, "utf8");
184
+ return await readFile(skillPath2, "utf8");
186
185
  } catch {
187
186
  throw new Error(`custom prompt file not found (skill: ${skill}, path: ${skillPath2})`);
188
187
  }
189
188
  }
190
189
  const skillPath = resolveSkillPath(skill);
191
190
  try {
192
- return await readFile2(skillPath, "utf8");
191
+ return await readFile(skillPath, "utf8");
193
192
  } catch {
194
193
  throw new Error(`skill file missing from CLI installation \u2014 try reinstalling the CLI (looked for: ${skillPath})`);
195
194
  }
@@ -1997,13 +1996,13 @@ __export(cache_keys_exports, {
1997
1996
  hashPromptForSkill: () => hashPromptForSkill
1998
1997
  });
1999
1998
  import { createHash as createHash4 } from "node:crypto";
2000
- import { readFile as readFile3 } from "node:fs/promises";
1999
+ import { readFile as readFile2 } from "node:fs/promises";
2001
2000
  import { resolve as resolve2 } from "node:path";
2002
2001
  function hashContent(content) {
2003
2002
  return createHash4("sha256").update(content).digest("hex");
2004
2003
  }
2005
2004
  async function hashFile(filePath) {
2006
- const content = await readFile3(filePath, "utf8");
2005
+ const content = await readFile2(filePath, "utf8");
2007
2006
  return hashContent(content);
2008
2007
  }
2009
2008
  async function hashPromptForSkill(skill, agent, model, skillPathOverride, extraInputs = [], skillContentOverride) {
@@ -2021,15 +2020,15 @@ var init_cache_keys = __esm({
2021
2020
  // packages/experience-design-system-cli-legacy/src/session/db.ts
2022
2021
  import { DatabaseSync } from "node:sqlite";
2023
2022
  import { mkdirSync, readFileSync } from "node:fs";
2024
- import { readFile as readFile4 } from "node:fs/promises";
2023
+ import { readFile as readFile3 } from "node:fs/promises";
2025
2024
  import { createHash as createHash5 } from "node:crypto";
2026
- import { homedir as homedir2 } from "node:os";
2025
+ import { configRoot } from "@contentful/experience-design-system-types/config";
2027
2026
  import { dirname as dirname2, resolve as resolve3 } from "node:path";
2028
2027
  function getPipelineDbPath() {
2029
2028
  if (process.env.EDS_PIPELINE_DB_PATH) {
2030
2029
  return resolve3(process.env.EDS_PIPELINE_DB_PATH);
2031
2030
  }
2032
- return resolve3(homedir2(), ".contentful", "experience-design-system-cli", "pipeline.db");
2031
+ return resolve3(configRoot(), "pipeline.db");
2033
2032
  }
2034
2033
  function openPipelineDb(dbPath) {
2035
2034
  const path = dbPath ?? getPipelineDbPath();
@@ -2829,7 +2828,7 @@ async function resolveRelativeImport(specifier, fromDir) {
2829
2828
  ];
2830
2829
  for (const candidate of candidates) {
2831
2830
  try {
2832
- await readFile4(candidate, "utf8");
2831
+ await readFile3(candidate, "utf8");
2833
2832
  return candidate;
2834
2833
  } catch {
2835
2834
  }
@@ -2859,7 +2858,7 @@ async function loadSiblingFiles(sourceText, sourcePath, propNames, candidateType
2859
2858
  if (discovered.length >= MAX_SIBLING_CANDIDATES_EXPLORED) break;
2860
2859
  let content;
2861
2860
  try {
2862
- content = await readFile4(resolvedPath, "utf8");
2861
+ content = await readFile3(resolvedPath, "utf8");
2863
2862
  } catch {
2864
2863
  continue;
2865
2864
  }
@@ -2896,7 +2895,7 @@ async function loadComponentSourceRef(name, sourcePath, propNames = [], propType
2896
2895
  let truncatedSiblingCount = 0;
2897
2896
  const usesNotShown = /* @__PURE__ */ new Set();
2898
2897
  try {
2899
- const rawText = await readFile4(sourcePath, "utf8");
2898
+ const rawText = await readFile3(sourcePath, "utf8");
2900
2899
  let siblingUsesNotShown;
2901
2900
  let declaredTypeNames;
2902
2901
  ({
@@ -4000,11 +3999,11 @@ CREATE INDEX IF NOT EXISTS idx_scanned_files_session ON scanned_files(session
4000
3999
  });
4001
4000
 
4002
4001
  // packages/experience-design-system-cli-legacy/src/helpers/read-existing-contentful-entities-from-session.ts
4003
- import { readFile as readFile5 } from "node:fs/promises";
4002
+ import { readFile as readFile4 } from "node:fs/promises";
4004
4003
  async function readExistingContentfulEntitiesFromSession(path) {
4005
4004
  if (!path) return void 0;
4006
4005
  try {
4007
- const raw = await readFile5(path, "utf8");
4006
+ const raw = await readFile4(path, "utf8");
4008
4007
  const parsed = JSON.parse(raw);
4009
4008
  if (!Array.isArray(parsed.components) || !Array.isArray(parsed.tokens)) return void 0;
4010
4009
  return parsed;
@@ -4129,18 +4128,18 @@ var init_resolve_session_id = __esm({
4129
4128
 
4130
4129
  // packages/experience-design-system-cli-legacy/src/lib/cli-path.ts
4131
4130
  import { existsSync as existsSync2 } from "node:fs";
4132
- import { dirname as dirname3, join as join3 } from "node:path";
4131
+ import { dirname as dirname3, join as join2 } from "node:path";
4133
4132
  import { fileURLToPath as fileURLToPath2 } from "node:url";
4134
4133
  function findCliPath() {
4135
4134
  let dir = dirname3(fileURLToPath2(import.meta.url));
4136
4135
  for (let i = 0; i < 8; i++) {
4137
- const candidate = join3(dir, "bin", "cli.js");
4136
+ const candidate = join2(dir, "bin", "cli.js");
4138
4137
  if (existsSync2(candidate)) return candidate;
4139
4138
  const parent = dirname3(dir);
4140
4139
  if (parent === dir) break;
4141
4140
  dir = parent;
4142
4141
  }
4143
- return join3(fileURLToPath2(import.meta.url), "..", "..", "..", "..", "bin", "cli.js");
4142
+ return join2(fileURLToPath2(import.meta.url), "..", "..", "..", "..", "bin", "cli.js");
4144
4143
  }
4145
4144
  function findPkgRoot() {
4146
4145
  return dirname3(dirname3(findCliPath()));
@@ -4153,7 +4152,7 @@ var init_cli_path = __esm({
4153
4152
 
4154
4153
  // packages/experience-design-system-cli-legacy/src/analytics/client.ts
4155
4154
  import { readFileSync as readFileSync2 } from "node:fs";
4156
- import { join as join4 } from "node:path";
4155
+ import { join as join3 } from "node:path";
4157
4156
  import { Analytics } from "@segment/analytics-node";
4158
4157
  function cliVersion() {
4159
4158
  return pkg.version;
@@ -4207,7 +4206,7 @@ var init_client = __esm({
4207
4206
  "packages/experience-design-system-cli-legacy/src/analytics/client.ts"() {
4208
4207
  "use strict";
4209
4208
  init_cli_path();
4210
- pkg = JSON.parse(readFileSync2(join4(findPkgRoot(), "package.json"), "utf8"));
4209
+ pkg = JSON.parse(readFileSync2(join3(findPkgRoot(), "package.json"), "utf8"));
4211
4210
  DEFAULT_WRITE_KEY = "6DmxiEPN3SV1vbRTTMcNqDzCvkfwT06N";
4212
4211
  analyticsClient = null;
4213
4212
  persistedDisabled = false;
@@ -4503,8 +4502,8 @@ var init_analytics = __esm({
4503
4502
 
4504
4503
  // packages/experience-design-system-cli-legacy/src/lib/debug-logger.ts
4505
4504
  import { mkdirSync as mkdirSync2, appendFileSync } from "node:fs";
4506
- import { join as join5, dirname as dirname4 } from "node:path";
4507
- import { homedir as homedir3 } from "node:os";
4505
+ import { join as join4, dirname as dirname4 } from "node:path";
4506
+ import { configRoot as configRoot2 } from "@contentful/experience-design-system-types/config";
4508
4507
  function redactValue(value, seen) {
4509
4508
  if (value === null || value === void 0) return value;
4510
4509
  if (typeof value === "string") {
@@ -4529,7 +4528,7 @@ function redactForDebug(payload) {
4529
4528
  return redactValue(payload, /* @__PURE__ */ new WeakSet());
4530
4529
  }
4531
4530
  function defaultDebugRoot() {
4532
- return process.env[DEBUG_ROOT_ENV] ?? join5(homedir3(), ".contentful", "experience-design-system-cli", "debug");
4531
+ return process.env[DEBUG_ROOT_ENV] ?? join4(configRoot2(), "debug");
4533
4532
  }
4534
4533
  function makeSessionTimestamp() {
4535
4534
  const override = process.env["EDSI_DEBUG_TS"];
@@ -4553,7 +4552,7 @@ function initDebugLogger(opts) {
4553
4552
  const root = opts.root ?? defaultDebugRoot();
4554
4553
  const ts4 = makeSessionTimestamp();
4555
4554
  const suffix = opts.command ? `-${opts.command}` : "";
4556
- const path = join5(root, `${ts4}${suffix}.jsonl`);
4555
+ const path = join4(root, `${ts4}${suffix}.jsonl`);
4557
4556
  singleton = new FileDebugLogger(path);
4558
4557
  process.env[DEBUG_LOG_ENV] = path;
4559
4558
  if (opts.command) singleton.event("config", "command.start", { command: opts.command });
@@ -4693,7 +4692,7 @@ var init_cli_errors = __esm({
4693
4692
  });
4694
4693
 
4695
4694
  // packages/experience-design-system-cli-legacy/src/lib/prompt-overrides.ts
4696
- import { readFile as readFile6 } from "node:fs/promises";
4695
+ import { readFile as readFile5 } from "node:fs/promises";
4697
4696
  import { resolve as resolve4 } from "node:path";
4698
4697
  function looksLikePath(value) {
4699
4698
  if (value.includes("/") || value.includes("\\")) return true;
@@ -4728,7 +4727,7 @@ async function resolvePromptOverride(override) {
4728
4727
  if (override.kind === "text") return override.value;
4729
4728
  const abs = resolve4(override.value);
4730
4729
  try {
4731
- return await readFile6(abs, "utf8");
4730
+ return await readFile5(abs, "utf8");
4732
4731
  } catch {
4733
4732
  throw new Error(`--prompt: could not read prompt file: ${abs}`);
4734
4733
  }
@@ -5146,8 +5145,8 @@ var init_invoke_all_component_agents = __esm({
5146
5145
  });
5147
5146
 
5148
5147
  // packages/experience-design-system-cli-legacy/src/generate/helpers/read-file-inline.ts
5149
- import { readFile as readFile7, readdir, stat } from "node:fs/promises";
5150
- import { join as join6, resolve as resolve5 } from "node:path";
5148
+ import { readFile as readFile6, readdir, stat } from "node:fs/promises";
5149
+ import { join as join5, resolve as resolve5 } from "node:path";
5151
5150
  async function readFileInline(path) {
5152
5151
  if (!path) return void 0;
5153
5152
  const resolved = resolve5(path);
@@ -5157,7 +5156,7 @@ async function readFileInline(path) {
5157
5156
  } catch {
5158
5157
  return void 0;
5159
5158
  }
5160
- if (!s.isDirectory()) return readFile7(resolved, "utf8");
5159
+ if (!s.isDirectory()) return readFile6(resolved, "utf8");
5161
5160
  const files = [];
5162
5161
  async function walk(dir) {
5163
5162
  let entries;
@@ -5167,7 +5166,7 @@ async function readFileInline(path) {
5167
5166
  return;
5168
5167
  }
5169
5168
  for (const entry of entries.sort()) {
5170
- const full = join6(dir, entry);
5169
+ const full = join5(dir, entry);
5171
5170
  let es;
5172
5171
  try {
5173
5172
  es = await stat(full);
@@ -5183,7 +5182,7 @@ async function readFileInline(path) {
5183
5182
  }
5184
5183
  await walk(resolved);
5185
5184
  if (files.length === 0) return void 0;
5186
- const parts = await Promise.all(files.map((f) => readFile7(f, "utf8").catch(() => "")));
5185
+ const parts = await Promise.all(files.map((f) => readFile6(f, "utf8").catch(() => "")));
5187
5186
  return parts.filter(Boolean).join("\n\n");
5188
5187
  }
5189
5188
  var init_read_file_inline = __esm({
@@ -5221,14 +5220,14 @@ var init_parse_precomputed_cached_names = __esm({
5221
5220
  });
5222
5221
 
5223
5222
  // packages/experience-design-system-cli-legacy/src/analyze/select/persistence.ts
5224
- import { access as access2, appendFile, mkdir as mkdir2, readFile as readFile8, writeFile as writeFile2 } from "node:fs/promises";
5225
- import { homedir as homedir4 } from "node:os";
5223
+ import { access as access2, appendFile, mkdir, readFile as readFile7, writeFile } from "node:fs/promises";
5224
+ import { configRoot as configRoot3 } from "@contentful/experience-design-system-types/config";
5226
5225
  import { resolve as resolve6 } from "node:path";
5227
5226
  function getRefineArtifactsRoot() {
5228
5227
  if (process.env.EDS_REVIEW_ARTIFACTS_DIR) {
5229
5228
  return resolve6(process.env.EDS_REVIEW_ARTIFACTS_DIR);
5230
5229
  }
5231
- return resolve6(homedir4(), ".contentful", "experience-design-system-cli", "reviews");
5230
+ return resolve6(configRoot3(), "reviews");
5232
5231
  }
5233
5232
  async function getRefineSessionPaths(sessionId2, artifactsRoot) {
5234
5233
  const sessionDir = resolve6(artifactsRoot, sessionId2);
@@ -5239,18 +5238,18 @@ async function getRefineSessionPaths(sessionId2, artifactsRoot) {
5239
5238
  };
5240
5239
  }
5241
5240
  async function saveReviewState(statePath, session) {
5242
- await writeFile2(statePath, JSON.stringify(session, null, 2), "utf8");
5241
+ await writeFile(statePath, JSON.stringify(session, null, 2), "utf8");
5243
5242
  }
5244
5243
  async function ensureRefineSession(sessionId2, artifactsRoot, initialSnapshot) {
5245
5244
  const paths = await getRefineSessionPaths(sessionId2, artifactsRoot);
5246
- await mkdir2(paths.sessionDir, { recursive: true });
5245
+ await mkdir(paths.sessionDir, { recursive: true });
5247
5246
  try {
5248
5247
  await access2(paths.statePath);
5249
- const savedState = await readFile8(paths.statePath, "utf8");
5248
+ const savedState = await readFile7(paths.statePath, "utf8");
5250
5249
  return JSON.parse(savedState);
5251
5250
  } catch {
5252
- await writeFile2(paths.statePath, JSON.stringify(initialSnapshot, null, 2), "utf8");
5253
- await writeFile2(paths.eventsPath, "", "utf8");
5251
+ await writeFile(paths.statePath, JSON.stringify(initialSnapshot, null, 2), "utf8");
5252
+ await writeFile(paths.eventsPath, "", "utf8");
5254
5253
  return initialSnapshot;
5255
5254
  }
5256
5255
  }
@@ -5280,7 +5279,7 @@ async function writeScopeDecisionsSnapshot(db, sessionId2, decisions) {
5280
5279
  };
5281
5280
  });
5282
5281
  const paths = await getRefineSessionPaths(sessionId2, getRefineArtifactsRoot());
5283
- await mkdir2(paths.sessionDir, { recursive: true });
5282
+ await mkdir(paths.sessionDir, { recursive: true });
5284
5283
  await saveReviewState(paths.statePath, { components: records });
5285
5284
  }
5286
5285
  var init_persistence = __esm({
@@ -5291,12 +5290,12 @@ var init_persistence = __esm({
5291
5290
  });
5292
5291
 
5293
5292
  // packages/experience-design-system-cli-legacy/src/generate/services/load-accepted-names.ts
5294
- import { readFile as readFile9 } from "node:fs/promises";
5293
+ import { readFile as readFile8 } from "node:fs/promises";
5295
5294
  async function loadAcceptedNames(sessionId2) {
5296
5295
  try {
5297
5296
  const artifactsRoot = getRefineArtifactsRoot();
5298
5297
  const paths = await getRefineSessionPaths(sessionId2, artifactsRoot);
5299
- const raw = await readFile9(paths.statePath, "utf8");
5298
+ const raw = await readFile8(paths.statePath, "utf8");
5300
5299
  const snapshot = JSON.parse(raw);
5301
5300
  const accepted = snapshot.components.filter((c2) => c2.status === "accepted").map((c2) => c2.name);
5302
5301
  if (accepted.length === 0) return null;
@@ -6687,7 +6686,7 @@ var init_src2 = __esm({
6687
6686
 
6688
6687
  // packages/experience-design-system-cli-legacy/src/lib/user-agent.ts
6689
6688
  import { readFileSync as readFileSync3 } from "node:fs";
6690
- import { join as join7 } from "node:path";
6689
+ import { join as join6 } from "node:path";
6691
6690
  function buildUserAgent(version = pkg2.version) {
6692
6691
  const parts = [`app ${APP}/${version}`, `platform node.js/${process.version}`];
6693
6692
  const os4 = OS_NAMES2[process.platform];
@@ -6699,7 +6698,7 @@ var init_user_agent = __esm({
6699
6698
  "packages/experience-design-system-cli-legacy/src/lib/user-agent.ts"() {
6700
6699
  "use strict";
6701
6700
  init_cli_path();
6702
- pkg2 = JSON.parse(readFileSync3(join7(findPkgRoot(), "package.json"), "utf8"));
6701
+ pkg2 = JSON.parse(readFileSync3(join6(findPkgRoot(), "package.json"), "utf8"));
6703
6702
  APP = "contentful.experience-design-system-cli";
6704
6703
  OS_NAMES2 = {
6705
6704
  android: "Android",
@@ -7695,8 +7694,8 @@ var init_ServerApplyView = __esm({
7695
7694
  });
7696
7695
 
7697
7696
  // packages/experience-design-system-cli-legacy/src/apply/helpers/read-token-files.ts
7698
- import { readFile as readFile10, readdir as readdir2, stat as stat2 } from "node:fs/promises";
7699
- import { join as join8 } from "node:path";
7697
+ import { readFile as readFile9, readdir as readdir2, stat as stat2 } from "node:fs/promises";
7698
+ import { join as join7 } from "node:path";
7700
7699
  import { flattenDTCG as flattenDTCG2, validateDTCG } from "@contentful/experience-design-system-types";
7701
7700
  async function die2(message) {
7702
7701
  process.stderr.write(`${message}
@@ -7706,7 +7705,7 @@ async function die2(message) {
7706
7705
  async function readJsonFile(flag, p) {
7707
7706
  let text;
7708
7707
  try {
7709
- text = await readFile10(p, "utf8");
7708
+ text = await readFile9(p, "utf8");
7710
7709
  } catch {
7711
7710
  return await die2(`Error: file not found: ${p} (from ${flag})`);
7712
7711
  }
@@ -7728,7 +7727,7 @@ async function collectJsonFiles(dir) {
7728
7727
  await Promise.all(
7729
7728
  entries.map(async (entry) => {
7730
7729
  if (IGNORE_TOKEN_DIRS.has(entry)) return;
7731
- const full = join8(current, entry);
7730
+ const full = join7(current, entry);
7732
7731
  let s;
7733
7732
  try {
7734
7733
  s = await stat2(full);
@@ -7760,7 +7759,7 @@ async function readTokensFromPath(flag, p) {
7760
7759
  for (const file of files.sort()) {
7761
7760
  let text;
7762
7761
  try {
7763
- text = await readFile10(file, "utf8");
7762
+ text = await readFile9(file, "utf8");
7764
7763
  } catch {
7765
7764
  continue;
7766
7765
  }
@@ -8454,11 +8453,11 @@ var init_command2 = __esm({
8454
8453
  });
8455
8454
 
8456
8455
  // packages/experience-design-system-cli-legacy/src/print/validate/validators/read-json-file.ts
8457
- import { readFile as readFile11 } from "node:fs/promises";
8456
+ import { readFile as readFile10 } from "node:fs/promises";
8458
8457
  async function readJsonFile2(filePath) {
8459
8458
  let content;
8460
8459
  try {
8461
- content = await readFile11(filePath, "utf-8");
8460
+ content = await readFile10(filePath, "utf-8");
8462
8461
  } catch (err) {
8463
8462
  return {
8464
8463
  ok: false,
@@ -8676,7 +8675,7 @@ var init_format_errors = __esm({
8676
8675
 
8677
8676
  // packages/experience-design-system-cli-legacy/src/analyze/select/tui/components/TopBar.tsx
8678
8677
  import { readFileSync as readFileSync4 } from "node:fs";
8679
- import { join as join9 } from "node:path";
8678
+ import { join as join8 } from "node:path";
8680
8679
  import { Box as Box4, Text as Text5 } from "ink";
8681
8680
  import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
8682
8681
  function TopBar({ subcommand, hints }) {
@@ -8693,7 +8692,7 @@ var init_TopBar = __esm({
8693
8692
  "packages/experience-design-system-cli-legacy/src/analyze/select/tui/components/TopBar.tsx"() {
8694
8693
  "use strict";
8695
8694
  init_cli_path();
8696
- VERSION = JSON.parse(readFileSync4(join9(findPkgRoot(), "package.json"), "utf8")).version;
8695
+ VERSION = JSON.parse(readFileSync4(join8(findPkgRoot(), "package.json"), "utf8")).version;
8697
8696
  }
8698
8697
  });
8699
8698
 
@@ -8868,7 +8867,7 @@ var init_ValidateView = __esm({
8868
8867
 
8869
8868
  // packages/experience-design-system-cli-legacy/src/print/command.ts
8870
8869
  import { createElement as createElement4 } from "react";
8871
- import { access as access3, mkdir as mkdir3, stat as stat3, writeFile as writeFile3 } from "node:fs/promises";
8870
+ import { access as access3, mkdir as mkdir2, stat as stat3, writeFile as writeFile2 } from "node:fs/promises";
8872
8871
  import { basename, resolve as resolve9 } from "node:path";
8873
8872
  import { CDF_SCHEMA_URL } from "@contentful/experience-design-system-types";
8874
8873
  async function die6(message) {
@@ -8984,8 +8983,8 @@ function registerPrintCommand(program) {
8984
8983
  `
8985
8984
  );
8986
8985
  }
8987
- await mkdir3(resolve9(outPath, ".."), { recursive: true });
8988
- await writeFile3(outPath, `${JSON.stringify(cdfObj, null, 2)}
8986
+ await mkdir2(resolve9(outPath, ".."), { recursive: true });
8987
+ await writeFile2(outPath, `${JSON.stringify(cdfObj, null, 2)}
8989
8988
  `);
8990
8989
  process.stdout.write(
8991
8990
  `wrote ${basename(outPath)} (${components.length} component${components.length === 1 ? "" : "s"})
@@ -9008,8 +9007,8 @@ function registerPrintCommand(program) {
9008
9007
  await die6(`Error: no generated tokens in session '${sessionId2}'. Run generate tokens first.`);
9009
9008
  }
9010
9009
  const tree = rebuildDTCGTree(result.groups, result.tokens);
9011
- await mkdir3(resolve9(outPath, ".."), { recursive: true });
9012
- await writeFile3(outPath, `${JSON.stringify(tree, null, 2)}
9010
+ await mkdir2(resolve9(outPath, ".."), { recursive: true });
9011
+ await writeFile2(outPath, `${JSON.stringify(tree, null, 2)}
9013
9012
  `);
9014
9013
  process.stdout.write(
9015
9014
  `wrote ${basename(outPath)} (${result.tokens.length} token${result.tokens.length === 1 ? "" : "s"})
@@ -9260,13 +9259,13 @@ var init_resolve_defaults = __esm({
9260
9259
  });
9261
9260
 
9262
9261
  // packages/experience-design-system-cli-legacy/src/map-tokens/services/resolve-token-name-paths.ts
9263
- import { readFile as readFile12 } from "node:fs/promises";
9262
+ import { readFile as readFile11 } from "node:fs/promises";
9264
9263
  async function resolveTokenNamePaths(db, sessionId2, tokenMapPath) {
9265
9264
  const tokenLeaves = db.prepare("SELECT path, type FROM raw_tokens WHERE session_id = ? ORDER BY path").all(sessionId2);
9266
9265
  const knownTokenPaths = new Set(tokenLeaves.map((t) => t.path));
9267
9266
  const tokenMapDiagnostics = [];
9268
9267
  if (tokenMapPath) {
9269
- const fileMappings = JSON.parse(await readFile12(tokenMapPath, "utf8"));
9268
+ const fileMappings = JSON.parse(await readFile11(tokenMapPath, "utf8"));
9270
9269
  const validMappings = {};
9271
9270
  for (const [rawName, path] of Object.entries(fileMappings)) {
9272
9271
  if (knownTokenPaths.has(path)) {
@@ -9585,10 +9584,10 @@ var init_command4 = __esm({
9585
9584
 
9586
9585
  // packages/experience-design-system-cli-legacy/src/import/path-utils.ts
9587
9586
  import { resolve as resolve11 } from "node:path";
9588
- import { homedir as homedir5 } from "node:os";
9587
+ import { homedir } from "node:os";
9589
9588
  function expandTilde(input) {
9590
9589
  if (input === "~" || input.startsWith("~/") || input.startsWith("~\\")) {
9591
- return homedir5() + input.slice(1);
9590
+ return homedir() + input.slice(1);
9592
9591
  }
9593
9592
  return input;
9594
9593
  }
@@ -9701,7 +9700,7 @@ var init_use_blinking_cursor = __esm({
9701
9700
  import { useState as useState4 } from "react";
9702
9701
  import { Box as Box6, Text as Text7 } from "ink";
9703
9702
  import { readdirSync } from "node:fs";
9704
- import { dirname as dirname5, basename as basename2, join as join10 } from "node:path";
9703
+ import { dirname as dirname5, basename as basename2, join as join9 } from "node:path";
9705
9704
  import { jsx as jsx9, jsxs as jsxs6 } from "react/jsx-runtime";
9706
9705
  function autocomplete(partial) {
9707
9706
  if (!partial) return null;
@@ -9716,13 +9715,13 @@ function autocomplete(partial) {
9716
9715
  }
9717
9716
  const matches = entries.filter((e) => e.startsWith(base));
9718
9717
  if (matches.length === 0) return null;
9719
- if (matches.length === 1) return join10(dir, matches[0]);
9718
+ if (matches.length === 1) return join9(dir, matches[0]);
9720
9719
  let prefix = matches[0];
9721
9720
  for (const m of matches) {
9722
9721
  while (!m.startsWith(prefix)) prefix = prefix.slice(0, -1);
9723
9722
  if (!prefix) break;
9724
9723
  }
9725
- return prefix.length > base.length ? join10(dir, prefix) : null;
9724
+ return prefix.length > base.length ? join9(dir, prefix) : null;
9726
9725
  }
9727
9726
  function PathPrompt({
9728
9727
  defaultPath,
@@ -9787,12 +9786,12 @@ var init_path_prompt = __esm({
9787
9786
 
9788
9787
  // packages/experience-design-system-cli-legacy/src/runs/save-path-resolver.ts
9789
9788
  import { access as access4 } from "node:fs/promises";
9790
- import { join as join11 } from "node:path";
9789
+ import { join as join10 } from "node:path";
9791
9790
  async function listConflictingFiles(path) {
9792
9791
  const conflicts = [];
9793
9792
  for (const name of SAVE_FILES) {
9794
9793
  try {
9795
- await access4(join11(path, name));
9794
+ await access4(join10(path, name));
9796
9795
  conflicts.push(name);
9797
9796
  } catch {
9798
9797
  }
@@ -9812,7 +9811,7 @@ function buildTimestampedSubdir(base, now = /* @__PURE__ */ new Date()) {
9812
9811
  const hh = pad2(now.getHours());
9813
9812
  const mm = pad2(now.getMinutes());
9814
9813
  const ss = pad2(now.getSeconds());
9815
- return join11(base, `dsi-${y}${m}${d}-${hh}${mm}${ss}`);
9814
+ return join10(base, `dsi-${y}${m}${d}-${hh}${mm}${ss}`);
9816
9815
  }
9817
9816
  var SAVE_FILES;
9818
9817
  var init_save_path_resolver = __esm({
@@ -9823,9 +9822,9 @@ var init_save_path_resolver = __esm({
9823
9822
  });
9824
9823
 
9825
9824
  // packages/experience-design-system-cli-legacy/src/runs/store.ts
9826
- import { readFile as readFile13, writeFile as writeFile4, mkdir as mkdir4, rename } from "node:fs/promises";
9827
- import { join as join12 } from "node:path";
9828
- import { homedir as homedir6 } from "node:os";
9825
+ import { readFile as readFile12, writeFile as writeFile3, mkdir as mkdir3, rename } from "node:fs/promises";
9826
+ import { dirname as dirname6 } from "node:path";
9827
+ import { runsFilePath } from "@contentful/experience-design-system-types/config";
9829
9828
  import { randomBytes as randomBytes2 } from "node:crypto";
9830
9829
  function encodeBase32(bytes, length) {
9831
9830
  let out = "";
@@ -9863,7 +9862,7 @@ function migrateRecord(rec) {
9863
9862
  }
9864
9863
  async function readFileMaybe() {
9865
9864
  try {
9866
- const raw = await readFile13(RUNS_PATH, "utf8");
9865
+ const raw = await readFile12(runsFilePath(), "utf8");
9867
9866
  const parsed = JSON.parse(raw);
9868
9867
  if (!READABLE_VERSIONS.has(parsed.version)) {
9869
9868
  throw new Error(
@@ -9879,11 +9878,11 @@ async function readFileMaybe() {
9879
9878
  }
9880
9879
  }
9881
9880
  async function writeAtomic(file) {
9882
- await mkdir4(RUNS_DIR, { recursive: true });
9881
+ await mkdir3(dirname6(runsFilePath()), { recursive: true });
9883
9882
  const body = JSON.stringify(file, null, 2) + "\n";
9884
- const tmp = `${RUNS_PATH}.${process.pid}.${Date.now()}.tmp`;
9885
- await writeFile4(tmp, body, { mode: 384 });
9886
- await rename(tmp, RUNS_PATH);
9883
+ const tmp = `${runsFilePath()}.${process.pid}.${Date.now()}.tmp`;
9884
+ await writeFile3(tmp, body, { mode: 384 });
9885
+ await rename(tmp, runsFilePath());
9887
9886
  }
9888
9887
  async function appendRun(input) {
9889
9888
  const existing = await readFileMaybe();
@@ -9907,28 +9906,26 @@ async function appendRun(input) {
9907
9906
  async function updateRun(id, patch) {
9908
9907
  const file = await readFileMaybe() ?? { version: RUNS_FILE_VERSION, runs: [] };
9909
9908
  const idx = file.runs.findIndex((r) => r.id === id);
9910
- if (idx < 0) throw new Error(`Run ${id} not found in ${RUNS_PATH}`);
9909
+ if (idx < 0) throw new Error(`Run ${id} not found in ${runsFilePath()}`);
9911
9910
  const updated = { ...file.runs[idx], ...patch, id };
9912
9911
  file.runs[idx] = updated;
9913
9912
  await writeAtomic(file);
9914
9913
  return updated;
9915
9914
  }
9916
- var RUNS_FILE_VERSION, RUNS_FILE_CAP, READABLE_VERSIONS, RUNS_DIR, RUNS_PATH, CROCKFORD;
9915
+ var RUNS_FILE_VERSION, RUNS_FILE_CAP, READABLE_VERSIONS, CROCKFORD;
9917
9916
  var init_store = __esm({
9918
9917
  "packages/experience-design-system-cli-legacy/src/runs/store.ts"() {
9919
9918
  "use strict";
9920
9919
  RUNS_FILE_VERSION = 3;
9921
9920
  RUNS_FILE_CAP = 200;
9922
9921
  READABLE_VERSIONS = /* @__PURE__ */ new Set([1, 2, 3]);
9923
- RUNS_DIR = join12(homedir6(), ".config", "experiences");
9924
- RUNS_PATH = join12(RUNS_DIR, "runs.json");
9925
9922
  CROCKFORD = "0123456789ABCDEFGHJKMNPQRSTVWXYZ";
9926
9923
  }
9927
9924
  });
9928
9925
 
9929
9926
  // packages/experience-design-system-cli-legacy/src/runs/fingerprint.ts
9930
9927
  import { createHash as createHash6 } from "node:crypto";
9931
- import { readFile as readFile14, stat as stat4 } from "node:fs/promises";
9928
+ import { readFile as readFile13, stat as stat4 } from "node:fs/promises";
9932
9929
  import { resolve as resolve12 } from "node:path";
9933
9930
  function rowField(row, key) {
9934
9931
  const v = row[key];
@@ -9963,7 +9960,7 @@ async function buildSourceFingerprint(opts) {
9963
9960
  const abs = resolve12(opts.rawTokensPath);
9964
9961
  rawTokensPath = abs;
9965
9962
  try {
9966
- const [st, buf] = await Promise.all([stat4(abs), readFile14(abs)]);
9963
+ const [st, buf] = await Promise.all([stat4(abs), readFile13(abs)]);
9967
9964
  rawTokensMtime = st.mtime.toISOString();
9968
9965
  rawTokensContentHash = sha256Hex(buf);
9969
9966
  } catch {
@@ -10078,7 +10075,7 @@ var init_WelcomeStep = __esm({
10078
10075
  import { useState as useState6, useEffect as useEffect3 } from "react";
10079
10076
  import { Box as Box9, Text as Text10 } from "ink";
10080
10077
  import { promises as fs } from "node:fs";
10081
- import { join as join13 } from "node:path";
10078
+ import { join as join11 } from "node:path";
10082
10079
  import { jsx as jsx12, jsxs as jsxs9 } from "react/jsx-runtime";
10083
10080
  async function countFiles(dir) {
10084
10081
  const counts = {
@@ -10102,7 +10099,7 @@ async function countFiles(dir) {
10102
10099
  await Promise.all(
10103
10100
  entries.map(async (entry) => {
10104
10101
  if (IGNORE_DIRS.has(entry)) return;
10105
- const full = join13(current, entry);
10102
+ const full = join11(current, entry);
10106
10103
  let stat6;
10107
10104
  try {
10108
10105
  stat6 = await fs.stat(full);
@@ -10635,7 +10632,7 @@ function CredentialsStep({
10635
10632
  /* @__PURE__ */ jsx16(Text14, { children: initialSpaceId && initialCmaToken ? "Credentials pre-filled from experiences setup. Press Enter to continue or edit any field to update." : "Enter the Contentful space you want to import into." }),
10636
10633
  !(initialSpaceId && initialCmaToken) && /* @__PURE__ */ jsxs13(Fragment3, { children: [
10637
10634
  /* @__PURE__ */ jsx16(Text14, { dimColor: true, children: "These credentials are used both to align agent suggestions with what already exists in the space and to push your import at the end. Press S to skip and run without space context (push will be disabled)." }),
10638
- /* @__PURE__ */ jsx16(Text14, { dimColor: true, children: "Tip: run experiences setup to save these to ~/.config/experiences/credentials.json so they pre-fill here automatically." })
10635
+ /* @__PURE__ */ jsx16(Text14, { dimColor: true, children: "Tip: run experiences setup to save these to ~/.contentful/experience-design-system-cli/config.json so they pre-fill here automatically." })
10639
10636
  ] })
10640
10637
  ] }),
10641
10638
  /* @__PURE__ */ jsxs13(Box13, { flexDirection: "column", gap: 0, marginTop: 1, children: [
@@ -12008,7 +12005,7 @@ var init_deduplicate_components = __esm({
12008
12005
  });
12009
12006
 
12010
12007
  // packages/experience-design-system-extraction/dist/src/extract/framework-adapters/shared/helpers/file-processing/file-workers.js
12011
- import { readFile as readFile15 } from "node:fs/promises";
12008
+ import { readFile as readFile14 } from "node:fs/promises";
12012
12009
  async function runFileExtractionWorkers(filePaths, concurrency, extractFile, formatError, onProgress, onResult) {
12013
12010
  const warnings = [];
12014
12011
  const items = [];
@@ -12020,7 +12017,7 @@ async function runFileExtractionWorkers(filePaths, concurrency, extractFile, for
12020
12017
  if (!filePath)
12021
12018
  break;
12022
12019
  try {
12023
- const source = await readFile15(filePath, "utf-8");
12020
+ const source = await readFile14(filePath, "utf-8");
12024
12021
  const outcome = await extractFile(filePath, source);
12025
12022
  warnings.push(...outcome.warnings ?? []);
12026
12023
  if (outcome.item)
@@ -12339,7 +12336,7 @@ var init_extractor = __esm({
12339
12336
 
12340
12337
  // packages/experience-design-system-extraction/dist/src/extract/framework-adapters/shared/helpers/resolve-tsx-tsconfig-path.js
12341
12338
  import { existsSync as existsSync3 } from "node:fs";
12342
- import { dirname as dirname6, join as join14, resolve as resolve14 } from "node:path";
12339
+ import { dirname as dirname7, join as join12, resolve as resolve14 } from "node:path";
12343
12340
  import ts from "typescript";
12344
12341
  function matchTsConfigPathPattern(pattern, specifier) {
12345
12342
  if (!pattern.includes("*"))
@@ -12358,16 +12355,16 @@ function substituteTsConfigPathTarget(targetPattern, wildcard) {
12358
12355
  function findNearestTsConfigPath(filePath) {
12359
12356
  if (nearestTsConfigPathCache.has(filePath))
12360
12357
  return nearestTsConfigPathCache.get(filePath) ?? void 0;
12361
- let currentDir = dirname6(filePath);
12358
+ let currentDir = dirname7(filePath);
12362
12359
  while (true) {
12363
12360
  for (const candidateName of ["tsconfig.json", "jsconfig.json"]) {
12364
- const candidatePath = join14(currentDir, candidateName);
12361
+ const candidatePath = join12(currentDir, candidateName);
12365
12362
  if (existsSync3(candidatePath)) {
12366
12363
  nearestTsConfigPathCache.set(filePath, candidatePath);
12367
12364
  return candidatePath;
12368
12365
  }
12369
12366
  }
12370
- const parentDir = dirname6(currentDir);
12367
+ const parentDir = dirname7(currentDir);
12371
12368
  if (parentDir === currentDir) {
12372
12369
  nearestTsConfigPathCache.set(filePath, null);
12373
12370
  return void 0;
@@ -12383,13 +12380,13 @@ function getTsConfigPaths(tsConfigPath) {
12383
12380
  tsConfigPathsCache.set(tsConfigPath, null);
12384
12381
  return void 0;
12385
12382
  }
12386
- const parsedConfig = ts.parseJsonConfigFileContent(configFile.config, ts.sys, dirname6(tsConfigPath));
12383
+ const parsedConfig = ts.parseJsonConfigFileContent(configFile.config, ts.sys, dirname7(tsConfigPath));
12387
12384
  const paths = parsedConfig.options.paths;
12388
12385
  if (!paths || Object.keys(paths).length === 0) {
12389
12386
  tsConfigPathsCache.set(tsConfigPath, null);
12390
12387
  return void 0;
12391
12388
  }
12392
- const baseUrl = parsedConfig.options.baseUrl ?? dirname6(tsConfigPath);
12389
+ const baseUrl = parsedConfig.options.baseUrl ?? dirname7(tsConfigPath);
12393
12390
  const result = { baseUrl, paths };
12394
12391
  tsConfigPathsCache.set(tsConfigPath, result);
12395
12392
  return result;
@@ -12401,10 +12398,10 @@ function resolveImportSourcePath(basePath) {
12401
12398
  `${basePath}.tsx`,
12402
12399
  `${basePath}.js`,
12403
12400
  `${basePath}.jsx`,
12404
- join14(basePath, "index.ts"),
12405
- join14(basePath, "index.tsx"),
12406
- join14(basePath, "index.js"),
12407
- join14(basePath, "index.jsx")
12401
+ join12(basePath, "index.ts"),
12402
+ join12(basePath, "index.tsx"),
12403
+ join12(basePath, "index.js"),
12404
+ join12(basePath, "index.jsx")
12408
12405
  ];
12409
12406
  return candidates.find((candidatePath) => existsSync3(candidatePath));
12410
12407
  }
@@ -12440,17 +12437,17 @@ var init_resolve_tsx_tsconfig_path = __esm({
12440
12437
 
12441
12438
  // packages/experience-design-system-extraction/dist/src/extract/framework-adapters/shared/helpers/find-tsx-workspace-package.js
12442
12439
  import { existsSync as existsSync4, readFileSync as readFileSync5 } from "node:fs";
12443
- import { dirname as dirname7, join as join15 } from "node:path";
12440
+ import { dirname as dirname8, join as join13 } from "node:path";
12444
12441
  function findNearestPackageRootDir(filePath) {
12445
12442
  if (packageRootByFilePathCache.has(filePath))
12446
12443
  return packageRootByFilePathCache.get(filePath) ?? void 0;
12447
- let currentDir = dirname7(filePath);
12444
+ let currentDir = dirname8(filePath);
12448
12445
  while (true) {
12449
- if (existsSync4(join15(currentDir, "package.json"))) {
12446
+ if (existsSync4(join13(currentDir, "package.json"))) {
12450
12447
  packageRootByFilePathCache.set(filePath, currentDir);
12451
12448
  return currentDir;
12452
12449
  }
12453
- const parentDir = dirname7(currentDir);
12450
+ const parentDir = dirname8(currentDir);
12454
12451
  if (parentDir === currentDir) {
12455
12452
  packageRootByFilePathCache.set(filePath, null);
12456
12453
  return void 0;
@@ -12464,7 +12461,7 @@ function getWorkspacePackageManifestForSourceFile(sourceFile) {
12464
12461
  return void 0;
12465
12462
  if (workspacePackageManifestCache.has(packageRootDir))
12466
12463
  return workspacePackageManifestCache.get(packageRootDir) ?? void 0;
12467
- const packageJsonPath = join15(packageRootDir, "package.json");
12464
+ const packageJsonPath = join13(packageRootDir, "package.json");
12468
12465
  try {
12469
12466
  const packageJson = JSON.parse(readFileSync5(packageJsonPath, "utf8"));
12470
12467
  const manifest = typeof packageJson.name === "string" ? { name: packageJson.name, rootDir: packageRootDir } : null;
@@ -12487,16 +12484,16 @@ function findWorkspacePackageEntrySourceFile(originSourceFile, moduleSpecifier)
12487
12484
  if (!packageRootDir)
12488
12485
  return void 0;
12489
12486
  for (const entryPath of [
12490
- join15(packageRootDir, "src/index.ts"),
12491
- join15(packageRootDir, "src/index.tsx"),
12492
- join15(packageRootDir, "index.ts"),
12493
- join15(packageRootDir, "index.tsx")
12487
+ join13(packageRootDir, "src/index.ts"),
12488
+ join13(packageRootDir, "src/index.tsx"),
12489
+ join13(packageRootDir, "index.ts"),
12490
+ join13(packageRootDir, "index.tsx")
12494
12491
  ]) {
12495
12492
  const entrySourceFile = project.getSourceFile(entryPath);
12496
12493
  if (entrySourceFile)
12497
12494
  return entrySourceFile;
12498
12495
  }
12499
- return candidateSourceFiles.find((sourceFile) => sourceFile.getDirectoryPath() === join15(packageRootDir, "src"));
12496
+ return candidateSourceFiles.find((sourceFile) => sourceFile.getDirectoryPath() === join13(packageRootDir, "src"));
12500
12497
  }
12501
12498
  var packageRootByFilePathCache, workspacePackageManifestCache;
12502
12499
  var init_find_tsx_workspace_package = __esm({
@@ -12508,7 +12505,7 @@ var init_find_tsx_workspace_package = __esm({
12508
12505
  });
12509
12506
 
12510
12507
  // packages/experience-design-system-extraction/dist/src/extract/framework-adapters/shared/helpers/resolve-tsx-workspace-imports.js
12511
- import { join as join16 } from "node:path";
12508
+ import { join as join14 } from "node:path";
12512
12509
  import { Node as Node2 } from "ts-morph";
12513
12510
  function isBareModuleSpecifier(moduleSpecifier) {
12514
12511
  return !moduleSpecifier.startsWith(".") && !moduleSpecifier.startsWith("/");
@@ -12520,10 +12517,10 @@ function findProjectSourceFileByImportPath(project, resolvedPath) {
12520
12517
  `${resolvedPath}.tsx`,
12521
12518
  `${resolvedPath}.js`,
12522
12519
  `${resolvedPath}.jsx`,
12523
- join16(resolvedPath, "index.ts"),
12524
- join16(resolvedPath, "index.tsx"),
12525
- join16(resolvedPath, "index.js"),
12526
- join16(resolvedPath, "index.jsx")
12520
+ join14(resolvedPath, "index.ts"),
12521
+ join14(resolvedPath, "index.tsx"),
12522
+ join14(resolvedPath, "index.js"),
12523
+ join14(resolvedPath, "index.jsx")
12527
12524
  ];
12528
12525
  for (const candidatePath of candidatePaths) {
12529
12526
  const sourceFile = project.getSourceFile(candidatePath);
@@ -15510,14 +15507,14 @@ var init_extractor3 = __esm({
15510
15507
  });
15511
15508
 
15512
15509
  // packages/experience-design-system-extraction/dist/src/extract/framework-adapters/svelte/helpers/get-svelte-component-name.js
15513
- import { basename as basename4, dirname as dirname8 } from "node:path";
15510
+ import { basename as basename4, dirname as dirname9 } from "node:path";
15514
15511
  function getSvelteComponentName(filePath) {
15515
15512
  const file = basename4(filePath, ".svelte");
15516
- const parentDir = basename4(dirname8(filePath));
15513
+ const parentDir = basename4(dirname9(filePath));
15517
15514
  if (file === "index")
15518
15515
  return toPascalCase(parentDir);
15519
15516
  if (ANATOMY_FOLDERS.has(parentDir)) {
15520
- const grandparent = basename4(dirname8(dirname8(filePath)));
15517
+ const grandparent = basename4(dirname9(dirname9(filePath)));
15521
15518
  if (grandparent && grandparent !== "." && grandparent !== "/") {
15522
15519
  return `${toPascalCase(grandparent)}${toPascalCase(file)}`;
15523
15520
  }
@@ -16235,19 +16232,19 @@ var init_resolve_svelte_type_checker = __esm({
16235
16232
 
16236
16233
  // packages/experience-design-system-extraction/dist/src/extract/framework-adapters/shared/helpers/resolve-import-file-path.js
16237
16234
  import { existsSync as existsSync5, statSync as statSync2 } from "node:fs";
16238
- import { dirname as dirname9, join as join17, resolve as resolve15 } from "node:path";
16235
+ import { dirname as dirname10, join as join15, resolve as resolve15 } from "node:path";
16239
16236
  function resolveLocalModule(importingFilePath, specifier, options = {}) {
16240
- const basePath = resolve15(dirname9(importingFilePath), specifier);
16237
+ const basePath = resolve15(dirname10(importingFilePath), specifier);
16241
16238
  const candidates = [
16242
16239
  basePath,
16243
16240
  `${basePath}.js`,
16244
16241
  `${basePath}.ts`,
16245
16242
  `${basePath}.mjs`,
16246
16243
  `${basePath}.cjs`,
16247
- join17(basePath, "index.js"),
16248
- join17(basePath, "index.ts"),
16249
- join17(basePath, "index.mjs"),
16250
- join17(basePath, "index.cjs")
16244
+ join15(basePath, "index.js"),
16245
+ join15(basePath, "index.ts"),
16246
+ join15(basePath, "index.mjs"),
16247
+ join15(basePath, "index.cjs")
16251
16248
  ];
16252
16249
  for (const candidate of candidates) {
16253
16250
  if (existsSync5(candidate) && statSync2(candidate).isFile())
@@ -16688,7 +16685,7 @@ var init_extract_svelte_props = __esm({
16688
16685
  });
16689
16686
 
16690
16687
  // packages/experience-design-system-extraction/dist/src/extract/framework-adapters/svelte/helpers/resolve-dts-location.js
16691
- import { dirname as dirname10, join as join18, resolve as resolve16 } from "node:path";
16688
+ import { dirname as dirname11, join as join16, resolve as resolve16 } from "node:path";
16692
16689
  import { existsSync as existsSync6, readFileSync as readFileSync6 } from "node:fs";
16693
16690
  function extractTypesFromExports(exportsField) {
16694
16691
  if (!exportsField || typeof exportsField !== "object")
@@ -16713,9 +16710,9 @@ function extractTypesFromExports(exportsField) {
16713
16710
  function findPackageRootForSpecifier(seedDir, specifier) {
16714
16711
  let dir = seedDir;
16715
16712
  for (let i = 0; i < 32; i++) {
16716
- if (existsSync6(join18(dir, "package.json"))) {
16713
+ if (existsSync6(join16(dir, "package.json"))) {
16717
16714
  try {
16718
- const pkgRaw = readFileSync6(join18(dir, "package.json"), "utf-8");
16715
+ const pkgRaw = readFileSync6(join16(dir, "package.json"), "utf-8");
16719
16716
  const pkg4 = JSON.parse(pkgRaw);
16720
16717
  if (pkg4.name === specifier)
16721
16718
  return dir;
@@ -16724,7 +16721,7 @@ function findPackageRootForSpecifier(seedDir, specifier) {
16724
16721
  } catch {
16725
16722
  }
16726
16723
  }
16727
- const parent = dirname10(dir);
16724
+ const parent = dirname11(dir);
16728
16725
  if (!parent || parent === dir)
16729
16726
  return null;
16730
16727
  dir = parent;
@@ -16738,10 +16735,10 @@ function locateDtsForSpecifier(req, specifier, parentFile) {
16738
16735
  } catch {
16739
16736
  resolvedJs = null;
16740
16737
  }
16741
- const seedDir = resolvedJs ? dirname10(resolvedJs) : dirname10(parentFile);
16738
+ const seedDir = resolvedJs ? dirname11(resolvedJs) : dirname11(parentFile);
16742
16739
  const pkgRoot = findPackageRootForSpecifier(seedDir, specifier);
16743
16740
  if (pkgRoot) {
16744
- const pkgJsonPath = join18(pkgRoot, "package.json");
16741
+ const pkgJsonPath = join16(pkgRoot, "package.json");
16745
16742
  if (existsSync6(pkgJsonPath)) {
16746
16743
  try {
16747
16744
  const pkgRaw = readFileSync6(pkgJsonPath, "utf-8");
@@ -16762,7 +16759,7 @@ function locateDtsForSpecifier(req, specifier, parentFile) {
16762
16759
  }
16763
16760
  }
16764
16761
  for (const entry of ["index.d.ts", "index.d.mts"]) {
16765
- const candidate = join18(pkgRoot, entry);
16762
+ const candidate = join16(pkgRoot, entry);
16766
16763
  if (existsSync6(candidate))
16767
16764
  return candidate;
16768
16765
  }
@@ -16784,7 +16781,7 @@ var init_resolve_dts_location = __esm({
16784
16781
  });
16785
16782
 
16786
16783
  // packages/experience-design-system-extraction/dist/src/extract/framework-adapters/svelte/helpers/resolve-svelte-unresolved-retry.js
16787
- import { dirname as dirname11, join as join19 } from "node:path";
16784
+ import { dirname as dirname12, join as join17 } from "node:path";
16788
16785
  import { existsSync as existsSync7 } from "node:fs";
16789
16786
  import { createRequire } from "node:module";
16790
16787
  import { Project as Project6, ScriptTarget as ScriptTarget3, ModuleKind as ModuleKind3, ts as ts3 } from "ts-morph";
@@ -16944,10 +16941,10 @@ async function maybeRunResolveUnreachableRetry(components, warnings, retryContex
16944
16941
  function findNearestTsconfig(startDir) {
16945
16942
  let dir = startDir;
16946
16943
  for (let i = 0; i < 16; i++) {
16947
- const candidate = join19(dir, "tsconfig.json");
16944
+ const candidate = join17(dir, "tsconfig.json");
16948
16945
  if (existsSync7(candidate))
16949
16946
  return candidate;
16950
- const parent = dirname11(dir);
16947
+ const parent = dirname12(dir);
16951
16948
  if (!parent || parent === dir)
16952
16949
  return null;
16953
16950
  dir = parent;
@@ -17599,13 +17596,13 @@ var init_extractor5 = __esm({
17599
17596
  });
17600
17597
 
17601
17598
  // packages/experience-design-system-extraction/dist/src/extract/framework-adapters/vue/helpers/resolve-vue-component-name.js
17602
- import { basename as basename5, dirname as dirname12 } from "node:path";
17599
+ import { basename as basename5, dirname as dirname13 } from "node:path";
17603
17600
  function resolveVueComponentName(filePath) {
17604
17601
  const fileName = basename5(filePath, ".vue");
17605
17602
  if (fileName !== "index") {
17606
17603
  return fileName;
17607
17604
  }
17608
- return basename5(dirname12(filePath)) || fileName;
17605
+ return basename5(dirname13(filePath)) || fileName;
17609
17606
  }
17610
17607
  var init_resolve_vue_component_name = __esm({
17611
17608
  "packages/experience-design-system-extraction/dist/src/extract/framework-adapters/vue/helpers/resolve-vue-component-name.js"() {
@@ -17746,7 +17743,7 @@ var init_extract_vue_object_props = __esm({
17746
17743
  });
17747
17744
 
17748
17745
  // packages/experience-design-system-extraction/dist/src/extract/framework-adapters/vue/helpers/extract-vue-setup-object-props.js
17749
- import { readFile as readFile16 } from "node:fs/promises";
17746
+ import { readFile as readFile15 } from "node:fs/promises";
17750
17747
  import { Project as Project7, Node as Node37 } from "ts-morph";
17751
17748
  function collectSetupImportedObjectRefs(sf, filePath) {
17752
17749
  const refs = /* @__PURE__ */ new Map();
@@ -17771,7 +17768,7 @@ async function extractImportedObjectExportProps(importedRef, visitedImports) {
17771
17768
  if (visitedImports.has(visitKey))
17772
17769
  return [];
17773
17770
  visitedImports.add(visitKey);
17774
- const source = await readFile16(importedRef.filePath, "utf-8");
17771
+ const source = await readFile15(importedRef.filePath, "utf-8");
17775
17772
  const project = new Project7({
17776
17773
  compilerOptions: { strict: false, target: 99, module: 99, allowJs: true },
17777
17774
  useInMemoryFileSystem: true,
@@ -17886,25 +17883,25 @@ var init_extract_vue_setup_props = __esm({
17886
17883
  });
17887
17884
 
17888
17885
  // packages/experience-design-system-extraction/dist/src/extract/framework-adapters/vue/helpers/workspace-package-dirs.js
17889
- import { dirname as dirname13, join as join20 } from "node:path";
17886
+ import { dirname as dirname14, join as join18 } from "node:path";
17890
17887
  import { existsSync as existsSync8, readFileSync as readFileSync7, readdirSync as readdirSync2, statSync as statSync3 } from "node:fs";
17891
17888
  function findWorkspaceRoot(startDir) {
17892
17889
  if (workspaceRootCache.has(startDir))
17893
17890
  return workspaceRootCache.get(startDir);
17894
17891
  let dir = startDir;
17895
17892
  while (true) {
17896
- const pkgJsonPath = join20(dir, "package.json");
17893
+ const pkgJsonPath = join18(dir, "package.json");
17897
17894
  if (existsSync8(pkgJsonPath)) {
17898
17895
  try {
17899
17896
  const pkg4 = JSON.parse(readFileSync7(pkgJsonPath, "utf8"));
17900
- if (pkg4.workspaces || existsSync8(join20(dir, "pnpm-workspace.yaml"))) {
17897
+ if (pkg4.workspaces || existsSync8(join18(dir, "pnpm-workspace.yaml"))) {
17901
17898
  workspaceRootCache.set(startDir, dir);
17902
17899
  return dir;
17903
17900
  }
17904
17901
  } catch {
17905
17902
  }
17906
17903
  }
17907
- const parent = dirname13(dir);
17904
+ const parent = dirname14(dir);
17908
17905
  if (parent === dir) {
17909
17906
  workspaceRootCache.set(startDir, null);
17910
17907
  return null;
@@ -17916,7 +17913,7 @@ function collectWorkspacePackageDirs(workspaceRoot) {
17916
17913
  if (workspacePackageDirsCache.has(workspaceRoot))
17917
17914
  return workspacePackageDirsCache.get(workspaceRoot);
17918
17915
  const packageMap = /* @__PURE__ */ new Map();
17919
- const packagesDir = join20(workspaceRoot, "packages");
17916
+ const packagesDir = join18(workspaceRoot, "packages");
17920
17917
  if (!existsSync8(packagesDir)) {
17921
17918
  workspacePackageDirsCache.set(workspaceRoot, packageMap);
17922
17919
  return packageMap;
@@ -17930,7 +17927,7 @@ function collectWorkspacePackageDirs(workspaceRoot) {
17930
17927
  } catch {
17931
17928
  return;
17932
17929
  }
17933
- const pkgJsonPath = join20(dir, "package.json");
17930
+ const pkgJsonPath = join18(dir, "package.json");
17934
17931
  if (existsSync8(pkgJsonPath)) {
17935
17932
  try {
17936
17933
  const pkg4 = JSON.parse(readFileSync7(pkgJsonPath, "utf8"));
@@ -17942,7 +17939,7 @@ function collectWorkspacePackageDirs(workspaceRoot) {
17942
17939
  for (const entry of entries) {
17943
17940
  if (entry === "node_modules" || entry === ".git" || entry.startsWith("."))
17944
17941
  continue;
17945
- const entryPath = join20(dir, entry);
17942
+ const entryPath = join18(dir, entry);
17946
17943
  try {
17947
17944
  if (statSync3(entryPath).isDirectory())
17948
17945
  scanDir(entryPath, depth + 1);
@@ -17964,10 +17961,10 @@ var init_workspace_package_dirs = __esm({
17964
17961
  });
17965
17962
 
17966
17963
  // packages/experience-design-system-extraction/dist/src/extract/framework-adapters/vue/helpers/resolve-workspace-module.js
17967
- import { dirname as dirname14, join as join21, resolve as resolve17 } from "node:path";
17964
+ import { dirname as dirname15, join as join19, resolve as resolve17 } from "node:path";
17968
17965
  import { existsSync as existsSync9, readFileSync as readFileSync8 } from "node:fs";
17969
17966
  function resolveWorkspaceVueImport(specifier, importingFilePath) {
17970
- const workspaceRoot = findWorkspaceRoot(dirname14(importingFilePath));
17967
+ const workspaceRoot = findWorkspaceRoot(dirname15(importingFilePath));
17971
17968
  if (!workspaceRoot)
17972
17969
  return null;
17973
17970
  const packageDirs = collectWorkspacePackageDirs(workspaceRoot);
@@ -17992,7 +17989,7 @@ function resolveWorkspaceVueImport(specifier, importingFilePath) {
17992
17989
  const packageDir = packageDirs.get(packageName);
17993
17990
  if (!packageDir)
17994
17991
  return null;
17995
- const pkgJsonPath = join21(packageDir, "package.json");
17992
+ const pkgJsonPath = join19(packageDir, "package.json");
17996
17993
  try {
17997
17994
  const pkg4 = JSON.parse(readFileSync8(pkgJsonPath, "utf8"));
17998
17995
  if (pkg4.exports && subpath !== ".") {
@@ -18005,8 +18002,8 @@ function resolveWorkspaceVueImport(specifier, importingFilePath) {
18005
18002
  }
18006
18003
  if (subpath !== ".") {
18007
18004
  const subDir = resolve17(packageDir, subpath.replace(/^\.\//, ""));
18008
- for (const base of [join21(packageDir, "src", subpath.replace(/^\.\//, "")), subDir]) {
18009
- const subPkgPath = join21(base, "package.json");
18005
+ for (const base of [join19(packageDir, "src", subpath.replace(/^\.\//, "")), subDir]) {
18006
+ const subPkgPath = join19(base, "package.json");
18010
18007
  if (existsSync9(subPkgPath)) {
18011
18008
  try {
18012
18009
  const subPkg = JSON.parse(readFileSync8(subPkgPath, "utf8"));
@@ -18041,8 +18038,8 @@ var init_resolve_workspace_module = __esm({
18041
18038
  });
18042
18039
 
18043
18040
  // packages/experience-design-system-extraction/dist/src/extract/framework-adapters/vue/helpers/extract-vue-options-props.js
18044
- import { resolve as resolve18, dirname as dirname15 } from "node:path";
18045
- import { readFile as readFile17 } from "node:fs/promises";
18041
+ import { resolve as resolve18, dirname as dirname16 } from "node:path";
18042
+ import { readFile as readFile16 } from "node:fs/promises";
18046
18043
  import { parse as parseSFC } from "@vue/compiler-sfc";
18047
18044
  import { Node as Node39, Project as Project9 } from "ts-morph";
18048
18045
  async function extractVueOptionsProps(filePath, scriptContent, visited = /* @__PURE__ */ new Set()) {
@@ -18065,7 +18062,7 @@ async function extractVueOptionsProps(filePath, scriptContent, visited = /* @__P
18065
18062
  if (specifier.startsWith(".")) {
18066
18063
  if (!specifier.endsWith(".vue"))
18067
18064
  continue;
18068
- localImports.set(defaultImport.getText(), resolve18(dirname15(resolvedFilePath), specifier));
18065
+ localImports.set(defaultImport.getText(), resolve18(dirname16(resolvedFilePath), specifier));
18069
18066
  } else {
18070
18067
  const resolvedVuePath = resolveWorkspaceVueImport(specifier, resolvedFilePath);
18071
18068
  if (resolvedVuePath)
@@ -18103,7 +18100,7 @@ async function extractVueOptionsProps(filePath, scriptContent, visited = /* @__P
18103
18100
  return [];
18104
18101
  }
18105
18102
  async function extractInheritedVueProps(filePath, visited) {
18106
- const source = await readFile17(filePath, "utf-8");
18103
+ const source = await readFile16(filePath, "utf-8");
18107
18104
  const { descriptor } = parseSFC(source);
18108
18105
  if (!descriptor.script)
18109
18106
  return [];
@@ -18480,7 +18477,7 @@ var init_resolve_wc_decorator_tag = __esm({
18480
18477
  });
18481
18478
 
18482
18479
  // packages/experience-design-system-extraction/dist/src/extract/framework-adapters/web-components/helpers/resolve-wc-import-source.js
18483
- import { dirname as dirname16, resolve as resolve19 } from "node:path";
18480
+ import { dirname as dirname17, resolve as resolve19 } from "node:path";
18484
18481
  import { Node as Node43 } from "ts-morph";
18485
18482
  function loadSourceFile(project, filePath) {
18486
18483
  let sourceFile = project.getSourceFile(filePath);
@@ -18495,7 +18492,7 @@ function loadSourceFile(project, filePath) {
18495
18492
  }
18496
18493
  function resolveImportSourcePath2(fromFilePath, specifier) {
18497
18494
  if (specifier.startsWith(".")) {
18498
- const resolvedPath = resolve19(dirname16(fromFilePath), specifier);
18495
+ const resolvedPath = resolve19(dirname17(fromFilePath), specifier);
18499
18496
  if (resolvedPath.endsWith(".js"))
18500
18497
  return `${resolvedPath.slice(0, -3)}.ts`;
18501
18498
  return resolvedPath;
@@ -19641,11 +19638,11 @@ var init_detect_data_wrapper_patterns = __esm({
19641
19638
  });
19642
19639
 
19643
19640
  // packages/experience-design-system-extraction/dist/src/extract/services/quality/helpers/inspection/inspect-component-source.js
19644
- import { readFile as readFile18 } from "node:fs/promises";
19641
+ import { readFile as readFile17 } from "node:fs/promises";
19645
19642
  async function inspectComponentSource(component) {
19646
19643
  let sourceText = "";
19647
19644
  try {
19648
- sourceText = await readFile18(component.source, "utf8");
19645
+ sourceText = await readFile17(component.source, "utf8");
19649
19646
  } catch {
19650
19647
  return {
19651
19648
  wrapperConfidence: 0,
@@ -19979,7 +19976,7 @@ var init_src3 = __esm({
19979
19976
  });
19980
19977
 
19981
19978
  // packages/experience-design-system-cli-legacy/src/analyze/select/command.ts
19982
- import { access as access6, readFile as readFile19 } from "node:fs/promises";
19979
+ import { access as access6, readFile as readFile18 } from "node:fs/promises";
19983
19980
  async function loadAndValidateForReview(sessionId2, projectRoot) {
19984
19981
  const db = openPipelineDb();
19985
19982
  let rawComponents;
@@ -19997,7 +19994,7 @@ async function patchReviewStateWithValidationErrors(sessionId2, errors, opts = {
19997
19994
  let snapshot;
19998
19995
  try {
19999
19996
  await access6(paths.statePath);
20000
- snapshot = JSON.parse(await readFile19(paths.statePath, "utf8"));
19997
+ snapshot = JSON.parse(await readFile18(paths.statePath, "utf8"));
20001
19998
  } catch {
20002
19999
  snapshot = await loadAndValidateForReview(sessionId2, void 0);
20003
20000
  snapshot = await ensureRefineSession(sessionId2, artifactsRoot, snapshot);
@@ -20048,7 +20045,7 @@ async function rejectComponentsByName(sessionId2, names, opts = {}) {
20048
20045
  const nameSet = new Set(names);
20049
20046
  let snapshot;
20050
20047
  try {
20051
- snapshot = JSON.parse(await readFile19(paths.statePath, "utf8"));
20048
+ snapshot = JSON.parse(await readFile18(paths.statePath, "utf8"));
20052
20049
  } catch {
20053
20050
  return;
20054
20051
  }
@@ -28253,8 +28250,8 @@ var init_fetch_existing_contentful_entities = __esm({
28253
28250
  });
28254
28251
 
28255
28252
  // packages/experience-design-system-cli-legacy/src/helpers/fetch-and-persist-existing-contentful-entities.ts
28256
- import { writeFile as writeFile5 } from "node:fs/promises";
28257
- import { join as join22 } from "node:path";
28253
+ import { writeFile as writeFile4 } from "node:fs/promises";
28254
+ import { join as join20 } from "node:path";
28258
28255
  async function fetchAndPersistExistingContentfulEntities(params) {
28259
28256
  const t0 = Date.now();
28260
28257
  try {
@@ -28266,8 +28263,8 @@ async function fetchAndPersistExistingContentfulEntities(params) {
28266
28263
  spaceId: params.spaceId,
28267
28264
  environmentId: params.environmentId
28268
28265
  });
28269
- const path = join22(params.outDir, ".existing-entities.json");
28270
- await writeFile5(path, JSON.stringify(entities, null, 2), "utf8");
28266
+ const path = join20(params.outDir, ".existing-entities.json");
28267
+ await writeFile4(path, JSON.stringify(entities, null, 2), "utf8");
28271
28268
  return { ok: true, path, durationMs: Date.now() - t0, entities };
28272
28269
  } catch (error) {
28273
28270
  return {
@@ -28333,7 +28330,7 @@ var init_resolve_mapping_cli = __esm({
28333
28330
  });
28334
28331
 
28335
28332
  // packages/experience-design-system-cli-legacy/src/analyze/helpers/resolve-composition-agent.ts
28336
- import { readFile as readFile20 } from "node:fs/promises";
28333
+ import { readFile as readFile19 } from "node:fs/promises";
28337
28334
  function resolveCompositionAgentName(flagValue) {
28338
28335
  if (flagValue && isAgentName(flagValue)) return flagValue;
28339
28336
  const env = process.env["EDS_COMPOSITION_AGENT"];
@@ -28349,7 +28346,7 @@ async function readCandidateFiles(components, extraFiles = []) {
28349
28346
  await Promise.all(
28350
28347
  [...paths].map(async (p) => {
28351
28348
  try {
28352
- const content = await readFile20(p, "utf8");
28349
+ const content = await readFile19(p, "utf8");
28353
28350
  out.push({ path: p, content });
28354
28351
  } catch {
28355
28352
  }
@@ -28388,7 +28385,7 @@ var init_resolve_source_directory = __esm({
28388
28385
 
28389
28386
  // packages/experience-design-system-cli-legacy/src/analyze/services/collect-source-files.ts
28390
28387
  import { readdir as readdir3 } from "node:fs/promises";
28391
- import { join as join23 } from "node:path";
28388
+ import { join as join21 } from "node:path";
28392
28389
  function isDenylistedNoiseFile(name) {
28393
28390
  return DENYLISTED_EXACT_FILE_NAMES.has(name) || DENYLISTED_FILE_NAME_PATTERNS.some((p) => p.test(name));
28394
28391
  }
@@ -28398,7 +28395,7 @@ async function collectSourceFiles(directory, onProgress) {
28398
28395
  const entries = await readdir3(currentDirectory, { withFileTypes: true });
28399
28396
  const subdirs = [];
28400
28397
  for (const entry of entries) {
28401
- const fullPath = join23(currentDirectory, entry.name);
28398
+ const fullPath = join21(currentDirectory, entry.name);
28402
28399
  if (entry.isDirectory()) {
28403
28400
  if (!IGNORED_DIRECTORY_NAMES.has(entry.name)) subdirs.push(fullPath);
28404
28401
  continue;
@@ -28688,14 +28685,14 @@ var init_apply_mapping = __esm({
28688
28685
 
28689
28686
  // packages/experience-design-system-cli-legacy/src/analyze/composition/prompt-loader.ts
28690
28687
  import { existsSync as existsSync10, readFileSync as readFileSync9 } from "node:fs";
28691
- import { dirname as dirname17, join as join24, resolve as resolve21 } from "node:path";
28688
+ import { dirname as dirname18, join as join22, resolve as resolve21 } from "node:path";
28692
28689
  import { fileURLToPath as fileURLToPath3 } from "node:url";
28693
28690
  function resolvePromptPath(fileName) {
28694
- const thisDir = dirname17(fileURLToPath3(import.meta.url));
28691
+ const thisDir = dirname18(fileURLToPath3(import.meta.url));
28695
28692
  let dir = thisDir;
28696
28693
  for (; ; ) {
28697
- const candidate = join24(dir, "prompts");
28698
- if (existsSync10(candidate)) return join24(candidate, fileName);
28694
+ const candidate = join22(dir, "prompts");
28695
+ if (existsSync10(candidate)) return join22(candidate, fileName);
28699
28696
  const parent = resolve21(dir, "..");
28700
28697
  if (parent === dir) {
28701
28698
  throw new Error(
@@ -28868,7 +28865,7 @@ var init_composition_cache_key = __esm({
28868
28865
  });
28869
28866
 
28870
28867
  // packages/experience-design-system-cli-legacy/src/analyze/composition/manifest-doc-evidence.ts
28871
- import { dirname as dirname18 } from "node:path";
28868
+ import { dirname as dirname19 } from "node:path";
28872
28869
  function kebabToPascal2(name) {
28873
28870
  return name.split("-").filter(Boolean).map((seg) => seg.charAt(0).toUpperCase() + seg.slice(1)).join("");
28874
28871
  }
@@ -28918,8 +28915,8 @@ function collectAgentsDocEdges(files, components, componentNames) {
28918
28915
  const seen = /* @__PURE__ */ new Set();
28919
28916
  for (const file of files) {
28920
28917
  if (!file.path.endsWith("AGENTS.md")) continue;
28921
- const docDir = dirname18(file.path);
28922
- const parent = components.find((c2) => c2.sourcePath && dirname18(c2.sourcePath) === docDir)?.name;
28918
+ const docDir = dirname19(file.path);
28919
+ const parent = components.find((c2) => c2.sourcePath && dirname19(c2.sourcePath) === docDir)?.name;
28923
28920
  if (!parent || !componentNames.has(parent)) continue;
28924
28921
  for (const line of file.content.split("\n")) {
28925
28922
  const lower = line.toLowerCase();
@@ -29078,9 +29075,9 @@ var init_persist_extract_results = __esm({
29078
29075
  });
29079
29076
 
29080
29077
  // packages/experience-design-system-cli-legacy/src/analyze/orchestrator/execute-analyze-extract.ts
29081
- import { mkdir as mkdir5 } from "node:fs/promises";
29078
+ import { mkdir as mkdir4 } from "node:fs/promises";
29082
29079
  async function executeAnalyzeExtractOrchestrator(request2) {
29083
- await mkdir5(request2.outDir, { recursive: true });
29080
+ await mkdir4(request2.outDir, { recursive: true });
29084
29081
  const sourceFiles = await collectSourceFiles(request2.sourceDirectory, (count) => {
29085
29082
  request2.onScanProgress?.(count);
29086
29083
  });
@@ -29149,7 +29146,7 @@ var init_execute_analyze_extract = __esm({
29149
29146
  });
29150
29147
 
29151
29148
  // packages/experience-design-system-cli-legacy/src/analyze/controller/create-analyze-extract-endpoint.ts
29152
- import { resolve as resolve22, join as join25 } from "node:path";
29149
+ import { resolve as resolve22, join as join23 } from "node:path";
29153
29150
  async function analyzeExtractEndpoint(request2) {
29154
29151
  const agent = resolveCompositionAgentName(request2.agent);
29155
29152
  if (request2.bedrock && !agentSupportsBedrock(agent)) {
@@ -29158,7 +29155,7 @@ async function analyzeExtractEndpoint(request2) {
29158
29155
  const { overrides, errors } = parsePromptOverrides(request2.promptOverrides ?? []);
29159
29156
  if (errors.length > 0) throw new Error(errors.join("; "));
29160
29157
  const projectRoot = resolve22(request2.projectPath);
29161
- const outDir = join25(projectRoot, ".contentful");
29158
+ const outDir = join23(projectRoot, ".contentful");
29162
29159
  const sourceDirectory = await resolveSourceDirectory(projectRoot, void 0);
29163
29160
  const compositionSources = resolveCompositionSources({
29164
29161
  compositionRefresh: request2.noCache,
@@ -29316,12 +29313,12 @@ __export(WizardApp_exports, {
29316
29313
  });
29317
29314
  import { useEffect as useEffect15, useRef as useRef10, useState as useState23 } from "react";
29318
29315
  import { Box as Box42, Text as Text46 } from "ink";
29319
- import { join as join26, resolve as resolve23 } from "node:path";
29316
+ import { join as join24, resolve as resolve23 } from "node:path";
29320
29317
  import { appendFileSync as appendFileSync2, writeFileSync } from "node:fs";
29321
- import { access as access7, stat as stat5, writeFile as writeFile6 } from "node:fs/promises";
29318
+ import { access as access7, stat as stat5, writeFile as writeFile5 } from "node:fs/promises";
29322
29319
  import { tmpdir } from "node:os";
29323
29320
  import { execFile as execFile2, spawn as spawn5 } from "node:child_process";
29324
- import { mkdir as mkdir6 } from "node:fs/promises";
29321
+ import { mkdir as mkdir5 } from "node:fs/promises";
29325
29322
  import { buildCDF as buildCDF3, validateCDF as validateCDF3, validateSlotReferences as validateSlotReferences2 } from "@contentful/experience-design-system-types";
29326
29323
  import { jsx as jsx50, jsxs as jsxs43 } from "react/jsx-runtime";
29327
29324
  function buildGenerateComponentsArgs(opts) {
@@ -29484,7 +29481,7 @@ function WizardApp({
29484
29481
  const rawTokensEntryReady = !!initialRawTokensPath;
29485
29482
  const effectiveNoCache = resolveNoCacheForGenerate({ cliNoCache: noCache });
29486
29483
  const initialStepResolved = rawTokensEntryReady ? initialProjectPath ? "path-validation" : "credentials" : initialProjectPath ? "token-input" : "welcome";
29487
- const initialOutDir = initialProjectPath ? join26(resolve23(initialProjectPath), ".contentful") : "";
29484
+ const initialOutDir = initialProjectPath ? join24(resolve23(initialProjectPath), ".contentful") : "";
29488
29485
  const [state, setState] = useState23({
29489
29486
  step: initialStepResolved,
29490
29487
  agent: initialAgent ?? "claude",
@@ -29682,7 +29679,7 @@ If you are using AWS Bedrock, run:
29682
29679
  }
29683
29680
  const sessionMatch = /^session=(.+)$/m.exec(result.stdout);
29684
29681
  const tokenSessionId = sessionMatch ? sessionMatch[1].trim() : null;
29685
- const tokensPath = join26(outDir, "tokens.json");
29682
+ const tokensPath = join24(outDir, "tokens.json");
29686
29683
  const printArgs = ["print", "tokens", "--out", tokensPath];
29687
29684
  if (tokenSessionId) printArgs.push("--session", tokenSessionId);
29688
29685
  const r = await runCli(printArgs);
@@ -29704,7 +29701,7 @@ If you are using AWS Bedrock, run:
29704
29701
  tokenGenerationStatus: "complete",
29705
29702
  skipComponents: true,
29706
29703
  acceptedCount: 0,
29707
- outDir: state.outDir || join26(process.cwd(), ".contentful")
29704
+ outDir: state.outDir || join24(process.cwd(), ".contentful")
29708
29705
  });
29709
29706
  update({ step: "credentials" });
29710
29707
  return true;
@@ -29809,7 +29806,7 @@ If you are using AWS Bedrock, run:
29809
29806
  update({ existingEntitiesStatus: "running" });
29810
29807
  const promise = (async () => {
29811
29808
  try {
29812
- await mkdir6(outDir, { recursive: true });
29809
+ await mkdir5(outDir, { recursive: true });
29813
29810
  const result = await fetchAndPersistExistingContentfulEntities({
29814
29811
  spaceId: state.spaceId,
29815
29812
  environmentId: state.environmentId,
@@ -29845,7 +29842,7 @@ If you are using AWS Bedrock, run:
29845
29842
  return promise;
29846
29843
  };
29847
29844
  const runExtract = async (projectPath, showProgress = true) => {
29848
- const outDir = join26(resolve23(projectPath), ".contentful");
29845
+ const outDir = join24(resolve23(projectPath), ".contentful");
29849
29846
  const existingEntitiesExpected = !state.credentialsSkipped && Boolean(state.spaceId && state.environmentId && state.cmaToken && projectPath);
29850
29847
  update({
29851
29848
  ...showProgress ? { step: "extracting" } : {},
@@ -30813,7 +30810,7 @@ If using a custom host configuration, make sure the space exists on that host.`
30813
30810
  };
30814
30811
  const runPrintFiles = async (extractSessionId, outDir, opts = {}) => {
30815
30812
  update({ step: "printing" });
30816
- const componentsPath = join26(outDir, "components.json");
30813
+ const componentsPath = join24(outDir, "components.json");
30817
30814
  try {
30818
30815
  const db = openPipelineDb();
30819
30816
  let components = [];
@@ -30826,7 +30823,7 @@ If using a custom host configuration, make sure the space exists on that host.`
30826
30823
  }
30827
30824
  if (!opts.tokenSessionId && opts.tokensPath) tokens = await readTokensFromPath("tokens", opts.tokensPath);
30828
30825
  const cdf = buildSavedCDF(components, tokens, { deleteAll: opts.allowEmpty });
30829
- await writeFile6(componentsPath, `${JSON.stringify(cdf, null, 2)}
30826
+ await writeFile5(componentsPath, `${JSON.stringify(cdf, null, 2)}
30830
30827
  `);
30831
30828
  process.stderr.write(
30832
30829
  `wrote ${componentsPath} (${components.length} component${components.length === 1 ? "" : "s"}, ${tokens.length} token${tokens.length === 1 ? "" : "s"})
@@ -30916,7 +30913,7 @@ If using a custom host configuration, make sure the space exists on that host.`
30916
30913
  if (tokenReuseChecked.current) return;
30917
30914
  tokenReuseChecked.current = true;
30918
30915
  const tokenNextStep = state.projectPath ? "path-validation" : "credentials";
30919
- const existingTokensPath = join26(state.outDir, "tokens.json");
30916
+ const existingTokensPath = join24(state.outDir, "tokens.json");
30920
30917
  if (effectiveNoCache) {
30921
30918
  tokenGenerationPromiseRef.current = runAgentAuthCheck(tokenNextStep).then(
30922
30919
  (ok2) => ok2 ? runGenerateTokens2(state.rawTokensPath, state.outDir) : false
@@ -30967,7 +30964,7 @@ If using a custom host configuration, make sure the space exists on that host.`
30967
30964
  {
30968
30965
  onContinue: (path) => {
30969
30966
  const projectPath = normalizePath(path);
30970
- const outDir = join26(projectPath, ".contentful");
30967
+ const outDir = join24(projectPath, ".contentful");
30971
30968
  update({ step: "token-input", projectPath, outDir });
30972
30969
  },
30973
30970
  onQuit: () => process.exit(0)
@@ -31354,11 +31351,11 @@ If using a custom host configuration, make sure the space exists on that host.`
31354
31351
  defaultPath: state.outDir,
31355
31352
  onSubmit: (submitted) => {
31356
31353
  void (async () => {
31357
- await mkdir6(submitted, { recursive: true });
31354
+ await mkdir5(submitted, { recursive: true });
31358
31355
  const hasConflict = await detectSaveConflict(submitted);
31359
31356
  if (hasConflict) {
31360
31357
  const subdir = buildTimestampedSubdir(submitted);
31361
- await mkdir6(subdir, { recursive: true });
31358
+ await mkdir5(subdir, { recursive: true });
31362
31359
  await proceedToWrite(subdir);
31363
31360
  return;
31364
31361
  }
@@ -31511,7 +31508,7 @@ var init_WizardApp = __esm({
31511
31508
  init_use_terminal_size();
31512
31509
  init_render_with_goodbye();
31513
31510
  SAVE_CONFIRMATION_DELAY_MS = 1e3;
31514
- WIZARD_LOG = join26(tmpdir(), "experiences-import-wizard.log");
31511
+ WIZARD_LOG = join24(tmpdir(), "experiences-import-wizard.log");
31515
31512
  }
31516
31513
  });
31517
31514
 
@@ -31691,7 +31688,7 @@ var init_shell = __esm({
31691
31688
  });
31692
31689
 
31693
31690
  // packages/experience-design-system-cli-legacy/src/setup/lib/checks.ts
31694
- import { join as join27 } from "node:path";
31691
+ import { join as join25 } from "node:path";
31695
31692
  function checkNodeVersion(nodeVersion = process.versions.node) {
31696
31693
  const major = Number.parseInt(nodeVersion.split(".")[0], 10);
31697
31694
  return {
@@ -31705,7 +31702,7 @@ async function detectNodeVersionManagers(homeDir, deps = {
31705
31702
  binaryExists,
31706
31703
  pathExists: pathExists3
31707
31704
  }) {
31708
- const nvmScript = join27(homeDir, ".nvm", "nvm.sh");
31705
+ const nvmScript = join25(homeDir, ".nvm", "nvm.sh");
31709
31706
  return {
31710
31707
  nvm: await deps.binaryExists("nvm") || await deps.pathExists(nvmScript),
31711
31708
  fnm: await deps.binaryExists("fnm"),
@@ -31783,8 +31780,8 @@ var init_report = __esm({
31783
31780
  });
31784
31781
 
31785
31782
  // packages/experience-design-system-cli-legacy/src/doctor/checks.ts
31786
- import { homedir as homedir7 } from "node:os";
31787
- import { join as join28 } from "node:path";
31783
+ import { homedir as homedir2 } from "node:os";
31784
+ import { join as join26 } from "node:path";
31788
31785
  async function reportNode() {
31789
31786
  section("Checking Node.js version");
31790
31787
  const check = checkNodeVersion();
@@ -31795,7 +31792,7 @@ async function reportNode() {
31795
31792
  fail(`Node.js v${check.version} \u2014 need v${check.required}+`);
31796
31793
  info("");
31797
31794
  info("How to fix:");
31798
- const managers = await detectNodeVersionManagers(homedir7());
31795
+ const managers = await detectNodeVersionManagers(homedir2());
31799
31796
  if (managers.nvm) {
31800
31797
  info(` nvm install ${check.required}`);
31801
31798
  info(` nvm use ${check.required}`);
@@ -31835,12 +31832,12 @@ async function reportPnpm(pkgRoot) {
31835
31832
  }
31836
31833
  async function reportDependencies(pkgRoot) {
31837
31834
  section("Checking dependencies (pnpm install)");
31838
- if (!await pathExists3(join28(pkgRoot, "node_modules"))) {
31835
+ if (!await pathExists3(join26(pkgRoot, "node_modules"))) {
31839
31836
  info("node_modules not found \u2014 running pnpm install...");
31840
31837
  } else {
31841
31838
  info("Running pnpm install to ensure dependencies are up to date...");
31842
31839
  }
31843
- const check = await installDependencies(join28(pkgRoot, "..", ".."));
31840
+ const check = await installDependencies(join26(pkgRoot, "..", ".."));
31844
31841
  if (!check.passed) {
31845
31842
  fail("pnpm install failed");
31846
31843
  info("");
@@ -31857,7 +31854,7 @@ async function reportDependencies(pkgRoot) {
31857
31854
  async function reportBuild(pkgRoot) {
31858
31855
  section("Building CLI");
31859
31856
  info("Running pnpm build...");
31860
- const check = await buildCli(join28(pkgRoot, "..", ".."));
31857
+ const check = await buildCli(join26(pkgRoot, "..", ".."));
31861
31858
  if (!check.passed) {
31862
31859
  fail("Build failed");
31863
31860
  info("");
@@ -33072,9 +33069,9 @@ var init_SetupScreen = __esm({
33072
33069
 
33073
33070
  // packages/experience-design-system-cli-legacy/src/setup/command.ts
33074
33071
  import { readFileSync as readFileSync10 } from "node:fs";
33075
- import { join as join29 } from "node:path";
33072
+ import { join as join27 } from "node:path";
33076
33073
  function getCliVersion() {
33077
- const pkg4 = JSON.parse(readFileSync10(join29(findPkgRoot(), "package.json"), "utf8"));
33074
+ const pkg4 = JSON.parse(readFileSync10(join27(findPkgRoot(), "package.json"), "utf8"));
33078
33075
  return pkg4.version;
33079
33076
  }
33080
33077
  async function runSetup(opts) {
@@ -33086,7 +33083,7 @@ async function runSetup(opts) {
33086
33083
  const { renderWithGoodbye: renderWithGoodbye2 } = await Promise.resolve().then(() => (init_render_with_goodbye(), render_with_goodbye_exports));
33087
33084
  const { createElement: createElement7 } = await import("react");
33088
33085
  const { SetupScreen: SetupScreen2 } = await Promise.resolve().then(() => (init_SetupScreen(), SetupScreen_exports));
33089
- const repoRoot = join29(findPkgRoot(), "..", "..");
33086
+ const repoRoot = join27(findPkgRoot(), "..", "..");
33090
33087
  const completion = { outcome: null };
33091
33088
  let unmountInk = null;
33092
33089
  const { waitUntilExit, unmount } = renderWithGoodbye2(
@@ -33164,7 +33161,7 @@ __export(program_exports, {
33164
33161
  });
33165
33162
  import { spawn as spawn7 } from "node:child_process";
33166
33163
  import { fileURLToPath as fileURLToPath4 } from "node:url";
33167
- import { dirname as dirname19, join as join30, resolve as resolve24 } from "node:path";
33164
+ import { dirname as dirname20, join as join28, resolve as resolve24 } from "node:path";
33168
33165
  import { readFileSync as readFileSync11 } from "node:fs";
33169
33166
  import { Command } from "commander";
33170
33167
  async function runBuild(opts) {
@@ -33194,7 +33191,7 @@ function resolveBedrockFromAncestors(actionCommand) {
33194
33191
  }
33195
33192
  function registerBuildCommand(program) {
33196
33193
  program.command("build").description("Rebuild from source and re-link exo/experiences binaries to this build").helpOption(false).action(async () => {
33197
- const pkgRoot = resolve24(dirname19(fileURLToPath4(import.meta.url)), "..", "..");
33194
+ const pkgRoot = resolve24(dirname20(fileURLToPath4(import.meta.url)), "..", "..");
33198
33195
  process.stderr.write("\u2699 Building from source...\n");
33199
33196
  const { exitCode } = await runBuild({
33200
33197
  spawnFn: () => spawn7("pnpm", ["build"], { cwd: pkgRoot, stdio: "inherit" }),
@@ -33262,7 +33259,7 @@ var init_program = __esm({
33262
33259
  init_analytics();
33263
33260
  init_credentials_store();
33264
33261
  init_cli_path();
33265
- pkg3 = JSON.parse(readFileSync11(join30(findPkgRoot(), "package.json"), "utf8"));
33262
+ pkg3 = JSON.parse(readFileSync11(join28(findPkgRoot(), "package.json"), "utf8"));
33266
33263
  }
33267
33264
  });
33268
33265