@margoengine/save 0.1.0 → 1.0.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/dist/engine.js CHANGED
@@ -1,4 +1,4 @@
1
- // @margo/core-built 0.1.0
1
+ // @margo/core-built 1.0.0
2
2
  import {coreRequirement as __margoCoreRequirement,assertCore as __margoAssertCore} from '@margoengine/core/extension';
3
3
 
4
4
  import { s as e, t } from "./prefab-DeWmT5ey.js";
@@ -17,7 +17,7 @@ function l(e, t) {
17
17
  scene: t,
18
18
  run(n) {
19
19
  if (!t) return n();
20
- let r, i = {coreRequirement:/*@__PURE__*/__margoCoreRequirement("0.1.0",import.meta.url),
20
+ let r, i = {coreRequirement:/*@__PURE__*/__margoCoreRequirement("1.0.0",import.meta.url),
21
21
  name: c(e, "scene-scope:"),
22
22
  setup() {
23
23
  r = n();
@@ -323,7 +323,7 @@ function F(e, t, n, r) {
323
323
  function I(e, t, n, r, i) {
324
324
  let a = [], o = "save:restore";
325
325
  for (; t.plugins.has(o) || n.some(([e]) => e === o);) o += ":";
326
- let s = {coreRequirement:/*@__PURE__*/__margoCoreRequirement("0.1.0",import.meta.url),
326
+ let s = {coreRequirement:/*@__PURE__*/__margoCoreRequirement("1.0.0",import.meta.url),
327
327
  name: o,
328
328
  setup: c
329
329
  };
@@ -1,8 +1,12 @@
1
1
  // @ts-ignore optional peer: its types apply when it is installed
2
- import { type MaterialCaptureOptions, type MaterialRestoreOptions, type MaterialLibrary } from '@margoengine/materials/serialization';
2
+ import { type MaterialCaptureOptions, type MaterialRestoreOptions, type MaterialLibrary, type MaterialKinds, type RestoredMaterials, type TypedMaterialRestoreOptions } from '@margoengine/materials/serialization';
3
3
  // @ts-ignore optional peer: its types apply when it is installed
4
- export type { MaterialLibrary, MaterialCaptureOptions, MaterialRestoreOptions, } from '@margoengine/materials/serialization';
4
+ export type { MaterialLibrary, MaterialClass, MaterialKinds, RestoredMaterials, TypedMaterialRestoreOptions, MaterialCaptureOptions, MaterialRestoreOptions, } from '@margoengine/materials/serialization';
5
5
  /** Lossless material library: kind, all factors, maps, per-slot UVs, render state and shader parameters. */
6
6
  export declare function captureMaterials(materials: Readonly<Record<string, object>>, options?: MaterialCaptureOptions): Promise<MaterialLibrary>;
7
- /** Recreate materials and shared textures; install returned objects on the loaded scene's meshes. */
7
+ /**
8
+ * Recreate materials and shared textures; install returned objects on the loaded scene's meshes.
9
+ * With `expect: { red: PbrMaterial }` each named result is checked and typed as that class.
10
+ */
11
+ export declare function restoreMaterials<K extends MaterialKinds>(library: MaterialLibrary, options: TypedMaterialRestoreOptions<K>): Promise<RestoredMaterials<K>>;
8
12
  export declare function restoreMaterials(library: MaterialLibrary, options?: MaterialRestoreOptions): Promise<Record<string, object>>;
package/package.json CHANGED
@@ -1,121 +1,121 @@
1
- {
2
- "name": "@margoengine/save",
3
- "version": "0.1.0",
4
- "description": "Save and load: versioned scene and world documents with stable ids, prefabs with overrides, migrations, all-or-nothing loading and storage adapters.",
5
- "keywords": [
6
- "margoengine",
7
- "webgpu",
8
- "3d",
9
- "save",
10
- "load",
11
- "serialization",
12
- "prefab",
13
- "indexeddb",
14
- "localstorage"
15
- ],
16
- "homepage": "https://margoengine.com",
17
- "bugs": {
18
- "url": "https://github.com/scottcampbelldata/margoengine/issues"
19
- },
20
- "repository": {
21
- "type": "git",
22
- "url": "git+https://github.com/scottcampbelldata/margoengine.git",
23
- "directory": "packages/save"
24
- },
25
- "license": "Apache-2.0",
26
- "author": "Scott Campbell",
27
- "type": "module",
28
- "sideEffects": false,
29
- "exports": {
30
- ".": {
31
- "types": "./dist/index.d.ts",
32
- "import": "./dist/index.js"
33
- },
34
- "./delta": {
35
- "types": "./dist/delta.d.ts",
36
- "import": "./dist/delta.js"
37
- },
38
- "./node": {
39
- "types": "./dist/node.d.ts",
40
- "import": "./dist/node.js"
41
- },
42
- "./engine": {
43
- "types": "./dist/engine.d.ts",
44
- "import": "./dist/engine.js"
45
- },
46
- "./slots": {
47
- "types": "./dist/slots.d.ts",
48
- "import": "./dist/slots.js"
49
- },
50
- "./remote": {
51
- "types": "./dist/remote.d.ts",
52
- "import": "./dist/remote.js"
53
- },
54
- "./safe": {
55
- "types": "./dist/safe.d.ts",
56
- "import": "./dist/safe.js"
57
- },
58
- "./opfs": {
59
- "types": "./dist/opfs.d.ts",
60
- "import": "./dist/opfs.js"
61
- },
62
- "./signed": {
63
- "types": "./dist/signed.d.ts",
64
- "import": "./dist/signed.js"
65
- },
66
- "./scene-state": {
67
- "types": "./dist/scene-state.d.ts",
68
- "import": "./dist/scene-state.js"
69
- },
70
- "./materials": {
71
- "types": "./dist/materials.d.ts",
72
- "import": "./dist/materials.js"
73
- }
74
- },
75
- "files": [
76
- "dist",
77
- "LICENSE",
78
- "NOTICE"
79
- ],
80
- "publishConfig": {
81
- "access": "public"
82
- },
83
- "peerDependencies": {
84
- "@margoengine/animation": "^0.1.0",
85
- "@margoengine/core": "^0.1.0",
86
- "@margoengine/gltf": "^0.1.0",
87
- "@margoengine/materials": "^0.1.0",
88
- "@margoengine/shader": "^0.1.0"
89
- },
90
- "peerDependenciesMeta": {
91
- "@margoengine/animation": {
92
- "optional": true
93
- },
94
- "@margoengine/core": {
95
- "optional": true
96
- },
97
- "@margoengine/gltf": {
98
- "optional": true
99
- },
100
- "@margoengine/materials": {
101
- "optional": true
102
- },
103
- "@margoengine/shader": {
104
- "optional": true
105
- }
106
- },
107
- "dependencies": {
108
- "@margoengine/math": "^0.1.0"
109
- },
110
- "devDependencies": {
111
- "@margoengine/core": "^0.1.0",
112
- "@margoengine/ecs": "^0.1.0"
113
- },
114
- "scripts": {
115
- "build": "node ../../scripts/build-optional.js save",
116
- "test": "npm run build && node --test tests/*.test.js",
117
- "prepack": "npm run build",
118
- "test:gpu": "cd ../.. && node packages/save/tests/browser/engine-check.mjs && node packages/save/tests/browser/slots-check.mjs && node packages/save/tests/browser/safe-check.mjs && node packages/save/tests/browser/remote-check.mjs",
119
- "test:gpu:materials": "cd ../.. && node packages/save/tests/browser/materials-check.mjs"
120
- }
121
- }
1
+ {
2
+ "name": "@margoengine/save",
3
+ "version": "1.0.0",
4
+ "description": "Save and load: versioned scene and world documents with stable ids, prefabs with overrides, migrations, all-or-nothing loading and storage adapters.",
5
+ "keywords": [
6
+ "margoengine",
7
+ "webgpu",
8
+ "3d",
9
+ "save",
10
+ "load",
11
+ "serialization",
12
+ "prefab",
13
+ "indexeddb",
14
+ "localstorage"
15
+ ],
16
+ "homepage": "https://margoengine.com",
17
+ "bugs": {
18
+ "url": "https://github.com/scottcampbelldata/margoengine/issues"
19
+ },
20
+ "repository": {
21
+ "type": "git",
22
+ "url": "git+https://github.com/scottcampbelldata/margoengine.git",
23
+ "directory": "packages/save"
24
+ },
25
+ "license": "Apache-2.0",
26
+ "author": "Scott Campbell",
27
+ "type": "module",
28
+ "sideEffects": false,
29
+ "exports": {
30
+ ".": {
31
+ "types": "./dist/index.d.ts",
32
+ "import": "./dist/index.js"
33
+ },
34
+ "./delta": {
35
+ "types": "./dist/delta.d.ts",
36
+ "import": "./dist/delta.js"
37
+ },
38
+ "./node": {
39
+ "types": "./dist/node.d.ts",
40
+ "import": "./dist/node.js"
41
+ },
42
+ "./engine": {
43
+ "types": "./dist/engine.d.ts",
44
+ "import": "./dist/engine.js"
45
+ },
46
+ "./slots": {
47
+ "types": "./dist/slots.d.ts",
48
+ "import": "./dist/slots.js"
49
+ },
50
+ "./remote": {
51
+ "types": "./dist/remote.d.ts",
52
+ "import": "./dist/remote.js"
53
+ },
54
+ "./safe": {
55
+ "types": "./dist/safe.d.ts",
56
+ "import": "./dist/safe.js"
57
+ },
58
+ "./opfs": {
59
+ "types": "./dist/opfs.d.ts",
60
+ "import": "./dist/opfs.js"
61
+ },
62
+ "./signed": {
63
+ "types": "./dist/signed.d.ts",
64
+ "import": "./dist/signed.js"
65
+ },
66
+ "./scene-state": {
67
+ "types": "./dist/scene-state.d.ts",
68
+ "import": "./dist/scene-state.js"
69
+ },
70
+ "./materials": {
71
+ "types": "./dist/materials.d.ts",
72
+ "import": "./dist/materials.js"
73
+ }
74
+ },
75
+ "files": [
76
+ "dist",
77
+ "LICENSE",
78
+ "NOTICE"
79
+ ],
80
+ "publishConfig": {
81
+ "access": "public"
82
+ },
83
+ "peerDependencies": {
84
+ "@margoengine/animation": "^1.0.0",
85
+ "@margoengine/core": "^1.0.0",
86
+ "@margoengine/gltf": "^1.0.0",
87
+ "@margoengine/materials": "^1.0.0",
88
+ "@margoengine/shader": "^1.0.0"
89
+ },
90
+ "peerDependenciesMeta": {
91
+ "@margoengine/animation": {
92
+ "optional": true
93
+ },
94
+ "@margoengine/core": {
95
+ "optional": true
96
+ },
97
+ "@margoengine/gltf": {
98
+ "optional": true
99
+ },
100
+ "@margoengine/materials": {
101
+ "optional": true
102
+ },
103
+ "@margoengine/shader": {
104
+ "optional": true
105
+ }
106
+ },
107
+ "dependencies": {
108
+ "@margoengine/math": "^1.0.0"
109
+ },
110
+ "devDependencies": {
111
+ "@margoengine/core": "^1.0.0",
112
+ "@margoengine/ecs": "^1.0.0"
113
+ },
114
+ "scripts": {
115
+ "build": "node ../../scripts/build-optional.js save",
116
+ "test": "npm run build && node --test tests/*.test.js",
117
+ "prepack": "npm run build",
118
+ "test:gpu": "cd ../.. && node packages/save/tests/browser/engine-check.mjs && node packages/save/tests/browser/slots-check.mjs && node packages/save/tests/browser/safe-check.mjs && node packages/save/tests/browser/remote-check.mjs",
119
+ "test:gpu:materials": "cd ../.. && node packages/save/tests/browser/materials-check.mjs"
120
+ }
121
+ }