@margoengine/ecs 0.0.0-stage → 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.
@@ -0,0 +1,355 @@
1
+ //#region src/serialize-codec.ts
2
+ var e = {
3
+ Int8Array,
4
+ Uint8Array,
5
+ Uint8ClampedArray,
6
+ Int16Array,
7
+ Uint16Array,
8
+ Int32Array,
9
+ Uint32Array,
10
+ Float32Array,
11
+ Float64Array,
12
+ BigInt64Array,
13
+ BigUint64Array,
14
+ DataView
15
+ };
16
+ function t(e) {
17
+ if (typeof e.toBase64 == "function") return e.toBase64();
18
+ let t = "";
19
+ for (let n = 0; n < e.length; n += 32768) t += String.fromCharCode(...e.subarray(n, n + 32768));
20
+ return btoa(t);
21
+ }
22
+ function n(e) {
23
+ if (typeof Uint8Array.fromBase64 == "function") return Uint8Array.fromBase64(e, { lastChunkHandling: "strict" });
24
+ let t = e.replace(/[\t\n\f\r ]+/g, "");
25
+ if (t.length % 4 || !/^[A-Za-z0-9+/]*={0,2}$/.test(t)) throw SyntaxError("Invalid base64 text");
26
+ let n = atob(t);
27
+ if (btoa(n) !== t) throw SyntaxError("Invalid base64 text");
28
+ let r = new Uint8Array(n.length);
29
+ for (let e = 0; e < n.length; e++) r[e] = n.charCodeAt(e);
30
+ return r;
31
+ }
32
+ function r(e) {
33
+ if (typeof e.toHex == "function") return e.toHex();
34
+ let t = "";
35
+ for (let n of e) t += n.toString(16).padStart(2, "0");
36
+ return t;
37
+ }
38
+ function i() {
39
+ throw TypeError("Invalid snapshot value; use portable data or register a named value codec");
40
+ }
41
+ function a(e, t = 1e6) {
42
+ return typeof e == "number" && Number.isInteger(e) && e >= 0 && e <= t;
43
+ }
44
+ function o(n, r = []) {
45
+ l(r);
46
+ let o = /* @__PURE__ */ new Map(), s = [];
47
+ function c(n, l = 0) {
48
+ if (l > 256) throw RangeError("Snapshot graph too deep; keep reference nesting below 257 levels");
49
+ if (n === void 0) return [1];
50
+ if (typeof n == "bigint") return [2, String(n)];
51
+ if (typeof n == "number" && (!Number.isFinite(n) || Object.is(n, -0))) return [3, String(Object.is(n, -0) ? "-0" : n)];
52
+ if (n === null || [
53
+ "string",
54
+ "number",
55
+ "boolean"
56
+ ].includes(typeof n)) return n;
57
+ if (typeof n != "object" && typeof n != "function") return i();
58
+ let u = o.get(n);
59
+ if (u !== void 0) return [0, u];
60
+ if (s.length >= 1e6) throw RangeError("Too many snapshot objects; keep the graph below 1000000 nodes");
61
+ let d = s.length, f = [];
62
+ o.set(n, d), s.push(f);
63
+ let p = (e) => c(e, l + 1), m = r.find((e) => e.test(n));
64
+ if (m) f.push("x", m.name, p(m.encode(n)));
65
+ else if (n instanceof ArrayBuffer) f.push("b", t(new Uint8Array(n)));
66
+ else if (ArrayBuffer.isView(n)) {
67
+ let t = n instanceof DataView ? "DataView" : Object.getPrototypeOf(n).constructor.name;
68
+ if (!Object.hasOwn(e, t)) return i();
69
+ f.push("v", t, p(n.buffer), n.byteOffset, n instanceof DataView ? n.byteLength : n.length);
70
+ } else if (n instanceof Date) f.push("d", p(n.getTime()));
71
+ else if (n instanceof RegExp) f.push("r", n.source, n.flags, n.lastIndex);
72
+ else if (n instanceof Map) f.push("m", [...n].map(([e, t]) => [p(e), p(t)]));
73
+ else if (n instanceof Set) f.push("s", [...n].map(p));
74
+ else {
75
+ let e = Object.getPrototypeOf(n);
76
+ if (!Array.isArray(n) && e !== Object.prototype && e !== null) return i();
77
+ let t = Object.keys(n).sort().map((e) => {
78
+ let t = Object.getOwnPropertyDescriptor(n, e);
79
+ return "value" in t ? [e, p(t.value)] : i();
80
+ });
81
+ if (Object.getOwnPropertySymbols(n).some((e) => Object.getOwnPropertyDescriptor(n, e)?.enumerable)) return i();
82
+ if (Array.isArray(n)) {
83
+ if (!a(n.length)) throw RangeError("Snapshot array too large; use at most 1000000 entries per JS array");
84
+ f.push("a", n.length, t);
85
+ } else f.push("o", e === null, t);
86
+ }
87
+ return [0, d];
88
+ }
89
+ let u = c(n);
90
+ return JSON.stringify({
91
+ value: u,
92
+ nodes: s
93
+ });
94
+ }
95
+ function s(t, r = []) {
96
+ l(r);
97
+ let o = JSON.parse(t);
98
+ if (!o || !Array.isArray(o.nodes) || o.nodes.length > 1e6) return i();
99
+ let s = o.nodes, c = [], u = [];
100
+ function d(t, o = 0) {
101
+ if (o > 256) throw RangeError("Snapshot graph too deep; use a graph nested below 257 levels");
102
+ if (t === null || typeof t == "string" || typeof t == "boolean" || typeof t == "number" && Number.isFinite(t)) return t;
103
+ if (!Array.isArray(t)) return i();
104
+ if (t.length === 1 && t[0] === 1) return;
105
+ if (t.length !== 2) return i();
106
+ if (t[0] === 2 && typeof t[1] == "string" && /^-?(0|[1-9][0-9]*)$/.test(t[1])) return BigInt(t[1]);
107
+ if (t[0] === 3 && [
108
+ "NaN",
109
+ "Infinity",
110
+ "-Infinity",
111
+ "-0"
112
+ ].includes(t[1])) return Number(t[1]);
113
+ if (t[0] !== 0 || !a(t[1], s.length - 1)) return i();
114
+ let l = t[1];
115
+ if (u[l]) return u[l] === 1 && c[l] === void 0 ? i() : c[l];
116
+ let f = s[l];
117
+ if (!Array.isArray(f)) return i();
118
+ u[l] = 1;
119
+ let p = (e) => d(e, o + 1), m;
120
+ if (f[0] === "b" && f.length === 2 && typeof f[1] == "string") m = n(f[1]).buffer;
121
+ else if (f[0] === "v" && f.length === 5 && typeof f[1] == "string" && Object.hasOwn(e, f[1]) && a(f[3], 67108864) && a(f[4], 67108864)) {
122
+ let t = p(f[2]);
123
+ if (!(t instanceof ArrayBuffer)) return i();
124
+ m = new e[f[1]](t, f[3], f[4]);
125
+ } else if (f[0] === "d" && f.length === 2) {
126
+ let e = p(f[1]);
127
+ if (typeof e != "number") return i();
128
+ m = new Date(e);
129
+ } else if (f[0] === "r" && f.length === 4 && typeof f[1] == "string" && typeof f[2] == "string" && a(f[3], 4294967295)) m = new RegExp(f[1], f[2]), m.lastIndex = f[3];
130
+ else if (f[0] === "x" && f.length === 3 && typeof f[1] == "string") {
131
+ let e = r.find((e) => e.name === f[1]);
132
+ if (!e) return i();
133
+ m = e.decode(p(f[2]));
134
+ } else if (f[0] === "m" && f.length === 2 && Array.isArray(f[1])) {
135
+ let e = /* @__PURE__ */ new Map();
136
+ c[l] = e;
137
+ for (let t of f[1]) {
138
+ if (!Array.isArray(t) || t.length !== 2) return i();
139
+ e.set(p(t[0]), p(t[1]));
140
+ }
141
+ m = e;
142
+ } else if (f[0] === "s" && f.length === 2 && Array.isArray(f[1])) {
143
+ let e = /* @__PURE__ */ new Set();
144
+ c[l] = e;
145
+ for (let t of f[1]) e.add(p(t));
146
+ m = e;
147
+ } else if ((f[0] === "a" || f[0] === "o") && f.length === 3 && Array.isArray(f[2])) {
148
+ if (f[0] === "a" ? !a(f[1]) : typeof f[1] != "boolean") return i();
149
+ let e = f[0] === "a" ? Array(f[1]) : Object.create(f[1] ? null : Object.prototype);
150
+ c[l] = e;
151
+ let t = /* @__PURE__ */ new Set();
152
+ for (let n of f[2]) {
153
+ if (!Array.isArray(n) || n.length !== 2 || typeof n[0] != "string" || t.has(n[0]) || f[0] === "a" && n[0] === "length" || (t.add(n[0]), f[0] === "a" && /^(0|[1-9][0-9]*)$/.test(n[0]) && Number(n[0]) < 4294967295 && Number(n[0]) >= f[1])) return i();
154
+ Object.defineProperty(e, n[0], {
155
+ value: p(n[1]),
156
+ writable: !0,
157
+ configurable: !0,
158
+ enumerable: !0
159
+ });
160
+ }
161
+ m = e;
162
+ } else return i();
163
+ return u[l] = 2, c[l] = m, m;
164
+ }
165
+ return d(o.value);
166
+ }
167
+ function c(e) {
168
+ let t = e.maxBytes ?? 67108864;
169
+ if (!Number.isSafeInteger(t) || t < 1 || t > 2147483647) throw RangeError("Invalid snapshot byte limit; use 1 to 2147483647");
170
+ return t;
171
+ }
172
+ function l(e) {
173
+ (!Array.isArray(e) || e.some((e) => !e || typeof e.name != "string" || !e.name.trim() || typeof e.test != "function" || typeof e.encode != "function" || typeof e.decode != "function") || new Set(e.map((e) => e.name)).size !== e.length) && i();
174
+ }
175
+ async function u(e, t, n) {
176
+ let r = c(n), i = n.signal;
177
+ if (i?.throwIfAborted(), e.byteLength > r) throw RangeError("Snapshot exceeds byte limit; raise maxBytes deliberately");
178
+ let a = new Blob([e]).stream().pipeThrough(t ? new DecompressionStream("deflate") : new CompressionStream("deflate"), { signal: i }).getReader(), o = [], s = 0;
179
+ try {
180
+ for (;;) {
181
+ let e = await a.read();
182
+ if (i?.throwIfAborted(), e.done) break;
183
+ if (s += e.value.length, s > r) throw await a.cancel(), RangeError("Expanded snapshot exceeds byte limit; raise maxBytes deliberately");
184
+ o.push(e.value);
185
+ }
186
+ } finally {
187
+ a.releaseLock();
188
+ }
189
+ let l = new Uint8Array(s), u = 0;
190
+ for (let e of o) l.set(e, u), u += e.length;
191
+ return l;
192
+ }
193
+ //#endregion
194
+ //#region src/serialize.ts
195
+ var d = new Uint8Array(new Uint16Array([1]).buffer)[0] === 1, f = [
196
+ Float32Array,
197
+ Float64Array,
198
+ Int32Array,
199
+ Uint32Array,
200
+ Uint8Array
201
+ ], p = new TextEncoder(), m = new TextDecoder("utf-8", { fatal: !0 });
202
+ function h() {
203
+ throw TypeError("Invalid ECS snapshot or schema; use a complete version-1 packet with matching named components");
204
+ }
205
+ function g(e) {
206
+ let t = new Uint32Array(e.capacity);
207
+ return [...t.subarray(0, e.entities(t))].sort((e, t) => e - t);
208
+ }
209
+ function _(e) {
210
+ return e.fields;
211
+ }
212
+ function v(e) {
213
+ return typeof e == "number" && Number.isInteger(e) && e >= 0 && e <= 4294967295;
214
+ }
215
+ function y(e) {
216
+ return Array.isArray(e) && e.every(v) && new Set(e).size === e.length;
217
+ }
218
+ async function b(e, t, n) {
219
+ let r = p.encode(e), i = c(n);
220
+ if (r.length > i) throw RangeError("Snapshot text exceeds byte limit; raise maxBytes deliberately");
221
+ let a = await u(r, !1, n), o = new Uint8Array(a.length + 4);
222
+ if (o.length > i) throw RangeError("Snapshot packet exceeds byte limit; raise maxBytes deliberately");
223
+ return o.set([
224
+ 69,
225
+ 67,
226
+ t,
227
+ 49
228
+ ]), o.set(a, 4), o;
229
+ }
230
+ async function x(e, t, n) {
231
+ return n.signal?.throwIfAborted(), !(e instanceof Uint8Array) || e.length > c(n) || e.length < 5 || e[0] !== 69 || e[1] !== 67 || e[2] !== t || e[3] !== 49 ? h() : m.decode(await u(e.subarray(4), !0, n));
232
+ }
233
+ var S = class {
234
+ constructor(e, t) {
235
+ if (this.world = e, this.stores = Object.entries(t).sort(([e], [t]) => e < t ? -1 : +(e > t)), !this.stores.length || this.stores.some(([, t]) => t.world !== e || Object.values(_(t)).some((e) => !Array.isArray(e) && !f.some((t) => e instanceof t)))) return h();
236
+ }
237
+ async snapshot(e = {}) {
238
+ e.signal?.throwIfAborted();
239
+ let t = g(this.world), n = new Set(t);
240
+ return b(o({
241
+ version: 1,
242
+ littleEndian: d,
243
+ entities: t,
244
+ components: this.stores.map(([e, t]) => {
245
+ let r = [...t.entities.subarray(0, t.size)].filter((e) => n.has(e)).sort((e, t) => e - t), i = {};
246
+ for (let e of Object.keys(_(t)).sort()) {
247
+ let n = _(t)[e], a;
248
+ if (Array.isArray(n)) a = r.map((e) => n[t.index(e)]);
249
+ else {
250
+ if ((n instanceof Float32Array || n instanceof Float64Array) && !n.every(Number.isFinite)) throw RangeError("Nonfinite numeric component data; keep numeric fields finite as required by Component.add");
251
+ let e = n.constructor;
252
+ a = new e(r.length);
253
+ let i = n.BYTES_PER_ELEMENT, o = new Uint8Array(a.buffer);
254
+ r.forEach((e, r) => o.set(new Uint8Array(n.buffer, n.byteOffset + t.index(e) * i, i), r * i));
255
+ }
256
+ Object.defineProperty(i, e, {
257
+ value: a,
258
+ enumerable: !0
259
+ });
260
+ }
261
+ return {
262
+ name: e,
263
+ entities: r,
264
+ fields: i
265
+ };
266
+ })
267
+ }, e.codecs), 83, e);
268
+ }
269
+ async restore(e, t = {}) {
270
+ let n = s(await x(e, 83, t), t.codecs);
271
+ if (!n || typeof n != "object") return h();
272
+ let r = n;
273
+ if (r.version !== 1 || r.littleEndian !== d || !y(r.entities) || !Array.isArray(r.components) || r.components.length !== this.stores.length) return h();
274
+ let i = new Set(r.entities), a = /* @__PURE__ */ new Set();
275
+ for (let e of r.components) {
276
+ if (!e || typeof e.name != "string" || a.has(e.name) || !y(e.entities) || e.entities.some((e) => !i.has(e)) || !e.fields || typeof e.fields != "object") return h();
277
+ a.add(e.name);
278
+ let t = this.stores.find(([t]) => t === e.name)?.[1];
279
+ if (!t) return h();
280
+ let n = _(t), r = Object.keys(n).sort();
281
+ if (JSON.stringify(Object.keys(e.fields).sort()) !== JSON.stringify(r)) return h();
282
+ for (let t of r) {
283
+ let r = e.fields[t], i = n[t];
284
+ if ((Array.isArray(i) ? !Array.isArray(r) : !r || r.constructor !== i.constructor) || r.length !== e.entities.length || (r instanceof Float32Array || r instanceof Float64Array) && !r.every(Number.isFinite)) return h();
285
+ }
286
+ }
287
+ if (r.entities.length > this.world.stride) throw RangeError("Snapshot entity count exceeds world capacity limit; restore into a larger world");
288
+ let o = new Map(t.entities ?? g(this.world).map((e) => [e, e]));
289
+ if ([...o].some(([e, t]) => !v(e) || !v(t)) || new Set(o.values()).size !== o.size) return h();
290
+ let c = [...o].filter(([e, t]) => !i.has(e) && this.world.alive(t)).map(([, e]) => e), l = new Set(o.values());
291
+ for (let e of g(this.world)) l.has(e) || c.push(e);
292
+ let u = r.entities.filter((e) => !o.has(e) || !this.world.alive(o.get(e))), f = c.filter((e) => (Math.floor(e / this.world.stride) + 1) * this.world.stride + e % this.world.stride <= 4294967295).length;
293
+ this.world.reserve(Math.max(0, u.length - f)), t.signal?.throwIfAborted();
294
+ for (let e of c) this.world.destroy(e);
295
+ let p = /* @__PURE__ */ new Map();
296
+ for (let e of r.entities) {
297
+ let t = o.get(e);
298
+ p.set(e, t !== void 0 && this.world.alive(t) ? t : this.world.create());
299
+ }
300
+ for (let e of r.components) {
301
+ let t = this.stores.find(([t]) => t === e.name)[1], n = new Set(e.entities.map((e) => p.get(e)));
302
+ for (let e of [...t.entities.subarray(0, t.size)]) n.has(e) || t.remove(e);
303
+ e.entities.forEach((n, r) => {
304
+ let i = {};
305
+ for (let [t, n] of Object.entries(e.fields)) Object.defineProperty(i, t, {
306
+ value: n[r],
307
+ enumerable: !0
308
+ });
309
+ t.add(p.get(n), i);
310
+ });
311
+ }
312
+ return p;
313
+ }
314
+ };
315
+ async function C(e, t) {
316
+ t.signal?.throwIfAborted();
317
+ let n = new Uint8Array(await crypto.subtle.digest("SHA-256", p.encode(e)));
318
+ return t.signal?.throwIfAborted(), r(n);
319
+ }
320
+ async function w(e, t, n = {}) {
321
+ let r = await x(e, 83, n), i = await x(t, 83, n), a = [];
322
+ for (let e = 0; e < i.length; e += 256) {
323
+ let t = i.slice(e, e + 256);
324
+ t !== r.slice(e, e + 256) && a.push([e, t]);
325
+ }
326
+ let o = await C(r, n), s = await C(i, n), c = {
327
+ base: o,
328
+ target: s,
329
+ length: i.length,
330
+ patches: a
331
+ }, l = {
332
+ base: o,
333
+ target: s,
334
+ length: i.length,
335
+ full: i
336
+ }, u = JSON.stringify(c), d = JSON.stringify(l);
337
+ return b(u.length <= d.length ? u : d, 68, n);
338
+ }
339
+ async function T(e, t, n = {}) {
340
+ let r = await x(e, 83, n), i = JSON.parse(await x(t, 68, n));
341
+ if (!i || typeof i != "object" || i.base !== await C(r, n) || typeof i.target != "string" || typeof i.length != "number" || !Number.isInteger(i.length) || i.length < 0 || i.length > c(n)) return h();
342
+ let a;
343
+ if (typeof i.full == "string" && i.patches === void 0) a = i.full;
344
+ else if (Array.isArray(i.patches) && i.full === void 0) {
345
+ let e = Array.from({ length: Math.ceil(i.length / 256) }, (e, t) => r.slice(t * 256, Math.min(t * 256 + 256, i.length))), t = -1;
346
+ for (let n of i.patches) {
347
+ if (!Array.isArray(n) || n.length !== 2 || !Number.isInteger(n[0]) || n[0] <= t || n[0] < 0 || n[0] >= i.length || n[0] % 256 != 0 || typeof n[1] != "string" || n[1].length !== Math.min(256, i.length - n[0])) return h();
348
+ t = n[0], e[n[0] / 256] = n[1];
349
+ }
350
+ a = e.join("");
351
+ } else return h();
352
+ return a.length !== i.length || await C(a, n) !== i.target ? h() : b(a, 83, n);
353
+ }
354
+ //#endregion
355
+ export { S as WorldSerializer, T as applyDelta, w as createDelta };
@@ -0,0 +1 @@
1
+ (function(){function e(e){let t=!1,n=!1,r=r=>{let i=r.data;if(!i||i.tag!==`margo-ecs-parallel`||!Number.isSafeInteger(i.id))return;let a=(t,r)=>{n||e.postMessage({tag:i.tag,id:i.id,ok:t,error:r})};t?a(!1,`Worker already running; dispatch one system at a time`):(t=!0,(async()=>{try{if(typeof i.module!=`string`||typeof i.exportName!=`string`||!i.context)throw TypeError(`Invalid parallel message; dispatch a named module with a context`);let e=await import(i.module);if(!Object.hasOwn(e,i.exportName)||typeof e[i.exportName]!=`function`)throw TypeError(`Parallel system export is missing; export a system function from the module`);await e[i.exportName](i.context),a(!0)}catch(e){a(!1,e instanceof Error?e.message:String(e))}finally{t=!1}})())};return e.addEventListener(`message`,r),()=>{n=!0,e.removeEventListener(`message`,r)}}e(globalThis)})();
package/package.json CHANGED
@@ -1,6 +1,107 @@
1
1
  {
2
2
  "name": "@margoengine/ecs",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "1.0.0",
4
+ "description": "Typed-array packed sparse-set entity component storage.",
5
+ "keywords": [
6
+ "margoengine",
7
+ "webgpu",
8
+ "3d",
9
+ "ecs"
10
+ ],
11
+ "homepage": "https://margoengine.com",
12
+ "bugs": {
13
+ "url": "https://github.com/scottcampbelldata/margoengine/issues"
14
+ },
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "git+https://github.com/scottcampbelldata/margoengine.git",
18
+ "directory": "packages/ecs"
19
+ },
20
+ "license": "Apache-2.0",
21
+ "author": "Scott Campbell",
22
+ "type": "module",
23
+ "sideEffects": false,
24
+ "exports": {
25
+ ".": {
26
+ "types": "./dist/index.d.ts",
27
+ "import": "./dist/index.js"
28
+ },
29
+ "./changes": {
30
+ "types": "./dist/changes.d.ts",
31
+ "import": "./dist/changes.js"
32
+ },
33
+ "./engine": {
34
+ "types": "./dist/engine.d.ts",
35
+ "import": "./dist/engine.js"
36
+ },
37
+ "./growable": {
38
+ "types": "./dist/growable.d.ts",
39
+ "import": "./dist/growable.js"
40
+ },
41
+ "./query": {
42
+ "types": "./dist/query.d.ts",
43
+ "import": "./dist/query.js"
44
+ },
45
+ "./relations": {
46
+ "types": "./dist/relations.d.ts",
47
+ "import": "./dist/relations.js"
48
+ },
49
+ "./schedule": {
50
+ "types": "./dist/schedule.d.ts",
51
+ "import": "./dist/schedule.js"
52
+ },
53
+ "./objects": {
54
+ "types": "./dist/objects.d.ts",
55
+ "import": "./dist/objects.js"
56
+ },
57
+ "./coroutines": {
58
+ "types": "./dist/coroutines.d.ts",
59
+ "import": "./dist/coroutines.js"
60
+ },
61
+ "./scripts": {
62
+ "types": "./dist/scripts.d.ts",
63
+ "import": "./dist/scripts.js"
64
+ },
65
+ "./relation-query": {
66
+ "types": "./dist/relation-query.d.ts",
67
+ "import": "./dist/relation-query.js"
68
+ },
69
+ "./reactive": {
70
+ "types": "./dist/reactive.d.ts",
71
+ "import": "./dist/reactive.js"
72
+ },
73
+ "./serialize": {
74
+ "types": "./dist/serialize.d.ts",
75
+ "import": "./dist/serialize.js"
76
+ },
77
+ "./parallel": {
78
+ "types": "./dist/parallel.d.ts",
79
+ "import": "./dist/parallel.js"
80
+ }
81
+ },
82
+ "files": [
83
+ "dist",
84
+ "LICENSE",
85
+ "NOTICE"
86
+ ],
87
+ "publishConfig": {
88
+ "access": "public"
89
+ },
90
+ "peerDependencies": {
91
+ "@margoengine/core": "^1.0.0",
92
+ "@margoengine/scene": "^1.0.0"
93
+ },
94
+ "peerDependenciesMeta": {
95
+ "@margoengine/scene": {
96
+ "optional": true
97
+ }
98
+ },
99
+ "dependencies": {
100
+ "@margoengine/math": "^1.0.0"
101
+ },
102
+ "scripts": {
103
+ "build": "node ../../scripts/build-optional.js ecs",
104
+ "test": "npm run build && node --test test/*.test.js",
105
+ "prepack": "npm run build"
106
+ }
107
+ }