@forgeax/engine-import 0.1.2
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/LICENSE +202 -0
- package/README.md +226 -0
- package/dist/.tsbuildinfo +1 -0
- package/dist/__tests__/decode-image-owner.test-d.d.ts +2 -0
- package/dist/__tests__/decode-image-owner.test-d.d.ts.map +1 -0
- package/dist/__tests__/import-contract-migration.test.d.ts +2 -0
- package/dist/__tests__/import-contract-migration.test.d.ts.map +1 -0
- package/dist/__tests__/import-dependencies.test.d.ts +2 -0
- package/dist/__tests__/import-dependencies.test.d.ts.map +1 -0
- package/dist/__tests__/import-finalizer-digest-retry.test.d.ts +2 -0
- package/dist/__tests__/import-finalizer-digest-retry.test.d.ts.map +1 -0
- package/dist/__tests__/import-local-artifacts.test.d.ts +2 -0
- package/dist/__tests__/import-local-artifacts.test.d.ts.map +1 -0
- package/dist/__tests__/import.unit.test.d.ts +2 -0
- package/dist/__tests__/import.unit.test.d.ts.map +1 -0
- package/dist/__tests__/material-import-product.unit.test.d.ts +2 -0
- package/dist/__tests__/material-import-product.unit.test.d.ts.map +1 -0
- package/dist/__tests__/mesh-bin-contract.test.d.ts +2 -0
- package/dist/__tests__/mesh-bin-contract.test.d.ts.map +1 -0
- package/dist/__tests__/mesh-bin-morph-v3.test.d.ts +2 -0
- package/dist/__tests__/mesh-bin-morph-v3.test.d.ts.map +1 -0
- package/dist/__tests__/mesh-bin.test.d.ts +2 -0
- package/dist/__tests__/mesh-bin.test.d.ts.map +1 -0
- package/dist/__tests__/scriptable-pack-output-producers.unit.test.d.ts +2 -0
- package/dist/__tests__/scriptable-pack-output-producers.unit.test.d.ts.map +1 -0
- package/dist/__tests__/scriptable-pack-production-producers.unit.test.d.ts +2 -0
- package/dist/__tests__/scriptable-pack-production-producers.unit.test.d.ts.map +1 -0
- package/dist/__tests__/scriptable-pack-staged-snapshot.unit.test.d.ts +2 -0
- package/dist/__tests__/scriptable-pack-staged-snapshot.unit.test.d.ts.map +1 -0
- package/dist/__tests__/scriptable-pack.integration.test.d.ts +2 -0
- package/dist/__tests__/scriptable-pack.integration.test.d.ts.map +1 -0
- package/dist/__tests__/source-overrides-import-context.unit.test.d.ts +2 -0
- package/dist/__tests__/source-overrides-import-context.unit.test.d.ts.map +1 -0
- package/dist/import-product.d.ts +36 -0
- package/dist/import-product.d.ts.map +1 -0
- package/dist/import-runner.d.ts +133 -0
- package/dist/import-runner.d.ts.map +1 -0
- package/dist/importer-registry.d.ts +40 -0
- package/dist/importer-registry.d.ts.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.mjs +1607 -0
- package/dist/index.mjs.map +1 -0
- package/dist/mesh-bin.d.ts +19 -0
- package/dist/mesh-bin.d.ts.map +1 -0
- package/dist/scriptable-pack-output-producers.d.ts +6 -0
- package/dist/scriptable-pack-output-producers.d.ts.map +1 -0
- package/dist/scriptable-pack-staged-snapshot.d.ts +22 -0
- package/dist/scriptable-pack-staged-snapshot.d.ts.map +1 -0
- package/dist/scriptable-pack.d.ts +153 -0
- package/dist/scriptable-pack.d.ts.map +1 -0
- package/package.json +63 -0
- package/src/__tests__/decode-image-owner.test-d.ts +53 -0
- package/src/__tests__/import-contract-migration.test.ts +190 -0
- package/src/__tests__/import-dependencies.test.ts +65 -0
- package/src/__tests__/import-finalizer-digest-retry.test.ts +113 -0
- package/src/__tests__/import-local-artifacts.test.ts +100 -0
- package/src/__tests__/import.unit.test.ts +429 -0
- package/src/__tests__/material-import-product.unit.test.ts +56 -0
- package/src/__tests__/mesh-bin-contract.test.ts +95 -0
- package/src/__tests__/mesh-bin-morph-v3.test.ts +44 -0
- package/src/__tests__/mesh-bin.test.ts +102 -0
- package/src/__tests__/scriptable-pack-output-producers.unit.test.ts +190 -0
- package/src/__tests__/scriptable-pack-production-producers.unit.test.ts +429 -0
- package/src/__tests__/scriptable-pack-staged-snapshot.unit.test.ts +258 -0
- package/src/__tests__/scriptable-pack.integration.test.ts +435 -0
- package/src/__tests__/source-overrides-import-context.unit.test.ts +92 -0
- package/src/import-product.ts +195 -0
- package/src/import-runner.ts +720 -0
- package/src/importer-registry.ts +80 -0
- package/src/index.ts +103 -0
- package/src/mesh-bin.ts +229 -0
- package/src/scriptable-pack-output-producers.ts +466 -0
- package/src/scriptable-pack-staged-snapshot.ts +161 -0
- package/src/scriptable-pack.ts +615 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { Importer } from '@forgeax/engine-types';
|
|
2
|
+
/**
|
|
3
|
+
* Injectable `meta.importer` -> {@link Importer} table held by the import
|
|
4
|
+
* runner.
|
|
5
|
+
*
|
|
6
|
+
* @example Wire + dispatch (build tooling side)
|
|
7
|
+
* ```ts
|
|
8
|
+
* import { ImporterRegistry } from '@forgeax/engine-import';
|
|
9
|
+
* import { gltfImporter } from '@forgeax/engine-gltf';
|
|
10
|
+
* const importers = new ImporterRegistry();
|
|
11
|
+
* importers.register(gltfImporter);
|
|
12
|
+
* const gltf = importers.get('gltf'); // Importer | undefined
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
export declare class ImporterRegistry {
|
|
16
|
+
private readonly importers;
|
|
17
|
+
/**
|
|
18
|
+
* Register an importer for its `importer.key`. Fail-fast on a malformed
|
|
19
|
+
* importer (charter P3); idempotent on a repeated key (last write wins).
|
|
20
|
+
*
|
|
21
|
+
* @param importer the `{ key, import }` object to register.
|
|
22
|
+
* @throws TypeError when `importer.key` is empty or `importer.import` is not
|
|
23
|
+
* a function - a wire-time misconfiguration the host must fix.
|
|
24
|
+
*/
|
|
25
|
+
register(importer: Importer): void;
|
|
26
|
+
/**
|
|
27
|
+
* Look up the importer registered for `key`. Returns `undefined` when no
|
|
28
|
+
* importer is wired - the import runner maps that to a structured
|
|
29
|
+
* `ImportError(code='importer-not-registered')` with the registered keys in
|
|
30
|
+
* `.detail.registeredImporters` (charter P3).
|
|
31
|
+
*/
|
|
32
|
+
get(key: string): Importer | undefined;
|
|
33
|
+
/**
|
|
34
|
+
* The importer keys currently wired, in insertion order. Fed into the
|
|
35
|
+
* `importer-not-registered` error `.detail.registeredImporters` so AI users
|
|
36
|
+
* see exactly what is injectable.
|
|
37
|
+
*/
|
|
38
|
+
registeredImporters(): readonly string[];
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=importer-registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"importer-registry.d.ts","sourceRoot":"","sources":["../src/importer-registry.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEtD;;;;;;;;;;;;GAYG;AACH,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,QAAQ,CAAC,SAAS,CAA+B;IAEzD;;;;;;;OAOG;IACH,QAAQ,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI;IAclC;;;;;OAKG;IACH,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,QAAQ,GAAG,SAAS;IAItC;;;;OAIG;IACH,mBAAmB,IAAI,SAAS,MAAM,EAAE;CAGzC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type { AnimationClip, AnimationGraph, Asset, AudioClipAsset, EquirectAsset, FontAsset, MaterialAsset, MeshAsset, ParticleEffectAsset, RenderPipelineAsset, SamplerAsset, SceneAsset, SkeletonAsset, SkinAsset, TextureAsset, TilesetAsset, VideoAsset, } from '@forgeax/engine-types';
|
|
2
|
+
export { type CookProduct, IMPORT_ERROR_HINTS, type ImportContext, ImportError, type ImportErrorCode, type ImportErrorDetail, type ImportedAsset, type Importer, type ImportSubAsset, type ImportTransport, } from '@forgeax/engine-types';
|
|
3
|
+
export { createMaterialImportProduct, finalizeImportProducts, type MaterialImportProduct, type MaterialImportProductError, type MaterialImportProductInput, type MaterialImportRefs, type MaterialSourceEvidence, materialImportProductReady, } from './import-product.js';
|
|
4
|
+
export { type DdcPack, type ImportRunnerFs, normaliseForPack, type RunImportMeta, type RunImportOk, type RunImportProductResult, type RunImportResult, runImport, SHADER_RESERVED_IMPORTER_KEY, } from './import-runner.js';
|
|
5
|
+
export { ImporterRegistry } from './importer-registry.js';
|
|
6
|
+
export { type MeshBinEncodeError, packMeshBinV4, } from './mesh-bin.js';
|
|
7
|
+
export { type AssetOutputInput, type AssetOutputPayload, type AssetOutputProducer, AssetOutputProducerRegistry, type AssetOutputProduct, type BuildScriptablePackOptions, buildScriptablePack, type ScriptablePackAssetSnapshot, type ScriptablePackAssetSnapshotSource, type ScriptablePackBuildBridgeResult, type ScriptablePackBuildProduct, type ScriptablePackDomainError, type ScriptablePackExternalEvidence, type ScriptablePackExternalUsage, type ScriptablePackSourceClosureEntry, type ScriptablePackStagedOutput, } from './scriptable-pack.js';
|
|
8
|
+
export { createStandardAssetOutputProducerRegistry, materialAssetOutputProducer, meshAssetOutputProducer, sceneAssetOutputProducer, } from './scriptable-pack-output-producers.js';
|
|
9
|
+
export { createScriptablePackStagedAssetSnapshotSource, type ScriptablePackSnapshotError, type ScriptablePackStagedOwner, type ScriptablePackStagedSnapshotOptions, } from './scriptable-pack-staged-snapshot.js';
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAgBA,YAAY,EACV,aAAa,EACb,cAAc,EACd,KAAK,EACL,cAAc,EACd,aAAa,EACb,SAAS,EACT,aAAa,EACb,SAAS,EACT,mBAAmB,EACnB,mBAAmB,EACnB,YAAY,EACZ,UAAU,EACV,aAAa,EACb,SAAS,EACT,YAAY,EACZ,YAAY,EACZ,UAAU,GACX,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,KAAK,WAAW,EAChB,kBAAkB,EAClB,KAAK,aAAa,EAClB,WAAW,EACX,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,KAAK,aAAa,EACl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