@margoengine/wfc 0.0.0-stage → 0.1.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/LICENSE +201 -0
- package/NOTICE +4 -0
- package/README.md +243 -3
- package/dist/assemble.d.ts +37 -0
- package/dist/assemble.js +112 -0
- package/dist/chunks.d.ts +26 -0
- package/dist/chunks.js +309 -0
- package/dist/constraints.d.ts +51 -0
- package/dist/constraints.js +193 -0
- package/dist/graph-BI3KRQ6B.js +113 -0
- package/dist/graph.d.ts +35 -0
- package/dist/grid-BGBmzG3D.js +33 -0
- package/dist/grid.d.ts +13 -0
- package/dist/heap.d.ts +41 -0
- package/dist/hex.d.ts +65 -0
- package/dist/hex.js +130 -0
- package/dist/index.d.ts +63 -0
- package/dist/index.js +145 -0
- package/dist/overlapping.d.ts +59 -0
- package/dist/overlapping.js +147 -0
- package/dist/overlapping3d.d.ts +43 -0
- package/dist/overlapping3d.js +186 -0
- package/dist/sockets.d.ts +21 -0
- package/dist/sockets.js +92 -0
- package/dist/tileset.d.ts +31 -0
- package/dist/tileset.js +169 -0
- package/dist/wfc.wasm +0 -0
- package/dist/wfc.worker.d.ts +1 -0
- package/dist/worker.d.ts +34 -0
- package/dist/worker.js +82 -0
- package/dist/workers/wfc.js +1 -0
- package/package.json +86 -6
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/worker.d.ts
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { Tile } from './index.js';
|
|
2
|
+
import type { CellPosition } from './constraints.js';
|
|
3
|
+
import type { HeapBackendOptions, HeapSolveOptions } from './heap.js';
|
|
4
|
+
/** Real work counters, cumulative across restarts. They are not a completion percentage. */
|
|
5
|
+
export interface WFCProgress {
|
|
6
|
+
/** Selected solver implementation. */ backend: 'typescript' | 'wasm';
|
|
7
|
+
/** Local entropy choices made so far. */ decisions: number;
|
|
8
|
+
/** Heap updates so far. */ updates: number;
|
|
9
|
+
/** Domain intersections so far. */ intersections: number;
|
|
10
|
+
/** Current restart, starting at 1. */ attempts: number;
|
|
11
|
+
}
|
|
12
|
+
/** One worker solve. */
|
|
13
|
+
export interface WorkerSolveOptions extends HeapSolveOptions, HeapBackendOptions {
|
|
14
|
+
/** Wall-clock limit including startup and loading, 1..2147483647 ms. Default 60000. */ timeout?: number;
|
|
15
|
+
}
|
|
16
|
+
/** One dedicated worker per solve, with a promise result and a bounded, single-consumer progress stream. */
|
|
17
|
+
export declare class WFCWorkerSolve implements Disposable, AsyncIterable<WFCProgress> {
|
|
18
|
+
/** Transferred X-fastest Uint16 tile IDs; rejects on abort, disposal, timeout or worker failure. */
|
|
19
|
+
readonly result: Promise<Uint16Array>;
|
|
20
|
+
private readonly worker;
|
|
21
|
+
private latest?;
|
|
22
|
+
private wake?;
|
|
23
|
+
private finished;
|
|
24
|
+
private consumed;
|
|
25
|
+
private cancel;
|
|
26
|
+
/** Start immediately. Rules and pins are copied by structured clone; no solver runs on the calling thread. */
|
|
27
|
+
constructor(dimensions: CellPosition, tiles: readonly Tile[], options?: WorkerSolveOptions);
|
|
28
|
+
/** Single consumer. Slow readers keep only the latest snapshot; completion closes the stream. Await result for errors. */
|
|
29
|
+
[Symbol.asyncIterator](): AsyncGenerator<WFCProgress>;
|
|
30
|
+
/** Terminate immediately and reject an unfinished result with coded disposed. Idempotent. */
|
|
31
|
+
dispose(): void;
|
|
32
|
+
/** Explicit resource management. */
|
|
33
|
+
[Symbol.dispose](): void;
|
|
34
|
+
}
|
package/dist/worker.js
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { MargoError as e } from "@margoengine/math/errors";
|
|
2
|
+
//#region ../shared/worker.js
|
|
3
|
+
var t = () => typeof Worker == "function" && globalThis.location !== void 0, n = {
|
|
4
|
+
TypeError,
|
|
5
|
+
RangeError,
|
|
6
|
+
SyntaxError
|
|
7
|
+
}, r = ({ name: e, message: t }) => new (Object.hasOwn(n, e) ? n[e] : Error)(typeof t == "string" ? t : "Parser worker failed"), i = (t, n) => new e(t, `${n}. Help: https://margoengine.com/llms/packages/wfc.md`), a = class {
|
|
8
|
+
constructor(e, n, a = {}) {
|
|
9
|
+
this.finished = !1, this.consumed = !1;
|
|
10
|
+
let { signal: o, timeout: s = 6e4, ...c } = a;
|
|
11
|
+
if (o?.throwIfAborted(), !Number.isInteger(s) || s < 1 || s > 2147483647) throw RangeError("WFC worker timeout must be an integer from 1 to 2147483647 milliseconds");
|
|
12
|
+
if (!t()) throw i("unsupported", "WFC worker solving needs browser Web Workers; use HeapWFC in Node");
|
|
13
|
+
let l = new URL("./workers/wfc.js?no-inline",
|
|
14
|
+
import.meta.url
|
|
15
|
+
);
|
|
16
|
+
try {
|
|
17
|
+
this.worker = new Worker(l, { name: "margoengine-wfc" });
|
|
18
|
+
} catch (e) {
|
|
19
|
+
throw Object.assign(i("failed", "WFC worker could not start; check worker-src and asset hosting"), { cause: e });
|
|
20
|
+
}
|
|
21
|
+
this.result = new Promise((t, a) => {
|
|
22
|
+
let l = (e, n) => {
|
|
23
|
+
this.finished || (this.finished = !0, clearTimeout(d), o?.removeEventListener("abort", u), this.worker.onmessage = this.worker.onerror = this.worker.onmessageerror = null, this.worker.terminate(), this.wake?.(), n ? t(n) : a(e));
|
|
24
|
+
}, u = () => l(o.reason), d = setTimeout(() => l(i("timeout", "WFC worker exceeded its time limit; reduce the grid or raise timeout")), s);
|
|
25
|
+
this.cancel = (e) => l(e), o?.addEventListener("abort", u, { once: !0 }), this.worker.onerror = (e) => {
|
|
26
|
+
e.preventDefault?.(), l(i("failed", `WFC worker crashed: ${e.message || "unknown error"}`));
|
|
27
|
+
}, this.worker.onmessageerror = () => l(i("failed", "WFC worker reply could not be deserialized")), this.worker.onmessage = ({ data: e }) => {
|
|
28
|
+
if (!this.finished) {
|
|
29
|
+
if (e?.progress) {
|
|
30
|
+
let t = e.progress;
|
|
31
|
+
if (!["typescript", "wasm"].includes(t.backend) || ![
|
|
32
|
+
"decisions",
|
|
33
|
+
"updates",
|
|
34
|
+
"intersections",
|
|
35
|
+
"attempts"
|
|
36
|
+
].every((e) => Number.isSafeInteger(t[e]) && t[e] >= 0)) {
|
|
37
|
+
l(i("failed", "WFC worker sent invalid progress"));
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
this.latest = { ...t }, this.wake?.();
|
|
41
|
+
} else if (e?.error) {
|
|
42
|
+
let t = r(e.error);
|
|
43
|
+
l(e.error.name === "MargoError" ? Object.assign(t, {
|
|
44
|
+
name: "MargoError",
|
|
45
|
+
code: e.error.code
|
|
46
|
+
}) : t);
|
|
47
|
+
} else e?.result instanceof Uint16Array ? l(void 0, e.result) : l(i("failed", "WFC worker sent an invalid result"));
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
try {
|
|
51
|
+
this.worker.postMessage({
|
|
52
|
+
dimensions: e,
|
|
53
|
+
tiles: n,
|
|
54
|
+
options: c,
|
|
55
|
+
wasmURL: new URL("./wfc.wasm?no-inline",
|
|
56
|
+
import.meta.url
|
|
57
|
+
).href
|
|
58
|
+
});
|
|
59
|
+
} catch (e) {
|
|
60
|
+
l(Object.assign(i("failed", "WFC worker inputs could not be cloned"), { cause: e }));
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
async *[Symbol.asyncIterator]() {
|
|
65
|
+
if (this.consumed) throw i("state", "WFC progress already has a consumer");
|
|
66
|
+
for (this.consumed = !0; !this.finished || this.latest;) if (this.latest) {
|
|
67
|
+
let e = this.latest;
|
|
68
|
+
this.latest = void 0, yield e;
|
|
69
|
+
} else await new Promise((e) => {
|
|
70
|
+
this.wake = e;
|
|
71
|
+
});
|
|
72
|
+
this.wake = void 0;
|
|
73
|
+
}
|
|
74
|
+
dispose() {
|
|
75
|
+
this.cancel(i("disposed", "WFC worker solve disposed; create another solve"));
|
|
76
|
+
}
|
|
77
|
+
[Symbol.dispose]() {
|
|
78
|
+
this.dispose();
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
//#endregion
|
|
82
|
+
export { a as WFCWorkerSolve };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(){function e(e,t=new Set,n=new Set){let r=[e];for(;r.length;){let e=r.pop();if(e&&typeof e==`object`&&!n.has(e)){if(n.add(e),ArrayBuffer.isView(e))e.buffer instanceof ArrayBuffer&&t.add(e.buffer);else if(e instanceof ArrayBuffer)t.add(e);else if(typeof ImageBitmap<`u`&&e instanceof ImageBitmap)t.add(e);else if(e instanceof Map)for(let[t,n]of e)r.push(t,n);else for(let t in e)r.push(e[t])}}return t}function t(t){self.onmessage=async({data:n})=>{try{if(!n||typeof n!=`object`)throw TypeError(`Invalid parser worker job; post an object`);let r=await t(n);self.postMessage({result:r},[...e(r)])}catch(e){let t={name:e?.name??`Error`,message:e instanceof Error?e.message:String(e)};try{self.postMessage({error:{...e,...t}})}catch{self.postMessage({error:t})}}}}function n(e,t){let n=e[0]*e[1]*e[2],r=t.length,i=Math.ceil(r/32);if(e.length!==3||Array.from(e).some(e=>!Number.isInteger(e)||e<1)||!Number.isSafeInteger(n)||n>1e6||r<1||r>4096||n*r>16777216)throw RangeError(`Invalid constrained WFC grid; use 1..4096 tiles, positive dimensions and at most 16,777,216 cell/tile pairs`);let a=Float64Array.from(t,e=>e.weight??1),o=a.map(e=>e*Math.log(e));if(a.some(e=>!Number.isFinite(e)||e<=0)||!Number.isFinite(a.reduce((e,t)=>e+t,0))||!Number.isFinite(o.reduce((e,t)=>e+t,0)))throw RangeError(`Invalid WFC weights; use positive finite weights whose sum and weighted logarithms stay finite`);let s=new Uint32Array(r*6*i);return t.forEach((e,t)=>{if(e.neighbors.length!==6)throw TypeError(`Invalid WFC adjacency; give each tile exactly six neighbour lists`);for(let n=0;n<6;n++){let a=e.neighbors[n];if(!a)throw TypeError(`Invalid WFC adjacency; give each tile exactly six neighbour lists`);for(let e of a){if(!Number.isInteger(e)||e<0||e>=r)throw RangeError(`Invalid WFC adjacency; use existing tile IDs and reciprocal opposite directions`);s[(t*6+n)*i+(e>>>5)]|=1<<(e&31)}}}),{size:n,tiles:t.map((e,t)=>({weight:a[t],neighbors:e.neighbors.map((e,n)=>{for(let r of e)if(!(s[(r*6+(n^1))*i+(t>>>5)]&1<<(t&31)))throw RangeError(`Invalid WFC adjacency; use existing tile IDs and reciprocal opposite directions`);return[...new Set(e)]})})),weights:a,logs:o,dimensions:[...e]}}var r=class extends Error{constructor(e,t){super(t),this.name=`MargoError`,this.code=e}static[Symbol.hasInstance](e){return e instanceof Error&&e.name===`MargoError`}},i=`Help: https://margoengine.com/llms/packages/wfc.md`,a=[[1,0,0],[-1,0,0],[0,1,0],[0,-1,0],[0,0,1],[0,0,-1]],o=e=>(e=Math.imul(e^e>>>16,2146121005),e=Math.imul(e^e>>>15,2221713035),(e^e>>>16)>>>0),s=class{report(e,t,n,r){}static wasmURL(){return new URL(`./wfc.wasm?no-inline`,`@margoengine/wfc/dist/workers/wfc.js`)}constructor(e,t){this.stats={decisions:0,updates:0,intersections:0,attempts:0},this.backend=`typescript`;let r=n(e,t);this.dims=r.dimensions,this.tiles=r.tiles,this.weights=this.tiles.map(e=>e.weight),this.equal=this.weights.every(e=>e===this.weights[0])}static async create(e,t,n={}){let a=new this(e,t),{backend:o=`auto`,signal:s}=n;if(s?.throwIfAborted(),![`auto`,`typescript`,`wasm`].includes(o))throw RangeError(`Invalid WFC backend; use auto, typescript or wasm`);let c=a.weights.every(e=>e===1)&&t.length<=32;if(o===`wasm`&&!c)throw new r(`unsupported`,`WFC SIMD needs at most 32 unit-weight tiles; use typescript or auto. ${i}`);if(o===`typescript`||!c)return a;let l;try{let e=this.wasmURL();if(e.protocol===`file:`){let{readFile:t}=await import(`node:fs/promises`);l=await t(e,{signal:s})}else{let t=await fetch(e,{signal:s});if(!t.ok)throw new r(`failed`,`WFC SIMD download failed (${t.status}); check the asset URL. ${i}`);l=await t.arrayBuffer()}if(s?.throwIfAborted(),!WebAssembly.validate(l)){if(o===`auto`)return a;throw new r(`unsupported`,`WFC SIMD unavailable; use the typescript backend. ${i}`)}let t=await WebAssembly.instantiate(l,{progress:{report:(e,t,n,r)=>a.report(e>>>0,t>>>0,n>>>0,r>>>0)}});s?.throwIfAborted(),a.wasm=t.instance.exports}catch(e){throw s?.throwIfAborted(),e instanceof r?e:Object.assign(new r(`failed`,`WFC SIMD loading failed; check asset hosting and availability. ${i}`),{cause:e})}return a.backend=`wasm`,a}solve({seed:e=1,pins:t=[],attempts:n=4,signal:s}={}){let[c,l,u]=this.dims,d=c*l*u,f=this.tiles.length,p=Math.ceil(f/32);if(!Number.isSafeInteger(e)||!Number.isInteger(n)||n<1||n>64)throw RangeError(`Invalid heap WFC budget; use an integer seed and 1..64 attempts`);let m=Array.from(t,e=>{if(e.position.length!==3||Array.from(e.position).some((e,t)=>!Number.isInteger(e)||e<0||e>=this.dims[t])||!Number.isInteger(e.tile)||e.tile<0||e.tile>=f)throw RangeError(`Invalid heap WFC pin; use integer coordinates inside the grid and an existing tile`);return{cell:e.position[0]+c*(e.position[1]+l*e.position[2]),tile:e.tile}});if(s?.throwIfAborted(),Object.assign(this.stats,{decisions:0,updates:0,intersections:0,attempts:0}),this.wasm){let t=12+8*f+2*m.length+d,a=this.wasm.alloc(t);try{let r=new Uint32Array(this.wasm.memory.buffer,a,t);r.set([c,l,u,f,e>>>0||1,n,m.length,0,0,0,0,e>>>0]);for(let e=0;e<f;e++)for(let t=0;t<6;t++)for(let n of this.tiles[e].neighbors[t])r[12+e*8+t]|=1<<n;m.forEach((e,t)=>r.set([e.cell,e.tile],12+8*f+2*t));let i=this.wasm.solve(a),o=new Uint32Array(this.wasm.memory.buffer,a,t);if(Object.assign(this.stats,{decisions:o[7],updates:o[8],intersections:o[9],attempts:o[10]}),s?.throwIfAborted(),i)return Uint16Array.from(o.subarray(t-d))}finally{this.wasm.release(a,t)}throw new r(`failed`,`Heap WFC exhausted attempts; check pins/rules or raise attempts. ${i}`)}let h=new Uint32Array(f*6*p),g=new Uint32Array(d*p),_=new Uint16Array(d),v=new Float64Array(d),y=Uint32Array.from({length:d},(t,n)=>o(n^e>>>0)),b=new Int32Array(d),x=[],S=[],C=new Uint8Array(d),w=new Uint32Array(6*p),T=0,E=()=>this.report(this.stats.decisions,this.stats.updates,this.stats.intersections,this.stats.attempts);for(let e=0;e<f;e++)for(let t=0;t<6;t++)for(let n of this.tiles[e].neighbors[t])h[(e*6+t)*p+(n>>>5)]|=1<<(n&31);let D=new Uint32Array(6*p);for(let e=0;e<f;e++)for(let t=0;t<6*p;t++)D[t]|=h[e*6*p+t];let O=(e,t)=>v[e]<v[t]||v[e]===v[t]&&(y[e]<y[t]||y[e]===y[t]&&e<t),k=(e,t)=>{let n=x[e];x[e]=x[t],x[t]=n,b[x[e]]=e,b[x[t]]=t},A=e=>{this.stats.updates++;let t=_[e]>1?_[e]:1/0;if(!this.equal&&_[e]>1){let n=0,r=0;for(let t=0;t<f;t++)g[e*p+(t>>>5)]&1<<(t&31)&&(n+=this.weights[t],r+=this.weights[t]*Math.log(this.weights[t]));t=Math.log(n)-r/n}v[e]=t;let n=b[e];for(;n>0;){let e=n-1>>>1;if(!O(x[n],x[e]))break;k(n,e),n=e}for(;;){let e=n*2+1;if(e>=d||(e+1<d&&O(x[e+1],x[e])&&e++,!O(x[e],x[n])))break;k(n,e),n=e}},j=(e,t)=>{for(let n=0;n<p;n++){let r=g[e*p+n];for(;r;){let e=r&-r;t(n*32+31-Math.clz32(e)),r=(r^e)>>>0}}},M=e=>{C[e]||(C[e]=1,S.push(e))},N=e>>>0||1,P=()=>(N^=N<<13,N^=N>>>17,N^=N<<5,(N>>>0)/4294967296);for(let e=1;e<=n;e++){this.stats.attempts=e,S.length=0,C.fill(0),_.fill(f),x.length=0;for(let e=0;e<d;e++){x.push(e),b[e]=e,v[e]=1/0;for(let t=0;t<p;t++)g[e*p+t]=t===p-1&&f%32?2**(f%32)-1:4294967295}for(let e=0;e<d;e++)A(e),M(e);let t=!1;for(let e of m){if(!(g[e.cell*p+(e.tile>>>5)]&1<<(e.tile&31))){t=!0;break}g.fill(0,e.cell*p,(e.cell+1)*p),g[e.cell*p+(e.tile>>>5)]=1<<(e.tile&31),_[e.cell]=1,A(e.cell)}for(;;){for(;S.length&&!t;){s?.throwIfAborted(),++T%1024==0&&E();let e=S.pop();C[e]=0,_[e]===f?w.set(D):(w.fill(0),j(e,e=>{for(let t=0;t<6*p;t++)w[t]|=h[e*6*p+t]}));for(let n=0;n<6;n++){let r=e%c+a[n][0],i=Math.floor(e/c)%l+a[n][1],o=Math.floor(e/(c*l))+a[n][2];if(r<0||r>=c||i<0||i>=l||o<0||o>=u)continue;let s=r+c*(i+l*o),d=!1,f=0;for(let e=0;e<p;e++){let t=s*p+e,r=g[t],i=(r&w[n*p+e])>>>0;this.stats.intersections++,i!==r&&(g[t]=i,d=!0);let a=i;for(;a;)f++,a=(a&a-1)>>>0}if(d&&(_[s]=f,A(s),M(s),!f)){t=!0;break}}}if(t)break;let e=x[0];if(_[e]<=1){let e=new Uint16Array(d);for(let t=0;t<d;t++)j(t,n=>{e[t]=n});return e}let n=0;j(e,e=>{n+=this.weights[e]});let r=P()*n,i=-1;j(e,e=>{i<0&&(r-=this.weights[e],r<=0&&(i=e))}),i<0&&j(e,e=>{i=e}),g.fill(0,e*p,(e+1)*p),g[e*p+(i>>>5)]=1<<(i&31),_[e]=1,A(e),M(e),this.stats.decisions++,this.stats.decisions%256==0&&E()}}throw new r(`failed`,`Heap WFC exhausted attempts; check pins/rules or raise attempts. ${i}`)}},c,l=class extends s{static wasmURL(){return c}report(e,t,n,r){self.postMessage({progress:{backend:this.backend,decisions:e,updates:t,intersections:n,attempts:r}})}};t(async e=>{c=new URL(e.wasmURL);let t=await l.create(e.dimensions,e.tiles,e.options),n=t.solve(e.options);return self.postMessage({progress:{backend:t.backend,...t.stats}}),n})})();
|
package/package.json
CHANGED
|
@@ -1,6 +1,86 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@margoengine/wfc",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@margoengine/wfc",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Seeded wave function collapse: 3D tile adjacency and the 2D overlapping (sample-based) model with backtracking.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"margoengine",
|
|
7
|
+
"webgpu",
|
|
8
|
+
"3d",
|
|
9
|
+
"wfc"
|
|
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/wfc"
|
|
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
|
+
"./overlapping": {
|
|
30
|
+
"types": "./dist/overlapping.d.ts",
|
|
31
|
+
"import": "./dist/overlapping.js"
|
|
32
|
+
},
|
|
33
|
+
"./constraints": {
|
|
34
|
+
"types": "./dist/constraints.d.ts",
|
|
35
|
+
"import": "./dist/constraints.js"
|
|
36
|
+
},
|
|
37
|
+
"./sockets": {
|
|
38
|
+
"types": "./dist/sockets.d.ts",
|
|
39
|
+
"import": "./dist/sockets.js"
|
|
40
|
+
},
|
|
41
|
+
"./chunks": {
|
|
42
|
+
"types": "./dist/chunks.d.ts",
|
|
43
|
+
"import": "./dist/chunks.js"
|
|
44
|
+
},
|
|
45
|
+
"./worker": {
|
|
46
|
+
"types": "./dist/worker.d.ts",
|
|
47
|
+
"import": "./dist/worker.js"
|
|
48
|
+
},
|
|
49
|
+
"./assemble": {
|
|
50
|
+
"types": "./dist/assemble.d.ts",
|
|
51
|
+
"import": "./dist/assemble.js"
|
|
52
|
+
},
|
|
53
|
+
"./tileset": {
|
|
54
|
+
"types": "./dist/tileset.d.ts",
|
|
55
|
+
"import": "./dist/tileset.js"
|
|
56
|
+
},
|
|
57
|
+
"./overlapping3d": {
|
|
58
|
+
"types": "./dist/overlapping3d.d.ts",
|
|
59
|
+
"import": "./dist/overlapping3d.js"
|
|
60
|
+
},
|
|
61
|
+
"./hex": {
|
|
62
|
+
"types": "./dist/hex.d.ts",
|
|
63
|
+
"import": "./dist/hex.js"
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
"files": [
|
|
67
|
+
"dist",
|
|
68
|
+
"LICENSE",
|
|
69
|
+
"NOTICE"
|
|
70
|
+
],
|
|
71
|
+
"publishConfig": {
|
|
72
|
+
"access": "public"
|
|
73
|
+
},
|
|
74
|
+
"peerDependencies": {
|
|
75
|
+
"@margoengine/core": "^0.1.0"
|
|
76
|
+
},
|
|
77
|
+
"dependencies": {
|
|
78
|
+
"@margoengine/math": "^0.1.0"
|
|
79
|
+
},
|
|
80
|
+
"scripts": {
|
|
81
|
+
"build": "node ../../scripts/build-optional.js wfc && node scripts/copy-wasm.mjs",
|
|
82
|
+
"test": "npm run build && node --test test/*.test.js",
|
|
83
|
+
"prepack": "npm run build",
|
|
84
|
+
"test:gpu": "node test/browser-check.mjs && node test/assemble-browser.mjs"
|
|
85
|
+
}
|
|
86
|
+
}
|