@forgeax/engine-pack 0.1.28 → 0.1.29
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 +17 -5
- package/dist/build.mjs +34 -51
- package/dist/build.mjs.map +1 -1
- package/dist/cli-asset.mjs +21 -12
- package/dist/cli-asset.mjs.map +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/inventory/declaration.d.ts +1 -1
- package/dist/inventory/declaration.d.ts.map +1 -1
- package/dist/inventory/sync.d.ts.map +1 -1
- package/dist/native-cooker-registry.d.ts +1 -0
- package/dist/native-cooker-registry.d.ts.map +1 -1
- package/dist/native-cooker.mjs.map +1 -1
- package/dist/pack-authoring-node.mjs +21 -12
- package/dist/pack-authoring-node.mjs.map +1 -1
- package/dist/runtime.mjs.map +1 -1
- package/dist/scanner.mjs +21 -12
- package/dist/scanner.mjs.map +1 -1
- package/dist/schema-compiled.d.ts.map +1 -1
- package/dist/schema.mjs +40 -62
- package/dist/schema.mjs.map +1 -1
- package/dist/scriptable-pack-node.d.ts.map +1 -1
- package/dist/scriptable-pack-node.mjs +11 -3
- package/dist/scriptable-pack-node.mjs.map +1 -1
- package/dist/scriptable-pack-worker.mjs +5 -1
- package/dist/scriptable-pack-worker.mjs.map +1 -1
- package/package.json +2 -2
- package/src/__tests__/inventory-schema.test.ts +10 -10
- package/src/__tests__/pack-authoring.unit.test.ts +2 -4
- package/src/__tests__/pack.unit.test.ts +86 -124
- package/src/__tests__/scanner-instance-cycle.test.ts +92 -0
- package/src/__tests__/scanner-inventory.contract.test.ts +2 -2
- package/src/__tests__/scriptable-pack-diagnostic.integration.test.ts +45 -0
- package/src/inventory/binding.ts +3 -3
- package/src/inventory/declaration.ts +10 -48
- package/src/inventory/sync.ts +3 -2
- package/src/native-cooker-registry.ts +1 -0
- package/src/scanner.ts +28 -28
- package/src/schema-compiled.ts +40 -79
- package/src/scriptable-pack-node.ts +11 -3
- package/src/scriptable-pack-worker.ts +8 -1
- package/src/__tests__/scanner-mount-cycle.test.ts +0 -232
package/dist/scanner.mjs
CHANGED
|
@@ -8543,9 +8543,17 @@ var WorkerScriptablePackExecutor = class {
|
|
|
8543
8543
|
}
|
|
8544
8544
|
};
|
|
8545
8545
|
worker.on("message", onMessage);
|
|
8546
|
-
|
|
8546
|
+
const fail = (error) => {
|
|
8547
|
+
rejectLoad(error);
|
|
8548
|
+
const active = this.build;
|
|
8549
|
+
this.build = void 0;
|
|
8550
|
+
active?.reject(error);
|
|
8551
|
+
void this.dispose("failure");
|
|
8552
|
+
};
|
|
8553
|
+
worker.once("error", fail);
|
|
8547
8554
|
worker.once("exit", (code) => {
|
|
8548
|
-
if (
|
|
8555
|
+
if (this.disposal !== void 0) return;
|
|
8556
|
+
fail(new Error(`ScriptablePack worker exited with code ${code}`));
|
|
8549
8557
|
});
|
|
8550
8558
|
});
|
|
8551
8559
|
}
|
|
@@ -8781,16 +8789,17 @@ function makePackError(code, detail) {
|
|
|
8781
8789
|
detail
|
|
8782
8790
|
});
|
|
8783
8791
|
}
|
|
8784
|
-
function*
|
|
8792
|
+
function* extractInstanceSourceGuids(asset) {
|
|
8785
8793
|
if (asset.kind !== "scene") return;
|
|
8786
8794
|
const payload = asset.payload;
|
|
8787
|
-
if (!payload ||
|
|
8788
|
-
|
|
8789
|
-
|
|
8790
|
-
|
|
8791
|
-
|
|
8792
|
-
if (
|
|
8793
|
-
const
|
|
8795
|
+
if (!payload || payload.entities === null || typeof payload.entities !== "object" || Array.isArray(payload.entities))
|
|
8796
|
+
return;
|
|
8797
|
+
for (const rawEntity of Object.values(payload.entities)) {
|
|
8798
|
+
if (rawEntity === null || typeof rawEntity !== "object" || Array.isArray(rawEntity)) continue;
|
|
8799
|
+
const instance = rawEntity.instance;
|
|
8800
|
+
if (instance === null || typeof instance !== "object" || Array.isArray(instance)) continue;
|
|
8801
|
+
const source = instance.source;
|
|
8802
|
+
const resolved = typeof source === "number" && Number.isInteger(source) ? asset.refs[source] : typeof source === "string" ? source : void 0;
|
|
8794
8803
|
if (typeof resolved !== "string") continue;
|
|
8795
8804
|
yield resolved.toLowerCase();
|
|
8796
8805
|
}
|
|
@@ -8908,7 +8917,7 @@ async function scanValidated(roots, opts = {}, capture) {
|
|
|
8908
8917
|
guidToPath.set(normalizedGuid, packPath);
|
|
8909
8918
|
packRefs.set(normalizedGuid, [
|
|
8910
8919
|
...asset.refs.map((ref) => ref.toLowerCase()),
|
|
8911
|
-
...
|
|
8920
|
+
...extractInstanceSourceGuids(asset)
|
|
8912
8921
|
]);
|
|
8913
8922
|
}
|
|
8914
8923
|
}
|
|
@@ -9012,7 +9021,7 @@ async function scanValidated(roots, opts = {}, capture) {
|
|
|
9012
9021
|
guidToPath.set(normalizedGuid, packPath);
|
|
9013
9022
|
packRefs.set(normalizedGuid, [
|
|
9014
9023
|
...asset.refs.map((ref) => ref.toLowerCase()),
|
|
9015
|
-
...
|
|
9024
|
+
...extractInstanceSourceGuids(asset)
|
|
9016
9025
|
]);
|
|
9017
9026
|
}
|
|
9018
9027
|
capture?.declarations.set(packPath, {
|