@contentful/experience-design-system-cli 2.37.1-dev-build-8a9493aa.0 → 2.37.1-dev-build-c5c89a0c.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 +1239 -365
- package/dist/index.js +1366 -381
- package/dist/package.json +1 -1
- package/dist/src/tui/shared/components/FieldForm.d.ts +4 -2
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1484,6 +1484,16 @@ var init_parse_map_token_prop_tool_calls = __esm({
|
|
|
1484
1484
|
|
|
1485
1485
|
// packages/experience-design-system-backend-pipeline/dist/src/agents/services/run-agent.js
|
|
1486
1486
|
import { spawn } from "node:child_process";
|
|
1487
|
+
function killProcessTree(pid, signal) {
|
|
1488
|
+
try {
|
|
1489
|
+
process.kill(-pid, signal);
|
|
1490
|
+
} catch {
|
|
1491
|
+
try {
|
|
1492
|
+
process.kill(pid, signal);
|
|
1493
|
+
} catch {
|
|
1494
|
+
}
|
|
1495
|
+
}
|
|
1496
|
+
}
|
|
1487
1497
|
async function runAgent(options) {
|
|
1488
1498
|
const { agent, prompt, timeoutMs, model, onOutput, promptViaStdin, onDebugEvent } = options;
|
|
1489
1499
|
const bedrock = options.bedrock ?? process.env.EDS_BEDROCK === "1";
|
|
@@ -1500,10 +1510,11 @@ async function runAgent(options) {
|
|
|
1500
1510
|
promptLen: prompt.length,
|
|
1501
1511
|
promptHead: prompt.slice(0, 500)
|
|
1502
1512
|
});
|
|
1503
|
-
return new Promise((
|
|
1513
|
+
return new Promise((resolve29) => {
|
|
1504
1514
|
const bedrockEnv = bedrock ? BEDROCK_ENV_BY_AGENT[agent] : void 0;
|
|
1505
1515
|
const child = spawn(binary, args, {
|
|
1506
1516
|
stdio: ["pipe", "pipe", "pipe"],
|
|
1517
|
+
detached: true,
|
|
1507
1518
|
...bedrockEnv ? { env: { ...process.env, ...bedrockEnv } } : {}
|
|
1508
1519
|
});
|
|
1509
1520
|
if (useStdin2 && child.stdin) {
|
|
@@ -1515,50 +1526,87 @@ async function runAgent(options) {
|
|
|
1515
1526
|
} else {
|
|
1516
1527
|
child.stdin?.end();
|
|
1517
1528
|
}
|
|
1518
|
-
|
|
1519
|
-
|
|
1529
|
+
const stdoutChunks = [];
|
|
1530
|
+
const stderrChunks = [];
|
|
1520
1531
|
let timedOut = false;
|
|
1521
|
-
|
|
1532
|
+
let settled = false;
|
|
1533
|
+
const pid = child.pid;
|
|
1534
|
+
const settle = (result) => {
|
|
1535
|
+
if (settled)
|
|
1536
|
+
return;
|
|
1537
|
+
settled = true;
|
|
1538
|
+
clearTimeout(softTimer);
|
|
1539
|
+
clearTimeout(hardTimer);
|
|
1540
|
+
onDebugEvent?.("run.end", {
|
|
1541
|
+
agent,
|
|
1542
|
+
model,
|
|
1543
|
+
durationMs: Date.now() - startedAt,
|
|
1544
|
+
exitCode: result.exitCode,
|
|
1545
|
+
timedOut: result.timedOut,
|
|
1546
|
+
stdoutLen: result.stdout.length,
|
|
1547
|
+
stderrLen: result.stderr.length,
|
|
1548
|
+
stderrTail: result.stderr.slice(-1e3)
|
|
1549
|
+
});
|
|
1550
|
+
resolve29(result);
|
|
1551
|
+
};
|
|
1552
|
+
const softTimer = setTimeout(() => {
|
|
1522
1553
|
timedOut = true;
|
|
1523
|
-
|
|
1554
|
+
if (pid)
|
|
1555
|
+
killProcessTree(pid, "SIGTERM");
|
|
1524
1556
|
}, timeoutMs);
|
|
1557
|
+
const hardTimer = setTimeout(() => {
|
|
1558
|
+
if (settled)
|
|
1559
|
+
return;
|
|
1560
|
+
if (pid)
|
|
1561
|
+
killProcessTree(pid, "SIGKILL");
|
|
1562
|
+
try {
|
|
1563
|
+
child.stdout?.destroy();
|
|
1564
|
+
child.stderr?.destroy();
|
|
1565
|
+
child.stdin?.destroy();
|
|
1566
|
+
} catch {
|
|
1567
|
+
}
|
|
1568
|
+
settle({
|
|
1569
|
+
exitCode: 1,
|
|
1570
|
+
stdout: Buffer.concat(stdoutChunks).toString("utf8"),
|
|
1571
|
+
stderr: Buffer.concat(stderrChunks).toString("utf8"),
|
|
1572
|
+
timedOut: true
|
|
1573
|
+
});
|
|
1574
|
+
}, timeoutMs + WATCHDOG_GRACE_MS);
|
|
1525
1575
|
child.stdout?.on("data", (chunk) => {
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1576
|
+
stdoutChunks.push(chunk);
|
|
1577
|
+
if (onOutput)
|
|
1578
|
+
onOutput(chunk.toString("utf8"));
|
|
1529
1579
|
});
|
|
1530
1580
|
child.stderr?.on("data", (chunk) => {
|
|
1531
|
-
|
|
1581
|
+
stderrChunks.push(chunk);
|
|
1582
|
+
});
|
|
1583
|
+
child.on("error", (err) => {
|
|
1584
|
+
settle({
|
|
1585
|
+
exitCode: 1,
|
|
1586
|
+
stdout: Buffer.concat(stdoutChunks).toString("utf8"),
|
|
1587
|
+
stderr: `${err instanceof Error ? err.message : String(err)}
|
|
1588
|
+
${Buffer.concat(stderrChunks).toString("utf8")}`,
|
|
1589
|
+
timedOut
|
|
1590
|
+
});
|
|
1532
1591
|
});
|
|
1533
1592
|
child.on("close", (code, signal) => {
|
|
1534
|
-
|
|
1535
|
-
const result = {
|
|
1593
|
+
settle({
|
|
1536
1594
|
exitCode: signal ? 1 : code ?? 1,
|
|
1537
|
-
stdout,
|
|
1538
|
-
stderr,
|
|
1595
|
+
stdout: Buffer.concat(stdoutChunks).toString("utf8"),
|
|
1596
|
+
stderr: Buffer.concat(stderrChunks).toString("utf8"),
|
|
1539
1597
|
timedOut
|
|
1540
|
-
};
|
|
1541
|
-
onDebugEvent?.("run.end", {
|
|
1542
|
-
agent,
|
|
1543
|
-
model,
|
|
1544
|
-
durationMs: Date.now() - startedAt,
|
|
1545
|
-
exitCode: result.exitCode,
|
|
1546
|
-
signal,
|
|
1547
|
-
timedOut,
|
|
1548
|
-
stdoutLen: stdout.length,
|
|
1549
|
-
stderrLen: stderr.length,
|
|
1550
|
-
stderrTail: stderr.slice(-1e3)
|
|
1551
1598
|
});
|
|
1552
|
-
resolve28(result);
|
|
1553
1599
|
});
|
|
1554
1600
|
});
|
|
1555
1601
|
}
|
|
1602
|
+
var WATCHDOG_GRACE_MS;
|
|
1556
1603
|
var init_run_agent = __esm({
|
|
1557
1604
|
"packages/experience-design-system-backend-pipeline/dist/src/agents/services/run-agent.js"() {
|
|
1558
1605
|
"use strict";
|
|
1559
1606
|
init_bedrock();
|
|
1560
1607
|
init_build_agent_args();
|
|
1561
1608
|
init_resolve_binary();
|
|
1609
|
+
WATCHDOG_GRACE_MS = 10 * 1e3;
|
|
1562
1610
|
}
|
|
1563
1611
|
});
|
|
1564
1612
|
|
|
@@ -1571,7 +1619,7 @@ async function checkAgentAuth(agent) {
|
|
|
1571
1619
|
return "not-found";
|
|
1572
1620
|
if (agent !== "claude")
|
|
1573
1621
|
return "ok";
|
|
1574
|
-
return new Promise((
|
|
1622
|
+
return new Promise((resolve29) => {
|
|
1575
1623
|
const child = spawn2(binary, ["auth", "status", "--json"], { stdio: ["ignore", "pipe", "pipe"] });
|
|
1576
1624
|
let stdout = "";
|
|
1577
1625
|
let done = false;
|
|
@@ -1580,7 +1628,7 @@ async function checkAgentAuth(agent) {
|
|
|
1580
1628
|
return;
|
|
1581
1629
|
done = true;
|
|
1582
1630
|
child.kill("SIGTERM");
|
|
1583
|
-
|
|
1631
|
+
resolve29("unauthenticated");
|
|
1584
1632
|
}, 5e3);
|
|
1585
1633
|
child.stdout?.on("data", (chunk) => {
|
|
1586
1634
|
stdout += chunk.toString();
|
|
@@ -1591,14 +1639,14 @@ async function checkAgentAuth(agent) {
|
|
|
1591
1639
|
done = true;
|
|
1592
1640
|
clearTimeout(timer);
|
|
1593
1641
|
if (code !== 0) {
|
|
1594
|
-
|
|
1642
|
+
resolve29("unauthenticated");
|
|
1595
1643
|
return;
|
|
1596
1644
|
}
|
|
1597
1645
|
try {
|
|
1598
1646
|
const status = JSON.parse(stdout);
|
|
1599
|
-
|
|
1647
|
+
resolve29(status.loggedIn ? "ok" : "unauthenticated");
|
|
1600
1648
|
} catch {
|
|
1601
|
-
|
|
1649
|
+
resolve29("unauthenticated");
|
|
1602
1650
|
}
|
|
1603
1651
|
});
|
|
1604
1652
|
});
|
|
@@ -1608,9 +1656,9 @@ async function binaryIsOnPath(binary) {
|
|
|
1608
1656
|
const fs = await import("node:fs/promises");
|
|
1609
1657
|
return fs.access(binary).then(() => true, () => false);
|
|
1610
1658
|
}
|
|
1611
|
-
return new Promise((
|
|
1659
|
+
return new Promise((resolve29) => {
|
|
1612
1660
|
const child = spawn2(process.platform === "win32" ? "where" : "which", [binary], { stdio: "ignore" });
|
|
1613
|
-
child.on("close", (code) =>
|
|
1661
|
+
child.on("close", (code) => resolve29(code === 0));
|
|
1614
1662
|
});
|
|
1615
1663
|
}
|
|
1616
1664
|
var init_check_agent_auth = __esm({
|
|
@@ -2247,7 +2295,8 @@ var init_infer_fence_lang = __esm({
|
|
|
2247
2295
|
sass: "scss",
|
|
2248
2296
|
css: "css",
|
|
2249
2297
|
json: "json",
|
|
2250
|
-
json5: "json"
|
|
2298
|
+
json5: "json",
|
|
2299
|
+
html: "html"
|
|
2251
2300
|
};
|
|
2252
2301
|
}
|
|
2253
2302
|
});
|
|
@@ -10986,6 +11035,797 @@ var init_extract_svelte_components = __esm({
|
|
|
10986
11035
|
}
|
|
10987
11036
|
});
|
|
10988
11037
|
|
|
11038
|
+
// packages/experience-design-system-backend-pipeline/dist/src/steps/extraction/src/framework-adapters/angular/helpers/find-component-decorator.js
|
|
11039
|
+
import { Node as Node10 } from "ts-morph";
|
|
11040
|
+
function resolveToObjectLiteral(expr, depth = 0) {
|
|
11041
|
+
if (!expr || depth > 3)
|
|
11042
|
+
return null;
|
|
11043
|
+
if (Node10.isObjectLiteralExpression(expr))
|
|
11044
|
+
return expr;
|
|
11045
|
+
if (Node10.isIdentifier(expr)) {
|
|
11046
|
+
const defs = expr.getDefinitions();
|
|
11047
|
+
for (const def of defs) {
|
|
11048
|
+
const node = def.getDeclarationNode();
|
|
11049
|
+
if (node && Node10.isVariableDeclaration(node)) {
|
|
11050
|
+
const init = node.getInitializer();
|
|
11051
|
+
const resolved = resolveToObjectLiteral(init, depth + 1);
|
|
11052
|
+
if (resolved)
|
|
11053
|
+
return resolved;
|
|
11054
|
+
}
|
|
11055
|
+
}
|
|
11056
|
+
}
|
|
11057
|
+
return null;
|
|
11058
|
+
}
|
|
11059
|
+
function findComponentDecorator(cls) {
|
|
11060
|
+
const decorator = cls.getDecorator("Component");
|
|
11061
|
+
if (!decorator)
|
|
11062
|
+
return null;
|
|
11063
|
+
const [arg] = decorator.getArguments();
|
|
11064
|
+
return resolveToObjectLiteral(arg);
|
|
11065
|
+
}
|
|
11066
|
+
function hasComponentDecorator(cls) {
|
|
11067
|
+
return cls.getDecorator("Component") !== void 0;
|
|
11068
|
+
}
|
|
11069
|
+
var init_find_component_decorator = __esm({
|
|
11070
|
+
"packages/experience-design-system-backend-pipeline/dist/src/steps/extraction/src/framework-adapters/angular/helpers/find-component-decorator.js"() {
|
|
11071
|
+
"use strict";
|
|
11072
|
+
}
|
|
11073
|
+
});
|
|
11074
|
+
|
|
11075
|
+
// packages/experience-design-system-backend-pipeline/dist/src/steps/extraction/src/framework-adapters/angular/helpers/props/resolve-prop-type.js
|
|
11076
|
+
import { Node as Node11 } from "ts-morph";
|
|
11077
|
+
function resolvePropType(typeNode) {
|
|
11078
|
+
if (!typeNode) {
|
|
11079
|
+
return { text: "any", allowedValues: null, isTemplateRef: false };
|
|
11080
|
+
}
|
|
11081
|
+
const text = typeNode.getText();
|
|
11082
|
+
const members = extractStringLiteralUnion(typeNode);
|
|
11083
|
+
const isTemplateRef = containsTemplateRef(typeNode);
|
|
11084
|
+
return {
|
|
11085
|
+
text,
|
|
11086
|
+
allowedValues: members.length > 0 ? members : null,
|
|
11087
|
+
isTemplateRef
|
|
11088
|
+
};
|
|
11089
|
+
}
|
|
11090
|
+
function extractStringLiteralUnion(typeNode) {
|
|
11091
|
+
if (Node11.isLiteralTypeNode(typeNode)) {
|
|
11092
|
+
const lit = typeNode.getLiteral();
|
|
11093
|
+
if (Node11.isStringLiteral(lit) || Node11.isNoSubstitutionTemplateLiteral(lit)) {
|
|
11094
|
+
return [lit.getLiteralText()];
|
|
11095
|
+
}
|
|
11096
|
+
return [];
|
|
11097
|
+
}
|
|
11098
|
+
if (Node11.isUnionTypeNode(typeNode)) {
|
|
11099
|
+
const out = [];
|
|
11100
|
+
for (const member of typeNode.getTypeNodes()) {
|
|
11101
|
+
const sub = extractStringLiteralUnion(member);
|
|
11102
|
+
if (sub.length === 0 && !isNullOrUndefinedLiteral(member)) {
|
|
11103
|
+
return [];
|
|
11104
|
+
}
|
|
11105
|
+
out.push(...sub);
|
|
11106
|
+
}
|
|
11107
|
+
return out;
|
|
11108
|
+
}
|
|
11109
|
+
return [];
|
|
11110
|
+
}
|
|
11111
|
+
function isNullOrUndefinedLiteral(typeNode) {
|
|
11112
|
+
if (Node11.isLiteralTypeNode(typeNode)) {
|
|
11113
|
+
const lit = typeNode.getLiteral();
|
|
11114
|
+
if (Node11.isNullLiteral(lit))
|
|
11115
|
+
return true;
|
|
11116
|
+
}
|
|
11117
|
+
const t = typeNode.getText();
|
|
11118
|
+
return t === "null" || t === "undefined";
|
|
11119
|
+
}
|
|
11120
|
+
function containsTemplateRef(typeNode) {
|
|
11121
|
+
const text = typeNode.getText();
|
|
11122
|
+
return /\bTemplateRef\b/.test(text);
|
|
11123
|
+
}
|
|
11124
|
+
var init_resolve_prop_type = __esm({
|
|
11125
|
+
"packages/experience-design-system-backend-pipeline/dist/src/steps/extraction/src/framework-adapters/angular/helpers/props/resolve-prop-type.js"() {
|
|
11126
|
+
"use strict";
|
|
11127
|
+
}
|
|
11128
|
+
});
|
|
11129
|
+
|
|
11130
|
+
// packages/experience-design-system-backend-pipeline/dist/src/steps/extraction/src/framework-adapters/angular/helpers/props/extract-decorator-input.js
|
|
11131
|
+
import { Node as Node12 } from "ts-morph";
|
|
11132
|
+
function extractDecoratorInput(field) {
|
|
11133
|
+
const decorator = field.getDecorator("Input");
|
|
11134
|
+
if (!decorator)
|
|
11135
|
+
return null;
|
|
11136
|
+
const fieldName = field.getName();
|
|
11137
|
+
const args = decorator.getArguments();
|
|
11138
|
+
let alias = null;
|
|
11139
|
+
let required = false;
|
|
11140
|
+
let transformIsBoolean = false;
|
|
11141
|
+
let transformIsNumber = false;
|
|
11142
|
+
if (args.length === 1) {
|
|
11143
|
+
const arg = args[0];
|
|
11144
|
+
if (Node12.isStringLiteral(arg) || Node12.isNoSubstitutionTemplateLiteral(arg)) {
|
|
11145
|
+
alias = arg.getLiteralText();
|
|
11146
|
+
} else if (Node12.isObjectLiteralExpression(arg)) {
|
|
11147
|
+
const aliasProp = arg.getProperty("alias");
|
|
11148
|
+
if (aliasProp && Node12.isPropertyAssignment(aliasProp)) {
|
|
11149
|
+
const init = aliasProp.getInitializer();
|
|
11150
|
+
if (init && (Node12.isStringLiteral(init) || Node12.isNoSubstitutionTemplateLiteral(init))) {
|
|
11151
|
+
alias = init.getLiteralText();
|
|
11152
|
+
}
|
|
11153
|
+
}
|
|
11154
|
+
const requiredProp = arg.getProperty("required");
|
|
11155
|
+
if (requiredProp && Node12.isPropertyAssignment(requiredProp)) {
|
|
11156
|
+
const init = requiredProp.getInitializer();
|
|
11157
|
+
if (init?.getText() === "true")
|
|
11158
|
+
required = true;
|
|
11159
|
+
}
|
|
11160
|
+
const transformProp = arg.getProperty("transform");
|
|
11161
|
+
if (transformProp && Node12.isPropertyAssignment(transformProp)) {
|
|
11162
|
+
const transformText = transformProp.getInitializer()?.getText() ?? "";
|
|
11163
|
+
if (/\bbooleanAttribute\b/.test(transformText))
|
|
11164
|
+
transformIsBoolean = true;
|
|
11165
|
+
if (/\bnumberAttribute\b/.test(transformText))
|
|
11166
|
+
transformIsNumber = true;
|
|
11167
|
+
}
|
|
11168
|
+
}
|
|
11169
|
+
}
|
|
11170
|
+
let typeNode;
|
|
11171
|
+
let defaultValue;
|
|
11172
|
+
if (Node12.isSetAccessorDeclaration(field)) {
|
|
11173
|
+
const param = field.getParameters()[0];
|
|
11174
|
+
typeNode = param?.getTypeNode();
|
|
11175
|
+
} else if (Node12.isGetAccessorDeclaration(field)) {
|
|
11176
|
+
const parent = field.getParent();
|
|
11177
|
+
const companionSetter = parent && Node12.isClassDeclaration(parent) ? parent.getSetAccessor(fieldName) : void 0;
|
|
11178
|
+
if (companionSetter) {
|
|
11179
|
+
typeNode = companionSetter.getParameters()[0]?.getTypeNode();
|
|
11180
|
+
}
|
|
11181
|
+
if (!typeNode)
|
|
11182
|
+
typeNode = field.getReturnTypeNode();
|
|
11183
|
+
} else {
|
|
11184
|
+
typeNode = field.getTypeNode();
|
|
11185
|
+
const initializer = field.getInitializer();
|
|
11186
|
+
if (initializer)
|
|
11187
|
+
defaultValue = initializer.getText();
|
|
11188
|
+
}
|
|
11189
|
+
const resolved = resolvePropType(typeNode);
|
|
11190
|
+
const typeText = transformIsBoolean ? "boolean" : transformIsNumber ? "number" : resolved.text;
|
|
11191
|
+
const name = alias ?? fieldName;
|
|
11192
|
+
const prop = {
|
|
11193
|
+
name,
|
|
11194
|
+
type: typeText,
|
|
11195
|
+
required,
|
|
11196
|
+
sourceStartLine: field.getStartLineNumber(),
|
|
11197
|
+
sourceEndLine: field.getEndLineNumber()
|
|
11198
|
+
};
|
|
11199
|
+
if (defaultValue !== void 0)
|
|
11200
|
+
prop.defaultValue = defaultValue;
|
|
11201
|
+
if (resolved.allowedValues && !transformIsBoolean && !transformIsNumber) {
|
|
11202
|
+
prop.allowedValues = resolved.allowedValues;
|
|
11203
|
+
}
|
|
11204
|
+
return prop;
|
|
11205
|
+
}
|
|
11206
|
+
var init_extract_decorator_input = __esm({
|
|
11207
|
+
"packages/experience-design-system-backend-pipeline/dist/src/steps/extraction/src/framework-adapters/angular/helpers/props/extract-decorator-input.js"() {
|
|
11208
|
+
"use strict";
|
|
11209
|
+
init_resolve_prop_type();
|
|
11210
|
+
}
|
|
11211
|
+
});
|
|
11212
|
+
|
|
11213
|
+
// packages/experience-design-system-backend-pipeline/dist/src/steps/extraction/src/framework-adapters/angular/helpers/props/extract-signal-input.js
|
|
11214
|
+
import { Node as Node13 } from "ts-morph";
|
|
11215
|
+
function extractSignalInput(field) {
|
|
11216
|
+
const init = field.getInitializer();
|
|
11217
|
+
if (!init || !Node13.isCallExpression(init))
|
|
11218
|
+
return null;
|
|
11219
|
+
const callee = init.getExpression();
|
|
11220
|
+
let required = false;
|
|
11221
|
+
if (Node13.isIdentifier(callee)) {
|
|
11222
|
+
if (callee.getText() !== "input")
|
|
11223
|
+
return null;
|
|
11224
|
+
} else if (Node13.isPropertyAccessExpression(callee)) {
|
|
11225
|
+
const left = callee.getExpression();
|
|
11226
|
+
const right = callee.getName();
|
|
11227
|
+
if (!Node13.isIdentifier(left) || left.getText() !== "input" || right !== "required")
|
|
11228
|
+
return null;
|
|
11229
|
+
required = true;
|
|
11230
|
+
} else {
|
|
11231
|
+
return null;
|
|
11232
|
+
}
|
|
11233
|
+
const fieldName = field.getName();
|
|
11234
|
+
const args = init.getArguments();
|
|
11235
|
+
let defaultValue;
|
|
11236
|
+
let configArg;
|
|
11237
|
+
if (required) {
|
|
11238
|
+
configArg = args[0];
|
|
11239
|
+
} else {
|
|
11240
|
+
const first = args[0];
|
|
11241
|
+
if (first) {
|
|
11242
|
+
defaultValue = first.getText();
|
|
11243
|
+
configArg = args[1];
|
|
11244
|
+
}
|
|
11245
|
+
}
|
|
11246
|
+
let alias = null;
|
|
11247
|
+
let transformIsBoolean = false;
|
|
11248
|
+
let transformIsNumber = false;
|
|
11249
|
+
if (configArg && Node13.isObjectLiteralExpression(configArg)) {
|
|
11250
|
+
const aliasProp = configArg.getProperty("alias");
|
|
11251
|
+
if (aliasProp && Node13.isPropertyAssignment(aliasProp)) {
|
|
11252
|
+
const aliasInit = aliasProp.getInitializer();
|
|
11253
|
+
if (aliasInit && (Node13.isStringLiteral(aliasInit) || Node13.isNoSubstitutionTemplateLiteral(aliasInit))) {
|
|
11254
|
+
alias = aliasInit.getLiteralText();
|
|
11255
|
+
}
|
|
11256
|
+
}
|
|
11257
|
+
const transformProp = configArg.getProperty("transform");
|
|
11258
|
+
if (transformProp && Node13.isPropertyAssignment(transformProp)) {
|
|
11259
|
+
const transformText = transformProp.getInitializer()?.getText() ?? "";
|
|
11260
|
+
if (/\bbooleanAttribute\b/.test(transformText))
|
|
11261
|
+
transformIsBoolean = true;
|
|
11262
|
+
if (/\bnumberAttribute\b/.test(transformText))
|
|
11263
|
+
transformIsNumber = true;
|
|
11264
|
+
}
|
|
11265
|
+
}
|
|
11266
|
+
const typeArg = init.getTypeArguments()[0];
|
|
11267
|
+
const resolved = resolvePropType(typeArg);
|
|
11268
|
+
const typeText = transformIsBoolean ? "boolean" : transformIsNumber ? "number" : resolved.text;
|
|
11269
|
+
const name = alias ?? fieldName;
|
|
11270
|
+
const prop = {
|
|
11271
|
+
name,
|
|
11272
|
+
type: typeText,
|
|
11273
|
+
required,
|
|
11274
|
+
sourceStartLine: field.getStartLineNumber(),
|
|
11275
|
+
sourceEndLine: field.getEndLineNumber()
|
|
11276
|
+
};
|
|
11277
|
+
if (defaultValue !== void 0)
|
|
11278
|
+
prop.defaultValue = defaultValue;
|
|
11279
|
+
if (resolved.allowedValues && !transformIsBoolean && !transformIsNumber) {
|
|
11280
|
+
prop.allowedValues = resolved.allowedValues;
|
|
11281
|
+
}
|
|
11282
|
+
return prop;
|
|
11283
|
+
}
|
|
11284
|
+
var init_extract_signal_input = __esm({
|
|
11285
|
+
"packages/experience-design-system-backend-pipeline/dist/src/steps/extraction/src/framework-adapters/angular/helpers/props/extract-signal-input.js"() {
|
|
11286
|
+
"use strict";
|
|
11287
|
+
init_resolve_prop_type();
|
|
11288
|
+
}
|
|
11289
|
+
});
|
|
11290
|
+
|
|
11291
|
+
// packages/experience-design-system-backend-pipeline/dist/src/steps/extraction/src/framework-adapters/angular/helpers/props/parse-inputs-array-entry.js
|
|
11292
|
+
function parseInputsArrayEntry(entry) {
|
|
11293
|
+
const trimmed = entry.trim();
|
|
11294
|
+
if (!trimmed)
|
|
11295
|
+
return null;
|
|
11296
|
+
const parts = trimmed.split(":");
|
|
11297
|
+
if (parts.length === 1) {
|
|
11298
|
+
return { fieldName: parts[0].trim(), alias: null };
|
|
11299
|
+
}
|
|
11300
|
+
if (parts.length === 2) {
|
|
11301
|
+
const field = parts[0].trim();
|
|
11302
|
+
const alias = parts[1].trim();
|
|
11303
|
+
if (!field || !alias)
|
|
11304
|
+
return null;
|
|
11305
|
+
return { fieldName: field, alias };
|
|
11306
|
+
}
|
|
11307
|
+
return null;
|
|
11308
|
+
}
|
|
11309
|
+
var init_parse_inputs_array_entry = __esm({
|
|
11310
|
+
"packages/experience-design-system-backend-pipeline/dist/src/steps/extraction/src/framework-adapters/angular/helpers/props/parse-inputs-array-entry.js"() {
|
|
11311
|
+
"use strict";
|
|
11312
|
+
}
|
|
11313
|
+
});
|
|
11314
|
+
|
|
11315
|
+
// packages/experience-design-system-backend-pipeline/dist/src/steps/extraction/src/framework-adapters/angular/helpers/props/extract-props.js
|
|
11316
|
+
function collectClassChain(cls) {
|
|
11317
|
+
const chain = [cls];
|
|
11318
|
+
const seen = /* @__PURE__ */ new Set([cls]);
|
|
11319
|
+
let current = cls;
|
|
11320
|
+
for (let i = 0; i < MAX_BASE_CHAIN; i++) {
|
|
11321
|
+
let base;
|
|
11322
|
+
try {
|
|
11323
|
+
base = current.getBaseClass();
|
|
11324
|
+
} catch {
|
|
11325
|
+
break;
|
|
11326
|
+
}
|
|
11327
|
+
if (!base || seen.has(base))
|
|
11328
|
+
break;
|
|
11329
|
+
chain.push(base);
|
|
11330
|
+
seen.add(base);
|
|
11331
|
+
current = base;
|
|
11332
|
+
}
|
|
11333
|
+
return chain;
|
|
11334
|
+
}
|
|
11335
|
+
function extractProps2(cls, meta) {
|
|
11336
|
+
const byName = /* @__PURE__ */ new Map();
|
|
11337
|
+
const chain = collectClassChain(cls);
|
|
11338
|
+
for (const klass of chain) {
|
|
11339
|
+
for (const field of klass.getProperties()) {
|
|
11340
|
+
const prop = extractDecoratorInput(field);
|
|
11341
|
+
if (prop && !byName.has(prop.name))
|
|
11342
|
+
byName.set(prop.name, prop);
|
|
11343
|
+
}
|
|
11344
|
+
for (const setter of klass.getSetAccessors()) {
|
|
11345
|
+
const prop = extractDecoratorInput(setter);
|
|
11346
|
+
if (prop && !byName.has(prop.name))
|
|
11347
|
+
byName.set(prop.name, prop);
|
|
11348
|
+
}
|
|
11349
|
+
for (const getter of klass.getGetAccessors()) {
|
|
11350
|
+
const prop = extractDecoratorInput(getter);
|
|
11351
|
+
if (prop && !byName.has(prop.name))
|
|
11352
|
+
byName.set(prop.name, prop);
|
|
11353
|
+
}
|
|
11354
|
+
for (const field of klass.getProperties()) {
|
|
11355
|
+
const prop = extractSignalInput(field);
|
|
11356
|
+
if (prop && !byName.has(prop.name))
|
|
11357
|
+
byName.set(prop.name, prop);
|
|
11358
|
+
}
|
|
11359
|
+
}
|
|
11360
|
+
for (const entry of meta.inputsArray) {
|
|
11361
|
+
const parsed = parseInputsArrayEntry(entry);
|
|
11362
|
+
if (!parsed)
|
|
11363
|
+
continue;
|
|
11364
|
+
const name = parsed.alias ?? parsed.fieldName;
|
|
11365
|
+
if (byName.has(name))
|
|
11366
|
+
continue;
|
|
11367
|
+
byName.set(name, { name, type: "any", required: false });
|
|
11368
|
+
}
|
|
11369
|
+
return [...byName.values()];
|
|
11370
|
+
}
|
|
11371
|
+
var MAX_BASE_CHAIN;
|
|
11372
|
+
var init_extract_props = __esm({
|
|
11373
|
+
"packages/experience-design-system-backend-pipeline/dist/src/steps/extraction/src/framework-adapters/angular/helpers/props/extract-props.js"() {
|
|
11374
|
+
"use strict";
|
|
11375
|
+
init_extract_decorator_input();
|
|
11376
|
+
init_extract_signal_input();
|
|
11377
|
+
init_parse_inputs_array_entry();
|
|
11378
|
+
MAX_BASE_CHAIN = 10;
|
|
11379
|
+
}
|
|
11380
|
+
});
|
|
11381
|
+
|
|
11382
|
+
// packages/experience-design-system-backend-pipeline/dist/src/steps/extraction/src/framework-adapters/angular/helpers/resolution/normalize-component-name.js
|
|
11383
|
+
function normalizeComponentName2(className) {
|
|
11384
|
+
for (const suffix of SUFFIXES) {
|
|
11385
|
+
if (className.endsWith(suffix) && className.length > suffix.length) {
|
|
11386
|
+
return className.slice(0, -suffix.length);
|
|
11387
|
+
}
|
|
11388
|
+
}
|
|
11389
|
+
return className;
|
|
11390
|
+
}
|
|
11391
|
+
var SUFFIXES;
|
|
11392
|
+
var init_normalize_component_name = __esm({
|
|
11393
|
+
"packages/experience-design-system-backend-pipeline/dist/src/steps/extraction/src/framework-adapters/angular/helpers/resolution/normalize-component-name.js"() {
|
|
11394
|
+
"use strict";
|
|
11395
|
+
SUFFIXES = ["Component", "Directive"];
|
|
11396
|
+
}
|
|
11397
|
+
});
|
|
11398
|
+
|
|
11399
|
+
// packages/experience-design-system-backend-pipeline/dist/src/steps/extraction/src/framework-adapters/angular/helpers/read-decorator-string.js
|
|
11400
|
+
import { Node as Node14 } from "ts-morph";
|
|
11401
|
+
function readDecoratorString(obj, propName) {
|
|
11402
|
+
const prop = obj.getProperty(propName);
|
|
11403
|
+
if (!prop || !Node14.isPropertyAssignment(prop))
|
|
11404
|
+
return null;
|
|
11405
|
+
const init = prop.getInitializer();
|
|
11406
|
+
if (!init)
|
|
11407
|
+
return null;
|
|
11408
|
+
if (Node14.isStringLiteral(init) || Node14.isNoSubstitutionTemplateLiteral(init)) {
|
|
11409
|
+
return init.getLiteralText();
|
|
11410
|
+
}
|
|
11411
|
+
return null;
|
|
11412
|
+
}
|
|
11413
|
+
function readDecoratorStringArray(obj, propName) {
|
|
11414
|
+
const prop = obj.getProperty(propName);
|
|
11415
|
+
if (!prop || !Node14.isPropertyAssignment(prop))
|
|
11416
|
+
return [];
|
|
11417
|
+
const init = prop.getInitializer();
|
|
11418
|
+
if (!init || !Node14.isArrayLiteralExpression(init))
|
|
11419
|
+
return [];
|
|
11420
|
+
const out = [];
|
|
11421
|
+
for (const el of init.getElements()) {
|
|
11422
|
+
if (Node14.isStringLiteral(el) || Node14.isNoSubstitutionTemplateLiteral(el)) {
|
|
11423
|
+
out.push(el.getLiteralText());
|
|
11424
|
+
}
|
|
11425
|
+
}
|
|
11426
|
+
return out;
|
|
11427
|
+
}
|
|
11428
|
+
var init_read_decorator_string = __esm({
|
|
11429
|
+
"packages/experience-design-system-backend-pipeline/dist/src/steps/extraction/src/framework-adapters/angular/helpers/read-decorator-string.js"() {
|
|
11430
|
+
"use strict";
|
|
11431
|
+
}
|
|
11432
|
+
});
|
|
11433
|
+
|
|
11434
|
+
// packages/experience-design-system-backend-pipeline/dist/src/steps/extraction/src/framework-adapters/angular/helpers/read-component-metadata.js
|
|
11435
|
+
import { dirname as dirname9, resolve as resolve11 } from "node:path";
|
|
11436
|
+
function readComponentMetadata(cls, sourceFilePath) {
|
|
11437
|
+
const obj = findComponentDecorator(cls);
|
|
11438
|
+
if (!obj)
|
|
11439
|
+
return null;
|
|
11440
|
+
const className = cls.getName();
|
|
11441
|
+
if (!className)
|
|
11442
|
+
return null;
|
|
11443
|
+
const rawSelector = readDecoratorString(obj, "selector");
|
|
11444
|
+
const inlineTemplate = readDecoratorString(obj, "template");
|
|
11445
|
+
const templateUrlRel = readDecoratorString(obj, "templateUrl");
|
|
11446
|
+
const inputsArray = readDecoratorStringArray(obj, "inputs");
|
|
11447
|
+
const templatePath = templateUrlRel ? resolve11(dirname9(sourceFilePath), templateUrlRel) : null;
|
|
11448
|
+
const decorator = cls.getDecorator("Component");
|
|
11449
|
+
const decoratorLine = decorator?.getStartLineNumber() ?? cls.getStartLineNumber();
|
|
11450
|
+
return {
|
|
11451
|
+
className,
|
|
11452
|
+
normalizedName: normalizeComponentName2(className),
|
|
11453
|
+
rawSelector,
|
|
11454
|
+
inlineTemplate,
|
|
11455
|
+
templatePath,
|
|
11456
|
+
inputsArray,
|
|
11457
|
+
decoratorLine
|
|
11458
|
+
};
|
|
11459
|
+
}
|
|
11460
|
+
var init_read_component_metadata = __esm({
|
|
11461
|
+
"packages/experience-design-system-backend-pipeline/dist/src/steps/extraction/src/framework-adapters/angular/helpers/read-component-metadata.js"() {
|
|
11462
|
+
"use strict";
|
|
11463
|
+
init_find_component_decorator();
|
|
11464
|
+
init_normalize_component_name();
|
|
11465
|
+
init_read_decorator_string();
|
|
11466
|
+
}
|
|
11467
|
+
});
|
|
11468
|
+
|
|
11469
|
+
// packages/experience-design-system-backend-pipeline/dist/src/steps/extraction/src/framework-adapters/angular/helpers/template/parse-ng-content-elements.js
|
|
11470
|
+
function parseNgContentElements(templateHtml) {
|
|
11471
|
+
const out = [];
|
|
11472
|
+
const tagRe = /<ng-content\b([^>]*?)\/?>/gi;
|
|
11473
|
+
for (const match2 of templateHtml.matchAll(tagRe)) {
|
|
11474
|
+
const attrs = match2[1] ?? "";
|
|
11475
|
+
const selectMatch = attrs.match(/\bselect\s*=\s*(?:"([^"]*)"|'([^']*)')/);
|
|
11476
|
+
const rawSelect = selectMatch ? selectMatch[1] ?? selectMatch[2] ?? null : null;
|
|
11477
|
+
const sourceLine = countLines(templateHtml, match2.index ?? 0);
|
|
11478
|
+
out.push({ rawSelect, sourceLine });
|
|
11479
|
+
}
|
|
11480
|
+
return out;
|
|
11481
|
+
}
|
|
11482
|
+
function countLines(text, offset) {
|
|
11483
|
+
let line = 1;
|
|
11484
|
+
for (let i = 0; i < offset && i < text.length; i++) {
|
|
11485
|
+
if (text.charCodeAt(i) === 10)
|
|
11486
|
+
line++;
|
|
11487
|
+
}
|
|
11488
|
+
return line;
|
|
11489
|
+
}
|
|
11490
|
+
var init_parse_ng_content_elements = __esm({
|
|
11491
|
+
"packages/experience-design-system-backend-pipeline/dist/src/steps/extraction/src/framework-adapters/angular/helpers/template/parse-ng-content-elements.js"() {
|
|
11492
|
+
"use strict";
|
|
11493
|
+
}
|
|
11494
|
+
});
|
|
11495
|
+
|
|
11496
|
+
// packages/experience-design-system-backend-pipeline/dist/src/steps/extraction/src/framework-adapters/angular/helpers/template/resolve-template-source.js
|
|
11497
|
+
import { readFile as readFile7 } from "node:fs/promises";
|
|
11498
|
+
async function resolveTemplateSource(meta) {
|
|
11499
|
+
if (meta.inlineTemplate !== null)
|
|
11500
|
+
return meta.inlineTemplate;
|
|
11501
|
+
if (meta.templatePath === null)
|
|
11502
|
+
return null;
|
|
11503
|
+
try {
|
|
11504
|
+
return await readFile7(meta.templatePath, "utf8");
|
|
11505
|
+
} catch {
|
|
11506
|
+
return null;
|
|
11507
|
+
}
|
|
11508
|
+
}
|
|
11509
|
+
var init_resolve_template_source = __esm({
|
|
11510
|
+
"packages/experience-design-system-backend-pipeline/dist/src/steps/extraction/src/framework-adapters/angular/helpers/template/resolve-template-source.js"() {
|
|
11511
|
+
"use strict";
|
|
11512
|
+
}
|
|
11513
|
+
});
|
|
11514
|
+
|
|
11515
|
+
// packages/experience-design-system-backend-pipeline/dist/src/steps/extraction/src/framework-adapters/angular/helpers/resolution/strip-library-prefix.js
|
|
11516
|
+
function stripLibraryPrefix(name) {
|
|
11517
|
+
for (const prefix of KNOWN_PREFIXES) {
|
|
11518
|
+
if (name.startsWith(prefix) && name.length > prefix.length) {
|
|
11519
|
+
const rest = name.slice(prefix.length);
|
|
11520
|
+
if (rest[0] && rest[0] === rest[0].toUpperCase()) {
|
|
11521
|
+
return rest;
|
|
11522
|
+
}
|
|
11523
|
+
}
|
|
11524
|
+
}
|
|
11525
|
+
return name;
|
|
11526
|
+
}
|
|
11527
|
+
var KNOWN_PREFIXES;
|
|
11528
|
+
var init_strip_library_prefix = __esm({
|
|
11529
|
+
"packages/experience-design-system-backend-pipeline/dist/src/steps/extraction/src/framework-adapters/angular/helpers/resolution/strip-library-prefix.js"() {
|
|
11530
|
+
"use strict";
|
|
11531
|
+
KNOWN_PREFIXES = ["Mat", "Cdk", "Nz", "Cds", "Ibm", "Clr", "Hlm", "Brn", "Tui", "Nb", "Fd", "P", "Ng"];
|
|
11532
|
+
}
|
|
11533
|
+
});
|
|
11534
|
+
|
|
11535
|
+
// packages/experience-design-system-backend-pipeline/dist/src/steps/extraction/src/framework-adapters/angular/helpers/slots/derive-slot-name.js
|
|
11536
|
+
function deriveSlotName(rawSelect, parentNormalizedName) {
|
|
11537
|
+
if (!rawSelect || rawSelect.trim() === "")
|
|
11538
|
+
return "children";
|
|
11539
|
+
if (rawSelect.includes(",")) {
|
|
11540
|
+
const first = rawSelect.split(",")[0].trim();
|
|
11541
|
+
return deriveSingleSelectorName(first, parentNormalizedName);
|
|
11542
|
+
}
|
|
11543
|
+
return deriveSingleSelectorName(rawSelect.trim(), parentNormalizedName);
|
|
11544
|
+
}
|
|
11545
|
+
function deriveSingleSelectorName(sel, parentNormalizedName) {
|
|
11546
|
+
const slotAttrMatch = sel.match(/^\[\s*slot\s*=\s*['"]?([^'"\]]+)['"]?\s*\]$/);
|
|
11547
|
+
if (slotAttrMatch)
|
|
11548
|
+
return slotAttrMatch[1].trim();
|
|
11549
|
+
if (sel.startsWith(".")) {
|
|
11550
|
+
const last = sel.slice(1).split("-").pop() ?? sel.slice(1);
|
|
11551
|
+
return kebabToCamel2(last);
|
|
11552
|
+
}
|
|
11553
|
+
const attrMatch = sel.match(/^\[([^=\]]+)\]$/);
|
|
11554
|
+
if (attrMatch) {
|
|
11555
|
+
const attr = attrMatch[1].trim();
|
|
11556
|
+
const stripped = tryStripSubComponentOrLibraryPrefix(attr, parentNormalizedName);
|
|
11557
|
+
return stripped || kebabToCamel2(attr);
|
|
11558
|
+
}
|
|
11559
|
+
const elMatch = sel.match(/^([a-zA-Z][a-zA-Z0-9-]*)/);
|
|
11560
|
+
if (elMatch) {
|
|
11561
|
+
const tag = elMatch[1];
|
|
11562
|
+
const stripped = tryStripSubComponentOrLibraryPrefix(tag, parentNormalizedName);
|
|
11563
|
+
return stripped || kebabToCamel2(tag);
|
|
11564
|
+
}
|
|
11565
|
+
return sel.replace(/\s+/g, "");
|
|
11566
|
+
}
|
|
11567
|
+
function tryStripSubComponentOrLibraryPrefix(ident, parentNormalizedName) {
|
|
11568
|
+
const parentKebab = pascalToKebab(parentNormalizedName);
|
|
11569
|
+
if (parentKebab && ident.startsWith(`${parentKebab}-`)) {
|
|
11570
|
+
return kebabToCamel2(ident.slice(parentKebab.length + 1));
|
|
11571
|
+
}
|
|
11572
|
+
const asPascal = kebabToPascal2(ident);
|
|
11573
|
+
const stripped = stripLibraryPrefix(asPascal);
|
|
11574
|
+
if (stripped !== asPascal) {
|
|
11575
|
+
return stripped.charAt(0).toLowerCase() + stripped.slice(1);
|
|
11576
|
+
}
|
|
11577
|
+
return null;
|
|
11578
|
+
}
|
|
11579
|
+
function kebabToCamel2(s) {
|
|
11580
|
+
return s.replace(/-([a-z])/g, (_, c2) => c2.toUpperCase());
|
|
11581
|
+
}
|
|
11582
|
+
function kebabToPascal2(s) {
|
|
11583
|
+
const camel = kebabToCamel2(s);
|
|
11584
|
+
return camel.charAt(0).toUpperCase() + camel.slice(1);
|
|
11585
|
+
}
|
|
11586
|
+
function pascalToKebab(s) {
|
|
11587
|
+
return s.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
11588
|
+
}
|
|
11589
|
+
var init_derive_slot_name = __esm({
|
|
11590
|
+
"packages/experience-design-system-backend-pipeline/dist/src/steps/extraction/src/framework-adapters/angular/helpers/slots/derive-slot-name.js"() {
|
|
11591
|
+
"use strict";
|
|
11592
|
+
init_strip_library_prefix();
|
|
11593
|
+
}
|
|
11594
|
+
});
|
|
11595
|
+
|
|
11596
|
+
// packages/experience-design-system-backend-pipeline/dist/src/steps/extraction/src/framework-adapters/angular/helpers/slots/extract-content-child-queries.js
|
|
11597
|
+
import { Node as Node15 } from "ts-morph";
|
|
11598
|
+
function extractContentChildQueries(cls) {
|
|
11599
|
+
const out = [];
|
|
11600
|
+
for (const field of cls.getProperties()) {
|
|
11601
|
+
const fieldName = field.getName();
|
|
11602
|
+
const init = field.getInitializer();
|
|
11603
|
+
if (init && Node15.isCallExpression(init)) {
|
|
11604
|
+
const callee = init.getExpression();
|
|
11605
|
+
if (Node15.isIdentifier(callee)) {
|
|
11606
|
+
const name = callee.getText();
|
|
11607
|
+
if (name === "contentChild" || name === "contentChildren") {
|
|
11608
|
+
const first = init.getArguments()[0];
|
|
11609
|
+
const allowed = resolveClassIdentifierArg(first);
|
|
11610
|
+
out.push(buildSlot(fieldName, allowed));
|
|
11611
|
+
continue;
|
|
11612
|
+
}
|
|
11613
|
+
}
|
|
11614
|
+
}
|
|
11615
|
+
for (const decName of ["ContentChild", "ContentChildren"]) {
|
|
11616
|
+
const dec = field.getDecorator(decName);
|
|
11617
|
+
if (dec) {
|
|
11618
|
+
const first = dec.getArguments()[0];
|
|
11619
|
+
const allowed = resolveClassIdentifierArg(first);
|
|
11620
|
+
out.push(buildSlot(fieldName, allowed));
|
|
11621
|
+
break;
|
|
11622
|
+
}
|
|
11623
|
+
}
|
|
11624
|
+
}
|
|
11625
|
+
return out;
|
|
11626
|
+
}
|
|
11627
|
+
function resolveClassIdentifierArg(arg) {
|
|
11628
|
+
if (!arg)
|
|
11629
|
+
return [];
|
|
11630
|
+
if (Node15.isStringLiteral(arg) || Node15.isNoSubstitutionTemplateLiteral(arg))
|
|
11631
|
+
return [];
|
|
11632
|
+
if (Node15.isIdentifier(arg))
|
|
11633
|
+
return [arg.getText()];
|
|
11634
|
+
return [];
|
|
11635
|
+
}
|
|
11636
|
+
function buildSlot(name, allowed) {
|
|
11637
|
+
const slot = {
|
|
11638
|
+
name,
|
|
11639
|
+
isDefault: false
|
|
11640
|
+
};
|
|
11641
|
+
if (allowed.length > 0)
|
|
11642
|
+
slot.allowedComponents = allowed;
|
|
11643
|
+
return slot;
|
|
11644
|
+
}
|
|
11645
|
+
var init_extract_content_child_queries = __esm({
|
|
11646
|
+
"packages/experience-design-system-backend-pipeline/dist/src/steps/extraction/src/framework-adapters/angular/helpers/slots/extract-content-child-queries.js"() {
|
|
11647
|
+
"use strict";
|
|
11648
|
+
}
|
|
11649
|
+
});
|
|
11650
|
+
|
|
11651
|
+
// packages/experience-design-system-backend-pipeline/dist/src/steps/extraction/src/framework-adapters/angular/helpers/slots/extract-template-ref-slots.js
|
|
11652
|
+
function extractTemplateRefSlots(props) {
|
|
11653
|
+
const nextProps = [];
|
|
11654
|
+
const slots = [];
|
|
11655
|
+
for (const prop of props) {
|
|
11656
|
+
const type = prop.type;
|
|
11657
|
+
const hasTemplateRef = /\bTemplateRef\b/.test(type);
|
|
11658
|
+
if (!hasTemplateRef) {
|
|
11659
|
+
nextProps.push(prop);
|
|
11660
|
+
continue;
|
|
11661
|
+
}
|
|
11662
|
+
const isPureTemplateRef = /^\s*TemplateRef<[^>]*>\s*(\|\s*(null|undefined)\s*)*$/.test(type);
|
|
11663
|
+
if (!isPureTemplateRef) {
|
|
11664
|
+
nextProps.push(prop);
|
|
11665
|
+
}
|
|
11666
|
+
slots.push({ name: prop.name, isDefault: false });
|
|
11667
|
+
}
|
|
11668
|
+
return { props: nextProps, slots };
|
|
11669
|
+
}
|
|
11670
|
+
var init_extract_template_ref_slots = __esm({
|
|
11671
|
+
"packages/experience-design-system-backend-pipeline/dist/src/steps/extraction/src/framework-adapters/angular/helpers/slots/extract-template-ref-slots.js"() {
|
|
11672
|
+
"use strict";
|
|
11673
|
+
}
|
|
11674
|
+
});
|
|
11675
|
+
|
|
11676
|
+
// packages/experience-design-system-backend-pipeline/dist/src/steps/extraction/src/framework-adapters/angular/helpers/slots/extract-slots.js
|
|
11677
|
+
async function extractSlots3(cls, meta, props) {
|
|
11678
|
+
const byName = /* @__PURE__ */ new Map();
|
|
11679
|
+
const template = await resolveTemplateSource(meta);
|
|
11680
|
+
if (template) {
|
|
11681
|
+
for (const el of parseNgContentElements(template)) {
|
|
11682
|
+
const name = deriveSlotName(el.rawSelect, meta.normalizedName);
|
|
11683
|
+
if (byName.has(name))
|
|
11684
|
+
continue;
|
|
11685
|
+
byName.set(name, {
|
|
11686
|
+
name,
|
|
11687
|
+
isDefault: el.rawSelect === null
|
|
11688
|
+
});
|
|
11689
|
+
}
|
|
11690
|
+
}
|
|
11691
|
+
for (const slot of extractContentChildQueries(cls)) {
|
|
11692
|
+
if (!byName.has(slot.name))
|
|
11693
|
+
byName.set(slot.name, slot);
|
|
11694
|
+
}
|
|
11695
|
+
const split = extractTemplateRefSlots(props);
|
|
11696
|
+
for (const slot of split.slots) {
|
|
11697
|
+
if (!byName.has(slot.name))
|
|
11698
|
+
byName.set(slot.name, slot);
|
|
11699
|
+
}
|
|
11700
|
+
return { props: split.props, slots: [...byName.values()] };
|
|
11701
|
+
}
|
|
11702
|
+
var init_extract_slots = __esm({
|
|
11703
|
+
"packages/experience-design-system-backend-pipeline/dist/src/steps/extraction/src/framework-adapters/angular/helpers/slots/extract-slots.js"() {
|
|
11704
|
+
"use strict";
|
|
11705
|
+
init_parse_ng_content_elements();
|
|
11706
|
+
init_resolve_template_source();
|
|
11707
|
+
init_derive_slot_name();
|
|
11708
|
+
init_extract_content_child_queries();
|
|
11709
|
+
init_extract_template_ref_slots();
|
|
11710
|
+
}
|
|
11711
|
+
});
|
|
11712
|
+
|
|
11713
|
+
// packages/experience-design-system-backend-pipeline/dist/src/steps/extraction/src/framework-adapters/angular/extract-angular-components.js
|
|
11714
|
+
import { readFile as readFile8 } from "node:fs/promises";
|
|
11715
|
+
import { ModuleKind as ModuleKind2, Project as Project7, ScriptTarget as ScriptTarget2 } from "ts-morph";
|
|
11716
|
+
async function extractAngularComponents(filePaths, onProgress, _opts) {
|
|
11717
|
+
const components = [];
|
|
11718
|
+
const warnings = [];
|
|
11719
|
+
let filesProcessed = 0;
|
|
11720
|
+
const project = new Project7({
|
|
11721
|
+
useInMemoryFileSystem: false,
|
|
11722
|
+
skipAddingFilesFromTsConfig: true,
|
|
11723
|
+
compilerOptions: {
|
|
11724
|
+
target: ScriptTarget2.ES2022,
|
|
11725
|
+
module: ModuleKind2.ESNext,
|
|
11726
|
+
experimentalDecorators: true,
|
|
11727
|
+
emitDecoratorMetadata: false,
|
|
11728
|
+
allowJs: false
|
|
11729
|
+
}
|
|
11730
|
+
});
|
|
11731
|
+
for (const filePath of filePaths) {
|
|
11732
|
+
try {
|
|
11733
|
+
const source = await readFile8(filePath, "utf8");
|
|
11734
|
+
const sourceFile = project.createSourceFile(filePath, source, { overwrite: true });
|
|
11735
|
+
for (const cls of sourceFile.getClasses()) {
|
|
11736
|
+
if (!hasComponentDecorator(cls))
|
|
11737
|
+
continue;
|
|
11738
|
+
if (!findComponentDecorator(cls)) {
|
|
11739
|
+
warnings.push(`${filePath}: ${cls.getName() ?? "<anonymous>"} has @Component with a non-literal argument; skipped.`);
|
|
11740
|
+
continue;
|
|
11741
|
+
}
|
|
11742
|
+
const meta = readComponentMetadata(cls, filePath);
|
|
11743
|
+
if (!meta)
|
|
11744
|
+
continue;
|
|
11745
|
+
const propsOnly = extractProps2(cls, meta);
|
|
11746
|
+
const { props, slots } = await extractSlots3(cls, meta, propsOnly);
|
|
11747
|
+
const partial = {
|
|
11748
|
+
name: meta.className,
|
|
11749
|
+
source: filePath,
|
|
11750
|
+
framework: "angular",
|
|
11751
|
+
props,
|
|
11752
|
+
slots: normalizeSlots(slots),
|
|
11753
|
+
sourcePath: filePath
|
|
11754
|
+
};
|
|
11755
|
+
const score = computeExtractionScore(partial);
|
|
11756
|
+
partial.extractionConfidence = score.confidence;
|
|
11757
|
+
partial.reviewReasons = score.reasons;
|
|
11758
|
+
partial.needsReview = deriveNeedsReview(score.confidence);
|
|
11759
|
+
components.push(partial);
|
|
11760
|
+
}
|
|
11761
|
+
sourceFile.forget();
|
|
11762
|
+
} catch (err) {
|
|
11763
|
+
warnings.push(`${filePath}: Angular extractor failed \u2014 ${err instanceof Error ? err.message : String(err)}`);
|
|
11764
|
+
} finally {
|
|
11765
|
+
filesProcessed++;
|
|
11766
|
+
if (onProgress)
|
|
11767
|
+
onProgress({ filesProcessed, componentsFound: components.length });
|
|
11768
|
+
}
|
|
11769
|
+
}
|
|
11770
|
+
return {
|
|
11771
|
+
components: components.sort((a, b) => a.name.localeCompare(b.name)),
|
|
11772
|
+
warnings
|
|
11773
|
+
};
|
|
11774
|
+
}
|
|
11775
|
+
function normalizeSlots(slots) {
|
|
11776
|
+
let fallbackIndex = 0;
|
|
11777
|
+
return slots.map((slot) => {
|
|
11778
|
+
if (slot.name.trim())
|
|
11779
|
+
return slot;
|
|
11780
|
+
const name = fallbackIndex === 0 ? "children" : `slot_${fallbackIndex}`;
|
|
11781
|
+
fallbackIndex++;
|
|
11782
|
+
return { ...slot, name };
|
|
11783
|
+
});
|
|
11784
|
+
}
|
|
11785
|
+
var init_extract_angular_components = __esm({
|
|
11786
|
+
"packages/experience-design-system-backend-pipeline/dist/src/steps/extraction/src/framework-adapters/angular/extract-angular-components.js"() {
|
|
11787
|
+
"use strict";
|
|
11788
|
+
init_scoring();
|
|
11789
|
+
init_find_component_decorator();
|
|
11790
|
+
init_extract_props();
|
|
11791
|
+
init_read_component_metadata();
|
|
11792
|
+
init_extract_slots();
|
|
11793
|
+
}
|
|
11794
|
+
});
|
|
11795
|
+
|
|
11796
|
+
// packages/experience-design-system-backend-pipeline/dist/src/steps/extraction/src/framework-adapters/angular/helpers/is-angular-source-file.js
|
|
11797
|
+
import { openSync, readSync, closeSync, statSync as statSync3 } from "node:fs";
|
|
11798
|
+
function isAngularSourceFile(filePath) {
|
|
11799
|
+
if (!/\.[cm]?ts$/.test(filePath))
|
|
11800
|
+
return false;
|
|
11801
|
+
if (filePath.endsWith(".d.ts"))
|
|
11802
|
+
return false;
|
|
11803
|
+
try {
|
|
11804
|
+
const stats = statSync3(filePath);
|
|
11805
|
+
const toRead = Math.min(HEAD_BYTES, stats.size);
|
|
11806
|
+
if (toRead === 0)
|
|
11807
|
+
return false;
|
|
11808
|
+
const fd = openSync(filePath, "r");
|
|
11809
|
+
try {
|
|
11810
|
+
const bytesRead = readSync(fd, buffer, 0, toRead, 0);
|
|
11811
|
+
const head = buffer.subarray(0, bytesRead).toString("utf8");
|
|
11812
|
+
return head.includes("@angular/core");
|
|
11813
|
+
} finally {
|
|
11814
|
+
closeSync(fd);
|
|
11815
|
+
}
|
|
11816
|
+
} catch {
|
|
11817
|
+
return false;
|
|
11818
|
+
}
|
|
11819
|
+
}
|
|
11820
|
+
var HEAD_BYTES, buffer;
|
|
11821
|
+
var init_is_angular_source_file = __esm({
|
|
11822
|
+
"packages/experience-design-system-backend-pipeline/dist/src/steps/extraction/src/framework-adapters/angular/helpers/is-angular-source-file.js"() {
|
|
11823
|
+
"use strict";
|
|
11824
|
+
HEAD_BYTES = 32 * 1024;
|
|
11825
|
+
buffer = Buffer.alloc(HEAD_BYTES);
|
|
11826
|
+
}
|
|
11827
|
+
});
|
|
11828
|
+
|
|
10989
11829
|
// packages/experience-design-system-backend-pipeline/dist/src/steps/extraction/src/services/run-extraction-service.js
|
|
10990
11830
|
function getPathPreferenceScore(filePath) {
|
|
10991
11831
|
const normalized = filePath.replace(/\\/g, "/");
|
|
@@ -11278,6 +12118,8 @@ var init_run_extraction_service = __esm({
|
|
|
11278
12118
|
init_extract_astro_components();
|
|
11279
12119
|
init_extract_web_components();
|
|
11280
12120
|
init_extract_svelte_components();
|
|
12121
|
+
init_extract_angular_components();
|
|
12122
|
+
init_is_angular_source_file();
|
|
11281
12123
|
extractors = [
|
|
11282
12124
|
{
|
|
11283
12125
|
name: "stencil",
|
|
@@ -11304,6 +12146,13 @@ var init_run_extraction_service = __esm({
|
|
|
11304
12146
|
fileFilter: (f) => f.endsWith(".astro"),
|
|
11305
12147
|
extract: extractAstroComponents
|
|
11306
12148
|
},
|
|
12149
|
+
{
|
|
12150
|
+
// Must run BEFORE web-components (both claim bare .ts). The sniff reads
|
|
12151
|
+
// the file head looking for `@angular/core` so we only claim real Angular files.
|
|
12152
|
+
name: "angular",
|
|
12153
|
+
fileFilter: (f) => isAngularSourceFile(f),
|
|
12154
|
+
extract: extractAngularComponents
|
|
12155
|
+
},
|
|
11307
12156
|
{
|
|
11308
12157
|
name: "web-components",
|
|
11309
12158
|
fileFilter: (f) => /\.[jt]s$/.test(f) && !/\.[jt]sx$/.test(f) && !f.endsWith(".d.ts"),
|
|
@@ -11532,16 +12381,16 @@ var init_apply_mapping = __esm({
|
|
|
11532
12381
|
|
|
11533
12382
|
// packages/experience-design-system-backend-pipeline/dist/src/steps/composition/src/helpers/prompt/prompt-loader.js
|
|
11534
12383
|
import { existsSync as existsSync6, readFileSync as readFileSync5 } from "node:fs";
|
|
11535
|
-
import { dirname as
|
|
12384
|
+
import { dirname as dirname10, join as join8, resolve as resolve12 } from "node:path";
|
|
11536
12385
|
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
11537
12386
|
function resolvePromptPath(fileName) {
|
|
11538
|
-
const thisDir =
|
|
12387
|
+
const thisDir = dirname10(fileURLToPath2(import.meta.url));
|
|
11539
12388
|
let dir = thisDir;
|
|
11540
12389
|
for (; ; ) {
|
|
11541
12390
|
const candidate = join8(dir, "prompts");
|
|
11542
12391
|
if (existsSync6(candidate))
|
|
11543
12392
|
return join8(candidate, fileName);
|
|
11544
|
-
const parent =
|
|
12393
|
+
const parent = resolve12(dir, "..");
|
|
11545
12394
|
if (parent === dir) {
|
|
11546
12395
|
throw new Error(`prompt file missing from package installation (could not locate prompts/ directory from: ${thisDir})`);
|
|
11547
12396
|
}
|
|
@@ -11639,14 +12488,31 @@ var CANDIDATE_NAME_PATTERNS, CANDIDATE_CONTENT_MARKERS, PROMPT_CANDIDATE_TOKEN_B
|
|
|
11639
12488
|
var init_candidate_files = __esm({
|
|
11640
12489
|
"packages/experience-design-system-backend-pipeline/dist/src/steps/composition/src/constants/candidate-files.js"() {
|
|
11641
12490
|
"use strict";
|
|
11642
|
-
CANDIDATE_NAME_PATTERNS = [
|
|
12491
|
+
CANDIDATE_NAME_PATTERNS = [
|
|
12492
|
+
/mapping/i,
|
|
12493
|
+
/meta/i,
|
|
12494
|
+
/registry/i,
|
|
12495
|
+
/schema/i,
|
|
12496
|
+
/composition/i,
|
|
12497
|
+
/\.module\.ts$/i,
|
|
12498
|
+
/\.component\.ts$/i,
|
|
12499
|
+
/public[-_]api\.ts$/i,
|
|
12500
|
+
/^index\.ts$/i
|
|
12501
|
+
];
|
|
11643
12502
|
CANDIDATE_CONTENT_MARKERS = [
|
|
11644
12503
|
"requiredParent",
|
|
11645
12504
|
"withParentType",
|
|
11646
12505
|
"allowedTagNames",
|
|
11647
12506
|
"createContext",
|
|
11648
12507
|
"MappingContext",
|
|
11649
|
-
"allowedComponents"
|
|
12508
|
+
"allowedComponents",
|
|
12509
|
+
"TemplateRef",
|
|
12510
|
+
"NG_VALUE_ACCESSOR",
|
|
12511
|
+
"ContentChild",
|
|
12512
|
+
"contentChild",
|
|
12513
|
+
"ng-content",
|
|
12514
|
+
"@NgModule",
|
|
12515
|
+
"standalone: true"
|
|
11650
12516
|
];
|
|
11651
12517
|
PROMPT_CANDIDATE_TOKEN_BUDGET = 8e4;
|
|
11652
12518
|
}
|
|
@@ -11729,8 +12595,8 @@ var init_composition_cache_key = __esm({
|
|
|
11729
12595
|
});
|
|
11730
12596
|
|
|
11731
12597
|
// packages/experience-design-system-backend-pipeline/dist/src/steps/composition/src/helpers/edges/manifest-doc-evidence.js
|
|
11732
|
-
import { dirname as
|
|
11733
|
-
function
|
|
12598
|
+
import { dirname as dirname11 } from "node:path";
|
|
12599
|
+
function kebabToPascal3(name) {
|
|
11734
12600
|
return name.split("-").filter(Boolean).map((seg) => seg.charAt(0).toUpperCase() + seg.slice(1)).join("");
|
|
11735
12601
|
}
|
|
11736
12602
|
function collectManifestEdges(files, componentNames) {
|
|
@@ -11752,7 +12618,7 @@ function collectManifestEdges(files, componentNames) {
|
|
|
11752
12618
|
const rawParentName = typeof component === "object" && component !== null && typeof component.name === "string" ? component.name : void 0;
|
|
11753
12619
|
if (!rawParentName)
|
|
11754
12620
|
continue;
|
|
11755
|
-
const parent =
|
|
12621
|
+
const parent = kebabToPascal3(rawParentName);
|
|
11756
12622
|
if (!componentNames.has(parent))
|
|
11757
12623
|
continue;
|
|
11758
12624
|
const variantsMeta = root.variantsMeta;
|
|
@@ -11772,7 +12638,7 @@ function collectManifestEdges(files, componentNames) {
|
|
|
11772
12638
|
const rawChildName = value.name;
|
|
11773
12639
|
if (typeof rawChildName !== "string")
|
|
11774
12640
|
continue;
|
|
11775
|
-
const child =
|
|
12641
|
+
const child = kebabToPascal3(rawChildName);
|
|
11776
12642
|
if (!componentNames.has(child) || child === parent)
|
|
11777
12643
|
continue;
|
|
11778
12644
|
const key = `${parent}::${child}`;
|
|
@@ -11791,8 +12657,8 @@ function collectAgentsDocEdges(files, components, componentNames) {
|
|
|
11791
12657
|
for (const file of files) {
|
|
11792
12658
|
if (!file.path.endsWith("AGENTS.md"))
|
|
11793
12659
|
continue;
|
|
11794
|
-
const docDir =
|
|
11795
|
-
const parent = components.find((c2) => c2.sourcePath &&
|
|
12660
|
+
const docDir = dirname11(file.path);
|
|
12661
|
+
const parent = components.find((c2) => c2.sourcePath && dirname11(c2.sourcePath) === docDir)?.name;
|
|
11796
12662
|
if (!parent || !componentNames.has(parent))
|
|
11797
12663
|
continue;
|
|
11798
12664
|
for (const line of file.content.split("\n")) {
|
|
@@ -11801,7 +12667,7 @@ function collectAgentsDocEdges(files, components, componentNames) {
|
|
|
11801
12667
|
continue;
|
|
11802
12668
|
for (const match2 of line.matchAll(BOLD_BACKTICK)) {
|
|
11803
12669
|
const raw = match2[1];
|
|
11804
|
-
const candidate = componentNames.has(raw) ? raw :
|
|
12670
|
+
const candidate = componentNames.has(raw) ? raw : kebabToPascal3(raw);
|
|
11805
12671
|
if (!componentNames.has(candidate) || candidate === parent)
|
|
11806
12672
|
continue;
|
|
11807
12673
|
const key = `${parent}::${candidate}`;
|
|
@@ -12439,7 +13305,7 @@ var init_create_component_id = __esm({
|
|
|
12439
13305
|
|
|
12440
13306
|
// packages/experience-design-system-backend-pipeline/dist/src/persistence/src/review-session/helpers/resolve-component-source-path.js
|
|
12441
13307
|
import { access } from "node:fs/promises";
|
|
12442
|
-
import { isAbsolute, relative, resolve as
|
|
13308
|
+
import { isAbsolute, relative, resolve as resolve13 } from "node:path";
|
|
12443
13309
|
async function resolveComponentSourcePath(source, reviewRoot) {
|
|
12444
13310
|
if (isAbsolute(source)) {
|
|
12445
13311
|
try {
|
|
@@ -12449,7 +13315,7 @@ async function resolveComponentSourcePath(source, reviewRoot) {
|
|
|
12449
13315
|
throw new Error(`Unable to access component source at ${source}`);
|
|
12450
13316
|
}
|
|
12451
13317
|
}
|
|
12452
|
-
const candidate =
|
|
13318
|
+
const candidate = resolve13(reviewRoot, source);
|
|
12453
13319
|
const relativeToRoot = relative(reviewRoot, candidate);
|
|
12454
13320
|
if (relativeToRoot.startsWith("..") || relativeToRoot === ".." || isAbsolute(relativeToRoot)) {
|
|
12455
13321
|
throw new Error(`Resolved component source is outside the review root: ${source}. Pass --project-root <path> to set the correct base.`);
|
|
@@ -12468,9 +13334,9 @@ var init_resolve_component_source_path = __esm({
|
|
|
12468
13334
|
});
|
|
12469
13335
|
|
|
12470
13336
|
// packages/experience-design-system-backend-pipeline/dist/src/persistence/src/review-session/helpers/load-review-input.js
|
|
12471
|
-
import { resolve as
|
|
13337
|
+
import { resolve as resolve14 } from "node:path";
|
|
12472
13338
|
async function loadReviewInput(components, options = {}) {
|
|
12473
|
-
const reviewRoot =
|
|
13339
|
+
const reviewRoot = resolve14(options.reviewRoot ?? process.cwd());
|
|
12474
13340
|
const records = await Promise.all(components.map(async (component) => {
|
|
12475
13341
|
let resolvedSourcePath;
|
|
12476
13342
|
try {
|
|
@@ -12521,13 +13387,13 @@ var init_load_and_validate_for_review = __esm({
|
|
|
12521
13387
|
});
|
|
12522
13388
|
|
|
12523
13389
|
// packages/experience-design-system-backend-pipeline/dist/src/persistence/src/review-session/repositories/review-session-paths.js
|
|
12524
|
-
import { resolve as
|
|
13390
|
+
import { resolve as resolve15 } from "node:path";
|
|
12525
13391
|
async function getRefineSessionPaths(sessionId, artifactsRoot) {
|
|
12526
|
-
const sessionDir2 =
|
|
13392
|
+
const sessionDir2 = resolve15(artifactsRoot, sessionId);
|
|
12527
13393
|
return {
|
|
12528
13394
|
sessionDir: sessionDir2,
|
|
12529
|
-
eventsPath:
|
|
12530
|
-
statePath:
|
|
13395
|
+
eventsPath: resolve15(sessionDir2, "events.jsonl"),
|
|
13396
|
+
statePath: resolve15(sessionDir2, "current-review-state.json")
|
|
12531
13397
|
};
|
|
12532
13398
|
}
|
|
12533
13399
|
var init_review_session_paths = __esm({
|
|
@@ -12537,13 +13403,13 @@ var init_review_session_paths = __esm({
|
|
|
12537
13403
|
});
|
|
12538
13404
|
|
|
12539
13405
|
// packages/experience-design-system-backend-pipeline/dist/src/persistence/src/review-session/repositories/ensure-review-session.js
|
|
12540
|
-
import { access as access2, mkdir, readFile as
|
|
13406
|
+
import { access as access2, mkdir, readFile as readFile9, writeFile } from "node:fs/promises";
|
|
12541
13407
|
async function ensureRefineSession(sessionId, artifactsRoot, initialSnapshot) {
|
|
12542
13408
|
const paths = await getRefineSessionPaths(sessionId, artifactsRoot);
|
|
12543
13409
|
await mkdir(paths.sessionDir, { recursive: true });
|
|
12544
13410
|
try {
|
|
12545
13411
|
await access2(paths.statePath);
|
|
12546
|
-
const savedState = await
|
|
13412
|
+
const savedState = await readFile9(paths.statePath, "utf8");
|
|
12547
13413
|
return JSON.parse(savedState);
|
|
12548
13414
|
} catch {
|
|
12549
13415
|
await writeFile(paths.statePath, JSON.stringify(initialSnapshot, null, 2), "utf8");
|
|
@@ -12559,12 +13425,12 @@ var init_ensure_review_session = __esm({
|
|
|
12559
13425
|
});
|
|
12560
13426
|
|
|
12561
13427
|
// packages/experience-design-system-backend-pipeline/dist/src/persistence/src/review-session/repositories/review-artifacts-root.js
|
|
12562
|
-
import { resolve as
|
|
13428
|
+
import { resolve as resolve16 } from "node:path";
|
|
12563
13429
|
function getRefineArtifactsRoot() {
|
|
12564
13430
|
if (process.env["EDS_REVIEW_ARTIFACTS_DIR"]) {
|
|
12565
|
-
return
|
|
13431
|
+
return resolve16(process.env["EDS_REVIEW_ARTIFACTS_DIR"]);
|
|
12566
13432
|
}
|
|
12567
|
-
return
|
|
13433
|
+
return resolve16(configRoot(), "reviews");
|
|
12568
13434
|
}
|
|
12569
13435
|
var init_review_artifacts_root = __esm({
|
|
12570
13436
|
"packages/experience-design-system-backend-pipeline/dist/src/persistence/src/review-session/repositories/review-artifacts-root.js"() {
|
|
@@ -12585,14 +13451,14 @@ var init_save_review_state = __esm({
|
|
|
12585
13451
|
});
|
|
12586
13452
|
|
|
12587
13453
|
// packages/experience-design-system-backend-pipeline/dist/src/steps/selection/src/controller/review/merge-preview-validation-errors-into-review-session.js
|
|
12588
|
-
import { access as access3, readFile as
|
|
13454
|
+
import { access as access3, readFile as readFile10 } from "node:fs/promises";
|
|
12589
13455
|
async function mergePreviewValidationErrorsIntoReviewSession(sessionId, errors, opts = {}) {
|
|
12590
13456
|
const artifactsRoot = opts.artifactsRoot ?? getRefineArtifactsRoot();
|
|
12591
13457
|
const paths = await getRefineSessionPaths(sessionId, artifactsRoot);
|
|
12592
13458
|
let snapshot;
|
|
12593
13459
|
try {
|
|
12594
13460
|
await access3(paths.statePath);
|
|
12595
|
-
snapshot = JSON.parse(await
|
|
13461
|
+
snapshot = JSON.parse(await readFile10(paths.statePath, "utf8"));
|
|
12596
13462
|
} catch {
|
|
12597
13463
|
snapshot = await loadAndValidateForReview(sessionId, void 0);
|
|
12598
13464
|
snapshot = await ensureRefineSession(sessionId, artifactsRoot, snapshot);
|
|
@@ -12640,7 +13506,7 @@ var init_merge_preview_validation_errors_into_review_session = __esm({
|
|
|
12640
13506
|
});
|
|
12641
13507
|
|
|
12642
13508
|
// packages/experience-design-system-backend-pipeline/dist/src/steps/selection/src/controller/review/reject-components-by-name.js
|
|
12643
|
-
import { readFile as
|
|
13509
|
+
import { readFile as readFile11 } from "node:fs/promises";
|
|
12644
13510
|
async function rejectComponentsByName(sessionId, names, opts = {}) {
|
|
12645
13511
|
if (names.length === 0)
|
|
12646
13512
|
return;
|
|
@@ -12656,7 +13522,7 @@ async function rejectComponentsByName(sessionId, names, opts = {}) {
|
|
|
12656
13522
|
const nameSet = new Set(names);
|
|
12657
13523
|
let snapshot;
|
|
12658
13524
|
try {
|
|
12659
|
-
snapshot = JSON.parse(await
|
|
13525
|
+
snapshot = JSON.parse(await readFile11(paths.statePath, "utf8"));
|
|
12660
13526
|
} catch {
|
|
12661
13527
|
return;
|
|
12662
13528
|
}
|
|
@@ -12740,7 +13606,9 @@ var init_file_patterns = __esm({
|
|
|
12740
13606
|
".spec.ts",
|
|
12741
13607
|
".spec.tsx",
|
|
12742
13608
|
".test.ts",
|
|
12743
|
-
".test.tsx"
|
|
13609
|
+
".test.tsx",
|
|
13610
|
+
".harness.ts",
|
|
13611
|
+
".harness.tsx"
|
|
12744
13612
|
];
|
|
12745
13613
|
IGNORED_DIRS = /* @__PURE__ */ new Set([
|
|
12746
13614
|
".changeset",
|
|
@@ -12758,9 +13626,12 @@ var init_file_patterns = __esm({
|
|
|
12758
13626
|
"dist",
|
|
12759
13627
|
"example",
|
|
12760
13628
|
"examples",
|
|
13629
|
+
"harness",
|
|
13630
|
+
"harnesses",
|
|
12761
13631
|
"node_modules",
|
|
12762
13632
|
"out",
|
|
12763
|
-
"storybook-static"
|
|
13633
|
+
"storybook-static",
|
|
13634
|
+
"testing"
|
|
12764
13635
|
]);
|
|
12765
13636
|
DENYLISTED_EXACT_FILE_NAMES = /* @__PURE__ */ new Set([
|
|
12766
13637
|
"package.json",
|
|
@@ -12907,13 +13778,13 @@ var init_walk_project_tree = __esm({
|
|
|
12907
13778
|
});
|
|
12908
13779
|
|
|
12909
13780
|
// packages/experience-design-system-backend-pipeline/dist/src/persistence/src/helpers/collect-files/collect-files.js
|
|
12910
|
-
import { statSync as
|
|
13781
|
+
import { statSync as statSync4 } from "node:fs";
|
|
12911
13782
|
import path4 from "node:path";
|
|
12912
13783
|
function collectFiles(root, options = {}) {
|
|
12913
13784
|
const resolved = path4.resolve(root);
|
|
12914
13785
|
let stat5;
|
|
12915
13786
|
try {
|
|
12916
|
-
stat5 =
|
|
13787
|
+
stat5 = statSync4(resolved);
|
|
12917
13788
|
} catch (err) {
|
|
12918
13789
|
return { ok: false, failure: classifyStatError(err.code), rootPath: resolved };
|
|
12919
13790
|
}
|
|
@@ -13017,10 +13888,10 @@ var init_run_record = __esm({
|
|
|
13017
13888
|
});
|
|
13018
13889
|
|
|
13019
13890
|
// packages/experience-design-system-backend-pipeline/dist/src/persistence/src/runs/repositories/read-runs-file.js
|
|
13020
|
-
import { readFile as
|
|
13891
|
+
import { readFile as readFile12 } from "node:fs/promises";
|
|
13021
13892
|
async function readRunsFileMaybe() {
|
|
13022
13893
|
try {
|
|
13023
|
-
const raw = await
|
|
13894
|
+
const raw = await readFile12(runsFilePath(), "utf8");
|
|
13024
13895
|
const parsed = JSON.parse(raw);
|
|
13025
13896
|
if (!READABLE_VERSIONS.has(parsed.version)) {
|
|
13026
13897
|
throw new Error(`runs.json version mismatch: file is v${parsed.version}, this CLI expects v${RUNS_FILE_VERSION} (also reads: ${[...READABLE_VERSIONS].join(", ")}). Back up and remove the file to start fresh.`);
|
|
@@ -13045,9 +13916,9 @@ var init_read_runs_file = __esm({
|
|
|
13045
13916
|
|
|
13046
13917
|
// packages/experience-design-system-backend-pipeline/dist/src/persistence/src/runs/repositories/write-runs-file.js
|
|
13047
13918
|
import { mkdir as mkdir2, rename, writeFile as writeFile3 } from "node:fs/promises";
|
|
13048
|
-
import { dirname as
|
|
13919
|
+
import { dirname as dirname12 } from "node:path";
|
|
13049
13920
|
async function writeRunsFileAtomic(file) {
|
|
13050
|
-
await mkdir2(
|
|
13921
|
+
await mkdir2(dirname12(runsFilePath()), { recursive: true });
|
|
13051
13922
|
const body = JSON.stringify(file, null, 2) + "\n";
|
|
13052
13923
|
const tmp = `${runsFilePath()}.${process.pid}.${Date.now()}.tmp`;
|
|
13053
13924
|
await writeFile3(tmp, body, { mode: 384 });
|
|
@@ -13140,8 +14011,8 @@ var init_sha256_hex = __esm({
|
|
|
13140
14011
|
});
|
|
13141
14012
|
|
|
13142
14013
|
// packages/experience-design-system-backend-pipeline/dist/src/persistence/src/runs/services/build-source-fingerprint.js
|
|
13143
|
-
import { readFile as
|
|
13144
|
-
import { resolve as
|
|
14014
|
+
import { readFile as readFile13, stat } from "node:fs/promises";
|
|
14015
|
+
import { resolve as resolve17 } from "node:path";
|
|
13145
14016
|
function rowField(row, key) {
|
|
13146
14017
|
const v = row[key];
|
|
13147
14018
|
return typeof v === "string" ? v : null;
|
|
@@ -13155,7 +14026,7 @@ async function buildSourceFingerprint(opts) {
|
|
|
13155
14026
|
const name = rowField(row, "name");
|
|
13156
14027
|
if (!sourcePath)
|
|
13157
14028
|
continue;
|
|
13158
|
-
const abs =
|
|
14029
|
+
const abs = resolve17(sourcePath);
|
|
13159
14030
|
if (seen.has(abs))
|
|
13160
14031
|
continue;
|
|
13161
14032
|
seen.add(abs);
|
|
@@ -13172,10 +14043,10 @@ async function buildSourceFingerprint(opts) {
|
|
|
13172
14043
|
let rawTokensMtime = null;
|
|
13173
14044
|
let rawTokensContentHash = null;
|
|
13174
14045
|
if (opts.rawTokensPath) {
|
|
13175
|
-
const abs =
|
|
14046
|
+
const abs = resolve17(opts.rawTokensPath);
|
|
13176
14047
|
rawTokensPath = abs;
|
|
13177
14048
|
try {
|
|
13178
|
-
const [st, buf] = await Promise.all([stat(abs),
|
|
14049
|
+
const [st, buf] = await Promise.all([stat(abs), readFile13(abs)]);
|
|
13179
14050
|
rawTokensMtime = st.mtime.toISOString();
|
|
13180
14051
|
rawTokensContentHash = sha256Hex(buf);
|
|
13181
14052
|
} catch {
|
|
@@ -13340,12 +14211,12 @@ var init_write_scope_decisions_snapshot = __esm({
|
|
|
13340
14211
|
});
|
|
13341
14212
|
|
|
13342
14213
|
// packages/experience-design-system-backend-pipeline/dist/src/persistence/src/review-session/repositories/load-accepted-names.js
|
|
13343
|
-
import { readFile as
|
|
14214
|
+
import { readFile as readFile14 } from "node:fs/promises";
|
|
13344
14215
|
async function loadAcceptedNames(sessionId) {
|
|
13345
14216
|
try {
|
|
13346
14217
|
const artifactsRoot = getRefineArtifactsRoot();
|
|
13347
14218
|
const paths = await getRefineSessionPaths(sessionId, artifactsRoot);
|
|
13348
|
-
const raw = await
|
|
14219
|
+
const raw = await readFile14(paths.statePath, "utf8");
|
|
13349
14220
|
const snapshot = JSON.parse(raw);
|
|
13350
14221
|
const accepted = snapshot.components.filter((c2) => c2.status === "accepted").map((c2) => c2.name);
|
|
13351
14222
|
if (accepted.length === 0)
|
|
@@ -14333,7 +15204,7 @@ function errorMessage(error) {
|
|
|
14333
15204
|
return error instanceof Error && error.message ? error.message : String(error);
|
|
14334
15205
|
}
|
|
14335
15206
|
function defaultSleep(delayMs) {
|
|
14336
|
-
return new Promise((
|
|
15207
|
+
return new Promise((resolve29) => setTimeout(resolve29, delayMs));
|
|
14337
15208
|
}
|
|
14338
15209
|
var MAX_RETRY_AFTER_MS;
|
|
14339
15210
|
var init_http_utils = __esm({
|
|
@@ -14609,7 +15480,7 @@ var init_api_client = __esm({
|
|
|
14609
15480
|
const progress = maxAttempts > 1 ? attempt / (maxAttempts - 1) : 0;
|
|
14610
15481
|
const baseDelay = intervalMs + (maxIntervalMs - intervalMs) * progress;
|
|
14611
15482
|
const jitter = Math.random() * baseDelay * 0.15;
|
|
14612
|
-
await new Promise((
|
|
15483
|
+
await new Promise((resolve29) => setTimeout(resolve29, baseDelay + jitter));
|
|
14613
15484
|
}
|
|
14614
15485
|
}
|
|
14615
15486
|
throw new Error(`Operation ${operationId} timed out after ${maxAttempts} attempts`);
|
|
@@ -15296,7 +16167,7 @@ var init_collect_json_files = __esm({
|
|
|
15296
16167
|
});
|
|
15297
16168
|
|
|
15298
16169
|
// packages/experience-design-system-backend-pipeline/dist/src/steps/apply/src/helpers/tokens/read-tokens-from-path.js
|
|
15299
|
-
import { readFile as
|
|
16170
|
+
import { readFile as readFile15, stat as stat3 } from "node:fs/promises";
|
|
15300
16171
|
async function readTokensFromPath(flag, p) {
|
|
15301
16172
|
let s;
|
|
15302
16173
|
try {
|
|
@@ -15319,7 +16190,7 @@ async function readMergedFromDir(flag, dir) {
|
|
|
15319
16190
|
const merged = {};
|
|
15320
16191
|
for (const file of files.sort()) {
|
|
15321
16192
|
try {
|
|
15322
|
-
const text = await
|
|
16193
|
+
const text = await readFile15(file, "utf8");
|
|
15323
16194
|
const parsed = JSON.parse(text);
|
|
15324
16195
|
if (typeof parsed === "object" && parsed !== null && !Array.isArray(parsed)) {
|
|
15325
16196
|
Object.assign(merged, parsed);
|
|
@@ -15333,7 +16204,7 @@ async function readMergedFromDir(flag, dir) {
|
|
|
15333
16204
|
async function readSingleFile(flag, p) {
|
|
15334
16205
|
let text;
|
|
15335
16206
|
try {
|
|
15336
|
-
text = await
|
|
16207
|
+
text = await readFile15(p, "utf8");
|
|
15337
16208
|
} catch {
|
|
15338
16209
|
throw new Error(`file not found: ${p} (from ${flag})`);
|
|
15339
16210
|
}
|
|
@@ -15439,12 +16310,12 @@ var init_fetch_and_persist = __esm({
|
|
|
15439
16310
|
});
|
|
15440
16311
|
|
|
15441
16312
|
// packages/experience-design-system-backend-pipeline/dist/src/steps/generation/src/controller/existing-entities/read-from-session.js
|
|
15442
|
-
import { readFile as
|
|
16313
|
+
import { readFile as readFile16 } from "node:fs/promises";
|
|
15443
16314
|
async function readExistingContentfulEntitiesFromSession(request) {
|
|
15444
16315
|
if (!request.path)
|
|
15445
16316
|
return void 0;
|
|
15446
16317
|
try {
|
|
15447
|
-
const raw = await
|
|
16318
|
+
const raw = await readFile16(request.path, "utf8");
|
|
15448
16319
|
const parsed = JSON.parse(raw);
|
|
15449
16320
|
if (!Array.isArray(parsed.components) || !Array.isArray(parsed.tokens))
|
|
15450
16321
|
return void 0;
|
|
@@ -16023,22 +16894,26 @@ async function trackEvent(event, properties, anonymousId, options) {
|
|
|
16023
16894
|
}
|
|
16024
16895
|
}
|
|
16025
16896
|
async function flushAnalytics() {
|
|
16026
|
-
|
|
16027
|
-
|
|
16028
|
-
|
|
16029
|
-
|
|
16030
|
-
} catch {
|
|
16031
|
-
} finally {
|
|
16897
|
+
flushChain = flushChain.then(async () => {
|
|
16898
|
+
const client2 = analyticsClient;
|
|
16899
|
+
if (!client2)
|
|
16900
|
+
return;
|
|
16032
16901
|
analyticsClient = null;
|
|
16033
|
-
|
|
16902
|
+
try {
|
|
16903
|
+
await client2.closeAndFlush();
|
|
16904
|
+
} catch {
|
|
16905
|
+
}
|
|
16906
|
+
});
|
|
16907
|
+
return flushChain;
|
|
16034
16908
|
}
|
|
16035
|
-
var DEFAULT_WRITE_KEY, analyticsClient;
|
|
16909
|
+
var DEFAULT_WRITE_KEY, analyticsClient, flushChain;
|
|
16036
16910
|
var init_segment_client = __esm({
|
|
16037
16911
|
"packages/experience-design-system-backend-pipeline/dist/src/analytics/client/segment-client.js"() {
|
|
16038
16912
|
"use strict";
|
|
16039
16913
|
init_opt_out();
|
|
16040
16914
|
DEFAULT_WRITE_KEY = "6DmxiEPN3SV1vbRTTMcNqDzCvkfwT06N";
|
|
16041
16915
|
analyticsClient = null;
|
|
16916
|
+
flushChain = Promise.resolve();
|
|
16042
16917
|
}
|
|
16043
16918
|
});
|
|
16044
16919
|
|
|
@@ -16317,7 +17192,7 @@ var init_analytics = __esm({
|
|
|
16317
17192
|
});
|
|
16318
17193
|
|
|
16319
17194
|
// packages/experience-design-system-backend-pipeline/dist/src/steps/generation/src/controller/map-tokens/run-map-tokens.js
|
|
16320
|
-
import { resolve as
|
|
17195
|
+
import { resolve as resolve18 } from "node:path";
|
|
16321
17196
|
async function runMapTokens(request) {
|
|
16322
17197
|
const timeoutMs = request.agentTimeoutMs ?? DEFAULT_TIMEOUT_MS2;
|
|
16323
17198
|
const db = openPipelineDb();
|
|
@@ -16368,7 +17243,7 @@ async function runMapTokens(request) {
|
|
|
16368
17243
|
outDir: process.cwd(),
|
|
16369
17244
|
existingTokensInline: request.existingEntitiesInline,
|
|
16370
17245
|
...request.skillContentOverride !== void 0 ? { skillContentOverride: request.skillContentOverride } : {},
|
|
16371
|
-
...request.skillContentOverride === void 0 && request.skillPathOverride ? { skillPathOverride:
|
|
17246
|
+
...request.skillContentOverride === void 0 && request.skillPathOverride ? { skillPathOverride: resolve18(request.skillPathOverride) } : {}
|
|
16372
17247
|
});
|
|
16373
17248
|
if (request.printPrompt) {
|
|
16374
17249
|
const prompt2 = await buildMapPrompt();
|
|
@@ -16584,7 +17459,7 @@ var init_parse_imported_names = __esm({
|
|
|
16584
17459
|
});
|
|
16585
17460
|
|
|
16586
17461
|
// packages/experience-design-system-backend-pipeline/dist/src/steps/extraction/src/helpers/evidence/source-inspection.js
|
|
16587
|
-
import { readFile as
|
|
17462
|
+
import { readFile as readFile17 } from "node:fs/promises";
|
|
16588
17463
|
function escapeRegExp(value) {
|
|
16589
17464
|
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
16590
17465
|
}
|
|
@@ -16617,7 +17492,14 @@ function hasSiblingForwardRender(sourceText, siblingImports) {
|
|
|
16617
17492
|
});
|
|
16618
17493
|
}
|
|
16619
17494
|
function hasVisibleUiRender(sourceText) {
|
|
16620
|
-
|
|
17495
|
+
if (/return\s*(?:\(|<)/.test(sourceText) && VISIBLE_UI_TAG_PATTERN.test(sourceText))
|
|
17496
|
+
return true;
|
|
17497
|
+
if (/template\s*:\s*[`'"][\s\S]*?[`'"]/.test(sourceText)) {
|
|
17498
|
+
const inlineMatch = sourceText.match(/template\s*:\s*[`'"]([\s\S]*?)[`'"]/);
|
|
17499
|
+
if (inlineMatch && VISIBLE_UI_TAG_PATTERN.test(inlineMatch[1]))
|
|
17500
|
+
return true;
|
|
17501
|
+
}
|
|
17502
|
+
return /templateUrl\s*:\s*['"]/.test(sourceText);
|
|
16621
17503
|
}
|
|
16622
17504
|
function infraPropNames(component) {
|
|
16623
17505
|
const props = component.props.map((prop) => prop.name);
|
|
@@ -16640,7 +17522,7 @@ function dedupeReasons(reasons) {
|
|
|
16640
17522
|
async function inspectComponentSource(component) {
|
|
16641
17523
|
let sourceText = "";
|
|
16642
17524
|
try {
|
|
16643
|
-
sourceText = await
|
|
17525
|
+
sourceText = await readFile17(component.source, "utf8");
|
|
16644
17526
|
} catch {
|
|
16645
17527
|
return {
|
|
16646
17528
|
wrapperConfidence: 0,
|
|
@@ -17096,7 +17978,7 @@ async function retryDatabaseWrite(operation, attempts = 8) {
|
|
|
17096
17978
|
const message = error instanceof Error ? error.message : String(error);
|
|
17097
17979
|
if (!/database is locked|database is busy/i.test(message) || attempt >= attempts)
|
|
17098
17980
|
throw error;
|
|
17099
|
-
await new Promise((
|
|
17981
|
+
await new Promise((resolve29) => setTimeout(resolve29, Math.min(250 * attempt, 2e3)));
|
|
17100
17982
|
}
|
|
17101
17983
|
}
|
|
17102
17984
|
}
|
|
@@ -17144,7 +18026,7 @@ var init_resolve_composition_agent_name = __esm({
|
|
|
17144
18026
|
});
|
|
17145
18027
|
|
|
17146
18028
|
// packages/experience-design-system-backend-pipeline/dist/src/orchestrators/run-extract-and-compose-session/helpers/read-candidate-files.js
|
|
17147
|
-
import { readFile as
|
|
18029
|
+
import { readFile as readFile18 } from "node:fs/promises";
|
|
17148
18030
|
async function readCandidateFiles(components, extraFiles = []) {
|
|
17149
18031
|
const paths = new Set(extraFiles);
|
|
17150
18032
|
for (const c2 of components) {
|
|
@@ -17154,7 +18036,7 @@ async function readCandidateFiles(components, extraFiles = []) {
|
|
|
17154
18036
|
const out = [];
|
|
17155
18037
|
await Promise.all([...paths].map(async (p) => {
|
|
17156
18038
|
try {
|
|
17157
|
-
const content = await
|
|
18039
|
+
const content = await readFile18(p, "utf8");
|
|
17158
18040
|
out.push({ path: p, content });
|
|
17159
18041
|
} catch {
|
|
17160
18042
|
}
|
|
@@ -17393,7 +18275,7 @@ var init_write_tokens_file = __esm({
|
|
|
17393
18275
|
});
|
|
17394
18276
|
|
|
17395
18277
|
// packages/experience-design-system-backend-pipeline/dist/src/orchestrators/run-generate-tokens-session/run-generate-tokens-session.js
|
|
17396
|
-
import { readFile as
|
|
18278
|
+
import { readFile as readFile19 } from "node:fs/promises";
|
|
17397
18279
|
import { basename as basename5, resolve as pathResolve } from "node:path";
|
|
17398
18280
|
async function runGenerateTokensSession(request) {
|
|
17399
18281
|
const { rawTokensPath, outDir, agent, agentModel, promptOverrides, skillPath, noCache, bedrock = false, onProgress, onSessionCreated } = request;
|
|
@@ -17402,7 +18284,7 @@ async function runGenerateTokensSession(request) {
|
|
|
17402
18284
|
throw new Error(`Prompt override error(s): ${promptErrors.join("; ")}`);
|
|
17403
18285
|
const tokensOverride = overridesMap.get("tokens");
|
|
17404
18286
|
const skillContentOverride = tokensOverride ? await resolvePromptOverride(tokensOverride) : void 0;
|
|
17405
|
-
const rawTokensInline = await
|
|
18287
|
+
const rawTokensInline = await readFile19(pathResolve(rawTokensPath), "utf8");
|
|
17406
18288
|
const tokenInputHash = hashTokenContent(rawTokensInline);
|
|
17407
18289
|
const db = openPipelineDb();
|
|
17408
18290
|
try {
|
|
@@ -17553,7 +18435,7 @@ var init_read_existing_entities = __esm({
|
|
|
17553
18435
|
});
|
|
17554
18436
|
|
|
17555
18437
|
// packages/experience-design-system-backend-pipeline/dist/src/orchestrators/run-generate-components-session/helpers/resolve-generate-prompt.js
|
|
17556
|
-
import { resolve as
|
|
18438
|
+
import { resolve as resolve19 } from "node:path";
|
|
17557
18439
|
async function resolveGeneratePrompt(overrides) {
|
|
17558
18440
|
const { overrides: parsed, errors } = parsePromptOverrides(overrides);
|
|
17559
18441
|
if (errors.length > 0)
|
|
@@ -17564,7 +18446,7 @@ async function resolveGeneratePrompt(overrides) {
|
|
|
17564
18446
|
const text = await resolvePromptOverride(entry);
|
|
17565
18447
|
if (entry.kind === "text")
|
|
17566
18448
|
return { text };
|
|
17567
|
-
return { path:
|
|
18449
|
+
return { path: resolve19(entry.value), text };
|
|
17568
18450
|
}
|
|
17569
18451
|
var init_resolve_generate_prompt = __esm({
|
|
17570
18452
|
"packages/experience-design-system-backend-pipeline/dist/src/orchestrators/run-generate-components-session/helpers/resolve-generate-prompt.js"() {
|
|
@@ -18067,10 +18949,10 @@ var init_src3 = __esm({
|
|
|
18067
18949
|
|
|
18068
18950
|
// packages/experience-design-system-cli/src/tui/package-root.ts
|
|
18069
18951
|
import { existsSync as existsSync7, readFileSync as readFileSync7 } from "node:fs";
|
|
18070
|
-
import { dirname as
|
|
18952
|
+
import { dirname as dirname13, join as join14 } from "node:path";
|
|
18071
18953
|
import { fileURLToPath as fileURLToPath3 } from "node:url";
|
|
18072
18954
|
function findPackageRoot(startUrl, packageName) {
|
|
18073
|
-
let dir =
|
|
18955
|
+
let dir = dirname13(fileURLToPath3(startUrl));
|
|
18074
18956
|
let found;
|
|
18075
18957
|
while (true) {
|
|
18076
18958
|
const manifestPath = join14(dir, "package.json");
|
|
@@ -18078,7 +18960,7 @@ function findPackageRoot(startUrl, packageName) {
|
|
|
18078
18960
|
const pkg2 = JSON.parse(readFileSync7(manifestPath, "utf8"));
|
|
18079
18961
|
if (pkg2.name === packageName) found = dir;
|
|
18080
18962
|
}
|
|
18081
|
-
const parent =
|
|
18963
|
+
const parent = dirname13(dir);
|
|
18082
18964
|
if (parent === dir) return found ?? dir;
|
|
18083
18965
|
dir = parent;
|
|
18084
18966
|
}
|
|
@@ -18091,22 +18973,22 @@ var init_package_root = __esm({
|
|
|
18091
18973
|
|
|
18092
18974
|
// packages/experience-design-system-types/dist/src/config/index.js
|
|
18093
18975
|
import { randomBytes as randomBytes4 } from "node:crypto";
|
|
18094
|
-
import { mkdir as mkdir6, readFile as
|
|
18976
|
+
import { mkdir as mkdir6, readFile as readFile20, rename as rename2, writeFile as writeFile6 } from "node:fs/promises";
|
|
18095
18977
|
import { homedir as homedir2 } from "node:os";
|
|
18096
|
-
import { dirname as
|
|
18978
|
+
import { dirname as dirname14, join as join16 } from "node:path";
|
|
18097
18979
|
function configRoot2() {
|
|
18098
18980
|
return process.env["EDS_HOME"] || join16(homedir2(), ".contentful", "experience-design-system-cli");
|
|
18099
18981
|
}
|
|
18100
18982
|
async function readSettings2() {
|
|
18101
18983
|
try {
|
|
18102
|
-
return JSON.parse(await
|
|
18984
|
+
return JSON.parse(await readFile20(configFilePath2(), "utf8"));
|
|
18103
18985
|
} catch {
|
|
18104
18986
|
return {};
|
|
18105
18987
|
}
|
|
18106
18988
|
}
|
|
18107
18989
|
async function writeSettings2(settings) {
|
|
18108
18990
|
const path5 = configFilePath2();
|
|
18109
|
-
await mkdir6(
|
|
18991
|
+
await mkdir6(dirname14(path5), { recursive: true });
|
|
18110
18992
|
const tmp = `${path5}.${process.pid}.${randomBytes4(4).toString("hex")}.tmp`;
|
|
18111
18993
|
await writeFile6(tmp, `${JSON.stringify(settings, null, 2)}
|
|
18112
18994
|
`, { mode: 384 });
|
|
@@ -18487,7 +19369,7 @@ var init_home = __esm({
|
|
|
18487
19369
|
init_use_terminal_width();
|
|
18488
19370
|
init_ControlHints();
|
|
18489
19371
|
VERSION = readPackageVersion();
|
|
18490
|
-
HEADING = "
|
|
19372
|
+
HEADING = "Design System Import";
|
|
18491
19373
|
MIN_TERMINAL_WIDTH = 164;
|
|
18492
19374
|
START_ITEMS = [
|
|
18493
19375
|
{ label: "Import", screen: "import" },
|
|
@@ -18771,6 +19653,7 @@ function StepHeader({ step }) {
|
|
|
18771
19653
|
{
|
|
18772
19654
|
justifyContent: "space-between",
|
|
18773
19655
|
paddingX: 2,
|
|
19656
|
+
paddingTop: 1,
|
|
18774
19657
|
marginBottom: 1,
|
|
18775
19658
|
borderStyle: "single",
|
|
18776
19659
|
borderColor: PALETTE.border,
|
|
@@ -19143,17 +20026,19 @@ function WelcomeScreen({ onContinue, onQuit, initialPath = "" }) {
|
|
|
19143
20026
|
const path5 = toProjectPath(value);
|
|
19144
20027
|
if (path5) onContinue(path5);
|
|
19145
20028
|
};
|
|
19146
|
-
return /* @__PURE__ */ jsxs10(Box10, { flexDirection: "column",
|
|
19147
|
-
/* @__PURE__ */ jsx11(
|
|
19148
|
-
/* @__PURE__ */ jsxs10(Box10, { flexDirection: "column", gap: 1, children: [
|
|
19149
|
-
/* @__PURE__ */
|
|
19150
|
-
|
|
19151
|
-
/* @__PURE__ */
|
|
19152
|
-
|
|
19153
|
-
|
|
19154
|
-
|
|
19155
|
-
|
|
19156
|
-
|
|
20029
|
+
return /* @__PURE__ */ jsxs10(Box10, { flexDirection: "column", children: [
|
|
20030
|
+
/* @__PURE__ */ jsx11(StepHeader, { step: "setup" }),
|
|
20031
|
+
/* @__PURE__ */ jsxs10(Box10, { flexDirection: "column", gap: 1, paddingX: 2, paddingBottom: 1, children: [
|
|
20032
|
+
/* @__PURE__ */ jsxs10(Box10, { flexDirection: "column", gap: 1, children: [
|
|
20033
|
+
/* @__PURE__ */ jsx11(Text10, { color: PALETTE.text, children: "Where is your component library?" }),
|
|
20034
|
+
/* @__PURE__ */ jsxs10(Box10, { children: [
|
|
20035
|
+
/* @__PURE__ */ jsx11(Text10, { color: PALETTE.accent, children: "? " }),
|
|
20036
|
+
/* @__PURE__ */ jsx11(Text10, { children: "Project path: " }),
|
|
20037
|
+
/* @__PURE__ */ jsx11(ClearableTextInput, { value: projectPath, onChange: setProjectPath, onSubmit: submit })
|
|
20038
|
+
] })
|
|
20039
|
+
] }),
|
|
20040
|
+
/* @__PURE__ */ jsx11(Box10, { children: /* @__PURE__ */ jsx11(ControlHints, { hints: WELCOME_CONTROLS }) })
|
|
20041
|
+
] })
|
|
19157
20042
|
] });
|
|
19158
20043
|
}
|
|
19159
20044
|
var init_screen2 = __esm({
|
|
@@ -19164,6 +20049,7 @@ var init_screen2 = __esm({
|
|
|
19164
20049
|
init_controls4();
|
|
19165
20050
|
init_logic5();
|
|
19166
20051
|
init_ControlHints();
|
|
20052
|
+
init_StepHeader();
|
|
19167
20053
|
}
|
|
19168
20054
|
});
|
|
19169
20055
|
|
|
@@ -19203,7 +20089,7 @@ var init_controls5 = __esm({
|
|
|
19203
20089
|
|
|
19204
20090
|
// packages/experience-design-system-cli/src/tui/import/resolve-user-path.ts
|
|
19205
20091
|
import { homedir as homedir3 } from "node:os";
|
|
19206
|
-
import { resolve as
|
|
20092
|
+
import { resolve as resolve20 } from "node:path";
|
|
19207
20093
|
function stripQuotes(value) {
|
|
19208
20094
|
const quoted = value.startsWith('"') && value.endsWith('"') || value.startsWith("'") && value.endsWith("'");
|
|
19209
20095
|
return value.length >= 2 && quoted ? value.slice(1, -1) : value;
|
|
@@ -19212,7 +20098,7 @@ function expandHome(value) {
|
|
|
19212
20098
|
return value === "~" || value.startsWith("~/") || value.startsWith("~\\") ? homedir3() + value.slice(1) : value;
|
|
19213
20099
|
}
|
|
19214
20100
|
function resolveUserPath(raw) {
|
|
19215
|
-
return
|
|
20101
|
+
return resolve20(expandHome(stripQuotes(raw.trim())));
|
|
19216
20102
|
}
|
|
19217
20103
|
var init_resolve_user_path = __esm({
|
|
19218
20104
|
"packages/experience-design-system-cli/src/tui/import/resolve-user-path.ts"() {
|
|
@@ -19221,12 +20107,12 @@ var init_resolve_user_path = __esm({
|
|
|
19221
20107
|
});
|
|
19222
20108
|
|
|
19223
20109
|
// packages/experience-design-system-cli/src/tui/import/steps/02-token-input/validate-path.ts
|
|
19224
|
-
import { statSync as
|
|
20110
|
+
import { statSync as statSync5 } from "node:fs";
|
|
19225
20111
|
function validateTokenPath(rawPath) {
|
|
19226
20112
|
const path5 = resolveUserPath(rawPath);
|
|
19227
20113
|
let stats;
|
|
19228
20114
|
try {
|
|
19229
|
-
stats =
|
|
20115
|
+
stats = statSync5(path5);
|
|
19230
20116
|
} catch {
|
|
19231
20117
|
return { ok: false, error: `Path not found: ${path5}`, resolvedPath: path5 };
|
|
19232
20118
|
}
|
|
@@ -19565,6 +20451,9 @@ function FieldForm({
|
|
|
19565
20451
|
onChange,
|
|
19566
20452
|
onSave,
|
|
19567
20453
|
saveLabel = "save",
|
|
20454
|
+
enterAdvances = false,
|
|
20455
|
+
onSkip,
|
|
20456
|
+
skipLabel: skipLabel2 = "skip",
|
|
19568
20457
|
onQuit,
|
|
19569
20458
|
quitLabel = "back without saving",
|
|
19570
20459
|
actions = [],
|
|
@@ -19596,6 +20485,10 @@ function FieldForm({
|
|
|
19596
20485
|
onSave();
|
|
19597
20486
|
return;
|
|
19598
20487
|
}
|
|
20488
|
+
if (input === "k" && onSkip) {
|
|
20489
|
+
onSkip();
|
|
20490
|
+
return;
|
|
20491
|
+
}
|
|
19599
20492
|
if (isClearKey(input, key) && currentField) {
|
|
19600
20493
|
onChange(currentField.key, "");
|
|
19601
20494
|
return;
|
|
@@ -19617,6 +20510,21 @@ function FieldForm({
|
|
|
19617
20510
|
}
|
|
19618
20511
|
}
|
|
19619
20512
|
});
|
|
20513
|
+
const isLastField = active === fields2.length - 1;
|
|
20514
|
+
const submitField = () => {
|
|
20515
|
+
if (!enterAdvances) {
|
|
20516
|
+
setEditing(false);
|
|
20517
|
+
return;
|
|
20518
|
+
}
|
|
20519
|
+
if (isLastField) {
|
|
20520
|
+
setEditing(false);
|
|
20521
|
+
onSave();
|
|
20522
|
+
return;
|
|
20523
|
+
}
|
|
20524
|
+
const next = fields2[active + 1];
|
|
20525
|
+
setValueBeforeEdit(values[next.key]);
|
|
20526
|
+
setActive(active + 1);
|
|
20527
|
+
};
|
|
19620
20528
|
const pointer = (isActive) => /* @__PURE__ */ jsx14(Text13, { color: isActive ? PALETTE.accent : void 0, children: isActive ? "\u276F" : " " });
|
|
19621
20529
|
return /* @__PURE__ */ jsxs13(Box13, { flexDirection: "column", children: [
|
|
19622
20530
|
header,
|
|
@@ -19638,7 +20546,7 @@ function FieldForm({
|
|
|
19638
20546
|
{
|
|
19639
20547
|
value,
|
|
19640
20548
|
onChange: (next) => onChange(field.key, next),
|
|
19641
|
-
onSubmit:
|
|
20549
|
+
onSubmit: submitField,
|
|
19642
20550
|
mask: field.masked ? "\u2022" : void 0
|
|
19643
20551
|
}
|
|
19644
20552
|
) : display ? /* @__PURE__ */ jsx14(Text13, { bold: true, children: display }) : (
|
|
@@ -19674,7 +20582,7 @@ function FieldForm({
|
|
|
19674
20582
|
hints: editing ? [
|
|
19675
20583
|
{ keys: "type", label: "edit" },
|
|
19676
20584
|
{ keys: "\u2190/\u2192", label: "move cursor" },
|
|
19677
|
-
{ keys: "\u23CE", label: "done" },
|
|
20585
|
+
{ keys: "\u23CE", label: enterAdvances ? isLastField ? saveLabel : "next" : "done" },
|
|
19678
20586
|
{ keys: "Ctrl+D", label: "clear" },
|
|
19679
20587
|
{ keys: "Esc", label: "cancel edit" }
|
|
19680
20588
|
] : [
|
|
@@ -19682,6 +20590,7 @@ function FieldForm({
|
|
|
19682
20590
|
{ keys: "\u23CE", label: currentAction ? currentAction.hint : "edit" },
|
|
19683
20591
|
...currentField ? [{ keys: "Ctrl+D", label: "clear" }] : [],
|
|
19684
20592
|
{ keys: "s", label: saveLabel },
|
|
20593
|
+
...onSkip ? [{ keys: "k", label: skipLabel2 }] : [],
|
|
19685
20594
|
{ keys: "Esc/q", label: quitLabel }
|
|
19686
20595
|
]
|
|
19687
20596
|
}
|
|
@@ -19775,8 +20684,71 @@ var init_validate4 = __esm({
|
|
|
19775
20684
|
|
|
19776
20685
|
// packages/experience-design-system-cli/src/tui/import/steps/04-credentials/screen.tsx
|
|
19777
20686
|
import { useRef as useRef2, useState as useState9 } from "react";
|
|
19778
|
-
import { Text as Text14 } from "ink";
|
|
20687
|
+
import { Box as Box14, Text as Text14, useInput as useInput11 } from "ink";
|
|
19779
20688
|
import { Fragment as Fragment2, jsx as jsx15, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
20689
|
+
function CredentialsReview({
|
|
20690
|
+
values,
|
|
20691
|
+
subtitle,
|
|
20692
|
+
notice,
|
|
20693
|
+
validating,
|
|
20694
|
+
onChoose,
|
|
20695
|
+
children
|
|
20696
|
+
}) {
|
|
20697
|
+
const [focus, setFocus] = useState9(0);
|
|
20698
|
+
useInput11((_input, key) => {
|
|
20699
|
+
if (validating) return;
|
|
20700
|
+
if (key.escape) onChoose("quit");
|
|
20701
|
+
else if (key.return) onChoose(MENU[focus].choice);
|
|
20702
|
+
else if (key.upArrow) setFocus((current) => (current - 1 + MENU.length) % MENU.length);
|
|
20703
|
+
else if (key.downArrow || key.tab) setFocus((current) => (current + 1) % MENU.length);
|
|
20704
|
+
});
|
|
20705
|
+
const labelWidth = formLabelWidth([...FIELDS2, ...MENU]);
|
|
20706
|
+
return /* @__PURE__ */ jsxs14(Box14, { flexDirection: "column", children: [
|
|
20707
|
+
/* @__PURE__ */ jsx15(StepHeader, { step: "setup" }),
|
|
20708
|
+
/* @__PURE__ */ jsxs14(Box14, { flexDirection: "column", paddingX: 2, paddingBottom: 1, children: [
|
|
20709
|
+
/* @__PURE__ */ jsx15(Text14, { bold: true, children: "Contentful Credentials" }),
|
|
20710
|
+
/* @__PURE__ */ jsx15(Text14, { children: " " }),
|
|
20711
|
+
/* @__PURE__ */ jsx15(Text14, { color: PALETTE.muted, children: subtitle }),
|
|
20712
|
+
/* @__PURE__ */ jsx15(Text14, { children: " " }),
|
|
20713
|
+
MENU.map((item, index) => {
|
|
20714
|
+
const focused = index === focus;
|
|
20715
|
+
return /* @__PURE__ */ jsxs14(Box14, { gap: 1, children: [
|
|
20716
|
+
/* @__PURE__ */ jsx15(Text14, { color: focused ? PALETTE.accent : void 0, children: focused ? "\u276F" : " " }),
|
|
20717
|
+
/* @__PURE__ */ jsx15(Box14, { width: labelWidth, flexShrink: 0, children: /* @__PURE__ */ jsx15(Text14, { bold: focused, color: focused ? PALETTE.accent : PALETTE.muted, children: item.label }) }),
|
|
20718
|
+
/* @__PURE__ */ jsx15(Text14, { color: PALETTE.muted, children: item.description })
|
|
20719
|
+
] }, item.choice);
|
|
20720
|
+
}),
|
|
20721
|
+
/* @__PURE__ */ jsx15(Text14, { children: " " }),
|
|
20722
|
+
FIELDS2.map((field) => {
|
|
20723
|
+
const value = values[field.key];
|
|
20724
|
+
return /* @__PURE__ */ jsx15(FormReadOnlyRow, { label: field.label, labelWidth, children: /* @__PURE__ */ jsx15(Text14, { bold: value !== "", children: field.masked ? "\u2022".repeat(value.length) : value || "(empty)" }) }, field.key);
|
|
20725
|
+
}),
|
|
20726
|
+
notice && /* @__PURE__ */ jsxs14(Fragment2, { children: [
|
|
20727
|
+
/* @__PURE__ */ jsx15(Text14, { children: " " }),
|
|
20728
|
+
/* @__PURE__ */ jsxs14(Text14, { color: PALETTE.error, children: [
|
|
20729
|
+
"\u2717 ",
|
|
20730
|
+
notice.text
|
|
20731
|
+
] })
|
|
20732
|
+
] }),
|
|
20733
|
+
validating && /* @__PURE__ */ jsxs14(Fragment2, { children: [
|
|
20734
|
+
/* @__PURE__ */ jsx15(Text14, { children: " " }),
|
|
20735
|
+
/* @__PURE__ */ jsx15(Text14, { color: PALETTE.accent, children: "Validating credentials..." })
|
|
20736
|
+
] }),
|
|
20737
|
+
children,
|
|
20738
|
+
/* @__PURE__ */ jsx15(Text14, { children: " " }),
|
|
20739
|
+
/* @__PURE__ */ jsx15(
|
|
20740
|
+
ControlHints,
|
|
20741
|
+
{
|
|
20742
|
+
hints: [
|
|
20743
|
+
{ keys: "\u2191/\u2193", label: "move" },
|
|
20744
|
+
{ keys: "\u23CE", label: MENU[focus].label.toLowerCase() },
|
|
20745
|
+
{ keys: "Esc", label: "back" }
|
|
20746
|
+
]
|
|
20747
|
+
}
|
|
20748
|
+
)
|
|
20749
|
+
] })
|
|
20750
|
+
] });
|
|
20751
|
+
}
|
|
19780
20752
|
function CredentialsScreen({
|
|
19781
20753
|
onDone,
|
|
19782
20754
|
onBack,
|
|
@@ -19796,6 +20768,7 @@ function CredentialsScreen({
|
|
|
19796
20768
|
const [notice, setNotice] = useState9(null);
|
|
19797
20769
|
const [validating, setValidating] = useState9(false);
|
|
19798
20770
|
const prefilled = initialValues.spaceId !== "" && initialValues.cmaToken !== "";
|
|
20771
|
+
const [editing, setEditing] = useState9(!prefilled);
|
|
19799
20772
|
const submit = async () => {
|
|
19800
20773
|
const credentials = normalize(values);
|
|
19801
20774
|
if (missingField(credentials)) {
|
|
@@ -19808,38 +20781,38 @@ function CredentialsScreen({
|
|
|
19808
20781
|
if (result.ok) onDone({ skipped: false, credentials });
|
|
19809
20782
|
else setNotice({ kind: "error", text: result.error });
|
|
19810
20783
|
};
|
|
20784
|
+
const subtitle = prefilled ? "Credentials pre-filled from the configuration settings." : "Enter the Contentful space you want to import into.";
|
|
20785
|
+
const choose = (choice) => {
|
|
20786
|
+
if (choice === "continue") void submit();
|
|
20787
|
+
else if (choice === "edit") {
|
|
20788
|
+
setNotice(null);
|
|
20789
|
+
setEditing(true);
|
|
20790
|
+
} else if (choice === "skip") onDone({ skipped: true });
|
|
20791
|
+
else onBack();
|
|
20792
|
+
};
|
|
20793
|
+
if (!editing) {
|
|
20794
|
+
return /* @__PURE__ */ jsx15(CredentialsReview, { values, subtitle, notice, validating, onChoose: choose, children: !isUnchanged(normalize(values), initialValues) && /* @__PURE__ */ jsxs14(Fragment2, { children: [
|
|
20795
|
+
/* @__PURE__ */ jsx15(Text14, { children: " " }),
|
|
20796
|
+
/* @__PURE__ */ jsx15(Text14, { color: PALETTE.muted, children: "Changed values are saved after they validate." })
|
|
20797
|
+
] }) });
|
|
20798
|
+
}
|
|
19811
20799
|
return /* @__PURE__ */ jsxs14(
|
|
19812
20800
|
FieldForm,
|
|
19813
20801
|
{
|
|
19814
20802
|
header: /* @__PURE__ */ jsx15(StepHeader, { step: "setup" }),
|
|
19815
20803
|
title: "Contentful Credentials",
|
|
19816
|
-
subtitle
|
|
20804
|
+
subtitle,
|
|
19817
20805
|
fields: FIELDS2,
|
|
19818
20806
|
values,
|
|
19819
20807
|
onChange: (key, value) => {
|
|
19820
20808
|
setValues((current) => ({ ...current, [key]: value }));
|
|
19821
20809
|
setNotice(null);
|
|
19822
20810
|
},
|
|
19823
|
-
|
|
19824
|
-
{
|
|
19825
|
-
label: "Continue",
|
|
19826
|
-
description: "Check the credentials and go on",
|
|
19827
|
-
runningText: "Validating credentials...",
|
|
19828
|
-
running: validating,
|
|
19829
|
-
hint: "continue",
|
|
19830
|
-
onRun: () => void submit()
|
|
19831
|
-
},
|
|
19832
|
-
{
|
|
19833
|
-
label: "Skip",
|
|
19834
|
-
description: "Save files only, nothing is pushed",
|
|
19835
|
-
hint: "skip",
|
|
19836
|
-
onRun: () => onDone({ skipped: true })
|
|
19837
|
-
}
|
|
19838
|
-
],
|
|
20811
|
+
enterAdvances: true,
|
|
19839
20812
|
onSave: () => void submit(),
|
|
19840
20813
|
saveLabel: "continue",
|
|
19841
|
-
onQuit: onBack,
|
|
19842
|
-
quitLabel: "back",
|
|
20814
|
+
onQuit: prefilled ? () => setEditing(false) : onBack,
|
|
20815
|
+
quitLabel: prefilled ? "stop editing" : "back",
|
|
19843
20816
|
notice,
|
|
19844
20817
|
busy: validating,
|
|
19845
20818
|
children: [
|
|
@@ -19848,6 +20821,10 @@ function CredentialsScreen({
|
|
|
19848
20821
|
/* @__PURE__ */ jsx15(Text14, { color: PALETTE.muted, children: credentialsPurpose(tokensOnly) }),
|
|
19849
20822
|
/* @__PURE__ */ jsx15(Text14, { color: PALETTE.muted, children: "Tip: save these under Settings \u2192 Configuration so they pre-fill here." })
|
|
19850
20823
|
] }),
|
|
20824
|
+
validating && /* @__PURE__ */ jsxs14(Fragment2, { children: [
|
|
20825
|
+
/* @__PURE__ */ jsx15(Text14, { children: " " }),
|
|
20826
|
+
/* @__PURE__ */ jsx15(Text14, { color: PALETTE.accent, children: "Validating credentials..." })
|
|
20827
|
+
] }),
|
|
19851
20828
|
!validating && !notice && !isUnchanged(normalize(values), initialValues) && /* @__PURE__ */ jsxs14(Fragment2, { children: [
|
|
19852
20829
|
/* @__PURE__ */ jsx15(Text14, { children: " " }),
|
|
19853
20830
|
/* @__PURE__ */ jsx15(Text14, { color: PALETTE.muted, children: "Changed values are saved after they validate." })
|
|
@@ -19856,12 +20833,13 @@ function CredentialsScreen({
|
|
|
19856
20833
|
}
|
|
19857
20834
|
);
|
|
19858
20835
|
}
|
|
19859
|
-
var FIELDS2;
|
|
20836
|
+
var FIELDS2, MENU;
|
|
19860
20837
|
var init_screen5 = __esm({
|
|
19861
20838
|
"packages/experience-design-system-cli/src/tui/import/steps/04-credentials/screen.tsx"() {
|
|
19862
20839
|
"use strict";
|
|
19863
20840
|
init_theme();
|
|
19864
20841
|
init_FieldForm();
|
|
20842
|
+
init_ControlHints();
|
|
19865
20843
|
init_StepHeader();
|
|
19866
20844
|
init_logic8();
|
|
19867
20845
|
init_validate4();
|
|
@@ -19871,6 +20849,12 @@ var init_screen5 = __esm({
|
|
|
19871
20849
|
{ key: "cmaToken", label: "CMA Token", masked: true },
|
|
19872
20850
|
{ key: "host", label: "API Host", hint: "(default: api.contentful.com \xB7 EU spaces: api.eu.contentful.com)" }
|
|
19873
20851
|
];
|
|
20852
|
+
MENU = [
|
|
20853
|
+
{ choice: "continue", label: "Continue", description: "Check the credentials and go on" },
|
|
20854
|
+
{ choice: "edit", label: "Edit", description: "Change the credentials" },
|
|
20855
|
+
{ choice: "skip", label: "Skip", description: "Save files only, nothing is pushed" },
|
|
20856
|
+
{ choice: "quit", label: "Quit", description: "Go back" }
|
|
20857
|
+
];
|
|
19874
20858
|
}
|
|
19875
20859
|
});
|
|
19876
20860
|
|
|
@@ -19996,15 +20980,15 @@ var init_steps = __esm({
|
|
|
19996
20980
|
|
|
19997
20981
|
// packages/experience-design-system-cli/src/tui/import/steps/06-extraction/find-skill-path.ts
|
|
19998
20982
|
import { existsSync as existsSync9 } from "node:fs";
|
|
19999
|
-
import { dirname as
|
|
20983
|
+
import { dirname as dirname15, join as join18, resolve as resolve21 } from "node:path";
|
|
20000
20984
|
import { fileURLToPath as fileURLToPath4 } from "node:url";
|
|
20001
20985
|
function findSkillPath(fileName) {
|
|
20002
|
-
const thisDir =
|
|
20986
|
+
const thisDir = dirname15(fileURLToPath4(import.meta.url));
|
|
20003
20987
|
let dir = thisDir;
|
|
20004
20988
|
for (; ; ) {
|
|
20005
20989
|
const candidate = join18(dir, "skills", fileName);
|
|
20006
20990
|
if (existsSync9(candidate)) return candidate;
|
|
20007
|
-
const parent =
|
|
20991
|
+
const parent = resolve21(dir, "..");
|
|
20008
20992
|
if (parent === dir) {
|
|
20009
20993
|
throw new Error(`skill file not found (looked for skills/${fileName} from ${thisDir})`);
|
|
20010
20994
|
}
|
|
@@ -20018,9 +21002,9 @@ var init_find_skill_path = __esm({
|
|
|
20018
21002
|
});
|
|
20019
21003
|
|
|
20020
21004
|
// packages/experience-design-system-cli/src/tui/import/steps/06-extraction/selection.ts
|
|
20021
|
-
import { resolve as
|
|
21005
|
+
import { resolve as resolve22 } from "node:path";
|
|
20022
21006
|
async function hashSelectPrompt(options) {
|
|
20023
|
-
const promptHash = options.promptText ? hashContent(options.promptText) : options.promptPath ? await hashFile(
|
|
21007
|
+
const promptHash = options.promptText ? hashContent(options.promptText) : options.promptPath ? await hashFile(resolve22(options.promptPath)) : await hashFile(SELECT_SKILL_PATH);
|
|
20024
21008
|
return hashContent(`${promptHash}|${options.agent}|${options.model ?? ""}`);
|
|
20025
21009
|
}
|
|
20026
21010
|
async function runSelection(options) {
|
|
@@ -20115,9 +21099,9 @@ var init_selection2 = __esm({
|
|
|
20115
21099
|
|
|
20116
21100
|
// packages/experience-design-system-cli/src/tui/import/steps/06-extraction/run.ts
|
|
20117
21101
|
import { mkdir as mkdir7 } from "node:fs/promises";
|
|
20118
|
-
import { join as join19, resolve as
|
|
21102
|
+
import { join as join19, resolve as resolve23 } from "node:path";
|
|
20119
21103
|
async function runExtraction(input, onProgress, deps = realDeps) {
|
|
20120
|
-
const outDir = input.outDir ?? join19(
|
|
21104
|
+
const outDir = input.outDir ?? join19(resolve23(input.projectPath), ".contentful");
|
|
20121
21105
|
let progress = initialProgress({
|
|
20122
21106
|
hasCredentials: input.credentials !== null,
|
|
20123
21107
|
hasRawTokens: input.rawTokensPath !== ""
|
|
@@ -20241,7 +21225,7 @@ async function resolveSelectionPrompt(overrides) {
|
|
|
20241
21225
|
if (select?.kind === "text") return { promptText: select.value };
|
|
20242
21226
|
if (select?.kind === "path") {
|
|
20243
21227
|
await resolvePromptOverride(select);
|
|
20244
|
-
return { promptPath:
|
|
21228
|
+
return { promptPath: resolve23(select.value) };
|
|
20245
21229
|
}
|
|
20246
21230
|
return {};
|
|
20247
21231
|
}
|
|
@@ -20480,7 +21464,7 @@ var init_columns = __esm({
|
|
|
20480
21464
|
});
|
|
20481
21465
|
|
|
20482
21466
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/sidebar/components/windowed-panel.tsx
|
|
20483
|
-
import { Box as
|
|
21467
|
+
import { Box as Box15, Text as Text15 } from "ink";
|
|
20484
21468
|
import { jsx as jsx17, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
20485
21469
|
function terminalPanelHeight(rows, reservedRows = 4) {
|
|
20486
21470
|
return Math.max(MIN_TERMINAL_PANEL_HEIGHT, rows - reservedRows);
|
|
@@ -20497,7 +21481,7 @@ function FixedPanel({
|
|
|
20497
21481
|
children
|
|
20498
21482
|
}) {
|
|
20499
21483
|
return /* @__PURE__ */ jsx17(
|
|
20500
|
-
|
|
21484
|
+
Box15,
|
|
20501
21485
|
{
|
|
20502
21486
|
flexDirection: "column",
|
|
20503
21487
|
width,
|
|
@@ -20533,7 +21517,7 @@ function WindowedPanelHeader({
|
|
|
20533
21517
|
width,
|
|
20534
21518
|
focused
|
|
20535
21519
|
}) {
|
|
20536
|
-
return /* @__PURE__ */ jsxs15(
|
|
21520
|
+
return /* @__PURE__ */ jsxs15(Box15, { flexDirection: "column", children: [
|
|
20537
21521
|
/* @__PURE__ */ jsx17(Text15, { bold: true, color: PALETTE.accent, inverse: focused, children: title }),
|
|
20538
21522
|
/* @__PURE__ */ jsx17(Text15, { color: PALETTE.muted, children: "\u2500".repeat(Math.max(0, width - 2)) })
|
|
20539
21523
|
] });
|
|
@@ -20560,7 +21544,7 @@ var init_windowed_panel = __esm({
|
|
|
20560
21544
|
|
|
20561
21545
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/panels/added-column.tsx
|
|
20562
21546
|
import React10 from "react";
|
|
20563
|
-
import { Box as
|
|
21547
|
+
import { Box as Box16, Text as Text16 } from "ink";
|
|
20564
21548
|
import figures2 from "figures";
|
|
20565
21549
|
import { jsx as jsx18, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
20566
21550
|
function AddedColumn(props) {
|
|
@@ -20579,7 +21563,7 @@ function AddedColumn(props) {
|
|
|
20579
21563
|
const style = sideColumnLabelStyle({ isCycle: entry.isCycle, isSelected, focused });
|
|
20580
21564
|
return /* @__PURE__ */ jsxs16(React10.Fragment, { children: [
|
|
20581
21565
|
showSeparator && /* @__PURE__ */ jsx18(Text16, { color: PALETTE.muted, children: "\u2500".repeat(Math.max(0, width - 2)) }),
|
|
20582
|
-
/* @__PURE__ */ jsxs16(
|
|
21566
|
+
/* @__PURE__ */ jsxs16(Box16, { children: [
|
|
20583
21567
|
isCursor ? /* @__PURE__ */ jsx18(Text16, { color: PALETTE.accent, bold: true, children: figures2.pointer }) : /* @__PURE__ */ jsx18(Text16, { children: " " }),
|
|
20584
21568
|
reserveAiBadge && (aiFlagged ? /* @__PURE__ */ jsx18(Text16, { color: PALETTE.warning, bold: true, children: " [\xD7]" }) : /* @__PURE__ */ jsx18(Text16, { children: " " })),
|
|
20585
21569
|
entry.isCycle && /* @__PURE__ */ jsx18(Text16, { color: isCursor ? PALETTE.accent : PALETTE.warning, bold: true, underline: style.nameUnderline, children: " \u26A0" }),
|
|
@@ -20610,7 +21594,7 @@ var init_added_column = __esm({
|
|
|
20610
21594
|
});
|
|
20611
21595
|
|
|
20612
21596
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/panels/cycles-panel.tsx
|
|
20613
|
-
import { Box as
|
|
21597
|
+
import { Box as Box17, Text as Text17 } from "ink";
|
|
20614
21598
|
import figures3 from "figures";
|
|
20615
21599
|
import { jsx as jsx19, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
20616
21600
|
function cycleLabel(cycle, index) {
|
|
@@ -20623,7 +21607,7 @@ function cycleLabel(cycle, index) {
|
|
|
20623
21607
|
return `Cycle ${index + 1}: ${parts.join(" \u2192 ")}`;
|
|
20624
21608
|
}
|
|
20625
21609
|
function CyclesPanel({ cycles, cursor }) {
|
|
20626
|
-
return /* @__PURE__ */ jsxs17(
|
|
21610
|
+
return /* @__PURE__ */ jsxs17(Box17, { flexDirection: "column", borderStyle: "single", borderColor: PALETTE.warning, paddingX: 1, marginTop: 1, children: [
|
|
20627
21611
|
/* @__PURE__ */ jsx19(Text17, { bold: true, color: PALETTE.warning, children: `Cycles detected (${cycles.length}):` }),
|
|
20628
21612
|
/* @__PURE__ */ jsx19(Text17, { children: " " }),
|
|
20629
21613
|
cycles.map((cycle, i) => {
|
|
@@ -20644,10 +21628,10 @@ var init_cycles_panel = __esm({
|
|
|
20644
21628
|
});
|
|
20645
21629
|
|
|
20646
21630
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/panels/reject-prompt.tsx
|
|
20647
|
-
import { Box as
|
|
21631
|
+
import { Box as Box18, Text as Text18 } from "ink";
|
|
20648
21632
|
import { jsx as jsx20, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
20649
21633
|
function RejectPrompt({ pending }) {
|
|
20650
|
-
return /* @__PURE__ */ jsxs18(
|
|
21634
|
+
return /* @__PURE__ */ jsxs18(Box18, { flexDirection: "column", borderStyle: "single", borderColor: PALETTE.warning, paddingX: 1, marginTop: 1, children: [
|
|
20651
21635
|
/* @__PURE__ */ jsx20(Text18, { bold: true, color: PALETTE.warning, children: `Rejecting ${pending.target} will:` }),
|
|
20652
21636
|
pending.ancestors.length > 0 && /* @__PURE__ */ jsx20(Text18, { children: `- Reject ancestors: ${pending.ancestors.join(", ")}` }),
|
|
20653
21637
|
pending.descendants.length > 0 && /* @__PURE__ */ jsx20(Text18, { children: `- Deselect descendants: ${pending.descendants.join(", ")}` }),
|
|
@@ -20687,7 +21671,7 @@ var init_CompactControlBar = __esm({
|
|
|
20687
21671
|
});
|
|
20688
21672
|
|
|
20689
21673
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/sidebar/components/CounterStrip.tsx
|
|
20690
|
-
import { Box as
|
|
21674
|
+
import { Box as Box19, Text as Text19 } from "ink";
|
|
20691
21675
|
import { jsx as jsx22, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
20692
21676
|
function CounterStrip(props) {
|
|
20693
21677
|
const { counters, totalWidth } = props;
|
|
@@ -20696,7 +21680,7 @@ function CounterStrip(props) {
|
|
|
20696
21680
|
const labelRej = condensed ? "Rej" : "Rejected";
|
|
20697
21681
|
const labelUnd = condensed ? "Und" : "Undecided";
|
|
20698
21682
|
const sep = condensed ? " | " : " ";
|
|
20699
|
-
return /* @__PURE__ */ jsx22(
|
|
21683
|
+
return /* @__PURE__ */ jsx22(Box19, { children: /* @__PURE__ */ jsxs19(Text19, { children: [
|
|
20700
21684
|
/* @__PURE__ */ jsxs19(Text19, { color: PALETTE.muted, children: [
|
|
20701
21685
|
labelGrp,
|
|
20702
21686
|
" "
|
|
@@ -20726,7 +21710,7 @@ var init_CounterStrip = __esm({
|
|
|
20726
21710
|
|
|
20727
21711
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/sidebar/components/GotoBanner.tsx
|
|
20728
21712
|
import figures4 from "figures";
|
|
20729
|
-
import { Box as
|
|
21713
|
+
import { Box as Box20, Text as Text20 } from "ink";
|
|
20730
21714
|
import { jsx as jsx23, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
20731
21715
|
function windowStart(rowCount, highlightIndex, maxRows) {
|
|
20732
21716
|
if (rowCount <= maxRows) return 0;
|
|
@@ -20759,7 +21743,7 @@ function GotoBanner({
|
|
|
20759
21743
|
const moreAbove = start;
|
|
20760
21744
|
const moreBelow = rows.length - end;
|
|
20761
21745
|
return /* @__PURE__ */ jsxs20(
|
|
20762
|
-
|
|
21746
|
+
Box20,
|
|
20763
21747
|
{
|
|
20764
21748
|
flexDirection: "column",
|
|
20765
21749
|
borderStyle: "single",
|
|
@@ -21170,7 +22154,7 @@ var init_badge = __esm({
|
|
|
21170
22154
|
|
|
21171
22155
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/sidebar/components/GroupedSidebar.tsx
|
|
21172
22156
|
import figures5 from "figures";
|
|
21173
|
-
import { Box as
|
|
22157
|
+
import { Box as Box21, Text as Text22 } from "ink";
|
|
21174
22158
|
import { jsx as jsx25, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
21175
22159
|
function hasDirectChild(node) {
|
|
21176
22160
|
return node.slots.some((slot) => (slot.allowedComponents ?? []).some((target) => target !== node.name));
|
|
@@ -21621,7 +22605,7 @@ function GroupedSidebar(props) {
|
|
|
21621
22605
|
isOwn: rs?.isOwn ?? false,
|
|
21622
22606
|
isCursor
|
|
21623
22607
|
});
|
|
21624
|
-
return /* @__PURE__ */ jsxs21(
|
|
22608
|
+
return /* @__PURE__ */ jsxs21(Box21, { children: [
|
|
21625
22609
|
isCursor ? /* @__PURE__ */ jsx25(Text22, { color: PALETTE.accent, bold: true, children: figures5.pointer }) : /* @__PURE__ */ jsx25(Text22, { children: " " }),
|
|
21626
22610
|
/* @__PURE__ */ jsx25(PreviewBadge, { badge, highlighted: isSelected }),
|
|
21627
22611
|
selectionStateByKey !== void 0 && (selGlyph && !isSynthetic ? /* @__PURE__ */ jsx25(Text22, { color: !isSelected && selDim ? PALETTE.muted : selColor, bold: selBold, children: " " + selGlyph }) : /* @__PURE__ */ jsx25(Text22, { children: " " })),
|
|
@@ -21772,7 +22756,7 @@ var init_use_terminal_size = __esm({
|
|
|
21772
22756
|
|
|
21773
22757
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/sidebar/components/HelpOverlay.tsx
|
|
21774
22758
|
import React11 from "react";
|
|
21775
|
-
import { Box as
|
|
22759
|
+
import { Box as Box22, Text as Text23 } from "ink";
|
|
21776
22760
|
import { Fragment as Fragment3, jsx as jsx26, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
21777
22761
|
function HelpOverlay(props) {
|
|
21778
22762
|
const { onClose } = props;
|
|
@@ -21785,7 +22769,7 @@ function HelpOverlay(props) {
|
|
|
21785
22769
|
}, props.handleInput !== false);
|
|
21786
22770
|
if (props.sections) {
|
|
21787
22771
|
return /* @__PURE__ */ jsxs22(
|
|
21788
|
-
|
|
22772
|
+
Box22,
|
|
21789
22773
|
{
|
|
21790
22774
|
flexDirection: "column",
|
|
21791
22775
|
borderStyle: "round",
|
|
@@ -21806,7 +22790,7 @@ function HelpOverlay(props) {
|
|
|
21806
22790
|
}
|
|
21807
22791
|
const mode = props.mode;
|
|
21808
22792
|
return /* @__PURE__ */ jsxs22(
|
|
21809
|
-
|
|
22793
|
+
Box22,
|
|
21810
22794
|
{
|
|
21811
22795
|
flexDirection: "column",
|
|
21812
22796
|
borderStyle: "round",
|
|
@@ -21919,7 +22903,7 @@ var init_sidebar_input = __esm({
|
|
|
21919
22903
|
});
|
|
21920
22904
|
|
|
21921
22905
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/sidebar/components/SearchMatchSummary.tsx
|
|
21922
|
-
import { Box as
|
|
22906
|
+
import { Box as Box23, Text as Text24 } from "ink";
|
|
21923
22907
|
import { Fragment as Fragment4, jsx as jsx27, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
21924
22908
|
function SearchMatchSummary({
|
|
21925
22909
|
open,
|
|
@@ -21932,7 +22916,7 @@ function SearchMatchSummary({
|
|
|
21932
22916
|
}) {
|
|
21933
22917
|
if (hidden) return null;
|
|
21934
22918
|
return /* @__PURE__ */ jsxs23(Fragment4, { children: [
|
|
21935
|
-
open && /* @__PURE__ */ jsxs23(
|
|
22919
|
+
open && /* @__PURE__ */ jsxs23(Box23, { marginTop, flexDirection: "column", children: [
|
|
21936
22920
|
/* @__PURE__ */ jsxs23(Text24, { children: [
|
|
21937
22921
|
`/${query}`,
|
|
21938
22922
|
/* @__PURE__ */ jsx27(Text24, { color: PALETTE.accent, children: "\u258E" }),
|
|
@@ -21941,7 +22925,7 @@ function SearchMatchSummary({
|
|
|
21941
22925
|
] }),
|
|
21942
22926
|
autocompleteCandidates.length > 1 && /* @__PURE__ */ jsx27(Text24, { color: PALETTE.muted, children: ` possibilities: ${autocompleteCandidates.join(" \xB7 ").slice(0, 120)}` })
|
|
21943
22927
|
] }),
|
|
21944
|
-
!open && query && /* @__PURE__ */ jsx27(
|
|
22928
|
+
!open && query && /* @__PURE__ */ jsx27(Box23, { marginTop, children: /* @__PURE__ */ jsx27(Text24, { children: `/${query}${formatSearchMatchSummary(matches, total)} \xB7 [Esc] clear` }) })
|
|
21945
22929
|
] });
|
|
21946
22930
|
}
|
|
21947
22931
|
var init_SearchMatchSummary = __esm({
|
|
@@ -23201,11 +24185,11 @@ var init_use_scope_gate = __esm({
|
|
|
23201
24185
|
});
|
|
23202
24186
|
|
|
23203
24187
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/screen.tsx
|
|
23204
|
-
import { Box as
|
|
24188
|
+
import { Box as Box24, Text as Text25 } from "ink";
|
|
23205
24189
|
import { Fragment as Fragment5, jsx as jsx28, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
23206
24190
|
function ScopeGateScreen(props) {
|
|
23207
24191
|
if (props.components.length === 0) {
|
|
23208
|
-
return /* @__PURE__ */ jsx28(
|
|
24192
|
+
return /* @__PURE__ */ jsx28(Box24, { paddingX: 2, paddingY: 1, children: /* @__PURE__ */ jsx28(Text25, { color: PALETTE.error, children: "Error: no components found for this session \u2014 please re-run analyze extract." }) });
|
|
23209
24193
|
}
|
|
23210
24194
|
return /* @__PURE__ */ jsx28(ScopeGateView, { ...props });
|
|
23211
24195
|
}
|
|
@@ -23215,18 +24199,18 @@ function ScopeGateView({ components, onConfirm, onQuit }) {
|
|
|
23215
24199
|
if (gate.showHelp) {
|
|
23216
24200
|
return /* @__PURE__ */ jsx28(HelpOverlay, { sections: HELP_SECTIONS, handleInput: false, onClose: gate.closeHelp });
|
|
23217
24201
|
}
|
|
23218
|
-
return /* @__PURE__ */ jsxs24(
|
|
24202
|
+
return /* @__PURE__ */ jsxs24(Box24, { flexDirection: "column", children: [
|
|
23219
24203
|
/* @__PURE__ */ jsx28(StepHeader, { step: "scope-gate" }),
|
|
23220
|
-
/* @__PURE__ */ jsxs24(
|
|
23221
|
-
/* @__PURE__ */ jsxs24(
|
|
24204
|
+
/* @__PURE__ */ jsxs24(Box24, { flexDirection: "column", paddingX: 2, children: [
|
|
24205
|
+
/* @__PURE__ */ jsxs24(Box24, { flexDirection: "row", flexWrap: "wrap", children: [
|
|
23222
24206
|
/* @__PURE__ */ jsx28(CounterStrip, { counters, totalWidth: gate.totalWidth }),
|
|
23223
24207
|
gate.aiExcludedCount > 0 && /* @__PURE__ */ jsxs24(Text25, { color: PALETTE.muted, children: [
|
|
23224
24208
|
`${gate.aiExcludedCount} component${gate.aiExcludedCount === 1 ? "" : "s"} flagged by AI`,
|
|
23225
24209
|
gate.aiRows.length > 0 && /* @__PURE__ */ jsx28(Text25, { color: PALETTE.accent, children: " \u2014 press [x] to see why" })
|
|
23226
24210
|
] })
|
|
23227
24211
|
] }),
|
|
23228
|
-
graph.cycles.length > 0 && /* @__PURE__ */ jsx28(
|
|
23229
|
-
/* @__PURE__ */ jsxs24(
|
|
24212
|
+
graph.cycles.length > 0 && /* @__PURE__ */ jsx28(Box24, { marginTop: 1, children: /* @__PURE__ */ jsx28(Text25, { color: PALETTE.muted, children: "If you must have components with cycles, select them together into the generate step and then use the editor to fix them." }) }),
|
|
24213
|
+
/* @__PURE__ */ jsxs24(Box24, { flexDirection: "row", alignItems: "stretch", children: [
|
|
23230
24214
|
gate.aiRationalePanelOpen ? /* @__PURE__ */ jsx28(
|
|
23231
24215
|
GotoBanner,
|
|
23232
24216
|
{
|
|
@@ -23266,7 +24250,7 @@ function ScopeGateView({ components, onConfirm, onQuit }) {
|
|
|
23266
24250
|
}
|
|
23267
24251
|
),
|
|
23268
24252
|
columnPlan.layout === "two-column" && /* @__PURE__ */ jsxs24(Fragment5, { children: [
|
|
23269
|
-
/* @__PURE__ */ jsx28(
|
|
24253
|
+
/* @__PURE__ */ jsx28(Box24, { width: 2, flexShrink: 0 }),
|
|
23270
24254
|
/* @__PURE__ */ jsx28(
|
|
23271
24255
|
AddedColumn,
|
|
23272
24256
|
{
|
|
@@ -23456,7 +24440,7 @@ function formatAcceptanceSummary(counts) {
|
|
|
23456
24440
|
function describeGeneration(input) {
|
|
23457
24441
|
const agent = capitalize(input.agent);
|
|
23458
24442
|
return `${formatAcceptanceSummary({ accepted: input.acceptedCount, autoRejected: 0 })}
|
|
23459
|
-
${agent} is
|
|
24443
|
+
${agent} is reading each selected component and writing a Contentful component definition for it${input.hasTokens ? " Using your design tokens for prop resolution." : ""}`;
|
|
23460
24444
|
}
|
|
23461
24445
|
function progressRows2(progress, agent) {
|
|
23462
24446
|
const name = capitalize(agent);
|
|
@@ -23559,7 +24543,7 @@ var init_save_decisions = __esm({
|
|
|
23559
24543
|
});
|
|
23560
24544
|
|
|
23561
24545
|
// packages/experience-design-system-cli/src/tui/import/steps/08-generation/run.ts
|
|
23562
|
-
import { resolve as
|
|
24546
|
+
import { resolve as resolve24 } from "node:path";
|
|
23563
24547
|
async function runGeneration(input, onProgress, deps = realDeps4) {
|
|
23564
24548
|
let progress = { components: null, mapTokens: "idle", mapTokensEligible: null };
|
|
23565
24549
|
const update = (change) => {
|
|
@@ -23645,7 +24629,7 @@ async function buildMapTokensOptions(input) {
|
|
|
23645
24629
|
if (mapOverride?.kind === "text") prompt.skillContentOverride = mapOverride.value;
|
|
23646
24630
|
if (mapOverride?.kind === "path") {
|
|
23647
24631
|
await resolvePromptOverride(mapOverride);
|
|
23648
|
-
prompt.skillPathOverride =
|
|
24632
|
+
prompt.skillPathOverride = resolve24(mapOverride.value);
|
|
23649
24633
|
}
|
|
23650
24634
|
if (input.existingEntitiesPath) {
|
|
23651
24635
|
const entities = await readExistingContentfulEntitiesFromSession({ path: input.existingEntitiesPath });
|
|
@@ -24556,7 +25540,7 @@ var init_scroll_offset = __esm({
|
|
|
24556
25540
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/components/FieldEditor.tsx
|
|
24557
25541
|
import React12, { useEffect as useEffect11, useLayoutEffect as useLayoutEffect2, useState as useState18 } from "react";
|
|
24558
25542
|
import figures6 from "figures";
|
|
24559
|
-
import { Box as
|
|
25543
|
+
import { Box as Box25, measureElement, Text as Text26 } from "ink";
|
|
24560
25544
|
import { Fragment as Fragment6, jsx as jsx31, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
24561
25545
|
function createCommonRowProps(selected, focusLevel, editingField, textCursor, valueCursor, cursorVisible, editingValue, valueText, width) {
|
|
24562
25546
|
return {
|
|
@@ -24695,14 +25679,14 @@ function serializeState(state2, originalJson) {
|
|
|
24695
25679
|
return JSON.stringify(entry, null, 2);
|
|
24696
25680
|
}
|
|
24697
25681
|
function Picker({ value, active }) {
|
|
24698
|
-
return /* @__PURE__ */ jsxs25(
|
|
25682
|
+
return /* @__PURE__ */ jsxs25(Box25, { children: [
|
|
24699
25683
|
active && /* @__PURE__ */ jsx31(Text26, { color: PALETTE.warning, children: "\u2039" }),
|
|
24700
25684
|
/* @__PURE__ */ jsx31(Text26, { color: active ? PALETTE.warning : void 0, bold: active, children: value }),
|
|
24701
25685
|
active && /* @__PURE__ */ jsx31(Text26, { color: PALETTE.warning, children: "\u203A" })
|
|
24702
25686
|
] });
|
|
24703
25687
|
}
|
|
24704
25688
|
function Toggle({ value, active }) {
|
|
24705
|
-
return /* @__PURE__ */ jsx31(
|
|
25689
|
+
return /* @__PURE__ */ jsx31(Box25, { children: /* @__PURE__ */ jsx31(Text26, { color: active ? PALETTE.warning : value ? PALETTE.success : PALETTE.border, children: value ? "[\u2713]" : "[ ]" }) });
|
|
24706
25690
|
}
|
|
24707
25691
|
function InlinePropField({
|
|
24708
25692
|
label,
|
|
@@ -24711,7 +25695,7 @@ function InlinePropField({
|
|
|
24711
25695
|
flexible = false,
|
|
24712
25696
|
width
|
|
24713
25697
|
}) {
|
|
24714
|
-
return /* @__PURE__ */ jsxs25(
|
|
25698
|
+
return /* @__PURE__ */ jsxs25(Box25, { width, gap: 1, flexShrink: flexible ? 1 : 0, flexGrow: flexible ? 1 : 0, flexWrap: "wrap", children: [
|
|
24715
25699
|
/* @__PURE__ */ jsxs25(Text26, { color: focused ? PALETTE.warning : PALETTE.muted, bold: focused, wrap: "truncate-end", children: [
|
|
24716
25700
|
focused ? "\u203A " : " ",
|
|
24717
25701
|
label
|
|
@@ -24732,7 +25716,7 @@ function DefaultValueRow({
|
|
|
24732
25716
|
active,
|
|
24733
25717
|
focused
|
|
24734
25718
|
}) {
|
|
24735
|
-
return /* @__PURE__ */ jsxs25(
|
|
25719
|
+
return /* @__PURE__ */ jsxs25(Box25, { gap: 1, flexWrap: "wrap", flexShrink: 0, children: [
|
|
24736
25720
|
/* @__PURE__ */ jsxs25(Text26, { color: focused ? PALETTE.warning : PALETTE.muted, bold: focused, children: [
|
|
24737
25721
|
focused ? "\u203A " : " ",
|
|
24738
25722
|
"default:"
|
|
@@ -24765,7 +25749,7 @@ function ValueInputRow({
|
|
|
24765
25749
|
valueText,
|
|
24766
25750
|
cursorVisible
|
|
24767
25751
|
}) {
|
|
24768
|
-
return /* @__PURE__ */ jsxs25(
|
|
25752
|
+
return /* @__PURE__ */ jsxs25(Box25, { paddingLeft: 2, children: [
|
|
24769
25753
|
/* @__PURE__ */ jsx31(Text26, { color: PALETTE.accent, children: mode === "edit" ? "\u270E " : "+ " }),
|
|
24770
25754
|
/* @__PURE__ */ jsx31(Text26, { children: valueText }),
|
|
24771
25755
|
/* @__PURE__ */ jsx31(Text26, { inverse: cursorVisible, children: " " })
|
|
@@ -24783,7 +25767,7 @@ function EditableListItem({
|
|
|
24783
25767
|
if (isBeingEdited) {
|
|
24784
25768
|
return /* @__PURE__ */ jsx31(ValueInputRow, { mode: "edit", valueText, cursorVisible });
|
|
24785
25769
|
}
|
|
24786
|
-
return /* @__PURE__ */ jsx31(
|
|
25770
|
+
return /* @__PURE__ */ jsx31(Box25, { gap: 1, paddingLeft: 2, children: /* @__PURE__ */ jsx31(Text26, { color: active ? PALETTE.accent : void 0, children: active ? `${figures6.pointer} ${value}` : ` ${value}` }) });
|
|
24787
25771
|
}
|
|
24788
25772
|
function EditableValueList({
|
|
24789
25773
|
values,
|
|
@@ -24797,7 +25781,7 @@ function EditableValueList({
|
|
|
24797
25781
|
showAddInput
|
|
24798
25782
|
}) {
|
|
24799
25783
|
return /* @__PURE__ */ jsxs25(Fragment6, { children: [
|
|
24800
|
-
values.length === 0 && !editingValue && (emptyPaddingLeft === void 0 ? /* @__PURE__ */ jsx31(Text26, { color: PALETTE.muted, children: emptyMessage }) : /* @__PURE__ */ jsx31(
|
|
25784
|
+
values.length === 0 && !editingValue && (emptyPaddingLeft === void 0 ? /* @__PURE__ */ jsx31(Text26, { color: PALETTE.muted, children: emptyMessage }) : /* @__PURE__ */ jsx31(Box25, { paddingLeft: emptyPaddingLeft, children: /* @__PURE__ */ jsx31(Text26, { color: PALETTE.muted, children: emptyMessage }) })),
|
|
24801
25785
|
values.map((value, index) => /* @__PURE__ */ jsx31(
|
|
24802
25786
|
EditableListItem,
|
|
24803
25787
|
{
|
|
@@ -24822,7 +25806,7 @@ function DefaultSubRow({
|
|
|
24822
25806
|
}) {
|
|
24823
25807
|
const cursor = cursorVisible ? "\u2588" : " ";
|
|
24824
25808
|
if (prop.type === "richtext" || prop.type === "media" || prop.type === "link") {
|
|
24825
|
-
return /* @__PURE__ */ jsxs25(
|
|
25809
|
+
return /* @__PURE__ */ jsxs25(Box25, { gap: 1, flexShrink: 0, children: [
|
|
24826
25810
|
/* @__PURE__ */ jsxs25(Text26, { color: focused ? PALETTE.warning : PALETTE.muted, bold: focused, children: [
|
|
24827
25811
|
focused ? "\u203A " : " ",
|
|
24828
25812
|
"default:"
|
|
@@ -24836,7 +25820,7 @@ function DefaultSubRow({
|
|
|
24836
25820
|
}
|
|
24837
25821
|
if (prop.type === "enum") {
|
|
24838
25822
|
if (prop.values.length === 0) {
|
|
24839
|
-
return /* @__PURE__ */ jsxs25(
|
|
25823
|
+
return /* @__PURE__ */ jsxs25(Box25, { gap: 1, flexShrink: 0, children: [
|
|
24840
25824
|
/* @__PURE__ */ jsxs25(Text26, { color: focused ? PALETTE.warning : PALETTE.muted, bold: focused, children: [
|
|
24841
25825
|
focused ? "\u203A " : " ",
|
|
24842
25826
|
"default:"
|
|
@@ -24849,19 +25833,19 @@ function DefaultSubRow({
|
|
|
24849
25833
|
}
|
|
24850
25834
|
const value = typeof prop.default === "string" ? prop.default : "";
|
|
24851
25835
|
if (active) {
|
|
24852
|
-
return /* @__PURE__ */ jsxs25(
|
|
25836
|
+
return /* @__PURE__ */ jsxs25(Box25, { flexDirection: "row", flexShrink: 0, children: [
|
|
24853
25837
|
/* @__PURE__ */ jsxs25(Text26, { color: focused ? PALETTE.warning : PALETTE.muted, bold: focused, children: [
|
|
24854
25838
|
focused ? "\u203A " : " ",
|
|
24855
25839
|
"default:"
|
|
24856
25840
|
] }),
|
|
24857
|
-
/* @__PURE__ */ jsxs25(
|
|
25841
|
+
/* @__PURE__ */ jsxs25(Box25, { flexGrow: 1, borderStyle: "round", borderColor: PALETTE.warning, paddingX: 1, children: [
|
|
24858
25842
|
/* @__PURE__ */ jsx31(Text26, { children: value.slice(0, textCursor) }),
|
|
24859
25843
|
/* @__PURE__ */ jsx31(Text26, { inverse: cursorVisible, children: value[textCursor] ?? cursor }),
|
|
24860
25844
|
/* @__PURE__ */ jsx31(Text26, { children: value.slice(textCursor + 1) })
|
|
24861
25845
|
] })
|
|
24862
25846
|
] });
|
|
24863
25847
|
}
|
|
24864
|
-
return /* @__PURE__ */ jsxs25(
|
|
25848
|
+
return /* @__PURE__ */ jsxs25(Box25, { gap: 1, flexShrink: 0, children: [
|
|
24865
25849
|
/* @__PURE__ */ jsxs25(Text26, { color: focused ? PALETTE.warning : PALETTE.muted, bold: focused, children: [
|
|
24866
25850
|
focused ? "\u203A " : " ",
|
|
24867
25851
|
"default:"
|
|
@@ -24881,7 +25865,7 @@ function DescriptionField({
|
|
|
24881
25865
|
paddingLeft = 2
|
|
24882
25866
|
}) {
|
|
24883
25867
|
if (compact) {
|
|
24884
|
-
return /* @__PURE__ */ jsxs25(
|
|
25868
|
+
return /* @__PURE__ */ jsxs25(Box25, { gap: 1, flexWrap: "wrap", width, flexShrink: 0, children: [
|
|
24885
25869
|
/* @__PURE__ */ jsxs25(Text26, { color: focused ? PALETTE.warning : PALETTE.muted, bold: focused, children: [
|
|
24886
25870
|
focused ? "\u203A " : " ",
|
|
24887
25871
|
label
|
|
@@ -24889,7 +25873,7 @@ function DescriptionField({
|
|
|
24889
25873
|
/* @__PURE__ */ jsx31(Text26, { wrap: "truncate-end", color: value ? void 0 : PALETTE.muted, children: value || "\u2014" })
|
|
24890
25874
|
] });
|
|
24891
25875
|
}
|
|
24892
|
-
return /* @__PURE__ */ jsxs25(
|
|
25876
|
+
return /* @__PURE__ */ jsxs25(Box25, { paddingLeft, flexDirection: "column", width, flexShrink: 0, children: [
|
|
24893
25877
|
/* @__PURE__ */ jsxs25(Text26, { color: focused ? PALETTE.warning : PALETTE.muted, bold: focused, children: [
|
|
24894
25878
|
focused ? "\u203A " : " ",
|
|
24895
25879
|
label
|
|
@@ -24925,8 +25909,8 @@ function PropRow({
|
|
|
24925
25909
|
}) {
|
|
24926
25910
|
const descFocused = activeField === "description";
|
|
24927
25911
|
const descActive = editingField && descFocused;
|
|
24928
|
-
return /* @__PURE__ */ jsxs25(
|
|
24929
|
-
/* @__PURE__ */ jsx31(
|
|
25912
|
+
return /* @__PURE__ */ jsxs25(Box25, { flexDirection: "column", width, flexShrink: 0, children: [
|
|
25913
|
+
/* @__PURE__ */ jsx31(Box25, { gap: 1, flexWrap: "wrap", width, flexShrink: 0, children: /* @__PURE__ */ jsx31(RowLabel, { name: prop.name, selected }) }),
|
|
24930
25914
|
/* @__PURE__ */ jsx31(
|
|
24931
25915
|
DescriptionField,
|
|
24932
25916
|
{
|
|
@@ -24940,7 +25924,7 @@ function PropRow({
|
|
|
24940
25924
|
paddingLeft: 0
|
|
24941
25925
|
}
|
|
24942
25926
|
),
|
|
24943
|
-
/* @__PURE__ */ jsxs25(
|
|
25927
|
+
/* @__PURE__ */ jsxs25(Box25, { flexDirection: "column", width, flexShrink: 0, children: [
|
|
24944
25928
|
/* @__PURE__ */ jsx31(
|
|
24945
25929
|
RequiredField,
|
|
24946
25930
|
{
|
|
@@ -24953,7 +25937,7 @@ function PropRow({
|
|
|
24953
25937
|
/* @__PURE__ */ jsx31(InlinePropField, { label: "type:", focused: activeField === "type", children: editingField && activeField === "type" ? /* @__PURE__ */ jsx31(Picker, { value: prop.type, active: true }) : /* @__PURE__ */ jsx31(Text26, { children: prop.type }) })
|
|
24954
25938
|
] }),
|
|
24955
25939
|
prop.type === "token" && /* @__PURE__ */ jsx31(InlinePropField, { label: "kind:", focused: activeField === "tokenKind", width, children: editingField && activeField === "tokenKind" ? /* @__PURE__ */ jsx31(Picker, { value: prop.tokenKind || DESIGN_TOKEN_TYPES2[0], active: true }) : /* @__PURE__ */ jsx31(Text26, { wrap: "wrap", children: prop.tokenKind || "\u2014" }) }),
|
|
24956
|
-
prop.type === "enum" && /* @__PURE__ */ jsxs25(
|
|
25940
|
+
prop.type === "enum" && /* @__PURE__ */ jsxs25(Box25, { gap: 1, flexWrap: "wrap", width, flexShrink: 0, children: [
|
|
24957
25941
|
/* @__PURE__ */ jsxs25(Text26, { color: activeField === "values" ? PALETTE.warning : PALETTE.muted, bold: activeField === "values", children: [
|
|
24958
25942
|
activeField === "values" ? "\u203A " : " ",
|
|
24959
25943
|
"values:"
|
|
@@ -24974,12 +25958,12 @@ function PropRow({
|
|
|
24974
25958
|
cursorVisible
|
|
24975
25959
|
}
|
|
24976
25960
|
),
|
|
24977
|
-
prop.type === "token" && prop.category === "design" && /* @__PURE__ */ jsxs25(
|
|
25961
|
+
prop.type === "token" && prop.category === "design" && /* @__PURE__ */ jsxs25(Box25, { gap: 1, flexWrap: "wrap", width, flexShrink: 0, children: [
|
|
24978
25962
|
/* @__PURE__ */ jsxs25(Text26, { color: activeField === "allowed" ? PALETTE.warning : PALETTE.muted, bold: activeField === "allowed", children: [
|
|
24979
25963
|
activeField === "allowed" ? "\u203A " : " ",
|
|
24980
25964
|
"allowed:"
|
|
24981
25965
|
] }),
|
|
24982
|
-
editingField && activeField === "allowed" ? /* @__PURE__ */ jsx31(
|
|
25966
|
+
editingField && activeField === "allowed" ? /* @__PURE__ */ jsx31(Box25, { width: Math.max(1, width - 4), borderStyle: "round", borderColor: PALETTE.warning, paddingX: 1, children: /* @__PURE__ */ jsx31(Text26, { children: "press [t] to edit allowed tokens" }) }) : /* @__PURE__ */ jsx31(
|
|
24983
25967
|
Text26,
|
|
24984
25968
|
{
|
|
24985
25969
|
color: activeField !== "allowed" && prop.allowed.length === 0 ? PALETTE.muted : void 0,
|
|
@@ -24988,13 +25972,13 @@ function PropRow({
|
|
|
24988
25972
|
}
|
|
24989
25973
|
)
|
|
24990
25974
|
] }),
|
|
24991
|
-
selected && showRationale && rationale && rationale.trim().length > 0 && /* @__PURE__ */ jsx31(
|
|
25975
|
+
selected && showRationale && rationale && rationale.trim().length > 0 && /* @__PURE__ */ jsx31(Box25, { paddingLeft: 2, children: /* @__PURE__ */ jsx31(Text26, { color: PALETTE.muted, children: (() => {
|
|
24992
25976
|
const max = Math.max(8, width - 8);
|
|
24993
25977
|
const text = `~ ${rationale}`;
|
|
24994
25978
|
return text.length > max ? text.slice(0, max - 1) + "\u2026" : text;
|
|
24995
25979
|
})() }) }, rowKey ? `rationale-${rowKey}` : void 0),
|
|
24996
|
-
selected && prop.type === "enum" && activeField === "values" && /* @__PURE__ */ jsxs25(
|
|
24997
|
-
/* @__PURE__ */ jsxs25(
|
|
25980
|
+
selected && prop.type === "enum" && activeField === "values" && /* @__PURE__ */ jsxs25(Box25, { paddingLeft: 2, flexDirection: "column", children: [
|
|
25981
|
+
/* @__PURE__ */ jsxs25(Box25, { children: [
|
|
24998
25982
|
/* @__PURE__ */ jsx31(Text26, { color: PALETTE.muted, children: "values:" }),
|
|
24999
25983
|
activeField === "values" && /* @__PURE__ */ jsx31(Text26, { children: " [a] add [e] edit [r] remove [\u2191\u2193] navigate [K/J] reorder" })
|
|
25000
25984
|
] }),
|
|
@@ -25028,8 +26012,8 @@ function SlotRow({
|
|
|
25028
26012
|
pickerCandidates,
|
|
25029
26013
|
pickerCursor
|
|
25030
26014
|
}) {
|
|
25031
|
-
return /* @__PURE__ */ jsxs25(
|
|
25032
|
-
/* @__PURE__ */ jsx31(
|
|
26015
|
+
return /* @__PURE__ */ jsxs25(Box25, { flexDirection: "column", width, flexShrink: 0, children: [
|
|
26016
|
+
/* @__PURE__ */ jsx31(Box25, { gap: 1, flexWrap: "wrap", width, flexShrink: 0, children: /* @__PURE__ */ jsx31(RowLabel, { name: slot.name, selected, trailing: false }) }),
|
|
25033
26017
|
/* @__PURE__ */ jsx31(
|
|
25034
26018
|
DescriptionField,
|
|
25035
26019
|
{
|
|
@@ -25043,7 +26027,7 @@ function SlotRow({
|
|
|
25043
26027
|
paddingLeft: 0
|
|
25044
26028
|
}
|
|
25045
26029
|
),
|
|
25046
|
-
/* @__PURE__ */ jsx31(
|
|
26030
|
+
/* @__PURE__ */ jsx31(Box25, { gap: 1, flexWrap: "wrap", width, flexShrink: 0, children: /* @__PURE__ */ jsx31(
|
|
25047
26031
|
RequiredField,
|
|
25048
26032
|
{
|
|
25049
26033
|
value: slot.required,
|
|
@@ -25052,7 +26036,7 @@ function SlotRow({
|
|
|
25052
26036
|
activeField
|
|
25053
26037
|
}
|
|
25054
26038
|
) }),
|
|
25055
|
-
!(selected && editingField && activeField === "allowedComponents") && /* @__PURE__ */ jsxs25(
|
|
26039
|
+
!(selected && editingField && activeField === "allowedComponents") && /* @__PURE__ */ jsxs25(Box25, { gap: 1, flexWrap: "wrap", width, flexShrink: 0, children: [
|
|
25056
26040
|
/* @__PURE__ */ jsxs25(
|
|
25057
26041
|
Text26,
|
|
25058
26042
|
{
|
|
@@ -25066,8 +26050,8 @@ function SlotRow({
|
|
|
25066
26050
|
),
|
|
25067
26051
|
slot.allowedComponents.length === 0 ? /* @__PURE__ */ jsx31(Text26, { color: PALETTE.muted, children: "(any)" }) : /* @__PURE__ */ jsx31(Text26, { wrap: "wrap", children: slot.allowedComponents.join(", ") })
|
|
25068
26052
|
] }),
|
|
25069
|
-
selected && editingField && activeField === "allowedComponents" && /* @__PURE__ */ jsxs25(
|
|
25070
|
-
/* @__PURE__ */ jsxs25(
|
|
26053
|
+
selected && editingField && activeField === "allowedComponents" && /* @__PURE__ */ jsxs25(Box25, { flexDirection: "column", children: [
|
|
26054
|
+
/* @__PURE__ */ jsxs25(Box25, { children: [
|
|
25071
26055
|
/* @__PURE__ */ jsxs25(
|
|
25072
26056
|
Text26,
|
|
25073
26057
|
{
|
|
@@ -25095,7 +26079,7 @@ function SlotRow({
|
|
|
25095
26079
|
showAddInput: editingField && activeField === "allowedComponents"
|
|
25096
26080
|
}
|
|
25097
26081
|
),
|
|
25098
|
-
editingField && editingValue?.mode === "add" && activeField === "allowedComponents" && pickerCandidates !== null && /* @__PURE__ */ jsx31(
|
|
26082
|
+
editingField && editingValue?.mode === "add" && activeField === "allowedComponents" && pickerCandidates !== null && /* @__PURE__ */ jsx31(Box25, { paddingLeft: 2, flexDirection: "column", children: pickerCandidates.length === 0 ? /* @__PURE__ */ jsx31(Text26, { color: PALETTE.muted, children: "(no valid components to add \u2014 all remaining candidates would create cycles)" }) : (() => {
|
|
25099
26083
|
const filtered = valueText.length === 0 ? pickerCandidates : pickerCandidates.filter((n) => n.toLowerCase().includes(valueText.toLowerCase()));
|
|
25100
26084
|
if (filtered.length === 0) {
|
|
25101
26085
|
return /* @__PURE__ */ jsx31(Text26, { color: PALETTE.muted, children: "(no candidates match \u2014 Enter to add as free text)" });
|
|
@@ -25104,7 +26088,7 @@ function SlotRow({
|
|
|
25104
26088
|
const MAX_VISIBLE = 5;
|
|
25105
26089
|
const start = Math.max(0, Math.min(filtered.length - MAX_VISIBLE, cursor - 2));
|
|
25106
26090
|
const slice = filtered.slice(start, start + MAX_VISIBLE);
|
|
25107
|
-
return /* @__PURE__ */ jsxs25(
|
|
26091
|
+
return /* @__PURE__ */ jsxs25(Box25, { flexDirection: "column", children: [
|
|
25108
26092
|
/* @__PURE__ */ jsx31(Text26, { color: PALETTE.muted, children: " candidates (\u2191\u2193 cycle, Enter to add):" }),
|
|
25109
26093
|
slice.map((name, i) => {
|
|
25110
26094
|
const absIdx = start + i;
|
|
@@ -25937,14 +26921,14 @@ function FieldEditor({
|
|
|
25937
26921
|
});
|
|
25938
26922
|
const innerWidth = Math.max(1, width - 2);
|
|
25939
26923
|
if (parseErr) {
|
|
25940
|
-
return /* @__PURE__ */ jsxs25(
|
|
26924
|
+
return /* @__PURE__ */ jsxs25(Box25, { flexDirection: "column", width, borderStyle: "single", borderColor: PALETTE.error, children: [
|
|
25941
26925
|
/* @__PURE__ */ jsx31(Text26, { bold: true, color: PALETTE.error, children: "FIELD EDITOR \u2014 parse error" }),
|
|
25942
26926
|
/* @__PURE__ */ jsx31(Text26, { color: PALETTE.error, children: parseErr }),
|
|
25943
26927
|
/* @__PURE__ */ jsx31(Text26, { color: PALETTE.muted, children: "Cannot display structured editor. Fix the JSON first." })
|
|
25944
26928
|
] });
|
|
25945
26929
|
}
|
|
25946
26930
|
if (props.length === 0 && slots.length === 0) {
|
|
25947
|
-
return /* @__PURE__ */ jsxs25(
|
|
26931
|
+
return /* @__PURE__ */ jsxs25(Box25, { flexDirection: "column", width, borderStyle: "single", borderColor: PALETTE.warning, children: [
|
|
25948
26932
|
/* @__PURE__ */ jsx31(Text26, { bold: true, color: PALETTE.warning, children: "FIELD EDITOR \u2014 no fields" }),
|
|
25949
26933
|
/* @__PURE__ */ jsx31(Text26, { color: PALETTE.warning, children: "\u26A0 No properties classified for this component. The LLM didn't find anything to classify." }),
|
|
25950
26934
|
/* @__PURE__ */ jsx31(Text26, { color: PALETTE.muted, children: "You can add fields manually below or reject this component." }),
|
|
@@ -26077,7 +27061,7 @@ function FieldEditor({
|
|
|
26077
27061
|
const renderRow = (row, index) => {
|
|
26078
27062
|
const key = rowKey(row, index);
|
|
26079
27063
|
if (row.kind === "header") {
|
|
26080
|
-
return /* @__PURE__ */ jsx31(
|
|
27064
|
+
return /* @__PURE__ */ jsx31(Box25, { flexDirection: "column", paddingTop: 1, children: /* @__PURE__ */ jsx31(Text26, { bold: true, color: PALETTE.success, children: row.label }) }, key);
|
|
26081
27065
|
}
|
|
26082
27066
|
if (row.kind === "component-description") {
|
|
26083
27067
|
const isSelected2 = inComponentDesc && active;
|
|
@@ -26163,7 +27147,7 @@ function FieldEditor({
|
|
|
26163
27147
|
children: [
|
|
26164
27148
|
hasEmptyProperties && /* @__PURE__ */ jsx31(Text26, { color: PALETTE.warning, children: "\u26A0 No properties classified for this component. The LLM didn't find anything to classify. Reject this component or add fields manually." }),
|
|
26165
27149
|
header,
|
|
26166
|
-
/* @__PURE__ */ jsx31(
|
|
27150
|
+
/* @__PURE__ */ jsx31(Box25, { flexDirection: "column", width: innerWidth, flexShrink: 0, children: focusLevel === "field" && !inComponentDesc && currentProp ? /* @__PURE__ */ jsx31(
|
|
26167
27151
|
PropRow,
|
|
26168
27152
|
{
|
|
26169
27153
|
prop: currentProp,
|
|
@@ -26199,7 +27183,7 @@ function FieldEditor({
|
|
|
26199
27183
|
const absoluteIndex = scrollStart + index;
|
|
26200
27184
|
const key = rowKey(row, absoluteIndex);
|
|
26201
27185
|
return /* @__PURE__ */ jsx31(
|
|
26202
|
-
|
|
27186
|
+
Box25,
|
|
26203
27187
|
{
|
|
26204
27188
|
ref: (node) => {
|
|
26205
27189
|
if (node) rowMeasureRefs.current.set(key, node);
|
|
@@ -26221,20 +27205,20 @@ function FieldEditor({
|
|
|
26221
27205
|
const src = metadata?.componentSource ?? null;
|
|
26222
27206
|
const headerPath = path5 ?? "<unknown source path>";
|
|
26223
27207
|
if (!start || !end2 || !src) {
|
|
26224
|
-
return /* @__PURE__ */ jsxs25(
|
|
27208
|
+
return /* @__PURE__ */ jsxs25(Box25, { flexDirection: "column", borderStyle: "single", borderColor: "gray", paddingX: 1, children: [
|
|
26225
27209
|
/* @__PURE__ */ jsx31(Text26, { color: PALETTE.muted, bold: true, children: `source: ${headerPath}` }),
|
|
26226
27210
|
/* @__PURE__ */ jsx31(Text26, { color: PALETTE.muted, children: "(no source location captured for this prop)" }),
|
|
26227
27211
|
/* @__PURE__ */ jsx31(Text26, { children: "[s] close" })
|
|
26228
27212
|
] });
|
|
26229
27213
|
}
|
|
26230
27214
|
const lines = src.split("\n").slice(Math.max(0, start - 1), end2);
|
|
26231
|
-
return /* @__PURE__ */ jsxs25(
|
|
27215
|
+
return /* @__PURE__ */ jsxs25(Box25, { flexDirection: "column", borderStyle: "single", borderColor: "gray", paddingX: 1, children: [
|
|
26232
27216
|
/* @__PURE__ */ jsx31(Text26, { color: PALETTE.muted, bold: true, children: `${headerPath}: lines ${start}\u2013${end2}` }),
|
|
26233
27217
|
lines.map((ln, i) => /* @__PURE__ */ jsx31(Text26, { color: PALETTE.muted, children: ln }, `source-line-${i}`)),
|
|
26234
27218
|
/* @__PURE__ */ jsx31(Text26, { children: "[s] close \xB7 [Esc] close" })
|
|
26235
27219
|
] });
|
|
26236
27220
|
})(),
|
|
26237
|
-
showHelp && /* @__PURE__ */ jsxs25(
|
|
27221
|
+
showHelp && /* @__PURE__ */ jsxs25(Box25, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE.accent, paddingX: 1, children: [
|
|
26238
27222
|
/* @__PURE__ */ jsx31(Text26, { bold: true, color: PALETTE.accent, children: "Keybindings" }),
|
|
26239
27223
|
/* @__PURE__ */ jsx31(Text26, { children: " " }),
|
|
26240
27224
|
/* @__PURE__ */ jsx31(Text26, { bold: true, children: "Row navigation" }),
|
|
@@ -26263,7 +27247,7 @@ function FieldEditor({
|
|
|
26263
27247
|
/* @__PURE__ */ jsx31(Text26, { color: PALETTE.muted, children: "press ? or Esc to close" })
|
|
26264
27248
|
] }),
|
|
26265
27249
|
validationError && /* @__PURE__ */ jsx31(Text26, { color: PALETTE.error, children: "\u2717 " + validationError }),
|
|
26266
|
-
/* @__PURE__ */ jsx31(
|
|
27250
|
+
/* @__PURE__ */ jsx31(Box25, { paddingTop: 1, children: /* @__PURE__ */ jsx31(Text26, { color: PALETTE.muted, children: modeLabel }) })
|
|
26267
27251
|
]
|
|
26268
27252
|
}
|
|
26269
27253
|
);
|
|
@@ -26320,23 +27304,23 @@ var init_wrap_text = __esm({
|
|
|
26320
27304
|
});
|
|
26321
27305
|
|
|
26322
27306
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/components/RationaleLine.tsx
|
|
26323
|
-
import { Box as
|
|
27307
|
+
import { Box as Box26, Text as Text27 } from "ink";
|
|
26324
27308
|
import { jsx as jsx32, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
26325
27309
|
function RationaleLine({ line, active }) {
|
|
26326
27310
|
if (line.kind === "blank") {
|
|
26327
|
-
return /* @__PURE__ */ jsx32(
|
|
27311
|
+
return /* @__PURE__ */ jsx32(Box26, { children: /* @__PURE__ */ jsx32(Text27, { children: " " }) });
|
|
26328
27312
|
}
|
|
26329
27313
|
if (line.kind === "heading") {
|
|
26330
|
-
return /* @__PURE__ */ jsx32(
|
|
27314
|
+
return /* @__PURE__ */ jsx32(Box26, { children: /* @__PURE__ */ jsx32(Text27, { bold: true, color: active ? PALETTE.accent : PALETTE.muted, children: line.text }) });
|
|
26331
27315
|
}
|
|
26332
27316
|
if (line.kind === "label") {
|
|
26333
|
-
return /* @__PURE__ */ jsxs26(
|
|
27317
|
+
return /* @__PURE__ */ jsxs26(Box26, { children: [
|
|
26334
27318
|
line.prefix && /* @__PURE__ */ jsx32(Text27, { children: line.prefix }),
|
|
26335
27319
|
/* @__PURE__ */ jsx32(Text27, { bold: true, color: active ? line.color : PALETTE.muted, children: line.text }),
|
|
26336
27320
|
line.suffix && /* @__PURE__ */ jsx32(Text27, { color: PALETTE.muted, children: line.suffix })
|
|
26337
27321
|
] });
|
|
26338
27322
|
}
|
|
26339
|
-
return /* @__PURE__ */ jsx32(
|
|
27323
|
+
return /* @__PURE__ */ jsx32(Box26, { children: /* @__PURE__ */ jsx32(Text27, { color: !active || line.dim ? PALETTE.muted : void 0, children: line.text }) });
|
|
26340
27324
|
}
|
|
26341
27325
|
var init_RationaleLine = __esm({
|
|
26342
27326
|
"packages/experience-design-system-cli/src/tui/import/steps/09-review/components/RationaleLine.tsx"() {
|
|
@@ -26346,7 +27330,7 @@ var init_RationaleLine = __esm({
|
|
|
26346
27330
|
});
|
|
26347
27331
|
|
|
26348
27332
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/components/ComponentRationalePanel.tsx
|
|
26349
|
-
import { Box as
|
|
27333
|
+
import { Box as Box27, Text as Text28 } from "ink";
|
|
26350
27334
|
import { jsx as jsx33, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
26351
27335
|
function renderComponentRationaleLines(data, innerWidth) {
|
|
26352
27336
|
const out = [];
|
|
@@ -26415,7 +27399,7 @@ function ComponentRationalePanel({
|
|
|
26415
27399
|
const visibleStart = totalLines === 0 ? 0 : scrollOffset + 1;
|
|
26416
27400
|
const visibleEnd = Math.min(totalLines, scrollOffset + contentHeight);
|
|
26417
27401
|
return /* @__PURE__ */ jsxs27(
|
|
26418
|
-
|
|
27402
|
+
Box27,
|
|
26419
27403
|
{
|
|
26420
27404
|
flexDirection: "column",
|
|
26421
27405
|
width,
|
|
@@ -26423,9 +27407,9 @@ function ComponentRationalePanel({
|
|
|
26423
27407
|
borderStyle: "single",
|
|
26424
27408
|
borderColor: active ? PALETTE.text : void 0,
|
|
26425
27409
|
children: [
|
|
26426
|
-
/* @__PURE__ */ jsx33(
|
|
27410
|
+
/* @__PURE__ */ jsx33(Box27, { children: /* @__PURE__ */ jsx33(Text28, { bold: true, color: active ? void 0 : PALETTE.muted, children: `Component rationale: ${data.name}` }) }),
|
|
26427
27411
|
visible.map((line, i) => /* @__PURE__ */ jsx33(RationaleLine, { line, active }, i)),
|
|
26428
|
-
/* @__PURE__ */ jsx33(
|
|
27412
|
+
/* @__PURE__ */ jsx33(Box27, { children: overflowed ? /* @__PURE__ */ jsx33(Text28, { children: `${visibleStart}-${visibleEnd}/${totalLines} [\u2191\u2193] scroll [I/Esc] close` }) : /* @__PURE__ */ jsx33(Text28, { children: "[I/Esc] close" }) })
|
|
26429
27413
|
]
|
|
26430
27414
|
}
|
|
26431
27415
|
);
|
|
@@ -26455,7 +27439,7 @@ var init_HighlightedLine = __esm({
|
|
|
26455
27439
|
});
|
|
26456
27440
|
|
|
26457
27441
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/components/ScrollablePanel.tsx
|
|
26458
|
-
import { Box as
|
|
27442
|
+
import { Box as Box28, Text as Text30 } from "ink";
|
|
26459
27443
|
import { Fragment as Fragment8, jsx as jsx35, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
26460
27444
|
function ScrollablePanel({
|
|
26461
27445
|
title,
|
|
@@ -26469,11 +27453,11 @@ function ScrollablePanel({
|
|
|
26469
27453
|
children
|
|
26470
27454
|
}) {
|
|
26471
27455
|
const overflowed = totalLines > height;
|
|
26472
|
-
return /* @__PURE__ */ jsxs28(
|
|
26473
|
-
/* @__PURE__ */ jsxs28(
|
|
27456
|
+
return /* @__PURE__ */ jsxs28(Box28, { flexDirection: "column", width, height: height + 2, borderStyle: "single", borderColor, children: [
|
|
27457
|
+
/* @__PURE__ */ jsxs28(Box28, { children: [
|
|
26474
27458
|
/* @__PURE__ */ jsx35(Text30, { bold: true, color: active ? void 0 : PALETTE.muted, children: title }),
|
|
26475
27459
|
overflowed && /* @__PURE__ */ jsxs28(Fragment8, { children: [
|
|
26476
|
-
/* @__PURE__ */ jsx35(
|
|
27460
|
+
/* @__PURE__ */ jsx35(Box28, { flexGrow: 1 }),
|
|
26477
27461
|
/* @__PURE__ */ jsx35(Text30, { color: active ? void 0 : PALETTE.muted, children: `\u2195 ${visibleStart}-${visibleEnd}/${totalLines}` })
|
|
26478
27462
|
] })
|
|
26479
27463
|
] }),
|
|
@@ -26488,7 +27472,7 @@ var init_ScrollablePanel = __esm({
|
|
|
26488
27472
|
});
|
|
26489
27473
|
|
|
26490
27474
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/components/JsonPanel.tsx
|
|
26491
|
-
import { Box as
|
|
27475
|
+
import { Box as Box29 } from "ink";
|
|
26492
27476
|
import { jsx as jsx36 } from "react/jsx-runtime";
|
|
26493
27477
|
function highlightJson(line) {
|
|
26494
27478
|
const parts = [];
|
|
@@ -26553,7 +27537,7 @@ function JsonPanel({ label, value, scrollOffset, width, height, active }) {
|
|
|
26553
27537
|
borderColor: active ? "white" : void 0,
|
|
26554
27538
|
children: visibleLines.map((line, i) => {
|
|
26555
27539
|
const truncated = truncateLine(line, innerWidth);
|
|
26556
|
-
return /* @__PURE__ */ jsx36(
|
|
27540
|
+
return /* @__PURE__ */ jsx36(Box29, { children: highlightJson(truncated) }, i);
|
|
26557
27541
|
})
|
|
26558
27542
|
}
|
|
26559
27543
|
);
|
|
@@ -26627,7 +27611,7 @@ var init_RationalePanel = __esm({
|
|
|
26627
27611
|
|
|
26628
27612
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/components/TokenReviewPanel.tsx
|
|
26629
27613
|
import figures7 from "figures";
|
|
26630
|
-
import { Box as
|
|
27614
|
+
import { Box as Box30, Text as Text31 } from "ink";
|
|
26631
27615
|
import { jsx as jsx38, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
26632
27616
|
function TokenReviewPanel({
|
|
26633
27617
|
componentName,
|
|
@@ -26648,7 +27632,7 @@ function TokenReviewPanel({
|
|
|
26648
27632
|
const visiblePaths = current.paths.slice(scrollStart, scrollStart + visibleCount);
|
|
26649
27633
|
const rangeLabel = current.paths.length === 0 ? "no compatible tokens" : `${scrollStart + 1}-${scrollStart + visiblePaths.length} of ${current.paths.length}`;
|
|
26650
27634
|
return /* @__PURE__ */ jsxs29(
|
|
26651
|
-
|
|
27635
|
+
Box30,
|
|
26652
27636
|
{
|
|
26653
27637
|
flexDirection: "column",
|
|
26654
27638
|
width,
|
|
@@ -26664,7 +27648,7 @@ function TokenReviewPanel({
|
|
|
26664
27648
|
const pathIndex = scrollStart + i;
|
|
26665
27649
|
const checked = editSelection.has(path5);
|
|
26666
27650
|
const focused = pathIndex === editCursor;
|
|
26667
|
-
return /* @__PURE__ */ jsx38(
|
|
27651
|
+
return /* @__PURE__ */ jsx38(Box30, { children: /* @__PURE__ */ jsx38(
|
|
26668
27652
|
Text31,
|
|
26669
27653
|
{
|
|
26670
27654
|
color: focused ? PALETTE.accent : active ? void 0 : PALETTE.muted,
|
|
@@ -26682,7 +27666,7 @@ function TokenReviewPanel({
|
|
|
26682
27666
|
);
|
|
26683
27667
|
}
|
|
26684
27668
|
return /* @__PURE__ */ jsxs29(
|
|
26685
|
-
|
|
27669
|
+
Box30,
|
|
26686
27670
|
{
|
|
26687
27671
|
flexDirection: "column",
|
|
26688
27672
|
width,
|
|
@@ -26694,8 +27678,8 @@ function TokenReviewPanel({
|
|
|
26694
27678
|
suggestions.length === 0 && /* @__PURE__ */ jsx38(Text31, { color: PALETTE.muted, children: "(no token suggestions for this component)" }),
|
|
26695
27679
|
suggestions.map((s, i) => {
|
|
26696
27680
|
const focused = i === selectedRow;
|
|
26697
|
-
return /* @__PURE__ */ jsxs29(
|
|
26698
|
-
/* @__PURE__ */ jsx38(
|
|
27681
|
+
return /* @__PURE__ */ jsxs29(Box30, { flexDirection: "column", children: [
|
|
27682
|
+
/* @__PURE__ */ jsx38(Box30, { children: /* @__PURE__ */ jsx38(Text31, { color: focused ? PALETTE.accent : active ? void 0 : PALETTE.muted, bold: focused, children: `${focused ? figures7.pointer : " "} ${s.propName}` }) }),
|
|
26699
27683
|
/* @__PURE__ */ jsx38(Text31, { color: PALETTE.muted, children: ` suggested: ${s.suggested.join(", ")}` }),
|
|
26700
27684
|
/* @__PURE__ */ jsx38(Text31, { color: PALETTE.muted, children: ` allowed: ${s.allowed.join(", ")}` })
|
|
26701
27685
|
] }, s.propName);
|
|
@@ -26919,7 +27903,7 @@ var init_ReviewDetailsEditor = __esm({
|
|
|
26919
27903
|
});
|
|
26920
27904
|
|
|
26921
27905
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/components/ReviewComponentPanel.tsx
|
|
26922
|
-
import { Box as
|
|
27906
|
+
import { Box as Box31, Text as Text33 } from "ink";
|
|
26923
27907
|
import { Fragment as Fragment10, jsx as jsx41, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
26924
27908
|
function buildReviewFieldEditor(reviewEditor, selectedJson, onExit, overrides = {}) {
|
|
26925
27909
|
return {
|
|
@@ -26963,7 +27947,7 @@ function ReviewEmptyComponentsWarning({
|
|
|
26963
27947
|
return /* @__PURE__ */ jsx41(Text33, { color: PALETTE.warning, children: `\u26A0 ${count} component${count === 1 ? "" : "s"} had no classifiable props \u2014 review with care` });
|
|
26964
27948
|
}
|
|
26965
27949
|
function ReviewNoSelection() {
|
|
26966
|
-
return /* @__PURE__ */ jsx41(
|
|
27950
|
+
return /* @__PURE__ */ jsx41(Box31, { flexGrow: 1, paddingLeft: 1, flexDirection: "column", children: /* @__PURE__ */ jsx41(Text33, { color: PALETTE.muted, children: "No component selected" }) });
|
|
26967
27951
|
}
|
|
26968
27952
|
function ReviewFinalizeError({
|
|
26969
27953
|
message,
|
|
@@ -26991,9 +27975,9 @@ function ReviewComponentTitle({
|
|
|
26991
27975
|
slotCount,
|
|
26992
27976
|
sidebarFocused
|
|
26993
27977
|
}) {
|
|
26994
|
-
return /* @__PURE__ */ jsxs31(
|
|
27978
|
+
return /* @__PURE__ */ jsxs31(Box31, { paddingLeft: 2, paddingBottom: 1, children: [
|
|
26995
27979
|
/* @__PURE__ */ jsx41(Text33, { bold: true, wrap: "truncate-end", children: selectedKey }),
|
|
26996
|
-
/* @__PURE__ */ jsx41(
|
|
27980
|
+
/* @__PURE__ */ jsx41(Box31, { flexGrow: 1 }),
|
|
26997
27981
|
/* @__PURE__ */ jsxs31(Text33, { color: PALETTE.muted, wrap: "truncate-end", children: [
|
|
26998
27982
|
propCount,
|
|
26999
27983
|
" prop",
|
|
@@ -27025,8 +28009,8 @@ function ReviewComponentPanel({
|
|
|
27025
28009
|
const slotCount = selectedEntry.$slots ? Object.keys(selectedEntry.$slots).length : 0;
|
|
27026
28010
|
const contentHeight = Math.max(1, height - 2);
|
|
27027
28011
|
const contentWidth = Math.max(1, width - 1);
|
|
27028
|
-
return /* @__PURE__ */ jsx41(FixedPanel, { width, height, borderStyle: void 0, paddingLeft: 1, children: /* @__PURE__ */ jsxs31(
|
|
27029
|
-
/* @__PURE__ */ jsx41(
|
|
28012
|
+
return /* @__PURE__ */ jsx41(FixedPanel, { width, height, borderStyle: void 0, paddingLeft: 1, children: /* @__PURE__ */ jsxs31(Box31, { flexDirection: "column", width: contentWidth, height, flexShrink: 0, overflowY: "hidden", children: [
|
|
28013
|
+
/* @__PURE__ */ jsx41(Box31, { width: contentWidth, height: contentHeight, flexShrink: 0, overflowY: "hidden", children: /* @__PURE__ */ jsx41(
|
|
27030
28014
|
ReviewDetailsEditor,
|
|
27031
28015
|
{
|
|
27032
28016
|
selectedKey,
|
|
@@ -27050,8 +28034,8 @@ function ReviewComponentPanel({
|
|
|
27050
28034
|
)
|
|
27051
28035
|
}
|
|
27052
28036
|
) }),
|
|
27053
|
-
/* @__PURE__ */ jsx41(
|
|
27054
|
-
/* @__PURE__ */ jsx41(
|
|
28037
|
+
/* @__PURE__ */ jsx41(Box31, { width: contentWidth, height: 1, flexShrink: 0, children: /* @__PURE__ */ jsx41(Text33, { color: saveError ? PALETTE.error : void 0, wrap: "truncate-end", children: saveError ? "\u2717 " + saveError : " " }) }),
|
|
28038
|
+
/* @__PURE__ */ jsx41(Box31, { width: contentWidth, height: 1, flexShrink: 0, children: /* @__PURE__ */ jsx41(Text33, { color: PALETTE.muted, wrap: "truncate-end", children: /* @__PURE__ */ jsx41(
|
|
27055
28039
|
ReviewPanelFooter,
|
|
27056
28040
|
{
|
|
27057
28041
|
reviewEditor,
|
|
@@ -27074,7 +28058,7 @@ var init_ReviewComponentPanel = __esm({
|
|
|
27074
28058
|
});
|
|
27075
28059
|
|
|
27076
28060
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/components/ReviewStatus.tsx
|
|
27077
|
-
import { Box as
|
|
28061
|
+
import { Box as Box32, Text as Text34 } from "ink";
|
|
27078
28062
|
import { jsx as jsx42, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
27079
28063
|
function countReviewStatuses(entries) {
|
|
27080
28064
|
return entries.reduce(
|
|
@@ -27088,10 +28072,10 @@ function countReviewStatuses(entries) {
|
|
|
27088
28072
|
);
|
|
27089
28073
|
}
|
|
27090
28074
|
function ReviewLoadingState() {
|
|
27091
|
-
return /* @__PURE__ */ jsx42(
|
|
28075
|
+
return /* @__PURE__ */ jsx42(Box32, { paddingX: 2, paddingY: 1, children: /* @__PURE__ */ jsx42(Text34, { color: PALETTE.muted, children: "Loading generated definitions..." }) });
|
|
27092
28076
|
}
|
|
27093
28077
|
function ReviewLoadError({ message }) {
|
|
27094
|
-
return /* @__PURE__ */ jsxs32(
|
|
28078
|
+
return /* @__PURE__ */ jsxs32(Box32, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
27095
28079
|
/* @__PURE__ */ jsx42(Text34, { color: PALETTE.error, children: message }),
|
|
27096
28080
|
/* @__PURE__ */ jsx42(Text34, { children: " " }),
|
|
27097
28081
|
/* @__PURE__ */ jsx42(ControlHints, { hints: [{ keys: "q / Enter / Esc", label: "Quit" }] })
|
|
@@ -27318,7 +28302,7 @@ var init_run_live_preview = __esm({
|
|
|
27318
28302
|
});
|
|
27319
28303
|
|
|
27320
28304
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/components/FinalizeDialog.tsx
|
|
27321
|
-
import { Box as
|
|
28305
|
+
import { Box as Box33, Text as Text35 } from "ink";
|
|
27322
28306
|
import { Fragment as Fragment11, jsx as jsx43, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
27323
28307
|
function FinalizeDialog({
|
|
27324
28308
|
accepted,
|
|
@@ -27347,7 +28331,7 @@ function FinalizeDialog({
|
|
|
27347
28331
|
const windowed = removed.slice(offset, offset + FINALIZE_REMOVED_WINDOW);
|
|
27348
28332
|
const hasMoreBelow = offset + FINALIZE_REMOVED_WINDOW < removed.length;
|
|
27349
28333
|
const hasMoreAbove = offset > 0;
|
|
27350
|
-
return /* @__PURE__ */ jsx43(
|
|
28334
|
+
return /* @__PURE__ */ jsx43(Box33, { width: "100%", paddingX: 2, children: /* @__PURE__ */ jsxs33(Box33, { flexDirection: "column", alignItems: "flex-start", children: [
|
|
27351
28335
|
/* @__PURE__ */ jsx43(Text35, { bold: true, children: "Finalize" }),
|
|
27352
28336
|
/* @__PURE__ */ jsx43(Text35, { children: " " }),
|
|
27353
28337
|
/* @__PURE__ */ jsxs33(Text35, { children: [
|
|
@@ -27377,7 +28361,7 @@ function FinalizeDialog({
|
|
|
27377
28361
|
/* @__PURE__ */ jsx43(Text35, { color: PALETTE.warning, children: "Only explicitly accepted components ship." }),
|
|
27378
28362
|
/* @__PURE__ */ jsx43(Text35, { children: " " })
|
|
27379
28363
|
] }),
|
|
27380
|
-
/* @__PURE__ */ jsxs33(
|
|
28364
|
+
/* @__PURE__ */ jsxs33(Box33, { flexDirection: "column", height: 2, children: [
|
|
27381
28365
|
previewStatus === "running" ? /* @__PURE__ */ jsx43(Text35, { color: PALETTE.muted, children: "Previewing deletions against the target space\u2026" }) : previewStatus === "error" ? /* @__PURE__ */ jsx43(Text35, { color: PALETTE.warning, children: "\u26A0 Could not preview deletions (the push will still proceed)." }) : /* @__PURE__ */ jsx43(Text35, { children: " " }),
|
|
27382
28366
|
/* @__PURE__ */ jsx43(Text35, { children: " " })
|
|
27383
28367
|
] }),
|
|
@@ -27848,7 +28832,7 @@ var init_use_review_surface_state = __esm({
|
|
|
27848
28832
|
});
|
|
27849
28833
|
|
|
27850
28834
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/components/QuitDialog.tsx
|
|
27851
|
-
import { Box as
|
|
28835
|
+
import { Box as Box34, Text as Text36 } from "ink";
|
|
27852
28836
|
import { Fragment as Fragment12, jsx as jsx44, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
27853
28837
|
function QuitDialog({ hasUnsavedDrafts, onConfirm, onCancel }) {
|
|
27854
28838
|
useImmediateInput((input, key) => {
|
|
@@ -27858,7 +28842,7 @@ function QuitDialog({ hasUnsavedDrafts, onConfirm, onCancel }) {
|
|
|
27858
28842
|
onCancel();
|
|
27859
28843
|
}
|
|
27860
28844
|
});
|
|
27861
|
-
return /* @__PURE__ */ jsxs34(
|
|
28845
|
+
return /* @__PURE__ */ jsxs34(Box34, { flexDirection: "column", borderStyle: "round", padding: 1, width: 50, children: [
|
|
27862
28846
|
/* @__PURE__ */ jsx44(Text36, { bold: true, children: "\u2500".repeat(19) + " Quit " + "\u2500".repeat(19) }),
|
|
27863
28847
|
/* @__PURE__ */ jsx44(Text36, { children: " " }),
|
|
27864
28848
|
hasUnsavedDrafts ? /* @__PURE__ */ jsxs34(Fragment12, { children: [
|
|
@@ -27887,7 +28871,7 @@ var init_QuitDialog = __esm({
|
|
|
27887
28871
|
});
|
|
27888
28872
|
|
|
27889
28873
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/components/ReviewDialogs.tsx
|
|
27890
|
-
import { Box as
|
|
28874
|
+
import { Box as Box35, Text as Text37 } from "ink";
|
|
27891
28875
|
import { Fragment as Fragment13, jsx as jsx45, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
27892
28876
|
function ReviewFinalizeDialogs({
|
|
27893
28877
|
showFinalize,
|
|
@@ -27944,7 +28928,7 @@ function ReviewStepDialogs({
|
|
|
27944
28928
|
}
|
|
27945
28929
|
function ReviewReloadDialog({ open }) {
|
|
27946
28930
|
if (!open) return null;
|
|
27947
|
-
return /* @__PURE__ */ jsxs35(
|
|
28931
|
+
return /* @__PURE__ */ jsxs35(Box35, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE.warning, paddingX: 1, children: [
|
|
27948
28932
|
/* @__PURE__ */ jsx45(Text37, { bold: true, color: PALETTE.warning, children: "Reload from saved state?" }),
|
|
27949
28933
|
/* @__PURE__ */ jsx45(Text37, { children: "Unsaved in-memory changes will be lost." }),
|
|
27950
28934
|
/* @__PURE__ */ jsx45(Text37, { children: " " }),
|
|
@@ -28351,7 +29335,7 @@ var init_use_review_preview = __esm({
|
|
|
28351
29335
|
});
|
|
28352
29336
|
|
|
28353
29337
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/components/LivePreviewSummary.tsx
|
|
28354
|
-
import { Box as
|
|
29338
|
+
import { Box as Box36, Text as Text38 } from "ink";
|
|
28355
29339
|
import { jsx as jsx46, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
28356
29340
|
function LivePreviewSummary({
|
|
28357
29341
|
enabled,
|
|
@@ -28369,7 +29353,7 @@ function LivePreviewSummary({
|
|
|
28369
29353
|
if (disabled) return /* @__PURE__ */ jsx46(Text38, { color: PALETTE.muted, children: "Preview: disabled (creds rejected)" });
|
|
28370
29354
|
if (status === "running" && !hasCounts) return /* @__PURE__ */ jsx46(Text38, { color: PALETTE.muted, children: `Preview: ${spinner} running...` });
|
|
28371
29355
|
if (!hasCounts) return null;
|
|
28372
|
-
return /* @__PURE__ */ jsxs36(
|
|
29356
|
+
return /* @__PURE__ */ jsxs36(Box36, { children: [
|
|
28373
29357
|
/* @__PURE__ */ jsx46(Text38, { children: "Preview: " }),
|
|
28374
29358
|
/* @__PURE__ */ jsx46(Text38, { color: PALETTE.success, children: `${counts.new} new` }),
|
|
28375
29359
|
/* @__PURE__ */ jsx46(Text38, { children: " \xB7 " }),
|
|
@@ -28391,7 +29375,7 @@ var init_LivePreviewSummary = __esm({
|
|
|
28391
29375
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/generate-review-step.tsx
|
|
28392
29376
|
import { useCallback as useCallback5, useEffect as useEffect17, useMemo as useMemo4, useRef as useRef13, useState as useState25 } from "react";
|
|
28393
29377
|
import figures8 from "figures";
|
|
28394
|
-
import { Box as
|
|
29378
|
+
import { Box as Box37, Text as Text39 } from "ink";
|
|
28395
29379
|
import { Fragment as Fragment14, jsx as jsx47, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
28396
29380
|
function sortComponentsForSidebar(components, cycleParticipants) {
|
|
28397
29381
|
const isEmpty2 = (entry) => Object.keys(entry.$properties ?? {}).length === 0 && Object.keys(entry.$slots ?? {}).length === 0;
|
|
@@ -28536,7 +29520,7 @@ function deriveBreakingChanges(response) {
|
|
|
28536
29520
|
}
|
|
28537
29521
|
function GenerateReviewStep(props) {
|
|
28538
29522
|
if (!props.extractSessionId) {
|
|
28539
|
-
return /* @__PURE__ */ jsx47(
|
|
29523
|
+
return /* @__PURE__ */ jsx47(Box37, { paddingX: 2, paddingY: 1, children: /* @__PURE__ */ jsx47(Text39, { color: PALETTE.error, children: "Error: no session ID \u2014 cannot load generated definitions." }) });
|
|
28540
29524
|
}
|
|
28541
29525
|
return /* @__PURE__ */ jsx47(GenerateReviewStepView, { ...props, extractSessionId: props.extractSessionId });
|
|
28542
29526
|
}
|
|
@@ -29441,7 +30425,7 @@ function GenerateReviewStepView({
|
|
|
29441
30425
|
for (const c2 of closures.values()) if (c2.nodes.length > 1) return true;
|
|
29442
30426
|
return false;
|
|
29443
30427
|
})();
|
|
29444
|
-
return /* @__PURE__ */ jsxs37(
|
|
30428
|
+
return /* @__PURE__ */ jsxs37(Box37, { flexDirection: "column", children: [
|
|
29445
30429
|
/* @__PURE__ */ jsx47(StepHeader, { step: "review" }),
|
|
29446
30430
|
/* @__PURE__ */ jsx47(
|
|
29447
30431
|
ReviewStepDialogs,
|
|
@@ -29454,14 +30438,14 @@ function GenerateReviewStepView({
|
|
|
29454
30438
|
}
|
|
29455
30439
|
),
|
|
29456
30440
|
/* @__PURE__ */ jsx47(ReviewReloadDialog, { open: showReloadDialog && !dialogOpen }),
|
|
29457
|
-
removedComponents.length > 0 && !dialogOpen && /* @__PURE__ */ jsxs37(
|
|
30441
|
+
removedComponents.length > 0 && !dialogOpen && /* @__PURE__ */ jsxs37(Box37, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE.error, paddingX: 1, children: [
|
|
29458
30442
|
/* @__PURE__ */ jsx47(Text39, { bold: true, color: PALETTE.error, children: removedComponentsHeader(removedComponents.length, true) }),
|
|
29459
30443
|
!removedBannerCollapsed && /* @__PURE__ */ jsxs37(Fragment14, { children: [
|
|
29460
30444
|
/* @__PURE__ */ jsx47(Text39, { children: " " }),
|
|
29461
30445
|
removedComponents.map((rc) => /* @__PURE__ */ jsx47(Text39, { children: removedComponentLine(rc) }, rc.id))
|
|
29462
30446
|
] })
|
|
29463
30447
|
] }),
|
|
29464
|
-
breakingChanges.length > 0 && !dialogOpen && /* @__PURE__ */ jsx47(
|
|
30448
|
+
breakingChanges.length > 0 && !dialogOpen && /* @__PURE__ */ jsx47(Box37, { paddingX: 1, children: /* @__PURE__ */ jsx47(
|
|
29465
30449
|
Text39,
|
|
29466
30450
|
{
|
|
29467
30451
|
color: PALETTE.warning,
|
|
@@ -29472,7 +30456,7 @@ function GenerateReviewStepView({
|
|
|
29472
30456
|
const row = breakingRows[breakingCursor];
|
|
29473
30457
|
const comp = row ? breakingChanges.find((b) => b.componentName === row.componentName) : void 0;
|
|
29474
30458
|
if (!comp) return null;
|
|
29475
|
-
return /* @__PURE__ */ jsxs37(
|
|
30459
|
+
return /* @__PURE__ */ jsxs37(Box37, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE.warning, paddingX: 1, children: [
|
|
29476
30460
|
/* @__PURE__ */ jsx47(Text39, { bold: true, color: PALETTE.warning, children: `Breaking changes \u2014 ${comp.componentName}` }),
|
|
29477
30461
|
comp.impact && /* @__PURE__ */ jsx47(Text39, { color: PALETTE.muted, children: ` affects ${comp.impact.affectedExperiences} experience${comp.impact.affectedExperiences === 1 ? "" : "s"}, ${comp.impact.affectedFragments} fragment${comp.impact.affectedFragments === 1 ? "" : "s"}` }),
|
|
29478
30462
|
comp.changes.length === 0 ? /* @__PURE__ */ jsx47(Text39, { color: PALETTE.muted, children: " (no enumerated changes)" }) : comp.changes.map((change, ci) => /* @__PURE__ */ jsx47(Text39, { children: ` \u2022 ${formatBreakingChange(change, comp.current)}` }, `bd-detail-${ci}`)),
|
|
@@ -29498,7 +30482,7 @@ function GenerateReviewStepView({
|
|
|
29498
30482
|
const participantSet = cycleView.structural;
|
|
29499
30483
|
const members = stillRejected.filter((n) => participantSet.has(n)).sort();
|
|
29500
30484
|
const ancestors = stillRejected.filter((n) => !participantSet.has(n)).sort();
|
|
29501
|
-
return /* @__PURE__ */ jsxs37(
|
|
30485
|
+
return /* @__PURE__ */ jsxs37(Box37, { flexDirection: "column", borderStyle: "single", borderColor: PALETTE.error, paddingX: 1, children: [
|
|
29502
30486
|
/* @__PURE__ */ jsx47(Text39, { color: PALETTE.error, bold: true, children: `Cyclic component graph \u2014 auto-rejected ${stillRejected.length} component${stillRejected.length === 1 ? "" : "s"}:` }),
|
|
29503
30487
|
members.length > 0 && /* @__PURE__ */ jsx47(Text39, { color: PALETTE.error, children: ` Cycle members: ${members.join(", ")}` }),
|
|
29504
30488
|
ancestors.length > 0 && /* @__PURE__ */ jsx47(Text39, { color: PALETTE.error, children: ` Ancestors: ${ancestors.join(", ")}` }),
|
|
@@ -29528,7 +30512,7 @@ function GenerateReviewStepView({
|
|
|
29528
30512
|
height: panelHeight
|
|
29529
30513
|
}
|
|
29530
30514
|
),
|
|
29531
|
-
!dialogOpen && !cyclePanel.isOpen && !breakPanel.isOpen && /* @__PURE__ */ jsxs37(
|
|
30515
|
+
!dialogOpen && !cyclePanel.isOpen && !breakPanel.isOpen && /* @__PURE__ */ jsxs37(Box37, { children: [
|
|
29532
30516
|
breakingPanel.isOpen ? /* @__PURE__ */ jsx47(
|
|
29533
30517
|
GotoBanner,
|
|
29534
30518
|
{
|
|
@@ -29617,7 +30601,7 @@ function GenerateReviewStepView({
|
|
|
29617
30601
|
}
|
|
29618
30602
|
) : /* @__PURE__ */ jsx47(ReviewNoSelection, {})
|
|
29619
30603
|
] }),
|
|
29620
|
-
!dialogOpen && cycleRows.length > 0 && !cyclePanel.isOpen && !breakPanel.isOpen && /* @__PURE__ */ jsxs37(
|
|
30604
|
+
!dialogOpen && cycleRows.length > 0 && !cyclePanel.isOpen && !breakPanel.isOpen && /* @__PURE__ */ jsxs37(Box37, { flexDirection: "column", children: [
|
|
29621
30605
|
/* @__PURE__ */ jsx47(Text39, { color: PALETTE.warning, children: `\u26A0 ${cycleRows.length} slot dependency cycle${cycleRows.length === 1 ? "" : "s"} detected \u2014 push will fail` }),
|
|
29622
30606
|
cycleRows.slice(0, 3).map((cycle, idx) => {
|
|
29623
30607
|
return /* @__PURE__ */ jsx47(
|
|
@@ -29761,11 +30745,11 @@ var init_generate_review_step = __esm({
|
|
|
29761
30745
|
});
|
|
29762
30746
|
|
|
29763
30747
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/components/CustomPromptBanner.tsx
|
|
29764
|
-
import { Box as
|
|
30748
|
+
import { Box as Box38, Text as Text40 } from "ink";
|
|
29765
30749
|
import { jsx as jsx48, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
29766
30750
|
function CustomPromptBanner({ generatePromptPath }) {
|
|
29767
30751
|
if (!generatePromptPath) return null;
|
|
29768
|
-
return /* @__PURE__ */ jsxs38(
|
|
30752
|
+
return /* @__PURE__ */ jsxs38(Box38, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE.warning, paddingX: 1, children: [
|
|
29769
30753
|
/* @__PURE__ */ jsx48(Text40, { color: PALETTE.warning, bold: true, children: "WARNING: Custom prompt active" }),
|
|
29770
30754
|
generatePromptPath ? /* @__PURE__ */ jsxs38(Text40, { color: PALETTE.warning, children: [
|
|
29771
30755
|
"components: ",
|
|
@@ -29800,10 +30784,10 @@ var init_contentful_urls2 = __esm({
|
|
|
29800
30784
|
});
|
|
29801
30785
|
|
|
29802
30786
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/components/SpaceEnvironment.tsx
|
|
29803
|
-
import { Box as
|
|
30787
|
+
import { Box as Box39, Text as Text41 } from "ink";
|
|
29804
30788
|
import { jsx as jsx49, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
29805
30789
|
function SpaceEnvironment({ spaceId, environmentId }) {
|
|
29806
|
-
return /* @__PURE__ */ jsxs39(
|
|
30790
|
+
return /* @__PURE__ */ jsxs39(Box39, { gap: 1, marginTop: 1, children: [
|
|
29807
30791
|
/* @__PURE__ */ jsx49(Text41, { color: PALETTE.muted, children: "Space:" }),
|
|
29808
30792
|
/* @__PURE__ */ jsx49(Text41, { children: spaceId }),
|
|
29809
30793
|
/* @__PURE__ */ jsx49(Text41, { color: PALETTE.muted, children: "/" }),
|
|
@@ -29819,7 +30803,7 @@ var init_SpaceEnvironment = __esm({
|
|
|
29819
30803
|
});
|
|
29820
30804
|
|
|
29821
30805
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/screens/DoneStep.tsx
|
|
29822
|
-
import { Box as
|
|
30806
|
+
import { Box as Box40, Text as Text42 } from "ink";
|
|
29823
30807
|
import { Fragment as Fragment15, jsx as jsx50, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
29824
30808
|
function EntityRows({ entity, label }) {
|
|
29825
30809
|
const plural3 = (n) => `${n} ${label}${n !== 1 ? "s" : ""}`;
|
|
@@ -29839,7 +30823,7 @@ function EntityRows({ entity, label }) {
|
|
|
29839
30823
|
] });
|
|
29840
30824
|
}
|
|
29841
30825
|
function LinkRow({ title, url }) {
|
|
29842
|
-
return /* @__PURE__ */ jsxs40(
|
|
30826
|
+
return /* @__PURE__ */ jsxs40(Box40, { flexDirection: "column", children: [
|
|
29843
30827
|
/* @__PURE__ */ jsx50(Text42, { color: PALETTE.muted, children: title }),
|
|
29844
30828
|
/* @__PURE__ */ jsx50(Text42, { color: PALETTE.accent, children: url })
|
|
29845
30829
|
] });
|
|
@@ -29865,14 +30849,14 @@ function DoneStep({
|
|
|
29865
30849
|
const totalPushed = componentTypes.created + componentTypes.updated + componentTypes.removed + designTokens.created + designTokens.updated + designTokens.removed;
|
|
29866
30850
|
const success = totalFailed === 0;
|
|
29867
30851
|
const urlArgs = { host: host ?? "api.contentful.com", spaceId, environmentId };
|
|
29868
|
-
return /* @__PURE__ */ jsxs40(
|
|
30852
|
+
return /* @__PURE__ */ jsxs40(Box40, { flexDirection: "column", children: [
|
|
29869
30853
|
/* @__PURE__ */ jsx50(StepHeader, { step: "done" }),
|
|
29870
|
-
/* @__PURE__ */ jsxs40(
|
|
30854
|
+
/* @__PURE__ */ jsxs40(Box40, { flexDirection: "column", gap: 1, paddingX: 2, paddingBottom: 1, children: [
|
|
29871
30855
|
success ? /* @__PURE__ */ jsx50(Text42, { bold: true, color: PALETTE.success, children: "Done!" }) : /* @__PURE__ */ jsx50(Text42, { bold: true, color: PALETTE.warning, children: "\u26A0 Finished with errors" }),
|
|
29872
|
-
totalPushed === 0 && totalFailed === 0 && !summary ? /* @__PURE__ */ jsx50(Text42, { color: PALETTE.muted, children: credentialsSkipped ? "Nothing was pushed \u2014 you skipped the Contentful credentials, so the files were only saved locally." : "Nothing was pushed \u2014 everything was already up to date." }) : /* @__PURE__ */ jsxs40(
|
|
29873
|
-
/* @__PURE__ */ jsx50(EntityRows, { entity: componentTypes, label: "Component
|
|
30856
|
+
totalPushed === 0 && totalFailed === 0 && !summary ? /* @__PURE__ */ jsx50(Text42, { color: PALETTE.muted, children: credentialsSkipped ? "Nothing was pushed \u2014 you skipped the Contentful credentials, so the files were only saved locally." : "Nothing was pushed \u2014 everything was already up to date." }) : /* @__PURE__ */ jsxs40(Box40, { flexDirection: "column", children: [
|
|
30857
|
+
/* @__PURE__ */ jsx50(EntityRows, { entity: componentTypes, label: "Component" }),
|
|
29874
30858
|
/* @__PURE__ */ jsx50(EntityRows, { entity: designTokens, label: "Design Token" }),
|
|
29875
|
-
summary && /* @__PURE__ */ jsx50(
|
|
30859
|
+
summary && /* @__PURE__ */ jsx50(Box40, { marginTop: 1, children: /* @__PURE__ */ jsxs40(Text42, { color: PALETTE.muted, children: [
|
|
29876
30860
|
"Push result: ",
|
|
29877
30861
|
summary.succeeded,
|
|
29878
30862
|
"/",
|
|
@@ -29885,7 +30869,7 @@ function DoneStep({
|
|
|
29885
30869
|
] })
|
|
29886
30870
|
] }) })
|
|
29887
30871
|
] }),
|
|
29888
|
-
failures.length > 0 && /* @__PURE__ */ jsxs40(
|
|
30872
|
+
failures.length > 0 && /* @__PURE__ */ jsxs40(Box40, { flexDirection: "column", children: [
|
|
29889
30873
|
/* @__PURE__ */ jsx50(Text42, { bold: true, color: PALETTE.error, children: "Failure details" }),
|
|
29890
30874
|
failures.map((failure) => /* @__PURE__ */ jsxs40(Text42, { color: PALETTE.error, children: [
|
|
29891
30875
|
failure.entityType,
|
|
@@ -29896,7 +30880,7 @@ function DoneStep({
|
|
|
29896
30880
|
] }, `${failure.entityType}:${failure.entityId}`))
|
|
29897
30881
|
] }),
|
|
29898
30882
|
/* @__PURE__ */ jsx50(SpaceEnvironment, { spaceId, environmentId }),
|
|
29899
|
-
success && totalPushed > 0 && /* @__PURE__ */ jsxs40(
|
|
30883
|
+
success && totalPushed > 0 && /* @__PURE__ */ jsxs40(Box40, { flexDirection: "column", gap: 1, children: [
|
|
29900
30884
|
/* @__PURE__ */ jsx50(Text42, { color: PALETTE.success, children: "Your design system is now in Contentful Experiences." }),
|
|
29901
30885
|
produced.components && /* @__PURE__ */ jsx50(LinkRow, { title: "View your components here:", url: buildPostPushUrl2(urlArgs) }),
|
|
29902
30886
|
produced.tokens && /* @__PURE__ */ jsx50(
|
|
@@ -29926,7 +30910,7 @@ var init_DoneStep = __esm({
|
|
|
29926
30910
|
});
|
|
29927
30911
|
|
|
29928
30912
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/support/path-utils.ts
|
|
29929
|
-
import { resolve as
|
|
30913
|
+
import { resolve as resolve25 } from "node:path";
|
|
29930
30914
|
import { homedir as homedir4 } from "node:os";
|
|
29931
30915
|
function expandTilde(input) {
|
|
29932
30916
|
if (input === "~" || input.startsWith("~/") || input.startsWith("~\\")) {
|
|
@@ -29940,7 +30924,7 @@ function normalizePath(input) {
|
|
|
29940
30924
|
p = p.slice(1, -1);
|
|
29941
30925
|
}
|
|
29942
30926
|
p = expandTilde(p);
|
|
29943
|
-
return
|
|
30927
|
+
return resolve25(p);
|
|
29944
30928
|
}
|
|
29945
30929
|
var init_path_utils = __esm({
|
|
29946
30930
|
"packages/experience-design-system-cli/src/tui/import/steps/10-flow/support/path-utils.ts"() {
|
|
@@ -29966,14 +30950,14 @@ var init_use_blinking_cursor = __esm({
|
|
|
29966
30950
|
|
|
29967
30951
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/screens/PathPrompt.tsx
|
|
29968
30952
|
import { useState as useState27 } from "react";
|
|
29969
|
-
import { Box as
|
|
30953
|
+
import { Box as Box41, Text as Text43 } from "ink";
|
|
29970
30954
|
import { readdirSync as readdirSync3 } from "node:fs";
|
|
29971
|
-
import { dirname as
|
|
30955
|
+
import { dirname as dirname16, basename as basename6, join as join21 } from "node:path";
|
|
29972
30956
|
import { jsx as jsx51, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
29973
30957
|
function autocomplete(partial) {
|
|
29974
30958
|
if (!partial) return null;
|
|
29975
30959
|
const normalized = normalizePath(partial);
|
|
29976
|
-
const dir =
|
|
30960
|
+
const dir = dirname16(normalized);
|
|
29977
30961
|
const base = basename6(normalized);
|
|
29978
30962
|
let entries;
|
|
29979
30963
|
try {
|
|
@@ -30026,10 +31010,10 @@ function PathPrompt({
|
|
|
30026
31010
|
const shown = input || defaultPath;
|
|
30027
31011
|
const isPlaceholder = input === "";
|
|
30028
31012
|
const cursor = cursorVisible ? "\u2588" : " ";
|
|
30029
|
-
return /* @__PURE__ */ jsxs41(
|
|
31013
|
+
return /* @__PURE__ */ jsxs41(Box41, { flexDirection: "column", children: [
|
|
30030
31014
|
/* @__PURE__ */ jsx51(StepHeader, { step: "push" }),
|
|
30031
|
-
/* @__PURE__ */ jsxs41(
|
|
30032
|
-
/* @__PURE__ */ jsxs41(
|
|
31015
|
+
/* @__PURE__ */ jsxs41(Box41, { flexDirection: "column", gap: 1, paddingX: 2, paddingBottom: 1, children: [
|
|
31016
|
+
/* @__PURE__ */ jsxs41(Box41, { gap: 1, children: [
|
|
30033
31017
|
/* @__PURE__ */ jsx51(Text43, { color: PALETTE.accent, children: "?" }),
|
|
30034
31018
|
/* @__PURE__ */ jsxs41(Text43, { bold: true, children: [
|
|
30035
31019
|
label,
|
|
@@ -30106,7 +31090,7 @@ var init_use_timed_spinner = __esm({
|
|
|
30106
31090
|
});
|
|
30107
31091
|
|
|
30108
31092
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/screens/PushingStep.tsx
|
|
30109
|
-
import { Box as
|
|
31093
|
+
import { Box as Box42, Text as Text44 } from "ink";
|
|
30110
31094
|
import { ProgressBar as ProgressBar2, ThemeProvider as ThemeProvider2 } from "@inkjs/ui";
|
|
30111
31095
|
import { jsx as jsx53, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
30112
31096
|
function PushingStep({ progress, produced }) {
|
|
@@ -30114,20 +31098,20 @@ function PushingStep({ progress, produced }) {
|
|
|
30114
31098
|
const operationId = progress && progress.kind === "queued" ? progress.operationId : null;
|
|
30115
31099
|
const showGlobal = progress && progress.kind === "progress";
|
|
30116
31100
|
const showCurrent = progress && progress.kind === "progress" && progress.current ? progress.current : null;
|
|
30117
|
-
return /* @__PURE__ */ jsxs42(
|
|
31101
|
+
return /* @__PURE__ */ jsxs42(Box42, { flexDirection: "column", children: [
|
|
30118
31102
|
/* @__PURE__ */ jsx53(StepHeader, { step: "push" }),
|
|
30119
|
-
/* @__PURE__ */ jsxs42(
|
|
31103
|
+
/* @__PURE__ */ jsxs42(Box42, { flexDirection: "column", gap: 1, paddingX: 2, paddingBottom: 1, children: [
|
|
30120
31104
|
/* @__PURE__ */ jsxs42(Text44, { children: [
|
|
30121
31105
|
"Writing ",
|
|
30122
31106
|
writtenThings(produced),
|
|
30123
31107
|
" to your Contentful space..."
|
|
30124
31108
|
] }),
|
|
30125
|
-
operationId && /* @__PURE__ */ jsxs42(
|
|
31109
|
+
operationId && /* @__PURE__ */ jsxs42(Box42, { gap: 1, children: [
|
|
30126
31110
|
/* @__PURE__ */ jsx53(Text44, { color: PALETTE.muted, children: "Operation:" }),
|
|
30127
31111
|
/* @__PURE__ */ jsx53(Text44, { children: operationId })
|
|
30128
31112
|
] }),
|
|
30129
|
-
showGlobal && progress && progress.kind === "progress" && /* @__PURE__ */ jsx53(
|
|
30130
|
-
/* @__PURE__ */ jsx53(
|
|
31113
|
+
showGlobal && progress && progress.kind === "progress" && /* @__PURE__ */ jsx53(Box42, { gap: 1, flexDirection: "column", children: /* @__PURE__ */ jsxs42(Box42, { gap: 2, children: [
|
|
31114
|
+
/* @__PURE__ */ jsx53(Box42, { width: 40, children: /* @__PURE__ */ jsx53(ThemeProvider2, { theme: PROGRESS_THEME, children: /* @__PURE__ */ jsx53(ProgressBar2, { value: Math.round(progress.processed / progress.total * 100) }) }) }),
|
|
30131
31115
|
/* @__PURE__ */ jsxs42(Text44, { color: PALETTE.muted, children: [
|
|
30132
31116
|
progress.processed,
|
|
30133
31117
|
"/",
|
|
@@ -30135,11 +31119,11 @@ function PushingStep({ progress, produced }) {
|
|
|
30135
31119
|
" entities"
|
|
30136
31120
|
] })
|
|
30137
31121
|
] }) }),
|
|
30138
|
-
showCurrent && /* @__PURE__ */ jsxs42(
|
|
31122
|
+
showCurrent && /* @__PURE__ */ jsxs42(Box42, { gap: 1, children: [
|
|
30139
31123
|
/* @__PURE__ */ jsx53(Text44, { color: PALETTE.muted, children: "Now processing:" }),
|
|
30140
31124
|
/* @__PURE__ */ jsx53(Text44, { children: showCurrent })
|
|
30141
31125
|
] }),
|
|
30142
|
-
/* @__PURE__ */ jsx53(
|
|
31126
|
+
/* @__PURE__ */ jsx53(Box42, { marginTop: 1, children: /* @__PURE__ */ jsxs42(Text44, { color: PALETTE.muted, children: [
|
|
30143
31127
|
"Elapsed: ",
|
|
30144
31128
|
elapsed
|
|
30145
31129
|
] }) })
|
|
@@ -30345,7 +31329,7 @@ var init_preview_confirmation_input = __esm({
|
|
|
30345
31329
|
|
|
30346
31330
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/screens/WizardPreviewStep.tsx
|
|
30347
31331
|
import { useEffect as useEffect20, useState as useState29, useMemo as useMemo5 } from "react";
|
|
30348
|
-
import { Box as
|
|
31332
|
+
import { Box as Box43, Text as Text45 } from "ink";
|
|
30349
31333
|
import { Fragment as Fragment16, jsx as jsx54, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
30350
31334
|
function buildPreviewSummaryLines(preview) {
|
|
30351
31335
|
const lines = [];
|
|
@@ -30598,9 +31582,9 @@ function WizardPreviewStep({
|
|
|
30598
31582
|
return;
|
|
30599
31583
|
}
|
|
30600
31584
|
});
|
|
30601
|
-
return /* @__PURE__ */ jsxs43(
|
|
31585
|
+
return /* @__PURE__ */ jsxs43(Box43, { flexDirection: "column", children: [
|
|
30602
31586
|
/* @__PURE__ */ jsx54(StepHeader, { step: "push" }),
|
|
30603
|
-
/* @__PURE__ */ jsxs43(
|
|
31587
|
+
/* @__PURE__ */ jsxs43(Box43, { flexDirection: "column", gap: 1, paddingX: 2, paddingBottom: 2, children: [
|
|
30604
31588
|
hasAnything ? /* @__PURE__ */ jsxs43(Fragment16, { children: [
|
|
30605
31589
|
/* @__PURE__ */ jsx54(Text45, { children: "Here's what will happen in your space:" }),
|
|
30606
31590
|
/* @__PURE__ */ jsxs43(
|
|
@@ -30617,9 +31601,9 @@ function WizardPreviewStep({
|
|
|
30617
31601
|
}
|
|
30618
31602
|
)
|
|
30619
31603
|
] }) : /* @__PURE__ */ jsx54(Text45, { color: PALETTE.muted, children: "Nothing to push \u2014 everything is already up to date." }),
|
|
30620
|
-
breakingWithImpact && /* @__PURE__ */ jsx54(
|
|
31604
|
+
breakingWithImpact && /* @__PURE__ */ jsx54(Box43, { marginTop: 1, children: /* @__PURE__ */ jsx54(Text45, { color: PALETTE.error, bold: true, children: "\u26A0 Breaking changes will affect downstream entities. Press Enter to acknowledge and apply." }) }),
|
|
30621
31605
|
/* @__PURE__ */ jsx54(SpaceEnvironment, { spaceId, environmentId }),
|
|
30622
|
-
/* @__PURE__ */ jsx54(
|
|
31606
|
+
/* @__PURE__ */ jsx54(Box43, { marginTop: 1, children: /* @__PURE__ */ jsx54(
|
|
30623
31607
|
ControlHints,
|
|
30624
31608
|
{
|
|
30625
31609
|
hints: [
|
|
@@ -30665,7 +31649,7 @@ var init_run_teaser = __esm({
|
|
|
30665
31649
|
});
|
|
30666
31650
|
|
|
30667
31651
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/flow/screen.tsx
|
|
30668
|
-
import { Box as
|
|
31652
|
+
import { Box as Box44 } from "ink";
|
|
30669
31653
|
import { jsx as jsx55, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
30670
31654
|
function canEditFromPreview(cdf) {
|
|
30671
31655
|
if (!cdf) return false;
|
|
@@ -30783,7 +31767,7 @@ function FlowScreen({
|
|
|
30783
31767
|
);
|
|
30784
31768
|
}
|
|
30785
31769
|
})();
|
|
30786
|
-
return /* @__PURE__ */ jsxs44(
|
|
31770
|
+
return /* @__PURE__ */ jsxs44(Box44, { flexDirection: "column", children: [
|
|
30787
31771
|
/* @__PURE__ */ jsx55(CustomPromptBanner, { generatePromptPath }),
|
|
30788
31772
|
content
|
|
30789
31773
|
] });
|
|
@@ -31287,7 +32271,7 @@ var init_save = __esm({
|
|
|
31287
32271
|
writeFile: (path5, contents) => writeFile7(path5, contents),
|
|
31288
32272
|
appendRun,
|
|
31289
32273
|
buildSourceFingerprint,
|
|
31290
|
-
sleep: (ms) => new Promise((
|
|
32274
|
+
sleep: (ms) => new Promise((resolve29) => setTimeout(resolve29, ms)),
|
|
31291
32275
|
warn: (message) => process.stderr.write(message)
|
|
31292
32276
|
});
|
|
31293
32277
|
}
|
|
@@ -31309,7 +32293,7 @@ var init_types9 = __esm({
|
|
|
31309
32293
|
import { appendFileSync, writeFileSync } from "node:fs";
|
|
31310
32294
|
import { mkdir as mkdir8 } from "node:fs/promises";
|
|
31311
32295
|
import { tmpdir } from "node:os";
|
|
31312
|
-
import { join as join23, resolve as
|
|
32296
|
+
import { join as join23, resolve as resolve26 } from "node:path";
|
|
31313
32297
|
function appendWizardLog(entry) {
|
|
31314
32298
|
appendFileSync(WIZARD_LOG, JSON.stringify({ ts: (/* @__PURE__ */ new Date()).toISOString(), ...entry }) + "\n");
|
|
31315
32299
|
}
|
|
@@ -31562,7 +32546,7 @@ function createFlowController(start, deps) {
|
|
|
31562
32546
|
},
|
|
31563
32547
|
async submitPath(submitted) {
|
|
31564
32548
|
await deps.mkdir(submitted);
|
|
31565
|
-
if (
|
|
32549
|
+
if (resolve26(submitted) !== resolve26(state2.outDir) && await deps.detectSaveConflict(submitted)) {
|
|
31566
32550
|
const subdir = deps.buildTimestampedSubdir(submitted);
|
|
31567
32551
|
await deps.mkdir(subdir);
|
|
31568
32552
|
await proceedToWrite(subdir);
|
|
@@ -31657,7 +32641,7 @@ var init_debug_mode_store = __esm({
|
|
|
31657
32641
|
|
|
31658
32642
|
// packages/experience-design-system-cli/src/tui/debug-prune.ts
|
|
31659
32643
|
import { readdir as readdir2, rm, rmdir, stat as stat4 } from "node:fs/promises";
|
|
31660
|
-
import { dirname as
|
|
32644
|
+
import { dirname as dirname17, join as join24 } from "node:path";
|
|
31661
32645
|
async function logFilesIn(dir) {
|
|
31662
32646
|
const entries = await readdir2(dir, { withFileTypes: true });
|
|
31663
32647
|
const nested = await Promise.all(
|
|
@@ -31680,7 +32664,7 @@ async function removeEmptyFolders(from, stop) {
|
|
|
31680
32664
|
}
|
|
31681
32665
|
removed += 1;
|
|
31682
32666
|
if (dir === stop) return removed;
|
|
31683
|
-
dir =
|
|
32667
|
+
dir = dirname17(dir);
|
|
31684
32668
|
}
|
|
31685
32669
|
}
|
|
31686
32670
|
async function pruneExpiredLogs(base, retentionDays, now = Date.now()) {
|
|
@@ -31696,7 +32680,7 @@ async function pruneExpiredLogs(base, retentionDays, now = Date.now()) {
|
|
|
31696
32680
|
if ((await stat4(file)).mtimeMs >= cutoff) continue;
|
|
31697
32681
|
await rm(file);
|
|
31698
32682
|
result.logs += 1;
|
|
31699
|
-
result.folders += await removeEmptyFolders(
|
|
32683
|
+
result.folders += await removeEmptyFolders(dirname17(file), join24(contentfulDir, session));
|
|
31700
32684
|
} catch {
|
|
31701
32685
|
}
|
|
31702
32686
|
}
|
|
@@ -31726,7 +32710,7 @@ __export(debug_store_exports, {
|
|
|
31726
32710
|
});
|
|
31727
32711
|
import { mkdir as mkdir9, writeFile as writeFile8 } from "node:fs/promises";
|
|
31728
32712
|
import { existsSync as existsSync10, readdirSync as readdirSync4 } from "node:fs";
|
|
31729
|
-
import { join as join25, resolve as
|
|
32713
|
+
import { join as join25, resolve as resolve27 } from "node:path";
|
|
31730
32714
|
function generateRunId() {
|
|
31731
32715
|
const now = /* @__PURE__ */ new Date();
|
|
31732
32716
|
const pad = (n) => String(n).padStart(2, "0");
|
|
@@ -31742,7 +32726,7 @@ function slugify(value) {
|
|
|
31742
32726
|
async function readBaseDir() {
|
|
31743
32727
|
try {
|
|
31744
32728
|
const dir = (await readSettings2())["contentfulBaseDir"];
|
|
31745
|
-
return typeof dir === "string" && dir !== "" ?
|
|
32729
|
+
return typeof dir === "string" && dir !== "" ? resolve27(dir) : void 0;
|
|
31746
32730
|
} catch {
|
|
31747
32731
|
return void 0;
|
|
31748
32732
|
}
|
|
@@ -31771,7 +32755,7 @@ function currentSessionDir() {
|
|
|
31771
32755
|
async function startDebugSessionIn(base, { replace = false } = {}) {
|
|
31772
32756
|
try {
|
|
31773
32757
|
if (!await isDebugModeEnabled()) return;
|
|
31774
|
-
await mkdir9(join25(startSession(
|
|
32758
|
+
await mkdir9(join25(startSession(resolve27(base), { replace }), "debug"), { recursive: true });
|
|
31775
32759
|
} catch {
|
|
31776
32760
|
}
|
|
31777
32761
|
}
|
|
@@ -31785,7 +32769,7 @@ function nextImportRunDir(session) {
|
|
|
31785
32769
|
}
|
|
31786
32770
|
async function startImportRun(projectPath) {
|
|
31787
32771
|
await startDebugSessionIn(projectPath);
|
|
31788
|
-
if (!sessionDir) return join25(
|
|
32772
|
+
if (!sessionDir) return join25(resolve27(projectPath), ".contentful");
|
|
31789
32773
|
const dir = nextImportRunDir(sessionDir);
|
|
31790
32774
|
await mkdir9(dir, { recursive: true });
|
|
31791
32775
|
return dir;
|
|
@@ -31927,7 +32911,7 @@ var init_debug_store = __esm({
|
|
|
31927
32911
|
});
|
|
31928
32912
|
|
|
31929
32913
|
// packages/experience-design-system-cli/src/tui/help/file-locations.ts
|
|
31930
|
-
import { join as join26, resolve as
|
|
32914
|
+
import { join as join26, resolve as resolve28 } from "node:path";
|
|
31931
32915
|
function describeFileLocations({
|
|
31932
32916
|
contentfulBaseDir,
|
|
31933
32917
|
debugModeEnabled,
|
|
@@ -31939,7 +32923,7 @@ function describeFileLocations({
|
|
|
31939
32923
|
importFiles: `${join26("<project>", ".contentful")}/ (tokens.json, components.json)`
|
|
31940
32924
|
};
|
|
31941
32925
|
}
|
|
31942
|
-
const base = contentfulBaseDir ?
|
|
32926
|
+
const base = contentfulBaseDir ? resolve28(contentfulBaseDir) : "<project>";
|
|
31943
32927
|
const session = currentSessionDir2 ?? join26(base, ".contentful", "<date>-session-<n>");
|
|
31944
32928
|
return {
|
|
31945
32929
|
debugLogs: join26(session, "debug"),
|
|
@@ -31994,13 +32978,13 @@ var init_help_info = __esm({
|
|
|
31994
32978
|
|
|
31995
32979
|
// packages/experience-design-system-cli/src/tui/help/PageContainer.tsx
|
|
31996
32980
|
import { useEffect as useEffect22, useState as useState30 } from "react";
|
|
31997
|
-
import { Box as
|
|
32981
|
+
import { Box as Box45, Text as Text46, useInput as useInput12 } from "ink";
|
|
31998
32982
|
import { Fragment as Fragment17, jsx as jsx56, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
31999
32983
|
function Section({ title, rows }) {
|
|
32000
|
-
return /* @__PURE__ */ jsxs45(
|
|
32984
|
+
return /* @__PURE__ */ jsxs45(Box45, { flexDirection: "column", children: [
|
|
32001
32985
|
/* @__PURE__ */ jsx56(Text46, { bold: true, color: PALETTE.accent, children: title }),
|
|
32002
|
-
rows.map((row) => /* @__PURE__ */ jsxs45(
|
|
32003
|
-
/* @__PURE__ */ jsx56(
|
|
32986
|
+
rows.map((row) => /* @__PURE__ */ jsxs45(Box45, { gap: 1, children: [
|
|
32987
|
+
/* @__PURE__ */ jsx56(Box45, { width: 16, flexShrink: 0, children: /* @__PURE__ */ jsx56(Text46, { color: PALETTE.muted, children: row.label }) }),
|
|
32004
32988
|
/* @__PURE__ */ jsx56(Text46, { children: row.value })
|
|
32005
32989
|
] }, row.label))
|
|
32006
32990
|
] });
|
|
@@ -32015,7 +32999,7 @@ function HelpScreen({ onDone }) {
|
|
|
32015
32999
|
void finishDebugRun({ outputs: {}, status: "success", exitMethod });
|
|
32016
33000
|
onDone();
|
|
32017
33001
|
};
|
|
32018
|
-
|
|
33002
|
+
useInput12((input, key) => {
|
|
32019
33003
|
if (key.return) {
|
|
32020
33004
|
leave("saved");
|
|
32021
33005
|
return;
|
|
@@ -32025,7 +33009,7 @@ function HelpScreen({ onDone }) {
|
|
|
32025
33009
|
return;
|
|
32026
33010
|
}
|
|
32027
33011
|
});
|
|
32028
|
-
return /* @__PURE__ */ jsxs45(
|
|
33012
|
+
return /* @__PURE__ */ jsxs45(Box45, { flexDirection: "column", paddingX: 2, paddingY: 1, gap: 1, children: [
|
|
32029
33013
|
/* @__PURE__ */ jsx56(Text46, { bold: true, children: "Help" }),
|
|
32030
33014
|
info ? /* @__PURE__ */ jsxs45(Fragment17, { children: [
|
|
32031
33015
|
/* @__PURE__ */ jsx56(Section, { title: "Where things are stored", rows: info.storage }),
|
|
@@ -32055,7 +33039,7 @@ var init_PageContainer2 = __esm({
|
|
|
32055
33039
|
|
|
32056
33040
|
// packages/experience-design-system-cli/src/tui/settings/PageContainer.tsx
|
|
32057
33041
|
import { useState as useState31 } from "react";
|
|
32058
|
-
import { Box as
|
|
33042
|
+
import { Box as Box46, Text as Text47, useInput as useInput13 } from "ink";
|
|
32059
33043
|
import { jsx as jsx57, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
32060
33044
|
function SettingsScreen({
|
|
32061
33045
|
onNavigate,
|
|
@@ -32067,7 +33051,7 @@ function SettingsScreen({
|
|
|
32067
33051
|
{ label: "Opt-in Analytics", screen: "settings-opt-in-analytics" },
|
|
32068
33052
|
{ label: "Debug Mode", screen: "settings-debug-mode" }
|
|
32069
33053
|
];
|
|
32070
|
-
|
|
33054
|
+
useInput13((input, key) => {
|
|
32071
33055
|
if (key.upArrow) {
|
|
32072
33056
|
setFocusIdx((i) => (i - 1 + items.length) % items.length);
|
|
32073
33057
|
return;
|
|
@@ -32087,7 +33071,7 @@ function SettingsScreen({
|
|
|
32087
33071
|
onBack();
|
|
32088
33072
|
}
|
|
32089
33073
|
});
|
|
32090
|
-
return /* @__PURE__ */ jsxs46(
|
|
33074
|
+
return /* @__PURE__ */ jsxs46(Box46, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
32091
33075
|
/* @__PURE__ */ jsx57(Text47, { bold: true, children: "Settings" }),
|
|
32092
33076
|
/* @__PURE__ */ jsx57(Text47, { color: PALETTE.muted, children: " " }),
|
|
32093
33077
|
items.map((item, i) => /* @__PURE__ */ jsxs46(Text47, { color: i === focusIdx ? PALETTE.accent : void 0, children: [
|
|
@@ -32171,20 +33155,20 @@ function resolveOnPath(binary) {
|
|
|
32171
33155
|
() => null
|
|
32172
33156
|
);
|
|
32173
33157
|
}
|
|
32174
|
-
return new Promise((
|
|
33158
|
+
return new Promise((resolve29) => {
|
|
32175
33159
|
execFile2(
|
|
32176
33160
|
process.platform === "win32" ? "where" : "which",
|
|
32177
33161
|
[binary],
|
|
32178
|
-
(error, stdout) =>
|
|
33162
|
+
(error, stdout) => resolve29(error ? null : stdout.split("\n")[0]?.trim() ?? null)
|
|
32179
33163
|
);
|
|
32180
33164
|
});
|
|
32181
33165
|
}
|
|
32182
33166
|
function readVersion(binary) {
|
|
32183
|
-
return new Promise((
|
|
33167
|
+
return new Promise((resolve29) => {
|
|
32184
33168
|
execFile2(binary, ["--version"], { timeout: VERSION_TIMEOUT_MS }, (error, stdout) => {
|
|
32185
33169
|
const line = stdout.split("\n")[0]?.trim() ?? "";
|
|
32186
|
-
if (!error && line)
|
|
32187
|
-
else
|
|
33170
|
+
if (!error && line) resolve29(pass("version", line));
|
|
33171
|
+
else resolve29(fail3("version", "runs, but did not report a version"));
|
|
32188
33172
|
});
|
|
32189
33173
|
});
|
|
32190
33174
|
}
|
|
@@ -32429,10 +33413,10 @@ var init_AgentStatusBadge = __esm({
|
|
|
32429
33413
|
|
|
32430
33414
|
// packages/experience-design-system-cli/src/tui/settings/configuration/agents/AgentDetail.tsx
|
|
32431
33415
|
import { useEffect as useEffect23, useState as useState32 } from "react";
|
|
32432
|
-
import { Box as
|
|
33416
|
+
import { Box as Box47, Text as Text49 } from "ink";
|
|
32433
33417
|
import { jsx as jsx59, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
32434
33418
|
function StatusHeading() {
|
|
32435
|
-
return /* @__PURE__ */ jsxs47(
|
|
33419
|
+
return /* @__PURE__ */ jsxs47(Box47, { gap: 1, children: [
|
|
32436
33420
|
/* @__PURE__ */ jsx59(Text49, { bold: true, color: PALETTE.muted, children: "STATUS" }),
|
|
32437
33421
|
/* @__PURE__ */ jsx59(Text49, { color: PALETTE.muted, children: "\xB7 read only" })
|
|
32438
33422
|
] });
|
|
@@ -32514,7 +33498,7 @@ function AgentDetail({
|
|
|
32514
33498
|
actions: [action],
|
|
32515
33499
|
notice: testing ? null : notice,
|
|
32516
33500
|
busy: saving || testing,
|
|
32517
|
-
children: /* @__PURE__ */ jsxs47(
|
|
33501
|
+
children: /* @__PURE__ */ jsxs47(Box47, { flexDirection: "column", marginTop: 1, children: [
|
|
32518
33502
|
/* @__PURE__ */ jsx59(StatusHeading, {}),
|
|
32519
33503
|
statusRows(name, checks, settings.binary).map((row) => /* @__PURE__ */ jsx59(FormReadOnlyRow, { label: row.label, labelWidth, children: /* @__PURE__ */ jsx59(Text49, { color: TONE_COLOR[row.tone], children: row.value }) }, row.label))
|
|
32520
33504
|
] })
|
|
@@ -32542,7 +33526,7 @@ var init_AgentDetail = __esm({
|
|
|
32542
33526
|
|
|
32543
33527
|
// packages/experience-design-system-cli/src/tui/settings/configuration/agents/AgentsScreen.tsx
|
|
32544
33528
|
import { useEffect as useEffect24, useRef as useRef15, useState as useState33 } from "react";
|
|
32545
|
-
import { Box as
|
|
33529
|
+
import { Box as Box48, Text as Text50, useInput as useInput14 } from "ink";
|
|
32546
33530
|
import { Fragment as Fragment18, jsx as jsx60, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
32547
33531
|
function AgentsScreen({ onDone }) {
|
|
32548
33532
|
const [config, setConfig] = useState33(null);
|
|
@@ -32619,7 +33603,7 @@ function AgentsScreen({ onDone }) {
|
|
|
32619
33603
|
setNotice({ kind: "error", text: `Default agent not changed: ${visit.error}` });
|
|
32620
33604
|
}).finally(() => setSaving(false));
|
|
32621
33605
|
};
|
|
32622
|
-
|
|
33606
|
+
useInput14((input, key) => {
|
|
32623
33607
|
if (loadError && (key.escape || input === "q")) {
|
|
32624
33608
|
endVisit(null);
|
|
32625
33609
|
onDone();
|
|
@@ -32651,7 +33635,7 @@ function AgentsScreen({ onDone }) {
|
|
|
32651
33635
|
}
|
|
32652
33636
|
});
|
|
32653
33637
|
if (!config) {
|
|
32654
|
-
return /* @__PURE__ */ jsxs48(
|
|
33638
|
+
return /* @__PURE__ */ jsxs48(Box48, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
32655
33639
|
/* @__PURE__ */ jsx60(Text50, { bold: true, children: "Settings \u203A Configuration \u203A Agents" }),
|
|
32656
33640
|
/* @__PURE__ */ jsx60(Text50, { children: " " }),
|
|
32657
33641
|
loadError ? /* @__PURE__ */ jsxs48(Fragment18, { children: [
|
|
@@ -32686,35 +33670,35 @@ function AgentsScreen({ onDone }) {
|
|
|
32686
33670
|
);
|
|
32687
33671
|
}
|
|
32688
33672
|
const focusedAgent = AGENT_NAMES[focus];
|
|
32689
|
-
return /* @__PURE__ */ jsxs48(
|
|
33673
|
+
return /* @__PURE__ */ jsxs48(Box48, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
32690
33674
|
/* @__PURE__ */ jsx60(Text50, { bold: true, children: "Settings \u203A Configuration \u203A Agents" }),
|
|
32691
33675
|
/* @__PURE__ */ jsx60(Text50, { children: " " }),
|
|
32692
33676
|
/* @__PURE__ */ jsx60(Text50, { color: PALETTE.muted, children: "The coding agent the CLI runs, and what was found for each one." }),
|
|
32693
33677
|
/* @__PURE__ */ jsx60(Text50, { children: " " }),
|
|
32694
|
-
/* @__PURE__ */ jsxs48(
|
|
33678
|
+
/* @__PURE__ */ jsxs48(Box48, { gap: 1, children: [
|
|
32695
33679
|
/* @__PURE__ */ jsx60(Text50, { color: PALETTE.muted, children: "Default agent" }),
|
|
32696
33680
|
/* @__PURE__ */ jsx60(Text50, { bold: true, children: AGENT_LABELS[config.defaultAgent] }),
|
|
32697
33681
|
saving && /* @__PURE__ */ jsx60(Text50, { color: PALETTE.accent, children: "\u2026 saving" })
|
|
32698
33682
|
] }),
|
|
32699
|
-
/* @__PURE__ */ jsxs48(
|
|
33683
|
+
/* @__PURE__ */ jsxs48(Box48, { marginTop: 1, gap: 1, children: [
|
|
32700
33684
|
/* @__PURE__ */ jsx60(Text50, { children: " " }),
|
|
32701
33685
|
/* @__PURE__ */ jsx60(Text50, { children: " " }),
|
|
32702
|
-
/* @__PURE__ */ jsx60(
|
|
33686
|
+
/* @__PURE__ */ jsx60(Box48, { width: NAME_WIDTH, flexShrink: 0, children: /* @__PURE__ */ jsx60(Text50, { color: PALETTE.muted, children: "AGENT" }) }),
|
|
32703
33687
|
/* @__PURE__ */ jsx60(Text50, { color: PALETTE.muted, children: "STATUS" })
|
|
32704
33688
|
] }),
|
|
32705
33689
|
AGENT_NAMES.map((name) => {
|
|
32706
33690
|
const isFocused = focusedAgent === name;
|
|
32707
|
-
return /* @__PURE__ */ jsxs48(
|
|
33691
|
+
return /* @__PURE__ */ jsxs48(Box48, { gap: 1, children: [
|
|
32708
33692
|
/* @__PURE__ */ jsx60(Text50, { color: isFocused ? PALETTE.accent : void 0, children: isFocused ? "\u276F" : " " }),
|
|
32709
33693
|
/* @__PURE__ */ jsx60(Text50, { color: PALETTE.success, children: name === config.defaultAgent ? "\u2605" : " " }),
|
|
32710
|
-
/* @__PURE__ */ jsx60(
|
|
33694
|
+
/* @__PURE__ */ jsx60(Box48, { width: NAME_WIDTH, flexShrink: 0, children: /* @__PURE__ */ jsx60(Text50, { bold: isFocused, color: isFocused ? PALETTE.accent : void 0, children: AGENT_LABELS[name] }) }),
|
|
32711
33695
|
/* @__PURE__ */ jsx60(AgentStatusBadge, { name, checks: checks[name], binary: config.agents[name].binary })
|
|
32712
33696
|
] }, name);
|
|
32713
33697
|
}),
|
|
32714
|
-
/* @__PURE__ */ jsxs48(
|
|
33698
|
+
/* @__PURE__ */ jsxs48(Box48, { flexDirection: "column", marginTop: 1, children: [
|
|
32715
33699
|
/* @__PURE__ */ jsx60(Text50, { color: PALETTE.muted, children: `\u2500 ${AGENT_LABELS[focusedAgent]} ${"\u2500".repeat(30)}` }),
|
|
32716
|
-
panelRows(focusedAgent, checks[focusedAgent], config.agents[focusedAgent]).map((row) => /* @__PURE__ */ jsxs48(
|
|
32717
|
-
/* @__PURE__ */ jsx60(
|
|
33700
|
+
panelRows(focusedAgent, checks[focusedAgent], config.agents[focusedAgent]).map((row) => /* @__PURE__ */ jsxs48(Box48, { gap: 1, paddingLeft: 1, children: [
|
|
33701
|
+
/* @__PURE__ */ jsx60(Box48, { width: PANEL_LABEL_WIDTH, flexShrink: 0, children: /* @__PURE__ */ jsx60(Text50, { color: PALETTE.muted, children: row.label }) }),
|
|
32718
33702
|
/* @__PURE__ */ jsx60(Text50, { color: TONE_COLOR[row.tone], children: row.value })
|
|
32719
33703
|
] }, row.label))
|
|
32720
33704
|
] }),
|
|
@@ -32792,7 +33776,7 @@ var init_project_store = __esm({
|
|
|
32792
33776
|
|
|
32793
33777
|
// packages/experience-design-system-cli/src/tui/settings/configuration/project/ProjectScreen.tsx
|
|
32794
33778
|
import { useEffect as useEffect25, useRef as useRef16, useState as useState34 } from "react";
|
|
32795
|
-
import { Box as
|
|
33779
|
+
import { Box as Box49, Text as Text51, useInput as useInput15 } from "ink";
|
|
32796
33780
|
import { Fragment as Fragment19, jsx as jsx61, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
32797
33781
|
function debugFields(config) {
|
|
32798
33782
|
return {
|
|
@@ -32855,14 +33839,14 @@ function ProjectScreen({ onDone }) {
|
|
|
32855
33839
|
exitMethod: change.changed ? "saved" : "discarded"
|
|
32856
33840
|
});
|
|
32857
33841
|
};
|
|
32858
|
-
|
|
33842
|
+
useInput15((input, key) => {
|
|
32859
33843
|
if (!config && loadError && (key.escape || input === "q")) {
|
|
32860
33844
|
endVisit(null);
|
|
32861
33845
|
onDone();
|
|
32862
33846
|
}
|
|
32863
33847
|
});
|
|
32864
33848
|
if (!config) {
|
|
32865
|
-
return /* @__PURE__ */ jsxs49(
|
|
33849
|
+
return /* @__PURE__ */ jsxs49(Box49, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
32866
33850
|
/* @__PURE__ */ jsx61(Text51, { bold: true, children: "Settings \u203A Configuration \u203A Project" }),
|
|
32867
33851
|
/* @__PURE__ */ jsx61(Text51, { children: " " }),
|
|
32868
33852
|
loadError ? /* @__PURE__ */ jsxs49(Fragment19, { children: [
|
|
@@ -32905,6 +33889,7 @@ function ProjectScreen({ onDone }) {
|
|
|
32905
33889
|
setNotice(null);
|
|
32906
33890
|
visit.trail.record(`edited ${key}`);
|
|
32907
33891
|
},
|
|
33892
|
+
enterAdvances: true,
|
|
32908
33893
|
onSave: save,
|
|
32909
33894
|
onQuit: quit,
|
|
32910
33895
|
notice,
|
|
@@ -32938,13 +33923,13 @@ var init_ProjectScreen = __esm({
|
|
|
32938
33923
|
|
|
32939
33924
|
// packages/experience-design-system-cli/src/tui/settings/configuration/ConfigurationScreen.tsx
|
|
32940
33925
|
import { useState as useState35 } from "react";
|
|
32941
|
-
import { Box as
|
|
33926
|
+
import { Box as Box50, Text as Text52, useInput as useInput16 } from "ink";
|
|
32942
33927
|
import { jsx as jsx62, jsxs as jsxs50 } from "react/jsx-runtime";
|
|
32943
33928
|
function ConfigurationScreen({ onDone }) {
|
|
32944
33929
|
const [focus, setFocus] = useState35(0);
|
|
32945
33930
|
const [open, setOpen] = useState35(null);
|
|
32946
33931
|
const close = () => setOpen(null);
|
|
32947
|
-
|
|
33932
|
+
useInput16((input, key) => {
|
|
32948
33933
|
if (open) return;
|
|
32949
33934
|
if (key.upArrow) {
|
|
32950
33935
|
setFocus((i) => (i - 1 + SECTIONS.length) % SECTIONS.length);
|
|
@@ -32962,12 +33947,12 @@ function ConfigurationScreen({ onDone }) {
|
|
|
32962
33947
|
});
|
|
32963
33948
|
if (open === "project") return /* @__PURE__ */ jsx62(ProjectScreen, { onDone: close });
|
|
32964
33949
|
if (open === "agents") return /* @__PURE__ */ jsx62(AgentsScreen, { onDone: close });
|
|
32965
|
-
return /* @__PURE__ */ jsxs50(
|
|
33950
|
+
return /* @__PURE__ */ jsxs50(Box50, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
32966
33951
|
/* @__PURE__ */ jsx62(Text52, { bold: true, children: "Settings \u203A Configuration" }),
|
|
32967
33952
|
/* @__PURE__ */ jsx62(Text52, { children: " " }),
|
|
32968
|
-
SECTIONS.map((section, index) => /* @__PURE__ */ jsxs50(
|
|
33953
|
+
SECTIONS.map((section, index) => /* @__PURE__ */ jsxs50(Box50, { gap: 1, children: [
|
|
32969
33954
|
/* @__PURE__ */ jsx62(Text52, { color: index === focus ? PALETTE.accent : void 0, children: index === focus ? "\u276F" : " " }),
|
|
32970
|
-
/* @__PURE__ */ jsx62(
|
|
33955
|
+
/* @__PURE__ */ jsx62(Box50, { width: 9, flexShrink: 0, children: /* @__PURE__ */ jsx62(Text52, { bold: index === focus, color: index === focus ? PALETTE.accent : void 0, children: section.label }) }),
|
|
32971
33956
|
/* @__PURE__ */ jsx62(Text52, { color: PALETTE.muted, children: section.description })
|
|
32972
33957
|
] }, section.id)),
|
|
32973
33958
|
/* @__PURE__ */ jsx62(Text52, { children: " " }),
|
|
@@ -33004,7 +33989,7 @@ var init_ConfigurationScreen = __esm({
|
|
|
33004
33989
|
|
|
33005
33990
|
// packages/experience-design-system-cli/src/tui/settings/opt-in-analytics/screen.tsx
|
|
33006
33991
|
import { useEffect as useEffect26, useState as useState36 } from "react";
|
|
33007
|
-
import { Box as
|
|
33992
|
+
import { Box as Box51, Text as Text53, useInput as useInput17 } from "ink";
|
|
33008
33993
|
import { Fragment as Fragment20, jsx as jsx63, jsxs as jsxs51 } from "react/jsx-runtime";
|
|
33009
33994
|
function OptInAnalyticsScreen({ onDone }) {
|
|
33010
33995
|
const [loading, setLoading] = useState36(true);
|
|
@@ -33021,7 +34006,7 @@ function OptInAnalyticsScreen({ onDone }) {
|
|
|
33021
34006
|
});
|
|
33022
34007
|
});
|
|
33023
34008
|
}, []);
|
|
33024
|
-
|
|
34009
|
+
useInput17((input, key) => {
|
|
33025
34010
|
if (loading) return;
|
|
33026
34011
|
if (key.return || input === " ") {
|
|
33027
34012
|
setEnabled((current) => {
|
|
@@ -33036,7 +34021,7 @@ function OptInAnalyticsScreen({ onDone }) {
|
|
|
33036
34021
|
onDone();
|
|
33037
34022
|
}
|
|
33038
34023
|
});
|
|
33039
|
-
return /* @__PURE__ */ jsxs51(
|
|
34024
|
+
return /* @__PURE__ */ jsxs51(Box51, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
33040
34025
|
/* @__PURE__ */ jsx63(Text53, { bold: true, children: "Settings \u203A Opt-in Analytics" }),
|
|
33041
34026
|
/* @__PURE__ */ jsx63(Text53, { children: " " }),
|
|
33042
34027
|
loading ? /* @__PURE__ */ jsx63(Text53, { color: PALETTE.muted, children: "Loading\u2026" }) : /* @__PURE__ */ jsxs51(Fragment20, { children: [
|
|
@@ -33073,7 +34058,7 @@ var init_screen11 = __esm({
|
|
|
33073
34058
|
|
|
33074
34059
|
// packages/experience-design-system-cli/src/tui/settings/debug-mode/screen.tsx
|
|
33075
34060
|
import { useEffect as useEffect27, useRef as useRef17, useState as useState37 } from "react";
|
|
33076
|
-
import { Box as
|
|
34061
|
+
import { Box as Box52, Text as Text54, useInput as useInput18 } from "ink";
|
|
33077
34062
|
import { Fragment as Fragment21, jsx as jsx64, jsxs as jsxs52 } from "react/jsx-runtime";
|
|
33078
34063
|
function DebugModeScreen({ onDone }) {
|
|
33079
34064
|
const [setting, setSetting] = useState37(null);
|
|
@@ -33123,7 +34108,7 @@ function DebugModeScreen({ onDone }) {
|
|
|
33123
34108
|
exitMethod: change.changed ? "saved" : "discarded"
|
|
33124
34109
|
});
|
|
33125
34110
|
};
|
|
33126
|
-
|
|
34111
|
+
useInput18((input, key) => {
|
|
33127
34112
|
if (!setting) return;
|
|
33128
34113
|
if (key.upArrow || key.downArrow) {
|
|
33129
34114
|
setFocus((current) => ROWS[(ROWS.indexOf(current) + (key.downArrow ? 1 : ROWS.length - 1)) % ROWS.length]);
|
|
@@ -33152,16 +34137,16 @@ function DebugModeScreen({ onDone }) {
|
|
|
33152
34137
|
});
|
|
33153
34138
|
const marker = (row) => /* @__PURE__ */ jsx64(Text54, { color: focus === row ? PALETTE.accent : void 0, children: focus === row ? "\u276F" : " " });
|
|
33154
34139
|
const label = (row, text) => /* @__PURE__ */ jsx64(Text54, { bold: focus === row, color: focus === row ? PALETTE.accent : PALETTE.muted, children: text });
|
|
33155
|
-
return /* @__PURE__ */ jsxs52(
|
|
34140
|
+
return /* @__PURE__ */ jsxs52(Box52, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
33156
34141
|
/* @__PURE__ */ jsx64(Text54, { bold: true, children: "Settings \u203A Debug Mode" }),
|
|
33157
34142
|
/* @__PURE__ */ jsx64(Text54, { children: " " }),
|
|
33158
34143
|
setting ? /* @__PURE__ */ jsxs52(Fragment21, { children: [
|
|
33159
|
-
/* @__PURE__ */ jsxs52(
|
|
34144
|
+
/* @__PURE__ */ jsxs52(Box52, { gap: 1, children: [
|
|
33160
34145
|
marker("enabled"),
|
|
33161
34146
|
label("enabled", "Debug logging:"),
|
|
33162
34147
|
/* @__PURE__ */ jsx64(Text54, { bold: true, color: setting.enabled ? PALETTE.success : PALETTE.muted, children: setting.enabled ? "On" : "Off" })
|
|
33163
34148
|
] }),
|
|
33164
|
-
/* @__PURE__ */ jsxs52(
|
|
34149
|
+
/* @__PURE__ */ jsxs52(Box52, { gap: 1, children: [
|
|
33165
34150
|
marker("retentionDays"),
|
|
33166
34151
|
label("retentionDays", "Delete logs after:"),
|
|
33167
34152
|
RETENTION_CHOICES.map((days) => {
|
|
@@ -33608,14 +34593,14 @@ function runDevWatch(args) {
|
|
|
33608
34593
|
process.stderr.write("--watch only works from a checkout of the repo (scripts/dev.mjs is not in the package).\n");
|
|
33609
34594
|
return Promise.resolve(1);
|
|
33610
34595
|
}
|
|
33611
|
-
return new Promise((
|
|
34596
|
+
return new Promise((resolve29) => {
|
|
33612
34597
|
const child = spawn3(process.execPath, [script, ...args], { stdio: "inherit" });
|
|
33613
34598
|
process.on("SIGINT", () => void 0);
|
|
33614
|
-
child.on("exit", (code) =>
|
|
34599
|
+
child.on("exit", (code) => resolve29(code ?? 0));
|
|
33615
34600
|
child.on("error", (err) => {
|
|
33616
34601
|
process.stderr.write(`${err.message}
|
|
33617
34602
|
`);
|
|
33618
|
-
|
|
34603
|
+
resolve29(1);
|
|
33619
34604
|
});
|
|
33620
34605
|
});
|
|
33621
34606
|
}
|
|
@@ -33686,12 +34671,12 @@ function createProgram() {
|
|
|
33686
34671
|
init_config();
|
|
33687
34672
|
init_package_root();
|
|
33688
34673
|
import { existsSync as existsSync12 } from "node:fs";
|
|
33689
|
-
import { mkdir as mkdir10, readFile as
|
|
33690
|
-
import { dirname as
|
|
34674
|
+
import { mkdir as mkdir10, readFile as readFile21, rename as rename3, rmdir as rmdir2, unlink } from "node:fs/promises";
|
|
34675
|
+
import { dirname as dirname18, join as join28 } from "node:path";
|
|
33691
34676
|
var PACKAGE_NAME3 = "@contentful/experience-design-system-cli";
|
|
33692
34677
|
async function readJson(path5) {
|
|
33693
34678
|
try {
|
|
33694
|
-
return JSON.parse(await
|
|
34679
|
+
return JSON.parse(await readFile21(path5, "utf8"));
|
|
33695
34680
|
} catch {
|
|
33696
34681
|
return void 0;
|
|
33697
34682
|
}
|
|
@@ -33713,7 +34698,7 @@ async function migrateOldConfig() {
|
|
|
33713
34698
|
if (Object.keys(migrated).length > 0) await updateSettings2({ ...migrated, ...await readSettings2() });
|
|
33714
34699
|
if (existsSync12(oldRuns)) {
|
|
33715
34700
|
if (!existsSync12(runsFilePath2())) {
|
|
33716
|
-
await mkdir10(
|
|
34701
|
+
await mkdir10(dirname18(runsFilePath2()), { recursive: true });
|
|
33717
34702
|
await rename3(oldRuns, runsFilePath2());
|
|
33718
34703
|
} else {
|
|
33719
34704
|
await unlink(oldRuns);
|