{"_id":"@astral3d/infinite-grid","name":"@astral3d/infinite-grid","dist-tags":{"latest":"0.0.1"},"versions":{"0.0.1":{"name":"@astral3d/infinite-grid","version":"0.0.1","type":"module","main":"dist/index.mjs","module":"src/index.mjs","commonjs":"dist/index.cjs","exports":{".":{"import":"./src/index.mjs","require":"./dist/index.cjs"},"./package.json":{"import":"./package.json","require":"./package.json"},"./src/index.mjs":{"import":"./src/index.mjs","require":"./dist/index.cjs"},"./dist/index.cjs":{"import":"./src/index.mjs","require":"./dist/index.cjs"}},"homepage":"https://github.com/astral3d/infinite-grid","description":"An abstraction for working within an continuous, infinite grid","keywords":[],"author":{"name":"Abbey Hawk Sparrow","email":"khrome","url":"http://abbeyhawksparrow.com"},"contributors":[],"repository":{"type":"git","url":"git+https://github.com/astral3d/infinite-grid.git"},"bugs":{"url":"https://api.github.com/repos/astral3d/infinite-grid/issues"},"moka":{"firefox":{"engine":"@open-automaton/playwright-mining-engine","options":{"type":"firefox"}},"chrome":{"engine":"@open-automaton/playwright-mining-engine","options":{"type":"chromium"}},"safari":{"engine":"@open-automaton/playwright-mining-engine","options":{"type":"webkit"}},"stub":"node_modules/@open-automaton/moka/src/stub.mjs","stubs":["express","module","os","fs","path"],"shims":{"chai":"node_modules/chai/chai.js","browser-or-node":"node_modules/browser-or-node/src/index.js"}},"license":"MIT","devDependencies":{"@babel/cli":"^7.22.5","@babel/core":"^7.22.5","@babel/plugin-transform-modules-commonjs":"^7.22.5","@environment-safe/chai":"^0.2.0","@environment-safe/commonjs-builder":"^0.0.3","@environment-safe/jsdoc-builder":"^0.0.2","@open-automaton/moka":"^0.5.2","babel-plugin-search-and-replace":"^1.1.1","babel-plugin-transform-import-meta":"^2.2.0","chai":"^4.3.7","eslint":"^8.43.0","husky":"^8.0.3","mocha":"^10.2.0"},"scripts":{"lint":"eslint src/*.mjs test/*.mjs","test":"npm run import-test; npm run browser-test; npm run require-test","import-test":"mocha test/test.mjs","require-test":"mocha test/test.cjs","build-commonjs":"./node_modules/@environment-safe/commonjs-builder/bin/build.mjs","local-server":"open 'http://localhost:8085/' ; npx http-server -p 8085","headless-browser-test":"npm run headless-chrome-test; npm run headless-firefox-test; npm run headless-safari-test","headless-chrome-test":"moka --server . --browser chrome test/test.mjs","headless-firefox-test":"moka --server . --browser firefox test/test.mjs","headless-safari-test":"moka --server . --browser safari test/test.mjs","browser-test":"moka --server . --local-browser test/test.mjs","container-test":"docker build . -t environment-safe-package.json -f ./containers/test.dockerfile; docker logs --follow \"$(docker run -d environment-safe-package.json)\"","build-docs":"build-jsdoc docs","build-types":"build-jsdoc types","add-generated-files-to-commit":"git add docs/*.md; git add src/*.d.ts; git add dist/*.cjs","prepare":"husky install"},"dependencies":{"browser-or-node":"^2.1.1"},"_id":"@astral3d/infinite-grid@0.0.1","gitHead":"b0b30135947ef63cf7b6daadcef5e805dae04b54","_nodeVersion":"18.19.0","_npmVersion":"10.2.3","dist":{"integrity":"sha512-RjSAsqh9rNrRz/d4Te6yDWz0BChhio9CFY4DvK3LWr1ZErVFsyuJcK30bHxv6bN0qCpsNZoJtPv3KiFicEQXlA==","shasum":"ab4e68ede5030305142881921aef28db55273907","tarball":"https://registry.npmjs.org/@astral3d/infinite-grid/-/infinite-grid-0.0.1.tgz","fileCount":15,"unpackedSize":25168,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDCCQnpswkD74/OSVCPfiR8UccPZ5YnZ8eBHSF8AHTyFwIhAJYKBOmU5DkVJevM/C3WxUh8qZBqMtI6WCeC9rRWmTmv"}]},"_npmUser":{"name":"khrome","email":"abbey@khrome.net"},"directories":{},"maintainers":[{"name":"khrome","email":"abbey@khrome.net"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/infinite-grid_0.0.1_1733633679320_0.7645796122554291"},"_hasShrinkwrap":false}},"time":{"created":"2024-12-08T04:54:39.235Z","0.0.1":"2024-12-08T04:54:39.491Z","modified":"2024-12-08T04:54:39.812Z"},"maintainers":[{"name":"khrome","email":"abbey@khrome.net"}],"description":"An abstraction for working within an continuous, infinite grid","homepage":"https://github.com/astral3d/infinite-grid","keywords":[],"repository":{"type":"git","url":"git+https://github.com/astral3d/infinite-grid.git"},"contributors":[],"author":{"name":"Abbey Hawk Sparrow","email":"khrome","url":"http://abbeyhawksparrow.com"},"bugs":{"url":"https://api.github.com/repos/astral3d/infinite-grid/issues"},"license":"MIT","readme":"infinite-grid\n============================\nAn abstraction for working within a continuous, infinite grid\n\nUsage\n-----\n\n```js\nimport { InfiniteGrid, InfiniteGridMarker } from 'infinite-grid';\n\nconst grid = new InfiniteGrid({\n    radius: 1,\n    cellSize: 16,\n    x: 5,\n    y: 5\n});\nconst avatar = new InfiniteGridMarker({});\nawait grid.cellsLoaded();\ngrid.setAvatar(avatar, { x:0, y:0, z:0 });\n// change the position of the avatar to be outside the cell\navatar.position.x = 17;\navatar.position.y = 17;\n// check if there is a transition in the current state\nconst transition = grid.checkForTransition();\n// if so, recenter\nif(transition){\n    grid.offset.x += transition.x;\n    grid.offset.y += transition.y;\n}\n// rearrange the submeshes for the new center\ngrid.transitionCells();\n//fill in any missing submeshes once complete\ngrid.loadEmptyCells();\n//wait for the filled submeshes load to be complete\nawait grid.cellsLoaded();\n```\n\nTesting\n-------\n\nRun the es module tests to test the root modules\n```bash\nnpm run import-test\n```\nto run the same test inside the browser:\n\n```bash\nnpm run browser-test\n```\nto run the same test headless in chrome:\n```bash\nnpm run headless-browser-test\n```\n\nto run the same test inside docker:\n```bash\nnpm run container-test\n```\n\nRun the commonjs tests against the `/dist` commonjs source (generated with the `build-commonjs` target).\n```bash\nnpm run require-test\n```\n\nDevelopment\n-----------\nAll work is done in the .mjs files and will be transpiled on commit to commonjs and tested.\n\nIf the above tests pass, then attempt a commit which will generate .d.ts files alongside the `src` files and commonjs classes in `dist`\n\n","readmeFilename":"README.md"}