@metamesh/testkit 0.14.0 → 0.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +70 -0
- package/README.md +3 -1
- package/dist/assertions.d.ts +1 -1
- package/dist/assertions.d.ts.map +1 -1
- package/dist/assertions.js +20 -5
- package/dist/assertions.js.map +1 -1
- package/dist/docs/guides/package.md +3 -1
- package/dist/docs/manifest.json +2 -2
- package/dist/docs/reference/font-fixtures/LoadedFontFixtures.md +1 -1
- package/dist/docs/reference/font-fixtures/loadFontFixtureServices.md +1 -1
- package/dist/docs/reference/font-fixtures/loadFontFixtures.md +1 -1
- package/dist/docs/reference/fonts/FontTestFixture.md +1 -1
- package/dist/docs/reference/fonts/prepareFontTestServices.md +1 -1
- package/dist/docs/reference/index/GeneratorTestExecution.md +1 -1
- package/dist/docs/reference/index/GeneratorTestRunner.md +1 -1
- package/dist/docs/reference/index/GeneratorTestRunnerOptions.md +1 -1
- package/dist/docs/reference/index/MeshMeasurementExpectation.md +2 -2
- package/dist/docs/reference/index/MeshMeasurementTolerances.md +1 -1
- package/dist/docs/reference/index/createGeneratorTestRunner.md +1 -1
- package/dist/docs/reference/index/expectMeshMeasurements.md +1 -1
- package/dist/docs/reference/index/expectSerializableDefinition.md +1 -1
- package/dist/docs/reference/index/expectValidDefaults.md +1 -1
- package/dist/docs/reference/index/expectValidParts.md +3 -3
- package/dist/docs/reference/index/expectValidPresets.md +1 -1
- package/dist/docs/reference/index/getTestEngine.md +1 -1
- package/dist/measurements.d.ts +2 -2
- package/dist/measurements.d.ts.map +1 -1
- package/dist/runner.d.ts.map +1 -1
- package/dist/runner.js +4 -1
- package/dist/runner.js.map +1 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,75 @@
|
|
|
1
1
|
# @metamesh/testkit
|
|
2
2
|
|
|
3
|
+
## 0.16.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- fbd7276: Standardize immutable value interchange on domain names, Data representations, Input construction
|
|
8
|
+
forms, and toData(). Rename vector tuples and transform matrices to Vector2Data/Vector3Data and
|
|
9
|
+
Transform2Data/Transform3Data. Path2Data and Path3Data now preserve dimension, points, and closure;
|
|
10
|
+
path factories accept complete data records as well as coordinate collections. Advance the host
|
|
11
|
+
runtime to major 8 for the new value protocol, and update consumers, examples, and references.
|
|
12
|
+
- 1585391: Add immutable `bounds2()` and `bounds3()` values with fluent measurements, positioned containment,
|
|
13
|
+
and plain-data conversion. Path bounds now return these values. Rename plain bounds records to
|
|
14
|
+
`Bounds2Data` and `Bounds3Data` across geometry, model snapshots, CLI captures, and Testkit contracts.
|
|
15
|
+
Bounds values in recipe inputs and computed data use the runtime 8 value interchange protocol.
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- Updated dependencies [fbd7276]
|
|
20
|
+
- Updated dependencies [1585391]
|
|
21
|
+
- Updated dependencies [29e19a5]
|
|
22
|
+
- @metamesh/modeling@0.16.0
|
|
23
|
+
- @metamesh/generator-sdk@0.16.0
|
|
24
|
+
|
|
25
|
+
## 0.15.0
|
|
26
|
+
|
|
27
|
+
### Minor Changes
|
|
28
|
+
|
|
29
|
+
- 25561f6: Consolidate sampled paths into immutable `path2` and `path3` values with explicit closure,
|
|
30
|
+
transformation, resampling, measurements, and closest-point queries. Geometry accepts paths and
|
|
31
|
+
fluent vector collections directly; tuple path data is named `Path2Data` and `Path3Data`.
|
|
32
|
+
Remove redundant public path query and transform helpers and move mesh observation to
|
|
33
|
+
`solid.toTriangleMesh()`. Runtime protocol 7 rejects incompatible older compiled generators.
|
|
34
|
+
|
|
35
|
+
Complete dimensional XY patterning and fluent geometry interoperability. Consolidate degree-based
|
|
36
|
+
attachment options under `AttachOptions` and primitive `attachment`, rename immutable tolerance
|
|
37
|
+
changes to `withTolerance`, and use `analyzeTriangleMesh` as the single mesh measurement operation.
|
|
38
|
+
Geometry and text validation report structured errors; host lifecycle and copying contracts are explicit.
|
|
39
|
+
|
|
40
|
+
Use concise value factories and semantic degree options, including `anchor3`, `threadProfile`,
|
|
41
|
+
attachment `spin`, full thread `includedAngle`, and revolution `degrees`. Segment intersections use
|
|
42
|
+
`castSegment`; stroke APIs share `StrokeOptions`, `StrokeCap`, and `StrokeJoin`. Engines accept a
|
|
43
|
+
fixed `wasmUrl`. Remove superseded public names and update included consumers.
|
|
44
|
+
|
|
45
|
+
Make `components()` return disconnected material with holes and enclosed cavities intact.
|
|
46
|
+
Inspection uses `componentCount`; snapshots use `partCount`, `vertexCount`, `triangleCount`, and
|
|
47
|
+
`byteCount`, preserving instance counts and shared-storage accounting.
|
|
48
|
+
|
|
49
|
+
Inspect zero-volume Boolean contacts without treating their native boundary remnants as
|
|
50
|
+
material components. Retain thin material pieces and inward cavity boundaries without a volume
|
|
51
|
+
tolerance cutoff.
|
|
52
|
+
|
|
53
|
+
Keep ordinary component inspection on a certified native fast path, reserving exact arithmetic
|
|
54
|
+
for ambiguous contact boundaries. Reuse captured generation-data metadata during cache retention,
|
|
55
|
+
and include retention, commit, and cleanup in total generation timing.
|
|
56
|
+
|
|
57
|
+
Preserve shared snapshot buffers and rigid placements in Testkit part assertions. Validate CLI
|
|
58
|
+
capture bounds by coordinates, independently of JSON property order.
|
|
59
|
+
|
|
60
|
+
Use concise input bounds such as `maxTriangles`, `maxVertices`, `minSegments`, and `maxSegments`,
|
|
61
|
+
including mesh-optimization work budgets. Remove the superseded long option spellings.
|
|
62
|
+
|
|
63
|
+
Refresh Testkit sessions when prepared services change, validate CLI callback results against the
|
|
64
|
+
installed Modeling contract, and reject conflicting buffers for one generated geometry identity
|
|
65
|
+
and revision. Correct closest-point projection when finite path edges have overflowing squared lengths.
|
|
66
|
+
|
|
67
|
+
### Patch Changes
|
|
68
|
+
|
|
69
|
+
- Updated dependencies [25561f6]
|
|
70
|
+
- @metamesh/modeling@0.15.0
|
|
71
|
+
- @metamesh/generator-sdk@0.15.0
|
|
72
|
+
|
|
3
73
|
## 0.14.0
|
|
4
74
|
|
|
5
75
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -64,6 +64,7 @@ Helpers throw on failure without depending on your test framework:
|
|
|
64
64
|
`expectValidParts(parts, engine)` is synchronous and uses that engine's limits. Without an engine,
|
|
65
65
|
it returns a promise using the shared test engine and default limits. It also accepts finalized
|
|
66
66
|
parts, stripping measurement facts before strict validation; other unknown fields reject.
|
|
67
|
+
Snapshot inputs retain shared local mesh buffers and rigid placements in the returned parts.
|
|
67
68
|
|
|
68
69
|
Compare physical measurements with explicit tolerances. For a 30 × 20 × 4 mm box mesh:
|
|
69
70
|
|
|
@@ -86,7 +87,8 @@ measurements alone do not establish geometric equivalence or exclude self-inters
|
|
|
86
87
|
|
|
87
88
|
Supply `prepareServices` in runner options for models with fonts. It receives the definition and
|
|
88
89
|
current parameters, and can return services synchronously or asynchronously. Missing fixtures or
|
|
89
|
-
service failures reject before generation.
|
|
90
|
+
service failures reject before generation. A different services object starts a fresh session;
|
|
91
|
+
return the same immutable object when capabilities are unchanged to retain computation caches.
|
|
90
92
|
|
|
91
93
|
`prepareFontTestServices` from `/fonts` checks immutable font revisions and prepares services from
|
|
92
94
|
checked-in bytes. Install Modeling's optional `fontkit` peer, plus `woff2-encoder` for WOFF2 fixtures.
|
package/dist/assertions.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export declare function expectValidDefaults<const D extends GeneratorDefinition>
|
|
|
9
9
|
/** Checks preset metadata. Validate domain assertions through the generation test runner. */
|
|
10
10
|
export declare function expectValidPresets<const D extends GeneratorDefinition>(definition: D, presets: readonly GeneratorPreset<D>[]): void;
|
|
11
11
|
/**
|
|
12
|
-
* Checks finalized
|
|
12
|
+
* Checks finalized parts without measurement facts, retaining shared snapshot resources and placement.
|
|
13
13
|
* Runs mesh reconstruction/finalization synchronously using the supplied engine.
|
|
14
14
|
*/
|
|
15
15
|
export declare function expectValidParts(value: readonly FinalizedPart[], engine: ModelEngine): readonly GeneratedPart[];
|
package/dist/assertions.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assertions.d.ts","sourceRoot":"","sources":["../src/assertions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,mBAAmB,EACnB,eAAe,EACf,eAAe,EAChB,MAAM,yBAAyB,CAAC;AAMjC,OAAO,EAAuB,KAAK,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAC1F,OAAO,EAAY,KAAK,aAAa,
|
|
1
|
+
{"version":3,"file":"assertions.d.ts","sourceRoot":"","sources":["../src/assertions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,mBAAmB,EACnB,eAAe,EACf,eAAe,EAChB,MAAM,yBAAyB,CAAC;AAMjC,OAAO,EAAuB,KAAK,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAC1F,OAAO,EAAY,KAAK,aAAa,EAAqB,MAAM,oBAAoB,CAAC;AACrF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AA4B7D,gGAAgG;AAChG,wBAAgB,4BAA4B,CAAC,UAAU,EAAE,mBAAmB,GAAG,IAAI,CAUlF;AAED,iGAAiG;AACjG,wBAAgB,mBAAmB,CAAC,KAAK,CAAC,CAAC,SAAS,mBAAmB,EACrE,UAAU,EAAE,CAAC,EACb,QAAQ,EAAE,eAAe,CAAC,CAAC,CAAC,GAC3B,IAAI,CAQN;AAED,6FAA6F;AAC7F,wBAAgB,kBAAkB,CAAC,KAAK,CAAC,CAAC,SAAS,mBAAmB,EACpE,UAAU,EAAE,CAAC,EACb,OAAO,EAAE,SAAS,eAAe,CAAC,CAAC,CAAC,EAAE,GACrC,IAAI,CAEN;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,SAAS,aAAa,EAAE,EAC/B,MAAM,EAAE,WAAW,GAClB,SAAS,aAAa,EAAE,CAAC;AAE5B,+FAA+F;AAC/F,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,GAAG,SAAS,aAAa,EAAE,CAAC;AAEhG,6FAA6F;AAC7F,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,SAAS,aAAa,EAAE,CAAC,CAAC"}
|
package/dist/assertions.js
CHANGED
|
@@ -51,6 +51,7 @@ export function expectValidPresets(definition, presets) {
|
|
|
51
51
|
export function expectValidParts(value, engine) {
|
|
52
52
|
if (engine === undefined)
|
|
53
53
|
return getTestEngine().then((host) => expectValidParts(value, host));
|
|
54
|
+
const meshes = new WeakMap();
|
|
54
55
|
const wireValue = Array.isArray(value)
|
|
55
56
|
? value.map((part, index) => {
|
|
56
57
|
if (typeof part !== "object" || part === null || !Object.hasOwn(part, "measurements"))
|
|
@@ -70,11 +71,25 @@ export function expectValidParts(value, engine) {
|
|
|
70
71
|
"rotation",
|
|
71
72
|
].includes(key)))
|
|
72
73
|
return part;
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
74
|
+
const resource = descriptors["geometry"];
|
|
75
|
+
if (resource !== undefined && !("value" in resource))
|
|
76
|
+
return part;
|
|
77
|
+
const geometry = resource?.value;
|
|
78
|
+
const source = typeof geometry === "object" && geometry !== null
|
|
79
|
+
? geometry
|
|
80
|
+
: part;
|
|
81
|
+
// Snapshot getters return copies. Read each local resource once to retain shared storage.
|
|
82
|
+
let mesh = meshes.get(source);
|
|
83
|
+
if (mesh === undefined) {
|
|
84
|
+
mesh = { positions: source.positions, indices: source.indices };
|
|
85
|
+
meshes.set(source, mesh);
|
|
86
|
+
}
|
|
87
|
+
descriptors["positions"] = { value: mesh.positions, enumerable: true };
|
|
88
|
+
descriptors["indices"] = { value: mesh.indices, enumerable: true };
|
|
89
|
+
if (source === part) {
|
|
90
|
+
delete descriptors["position"];
|
|
91
|
+
delete descriptors["rotation"];
|
|
92
|
+
}
|
|
78
93
|
delete descriptors["measurements"];
|
|
79
94
|
delete descriptors["geometry"];
|
|
80
95
|
return Object.defineProperties({
|
package/dist/assertions.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assertions.js","sourceRoot":"","sources":["../src/assertions.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,wBAAwB,EACxB,wBAAwB,GACzB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC5F,OAAO,EAAE,mBAAmB,EAAsB,MAAM,iCAAiC,CAAC;AAC1F,OAAO,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"assertions.js","sourceRoot":"","sources":["../src/assertions.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,wBAAwB,EACxB,wBAAwB,GACzB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC5F,OAAO,EAAE,mBAAmB,EAAsB,MAAM,iCAAiC,CAAC;AAC1F,OAAO,EAAE,QAAQ,EAAyC,MAAM,oBAAoB,CAAC;AAGrF,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,SAAS,SAAS,CAAC,KAAc,EAAE,KAAa;IAC9C,IAAI,CAAC;QACH,MAAM,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QACzC,IAAI,UAAU,KAAK,SAAS;YAAE,MAAM,IAAI,SAAS,CAAC,GAAG,KAAK,4BAA4B,CAAC,CAAC;QACxF,OAAO,UAAU,CAAC;IACpB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,SAAS,CAAC,GAAG,KAAK,4BAA4B,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;IACvE,CAAC;AACH,CAAC;AAED,SAAS,QAAQ,CAAC,KAAc;IAC9B,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;Q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ACE,UAAU,EAAE,aAAa,KAAK,EAAE;gBAChC,gBAAgB,EAAE,CAAC;gBACnB,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;gBACnB,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;aACpB,EACD,WAAW,CACZ,CAAC;QACJ,CAAC,CAAC;QACJ,CAAC,CAAC,KAAK,CAAC;IACV,MAAM,KAAK,GAAG,mBAAmB,CAAC,SAAS,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;IAC5D,MAAM,OAAO,GAAG,MAAM,CAAC,aAAa,CAClC,QAAQ,CAAuB,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAC1C,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CACjB,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE;QACZ,QAAQ,EAAE,IAAI;QACd,QAAQ,EAAE,IAAI,CAAC,QAAQ;QACvB,QAAQ,EAAE,IAAI,CAAC,QAAQ;QACvB,GAAG,CAAC,IAAI,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC;KAC3D,CAAC,CACH,CACF,CACF,CAAC;IACF,IAAI,CAAC;QACH,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC;IAC5B,CAAC;YAAS,CAAC;QACT,OAAO,CAAC,OAAO,EAAE,CAAC;IACpB,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -64,6 +64,7 @@ Helpers throw on failure without depending on your test framework:
|
|
|
64
64
|
`expectValidParts(parts, engine)` is synchronous and uses that engine's limits. Without an engine,
|
|
65
65
|
it returns a promise using the shared test engine and default limits. It also accepts finalized
|
|
66
66
|
parts, stripping measurement facts before strict validation; other unknown fields reject.
|
|
67
|
+
Snapshot inputs retain shared local mesh buffers and rigid placements in the returned parts.
|
|
67
68
|
|
|
68
69
|
Compare physical measurements with explicit tolerances. For a 30 × 20 × 4 mm box mesh:
|
|
69
70
|
|
|
@@ -86,7 +87,8 @@ measurements alone do not establish geometric equivalence or exclude self-inters
|
|
|
86
87
|
|
|
87
88
|
Supply `prepareServices` in runner options for models with fonts. It receives the definition and
|
|
88
89
|
current parameters, and can return services synchronously or asynchronously. Missing fixtures or
|
|
89
|
-
service failures reject before generation.
|
|
90
|
+
service failures reject before generation. A different services object starts a fresh session;
|
|
91
|
+
return the same immutable object when capabilities are unchanged to retain computation caches.
|
|
90
92
|
|
|
91
93
|
`prepareFontTestServices` from `/fonts` checks immutable font revisions and prepares services from
|
|
92
94
|
checked-in bytes. Install Modeling's optional `fontkit` peer, plus `woff2-encoder` for WOFF2 fixtures.
|
package/dist/docs/manifest.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"formatVersion": 1,
|
|
3
3
|
"packageName": "@metamesh/testkit",
|
|
4
|
-
"packageVersion": "0.
|
|
4
|
+
"packageVersion": "0.16.0",
|
|
5
5
|
"documents": [
|
|
6
6
|
{
|
|
7
7
|
"id": "testkit/guide/testing",
|
|
@@ -146,7 +146,7 @@
|
|
|
146
146
|
{
|
|
147
147
|
"id": "testkit/reference/index/expectValidParts",
|
|
148
148
|
"title": "expectValidParts",
|
|
149
|
-
"summary": "Checks finalized
|
|
149
|
+
"summary": "Checks finalized parts without measurement facts, retaining shared snapshot resources and placement. Runs mesh reconstruction/finalization synchronously using the supplied engine. Strictly checks unknown wire data and reconstructs its meshes using the supplied engine. Initializes the shared test engine lazily, then applies the same wire and mesh checks.",
|
|
150
150
|
"path": "reference/index/expectValidParts.md",
|
|
151
151
|
"importPath": "@metamesh/testkit",
|
|
152
152
|
"availability": "Local Node testing",
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Byte-verified local font selections and a reusable Generator service-preparation adapter.
|
|
4
4
|
|
|
5
|
-
Import from `@metamesh/testkit/font-fixtures` (@metamesh/testkit@0.
|
|
5
|
+
Import from `@metamesh/testkit/font-fixtures` (@metamesh/testkit@0.16.0).
|
|
6
6
|
|
|
7
7
|
```ts
|
|
8
8
|
/** Byte-verified local font selections and a reusable Generator service-preparation adapter. */
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Fixture provider matching createGeneratorTestRunner's asynchronous service boundary.
|
|
4
4
|
|
|
5
|
-
Import from `@metamesh/testkit/font-fixtures` (@metamesh/testkit@0.
|
|
5
|
+
Import from `@metamesh/testkit/font-fixtures` (@metamesh/testkit@0.16.0).
|
|
6
6
|
|
|
7
7
|
```ts
|
|
8
8
|
/** Fixture provider matching createGeneratorTestRunner's asynchronous service boundary. */
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Node-only local descriptor loader. Paths resolve beside the descriptor; bytes never come from a catalog.
|
|
4
4
|
|
|
5
|
-
Import from `@metamesh/testkit/font-fixtures` (@metamesh/testkit@0.
|
|
5
|
+
Import from `@metamesh/testkit/font-fixtures` (@metamesh/testkit@0.16.0).
|
|
6
6
|
|
|
7
7
|
```ts
|
|
8
8
|
/** Node-only local descriptor loader. Paths resolve beside the descriptor; bytes never come from a catalog. */
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
A checked-in immutable font fixture; no catalog or network is used by the test harness.
|
|
4
4
|
|
|
5
|
-
Import from `@metamesh/testkit/fonts` (@metamesh/testkit@0.
|
|
5
|
+
Import from `@metamesh/testkit/fonts` (@metamesh/testkit@0.16.0).
|
|
6
6
|
|
|
7
7
|
```ts
|
|
8
8
|
/** A checked-in immutable font fixture; no catalog or network is used by the test harness. */
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Prepares the same synchronous text service used by Studio, from reproducible fixture bytes.
|
|
4
4
|
|
|
5
|
-
Import from `@metamesh/testkit/fonts` (@metamesh/testkit@0.
|
|
5
|
+
Import from `@metamesh/testkit/fonts` (@metamesh/testkit@0.16.0).
|
|
6
6
|
|
|
7
7
|
```ts
|
|
8
8
|
/** Prepares the same synchronous text service used by Studio, from reproducible fixture bytes. */
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Parameter or assertion failure, or a generated snapshot owned separately from its runner.
|
|
4
4
|
|
|
5
|
-
Import from `@metamesh/testkit` (@metamesh/testkit@0.
|
|
5
|
+
Import from `@metamesh/testkit` (@metamesh/testkit@0.16.0).
|
|
6
6
|
|
|
7
7
|
```ts
|
|
8
8
|
/** Parameter or assertion failure, or a generated snapshot owned separately from its runner. */
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
A lazy reusable Generator test session; dispose the runner and every returned snapshot separately.
|
|
4
4
|
|
|
5
|
-
Import from `@metamesh/testkit` (@metamesh/testkit@0.
|
|
5
|
+
Import from `@metamesh/testkit` (@metamesh/testkit@0.16.0).
|
|
6
6
|
|
|
7
7
|
```ts
|
|
8
8
|
/** A lazy reusable Generator test session; dispose the runner and every returned snapshot separately. */
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Fixed host resources and optional asynchronous asset preparation.
|
|
4
4
|
|
|
5
|
-
Import from `@metamesh/testkit` (@metamesh/testkit@0.
|
|
5
|
+
Import from `@metamesh/testkit` (@metamesh/testkit@0.16.0).
|
|
6
6
|
|
|
7
7
|
```ts
|
|
8
8
|
/** Fixed host resources and optional asynchronous asset preparation. */
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
Physical expectations for a closed mesh; omitted facts are not asserted.
|
|
4
4
|
|
|
5
|
-
Import from `@metamesh/testkit` (@metamesh/testkit@0.
|
|
5
|
+
Import from `@metamesh/testkit` (@metamesh/testkit@0.16.0).
|
|
6
6
|
|
|
7
7
|
```ts
|
|
8
8
|
/** Physical expectations for a closed mesh; omitted facts are not asserted. */
|
|
9
9
|
export interface MeshMeasurementExpectation {
|
|
10
10
|
/** Axis-aligned XYZ bounds in millimetres. */
|
|
11
|
-
readonly bounds?:
|
|
11
|
+
readonly bounds?: Bounds3Data;
|
|
12
12
|
/** Oriented enclosed volume in cubic millimetres; outward winding is positive. */
|
|
13
13
|
readonly signedVolume?: number;
|
|
14
14
|
/** Sum of triangle areas in square millimetres. */
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Absolute nonnegative comparison allowances; each omitted tolerance defaults to zero.
|
|
4
4
|
|
|
5
|
-
Import from `@metamesh/testkit` (@metamesh/testkit@0.
|
|
5
|
+
Import from `@metamesh/testkit` (@metamesh/testkit@0.16.0).
|
|
6
6
|
|
|
7
7
|
```ts
|
|
8
8
|
/** Absolute nonnegative comparison allowances; each omitted tolerance defaults to zero. */
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Creates a lazy runner for one generation program without loading assets or an engine.
|
|
4
4
|
|
|
5
|
-
Import from `@metamesh/testkit` (@metamesh/testkit@0.
|
|
5
|
+
Import from `@metamesh/testkit` (@metamesh/testkit@0.16.0).
|
|
6
6
|
|
|
7
7
|
```ts
|
|
8
8
|
/** Creates a lazy runner for one generation program without loading assets or an engine. */
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Analyzes current buffers, requires closed oriented edge topology, and checks selected physical facts with explicit absolute tolerances. Returns fresh measurements without initializing an engine. These facts do not prove geometric equivalence or absence of self-intersections.
|
|
4
4
|
|
|
5
|
-
Import from `@metamesh/testkit` (@metamesh/testkit@0.
|
|
5
|
+
Import from `@metamesh/testkit` (@metamesh/testkit@0.16.0).
|
|
6
6
|
|
|
7
7
|
```ts
|
|
8
8
|
/**
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Throws unless a definition already has the canonical package-serializable representation.
|
|
4
4
|
|
|
5
|
-
Import from `@metamesh/testkit` (@metamesh/testkit@0.
|
|
5
|
+
Import from `@metamesh/testkit` (@metamesh/testkit@0.16.0).
|
|
6
6
|
|
|
7
7
|
```ts
|
|
8
8
|
/** Throws unless a definition already has the canonical package-serializable representation. */
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Throws unless defaults strictly decode and equal the defaults derived from the definition.
|
|
4
4
|
|
|
5
|
-
Import from `@metamesh/testkit` (@metamesh/testkit@0.
|
|
5
|
+
Import from `@metamesh/testkit` (@metamesh/testkit@0.16.0).
|
|
6
6
|
|
|
7
7
|
```ts
|
|
8
8
|
/** Throws unless defaults strictly decode and equal the defaults derived from the definition. */
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# expectValidParts
|
|
2
2
|
|
|
3
|
-
Checks finalized
|
|
3
|
+
Checks finalized parts without measurement facts, retaining shared snapshot resources and placement. Runs mesh reconstruction/finalization synchronously using the supplied engine. Strictly checks unknown wire data and reconstructs its meshes using the supplied engine. Initializes the shared test engine lazily, then applies the same wire and mesh checks.
|
|
4
4
|
|
|
5
|
-
Import from `@metamesh/testkit` (@metamesh/testkit@0.
|
|
5
|
+
Import from `@metamesh/testkit` (@metamesh/testkit@0.16.0).
|
|
6
6
|
|
|
7
7
|
```ts
|
|
8
8
|
/**
|
|
9
|
-
* Checks finalized
|
|
9
|
+
* Checks finalized parts without measurement facts, retaining shared snapshot resources and placement.
|
|
10
10
|
* Runs mesh reconstruction/finalization synchronously using the supplied engine.
|
|
11
11
|
*/
|
|
12
12
|
export declare function expectValidParts(value: readonly FinalizedPart[], engine: ModelEngine): readonly GeneratedPart[];
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Checks preset metadata. Validate domain assertions through the generation test runner.
|
|
4
4
|
|
|
5
|
-
Import from `@metamesh/testkit` (@metamesh/testkit@0.
|
|
5
|
+
Import from `@metamesh/testkit` (@metamesh/testkit@0.16.0).
|
|
6
6
|
|
|
7
7
|
```ts
|
|
8
8
|
/** Checks preset metadata. Validate domain assertions through the generation test runner. */
|
package/dist/measurements.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type Bounds3Data, type TriangleMesh, type TriangleMeshAnalysis } from "@metamesh/modeling/geometry";
|
|
2
2
|
/** Physical expectations for a closed mesh; omitted facts are not asserted. */
|
|
3
3
|
export interface MeshMeasurementExpectation {
|
|
4
4
|
/** Axis-aligned XYZ bounds in millimetres. */
|
|
5
|
-
readonly bounds?:
|
|
5
|
+
readonly bounds?: Bounds3Data;
|
|
6
6
|
/** Oriented enclosed volume in cubic millimetres; outward winding is positive. */
|
|
7
7
|
readonly signedVolume?: number;
|
|
8
8
|
/** Sum of triangle areas in square millimetres. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"measurements.d.ts","sourceRoot":"","sources":["../src/measurements.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,
|
|
1
|
+
{"version":3,"file":"measurements.d.ts","sourceRoot":"","sources":["../src/measurements.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,oBAAoB,EAC1B,MAAM,6BAA6B,CAAC;AAErC,+EAA+E;AAC/E,MAAM,WAAW,0BAA0B;IACzC,8CAA8C;IAC9C,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,CAAC;IAC9B,kFAAkF;IAClF,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,mDAAmD;IACnD,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,kEAAkE;IAClE,QAAQ,CAAC,uBAAuB,CAAC,EAAE,MAAM,CAAC;CAC3C;AAED,2FAA2F;AAC3F,MAAM,WAAW,yBAAyB;IACxC,wEAAwE;IACxE,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,wDAAwD;IACxD,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,wDAAwD;IACxD,QAAQ,CAAC,WAAW,C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,OAAO,CAAC,CAAC,KAC1C,OAAO,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC;IACxC,uEAAuE;IACvE,QAAQ,CAAC,OAAO,EAAE,MAAM,IAAI,CAAC;CAC9B;AAED,4FAA4F;AAC5F,wBAAgB,yBAAyB,CAAC,KAAK,CAAC,CAAC,SAAS,mBAAmB,EAC3E,UAAU,EAAE,CAAC,EACb,OAAO,EAAE;IAAE,QAAQ,CAAC,QAAQ,EAAE,YAAY,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,iBAAiB,CAAC,CAAA;CAAE,EACnF,OAAO,GAAE,0BAA0B,CAAC,OAAO,CAAC,CAAC,CAAC,CAAM,GACnD,mBAAmB,CAAC,CAAC,CAAC,CAgIxB"}
|
package/dist/runner.js
CHANGED
|
@@ -7,6 +7,7 @@ import { getTestEngine } from "./engine.js";
|
|
|
7
7
|
/** Creates a lazy runner for one generation program without loading assets or an engine. */
|
|
8
8
|
export function createGeneratorTestRunner(definition, runtime, options = {}) {
|
|
9
9
|
let session;
|
|
10
|
+
let sessionServices;
|
|
10
11
|
let assetKey;
|
|
11
12
|
let previous;
|
|
12
13
|
let disposed = false;
|
|
@@ -29,7 +30,7 @@ export function createGeneratorTestRunner(definition, runtime, options = {}) {
|
|
|
29
30
|
const key = JSON.stringify(definition.parameters
|
|
30
31
|
.filter((parameter) => parameter.type === "font")
|
|
31
32
|
.map(({ id }) => parameters[id]));
|
|
32
|
-
if (session === undefined || assetKey !== key) {
|
|
33
|
+
if (session === undefined || assetKey !== key || sessionServices !== capabilities) {
|
|
33
34
|
session?.dispose();
|
|
34
35
|
session = undefined;
|
|
35
36
|
session = engine.createSession(runtime.generate, {
|
|
@@ -37,6 +38,7 @@ export function createGeneratorTestRunner(definition, runtime, options = {}) {
|
|
|
37
38
|
...(options.limits === undefined ? {} : { limits: options.limits }),
|
|
38
39
|
});
|
|
39
40
|
assetKey = key;
|
|
41
|
+
sessionServices = capabilities;
|
|
40
42
|
}
|
|
41
43
|
// Selection and execution stay synchronous: another prepared request may replace this session.
|
|
42
44
|
return execute(session);
|
|
@@ -111,6 +113,7 @@ export function createGeneratorTestRunner(definition, runtime, options = {}) {
|
|
|
111
113
|
disposed = true;
|
|
112
114
|
session?.dispose();
|
|
113
115
|
session = undefined;
|
|
116
|
+
sessionServices = undefined;
|
|
114
117
|
previous = undefined;
|
|
115
118
|
},
|
|
116
119
|
});
|
package/dist/runner.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runner.js","sourceRoot":"","sources":["../src/runner.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,6BAA6B,GAK9B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,wBAAwB,EACxB,sBAAsB,EACtB,oBAAoB,EACpB,iBAAiB,GAClB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAEnE,OAAO,EACL,aAAa,GAId,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAE9D,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAyC5C,4FAA4F;AAC5F,MAAM,UAAU,yBAAyB,CACvC,UAAa,EACb,OAAmF,EACnF,UAAkD,EAAE;IAEpD,IAAI,OAAqD,CAAC;IAC1D,IAAI,QAA4B,CAAC;IACjC,IAAI,QAAwC,CAAC;IAC7C,IAAI,QAAQ,GAAG,KAAK,CAAC;IACrB,MAAM,YAAY,GAAG,GAAG,EAAE;QACxB,IAAI,QAAQ;YAAE,MAAM,IAAI,KAAK,CAAC,0CAA0C,CAAC,CAAC;IAC5E,CAAC,CAAC;IAEF,KAAK,UAAU,QAAQ,CAAC,UAA8B;QACpD,IAAI,OAAO,CAAC,eAAe;YAAE,OAAO,OAAO,CAAC,eAAe,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;QACpF,IAAI,UAAU,CAAC,UAAU,CAAC,IAAI,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oBACf,UAAU,EAAE,MAAM;oBAClB,UAAU,EAAE,wBAAwB,CAAC,KAAK,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,CAAC;iBACtE,CAAC,CAAC;YACL,CAAC;QACH,CAAC;QACD,OAAO;YACL,QAAQ,GAAG,IAAI,CAAC;YAChB,OAAO,EAAE,OAAO,EAAE,CAAC;YACnB,OAAO,GAAG,SAAS,CAAC;YACpB,eAAe,GAAG,SAAS,CAAC;YAC5B,QAAQ,GAAG,SAAS,CAAC;QACvB,CAAC;KACF,CAAC,CAAC;AACL,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@metamesh/testkit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.0",
|
|
4
4
|
"description": "Runner-neutral MetaMesh model and Generator testing helpers, assertions, and local font fixtures.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -38,13 +38,13 @@
|
|
|
38
38
|
"registry": "https://registry.npmjs.org/"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
|
-
"@metamesh/generator-sdk": "0.
|
|
42
|
-
"@metamesh/modeling": "0.
|
|
41
|
+
"@metamesh/generator-sdk": "0.16.0",
|
|
42
|
+
"@metamesh/modeling": "0.16.0"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@metamesh/config": "0.0.0",
|
|
46
|
-
"@metamesh/generator-sdk": "0.
|
|
47
|
-
"@metamesh/modeling": "0.
|
|
46
|
+
"@metamesh/generator-sdk": "0.16.0",
|
|
47
|
+
"@metamesh/modeling": "0.16.0",
|
|
48
48
|
"vitest": "^5.0.5",
|
|
49
49
|
"@types/node": "^24.19.2",
|
|
50
50
|
"typescript": "6.0.3"
|