@contentful/experience-design-system-cli 2.37.1-dev-build-7e007460.0 → 2.37.1-dev-build-230b645f.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 +14 -19
- package/dist/index.js +14 -19
- package/dist/package.json +1 -1
- package/dist/src/tui/import/steps/00-preflight/logic.d.ts +2 -4
- package/dist/src/tui/import/steps/06-extraction/logic.d.ts +1 -3
- package/dist/src/tui/import/steps/06-extraction/types.d.ts +2 -5
- package/package.json +3 -3
- package/dist/src/tui/import/steps/05-token-reuse/logic.d.ts +0 -15
package/dist/app.js
CHANGED
|
@@ -17350,7 +17350,7 @@ function initialProgress(input) {
|
|
|
17350
17350
|
composition: "resolving",
|
|
17351
17351
|
selection: "running",
|
|
17352
17352
|
existingEntities: input.hasCredentials ? "running" : "idle",
|
|
17353
|
-
tokens: input.hasRawTokens ?
|
|
17353
|
+
tokens: input.hasRawTokens ? "running" : "idle"
|
|
17354
17354
|
};
|
|
17355
17355
|
}
|
|
17356
17356
|
function applyProgressEvent(progress, event) {
|
|
@@ -17582,8 +17582,7 @@ async function runExtraction(input, onProgress, deps = realDeps) {
|
|
|
17582
17582
|
const outDir = input.outDir ?? join18(resolve22(input.projectPath), ".contentful");
|
|
17583
17583
|
let progress = initialProgress({
|
|
17584
17584
|
hasCredentials: input.credentials !== null,
|
|
17585
|
-
hasRawTokens: input.rawTokensPath !== ""
|
|
17586
|
-
reuseTokens: input.tokenStrategy === "reuse"
|
|
17585
|
+
hasRawTokens: input.rawTokensPath !== ""
|
|
17587
17586
|
});
|
|
17588
17587
|
const update = (change) => {
|
|
17589
17588
|
progress = { ...progress, ...change };
|
|
@@ -17600,15 +17599,14 @@ async function runExtraction(input, onProgress, deps = realDeps) {
|
|
|
17600
17599
|
} catch (error) {
|
|
17601
17600
|
return fail("selection agent", errorMessage2(error));
|
|
17602
17601
|
}
|
|
17603
|
-
const tokenGeneration = input.rawTokensPath !== ""
|
|
17602
|
+
const tokenGeneration = input.rawTokensPath !== "" ? deps.runGenerateTokensSession({
|
|
17604
17603
|
rawTokensPath: input.rawTokensPath,
|
|
17605
17604
|
outDir,
|
|
17606
17605
|
agent: input.agent,
|
|
17607
17606
|
...input.agentModel ? { agentModel: input.agentModel } : {},
|
|
17608
17607
|
promptOverrides: input.promptOverrides,
|
|
17609
17608
|
skillPath: TOKENS_SKILL_PATH,
|
|
17610
|
-
|
|
17611
|
-
noCache: input.noCache || input.tokenStrategy === "regenerate"
|
|
17609
|
+
noCache: input.noCache
|
|
17612
17610
|
}).then((result) => {
|
|
17613
17611
|
update({ tokens: "complete" });
|
|
17614
17612
|
return {
|
|
@@ -17670,11 +17668,11 @@ async function runExtraction(input, onProgress, deps = realDeps) {
|
|
|
17670
17668
|
if (selectionError) return fail("selection agent", errorMessage2(selectionError));
|
|
17671
17669
|
const tokens = await tokenGeneration;
|
|
17672
17670
|
if (tokens && !tokens.ok) return fail(tokens.step, tokens.message);
|
|
17673
|
-
const hasTokenSource = input.rawTokensPath !== "" || input.tokenStrategy === "reuse";
|
|
17674
17671
|
const extraction = {
|
|
17675
17672
|
sessionId: extracted.sessionId,
|
|
17676
17673
|
outDir,
|
|
17677
|
-
|
|
17674
|
+
// With no raw tokens file nothing is generated, and the later steps read an empty path as "no tokens".
|
|
17675
|
+
tokensPath: tokens?.ok ? tokens.tokensPath : "",
|
|
17678
17676
|
tokenSessionId: tokens?.ok ? tokens.tokenSessionId : null,
|
|
17679
17677
|
tokenCount: tokens?.ok ? tokens.tokenCount : 0,
|
|
17680
17678
|
existingEntitiesPath,
|
|
@@ -17724,8 +17722,7 @@ function useExtraction(input) {
|
|
|
17724
17722
|
status: "running",
|
|
17725
17723
|
progress: initialProgress({
|
|
17726
17724
|
hasCredentials: input.credentials !== null,
|
|
17727
|
-
hasRawTokens: input.rawTokensPath !== ""
|
|
17728
|
-
reuseTokens: input.tokenStrategy === "reuse"
|
|
17725
|
+
hasRawTokens: input.rawTokensPath !== ""
|
|
17729
17726
|
})
|
|
17730
17727
|
});
|
|
17731
17728
|
void runExtraction(input, (progress) => {
|
|
@@ -29634,9 +29631,9 @@ function App({ importOptions, inkClear }) {
|
|
|
29634
29631
|
...importOptions
|
|
29635
29632
|
};
|
|
29636
29633
|
if (target === "tokens") await startTokensOnly(launch, result);
|
|
29637
|
-
else await startExtraction(launch,
|
|
29634
|
+
else await startExtraction(launch, result);
|
|
29638
29635
|
};
|
|
29639
|
-
const prepareRun = async (launch,
|
|
29636
|
+
const prepareRun = async (launch, credentials) => {
|
|
29640
29637
|
const settings = await readSettings2();
|
|
29641
29638
|
const { agent, agentModel } = resolveAgentChoice(launch.agent, settings);
|
|
29642
29639
|
const generatePromptPath = typeof settings.generatePromptPath === "string" ? settings.generatePromptPath : void 0;
|
|
@@ -29651,7 +29648,6 @@ function App({ importOptions, inkClear }) {
|
|
|
29651
29648
|
outDir,
|
|
29652
29649
|
filePaths: launch.filePaths ?? [],
|
|
29653
29650
|
rawTokensPath: launch.tokens ?? "",
|
|
29654
|
-
tokenStrategy,
|
|
29655
29651
|
credentials: credentials.skipped ? null : credentials.credentials,
|
|
29656
29652
|
agent,
|
|
29657
29653
|
...agentModel ? { agentModel } : {},
|
|
@@ -29660,18 +29656,17 @@ function App({ importOptions, inkClear }) {
|
|
|
29660
29656
|
}
|
|
29661
29657
|
};
|
|
29662
29658
|
};
|
|
29663
|
-
const startExtraction = async (launch,
|
|
29664
|
-
const run = await prepareRun(launch,
|
|
29659
|
+
const startExtraction = async (launch, credentials) => {
|
|
29660
|
+
const run = await prepareRun(launch, credentials);
|
|
29665
29661
|
setExtractionRun({
|
|
29666
29662
|
...run.generatePromptPath ? { generatePromptPath: run.generatePromptPath } : {},
|
|
29667
29663
|
launch: run.launch,
|
|
29668
29664
|
credentialsSkipped: credentials.skipped,
|
|
29669
|
-
tokenStrategy,
|
|
29670
29665
|
input: run.input
|
|
29671
29666
|
});
|
|
29672
29667
|
};
|
|
29673
29668
|
const startTokensOnly = async (launch, credentials) => {
|
|
29674
|
-
const { input, outDir } = await prepareRun(launch,
|
|
29669
|
+
const { input, outDir } = await prepareRun(launch, credentials);
|
|
29675
29670
|
setTokensOnlyRun({
|
|
29676
29671
|
credentialsSkipped: credentials.skipped,
|
|
29677
29672
|
input,
|
|
@@ -29725,7 +29720,7 @@ function App({ importOptions, inkClear }) {
|
|
|
29725
29720
|
}, [scopeFlow, scopeRun, generationInput]);
|
|
29726
29721
|
useEffect28(() => {
|
|
29727
29722
|
if (!scopeRun || generation?.status !== "done" || !generation.result.ok) return;
|
|
29728
|
-
const { credentialsSkipped,
|
|
29723
|
+
const { credentialsSkipped, extraction: produced, input, generatePromptPath } = scopeRun;
|
|
29729
29724
|
inkClear();
|
|
29730
29725
|
setScopeRun(void 0);
|
|
29731
29726
|
setGenerationInput(void 0);
|
|
@@ -29735,7 +29730,7 @@ function App({ importOptions, inkClear }) {
|
|
|
29735
29730
|
saved: importDefaults?.credentials,
|
|
29736
29731
|
handoff: {
|
|
29737
29732
|
credentialsSkipped,
|
|
29738
|
-
tokens: { strategy:
|
|
29733
|
+
tokens: { strategy: "generate" },
|
|
29739
29734
|
extraction: produced,
|
|
29740
29735
|
generation: generation.result.generation
|
|
29741
29736
|
},
|
package/dist/index.js
CHANGED
|
@@ -19698,7 +19698,7 @@ function initialProgress(input) {
|
|
|
19698
19698
|
composition: "resolving",
|
|
19699
19699
|
selection: "running",
|
|
19700
19700
|
existingEntities: input.hasCredentials ? "running" : "idle",
|
|
19701
|
-
tokens: input.hasRawTokens ?
|
|
19701
|
+
tokens: input.hasRawTokens ? "running" : "idle"
|
|
19702
19702
|
};
|
|
19703
19703
|
}
|
|
19704
19704
|
function applyProgressEvent(progress, event) {
|
|
@@ -19951,8 +19951,7 @@ async function runExtraction(input, onProgress, deps = realDeps) {
|
|
|
19951
19951
|
const outDir = input.outDir ?? join19(resolve22(input.projectPath), ".contentful");
|
|
19952
19952
|
let progress = initialProgress({
|
|
19953
19953
|
hasCredentials: input.credentials !== null,
|
|
19954
|
-
hasRawTokens: input.rawTokensPath !== ""
|
|
19955
|
-
reuseTokens: input.tokenStrategy === "reuse"
|
|
19954
|
+
hasRawTokens: input.rawTokensPath !== ""
|
|
19956
19955
|
});
|
|
19957
19956
|
const update = (change) => {
|
|
19958
19957
|
progress = { ...progress, ...change };
|
|
@@ -19969,15 +19968,14 @@ async function runExtraction(input, onProgress, deps = realDeps) {
|
|
|
19969
19968
|
} catch (error) {
|
|
19970
19969
|
return fail("selection agent", errorMessage2(error));
|
|
19971
19970
|
}
|
|
19972
|
-
const tokenGeneration = input.rawTokensPath !== ""
|
|
19971
|
+
const tokenGeneration = input.rawTokensPath !== "" ? deps.runGenerateTokensSession({
|
|
19973
19972
|
rawTokensPath: input.rawTokensPath,
|
|
19974
19973
|
outDir,
|
|
19975
19974
|
agent: input.agent,
|
|
19976
19975
|
...input.agentModel ? { agentModel: input.agentModel } : {},
|
|
19977
19976
|
promptOverrides: input.promptOverrides,
|
|
19978
19977
|
skillPath: TOKENS_SKILL_PATH,
|
|
19979
|
-
|
|
19980
|
-
noCache: input.noCache || input.tokenStrategy === "regenerate"
|
|
19978
|
+
noCache: input.noCache
|
|
19981
19979
|
}).then((result) => {
|
|
19982
19980
|
update({ tokens: "complete" });
|
|
19983
19981
|
return {
|
|
@@ -20039,11 +20037,11 @@ async function runExtraction(input, onProgress, deps = realDeps) {
|
|
|
20039
20037
|
if (selectionError) return fail("selection agent", errorMessage2(selectionError));
|
|
20040
20038
|
const tokens = await tokenGeneration;
|
|
20041
20039
|
if (tokens && !tokens.ok) return fail(tokens.step, tokens.message);
|
|
20042
|
-
const hasTokenSource = input.rawTokensPath !== "" || input.tokenStrategy === "reuse";
|
|
20043
20040
|
const extraction = {
|
|
20044
20041
|
sessionId: extracted.sessionId,
|
|
20045
20042
|
outDir,
|
|
20046
|
-
|
|
20043
|
+
// With no raw tokens file nothing is generated, and the later steps read an empty path as "no tokens".
|
|
20044
|
+
tokensPath: tokens?.ok ? tokens.tokensPath : "",
|
|
20047
20045
|
tokenSessionId: tokens?.ok ? tokens.tokenSessionId : null,
|
|
20048
20046
|
tokenCount: tokens?.ok ? tokens.tokenCount : 0,
|
|
20049
20047
|
existingEntitiesPath,
|
|
@@ -20114,8 +20112,7 @@ function useExtraction(input) {
|
|
|
20114
20112
|
status: "running",
|
|
20115
20113
|
progress: initialProgress({
|
|
20116
20114
|
hasCredentials: input.credentials !== null,
|
|
20117
|
-
hasRawTokens: input.rawTokensPath !== ""
|
|
20118
|
-
reuseTokens: input.tokenStrategy === "reuse"
|
|
20115
|
+
hasRawTokens: input.rawTokensPath !== ""
|
|
20119
20116
|
})
|
|
20120
20117
|
});
|
|
20121
20118
|
void runExtraction(input, (progress) => {
|
|
@@ -33266,9 +33263,9 @@ function App({ importOptions, inkClear }) {
|
|
|
33266
33263
|
...importOptions
|
|
33267
33264
|
};
|
|
33268
33265
|
if (target === "tokens") await startTokensOnly(launch, result);
|
|
33269
|
-
else await startExtraction(launch,
|
|
33266
|
+
else await startExtraction(launch, result);
|
|
33270
33267
|
};
|
|
33271
|
-
const prepareRun = async (launch,
|
|
33268
|
+
const prepareRun = async (launch, credentials) => {
|
|
33272
33269
|
const settings = await readSettings2();
|
|
33273
33270
|
const { agent, agentModel } = resolveAgentChoice(launch.agent, settings);
|
|
33274
33271
|
const generatePromptPath = typeof settings.generatePromptPath === "string" ? settings.generatePromptPath : void 0;
|
|
@@ -33283,7 +33280,6 @@ function App({ importOptions, inkClear }) {
|
|
|
33283
33280
|
outDir,
|
|
33284
33281
|
filePaths: launch.filePaths ?? [],
|
|
33285
33282
|
rawTokensPath: launch.tokens ?? "",
|
|
33286
|
-
tokenStrategy,
|
|
33287
33283
|
credentials: credentials.skipped ? null : credentials.credentials,
|
|
33288
33284
|
agent,
|
|
33289
33285
|
...agentModel ? { agentModel } : {},
|
|
@@ -33292,18 +33288,17 @@ function App({ importOptions, inkClear }) {
|
|
|
33292
33288
|
}
|
|
33293
33289
|
};
|
|
33294
33290
|
};
|
|
33295
|
-
const startExtraction = async (launch,
|
|
33296
|
-
const run = await prepareRun(launch,
|
|
33291
|
+
const startExtraction = async (launch, credentials) => {
|
|
33292
|
+
const run = await prepareRun(launch, credentials);
|
|
33297
33293
|
setExtractionRun({
|
|
33298
33294
|
...run.generatePromptPath ? { generatePromptPath: run.generatePromptPath } : {},
|
|
33299
33295
|
launch: run.launch,
|
|
33300
33296
|
credentialsSkipped: credentials.skipped,
|
|
33301
|
-
tokenStrategy,
|
|
33302
33297
|
input: run.input
|
|
33303
33298
|
});
|
|
33304
33299
|
};
|
|
33305
33300
|
const startTokensOnly = async (launch, credentials) => {
|
|
33306
|
-
const { input, outDir } = await prepareRun(launch,
|
|
33301
|
+
const { input, outDir } = await prepareRun(launch, credentials);
|
|
33307
33302
|
setTokensOnlyRun({
|
|
33308
33303
|
credentialsSkipped: credentials.skipped,
|
|
33309
33304
|
input,
|
|
@@ -33357,7 +33352,7 @@ function App({ importOptions, inkClear }) {
|
|
|
33357
33352
|
}, [scopeFlow, scopeRun, generationInput]);
|
|
33358
33353
|
useEffect28(() => {
|
|
33359
33354
|
if (!scopeRun || generation?.status !== "done" || !generation.result.ok) return;
|
|
33360
|
-
const { credentialsSkipped,
|
|
33355
|
+
const { credentialsSkipped, extraction: produced, input, generatePromptPath } = scopeRun;
|
|
33361
33356
|
inkClear();
|
|
33362
33357
|
setScopeRun(void 0);
|
|
33363
33358
|
setGenerationInput(void 0);
|
|
@@ -33367,7 +33362,7 @@ function App({ importOptions, inkClear }) {
|
|
|
33367
33362
|
saved: importDefaults?.credentials,
|
|
33368
33363
|
handoff: {
|
|
33369
33364
|
credentialsSkipped,
|
|
33370
|
-
tokens: { strategy:
|
|
33365
|
+
tokens: { strategy: "generate" },
|
|
33371
33366
|
extraction: produced,
|
|
33372
33367
|
generation: generation.result.generation
|
|
33373
33368
|
},
|
package/dist/package.json
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
|
+
import type { OverviewStep } from '../../shared/index.js';
|
|
1
2
|
export type ImportTarget = 'both' | 'tokens' | 'components';
|
|
2
3
|
export declare const IMPORT_TARGET_OPTIONS: ReadonlyArray<{
|
|
3
4
|
target: ImportTarget;
|
|
4
5
|
label: string;
|
|
5
6
|
}>;
|
|
6
|
-
export declare const TOKENS_ONLY_OVERVIEW:
|
|
7
|
-
description: string;
|
|
8
|
-
ai: boolean;
|
|
9
|
-
}>;
|
|
7
|
+
export declare const TOKENS_ONLY_OVERVIEW: readonly OverviewStep[];
|
|
10
8
|
export declare const TOKENS_ONLY_STEP_COUNT: number;
|
|
11
9
|
export type ImportStepId = 'project' | 'token-file' | 'path-validation' | 'credentials' | 'component-extraction' | 'token-generation' | 'scope-gate' | 'generation' | 'review' | 'save-push';
|
|
12
10
|
export declare function stepsFor(target: ImportTarget): readonly ImportStepId[];
|
|
@@ -4,13 +4,11 @@ import type { ExtractionProgress } from './types.js';
|
|
|
4
4
|
export type ProgressEvent = ExtractAndComposeProgress;
|
|
5
5
|
/**
|
|
6
6
|
* Every job the stage will run starts on the first frame, so no row appears later as a surprise. A job that does not
|
|
7
|
-
* apply stays 'idle' and has no row: existing entities need credentials, token definitions need a raw tokens file
|
|
8
|
-
* reused tokens are already complete.
|
|
7
|
+
* apply stays 'idle' and has no row: existing entities need credentials, and token definitions need a raw tokens file.
|
|
9
8
|
*/
|
|
10
9
|
export declare function initialProgress(input: {
|
|
11
10
|
hasCredentials: boolean;
|
|
12
11
|
hasRawTokens: boolean;
|
|
13
|
-
reuseTokens: boolean;
|
|
14
12
|
}): ExtractionProgress;
|
|
15
13
|
export declare function applyProgressEvent(progress: ExtractionProgress, event: ProgressEvent): ExtractionProgress;
|
|
16
14
|
/** The rows the screen shows, in the order the wizard showed them. Rows that do not apply are left out. */
|
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
import type { ExtractionHandoff
|
|
2
|
-
export type TokenStrategy = ImportHandoff['tokens']['strategy'];
|
|
1
|
+
import type { ExtractionHandoff } from '@contentful/experience-design-system-types/handoff';
|
|
3
2
|
export interface ExtractionInput {
|
|
4
3
|
projectPath: string;
|
|
5
4
|
/** Where the stage writes tokens.json and the other files. Defaults to `<projectPath>/.contentful`. */
|
|
6
5
|
outDir?: string;
|
|
7
6
|
/** Absolute source files from the path-validation step (collectFiles output). */
|
|
8
7
|
filePaths: string[];
|
|
9
|
-
/** Raw tokens file the user pointed at
|
|
8
|
+
/** Raw tokens file the user pointed at. Empty when the import does not generate tokens (components only). */
|
|
10
9
|
rawTokensPath: string;
|
|
11
|
-
/** From the token reuse step. 'reuse' skips token generation entirely. */
|
|
12
|
-
tokenStrategy: TokenStrategy;
|
|
13
10
|
/** Null when the user skipped credentials: no existing-entities fetch happens. */
|
|
14
11
|
credentials: {
|
|
15
12
|
spaceId: string;
|
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-230b645f.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-types": "2.37.1-dev-build-230b645f.0",
|
|
49
|
+
"@contentful/experience-design-system-backend-pipeline": "2.37.1-dev-build-230b645f.0"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@tsconfig/node24": "^24.0.4",
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export type { TokenStrategy } from '../06-extraction/types.js';
|
|
2
|
-
export type TokensState = {
|
|
3
|
-
kind: 'none';
|
|
4
|
-
} | {
|
|
5
|
-
kind: 'cached';
|
|
6
|
-
tokensPath: string;
|
|
7
|
-
sourceChanged: boolean;
|
|
8
|
-
};
|
|
9
|
-
interface InspectInput {
|
|
10
|
-
rawTokensPath: string;
|
|
11
|
-
/** The `.contentful` folder: the sessions' `dsi-import` folders sit inside it, and an older `tokens.json` may sit in it. */
|
|
12
|
-
contentfulDir: string;
|
|
13
|
-
cache: boolean;
|
|
14
|
-
}
|
|
15
|
-
export declare function inspectTokens({ rawTokensPath, contentfulDir, cache }: InspectInput): Promise<TokensState>;
|