@forgeax/engine-gltf 0.1.27 → 0.1.28
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 +12 -10
- package/dist/cli-gltf.d.ts.map +1 -1
- package/dist/cli-gltf.mjs +13 -13
- package/dist/cli-gltf.mjs.map +1 -1
- package/dist/importer-entry.mjs +3 -3
- package/dist/importer-entry.mjs.map +1 -1
- package/dist/index.mjs +3 -3
- package/dist/index.mjs.map +1 -1
- package/dist/node-file-entry.mjs +3 -3
- package/dist/node-file-entry.mjs.map +1 -1
- package/package.json +13 -16
- package/src/__tests__/cli-gltf.integration.test.ts +1 -1
- package/src/__tests__/gltf.unit.test.ts +1 -1
- package/src/cli-gltf.ts +16 -18
- package/src/errors.ts +3 -3
package/package.json
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forgeax/engine-gltf",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.28",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"sideEffects": false,
|
|
8
|
-
"description": "Runtime glTF 2.0 importer
|
|
9
|
-
"bin": {
|
|
10
|
-
"forgeax-engine-remote-gltf": "./dist/cli-gltf.mjs"
|
|
11
|
-
},
|
|
8
|
+
"description": "Runtime glTF 2.0 importer and build-time producer. Pure-function parseGlb / parseGltf / toAssetPack is invoked by the unified ForgeaX asset command and writes <source>.meta.json for runtime loadByGuid<SceneAsset>.",
|
|
12
9
|
"exports": {
|
|
13
10
|
".": {
|
|
14
11
|
"types": "./dist/index.d.ts",
|
|
@@ -38,21 +35,21 @@
|
|
|
38
35
|
"LICENSE"
|
|
39
36
|
],
|
|
40
37
|
"dependencies": {
|
|
41
|
-
"@forgeax/engine-animation": "0.1.
|
|
42
|
-
"@forgeax/engine-geometry": "0.1.
|
|
43
|
-
"@forgeax/engine-import": "0.1.
|
|
44
|
-
"@forgeax/engine-math": "0.1.
|
|
45
|
-
"@forgeax/engine-pack": "0.1.
|
|
46
|
-
"@forgeax/engine-scene": "0.1.
|
|
47
|
-
"@forgeax/engine-types": "0.1.
|
|
38
|
+
"@forgeax/engine-animation": "0.1.28",
|
|
39
|
+
"@forgeax/engine-geometry": "0.1.28",
|
|
40
|
+
"@forgeax/engine-import": "0.1.28",
|
|
41
|
+
"@forgeax/engine-math": "0.1.28",
|
|
42
|
+
"@forgeax/engine-pack": "0.1.28",
|
|
43
|
+
"@forgeax/engine-scene": "0.1.28",
|
|
44
|
+
"@forgeax/engine-types": "0.1.28",
|
|
48
45
|
"@webgpu/types": "^0.1.71",
|
|
49
46
|
"meshoptimizer": "^0.20.0"
|
|
50
47
|
},
|
|
51
48
|
"devDependencies": {
|
|
52
|
-
"@forgeax/engine-assets-runtime": "0.1.
|
|
53
|
-
"@forgeax/engine-picking": "0.1.
|
|
54
|
-
"@forgeax/engine-render": "0.1.
|
|
55
|
-
"@forgeax/engine-runtime": "0.1.
|
|
49
|
+
"@forgeax/engine-assets-runtime": "0.1.28",
|
|
50
|
+
"@forgeax/engine-picking": "0.1.28",
|
|
51
|
+
"@forgeax/engine-render": "0.1.28",
|
|
52
|
+
"@forgeax/engine-runtime": "0.1.28",
|
|
56
53
|
"@types/node": "^20.14.0"
|
|
57
54
|
},
|
|
58
55
|
"forgeax": {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// packages/gltf/src/__tests__/cli-gltf.integration.test.ts
|
|
2
2
|
//
|
|
3
|
-
// Integration test: run `forgeax
|
|
3
|
+
// Integration test: run `forgeax asset import import` against real
|
|
4
4
|
// glTF files and verify the written .meta.json sidecar contains texture
|
|
5
5
|
// sub-assets (feat-20260608 M6 w29 AC-18).
|
|
6
6
|
//
|
|
@@ -189,7 +189,7 @@ function unwrapReimport(result: ReturnType<typeof reimportReuseMeta>) {
|
|
|
189
189
|
await rm(tempDir, { recursive: true, force: true });
|
|
190
190
|
});
|
|
191
191
|
|
|
192
|
-
describe('cli-gltf (forgeax
|
|
192
|
+
describe('cli-gltf (forgeax asset import plugin bin)', () => {
|
|
193
193
|
describe('subcommand routing (a)', () => {
|
|
194
194
|
it('prints help on --help and exits 0', async () => {
|
|
195
195
|
const io = makeIO();
|
package/src/cli-gltf.ts
CHANGED
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
// @forgeax/engine-gltf/src/cli-gltf —
|
|
3
|
-
//
|
|
4
|
-
// 2.9). Discovered by the base bin via the kubectl 4th-path
|
|
5
|
-
// `forgeax-engine-remote-` prefix scanner.
|
|
2
|
+
// @forgeax/engine-gltf/src/cli-gltf — internal producer used by DevKit's
|
|
3
|
+
// unified `forgeax asset import` command. It is deliberately not a package bin.
|
|
6
4
|
//
|
|
7
5
|
// Single subcommand `import` for v1 (UX break vs the prior
|
|
8
|
-
// `forgeax
|
|
6
|
+
// `forgeax asset import`):
|
|
9
7
|
//
|
|
10
|
-
// write mode `forgeax
|
|
8
|
+
// write mode `forgeax asset import <gltf-or-glb> --root <project>`
|
|
11
9
|
// Parses the source via parseGlb / parseGltf and writes the
|
|
12
10
|
// sibling `<source>.meta.json` sidecar (sorted-keys, LF line
|
|
13
11
|
// ending — byte-stable so a clean reimport produces no diff).
|
|
14
12
|
//
|
|
15
|
-
// --check `forgeax
|
|
13
|
+
// --check `forgeax asset import <dir> --dry-run --root <project>`
|
|
16
14
|
// Dry-run: traverse <dir> reusing SCANNER_BLACKLIST from
|
|
17
15
|
// @forgeax/engine-pack/scanner and surface the first orphan
|
|
18
16
|
// .gltf / .glb whose `<source>.meta.json` is absent as
|
|
@@ -55,14 +53,14 @@ function emitError(ctx: AssetCtx, err: ErrShape): number {
|
|
|
55
53
|
|
|
56
54
|
function helpBody(): string {
|
|
57
55
|
return [
|
|
58
|
-
'forgeax
|
|
56
|
+
'forgeax asset import — glTF / GLB sidecar importer (internal producer)',
|
|
59
57
|
'',
|
|
60
58
|
'Usage:',
|
|
61
|
-
' forgeax
|
|
62
|
-
' forgeax
|
|
59
|
+
' forgeax asset import <path.gltf|path.glb> --root <project>',
|
|
60
|
+
' forgeax asset import <dir> --dry-run --root <project>',
|
|
63
61
|
'',
|
|
64
|
-
'
|
|
65
|
-
'
|
|
62
|
+
'produces texture, mesh, material, and scene sub-asset entries in a sibling',
|
|
63
|
+
'<source>.meta.json sidecar.',
|
|
66
64
|
'',
|
|
67
65
|
].join('\n');
|
|
68
66
|
}
|
|
@@ -77,7 +75,7 @@ export async function runCliGltf(rest: string[], ctx: AssetCtx): Promise<number>
|
|
|
77
75
|
return emitError(ctx, {
|
|
78
76
|
code: 'unknown-subcommand',
|
|
79
77
|
expected: "subcommand 'import'",
|
|
80
|
-
hint: "run 'forgeax
|
|
78
|
+
hint: "run 'forgeax help asset import' for usage",
|
|
81
79
|
detail: { subcommand: sub },
|
|
82
80
|
});
|
|
83
81
|
}
|
|
@@ -100,8 +98,8 @@ async function runImport(rest: string[], ctx: AssetCtx): Promise<number> {
|
|
|
100
98
|
const message = e instanceof Error ? e.message : String(e);
|
|
101
99
|
return emitError(ctx, {
|
|
102
100
|
code: 'cli-parse-error',
|
|
103
|
-
expected: 'forgeax
|
|
104
|
-
hint: "run 'forgeax
|
|
101
|
+
expected: 'forgeax asset import [--dry-run] <path> --root <project>',
|
|
102
|
+
hint: "run 'forgeax help asset import' for usage",
|
|
105
103
|
detail: { message },
|
|
106
104
|
});
|
|
107
105
|
}
|
|
@@ -110,8 +108,8 @@ async function runImport(rest: string[], ctx: AssetCtx): Promise<number> {
|
|
|
110
108
|
return emitError(ctx, {
|
|
111
109
|
code: 'cli-parse-error',
|
|
112
110
|
expected: check
|
|
113
|
-
? 'forgeax
|
|
114
|
-
: 'forgeax
|
|
111
|
+
? 'forgeax asset import <dir> --dry-run --root <project>'
|
|
112
|
+
: 'forgeax asset import <path.gltf|path.glb> --root <project>',
|
|
115
113
|
hint: 'pass a positional <gltf-or-glb> argument; with --check pass a directory',
|
|
116
114
|
});
|
|
117
115
|
}
|
|
@@ -192,7 +190,7 @@ async function runCheck(target: string, ctx: AssetCtx): Promise<number> {
|
|
|
192
190
|
const message = e instanceof Error ? e.message : String(e);
|
|
193
191
|
return emitError(ctx, {
|
|
194
192
|
code: 'cli-parse-error',
|
|
195
|
-
expected: 'forgeax
|
|
193
|
+
expected: 'forgeax asset import <dir> --dry-run --root <project>',
|
|
196
194
|
hint: 'pass a directory that exists and is readable',
|
|
197
195
|
detail: { path: target, message },
|
|
198
196
|
});
|
package/src/errors.ts
CHANGED
|
@@ -267,7 +267,7 @@ const gltfErrorPolicy = {
|
|
|
267
267
|
'gltf-malformed-header': {
|
|
268
268
|
expected:
|
|
269
269
|
'GLB 12-byte header (magic 0x46546C67 + version=2 + length) plus mandatory JSON chunk',
|
|
270
|
-
hint: 'verify .glb is not truncated; rerun: forgeax
|
|
270
|
+
hint: 'verify .glb is not truncated; rerun: forgeax asset import <path> --root <project> --json',
|
|
271
271
|
},
|
|
272
272
|
'gltf-version-unsupported': {
|
|
273
273
|
expected: 'asset.version === "2.0"',
|
|
@@ -305,7 +305,7 @@ const gltfErrorPolicy = {
|
|
|
305
305
|
},
|
|
306
306
|
'gltf-meta-missing': {
|
|
307
307
|
expected: "sidecar <source>.meta.json (importer: 'gltf') present in same directory",
|
|
308
|
-
hint: 'run: forgeax
|
|
308
|
+
hint: 'run: forgeax asset import <path> --root <project> --json',
|
|
309
309
|
},
|
|
310
310
|
'gltf-instancing-count-mismatch': {
|
|
311
311
|
expected: 'all instance attribute accessors share the same count',
|
|
@@ -334,7 +334,7 @@ const gltfErrorPolicy = {
|
|
|
334
334
|
'gltf-image-extract-failed': {
|
|
335
335
|
expected:
|
|
336
336
|
'image bytes extractable from bufferView / data-URI / external URI without corruption',
|
|
337
|
-
hint: 'verify the bufferView byte range / data: URI base64 / external URI sibling file is intact next to the .gltf source; rerun: forgeax
|
|
337
|
+
hint: 'verify the bufferView byte range / data: URI base64 / external URI sibling file is intact next to the .gltf source; rerun: forgeax asset import <path> --root <project> --json',
|
|
338
338
|
},
|
|
339
339
|
'gltf-skin-attr-asymmetric': {
|
|
340
340
|
expected:
|