@contentful/experience-design-system-cli 2.34.1-dev-build-e12e553.0 → 2.34.1-dev-build-1576344.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/package.json +1 -1
- package/dist/src/index.js +31 -42
- package/dist/src/lib/cli-errors.d.ts +10 -0
- package/package.json +6 -6
package/dist/package.json
CHANGED
package/dist/src/index.js
CHANGED
|
@@ -22,6 +22,7 @@ var init_agent_names = __esm({
|
|
|
22
22
|
});
|
|
23
23
|
|
|
24
24
|
// packages/experience-design-system-generation/dist/src/lib/binary-launch.js
|
|
25
|
+
import { spawn } from "node:child_process";
|
|
25
26
|
import { accessSync, constants } from "node:fs";
|
|
26
27
|
import { delimiter, isAbsolute, join } from "node:path";
|
|
27
28
|
function executableExtensions(platform) {
|
|
@@ -78,6 +79,13 @@ function resolveSpawn(binary, args, platform = process.platform) {
|
|
|
78
79
|
return null;
|
|
79
80
|
return spawnSpec(resolved, args, platform);
|
|
80
81
|
}
|
|
82
|
+
function spawnBinary(command, args, options = {}) {
|
|
83
|
+
const launch = resolveSpawn(command, args) ?? { command, args };
|
|
84
|
+
return spawn(launch.command, launch.args, {
|
|
85
|
+
...options,
|
|
86
|
+
...launch.windowsVerbatimArguments ? { windowsVerbatimArguments: true } : {}
|
|
87
|
+
});
|
|
88
|
+
}
|
|
81
89
|
var init_binary_launch = __esm({
|
|
82
90
|
"packages/experience-design-system-generation/dist/src/lib/binary-launch.js"() {
|
|
83
91
|
"use strict";
|
|
@@ -85,7 +93,6 @@ var init_binary_launch = __esm({
|
|
|
85
93
|
});
|
|
86
94
|
|
|
87
95
|
// packages/experience-design-system-generation/dist/src/agent-runner.js
|
|
88
|
-
import { spawn } from "node:child_process";
|
|
89
96
|
function findJsonObjectEnd(line) {
|
|
90
97
|
let depth = 0;
|
|
91
98
|
let inString = false;
|
|
@@ -412,10 +419,8 @@ async function runAgent(options) {
|
|
|
412
419
|
});
|
|
413
420
|
return new Promise((resolve29) => {
|
|
414
421
|
const bedrockEnv = bedrock ? BEDROCK_ENV_BY_AGENT[agent] : void 0;
|
|
415
|
-
const
|
|
416
|
-
const child = spawn(launch.command, launch.args, {
|
|
422
|
+
const child = spawnBinary(binary, args, {
|
|
417
423
|
stdio: ["pipe", "pipe", "pipe"],
|
|
418
|
-
...launch.windowsVerbatimArguments ? { windowsVerbatimArguments: true } : {},
|
|
419
424
|
...bedrockEnv ? { env: { ...process.env, ...bedrockEnv } } : {}
|
|
420
425
|
});
|
|
421
426
|
if (useStdin2 && child.stdin) {
|
|
@@ -473,10 +478,8 @@ async function checkAgentAuth(agent) {
|
|
|
473
478
|
if (agent !== "claude")
|
|
474
479
|
return "ok";
|
|
475
480
|
return new Promise((resolve29) => {
|
|
476
|
-
const
|
|
477
|
-
|
|
478
|
-
stdio: ["ignore", "pipe", "pipe"],
|
|
479
|
-
...launch.windowsVerbatimArguments ? { windowsVerbatimArguments: true } : {}
|
|
481
|
+
const child = spawnBinary(resolvedBinary, ["auth", "status", "--json"], {
|
|
482
|
+
stdio: ["ignore", "pipe", "pipe"]
|
|
480
483
|
});
|
|
481
484
|
let stdout = "";
|
|
482
485
|
let done = false;
|
|
@@ -986,10 +989,9 @@ __export(src_exports, {
|
|
|
986
989
|
resolveAgentModel: () => resolveAgentModel,
|
|
987
990
|
resolveBinary: () => resolveBinary,
|
|
988
991
|
resolveSkillPath: () => resolveSkillPath,
|
|
989
|
-
resolveSpawn: () => resolveSpawn,
|
|
990
992
|
runAgent: () => runAgent,
|
|
991
993
|
shouldUseStdinPrompt: () => shouldUseStdinPrompt,
|
|
992
|
-
|
|
994
|
+
spawnBinary: () => spawnBinary
|
|
993
995
|
});
|
|
994
996
|
var init_src = __esm({
|
|
995
997
|
"packages/experience-design-system-generation/dist/src/index.js"() {
|
|
@@ -30194,7 +30196,6 @@ var init_push_creds_prompt = __esm({
|
|
|
30194
30196
|
});
|
|
30195
30197
|
|
|
30196
30198
|
// packages/experience-design-system-cli/src/program.ts
|
|
30197
|
-
import { spawn as spawn6 } from "node:child_process";
|
|
30198
30199
|
import { fileURLToPath as fileURLToPath5 } from "node:url";
|
|
30199
30200
|
import { dirname as dirname15, join as join30, resolve as resolve28 } from "node:path";
|
|
30200
30201
|
import { readFileSync as readFileSync10 } from "node:fs";
|
|
@@ -32895,6 +32896,17 @@ function die2(message) {
|
|
|
32895
32896
|
async function assertBinaryInPath(binary) {
|
|
32896
32897
|
return binaryExists(binary);
|
|
32897
32898
|
}
|
|
32899
|
+
function assertAgentCanReceivePrompt(agent) {
|
|
32900
|
+
if (process.platform !== "win32" || agentSupportsStdinPrompt(agent)) return;
|
|
32901
|
+
die2(
|
|
32902
|
+
`Error: --agent ${agent} does not work on Windows.
|
|
32903
|
+
Its CLI only accepts the prompt as a command-line argument, and Windows limits a command
|
|
32904
|
+
line to 8191 characters \u2014 shorter than the prompts this command sends.
|
|
32905
|
+
|
|
32906
|
+
Every other agent reads the prompt from standard input, so they are unaffected.
|
|
32907
|
+
Use --agent claude, codex, opencode, or cursor.`
|
|
32908
|
+
);
|
|
32909
|
+
}
|
|
32898
32910
|
|
|
32899
32911
|
// packages/experience-design-system-cli/src/generate/command.ts
|
|
32900
32912
|
init_path_exists();
|
|
@@ -33299,15 +33311,7 @@ async function runGenerateSkill(skill, opts, verbose = false) {
|
|
|
33299
33311
|
});
|
|
33300
33312
|
await exitWithAnalytics(1);
|
|
33301
33313
|
}
|
|
33302
|
-
|
|
33303
|
-
die2(
|
|
33304
|
-
`Error: --agent ${agent} does not work on Windows.
|
|
33305
|
-
Its CLI only accepts the prompt as a command-line argument, and Windows limits a command
|
|
33306
|
-
line to 8191 characters \u2014 shorter than the prompts this command sends.
|
|
33307
|
-
|
|
33308
|
-
Every other agent works on Windows. Use --agent claude, codex, opencode, or cursor.`
|
|
33309
|
-
);
|
|
33310
|
-
}
|
|
33314
|
+
assertAgentCanReceivePrompt(agent);
|
|
33311
33315
|
if (skill === "components" && allComponents && sessionId2) {
|
|
33312
33316
|
const db = openPipelineDb();
|
|
33313
33317
|
let componentResults;
|
|
@@ -34837,15 +34841,7 @@ Install it, choose another agent with --agent, or use --print-prompt to run the
|
|
|
34837
34841
|
${resolveSkillPath("map-tokens")}`
|
|
34838
34842
|
);
|
|
34839
34843
|
}
|
|
34840
|
-
|
|
34841
|
-
die2(
|
|
34842
|
-
`Error: --agent ${agent} does not work on Windows.
|
|
34843
|
-
Its CLI only accepts the prompt as a command-line argument, and Windows limits a command
|
|
34844
|
-
line to 8191 characters \u2014 shorter than the prompts this command sends.
|
|
34845
|
-
|
|
34846
|
-
Every other agent works on Windows. Use --agent claude, codex, opencode, or cursor.`
|
|
34847
|
-
);
|
|
34848
|
-
}
|
|
34844
|
+
assertAgentCanReceivePrompt(agent);
|
|
34849
34845
|
const stepId = createStep(db, sessionId2, "map tokens", { agent, model: model ?? "" });
|
|
34850
34846
|
const prompt2 = await buildPrompt({
|
|
34851
34847
|
skill: "map-tokens",
|
|
@@ -36394,7 +36390,6 @@ function registerImportCommand(program) {
|
|
|
36394
36390
|
|
|
36395
36391
|
// packages/experience-design-system-cli/src/setup/command.ts
|
|
36396
36392
|
init_credentials_store();
|
|
36397
|
-
import { spawn as spawn5 } from "node:child_process";
|
|
36398
36393
|
import { appendFile as appendFile2, readFile as readFile26, access as access9 } from "node:fs/promises";
|
|
36399
36394
|
import { join as join29 } from "node:path";
|
|
36400
36395
|
import { homedir as homedir9 } from "node:os";
|
|
@@ -36522,12 +36517,10 @@ async function binaryExists2(name) {
|
|
|
36522
36517
|
}
|
|
36523
36518
|
function runSpawn(cmd, args, opts = {}) {
|
|
36524
36519
|
return new Promise((resolve29) => {
|
|
36525
|
-
const
|
|
36526
|
-
const child = spawn5(launch.command, launch.args, {
|
|
36520
|
+
const child = spawnBinary(cmd, args, {
|
|
36527
36521
|
cwd: opts.cwd,
|
|
36528
36522
|
env: opts.env ?? process.env,
|
|
36529
|
-
stdio: ["ignore", "pipe", "pipe"]
|
|
36530
|
-
...launch.windowsVerbatimArguments ? { windowsVerbatimArguments: true } : {}
|
|
36523
|
+
stdio: ["ignore", "pipe", "pipe"]
|
|
36531
36524
|
});
|
|
36532
36525
|
let settled = false;
|
|
36533
36526
|
let stdout = "";
|
|
@@ -36538,10 +36531,10 @@ function runSpawn(cmd, args, opts = {}) {
|
|
|
36538
36531
|
resolve29({ exitCode: 1, stdout: "", stderr: err.message });
|
|
36539
36532
|
}
|
|
36540
36533
|
});
|
|
36541
|
-
child.stdout
|
|
36534
|
+
child.stdout?.on("data", (d) => {
|
|
36542
36535
|
stdout += String(d);
|
|
36543
36536
|
});
|
|
36544
|
-
child.stderr
|
|
36537
|
+
child.stderr?.on("data", (d) => {
|
|
36545
36538
|
stderr += String(d);
|
|
36546
36539
|
});
|
|
36547
36540
|
child.on("exit", (code) => {
|
|
@@ -37489,13 +37482,9 @@ function registerBuildCommand(program) {
|
|
|
37489
37482
|
program.command("build").description("Rebuild from source and re-link exo/experiences binaries to this build").action(async () => {
|
|
37490
37483
|
const pkgRoot = resolve28(dirname15(fileURLToPath5(import.meta.url)), "..", "..");
|
|
37491
37484
|
process.stderr.write("\u2699 Building from source...\n");
|
|
37492
|
-
const launch = resolveSpawn("pnpm", ["build"]) ?? { command: "pnpm", args: ["build"] };
|
|
37493
37485
|
const { exitCode } = await runBuild({
|
|
37494
|
-
|
|
37495
|
-
|
|
37496
|
-
stdio: "inherit",
|
|
37497
|
-
...launch.windowsVerbatimArguments ? { windowsVerbatimArguments: true } : {}
|
|
37498
|
-
}),
|
|
37486
|
+
// spawnBinary: pnpm is a `.cmd` shim on Windows.
|
|
37487
|
+
spawnFn: () => spawnBinary("pnpm", ["build"], { cwd: pkgRoot, stdio: "inherit" }),
|
|
37499
37488
|
stderrWrite: (s) => process.stderr.write(s)
|
|
37500
37489
|
});
|
|
37501
37490
|
process.exit(exitCode);
|
|
@@ -1,2 +1,12 @@
|
|
|
1
|
+
import { type AgentName } from '@contentful/experience-design-system-generation';
|
|
1
2
|
export declare function die(message: string): never;
|
|
2
3
|
export declare function assertBinaryInPath(binary: string): Promise<boolean>;
|
|
4
|
+
/**
|
|
5
|
+
* Exit early when the chosen agent can't receive a prompt on this platform.
|
|
6
|
+
*
|
|
7
|
+
* Windows limits a command line to 8191 characters and every skill prompt is
|
|
8
|
+
* larger, so an agent that can only take the prompt as an argument has no way to
|
|
9
|
+
* receive one. Every agent but copilot reads the prompt on stdin instead, where
|
|
10
|
+
* no limit applies.
|
|
11
|
+
*/
|
|
12
|
+
export declare function assertAgentCanReceivePrompt(agent: AgentName): void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentful/experience-design-system-cli",
|
|
3
|
-
"version": "2.34.1-dev-build-
|
|
3
|
+
"version": "2.34.1-dev-build-1576344.0",
|
|
4
4
|
"description": "Contentful Experiences design system import CLI",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
"svelte": "^5.56.4",
|
|
40
40
|
"ts-morph": "^27.0.2",
|
|
41
41
|
"typescript": "^5.9.3",
|
|
42
|
-
"@contentful/experience-design-system-cli-v2": "2.34.1-dev-build-
|
|
43
|
-
"@contentful/experience-design-system-types": "2.34.1-dev-build-
|
|
42
|
+
"@contentful/experience-design-system-cli-v2": "2.34.1-dev-build-1576344.0",
|
|
43
|
+
"@contentful/experience-design-system-types": "2.34.1-dev-build-1576344.0"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@tsconfig/node24": "^24.0.4",
|
|
@@ -52,9 +52,9 @@
|
|
|
52
52
|
"ink-testing-library": "^4.0.0",
|
|
53
53
|
"typescript-eslint": "^8.67.0",
|
|
54
54
|
"vitest": "^4.0.16",
|
|
55
|
-
"@contentful/experience-design-system-
|
|
56
|
-
"@contentful/experience-design-system-
|
|
57
|
-
"@contentful/experience-design-system-generation": "2.34.1-dev-build-
|
|
55
|
+
"@contentful/experience-design-system-extraction": "2.34.1-dev-build-1576344.0",
|
|
56
|
+
"@contentful/experience-design-system-client": "2.34.1-dev-build-1576344.0",
|
|
57
|
+
"@contentful/experience-design-system-generation": "2.34.1-dev-build-1576344.0"
|
|
58
58
|
},
|
|
59
59
|
"repository": {
|
|
60
60
|
"type": "git",
|