@playfast/reform-proof 0.0.9 → 0.0.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/package.json +1 -1
- package/src/engine.ts +7 -5
- package/src/index.ts +6 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@playfast/reform-proof",
|
|
3
3
|
"playbook": "./playbook",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.10",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Headless testing toolkit for reform — drive a scene's compositions and assert on the props they compute, with no DOM, timers, or text matching.",
|
|
7
7
|
"keywords": [
|
package/src/engine.ts
CHANGED
|
@@ -67,13 +67,15 @@ const uiNameOf = (comp: CompositionClass<unknown>): string => comp.manifest.ui.m
|
|
|
67
67
|
const eventsOf = (structure: Structure<UiContract>): Record<string, Trigger<unknown>> =>
|
|
68
68
|
Object.fromEntries(Object.entries(structure.events ?? {}))
|
|
69
69
|
|
|
70
|
-
|
|
70
|
+
// Engine SPI (Sink/makeSink/RuntimeServices/proofLayer/makeFacade) — exported for
|
|
71
|
+
// @playfast/reform-drive, which builds the no-ceremony scene driver on the same core.
|
|
72
|
+
export interface Sink {
|
|
71
73
|
readonly api: CaptureSinkApi
|
|
72
74
|
readonly captures: ReadonlyArray<UiCapture>
|
|
73
75
|
reset(): void
|
|
74
76
|
}
|
|
75
77
|
|
|
76
|
-
const makeSink = (): Sink => {
|
|
78
|
+
export const makeSink = (): Sink => {
|
|
77
79
|
// A const holder whose array we swap on reset (no reassigned binding).
|
|
78
80
|
const state: { captures: UiCapture[] } = { captures: [] }
|
|
79
81
|
return {
|
|
@@ -87,7 +89,7 @@ const makeSink = (): Sink => {
|
|
|
87
89
|
}
|
|
88
90
|
}
|
|
89
91
|
|
|
90
|
-
type RuntimeServices = CompositionService | SlotChild | Bus
|
|
92
|
+
export type RuntimeServices = CompositionService | SlotChild | Bus
|
|
91
93
|
|
|
92
94
|
/**
|
|
93
95
|
* Build a proof's runtime layer: the scene's closed wiring with the capture sink
|
|
@@ -99,7 +101,7 @@ type RuntimeServices = CompositionService | SlotChild | Bus
|
|
|
99
101
|
* is the one erasure boundary, the same seam the react host crosses when it reads
|
|
100
102
|
* a slot tag with the requirement erased.
|
|
101
103
|
*/
|
|
102
|
-
const proofLayer = (scene: Scene, sink: Sink): Layer.Layer<RuntimeServices, never, never> => {
|
|
104
|
+
export const proofLayer = (scene: Scene, sink: Sink): Layer.Layer<RuntimeServices, never, never> => {
|
|
103
105
|
const sceneLayer = scene.provide.reduce((a, b) =>
|
|
104
106
|
Layer.merge(a, b),
|
|
105
107
|
) as unknown as Layer.Layer<RuntimeServices, never, never>
|
|
@@ -115,7 +117,7 @@ interface Mounted {
|
|
|
115
117
|
readonly key?: string
|
|
116
118
|
}
|
|
117
119
|
|
|
118
|
-
const makeFacade = (
|
|
120
|
+
export const makeFacade = (
|
|
119
121
|
runtime: ManagedRuntime.ManagedRuntime<RuntimeServices, never>,
|
|
120
122
|
root: CompositionClass<unknown>,
|
|
121
123
|
sink: Sink,
|
package/src/index.ts
CHANGED
|
@@ -26,6 +26,12 @@ import type {
|
|
|
26
26
|
export { ProofRunner, proofRunnerLayer, withProofRunner }
|
|
27
27
|
export type { ProofRunnerApi }
|
|
28
28
|
|
|
29
|
+
// Engine SPI consumed by @playfast/reform-drive — the no-ceremony scene driver builds
|
|
30
|
+
// on the same facade engine. Re-exported from the package index (not the engine
|
|
31
|
+
// subpath) so consumers load the package in its normal init order.
|
|
32
|
+
export { makeFacade, makeSink, proofLayer } from './engine'
|
|
33
|
+
export type { RuntimeServices, Sink } from './engine'
|
|
34
|
+
|
|
29
35
|
// ---------------------------------------------------------------------------
|
|
30
36
|
// Definitions: ProductRequirement + Product
|
|
31
37
|
// ---------------------------------------------------------------------------
|