conveyor-engine-assets 0.1.1 → 0.2.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/README.md +16 -6
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/node-unavailable.d.ts +8 -0
- package/dist/node-unavailable.js +11 -0
- package/package.json +4 -2
- package/src/index.ts +0 -1
- package/src/node-unavailable.ts +18 -0
package/README.md
CHANGED
|
@@ -11,6 +11,14 @@ The package keeps two planes apart:
|
|
|
11
11
|
|
|
12
12
|
It has no renderer dependency. GLB files are inspected structurally without `three`, and collision artifacts are flattened into the AABB shape that `conveyor-engine-world` uses.
|
|
13
13
|
|
|
14
|
+
## Migrating to 0.2.0
|
|
15
|
+
|
|
16
|
+
The root entry no longer re-exports the filesystem provider. Import it from `conveyor-engine-assets/node`. `http-fetch` stays on the root (it uses `fetch`) and on `./http`.
|
|
17
|
+
|
|
18
|
+
| Before | After |
|
|
19
|
+
| --- | --- |
|
|
20
|
+
| `import { FilesystemAcquisitionProvider, resolveUnderRoot } from "conveyor-engine-assets"` | `import { FilesystemAcquisitionProvider, resolveUnderRoot } from "conveyor-engine-assets/node"` |
|
|
21
|
+
|
|
14
22
|
---
|
|
15
23
|
|
|
16
24
|
## Contents
|
|
@@ -51,10 +59,11 @@ It has no renderer dependency. GLB files are inspected structurally without `thr
|
|
|
51
59
|
| Field | Value |
|
|
52
60
|
| --- | --- |
|
|
53
61
|
| `name` | `conveyor-engine-assets` |
|
|
54
|
-
| `version` | `0.0
|
|
62
|
+
| `version` | `0.2.0` |
|
|
55
63
|
| `type` | `module` (ESM only) |
|
|
56
|
-
| `
|
|
57
|
-
| `exports["
|
|
64
|
+
| `sideEffects` | `false` |
|
|
65
|
+
| `exports["."]` | `./dist/index.js` (+ `.d.ts`), browser-safe |
|
|
66
|
+
| `exports["./node"]` | filesystem provider on Node; throwing stub otherwise |
|
|
58
67
|
| `exports["./http"]` | `./dist/http.js` (+ `.d.ts`): HTTP provider |
|
|
59
68
|
| `files` | `dist`, `src` |
|
|
60
69
|
| `license` | `ISC` |
|
|
@@ -65,7 +74,7 @@ Inside the monorepo, depend on it by path:
|
|
|
65
74
|
"dependencies": { "conveyor-engine-assets": "file:../conveyor-engine-assets" }
|
|
66
75
|
```
|
|
67
76
|
|
|
68
|
-
> **Note on entry points.** The root barrel
|
|
77
|
+
> **Note on entry points.** The root barrel re-exports `http-fetch.ts` (global `fetch`) and the rest of the browser-safe package. It does not re-export `node-fs.ts`. Import `FilesystemAcquisitionProvider` and `resolveUnderRoot` from `conveyor-engine-assets/node`. That subpath is Node-only; a browser import loads a stub that throws.
|
|
69
78
|
|
|
70
79
|
---
|
|
71
80
|
|
|
@@ -194,7 +203,7 @@ Shared type vocabulary:
|
|
|
194
203
|
- A `FixtureScript` can set `delayMs` (abortable), `fail`, `cancel`, or `completeAfterAbort`. With `completeAfterAbort` the fixture finishes its delay and then rejects with `stale` if the caller has aborted.
|
|
195
204
|
- `FixtureRegistry` is a fluent wrapper around the provider: `put`, `success`, and `fail`.
|
|
196
205
|
|
|
197
|
-
### `node-fs.ts` (
|
|
206
|
+
### `node-fs.ts` (`conveyor-engine-assets/node` only)
|
|
198
207
|
|
|
199
208
|
- `FilesystemAcquisitionProvider({ root, maxBytes = 32 MiB })` reads files relative to `root`. It accepts scheme-less URIs and the file scheme, and rejects other schemes.
|
|
200
209
|
- It sets the content type for `.json`, `.glb`, and `.gltf`. A missing file maps to `not-found`.
|
|
@@ -410,8 +419,9 @@ if (resolved.kind === "primitive") console.warn("fallback:", resolved.reason);
|
|
|
410
419
|
conveyor-engine-assets/
|
|
411
420
|
├── package.json, tsconfig.json, README.md
|
|
412
421
|
├── src/
|
|
413
|
-
│ ├── index.ts # barrel (
|
|
422
|
+
│ ├── index.ts # browser-safe barrel (no node-fs)
|
|
414
423
|
│ ├── node.ts # ./node subpath → FilesystemAcquisitionProvider, resolveUnderRoot
|
|
424
|
+
│ ├── node-unavailable.ts
|
|
415
425
|
│ ├── http.ts # ./http subpath → HttpAcquisitionProvider
|
|
416
426
|
│ ├── types.ts # kinds, authorities, records, manifest, metrics, events
|
|
417
427
|
│ ├── hash.ts # portable SHA-256, canonical JSON
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "conveyor-engine-assets",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Deterministic, provenance-aware asset identity, manifest, and memory loader for Conveyor Engine",
|
|
5
5
|
"type": "module",
|
|
6
|
+
"sideEffects": false,
|
|
6
7
|
"main": "./dist/index.js",
|
|
7
8
|
"types": "./dist/index.d.ts",
|
|
8
9
|
"exports": {
|
|
@@ -12,7 +13,8 @@
|
|
|
12
13
|
},
|
|
13
14
|
"./node": {
|
|
14
15
|
"types": "./dist/node.d.ts",
|
|
15
|
-
"
|
|
16
|
+
"node": "./dist/node.js",
|
|
17
|
+
"default": "./dist/node-unavailable.js"
|
|
16
18
|
},
|
|
17
19
|
"./http": {
|
|
18
20
|
"types": "./dist/http.d.ts",
|
package/src/index.ts
CHANGED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
function nodeOnly(): never {
|
|
2
|
+
throw new Error("conveyor-engine-assets/node is Node-only");
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
export function resolveUnderRoot(): never {
|
|
6
|
+
nodeOnly();
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export class FilesystemAcquisitionProvider {
|
|
10
|
+
constructor() {
|
|
11
|
+
nodeOnly();
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export type FilesystemProviderOptions = {
|
|
16
|
+
root: string;
|
|
17
|
+
maxBytes?: number;
|
|
18
|
+
};
|