@dreamboard-games/sdk 0.4.0-alpha.1 → 0.4.0-alpha.10
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/REFERENCE.md +4071 -566
- package/dist/HandView-Bi2lxzQP.d.ts +79 -0
- package/dist/{ResourceCounter-BTXklCEZ.d.ts → ResourceCounter-BFxJknqp.d.ts} +5 -9
- package/dist/{ThemeProvider-DvMl17Ny.d.ts → ThemeProvider-CElaL2ik.d.ts} +1 -1
- package/dist/{attributes-BrZtP9az.d.ts → attributes-DbvyMbXw.d.ts} +17 -2
- package/dist/authoring/index.d.ts +62 -0
- package/dist/authoring/index.js +24 -0
- package/dist/authoring/index.js.map +1 -0
- package/dist/authoring-compiler.d.ts +27 -0
- package/dist/authoring-compiler.js +12 -0
- package/dist/authoring-compiler.js.map +1 -0
- package/dist/authoring-materialize-cli.d.ts +1 -0
- package/dist/authoring-materialize-cli.js +46 -0
- package/dist/authoring-materialize-cli.js.map +1 -0
- package/dist/browser-interaction.d.ts +206 -6
- package/dist/browser-interaction.js +14 -2
- package/dist/chunk-26IRD573.js +169 -0
- package/dist/chunk-26IRD573.js.map +1 -0
- package/dist/{chunk-7W6TQO3X.js → chunk-2TRZSZGD.js} +1544 -669
- package/dist/chunk-2TRZSZGD.js.map +1 -0
- package/dist/{chunk-Y6Y2YABD.js → chunk-3PFDHTR7.js} +39 -11
- package/dist/chunk-3PFDHTR7.js.map +1 -0
- package/dist/chunk-4IIY742N.js +435 -0
- package/dist/chunk-4IIY742N.js.map +1 -0
- package/dist/chunk-5XTAQ4EQ.js +32 -0
- package/dist/chunk-5XTAQ4EQ.js.map +1 -0
- package/dist/{chunk-CZMFAS3E.js → chunk-6P3IO3FF.js} +641 -1355
- package/dist/chunk-6P3IO3FF.js.map +1 -0
- package/dist/chunk-GMOBG7Y7.js +564 -0
- package/dist/chunk-GMOBG7Y7.js.map +1 -0
- package/dist/{chunk-3K362ZKR.js → chunk-M4PZ6PEY.js} +225 -47
- package/dist/chunk-M4PZ6PEY.js.map +1 -0
- package/dist/chunk-NGYFBNBP.js +333 -0
- package/dist/chunk-NGYFBNBP.js.map +1 -0
- package/dist/{chunk-AEUXCFGM.js → chunk-PF7L4BMG.js} +1 -8
- package/dist/{chunk-AEUXCFGM.js.map → chunk-PF7L4BMG.js.map} +1 -1
- package/dist/{chunk-IUGKW2GS.js → chunk-PIZEWMKV.js} +6 -2
- package/dist/chunk-PIZEWMKV.js.map +1 -0
- package/dist/chunk-PJXXQ7IE.js +532 -0
- package/dist/chunk-PJXXQ7IE.js.map +1 -0
- package/dist/chunk-QQNL4WTX.js +578 -0
- package/dist/chunk-QQNL4WTX.js.map +1 -0
- package/dist/chunk-QWWAGWAI.js +1864 -0
- package/dist/chunk-QWWAGWAI.js.map +1 -0
- package/dist/{chunk-XXBSIPJX.js → chunk-SACZWUA6.js} +333 -111
- package/dist/chunk-SACZWUA6.js.map +1 -0
- package/dist/{chunk-XJYUSD5F.js → chunk-UC2UXAC6.js} +2 -2
- package/dist/chunk-UNVCT5Z7.js +73 -0
- package/dist/chunk-UNVCT5Z7.js.map +1 -0
- package/dist/{chunk-MALRKLRR.js → chunk-WHR5UW3F.js} +301 -12
- package/dist/chunk-WHR5UW3F.js.map +1 -0
- package/dist/chunk-X7GPD5TR.js +12 -0
- package/dist/chunk-X7GPD5TR.js.map +1 -0
- package/dist/chunk-XDGRC6OR.js +7039 -0
- package/dist/chunk-XDGRC6OR.js.map +1 -0
- package/dist/chunk-YN5W67YL.js +174 -0
- package/dist/chunk-YN5W67YL.js.map +1 -0
- package/dist/{chunk-7LZZEI25.js → chunk-YNW3KBDE.js} +41 -13
- package/dist/chunk-YNW3KBDE.js.map +1 -0
- package/dist/codegen.d.ts +24 -3
- package/dist/codegen.js +1 -1
- package/dist/{components-Dqr_LuZJ.d.ts → components-BPzsSRs8.d.ts} +111 -209
- package/dist/definitions-BTaUEJ0t.d.ts +300 -0
- package/dist/{stale-contract-artifact-error-BelRiIDR.d.ts → diagnostics-DIi3ina7.d.ts} +3 -19
- package/dist/{hex-board-view-UCUjMALd.d.ts → hex-board-view-aKkblDp6.d.ts} +296 -2
- package/dist/index-CWzWpQzM.d.ts +193 -0
- package/dist/{index.d-BL3bT5lt.d.ts → index.d-C7Ztirg6.d.ts} +525 -29
- package/dist/index.js +2 -1
- package/dist/package-set.d.ts +2 -2
- package/dist/package-set.js +2 -1
- package/dist/player-state-Cqpyeql0.d.ts +371 -0
- package/dist/plugin-state-BRH3UiUp.d.ts +214 -0
- package/dist/protocol-B2LWcqB4.d.ts +322 -0
- package/dist/reducer/advanced.d.ts +4 -2
- package/dist/reducer/advanced.js +7 -26
- package/dist/reducer/advanced.js.map +1 -1
- package/dist/reducer-contract.d.ts +1 -1
- package/dist/reducer-contract.js +2 -2
- package/dist/reducer.d.ts +41 -25
- package/dist/reducer.js +49 -5722
- package/dist/reducer.js.map +1 -1
- package/dist/reference-game-compiler.d.ts +45 -0
- package/dist/reference-game-compiler.js +25 -0
- package/dist/reference-game-compiler.js.map +1 -0
- package/dist/reference-game-source-manifest-cli.d.ts +1 -0
- package/dist/reference-game-source-manifest-cli.js +84 -0
- package/dist/reference-game-source-manifest-cli.js.map +1 -0
- package/dist/reference-games/index.d.ts +13 -0
- package/dist/reference-games/index.js +50 -0
- package/dist/reference-games/index.js.map +1 -0
- package/dist/runtime/primitives.d.ts +51 -29
- package/dist/runtime/primitives.js +14 -7
- package/dist/runtime/runtime-api.d.ts +2 -2
- package/dist/runtime/workspace-contract.d.ts +21 -167
- package/dist/runtime/workspace-contract.js +8 -6
- package/dist/runtime-B_w9AO2n.d.ts +1725 -0
- package/dist/runtime-api-xCWLMQRT.d.ts +97 -0
- package/dist/runtime.d.ts +37 -32
- package/dist/runtime.js +117 -793
- package/dist/runtime.js.map +1 -1
- package/dist/schema-CJc0UfjJ.d.ts +216 -0
- package/dist/stale-contract-artifact-error-XLaweZtF.d.ts +18 -0
- package/dist/testing-compiler.d.ts +36 -0
- package/dist/testing-compiler.js +275 -0
- package/dist/testing-compiler.js.map +1 -0
- package/dist/testing-runtime.d.ts +118 -0
- package/dist/testing-runtime.js +212 -0
- package/dist/testing-runtime.js.map +1 -0
- package/dist/testing.d.ts +420 -311
- package/dist/testing.js +1585 -710
- package/dist/testing.js.map +1 -1
- package/dist/types-CYZqg_Hn.d.ts +122 -0
- package/dist/{types-BqzHkNMA.d.ts → types-DJj5MJkl.d.ts} +32 -5
- package/dist/types-_zfC_7CD.d.ts +29 -0
- package/dist/types.d.ts +30 -8
- package/dist/ui/components.d.ts +8 -6
- package/dist/ui/components.js +33 -5
- package/dist/ui/player-state.d.ts +2 -365
- package/dist/ui/plugin-styles.css +2 -2
- package/dist/{ui-contract-W2-kxObe.d.ts → ui-contract-CUC7Lyoc.d.ts} +36 -32
- package/dist/ui.d.ts +11 -9
- package/dist/ui.js +34 -6
- package/dist/views-DE2eZxPz.d.ts +1588 -0
- package/package.json +73 -36
- package/dist/HandView-PYDmehVD.d.ts +0 -193
- package/dist/chunk-3K362ZKR.js.map +0 -1
- package/dist/chunk-3OZMHZK3.js +0 -40
- package/dist/chunk-3OZMHZK3.js.map +0 -1
- package/dist/chunk-7LZZEI25.js.map +0 -1
- package/dist/chunk-7W6TQO3X.js.map +0 -1
- package/dist/chunk-CZMFAS3E.js.map +0 -1
- package/dist/chunk-IUGKW2GS.js.map +0 -1
- package/dist/chunk-MALRKLRR.js.map +0 -1
- package/dist/chunk-XXBSIPJX.js.map +0 -1
- package/dist/chunk-Y6Y2YABD.js.map +0 -1
- package/dist/hex-color-MhOyuY-o.d.ts +0 -8
- package/dist/runtime-api-BXd70c2e.d.ts +0 -490
- package/dist/views-fn2RuXOx.d.ts +0 -3168
- /package/dist/{chunk-XJYUSD5F.js.map → chunk-UC2UXAC6.js.map} +0 -0
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ReactNode, CSSProperties } from 'react';
|
|
3
|
+
import { ViewCard } from './types.js';
|
|
4
|
+
import { P as InteractionVisualState, f as CardIntent } from './hex-board-view-aKkblDp6.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Pure layout math for the controlled `HandView`.
|
|
8
|
+
*
|
|
9
|
+
* The functions here are independent of React and DOM measurement so they can
|
|
10
|
+
* be unit-tested directly. {@link computeFanLayout} matches the algorithm
|
|
11
|
+
* documented in `docs/reference/ui-sdk-mobile-hand-and-card-interactions.md`,
|
|
12
|
+
* and {@link chooseHandLayoutMode} translates a measured container width and a
|
|
13
|
+
* caller policy into the actual presentation mode the hand should render.
|
|
14
|
+
*/
|
|
15
|
+
type HandPresentationMode = "fan" | "compressed-fan" | "strip" | "tray";
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Deterministic pointer recognizer for the controlled hand view.
|
|
19
|
+
*
|
|
20
|
+
* The engine is independent from React: it consumes pointer events and a
|
|
21
|
+
* caller-supplied callbacks bag, and produces semantic gesture events. It
|
|
22
|
+
* owns no DOM, emits no `CardIntent`, and does not track the drag-lifecycle
|
|
23
|
+
* `phase` — that responsibility lives in `CardDragSurface`. The engine only
|
|
24
|
+
* recognizes `tap`, `previewStart`/`previewEnd`, `liftStart`/`liftMove`/
|
|
25
|
+
* `liftEnd`/`liftCancel`, and a `horizontalBrowse` informational signal.
|
|
26
|
+
*
|
|
27
|
+
* The thresholds match
|
|
28
|
+
* `docs/reference/ui-sdk-mobile-hand-and-card-interactions.md`:
|
|
29
|
+
*
|
|
30
|
+
* | Threshold | Default |
|
|
31
|
+
* | ------------------------- | ----------- |
|
|
32
|
+
* | Press preview delay | `220ms` |
|
|
33
|
+
* | Movement slop | `8px` |
|
|
34
|
+
* | Axis bias | `1.25` |
|
|
35
|
+
* | Drag lift distance | `28px` |
|
|
36
|
+
*
|
|
37
|
+
* Callers wire the engine's `handlePointerDown` / `handlePointerMove` /
|
|
38
|
+
* `handlePointerUp` / `handlePointerCancel` to the matching DOM events on
|
|
39
|
+
* each interactive card.
|
|
40
|
+
*/
|
|
41
|
+
type HandInteractionPolicy = "direct-activate" | "drag-to-target";
|
|
42
|
+
|
|
43
|
+
type HandLayoutKind = HandPresentationMode | "stack";
|
|
44
|
+
interface HandLayoutPolicy {
|
|
45
|
+
desktop?: HandLayoutKind;
|
|
46
|
+
mobile?: HandLayoutKind;
|
|
47
|
+
}
|
|
48
|
+
interface HandViewProps<CardData extends ViewCard = ViewCard> {
|
|
49
|
+
cards: readonly CardData[];
|
|
50
|
+
/**
|
|
51
|
+
* Layout policy. Pass a single layout kind to use the same layout in every
|
|
52
|
+
* viewport, or pass `{ desktop, mobile }` for a measured-width decision.
|
|
53
|
+
* Defaults to `{ desktop: "fan", mobile: "tray" }`.
|
|
54
|
+
*/
|
|
55
|
+
layout?: HandLayoutKind | HandLayoutPolicy;
|
|
56
|
+
/**
|
|
57
|
+
* Mobile interaction policy. Defaults to `direct-activate`. Use
|
|
58
|
+
* `drag-to-target` together with a surrounding `CardDragSurface` and one
|
|
59
|
+
* or more `CardDropTargetView` children.
|
|
60
|
+
*/
|
|
61
|
+
mobileInteraction?: HandInteractionPolicy;
|
|
62
|
+
/** Returns the controlled visual state for a card. */
|
|
63
|
+
stateForCard?: (card: CardData, index: number) => InteractionVisualState | undefined;
|
|
64
|
+
/** Visual surface renderer. */
|
|
65
|
+
renderCard: (card: CardData, state: InteractionVisualState, index: number) => ReactNode;
|
|
66
|
+
/** Generic UI intent callback. */
|
|
67
|
+
onCardIntent?: (intent: CardIntent<CardData["id"] & string>) => void;
|
|
68
|
+
/** Card width hint for fan geometry. */
|
|
69
|
+
cardSize?: "sm" | "md" | "lg";
|
|
70
|
+
/** Slot for the empty state. Defaults to nothing rendered. */
|
|
71
|
+
renderEmpty?: () => ReactNode;
|
|
72
|
+
/** ARIA label for the hand region. */
|
|
73
|
+
"aria-label"?: string;
|
|
74
|
+
className?: string;
|
|
75
|
+
style?: CSSProperties;
|
|
76
|
+
}
|
|
77
|
+
declare function HandView<CardData extends ViewCard = ViewCard>({ cards, layout, mobileInteraction, stateForCard, renderCard, onCardIntent, cardSize, renderEmpty, "aria-label": ariaLabel, className, style, }: HandViewProps<CardData>): react_jsx_runtime.JSX.Element;
|
|
78
|
+
|
|
79
|
+
export { type HandInteractionPolicy as H, type HandLayoutKind as a, type HandLayoutPolicy as b, HandView as c, type HandViewProps as d };
|
|
@@ -20,14 +20,10 @@ declare function MobileHandTrayProvider({ children }: {
|
|
|
20
20
|
children: ReactNode;
|
|
21
21
|
}): react_jsx_runtime.JSX.Element;
|
|
22
22
|
declare function useRegisterMobileHand(hand: MobileHandRegistration): void;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
* chrome (labels, framing) that the tray already provides, instead of guessing
|
|
28
|
-
* the breakpoint with a CSS media query. Returns `false` outside `<UI.Root>`.
|
|
29
|
-
*/
|
|
30
|
-
declare function useMobileHandTrayActive(): boolean;
|
|
23
|
+
declare function useOverlayInsets(): {
|
|
24
|
+
bottom: number;
|
|
25
|
+
};
|
|
26
|
+
declare function useRegisterBottomOverlayInset(id: string, height: number): void;
|
|
31
27
|
|
|
32
28
|
type ResourceId = string;
|
|
33
29
|
interface ResourceDisplayConfig<Resource extends string = ResourceId> {
|
|
@@ -99,4 +95,4 @@ declare const ResourceCounter: {
|
|
|
99
95
|
Label: typeof ResourceCounterLabel;
|
|
100
96
|
};
|
|
101
97
|
|
|
102
|
-
export { type BoundResourceCounterRootProps as B, type HandRole as H, type MobileHandRegistration as M, ResourceCounter as R, MobileHandTrayProvider as a, type ResourceCounterComponents as b, ResourceCounterCount as c, ResourceCounterIcon as d, ResourceCounterItem as e, type ResourceCounterItemState as f, ResourceCounterLabel as g, type ResourceCounterPartProps as h, type ResourceCounterProps as i, ResourceCounterRoot as j, type ResourceCounterRootProps as k, type ResourceDisplayConfig as l, type ResourceIconProps as m, createResourceCounter as n,
|
|
98
|
+
export { type BoundResourceCounterRootProps as B, type HandRole as H, type MobileHandRegistration as M, ResourceCounter as R, MobileHandTrayProvider as a, type ResourceCounterComponents as b, ResourceCounterCount as c, ResourceCounterIcon as d, ResourceCounterItem as e, type ResourceCounterItemState as f, ResourceCounterLabel as g, type ResourceCounterPartProps as h, type ResourceCounterProps as i, ResourceCounterRoot as j, type ResourceCounterRootProps as k, type ResourceDisplayConfig as l, type ResourceIconProps as m, createResourceCounter as n, useRegisterBottomOverlayInset as o, useRegisterMobileHand as p, useOverlayInsets as u };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { CSSProperties, ReactNode } from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { ag as Theme, ai as ThemeOverride } from './hex-board-view-aKkblDp6.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* The set of preset theme ids ships in `@dreamboard-games/sdk/ui`. Authors
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { q as BrowserInteractionIntent, i as BrowserInteractionCandidateState, h as BrowserInteractionActuatorKind,
|
|
1
|
+
import { q as BrowserInteractionIntent, i as BrowserInteractionCandidateState, h as BrowserInteractionActuatorKind, K as BrowserInteractionSurfaceEffect, k as BrowserInteractionEffectPattern, w as BrowserInteractionPreparationTarget, z as BrowserInteractionReadiness, V as GameplayBrowserInteractionIntent, X as GameplaySemanticEffect, Y as GameplaySemanticEffectPattern } from './types-DJj5MJkl.js';
|
|
2
2
|
|
|
3
3
|
type BrowserInteractionAttributeMap = Record<string, string | boolean>;
|
|
4
4
|
interface BrowserInteractionRootAttributesInput {
|
|
@@ -29,8 +29,19 @@ interface BrowserInteractionActuatorAttributesInput {
|
|
|
29
29
|
readonly preparationPatterns?: readonly BrowserInteractionEffectPattern[];
|
|
30
30
|
readonly prepares?: BrowserInteractionPreparationTarget;
|
|
31
31
|
}
|
|
32
|
+
interface BrowserInteractionPointerTargetAttributesInput {
|
|
33
|
+
readonly surface: string;
|
|
34
|
+
readonly scopeId: string;
|
|
35
|
+
readonly interactionKey: string;
|
|
36
|
+
readonly interactionId: string;
|
|
37
|
+
readonly descriptorDigest?: string;
|
|
38
|
+
readonly targetId: string;
|
|
39
|
+
readonly enabled?: boolean;
|
|
40
|
+
readonly acceptedEffectPatterns: readonly BrowserInteractionEffectPattern[];
|
|
41
|
+
}
|
|
32
42
|
declare function createBrowserInteractionRootAttributes(input: BrowserInteractionRootAttributesInput): BrowserInteractionAttributeMap;
|
|
33
43
|
declare function createBrowserInteractionActuatorAttributes(input: BrowserInteractionActuatorAttributesInput): BrowserInteractionAttributeMap;
|
|
44
|
+
declare function createBrowserInteractionPointerTargetAttributes(input: BrowserInteractionPointerTargetAttributesInput): BrowserInteractionAttributeMap;
|
|
34
45
|
type GameplayInteractionRootAttributesInput = Omit<BrowserInteractionRootAttributesInput, "surface">;
|
|
35
46
|
type GameplayActuatorAttributesInput = Omit<BrowserInteractionActuatorAttributesInput, "surface" | "intent" | "semanticEffects" | "acceptedEffectPatterns" | "preparationPatterns"> & {
|
|
36
47
|
readonly intent: GameplayBrowserInteractionIntent;
|
|
@@ -38,8 +49,12 @@ type GameplayActuatorAttributesInput = Omit<BrowserInteractionActuatorAttributes
|
|
|
38
49
|
readonly acceptedEffectPatterns?: readonly GameplaySemanticEffectPattern[];
|
|
39
50
|
readonly preparationPatterns?: readonly GameplaySemanticEffectPattern[];
|
|
40
51
|
};
|
|
52
|
+
type GameplayPointerTargetAttributesInput = Omit<BrowserInteractionPointerTargetAttributesInput, "surface" | "acceptedEffectPatterns"> & {
|
|
53
|
+
readonly acceptedEffectPatterns: readonly GameplaySemanticEffectPattern[];
|
|
54
|
+
};
|
|
41
55
|
declare function createGameplayInteractionRootAttributes(input: GameplayInteractionRootAttributesInput): BrowserInteractionAttributeMap;
|
|
42
56
|
declare function createGameplayActuatorAttributes(input: GameplayActuatorAttributesInput): BrowserInteractionAttributeMap;
|
|
57
|
+
declare function createGameplayPointerTargetAttributes(input: GameplayPointerTargetAttributesInput): BrowserInteractionAttributeMap;
|
|
43
58
|
declare function createBrowserInteractionActuatorKey(input: {
|
|
44
59
|
readonly surface: string;
|
|
45
60
|
readonly scopeId: string;
|
|
@@ -50,4 +65,4 @@ declare function createBrowserInteractionActuatorKey(input: {
|
|
|
50
65
|
readonly actuatorKind: BrowserInteractionActuatorKind;
|
|
51
66
|
}): string;
|
|
52
67
|
|
|
53
|
-
export { type BrowserInteractionActuatorAttributesInput as B, type GameplayActuatorAttributesInput as G, type BrowserInteractionAttributeMap as a, type
|
|
68
|
+
export { type BrowserInteractionActuatorAttributesInput as B, type GameplayActuatorAttributesInput as G, type BrowserInteractionAttributeMap as a, type BrowserInteractionPointerTargetAttributesInput as b, type BrowserInteractionRootAttributesInput as c, type GameplayInteractionRootAttributesInput as d, type GameplayPointerTargetAttributesInput as e, createBrowserInteractionActuatorAttributes as f, createBrowserInteractionActuatorKey as g, createBrowserInteractionPointerTargetAttributes as h, createBrowserInteractionRootAttributes as i, createGameplayActuatorAttributes as j, createGameplayInteractionRootAttributes as k, createGameplayPointerTargetAttributes as l };
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { JsonValue } from '../types.js';
|
|
2
|
+
|
|
3
|
+
type GeneratedAuthoringMetadataV1 = {
|
|
4
|
+
sdkVersion: string;
|
|
5
|
+
codegenVersion: string;
|
|
6
|
+
manifestSchemaVersion: number;
|
|
7
|
+
generatedArtifactSchemaVersion: number;
|
|
8
|
+
};
|
|
9
|
+
type AuthoringValidationResultV1 = {
|
|
10
|
+
valid: boolean;
|
|
11
|
+
errors: readonly string[];
|
|
12
|
+
warnings: readonly string[];
|
|
13
|
+
};
|
|
14
|
+
type GeneratedArtifactV1 = {
|
|
15
|
+
path: string;
|
|
16
|
+
ownership: "authoritative" | "seed";
|
|
17
|
+
content: string;
|
|
18
|
+
contentSha256: string;
|
|
19
|
+
};
|
|
20
|
+
type GeneratedPathPatternV1 = {
|
|
21
|
+
prefix: string;
|
|
22
|
+
suffix: string;
|
|
23
|
+
};
|
|
24
|
+
type AuthoringManifestConformanceCaseV1 = {
|
|
25
|
+
id: string;
|
|
26
|
+
manifest: JsonValue;
|
|
27
|
+
expected: {
|
|
28
|
+
valid: true;
|
|
29
|
+
transportValid: true;
|
|
30
|
+
materializedSha256: string;
|
|
31
|
+
} | {
|
|
32
|
+
valid: false;
|
|
33
|
+
transportValid: boolean;
|
|
34
|
+
diagnosticCodes: readonly string[];
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
type ProjectAuthoringAdapterV1 = {
|
|
38
|
+
protocolVersion: 1;
|
|
39
|
+
metadata: GeneratedAuthoringMetadataV1;
|
|
40
|
+
generatedPaths: readonly string[];
|
|
41
|
+
generatedPathPatterns: readonly GeneratedPathPatternV1[];
|
|
42
|
+
manifestConformanceCases: readonly AuthoringManifestConformanceCaseV1[];
|
|
43
|
+
validateManifest(manifest: unknown): AuthoringValidationResultV1;
|
|
44
|
+
materializeManifest(manifest: unknown): JsonValue;
|
|
45
|
+
generateWorkspaceArtifacts(manifest: unknown): readonly GeneratedArtifactV1[];
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
declare function diagnosticCodesForValidationErrors(errors: readonly string[]): readonly string[];
|
|
49
|
+
|
|
50
|
+
declare function validateManifest(manifest: unknown): AuthoringValidationResultV1;
|
|
51
|
+
declare function materializeManifest(manifest: unknown): JsonValue;
|
|
52
|
+
declare function generateWorkspaceArtifacts(manifest: unknown): readonly GeneratedArtifactV1[];
|
|
53
|
+
declare const GENERATED_WORKSPACE_PATHS: readonly string[];
|
|
54
|
+
type GeneratedWorkspacePathPattern = {
|
|
55
|
+
readonly prefix: string;
|
|
56
|
+
readonly suffix: string;
|
|
57
|
+
};
|
|
58
|
+
declare const GENERATED_WORKSPACE_PATH_PATTERNS: readonly GeneratedWorkspacePathPattern[];
|
|
59
|
+
declare const MANIFEST_CONFORMANCE_CASES: readonly AuthoringManifestConformanceCaseV1[];
|
|
60
|
+
declare const projectAuthoringAdapter: ProjectAuthoringAdapterV1;
|
|
61
|
+
|
|
62
|
+
export { type AuthoringManifestConformanceCaseV1, type AuthoringValidationResultV1, GENERATED_WORKSPACE_PATHS, GENERATED_WORKSPACE_PATH_PATTERNS, type GeneratedArtifactV1, type GeneratedAuthoringMetadataV1, type GeneratedPathPatternV1, MANIFEST_CONFORMANCE_CASES, type ProjectAuthoringAdapterV1, diagnosticCodesForValidationErrors, generateWorkspaceArtifacts, materializeManifest, projectAuthoringAdapter, validateManifest };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import {
|
|
2
|
+
GENERATED_WORKSPACE_PATHS,
|
|
3
|
+
GENERATED_WORKSPACE_PATH_PATTERNS,
|
|
4
|
+
MANIFEST_CONFORMANCE_CASES,
|
|
5
|
+
diagnosticCodesForValidationErrors,
|
|
6
|
+
generateWorkspaceArtifacts,
|
|
7
|
+
materializeManifest,
|
|
8
|
+
projectAuthoringAdapter,
|
|
9
|
+
validateManifest
|
|
10
|
+
} from "../chunk-PJXXQ7IE.js";
|
|
11
|
+
import "../chunk-X7GPD5TR.js";
|
|
12
|
+
import "../chunk-SACZWUA6.js";
|
|
13
|
+
import "../chunk-PZ5AY32C.js";
|
|
14
|
+
export {
|
|
15
|
+
GENERATED_WORKSPACE_PATHS,
|
|
16
|
+
GENERATED_WORKSPACE_PATH_PATTERNS,
|
|
17
|
+
MANIFEST_CONFORMANCE_CASES,
|
|
18
|
+
diagnosticCodesForValidationErrors,
|
|
19
|
+
generateWorkspaceArtifacts,
|
|
20
|
+
materializeManifest,
|
|
21
|
+
projectAuthoringAdapter,
|
|
22
|
+
validateManifest
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
type MaterializeWorkspaceOptions = {
|
|
2
|
+
readonly manifestPath: string;
|
|
3
|
+
readonly projectRoot?: string;
|
|
4
|
+
/** Scaffolding-only. Existing build/test paths leave seed files untouched. */
|
|
5
|
+
readonly writeMissingSeeds?: boolean;
|
|
6
|
+
};
|
|
7
|
+
type MaterializedWorkspaceReceipt = {
|
|
8
|
+
readonly schemaVersion: 1;
|
|
9
|
+
readonly projectRoot: string;
|
|
10
|
+
readonly authoritativeFiles: number;
|
|
11
|
+
readonly seededFiles: number;
|
|
12
|
+
readonly artifacts: readonly {
|
|
13
|
+
readonly path: string;
|
|
14
|
+
readonly ownership: "authoritative";
|
|
15
|
+
readonly sha256: `sha256:${string}`;
|
|
16
|
+
}[];
|
|
17
|
+
readonly digest: `sha256:${string}`;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Materialize SDK-owned workspace contracts from authored manifest source.
|
|
21
|
+
* Authoritative files are always replaced. Seed files are untouched unless a
|
|
22
|
+
* scaffolding caller explicitly opts in. No test state or projection artifact
|
|
23
|
+
* is emitted.
|
|
24
|
+
*/
|
|
25
|
+
declare function materializeWorkspace(options: MaterializeWorkspaceOptions): Promise<MaterializedWorkspaceReceipt>;
|
|
26
|
+
|
|
27
|
+
export { type MaterializeWorkspaceOptions, type MaterializedWorkspaceReceipt, materializeWorkspace };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import {
|
|
2
|
+
materializeWorkspace
|
|
3
|
+
} from "./chunk-26IRD573.js";
|
|
4
|
+
import "./chunk-PJXXQ7IE.js";
|
|
5
|
+
import "./chunk-UNVCT5Z7.js";
|
|
6
|
+
import "./chunk-X7GPD5TR.js";
|
|
7
|
+
import "./chunk-SACZWUA6.js";
|
|
8
|
+
import "./chunk-PZ5AY32C.js";
|
|
9
|
+
export {
|
|
10
|
+
materializeWorkspace
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=authoring-compiler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
materializeWorkspace
|
|
4
|
+
} from "./chunk-26IRD573.js";
|
|
5
|
+
import "./chunk-PJXXQ7IE.js";
|
|
6
|
+
import "./chunk-UNVCT5Z7.js";
|
|
7
|
+
import "./chunk-X7GPD5TR.js";
|
|
8
|
+
import "./chunk-SACZWUA6.js";
|
|
9
|
+
import "./chunk-PZ5AY32C.js";
|
|
10
|
+
|
|
11
|
+
// src/authoring-materialize-cli.ts
|
|
12
|
+
var options = parseArgs(process.argv.slice(2));
|
|
13
|
+
var receipt = await materializeWorkspace(options);
|
|
14
|
+
console.log(JSON.stringify(receipt, null, 2));
|
|
15
|
+
function parseArgs(argv) {
|
|
16
|
+
let manifestPath;
|
|
17
|
+
let projectRoot;
|
|
18
|
+
let writeMissingSeeds = false;
|
|
19
|
+
for (let index = 0; index < argv.length; index += 1) {
|
|
20
|
+
const arg = argv[index];
|
|
21
|
+
if (arg === "--manifest") {
|
|
22
|
+
manifestPath = argv[index + 1];
|
|
23
|
+
index += 1;
|
|
24
|
+
continue;
|
|
25
|
+
}
|
|
26
|
+
if (arg === "--project-root") {
|
|
27
|
+
projectRoot = argv[index + 1];
|
|
28
|
+
index += 1;
|
|
29
|
+
continue;
|
|
30
|
+
}
|
|
31
|
+
if (arg === "--write-missing-seeds") {
|
|
32
|
+
writeMissingSeeds = true;
|
|
33
|
+
continue;
|
|
34
|
+
}
|
|
35
|
+
throw new Error(`Unknown argument '${arg}'.`);
|
|
36
|
+
}
|
|
37
|
+
if (!manifestPath) {
|
|
38
|
+
throw new Error("--manifest is required.");
|
|
39
|
+
}
|
|
40
|
+
return {
|
|
41
|
+
manifestPath,
|
|
42
|
+
...projectRoot === void 0 ? {} : { projectRoot },
|
|
43
|
+
...writeMissingSeeds ? { writeMissingSeeds: true } : {}
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=authoring-materialize-cli.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/authoring-materialize-cli.ts"],"sourcesContent":["#!/usr/bin/env node\nimport { materializeWorkspace } from \"./authoring/materialize-workspace.js\";\n\nconst options = parseArgs(process.argv.slice(2));\nconst receipt = await materializeWorkspace(options);\nconsole.log(JSON.stringify(receipt, null, 2));\n\nfunction parseArgs(argv: readonly string[]): {\n readonly manifestPath: string;\n readonly projectRoot?: string;\n readonly writeMissingSeeds?: boolean;\n} {\n let manifestPath: string | undefined;\n let projectRoot: string | undefined;\n let writeMissingSeeds = false;\n for (let index = 0; index < argv.length; index += 1) {\n const arg = argv[index];\n if (arg === \"--manifest\") {\n manifestPath = argv[index + 1];\n index += 1;\n continue;\n }\n if (arg === \"--project-root\") {\n projectRoot = argv[index + 1];\n index += 1;\n continue;\n }\n if (arg === \"--write-missing-seeds\") {\n writeMissingSeeds = true;\n continue;\n }\n throw new Error(`Unknown argument '${arg}'.`);\n }\n if (!manifestPath) {\n throw new Error(\"--manifest is required.\");\n }\n return {\n manifestPath,\n ...(projectRoot === undefined ? {} : { projectRoot }),\n ...(writeMissingSeeds ? { writeMissingSeeds: true } : {}),\n };\n}\n"],"mappings":";;;;;;;;;;;AAGA,IAAM,UAAU,UAAU,QAAQ,KAAK,MAAM,CAAC,CAAC;AAC/C,IAAM,UAAU,MAAM,qBAAqB,OAAO;AAClD,QAAQ,IAAI,KAAK,UAAU,SAAS,MAAM,CAAC,CAAC;AAE5C,SAAS,UAAU,MAIjB;AACA,MAAI;AACJ,MAAI;AACJ,MAAI,oBAAoB;AACxB,WAAS,QAAQ,GAAG,QAAQ,KAAK,QAAQ,SAAS,GAAG;AACnD,UAAM,MAAM,KAAK,KAAK;AACtB,QAAI,QAAQ,cAAc;AACxB,qBAAe,KAAK,QAAQ,CAAC;AAC7B,eAAS;AACT;AAAA,IACF;AACA,QAAI,QAAQ,kBAAkB;AAC5B,oBAAc,KAAK,QAAQ,CAAC;AAC5B,eAAS;AACT;AAAA,IACF;AACA,QAAI,QAAQ,yBAAyB;AACnC,0BAAoB;AACpB;AAAA,IACF;AACA,UAAM,IAAI,MAAM,qBAAqB,GAAG,IAAI;AAAA,EAC9C;AACA,MAAI,CAAC,cAAc;AACjB,UAAM,IAAI,MAAM,yBAAyB;AAAA,EAC3C;AACA,SAAO;AAAA,IACL;AAAA,IACA,GAAI,gBAAgB,SAAY,CAAC,IAAI,EAAE,YAAY;AAAA,IACnD,GAAI,oBAAoB,EAAE,mBAAmB,KAAK,IAAI,CAAC;AAAA,EACzD;AACF;","names":[]}
|