@contentful/experience-design-system-cli 2.32.1-dev-build-b78fe18.0 → 2.32.1-dev-build-d28a6f8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/package.json +1 -1
- package/dist/src/helpers/build-contentful-management-client.d.ts +7 -0
- package/dist/src/helpers/fetch-and-persist-existing-contentful-entities.d.ts +29 -0
- package/dist/src/helpers/fetch-existing-contentful-entities.d.ts +11 -0
- package/dist/src/helpers/find-nearly-matching-component.d.ts +7 -0
- package/dist/src/helpers/read-existing-contentful-entities-from-session.d.ts +7 -0
- package/dist/src/helpers/summarize-existing-contentful-entities.d.ts +50 -0
- package/dist/src/import/orchestrator.d.ts +0 -1
- package/dist/src/import/tui/WizardApp.d.ts +3 -0
- package/dist/src/index.js +826 -445
- package/dist/src/session/cache-keys.d.ts +1 -1
- package/dist/src/session/core/cdf/server-type-map.d.ts +3 -0
- package/dist/src/session/core/components/component-id.d.ts +1 -0
- package/dist/src/session/core/components/input-hash.d.ts +5 -0
- package/dist/src/session/core/shared/group-by.d.ts +1 -0
- package/dist/src/session/core/tokens/input-hash.d.ts +1 -0
- package/dist/src/session/db.d.ts +9 -13
- package/dist/src/session/repositories/sessions/read.d.ts +11 -0
- package/dist/src/session/repositories/sessions/write.d.ts +3 -0
- package/dist/src/session/repositories/steps/read.d.ts +2 -0
- package/dist/src/session/repositories/steps/write.d.ts +5 -0
- package/dist/src/session/services/session-resolver.d.ts +21 -0
- package/package.json +6 -6
- package/skills/generate-components.md +27 -0
- package/skills/map-tokens.md +12 -0
- package/skills/select-components.md +11 -0
- package/dist/src/helpers/cma-client.d.ts +0 -17
- package/dist/src/helpers/fetch-existing-entities.d.ts +0 -16
- /package/dist/src/session/{command.d.ts → cli.d.ts} +0 -0
package/dist/package.json
CHANGED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type PlainClientAPI } from 'contentful-management';
|
|
2
|
+
interface BuildContentfulManagementClientOptions {
|
|
3
|
+
cmaToken: string;
|
|
4
|
+
host?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function buildContentfulManagementClient(opts: BuildContentfulManagementClientOptions): PlainClientAPI;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type ExistingContentfulEntities } from './fetch-existing-contentful-entities.js';
|
|
2
|
+
export interface FetchAndPersistParams {
|
|
3
|
+
spaceId: string;
|
|
4
|
+
environmentId: string;
|
|
5
|
+
cmaToken: string;
|
|
6
|
+
host?: string;
|
|
7
|
+
outDir: string;
|
|
8
|
+
}
|
|
9
|
+
export interface FetchAndPersistSuccess {
|
|
10
|
+
ok: true;
|
|
11
|
+
path: string;
|
|
12
|
+
durationMs: number;
|
|
13
|
+
entities: ExistingContentfulEntities;
|
|
14
|
+
}
|
|
15
|
+
export interface FetchAndPersistFailure {
|
|
16
|
+
ok: false;
|
|
17
|
+
durationMs: number;
|
|
18
|
+
error: string;
|
|
19
|
+
}
|
|
20
|
+
export type FetchAndPersistResult = FetchAndPersistSuccess | FetchAndPersistFailure;
|
|
21
|
+
/**
|
|
22
|
+
* Build the Contentful management client, fetch the target space's Components
|
|
23
|
+
* and DesignTokens, and write the raw payload to `<outDir>/.existing-entities.json`.
|
|
24
|
+
*
|
|
25
|
+
* Never throws — a failure is reported via `ok: false`. Callers own the
|
|
26
|
+
* user-facing step/progress reporting. This helper only handles the mechanical
|
|
27
|
+
* fetch-then-write and returns a structured result.
|
|
28
|
+
*/
|
|
29
|
+
export declare function fetchAndPersistExistingContentfulEntities(params: FetchAndPersistParams): Promise<FetchAndPersistResult>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type ComponentProps, type DesignTokenProps, type PlainClientAPI } from 'contentful-management';
|
|
2
|
+
export interface ExistingContentfulEntities {
|
|
3
|
+
components: ComponentProps[];
|
|
4
|
+
tokens: DesignTokenProps[];
|
|
5
|
+
}
|
|
6
|
+
interface FetchExistingContentfulEntitiesParams {
|
|
7
|
+
spaceId: string;
|
|
8
|
+
environmentId: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function fetchExistingContentfulEntitiesFromContentful(client: PlainClientAPI, params: FetchExistingContentfulEntitiesParams): Promise<ExistingContentfulEntities>;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ComponentProps } from 'contentful-management';
|
|
2
|
+
/**
|
|
3
|
+
* Find the space component whose name is closest to the codebase component name,
|
|
4
|
+
* within a small edit budget. Handles case, punctuation, and plural differences
|
|
5
|
+
* so `Btn-Primary` matches `btnPrimary`, and `Cards` matches `Card`.
|
|
6
|
+
*/
|
|
7
|
+
export declare function findNearlyMatchingComponent(components: ComponentProps[], codebaseName: string): ComponentProps | undefined;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ExistingContentfulEntities } from './fetch-existing-contentful-entities.js';
|
|
2
|
+
/**
|
|
3
|
+
* Read the session file the orchestrator writes after
|
|
4
|
+
* `fetchExistingContentfulEntitiesFromContentful()`. Returns undefined on
|
|
5
|
+
* any failure — this is optional enrichment and must never block the step.
|
|
6
|
+
*/
|
|
7
|
+
export declare function readExistingContentfulEntitiesFromSession(path: string | undefined): Promise<ExistingContentfulEntities | undefined>;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { ExistingContentfulEntities } from './fetch-existing-contentful-entities.js';
|
|
2
|
+
export interface SelectAgentSummary {
|
|
3
|
+
components: Array<{
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
description: string;
|
|
7
|
+
}>;
|
|
8
|
+
tokens: {
|
|
9
|
+
count: number;
|
|
10
|
+
kinds: string[];
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
export interface GenerateAgentSummary {
|
|
14
|
+
likelyMatch?: {
|
|
15
|
+
id: string;
|
|
16
|
+
name: string;
|
|
17
|
+
designProperties: Array<{
|
|
18
|
+
id: string;
|
|
19
|
+
name: string;
|
|
20
|
+
type: string;
|
|
21
|
+
}>;
|
|
22
|
+
contentProperties: Array<{
|
|
23
|
+
id: string;
|
|
24
|
+
name: string;
|
|
25
|
+
type: string;
|
|
26
|
+
}>;
|
|
27
|
+
slots: Array<{
|
|
28
|
+
id: string;
|
|
29
|
+
name: string;
|
|
30
|
+
}>;
|
|
31
|
+
};
|
|
32
|
+
otherComponents: Array<{
|
|
33
|
+
id: string;
|
|
34
|
+
name: string;
|
|
35
|
+
}>;
|
|
36
|
+
tokens: {
|
|
37
|
+
count: number;
|
|
38
|
+
kinds: string[];
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
export interface MapTokensSummary {
|
|
42
|
+
tokens: Array<{
|
|
43
|
+
id: string;
|
|
44
|
+
name: string;
|
|
45
|
+
type: string;
|
|
46
|
+
}>;
|
|
47
|
+
}
|
|
48
|
+
export declare function summarizeForSelectAgent(entities: ExistingContentfulEntities): SelectAgentSummary;
|
|
49
|
+
export declare function summarizeForGenerateAgent(entities: ExistingContentfulEntities, codebaseComponentName: string): GenerateAgentSummary;
|
|
50
|
+
export declare function summarizeForMapTokens(entities: ExistingContentfulEntities): MapTokensSummary;
|
|
@@ -28,7 +28,6 @@ export interface PipelineOptions {
|
|
|
28
28
|
/** When true, auto-reject cycle participants and retry push instead of surfacing an error. */
|
|
29
29
|
autoRejectCycles?: boolean;
|
|
30
30
|
allowDeletions?: boolean;
|
|
31
|
-
withSpaceContext?: boolean;
|
|
32
31
|
compositionMode?: CompositionMode;
|
|
33
32
|
compositionMap?: string;
|
|
34
33
|
compositionAgent?: boolean;
|
|
@@ -10,6 +10,7 @@ export declare function buildSelectAgentArgs(opts: {
|
|
|
10
10
|
bedrock?: boolean;
|
|
11
11
|
selectPromptPath?: string;
|
|
12
12
|
noCache?: boolean;
|
|
13
|
+
existingEntitiesPath?: string;
|
|
13
14
|
}): string[];
|
|
14
15
|
export type AutoFilterProgress = {
|
|
15
16
|
n: number;
|
|
@@ -27,6 +28,7 @@ export declare function buildGenerateComponentsArgs(opts: {
|
|
|
27
28
|
bedrock?: boolean;
|
|
28
29
|
noCache?: boolean;
|
|
29
30
|
generatePromptPath?: string;
|
|
31
|
+
existingEntitiesPath?: string;
|
|
30
32
|
}): string[];
|
|
31
33
|
export declare function buildMapTokensArgs(opts: {
|
|
32
34
|
sessionId: string;
|
|
@@ -34,6 +36,7 @@ export declare function buildMapTokensArgs(opts: {
|
|
|
34
36
|
model?: string;
|
|
35
37
|
noCache?: boolean;
|
|
36
38
|
skipAgent?: boolean;
|
|
39
|
+
existingEntitiesPath?: string;
|
|
37
40
|
}): string[];
|
|
38
41
|
export declare function shouldRunMapTokens(opts: {
|
|
39
42
|
mappablePropCount: number;
|