@oasys/oecs 0.5.1 → 0.5.3

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.
Files changed (58) hide show
  1. package/CHANGELOG.md +52 -0
  2. package/README.md +12 -4
  3. package/dist/core/ecs/ecs_memory.d.cts +6 -6
  4. package/dist/core/ecs/ecs_memory.d.ts +6 -6
  5. package/dist/core/ecs/ecs_memory.d.ts.map +1 -1
  6. package/dist/core/store/allocator.d.cts +44 -19
  7. package/dist/core/store/allocator.d.ts +44 -19
  8. package/dist/core/store/allocator.d.ts.map +1 -1
  9. package/dist/core/store/column_store.d.cts +1 -1
  10. package/dist/core/store/column_store.d.ts +1 -1
  11. package/dist/core/store/extend.d.ts.map +1 -1
  12. package/dist/core/store/grow.d.ts.map +1 -1
  13. package/dist/core/store/layout_ops.d.cts +18 -0
  14. package/dist/core/store/layout_ops.d.ts +18 -0
  15. package/dist/core/store/layout_ops.d.ts.map +1 -1
  16. package/dist/dev_flag.d.ts.map +1 -1
  17. package/dist/extensions/editor/index.development.cjs +1 -0
  18. package/dist/extensions/editor/index.development.js +239 -0
  19. package/dist/extensions/reactive/index.development.cjs +1 -0
  20. package/dist/extensions/reactive/index.development.js +215 -0
  21. package/dist/extensions/solid/index.development.cjs +1 -0
  22. package/dist/extensions/solid/index.development.js +40 -0
  23. package/dist/{host_commands-BI8pEmjH.js → host_commands-3jyFfWNg.js} +2 -2
  24. package/dist/{host_commands-CxhpzMx9.cjs → host_commands-DNf0f6ko.cjs} +1 -1
  25. package/dist/index.cjs +1 -1
  26. package/dist/index.d.cts +1 -1
  27. package/dist/index.d.ts +1 -1
  28. package/dist/index.development.cjs +1 -0
  29. package/dist/index.development.js +8119 -0
  30. package/dist/index.js +195 -192
  31. package/dist/internal-C9jjL90H.js +2485 -0
  32. package/dist/internal-RZN14uMw.cjs +2 -0
  33. package/dist/internal.cjs +1 -1
  34. package/dist/internal.development.cjs +1 -0
  35. package/dist/internal.development.js +24 -0
  36. package/dist/internal.js +1 -1
  37. package/dist/interop-DqxleBo7.js +18 -0
  38. package/dist/interop-T1HZ-Dpa.cjs +1 -0
  39. package/dist/kernel-Cz2Kxlwl.js +240 -0
  40. package/dist/kernel-sw7ScKWu.cjs +1 -0
  41. package/dist/primitives.development.cjs +1 -0
  42. package/dist/primitives.development.js +45 -0
  43. package/dist/reactive/index.development.cjs +1 -0
  44. package/dist/reactive/index.development.js +18 -0
  45. package/dist/shallow-9S1pY_Iw.js +159 -0
  46. package/dist/shallow-C5YmTbtb.cjs +1 -0
  47. package/dist/shared-BMXh9hxm.cjs +1 -0
  48. package/dist/{shared-BU1Cd40h.js → shared-DQKK0i-E.js} +38 -32
  49. package/dist/shared.cjs +1 -1
  50. package/dist/shared.d.cts +1 -1
  51. package/dist/shared.d.ts +1 -1
  52. package/dist/shared.development.cjs +1 -0
  53. package/dist/shared.development.js +7 -0
  54. package/dist/shared.js +1 -1
  55. package/dist/version.d.cts +1 -1
  56. package/dist/version.d.ts +1 -1
  57. package/package.json +31 -2
  58. package/dist/shared-BymrGTyR.cjs +0 -1
