@adobe/data-testing 0.10.22 → 0.10.24
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/README.md +4 -2
- package/dist/conformance/adapt-spec.d.ts +1 -1
- package/dist/conformance/adapt-spec.js +6 -5
- package/dist/conformance/adapt-spec.js.map +1 -1
- package/dist/conformance/build-double.d.ts +1 -1
- package/dist/conformance/build-double.js +5 -2
- package/dist/conformance/build-double.js.map +1 -1
- package/dist/conformance/build-double.test.js +10 -0
- package/dist/conformance/build-double.test.js.map +1 -1
- package/dist/conformance/check-feature.d.ts +4 -1
- package/dist/conformance/check-feature.js +14 -1
- package/dist/conformance/check-feature.js.map +1 -1
- package/dist/conformance/check-spec.d.ts +4 -1
- package/dist/conformance/check-spec.js +10 -6
- package/dist/conformance/check-spec.js.map +1 -1
- package/dist/conformance/context.test.d.ts +1 -0
- package/dist/conformance/context.test.js +57 -0
- package/dist/conformance/context.test.js.map +1 -0
- package/dist/conformance/implementation.d.ts +5 -2
- package/dist/conformance/implementation.js.map +1 -1
- package/dist/conformance/{feature-spec.d.ts → legacy-feature.d.ts} +12 -2
- package/dist/conformance/{feature-spec.js → legacy-feature.js} +17 -16
- package/dist/conformance/legacy-feature.js.map +1 -0
- package/dist/conformance/legacy-feature.test.d.ts +1 -0
- package/dist/conformance/legacy-feature.test.js +55 -0
- package/dist/conformance/legacy-feature.test.js.map +1 -0
- package/dist/conformance/{feature-spec.type-test.d.ts → legacy-feature.type-test.d.ts} +11 -11
- package/dist/conformance/{feature-spec.type-test.js → legacy-feature.type-test.js} +2 -2
- package/dist/conformance/legacy-feature.type-test.js.map +1 -0
- package/dist/conformance/legacy-run-feature.d.ts +29 -0
- package/dist/conformance/legacy-run-feature.js +63 -0
- package/dist/conformance/legacy-run-feature.js.map +1 -0
- package/dist/conformance/public.d.ts +1 -0
- package/dist/conformance/public.js +3 -0
- package/dist/conformance/public.js.map +1 -1
- package/dist/conformance/run-feature.d.ts +3 -1
- package/dist/conformance/run-feature.js +5 -1
- package/dist/conformance/run-feature.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/package.json +2 -2
- package/dist/conformance/cases.d.ts +0 -39
- package/dist/conformance/cases.js +0 -15
- package/dist/conformance/cases.js.map +0 -1
- package/dist/conformance/cases.type-test.d.ts +0 -29
- package/dist/conformance/cases.type-test.js +0 -38
- package/dist/conformance/cases.type-test.js.map +0 -1
- package/dist/conformance/entity-ref.d.ts +0 -5
- package/dist/conformance/entity-ref.js +0 -28
- package/dist/conformance/entity-ref.js.map +0 -1
- package/dist/conformance/feature-spec.js.map +0 -1
- package/dist/conformance/feature-spec.type-test.js.map +0 -1
package/README.md
CHANGED
|
@@ -57,5 +57,7 @@ Conformance.checkFeature(implementation);
|
|
|
57
57
|
`State`'s keys to the feature's resource and component names.
|
|
58
58
|
- **`Match`** provides tolerant, matcher-aware comparison (`matches`, `ref`,
|
|
59
59
|
`anyNumber`, `anyString`).
|
|
60
|
-
-
|
|
61
|
-
`
|
|
60
|
+
- An action that reads ambient per-case context (a peer `userId`) passes a test
|
|
61
|
+
`concurrency` and a `seedContext` to `Conformance.implementation`.
|
|
62
|
+
- The lower-level runners (`runActions`, `runComputeds`, `runSystems`,
|
|
63
|
+
`runTransactions`, `adaptCases`) remain for custom harnesses.
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
type AnyFn = (...args: never[]) => unknown;
|
|
2
|
-
export declare const adaptCases: (fns: Readonly<Record<string, AnyFn>>, cases: object, services: Readonly<Record<string, () => object>> | undefined, injectServices: boolean) => Record<string, Record<string, unknown>>;
|
|
2
|
+
export declare const adaptCases: (fns: Readonly<Record<string, AnyFn>>, cases: object, services: Readonly<Record<string, () => object>> | undefined, injectServices: boolean, lenientDoubles?: boolean) => Record<string, Record<string, unknown>>;
|
|
3
3
|
export {};
|
|
@@ -5,12 +5,12 @@ import { buildDouble } from "./build-double.js";
|
|
|
5
5
|
// superset): a service a transform calls but the case neither schedules nor asserts
|
|
6
6
|
// must still be present, and an unused one is harmless (its recorded calls aren't
|
|
7
7
|
// asserted). The test-only `responses` channel is dropped — it is not a fn arg.
|
|
8
|
-
const injectDoubles = (testCase, services) => {
|
|
8
|
+
const injectDoubles = (testCase, services, lenient) => {
|
|
9
9
|
const responses = testCase["responses"];
|
|
10
10
|
const args = testCase["args"];
|
|
11
11
|
const built = {};
|
|
12
12
|
for (const [name, template] of Object.entries(services)) {
|
|
13
|
-
built[name] = buildDouble(template, responses?.[name]);
|
|
13
|
+
built[name] = buildDouble(template, responses?.[name], lenient);
|
|
14
14
|
}
|
|
15
15
|
const { responses: _responses, args: _args, ...rest } = testCase;
|
|
16
16
|
return { ...rest, args: { ...built, ...(args ?? {}) } };
|
|
@@ -23,8 +23,9 @@ const injectDoubles = (testCase, services) => {
|
|
|
23
23
|
// bridge from inert, data-only cases to the unchanged runners: the pure spec and the
|
|
24
24
|
// ecs action side adapt WITH services (each side builds its own fresh doubles, so
|
|
25
25
|
// their FIFO schedules never cross); the ecs transaction side adapts WITHOUT (a
|
|
26
|
-
// transaction is a pure store mutation and never receives services).
|
|
27
|
-
|
|
26
|
+
// transaction is a pure store mutation and never receives services). `lenientDoubles`
|
|
27
|
+
// builds the deprecated `Conformance.feature` path's doubles (see `buildDouble`).
|
|
28
|
+
export const adaptCases = (fns, cases, services, injectServices, lenientDoubles = false) => {
|
|
28
29
|
const out = {};
|
|
29
30
|
for (const [name, fn] of Object.entries(fns)) {
|
|
30
31
|
// Runtime invariant: a manifest's `cases` holds one case module per fn (the
|
|
@@ -36,7 +37,7 @@ export const adaptCases = (fns, cases, services, injectServices) => {
|
|
|
36
37
|
out[`./${name}`] = { [name]: fn, cases: { cases: list } };
|
|
37
38
|
continue;
|
|
38
39
|
}
|
|
39
|
-
const adapted = injectServices && services ? list.map((testCase) => injectDoubles(testCase, services)) : list;
|
|
40
|
+
const adapted = injectServices && services ? list.map((testCase) => injectDoubles(testCase, services, lenientDoubles)) : list;
|
|
40
41
|
out[`./${name}`] = {
|
|
41
42
|
[name]: fn,
|
|
42
43
|
cases: module.args ? { args: module.args, cases: adapted } : { cases: adapted },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapt-spec.js","sourceRoot":"","sources":["../../src/conformance/adapt-spec.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAiB,MAAM,mBAAmB,CAAC;AAQ/D,oFAAoF;AACpF,8EAA8E;AAC9E,mFAAmF;AACnF,oFAAoF;AACpF,kFAAkF;AAClF,gFAAgF;AAChF,MAAM,aAAa,GAAG,CACpB,QAAiC,EACjC,QAAgD,
|
|
1
|
+
{"version":3,"file":"adapt-spec.js","sourceRoot":"","sources":["../../src/conformance/adapt-spec.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAiB,MAAM,mBAAmB,CAAC;AAQ/D,oFAAoF;AACpF,8EAA8E;AAC9E,mFAAmF;AACnF,oFAAoF;AACpF,kFAAkF;AAClF,gFAAgF;AAChF,MAAM,aAAa,GAAG,CACpB,QAAiC,EACjC,QAAgD,EAChD,OAAgB,EACS,EAAE;IAC3B,MAAM,SAAS,GAAG,QAAQ,CAAC,WAAW,CAAmD,CAAC;IAC1F,MAAM,IAAI,GAAG,QAAQ,CAAC,MAAM,CAAuB,CAAC;IACpD,MAAM,KAAK,GAA2B,EAAE,CAAC;IACzC,KAAK,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;QACxD,KAAK,CAAC,IAAI,CAAC,GAAG,WAAW,CAAC,QAAQ,EAAE,SAAS,EAAE,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC,CAAC;IAClE,CAAC;IACD,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,GAAG,QAAQ,CAAC;IACjE,OAAO,EAAE,GAAG,IAAI,EAAE,IAAI,EAAE,EAAE,GAAG,K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M,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE;SAChF,CAAC;IACJ,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export type Schedule = Readonly<Record<string, readonly unknown[]>>;
|
|
2
|
-
export declare const buildDouble: (template: () => object, responses: Schedule | undefined) => object;
|
|
2
|
+
export declare const buildDouble: (template: () => object, responses: Schedule | undefined, lenient?: boolean) => object;
|
|
@@ -9,14 +9,17 @@
|
|
|
9
9
|
//
|
|
10
10
|
// The returned double still gets wrapped by `recordCalls` on its way into a case's
|
|
11
11
|
// args, so effect assertion is unchanged; only the RETURNS come from the case.
|
|
12
|
-
|
|
12
|
+
//
|
|
13
|
+
// `lenient` (the deprecated `Conformance.feature` path) skips the probe: an
|
|
14
|
+
// unscheduled call returns `undefined`, whatever the method.
|
|
15
|
+
export const buildDouble = (template, responses, lenient = false) => {
|
|
13
16
|
const shape = template();
|
|
14
17
|
const service = "serviceName" in shape ? String(shape.serviceName) : "service";
|
|
15
18
|
const queues = new Map(Object.entries(responses ?? {}).map(([method, schedule]) => [method, [...schedule]]));
|
|
16
19
|
return Object.fromEntries(Object.entries(shape).map(([key, value]) => {
|
|
17
20
|
if (typeof value !== "function")
|
|
18
21
|
return [key, value]; // serviceName and other non-method members pass through
|
|
19
|
-
const returnsValue = value() !== undefined;
|
|
22
|
+
const returnsValue = !lenient && value() !== undefined;
|
|
20
23
|
return [
|
|
21
24
|
key,
|
|
22
25
|
(..._args) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-double.js","sourceRoot":"","sources":["../../src/conformance/build-double.ts"],"names":[],"mappings":"AAAA,uDAAuD;AAMvD,mFAAmF;AACnF,iFAAiF;AACjF,sFAAsF;AACtF,qFAAqF;AAC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AAK,SAAS,CAAC;QAC1E,OAAO;YACL,GAAG;YACH,CAAC,GAAG,KAAgB,EAAW,EAAE;gBAC/B,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;gBAC9B,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;oBACxB,IAAI,CAAC,YAAY;wBAAE,OAAO,SAAS,CAAC,CAAC,gBAAgB;oBACrD,MAAM,IAAI,KAAK,CAAC,8BAA8B,OAAO,IAAI,GAAG,mCAAmC,CAAC,CAAC;gBACnG,CAAC;gBACD,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;oBAAE,MAAM,IAAI,KAAK,CAAC,oCAAoC,OAAO,IAAI,GAAG,GAAG,CAAC,CAAC;gBAC/F,OAAO,KAAK,CAAC,KAAK,EAAE,CAAC;YACvB,CAAC;SACF,CAAC;IACJ,CAAC,CAAC,CACH,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -26,5 +26,15 @@ describe("buildDouble", () => {
|
|
|
26
26
|
const double = buildDouble(template, undefined);
|
|
27
27
|
expect(double.log()).toBeUndefined();
|
|
28
28
|
});
|
|
29
|
+
it("returns undefined for an unscheduled value method when lenient", () => {
|
|
30
|
+
const double = buildDouble(template, undefined, true);
|
|
31
|
+
expect(double.next()).toBeUndefined();
|
|
32
|
+
expect(double.fetch()).toBeUndefined();
|
|
33
|
+
});
|
|
34
|
+
it("still throws once a lenient schedule is exhausted", () => {
|
|
35
|
+
const double = buildDouble(template, { next: [1] }, true);
|
|
36
|
+
double.next();
|
|
37
|
+
expect(() => double.next()).toThrow('response schedule exhausted for "rng.next"');
|
|
38
|
+
});
|
|
29
39
|
});
|
|
30
40
|
//# sourceMappingURL=build-double.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-double.test.js","sourceRoot":"","sources":["../../src/conformance/build-double.test.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,OAAO,EAAE,QAAQ,EAAE,EAAE,EA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,MAAM,GAAG,WAAW,CAAC,QAAQ,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,IAAI,CAAQ,CAAC;QACjE,MAAM,CAAC,IAAI,EAAE,CAAC;QACd,MAAM,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,4CAA4C,CAAC,CAAC;IACpF,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import type { SchemaSource } from "./refify.js";
|
|
2
2
|
import type { Implementation } from "./implementation.js";
|
|
3
|
+
import { type FeatureSpec } from "./legacy-feature.js";
|
|
3
4
|
type AnyFn = (...args: never[]) => unknown;
|
|
4
|
-
export declare
|
|
5
|
+
export declare function checkFeature<State extends object, Fns extends Record<string, AnyFn>, StoreT extends SchemaSource>(impl: Implementation<State, Fns, StoreT>): void;
|
|
6
|
+
/** @deprecated Pass a `Conformance.implementation` manifest. */
|
|
7
|
+
export declare function checkFeature<State extends object, Fns extends Record<string, AnyFn>, StoreT extends SchemaSource>(spec: FeatureSpec<State, Fns, StoreT>): void;
|
|
5
8
|
export {};
|
|
@@ -4,6 +4,7 @@ import { runFeature } from "./run-feature.js";
|
|
|
4
4
|
import { runSystems } from "./run-systems.js";
|
|
5
5
|
import { adaptCases } from "./adapt-spec.js";
|
|
6
6
|
import { withNoOp } from "./with-no-op.js";
|
|
7
|
+
import { checkLegacyFeature } from "./legacy-feature.js";
|
|
7
8
|
// Frame cases with recording doubles injected into their `args`, as `adaptCases` does
|
|
8
9
|
// for an op's cases.
|
|
9
10
|
const frameCasesOf = (frame, services) => {
|
|
@@ -16,7 +17,7 @@ const frameCasesOf = (frame, services) => {
|
|
|
16
17
|
// The ecs conformance suite: the spec's cases drive the implementation's actions and
|
|
17
18
|
// computeds (fresh doubles again, so the pure and ecs runs never share FIFO state).
|
|
18
19
|
// A spec op with no same-named implementation is a named failure.
|
|
19
|
-
|
|
20
|
+
const checkImplementation = (impl) => {
|
|
20
21
|
const { spec } = impl;
|
|
21
22
|
runFeature({
|
|
22
23
|
state: spec.state,
|
|
@@ -26,6 +27,9 @@ export const checkFeature = (impl) => {
|
|
|
26
27
|
projection: impl.projection,
|
|
27
28
|
hydrate: impl.hydrate,
|
|
28
29
|
services: impl.services,
|
|
30
|
+
concurrency: impl.concurrency,
|
|
31
|
+
// Runtime invariant: `implementation` types `seedContext` against this plugin's db.
|
|
32
|
+
seedContext: impl.seedContext,
|
|
29
33
|
match: spec.match,
|
|
30
34
|
ops: impl.ops,
|
|
31
35
|
});
|
|
@@ -47,4 +51,13 @@ export const checkFeature = (impl) => {
|
|
|
47
51
|
});
|
|
48
52
|
}
|
|
49
53
|
};
|
|
54
|
+
export function checkFeature(manifest) {
|
|
55
|
+
if (isImplementation(manifest))
|
|
56
|
+
checkImplementation(manifest);
|
|
57
|
+
else
|
|
58
|
+
checkLegacyFeature(manifest);
|
|
59
|
+
}
|
|
60
|
+
// Runtime invariant: a `Conformance.implementation` wraps its pure manifest in `spec`;
|
|
61
|
+
// a `Conformance.feature` manifest is flat and has no `spec` member.
|
|
62
|
+
const isImplementation = (manifest) => "spec" in manifest;
|
|
50
63
|
//# sourceMappingURL=check-feature.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check-feature.js","sourceRoot":"","sources":["../../src/conformance/check-feature.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAwC,MAAM,kBAAkB,CAAC;AACpF,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"check-feature.js","sourceRoot":"","sources":["../../src/conformance/check-feature.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AAC;YAChE,iFAAiF;YACjF,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,IAAa;YAC9B,UAAU,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,IAAI,EAAE;YACvC,KAAK,EAAE,IAAI,CAAC,KAAK;SAClB,CAAC,CAAC;IACL,CAAC;AACH,CAAC,CAAC;AASF,MAAM,UAAU,YAAY,CAC1B,QAAgI;IAEhI,IAAI,gBAAgB,CAAC,QAAQ,CAAC;QAAE,mBAAmB,CAAC,QAAQ,CAAC,CAAC;;QACzD,kBAAkB,CAAC,QAAQ,CAAC,CAAC;AACpC,CAAC;AAED,uFAAuF;AACvF,qEAAqE;AACrE,MAAM,gBAAgB,GAAG,CACvB,QAAgI,EACvD,EAAE,CAAC,MAAM,IAAI,QAAQ,CAAC"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import type { Spec } from "./spec.js";
|
|
2
|
+
import { type FeatureSpec } from "./legacy-feature.js";
|
|
2
3
|
type AnyFn = (...args: never[]) => unknown;
|
|
3
|
-
export declare
|
|
4
|
+
export declare function checkSpec<State extends object, Fns extends Record<string, AnyFn>, C extends object, Sys extends Record<string, AnyFn>>(spec: Spec<State, Fns, C, Sys>): void;
|
|
5
|
+
/** @deprecated Pass a `Conformance.spec` manifest. */
|
|
6
|
+
export declare function checkSpec<State extends object, Fns extends Record<string, AnyFn>, StoreT>(spec: FeatureSpec<State, Fns, StoreT>): void;
|
|
4
7
|
export {};
|
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
import { runSpec } from "./run-spec.js";
|
|
3
3
|
import { adaptCases } from "./adapt-spec.js";
|
|
4
4
|
import { withNoOp } from "./with-no-op.js";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
import { checkLegacySpec } from "./legacy-feature.js";
|
|
6
|
+
export function checkSpec(spec) {
|
|
7
|
+
if (isLegacy(spec)) {
|
|
8
|
+
checkLegacySpec(spec);
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
10
11
|
runSpec({
|
|
11
12
|
state: spec.state,
|
|
12
13
|
transitions: {
|
|
@@ -16,5 +17,8 @@ export const checkSpec = (spec) => {
|
|
|
16
17
|
schemas: spec.schemas,
|
|
17
18
|
match: spec.match,
|
|
18
19
|
});
|
|
19
|
-
}
|
|
20
|
+
}
|
|
21
|
+
// Runtime invariant: only a `Conformance.feature` manifest carries the plugin; a
|
|
22
|
+
// `Conformance.spec` is pure and never has one.
|
|
23
|
+
const isLegacy = (spec) => "plugin" in spec;
|
|
20
24
|
//# sourceMappingURL=check-spec.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check-spec.js","sourceRoot":"","sources":["../../src/conformance/check-spec.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"check-spec.js","sourceRoot":"","sources":["../../src/conformance/check-spec.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3C,OAAO,EAAE,eAAe,EAAoB,MAAM,qBAAqB,CAAC;AAaxE,MAAM,UAAU,SAAS,CACvB,IAA8H;IAE9H,IAAI,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;QACnB,eAAe,CAAC,IAAI,CAAC,CAAC;QACtB,OAAO;IACT,CAAC;IACD,OAAO,CAAC;QACN,KAAK,EAAE,IAAI,CAAC,KAAK;QACjB,WAAW,EAAE;YACX,GAAG,UAAU,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC;YACxD,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;SAC5H;QACD,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,KAAK,EAAE,IAAI,CAAC,KAAK;KAClB,CAAC,CAAC;AACL,CAAC;AAED,iFAAiF;AACjF,gDAAgD;AAChD,MAAM,QAAQ,GAAG,CACf,IAA8H,EACjE,EAAE,CAAC,QAAQ,IAAI,IAAI,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
// © 2026 Adobe. MIT License. See /LICENSE for details.
|
|
2
|
+
// An action that reads ambient context the spec can't carry (the acting peer's
|
|
3
|
+
// `userId`) conforms through `checkFeature`: `seedContext` primes a test concurrency
|
|
4
|
+
// that stamps the `userId` at dispatch.
|
|
5
|
+
import { Database } from "@adobe/data/ecs";
|
|
6
|
+
import { spec } from "./spec.js";
|
|
7
|
+
import { implementation } from "./implementation.js";
|
|
8
|
+
import { checkFeature } from "./check-feature.js";
|
|
9
|
+
const move = (_state, { peer }) => ({ lastMover: peer });
|
|
10
|
+
const plugin = Database.Plugin.create({
|
|
11
|
+
resources: { lastMover: { default: "" } },
|
|
12
|
+
transactions: {
|
|
13
|
+
move: (t) => {
|
|
14
|
+
t.resources.lastMover = String(t.userId ?? "");
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
actions: {
|
|
18
|
+
move: (db, _args) => {
|
|
19
|
+
db.transactions.move();
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
let peer;
|
|
24
|
+
const peerConcurrency = (execute, getTransaction) => ({
|
|
25
|
+
deferredCommit: false,
|
|
26
|
+
apply: (envelope) => {
|
|
27
|
+
if (envelope.time === 0)
|
|
28
|
+
return undefined;
|
|
29
|
+
const transaction = getTransaction(envelope.name);
|
|
30
|
+
if (!transaction)
|
|
31
|
+
throw new Error(`Unknown transaction: ${envelope.name}`);
|
|
32
|
+
return execute((t) => transaction(t, envelope.args), { intermediate: envelope.time < 0, userId: peer });
|
|
33
|
+
},
|
|
34
|
+
cancel: () => { },
|
|
35
|
+
onReset: () => { },
|
|
36
|
+
});
|
|
37
|
+
const cases = {
|
|
38
|
+
cases: [
|
|
39
|
+
{ name: "records the acting peer", before: {}, args: { peer: "X" }, after: { lastMover: "X" } },
|
|
40
|
+
{ name: "records another peer", before: { lastMover: "X" }, args: { peer: "O" }, after: { lastMover: "O" } },
|
|
41
|
+
],
|
|
42
|
+
};
|
|
43
|
+
checkFeature(implementation(spec({ state: { create: () => ({ lastMover: "" }) }, fns: { move }, cases: { move: cases } }), {
|
|
44
|
+
plugin,
|
|
45
|
+
projection: {
|
|
46
|
+
fromState: (store, state) => {
|
|
47
|
+
store.resources.lastMover = state.lastMover;
|
|
48
|
+
},
|
|
49
|
+
toState: (store) => ({ lastMover: store.resources.lastMover }),
|
|
50
|
+
},
|
|
51
|
+
concurrency: peerConcurrency,
|
|
52
|
+
seedContext: (_db, _before, args) => {
|
|
53
|
+
// Runtime invariant: every `move` case's args carry its `peer`.
|
|
54
|
+
peer = args.peer;
|
|
55
|
+
},
|
|
56
|
+
}));
|
|
57
|
+
//# sourceMappingURL=context.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.test.js","sourceRoot":"","sources":["../../src/conformance/context.test.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,+EAA+E;AAC/E,qFAAqF;AACrF,wCAAwC;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3C,OAAO,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AAE;QAClC,gEAAgE;QAChE,IAAI,GAAI,IAAkC,CAAC,IAAI,CAAC;IAClD,CAAC;CACF,CAAC,CACH,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Database } from "@adobe/data/ecs";
|
|
1
|
+
import type { ConcurrencyStrategyFactory, Database } from "@adobe/data/ecs";
|
|
2
2
|
import type { HasDerivations, HydrateExact, HydrationKeys, ProjectionShape, ProjectionStore, ProjectionValue } from "./feature-types.js";
|
|
3
3
|
import type { Projection } from "./run-feature.js";
|
|
4
4
|
import type { Spec } from "./spec.js";
|
|
@@ -16,13 +16,16 @@ export interface Implementation<State extends object, Fns extends Record<string,
|
|
|
16
16
|
readonly projection: Projection<StoreT, State>;
|
|
17
17
|
readonly hydrate?: readonly string[];
|
|
18
18
|
readonly services?: Readonly<Record<string, () => object>>;
|
|
19
|
+
readonly concurrency?: ConcurrencyStrategyFactory;
|
|
20
|
+
readonly seedContext?: (db: never, before: State, args: unknown) => void;
|
|
19
21
|
readonly ops?: {
|
|
20
22
|
readonly actions?: Record<string, unknown>;
|
|
21
23
|
readonly computeds?: Record<string, unknown>;
|
|
22
24
|
};
|
|
23
25
|
}
|
|
24
|
-
export declare const implementation: <State extends object, Fns extends Record<string, AnyFn>, C extends object, P extends ProjectionShape<State>, const H extends readonly Extract<keyof Fns, string>[] = readonly [], PL extends Database.Plugin = Database.Plugin, Sys extends Record<string, AnyFn> = {}, U extends string = never>(spec: Spec<State, Fns, C, Sys>, impl: Omit<Implementation<State, Fns, ProjectionStore<P>>, "spec" | "plugin" | "projection" | "hydrate" | "computedPlugin" | "frame"> & {
|
|
26
|
+
export declare const implementation: <State extends object, Fns extends Record<string, AnyFn>, C extends object, P extends ProjectionShape<State>, const H extends readonly Extract<keyof Fns, string>[] = readonly [], PL extends Database.Plugin = Database.Plugin, Sys extends Record<string, AnyFn> = {}, U extends string = never>(spec: Spec<State, Fns, C, Sys>, impl: Omit<Implementation<State, Fns, ProjectionStore<P>>, "spec" | "plugin" | "projection" | "hydrate" | "computedPlugin" | "frame" | "seedContext"> & {
|
|
25
27
|
readonly plugin: PL;
|
|
28
|
+
readonly seedContext?: (db: Database.Plugin.ToSystemDatabase<PL>, before: State, args: unknown) => void;
|
|
26
29
|
readonly projection: P;
|
|
27
30
|
readonly hydrate?: H;
|
|
28
31
|
} & (HasDerivations<C> extends true ? {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"implementation.js","sourceRoot":"","sources":["../../src/conformance/implementation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"implementation.js","sourceRoot":"","sources":["../../src/conformance/implementation.ts"],"names":[],"mappings":"AAwDA,kFAAkF;AAClF,kFAAkF;AAClF,+EAA+E;AAC/E,uFAAuF;AACvF,2EAA2E;AAC3E,MAAM,CAAC,MAAM,cAAc,GAAG,CAU5B,IAA8B,EAC9B,IAeQ,EACwC,EAAE;AAClD,wEAAwE;AACxE,qFAAqF;AACrF,uDAAuD;AACvD,CAAC,EAAE,GAAG,IAAI,EAAE,IAAI,EAAE,CAA8D,CAAC"}
|
|
@@ -4,6 +4,13 @@ import type { CaseModule, HasDerivations, HydrateExact, HydrationKeys, Projectio
|
|
|
4
4
|
import type { Projection } from "./run-feature.js";
|
|
5
5
|
import type { SchemaSource } from "./refify.js";
|
|
6
6
|
type AnyFn = (...args: never[]) => unknown;
|
|
7
|
+
/**
|
|
8
|
+
* @deprecated One feature's whole conformance declaration in the state-based layout,
|
|
9
|
+
* imported by both `spec.test.ts` (pure) and `conformance.test.ts` (ecs). Spec
|
|
10
|
+
* transitions conform against same-named transactions AND actions, and unscheduled
|
|
11
|
+
* double calls return `undefined`. New features author a `Conformance.spec` plus a
|
|
12
|
+
* `Conformance.implementation`.
|
|
13
|
+
*/
|
|
7
14
|
export interface FeatureSpec<State extends object, Fns extends Record<string, AnyFn>, StoreT> {
|
|
8
15
|
readonly state: {
|
|
9
16
|
create(): State;
|
|
@@ -25,6 +32,9 @@ export interface FeatureSpec<State extends object, Fns extends Record<string, An
|
|
|
25
32
|
readonly computeds?: Record<string, unknown>;
|
|
26
33
|
};
|
|
27
34
|
}
|
|
35
|
+
/**
|
|
36
|
+
* @deprecated Use `Conformance.spec` and `Conformance.implementation`.
|
|
37
|
+
*/
|
|
28
38
|
export declare const feature: <State extends object, Fns extends Record<string, AnyFn>, P extends ProjectionShape<State>, C extends { readonly [K in keyof Fns]: CaseModule<State, Fns[K]>; }, const H extends readonly Extract<keyof Fns, string>[] = readonly []>(spec: Omit<FeatureSpec<State, Fns, ProjectionStore<P>>, "projection" | "cases" | "hydrate" | "services" | "computedPlugin"> & {
|
|
29
39
|
readonly projection: P;
|
|
30
40
|
readonly cases: C;
|
|
@@ -37,6 +47,6 @@ export declare const feature: <State extends object, Fns extends Record<string,
|
|
|
37
47
|
readonly __casesError: "a case module names something that is not a conformed fn";
|
|
38
48
|
readonly extra: Exclude<keyof C, keyof Fns>;
|
|
39
49
|
}) & HydrateExact<H, HydrationKeys<Fns, ProjectionValue<P>>>) => FeatureSpec<State, Fns, ProjectionStore<P>>;
|
|
40
|
-
export declare const
|
|
41
|
-
export declare const
|
|
50
|
+
export declare const checkLegacySpec: <State extends object, Fns extends Record<string, AnyFn>, StoreT>(spec: FeatureSpec<State, Fns, StoreT>) => void;
|
|
51
|
+
export declare const checkLegacyFeature: <State extends object, Fns extends Record<string, AnyFn>, StoreT extends SchemaSource>(spec: FeatureSpec<State, Fns, StoreT>) => void;
|
|
42
52
|
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { Store } from "@adobe/data/ecs";
|
|
1
2
|
import { runSpec } from "./run-spec.js";
|
|
2
|
-
import {
|
|
3
|
+
import { runLegacyFeature } from "./legacy-run-feature.js";
|
|
3
4
|
import { adaptCases } from "./adapt-spec.js";
|
|
4
5
|
// Author a feature's conformance manifest. Purely a typed identity — it exists so the
|
|
5
6
|
// generics infer from the argument and arm the compile-time guards. `P` (projection)
|
|
@@ -15,6 +16,9 @@ import { adaptCases } from "./adapt-spec.js";
|
|
|
15
16
|
// • `computedPlugin` requiredness — required when any authored case module is a
|
|
16
17
|
// derivation (`HasDerivations<C>`), so a feature with derivations can't silently skip
|
|
17
18
|
// its computed conformance by omitting the plugin.
|
|
19
|
+
/**
|
|
20
|
+
* @deprecated Use `Conformance.spec` and `Conformance.implementation`.
|
|
21
|
+
*/
|
|
18
22
|
export const feature = (spec) =>
|
|
19
23
|
// Runtime invariant the checker can't see: the constrained param IS this FeatureSpec
|
|
20
24
|
// (`P` widens to the stored `Projection`, `C` to the `cases` mapped type, `H` to
|
|
@@ -22,26 +26,23 @@ export const feature = (spec) =>
|
|
|
22
26
|
// factors are compile-only phantoms with no runtime shape, and together they defeat
|
|
23
27
|
// TS's structural-overlap check for a direct `as`, so this goes through `unknown`.
|
|
24
28
|
spec;
|
|
25
|
-
// The pure-spec suite for a manifest
|
|
26
|
-
//
|
|
27
|
-
//
|
|
28
|
-
|
|
29
|
-
export const checkSpec = (spec) => {
|
|
29
|
+
// The pure-spec suite for a manifest (`checkSpec` dispatches here): fresh lenient
|
|
30
|
+
// doubles per case, and reference-field schemas read from the plugin through a
|
|
31
|
+
// throwaway store.
|
|
32
|
+
export const checkLegacySpec = (spec) => {
|
|
30
33
|
runSpec({
|
|
31
34
|
state: spec.state,
|
|
32
|
-
transitions: adaptCases(spec.fns, spec.cases, spec.services, true),
|
|
33
|
-
|
|
35
|
+
transitions: adaptCases(spec.fns, spec.cases, spec.services, true, true),
|
|
36
|
+
schemas: Store.create(spec.plugin).componentSchemas,
|
|
34
37
|
match: spec.match,
|
|
35
38
|
});
|
|
36
39
|
};
|
|
37
|
-
// The ecs
|
|
38
|
-
//
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
export const checkFeature = (spec) => {
|
|
42
|
-
runFeature({
|
|
40
|
+
// The ecs suite for a manifest (`checkFeature` dispatches here): transactions ignore
|
|
41
|
+
// the injected services; actions consume each case's response schedule.
|
|
42
|
+
export const checkLegacyFeature = (spec) => {
|
|
43
|
+
runLegacyFeature({
|
|
43
44
|
state: spec.state,
|
|
44
|
-
transitions: adaptCases(spec.fns, spec.cases, spec.services, true),
|
|
45
|
+
transitions: adaptCases(spec.fns, spec.cases, spec.services, true, true),
|
|
45
46
|
plugin: spec.plugin,
|
|
46
47
|
computedPlugin: spec.computedPlugin,
|
|
47
48
|
projection: spec.projection,
|
|
@@ -50,4 +51,4 @@ export const checkFeature = (spec) => {
|
|
|
50
51
|
ops: spec.ops,
|
|
51
52
|
});
|
|
52
53
|
};
|
|
53
|
-
//# sourceMappingURL=feature
|
|
54
|
+
//# sourceMappingURL=legacy-feature.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"legacy-feature.js","sourceRoot":"","sources":["../../src/conformance/legacy-feature.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAsC7C,sFAAsF;AACtF,qFAAqF;AACrF,qFAAqF;AACrF,mBAAmB;AACnB,wFAAwF;AACxF,uFAAuF;AACvF,uCAAuC;AACvC,0FAA0F;AAC1F,sFAAsF;AACtF,wFAAwF;AACxF,uBAAuB;AACvB,kFAAkF;AAClF,0FAA0F;AAC1F,uDAAuD;AACvD;;GAEG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,CAOrB,IASyD,EACZ,EAAE;AAC/C,qFAAqF;AACrF,iFAAiF;AACjF,uFAAuF;AACvF,oFAAoF;AACpF,mFAAmF;AACnF,IAA8D,CAAC;AAEjE,kFAAkF;AAClF,+EAA+E;AAC/E,mBAAmB;AACnB,MAAM,CAAC,MAAM,eAAe,GAAG,CAC7B,IAAqC,EAC/B,EAAE;IACR,OAAO,CAAC;QACN,KAAK,EAAE,IAAI,CAAC,KAAK;QACjB,WAAW,EAAE,UAAU,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,EAAE,IAAI,CAAC;QACxE,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,MAAe,CAAC,CAAC,gBAAgB;QAC5D,KAAK,EAAE,IAAI,CAAC,KAAK;KAClB,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,qFAAqF;AACrF,wEAAwE;AACxE,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAChC,IAAqC,EAC/B,EAAE;IACR,gBAAgB,CAAmC;QACjD,KAAK,EAAE,IAAI,CAAC,KAAK;QACjB,WAAW,EAAE,UAAU,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,EAAE,IAAI,CAAC;QACxE,MAAM,EAAE,IAAI,CAAC,MAAM;QACnB,cAAc,EAAE,IAAI,CAAC,cAAc;QACnC,UAAU,EAAE,IAAI,CAAC,UAAU;QAC3B,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,KAAK,EAAE,IAAI,CAAC,KAAK;QACjB,GAAG,EAAE,IAAI,CAAC,GAAG;KACd,CAAC,CAAC;AACL,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
// © 2026 Adobe. MIT License. See /LICENSE for details.
|
|
2
|
+
// The deprecated `Conformance.feature` manifest still conforms through `checkSpec` and
|
|
3
|
+
// `checkFeature` with its original semantics: `bump` is covered only by a same-named
|
|
4
|
+
// transaction (no action), and `relabel` calls a value method no case schedules, which
|
|
5
|
+
// the lenient doubles answer with `undefined`.
|
|
6
|
+
import { Database } from "@adobe/data/ecs";
|
|
7
|
+
import { feature } from "./legacy-feature.js";
|
|
8
|
+
import { checkSpec } from "./check-spec.js";
|
|
9
|
+
import { checkFeature } from "./check-feature.js";
|
|
10
|
+
const bump = (state, { by }) => ({ count: state.count + by });
|
|
11
|
+
const relabel = (_state, { namer }) => ({ label: namer.next() ?? "unnamed" });
|
|
12
|
+
const createNamer = () => ({ serviceName: "namer", next: () => "fake" });
|
|
13
|
+
const plugin = Database.Plugin.create({
|
|
14
|
+
services: { namer: () => createNamer() },
|
|
15
|
+
resources: { count: { default: 0 }, label: { default: "" } },
|
|
16
|
+
transactions: {
|
|
17
|
+
bump: (t, { by }) => {
|
|
18
|
+
t.resources.count += by;
|
|
19
|
+
},
|
|
20
|
+
setLabel: (t, label) => {
|
|
21
|
+
t.resources.label = label;
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
actions: {
|
|
25
|
+
relabel: (db) => {
|
|
26
|
+
db.transactions.setLabel(db.services.namer.next() ?? "unnamed");
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
const bumpCases = {
|
|
31
|
+
cases: [{ name: "adds", before: { count: 1 }, args: { by: 2 }, after: { count: 3 } }],
|
|
32
|
+
};
|
|
33
|
+
const relabelCases = {
|
|
34
|
+
cases: [
|
|
35
|
+
{ name: "uses the scheduled name", before: {}, responses: { namer: { next: ["Ada"] } }, after: { label: "Ada" } },
|
|
36
|
+
{ name: "falls back when nothing is scheduled", before: {}, after: { label: "unnamed" } },
|
|
37
|
+
],
|
|
38
|
+
};
|
|
39
|
+
const manifest = feature({
|
|
40
|
+
state: { create: () => ({ count: 0, label: "" }), samples: [{ count: 4, label: "x" }] },
|
|
41
|
+
fns: { bump, relabel },
|
|
42
|
+
cases: { bump: bumpCases, relabel: relabelCases },
|
|
43
|
+
services: { namer: createNamer },
|
|
44
|
+
plugin,
|
|
45
|
+
projection: {
|
|
46
|
+
fromState: (store, state) => {
|
|
47
|
+
store.resources.count = state.count;
|
|
48
|
+
store.resources.label = state.label;
|
|
49
|
+
},
|
|
50
|
+
toState: (store) => ({ count: store.resources.count, label: store.resources.label }),
|
|
51
|
+
},
|
|
52
|
+
});
|
|
53
|
+
checkSpec(manifest);
|
|
54
|
+
checkFeature(manifest);
|
|
55
|
+
//# sourceMappingURL=legacy-feature.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"legacy-feature.test.js","sourceRoot":"","sources":["../../src/conformance/legacy-feature.test.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,uFAAuF;AACvF,qFAAqF;AACrF,uFAAuF;AACvF,+CAA+C;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAUlD,MAAM,IAAI,GAAG,CAAC,KAA2B,EAAE,EAAE,EAAE,EAA2B,EAAwB,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,GAAG,EAAE,EAAE,CAAC,CAAC;AACnI,MAAM,OAAO,GAAG,CAAC,MAAa,EAAE,EAAE,KAAK,EAA6B,EAAwB,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,IAAI,EAAE,IAAI,SAAS,EAAE,CAAC,CAAC;AAEtI,MAAM,WAAW,GAAG,GAAU,EAAE,CAAC,CAAC,EAAE,WAAW,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC;AAEhF,MAAM,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC;IACpC,QAAQ,EAAE,EAAE,KAAK,EAAE,GAAU,EAAE,CAAC,WAAW,EAAE,EAAE;IAC/C,SAAS,EAAE,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,CAAW,EAAE,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,EAAY,EAAE,EAAE;IAChF,YAAY,EAAE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AAC,EAAE,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,EAAE;IAC9F,GAAG,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE;IACtB,KAAK,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,YAAY,EAAE;IACjD,QAAQ,EAAE,EAAE,KAAK,EAAE,WAAW,EAAE;IAChC,MAAM;IACN,UAAU,EAAE;QACV,SAAS,EAAE,CAAC,KAAY,EAAE,KAAY,EAAQ,EAAE;YAC9C,KAAK,CAAC,SAAS,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;YACpC,KAAK,CAAC,SAAS,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;QACtC,CAAC;QACD,OAAO,EAAE,CAAC,KAAY,EAAS,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC;KACnG;CACF,CAAC,CAAC;AAEH,SAAS,CAAC,QAAQ,CAAC,CAAC;AACpB,YAAY,CAAC,QAAQ,CAAC,CAAC"}
|
|
@@ -13,31 +13,31 @@ declare const listFoos: (s: Pick<State, "entities">) => readonly Foo[];
|
|
|
13
13
|
interface Store {
|
|
14
14
|
readonly componentSchemas: Record<string, unknown>;
|
|
15
15
|
}
|
|
16
|
-
export declare const ok: import("./feature
|
|
16
|
+
export declare const ok: import("./legacy-feature.js").FeatureSpec<State, {
|
|
17
17
|
bump: (s: Pick<State, "count">, args: {
|
|
18
18
|
readonly by: number;
|
|
19
19
|
}) => Pick<State, "count">;
|
|
20
20
|
listFoos: (s: Pick<State, "entities">) => readonly Foo[];
|
|
21
21
|
}, Store>;
|
|
22
|
-
export declare const missingCase: import("./feature
|
|
22
|
+
export declare const missingCase: import("./legacy-feature.js").FeatureSpec<State, {
|
|
23
23
|
bump: (s: Pick<State, "count">, args: {
|
|
24
24
|
readonly by: number;
|
|
25
25
|
}) => Pick<State, "count">;
|
|
26
26
|
listFoos: (s: Pick<State, "entities">) => readonly Foo[];
|
|
27
27
|
}, Store>;
|
|
28
|
-
export declare const extraCase: import("./feature
|
|
28
|
+
export declare const extraCase: import("./legacy-feature.js").FeatureSpec<State, {
|
|
29
29
|
bump: (s: Pick<State, "count">, args: {
|
|
30
30
|
readonly by: number;
|
|
31
31
|
}) => Pick<State, "count">;
|
|
32
32
|
listFoos: (s: Pick<State, "entities">) => readonly Foo[];
|
|
33
33
|
}, Store>;
|
|
34
|
-
export declare const missingHydrate: import("./feature
|
|
34
|
+
export declare const missingHydrate: import("./legacy-feature.js").FeatureSpec<State, {
|
|
35
35
|
bump: (s: Pick<State, "count">, args: {
|
|
36
36
|
readonly by: number;
|
|
37
37
|
}) => Pick<State, "count">;
|
|
38
38
|
listFoos: (s: Pick<State, "entities">) => readonly Foo[];
|
|
39
39
|
}, Store>;
|
|
40
|
-
export declare const extraHydrate: import("./feature
|
|
40
|
+
export declare const extraHydrate: import("./legacy-feature.js").FeatureSpec<State, {
|
|
41
41
|
bump: (s: Pick<State, "count">, args: {
|
|
42
42
|
readonly by: number;
|
|
43
43
|
}) => Pick<State, "count">;
|
|
@@ -74,36 +74,36 @@ export declare const wrongDerivation: SpecDerivations<typeof total>;
|
|
|
74
74
|
export declare const mispair: CaseModule<State, typeof bump>;
|
|
75
75
|
declare const count: (s: State) => number;
|
|
76
76
|
export declare const residualGap: CaseModule<State, typeof count>;
|
|
77
|
-
export declare const missingComputedPlugin: import("./feature
|
|
77
|
+
export declare const missingComputedPlugin: import("./legacy-feature.js").FeatureSpec<State, {
|
|
78
78
|
bump: (s: Pick<State, "count">, args: {
|
|
79
79
|
readonly by: number;
|
|
80
80
|
}) => Pick<State, "count">;
|
|
81
81
|
listFoos: (s: Pick<State, "entities">) => readonly Foo[];
|
|
82
82
|
}, Store>;
|
|
83
|
-
export declare const noComputedOk: import("./feature
|
|
83
|
+
export declare const noComputedOk: import("./legacy-feature.js").FeatureSpec<State, {
|
|
84
84
|
bump: (s: Pick<State, "count">, args: {
|
|
85
85
|
readonly by: number;
|
|
86
86
|
}) => Pick<State, "count">;
|
|
87
87
|
}, Store>;
|
|
88
|
-
export declare const servicesOk: import("./feature
|
|
88
|
+
export declare const servicesOk: import("./legacy-feature.js").FeatureSpec<State, {
|
|
89
89
|
record: (s: Pick<State, "count">, args: {
|
|
90
90
|
readonly by: number;
|
|
91
91
|
readonly logger: Logger;
|
|
92
92
|
}) => Pick<State, "count">;
|
|
93
93
|
}, Store>;
|
|
94
|
-
export declare const missingServices: import("./feature
|
|
94
|
+
export declare const missingServices: import("./legacy-feature.js").FeatureSpec<State, {
|
|
95
95
|
record: (s: Pick<State, "count">, args: {
|
|
96
96
|
readonly by: number;
|
|
97
97
|
readonly logger: Logger;
|
|
98
98
|
}) => Pick<State, "count">;
|
|
99
99
|
}, Store>;
|
|
100
|
-
export declare const incompleteServices: import("./feature
|
|
100
|
+
export declare const incompleteServices: import("./legacy-feature.js").FeatureSpec<State, {
|
|
101
101
|
record: (s: Pick<State, "count">, args: {
|
|
102
102
|
readonly by: number;
|
|
103
103
|
readonly logger: Logger;
|
|
104
104
|
}) => Pick<State, "count">;
|
|
105
105
|
}, Store>;
|
|
106
|
-
export declare const extraServices: import("./feature
|
|
106
|
+
export declare const extraServices: import("./legacy-feature.js").FeatureSpec<State, {
|
|
107
107
|
bump: (s: Pick<State, "count">, args: {
|
|
108
108
|
readonly by: number;
|
|
109
109
|
}) => Pick<State, "count">;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { feature } from "./feature
|
|
1
|
+
import { feature } from "./legacy-feature.js";
|
|
2
2
|
// A transition (2 params) and an entity-list derivation (returns `readonly Foo[]`, so
|
|
3
3
|
// its ecs computed emits ids → it MUST be hydrated).
|
|
4
4
|
const bump = (s, args) => ({ count: s.count + args.by });
|
|
@@ -92,4 +92,4 @@ export const incompleteServices = feature({ state, fns: svcFns, plugin, projecti
|
|
|
92
92
|
// NEGATIVE — a service-free feature must not carry dead templates.
|
|
93
93
|
// @ts-expect-error — `bump` injects no service, so `services` must be absent
|
|
94
94
|
export const extraServices = feature({ state, fns: txFns, plugin, projection, services: { logger: () => logger }, cases: { bump: txCases } });
|
|
95
|
-
//# sourceMappingURL=feature
|
|
95
|
+
//# sourceMappingURL=legacy-feature.type-test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"legacy-feature.type-test.js","sourceRoot":"","sources":["../../src/conformance/legacy-feature.type-test.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAM9C,sFAAsF;AACtF,qDAAqD;AACrD,MAAM,IAAI,GAAG,CAAC,CAAuB,EAAE,IAA6B,EAAwB,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;AAC9H,MAAM,QAAQ,GAAG,CAAC,CAA0B,EAAkB,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;AAC1F,MAAM,GAAG,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;AAS/B,oFAAoF;AACpF,wEAAwE;AACxE,MAAM,UAAU,GAAG;IACjB,SAAS,EAAE,CAAC,MAAa,EAAE,EAAS,EAAQ,EAAE,GAAE,CAAC;IACjD,OAAO,EAAE,CAAC,MAAa,EAAS,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,IAAI,GAAG,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;IACtE,MAAM,EAAE,CAAC,MAAa,EAAE,EAAU,EAAO,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC;CAC3D,CAAC;AAEF,MAAM,SAAS,GAAkC;IAC/C,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,OAAO,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AAM,CAAC,MAAM,aAAa,GAAG,OAAO,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,CAAC,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Database } from "@adobe/data/ecs";
|
|
2
|
+
import type { MatchOptions } from "../match/match.js";
|
|
3
|
+
import type { Projection } from "./run-feature.js";
|
|
4
|
+
import type { SchemaSource } from "./refify.js";
|
|
5
|
+
/**
|
|
6
|
+
* @deprecated The runner behind `Conformance.feature`. Each spec transition conforms
|
|
7
|
+
* against the plugin's same-named TRANSACTION and its same-named ACTION, whichever
|
|
8
|
+
* exist. New features use `Conformance.implementation`, which conforms actions only.
|
|
9
|
+
*/
|
|
10
|
+
export interface LegacyFeatureRunConfig<State, StoreT> {
|
|
11
|
+
readonly state: {
|
|
12
|
+
create(): State;
|
|
13
|
+
readonly samples?: readonly State[];
|
|
14
|
+
};
|
|
15
|
+
readonly transitions: Record<string, Record<string, unknown>>;
|
|
16
|
+
readonly plugin: Database.Plugin;
|
|
17
|
+
readonly computedPlugin?: Database.Plugin;
|
|
18
|
+
readonly projection: Projection<StoreT, State>;
|
|
19
|
+
readonly hydrate?: readonly string[];
|
|
20
|
+
readonly match?: MatchOptions;
|
|
21
|
+
readonly ops?: {
|
|
22
|
+
readonly transactions?: Record<string, unknown>;
|
|
23
|
+
readonly actions?: Record<string, unknown>;
|
|
24
|
+
readonly computeds?: Record<string, unknown>;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
export declare function runLegacyFeature<State, StoreT extends SchemaSource, Db extends {
|
|
28
|
+
store: StoreT;
|
|
29
|
+
}>(config: LegacyFeatureRunConfig<State, StoreT>): void;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
// © 2026 Adobe. MIT License. See /LICENSE for details.
|
|
2
|
+
import { describe, it } from "vitest";
|
|
3
|
+
import { Database, Store } from "@adobe/data/ecs";
|
|
4
|
+
import { runTransactions } from "./run-transactions.js";
|
|
5
|
+
import { runActions } from "./run-actions.js";
|
|
6
|
+
import { runComputeds } from "./run-computeds.js";
|
|
7
|
+
import { expectAfter } from "./expect-after.js";
|
|
8
|
+
export function runLegacyFeature(config) {
|
|
9
|
+
const initial = config.state.create();
|
|
10
|
+
const { fromState, toState, toData } = config.projection;
|
|
11
|
+
const facets = config.plugin;
|
|
12
|
+
// A plugin carries the schema facets, so `Store.create` / `Database.create`
|
|
13
|
+
// accept it; the resulting store/db is the projection's `StoreT`/`Db`.
|
|
14
|
+
const makeStore = () => Store.create(config.plugin);
|
|
15
|
+
runTransactions({
|
|
16
|
+
createStore: makeStore,
|
|
17
|
+
fromState,
|
|
18
|
+
toState,
|
|
19
|
+
initial,
|
|
20
|
+
transitions: config.transitions,
|
|
21
|
+
transactions: config.ops?.transactions ?? facets.transactions,
|
|
22
|
+
match: config.match,
|
|
23
|
+
});
|
|
24
|
+
runActions({
|
|
25
|
+
makeDb: (services) => Database.toSystemDatabase(Database.create(config.plugin, { services })),
|
|
26
|
+
store: (db) => db.store,
|
|
27
|
+
fromState,
|
|
28
|
+
toState,
|
|
29
|
+
initial,
|
|
30
|
+
transitions: config.transitions,
|
|
31
|
+
actions: config.ops?.actions ?? facets.actions,
|
|
32
|
+
match: config.match,
|
|
33
|
+
});
|
|
34
|
+
if (config.computedPlugin) {
|
|
35
|
+
const computedFacets = config.computedPlugin;
|
|
36
|
+
runComputeds({
|
|
37
|
+
makeDb: () => Database.toSystemDatabase(Database.create(config.computedPlugin)),
|
|
38
|
+
store: (db) => db.store,
|
|
39
|
+
fromState,
|
|
40
|
+
toData,
|
|
41
|
+
initial,
|
|
42
|
+
derivations: config.transitions,
|
|
43
|
+
computeds: config.ops?.computeds ?? computedFacets.computed,
|
|
44
|
+
hydrate: config.hydrate,
|
|
45
|
+
match: config.match,
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
const samples = config.state.samples ?? [];
|
|
49
|
+
if (samples.length > 0) {
|
|
50
|
+
describe("projection round-trips (toState ∘ fromState ≡ identity)", () => {
|
|
51
|
+
samples.forEach((sample, index) => {
|
|
52
|
+
it(`sample ${index}`, () => {
|
|
53
|
+
const store = makeStore();
|
|
54
|
+
fromState(store, sample);
|
|
55
|
+
// A full-state round-trip: the whole sample is the expectation (no delta),
|
|
56
|
+
// compared up to an id-bijection.
|
|
57
|
+
expectAfter(toState(store), {}, sample, store, config.match);
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=legacy-run-feature.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"legacy-run-feature.js","sourceRoot":"","sources":["../../src/conformance/legacy-run-feature.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAElD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AA6BhD,MAAM,UAAU,gBAAgB,CAC9B,MAA6C;IAE7C,MAAM,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;IACtC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC,UAAU,CAAC;IACzD,MAAM,MAAM,GAAG,MAAM,CAAC,MAAiC,CAAC;IACxD,4EAA4E;IAC5E,uEAAuE;IACvE,MAAM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AE,MAAM,CAAC,OAAO;YACvB,KAAK,EAAE,MAAM,CAAC,KAAK;SACpB,CAAC,CAAC;IACL,CAAC;IAED,MAAM,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC,OAAO,IAAI,EAAE,CAAC;IAC3C,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACvB,QAAQ,CAAC,yDAAyD,EAAE,GAAG,EAAE;YACvE,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE;gBAChC,EAAE,CAAC,UAAU,KAAK,EAAE,EAAE,GAAG,EAAE;oBACzB,MAAM,KAAK,GAAG,SAAS,EAAE,CAAC;oBAC1B,SAAS,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;oBACzB,2EAA2E;oBAC3E,kCAAkC;oBAClC,WAAW,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,EAAE,EAAE,MAAgB,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;gBACzE,CAAC,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;AACH,CAAC"}
|
|
@@ -2,6 +2,7 @@ export { spec, type Spec } from "./spec.js";
|
|
|
2
2
|
export { implementation, type Implementation } from "./implementation.js";
|
|
3
3
|
export { checkSpec } from "./check-spec.js";
|
|
4
4
|
export { checkFeature } from "./check-feature.js";
|
|
5
|
+
export { feature, type FeatureSpec } from "./legacy-feature.js";
|
|
5
6
|
export type { StateMatches } from "./state-matches.js";
|
|
6
7
|
export type { FrameCases, SystemCases } from "./systems-types.js";
|
|
7
8
|
export { runSystems, type SystemRunConfig } from "./run-systems.js";
|
|
@@ -6,6 +6,9 @@ export { spec } from "./spec.js";
|
|
|
6
6
|
export { implementation } from "./implementation.js";
|
|
7
7
|
export { checkSpec } from "./check-spec.js";
|
|
8
8
|
export { checkFeature } from "./check-feature.js";
|
|
9
|
+
// Deprecated: the state-based `feature` manifest, still accepted by `checkSpec` and
|
|
10
|
+
// `checkFeature`.
|
|
11
|
+
export { feature } from "./legacy-feature.js";
|
|
9
12
|
export { runSystems } from "./run-systems.js";
|
|
10
13
|
// The escape hatch — the lower-level runners, for a feature whose ecs conformance needs
|
|
11
14
|
// per-surface `seedContext` or a custom concurrency/db (e.g. a user-scoped `userId`); it
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public.js","sourceRoot":"","sources":["../../src/conformance/public.ts"],"names":[],"mappings":"AAAA,uDAAuD;AAEvD,sFAAsF;AACtF,sFAAsF;AACtF,qFAAqF;AACrF,OAAO,EAAE,IAAI,EAAa,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAuB,MAAM,qBAAqB,CAAC;AAC1E,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"public.js","sourceRoot":"","sources":["../../src/conformance/public.ts"],"names":[],"mappings":"AAAA,uDAAuD;AAEvD,sFAAsF;AACtF,sFAAsF;AACtF,qFAAqF;AACrF,OAAO,EAAE,IAAI,EAAa,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAuB,MAAM,qBAAqB,CAAC;AAC1E,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,oFAAoF;AACpF,kBAAkB;AAClB,OAAO,EAAE,OAAO,EAAoB,MAAM,qBAAqB,CAAC;AAGhE,OAAO,EAAE,UAAU,EAAwB,MAAM,kBAAkB,CAAC;AAWpE,wFAAwF;AACxF,yFAAyF;AACzF,wFAAwF;AACxF,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,eAAe,EAA6B,MAAM,uBAAuB,CAAC;AACnF,OAAO,EAAE,UAAU,EAAwB,MAAM,kBAAkB,CAAC;AACpE,OAAO,EAAE,YAAY,EAA0B,MAAM,oBAAoB,CAAC;AAG1E,yFAAyF;AACzF,uDAAuD;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Database } from "@adobe/data/ecs";
|
|
2
|
-
import type { Entity } from "@adobe/data/ecs";
|
|
2
|
+
import type { ConcurrencyStrategyFactory, Entity } from "@adobe/data/ecs";
|
|
3
3
|
import type { MatchOptions } from "../match/match.js";
|
|
4
4
|
import type { SchemaSource } from "./refify.js";
|
|
5
5
|
export interface Projection<Store, State> {
|
|
@@ -20,6 +20,8 @@ export interface FeatureRunConfig<State, StoreT, Db extends {
|
|
|
20
20
|
readonly projection: Projection<StoreT, State>;
|
|
21
21
|
readonly hydrate?: readonly string[];
|
|
22
22
|
readonly services?: Readonly<Record<string, () => object>>;
|
|
23
|
+
readonly concurrency?: ConcurrencyStrategyFactory;
|
|
24
|
+
readonly seedContext?: (db: Db, before: State, args: unknown) => void;
|
|
23
25
|
readonly match?: MatchOptions;
|
|
24
26
|
readonly ops?: {
|
|
25
27
|
readonly actions?: Record<string, unknown>;
|
|
@@ -34,13 +34,17 @@ export function runFeature(config) {
|
|
|
34
34
|
});
|
|
35
35
|
}
|
|
36
36
|
runActions({
|
|
37
|
-
makeDb: (services) => Database.toSystemDatabase(Database.create(config.plugin, {
|
|
37
|
+
makeDb: (services) => Database.toSystemDatabase(Database.create(config.plugin, {
|
|
38
|
+
services: { ...baseServices(), ...services },
|
|
39
|
+
concurrency: config.concurrency,
|
|
40
|
+
})),
|
|
38
41
|
store: (db) => db.store,
|
|
39
42
|
fromState,
|
|
40
43
|
toState,
|
|
41
44
|
initial,
|
|
42
45
|
transitions: config.transitions,
|
|
43
46
|
actions: pick(actions, byAction),
|
|
47
|
+
seedContext: config.seedContext,
|
|
44
48
|
match: config.match,
|
|
45
49
|
});
|
|
46
50
|
if (config.computedPlugin) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run-feature.js","sourceRoot":"","sources":["../../src/conformance/run-feature.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAGlD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"run-feature.js","sourceRoot":"","sources":["../../src/conformance/run-feature.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAGlD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAqDtF,MAAM,IAAI,GAAG,CAAC,MAAoC,EAAE,KAA0B,EAA2B,EAAE,CACzG,MAAM,CAAC,WAAW,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAEtE,MAAM,UAAU,UAAU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@
|
|
|
1
1
|
export * as Match from "./match/public.js";
|
|
2
2
|
export * as Conformance from "./conformance/public.js";
|
|
3
|
-
export type { SpecCase, SpecCases, SpecDerivationCase, SpecDerivations, Responses, CaseModule, Spec, Implementation, StateMatches, FrameCases, SystemCases, Effects, ServiceCall, } from "./conformance/public.js";
|
|
3
|
+
export type { SpecCase, SpecCases, SpecDerivationCase, SpecDerivations, Responses, CaseModule, Spec, Implementation, FeatureSpec, StateMatches, FrameCases, SystemCases, Effects, ServiceCall, } from "./conformance/public.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adobe/data-testing",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.24",
|
|
4
4
|
"description": "Conformance-testing utilities (Match + Conformance runners) for @adobe/data ECS features",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"LICENSE"
|
|
16
16
|
],
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@adobe/data": "0.10.
|
|
18
|
+
"@adobe/data": "0.10.24"
|
|
19
19
|
},
|
|
20
20
|
"peerDependencies": {
|
|
21
21
|
"vitest": "^1.6.0"
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import type { Schema } from "@adobe/data/schema";
|
|
2
|
-
import type { Case, DerivationCase } from "./types.js";
|
|
3
|
-
type AnyFn = (...args: never[]) => unknown;
|
|
4
|
-
type ArgsOf<F extends AnyFn> = Parameters<F> extends [unknown, infer A, ...unknown[]] ? A : void;
|
|
5
|
-
type ArgsSchemaMismatch = {
|
|
6
|
-
readonly __argsSchemaMismatch: "the transition's args type must be assignable to Schema.ToType<options.args>";
|
|
7
|
-
};
|
|
8
|
-
type CasesOptions<F extends AnyFn, S extends Schema> = {
|
|
9
|
-
readonly name?: never;
|
|
10
|
-
/**
|
|
11
|
-
* Optional schema for this transition's `args`. Conformance uses it for ONE
|
|
12
|
-
* purpose: to identify which argument fields are ENTITY REFERENCES — a field
|
|
13
|
-
* typed with `Entity.schema` — so the runner resolves that spec-id to the entity
|
|
14
|
-
* seeded for it (the args-side counterpart of the component schemas it reads for
|
|
15
|
-
* state). Provide it whenever a transition addresses an entity by id in its
|
|
16
|
-
* `args`; omit it otherwise. Describe only the fields you need identified — an
|
|
17
|
-
* injected service, and any non-reference arg, may be left off. The args type
|
|
18
|
-
* must be assignable to this schema's `Schema.ToType`, so the schema cannot drift
|
|
19
|
-
* from the signature.
|
|
20
|
-
*/
|
|
21
|
-
readonly args?: S & (ArgsOf<F> extends Schema.ToType<S> ? unknown : ArgsSchemaMismatch);
|
|
22
|
-
};
|
|
23
|
-
export type CasesResult<State, F extends AnyFn> = {
|
|
24
|
-
readonly args?: Schema;
|
|
25
|
-
readonly cases: readonly Case<State, ArgsOf<F>>[];
|
|
26
|
-
};
|
|
27
|
-
export type DerivationsResult<F extends AnyFn> = {
|
|
28
|
-
readonly cases: readonly DerivationCase<Parameters<F>[0], ReturnType<F>>[];
|
|
29
|
-
};
|
|
30
|
-
export interface CasesBuilder<State> {
|
|
31
|
-
<F extends AnyFn>(fn: F, ...cases: readonly Case<State, ArgsOf<NoInfer<F>>>[]): CasesResult<State, F>;
|
|
32
|
-
<F extends AnyFn, const S extends Schema = Schema>(fn: F, options: CasesOptions<F, S>, ...cases: readonly Case<State, ArgsOf<NoInfer<F>>>[]): CasesResult<State, F>;
|
|
33
|
-
}
|
|
34
|
-
export interface DerivationsBuilder {
|
|
35
|
-
<F extends AnyFn>(fn: F, ...cases: readonly DerivationCase<Parameters<NoInfer<F>>[0], ReturnType<NoInfer<F>>>[]): DerivationsResult<F>;
|
|
36
|
-
}
|
|
37
|
-
export declare const casesBuilder: <State>() => CasesBuilder<State>;
|
|
38
|
-
export declare const derivationsBuilder: () => DerivationsBuilder;
|
|
39
|
-
export {};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export const casesBuilder = () => {
|
|
2
|
-
const build = (_fn, ...rest) => {
|
|
3
|
-
const first = rest[0];
|
|
4
|
-
// An options object has no `name` (every case does), so it discriminates the
|
|
5
|
-
// two overloads at runtime; either way the result is one `{ args?, cases }` shape.
|
|
6
|
-
const isOptions = first !== null && typeof first === "object" && !Array.isArray(first) && !("name" in first);
|
|
7
|
-
return isOptions ? { ...first, cases: rest.slice(1) } : { cases: rest };
|
|
8
|
-
};
|
|
9
|
-
return build;
|
|
10
|
-
};
|
|
11
|
-
export const derivationsBuilder = () => {
|
|
12
|
-
const build = (_fn, ...cases) => ({ cases });
|
|
13
|
-
return build;
|
|
14
|
-
};
|
|
15
|
-
//# sourceMappingURL=cases.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cases.js","sourceRoot":"","sources":["../../src/conformance/cases.ts"],"names":[],"mappings":"AA6EA,MAAM,CAAC,MAAM,YAAY,GAAG,GAA+B,EAAE;IAC3D,MAAM,KAAK,GAAG,CAAC,GAAU,EAAE,GAAG,IAAwB,EAAW,EAAE;QACjE,MAAM,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QACtB,6EAA6E;QAC7E,mFAAmF;QACnF,MAAM,SAAS,GACb,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,MAAM,IAAI,KAAK,CAAC,CAAC;QAC7F,OAAO,SAAS,CAAC,CAAC,CAAC,EAAE,GAAI,KAAgB,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;IACtF,CAAC,CAAC;IACF,OAAO,KAA4B,CAAC;AACtC,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAuB,EAAE;IACzD,MAAM,KAAK,GAAG,CAAC,GAAU,EAAE,GAAG,KAAyB,EAAW,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;IACjF,OAAO,KAA2B,CAAC;AACrC,CAAC,CAAC"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
type State = {
|
|
2
|
-
readonly entities: ReadonlyMap<number, {
|
|
3
|
-
readonly name: string;
|
|
4
|
-
}>;
|
|
5
|
-
readonly selected: number;
|
|
6
|
-
};
|
|
7
|
-
export declare const good: import("./cases.js").CasesResult<State, (_s: Pick<State, "selected">, args: {
|
|
8
|
-
readonly id: number;
|
|
9
|
-
readonly count: number;
|
|
10
|
-
}) => Pick<State, "selected">>;
|
|
11
|
-
export declare const noArgsResult: import("./cases.js").CasesResult<State, (_s: Pick<State, "selected">) => Pick<State, "selected">>;
|
|
12
|
-
export declare const derived: import("./cases.js").DerivationsResult<(_s: State) => number>;
|
|
13
|
-
export declare const bad: import("./cases.js").CasesResult<State, (_s: Pick<State, "selected">, args: {
|
|
14
|
-
readonly id: number;
|
|
15
|
-
readonly count: number;
|
|
16
|
-
}) => Pick<State, "selected">>;
|
|
17
|
-
export declare const throwsAny: import("./cases.js").CasesResult<State, (_s: Pick<State, "selected">, args: {
|
|
18
|
-
readonly id: number;
|
|
19
|
-
readonly count: number;
|
|
20
|
-
}) => Pick<State, "selected">>;
|
|
21
|
-
export declare const throwsSubstring: import("./cases.js").CasesResult<State, (_s: Pick<State, "selected">, args: {
|
|
22
|
-
readonly id: number;
|
|
23
|
-
readonly count: number;
|
|
24
|
-
}) => Pick<State, "selected">>;
|
|
25
|
-
export declare const badBoth: import("./cases.js").CasesResult<State, (_s: Pick<State, "selected">, args: {
|
|
26
|
-
readonly id: number;
|
|
27
|
-
readonly count: number;
|
|
28
|
-
}) => Pick<State, "selected">>;
|
|
29
|
-
export {};
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
// © 2026 Adobe. MIT License. See /LICENSE for details.
|
|
2
|
-
// Type-level checks for the `cases` builder's args-schema pin and its uniform envelope.
|
|
3
|
-
import { Entity } from "@adobe/data/ecs";
|
|
4
|
-
import { casesBuilder, derivationsBuilder } from "./cases.js";
|
|
5
|
-
const cases = casesBuilder();
|
|
6
|
-
const derivations = derivationsBuilder();
|
|
7
|
-
const reparent = (_s, args) => ({
|
|
8
|
-
selected: args.id,
|
|
9
|
-
});
|
|
10
|
-
const noArgs = (_s) => ({ selected: 0 });
|
|
11
|
-
// A schema whose ToType is assignable-from the args type — accepted.
|
|
12
|
-
export const good = cases(reparent,
|
|
13
|
-
// No `required`: the args type `{ id, count }` is still assignable to the schema's
|
|
14
|
-
// `ToType` (`{ id?, count? }`), and a marked field is detected regardless.
|
|
15
|
-
{ args: { type: "object", properties: { id: Entity.schema, count: { type: "integer" } } } }, { name: "ok", before: {}, args: { id: 1, count: 2 }, after: { selected: 1 } });
|
|
16
|
-
// Both forms emit the SAME envelope `{ args?, cases }` — never a bare array.
|
|
17
|
-
const _hasArgs = good.args;
|
|
18
|
-
const _hasCases = good.cases;
|
|
19
|
-
// The no-args overload emits the same envelope (no bare array).
|
|
20
|
-
export const noArgsResult = cases(noArgs, { name: "n", before: {}, after: { selected: 0 } });
|
|
21
|
-
const _noArgsCases = noArgsResult.cases;
|
|
22
|
-
// A derivation emits `{ cases }` through the parallel builder.
|
|
23
|
-
const derive = (_s) => _s.selected;
|
|
24
|
-
export const derived = derivations(derive, { name: "d", input: { entities: new Map(), selected: 0 }, value: 0 });
|
|
25
|
-
const _derivedCases = derived.cases;
|
|
26
|
-
// A schema that DIVERGES from the signature (id typed as string) must be rejected:
|
|
27
|
-
// `Schema.ToType<args>.id` is `string`, but the transition's `args.id` is `number`.
|
|
28
|
-
const badArgs = { type: "object", properties: { id: { type: "string" }, count: { type: "integer" } } };
|
|
29
|
-
// @ts-expect-error — args type is not assignable to Schema.ToType<args>
|
|
30
|
-
export const bad = cases(reparent, { args: badArgs }, { name: "bad", before: {}, args: { id: 1, count: 2 }, after: { selected: 1 } });
|
|
31
|
-
// A `throws` case takes no `after`/`effects` — `true` for any message, or a
|
|
32
|
-
// substring the thrown message must contain.
|
|
33
|
-
export const throwsAny = cases(reparent, { name: "throws (any message)", before: {}, args: { id: 1, count: 2 }, throws: true });
|
|
34
|
-
export const throwsSubstring = cases(reparent, { name: "throws (substring)", before: {}, args: { id: 1, count: 2 }, throws: "not found" });
|
|
35
|
-
// A case cannot declare both `after` and `throws` — the union forbids it.
|
|
36
|
-
// @ts-expect-error — `after` and `throws` are mutually exclusive
|
|
37
|
-
export const badBoth = cases(reparent, { name: "bad", before: {}, args: { id: 1, count: 2 }, after: { selected: 1 }, throws: true });
|
|
38
|
-
//# sourceMappingURL=cases.type-test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cases.type-test.js","sourceRoot":"","sources":["../../src/conformance/cases.type-test.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,wFAAwF;AACxF,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAG9D,MAAM,KAAK,GAAG,YAAY,EAAS,CAAC;AACpC,MAAM,WAAW,GAAG,kBAAkB,EAAE,CAAC;AAEzC,MAAM,QAAQ,GAAG,CAAC,EAA2B,EAAE,IAAqD,EAA2B,EAAE,CAAC,CAAC;IACjI,QAAQ,EAAE,IAAI,CAAC,EAAE;CAClB,CAAC,CAAC;AACH,MAAM,MAAM,GAAG,CAAC,EAA2B,EAA2B,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC,CAAC;AAE3F,qEAAqE;AACrE,MAAM,CAAC,MAAM,IAAI,GAAG,KAAK,CACvB,QAAQ;AACR,mFAAmF;AACnF,2EAA2E;AAC3E,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,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,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,KAAK,EAAE,EAAE,QAAQ,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;AAEtI,4EAA4E;AAC5E,6CAA6C;AAC7C,MAAM,CAAC,MAAM,SAAS,GAAG,KAAK,CAC5B,QAAQ,EACR,EAAE,IAAI,EAAE,sBAAsB,EAAE,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CACtF,CAAC;AACF,MAAM,CAAC,MAAM,eAAe,GAAG,KAAK,CAClC,QAAQ,EACR,EAAE,IAAI,EAAE,oBAAoB,EAAE,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,CAC3F,CAAC;AACF,0EAA0E;AAC1E,iEAAiE;AACjE,MAAM,CAAC,MAAM,OAAO,GAAG,KAAK,CAAC,QAAQ,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,KAAK,EAAE,EAAE,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
// A spec entity reference inside a case's `args`: `{ id: entity(1) }` names "the
|
|
2
|
-
// entity seeded for spec-id 1". It closes the one irreducible spec↔ecs vocabulary
|
|
3
|
-
// gap — identity: the pure spec reads the data-id, the ecs reads the entity the
|
|
4
|
-
// runner resolves. Typed as the id it stands in for, so it slots into the
|
|
5
|
-
// transform's own arg type (`{ id: number }`), exactly like `Match.anyNumber`.
|
|
6
|
-
const ENTITY_REF = Symbol.for("@adobe/data-testing:entity-ref");
|
|
7
|
-
export const entity = (specId) => ({ [ENTITY_REF]: specId });
|
|
8
|
-
const isEntityRef = (value) => typeof value === "object" && value !== null && ENTITY_REF in value;
|
|
9
|
-
// Adapt a case's `args` for one side of the conformance. `resolve` present → the
|
|
10
|
-
// ecs side (refs become seeded entities); absent → the pure-spec side (refs become
|
|
11
|
-
// their data-id). Only the top-level arg values are inspected — a `ref` is always a
|
|
12
|
-
// direct arg field. Non-ref values pass through untouched; a non-object `args`
|
|
13
|
-
// (a scalar `dt`, or `undefined`) passes through whole.
|
|
14
|
-
export const adaptArgs = (args, resolve) => {
|
|
15
|
-
if (args === null || typeof args !== "object" || Array.isArray(args))
|
|
16
|
-
return args;
|
|
17
|
-
let changed = false;
|
|
18
|
-
const next = { ...args };
|
|
19
|
-
for (const [key, value] of Object.entries(next)) {
|
|
20
|
-
if (isEntityRef(value)) {
|
|
21
|
-
const specId = value[ENTITY_REF];
|
|
22
|
-
next[key] = resolve ? resolve(specId) : specId;
|
|
23
|
-
changed = true;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
return (changed ? next : args);
|
|
27
|
-
};
|
|
28
|
-
//# sourceMappingURL=entity-ref.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"entity-ref.js","sourceRoot":"","sources":["../../src/conformance/entity-ref.ts"],"names":[],"mappings":"AAIA,iFAAiF;AACjF,kFAAkF;AAClF,gFAAgF;AAChF,0EAA0E;AAC1E,+EAA+E;AAC/E,MAAM,UAAU,GAAG,MAAM,CAAC,GAAG,CAAC,gCAAgC,CAAC,CAAC;AAEhE,MAAM,CAAC,MAAM,MAAM,GAAG,CAAI,MAAS,EAAK,EAAE,CAAC,CAAC,EAAE,CAAC,UAAU,CAAC,EAAE,MAAM,EAAE,CAAiB,CAAC;AAEtF,MAAM,WAAW,GAAG,CAAC,K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