@contentful/experience-design-system-cli 2.42.1-dev-build-9a3d743e.0 → 2.42.1-dev-build-c7f654e2.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 } from "node:child_process";
|
|
1205
|
+
import { spawn as spawn2 } 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 =
|
|
1234
|
+
const child = spawn2(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
|
|
1333
|
+
import { spawn as spawn3 } 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 =
|
|
1342
|
+
const child = spawn3(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 =
|
|
1379
|
+
const child = spawn3(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
|
|
2161
|
+
import { dirname as dirname6, 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 =
|
|
2166
|
+
const thisDir = dirname6(fileURLToPath2(import.meta.url));
|
|
2167
2167
|
let dir = thisDir;
|
|
2168
2168
|
for (; ; ) {
|
|
2169
2169
|
const candidate = join8(dir, "skills");
|
|
@@ -2838,8 +2838,9 @@ 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";
|
|
2841
2842
|
import { readdir as readdir2, readFile as readFile2, stat as stat2, writeFile as writeFile3 } from "node:fs/promises";
|
|
2842
|
-
import { basename, join as join6, sep } from "node:path";
|
|
2843
|
+
import { basename, dirname as dirname4, join as join6, sep } from "node:path";
|
|
2843
2844
|
|
|
2844
2845
|
// packages/experience-design-system-cli/src/tui/zip.ts
|
|
2845
2846
|
import { crc32, deflateRawSync } from "node:zlib";
|
|
@@ -2925,6 +2926,17 @@ async function bundleDebugLogs() {
|
|
|
2925
2926
|
return { status: "failed", folder: debugDir };
|
|
2926
2927
|
}
|
|
2927
2928
|
}
|
|
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
|
+
}
|
|
2928
2940
|
function supportInstruction(bundle) {
|
|
2929
2941
|
switch (bundle.status) {
|
|
2930
2942
|
case "created":
|
|
@@ -2945,6 +2957,7 @@ import { useInput as useInput4 } from "ink";
|
|
|
2945
2957
|
function errorAction(input, key, available) {
|
|
2946
2958
|
if (key.return && available.canAcknowledge) return "acknowledge";
|
|
2947
2959
|
if (input === "r" && available.canRetry) return "retry";
|
|
2960
|
+
if (input === "o" && available.canOpen) return "open";
|
|
2948
2961
|
if (key.return || key.escape) return "exit";
|
|
2949
2962
|
return null;
|
|
2950
2963
|
}
|
|
@@ -2952,7 +2965,8 @@ function errorControls(available) {
|
|
|
2952
2965
|
return [
|
|
2953
2966
|
available.canAcknowledge ? { keys: "Enter", label: "Acknowledge and apply" } : { keys: "Enter", label: "Exit" },
|
|
2954
2967
|
...available.canAcknowledge ? [{ keys: "Esc", label: "Exit" }] : [],
|
|
2955
|
-
...available.canRetry ? [{ keys: "r", label: "Re-enter credentials" }] : []
|
|
2968
|
+
...available.canRetry ? [{ keys: "r", label: "Re-enter credentials" }] : [],
|
|
2969
|
+
...available.canOpen ? [{ keys: "o", label: "Show debug logs in file manager" }] : []
|
|
2956
2970
|
];
|
|
2957
2971
|
}
|
|
2958
2972
|
|
|
@@ -2961,10 +2975,12 @@ function useErrorControls(handlers) {
|
|
|
2961
2975
|
useInput4((input, key) => {
|
|
2962
2976
|
const action = errorAction(input, key, {
|
|
2963
2977
|
canRetry: handlers.onRetry !== void 0,
|
|
2964
|
-
canAcknowledge: handlers.onAcknowledge !== void 0
|
|
2978
|
+
canAcknowledge: handlers.onAcknowledge !== void 0,
|
|
2979
|
+
canOpen: handlers.onOpen !== void 0
|
|
2965
2980
|
});
|
|
2966
2981
|
if (action === "acknowledge") handlers.onAcknowledge?.();
|
|
2967
2982
|
else if (action === "retry") handlers.onRetry?.();
|
|
2983
|
+
else if (action === "open") handlers.onOpen?.();
|
|
2968
2984
|
else if (action === "exit") handlers.onExit();
|
|
2969
2985
|
});
|
|
2970
2986
|
}
|
|
@@ -2994,11 +3010,18 @@ function ErrorStep({
|
|
|
2994
3010
|
onRetryCredentials,
|
|
2995
3011
|
onAcknowledgeBreakingChanges
|
|
2996
3012
|
}) {
|
|
2997
|
-
useErrorControls({ onExit, onRetry: onRetryCredentials, onAcknowledge: onAcknowledgeBreakingChanges });
|
|
2998
3013
|
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
|
+
});
|
|
2999
3021
|
const controls = errorControls({
|
|
3000
3022
|
canRetry: onRetryCredentials !== void 0,
|
|
3001
|
-
canAcknowledge: onAcknowledgeBreakingChanges !== void 0
|
|
3023
|
+
canAcknowledge: onAcknowledgeBreakingChanges !== void 0,
|
|
3024
|
+
canOpen
|
|
3002
3025
|
});
|
|
3003
3026
|
return /* @__PURE__ */ jsxs4(Box4, { flexDirection: "column", gap: 1, paddingX: 2, paddingY: 1, children: [
|
|
3004
3027
|
/* @__PURE__ */ jsxs4(Text4, { bold: true, color: PALETTE.error, children: [
|
|
@@ -3728,14 +3751,14 @@ import { createHash as createHash5 } from "node:crypto";
|
|
|
3728
3751
|
|
|
3729
3752
|
// packages/experience-design-system-backend-pipeline/dist/src/persistence/src/session/helpers/config-root.js
|
|
3730
3753
|
import { homedir as homedir3 } from "node:os";
|
|
3731
|
-
import { dirname as
|
|
3754
|
+
import { dirname as dirname5, join as join7 } from "node:path";
|
|
3732
3755
|
function configRoot2() {
|
|
3733
3756
|
return process.env["EDS_HOME"] || join7(homedir3(), ".contentful", "experience-design-system-cli");
|
|
3734
3757
|
}
|
|
3735
3758
|
var runsFilePath = () => join7(configRoot2(), "state", "runs.json");
|
|
3736
3759
|
|
|
3737
3760
|
// packages/experience-design-system-backend-pipeline/dist/src/persistence/src/session/repositories/db.js
|
|
3738
|
-
import { dirname as
|
|
3761
|
+
import { dirname as dirname7, resolve as resolve7 } from "node:path";
|
|
3739
3762
|
|
|
3740
3763
|
// packages/experience-design-system-backend-pipeline/dist/src/persistence/src/session/helpers/source-excerpt.js
|
|
3741
3764
|
var ELLIPSIS_MARKER = "/* \u2026 */";
|
|
@@ -4512,7 +4535,7 @@ function getPipelineDbPath() {
|
|
|
4512
4535
|
}
|
|
4513
4536
|
function openPipelineDb(dbPath) {
|
|
4514
4537
|
const path5 = dbPath ?? getPipelineDbPath();
|
|
4515
|
-
mkdirSync(
|
|
4538
|
+
mkdirSync(dirname7(path5), { recursive: true });
|
|
4516
4539
|
try {
|
|
4517
4540
|
const db = new DatabaseSync(path5);
|
|
4518
4541
|
db.exec("PRAGMA busy_timeout = 5000");
|
|
@@ -5205,7 +5228,7 @@ async function resolveImportSpecifiers(sourceText, fromDir) {
|
|
|
5205
5228
|
async function loadSiblingFiles(sourceText, sourcePath, propNames, candidateTypeNames = []) {
|
|
5206
5229
|
const visited = /* @__PURE__ */ new Set([resolve7(sourcePath)]);
|
|
5207
5230
|
const discovered = [];
|
|
5208
|
-
let frontier = [{ text: sourceText, dir:
|
|
5231
|
+
let frontier = [{ text: sourceText, dir: dirname7(sourcePath) }];
|
|
5209
5232
|
for (let hop = 0; hop < MAX_SIBLING_DEPTH && discovered.length < MAX_SIBLING_CANDIDATES_EXPLORED; hop++) {
|
|
5210
5233
|
const nextFrontier = [];
|
|
5211
5234
|
for (const node of frontier) {
|
|
@@ -5225,7 +5248,7 @@ async function loadSiblingFiles(sourceText, sourcePath, propNames, candidateType
|
|
|
5225
5248
|
continue;
|
|
5226
5249
|
}
|
|
5227
5250
|
discovered.push({ path: resolvedPath, content });
|
|
5228
|
-
nextFrontier.push({ text: content, dir:
|
|
5251
|
+
nextFrontier.push({ text: content, dir: dirname7(resolvedPath) });
|
|
5229
5252
|
}
|
|
5230
5253
|
}
|
|
5231
5254
|
frontier = nextFrontier;
|
|
@@ -6021,7 +6044,7 @@ import { Project as Project2, Node as Node2, SyntaxKind as SyntaxKind2 } from "t
|
|
|
6021
6044
|
|
|
6022
6045
|
// packages/experience-design-system-backend-pipeline/dist/src/steps/extraction/src/framework-adapters/shared/extract-tsx-components.js
|
|
6023
6046
|
import { existsSync as existsSync4, readFileSync as readFileSync4 } from "node:fs";
|
|
6024
|
-
import { dirname as
|
|
6047
|
+
import { dirname as dirname8, join as join9, resolve as resolve8 } from "node:path";
|
|
6025
6048
|
import { Node, Project, SyntaxKind } from "ts-morph";
|
|
6026
6049
|
import ts from "typescript";
|
|
6027
6050
|
var packageRootByFilePathCache = /* @__PURE__ */ new Map();
|
|
@@ -6221,7 +6244,7 @@ function findNearestTsConfigPath(filePath) {
|
|
|
6221
6244
|
if (nearestTsConfigPathCache.has(filePath)) {
|
|
6222
6245
|
return nearestTsConfigPathCache.get(filePath) ?? void 0;
|
|
6223
6246
|
}
|
|
6224
|
-
let currentDir =
|
|
6247
|
+
let currentDir = dirname8(filePath);
|
|
6225
6248
|
while (true) {
|
|
6226
6249
|
for (const candidateName of ["tsconfig.json", "jsconfig.json"]) {
|
|
6227
6250
|
const candidatePath = join9(currentDir, candidateName);
|
|
@@ -6230,7 +6253,7 @@ function findNearestTsConfigPath(filePath) {
|
|
|
6230
6253
|
return candidatePath;
|
|
6231
6254
|
}
|
|
6232
6255
|
}
|
|
6233
|
-
const parentDir =
|
|
6256
|
+
const parentDir = dirname8(currentDir);
|
|
6234
6257
|
if (parentDir === currentDir) {
|
|
6235
6258
|
nearestTsConfigPathCache.set(filePath, null);
|
|
6236
6259
|
return void 0;
|
|
@@ -6247,13 +6270,13 @@ function getTsConfigPaths(tsConfigPath) {
|
|
|
6247
6270
|
tsConfigPathsCache.set(tsConfigPath, null);
|
|
6248
6271
|
return void 0;
|
|
6249
6272
|
}
|
|
6250
|
-
const parsedConfig = ts.parseJsonConfigFileContent(configFile.config, ts.sys,
|
|
6273
|
+
const parsedConfig = ts.parseJsonConfigFileContent(configFile.config, ts.sys, dirname8(tsConfigPath));
|
|
6251
6274
|
const paths = parsedConfig.options.paths;
|
|
6252
6275
|
if (!paths || Object.keys(paths).length === 0) {
|
|
6253
6276
|
tsConfigPathsCache.set(tsConfigPath, null);
|
|
6254
6277
|
return void 0;
|
|
6255
6278
|
}
|
|
6256
|
-
const baseUrl = parsedConfig.options.baseUrl ??
|
|
6279
|
+
const baseUrl = parsedConfig.options.baseUrl ?? dirname8(tsConfigPath);
|
|
6257
6280
|
const result = { baseUrl, paths };
|
|
6258
6281
|
tsConfigPathsCache.set(tsConfigPath, result);
|
|
6259
6282
|
return result;
|
|
@@ -6354,13 +6377,13 @@ function findNearestPackageRootDir(filePath) {
|
|
|
6354
6377
|
if (packageRootByFilePathCache.has(filePath)) {
|
|
6355
6378
|
return packageRootByFilePathCache.get(filePath) ?? void 0;
|
|
6356
6379
|
}
|
|
6357
|
-
let currentDir =
|
|
6380
|
+
let currentDir = dirname8(filePath);
|
|
6358
6381
|
while (true) {
|
|
6359
6382
|
if (existsSync4(join9(currentDir, "package.json"))) {
|
|
6360
6383
|
packageRootByFilePathCache.set(filePath, currentDir);
|
|
6361
6384
|
return currentDir;
|
|
6362
6385
|
}
|
|
6363
|
-
const parentDir =
|
|
6386
|
+
const parentDir = dirname8(currentDir);
|
|
6364
6387
|
if (parentDir === currentDir) {
|
|
6365
6388
|
packageRootByFilePathCache.set(filePath, null);
|
|
6366
6389
|
return void 0;
|
|
@@ -9357,7 +9380,7 @@ function extractVueSlotsFromSetup(options) {
|
|
|
9357
9380
|
|
|
9358
9381
|
// packages/experience-design-system-backend-pipeline/dist/src/steps/extraction/src/framework-adapters/vue/extract-vue-components.js
|
|
9359
9382
|
import os from "node:os";
|
|
9360
|
-
import { basename as basename2, dirname as
|
|
9383
|
+
import { basename as basename2, dirname as dirname10, resolve as resolve10, join as join11 } from "node:path";
|
|
9361
9384
|
import { readFile as readFile8 } from "node:fs/promises";
|
|
9362
9385
|
import { existsSync as existsSync6, readFileSync as readFileSync5, readdirSync as readdirSync2, statSync as statSync3 } from "node:fs";
|
|
9363
9386
|
import { parse as parseSFC } from "@vue/compiler-sfc";
|
|
@@ -9365,9 +9388,9 @@ import { Project as Project3, Node as Node6 } from "ts-morph";
|
|
|
9365
9388
|
|
|
9366
9389
|
// packages/experience-design-system-backend-pipeline/dist/src/steps/extraction/src/framework-adapters/shared/resolve-local-module.js
|
|
9367
9390
|
import { existsSync as existsSync5, statSync as statSync2 } from "node:fs";
|
|
9368
|
-
import { dirname as
|
|
9391
|
+
import { dirname as dirname9, join as join10, resolve as resolve9 } from "node:path";
|
|
9369
9392
|
function resolveLocalModule(importingFilePath, specifier, options = {}) {
|
|
9370
|
-
const basePath = resolve9(
|
|
9393
|
+
const basePath = resolve9(dirname9(importingFilePath), specifier);
|
|
9371
9394
|
const candidates = [
|
|
9372
9395
|
basePath,
|
|
9373
9396
|
`${basePath}.js`,
|
|
@@ -9456,7 +9479,7 @@ function getVueComponentName(filePath) {
|
|
|
9456
9479
|
if (fileName !== "index") {
|
|
9457
9480
|
return fileName;
|
|
9458
9481
|
}
|
|
9459
|
-
const parentDirName = basename2(
|
|
9482
|
+
const parentDirName = basename2(dirname10(filePath));
|
|
9460
9483
|
return parentDirName || fileName;
|
|
9461
9484
|
}
|
|
9462
9485
|
async function extractOptionsComponent(filePath, scriptContent, fileWarnings, name, templateAst, sfcSource) {
|
|
@@ -9639,7 +9662,7 @@ function findWorkspaceRoot(startDir) {
|
|
|
9639
9662
|
} catch {
|
|
9640
9663
|
}
|
|
9641
9664
|
}
|
|
9642
|
-
const parent =
|
|
9665
|
+
const parent = dirname10(dir);
|
|
9643
9666
|
if (parent === dir) {
|
|
9644
9667
|
workspaceRootCache.set(startDir, null);
|
|
9645
9668
|
return null;
|
|
@@ -9695,7 +9718,7 @@ function getWorkspacePackageDirs(workspaceRoot) {
|
|
|
9695
9718
|
return packageMap;
|
|
9696
9719
|
}
|
|
9697
9720
|
function resolveWorkspaceVueImport(specifier, importingFilePath) {
|
|
9698
|
-
const workspaceRoot = findWorkspaceRoot(
|
|
9721
|
+
const workspaceRoot = findWorkspaceRoot(dirname10(importingFilePath));
|
|
9699
9722
|
if (!workspaceRoot)
|
|
9700
9723
|
return null;
|
|
9701
9724
|
const packageDirs = getWorkspacePackageDirs(workspaceRoot);
|
|
@@ -9787,7 +9810,7 @@ async function extractOptionsProps(filePath, scriptContent, visited = /* @__PURE
|
|
|
9787
9810
|
if (specifier.startsWith(".")) {
|
|
9788
9811
|
if (!specifier.endsWith(".vue"))
|
|
9789
9812
|
continue;
|
|
9790
|
-
localImports.set(defaultImport.getText(), resolve10(
|
|
9813
|
+
localImports.set(defaultImport.getText(), resolve10(dirname10(resolvedFilePath), specifier));
|
|
9791
9814
|
} else {
|
|
9792
9815
|
const resolvedVuePath = resolveWorkspaceVueImport(specifier, resolvedFilePath);
|
|
9793
9816
|
if (resolvedVuePath) {
|
|
@@ -10164,7 +10187,7 @@ async function extractAstroComponents(filePaths, onProgress) {
|
|
|
10164
10187
|
}
|
|
10165
10188
|
|
|
10166
10189
|
// packages/experience-design-system-backend-pipeline/dist/src/steps/extraction/src/framework-adapters/web-components/extract-web-components.js
|
|
10167
|
-
import { basename as basename4, dirname as
|
|
10190
|
+
import { basename as basename4, dirname as dirname11, join as join12, resolve as resolve11 } from "node:path";
|
|
10168
10191
|
import { Project as Project5, Node as Node8, SyntaxKind as SyntaxKind6 } from "ts-morph";
|
|
10169
10192
|
function normalizeComponentName(input) {
|
|
10170
10193
|
return input.replace(/[^a-zA-Z0-9]/g, "").toLowerCase();
|
|
@@ -10809,7 +10832,7 @@ function getElementTagNameFromFastDefinition(classDecl, project) {
|
|
|
10809
10832
|
}
|
|
10810
10833
|
function resolveImportSourcePath2(fromFilePath, specifier) {
|
|
10811
10834
|
if (specifier.startsWith(".")) {
|
|
10812
|
-
const resolvedPath = resolve11(
|
|
10835
|
+
const resolvedPath = resolve11(dirname11(fromFilePath), specifier);
|
|
10813
10836
|
if (resolvedPath.endsWith(".js")) {
|
|
10814
10837
|
return `${resolvedPath.slice(0, -3)}.ts`;
|
|
10815
10838
|
}
|
|
@@ -10979,7 +11002,7 @@ async function extractWebComponentDefinitions(filePaths) {
|
|
|
10979
11002
|
|
|
10980
11003
|
// packages/experience-design-system-backend-pipeline/dist/src/steps/extraction/src/framework-adapters/svelte/extract-svelte-components.js
|
|
10981
11004
|
import os3 from "node:os";
|
|
10982
|
-
import { basename as basename5, dirname as
|
|
11005
|
+
import { basename as basename5, dirname as dirname12, resolve as resolve12, join as join13 } from "node:path";
|
|
10983
11006
|
import { existsSync as existsSync7, readFileSync as readFileSync6 } from "node:fs";
|
|
10984
11007
|
import { createRequire } from "node:module";
|
|
10985
11008
|
import { parse as parseSvelte } from "svelte/compiler";
|
|
@@ -11216,7 +11239,7 @@ function findNearestTsconfig(startDir) {
|
|
|
11216
11239
|
const candidate = join13(dir, "tsconfig.json");
|
|
11217
11240
|
if (existsSync7(candidate))
|
|
11218
11241
|
return candidate;
|
|
11219
|
-
const parent =
|
|
11242
|
+
const parent = dirname12(dir);
|
|
11220
11243
|
if (!parent || parent === dir)
|
|
11221
11244
|
return null;
|
|
11222
11245
|
dir = parent;
|
|
@@ -11346,7 +11369,7 @@ function locateDtsForSpecifier(req, specifier, parentFile) {
|
|
|
11346
11369
|
} catch {
|
|
11347
11370
|
resolvedJs = null;
|
|
11348
11371
|
}
|
|
11349
|
-
const seedDir = resolvedJs ?
|
|
11372
|
+
const seedDir = resolvedJs ? dirname12(resolvedJs) : dirname12(parentFile);
|
|
11350
11373
|
const pkgRoot = findPackageRootForSpecifier(seedDir, specifier);
|
|
11351
11374
|
if (pkgRoot) {
|
|
11352
11375
|
const pkgJsonPath = join13(pkgRoot, "package.json");
|
|
@@ -11399,7 +11422,7 @@ function findPackageRootForSpecifier(seedDir, specifier) {
|
|
|
11399
11422
|
} catch {
|
|
11400
11423
|
}
|
|
11401
11424
|
}
|
|
11402
|
-
const parent =
|
|
11425
|
+
const parent = dirname12(dir);
|
|
11403
11426
|
if (!parent || parent === dir)
|
|
11404
11427
|
return null;
|
|
11405
11428
|
dir = parent;
|
|
@@ -11531,11 +11554,11 @@ async function extractFromSvelteFile(filePath, source) {
|
|
|
11531
11554
|
var ANATOMY_FOLDERS = /* @__PURE__ */ new Set(["anatomy", "parts"]);
|
|
11532
11555
|
function getSvelteComponentName(filePath) {
|
|
11533
11556
|
const file = basename5(filePath, ".svelte");
|
|
11534
|
-
const parentDir = basename5(
|
|
11557
|
+
const parentDir = basename5(dirname12(filePath));
|
|
11535
11558
|
if (file === "index")
|
|
11536
11559
|
return toPascalCase(parentDir);
|
|
11537
11560
|
if (ANATOMY_FOLDERS.has(parentDir)) {
|
|
11538
|
-
const grandparent = basename5(
|
|
11561
|
+
const grandparent = basename5(dirname12(dirname12(filePath)));
|
|
11539
11562
|
if (grandparent && grandparent !== "." && grandparent !== "/") {
|
|
11540
11563
|
return `${toPascalCase(grandparent)}${toPascalCase(file)}`;
|
|
11541
11564
|
}
|
|
@@ -12664,7 +12687,7 @@ function extractProps2(cls, meta) {
|
|
|
12664
12687
|
}
|
|
12665
12688
|
|
|
12666
12689
|
// packages/experience-design-system-backend-pipeline/dist/src/steps/extraction/src/framework-adapters/angular/helpers/read-component-metadata.js
|
|
12667
|
-
import { dirname as
|
|
12690
|
+
import { dirname as dirname13, resolve as resolve13 } from "node:path";
|
|
12668
12691
|
|
|
12669
12692
|
// packages/experience-design-system-backend-pipeline/dist/src/steps/extraction/src/framework-adapters/angular/helpers/resolution/normalize-component-name.js
|
|
12670
12693
|
var SUFFIXES = ["Component", "Directive"];
|
|
@@ -12719,7 +12742,7 @@ function readComponentMetadata(cls, sourceFilePath) {
|
|
|
12719
12742
|
const inlineTemplate = readDecoratorString(obj, "template");
|
|
12720
12743
|
const templateUrlRel = readDecoratorString(obj, "templateUrl");
|
|
12721
12744
|
const inputsArray = readDecoratorStringArray(obj, "inputs");
|
|
12722
|
-
const templatePath = templateUrlRel ? resolve13(
|
|
12745
|
+
const templatePath = templateUrlRel ? resolve13(dirname13(sourceFilePath), templateUrlRel) : null;
|
|
12723
12746
|
const decorator = cls.getDecorator("Component");
|
|
12724
12747
|
const decoratorLine = decorator?.getStartLineNumber() ?? cls.getStartLineNumber();
|
|
12725
12748
|
return {
|
|
@@ -13542,10 +13565,10 @@ function applyCompositionEdges(components, edges) {
|
|
|
13542
13565
|
|
|
13543
13566
|
// packages/experience-design-system-backend-pipeline/dist/src/steps/composition/src/helpers/prompt/prompt-loader.js
|
|
13544
13567
|
import { existsSync as existsSync8, readFileSync as readFileSync7 } from "node:fs";
|
|
13545
|
-
import { dirname as
|
|
13568
|
+
import { dirname as dirname14, join as join14, resolve as resolve14 } from "node:path";
|
|
13546
13569
|
import { fileURLToPath as fileURLToPath3 } from "node:url";
|
|
13547
13570
|
function resolvePromptPath(fileName) {
|
|
13548
|
-
const thisDir =
|
|
13571
|
+
const thisDir = dirname14(fileURLToPath3(import.meta.url));
|
|
13549
13572
|
let dir = thisDir;
|
|
13550
13573
|
for (; ; ) {
|
|
13551
13574
|
const candidate = join14(dir, "prompts");
|
|
@@ -13716,7 +13739,7 @@ ${fileDigest}`);
|
|
|
13716
13739
|
}
|
|
13717
13740
|
|
|
13718
13741
|
// packages/experience-design-system-backend-pipeline/dist/src/steps/composition/src/helpers/edges/manifest-doc-evidence.js
|
|
13719
|
-
import { dirname as
|
|
13742
|
+
import { dirname as dirname15 } from "node:path";
|
|
13720
13743
|
function kebabToPascal3(name) {
|
|
13721
13744
|
return name.split("-").filter(Boolean).map((seg) => seg.charAt(0).toUpperCase() + seg.slice(1)).join("");
|
|
13722
13745
|
}
|
|
@@ -13780,8 +13803,8 @@ function collectAgentsDocEdges(files, components, componentNames) {
|
|
|
13780
13803
|
for (const file of files) {
|
|
13781
13804
|
if (!file.path.endsWith("AGENTS.md"))
|
|
13782
13805
|
continue;
|
|
13783
|
-
const docDir =
|
|
13784
|
-
const parent = components.find((c2) => c2.sourcePath &&
|
|
13806
|
+
const docDir = dirname15(file.path);
|
|
13807
|
+
const parent = components.find((c2) => c2.sourcePath && dirname15(c2.sourcePath) === docDir)?.name;
|
|
13785
13808
|
if (!parent || !componentNames.has(parent))
|
|
13786
13809
|
continue;
|
|
13787
13810
|
for (const line of file.content.split("\n")) {
|
|
@@ -14577,9 +14600,9 @@ async function readRunsFileMaybe() {
|
|
|
14577
14600
|
|
|
14578
14601
|
// packages/experience-design-system-backend-pipeline/dist/src/persistence/src/runs/repositories/write-runs-file.js
|
|
14579
14602
|
import { mkdir as mkdir4, rename as rename2, writeFile as writeFile6 } from "node:fs/promises";
|
|
14580
|
-
import { dirname as
|
|
14603
|
+
import { dirname as dirname16 } from "node:path";
|
|
14581
14604
|
async function writeRunsFileAtomic(file) {
|
|
14582
|
-
await mkdir4(
|
|
14605
|
+
await mkdir4(dirname16(runsFilePath()), { recursive: true });
|
|
14583
14606
|
const body = JSON.stringify(file, null, 2) + "\n";
|
|
14584
14607
|
const tmp = `${runsFilePath()}.${process.pid}.${Date.now()}.tmp`;
|
|
14585
14608
|
await writeFile6(tmp, body, { mode: 384 });
|
|
@@ -19141,10 +19164,10 @@ import { join as join21, resolve as resolve24 } from "node:path";
|
|
|
19141
19164
|
|
|
19142
19165
|
// packages/experience-design-system-cli/src/tui/import/steps/06-extraction/find-skill-path.ts
|
|
19143
19166
|
import { existsSync as existsSync10 } from "node:fs";
|
|
19144
|
-
import { dirname as
|
|
19167
|
+
import { dirname as dirname17, join as join20, resolve as resolve22 } from "node:path";
|
|
19145
19168
|
import { fileURLToPath as fileURLToPath4 } from "node:url";
|
|
19146
19169
|
function findSkillPath(fileName) {
|
|
19147
|
-
const thisDir =
|
|
19170
|
+
const thisDir = dirname17(fileURLToPath4(import.meta.url));
|
|
19148
19171
|
let dir = thisDir;
|
|
19149
19172
|
for (; ; ) {
|
|
19150
19173
|
const candidate = join20(dir, "skills", fileName);
|
|
@@ -28709,7 +28732,7 @@ function DoneStep({
|
|
|
28709
28732
|
import { useState as useState29 } from "react";
|
|
28710
28733
|
import { Box as Box42, Text as Text44 } from "ink";
|
|
28711
28734
|
import { readdirSync as readdirSync4 } from "node:fs";
|
|
28712
|
-
import { dirname as
|
|
28735
|
+
import { dirname as dirname18, basename as basename7, join as join23 } from "node:path";
|
|
28713
28736
|
|
|
28714
28737
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/support/path-utils.ts
|
|
28715
28738
|
import { resolve as resolve26 } from "node:path";
|
|
@@ -28745,7 +28768,7 @@ import { jsx as jsx52, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
|
28745
28768
|
function autocomplete(partial) {
|
|
28746
28769
|
if (!partial) return null;
|
|
28747
28770
|
const normalized = normalizePath(partial);
|
|
28748
|
-
const dir =
|
|
28771
|
+
const dir = dirname18(normalized);
|
|
28749
28772
|
const base = basename7(normalized);
|
|
28750
28773
|
let entries;
|
|
28751
28774
|
try {
|
package/dist/index.js
CHANGED
|
@@ -19943,8 +19943,9 @@ 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";
|
|
19946
19947
|
import { readdir as readdir3, readFile as readFile21, stat as stat5, writeFile as writeFile8 } from "node:fs/promises";
|
|
19947
|
-
import { basename as basename6, join as join20, sep } from "node:path";
|
|
19948
|
+
import { basename as basename6, dirname as dirname16, join as join20, sep } from "node:path";
|
|
19948
19949
|
async function bundleDebugLogs() {
|
|
19949
19950
|
const session = currentSessionDir();
|
|
19950
19951
|
const debugDir = currentDebugSessionDir();
|
|
@@ -19966,6 +19967,17 @@ async function bundleDebugLogs() {
|
|
|
19966
19967
|
return { status: "failed", folder: debugDir };
|
|
19967
19968
|
}
|
|
19968
19969
|
}
|
|
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
|
+
}
|
|
19969
19981
|
function supportInstruction(bundle) {
|
|
19970
19982
|
switch (bundle.status) {
|
|
19971
19983
|
case "created":
|
|
@@ -19990,6 +20002,7 @@ var init_support_bundle = __esm({
|
|
|
19990
20002
|
function errorAction(input, key, available) {
|
|
19991
20003
|
if (key.return && available.canAcknowledge) return "acknowledge";
|
|
19992
20004
|
if (input === "r" && available.canRetry) return "retry";
|
|
20005
|
+
if (input === "o" && available.canOpen) return "open";
|
|
19993
20006
|
if (key.return || key.escape) return "exit";
|
|
19994
20007
|
return null;
|
|
19995
20008
|
}
|
|
@@ -19997,7 +20010,8 @@ function errorControls(available) {
|
|
|
19997
20010
|
return [
|
|
19998
20011
|
available.canAcknowledge ? { keys: "Enter", label: "Acknowledge and apply" } : { keys: "Enter", label: "Exit" },
|
|
19999
20012
|
...available.canAcknowledge ? [{ keys: "Esc", label: "Exit" }] : [],
|
|
20000
|
-
...available.canRetry ? [{ keys: "r", label: "Re-enter credentials" }] : []
|
|
20013
|
+
...available.canRetry ? [{ keys: "r", label: "Re-enter credentials" }] : [],
|
|
20014
|
+
...available.canOpen ? [{ keys: "o", label: "Show debug logs in file manager" }] : []
|
|
20001
20015
|
];
|
|
20002
20016
|
}
|
|
20003
20017
|
var init_logic2 = __esm({
|
|
@@ -20012,10 +20026,12 @@ function useErrorControls(handlers) {
|
|
|
20012
20026
|
useInput4((input, key) => {
|
|
20013
20027
|
const action = errorAction(input, key, {
|
|
20014
20028
|
canRetry: handlers.onRetry !== void 0,
|
|
20015
|
-
canAcknowledge: handlers.onAcknowledge !== void 0
|
|
20029
|
+
canAcknowledge: handlers.onAcknowledge !== void 0,
|
|
20030
|
+
canOpen: handlers.onOpen !== void 0
|
|
20016
20031
|
});
|
|
20017
20032
|
if (action === "acknowledge") handlers.onAcknowledge?.();
|
|
20018
20033
|
else if (action === "retry") handlers.onRetry?.();
|
|
20034
|
+
else if (action === "open") handlers.onOpen?.();
|
|
20019
20035
|
else if (action === "exit") handlers.onExit();
|
|
20020
20036
|
});
|
|
20021
20037
|
}
|
|
@@ -20058,11 +20074,18 @@ function ErrorStep({
|
|
|
20058
20074
|
onRetryCredentials,
|
|
20059
20075
|
onAcknowledgeBreakingChanges
|
|
20060
20076
|
}) {
|
|
20061
|
-
useErrorControls({ onExit, onRetry: onRetryCredentials, onAcknowledge: onAcknowledgeBreakingChanges });
|
|
20062
20077
|
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
|
+
});
|
|
20063
20085
|
const controls = errorControls({
|
|
20064
20086
|
canRetry: onRetryCredentials !== void 0,
|
|
20065
|
-
canAcknowledge: onAcknowledgeBreakingChanges !== void 0
|
|
20087
|
+
canAcknowledge: onAcknowledgeBreakingChanges !== void 0,
|
|
20088
|
+
canOpen
|
|
20066
20089
|
});
|
|
20067
20090
|
return /* @__PURE__ */ jsxs4(Box4, { flexDirection: "column", gap: 1, paddingX: 2, paddingY: 1, children: [
|
|
20068
20091
|
/* @__PURE__ */ jsxs4(Text4, { bold: true, color: PALETTE.error, children: [
|
|
@@ -21982,10 +22005,10 @@ var init_steps = __esm({
|
|
|
21982
22005
|
|
|
21983
22006
|
// packages/experience-design-system-cli/src/tui/import/steps/06-extraction/find-skill-path.ts
|
|
21984
22007
|
import { existsSync as existsSync11 } from "node:fs";
|
|
21985
|
-
import { dirname as
|
|
22008
|
+
import { dirname as dirname17, join as join21, resolve as resolve22 } from "node:path";
|
|
21986
22009
|
import { fileURLToPath as fileURLToPath4 } from "node:url";
|
|
21987
22010
|
function findSkillPath(fileName) {
|
|
21988
|
-
const thisDir =
|
|
22011
|
+
const thisDir = dirname17(fileURLToPath4(import.meta.url));
|
|
21989
22012
|
let dir = thisDir;
|
|
21990
22013
|
for (; ; ) {
|
|
21991
22014
|
const candidate = join21(dir, "skills", fileName);
|
|
@@ -32454,12 +32477,12 @@ var init_use_blinking_cursor = __esm({
|
|
|
32454
32477
|
import { useState as useState29 } from "react";
|
|
32455
32478
|
import { Box as Box42, Text as Text44 } from "ink";
|
|
32456
32479
|
import { readdirSync as readdirSync4 } from "node:fs";
|
|
32457
|
-
import { dirname as
|
|
32480
|
+
import { dirname as dirname18, basename as basename7, join as join24 } from "node:path";
|
|
32458
32481
|
import { jsx as jsx52, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
32459
32482
|
function autocomplete(partial) {
|
|
32460
32483
|
if (!partial) return null;
|
|
32461
32484
|
const normalized = normalizePath(partial);
|
|
32462
|
-
const dir =
|
|
32485
|
+
const dir = dirname18(normalized);
|
|
32463
32486
|
const base = basename7(normalized);
|
|
32464
32487
|
let entries;
|
|
32465
32488
|
try {
|
|
@@ -36113,7 +36136,7 @@ init_config();
|
|
|
36113
36136
|
init_package_root();
|
|
36114
36137
|
import { existsSync as existsSync12 } from "node:fs";
|
|
36115
36138
|
import { mkdir as mkdir10, readFile as readFile22, rename as rename3, rmdir as rmdir2, unlink } from "node:fs/promises";
|
|
36116
|
-
import { dirname as
|
|
36139
|
+
import { dirname as dirname19, join as join29 } from "node:path";
|
|
36117
36140
|
var PACKAGE_NAME3 = "@contentful/experience-design-system-cli";
|
|
36118
36141
|
async function readJson(path5) {
|
|
36119
36142
|
try {
|
|
@@ -36139,7 +36162,7 @@ async function migrateOldConfig() {
|
|
|
36139
36162
|
if (Object.keys(migrated).length > 0) await updateSettings2({ ...migrated, ...await readSettings2() });
|
|
36140
36163
|
if (existsSync12(oldRuns)) {
|
|
36141
36164
|
if (!existsSync12(runsFilePath2())) {
|
|
36142
|
-
await mkdir10(
|
|
36165
|
+
await mkdir10(dirname19(runsFilePath2()), { recursive: true });
|
|
36143
36166
|
await rename3(oldRuns, runsFilePath2());
|
|
36144
36167
|
} else {
|
|
36145
36168
|
await unlink(oldRuns);
|
package/dist/package.json
CHANGED
|
@@ -2,6 +2,8 @@ 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;
|
|
5
7
|
}
|
|
6
8
|
export declare function useErrorControls(handlers: ErrorHandlers): void;
|
|
7
9
|
export {};
|
|
@@ -2,10 +2,11 @@ interface Key {
|
|
|
2
2
|
return: boolean;
|
|
3
3
|
escape: boolean;
|
|
4
4
|
}
|
|
5
|
-
export type ErrorAction = 'exit' | 'retry' | 'acknowledge' | null;
|
|
5
|
+
export type ErrorAction = 'exit' | 'retry' | 'acknowledge' | 'open' | null;
|
|
6
6
|
interface Available {
|
|
7
7
|
canRetry: boolean;
|
|
8
8
|
canAcknowledge: boolean;
|
|
9
|
+
canOpen: boolean;
|
|
9
10
|
}
|
|
10
11
|
export declare function errorAction(input: string, key: Key, available: Available): ErrorAction;
|
|
11
12
|
export declare function errorControls(available: Available): {
|
|
@@ -19,5 +19,7 @@ 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;
|
|
22
24
|
/** What the error screen says about the logs, in one short instruction. */
|
|
23
25
|
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-
|
|
3
|
+
"version": "2.42.1-dev-build-c7f654e2.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-
|
|
48
|
+
"@contentful/experience-design-system-types": "2.42.1-dev-build-c7f654e2.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-
|
|
62
|
+
"@contentful/experience-design-system-backend-pipeline": "2.42.1-dev-build-c7f654e2.0"
|
|
63
63
|
},
|
|
64
64
|
"repository": {
|
|
65
65
|
"type": "git",
|