@contentful/experience-design-system-cli 2.34.5-dev-build-50638cc0.0 → 2.34.5-dev-build-a4f15b7e.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/analyze/composition/interchange-schema.d.ts +4 -24
- package/dist/src/analyze/composition/resolve-mapping-cli.d.ts +0 -11
- package/dist/src/analyze/composition/resolve-mapping.d.ts +5 -7
- package/dist/src/import/composition-options.d.ts +0 -2
- package/dist/src/import/tui/steps/WelcomeStep.d.ts +7 -0
- package/dist/src/index.js +1339 -1367
- package/package.json +6 -6
package/dist/package.json
CHANGED
|
@@ -1,17 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The CLI-owned composition interchange format (spec T1).
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* `--composition-map` consumes and the resolver can emit.
|
|
8
|
-
* - `CompositionEdge[]` — the flat internal runtime view, one edge per
|
|
9
|
-
* parent→child relationship, carrying optional `slot` (T7), `confidence`,
|
|
10
|
-
* and `provenance`. Easier to merge/dedupe across sources (T2).
|
|
11
|
-
*
|
|
12
|
-
* This module owns both shapes and the converters between them.
|
|
4
|
+
* `CompositionEdge[]` is the flat internal runtime view, one edge per
|
|
5
|
+
* parent→child relationship, carrying optional `slot` (T7), `confidence`,
|
|
6
|
+
* and `provenance`. It is easier to merge and dedupe across sources (T2).
|
|
13
7
|
*/
|
|
14
|
-
export type EdgeProvenance = '
|
|
8
|
+
export type EdgeProvenance = 'typed-slot' | 'structural' | 'manifest' | 'doc' | `adapter:${string}` | 'agent';
|
|
15
9
|
export type CompositionEdge = {
|
|
16
10
|
parent: string;
|
|
17
11
|
child: string;
|
|
@@ -21,17 +15,3 @@ export type CompositionEdge = {
|
|
|
21
15
|
confidence?: number;
|
|
22
16
|
provenance: EdgeProvenance;
|
|
23
17
|
};
|
|
24
|
-
export type InterchangeMap = {
|
|
25
|
-
version: 1;
|
|
26
|
-
groups: Record<string, string[]>;
|
|
27
|
-
};
|
|
28
|
-
export type ValidateResult = {
|
|
29
|
-
valid: true;
|
|
30
|
-
map: InterchangeMap;
|
|
31
|
-
} | {
|
|
32
|
-
valid: false;
|
|
33
|
-
errors: string[];
|
|
34
|
-
};
|
|
35
|
-
export declare function validateInterchangeMap(input: unknown): ValidateResult;
|
|
36
|
-
export declare function groupsToEdges(map: InterchangeMap, provenance: EdgeProvenance): CompositionEdge[];
|
|
37
|
-
export declare function edgesToGroups(edges: CompositionEdge[]): InterchangeMap;
|
|
@@ -1,18 +1,7 @@
|
|
|
1
|
-
import { type InterchangeMap } from './interchange-schema.js';
|
|
2
1
|
export type CompositionCliOptions = {
|
|
3
|
-
/** `--composition-map <path>` — hand-authored interchange file. */
|
|
4
|
-
compositionMap?: string;
|
|
5
2
|
/** `--composition-refresh` — force edge emission to run even over resolved residue. */
|
|
6
3
|
compositionRefresh?: boolean;
|
|
7
4
|
};
|
|
8
|
-
export type LoadUserMapResult = {
|
|
9
|
-
ok: true;
|
|
10
|
-
map: InterchangeMap;
|
|
11
|
-
} | {
|
|
12
|
-
ok: false;
|
|
13
|
-
error: string;
|
|
14
|
-
};
|
|
15
|
-
export declare function loadUserMap(path: string): Promise<LoadUserMapResult>;
|
|
16
5
|
export type ResolvedCompositionSources = {
|
|
17
6
|
forceAgent: boolean;
|
|
18
7
|
};
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import type { RawComponentDefinition } from '../../types.js';
|
|
2
|
-
import {
|
|
2
|
+
import type { CompositionEdge } from './interchange-schema.js';
|
|
3
3
|
import { type EdgeConflict } from './merge-edges.js';
|
|
4
4
|
export type ResolveMappingResult = {
|
|
5
5
|
components: RawComponentDefinition[];
|
|
6
|
-
userMap?: InterchangeMap;
|
|
7
6
|
edges: CompositionEdge[];
|
|
8
7
|
conflicts: EdgeConflict[];
|
|
9
8
|
warnings: string[];
|
|
@@ -11,9 +10,9 @@ export type ResolveMappingResult = {
|
|
|
11
10
|
/**
|
|
12
11
|
* Orchestrate composition-edge acquisition and enrichment.
|
|
13
12
|
*
|
|
14
|
-
* Sources by rank:
|
|
15
|
-
*
|
|
16
|
-
*
|
|
13
|
+
* Sources by rank: typed-slot / "code slots" (2) > structural usage evidence
|
|
14
|
+
* (3) > manifest (4) > doc (5) > adapter-resolved / extraEdges (6) >
|
|
15
|
+
* edge-emitting agent (7). Manifest/doc edges are computed deterministically outside
|
|
17
16
|
* this function (see manifest-doc-evidence.ts) and joined via `extraEdges`.
|
|
18
17
|
* ALL sources — including the code slots already on the incoming components —
|
|
19
18
|
* are fed into one ranked merge and unioned; non-conflicting edges from every
|
|
@@ -28,7 +27,6 @@ export type ResolveMappingResult = {
|
|
|
28
27
|
*/
|
|
29
28
|
export declare function resolveMapping(input: {
|
|
30
29
|
components: RawComponentDefinition[];
|
|
31
|
-
userMap?: InterchangeMap;
|
|
32
30
|
forceAgent?: boolean;
|
|
33
31
|
files: Array<{
|
|
34
32
|
path: string;
|
|
@@ -55,7 +53,7 @@ export declare function resolveMapping(input: {
|
|
|
55
53
|
/**
|
|
56
54
|
* Pre-resolved edges from an external source (e.g. manifest or documentation)
|
|
57
55
|
* path). They join the ranked merge at their own provenance rank alongside
|
|
58
|
-
* code slots and
|
|
56
|
+
* code slots and other automatic mapping sources.
|
|
59
57
|
*/
|
|
60
58
|
extraEdges?: CompositionEdge[];
|
|
61
59
|
}): Promise<ResolveMappingResult>;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
export type CompositionOptionInput = {
|
|
2
|
-
compositionMap?: string;
|
|
3
2
|
prompt?: string[];
|
|
4
3
|
};
|
|
5
4
|
export type CompositionForwardingOptions = {
|
|
6
|
-
compositionMap?: string;
|
|
7
5
|
promptOverrides?: string[];
|
|
8
6
|
};
|
|
9
7
|
export declare function buildCompositionForwardingOptions(options: CompositionOptionInput): CompositionForwardingOptions;
|