@contentful/experience-design-system-cli 2.37.1-dev-build-f18643c3.0 → 2.37.1-dev-build-af058351.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 +35 -21
- package/dist/index.js +37 -22
- package/dist/package.json +1 -1
- package/dist/src/tui/import/steps/07-scope-gate/cache-check.d.ts +0 -7
- package/dist/src/tui/import/steps/08-generation/logic.d.ts +0 -4
- package/dist/src/tui/import/steps/08-generation/run.d.ts +0 -10
- package/legacy/package.json +1 -1
- package/package.json +3 -3
package/dist/app.js
CHANGED
|
@@ -2018,7 +2018,7 @@ var init_cache_keys = __esm({
|
|
|
2018
2018
|
|
|
2019
2019
|
// packages/experience-design-system-cli/app.tsx
|
|
2020
2020
|
import { join as join25 } from "node:path";
|
|
2021
|
-
import { useEffect as
|
|
2021
|
+
import { useEffect as useEffect27, useState as useState33 } from "react";
|
|
2022
2022
|
|
|
2023
2023
|
// packages/experience-design-system-cli/src/tui/home/home.tsx
|
|
2024
2024
|
import { useEffect as useEffect2, useState as useState2 } from "react";
|
|
@@ -14772,7 +14772,7 @@ async function runMapTokens(request) {
|
|
|
14772
14772
|
}
|
|
14773
14773
|
const agent = request.agent;
|
|
14774
14774
|
const noCache = request.cache === false || process.env["EDS_NO_CACHE"] === "1";
|
|
14775
|
-
const promptHash = await hashPromptForSkill("map-tokens", agent, request.model,
|
|
14775
|
+
const promptHash = await hashPromptForSkill("map-tokens", agent, request.model, request.skillPathOverride, request.existingEntitiesInline ? [hashContent(request.existingEntitiesInline)] : [], request.skillContentOverride);
|
|
14776
14776
|
const inputHash = computeMapTokensInputHash(db, sessionId, componentSourceRefs);
|
|
14777
14777
|
if (!noCache) {
|
|
14778
14778
|
const cached = lookupCache(db, inputHash, "token_mapping", "__map_tokens__", promptHash);
|
|
@@ -16482,11 +16482,12 @@ async function checkGenerateComponentsCache(request) {
|
|
|
16482
16482
|
var DEFAULT_COMPONENT_CONCURRENCY = Number(process.env["EDS_GENERATE_CONCURRENCY"] ?? 10);
|
|
16483
16483
|
async function runGenerateComponentsSession(request) {
|
|
16484
16484
|
const prompt = await resolveGeneratePrompt(request.promptOverrides);
|
|
16485
|
+
const effectiveSkillPath = prompt.path ?? request.skillPath;
|
|
16485
16486
|
const existingEntities = await readExistingEntities(request);
|
|
16486
16487
|
const existingTokensInline = existingEntities ? JSON.stringify(summarizeForMapTokens({ entities: existingEntities })) : void 0;
|
|
16487
16488
|
const existingTokensHash = existingTokensInline ? [hashContent(existingTokensInline)] : [];
|
|
16488
16489
|
const agent = request.agent;
|
|
16489
|
-
const promptHash = await hashPromptForSkill("components", agent, request.agentModel,
|
|
16490
|
+
const promptHash = await hashPromptForSkill("components", agent, request.agentModel, effectiveSkillPath, existingTokensHash, prompt.text);
|
|
16490
16491
|
const db = openPipelineDb();
|
|
16491
16492
|
try {
|
|
16492
16493
|
const acceptedNames = await loadAcceptedNames(request.sessionId);
|
|
@@ -16513,7 +16514,7 @@ async function runGenerateComponentsSession(request) {
|
|
|
16513
16514
|
tokenMapInline: request.tokenMapInline,
|
|
16514
16515
|
verbose: request.verbose ?? false,
|
|
16515
16516
|
noCache: request.noCache,
|
|
16516
|
-
skillPathOverride:
|
|
16517
|
+
skillPathOverride: effectiveSkillPath,
|
|
16517
16518
|
skillContentOverride: prompt.text,
|
|
16518
16519
|
promptHash,
|
|
16519
16520
|
existingContentfulEntities: existingEntities,
|
|
@@ -20413,6 +20414,8 @@ async function saveDecisions(input) {
|
|
|
20413
20414
|
}
|
|
20414
20415
|
|
|
20415
20416
|
// packages/experience-design-system-cli/src/tui/import/steps/08-generation/run.ts
|
|
20417
|
+
var COMPONENTS_SKILL_PATH = findSkillPath("generate-components.md");
|
|
20418
|
+
var MAP_TOKENS_SKILL_PATH = findSkillPath("map-tokens.md");
|
|
20416
20419
|
var realDeps3 = {
|
|
20417
20420
|
checkAgentAuth,
|
|
20418
20421
|
saveDecisions,
|
|
@@ -20447,6 +20450,7 @@ async function runGeneration(input, onProgress, deps = realDeps3) {
|
|
|
20447
20450
|
agent: input.agent,
|
|
20448
20451
|
...input.agentModel ? { agentModel: input.agentModel } : {},
|
|
20449
20452
|
promptOverrides: appendGeneratePromptOverride(input),
|
|
20453
|
+
skillPath: COMPONENTS_SKILL_PATH,
|
|
20450
20454
|
noCache: input.noCache,
|
|
20451
20455
|
existingEntitiesPath: input.existingEntitiesPath,
|
|
20452
20456
|
precomputedCachedNames: new Set(handedOverNames),
|
|
@@ -20476,6 +20480,7 @@ async function runGeneration(input, onProgress, deps = realDeps3) {
|
|
|
20476
20480
|
agent: input.agent,
|
|
20477
20481
|
...input.agentModel ? { model: input.agentModel } : {},
|
|
20478
20482
|
cache: !input.noCache,
|
|
20483
|
+
skillPathOverride: MAP_TOKENS_SKILL_PATH,
|
|
20479
20484
|
...mapTokensOptions
|
|
20480
20485
|
});
|
|
20481
20486
|
} catch (error) {
|
|
@@ -20484,6 +20489,7 @@ async function runGeneration(input, onProgress, deps = realDeps3) {
|
|
|
20484
20489
|
}
|
|
20485
20490
|
}
|
|
20486
20491
|
update({ mapTokens: "complete" });
|
|
20492
|
+
await new Promise((r) => setImmediate(r));
|
|
20487
20493
|
const generatedCount = generated.results.filter((r) => !r.failed).length;
|
|
20488
20494
|
return {
|
|
20489
20495
|
ok: true,
|
|
@@ -20578,6 +20584,7 @@ function buildFlowStart(input) {
|
|
|
20578
20584
|
}
|
|
20579
20585
|
|
|
20580
20586
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/flow/screen.tsx
|
|
20587
|
+
import { useEffect as useEffect20, useRef as useRef12 } from "react";
|
|
20581
20588
|
import { Box as Box41 } from "ink";
|
|
20582
20589
|
|
|
20583
20590
|
// packages/experience-design-system-types/dist/src/cdf/validate.js
|
|
@@ -26982,6 +26989,13 @@ function FlowScreen({
|
|
|
26982
26989
|
}) {
|
|
26983
26990
|
const totalSteps = totalStepsFor(state);
|
|
26984
26991
|
const quit = () => onExit(0);
|
|
26992
|
+
const previousStep = useRef12(state.step);
|
|
26993
|
+
useEffect20(() => {
|
|
26994
|
+
if (previousStep.current !== state.step) {
|
|
26995
|
+
process.stdout.write("\x1B[2J\x1B[H");
|
|
26996
|
+
previousStep.current = state.step;
|
|
26997
|
+
}
|
|
26998
|
+
}, [state.step]);
|
|
26985
26999
|
const content = (() => {
|
|
26986
27000
|
switch (state.step) {
|
|
26987
27001
|
case "final-review":
|
|
@@ -27107,7 +27121,7 @@ function FlowScreen({
|
|
|
27107
27121
|
}
|
|
27108
27122
|
|
|
27109
27123
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/flow/use-flow.ts
|
|
27110
|
-
import { useEffect as
|
|
27124
|
+
import { useEffect as useEffect21, useRef as useRef13, useSyncExternalStore } from "react";
|
|
27111
27125
|
|
|
27112
27126
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/flow/controller.ts
|
|
27113
27127
|
import { appendFileSync, writeFileSync } from "node:fs";
|
|
@@ -27835,7 +27849,7 @@ function createFlowController(start, deps) {
|
|
|
27835
27849
|
|
|
27836
27850
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/flow/use-flow.ts
|
|
27837
27851
|
function useFlow(start, deps = realFlowDeps) {
|
|
27838
|
-
const controller =
|
|
27852
|
+
const controller = useRef13();
|
|
27839
27853
|
if (start && !controller.current) {
|
|
27840
27854
|
try {
|
|
27841
27855
|
startWizardLog();
|
|
@@ -27848,14 +27862,14 @@ function useFlow(start, deps = realFlowDeps) {
|
|
|
27848
27862
|
(listener) => current?.subscribe(listener) ?? (() => void 0),
|
|
27849
27863
|
() => current?.getState()
|
|
27850
27864
|
);
|
|
27851
|
-
|
|
27865
|
+
useEffect21(() => {
|
|
27852
27866
|
if (!start) controller.current = void 0;
|
|
27853
27867
|
}, [start]);
|
|
27854
27868
|
return current && state ? { controller: current, state } : void 0;
|
|
27855
27869
|
}
|
|
27856
27870
|
|
|
27857
27871
|
// packages/experience-design-system-cli/src/tui/help/PageContainer.tsx
|
|
27858
|
-
import { useEffect as
|
|
27872
|
+
import { useEffect as useEffect22, useState as useState27 } from "react";
|
|
27859
27873
|
import { Box as Box42, Text as Text44, useInput as useInput9 } from "ink";
|
|
27860
27874
|
|
|
27861
27875
|
// packages/experience-design-system-cli/src/tui/debug-store.ts
|
|
@@ -28049,7 +28063,7 @@ function Section({ title, rows }) {
|
|
|
28049
28063
|
}
|
|
28050
28064
|
function HelpScreen({ onDone }) {
|
|
28051
28065
|
const [info, setInfo] = useState27();
|
|
28052
|
-
|
|
28066
|
+
useEffect22(() => {
|
|
28053
28067
|
startDebugRun({ flow: "help", step: "01-help", menuOption: "Help", inputs: {} });
|
|
28054
28068
|
void readHelpInfo().then(setInfo);
|
|
28055
28069
|
}, []);
|
|
@@ -28142,7 +28156,7 @@ function SettingsScreen({
|
|
|
28142
28156
|
}
|
|
28143
28157
|
|
|
28144
28158
|
// packages/experience-design-system-cli/src/tui/settings/contentful-configuration/ContentfulConfigScreen.tsx
|
|
28145
|
-
import { useEffect as
|
|
28159
|
+
import { useEffect as useEffect23, useState as useState29 } from "react";
|
|
28146
28160
|
import { Box as Box44, Text as Text46, useInput as useInput11 } from "ink";
|
|
28147
28161
|
import TextInput4 from "ink-text-input";
|
|
28148
28162
|
|
|
@@ -28210,7 +28224,7 @@ function ConfigurationScreen({ onDone }) {
|
|
|
28210
28224
|
const [lastSaved, setLastSaved] = useState29(null);
|
|
28211
28225
|
const [editing, setEditing] = useState29(false);
|
|
28212
28226
|
const [valueBeforeEdit, setValueBeforeEdit] = useState29("");
|
|
28213
|
-
|
|
28227
|
+
useEffect23(() => {
|
|
28214
28228
|
readCredentials().then((cfg) => {
|
|
28215
28229
|
setConfig(cfg);
|
|
28216
28230
|
setStage("form");
|
|
@@ -28347,7 +28361,7 @@ function ConfigurationScreen({ onDone }) {
|
|
|
28347
28361
|
}
|
|
28348
28362
|
|
|
28349
28363
|
// packages/experience-design-system-cli/src/tui/settings/opt-in-analytics/screen.tsx
|
|
28350
|
-
import { useEffect as
|
|
28364
|
+
import { useEffect as useEffect24, useState as useState30 } from "react";
|
|
28351
28365
|
import { Box as Box45, Text as Text47, useInput as useInput12 } from "ink";
|
|
28352
28366
|
|
|
28353
28367
|
// packages/experience-design-system-cli/src/tui/settings/opt-in-analytics/analytics-store.ts
|
|
@@ -28370,7 +28384,7 @@ import { Fragment as Fragment18, jsx as jsx56, jsxs as jsxs46 } from "react/jsx-
|
|
|
28370
28384
|
function OptInAnalyticsScreen({ onDone }) {
|
|
28371
28385
|
const [loading, setLoading] = useState30(true);
|
|
28372
28386
|
const [enabled, setEnabled] = useState30(true);
|
|
28373
|
-
|
|
28387
|
+
useEffect24(() => {
|
|
28374
28388
|
readAnalyticsSetting().then((setting) => {
|
|
28375
28389
|
setEnabled(setting.enabled);
|
|
28376
28390
|
setLoading(false);
|
|
@@ -28424,13 +28438,13 @@ function OptInAnalyticsScreen({ onDone }) {
|
|
|
28424
28438
|
}
|
|
28425
28439
|
|
|
28426
28440
|
// packages/experience-design-system-cli/src/tui/upgrade/PageContainer.tsx
|
|
28427
|
-
import { useEffect as
|
|
28441
|
+
import { useEffect as useEffect25, useState as useState31 } from "react";
|
|
28428
28442
|
import { Box as Box46, Text as Text48, useInput as useInput13 } from "ink";
|
|
28429
28443
|
import { jsx as jsx57, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
28430
28444
|
var UPGRADE_COMMANDS = ["git pull", "pnpm install", "pnpm build"];
|
|
28431
28445
|
function UpgradeScreen({ onDone }) {
|
|
28432
28446
|
const [upgradeCheck, setUpgradeCheck] = useState31();
|
|
28433
|
-
|
|
28447
|
+
useEffect25(() => {
|
|
28434
28448
|
startDebugRun({
|
|
28435
28449
|
flow: "upgrade",
|
|
28436
28450
|
step: "01-upgrade",
|
|
@@ -28495,13 +28509,13 @@ function renderBody(upgradeCheck) {
|
|
|
28495
28509
|
}
|
|
28496
28510
|
|
|
28497
28511
|
// packages/experience-design-system-cli/src/tui/settings/debug-mode/screen.tsx
|
|
28498
|
-
import { useEffect as
|
|
28512
|
+
import { useEffect as useEffect26, useState as useState32 } from "react";
|
|
28499
28513
|
import { Box as Box47, Text as Text49, useInput as useInput14 } from "ink";
|
|
28500
28514
|
import { jsx as jsx58, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
28501
28515
|
function DebugModeScreen({ onDone }) {
|
|
28502
28516
|
const [loading, setLoading] = useState32(true);
|
|
28503
28517
|
const [enabled, setEnabled] = useState32(true);
|
|
28504
|
-
|
|
28518
|
+
useEffect26(() => {
|
|
28505
28519
|
readDebugModeSetting().then((setting) => {
|
|
28506
28520
|
setEnabled(setting.enabled);
|
|
28507
28521
|
setLoading(false);
|
|
@@ -28581,7 +28595,7 @@ function App({ importOptions }) {
|
|
|
28581
28595
|
const [flowStart, setFlowStart] = useState33();
|
|
28582
28596
|
const flow = useFlow(flowStart);
|
|
28583
28597
|
const [importDefaults, setImportDefaults] = useState33();
|
|
28584
|
-
|
|
28598
|
+
useEffect27(() => {
|
|
28585
28599
|
if (screen !== "import") {
|
|
28586
28600
|
setImportDefaults(void 0);
|
|
28587
28601
|
return;
|
|
@@ -28639,12 +28653,12 @@ function App({ importOptions }) {
|
|
|
28639
28653
|
}
|
|
28640
28654
|
});
|
|
28641
28655
|
};
|
|
28642
|
-
|
|
28656
|
+
useEffect27(() => {
|
|
28643
28657
|
if (!extractionRun || extraction?.status !== "done" || !extraction.result.ok) return;
|
|
28644
28658
|
setExtractionRun(void 0);
|
|
28645
28659
|
setScopeRun({ ...extractionRun, extraction: extraction.result.extraction });
|
|
28646
28660
|
}, [extraction, extractionRun]);
|
|
28647
|
-
|
|
28661
|
+
useEffect27(() => {
|
|
28648
28662
|
if (!scopeRun || scopeFlow?.status !== "confirmed" || generationInput) return;
|
|
28649
28663
|
const { extraction: produced, input, generatePromptPath } = scopeRun;
|
|
28650
28664
|
setGenerationInput({
|
|
@@ -28662,7 +28676,7 @@ function App({ importOptions }) {
|
|
|
28662
28676
|
...generatePromptPath ? { generatePromptPath } : {}
|
|
28663
28677
|
});
|
|
28664
28678
|
}, [scopeFlow, scopeRun, generationInput]);
|
|
28665
|
-
|
|
28679
|
+
useEffect27(() => {
|
|
28666
28680
|
if (!scopeRun || generation?.status !== "done" || !generation.result.ok) return;
|
|
28667
28681
|
const { credentialsSkipped, tokenStrategy, extraction: produced, input, generatePromptPath } = scopeRun;
|
|
28668
28682
|
setScopeRun(void 0);
|
package/dist/index.js
CHANGED
|
@@ -16593,7 +16593,7 @@ async function runMapTokens(request) {
|
|
|
16593
16593
|
}
|
|
16594
16594
|
const agent = request.agent;
|
|
16595
16595
|
const noCache = request.cache === false || process.env["EDS_NO_CACHE"] === "1";
|
|
16596
|
-
const promptHash = await hashPromptForSkill("map-tokens", agent, request.model,
|
|
16596
|
+
const promptHash = await hashPromptForSkill("map-tokens", agent, request.model, request.skillPathOverride, request.existingEntitiesInline ? [hashContent(request.existingEntitiesInline)] : [], request.skillContentOverride);
|
|
16597
16597
|
const inputHash = computeMapTokensInputHash(db, sessionId, componentSourceRefs);
|
|
16598
16598
|
if (!noCache) {
|
|
16599
16599
|
const cached = lookupCache(db, inputHash, "token_mapping", "__map_tokens__", promptHash);
|
|
@@ -19491,11 +19491,12 @@ var init_check_generate_components_cache = __esm({
|
|
|
19491
19491
|
// packages/experience-design-system-backend-pipeline/dist/src/orchestrators/run-generate-components-session/run-generate-components-session.js
|
|
19492
19492
|
async function runGenerateComponentsSession(request) {
|
|
19493
19493
|
const prompt = await resolveGeneratePrompt(request.promptOverrides);
|
|
19494
|
+
const effectiveSkillPath = prompt.path ?? request.skillPath;
|
|
19494
19495
|
const existingEntities = await readExistingEntities(request);
|
|
19495
19496
|
const existingTokensInline = existingEntities ? JSON.stringify(summarizeForMapTokens({ entities: existingEntities })) : void 0;
|
|
19496
19497
|
const existingTokensHash = existingTokensInline ? [hashContent(existingTokensInline)] : [];
|
|
19497
19498
|
const agent = request.agent;
|
|
19498
|
-
const promptHash = await hashPromptForSkill("components", agent, request.agentModel,
|
|
19499
|
+
const promptHash = await hashPromptForSkill("components", agent, request.agentModel, effectiveSkillPath, existingTokensHash, prompt.text);
|
|
19499
19500
|
const db = openPipelineDb();
|
|
19500
19501
|
try {
|
|
19501
19502
|
const acceptedNames = await loadAcceptedNames(request.sessionId);
|
|
@@ -19522,7 +19523,7 @@ async function runGenerateComponentsSession(request) {
|
|
|
19522
19523
|
tokenMapInline: request.tokenMapInline,
|
|
19523
19524
|
verbose: request.verbose ?? false,
|
|
19524
19525
|
noCache: request.noCache,
|
|
19525
|
-
skillPathOverride:
|
|
19526
|
+
skillPathOverride: effectiveSkillPath,
|
|
19526
19527
|
skillContentOverride: prompt.text,
|
|
19527
19528
|
promptHash,
|
|
19528
19529
|
existingContentfulEntities: existingEntities,
|
|
@@ -24066,6 +24067,7 @@ async function runGeneration(input, onProgress, deps = realDeps3) {
|
|
|
24066
24067
|
agent: input.agent,
|
|
24067
24068
|
...input.agentModel ? { agentModel: input.agentModel } : {},
|
|
24068
24069
|
promptOverrides: appendGeneratePromptOverride(input),
|
|
24070
|
+
skillPath: COMPONENTS_SKILL_PATH,
|
|
24069
24071
|
noCache: input.noCache,
|
|
24070
24072
|
existingEntitiesPath: input.existingEntitiesPath,
|
|
24071
24073
|
precomputedCachedNames: new Set(handedOverNames),
|
|
@@ -24095,6 +24097,7 @@ async function runGeneration(input, onProgress, deps = realDeps3) {
|
|
|
24095
24097
|
agent: input.agent,
|
|
24096
24098
|
...input.agentModel ? { model: input.agentModel } : {},
|
|
24097
24099
|
cache: !input.noCache,
|
|
24100
|
+
skillPathOverride: MAP_TOKENS_SKILL_PATH,
|
|
24098
24101
|
...mapTokensOptions
|
|
24099
24102
|
});
|
|
24100
24103
|
} catch (error) {
|
|
@@ -24103,6 +24106,7 @@ async function runGeneration(input, onProgress, deps = realDeps3) {
|
|
|
24103
24106
|
}
|
|
24104
24107
|
}
|
|
24105
24108
|
update({ mapTokens: "complete" });
|
|
24109
|
+
await new Promise((r) => setImmediate(r));
|
|
24106
24110
|
const generatedCount = generated.results.filter((r) => !r.failed).length;
|
|
24107
24111
|
return {
|
|
24108
24112
|
ok: true,
|
|
@@ -24146,14 +24150,17 @@ function applyProgressEvent2(event, previous, total) {
|
|
|
24146
24150
|
}
|
|
24147
24151
|
return previous;
|
|
24148
24152
|
}
|
|
24149
|
-
var realDeps3, fail2, errorMessage3;
|
|
24153
|
+
var COMPONENTS_SKILL_PATH, MAP_TOKENS_SKILL_PATH, realDeps3, fail2, errorMessage3;
|
|
24150
24154
|
var init_run2 = __esm({
|
|
24151
24155
|
"packages/experience-design-system-cli/src/tui/import/steps/08-generation/run.ts"() {
|
|
24152
24156
|
"use strict";
|
|
24153
24157
|
init_src4();
|
|
24158
|
+
init_find_skill_path();
|
|
24154
24159
|
init_logic9();
|
|
24155
24160
|
init_map_tokens();
|
|
24156
24161
|
init_save_decisions();
|
|
24162
|
+
COMPONENTS_SKILL_PATH = findSkillPath("generate-components.md");
|
|
24163
|
+
MAP_TOKENS_SKILL_PATH = findSkillPath("map-tokens.md");
|
|
24157
24164
|
realDeps3 = {
|
|
24158
24165
|
checkAgentAuth,
|
|
24159
24166
|
saveDecisions,
|
|
@@ -31127,6 +31134,7 @@ var init_run_teaser = __esm({
|
|
|
31127
31134
|
});
|
|
31128
31135
|
|
|
31129
31136
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/flow/screen.tsx
|
|
31137
|
+
import { useEffect as useEffect20, useRef as useRef12 } from "react";
|
|
31130
31138
|
import { Box as Box41 } from "ink";
|
|
31131
31139
|
import { jsx as jsx52, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
31132
31140
|
function totalStepsFor(state) {
|
|
@@ -31146,6 +31154,13 @@ function FlowScreen({
|
|
|
31146
31154
|
}) {
|
|
31147
31155
|
const totalSteps = totalStepsFor(state);
|
|
31148
31156
|
const quit = () => onExit(0);
|
|
31157
|
+
const previousStep = useRef12(state.step);
|
|
31158
|
+
useEffect20(() => {
|
|
31159
|
+
if (previousStep.current !== state.step) {
|
|
31160
|
+
process.stdout.write("\x1B[2J\x1B[H");
|
|
31161
|
+
previousStep.current = state.step;
|
|
31162
|
+
}
|
|
31163
|
+
}, [state.step]);
|
|
31149
31164
|
const content = (() => {
|
|
31150
31165
|
switch (state.step) {
|
|
31151
31166
|
case "final-review":
|
|
@@ -32065,9 +32080,9 @@ var init_controller = __esm({
|
|
|
32065
32080
|
});
|
|
32066
32081
|
|
|
32067
32082
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/flow/use-flow.ts
|
|
32068
|
-
import { useEffect as
|
|
32083
|
+
import { useEffect as useEffect21, useRef as useRef13, useSyncExternalStore } from "react";
|
|
32069
32084
|
function useFlow(start, deps = realFlowDeps) {
|
|
32070
|
-
const controller =
|
|
32085
|
+
const controller = useRef13();
|
|
32071
32086
|
if (start && !controller.current) {
|
|
32072
32087
|
try {
|
|
32073
32088
|
startWizardLog();
|
|
@@ -32080,7 +32095,7 @@ function useFlow(start, deps = realFlowDeps) {
|
|
|
32080
32095
|
(listener) => current?.subscribe(listener) ?? (() => void 0),
|
|
32081
32096
|
() => current?.getState()
|
|
32082
32097
|
);
|
|
32083
|
-
|
|
32098
|
+
useEffect21(() => {
|
|
32084
32099
|
if (!start) controller.current = void 0;
|
|
32085
32100
|
}, [start]);
|
|
32086
32101
|
return current && state ? { controller: current, state } : void 0;
|
|
@@ -32293,7 +32308,7 @@ var init_help_info = __esm({
|
|
|
32293
32308
|
});
|
|
32294
32309
|
|
|
32295
32310
|
// packages/experience-design-system-cli/src/tui/help/PageContainer.tsx
|
|
32296
|
-
import { useEffect as
|
|
32311
|
+
import { useEffect as useEffect22, useState as useState27 } from "react";
|
|
32297
32312
|
import { Box as Box42, Text as Text44, useInput as useInput9 } from "ink";
|
|
32298
32313
|
import { Fragment as Fragment16, jsx as jsx53, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
32299
32314
|
function Section({ title, rows }) {
|
|
@@ -32307,7 +32322,7 @@ function Section({ title, rows }) {
|
|
|
32307
32322
|
}
|
|
32308
32323
|
function HelpScreen({ onDone }) {
|
|
32309
32324
|
const [info, setInfo] = useState27();
|
|
32310
|
-
|
|
32325
|
+
useEffect22(() => {
|
|
32311
32326
|
startDebugRun({ flow: "help", step: "01-help", menuOption: "Help", inputs: {} });
|
|
32312
32327
|
void readHelpInfo().then(setInfo);
|
|
32313
32328
|
}, []);
|
|
@@ -32456,7 +32471,7 @@ var init_config_store = __esm({
|
|
|
32456
32471
|
});
|
|
32457
32472
|
|
|
32458
32473
|
// packages/experience-design-system-cli/src/tui/settings/contentful-configuration/ContentfulConfigScreen.tsx
|
|
32459
|
-
import { useEffect as
|
|
32474
|
+
import { useEffect as useEffect23, useState as useState29 } from "react";
|
|
32460
32475
|
import { Box as Box44, Text as Text46, useInput as useInput11 } from "ink";
|
|
32461
32476
|
import TextInput4 from "ink-text-input";
|
|
32462
32477
|
import { Fragment as Fragment17, jsx as jsx55, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
@@ -32478,7 +32493,7 @@ function ConfigurationScreen({ onDone }) {
|
|
|
32478
32493
|
const [lastSaved, setLastSaved] = useState29(null);
|
|
32479
32494
|
const [editing, setEditing] = useState29(false);
|
|
32480
32495
|
const [valueBeforeEdit, setValueBeforeEdit] = useState29("");
|
|
32481
|
-
|
|
32496
|
+
useEffect23(() => {
|
|
32482
32497
|
readCredentials().then((cfg) => {
|
|
32483
32498
|
setConfig(cfg);
|
|
32484
32499
|
setStage("form");
|
|
@@ -32662,13 +32677,13 @@ var init_analytics_store = __esm({
|
|
|
32662
32677
|
});
|
|
32663
32678
|
|
|
32664
32679
|
// packages/experience-design-system-cli/src/tui/settings/opt-in-analytics/screen.tsx
|
|
32665
|
-
import { useEffect as
|
|
32680
|
+
import { useEffect as useEffect24, useState as useState30 } from "react";
|
|
32666
32681
|
import { Box as Box45, Text as Text47, useInput as useInput12 } from "ink";
|
|
32667
32682
|
import { Fragment as Fragment18, jsx as jsx56, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
32668
32683
|
function OptInAnalyticsScreen({ onDone }) {
|
|
32669
32684
|
const [loading, setLoading] = useState30(true);
|
|
32670
32685
|
const [enabled, setEnabled] = useState30(true);
|
|
32671
|
-
|
|
32686
|
+
useEffect24(() => {
|
|
32672
32687
|
readAnalyticsSetting().then((setting) => {
|
|
32673
32688
|
setEnabled(setting.enabled);
|
|
32674
32689
|
setLoading(false);
|
|
@@ -32731,12 +32746,12 @@ var init_screen11 = __esm({
|
|
|
32731
32746
|
});
|
|
32732
32747
|
|
|
32733
32748
|
// packages/experience-design-system-cli/src/tui/upgrade/PageContainer.tsx
|
|
32734
|
-
import { useEffect as
|
|
32749
|
+
import { useEffect as useEffect25, useState as useState31 } from "react";
|
|
32735
32750
|
import { Box as Box46, Text as Text48, useInput as useInput13 } from "ink";
|
|
32736
32751
|
import { jsx as jsx57, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
32737
32752
|
function UpgradeScreen({ onDone }) {
|
|
32738
32753
|
const [upgradeCheck, setUpgradeCheck] = useState31();
|
|
32739
|
-
|
|
32754
|
+
useEffect25(() => {
|
|
32740
32755
|
startDebugRun({
|
|
32741
32756
|
flow: "upgrade",
|
|
32742
32757
|
step: "01-upgrade",
|
|
@@ -32811,13 +32826,13 @@ var init_PageContainer4 = __esm({
|
|
|
32811
32826
|
});
|
|
32812
32827
|
|
|
32813
32828
|
// packages/experience-design-system-cli/src/tui/settings/debug-mode/screen.tsx
|
|
32814
|
-
import { useEffect as
|
|
32829
|
+
import { useEffect as useEffect26, useState as useState32 } from "react";
|
|
32815
32830
|
import { Box as Box47, Text as Text49, useInput as useInput14 } from "ink";
|
|
32816
32831
|
import { jsx as jsx58, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
32817
32832
|
function DebugModeScreen({ onDone }) {
|
|
32818
32833
|
const [loading, setLoading] = useState32(true);
|
|
32819
32834
|
const [enabled, setEnabled] = useState32(true);
|
|
32820
|
-
|
|
32835
|
+
useEffect26(() => {
|
|
32821
32836
|
readDebugModeSetting().then((setting) => {
|
|
32822
32837
|
setEnabled(setting.enabled);
|
|
32823
32838
|
setLoading(false);
|
|
@@ -32880,7 +32895,7 @@ __export(app_exports, {
|
|
|
32880
32895
|
runApp: () => runApp
|
|
32881
32896
|
});
|
|
32882
32897
|
import { join as join27 } from "node:path";
|
|
32883
|
-
import { useEffect as
|
|
32898
|
+
import { useEffect as useEffect27, useState as useState33 } from "react";
|
|
32884
32899
|
import { Fragment as Fragment19, jsx as jsx59 } from "react/jsx-runtime";
|
|
32885
32900
|
function App({ importOptions }) {
|
|
32886
32901
|
const [screen, setScreen] = useState33("start");
|
|
@@ -32912,7 +32927,7 @@ function App({ importOptions }) {
|
|
|
32912
32927
|
const [flowStart, setFlowStart] = useState33();
|
|
32913
32928
|
const flow = useFlow(flowStart);
|
|
32914
32929
|
const [importDefaults, setImportDefaults] = useState33();
|
|
32915
|
-
|
|
32930
|
+
useEffect27(() => {
|
|
32916
32931
|
if (screen !== "import") {
|
|
32917
32932
|
setImportDefaults(void 0);
|
|
32918
32933
|
return;
|
|
@@ -32970,12 +32985,12 @@ function App({ importOptions }) {
|
|
|
32970
32985
|
}
|
|
32971
32986
|
});
|
|
32972
32987
|
};
|
|
32973
|
-
|
|
32988
|
+
useEffect27(() => {
|
|
32974
32989
|
if (!extractionRun || extraction?.status !== "done" || !extraction.result.ok) return;
|
|
32975
32990
|
setExtractionRun(void 0);
|
|
32976
32991
|
setScopeRun({ ...extractionRun, extraction: extraction.result.extraction });
|
|
32977
32992
|
}, [extraction, extractionRun]);
|
|
32978
|
-
|
|
32993
|
+
useEffect27(() => {
|
|
32979
32994
|
if (!scopeRun || scopeFlow?.status !== "confirmed" || generationInput) return;
|
|
32980
32995
|
const { extraction: produced, input, generatePromptPath } = scopeRun;
|
|
32981
32996
|
setGenerationInput({
|
|
@@ -32993,7 +33008,7 @@ function App({ importOptions }) {
|
|
|
32993
33008
|
...generatePromptPath ? { generatePromptPath } : {}
|
|
32994
33009
|
});
|
|
32995
33010
|
}, [scopeFlow, scopeRun, generationInput]);
|
|
32996
|
-
|
|
33011
|
+
useEffect27(() => {
|
|
32997
33012
|
if (!scopeRun || generation?.status !== "done" || !generation.result.ok) return;
|
|
32998
33013
|
const { credentialsSkipped, tokenStrategy, extraction: produced, input, generatePromptPath } = scopeRun;
|
|
32999
33014
|
setScopeRun(void 0);
|
package/dist/package.json
CHANGED
|
@@ -7,11 +7,4 @@ export interface CacheCheckInput {
|
|
|
7
7
|
existingEntitiesPath: string | null;
|
|
8
8
|
noCache: boolean;
|
|
9
9
|
}
|
|
10
|
-
/**
|
|
11
|
-
* Runs the generation cache check in-process while the scope gate is open.
|
|
12
|
-
* Restores cached CDF entries into the pipeline database as a side-effect so
|
|
13
|
-
* the generate run that follows can skip them. A failed check is
|
|
14
|
-
* indistinguishable from "nothing cached", as in legacy. INTEG-5050 tracks
|
|
15
|
-
* surfacing it.
|
|
16
|
-
*/
|
|
17
10
|
export declare function checkGenerationCache(input: CacheCheckInput): Promise<string[]>;
|
|
@@ -1,22 +1,18 @@
|
|
|
1
1
|
import type { GenerationProgress } from './types.js';
|
|
2
2
|
export declare function initialProgress(): GenerationProgress;
|
|
3
|
-
/** Token mapping runs only when there is something to map and tokens to map it from. */
|
|
4
3
|
export declare function shouldRunMapTokens(counts: {
|
|
5
4
|
mappablePropCount: number;
|
|
6
5
|
rawTokenCount: number;
|
|
7
6
|
}): boolean;
|
|
8
|
-
/** "5 components accepted." or, with some left out, "5 components accepted, 2 excluded due to validation errors." */
|
|
9
7
|
export declare function formatAcceptanceSummary(counts: {
|
|
10
8
|
accepted: number;
|
|
11
9
|
autoRejected: number;
|
|
12
10
|
}): string;
|
|
13
|
-
/** The screen's description: what was accepted, what is happening to it, and whether the tokens are used. */
|
|
14
11
|
export declare function describeGeneration(input: {
|
|
15
12
|
acceptedCount: number;
|
|
16
13
|
agent: string;
|
|
17
14
|
hasTokens: boolean;
|
|
18
15
|
}): string;
|
|
19
|
-
/** The rows the generating screen shows for this progress. */
|
|
20
16
|
export declare function progressRows(progress: GenerationProgress, agent: string): Array<{
|
|
21
17
|
text: string;
|
|
22
18
|
complete: boolean;
|
|
@@ -9,14 +9,4 @@ export interface GenerationDeps {
|
|
|
9
9
|
runMapTokens: typeof runMapTokens;
|
|
10
10
|
prepareMapTokens: typeof prepareMapTokens;
|
|
11
11
|
}
|
|
12
|
-
/**
|
|
13
|
-
* The whole stage, in the order the wizard ran it:
|
|
14
|
-
* 1. Wait for the cache check that ran while the scope gate was open, then save the decisions. Both write to the
|
|
15
|
-
* pipeline database and the cache has to be restored first. With nothing accepted the stage ends here.
|
|
16
|
-
* 2. Generate the accepted components in-process. The orchestrator handles per-component cache lookup, so the names
|
|
17
|
-
* from the cache check are forwarded as `precomputedCachedNames` to skip a redundant lookup.
|
|
18
|
-
* 3. Map tokens onto the generated session. Skipped when there is nothing to map.
|
|
19
|
-
* A failed token mapping after a successful generation is an error to show. It neither retries nor throws away what was
|
|
20
|
-
* generated.
|
|
21
|
-
*/
|
|
22
12
|
export declare function runGeneration(input: GenerationInput, onProgress: (progress: GenerationProgress) => void, deps?: GenerationDeps): Promise<GenerationResult>;
|
package/legacy/package.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentful/experience-design-system-cli",
|
|
3
|
-
"version": "2.37.1-dev-build-
|
|
3
|
+
"version": "2.37.1-dev-build-af058351.0",
|
|
4
4
|
"description": "Contentful Experiences design system import CLI",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -45,8 +45,8 @@
|
|
|
45
45
|
"ts-morph": "^27.0.2",
|
|
46
46
|
"typescript": "^5.9.3",
|
|
47
47
|
"zod": "^4.6.5",
|
|
48
|
-
"@contentful/experience-design-system-
|
|
49
|
-
"@contentful/experience-design-system-
|
|
48
|
+
"@contentful/experience-design-system-backend-pipeline": "2.37.1-dev-build-af058351.0",
|
|
49
|
+
"@contentful/experience-design-system-types": "2.37.1-dev-build-af058351.0"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@tsconfig/node24": "^24.0.4",
|