@contentful/experience-design-system-cli 2.37.1-dev-build-34dbca05.0 → 2.37.1-dev-build-ced30421.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 +421 -564
- package/dist/index.js +1701 -1994
- package/dist/package.json +1 -1
- package/dist/src/tui/import/steps/07-scope-gate/keymap.d.ts +2 -0
- package/dist/src/tui/import/steps/07-scope-gate/sidebar/components/GroupedSidebar.d.ts +2 -0
- package/dist/src/tui/import/steps/07-scope-gate/state.d.ts +3 -2
- package/dist/src/tui/import/steps/07-scope-gate/types.d.ts +7 -0
- package/dist/src/tui/import/steps/07-scope-gate/use-scope-gate.d.ts +1 -1
- package/dist/src/tui/import/steps/08-generation/types.d.ts +2 -4
- package/legacy/dist/src/analytics/apply.d.ts +6 -0
- package/legacy/dist/src/analytics/client.d.ts +8 -0
- package/legacy/dist/src/analytics/constants.d.ts +4 -0
- package/legacy/dist/src/analytics/exit.d.ts +1 -1
- package/legacy/dist/src/analytics/index.d.ts +5 -2
- package/legacy/dist/src/analytics/normalize.d.ts +3 -0
- package/legacy/dist/src/analytics/os.d.ts +2 -0
- package/legacy/dist/src/analytics/session.d.ts +3 -0
- package/legacy/dist/src/analytics/tracker.d.ts +16 -0
- package/legacy/dist/src/analytics/types.d.ts +28 -0
- package/legacy/dist/src/index.js +19173 -19237
- package/legacy/package.json +1 -1
- package/package.json +3 -3
package/dist/package.json
CHANGED
|
@@ -45,6 +45,8 @@ export interface VisibleRow {
|
|
|
45
45
|
cycleChild?: boolean;
|
|
46
46
|
itemIdx: number;
|
|
47
47
|
rootName?: string;
|
|
48
|
+
/** The parent whose slot the nested row sits in. */
|
|
49
|
+
parentName?: string;
|
|
48
50
|
}
|
|
49
51
|
export declare function buildVisibleRows(props: {
|
|
50
52
|
items: GroupedSidebarItem[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ScopeGraph } from './graph/index.js';
|
|
2
|
-
import type { Decision, ScopeComponent, ScopeDecisions } from './types.js';
|
|
2
|
+
import type { Decision, ParentChildEdge, ScopeComponent, ScopeDecisions } from './types.js';
|
|
3
3
|
export type DecisionState = Map<string, Decision>;
|
|
4
4
|
export type DecisionAction = {
|
|
5
5
|
type: 'accept';
|
|
@@ -15,5 +15,6 @@ export type DecisionAction = {
|
|
|
15
15
|
export declare function reduceDecisions(state: DecisionState, action: DecisionAction, components: ScopeComponent[], graph: ScopeGraph): DecisionState;
|
|
16
16
|
/** Whether rejecting `name` touches 2 or more other components, so the screen has to ask first. */
|
|
17
17
|
export declare function rejectNeedsConfirmation(graph: ScopeGraph, name: string, state: DecisionState): boolean;
|
|
18
|
+
export declare function withoutSlotChildren(components: ScopeComponent[], removedEdges: ParentChildEdge[]): ScopeComponent[];
|
|
18
19
|
/** Everything not accepted counts as rejected, as legacy's `partition` did. */
|
|
19
|
-
export declare function partitionDecisions(components: ScopeComponent[], state: DecisionState): ScopeDecisions;
|
|
20
|
+
export declare function partitionDecisions(components: ScopeComponent[], state: DecisionState, removedEdges: ParentChildEdge[]): ScopeDecisions;
|
|
@@ -10,10 +10,17 @@ export type ScopeComponent = Omit<ScopeComponentRow, 'aiDecision' | 'aiReason' |
|
|
|
10
10
|
slots?: ScopeComponentRow['slots'];
|
|
11
11
|
};
|
|
12
12
|
export type Decision = 'accepted' | 'rejected' | 'undecided';
|
|
13
|
+
/** One slot edge: `parent` allows `child` in a slot. */
|
|
14
|
+
export interface ParentChildEdge {
|
|
15
|
+
parent: string;
|
|
16
|
+
child: string;
|
|
17
|
+
}
|
|
13
18
|
/** What the user confirmed. Becomes `ImportHandoff.scope`; the legacy wizard saves it and starts generation. */
|
|
14
19
|
export interface ScopeDecisions {
|
|
15
20
|
accepted: string[];
|
|
16
21
|
rejected: string[];
|
|
22
|
+
/** Slot edges removed at the gate. The child keeps its own decision. Missing means none were removed. */
|
|
23
|
+
excludedSlotEdges?: ParentChildEdge[];
|
|
17
24
|
}
|
|
18
25
|
export type ScopeGateLoad = {
|
|
19
26
|
ok: true;
|
|
@@ -10,7 +10,7 @@ export interface PendingRejectCascade {
|
|
|
10
10
|
ancestors: string[];
|
|
11
11
|
descendants: string[];
|
|
12
12
|
}
|
|
13
|
-
export declare function useScopeGate({ components, onConfirm, onQuit }: UseScopeGateOptions): {
|
|
13
|
+
export declare function useScopeGate({ components: loadedComponents, onConfirm, onQuit }: UseScopeGateOptions): {
|
|
14
14
|
totalWidth: number;
|
|
15
15
|
columnPlan: {
|
|
16
16
|
layout: "single" | "two-column";
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import type { GenerationHandoff } from '@contentful/experience-design-system-types/handoff';
|
|
2
|
+
import type { ScopeDecisions } from '../07-scope-gate/types.js';
|
|
2
3
|
export interface GenerationInput {
|
|
3
4
|
/** The extraction session the scope was decided on. */
|
|
4
5
|
sessionId: string;
|
|
5
|
-
decisions:
|
|
6
|
-
accepted: string[];
|
|
7
|
-
rejected: string[];
|
|
8
|
-
};
|
|
6
|
+
decisions: ScopeDecisions;
|
|
9
7
|
/**
|
|
10
8
|
* The cache check that ran while the scope gate was open, which restores cached definitions into the pipeline
|
|
11
9
|
* database. The stage waits for it before saving the decisions, since both write to that database.
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ApplyOperationResponse } from '@contentful/experience-design-system-types';
|
|
2
|
+
import type { ImportApiClient } from '../apply/api-client.js';
|
|
3
|
+
/** Record apply/preview API outcomes on the active command. */
|
|
4
|
+
export declare function recordApplyOutcome(client: ImportApiClient, spaceId: string, environmentId: string, operation: ApplyOperationResponse): void;
|
|
5
|
+
/** Record Contentful target context without an apply operation (e.g. preview-only). */
|
|
6
|
+
export declare function recordContentfulContext(client: ImportApiClient, spaceId: string, environmentId: string): void;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare function cliVersion(): string;
|
|
2
|
+
export declare function setPersistedAnalyticsDisabled(disabled: boolean): void;
|
|
3
|
+
export declare function analyticsEnabled(): boolean;
|
|
4
|
+
export declare function trackEvent(event: string, properties: Record<string, unknown>, anonymousId: string, options?: {
|
|
5
|
+
flush?: boolean;
|
|
6
|
+
}): Promise<void>;
|
|
7
|
+
export declare function flushAnalytics(): Promise<void>;
|
|
8
|
+
export declare function resetAnalyticsClientForTests(): void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type CommandFailure } from '@contentful/experience-design-system-backend-pipeline';
|
|
2
1
|
import type { ApiError } from '../apply/api-client.js';
|
|
2
|
+
import type { CommandFailure } from './types.js';
|
|
3
3
|
export declare function exitWithAnalytics(code: number, fields?: CommandFailure): Promise<never>;
|
|
4
4
|
export declare function failureFromApiError(error: ApiError): CommandFailure;
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
export { bindAnalyticsSessionId, completeActiveCommand, emitSessionStarted, enrichCommandResult, failActiveCommand, flushAnalytics, isPipelineAnalyticsChild, noteCommandStart, recordApplyOutcome, recordContentfulContext, setCliVersion, setPersistedAnalyticsDisabled, } from '@contentful/experience-design-system-backend-pipeline';
|
|
2
|
-
export type { CommandFailure } from '@contentful/experience-design-system-backend-pipeline';
|
|
3
1
|
export { exitWithAnalytics, failureFromApiError } from './exit.js';
|
|
2
|
+
export { flushAnalytics, setPersistedAnalyticsDisabled } from './client.js';
|
|
3
|
+
export { isPipelineAnalyticsChild } from './session.js';
|
|
4
|
+
export { bindAnalyticsSessionId, completeActiveCommand, emitSessionStarted, enrichCommandResult, failActiveCommand, noteCommandStart, } from './tracker.js';
|
|
5
|
+
export { recordApplyOutcome, recordContentfulContext } from './apply.js';
|
|
6
|
+
export type { CommandFailure } from './types.js';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { CommandCompletion, CommandContext, CommandFailure, EntryCommand } from './types.js';
|
|
2
|
+
/** Record the start of a tracked command. Invoked is deferred until a session is bound. */
|
|
3
|
+
export declare function noteCommandStart(commandChain: string): void;
|
|
4
|
+
/** Bind a session id, preferring a pipeline parent id when present. */
|
|
5
|
+
export declare function bindAnalyticsSessionId(sessionId: string | undefined, context?: CommandContext): Promise<string>;
|
|
6
|
+
/** Attach Contentful target context for the active command. */
|
|
7
|
+
export declare function setCommandContext(context: CommandContext): void;
|
|
8
|
+
/** Merge optional completion fields before the terminal event fires. */
|
|
9
|
+
export declare function enrichCommandResult(fields: CommandCompletion): void;
|
|
10
|
+
/** Bind the pipeline session and emit invoked once both command and session are known. */
|
|
11
|
+
export declare function bindAnalyticsSession(id: string, context?: CommandContext): Promise<void>;
|
|
12
|
+
/** Emit session_started once per new pipeline head. */
|
|
13
|
+
export declare function emitSessionStarted(entryCommand: EntryCommand): Promise<void>;
|
|
14
|
+
export declare function completeActiveCommand(): Promise<void>;
|
|
15
|
+
export declare function failActiveCommand(fields?: CommandFailure): Promise<void>;
|
|
16
|
+
export declare function resetAnalyticsStateForTests(): void;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/** Tracked CLI commands — closed set aligned with the published event schema. */
|
|
2
|
+
export type DsiCliCommand = 'analyze_extract' | 'analyze_select' | 'generate_components' | 'generate_tokens' | 'map_tokens' | 'apply_push' | 'print_components' | 'print_tokens' | 'import';
|
|
3
|
+
export type EntryCommand = 'analyze_extract' | 'import';
|
|
4
|
+
export type OsName = 'macOS' | 'Linux' | 'Windows' | 'Android' | 'other';
|
|
5
|
+
export type WriteResult = {
|
|
6
|
+
created_count: number;
|
|
7
|
+
updated_count: number;
|
|
8
|
+
failed_count: number;
|
|
9
|
+
};
|
|
10
|
+
export type CommandContext = {
|
|
11
|
+
space_key?: string;
|
|
12
|
+
environment_key?: string;
|
|
13
|
+
x_contentful_request_id?: string;
|
|
14
|
+
};
|
|
15
|
+
export type CommandCompletion = CommandContext & {
|
|
16
|
+
dsi_operation_id?: string;
|
|
17
|
+
extracted_component_count?: number;
|
|
18
|
+
accepted_component_count?: number;
|
|
19
|
+
component_type_result?: WriteResult;
|
|
20
|
+
design_token_result?: WriteResult;
|
|
21
|
+
};
|
|
22
|
+
export type CommandFailure = CommandContext & {
|
|
23
|
+
dsi_operation_id?: string;
|
|
24
|
+
error_name?: string;
|
|
25
|
+
error_code?: string;
|
|
26
|
+
http_status_code?: number;
|
|
27
|
+
exit_code?: number;
|
|
28
|
+
};
|