@@ -0,0 +1,159 @@
1
+ import { s as y, b as w, u as O } from "./kernel-Cz2Kxlwl.js";
2
+ function j(p = Object.is) {
3
+ const i = /* @__PURE__ */ new Map(), [t, h] = y(0);
4
+ let l = 0;
5
+ const a = (s, n) => s !== void 0 && n !== void 0 ? p(s, n) : s === n;
6
+ return {
7
+ get(s) {
8
+ const n = i.get(s);
9
+ if (n !== void 0) return n[0]();
10
+ t();
11
+ },
12
+ set(s, n) {
13
+ n === void 0 && console.warn(
14
+ "reactiveMap.set(key, undefined): undefined is the absent sentinel — get(key) cannot distinguish it from an unset key; use delete(key) to remove."
15
+ );
16
+ const o = i.get(s);
17
+ o !== void 0 ? o[1](n) : (i.set(s, y(n, a)), h(++l));
18
+ },
19
+ delete(s) {
20
+ const n = i.get(s);
21
+ return n === void 0 ? !1 : (i.delete(s), w(() => {
22
+ n[1](void 0), h(++l);
23
+ }), !0);
24
+ },
25
+ has(s) {
26
+ return t(), i.has(s);
27
+ },
28
+ size() {
29
+ return t(), i.size;
30
+ },
31
+ keys() {
32
+ return t(), [...i.keys()];
33
+ }
34
+ };
35
+ }
36
+ function x(p, i = {}) {
37
+ const t = {}, h = {}, l = Object.keys(p), a = new Set(l);
38
+ for (const n of l) {
39
+ const [o, m] = y(
40
+ p[n],
41
+ i[n]
42
+ );
43
+ t[n] = o, h[n] = m;
44
+ }
45
+ return [new Proxy({}, {
46
+ // A field read subscribes; a NON-field key must not throw. `JSON.stringify`
47
+ // (`toJSON`), `await proxy` (`then`), `String(proxy)` (`Symbol.toPrimitive`)
48
+ // and `for..of` (`Symbol.iterator`) all probe keys that aren't fields — fall
49
+ // through to the (empty) target so they see the ordinary undefined/inherited
50
+ // value instead of calling `undefined()`. `fieldSet` (not `k in reads`) so
51
+ // inherited `toString`/`constructor` aren't mistaken for fields.
52
+ get: (n, o) => a.has(o) ? t[o]() : Reflect.get(n, o),
53
+ has: (n, o) => a.has(o),
54
+ // Enumerable without subscribing: enumeration calls `ownKeys` +
55
+ // `getOwnPropertyDescriptor`, never `get`, so `Object.keys(proxy)` returns
56
+ // the field set and tracks nothing. The descriptor is an ACCESSOR whose `get`
57
+ // reads the live signal, so `{...proxy}` / `Object.values(proxy)` /
58
+ // `Object.getOwnPropertyDescriptor(proxy, f).value` see the current value
59
+ // (a value-less descriptor would normalize to `value: undefined`). Non-field
60
+ // keys report no own descriptor. The target is the empty (extensible) object,
61
+ // so these configurable own keys satisfy the Proxy invariants.
62
+ ownKeys: () => l,
63
+ getOwnPropertyDescriptor: (n, o) => a.has(o) ? { get: () => t[o](), enumerable: !0, configurable: !0 } : void 0,
64
+ // Writes go through `set.field(v)` — the proxy is a READ surface, and its
65
+ // public type says so (`Readonly<T>`, POLISH_AUDIT #8). The trap backs the
66
+ // type for JS callers / policed casts: without it, a field assignment threw
67
+ // an opaque "Cannot redefine property" (the accessor descriptor above has no
68
+ // setter) and a TYPO'D field silently stuck on the hidden target as a
69
+ // non-reactive value.
70
+ set: (n, o) => {
71
+ throw new TypeError(
72
+ `reactiveStruct proxy is read-only: use set.${String(o)}(value) — the setters tuple returned alongside the proxy`
73
+ );
74
+ }
75
+ }), h];
76
+ }
77
+ const v = Symbol("reactiveArray.absent");
78
+ function M(p = [], i = Object.is) {
79
+ const t = [], [h, l] = y(0);
80
+ let a = 0;
81
+ const s = (e, r) => e !== v && r !== v ? i(e, r) : e === r, n = (e) => y(e, s), o = (e) => O(t[e][0]);
82
+ for (const e of p) t.push(n(e));
83
+ function m(e) {
84
+ w(() => {
85
+ const r = t.length, f = e.length, g = f < r ? f : r;
86
+ for (let c = 0; c < g; c++) t[c][1](e[c]);
87
+ if (f > r) {
88
+ for (let c = r; c < f; c++) t.push(n(e[c]));
89
+ l(++a);
90
+ } else if (f < r) {
91
+ const c = t.splice(f);
92
+ for (let d = 0; d < c.length; d++) c[d][1](v);
93
+ l(++a);
94
+ }
95
+ });
96
+ }
97
+ return {
98
+ get(e) {
99
+ if (e >= 0 && e < t.length) {
100
+ const r = t[e][0]();
101
+ if (r !== v) return r;
102
+ }
103
+ h();
104
+ },
105
+ length() {
106
+ return h(), t.length;
107
+ },
108
+ snapshot() {
109
+ h();
110
+ const e = new Array(t.length);
111
+ for (let r = 0; r < t.length; r++) e[r] = t[r][0]();
112
+ return e;
113
+ },
114
+ set(e, r) {
115
+ e >= 0 && e < t.length ? t[e][1](r) : console.warn(
116
+ `reactiveArray.set(${e}): index out of range [0, ${t.length}); ignored. Use push / splice / reconcile to change length.`
117
+ );
118
+ },
119
+ push(e) {
120
+ t.push(n(e)), l(++a);
121
+ },
122
+ pop() {
123
+ const e = t.length;
124
+ if (e === 0) return;
125
+ const r = o(e - 1), [f] = t.splice(e - 1);
126
+ return w(() => {
127
+ f[1](v), l(++a);
128
+ }), r;
129
+ },
130
+ splice(e, r, ...f) {
131
+ const g = t.length, c = e < 0 ? Math.max(g + e, 0) : Math.min(e, g), d = r === void 0 ? g - c : Math.max(0, Math.min(r, g - c)), k = [];
132
+ for (let u = 0; u < d; u++) k.push(o(c + u));
133
+ const b = [];
134
+ for (let u = 0; u < c; u++) b.push(o(u));
135
+ for (let u = 0; u < f.length; u++) b.push(f[u]);
136
+ for (let u = c + d; u < g; u++) b.push(o(u));
137
+ return m(b), k;
138
+ },
139
+ reconcile(e) {
140
+ m(e);
141
+ }
142
+ };
143
+ }
144
+ function A(p, i) {
145
+ if (Object.is(p, i)) return !0;
146
+ const t = p, h = i, l = Object.keys(t);
147
+ if (l.length !== Object.keys(h).length) return !1;
148
+ for (let a = 0; a < l.length; a++) {
149
+ const s = l[a];
150
+ if (!Object.prototype.hasOwnProperty.call(h, s) || !Object.is(t[s], h[s])) return !1;
151
+ }
152
+ return !0;
153
+ }
154
+ export {
155
+ x as a,
156
+ M as b,
157
+ j as r,
158
+ A as s
159
+ };
@@ -0,0 +1 @@
1
+ "use strict";const p=require("./kernel-sw7ScKWu.cjs");function k(g=Object.is){const i=new Map,[t,h]=p.signal(0);let l=0;const a=(s,n)=>s!==void 0&&n!==void 0?g(s,n):s===n;return{get(s){const n=i.get(s);if(n!==void 0)return n[0]();t()},set(s,n){n===void 0&&console.warn("reactiveMap.set(key, undefined): undefined is the absent sentinel — get(key) cannot distinguish it from an unset key; use delete(key) to remove.");const o=i.get(s);o!==void 0?o[1](n):(i.set(s,p.signal(n,a)),h(++l))},delete(s){const n=i.get(s);return n===void 0?!1:(i.delete(s),p.batch(()=>{n[1](void 0),h(++l)}),!0)},has(s){return t(),i.has(s)},size(){return t(),i.size},keys(){return t(),[...i.keys()]}}}function O(g,i={}){const t={},h={},l=Object.keys(g),a=new Set(l);for(const n of l){const[o,b]=p.signal(g[n],i[n]);t[n]=o,h[n]=b}return[new Proxy({},{get:(n,o)=>a.has(o)?t[o]():Reflect.get(n,o),has:(n,o)=>a.has(o),ownKeys:()=>l,getOwnPropertyDescriptor:(n,o)=>a.has(o)?{get:()=>t[o](),enumerable:!0,configurable:!0}:void 0,set:(n,o)=>{throw new TypeError(`reactiveStruct proxy is read-only: use set.${String(o)}(value) — the setters tuple returned alongside the proxy`)}}),h]}const y=Symbol("reactiveArray.absent");function S(g=[],i=Object.is){const t=[],[h,l]=p.signal(0);let a=0;const s=(e,r)=>e!==y&&r!==y?i(e,r):e===r,n=e=>p.signal(e,s),o=e=>p.untrack(t[e][0]);for(const e of g)t.push(n(e));function b(e){p.batch(()=>{const r=t.length,f=e.length,d=f<r?f:r;for(let c=0;c<d;c++)t[c][1](e[c]);if(f>r){for(let c=r;c<f;c++)t.push(n(e[c]));l(++a)}else if(f<r){const c=t.splice(f);for(let v=0;v<c.length;v++)c[v][1](y);l(++a)}})}return{get(e){if(e>=0&&e<t.length){const r=t[e][0]();if(r!==y)return r}h()},length(){return h(),t.length},snapshot(){h();const e=new Array(t.length);for(let r=0;r<t.length;r++)e[r]=t[r][0]();return e},set(e,r){e>=0&&e<t.length?t[e][1](r):console.warn(`reactiveArray.set(${e}): index out of range [0, ${t.length}); ignored. Use push / splice / reconcile to change length.`)},push(e){t.push(n(e)),l(++a)},pop(){const e=t.length;if(e===0)return;const r=o(e-1),[f]=t.splice(e-1);return p.batch(()=>{f[1](y),l(++a)}),r},splice(e,r,...f){const d=t.length,c=e<0?Math.max(d+e,0):Math.min(e,d),v=r===void 0?d-c:Math.max(0,Math.min(r,d-c)),w=[];for(let u=0;u<v;u++)w.push(o(c+u));const m=[];for(let u=0;u<c;u++)m.push(o(u));for(let u=0;u<f.length;u++)m.push(f[u]);for(let u=c+v;u<d;u++)m.push(o(u));return b(m),w},reconcile(e){b(e)}}}function j(g,i){if(Object.is(g,i))return!0;const t=g,h=i,l=Object.keys(t);if(l.length!==Object.keys(h).length)return!1;for(let a=0;a<l.length;a++){const s=l[a];if(!Object.prototype.hasOwnProperty.call(h,s)||!Object.is(t[s],h[s]))return!1}return!0}exports.reactiveArray=S;exports.reactiveMap=k;exports.reactiveStruct=O;exports.shallow=j;
@@ -0,0 +1 @@
1
+ "use strict";class s extends Error{constructor(t,e,a,n){super(t,n),this.requestedBytes=e,this.capBytes=a,this.name="StoreCapExceededError"}}class l extends Error{constructor(){super("SharedArrayBuffer is not available in this runtime. The chosen world backing is SAB-based and cannot start without it. In browsers this requires cross-origin isolation: serve the page with `Cross-Origin-Opener-Policy: same-origin` and `Cross-Origin-Embedder-Policy: require-corp` (or `credentialless`). Alternatively choose the pure-TS heap profile (`memory: { heap: {} }`), which is backed by a plain ArrayBuffer and needs no SAB / no COOP+COEP. In Bun/Node SAB is available unconditionally — if you see this there, the runtime is older than expected or the global was shadowed."),this.name="SabUnavailableError"}}const h=r=>{if(typeof SharedArrayBuffer>"u")throw new l;return new SharedArrayBuffer(r)},d=64*1024;function f(r,t,e){if(e<=0||!Number.isInteger(e))throw new Error(`${r}: maxBytes must be a positive integer (got ${e})`);let a=null;const n=o=>{if(o>e)throw new s(`${r}: requested ${o} bytes exceeds the by-design maxBytes cap of ${e}. This is a hard ceiling with no grow-beyond-cap fallback (#380); a real workload stays ~16 MiB. Reaching it signals runaway entity/column growth upstream — diagnose that rather than raising the cap blindly.`,o,e);return a===null?(a=t.create(o,e),a):(o>a.byteLength&&t.growTo(a,o),a)};return Object.defineProperty(n,"isInPlace",{value:!0,enumerable:!0}),n}function w(r=256*1024*1024){if(typeof SharedArrayBuffer>"u")throw new l;return f("growable_sab_allocator",{create:(t,e)=>{const a=SharedArrayBuffer;return new a(t,{maxByteLength:e})},growTo:(t,e)=>t.grow(e)},r)}function b(r=256*1024*1024){return f("heap_arraybuffer_allocator",{create:(t,e)=>new ArrayBuffer(e),growTo:()=>{throw new Error("heap_arraybuffer_allocator: the heap buffer is fixed at maxBytes and must never grow — growth relocates columns within the buffer, not the buffer itself")}},r)}function A(r){if(!(r.buffer instanceof SharedArrayBuffer))throw new Error("wasm_memory_allocator: WebAssembly.Memory must be constructed with `shared: true` so its buffer is a SharedArrayBuffer");const t=()=>r.buffer,e=a=>{const n=r.buffer.byteLength;if(a<=n)return t();const o=Math.ceil((a-n)/d),u=i=>new s(`wasm_memory_allocator: memory.grow(${o}) failed (current=${n} bytes, requested=${a} bytes, maximum may be reached)`,a,null,{cause:i});let c;try{c=r.grow(o)}catch(i){throw u(i)}if(c===-1)throw u();return t()};return Object.defineProperty(e,"isInPlace",{value:!0,enumerable:!0}),e}exports.DEFAULT_SAB_ALLOCATOR=h;exports.SabUnavailableError=l;exports.StoreCapExceededError=s;exports.growableSabAllocator=w;exports.heapArraybufferAllocator=b;exports.wasmMemoryAllocator=A;
@@ -1,6 +1,6 @@
1
1
  class u extends Error {
2
- constructor(t, e, r, n) {
3
- super(t, n), this.requestedBytes = e, this.capBytes = r, this.name = "StoreCapExceededError";
2
+ constructor(t, e, a, n) {
3
+ super(t, n), this.requestedBytes = e, this.capBytes = a, this.name = "StoreCapExceededError";
4
4
  }
5
5
  }
6
6
  class c extends Error {
@@ -10,80 +10,86 @@ class c extends Error {
10
10
  ), this.name = "SabUnavailableError";
11
11
  }
12
12
  }
