{"_id":"@benev/marduk","_rev":"4-c98c928a4653c7a9cb950fb757fcb23b","name":"@benev/marduk","dist-tags":{"latest":"0.0.0-4"},"versions":{"0.0.0-1":{"name":"@benev/marduk","version":"0.0.0-1","keywords":["babylon","babylonjs","toolkit"],"author":{"name":"Chase Moskal","email":"chasemoskal@gmail.com"},"license":"MIT","_id":"@benev/marduk@0.0.0-1","maintainers":[{"name":"chasemoskal","email":"chasemoskal@gmail.com"}],"homepage":"https://github.com/benevolent-games/marduk#readme","bugs":{"url":"https://github.com/benevolent-games/marduk/issues"},"bin":{"delete-babylon-indexes":"s/delete-babylon-indexes"},"dist":{"shasum":"42e894ca118e84871bb3dc8b6912d9a9d792f3ad","tarball":"https://registry.npmjs.org/@benev/marduk/-/marduk-0.0.0-1.tgz","fileCount":261,"integrity":"sha512-UtfCUVYKe0AqnTZhIT0xhi0bNsGrmvwiOKvNLVlvZWtVf9QrsoDj1UavWoIdvUfQeyhc6iffAOFEqSZoQv675g==","signatures":[{"sig":"MEUCIAE7CpbbaWQHoamXiWRJpHcUV4ypnzMy9DbCJ5OU9nOFAiEA5mH3ouh3IDlGPok965kDOjC0J4r6HOggD2jht3esDQY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":12254173},"main":"x/index.js","type":"module","types":"./x/index.d.ts","gitHead":"f30cc1ea7f14f589aa7e90df3160e99c76d24fe3","scripts":{"_ln":"run-s _ln-s _ln-assets","_ssg":"turtle ssg --in=s,x --out=x","test":"node x/tests.test.js","_code":"turtle build --out=x","_http":"http-server x -c-1","_ln-s":"ln -s \"$(realpath s)\" x/s","build":"run-s _clean _code _ssg _ln esbuild","start":"run-p _turtlewatch _http esbuild-watch","_clean":"rm -rf x && s/delete-babylon-indexes","_parcel":"parcel --target app","esbuild":"esbuild x/demo/main.js x/demo/worker.js --bundle --format=esm --target=es2023 --outdir=x/demo --entry-names=[name].bundle --sourcemap \"--external:node:*\" --external:os --external:fs","_ln-assets":"ln -s \"$(realpath assets)\" x/assets","test-debug":"node inspect x/tests.test.js","test-watch":"node --watch x/tests.test.js","_turtlewatch":"turtle watch --in=s,x --out=x -v","esbuild-watch":"npm run esbuild -- --watch"},"targets":{"app":{"source":"x/index.html","context":"browser","distDir":"x/parcel","publicUrl":"./"}},"_npmUser":{"name":"chasemoskal","email":"chasemoskal@gmail.com"},"repository":{"url":"git+https://github.com/benevolent-games/marduk.git","type":"git"},"_npmVersion":"10.9.2","description":"babylonjs toolkit","directories":{},"_nodeVersion":"22.15.0","browserslist":["last 1 chrome version"],"dependencies":{"@e280/stz":"^0.0.0-22","@benev/math":"^0.0.0-2","@benev/slate":"^0.3.5","@e280/comrade":"^0.0.0-13","@e280/renraku":"^0.5.0-14","@babylonjs/core":"^8.10.0","@babylonjs/loaders":"^8.10.0"},"_hasShrinkwrap":false,"devDependencies":{"buffer":"^6.0.3","esbuild":"^0.25.5","process":"^0.11.10","typescript":"^5.8.3","http-server":"^14.1.1","npm-run-all":"^4.1.5","@benev/turtle":"^0.6.12","@e280/science":"^0.0.5","os-browserify":"^0.3.0"},"_npmOperationalInternal":{"tmp":"tmp/marduk_0.0.0-1_1748575504737_0.8381117966384488","host":"s3://npm-registry-packages-npm-production"}},"0.0.0-2":{"name":"@benev/marduk","version":"0.0.0-2","keywords":["babylon","babylonjs","toolkit"],"author":{"name":"Chase Moskal","email":"chasemoskal@gmail.com"},"license":"MIT","_id":"@benev/marduk@0.0.0-2","maintainers":[{"name":"chasemoskal","email":"chasemoskal@gmail.com"}],"homepage":"https://github.com/benevolent-games/marduk#readme","bugs":{"url":"https://github.com/benevolent-games/marduk/issues"},"bin":{"delete-babylon-indexes":"s/delete-babylon-indexes"},"dist":{"shasum":"0eceed1579ae25377301925a31ae589e92d7a319","tarball":"https://registry.npmjs.org/@benev/marduk/-/marduk-0.0.0-2.tgz","fileCount":345,"integrity":"sha512-x9u3Ms9dFDlbeUZA2G926Ua8g70W5Pe6eJLE9UK5SdxI+hLPG8AzrBuYctAgdDQrUL/uULNwDRd6P4Z8xmF6rw==","signatures":[{"sig":"MEUCIQDcgq0nm2B/B9K1WZ4MolbQnDAtwdhRKxbuI7iTJ3+DzgIgEPtohpJm+0gTmY90irRGipGM4B9DEvxS9zsdxmx8FWk=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":11204174},"main":"x/index.js","type":"module","types":"./x/index.d.ts","gitHead":"6197900faee914f8a8cf3d3fc1c0e10306b94058","scripts":{"_ln":"run-s _ln-s _ln-assets","_ssg":"turtle ssg --in=s,x --out=x","test":"node x/tests.test.js","_code":"turtle build --out=x","_http":"http-server x -c-1","_ln-s":"ln -s \"$(realpath s)\" x/s","build":"run-s _clean _code _ssg _ln esbuild","count":"find s -path '*/_archive' -prune -o -name '*.ts' -exec wc -l {} +","start":"run-p _turtlewatch _http esbuild-watch","_clean":"rm -rf x && s/delete-babylon-indexes","_parcel":"parcel --target app","esbuild":"esbuild x/demo/theater/worker.bundle.js --bundle --minify --format=esm --target=es2023 --outdir=x/demo/theater --entry-names=[name].esbuild --sourcemap \"--external:node:*\" --external:os --external:fs","_ln-assets":"ln -s \"$(realpath assets)\" x/assets","test-debug":"node inspect x/tests.test.js","test-watch":"node --watch x/tests.test.js","_turtlewatch":"turtle watch --in=s,x --out=x -v","esbuild-watch":"npm run esbuild -- --watch"},"targets":{"app":{"source":"x/index.html","context":"browser","distDir":"x/parcel","publicUrl":"./"}},"_npmUser":{"name":"chasemoskal","email":"chasemoskal@gmail.com"},"repository":{"url":"git+https://github.com/benevolent-games/marduk.git","type":"git"},"_npmVersion":"10.9.2","description":"babylonjs toolkit","directories":{},"_nodeVersion":"22.15.0","browserslist":["last 1 chrome version"],"dependencies":{"@e280/stz":"^0.0.0-22","@benev/math":"^0.0.0-2","@benev/slate":"^0.3.5","@e280/comrade":"^0.0.0-13","@e280/renraku":"^0.5.0-14","@babylonjs/core":"^8.10.0","@babylonjs/loaders":"^8.10.0"},"_hasShrinkwrap":false,"devDependencies":{"esbuild":"^0.25.5","process":"^0.11.10","typescript":"^5.8.3","http-server":"^14.1.1","npm-run-all":"^4.1.5","@benev/turtle":"^0.6.12","@e280/science":"^0.0.5","os-browserify":"^0.3.0"},"_npmOperationalInternal":{"tmp":"tmp/marduk_0.0.0-2_1748810769255_0.18178463549403978","host":"s3://npm-registry-packages-npm-production"}},"0.0.0-3":{"name":"@benev/marduk","version":"0.0.0-3","keywords":["babylon","babylonjs","toolkit"],"author":{"name":"Chase Moskal","email":"chasemoskal@gmail.com"},"license":"MIT","_id":"@benev/marduk@0.0.0-3","maintainers":[{"name":"chasemoskal","email":"chasemoskal@gmail.com"}],"homepage":"https://github.com/benevolent-games/marduk#readme","bugs":{"url":"https://github.com/benevolent-games/marduk/issues"},"bin":{"delete-babylon-indexes":"s/delete-babylon-indexes"},"dist":{"shasum":"460e90e1b90de1aca2f84167ad478bd2d36434ae","tarball":"https://registry.npmjs.org/@benev/marduk/-/marduk-0.0.0-3.tgz","fileCount":345,"integrity":"sha512-xK6opF1n9411w5gu0U94M2aSwDj2qHEsZPKHimBpftesMa97J4AK4zJk93XWWAvnXf56/ZkmVtkp6f/qmG6l2g==","signatures":[{"sig":"MEUCIQCQEtMUolElYI0bn969RsA6yyMy3ryzT9WkPQTMb/J0EgIgVnzJygGnZpJPwO0OJlD8O1DW/t//ftjv2n+eR7+pEYY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":11204754},"main":"x/index.js","type":"module","types":"./x/index.d.ts","gitHead":"351685fcbb1f8064637c768fe3c660121aa7f523","scripts":{"_ln":"run-s _ln-s _ln-assets","_ssg":"turtle ssg --in=s,x --out=x","test":"node x/tests.test.js","_code":"turtle build --out=x","_http":"http-server x -c-1","_ln-s":"ln -s \"$(realpath s)\" x/s","build":"run-s _clean _code _ssg _ln esbuild","count":"find s -path '*/_archive' -prune -o -name '*.ts' -exec wc -l {} +","start":"run-p _turtlewatch _http esbuild-watch","_clean":"rm -rf x && s/delete-babylon-indexes","_parcel":"parcel --target app","esbuild":"esbuild x/demo/theater/worker.bundle.js --bundle --minify --format=esm --target=es2023 --outdir=x/demo/theater --entry-names=[name].esbuild --sourcemap \"--external:node:*\" --external:os --external:fs","_ln-assets":"ln -s \"$(realpath assets)\" x/assets","test-debug":"node inspect x/tests.test.js","test-watch":"node --watch x/tests.test.js","_turtlewatch":"turtle watch --in=s,x --out=x -v","esbuild-watch":"npm run esbuild -- --watch"},"targets":{"app":{"source":"x/index.html","context":"browser","distDir":"x/parcel","publicUrl":"./"}},"_npmUser":{"name":"chasemoskal","email":"chasemoskal@gmail.com"},"repository":{"url":"git+https://github.com/benevolent-games/marduk.git","type":"git"},"_npmVersion":"10.9.2","description":"babylonjs toolkit","directories":{},"_nodeVersion":"22.15.0","browserslist":["last 1 chrome version"],"dependencies":{"@e280/stz":"^0.0.0-22","@benev/math":"^0.0.0-2","@benev/slate":"^0.3.5","@e280/comrade":"^0.0.0-13","@e280/renraku":"^0.5.0-14","@babylonjs/core":"^8.10.0","@babylonjs/loaders":"^8.10.0"},"_hasShrinkwrap":false,"devDependencies":{"esbuild":"^0.25.5","typescript":"^5.8.3","http-server":"^14.1.1","npm-run-all":"^4.1.5","@benev/turtle":"^0.6.12","@e280/science":"^0.0.5"},"_npmOperationalInternal":{"tmp":"tmp/marduk_0.0.0-3_1748812248564_0.6533005913008281","host":"s3://npm-registry-packages-npm-production"}},"0.0.0-4":{"name":"@benev/marduk","version":"0.0.0-4","description":"babylonjs toolkit","license":"MIT","author":{"name":"Chase Moskal","email":"chasemoskal@gmail.com"},"type":"module","main":"x/index.js","bin":{"delete-babylon-indexes":"s/delete-babylon-indexes"},"scripts":{"build":"run-s _clean _code _ssg _ln esbuild","esbuild":"esbuild x/demo/theater/back.worker.js --bundle --minify --format=esm --target=es2023 --outdir=x/demo/theater --entry-names=[name].bundle --sourcemap \"--external:node:*\" --external:os --external:fs","esbuild-watch":"npm run esbuild -- --watch","_clean":"rm -rf x && s/delete-babylon-indexes","_code":"turtle build --out=x","_ssg":"turtle ssg --in=s,x --out=x","start":"run-p _turtlewatch _http esbuild-watch","_http":"http-server x -c-1","_parcel":"parcel --target app","_turtlewatch":"turtle watch --in=s,x --out=x -v","_ln":"run-s _ln-s _ln-assets","_ln-s":"ln -s \"$(realpath s)\" x/s","_ln-assets":"ln -s \"$(realpath assets)\" x/assets","test":"node x/tests.test.js","test-watch":"node --watch x/tests.test.js","test-debug":"node inspect x/tests.test.js","count":"find s -path '*/_archive' -prune -o -name '*.ts' -exec wc -l {} +"},"dependencies":{"@babylonjs/core":"^8.11.0","@babylonjs/loaders":"^8.11.0","@benev/math":"^0.0.0-2","@benev/slate":"^0.3.5","@e280/comrade":"^0.0.0-15","@e280/renraku":"^0.5.0-17","@e280/stz":"^0.0.0-22"},"devDependencies":{"@benev/turtle":"^0.6.13","@e280/science":"^0.0.5","esbuild":"^0.25.5","http-server":"^14.1.1","npm-run-all":"^4.1.5","typescript":"^5.8.3"},"repository":{"type":"git","url":"git+https://github.com/benevolent-games/marduk.git"},"bugs":{"url":"https://github.com/benevolent-games/marduk/issues"},"homepage":"https://github.com/benevolent-games/marduk#readme","keywords":["babylon","babylonjs","toolkit"],"_id":"@benev/marduk@0.0.0-4","gitHead":"3424f62c2b3855f7f069ba2678e42308139e35cd","types":"./x/index.d.ts","_nodeVersion":"22.15.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-afuzTCj2yUa4Ey2BIippuEnS5X5O5X3UdrKBSljGVFyWr9c+c6IWcG6RJgHh72Bk9IX54JD3f4rr+WPXCdtY3w==","shasum":"bf6935176b31c5346e772d72444b16488abc7388","tarball":"https://registry.npmjs.org/@benev/marduk/-/marduk-0.0.0-4.tgz","fileCount":282,"unpackedSize":9591887,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIAhjVBm2nONyfS3eK0K7Mx/eL88Aeh5Th83W1RHGV1XPAiEAkL5B8jBdQXWWlDwqzJEDRaYr9qN9XJqwY+rIrzqkZeo="}]},"_npmUser":{"name":"chasemoskal","email":"chasemoskal@gmail.com"},"directories":{},"maintainers":[{"name":"chasemoskal","email":"chasemoskal@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/marduk_0.0.0-4_1749184198472_0.7476753436528398"},"_hasShrinkwrap":false}},"time":{"created":"2025-05-30T03:25:04.681Z","modified":"2025-06-06T04:29:58.978Z","0.0.0-1":"2025-05-30T03:25:05.046Z","0.0.0-2":"2025-06-01T20:46:09.452Z","0.0.0-3":"2025-06-01T21:10:48.809Z","0.0.0-4":"2025-06-06T04:29:58.760Z"},"bugs":{"url":"https://github.com/benevolent-games/marduk/issues"},"author":{"name":"Chase Moskal","email":"chasemoskal@gmail.com"},"license":"MIT","homepage":"https://github.com/benevolent-games/marduk#readme","keywords":["babylon","babylonjs","toolkit"],"repository":{"type":"git","url":"git+https://github.com/benevolent-games/marduk.git"},"description":"babylonjs toolkit","maintainers":[{"name":"chasemoskal","email":"chasemoskal@gmail.com"}],"readme":"\n# MARDUK\n\n**Marduk** is a [BabylonJS](https://www.babylonjs.com/) framework for rendering good web games.\n- 🧵 **Multithreaded** — rendering happens in its own thread\n- 🎳 **Smart architecture** — logic and rendering happen on separate threads\n\n<br/>\n\n## Install Marduk\n\n```sh\nnpm install @benev/marduk\n```\n\n<br/>\n\n## Theater\n\nThe theater coordinates your rendering thread and displays the results onto a canvas.\n\nThe theater is split into two main parts. Each will live in its own separate bundle.\n- *The Frontstage* hosts the visible canvas in the dom. It doesn't import Babylon, and will be lean in filesize.\n- *The Backstage* runs inside a web worker, and performs rendering work. It imports Babylon, and will be fat in filesize.\n\n### Theater project setup\n1. Write your `spec.ts` type, which describes your renderable world\n    ```ts\n    import {AsFigmentSpec} from \"@benev/marduk/x/theater/index.pure.js\"\n\n    export type MySpec = AsFigmentSpec<{\n\n      // Describe a renderable object in your world,\n      // in terms of serializable data.\n      hippo: {hungry: boolean}\n    }>\n    ```\n    - notice the specific locations from where we're importing things\n1. Establish your `backstage.ts` module (this will be a web worker)\n    ```ts\n    import {MySpec} from \"./spec.js\"\n    import {babylonBackstage, theaterWorker} from \"@benev/marduk/x/theater/index.babylon.js\"\n\n    void async function() {\n\n      // defining a babylon backstage\n      // (you could make a backstage for a different kind of renderer)\n      const backstage = await babylonBackstage<MySpec>(async stagecraft => ({\n\n        // now we define a renderer for this object\n        hippo: (id, data) => {\n          console.log(\"spawn\", id, data)\n          return {\n            update: data => console.log(\"update\", id, data),\n            dispose: () => console.log(\"dispose\", id, data),\n          }\n        },\n      }))\n\n      // establishing the web worker\n      await theaterWorker(backstage)\n    }()\n    ```\n    - now bundle this module as `backstage.bundle.js` using `rollup`, `esbuild`, `parcel`, `vite`, or whatever\n1. Create your `frontstage.ts` module (this will be your app's main entrypoint)\n    ```ts\n    import {MySpec} from \"./spec.js\"\n    import {Frontstage, register} from \"@benev/marduk/x/theater/index.dom.js\"\n\n    void async function() {\n      const workerUrl = new URL(\"./backstage.bundle.js\", import.meta.url)\n      const frontstage = await Frontstage.make<MySpec>({workerUrl})\n      register(frontstage.getElements())\n\n      // okay, now you're ready to manipulate your world\n\n      // spawn, then update, then delete a hippo (lol, just to exercise the full lifecycle)\n      await frontstage.syncFigments([[0, [\"hippo\", {hungry: false}]]])\n      await frontstage.syncFigments([[0, [\"hippo\", {hungry: true}]]])\n      await frontstage.syncFigments([[0, undefined]])\n    }()\n    ```\n    - now bundle this module as `frontstage.bundle.js`\n1. Load the frontstage bundle onto your web page\n    ```html\n    <script type=module src=\"./frontstage.bundle.js\"></script>\n    ```\n1. Place the `<marduk-theater>` element in your html body\n    ```html\n    <marduk-theater></marduk-theater>\n    ```\n1. 🎉 You're done!\n    - If you run the page, you should see the console logging about the hippo lifecycle events.\n\n","readmeFilename":"README.md"}