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 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.1` |
62
+ | `version` | `0.2.0` |
55
63
  | `type` | `module` (ESM only) |
56
- | `exports["."]` | `./dist/index.js` (+ `.d.ts`) |
57
- | `exports["./node"]` | `./dist/node.js` (+ `.d.ts`): filesystem provider |
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 (`src/index.ts`) re-exports `node-fs.ts` and `http-fetch.ts` as well as the rest of the package. `node-fs.ts` imports `node:fs/promises` and `node:path` at module load, so importing the root entry pulls in Node built-ins. The `./node` and `./http` subpaths are narrower entry points. They do **not** make the root entry browser-safe. A browser bundle that imports the root needs those Node modules stubbed or tree-shaken.
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` (also `./node`)
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 (re-exports everything below, including node-fs and http-fetch)
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
@@ -3,7 +3,6 @@ export * from "./hash.js";
3
3
  export * from "./schema.js";
4
4
  export * from "./acquisition.js";
5
5
  export * from "./fixtures.js";
6
- export * from "./node-fs.js";
7
6
  export * from "./http-fetch.js";
8
7
  export * from "./loader.js";
9
8
  export * from "./admission.js";
package/dist/index.js CHANGED
@@ -3,7 +3,6 @@ export * from "./hash.js";
3
3
  export * from "./schema.js";
4
4
  export * from "./acquisition.js";
5
5
  export * from "./fixtures.js";
6
- export * from "./node-fs.js";
7
6
  export * from "./http-fetch.js";
8
7
  export * from "./loader.js";
9
8
  export * from "./admission.js";
@@ -0,0 +1,8 @@
1
+ export declare function resolveUnderRoot(): never;
2
+ export declare class FilesystemAcquisitionProvider {
3
+ constructor();
4
+ }
5
+ export type FilesystemProviderOptions = {
6
+ root: string;
7
+ maxBytes?: number;
8
+ };
@@ -0,0 +1,11 @@
1
+ function nodeOnly() {
2
+ throw new Error("conveyor-engine-assets/node is Node-only");
3
+ }
4
+ export function resolveUnderRoot() {
5
+ nodeOnly();
6
+ }
7
+ export class FilesystemAcquisitionProvider {
8
+ constructor() {
9
+ nodeOnly();
10
+ }
11
+ }
package/package.json CHANGED
@@ -1,8 +1,9 @@
1
1
  {
2
2
  "name": "conveyor-engine-assets",
3
- "version": "0.1.1",
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
- "import": "./dist/node.js"
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
@@ -3,7 +3,6 @@ export * from "./hash.js";
3
3
  export * from "./schema.js";
4
4
  export * from "./acquisition.js";
5
5
  export * from "./fixtures.js";
6
- export * from "./node-fs.js";
7
6
  export * from "./http-fetch.js";
8
7
  export * from "./loader.js";
9
8
  export * from "./admission.js";
@@ -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
+ };