13
- const d = (a) => {
13
+ const d = (r) => {
14
14
  if (typeof SharedArrayBuffer > "u") throw new c();
15
- return new SharedArrayBuffer(a);
15
+ return new SharedArrayBuffer(r);
16
16
  }, h = 64 * 1024;
17
- function f(a, t, e) {
17
+ function f(r, t, e) {
18
18
  if (e <= 0 || !Number.isInteger(e))
19
- throw new Error(`${a}: maxBytes must be a positive integer (got ${e})`);
20
- let r = null;
19
+ throw new Error(`${r}: maxBytes must be a positive integer (got ${e})`);
20
+ let a = null;
21
21
  const n = (o) => {
22
22
  if (o > e)
23
23
  throw new u(
24
- `${a}: requested ${o} bytes exceeds the by-design maxBytes cap of ${e}. This is a hard ceiling with no grow-beyond-cap fallback (#380); a real workload stays ~16 MiB. Reaching it signals runaway entity/column growth upstream — diagnose that rather than raising the cap blindly.`,
24
+ `${r}: requested ${o} bytes exceeds the by-design maxBytes cap of ${e}. This is a hard ceiling with no grow-beyond-cap fallback (#380); a real workload stays ~16 MiB. Reaching it signals runaway entity/column growth upstream — diagnose that rather than raising the cap blindly.`,
25
25
  o,
26
26
  e
27
27
  );
28
- return r === null ? (r = t.create(o, e), r) : (o > r.byteLength && t.growTo(r, o), r);
28
+ return a === null ? (a = t.create(o, e), a) : (o > a.byteLength && t.growTo(a, o), a);
29
29
  };
30
30
  return Object.defineProperty(n, "isInPlace", { value: !0, enumerable: !0 }), n;
31
31
  }
32
- function w(a = 256 * 1024 * 1024) {
32
+ function w(r = 256 * 1024 * 1024) {
33
33
  if (typeof SharedArrayBuffer > "u") throw new c();
34
34
  return f(
35
35
  "growable_sab_allocator",
36
36
  {
37
37
  create: (t, e) => {
38
- const r = SharedArrayBuffer;
39
- return new r(t, { maxByteLength: e });
38
+ const a = SharedArrayBuffer;
39
+ return new a(t, { maxByteLength: e });
40
40
  },
41
41
  // boundary: SharedArrayBuffer.grow is in the spec but not in all
42
42
  // lib types; widen here so the rest of the layer doesn't need to.
43
43
  growTo: (t, e) => t.grow(e)
44
44
  },
45
- a
45
+ r
46
46
  );
47
47
  }
48
- function b(a = 256 * 1024 * 1024) {
48
+ function b(r = 256 * 1024 * 1024) {
49
49
  return f(
50
50
  "heap_arraybuffer_allocator",
51
51
  {
52
- create: (t, e) => {
53
- const r = ArrayBuffer;
54
- return new r(t, { maxByteLength: e });
55
- },
56
- // boundary: `ArrayBuffer.prototype.resize` is ES2024, not in the ES2022
57
- // lib types; widen here. Resize keeps the same buffer object and
58
- // preserves existing views (the in-place contract).
59
- growTo: (t, e) => t.resize(e)
52
+ // Reserve the whole cap as ONE fixed buffer. `byteLength` (the current
53
+ // need) is ignored: the buffer never resizes, so it must be born at the
54
+ // ceiling. Lazy page-faulting keeps RSS proportional to real use.
55
+ create: (t, e) => new ArrayBuffer(e),
56
+ // Unreachable: the buffer is created at `maxByteLength`, so
57
+ // `makeGrowableAllocator`'s `bytes > buffer.byteLength` guard never fires
58
+ // (a byte count past the cap throws first). A fixed `ArrayBuffer` has no
59
+ // `.resize()`; assert loudly rather than attempt one, in case the guard
60
+ // logic ever changes.
61
+ growTo: () => {
62
+ throw new Error(
63
+ "heap_arraybuffer_allocator: the heap buffer is fixed at maxBytes and must never grow — growth relocates columns within the buffer, not the buffer itself"
64
+ );
65
+ }
60
66
  },
61
- a
67
+ r
62
68
  );
63
69
  }
64
- function g(a) {
65
- if (!(a.buffer instanceof SharedArrayBuffer))
70
+ function g(r) {
71
+ if (!(r.buffer instanceof SharedArrayBuffer))
66
72
  throw new Error(
67
73
  "wasm_memory_allocator: WebAssembly.Memory must be constructed with `shared: true` so its buffer is a SharedArrayBuffer"
68
74
  );
69
- const t = () => a.buffer, e = (r) => {
70
- const n = a.buffer.byteLength;
71
- if (r <= n)
75
+ const t = () => r.buffer, e = (a) => {
76
+ const n = r.buffer.byteLength;
77
+ if (a <= n)
72
78
  return t();
73
- const o = Math.ceil((r - n) / h), s = (i) => (
79
+ const o = Math.ceil((a - n) / h), s = (i) => (
74
80
  // The JS API doesn't expose the Memory's `maximum`, so the cap is
75
81
  // reported as unknowable (`null`) — the caller declared it at
76
82
  // `new WebAssembly.Memory({ maximum })` time.
77
83
  new u(
78
- `wasm_memory_allocator: memory.grow(${o}) failed (current=${n} bytes, requested=${r} bytes, maximum may be reached)`,
79
- r,
84
+ `wasm_memory_allocator: memory.grow(${o}) failed (current=${n} bytes, requested=${a} bytes, maximum may be reached)`,
85
+ a,
80
86
  null,
81
87
  { cause: i }
82
88
  )
83
89
  );
84
90
  let l;
85
91
  try {
86
- l = a.grow(o);
92
+ l = r.grow(o);
87
93
  } catch (i) {
88
94
  throw s(i);
89
95
  }
package/dist/shared.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./shared-BymrGTyR.cjs");exports.DEFAULT_SAB_ALLOCATOR=a.DEFAULT_SAB_ALLOCATOR;exports.SabUnavailableError=a.SabUnavailableError;exports.growableSabAllocator=a.growableSabAllocator;exports.wasmMemoryAllocator=a.wasmMemoryAllocator;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./shared-BMXh9hxm.cjs");exports.DEFAULT_SAB_ALLOCATOR=a.DEFAULT_SAB_ALLOCATOR;exports.SabUnavailableError=a.SabUnavailableError;exports.growableSabAllocator=a.growableSabAllocator;exports.wasmMemoryAllocator=a.wasmMemoryAllocator;
package/dist/shared.d.cts CHANGED
@@ -2,7 +2,7 @@
2
2
  * `@oasys/oecs/shared` — the opt-in SharedArrayBuffer / WASM profile.
3
3
  *
4
4
  * The default `@oasys/oecs` profile runs the column store over a plain
5
- * resizable `ArrayBuffer` (no cross-origin isolation). This entry surfaces the
5
+ * fixed `ArrayBuffer` (no cross-origin isolation). This entry surfaces the
6
6
  * `SharedArrayBuffer`-backed allocators for worlds that opt into worker offload
7
7
  * or a WASM compute backend — construct with `new ECS({ memory: { shared: {} } })`,
8
8
  * or pass one of these allocators through `memory: { allocator }`.
package/dist/shared.d.ts CHANGED
@@ -2,7 +2,7 @@
2
2
  * `@oasys/oecs/shared` — the opt-in SharedArrayBuffer / WASM profile.
3
3
  *
4
4
  * The default `@oasys/oecs` profile runs the column store over a plain
5
- * resizable `ArrayBuffer` (no cross-origin isolation). This entry surfaces the
5
+ * fixed `ArrayBuffer` (no cross-origin isolation). This entry surfaces the
6
6
  * `SharedArrayBuffer`-backed allocators for worlds that opt into worker offload
7
7
  * or a WASM compute backend — construct with `new ECS({ memory: { shared: {} } })`,
8
8
  * or pass one of these allocators through `memory: { allocator }`.
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./shared-BMXh9hxm.cjs");exports.DEFAULT_SAB_ALLOCATOR=a.DEFAULT_SAB_ALLOCATOR;exports.SabUnavailableError=a.SabUnavailableError;exports.growableSabAllocator=a.growableSabAllocator;exports.wasmMemoryAllocator=a.wasmMemoryAllocator;
@@ -0,0 +1,7 @@
1
+ import { D as r, a as l, g as A, w as s } from "./shared-DQKK0i-E.js";
2
+ export {
3
+ r as DEFAULT_SAB_ALLOCATOR,
4
+ l as SabUnavailableError,
5
+ A as growableSabAllocator,
6
+ s as wasmMemoryAllocator
7
+ };
package/dist/shared.js CHANGED
@@ -1,4 +1,4 @@
1
- import { D as r, a as l, g as A, w as s } from "./shared-BU1Cd40h.js";
1
+ import { D as r, a as l, g as A, w as s } from "./shared-DQKK0i-E.js";
2
2
  export {
3
3
  r as DEFAULT_SAB_ALLOCATOR,
4
4
  l as SabUnavailableError,
@@ -6,5 +6,5 @@
6
6
  * `jsr.json` by `src/__tests__/version_sync.test.ts` — bump all three
7
7
  * together.
8
8
  */
9
- export declare const VERSION = "0.5.1";
9
+ export declare const VERSION = "0.5.3";
10
10
  //# sourceMappingURL=version.d.ts.map
package/dist/version.d.ts CHANGED
@@ -6,5 +6,5 @@
6
6
  * `jsr.json` by `src/__tests__/version_sync.test.ts` — bump all three
7
7
  * together.
8
8
  */
9
- export declare const VERSION = "0.5.1";
9
+ export declare const VERSION = "0.5.3";
10
10
  //# sourceMappingURL=version.d.ts.map
package/package.json CHANGED
@@ -1,86 +1,112 @@
1
1
  {
2
2
  "name": "@oasys/oecs",
3
- "version": "0.5.1",
3
+ "version": "0.5.3",
4
4
  "description": "Archetype-based Entity Component System",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  ".": {
8
8
  "import": {
9
9
  "types": "./dist/index.d.ts",
10
+ "development": "./dist/index.development.js",
10
11
  "default": "./dist/index.js"
11
12
  },
12
13
  "require": {
13
14
  "types": "./dist/index.d.cts",
15
+ "development": "./dist/index.development.cjs",
14
16
  "default": "./dist/index.cjs"
15
17
  }
16
18
  },
19
+ "./dev": {
20
+ "import": {
21
+ "types": "./dist/index.d.ts",
22
+ "default": "./dist/index.development.js"
23
+ },
24
+ "require": {
25
+ "types": "./dist/index.d.cts",
26
+ "default": "./dist/index.development.cjs"
27
+ }
28
+ },
17
29
  "./primitives": {
18
30
  "import": {
19
31
  "types": "./dist/primitives.d.ts",
32
+ "development": "./dist/primitives.development.js",
20
33
  "default": "./dist/primitives.js"
21
34
  },
22
35
  "require": {
23
36
  "types": "./dist/primitives.d.cts",
37
+ "development": "./dist/primitives.development.cjs",
24
38
  "default": "./dist/primitives.cjs"
25
39
  }
26
40
  },
27
41
  "./reactive": {
28
42
  "import": {
29
43
  "types": "./dist/reactive/index.d.ts",
44
+ "development": "./dist/reactive/index.development.js",
30
45
  "default": "./dist/reactive/index.js"
31
46
  },
32
47
  "require": {
33
48
  "types": "./dist/reactive/index.d.cts",
49
+ "development": "./dist/reactive/index.development.cjs",
34
50
  "default": "./dist/reactive/index.cjs"
35
51
  }
36
52
  },
37
53
  "./reactive-sync": {
38
54
  "import": {
39
55
  "types": "./dist/extensions/reactive/index.d.ts",
56
+ "development": "./dist/extensions/reactive/index.development.js",
40
57
  "default": "./dist/extensions/reactive/index.js"
41
58
  },
42
59
  "require": {
43
60
  "types": "./dist/extensions/reactive/index.d.cts",
61
+ "development": "./dist/extensions/reactive/index.development.cjs",
44
62
  "default": "./dist/extensions/reactive/index.cjs"
45
63
  }
46
64
  },
47
65
  "./editor": {
48
66
  "import": {
49
67
  "types": "./dist/extensions/editor/index.d.ts",
68
+ "development": "./dist/extensions/editor/index.development.js",
50
69
  "default": "./dist/extensions/editor/index.js"
51
70
  },
52
71
  "require": {
53
72
  "types": "./dist/extensions/editor/index.d.cts",
73
+ "development": "./dist/extensions/editor/index.development.cjs",
54
74
  "default": "./dist/extensions/editor/index.cjs"
55
75
  }
56
76
  },
57
77
  "./solid": {
58
78
  "import": {
59
79
  "types": "./dist/extensions/solid/index.d.ts",
80
+ "development": "./dist/extensions/solid/index.development.js",
60
81
  "default": "./dist/extensions/solid/index.js"
61
82
  },
62
83
  "require": {
63
84
  "types": "./dist/extensions/solid/index.d.cts",
85
+ "development": "./dist/extensions/solid/index.development.cjs",
64
86
  "default": "./dist/extensions/solid/index.cjs"
65
87
  }
66
88
  },
67
89
  "./shared": {
68
90
  "import": {
69
91
  "types": "./dist/shared.d.ts",
92
+ "development": "./dist/shared.development.js",
70
93
  "default": "./dist/shared.js"
71
94
  },
72
95
  "require": {
73
96
  "types": "./dist/shared.d.cts",
97
+ "development": "./dist/shared.development.cjs",
74
98
  "default": "./dist/shared.cjs"
75
99
  }
76
100
  },
77
101
  "./internal": {
78
102
  "import": {
79
103
  "types": "./dist/internal.d.ts",
104
+ "development": "./dist/internal.development.js",
80
105
  "default": "./dist/internal.js"
81
106
  },
82
107
  "require": {
83
108
  "types": "./dist/internal.d.cts",
109
+ "development": "./dist/internal.development.cjs",
84
110
  "default": "./dist/internal.cjs"
85
111
  }
86
112
  },
@@ -96,7 +122,7 @@
96
122
  "sideEffects": false,
97
123
  "scripts": {
98
124
  "dev": "vite",
99
- "build": "vite build && node scripts/postbuild.mjs",
125
+ "build": "node scripts/build.mjs && node scripts/postbuild.mjs",
100
126
  "test": "vitest",
101
127
  "bench": "vitest bench",
102
128
  "prepublishOnly": "pnpm build"
@@ -138,6 +164,9 @@
138
164
  },
139
165
  "typesVersions": {
140
166
  "*": {
167
+ "dev": [
168
+ "./dist/index.d.ts"
169
+ ],
141
170
  "primitives": [
142
171
  "./dist/primitives.d.ts"
143
172
  ],
@@ -1 +0,0 @@
1
- "use strict";class s extends Error{constructor(o,r,e,n){super(o,n),this.requestedBytes=r,this.capBytes=e,this.name="StoreCapExceededError"}}class l extends Error{constructor(){super("SharedArrayBuffer is not available in this runtime. The chosen world backing is SAB-based and cannot start without it. In browsers this requires cross-origin isolation: serve the page with `Cross-Origin-Opener-Policy: same-origin` and `Cross-Origin-Embedder-Policy: require-corp` (or `credentialless`). Alternatively choose the pure-TS heap profile (`memory: { heap: {} }`), which is backed by a plain ArrayBuffer and needs no SAB / no COOP+COEP. In Bun/Node SAB is available unconditionally — if you see this there, the runtime is older than expected or the global was shadowed."),this.name="SabUnavailableError"}}const h=a=>{if(typeof SharedArrayBuffer>"u")throw new l;return new SharedArrayBuffer(a)},d=64*1024;function f(a,o,r){if(r<=0||!Number.isInteger(r))throw new Error(`${a}: maxBytes must be a positive integer (got ${r})`);let e=null;const n=t=>{if(t>r)throw new s(`${a}: requested ${t} bytes exceeds the by-design maxBytes cap of ${r}. This is a hard ceiling with no grow-beyond-cap fallback (#380); a real workload stays ~16 MiB. Reaching it signals runaway entity/column growth upstream — diagnose that rather than raising the cap blindly.`,t,r);return e===null?(e=o.create(t,r),e):(t>e.byteLength&&o.growTo(e,t),e)};return Object.defineProperty(n,"isInPlace",{value:!0,enumerable:!0}),n}function b(a=256*1024*1024){if(typeof SharedArrayBuffer>"u")throw new l;return f("growable_sab_allocator",{create:(o,r)=>{const e=SharedArrayBuffer;return new e(o,{maxByteLength:r})},growTo:(o,r)=>o.grow(r)},a)}function w(a=256*1024*1024){return f("heap_arraybuffer_allocator",{create:(o,r)=>{const e=ArrayBuffer;return new e(o,{maxByteLength:r})},growTo:(o,r)=>o.resize(r)},a)}function A(a){if(!(a.buffer instanceof SharedArrayBuffer))throw new Error("wasm_memory_allocator: WebAssembly.Memory must be constructed with `shared: true` so its buffer is a SharedArrayBuffer");const o=()=>a.buffer,r=e=>{const n=a.buffer.byteLength;if(e<=n)return o();const t=Math.ceil((e-n)/d),c=i=>new s(`wasm_memory_allocator: memory.grow(${t}) failed (current=${n} bytes, requested=${e} bytes, maximum may be reached)`,e,null,{cause:i});let u;try{u=a.grow(t)}catch(i){throw c(i)}if(u===-1)throw c();return o()};return Object.defineProperty(r,"isInPlace",{value:!0,enumerable:!0}),r}exports.DEFAULT_SAB_ALLOCATOR=h;exports.SabUnavailableError=l;exports.StoreCapExceededError=s;exports.growableSabAllocator=b;exports.heapArraybufferAllocator=w;exports.wasmMemoryAllocator=A;