diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 4775d01..86236a8 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -7,7 +7,7 @@ If you wish to contribute to the NanoForge project, fork the repository and subm To get ready to work on the codebase, please do the following: 1. Fork & clone the repository, and make sure you're on the **main** branch -2. Run `pnpm install --frozen-lockfile` ([install](https://pnpm.io/installation)) -3. Make your changes -4. Run `pnpm format && pnpm build && pnpm test:unit` to run ESLint/Prettier, build and tests -5. [Submit a pull request](https://github.com/NanoForge-dev/CLI/compare) (Make sure you follow the [conventional commit format](https://github.com/NanoForge-dev/CLI/blob/main/.github/COMMIT_CONVENTION.md)) +2. Run `pnpm install --frozen-lockfile` ([install](https://pnpm.io/installation)); each example has its own install too (`cd games/breakout && pnpm install`) +3. Make your changes. Read the [rules](../README.md#rules): one item per file, and shared files are edited in `shared/` then copied with `pnpm fix` +4. Run `pnpm lint` (prettier, one item per file, shared copies). In the example you changed, also run `pnpm exec tsc --noEmit` (per app for client and server examples) and `pnpm build` +5. [Submit a pull request](https://github.com/NanoForge-dev/examples/compare) (Make sure you follow the [conventional commit format](https://github.com/NanoForge-dev/examples/blob/main/.github/COMMIT_CONVENTION.md)) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..a8fd4c7 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,54 @@ +name: Tests + +on: + pull_request: + push: + branches: [main] + +permissions: + contents: read + +jobs: + lint: + name: Lint and shared code + runs-on: ubuntu-latest + outputs: + examples: ${{ steps.list.outputs.examples }} + steps: + - uses: actions/checkout@v4 + - uses: pnpm/action-setup@v4 + - uses: actions/setup-node@v4 + with: + node-version: 26 + - run: pnpm install --frozen-lockfile + - run: pnpm lint + - run: pnpm test + - id: list + run: echo "examples=$(node scripts/check.ts --list)" >> "$GITHUB_OUTPUT" + + build: + name: Build ${{ matrix.example }} + needs: lint + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + example: ${{ fromJSON(needs.lint.outputs.examples) }} + defaults: + run: + working-directory: ${{ matrix.example }} + steps: + - uses: actions/checkout@v4 + - uses: pnpm/action-setup@v4 + - uses: actions/setup-node@v4 + with: + node-version: 26 + - run: pnpm install --frozen-lockfile + # A client+server workspace is typechecked per app: their `Context` augmentations clash. + - run: | + if [ -d apps ]; then + for app in apps/*/; do pnpm exec tsc --noEmit -p "$app"; done + else + pnpm exec tsc --noEmit -p . + fi + - run: pnpm build diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ed69331 --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +node_modules/ +dist/ +.nanoforge/ +nf_modules/ +.env +.idea/ diff --git a/.idea/.gitignore b/.idea/.gitignore deleted file mode 100644 index 30cf57e..0000000 --- a/.idea/.gitignore +++ /dev/null @@ -1,10 +0,0 @@ -# Default ignored files -/shelf/ -/workspace.xml -# Editor-based HTTP Client requests -/httpRequests/ -# Ignored default folder with query files -/queries/ -# Datasource local storage ignored files -/dataSources/ -/dataSources.local.xml diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml deleted file mode 100644 index a55e7a1..0000000 --- a/.idea/codeStyles/codeStyleConfig.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/dictionaries/project.xml b/.idea/dictionaries/project.xml deleted file mode 100644 index 48f4f77..0000000 --- a/.idea/dictionaries/project.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - keys - - - \ No newline at end of file diff --git a/.idea/examples.iml b/.idea/examples.iml deleted file mode 100644 index c956989..0000000 --- a/.idea/examples.iml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml deleted file mode 100644 index 03d9549..0000000 --- a/.idea/inspectionProfiles/Project_Default.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index 704ff0e..0000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/prettier.xml b/.idea/prettier.xml deleted file mode 100644 index b0c1c68..0000000 --- a/.idea/prettier.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 35eb1dd..0000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..3e842bf --- /dev/null +++ b/.prettierignore @@ -0,0 +1,6 @@ +node_modules/ +pnpm-lock.yaml +dist/ +.nanoforge/ +nf_modules/ +/.idea/ diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..de753c5 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,3 @@ +{ + "printWidth": 100 +} diff --git a/README.md b/README.md index 6ea6c2a..eb6bec4 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,69 @@
-
-

- NanoForge -

-
+ NanoForge +

NanoForge examples

-## About +Games made with [NanoForge](https://nanoforge.eu). Each one is a project of its own, laid out as +`nf new` writes it, and opens in the editor (`nf editor `). -This repository contains the examples for NanoForge. +| Folder | What | +| --------- | ---------------------------------------------------------------------- | +| `basics/` | One engine feature each: the smallest game that shows it. | +| `demos/` | Small games around one idea (the pong family): local, networked, 3D. | +| `games/` | Complete games. | +| `shared/` | Components and systems several examples use, copied into each of them. | -## Examples in the repository +## Examples -- flappy-bird -- pong-network -- tic-tac-toe +| Example | Shows | +| ------------------------------------------------ | ----------------------------------------------------------- | +| [`basics/input-keyboard`](basics/input-keyboard) | Keyboard input: two squares moved with the arrows and WASD. | +| [`basics/input-mouse`](basics/input-mouse) | Mouse position, clicks and drag. | +| [`basics/input-gamepad`](basics/input-gamepad) | A controller's stick, buttons and rumble. | +| [`basics/sprite-2d`](basics/sprite-2d) | Images drawn from the assets folder. | +| [`basics/sound`](basics/sound) | Sound effects. | +| [`basics/music`](basics/music) | Music tracks. | +| [`basics/scenes`](basics/scenes) | Two scenes and their scene vars. | +| [`basics/network`](basics/network) | A client, a game server and a shared protocol library. | +| [`basics/graphics-3d`](basics/graphics-3d) | A lit, spinning cube in 3D. | +| [`demos/pong`](demos/pong) | Pong for two players on one keyboard, with scenes. | +| [`demos/pong-network`](demos/pong-network) | Pong over the network, run by a game server. | +| [`demos/pong-3d`](demos/pong-3d) | Pong in 3D, peer to peer, with the same server code. | +| [`games/breakout`](games/breakout) | Breakout: menu, three levels, pause and end screens. | +| [`games/flappy-bird`](games/flappy-bird) | Flappy Bird. | +| [`games/tic-tac-toe`](games/tic-tac-toe) | Tic-tac-toe for two players. | +| [`games/raid-survival`](games/raid-survival) | A co-op multiplayer zombie survival game. | +## Run an example + +```sh +cd basics/input-keyboard +pnpm install +pnpm dev # or pnpm build && pnpm start +pnpm editor # open it in the NanoForge editor +``` + +Node 26 and pnpm 12. The examples depend on the latest NanoForge packages. + +## Rules + +- **One item per file**: each file under `components/` holds one component, each file under + `systems/` one system, each file under `scenes/` one scene (nested folders included). Types, + interfaces and enums that describe the item may sit next to it; any other export is a second + item. Items carry the editor's TSDoc tags (`@component`, `@system`, `@scene`, `@side`). +- **Shared code is copied, never imported**: an example must work on its own once copied out of + this repository. A file at `src/` whose `` exists in `shared//` must be an + exact copy of it. `pnpm check` fails on a copy that drifted; `pnpm fix` copies the shared version + over it. Change the file in `shared/`, then run `pnpm fix`. +- The shared files are temporary: [`docs/shared-components.md`](docs/shared-components.md) lists + them and the library package that should replace each one. + +## Checks + +```sh +pnpm install +pnpm lint # prettier + one item per file + shared copies +node --test scripts/check.test.ts # self-test of the check +``` + +CI also type-checks and builds every example (`.github/workflows/tests.yml`). diff --git a/basics/graphics-3d/.gitignore b/basics/graphics-3d/.gitignore new file mode 100644 index 0000000..f28e2dc --- /dev/null +++ b/basics/graphics-3d/.gitignore @@ -0,0 +1,5 @@ +node_modules/ +dist/ +.nanoforge/ +nf_modules/ +.env diff --git a/basics/graphics-3d/README.md b/basics/graphics-3d/README.md new file mode 100644 index 0000000..0f4823e --- /dev/null +++ b/basics/graphics-3d/README.md @@ -0,0 +1,20 @@ +# graphics-3d + +A cube spinning in 3D, lit by a sun and the sky. + +It shows the `graphics-3d` engine library (Three.js): `main` sets up the scene's background, +camera and lights through `Graphics3DLibrary`, and the cube is an entity: `Transform3D` places it, +`DrawableBox3D` draws it (the `draw3D` system adds its mesh to `ctx.graphics.scene`) and `Spin3D` +turns it (the `spin3D` system). graphics-3d renders the scene after the systems, every tick. + +`Transform3D`, `DrawableBox3D`, `DrawableSphere3D` (a ball, unused here) and `draw3D` are copies +of `shared/3d` (see the repository's README); `demos/pong-3d` draws its table with them. + +Three.js is a peer dependency of graphics-3d: import its classes from +`@nanoforge-dev/graphics-3d/three`. + +```sh +pnpm install +pnpm dev # play it +pnpm editor # open it in the editor +``` diff --git a/basics/graphics-3d/assets/.gitkeep b/basics/graphics-3d/assets/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/basics/graphics-3d/nanoforge.config.ts b/basics/graphics-3d/nanoforge.config.ts new file mode 100644 index 0000000..77607cb --- /dev/null +++ b/basics/graphics-3d/nanoforge.config.ts @@ -0,0 +1,5 @@ +import { defineConfig } from "@nanoforge-dev/config"; + +export default defineConfig({ + type: "client", +}); diff --git a/basics/graphics-3d/package.json b/basics/graphics-3d/package.json new file mode 100644 index 0000000..0b1ce92 --- /dev/null +++ b/basics/graphics-3d/package.json @@ -0,0 +1,26 @@ +{ + "$schema": "https://json.schemastore.org/package.json", + "name": "graphics-3d", + "description": "A spinning cube: the smallest NanoForge game drawn in 3D", + "private": true, + "type": "module", + "scripts": { + "dev": "nf dev", + "build": "nf build", + "start": "nf start", + "editor": "nf editor ." + }, + "devDependencies": { + "@nanoforge-dev/asset": "^3.0.0", + "@nanoforge-dev/cli": "^3.0.1", + "@nanoforge-dev/common": "^3.0.0", + "@nanoforge-dev/config": "^3.0.1", + "@nanoforge-dev/core": "^3.0.0", + "@nanoforge-dev/ecs": "^3.0.0", + "@nanoforge-dev/editor-lib": "^3.0.0", + "@nanoforge-dev/env": "^3.0.0", + "@nanoforge-dev/graphics-3d": "^3.0.0", + "three": "^0.187.0", + "typescript": "^6.0.0" + } +} diff --git a/basics/graphics-3d/pnpm-lock.yaml b/basics/graphics-3d/pnpm-lock.yaml new file mode 100644 index 0000000..e54d940 --- /dev/null +++ b/basics/graphics-3d/pnpm-lock.yaml @@ -0,0 +1,1539 @@ +lockfileVersion: '9.0' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + +importers: + + .: + devDependencies: + '@nanoforge-dev/asset': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/cli': + specifier: ^3.0.1 + version: 3.0.1 + '@nanoforge-dev/common': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/config': + specifier: ^3.0.1 + version: 3.0.1 + '@nanoforge-dev/core': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/ecs': + specifier: ^3.0.0 + version: 3.0.0(@nanoforge-dev/editor-lib@3.0.0) + '@nanoforge-dev/editor-lib': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/env': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/graphics-3d': + specifier: ^3.0.0 + version: 3.0.0(@nanoforge-dev/editor-lib@3.0.0)(three@0.187.0) + three: + specifier: ^0.187.0 + version: 0.187.0 + typescript: + specifier: ^6.0.0 + version: 6.0.3 + +packages: + + '@angular-devkit/core@22.2.7': + resolution: {integrity: sha512-cchZAMsV4d76RDZBlWzPhYxM/Hb6bmq71oUngdrwehMbBbdQu3W9C2tGlvxuPxbRKru9ZlUa14YVXQ0+QnhFtw==} + engines: {node: ^22.22.3 || ^24.15.0 || >=26.0.0, npm: ^6.11.0 || ^7.5.6 || >=8.0.0, yarn: '>= 1.13.0'} + peerDependencies: + chokidar: ^5.0.0 + peerDependenciesMeta: + chokidar: + optional: true + + '@angular-devkit/schematics-cli@22.2.7': + resolution: {integrity: sha512-9Od0E8TiYTQWm/03QjYWnsryZA8ZSjTf/k5z61nPd/jgloVNvSW8kxC7/YMw+RoXh2idMzjiJxraKxg+gJxzPw==} + engines: {node: ^22.22.3 || ^24.15.0 || >=26.0.0, npm: ^6.11.0 || ^7.5.6 || >=8.0.0, yarn: '>= 1.13.0'} + hasBin: true + + '@angular-devkit/schematics@22.2.7': + resolution: {integrity: sha512-a1h7xNqBLQVo1e5eCyOU3axSbA9AFU6nnSH5QhlNhggfMeZde+eBrueSt25xsewoxlKO8EvkVT3+knMUkDYiGQ==} + engines: {node: ^22.22.3 || ^24.15.0 || >=26.0.0, npm: ^6.11.0 || ^7.5.6 || >=8.0.0, yarn: '>= 1.13.0'} + + '@dimforge/rapier3d-compat@0.12.0': + resolution: {integrity: sha512-uekIGetywIgopfD97oDL5PfeezkFpNhwlzlaEYNOA0N6ghdsOvh/HYjSMek5Q2O1PYvRSDFcqFVJl4r4ZBwOow==} + + '@emnapi/core@2.0.0-beta.2': + resolution: {integrity: sha512-MzCVoWtcg4Pm2B3je5mMvYMvj3MmBKw+fU7vbsJc9/iT8ip6/eYIHo/Dsm/mr+wsHB6SEyJDuxB09Yy6r/8+4A==} + + '@emnapi/runtime@2.0.0-beta.2': + resolution: {integrity: sha512-JcrSPzPvZuNZvJqPTF9Fw25LbOJ8avzFVlaf2grmH4Cku0oGP47tRgqPZadcfj3YoZMHkFVnCYFbQM8I+i5QEw==} + + '@emnapi/wasi-threads@2.2.0': + resolution: {integrity: sha512-JP7OYH38Q7+pyTAe14raZHLQIK7BDKbdwji+Xi3pcd/6QkJYQH3SX4wu6EplGrGJWRepoNzedfm0G3B9Z4e9Rw==} + + '@inquirer/ansi@2.1.0': + resolution: {integrity: sha512-63GU5AD9KhNbWM0jlhHoMJTEFck2upFOPxHlnCKf3xYTV3rjTUUQfodihmTnfYQzMLS29oy8lK/gA1eJgu4bhA==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + + '@inquirer/checkbox@5.3.0': + resolution: {integrity: sha512-3QQSO87A+JoRtOtjtsgX2enwTL+3+VBVrkUpdqrIxMOgn5+W5sE57PcCPAiNUIESHxV4Q6mNEGxq2xLmRa0/yw==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/confirm@6.4.0': + resolution: {integrity: sha512-+DCZxrOF01Q/1SzTQkgycAQPS/Jf+Yol0h1P/MVmopukTsxGOu1h/LKqf30y0eHKFZYYrgUMVhGDhEbPmSPi9A==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/core@12.1.0': + resolution: {integrity: sha512-6H7usRWw4Gdjgpaem10CA5MfZ/xoYPGyInriR1Xubqjv+SVo8LIJ1erpFxW5JgCza6VZVZiKLTko7RtUU3AQMg==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/editor@5.4.0': + resolution: {integrity: sha512-L7vdCe4jnMpzhDisu1tAnr4WGvfPOVz+vNFXyIIL7O2Ycn/n90sn1ARvg+4cwzLf+us51BE/cX7uhnrLcal3+g==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/expand@5.2.0': + resolution: {integrity: sha512-AOp2KQk7QojUyWOP7VkqdBWmxLRaVH58wQMx3N4//P530EDtpVp1EWIjAJubx9ZohWS/UCEpIkA1TuiNki0iOA==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/external-editor@3.1.0': + resolution: {integrity: sha512-27JAkF38nXqXaoveU28iA/+Z8nutnF8B3JsbdToPHn9WnkrsMtZ0/YoJ29YwbtFexYIo+tIy6ikMvTdHKjjmGA==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/figures@2.1.0': + resolution: {integrity: sha512-CR9u2PME23jxy2SOyTb117efwAAPm98Zr+LoWI+PiQ55D6U8Yeu/HyFTxwytKhPa6oxAGzdsm2Kg7oLS6B9z8w==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + + '@inquirer/input@5.2.0': + resolution: {integrity: sha512-sIUPnN2X7M+7dq3RUd+e9QRacYnM+6B+kSucwQgj5VC5Eo/f+CIr2NyPBumxsViI+wzfokkgop/3x3KfHxNyJw==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/number@4.3.0': + resolution: {integrity: sha512-xYkX4sPVgox0F7yQwpz/MByWjOGdLEf1pdjH+Lji2gAzSs2xezz5bN5YgS1n0tx9wo0mRhGvq1KJGtvDZ9XXcQ==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/password@5.3.0': + resolution: {integrity: sha512-KVqW4G/UbMK06uBN76xF89JKYC9YBWU7v+Kc2tUwMCO8pg3ASBr0HVabl1KaSqF94O2KiRu8aKx4EicN78PK+A==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/prompts@8.7.2': + resolution: {integrity: sha512-QoRB4wFIjgH5iOhSjoIKMkTvSHDuV+O3OITlIqAYO0oK5x364GJILXiMBvlPiE+klg7Xx9tq5XVqQHcGUDYYPA==} + engines: {node: '>=23.5.0 || ^22.13.0 || ^20.17.0'} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/prompts@8.8.0': + resolution: {integrity: sha512-yYVT2Eo3mafb9tnU2Mr3+wh5wLCWyspExqVoPSMCIfBIn3ZUTE4IDfbCMbMgXaOH0tH+JZEhOtfczQhDzOjIGg==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/rawlist@5.4.0': + resolution: {integrity: sha512-x42wcy465GM5/mHNKBFdAJbLlLyzmYqr/DEa6F49nHpI+03EFwRCRKeLGQakx5XqZ4unc2yFuS78qAD4Rb0iFA==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/search@4.4.0': + resolution: {integrity: sha512-UJ+9tkzPT1AjnvjuPFYcOdO3BVeN28bfSXajYRFZTRgA9OiNl4k2Nn2cHHPwiIDyPHlvOnmE9ZOHyXhPHtvb+A==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/select@5.3.0': + resolution: {integrity: sha512-Fmgfl0qjqCQo+/tjQpgnRXKh5N7/VpYcJh+AlYU2eHmHZLMGUBDzo+Gwc2ODzWJfXNRZmgaMhz4qULcO/C/rXg==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/type@4.3.0': + resolution: {integrity: sha512-/IA8q2nyjgyl0NGSjqiRXB8gh3We7Pzx9C0c+6Zoolu905jFc79anerrUG7+n65+qs310DRK43yi2WDI8nY59A==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@isaacs/fs-minipass@4.0.1': + resolution: {integrity: sha512-wgm9Ehl2jpeqP3zw/7mo3kRHFp5MEDhqAdwy1fTGkHAwnkGOVsgpvQhL8B5n1qlb01jV3n/bI0ZfZp5lWA1k4w==} + engines: {node: '>=18.0.0'} + + '@jridgewell/sourcemap-codec@1.6.0': + resolution: {integrity: sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw==} + + '@nanoforge-dev/asset@3.0.0': + resolution: {integrity: sha512-jqXcyCMbdcCCj7wZ/dyIpjY8hza02Pt/vY8KrNcaXTlxpTc9EE+VKuO5+fHdUXWWPgJSFt96TqAPhug+z+KH3Q==} + engines: {node: '26'} + + '@nanoforge-dev/cli@3.0.1': + resolution: {integrity: sha512-ZfrbETcAcX3vsPLO1WLSCJc2ERCAcIpbdi9Df5bmH3XLinQkDAcESkN9JkaI/vgV08A7xhTjV8zSDSwF0T73Xg==} + engines: {node: '26'} + hasBin: true + + '@nanoforge-dev/common@3.0.0': + resolution: {integrity: sha512-lzMvQ1vCElh9OcP4EqhffbY+AQXOH4IiuD1pj7VvJlpcY6hh7Bs/s4NVS0gXoJ+ibpBMe5mAq23RyzqTwk8czg==} + engines: {node: '26'} + + '@nanoforge-dev/config@3.0.1': + resolution: {integrity: sha512-XWRScOotb8IirerRx/mWLmUVYye3lo0PN/5a0MUp/eoSrhz0S6zzhGHEupRuC8aeHTjsQT7ctM3P6YyKSHZLaQ==} + engines: {node: '26'} + + '@nanoforge-dev/core@3.0.0': + resolution: {integrity: sha512-pa7Fr3TFkZVfAADBC17Qt5ru/W9vXtYB8e5eb7wurAtu8/jH/ZtqfW3kafTuWC9513MXp/h6LOCdZQhjnCt6UA==} + engines: {node: '26'} + + '@nanoforge-dev/ecs@3.0.0': + resolution: {integrity: sha512-csrXJtCzqohxtvEQs+O//xabnaLR3BXe0QpSpl7NVihF3f0iX2fNYURxNjQKxzoPYBokCnnyNxN2KFc7UmIsdA==} + engines: {node: '26'} + peerDependencies: + '@nanoforge-dev/editor-lib': 3.0.0 + '@nanoforge-dev/scene': 3.0.0 + peerDependenciesMeta: + '@nanoforge-dev/editor-lib': + optional: true + '@nanoforge-dev/scene': + optional: true + + '@nanoforge-dev/editor-lib@3.0.0': + resolution: {integrity: sha512-fSWm6bHelbxqeVESYoUUKDi9RGNxvRu6p1r41KE1DddM0RrP0/WzkFOWBvgl+psHbYNotXe723Y2Fd3p+tqPDQ==} + engines: {node: '26'} + + '@nanoforge-dev/editor@0.1.4': + resolution: {integrity: sha512-bqbrH8ulFSiZz1iisJHtHeEzj1RV/70uErCYHeW4DIhVPsWbBfWKFvg/ghAbmPk5vsj0YnhDX6DSpik4S1QoiQ==} + engines: {node: '25'} + + '@nanoforge-dev/env@3.0.0': + resolution: {integrity: sha512-kXYXl9/09Bn8VStTTFuZY3dYDG9b76VhOi9PHMnaLe75XcFRLKJ2dYkXf3ut6RCL2+6H7HAEIOALjR15CHnJ5A==} + engines: {node: '26'} + + '@nanoforge-dev/graphics-3d@3.0.0': + resolution: {integrity: sha512-yRY2ktlzgHQS0fdrdj+k5FjrBMGPQ3vFnw+Ag3vMv2mRRrFCwFBDzofpf1tSzluOyyTpJkgD2tmRpQZqC5CsLg==} + engines: {node: '26'} + peerDependencies: + '@nanoforge-dev/editor-lib': 3.0.0 + three: ^0.187.0 + peerDependenciesMeta: + '@nanoforge-dev/editor-lib': + optional: true + + '@nanoforge-dev/loader-client@1.7.0': + resolution: {integrity: sha512-zDj0yQ8cZyHHjAYDVIyB79mh4dK7WRgZG7Kc+d/43t2WX/pX2HqBVkpLcDPkA9cNOKpCRYWd3LyYISlz53gzyg==} + engines: {node: '26'} + + '@nanoforge-dev/loader-server@1.7.0': + resolution: {integrity: sha512-Yd/BYORhoar5znNSD7kGirAc1Al0q5t8iscbb07QWKeXWA+DLKjPSuKJC6ykysFkbs9HiZU59oOfxyvNL4h3Pw==} + engines: {node: '26'} + + '@nanoforge-dev/loader-website@1.7.0': + resolution: {integrity: sha512-x1fV3RYUUxru39sF5HJcfutNnifMMTIEHW92jgkR9gz06ZlZ+rQofuegXgAnEzs0dEXa+rhNQ/iXYbqOZvq6YQ==} + engines: {node: '26'} + + '@nanoforge-dev/registry@3.0.1': + resolution: {integrity: sha512-EzSaszYtrPldD5Do7jdQK3TLLb8uCirY6NQjKXkeGw31X+sUXor4h5GAaoxELWMzPnv9BbKtggSaVaQIt7s8IQ==} + engines: {node: '26'} + + '@nanoforge-dev/schematics@3.0.1': + resolution: {integrity: sha512-iK2vC0gPEh2mQ81IB4+jfGw/ZNOLMDnS9HRBXH5tWB0mdN5GA32viblhW0oYPX2/tWrLC9YiCPgEE4AL8Zwz6w==} + engines: {node: '26'} + + '@napi-rs/wasm-runtime@1.2.6': + resolution: {integrity: sha512-mRyDmEw9/fCDXCGfL1sbgIw/GUK0PVxRW4YwgPN61F3LQ+fSyoBFarJVzgGyhF6kRzEQZ0FejDqm4WLXSeqQmw==} + engines: {node: ^20.19.0 || ^22.13.0 || >=23.5.0} + peerDependencies: + '@emnapi/core': ^1.7.1 || 2.0.0-beta.2 + '@emnapi/runtime': ^1.7.1 || 2.0.0-beta.2 + + '@oven/bun-darwin-aarch64@1.4.4': + resolution: {integrity: sha512-zW/hxwc8sJAILGwB5eTC4i48ouGXf0V4lrxmEOk3JIE6JkYVW1TZh1E2pIempqsezgW1sckTIIDudFON8bJ2Mw==} + cpu: [arm64] + os: [darwin] + + '@oven/bun-darwin-x64@1.4.4': + resolution: {integrity: sha512-oKGcxLsvh4oHjAo28nPm8c/xN0o/OmGyj1IHYc94vprkWsW2hNg2keEZt5f40cI5Hvu4jDlSRTR0UNpv1UIAxw==} + cpu: [x64] + os: [darwin] + + '@oven/bun-freebsd-aarch64@1.4.4': + resolution: {integrity: sha512-klvA9FlwLxZj3JYIOPQA4bbnHIC3uas8kBE4GaGGkeVgAQP/k8hAzYkOqkSaqHBDbxLrTyFEQArEAevJq6NJzg==} + cpu: [arm64] + os: [freebsd] + + '@oven/bun-freebsd-x64@1.4.4': + resolution: {integrity: sha512-sF1xS/scbyN94P2d0eTiarO6JHxrIvhZNT9hnWjQXW5nwKRtfuP+UYnIMNyvW1BQPcZFP/cvfLBNUIe1ea4zPA==} + cpu: [x64] + os: [freebsd] + + '@oven/bun-linux-aarch64-android@1.4.4': + resolution: {integrity: sha512-5lvn3at5vRC0GxvmiqEiV2/e23tnRi0q5pzR40yfDvDA3OW7PSkt4chF1nA9vnAJhro4/l+ol1FmNP6D3cf/oA==} + cpu: [arm64] + os: [android] + + '@oven/bun-linux-aarch64-musl@1.4.4': + resolution: {integrity: sha512-QFd0P+mHJxbZFbUla4MgiE5OwxysHaUIYxL2pPNkpWtaI7v4ShOpr8OhBmsuyB0xn5rv/ZJnPsj2y8+bB9+g/A==} + cpu: [arm64] + os: [linux] + libc: [musl] + + '@oven/bun-linux-aarch64@1.4.4': + resolution: {integrity: sha512-ZTVtpf9zmHSBVPX1sBwe5agGb/rN34yPGg/Hby8e2Ax2uCUA2URZKlZH7qLntK7qaFJCMXh9v0GWNYN2zINz1w==} + cpu: [arm64] + os: [linux] + libc: [glibc] + + '@oven/bun-linux-x64-android@1.4.4': + resolution: {integrity: sha512-3dMicj9C1DhaIfDkwt/9GtpU0W+q+GazbG9OIlEyL3Q1BBEz2e6ZRz/JiO8D/ECC0caXAqvnpFudehcLlgIwWQ==} + cpu: [x64] + os: [android] + + '@oven/bun-linux-x64-musl@1.4.4': + resolution: {integrity: sha512-lEEjNOJJrbGZu2NVcPI4uXdILcpspezWkA8R/Jr0RCGhM6zQd0Y7JBIIKNAmbX59EeWpeEz7Q78iLbpcAUypUA==} + cpu: [x64] + os: [linux] + libc: [musl] + + '@oven/bun-linux-x64@1.4.4': + resolution: {integrity: sha512-CHbbkmHVM28T1GFq+6GL4Ao4ujwwYwj1CxFFwEFzLanPfNsId9AhbIP0Q4reWuWBkGimUkoQygrK7Rgjtj3vog==} + cpu: [x64] + os: [linux] + libc: [glibc] + + '@oven/bun-windows-aarch64@1.4.4': + resolution: {integrity: sha512-n0ep5ZRPCZY1+dqFJpnnRUZB1wy4GYU6At8RF+pyzySCLjkN9R4rFh2PtBHAgF/lg1vOl3/CeER3pDM+p40ATA==} + cpu: [arm64] + os: [win32] + + '@oven/bun-windows-x64@1.4.4': + resolution: {integrity: sha512-a3LNctBVO8PjePsFZfwDleF2JXYf2BfQ1u/PLRnBDLnC2Riml+4+LgJpKj4xRGhB92KweGyQI5PXaTkP9qypMQ==} + cpu: [x64] + os: [win32] + + '@oxc-project/types@0.158.0': + resolution: {integrity: sha512-xZ66qA4WmLbTLlxH3mqMd8f9UKbaOzOT0ATwFf4DH/14pMgpUrtqtjyYzOQmgfl2a0iRAAMbQ9G1th/67jRzGw==} + + '@rolldown/binding-android-arm-eabi@1.3.2': + resolution: {integrity: sha512-kqR2xcygEx3WwDY69LsKeyf7SVmx4yzMtKZRknyaHieVJdRvvnAM97L0Gq6tUFc9T2YXcW/Ghij2+Um6He0LTw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [android] + + '@rolldown/binding-android-arm64@1.3.2': + resolution: {integrity: sha512-gXM4GAAvvIZA7qUuSCQS+Zz91H2fagKa5MNppUdjzysJ8LXMWm9D/gQj4nfOKo6okquDQ5pkjsuo2SUMXNW0Rw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [android] + + '@rolldown/binding-darwin-arm64@1.3.2': + resolution: {integrity: sha512-OBs5hp3W+LwMEUmDMMMnu08ncG0t6DDgnFU+6TAucKtAfNgerYLZSr2jtREKb/JuPQ1J7bJnWIgKKkxvjuAw1g==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [darwin] + + '@rolldown/binding-darwin-x64@1.3.2': + resolution: {integrity: sha512-X0VGYd4v/gdjfa/IP6uHuMhofPoUDYvK/byk3bC0jQ1pKKgt6RZ4B4puMqP0AHkjmIHAsxA471mM6AxZ39IaTA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [darwin] + + '@rolldown/binding-freebsd-x64@1.3.2': + resolution: {integrity: sha512-mr04K4cp9J/fj9fknrX8e4QvI/V48Sp+4v64PoLwhoirIH8b8L8EBrF/0bTjV1It2IL91hoNG13GblnWLglkxA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [freebsd] + + '@rolldown/binding-linux-arm-gnueabihf@1.3.2': + resolution: {integrity: sha512-VgWy02HU9Tiy6tU8U+kF3Fd4TQwTNdIBvs2MlgViP1ksMtAnQQTIPAj0ZsJzIQXKIOugqQSpqxQgELJ3fkuL5w==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [linux] + + '@rolldown/binding-linux-arm64-gnu@1.3.2': + resolution: {integrity: sha512-0wloJFYqV844gv6boiERbHpErxbxHbmlgnMX5VxP1Ux+DLBqGrUOn0cIpBmCZEcTITes3QUelxya4u8c9ziQvQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-arm64-musl@1.3.2': + resolution: {integrity: sha512-Kys8wgFQy8H8vua0MNpC0akMBFoNO8455RHk2yycBM0iayMIAtVAL6xmV9TWAkehFgrrlImTL2fZdX5LXfYtAA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + libc: [musl] + + '@rolldown/binding-linux-ppc64-gnu@1.3.2': + resolution: {integrity: sha512-L8eej7+/StRxUHHOPsOVl7Fzx/3tumuGB4hGQZKT73xRI16KZhaSJr0gi3C3WBjNRxeJRKKps2UD4lQukP+oBw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [ppc64] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-s390x-gnu@1.3.2': + resolution: {integrity: sha512-MV5CEb/nV8neQOj7l6945q1vy62HXtWO8zPDvfySPusoUzdBoLoJ/DfXXwaYThGTXZCniF+5bCf253WTPPK7Yw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [s390x] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-x64-gnu@1.3.2': + resolution: {integrity: sha512-3qssvvVvkwQookZ1/1avlKWc5orAR85vgKdzDd5noZS8nnHiI/ejOAEt0xfNYvtBBF7/DZmP8dANWkRBJVOBCA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-x64-musl@1.3.2': + resolution: {integrity: sha512-rJqoFTm/bCZFKKgaT4NzWn/TuJkFDToZ/rzYFnYVBL28jH1nIfg6snx2mDri30nal9H+wcYfKpoPR9jrMQgQQg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + libc: [musl] + + '@rolldown/binding-openharmony-arm64@1.3.2': + resolution: {integrity: sha512-ozdbCjHfh0N//wJNExjJlSlcDaeIKo8k1ktzkLUyESr2Gu/Qw7nBYxKe3jgtoaxda570vg10WdYosre82263hQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [openharmony] + + '@rolldown/binding-wasm32-wasi@1.3.2': + resolution: {integrity: sha512-p5VA6Vk/2cXZPVWf+dDbuE0dkhrcoAo6pISTJmzUnsSdQqNJdusyR8lZgHku095+r27zrYISNLZnJoqrcePW0A==} + engines: {node: ^20.19.0 || ^22.13.0 || >=23.5.0} + cpu: [wasm32] + + '@rolldown/binding-win32-arm64-msvc@1.3.2': + resolution: {integrity: sha512-XDb2U14Orf4r76SwzvJ7avePL00w4gHBmi1Ig4B/itYFEUTmYMNDHVU0dcYuBa0LgNBqyREoJOrQKxQlyYJA7A==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [win32] + + '@rolldown/binding-win32-x64-msvc@1.3.2': + resolution: {integrity: sha512-lEsKzKJqIUDZVCBhS4lkZuyQUhV1oRg5UHkI72qlOAqJn7qEXcoVdTridFS7PHNWdZknBl95EAF/4P1Xv0K1eQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [win32] + + '@rolldown/pluginutils@1.1.0': + resolution: {integrity: sha512-K+NU2HDCEem4sClgHH4ZZXwdJeNFkJo+hRk479DIwdIviAPN2hFJH1KHHwg8CxHQXvi0M5XY4deTXINfIiSG6w==} + + '@sindresorhus/is@4.6.0': + resolution: {integrity: sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==} + engines: {node: '>=10'} + + '@tweenjs/tween.js@23.1.3': + resolution: {integrity: sha512-vJmvvwFxYuGnF2axRtPYocag6Clbb5YS7kLL+SO/TeVFzHqDIWrNKYtcsPMibjDx9O+bu+psAy9NKfWklassUA==} + + '@tybys/wasm-util@0.10.4': + resolution: {integrity: sha512-W3c4gRigFS0T/Ma4qIYF3GDAc5AQdHb1yL5znJT1Zv1YaD9Kitx656wBjvr19qbiosmZT8lWDM5BEMynUqX65A==} + + '@types/stats.js@0.17.4': + resolution: {integrity: sha512-jIBvWWShCvlBqBNIZt0KAshWpvSjhkwkEu4ZUcASoAvhmrgAUI2t1dXrjSL4xXVLB4FznPrIsX3nKXFl/Dt4vA==} + + '@types/three@0.187.0': + resolution: {integrity: sha512-v+vKNarUtk4n2QRZ4+CN5ygMM0ARUjXjIQl0R/unMUfmStFeVqGbgqarbrpoGTXRZoulSH16ePrVJVxPJEbMUA==} + + '@types/validator@13.15.10': + resolution: {integrity: sha512-T8L6i7wCuyoK8A/ZeLYt1+q0ty3Zb9+qbSSvrIVitzT3YjZqkTZ40IbRsPanlB4h1QB3JVL1SYCdR6ngtFYcuA==} + + '@types/webxr@0.5.24': + resolution: {integrity: sha512-h8fgEd/DpoS9CBrjEQXR+dIDraopAEfu4wYVNY2tEPwk60stPWhvZMf4Foo5FakuQ7HFZoa8WceaWFervK2Ovg==} + + ajv-formats@3.0.1: + resolution: {integrity: sha512-8iUql50EUR+uUcdRQ3HDqa6EVyo3docL8g5WJ3FNcWmu62IbkGUue/pEyLBW8VGKKucTPgqeks4fIU1DA4yowQ==} + peerDependencies: + ajv: ^8.0.0 + peerDependenciesMeta: + ajv: + optional: true + + ajv@8.20.0: + resolution: {integrity: sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA==} + + ansi-regex@6.6.0: + resolution: {integrity: sha512-XZ5apbzreCbXSKwPjJstu8R0zOi247w3XYwWxtwBXgpZrCyc1Ka7p9/xY0A9/diMewmHbEKz+FIraWaEWjlN5g==} + engines: {node: '>=12'} + + ansis@4.5.0: + resolution: {integrity: sha512-KwIVkfFfJSSzBmZhDGuTmkhWqTdyB5oNVzzznBJbBZ5bZtHiqSrcugRF0RKJKT4Ss3d7ZrcjnlFVDlQNmtWfWw==} + engines: {node: '>=14'} + + braces@3.0.3: + resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} + engines: {node: '>=8'} + + bun@1.4.4: + resolution: {integrity: sha512-hj0ASdG6PNjLZGFAXktWb3Uaj/dcv/1wCsIttoEXADNIQBsGjTr+5uLKYbrDkuc7NT0Tkj4yPIqJI2jDxXdvVg==} + cpu: [arm64, x64] + os: [darwin, linux, android, freebsd, win32] + hasBin: true + + bundle-name@4.1.1: + resolution: {integrity: sha512-DdH81/zPLVS11EUgWq3tEu/xn+EzljlMYooDNdzWEnFha3R3NBMpMV1UqYIpjYHV/SgpFKMIX1Oh7o06SjM/oA==} + engines: {node: '>=18'} + + chalk@5.6.2: + resolution: {integrity: sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA==} + engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} + + char-regex@1.0.2: + resolution: {integrity: sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==} + engines: {node: '>=10'} + + chardet@2.2.0: + resolution: {integrity: sha512-rddelWYNPRrXq6PtNEN2S3f6t9ILzvqaN5pVgi4kqt9jHQaXIial9PznB5iSPVlQSLNaaH22ItWz3EJtQ10+OA==} + + chokidar@5.0.0: + resolution: {integrity: sha512-TQMmc3w+5AxjpL8iIiwebF73dRDF4fBIieAqGn9RGCWaEVwQ6Fb2cGe31Yns0RRIzii5goJ1Y7xbMwo1TxMplw==} + engines: {node: '>= 20.19.0'} + + chownr@3.0.0: + resolution: {integrity: sha512-+IxzY9BZOQd/XuYPRmrvEVjF/nqj5kgT4kEq7VofrDoM1MxoRjEWkrCC3EtLi59TVawxTAn+orJwFQcrqEN1+g==} + engines: {node: '>=18'} + + class-transformer@0.5.1: + resolution: {integrity: sha512-SQa1Ws6hUbfC98vKGxZH3KFY0Y1lm5Zm0SY8XX9zbK7FJCyVEac3ATW0RIpwzW+oOfmHE5PMPufDG9hCfoEOMw==} + + class-validator@0.14.4: + resolution: {integrity: sha512-AwNusCCam51q703dW82x95tOqQp6oC9HNUl724KxJJOfnKscI8dOloXFgyez7LbTTKWuRBA37FScqVbJEoq8Yw==} + + class-validator@0.15.1: + resolution: {integrity: sha512-LqoS80HBBSCVhz/3KloUly0ovokxpdOLR++Al3J3+dHXWt9sTKlKd4eYtoxhxyUjoe5+UcIM+5k9MIxyBWnRTw==} + + cli-cursor@5.0.0: + resolution: {integrity: sha512-aCj4O5wKyszjMmDT4tZj93kxyydN/K5zPWSCe6/0AV/AA1pqe5ZBIw0a2ZfPQV7lL5/yb5HsUreJ6UFAF1tEQw==} + engines: {node: '>=18'} + + cli-spinners@3.4.0: + resolution: {integrity: sha512-bXfOC4QcT1tKXGorxL3wbJm6XJPDqEnij2gQ2m7ESQuE+/z9YFIWnl/5RpTiKWbMq3EVKR4fRLJGn6DVfu0mpw==} + engines: {node: '>=18.20'} + + cli-width@4.1.0: + resolution: {integrity: sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==} + engines: {node: '>= 12'} + + commander@15.1.0: + resolution: {integrity: sha512-cgnQ88TRrWcC7pVq46RzJVRMktu3W2RcbnoidnfBsl1bmDCBwJS/udcIZpKoCrbAYYaCqsz1yZCVIgbIaU3ddQ==} + engines: {node: '>=22.12.0'} + + default-browser-id@5.0.1: + resolution: {integrity: sha512-x1VCxdX4t+8wVfd1so/9w+vQ4vx7lKd2Qp5tDRutErwmR85OgmfX7RlLRMWafRMY7hbEiXIbudNrjOAPa/hL8Q==} + engines: {node: '>=18'} + + default-browser@5.5.1: + resolution: {integrity: sha512-m1pAzaJgZ/gssEqlOhJkPJp8Xly7QyW6xcrkUa2KKcDeDSEMP7X8xipU3snUcfisTQx0w1AGae+9UtJSfVnXGw==} + engines: {node: '>=18'} + + define-lazy-prop@3.0.0: + resolution: {integrity: sha512-N+MeXYoqr3pOgn8xfyRPREN7gHakLYjhsHhWGT3fWAiL4IkAt0iDw14QiiEm2bE30c5XX5q0FtAA3CK5f9/BUg==} + engines: {node: '>=12'} + + defu@6.1.7: + resolution: {integrity: sha512-7z22QmUWiQ/2d0KkdYmANbRUVABpZ9SNYyH5vx6PZ+nE5bcC0l7uFvEfHlyld/HcGBFTL536ClDt3DEcSlEJAQ==} + + destr@2.0.5: + resolution: {integrity: sha512-ugFTXCtDZunbzasqBxrK93Ik/DRYsO6S/fedkWEMKqt04xZ4csmnmwGDBAb07QWNaGMAmnTIemsYZCksjATwsA==} + + dotenv@17.4.2: + resolution: {integrity: sha512-nI4U3TottKAcAD9LLud4Cb7b2QztQMUEfHbvhTH09bqXTxnSie8WnjPALV/WMCrJZ6UV/qHJ6L03OqO3LcdYZw==} + engines: {node: '>=12'} + + dotenv@18.0.10: + resolution: {integrity: sha512-89FAA1xchzK2mxVWdr5F/0rldwiueXs6zJM86rO66EzekR1iBdiXRthyG+m5GvkJaFH3C2LESzamTkgndmLT2A==} + engines: {node: '>=12'} + hasBin: true + + emojilib@2.4.0: + resolution: {integrity: sha512-5U0rVMU5Y2n2+ykNLQqMoqklN9ICBT/KsvC1Gz6vqHbz2AXXGkG+Pm5rMWk/8Vjrr/mY9985Hi8DYzn1F09Nyw==} + + fast-deep-equal@3.1.3: + resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} + + fast-string-truncated-width@3.0.3: + resolution: {integrity: sha512-0jjjIEL6+0jag3l2XWWizO64/aZVtpiGE3t0Zgqxv0DPuxiMjvB3M24fCyhZUO4KomJQPj3LTSUnDP3GpdwC0g==} + + fast-string-width@3.0.2: + resolution: {integrity: sha512-gX8LrtNEI5hq8DVUfRQMbr5lpaS4nMIWV+7XEbXk2b8kiQIizgnlr12B4dA3ZEx3308ze0O4Q1R+cHts8kyUJg==} + + fast-uri@3.1.9: + resolution: {integrity: sha512-hS/0Wt3Ya043oKXs0sIxrMpKQITXhMLIrVAKKXi4gozGC9v7YRWVnXIZzjNPTO02M9BdxLCWqK1yRXgNziVyJQ==} + + fast-wrap-ansi@0.2.2: + resolution: {integrity: sha512-7F2Fl+TjRSenLqlU3UjSH0iyqopqoZIu7eZVpEirP2g1GtWa2G/ecEmBdgz31+Mxr+ELclgg6sokpSFIQiZ02Q==} + + fflate@0.8.3: + resolution: {integrity: sha512-tbZNuJrLwGUp3zshBtdy4W+ORxZuIh8a5ilyIEQDC5rY1f3U20JMry0Ll3WBzU58EZKsEuJFXhb5gwv8CsPvgA==} + + fill-range@7.1.1: + resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} + engines: {node: '>=8'} + + get-east-asian-width@1.7.0: + resolution: {integrity: sha512-XjH1AECxf0giL2V1aU8vKyRR2ppRUb5c0EvT7zuJTokQ74bNo52zOtghqdWIqrhUD79fo3x0WfKZdOqxF6LG1Q==} + engines: {node: '>=18'} + + iconv-lite@0.7.3: + resolution: {integrity: sha512-IKXpvIzjnC9XTAUbVBcMfGS0EPaIXtW6v+zr+RRp+hqULEpo0owZax6wyRwPOJbWbzjYspQwusTsfVr0ifh4uQ==} + engines: {node: '>=0.10.0'} + + is-docker@3.0.0: + resolution: {integrity: sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + hasBin: true + + is-in-ssh@1.0.0: + resolution: {integrity: sha512-jYa6Q9rH90kR1vKB6NM7qqd1mge3Fx4Dhw5TVlK1MUBqhEOuCagrEHMevNuCcbECmXZ0ThXkRm+Ymr51HwEPAw==} + engines: {node: '>=20'} + + is-inside-container@1.0.0: + resolution: {integrity: sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA==} + engines: {node: '>=14.16'} + hasBin: true + + is-interactive@2.0.0: + resolution: {integrity: sha512-qP1vozQRI+BMOPcjFzrjXuQvdak2pHNUMZoeG2eRbiSqyvbEf/wQtEOTOX1guk6E3t36RkaqiSt8A/6YElNxLQ==} + engines: {node: '>=12'} + + is-number@7.0.0: + resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} + engines: {node: '>=0.12.0'} + + is-unicode-supported@2.1.0: + resolution: {integrity: sha512-mE00Gnza5EEB3Ds0HfMyllZzbBrmLOX3vfWoj9A9PEnTfratQ/BcaJOuMhnkhjXvb2+FkY3VuHqtAGpTPmglFQ==} + engines: {node: '>=18'} + + is-wsl@3.1.1: + resolution: {integrity: sha512-e6rvdUCiQCAuumZslxRJWR/Doq4VpPR82kqclvcS0efgt430SlGIk05vdCN58+VrzgtIcfNODjozVielycD4Sw==} + engines: {node: '>=16'} + + json-schema-traverse@1.0.0: + resolution: {integrity: sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==} + + jsonc-parser@3.3.1: + resolution: {integrity: sha512-HUgH65KyejrUFPvHFPbqOY0rsFip3Bo5wb4ngvdi1EpCYWUQDC5V+Y7mZws+DLkr4M//zQJoanu1SP+87Dv1oQ==} + + libphonenumber-js@1.13.16: + resolution: {integrity: sha512-tIOCM9yx2Go6d5/ZANe0K+G4AZek1Ymx81HxQpf19Sri4zMP95eQbKdnUGHAvFQ4nx0PeLhFqvAfisTADXj3tQ==} + + log-symbols@7.0.1: + resolution: {integrity: sha512-ja1E3yCr9i/0hmBVaM0bfwDjnGy8I/s6PP4DFp+yP+a+mrHO4Rm7DtmnqROTUkHIkqffC84YY7AeqX6oFk0WFg==} + engines: {node: '>=18'} + + magic-string@1.4.1: + resolution: {integrity: sha512-8lyCu36ErXR0J9uaGKlKQoiLZKmtI63YGLE8G2o9jyRPdr4X47LusSOwgOJOzcVtp81fTAAjxR7BwKz682Jhow==} + + meshoptimizer@1.1.1: + resolution: {integrity: sha512-oRFNWJRDA/WTrVj7NWvqa5HqE1t9MYDj2VaWirQCzCCrAd2GHrqR/sQezCxiWATPNlKTcRaPRHPJwIRoPBAp5g==} + + micromatch@4.0.8: + resolution: {integrity: sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==} + engines: {node: '>=8.6'} + + mimic-function@5.0.1: + resolution: {integrity: sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==} + engines: {node: '>=18'} + + minipass@7.1.3: + resolution: {integrity: sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A==} + engines: {node: '>=16 || 14 >=14.17'} + + minizlib@3.1.0: + resolution: {integrity: sha512-KZxYo1BUkWD2TVFLr0MQoM8vUUigWD3LlD83a/75BqC+4qE0Hb1Vo5v1FgcfaNXvfXzr+5EhQ6ing/CaBijTlw==} + engines: {node: '>= 18'} + + mute-stream@4.0.0: + resolution: {integrity: sha512-gSrprq0fJ3EiOErzjdIZrjysVVmJ4uu1QWfCDss5LypA5OXvrMje5Ym5z6V6RLyJ2eF87lasX7t6a0AnFvZblg==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + + node-emoji@2.2.0: + resolution: {integrity: sha512-Z3lTE9pLaJF47NyMhd4ww1yFTAP8YhYI8SleJiHzM46Fgpm5cnNzSl9XfzFNqbaz+VlJrIj3fXQ4DeN1Rjm6cw==} + engines: {node: '>=18'} + + onetime@7.0.0: + resolution: {integrity: sha512-VXJjc87FScF88uafS3JllDgvAm+c/Slfz06lorj2uAY34rlUu0Nt+v8wreiImcrgAjjIHp1rXpTDlLOGw29WwQ==} + engines: {node: '>=18'} + + open@11.0.4: + resolution: {integrity: sha512-++Zlftm0kVLPmzC06t6epuWmcRMDbI4z5P3NNX979WA/k23+NtSOynEGzsVfZwguKw2mi5umVgnBlJQMwRz4Pg==} + engines: {node: '>=20'} + + ora@9.4.1: + resolution: {integrity: sha512-6VlU9MLXbjVQD04AZCMX28hVtA5bUoadvUqO76MUCVA0ilwJbMiHsITRPfyVm6p/BC0Av/BXMujx39WCe1LEqw==} + engines: {node: '>=20'} + + picomatch@2.3.2: + resolution: {integrity: sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==} + engines: {node: '>=8.6'} + + picomatch@4.0.7: + resolution: {integrity: sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA==} + engines: {node: '>=12'} + + powershell-utils@0.2.1: + resolution: {integrity: sha512-C+y9x90UElAddDZmV4qOx9W53B61PO7cIqWz2dQsWlwswuq4mr8NEwytdGKboYbQlGZ3awrkTeNvcZiZNHnQ8A==} + engines: {node: '>=20'} + + rc9@3.1.0: + resolution: {integrity: sha512-ufjkNVzbRHKcCOmTahZkmVsyc3W+MSk3jY03m+a7tGHkIsdVMG9l10/3HvFbWkkKzY5VFp3pkRsIo/UYgmFL7Q==} + + readdirp@5.1.1: + resolution: {integrity: sha512-Kko+Y5XQ6fM+Ce3dq3m9YGxnacYZYl9cA1wZjaF3Vbry2L3i1qVg8+CAgNPsXRArPMUMCaOR7oa9Nqntc43JKA==} + engines: {node: '>= 20.19.0'} + + require-from-string@2.0.2: + resolution: {integrity: sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==} + engines: {node: '>=0.10.0'} + + restore-cursor@5.1.0: + resolution: {integrity: sha512-oMA2dcrw6u0YfxJQXm342bFKX/E4sG9rbTzO9ptUcR/e8A33cHuvStiYOwH7fszkZlZ1z/ta9AAoPk2F4qIOHA==} + engines: {node: '>=18'} + + rolldown@1.3.2: + resolution: {integrity: sha512-EFHqbVkXiYZA6akmYm2bvJhNbEGdUwAResRhYwl/BO8QhB5KxsG+t3RVHJSIOy5jBEb0XCACvrIGnnl6Z8sMGA==} + engines: {node: ^20.19.0 || >=22.12.0} + hasBin: true + + run-applescript@7.1.0: + resolution: {integrity: sha512-DPe5pVFaAsinSaV6QjQ6gdiedWDcRCbUuiQfQa2wmWV7+xC9bGulGI8+TdRmoFkAPaBXk8CrAbnlY2ISniJ47Q==} + engines: {node: '>=18'} + + rxjs@7.8.2: + resolution: {integrity: sha512-dhKf903U/PQZY6boNNtAGdWbG85WAbjT/1xYoZIC7FAY0yWapOBQVsVrDl58W86//e1VpMNBtRV4MaXfdMySFA==} + + safer-buffer@2.1.2: + resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} + + semver@7.8.6: + resolution: {integrity: sha512-9lpSSU4Mly3mrtruwLs1eLK6+gzbzqeBFwRNjIjE+9LuDpWdYctrQlQ3ej1Ilgi7gknpsTRnPoLP8DpCHqHIJw==} + engines: {node: '>=10'} + hasBin: true + + signal-exit@4.1.0: + resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} + engines: {node: '>=14'} + + skin-tone@2.0.0: + resolution: {integrity: sha512-kUMbT1oBJCpgrnKoSr0o6wPtvRWT9W9UKvGLwfJYO2WuahZRHOpEyL1ckyMGgMWh0UdpmaoFqKKD29WTomNEGA==} + engines: {node: '>=8'} + + source-map@0.8.0: + resolution: {integrity: sha512-d8EqvL+k/SOXCreS/SUzg2ciyHqBBLcN/yuRjFsbvVhHTE2pgei7oAhmPM7kWFbkX6OSMQfUq4KbkF3au9lhYQ==} + engines: {node: '>= 12'} + + stdin-discarder@0.3.2: + resolution: {integrity: sha512-eCPu1qRxPVkl5605OTWF8Wz40b4Mf45NY5LQmVPQ599knfs5QhASUm9GbJ5BDMDOXgrnh0wyEdvzmL//YMlw0A==} + engines: {node: '>=18'} + + string-width@8.3.0: + resolution: {integrity: sha512-ZbmZM0JCihQN91dWnxoipT2KOEyHqEyfRXUyjuRhW8b/xnqPDoq4gWEVApTVa9db2wN8mmoikgFBbjh71+cGeQ==} + engines: {node: '>=20'} + + strip-ansi@7.2.0: + resolution: {integrity: sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==} + engines: {node: '>=12'} + + tar@7.5.23: + resolution: {integrity: sha512-lkukzdoGngZHJZXxW4S/E4Fp9ghTDlyZXrQGRNoJ/LXvDKcXUTq2sg5yQe74po7Voea6n/IN09+wE/QvJMiifA==} + engines: {node: '>=18'} + + three@0.187.0: + resolution: {integrity: sha512-Qiu7R+Cmh8CstZsY1uJOSWnVlfo7ZtNLV7mF8Jltk3LB3AtDu9cRZlcnRKkAk8Y4z6KKw35z7Y7Urd7jWY8etA==} + + to-regex-range@5.0.1: + resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} + engines: {node: '>=8.0'} + + tslib@2.9.1: + resolution: {integrity: sha512-a4Ux9VKuIMHsOS7ENbEq6hK2ZGYIT27Rtl0E4eD9KqwxhKiQeMZE/9xb3IdYwWaSOyIBQLExhQgXDTYoiCxnWA==} + + typescript@6.0.3: + resolution: {integrity: sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw==} + engines: {node: '>=14.17'} + hasBin: true + + unicode-emoji-modifier-base@1.0.0: + resolution: {integrity: sha512-yLSH4py7oFH3oG/9K+XWrz1pSi3dfUrWEnInbxMfArOfc1+33BlGPQtLsOYwvdMy11AwUBetYuaRxSPqgkq+8g==} + engines: {node: '>=4'} + + unrun@0.3.1: + resolution: {integrity: sha512-onIck/oNnCaytwths1ZVp1LK2Gq2hPoyFhiHebObuUXqR3S0uHuLLaBK8K6mRRgV7Ptip8AnNvaUsgzwWwBZuA==} + engines: {node: ^22.13.0 || >=24.0.0} + hasBin: true + peerDependencies: + synckit: ^0.11.11 + peerDependenciesMeta: + synckit: + optional: true + + validator@13.15.35: + resolution: {integrity: sha512-TQ5pAGhd5whStmqWvYF4OjQROlmv9SMFVt37qoCBdqRffuuklWYQlCNnEs2ZaIBD1kZRNnikiZOS1eqgkar0iw==} + engines: {node: '>= 0.10'} + + wsl-utils@1.0.1: + resolution: {integrity: sha512-c16PKLIRxBYpR3jSWsdS7SFp0COm5SOQdiFjY818dYFHJbMGuLBszpF07LBWmOS1uzrHa9VGdynsEgoeKy0oOQ==} + engines: {node: '>=20'} + + yallist@5.0.0: + resolution: {integrity: sha512-YgvUTfwqyc7UXVMrB+SImsVYSmTS8X/tSrtdNZMImM+n7+QTriRXyXim0mBrTXNeqzVF0KWGgHPeiyViFFrNDw==} + engines: {node: '>=18'} + + yoctocolors@2.2.0: + resolution: {integrity: sha512-xYqdZFUK/VYazNl/oCDYN+3WloWQwMfZxBoiNt6qNyk+xfOdi598muWE42rNZFp1kNOiqW936q5RhUdnpqElSg==} + engines: {node: '>=18'} + + zod@4.6.7: + resolution: {integrity: sha512-g8W2D2kU6a8untc053fX1uVBKzM7yqAxW/3zwk83+6RyF2+SKOuV+c0wBDhUwzV1PaGapmZH+rmcUzPf+3CGwg==} + +snapshots: + + '@angular-devkit/core@22.2.7(chokidar@5.0.0)': + dependencies: + ajv: 8.20.0 + ajv-formats: 3.0.1(ajv@8.20.0) + jsonc-parser: 3.3.1 + picomatch: 4.0.7 + rxjs: 7.8.2 + source-map: 0.8.0 + optionalDependencies: + chokidar: 5.0.0 + + '@angular-devkit/schematics-cli@22.2.7(chokidar@5.0.0)': + dependencies: + '@angular-devkit/core': 22.2.7(chokidar@5.0.0) + '@angular-devkit/schematics': 22.2.7(chokidar@5.0.0) + '@inquirer/prompts': 8.7.2 + transitivePeerDependencies: + - '@types/node' + - chokidar + + '@angular-devkit/schematics@22.2.7(chokidar@5.0.0)': + dependencies: + '@angular-devkit/core': 22.2.7(chokidar@5.0.0) + jsonc-parser: 3.3.1 + magic-string: 1.4.1 + ora: 9.4.1 + rxjs: 7.8.2 + transitivePeerDependencies: + - chokidar + + '@dimforge/rapier3d-compat@0.12.0': {} + + '@emnapi/core@2.0.0-beta.2': + dependencies: + '@emnapi/wasi-threads': 2.2.0 + tslib: 2.9.1 + optional: true + + '@emnapi/runtime@2.0.0-beta.2': + dependencies: + tslib: 2.9.1 + optional: true + + '@emnapi/wasi-threads@2.2.0': + dependencies: + tslib: 2.9.1 + optional: true + + '@inquirer/ansi@2.1.0': {} + + '@inquirer/checkbox@5.3.0': + dependencies: + '@inquirer/ansi': 2.1.0 + '@inquirer/core': 12.1.0 + '@inquirer/figures': 2.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/confirm@6.4.0': + dependencies: + '@inquirer/core': 12.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/core@12.1.0': + dependencies: + '@inquirer/ansi': 2.1.0 + '@inquirer/figures': 2.1.0 + '@inquirer/type': 4.3.0 + cli-width: 4.1.0 + fast-wrap-ansi: 0.2.2 + mute-stream: 4.0.0 + signal-exit: 4.1.0 + + '@inquirer/editor@5.4.0': + dependencies: + '@inquirer/core': 12.1.0 + '@inquirer/external-editor': 3.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/expand@5.2.0': + dependencies: + '@inquirer/core': 12.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/external-editor@3.1.0': + dependencies: + chardet: 2.2.0 + iconv-lite: 0.7.3 + + '@inquirer/figures@2.1.0': {} + + '@inquirer/input@5.2.0': + dependencies: + '@inquirer/core': 12.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/number@4.3.0': + dependencies: + '@inquirer/core': 12.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/password@5.3.0': + dependencies: + '@inquirer/ansi': 2.1.0 + '@inquirer/core': 12.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/prompts@8.7.2': + dependencies: + '@inquirer/checkbox': 5.3.0 + '@inquirer/confirm': 6.4.0 + '@inquirer/editor': 5.4.0 + '@inquirer/expand': 5.2.0 + '@inquirer/input': 5.2.0 + '@inquirer/number': 4.3.0 + '@inquirer/password': 5.3.0 + '@inquirer/rawlist': 5.4.0 + '@inquirer/search': 4.4.0 + '@inquirer/select': 5.3.0 + + '@inquirer/prompts@8.8.0': + dependencies: + '@inquirer/checkbox': 5.3.0 + '@inquirer/confirm': 6.4.0 + '@inquirer/editor': 5.4.0 + '@inquirer/expand': 5.2.0 + '@inquirer/input': 5.2.0 + '@inquirer/number': 4.3.0 + '@inquirer/password': 5.3.0 + '@inquirer/rawlist': 5.4.0 + '@inquirer/search': 4.4.0 + '@inquirer/select': 5.3.0 + + '@inquirer/rawlist@5.4.0': + dependencies: + '@inquirer/core': 12.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/search@4.4.0': + dependencies: + '@inquirer/core': 12.1.0 + '@inquirer/figures': 2.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/select@5.3.0': + dependencies: + '@inquirer/ansi': 2.1.0 + '@inquirer/core': 12.1.0 + '@inquirer/figures': 2.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/type@4.3.0': {} + + '@isaacs/fs-minipass@4.0.1': + dependencies: + minipass: 7.1.3 + + '@jridgewell/sourcemap-codec@1.6.0': {} + + '@nanoforge-dev/asset@3.0.0': + dependencies: + '@nanoforge-dev/common': 3.0.0 + + '@nanoforge-dev/cli@3.0.1': + dependencies: + '@angular-devkit/schematics': 22.2.7(chokidar@5.0.0) + '@angular-devkit/schematics-cli': 22.2.7(chokidar@5.0.0) + '@inquirer/prompts': 8.8.0 + '@nanoforge-dev/config': 3.0.1 + '@nanoforge-dev/editor': 0.1.4 + '@nanoforge-dev/loader-client': 1.7.0 + '@nanoforge-dev/loader-server': 1.7.0 + '@nanoforge-dev/registry': 3.0.1 + '@nanoforge-dev/schematics': 3.0.1(chokidar@5.0.0) + ansis: 4.5.0 + bun: 1.4.4 + chokidar: 5.0.0 + commander: 15.1.0 + dotenv: 18.0.10 + node-emoji: 2.2.0 + open: 11.0.4 + ora: 9.4.1 + rc9: 3.1.0 + transitivePeerDependencies: + - '@types/node' + - synckit + + '@nanoforge-dev/common@3.0.0': {} + + '@nanoforge-dev/config@3.0.1': + dependencies: + unrun: 0.3.1 + zod: 4.6.7 + transitivePeerDependencies: + - synckit + + '@nanoforge-dev/core@3.0.0': + dependencies: + '@nanoforge-dev/asset': 3.0.0 + '@nanoforge-dev/common': 3.0.0 + + '@nanoforge-dev/ecs@3.0.0(@nanoforge-dev/editor-lib@3.0.0)': + dependencies: + '@nanoforge-dev/common': 3.0.0 + optionalDependencies: + '@nanoforge-dev/editor-lib': 3.0.0 + + '@nanoforge-dev/editor-lib@3.0.0': + dependencies: + '@nanoforge-dev/common': 3.0.0 + + '@nanoforge-dev/editor@0.1.4': + dependencies: + bun: 1.4.4 + class-transformer: 0.5.1 + class-validator: 0.15.1 + dotenv: 17.4.2 + micromatch: 4.0.8 + tar: 7.5.23 + typescript: 6.0.3 + + '@nanoforge-dev/env@3.0.0': + dependencies: + '@nanoforge-dev/common': 3.0.0 + class-transformer: 0.5.1 + class-validator: 0.14.4 + + '@nanoforge-dev/graphics-3d@3.0.0(@nanoforge-dev/editor-lib@3.0.0)(three@0.187.0)': + dependencies: + '@nanoforge-dev/common': 3.0.0 + '@types/three': 0.187.0 + three: 0.187.0 + optionalDependencies: + '@nanoforge-dev/editor-lib': 3.0.0 + + '@nanoforge-dev/loader-client@1.7.0': + dependencies: + '@nanoforge-dev/loader-website': 1.7.0 + bun: 1.4.4 + commander: 15.1.0 + + '@nanoforge-dev/loader-server@1.7.0': + dependencies: + bun: 1.4.4 + commander: 15.1.0 + + '@nanoforge-dev/loader-website@1.7.0': {} + + '@nanoforge-dev/registry@3.0.1': + dependencies: + fflate: 0.8.3 + semver: 7.8.6 + zod: 4.6.7 + + '@nanoforge-dev/schematics@3.0.1(chokidar@5.0.0)': + dependencies: + '@angular-devkit/core': 22.2.7(chokidar@5.0.0) + '@angular-devkit/schematics': 22.2.7(chokidar@5.0.0) + rxjs: 7.8.2 + transitivePeerDependencies: + - chokidar + + '@napi-rs/wasm-runtime@1.2.6(@emnapi/core@2.0.0-beta.2)(@emnapi/runtime@2.0.0-beta.2)': + dependencies: + '@emnapi/core': 2.0.0-beta.2 + '@emnapi/runtime': 2.0.0-beta.2 + '@tybys/wasm-util': 0.10.4 + optional: true + + '@oven/bun-darwin-aarch64@1.4.4': + optional: true + + '@oven/bun-darwin-x64@1.4.4': + optional: true + + '@oven/bun-freebsd-aarch64@1.4.4': + optional: true + + '@oven/bun-freebsd-x64@1.4.4': + optional: true + + '@oven/bun-linux-aarch64-android@1.4.4': + optional: true + + '@oven/bun-linux-aarch64-musl@1.4.4': + optional: true + + '@oven/bun-linux-aarch64@1.4.4': + optional: true + + '@oven/bun-linux-x64-android@1.4.4': + optional: true + + '@oven/bun-linux-x64-musl@1.4.4': + optional: true + + '@oven/bun-linux-x64@1.4.4': + optional: true + + '@oven/bun-windows-aarch64@1.4.4': + optional: true + + '@oven/bun-windows-x64@1.4.4': + optional: true + + '@oxc-project/types@0.158.0': {} + + '@rolldown/binding-android-arm-eabi@1.3.2': + optional: true + + '@rolldown/binding-android-arm64@1.3.2': + optional: true + + '@rolldown/binding-darwin-arm64@1.3.2': + optional: true + + '@rolldown/binding-darwin-x64@1.3.2': + optional: true + + '@rolldown/binding-freebsd-x64@1.3.2': + optional: true + + '@rolldown/binding-linux-arm-gnueabihf@1.3.2': + optional: true + + '@rolldown/binding-linux-arm64-gnu@1.3.2': + optional: true + + '@rolldown/binding-linux-arm64-musl@1.3.2': + optional: true + + '@rolldown/binding-linux-ppc64-gnu@1.3.2': + optional: true + + '@rolldown/binding-linux-s390x-gnu@1.3.2': + optional: true + + '@rolldown/binding-linux-x64-gnu@1.3.2': + optional: true + + '@rolldown/binding-linux-x64-musl@1.3.2': + optional: true + + '@rolldown/binding-openharmony-arm64@1.3.2': + optional: true + + '@rolldown/binding-wasm32-wasi@1.3.2': + dependencies: + '@emnapi/core': 2.0.0-beta.2 + '@emnapi/runtime': 2.0.0-beta.2 + '@napi-rs/wasm-runtime': 1.2.6(@emnapi/core@2.0.0-beta.2)(@emnapi/runtime@2.0.0-beta.2) + optional: true + + '@rolldown/binding-win32-arm64-msvc@1.3.2': + optional: true + + '@rolldown/binding-win32-x64-msvc@1.3.2': + optional: true + + '@rolldown/pluginutils@1.1.0': {} + + '@sindresorhus/is@4.6.0': {} + + '@tweenjs/tween.js@23.1.3': {} + + '@tybys/wasm-util@0.10.4': + dependencies: + tslib: 2.9.1 + optional: true + + '@types/stats.js@0.17.4': {} + + '@types/three@0.187.0': + dependencies: + '@dimforge/rapier3d-compat': 0.12.0 + '@tweenjs/tween.js': 23.1.3 + '@types/stats.js': 0.17.4 + '@types/webxr': 0.5.24 + fflate: 0.8.3 + meshoptimizer: 1.1.1 + + '@types/validator@13.15.10': {} + + '@types/webxr@0.5.24': {} + + ajv-formats@3.0.1(ajv@8.20.0): + optionalDependencies: + ajv: 8.20.0 + + ajv@8.20.0: + dependencies: + fast-deep-equal: 3.1.3 + fast-uri: 3.1.9 + json-schema-traverse: 1.0.0 + require-from-string: 2.0.2 + + ansi-regex@6.6.0: {} + + ansis@4.5.0: {} + + braces@3.0.3: + dependencies: + fill-range: 7.1.1 + + bun@1.4.4: + optionalDependencies: + '@oven/bun-darwin-aarch64': 1.4.4 + '@oven/bun-darwin-x64': 1.4.4 + '@oven/bun-freebsd-aarch64': 1.4.4 + '@oven/bun-freebsd-x64': 1.4.4 + '@oven/bun-linux-aarch64': 1.4.4 + '@oven/bun-linux-aarch64-android': 1.4.4 + '@oven/bun-linux-aarch64-musl': 1.4.4 + '@oven/bun-linux-x64': 1.4.4 + '@oven/bun-linux-x64-android': 1.4.4 + '@oven/bun-linux-x64-musl': 1.4.4 + '@oven/bun-windows-aarch64': 1.4.4 + '@oven/bun-windows-x64': 1.4.4 + + bundle-name@4.1.1: + dependencies: + run-applescript: 7.1.0 + + chalk@5.6.2: {} + + char-regex@1.0.2: {} + + chardet@2.2.0: {} + + chokidar@5.0.0: + dependencies: + readdirp: 5.1.1 + + chownr@3.0.0: {} + + class-transformer@0.5.1: {} + + class-validator@0.14.4: + dependencies: + '@types/validator': 13.15.10 + libphonenumber-js: 1.13.16 + validator: 13.15.35 + + class-validator@0.15.1: + dependencies: + '@types/validator': 13.15.10 + libphonenumber-js: 1.13.16 + validator: 13.15.35 + + cli-cursor@5.0.0: + dependencies: + restore-cursor: 5.1.0 + + cli-spinners@3.4.0: {} + + cli-width@4.1.0: {} + + commander@15.1.0: {} + + default-browser-id@5.0.1: {} + + default-browser@5.5.1: + dependencies: + bundle-name: 4.1.1 + default-browser-id: 5.0.1 + + define-lazy-prop@3.0.0: {} + + defu@6.1.7: {} + + destr@2.0.5: {} + + dotenv@17.4.2: {} + + dotenv@18.0.10: {} + + emojilib@2.4.0: {} + + fast-deep-equal@3.1.3: {} + + fast-string-truncated-width@3.0.3: {} + + fast-string-width@3.0.2: + dependencies: + fast-string-truncated-width: 3.0.3 + + fast-uri@3.1.9: {} + + fast-wrap-ansi@0.2.2: + dependencies: + fast-string-width: 3.0.2 + + fflate@0.8.3: {} + + fill-range@7.1.1: + dependencies: + to-regex-range: 5.0.1 + + get-east-asian-width@1.7.0: {} + + iconv-lite@0.7.3: + dependencies: + safer-buffer: 2.1.2 + + is-docker@3.0.0: {} + + is-in-ssh@1.0.0: {} + + is-inside-container@1.0.0: + dependencies: + is-docker: 3.0.0 + + is-interactive@2.0.0: {} + + is-number@7.0.0: {} + + is-unicode-supported@2.1.0: {} + + is-wsl@3.1.1: + dependencies: + is-inside-container: 1.0.0 + + json-schema-traverse@1.0.0: {} + + jsonc-parser@3.3.1: {} + + libphonenumber-js@1.13.16: {} + + log-symbols@7.0.1: + dependencies: + is-unicode-supported: 2.1.0 + yoctocolors: 2.2.0 + + magic-string@1.4.1: + dependencies: + '@jridgewell/sourcemap-codec': 1.6.0 + + meshoptimizer@1.1.1: {} + + micromatch@4.0.8: + dependencies: + braces: 3.0.3 + picomatch: 2.3.2 + + mimic-function@5.0.1: {} + + minipass@7.1.3: {} + + minizlib@3.1.0: + dependencies: + minipass: 7.1.3 + + mute-stream@4.0.0: {} + + node-emoji@2.2.0: + dependencies: + '@sindresorhus/is': 4.6.0 + char-regex: 1.0.2 + emojilib: 2.4.0 + skin-tone: 2.0.0 + + onetime@7.0.0: + dependencies: + mimic-function: 5.0.1 + + open@11.0.4: + dependencies: + default-browser: 5.5.1 + define-lazy-prop: 3.0.0 + is-in-ssh: 1.0.0 + is-inside-container: 1.0.0 + powershell-utils: 0.2.1 + wsl-utils: 1.0.1 + + ora@9.4.1: + dependencies: + chalk: 5.6.2 + cli-cursor: 5.0.0 + cli-spinners: 3.4.0 + is-interactive: 2.0.0 + is-unicode-supported: 2.1.0 + log-symbols: 7.0.1 + stdin-discarder: 0.3.2 + string-width: 8.3.0 + + picomatch@2.3.2: {} + + picomatch@4.0.7: {} + + powershell-utils@0.2.1: {} + + rc9@3.1.0: + dependencies: + defu: 6.1.7 + destr: 2.0.5 + + readdirp@5.1.1: {} + + require-from-string@2.0.2: {} + + restore-cursor@5.1.0: + dependencies: + onetime: 7.0.0 + signal-exit: 4.1.0 + + rolldown@1.3.2: + dependencies: + '@oxc-project/types': 0.158.0 + '@rolldown/pluginutils': 1.1.0 + optionalDependencies: + '@rolldown/binding-android-arm-eabi': 1.3.2 + '@rolldown/binding-android-arm64': 1.3.2 + '@rolldown/binding-darwin-arm64': 1.3.2 + '@rolldown/binding-darwin-x64': 1.3.2 + '@rolldown/binding-freebsd-x64': 1.3.2 + '@rolldown/binding-linux-arm-gnueabihf': 1.3.2 + '@rolldown/binding-linux-arm64-gnu': 1.3.2 + '@rolldown/binding-linux-arm64-musl': 1.3.2 + '@rolldown/binding-linux-ppc64-gnu': 1.3.2 + '@rolldown/binding-linux-s390x-gnu': 1.3.2 + '@rolldown/binding-linux-x64-gnu': 1.3.2 + '@rolldown/binding-linux-x64-musl': 1.3.2 + '@rolldown/binding-openharmony-arm64': 1.3.2 + '@rolldown/binding-wasm32-wasi': 1.3.2 + '@rolldown/binding-win32-arm64-msvc': 1.3.2 + '@rolldown/binding-win32-x64-msvc': 1.3.2 + + run-applescript@7.1.0: {} + + rxjs@7.8.2: + dependencies: + tslib: 2.9.1 + + safer-buffer@2.1.2: {} + + semver@7.8.6: {} + + signal-exit@4.1.0: {} + + skin-tone@2.0.0: + dependencies: + unicode-emoji-modifier-base: 1.0.0 + + source-map@0.8.0: {} + + stdin-discarder@0.3.2: {} + + string-width@8.3.0: + dependencies: + get-east-asian-width: 1.7.0 + strip-ansi: 7.2.0 + + strip-ansi@7.2.0: + dependencies: + ansi-regex: 6.6.0 + + tar@7.5.23: + dependencies: + '@isaacs/fs-minipass': 4.0.1 + chownr: 3.0.0 + minipass: 7.1.3 + minizlib: 3.1.0 + yallist: 5.0.0 + + three@0.187.0: {} + + to-regex-range@5.0.1: + dependencies: + is-number: 7.0.0 + + tslib@2.9.1: {} + + typescript@6.0.3: {} + + unicode-emoji-modifier-base@1.0.0: {} + + unrun@0.3.1: + dependencies: + rolldown: 1.3.2 + + validator@13.15.35: {} + + wsl-utils@1.0.1: + dependencies: + is-wsl: 3.1.1 + powershell-utils: 0.2.1 + + yallist@5.0.0: {} + + yoctocolors@2.2.0: {} + + zod@4.6.7: {} diff --git a/basics/graphics-3d/pnpm-workspace.yaml b/basics/graphics-3d/pnpm-workspace.yaml new file mode 100644 index 0000000..96ca535 --- /dev/null +++ b/basics/graphics-3d/pnpm-workspace.yaml @@ -0,0 +1,5 @@ +allowBuilds: + bun: true +# NanoForge packages are ours: take a release as soon as it is out. +minimumReleaseAgeExclude: + - "@nanoforge-dev/*" diff --git a/basics/graphics-3d/src/components/drawable-box-3d.component.ts b/basics/graphics-3d/src/components/drawable-box-3d.component.ts new file mode 100644 index 0000000..638eb08 --- /dev/null +++ b/basics/graphics-3d/src/components/drawable-box-3d.component.ts @@ -0,0 +1,71 @@ +import { + BoxGeometry, + MathUtils, + Mesh, + MeshStandardMaterial, + type Scene, +} from "@nanoforge-dev/graphics-3d/three"; + +import type { Transform3D } from "./transform-3d.component"; + +/** + * Draws a box at the entity's `Transform3D` (its center), turned like it. Needs the `draw3D` + * system. + * + * @remarks + * `mesh` is the Three.js `Mesh` in the scene: change it from code for anything the parameters + * don't offer. It casts and receives shadows when the renderer's shadow map is on. + * + * @component + * @side client + * @group Shape color=#e86fb0 - Size of the box, in world units. + * @group Look color=#b18cff - What the box looks like. + */ +export class DrawableBox3D { + name = "DrawableBox3D"; + + /** The box in the scene, made by `draw3D` the first time it draws it. */ + mesh?: Mesh; + + constructor( + /** Along x. @group Shape @preset size.width */ + public width = 1, + /** Along y, up. @group Shape @preset size.height */ + public height = 1, + /** Along z. @group Shape */ + public depth = 1, + /** A CSS color: `red`, `#ff0000`... @group Look @preset color */ + public color = "#44aa88", + /** From 0 (a mirror) to 1 (matte). @group Look */ + public roughness = 1, + /** Whether it is drawn. @group Look */ + public visible = true, + ) {} + + /** Puts the box in `scene` at `transform`, up to date with the parameters. */ + draw(scene: Scene, transform: Transform3D): void { + if (!this.mesh) { + this.mesh = new Mesh(new BoxGeometry(), new MeshStandardMaterial()); + this.mesh.castShadow = this.mesh.receiveShadow = true; + } + if (this.mesh.parent !== scene) scene.add(this.mesh); + this.mesh.scale.set(this.width, this.height, this.depth); + this.mesh.material.color.set(this.color); + this.mesh.material.roughness = this.roughness; + this.mesh.visible = this.visible; + this.mesh.position.set(transform.x, transform.y, transform.z); + this.mesh.rotation.set( + MathUtils.degToRad(transform.rotationX), + MathUtils.degToRad(transform.rotationY), + MathUtils.degToRad(transform.rotationZ), + ); + } + + /** Removes the box from the scene and frees its GPU memory. */ + destroy(): void { + this.mesh?.removeFromParent(); + this.mesh?.geometry.dispose(); + this.mesh?.material.dispose(); + this.mesh = undefined; + } +} diff --git a/basics/graphics-3d/src/components/drawable-sphere-3d.component.ts b/basics/graphics-3d/src/components/drawable-sphere-3d.component.ts new file mode 100644 index 0000000..bdc9c91 --- /dev/null +++ b/basics/graphics-3d/src/components/drawable-sphere-3d.component.ts @@ -0,0 +1,66 @@ +import { + MathUtils, + Mesh, + MeshStandardMaterial, + type Scene, + SphereGeometry, +} from "@nanoforge-dev/graphics-3d/three"; + +import type { Transform3D } from "./transform-3d.component"; + +/** + * Draws a ball at the entity's `Transform3D` (its center). Needs the `draw3D` system. + * + * @remarks + * `mesh` is the Three.js `Mesh` in the scene: change it from code for anything the parameters + * don't offer. It casts shadows when the renderer's shadow map is on. + * + * @component + * @side client + * @group Shape color=#e86fb0 - Size of the ball, in world units. + * @group Look color=#b18cff - What the ball looks like. + */ +export class DrawableSphere3D { + name = "DrawableSphere3D"; + + /** The ball in the scene, made by `draw3D` the first time it draws it. */ + mesh?: Mesh; + + constructor( + /** @group Shape */ + public radius = 0.5, + /** A CSS color: `red`, `#ff0000`... @group Look @preset color */ + public color = "#ff4d3d", + /** From 0 (a mirror) to 1 (matte). @group Look */ + public roughness = 1, + /** Whether it is drawn. @group Look */ + public visible = true, + ) {} + + /** Puts the ball in `scene` at `transform`, up to date with the parameters. */ + draw(scene: Scene, transform: Transform3D): void { + if (!this.mesh) { + this.mesh = new Mesh(new SphereGeometry(1, 32, 16), new MeshStandardMaterial()); + this.mesh.castShadow = true; + } + if (this.mesh.parent !== scene) scene.add(this.mesh); + this.mesh.scale.setScalar(this.radius); + this.mesh.material.color.set(this.color); + this.mesh.material.roughness = this.roughness; + this.mesh.visible = this.visible; + this.mesh.position.set(transform.x, transform.y, transform.z); + this.mesh.rotation.set( + MathUtils.degToRad(transform.rotationX), + MathUtils.degToRad(transform.rotationY), + MathUtils.degToRad(transform.rotationZ), + ); + } + + /** Removes the ball from the scene and frees its GPU memory. */ + destroy(): void { + this.mesh?.removeFromParent(); + this.mesh?.geometry.dispose(); + this.mesh?.material.dispose(); + this.mesh = undefined; + } +} diff --git a/basics/graphics-3d/src/components/spin-3d.component.ts b/basics/graphics-3d/src/components/spin-3d.component.ts new file mode 100644 index 0000000..5405478 --- /dev/null +++ b/basics/graphics-3d/src/components/spin-3d.component.ts @@ -0,0 +1,19 @@ +/** + * Turns an entity's `Transform3D` on its own. Needs the `spin3D` system. + * + * @component + * @side shared + * @group Speed color=#f0a33a - Degrees per second around each axis. + */ +export class Spin3D { + name = "Spin3D"; + + constructor( + /** @group Speed */ + public x = 0, + /** @group Speed */ + public y = 0, + /** @group Speed */ + public z = 0, + ) {} +} diff --git a/basics/graphics-3d/src/components/transform-3d.component.ts b/basics/graphics-3d/src/components/transform-3d.component.ts new file mode 100644 index 0000000..1d2f8d0 --- /dev/null +++ b/basics/graphics-3d/src/components/transform-3d.component.ts @@ -0,0 +1,26 @@ +/** + * Where an entity is in the 3D world, and how it is turned. + * + * @component + * @side shared + * @group Position color=#4aa3ff - World units from the origin. + * @group Rotation color=#36c5a0 - Degrees around each axis. + */ +export class Transform3D { + name = "Transform3D"; + + constructor( + /** @group Position @preset vector.x */ + public x = 0, + /** @group Position @preset vector.y */ + public y = 0, + /** @group Position */ + public z = 0, + /** @group Rotation */ + public rotationX = 0, + /** @group Rotation */ + public rotationY = 0, + /** @group Rotation */ + public rotationZ = 0, + ) {} +} diff --git a/basics/graphics-3d/src/main.ts b/basics/graphics-3d/src/main.ts new file mode 100644 index 0000000..a4eb6e4 --- /dev/null +++ b/basics/graphics-3d/src/main.ts @@ -0,0 +1,48 @@ +import type { ClientRunOptions } from "@nanoforge-dev/common"; +import { NanoforgeFactory } from "@nanoforge-dev/core"; +import { EcsLibrary } from "@nanoforge-dev/ecs/client"; +import { EditorLibrary } from "@nanoforge-dev/editor-lib"; +import { Graphics3DLibrary } from "@nanoforge-dev/graphics-3d"; +import { Color, DirectionalLight, HemisphereLight } from "@nanoforge-dev/graphics-3d/three"; + +import { DrawableBox3D } from "./components/drawable-box-3d.component"; +import { Spin3D } from "./components/spin-3d.component"; +import { Transform3D } from "./components/transform-3d.component"; +import { draw3D } from "./systems/draw-3d.system"; +import { spin3D } from "./systems/spin-3d.system"; + +export const main = async (options: ClientRunOptions): Promise => { + const app = NanoforgeFactory.createClient({ + tickRate: 60, + viewport: { width: 1280, height: 720, fit: "contain" }, + }); + const graphics = new Graphics3DLibrary(); + const ecs = new EcsLibrary(); + + app.use(graphics); + app.use(ecs); + app.use(new EditorLibrary()); + + await app.init(options); + + // The world around the entities: a background, a camera looking at the origin, and lights. + const { scene, camera } = graphics; + scene.background = new Color("#20232a"); + camera.position.set(0, 1.5, 4); + camera.lookAt(0, 0, 0); + const sun = new DirectionalLight("white", 3); + sun.position.set(3, 5, 4); + scene.add(new HemisphereLight("white", "#445566", 1), sun); + + const registry = ecs.registry; + + const cube = registry.spawnEntity(); + registry.addComponent(cube, new Transform3D(0, 0, 0)); + registry.addComponent(cube, new DrawableBox3D(1, 1, 1, "#44aa88")); + registry.addComponent(cube, new Spin3D(20, 90, 0)); + + registry.addSystem(spin3D); + registry.addSystem(draw3D); + + await app.run(); +}; diff --git a/basics/graphics-3d/src/systems/draw-3d.system.ts b/basics/graphics-3d/src/systems/draw-3d.system.ts new file mode 100644 index 0000000..d9e3948 --- /dev/null +++ b/basics/graphics-3d/src/systems/draw-3d.system.ts @@ -0,0 +1,43 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; +import "@nanoforge-dev/graphics-3d"; + +import { DrawableBox3D } from "../components/drawable-box-3d.component"; +import { DrawableSphere3D } from "../components/drawable-sphere-3d.component"; +import { Transform3D } from "../components/transform-3d.component"; + +type Drawable = DrawableBox3D | DrawableSphere3D; + +/** The drawables shown by the last frame. */ +let shown = new Set(); + +/** + * Puts every entity that has a `Transform3D` and a `DrawableBox3D` or `DrawableSphere3D` in the + * 3D scene, where it is. Add it after the systems that move entities: graphics-3d renders the + * scene after the systems. + * + * @remarks + * The mesh of a killed entity, or of a removed drawable, is removed from the scene. + * + * @system + * @side client + */ +export const draw3D = (registry: Registry, ctx: Context) => { + const scene = ctx.graphics.scene; + const drawn = new Set(); + + registry.getZipper([DrawableBox3D, Transform3D]).forEach(({ DrawableBox3D, Transform3D }) => { + DrawableBox3D.draw(scene, Transform3D); + drawn.add(DrawableBox3D); + }); + registry + .getZipper([DrawableSphere3D, Transform3D]) + .forEach(({ DrawableSphere3D, Transform3D }) => { + DrawableSphere3D.draw(scene, Transform3D); + drawn.add(DrawableSphere3D); + }); + + // `killEntity` doesn't call `destroy()`: a drawable no longer in the world loses its mesh here. + for (const drawable of shown) if (!drawn.has(drawable)) drawable.destroy(); + shown = drawn; +}; diff --git a/basics/graphics-3d/src/systems/spin-3d.system.ts b/basics/graphics-3d/src/systems/spin-3d.system.ts new file mode 100644 index 0000000..81d6b8d --- /dev/null +++ b/basics/graphics-3d/src/systems/spin-3d.system.ts @@ -0,0 +1,21 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; + +import { Spin3D } from "../components/spin-3d.component"; +import { Transform3D } from "../components/transform-3d.component"; + +/** + * Turns every `Spin3D` entity by its speed, for the time elapsed since the last frame. + * + * @system + * @side shared + */ +export const spin3D = (registry: Registry, ctx: Context) => { + const seconds = ctx.app.delta / 1000; + + registry.getZipper([Spin3D, Transform3D]).forEach(({ Spin3D, Transform3D }) => { + Transform3D.rotationX = (Transform3D.rotationX + Spin3D.x * seconds) % 360; + Transform3D.rotationY = (Transform3D.rotationY + Spin3D.y * seconds) % 360; + Transform3D.rotationZ = (Transform3D.rotationZ + Spin3D.z * seconds) % 360; + }); +}; diff --git a/basics/graphics-3d/tsconfig.json b/basics/graphics-3d/tsconfig.json new file mode 100644 index 0000000..c0ae4f2 --- /dev/null +++ b/basics/graphics-3d/tsconfig.json @@ -0,0 +1,39 @@ +{ + "$schema": "https://json.schemastore.org/tsconfig.json", + // Mapped from https://www.typescriptlang.org/tsconfig + "compilerOptions": { + // Type Checking + "allowUnreachableCode": false, + "allowUnusedLabels": false, + "noFallthroughCasesInSwitch": true, + "noImplicitOverride": true, + "noImplicitReturns": true, + "noPropertyAccessFromIndexSignature": false, + "noUncheckedIndexedAccess": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "strict": true, + + // Modules + "allowArbitraryExtensions": false, + "allowImportingTsExtensions": false, + "module": "ESNext", + "moduleResolution": "Bundler", + "resolveJsonModule": true, + "resolvePackageJsonExports": true, + "resolvePackageJsonImports": true, + + // Interop Constraints + "allowSyntheticDefaultImports": true, + "forceConsistentCasingInFileNames": true, + "isolatedModules": true, + + // Language and Environment + "experimentalDecorators": true, + "lib": ["ESNext", "esnext.disposable", "DOM"], + "target": "ESNext", + "useDefineForClassFields": true + }, + "include": ["src"], + "exclude": ["node_modules", ".nanoforge", "dist"] +} diff --git a/basics/input-gamepad/.gitignore b/basics/input-gamepad/.gitignore new file mode 100644 index 0000000..f28e2dc --- /dev/null +++ b/basics/input-gamepad/.gitignore @@ -0,0 +1,5 @@ +node_modules/ +dist/ +.nanoforge/ +nf_modules/ +.env diff --git a/basics/input-gamepad/README.md b/basics/input-gamepad/README.md new file mode 100644 index 0000000..2faa859 --- /dev/null +++ b/basics/input-gamepad/README.md @@ -0,0 +1,22 @@ +# input-gamepad + +A square moved with a controller's left stick; holding A doubles its speed and pressing it makes +the controller rumble. The bottom line names the connected controller. + +It shows the controller side of the `input` engine library (`@nanoforge-dev/input/controller`): +`ControllerLibrary` polls the Gamepad API every frame, and the systems read `ctx.controller`: +`getStick` (with the deadzone applied), `isButtonPressed`, `isButtonJustPressed`, `vibrate` and +`getController`. Buttons follow the standard layout (`ControllerButton.A` is the bottom face +button, Cross on PlayStation). + +Browsers only show a controller to the page after one of its buttons is pressed. + +```sh +pnpm install +pnpm dev # play it +pnpm editor # open it in the editor +``` + +`image-fill.ts`, the `Position2D`, `Velocity2D`, `Acceleration2D`, `DrawableRect2D`, +`DrawableCircle2D` and `DrawableText2D` components and the `draw2D` and `move2D` systems are +copies of `shared/2d` (see the repository's README). diff --git a/basics/input-gamepad/assets/.gitkeep b/basics/input-gamepad/assets/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/basics/input-gamepad/nanoforge.config.ts b/basics/input-gamepad/nanoforge.config.ts new file mode 100644 index 0000000..77607cb --- /dev/null +++ b/basics/input-gamepad/nanoforge.config.ts @@ -0,0 +1,5 @@ +import { defineConfig } from "@nanoforge-dev/config"; + +export default defineConfig({ + type: "client", +}); diff --git a/basics/input-gamepad/package.json b/basics/input-gamepad/package.json new file mode 100644 index 0000000..8a54854 --- /dev/null +++ b/basics/input-gamepad/package.json @@ -0,0 +1,26 @@ +{ + "$schema": "https://json.schemastore.org/package.json", + "name": "input-gamepad", + "description": "Move a square with a controller: the smallest NanoForge game reading a gamepad", + "private": true, + "type": "module", + "scripts": { + "dev": "nf dev", + "build": "nf build", + "start": "nf start", + "editor": "nf editor ." + }, + "devDependencies": { + "@nanoforge-dev/asset": "^3.0.0", + "@nanoforge-dev/cli": "^3.0.1", + "@nanoforge-dev/common": "^3.0.0", + "@nanoforge-dev/config": "^3.0.1", + "@nanoforge-dev/core": "^3.0.0", + "@nanoforge-dev/ecs": "^3.0.0", + "@nanoforge-dev/editor-lib": "^3.0.0", + "@nanoforge-dev/env": "^3.0.0", + "@nanoforge-dev/graphics-2d": "^3.0.0", + "@nanoforge-dev/input": "^3.0.0", + "typescript": "^6.0.0" + } +} diff --git a/basics/input-gamepad/pnpm-lock.yaml b/basics/input-gamepad/pnpm-lock.yaml new file mode 100644 index 0000000..9aca6d9 --- /dev/null +++ b/basics/input-gamepad/pnpm-lock.yaml @@ -0,0 +1,1512 @@ +lockfileVersion: '9.0' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + +importers: + + .: + devDependencies: + '@nanoforge-dev/asset': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/cli': + specifier: ^3.0.1 + version: 3.0.1 + '@nanoforge-dev/common': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/config': + specifier: ^3.0.1 + version: 3.0.1 + '@nanoforge-dev/core': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/ecs': + specifier: ^3.0.0 + version: 3.0.0(@nanoforge-dev/editor-lib@3.0.0) + '@nanoforge-dev/editor-lib': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/env': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/graphics-2d': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/input': + specifier: ^3.0.0 + version: 3.0.0 + typescript: + specifier: ^6.0.0 + version: 6.0.3 + +packages: + + '@angular-devkit/core@22.2.7': + resolution: {integrity: sha512-cchZAMsV4d76RDZBlWzPhYxM/Hb6bmq71oUngdrwehMbBbdQu3W9C2tGlvxuPxbRKru9ZlUa14YVXQ0+QnhFtw==} + engines: {node: ^22.22.3 || ^24.15.0 || >=26.0.0, npm: ^6.11.0 || ^7.5.6 || >=8.0.0, yarn: '>= 1.13.0'} + peerDependencies: + chokidar: ^5.0.0 + peerDependenciesMeta: + chokidar: + optional: true + + '@angular-devkit/schematics-cli@22.2.7': + resolution: {integrity: sha512-9Od0E8TiYTQWm/03QjYWnsryZA8ZSjTf/k5z61nPd/jgloVNvSW8kxC7/YMw+RoXh2idMzjiJxraKxg+gJxzPw==} + engines: {node: ^22.22.3 || ^24.15.0 || >=26.0.0, npm: ^6.11.0 || ^7.5.6 || >=8.0.0, yarn: '>= 1.13.0'} + hasBin: true + + '@angular-devkit/schematics@22.2.7': + resolution: {integrity: sha512-a1h7xNqBLQVo1e5eCyOU3axSbA9AFU6nnSH5QhlNhggfMeZde+eBrueSt25xsewoxlKO8EvkVT3+knMUkDYiGQ==} + engines: {node: ^22.22.3 || ^24.15.0 || >=26.0.0, npm: ^6.11.0 || ^7.5.6 || >=8.0.0, yarn: '>= 1.13.0'} + + '@emnapi/core@2.0.0-beta.2': + resolution: {integrity: sha512-MzCVoWtcg4Pm2B3je5mMvYMvj3MmBKw+fU7vbsJc9/iT8ip6/eYIHo/Dsm/mr+wsHB6SEyJDuxB09Yy6r/8+4A==} + + '@emnapi/runtime@2.0.0-beta.2': + resolution: {integrity: sha512-JcrSPzPvZuNZvJqPTF9Fw25LbOJ8avzFVlaf2grmH4Cku0oGP47tRgqPZadcfj3YoZMHkFVnCYFbQM8I+i5QEw==} + + '@emnapi/wasi-threads@2.2.0': + resolution: {integrity: sha512-JP7OYH38Q7+pyTAe14raZHLQIK7BDKbdwji+Xi3pcd/6QkJYQH3SX4wu6EplGrGJWRepoNzedfm0G3B9Z4e9Rw==} + + '@inquirer/ansi@2.1.0': + resolution: {integrity: sha512-63GU5AD9KhNbWM0jlhHoMJTEFck2upFOPxHlnCKf3xYTV3rjTUUQfodihmTnfYQzMLS29oy8lK/gA1eJgu4bhA==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + + '@inquirer/checkbox@5.3.0': + resolution: {integrity: sha512-3QQSO87A+JoRtOtjtsgX2enwTL+3+VBVrkUpdqrIxMOgn5+W5sE57PcCPAiNUIESHxV4Q6mNEGxq2xLmRa0/yw==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/confirm@6.4.0': + resolution: {integrity: sha512-+DCZxrOF01Q/1SzTQkgycAQPS/Jf+Yol0h1P/MVmopukTsxGOu1h/LKqf30y0eHKFZYYrgUMVhGDhEbPmSPi9A==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/core@12.1.0': + resolution: {integrity: sha512-6H7usRWw4Gdjgpaem10CA5MfZ/xoYPGyInriR1Xubqjv+SVo8LIJ1erpFxW5JgCza6VZVZiKLTko7RtUU3AQMg==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/editor@5.4.0': + resolution: {integrity: sha512-L7vdCe4jnMpzhDisu1tAnr4WGvfPOVz+vNFXyIIL7O2Ycn/n90sn1ARvg+4cwzLf+us51BE/cX7uhnrLcal3+g==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/expand@5.2.0': + resolution: {integrity: sha512-AOp2KQk7QojUyWOP7VkqdBWmxLRaVH58wQMx3N4//P530EDtpVp1EWIjAJubx9ZohWS/UCEpIkA1TuiNki0iOA==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/external-editor@3.1.0': + resolution: {integrity: sha512-27JAkF38nXqXaoveU28iA/+Z8nutnF8B3JsbdToPHn9WnkrsMtZ0/YoJ29YwbtFexYIo+tIy6ikMvTdHKjjmGA==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/figures@2.1.0': + resolution: {integrity: sha512-CR9u2PME23jxy2SOyTb117efwAAPm98Zr+LoWI+PiQ55D6U8Yeu/HyFTxwytKhPa6oxAGzdsm2Kg7oLS6B9z8w==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + + '@inquirer/input@5.2.0': + resolution: {integrity: sha512-sIUPnN2X7M+7dq3RUd+e9QRacYnM+6B+kSucwQgj5VC5Eo/f+CIr2NyPBumxsViI+wzfokkgop/3x3KfHxNyJw==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/number@4.3.0': + resolution: {integrity: sha512-xYkX4sPVgox0F7yQwpz/MByWjOGdLEf1pdjH+Lji2gAzSs2xezz5bN5YgS1n0tx9wo0mRhGvq1KJGtvDZ9XXcQ==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/password@5.3.0': + resolution: {integrity: sha512-KVqW4G/UbMK06uBN76xF89JKYC9YBWU7v+Kc2tUwMCO8pg3ASBr0HVabl1KaSqF94O2KiRu8aKx4EicN78PK+A==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/prompts@8.7.2': + resolution: {integrity: sha512-QoRB4wFIjgH5iOhSjoIKMkTvSHDuV+O3OITlIqAYO0oK5x364GJILXiMBvlPiE+klg7Xx9tq5XVqQHcGUDYYPA==} + engines: {node: '>=23.5.0 || ^22.13.0 || ^20.17.0'} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/prompts@8.8.0': + resolution: {integrity: sha512-yYVT2Eo3mafb9tnU2Mr3+wh5wLCWyspExqVoPSMCIfBIn3ZUTE4IDfbCMbMgXaOH0tH+JZEhOtfczQhDzOjIGg==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/rawlist@5.4.0': + resolution: {integrity: sha512-x42wcy465GM5/mHNKBFdAJbLlLyzmYqr/DEa6F49nHpI+03EFwRCRKeLGQakx5XqZ4unc2yFuS78qAD4Rb0iFA==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/search@4.4.0': + resolution: {integrity: sha512-UJ+9tkzPT1AjnvjuPFYcOdO3BVeN28bfSXajYRFZTRgA9OiNl4k2Nn2cHHPwiIDyPHlvOnmE9ZOHyXhPHtvb+A==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/select@5.3.0': + resolution: {integrity: sha512-Fmgfl0qjqCQo+/tjQpgnRXKh5N7/VpYcJh+AlYU2eHmHZLMGUBDzo+Gwc2ODzWJfXNRZmgaMhz4qULcO/C/rXg==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/type@4.3.0': + resolution: {integrity: sha512-/IA8q2nyjgyl0NGSjqiRXB8gh3We7Pzx9C0c+6Zoolu905jFc79anerrUG7+n65+qs310DRK43yi2WDI8nY59A==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@isaacs/fs-minipass@4.0.1': + resolution: {integrity: sha512-wgm9Ehl2jpeqP3zw/7mo3kRHFp5MEDhqAdwy1fTGkHAwnkGOVsgpvQhL8B5n1qlb01jV3n/bI0ZfZp5lWA1k4w==} + engines: {node: '>=18.0.0'} + + '@jridgewell/sourcemap-codec@1.6.0': + resolution: {integrity: sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw==} + + '@nanoforge-dev/asset@3.0.0': + resolution: {integrity: sha512-jqXcyCMbdcCCj7wZ/dyIpjY8hza02Pt/vY8KrNcaXTlxpTc9EE+VKuO5+fHdUXWWPgJSFt96TqAPhug+z+KH3Q==} + engines: {node: '26'} + + '@nanoforge-dev/cli@3.0.1': + resolution: {integrity: sha512-ZfrbETcAcX3vsPLO1WLSCJc2ERCAcIpbdi9Df5bmH3XLinQkDAcESkN9JkaI/vgV08A7xhTjV8zSDSwF0T73Xg==} + engines: {node: '26'} + hasBin: true + + '@nanoforge-dev/common@3.0.0': + resolution: {integrity: sha512-lzMvQ1vCElh9OcP4EqhffbY+AQXOH4IiuD1pj7VvJlpcY6hh7Bs/s4NVS0gXoJ+ibpBMe5mAq23RyzqTwk8czg==} + engines: {node: '26'} + + '@nanoforge-dev/config@3.0.1': + resolution: {integrity: sha512-XWRScOotb8IirerRx/mWLmUVYye3lo0PN/5a0MUp/eoSrhz0S6zzhGHEupRuC8aeHTjsQT7ctM3P6YyKSHZLaQ==} + engines: {node: '26'} + + '@nanoforge-dev/core@3.0.0': + resolution: {integrity: sha512-pa7Fr3TFkZVfAADBC17Qt5ru/W9vXtYB8e5eb7wurAtu8/jH/ZtqfW3kafTuWC9513MXp/h6LOCdZQhjnCt6UA==} + engines: {node: '26'} + + '@nanoforge-dev/ecs@3.0.0': + resolution: {integrity: sha512-csrXJtCzqohxtvEQs+O//xabnaLR3BXe0QpSpl7NVihF3f0iX2fNYURxNjQKxzoPYBokCnnyNxN2KFc7UmIsdA==} + engines: {node: '26'} + peerDependencies: + '@nanoforge-dev/editor-lib': 3.0.0 + '@nanoforge-dev/scene': 3.0.0 + peerDependenciesMeta: + '@nanoforge-dev/editor-lib': + optional: true + '@nanoforge-dev/scene': + optional: true + + '@nanoforge-dev/editor-lib@3.0.0': + resolution: {integrity: sha512-fSWm6bHelbxqeVESYoUUKDi9RGNxvRu6p1r41KE1DddM0RrP0/WzkFOWBvgl+psHbYNotXe723Y2Fd3p+tqPDQ==} + engines: {node: '26'} + + '@nanoforge-dev/editor@0.1.4': + resolution: {integrity: sha512-bqbrH8ulFSiZz1iisJHtHeEzj1RV/70uErCYHeW4DIhVPsWbBfWKFvg/ghAbmPk5vsj0YnhDX6DSpik4S1QoiQ==} + engines: {node: '25'} + + '@nanoforge-dev/env@3.0.0': + resolution: {integrity: sha512-kXYXl9/09Bn8VStTTFuZY3dYDG9b76VhOi9PHMnaLe75XcFRLKJ2dYkXf3ut6RCL2+6H7HAEIOALjR15CHnJ5A==} + engines: {node: '26'} + + '@nanoforge-dev/graphics-2d@3.0.0': + resolution: {integrity: sha512-0I0WUr5495jORdYR+HtyP4kmAfCMvixmG+EH/gE5bN33S8RO6/Ly4oMLZOLUywcDTAFuLn28BlHuVor2YfXrsg==} + engines: {node: '26'} + + '@nanoforge-dev/input@3.0.0': + resolution: {integrity: sha512-8pWU28c99VAvn37onNbVFfwXTgyQGxm5DVnTdBEzgrF3KPCzU77kEaexB1AWOlga+4qNGU7/XNm3hNZ+YS49Ig==} + engines: {node: '26'} + + '@nanoforge-dev/loader-client@1.7.0': + resolution: {integrity: sha512-zDj0yQ8cZyHHjAYDVIyB79mh4dK7WRgZG7Kc+d/43t2WX/pX2HqBVkpLcDPkA9cNOKpCRYWd3LyYISlz53gzyg==} + engines: {node: '26'} + + '@nanoforge-dev/loader-server@1.7.0': + resolution: {integrity: sha512-Yd/BYORhoar5znNSD7kGirAc1Al0q5t8iscbb07QWKeXWA+DLKjPSuKJC6ykysFkbs9HiZU59oOfxyvNL4h3Pw==} + engines: {node: '26'} + + '@nanoforge-dev/loader-website@1.7.0': + resolution: {integrity: sha512-x1fV3RYUUxru39sF5HJcfutNnifMMTIEHW92jgkR9gz06ZlZ+rQofuegXgAnEzs0dEXa+rhNQ/iXYbqOZvq6YQ==} + engines: {node: '26'} + + '@nanoforge-dev/registry@3.0.1': + resolution: {integrity: sha512-EzSaszYtrPldD5Do7jdQK3TLLb8uCirY6NQjKXkeGw31X+sUXor4h5GAaoxELWMzPnv9BbKtggSaVaQIt7s8IQ==} + engines: {node: '26'} + + '@nanoforge-dev/schematics@3.0.1': + resolution: {integrity: sha512-iK2vC0gPEh2mQ81IB4+jfGw/ZNOLMDnS9HRBXH5tWB0mdN5GA32viblhW0oYPX2/tWrLC9YiCPgEE4AL8Zwz6w==} + engines: {node: '26'} + + '@napi-rs/wasm-runtime@1.2.6': + resolution: {integrity: sha512-mRyDmEw9/fCDXCGfL1sbgIw/GUK0PVxRW4YwgPN61F3LQ+fSyoBFarJVzgGyhF6kRzEQZ0FejDqm4WLXSeqQmw==} + engines: {node: ^20.19.0 || ^22.13.0 || >=23.5.0} + peerDependencies: + '@emnapi/core': ^1.7.1 || 2.0.0-beta.2 + '@emnapi/runtime': ^1.7.1 || 2.0.0-beta.2 + + '@oven/bun-darwin-aarch64@1.4.4': + resolution: {integrity: sha512-zW/hxwc8sJAILGwB5eTC4i48ouGXf0V4lrxmEOk3JIE6JkYVW1TZh1E2pIempqsezgW1sckTIIDudFON8bJ2Mw==} + cpu: [arm64] + os: [darwin] + + '@oven/bun-darwin-x64@1.4.4': + resolution: {integrity: sha512-oKGcxLsvh4oHjAo28nPm8c/xN0o/OmGyj1IHYc94vprkWsW2hNg2keEZt5f40cI5Hvu4jDlSRTR0UNpv1UIAxw==} + cpu: [x64] + os: [darwin] + + '@oven/bun-freebsd-aarch64@1.4.4': + resolution: {integrity: sha512-klvA9FlwLxZj3JYIOPQA4bbnHIC3uas8kBE4GaGGkeVgAQP/k8hAzYkOqkSaqHBDbxLrTyFEQArEAevJq6NJzg==} + cpu: [arm64] + os: [freebsd] + + '@oven/bun-freebsd-x64@1.4.4': + resolution: {integrity: sha512-sF1xS/scbyN94P2d0eTiarO6JHxrIvhZNT9hnWjQXW5nwKRtfuP+UYnIMNyvW1BQPcZFP/cvfLBNUIe1ea4zPA==} + cpu: [x64] + os: [freebsd] + + '@oven/bun-linux-aarch64-android@1.4.4': + resolution: {integrity: sha512-5lvn3at5vRC0GxvmiqEiV2/e23tnRi0q5pzR40yfDvDA3OW7PSkt4chF1nA9vnAJhro4/l+ol1FmNP6D3cf/oA==} + cpu: [arm64] + os: [android] + + '@oven/bun-linux-aarch64-musl@1.4.4': + resolution: {integrity: sha512-QFd0P+mHJxbZFbUla4MgiE5OwxysHaUIYxL2pPNkpWtaI7v4ShOpr8OhBmsuyB0xn5rv/ZJnPsj2y8+bB9+g/A==} + cpu: [arm64] + os: [linux] + libc: [musl] + + '@oven/bun-linux-aarch64@1.4.4': + resolution: {integrity: sha512-ZTVtpf9zmHSBVPX1sBwe5agGb/rN34yPGg/Hby8e2Ax2uCUA2URZKlZH7qLntK7qaFJCMXh9v0GWNYN2zINz1w==} + cpu: [arm64] + os: [linux] + libc: [glibc] + + '@oven/bun-linux-x64-android@1.4.4': + resolution: {integrity: sha512-3dMicj9C1DhaIfDkwt/9GtpU0W+q+GazbG9OIlEyL3Q1BBEz2e6ZRz/JiO8D/ECC0caXAqvnpFudehcLlgIwWQ==} + cpu: [x64] + os: [android] + + '@oven/bun-linux-x64-musl@1.4.4': + resolution: {integrity: sha512-lEEjNOJJrbGZu2NVcPI4uXdILcpspezWkA8R/Jr0RCGhM6zQd0Y7JBIIKNAmbX59EeWpeEz7Q78iLbpcAUypUA==} + cpu: [x64] + os: [linux] + libc: [musl] + + '@oven/bun-linux-x64@1.4.4': + resolution: {integrity: sha512-CHbbkmHVM28T1GFq+6GL4Ao4ujwwYwj1CxFFwEFzLanPfNsId9AhbIP0Q4reWuWBkGimUkoQygrK7Rgjtj3vog==} + cpu: [x64] + os: [linux] + libc: [glibc] + + '@oven/bun-windows-aarch64@1.4.4': + resolution: {integrity: sha512-n0ep5ZRPCZY1+dqFJpnnRUZB1wy4GYU6At8RF+pyzySCLjkN9R4rFh2PtBHAgF/lg1vOl3/CeER3pDM+p40ATA==} + cpu: [arm64] + os: [win32] + + '@oven/bun-windows-x64@1.4.4': + resolution: {integrity: sha512-a3LNctBVO8PjePsFZfwDleF2JXYf2BfQ1u/PLRnBDLnC2Riml+4+LgJpKj4xRGhB92KweGyQI5PXaTkP9qypMQ==} + cpu: [x64] + os: [win32] + + '@oxc-project/types@0.158.0': + resolution: {integrity: sha512-xZ66qA4WmLbTLlxH3mqMd8f9UKbaOzOT0ATwFf4DH/14pMgpUrtqtjyYzOQmgfl2a0iRAAMbQ9G1th/67jRzGw==} + + '@rolldown/binding-android-arm-eabi@1.3.2': + resolution: {integrity: sha512-kqR2xcygEx3WwDY69LsKeyf7SVmx4yzMtKZRknyaHieVJdRvvnAM97L0Gq6tUFc9T2YXcW/Ghij2+Um6He0LTw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [android] + + '@rolldown/binding-android-arm64@1.3.2': + resolution: {integrity: sha512-gXM4GAAvvIZA7qUuSCQS+Zz91H2fagKa5MNppUdjzysJ8LXMWm9D/gQj4nfOKo6okquDQ5pkjsuo2SUMXNW0Rw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [android] + + '@rolldown/binding-darwin-arm64@1.3.2': + resolution: {integrity: sha512-OBs5hp3W+LwMEUmDMMMnu08ncG0t6DDgnFU+6TAucKtAfNgerYLZSr2jtREKb/JuPQ1J7bJnWIgKKkxvjuAw1g==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [darwin] + + '@rolldown/binding-darwin-x64@1.3.2': + resolution: {integrity: sha512-X0VGYd4v/gdjfa/IP6uHuMhofPoUDYvK/byk3bC0jQ1pKKgt6RZ4B4puMqP0AHkjmIHAsxA471mM6AxZ39IaTA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [darwin] + + '@rolldown/binding-freebsd-x64@1.3.2': + resolution: {integrity: sha512-mr04K4cp9J/fj9fknrX8e4QvI/V48Sp+4v64PoLwhoirIH8b8L8EBrF/0bTjV1It2IL91hoNG13GblnWLglkxA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [freebsd] + + '@rolldown/binding-linux-arm-gnueabihf@1.3.2': + resolution: {integrity: sha512-VgWy02HU9Tiy6tU8U+kF3Fd4TQwTNdIBvs2MlgViP1ksMtAnQQTIPAj0ZsJzIQXKIOugqQSpqxQgELJ3fkuL5w==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [linux] + + '@rolldown/binding-linux-arm64-gnu@1.3.2': + resolution: {integrity: sha512-0wloJFYqV844gv6boiERbHpErxbxHbmlgnMX5VxP1Ux+DLBqGrUOn0cIpBmCZEcTITes3QUelxya4u8c9ziQvQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-arm64-musl@1.3.2': + resolution: {integrity: sha512-Kys8wgFQy8H8vua0MNpC0akMBFoNO8455RHk2yycBM0iayMIAtVAL6xmV9TWAkehFgrrlImTL2fZdX5LXfYtAA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + libc: [musl] + + '@rolldown/binding-linux-ppc64-gnu@1.3.2': + resolution: {integrity: sha512-L8eej7+/StRxUHHOPsOVl7Fzx/3tumuGB4hGQZKT73xRI16KZhaSJr0gi3C3WBjNRxeJRKKps2UD4lQukP+oBw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [ppc64] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-s390x-gnu@1.3.2': + resolution: {integrity: sha512-MV5CEb/nV8neQOj7l6945q1vy62HXtWO8zPDvfySPusoUzdBoLoJ/DfXXwaYThGTXZCniF+5bCf253WTPPK7Yw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [s390x] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-x64-gnu@1.3.2': + resolution: {integrity: sha512-3qssvvVvkwQookZ1/1avlKWc5orAR85vgKdzDd5noZS8nnHiI/ejOAEt0xfNYvtBBF7/DZmP8dANWkRBJVOBCA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-x64-musl@1.3.2': + resolution: {integrity: sha512-rJqoFTm/bCZFKKgaT4NzWn/TuJkFDToZ/rzYFnYVBL28jH1nIfg6snx2mDri30nal9H+wcYfKpoPR9jrMQgQQg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + libc: [musl] + + '@rolldown/binding-openharmony-arm64@1.3.2': + resolution: {integrity: sha512-ozdbCjHfh0N//wJNExjJlSlcDaeIKo8k1ktzkLUyESr2Gu/Qw7nBYxKe3jgtoaxda570vg10WdYosre82263hQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [openharmony] + + '@rolldown/binding-wasm32-wasi@1.3.2': + resolution: {integrity: sha512-p5VA6Vk/2cXZPVWf+dDbuE0dkhrcoAo6pISTJmzUnsSdQqNJdusyR8lZgHku095+r27zrYISNLZnJoqrcePW0A==} + engines: {node: ^20.19.0 || ^22.13.0 || >=23.5.0} + cpu: [wasm32] + + '@rolldown/binding-win32-arm64-msvc@1.3.2': + resolution: {integrity: sha512-XDb2U14Orf4r76SwzvJ7avePL00w4gHBmi1Ig4B/itYFEUTmYMNDHVU0dcYuBa0LgNBqyREoJOrQKxQlyYJA7A==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [win32] + + '@rolldown/binding-win32-x64-msvc@1.3.2': + resolution: {integrity: sha512-lEsKzKJqIUDZVCBhS4lkZuyQUhV1oRg5UHkI72qlOAqJn7qEXcoVdTridFS7PHNWdZknBl95EAF/4P1Xv0K1eQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [win32] + + '@rolldown/pluginutils@1.1.0': + resolution: {integrity: sha512-K+NU2HDCEem4sClgHH4ZZXwdJeNFkJo+hRk479DIwdIviAPN2hFJH1KHHwg8CxHQXvi0M5XY4deTXINfIiSG6w==} + + '@sindresorhus/is@4.6.0': + resolution: {integrity: sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==} + engines: {node: '>=10'} + + '@tybys/wasm-util@0.10.4': + resolution: {integrity: sha512-W3c4gRigFS0T/Ma4qIYF3GDAc5AQdHb1yL5znJT1Zv1YaD9Kitx656wBjvr19qbiosmZT8lWDM5BEMynUqX65A==} + + '@types/validator@13.15.10': + resolution: {integrity: sha512-T8L6i7wCuyoK8A/ZeLYt1+q0ty3Zb9+qbSSvrIVitzT3YjZqkTZ40IbRsPanlB4h1QB3JVL1SYCdR6ngtFYcuA==} + + ajv-formats@3.0.1: + resolution: {integrity: sha512-8iUql50EUR+uUcdRQ3HDqa6EVyo3docL8g5WJ3FNcWmu62IbkGUue/pEyLBW8VGKKucTPgqeks4fIU1DA4yowQ==} + peerDependencies: + ajv: ^8.0.0 + peerDependenciesMeta: + ajv: + optional: true + + ajv@8.20.0: + resolution: {integrity: sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA==} + + ansi-regex@6.6.0: + resolution: {integrity: sha512-XZ5apbzreCbXSKwPjJstu8R0zOi247w3XYwWxtwBXgpZrCyc1Ka7p9/xY0A9/diMewmHbEKz+FIraWaEWjlN5g==} + engines: {node: '>=12'} + + ansis@4.5.0: + resolution: {integrity: sha512-KwIVkfFfJSSzBmZhDGuTmkhWqTdyB5oNVzzznBJbBZ5bZtHiqSrcugRF0RKJKT4Ss3d7ZrcjnlFVDlQNmtWfWw==} + engines: {node: '>=14'} + + braces@3.0.3: + resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} + engines: {node: '>=8'} + + bun@1.4.4: + resolution: {integrity: sha512-hj0ASdG6PNjLZGFAXktWb3Uaj/dcv/1wCsIttoEXADNIQBsGjTr+5uLKYbrDkuc7NT0Tkj4yPIqJI2jDxXdvVg==} + cpu: [arm64, x64] + os: [darwin, linux, android, freebsd, win32] + hasBin: true + + bundle-name@4.1.1: + resolution: {integrity: sha512-DdH81/zPLVS11EUgWq3tEu/xn+EzljlMYooDNdzWEnFha3R3NBMpMV1UqYIpjYHV/SgpFKMIX1Oh7o06SjM/oA==} + engines: {node: '>=18'} + + chalk@5.6.2: + resolution: {integrity: sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA==} + engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} + + char-regex@1.0.2: + resolution: {integrity: sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==} + engines: {node: '>=10'} + + chardet@2.2.0: + resolution: {integrity: sha512-rddelWYNPRrXq6PtNEN2S3f6t9ILzvqaN5pVgi4kqt9jHQaXIial9PznB5iSPVlQSLNaaH22ItWz3EJtQ10+OA==} + + chokidar@5.0.0: + resolution: {integrity: sha512-TQMmc3w+5AxjpL8iIiwebF73dRDF4fBIieAqGn9RGCWaEVwQ6Fb2cGe31Yns0RRIzii5goJ1Y7xbMwo1TxMplw==} + engines: {node: '>= 20.19.0'} + + chownr@3.0.0: + resolution: {integrity: sha512-+IxzY9BZOQd/XuYPRmrvEVjF/nqj5kgT4kEq7VofrDoM1MxoRjEWkrCC3EtLi59TVawxTAn+orJwFQcrqEN1+g==} + engines: {node: '>=18'} + + class-transformer@0.5.1: + resolution: {integrity: sha512-SQa1Ws6hUbfC98vKGxZH3KFY0Y1lm5Zm0SY8XX9zbK7FJCyVEac3ATW0RIpwzW+oOfmHE5PMPufDG9hCfoEOMw==} + + class-validator@0.14.4: + resolution: {integrity: sha512-AwNusCCam51q703dW82x95tOqQp6oC9HNUl724KxJJOfnKscI8dOloXFgyez7LbTTKWuRBA37FScqVbJEoq8Yw==} + + class-validator@0.15.1: + resolution: {integrity: sha512-LqoS80HBBSCVhz/3KloUly0ovokxpdOLR++Al3J3+dHXWt9sTKlKd4eYtoxhxyUjoe5+UcIM+5k9MIxyBWnRTw==} + + cli-cursor@5.0.0: + resolution: {integrity: sha512-aCj4O5wKyszjMmDT4tZj93kxyydN/K5zPWSCe6/0AV/AA1pqe5ZBIw0a2ZfPQV7lL5/yb5HsUreJ6UFAF1tEQw==} + engines: {node: '>=18'} + + cli-spinners@3.4.0: + resolution: {integrity: sha512-bXfOC4QcT1tKXGorxL3wbJm6XJPDqEnij2gQ2m7ESQuE+/z9YFIWnl/5RpTiKWbMq3EVKR4fRLJGn6DVfu0mpw==} + engines: {node: '>=18.20'} + + cli-width@4.1.0: + resolution: {integrity: sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==} + engines: {node: '>= 12'} + + commander@15.1.0: + resolution: {integrity: sha512-cgnQ88TRrWcC7pVq46RzJVRMktu3W2RcbnoidnfBsl1bmDCBwJS/udcIZpKoCrbAYYaCqsz1yZCVIgbIaU3ddQ==} + engines: {node: '>=22.12.0'} + + default-browser-id@5.0.1: + resolution: {integrity: sha512-x1VCxdX4t+8wVfd1so/9w+vQ4vx7lKd2Qp5tDRutErwmR85OgmfX7RlLRMWafRMY7hbEiXIbudNrjOAPa/hL8Q==} + engines: {node: '>=18'} + + default-browser@5.5.1: + resolution: {integrity: sha512-m1pAzaJgZ/gssEqlOhJkPJp8Xly7QyW6xcrkUa2KKcDeDSEMP7X8xipU3snUcfisTQx0w1AGae+9UtJSfVnXGw==} + engines: {node: '>=18'} + + define-lazy-prop@3.0.0: + resolution: {integrity: sha512-N+MeXYoqr3pOgn8xfyRPREN7gHakLYjhsHhWGT3fWAiL4IkAt0iDw14QiiEm2bE30c5XX5q0FtAA3CK5f9/BUg==} + engines: {node: '>=12'} + + defu@6.1.7: + resolution: {integrity: sha512-7z22QmUWiQ/2d0KkdYmANbRUVABpZ9SNYyH5vx6PZ+nE5bcC0l7uFvEfHlyld/HcGBFTL536ClDt3DEcSlEJAQ==} + + destr@2.0.5: + resolution: {integrity: sha512-ugFTXCtDZunbzasqBxrK93Ik/DRYsO6S/fedkWEMKqt04xZ4csmnmwGDBAb07QWNaGMAmnTIemsYZCksjATwsA==} + + dotenv@17.4.2: + resolution: {integrity: sha512-nI4U3TottKAcAD9LLud4Cb7b2QztQMUEfHbvhTH09bqXTxnSie8WnjPALV/WMCrJZ6UV/qHJ6L03OqO3LcdYZw==} + engines: {node: '>=12'} + + dotenv@18.0.10: + resolution: {integrity: sha512-89FAA1xchzK2mxVWdr5F/0rldwiueXs6zJM86rO66EzekR1iBdiXRthyG+m5GvkJaFH3C2LESzamTkgndmLT2A==} + engines: {node: '>=12'} + hasBin: true + + emojilib@2.4.0: + resolution: {integrity: sha512-5U0rVMU5Y2n2+ykNLQqMoqklN9ICBT/KsvC1Gz6vqHbz2AXXGkG+Pm5rMWk/8Vjrr/mY9985Hi8DYzn1F09Nyw==} + + fast-deep-equal@3.1.3: + resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} + + fast-string-truncated-width@3.0.3: + resolution: {integrity: sha512-0jjjIEL6+0jag3l2XWWizO64/aZVtpiGE3t0Zgqxv0DPuxiMjvB3M24fCyhZUO4KomJQPj3LTSUnDP3GpdwC0g==} + + fast-string-width@3.0.2: + resolution: {integrity: sha512-gX8LrtNEI5hq8DVUfRQMbr5lpaS4nMIWV+7XEbXk2b8kiQIizgnlr12B4dA3ZEx3308ze0O4Q1R+cHts8kyUJg==} + + fast-uri@3.1.9: + resolution: {integrity: sha512-hS/0Wt3Ya043oKXs0sIxrMpKQITXhMLIrVAKKXi4gozGC9v7YRWVnXIZzjNPTO02M9BdxLCWqK1yRXgNziVyJQ==} + + fast-wrap-ansi@0.2.2: + resolution: {integrity: sha512-7F2Fl+TjRSenLqlU3UjSH0iyqopqoZIu7eZVpEirP2g1GtWa2G/ecEmBdgz31+Mxr+ELclgg6sokpSFIQiZ02Q==} + + fflate@0.8.3: + resolution: {integrity: sha512-tbZNuJrLwGUp3zshBtdy4W+ORxZuIh8a5ilyIEQDC5rY1f3U20JMry0Ll3WBzU58EZKsEuJFXhb5gwv8CsPvgA==} + + fill-range@7.1.1: + resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} + engines: {node: '>=8'} + + get-east-asian-width@1.7.0: + resolution: {integrity: sha512-XjH1AECxf0giL2V1aU8vKyRR2ppRUb5c0EvT7zuJTokQ74bNo52zOtghqdWIqrhUD79fo3x0WfKZdOqxF6LG1Q==} + engines: {node: '>=18'} + + iconv-lite@0.7.3: + resolution: {integrity: sha512-IKXpvIzjnC9XTAUbVBcMfGS0EPaIXtW6v+zr+RRp+hqULEpo0owZax6wyRwPOJbWbzjYspQwusTsfVr0ifh4uQ==} + engines: {node: '>=0.10.0'} + + is-docker@3.0.0: + resolution: {integrity: sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + hasBin: true + + is-in-ssh@1.0.0: + resolution: {integrity: sha512-jYa6Q9rH90kR1vKB6NM7qqd1mge3Fx4Dhw5TVlK1MUBqhEOuCagrEHMevNuCcbECmXZ0ThXkRm+Ymr51HwEPAw==} + engines: {node: '>=20'} + + is-inside-container@1.0.0: + resolution: {integrity: sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA==} + engines: {node: '>=14.16'} + hasBin: true + + is-interactive@2.0.0: + resolution: {integrity: sha512-qP1vozQRI+BMOPcjFzrjXuQvdak2pHNUMZoeG2eRbiSqyvbEf/wQtEOTOX1guk6E3t36RkaqiSt8A/6YElNxLQ==} + engines: {node: '>=12'} + + is-number@7.0.0: + resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} + engines: {node: '>=0.12.0'} + + is-unicode-supported@2.1.0: + resolution: {integrity: sha512-mE00Gnza5EEB3Ds0HfMyllZzbBrmLOX3vfWoj9A9PEnTfratQ/BcaJOuMhnkhjXvb2+FkY3VuHqtAGpTPmglFQ==} + engines: {node: '>=18'} + + is-wsl@3.1.1: + resolution: {integrity: sha512-e6rvdUCiQCAuumZslxRJWR/Doq4VpPR82kqclvcS0efgt430SlGIk05vdCN58+VrzgtIcfNODjozVielycD4Sw==} + engines: {node: '>=16'} + + json-schema-traverse@1.0.0: + resolution: {integrity: sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==} + + jsonc-parser@3.3.1: + resolution: {integrity: sha512-HUgH65KyejrUFPvHFPbqOY0rsFip3Bo5wb4ngvdi1EpCYWUQDC5V+Y7mZws+DLkr4M//zQJoanu1SP+87Dv1oQ==} + + konva@10.9.1: + resolution: {integrity: sha512-m49x+GatSxEUSvqahYhxpTjgKbtrLtw4P4o4B4iux953ZFpceaK52Ea+CFsAsd7W4I0Y5u6mMoRUsY/eltNZmw==} + peerDependencies: + canvas: ^3.0.0 + skia-canvas: ^3.0.0 + peerDependenciesMeta: + canvas: + optional: true + skia-canvas: + optional: true + + libphonenumber-js@1.13.16: + resolution: {integrity: sha512-tIOCM9yx2Go6d5/ZANe0K+G4AZek1Ymx81HxQpf19Sri4zMP95eQbKdnUGHAvFQ4nx0PeLhFqvAfisTADXj3tQ==} + + log-symbols@7.0.1: + resolution: {integrity: sha512-ja1E3yCr9i/0hmBVaM0bfwDjnGy8I/s6PP4DFp+yP+a+mrHO4Rm7DtmnqROTUkHIkqffC84YY7AeqX6oFk0WFg==} + engines: {node: '>=18'} + + magic-string@1.4.1: + resolution: {integrity: sha512-8lyCu36ErXR0J9uaGKlKQoiLZKmtI63YGLE8G2o9jyRPdr4X47LusSOwgOJOzcVtp81fTAAjxR7BwKz682Jhow==} + + micromatch@4.0.8: + resolution: {integrity: sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==} + engines: {node: '>=8.6'} + + mimic-function@5.0.1: + resolution: {integrity: sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==} + engines: {node: '>=18'} + + minipass@7.1.3: + resolution: {integrity: sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A==} + engines: {node: '>=16 || 14 >=14.17'} + + minizlib@3.1.0: + resolution: {integrity: sha512-KZxYo1BUkWD2TVFLr0MQoM8vUUigWD3LlD83a/75BqC+4qE0Hb1Vo5v1FgcfaNXvfXzr+5EhQ6ing/CaBijTlw==} + engines: {node: '>= 18'} + + mute-stream@4.0.0: + resolution: {integrity: sha512-gSrprq0fJ3EiOErzjdIZrjysVVmJ4uu1QWfCDss5LypA5OXvrMje5Ym5z6V6RLyJ2eF87lasX7t6a0AnFvZblg==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + + node-emoji@2.2.0: + resolution: {integrity: sha512-Z3lTE9pLaJF47NyMhd4ww1yFTAP8YhYI8SleJiHzM46Fgpm5cnNzSl9XfzFNqbaz+VlJrIj3fXQ4DeN1Rjm6cw==} + engines: {node: '>=18'} + + onetime@7.0.0: + resolution: {integrity: sha512-VXJjc87FScF88uafS3JllDgvAm+c/Slfz06lorj2uAY34rlUu0Nt+v8wreiImcrgAjjIHp1rXpTDlLOGw29WwQ==} + engines: {node: '>=18'} + + open@11.0.4: + resolution: {integrity: sha512-++Zlftm0kVLPmzC06t6epuWmcRMDbI4z5P3NNX979WA/k23+NtSOynEGzsVfZwguKw2mi5umVgnBlJQMwRz4Pg==} + engines: {node: '>=20'} + + ora@9.4.1: + resolution: {integrity: sha512-6VlU9MLXbjVQD04AZCMX28hVtA5bUoadvUqO76MUCVA0ilwJbMiHsITRPfyVm6p/BC0Av/BXMujx39WCe1LEqw==} + engines: {node: '>=20'} + + picomatch@2.3.2: + resolution: {integrity: sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==} + engines: {node: '>=8.6'} + + picomatch@4.0.7: + resolution: {integrity: sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA==} + engines: {node: '>=12'} + + powershell-utils@0.2.1: + resolution: {integrity: sha512-C+y9x90UElAddDZmV4qOx9W53B61PO7cIqWz2dQsWlwswuq4mr8NEwytdGKboYbQlGZ3awrkTeNvcZiZNHnQ8A==} + engines: {node: '>=20'} + + rc9@3.1.0: + resolution: {integrity: sha512-ufjkNVzbRHKcCOmTahZkmVsyc3W+MSk3jY03m+a7tGHkIsdVMG9l10/3HvFbWkkKzY5VFp3pkRsIo/UYgmFL7Q==} + + readdirp@5.1.1: + resolution: {integrity: sha512-Kko+Y5XQ6fM+Ce3dq3m9YGxnacYZYl9cA1wZjaF3Vbry2L3i1qVg8+CAgNPsXRArPMUMCaOR7oa9Nqntc43JKA==} + engines: {node: '>= 20.19.0'} + + require-from-string@2.0.2: + resolution: {integrity: sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==} + engines: {node: '>=0.10.0'} + + restore-cursor@5.1.0: + resolution: {integrity: sha512-oMA2dcrw6u0YfxJQXm342bFKX/E4sG9rbTzO9ptUcR/e8A33cHuvStiYOwH7fszkZlZ1z/ta9AAoPk2F4qIOHA==} + engines: {node: '>=18'} + + rolldown@1.3.2: + resolution: {integrity: sha512-EFHqbVkXiYZA6akmYm2bvJhNbEGdUwAResRhYwl/BO8QhB5KxsG+t3RVHJSIOy5jBEb0XCACvrIGnnl6Z8sMGA==} + engines: {node: ^20.19.0 || >=22.12.0} + hasBin: true + + run-applescript@7.1.0: + resolution: {integrity: sha512-DPe5pVFaAsinSaV6QjQ6gdiedWDcRCbUuiQfQa2wmWV7+xC9bGulGI8+TdRmoFkAPaBXk8CrAbnlY2ISniJ47Q==} + engines: {node: '>=18'} + + rxjs@7.8.2: + resolution: {integrity: sha512-dhKf903U/PQZY6boNNtAGdWbG85WAbjT/1xYoZIC7FAY0yWapOBQVsVrDl58W86//e1VpMNBtRV4MaXfdMySFA==} + + safer-buffer@2.1.2: + resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} + + semver@7.8.6: + resolution: {integrity: sha512-9lpSSU4Mly3mrtruwLs1eLK6+gzbzqeBFwRNjIjE+9LuDpWdYctrQlQ3ej1Ilgi7gknpsTRnPoLP8DpCHqHIJw==} + engines: {node: '>=10'} + hasBin: true + + signal-exit@4.1.0: + resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} + engines: {node: '>=14'} + + skin-tone@2.0.0: + resolution: {integrity: sha512-kUMbT1oBJCpgrnKoSr0o6wPtvRWT9W9UKvGLwfJYO2WuahZRHOpEyL1ckyMGgMWh0UdpmaoFqKKD29WTomNEGA==} + engines: {node: '>=8'} + + source-map@0.8.0: + resolution: {integrity: sha512-d8EqvL+k/SOXCreS/SUzg2ciyHqBBLcN/yuRjFsbvVhHTE2pgei7oAhmPM7kWFbkX6OSMQfUq4KbkF3au9lhYQ==} + engines: {node: '>= 12'} + + stdin-discarder@0.3.2: + resolution: {integrity: sha512-eCPu1qRxPVkl5605OTWF8Wz40b4Mf45NY5LQmVPQ599knfs5QhASUm9GbJ5BDMDOXgrnh0wyEdvzmL//YMlw0A==} + engines: {node: '>=18'} + + string-width@8.3.0: + resolution: {integrity: sha512-ZbmZM0JCihQN91dWnxoipT2KOEyHqEyfRXUyjuRhW8b/xnqPDoq4gWEVApTVa9db2wN8mmoikgFBbjh71+cGeQ==} + engines: {node: '>=20'} + + strip-ansi@7.2.0: + resolution: {integrity: sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==} + engines: {node: '>=12'} + + tar@7.5.23: + resolution: {integrity: sha512-lkukzdoGngZHJZXxW4S/E4Fp9ghTDlyZXrQGRNoJ/LXvDKcXUTq2sg5yQe74po7Voea6n/IN09+wE/QvJMiifA==} + engines: {node: '>=18'} + + to-regex-range@5.0.1: + resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} + engines: {node: '>=8.0'} + + tslib@2.9.1: + resolution: {integrity: sha512-a4Ux9VKuIMHsOS7ENbEq6hK2ZGYIT27Rtl0E4eD9KqwxhKiQeMZE/9xb3IdYwWaSOyIBQLExhQgXDTYoiCxnWA==} + + typescript@6.0.3: + resolution: {integrity: sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw==} + engines: {node: '>=14.17'} + hasBin: true + + unicode-emoji-modifier-base@1.0.0: + resolution: {integrity: sha512-yLSH4py7oFH3oG/9K+XWrz1pSi3dfUrWEnInbxMfArOfc1+33BlGPQtLsOYwvdMy11AwUBetYuaRxSPqgkq+8g==} + engines: {node: '>=4'} + + unrun@0.3.1: + resolution: {integrity: sha512-onIck/oNnCaytwths1ZVp1LK2Gq2hPoyFhiHebObuUXqR3S0uHuLLaBK8K6mRRgV7Ptip8AnNvaUsgzwWwBZuA==} + engines: {node: ^22.13.0 || >=24.0.0} + hasBin: true + peerDependencies: + synckit: ^0.11.11 + peerDependenciesMeta: + synckit: + optional: true + + validator@13.15.35: + resolution: {integrity: sha512-TQ5pAGhd5whStmqWvYF4OjQROlmv9SMFVt37qoCBdqRffuuklWYQlCNnEs2ZaIBD1kZRNnikiZOS1eqgkar0iw==} + engines: {node: '>= 0.10'} + + wsl-utils@1.0.1: + resolution: {integrity: sha512-c16PKLIRxBYpR3jSWsdS7SFp0COm5SOQdiFjY818dYFHJbMGuLBszpF07LBWmOS1uzrHa9VGdynsEgoeKy0oOQ==} + engines: {node: '>=20'} + + yallist@5.0.0: + resolution: {integrity: sha512-YgvUTfwqyc7UXVMrB+SImsVYSmTS8X/tSrtdNZMImM+n7+QTriRXyXim0mBrTXNeqzVF0KWGgHPeiyViFFrNDw==} + engines: {node: '>=18'} + + yoctocolors@2.2.0: + resolution: {integrity: sha512-xYqdZFUK/VYazNl/oCDYN+3WloWQwMfZxBoiNt6qNyk+xfOdi598muWE42rNZFp1kNOiqW936q5RhUdnpqElSg==} + engines: {node: '>=18'} + + zod@4.6.7: + resolution: {integrity: sha512-g8W2D2kU6a8untc053fX1uVBKzM7yqAxW/3zwk83+6RyF2+SKOuV+c0wBDhUwzV1PaGapmZH+rmcUzPf+3CGwg==} + +snapshots: + + '@angular-devkit/core@22.2.7(chokidar@5.0.0)': + dependencies: + ajv: 8.20.0 + ajv-formats: 3.0.1(ajv@8.20.0) + jsonc-parser: 3.3.1 + picomatch: 4.0.7 + rxjs: 7.8.2 + source-map: 0.8.0 + optionalDependencies: + chokidar: 5.0.0 + + '@angular-devkit/schematics-cli@22.2.7(chokidar@5.0.0)': + dependencies: + '@angular-devkit/core': 22.2.7(chokidar@5.0.0) + '@angular-devkit/schematics': 22.2.7(chokidar@5.0.0) + '@inquirer/prompts': 8.7.2 + transitivePeerDependencies: + - '@types/node' + - chokidar + + '@angular-devkit/schematics@22.2.7(chokidar@5.0.0)': + dependencies: + '@angular-devkit/core': 22.2.7(chokidar@5.0.0) + jsonc-parser: 3.3.1 + magic-string: 1.4.1 + ora: 9.4.1 + rxjs: 7.8.2 + transitivePeerDependencies: + - chokidar + + '@emnapi/core@2.0.0-beta.2': + dependencies: + '@emnapi/wasi-threads': 2.2.0 + tslib: 2.9.1 + optional: true + + '@emnapi/runtime@2.0.0-beta.2': + dependencies: + tslib: 2.9.1 + optional: true + + '@emnapi/wasi-threads@2.2.0': + dependencies: + tslib: 2.9.1 + optional: true + + '@inquirer/ansi@2.1.0': {} + + '@inquirer/checkbox@5.3.0': + dependencies: + '@inquirer/ansi': 2.1.0 + '@inquirer/core': 12.1.0 + '@inquirer/figures': 2.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/confirm@6.4.0': + dependencies: + '@inquirer/core': 12.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/core@12.1.0': + dependencies: + '@inquirer/ansi': 2.1.0 + '@inquirer/figures': 2.1.0 + '@inquirer/type': 4.3.0 + cli-width: 4.1.0 + fast-wrap-ansi: 0.2.2 + mute-stream: 4.0.0 + signal-exit: 4.1.0 + + '@inquirer/editor@5.4.0': + dependencies: + '@inquirer/core': 12.1.0 + '@inquirer/external-editor': 3.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/expand@5.2.0': + dependencies: + '@inquirer/core': 12.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/external-editor@3.1.0': + dependencies: + chardet: 2.2.0 + iconv-lite: 0.7.3 + + '@inquirer/figures@2.1.0': {} + + '@inquirer/input@5.2.0': + dependencies: + '@inquirer/core': 12.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/number@4.3.0': + dependencies: + '@inquirer/core': 12.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/password@5.3.0': + dependencies: + '@inquirer/ansi': 2.1.0 + '@inquirer/core': 12.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/prompts@8.7.2': + dependencies: + '@inquirer/checkbox': 5.3.0 + '@inquirer/confirm': 6.4.0 + '@inquirer/editor': 5.4.0 + '@inquirer/expand': 5.2.0 + '@inquirer/input': 5.2.0 + '@inquirer/number': 4.3.0 + '@inquirer/password': 5.3.0 + '@inquirer/rawlist': 5.4.0 + '@inquirer/search': 4.4.0 + '@inquirer/select': 5.3.0 + + '@inquirer/prompts@8.8.0': + dependencies: + '@inquirer/checkbox': 5.3.0 + '@inquirer/confirm': 6.4.0 + '@inquirer/editor': 5.4.0 + '@inquirer/expand': 5.2.0 + '@inquirer/input': 5.2.0 + '@inquirer/number': 4.3.0 + '@inquirer/password': 5.3.0 + '@inquirer/rawlist': 5.4.0 + '@inquirer/search': 4.4.0 + '@inquirer/select': 5.3.0 + + '@inquirer/rawlist@5.4.0': + dependencies: + '@inquirer/core': 12.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/search@4.4.0': + dependencies: + '@inquirer/core': 12.1.0 + '@inquirer/figures': 2.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/select@5.3.0': + dependencies: + '@inquirer/ansi': 2.1.0 + '@inquirer/core': 12.1.0 + '@inquirer/figures': 2.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/type@4.3.0': {} + + '@isaacs/fs-minipass@4.0.1': + dependencies: + minipass: 7.1.3 + + '@jridgewell/sourcemap-codec@1.6.0': {} + + '@nanoforge-dev/asset@3.0.0': + dependencies: + '@nanoforge-dev/common': 3.0.0 + + '@nanoforge-dev/cli@3.0.1': + dependencies: + '@angular-devkit/schematics': 22.2.7(chokidar@5.0.0) + '@angular-devkit/schematics-cli': 22.2.7(chokidar@5.0.0) + '@inquirer/prompts': 8.8.0 + '@nanoforge-dev/config': 3.0.1 + '@nanoforge-dev/editor': 0.1.4 + '@nanoforge-dev/loader-client': 1.7.0 + '@nanoforge-dev/loader-server': 1.7.0 + '@nanoforge-dev/registry': 3.0.1 + '@nanoforge-dev/schematics': 3.0.1(chokidar@5.0.0) + ansis: 4.5.0 + bun: 1.4.4 + chokidar: 5.0.0 + commander: 15.1.0 + dotenv: 18.0.10 + node-emoji: 2.2.0 + open: 11.0.4 + ora: 9.4.1 + rc9: 3.1.0 + transitivePeerDependencies: + - '@types/node' + - synckit + + '@nanoforge-dev/common@3.0.0': {} + + '@nanoforge-dev/config@3.0.1': + dependencies: + unrun: 0.3.1 + zod: 4.6.7 + transitivePeerDependencies: + - synckit + + '@nanoforge-dev/core@3.0.0': + dependencies: + '@nanoforge-dev/asset': 3.0.0 + '@nanoforge-dev/common': 3.0.0 + + '@nanoforge-dev/ecs@3.0.0(@nanoforge-dev/editor-lib@3.0.0)': + dependencies: + '@nanoforge-dev/common': 3.0.0 + optionalDependencies: + '@nanoforge-dev/editor-lib': 3.0.0 + + '@nanoforge-dev/editor-lib@3.0.0': + dependencies: + '@nanoforge-dev/common': 3.0.0 + + '@nanoforge-dev/editor@0.1.4': + dependencies: + bun: 1.4.4 + class-transformer: 0.5.1 + class-validator: 0.15.1 + dotenv: 17.4.2 + micromatch: 4.0.8 + tar: 7.5.23 + typescript: 6.0.3 + + '@nanoforge-dev/env@3.0.0': + dependencies: + '@nanoforge-dev/common': 3.0.0 + class-transformer: 0.5.1 + class-validator: 0.14.4 + + '@nanoforge-dev/graphics-2d@3.0.0': + dependencies: + '@nanoforge-dev/common': 3.0.0 + konva: 10.9.1 + transitivePeerDependencies: + - canvas + - skia-canvas + + '@nanoforge-dev/input@3.0.0': + dependencies: + '@nanoforge-dev/common': 3.0.0 + + '@nanoforge-dev/loader-client@1.7.0': + dependencies: + '@nanoforge-dev/loader-website': 1.7.0 + bun: 1.4.4 + commander: 15.1.0 + + '@nanoforge-dev/loader-server@1.7.0': + dependencies: + bun: 1.4.4 + commander: 15.1.0 + + '@nanoforge-dev/loader-website@1.7.0': {} + + '@nanoforge-dev/registry@3.0.1': + dependencies: + fflate: 0.8.3 + semver: 7.8.6 + zod: 4.6.7 + + '@nanoforge-dev/schematics@3.0.1(chokidar@5.0.0)': + dependencies: + '@angular-devkit/core': 22.2.7(chokidar@5.0.0) + '@angular-devkit/schematics': 22.2.7(chokidar@5.0.0) + rxjs: 7.8.2 + transitivePeerDependencies: + - chokidar + + '@napi-rs/wasm-runtime@1.2.6(@emnapi/core@2.0.0-beta.2)(@emnapi/runtime@2.0.0-beta.2)': + dependencies: + '@emnapi/core': 2.0.0-beta.2 + '@emnapi/runtime': 2.0.0-beta.2 + '@tybys/wasm-util': 0.10.4 + optional: true + + '@oven/bun-darwin-aarch64@1.4.4': + optional: true + + '@oven/bun-darwin-x64@1.4.4': + optional: true + + '@oven/bun-freebsd-aarch64@1.4.4': + optional: true + + '@oven/bun-freebsd-x64@1.4.4': + optional: true + + '@oven/bun-linux-aarch64-android@1.4.4': + optional: true + + '@oven/bun-linux-aarch64-musl@1.4.4': + optional: true + + '@oven/bun-linux-aarch64@1.4.4': + optional: true + + '@oven/bun-linux-x64-android@1.4.4': + optional: true + + '@oven/bun-linux-x64-musl@1.4.4': + optional: true + + '@oven/bun-linux-x64@1.4.4': + optional: true + + '@oven/bun-windows-aarch64@1.4.4': + optional: true + + '@oven/bun-windows-x64@1.4.4': + optional: true + + '@oxc-project/types@0.158.0': {} + + '@rolldown/binding-android-arm-eabi@1.3.2': + optional: true + + '@rolldown/binding-android-arm64@1.3.2': + optional: true + + '@rolldown/binding-darwin-arm64@1.3.2': + optional: true + + '@rolldown/binding-darwin-x64@1.3.2': + optional: true + + '@rolldown/binding-freebsd-x64@1.3.2': + optional: true + + '@rolldown/binding-linux-arm-gnueabihf@1.3.2': + optional: true + + '@rolldown/binding-linux-arm64-gnu@1.3.2': + optional: true + + '@rolldown/binding-linux-arm64-musl@1.3.2': + optional: true + + '@rolldown/binding-linux-ppc64-gnu@1.3.2': + optional: true + + '@rolldown/binding-linux-s390x-gnu@1.3.2': + optional: true + + '@rolldown/binding-linux-x64-gnu@1.3.2': + optional: true + + '@rolldown/binding-linux-x64-musl@1.3.2': + optional: true + + '@rolldown/binding-openharmony-arm64@1.3.2': + optional: true + + '@rolldown/binding-wasm32-wasi@1.3.2': + dependencies: + '@emnapi/core': 2.0.0-beta.2 + '@emnapi/runtime': 2.0.0-beta.2 + '@napi-rs/wasm-runtime': 1.2.6(@emnapi/core@2.0.0-beta.2)(@emnapi/runtime@2.0.0-beta.2) + optional: true + + '@rolldown/binding-win32-arm64-msvc@1.3.2': + optional: true + + '@rolldown/binding-win32-x64-msvc@1.3.2': + optional: true + + '@rolldown/pluginutils@1.1.0': {} + + '@sindresorhus/is@4.6.0': {} + + '@tybys/wasm-util@0.10.4': + dependencies: + tslib: 2.9.1 + optional: true + + '@types/validator@13.15.10': {} + + ajv-formats@3.0.1(ajv@8.20.0): + optionalDependencies: + ajv: 8.20.0 + + ajv@8.20.0: + dependencies: + fast-deep-equal: 3.1.3 + fast-uri: 3.1.9 + json-schema-traverse: 1.0.0 + require-from-string: 2.0.2 + + ansi-regex@6.6.0: {} + + ansis@4.5.0: {} + + braces@3.0.3: + dependencies: + fill-range: 7.1.1 + + bun@1.4.4: + optionalDependencies: + '@oven/bun-darwin-aarch64': 1.4.4 + '@oven/bun-darwin-x64': 1.4.4 + '@oven/bun-freebsd-aarch64': 1.4.4 + '@oven/bun-freebsd-x64': 1.4.4 + '@oven/bun-linux-aarch64': 1.4.4 + '@oven/bun-linux-aarch64-android': 1.4.4 + '@oven/bun-linux-aarch64-musl': 1.4.4 + '@oven/bun-linux-x64': 1.4.4 + '@oven/bun-linux-x64-android': 1.4.4 + '@oven/bun-linux-x64-musl': 1.4.4 + '@oven/bun-windows-aarch64': 1.4.4 + '@oven/bun-windows-x64': 1.4.4 + + bundle-name@4.1.1: + dependencies: + run-applescript: 7.1.0 + + chalk@5.6.2: {} + + char-regex@1.0.2: {} + + chardet@2.2.0: {} + + chokidar@5.0.0: + dependencies: + readdirp: 5.1.1 + + chownr@3.0.0: {} + + class-transformer@0.5.1: {} + + class-validator@0.14.4: + dependencies: + '@types/validator': 13.15.10 + libphonenumber-js: 1.13.16 + validator: 13.15.35 + + class-validator@0.15.1: + dependencies: + '@types/validator': 13.15.10 + libphonenumber-js: 1.13.16 + validator: 13.15.35 + + cli-cursor@5.0.0: + dependencies: + restore-cursor: 5.1.0 + + cli-spinners@3.4.0: {} + + cli-width@4.1.0: {} + + commander@15.1.0: {} + + default-browser-id@5.0.1: {} + + default-browser@5.5.1: + dependencies: + bundle-name: 4.1.1 + default-browser-id: 5.0.1 + + define-lazy-prop@3.0.0: {} + + defu@6.1.7: {} + + destr@2.0.5: {} + + dotenv@17.4.2: {} + + dotenv@18.0.10: {} + + emojilib@2.4.0: {} + + fast-deep-equal@3.1.3: {} + + fast-string-truncated-width@3.0.3: {} + + fast-string-width@3.0.2: + dependencies: + fast-string-truncated-width: 3.0.3 + + fast-uri@3.1.9: {} + + fast-wrap-ansi@0.2.2: + dependencies: + fast-string-width: 3.0.2 + + fflate@0.8.3: {} + + fill-range@7.1.1: + dependencies: + to-regex-range: 5.0.1 + + get-east-asian-width@1.7.0: {} + + iconv-lite@0.7.3: + dependencies: + safer-buffer: 2.1.2 + + is-docker@3.0.0: {} + + is-in-ssh@1.0.0: {} + + is-inside-container@1.0.0: + dependencies: + is-docker: 3.0.0 + + is-interactive@2.0.0: {} + + is-number@7.0.0: {} + + is-unicode-supported@2.1.0: {} + + is-wsl@3.1.1: + dependencies: + is-inside-container: 1.0.0 + + json-schema-traverse@1.0.0: {} + + jsonc-parser@3.3.1: {} + + konva@10.9.1: {} + + libphonenumber-js@1.13.16: {} + + log-symbols@7.0.1: + dependencies: + is-unicode-supported: 2.1.0 + yoctocolors: 2.2.0 + + magic-string@1.4.1: + dependencies: + '@jridgewell/sourcemap-codec': 1.6.0 + + micromatch@4.0.8: + dependencies: + braces: 3.0.3 + picomatch: 2.3.2 + + mimic-function@5.0.1: {} + + minipass@7.1.3: {} + + minizlib@3.1.0: + dependencies: + minipass: 7.1.3 + + mute-stream@4.0.0: {} + + node-emoji@2.2.0: + dependencies: + '@sindresorhus/is': 4.6.0 + char-regex: 1.0.2 + emojilib: 2.4.0 + skin-tone: 2.0.0 + + onetime@7.0.0: + dependencies: + mimic-function: 5.0.1 + + open@11.0.4: + dependencies: + default-browser: 5.5.1 + define-lazy-prop: 3.0.0 + is-in-ssh: 1.0.0 + is-inside-container: 1.0.0 + powershell-utils: 0.2.1 + wsl-utils: 1.0.1 + + ora@9.4.1: + dependencies: + chalk: 5.6.2 + cli-cursor: 5.0.0 + cli-spinners: 3.4.0 + is-interactive: 2.0.0 + is-unicode-supported: 2.1.0 + log-symbols: 7.0.1 + stdin-discarder: 0.3.2 + string-width: 8.3.0 + + picomatch@2.3.2: {} + + picomatch@4.0.7: {} + + powershell-utils@0.2.1: {} + + rc9@3.1.0: + dependencies: + defu: 6.1.7 + destr: 2.0.5 + + readdirp@5.1.1: {} + + require-from-string@2.0.2: {} + + restore-cursor@5.1.0: + dependencies: + onetime: 7.0.0 + signal-exit: 4.1.0 + + rolldown@1.3.2: + dependencies: + '@oxc-project/types': 0.158.0 + '@rolldown/pluginutils': 1.1.0 + optionalDependencies: + '@rolldown/binding-android-arm-eabi': 1.3.2 + '@rolldown/binding-android-arm64': 1.3.2 + '@rolldown/binding-darwin-arm64': 1.3.2 + '@rolldown/binding-darwin-x64': 1.3.2 + '@rolldown/binding-freebsd-x64': 1.3.2 + '@rolldown/binding-linux-arm-gnueabihf': 1.3.2 + '@rolldown/binding-linux-arm64-gnu': 1.3.2 + '@rolldown/binding-linux-arm64-musl': 1.3.2 + '@rolldown/binding-linux-ppc64-gnu': 1.3.2 + '@rolldown/binding-linux-s390x-gnu': 1.3.2 + '@rolldown/binding-linux-x64-gnu': 1.3.2 + '@rolldown/binding-linux-x64-musl': 1.3.2 + '@rolldown/binding-openharmony-arm64': 1.3.2 + '@rolldown/binding-wasm32-wasi': 1.3.2 + '@rolldown/binding-win32-arm64-msvc': 1.3.2 + '@rolldown/binding-win32-x64-msvc': 1.3.2 + + run-applescript@7.1.0: {} + + rxjs@7.8.2: + dependencies: + tslib: 2.9.1 + + safer-buffer@2.1.2: {} + + semver@7.8.6: {} + + signal-exit@4.1.0: {} + + skin-tone@2.0.0: + dependencies: + unicode-emoji-modifier-base: 1.0.0 + + source-map@0.8.0: {} + + stdin-discarder@0.3.2: {} + + string-width@8.3.0: + dependencies: + get-east-asian-width: 1.7.0 + strip-ansi: 7.2.0 + + strip-ansi@7.2.0: + dependencies: + ansi-regex: 6.6.0 + + tar@7.5.23: + dependencies: + '@isaacs/fs-minipass': 4.0.1 + chownr: 3.0.0 + minipass: 7.1.3 + minizlib: 3.1.0 + yallist: 5.0.0 + + to-regex-range@5.0.1: + dependencies: + is-number: 7.0.0 + + tslib@2.9.1: {} + + typescript@6.0.3: {} + + unicode-emoji-modifier-base@1.0.0: {} + + unrun@0.3.1: + dependencies: + rolldown: 1.3.2 + + validator@13.15.35: {} + + wsl-utils@1.0.1: + dependencies: + is-wsl: 3.1.1 + powershell-utils: 0.2.1 + + yallist@5.0.0: {} + + yoctocolors@2.2.0: {} + + zod@4.6.7: {} diff --git a/basics/input-gamepad/pnpm-workspace.yaml b/basics/input-gamepad/pnpm-workspace.yaml new file mode 100644 index 0000000..96ca535 --- /dev/null +++ b/basics/input-gamepad/pnpm-workspace.yaml @@ -0,0 +1,5 @@ +allowBuilds: + bun: true +# NanoForge packages are ours: take a release as soon as it is out. +minimumReleaseAgeExclude: + - "@nanoforge-dev/*" diff --git a/basics/input-gamepad/src/components/acceleration-2d.component.ts b/basics/input-gamepad/src/components/acceleration-2d.component.ts new file mode 100644 index 0000000..5d4097f --- /dev/null +++ b/basics/input-gamepad/src/components/acceleration-2d.component.ts @@ -0,0 +1,18 @@ +/** + * How fast the velocity of an entity changes, in pixels per second, per second. Needs + * `Velocity2D` and the `move2D` system. + * + * @component + * @side shared + * @group Acceleration color=#f0a33a - Pixels per second, per second. + */ +export class Acceleration2D { + name = "Acceleration2D"; + + constructor( + /** Added to the horizontal velocity every second. @group Acceleration @preset vector.x */ + public x = 0, + /** Added to the vertical velocity every second. @group Acceleration @preset vector.y */ + public y = 0, + ) {} +} diff --git a/basics/input-gamepad/src/components/controller-move-2d.component.ts b/basics/input-gamepad/src/components/controller-move-2d.component.ts new file mode 100644 index 0000000..a70b368 --- /dev/null +++ b/basics/input-gamepad/src/components/controller-move-2d.component.ts @@ -0,0 +1,22 @@ +import { ControllerButton } from "@nanoforge-dev/input/controller"; + +/** + * Moves an entity with a controller's left stick, by setting its `Velocity2D`; holding a button + * speeds it up, and pressing it makes the controller rumble. Needs the `controllerMove2D` system. + * + * @component + * @side client + * @group Movement color=#9d7bff - How the entity moves. + */ +export class ControllerMove2D { + name = "ControllerMove2D"; + + constructor( + /** In pixels per second, with the stick pushed all the way. @group Movement */ + public speed = 300, + /** The controller that moves it: 0 for the first one. @group Movement */ + public controller = 0, + /** Held: twice the speed. @group Movement */ + public boost: ControllerButton = ControllerButton.A, + ) {} +} diff --git a/basics/input-gamepad/src/components/controller-status.component.ts b/basics/input-gamepad/src/components/controller-status.component.ts new file mode 100644 index 0000000..05db2e0 --- /dev/null +++ b/basics/input-gamepad/src/components/controller-status.component.ts @@ -0,0 +1,15 @@ +/** + * Writes whether a controller is connected in the entity's `DrawableText2D`. Needs the + * `showControllerStatus` system. + * + * @component + * @side client + */ +export class ControllerStatus { + name = "ControllerStatus"; + + constructor( + /** The controller to watch: 0 for the first one. */ + public controller = 0, + ) {} +} diff --git a/basics/input-gamepad/src/components/drawable-circle-2d.component.ts b/basics/input-gamepad/src/components/drawable-circle-2d.component.ts new file mode 100644 index 0000000..1066155 --- /dev/null +++ b/basics/input-gamepad/src/components/drawable-circle-2d.component.ts @@ -0,0 +1,62 @@ +import type { AssetContext } from "@nanoforge-dev/common"; +import { Circle, type Layer } from "@nanoforge-dev/graphics-2d"; +import type { Position2D } from "./position-2d.component"; + +import { imageFill } from "../image-fill"; + +/** + * Draws a circle at the entity's `Position2D` (its center). Needs the `draw2D` system. + * + * @remarks + * `shape` is the Konva `Circle` on screen: change it from code for anything the parameters don't + * offer (shadows, strokes...). + * + * @component + * @side client + * @group Shape color=#e86fb0 - Size of the circle. + * @group Look color=#b18cff - What the circle looks like. + * @group Advanced hidden - Less common settings. + */ +export class DrawableCircle2D { + name = "DrawableCircle2D"; + + /** The circle on screen, made by `draw2D` the first time it draws it. */ + shape?: Circle; + + constructor( + /** In pixels. @group Shape */ + public radius = 25, + /** A CSS color: `red`, `#ff0000`, `rgba(255, 0, 0, 0.5)`... @group Look @preset color */ + public fillColor = "#4aa3ff", + /** An image stretched over the circle, shown instead of the color. @group Look @asset .png .jpg .jpeg .gif .webp .svg */ + public image = "", + /** From 0 (invisible) to 1 (opaque). @group Look */ + public opacity = 1, + /** Clockwise, in degrees, around the center. @group Advanced */ + public rotation = 0, + /** Whether it is drawn. @group Advanced */ + public visible = true, + ) {} + + /** Puts the circle on `layer` at `position`, up to date with the parameters. */ + draw(layer: Layer, position: Position2D, assets: AssetContext): void { + this.shape ??= new Circle(); + if (this.shape.getParent() !== layer) layer.add(this.shape); + this.shape.setAttrs({ + x: position.x, + y: position.y, + radius: this.radius, + fill: this.fillColor, + opacity: this.opacity, + rotation: this.rotation, + visible: this.visible, + ...imageFill(assets, this.image, this.radius * 2, this.radius * 2, true), + }); + } + + /** Removes the circle from the screen. */ + destroy(): void { + this.shape?.destroy(); + this.shape = undefined; + } +} diff --git a/basics/input-gamepad/src/components/drawable-rect-2d.component.ts b/basics/input-gamepad/src/components/drawable-rect-2d.component.ts new file mode 100644 index 0000000..d3586ca --- /dev/null +++ b/basics/input-gamepad/src/components/drawable-rect-2d.component.ts @@ -0,0 +1,69 @@ +import type { AssetContext } from "@nanoforge-dev/common"; +import { type Layer, Rect } from "@nanoforge-dev/graphics-2d"; +import type { Position2D } from "./position-2d.component"; + +import { imageFill } from "../image-fill"; + +/** + * Draws a rectangle at the entity's `Position2D` (its top-left corner). Needs the `draw2D` + * system. + * + * @remarks + * `shape` is the Konva `Rect` on screen: change it from code for anything the parameters don't + * offer (shadows, strokes...). + * + * @component + * @side client + * @group Shape color=#e86fb0 - Size of the rectangle. + * @group Look color=#b18cff - What the rectangle looks like. + * @group Advanced hidden - Less common settings. + */ +export class DrawableRect2D { + name = "DrawableRect2D"; + + /** The rectangle on screen, made by `draw2D` the first time it draws it. */ + shape?: Rect; + + constructor( + /** In pixels. @group Shape @preset size.width */ + public width = 50, + /** In pixels. @group Shape @preset size.height */ + public height = 50, + /** A CSS color: `red`, `#ff0000`, `rgba(255, 0, 0, 0.5)`... @group Look @preset color */ + public fillColor = "#4aa3ff", + /** An image stretched over the rectangle, shown instead of the color. @group Look @asset .png .jpg .jpeg .gif .webp .svg */ + public image = "", + /** From 0 (invisible) to 1 (opaque). @group Look */ + public opacity = 1, + /** Clockwise, in degrees, around the top-left corner. @group Advanced */ + public rotation = 0, + /** Rounds the corners, in pixels. @group Advanced */ + public cornerRadius = 0, + /** Whether it is drawn. @group Advanced */ + public visible = true, + ) {} + + /** Puts the rectangle on `layer` at `position`, up to date with the parameters. */ + draw(layer: Layer, position: Position2D, assets: AssetContext): void { + this.shape ??= new Rect(); + if (this.shape.getParent() !== layer) layer.add(this.shape); + this.shape.setAttrs({ + x: position.x, + y: position.y, + width: this.width, + height: this.height, + fill: this.fillColor, + opacity: this.opacity, + rotation: this.rotation, + cornerRadius: this.cornerRadius, + visible: this.visible, + ...imageFill(assets, this.image, this.width, this.height), + }); + } + + /** Removes the rectangle from the screen. */ + destroy(): void { + this.shape?.destroy(); + this.shape = undefined; + } +} diff --git a/basics/input-gamepad/src/components/drawable-text-2d.component.ts b/basics/input-gamepad/src/components/drawable-text-2d.component.ts new file mode 100644 index 0000000..adba963 --- /dev/null +++ b/basics/input-gamepad/src/components/drawable-text-2d.component.ts @@ -0,0 +1,62 @@ +import { type Layer, Text } from "@nanoforge-dev/graphics-2d"; +import type { Position2D } from "./position-2d.component"; + +/** + * Draws a text at the entity's `Position2D` (its top-left corner). Needs the `draw2D` system. + * + * @remarks + * Change `text` from a system to show a score, a timer... `shape` is the Konva `Text` on screen: + * change it from code for anything the parameters don't offer. + * + * @component + * @side client + * @group Text color=#e86fb0 - What is written. + * @group Look color=#b18cff - What the text looks like. + * @group Advanced hidden - Less common settings. + */ +export class DrawableText2D { + name = "DrawableText2D"; + + /** The text on screen, made by `draw2D` the first time it draws it. */ + shape?: Text; + + constructor( + /** What is written. @group Text */ + public text = "Hello", + /** Height of the letters, in pixels. @group Text */ + public fontSize = 24, + /** A CSS color: `white`, `#ffffff`... @group Look @preset color */ + public fillColor = "#ffffff", + /** From 0 (invisible) to 1 (opaque). @group Look */ + public opacity = 1, + /** A CSS font family: `Arial`, `monospace`... @group Advanced */ + public fontFamily = "Arial", + /** Clockwise, in degrees, around the top-left corner. @group Advanced */ + public rotation = 0, + /** Whether it is drawn. @group Advanced */ + public visible = true, + ) {} + + /** Puts the text on `layer` at `position`, up to date with the parameters. */ + draw(layer: Layer, position: Position2D): void { + this.shape ??= new Text(); + if (this.shape.getParent() !== layer) layer.add(this.shape); + this.shape.setAttrs({ + x: position.x, + y: position.y, + text: this.text, + fontSize: this.fontSize, + fontFamily: this.fontFamily, + fill: this.fillColor, + opacity: this.opacity, + rotation: this.rotation, + visible: this.visible, + }); + } + + /** Removes the text from the screen. */ + destroy(): void { + this.shape?.destroy(); + this.shape = undefined; + } +} diff --git a/basics/input-gamepad/src/components/position-2d.component.ts b/basics/input-gamepad/src/components/position-2d.component.ts new file mode 100644 index 0000000..0a35624 --- /dev/null +++ b/basics/input-gamepad/src/components/position-2d.component.ts @@ -0,0 +1,20 @@ +/** + * Where an entity is, in pixels from the top-left corner of the screen. + * + * @remarks + * For rectangles it is their top-left corner, for circles their center. + * + * @component + * @side shared + * @group Position color=#4aa3ff - Pixels from the top-left corner of the screen. + */ +export class Position2D { + name = "Position2D"; + + constructor( + /** Pixels from the left edge. @group Position @preset vector.x */ + public x = 0, + /** Pixels from the top edge. @group Position @preset vector.y */ + public y = 0, + ) {} +} diff --git a/basics/input-gamepad/src/components/velocity-2d.component.ts b/basics/input-gamepad/src/components/velocity-2d.component.ts new file mode 100644 index 0000000..3b93d4e --- /dev/null +++ b/basics/input-gamepad/src/components/velocity-2d.component.ts @@ -0,0 +1,20 @@ +/** + * How fast an entity moves, in pixels per second. Needs `Position2D` and the `move2D` system. + * + * @example + * `new Velocity2D(100, 0)` moves 100 pixels to the right every second. + * + * @component + * @side shared + * @group Velocity color=#36c5a0 - Pixels per second. + */ +export class Velocity2D { + name = "Velocity2D"; + + constructor( + /** Pixels per second to the right (negative: to the left). @group Velocity @preset vector.x */ + public x = 0, + /** Pixels per second downward (negative: upward). @group Velocity @preset vector.y */ + public y = 0, + ) {} +} diff --git a/basics/input-gamepad/src/image-fill.ts b/basics/input-gamepad/src/image-fill.ts new file mode 100644 index 0000000..c7fc737 --- /dev/null +++ b/basics/input-gamepad/src/image-fill.ts @@ -0,0 +1,43 @@ +import type { AssetContext } from "@nanoforge-dev/common"; +import type { ShapeConfig } from "@nanoforge-dev/graphics-2d"; + +const images = new Map(); + +/** + * The fill of a shape of `width` by `height` pixels showing the image at `path` (an asset path + * such as `/textures/hero.png`, found in `assets`) stretched over it. Without an image, until it + * is loaded, or when there is no asset at `path`, the shape is filled with its color. + * + * @param centered - Whether the shape's origin is its center (a circle) instead of its top-left + * corner (a rectangle). + */ +export const imageFill = ( + assets: AssetContext, + path: string, + width: number, + height: number, + centered = false, +): ShapeConfig => { + if (!path) return { fillPriority: "color", fillPatternImage: undefined }; + let image = images.get(path); + if (!image) { + image = document.createElement("img"); + try { + image.src = assets.getAsset(path).path; + } catch (error) { + // Once per path, not every frame: the shape keeps its color. + console.warn(`No image at "${path}":`, error); + } + images.set(path, image); + } + if (!image.naturalWidth) return { fillPriority: "color", fillPatternImage: undefined }; + return { + fillPriority: "pattern", + fillPatternImage: image, + fillPatternRepeat: "no-repeat", + fillPatternScaleX: width / image.naturalWidth, + fillPatternScaleY: height / image.naturalHeight, + fillPatternOffsetX: centered ? image.naturalWidth / 2 : 0, + fillPatternOffsetY: centered ? image.naturalHeight / 2 : 0, + }; +}; diff --git a/basics/input-gamepad/src/main.ts b/basics/input-gamepad/src/main.ts new file mode 100644 index 0000000..128b7ca --- /dev/null +++ b/basics/input-gamepad/src/main.ts @@ -0,0 +1,63 @@ +import type { ClientRunOptions } from "@nanoforge-dev/common"; +import { NanoforgeFactory } from "@nanoforge-dev/core"; +import { EcsLibrary } from "@nanoforge-dev/ecs/client"; +import { EditorLibrary } from "@nanoforge-dev/editor-lib"; +import { Graphics2DLibrary } from "@nanoforge-dev/graphics-2d"; +import { ControllerButton, ControllerLibrary } from "@nanoforge-dev/input/controller"; + +import { ControllerMove2D } from "./components/controller-move-2d.component"; +import { ControllerStatus } from "./components/controller-status.component"; +import { DrawableRect2D } from "./components/drawable-rect-2d.component"; +import { DrawableText2D } from "./components/drawable-text-2d.component"; +import { Position2D } from "./components/position-2d.component"; +import { Velocity2D } from "./components/velocity-2d.component"; +import { controllerMove2D } from "./systems/controller-move-2d.system"; +import { draw2D } from "./systems/draw-2d.system"; +import { move2D } from "./systems/move-2d.system"; +import { showControllerStatus } from "./systems/show-controller-status.system"; + +export const main = async (options: ClientRunOptions): Promise => { + const app = NanoforgeFactory.createClient({ + tickRate: 60, + viewport: { width: 800, height: 600, fit: "contain" }, + }); + const ecs = new EcsLibrary(); + + app.use(new Graphics2DLibrary()); + app.use(ecs); + app.use(new ControllerLibrary({ deadzone: 0.15 })); + app.use(new EditorLibrary()); + + await app.init(options); + + const registry = ecs.registry; + + const background = registry.spawnEntity(); + registry.addComponent(background, new Position2D(0, 0)); + registry.addComponent(background, new DrawableRect2D(800, 600, "#1e1e2e")); + + const help = registry.spawnEntity(); + registry.addComponent(help, new Position2D(20, 20)); + registry.addComponent( + help, + new DrawableText2D("Left stick to move, hold A to go faster", 24, "#cdd6f4"), + ); + + const status = registry.spawnEntity(); + registry.addComponent(status, new Position2D(20, 560)); + registry.addComponent(status, new DrawableText2D("", 18, "#a6adc8")); + registry.addComponent(status, new ControllerStatus(0)); + + const player = registry.spawnEntity(); + registry.addComponent(player, new Position2D(370, 270)); + registry.addComponent(player, new Velocity2D(0, 0)); + registry.addComponent(player, new ControllerMove2D(300, 0, ControllerButton.A)); + registry.addComponent(player, new DrawableRect2D(60, 60, "#89b4fa")); + + registry.addSystem(controllerMove2D); + registry.addSystem(move2D); + registry.addSystem(showControllerStatus); + registry.addSystem(draw2D); + + await app.run(); +}; diff --git a/basics/input-gamepad/src/systems/controller-move-2d.system.ts b/basics/input-gamepad/src/systems/controller-move-2d.system.ts new file mode 100644 index 0000000..61f0fde --- /dev/null +++ b/basics/input-gamepad/src/systems/controller-move-2d.system.ts @@ -0,0 +1,25 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; +import "@nanoforge-dev/input/controller"; +import { Velocity2D } from "../components/velocity-2d.component"; + +import { ControllerMove2D } from "../components/controller-move-2d.component"; + +/** + * Sets the `Velocity2D` of `ControllerMove2D` entities from their controller's left stick, twice + * as fast while the boost button is held, and rumbles when it is pressed. Add it before `move2D`. + * + * @system + * @side client + */ +export const controllerMove2D = (registry: Registry, ctx: Context) => { + registry.getZipper([ControllerMove2D, Velocity2D]).forEach(({ ControllerMove2D, Velocity2D }) => { + const { speed, controller, boost } = ControllerMove2D as ControllerMove2D; + const stick = ctx.controller.getStick("left", controller); + const factor = ctx.controller.isButtonPressed(boost, controller) ? 2 : 1; + Velocity2D.x = stick.x * speed * factor; + Velocity2D.y = stick.y * speed * factor; + if (ctx.controller.isButtonJustPressed(boost, controller)) + void ctx.controller.vibrate({ duration: 150, strongMagnitude: 0.5 }, controller); + }); +}; diff --git a/basics/input-gamepad/src/systems/draw-2d.system.ts b/basics/input-gamepad/src/systems/draw-2d.system.ts new file mode 100644 index 0000000..937eeeb --- /dev/null +++ b/basics/input-gamepad/src/systems/draw-2d.system.ts @@ -0,0 +1,45 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; +import "@nanoforge-dev/graphics-2d"; +import { Position2D } from "../components/position-2d.component"; + +import { DrawableCircle2D } from "../components/drawable-circle-2d.component"; +import { DrawableRect2D } from "../components/drawable-rect-2d.component"; +import { DrawableText2D } from "../components/drawable-text-2d.component"; + +type Drawable = DrawableRect2D | DrawableCircle2D | DrawableText2D; + +/** The drawables shown by the last frame. */ +let shown = new Set(); + +/** + * Draws every entity that has a `Position2D` and a `DrawableRect2D`, `DrawableCircle2D` or + * `DrawableText2D`, where it is. Add it last, after the systems that move entities. + * + * @remarks + * The shape of a killed entity, or of a removed drawable, is removed from the screen. + * + * @system + * @side client + */ +export const draw2D = (registry: Registry, ctx: Context) => { + const layer = ctx.graphics.baseLayer; + const drawn = new Set(); + + registry.getZipper([DrawableRect2D, Position2D]).forEach(({ DrawableRect2D, Position2D }) => { + DrawableRect2D.draw(layer, Position2D, ctx.assets); + drawn.add(DrawableRect2D); + }); + registry.getZipper([DrawableCircle2D, Position2D]).forEach(({ DrawableCircle2D, Position2D }) => { + DrawableCircle2D.draw(layer, Position2D, ctx.assets); + drawn.add(DrawableCircle2D); + }); + registry.getZipper([DrawableText2D, Position2D]).forEach(({ DrawableText2D, Position2D }) => { + DrawableText2D.draw(layer, Position2D); + drawn.add(DrawableText2D); + }); + + // `killEntity` doesn't call `destroy()`: a drawable no longer in the world loses its shape here. + for (const drawable of shown) if (!drawn.has(drawable)) drawable.destroy(); + shown = drawn; +}; diff --git a/basics/input-gamepad/src/systems/move-2d.system.ts b/basics/input-gamepad/src/systems/move-2d.system.ts new file mode 100644 index 0000000..514766a --- /dev/null +++ b/basics/input-gamepad/src/systems/move-2d.system.ts @@ -0,0 +1,26 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; + +import { Acceleration2D } from "../components/acceleration-2d.component"; +import { Position2D } from "../components/position-2d.component"; +import { Velocity2D } from "../components/velocity-2d.component"; + +/** + * Moves entities: their `Acceleration2D` changes their `Velocity2D`, then their `Velocity2D` + * changes their `Position2D`, by the time elapsed since the last frame. + * + * @system + * @side shared + */ +export const move2D = (registry: Registry, ctx: Context) => { + const seconds = ctx.app.delta / 1000; + + registry.getZipper([Acceleration2D, Velocity2D]).forEach(({ Acceleration2D, Velocity2D }) => { + Velocity2D.x += Acceleration2D.x * seconds; + Velocity2D.y += Acceleration2D.y * seconds; + }); + registry.getZipper([Position2D, Velocity2D]).forEach(({ Position2D, Velocity2D }) => { + Position2D.x += Velocity2D.x * seconds; + Position2D.y += Velocity2D.y * seconds; + }); +}; diff --git a/basics/input-gamepad/src/systems/show-controller-status.system.ts b/basics/input-gamepad/src/systems/show-controller-status.system.ts new file mode 100644 index 0000000..4b4fd1f --- /dev/null +++ b/basics/input-gamepad/src/systems/show-controller-status.system.ts @@ -0,0 +1,25 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; +import "@nanoforge-dev/input/controller"; +import { DrawableText2D } from "../components/drawable-text-2d.component"; + +import { ControllerStatus } from "../components/controller-status.component"; + +/** + * Writes the name of the watched controller, or how to connect one, in the text of every + * `ControllerStatus` entity. + * + * @system + * @side client + */ +export const showControllerStatus = (registry: Registry, ctx: Context) => { + registry + .getZipper([ControllerStatus, DrawableText2D]) + .forEach(({ ControllerStatus, DrawableText2D }) => { + const index = (ControllerStatus as ControllerStatus).controller; + const state = ctx.controller.getController(index); + DrawableText2D.text = state + ? `Controller ${index + 1}: ${state.id}` + : `Controller ${index + 1}: plug it in and press a button`; + }); +}; diff --git a/basics/input-gamepad/tsconfig.json b/basics/input-gamepad/tsconfig.json new file mode 100644 index 0000000..c0ae4f2 --- /dev/null +++ b/basics/input-gamepad/tsconfig.json @@ -0,0 +1,39 @@ +{ + "$schema": "https://json.schemastore.org/tsconfig.json", + // Mapped from https://www.typescriptlang.org/tsconfig + "compilerOptions": { + // Type Checking + "allowUnreachableCode": false, + "allowUnusedLabels": false, + "noFallthroughCasesInSwitch": true, + "noImplicitOverride": true, + "noImplicitReturns": true, + "noPropertyAccessFromIndexSignature": false, + "noUncheckedIndexedAccess": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "strict": true, + + // Modules + "allowArbitraryExtensions": false, + "allowImportingTsExtensions": false, + "module": "ESNext", + "moduleResolution": "Bundler", + "resolveJsonModule": true, + "resolvePackageJsonExports": true, + "resolvePackageJsonImports": true, + + // Interop Constraints + "allowSyntheticDefaultImports": true, + "forceConsistentCasingInFileNames": true, + "isolatedModules": true, + + // Language and Environment + "experimentalDecorators": true, + "lib": ["ESNext", "esnext.disposable", "DOM"], + "target": "ESNext", + "useDefineForClassFields": true + }, + "include": ["src"], + "exclude": ["node_modules", ".nanoforge", "dist"] +} diff --git a/basics/input-keyboard/.gitignore b/basics/input-keyboard/.gitignore new file mode 100644 index 0000000..f28e2dc --- /dev/null +++ b/basics/input-keyboard/.gitignore @@ -0,0 +1,5 @@ +node_modules/ +dist/ +.nanoforge/ +nf_modules/ +.env diff --git a/basics/input-keyboard/README.md b/basics/input-keyboard/README.md new file mode 100644 index 0000000..6484b5c --- /dev/null +++ b/basics/input-keyboard/README.md @@ -0,0 +1,16 @@ +# input-keyboard + +Two squares, moved with the keyboard: the arrows move the red one, WASD the green one. + +It shows the `input` engine library: `MoveController2D` names the keys that move an entity, and +the `moveControl2D` system reads them with `ctx.input.isKeyPressed` and sets the entity's +`Velocity2D`. + +```sh +pnpm install +pnpm dev # play it +pnpm editor # open it in the editor +``` + +The files of `src/components` and `src/systems` are copies of `shared/2d` (see the repository's +README). diff --git a/basics/input-keyboard/assets/.gitkeep b/basics/input-keyboard/assets/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/basics/input-keyboard/nanoforge.config.ts b/basics/input-keyboard/nanoforge.config.ts new file mode 100644 index 0000000..77607cb --- /dev/null +++ b/basics/input-keyboard/nanoforge.config.ts @@ -0,0 +1,5 @@ +import { defineConfig } from "@nanoforge-dev/config"; + +export default defineConfig({ + type: "client", +}); diff --git a/basics/input-keyboard/package.json b/basics/input-keyboard/package.json new file mode 100644 index 0000000..50dc63a --- /dev/null +++ b/basics/input-keyboard/package.json @@ -0,0 +1,26 @@ +{ + "$schema": "https://json.schemastore.org/package.json", + "name": "input-keyboard", + "description": "Move a square with the keyboard: the smallest NanoForge game reading input", + "private": true, + "type": "module", + "scripts": { + "dev": "nf dev", + "build": "nf build", + "start": "nf start", + "editor": "nf editor ." + }, + "devDependencies": { + "@nanoforge-dev/asset": "^3.0.0", + "@nanoforge-dev/cli": "^3.0.1", + "@nanoforge-dev/common": "^3.0.0", + "@nanoforge-dev/config": "^3.0.1", + "@nanoforge-dev/core": "^3.0.0", + "@nanoforge-dev/ecs": "^3.0.0", + "@nanoforge-dev/editor-lib": "^3.0.0", + "@nanoforge-dev/env": "^3.0.0", + "@nanoforge-dev/graphics-2d": "^3.0.0", + "@nanoforge-dev/input": "^3.0.0", + "typescript": "^6.0.0" + } +} diff --git a/basics/input-keyboard/pnpm-lock.yaml b/basics/input-keyboard/pnpm-lock.yaml new file mode 100644 index 0000000..9aca6d9 --- /dev/null +++ b/basics/input-keyboard/pnpm-lock.yaml @@ -0,0 +1,1512 @@ +lockfileVersion: '9.0' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + +importers: + + .: + devDependencies: + '@nanoforge-dev/asset': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/cli': + specifier: ^3.0.1 + version: 3.0.1 + '@nanoforge-dev/common': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/config': + specifier: ^3.0.1 + version: 3.0.1 + '@nanoforge-dev/core': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/ecs': + specifier: ^3.0.0 + version: 3.0.0(@nanoforge-dev/editor-lib@3.0.0) + '@nanoforge-dev/editor-lib': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/env': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/graphics-2d': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/input': + specifier: ^3.0.0 + version: 3.0.0 + typescript: + specifier: ^6.0.0 + version: 6.0.3 + +packages: + + '@angular-devkit/core@22.2.7': + resolution: {integrity: sha512-cchZAMsV4d76RDZBlWzPhYxM/Hb6bmq71oUngdrwehMbBbdQu3W9C2tGlvxuPxbRKru9ZlUa14YVXQ0+QnhFtw==} + engines: {node: ^22.22.3 || ^24.15.0 || >=26.0.0, npm: ^6.11.0 || ^7.5.6 || >=8.0.0, yarn: '>= 1.13.0'} + peerDependencies: + chokidar: ^5.0.0 + peerDependenciesMeta: + chokidar: + optional: true + + '@angular-devkit/schematics-cli@22.2.7': + resolution: {integrity: sha512-9Od0E8TiYTQWm/03QjYWnsryZA8ZSjTf/k5z61nPd/jgloVNvSW8kxC7/YMw+RoXh2idMzjiJxraKxg+gJxzPw==} + engines: {node: ^22.22.3 || ^24.15.0 || >=26.0.0, npm: ^6.11.0 || ^7.5.6 || >=8.0.0, yarn: '>= 1.13.0'} + hasBin: true + + '@angular-devkit/schematics@22.2.7': + resolution: {integrity: sha512-a1h7xNqBLQVo1e5eCyOU3axSbA9AFU6nnSH5QhlNhggfMeZde+eBrueSt25xsewoxlKO8EvkVT3+knMUkDYiGQ==} + engines: {node: ^22.22.3 || ^24.15.0 || >=26.0.0, npm: ^6.11.0 || ^7.5.6 || >=8.0.0, yarn: '>= 1.13.0'} + + '@emnapi/core@2.0.0-beta.2': + resolution: {integrity: sha512-MzCVoWtcg4Pm2B3je5mMvYMvj3MmBKw+fU7vbsJc9/iT8ip6/eYIHo/Dsm/mr+wsHB6SEyJDuxB09Yy6r/8+4A==} + + '@emnapi/runtime@2.0.0-beta.2': + resolution: {integrity: sha512-JcrSPzPvZuNZvJqPTF9Fw25LbOJ8avzFVlaf2grmH4Cku0oGP47tRgqPZadcfj3YoZMHkFVnCYFbQM8I+i5QEw==} + + '@emnapi/wasi-threads@2.2.0': + resolution: {integrity: sha512-JP7OYH38Q7+pyTAe14raZHLQIK7BDKbdwji+Xi3pcd/6QkJYQH3SX4wu6EplGrGJWRepoNzedfm0G3B9Z4e9Rw==} + + '@inquirer/ansi@2.1.0': + resolution: {integrity: sha512-63GU5AD9KhNbWM0jlhHoMJTEFck2upFOPxHlnCKf3xYTV3rjTUUQfodihmTnfYQzMLS29oy8lK/gA1eJgu4bhA==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + + '@inquirer/checkbox@5.3.0': + resolution: {integrity: sha512-3QQSO87A+JoRtOtjtsgX2enwTL+3+VBVrkUpdqrIxMOgn5+W5sE57PcCPAiNUIESHxV4Q6mNEGxq2xLmRa0/yw==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/confirm@6.4.0': + resolution: {integrity: sha512-+DCZxrOF01Q/1SzTQkgycAQPS/Jf+Yol0h1P/MVmopukTsxGOu1h/LKqf30y0eHKFZYYrgUMVhGDhEbPmSPi9A==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/core@12.1.0': + resolution: {integrity: sha512-6H7usRWw4Gdjgpaem10CA5MfZ/xoYPGyInriR1Xubqjv+SVo8LIJ1erpFxW5JgCza6VZVZiKLTko7RtUU3AQMg==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/editor@5.4.0': + resolution: {integrity: sha512-L7vdCe4jnMpzhDisu1tAnr4WGvfPOVz+vNFXyIIL7O2Ycn/n90sn1ARvg+4cwzLf+us51BE/cX7uhnrLcal3+g==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/expand@5.2.0': + resolution: {integrity: sha512-AOp2KQk7QojUyWOP7VkqdBWmxLRaVH58wQMx3N4//P530EDtpVp1EWIjAJubx9ZohWS/UCEpIkA1TuiNki0iOA==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/external-editor@3.1.0': + resolution: {integrity: sha512-27JAkF38nXqXaoveU28iA/+Z8nutnF8B3JsbdToPHn9WnkrsMtZ0/YoJ29YwbtFexYIo+tIy6ikMvTdHKjjmGA==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/figures@2.1.0': + resolution: {integrity: sha512-CR9u2PME23jxy2SOyTb117efwAAPm98Zr+LoWI+PiQ55D6U8Yeu/HyFTxwytKhPa6oxAGzdsm2Kg7oLS6B9z8w==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + + '@inquirer/input@5.2.0': + resolution: {integrity: sha512-sIUPnN2X7M+7dq3RUd+e9QRacYnM+6B+kSucwQgj5VC5Eo/f+CIr2NyPBumxsViI+wzfokkgop/3x3KfHxNyJw==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/number@4.3.0': + resolution: {integrity: sha512-xYkX4sPVgox0F7yQwpz/MByWjOGdLEf1pdjH+Lji2gAzSs2xezz5bN5YgS1n0tx9wo0mRhGvq1KJGtvDZ9XXcQ==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/password@5.3.0': + resolution: {integrity: sha512-KVqW4G/UbMK06uBN76xF89JKYC9YBWU7v+Kc2tUwMCO8pg3ASBr0HVabl1KaSqF94O2KiRu8aKx4EicN78PK+A==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/prompts@8.7.2': + resolution: {integrity: sha512-QoRB4wFIjgH5iOhSjoIKMkTvSHDuV+O3OITlIqAYO0oK5x364GJILXiMBvlPiE+klg7Xx9tq5XVqQHcGUDYYPA==} + engines: {node: '>=23.5.0 || ^22.13.0 || ^20.17.0'} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/prompts@8.8.0': + resolution: {integrity: sha512-yYVT2Eo3mafb9tnU2Mr3+wh5wLCWyspExqVoPSMCIfBIn3ZUTE4IDfbCMbMgXaOH0tH+JZEhOtfczQhDzOjIGg==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/rawlist@5.4.0': + resolution: {integrity: sha512-x42wcy465GM5/mHNKBFdAJbLlLyzmYqr/DEa6F49nHpI+03EFwRCRKeLGQakx5XqZ4unc2yFuS78qAD4Rb0iFA==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/search@4.4.0': + resolution: {integrity: sha512-UJ+9tkzPT1AjnvjuPFYcOdO3BVeN28bfSXajYRFZTRgA9OiNl4k2Nn2cHHPwiIDyPHlvOnmE9ZOHyXhPHtvb+A==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/select@5.3.0': + resolution: {integrity: sha512-Fmgfl0qjqCQo+/tjQpgnRXKh5N7/VpYcJh+AlYU2eHmHZLMGUBDzo+Gwc2ODzWJfXNRZmgaMhz4qULcO/C/rXg==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/type@4.3.0': + resolution: {integrity: sha512-/IA8q2nyjgyl0NGSjqiRXB8gh3We7Pzx9C0c+6Zoolu905jFc79anerrUG7+n65+qs310DRK43yi2WDI8nY59A==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@isaacs/fs-minipass@4.0.1': + resolution: {integrity: sha512-wgm9Ehl2jpeqP3zw/7mo3kRHFp5MEDhqAdwy1fTGkHAwnkGOVsgpvQhL8B5n1qlb01jV3n/bI0ZfZp5lWA1k4w==} + engines: {node: '>=18.0.0'} + + '@jridgewell/sourcemap-codec@1.6.0': + resolution: {integrity: sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw==} + + '@nanoforge-dev/asset@3.0.0': + resolution: {integrity: sha512-jqXcyCMbdcCCj7wZ/dyIpjY8hza02Pt/vY8KrNcaXTlxpTc9EE+VKuO5+fHdUXWWPgJSFt96TqAPhug+z+KH3Q==} + engines: {node: '26'} + + '@nanoforge-dev/cli@3.0.1': + resolution: {integrity: sha512-ZfrbETcAcX3vsPLO1WLSCJc2ERCAcIpbdi9Df5bmH3XLinQkDAcESkN9JkaI/vgV08A7xhTjV8zSDSwF0T73Xg==} + engines: {node: '26'} + hasBin: true + + '@nanoforge-dev/common@3.0.0': + resolution: {integrity: sha512-lzMvQ1vCElh9OcP4EqhffbY+AQXOH4IiuD1pj7VvJlpcY6hh7Bs/s4NVS0gXoJ+ibpBMe5mAq23RyzqTwk8czg==} + engines: {node: '26'} + + '@nanoforge-dev/config@3.0.1': + resolution: {integrity: sha512-XWRScOotb8IirerRx/mWLmUVYye3lo0PN/5a0MUp/eoSrhz0S6zzhGHEupRuC8aeHTjsQT7ctM3P6YyKSHZLaQ==} + engines: {node: '26'} + + '@nanoforge-dev/core@3.0.0': + resolution: {integrity: sha512-pa7Fr3TFkZVfAADBC17Qt5ru/W9vXtYB8e5eb7wurAtu8/jH/ZtqfW3kafTuWC9513MXp/h6LOCdZQhjnCt6UA==} + engines: {node: '26'} + + '@nanoforge-dev/ecs@3.0.0': + resolution: {integrity: sha512-csrXJtCzqohxtvEQs+O//xabnaLR3BXe0QpSpl7NVihF3f0iX2fNYURxNjQKxzoPYBokCnnyNxN2KFc7UmIsdA==} + engines: {node: '26'} + peerDependencies: + '@nanoforge-dev/editor-lib': 3.0.0 + '@nanoforge-dev/scene': 3.0.0 + peerDependenciesMeta: + '@nanoforge-dev/editor-lib': + optional: true + '@nanoforge-dev/scene': + optional: true + + '@nanoforge-dev/editor-lib@3.0.0': + resolution: {integrity: sha512-fSWm6bHelbxqeVESYoUUKDi9RGNxvRu6p1r41KE1DddM0RrP0/WzkFOWBvgl+psHbYNotXe723Y2Fd3p+tqPDQ==} + engines: {node: '26'} + + '@nanoforge-dev/editor@0.1.4': + resolution: {integrity: sha512-bqbrH8ulFSiZz1iisJHtHeEzj1RV/70uErCYHeW4DIhVPsWbBfWKFvg/ghAbmPk5vsj0YnhDX6DSpik4S1QoiQ==} + engines: {node: '25'} + + '@nanoforge-dev/env@3.0.0': + resolution: {integrity: sha512-kXYXl9/09Bn8VStTTFuZY3dYDG9b76VhOi9PHMnaLe75XcFRLKJ2dYkXf3ut6RCL2+6H7HAEIOALjR15CHnJ5A==} + engines: {node: '26'} + + '@nanoforge-dev/graphics-2d@3.0.0': + resolution: {integrity: sha512-0I0WUr5495jORdYR+HtyP4kmAfCMvixmG+EH/gE5bN33S8RO6/Ly4oMLZOLUywcDTAFuLn28BlHuVor2YfXrsg==} + engines: {node: '26'} + + '@nanoforge-dev/input@3.0.0': + resolution: {integrity: sha512-8pWU28c99VAvn37onNbVFfwXTgyQGxm5DVnTdBEzgrF3KPCzU77kEaexB1AWOlga+4qNGU7/XNm3hNZ+YS49Ig==} + engines: {node: '26'} + + '@nanoforge-dev/loader-client@1.7.0': + resolution: {integrity: sha512-zDj0yQ8cZyHHjAYDVIyB79mh4dK7WRgZG7Kc+d/43t2WX/pX2HqBVkpLcDPkA9cNOKpCRYWd3LyYISlz53gzyg==} + engines: {node: '26'} + + '@nanoforge-dev/loader-server@1.7.0': + resolution: {integrity: sha512-Yd/BYORhoar5znNSD7kGirAc1Al0q5t8iscbb07QWKeXWA+DLKjPSuKJC6ykysFkbs9HiZU59oOfxyvNL4h3Pw==} + engines: {node: '26'} + + '@nanoforge-dev/loader-website@1.7.0': + resolution: {integrity: sha512-x1fV3RYUUxru39sF5HJcfutNnifMMTIEHW92jgkR9gz06ZlZ+rQofuegXgAnEzs0dEXa+rhNQ/iXYbqOZvq6YQ==} + engines: {node: '26'} + + '@nanoforge-dev/registry@3.0.1': + resolution: {integrity: sha512-EzSaszYtrPldD5Do7jdQK3TLLb8uCirY6NQjKXkeGw31X+sUXor4h5GAaoxELWMzPnv9BbKtggSaVaQIt7s8IQ==} + engines: {node: '26'} + + '@nanoforge-dev/schematics@3.0.1': + resolution: {integrity: sha512-iK2vC0gPEh2mQ81IB4+jfGw/ZNOLMDnS9HRBXH5tWB0mdN5GA32viblhW0oYPX2/tWrLC9YiCPgEE4AL8Zwz6w==} + engines: {node: '26'} + + '@napi-rs/wasm-runtime@1.2.6': + resolution: {integrity: sha512-mRyDmEw9/fCDXCGfL1sbgIw/GUK0PVxRW4YwgPN61F3LQ+fSyoBFarJVzgGyhF6kRzEQZ0FejDqm4WLXSeqQmw==} + engines: {node: ^20.19.0 || ^22.13.0 || >=23.5.0} + peerDependencies: + '@emnapi/core': ^1.7.1 || 2.0.0-beta.2 + '@emnapi/runtime': ^1.7.1 || 2.0.0-beta.2 + + '@oven/bun-darwin-aarch64@1.4.4': + resolution: {integrity: sha512-zW/hxwc8sJAILGwB5eTC4i48ouGXf0V4lrxmEOk3JIE6JkYVW1TZh1E2pIempqsezgW1sckTIIDudFON8bJ2Mw==} + cpu: [arm64] + os: [darwin] + + '@oven/bun-darwin-x64@1.4.4': + resolution: {integrity: sha512-oKGcxLsvh4oHjAo28nPm8c/xN0o/OmGyj1IHYc94vprkWsW2hNg2keEZt5f40cI5Hvu4jDlSRTR0UNpv1UIAxw==} + cpu: [x64] + os: [darwin] + + '@oven/bun-freebsd-aarch64@1.4.4': + resolution: {integrity: sha512-klvA9FlwLxZj3JYIOPQA4bbnHIC3uas8kBE4GaGGkeVgAQP/k8hAzYkOqkSaqHBDbxLrTyFEQArEAevJq6NJzg==} + cpu: [arm64] + os: [freebsd] + + '@oven/bun-freebsd-x64@1.4.4': + resolution: {integrity: sha512-sF1xS/scbyN94P2d0eTiarO6JHxrIvhZNT9hnWjQXW5nwKRtfuP+UYnIMNyvW1BQPcZFP/cvfLBNUIe1ea4zPA==} + cpu: [x64] + os: [freebsd] + + '@oven/bun-linux-aarch64-android@1.4.4': + resolution: {integrity: sha512-5lvn3at5vRC0GxvmiqEiV2/e23tnRi0q5pzR40yfDvDA3OW7PSkt4chF1nA9vnAJhro4/l+ol1FmNP6D3cf/oA==} + cpu: [arm64] + os: [android] + + '@oven/bun-linux-aarch64-musl@1.4.4': + resolution: {integrity: sha512-QFd0P+mHJxbZFbUla4MgiE5OwxysHaUIYxL2pPNkpWtaI7v4ShOpr8OhBmsuyB0xn5rv/ZJnPsj2y8+bB9+g/A==} + cpu: [arm64] + os: [linux] + libc: [musl] + + '@oven/bun-linux-aarch64@1.4.4': + resolution: {integrity: sha512-ZTVtpf9zmHSBVPX1sBwe5agGb/rN34yPGg/Hby8e2Ax2uCUA2URZKlZH7qLntK7qaFJCMXh9v0GWNYN2zINz1w==} + cpu: [arm64] + os: [linux] + libc: [glibc] + + '@oven/bun-linux-x64-android@1.4.4': + resolution: {integrity: sha512-3dMicj9C1DhaIfDkwt/9GtpU0W+q+GazbG9OIlEyL3Q1BBEz2e6ZRz/JiO8D/ECC0caXAqvnpFudehcLlgIwWQ==} + cpu: [x64] + os: [android] + + '@oven/bun-linux-x64-musl@1.4.4': + resolution: {integrity: sha512-lEEjNOJJrbGZu2NVcPI4uXdILcpspezWkA8R/Jr0RCGhM6zQd0Y7JBIIKNAmbX59EeWpeEz7Q78iLbpcAUypUA==} + cpu: [x64] + os: [linux] + libc: [musl] + + '@oven/bun-linux-x64@1.4.4': + resolution: {integrity: sha512-CHbbkmHVM28T1GFq+6GL4Ao4ujwwYwj1CxFFwEFzLanPfNsId9AhbIP0Q4reWuWBkGimUkoQygrK7Rgjtj3vog==} + cpu: [x64] + os: [linux] + libc: [glibc] + + '@oven/bun-windows-aarch64@1.4.4': + resolution: {integrity: sha512-n0ep5ZRPCZY1+dqFJpnnRUZB1wy4GYU6At8RF+pyzySCLjkN9R4rFh2PtBHAgF/lg1vOl3/CeER3pDM+p40ATA==} + cpu: [arm64] + os: [win32] + + '@oven/bun-windows-x64@1.4.4': + resolution: {integrity: sha512-a3LNctBVO8PjePsFZfwDleF2JXYf2BfQ1u/PLRnBDLnC2Riml+4+LgJpKj4xRGhB92KweGyQI5PXaTkP9qypMQ==} + cpu: [x64] + os: [win32] + + '@oxc-project/types@0.158.0': + resolution: {integrity: sha512-xZ66qA4WmLbTLlxH3mqMd8f9UKbaOzOT0ATwFf4DH/14pMgpUrtqtjyYzOQmgfl2a0iRAAMbQ9G1th/67jRzGw==} + + '@rolldown/binding-android-arm-eabi@1.3.2': + resolution: {integrity: sha512-kqR2xcygEx3WwDY69LsKeyf7SVmx4yzMtKZRknyaHieVJdRvvnAM97L0Gq6tUFc9T2YXcW/Ghij2+Um6He0LTw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [android] + + '@rolldown/binding-android-arm64@1.3.2': + resolution: {integrity: sha512-gXM4GAAvvIZA7qUuSCQS+Zz91H2fagKa5MNppUdjzysJ8LXMWm9D/gQj4nfOKo6okquDQ5pkjsuo2SUMXNW0Rw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [android] + + '@rolldown/binding-darwin-arm64@1.3.2': + resolution: {integrity: sha512-OBs5hp3W+LwMEUmDMMMnu08ncG0t6DDgnFU+6TAucKtAfNgerYLZSr2jtREKb/JuPQ1J7bJnWIgKKkxvjuAw1g==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [darwin] + + '@rolldown/binding-darwin-x64@1.3.2': + resolution: {integrity: sha512-X0VGYd4v/gdjfa/IP6uHuMhofPoUDYvK/byk3bC0jQ1pKKgt6RZ4B4puMqP0AHkjmIHAsxA471mM6AxZ39IaTA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [darwin] + + '@rolldown/binding-freebsd-x64@1.3.2': + resolution: {integrity: sha512-mr04K4cp9J/fj9fknrX8e4QvI/V48Sp+4v64PoLwhoirIH8b8L8EBrF/0bTjV1It2IL91hoNG13GblnWLglkxA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [freebsd] + + '@rolldown/binding-linux-arm-gnueabihf@1.3.2': + resolution: {integrity: sha512-VgWy02HU9Tiy6tU8U+kF3Fd4TQwTNdIBvs2MlgViP1ksMtAnQQTIPAj0ZsJzIQXKIOugqQSpqxQgELJ3fkuL5w==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [linux] + + '@rolldown/binding-linux-arm64-gnu@1.3.2': + resolution: {integrity: sha512-0wloJFYqV844gv6boiERbHpErxbxHbmlgnMX5VxP1Ux+DLBqGrUOn0cIpBmCZEcTITes3QUelxya4u8c9ziQvQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-arm64-musl@1.3.2': + resolution: {integrity: sha512-Kys8wgFQy8H8vua0MNpC0akMBFoNO8455RHk2yycBM0iayMIAtVAL6xmV9TWAkehFgrrlImTL2fZdX5LXfYtAA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + libc: [musl] + + '@rolldown/binding-linux-ppc64-gnu@1.3.2': + resolution: {integrity: sha512-L8eej7+/StRxUHHOPsOVl7Fzx/3tumuGB4hGQZKT73xRI16KZhaSJr0gi3C3WBjNRxeJRKKps2UD4lQukP+oBw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [ppc64] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-s390x-gnu@1.3.2': + resolution: {integrity: sha512-MV5CEb/nV8neQOj7l6945q1vy62HXtWO8zPDvfySPusoUzdBoLoJ/DfXXwaYThGTXZCniF+5bCf253WTPPK7Yw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [s390x] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-x64-gnu@1.3.2': + resolution: {integrity: sha512-3qssvvVvkwQookZ1/1avlKWc5orAR85vgKdzDd5noZS8nnHiI/ejOAEt0xfNYvtBBF7/DZmP8dANWkRBJVOBCA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-x64-musl@1.3.2': + resolution: {integrity: sha512-rJqoFTm/bCZFKKgaT4NzWn/TuJkFDToZ/rzYFnYVBL28jH1nIfg6snx2mDri30nal9H+wcYfKpoPR9jrMQgQQg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + libc: [musl] + + '@rolldown/binding-openharmony-arm64@1.3.2': + resolution: {integrity: sha512-ozdbCjHfh0N//wJNExjJlSlcDaeIKo8k1ktzkLUyESr2Gu/Qw7nBYxKe3jgtoaxda570vg10WdYosre82263hQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [openharmony] + + '@rolldown/binding-wasm32-wasi@1.3.2': + resolution: {integrity: sha512-p5VA6Vk/2cXZPVWf+dDbuE0dkhrcoAo6pISTJmzUnsSdQqNJdusyR8lZgHku095+r27zrYISNLZnJoqrcePW0A==} + engines: {node: ^20.19.0 || ^22.13.0 || >=23.5.0} + cpu: [wasm32] + + '@rolldown/binding-win32-arm64-msvc@1.3.2': + resolution: {integrity: sha512-XDb2U14Orf4r76SwzvJ7avePL00w4gHBmi1Ig4B/itYFEUTmYMNDHVU0dcYuBa0LgNBqyREoJOrQKxQlyYJA7A==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [win32] + + '@rolldown/binding-win32-x64-msvc@1.3.2': + resolution: {integrity: sha512-lEsKzKJqIUDZVCBhS4lkZuyQUhV1oRg5UHkI72qlOAqJn7qEXcoVdTridFS7PHNWdZknBl95EAF/4P1Xv0K1eQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [win32] + + '@rolldown/pluginutils@1.1.0': + resolution: {integrity: sha512-K+NU2HDCEem4sClgHH4ZZXwdJeNFkJo+hRk479DIwdIviAPN2hFJH1KHHwg8CxHQXvi0M5XY4deTXINfIiSG6w==} + + '@sindresorhus/is@4.6.0': + resolution: {integrity: sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==} + engines: {node: '>=10'} + + '@tybys/wasm-util@0.10.4': + resolution: {integrity: sha512-W3c4gRigFS0T/Ma4qIYF3GDAc5AQdHb1yL5znJT1Zv1YaD9Kitx656wBjvr19qbiosmZT8lWDM5BEMynUqX65A==} + + '@types/validator@13.15.10': + resolution: {integrity: sha512-T8L6i7wCuyoK8A/ZeLYt1+q0ty3Zb9+qbSSvrIVitzT3YjZqkTZ40IbRsPanlB4h1QB3JVL1SYCdR6ngtFYcuA==} + + ajv-formats@3.0.1: + resolution: {integrity: sha512-8iUql50EUR+uUcdRQ3HDqa6EVyo3docL8g5WJ3FNcWmu62IbkGUue/pEyLBW8VGKKucTPgqeks4fIU1DA4yowQ==} + peerDependencies: + ajv: ^8.0.0 + peerDependenciesMeta: + ajv: + optional: true + + ajv@8.20.0: + resolution: {integrity: sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA==} + + ansi-regex@6.6.0: + resolution: {integrity: sha512-XZ5apbzreCbXSKwPjJstu8R0zOi247w3XYwWxtwBXgpZrCyc1Ka7p9/xY0A9/diMewmHbEKz+FIraWaEWjlN5g==} + engines: {node: '>=12'} + + ansis@4.5.0: + resolution: {integrity: sha512-KwIVkfFfJSSzBmZhDGuTmkhWqTdyB5oNVzzznBJbBZ5bZtHiqSrcugRF0RKJKT4Ss3d7ZrcjnlFVDlQNmtWfWw==} + engines: {node: '>=14'} + + braces@3.0.3: + resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} + engines: {node: '>=8'} + + bun@1.4.4: + resolution: {integrity: sha512-hj0ASdG6PNjLZGFAXktWb3Uaj/dcv/1wCsIttoEXADNIQBsGjTr+5uLKYbrDkuc7NT0Tkj4yPIqJI2jDxXdvVg==} + cpu: [arm64, x64] + os: [darwin, linux, android, freebsd, win32] + hasBin: true + + bundle-name@4.1.1: + resolution: {integrity: sha512-DdH81/zPLVS11EUgWq3tEu/xn+EzljlMYooDNdzWEnFha3R3NBMpMV1UqYIpjYHV/SgpFKMIX1Oh7o06SjM/oA==} + engines: {node: '>=18'} + + chalk@5.6.2: + resolution: {integrity: sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA==} + engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} + + char-regex@1.0.2: + resolution: {integrity: sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==} + engines: {node: '>=10'} + + chardet@2.2.0: + resolution: {integrity: sha512-rddelWYNPRrXq6PtNEN2S3f6t9ILzvqaN5pVgi4kqt9jHQaXIial9PznB5iSPVlQSLNaaH22ItWz3EJtQ10+OA==} + + chokidar@5.0.0: + resolution: {integrity: sha512-TQMmc3w+5AxjpL8iIiwebF73dRDF4fBIieAqGn9RGCWaEVwQ6Fb2cGe31Yns0RRIzii5goJ1Y7xbMwo1TxMplw==} + engines: {node: '>= 20.19.0'} + + chownr@3.0.0: + resolution: {integrity: sha512-+IxzY9BZOQd/XuYPRmrvEVjF/nqj5kgT4kEq7VofrDoM1MxoRjEWkrCC3EtLi59TVawxTAn+orJwFQcrqEN1+g==} + engines: {node: '>=18'} + + class-transformer@0.5.1: + resolution: {integrity: sha512-SQa1Ws6hUbfC98vKGxZH3KFY0Y1lm5Zm0SY8XX9zbK7FJCyVEac3ATW0RIpwzW+oOfmHE5PMPufDG9hCfoEOMw==} + + class-validator@0.14.4: + resolution: {integrity: sha512-AwNusCCam51q703dW82x95tOqQp6oC9HNUl724KxJJOfnKscI8dOloXFgyez7LbTTKWuRBA37FScqVbJEoq8Yw==} + + class-validator@0.15.1: + resolution: {integrity: sha512-LqoS80HBBSCVhz/3KloUly0ovokxpdOLR++Al3J3+dHXWt9sTKlKd4eYtoxhxyUjoe5+UcIM+5k9MIxyBWnRTw==} + + cli-cursor@5.0.0: + resolution: {integrity: sha512-aCj4O5wKyszjMmDT4tZj93kxyydN/K5zPWSCe6/0AV/AA1pqe5ZBIw0a2ZfPQV7lL5/yb5HsUreJ6UFAF1tEQw==} + engines: {node: '>=18'} + + cli-spinners@3.4.0: + resolution: {integrity: sha512-bXfOC4QcT1tKXGorxL3wbJm6XJPDqEnij2gQ2m7ESQuE+/z9YFIWnl/5RpTiKWbMq3EVKR4fRLJGn6DVfu0mpw==} + engines: {node: '>=18.20'} + + cli-width@4.1.0: + resolution: {integrity: sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==} + engines: {node: '>= 12'} + + commander@15.1.0: + resolution: {integrity: sha512-cgnQ88TRrWcC7pVq46RzJVRMktu3W2RcbnoidnfBsl1bmDCBwJS/udcIZpKoCrbAYYaCqsz1yZCVIgbIaU3ddQ==} + engines: {node: '>=22.12.0'} + + default-browser-id@5.0.1: + resolution: {integrity: sha512-x1VCxdX4t+8wVfd1so/9w+vQ4vx7lKd2Qp5tDRutErwmR85OgmfX7RlLRMWafRMY7hbEiXIbudNrjOAPa/hL8Q==} + engines: {node: '>=18'} + + default-browser@5.5.1: + resolution: {integrity: sha512-m1pAzaJgZ/gssEqlOhJkPJp8Xly7QyW6xcrkUa2KKcDeDSEMP7X8xipU3snUcfisTQx0w1AGae+9UtJSfVnXGw==} + engines: {node: '>=18'} + + define-lazy-prop@3.0.0: + resolution: {integrity: sha512-N+MeXYoqr3pOgn8xfyRPREN7gHakLYjhsHhWGT3fWAiL4IkAt0iDw14QiiEm2bE30c5XX5q0FtAA3CK5f9/BUg==} + engines: {node: '>=12'} + + defu@6.1.7: + resolution: {integrity: sha512-7z22QmUWiQ/2d0KkdYmANbRUVABpZ9SNYyH5vx6PZ+nE5bcC0l7uFvEfHlyld/HcGBFTL536ClDt3DEcSlEJAQ==} + + destr@2.0.5: + resolution: {integrity: sha512-ugFTXCtDZunbzasqBxrK93Ik/DRYsO6S/fedkWEMKqt04xZ4csmnmwGDBAb07QWNaGMAmnTIemsYZCksjATwsA==} + + dotenv@17.4.2: + resolution: {integrity: sha512-nI4U3TottKAcAD9LLud4Cb7b2QztQMUEfHbvhTH09bqXTxnSie8WnjPALV/WMCrJZ6UV/qHJ6L03OqO3LcdYZw==} + engines: {node: '>=12'} + + dotenv@18.0.10: + resolution: {integrity: sha512-89FAA1xchzK2mxVWdr5F/0rldwiueXs6zJM86rO66EzekR1iBdiXRthyG+m5GvkJaFH3C2LESzamTkgndmLT2A==} + engines: {node: '>=12'} + hasBin: true + + emojilib@2.4.0: + resolution: {integrity: sha512-5U0rVMU5Y2n2+ykNLQqMoqklN9ICBT/KsvC1Gz6vqHbz2AXXGkG+Pm5rMWk/8Vjrr/mY9985Hi8DYzn1F09Nyw==} + + fast-deep-equal@3.1.3: + resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} + + fast-string-truncated-width@3.0.3: + resolution: {integrity: sha512-0jjjIEL6+0jag3l2XWWizO64/aZVtpiGE3t0Zgqxv0DPuxiMjvB3M24fCyhZUO4KomJQPj3LTSUnDP3GpdwC0g==} + + fast-string-width@3.0.2: + resolution: {integrity: sha512-gX8LrtNEI5hq8DVUfRQMbr5lpaS4nMIWV+7XEbXk2b8kiQIizgnlr12B4dA3ZEx3308ze0O4Q1R+cHts8kyUJg==} + + fast-uri@3.1.9: + resolution: {integrity: sha512-hS/0Wt3Ya043oKXs0sIxrMpKQITXhMLIrVAKKXi4gozGC9v7YRWVnXIZzjNPTO02M9BdxLCWqK1yRXgNziVyJQ==} + + fast-wrap-ansi@0.2.2: + resolution: {integrity: sha512-7F2Fl+TjRSenLqlU3UjSH0iyqopqoZIu7eZVpEirP2g1GtWa2G/ecEmBdgz31+Mxr+ELclgg6sokpSFIQiZ02Q==} + + fflate@0.8.3: + resolution: {integrity: sha512-tbZNuJrLwGUp3zshBtdy4W+ORxZuIh8a5ilyIEQDC5rY1f3U20JMry0Ll3WBzU58EZKsEuJFXhb5gwv8CsPvgA==} + + fill-range@7.1.1: + resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} + engines: {node: '>=8'} + + get-east-asian-width@1.7.0: + resolution: {integrity: sha512-XjH1AECxf0giL2V1aU8vKyRR2ppRUb5c0EvT7zuJTokQ74bNo52zOtghqdWIqrhUD79fo3x0WfKZdOqxF6LG1Q==} + engines: {node: '>=18'} + + iconv-lite@0.7.3: + resolution: {integrity: sha512-IKXpvIzjnC9XTAUbVBcMfGS0EPaIXtW6v+zr+RRp+hqULEpo0owZax6wyRwPOJbWbzjYspQwusTsfVr0ifh4uQ==} + engines: {node: '>=0.10.0'} + + is-docker@3.0.0: + resolution: {integrity: sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + hasBin: true + + is-in-ssh@1.0.0: + resolution: {integrity: sha512-jYa6Q9rH90kR1vKB6NM7qqd1mge3Fx4Dhw5TVlK1MUBqhEOuCagrEHMevNuCcbECmXZ0ThXkRm+Ymr51HwEPAw==} + engines: {node: '>=20'} + + is-inside-container@1.0.0: + resolution: {integrity: sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA==} + engines: {node: '>=14.16'} + hasBin: true + + is-interactive@2.0.0: + resolution: {integrity: sha512-qP1vozQRI+BMOPcjFzrjXuQvdak2pHNUMZoeG2eRbiSqyvbEf/wQtEOTOX1guk6E3t36RkaqiSt8A/6YElNxLQ==} + engines: {node: '>=12'} + + is-number@7.0.0: + resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} + engines: {node: '>=0.12.0'} + + is-unicode-supported@2.1.0: + resolution: {integrity: sha512-mE00Gnza5EEB3Ds0HfMyllZzbBrmLOX3vfWoj9A9PEnTfratQ/BcaJOuMhnkhjXvb2+FkY3VuHqtAGpTPmglFQ==} + engines: {node: '>=18'} + + is-wsl@3.1.1: + resolution: {integrity: sha512-e6rvdUCiQCAuumZslxRJWR/Doq4VpPR82kqclvcS0efgt430SlGIk05vdCN58+VrzgtIcfNODjozVielycD4Sw==} + engines: {node: '>=16'} + + json-schema-traverse@1.0.0: + resolution: {integrity: sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==} + + jsonc-parser@3.3.1: + resolution: {integrity: sha512-HUgH65KyejrUFPvHFPbqOY0rsFip3Bo5wb4ngvdi1EpCYWUQDC5V+Y7mZws+DLkr4M//zQJoanu1SP+87Dv1oQ==} + + konva@10.9.1: + resolution: {integrity: sha512-m49x+GatSxEUSvqahYhxpTjgKbtrLtw4P4o4B4iux953ZFpceaK52Ea+CFsAsd7W4I0Y5u6mMoRUsY/eltNZmw==} + peerDependencies: + canvas: ^3.0.0 + skia-canvas: ^3.0.0 + peerDependenciesMeta: + canvas: + optional: true + skia-canvas: + optional: true + + libphonenumber-js@1.13.16: + resolution: {integrity: sha512-tIOCM9yx2Go6d5/ZANe0K+G4AZek1Ymx81HxQpf19Sri4zMP95eQbKdnUGHAvFQ4nx0PeLhFqvAfisTADXj3tQ==} + + log-symbols@7.0.1: + resolution: {integrity: sha512-ja1E3yCr9i/0hmBVaM0bfwDjnGy8I/s6PP4DFp+yP+a+mrHO4Rm7DtmnqROTUkHIkqffC84YY7AeqX6oFk0WFg==} + engines: {node: '>=18'} + + magic-string@1.4.1: + resolution: {integrity: sha512-8lyCu36ErXR0J9uaGKlKQoiLZKmtI63YGLE8G2o9jyRPdr4X47LusSOwgOJOzcVtp81fTAAjxR7BwKz682Jhow==} + + micromatch@4.0.8: + resolution: {integrity: sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==} + engines: {node: '>=8.6'} + + mimic-function@5.0.1: + resolution: {integrity: sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==} + engines: {node: '>=18'} + + minipass@7.1.3: + resolution: {integrity: sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A==} + engines: {node: '>=16 || 14 >=14.17'} + + minizlib@3.1.0: + resolution: {integrity: sha512-KZxYo1BUkWD2TVFLr0MQoM8vUUigWD3LlD83a/75BqC+4qE0Hb1Vo5v1FgcfaNXvfXzr+5EhQ6ing/CaBijTlw==} + engines: {node: '>= 18'} + + mute-stream@4.0.0: + resolution: {integrity: sha512-gSrprq0fJ3EiOErzjdIZrjysVVmJ4uu1QWfCDss5LypA5OXvrMje5Ym5z6V6RLyJ2eF87lasX7t6a0AnFvZblg==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + + node-emoji@2.2.0: + resolution: {integrity: sha512-Z3lTE9pLaJF47NyMhd4ww1yFTAP8YhYI8SleJiHzM46Fgpm5cnNzSl9XfzFNqbaz+VlJrIj3fXQ4DeN1Rjm6cw==} + engines: {node: '>=18'} + + onetime@7.0.0: + resolution: {integrity: sha512-VXJjc87FScF88uafS3JllDgvAm+c/Slfz06lorj2uAY34rlUu0Nt+v8wreiImcrgAjjIHp1rXpTDlLOGw29WwQ==} + engines: {node: '>=18'} + + open@11.0.4: + resolution: {integrity: sha512-++Zlftm0kVLPmzC06t6epuWmcRMDbI4z5P3NNX979WA/k23+NtSOynEGzsVfZwguKw2mi5umVgnBlJQMwRz4Pg==} + engines: {node: '>=20'} + + ora@9.4.1: + resolution: {integrity: sha512-6VlU9MLXbjVQD04AZCMX28hVtA5bUoadvUqO76MUCVA0ilwJbMiHsITRPfyVm6p/BC0Av/BXMujx39WCe1LEqw==} + engines: {node: '>=20'} + + picomatch@2.3.2: + resolution: {integrity: sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==} + engines: {node: '>=8.6'} + + picomatch@4.0.7: + resolution: {integrity: sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA==} + engines: {node: '>=12'} + + powershell-utils@0.2.1: + resolution: {integrity: sha512-C+y9x90UElAddDZmV4qOx9W53B61PO7cIqWz2dQsWlwswuq4mr8NEwytdGKboYbQlGZ3awrkTeNvcZiZNHnQ8A==} + engines: {node: '>=20'} + + rc9@3.1.0: + resolution: {integrity: sha512-ufjkNVzbRHKcCOmTahZkmVsyc3W+MSk3jY03m+a7tGHkIsdVMG9l10/3HvFbWkkKzY5VFp3pkRsIo/UYgmFL7Q==} + + readdirp@5.1.1: + resolution: {integrity: sha512-Kko+Y5XQ6fM+Ce3dq3m9YGxnacYZYl9cA1wZjaF3Vbry2L3i1qVg8+CAgNPsXRArPMUMCaOR7oa9Nqntc43JKA==} + engines: {node: '>= 20.19.0'} + + require-from-string@2.0.2: + resolution: {integrity: sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==} + engines: {node: '>=0.10.0'} + + restore-cursor@5.1.0: + resolution: {integrity: sha512-oMA2dcrw6u0YfxJQXm342bFKX/E4sG9rbTzO9ptUcR/e8A33cHuvStiYOwH7fszkZlZ1z/ta9AAoPk2F4qIOHA==} + engines: {node: '>=18'} + + rolldown@1.3.2: + resolution: {integrity: sha512-EFHqbVkXiYZA6akmYm2bvJhNbEGdUwAResRhYwl/BO8QhB5KxsG+t3RVHJSIOy5jBEb0XCACvrIGnnl6Z8sMGA==} + engines: {node: ^20.19.0 || >=22.12.0} + hasBin: true + + run-applescript@7.1.0: + resolution: {integrity: sha512-DPe5pVFaAsinSaV6QjQ6gdiedWDcRCbUuiQfQa2wmWV7+xC9bGulGI8+TdRmoFkAPaBXk8CrAbnlY2ISniJ47Q==} + engines: {node: '>=18'} + + rxjs@7.8.2: + resolution: {integrity: sha512-dhKf903U/PQZY6boNNtAGdWbG85WAbjT/1xYoZIC7FAY0yWapOBQVsVrDl58W86//e1VpMNBtRV4MaXfdMySFA==} + + safer-buffer@2.1.2: + resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} + + semver@7.8.6: + resolution: {integrity: sha512-9lpSSU4Mly3mrtruwLs1eLK6+gzbzqeBFwRNjIjE+9LuDpWdYctrQlQ3ej1Ilgi7gknpsTRnPoLP8DpCHqHIJw==} + engines: {node: '>=10'} + hasBin: true + + signal-exit@4.1.0: + resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} + engines: {node: '>=14'} + + skin-tone@2.0.0: + resolution: {integrity: sha512-kUMbT1oBJCpgrnKoSr0o6wPtvRWT9W9UKvGLwfJYO2WuahZRHOpEyL1ckyMGgMWh0UdpmaoFqKKD29WTomNEGA==} + engines: {node: '>=8'} + + source-map@0.8.0: + resolution: {integrity: sha512-d8EqvL+k/SOXCreS/SUzg2ciyHqBBLcN/yuRjFsbvVhHTE2pgei7oAhmPM7kWFbkX6OSMQfUq4KbkF3au9lhYQ==} + engines: {node: '>= 12'} + + stdin-discarder@0.3.2: + resolution: {integrity: sha512-eCPu1qRxPVkl5605OTWF8Wz40b4Mf45NY5LQmVPQ599knfs5QhASUm9GbJ5BDMDOXgrnh0wyEdvzmL//YMlw0A==} + engines: {node: '>=18'} + + string-width@8.3.0: + resolution: {integrity: sha512-ZbmZM0JCihQN91dWnxoipT2KOEyHqEyfRXUyjuRhW8b/xnqPDoq4gWEVApTVa9db2wN8mmoikgFBbjh71+cGeQ==} + engines: {node: '>=20'} + + strip-ansi@7.2.0: + resolution: {integrity: sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==} + engines: {node: '>=12'} + + tar@7.5.23: + resolution: {integrity: sha512-lkukzdoGngZHJZXxW4S/E4Fp9ghTDlyZXrQGRNoJ/LXvDKcXUTq2sg5yQe74po7Voea6n/IN09+wE/QvJMiifA==} + engines: {node: '>=18'} + + to-regex-range@5.0.1: + resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} + engines: {node: '>=8.0'} + + tslib@2.9.1: + resolution: {integrity: sha512-a4Ux9VKuIMHsOS7ENbEq6hK2ZGYIT27Rtl0E4eD9KqwxhKiQeMZE/9xb3IdYwWaSOyIBQLExhQgXDTYoiCxnWA==} + + typescript@6.0.3: + resolution: {integrity: sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw==} + engines: {node: '>=14.17'} + hasBin: true + + unicode-emoji-modifier-base@1.0.0: + resolution: {integrity: sha512-yLSH4py7oFH3oG/9K+XWrz1pSi3dfUrWEnInbxMfArOfc1+33BlGPQtLsOYwvdMy11AwUBetYuaRxSPqgkq+8g==} + engines: {node: '>=4'} + + unrun@0.3.1: + resolution: {integrity: sha512-onIck/oNnCaytwths1ZVp1LK2Gq2hPoyFhiHebObuUXqR3S0uHuLLaBK8K6mRRgV7Ptip8AnNvaUsgzwWwBZuA==} + engines: {node: ^22.13.0 || >=24.0.0} + hasBin: true + peerDependencies: + synckit: ^0.11.11 + peerDependenciesMeta: + synckit: + optional: true + + validator@13.15.35: + resolution: {integrity: sha512-TQ5pAGhd5whStmqWvYF4OjQROlmv9SMFVt37qoCBdqRffuuklWYQlCNnEs2ZaIBD1kZRNnikiZOS1eqgkar0iw==} + engines: {node: '>= 0.10'} + + wsl-utils@1.0.1: + resolution: {integrity: sha512-c16PKLIRxBYpR3jSWsdS7SFp0COm5SOQdiFjY818dYFHJbMGuLBszpF07LBWmOS1uzrHa9VGdynsEgoeKy0oOQ==} + engines: {node: '>=20'} + + yallist@5.0.0: + resolution: {integrity: sha512-YgvUTfwqyc7UXVMrB+SImsVYSmTS8X/tSrtdNZMImM+n7+QTriRXyXim0mBrTXNeqzVF0KWGgHPeiyViFFrNDw==} + engines: {node: '>=18'} + + yoctocolors@2.2.0: + resolution: {integrity: sha512-xYqdZFUK/VYazNl/oCDYN+3WloWQwMfZxBoiNt6qNyk+xfOdi598muWE42rNZFp1kNOiqW936q5RhUdnpqElSg==} + engines: {node: '>=18'} + + zod@4.6.7: + resolution: {integrity: sha512-g8W2D2kU6a8untc053fX1uVBKzM7yqAxW/3zwk83+6RyF2+SKOuV+c0wBDhUwzV1PaGapmZH+rmcUzPf+3CGwg==} + +snapshots: + + '@angular-devkit/core@22.2.7(chokidar@5.0.0)': + dependencies: + ajv: 8.20.0 + ajv-formats: 3.0.1(ajv@8.20.0) + jsonc-parser: 3.3.1 + picomatch: 4.0.7 + rxjs: 7.8.2 + source-map: 0.8.0 + optionalDependencies: + chokidar: 5.0.0 + + '@angular-devkit/schematics-cli@22.2.7(chokidar@5.0.0)': + dependencies: + '@angular-devkit/core': 22.2.7(chokidar@5.0.0) + '@angular-devkit/schematics': 22.2.7(chokidar@5.0.0) + '@inquirer/prompts': 8.7.2 + transitivePeerDependencies: + - '@types/node' + - chokidar + + '@angular-devkit/schematics@22.2.7(chokidar@5.0.0)': + dependencies: + '@angular-devkit/core': 22.2.7(chokidar@5.0.0) + jsonc-parser: 3.3.1 + magic-string: 1.4.1 + ora: 9.4.1 + rxjs: 7.8.2 + transitivePeerDependencies: + - chokidar + + '@emnapi/core@2.0.0-beta.2': + dependencies: + '@emnapi/wasi-threads': 2.2.0 + tslib: 2.9.1 + optional: true + + '@emnapi/runtime@2.0.0-beta.2': + dependencies: + tslib: 2.9.1 + optional: true + + '@emnapi/wasi-threads@2.2.0': + dependencies: + tslib: 2.9.1 + optional: true + + '@inquirer/ansi@2.1.0': {} + + '@inquirer/checkbox@5.3.0': + dependencies: + '@inquirer/ansi': 2.1.0 + '@inquirer/core': 12.1.0 + '@inquirer/figures': 2.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/confirm@6.4.0': + dependencies: + '@inquirer/core': 12.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/core@12.1.0': + dependencies: + '@inquirer/ansi': 2.1.0 + '@inquirer/figures': 2.1.0 + '@inquirer/type': 4.3.0 + cli-width: 4.1.0 + fast-wrap-ansi: 0.2.2 + mute-stream: 4.0.0 + signal-exit: 4.1.0 + + '@inquirer/editor@5.4.0': + dependencies: + '@inquirer/core': 12.1.0 + '@inquirer/external-editor': 3.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/expand@5.2.0': + dependencies: + '@inquirer/core': 12.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/external-editor@3.1.0': + dependencies: + chardet: 2.2.0 + iconv-lite: 0.7.3 + + '@inquirer/figures@2.1.0': {} + + '@inquirer/input@5.2.0': + dependencies: + '@inquirer/core': 12.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/number@4.3.0': + dependencies: + '@inquirer/core': 12.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/password@5.3.0': + dependencies: + '@inquirer/ansi': 2.1.0 + '@inquirer/core': 12.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/prompts@8.7.2': + dependencies: + '@inquirer/checkbox': 5.3.0 + '@inquirer/confirm': 6.4.0 + '@inquirer/editor': 5.4.0 + '@inquirer/expand': 5.2.0 + '@inquirer/input': 5.2.0 + '@inquirer/number': 4.3.0 + '@inquirer/password': 5.3.0 + '@inquirer/rawlist': 5.4.0 + '@inquirer/search': 4.4.0 + '@inquirer/select': 5.3.0 + + '@inquirer/prompts@8.8.0': + dependencies: + '@inquirer/checkbox': 5.3.0 + '@inquirer/confirm': 6.4.0 + '@inquirer/editor': 5.4.0 + '@inquirer/expand': 5.2.0 + '@inquirer/input': 5.2.0 + '@inquirer/number': 4.3.0 + '@inquirer/password': 5.3.0 + '@inquirer/rawlist': 5.4.0 + '@inquirer/search': 4.4.0 + '@inquirer/select': 5.3.0 + + '@inquirer/rawlist@5.4.0': + dependencies: + '@inquirer/core': 12.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/search@4.4.0': + dependencies: + '@inquirer/core': 12.1.0 + '@inquirer/figures': 2.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/select@5.3.0': + dependencies: + '@inquirer/ansi': 2.1.0 + '@inquirer/core': 12.1.0 + '@inquirer/figures': 2.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/type@4.3.0': {} + + '@isaacs/fs-minipass@4.0.1': + dependencies: + minipass: 7.1.3 + + '@jridgewell/sourcemap-codec@1.6.0': {} + + '@nanoforge-dev/asset@3.0.0': + dependencies: + '@nanoforge-dev/common': 3.0.0 + + '@nanoforge-dev/cli@3.0.1': + dependencies: + '@angular-devkit/schematics': 22.2.7(chokidar@5.0.0) + '@angular-devkit/schematics-cli': 22.2.7(chokidar@5.0.0) + '@inquirer/prompts': 8.8.0 + '@nanoforge-dev/config': 3.0.1 + '@nanoforge-dev/editor': 0.1.4 + '@nanoforge-dev/loader-client': 1.7.0 + '@nanoforge-dev/loader-server': 1.7.0 + '@nanoforge-dev/registry': 3.0.1 + '@nanoforge-dev/schematics': 3.0.1(chokidar@5.0.0) + ansis: 4.5.0 + bun: 1.4.4 + chokidar: 5.0.0 + commander: 15.1.0 + dotenv: 18.0.10 + node-emoji: 2.2.0 + open: 11.0.4 + ora: 9.4.1 + rc9: 3.1.0 + transitivePeerDependencies: + - '@types/node' + - synckit + + '@nanoforge-dev/common@3.0.0': {} + + '@nanoforge-dev/config@3.0.1': + dependencies: + unrun: 0.3.1 + zod: 4.6.7 + transitivePeerDependencies: + - synckit + + '@nanoforge-dev/core@3.0.0': + dependencies: + '@nanoforge-dev/asset': 3.0.0 + '@nanoforge-dev/common': 3.0.0 + + '@nanoforge-dev/ecs@3.0.0(@nanoforge-dev/editor-lib@3.0.0)': + dependencies: + '@nanoforge-dev/common': 3.0.0 + optionalDependencies: + '@nanoforge-dev/editor-lib': 3.0.0 + + '@nanoforge-dev/editor-lib@3.0.0': + dependencies: + '@nanoforge-dev/common': 3.0.0 + + '@nanoforge-dev/editor@0.1.4': + dependencies: + bun: 1.4.4 + class-transformer: 0.5.1 + class-validator: 0.15.1 + dotenv: 17.4.2 + micromatch: 4.0.8 + tar: 7.5.23 + typescript: 6.0.3 + + '@nanoforge-dev/env@3.0.0': + dependencies: + '@nanoforge-dev/common': 3.0.0 + class-transformer: 0.5.1 + class-validator: 0.14.4 + + '@nanoforge-dev/graphics-2d@3.0.0': + dependencies: + '@nanoforge-dev/common': 3.0.0 + konva: 10.9.1 + transitivePeerDependencies: + - canvas + - skia-canvas + + '@nanoforge-dev/input@3.0.0': + dependencies: + '@nanoforge-dev/common': 3.0.0 + + '@nanoforge-dev/loader-client@1.7.0': + dependencies: + '@nanoforge-dev/loader-website': 1.7.0 + bun: 1.4.4 + commander: 15.1.0 + + '@nanoforge-dev/loader-server@1.7.0': + dependencies: + bun: 1.4.4 + commander: 15.1.0 + + '@nanoforge-dev/loader-website@1.7.0': {} + + '@nanoforge-dev/registry@3.0.1': + dependencies: + fflate: 0.8.3 + semver: 7.8.6 + zod: 4.6.7 + + '@nanoforge-dev/schematics@3.0.1(chokidar@5.0.0)': + dependencies: + '@angular-devkit/core': 22.2.7(chokidar@5.0.0) + '@angular-devkit/schematics': 22.2.7(chokidar@5.0.0) + rxjs: 7.8.2 + transitivePeerDependencies: + - chokidar + + '@napi-rs/wasm-runtime@1.2.6(@emnapi/core@2.0.0-beta.2)(@emnapi/runtime@2.0.0-beta.2)': + dependencies: + '@emnapi/core': 2.0.0-beta.2 + '@emnapi/runtime': 2.0.0-beta.2 + '@tybys/wasm-util': 0.10.4 + optional: true + + '@oven/bun-darwin-aarch64@1.4.4': + optional: true + + '@oven/bun-darwin-x64@1.4.4': + optional: true + + '@oven/bun-freebsd-aarch64@1.4.4': + optional: true + + '@oven/bun-freebsd-x64@1.4.4': + optional: true + + '@oven/bun-linux-aarch64-android@1.4.4': + optional: true + + '@oven/bun-linux-aarch64-musl@1.4.4': + optional: true + + '@oven/bun-linux-aarch64@1.4.4': + optional: true + + '@oven/bun-linux-x64-android@1.4.4': + optional: true + + '@oven/bun-linux-x64-musl@1.4.4': + optional: true + + '@oven/bun-linux-x64@1.4.4': + optional: true + + '@oven/bun-windows-aarch64@1.4.4': + optional: true + + '@oven/bun-windows-x64@1.4.4': + optional: true + + '@oxc-project/types@0.158.0': {} + + '@rolldown/binding-android-arm-eabi@1.3.2': + optional: true + + '@rolldown/binding-android-arm64@1.3.2': + optional: true + + '@rolldown/binding-darwin-arm64@1.3.2': + optional: true + + '@rolldown/binding-darwin-x64@1.3.2': + optional: true + + '@rolldown/binding-freebsd-x64@1.3.2': + optional: true + + '@rolldown/binding-linux-arm-gnueabihf@1.3.2': + optional: true + + '@rolldown/binding-linux-arm64-gnu@1.3.2': + optional: true + + '@rolldown/binding-linux-arm64-musl@1.3.2': + optional: true + + '@rolldown/binding-linux-ppc64-gnu@1.3.2': + optional: true + + '@rolldown/binding-linux-s390x-gnu@1.3.2': + optional: true + + '@rolldown/binding-linux-x64-gnu@1.3.2': + optional: true + + '@rolldown/binding-linux-x64-musl@1.3.2': + optional: true + + '@rolldown/binding-openharmony-arm64@1.3.2': + optional: true + + '@rolldown/binding-wasm32-wasi@1.3.2': + dependencies: + '@emnapi/core': 2.0.0-beta.2 + '@emnapi/runtime': 2.0.0-beta.2 + '@napi-rs/wasm-runtime': 1.2.6(@emnapi/core@2.0.0-beta.2)(@emnapi/runtime@2.0.0-beta.2) + optional: true + + '@rolldown/binding-win32-arm64-msvc@1.3.2': + optional: true + + '@rolldown/binding-win32-x64-msvc@1.3.2': + optional: true + + '@rolldown/pluginutils@1.1.0': {} + + '@sindresorhus/is@4.6.0': {} + + '@tybys/wasm-util@0.10.4': + dependencies: + tslib: 2.9.1 + optional: true + + '@types/validator@13.15.10': {} + + ajv-formats@3.0.1(ajv@8.20.0): + optionalDependencies: + ajv: 8.20.0 + + ajv@8.20.0: + dependencies: + fast-deep-equal: 3.1.3 + fast-uri: 3.1.9 + json-schema-traverse: 1.0.0 + require-from-string: 2.0.2 + + ansi-regex@6.6.0: {} + + ansis@4.5.0: {} + + braces@3.0.3: + dependencies: + fill-range: 7.1.1 + + bun@1.4.4: + optionalDependencies: + '@oven/bun-darwin-aarch64': 1.4.4 + '@oven/bun-darwin-x64': 1.4.4 + '@oven/bun-freebsd-aarch64': 1.4.4 + '@oven/bun-freebsd-x64': 1.4.4 + '@oven/bun-linux-aarch64': 1.4.4 + '@oven/bun-linux-aarch64-android': 1.4.4 + '@oven/bun-linux-aarch64-musl': 1.4.4 + '@oven/bun-linux-x64': 1.4.4 + '@oven/bun-linux-x64-android': 1.4.4 + '@oven/bun-linux-x64-musl': 1.4.4 + '@oven/bun-windows-aarch64': 1.4.4 + '@oven/bun-windows-x64': 1.4.4 + + bundle-name@4.1.1: + dependencies: + run-applescript: 7.1.0 + + chalk@5.6.2: {} + + char-regex@1.0.2: {} + + chardet@2.2.0: {} + + chokidar@5.0.0: + dependencies: + readdirp: 5.1.1 + + chownr@3.0.0: {} + + class-transformer@0.5.1: {} + + class-validator@0.14.4: + dependencies: + '@types/validator': 13.15.10 + libphonenumber-js: 1.13.16 + validator: 13.15.35 + + class-validator@0.15.1: + dependencies: + '@types/validator': 13.15.10 + libphonenumber-js: 1.13.16 + validator: 13.15.35 + + cli-cursor@5.0.0: + dependencies: + restore-cursor: 5.1.0 + + cli-spinners@3.4.0: {} + + cli-width@4.1.0: {} + + commander@15.1.0: {} + + default-browser-id@5.0.1: {} + + default-browser@5.5.1: + dependencies: + bundle-name: 4.1.1 + default-browser-id: 5.0.1 + + define-lazy-prop@3.0.0: {} + + defu@6.1.7: {} + + destr@2.0.5: {} + + dotenv@17.4.2: {} + + dotenv@18.0.10: {} + + emojilib@2.4.0: {} + + fast-deep-equal@3.1.3: {} + + fast-string-truncated-width@3.0.3: {} + + fast-string-width@3.0.2: + dependencies: + fast-string-truncated-width: 3.0.3 + + fast-uri@3.1.9: {} + + fast-wrap-ansi@0.2.2: + dependencies: + fast-string-width: 3.0.2 + + fflate@0.8.3: {} + + fill-range@7.1.1: + dependencies: + to-regex-range: 5.0.1 + + get-east-asian-width@1.7.0: {} + + iconv-lite@0.7.3: + dependencies: + safer-buffer: 2.1.2 + + is-docker@3.0.0: {} + + is-in-ssh@1.0.0: {} + + is-inside-container@1.0.0: + dependencies: + is-docker: 3.0.0 + + is-interactive@2.0.0: {} + + is-number@7.0.0: {} + + is-unicode-supported@2.1.0: {} + + is-wsl@3.1.1: + dependencies: + is-inside-container: 1.0.0 + + json-schema-traverse@1.0.0: {} + + jsonc-parser@3.3.1: {} + + konva@10.9.1: {} + + libphonenumber-js@1.13.16: {} + + log-symbols@7.0.1: + dependencies: + is-unicode-supported: 2.1.0 + yoctocolors: 2.2.0 + + magic-string@1.4.1: + dependencies: + '@jridgewell/sourcemap-codec': 1.6.0 + + micromatch@4.0.8: + dependencies: + braces: 3.0.3 + picomatch: 2.3.2 + + mimic-function@5.0.1: {} + + minipass@7.1.3: {} + + minizlib@3.1.0: + dependencies: + minipass: 7.1.3 + + mute-stream@4.0.0: {} + + node-emoji@2.2.0: + dependencies: + '@sindresorhus/is': 4.6.0 + char-regex: 1.0.2 + emojilib: 2.4.0 + skin-tone: 2.0.0 + + onetime@7.0.0: + dependencies: + mimic-function: 5.0.1 + + open@11.0.4: + dependencies: + default-browser: 5.5.1 + define-lazy-prop: 3.0.0 + is-in-ssh: 1.0.0 + is-inside-container: 1.0.0 + powershell-utils: 0.2.1 + wsl-utils: 1.0.1 + + ora@9.4.1: + dependencies: + chalk: 5.6.2 + cli-cursor: 5.0.0 + cli-spinners: 3.4.0 + is-interactive: 2.0.0 + is-unicode-supported: 2.1.0 + log-symbols: 7.0.1 + stdin-discarder: 0.3.2 + string-width: 8.3.0 + + picomatch@2.3.2: {} + + picomatch@4.0.7: {} + + powershell-utils@0.2.1: {} + + rc9@3.1.0: + dependencies: + defu: 6.1.7 + destr: 2.0.5 + + readdirp@5.1.1: {} + + require-from-string@2.0.2: {} + + restore-cursor@5.1.0: + dependencies: + onetime: 7.0.0 + signal-exit: 4.1.0 + + rolldown@1.3.2: + dependencies: + '@oxc-project/types': 0.158.0 + '@rolldown/pluginutils': 1.1.0 + optionalDependencies: + '@rolldown/binding-android-arm-eabi': 1.3.2 + '@rolldown/binding-android-arm64': 1.3.2 + '@rolldown/binding-darwin-arm64': 1.3.2 + '@rolldown/binding-darwin-x64': 1.3.2 + '@rolldown/binding-freebsd-x64': 1.3.2 + '@rolldown/binding-linux-arm-gnueabihf': 1.3.2 + '@rolldown/binding-linux-arm64-gnu': 1.3.2 + '@rolldown/binding-linux-arm64-musl': 1.3.2 + '@rolldown/binding-linux-ppc64-gnu': 1.3.2 + '@rolldown/binding-linux-s390x-gnu': 1.3.2 + '@rolldown/binding-linux-x64-gnu': 1.3.2 + '@rolldown/binding-linux-x64-musl': 1.3.2 + '@rolldown/binding-openharmony-arm64': 1.3.2 + '@rolldown/binding-wasm32-wasi': 1.3.2 + '@rolldown/binding-win32-arm64-msvc': 1.3.2 + '@rolldown/binding-win32-x64-msvc': 1.3.2 + + run-applescript@7.1.0: {} + + rxjs@7.8.2: + dependencies: + tslib: 2.9.1 + + safer-buffer@2.1.2: {} + + semver@7.8.6: {} + + signal-exit@4.1.0: {} + + skin-tone@2.0.0: + dependencies: + unicode-emoji-modifier-base: 1.0.0 + + source-map@0.8.0: {} + + stdin-discarder@0.3.2: {} + + string-width@8.3.0: + dependencies: + get-east-asian-width: 1.7.0 + strip-ansi: 7.2.0 + + strip-ansi@7.2.0: + dependencies: + ansi-regex: 6.6.0 + + tar@7.5.23: + dependencies: + '@isaacs/fs-minipass': 4.0.1 + chownr: 3.0.0 + minipass: 7.1.3 + minizlib: 3.1.0 + yallist: 5.0.0 + + to-regex-range@5.0.1: + dependencies: + is-number: 7.0.0 + + tslib@2.9.1: {} + + typescript@6.0.3: {} + + unicode-emoji-modifier-base@1.0.0: {} + + unrun@0.3.1: + dependencies: + rolldown: 1.3.2 + + validator@13.15.35: {} + + wsl-utils@1.0.1: + dependencies: + is-wsl: 3.1.1 + powershell-utils: 0.2.1 + + yallist@5.0.0: {} + + yoctocolors@2.2.0: {} + + zod@4.6.7: {} diff --git a/basics/input-keyboard/pnpm-workspace.yaml b/basics/input-keyboard/pnpm-workspace.yaml new file mode 100644 index 0000000..96ca535 --- /dev/null +++ b/basics/input-keyboard/pnpm-workspace.yaml @@ -0,0 +1,5 @@ +allowBuilds: + bun: true +# NanoForge packages are ours: take a release as soon as it is out. +minimumReleaseAgeExclude: + - "@nanoforge-dev/*" diff --git a/basics/input-keyboard/src/components/acceleration-2d.component.ts b/basics/input-keyboard/src/components/acceleration-2d.component.ts new file mode 100644 index 0000000..5d4097f --- /dev/null +++ b/basics/input-keyboard/src/components/acceleration-2d.component.ts @@ -0,0 +1,18 @@ +/** + * How fast the velocity of an entity changes, in pixels per second, per second. Needs + * `Velocity2D` and the `move2D` system. + * + * @component + * @side shared + * @group Acceleration color=#f0a33a - Pixels per second, per second. + */ +export class Acceleration2D { + name = "Acceleration2D"; + + constructor( + /** Added to the horizontal velocity every second. @group Acceleration @preset vector.x */ + public x = 0, + /** Added to the vertical velocity every second. @group Acceleration @preset vector.y */ + public y = 0, + ) {} +} diff --git a/basics/input-keyboard/src/components/drawable-circle-2d.component.ts b/basics/input-keyboard/src/components/drawable-circle-2d.component.ts new file mode 100644 index 0000000..1066155 --- /dev/null +++ b/basics/input-keyboard/src/components/drawable-circle-2d.component.ts @@ -0,0 +1,62 @@ +import type { AssetContext } from "@nanoforge-dev/common"; +import { Circle, type Layer } from "@nanoforge-dev/graphics-2d"; +import type { Position2D } from "./position-2d.component"; + +import { imageFill } from "../image-fill"; + +/** + * Draws a circle at the entity's `Position2D` (its center). Needs the `draw2D` system. + * + * @remarks + * `shape` is the Konva `Circle` on screen: change it from code for anything the parameters don't + * offer (shadows, strokes...). + * + * @component + * @side client + * @group Shape color=#e86fb0 - Size of the circle. + * @group Look color=#b18cff - What the circle looks like. + * @group Advanced hidden - Less common settings. + */ +export class DrawableCircle2D { + name = "DrawableCircle2D"; + + /** The circle on screen, made by `draw2D` the first time it draws it. */ + shape?: Circle; + + constructor( + /** In pixels. @group Shape */ + public radius = 25, + /** A CSS color: `red`, `#ff0000`, `rgba(255, 0, 0, 0.5)`... @group Look @preset color */ + public fillColor = "#4aa3ff", + /** An image stretched over the circle, shown instead of the color. @group Look @asset .png .jpg .jpeg .gif .webp .svg */ + public image = "", + /** From 0 (invisible) to 1 (opaque). @group Look */ + public opacity = 1, + /** Clockwise, in degrees, around the center. @group Advanced */ + public rotation = 0, + /** Whether it is drawn. @group Advanced */ + public visible = true, + ) {} + + /** Puts the circle on `layer` at `position`, up to date with the parameters. */ + draw(layer: Layer, position: Position2D, assets: AssetContext): void { + this.shape ??= new Circle(); + if (this.shape.getParent() !== layer) layer.add(this.shape); + this.shape.setAttrs({ + x: position.x, + y: position.y, + radius: this.radius, + fill: this.fillColor, + opacity: this.opacity, + rotation: this.rotation, + visible: this.visible, + ...imageFill(assets, this.image, this.radius * 2, this.radius * 2, true), + }); + } + + /** Removes the circle from the screen. */ + destroy(): void { + this.shape?.destroy(); + this.shape = undefined; + } +} diff --git a/basics/input-keyboard/src/components/drawable-rect-2d.component.ts b/basics/input-keyboard/src/components/drawable-rect-2d.component.ts new file mode 100644 index 0000000..d3586ca --- /dev/null +++ b/basics/input-keyboard/src/components/drawable-rect-2d.component.ts @@ -0,0 +1,69 @@ +import type { AssetContext } from "@nanoforge-dev/common"; +import { type Layer, Rect } from "@nanoforge-dev/graphics-2d"; +import type { Position2D } from "./position-2d.component"; + +import { imageFill } from "../image-fill"; + +/** + * Draws a rectangle at the entity's `Position2D` (its top-left corner). Needs the `draw2D` + * system. + * + * @remarks + * `shape` is the Konva `Rect` on screen: change it from code for anything the parameters don't + * offer (shadows, strokes...). + * + * @component + * @side client + * @group Shape color=#e86fb0 - Size of the rectangle. + * @group Look color=#b18cff - What the rectangle looks like. + * @group Advanced hidden - Less common settings. + */ +export class DrawableRect2D { + name = "DrawableRect2D"; + + /** The rectangle on screen, made by `draw2D` the first time it draws it. */ + shape?: Rect; + + constructor( + /** In pixels. @group Shape @preset size.width */ + public width = 50, + /** In pixels. @group Shape @preset size.height */ + public height = 50, + /** A CSS color: `red`, `#ff0000`, `rgba(255, 0, 0, 0.5)`... @group Look @preset color */ + public fillColor = "#4aa3ff", + /** An image stretched over the rectangle, shown instead of the color. @group Look @asset .png .jpg .jpeg .gif .webp .svg */ + public image = "", + /** From 0 (invisible) to 1 (opaque). @group Look */ + public opacity = 1, + /** Clockwise, in degrees, around the top-left corner. @group Advanced */ + public rotation = 0, + /** Rounds the corners, in pixels. @group Advanced */ + public cornerRadius = 0, + /** Whether it is drawn. @group Advanced */ + public visible = true, + ) {} + + /** Puts the rectangle on `layer` at `position`, up to date with the parameters. */ + draw(layer: Layer, position: Position2D, assets: AssetContext): void { + this.shape ??= new Rect(); + if (this.shape.getParent() !== layer) layer.add(this.shape); + this.shape.setAttrs({ + x: position.x, + y: position.y, + width: this.width, + height: this.height, + fill: this.fillColor, + opacity: this.opacity, + rotation: this.rotation, + cornerRadius: this.cornerRadius, + visible: this.visible, + ...imageFill(assets, this.image, this.width, this.height), + }); + } + + /** Removes the rectangle from the screen. */ + destroy(): void { + this.shape?.destroy(); + this.shape = undefined; + } +} diff --git a/basics/input-keyboard/src/components/drawable-text-2d.component.ts b/basics/input-keyboard/src/components/drawable-text-2d.component.ts new file mode 100644 index 0000000..adba963 --- /dev/null +++ b/basics/input-keyboard/src/components/drawable-text-2d.component.ts @@ -0,0 +1,62 @@ +import { type Layer, Text } from "@nanoforge-dev/graphics-2d"; +import type { Position2D } from "./position-2d.component"; + +/** + * Draws a text at the entity's `Position2D` (its top-left corner). Needs the `draw2D` system. + * + * @remarks + * Change `text` from a system to show a score, a timer... `shape` is the Konva `Text` on screen: + * change it from code for anything the parameters don't offer. + * + * @component + * @side client + * @group Text color=#e86fb0 - What is written. + * @group Look color=#b18cff - What the text looks like. + * @group Advanced hidden - Less common settings. + */ +export class DrawableText2D { + name = "DrawableText2D"; + + /** The text on screen, made by `draw2D` the first time it draws it. */ + shape?: Text; + + constructor( + /** What is written. @group Text */ + public text = "Hello", + /** Height of the letters, in pixels. @group Text */ + public fontSize = 24, + /** A CSS color: `white`, `#ffffff`... @group Look @preset color */ + public fillColor = "#ffffff", + /** From 0 (invisible) to 1 (opaque). @group Look */ + public opacity = 1, + /** A CSS font family: `Arial`, `monospace`... @group Advanced */ + public fontFamily = "Arial", + /** Clockwise, in degrees, around the top-left corner. @group Advanced */ + public rotation = 0, + /** Whether it is drawn. @group Advanced */ + public visible = true, + ) {} + + /** Puts the text on `layer` at `position`, up to date with the parameters. */ + draw(layer: Layer, position: Position2D): void { + this.shape ??= new Text(); + if (this.shape.getParent() !== layer) layer.add(this.shape); + this.shape.setAttrs({ + x: position.x, + y: position.y, + text: this.text, + fontSize: this.fontSize, + fontFamily: this.fontFamily, + fill: this.fillColor, + opacity: this.opacity, + rotation: this.rotation, + visible: this.visible, + }); + } + + /** Removes the text from the screen. */ + destroy(): void { + this.shape?.destroy(); + this.shape = undefined; + } +} diff --git a/basics/input-keyboard/src/components/move-controller-2d.component.ts b/basics/input-keyboard/src/components/move-controller-2d.component.ts new file mode 100644 index 0000000..75ffcf0 --- /dev/null +++ b/basics/input-keyboard/src/components/move-controller-2d.component.ts @@ -0,0 +1,33 @@ +import { InputEnum } from "@nanoforge-dev/input"; + +/** + * Moves an entity with the keyboard, by setting its `Velocity2D`. Needs the `moveControl2D` + * system. + * + * @example + * For a platformer, set `axes` to `horizontal`: the vertical velocity is left to gravity and + * jumps. + * + * @component + * @side client + * @group Movement color=#9d7bff - How the entity moves. + * @group Keys color=#f0a33a - The keys that move it. + */ +export class MoveController2D { + name = "MoveController2D"; + + constructor( + /** In pixels per second. @group Movement */ + public speed = 200, + /** Which directions the keys move it in. @group Movement */ + public axes: "both" | "horizontal" | "vertical" = "both", + /** @group Keys */ + public left: InputEnum = InputEnum.ArrowLeft, + /** @group Keys */ + public right: InputEnum = InputEnum.ArrowRight, + /** @group Keys */ + public up: InputEnum = InputEnum.ArrowUp, + /** @group Keys */ + public down: InputEnum = InputEnum.ArrowDown, + ) {} +} diff --git a/basics/input-keyboard/src/components/position-2d.component.ts b/basics/input-keyboard/src/components/position-2d.component.ts new file mode 100644 index 0000000..0a35624 --- /dev/null +++ b/basics/input-keyboard/src/components/position-2d.component.ts @@ -0,0 +1,20 @@ +/** + * Where an entity is, in pixels from the top-left corner of the screen. + * + * @remarks + * For rectangles it is their top-left corner, for circles their center. + * + * @component + * @side shared + * @group Position color=#4aa3ff - Pixels from the top-left corner of the screen. + */ +export class Position2D { + name = "Position2D"; + + constructor( + /** Pixels from the left edge. @group Position @preset vector.x */ + public x = 0, + /** Pixels from the top edge. @group Position @preset vector.y */ + public y = 0, + ) {} +} diff --git a/basics/input-keyboard/src/components/velocity-2d.component.ts b/basics/input-keyboard/src/components/velocity-2d.component.ts new file mode 100644 index 0000000..3b93d4e --- /dev/null +++ b/basics/input-keyboard/src/components/velocity-2d.component.ts @@ -0,0 +1,20 @@ +/** + * How fast an entity moves, in pixels per second. Needs `Position2D` and the `move2D` system. + * + * @example + * `new Velocity2D(100, 0)` moves 100 pixels to the right every second. + * + * @component + * @side shared + * @group Velocity color=#36c5a0 - Pixels per second. + */ +export class Velocity2D { + name = "Velocity2D"; + + constructor( + /** Pixels per second to the right (negative: to the left). @group Velocity @preset vector.x */ + public x = 0, + /** Pixels per second downward (negative: upward). @group Velocity @preset vector.y */ + public y = 0, + ) {} +} diff --git a/basics/input-keyboard/src/image-fill.ts b/basics/input-keyboard/src/image-fill.ts new file mode 100644 index 0000000..c7fc737 --- /dev/null +++ b/basics/input-keyboard/src/image-fill.ts @@ -0,0 +1,43 @@ +import type { AssetContext } from "@nanoforge-dev/common"; +import type { ShapeConfig } from "@nanoforge-dev/graphics-2d"; + +const images = new Map(); + +/** + * The fill of a shape of `width` by `height` pixels showing the image at `path` (an asset path + * such as `/textures/hero.png`, found in `assets`) stretched over it. Without an image, until it + * is loaded, or when there is no asset at `path`, the shape is filled with its color. + * + * @param centered - Whether the shape's origin is its center (a circle) instead of its top-left + * corner (a rectangle). + */ +export const imageFill = ( + assets: AssetContext, + path: string, + width: number, + height: number, + centered = false, +): ShapeConfig => { + if (!path) return { fillPriority: "color", fillPatternImage: undefined }; + let image = images.get(path); + if (!image) { + image = document.createElement("img"); + try { + image.src = assets.getAsset(path).path; + } catch (error) { + // Once per path, not every frame: the shape keeps its color. + console.warn(`No image at "${path}":`, error); + } + images.set(path, image); + } + if (!image.naturalWidth) return { fillPriority: "color", fillPatternImage: undefined }; + return { + fillPriority: "pattern", + fillPatternImage: image, + fillPatternRepeat: "no-repeat", + fillPatternScaleX: width / image.naturalWidth, + fillPatternScaleY: height / image.naturalHeight, + fillPatternOffsetX: centered ? image.naturalWidth / 2 : 0, + fillPatternOffsetY: centered ? image.naturalHeight / 2 : 0, + }; +}; diff --git a/basics/input-keyboard/src/main.ts b/basics/input-keyboard/src/main.ts new file mode 100644 index 0000000..9315b5b --- /dev/null +++ b/basics/input-keyboard/src/main.ts @@ -0,0 +1,68 @@ +import type { ClientRunOptions } from "@nanoforge-dev/common"; +import { NanoforgeFactory } from "@nanoforge-dev/core"; +import { EcsLibrary } from "@nanoforge-dev/ecs/client"; +import { EditorLibrary } from "@nanoforge-dev/editor-lib"; +import { Graphics2DLibrary } from "@nanoforge-dev/graphics-2d"; +import { InputEnum, InputLibrary } from "@nanoforge-dev/input"; + +import { DrawableRect2D } from "./components/drawable-rect-2d.component"; +import { DrawableText2D } from "./components/drawable-text-2d.component"; +import { MoveController2D } from "./components/move-controller-2d.component"; +import { Position2D } from "./components/position-2d.component"; +import { Velocity2D } from "./components/velocity-2d.component"; +import { draw2D } from "./systems/draw-2d.system"; +import { move2D } from "./systems/move-2d.system"; +import { moveControl2D } from "./systems/move-control-2d.system"; + +export const main = async (options: ClientRunOptions): Promise => { + const app = NanoforgeFactory.createClient({ + tickRate: 60, + viewport: { width: 800, height: 600, fit: "contain" }, + }); + const ecs = new EcsLibrary(); + + app.use(new Graphics2DLibrary()); + app.use(ecs); + app.use(new InputLibrary()); + app.use(new EditorLibrary()); + + await app.init(options); + + const registry = ecs.registry; + + const background = registry.spawnEntity(); + registry.addComponent(background, new Position2D(0, 0)); + registry.addComponent(background, new DrawableRect2D(800, 600, "#1e1e2e")); + + const help = registry.spawnEntity(); + registry.addComponent(help, new Position2D(20, 20)); + registry.addComponent(help, new DrawableText2D("Arrows or WASD to move", 24, "#cdd6f4")); + + const arrows = registry.spawnEntity(); + registry.addComponent(arrows, new Position2D(250, 270)); + registry.addComponent(arrows, new Velocity2D(0, 0)); + registry.addComponent(arrows, new MoveController2D(300, "both")); + registry.addComponent(arrows, new DrawableRect2D(60, 60, "#f38ba8")); + + const wasd = registry.spawnEntity(); + registry.addComponent(wasd, new Position2D(490, 270)); + registry.addComponent(wasd, new Velocity2D(0, 0)); + registry.addComponent( + wasd, + new MoveController2D( + 300, + "both", + InputEnum.KeyA, + InputEnum.KeyD, + InputEnum.KeyW, + InputEnum.KeyS, + ), + ); + registry.addComponent(wasd, new DrawableRect2D(60, 60, "#a6e3a1")); + + registry.addSystem(moveControl2D); + registry.addSystem(move2D); + registry.addSystem(draw2D); + + await app.run(); +}; diff --git a/basics/input-keyboard/src/systems/draw-2d.system.ts b/basics/input-keyboard/src/systems/draw-2d.system.ts new file mode 100644 index 0000000..937eeeb --- /dev/null +++ b/basics/input-keyboard/src/systems/draw-2d.system.ts @@ -0,0 +1,45 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; +import "@nanoforge-dev/graphics-2d"; +import { Position2D } from "../components/position-2d.component"; + +import { DrawableCircle2D } from "../components/drawable-circle-2d.component"; +import { DrawableRect2D } from "../components/drawable-rect-2d.component"; +import { DrawableText2D } from "../components/drawable-text-2d.component"; + +type Drawable = DrawableRect2D | DrawableCircle2D | DrawableText2D; + +/** The drawables shown by the last frame. */ +let shown = new Set(); + +/** + * Draws every entity that has a `Position2D` and a `DrawableRect2D`, `DrawableCircle2D` or + * `DrawableText2D`, where it is. Add it last, after the systems that move entities. + * + * @remarks + * The shape of a killed entity, or of a removed drawable, is removed from the screen. + * + * @system + * @side client + */ +export const draw2D = (registry: Registry, ctx: Context) => { + const layer = ctx.graphics.baseLayer; + const drawn = new Set(); + + registry.getZipper([DrawableRect2D, Position2D]).forEach(({ DrawableRect2D, Position2D }) => { + DrawableRect2D.draw(layer, Position2D, ctx.assets); + drawn.add(DrawableRect2D); + }); + registry.getZipper([DrawableCircle2D, Position2D]).forEach(({ DrawableCircle2D, Position2D }) => { + DrawableCircle2D.draw(layer, Position2D, ctx.assets); + drawn.add(DrawableCircle2D); + }); + registry.getZipper([DrawableText2D, Position2D]).forEach(({ DrawableText2D, Position2D }) => { + DrawableText2D.draw(layer, Position2D); + drawn.add(DrawableText2D); + }); + + // `killEntity` doesn't call `destroy()`: a drawable no longer in the world loses its shape here. + for (const drawable of shown) if (!drawn.has(drawable)) drawable.destroy(); + shown = drawn; +}; diff --git a/basics/input-keyboard/src/systems/move-2d.system.ts b/basics/input-keyboard/src/systems/move-2d.system.ts new file mode 100644 index 0000000..514766a --- /dev/null +++ b/basics/input-keyboard/src/systems/move-2d.system.ts @@ -0,0 +1,26 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; + +import { Acceleration2D } from "../components/acceleration-2d.component"; +import { Position2D } from "../components/position-2d.component"; +import { Velocity2D } from "../components/velocity-2d.component"; + +/** + * Moves entities: their `Acceleration2D` changes their `Velocity2D`, then their `Velocity2D` + * changes their `Position2D`, by the time elapsed since the last frame. + * + * @system + * @side shared + */ +export const move2D = (registry: Registry, ctx: Context) => { + const seconds = ctx.app.delta / 1000; + + registry.getZipper([Acceleration2D, Velocity2D]).forEach(({ Acceleration2D, Velocity2D }) => { + Velocity2D.x += Acceleration2D.x * seconds; + Velocity2D.y += Acceleration2D.y * seconds; + }); + registry.getZipper([Position2D, Velocity2D]).forEach(({ Position2D, Velocity2D }) => { + Position2D.x += Velocity2D.x * seconds; + Position2D.y += Velocity2D.y * seconds; + }); +}; diff --git a/basics/input-keyboard/src/systems/move-control-2d.system.ts b/basics/input-keyboard/src/systems/move-control-2d.system.ts new file mode 100644 index 0000000..71ad4f7 --- /dev/null +++ b/basics/input-keyboard/src/systems/move-control-2d.system.ts @@ -0,0 +1,23 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; +import "@nanoforge-dev/input"; +import { Velocity2D } from "../components/velocity-2d.component"; + +import { MoveController2D } from "../components/move-controller-2d.component"; + +/** + * Sets the `Velocity2D` of `MoveController2D` entities from the keys held down. Add it before + * `move2D`. + * + * @system + * @side client + */ +export const moveControl2D = (registry: Registry, ctx: Context) => { + const held = (key: MoveController2D["left"]) => Number(ctx.input.isKeyPressed(key) === true); + + registry.getZipper([MoveController2D, Velocity2D]).forEach(({ MoveController2D, Velocity2D }) => { + const { speed, axes, left, right, up, down } = MoveController2D as MoveController2D; + if (axes !== "vertical") Velocity2D.x = (held(right) - held(left)) * speed; + if (axes !== "horizontal") Velocity2D.y = (held(down) - held(up)) * speed; + }); +}; diff --git a/basics/input-keyboard/tsconfig.json b/basics/input-keyboard/tsconfig.json new file mode 100644 index 0000000..c0ae4f2 --- /dev/null +++ b/basics/input-keyboard/tsconfig.json @@ -0,0 +1,39 @@ +{ + "$schema": "https://json.schemastore.org/tsconfig.json", + // Mapped from https://www.typescriptlang.org/tsconfig + "compilerOptions": { + // Type Checking + "allowUnreachableCode": false, + "allowUnusedLabels": false, + "noFallthroughCasesInSwitch": true, + "noImplicitOverride": true, + "noImplicitReturns": true, + "noPropertyAccessFromIndexSignature": false, + "noUncheckedIndexedAccess": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "strict": true, + + // Modules + "allowArbitraryExtensions": false, + "allowImportingTsExtensions": false, + "module": "ESNext", + "moduleResolution": "Bundler", + "resolveJsonModule": true, + "resolvePackageJsonExports": true, + "resolvePackageJsonImports": true, + + // Interop Constraints + "allowSyntheticDefaultImports": true, + "forceConsistentCasingInFileNames": true, + "isolatedModules": true, + + // Language and Environment + "experimentalDecorators": true, + "lib": ["ESNext", "esnext.disposable", "DOM"], + "target": "ESNext", + "useDefineForClassFields": true + }, + "include": ["src"], + "exclude": ["node_modules", ".nanoforge", "dist"] +} diff --git a/basics/input-mouse/.gitignore b/basics/input-mouse/.gitignore new file mode 100644 index 0000000..f28e2dc --- /dev/null +++ b/basics/input-mouse/.gitignore @@ -0,0 +1,5 @@ +node_modules/ +dist/ +.nanoforge/ +nf_modules/ +.env diff --git a/basics/input-mouse/README.md b/basics/input-mouse/README.md new file mode 100644 index 0000000..a62b24e --- /dev/null +++ b/basics/input-mouse/README.md @@ -0,0 +1,20 @@ +# input-mouse + +A dot follows the mouse, two squares can be dragged with the left button, and a line at the +bottom shows the cursor position and the number of left clicks. + +It shows the mouse side of the `input` engine library: + +- `followMouse2D` reads `ctx.input.getMousePosition()` (in game coordinates); +- `drag2D` reads `ctx.input.getDragState()`: a drag that starts on a `Draggable2D` rectangle + carries it until the button is released; +- `showMouseReadout` counts clicks with `ctx.input.isKeyPressed(InputEnum.MouseLeft)`. + +```sh +pnpm install +pnpm dev # play it +pnpm editor # open it in the editor +``` + +`image-fill.ts`, the `Position2D`, `DrawableRect2D`, `DrawableCircle2D` and `DrawableText2D` +components and the `draw2D` system are copies of `shared/2d` (see the repository's README). diff --git a/basics/input-mouse/assets/.gitkeep b/basics/input-mouse/assets/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/basics/input-mouse/nanoforge.config.ts b/basics/input-mouse/nanoforge.config.ts new file mode 100644 index 0000000..77607cb --- /dev/null +++ b/basics/input-mouse/nanoforge.config.ts @@ -0,0 +1,5 @@ +import { defineConfig } from "@nanoforge-dev/config"; + +export default defineConfig({ + type: "client", +}); diff --git a/basics/input-mouse/package.json b/basics/input-mouse/package.json new file mode 100644 index 0000000..e4974f7 --- /dev/null +++ b/basics/input-mouse/package.json @@ -0,0 +1,26 @@ +{ + "$schema": "https://json.schemastore.org/package.json", + "name": "input-mouse", + "description": "Follow, click and drag with the mouse: the smallest NanoForge game reading the mouse", + "private": true, + "type": "module", + "scripts": { + "dev": "nf dev", + "build": "nf build", + "start": "nf start", + "editor": "nf editor ." + }, + "devDependencies": { + "@nanoforge-dev/asset": "^3.0.0", + "@nanoforge-dev/cli": "^3.0.1", + "@nanoforge-dev/common": "^3.0.0", + "@nanoforge-dev/config": "^3.0.1", + "@nanoforge-dev/core": "^3.0.0", + "@nanoforge-dev/ecs": "^3.0.0", + "@nanoforge-dev/editor-lib": "^3.0.0", + "@nanoforge-dev/env": "^3.0.0", + "@nanoforge-dev/graphics-2d": "^3.0.0", + "@nanoforge-dev/input": "^3.0.0", + "typescript": "^6.0.0" + } +} diff --git a/basics/input-mouse/pnpm-lock.yaml b/basics/input-mouse/pnpm-lock.yaml new file mode 100644 index 0000000..9aca6d9 --- /dev/null +++ b/basics/input-mouse/pnpm-lock.yaml @@ -0,0 +1,1512 @@ +lockfileVersion: '9.0' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + +importers: + + .: + devDependencies: + '@nanoforge-dev/asset': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/cli': + specifier: ^3.0.1 + version: 3.0.1 + '@nanoforge-dev/common': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/config': + specifier: ^3.0.1 + version: 3.0.1 + '@nanoforge-dev/core': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/ecs': + specifier: ^3.0.0 + version: 3.0.0(@nanoforge-dev/editor-lib@3.0.0) + '@nanoforge-dev/editor-lib': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/env': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/graphics-2d': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/input': + specifier: ^3.0.0 + version: 3.0.0 + typescript: + specifier: ^6.0.0 + version: 6.0.3 + +packages: + + '@angular-devkit/core@22.2.7': + resolution: {integrity: sha512-cchZAMsV4d76RDZBlWzPhYxM/Hb6bmq71oUngdrwehMbBbdQu3W9C2tGlvxuPxbRKru9ZlUa14YVXQ0+QnhFtw==} + engines: {node: ^22.22.3 || ^24.15.0 || >=26.0.0, npm: ^6.11.0 || ^7.5.6 || >=8.0.0, yarn: '>= 1.13.0'} + peerDependencies: + chokidar: ^5.0.0 + peerDependenciesMeta: + chokidar: + optional: true + + '@angular-devkit/schematics-cli@22.2.7': + resolution: {integrity: sha512-9Od0E8TiYTQWm/03QjYWnsryZA8ZSjTf/k5z61nPd/jgloVNvSW8kxC7/YMw+RoXh2idMzjiJxraKxg+gJxzPw==} + engines: {node: ^22.22.3 || ^24.15.0 || >=26.0.0, npm: ^6.11.0 || ^7.5.6 || >=8.0.0, yarn: '>= 1.13.0'} + hasBin: true + + '@angular-devkit/schematics@22.2.7': + resolution: {integrity: sha512-a1h7xNqBLQVo1e5eCyOU3axSbA9AFU6nnSH5QhlNhggfMeZde+eBrueSt25xsewoxlKO8EvkVT3+knMUkDYiGQ==} + engines: {node: ^22.22.3 || ^24.15.0 || >=26.0.0, npm: ^6.11.0 || ^7.5.6 || >=8.0.0, yarn: '>= 1.13.0'} + + '@emnapi/core@2.0.0-beta.2': + resolution: {integrity: sha512-MzCVoWtcg4Pm2B3je5mMvYMvj3MmBKw+fU7vbsJc9/iT8ip6/eYIHo/Dsm/mr+wsHB6SEyJDuxB09Yy6r/8+4A==} + + '@emnapi/runtime@2.0.0-beta.2': + resolution: {integrity: sha512-JcrSPzPvZuNZvJqPTF9Fw25LbOJ8avzFVlaf2grmH4Cku0oGP47tRgqPZadcfj3YoZMHkFVnCYFbQM8I+i5QEw==} + + '@emnapi/wasi-threads@2.2.0': + resolution: {integrity: sha512-JP7OYH38Q7+pyTAe14raZHLQIK7BDKbdwji+Xi3pcd/6QkJYQH3SX4wu6EplGrGJWRepoNzedfm0G3B9Z4e9Rw==} + + '@inquirer/ansi@2.1.0': + resolution: {integrity: sha512-63GU5AD9KhNbWM0jlhHoMJTEFck2upFOPxHlnCKf3xYTV3rjTUUQfodihmTnfYQzMLS29oy8lK/gA1eJgu4bhA==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + + '@inquirer/checkbox@5.3.0': + resolution: {integrity: sha512-3QQSO87A+JoRtOtjtsgX2enwTL+3+VBVrkUpdqrIxMOgn5+W5sE57PcCPAiNUIESHxV4Q6mNEGxq2xLmRa0/yw==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/confirm@6.4.0': + resolution: {integrity: sha512-+DCZxrOF01Q/1SzTQkgycAQPS/Jf+Yol0h1P/MVmopukTsxGOu1h/LKqf30y0eHKFZYYrgUMVhGDhEbPmSPi9A==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/core@12.1.0': + resolution: {integrity: sha512-6H7usRWw4Gdjgpaem10CA5MfZ/xoYPGyInriR1Xubqjv+SVo8LIJ1erpFxW5JgCza6VZVZiKLTko7RtUU3AQMg==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/editor@5.4.0': + resolution: {integrity: sha512-L7vdCe4jnMpzhDisu1tAnr4WGvfPOVz+vNFXyIIL7O2Ycn/n90sn1ARvg+4cwzLf+us51BE/cX7uhnrLcal3+g==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/expand@5.2.0': + resolution: {integrity: sha512-AOp2KQk7QojUyWOP7VkqdBWmxLRaVH58wQMx3N4//P530EDtpVp1EWIjAJubx9ZohWS/UCEpIkA1TuiNki0iOA==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/external-editor@3.1.0': + resolution: {integrity: sha512-27JAkF38nXqXaoveU28iA/+Z8nutnF8B3JsbdToPHn9WnkrsMtZ0/YoJ29YwbtFexYIo+tIy6ikMvTdHKjjmGA==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/figures@2.1.0': + resolution: {integrity: sha512-CR9u2PME23jxy2SOyTb117efwAAPm98Zr+LoWI+PiQ55D6U8Yeu/HyFTxwytKhPa6oxAGzdsm2Kg7oLS6B9z8w==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + + '@inquirer/input@5.2.0': + resolution: {integrity: sha512-sIUPnN2X7M+7dq3RUd+e9QRacYnM+6B+kSucwQgj5VC5Eo/f+CIr2NyPBumxsViI+wzfokkgop/3x3KfHxNyJw==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/number@4.3.0': + resolution: {integrity: sha512-xYkX4sPVgox0F7yQwpz/MByWjOGdLEf1pdjH+Lji2gAzSs2xezz5bN5YgS1n0tx9wo0mRhGvq1KJGtvDZ9XXcQ==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/password@5.3.0': + resolution: {integrity: sha512-KVqW4G/UbMK06uBN76xF89JKYC9YBWU7v+Kc2tUwMCO8pg3ASBr0HVabl1KaSqF94O2KiRu8aKx4EicN78PK+A==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/prompts@8.7.2': + resolution: {integrity: sha512-QoRB4wFIjgH5iOhSjoIKMkTvSHDuV+O3OITlIqAYO0oK5x364GJILXiMBvlPiE+klg7Xx9tq5XVqQHcGUDYYPA==} + engines: {node: '>=23.5.0 || ^22.13.0 || ^20.17.0'} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/prompts@8.8.0': + resolution: {integrity: sha512-yYVT2Eo3mafb9tnU2Mr3+wh5wLCWyspExqVoPSMCIfBIn3ZUTE4IDfbCMbMgXaOH0tH+JZEhOtfczQhDzOjIGg==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/rawlist@5.4.0': + resolution: {integrity: sha512-x42wcy465GM5/mHNKBFdAJbLlLyzmYqr/DEa6F49nHpI+03EFwRCRKeLGQakx5XqZ4unc2yFuS78qAD4Rb0iFA==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/search@4.4.0': + resolution: {integrity: sha512-UJ+9tkzPT1AjnvjuPFYcOdO3BVeN28bfSXajYRFZTRgA9OiNl4k2Nn2cHHPwiIDyPHlvOnmE9ZOHyXhPHtvb+A==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/select@5.3.0': + resolution: {integrity: sha512-Fmgfl0qjqCQo+/tjQpgnRXKh5N7/VpYcJh+AlYU2eHmHZLMGUBDzo+Gwc2ODzWJfXNRZmgaMhz4qULcO/C/rXg==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/type@4.3.0': + resolution: {integrity: sha512-/IA8q2nyjgyl0NGSjqiRXB8gh3We7Pzx9C0c+6Zoolu905jFc79anerrUG7+n65+qs310DRK43yi2WDI8nY59A==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@isaacs/fs-minipass@4.0.1': + resolution: {integrity: sha512-wgm9Ehl2jpeqP3zw/7mo3kRHFp5MEDhqAdwy1fTGkHAwnkGOVsgpvQhL8B5n1qlb01jV3n/bI0ZfZp5lWA1k4w==} + engines: {node: '>=18.0.0'} + + '@jridgewell/sourcemap-codec@1.6.0': + resolution: {integrity: sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw==} + + '@nanoforge-dev/asset@3.0.0': + resolution: {integrity: sha512-jqXcyCMbdcCCj7wZ/dyIpjY8hza02Pt/vY8KrNcaXTlxpTc9EE+VKuO5+fHdUXWWPgJSFt96TqAPhug+z+KH3Q==} + engines: {node: '26'} + + '@nanoforge-dev/cli@3.0.1': + resolution: {integrity: sha512-ZfrbETcAcX3vsPLO1WLSCJc2ERCAcIpbdi9Df5bmH3XLinQkDAcESkN9JkaI/vgV08A7xhTjV8zSDSwF0T73Xg==} + engines: {node: '26'} + hasBin: true + + '@nanoforge-dev/common@3.0.0': + resolution: {integrity: sha512-lzMvQ1vCElh9OcP4EqhffbY+AQXOH4IiuD1pj7VvJlpcY6hh7Bs/s4NVS0gXoJ+ibpBMe5mAq23RyzqTwk8czg==} + engines: {node: '26'} + + '@nanoforge-dev/config@3.0.1': + resolution: {integrity: sha512-XWRScOotb8IirerRx/mWLmUVYye3lo0PN/5a0MUp/eoSrhz0S6zzhGHEupRuC8aeHTjsQT7ctM3P6YyKSHZLaQ==} + engines: {node: '26'} + + '@nanoforge-dev/core@3.0.0': + resolution: {integrity: sha512-pa7Fr3TFkZVfAADBC17Qt5ru/W9vXtYB8e5eb7wurAtu8/jH/ZtqfW3kafTuWC9513MXp/h6LOCdZQhjnCt6UA==} + engines: {node: '26'} + + '@nanoforge-dev/ecs@3.0.0': + resolution: {integrity: sha512-csrXJtCzqohxtvEQs+O//xabnaLR3BXe0QpSpl7NVihF3f0iX2fNYURxNjQKxzoPYBokCnnyNxN2KFc7UmIsdA==} + engines: {node: '26'} + peerDependencies: + '@nanoforge-dev/editor-lib': 3.0.0 + '@nanoforge-dev/scene': 3.0.0 + peerDependenciesMeta: + '@nanoforge-dev/editor-lib': + optional: true + '@nanoforge-dev/scene': + optional: true + + '@nanoforge-dev/editor-lib@3.0.0': + resolution: {integrity: sha512-fSWm6bHelbxqeVESYoUUKDi9RGNxvRu6p1r41KE1DddM0RrP0/WzkFOWBvgl+psHbYNotXe723Y2Fd3p+tqPDQ==} + engines: {node: '26'} + + '@nanoforge-dev/editor@0.1.4': + resolution: {integrity: sha512-bqbrH8ulFSiZz1iisJHtHeEzj1RV/70uErCYHeW4DIhVPsWbBfWKFvg/ghAbmPk5vsj0YnhDX6DSpik4S1QoiQ==} + engines: {node: '25'} + + '@nanoforge-dev/env@3.0.0': + resolution: {integrity: sha512-kXYXl9/09Bn8VStTTFuZY3dYDG9b76VhOi9PHMnaLe75XcFRLKJ2dYkXf3ut6RCL2+6H7HAEIOALjR15CHnJ5A==} + engines: {node: '26'} + + '@nanoforge-dev/graphics-2d@3.0.0': + resolution: {integrity: sha512-0I0WUr5495jORdYR+HtyP4kmAfCMvixmG+EH/gE5bN33S8RO6/Ly4oMLZOLUywcDTAFuLn28BlHuVor2YfXrsg==} + engines: {node: '26'} + + '@nanoforge-dev/input@3.0.0': + resolution: {integrity: sha512-8pWU28c99VAvn37onNbVFfwXTgyQGxm5DVnTdBEzgrF3KPCzU77kEaexB1AWOlga+4qNGU7/XNm3hNZ+YS49Ig==} + engines: {node: '26'} + + '@nanoforge-dev/loader-client@1.7.0': + resolution: {integrity: sha512-zDj0yQ8cZyHHjAYDVIyB79mh4dK7WRgZG7Kc+d/43t2WX/pX2HqBVkpLcDPkA9cNOKpCRYWd3LyYISlz53gzyg==} + engines: {node: '26'} + + '@nanoforge-dev/loader-server@1.7.0': + resolution: {integrity: sha512-Yd/BYORhoar5znNSD7kGirAc1Al0q5t8iscbb07QWKeXWA+DLKjPSuKJC6ykysFkbs9HiZU59oOfxyvNL4h3Pw==} + engines: {node: '26'} + + '@nanoforge-dev/loader-website@1.7.0': + resolution: {integrity: sha512-x1fV3RYUUxru39sF5HJcfutNnifMMTIEHW92jgkR9gz06ZlZ+rQofuegXgAnEzs0dEXa+rhNQ/iXYbqOZvq6YQ==} + engines: {node: '26'} + + '@nanoforge-dev/registry@3.0.1': + resolution: {integrity: sha512-EzSaszYtrPldD5Do7jdQK3TLLb8uCirY6NQjKXkeGw31X+sUXor4h5GAaoxELWMzPnv9BbKtggSaVaQIt7s8IQ==} + engines: {node: '26'} + + '@nanoforge-dev/schematics@3.0.1': + resolution: {integrity: sha512-iK2vC0gPEh2mQ81IB4+jfGw/ZNOLMDnS9HRBXH5tWB0mdN5GA32viblhW0oYPX2/tWrLC9YiCPgEE4AL8Zwz6w==} + engines: {node: '26'} + + '@napi-rs/wasm-runtime@1.2.6': + resolution: {integrity: sha512-mRyDmEw9/fCDXCGfL1sbgIw/GUK0PVxRW4YwgPN61F3LQ+fSyoBFarJVzgGyhF6kRzEQZ0FejDqm4WLXSeqQmw==} + engines: {node: ^20.19.0 || ^22.13.0 || >=23.5.0} + peerDependencies: + '@emnapi/core': ^1.7.1 || 2.0.0-beta.2 + '@emnapi/runtime': ^1.7.1 || 2.0.0-beta.2 + + '@oven/bun-darwin-aarch64@1.4.4': + resolution: {integrity: sha512-zW/hxwc8sJAILGwB5eTC4i48ouGXf0V4lrxmEOk3JIE6JkYVW1TZh1E2pIempqsezgW1sckTIIDudFON8bJ2Mw==} + cpu: [arm64] + os: [darwin] + + '@oven/bun-darwin-x64@1.4.4': + resolution: {integrity: sha512-oKGcxLsvh4oHjAo28nPm8c/xN0o/OmGyj1IHYc94vprkWsW2hNg2keEZt5f40cI5Hvu4jDlSRTR0UNpv1UIAxw==} + cpu: [x64] + os: [darwin] + + '@oven/bun-freebsd-aarch64@1.4.4': + resolution: {integrity: sha512-klvA9FlwLxZj3JYIOPQA4bbnHIC3uas8kBE4GaGGkeVgAQP/k8hAzYkOqkSaqHBDbxLrTyFEQArEAevJq6NJzg==} + cpu: [arm64] + os: [freebsd] + + '@oven/bun-freebsd-x64@1.4.4': + resolution: {integrity: sha512-sF1xS/scbyN94P2d0eTiarO6JHxrIvhZNT9hnWjQXW5nwKRtfuP+UYnIMNyvW1BQPcZFP/cvfLBNUIe1ea4zPA==} + cpu: [x64] + os: [freebsd] + + '@oven/bun-linux-aarch64-android@1.4.4': + resolution: {integrity: sha512-5lvn3at5vRC0GxvmiqEiV2/e23tnRi0q5pzR40yfDvDA3OW7PSkt4chF1nA9vnAJhro4/l+ol1FmNP6D3cf/oA==} + cpu: [arm64] + os: [android] + + '@oven/bun-linux-aarch64-musl@1.4.4': + resolution: {integrity: sha512-QFd0P+mHJxbZFbUla4MgiE5OwxysHaUIYxL2pPNkpWtaI7v4ShOpr8OhBmsuyB0xn5rv/ZJnPsj2y8+bB9+g/A==} + cpu: [arm64] + os: [linux] + libc: [musl] + + '@oven/bun-linux-aarch64@1.4.4': + resolution: {integrity: sha512-ZTVtpf9zmHSBVPX1sBwe5agGb/rN34yPGg/Hby8e2Ax2uCUA2URZKlZH7qLntK7qaFJCMXh9v0GWNYN2zINz1w==} + cpu: [arm64] + os: [linux] + libc: [glibc] + + '@oven/bun-linux-x64-android@1.4.4': + resolution: {integrity: sha512-3dMicj9C1DhaIfDkwt/9GtpU0W+q+GazbG9OIlEyL3Q1BBEz2e6ZRz/JiO8D/ECC0caXAqvnpFudehcLlgIwWQ==} + cpu: [x64] + os: [android] + + '@oven/bun-linux-x64-musl@1.4.4': + resolution: {integrity: sha512-lEEjNOJJrbGZu2NVcPI4uXdILcpspezWkA8R/Jr0RCGhM6zQd0Y7JBIIKNAmbX59EeWpeEz7Q78iLbpcAUypUA==} + cpu: [x64] + os: [linux] + libc: [musl] + + '@oven/bun-linux-x64@1.4.4': + resolution: {integrity: sha512-CHbbkmHVM28T1GFq+6GL4Ao4ujwwYwj1CxFFwEFzLanPfNsId9AhbIP0Q4reWuWBkGimUkoQygrK7Rgjtj3vog==} + cpu: [x64] + os: [linux] + libc: [glibc] + + '@oven/bun-windows-aarch64@1.4.4': + resolution: {integrity: sha512-n0ep5ZRPCZY1+dqFJpnnRUZB1wy4GYU6At8RF+pyzySCLjkN9R4rFh2PtBHAgF/lg1vOl3/CeER3pDM+p40ATA==} + cpu: [arm64] + os: [win32] + + '@oven/bun-windows-x64@1.4.4': + resolution: {integrity: sha512-a3LNctBVO8PjePsFZfwDleF2JXYf2BfQ1u/PLRnBDLnC2Riml+4+LgJpKj4xRGhB92KweGyQI5PXaTkP9qypMQ==} + cpu: [x64] + os: [win32] + + '@oxc-project/types@0.158.0': + resolution: {integrity: sha512-xZ66qA4WmLbTLlxH3mqMd8f9UKbaOzOT0ATwFf4DH/14pMgpUrtqtjyYzOQmgfl2a0iRAAMbQ9G1th/67jRzGw==} + + '@rolldown/binding-android-arm-eabi@1.3.2': + resolution: {integrity: sha512-kqR2xcygEx3WwDY69LsKeyf7SVmx4yzMtKZRknyaHieVJdRvvnAM97L0Gq6tUFc9T2YXcW/Ghij2+Um6He0LTw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [android] + + '@rolldown/binding-android-arm64@1.3.2': + resolution: {integrity: sha512-gXM4GAAvvIZA7qUuSCQS+Zz91H2fagKa5MNppUdjzysJ8LXMWm9D/gQj4nfOKo6okquDQ5pkjsuo2SUMXNW0Rw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [android] + + '@rolldown/binding-darwin-arm64@1.3.2': + resolution: {integrity: sha512-OBs5hp3W+LwMEUmDMMMnu08ncG0t6DDgnFU+6TAucKtAfNgerYLZSr2jtREKb/JuPQ1J7bJnWIgKKkxvjuAw1g==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [darwin] + + '@rolldown/binding-darwin-x64@1.3.2': + resolution: {integrity: sha512-X0VGYd4v/gdjfa/IP6uHuMhofPoUDYvK/byk3bC0jQ1pKKgt6RZ4B4puMqP0AHkjmIHAsxA471mM6AxZ39IaTA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [darwin] + + '@rolldown/binding-freebsd-x64@1.3.2': + resolution: {integrity: sha512-mr04K4cp9J/fj9fknrX8e4QvI/V48Sp+4v64PoLwhoirIH8b8L8EBrF/0bTjV1It2IL91hoNG13GblnWLglkxA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [freebsd] + + '@rolldown/binding-linux-arm-gnueabihf@1.3.2': + resolution: {integrity: sha512-VgWy02HU9Tiy6tU8U+kF3Fd4TQwTNdIBvs2MlgViP1ksMtAnQQTIPAj0ZsJzIQXKIOugqQSpqxQgELJ3fkuL5w==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [linux] + + '@rolldown/binding-linux-arm64-gnu@1.3.2': + resolution: {integrity: sha512-0wloJFYqV844gv6boiERbHpErxbxHbmlgnMX5VxP1Ux+DLBqGrUOn0cIpBmCZEcTITes3QUelxya4u8c9ziQvQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-arm64-musl@1.3.2': + resolution: {integrity: sha512-Kys8wgFQy8H8vua0MNpC0akMBFoNO8455RHk2yycBM0iayMIAtVAL6xmV9TWAkehFgrrlImTL2fZdX5LXfYtAA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + libc: [musl] + + '@rolldown/binding-linux-ppc64-gnu@1.3.2': + resolution: {integrity: sha512-L8eej7+/StRxUHHOPsOVl7Fzx/3tumuGB4hGQZKT73xRI16KZhaSJr0gi3C3WBjNRxeJRKKps2UD4lQukP+oBw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [ppc64] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-s390x-gnu@1.3.2': + resolution: {integrity: sha512-MV5CEb/nV8neQOj7l6945q1vy62HXtWO8zPDvfySPusoUzdBoLoJ/DfXXwaYThGTXZCniF+5bCf253WTPPK7Yw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [s390x] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-x64-gnu@1.3.2': + resolution: {integrity: sha512-3qssvvVvkwQookZ1/1avlKWc5orAR85vgKdzDd5noZS8nnHiI/ejOAEt0xfNYvtBBF7/DZmP8dANWkRBJVOBCA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-x64-musl@1.3.2': + resolution: {integrity: sha512-rJqoFTm/bCZFKKgaT4NzWn/TuJkFDToZ/rzYFnYVBL28jH1nIfg6snx2mDri30nal9H+wcYfKpoPR9jrMQgQQg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + libc: [musl] + + '@rolldown/binding-openharmony-arm64@1.3.2': + resolution: {integrity: sha512-ozdbCjHfh0N//wJNExjJlSlcDaeIKo8k1ktzkLUyESr2Gu/Qw7nBYxKe3jgtoaxda570vg10WdYosre82263hQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [openharmony] + + '@rolldown/binding-wasm32-wasi@1.3.2': + resolution: {integrity: sha512-p5VA6Vk/2cXZPVWf+dDbuE0dkhrcoAo6pISTJmzUnsSdQqNJdusyR8lZgHku095+r27zrYISNLZnJoqrcePW0A==} + engines: {node: ^20.19.0 || ^22.13.0 || >=23.5.0} + cpu: [wasm32] + + '@rolldown/binding-win32-arm64-msvc@1.3.2': + resolution: {integrity: sha512-XDb2U14Orf4r76SwzvJ7avePL00w4gHBmi1Ig4B/itYFEUTmYMNDHVU0dcYuBa0LgNBqyREoJOrQKxQlyYJA7A==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [win32] + + '@rolldown/binding-win32-x64-msvc@1.3.2': + resolution: {integrity: sha512-lEsKzKJqIUDZVCBhS4lkZuyQUhV1oRg5UHkI72qlOAqJn7qEXcoVdTridFS7PHNWdZknBl95EAF/4P1Xv0K1eQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [win32] + + '@rolldown/pluginutils@1.1.0': + resolution: {integrity: sha512-K+NU2HDCEem4sClgHH4ZZXwdJeNFkJo+hRk479DIwdIviAPN2hFJH1KHHwg8CxHQXvi0M5XY4deTXINfIiSG6w==} + + '@sindresorhus/is@4.6.0': + resolution: {integrity: sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==} + engines: {node: '>=10'} + + '@tybys/wasm-util@0.10.4': + resolution: {integrity: sha512-W3c4gRigFS0T/Ma4qIYF3GDAc5AQdHb1yL5znJT1Zv1YaD9Kitx656wBjvr19qbiosmZT8lWDM5BEMynUqX65A==} + + '@types/validator@13.15.10': + resolution: {integrity: sha512-T8L6i7wCuyoK8A/ZeLYt1+q0ty3Zb9+qbSSvrIVitzT3YjZqkTZ40IbRsPanlB4h1QB3JVL1SYCdR6ngtFYcuA==} + + ajv-formats@3.0.1: + resolution: {integrity: sha512-8iUql50EUR+uUcdRQ3HDqa6EVyo3docL8g5WJ3FNcWmu62IbkGUue/pEyLBW8VGKKucTPgqeks4fIU1DA4yowQ==} + peerDependencies: + ajv: ^8.0.0 + peerDependenciesMeta: + ajv: + optional: true + + ajv@8.20.0: + resolution: {integrity: sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA==} + + ansi-regex@6.6.0: + resolution: {integrity: sha512-XZ5apbzreCbXSKwPjJstu8R0zOi247w3XYwWxtwBXgpZrCyc1Ka7p9/xY0A9/diMewmHbEKz+FIraWaEWjlN5g==} + engines: {node: '>=12'} + + ansis@4.5.0: + resolution: {integrity: sha512-KwIVkfFfJSSzBmZhDGuTmkhWqTdyB5oNVzzznBJbBZ5bZtHiqSrcugRF0RKJKT4Ss3d7ZrcjnlFVDlQNmtWfWw==} + engines: {node: '>=14'} + + braces@3.0.3: + resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} + engines: {node: '>=8'} + + bun@1.4.4: + resolution: {integrity: sha512-hj0ASdG6PNjLZGFAXktWb3Uaj/dcv/1wCsIttoEXADNIQBsGjTr+5uLKYbrDkuc7NT0Tkj4yPIqJI2jDxXdvVg==} + cpu: [arm64, x64] + os: [darwin, linux, android, freebsd, win32] + hasBin: true + + bundle-name@4.1.1: + resolution: {integrity: sha512-DdH81/zPLVS11EUgWq3tEu/xn+EzljlMYooDNdzWEnFha3R3NBMpMV1UqYIpjYHV/SgpFKMIX1Oh7o06SjM/oA==} + engines: {node: '>=18'} + + chalk@5.6.2: + resolution: {integrity: sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA==} + engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} + + char-regex@1.0.2: + resolution: {integrity: sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==} + engines: {node: '>=10'} + + chardet@2.2.0: + resolution: {integrity: sha512-rddelWYNPRrXq6PtNEN2S3f6t9ILzvqaN5pVgi4kqt9jHQaXIial9PznB5iSPVlQSLNaaH22ItWz3EJtQ10+OA==} + + chokidar@5.0.0: + resolution: {integrity: sha512-TQMmc3w+5AxjpL8iIiwebF73dRDF4fBIieAqGn9RGCWaEVwQ6Fb2cGe31Yns0RRIzii5goJ1Y7xbMwo1TxMplw==} + engines: {node: '>= 20.19.0'} + + chownr@3.0.0: + resolution: {integrity: sha512-+IxzY9BZOQd/XuYPRmrvEVjF/nqj5kgT4kEq7VofrDoM1MxoRjEWkrCC3EtLi59TVawxTAn+orJwFQcrqEN1+g==} + engines: {node: '>=18'} + + class-transformer@0.5.1: + resolution: {integrity: sha512-SQa1Ws6hUbfC98vKGxZH3KFY0Y1lm5Zm0SY8XX9zbK7FJCyVEac3ATW0RIpwzW+oOfmHE5PMPufDG9hCfoEOMw==} + + class-validator@0.14.4: + resolution: {integrity: sha512-AwNusCCam51q703dW82x95tOqQp6oC9HNUl724KxJJOfnKscI8dOloXFgyez7LbTTKWuRBA37FScqVbJEoq8Yw==} + + class-validator@0.15.1: + resolution: {integrity: sha512-LqoS80HBBSCVhz/3KloUly0ovokxpdOLR++Al3J3+dHXWt9sTKlKd4eYtoxhxyUjoe5+UcIM+5k9MIxyBWnRTw==} + + cli-cursor@5.0.0: + resolution: {integrity: sha512-aCj4O5wKyszjMmDT4tZj93kxyydN/K5zPWSCe6/0AV/AA1pqe5ZBIw0a2ZfPQV7lL5/yb5HsUreJ6UFAF1tEQw==} + engines: {node: '>=18'} + + cli-spinners@3.4.0: + resolution: {integrity: sha512-bXfOC4QcT1tKXGorxL3wbJm6XJPDqEnij2gQ2m7ESQuE+/z9YFIWnl/5RpTiKWbMq3EVKR4fRLJGn6DVfu0mpw==} + engines: {node: '>=18.20'} + + cli-width@4.1.0: + resolution: {integrity: sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==} + engines: {node: '>= 12'} + + commander@15.1.0: + resolution: {integrity: sha512-cgnQ88TRrWcC7pVq46RzJVRMktu3W2RcbnoidnfBsl1bmDCBwJS/udcIZpKoCrbAYYaCqsz1yZCVIgbIaU3ddQ==} + engines: {node: '>=22.12.0'} + + default-browser-id@5.0.1: + resolution: {integrity: sha512-x1VCxdX4t+8wVfd1so/9w+vQ4vx7lKd2Qp5tDRutErwmR85OgmfX7RlLRMWafRMY7hbEiXIbudNrjOAPa/hL8Q==} + engines: {node: '>=18'} + + default-browser@5.5.1: + resolution: {integrity: sha512-m1pAzaJgZ/gssEqlOhJkPJp8Xly7QyW6xcrkUa2KKcDeDSEMP7X8xipU3snUcfisTQx0w1AGae+9UtJSfVnXGw==} + engines: {node: '>=18'} + + define-lazy-prop@3.0.0: + resolution: {integrity: sha512-N+MeXYoqr3pOgn8xfyRPREN7gHakLYjhsHhWGT3fWAiL4IkAt0iDw14QiiEm2bE30c5XX5q0FtAA3CK5f9/BUg==} + engines: {node: '>=12'} + + defu@6.1.7: + resolution: {integrity: sha512-7z22QmUWiQ/2d0KkdYmANbRUVABpZ9SNYyH5vx6PZ+nE5bcC0l7uFvEfHlyld/HcGBFTL536ClDt3DEcSlEJAQ==} + + destr@2.0.5: + resolution: {integrity: sha512-ugFTXCtDZunbzasqBxrK93Ik/DRYsO6S/fedkWEMKqt04xZ4csmnmwGDBAb07QWNaGMAmnTIemsYZCksjATwsA==} + + dotenv@17.4.2: + resolution: {integrity: sha512-nI4U3TottKAcAD9LLud4Cb7b2QztQMUEfHbvhTH09bqXTxnSie8WnjPALV/WMCrJZ6UV/qHJ6L03OqO3LcdYZw==} + engines: {node: '>=12'} + + dotenv@18.0.10: + resolution: {integrity: sha512-89FAA1xchzK2mxVWdr5F/0rldwiueXs6zJM86rO66EzekR1iBdiXRthyG+m5GvkJaFH3C2LESzamTkgndmLT2A==} + engines: {node: '>=12'} + hasBin: true + + emojilib@2.4.0: + resolution: {integrity: sha512-5U0rVMU5Y2n2+ykNLQqMoqklN9ICBT/KsvC1Gz6vqHbz2AXXGkG+Pm5rMWk/8Vjrr/mY9985Hi8DYzn1F09Nyw==} + + fast-deep-equal@3.1.3: + resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} + + fast-string-truncated-width@3.0.3: + resolution: {integrity: sha512-0jjjIEL6+0jag3l2XWWizO64/aZVtpiGE3t0Zgqxv0DPuxiMjvB3M24fCyhZUO4KomJQPj3LTSUnDP3GpdwC0g==} + + fast-string-width@3.0.2: + resolution: {integrity: sha512-gX8LrtNEI5hq8DVUfRQMbr5lpaS4nMIWV+7XEbXk2b8kiQIizgnlr12B4dA3ZEx3308ze0O4Q1R+cHts8kyUJg==} + + fast-uri@3.1.9: + resolution: {integrity: sha512-hS/0Wt3Ya043oKXs0sIxrMpKQITXhMLIrVAKKXi4gozGC9v7YRWVnXIZzjNPTO02M9BdxLCWqK1yRXgNziVyJQ==} + + fast-wrap-ansi@0.2.2: + resolution: {integrity: sha512-7F2Fl+TjRSenLqlU3UjSH0iyqopqoZIu7eZVpEirP2g1GtWa2G/ecEmBdgz31+Mxr+ELclgg6sokpSFIQiZ02Q==} + + fflate@0.8.3: + resolution: {integrity: sha512-tbZNuJrLwGUp3zshBtdy4W+ORxZuIh8a5ilyIEQDC5rY1f3U20JMry0Ll3WBzU58EZKsEuJFXhb5gwv8CsPvgA==} + + fill-range@7.1.1: + resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} + engines: {node: '>=8'} + + get-east-asian-width@1.7.0: + resolution: {integrity: sha512-XjH1AECxf0giL2V1aU8vKyRR2ppRUb5c0EvT7zuJTokQ74bNo52zOtghqdWIqrhUD79fo3x0WfKZdOqxF6LG1Q==} + engines: {node: '>=18'} + + iconv-lite@0.7.3: + resolution: {integrity: sha512-IKXpvIzjnC9XTAUbVBcMfGS0EPaIXtW6v+zr+RRp+hqULEpo0owZax6wyRwPOJbWbzjYspQwusTsfVr0ifh4uQ==} + engines: {node: '>=0.10.0'} + + is-docker@3.0.0: + resolution: {integrity: sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + hasBin: true + + is-in-ssh@1.0.0: + resolution: {integrity: sha512-jYa6Q9rH90kR1vKB6NM7qqd1mge3Fx4Dhw5TVlK1MUBqhEOuCagrEHMevNuCcbECmXZ0ThXkRm+Ymr51HwEPAw==} + engines: {node: '>=20'} + + is-inside-container@1.0.0: + resolution: {integrity: sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA==} + engines: {node: '>=14.16'} + hasBin: true + + is-interactive@2.0.0: + resolution: {integrity: sha512-qP1vozQRI+BMOPcjFzrjXuQvdak2pHNUMZoeG2eRbiSqyvbEf/wQtEOTOX1guk6E3t36RkaqiSt8A/6YElNxLQ==} + engines: {node: '>=12'} + + is-number@7.0.0: + resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} + engines: {node: '>=0.12.0'} + + is-unicode-supported@2.1.0: + resolution: {integrity: sha512-mE00Gnza5EEB3Ds0HfMyllZzbBrmLOX3vfWoj9A9PEnTfratQ/BcaJOuMhnkhjXvb2+FkY3VuHqtAGpTPmglFQ==} + engines: {node: '>=18'} + + is-wsl@3.1.1: + resolution: {integrity: sha512-e6rvdUCiQCAuumZslxRJWR/Doq4VpPR82kqclvcS0efgt430SlGIk05vdCN58+VrzgtIcfNODjozVielycD4Sw==} + engines: {node: '>=16'} + + json-schema-traverse@1.0.0: + resolution: {integrity: sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==} + + jsonc-parser@3.3.1: + resolution: {integrity: sha512-HUgH65KyejrUFPvHFPbqOY0rsFip3Bo5wb4ngvdi1EpCYWUQDC5V+Y7mZws+DLkr4M//zQJoanu1SP+87Dv1oQ==} + + konva@10.9.1: + resolution: {integrity: sha512-m49x+GatSxEUSvqahYhxpTjgKbtrLtw4P4o4B4iux953ZFpceaK52Ea+CFsAsd7W4I0Y5u6mMoRUsY/eltNZmw==} + peerDependencies: + canvas: ^3.0.0 + skia-canvas: ^3.0.0 + peerDependenciesMeta: + canvas: + optional: true + skia-canvas: + optional: true + + libphonenumber-js@1.13.16: + resolution: {integrity: sha512-tIOCM9yx2Go6d5/ZANe0K+G4AZek1Ymx81HxQpf19Sri4zMP95eQbKdnUGHAvFQ4nx0PeLhFqvAfisTADXj3tQ==} + + log-symbols@7.0.1: + resolution: {integrity: sha512-ja1E3yCr9i/0hmBVaM0bfwDjnGy8I/s6PP4DFp+yP+a+mrHO4Rm7DtmnqROTUkHIkqffC84YY7AeqX6oFk0WFg==} + engines: {node: '>=18'} + + magic-string@1.4.1: + resolution: {integrity: sha512-8lyCu36ErXR0J9uaGKlKQoiLZKmtI63YGLE8G2o9jyRPdr4X47LusSOwgOJOzcVtp81fTAAjxR7BwKz682Jhow==} + + micromatch@4.0.8: + resolution: {integrity: sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==} + engines: {node: '>=8.6'} + + mimic-function@5.0.1: + resolution: {integrity: sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==} + engines: {node: '>=18'} + + minipass@7.1.3: + resolution: {integrity: sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A==} + engines: {node: '>=16 || 14 >=14.17'} + + minizlib@3.1.0: + resolution: {integrity: sha512-KZxYo1BUkWD2TVFLr0MQoM8vUUigWD3LlD83a/75BqC+4qE0Hb1Vo5v1FgcfaNXvfXzr+5EhQ6ing/CaBijTlw==} + engines: {node: '>= 18'} + + mute-stream@4.0.0: + resolution: {integrity: sha512-gSrprq0fJ3EiOErzjdIZrjysVVmJ4uu1QWfCDss5LypA5OXvrMje5Ym5z6V6RLyJ2eF87lasX7t6a0AnFvZblg==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + + node-emoji@2.2.0: + resolution: {integrity: sha512-Z3lTE9pLaJF47NyMhd4ww1yFTAP8YhYI8SleJiHzM46Fgpm5cnNzSl9XfzFNqbaz+VlJrIj3fXQ4DeN1Rjm6cw==} + engines: {node: '>=18'} + + onetime@7.0.0: + resolution: {integrity: sha512-VXJjc87FScF88uafS3JllDgvAm+c/Slfz06lorj2uAY34rlUu0Nt+v8wreiImcrgAjjIHp1rXpTDlLOGw29WwQ==} + engines: {node: '>=18'} + + open@11.0.4: + resolution: {integrity: sha512-++Zlftm0kVLPmzC06t6epuWmcRMDbI4z5P3NNX979WA/k23+NtSOynEGzsVfZwguKw2mi5umVgnBlJQMwRz4Pg==} + engines: {node: '>=20'} + + ora@9.4.1: + resolution: {integrity: sha512-6VlU9MLXbjVQD04AZCMX28hVtA5bUoadvUqO76MUCVA0ilwJbMiHsITRPfyVm6p/BC0Av/BXMujx39WCe1LEqw==} + engines: {node: '>=20'} + + picomatch@2.3.2: + resolution: {integrity: sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==} + engines: {node: '>=8.6'} + + picomatch@4.0.7: + resolution: {integrity: sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA==} + engines: {node: '>=12'} + + powershell-utils@0.2.1: + resolution: {integrity: sha512-C+y9x90UElAddDZmV4qOx9W53B61PO7cIqWz2dQsWlwswuq4mr8NEwytdGKboYbQlGZ3awrkTeNvcZiZNHnQ8A==} + engines: {node: '>=20'} + + rc9@3.1.0: + resolution: {integrity: sha512-ufjkNVzbRHKcCOmTahZkmVsyc3W+MSk3jY03m+a7tGHkIsdVMG9l10/3HvFbWkkKzY5VFp3pkRsIo/UYgmFL7Q==} + + readdirp@5.1.1: + resolution: {integrity: sha512-Kko+Y5XQ6fM+Ce3dq3m9YGxnacYZYl9cA1wZjaF3Vbry2L3i1qVg8+CAgNPsXRArPMUMCaOR7oa9Nqntc43JKA==} + engines: {node: '>= 20.19.0'} + + require-from-string@2.0.2: + resolution: {integrity: sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==} + engines: {node: '>=0.10.0'} + + restore-cursor@5.1.0: + resolution: {integrity: sha512-oMA2dcrw6u0YfxJQXm342bFKX/E4sG9rbTzO9ptUcR/e8A33cHuvStiYOwH7fszkZlZ1z/ta9AAoPk2F4qIOHA==} + engines: {node: '>=18'} + + rolldown@1.3.2: + resolution: {integrity: sha512-EFHqbVkXiYZA6akmYm2bvJhNbEGdUwAResRhYwl/BO8QhB5KxsG+t3RVHJSIOy5jBEb0XCACvrIGnnl6Z8sMGA==} + engines: {node: ^20.19.0 || >=22.12.0} + hasBin: true + + run-applescript@7.1.0: + resolution: {integrity: sha512-DPe5pVFaAsinSaV6QjQ6gdiedWDcRCbUuiQfQa2wmWV7+xC9bGulGI8+TdRmoFkAPaBXk8CrAbnlY2ISniJ47Q==} + engines: {node: '>=18'} + + rxjs@7.8.2: + resolution: {integrity: sha512-dhKf903U/PQZY6boNNtAGdWbG85WAbjT/1xYoZIC7FAY0yWapOBQVsVrDl58W86//e1VpMNBtRV4MaXfdMySFA==} + + safer-buffer@2.1.2: + resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} + + semver@7.8.6: + resolution: {integrity: sha512-9lpSSU4Mly3mrtruwLs1eLK6+gzbzqeBFwRNjIjE+9LuDpWdYctrQlQ3ej1Ilgi7gknpsTRnPoLP8DpCHqHIJw==} + engines: {node: '>=10'} + hasBin: true + + signal-exit@4.1.0: + resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} + engines: {node: '>=14'} + + skin-tone@2.0.0: + resolution: {integrity: sha512-kUMbT1oBJCpgrnKoSr0o6wPtvRWT9W9UKvGLwfJYO2WuahZRHOpEyL1ckyMGgMWh0UdpmaoFqKKD29WTomNEGA==} + engines: {node: '>=8'} + + source-map@0.8.0: + resolution: {integrity: sha512-d8EqvL+k/SOXCreS/SUzg2ciyHqBBLcN/yuRjFsbvVhHTE2pgei7oAhmPM7kWFbkX6OSMQfUq4KbkF3au9lhYQ==} + engines: {node: '>= 12'} + + stdin-discarder@0.3.2: + resolution: {integrity: sha512-eCPu1qRxPVkl5605OTWF8Wz40b4Mf45NY5LQmVPQ599knfs5QhASUm9GbJ5BDMDOXgrnh0wyEdvzmL//YMlw0A==} + engines: {node: '>=18'} + + string-width@8.3.0: + resolution: {integrity: sha512-ZbmZM0JCihQN91dWnxoipT2KOEyHqEyfRXUyjuRhW8b/xnqPDoq4gWEVApTVa9db2wN8mmoikgFBbjh71+cGeQ==} + engines: {node: '>=20'} + + strip-ansi@7.2.0: + resolution: {integrity: sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==} + engines: {node: '>=12'} + + tar@7.5.23: + resolution: {integrity: sha512-lkukzdoGngZHJZXxW4S/E4Fp9ghTDlyZXrQGRNoJ/LXvDKcXUTq2sg5yQe74po7Voea6n/IN09+wE/QvJMiifA==} + engines: {node: '>=18'} + + to-regex-range@5.0.1: + resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} + engines: {node: '>=8.0'} + + tslib@2.9.1: + resolution: {integrity: sha512-a4Ux9VKuIMHsOS7ENbEq6hK2ZGYIT27Rtl0E4eD9KqwxhKiQeMZE/9xb3IdYwWaSOyIBQLExhQgXDTYoiCxnWA==} + + typescript@6.0.3: + resolution: {integrity: sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw==} + engines: {node: '>=14.17'} + hasBin: true + + unicode-emoji-modifier-base@1.0.0: + resolution: {integrity: sha512-yLSH4py7oFH3oG/9K+XWrz1pSi3dfUrWEnInbxMfArOfc1+33BlGPQtLsOYwvdMy11AwUBetYuaRxSPqgkq+8g==} + engines: {node: '>=4'} + + unrun@0.3.1: + resolution: {integrity: sha512-onIck/oNnCaytwths1ZVp1LK2Gq2hPoyFhiHebObuUXqR3S0uHuLLaBK8K6mRRgV7Ptip8AnNvaUsgzwWwBZuA==} + engines: {node: ^22.13.0 || >=24.0.0} + hasBin: true + peerDependencies: + synckit: ^0.11.11 + peerDependenciesMeta: + synckit: + optional: true + + validator@13.15.35: + resolution: {integrity: sha512-TQ5pAGhd5whStmqWvYF4OjQROlmv9SMFVt37qoCBdqRffuuklWYQlCNnEs2ZaIBD1kZRNnikiZOS1eqgkar0iw==} + engines: {node: '>= 0.10'} + + wsl-utils@1.0.1: + resolution: {integrity: sha512-c16PKLIRxBYpR3jSWsdS7SFp0COm5SOQdiFjY818dYFHJbMGuLBszpF07LBWmOS1uzrHa9VGdynsEgoeKy0oOQ==} + engines: {node: '>=20'} + + yallist@5.0.0: + resolution: {integrity: sha512-YgvUTfwqyc7UXVMrB+SImsVYSmTS8X/tSrtdNZMImM+n7+QTriRXyXim0mBrTXNeqzVF0KWGgHPeiyViFFrNDw==} + engines: {node: '>=18'} + + yoctocolors@2.2.0: + resolution: {integrity: sha512-xYqdZFUK/VYazNl/oCDYN+3WloWQwMfZxBoiNt6qNyk+xfOdi598muWE42rNZFp1kNOiqW936q5RhUdnpqElSg==} + engines: {node: '>=18'} + + zod@4.6.7: + resolution: {integrity: sha512-g8W2D2kU6a8untc053fX1uVBKzM7yqAxW/3zwk83+6RyF2+SKOuV+c0wBDhUwzV1PaGapmZH+rmcUzPf+3CGwg==} + +snapshots: + + '@angular-devkit/core@22.2.7(chokidar@5.0.0)': + dependencies: + ajv: 8.20.0 + ajv-formats: 3.0.1(ajv@8.20.0) + jsonc-parser: 3.3.1 + picomatch: 4.0.7 + rxjs: 7.8.2 + source-map: 0.8.0 + optionalDependencies: + chokidar: 5.0.0 + + '@angular-devkit/schematics-cli@22.2.7(chokidar@5.0.0)': + dependencies: + '@angular-devkit/core': 22.2.7(chokidar@5.0.0) + '@angular-devkit/schematics': 22.2.7(chokidar@5.0.0) + '@inquirer/prompts': 8.7.2 + transitivePeerDependencies: + - '@types/node' + - chokidar + + '@angular-devkit/schematics@22.2.7(chokidar@5.0.0)': + dependencies: + '@angular-devkit/core': 22.2.7(chokidar@5.0.0) + jsonc-parser: 3.3.1 + magic-string: 1.4.1 + ora: 9.4.1 + rxjs: 7.8.2 + transitivePeerDependencies: + - chokidar + + '@emnapi/core@2.0.0-beta.2': + dependencies: + '@emnapi/wasi-threads': 2.2.0 + tslib: 2.9.1 + optional: true + + '@emnapi/runtime@2.0.0-beta.2': + dependencies: + tslib: 2.9.1 + optional: true + + '@emnapi/wasi-threads@2.2.0': + dependencies: + tslib: 2.9.1 + optional: true + + '@inquirer/ansi@2.1.0': {} + + '@inquirer/checkbox@5.3.0': + dependencies: + '@inquirer/ansi': 2.1.0 + '@inquirer/core': 12.1.0 + '@inquirer/figures': 2.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/confirm@6.4.0': + dependencies: + '@inquirer/core': 12.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/core@12.1.0': + dependencies: + '@inquirer/ansi': 2.1.0 + '@inquirer/figures': 2.1.0 + '@inquirer/type': 4.3.0 + cli-width: 4.1.0 + fast-wrap-ansi: 0.2.2 + mute-stream: 4.0.0 + signal-exit: 4.1.0 + + '@inquirer/editor@5.4.0': + dependencies: + '@inquirer/core': 12.1.0 + '@inquirer/external-editor': 3.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/expand@5.2.0': + dependencies: + '@inquirer/core': 12.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/external-editor@3.1.0': + dependencies: + chardet: 2.2.0 + iconv-lite: 0.7.3 + + '@inquirer/figures@2.1.0': {} + + '@inquirer/input@5.2.0': + dependencies: + '@inquirer/core': 12.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/number@4.3.0': + dependencies: + '@inquirer/core': 12.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/password@5.3.0': + dependencies: + '@inquirer/ansi': 2.1.0 + '@inquirer/core': 12.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/prompts@8.7.2': + dependencies: + '@inquirer/checkbox': 5.3.0 + '@inquirer/confirm': 6.4.0 + '@inquirer/editor': 5.4.0 + '@inquirer/expand': 5.2.0 + '@inquirer/input': 5.2.0 + '@inquirer/number': 4.3.0 + '@inquirer/password': 5.3.0 + '@inquirer/rawlist': 5.4.0 + '@inquirer/search': 4.4.0 + '@inquirer/select': 5.3.0 + + '@inquirer/prompts@8.8.0': + dependencies: + '@inquirer/checkbox': 5.3.0 + '@inquirer/confirm': 6.4.0 + '@inquirer/editor': 5.4.0 + '@inquirer/expand': 5.2.0 + '@inquirer/input': 5.2.0 + '@inquirer/number': 4.3.0 + '@inquirer/password': 5.3.0 + '@inquirer/rawlist': 5.4.0 + '@inquirer/search': 4.4.0 + '@inquirer/select': 5.3.0 + + '@inquirer/rawlist@5.4.0': + dependencies: + '@inquirer/core': 12.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/search@4.4.0': + dependencies: + '@inquirer/core': 12.1.0 + '@inquirer/figures': 2.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/select@5.3.0': + dependencies: + '@inquirer/ansi': 2.1.0 + '@inquirer/core': 12.1.0 + '@inquirer/figures': 2.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/type@4.3.0': {} + + '@isaacs/fs-minipass@4.0.1': + dependencies: + minipass: 7.1.3 + + '@jridgewell/sourcemap-codec@1.6.0': {} + + '@nanoforge-dev/asset@3.0.0': + dependencies: + '@nanoforge-dev/common': 3.0.0 + + '@nanoforge-dev/cli@3.0.1': + dependencies: + '@angular-devkit/schematics': 22.2.7(chokidar@5.0.0) + '@angular-devkit/schematics-cli': 22.2.7(chokidar@5.0.0) + '@inquirer/prompts': 8.8.0 + '@nanoforge-dev/config': 3.0.1 + '@nanoforge-dev/editor': 0.1.4 + '@nanoforge-dev/loader-client': 1.7.0 + '@nanoforge-dev/loader-server': 1.7.0 + '@nanoforge-dev/registry': 3.0.1 + '@nanoforge-dev/schematics': 3.0.1(chokidar@5.0.0) + ansis: 4.5.0 + bun: 1.4.4 + chokidar: 5.0.0 + commander: 15.1.0 + dotenv: 18.0.10 + node-emoji: 2.2.0 + open: 11.0.4 + ora: 9.4.1 + rc9: 3.1.0 + transitivePeerDependencies: + - '@types/node' + - synckit + + '@nanoforge-dev/common@3.0.0': {} + + '@nanoforge-dev/config@3.0.1': + dependencies: + unrun: 0.3.1 + zod: 4.6.7 + transitivePeerDependencies: + - synckit + + '@nanoforge-dev/core@3.0.0': + dependencies: + '@nanoforge-dev/asset': 3.0.0 + '@nanoforge-dev/common': 3.0.0 + + '@nanoforge-dev/ecs@3.0.0(@nanoforge-dev/editor-lib@3.0.0)': + dependencies: + '@nanoforge-dev/common': 3.0.0 + optionalDependencies: + '@nanoforge-dev/editor-lib': 3.0.0 + + '@nanoforge-dev/editor-lib@3.0.0': + dependencies: + '@nanoforge-dev/common': 3.0.0 + + '@nanoforge-dev/editor@0.1.4': + dependencies: + bun: 1.4.4 + class-transformer: 0.5.1 + class-validator: 0.15.1 + dotenv: 17.4.2 + micromatch: 4.0.8 + tar: 7.5.23 + typescript: 6.0.3 + + '@nanoforge-dev/env@3.0.0': + dependencies: + '@nanoforge-dev/common': 3.0.0 + class-transformer: 0.5.1 + class-validator: 0.14.4 + + '@nanoforge-dev/graphics-2d@3.0.0': + dependencies: + '@nanoforge-dev/common': 3.0.0 + konva: 10.9.1 + transitivePeerDependencies: + - canvas + - skia-canvas + + '@nanoforge-dev/input@3.0.0': + dependencies: + '@nanoforge-dev/common': 3.0.0 + + '@nanoforge-dev/loader-client@1.7.0': + dependencies: + '@nanoforge-dev/loader-website': 1.7.0 + bun: 1.4.4 + commander: 15.1.0 + + '@nanoforge-dev/loader-server@1.7.0': + dependencies: + bun: 1.4.4 + commander: 15.1.0 + + '@nanoforge-dev/loader-website@1.7.0': {} + + '@nanoforge-dev/registry@3.0.1': + dependencies: + fflate: 0.8.3 + semver: 7.8.6 + zod: 4.6.7 + + '@nanoforge-dev/schematics@3.0.1(chokidar@5.0.0)': + dependencies: + '@angular-devkit/core': 22.2.7(chokidar@5.0.0) + '@angular-devkit/schematics': 22.2.7(chokidar@5.0.0) + rxjs: 7.8.2 + transitivePeerDependencies: + - chokidar + + '@napi-rs/wasm-runtime@1.2.6(@emnapi/core@2.0.0-beta.2)(@emnapi/runtime@2.0.0-beta.2)': + dependencies: + '@emnapi/core': 2.0.0-beta.2 + '@emnapi/runtime': 2.0.0-beta.2 + '@tybys/wasm-util': 0.10.4 + optional: true + + '@oven/bun-darwin-aarch64@1.4.4': + optional: true + + '@oven/bun-darwin-x64@1.4.4': + optional: true + + '@oven/bun-freebsd-aarch64@1.4.4': + optional: true + + '@oven/bun-freebsd-x64@1.4.4': + optional: true + + '@oven/bun-linux-aarch64-android@1.4.4': + optional: true + + '@oven/bun-linux-aarch64-musl@1.4.4': + optional: true + + '@oven/bun-linux-aarch64@1.4.4': + optional: true + + '@oven/bun-linux-x64-android@1.4.4': + optional: true + + '@oven/bun-linux-x64-musl@1.4.4': + optional: true + + '@oven/bun-linux-x64@1.4.4': + optional: true + + '@oven/bun-windows-aarch64@1.4.4': + optional: true + + '@oven/bun-windows-x64@1.4.4': + optional: true + + '@oxc-project/types@0.158.0': {} + + '@rolldown/binding-android-arm-eabi@1.3.2': + optional: true + + '@rolldown/binding-android-arm64@1.3.2': + optional: true + + '@rolldown/binding-darwin-arm64@1.3.2': + optional: true + + '@rolldown/binding-darwin-x64@1.3.2': + optional: true + + '@rolldown/binding-freebsd-x64@1.3.2': + optional: true + + '@rolldown/binding-linux-arm-gnueabihf@1.3.2': + optional: true + + '@rolldown/binding-linux-arm64-gnu@1.3.2': + optional: true + + '@rolldown/binding-linux-arm64-musl@1.3.2': + optional: true + + '@rolldown/binding-linux-ppc64-gnu@1.3.2': + optional: true + + '@rolldown/binding-linux-s390x-gnu@1.3.2': + optional: true + + '@rolldown/binding-linux-x64-gnu@1.3.2': + optional: true + + '@rolldown/binding-linux-x64-musl@1.3.2': + optional: true + + '@rolldown/binding-openharmony-arm64@1.3.2': + optional: true + + '@rolldown/binding-wasm32-wasi@1.3.2': + dependencies: + '@emnapi/core': 2.0.0-beta.2 + '@emnapi/runtime': 2.0.0-beta.2 + '@napi-rs/wasm-runtime': 1.2.6(@emnapi/core@2.0.0-beta.2)(@emnapi/runtime@2.0.0-beta.2) + optional: true + + '@rolldown/binding-win32-arm64-msvc@1.3.2': + optional: true + + '@rolldown/binding-win32-x64-msvc@1.3.2': + optional: true + + '@rolldown/pluginutils@1.1.0': {} + + '@sindresorhus/is@4.6.0': {} + + '@tybys/wasm-util@0.10.4': + dependencies: + tslib: 2.9.1 + optional: true + + '@types/validator@13.15.10': {} + + ajv-formats@3.0.1(ajv@8.20.0): + optionalDependencies: + ajv: 8.20.0 + + ajv@8.20.0: + dependencies: + fast-deep-equal: 3.1.3 + fast-uri: 3.1.9 + json-schema-traverse: 1.0.0 + require-from-string: 2.0.2 + + ansi-regex@6.6.0: {} + + ansis@4.5.0: {} + + braces@3.0.3: + dependencies: + fill-range: 7.1.1 + + bun@1.4.4: + optionalDependencies: + '@oven/bun-darwin-aarch64': 1.4.4 + '@oven/bun-darwin-x64': 1.4.4 + '@oven/bun-freebsd-aarch64': 1.4.4 + '@oven/bun-freebsd-x64': 1.4.4 + '@oven/bun-linux-aarch64': 1.4.4 + '@oven/bun-linux-aarch64-android': 1.4.4 + '@oven/bun-linux-aarch64-musl': 1.4.4 + '@oven/bun-linux-x64': 1.4.4 + '@oven/bun-linux-x64-android': 1.4.4 + '@oven/bun-linux-x64-musl': 1.4.4 + '@oven/bun-windows-aarch64': 1.4.4 + '@oven/bun-windows-x64': 1.4.4 + + bundle-name@4.1.1: + dependencies: + run-applescript: 7.1.0 + + chalk@5.6.2: {} + + char-regex@1.0.2: {} + + chardet@2.2.0: {} + + chokidar@5.0.0: + dependencies: + readdirp: 5.1.1 + + chownr@3.0.0: {} + + class-transformer@0.5.1: {} + + class-validator@0.14.4: + dependencies: + '@types/validator': 13.15.10 + libphonenumber-js: 1.13.16 + validator: 13.15.35 + + class-validator@0.15.1: + dependencies: + '@types/validator': 13.15.10 + libphonenumber-js: 1.13.16 + validator: 13.15.35 + + cli-cursor@5.0.0: + dependencies: + restore-cursor: 5.1.0 + + cli-spinners@3.4.0: {} + + cli-width@4.1.0: {} + + commander@15.1.0: {} + + default-browser-id@5.0.1: {} + + default-browser@5.5.1: + dependencies: + bundle-name: 4.1.1 + default-browser-id: 5.0.1 + + define-lazy-prop@3.0.0: {} + + defu@6.1.7: {} + + destr@2.0.5: {} + + dotenv@17.4.2: {} + + dotenv@18.0.10: {} + + emojilib@2.4.0: {} + + fast-deep-equal@3.1.3: {} + + fast-string-truncated-width@3.0.3: {} + + fast-string-width@3.0.2: + dependencies: + fast-string-truncated-width: 3.0.3 + + fast-uri@3.1.9: {} + + fast-wrap-ansi@0.2.2: + dependencies: + fast-string-width: 3.0.2 + + fflate@0.8.3: {} + + fill-range@7.1.1: + dependencies: + to-regex-range: 5.0.1 + + get-east-asian-width@1.7.0: {} + + iconv-lite@0.7.3: + dependencies: + safer-buffer: 2.1.2 + + is-docker@3.0.0: {} + + is-in-ssh@1.0.0: {} + + is-inside-container@1.0.0: + dependencies: + is-docker: 3.0.0 + + is-interactive@2.0.0: {} + + is-number@7.0.0: {} + + is-unicode-supported@2.1.0: {} + + is-wsl@3.1.1: + dependencies: + is-inside-container: 1.0.0 + + json-schema-traverse@1.0.0: {} + + jsonc-parser@3.3.1: {} + + konva@10.9.1: {} + + libphonenumber-js@1.13.16: {} + + log-symbols@7.0.1: + dependencies: + is-unicode-supported: 2.1.0 + yoctocolors: 2.2.0 + + magic-string@1.4.1: + dependencies: + '@jridgewell/sourcemap-codec': 1.6.0 + + micromatch@4.0.8: + dependencies: + braces: 3.0.3 + picomatch: 2.3.2 + + mimic-function@5.0.1: {} + + minipass@7.1.3: {} + + minizlib@3.1.0: + dependencies: + minipass: 7.1.3 + + mute-stream@4.0.0: {} + + node-emoji@2.2.0: + dependencies: + '@sindresorhus/is': 4.6.0 + char-regex: 1.0.2 + emojilib: 2.4.0 + skin-tone: 2.0.0 + + onetime@7.0.0: + dependencies: + mimic-function: 5.0.1 + + open@11.0.4: + dependencies: + default-browser: 5.5.1 + define-lazy-prop: 3.0.0 + is-in-ssh: 1.0.0 + is-inside-container: 1.0.0 + powershell-utils: 0.2.1 + wsl-utils: 1.0.1 + + ora@9.4.1: + dependencies: + chalk: 5.6.2 + cli-cursor: 5.0.0 + cli-spinners: 3.4.0 + is-interactive: 2.0.0 + is-unicode-supported: 2.1.0 + log-symbols: 7.0.1 + stdin-discarder: 0.3.2 + string-width: 8.3.0 + + picomatch@2.3.2: {} + + picomatch@4.0.7: {} + + powershell-utils@0.2.1: {} + + rc9@3.1.0: + dependencies: + defu: 6.1.7 + destr: 2.0.5 + + readdirp@5.1.1: {} + + require-from-string@2.0.2: {} + + restore-cursor@5.1.0: + dependencies: + onetime: 7.0.0 + signal-exit: 4.1.0 + + rolldown@1.3.2: + dependencies: + '@oxc-project/types': 0.158.0 + '@rolldown/pluginutils': 1.1.0 + optionalDependencies: + '@rolldown/binding-android-arm-eabi': 1.3.2 + '@rolldown/binding-android-arm64': 1.3.2 + '@rolldown/binding-darwin-arm64': 1.3.2 + '@rolldown/binding-darwin-x64': 1.3.2 + '@rolldown/binding-freebsd-x64': 1.3.2 + '@rolldown/binding-linux-arm-gnueabihf': 1.3.2 + '@rolldown/binding-linux-arm64-gnu': 1.3.2 + '@rolldown/binding-linux-arm64-musl': 1.3.2 + '@rolldown/binding-linux-ppc64-gnu': 1.3.2 + '@rolldown/binding-linux-s390x-gnu': 1.3.2 + '@rolldown/binding-linux-x64-gnu': 1.3.2 + '@rolldown/binding-linux-x64-musl': 1.3.2 + '@rolldown/binding-openharmony-arm64': 1.3.2 + '@rolldown/binding-wasm32-wasi': 1.3.2 + '@rolldown/binding-win32-arm64-msvc': 1.3.2 + '@rolldown/binding-win32-x64-msvc': 1.3.2 + + run-applescript@7.1.0: {} + + rxjs@7.8.2: + dependencies: + tslib: 2.9.1 + + safer-buffer@2.1.2: {} + + semver@7.8.6: {} + + signal-exit@4.1.0: {} + + skin-tone@2.0.0: + dependencies: + unicode-emoji-modifier-base: 1.0.0 + + source-map@0.8.0: {} + + stdin-discarder@0.3.2: {} + + string-width@8.3.0: + dependencies: + get-east-asian-width: 1.7.0 + strip-ansi: 7.2.0 + + strip-ansi@7.2.0: + dependencies: + ansi-regex: 6.6.0 + + tar@7.5.23: + dependencies: + '@isaacs/fs-minipass': 4.0.1 + chownr: 3.0.0 + minipass: 7.1.3 + minizlib: 3.1.0 + yallist: 5.0.0 + + to-regex-range@5.0.1: + dependencies: + is-number: 7.0.0 + + tslib@2.9.1: {} + + typescript@6.0.3: {} + + unicode-emoji-modifier-base@1.0.0: {} + + unrun@0.3.1: + dependencies: + rolldown: 1.3.2 + + validator@13.15.35: {} + + wsl-utils@1.0.1: + dependencies: + is-wsl: 3.1.1 + powershell-utils: 0.2.1 + + yallist@5.0.0: {} + + yoctocolors@2.2.0: {} + + zod@4.6.7: {} diff --git a/basics/input-mouse/pnpm-workspace.yaml b/basics/input-mouse/pnpm-workspace.yaml new file mode 100644 index 0000000..96ca535 --- /dev/null +++ b/basics/input-mouse/pnpm-workspace.yaml @@ -0,0 +1,5 @@ +allowBuilds: + bun: true +# NanoForge packages are ours: take a release as soon as it is out. +minimumReleaseAgeExclude: + - "@nanoforge-dev/*" diff --git a/basics/input-mouse/src/components/draggable-2d.component.ts b/basics/input-mouse/src/components/draggable-2d.component.ts new file mode 100644 index 0000000..96762e2 --- /dev/null +++ b/basics/input-mouse/src/components/draggable-2d.component.ts @@ -0,0 +1,27 @@ +import { InputEnum } from "@nanoforge-dev/input"; + +/** + * Lets the mouse drag a rectangle: press a button on its `DrawableRect2D`, move, release. Needs + * the `drag2D` system. + * + * @component + * @side client + * @group Drag color=#9d7bff - How the entity is dragged. + */ +export class Draggable2D { + name = "Draggable2D"; + + /** Whether the current drag started on the entity, set by `drag2D`. */ + grabbed = false; + /** Whether the current drag was already checked, set by `drag2D`. */ + checked = false; + /** Where the entity was when the drag started, set by `drag2D`. */ + fromX = 0; + /** Where the entity was when the drag started, set by `drag2D`. */ + fromY = 0; + + constructor( + /** The mouse button that drags it. @group Drag */ + public button: InputEnum = InputEnum.MouseLeft, + ) {} +} diff --git a/basics/input-mouse/src/components/drawable-circle-2d.component.ts b/basics/input-mouse/src/components/drawable-circle-2d.component.ts new file mode 100644 index 0000000..1066155 --- /dev/null +++ b/basics/input-mouse/src/components/drawable-circle-2d.component.ts @@ -0,0 +1,62 @@ +import type { AssetContext } from "@nanoforge-dev/common"; +import { Circle, type Layer } from "@nanoforge-dev/graphics-2d"; +import type { Position2D } from "./position-2d.component"; + +import { imageFill } from "../image-fill"; + +/** + * Draws a circle at the entity's `Position2D` (its center). Needs the `draw2D` system. + * + * @remarks + * `shape` is the Konva `Circle` on screen: change it from code for anything the parameters don't + * offer (shadows, strokes...). + * + * @component + * @side client + * @group Shape color=#e86fb0 - Size of the circle. + * @group Look color=#b18cff - What the circle looks like. + * @group Advanced hidden - Less common settings. + */ +export class DrawableCircle2D { + name = "DrawableCircle2D"; + + /** The circle on screen, made by `draw2D` the first time it draws it. */ + shape?: Circle; + + constructor( + /** In pixels. @group Shape */ + public radius = 25, + /** A CSS color: `red`, `#ff0000`, `rgba(255, 0, 0, 0.5)`... @group Look @preset color */ + public fillColor = "#4aa3ff", + /** An image stretched over the circle, shown instead of the color. @group Look @asset .png .jpg .jpeg .gif .webp .svg */ + public image = "", + /** From 0 (invisible) to 1 (opaque). @group Look */ + public opacity = 1, + /** Clockwise, in degrees, around the center. @group Advanced */ + public rotation = 0, + /** Whether it is drawn. @group Advanced */ + public visible = true, + ) {} + + /** Puts the circle on `layer` at `position`, up to date with the parameters. */ + draw(layer: Layer, position: Position2D, assets: AssetContext): void { + this.shape ??= new Circle(); + if (this.shape.getParent() !== layer) layer.add(this.shape); + this.shape.setAttrs({ + x: position.x, + y: position.y, + radius: this.radius, + fill: this.fillColor, + opacity: this.opacity, + rotation: this.rotation, + visible: this.visible, + ...imageFill(assets, this.image, this.radius * 2, this.radius * 2, true), + }); + } + + /** Removes the circle from the screen. */ + destroy(): void { + this.shape?.destroy(); + this.shape = undefined; + } +} diff --git a/basics/input-mouse/src/components/drawable-rect-2d.component.ts b/basics/input-mouse/src/components/drawable-rect-2d.component.ts new file mode 100644 index 0000000..d3586ca --- /dev/null +++ b/basics/input-mouse/src/components/drawable-rect-2d.component.ts @@ -0,0 +1,69 @@ +import type { AssetContext } from "@nanoforge-dev/common"; +import { type Layer, Rect } from "@nanoforge-dev/graphics-2d"; +import type { Position2D } from "./position-2d.component"; + +import { imageFill } from "../image-fill"; + +/** + * Draws a rectangle at the entity's `Position2D` (its top-left corner). Needs the `draw2D` + * system. + * + * @remarks + * `shape` is the Konva `Rect` on screen: change it from code for anything the parameters don't + * offer (shadows, strokes...). + * + * @component + * @side client + * @group Shape color=#e86fb0 - Size of the rectangle. + * @group Look color=#b18cff - What the rectangle looks like. + * @group Advanced hidden - Less common settings. + */ +export class DrawableRect2D { + name = "DrawableRect2D"; + + /** The rectangle on screen, made by `draw2D` the first time it draws it. */ + shape?: Rect; + + constructor( + /** In pixels. @group Shape @preset size.width */ + public width = 50, + /** In pixels. @group Shape @preset size.height */ + public height = 50, + /** A CSS color: `red`, `#ff0000`, `rgba(255, 0, 0, 0.5)`... @group Look @preset color */ + public fillColor = "#4aa3ff", + /** An image stretched over the rectangle, shown instead of the color. @group Look @asset .png .jpg .jpeg .gif .webp .svg */ + public image = "", + /** From 0 (invisible) to 1 (opaque). @group Look */ + public opacity = 1, + /** Clockwise, in degrees, around the top-left corner. @group Advanced */ + public rotation = 0, + /** Rounds the corners, in pixels. @group Advanced */ + public cornerRadius = 0, + /** Whether it is drawn. @group Advanced */ + public visible = true, + ) {} + + /** Puts the rectangle on `layer` at `position`, up to date with the parameters. */ + draw(layer: Layer, position: Position2D, assets: AssetContext): void { + this.shape ??= new Rect(); + if (this.shape.getParent() !== layer) layer.add(this.shape); + this.shape.setAttrs({ + x: position.x, + y: position.y, + width: this.width, + height: this.height, + fill: this.fillColor, + opacity: this.opacity, + rotation: this.rotation, + cornerRadius: this.cornerRadius, + visible: this.visible, + ...imageFill(assets, this.image, this.width, this.height), + }); + } + + /** Removes the rectangle from the screen. */ + destroy(): void { + this.shape?.destroy(); + this.shape = undefined; + } +} diff --git a/basics/input-mouse/src/components/drawable-text-2d.component.ts b/basics/input-mouse/src/components/drawable-text-2d.component.ts new file mode 100644 index 0000000..adba963 --- /dev/null +++ b/basics/input-mouse/src/components/drawable-text-2d.component.ts @@ -0,0 +1,62 @@ +import { type Layer, Text } from "@nanoforge-dev/graphics-2d"; +import type { Position2D } from "./position-2d.component"; + +/** + * Draws a text at the entity's `Position2D` (its top-left corner). Needs the `draw2D` system. + * + * @remarks + * Change `text` from a system to show a score, a timer... `shape` is the Konva `Text` on screen: + * change it from code for anything the parameters don't offer. + * + * @component + * @side client + * @group Text color=#e86fb0 - What is written. + * @group Look color=#b18cff - What the text looks like. + * @group Advanced hidden - Less common settings. + */ +export class DrawableText2D { + name = "DrawableText2D"; + + /** The text on screen, made by `draw2D` the first time it draws it. */ + shape?: Text; + + constructor( + /** What is written. @group Text */ + public text = "Hello", + /** Height of the letters, in pixels. @group Text */ + public fontSize = 24, + /** A CSS color: `white`, `#ffffff`... @group Look @preset color */ + public fillColor = "#ffffff", + /** From 0 (invisible) to 1 (opaque). @group Look */ + public opacity = 1, + /** A CSS font family: `Arial`, `monospace`... @group Advanced */ + public fontFamily = "Arial", + /** Clockwise, in degrees, around the top-left corner. @group Advanced */ + public rotation = 0, + /** Whether it is drawn. @group Advanced */ + public visible = true, + ) {} + + /** Puts the text on `layer` at `position`, up to date with the parameters. */ + draw(layer: Layer, position: Position2D): void { + this.shape ??= new Text(); + if (this.shape.getParent() !== layer) layer.add(this.shape); + this.shape.setAttrs({ + x: position.x, + y: position.y, + text: this.text, + fontSize: this.fontSize, + fontFamily: this.fontFamily, + fill: this.fillColor, + opacity: this.opacity, + rotation: this.rotation, + visible: this.visible, + }); + } + + /** Removes the text from the screen. */ + destroy(): void { + this.shape?.destroy(); + this.shape = undefined; + } +} diff --git a/basics/input-mouse/src/components/follow-mouse-2d.component.ts b/basics/input-mouse/src/components/follow-mouse-2d.component.ts new file mode 100644 index 0000000..f41a177 --- /dev/null +++ b/basics/input-mouse/src/components/follow-mouse-2d.component.ts @@ -0,0 +1,9 @@ +/** + * Keeps an entity's `Position2D` on the mouse cursor. Needs the `followMouse2D` system. + * + * @component + * @side client + */ +export class FollowMouse2D { + name = "FollowMouse2D"; +} diff --git a/basics/input-mouse/src/components/mouse-readout.component.ts b/basics/input-mouse/src/components/mouse-readout.component.ts new file mode 100644 index 0000000..8eb9b5a --- /dev/null +++ b/basics/input-mouse/src/components/mouse-readout.component.ts @@ -0,0 +1,15 @@ +/** + * Writes the mouse position and the number of clicks in the entity's `DrawableText2D`. Needs the + * `showMouseReadout` system. + * + * @component + * @side client + */ +export class MouseReadout { + name = "MouseReadout"; + + /** Left clicks so far, counted by `showMouseReadout`. */ + clicks = 0; + /** Whether the left button was down last frame, set by `showMouseReadout`. */ + held = false; +} diff --git a/basics/input-mouse/src/components/position-2d.component.ts b/basics/input-mouse/src/components/position-2d.component.ts new file mode 100644 index 0000000..0a35624 --- /dev/null +++ b/basics/input-mouse/src/components/position-2d.component.ts @@ -0,0 +1,20 @@ +/** + * Where an entity is, in pixels from the top-left corner of the screen. + * + * @remarks + * For rectangles it is their top-left corner, for circles their center. + * + * @component + * @side shared + * @group Position color=#4aa3ff - Pixels from the top-left corner of the screen. + */ +export class Position2D { + name = "Position2D"; + + constructor( + /** Pixels from the left edge. @group Position @preset vector.x */ + public x = 0, + /** Pixels from the top edge. @group Position @preset vector.y */ + public y = 0, + ) {} +} diff --git a/basics/input-mouse/src/image-fill.ts b/basics/input-mouse/src/image-fill.ts new file mode 100644 index 0000000..c7fc737 --- /dev/null +++ b/basics/input-mouse/src/image-fill.ts @@ -0,0 +1,43 @@ +import type { AssetContext } from "@nanoforge-dev/common"; +import type { ShapeConfig } from "@nanoforge-dev/graphics-2d"; + +const images = new Map(); + +/** + * The fill of a shape of `width` by `height` pixels showing the image at `path` (an asset path + * such as `/textures/hero.png`, found in `assets`) stretched over it. Without an image, until it + * is loaded, or when there is no asset at `path`, the shape is filled with its color. + * + * @param centered - Whether the shape's origin is its center (a circle) instead of its top-left + * corner (a rectangle). + */ +export const imageFill = ( + assets: AssetContext, + path: string, + width: number, + height: number, + centered = false, +): ShapeConfig => { + if (!path) return { fillPriority: "color", fillPatternImage: undefined }; + let image = images.get(path); + if (!image) { + image = document.createElement("img"); + try { + image.src = assets.getAsset(path).path; + } catch (error) { + // Once per path, not every frame: the shape keeps its color. + console.warn(`No image at "${path}":`, error); + } + images.set(path, image); + } + if (!image.naturalWidth) return { fillPriority: "color", fillPatternImage: undefined }; + return { + fillPriority: "pattern", + fillPatternImage: image, + fillPatternRepeat: "no-repeat", + fillPatternScaleX: width / image.naturalWidth, + fillPatternScaleY: height / image.naturalHeight, + fillPatternOffsetX: centered ? image.naturalWidth / 2 : 0, + fillPatternOffsetY: centered ? image.naturalHeight / 2 : 0, + }; +}; diff --git a/basics/input-mouse/src/main.ts b/basics/input-mouse/src/main.ts new file mode 100644 index 0000000..c9ca23a --- /dev/null +++ b/basics/input-mouse/src/main.ts @@ -0,0 +1,73 @@ +import type { ClientRunOptions } from "@nanoforge-dev/common"; +import { NanoforgeFactory } from "@nanoforge-dev/core"; +import { EcsLibrary } from "@nanoforge-dev/ecs/client"; +import { EditorLibrary } from "@nanoforge-dev/editor-lib"; +import { Graphics2DLibrary } from "@nanoforge-dev/graphics-2d"; +import { InputLibrary } from "@nanoforge-dev/input"; + +import { Draggable2D } from "./components/draggable-2d.component"; +import { DrawableCircle2D } from "./components/drawable-circle-2d.component"; +import { DrawableRect2D } from "./components/drawable-rect-2d.component"; +import { DrawableText2D } from "./components/drawable-text-2d.component"; +import { FollowMouse2D } from "./components/follow-mouse-2d.component"; +import { MouseReadout } from "./components/mouse-readout.component"; +import { Position2D } from "./components/position-2d.component"; +import { drag2D } from "./systems/drag-2d.system"; +import { draw2D } from "./systems/draw-2d.system"; +import { followMouse2D } from "./systems/follow-mouse-2d.system"; +import { showMouseReadout } from "./systems/show-mouse-readout.system"; + +export const main = async (options: ClientRunOptions): Promise => { + const app = NanoforgeFactory.createClient({ + tickRate: 60, + viewport: { width: 800, height: 600, fit: "contain" }, + }); + const ecs = new EcsLibrary(); + + app.use(new Graphics2DLibrary()); + app.use(ecs); + app.use(new InputLibrary()); + app.use(new EditorLibrary()); + + await app.init(options); + + const registry = ecs.registry; + + const background = registry.spawnEntity(); + registry.addComponent(background, new Position2D(0, 0)); + registry.addComponent(background, new DrawableRect2D(800, 600, "#1e1e2e")); + + const help = registry.spawnEntity(); + registry.addComponent(help, new Position2D(20, 20)); + registry.addComponent( + help, + new DrawableText2D("Drag the squares with the left button", 22, "#cdd6f4"), + ); + + const readout = registry.spawnEntity(); + registry.addComponent(readout, new Position2D(20, 560)); + registry.addComponent(readout, new DrawableText2D("", 20, "#a6adc8")); + registry.addComponent(readout, new MouseReadout()); + + const red = registry.spawnEntity(); + registry.addComponent(red, new Position2D(250, 270)); + registry.addComponent(red, new DrawableRect2D(80, 80, "#f38ba8")); + registry.addComponent(red, new Draggable2D()); + + const green = registry.spawnEntity(); + registry.addComponent(green, new Position2D(470, 270)); + registry.addComponent(green, new DrawableRect2D(80, 80, "#a6e3a1")); + registry.addComponent(green, new Draggable2D()); + + const cursor = registry.spawnEntity(); + registry.addComponent(cursor, new Position2D(0, 0)); + registry.addComponent(cursor, new DrawableCircle2D(8, "#f9e2af")); + registry.addComponent(cursor, new FollowMouse2D()); + + registry.addSystem(followMouse2D); + registry.addSystem(drag2D); + registry.addSystem(showMouseReadout); + registry.addSystem(draw2D); + + await app.run(); +}; diff --git a/basics/input-mouse/src/systems/drag-2d.system.ts b/basics/input-mouse/src/systems/drag-2d.system.ts new file mode 100644 index 0000000..c963749 --- /dev/null +++ b/basics/input-mouse/src/systems/drag-2d.system.ts @@ -0,0 +1,41 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; +import "@nanoforge-dev/input"; +import { DrawableRect2D } from "../components/drawable-rect-2d.component"; +import { Position2D } from "../components/position-2d.component"; + +import { Draggable2D } from "../components/draggable-2d.component"; + +/** + * Moves the `Draggable2D` rectangles the mouse drags: a drag that starts on a rectangle carries it + * until the button is released. + * + * @system + * @side client + */ +export const drag2D = (registry: Registry, ctx: Context) => { + const drag = ctx.input.getDragState(); + + registry + .getZipper([Draggable2D, Position2D, DrawableRect2D]) + .forEach(({ Draggable2D, Position2D, DrawableRect2D }) => { + if (!drag.active || drag.button !== Draggable2D.button) { + Draggable2D.checked = false; + Draggable2D.grabbed = false; + return; + } + if (!Draggable2D.checked) { + Draggable2D.checked = true; + Draggable2D.grabbed = + drag.startX >= Position2D.x && + drag.startX <= Position2D.x + DrawableRect2D.width && + drag.startY >= Position2D.y && + drag.startY <= Position2D.y + DrawableRect2D.height; + Draggable2D.fromX = Position2D.x; + Draggable2D.fromY = Position2D.y; + } + if (!Draggable2D.grabbed) return; + Position2D.x = Draggable2D.fromX + drag.deltaX; + Position2D.y = Draggable2D.fromY + drag.deltaY; + }); +}; diff --git a/basics/input-mouse/src/systems/draw-2d.system.ts b/basics/input-mouse/src/systems/draw-2d.system.ts new file mode 100644 index 0000000..937eeeb --- /dev/null +++ b/basics/input-mouse/src/systems/draw-2d.system.ts @@ -0,0 +1,45 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; +import "@nanoforge-dev/graphics-2d"; +import { Position2D } from "../components/position-2d.component"; + +import { DrawableCircle2D } from "../components/drawable-circle-2d.component"; +import { DrawableRect2D } from "../components/drawable-rect-2d.component"; +import { DrawableText2D } from "../components/drawable-text-2d.component"; + +type Drawable = DrawableRect2D | DrawableCircle2D | DrawableText2D; + +/** The drawables shown by the last frame. */ +let shown = new Set(); + +/** + * Draws every entity that has a `Position2D` and a `DrawableRect2D`, `DrawableCircle2D` or + * `DrawableText2D`, where it is. Add it last, after the systems that move entities. + * + * @remarks + * The shape of a killed entity, or of a removed drawable, is removed from the screen. + * + * @system + * @side client + */ +export const draw2D = (registry: Registry, ctx: Context) => { + const layer = ctx.graphics.baseLayer; + const drawn = new Set(); + + registry.getZipper([DrawableRect2D, Position2D]).forEach(({ DrawableRect2D, Position2D }) => { + DrawableRect2D.draw(layer, Position2D, ctx.assets); + drawn.add(DrawableRect2D); + }); + registry.getZipper([DrawableCircle2D, Position2D]).forEach(({ DrawableCircle2D, Position2D }) => { + DrawableCircle2D.draw(layer, Position2D, ctx.assets); + drawn.add(DrawableCircle2D); + }); + registry.getZipper([DrawableText2D, Position2D]).forEach(({ DrawableText2D, Position2D }) => { + DrawableText2D.draw(layer, Position2D); + drawn.add(DrawableText2D); + }); + + // `killEntity` doesn't call `destroy()`: a drawable no longer in the world loses its shape here. + for (const drawable of shown) if (!drawn.has(drawable)) drawable.destroy(); + shown = drawn; +}; diff --git a/basics/input-mouse/src/systems/follow-mouse-2d.system.ts b/basics/input-mouse/src/systems/follow-mouse-2d.system.ts new file mode 100644 index 0000000..3f90180 --- /dev/null +++ b/basics/input-mouse/src/systems/follow-mouse-2d.system.ts @@ -0,0 +1,21 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; +import "@nanoforge-dev/input"; +import { Position2D } from "../components/position-2d.component"; + +import { FollowMouse2D } from "../components/follow-mouse-2d.component"; + +/** + * Moves every `FollowMouse2D` entity to the mouse cursor. + * + * @system + * @side client + */ +export const followMouse2D = (registry: Registry, ctx: Context) => { + const { x, y } = ctx.input.getMousePosition(); + + registry.getZipper([FollowMouse2D, Position2D]).forEach(({ Position2D }) => { + Position2D.x = x; + Position2D.y = y; + }); +}; diff --git a/basics/input-mouse/src/systems/show-mouse-readout.system.ts b/basics/input-mouse/src/systems/show-mouse-readout.system.ts new file mode 100644 index 0000000..8aa9d10 --- /dev/null +++ b/basics/input-mouse/src/systems/show-mouse-readout.system.ts @@ -0,0 +1,24 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; +import { InputEnum } from "@nanoforge-dev/input"; +import { DrawableText2D } from "../components/drawable-text-2d.component"; + +import { MouseReadout } from "../components/mouse-readout.component"; + +/** + * Counts the left clicks and writes them, with the mouse position, in the text of every + * `MouseReadout` entity. + * + * @system + * @side client + */ +export const showMouseReadout = (registry: Registry, ctx: Context) => { + const { x, y } = ctx.input.getMousePosition(); + const down = ctx.input.isKeyPressed(InputEnum.MouseLeft) === true; + + registry.getZipper([MouseReadout, DrawableText2D]).forEach(({ MouseReadout, DrawableText2D }) => { + if (down && !MouseReadout.held) MouseReadout.clicks++; + MouseReadout.held = down; + DrawableText2D.text = `Mouse ${Math.round(x)}, ${Math.round(y)} Clicks ${MouseReadout.clicks}`; + }); +}; diff --git a/basics/input-mouse/tsconfig.json b/basics/input-mouse/tsconfig.json new file mode 100644 index 0000000..c0ae4f2 --- /dev/null +++ b/basics/input-mouse/tsconfig.json @@ -0,0 +1,39 @@ +{ + "$schema": "https://json.schemastore.org/tsconfig.json", + // Mapped from https://www.typescriptlang.org/tsconfig + "compilerOptions": { + // Type Checking + "allowUnreachableCode": false, + "allowUnusedLabels": false, + "noFallthroughCasesInSwitch": true, + "noImplicitOverride": true, + "noImplicitReturns": true, + "noPropertyAccessFromIndexSignature": false, + "noUncheckedIndexedAccess": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "strict": true, + + // Modules + "allowArbitraryExtensions": false, + "allowImportingTsExtensions": false, + "module": "ESNext", + "moduleResolution": "Bundler", + "resolveJsonModule": true, + "resolvePackageJsonExports": true, + "resolvePackageJsonImports": true, + + // Interop Constraints + "allowSyntheticDefaultImports": true, + "forceConsistentCasingInFileNames": true, + "isolatedModules": true, + + // Language and Environment + "experimentalDecorators": true, + "lib": ["ESNext", "esnext.disposable", "DOM"], + "target": "ESNext", + "useDefineForClassFields": true + }, + "include": ["src"], + "exclude": ["node_modules", ".nanoforge", "dist"] +} diff --git a/basics/music/.gitignore b/basics/music/.gitignore new file mode 100644 index 0000000..f28e2dc --- /dev/null +++ b/basics/music/.gitignore @@ -0,0 +1,5 @@ +node_modules/ +dist/ +.nanoforge/ +nf_modules/ +.env diff --git a/basics/music/README.md b/basics/music/README.md new file mode 100644 index 0000000..e92ff44 --- /dev/null +++ b/basics/music/README.md @@ -0,0 +1,26 @@ +# music + +Press 1 or 2 to play one of two music tracks; M turns the music on and off. + +It shows the `music` engine library: `playMusicOnKey` loads the track of each `PlayOnKey` +(`ctx.music.load`, with the URL `ctx.assets.getAsset` gives for the asset) and plays it when its +key is pressed (`ctx.music.play`). Unlike sound effects, only one track plays at a time: starting +a track pauses the one playing, and pressing its key again resumes it where it stopped. + +The music library **starts muted**, and `ctx.music.mute()` toggles it: press M once to hear +anything. `MuteOnKey` keeps track of the state, which the library does not expose. + +`MusicLibrary` 3.0.0 has no pause, stop or loop: a track plays once to its end, and muting it +does not pause it. + +```sh +pnpm install +pnpm dev # play it +pnpm editor # open it in the editor +``` + +`assets/track-a.wav` and `assets/track-b.wav` are sine-wave melodies generated by a script for this +example: no third-party material. `image-fill.ts`, the `Position2D`, `DrawableRect2D`, +`DrawableCircle2D` and `DrawableText2D` components and the `draw2D` system are copies of +`shared/2d`, and the `PlayOnKey` and `MuteOnKey` components copies of `shared/basics` (see the +repository's README). diff --git a/basics/music/assets/track-a.wav b/basics/music/assets/track-a.wav new file mode 100644 index 0000000..5d82685 Binary files /dev/null and b/basics/music/assets/track-a.wav differ diff --git a/basics/music/assets/track-b.wav b/basics/music/assets/track-b.wav new file mode 100644 index 0000000..419e762 Binary files /dev/null and b/basics/music/assets/track-b.wav differ diff --git a/basics/music/nanoforge.config.ts b/basics/music/nanoforge.config.ts new file mode 100644 index 0000000..77607cb --- /dev/null +++ b/basics/music/nanoforge.config.ts @@ -0,0 +1,5 @@ +import { defineConfig } from "@nanoforge-dev/config"; + +export default defineConfig({ + type: "client", +}); diff --git a/basics/music/package.json b/basics/music/package.json new file mode 100644 index 0000000..491d0f3 --- /dev/null +++ b/basics/music/package.json @@ -0,0 +1,27 @@ +{ + "$schema": "https://json.schemastore.org/package.json", + "name": "music", + "description": "Switch music tracks with keys: the smallest NanoForge game playing music", + "private": true, + "type": "module", + "scripts": { + "dev": "nf dev", + "build": "nf build", + "start": "nf start", + "editor": "nf editor ." + }, + "devDependencies": { + "@nanoforge-dev/asset": "^3.0.0", + "@nanoforge-dev/cli": "^3.0.1", + "@nanoforge-dev/common": "^3.0.0", + "@nanoforge-dev/config": "^3.0.1", + "@nanoforge-dev/core": "^3.0.0", + "@nanoforge-dev/ecs": "^3.0.0", + "@nanoforge-dev/editor-lib": "^3.0.0", + "@nanoforge-dev/env": "^3.0.0", + "@nanoforge-dev/graphics-2d": "^3.0.0", + "@nanoforge-dev/input": "^3.0.0", + "@nanoforge-dev/music": "^3.0.0", + "typescript": "^6.0.0" + } +} diff --git a/basics/music/pnpm-lock.yaml b/basics/music/pnpm-lock.yaml new file mode 100644 index 0000000..e724147 --- /dev/null +++ b/basics/music/pnpm-lock.yaml @@ -0,0 +1,1530 @@ +lockfileVersion: '9.0' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + +importers: + + .: + devDependencies: + '@nanoforge-dev/asset': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/cli': + specifier: ^3.0.1 + version: 3.0.1 + '@nanoforge-dev/common': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/config': + specifier: ^3.0.1 + version: 3.0.1 + '@nanoforge-dev/core': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/ecs': + specifier: ^3.0.0 + version: 3.0.0(@nanoforge-dev/editor-lib@3.0.0) + '@nanoforge-dev/editor-lib': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/env': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/graphics-2d': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/input': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/music': + specifier: ^3.0.0 + version: 3.0.0(@nanoforge-dev/editor-lib@3.0.0) + typescript: + specifier: ^6.0.0 + version: 6.0.3 + +packages: + + '@angular-devkit/core@22.2.7': + resolution: {integrity: sha512-cchZAMsV4d76RDZBlWzPhYxM/Hb6bmq71oUngdrwehMbBbdQu3W9C2tGlvxuPxbRKru9ZlUa14YVXQ0+QnhFtw==} + engines: {node: ^22.22.3 || ^24.15.0 || >=26.0.0, npm: ^6.11.0 || ^7.5.6 || >=8.0.0, yarn: '>= 1.13.0'} + peerDependencies: + chokidar: ^5.0.0 + peerDependenciesMeta: + chokidar: + optional: true + + '@angular-devkit/schematics-cli@22.2.7': + resolution: {integrity: sha512-9Od0E8TiYTQWm/03QjYWnsryZA8ZSjTf/k5z61nPd/jgloVNvSW8kxC7/YMw+RoXh2idMzjiJxraKxg+gJxzPw==} + engines: {node: ^22.22.3 || ^24.15.0 || >=26.0.0, npm: ^6.11.0 || ^7.5.6 || >=8.0.0, yarn: '>= 1.13.0'} + hasBin: true + + '@angular-devkit/schematics@22.2.7': + resolution: {integrity: sha512-a1h7xNqBLQVo1e5eCyOU3axSbA9AFU6nnSH5QhlNhggfMeZde+eBrueSt25xsewoxlKO8EvkVT3+knMUkDYiGQ==} + engines: {node: ^22.22.3 || ^24.15.0 || >=26.0.0, npm: ^6.11.0 || ^7.5.6 || >=8.0.0, yarn: '>= 1.13.0'} + + '@emnapi/core@2.0.0-beta.2': + resolution: {integrity: sha512-MzCVoWtcg4Pm2B3je5mMvYMvj3MmBKw+fU7vbsJc9/iT8ip6/eYIHo/Dsm/mr+wsHB6SEyJDuxB09Yy6r/8+4A==} + + '@emnapi/runtime@2.0.0-beta.2': + resolution: {integrity: sha512-JcrSPzPvZuNZvJqPTF9Fw25LbOJ8avzFVlaf2grmH4Cku0oGP47tRgqPZadcfj3YoZMHkFVnCYFbQM8I+i5QEw==} + + '@emnapi/wasi-threads@2.2.0': + resolution: {integrity: sha512-JP7OYH38Q7+pyTAe14raZHLQIK7BDKbdwji+Xi3pcd/6QkJYQH3SX4wu6EplGrGJWRepoNzedfm0G3B9Z4e9Rw==} + + '@inquirer/ansi@2.1.0': + resolution: {integrity: sha512-63GU5AD9KhNbWM0jlhHoMJTEFck2upFOPxHlnCKf3xYTV3rjTUUQfodihmTnfYQzMLS29oy8lK/gA1eJgu4bhA==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + + '@inquirer/checkbox@5.3.0': + resolution: {integrity: sha512-3QQSO87A+JoRtOtjtsgX2enwTL+3+VBVrkUpdqrIxMOgn5+W5sE57PcCPAiNUIESHxV4Q6mNEGxq2xLmRa0/yw==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/confirm@6.4.0': + resolution: {integrity: sha512-+DCZxrOF01Q/1SzTQkgycAQPS/Jf+Yol0h1P/MVmopukTsxGOu1h/LKqf30y0eHKFZYYrgUMVhGDhEbPmSPi9A==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/core@12.1.0': + resolution: {integrity: sha512-6H7usRWw4Gdjgpaem10CA5MfZ/xoYPGyInriR1Xubqjv+SVo8LIJ1erpFxW5JgCza6VZVZiKLTko7RtUU3AQMg==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/editor@5.4.0': + resolution: {integrity: sha512-L7vdCe4jnMpzhDisu1tAnr4WGvfPOVz+vNFXyIIL7O2Ycn/n90sn1ARvg+4cwzLf+us51BE/cX7uhnrLcal3+g==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/expand@5.2.0': + resolution: {integrity: sha512-AOp2KQk7QojUyWOP7VkqdBWmxLRaVH58wQMx3N4//P530EDtpVp1EWIjAJubx9ZohWS/UCEpIkA1TuiNki0iOA==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/external-editor@3.1.0': + resolution: {integrity: sha512-27JAkF38nXqXaoveU28iA/+Z8nutnF8B3JsbdToPHn9WnkrsMtZ0/YoJ29YwbtFexYIo+tIy6ikMvTdHKjjmGA==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/figures@2.1.0': + resolution: {integrity: sha512-CR9u2PME23jxy2SOyTb117efwAAPm98Zr+LoWI+PiQ55D6U8Yeu/HyFTxwytKhPa6oxAGzdsm2Kg7oLS6B9z8w==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + + '@inquirer/input@5.2.0': + resolution: {integrity: sha512-sIUPnN2X7M+7dq3RUd+e9QRacYnM+6B+kSucwQgj5VC5Eo/f+CIr2NyPBumxsViI+wzfokkgop/3x3KfHxNyJw==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/number@4.3.0': + resolution: {integrity: sha512-xYkX4sPVgox0F7yQwpz/MByWjOGdLEf1pdjH+Lji2gAzSs2xezz5bN5YgS1n0tx9wo0mRhGvq1KJGtvDZ9XXcQ==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/password@5.3.0': + resolution: {integrity: sha512-KVqW4G/UbMK06uBN76xF89JKYC9YBWU7v+Kc2tUwMCO8pg3ASBr0HVabl1KaSqF94O2KiRu8aKx4EicN78PK+A==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/prompts@8.7.2': + resolution: {integrity: sha512-QoRB4wFIjgH5iOhSjoIKMkTvSHDuV+O3OITlIqAYO0oK5x364GJILXiMBvlPiE+klg7Xx9tq5XVqQHcGUDYYPA==} + engines: {node: '>=23.5.0 || ^22.13.0 || ^20.17.0'} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/prompts@8.8.0': + resolution: {integrity: sha512-yYVT2Eo3mafb9tnU2Mr3+wh5wLCWyspExqVoPSMCIfBIn3ZUTE4IDfbCMbMgXaOH0tH+JZEhOtfczQhDzOjIGg==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/rawlist@5.4.0': + resolution: {integrity: sha512-x42wcy465GM5/mHNKBFdAJbLlLyzmYqr/DEa6F49nHpI+03EFwRCRKeLGQakx5XqZ4unc2yFuS78qAD4Rb0iFA==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/search@4.4.0': + resolution: {integrity: sha512-UJ+9tkzPT1AjnvjuPFYcOdO3BVeN28bfSXajYRFZTRgA9OiNl4k2Nn2cHHPwiIDyPHlvOnmE9ZOHyXhPHtvb+A==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/select@5.3.0': + resolution: {integrity: sha512-Fmgfl0qjqCQo+/tjQpgnRXKh5N7/VpYcJh+AlYU2eHmHZLMGUBDzo+Gwc2ODzWJfXNRZmgaMhz4qULcO/C/rXg==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/type@4.3.0': + resolution: {integrity: sha512-/IA8q2nyjgyl0NGSjqiRXB8gh3We7Pzx9C0c+6Zoolu905jFc79anerrUG7+n65+qs310DRK43yi2WDI8nY59A==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@isaacs/fs-minipass@4.0.1': + resolution: {integrity: sha512-wgm9Ehl2jpeqP3zw/7mo3kRHFp5MEDhqAdwy1fTGkHAwnkGOVsgpvQhL8B5n1qlb01jV3n/bI0ZfZp5lWA1k4w==} + engines: {node: '>=18.0.0'} + + '@jridgewell/sourcemap-codec@1.6.0': + resolution: {integrity: sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw==} + + '@nanoforge-dev/asset@3.0.0': + resolution: {integrity: sha512-jqXcyCMbdcCCj7wZ/dyIpjY8hza02Pt/vY8KrNcaXTlxpTc9EE+VKuO5+fHdUXWWPgJSFt96TqAPhug+z+KH3Q==} + engines: {node: '26'} + + '@nanoforge-dev/cli@3.0.1': + resolution: {integrity: sha512-ZfrbETcAcX3vsPLO1WLSCJc2ERCAcIpbdi9Df5bmH3XLinQkDAcESkN9JkaI/vgV08A7xhTjV8zSDSwF0T73Xg==} + engines: {node: '26'} + hasBin: true + + '@nanoforge-dev/common@3.0.0': + resolution: {integrity: sha512-lzMvQ1vCElh9OcP4EqhffbY+AQXOH4IiuD1pj7VvJlpcY6hh7Bs/s4NVS0gXoJ+ibpBMe5mAq23RyzqTwk8czg==} + engines: {node: '26'} + + '@nanoforge-dev/config@3.0.1': + resolution: {integrity: sha512-XWRScOotb8IirerRx/mWLmUVYye3lo0PN/5a0MUp/eoSrhz0S6zzhGHEupRuC8aeHTjsQT7ctM3P6YyKSHZLaQ==} + engines: {node: '26'} + + '@nanoforge-dev/core@3.0.0': + resolution: {integrity: sha512-pa7Fr3TFkZVfAADBC17Qt5ru/W9vXtYB8e5eb7wurAtu8/jH/ZtqfW3kafTuWC9513MXp/h6LOCdZQhjnCt6UA==} + engines: {node: '26'} + + '@nanoforge-dev/ecs@3.0.0': + resolution: {integrity: sha512-csrXJtCzqohxtvEQs+O//xabnaLR3BXe0QpSpl7NVihF3f0iX2fNYURxNjQKxzoPYBokCnnyNxN2KFc7UmIsdA==} + engines: {node: '26'} + peerDependencies: + '@nanoforge-dev/editor-lib': 3.0.0 + '@nanoforge-dev/scene': 3.0.0 + peerDependenciesMeta: + '@nanoforge-dev/editor-lib': + optional: true + '@nanoforge-dev/scene': + optional: true + + '@nanoforge-dev/editor-lib@3.0.0': + resolution: {integrity: sha512-fSWm6bHelbxqeVESYoUUKDi9RGNxvRu6p1r41KE1DddM0RrP0/WzkFOWBvgl+psHbYNotXe723Y2Fd3p+tqPDQ==} + engines: {node: '26'} + + '@nanoforge-dev/editor@0.1.4': + resolution: {integrity: sha512-bqbrH8ulFSiZz1iisJHtHeEzj1RV/70uErCYHeW4DIhVPsWbBfWKFvg/ghAbmPk5vsj0YnhDX6DSpik4S1QoiQ==} + engines: {node: '25'} + + '@nanoforge-dev/env@3.0.0': + resolution: {integrity: sha512-kXYXl9/09Bn8VStTTFuZY3dYDG9b76VhOi9PHMnaLe75XcFRLKJ2dYkXf3ut6RCL2+6H7HAEIOALjR15CHnJ5A==} + engines: {node: '26'} + + '@nanoforge-dev/graphics-2d@3.0.0': + resolution: {integrity: sha512-0I0WUr5495jORdYR+HtyP4kmAfCMvixmG+EH/gE5bN33S8RO6/Ly4oMLZOLUywcDTAFuLn28BlHuVor2YfXrsg==} + engines: {node: '26'} + + '@nanoforge-dev/input@3.0.0': + resolution: {integrity: sha512-8pWU28c99VAvn37onNbVFfwXTgyQGxm5DVnTdBEzgrF3KPCzU77kEaexB1AWOlga+4qNGU7/XNm3hNZ+YS49Ig==} + engines: {node: '26'} + + '@nanoforge-dev/loader-client@1.7.0': + resolution: {integrity: sha512-zDj0yQ8cZyHHjAYDVIyB79mh4dK7WRgZG7Kc+d/43t2WX/pX2HqBVkpLcDPkA9cNOKpCRYWd3LyYISlz53gzyg==} + engines: {node: '26'} + + '@nanoforge-dev/loader-server@1.7.0': + resolution: {integrity: sha512-Yd/BYORhoar5znNSD7kGirAc1Al0q5t8iscbb07QWKeXWA+DLKjPSuKJC6ykysFkbs9HiZU59oOfxyvNL4h3Pw==} + engines: {node: '26'} + + '@nanoforge-dev/loader-website@1.7.0': + resolution: {integrity: sha512-x1fV3RYUUxru39sF5HJcfutNnifMMTIEHW92jgkR9gz06ZlZ+rQofuegXgAnEzs0dEXa+rhNQ/iXYbqOZvq6YQ==} + engines: {node: '26'} + + '@nanoforge-dev/music@3.0.0': + resolution: {integrity: sha512-H0c3QK2dJ8NARU69WG/lwQCnIFpaz1ZOQJxdW3w0MBriU1twJAHicMlwQ2c61Cdmpte4heNqRQqSuBJ8qFY9OQ==} + engines: {node: '26'} + peerDependencies: + '@nanoforge-dev/editor-lib': 3.0.0 + peerDependenciesMeta: + '@nanoforge-dev/editor-lib': + optional: true + + '@nanoforge-dev/registry@3.0.1': + resolution: {integrity: sha512-EzSaszYtrPldD5Do7jdQK3TLLb8uCirY6NQjKXkeGw31X+sUXor4h5GAaoxELWMzPnv9BbKtggSaVaQIt7s8IQ==} + engines: {node: '26'} + + '@nanoforge-dev/schematics@3.0.1': + resolution: {integrity: sha512-iK2vC0gPEh2mQ81IB4+jfGw/ZNOLMDnS9HRBXH5tWB0mdN5GA32viblhW0oYPX2/tWrLC9YiCPgEE4AL8Zwz6w==} + engines: {node: '26'} + + '@napi-rs/wasm-runtime@1.2.6': + resolution: {integrity: sha512-mRyDmEw9/fCDXCGfL1sbgIw/GUK0PVxRW4YwgPN61F3LQ+fSyoBFarJVzgGyhF6kRzEQZ0FejDqm4WLXSeqQmw==} + engines: {node: ^20.19.0 || ^22.13.0 || >=23.5.0} + peerDependencies: + '@emnapi/core': ^1.7.1 || 2.0.0-beta.2 + '@emnapi/runtime': ^1.7.1 || 2.0.0-beta.2 + + '@oven/bun-darwin-aarch64@1.4.4': + resolution: {integrity: sha512-zW/hxwc8sJAILGwB5eTC4i48ouGXf0V4lrxmEOk3JIE6JkYVW1TZh1E2pIempqsezgW1sckTIIDudFON8bJ2Mw==} + cpu: [arm64] + os: [darwin] + + '@oven/bun-darwin-x64@1.4.4': + resolution: {integrity: sha512-oKGcxLsvh4oHjAo28nPm8c/xN0o/OmGyj1IHYc94vprkWsW2hNg2keEZt5f40cI5Hvu4jDlSRTR0UNpv1UIAxw==} + cpu: [x64] + os: [darwin] + + '@oven/bun-freebsd-aarch64@1.4.4': + resolution: {integrity: sha512-klvA9FlwLxZj3JYIOPQA4bbnHIC3uas8kBE4GaGGkeVgAQP/k8hAzYkOqkSaqHBDbxLrTyFEQArEAevJq6NJzg==} + cpu: [arm64] + os: [freebsd] + + '@oven/bun-freebsd-x64@1.4.4': + resolution: {integrity: sha512-sF1xS/scbyN94P2d0eTiarO6JHxrIvhZNT9hnWjQXW5nwKRtfuP+UYnIMNyvW1BQPcZFP/cvfLBNUIe1ea4zPA==} + cpu: [x64] + os: [freebsd] + + '@oven/bun-linux-aarch64-android@1.4.4': + resolution: {integrity: sha512-5lvn3at5vRC0GxvmiqEiV2/e23tnRi0q5pzR40yfDvDA3OW7PSkt4chF1nA9vnAJhro4/l+ol1FmNP6D3cf/oA==} + cpu: [arm64] + os: [android] + + '@oven/bun-linux-aarch64-musl@1.4.4': + resolution: {integrity: sha512-QFd0P+mHJxbZFbUla4MgiE5OwxysHaUIYxL2pPNkpWtaI7v4ShOpr8OhBmsuyB0xn5rv/ZJnPsj2y8+bB9+g/A==} + cpu: [arm64] + os: [linux] + libc: [musl] + + '@oven/bun-linux-aarch64@1.4.4': + resolution: {integrity: sha512-ZTVtpf9zmHSBVPX1sBwe5agGb/rN34yPGg/Hby8e2Ax2uCUA2URZKlZH7qLntK7qaFJCMXh9v0GWNYN2zINz1w==} + cpu: [arm64] + os: [linux] + libc: [glibc] + + '@oven/bun-linux-x64-android@1.4.4': + resolution: {integrity: sha512-3dMicj9C1DhaIfDkwt/9GtpU0W+q+GazbG9OIlEyL3Q1BBEz2e6ZRz/JiO8D/ECC0caXAqvnpFudehcLlgIwWQ==} + cpu: [x64] + os: [android] + + '@oven/bun-linux-x64-musl@1.4.4': + resolution: {integrity: sha512-lEEjNOJJrbGZu2NVcPI4uXdILcpspezWkA8R/Jr0RCGhM6zQd0Y7JBIIKNAmbX59EeWpeEz7Q78iLbpcAUypUA==} + cpu: [x64] + os: [linux] + libc: [musl] + + '@oven/bun-linux-x64@1.4.4': + resolution: {integrity: sha512-CHbbkmHVM28T1GFq+6GL4Ao4ujwwYwj1CxFFwEFzLanPfNsId9AhbIP0Q4reWuWBkGimUkoQygrK7Rgjtj3vog==} + cpu: [x64] + os: [linux] + libc: [glibc] + + '@oven/bun-windows-aarch64@1.4.4': + resolution: {integrity: sha512-n0ep5ZRPCZY1+dqFJpnnRUZB1wy4GYU6At8RF+pyzySCLjkN9R4rFh2PtBHAgF/lg1vOl3/CeER3pDM+p40ATA==} + cpu: [arm64] + os: [win32] + + '@oven/bun-windows-x64@1.4.4': + resolution: {integrity: sha512-a3LNctBVO8PjePsFZfwDleF2JXYf2BfQ1u/PLRnBDLnC2Riml+4+LgJpKj4xRGhB92KweGyQI5PXaTkP9qypMQ==} + cpu: [x64] + os: [win32] + + '@oxc-project/types@0.158.0': + resolution: {integrity: sha512-xZ66qA4WmLbTLlxH3mqMd8f9UKbaOzOT0ATwFf4DH/14pMgpUrtqtjyYzOQmgfl2a0iRAAMbQ9G1th/67jRzGw==} + + '@rolldown/binding-android-arm-eabi@1.3.2': + resolution: {integrity: sha512-kqR2xcygEx3WwDY69LsKeyf7SVmx4yzMtKZRknyaHieVJdRvvnAM97L0Gq6tUFc9T2YXcW/Ghij2+Um6He0LTw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [android] + + '@rolldown/binding-android-arm64@1.3.2': + resolution: {integrity: sha512-gXM4GAAvvIZA7qUuSCQS+Zz91H2fagKa5MNppUdjzysJ8LXMWm9D/gQj4nfOKo6okquDQ5pkjsuo2SUMXNW0Rw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [android] + + '@rolldown/binding-darwin-arm64@1.3.2': + resolution: {integrity: sha512-OBs5hp3W+LwMEUmDMMMnu08ncG0t6DDgnFU+6TAucKtAfNgerYLZSr2jtREKb/JuPQ1J7bJnWIgKKkxvjuAw1g==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [darwin] + + '@rolldown/binding-darwin-x64@1.3.2': + resolution: {integrity: sha512-X0VGYd4v/gdjfa/IP6uHuMhofPoUDYvK/byk3bC0jQ1pKKgt6RZ4B4puMqP0AHkjmIHAsxA471mM6AxZ39IaTA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [darwin] + + '@rolldown/binding-freebsd-x64@1.3.2': + resolution: {integrity: sha512-mr04K4cp9J/fj9fknrX8e4QvI/V48Sp+4v64PoLwhoirIH8b8L8EBrF/0bTjV1It2IL91hoNG13GblnWLglkxA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [freebsd] + + '@rolldown/binding-linux-arm-gnueabihf@1.3.2': + resolution: {integrity: sha512-VgWy02HU9Tiy6tU8U+kF3Fd4TQwTNdIBvs2MlgViP1ksMtAnQQTIPAj0ZsJzIQXKIOugqQSpqxQgELJ3fkuL5w==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [linux] + + '@rolldown/binding-linux-arm64-gnu@1.3.2': + resolution: {integrity: sha512-0wloJFYqV844gv6boiERbHpErxbxHbmlgnMX5VxP1Ux+DLBqGrUOn0cIpBmCZEcTITes3QUelxya4u8c9ziQvQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-arm64-musl@1.3.2': + resolution: {integrity: sha512-Kys8wgFQy8H8vua0MNpC0akMBFoNO8455RHk2yycBM0iayMIAtVAL6xmV9TWAkehFgrrlImTL2fZdX5LXfYtAA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + libc: [musl] + + '@rolldown/binding-linux-ppc64-gnu@1.3.2': + resolution: {integrity: sha512-L8eej7+/StRxUHHOPsOVl7Fzx/3tumuGB4hGQZKT73xRI16KZhaSJr0gi3C3WBjNRxeJRKKps2UD4lQukP+oBw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [ppc64] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-s390x-gnu@1.3.2': + resolution: {integrity: sha512-MV5CEb/nV8neQOj7l6945q1vy62HXtWO8zPDvfySPusoUzdBoLoJ/DfXXwaYThGTXZCniF+5bCf253WTPPK7Yw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [s390x] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-x64-gnu@1.3.2': + resolution: {integrity: sha512-3qssvvVvkwQookZ1/1avlKWc5orAR85vgKdzDd5noZS8nnHiI/ejOAEt0xfNYvtBBF7/DZmP8dANWkRBJVOBCA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-x64-musl@1.3.2': + resolution: {integrity: sha512-rJqoFTm/bCZFKKgaT4NzWn/TuJkFDToZ/rzYFnYVBL28jH1nIfg6snx2mDri30nal9H+wcYfKpoPR9jrMQgQQg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + libc: [musl] + + '@rolldown/binding-openharmony-arm64@1.3.2': + resolution: {integrity: sha512-ozdbCjHfh0N//wJNExjJlSlcDaeIKo8k1ktzkLUyESr2Gu/Qw7nBYxKe3jgtoaxda570vg10WdYosre82263hQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [openharmony] + + '@rolldown/binding-wasm32-wasi@1.3.2': + resolution: {integrity: sha512-p5VA6Vk/2cXZPVWf+dDbuE0dkhrcoAo6pISTJmzUnsSdQqNJdusyR8lZgHku095+r27zrYISNLZnJoqrcePW0A==} + engines: {node: ^20.19.0 || ^22.13.0 || >=23.5.0} + cpu: [wasm32] + + '@rolldown/binding-win32-arm64-msvc@1.3.2': + resolution: {integrity: sha512-XDb2U14Orf4r76SwzvJ7avePL00w4gHBmi1Ig4B/itYFEUTmYMNDHVU0dcYuBa0LgNBqyREoJOrQKxQlyYJA7A==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [win32] + + '@rolldown/binding-win32-x64-msvc@1.3.2': + resolution: {integrity: sha512-lEsKzKJqIUDZVCBhS4lkZuyQUhV1oRg5UHkI72qlOAqJn7qEXcoVdTridFS7PHNWdZknBl95EAF/4P1Xv0K1eQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [win32] + + '@rolldown/pluginutils@1.1.0': + resolution: {integrity: sha512-K+NU2HDCEem4sClgHH4ZZXwdJeNFkJo+hRk479DIwdIviAPN2hFJH1KHHwg8CxHQXvi0M5XY4deTXINfIiSG6w==} + + '@sindresorhus/is@4.6.0': + resolution: {integrity: sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==} + engines: {node: '>=10'} + + '@tybys/wasm-util@0.10.4': + resolution: {integrity: sha512-W3c4gRigFS0T/Ma4qIYF3GDAc5AQdHb1yL5znJT1Zv1YaD9Kitx656wBjvr19qbiosmZT8lWDM5BEMynUqX65A==} + + '@types/validator@13.15.10': + resolution: {integrity: sha512-T8L6i7wCuyoK8A/ZeLYt1+q0ty3Zb9+qbSSvrIVitzT3YjZqkTZ40IbRsPanlB4h1QB3JVL1SYCdR6ngtFYcuA==} + + ajv-formats@3.0.1: + resolution: {integrity: sha512-8iUql50EUR+uUcdRQ3HDqa6EVyo3docL8g5WJ3FNcWmu62IbkGUue/pEyLBW8VGKKucTPgqeks4fIU1DA4yowQ==} + peerDependencies: + ajv: ^8.0.0 + peerDependenciesMeta: + ajv: + optional: true + + ajv@8.20.0: + resolution: {integrity: sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA==} + + ansi-regex@6.6.0: + resolution: {integrity: sha512-XZ5apbzreCbXSKwPjJstu8R0zOi247w3XYwWxtwBXgpZrCyc1Ka7p9/xY0A9/diMewmHbEKz+FIraWaEWjlN5g==} + engines: {node: '>=12'} + + ansis@4.5.0: + resolution: {integrity: sha512-KwIVkfFfJSSzBmZhDGuTmkhWqTdyB5oNVzzznBJbBZ5bZtHiqSrcugRF0RKJKT4Ss3d7ZrcjnlFVDlQNmtWfWw==} + engines: {node: '>=14'} + + braces@3.0.3: + resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} + engines: {node: '>=8'} + + bun@1.4.4: + resolution: {integrity: sha512-hj0ASdG6PNjLZGFAXktWb3Uaj/dcv/1wCsIttoEXADNIQBsGjTr+5uLKYbrDkuc7NT0Tkj4yPIqJI2jDxXdvVg==} + cpu: [arm64, x64] + os: [darwin, linux, android, freebsd, win32] + hasBin: true + + bundle-name@4.1.1: + resolution: {integrity: sha512-DdH81/zPLVS11EUgWq3tEu/xn+EzljlMYooDNdzWEnFha3R3NBMpMV1UqYIpjYHV/SgpFKMIX1Oh7o06SjM/oA==} + engines: {node: '>=18'} + + chalk@5.6.2: + resolution: {integrity: sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA==} + engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} + + char-regex@1.0.2: + resolution: {integrity: sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==} + engines: {node: '>=10'} + + chardet@2.2.0: + resolution: {integrity: sha512-rddelWYNPRrXq6PtNEN2S3f6t9ILzvqaN5pVgi4kqt9jHQaXIial9PznB5iSPVlQSLNaaH22ItWz3EJtQ10+OA==} + + chokidar@5.0.0: + resolution: {integrity: sha512-TQMmc3w+5AxjpL8iIiwebF73dRDF4fBIieAqGn9RGCWaEVwQ6Fb2cGe31Yns0RRIzii5goJ1Y7xbMwo1TxMplw==} + engines: {node: '>= 20.19.0'} + + chownr@3.0.0: + resolution: {integrity: sha512-+IxzY9BZOQd/XuYPRmrvEVjF/nqj5kgT4kEq7VofrDoM1MxoRjEWkrCC3EtLi59TVawxTAn+orJwFQcrqEN1+g==} + engines: {node: '>=18'} + + class-transformer@0.5.1: + resolution: {integrity: sha512-SQa1Ws6hUbfC98vKGxZH3KFY0Y1lm5Zm0SY8XX9zbK7FJCyVEac3ATW0RIpwzW+oOfmHE5PMPufDG9hCfoEOMw==} + + class-validator@0.14.4: + resolution: {integrity: sha512-AwNusCCam51q703dW82x95tOqQp6oC9HNUl724KxJJOfnKscI8dOloXFgyez7LbTTKWuRBA37FScqVbJEoq8Yw==} + + class-validator@0.15.1: + resolution: {integrity: sha512-LqoS80HBBSCVhz/3KloUly0ovokxpdOLR++Al3J3+dHXWt9sTKlKd4eYtoxhxyUjoe5+UcIM+5k9MIxyBWnRTw==} + + cli-cursor@5.0.0: + resolution: {integrity: sha512-aCj4O5wKyszjMmDT4tZj93kxyydN/K5zPWSCe6/0AV/AA1pqe5ZBIw0a2ZfPQV7lL5/yb5HsUreJ6UFAF1tEQw==} + engines: {node: '>=18'} + + cli-spinners@3.4.0: + resolution: {integrity: sha512-bXfOC4QcT1tKXGorxL3wbJm6XJPDqEnij2gQ2m7ESQuE+/z9YFIWnl/5RpTiKWbMq3EVKR4fRLJGn6DVfu0mpw==} + engines: {node: '>=18.20'} + + cli-width@4.1.0: + resolution: {integrity: sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==} + engines: {node: '>= 12'} + + commander@15.1.0: + resolution: {integrity: sha512-cgnQ88TRrWcC7pVq46RzJVRMktu3W2RcbnoidnfBsl1bmDCBwJS/udcIZpKoCrbAYYaCqsz1yZCVIgbIaU3ddQ==} + engines: {node: '>=22.12.0'} + + default-browser-id@5.0.1: + resolution: {integrity: sha512-x1VCxdX4t+8wVfd1so/9w+vQ4vx7lKd2Qp5tDRutErwmR85OgmfX7RlLRMWafRMY7hbEiXIbudNrjOAPa/hL8Q==} + engines: {node: '>=18'} + + default-browser@5.5.1: + resolution: {integrity: sha512-m1pAzaJgZ/gssEqlOhJkPJp8Xly7QyW6xcrkUa2KKcDeDSEMP7X8xipU3snUcfisTQx0w1AGae+9UtJSfVnXGw==} + engines: {node: '>=18'} + + define-lazy-prop@3.0.0: + resolution: {integrity: sha512-N+MeXYoqr3pOgn8xfyRPREN7gHakLYjhsHhWGT3fWAiL4IkAt0iDw14QiiEm2bE30c5XX5q0FtAA3CK5f9/BUg==} + engines: {node: '>=12'} + + defu@6.1.7: + resolution: {integrity: sha512-7z22QmUWiQ/2d0KkdYmANbRUVABpZ9SNYyH5vx6PZ+nE5bcC0l7uFvEfHlyld/HcGBFTL536ClDt3DEcSlEJAQ==} + + destr@2.0.5: + resolution: {integrity: sha512-ugFTXCtDZunbzasqBxrK93Ik/DRYsO6S/fedkWEMKqt04xZ4csmnmwGDBAb07QWNaGMAmnTIemsYZCksjATwsA==} + + dotenv@17.4.2: + resolution: {integrity: sha512-nI4U3TottKAcAD9LLud4Cb7b2QztQMUEfHbvhTH09bqXTxnSie8WnjPALV/WMCrJZ6UV/qHJ6L03OqO3LcdYZw==} + engines: {node: '>=12'} + + dotenv@18.0.10: + resolution: {integrity: sha512-89FAA1xchzK2mxVWdr5F/0rldwiueXs6zJM86rO66EzekR1iBdiXRthyG+m5GvkJaFH3C2LESzamTkgndmLT2A==} + engines: {node: '>=12'} + hasBin: true + + emojilib@2.4.0: + resolution: {integrity: sha512-5U0rVMU5Y2n2+ykNLQqMoqklN9ICBT/KsvC1Gz6vqHbz2AXXGkG+Pm5rMWk/8Vjrr/mY9985Hi8DYzn1F09Nyw==} + + fast-deep-equal@3.1.3: + resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} + + fast-string-truncated-width@3.0.3: + resolution: {integrity: sha512-0jjjIEL6+0jag3l2XWWizO64/aZVtpiGE3t0Zgqxv0DPuxiMjvB3M24fCyhZUO4KomJQPj3LTSUnDP3GpdwC0g==} + + fast-string-width@3.0.2: + resolution: {integrity: sha512-gX8LrtNEI5hq8DVUfRQMbr5lpaS4nMIWV+7XEbXk2b8kiQIizgnlr12B4dA3ZEx3308ze0O4Q1R+cHts8kyUJg==} + + fast-uri@3.1.9: + resolution: {integrity: sha512-hS/0Wt3Ya043oKXs0sIxrMpKQITXhMLIrVAKKXi4gozGC9v7YRWVnXIZzjNPTO02M9BdxLCWqK1yRXgNziVyJQ==} + + fast-wrap-ansi@0.2.2: + resolution: {integrity: sha512-7F2Fl+TjRSenLqlU3UjSH0iyqopqoZIu7eZVpEirP2g1GtWa2G/ecEmBdgz31+Mxr+ELclgg6sokpSFIQiZ02Q==} + + fflate@0.8.3: + resolution: {integrity: sha512-tbZNuJrLwGUp3zshBtdy4W+ORxZuIh8a5ilyIEQDC5rY1f3U20JMry0Ll3WBzU58EZKsEuJFXhb5gwv8CsPvgA==} + + fill-range@7.1.1: + resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} + engines: {node: '>=8'} + + get-east-asian-width@1.7.0: + resolution: {integrity: sha512-XjH1AECxf0giL2V1aU8vKyRR2ppRUb5c0EvT7zuJTokQ74bNo52zOtghqdWIqrhUD79fo3x0WfKZdOqxF6LG1Q==} + engines: {node: '>=18'} + + iconv-lite@0.7.3: + resolution: {integrity: sha512-IKXpvIzjnC9XTAUbVBcMfGS0EPaIXtW6v+zr+RRp+hqULEpo0owZax6wyRwPOJbWbzjYspQwusTsfVr0ifh4uQ==} + engines: {node: '>=0.10.0'} + + is-docker@3.0.0: + resolution: {integrity: sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + hasBin: true + + is-in-ssh@1.0.0: + resolution: {integrity: sha512-jYa6Q9rH90kR1vKB6NM7qqd1mge3Fx4Dhw5TVlK1MUBqhEOuCagrEHMevNuCcbECmXZ0ThXkRm+Ymr51HwEPAw==} + engines: {node: '>=20'} + + is-inside-container@1.0.0: + resolution: {integrity: sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA==} + engines: {node: '>=14.16'} + hasBin: true + + is-interactive@2.0.0: + resolution: {integrity: sha512-qP1vozQRI+BMOPcjFzrjXuQvdak2pHNUMZoeG2eRbiSqyvbEf/wQtEOTOX1guk6E3t36RkaqiSt8A/6YElNxLQ==} + engines: {node: '>=12'} + + is-number@7.0.0: + resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} + engines: {node: '>=0.12.0'} + + is-unicode-supported@2.1.0: + resolution: {integrity: sha512-mE00Gnza5EEB3Ds0HfMyllZzbBrmLOX3vfWoj9A9PEnTfratQ/BcaJOuMhnkhjXvb2+FkY3VuHqtAGpTPmglFQ==} + engines: {node: '>=18'} + + is-wsl@3.1.1: + resolution: {integrity: sha512-e6rvdUCiQCAuumZslxRJWR/Doq4VpPR82kqclvcS0efgt430SlGIk05vdCN58+VrzgtIcfNODjozVielycD4Sw==} + engines: {node: '>=16'} + + json-schema-traverse@1.0.0: + resolution: {integrity: sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==} + + jsonc-parser@3.3.1: + resolution: {integrity: sha512-HUgH65KyejrUFPvHFPbqOY0rsFip3Bo5wb4ngvdi1EpCYWUQDC5V+Y7mZws+DLkr4M//zQJoanu1SP+87Dv1oQ==} + + konva@10.9.1: + resolution: {integrity: sha512-m49x+GatSxEUSvqahYhxpTjgKbtrLtw4P4o4B4iux953ZFpceaK52Ea+CFsAsd7W4I0Y5u6mMoRUsY/eltNZmw==} + peerDependencies: + canvas: ^3.0.0 + skia-canvas: ^3.0.0 + peerDependenciesMeta: + canvas: + optional: true + skia-canvas: + optional: true + + libphonenumber-js@1.13.16: + resolution: {integrity: sha512-tIOCM9yx2Go6d5/ZANe0K+G4AZek1Ymx81HxQpf19Sri4zMP95eQbKdnUGHAvFQ4nx0PeLhFqvAfisTADXj3tQ==} + + log-symbols@7.0.1: + resolution: {integrity: sha512-ja1E3yCr9i/0hmBVaM0bfwDjnGy8I/s6PP4DFp+yP+a+mrHO4Rm7DtmnqROTUkHIkqffC84YY7AeqX6oFk0WFg==} + engines: {node: '>=18'} + + magic-string@1.4.1: + resolution: {integrity: sha512-8lyCu36ErXR0J9uaGKlKQoiLZKmtI63YGLE8G2o9jyRPdr4X47LusSOwgOJOzcVtp81fTAAjxR7BwKz682Jhow==} + + micromatch@4.0.8: + resolution: {integrity: sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==} + engines: {node: '>=8.6'} + + mimic-function@5.0.1: + resolution: {integrity: sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==} + engines: {node: '>=18'} + + minipass@7.1.3: + resolution: {integrity: sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A==} + engines: {node: '>=16 || 14 >=14.17'} + + minizlib@3.1.0: + resolution: {integrity: sha512-KZxYo1BUkWD2TVFLr0MQoM8vUUigWD3LlD83a/75BqC+4qE0Hb1Vo5v1FgcfaNXvfXzr+5EhQ6ing/CaBijTlw==} + engines: {node: '>= 18'} + + mute-stream@4.0.0: + resolution: {integrity: sha512-gSrprq0fJ3EiOErzjdIZrjysVVmJ4uu1QWfCDss5LypA5OXvrMje5Ym5z6V6RLyJ2eF87lasX7t6a0AnFvZblg==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + + node-emoji@2.2.0: + resolution: {integrity: sha512-Z3lTE9pLaJF47NyMhd4ww1yFTAP8YhYI8SleJiHzM46Fgpm5cnNzSl9XfzFNqbaz+VlJrIj3fXQ4DeN1Rjm6cw==} + engines: {node: '>=18'} + + onetime@7.0.0: + resolution: {integrity: sha512-VXJjc87FScF88uafS3JllDgvAm+c/Slfz06lorj2uAY34rlUu0Nt+v8wreiImcrgAjjIHp1rXpTDlLOGw29WwQ==} + engines: {node: '>=18'} + + open@11.0.4: + resolution: {integrity: sha512-++Zlftm0kVLPmzC06t6epuWmcRMDbI4z5P3NNX979WA/k23+NtSOynEGzsVfZwguKw2mi5umVgnBlJQMwRz4Pg==} + engines: {node: '>=20'} + + ora@9.4.1: + resolution: {integrity: sha512-6VlU9MLXbjVQD04AZCMX28hVtA5bUoadvUqO76MUCVA0ilwJbMiHsITRPfyVm6p/BC0Av/BXMujx39WCe1LEqw==} + engines: {node: '>=20'} + + picomatch@2.3.2: + resolution: {integrity: sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==} + engines: {node: '>=8.6'} + + picomatch@4.0.7: + resolution: {integrity: sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA==} + engines: {node: '>=12'} + + powershell-utils@0.2.1: + resolution: {integrity: sha512-C+y9x90UElAddDZmV4qOx9W53B61PO7cIqWz2dQsWlwswuq4mr8NEwytdGKboYbQlGZ3awrkTeNvcZiZNHnQ8A==} + engines: {node: '>=20'} + + rc9@3.1.0: + resolution: {integrity: sha512-ufjkNVzbRHKcCOmTahZkmVsyc3W+MSk3jY03m+a7tGHkIsdVMG9l10/3HvFbWkkKzY5VFp3pkRsIo/UYgmFL7Q==} + + readdirp@5.1.1: + resolution: {integrity: sha512-Kko+Y5XQ6fM+Ce3dq3m9YGxnacYZYl9cA1wZjaF3Vbry2L3i1qVg8+CAgNPsXRArPMUMCaOR7oa9Nqntc43JKA==} + engines: {node: '>= 20.19.0'} + + require-from-string@2.0.2: + resolution: {integrity: sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==} + engines: {node: '>=0.10.0'} + + restore-cursor@5.1.0: + resolution: {integrity: sha512-oMA2dcrw6u0YfxJQXm342bFKX/E4sG9rbTzO9ptUcR/e8A33cHuvStiYOwH7fszkZlZ1z/ta9AAoPk2F4qIOHA==} + engines: {node: '>=18'} + + rolldown@1.3.2: + resolution: {integrity: sha512-EFHqbVkXiYZA6akmYm2bvJhNbEGdUwAResRhYwl/BO8QhB5KxsG+t3RVHJSIOy5jBEb0XCACvrIGnnl6Z8sMGA==} + engines: {node: ^20.19.0 || >=22.12.0} + hasBin: true + + run-applescript@7.1.0: + resolution: {integrity: sha512-DPe5pVFaAsinSaV6QjQ6gdiedWDcRCbUuiQfQa2wmWV7+xC9bGulGI8+TdRmoFkAPaBXk8CrAbnlY2ISniJ47Q==} + engines: {node: '>=18'} + + rxjs@7.8.2: + resolution: {integrity: sha512-dhKf903U/PQZY6boNNtAGdWbG85WAbjT/1xYoZIC7FAY0yWapOBQVsVrDl58W86//e1VpMNBtRV4MaXfdMySFA==} + + safer-buffer@2.1.2: + resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} + + semver@7.8.6: + resolution: {integrity: sha512-9lpSSU4Mly3mrtruwLs1eLK6+gzbzqeBFwRNjIjE+9LuDpWdYctrQlQ3ej1Ilgi7gknpsTRnPoLP8DpCHqHIJw==} + engines: {node: '>=10'} + hasBin: true + + signal-exit@4.1.0: + resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} + engines: {node: '>=14'} + + skin-tone@2.0.0: + resolution: {integrity: sha512-kUMbT1oBJCpgrnKoSr0o6wPtvRWT9W9UKvGLwfJYO2WuahZRHOpEyL1ckyMGgMWh0UdpmaoFqKKD29WTomNEGA==} + engines: {node: '>=8'} + + source-map@0.8.0: + resolution: {integrity: sha512-d8EqvL+k/SOXCreS/SUzg2ciyHqBBLcN/yuRjFsbvVhHTE2pgei7oAhmPM7kWFbkX6OSMQfUq4KbkF3au9lhYQ==} + engines: {node: '>= 12'} + + stdin-discarder@0.3.2: + resolution: {integrity: sha512-eCPu1qRxPVkl5605OTWF8Wz40b4Mf45NY5LQmVPQ599knfs5QhASUm9GbJ5BDMDOXgrnh0wyEdvzmL//YMlw0A==} + engines: {node: '>=18'} + + string-width@8.3.0: + resolution: {integrity: sha512-ZbmZM0JCihQN91dWnxoipT2KOEyHqEyfRXUyjuRhW8b/xnqPDoq4gWEVApTVa9db2wN8mmoikgFBbjh71+cGeQ==} + engines: {node: '>=20'} + + strip-ansi@7.2.0: + resolution: {integrity: sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==} + engines: {node: '>=12'} + + tar@7.5.23: + resolution: {integrity: sha512-lkukzdoGngZHJZXxW4S/E4Fp9ghTDlyZXrQGRNoJ/LXvDKcXUTq2sg5yQe74po7Voea6n/IN09+wE/QvJMiifA==} + engines: {node: '>=18'} + + to-regex-range@5.0.1: + resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} + engines: {node: '>=8.0'} + + tslib@2.9.1: + resolution: {integrity: sha512-a4Ux9VKuIMHsOS7ENbEq6hK2ZGYIT27Rtl0E4eD9KqwxhKiQeMZE/9xb3IdYwWaSOyIBQLExhQgXDTYoiCxnWA==} + + typescript@6.0.3: + resolution: {integrity: sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw==} + engines: {node: '>=14.17'} + hasBin: true + + unicode-emoji-modifier-base@1.0.0: + resolution: {integrity: sha512-yLSH4py7oFH3oG/9K+XWrz1pSi3dfUrWEnInbxMfArOfc1+33BlGPQtLsOYwvdMy11AwUBetYuaRxSPqgkq+8g==} + engines: {node: '>=4'} + + unrun@0.3.1: + resolution: {integrity: sha512-onIck/oNnCaytwths1ZVp1LK2Gq2hPoyFhiHebObuUXqR3S0uHuLLaBK8K6mRRgV7Ptip8AnNvaUsgzwWwBZuA==} + engines: {node: ^22.13.0 || >=24.0.0} + hasBin: true + peerDependencies: + synckit: ^0.11.11 + peerDependenciesMeta: + synckit: + optional: true + + validator@13.15.35: + resolution: {integrity: sha512-TQ5pAGhd5whStmqWvYF4OjQROlmv9SMFVt37qoCBdqRffuuklWYQlCNnEs2ZaIBD1kZRNnikiZOS1eqgkar0iw==} + engines: {node: '>= 0.10'} + + wsl-utils@1.0.1: + resolution: {integrity: sha512-c16PKLIRxBYpR3jSWsdS7SFp0COm5SOQdiFjY818dYFHJbMGuLBszpF07LBWmOS1uzrHa9VGdynsEgoeKy0oOQ==} + engines: {node: '>=20'} + + yallist@5.0.0: + resolution: {integrity: sha512-YgvUTfwqyc7UXVMrB+SImsVYSmTS8X/tSrtdNZMImM+n7+QTriRXyXim0mBrTXNeqzVF0KWGgHPeiyViFFrNDw==} + engines: {node: '>=18'} + + yoctocolors@2.2.0: + resolution: {integrity: sha512-xYqdZFUK/VYazNl/oCDYN+3WloWQwMfZxBoiNt6qNyk+xfOdi598muWE42rNZFp1kNOiqW936q5RhUdnpqElSg==} + engines: {node: '>=18'} + + zod@4.6.7: + resolution: {integrity: sha512-g8W2D2kU6a8untc053fX1uVBKzM7yqAxW/3zwk83+6RyF2+SKOuV+c0wBDhUwzV1PaGapmZH+rmcUzPf+3CGwg==} + +snapshots: + + '@angular-devkit/core@22.2.7(chokidar@5.0.0)': + dependencies: + ajv: 8.20.0 + ajv-formats: 3.0.1(ajv@8.20.0) + jsonc-parser: 3.3.1 + picomatch: 4.0.7 + rxjs: 7.8.2 + source-map: 0.8.0 + optionalDependencies: + chokidar: 5.0.0 + + '@angular-devkit/schematics-cli@22.2.7(chokidar@5.0.0)': + dependencies: + '@angular-devkit/core': 22.2.7(chokidar@5.0.0) + '@angular-devkit/schematics': 22.2.7(chokidar@5.0.0) + '@inquirer/prompts': 8.7.2 + transitivePeerDependencies: + - '@types/node' + - chokidar + + '@angular-devkit/schematics@22.2.7(chokidar@5.0.0)': + dependencies: + '@angular-devkit/core': 22.2.7(chokidar@5.0.0) + jsonc-parser: 3.3.1 + magic-string: 1.4.1 + ora: 9.4.1 + rxjs: 7.8.2 + transitivePeerDependencies: + - chokidar + + '@emnapi/core@2.0.0-beta.2': + dependencies: + '@emnapi/wasi-threads': 2.2.0 + tslib: 2.9.1 + optional: true + + '@emnapi/runtime@2.0.0-beta.2': + dependencies: + tslib: 2.9.1 + optional: true + + '@emnapi/wasi-threads@2.2.0': + dependencies: + tslib: 2.9.1 + optional: true + + '@inquirer/ansi@2.1.0': {} + + '@inquirer/checkbox@5.3.0': + dependencies: + '@inquirer/ansi': 2.1.0 + '@inquirer/core': 12.1.0 + '@inquirer/figures': 2.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/confirm@6.4.0': + dependencies: + '@inquirer/core': 12.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/core@12.1.0': + dependencies: + '@inquirer/ansi': 2.1.0 + '@inquirer/figures': 2.1.0 + '@inquirer/type': 4.3.0 + cli-width: 4.1.0 + fast-wrap-ansi: 0.2.2 + mute-stream: 4.0.0 + signal-exit: 4.1.0 + + '@inquirer/editor@5.4.0': + dependencies: + '@inquirer/core': 12.1.0 + '@inquirer/external-editor': 3.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/expand@5.2.0': + dependencies: + '@inquirer/core': 12.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/external-editor@3.1.0': + dependencies: + chardet: 2.2.0 + iconv-lite: 0.7.3 + + '@inquirer/figures@2.1.0': {} + + '@inquirer/input@5.2.0': + dependencies: + '@inquirer/core': 12.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/number@4.3.0': + dependencies: + '@inquirer/core': 12.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/password@5.3.0': + dependencies: + '@inquirer/ansi': 2.1.0 + '@inquirer/core': 12.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/prompts@8.7.2': + dependencies: + '@inquirer/checkbox': 5.3.0 + '@inquirer/confirm': 6.4.0 + '@inquirer/editor': 5.4.0 + '@inquirer/expand': 5.2.0 + '@inquirer/input': 5.2.0 + '@inquirer/number': 4.3.0 + '@inquirer/password': 5.3.0 + '@inquirer/rawlist': 5.4.0 + '@inquirer/search': 4.4.0 + '@inquirer/select': 5.3.0 + + '@inquirer/prompts@8.8.0': + dependencies: + '@inquirer/checkbox': 5.3.0 + '@inquirer/confirm': 6.4.0 + '@inquirer/editor': 5.4.0 + '@inquirer/expand': 5.2.0 + '@inquirer/input': 5.2.0 + '@inquirer/number': 4.3.0 + '@inquirer/password': 5.3.0 + '@inquirer/rawlist': 5.4.0 + '@inquirer/search': 4.4.0 + '@inquirer/select': 5.3.0 + + '@inquirer/rawlist@5.4.0': + dependencies: + '@inquirer/core': 12.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/search@4.4.0': + dependencies: + '@inquirer/core': 12.1.0 + '@inquirer/figures': 2.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/select@5.3.0': + dependencies: + '@inquirer/ansi': 2.1.0 + '@inquirer/core': 12.1.0 + '@inquirer/figures': 2.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/type@4.3.0': {} + + '@isaacs/fs-minipass@4.0.1': + dependencies: + minipass: 7.1.3 + + '@jridgewell/sourcemap-codec@1.6.0': {} + + '@nanoforge-dev/asset@3.0.0': + dependencies: + '@nanoforge-dev/common': 3.0.0 + + '@nanoforge-dev/cli@3.0.1': + dependencies: + '@angular-devkit/schematics': 22.2.7(chokidar@5.0.0) + '@angular-devkit/schematics-cli': 22.2.7(chokidar@5.0.0) + '@inquirer/prompts': 8.8.0 + '@nanoforge-dev/config': 3.0.1 + '@nanoforge-dev/editor': 0.1.4 + '@nanoforge-dev/loader-client': 1.7.0 + '@nanoforge-dev/loader-server': 1.7.0 + '@nanoforge-dev/registry': 3.0.1 + '@nanoforge-dev/schematics': 3.0.1(chokidar@5.0.0) + ansis: 4.5.0 + bun: 1.4.4 + chokidar: 5.0.0 + commander: 15.1.0 + dotenv: 18.0.10 + node-emoji: 2.2.0 + open: 11.0.4 + ora: 9.4.1 + rc9: 3.1.0 + transitivePeerDependencies: + - '@types/node' + - synckit + + '@nanoforge-dev/common@3.0.0': {} + + '@nanoforge-dev/config@3.0.1': + dependencies: + unrun: 0.3.1 + zod: 4.6.7 + transitivePeerDependencies: + - synckit + + '@nanoforge-dev/core@3.0.0': + dependencies: + '@nanoforge-dev/asset': 3.0.0 + '@nanoforge-dev/common': 3.0.0 + + '@nanoforge-dev/ecs@3.0.0(@nanoforge-dev/editor-lib@3.0.0)': + dependencies: + '@nanoforge-dev/common': 3.0.0 + optionalDependencies: + '@nanoforge-dev/editor-lib': 3.0.0 + + '@nanoforge-dev/editor-lib@3.0.0': + dependencies: + '@nanoforge-dev/common': 3.0.0 + + '@nanoforge-dev/editor@0.1.4': + dependencies: + bun: 1.4.4 + class-transformer: 0.5.1 + class-validator: 0.15.1 + dotenv: 17.4.2 + micromatch: 4.0.8 + tar: 7.5.23 + typescript: 6.0.3 + + '@nanoforge-dev/env@3.0.0': + dependencies: + '@nanoforge-dev/common': 3.0.0 + class-transformer: 0.5.1 + class-validator: 0.14.4 + + '@nanoforge-dev/graphics-2d@3.0.0': + dependencies: + '@nanoforge-dev/common': 3.0.0 + konva: 10.9.1 + transitivePeerDependencies: + - canvas + - skia-canvas + + '@nanoforge-dev/input@3.0.0': + dependencies: + '@nanoforge-dev/common': 3.0.0 + + '@nanoforge-dev/loader-client@1.7.0': + dependencies: + '@nanoforge-dev/loader-website': 1.7.0 + bun: 1.4.4 + commander: 15.1.0 + + '@nanoforge-dev/loader-server@1.7.0': + dependencies: + bun: 1.4.4 + commander: 15.1.0 + + '@nanoforge-dev/loader-website@1.7.0': {} + + '@nanoforge-dev/music@3.0.0(@nanoforge-dev/editor-lib@3.0.0)': + dependencies: + '@nanoforge-dev/common': 3.0.0 + optionalDependencies: + '@nanoforge-dev/editor-lib': 3.0.0 + + '@nanoforge-dev/registry@3.0.1': + dependencies: + fflate: 0.8.3 + semver: 7.8.6 + zod: 4.6.7 + + '@nanoforge-dev/schematics@3.0.1(chokidar@5.0.0)': + dependencies: + '@angular-devkit/core': 22.2.7(chokidar@5.0.0) + '@angular-devkit/schematics': 22.2.7(chokidar@5.0.0) + rxjs: 7.8.2 + transitivePeerDependencies: + - chokidar + + '@napi-rs/wasm-runtime@1.2.6(@emnapi/core@2.0.0-beta.2)(@emnapi/runtime@2.0.0-beta.2)': + dependencies: + '@emnapi/core': 2.0.0-beta.2 + '@emnapi/runtime': 2.0.0-beta.2 + '@tybys/wasm-util': 0.10.4 + optional: true + + '@oven/bun-darwin-aarch64@1.4.4': + optional: true + + '@oven/bun-darwin-x64@1.4.4': + optional: true + + '@oven/bun-freebsd-aarch64@1.4.4': + optional: true + + '@oven/bun-freebsd-x64@1.4.4': + optional: true + + '@oven/bun-linux-aarch64-android@1.4.4': + optional: true + + '@oven/bun-linux-aarch64-musl@1.4.4': + optional: true + + '@oven/bun-linux-aarch64@1.4.4': + optional: true + + '@oven/bun-linux-x64-android@1.4.4': + optional: true + + '@oven/bun-linux-x64-musl@1.4.4': + optional: true + + '@oven/bun-linux-x64@1.4.4': + optional: true + + '@oven/bun-windows-aarch64@1.4.4': + optional: true + + '@oven/bun-windows-x64@1.4.4': + optional: true + + '@oxc-project/types@0.158.0': {} + + '@rolldown/binding-android-arm-eabi@1.3.2': + optional: true + + '@rolldown/binding-android-arm64@1.3.2': + optional: true + + '@rolldown/binding-darwin-arm64@1.3.2': + optional: true + + '@rolldown/binding-darwin-x64@1.3.2': + optional: true + + '@rolldown/binding-freebsd-x64@1.3.2': + optional: true + + '@rolldown/binding-linux-arm-gnueabihf@1.3.2': + optional: true + + '@rolldown/binding-linux-arm64-gnu@1.3.2': + optional: true + + '@rolldown/binding-linux-arm64-musl@1.3.2': + optional: true + + '@rolldown/binding-linux-ppc64-gnu@1.3.2': + optional: true + + '@rolldown/binding-linux-s390x-gnu@1.3.2': + optional: true + + '@rolldown/binding-linux-x64-gnu@1.3.2': + optional: true + + '@rolldown/binding-linux-x64-musl@1.3.2': + optional: true + + '@rolldown/binding-openharmony-arm64@1.3.2': + optional: true + + '@rolldown/binding-wasm32-wasi@1.3.2': + dependencies: + '@emnapi/core': 2.0.0-beta.2 + '@emnapi/runtime': 2.0.0-beta.2 + '@napi-rs/wasm-runtime': 1.2.6(@emnapi/core@2.0.0-beta.2)(@emnapi/runtime@2.0.0-beta.2) + optional: true + + '@rolldown/binding-win32-arm64-msvc@1.3.2': + optional: true + + '@rolldown/binding-win32-x64-msvc@1.3.2': + optional: true + + '@rolldown/pluginutils@1.1.0': {} + + '@sindresorhus/is@4.6.0': {} + + '@tybys/wasm-util@0.10.4': + dependencies: + tslib: 2.9.1 + optional: true + + '@types/validator@13.15.10': {} + + ajv-formats@3.0.1(ajv@8.20.0): + optionalDependencies: + ajv: 8.20.0 + + ajv@8.20.0: + dependencies: + fast-deep-equal: 3.1.3 + fast-uri: 3.1.9 + json-schema-traverse: 1.0.0 + require-from-string: 2.0.2 + + ansi-regex@6.6.0: {} + + ansis@4.5.0: {} + + braces@3.0.3: + dependencies: + fill-range: 7.1.1 + + bun@1.4.4: + optionalDependencies: + '@oven/bun-darwin-aarch64': 1.4.4 + '@oven/bun-darwin-x64': 1.4.4 + '@oven/bun-freebsd-aarch64': 1.4.4 + '@oven/bun-freebsd-x64': 1.4.4 + '@oven/bun-linux-aarch64': 1.4.4 + '@oven/bun-linux-aarch64-android': 1.4.4 + '@oven/bun-linux-aarch64-musl': 1.4.4 + '@oven/bun-linux-x64': 1.4.4 + '@oven/bun-linux-x64-android': 1.4.4 + '@oven/bun-linux-x64-musl': 1.4.4 + '@oven/bun-windows-aarch64': 1.4.4 + '@oven/bun-windows-x64': 1.4.4 + + bundle-name@4.1.1: + dependencies: + run-applescript: 7.1.0 + + chalk@5.6.2: {} + + char-regex@1.0.2: {} + + chardet@2.2.0: {} + + chokidar@5.0.0: + dependencies: + readdirp: 5.1.1 + + chownr@3.0.0: {} + + class-transformer@0.5.1: {} + + class-validator@0.14.4: + dependencies: + '@types/validator': 13.15.10 + libphonenumber-js: 1.13.16 + validator: 13.15.35 + + class-validator@0.15.1: + dependencies: + '@types/validator': 13.15.10 + libphonenumber-js: 1.13.16 + validator: 13.15.35 + + cli-cursor@5.0.0: + dependencies: + restore-cursor: 5.1.0 + + cli-spinners@3.4.0: {} + + cli-width@4.1.0: {} + + commander@15.1.0: {} + + default-browser-id@5.0.1: {} + + default-browser@5.5.1: + dependencies: + bundle-name: 4.1.1 + default-browser-id: 5.0.1 + + define-lazy-prop@3.0.0: {} + + defu@6.1.7: {} + + destr@2.0.5: {} + + dotenv@17.4.2: {} + + dotenv@18.0.10: {} + + emojilib@2.4.0: {} + + fast-deep-equal@3.1.3: {} + + fast-string-truncated-width@3.0.3: {} + + fast-string-width@3.0.2: + dependencies: + fast-string-truncated-width: 3.0.3 + + fast-uri@3.1.9: {} + + fast-wrap-ansi@0.2.2: + dependencies: + fast-string-width: 3.0.2 + + fflate@0.8.3: {} + + fill-range@7.1.1: + dependencies: + to-regex-range: 5.0.1 + + get-east-asian-width@1.7.0: {} + + iconv-lite@0.7.3: + dependencies: + safer-buffer: 2.1.2 + + is-docker@3.0.0: {} + + is-in-ssh@1.0.0: {} + + is-inside-container@1.0.0: + dependencies: + is-docker: 3.0.0 + + is-interactive@2.0.0: {} + + is-number@7.0.0: {} + + is-unicode-supported@2.1.0: {} + + is-wsl@3.1.1: + dependencies: + is-inside-container: 1.0.0 + + json-schema-traverse@1.0.0: {} + + jsonc-parser@3.3.1: {} + + konva@10.9.1: {} + + libphonenumber-js@1.13.16: {} + + log-symbols@7.0.1: + dependencies: + is-unicode-supported: 2.1.0 + yoctocolors: 2.2.0 + + magic-string@1.4.1: + dependencies: + '@jridgewell/sourcemap-codec': 1.6.0 + + micromatch@4.0.8: + dependencies: + braces: 3.0.3 + picomatch: 2.3.2 + + mimic-function@5.0.1: {} + + minipass@7.1.3: {} + + minizlib@3.1.0: + dependencies: + minipass: 7.1.3 + + mute-stream@4.0.0: {} + + node-emoji@2.2.0: + dependencies: + '@sindresorhus/is': 4.6.0 + char-regex: 1.0.2 + emojilib: 2.4.0 + skin-tone: 2.0.0 + + onetime@7.0.0: + dependencies: + mimic-function: 5.0.1 + + open@11.0.4: + dependencies: + default-browser: 5.5.1 + define-lazy-prop: 3.0.0 + is-in-ssh: 1.0.0 + is-inside-container: 1.0.0 + powershell-utils: 0.2.1 + wsl-utils: 1.0.1 + + ora@9.4.1: + dependencies: + chalk: 5.6.2 + cli-cursor: 5.0.0 + cli-spinners: 3.4.0 + is-interactive: 2.0.0 + is-unicode-supported: 2.1.0 + log-symbols: 7.0.1 + stdin-discarder: 0.3.2 + string-width: 8.3.0 + + picomatch@2.3.2: {} + + picomatch@4.0.7: {} + + powershell-utils@0.2.1: {} + + rc9@3.1.0: + dependencies: + defu: 6.1.7 + destr: 2.0.5 + + readdirp@5.1.1: {} + + require-from-string@2.0.2: {} + + restore-cursor@5.1.0: + dependencies: + onetime: 7.0.0 + signal-exit: 4.1.0 + + rolldown@1.3.2: + dependencies: + '@oxc-project/types': 0.158.0 + '@rolldown/pluginutils': 1.1.0 + optionalDependencies: + '@rolldown/binding-android-arm-eabi': 1.3.2 + '@rolldown/binding-android-arm64': 1.3.2 + '@rolldown/binding-darwin-arm64': 1.3.2 + '@rolldown/binding-darwin-x64': 1.3.2 + '@rolldown/binding-freebsd-x64': 1.3.2 + '@rolldown/binding-linux-arm-gnueabihf': 1.3.2 + '@rolldown/binding-linux-arm64-gnu': 1.3.2 + '@rolldown/binding-linux-arm64-musl': 1.3.2 + '@rolldown/binding-linux-ppc64-gnu': 1.3.2 + '@rolldown/binding-linux-s390x-gnu': 1.3.2 + '@rolldown/binding-linux-x64-gnu': 1.3.2 + '@rolldown/binding-linux-x64-musl': 1.3.2 + '@rolldown/binding-openharmony-arm64': 1.3.2 + '@rolldown/binding-wasm32-wasi': 1.3.2 + '@rolldown/binding-win32-arm64-msvc': 1.3.2 + '@rolldown/binding-win32-x64-msvc': 1.3.2 + + run-applescript@7.1.0: {} + + rxjs@7.8.2: + dependencies: + tslib: 2.9.1 + + safer-buffer@2.1.2: {} + + semver@7.8.6: {} + + signal-exit@4.1.0: {} + + skin-tone@2.0.0: + dependencies: + unicode-emoji-modifier-base: 1.0.0 + + source-map@0.8.0: {} + + stdin-discarder@0.3.2: {} + + string-width@8.3.0: + dependencies: + get-east-asian-width: 1.7.0 + strip-ansi: 7.2.0 + + strip-ansi@7.2.0: + dependencies: + ansi-regex: 6.6.0 + + tar@7.5.23: + dependencies: + '@isaacs/fs-minipass': 4.0.1 + chownr: 3.0.0 + minipass: 7.1.3 + minizlib: 3.1.0 + yallist: 5.0.0 + + to-regex-range@5.0.1: + dependencies: + is-number: 7.0.0 + + tslib@2.9.1: {} + + typescript@6.0.3: {} + + unicode-emoji-modifier-base@1.0.0: {} + + unrun@0.3.1: + dependencies: + rolldown: 1.3.2 + + validator@13.15.35: {} + + wsl-utils@1.0.1: + dependencies: + is-wsl: 3.1.1 + powershell-utils: 0.2.1 + + yallist@5.0.0: {} + + yoctocolors@2.2.0: {} + + zod@4.6.7: {} diff --git a/basics/music/pnpm-workspace.yaml b/basics/music/pnpm-workspace.yaml new file mode 100644 index 0000000..96ca535 --- /dev/null +++ b/basics/music/pnpm-workspace.yaml @@ -0,0 +1,5 @@ +allowBuilds: + bun: true +# NanoForge packages are ours: take a release as soon as it is out. +minimumReleaseAgeExclude: + - "@nanoforge-dev/*" diff --git a/basics/music/src/components/drawable-circle-2d.component.ts b/basics/music/src/components/drawable-circle-2d.component.ts new file mode 100644 index 0000000..1066155 --- /dev/null +++ b/basics/music/src/components/drawable-circle-2d.component.ts @@ -0,0 +1,62 @@ +import type { AssetContext } from "@nanoforge-dev/common"; +import { Circle, type Layer } from "@nanoforge-dev/graphics-2d"; +import type { Position2D } from "./position-2d.component"; + +import { imageFill } from "../image-fill"; + +/** + * Draws a circle at the entity's `Position2D` (its center). Needs the `draw2D` system. + * + * @remarks + * `shape` is the Konva `Circle` on screen: change it from code for anything the parameters don't + * offer (shadows, strokes...). + * + * @component + * @side client + * @group Shape color=#e86fb0 - Size of the circle. + * @group Look color=#b18cff - What the circle looks like. + * @group Advanced hidden - Less common settings. + */ +export class DrawableCircle2D { + name = "DrawableCircle2D"; + + /** The circle on screen, made by `draw2D` the first time it draws it. */ + shape?: Circle; + + constructor( + /** In pixels. @group Shape */ + public radius = 25, + /** A CSS color: `red`, `#ff0000`, `rgba(255, 0, 0, 0.5)`... @group Look @preset color */ + public fillColor = "#4aa3ff", + /** An image stretched over the circle, shown instead of the color. @group Look @asset .png .jpg .jpeg .gif .webp .svg */ + public image = "", + /** From 0 (invisible) to 1 (opaque). @group Look */ + public opacity = 1, + /** Clockwise, in degrees, around the center. @group Advanced */ + public rotation = 0, + /** Whether it is drawn. @group Advanced */ + public visible = true, + ) {} + + /** Puts the circle on `layer` at `position`, up to date with the parameters. */ + draw(layer: Layer, position: Position2D, assets: AssetContext): void { + this.shape ??= new Circle(); + if (this.shape.getParent() !== layer) layer.add(this.shape); + this.shape.setAttrs({ + x: position.x, + y: position.y, + radius: this.radius, + fill: this.fillColor, + opacity: this.opacity, + rotation: this.rotation, + visible: this.visible, + ...imageFill(assets, this.image, this.radius * 2, this.radius * 2, true), + }); + } + + /** Removes the circle from the screen. */ + destroy(): void { + this.shape?.destroy(); + this.shape = undefined; + } +} diff --git a/basics/music/src/components/drawable-rect-2d.component.ts b/basics/music/src/components/drawable-rect-2d.component.ts new file mode 100644 index 0000000..d3586ca --- /dev/null +++ b/basics/music/src/components/drawable-rect-2d.component.ts @@ -0,0 +1,69 @@ +import type { AssetContext } from "@nanoforge-dev/common"; +import { type Layer, Rect } from "@nanoforge-dev/graphics-2d"; +import type { Position2D } from "./position-2d.component"; + +import { imageFill } from "../image-fill"; + +/** + * Draws a rectangle at the entity's `Position2D` (its top-left corner). Needs the `draw2D` + * system. + * + * @remarks + * `shape` is the Konva `Rect` on screen: change it from code for anything the parameters don't + * offer (shadows, strokes...). + * + * @component + * @side client + * @group Shape color=#e86fb0 - Size of the rectangle. + * @group Look color=#b18cff - What the rectangle looks like. + * @group Advanced hidden - Less common settings. + */ +export class DrawableRect2D { + name = "DrawableRect2D"; + + /** The rectangle on screen, made by `draw2D` the first time it draws it. */ + shape?: Rect; + + constructor( + /** In pixels. @group Shape @preset size.width */ + public width = 50, + /** In pixels. @group Shape @preset size.height */ + public height = 50, + /** A CSS color: `red`, `#ff0000`, `rgba(255, 0, 0, 0.5)`... @group Look @preset color */ + public fillColor = "#4aa3ff", + /** An image stretched over the rectangle, shown instead of the color. @group Look @asset .png .jpg .jpeg .gif .webp .svg */ + public image = "", + /** From 0 (invisible) to 1 (opaque). @group Look */ + public opacity = 1, + /** Clockwise, in degrees, around the top-left corner. @group Advanced */ + public rotation = 0, + /** Rounds the corners, in pixels. @group Advanced */ + public cornerRadius = 0, + /** Whether it is drawn. @group Advanced */ + public visible = true, + ) {} + + /** Puts the rectangle on `layer` at `position`, up to date with the parameters. */ + draw(layer: Layer, position: Position2D, assets: AssetContext): void { + this.shape ??= new Rect(); + if (this.shape.getParent() !== layer) layer.add(this.shape); + this.shape.setAttrs({ + x: position.x, + y: position.y, + width: this.width, + height: this.height, + fill: this.fillColor, + opacity: this.opacity, + rotation: this.rotation, + cornerRadius: this.cornerRadius, + visible: this.visible, + ...imageFill(assets, this.image, this.width, this.height), + }); + } + + /** Removes the rectangle from the screen. */ + destroy(): void { + this.shape?.destroy(); + this.shape = undefined; + } +} diff --git a/basics/music/src/components/drawable-text-2d.component.ts b/basics/music/src/components/drawable-text-2d.component.ts new file mode 100644 index 0000000..adba963 --- /dev/null +++ b/basics/music/src/components/drawable-text-2d.component.ts @@ -0,0 +1,62 @@ +import { type Layer, Text } from "@nanoforge-dev/graphics-2d"; +import type { Position2D } from "./position-2d.component"; + +/** + * Draws a text at the entity's `Position2D` (its top-left corner). Needs the `draw2D` system. + * + * @remarks + * Change `text` from a system to show a score, a timer... `shape` is the Konva `Text` on screen: + * change it from code for anything the parameters don't offer. + * + * @component + * @side client + * @group Text color=#e86fb0 - What is written. + * @group Look color=#b18cff - What the text looks like. + * @group Advanced hidden - Less common settings. + */ +export class DrawableText2D { + name = "DrawableText2D"; + + /** The text on screen, made by `draw2D` the first time it draws it. */ + shape?: Text; + + constructor( + /** What is written. @group Text */ + public text = "Hello", + /** Height of the letters, in pixels. @group Text */ + public fontSize = 24, + /** A CSS color: `white`, `#ffffff`... @group Look @preset color */ + public fillColor = "#ffffff", + /** From 0 (invisible) to 1 (opaque). @group Look */ + public opacity = 1, + /** A CSS font family: `Arial`, `monospace`... @group Advanced */ + public fontFamily = "Arial", + /** Clockwise, in degrees, around the top-left corner. @group Advanced */ + public rotation = 0, + /** Whether it is drawn. @group Advanced */ + public visible = true, + ) {} + + /** Puts the text on `layer` at `position`, up to date with the parameters. */ + draw(layer: Layer, position: Position2D): void { + this.shape ??= new Text(); + if (this.shape.getParent() !== layer) layer.add(this.shape); + this.shape.setAttrs({ + x: position.x, + y: position.y, + text: this.text, + fontSize: this.fontSize, + fontFamily: this.fontFamily, + fill: this.fillColor, + opacity: this.opacity, + rotation: this.rotation, + visible: this.visible, + }); + } + + /** Removes the text from the screen. */ + destroy(): void { + this.shape?.destroy(); + this.shape = undefined; + } +} diff --git a/basics/music/src/components/mute-on-key.component.ts b/basics/music/src/components/mute-on-key.component.ts new file mode 100644 index 0000000..fd52cc6 --- /dev/null +++ b/basics/music/src/components/mute-on-key.component.ts @@ -0,0 +1,23 @@ +import { InputEnum } from "@nanoforge-dev/input"; + +/** + * Turns the audio on and off with a key, and writes whether it is on in the entity's + * `DrawableText2D`. Needs the system of the library it mutes: `muteSoundOnKey` or + * `muteMusicOnKey`. + * + * @component + * @side client + */ +export class MuteOnKey { + name = "MuteOnKey"; + + /** Whether the audio is off; the sound and music libraries start muted. Set by the system. */ + muted = true; + /** Whether the key was down last frame, set by the system. */ + held = false; + + constructor( + /** The key that turns the audio on and off. */ + public key: InputEnum = InputEnum.KeyM, + ) {} +} diff --git a/basics/music/src/components/play-on-key.component.ts b/basics/music/src/components/play-on-key.component.ts new file mode 100644 index 0000000..9f7298d --- /dev/null +++ b/basics/music/src/components/play-on-key.component.ts @@ -0,0 +1,29 @@ +import { InputEnum } from "@nanoforge-dev/input"; + +/** + * Plays an audio asset each time a key is pressed. Needs the system of the library that plays it: + * `playSoundOnKey` (the sound library: effects that may overlap) or `playMusicOnKey` (the music + * library: one track at a time). + * + * @remarks + * Both libraries start muted: add a `MuteOnKey` to let the player turn them on. + * + * @component + * @side client + * @group Audio color=#f0a33a - What is played, and when. + */ +export class PlayOnKey { + name = "PlayOnKey"; + + /** Whether the key was down last frame, set by the system. */ + held = false; + /** Whether `file` was handed to the library, or is not an asset. Set by the system. */ + status?: "loaded" | "missing"; + + constructor( + /** The key that plays it. @group Audio */ + public key: InputEnum = InputEnum.Space, + /** The audio file. @group Audio @asset .wav .mp3 .ogg */ + public file = "", + ) {} +} diff --git a/basics/music/src/components/position-2d.component.ts b/basics/music/src/components/position-2d.component.ts new file mode 100644 index 0000000..0a35624 --- /dev/null +++ b/basics/music/src/components/position-2d.component.ts @@ -0,0 +1,20 @@ +/** + * Where an entity is, in pixels from the top-left corner of the screen. + * + * @remarks + * For rectangles it is their top-left corner, for circles their center. + * + * @component + * @side shared + * @group Position color=#4aa3ff - Pixels from the top-left corner of the screen. + */ +export class Position2D { + name = "Position2D"; + + constructor( + /** Pixels from the left edge. @group Position @preset vector.x */ + public x = 0, + /** Pixels from the top edge. @group Position @preset vector.y */ + public y = 0, + ) {} +} diff --git a/basics/music/src/image-fill.ts b/basics/music/src/image-fill.ts new file mode 100644 index 0000000..c7fc737 --- /dev/null +++ b/basics/music/src/image-fill.ts @@ -0,0 +1,43 @@ +import type { AssetContext } from "@nanoforge-dev/common"; +import type { ShapeConfig } from "@nanoforge-dev/graphics-2d"; + +const images = new Map(); + +/** + * The fill of a shape of `width` by `height` pixels showing the image at `path` (an asset path + * such as `/textures/hero.png`, found in `assets`) stretched over it. Without an image, until it + * is loaded, or when there is no asset at `path`, the shape is filled with its color. + * + * @param centered - Whether the shape's origin is its center (a circle) instead of its top-left + * corner (a rectangle). + */ +export const imageFill = ( + assets: AssetContext, + path: string, + width: number, + height: number, + centered = false, +): ShapeConfig => { + if (!path) return { fillPriority: "color", fillPatternImage: undefined }; + let image = images.get(path); + if (!image) { + image = document.createElement("img"); + try { + image.src = assets.getAsset(path).path; + } catch (error) { + // Once per path, not every frame: the shape keeps its color. + console.warn(`No image at "${path}":`, error); + } + images.set(path, image); + } + if (!image.naturalWidth) return { fillPriority: "color", fillPatternImage: undefined }; + return { + fillPriority: "pattern", + fillPatternImage: image, + fillPatternRepeat: "no-repeat", + fillPatternScaleX: width / image.naturalWidth, + fillPatternScaleY: height / image.naturalHeight, + fillPatternOffsetX: centered ? image.naturalWidth / 2 : 0, + fillPatternOffsetY: centered ? image.naturalHeight / 2 : 0, + }; +}; diff --git a/basics/music/src/main.ts b/basics/music/src/main.ts new file mode 100644 index 0000000..3646b55 --- /dev/null +++ b/basics/music/src/main.ts @@ -0,0 +1,62 @@ +import type { ClientRunOptions } from "@nanoforge-dev/common"; +import { NanoforgeFactory } from "@nanoforge-dev/core"; +import { EcsLibrary } from "@nanoforge-dev/ecs/client"; +import { EditorLibrary } from "@nanoforge-dev/editor-lib"; +import { Graphics2DLibrary } from "@nanoforge-dev/graphics-2d"; +import { InputEnum, InputLibrary } from "@nanoforge-dev/input"; +import { MusicLibrary } from "@nanoforge-dev/music"; + +import { DrawableRect2D } from "./components/drawable-rect-2d.component"; +import { DrawableText2D } from "./components/drawable-text-2d.component"; +import { Position2D } from "./components/position-2d.component"; +import { MuteOnKey } from "./components/mute-on-key.component"; +import { PlayOnKey } from "./components/play-on-key.component"; +import { draw2D } from "./systems/draw-2d.system"; +import { muteMusicOnKey } from "./systems/mute-music-on-key.system"; +import { playMusicOnKey } from "./systems/play-music-on-key.system"; + +export const main = async (options: ClientRunOptions): Promise => { + const app = NanoforgeFactory.createClient({ + tickRate: 60, + viewport: { width: 800, height: 600, fit: "contain" }, + }); + const ecs = new EcsLibrary(); + + app.use(new Graphics2DLibrary()); + app.use(ecs); + app.use(new InputLibrary()); + app.use(new MusicLibrary()); + app.use(new EditorLibrary()); + + await app.init(options); + + const registry = ecs.registry; + + const background = registry.spawnEntity(); + registry.addComponent(background, new Position2D(0, 0)); + registry.addComponent(background, new DrawableRect2D(800, 600, "#1e1e2e")); + + const help = registry.spawnEntity(); + registry.addComponent(help, new Position2D(20, 20)); + registry.addComponent( + help, + new DrawableText2D("1: first track 2: second track", 24, "#cdd6f4"), + ); + + const mute = registry.spawnEntity(); + registry.addComponent(mute, new Position2D(20, 60)); + registry.addComponent(mute, new DrawableText2D("", 24, "#f9e2af")); + registry.addComponent(mute, new MuteOnKey(InputEnum.KeyM)); + + const first = registry.spawnEntity(); + registry.addComponent(first, new PlayOnKey(InputEnum.Digit1, "/track-a.wav")); + + const second = registry.spawnEntity(); + registry.addComponent(second, new PlayOnKey(InputEnum.Digit2, "/track-b.wav")); + + registry.addSystem(muteMusicOnKey); + registry.addSystem(playMusicOnKey); + registry.addSystem(draw2D); + + await app.run(); +}; diff --git a/basics/music/src/systems/draw-2d.system.ts b/basics/music/src/systems/draw-2d.system.ts new file mode 100644 index 0000000..937eeeb --- /dev/null +++ b/basics/music/src/systems/draw-2d.system.ts @@ -0,0 +1,45 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; +import "@nanoforge-dev/graphics-2d"; +import { Position2D } from "../components/position-2d.component"; + +import { DrawableCircle2D } from "../components/drawable-circle-2d.component"; +import { DrawableRect2D } from "../components/drawable-rect-2d.component"; +import { DrawableText2D } from "../components/drawable-text-2d.component"; + +type Drawable = DrawableRect2D | DrawableCircle2D | DrawableText2D; + +/** The drawables shown by the last frame. */ +let shown = new Set(); + +/** + * Draws every entity that has a `Position2D` and a `DrawableRect2D`, `DrawableCircle2D` or + * `DrawableText2D`, where it is. Add it last, after the systems that move entities. + * + * @remarks + * The shape of a killed entity, or of a removed drawable, is removed from the screen. + * + * @system + * @side client + */ +export const draw2D = (registry: Registry, ctx: Context) => { + const layer = ctx.graphics.baseLayer; + const drawn = new Set(); + + registry.getZipper([DrawableRect2D, Position2D]).forEach(({ DrawableRect2D, Position2D }) => { + DrawableRect2D.draw(layer, Position2D, ctx.assets); + drawn.add(DrawableRect2D); + }); + registry.getZipper([DrawableCircle2D, Position2D]).forEach(({ DrawableCircle2D, Position2D }) => { + DrawableCircle2D.draw(layer, Position2D, ctx.assets); + drawn.add(DrawableCircle2D); + }); + registry.getZipper([DrawableText2D, Position2D]).forEach(({ DrawableText2D, Position2D }) => { + DrawableText2D.draw(layer, Position2D); + drawn.add(DrawableText2D); + }); + + // `killEntity` doesn't call `destroy()`: a drawable no longer in the world loses its shape here. + for (const drawable of shown) if (!drawn.has(drawable)) drawable.destroy(); + shown = drawn; +}; diff --git a/basics/music/src/systems/mute-music-on-key.system.ts b/basics/music/src/systems/mute-music-on-key.system.ts new file mode 100644 index 0000000..b87c3eb --- /dev/null +++ b/basics/music/src/systems/mute-music-on-key.system.ts @@ -0,0 +1,26 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; +import "@nanoforge-dev/input"; +import "@nanoforge-dev/music"; +import { DrawableText2D } from "../components/drawable-text-2d.component"; + +import { MuteOnKey } from "../components/mute-on-key.component"; + +/** + * Turns the music on or off when the key of a `MuteOnKey` is pressed, and writes the state in + * its entity's text. + * + * @system + * @side client + */ +export const muteMusicOnKey = (registry: Registry, ctx: Context) => { + registry.getZipper([MuteOnKey, DrawableText2D]).forEach(({ MuteOnKey, DrawableText2D }) => { + const down = ctx.input.isKeyPressed((MuteOnKey as MuteOnKey).key) === true; + if (down && !MuteOnKey.held) { + ctx.music.mute(); + MuteOnKey.muted = !MuteOnKey.muted; + } + MuteOnKey.held = down; + DrawableText2D.text = MuteOnKey.muted ? "Music off: press M" : "Music on: press M to mute"; + }); +}; diff --git a/basics/music/src/systems/play-music-on-key.system.ts b/basics/music/src/systems/play-music-on-key.system.ts new file mode 100644 index 0000000..89fc6e3 --- /dev/null +++ b/basics/music/src/systems/play-music-on-key.system.ts @@ -0,0 +1,32 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; +import "@nanoforge-dev/input"; +import "@nanoforge-dev/music"; +import { PlayOnKey } from "../components/play-on-key.component"; + +/** + * Plays the track of the `PlayOnKey` whose key was just pressed: the music library stops the + * track playing. Loads each track into the music library, under its asset path, the first time + * it sees it; a missing asset is reported once. + * + * @system + * @side client + */ +export const playMusicOnKey = (registry: Registry, ctx: Context) => { + registry.getZipper([PlayOnKey]).forEach(({ PlayOnKey }) => { + const { key, file } = PlayOnKey as PlayOnKey; + if (!PlayOnKey.status && file) { + try { + ctx.music.load(file, ctx.assets.getAsset(file).path); + PlayOnKey.status = "loaded"; + } catch (error) { + // Once per component, not every frame: the key stays silent. + console.warn(`No track at "${file}":`, error); + PlayOnKey.status = "missing"; + } + } + const down = ctx.input.isKeyPressed(key) === true; + if (down && !PlayOnKey.held && PlayOnKey.status === "loaded") ctx.music.play(file); + PlayOnKey.held = down; + }); +}; diff --git a/basics/music/tsconfig.json b/basics/music/tsconfig.json new file mode 100644 index 0000000..c0ae4f2 --- /dev/null +++ b/basics/music/tsconfig.json @@ -0,0 +1,39 @@ +{ + "$schema": "https://json.schemastore.org/tsconfig.json", + // Mapped from https://www.typescriptlang.org/tsconfig + "compilerOptions": { + // Type Checking + "allowUnreachableCode": false, + "allowUnusedLabels": false, + "noFallthroughCasesInSwitch": true, + "noImplicitOverride": true, + "noImplicitReturns": true, + "noPropertyAccessFromIndexSignature": false, + "noUncheckedIndexedAccess": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "strict": true, + + // Modules + "allowArbitraryExtensions": false, + "allowImportingTsExtensions": false, + "module": "ESNext", + "moduleResolution": "Bundler", + "resolveJsonModule": true, + "resolvePackageJsonExports": true, + "resolvePackageJsonImports": true, + + // Interop Constraints + "allowSyntheticDefaultImports": true, + "forceConsistentCasingInFileNames": true, + "isolatedModules": true, + + // Language and Environment + "experimentalDecorators": true, + "lib": ["ESNext", "esnext.disposable", "DOM"], + "target": "ESNext", + "useDefineForClassFields": true + }, + "include": ["src"], + "exclude": ["node_modules", ".nanoforge", "dist"] +} diff --git a/basics/network/.env.example b/basics/network/.env.example new file mode 100644 index 0000000..18de8ee --- /dev/null +++ b/basics/network/.env.example @@ -0,0 +1,8 @@ +# Copy to .env: `nf start` and `nf dev` read it. Ports of the game server, as the client reaches +# it (CLIENT_) and as the server listens (SERVER_). +NANOFORGE_CLIENT_SERVER_TCP_PORT=4444 +NANOFORGE_CLIENT_SERVER_UDP_PORT=4445 +NANOFORGE_CLIENT_SERVER_ADDRESS=127.0.0.1 + +NANOFORGE_SERVER_LISTENING_TCP_PORT=4444 +NANOFORGE_SERVER_LISTENING_UDP_PORT=4445 diff --git a/basics/network/.gitignore b/basics/network/.gitignore new file mode 100644 index 0000000..f28e2dc --- /dev/null +++ b/basics/network/.gitignore @@ -0,0 +1,5 @@ +node_modules/ +dist/ +.nanoforge/ +nf_modules/ +.env diff --git a/basics/network/README.md b/basics/network/README.md new file mode 100644 index 0000000..1efba27 --- /dev/null +++ b/basics/network/README.md @@ -0,0 +1,30 @@ +# network + +Every player is a square on a game server: the arrows move yours (green), and the others' squares +(red) move as their players move them. Open the game in two tabs to see it. + +It shows the `network` engine library, with a server that owns the game: + +- the client only sends where its player wants to go (`Move`, a direction per axis), when its + keys change (`sendMoves`); +- the server spawns a player for each client that sends `Join` and removes it when the client + leaves (`joinPlayers`), turns the directions into speeds (`steerPlayers`), moves the players + (`move2D`), keeps them in the arena (`keepInArena`) and sends every position to every client, + each tick (`sendPlayers`); +- the client draws the players the server sent (`showPlayers`). + +The packets are declared once with `definePacket`, in the shared library `libs/protocol`, which +both apps import as `@network/protocol/messages` (the root `tsconfig.json` maps it). `Move`'s +`validate` drops anything but two directions: the server never trusts a client. + +```sh +pnpm install +cp .env.example .env # the server's address and ports +pnpm dev # play it: open the client's url in two tabs +pnpm editor # open it in the editor +``` + +`apps/client` and `apps/server` each hold copies of the `shared/2d` files they use (see the +repository's README): `Position2D` in both; `Velocity2D`, `Acceleration2D` and `move2D` on the +server; `image-fill.ts`, `DrawableRect2D`, `DrawableCircle2D`, `DrawableText2D` and `draw2D` on +the client. diff --git a/basics/network/apps/client/assets/.gitkeep b/basics/network/apps/client/assets/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/basics/network/apps/client/nanoforge.config.ts b/basics/network/apps/client/nanoforge.config.ts new file mode 100644 index 0000000..77607cb --- /dev/null +++ b/basics/network/apps/client/nanoforge.config.ts @@ -0,0 +1,5 @@ +import { defineConfig } from "@nanoforge-dev/config"; + +export default defineConfig({ + type: "client", +}); diff --git a/basics/network/apps/client/package.json b/basics/network/apps/client/package.json new file mode 100644 index 0000000..57f92c8 --- /dev/null +++ b/basics/network/apps/client/package.json @@ -0,0 +1,19 @@ +{ + "$schema": "https://json.schemastore.org/package.json", + "name": "network-client", + "private": true, + "type": "module", + "devDependencies": { + "@nanoforge-dev/asset": "^3.0.0", + "@nanoforge-dev/common": "^3.0.0", + "@nanoforge-dev/core": "^3.0.0", + "@nanoforge-dev/ecs": "^3.0.0", + "@nanoforge-dev/editor-lib": "^3.0.0", + "@nanoforge-dev/env": "^3.0.0", + "@nanoforge-dev/graphics-2d": "^3.0.0", + "@nanoforge-dev/input": "^3.0.0", + "@nanoforge-dev/network": "^3.0.0", + "@network/protocol": "workspace:*", + "typescript": "^6.0.0" + } +} diff --git a/basics/network/apps/client/src/components/drawable-circle-2d.component.ts b/basics/network/apps/client/src/components/drawable-circle-2d.component.ts new file mode 100644 index 0000000..1066155 --- /dev/null +++ b/basics/network/apps/client/src/components/drawable-circle-2d.component.ts @@ -0,0 +1,62 @@ +import type { AssetContext } from "@nanoforge-dev/common"; +import { Circle, type Layer } from "@nanoforge-dev/graphics-2d"; +import type { Position2D } from "./position-2d.component"; + +import { imageFill } from "../image-fill"; + +/** + * Draws a circle at the entity's `Position2D` (its center). Needs the `draw2D` system. + * + * @remarks + * `shape` is the Konva `Circle` on screen: change it from code for anything the parameters don't + * offer (shadows, strokes...). + * + * @component + * @side client + * @group Shape color=#e86fb0 - Size of the circle. + * @group Look color=#b18cff - What the circle looks like. + * @group Advanced hidden - Less common settings. + */ +export class DrawableCircle2D { + name = "DrawableCircle2D"; + + /** The circle on screen, made by `draw2D` the first time it draws it. */ + shape?: Circle; + + constructor( + /** In pixels. @group Shape */ + public radius = 25, + /** A CSS color: `red`, `#ff0000`, `rgba(255, 0, 0, 0.5)`... @group Look @preset color */ + public fillColor = "#4aa3ff", + /** An image stretched over the circle, shown instead of the color. @group Look @asset .png .jpg .jpeg .gif .webp .svg */ + public image = "", + /** From 0 (invisible) to 1 (opaque). @group Look */ + public opacity = 1, + /** Clockwise, in degrees, around the center. @group Advanced */ + public rotation = 0, + /** Whether it is drawn. @group Advanced */ + public visible = true, + ) {} + + /** Puts the circle on `layer` at `position`, up to date with the parameters. */ + draw(layer: Layer, position: Position2D, assets: AssetContext): void { + this.shape ??= new Circle(); + if (this.shape.getParent() !== layer) layer.add(this.shape); + this.shape.setAttrs({ + x: position.x, + y: position.y, + radius: this.radius, + fill: this.fillColor, + opacity: this.opacity, + rotation: this.rotation, + visible: this.visible, + ...imageFill(assets, this.image, this.radius * 2, this.radius * 2, true), + }); + } + + /** Removes the circle from the screen. */ + destroy(): void { + this.shape?.destroy(); + this.shape = undefined; + } +} diff --git a/basics/network/apps/client/src/components/drawable-rect-2d.component.ts b/basics/network/apps/client/src/components/drawable-rect-2d.component.ts new file mode 100644 index 0000000..d3586ca --- /dev/null +++ b/basics/network/apps/client/src/components/drawable-rect-2d.component.ts @@ -0,0 +1,69 @@ +import type { AssetContext } from "@nanoforge-dev/common"; +import { type Layer, Rect } from "@nanoforge-dev/graphics-2d"; +import type { Position2D } from "./position-2d.component"; + +import { imageFill } from "../image-fill"; + +/** + * Draws a rectangle at the entity's `Position2D` (its top-left corner). Needs the `draw2D` + * system. + * + * @remarks + * `shape` is the Konva `Rect` on screen: change it from code for anything the parameters don't + * offer (shadows, strokes...). + * + * @component + * @side client + * @group Shape color=#e86fb0 - Size of the rectangle. + * @group Look color=#b18cff - What the rectangle looks like. + * @group Advanced hidden - Less common settings. + */ +export class DrawableRect2D { + name = "DrawableRect2D"; + + /** The rectangle on screen, made by `draw2D` the first time it draws it. */ + shape?: Rect; + + constructor( + /** In pixels. @group Shape @preset size.width */ + public width = 50, + /** In pixels. @group Shape @preset size.height */ + public height = 50, + /** A CSS color: `red`, `#ff0000`, `rgba(255, 0, 0, 0.5)`... @group Look @preset color */ + public fillColor = "#4aa3ff", + /** An image stretched over the rectangle, shown instead of the color. @group Look @asset .png .jpg .jpeg .gif .webp .svg */ + public image = "", + /** From 0 (invisible) to 1 (opaque). @group Look */ + public opacity = 1, + /** Clockwise, in degrees, around the top-left corner. @group Advanced */ + public rotation = 0, + /** Rounds the corners, in pixels. @group Advanced */ + public cornerRadius = 0, + /** Whether it is drawn. @group Advanced */ + public visible = true, + ) {} + + /** Puts the rectangle on `layer` at `position`, up to date with the parameters. */ + draw(layer: Layer, position: Position2D, assets: AssetContext): void { + this.shape ??= new Rect(); + if (this.shape.getParent() !== layer) layer.add(this.shape); + this.shape.setAttrs({ + x: position.x, + y: position.y, + width: this.width, + height: this.height, + fill: this.fillColor, + opacity: this.opacity, + rotation: this.rotation, + cornerRadius: this.cornerRadius, + visible: this.visible, + ...imageFill(assets, this.image, this.width, this.height), + }); + } + + /** Removes the rectangle from the screen. */ + destroy(): void { + this.shape?.destroy(); + this.shape = undefined; + } +} diff --git a/basics/network/apps/client/src/components/drawable-text-2d.component.ts b/basics/network/apps/client/src/components/drawable-text-2d.component.ts new file mode 100644 index 0000000..adba963 --- /dev/null +++ b/basics/network/apps/client/src/components/drawable-text-2d.component.ts @@ -0,0 +1,62 @@ +import { type Layer, Text } from "@nanoforge-dev/graphics-2d"; +import type { Position2D } from "./position-2d.component"; + +/** + * Draws a text at the entity's `Position2D` (its top-left corner). Needs the `draw2D` system. + * + * @remarks + * Change `text` from a system to show a score, a timer... `shape` is the Konva `Text` on screen: + * change it from code for anything the parameters don't offer. + * + * @component + * @side client + * @group Text color=#e86fb0 - What is written. + * @group Look color=#b18cff - What the text looks like. + * @group Advanced hidden - Less common settings. + */ +export class DrawableText2D { + name = "DrawableText2D"; + + /** The text on screen, made by `draw2D` the first time it draws it. */ + shape?: Text; + + constructor( + /** What is written. @group Text */ + public text = "Hello", + /** Height of the letters, in pixels. @group Text */ + public fontSize = 24, + /** A CSS color: `white`, `#ffffff`... @group Look @preset color */ + public fillColor = "#ffffff", + /** From 0 (invisible) to 1 (opaque). @group Look */ + public opacity = 1, + /** A CSS font family: `Arial`, `monospace`... @group Advanced */ + public fontFamily = "Arial", + /** Clockwise, in degrees, around the top-left corner. @group Advanced */ + public rotation = 0, + /** Whether it is drawn. @group Advanced */ + public visible = true, + ) {} + + /** Puts the text on `layer` at `position`, up to date with the parameters. */ + draw(layer: Layer, position: Position2D): void { + this.shape ??= new Text(); + if (this.shape.getParent() !== layer) layer.add(this.shape); + this.shape.setAttrs({ + x: position.x, + y: position.y, + text: this.text, + fontSize: this.fontSize, + fontFamily: this.fontFamily, + fill: this.fillColor, + opacity: this.opacity, + rotation: this.rotation, + visible: this.visible, + }); + } + + /** Removes the text from the screen. */ + destroy(): void { + this.shape?.destroy(); + this.shape = undefined; + } +} diff --git a/basics/network/apps/client/src/components/move-sender.component.ts b/basics/network/apps/client/src/components/move-sender.component.ts new file mode 100644 index 0000000..3faebe8 --- /dev/null +++ b/basics/network/apps/client/src/components/move-sender.component.ts @@ -0,0 +1,31 @@ +import { InputEnum } from "@nanoforge-dev/input"; + +/** + * Sends the server where the player wants to go, from the keys held down; the server moves the + * player. Needs the `sendMoves` system. + * + * @component + * @side client + * @group Keys color=#f0a33a - The keys that move the player. + */ +export class MoveSender { + name = "MoveSender"; + + /** Whether the client asked the server for a player, set by `sendMoves`. */ + joined = false; + /** The direction last sent, set by `sendMoves`. */ + sentX = 0; + /** The direction last sent, set by `sendMoves`. */ + sentY = 0; + + constructor( + /** @group Keys */ + public left: InputEnum = InputEnum.ArrowLeft, + /** @group Keys */ + public right: InputEnum = InputEnum.ArrowRight, + /** @group Keys */ + public up: InputEnum = InputEnum.ArrowUp, + /** @group Keys */ + public down: InputEnum = InputEnum.ArrowDown, + ) {} +} diff --git a/basics/network/apps/client/src/components/network-player.component.ts b/basics/network/apps/client/src/components/network-player.component.ts new file mode 100644 index 0000000..7398b9f --- /dev/null +++ b/basics/network/apps/client/src/components/network-player.component.ts @@ -0,0 +1,15 @@ +/** + * A player as the server last sent it. The `showPlayers` system spawns, moves and kills these + * entities. + * + * @component + * @side client + */ +export class NetworkPlayer { + name = "NetworkPlayer"; + + constructor( + /** The client that moves it, as the server names it. */ + public clientId = "", + ) {} +} diff --git a/basics/network/apps/client/src/components/position-2d.component.ts b/basics/network/apps/client/src/components/position-2d.component.ts new file mode 100644 index 0000000..0a35624 --- /dev/null +++ b/basics/network/apps/client/src/components/position-2d.component.ts @@ -0,0 +1,20 @@ +/** + * Where an entity is, in pixels from the top-left corner of the screen. + * + * @remarks + * For rectangles it is their top-left corner, for circles their center. + * + * @component + * @side shared + * @group Position color=#4aa3ff - Pixels from the top-left corner of the screen. + */ +export class Position2D { + name = "Position2D"; + + constructor( + /** Pixels from the left edge. @group Position @preset vector.x */ + public x = 0, + /** Pixels from the top edge. @group Position @preset vector.y */ + public y = 0, + ) {} +} diff --git a/basics/network/apps/client/src/image-fill.ts b/basics/network/apps/client/src/image-fill.ts new file mode 100644 index 0000000..c7fc737 --- /dev/null +++ b/basics/network/apps/client/src/image-fill.ts @@ -0,0 +1,43 @@ +import type { AssetContext } from "@nanoforge-dev/common"; +import type { ShapeConfig } from "@nanoforge-dev/graphics-2d"; + +const images = new Map(); + +/** + * The fill of a shape of `width` by `height` pixels showing the image at `path` (an asset path + * such as `/textures/hero.png`, found in `assets`) stretched over it. Without an image, until it + * is loaded, or when there is no asset at `path`, the shape is filled with its color. + * + * @param centered - Whether the shape's origin is its center (a circle) instead of its top-left + * corner (a rectangle). + */ +export const imageFill = ( + assets: AssetContext, + path: string, + width: number, + height: number, + centered = false, +): ShapeConfig => { + if (!path) return { fillPriority: "color", fillPatternImage: undefined }; + let image = images.get(path); + if (!image) { + image = document.createElement("img"); + try { + image.src = assets.getAsset(path).path; + } catch (error) { + // Once per path, not every frame: the shape keeps its color. + console.warn(`No image at "${path}":`, error); + } + images.set(path, image); + } + if (!image.naturalWidth) return { fillPriority: "color", fillPatternImage: undefined }; + return { + fillPriority: "pattern", + fillPatternImage: image, + fillPatternRepeat: "no-repeat", + fillPatternScaleX: width / image.naturalWidth, + fillPatternScaleY: height / image.naturalHeight, + fillPatternOffsetX: centered ? image.naturalWidth / 2 : 0, + fillPatternOffsetY: centered ? image.naturalHeight / 2 : 0, + }; +}; diff --git a/basics/network/apps/client/src/main.ts b/basics/network/apps/client/src/main.ts new file mode 100644 index 0000000..c412ecb --- /dev/null +++ b/basics/network/apps/client/src/main.ts @@ -0,0 +1,59 @@ +import type { ClientRunOptions } from "@nanoforge-dev/common"; +import { NanoforgeFactory } from "@nanoforge-dev/core"; +import { EcsLibrary } from "@nanoforge-dev/ecs/client"; +import { EditorLibrary } from "@nanoforge-dev/editor-lib"; +import { Graphics2DLibrary } from "@nanoforge-dev/graphics-2d"; +import { InputEnum, InputLibrary } from "@nanoforge-dev/input"; +import { NetworkClientLibrary } from "@nanoforge-dev/network/client"; + +import { DrawableRect2D } from "./components/drawable-rect-2d.component"; +import { DrawableText2D } from "./components/drawable-text-2d.component"; +import { MoveSender } from "./components/move-sender.component"; +import { Position2D } from "./components/position-2d.component"; +import { draw2D } from "./systems/draw-2d.system"; +import { sendMoves } from "./systems/send-moves.system"; +import { showPlayers } from "./systems/show-players.system"; + +export const main = async (options: ClientRunOptions): Promise => { + const app = NanoforgeFactory.createClient({ + tickRate: 60, + viewport: { width: 800, height: 600, fit: "contain" }, + }); + const ecs = new EcsLibrary(); + + app.use(new Graphics2DLibrary()); + app.use(ecs); + app.use(new InputLibrary()); + app.use(new NetworkClientLibrary()); + app.use(new EditorLibrary()); + + await app.init(options); + + const registry = ecs.registry; + + const background = registry.spawnEntity(); + registry.addComponent(background, new Position2D(0, 0)); + registry.addComponent(background, new DrawableRect2D(800, 600, "#1e1e2e")); + + const help = registry.spawnEntity(); + registry.addComponent(help, new Position2D(20, 20)); + registry.addComponent( + help, + new DrawableText2D("Arrows to move. Open a second tab: you are green", 22, "#cdd6f4"), + ); + registry.addComponent( + help, + new MoveSender( + InputEnum.ArrowLeft, + InputEnum.ArrowRight, + InputEnum.ArrowUp, + InputEnum.ArrowDown, + ), + ); + + registry.addSystem(sendMoves); + registry.addSystem(showPlayers); + registry.addSystem(draw2D); + + await app.run(); +}; diff --git a/basics/network/apps/client/src/systems/draw-2d.system.ts b/basics/network/apps/client/src/systems/draw-2d.system.ts new file mode 100644 index 0000000..937eeeb --- /dev/null +++ b/basics/network/apps/client/src/systems/draw-2d.system.ts @@ -0,0 +1,45 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; +import "@nanoforge-dev/graphics-2d"; +import { Position2D } from "../components/position-2d.component"; + +import { DrawableCircle2D } from "../components/drawable-circle-2d.component"; +import { DrawableRect2D } from "../components/drawable-rect-2d.component"; +import { DrawableText2D } from "../components/drawable-text-2d.component"; + +type Drawable = DrawableRect2D | DrawableCircle2D | DrawableText2D; + +/** The drawables shown by the last frame. */ +let shown = new Set(); + +/** + * Draws every entity that has a `Position2D` and a `DrawableRect2D`, `DrawableCircle2D` or + * `DrawableText2D`, where it is. Add it last, after the systems that move entities. + * + * @remarks + * The shape of a killed entity, or of a removed drawable, is removed from the screen. + * + * @system + * @side client + */ +export const draw2D = (registry: Registry, ctx: Context) => { + const layer = ctx.graphics.baseLayer; + const drawn = new Set(); + + registry.getZipper([DrawableRect2D, Position2D]).forEach(({ DrawableRect2D, Position2D }) => { + DrawableRect2D.draw(layer, Position2D, ctx.assets); + drawn.add(DrawableRect2D); + }); + registry.getZipper([DrawableCircle2D, Position2D]).forEach(({ DrawableCircle2D, Position2D }) => { + DrawableCircle2D.draw(layer, Position2D, ctx.assets); + drawn.add(DrawableCircle2D); + }); + registry.getZipper([DrawableText2D, Position2D]).forEach(({ DrawableText2D, Position2D }) => { + DrawableText2D.draw(layer, Position2D); + drawn.add(DrawableText2D); + }); + + // `killEntity` doesn't call `destroy()`: a drawable no longer in the world loses its shape here. + for (const drawable of shown) if (!drawn.has(drawable)) drawable.destroy(); + shown = drawn; +}; diff --git a/basics/network/apps/client/src/systems/send-moves.system.ts b/basics/network/apps/client/src/systems/send-moves.system.ts new file mode 100644 index 0000000..a9d2ef9 --- /dev/null +++ b/basics/network/apps/client/src/systems/send-moves.system.ts @@ -0,0 +1,32 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; +import "@nanoforge-dev/input"; +import "@nanoforge-dev/network/client"; +import { Join, Move } from "@network/protocol/messages"; + +import { MoveSender } from "../components/move-sender.component"; + +/** + * Asks the server for a player once, then sends it the direction of the keys of `MoveSender` + * each time it changes. + * + * @system + * @side client + */ +export const sendMoves = (registry: Registry, ctx: Context) => { + const held = (key: MoveSender["left"]) => Number(ctx.input.isKeyPressed(key) === true); + + registry.getZipper([MoveSender]).forEach(({ MoveSender }) => { + if (!MoveSender.joined) { + ctx.network.packets.send(Join); + MoveSender.joined = true; + } + const { left, right, up, down } = MoveSender as MoveSender; + const x = (held(right) - held(left)) as -1 | 0 | 1; + const y = (held(down) - held(up)) as -1 | 0 | 1; + if (x === MoveSender.sentX && y === MoveSender.sentY) return; + ctx.network.packets.send(Move, { x, y }); + MoveSender.sentX = x; + MoveSender.sentY = y; + }); +}; diff --git a/basics/network/apps/client/src/systems/show-players.system.ts b/basics/network/apps/client/src/systems/show-players.system.ts new file mode 100644 index 0000000..6b67509 --- /dev/null +++ b/basics/network/apps/client/src/systems/show-players.system.ts @@ -0,0 +1,40 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; +import "@nanoforge-dev/network/client"; +import { PLAYER_SIZE, Players } from "@network/protocol/messages"; +import { DrawableRect2D } from "../components/drawable-rect-2d.component"; +import { Position2D } from "../components/position-2d.component"; + +import { NetworkPlayer } from "../components/network-player.component"; + +/** + * Shows the players the server sent last: moves their squares, spawns the squares of new players + * (green for this client's, red for the others) and kills those of the players that left. Add it + * before `draw2D`. + * + * @system + * @side client + */ +export const showPlayers = (registry: Registry, ctx: Context) => { + const players = ctx.network.packets.read(Players).at(-1)?.data; + if (!players) return; + + const shown = registry.getIndexedZipper([NetworkPlayer, Position2D]); + for (const { id: index, NetworkPlayer, Position2D } of shown) { + const player = players.find(({ id }) => id === NetworkPlayer.clientId); + if (!player) { + registry.killEntity(registry.entityFromIndex(index)); + continue; + } + Position2D.x = player.x; + Position2D.y = player.y; + } + for (const { id, x, y } of players) { + if (shown.some(({ NetworkPlayer }) => NetworkPlayer.clientId === id)) continue; + const color = id === ctx.network.clientId ? "#a6e3a1" : "#f38ba8"; + const player = registry.spawnEntity(); + registry.addComponent(player, new NetworkPlayer(id)); + registry.addComponent(player, new Position2D(x, y)); + registry.addComponent(player, new DrawableRect2D(PLAYER_SIZE, PLAYER_SIZE, color)); + } +}; diff --git a/basics/network/apps/client/tsconfig.json b/basics/network/apps/client/tsconfig.json new file mode 100644 index 0000000..9c06682 --- /dev/null +++ b/basics/network/apps/client/tsconfig.json @@ -0,0 +1,5 @@ +{ + "$schema": "https://json.schemastore.org/tsconfig.json", + "extends": "../../tsconfig.json", + "include": ["src"] +} diff --git a/basics/network/apps/server/assets/.gitkeep b/basics/network/apps/server/assets/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/basics/network/apps/server/nanoforge.config.ts b/basics/network/apps/server/nanoforge.config.ts new file mode 100644 index 0000000..43a3fef --- /dev/null +++ b/basics/network/apps/server/nanoforge.config.ts @@ -0,0 +1,5 @@ +import { defineConfig } from "@nanoforge-dev/config"; + +export default defineConfig({ + type: "server", +}); diff --git a/basics/network/apps/server/package.json b/basics/network/apps/server/package.json new file mode 100644 index 0000000..c5b76ff --- /dev/null +++ b/basics/network/apps/server/package.json @@ -0,0 +1,17 @@ +{ + "$schema": "https://json.schemastore.org/package.json", + "name": "network-server", + "private": true, + "type": "module", + "devDependencies": { + "@nanoforge-dev/asset": "^3.0.0", + "@nanoforge-dev/common": "^3.0.0", + "@nanoforge-dev/core": "^3.0.0", + "@nanoforge-dev/ecs": "^3.0.0", + "@nanoforge-dev/editor-lib": "^3.0.0", + "@nanoforge-dev/env": "^3.0.0", + "@nanoforge-dev/network": "^3.0.0", + "@network/protocol": "workspace:*", + "typescript": "^6.0.0" + } +} diff --git a/basics/network/apps/server/src/components/acceleration-2d.component.ts b/basics/network/apps/server/src/components/acceleration-2d.component.ts new file mode 100644 index 0000000..5d4097f --- /dev/null +++ b/basics/network/apps/server/src/components/acceleration-2d.component.ts @@ -0,0 +1,18 @@ +/** + * How fast the velocity of an entity changes, in pixels per second, per second. Needs + * `Velocity2D` and the `move2D` system. + * + * @component + * @side shared + * @group Acceleration color=#f0a33a - Pixels per second, per second. + */ +export class Acceleration2D { + name = "Acceleration2D"; + + constructor( + /** Added to the horizontal velocity every second. @group Acceleration @preset vector.x */ + public x = 0, + /** Added to the vertical velocity every second. @group Acceleration @preset vector.y */ + public y = 0, + ) {} +} diff --git a/basics/network/apps/server/src/components/player.component.ts b/basics/network/apps/server/src/components/player.component.ts new file mode 100644 index 0000000..48c50b0 --- /dev/null +++ b/basics/network/apps/server/src/components/player.component.ts @@ -0,0 +1,15 @@ +/** + * A player's square, moved by the client that owns it. The server spawns it when the client + * joins, and kills it when the client leaves. + * + * @component + * @side server + */ +export class Player { + name = "Player"; + + constructor( + /** The client that moves it, as `ctx.network` names it. */ + public clientId = "", + ) {} +} diff --git a/basics/network/apps/server/src/components/position-2d.component.ts b/basics/network/apps/server/src/components/position-2d.component.ts new file mode 100644 index 0000000..0a35624 --- /dev/null +++ b/basics/network/apps/server/src/components/position-2d.component.ts @@ -0,0 +1,20 @@ +/** + * Where an entity is, in pixels from the top-left corner of the screen. + * + * @remarks + * For rectangles it is their top-left corner, for circles their center. + * + * @component + * @side shared + * @group Position color=#4aa3ff - Pixels from the top-left corner of the screen. + */ +export class Position2D { + name = "Position2D"; + + constructor( + /** Pixels from the left edge. @group Position @preset vector.x */ + public x = 0, + /** Pixels from the top edge. @group Position @preset vector.y */ + public y = 0, + ) {} +} diff --git a/basics/network/apps/server/src/components/velocity-2d.component.ts b/basics/network/apps/server/src/components/velocity-2d.component.ts new file mode 100644 index 0000000..3b93d4e --- /dev/null +++ b/basics/network/apps/server/src/components/velocity-2d.component.ts @@ -0,0 +1,20 @@ +/** + * How fast an entity moves, in pixels per second. Needs `Position2D` and the `move2D` system. + * + * @example + * `new Velocity2D(100, 0)` moves 100 pixels to the right every second. + * + * @component + * @side shared + * @group Velocity color=#36c5a0 - Pixels per second. + */ +export class Velocity2D { + name = "Velocity2D"; + + constructor( + /** Pixels per second to the right (negative: to the left). @group Velocity @preset vector.x */ + public x = 0, + /** Pixels per second downward (negative: upward). @group Velocity @preset vector.y */ + public y = 0, + ) {} +} diff --git a/basics/network/apps/server/src/main.ts b/basics/network/apps/server/src/main.ts new file mode 100644 index 0000000..9170537 --- /dev/null +++ b/basics/network/apps/server/src/main.ts @@ -0,0 +1,33 @@ +import type { RunOptions } from "@nanoforge-dev/common"; +import { NanoforgeFactory } from "@nanoforge-dev/core"; +import { EcsLibrary } from "@nanoforge-dev/ecs/server"; +import { EditorLibrary } from "@nanoforge-dev/editor-lib"; +import { NetworkServerLibrary } from "@nanoforge-dev/network/server"; + +import { joinPlayers } from "./systems/join-players.system"; +import { keepInArena } from "./systems/keep-in-arena.system"; +import { move2D } from "./systems/move-2d.system"; +import { sendPlayers } from "./systems/send-players.system"; +import { steerPlayers } from "./systems/steer-players.system"; + +export const main = async (options: RunOptions): Promise => { + const app = NanoforgeFactory.createServer({ tickRate: 60 }); + const ecs = new EcsLibrary(); + + app.use(ecs); + app.use(new NetworkServerLibrary()); + app.use(new EditorLibrary()); + + await app.init(options); + + // No entity at the start: `joinPlayers` spawns one per client. + const registry = ecs.registry; + + registry.addSystem(joinPlayers); + registry.addSystem(steerPlayers); + registry.addSystem(move2D); + registry.addSystem(keepInArena); + registry.addSystem(sendPlayers); + + await app.run(); +}; diff --git a/basics/network/apps/server/src/systems/join-players.system.ts b/basics/network/apps/server/src/systems/join-players.system.ts new file mode 100644 index 0000000..47fba83 --- /dev/null +++ b/basics/network/apps/server/src/systems/join-players.system.ts @@ -0,0 +1,39 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; +import "@nanoforge-dev/network/server"; +import { ARENA, Join, PLAYER_SIZE } from "@network/protocol/messages"; +import { Position2D } from "../components/position-2d.component"; +import { Velocity2D } from "../components/velocity-2d.component"; + +import { Player } from "../components/player.component"; + +/** + * Spawns a player in the middle of the arena for each client that joins, once per client, and + * kills the players of the clients that left. + * + * @system + * @side server + */ +export const joinPlayers = (registry: Registry, ctx: Context) => { + const players = registry.getIndexedZipper([Player]); + const joins = ctx.network.packets.read(Join); + + if (joins.length) { + // A client gets one player, whatever it sends: several joins in one tick spawn one player. + const joined = new Set(players.map(({ Player }) => Player.clientId)); + for (const { clientId } of joins) { + if (joined.has(clientId)) continue; + joined.add(clientId); + const player = registry.spawnEntity(); + registry.addComponent(player, new Player(clientId)); + registry.addComponent( + player, + new Position2D((ARENA.width - PLAYER_SIZE) / 2, (ARENA.height - PLAYER_SIZE) / 2), + ); + registry.addComponent(player, new Velocity2D(0, 0)); + } + } + for (const { id: index, Player } of players) + if (!ctx.network.clients.get(Player.clientId)) + registry.killEntity(registry.entityFromIndex(index)); +}; diff --git a/basics/network/apps/server/src/systems/keep-in-arena.system.ts b/basics/network/apps/server/src/systems/keep-in-arena.system.ts new file mode 100644 index 0000000..f485f76 --- /dev/null +++ b/basics/network/apps/server/src/systems/keep-in-arena.system.ts @@ -0,0 +1,19 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; +import { ARENA, PLAYER_SIZE } from "@network/protocol/messages"; +import { Position2D } from "../components/position-2d.component"; + +import { Player } from "../components/player.component"; + +/** + * Keeps every player's square inside the arena. Add it after `move2D`. + * + * @system + * @side server + */ +export const keepInArena = (registry: Registry, _ctx: Context) => { + registry.getZipper([Player, Position2D]).forEach(({ Position2D }) => { + Position2D.x = Math.min(Math.max(Position2D.x, 0), ARENA.width - PLAYER_SIZE); + Position2D.y = Math.min(Math.max(Position2D.y, 0), ARENA.height - PLAYER_SIZE); + }); +}; diff --git a/basics/network/apps/server/src/systems/move-2d.system.ts b/basics/network/apps/server/src/systems/move-2d.system.ts new file mode 100644 index 0000000..514766a --- /dev/null +++ b/basics/network/apps/server/src/systems/move-2d.system.ts @@ -0,0 +1,26 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; + +import { Acceleration2D } from "../components/acceleration-2d.component"; +import { Position2D } from "../components/position-2d.component"; +import { Velocity2D } from "../components/velocity-2d.component"; + +/** + * Moves entities: their `Acceleration2D` changes their `Velocity2D`, then their `Velocity2D` + * changes their `Position2D`, by the time elapsed since the last frame. + * + * @system + * @side shared + */ +export const move2D = (registry: Registry, ctx: Context) => { + const seconds = ctx.app.delta / 1000; + + registry.getZipper([Acceleration2D, Velocity2D]).forEach(({ Acceleration2D, Velocity2D }) => { + Velocity2D.x += Acceleration2D.x * seconds; + Velocity2D.y += Acceleration2D.y * seconds; + }); + registry.getZipper([Position2D, Velocity2D]).forEach(({ Position2D, Velocity2D }) => { + Position2D.x += Velocity2D.x * seconds; + Position2D.y += Velocity2D.y * seconds; + }); +}; diff --git a/basics/network/apps/server/src/systems/send-players.system.ts b/basics/network/apps/server/src/systems/send-players.system.ts new file mode 100644 index 0000000..5f98ee0 --- /dev/null +++ b/basics/network/apps/server/src/systems/send-players.system.ts @@ -0,0 +1,24 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; +import "@nanoforge-dev/network/server"; +import { Players } from "@network/protocol/messages"; +import { Position2D } from "../components/position-2d.component"; + +import { Player } from "../components/player.component"; + +/** + * Sends every client where every player is. Add it last. + * + * @system + * @side server + */ +export const sendPlayers = (registry: Registry, ctx: Context) => { + ctx.network.packets.sendToAll( + Players, + registry.getZipper([Player, Position2D]).map(({ Player, Position2D }) => ({ + id: Player.clientId, + x: Math.round(Position2D.x), + y: Math.round(Position2D.y), + })), + ); +}; diff --git a/basics/network/apps/server/src/systems/steer-players.system.ts b/basics/network/apps/server/src/systems/steer-players.system.ts new file mode 100644 index 0000000..9344cc9 --- /dev/null +++ b/basics/network/apps/server/src/systems/steer-players.system.ts @@ -0,0 +1,26 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; +import "@nanoforge-dev/network/server"; +import { Move, PLAYER_SPEED } from "@network/protocol/messages"; +import { Velocity2D } from "../components/velocity-2d.component"; + +import { Player } from "../components/player.component"; + +/** + * Sets the `Velocity2D` of each player from the last direction its client sent. The client only + * says where it wants to go: the speed is the server's. Add it before `move2D`. + * + * @system + * @side server + */ +export const steerPlayers = (registry: Registry, ctx: Context) => { + const moves = ctx.network.packets.read(Move); + if (!moves.length) return; + + registry.getZipper([Player, Velocity2D]).forEach(({ Player, Velocity2D }) => { + const move = moves.findLast(({ clientId }) => clientId === Player.clientId); + if (!move) return; + Velocity2D.x = move.data.x * PLAYER_SPEED; + Velocity2D.y = move.data.y * PLAYER_SPEED; + }); +}; diff --git a/basics/network/apps/server/tsconfig.json b/basics/network/apps/server/tsconfig.json new file mode 100644 index 0000000..9c06682 --- /dev/null +++ b/basics/network/apps/server/tsconfig.json @@ -0,0 +1,5 @@ +{ + "$schema": "https://json.schemastore.org/tsconfig.json", + "extends": "../../tsconfig.json", + "include": ["src"] +} diff --git a/basics/network/libs/protocol/nanoforge.config.ts b/basics/network/libs/protocol/nanoforge.config.ts new file mode 100644 index 0000000..00eccaa --- /dev/null +++ b/basics/network/libs/protocol/nanoforge.config.ts @@ -0,0 +1,6 @@ +import { defineConfig } from "@nanoforge-dev/config"; + +export default defineConfig({ + type: "lib", + dir: { shared: "src" }, +}); diff --git a/basics/network/libs/protocol/package.json b/basics/network/libs/protocol/package.json new file mode 100644 index 0000000..1c865ed --- /dev/null +++ b/basics/network/libs/protocol/package.json @@ -0,0 +1,11 @@ +{ + "$schema": "https://json.schemastore.org/package.json", + "name": "@network/protocol", + "description": "What the client and the server of the network example say to each other", + "private": true, + "type": "module", + "devDependencies": { + "@nanoforge-dev/config": "^3.0.1", + "@nanoforge-dev/network": "^3.0.0" + } +} diff --git a/basics/network/libs/protocol/src/messages.ts b/basics/network/libs/protocol/src/messages.ts new file mode 100644 index 0000000..118b74f --- /dev/null +++ b/basics/network/libs/protocol/src/messages.ts @@ -0,0 +1,34 @@ +import { Channel, definePacket } from "@nanoforge-dev/network"; + +/** The play area, in pixels: the server keeps every player inside it. */ +export const ARENA = { width: 800, height: 600 }; + +/** Side of a player's square, in pixels. */ +export const PLAYER_SIZE = 40; + +/** Pixels per second a player moves at. */ +export const PLAYER_SPEED = 300; + +/** A direction on one axis: -1 (left or up), 0, or 1 (right or down). */ +type Direction = -1 | 0 | 1; + +const isDirection = (value: unknown): value is Direction => + value === -1 || value === 0 || value === 1; + +/** Client to server, once: puts the client's player in the game. */ +export const Join = definePacket("join"); + +/** Client to server, when the keys held change: where the player wants to go. */ +export const Move = definePacket<{ x: Direction; y: Direction }>("move", { + // The server never trusts a client: anything but two directions is dropped. + validate: (data): data is { x: Direction; y: Direction } => + typeof data === "object" && + data !== null && + isDirection((data as { x?: unknown }).x) && + isDirection((data as { y?: unknown }).y), +}); + +/** Server to every client, each tick: where every player is. */ +export const Players = definePacket<{ id: string; x: number; y: number }[]>("players", { + channel: Channel.UnreliableOrdered, +}); diff --git a/basics/network/nanoforge.config.ts b/basics/network/nanoforge.config.ts new file mode 100644 index 0000000..6f9f285 --- /dev/null +++ b/basics/network/nanoforge.config.ts @@ -0,0 +1,6 @@ +import { defineConfig } from "@nanoforge-dev/config"; + +export default defineConfig({ + type: "workspace", + packages: ["apps/*", "libs/*"], +}); diff --git a/basics/network/package.json b/basics/network/package.json new file mode 100644 index 0000000..b1661ae --- /dev/null +++ b/basics/network/package.json @@ -0,0 +1,18 @@ +{ + "$schema": "https://json.schemastore.org/package.json", + "name": "network", + "description": "Move squares on a shared server: the smallest NanoForge game played online", + "private": true, + "type": "module", + "scripts": { + "dev": "nf dev", + "build": "nf build", + "start": "nf start", + "editor": "nf editor ." + }, + "devDependencies": { + "@nanoforge-dev/cli": "^3.0.1", + "@nanoforge-dev/config": "^3.0.1", + "typescript": "^6.0.0" + } +} diff --git a/basics/network/pnpm-lock.yaml b/basics/network/pnpm-lock.yaml new file mode 100644 index 0000000..cbb3f3e --- /dev/null +++ b/basics/network/pnpm-lock.yaml @@ -0,0 +1,1680 @@ +lockfileVersion: '9.0' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + +importers: + + .: + devDependencies: + '@nanoforge-dev/cli': + specifier: ^3.0.1 + version: 3.0.1 + '@nanoforge-dev/config': + specifier: ^3.0.1 + version: 3.0.1 + typescript: + specifier: ^6.0.0 + version: 6.0.3 + + apps/client: + devDependencies: + '@nanoforge-dev/asset': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/common': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/core': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/ecs': + specifier: ^3.0.0 + version: 3.0.0(@nanoforge-dev/editor-lib@3.0.0) + '@nanoforge-dev/editor-lib': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/env': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/graphics-2d': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/input': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/network': + specifier: ^3.0.0 + version: 3.0.0(@nanoforge-dev/editor-lib@3.0.0) + '@network/protocol': + specifier: workspace:* + version: link:../../libs/protocol + typescript: + specifier: ^6.0.0 + version: 6.0.3 + + apps/server: + devDependencies: + '@nanoforge-dev/asset': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/common': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/core': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/ecs': + specifier: ^3.0.0 + version: 3.0.0(@nanoforge-dev/editor-lib@3.0.0) + '@nanoforge-dev/editor-lib': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/env': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/network': + specifier: ^3.0.0 + version: 3.0.0(@nanoforge-dev/editor-lib@3.0.0) + '@network/protocol': + specifier: workspace:* + version: link:../../libs/protocol + typescript: + specifier: ^6.0.0 + version: 6.0.3 + + libs/protocol: + devDependencies: + '@nanoforge-dev/config': + specifier: ^3.0.1 + version: 3.0.1 + '@nanoforge-dev/network': + specifier: ^3.0.0 + version: 3.0.0(@nanoforge-dev/editor-lib@3.0.0) + +packages: + + '@angular-devkit/core@22.2.7': + resolution: {integrity: sha512-cchZAMsV4d76RDZBlWzPhYxM/Hb6bmq71oUngdrwehMbBbdQu3W9C2tGlvxuPxbRKru9ZlUa14YVXQ0+QnhFtw==} + engines: {node: ^22.22.3 || ^24.15.0 || >=26.0.0, npm: ^6.11.0 || ^7.5.6 || >=8.0.0, yarn: '>= 1.13.0'} + peerDependencies: + chokidar: ^5.0.0 + peerDependenciesMeta: + chokidar: + optional: true + + '@angular-devkit/schematics-cli@22.2.7': + resolution: {integrity: sha512-9Od0E8TiYTQWm/03QjYWnsryZA8ZSjTf/k5z61nPd/jgloVNvSW8kxC7/YMw+RoXh2idMzjiJxraKxg+gJxzPw==} + engines: {node: ^22.22.3 || ^24.15.0 || >=26.0.0, npm: ^6.11.0 || ^7.5.6 || >=8.0.0, yarn: '>= 1.13.0'} + hasBin: true + + '@angular-devkit/schematics@22.2.7': + resolution: {integrity: sha512-a1h7xNqBLQVo1e5eCyOU3axSbA9AFU6nnSH5QhlNhggfMeZde+eBrueSt25xsewoxlKO8EvkVT3+knMUkDYiGQ==} + engines: {node: ^22.22.3 || ^24.15.0 || >=26.0.0, npm: ^6.11.0 || ^7.5.6 || >=8.0.0, yarn: '>= 1.13.0'} + + '@emnapi/core@2.0.0-beta.2': + resolution: {integrity: sha512-MzCVoWtcg4Pm2B3je5mMvYMvj3MmBKw+fU7vbsJc9/iT8ip6/eYIHo/Dsm/mr+wsHB6SEyJDuxB09Yy6r/8+4A==} + + '@emnapi/runtime@2.0.0-beta.2': + resolution: {integrity: sha512-JcrSPzPvZuNZvJqPTF9Fw25LbOJ8avzFVlaf2grmH4Cku0oGP47tRgqPZadcfj3YoZMHkFVnCYFbQM8I+i5QEw==} + + '@emnapi/wasi-threads@2.2.0': + resolution: {integrity: sha512-JP7OYH38Q7+pyTAe14raZHLQIK7BDKbdwji+Xi3pcd/6QkJYQH3SX4wu6EplGrGJWRepoNzedfm0G3B9Z4e9Rw==} + + '@inquirer/ansi@2.1.0': + resolution: {integrity: sha512-63GU5AD9KhNbWM0jlhHoMJTEFck2upFOPxHlnCKf3xYTV3rjTUUQfodihmTnfYQzMLS29oy8lK/gA1eJgu4bhA==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + + '@inquirer/checkbox@5.3.0': + resolution: {integrity: sha512-3QQSO87A+JoRtOtjtsgX2enwTL+3+VBVrkUpdqrIxMOgn5+W5sE57PcCPAiNUIESHxV4Q6mNEGxq2xLmRa0/yw==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/confirm@6.4.0': + resolution: {integrity: sha512-+DCZxrOF01Q/1SzTQkgycAQPS/Jf+Yol0h1P/MVmopukTsxGOu1h/LKqf30y0eHKFZYYrgUMVhGDhEbPmSPi9A==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/core@12.1.0': + resolution: {integrity: sha512-6H7usRWw4Gdjgpaem10CA5MfZ/xoYPGyInriR1Xubqjv+SVo8LIJ1erpFxW5JgCza6VZVZiKLTko7RtUU3AQMg==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/editor@5.4.0': + resolution: {integrity: sha512-L7vdCe4jnMpzhDisu1tAnr4WGvfPOVz+vNFXyIIL7O2Ycn/n90sn1ARvg+4cwzLf+us51BE/cX7uhnrLcal3+g==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/expand@5.2.0': + resolution: {integrity: sha512-AOp2KQk7QojUyWOP7VkqdBWmxLRaVH58wQMx3N4//P530EDtpVp1EWIjAJubx9ZohWS/UCEpIkA1TuiNki0iOA==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/external-editor@3.1.0': + resolution: {integrity: sha512-27JAkF38nXqXaoveU28iA/+Z8nutnF8B3JsbdToPHn9WnkrsMtZ0/YoJ29YwbtFexYIo+tIy6ikMvTdHKjjmGA==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/figures@2.1.0': + resolution: {integrity: sha512-CR9u2PME23jxy2SOyTb117efwAAPm98Zr+LoWI+PiQ55D6U8Yeu/HyFTxwytKhPa6oxAGzdsm2Kg7oLS6B9z8w==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + + '@inquirer/input@5.2.0': + resolution: {integrity: sha512-sIUPnN2X7M+7dq3RUd+e9QRacYnM+6B+kSucwQgj5VC5Eo/f+CIr2NyPBumxsViI+wzfokkgop/3x3KfHxNyJw==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/number@4.3.0': + resolution: {integrity: sha512-xYkX4sPVgox0F7yQwpz/MByWjOGdLEf1pdjH+Lji2gAzSs2xezz5bN5YgS1n0tx9wo0mRhGvq1KJGtvDZ9XXcQ==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/password@5.3.0': + resolution: {integrity: sha512-KVqW4G/UbMK06uBN76xF89JKYC9YBWU7v+Kc2tUwMCO8pg3ASBr0HVabl1KaSqF94O2KiRu8aKx4EicN78PK+A==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/prompts@8.7.2': + resolution: {integrity: sha512-QoRB4wFIjgH5iOhSjoIKMkTvSHDuV+O3OITlIqAYO0oK5x364GJILXiMBvlPiE+klg7Xx9tq5XVqQHcGUDYYPA==} + engines: {node: '>=23.5.0 || ^22.13.0 || ^20.17.0'} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/prompts@8.8.0': + resolution: {integrity: sha512-yYVT2Eo3mafb9tnU2Mr3+wh5wLCWyspExqVoPSMCIfBIn3ZUTE4IDfbCMbMgXaOH0tH+JZEhOtfczQhDzOjIGg==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/rawlist@5.4.0': + resolution: {integrity: sha512-x42wcy465GM5/mHNKBFdAJbLlLyzmYqr/DEa6F49nHpI+03EFwRCRKeLGQakx5XqZ4unc2yFuS78qAD4Rb0iFA==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/search@4.4.0': + resolution: {integrity: sha512-UJ+9tkzPT1AjnvjuPFYcOdO3BVeN28bfSXajYRFZTRgA9OiNl4k2Nn2cHHPwiIDyPHlvOnmE9ZOHyXhPHtvb+A==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/select@5.3.0': + resolution: {integrity: sha512-Fmgfl0qjqCQo+/tjQpgnRXKh5N7/VpYcJh+AlYU2eHmHZLMGUBDzo+Gwc2ODzWJfXNRZmgaMhz4qULcO/C/rXg==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/type@4.3.0': + resolution: {integrity: sha512-/IA8q2nyjgyl0NGSjqiRXB8gh3We7Pzx9C0c+6Zoolu905jFc79anerrUG7+n65+qs310DRK43yi2WDI8nY59A==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@isaacs/fs-minipass@4.0.1': + resolution: {integrity: sha512-wgm9Ehl2jpeqP3zw/7mo3kRHFp5MEDhqAdwy1fTGkHAwnkGOVsgpvQhL8B5n1qlb01jV3n/bI0ZfZp5lWA1k4w==} + engines: {node: '>=18.0.0'} + + '@jridgewell/sourcemap-codec@1.6.0': + resolution: {integrity: sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw==} + + '@nanoforge-dev/asset@3.0.0': + resolution: {integrity: sha512-jqXcyCMbdcCCj7wZ/dyIpjY8hza02Pt/vY8KrNcaXTlxpTc9EE+VKuO5+fHdUXWWPgJSFt96TqAPhug+z+KH3Q==} + engines: {node: '26'} + + '@nanoforge-dev/cli@3.0.1': + resolution: {integrity: sha512-ZfrbETcAcX3vsPLO1WLSCJc2ERCAcIpbdi9Df5bmH3XLinQkDAcESkN9JkaI/vgV08A7xhTjV8zSDSwF0T73Xg==} + engines: {node: '26'} + hasBin: true + + '@nanoforge-dev/common@3.0.0': + resolution: {integrity: sha512-lzMvQ1vCElh9OcP4EqhffbY+AQXOH4IiuD1pj7VvJlpcY6hh7Bs/s4NVS0gXoJ+ibpBMe5mAq23RyzqTwk8czg==} + engines: {node: '26'} + + '@nanoforge-dev/config@3.0.1': + resolution: {integrity: sha512-XWRScOotb8IirerRx/mWLmUVYye3lo0PN/5a0MUp/eoSrhz0S6zzhGHEupRuC8aeHTjsQT7ctM3P6YyKSHZLaQ==} + engines: {node: '26'} + + '@nanoforge-dev/core@3.0.0': + resolution: {integrity: sha512-pa7Fr3TFkZVfAADBC17Qt5ru/W9vXtYB8e5eb7wurAtu8/jH/ZtqfW3kafTuWC9513MXp/h6LOCdZQhjnCt6UA==} + engines: {node: '26'} + + '@nanoforge-dev/ecs@3.0.0': + resolution: {integrity: sha512-csrXJtCzqohxtvEQs+O//xabnaLR3BXe0QpSpl7NVihF3f0iX2fNYURxNjQKxzoPYBokCnnyNxN2KFc7UmIsdA==} + engines: {node: '26'} + peerDependencies: + '@nanoforge-dev/editor-lib': 3.0.0 + '@nanoforge-dev/scene': 3.0.0 + peerDependenciesMeta: + '@nanoforge-dev/editor-lib': + optional: true + '@nanoforge-dev/scene': + optional: true + + '@nanoforge-dev/editor-lib@3.0.0': + resolution: {integrity: sha512-fSWm6bHelbxqeVESYoUUKDi9RGNxvRu6p1r41KE1DddM0RrP0/WzkFOWBvgl+psHbYNotXe723Y2Fd3p+tqPDQ==} + engines: {node: '26'} + + '@nanoforge-dev/editor@0.1.4': + resolution: {integrity: sha512-bqbrH8ulFSiZz1iisJHtHeEzj1RV/70uErCYHeW4DIhVPsWbBfWKFvg/ghAbmPk5vsj0YnhDX6DSpik4S1QoiQ==} + engines: {node: '25'} + + '@nanoforge-dev/env@3.0.0': + resolution: {integrity: sha512-kXYXl9/09Bn8VStTTFuZY3dYDG9b76VhOi9PHMnaLe75XcFRLKJ2dYkXf3ut6RCL2+6H7HAEIOALjR15CHnJ5A==} + engines: {node: '26'} + + '@nanoforge-dev/graphics-2d@3.0.0': + resolution: {integrity: sha512-0I0WUr5495jORdYR+HtyP4kmAfCMvixmG+EH/gE5bN33S8RO6/Ly4oMLZOLUywcDTAFuLn28BlHuVor2YfXrsg==} + engines: {node: '26'} + + '@nanoforge-dev/input@3.0.0': + resolution: {integrity: sha512-8pWU28c99VAvn37onNbVFfwXTgyQGxm5DVnTdBEzgrF3KPCzU77kEaexB1AWOlga+4qNGU7/XNm3hNZ+YS49Ig==} + engines: {node: '26'} + + '@nanoforge-dev/loader-client@1.7.0': + resolution: {integrity: sha512-zDj0yQ8cZyHHjAYDVIyB79mh4dK7WRgZG7Kc+d/43t2WX/pX2HqBVkpLcDPkA9cNOKpCRYWd3LyYISlz53gzyg==} + engines: {node: '26'} + + '@nanoforge-dev/loader-server@1.7.0': + resolution: {integrity: sha512-Yd/BYORhoar5znNSD7kGirAc1Al0q5t8iscbb07QWKeXWA+DLKjPSuKJC6ykysFkbs9HiZU59oOfxyvNL4h3Pw==} + engines: {node: '26'} + + '@nanoforge-dev/loader-website@1.7.0': + resolution: {integrity: sha512-x1fV3RYUUxru39sF5HJcfutNnifMMTIEHW92jgkR9gz06ZlZ+rQofuegXgAnEzs0dEXa+rhNQ/iXYbqOZvq6YQ==} + engines: {node: '26'} + + '@nanoforge-dev/network@3.0.0': + resolution: {integrity: sha512-T0+s6vmiBuY3/KPK8s4wYcqQju6YDpoIJgpJy6eTelUD2+cHkWjav4WjfXxfVsE89JVu7ariXoRD+VuozhjUpA==} + engines: {node: '26'} + peerDependencies: + '@nanoforge-dev/editor-lib': 3.0.0 + peerDependenciesMeta: + '@nanoforge-dev/editor-lib': + optional: true + + '@nanoforge-dev/registry@3.0.1': + resolution: {integrity: sha512-EzSaszYtrPldD5Do7jdQK3TLLb8uCirY6NQjKXkeGw31X+sUXor4h5GAaoxELWMzPnv9BbKtggSaVaQIt7s8IQ==} + engines: {node: '26'} + + '@nanoforge-dev/schematics@3.0.1': + resolution: {integrity: sha512-iK2vC0gPEh2mQ81IB4+jfGw/ZNOLMDnS9HRBXH5tWB0mdN5GA32viblhW0oYPX2/tWrLC9YiCPgEE4AL8Zwz6w==} + engines: {node: '26'} + + '@napi-rs/wasm-runtime@1.2.6': + resolution: {integrity: sha512-mRyDmEw9/fCDXCGfL1sbgIw/GUK0PVxRW4YwgPN61F3LQ+fSyoBFarJVzgGyhF6kRzEQZ0FejDqm4WLXSeqQmw==} + engines: {node: ^20.19.0 || ^22.13.0 || >=23.5.0} + peerDependencies: + '@emnapi/core': ^1.7.1 || 2.0.0-beta.2 + '@emnapi/runtime': ^1.7.1 || 2.0.0-beta.2 + + '@node-datachannel/android-arm64@0.33.6': + resolution: {integrity: sha512-UzSnd1vSN//3pqyvuufbaIQemvRfIHn/7DAy7wjoYk9tzkJp4SMk1FrNhkhmev89SH/h7yTac6PlGxGe5oHcKw==} + cpu: [arm64] + os: [android] + + '@node-datachannel/darwin-arm64@0.33.6': + resolution: {integrity: sha512-vE2fN6D0BJJ3yZo5guJo2j1q7JeQbl+VyIs6vbkjEp654tQtTo3y7a4l3xB0bwDD27TOlkOlaSLJQRj6ZXqQdQ==} + cpu: [arm64] + os: [darwin] + + '@node-datachannel/darwin-x64@0.33.6': + resolution: {integrity: sha512-EtRB2THMR11XMzbNhMEwaZtipaUxFz+PgeVx7hE+er6Ai1Fzzv7XexrMWDG11ahdpEZ8fAxlxuyELs33/WH1Cg==} + cpu: [x64] + os: [darwin] + + '@node-datachannel/linux-arm64-gnu@0.33.6': + resolution: {integrity: sha512-phMRjx8NEfW70i768LCQDEF2C6Q2vtYsS4DPXv/zbb2cJClaU5fjKFQfQ1XBCNIi1ClfpSd3Cl/rn/7SS+paTQ==} + cpu: [arm64] + os: [linux] + libc: [glibc] + + '@node-datachannel/linux-arm64-musl@0.33.6': + resolution: {integrity: sha512-T9bqllJ9YkpgqgRFEfsPpfgfMDXdA7CIiJ4c1XXGPLSeqVFgDbf/WCewkE7q4xA+tKRLoOOtc2XgMGwVnlxXVQ==} + cpu: [arm64] + os: [linux] + libc: [musl] + + '@node-datachannel/linux-x64-gnu@0.33.6': + resolution: {integrity: sha512-NUTbne64++ZxwEJ9uppAAmYnFAfJAggf7gboioPdhr13P17GTQRCUgmipYrh1V0D4333x6NCBZyQaNv0n4WmpQ==} + cpu: [x64] + os: [linux] + libc: [glibc] + + '@node-datachannel/linux-x64-musl@0.33.6': + resolution: {integrity: sha512-dlWP4ycOJrTAl9UvxGofq0zwPhl6iAr1b0ZcBUgDfb2CXmbcJWCvg6OsJ6u8BVSV41eNXALmaRpU0wttas/f1g==} + cpu: [x64] + os: [linux] + libc: [musl] + + '@node-datachannel/win32-arm64-msvc@0.33.6': + resolution: {integrity: sha512-ttly7XRUrSOcOOGJvtm9gh2beAPUNOBOUc3Hk82LfMHHP7jJMkXNDns/ML+UVGommAcNyPhoZkRH62O7tSVQYw==} + cpu: [arm64] + os: [win32] + + '@node-datachannel/win32-x64-msvc@0.33.6': + resolution: {integrity: sha512-N5GW6XH11Iuu+kyHLTiCMcCHdwWwpKqvtYril0LzQm6xBgmGQN3JXxFmgi4g4usw1nLy6WhBWADjbhSXJiiEMA==} + cpu: [x64] + os: [win32] + + '@oven/bun-darwin-aarch64@1.4.4': + resolution: {integrity: sha512-zW/hxwc8sJAILGwB5eTC4i48ouGXf0V4lrxmEOk3JIE6JkYVW1TZh1E2pIempqsezgW1sckTIIDudFON8bJ2Mw==} + cpu: [arm64] + os: [darwin] + + '@oven/bun-darwin-x64@1.4.4': + resolution: {integrity: sha512-oKGcxLsvh4oHjAo28nPm8c/xN0o/OmGyj1IHYc94vprkWsW2hNg2keEZt5f40cI5Hvu4jDlSRTR0UNpv1UIAxw==} + cpu: [x64] + os: [darwin] + + '@oven/bun-freebsd-aarch64@1.4.4': + resolution: {integrity: sha512-klvA9FlwLxZj3JYIOPQA4bbnHIC3uas8kBE4GaGGkeVgAQP/k8hAzYkOqkSaqHBDbxLrTyFEQArEAevJq6NJzg==} + cpu: [arm64] + os: [freebsd] + + '@oven/bun-freebsd-x64@1.4.4': + resolution: {integrity: sha512-sF1xS/scbyN94P2d0eTiarO6JHxrIvhZNT9hnWjQXW5nwKRtfuP+UYnIMNyvW1BQPcZFP/cvfLBNUIe1ea4zPA==} + cpu: [x64] + os: [freebsd] + + '@oven/bun-linux-aarch64-android@1.4.4': + resolution: {integrity: sha512-5lvn3at5vRC0GxvmiqEiV2/e23tnRi0q5pzR40yfDvDA3OW7PSkt4chF1nA9vnAJhro4/l+ol1FmNP6D3cf/oA==} + cpu: [arm64] + os: [android] + + '@oven/bun-linux-aarch64-musl@1.4.4': + resolution: {integrity: sha512-QFd0P+mHJxbZFbUla4MgiE5OwxysHaUIYxL2pPNkpWtaI7v4ShOpr8OhBmsuyB0xn5rv/ZJnPsj2y8+bB9+g/A==} + cpu: [arm64] + os: [linux] + libc: [musl] + + '@oven/bun-linux-aarch64@1.4.4': + resolution: {integrity: sha512-ZTVtpf9zmHSBVPX1sBwe5agGb/rN34yPGg/Hby8e2Ax2uCUA2URZKlZH7qLntK7qaFJCMXh9v0GWNYN2zINz1w==} + cpu: [arm64] + os: [linux] + libc: [glibc] + + '@oven/bun-linux-x64-android@1.4.4': + resolution: {integrity: sha512-3dMicj9C1DhaIfDkwt/9GtpU0W+q+GazbG9OIlEyL3Q1BBEz2e6ZRz/JiO8D/ECC0caXAqvnpFudehcLlgIwWQ==} + cpu: [x64] + os: [android] + + '@oven/bun-linux-x64-musl@1.4.4': + resolution: {integrity: sha512-lEEjNOJJrbGZu2NVcPI4uXdILcpspezWkA8R/Jr0RCGhM6zQd0Y7JBIIKNAmbX59EeWpeEz7Q78iLbpcAUypUA==} + cpu: [x64] + os: [linux] + libc: [musl] + + '@oven/bun-linux-x64@1.4.4': + resolution: {integrity: sha512-CHbbkmHVM28T1GFq+6GL4Ao4ujwwYwj1CxFFwEFzLanPfNsId9AhbIP0Q4reWuWBkGimUkoQygrK7Rgjtj3vog==} + cpu: [x64] + os: [linux] + libc: [glibc] + + '@oven/bun-windows-aarch64@1.4.4': + resolution: {integrity: sha512-n0ep5ZRPCZY1+dqFJpnnRUZB1wy4GYU6At8RF+pyzySCLjkN9R4rFh2PtBHAgF/lg1vOl3/CeER3pDM+p40ATA==} + cpu: [arm64] + os: [win32] + + '@oven/bun-windows-x64@1.4.4': + resolution: {integrity: sha512-a3LNctBVO8PjePsFZfwDleF2JXYf2BfQ1u/PLRnBDLnC2Riml+4+LgJpKj4xRGhB92KweGyQI5PXaTkP9qypMQ==} + cpu: [x64] + os: [win32] + + '@oxc-project/types@0.158.0': + resolution: {integrity: sha512-xZ66qA4WmLbTLlxH3mqMd8f9UKbaOzOT0ATwFf4DH/14pMgpUrtqtjyYzOQmgfl2a0iRAAMbQ9G1th/67jRzGw==} + + '@rolldown/binding-android-arm-eabi@1.3.2': + resolution: {integrity: sha512-kqR2xcygEx3WwDY69LsKeyf7SVmx4yzMtKZRknyaHieVJdRvvnAM97L0Gq6tUFc9T2YXcW/Ghij2+Um6He0LTw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [android] + + '@rolldown/binding-android-arm64@1.3.2': + resolution: {integrity: sha512-gXM4GAAvvIZA7qUuSCQS+Zz91H2fagKa5MNppUdjzysJ8LXMWm9D/gQj4nfOKo6okquDQ5pkjsuo2SUMXNW0Rw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [android] + + '@rolldown/binding-darwin-arm64@1.3.2': + resolution: {integrity: sha512-OBs5hp3W+LwMEUmDMMMnu08ncG0t6DDgnFU+6TAucKtAfNgerYLZSr2jtREKb/JuPQ1J7bJnWIgKKkxvjuAw1g==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [darwin] + + '@rolldown/binding-darwin-x64@1.3.2': + resolution: {integrity: sha512-X0VGYd4v/gdjfa/IP6uHuMhofPoUDYvK/byk3bC0jQ1pKKgt6RZ4B4puMqP0AHkjmIHAsxA471mM6AxZ39IaTA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [darwin] + + '@rolldown/binding-freebsd-x64@1.3.2': + resolution: {integrity: sha512-mr04K4cp9J/fj9fknrX8e4QvI/V48Sp+4v64PoLwhoirIH8b8L8EBrF/0bTjV1It2IL91hoNG13GblnWLglkxA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [freebsd] + + '@rolldown/binding-linux-arm-gnueabihf@1.3.2': + resolution: {integrity: sha512-VgWy02HU9Tiy6tU8U+kF3Fd4TQwTNdIBvs2MlgViP1ksMtAnQQTIPAj0ZsJzIQXKIOugqQSpqxQgELJ3fkuL5w==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [linux] + + '@rolldown/binding-linux-arm64-gnu@1.3.2': + resolution: {integrity: sha512-0wloJFYqV844gv6boiERbHpErxbxHbmlgnMX5VxP1Ux+DLBqGrUOn0cIpBmCZEcTITes3QUelxya4u8c9ziQvQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-arm64-musl@1.3.2': + resolution: {integrity: sha512-Kys8wgFQy8H8vua0MNpC0akMBFoNO8455RHk2yycBM0iayMIAtVAL6xmV9TWAkehFgrrlImTL2fZdX5LXfYtAA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + libc: [musl] + + '@rolldown/binding-linux-ppc64-gnu@1.3.2': + resolution: {integrity: sha512-L8eej7+/StRxUHHOPsOVl7Fzx/3tumuGB4hGQZKT73xRI16KZhaSJr0gi3C3WBjNRxeJRKKps2UD4lQukP+oBw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [ppc64] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-s390x-gnu@1.3.2': + resolution: {integrity: sha512-MV5CEb/nV8neQOj7l6945q1vy62HXtWO8zPDvfySPusoUzdBoLoJ/DfXXwaYThGTXZCniF+5bCf253WTPPK7Yw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [s390x] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-x64-gnu@1.3.2': + resolution: {integrity: sha512-3qssvvVvkwQookZ1/1avlKWc5orAR85vgKdzDd5noZS8nnHiI/ejOAEt0xfNYvtBBF7/DZmP8dANWkRBJVOBCA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-x64-musl@1.3.2': + resolution: {integrity: sha512-rJqoFTm/bCZFKKgaT4NzWn/TuJkFDToZ/rzYFnYVBL28jH1nIfg6snx2mDri30nal9H+wcYfKpoPR9jrMQgQQg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + libc: [musl] + + '@rolldown/binding-openharmony-arm64@1.3.2': + resolution: {integrity: sha512-ozdbCjHfh0N//wJNExjJlSlcDaeIKo8k1ktzkLUyESr2Gu/Qw7nBYxKe3jgtoaxda570vg10WdYosre82263hQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [openharmony] + + '@rolldown/binding-wasm32-wasi@1.3.2': + resolution: {integrity: sha512-p5VA6Vk/2cXZPVWf+dDbuE0dkhrcoAo6pISTJmzUnsSdQqNJdusyR8lZgHku095+r27zrYISNLZnJoqrcePW0A==} + engines: {node: ^20.19.0 || ^22.13.0 || >=23.5.0} + cpu: [wasm32] + + '@rolldown/binding-win32-arm64-msvc@1.3.2': + resolution: {integrity: sha512-XDb2U14Orf4r76SwzvJ7avePL00w4gHBmi1Ig4B/itYFEUTmYMNDHVU0dcYuBa0LgNBqyREoJOrQKxQlyYJA7A==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [win32] + + '@rolldown/binding-win32-x64-msvc@1.3.2': + resolution: {integrity: sha512-lEsKzKJqIUDZVCBhS4lkZuyQUhV1oRg5UHkI72qlOAqJn7qEXcoVdTridFS7PHNWdZknBl95EAF/4P1Xv0K1eQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [win32] + + '@rolldown/pluginutils@1.1.0': + resolution: {integrity: sha512-K+NU2HDCEem4sClgHH4ZZXwdJeNFkJo+hRk479DIwdIviAPN2hFJH1KHHwg8CxHQXvi0M5XY4deTXINfIiSG6w==} + + '@sindresorhus/is@4.6.0': + resolution: {integrity: sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==} + engines: {node: '>=10'} + + '@tybys/wasm-util@0.10.4': + resolution: {integrity: sha512-W3c4gRigFS0T/Ma4qIYF3GDAc5AQdHb1yL5znJT1Zv1YaD9Kitx656wBjvr19qbiosmZT8lWDM5BEMynUqX65A==} + + '@types/validator@13.15.10': + resolution: {integrity: sha512-T8L6i7wCuyoK8A/ZeLYt1+q0ty3Zb9+qbSSvrIVitzT3YjZqkTZ40IbRsPanlB4h1QB3JVL1SYCdR6ngtFYcuA==} + + ajv-formats@3.0.1: + resolution: {integrity: sha512-8iUql50EUR+uUcdRQ3HDqa6EVyo3docL8g5WJ3FNcWmu62IbkGUue/pEyLBW8VGKKucTPgqeks4fIU1DA4yowQ==} + peerDependencies: + ajv: ^8.0.0 + peerDependenciesMeta: + ajv: + optional: true + + ajv@8.20.0: + resolution: {integrity: sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA==} + + ansi-regex@6.6.0: + resolution: {integrity: sha512-XZ5apbzreCbXSKwPjJstu8R0zOi247w3XYwWxtwBXgpZrCyc1Ka7p9/xY0A9/diMewmHbEKz+FIraWaEWjlN5g==} + engines: {node: '>=12'} + + ansis@4.5.0: + resolution: {integrity: sha512-KwIVkfFfJSSzBmZhDGuTmkhWqTdyB5oNVzzznBJbBZ5bZtHiqSrcugRF0RKJKT4Ss3d7ZrcjnlFVDlQNmtWfWw==} + engines: {node: '>=14'} + + braces@3.0.3: + resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} + engines: {node: '>=8'} + + bun@1.4.4: + resolution: {integrity: sha512-hj0ASdG6PNjLZGFAXktWb3Uaj/dcv/1wCsIttoEXADNIQBsGjTr+5uLKYbrDkuc7NT0Tkj4yPIqJI2jDxXdvVg==} + cpu: [arm64, x64] + os: [darwin, linux, android, freebsd, win32] + hasBin: true + + bundle-name@4.1.1: + resolution: {integrity: sha512-DdH81/zPLVS11EUgWq3tEu/xn+EzljlMYooDNdzWEnFha3R3NBMpMV1UqYIpjYHV/SgpFKMIX1Oh7o06SjM/oA==} + engines: {node: '>=18'} + + chalk@5.6.2: + resolution: {integrity: sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA==} + engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} + + char-regex@1.0.2: + resolution: {integrity: sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==} + engines: {node: '>=10'} + + chardet@2.2.0: + resolution: {integrity: sha512-rddelWYNPRrXq6PtNEN2S3f6t9ILzvqaN5pVgi4kqt9jHQaXIial9PznB5iSPVlQSLNaaH22ItWz3EJtQ10+OA==} + + chokidar@5.0.0: + resolution: {integrity: sha512-TQMmc3w+5AxjpL8iIiwebF73dRDF4fBIieAqGn9RGCWaEVwQ6Fb2cGe31Yns0RRIzii5goJ1Y7xbMwo1TxMplw==} + engines: {node: '>= 20.19.0'} + + chownr@3.0.0: + resolution: {integrity: sha512-+IxzY9BZOQd/XuYPRmrvEVjF/nqj5kgT4kEq7VofrDoM1MxoRjEWkrCC3EtLi59TVawxTAn+orJwFQcrqEN1+g==} + engines: {node: '>=18'} + + class-transformer@0.5.1: + resolution: {integrity: sha512-SQa1Ws6hUbfC98vKGxZH3KFY0Y1lm5Zm0SY8XX9zbK7FJCyVEac3ATW0RIpwzW+oOfmHE5PMPufDG9hCfoEOMw==} + + class-validator@0.14.4: + resolution: {integrity: sha512-AwNusCCam51q703dW82x95tOqQp6oC9HNUl724KxJJOfnKscI8dOloXFgyez7LbTTKWuRBA37FScqVbJEoq8Yw==} + + class-validator@0.15.1: + resolution: {integrity: sha512-LqoS80HBBSCVhz/3KloUly0ovokxpdOLR++Al3J3+dHXWt9sTKlKd4eYtoxhxyUjoe5+UcIM+5k9MIxyBWnRTw==} + + cli-cursor@5.0.0: + resolution: {integrity: sha512-aCj4O5wKyszjMmDT4tZj93kxyydN/K5zPWSCe6/0AV/AA1pqe5ZBIw0a2ZfPQV7lL5/yb5HsUreJ6UFAF1tEQw==} + engines: {node: '>=18'} + + cli-spinners@3.4.0: + resolution: {integrity: sha512-bXfOC4QcT1tKXGorxL3wbJm6XJPDqEnij2gQ2m7ESQuE+/z9YFIWnl/5RpTiKWbMq3EVKR4fRLJGn6DVfu0mpw==} + engines: {node: '>=18.20'} + + cli-width@4.1.0: + resolution: {integrity: sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==} + engines: {node: '>= 12'} + + commander@15.1.0: + resolution: {integrity: sha512-cgnQ88TRrWcC7pVq46RzJVRMktu3W2RcbnoidnfBsl1bmDCBwJS/udcIZpKoCrbAYYaCqsz1yZCVIgbIaU3ddQ==} + engines: {node: '>=22.12.0'} + + default-browser-id@5.0.1: + resolution: {integrity: sha512-x1VCxdX4t+8wVfd1so/9w+vQ4vx7lKd2Qp5tDRutErwmR85OgmfX7RlLRMWafRMY7hbEiXIbudNrjOAPa/hL8Q==} + engines: {node: '>=18'} + + default-browser@5.5.1: + resolution: {integrity: sha512-m1pAzaJgZ/gssEqlOhJkPJp8Xly7QyW6xcrkUa2KKcDeDSEMP7X8xipU3snUcfisTQx0w1AGae+9UtJSfVnXGw==} + engines: {node: '>=18'} + + define-lazy-prop@3.0.0: + resolution: {integrity: sha512-N+MeXYoqr3pOgn8xfyRPREN7gHakLYjhsHhWGT3fWAiL4IkAt0iDw14QiiEm2bE30c5XX5q0FtAA3CK5f9/BUg==} + engines: {node: '>=12'} + + defu@6.1.7: + resolution: {integrity: sha512-7z22QmUWiQ/2d0KkdYmANbRUVABpZ9SNYyH5vx6PZ+nE5bcC0l7uFvEfHlyld/HcGBFTL536ClDt3DEcSlEJAQ==} + + destr@2.0.5: + resolution: {integrity: sha512-ugFTXCtDZunbzasqBxrK93Ik/DRYsO6S/fedkWEMKqt04xZ4csmnmwGDBAb07QWNaGMAmnTIemsYZCksjATwsA==} + + detect-libc@2.1.2: + resolution: {integrity: sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==} + engines: {node: '>=8'} + + dotenv@17.4.2: + resolution: {integrity: sha512-nI4U3TottKAcAD9LLud4Cb7b2QztQMUEfHbvhTH09bqXTxnSie8WnjPALV/WMCrJZ6UV/qHJ6L03OqO3LcdYZw==} + engines: {node: '>=12'} + + dotenv@18.0.10: + resolution: {integrity: sha512-89FAA1xchzK2mxVWdr5F/0rldwiueXs6zJM86rO66EzekR1iBdiXRthyG+m5GvkJaFH3C2LESzamTkgndmLT2A==} + engines: {node: '>=12'} + hasBin: true + + emojilib@2.4.0: + resolution: {integrity: sha512-5U0rVMU5Y2n2+ykNLQqMoqklN9ICBT/KsvC1Gz6vqHbz2AXXGkG+Pm5rMWk/8Vjrr/mY9985Hi8DYzn1F09Nyw==} + + fast-deep-equal@3.1.3: + resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} + + fast-string-truncated-width@3.0.3: + resolution: {integrity: sha512-0jjjIEL6+0jag3l2XWWizO64/aZVtpiGE3t0Zgqxv0DPuxiMjvB3M24fCyhZUO4KomJQPj3LTSUnDP3GpdwC0g==} + + fast-string-width@3.0.2: + resolution: {integrity: sha512-gX8LrtNEI5hq8DVUfRQMbr5lpaS4nMIWV+7XEbXk2b8kiQIizgnlr12B4dA3ZEx3308ze0O4Q1R+cHts8kyUJg==} + + fast-uri@3.1.9: + resolution: {integrity: sha512-hS/0Wt3Ya043oKXs0sIxrMpKQITXhMLIrVAKKXi4gozGC9v7YRWVnXIZzjNPTO02M9BdxLCWqK1yRXgNziVyJQ==} + + fast-wrap-ansi@0.2.2: + resolution: {integrity: sha512-7F2Fl+TjRSenLqlU3UjSH0iyqopqoZIu7eZVpEirP2g1GtWa2G/ecEmBdgz31+Mxr+ELclgg6sokpSFIQiZ02Q==} + + fflate@0.8.3: + resolution: {integrity: sha512-tbZNuJrLwGUp3zshBtdy4W+ORxZuIh8a5ilyIEQDC5rY1f3U20JMry0Ll3WBzU58EZKsEuJFXhb5gwv8CsPvgA==} + + fill-range@7.1.1: + resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} + engines: {node: '>=8'} + + get-east-asian-width@1.7.0: + resolution: {integrity: sha512-XjH1AECxf0giL2V1aU8vKyRR2ppRUb5c0EvT7zuJTokQ74bNo52zOtghqdWIqrhUD79fo3x0WfKZdOqxF6LG1Q==} + engines: {node: '>=18'} + + iconv-lite@0.7.3: + resolution: {integrity: sha512-IKXpvIzjnC9XTAUbVBcMfGS0EPaIXtW6v+zr+RRp+hqULEpo0owZax6wyRwPOJbWbzjYspQwusTsfVr0ifh4uQ==} + engines: {node: '>=0.10.0'} + + is-docker@3.0.0: + resolution: {integrity: sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + hasBin: true + + is-in-ssh@1.0.0: + resolution: {integrity: sha512-jYa6Q9rH90kR1vKB6NM7qqd1mge3Fx4Dhw5TVlK1MUBqhEOuCagrEHMevNuCcbECmXZ0ThXkRm+Ymr51HwEPAw==} + engines: {node: '>=20'} + + is-inside-container@1.0.0: + resolution: {integrity: sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA==} + engines: {node: '>=14.16'} + hasBin: true + + is-interactive@2.0.0: + resolution: {integrity: sha512-qP1vozQRI+BMOPcjFzrjXuQvdak2pHNUMZoeG2eRbiSqyvbEf/wQtEOTOX1guk6E3t36RkaqiSt8A/6YElNxLQ==} + engines: {node: '>=12'} + + is-number@7.0.0: + resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} + engines: {node: '>=0.12.0'} + + is-unicode-supported@2.1.0: + resolution: {integrity: sha512-mE00Gnza5EEB3Ds0HfMyllZzbBrmLOX3vfWoj9A9PEnTfratQ/BcaJOuMhnkhjXvb2+FkY3VuHqtAGpTPmglFQ==} + engines: {node: '>=18'} + + is-wsl@3.1.1: + resolution: {integrity: sha512-e6rvdUCiQCAuumZslxRJWR/Doq4VpPR82kqclvcS0efgt430SlGIk05vdCN58+VrzgtIcfNODjozVielycD4Sw==} + engines: {node: '>=16'} + + json-schema-traverse@1.0.0: + resolution: {integrity: sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==} + + jsonc-parser@3.3.1: + resolution: {integrity: sha512-HUgH65KyejrUFPvHFPbqOY0rsFip3Bo5wb4ngvdi1EpCYWUQDC5V+Y7mZws+DLkr4M//zQJoanu1SP+87Dv1oQ==} + + konva@10.9.1: + resolution: {integrity: sha512-m49x+GatSxEUSvqahYhxpTjgKbtrLtw4P4o4B4iux953ZFpceaK52Ea+CFsAsd7W4I0Y5u6mMoRUsY/eltNZmw==} + peerDependencies: + canvas: ^3.0.0 + skia-canvas: ^3.0.0 + peerDependenciesMeta: + canvas: + optional: true + skia-canvas: + optional: true + + libphonenumber-js@1.13.16: + resolution: {integrity: sha512-tIOCM9yx2Go6d5/ZANe0K+G4AZek1Ymx81HxQpf19Sri4zMP95eQbKdnUGHAvFQ4nx0PeLhFqvAfisTADXj3tQ==} + + log-symbols@7.0.1: + resolution: {integrity: sha512-ja1E3yCr9i/0hmBVaM0bfwDjnGy8I/s6PP4DFp+yP+a+mrHO4Rm7DtmnqROTUkHIkqffC84YY7AeqX6oFk0WFg==} + engines: {node: '>=18'} + + magic-string@1.4.1: + resolution: {integrity: sha512-8lyCu36ErXR0J9uaGKlKQoiLZKmtI63YGLE8G2o9jyRPdr4X47LusSOwgOJOzcVtp81fTAAjxR7BwKz682Jhow==} + + micromatch@4.0.8: + resolution: {integrity: sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==} + engines: {node: '>=8.6'} + + mimic-function@5.0.1: + resolution: {integrity: sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==} + engines: {node: '>=18'} + + minipass@7.1.3: + resolution: {integrity: sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A==} + engines: {node: '>=16 || 14 >=14.17'} + + minizlib@3.1.0: + resolution: {integrity: sha512-KZxYo1BUkWD2TVFLr0MQoM8vUUigWD3LlD83a/75BqC+4qE0Hb1Vo5v1FgcfaNXvfXzr+5EhQ6ing/CaBijTlw==} + engines: {node: '>= 18'} + + mute-stream@4.0.0: + resolution: {integrity: sha512-gSrprq0fJ3EiOErzjdIZrjysVVmJ4uu1QWfCDss5LypA5OXvrMje5Ym5z6V6RLyJ2eF87lasX7t6a0AnFvZblg==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + + node-datachannel@0.33.6: + resolution: {integrity: sha512-n7RzImzysrOVFx/lXfkQQ4fL0wsuPXBFc8KM69V29iyIor/UX7Ej+edzNGWJm+3mApZG9nkLi7FsGAZhQCDA4w==} + engines: {node: '>=18.20.0'} + + node-emoji@2.2.0: + resolution: {integrity: sha512-Z3lTE9pLaJF47NyMhd4ww1yFTAP8YhYI8SleJiHzM46Fgpm5cnNzSl9XfzFNqbaz+VlJrIj3fXQ4DeN1Rjm6cw==} + engines: {node: '>=18'} + + onetime@7.0.0: + resolution: {integrity: sha512-VXJjc87FScF88uafS3JllDgvAm+c/Slfz06lorj2uAY34rlUu0Nt+v8wreiImcrgAjjIHp1rXpTDlLOGw29WwQ==} + engines: {node: '>=18'} + + open@11.0.4: + resolution: {integrity: sha512-++Zlftm0kVLPmzC06t6epuWmcRMDbI4z5P3NNX979WA/k23+NtSOynEGzsVfZwguKw2mi5umVgnBlJQMwRz4Pg==} + engines: {node: '>=20'} + + ora@9.4.1: + resolution: {integrity: sha512-6VlU9MLXbjVQD04AZCMX28hVtA5bUoadvUqO76MUCVA0ilwJbMiHsITRPfyVm6p/BC0Av/BXMujx39WCe1LEqw==} + engines: {node: '>=20'} + + picomatch@2.3.2: + resolution: {integrity: sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==} + engines: {node: '>=8.6'} + + picomatch@4.0.7: + resolution: {integrity: sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA==} + engines: {node: '>=12'} + + powershell-utils@0.2.1: + resolution: {integrity: sha512-C+y9x90UElAddDZmV4qOx9W53B61PO7cIqWz2dQsWlwswuq4mr8NEwytdGKboYbQlGZ3awrkTeNvcZiZNHnQ8A==} + engines: {node: '>=20'} + + rc9@3.1.0: + resolution: {integrity: sha512-ufjkNVzbRHKcCOmTahZkmVsyc3W+MSk3jY03m+a7tGHkIsdVMG9l10/3HvFbWkkKzY5VFp3pkRsIo/UYgmFL7Q==} + + readdirp@5.1.1: + resolution: {integrity: sha512-Kko+Y5XQ6fM+Ce3dq3m9YGxnacYZYl9cA1wZjaF3Vbry2L3i1qVg8+CAgNPsXRArPMUMCaOR7oa9Nqntc43JKA==} + engines: {node: '>= 20.19.0'} + + require-from-string@2.0.2: + resolution: {integrity: sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==} + engines: {node: '>=0.10.0'} + + restore-cursor@5.1.0: + resolution: {integrity: sha512-oMA2dcrw6u0YfxJQXm342bFKX/E4sG9rbTzO9ptUcR/e8A33cHuvStiYOwH7fszkZlZ1z/ta9AAoPk2F4qIOHA==} + engines: {node: '>=18'} + + rolldown@1.3.2: + resolution: {integrity: sha512-EFHqbVkXiYZA6akmYm2bvJhNbEGdUwAResRhYwl/BO8QhB5KxsG+t3RVHJSIOy5jBEb0XCACvrIGnnl6Z8sMGA==} + engines: {node: ^20.19.0 || >=22.12.0} + hasBin: true + + run-applescript@7.1.0: + resolution: {integrity: sha512-DPe5pVFaAsinSaV6QjQ6gdiedWDcRCbUuiQfQa2wmWV7+xC9bGulGI8+TdRmoFkAPaBXk8CrAbnlY2ISniJ47Q==} + engines: {node: '>=18'} + + rxjs@7.8.2: + resolution: {integrity: sha512-dhKf903U/PQZY6boNNtAGdWbG85WAbjT/1xYoZIC7FAY0yWapOBQVsVrDl58W86//e1VpMNBtRV4MaXfdMySFA==} + + safer-buffer@2.1.2: + resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} + + semver@7.8.6: + resolution: {integrity: sha512-9lpSSU4Mly3mrtruwLs1eLK6+gzbzqeBFwRNjIjE+9LuDpWdYctrQlQ3ej1Ilgi7gknpsTRnPoLP8DpCHqHIJw==} + engines: {node: '>=10'} + hasBin: true + + signal-exit@4.1.0: + resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} + engines: {node: '>=14'} + + skin-tone@2.0.0: + resolution: {integrity: sha512-kUMbT1oBJCpgrnKoSr0o6wPtvRWT9W9UKvGLwfJYO2WuahZRHOpEyL1ckyMGgMWh0UdpmaoFqKKD29WTomNEGA==} + engines: {node: '>=8'} + + source-map@0.8.0: + resolution: {integrity: sha512-d8EqvL+k/SOXCreS/SUzg2ciyHqBBLcN/yuRjFsbvVhHTE2pgei7oAhmPM7kWFbkX6OSMQfUq4KbkF3au9lhYQ==} + engines: {node: '>= 12'} + + stdin-discarder@0.3.2: + resolution: {integrity: sha512-eCPu1qRxPVkl5605OTWF8Wz40b4Mf45NY5LQmVPQ599knfs5QhASUm9GbJ5BDMDOXgrnh0wyEdvzmL//YMlw0A==} + engines: {node: '>=18'} + + string-width@8.3.0: + resolution: {integrity: sha512-ZbmZM0JCihQN91dWnxoipT2KOEyHqEyfRXUyjuRhW8b/xnqPDoq4gWEVApTVa9db2wN8mmoikgFBbjh71+cGeQ==} + engines: {node: '>=20'} + + strip-ansi@7.2.0: + resolution: {integrity: sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==} + engines: {node: '>=12'} + + tar@7.5.23: + resolution: {integrity: sha512-lkukzdoGngZHJZXxW4S/E4Fp9ghTDlyZXrQGRNoJ/LXvDKcXUTq2sg5yQe74po7Voea6n/IN09+wE/QvJMiifA==} + engines: {node: '>=18'} + + to-regex-range@5.0.1: + resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} + engines: {node: '>=8.0'} + + tslib@2.9.1: + resolution: {integrity: sha512-a4Ux9VKuIMHsOS7ENbEq6hK2ZGYIT27Rtl0E4eD9KqwxhKiQeMZE/9xb3IdYwWaSOyIBQLExhQgXDTYoiCxnWA==} + + typescript@6.0.3: + resolution: {integrity: sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw==} + engines: {node: '>=14.17'} + hasBin: true + + unicode-emoji-modifier-base@1.0.0: + resolution: {integrity: sha512-yLSH4py7oFH3oG/9K+XWrz1pSi3dfUrWEnInbxMfArOfc1+33BlGPQtLsOYwvdMy11AwUBetYuaRxSPqgkq+8g==} + engines: {node: '>=4'} + + unrun@0.3.1: + resolution: {integrity: sha512-onIck/oNnCaytwths1ZVp1LK2Gq2hPoyFhiHebObuUXqR3S0uHuLLaBK8K6mRRgV7Ptip8AnNvaUsgzwWwBZuA==} + engines: {node: ^22.13.0 || >=24.0.0} + hasBin: true + peerDependencies: + synckit: ^0.11.11 + peerDependenciesMeta: + synckit: + optional: true + + validator@13.15.35: + resolution: {integrity: sha512-TQ5pAGhd5whStmqWvYF4OjQROlmv9SMFVt37qoCBdqRffuuklWYQlCNnEs2ZaIBD1kZRNnikiZOS1eqgkar0iw==} + engines: {node: '>= 0.10'} + + wsl-utils@1.0.1: + resolution: {integrity: sha512-c16PKLIRxBYpR3jSWsdS7SFp0COm5SOQdiFjY818dYFHJbMGuLBszpF07LBWmOS1uzrHa9VGdynsEgoeKy0oOQ==} + engines: {node: '>=20'} + + yallist@5.0.0: + resolution: {integrity: sha512-YgvUTfwqyc7UXVMrB+SImsVYSmTS8X/tSrtdNZMImM+n7+QTriRXyXim0mBrTXNeqzVF0KWGgHPeiyViFFrNDw==} + engines: {node: '>=18'} + + yoctocolors@2.2.0: + resolution: {integrity: sha512-xYqdZFUK/VYazNl/oCDYN+3WloWQwMfZxBoiNt6qNyk+xfOdi598muWE42rNZFp1kNOiqW936q5RhUdnpqElSg==} + engines: {node: '>=18'} + + zod@4.6.7: + resolution: {integrity: sha512-g8W2D2kU6a8untc053fX1uVBKzM7yqAxW/3zwk83+6RyF2+SKOuV+c0wBDhUwzV1PaGapmZH+rmcUzPf+3CGwg==} + +snapshots: + + '@angular-devkit/core@22.2.7(chokidar@5.0.0)': + dependencies: + ajv: 8.20.0 + ajv-formats: 3.0.1(ajv@8.20.0) + jsonc-parser: 3.3.1 + picomatch: 4.0.7 + rxjs: 7.8.2 + source-map: 0.8.0 + optionalDependencies: + chokidar: 5.0.0 + + '@angular-devkit/schematics-cli@22.2.7(chokidar@5.0.0)': + dependencies: + '@angular-devkit/core': 22.2.7(chokidar@5.0.0) + '@angular-devkit/schematics': 22.2.7(chokidar@5.0.0) + '@inquirer/prompts': 8.7.2 + transitivePeerDependencies: + - '@types/node' + - chokidar + + '@angular-devkit/schematics@22.2.7(chokidar@5.0.0)': + dependencies: + '@angular-devkit/core': 22.2.7(chokidar@5.0.0) + jsonc-parser: 3.3.1 + magic-string: 1.4.1 + ora: 9.4.1 + rxjs: 7.8.2 + transitivePeerDependencies: + - chokidar + + '@emnapi/core@2.0.0-beta.2': + dependencies: + '@emnapi/wasi-threads': 2.2.0 + tslib: 2.9.1 + optional: true + + '@emnapi/runtime@2.0.0-beta.2': + dependencies: + tslib: 2.9.1 + optional: true + + '@emnapi/wasi-threads@2.2.0': + dependencies: + tslib: 2.9.1 + optional: true + + '@inquirer/ansi@2.1.0': {} + + '@inquirer/checkbox@5.3.0': + dependencies: + '@inquirer/ansi': 2.1.0 + '@inquirer/core': 12.1.0 + '@inquirer/figures': 2.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/confirm@6.4.0': + dependencies: + '@inquirer/core': 12.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/core@12.1.0': + dependencies: + '@inquirer/ansi': 2.1.0 + '@inquirer/figures': 2.1.0 + '@inquirer/type': 4.3.0 + cli-width: 4.1.0 + fast-wrap-ansi: 0.2.2 + mute-stream: 4.0.0 + signal-exit: 4.1.0 + + '@inquirer/editor@5.4.0': + dependencies: + '@inquirer/core': 12.1.0 + '@inquirer/external-editor': 3.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/expand@5.2.0': + dependencies: + '@inquirer/core': 12.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/external-editor@3.1.0': + dependencies: + chardet: 2.2.0 + iconv-lite: 0.7.3 + + '@inquirer/figures@2.1.0': {} + + '@inquirer/input@5.2.0': + dependencies: + '@inquirer/core': 12.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/number@4.3.0': + dependencies: + '@inquirer/core': 12.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/password@5.3.0': + dependencies: + '@inquirer/ansi': 2.1.0 + '@inquirer/core': 12.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/prompts@8.7.2': + dependencies: + '@inquirer/checkbox': 5.3.0 + '@inquirer/confirm': 6.4.0 + '@inquirer/editor': 5.4.0 + '@inquirer/expand': 5.2.0 + '@inquirer/input': 5.2.0 + '@inquirer/number': 4.3.0 + '@inquirer/password': 5.3.0 + '@inquirer/rawlist': 5.4.0 + '@inquirer/search': 4.4.0 + '@inquirer/select': 5.3.0 + + '@inquirer/prompts@8.8.0': + dependencies: + '@inquirer/checkbox': 5.3.0 + '@inquirer/confirm': 6.4.0 + '@inquirer/editor': 5.4.0 + '@inquirer/expand': 5.2.0 + '@inquirer/input': 5.2.0 + '@inquirer/number': 4.3.0 + '@inquirer/password': 5.3.0 + '@inquirer/rawlist': 5.4.0 + '@inquirer/search': 4.4.0 + '@inquirer/select': 5.3.0 + + '@inquirer/rawlist@5.4.0': + dependencies: + '@inquirer/core': 12.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/search@4.4.0': + dependencies: + '@inquirer/core': 12.1.0 + '@inquirer/figures': 2.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/select@5.3.0': + dependencies: + '@inquirer/ansi': 2.1.0 + '@inquirer/core': 12.1.0 + '@inquirer/figures': 2.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/type@4.3.0': {} + + '@isaacs/fs-minipass@4.0.1': + dependencies: + minipass: 7.1.3 + + '@jridgewell/sourcemap-codec@1.6.0': {} + + '@nanoforge-dev/asset@3.0.0': + dependencies: + '@nanoforge-dev/common': 3.0.0 + + '@nanoforge-dev/cli@3.0.1': + dependencies: + '@angular-devkit/schematics': 22.2.7(chokidar@5.0.0) + '@angular-devkit/schematics-cli': 22.2.7(chokidar@5.0.0) + '@inquirer/prompts': 8.8.0 + '@nanoforge-dev/config': 3.0.1 + '@nanoforge-dev/editor': 0.1.4 + '@nanoforge-dev/loader-client': 1.7.0 + '@nanoforge-dev/loader-server': 1.7.0 + '@nanoforge-dev/registry': 3.0.1 + '@nanoforge-dev/schematics': 3.0.1(chokidar@5.0.0) + ansis: 4.5.0 + bun: 1.4.4 + chokidar: 5.0.0 + commander: 15.1.0 + dotenv: 18.0.10 + node-emoji: 2.2.0 + open: 11.0.4 + ora: 9.4.1 + rc9: 3.1.0 + transitivePeerDependencies: + - '@types/node' + - synckit + + '@nanoforge-dev/common@3.0.0': {} + + '@nanoforge-dev/config@3.0.1': + dependencies: + unrun: 0.3.1 + zod: 4.6.7 + transitivePeerDependencies: + - synckit + + '@nanoforge-dev/core@3.0.0': + dependencies: + '@nanoforge-dev/asset': 3.0.0 + '@nanoforge-dev/common': 3.0.0 + + '@nanoforge-dev/ecs@3.0.0(@nanoforge-dev/editor-lib@3.0.0)': + dependencies: + '@nanoforge-dev/common': 3.0.0 + optionalDependencies: + '@nanoforge-dev/editor-lib': 3.0.0 + + '@nanoforge-dev/editor-lib@3.0.0': + dependencies: + '@nanoforge-dev/common': 3.0.0 + + '@nanoforge-dev/editor@0.1.4': + dependencies: + bun: 1.4.4 + class-transformer: 0.5.1 + class-validator: 0.15.1 + dotenv: 17.4.2 + micromatch: 4.0.8 + tar: 7.5.23 + typescript: 6.0.3 + + '@nanoforge-dev/env@3.0.0': + dependencies: + '@nanoforge-dev/common': 3.0.0 + class-transformer: 0.5.1 + class-validator: 0.14.4 + + '@nanoforge-dev/graphics-2d@3.0.0': + dependencies: + '@nanoforge-dev/common': 3.0.0 + konva: 10.9.1 + transitivePeerDependencies: + - canvas + - skia-canvas + + '@nanoforge-dev/input@3.0.0': + dependencies: + '@nanoforge-dev/common': 3.0.0 + + '@nanoforge-dev/loader-client@1.7.0': + dependencies: + '@nanoforge-dev/loader-website': 1.7.0 + bun: 1.4.4 + commander: 15.1.0 + + '@nanoforge-dev/loader-server@1.7.0': + dependencies: + bun: 1.4.4 + commander: 15.1.0 + + '@nanoforge-dev/loader-website@1.7.0': {} + + '@nanoforge-dev/network@3.0.0(@nanoforge-dev/editor-lib@3.0.0)': + dependencies: + '@nanoforge-dev/common': 3.0.0 + '@nanoforge-dev/env': 3.0.0 + node-datachannel: 0.33.6 + optionalDependencies: + '@nanoforge-dev/editor-lib': 3.0.0 + + '@nanoforge-dev/registry@3.0.1': + dependencies: + fflate: 0.8.3 + semver: 7.8.6 + zod: 4.6.7 + + '@nanoforge-dev/schematics@3.0.1(chokidar@5.0.0)': + dependencies: + '@angular-devkit/core': 22.2.7(chokidar@5.0.0) + '@angular-devkit/schematics': 22.2.7(chokidar@5.0.0) + rxjs: 7.8.2 + transitivePeerDependencies: + - chokidar + + '@napi-rs/wasm-runtime@1.2.6(@emnapi/core@2.0.0-beta.2)(@emnapi/runtime@2.0.0-beta.2)': + dependencies: + '@emnapi/core': 2.0.0-beta.2 + '@emnapi/runtime': 2.0.0-beta.2 + '@tybys/wasm-util': 0.10.4 + optional: true + + '@node-datachannel/android-arm64@0.33.6': + optional: true + + '@node-datachannel/darwin-arm64@0.33.6': + optional: true + + '@node-datachannel/darwin-x64@0.33.6': + optional: true + + '@node-datachannel/linux-arm64-gnu@0.33.6': + optional: true + + '@node-datachannel/linux-arm64-musl@0.33.6': + optional: true + + '@node-datachannel/linux-x64-gnu@0.33.6': + optional: true + + '@node-datachannel/linux-x64-musl@0.33.6': + optional: true + + '@node-datachannel/win32-arm64-msvc@0.33.6': + optional: true + + '@node-datachannel/win32-x64-msvc@0.33.6': + optional: true + + '@oven/bun-darwin-aarch64@1.4.4': + optional: true + + '@oven/bun-darwin-x64@1.4.4': + optional: true + + '@oven/bun-freebsd-aarch64@1.4.4': + optional: true + + '@oven/bun-freebsd-x64@1.4.4': + optional: true + + '@oven/bun-linux-aarch64-android@1.4.4': + optional: true + + '@oven/bun-linux-aarch64-musl@1.4.4': + optional: true + + '@oven/bun-linux-aarch64@1.4.4': + optional: true + + '@oven/bun-linux-x64-android@1.4.4': + optional: true + + '@oven/bun-linux-x64-musl@1.4.4': + optional: true + + '@oven/bun-linux-x64@1.4.4': + optional: true + + '@oven/bun-windows-aarch64@1.4.4': + optional: true + + '@oven/bun-windows-x64@1.4.4': + optional: true + + '@oxc-project/types@0.158.0': {} + + '@rolldown/binding-android-arm-eabi@1.3.2': + optional: true + + '@rolldown/binding-android-arm64@1.3.2': + optional: true + + '@rolldown/binding-darwin-arm64@1.3.2': + optional: true + + '@rolldown/binding-darwin-x64@1.3.2': + optional: true + + '@rolldown/binding-freebsd-x64@1.3.2': + optional: true + + '@rolldown/binding-linux-arm-gnueabihf@1.3.2': + optional: true + + '@rolldown/binding-linux-arm64-gnu@1.3.2': + optional: true + + '@rolldown/binding-linux-arm64-musl@1.3.2': + optional: true + + '@rolldown/binding-linux-ppc64-gnu@1.3.2': + optional: true + + '@rolldown/binding-linux-s390x-gnu@1.3.2': + optional: true + + '@rolldown/binding-linux-x64-gnu@1.3.2': + optional: true + + '@rolldown/binding-linux-x64-musl@1.3.2': + optional: true + + '@rolldown/binding-openharmony-arm64@1.3.2': + optional: true + + '@rolldown/binding-wasm32-wasi@1.3.2': + dependencies: + '@emnapi/core': 2.0.0-beta.2 + '@emnapi/runtime': 2.0.0-beta.2 + '@napi-rs/wasm-runtime': 1.2.6(@emnapi/core@2.0.0-beta.2)(@emnapi/runtime@2.0.0-beta.2) + optional: true + + '@rolldown/binding-win32-arm64-msvc@1.3.2': + optional: true + + '@rolldown/binding-win32-x64-msvc@1.3.2': + optional: true + + '@rolldown/pluginutils@1.1.0': {} + + '@sindresorhus/is@4.6.0': {} + + '@tybys/wasm-util@0.10.4': + dependencies: + tslib: 2.9.1 + optional: true + + '@types/validator@13.15.10': {} + + ajv-formats@3.0.1(ajv@8.20.0): + optionalDependencies: + ajv: 8.20.0 + + ajv@8.20.0: + dependencies: + fast-deep-equal: 3.1.3 + fast-uri: 3.1.9 + json-schema-traverse: 1.0.0 + require-from-string: 2.0.2 + + ansi-regex@6.6.0: {} + + ansis@4.5.0: {} + + braces@3.0.3: + dependencies: + fill-range: 7.1.1 + + bun@1.4.4: + optionalDependencies: + '@oven/bun-darwin-aarch64': 1.4.4 + '@oven/bun-darwin-x64': 1.4.4 + '@oven/bun-freebsd-aarch64': 1.4.4 + '@oven/bun-freebsd-x64': 1.4.4 + '@oven/bun-linux-aarch64': 1.4.4 + '@oven/bun-linux-aarch64-android': 1.4.4 + '@oven/bun-linux-aarch64-musl': 1.4.4 + '@oven/bun-linux-x64': 1.4.4 + '@oven/bun-linux-x64-android': 1.4.4 + '@oven/bun-linux-x64-musl': 1.4.4 + '@oven/bun-windows-aarch64': 1.4.4 + '@oven/bun-windows-x64': 1.4.4 + + bundle-name@4.1.1: + dependencies: + run-applescript: 7.1.0 + + chalk@5.6.2: {} + + char-regex@1.0.2: {} + + chardet@2.2.0: {} + + chokidar@5.0.0: + dependencies: + readdirp: 5.1.1 + + chownr@3.0.0: {} + + class-transformer@0.5.1: {} + + class-validator@0.14.4: + dependencies: + '@types/validator': 13.15.10 + libphonenumber-js: 1.13.16 + validator: 13.15.35 + + class-validator@0.15.1: + dependencies: + '@types/validator': 13.15.10 + libphonenumber-js: 1.13.16 + validator: 13.15.35 + + cli-cursor@5.0.0: + dependencies: + restore-cursor: 5.1.0 + + cli-spinners@3.4.0: {} + + cli-width@4.1.0: {} + + commander@15.1.0: {} + + default-browser-id@5.0.1: {} + + default-browser@5.5.1: + dependencies: + bundle-name: 4.1.1 + default-browser-id: 5.0.1 + + define-lazy-prop@3.0.0: {} + + defu@6.1.7: {} + + destr@2.0.5: {} + + detect-libc@2.1.2: {} + + dotenv@17.4.2: {} + + dotenv@18.0.10: {} + + emojilib@2.4.0: {} + + fast-deep-equal@3.1.3: {} + + fast-string-truncated-width@3.0.3: {} + + fast-string-width@3.0.2: + dependencies: + fast-string-truncated-width: 3.0.3 + + fast-uri@3.1.9: {} + + fast-wrap-ansi@0.2.2: + dependencies: + fast-string-width: 3.0.2 + + fflate@0.8.3: {} + + fill-range@7.1.1: + dependencies: + to-regex-range: 5.0.1 + + get-east-asian-width@1.7.0: {} + + iconv-lite@0.7.3: + dependencies: + safer-buffer: 2.1.2 + + is-docker@3.0.0: {} + + is-in-ssh@1.0.0: {} + + is-inside-container@1.0.0: + dependencies: + is-docker: 3.0.0 + + is-interactive@2.0.0: {} + + is-number@7.0.0: {} + + is-unicode-supported@2.1.0: {} + + is-wsl@3.1.1: + dependencies: + is-inside-container: 1.0.0 + + json-schema-traverse@1.0.0: {} + + jsonc-parser@3.3.1: {} + + konva@10.9.1: {} + + libphonenumber-js@1.13.16: {} + + log-symbols@7.0.1: + dependencies: + is-unicode-supported: 2.1.0 + yoctocolors: 2.2.0 + + magic-string@1.4.1: + dependencies: + '@jridgewell/sourcemap-codec': 1.6.0 + + micromatch@4.0.8: + dependencies: + braces: 3.0.3 + picomatch: 2.3.2 + + mimic-function@5.0.1: {} + + minipass@7.1.3: {} + + minizlib@3.1.0: + dependencies: + minipass: 7.1.3 + + mute-stream@4.0.0: {} + + node-datachannel@0.33.6: + dependencies: + detect-libc: 2.1.2 + optionalDependencies: + '@node-datachannel/android-arm64': 0.33.6 + '@node-datachannel/darwin-arm64': 0.33.6 + '@node-datachannel/darwin-x64': 0.33.6 + '@node-datachannel/linux-arm64-gnu': 0.33.6 + '@node-datachannel/linux-arm64-musl': 0.33.6 + '@node-datachannel/linux-x64-gnu': 0.33.6 + '@node-datachannel/linux-x64-musl': 0.33.6 + '@node-datachannel/win32-arm64-msvc': 0.33.6 + '@node-datachannel/win32-x64-msvc': 0.33.6 + + node-emoji@2.2.0: + dependencies: + '@sindresorhus/is': 4.6.0 + char-regex: 1.0.2 + emojilib: 2.4.0 + skin-tone: 2.0.0 + + onetime@7.0.0: + dependencies: + mimic-function: 5.0.1 + + open@11.0.4: + dependencies: + default-browser: 5.5.1 + define-lazy-prop: 3.0.0 + is-in-ssh: 1.0.0 + is-inside-container: 1.0.0 + powershell-utils: 0.2.1 + wsl-utils: 1.0.1 + + ora@9.4.1: + dependencies: + chalk: 5.6.2 + cli-cursor: 5.0.0 + cli-spinners: 3.4.0 + is-interactive: 2.0.0 + is-unicode-supported: 2.1.0 + log-symbols: 7.0.1 + stdin-discarder: 0.3.2 + string-width: 8.3.0 + + picomatch@2.3.2: {} + + picomatch@4.0.7: {} + + powershell-utils@0.2.1: {} + + rc9@3.1.0: + dependencies: + defu: 6.1.7 + destr: 2.0.5 + + readdirp@5.1.1: {} + + require-from-string@2.0.2: {} + + restore-cursor@5.1.0: + dependencies: + onetime: 7.0.0 + signal-exit: 4.1.0 + + rolldown@1.3.2: + dependencies: + '@oxc-project/types': 0.158.0 + '@rolldown/pluginutils': 1.1.0 + optionalDependencies: + '@rolldown/binding-android-arm-eabi': 1.3.2 + '@rolldown/binding-android-arm64': 1.3.2 + '@rolldown/binding-darwin-arm64': 1.3.2 + '@rolldown/binding-darwin-x64': 1.3.2 + '@rolldown/binding-freebsd-x64': 1.3.2 + '@rolldown/binding-linux-arm-gnueabihf': 1.3.2 + '@rolldown/binding-linux-arm64-gnu': 1.3.2 + '@rolldown/binding-linux-arm64-musl': 1.3.2 + '@rolldown/binding-linux-ppc64-gnu': 1.3.2 + '@rolldown/binding-linux-s390x-gnu': 1.3.2 + '@rolldown/binding-linux-x64-gnu': 1.3.2 + '@rolldown/binding-linux-x64-musl': 1.3.2 + '@rolldown/binding-openharmony-arm64': 1.3.2 + '@rolldown/binding-wasm32-wasi': 1.3.2 + '@rolldown/binding-win32-arm64-msvc': 1.3.2 + '@rolldown/binding-win32-x64-msvc': 1.3.2 + + run-applescript@7.1.0: {} + + rxjs@7.8.2: + dependencies: + tslib: 2.9.1 + + safer-buffer@2.1.2: {} + + semver@7.8.6: {} + + signal-exit@4.1.0: {} + + skin-tone@2.0.0: + dependencies: + unicode-emoji-modifier-base: 1.0.0 + + source-map@0.8.0: {} + + stdin-discarder@0.3.2: {} + + string-width@8.3.0: + dependencies: + get-east-asian-width: 1.7.0 + strip-ansi: 7.2.0 + + strip-ansi@7.2.0: + dependencies: + ansi-regex: 6.6.0 + + tar@7.5.23: + dependencies: + '@isaacs/fs-minipass': 4.0.1 + chownr: 3.0.0 + minipass: 7.1.3 + minizlib: 3.1.0 + yallist: 5.0.0 + + to-regex-range@5.0.1: + dependencies: + is-number: 7.0.0 + + tslib@2.9.1: {} + + typescript@6.0.3: {} + + unicode-emoji-modifier-base@1.0.0: {} + + unrun@0.3.1: + dependencies: + rolldown: 1.3.2 + + validator@13.15.35: {} + + wsl-utils@1.0.1: + dependencies: + is-wsl: 3.1.1 + powershell-utils: 0.2.1 + + yallist@5.0.0: {} + + yoctocolors@2.2.0: {} + + zod@4.6.7: {} diff --git a/basics/network/pnpm-workspace.yaml b/basics/network/pnpm-workspace.yaml new file mode 100644 index 0000000..d509076 --- /dev/null +++ b/basics/network/pnpm-workspace.yaml @@ -0,0 +1,8 @@ +packages: + - "apps/*" + - "libs/*" +allowBuilds: + bun: true +# NanoForge packages are ours: take a release as soon as it is out. +minimumReleaseAgeExclude: + - "@nanoforge-dev/*" diff --git a/basics/network/tsconfig.json b/basics/network/tsconfig.json new file mode 100644 index 0000000..2f352d7 --- /dev/null +++ b/basics/network/tsconfig.json @@ -0,0 +1,41 @@ +{ + "$schema": "https://json.schemastore.org/tsconfig.json", + // Mapped from https://www.typescriptlang.org/tsconfig + "compilerOptions": { + // Type Checking + "allowUnreachableCode": false, + "allowUnusedLabels": false, + "noFallthroughCasesInSwitch": true, + "noImplicitOverride": true, + "noImplicitReturns": true, + "noPropertyAccessFromIndexSignature": false, + "noUncheckedIndexedAccess": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "strict": true, + + // Modules + "allowArbitraryExtensions": false, + "allowImportingTsExtensions": false, + "module": "ESNext", + "moduleResolution": "Bundler", + "resolveJsonModule": true, + "resolvePackageJsonExports": true, + "resolvePackageJsonImports": true, + + // Interop Constraints + "allowSyntheticDefaultImports": true, + "forceConsistentCasingInFileNames": true, + "isolatedModules": true, + + // Language and Environment + "experimentalDecorators": true, + "lib": ["ESNext", "esnext.disposable", "DOM"], + "target": "ESNext", + "useDefineForClassFields": true, + + // The shared library (libs/protocol), imported by package name + "paths": { "@network/protocol/*": ["./libs/protocol/src/*"] } + }, + "exclude": ["**/node_modules", "**/.nanoforge", "**/dist"] +} diff --git a/basics/scenes/.gitignore b/basics/scenes/.gitignore new file mode 100644 index 0000000..f28e2dc --- /dev/null +++ b/basics/scenes/.gitignore @@ -0,0 +1,5 @@ +node_modules/ +dist/ +.nanoforge/ +nf_modules/ +.env diff --git a/basics/scenes/README.md b/basics/scenes/README.md new file mode 100644 index 0000000..51a9c6d --- /dev/null +++ b/basics/scenes/README.md @@ -0,0 +1,23 @@ +# scenes + +Two rooms, red and blue: Space switches from one to the other. The bottom lines show two scene +vars. + +It shows the `scene` engine library and `EcsScene` (`@nanoforge-dev/ecs/scene`): + +- each room is a scene whose `setup` spawns its entities, like `main`; they are removed when the + scene is unloaded; +- `SceneLibrary` lists the scenes and loads `RedRoom` first; `switchSceneOnKey` calls + `ctx.scenes.load` to move to the other one; +- `room` is a var each room makes: it belongs to that room and goes away with it. + `switches` is `persistent`: it is kept across scenes. `src/scene-vars.ts` types them. + +```sh +pnpm install +pnpm dev # play it +pnpm editor # open it in the editor +``` + +`image-fill.ts`, the `Position2D`, `DrawableRect2D`, `DrawableCircle2D` and `DrawableText2D` +components and the `draw2D` system are copies of `shared/2d`, and `SceneVarText` with its +`showSceneVar` system of `shared/scenes` (see the repository's README). diff --git a/basics/scenes/assets/.gitkeep b/basics/scenes/assets/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/basics/scenes/nanoforge.config.ts b/basics/scenes/nanoforge.config.ts new file mode 100644 index 0000000..77607cb --- /dev/null +++ b/basics/scenes/nanoforge.config.ts @@ -0,0 +1,5 @@ +import { defineConfig } from "@nanoforge-dev/config"; + +export default defineConfig({ + type: "client", +}); diff --git a/basics/scenes/package.json b/basics/scenes/package.json new file mode 100644 index 0000000..f7c99e6 --- /dev/null +++ b/basics/scenes/package.json @@ -0,0 +1,27 @@ +{ + "$schema": "https://json.schemastore.org/package.json", + "name": "scenes", + "description": "Switch between two scenes with a key: the smallest NanoForge game made of scenes", + "private": true, + "type": "module", + "scripts": { + "dev": "nf dev", + "build": "nf build", + "start": "nf start", + "editor": "nf editor ." + }, + "devDependencies": { + "@nanoforge-dev/asset": "^3.0.0", + "@nanoforge-dev/cli": "^3.0.1", + "@nanoforge-dev/common": "^3.0.0", + "@nanoforge-dev/config": "^3.0.1", + "@nanoforge-dev/core": "^3.0.0", + "@nanoforge-dev/ecs": "^3.0.0", + "@nanoforge-dev/editor-lib": "^3.0.0", + "@nanoforge-dev/env": "^3.0.0", + "@nanoforge-dev/graphics-2d": "^3.0.0", + "@nanoforge-dev/input": "^3.0.0", + "@nanoforge-dev/scene": "^3.0.0", + "typescript": "^6.0.0" + } +} diff --git a/basics/scenes/pnpm-lock.yaml b/basics/scenes/pnpm-lock.yaml new file mode 100644 index 0000000..a1c8333 --- /dev/null +++ b/basics/scenes/pnpm-lock.yaml @@ -0,0 +1,1531 @@ +lockfileVersion: '9.0' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + +importers: + + .: + devDependencies: + '@nanoforge-dev/asset': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/cli': + specifier: ^3.0.1 + version: 3.0.1 + '@nanoforge-dev/common': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/config': + specifier: ^3.0.1 + version: 3.0.1 + '@nanoforge-dev/core': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/ecs': + specifier: ^3.0.0 + version: 3.0.0(@nanoforge-dev/editor-lib@3.0.0)(@nanoforge-dev/scene@3.0.0(@nanoforge-dev/editor-lib@3.0.0)) + '@nanoforge-dev/editor-lib': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/env': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/graphics-2d': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/input': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/scene': + specifier: ^3.0.0 + version: 3.0.0(@nanoforge-dev/editor-lib@3.0.0) + typescript: + specifier: ^6.0.0 + version: 6.0.3 + +packages: + + '@angular-devkit/core@22.2.7': + resolution: {integrity: sha512-cchZAMsV4d76RDZBlWzPhYxM/Hb6bmq71oUngdrwehMbBbdQu3W9C2tGlvxuPxbRKru9ZlUa14YVXQ0+QnhFtw==} + engines: {node: ^22.22.3 || ^24.15.0 || >=26.0.0, npm: ^6.11.0 || ^7.5.6 || >=8.0.0, yarn: '>= 1.13.0'} + peerDependencies: + chokidar: ^5.0.0 + peerDependenciesMeta: + chokidar: + optional: true + + '@angular-devkit/schematics-cli@22.2.7': + resolution: {integrity: sha512-9Od0E8TiYTQWm/03QjYWnsryZA8ZSjTf/k5z61nPd/jgloVNvSW8kxC7/YMw+RoXh2idMzjiJxraKxg+gJxzPw==} + engines: {node: ^22.22.3 || ^24.15.0 || >=26.0.0, npm: ^6.11.0 || ^7.5.6 || >=8.0.0, yarn: '>= 1.13.0'} + hasBin: true + + '@angular-devkit/schematics@22.2.7': + resolution: {integrity: sha512-a1h7xNqBLQVo1e5eCyOU3axSbA9AFU6nnSH5QhlNhggfMeZde+eBrueSt25xsewoxlKO8EvkVT3+knMUkDYiGQ==} + engines: {node: ^22.22.3 || ^24.15.0 || >=26.0.0, npm: ^6.11.0 || ^7.5.6 || >=8.0.0, yarn: '>= 1.13.0'} + + '@emnapi/core@2.0.0-beta.2': + resolution: {integrity: sha512-MzCVoWtcg4Pm2B3je5mMvYMvj3MmBKw+fU7vbsJc9/iT8ip6/eYIHo/Dsm/mr+wsHB6SEyJDuxB09Yy6r/8+4A==} + + '@emnapi/runtime@2.0.0-beta.2': + resolution: {integrity: sha512-JcrSPzPvZuNZvJqPTF9Fw25LbOJ8avzFVlaf2grmH4Cku0oGP47tRgqPZadcfj3YoZMHkFVnCYFbQM8I+i5QEw==} + + '@emnapi/wasi-threads@2.2.0': + resolution: {integrity: sha512-JP7OYH38Q7+pyTAe14raZHLQIK7BDKbdwji+Xi3pcd/6QkJYQH3SX4wu6EplGrGJWRepoNzedfm0G3B9Z4e9Rw==} + + '@inquirer/ansi@2.1.0': + resolution: {integrity: sha512-63GU5AD9KhNbWM0jlhHoMJTEFck2upFOPxHlnCKf3xYTV3rjTUUQfodihmTnfYQzMLS29oy8lK/gA1eJgu4bhA==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + + '@inquirer/checkbox@5.3.0': + resolution: {integrity: sha512-3QQSO87A+JoRtOtjtsgX2enwTL+3+VBVrkUpdqrIxMOgn5+W5sE57PcCPAiNUIESHxV4Q6mNEGxq2xLmRa0/yw==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/confirm@6.4.0': + resolution: {integrity: sha512-+DCZxrOF01Q/1SzTQkgycAQPS/Jf+Yol0h1P/MVmopukTsxGOu1h/LKqf30y0eHKFZYYrgUMVhGDhEbPmSPi9A==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/core@12.1.0': + resolution: {integrity: sha512-6H7usRWw4Gdjgpaem10CA5MfZ/xoYPGyInriR1Xubqjv+SVo8LIJ1erpFxW5JgCza6VZVZiKLTko7RtUU3AQMg==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/editor@5.4.0': + resolution: {integrity: sha512-L7vdCe4jnMpzhDisu1tAnr4WGvfPOVz+vNFXyIIL7O2Ycn/n90sn1ARvg+4cwzLf+us51BE/cX7uhnrLcal3+g==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/expand@5.2.0': + resolution: {integrity: sha512-AOp2KQk7QojUyWOP7VkqdBWmxLRaVH58wQMx3N4//P530EDtpVp1EWIjAJubx9ZohWS/UCEpIkA1TuiNki0iOA==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/external-editor@3.1.0': + resolution: {integrity: sha512-27JAkF38nXqXaoveU28iA/+Z8nutnF8B3JsbdToPHn9WnkrsMtZ0/YoJ29YwbtFexYIo+tIy6ikMvTdHKjjmGA==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/figures@2.1.0': + resolution: {integrity: sha512-CR9u2PME23jxy2SOyTb117efwAAPm98Zr+LoWI+PiQ55D6U8Yeu/HyFTxwytKhPa6oxAGzdsm2Kg7oLS6B9z8w==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + + '@inquirer/input@5.2.0': + resolution: {integrity: sha512-sIUPnN2X7M+7dq3RUd+e9QRacYnM+6B+kSucwQgj5VC5Eo/f+CIr2NyPBumxsViI+wzfokkgop/3x3KfHxNyJw==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/number@4.3.0': + resolution: {integrity: sha512-xYkX4sPVgox0F7yQwpz/MByWjOGdLEf1pdjH+Lji2gAzSs2xezz5bN5YgS1n0tx9wo0mRhGvq1KJGtvDZ9XXcQ==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/password@5.3.0': + resolution: {integrity: sha512-KVqW4G/UbMK06uBN76xF89JKYC9YBWU7v+Kc2tUwMCO8pg3ASBr0HVabl1KaSqF94O2KiRu8aKx4EicN78PK+A==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/prompts@8.7.2': + resolution: {integrity: sha512-QoRB4wFIjgH5iOhSjoIKMkTvSHDuV+O3OITlIqAYO0oK5x364GJILXiMBvlPiE+klg7Xx9tq5XVqQHcGUDYYPA==} + engines: {node: '>=23.5.0 || ^22.13.0 || ^20.17.0'} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/prompts@8.8.0': + resolution: {integrity: sha512-yYVT2Eo3mafb9tnU2Mr3+wh5wLCWyspExqVoPSMCIfBIn3ZUTE4IDfbCMbMgXaOH0tH+JZEhOtfczQhDzOjIGg==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/rawlist@5.4.0': + resolution: {integrity: sha512-x42wcy465GM5/mHNKBFdAJbLlLyzmYqr/DEa6F49nHpI+03EFwRCRKeLGQakx5XqZ4unc2yFuS78qAD4Rb0iFA==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/search@4.4.0': + resolution: {integrity: sha512-UJ+9tkzPT1AjnvjuPFYcOdO3BVeN28bfSXajYRFZTRgA9OiNl4k2Nn2cHHPwiIDyPHlvOnmE9ZOHyXhPHtvb+A==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/select@5.3.0': + resolution: {integrity: sha512-Fmgfl0qjqCQo+/tjQpgnRXKh5N7/VpYcJh+AlYU2eHmHZLMGUBDzo+Gwc2ODzWJfXNRZmgaMhz4qULcO/C/rXg==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/type@4.3.0': + resolution: {integrity: sha512-/IA8q2nyjgyl0NGSjqiRXB8gh3We7Pzx9C0c+6Zoolu905jFc79anerrUG7+n65+qs310DRK43yi2WDI8nY59A==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@isaacs/fs-minipass@4.0.1': + resolution: {integrity: sha512-wgm9Ehl2jpeqP3zw/7mo3kRHFp5MEDhqAdwy1fTGkHAwnkGOVsgpvQhL8B5n1qlb01jV3n/bI0ZfZp5lWA1k4w==} + engines: {node: '>=18.0.0'} + + '@jridgewell/sourcemap-codec@1.6.0': + resolution: {integrity: sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw==} + + '@nanoforge-dev/asset@3.0.0': + resolution: {integrity: sha512-jqXcyCMbdcCCj7wZ/dyIpjY8hza02Pt/vY8KrNcaXTlxpTc9EE+VKuO5+fHdUXWWPgJSFt96TqAPhug+z+KH3Q==} + engines: {node: '26'} + + '@nanoforge-dev/cli@3.0.1': + resolution: {integrity: sha512-ZfrbETcAcX3vsPLO1WLSCJc2ERCAcIpbdi9Df5bmH3XLinQkDAcESkN9JkaI/vgV08A7xhTjV8zSDSwF0T73Xg==} + engines: {node: '26'} + hasBin: true + + '@nanoforge-dev/common@3.0.0': + resolution: {integrity: sha512-lzMvQ1vCElh9OcP4EqhffbY+AQXOH4IiuD1pj7VvJlpcY6hh7Bs/s4NVS0gXoJ+ibpBMe5mAq23RyzqTwk8czg==} + engines: {node: '26'} + + '@nanoforge-dev/config@3.0.1': + resolution: {integrity: sha512-XWRScOotb8IirerRx/mWLmUVYye3lo0PN/5a0MUp/eoSrhz0S6zzhGHEupRuC8aeHTjsQT7ctM3P6YyKSHZLaQ==} + engines: {node: '26'} + + '@nanoforge-dev/core@3.0.0': + resolution: {integrity: sha512-pa7Fr3TFkZVfAADBC17Qt5ru/W9vXtYB8e5eb7wurAtu8/jH/ZtqfW3kafTuWC9513MXp/h6LOCdZQhjnCt6UA==} + engines: {node: '26'} + + '@nanoforge-dev/ecs@3.0.0': + resolution: {integrity: sha512-csrXJtCzqohxtvEQs+O//xabnaLR3BXe0QpSpl7NVihF3f0iX2fNYURxNjQKxzoPYBokCnnyNxN2KFc7UmIsdA==} + engines: {node: '26'} + peerDependencies: + '@nanoforge-dev/editor-lib': 3.0.0 + '@nanoforge-dev/scene': 3.0.0 + peerDependenciesMeta: + '@nanoforge-dev/editor-lib': + optional: true + '@nanoforge-dev/scene': + optional: true + + '@nanoforge-dev/editor-lib@3.0.0': + resolution: {integrity: sha512-fSWm6bHelbxqeVESYoUUKDi9RGNxvRu6p1r41KE1DddM0RrP0/WzkFOWBvgl+psHbYNotXe723Y2Fd3p+tqPDQ==} + engines: {node: '26'} + + '@nanoforge-dev/editor@0.1.4': + resolution: {integrity: sha512-bqbrH8ulFSiZz1iisJHtHeEzj1RV/70uErCYHeW4DIhVPsWbBfWKFvg/ghAbmPk5vsj0YnhDX6DSpik4S1QoiQ==} + engines: {node: '25'} + + '@nanoforge-dev/env@3.0.0': + resolution: {integrity: sha512-kXYXl9/09Bn8VStTTFuZY3dYDG9b76VhOi9PHMnaLe75XcFRLKJ2dYkXf3ut6RCL2+6H7HAEIOALjR15CHnJ5A==} + engines: {node: '26'} + + '@nanoforge-dev/graphics-2d@3.0.0': + resolution: {integrity: sha512-0I0WUr5495jORdYR+HtyP4kmAfCMvixmG+EH/gE5bN33S8RO6/Ly4oMLZOLUywcDTAFuLn28BlHuVor2YfXrsg==} + engines: {node: '26'} + + '@nanoforge-dev/input@3.0.0': + resolution: {integrity: sha512-8pWU28c99VAvn37onNbVFfwXTgyQGxm5DVnTdBEzgrF3KPCzU77kEaexB1AWOlga+4qNGU7/XNm3hNZ+YS49Ig==} + engines: {node: '26'} + + '@nanoforge-dev/loader-client@1.7.0': + resolution: {integrity: sha512-zDj0yQ8cZyHHjAYDVIyB79mh4dK7WRgZG7Kc+d/43t2WX/pX2HqBVkpLcDPkA9cNOKpCRYWd3LyYISlz53gzyg==} + engines: {node: '26'} + + '@nanoforge-dev/loader-server@1.7.0': + resolution: {integrity: sha512-Yd/BYORhoar5znNSD7kGirAc1Al0q5t8iscbb07QWKeXWA+DLKjPSuKJC6ykysFkbs9HiZU59oOfxyvNL4h3Pw==} + engines: {node: '26'} + + '@nanoforge-dev/loader-website@1.7.0': + resolution: {integrity: sha512-x1fV3RYUUxru39sF5HJcfutNnifMMTIEHW92jgkR9gz06ZlZ+rQofuegXgAnEzs0dEXa+rhNQ/iXYbqOZvq6YQ==} + engines: {node: '26'} + + '@nanoforge-dev/registry@3.0.1': + resolution: {integrity: sha512-EzSaszYtrPldD5Do7jdQK3TLLb8uCirY6NQjKXkeGw31X+sUXor4h5GAaoxELWMzPnv9BbKtggSaVaQIt7s8IQ==} + engines: {node: '26'} + + '@nanoforge-dev/scene@3.0.0': + resolution: {integrity: sha512-4+QajCZCW8eVdQPZeSoLDQ/ueQOFwAoFvd0pRL06FeuzWJMxCVNTCeZp9UHZLTMqmEJKAC29OnBQuHvhGkuBVg==} + engines: {node: '26'} + peerDependencies: + '@nanoforge-dev/editor-lib': 3.0.0 + peerDependenciesMeta: + '@nanoforge-dev/editor-lib': + optional: true + + '@nanoforge-dev/schematics@3.0.1': + resolution: {integrity: sha512-iK2vC0gPEh2mQ81IB4+jfGw/ZNOLMDnS9HRBXH5tWB0mdN5GA32viblhW0oYPX2/tWrLC9YiCPgEE4AL8Zwz6w==} + engines: {node: '26'} + + '@napi-rs/wasm-runtime@1.2.6': + resolution: {integrity: sha512-mRyDmEw9/fCDXCGfL1sbgIw/GUK0PVxRW4YwgPN61F3LQ+fSyoBFarJVzgGyhF6kRzEQZ0FejDqm4WLXSeqQmw==} + engines: {node: ^20.19.0 || ^22.13.0 || >=23.5.0} + peerDependencies: + '@emnapi/core': ^1.7.1 || 2.0.0-beta.2 + '@emnapi/runtime': ^1.7.1 || 2.0.0-beta.2 + + '@oven/bun-darwin-aarch64@1.4.4': + resolution: {integrity: sha512-zW/hxwc8sJAILGwB5eTC4i48ouGXf0V4lrxmEOk3JIE6JkYVW1TZh1E2pIempqsezgW1sckTIIDudFON8bJ2Mw==} + cpu: [arm64] + os: [darwin] + + '@oven/bun-darwin-x64@1.4.4': + resolution: {integrity: sha512-oKGcxLsvh4oHjAo28nPm8c/xN0o/OmGyj1IHYc94vprkWsW2hNg2keEZt5f40cI5Hvu4jDlSRTR0UNpv1UIAxw==} + cpu: [x64] + os: [darwin] + + '@oven/bun-freebsd-aarch64@1.4.4': + resolution: {integrity: sha512-klvA9FlwLxZj3JYIOPQA4bbnHIC3uas8kBE4GaGGkeVgAQP/k8hAzYkOqkSaqHBDbxLrTyFEQArEAevJq6NJzg==} + cpu: [arm64] + os: [freebsd] + + '@oven/bun-freebsd-x64@1.4.4': + resolution: {integrity: sha512-sF1xS/scbyN94P2d0eTiarO6JHxrIvhZNT9hnWjQXW5nwKRtfuP+UYnIMNyvW1BQPcZFP/cvfLBNUIe1ea4zPA==} + cpu: [x64] + os: [freebsd] + + '@oven/bun-linux-aarch64-android@1.4.4': + resolution: {integrity: sha512-5lvn3at5vRC0GxvmiqEiV2/e23tnRi0q5pzR40yfDvDA3OW7PSkt4chF1nA9vnAJhro4/l+ol1FmNP6D3cf/oA==} + cpu: [arm64] + os: [android] + + '@oven/bun-linux-aarch64-musl@1.4.4': + resolution: {integrity: sha512-QFd0P+mHJxbZFbUla4MgiE5OwxysHaUIYxL2pPNkpWtaI7v4ShOpr8OhBmsuyB0xn5rv/ZJnPsj2y8+bB9+g/A==} + cpu: [arm64] + os: [linux] + libc: [musl] + + '@oven/bun-linux-aarch64@1.4.4': + resolution: {integrity: sha512-ZTVtpf9zmHSBVPX1sBwe5agGb/rN34yPGg/Hby8e2Ax2uCUA2URZKlZH7qLntK7qaFJCMXh9v0GWNYN2zINz1w==} + cpu: [arm64] + os: [linux] + libc: [glibc] + + '@oven/bun-linux-x64-android@1.4.4': + resolution: {integrity: sha512-3dMicj9C1DhaIfDkwt/9GtpU0W+q+GazbG9OIlEyL3Q1BBEz2e6ZRz/JiO8D/ECC0caXAqvnpFudehcLlgIwWQ==} + cpu: [x64] + os: [android] + + '@oven/bun-linux-x64-musl@1.4.4': + resolution: {integrity: sha512-lEEjNOJJrbGZu2NVcPI4uXdILcpspezWkA8R/Jr0RCGhM6zQd0Y7JBIIKNAmbX59EeWpeEz7Q78iLbpcAUypUA==} + cpu: [x64] + os: [linux] + libc: [musl] + + '@oven/bun-linux-x64@1.4.4': + resolution: {integrity: sha512-CHbbkmHVM28T1GFq+6GL4Ao4ujwwYwj1CxFFwEFzLanPfNsId9AhbIP0Q4reWuWBkGimUkoQygrK7Rgjtj3vog==} + cpu: [x64] + os: [linux] + libc: [glibc] + + '@oven/bun-windows-aarch64@1.4.4': + resolution: {integrity: sha512-n0ep5ZRPCZY1+dqFJpnnRUZB1wy4GYU6At8RF+pyzySCLjkN9R4rFh2PtBHAgF/lg1vOl3/CeER3pDM+p40ATA==} + cpu: [arm64] + os: [win32] + + '@oven/bun-windows-x64@1.4.4': + resolution: {integrity: sha512-a3LNctBVO8PjePsFZfwDleF2JXYf2BfQ1u/PLRnBDLnC2Riml+4+LgJpKj4xRGhB92KweGyQI5PXaTkP9qypMQ==} + cpu: [x64] + os: [win32] + + '@oxc-project/types@0.158.0': + resolution: {integrity: sha512-xZ66qA4WmLbTLlxH3mqMd8f9UKbaOzOT0ATwFf4DH/14pMgpUrtqtjyYzOQmgfl2a0iRAAMbQ9G1th/67jRzGw==} + + '@rolldown/binding-android-arm-eabi@1.3.2': + resolution: {integrity: sha512-kqR2xcygEx3WwDY69LsKeyf7SVmx4yzMtKZRknyaHieVJdRvvnAM97L0Gq6tUFc9T2YXcW/Ghij2+Um6He0LTw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [android] + + '@rolldown/binding-android-arm64@1.3.2': + resolution: {integrity: sha512-gXM4GAAvvIZA7qUuSCQS+Zz91H2fagKa5MNppUdjzysJ8LXMWm9D/gQj4nfOKo6okquDQ5pkjsuo2SUMXNW0Rw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [android] + + '@rolldown/binding-darwin-arm64@1.3.2': + resolution: {integrity: sha512-OBs5hp3W+LwMEUmDMMMnu08ncG0t6DDgnFU+6TAucKtAfNgerYLZSr2jtREKb/JuPQ1J7bJnWIgKKkxvjuAw1g==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [darwin] + + '@rolldown/binding-darwin-x64@1.3.2': + resolution: {integrity: sha512-X0VGYd4v/gdjfa/IP6uHuMhofPoUDYvK/byk3bC0jQ1pKKgt6RZ4B4puMqP0AHkjmIHAsxA471mM6AxZ39IaTA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [darwin] + + '@rolldown/binding-freebsd-x64@1.3.2': + resolution: {integrity: sha512-mr04K4cp9J/fj9fknrX8e4QvI/V48Sp+4v64PoLwhoirIH8b8L8EBrF/0bTjV1It2IL91hoNG13GblnWLglkxA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [freebsd] + + '@rolldown/binding-linux-arm-gnueabihf@1.3.2': + resolution: {integrity: sha512-VgWy02HU9Tiy6tU8U+kF3Fd4TQwTNdIBvs2MlgViP1ksMtAnQQTIPAj0ZsJzIQXKIOugqQSpqxQgELJ3fkuL5w==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [linux] + + '@rolldown/binding-linux-arm64-gnu@1.3.2': + resolution: {integrity: sha512-0wloJFYqV844gv6boiERbHpErxbxHbmlgnMX5VxP1Ux+DLBqGrUOn0cIpBmCZEcTITes3QUelxya4u8c9ziQvQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-arm64-musl@1.3.2': + resolution: {integrity: sha512-Kys8wgFQy8H8vua0MNpC0akMBFoNO8455RHk2yycBM0iayMIAtVAL6xmV9TWAkehFgrrlImTL2fZdX5LXfYtAA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + libc: [musl] + + '@rolldown/binding-linux-ppc64-gnu@1.3.2': + resolution: {integrity: sha512-L8eej7+/StRxUHHOPsOVl7Fzx/3tumuGB4hGQZKT73xRI16KZhaSJr0gi3C3WBjNRxeJRKKps2UD4lQukP+oBw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [ppc64] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-s390x-gnu@1.3.2': + resolution: {integrity: sha512-MV5CEb/nV8neQOj7l6945q1vy62HXtWO8zPDvfySPusoUzdBoLoJ/DfXXwaYThGTXZCniF+5bCf253WTPPK7Yw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [s390x] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-x64-gnu@1.3.2': + resolution: {integrity: sha512-3qssvvVvkwQookZ1/1avlKWc5orAR85vgKdzDd5noZS8nnHiI/ejOAEt0xfNYvtBBF7/DZmP8dANWkRBJVOBCA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-x64-musl@1.3.2': + resolution: {integrity: sha512-rJqoFTm/bCZFKKgaT4NzWn/TuJkFDToZ/rzYFnYVBL28jH1nIfg6snx2mDri30nal9H+wcYfKpoPR9jrMQgQQg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + libc: [musl] + + '@rolldown/binding-openharmony-arm64@1.3.2': + resolution: {integrity: sha512-ozdbCjHfh0N//wJNExjJlSlcDaeIKo8k1ktzkLUyESr2Gu/Qw7nBYxKe3jgtoaxda570vg10WdYosre82263hQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [openharmony] + + '@rolldown/binding-wasm32-wasi@1.3.2': + resolution: {integrity: sha512-p5VA6Vk/2cXZPVWf+dDbuE0dkhrcoAo6pISTJmzUnsSdQqNJdusyR8lZgHku095+r27zrYISNLZnJoqrcePW0A==} + engines: {node: ^20.19.0 || ^22.13.0 || >=23.5.0} + cpu: [wasm32] + + '@rolldown/binding-win32-arm64-msvc@1.3.2': + resolution: {integrity: sha512-XDb2U14Orf4r76SwzvJ7avePL00w4gHBmi1Ig4B/itYFEUTmYMNDHVU0dcYuBa0LgNBqyREoJOrQKxQlyYJA7A==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [win32] + + '@rolldown/binding-win32-x64-msvc@1.3.2': + resolution: {integrity: sha512-lEsKzKJqIUDZVCBhS4lkZuyQUhV1oRg5UHkI72qlOAqJn7qEXcoVdTridFS7PHNWdZknBl95EAF/4P1Xv0K1eQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [win32] + + '@rolldown/pluginutils@1.1.0': + resolution: {integrity: sha512-K+NU2HDCEem4sClgHH4ZZXwdJeNFkJo+hRk479DIwdIviAPN2hFJH1KHHwg8CxHQXvi0M5XY4deTXINfIiSG6w==} + + '@sindresorhus/is@4.6.0': + resolution: {integrity: sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==} + engines: {node: '>=10'} + + '@tybys/wasm-util@0.10.4': + resolution: {integrity: sha512-W3c4gRigFS0T/Ma4qIYF3GDAc5AQdHb1yL5znJT1Zv1YaD9Kitx656wBjvr19qbiosmZT8lWDM5BEMynUqX65A==} + + '@types/validator@13.15.10': + resolution: {integrity: sha512-T8L6i7wCuyoK8A/ZeLYt1+q0ty3Zb9+qbSSvrIVitzT3YjZqkTZ40IbRsPanlB4h1QB3JVL1SYCdR6ngtFYcuA==} + + ajv-formats@3.0.1: + resolution: {integrity: sha512-8iUql50EUR+uUcdRQ3HDqa6EVyo3docL8g5WJ3FNcWmu62IbkGUue/pEyLBW8VGKKucTPgqeks4fIU1DA4yowQ==} + peerDependencies: + ajv: ^8.0.0 + peerDependenciesMeta: + ajv: + optional: true + + ajv@8.20.0: + resolution: {integrity: sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA==} + + ansi-regex@6.6.0: + resolution: {integrity: sha512-XZ5apbzreCbXSKwPjJstu8R0zOi247w3XYwWxtwBXgpZrCyc1Ka7p9/xY0A9/diMewmHbEKz+FIraWaEWjlN5g==} + engines: {node: '>=12'} + + ansis@4.5.0: + resolution: {integrity: sha512-KwIVkfFfJSSzBmZhDGuTmkhWqTdyB5oNVzzznBJbBZ5bZtHiqSrcugRF0RKJKT4Ss3d7ZrcjnlFVDlQNmtWfWw==} + engines: {node: '>=14'} + + braces@3.0.3: + resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} + engines: {node: '>=8'} + + bun@1.4.4: + resolution: {integrity: sha512-hj0ASdG6PNjLZGFAXktWb3Uaj/dcv/1wCsIttoEXADNIQBsGjTr+5uLKYbrDkuc7NT0Tkj4yPIqJI2jDxXdvVg==} + cpu: [arm64, x64] + os: [darwin, linux, android, freebsd, win32] + hasBin: true + + bundle-name@4.1.1: + resolution: {integrity: sha512-DdH81/zPLVS11EUgWq3tEu/xn+EzljlMYooDNdzWEnFha3R3NBMpMV1UqYIpjYHV/SgpFKMIX1Oh7o06SjM/oA==} + engines: {node: '>=18'} + + chalk@5.6.2: + resolution: {integrity: sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA==} + engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} + + char-regex@1.0.2: + resolution: {integrity: sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==} + engines: {node: '>=10'} + + chardet@2.2.0: + resolution: {integrity: sha512-rddelWYNPRrXq6PtNEN2S3f6t9ILzvqaN5pVgi4kqt9jHQaXIial9PznB5iSPVlQSLNaaH22ItWz3EJtQ10+OA==} + + chokidar@5.0.0: + resolution: {integrity: sha512-TQMmc3w+5AxjpL8iIiwebF73dRDF4fBIieAqGn9RGCWaEVwQ6Fb2cGe31Yns0RRIzii5goJ1Y7xbMwo1TxMplw==} + engines: {node: '>= 20.19.0'} + + chownr@3.0.0: + resolution: {integrity: sha512-+IxzY9BZOQd/XuYPRmrvEVjF/nqj5kgT4kEq7VofrDoM1MxoRjEWkrCC3EtLi59TVawxTAn+orJwFQcrqEN1+g==} + engines: {node: '>=18'} + + class-transformer@0.5.1: + resolution: {integrity: sha512-SQa1Ws6hUbfC98vKGxZH3KFY0Y1lm5Zm0SY8XX9zbK7FJCyVEac3ATW0RIpwzW+oOfmHE5PMPufDG9hCfoEOMw==} + + class-validator@0.14.4: + resolution: {integrity: sha512-AwNusCCam51q703dW82x95tOqQp6oC9HNUl724KxJJOfnKscI8dOloXFgyez7LbTTKWuRBA37FScqVbJEoq8Yw==} + + class-validator@0.15.1: + resolution: {integrity: sha512-LqoS80HBBSCVhz/3KloUly0ovokxpdOLR++Al3J3+dHXWt9sTKlKd4eYtoxhxyUjoe5+UcIM+5k9MIxyBWnRTw==} + + cli-cursor@5.0.0: + resolution: {integrity: sha512-aCj4O5wKyszjMmDT4tZj93kxyydN/K5zPWSCe6/0AV/AA1pqe5ZBIw0a2ZfPQV7lL5/yb5HsUreJ6UFAF1tEQw==} + engines: {node: '>=18'} + + cli-spinners@3.4.0: + resolution: {integrity: sha512-bXfOC4QcT1tKXGorxL3wbJm6XJPDqEnij2gQ2m7ESQuE+/z9YFIWnl/5RpTiKWbMq3EVKR4fRLJGn6DVfu0mpw==} + engines: {node: '>=18.20'} + + cli-width@4.1.0: + resolution: {integrity: sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==} + engines: {node: '>= 12'} + + commander@15.1.0: + resolution: {integrity: sha512-cgnQ88TRrWcC7pVq46RzJVRMktu3W2RcbnoidnfBsl1bmDCBwJS/udcIZpKoCrbAYYaCqsz1yZCVIgbIaU3ddQ==} + engines: {node: '>=22.12.0'} + + default-browser-id@5.0.1: + resolution: {integrity: sha512-x1VCxdX4t+8wVfd1so/9w+vQ4vx7lKd2Qp5tDRutErwmR85OgmfX7RlLRMWafRMY7hbEiXIbudNrjOAPa/hL8Q==} + engines: {node: '>=18'} + + default-browser@5.5.1: + resolution: {integrity: sha512-m1pAzaJgZ/gssEqlOhJkPJp8Xly7QyW6xcrkUa2KKcDeDSEMP7X8xipU3snUcfisTQx0w1AGae+9UtJSfVnXGw==} + engines: {node: '>=18'} + + define-lazy-prop@3.0.0: + resolution: {integrity: sha512-N+MeXYoqr3pOgn8xfyRPREN7gHakLYjhsHhWGT3fWAiL4IkAt0iDw14QiiEm2bE30c5XX5q0FtAA3CK5f9/BUg==} + engines: {node: '>=12'} + + defu@6.1.7: + resolution: {integrity: sha512-7z22QmUWiQ/2d0KkdYmANbRUVABpZ9SNYyH5vx6PZ+nE5bcC0l7uFvEfHlyld/HcGBFTL536ClDt3DEcSlEJAQ==} + + destr@2.0.5: + resolution: {integrity: sha512-ugFTXCtDZunbzasqBxrK93Ik/DRYsO6S/fedkWEMKqt04xZ4csmnmwGDBAb07QWNaGMAmnTIemsYZCksjATwsA==} + + dotenv@17.4.2: + resolution: {integrity: sha512-nI4U3TottKAcAD9LLud4Cb7b2QztQMUEfHbvhTH09bqXTxnSie8WnjPALV/WMCrJZ6UV/qHJ6L03OqO3LcdYZw==} + engines: {node: '>=12'} + + dotenv@18.0.10: + resolution: {integrity: sha512-89FAA1xchzK2mxVWdr5F/0rldwiueXs6zJM86rO66EzekR1iBdiXRthyG+m5GvkJaFH3C2LESzamTkgndmLT2A==} + engines: {node: '>=12'} + hasBin: true + + emojilib@2.4.0: + resolution: {integrity: sha512-5U0rVMU5Y2n2+ykNLQqMoqklN9ICBT/KsvC1Gz6vqHbz2AXXGkG+Pm5rMWk/8Vjrr/mY9985Hi8DYzn1F09Nyw==} + + fast-deep-equal@3.1.3: + resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} + + fast-string-truncated-width@3.0.3: + resolution: {integrity: sha512-0jjjIEL6+0jag3l2XWWizO64/aZVtpiGE3t0Zgqxv0DPuxiMjvB3M24fCyhZUO4KomJQPj3LTSUnDP3GpdwC0g==} + + fast-string-width@3.0.2: + resolution: {integrity: sha512-gX8LrtNEI5hq8DVUfRQMbr5lpaS4nMIWV+7XEbXk2b8kiQIizgnlr12B4dA3ZEx3308ze0O4Q1R+cHts8kyUJg==} + + fast-uri@3.1.9: + resolution: {integrity: sha512-hS/0Wt3Ya043oKXs0sIxrMpKQITXhMLIrVAKKXi4gozGC9v7YRWVnXIZzjNPTO02M9BdxLCWqK1yRXgNziVyJQ==} + + fast-wrap-ansi@0.2.2: + resolution: {integrity: sha512-7F2Fl+TjRSenLqlU3UjSH0iyqopqoZIu7eZVpEirP2g1GtWa2G/ecEmBdgz31+Mxr+ELclgg6sokpSFIQiZ02Q==} + + fflate@0.8.3: + resolution: {integrity: sha512-tbZNuJrLwGUp3zshBtdy4W+ORxZuIh8a5ilyIEQDC5rY1f3U20JMry0Ll3WBzU58EZKsEuJFXhb5gwv8CsPvgA==} + + fill-range@7.1.1: + resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} + engines: {node: '>=8'} + + get-east-asian-width@1.7.0: + resolution: {integrity: sha512-XjH1AECxf0giL2V1aU8vKyRR2ppRUb5c0EvT7zuJTokQ74bNo52zOtghqdWIqrhUD79fo3x0WfKZdOqxF6LG1Q==} + engines: {node: '>=18'} + + iconv-lite@0.7.3: + resolution: {integrity: sha512-IKXpvIzjnC9XTAUbVBcMfGS0EPaIXtW6v+zr+RRp+hqULEpo0owZax6wyRwPOJbWbzjYspQwusTsfVr0ifh4uQ==} + engines: {node: '>=0.10.0'} + + is-docker@3.0.0: + resolution: {integrity: sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + hasBin: true + + is-in-ssh@1.0.0: + resolution: {integrity: sha512-jYa6Q9rH90kR1vKB6NM7qqd1mge3Fx4Dhw5TVlK1MUBqhEOuCagrEHMevNuCcbECmXZ0ThXkRm+Ymr51HwEPAw==} + engines: {node: '>=20'} + + is-inside-container@1.0.0: + resolution: {integrity: sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA==} + engines: {node: '>=14.16'} + hasBin: true + + is-interactive@2.0.0: + resolution: {integrity: sha512-qP1vozQRI+BMOPcjFzrjXuQvdak2pHNUMZoeG2eRbiSqyvbEf/wQtEOTOX1guk6E3t36RkaqiSt8A/6YElNxLQ==} + engines: {node: '>=12'} + + is-number@7.0.0: + resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} + engines: {node: '>=0.12.0'} + + is-unicode-supported@2.1.0: + resolution: {integrity: sha512-mE00Gnza5EEB3Ds0HfMyllZzbBrmLOX3vfWoj9A9PEnTfratQ/BcaJOuMhnkhjXvb2+FkY3VuHqtAGpTPmglFQ==} + engines: {node: '>=18'} + + is-wsl@3.1.1: + resolution: {integrity: sha512-e6rvdUCiQCAuumZslxRJWR/Doq4VpPR82kqclvcS0efgt430SlGIk05vdCN58+VrzgtIcfNODjozVielycD4Sw==} + engines: {node: '>=16'} + + json-schema-traverse@1.0.0: + resolution: {integrity: sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==} + + jsonc-parser@3.3.1: + resolution: {integrity: sha512-HUgH65KyejrUFPvHFPbqOY0rsFip3Bo5wb4ngvdi1EpCYWUQDC5V+Y7mZws+DLkr4M//zQJoanu1SP+87Dv1oQ==} + + konva@10.9.1: + resolution: {integrity: sha512-m49x+GatSxEUSvqahYhxpTjgKbtrLtw4P4o4B4iux953ZFpceaK52Ea+CFsAsd7W4I0Y5u6mMoRUsY/eltNZmw==} + peerDependencies: + canvas: ^3.0.0 + skia-canvas: ^3.0.0 + peerDependenciesMeta: + canvas: + optional: true + skia-canvas: + optional: true + + libphonenumber-js@1.13.16: + resolution: {integrity: sha512-tIOCM9yx2Go6d5/ZANe0K+G4AZek1Ymx81HxQpf19Sri4zMP95eQbKdnUGHAvFQ4nx0PeLhFqvAfisTADXj3tQ==} + + log-symbols@7.0.1: + resolution: {integrity: sha512-ja1E3yCr9i/0hmBVaM0bfwDjnGy8I/s6PP4DFp+yP+a+mrHO4Rm7DtmnqROTUkHIkqffC84YY7AeqX6oFk0WFg==} + engines: {node: '>=18'} + + magic-string@1.4.1: + resolution: {integrity: sha512-8lyCu36ErXR0J9uaGKlKQoiLZKmtI63YGLE8G2o9jyRPdr4X47LusSOwgOJOzcVtp81fTAAjxR7BwKz682Jhow==} + + micromatch@4.0.8: + resolution: {integrity: sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==} + engines: {node: '>=8.6'} + + mimic-function@5.0.1: + resolution: {integrity: sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==} + engines: {node: '>=18'} + + minipass@7.1.3: + resolution: {integrity: sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A==} + engines: {node: '>=16 || 14 >=14.17'} + + minizlib@3.1.0: + resolution: {integrity: sha512-KZxYo1BUkWD2TVFLr0MQoM8vUUigWD3LlD83a/75BqC+4qE0Hb1Vo5v1FgcfaNXvfXzr+5EhQ6ing/CaBijTlw==} + engines: {node: '>= 18'} + + mute-stream@4.0.0: + resolution: {integrity: sha512-gSrprq0fJ3EiOErzjdIZrjysVVmJ4uu1QWfCDss5LypA5OXvrMje5Ym5z6V6RLyJ2eF87lasX7t6a0AnFvZblg==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + + node-emoji@2.2.0: + resolution: {integrity: sha512-Z3lTE9pLaJF47NyMhd4ww1yFTAP8YhYI8SleJiHzM46Fgpm5cnNzSl9XfzFNqbaz+VlJrIj3fXQ4DeN1Rjm6cw==} + engines: {node: '>=18'} + + onetime@7.0.0: + resolution: {integrity: sha512-VXJjc87FScF88uafS3JllDgvAm+c/Slfz06lorj2uAY34rlUu0Nt+v8wreiImcrgAjjIHp1rXpTDlLOGw29WwQ==} + engines: {node: '>=18'} + + open@11.0.4: + resolution: {integrity: sha512-++Zlftm0kVLPmzC06t6epuWmcRMDbI4z5P3NNX979WA/k23+NtSOynEGzsVfZwguKw2mi5umVgnBlJQMwRz4Pg==} + engines: {node: '>=20'} + + ora@9.4.1: + resolution: {integrity: sha512-6VlU9MLXbjVQD04AZCMX28hVtA5bUoadvUqO76MUCVA0ilwJbMiHsITRPfyVm6p/BC0Av/BXMujx39WCe1LEqw==} + engines: {node: '>=20'} + + picomatch@2.3.2: + resolution: {integrity: sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==} + engines: {node: '>=8.6'} + + picomatch@4.0.7: + resolution: {integrity: sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA==} + engines: {node: '>=12'} + + powershell-utils@0.2.1: + resolution: {integrity: sha512-C+y9x90UElAddDZmV4qOx9W53B61PO7cIqWz2dQsWlwswuq4mr8NEwytdGKboYbQlGZ3awrkTeNvcZiZNHnQ8A==} + engines: {node: '>=20'} + + rc9@3.1.0: + resolution: {integrity: sha512-ufjkNVzbRHKcCOmTahZkmVsyc3W+MSk3jY03m+a7tGHkIsdVMG9l10/3HvFbWkkKzY5VFp3pkRsIo/UYgmFL7Q==} + + readdirp@5.1.1: + resolution: {integrity: sha512-Kko+Y5XQ6fM+Ce3dq3m9YGxnacYZYl9cA1wZjaF3Vbry2L3i1qVg8+CAgNPsXRArPMUMCaOR7oa9Nqntc43JKA==} + engines: {node: '>= 20.19.0'} + + require-from-string@2.0.2: + resolution: {integrity: sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==} + engines: {node: '>=0.10.0'} + + restore-cursor@5.1.0: + resolution: {integrity: sha512-oMA2dcrw6u0YfxJQXm342bFKX/E4sG9rbTzO9ptUcR/e8A33cHuvStiYOwH7fszkZlZ1z/ta9AAoPk2F4qIOHA==} + engines: {node: '>=18'} + + rolldown@1.3.2: + resolution: {integrity: sha512-EFHqbVkXiYZA6akmYm2bvJhNbEGdUwAResRhYwl/BO8QhB5KxsG+t3RVHJSIOy5jBEb0XCACvrIGnnl6Z8sMGA==} + engines: {node: ^20.19.0 || >=22.12.0} + hasBin: true + + run-applescript@7.1.0: + resolution: {integrity: sha512-DPe5pVFaAsinSaV6QjQ6gdiedWDcRCbUuiQfQa2wmWV7+xC9bGulGI8+TdRmoFkAPaBXk8CrAbnlY2ISniJ47Q==} + engines: {node: '>=18'} + + rxjs@7.8.2: + resolution: {integrity: sha512-dhKf903U/PQZY6boNNtAGdWbG85WAbjT/1xYoZIC7FAY0yWapOBQVsVrDl58W86//e1VpMNBtRV4MaXfdMySFA==} + + safer-buffer@2.1.2: + resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} + + semver@7.8.6: + resolution: {integrity: sha512-9lpSSU4Mly3mrtruwLs1eLK6+gzbzqeBFwRNjIjE+9LuDpWdYctrQlQ3ej1Ilgi7gknpsTRnPoLP8DpCHqHIJw==} + engines: {node: '>=10'} + hasBin: true + + signal-exit@4.1.0: + resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} + engines: {node: '>=14'} + + skin-tone@2.0.0: + resolution: {integrity: sha512-kUMbT1oBJCpgrnKoSr0o6wPtvRWT9W9UKvGLwfJYO2WuahZRHOpEyL1ckyMGgMWh0UdpmaoFqKKD29WTomNEGA==} + engines: {node: '>=8'} + + source-map@0.8.0: + resolution: {integrity: sha512-d8EqvL+k/SOXCreS/SUzg2ciyHqBBLcN/yuRjFsbvVhHTE2pgei7oAhmPM7kWFbkX6OSMQfUq4KbkF3au9lhYQ==} + engines: {node: '>= 12'} + + stdin-discarder@0.3.2: + resolution: {integrity: sha512-eCPu1qRxPVkl5605OTWF8Wz40b4Mf45NY5LQmVPQ599knfs5QhASUm9GbJ5BDMDOXgrnh0wyEdvzmL//YMlw0A==} + engines: {node: '>=18'} + + string-width@8.3.0: + resolution: {integrity: sha512-ZbmZM0JCihQN91dWnxoipT2KOEyHqEyfRXUyjuRhW8b/xnqPDoq4gWEVApTVa9db2wN8mmoikgFBbjh71+cGeQ==} + engines: {node: '>=20'} + + strip-ansi@7.2.0: + resolution: {integrity: sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==} + engines: {node: '>=12'} + + tar@7.5.23: + resolution: {integrity: sha512-lkukzdoGngZHJZXxW4S/E4Fp9ghTDlyZXrQGRNoJ/LXvDKcXUTq2sg5yQe74po7Voea6n/IN09+wE/QvJMiifA==} + engines: {node: '>=18'} + + to-regex-range@5.0.1: + resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} + engines: {node: '>=8.0'} + + tslib@2.9.1: + resolution: {integrity: sha512-a4Ux9VKuIMHsOS7ENbEq6hK2ZGYIT27Rtl0E4eD9KqwxhKiQeMZE/9xb3IdYwWaSOyIBQLExhQgXDTYoiCxnWA==} + + typescript@6.0.3: + resolution: {integrity: sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw==} + engines: {node: '>=14.17'} + hasBin: true + + unicode-emoji-modifier-base@1.0.0: + resolution: {integrity: sha512-yLSH4py7oFH3oG/9K+XWrz1pSi3dfUrWEnInbxMfArOfc1+33BlGPQtLsOYwvdMy11AwUBetYuaRxSPqgkq+8g==} + engines: {node: '>=4'} + + unrun@0.3.1: + resolution: {integrity: sha512-onIck/oNnCaytwths1ZVp1LK2Gq2hPoyFhiHebObuUXqR3S0uHuLLaBK8K6mRRgV7Ptip8AnNvaUsgzwWwBZuA==} + engines: {node: ^22.13.0 || >=24.0.0} + hasBin: true + peerDependencies: + synckit: ^0.11.11 + peerDependenciesMeta: + synckit: + optional: true + + validator@13.15.35: + resolution: {integrity: sha512-TQ5pAGhd5whStmqWvYF4OjQROlmv9SMFVt37qoCBdqRffuuklWYQlCNnEs2ZaIBD1kZRNnikiZOS1eqgkar0iw==} + engines: {node: '>= 0.10'} + + wsl-utils@1.0.1: + resolution: {integrity: sha512-c16PKLIRxBYpR3jSWsdS7SFp0COm5SOQdiFjY818dYFHJbMGuLBszpF07LBWmOS1uzrHa9VGdynsEgoeKy0oOQ==} + engines: {node: '>=20'} + + yallist@5.0.0: + resolution: {integrity: sha512-YgvUTfwqyc7UXVMrB+SImsVYSmTS8X/tSrtdNZMImM+n7+QTriRXyXim0mBrTXNeqzVF0KWGgHPeiyViFFrNDw==} + engines: {node: '>=18'} + + yoctocolors@2.2.0: + resolution: {integrity: sha512-xYqdZFUK/VYazNl/oCDYN+3WloWQwMfZxBoiNt6qNyk+xfOdi598muWE42rNZFp1kNOiqW936q5RhUdnpqElSg==} + engines: {node: '>=18'} + + zod@4.6.7: + resolution: {integrity: sha512-g8W2D2kU6a8untc053fX1uVBKzM7yqAxW/3zwk83+6RyF2+SKOuV+c0wBDhUwzV1PaGapmZH+rmcUzPf+3CGwg==} + +snapshots: + + '@angular-devkit/core@22.2.7(chokidar@5.0.0)': + dependencies: + ajv: 8.20.0 + ajv-formats: 3.0.1(ajv@8.20.0) + jsonc-parser: 3.3.1 + picomatch: 4.0.7 + rxjs: 7.8.2 + source-map: 0.8.0 + optionalDependencies: + chokidar: 5.0.0 + + '@angular-devkit/schematics-cli@22.2.7(chokidar@5.0.0)': + dependencies: + '@angular-devkit/core': 22.2.7(chokidar@5.0.0) + '@angular-devkit/schematics': 22.2.7(chokidar@5.0.0) + '@inquirer/prompts': 8.7.2 + transitivePeerDependencies: + - '@types/node' + - chokidar + + '@angular-devkit/schematics@22.2.7(chokidar@5.0.0)': + dependencies: + '@angular-devkit/core': 22.2.7(chokidar@5.0.0) + jsonc-parser: 3.3.1 + magic-string: 1.4.1 + ora: 9.4.1 + rxjs: 7.8.2 + transitivePeerDependencies: + - chokidar + + '@emnapi/core@2.0.0-beta.2': + dependencies: + '@emnapi/wasi-threads': 2.2.0 + tslib: 2.9.1 + optional: true + + '@emnapi/runtime@2.0.0-beta.2': + dependencies: + tslib: 2.9.1 + optional: true + + '@emnapi/wasi-threads@2.2.0': + dependencies: + tslib: 2.9.1 + optional: true + + '@inquirer/ansi@2.1.0': {} + + '@inquirer/checkbox@5.3.0': + dependencies: + '@inquirer/ansi': 2.1.0 + '@inquirer/core': 12.1.0 + '@inquirer/figures': 2.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/confirm@6.4.0': + dependencies: + '@inquirer/core': 12.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/core@12.1.0': + dependencies: + '@inquirer/ansi': 2.1.0 + '@inquirer/figures': 2.1.0 + '@inquirer/type': 4.3.0 + cli-width: 4.1.0 + fast-wrap-ansi: 0.2.2 + mute-stream: 4.0.0 + signal-exit: 4.1.0 + + '@inquirer/editor@5.4.0': + dependencies: + '@inquirer/core': 12.1.0 + '@inquirer/external-editor': 3.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/expand@5.2.0': + dependencies: + '@inquirer/core': 12.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/external-editor@3.1.0': + dependencies: + chardet: 2.2.0 + iconv-lite: 0.7.3 + + '@inquirer/figures@2.1.0': {} + + '@inquirer/input@5.2.0': + dependencies: + '@inquirer/core': 12.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/number@4.3.0': + dependencies: + '@inquirer/core': 12.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/password@5.3.0': + dependencies: + '@inquirer/ansi': 2.1.0 + '@inquirer/core': 12.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/prompts@8.7.2': + dependencies: + '@inquirer/checkbox': 5.3.0 + '@inquirer/confirm': 6.4.0 + '@inquirer/editor': 5.4.0 + '@inquirer/expand': 5.2.0 + '@inquirer/input': 5.2.0 + '@inquirer/number': 4.3.0 + '@inquirer/password': 5.3.0 + '@inquirer/rawlist': 5.4.0 + '@inquirer/search': 4.4.0 + '@inquirer/select': 5.3.0 + + '@inquirer/prompts@8.8.0': + dependencies: + '@inquirer/checkbox': 5.3.0 + '@inquirer/confirm': 6.4.0 + '@inquirer/editor': 5.4.0 + '@inquirer/expand': 5.2.0 + '@inquirer/input': 5.2.0 + '@inquirer/number': 4.3.0 + '@inquirer/password': 5.3.0 + '@inquirer/rawlist': 5.4.0 + '@inquirer/search': 4.4.0 + '@inquirer/select': 5.3.0 + + '@inquirer/rawlist@5.4.0': + dependencies: + '@inquirer/core': 12.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/search@4.4.0': + dependencies: + '@inquirer/core': 12.1.0 + '@inquirer/figures': 2.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/select@5.3.0': + dependencies: + '@inquirer/ansi': 2.1.0 + '@inquirer/core': 12.1.0 + '@inquirer/figures': 2.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/type@4.3.0': {} + + '@isaacs/fs-minipass@4.0.1': + dependencies: + minipass: 7.1.3 + + '@jridgewell/sourcemap-codec@1.6.0': {} + + '@nanoforge-dev/asset@3.0.0': + dependencies: + '@nanoforge-dev/common': 3.0.0 + + '@nanoforge-dev/cli@3.0.1': + dependencies: + '@angular-devkit/schematics': 22.2.7(chokidar@5.0.0) + '@angular-devkit/schematics-cli': 22.2.7(chokidar@5.0.0) + '@inquirer/prompts': 8.8.0 + '@nanoforge-dev/config': 3.0.1 + '@nanoforge-dev/editor': 0.1.4 + '@nanoforge-dev/loader-client': 1.7.0 + '@nanoforge-dev/loader-server': 1.7.0 + '@nanoforge-dev/registry': 3.0.1 + '@nanoforge-dev/schematics': 3.0.1(chokidar@5.0.0) + ansis: 4.5.0 + bun: 1.4.4 + chokidar: 5.0.0 + commander: 15.1.0 + dotenv: 18.0.10 + node-emoji: 2.2.0 + open: 11.0.4 + ora: 9.4.1 + rc9: 3.1.0 + transitivePeerDependencies: + - '@types/node' + - synckit + + '@nanoforge-dev/common@3.0.0': {} + + '@nanoforge-dev/config@3.0.1': + dependencies: + unrun: 0.3.1 + zod: 4.6.7 + transitivePeerDependencies: + - synckit + + '@nanoforge-dev/core@3.0.0': + dependencies: + '@nanoforge-dev/asset': 3.0.0 + '@nanoforge-dev/common': 3.0.0 + + '@nanoforge-dev/ecs@3.0.0(@nanoforge-dev/editor-lib@3.0.0)(@nanoforge-dev/scene@3.0.0(@nanoforge-dev/editor-lib@3.0.0))': + dependencies: + '@nanoforge-dev/common': 3.0.0 + optionalDependencies: + '@nanoforge-dev/editor-lib': 3.0.0 + '@nanoforge-dev/scene': 3.0.0(@nanoforge-dev/editor-lib@3.0.0) + + '@nanoforge-dev/editor-lib@3.0.0': + dependencies: + '@nanoforge-dev/common': 3.0.0 + + '@nanoforge-dev/editor@0.1.4': + dependencies: + bun: 1.4.4 + class-transformer: 0.5.1 + class-validator: 0.15.1 + dotenv: 17.4.2 + micromatch: 4.0.8 + tar: 7.5.23 + typescript: 6.0.3 + + '@nanoforge-dev/env@3.0.0': + dependencies: + '@nanoforge-dev/common': 3.0.0 + class-transformer: 0.5.1 + class-validator: 0.14.4 + + '@nanoforge-dev/graphics-2d@3.0.0': + dependencies: + '@nanoforge-dev/common': 3.0.0 + konva: 10.9.1 + transitivePeerDependencies: + - canvas + - skia-canvas + + '@nanoforge-dev/input@3.0.0': + dependencies: + '@nanoforge-dev/common': 3.0.0 + + '@nanoforge-dev/loader-client@1.7.0': + dependencies: + '@nanoforge-dev/loader-website': 1.7.0 + bun: 1.4.4 + commander: 15.1.0 + + '@nanoforge-dev/loader-server@1.7.0': + dependencies: + bun: 1.4.4 + commander: 15.1.0 + + '@nanoforge-dev/loader-website@1.7.0': {} + + '@nanoforge-dev/registry@3.0.1': + dependencies: + fflate: 0.8.3 + semver: 7.8.6 + zod: 4.6.7 + + '@nanoforge-dev/scene@3.0.0(@nanoforge-dev/editor-lib@3.0.0)': + dependencies: + '@nanoforge-dev/common': 3.0.0 + optionalDependencies: + '@nanoforge-dev/editor-lib': 3.0.0 + + '@nanoforge-dev/schematics@3.0.1(chokidar@5.0.0)': + dependencies: + '@angular-devkit/core': 22.2.7(chokidar@5.0.0) + '@angular-devkit/schematics': 22.2.7(chokidar@5.0.0) + rxjs: 7.8.2 + transitivePeerDependencies: + - chokidar + + '@napi-rs/wasm-runtime@1.2.6(@emnapi/core@2.0.0-beta.2)(@emnapi/runtime@2.0.0-beta.2)': + dependencies: + '@emnapi/core': 2.0.0-beta.2 + '@emnapi/runtime': 2.0.0-beta.2 + '@tybys/wasm-util': 0.10.4 + optional: true + + '@oven/bun-darwin-aarch64@1.4.4': + optional: true + + '@oven/bun-darwin-x64@1.4.4': + optional: true + + '@oven/bun-freebsd-aarch64@1.4.4': + optional: true + + '@oven/bun-freebsd-x64@1.4.4': + optional: true + + '@oven/bun-linux-aarch64-android@1.4.4': + optional: true + + '@oven/bun-linux-aarch64-musl@1.4.4': + optional: true + + '@oven/bun-linux-aarch64@1.4.4': + optional: true + + '@oven/bun-linux-x64-android@1.4.4': + optional: true + + '@oven/bun-linux-x64-musl@1.4.4': + optional: true + + '@oven/bun-linux-x64@1.4.4': + optional: true + + '@oven/bun-windows-aarch64@1.4.4': + optional: true + + '@oven/bun-windows-x64@1.4.4': + optional: true + + '@oxc-project/types@0.158.0': {} + + '@rolldown/binding-android-arm-eabi@1.3.2': + optional: true + + '@rolldown/binding-android-arm64@1.3.2': + optional: true + + '@rolldown/binding-darwin-arm64@1.3.2': + optional: true + + '@rolldown/binding-darwin-x64@1.3.2': + optional: true + + '@rolldown/binding-freebsd-x64@1.3.2': + optional: true + + '@rolldown/binding-linux-arm-gnueabihf@1.3.2': + optional: true + + '@rolldown/binding-linux-arm64-gnu@1.3.2': + optional: true + + '@rolldown/binding-linux-arm64-musl@1.3.2': + optional: true + + '@rolldown/binding-linux-ppc64-gnu@1.3.2': + optional: true + + '@rolldown/binding-linux-s390x-gnu@1.3.2': + optional: true + + '@rolldown/binding-linux-x64-gnu@1.3.2': + optional: true + + '@rolldown/binding-linux-x64-musl@1.3.2': + optional: true + + '@rolldown/binding-openharmony-arm64@1.3.2': + optional: true + + '@rolldown/binding-wasm32-wasi@1.3.2': + dependencies: + '@emnapi/core': 2.0.0-beta.2 + '@emnapi/runtime': 2.0.0-beta.2 + '@napi-rs/wasm-runtime': 1.2.6(@emnapi/core@2.0.0-beta.2)(@emnapi/runtime@2.0.0-beta.2) + optional: true + + '@rolldown/binding-win32-arm64-msvc@1.3.2': + optional: true + + '@rolldown/binding-win32-x64-msvc@1.3.2': + optional: true + + '@rolldown/pluginutils@1.1.0': {} + + '@sindresorhus/is@4.6.0': {} + + '@tybys/wasm-util@0.10.4': + dependencies: + tslib: 2.9.1 + optional: true + + '@types/validator@13.15.10': {} + + ajv-formats@3.0.1(ajv@8.20.0): + optionalDependencies: + ajv: 8.20.0 + + ajv@8.20.0: + dependencies: + fast-deep-equal: 3.1.3 + fast-uri: 3.1.9 + json-schema-traverse: 1.0.0 + require-from-string: 2.0.2 + + ansi-regex@6.6.0: {} + + ansis@4.5.0: {} + + braces@3.0.3: + dependencies: + fill-range: 7.1.1 + + bun@1.4.4: + optionalDependencies: + '@oven/bun-darwin-aarch64': 1.4.4 + '@oven/bun-darwin-x64': 1.4.4 + '@oven/bun-freebsd-aarch64': 1.4.4 + '@oven/bun-freebsd-x64': 1.4.4 + '@oven/bun-linux-aarch64': 1.4.4 + '@oven/bun-linux-aarch64-android': 1.4.4 + '@oven/bun-linux-aarch64-musl': 1.4.4 + '@oven/bun-linux-x64': 1.4.4 + '@oven/bun-linux-x64-android': 1.4.4 + '@oven/bun-linux-x64-musl': 1.4.4 + '@oven/bun-windows-aarch64': 1.4.4 + '@oven/bun-windows-x64': 1.4.4 + + bundle-name@4.1.1: + dependencies: + run-applescript: 7.1.0 + + chalk@5.6.2: {} + + char-regex@1.0.2: {} + + chardet@2.2.0: {} + + chokidar@5.0.0: + dependencies: + readdirp: 5.1.1 + + chownr@3.0.0: {} + + class-transformer@0.5.1: {} + + class-validator@0.14.4: + dependencies: + '@types/validator': 13.15.10 + libphonenumber-js: 1.13.16 + validator: 13.15.35 + + class-validator@0.15.1: + dependencies: + '@types/validator': 13.15.10 + libphonenumber-js: 1.13.16 + validator: 13.15.35 + + cli-cursor@5.0.0: + dependencies: + restore-cursor: 5.1.0 + + cli-spinners@3.4.0: {} + + cli-width@4.1.0: {} + + commander@15.1.0: {} + + default-browser-id@5.0.1: {} + + default-browser@5.5.1: + dependencies: + bundle-name: 4.1.1 + default-browser-id: 5.0.1 + + define-lazy-prop@3.0.0: {} + + defu@6.1.7: {} + + destr@2.0.5: {} + + dotenv@17.4.2: {} + + dotenv@18.0.10: {} + + emojilib@2.4.0: {} + + fast-deep-equal@3.1.3: {} + + fast-string-truncated-width@3.0.3: {} + + fast-string-width@3.0.2: + dependencies: + fast-string-truncated-width: 3.0.3 + + fast-uri@3.1.9: {} + + fast-wrap-ansi@0.2.2: + dependencies: + fast-string-width: 3.0.2 + + fflate@0.8.3: {} + + fill-range@7.1.1: + dependencies: + to-regex-range: 5.0.1 + + get-east-asian-width@1.7.0: {} + + iconv-lite@0.7.3: + dependencies: + safer-buffer: 2.1.2 + + is-docker@3.0.0: {} + + is-in-ssh@1.0.0: {} + + is-inside-container@1.0.0: + dependencies: + is-docker: 3.0.0 + + is-interactive@2.0.0: {} + + is-number@7.0.0: {} + + is-unicode-supported@2.1.0: {} + + is-wsl@3.1.1: + dependencies: + is-inside-container: 1.0.0 + + json-schema-traverse@1.0.0: {} + + jsonc-parser@3.3.1: {} + + konva@10.9.1: {} + + libphonenumber-js@1.13.16: {} + + log-symbols@7.0.1: + dependencies: + is-unicode-supported: 2.1.0 + yoctocolors: 2.2.0 + + magic-string@1.4.1: + dependencies: + '@jridgewell/sourcemap-codec': 1.6.0 + + micromatch@4.0.8: + dependencies: + braces: 3.0.3 + picomatch: 2.3.2 + + mimic-function@5.0.1: {} + + minipass@7.1.3: {} + + minizlib@3.1.0: + dependencies: + minipass: 7.1.3 + + mute-stream@4.0.0: {} + + node-emoji@2.2.0: + dependencies: + '@sindresorhus/is': 4.6.0 + char-regex: 1.0.2 + emojilib: 2.4.0 + skin-tone: 2.0.0 + + onetime@7.0.0: + dependencies: + mimic-function: 5.0.1 + + open@11.0.4: + dependencies: + default-browser: 5.5.1 + define-lazy-prop: 3.0.0 + is-in-ssh: 1.0.0 + is-inside-container: 1.0.0 + powershell-utils: 0.2.1 + wsl-utils: 1.0.1 + + ora@9.4.1: + dependencies: + chalk: 5.6.2 + cli-cursor: 5.0.0 + cli-spinners: 3.4.0 + is-interactive: 2.0.0 + is-unicode-supported: 2.1.0 + log-symbols: 7.0.1 + stdin-discarder: 0.3.2 + string-width: 8.3.0 + + picomatch@2.3.2: {} + + picomatch@4.0.7: {} + + powershell-utils@0.2.1: {} + + rc9@3.1.0: + dependencies: + defu: 6.1.7 + destr: 2.0.5 + + readdirp@5.1.1: {} + + require-from-string@2.0.2: {} + + restore-cursor@5.1.0: + dependencies: + onetime: 7.0.0 + signal-exit: 4.1.0 + + rolldown@1.3.2: + dependencies: + '@oxc-project/types': 0.158.0 + '@rolldown/pluginutils': 1.1.0 + optionalDependencies: + '@rolldown/binding-android-arm-eabi': 1.3.2 + '@rolldown/binding-android-arm64': 1.3.2 + '@rolldown/binding-darwin-arm64': 1.3.2 + '@rolldown/binding-darwin-x64': 1.3.2 + '@rolldown/binding-freebsd-x64': 1.3.2 + '@rolldown/binding-linux-arm-gnueabihf': 1.3.2 + '@rolldown/binding-linux-arm64-gnu': 1.3.2 + '@rolldown/binding-linux-arm64-musl': 1.3.2 + '@rolldown/binding-linux-ppc64-gnu': 1.3.2 + '@rolldown/binding-linux-s390x-gnu': 1.3.2 + '@rolldown/binding-linux-x64-gnu': 1.3.2 + '@rolldown/binding-linux-x64-musl': 1.3.2 + '@rolldown/binding-openharmony-arm64': 1.3.2 + '@rolldown/binding-wasm32-wasi': 1.3.2 + '@rolldown/binding-win32-arm64-msvc': 1.3.2 + '@rolldown/binding-win32-x64-msvc': 1.3.2 + + run-applescript@7.1.0: {} + + rxjs@7.8.2: + dependencies: + tslib: 2.9.1 + + safer-buffer@2.1.2: {} + + semver@7.8.6: {} + + signal-exit@4.1.0: {} + + skin-tone@2.0.0: + dependencies: + unicode-emoji-modifier-base: 1.0.0 + + source-map@0.8.0: {} + + stdin-discarder@0.3.2: {} + + string-width@8.3.0: + dependencies: + get-east-asian-width: 1.7.0 + strip-ansi: 7.2.0 + + strip-ansi@7.2.0: + dependencies: + ansi-regex: 6.6.0 + + tar@7.5.23: + dependencies: + '@isaacs/fs-minipass': 4.0.1 + chownr: 3.0.0 + minipass: 7.1.3 + minizlib: 3.1.0 + yallist: 5.0.0 + + to-regex-range@5.0.1: + dependencies: + is-number: 7.0.0 + + tslib@2.9.1: {} + + typescript@6.0.3: {} + + unicode-emoji-modifier-base@1.0.0: {} + + unrun@0.3.1: + dependencies: + rolldown: 1.3.2 + + validator@13.15.35: {} + + wsl-utils@1.0.1: + dependencies: + is-wsl: 3.1.1 + powershell-utils: 0.2.1 + + yallist@5.0.0: {} + + yoctocolors@2.2.0: {} + + zod@4.6.7: {} diff --git a/basics/scenes/pnpm-workspace.yaml b/basics/scenes/pnpm-workspace.yaml new file mode 100644 index 0000000..96ca535 --- /dev/null +++ b/basics/scenes/pnpm-workspace.yaml @@ -0,0 +1,5 @@ +allowBuilds: + bun: true +# NanoForge packages are ours: take a release as soon as it is out. +minimumReleaseAgeExclude: + - "@nanoforge-dev/*" diff --git a/basics/scenes/src/components/drawable-circle-2d.component.ts b/basics/scenes/src/components/drawable-circle-2d.component.ts new file mode 100644 index 0000000..1066155 --- /dev/null +++ b/basics/scenes/src/components/drawable-circle-2d.component.ts @@ -0,0 +1,62 @@ +import type { AssetContext } from "@nanoforge-dev/common"; +import { Circle, type Layer } from "@nanoforge-dev/graphics-2d"; +import type { Position2D } from "./position-2d.component"; + +import { imageFill } from "../image-fill"; + +/** + * Draws a circle at the entity's `Position2D` (its center). Needs the `draw2D` system. + * + * @remarks + * `shape` is the Konva `Circle` on screen: change it from code for anything the parameters don't + * offer (shadows, strokes...). + * + * @component + * @side client + * @group Shape color=#e86fb0 - Size of the circle. + * @group Look color=#b18cff - What the circle looks like. + * @group Advanced hidden - Less common settings. + */ +export class DrawableCircle2D { + name = "DrawableCircle2D"; + + /** The circle on screen, made by `draw2D` the first time it draws it. */ + shape?: Circle; + + constructor( + /** In pixels. @group Shape */ + public radius = 25, + /** A CSS color: `red`, `#ff0000`, `rgba(255, 0, 0, 0.5)`... @group Look @preset color */ + public fillColor = "#4aa3ff", + /** An image stretched over the circle, shown instead of the color. @group Look @asset .png .jpg .jpeg .gif .webp .svg */ + public image = "", + /** From 0 (invisible) to 1 (opaque). @group Look */ + public opacity = 1, + /** Clockwise, in degrees, around the center. @group Advanced */ + public rotation = 0, + /** Whether it is drawn. @group Advanced */ + public visible = true, + ) {} + + /** Puts the circle on `layer` at `position`, up to date with the parameters. */ + draw(layer: Layer, position: Position2D, assets: AssetContext): void { + this.shape ??= new Circle(); + if (this.shape.getParent() !== layer) layer.add(this.shape); + this.shape.setAttrs({ + x: position.x, + y: position.y, + radius: this.radius, + fill: this.fillColor, + opacity: this.opacity, + rotation: this.rotation, + visible: this.visible, + ...imageFill(assets, this.image, this.radius * 2, this.radius * 2, true), + }); + } + + /** Removes the circle from the screen. */ + destroy(): void { + this.shape?.destroy(); + this.shape = undefined; + } +} diff --git a/basics/scenes/src/components/drawable-rect-2d.component.ts b/basics/scenes/src/components/drawable-rect-2d.component.ts new file mode 100644 index 0000000..d3586ca --- /dev/null +++ b/basics/scenes/src/components/drawable-rect-2d.component.ts @@ -0,0 +1,69 @@ +import type { AssetContext } from "@nanoforge-dev/common"; +import { type Layer, Rect } from "@nanoforge-dev/graphics-2d"; +import type { Position2D } from "./position-2d.component"; + +import { imageFill } from "../image-fill"; + +/** + * Draws a rectangle at the entity's `Position2D` (its top-left corner). Needs the `draw2D` + * system. + * + * @remarks + * `shape` is the Konva `Rect` on screen: change it from code for anything the parameters don't + * offer (shadows, strokes...). + * + * @component + * @side client + * @group Shape color=#e86fb0 - Size of the rectangle. + * @group Look color=#b18cff - What the rectangle looks like. + * @group Advanced hidden - Less common settings. + */ +export class DrawableRect2D { + name = "DrawableRect2D"; + + /** The rectangle on screen, made by `draw2D` the first time it draws it. */ + shape?: Rect; + + constructor( + /** In pixels. @group Shape @preset size.width */ + public width = 50, + /** In pixels. @group Shape @preset size.height */ + public height = 50, + /** A CSS color: `red`, `#ff0000`, `rgba(255, 0, 0, 0.5)`... @group Look @preset color */ + public fillColor = "#4aa3ff", + /** An image stretched over the rectangle, shown instead of the color. @group Look @asset .png .jpg .jpeg .gif .webp .svg */ + public image = "", + /** From 0 (invisible) to 1 (opaque). @group Look */ + public opacity = 1, + /** Clockwise, in degrees, around the top-left corner. @group Advanced */ + public rotation = 0, + /** Rounds the corners, in pixels. @group Advanced */ + public cornerRadius = 0, + /** Whether it is drawn. @group Advanced */ + public visible = true, + ) {} + + /** Puts the rectangle on `layer` at `position`, up to date with the parameters. */ + draw(layer: Layer, position: Position2D, assets: AssetContext): void { + this.shape ??= new Rect(); + if (this.shape.getParent() !== layer) layer.add(this.shape); + this.shape.setAttrs({ + x: position.x, + y: position.y, + width: this.width, + height: this.height, + fill: this.fillColor, + opacity: this.opacity, + rotation: this.rotation, + cornerRadius: this.cornerRadius, + visible: this.visible, + ...imageFill(assets, this.image, this.width, this.height), + }); + } + + /** Removes the rectangle from the screen. */ + destroy(): void { + this.shape?.destroy(); + this.shape = undefined; + } +} diff --git a/basics/scenes/src/components/drawable-text-2d.component.ts b/basics/scenes/src/components/drawable-text-2d.component.ts new file mode 100644 index 0000000..adba963 --- /dev/null +++ b/basics/scenes/src/components/drawable-text-2d.component.ts @@ -0,0 +1,62 @@ +import { type Layer, Text } from "@nanoforge-dev/graphics-2d"; +import type { Position2D } from "./position-2d.component"; + +/** + * Draws a text at the entity's `Position2D` (its top-left corner). Needs the `draw2D` system. + * + * @remarks + * Change `text` from a system to show a score, a timer... `shape` is the Konva `Text` on screen: + * change it from code for anything the parameters don't offer. + * + * @component + * @side client + * @group Text color=#e86fb0 - What is written. + * @group Look color=#b18cff - What the text looks like. + * @group Advanced hidden - Less common settings. + */ +export class DrawableText2D { + name = "DrawableText2D"; + + /** The text on screen, made by `draw2D` the first time it draws it. */ + shape?: Text; + + constructor( + /** What is written. @group Text */ + public text = "Hello", + /** Height of the letters, in pixels. @group Text */ + public fontSize = 24, + /** A CSS color: `white`, `#ffffff`... @group Look @preset color */ + public fillColor = "#ffffff", + /** From 0 (invisible) to 1 (opaque). @group Look */ + public opacity = 1, + /** A CSS font family: `Arial`, `monospace`... @group Advanced */ + public fontFamily = "Arial", + /** Clockwise, in degrees, around the top-left corner. @group Advanced */ + public rotation = 0, + /** Whether it is drawn. @group Advanced */ + public visible = true, + ) {} + + /** Puts the text on `layer` at `position`, up to date with the parameters. */ + draw(layer: Layer, position: Position2D): void { + this.shape ??= new Text(); + if (this.shape.getParent() !== layer) layer.add(this.shape); + this.shape.setAttrs({ + x: position.x, + y: position.y, + text: this.text, + fontSize: this.fontSize, + fontFamily: this.fontFamily, + fill: this.fillColor, + opacity: this.opacity, + rotation: this.rotation, + visible: this.visible, + }); + } + + /** Removes the text from the screen. */ + destroy(): void { + this.shape?.destroy(); + this.shape = undefined; + } +} diff --git a/basics/scenes/src/components/position-2d.component.ts b/basics/scenes/src/components/position-2d.component.ts new file mode 100644 index 0000000..0a35624 --- /dev/null +++ b/basics/scenes/src/components/position-2d.component.ts @@ -0,0 +1,20 @@ +/** + * Where an entity is, in pixels from the top-left corner of the screen. + * + * @remarks + * For rectangles it is their top-left corner, for circles their center. + * + * @component + * @side shared + * @group Position color=#4aa3ff - Pixels from the top-left corner of the screen. + */ +export class Position2D { + name = "Position2D"; + + constructor( + /** Pixels from the left edge. @group Position @preset vector.x */ + public x = 0, + /** Pixels from the top edge. @group Position @preset vector.y */ + public y = 0, + ) {} +} diff --git a/basics/scenes/src/components/scene-switch-key.component.ts b/basics/scenes/src/components/scene-switch-key.component.ts new file mode 100644 index 0000000..26b7d0b --- /dev/null +++ b/basics/scenes/src/components/scene-switch-key.component.ts @@ -0,0 +1,19 @@ +import { InputEnum } from "@nanoforge-dev/input"; + +/** + * Switches between the red and the blue room with a key. Needs the `switchSceneOnKey` system. + * + * @component + * @side client + */ +export class SceneSwitchKey { + name = "SceneSwitchKey"; + + /** Whether the key was down last frame, set by `switchSceneOnKey`. */ + held = false; + + constructor( + /** The key that switches rooms. */ + public key: InputEnum = InputEnum.Space, + ) {} +} diff --git a/basics/scenes/src/components/scene-var-text.component.ts b/basics/scenes/src/components/scene-var-text.component.ts new file mode 100644 index 0000000..5eaa09a --- /dev/null +++ b/basics/scenes/src/components/scene-var-text.component.ts @@ -0,0 +1,24 @@ +import type { SceneVarKey } from "@nanoforge-dev/scene"; + +/** + * Shows a scene var in the entity's `DrawableText2D`: its text becomes `template`, with `{}` + * replaced by the var's value, or by `-` while the var does not exist. Needs the `showSceneVar` + * system. + * + * @example + * `new SceneVarText("score", "Score {}")` shows "Score 120" while `score` is 120. + * + * @component + * @side client + * @group Text color=#e86fb0 - What is shown. + */ +export class SceneVarText { + name = "SceneVarText"; + + constructor( + /** The key of the var in `ctx.scenes.vars`. @group Text */ + public variable: SceneVarKey = "", + /** The text, where `{}` is the var's value. @group Text */ + public template = "{}", + ) {} +} diff --git a/basics/scenes/src/image-fill.ts b/basics/scenes/src/image-fill.ts new file mode 100644 index 0000000..c7fc737 --- /dev/null +++ b/basics/scenes/src/image-fill.ts @@ -0,0 +1,43 @@ +import type { AssetContext } from "@nanoforge-dev/common"; +import type { ShapeConfig } from "@nanoforge-dev/graphics-2d"; + +const images = new Map(); + +/** + * The fill of a shape of `width` by `height` pixels showing the image at `path` (an asset path + * such as `/textures/hero.png`, found in `assets`) stretched over it. Without an image, until it + * is loaded, or when there is no asset at `path`, the shape is filled with its color. + * + * @param centered - Whether the shape's origin is its center (a circle) instead of its top-left + * corner (a rectangle). + */ +export const imageFill = ( + assets: AssetContext, + path: string, + width: number, + height: number, + centered = false, +): ShapeConfig => { + if (!path) return { fillPriority: "color", fillPatternImage: undefined }; + let image = images.get(path); + if (!image) { + image = document.createElement("img"); + try { + image.src = assets.getAsset(path).path; + } catch (error) { + // Once per path, not every frame: the shape keeps its color. + console.warn(`No image at "${path}":`, error); + } + images.set(path, image); + } + if (!image.naturalWidth) return { fillPriority: "color", fillPatternImage: undefined }; + return { + fillPriority: "pattern", + fillPatternImage: image, + fillPatternRepeat: "no-repeat", + fillPatternScaleX: width / image.naturalWidth, + fillPatternScaleY: height / image.naturalHeight, + fillPatternOffsetX: centered ? image.naturalWidth / 2 : 0, + fillPatternOffsetY: centered ? image.naturalHeight / 2 : 0, + }; +}; diff --git a/basics/scenes/src/main.ts b/basics/scenes/src/main.ts new file mode 100644 index 0000000..d6eab4e --- /dev/null +++ b/basics/scenes/src/main.ts @@ -0,0 +1,63 @@ +import type { ClientRunOptions } from "@nanoforge-dev/common"; +import { NanoforgeFactory } from "@nanoforge-dev/core"; +import { EcsLibrary } from "@nanoforge-dev/ecs/client"; +import { EditorLibrary } from "@nanoforge-dev/editor-lib"; +import { Graphics2DLibrary } from "@nanoforge-dev/graphics-2d"; +import { InputEnum, InputLibrary } from "@nanoforge-dev/input"; +import { SceneLibrary } from "@nanoforge-dev/scene"; + +import { DrawableRect2D } from "./components/drawable-rect-2d.component"; +import { DrawableText2D } from "./components/drawable-text-2d.component"; +import { Position2D } from "./components/position-2d.component"; +import { SceneSwitchKey } from "./components/scene-switch-key.component"; +import { SceneVarText } from "./components/scene-var-text.component"; +import "./scene-vars"; +import { BlueRoom } from "./scenes/blue-room.scene"; +import { RedRoom } from "./scenes/red-room.scene"; +import { draw2D } from "./systems/draw-2d.system"; +import { showSceneVar } from "./systems/show-scene-var.system"; +import { switchSceneOnKey } from "./systems/switch-scene-on-key.system"; + +export const main = async (options: ClientRunOptions): Promise => { + const app = NanoforgeFactory.createClient({ + tickRate: 60, + viewport: { width: 800, height: 600, fit: "contain" }, + }); + const ecs = new EcsLibrary(); + + app.use(new Graphics2DLibrary()); + app.use(ecs); + app.use(new InputLibrary()); + app.use(new SceneLibrary({ initial: RedRoom, scenes: { RedRoom, BlueRoom } })); + app.use(new EditorLibrary()); + + await app.init(options); + + const registry = ecs.registry; + + // Kept by every scene: the background, the help and the vars. Each room adds its own panel. + const background = registry.spawnEntity(); + registry.addComponent(background, new Position2D(0, 0)); + registry.addComponent(background, new DrawableRect2D(800, 600, "#1e1e2e")); + + const help = registry.spawnEntity(); + registry.addComponent(help, new Position2D(20, 20)); + registry.addComponent(help, new DrawableText2D("Space to switch rooms", 24, "#cdd6f4")); + registry.addComponent(help, new SceneSwitchKey(InputEnum.Space)); + + const room = registry.spawnEntity(); + registry.addComponent(room, new Position2D(20, 520)); + registry.addComponent(room, new DrawableText2D("", 20, "#a6adc8")); + registry.addComponent(room, new SceneVarText("room", "room (owned by the scene): {}")); + + const switches = registry.spawnEntity(); + registry.addComponent(switches, new Position2D(20, 555)); + registry.addComponent(switches, new DrawableText2D("", 20, "#a6adc8")); + registry.addComponent(switches, new SceneVarText("switches", "switches (persistent): {}")); + + registry.addSystem(switchSceneOnKey); + registry.addSystem(showSceneVar); + registry.addSystem(draw2D); + + await app.run(); +}; diff --git a/basics/scenes/src/scene-vars.ts b/basics/scenes/src/scene-vars.ts new file mode 100644 index 0000000..f56c6e6 --- /dev/null +++ b/basics/scenes/src/scene-vars.ts @@ -0,0 +1,14 @@ +/** + * The scene vars of the game, typed for `ctx.scenes.vars`. A var belongs to the scene that made + * it and goes away when that scene is unloaded, unless it is persistent. + */ +declare module "@nanoforge-dev/scene" { + interface SceneVars { + /** Scene switches since the game started, kept across scenes (persistent). @default 0 */ + switches: number; + /** Name of the room on screen, made by each room and removed with it. @default "" */ + room: string; + } +} + +export {}; diff --git a/basics/scenes/src/scenes/blue-room.scene.ts b/basics/scenes/src/scenes/blue-room.scene.ts new file mode 100644 index 0000000..78e6810 --- /dev/null +++ b/basics/scenes/src/scenes/blue-room.scene.ts @@ -0,0 +1,28 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; +import { EcsScene } from "@nanoforge-dev/ecs/scene"; + +import { DrawableRect2D } from "../components/drawable-rect-2d.component"; +import { DrawableText2D } from "../components/drawable-text-2d.component"; +import { Position2D } from "../components/position-2d.component"; + +/** + * The blue room: a blue panel and its title. Makes the `room` var, removed with the scene. + * + * @scene + * @side client + * @vars room + */ +export class BlueRoom extends EcsScene { + override setup(registry: Registry, ctx: Context) { + ctx.scenes.vars.set("room", "blue"); + + const panel = registry.spawnEntity(); + registry.addComponent(panel, new Position2D(200, 150)); + registry.addComponent(panel, new DrawableRect2D(400, 300, "#89b4fa")); + + const title = registry.spawnEntity(); + registry.addComponent(title, new Position2D(300, 280)); + registry.addComponent(title, new DrawableText2D("Blue room", 40, "#1e1e2e")); + } +} diff --git a/basics/scenes/src/scenes/red-room.scene.ts b/basics/scenes/src/scenes/red-room.scene.ts new file mode 100644 index 0000000..8f554e6 --- /dev/null +++ b/basics/scenes/src/scenes/red-room.scene.ts @@ -0,0 +1,28 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; +import { EcsScene } from "@nanoforge-dev/ecs/scene"; + +import { DrawableRect2D } from "../components/drawable-rect-2d.component"; +import { DrawableText2D } from "../components/drawable-text-2d.component"; +import { Position2D } from "../components/position-2d.component"; + +/** + * The red room: a red panel and its title. Makes the `room` var, removed with the scene. + * + * @scene + * @side client + * @vars room + */ +export class RedRoom extends EcsScene { + override setup(registry: Registry, ctx: Context) { + ctx.scenes.vars.set("room", "red"); + + const panel = registry.spawnEntity(); + registry.addComponent(panel, new Position2D(200, 150)); + registry.addComponent(panel, new DrawableRect2D(400, 300, "#f38ba8")); + + const title = registry.spawnEntity(); + registry.addComponent(title, new Position2D(310, 280)); + registry.addComponent(title, new DrawableText2D("Red room", 40, "#1e1e2e")); + } +} diff --git a/basics/scenes/src/systems/draw-2d.system.ts b/basics/scenes/src/systems/draw-2d.system.ts new file mode 100644 index 0000000..937eeeb --- /dev/null +++ b/basics/scenes/src/systems/draw-2d.system.ts @@ -0,0 +1,45 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; +import "@nanoforge-dev/graphics-2d"; +import { Position2D } from "../components/position-2d.component"; + +import { DrawableCircle2D } from "../components/drawable-circle-2d.component"; +import { DrawableRect2D } from "../components/drawable-rect-2d.component"; +import { DrawableText2D } from "../components/drawable-text-2d.component"; + +type Drawable = DrawableRect2D | DrawableCircle2D | DrawableText2D; + +/** The drawables shown by the last frame. */ +let shown = new Set(); + +/** + * Draws every entity that has a `Position2D` and a `DrawableRect2D`, `DrawableCircle2D` or + * `DrawableText2D`, where it is. Add it last, after the systems that move entities. + * + * @remarks + * The shape of a killed entity, or of a removed drawable, is removed from the screen. + * + * @system + * @side client + */ +export const draw2D = (registry: Registry, ctx: Context) => { + const layer = ctx.graphics.baseLayer; + const drawn = new Set(); + + registry.getZipper([DrawableRect2D, Position2D]).forEach(({ DrawableRect2D, Position2D }) => { + DrawableRect2D.draw(layer, Position2D, ctx.assets); + drawn.add(DrawableRect2D); + }); + registry.getZipper([DrawableCircle2D, Position2D]).forEach(({ DrawableCircle2D, Position2D }) => { + DrawableCircle2D.draw(layer, Position2D, ctx.assets); + drawn.add(DrawableCircle2D); + }); + registry.getZipper([DrawableText2D, Position2D]).forEach(({ DrawableText2D, Position2D }) => { + DrawableText2D.draw(layer, Position2D); + drawn.add(DrawableText2D); + }); + + // `killEntity` doesn't call `destroy()`: a drawable no longer in the world loses its shape here. + for (const drawable of shown) if (!drawn.has(drawable)) drawable.destroy(); + shown = drawn; +}; diff --git a/basics/scenes/src/systems/show-scene-var.system.ts b/basics/scenes/src/systems/show-scene-var.system.ts new file mode 100644 index 0000000..b6c608b --- /dev/null +++ b/basics/scenes/src/systems/show-scene-var.system.ts @@ -0,0 +1,20 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; +import "@nanoforge-dev/scene"; + +import { DrawableText2D } from "../components/drawable-text-2d.component"; +import { SceneVarText } from "../components/scene-var-text.component"; + +/** + * Writes the var of every `SceneVarText` in its entity's `DrawableText2D`, through its template; + * a var that does not exist shows as `-`. + * + * @system + * @side client + */ +export const showSceneVar = (registry: Registry, ctx: Context) => { + registry.getZipper([SceneVarText, DrawableText2D]).forEach(({ SceneVarText, DrawableText2D }) => { + const { variable, template } = SceneVarText as SceneVarText; + DrawableText2D.text = template.replace("{}", String(ctx.scenes.vars.get(variable) ?? "-")); + }); +}; diff --git a/basics/scenes/src/systems/switch-scene-on-key.system.ts b/basics/scenes/src/systems/switch-scene-on-key.system.ts new file mode 100644 index 0000000..c323e24 --- /dev/null +++ b/basics/scenes/src/systems/switch-scene-on-key.system.ts @@ -0,0 +1,27 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; +import "@nanoforge-dev/input"; +import "@nanoforge-dev/scene"; + +import { SceneSwitchKey } from "../components/scene-switch-key.component"; +import { BlueRoom } from "../scenes/blue-room.scene"; +import { RedRoom } from "../scenes/red-room.scene"; + +/** + * Loads the other room when the key of a `SceneSwitchKey` is pressed, and counts the switches in + * the persistent `switches` var. + * + * @system + * @side client + */ +export const switchSceneOnKey = (registry: Registry, ctx: Context) => { + registry.getZipper([SceneSwitchKey]).forEach(({ SceneSwitchKey }) => { + const down = ctx.input.isKeyPressed((SceneSwitchKey as SceneSwitchKey).key) === true; + if (down && !SceneSwitchKey.held) { + void ctx.scenes.load(ctx, ctx.scenes.isLoaded(RedRoom) ? BlueRoom : RedRoom); + const switches = ctx.scenes.vars.get("switches") ?? 0; + ctx.scenes.vars.set("switches", switches + 1, { persistent: true }); + } + SceneSwitchKey.held = down; + }); +}; diff --git a/basics/scenes/tsconfig.json b/basics/scenes/tsconfig.json new file mode 100644 index 0000000..c0ae4f2 --- /dev/null +++ b/basics/scenes/tsconfig.json @@ -0,0 +1,39 @@ +{ + "$schema": "https://json.schemastore.org/tsconfig.json", + // Mapped from https://www.typescriptlang.org/tsconfig + "compilerOptions": { + // Type Checking + "allowUnreachableCode": false, + "allowUnusedLabels": false, + "noFallthroughCasesInSwitch": true, + "noImplicitOverride": true, + "noImplicitReturns": true, + "noPropertyAccessFromIndexSignature": false, + "noUncheckedIndexedAccess": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "strict": true, + + // Modules + "allowArbitraryExtensions": false, + "allowImportingTsExtensions": false, + "module": "ESNext", + "moduleResolution": "Bundler", + "resolveJsonModule": true, + "resolvePackageJsonExports": true, + "resolvePackageJsonImports": true, + + // Interop Constraints + "allowSyntheticDefaultImports": true, + "forceConsistentCasingInFileNames": true, + "isolatedModules": true, + + // Language and Environment + "experimentalDecorators": true, + "lib": ["ESNext", "esnext.disposable", "DOM"], + "target": "ESNext", + "useDefineForClassFields": true + }, + "include": ["src"], + "exclude": ["node_modules", ".nanoforge", "dist"] +} diff --git a/basics/sound/.gitignore b/basics/sound/.gitignore new file mode 100644 index 0000000..f28e2dc --- /dev/null +++ b/basics/sound/.gitignore @@ -0,0 +1,5 @@ +node_modules/ +dist/ +.nanoforge/ +nf_modules/ +.env diff --git a/basics/sound/README.md b/basics/sound/README.md new file mode 100644 index 0000000..c38b536 --- /dev/null +++ b/basics/sound/README.md @@ -0,0 +1,21 @@ +# sound + +Press Space or Enter to play a sound effect; M turns the sound on and off. + +It shows the `sound` engine library: `playSoundOnKey` loads the sound of each `PlayOnKey` +(`ctx.sound.load`, with the URL `ctx.assets.getAsset` gives for the asset) and plays it when its +key is pressed (`ctx.sound.play`). Sounds may overlap: press both keys quickly. + +The sound library **starts muted**, and `ctx.sound.mute()` toggles it: press M once to hear +anything. `MuteOnKey` keeps track of the state, which the library does not expose. + +```sh +pnpm install +pnpm dev # play it +pnpm editor # open it in the editor +``` + +`assets/wing.wav` and `assets/hit.wav` come from the flappy-bird example, under the MIT license in +`assets/LICENSE`. `image-fill.ts`, the `Position2D`, `DrawableRect2D`, `DrawableCircle2D` and +`DrawableText2D` components and the `draw2D` system are copies of `shared/2d`, and the `PlayOnKey` +and `MuteOnKey` components copies of `shared/basics` (see the repository's README). diff --git a/flappy-bird/client/static/LICENSE b/basics/sound/assets/LICENSE similarity index 100% rename from flappy-bird/client/static/LICENSE rename to basics/sound/assets/LICENSE diff --git a/flappy-bird/client/static/hit.wav b/basics/sound/assets/hit.wav similarity index 100% rename from flappy-bird/client/static/hit.wav rename to basics/sound/assets/hit.wav diff --git a/flappy-bird/client/static/wing.wav b/basics/sound/assets/wing.wav similarity index 100% rename from flappy-bird/client/static/wing.wav rename to basics/sound/assets/wing.wav diff --git a/basics/sound/nanoforge.config.ts b/basics/sound/nanoforge.config.ts new file mode 100644 index 0000000..77607cb --- /dev/null +++ b/basics/sound/nanoforge.config.ts @@ -0,0 +1,5 @@ +import { defineConfig } from "@nanoforge-dev/config"; + +export default defineConfig({ + type: "client", +}); diff --git a/basics/sound/package.json b/basics/sound/package.json new file mode 100644 index 0000000..8ce0304 --- /dev/null +++ b/basics/sound/package.json @@ -0,0 +1,27 @@ +{ + "$schema": "https://json.schemastore.org/package.json", + "name": "sound", + "description": "Play sound effects on keys: the smallest NanoForge game making noise", + "private": true, + "type": "module", + "scripts": { + "dev": "nf dev", + "build": "nf build", + "start": "nf start", + "editor": "nf editor ." + }, + "devDependencies": { + "@nanoforge-dev/asset": "^3.0.0", + "@nanoforge-dev/cli": "^3.0.1", + "@nanoforge-dev/common": "^3.0.0", + "@nanoforge-dev/config": "^3.0.1", + "@nanoforge-dev/core": "^3.0.0", + "@nanoforge-dev/ecs": "^3.0.0", + "@nanoforge-dev/editor-lib": "^3.0.0", + "@nanoforge-dev/env": "^3.0.0", + "@nanoforge-dev/graphics-2d": "^3.0.0", + "@nanoforge-dev/input": "^3.0.0", + "@nanoforge-dev/sound": "^3.0.0", + "typescript": "^6.0.0" + } +} diff --git a/basics/sound/pnpm-lock.yaml b/basics/sound/pnpm-lock.yaml new file mode 100644 index 0000000..e053c1b --- /dev/null +++ b/basics/sound/pnpm-lock.yaml @@ -0,0 +1,1530 @@ +lockfileVersion: '9.0' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + +importers: + + .: + devDependencies: + '@nanoforge-dev/asset': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/cli': + specifier: ^3.0.1 + version: 3.0.1 + '@nanoforge-dev/common': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/config': + specifier: ^3.0.1 + version: 3.0.1 + '@nanoforge-dev/core': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/ecs': + specifier: ^3.0.0 + version: 3.0.0(@nanoforge-dev/editor-lib@3.0.0) + '@nanoforge-dev/editor-lib': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/env': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/graphics-2d': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/input': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/sound': + specifier: ^3.0.0 + version: 3.0.0(@nanoforge-dev/editor-lib@3.0.0) + typescript: + specifier: ^6.0.0 + version: 6.0.3 + +packages: + + '@angular-devkit/core@22.2.7': + resolution: {integrity: sha512-cchZAMsV4d76RDZBlWzPhYxM/Hb6bmq71oUngdrwehMbBbdQu3W9C2tGlvxuPxbRKru9ZlUa14YVXQ0+QnhFtw==} + engines: {node: ^22.22.3 || ^24.15.0 || >=26.0.0, npm: ^6.11.0 || ^7.5.6 || >=8.0.0, yarn: '>= 1.13.0'} + peerDependencies: + chokidar: ^5.0.0 + peerDependenciesMeta: + chokidar: + optional: true + + '@angular-devkit/schematics-cli@22.2.7': + resolution: {integrity: sha512-9Od0E8TiYTQWm/03QjYWnsryZA8ZSjTf/k5z61nPd/jgloVNvSW8kxC7/YMw+RoXh2idMzjiJxraKxg+gJxzPw==} + engines: {node: ^22.22.3 || ^24.15.0 || >=26.0.0, npm: ^6.11.0 || ^7.5.6 || >=8.0.0, yarn: '>= 1.13.0'} + hasBin: true + + '@angular-devkit/schematics@22.2.7': + resolution: {integrity: sha512-a1h7xNqBLQVo1e5eCyOU3axSbA9AFU6nnSH5QhlNhggfMeZde+eBrueSt25xsewoxlKO8EvkVT3+knMUkDYiGQ==} + engines: {node: ^22.22.3 || ^24.15.0 || >=26.0.0, npm: ^6.11.0 || ^7.5.6 || >=8.0.0, yarn: '>= 1.13.0'} + + '@emnapi/core@2.0.0-beta.2': + resolution: {integrity: sha512-MzCVoWtcg4Pm2B3je5mMvYMvj3MmBKw+fU7vbsJc9/iT8ip6/eYIHo/Dsm/mr+wsHB6SEyJDuxB09Yy6r/8+4A==} + + '@emnapi/runtime@2.0.0-beta.2': + resolution: {integrity: sha512-JcrSPzPvZuNZvJqPTF9Fw25LbOJ8avzFVlaf2grmH4Cku0oGP47tRgqPZadcfj3YoZMHkFVnCYFbQM8I+i5QEw==} + + '@emnapi/wasi-threads@2.2.0': + resolution: {integrity: sha512-JP7OYH38Q7+pyTAe14raZHLQIK7BDKbdwji+Xi3pcd/6QkJYQH3SX4wu6EplGrGJWRepoNzedfm0G3B9Z4e9Rw==} + + '@inquirer/ansi@2.1.0': + resolution: {integrity: sha512-63GU5AD9KhNbWM0jlhHoMJTEFck2upFOPxHlnCKf3xYTV3rjTUUQfodihmTnfYQzMLS29oy8lK/gA1eJgu4bhA==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + + '@inquirer/checkbox@5.3.0': + resolution: {integrity: sha512-3QQSO87A+JoRtOtjtsgX2enwTL+3+VBVrkUpdqrIxMOgn5+W5sE57PcCPAiNUIESHxV4Q6mNEGxq2xLmRa0/yw==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/confirm@6.4.0': + resolution: {integrity: sha512-+DCZxrOF01Q/1SzTQkgycAQPS/Jf+Yol0h1P/MVmopukTsxGOu1h/LKqf30y0eHKFZYYrgUMVhGDhEbPmSPi9A==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/core@12.1.0': + resolution: {integrity: sha512-6H7usRWw4Gdjgpaem10CA5MfZ/xoYPGyInriR1Xubqjv+SVo8LIJ1erpFxW5JgCza6VZVZiKLTko7RtUU3AQMg==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/editor@5.4.0': + resolution: {integrity: sha512-L7vdCe4jnMpzhDisu1tAnr4WGvfPOVz+vNFXyIIL7O2Ycn/n90sn1ARvg+4cwzLf+us51BE/cX7uhnrLcal3+g==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/expand@5.2.0': + resolution: {integrity: sha512-AOp2KQk7QojUyWOP7VkqdBWmxLRaVH58wQMx3N4//P530EDtpVp1EWIjAJubx9ZohWS/UCEpIkA1TuiNki0iOA==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/external-editor@3.1.0': + resolution: {integrity: sha512-27JAkF38nXqXaoveU28iA/+Z8nutnF8B3JsbdToPHn9WnkrsMtZ0/YoJ29YwbtFexYIo+tIy6ikMvTdHKjjmGA==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/figures@2.1.0': + resolution: {integrity: sha512-CR9u2PME23jxy2SOyTb117efwAAPm98Zr+LoWI+PiQ55D6U8Yeu/HyFTxwytKhPa6oxAGzdsm2Kg7oLS6B9z8w==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + + '@inquirer/input@5.2.0': + resolution: {integrity: sha512-sIUPnN2X7M+7dq3RUd+e9QRacYnM+6B+kSucwQgj5VC5Eo/f+CIr2NyPBumxsViI+wzfokkgop/3x3KfHxNyJw==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/number@4.3.0': + resolution: {integrity: sha512-xYkX4sPVgox0F7yQwpz/MByWjOGdLEf1pdjH+Lji2gAzSs2xezz5bN5YgS1n0tx9wo0mRhGvq1KJGtvDZ9XXcQ==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/password@5.3.0': + resolution: {integrity: sha512-KVqW4G/UbMK06uBN76xF89JKYC9YBWU7v+Kc2tUwMCO8pg3ASBr0HVabl1KaSqF94O2KiRu8aKx4EicN78PK+A==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/prompts@8.7.2': + resolution: {integrity: sha512-QoRB4wFIjgH5iOhSjoIKMkTvSHDuV+O3OITlIqAYO0oK5x364GJILXiMBvlPiE+klg7Xx9tq5XVqQHcGUDYYPA==} + engines: {node: '>=23.5.0 || ^22.13.0 || ^20.17.0'} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/prompts@8.8.0': + resolution: {integrity: sha512-yYVT2Eo3mafb9tnU2Mr3+wh5wLCWyspExqVoPSMCIfBIn3ZUTE4IDfbCMbMgXaOH0tH+JZEhOtfczQhDzOjIGg==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/rawlist@5.4.0': + resolution: {integrity: sha512-x42wcy465GM5/mHNKBFdAJbLlLyzmYqr/DEa6F49nHpI+03EFwRCRKeLGQakx5XqZ4unc2yFuS78qAD4Rb0iFA==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/search@4.4.0': + resolution: {integrity: sha512-UJ+9tkzPT1AjnvjuPFYcOdO3BVeN28bfSXajYRFZTRgA9OiNl4k2Nn2cHHPwiIDyPHlvOnmE9ZOHyXhPHtvb+A==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/select@5.3.0': + resolution: {integrity: sha512-Fmgfl0qjqCQo+/tjQpgnRXKh5N7/VpYcJh+AlYU2eHmHZLMGUBDzo+Gwc2ODzWJfXNRZmgaMhz4qULcO/C/rXg==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/type@4.3.0': + resolution: {integrity: sha512-/IA8q2nyjgyl0NGSjqiRXB8gh3We7Pzx9C0c+6Zoolu905jFc79anerrUG7+n65+qs310DRK43yi2WDI8nY59A==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@isaacs/fs-minipass@4.0.1': + resolution: {integrity: sha512-wgm9Ehl2jpeqP3zw/7mo3kRHFp5MEDhqAdwy1fTGkHAwnkGOVsgpvQhL8B5n1qlb01jV3n/bI0ZfZp5lWA1k4w==} + engines: {node: '>=18.0.0'} + + '@jridgewell/sourcemap-codec@1.6.0': + resolution: {integrity: sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw==} + + '@nanoforge-dev/asset@3.0.0': + resolution: {integrity: sha512-jqXcyCMbdcCCj7wZ/dyIpjY8hza02Pt/vY8KrNcaXTlxpTc9EE+VKuO5+fHdUXWWPgJSFt96TqAPhug+z+KH3Q==} + engines: {node: '26'} + + '@nanoforge-dev/cli@3.0.1': + resolution: {integrity: sha512-ZfrbETcAcX3vsPLO1WLSCJc2ERCAcIpbdi9Df5bmH3XLinQkDAcESkN9JkaI/vgV08A7xhTjV8zSDSwF0T73Xg==} + engines: {node: '26'} + hasBin: true + + '@nanoforge-dev/common@3.0.0': + resolution: {integrity: sha512-lzMvQ1vCElh9OcP4EqhffbY+AQXOH4IiuD1pj7VvJlpcY6hh7Bs/s4NVS0gXoJ+ibpBMe5mAq23RyzqTwk8czg==} + engines: {node: '26'} + + '@nanoforge-dev/config@3.0.1': + resolution: {integrity: sha512-XWRScOotb8IirerRx/mWLmUVYye3lo0PN/5a0MUp/eoSrhz0S6zzhGHEupRuC8aeHTjsQT7ctM3P6YyKSHZLaQ==} + engines: {node: '26'} + + '@nanoforge-dev/core@3.0.0': + resolution: {integrity: sha512-pa7Fr3TFkZVfAADBC17Qt5ru/W9vXtYB8e5eb7wurAtu8/jH/ZtqfW3kafTuWC9513MXp/h6LOCdZQhjnCt6UA==} + engines: {node: '26'} + + '@nanoforge-dev/ecs@3.0.0': + resolution: {integrity: sha512-csrXJtCzqohxtvEQs+O//xabnaLR3BXe0QpSpl7NVihF3f0iX2fNYURxNjQKxzoPYBokCnnyNxN2KFc7UmIsdA==} + engines: {node: '26'} + peerDependencies: + '@nanoforge-dev/editor-lib': 3.0.0 + '@nanoforge-dev/scene': 3.0.0 + peerDependenciesMeta: + '@nanoforge-dev/editor-lib': + optional: true + '@nanoforge-dev/scene': + optional: true + + '@nanoforge-dev/editor-lib@3.0.0': + resolution: {integrity: sha512-fSWm6bHelbxqeVESYoUUKDi9RGNxvRu6p1r41KE1DddM0RrP0/WzkFOWBvgl+psHbYNotXe723Y2Fd3p+tqPDQ==} + engines: {node: '26'} + + '@nanoforge-dev/editor@0.1.4': + resolution: {integrity: sha512-bqbrH8ulFSiZz1iisJHtHeEzj1RV/70uErCYHeW4DIhVPsWbBfWKFvg/ghAbmPk5vsj0YnhDX6DSpik4S1QoiQ==} + engines: {node: '25'} + + '@nanoforge-dev/env@3.0.0': + resolution: {integrity: sha512-kXYXl9/09Bn8VStTTFuZY3dYDG9b76VhOi9PHMnaLe75XcFRLKJ2dYkXf3ut6RCL2+6H7HAEIOALjR15CHnJ5A==} + engines: {node: '26'} + + '@nanoforge-dev/graphics-2d@3.0.0': + resolution: {integrity: sha512-0I0WUr5495jORdYR+HtyP4kmAfCMvixmG+EH/gE5bN33S8RO6/Ly4oMLZOLUywcDTAFuLn28BlHuVor2YfXrsg==} + engines: {node: '26'} + + '@nanoforge-dev/input@3.0.0': + resolution: {integrity: sha512-8pWU28c99VAvn37onNbVFfwXTgyQGxm5DVnTdBEzgrF3KPCzU77kEaexB1AWOlga+4qNGU7/XNm3hNZ+YS49Ig==} + engines: {node: '26'} + + '@nanoforge-dev/loader-client@1.7.0': + resolution: {integrity: sha512-zDj0yQ8cZyHHjAYDVIyB79mh4dK7WRgZG7Kc+d/43t2WX/pX2HqBVkpLcDPkA9cNOKpCRYWd3LyYISlz53gzyg==} + engines: {node: '26'} + + '@nanoforge-dev/loader-server@1.7.0': + resolution: {integrity: sha512-Yd/BYORhoar5znNSD7kGirAc1Al0q5t8iscbb07QWKeXWA+DLKjPSuKJC6ykysFkbs9HiZU59oOfxyvNL4h3Pw==} + engines: {node: '26'} + + '@nanoforge-dev/loader-website@1.7.0': + resolution: {integrity: sha512-x1fV3RYUUxru39sF5HJcfutNnifMMTIEHW92jgkR9gz06ZlZ+rQofuegXgAnEzs0dEXa+rhNQ/iXYbqOZvq6YQ==} + engines: {node: '26'} + + '@nanoforge-dev/registry@3.0.1': + resolution: {integrity: sha512-EzSaszYtrPldD5Do7jdQK3TLLb8uCirY6NQjKXkeGw31X+sUXor4h5GAaoxELWMzPnv9BbKtggSaVaQIt7s8IQ==} + engines: {node: '26'} + + '@nanoforge-dev/schematics@3.0.1': + resolution: {integrity: sha512-iK2vC0gPEh2mQ81IB4+jfGw/ZNOLMDnS9HRBXH5tWB0mdN5GA32viblhW0oYPX2/tWrLC9YiCPgEE4AL8Zwz6w==} + engines: {node: '26'} + + '@nanoforge-dev/sound@3.0.0': + resolution: {integrity: sha512-vNMYm3dp7A3A+4taJpSXwPEu/t1VtZ1BAUkY6a3D40Uz3q785+u79o3q21/yYGigCswuPlIQ5gT4ApcT+6J4tg==} + engines: {node: '26'} + peerDependencies: + '@nanoforge-dev/editor-lib': 3.0.0 + peerDependenciesMeta: + '@nanoforge-dev/editor-lib': + optional: true + + '@napi-rs/wasm-runtime@1.2.6': + resolution: {integrity: sha512-mRyDmEw9/fCDXCGfL1sbgIw/GUK0PVxRW4YwgPN61F3LQ+fSyoBFarJVzgGyhF6kRzEQZ0FejDqm4WLXSeqQmw==} + engines: {node: ^20.19.0 || ^22.13.0 || >=23.5.0} + peerDependencies: + '@emnapi/core': ^1.7.1 || 2.0.0-beta.2 + '@emnapi/runtime': ^1.7.1 || 2.0.0-beta.2 + + '@oven/bun-darwin-aarch64@1.4.4': + resolution: {integrity: sha512-zW/hxwc8sJAILGwB5eTC4i48ouGXf0V4lrxmEOk3JIE6JkYVW1TZh1E2pIempqsezgW1sckTIIDudFON8bJ2Mw==} + cpu: [arm64] + os: [darwin] + + '@oven/bun-darwin-x64@1.4.4': + resolution: {integrity: sha512-oKGcxLsvh4oHjAo28nPm8c/xN0o/OmGyj1IHYc94vprkWsW2hNg2keEZt5f40cI5Hvu4jDlSRTR0UNpv1UIAxw==} + cpu: [x64] + os: [darwin] + + '@oven/bun-freebsd-aarch64@1.4.4': + resolution: {integrity: sha512-klvA9FlwLxZj3JYIOPQA4bbnHIC3uas8kBE4GaGGkeVgAQP/k8hAzYkOqkSaqHBDbxLrTyFEQArEAevJq6NJzg==} + cpu: [arm64] + os: [freebsd] + + '@oven/bun-freebsd-x64@1.4.4': + resolution: {integrity: sha512-sF1xS/scbyN94P2d0eTiarO6JHxrIvhZNT9hnWjQXW5nwKRtfuP+UYnIMNyvW1BQPcZFP/cvfLBNUIe1ea4zPA==} + cpu: [x64] + os: [freebsd] + + '@oven/bun-linux-aarch64-android@1.4.4': + resolution: {integrity: sha512-5lvn3at5vRC0GxvmiqEiV2/e23tnRi0q5pzR40yfDvDA3OW7PSkt4chF1nA9vnAJhro4/l+ol1FmNP6D3cf/oA==} + cpu: [arm64] + os: [android] + + '@oven/bun-linux-aarch64-musl@1.4.4': + resolution: {integrity: sha512-QFd0P+mHJxbZFbUla4MgiE5OwxysHaUIYxL2pPNkpWtaI7v4ShOpr8OhBmsuyB0xn5rv/ZJnPsj2y8+bB9+g/A==} + cpu: [arm64] + os: [linux] + libc: [musl] + + '@oven/bun-linux-aarch64@1.4.4': + resolution: {integrity: sha512-ZTVtpf9zmHSBVPX1sBwe5agGb/rN34yPGg/Hby8e2Ax2uCUA2URZKlZH7qLntK7qaFJCMXh9v0GWNYN2zINz1w==} + cpu: [arm64] + os: [linux] + libc: [glibc] + + '@oven/bun-linux-x64-android@1.4.4': + resolution: {integrity: sha512-3dMicj9C1DhaIfDkwt/9GtpU0W+q+GazbG9OIlEyL3Q1BBEz2e6ZRz/JiO8D/ECC0caXAqvnpFudehcLlgIwWQ==} + cpu: [x64] + os: [android] + + '@oven/bun-linux-x64-musl@1.4.4': + resolution: {integrity: sha512-lEEjNOJJrbGZu2NVcPI4uXdILcpspezWkA8R/Jr0RCGhM6zQd0Y7JBIIKNAmbX59EeWpeEz7Q78iLbpcAUypUA==} + cpu: [x64] + os: [linux] + libc: [musl] + + '@oven/bun-linux-x64@1.4.4': + resolution: {integrity: sha512-CHbbkmHVM28T1GFq+6GL4Ao4ujwwYwj1CxFFwEFzLanPfNsId9AhbIP0Q4reWuWBkGimUkoQygrK7Rgjtj3vog==} + cpu: [x64] + os: [linux] + libc: [glibc] + + '@oven/bun-windows-aarch64@1.4.4': + resolution: {integrity: sha512-n0ep5ZRPCZY1+dqFJpnnRUZB1wy4GYU6At8RF+pyzySCLjkN9R4rFh2PtBHAgF/lg1vOl3/CeER3pDM+p40ATA==} + cpu: [arm64] + os: [win32] + + '@oven/bun-windows-x64@1.4.4': + resolution: {integrity: sha512-a3LNctBVO8PjePsFZfwDleF2JXYf2BfQ1u/PLRnBDLnC2Riml+4+LgJpKj4xRGhB92KweGyQI5PXaTkP9qypMQ==} + cpu: [x64] + os: [win32] + + '@oxc-project/types@0.158.0': + resolution: {integrity: sha512-xZ66qA4WmLbTLlxH3mqMd8f9UKbaOzOT0ATwFf4DH/14pMgpUrtqtjyYzOQmgfl2a0iRAAMbQ9G1th/67jRzGw==} + + '@rolldown/binding-android-arm-eabi@1.3.2': + resolution: {integrity: sha512-kqR2xcygEx3WwDY69LsKeyf7SVmx4yzMtKZRknyaHieVJdRvvnAM97L0Gq6tUFc9T2YXcW/Ghij2+Um6He0LTw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [android] + + '@rolldown/binding-android-arm64@1.3.2': + resolution: {integrity: sha512-gXM4GAAvvIZA7qUuSCQS+Zz91H2fagKa5MNppUdjzysJ8LXMWm9D/gQj4nfOKo6okquDQ5pkjsuo2SUMXNW0Rw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [android] + + '@rolldown/binding-darwin-arm64@1.3.2': + resolution: {integrity: sha512-OBs5hp3W+LwMEUmDMMMnu08ncG0t6DDgnFU+6TAucKtAfNgerYLZSr2jtREKb/JuPQ1J7bJnWIgKKkxvjuAw1g==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [darwin] + + '@rolldown/binding-darwin-x64@1.3.2': + resolution: {integrity: sha512-X0VGYd4v/gdjfa/IP6uHuMhofPoUDYvK/byk3bC0jQ1pKKgt6RZ4B4puMqP0AHkjmIHAsxA471mM6AxZ39IaTA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [darwin] + + '@rolldown/binding-freebsd-x64@1.3.2': + resolution: {integrity: sha512-mr04K4cp9J/fj9fknrX8e4QvI/V48Sp+4v64PoLwhoirIH8b8L8EBrF/0bTjV1It2IL91hoNG13GblnWLglkxA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [freebsd] + + '@rolldown/binding-linux-arm-gnueabihf@1.3.2': + resolution: {integrity: sha512-VgWy02HU9Tiy6tU8U+kF3Fd4TQwTNdIBvs2MlgViP1ksMtAnQQTIPAj0ZsJzIQXKIOugqQSpqxQgELJ3fkuL5w==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [linux] + + '@rolldown/binding-linux-arm64-gnu@1.3.2': + resolution: {integrity: sha512-0wloJFYqV844gv6boiERbHpErxbxHbmlgnMX5VxP1Ux+DLBqGrUOn0cIpBmCZEcTITes3QUelxya4u8c9ziQvQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-arm64-musl@1.3.2': + resolution: {integrity: sha512-Kys8wgFQy8H8vua0MNpC0akMBFoNO8455RHk2yycBM0iayMIAtVAL6xmV9TWAkehFgrrlImTL2fZdX5LXfYtAA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + libc: [musl] + + '@rolldown/binding-linux-ppc64-gnu@1.3.2': + resolution: {integrity: sha512-L8eej7+/StRxUHHOPsOVl7Fzx/3tumuGB4hGQZKT73xRI16KZhaSJr0gi3C3WBjNRxeJRKKps2UD4lQukP+oBw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [ppc64] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-s390x-gnu@1.3.2': + resolution: {integrity: sha512-MV5CEb/nV8neQOj7l6945q1vy62HXtWO8zPDvfySPusoUzdBoLoJ/DfXXwaYThGTXZCniF+5bCf253WTPPK7Yw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [s390x] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-x64-gnu@1.3.2': + resolution: {integrity: sha512-3qssvvVvkwQookZ1/1avlKWc5orAR85vgKdzDd5noZS8nnHiI/ejOAEt0xfNYvtBBF7/DZmP8dANWkRBJVOBCA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-x64-musl@1.3.2': + resolution: {integrity: sha512-rJqoFTm/bCZFKKgaT4NzWn/TuJkFDToZ/rzYFnYVBL28jH1nIfg6snx2mDri30nal9H+wcYfKpoPR9jrMQgQQg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + libc: [musl] + + '@rolldown/binding-openharmony-arm64@1.3.2': + resolution: {integrity: sha512-ozdbCjHfh0N//wJNExjJlSlcDaeIKo8k1ktzkLUyESr2Gu/Qw7nBYxKe3jgtoaxda570vg10WdYosre82263hQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [openharmony] + + '@rolldown/binding-wasm32-wasi@1.3.2': + resolution: {integrity: sha512-p5VA6Vk/2cXZPVWf+dDbuE0dkhrcoAo6pISTJmzUnsSdQqNJdusyR8lZgHku095+r27zrYISNLZnJoqrcePW0A==} + engines: {node: ^20.19.0 || ^22.13.0 || >=23.5.0} + cpu: [wasm32] + + '@rolldown/binding-win32-arm64-msvc@1.3.2': + resolution: {integrity: sha512-XDb2U14Orf4r76SwzvJ7avePL00w4gHBmi1Ig4B/itYFEUTmYMNDHVU0dcYuBa0LgNBqyREoJOrQKxQlyYJA7A==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [win32] + + '@rolldown/binding-win32-x64-msvc@1.3.2': + resolution: {integrity: sha512-lEsKzKJqIUDZVCBhS4lkZuyQUhV1oRg5UHkI72qlOAqJn7qEXcoVdTridFS7PHNWdZknBl95EAF/4P1Xv0K1eQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [win32] + + '@rolldown/pluginutils@1.1.0': + resolution: {integrity: sha512-K+NU2HDCEem4sClgHH4ZZXwdJeNFkJo+hRk479DIwdIviAPN2hFJH1KHHwg8CxHQXvi0M5XY4deTXINfIiSG6w==} + + '@sindresorhus/is@4.6.0': + resolution: {integrity: sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==} + engines: {node: '>=10'} + + '@tybys/wasm-util@0.10.4': + resolution: {integrity: sha512-W3c4gRigFS0T/Ma4qIYF3GDAc5AQdHb1yL5znJT1Zv1YaD9Kitx656wBjvr19qbiosmZT8lWDM5BEMynUqX65A==} + + '@types/validator@13.15.10': + resolution: {integrity: sha512-T8L6i7wCuyoK8A/ZeLYt1+q0ty3Zb9+qbSSvrIVitzT3YjZqkTZ40IbRsPanlB4h1QB3JVL1SYCdR6ngtFYcuA==} + + ajv-formats@3.0.1: + resolution: {integrity: sha512-8iUql50EUR+uUcdRQ3HDqa6EVyo3docL8g5WJ3FNcWmu62IbkGUue/pEyLBW8VGKKucTPgqeks4fIU1DA4yowQ==} + peerDependencies: + ajv: ^8.0.0 + peerDependenciesMeta: + ajv: + optional: true + + ajv@8.20.0: + resolution: {integrity: sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA==} + + ansi-regex@6.6.0: + resolution: {integrity: sha512-XZ5apbzreCbXSKwPjJstu8R0zOi247w3XYwWxtwBXgpZrCyc1Ka7p9/xY0A9/diMewmHbEKz+FIraWaEWjlN5g==} + engines: {node: '>=12'} + + ansis@4.5.0: + resolution: {integrity: sha512-KwIVkfFfJSSzBmZhDGuTmkhWqTdyB5oNVzzznBJbBZ5bZtHiqSrcugRF0RKJKT4Ss3d7ZrcjnlFVDlQNmtWfWw==} + engines: {node: '>=14'} + + braces@3.0.3: + resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} + engines: {node: '>=8'} + + bun@1.4.4: + resolution: {integrity: sha512-hj0ASdG6PNjLZGFAXktWb3Uaj/dcv/1wCsIttoEXADNIQBsGjTr+5uLKYbrDkuc7NT0Tkj4yPIqJI2jDxXdvVg==} + cpu: [arm64, x64] + os: [darwin, linux, android, freebsd, win32] + hasBin: true + + bundle-name@4.1.1: + resolution: {integrity: sha512-DdH81/zPLVS11EUgWq3tEu/xn+EzljlMYooDNdzWEnFha3R3NBMpMV1UqYIpjYHV/SgpFKMIX1Oh7o06SjM/oA==} + engines: {node: '>=18'} + + chalk@5.6.2: + resolution: {integrity: sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA==} + engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} + + char-regex@1.0.2: + resolution: {integrity: sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==} + engines: {node: '>=10'} + + chardet@2.2.0: + resolution: {integrity: sha512-rddelWYNPRrXq6PtNEN2S3f6t9ILzvqaN5pVgi4kqt9jHQaXIial9PznB5iSPVlQSLNaaH22ItWz3EJtQ10+OA==} + + chokidar@5.0.0: + resolution: {integrity: sha512-TQMmc3w+5AxjpL8iIiwebF73dRDF4fBIieAqGn9RGCWaEVwQ6Fb2cGe31Yns0RRIzii5goJ1Y7xbMwo1TxMplw==} + engines: {node: '>= 20.19.0'} + + chownr@3.0.0: + resolution: {integrity: sha512-+IxzY9BZOQd/XuYPRmrvEVjF/nqj5kgT4kEq7VofrDoM1MxoRjEWkrCC3EtLi59TVawxTAn+orJwFQcrqEN1+g==} + engines: {node: '>=18'} + + class-transformer@0.5.1: + resolution: {integrity: sha512-SQa1Ws6hUbfC98vKGxZH3KFY0Y1lm5Zm0SY8XX9zbK7FJCyVEac3ATW0RIpwzW+oOfmHE5PMPufDG9hCfoEOMw==} + + class-validator@0.14.4: + resolution: {integrity: sha512-AwNusCCam51q703dW82x95tOqQp6oC9HNUl724KxJJOfnKscI8dOloXFgyez7LbTTKWuRBA37FScqVbJEoq8Yw==} + + class-validator@0.15.1: + resolution: {integrity: sha512-LqoS80HBBSCVhz/3KloUly0ovokxpdOLR++Al3J3+dHXWt9sTKlKd4eYtoxhxyUjoe5+UcIM+5k9MIxyBWnRTw==} + + cli-cursor@5.0.0: + resolution: {integrity: sha512-aCj4O5wKyszjMmDT4tZj93kxyydN/K5zPWSCe6/0AV/AA1pqe5ZBIw0a2ZfPQV7lL5/yb5HsUreJ6UFAF1tEQw==} + engines: {node: '>=18'} + + cli-spinners@3.4.0: + resolution: {integrity: sha512-bXfOC4QcT1tKXGorxL3wbJm6XJPDqEnij2gQ2m7ESQuE+/z9YFIWnl/5RpTiKWbMq3EVKR4fRLJGn6DVfu0mpw==} + engines: {node: '>=18.20'} + + cli-width@4.1.0: + resolution: {integrity: sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==} + engines: {node: '>= 12'} + + commander@15.1.0: + resolution: {integrity: sha512-cgnQ88TRrWcC7pVq46RzJVRMktu3W2RcbnoidnfBsl1bmDCBwJS/udcIZpKoCrbAYYaCqsz1yZCVIgbIaU3ddQ==} + engines: {node: '>=22.12.0'} + + default-browser-id@5.0.1: + resolution: {integrity: sha512-x1VCxdX4t+8wVfd1so/9w+vQ4vx7lKd2Qp5tDRutErwmR85OgmfX7RlLRMWafRMY7hbEiXIbudNrjOAPa/hL8Q==} + engines: {node: '>=18'} + + default-browser@5.5.1: + resolution: {integrity: sha512-m1pAzaJgZ/gssEqlOhJkPJp8Xly7QyW6xcrkUa2KKcDeDSEMP7X8xipU3snUcfisTQx0w1AGae+9UtJSfVnXGw==} + engines: {node: '>=18'} + + define-lazy-prop@3.0.0: + resolution: {integrity: sha512-N+MeXYoqr3pOgn8xfyRPREN7gHakLYjhsHhWGT3fWAiL4IkAt0iDw14QiiEm2bE30c5XX5q0FtAA3CK5f9/BUg==} + engines: {node: '>=12'} + + defu@6.1.7: + resolution: {integrity: sha512-7z22QmUWiQ/2d0KkdYmANbRUVABpZ9SNYyH5vx6PZ+nE5bcC0l7uFvEfHlyld/HcGBFTL536ClDt3DEcSlEJAQ==} + + destr@2.0.5: + resolution: {integrity: sha512-ugFTXCtDZunbzasqBxrK93Ik/DRYsO6S/fedkWEMKqt04xZ4csmnmwGDBAb07QWNaGMAmnTIemsYZCksjATwsA==} + + dotenv@17.4.2: + resolution: {integrity: sha512-nI4U3TottKAcAD9LLud4Cb7b2QztQMUEfHbvhTH09bqXTxnSie8WnjPALV/WMCrJZ6UV/qHJ6L03OqO3LcdYZw==} + engines: {node: '>=12'} + + dotenv@18.0.10: + resolution: {integrity: sha512-89FAA1xchzK2mxVWdr5F/0rldwiueXs6zJM86rO66EzekR1iBdiXRthyG+m5GvkJaFH3C2LESzamTkgndmLT2A==} + engines: {node: '>=12'} + hasBin: true + + emojilib@2.4.0: + resolution: {integrity: sha512-5U0rVMU5Y2n2+ykNLQqMoqklN9ICBT/KsvC1Gz6vqHbz2AXXGkG+Pm5rMWk/8Vjrr/mY9985Hi8DYzn1F09Nyw==} + + fast-deep-equal@3.1.3: + resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} + + fast-string-truncated-width@3.0.3: + resolution: {integrity: sha512-0jjjIEL6+0jag3l2XWWizO64/aZVtpiGE3t0Zgqxv0DPuxiMjvB3M24fCyhZUO4KomJQPj3LTSUnDP3GpdwC0g==} + + fast-string-width@3.0.2: + resolution: {integrity: sha512-gX8LrtNEI5hq8DVUfRQMbr5lpaS4nMIWV+7XEbXk2b8kiQIizgnlr12B4dA3ZEx3308ze0O4Q1R+cHts8kyUJg==} + + fast-uri@3.1.9: + resolution: {integrity: sha512-hS/0Wt3Ya043oKXs0sIxrMpKQITXhMLIrVAKKXi4gozGC9v7YRWVnXIZzjNPTO02M9BdxLCWqK1yRXgNziVyJQ==} + + fast-wrap-ansi@0.2.2: + resolution: {integrity: sha512-7F2Fl+TjRSenLqlU3UjSH0iyqopqoZIu7eZVpEirP2g1GtWa2G/ecEmBdgz31+Mxr+ELclgg6sokpSFIQiZ02Q==} + + fflate@0.8.3: + resolution: {integrity: sha512-tbZNuJrLwGUp3zshBtdy4W+ORxZuIh8a5ilyIEQDC5rY1f3U20JMry0Ll3WBzU58EZKsEuJFXhb5gwv8CsPvgA==} + + fill-range@7.1.1: + resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} + engines: {node: '>=8'} + + get-east-asian-width@1.7.0: + resolution: {integrity: sha512-XjH1AECxf0giL2V1aU8vKyRR2ppRUb5c0EvT7zuJTokQ74bNo52zOtghqdWIqrhUD79fo3x0WfKZdOqxF6LG1Q==} + engines: {node: '>=18'} + + iconv-lite@0.7.3: + resolution: {integrity: sha512-IKXpvIzjnC9XTAUbVBcMfGS0EPaIXtW6v+zr+RRp+hqULEpo0owZax6wyRwPOJbWbzjYspQwusTsfVr0ifh4uQ==} + engines: {node: '>=0.10.0'} + + is-docker@3.0.0: + resolution: {integrity: sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + hasBin: true + + is-in-ssh@1.0.0: + resolution: {integrity: sha512-jYa6Q9rH90kR1vKB6NM7qqd1mge3Fx4Dhw5TVlK1MUBqhEOuCagrEHMevNuCcbECmXZ0ThXkRm+Ymr51HwEPAw==} + engines: {node: '>=20'} + + is-inside-container@1.0.0: + resolution: {integrity: sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA==} + engines: {node: '>=14.16'} + hasBin: true + + is-interactive@2.0.0: + resolution: {integrity: sha512-qP1vozQRI+BMOPcjFzrjXuQvdak2pHNUMZoeG2eRbiSqyvbEf/wQtEOTOX1guk6E3t36RkaqiSt8A/6YElNxLQ==} + engines: {node: '>=12'} + + is-number@7.0.0: + resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} + engines: {node: '>=0.12.0'} + + is-unicode-supported@2.1.0: + resolution: {integrity: sha512-mE00Gnza5EEB3Ds0HfMyllZzbBrmLOX3vfWoj9A9PEnTfratQ/BcaJOuMhnkhjXvb2+FkY3VuHqtAGpTPmglFQ==} + engines: {node: '>=18'} + + is-wsl@3.1.1: + resolution: {integrity: sha512-e6rvdUCiQCAuumZslxRJWR/Doq4VpPR82kqclvcS0efgt430SlGIk05vdCN58+VrzgtIcfNODjozVielycD4Sw==} + engines: {node: '>=16'} + + json-schema-traverse@1.0.0: + resolution: {integrity: sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==} + + jsonc-parser@3.3.1: + resolution: {integrity: sha512-HUgH65KyejrUFPvHFPbqOY0rsFip3Bo5wb4ngvdi1EpCYWUQDC5V+Y7mZws+DLkr4M//zQJoanu1SP+87Dv1oQ==} + + konva@10.9.1: + resolution: {integrity: sha512-m49x+GatSxEUSvqahYhxpTjgKbtrLtw4P4o4B4iux953ZFpceaK52Ea+CFsAsd7W4I0Y5u6mMoRUsY/eltNZmw==} + peerDependencies: + canvas: ^3.0.0 + skia-canvas: ^3.0.0 + peerDependenciesMeta: + canvas: + optional: true + skia-canvas: + optional: true + + libphonenumber-js@1.13.16: + resolution: {integrity: sha512-tIOCM9yx2Go6d5/ZANe0K+G4AZek1Ymx81HxQpf19Sri4zMP95eQbKdnUGHAvFQ4nx0PeLhFqvAfisTADXj3tQ==} + + log-symbols@7.0.1: + resolution: {integrity: sha512-ja1E3yCr9i/0hmBVaM0bfwDjnGy8I/s6PP4DFp+yP+a+mrHO4Rm7DtmnqROTUkHIkqffC84YY7AeqX6oFk0WFg==} + engines: {node: '>=18'} + + magic-string@1.4.1: + resolution: {integrity: sha512-8lyCu36ErXR0J9uaGKlKQoiLZKmtI63YGLE8G2o9jyRPdr4X47LusSOwgOJOzcVtp81fTAAjxR7BwKz682Jhow==} + + micromatch@4.0.8: + resolution: {integrity: sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==} + engines: {node: '>=8.6'} + + mimic-function@5.0.1: + resolution: {integrity: sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==} + engines: {node: '>=18'} + + minipass@7.1.3: + resolution: {integrity: sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A==} + engines: {node: '>=16 || 14 >=14.17'} + + minizlib@3.1.0: + resolution: {integrity: sha512-KZxYo1BUkWD2TVFLr0MQoM8vUUigWD3LlD83a/75BqC+4qE0Hb1Vo5v1FgcfaNXvfXzr+5EhQ6ing/CaBijTlw==} + engines: {node: '>= 18'} + + mute-stream@4.0.0: + resolution: {integrity: sha512-gSrprq0fJ3EiOErzjdIZrjysVVmJ4uu1QWfCDss5LypA5OXvrMje5Ym5z6V6RLyJ2eF87lasX7t6a0AnFvZblg==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + + node-emoji@2.2.0: + resolution: {integrity: sha512-Z3lTE9pLaJF47NyMhd4ww1yFTAP8YhYI8SleJiHzM46Fgpm5cnNzSl9XfzFNqbaz+VlJrIj3fXQ4DeN1Rjm6cw==} + engines: {node: '>=18'} + + onetime@7.0.0: + resolution: {integrity: sha512-VXJjc87FScF88uafS3JllDgvAm+c/Slfz06lorj2uAY34rlUu0Nt+v8wreiImcrgAjjIHp1rXpTDlLOGw29WwQ==} + engines: {node: '>=18'} + + open@11.0.4: + resolution: {integrity: sha512-++Zlftm0kVLPmzC06t6epuWmcRMDbI4z5P3NNX979WA/k23+NtSOynEGzsVfZwguKw2mi5umVgnBlJQMwRz4Pg==} + engines: {node: '>=20'} + + ora@9.4.1: + resolution: {integrity: sha512-6VlU9MLXbjVQD04AZCMX28hVtA5bUoadvUqO76MUCVA0ilwJbMiHsITRPfyVm6p/BC0Av/BXMujx39WCe1LEqw==} + engines: {node: '>=20'} + + picomatch@2.3.2: + resolution: {integrity: sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==} + engines: {node: '>=8.6'} + + picomatch@4.0.7: + resolution: {integrity: sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA==} + engines: {node: '>=12'} + + powershell-utils@0.2.1: + resolution: {integrity: sha512-C+y9x90UElAddDZmV4qOx9W53B61PO7cIqWz2dQsWlwswuq4mr8NEwytdGKboYbQlGZ3awrkTeNvcZiZNHnQ8A==} + engines: {node: '>=20'} + + rc9@3.1.0: + resolution: {integrity: sha512-ufjkNVzbRHKcCOmTahZkmVsyc3W+MSk3jY03m+a7tGHkIsdVMG9l10/3HvFbWkkKzY5VFp3pkRsIo/UYgmFL7Q==} + + readdirp@5.1.1: + resolution: {integrity: sha512-Kko+Y5XQ6fM+Ce3dq3m9YGxnacYZYl9cA1wZjaF3Vbry2L3i1qVg8+CAgNPsXRArPMUMCaOR7oa9Nqntc43JKA==} + engines: {node: '>= 20.19.0'} + + require-from-string@2.0.2: + resolution: {integrity: sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==} + engines: {node: '>=0.10.0'} + + restore-cursor@5.1.0: + resolution: {integrity: sha512-oMA2dcrw6u0YfxJQXm342bFKX/E4sG9rbTzO9ptUcR/e8A33cHuvStiYOwH7fszkZlZ1z/ta9AAoPk2F4qIOHA==} + engines: {node: '>=18'} + + rolldown@1.3.2: + resolution: {integrity: sha512-EFHqbVkXiYZA6akmYm2bvJhNbEGdUwAResRhYwl/BO8QhB5KxsG+t3RVHJSIOy5jBEb0XCACvrIGnnl6Z8sMGA==} + engines: {node: ^20.19.0 || >=22.12.0} + hasBin: true + + run-applescript@7.1.0: + resolution: {integrity: sha512-DPe5pVFaAsinSaV6QjQ6gdiedWDcRCbUuiQfQa2wmWV7+xC9bGulGI8+TdRmoFkAPaBXk8CrAbnlY2ISniJ47Q==} + engines: {node: '>=18'} + + rxjs@7.8.2: + resolution: {integrity: sha512-dhKf903U/PQZY6boNNtAGdWbG85WAbjT/1xYoZIC7FAY0yWapOBQVsVrDl58W86//e1VpMNBtRV4MaXfdMySFA==} + + safer-buffer@2.1.2: + resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} + + semver@7.8.6: + resolution: {integrity: sha512-9lpSSU4Mly3mrtruwLs1eLK6+gzbzqeBFwRNjIjE+9LuDpWdYctrQlQ3ej1Ilgi7gknpsTRnPoLP8DpCHqHIJw==} + engines: {node: '>=10'} + hasBin: true + + signal-exit@4.1.0: + resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} + engines: {node: '>=14'} + + skin-tone@2.0.0: + resolution: {integrity: sha512-kUMbT1oBJCpgrnKoSr0o6wPtvRWT9W9UKvGLwfJYO2WuahZRHOpEyL1ckyMGgMWh0UdpmaoFqKKD29WTomNEGA==} + engines: {node: '>=8'} + + source-map@0.8.0: + resolution: {integrity: sha512-d8EqvL+k/SOXCreS/SUzg2ciyHqBBLcN/yuRjFsbvVhHTE2pgei7oAhmPM7kWFbkX6OSMQfUq4KbkF3au9lhYQ==} + engines: {node: '>= 12'} + + stdin-discarder@0.3.2: + resolution: {integrity: sha512-eCPu1qRxPVkl5605OTWF8Wz40b4Mf45NY5LQmVPQ599knfs5QhASUm9GbJ5BDMDOXgrnh0wyEdvzmL//YMlw0A==} + engines: {node: '>=18'} + + string-width@8.3.0: + resolution: {integrity: sha512-ZbmZM0JCihQN91dWnxoipT2KOEyHqEyfRXUyjuRhW8b/xnqPDoq4gWEVApTVa9db2wN8mmoikgFBbjh71+cGeQ==} + engines: {node: '>=20'} + + strip-ansi@7.2.0: + resolution: {integrity: sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==} + engines: {node: '>=12'} + + tar@7.5.23: + resolution: {integrity: sha512-lkukzdoGngZHJZXxW4S/E4Fp9ghTDlyZXrQGRNoJ/LXvDKcXUTq2sg5yQe74po7Voea6n/IN09+wE/QvJMiifA==} + engines: {node: '>=18'} + + to-regex-range@5.0.1: + resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} + engines: {node: '>=8.0'} + + tslib@2.9.1: + resolution: {integrity: sha512-a4Ux9VKuIMHsOS7ENbEq6hK2ZGYIT27Rtl0E4eD9KqwxhKiQeMZE/9xb3IdYwWaSOyIBQLExhQgXDTYoiCxnWA==} + + typescript@6.0.3: + resolution: {integrity: sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw==} + engines: {node: '>=14.17'} + hasBin: true + + unicode-emoji-modifier-base@1.0.0: + resolution: {integrity: sha512-yLSH4py7oFH3oG/9K+XWrz1pSi3dfUrWEnInbxMfArOfc1+33BlGPQtLsOYwvdMy11AwUBetYuaRxSPqgkq+8g==} + engines: {node: '>=4'} + + unrun@0.3.1: + resolution: {integrity: sha512-onIck/oNnCaytwths1ZVp1LK2Gq2hPoyFhiHebObuUXqR3S0uHuLLaBK8K6mRRgV7Ptip8AnNvaUsgzwWwBZuA==} + engines: {node: ^22.13.0 || >=24.0.0} + hasBin: true + peerDependencies: + synckit: ^0.11.11 + peerDependenciesMeta: + synckit: + optional: true + + validator@13.15.35: + resolution: {integrity: sha512-TQ5pAGhd5whStmqWvYF4OjQROlmv9SMFVt37qoCBdqRffuuklWYQlCNnEs2ZaIBD1kZRNnikiZOS1eqgkar0iw==} + engines: {node: '>= 0.10'} + + wsl-utils@1.0.1: + resolution: {integrity: sha512-c16PKLIRxBYpR3jSWsdS7SFp0COm5SOQdiFjY818dYFHJbMGuLBszpF07LBWmOS1uzrHa9VGdynsEgoeKy0oOQ==} + engines: {node: '>=20'} + + yallist@5.0.0: + resolution: {integrity: sha512-YgvUTfwqyc7UXVMrB+SImsVYSmTS8X/tSrtdNZMImM+n7+QTriRXyXim0mBrTXNeqzVF0KWGgHPeiyViFFrNDw==} + engines: {node: '>=18'} + + yoctocolors@2.2.0: + resolution: {integrity: sha512-xYqdZFUK/VYazNl/oCDYN+3WloWQwMfZxBoiNt6qNyk+xfOdi598muWE42rNZFp1kNOiqW936q5RhUdnpqElSg==} + engines: {node: '>=18'} + + zod@4.6.7: + resolution: {integrity: sha512-g8W2D2kU6a8untc053fX1uVBKzM7yqAxW/3zwk83+6RyF2+SKOuV+c0wBDhUwzV1PaGapmZH+rmcUzPf+3CGwg==} + +snapshots: + + '@angular-devkit/core@22.2.7(chokidar@5.0.0)': + dependencies: + ajv: 8.20.0 + ajv-formats: 3.0.1(ajv@8.20.0) + jsonc-parser: 3.3.1 + picomatch: 4.0.7 + rxjs: 7.8.2 + source-map: 0.8.0 + optionalDependencies: + chokidar: 5.0.0 + + '@angular-devkit/schematics-cli@22.2.7(chokidar@5.0.0)': + dependencies: + '@angular-devkit/core': 22.2.7(chokidar@5.0.0) + '@angular-devkit/schematics': 22.2.7(chokidar@5.0.0) + '@inquirer/prompts': 8.7.2 + transitivePeerDependencies: + - '@types/node' + - chokidar + + '@angular-devkit/schematics@22.2.7(chokidar@5.0.0)': + dependencies: + '@angular-devkit/core': 22.2.7(chokidar@5.0.0) + jsonc-parser: 3.3.1 + magic-string: 1.4.1 + ora: 9.4.1 + rxjs: 7.8.2 + transitivePeerDependencies: + - chokidar + + '@emnapi/core@2.0.0-beta.2': + dependencies: + '@emnapi/wasi-threads': 2.2.0 + tslib: 2.9.1 + optional: true + + '@emnapi/runtime@2.0.0-beta.2': + dependencies: + tslib: 2.9.1 + optional: true + + '@emnapi/wasi-threads@2.2.0': + dependencies: + tslib: 2.9.1 + optional: true + + '@inquirer/ansi@2.1.0': {} + + '@inquirer/checkbox@5.3.0': + dependencies: + '@inquirer/ansi': 2.1.0 + '@inquirer/core': 12.1.0 + '@inquirer/figures': 2.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/confirm@6.4.0': + dependencies: + '@inquirer/core': 12.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/core@12.1.0': + dependencies: + '@inquirer/ansi': 2.1.0 + '@inquirer/figures': 2.1.0 + '@inquirer/type': 4.3.0 + cli-width: 4.1.0 + fast-wrap-ansi: 0.2.2 + mute-stream: 4.0.0 + signal-exit: 4.1.0 + + '@inquirer/editor@5.4.0': + dependencies: + '@inquirer/core': 12.1.0 + '@inquirer/external-editor': 3.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/expand@5.2.0': + dependencies: + '@inquirer/core': 12.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/external-editor@3.1.0': + dependencies: + chardet: 2.2.0 + iconv-lite: 0.7.3 + + '@inquirer/figures@2.1.0': {} + + '@inquirer/input@5.2.0': + dependencies: + '@inquirer/core': 12.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/number@4.3.0': + dependencies: + '@inquirer/core': 12.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/password@5.3.0': + dependencies: + '@inquirer/ansi': 2.1.0 + '@inquirer/core': 12.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/prompts@8.7.2': + dependencies: + '@inquirer/checkbox': 5.3.0 + '@inquirer/confirm': 6.4.0 + '@inquirer/editor': 5.4.0 + '@inquirer/expand': 5.2.0 + '@inquirer/input': 5.2.0 + '@inquirer/number': 4.3.0 + '@inquirer/password': 5.3.0 + '@inquirer/rawlist': 5.4.0 + '@inquirer/search': 4.4.0 + '@inquirer/select': 5.3.0 + + '@inquirer/prompts@8.8.0': + dependencies: + '@inquirer/checkbox': 5.3.0 + '@inquirer/confirm': 6.4.0 + '@inquirer/editor': 5.4.0 + '@inquirer/expand': 5.2.0 + '@inquirer/input': 5.2.0 + '@inquirer/number': 4.3.0 + '@inquirer/password': 5.3.0 + '@inquirer/rawlist': 5.4.0 + '@inquirer/search': 4.4.0 + '@inquirer/select': 5.3.0 + + '@inquirer/rawlist@5.4.0': + dependencies: + '@inquirer/core': 12.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/search@4.4.0': + dependencies: + '@inquirer/core': 12.1.0 + '@inquirer/figures': 2.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/select@5.3.0': + dependencies: + '@inquirer/ansi': 2.1.0 + '@inquirer/core': 12.1.0 + '@inquirer/figures': 2.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/type@4.3.0': {} + + '@isaacs/fs-minipass@4.0.1': + dependencies: + minipass: 7.1.3 + + '@jridgewell/sourcemap-codec@1.6.0': {} + + '@nanoforge-dev/asset@3.0.0': + dependencies: + '@nanoforge-dev/common': 3.0.0 + + '@nanoforge-dev/cli@3.0.1': + dependencies: + '@angular-devkit/schematics': 22.2.7(chokidar@5.0.0) + '@angular-devkit/schematics-cli': 22.2.7(chokidar@5.0.0) + '@inquirer/prompts': 8.8.0 + '@nanoforge-dev/config': 3.0.1 + '@nanoforge-dev/editor': 0.1.4 + '@nanoforge-dev/loader-client': 1.7.0 + '@nanoforge-dev/loader-server': 1.7.0 + '@nanoforge-dev/registry': 3.0.1 + '@nanoforge-dev/schematics': 3.0.1(chokidar@5.0.0) + ansis: 4.5.0 + bun: 1.4.4 + chokidar: 5.0.0 + commander: 15.1.0 + dotenv: 18.0.10 + node-emoji: 2.2.0 + open: 11.0.4 + ora: 9.4.1 + rc9: 3.1.0 + transitivePeerDependencies: + - '@types/node' + - synckit + + '@nanoforge-dev/common@3.0.0': {} + + '@nanoforge-dev/config@3.0.1': + dependencies: + unrun: 0.3.1 + zod: 4.6.7 + transitivePeerDependencies: + - synckit + + '@nanoforge-dev/core@3.0.0': + dependencies: + '@nanoforge-dev/asset': 3.0.0 + '@nanoforge-dev/common': 3.0.0 + + '@nanoforge-dev/ecs@3.0.0(@nanoforge-dev/editor-lib@3.0.0)': + dependencies: + '@nanoforge-dev/common': 3.0.0 + optionalDependencies: + '@nanoforge-dev/editor-lib': 3.0.0 + + '@nanoforge-dev/editor-lib@3.0.0': + dependencies: + '@nanoforge-dev/common': 3.0.0 + + '@nanoforge-dev/editor@0.1.4': + dependencies: + bun: 1.4.4 + class-transformer: 0.5.1 + class-validator: 0.15.1 + dotenv: 17.4.2 + micromatch: 4.0.8 + tar: 7.5.23 + typescript: 6.0.3 + + '@nanoforge-dev/env@3.0.0': + dependencies: + '@nanoforge-dev/common': 3.0.0 + class-transformer: 0.5.1 + class-validator: 0.14.4 + + '@nanoforge-dev/graphics-2d@3.0.0': + dependencies: + '@nanoforge-dev/common': 3.0.0 + konva: 10.9.1 + transitivePeerDependencies: + - canvas + - skia-canvas + + '@nanoforge-dev/input@3.0.0': + dependencies: + '@nanoforge-dev/common': 3.0.0 + + '@nanoforge-dev/loader-client@1.7.0': + dependencies: + '@nanoforge-dev/loader-website': 1.7.0 + bun: 1.4.4 + commander: 15.1.0 + + '@nanoforge-dev/loader-server@1.7.0': + dependencies: + bun: 1.4.4 + commander: 15.1.0 + + '@nanoforge-dev/loader-website@1.7.0': {} + + '@nanoforge-dev/registry@3.0.1': + dependencies: + fflate: 0.8.3 + semver: 7.8.6 + zod: 4.6.7 + + '@nanoforge-dev/schematics@3.0.1(chokidar@5.0.0)': + dependencies: + '@angular-devkit/core': 22.2.7(chokidar@5.0.0) + '@angular-devkit/schematics': 22.2.7(chokidar@5.0.0) + rxjs: 7.8.2 + transitivePeerDependencies: + - chokidar + + '@nanoforge-dev/sound@3.0.0(@nanoforge-dev/editor-lib@3.0.0)': + dependencies: + '@nanoforge-dev/common': 3.0.0 + optionalDependencies: + '@nanoforge-dev/editor-lib': 3.0.0 + + '@napi-rs/wasm-runtime@1.2.6(@emnapi/core@2.0.0-beta.2)(@emnapi/runtime@2.0.0-beta.2)': + dependencies: + '@emnapi/core': 2.0.0-beta.2 + '@emnapi/runtime': 2.0.0-beta.2 + '@tybys/wasm-util': 0.10.4 + optional: true + + '@oven/bun-darwin-aarch64@1.4.4': + optional: true + + '@oven/bun-darwin-x64@1.4.4': + optional: true + + '@oven/bun-freebsd-aarch64@1.4.4': + optional: true + + '@oven/bun-freebsd-x64@1.4.4': + optional: true + + '@oven/bun-linux-aarch64-android@1.4.4': + optional: true + + '@oven/bun-linux-aarch64-musl@1.4.4': + optional: true + + '@oven/bun-linux-aarch64@1.4.4': + optional: true + + '@oven/bun-linux-x64-android@1.4.4': + optional: true + + '@oven/bun-linux-x64-musl@1.4.4': + optional: true + + '@oven/bun-linux-x64@1.4.4': + optional: true + + '@oven/bun-windows-aarch64@1.4.4': + optional: true + + '@oven/bun-windows-x64@1.4.4': + optional: true + + '@oxc-project/types@0.158.0': {} + + '@rolldown/binding-android-arm-eabi@1.3.2': + optional: true + + '@rolldown/binding-android-arm64@1.3.2': + optional: true + + '@rolldown/binding-darwin-arm64@1.3.2': + optional: true + + '@rolldown/binding-darwin-x64@1.3.2': + optional: true + + '@rolldown/binding-freebsd-x64@1.3.2': + optional: true + + '@rolldown/binding-linux-arm-gnueabihf@1.3.2': + optional: true + + '@rolldown/binding-linux-arm64-gnu@1.3.2': + optional: true + + '@rolldown/binding-linux-arm64-musl@1.3.2': + optional: true + + '@rolldown/binding-linux-ppc64-gnu@1.3.2': + optional: true + + '@rolldown/binding-linux-s390x-gnu@1.3.2': + optional: true + + '@rolldown/binding-linux-x64-gnu@1.3.2': + optional: true + + '@rolldown/binding-linux-x64-musl@1.3.2': + optional: true + + '@rolldown/binding-openharmony-arm64@1.3.2': + optional: true + + '@rolldown/binding-wasm32-wasi@1.3.2': + dependencies: + '@emnapi/core': 2.0.0-beta.2 + '@emnapi/runtime': 2.0.0-beta.2 + '@napi-rs/wasm-runtime': 1.2.6(@emnapi/core@2.0.0-beta.2)(@emnapi/runtime@2.0.0-beta.2) + optional: true + + '@rolldown/binding-win32-arm64-msvc@1.3.2': + optional: true + + '@rolldown/binding-win32-x64-msvc@1.3.2': + optional: true + + '@rolldown/pluginutils@1.1.0': {} + + '@sindresorhus/is@4.6.0': {} + + '@tybys/wasm-util@0.10.4': + dependencies: + tslib: 2.9.1 + optional: true + + '@types/validator@13.15.10': {} + + ajv-formats@3.0.1(ajv@8.20.0): + optionalDependencies: + ajv: 8.20.0 + + ajv@8.20.0: + dependencies: + fast-deep-equal: 3.1.3 + fast-uri: 3.1.9 + json-schema-traverse: 1.0.0 + require-from-string: 2.0.2 + + ansi-regex@6.6.0: {} + + ansis@4.5.0: {} + + braces@3.0.3: + dependencies: + fill-range: 7.1.1 + + bun@1.4.4: + optionalDependencies: + '@oven/bun-darwin-aarch64': 1.4.4 + '@oven/bun-darwin-x64': 1.4.4 + '@oven/bun-freebsd-aarch64': 1.4.4 + '@oven/bun-freebsd-x64': 1.4.4 + '@oven/bun-linux-aarch64': 1.4.4 + '@oven/bun-linux-aarch64-android': 1.4.4 + '@oven/bun-linux-aarch64-musl': 1.4.4 + '@oven/bun-linux-x64': 1.4.4 + '@oven/bun-linux-x64-android': 1.4.4 + '@oven/bun-linux-x64-musl': 1.4.4 + '@oven/bun-windows-aarch64': 1.4.4 + '@oven/bun-windows-x64': 1.4.4 + + bundle-name@4.1.1: + dependencies: + run-applescript: 7.1.0 + + chalk@5.6.2: {} + + char-regex@1.0.2: {} + + chardet@2.2.0: {} + + chokidar@5.0.0: + dependencies: + readdirp: 5.1.1 + + chownr@3.0.0: {} + + class-transformer@0.5.1: {} + + class-validator@0.14.4: + dependencies: + '@types/validator': 13.15.10 + libphonenumber-js: 1.13.16 + validator: 13.15.35 + + class-validator@0.15.1: + dependencies: + '@types/validator': 13.15.10 + libphonenumber-js: 1.13.16 + validator: 13.15.35 + + cli-cursor@5.0.0: + dependencies: + restore-cursor: 5.1.0 + + cli-spinners@3.4.0: {} + + cli-width@4.1.0: {} + + commander@15.1.0: {} + + default-browser-id@5.0.1: {} + + default-browser@5.5.1: + dependencies: + bundle-name: 4.1.1 + default-browser-id: 5.0.1 + + define-lazy-prop@3.0.0: {} + + defu@6.1.7: {} + + destr@2.0.5: {} + + dotenv@17.4.2: {} + + dotenv@18.0.10: {} + + emojilib@2.4.0: {} + + fast-deep-equal@3.1.3: {} + + fast-string-truncated-width@3.0.3: {} + + fast-string-width@3.0.2: + dependencies: + fast-string-truncated-width: 3.0.3 + + fast-uri@3.1.9: {} + + fast-wrap-ansi@0.2.2: + dependencies: + fast-string-width: 3.0.2 + + fflate@0.8.3: {} + + fill-range@7.1.1: + dependencies: + to-regex-range: 5.0.1 + + get-east-asian-width@1.7.0: {} + + iconv-lite@0.7.3: + dependencies: + safer-buffer: 2.1.2 + + is-docker@3.0.0: {} + + is-in-ssh@1.0.0: {} + + is-inside-container@1.0.0: + dependencies: + is-docker: 3.0.0 + + is-interactive@2.0.0: {} + + is-number@7.0.0: {} + + is-unicode-supported@2.1.0: {} + + is-wsl@3.1.1: + dependencies: + is-inside-container: 1.0.0 + + json-schema-traverse@1.0.0: {} + + jsonc-parser@3.3.1: {} + + konva@10.9.1: {} + + libphonenumber-js@1.13.16: {} + + log-symbols@7.0.1: + dependencies: + is-unicode-supported: 2.1.0 + yoctocolors: 2.2.0 + + magic-string@1.4.1: + dependencies: + '@jridgewell/sourcemap-codec': 1.6.0 + + micromatch@4.0.8: + dependencies: + braces: 3.0.3 + picomatch: 2.3.2 + + mimic-function@5.0.1: {} + + minipass@7.1.3: {} + + minizlib@3.1.0: + dependencies: + minipass: 7.1.3 + + mute-stream@4.0.0: {} + + node-emoji@2.2.0: + dependencies: + '@sindresorhus/is': 4.6.0 + char-regex: 1.0.2 + emojilib: 2.4.0 + skin-tone: 2.0.0 + + onetime@7.0.0: + dependencies: + mimic-function: 5.0.1 + + open@11.0.4: + dependencies: + default-browser: 5.5.1 + define-lazy-prop: 3.0.0 + is-in-ssh: 1.0.0 + is-inside-container: 1.0.0 + powershell-utils: 0.2.1 + wsl-utils: 1.0.1 + + ora@9.4.1: + dependencies: + chalk: 5.6.2 + cli-cursor: 5.0.0 + cli-spinners: 3.4.0 + is-interactive: 2.0.0 + is-unicode-supported: 2.1.0 + log-symbols: 7.0.1 + stdin-discarder: 0.3.2 + string-width: 8.3.0 + + picomatch@2.3.2: {} + + picomatch@4.0.7: {} + + powershell-utils@0.2.1: {} + + rc9@3.1.0: + dependencies: + defu: 6.1.7 + destr: 2.0.5 + + readdirp@5.1.1: {} + + require-from-string@2.0.2: {} + + restore-cursor@5.1.0: + dependencies: + onetime: 7.0.0 + signal-exit: 4.1.0 + + rolldown@1.3.2: + dependencies: + '@oxc-project/types': 0.158.0 + '@rolldown/pluginutils': 1.1.0 + optionalDependencies: + '@rolldown/binding-android-arm-eabi': 1.3.2 + '@rolldown/binding-android-arm64': 1.3.2 + '@rolldown/binding-darwin-arm64': 1.3.2 + '@rolldown/binding-darwin-x64': 1.3.2 + '@rolldown/binding-freebsd-x64': 1.3.2 + '@rolldown/binding-linux-arm-gnueabihf': 1.3.2 + '@rolldown/binding-linux-arm64-gnu': 1.3.2 + '@rolldown/binding-linux-arm64-musl': 1.3.2 + '@rolldown/binding-linux-ppc64-gnu': 1.3.2 + '@rolldown/binding-linux-s390x-gnu': 1.3.2 + '@rolldown/binding-linux-x64-gnu': 1.3.2 + '@rolldown/binding-linux-x64-musl': 1.3.2 + '@rolldown/binding-openharmony-arm64': 1.3.2 + '@rolldown/binding-wasm32-wasi': 1.3.2 + '@rolldown/binding-win32-arm64-msvc': 1.3.2 + '@rolldown/binding-win32-x64-msvc': 1.3.2 + + run-applescript@7.1.0: {} + + rxjs@7.8.2: + dependencies: + tslib: 2.9.1 + + safer-buffer@2.1.2: {} + + semver@7.8.6: {} + + signal-exit@4.1.0: {} + + skin-tone@2.0.0: + dependencies: + unicode-emoji-modifier-base: 1.0.0 + + source-map@0.8.0: {} + + stdin-discarder@0.3.2: {} + + string-width@8.3.0: + dependencies: + get-east-asian-width: 1.7.0 + strip-ansi: 7.2.0 + + strip-ansi@7.2.0: + dependencies: + ansi-regex: 6.6.0 + + tar@7.5.23: + dependencies: + '@isaacs/fs-minipass': 4.0.1 + chownr: 3.0.0 + minipass: 7.1.3 + minizlib: 3.1.0 + yallist: 5.0.0 + + to-regex-range@5.0.1: + dependencies: + is-number: 7.0.0 + + tslib@2.9.1: {} + + typescript@6.0.3: {} + + unicode-emoji-modifier-base@1.0.0: {} + + unrun@0.3.1: + dependencies: + rolldown: 1.3.2 + + validator@13.15.35: {} + + wsl-utils@1.0.1: + dependencies: + is-wsl: 3.1.1 + powershell-utils: 0.2.1 + + yallist@5.0.0: {} + + yoctocolors@2.2.0: {} + + zod@4.6.7: {} diff --git a/basics/sound/pnpm-workspace.yaml b/basics/sound/pnpm-workspace.yaml new file mode 100644 index 0000000..96ca535 --- /dev/null +++ b/basics/sound/pnpm-workspace.yaml @@ -0,0 +1,5 @@ +allowBuilds: + bun: true +# NanoForge packages are ours: take a release as soon as it is out. +minimumReleaseAgeExclude: + - "@nanoforge-dev/*" diff --git a/basics/sound/src/components/drawable-circle-2d.component.ts b/basics/sound/src/components/drawable-circle-2d.component.ts new file mode 100644 index 0000000..1066155 --- /dev/null +++ b/basics/sound/src/components/drawable-circle-2d.component.ts @@ -0,0 +1,62 @@ +import type { AssetContext } from "@nanoforge-dev/common"; +import { Circle, type Layer } from "@nanoforge-dev/graphics-2d"; +import type { Position2D } from "./position-2d.component"; + +import { imageFill } from "../image-fill"; + +/** + * Draws a circle at the entity's `Position2D` (its center). Needs the `draw2D` system. + * + * @remarks + * `shape` is the Konva `Circle` on screen: change it from code for anything the parameters don't + * offer (shadows, strokes...). + * + * @component + * @side client + * @group Shape color=#e86fb0 - Size of the circle. + * @group Look color=#b18cff - What the circle looks like. + * @group Advanced hidden - Less common settings. + */ +export class DrawableCircle2D { + name = "DrawableCircle2D"; + + /** The circle on screen, made by `draw2D` the first time it draws it. */ + shape?: Circle; + + constructor( + /** In pixels. @group Shape */ + public radius = 25, + /** A CSS color: `red`, `#ff0000`, `rgba(255, 0, 0, 0.5)`... @group Look @preset color */ + public fillColor = "#4aa3ff", + /** An image stretched over the circle, shown instead of the color. @group Look @asset .png .jpg .jpeg .gif .webp .svg */ + public image = "", + /** From 0 (invisible) to 1 (opaque). @group Look */ + public opacity = 1, + /** Clockwise, in degrees, around the center. @group Advanced */ + public rotation = 0, + /** Whether it is drawn. @group Advanced */ + public visible = true, + ) {} + + /** Puts the circle on `layer` at `position`, up to date with the parameters. */ + draw(layer: Layer, position: Position2D, assets: AssetContext): void { + this.shape ??= new Circle(); + if (this.shape.getParent() !== layer) layer.add(this.shape); + this.shape.setAttrs({ + x: position.x, + y: position.y, + radius: this.radius, + fill: this.fillColor, + opacity: this.opacity, + rotation: this.rotation, + visible: this.visible, + ...imageFill(assets, this.image, this.radius * 2, this.radius * 2, true), + }); + } + + /** Removes the circle from the screen. */ + destroy(): void { + this.shape?.destroy(); + this.shape = undefined; + } +} diff --git a/basics/sound/src/components/drawable-rect-2d.component.ts b/basics/sound/src/components/drawable-rect-2d.component.ts new file mode 100644 index 0000000..d3586ca --- /dev/null +++ b/basics/sound/src/components/drawable-rect-2d.component.ts @@ -0,0 +1,69 @@ +import type { AssetContext } from "@nanoforge-dev/common"; +import { type Layer, Rect } from "@nanoforge-dev/graphics-2d"; +import type { Position2D } from "./position-2d.component"; + +import { imageFill } from "../image-fill"; + +/** + * Draws a rectangle at the entity's `Position2D` (its top-left corner). Needs the `draw2D` + * system. + * + * @remarks + * `shape` is the Konva `Rect` on screen: change it from code for anything the parameters don't + * offer (shadows, strokes...). + * + * @component + * @side client + * @group Shape color=#e86fb0 - Size of the rectangle. + * @group Look color=#b18cff - What the rectangle looks like. + * @group Advanced hidden - Less common settings. + */ +export class DrawableRect2D { + name = "DrawableRect2D"; + + /** The rectangle on screen, made by `draw2D` the first time it draws it. */ + shape?: Rect; + + constructor( + /** In pixels. @group Shape @preset size.width */ + public width = 50, + /** In pixels. @group Shape @preset size.height */ + public height = 50, + /** A CSS color: `red`, `#ff0000`, `rgba(255, 0, 0, 0.5)`... @group Look @preset color */ + public fillColor = "#4aa3ff", + /** An image stretched over the rectangle, shown instead of the color. @group Look @asset .png .jpg .jpeg .gif .webp .svg */ + public image = "", + /** From 0 (invisible) to 1 (opaque). @group Look */ + public opacity = 1, + /** Clockwise, in degrees, around the top-left corner. @group Advanced */ + public rotation = 0, + /** Rounds the corners, in pixels. @group Advanced */ + public cornerRadius = 0, + /** Whether it is drawn. @group Advanced */ + public visible = true, + ) {} + + /** Puts the rectangle on `layer` at `position`, up to date with the parameters. */ + draw(layer: Layer, position: Position2D, assets: AssetContext): void { + this.shape ??= new Rect(); + if (this.shape.getParent() !== layer) layer.add(this.shape); + this.shape.setAttrs({ + x: position.x, + y: position.y, + width: this.width, + height: this.height, + fill: this.fillColor, + opacity: this.opacity, + rotation: this.rotation, + cornerRadius: this.cornerRadius, + visible: this.visible, + ...imageFill(assets, this.image, this.width, this.height), + }); + } + + /** Removes the rectangle from the screen. */ + destroy(): void { + this.shape?.destroy(); + this.shape = undefined; + } +} diff --git a/basics/sound/src/components/drawable-text-2d.component.ts b/basics/sound/src/components/drawable-text-2d.component.ts new file mode 100644 index 0000000..adba963 --- /dev/null +++ b/basics/sound/src/components/drawable-text-2d.component.ts @@ -0,0 +1,62 @@ +import { type Layer, Text } from "@nanoforge-dev/graphics-2d"; +import type { Position2D } from "./position-2d.component"; + +/** + * Draws a text at the entity's `Position2D` (its top-left corner). Needs the `draw2D` system. + * + * @remarks + * Change `text` from a system to show a score, a timer... `shape` is the Konva `Text` on screen: + * change it from code for anything the parameters don't offer. + * + * @component + * @side client + * @group Text color=#e86fb0 - What is written. + * @group Look color=#b18cff - What the text looks like. + * @group Advanced hidden - Less common settings. + */ +export class DrawableText2D { + name = "DrawableText2D"; + + /** The text on screen, made by `draw2D` the first time it draws it. */ + shape?: Text; + + constructor( + /** What is written. @group Text */ + public text = "Hello", + /** Height of the letters, in pixels. @group Text */ + public fontSize = 24, + /** A CSS color: `white`, `#ffffff`... @group Look @preset color */ + public fillColor = "#ffffff", + /** From 0 (invisible) to 1 (opaque). @group Look */ + public opacity = 1, + /** A CSS font family: `Arial`, `monospace`... @group Advanced */ + public fontFamily = "Arial", + /** Clockwise, in degrees, around the top-left corner. @group Advanced */ + public rotation = 0, + /** Whether it is drawn. @group Advanced */ + public visible = true, + ) {} + + /** Puts the text on `layer` at `position`, up to date with the parameters. */ + draw(layer: Layer, position: Position2D): void { + this.shape ??= new Text(); + if (this.shape.getParent() !== layer) layer.add(this.shape); + this.shape.setAttrs({ + x: position.x, + y: position.y, + text: this.text, + fontSize: this.fontSize, + fontFamily: this.fontFamily, + fill: this.fillColor, + opacity: this.opacity, + rotation: this.rotation, + visible: this.visible, + }); + } + + /** Removes the text from the screen. */ + destroy(): void { + this.shape?.destroy(); + this.shape = undefined; + } +} diff --git a/basics/sound/src/components/mute-on-key.component.ts b/basics/sound/src/components/mute-on-key.component.ts new file mode 100644 index 0000000..fd52cc6 --- /dev/null +++ b/basics/sound/src/components/mute-on-key.component.ts @@ -0,0 +1,23 @@ +import { InputEnum } from "@nanoforge-dev/input"; + +/** + * Turns the audio on and off with a key, and writes whether it is on in the entity's + * `DrawableText2D`. Needs the system of the library it mutes: `muteSoundOnKey` or + * `muteMusicOnKey`. + * + * @component + * @side client + */ +export class MuteOnKey { + name = "MuteOnKey"; + + /** Whether the audio is off; the sound and music libraries start muted. Set by the system. */ + muted = true; + /** Whether the key was down last frame, set by the system. */ + held = false; + + constructor( + /** The key that turns the audio on and off. */ + public key: InputEnum = InputEnum.KeyM, + ) {} +} diff --git a/basics/sound/src/components/play-on-key.component.ts b/basics/sound/src/components/play-on-key.component.ts new file mode 100644 index 0000000..9f7298d --- /dev/null +++ b/basics/sound/src/components/play-on-key.component.ts @@ -0,0 +1,29 @@ +import { InputEnum } from "@nanoforge-dev/input"; + +/** + * Plays an audio asset each time a key is pressed. Needs the system of the library that plays it: + * `playSoundOnKey` (the sound library: effects that may overlap) or `playMusicOnKey` (the music + * library: one track at a time). + * + * @remarks + * Both libraries start muted: add a `MuteOnKey` to let the player turn them on. + * + * @component + * @side client + * @group Audio color=#f0a33a - What is played, and when. + */ +export class PlayOnKey { + name = "PlayOnKey"; + + /** Whether the key was down last frame, set by the system. */ + held = false; + /** Whether `file` was handed to the library, or is not an asset. Set by the system. */ + status?: "loaded" | "missing"; + + constructor( + /** The key that plays it. @group Audio */ + public key: InputEnum = InputEnum.Space, + /** The audio file. @group Audio @asset .wav .mp3 .ogg */ + public file = "", + ) {} +} diff --git a/basics/sound/src/components/position-2d.component.ts b/basics/sound/src/components/position-2d.component.ts new file mode 100644 index 0000000..0a35624 --- /dev/null +++ b/basics/sound/src/components/position-2d.component.ts @@ -0,0 +1,20 @@ +/** + * Where an entity is, in pixels from the top-left corner of the screen. + * + * @remarks + * For rectangles it is their top-left corner, for circles their center. + * + * @component + * @side shared + * @group Position color=#4aa3ff - Pixels from the top-left corner of the screen. + */ +export class Position2D { + name = "Position2D"; + + constructor( + /** Pixels from the left edge. @group Position @preset vector.x */ + public x = 0, + /** Pixels from the top edge. @group Position @preset vector.y */ + public y = 0, + ) {} +} diff --git a/basics/sound/src/image-fill.ts b/basics/sound/src/image-fill.ts new file mode 100644 index 0000000..c7fc737 --- /dev/null +++ b/basics/sound/src/image-fill.ts @@ -0,0 +1,43 @@ +import type { AssetContext } from "@nanoforge-dev/common"; +import type { ShapeConfig } from "@nanoforge-dev/graphics-2d"; + +const images = new Map(); + +/** + * The fill of a shape of `width` by `height` pixels showing the image at `path` (an asset path + * such as `/textures/hero.png`, found in `assets`) stretched over it. Without an image, until it + * is loaded, or when there is no asset at `path`, the shape is filled with its color. + * + * @param centered - Whether the shape's origin is its center (a circle) instead of its top-left + * corner (a rectangle). + */ +export const imageFill = ( + assets: AssetContext, + path: string, + width: number, + height: number, + centered = false, +): ShapeConfig => { + if (!path) return { fillPriority: "color", fillPatternImage: undefined }; + let image = images.get(path); + if (!image) { + image = document.createElement("img"); + try { + image.src = assets.getAsset(path).path; + } catch (error) { + // Once per path, not every frame: the shape keeps its color. + console.warn(`No image at "${path}":`, error); + } + images.set(path, image); + } + if (!image.naturalWidth) return { fillPriority: "color", fillPatternImage: undefined }; + return { + fillPriority: "pattern", + fillPatternImage: image, + fillPatternRepeat: "no-repeat", + fillPatternScaleX: width / image.naturalWidth, + fillPatternScaleY: height / image.naturalHeight, + fillPatternOffsetX: centered ? image.naturalWidth / 2 : 0, + fillPatternOffsetY: centered ? image.naturalHeight / 2 : 0, + }; +}; diff --git a/basics/sound/src/main.ts b/basics/sound/src/main.ts new file mode 100644 index 0000000..189799e --- /dev/null +++ b/basics/sound/src/main.ts @@ -0,0 +1,59 @@ +import type { ClientRunOptions } from "@nanoforge-dev/common"; +import { NanoforgeFactory } from "@nanoforge-dev/core"; +import { EcsLibrary } from "@nanoforge-dev/ecs/client"; +import { EditorLibrary } from "@nanoforge-dev/editor-lib"; +import { Graphics2DLibrary } from "@nanoforge-dev/graphics-2d"; +import { InputEnum, InputLibrary } from "@nanoforge-dev/input"; +import { SoundLibrary } from "@nanoforge-dev/sound"; + +import { DrawableRect2D } from "./components/drawable-rect-2d.component"; +import { DrawableText2D } from "./components/drawable-text-2d.component"; +import { Position2D } from "./components/position-2d.component"; +import { MuteOnKey } from "./components/mute-on-key.component"; +import { PlayOnKey } from "./components/play-on-key.component"; +import { draw2D } from "./systems/draw-2d.system"; +import { muteSoundOnKey } from "./systems/mute-sound-on-key.system"; +import { playSoundOnKey } from "./systems/play-sound-on-key.system"; + +export const main = async (options: ClientRunOptions): Promise => { + const app = NanoforgeFactory.createClient({ + tickRate: 60, + viewport: { width: 800, height: 600, fit: "contain" }, + }); + const ecs = new EcsLibrary(); + + app.use(new Graphics2DLibrary()); + app.use(ecs); + app.use(new InputLibrary()); + app.use(new SoundLibrary()); + app.use(new EditorLibrary()); + + await app.init(options); + + const registry = ecs.registry; + + const background = registry.spawnEntity(); + registry.addComponent(background, new Position2D(0, 0)); + registry.addComponent(background, new DrawableRect2D(800, 600, "#1e1e2e")); + + const help = registry.spawnEntity(); + registry.addComponent(help, new Position2D(20, 20)); + registry.addComponent(help, new DrawableText2D("Space: wing Enter: hit", 24, "#cdd6f4")); + + const mute = registry.spawnEntity(); + registry.addComponent(mute, new Position2D(20, 60)); + registry.addComponent(mute, new DrawableText2D("", 24, "#f9e2af")); + registry.addComponent(mute, new MuteOnKey(InputEnum.KeyM)); + + const wing = registry.spawnEntity(); + registry.addComponent(wing, new PlayOnKey(InputEnum.Space, "/wing.wav")); + + const hit = registry.spawnEntity(); + registry.addComponent(hit, new PlayOnKey(InputEnum.Enter, "/hit.wav")); + + registry.addSystem(muteSoundOnKey); + registry.addSystem(playSoundOnKey); + registry.addSystem(draw2D); + + await app.run(); +}; diff --git a/basics/sound/src/systems/draw-2d.system.ts b/basics/sound/src/systems/draw-2d.system.ts new file mode 100644 index 0000000..937eeeb --- /dev/null +++ b/basics/sound/src/systems/draw-2d.system.ts @@ -0,0 +1,45 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; +import "@nanoforge-dev/graphics-2d"; +import { Position2D } from "../components/position-2d.component"; + +import { DrawableCircle2D } from "../components/drawable-circle-2d.component"; +import { DrawableRect2D } from "../components/drawable-rect-2d.component"; +import { DrawableText2D } from "../components/drawable-text-2d.component"; + +type Drawable = DrawableRect2D | DrawableCircle2D | DrawableText2D; + +/** The drawables shown by the last frame. */ +let shown = new Set(); + +/** + * Draws every entity that has a `Position2D` and a `DrawableRect2D`, `DrawableCircle2D` or + * `DrawableText2D`, where it is. Add it last, after the systems that move entities. + * + * @remarks + * The shape of a killed entity, or of a removed drawable, is removed from the screen. + * + * @system + * @side client + */ +export const draw2D = (registry: Registry, ctx: Context) => { + const layer = ctx.graphics.baseLayer; + const drawn = new Set(); + + registry.getZipper([DrawableRect2D, Position2D]).forEach(({ DrawableRect2D, Position2D }) => { + DrawableRect2D.draw(layer, Position2D, ctx.assets); + drawn.add(DrawableRect2D); + }); + registry.getZipper([DrawableCircle2D, Position2D]).forEach(({ DrawableCircle2D, Position2D }) => { + DrawableCircle2D.draw(layer, Position2D, ctx.assets); + drawn.add(DrawableCircle2D); + }); + registry.getZipper([DrawableText2D, Position2D]).forEach(({ DrawableText2D, Position2D }) => { + DrawableText2D.draw(layer, Position2D); + drawn.add(DrawableText2D); + }); + + // `killEntity` doesn't call `destroy()`: a drawable no longer in the world loses its shape here. + for (const drawable of shown) if (!drawn.has(drawable)) drawable.destroy(); + shown = drawn; +}; diff --git a/basics/sound/src/systems/mute-sound-on-key.system.ts b/basics/sound/src/systems/mute-sound-on-key.system.ts new file mode 100644 index 0000000..32e5c94 --- /dev/null +++ b/basics/sound/src/systems/mute-sound-on-key.system.ts @@ -0,0 +1,26 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; +import "@nanoforge-dev/input"; +import "@nanoforge-dev/sound"; +import { DrawableText2D } from "../components/drawable-text-2d.component"; + +import { MuteOnKey } from "../components/mute-on-key.component"; + +/** + * Turns the sound on or off when the key of a `MuteOnKey` is pressed, and writes the state in + * its entity's text. + * + * @system + * @side client + */ +export const muteSoundOnKey = (registry: Registry, ctx: Context) => { + registry.getZipper([MuteOnKey, DrawableText2D]).forEach(({ MuteOnKey, DrawableText2D }) => { + const down = ctx.input.isKeyPressed((MuteOnKey as MuteOnKey).key) === true; + if (down && !MuteOnKey.held) { + ctx.sound.mute(); + MuteOnKey.muted = !MuteOnKey.muted; + } + MuteOnKey.held = down; + DrawableText2D.text = MuteOnKey.muted ? "Sound off: press M" : "Sound on: press M to mute"; + }); +}; diff --git a/basics/sound/src/systems/play-sound-on-key.system.ts b/basics/sound/src/systems/play-sound-on-key.system.ts new file mode 100644 index 0000000..3c3a80e --- /dev/null +++ b/basics/sound/src/systems/play-sound-on-key.system.ts @@ -0,0 +1,32 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; +import "@nanoforge-dev/input"; +import "@nanoforge-dev/sound"; +import { PlayOnKey } from "../components/play-on-key.component"; + +/** + * Plays the sound of every `PlayOnKey` whose key was just pressed: sounds may overlap. Loads + * each sound into the sound library, under its asset path, the first time it sees it; a + * missing asset is reported once. + * + * @system + * @side client + */ +export const playSoundOnKey = (registry: Registry, ctx: Context) => { + registry.getZipper([PlayOnKey]).forEach(({ PlayOnKey }) => { + const { key, file } = PlayOnKey as PlayOnKey; + if (!PlayOnKey.status && file) { + try { + ctx.sound.load(file, ctx.assets.getAsset(file).path); + PlayOnKey.status = "loaded"; + } catch (error) { + // Once per component, not every frame: the key stays silent. + console.warn(`No sound at "${file}":`, error); + PlayOnKey.status = "missing"; + } + } + const down = ctx.input.isKeyPressed(key) === true; + if (down && !PlayOnKey.held && PlayOnKey.status === "loaded") ctx.sound.play(file); + PlayOnKey.held = down; + }); +}; diff --git a/basics/sound/tsconfig.json b/basics/sound/tsconfig.json new file mode 100644 index 0000000..c0ae4f2 --- /dev/null +++ b/basics/sound/tsconfig.json @@ -0,0 +1,39 @@ +{ + "$schema": "https://json.schemastore.org/tsconfig.json", + // Mapped from https://www.typescriptlang.org/tsconfig + "compilerOptions": { + // Type Checking + "allowUnreachableCode": false, + "allowUnusedLabels": false, + "noFallthroughCasesInSwitch": true, + "noImplicitOverride": true, + "noImplicitReturns": true, + "noPropertyAccessFromIndexSignature": false, + "noUncheckedIndexedAccess": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "strict": true, + + // Modules + "allowArbitraryExtensions": false, + "allowImportingTsExtensions": false, + "module": "ESNext", + "moduleResolution": "Bundler", + "resolveJsonModule": true, + "resolvePackageJsonExports": true, + "resolvePackageJsonImports": true, + + // Interop Constraints + "allowSyntheticDefaultImports": true, + "forceConsistentCasingInFileNames": true, + "isolatedModules": true, + + // Language and Environment + "experimentalDecorators": true, + "lib": ["ESNext", "esnext.disposable", "DOM"], + "target": "ESNext", + "useDefineForClassFields": true + }, + "include": ["src"], + "exclude": ["node_modules", ".nanoforge", "dist"] +} diff --git a/basics/sprite-2d/.gitignore b/basics/sprite-2d/.gitignore new file mode 100644 index 0000000..f28e2dc --- /dev/null +++ b/basics/sprite-2d/.gitignore @@ -0,0 +1,5 @@ +node_modules/ +dist/ +.nanoforge/ +nf_modules/ +.env diff --git a/basics/sprite-2d/README.md b/basics/sprite-2d/README.md new file mode 100644 index 0000000..0995fb8 --- /dev/null +++ b/basics/sprite-2d/README.md @@ -0,0 +1,18 @@ +# sprite-2d + +A flappy-bird scene: the background, a pipe and the bird are images. + +It shows images in 2D: the `image` parameter of `DrawableRect2D` and `DrawableCircle2D` is an +asset path (`/pipe-green.png` is `assets/pipe-green.png`), and the image is stretched over the +shape. Until the image is loaded, or when there is no asset at that path, the shape shows its +color. The round bird is the same image in a `DrawableCircle2D`. + +```sh +pnpm install +pnpm dev # play it +pnpm editor # open it in the editor +``` + +The images of `assets/` come from the flappy-bird example, under the MIT license in +`assets/LICENSE`. Every file of `src/` but `main.ts` is a copy of `shared/2d` (see the +repository's README). diff --git a/basics/sprite-2d/assets/LICENSE b/basics/sprite-2d/assets/LICENSE new file mode 100644 index 0000000..18a448b --- /dev/null +++ b/basics/sprite-2d/assets/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2019 Samuel Custodio + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/flappy-bird/client/static/background-day.png b/basics/sprite-2d/assets/background-day.png similarity index 100% rename from flappy-bird/client/static/background-day.png rename to basics/sprite-2d/assets/background-day.png diff --git a/flappy-bird/client/static/pipe-green.png b/basics/sprite-2d/assets/pipe-green.png similarity index 100% rename from flappy-bird/client/static/pipe-green.png rename to basics/sprite-2d/assets/pipe-green.png diff --git a/flappy-bird/client/static/yellowbird-midflap.png b/basics/sprite-2d/assets/yellowbird-midflap.png similarity index 100% rename from flappy-bird/client/static/yellowbird-midflap.png rename to basics/sprite-2d/assets/yellowbird-midflap.png diff --git a/basics/sprite-2d/nanoforge.config.ts b/basics/sprite-2d/nanoforge.config.ts new file mode 100644 index 0000000..77607cb --- /dev/null +++ b/basics/sprite-2d/nanoforge.config.ts @@ -0,0 +1,5 @@ +import { defineConfig } from "@nanoforge-dev/config"; + +export default defineConfig({ + type: "client", +}); diff --git a/basics/sprite-2d/package.json b/basics/sprite-2d/package.json new file mode 100644 index 0000000..6494439 --- /dev/null +++ b/basics/sprite-2d/package.json @@ -0,0 +1,25 @@ +{ + "$schema": "https://json.schemastore.org/package.json", + "name": "sprite-2d", + "description": "Draw images: the smallest NanoForge game showing sprites", + "private": true, + "type": "module", + "scripts": { + "dev": "nf dev", + "build": "nf build", + "start": "nf start", + "editor": "nf editor ." + }, + "devDependencies": { + "@nanoforge-dev/asset": "^3.0.0", + "@nanoforge-dev/cli": "^3.0.1", + "@nanoforge-dev/common": "^3.0.0", + "@nanoforge-dev/config": "^3.0.1", + "@nanoforge-dev/core": "^3.0.0", + "@nanoforge-dev/ecs": "^3.0.0", + "@nanoforge-dev/editor-lib": "^3.0.0", + "@nanoforge-dev/env": "^3.0.0", + "@nanoforge-dev/graphics-2d": "^3.0.0", + "typescript": "^6.0.0" + } +} diff --git a/basics/sprite-2d/pnpm-lock.yaml b/basics/sprite-2d/pnpm-lock.yaml new file mode 100644 index 0000000..68fe992 --- /dev/null +++ b/basics/sprite-2d/pnpm-lock.yaml @@ -0,0 +1,1501 @@ +lockfileVersion: '9.0' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + +importers: + + .: + devDependencies: + '@nanoforge-dev/asset': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/cli': + specifier: ^3.0.1 + version: 3.0.1 + '@nanoforge-dev/common': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/config': + specifier: ^3.0.1 + version: 3.0.1 + '@nanoforge-dev/core': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/ecs': + specifier: ^3.0.0 + version: 3.0.0(@nanoforge-dev/editor-lib@3.0.0) + '@nanoforge-dev/editor-lib': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/env': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/graphics-2d': + specifier: ^3.0.0 + version: 3.0.0 + typescript: + specifier: ^6.0.0 + version: 6.0.3 + +packages: + + '@angular-devkit/core@22.2.7': + resolution: {integrity: sha512-cchZAMsV4d76RDZBlWzPhYxM/Hb6bmq71oUngdrwehMbBbdQu3W9C2tGlvxuPxbRKru9ZlUa14YVXQ0+QnhFtw==} + engines: {node: ^22.22.3 || ^24.15.0 || >=26.0.0, npm: ^6.11.0 || ^7.5.6 || >=8.0.0, yarn: '>= 1.13.0'} + peerDependencies: + chokidar: ^5.0.0 + peerDependenciesMeta: + chokidar: + optional: true + + '@angular-devkit/schematics-cli@22.2.7': + resolution: {integrity: sha512-9Od0E8TiYTQWm/03QjYWnsryZA8ZSjTf/k5z61nPd/jgloVNvSW8kxC7/YMw+RoXh2idMzjiJxraKxg+gJxzPw==} + engines: {node: ^22.22.3 || ^24.15.0 || >=26.0.0, npm: ^6.11.0 || ^7.5.6 || >=8.0.0, yarn: '>= 1.13.0'} + hasBin: true + + '@angular-devkit/schematics@22.2.7': + resolution: {integrity: sha512-a1h7xNqBLQVo1e5eCyOU3axSbA9AFU6nnSH5QhlNhggfMeZde+eBrueSt25xsewoxlKO8EvkVT3+knMUkDYiGQ==} + engines: {node: ^22.22.3 || ^24.15.0 || >=26.0.0, npm: ^6.11.0 || ^7.5.6 || >=8.0.0, yarn: '>= 1.13.0'} + + '@emnapi/core@2.0.0-beta.2': + resolution: {integrity: sha512-MzCVoWtcg4Pm2B3je5mMvYMvj3MmBKw+fU7vbsJc9/iT8ip6/eYIHo/Dsm/mr+wsHB6SEyJDuxB09Yy6r/8+4A==} + + '@emnapi/runtime@2.0.0-beta.2': + resolution: {integrity: sha512-JcrSPzPvZuNZvJqPTF9Fw25LbOJ8avzFVlaf2grmH4Cku0oGP47tRgqPZadcfj3YoZMHkFVnCYFbQM8I+i5QEw==} + + '@emnapi/wasi-threads@2.2.0': + resolution: {integrity: sha512-JP7OYH38Q7+pyTAe14raZHLQIK7BDKbdwji+Xi3pcd/6QkJYQH3SX4wu6EplGrGJWRepoNzedfm0G3B9Z4e9Rw==} + + '@inquirer/ansi@2.1.0': + resolution: {integrity: sha512-63GU5AD9KhNbWM0jlhHoMJTEFck2upFOPxHlnCKf3xYTV3rjTUUQfodihmTnfYQzMLS29oy8lK/gA1eJgu4bhA==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + + '@inquirer/checkbox@5.3.0': + resolution: {integrity: sha512-3QQSO87A+JoRtOtjtsgX2enwTL+3+VBVrkUpdqrIxMOgn5+W5sE57PcCPAiNUIESHxV4Q6mNEGxq2xLmRa0/yw==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/confirm@6.4.0': + resolution: {integrity: sha512-+DCZxrOF01Q/1SzTQkgycAQPS/Jf+Yol0h1P/MVmopukTsxGOu1h/LKqf30y0eHKFZYYrgUMVhGDhEbPmSPi9A==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/core@12.1.0': + resolution: {integrity: sha512-6H7usRWw4Gdjgpaem10CA5MfZ/xoYPGyInriR1Xubqjv+SVo8LIJ1erpFxW5JgCza6VZVZiKLTko7RtUU3AQMg==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/editor@5.4.0': + resolution: {integrity: sha512-L7vdCe4jnMpzhDisu1tAnr4WGvfPOVz+vNFXyIIL7O2Ycn/n90sn1ARvg+4cwzLf+us51BE/cX7uhnrLcal3+g==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/expand@5.2.0': + resolution: {integrity: sha512-AOp2KQk7QojUyWOP7VkqdBWmxLRaVH58wQMx3N4//P530EDtpVp1EWIjAJubx9ZohWS/UCEpIkA1TuiNki0iOA==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/external-editor@3.1.0': + resolution: {integrity: sha512-27JAkF38nXqXaoveU28iA/+Z8nutnF8B3JsbdToPHn9WnkrsMtZ0/YoJ29YwbtFexYIo+tIy6ikMvTdHKjjmGA==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/figures@2.1.0': + resolution: {integrity: sha512-CR9u2PME23jxy2SOyTb117efwAAPm98Zr+LoWI+PiQ55D6U8Yeu/HyFTxwytKhPa6oxAGzdsm2Kg7oLS6B9z8w==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + + '@inquirer/input@5.2.0': + resolution: {integrity: sha512-sIUPnN2X7M+7dq3RUd+e9QRacYnM+6B+kSucwQgj5VC5Eo/f+CIr2NyPBumxsViI+wzfokkgop/3x3KfHxNyJw==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/number@4.3.0': + resolution: {integrity: sha512-xYkX4sPVgox0F7yQwpz/MByWjOGdLEf1pdjH+Lji2gAzSs2xezz5bN5YgS1n0tx9wo0mRhGvq1KJGtvDZ9XXcQ==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/password@5.3.0': + resolution: {integrity: sha512-KVqW4G/UbMK06uBN76xF89JKYC9YBWU7v+Kc2tUwMCO8pg3ASBr0HVabl1KaSqF94O2KiRu8aKx4EicN78PK+A==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/prompts@8.7.2': + resolution: {integrity: sha512-QoRB4wFIjgH5iOhSjoIKMkTvSHDuV+O3OITlIqAYO0oK5x364GJILXiMBvlPiE+klg7Xx9tq5XVqQHcGUDYYPA==} + engines: {node: '>=23.5.0 || ^22.13.0 || ^20.17.0'} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/prompts@8.8.0': + resolution: {integrity: sha512-yYVT2Eo3mafb9tnU2Mr3+wh5wLCWyspExqVoPSMCIfBIn3ZUTE4IDfbCMbMgXaOH0tH+JZEhOtfczQhDzOjIGg==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/rawlist@5.4.0': + resolution: {integrity: sha512-x42wcy465GM5/mHNKBFdAJbLlLyzmYqr/DEa6F49nHpI+03EFwRCRKeLGQakx5XqZ4unc2yFuS78qAD4Rb0iFA==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/search@4.4.0': + resolution: {integrity: sha512-UJ+9tkzPT1AjnvjuPFYcOdO3BVeN28bfSXajYRFZTRgA9OiNl4k2Nn2cHHPwiIDyPHlvOnmE9ZOHyXhPHtvb+A==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/select@5.3.0': + resolution: {integrity: sha512-Fmgfl0qjqCQo+/tjQpgnRXKh5N7/VpYcJh+AlYU2eHmHZLMGUBDzo+Gwc2ODzWJfXNRZmgaMhz4qULcO/C/rXg==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/type@4.3.0': + resolution: {integrity: sha512-/IA8q2nyjgyl0NGSjqiRXB8gh3We7Pzx9C0c+6Zoolu905jFc79anerrUG7+n65+qs310DRK43yi2WDI8nY59A==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@isaacs/fs-minipass@4.0.1': + resolution: {integrity: sha512-wgm9Ehl2jpeqP3zw/7mo3kRHFp5MEDhqAdwy1fTGkHAwnkGOVsgpvQhL8B5n1qlb01jV3n/bI0ZfZp5lWA1k4w==} + engines: {node: '>=18.0.0'} + + '@jridgewell/sourcemap-codec@1.6.0': + resolution: {integrity: sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw==} + + '@nanoforge-dev/asset@3.0.0': + resolution: {integrity: sha512-jqXcyCMbdcCCj7wZ/dyIpjY8hza02Pt/vY8KrNcaXTlxpTc9EE+VKuO5+fHdUXWWPgJSFt96TqAPhug+z+KH3Q==} + engines: {node: '26'} + + '@nanoforge-dev/cli@3.0.1': + resolution: {integrity: sha512-ZfrbETcAcX3vsPLO1WLSCJc2ERCAcIpbdi9Df5bmH3XLinQkDAcESkN9JkaI/vgV08A7xhTjV8zSDSwF0T73Xg==} + engines: {node: '26'} + hasBin: true + + '@nanoforge-dev/common@3.0.0': + resolution: {integrity: sha512-lzMvQ1vCElh9OcP4EqhffbY+AQXOH4IiuD1pj7VvJlpcY6hh7Bs/s4NVS0gXoJ+ibpBMe5mAq23RyzqTwk8czg==} + engines: {node: '26'} + + '@nanoforge-dev/config@3.0.1': + resolution: {integrity: sha512-XWRScOotb8IirerRx/mWLmUVYye3lo0PN/5a0MUp/eoSrhz0S6zzhGHEupRuC8aeHTjsQT7ctM3P6YyKSHZLaQ==} + engines: {node: '26'} + + '@nanoforge-dev/core@3.0.0': + resolution: {integrity: sha512-pa7Fr3TFkZVfAADBC17Qt5ru/W9vXtYB8e5eb7wurAtu8/jH/ZtqfW3kafTuWC9513MXp/h6LOCdZQhjnCt6UA==} + engines: {node: '26'} + + '@nanoforge-dev/ecs@3.0.0': + resolution: {integrity: sha512-csrXJtCzqohxtvEQs+O//xabnaLR3BXe0QpSpl7NVihF3f0iX2fNYURxNjQKxzoPYBokCnnyNxN2KFc7UmIsdA==} + engines: {node: '26'} + peerDependencies: + '@nanoforge-dev/editor-lib': 3.0.0 + '@nanoforge-dev/scene': 3.0.0 + peerDependenciesMeta: + '@nanoforge-dev/editor-lib': + optional: true + '@nanoforge-dev/scene': + optional: true + + '@nanoforge-dev/editor-lib@3.0.0': + resolution: {integrity: sha512-fSWm6bHelbxqeVESYoUUKDi9RGNxvRu6p1r41KE1DddM0RrP0/WzkFOWBvgl+psHbYNotXe723Y2Fd3p+tqPDQ==} + engines: {node: '26'} + + '@nanoforge-dev/editor@0.1.4': + resolution: {integrity: sha512-bqbrH8ulFSiZz1iisJHtHeEzj1RV/70uErCYHeW4DIhVPsWbBfWKFvg/ghAbmPk5vsj0YnhDX6DSpik4S1QoiQ==} + engines: {node: '25'} + + '@nanoforge-dev/env@3.0.0': + resolution: {integrity: sha512-kXYXl9/09Bn8VStTTFuZY3dYDG9b76VhOi9PHMnaLe75XcFRLKJ2dYkXf3ut6RCL2+6H7HAEIOALjR15CHnJ5A==} + engines: {node: '26'} + + '@nanoforge-dev/graphics-2d@3.0.0': + resolution: {integrity: sha512-0I0WUr5495jORdYR+HtyP4kmAfCMvixmG+EH/gE5bN33S8RO6/Ly4oMLZOLUywcDTAFuLn28BlHuVor2YfXrsg==} + engines: {node: '26'} + + '@nanoforge-dev/loader-client@1.7.0': + resolution: {integrity: sha512-zDj0yQ8cZyHHjAYDVIyB79mh4dK7WRgZG7Kc+d/43t2WX/pX2HqBVkpLcDPkA9cNOKpCRYWd3LyYISlz53gzyg==} + engines: {node: '26'} + + '@nanoforge-dev/loader-server@1.7.0': + resolution: {integrity: sha512-Yd/BYORhoar5znNSD7kGirAc1Al0q5t8iscbb07QWKeXWA+DLKjPSuKJC6ykysFkbs9HiZU59oOfxyvNL4h3Pw==} + engines: {node: '26'} + + '@nanoforge-dev/loader-website@1.7.0': + resolution: {integrity: sha512-x1fV3RYUUxru39sF5HJcfutNnifMMTIEHW92jgkR9gz06ZlZ+rQofuegXgAnEzs0dEXa+rhNQ/iXYbqOZvq6YQ==} + engines: {node: '26'} + + '@nanoforge-dev/registry@3.0.1': + resolution: {integrity: sha512-EzSaszYtrPldD5Do7jdQK3TLLb8uCirY6NQjKXkeGw31X+sUXor4h5GAaoxELWMzPnv9BbKtggSaVaQIt7s8IQ==} + engines: {node: '26'} + + '@nanoforge-dev/schematics@3.0.1': + resolution: {integrity: sha512-iK2vC0gPEh2mQ81IB4+jfGw/ZNOLMDnS9HRBXH5tWB0mdN5GA32viblhW0oYPX2/tWrLC9YiCPgEE4AL8Zwz6w==} + engines: {node: '26'} + + '@napi-rs/wasm-runtime@1.2.6': + resolution: {integrity: sha512-mRyDmEw9/fCDXCGfL1sbgIw/GUK0PVxRW4YwgPN61F3LQ+fSyoBFarJVzgGyhF6kRzEQZ0FejDqm4WLXSeqQmw==} + engines: {node: ^20.19.0 || ^22.13.0 || >=23.5.0} + peerDependencies: + '@emnapi/core': ^1.7.1 || 2.0.0-beta.2 + '@emnapi/runtime': ^1.7.1 || 2.0.0-beta.2 + + '@oven/bun-darwin-aarch64@1.4.4': + resolution: {integrity: sha512-zW/hxwc8sJAILGwB5eTC4i48ouGXf0V4lrxmEOk3JIE6JkYVW1TZh1E2pIempqsezgW1sckTIIDudFON8bJ2Mw==} + cpu: [arm64] + os: [darwin] + + '@oven/bun-darwin-x64@1.4.4': + resolution: {integrity: sha512-oKGcxLsvh4oHjAo28nPm8c/xN0o/OmGyj1IHYc94vprkWsW2hNg2keEZt5f40cI5Hvu4jDlSRTR0UNpv1UIAxw==} + cpu: [x64] + os: [darwin] + + '@oven/bun-freebsd-aarch64@1.4.4': + resolution: {integrity: sha512-klvA9FlwLxZj3JYIOPQA4bbnHIC3uas8kBE4GaGGkeVgAQP/k8hAzYkOqkSaqHBDbxLrTyFEQArEAevJq6NJzg==} + cpu: [arm64] + os: [freebsd] + + '@oven/bun-freebsd-x64@1.4.4': + resolution: {integrity: sha512-sF1xS/scbyN94P2d0eTiarO6JHxrIvhZNT9hnWjQXW5nwKRtfuP+UYnIMNyvW1BQPcZFP/cvfLBNUIe1ea4zPA==} + cpu: [x64] + os: [freebsd] + + '@oven/bun-linux-aarch64-android@1.4.4': + resolution: {integrity: sha512-5lvn3at5vRC0GxvmiqEiV2/e23tnRi0q5pzR40yfDvDA3OW7PSkt4chF1nA9vnAJhro4/l+ol1FmNP6D3cf/oA==} + cpu: [arm64] + os: [android] + + '@oven/bun-linux-aarch64-musl@1.4.4': + resolution: {integrity: sha512-QFd0P+mHJxbZFbUla4MgiE5OwxysHaUIYxL2pPNkpWtaI7v4ShOpr8OhBmsuyB0xn5rv/ZJnPsj2y8+bB9+g/A==} + cpu: [arm64] + os: [linux] + libc: [musl] + + '@oven/bun-linux-aarch64@1.4.4': + resolution: {integrity: sha512-ZTVtpf9zmHSBVPX1sBwe5agGb/rN34yPGg/Hby8e2Ax2uCUA2URZKlZH7qLntK7qaFJCMXh9v0GWNYN2zINz1w==} + cpu: [arm64] + os: [linux] + libc: [glibc] + + '@oven/bun-linux-x64-android@1.4.4': + resolution: {integrity: sha512-3dMicj9C1DhaIfDkwt/9GtpU0W+q+GazbG9OIlEyL3Q1BBEz2e6ZRz/JiO8D/ECC0caXAqvnpFudehcLlgIwWQ==} + cpu: [x64] + os: [android] + + '@oven/bun-linux-x64-musl@1.4.4': + resolution: {integrity: sha512-lEEjNOJJrbGZu2NVcPI4uXdILcpspezWkA8R/Jr0RCGhM6zQd0Y7JBIIKNAmbX59EeWpeEz7Q78iLbpcAUypUA==} + cpu: [x64] + os: [linux] + libc: [musl] + + '@oven/bun-linux-x64@1.4.4': + resolution: {integrity: sha512-CHbbkmHVM28T1GFq+6GL4Ao4ujwwYwj1CxFFwEFzLanPfNsId9AhbIP0Q4reWuWBkGimUkoQygrK7Rgjtj3vog==} + cpu: [x64] + os: [linux] + libc: [glibc] + + '@oven/bun-windows-aarch64@1.4.4': + resolution: {integrity: sha512-n0ep5ZRPCZY1+dqFJpnnRUZB1wy4GYU6At8RF+pyzySCLjkN9R4rFh2PtBHAgF/lg1vOl3/CeER3pDM+p40ATA==} + cpu: [arm64] + os: [win32] + + '@oven/bun-windows-x64@1.4.4': + resolution: {integrity: sha512-a3LNctBVO8PjePsFZfwDleF2JXYf2BfQ1u/PLRnBDLnC2Riml+4+LgJpKj4xRGhB92KweGyQI5PXaTkP9qypMQ==} + cpu: [x64] + os: [win32] + + '@oxc-project/types@0.158.0': + resolution: {integrity: sha512-xZ66qA4WmLbTLlxH3mqMd8f9UKbaOzOT0ATwFf4DH/14pMgpUrtqtjyYzOQmgfl2a0iRAAMbQ9G1th/67jRzGw==} + + '@rolldown/binding-android-arm-eabi@1.3.2': + resolution: {integrity: sha512-kqR2xcygEx3WwDY69LsKeyf7SVmx4yzMtKZRknyaHieVJdRvvnAM97L0Gq6tUFc9T2YXcW/Ghij2+Um6He0LTw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [android] + + '@rolldown/binding-android-arm64@1.3.2': + resolution: {integrity: sha512-gXM4GAAvvIZA7qUuSCQS+Zz91H2fagKa5MNppUdjzysJ8LXMWm9D/gQj4nfOKo6okquDQ5pkjsuo2SUMXNW0Rw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [android] + + '@rolldown/binding-darwin-arm64@1.3.2': + resolution: {integrity: sha512-OBs5hp3W+LwMEUmDMMMnu08ncG0t6DDgnFU+6TAucKtAfNgerYLZSr2jtREKb/JuPQ1J7bJnWIgKKkxvjuAw1g==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [darwin] + + '@rolldown/binding-darwin-x64@1.3.2': + resolution: {integrity: sha512-X0VGYd4v/gdjfa/IP6uHuMhofPoUDYvK/byk3bC0jQ1pKKgt6RZ4B4puMqP0AHkjmIHAsxA471mM6AxZ39IaTA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [darwin] + + '@rolldown/binding-freebsd-x64@1.3.2': + resolution: {integrity: sha512-mr04K4cp9J/fj9fknrX8e4QvI/V48Sp+4v64PoLwhoirIH8b8L8EBrF/0bTjV1It2IL91hoNG13GblnWLglkxA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [freebsd] + + '@rolldown/binding-linux-arm-gnueabihf@1.3.2': + resolution: {integrity: sha512-VgWy02HU9Tiy6tU8U+kF3Fd4TQwTNdIBvs2MlgViP1ksMtAnQQTIPAj0ZsJzIQXKIOugqQSpqxQgELJ3fkuL5w==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [linux] + + '@rolldown/binding-linux-arm64-gnu@1.3.2': + resolution: {integrity: sha512-0wloJFYqV844gv6boiERbHpErxbxHbmlgnMX5VxP1Ux+DLBqGrUOn0cIpBmCZEcTITes3QUelxya4u8c9ziQvQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-arm64-musl@1.3.2': + resolution: {integrity: sha512-Kys8wgFQy8H8vua0MNpC0akMBFoNO8455RHk2yycBM0iayMIAtVAL6xmV9TWAkehFgrrlImTL2fZdX5LXfYtAA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + libc: [musl] + + '@rolldown/binding-linux-ppc64-gnu@1.3.2': + resolution: {integrity: sha512-L8eej7+/StRxUHHOPsOVl7Fzx/3tumuGB4hGQZKT73xRI16KZhaSJr0gi3C3WBjNRxeJRKKps2UD4lQukP+oBw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [ppc64] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-s390x-gnu@1.3.2': + resolution: {integrity: sha512-MV5CEb/nV8neQOj7l6945q1vy62HXtWO8zPDvfySPusoUzdBoLoJ/DfXXwaYThGTXZCniF+5bCf253WTPPK7Yw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [s390x] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-x64-gnu@1.3.2': + resolution: {integrity: sha512-3qssvvVvkwQookZ1/1avlKWc5orAR85vgKdzDd5noZS8nnHiI/ejOAEt0xfNYvtBBF7/DZmP8dANWkRBJVOBCA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-x64-musl@1.3.2': + resolution: {integrity: sha512-rJqoFTm/bCZFKKgaT4NzWn/TuJkFDToZ/rzYFnYVBL28jH1nIfg6snx2mDri30nal9H+wcYfKpoPR9jrMQgQQg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + libc: [musl] + + '@rolldown/binding-openharmony-arm64@1.3.2': + resolution: {integrity: sha512-ozdbCjHfh0N//wJNExjJlSlcDaeIKo8k1ktzkLUyESr2Gu/Qw7nBYxKe3jgtoaxda570vg10WdYosre82263hQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [openharmony] + + '@rolldown/binding-wasm32-wasi@1.3.2': + resolution: {integrity: sha512-p5VA6Vk/2cXZPVWf+dDbuE0dkhrcoAo6pISTJmzUnsSdQqNJdusyR8lZgHku095+r27zrYISNLZnJoqrcePW0A==} + engines: {node: ^20.19.0 || ^22.13.0 || >=23.5.0} + cpu: [wasm32] + + '@rolldown/binding-win32-arm64-msvc@1.3.2': + resolution: {integrity: sha512-XDb2U14Orf4r76SwzvJ7avePL00w4gHBmi1Ig4B/itYFEUTmYMNDHVU0dcYuBa0LgNBqyREoJOrQKxQlyYJA7A==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [win32] + + '@rolldown/binding-win32-x64-msvc@1.3.2': + resolution: {integrity: sha512-lEsKzKJqIUDZVCBhS4lkZuyQUhV1oRg5UHkI72qlOAqJn7qEXcoVdTridFS7PHNWdZknBl95EAF/4P1Xv0K1eQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [win32] + + '@rolldown/pluginutils@1.1.0': + resolution: {integrity: sha512-K+NU2HDCEem4sClgHH4ZZXwdJeNFkJo+hRk479DIwdIviAPN2hFJH1KHHwg8CxHQXvi0M5XY4deTXINfIiSG6w==} + + '@sindresorhus/is@4.6.0': + resolution: {integrity: sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==} + engines: {node: '>=10'} + + '@tybys/wasm-util@0.10.4': + resolution: {integrity: sha512-W3c4gRigFS0T/Ma4qIYF3GDAc5AQdHb1yL5znJT1Zv1YaD9Kitx656wBjvr19qbiosmZT8lWDM5BEMynUqX65A==} + + '@types/validator@13.15.10': + resolution: {integrity: sha512-T8L6i7wCuyoK8A/ZeLYt1+q0ty3Zb9+qbSSvrIVitzT3YjZqkTZ40IbRsPanlB4h1QB3JVL1SYCdR6ngtFYcuA==} + + ajv-formats@3.0.1: + resolution: {integrity: sha512-8iUql50EUR+uUcdRQ3HDqa6EVyo3docL8g5WJ3FNcWmu62IbkGUue/pEyLBW8VGKKucTPgqeks4fIU1DA4yowQ==} + peerDependencies: + ajv: ^8.0.0 + peerDependenciesMeta: + ajv: + optional: true + + ajv@8.20.0: + resolution: {integrity: sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA==} + + ansi-regex@6.6.0: + resolution: {integrity: sha512-XZ5apbzreCbXSKwPjJstu8R0zOi247w3XYwWxtwBXgpZrCyc1Ka7p9/xY0A9/diMewmHbEKz+FIraWaEWjlN5g==} + engines: {node: '>=12'} + + ansis@4.5.0: + resolution: {integrity: sha512-KwIVkfFfJSSzBmZhDGuTmkhWqTdyB5oNVzzznBJbBZ5bZtHiqSrcugRF0RKJKT4Ss3d7ZrcjnlFVDlQNmtWfWw==} + engines: {node: '>=14'} + + braces@3.0.3: + resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} + engines: {node: '>=8'} + + bun@1.4.4: + resolution: {integrity: sha512-hj0ASdG6PNjLZGFAXktWb3Uaj/dcv/1wCsIttoEXADNIQBsGjTr+5uLKYbrDkuc7NT0Tkj4yPIqJI2jDxXdvVg==} + cpu: [arm64, x64] + os: [darwin, linux, android, freebsd, win32] + hasBin: true + + bundle-name@4.1.1: + resolution: {integrity: sha512-DdH81/zPLVS11EUgWq3tEu/xn+EzljlMYooDNdzWEnFha3R3NBMpMV1UqYIpjYHV/SgpFKMIX1Oh7o06SjM/oA==} + engines: {node: '>=18'} + + chalk@5.6.2: + resolution: {integrity: sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA==} + engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} + + char-regex@1.0.2: + resolution: {integrity: sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==} + engines: {node: '>=10'} + + chardet@2.2.0: + resolution: {integrity: sha512-rddelWYNPRrXq6PtNEN2S3f6t9ILzvqaN5pVgi4kqt9jHQaXIial9PznB5iSPVlQSLNaaH22ItWz3EJtQ10+OA==} + + chokidar@5.0.0: + resolution: {integrity: sha512-TQMmc3w+5AxjpL8iIiwebF73dRDF4fBIieAqGn9RGCWaEVwQ6Fb2cGe31Yns0RRIzii5goJ1Y7xbMwo1TxMplw==} + engines: {node: '>= 20.19.0'} + + chownr@3.0.0: + resolution: {integrity: sha512-+IxzY9BZOQd/XuYPRmrvEVjF/nqj5kgT4kEq7VofrDoM1MxoRjEWkrCC3EtLi59TVawxTAn+orJwFQcrqEN1+g==} + engines: {node: '>=18'} + + class-transformer@0.5.1: + resolution: {integrity: sha512-SQa1Ws6hUbfC98vKGxZH3KFY0Y1lm5Zm0SY8XX9zbK7FJCyVEac3ATW0RIpwzW+oOfmHE5PMPufDG9hCfoEOMw==} + + class-validator@0.14.4: + resolution: {integrity: sha512-AwNusCCam51q703dW82x95tOqQp6oC9HNUl724KxJJOfnKscI8dOloXFgyez7LbTTKWuRBA37FScqVbJEoq8Yw==} + + class-validator@0.15.1: + resolution: {integrity: sha512-LqoS80HBBSCVhz/3KloUly0ovokxpdOLR++Al3J3+dHXWt9sTKlKd4eYtoxhxyUjoe5+UcIM+5k9MIxyBWnRTw==} + + cli-cursor@5.0.0: + resolution: {integrity: sha512-aCj4O5wKyszjMmDT4tZj93kxyydN/K5zPWSCe6/0AV/AA1pqe5ZBIw0a2ZfPQV7lL5/yb5HsUreJ6UFAF1tEQw==} + engines: {node: '>=18'} + + cli-spinners@3.4.0: + resolution: {integrity: sha512-bXfOC4QcT1tKXGorxL3wbJm6XJPDqEnij2gQ2m7ESQuE+/z9YFIWnl/5RpTiKWbMq3EVKR4fRLJGn6DVfu0mpw==} + engines: {node: '>=18.20'} + + cli-width@4.1.0: + resolution: {integrity: sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==} + engines: {node: '>= 12'} + + commander@15.1.0: + resolution: {integrity: sha512-cgnQ88TRrWcC7pVq46RzJVRMktu3W2RcbnoidnfBsl1bmDCBwJS/udcIZpKoCrbAYYaCqsz1yZCVIgbIaU3ddQ==} + engines: {node: '>=22.12.0'} + + default-browser-id@5.0.1: + resolution: {integrity: sha512-x1VCxdX4t+8wVfd1so/9w+vQ4vx7lKd2Qp5tDRutErwmR85OgmfX7RlLRMWafRMY7hbEiXIbudNrjOAPa/hL8Q==} + engines: {node: '>=18'} + + default-browser@5.5.1: + resolution: {integrity: sha512-m1pAzaJgZ/gssEqlOhJkPJp8Xly7QyW6xcrkUa2KKcDeDSEMP7X8xipU3snUcfisTQx0w1AGae+9UtJSfVnXGw==} + engines: {node: '>=18'} + + define-lazy-prop@3.0.0: + resolution: {integrity: sha512-N+MeXYoqr3pOgn8xfyRPREN7gHakLYjhsHhWGT3fWAiL4IkAt0iDw14QiiEm2bE30c5XX5q0FtAA3CK5f9/BUg==} + engines: {node: '>=12'} + + defu@6.1.7: + resolution: {integrity: sha512-7z22QmUWiQ/2d0KkdYmANbRUVABpZ9SNYyH5vx6PZ+nE5bcC0l7uFvEfHlyld/HcGBFTL536ClDt3DEcSlEJAQ==} + + destr@2.0.5: + resolution: {integrity: sha512-ugFTXCtDZunbzasqBxrK93Ik/DRYsO6S/fedkWEMKqt04xZ4csmnmwGDBAb07QWNaGMAmnTIemsYZCksjATwsA==} + + dotenv@17.4.2: + resolution: {integrity: sha512-nI4U3TottKAcAD9LLud4Cb7b2QztQMUEfHbvhTH09bqXTxnSie8WnjPALV/WMCrJZ6UV/qHJ6L03OqO3LcdYZw==} + engines: {node: '>=12'} + + dotenv@18.0.10: + resolution: {integrity: sha512-89FAA1xchzK2mxVWdr5F/0rldwiueXs6zJM86rO66EzekR1iBdiXRthyG+m5GvkJaFH3C2LESzamTkgndmLT2A==} + engines: {node: '>=12'} + hasBin: true + + emojilib@2.4.0: + resolution: {integrity: sha512-5U0rVMU5Y2n2+ykNLQqMoqklN9ICBT/KsvC1Gz6vqHbz2AXXGkG+Pm5rMWk/8Vjrr/mY9985Hi8DYzn1F09Nyw==} + + fast-deep-equal@3.1.3: + resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} + + fast-string-truncated-width@3.0.3: + resolution: {integrity: sha512-0jjjIEL6+0jag3l2XWWizO64/aZVtpiGE3t0Zgqxv0DPuxiMjvB3M24fCyhZUO4KomJQPj3LTSUnDP3GpdwC0g==} + + fast-string-width@3.0.2: + resolution: {integrity: sha512-gX8LrtNEI5hq8DVUfRQMbr5lpaS4nMIWV+7XEbXk2b8kiQIizgnlr12B4dA3ZEx3308ze0O4Q1R+cHts8kyUJg==} + + fast-uri@3.1.9: + resolution: {integrity: sha512-hS/0Wt3Ya043oKXs0sIxrMpKQITXhMLIrVAKKXi4gozGC9v7YRWVnXIZzjNPTO02M9BdxLCWqK1yRXgNziVyJQ==} + + fast-wrap-ansi@0.2.2: + resolution: {integrity: sha512-7F2Fl+TjRSenLqlU3UjSH0iyqopqoZIu7eZVpEirP2g1GtWa2G/ecEmBdgz31+Mxr+ELclgg6sokpSFIQiZ02Q==} + + fflate@0.8.3: + resolution: {integrity: sha512-tbZNuJrLwGUp3zshBtdy4W+ORxZuIh8a5ilyIEQDC5rY1f3U20JMry0Ll3WBzU58EZKsEuJFXhb5gwv8CsPvgA==} + + fill-range@7.1.1: + resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} + engines: {node: '>=8'} + + get-east-asian-width@1.7.0: + resolution: {integrity: sha512-XjH1AECxf0giL2V1aU8vKyRR2ppRUb5c0EvT7zuJTokQ74bNo52zOtghqdWIqrhUD79fo3x0WfKZdOqxF6LG1Q==} + engines: {node: '>=18'} + + iconv-lite@0.7.3: + resolution: {integrity: sha512-IKXpvIzjnC9XTAUbVBcMfGS0EPaIXtW6v+zr+RRp+hqULEpo0owZax6wyRwPOJbWbzjYspQwusTsfVr0ifh4uQ==} + engines: {node: '>=0.10.0'} + + is-docker@3.0.0: + resolution: {integrity: sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + hasBin: true + + is-in-ssh@1.0.0: + resolution: {integrity: sha512-jYa6Q9rH90kR1vKB6NM7qqd1mge3Fx4Dhw5TVlK1MUBqhEOuCagrEHMevNuCcbECmXZ0ThXkRm+Ymr51HwEPAw==} + engines: {node: '>=20'} + + is-inside-container@1.0.0: + resolution: {integrity: sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA==} + engines: {node: '>=14.16'} + hasBin: true + + is-interactive@2.0.0: + resolution: {integrity: sha512-qP1vozQRI+BMOPcjFzrjXuQvdak2pHNUMZoeG2eRbiSqyvbEf/wQtEOTOX1guk6E3t36RkaqiSt8A/6YElNxLQ==} + engines: {node: '>=12'} + + is-number@7.0.0: + resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} + engines: {node: '>=0.12.0'} + + is-unicode-supported@2.1.0: + resolution: {integrity: sha512-mE00Gnza5EEB3Ds0HfMyllZzbBrmLOX3vfWoj9A9PEnTfratQ/BcaJOuMhnkhjXvb2+FkY3VuHqtAGpTPmglFQ==} + engines: {node: '>=18'} + + is-wsl@3.1.1: + resolution: {integrity: sha512-e6rvdUCiQCAuumZslxRJWR/Doq4VpPR82kqclvcS0efgt430SlGIk05vdCN58+VrzgtIcfNODjozVielycD4Sw==} + engines: {node: '>=16'} + + json-schema-traverse@1.0.0: + resolution: {integrity: sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==} + + jsonc-parser@3.3.1: + resolution: {integrity: sha512-HUgH65KyejrUFPvHFPbqOY0rsFip3Bo5wb4ngvdi1EpCYWUQDC5V+Y7mZws+DLkr4M//zQJoanu1SP+87Dv1oQ==} + + konva@10.9.1: + resolution: {integrity: sha512-m49x+GatSxEUSvqahYhxpTjgKbtrLtw4P4o4B4iux953ZFpceaK52Ea+CFsAsd7W4I0Y5u6mMoRUsY/eltNZmw==} + peerDependencies: + canvas: ^3.0.0 + skia-canvas: ^3.0.0 + peerDependenciesMeta: + canvas: + optional: true + skia-canvas: + optional: true + + libphonenumber-js@1.13.16: + resolution: {integrity: sha512-tIOCM9yx2Go6d5/ZANe0K+G4AZek1Ymx81HxQpf19Sri4zMP95eQbKdnUGHAvFQ4nx0PeLhFqvAfisTADXj3tQ==} + + log-symbols@7.0.1: + resolution: {integrity: sha512-ja1E3yCr9i/0hmBVaM0bfwDjnGy8I/s6PP4DFp+yP+a+mrHO4Rm7DtmnqROTUkHIkqffC84YY7AeqX6oFk0WFg==} + engines: {node: '>=18'} + + magic-string@1.4.1: + resolution: {integrity: sha512-8lyCu36ErXR0J9uaGKlKQoiLZKmtI63YGLE8G2o9jyRPdr4X47LusSOwgOJOzcVtp81fTAAjxR7BwKz682Jhow==} + + micromatch@4.0.8: + resolution: {integrity: sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==} + engines: {node: '>=8.6'} + + mimic-function@5.0.1: + resolution: {integrity: sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==} + engines: {node: '>=18'} + + minipass@7.1.3: + resolution: {integrity: sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A==} + engines: {node: '>=16 || 14 >=14.17'} + + minizlib@3.1.0: + resolution: {integrity: sha512-KZxYo1BUkWD2TVFLr0MQoM8vUUigWD3LlD83a/75BqC+4qE0Hb1Vo5v1FgcfaNXvfXzr+5EhQ6ing/CaBijTlw==} + engines: {node: '>= 18'} + + mute-stream@4.0.0: + resolution: {integrity: sha512-gSrprq0fJ3EiOErzjdIZrjysVVmJ4uu1QWfCDss5LypA5OXvrMje5Ym5z6V6RLyJ2eF87lasX7t6a0AnFvZblg==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + + node-emoji@2.2.0: + resolution: {integrity: sha512-Z3lTE9pLaJF47NyMhd4ww1yFTAP8YhYI8SleJiHzM46Fgpm5cnNzSl9XfzFNqbaz+VlJrIj3fXQ4DeN1Rjm6cw==} + engines: {node: '>=18'} + + onetime@7.0.0: + resolution: {integrity: sha512-VXJjc87FScF88uafS3JllDgvAm+c/Slfz06lorj2uAY34rlUu0Nt+v8wreiImcrgAjjIHp1rXpTDlLOGw29WwQ==} + engines: {node: '>=18'} + + open@11.0.4: + resolution: {integrity: sha512-++Zlftm0kVLPmzC06t6epuWmcRMDbI4z5P3NNX979WA/k23+NtSOynEGzsVfZwguKw2mi5umVgnBlJQMwRz4Pg==} + engines: {node: '>=20'} + + ora@9.4.1: + resolution: {integrity: sha512-6VlU9MLXbjVQD04AZCMX28hVtA5bUoadvUqO76MUCVA0ilwJbMiHsITRPfyVm6p/BC0Av/BXMujx39WCe1LEqw==} + engines: {node: '>=20'} + + picomatch@2.3.2: + resolution: {integrity: sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==} + engines: {node: '>=8.6'} + + picomatch@4.0.7: + resolution: {integrity: sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA==} + engines: {node: '>=12'} + + powershell-utils@0.2.1: + resolution: {integrity: sha512-C+y9x90UElAddDZmV4qOx9W53B61PO7cIqWz2dQsWlwswuq4mr8NEwytdGKboYbQlGZ3awrkTeNvcZiZNHnQ8A==} + engines: {node: '>=20'} + + rc9@3.1.0: + resolution: {integrity: sha512-ufjkNVzbRHKcCOmTahZkmVsyc3W+MSk3jY03m+a7tGHkIsdVMG9l10/3HvFbWkkKzY5VFp3pkRsIo/UYgmFL7Q==} + + readdirp@5.1.1: + resolution: {integrity: sha512-Kko+Y5XQ6fM+Ce3dq3m9YGxnacYZYl9cA1wZjaF3Vbry2L3i1qVg8+CAgNPsXRArPMUMCaOR7oa9Nqntc43JKA==} + engines: {node: '>= 20.19.0'} + + require-from-string@2.0.2: + resolution: {integrity: sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==} + engines: {node: '>=0.10.0'} + + restore-cursor@5.1.0: + resolution: {integrity: sha512-oMA2dcrw6u0YfxJQXm342bFKX/E4sG9rbTzO9ptUcR/e8A33cHuvStiYOwH7fszkZlZ1z/ta9AAoPk2F4qIOHA==} + engines: {node: '>=18'} + + rolldown@1.3.2: + resolution: {integrity: sha512-EFHqbVkXiYZA6akmYm2bvJhNbEGdUwAResRhYwl/BO8QhB5KxsG+t3RVHJSIOy5jBEb0XCACvrIGnnl6Z8sMGA==} + engines: {node: ^20.19.0 || >=22.12.0} + hasBin: true + + run-applescript@7.1.0: + resolution: {integrity: sha512-DPe5pVFaAsinSaV6QjQ6gdiedWDcRCbUuiQfQa2wmWV7+xC9bGulGI8+TdRmoFkAPaBXk8CrAbnlY2ISniJ47Q==} + engines: {node: '>=18'} + + rxjs@7.8.2: + resolution: {integrity: sha512-dhKf903U/PQZY6boNNtAGdWbG85WAbjT/1xYoZIC7FAY0yWapOBQVsVrDl58W86//e1VpMNBtRV4MaXfdMySFA==} + + safer-buffer@2.1.2: + resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} + + semver@7.8.6: + resolution: {integrity: sha512-9lpSSU4Mly3mrtruwLs1eLK6+gzbzqeBFwRNjIjE+9LuDpWdYctrQlQ3ej1Ilgi7gknpsTRnPoLP8DpCHqHIJw==} + engines: {node: '>=10'} + hasBin: true + + signal-exit@4.1.0: + resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} + engines: {node: '>=14'} + + skin-tone@2.0.0: + resolution: {integrity: sha512-kUMbT1oBJCpgrnKoSr0o6wPtvRWT9W9UKvGLwfJYO2WuahZRHOpEyL1ckyMGgMWh0UdpmaoFqKKD29WTomNEGA==} + engines: {node: '>=8'} + + source-map@0.8.0: + resolution: {integrity: sha512-d8EqvL+k/SOXCreS/SUzg2ciyHqBBLcN/yuRjFsbvVhHTE2pgei7oAhmPM7kWFbkX6OSMQfUq4KbkF3au9lhYQ==} + engines: {node: '>= 12'} + + stdin-discarder@0.3.2: + resolution: {integrity: sha512-eCPu1qRxPVkl5605OTWF8Wz40b4Mf45NY5LQmVPQ599knfs5QhASUm9GbJ5BDMDOXgrnh0wyEdvzmL//YMlw0A==} + engines: {node: '>=18'} + + string-width@8.3.0: + resolution: {integrity: sha512-ZbmZM0JCihQN91dWnxoipT2KOEyHqEyfRXUyjuRhW8b/xnqPDoq4gWEVApTVa9db2wN8mmoikgFBbjh71+cGeQ==} + engines: {node: '>=20'} + + strip-ansi@7.2.0: + resolution: {integrity: sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==} + engines: {node: '>=12'} + + tar@7.5.23: + resolution: {integrity: sha512-lkukzdoGngZHJZXxW4S/E4Fp9ghTDlyZXrQGRNoJ/LXvDKcXUTq2sg5yQe74po7Voea6n/IN09+wE/QvJMiifA==} + engines: {node: '>=18'} + + to-regex-range@5.0.1: + resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} + engines: {node: '>=8.0'} + + tslib@2.9.1: + resolution: {integrity: sha512-a4Ux9VKuIMHsOS7ENbEq6hK2ZGYIT27Rtl0E4eD9KqwxhKiQeMZE/9xb3IdYwWaSOyIBQLExhQgXDTYoiCxnWA==} + + typescript@6.0.3: + resolution: {integrity: sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw==} + engines: {node: '>=14.17'} + hasBin: true + + unicode-emoji-modifier-base@1.0.0: + resolution: {integrity: sha512-yLSH4py7oFH3oG/9K+XWrz1pSi3dfUrWEnInbxMfArOfc1+33BlGPQtLsOYwvdMy11AwUBetYuaRxSPqgkq+8g==} + engines: {node: '>=4'} + + unrun@0.3.1: + resolution: {integrity: sha512-onIck/oNnCaytwths1ZVp1LK2Gq2hPoyFhiHebObuUXqR3S0uHuLLaBK8K6mRRgV7Ptip8AnNvaUsgzwWwBZuA==} + engines: {node: ^22.13.0 || >=24.0.0} + hasBin: true + peerDependencies: + synckit: ^0.11.11 + peerDependenciesMeta: + synckit: + optional: true + + validator@13.15.35: + resolution: {integrity: sha512-TQ5pAGhd5whStmqWvYF4OjQROlmv9SMFVt37qoCBdqRffuuklWYQlCNnEs2ZaIBD1kZRNnikiZOS1eqgkar0iw==} + engines: {node: '>= 0.10'} + + wsl-utils@1.0.1: + resolution: {integrity: sha512-c16PKLIRxBYpR3jSWsdS7SFp0COm5SOQdiFjY818dYFHJbMGuLBszpF07LBWmOS1uzrHa9VGdynsEgoeKy0oOQ==} + engines: {node: '>=20'} + + yallist@5.0.0: + resolution: {integrity: sha512-YgvUTfwqyc7UXVMrB+SImsVYSmTS8X/tSrtdNZMImM+n7+QTriRXyXim0mBrTXNeqzVF0KWGgHPeiyViFFrNDw==} + engines: {node: '>=18'} + + yoctocolors@2.2.0: + resolution: {integrity: sha512-xYqdZFUK/VYazNl/oCDYN+3WloWQwMfZxBoiNt6qNyk+xfOdi598muWE42rNZFp1kNOiqW936q5RhUdnpqElSg==} + engines: {node: '>=18'} + + zod@4.6.7: + resolution: {integrity: sha512-g8W2D2kU6a8untc053fX1uVBKzM7yqAxW/3zwk83+6RyF2+SKOuV+c0wBDhUwzV1PaGapmZH+rmcUzPf+3CGwg==} + +snapshots: + + '@angular-devkit/core@22.2.7(chokidar@5.0.0)': + dependencies: + ajv: 8.20.0 + ajv-formats: 3.0.1(ajv@8.20.0) + jsonc-parser: 3.3.1 + picomatch: 4.0.7 + rxjs: 7.8.2 + source-map: 0.8.0 + optionalDependencies: + chokidar: 5.0.0 + + '@angular-devkit/schematics-cli@22.2.7(chokidar@5.0.0)': + dependencies: + '@angular-devkit/core': 22.2.7(chokidar@5.0.0) + '@angular-devkit/schematics': 22.2.7(chokidar@5.0.0) + '@inquirer/prompts': 8.7.2 + transitivePeerDependencies: + - '@types/node' + - chokidar + + '@angular-devkit/schematics@22.2.7(chokidar@5.0.0)': + dependencies: + '@angular-devkit/core': 22.2.7(chokidar@5.0.0) + jsonc-parser: 3.3.1 + magic-string: 1.4.1 + ora: 9.4.1 + rxjs: 7.8.2 + transitivePeerDependencies: + - chokidar + + '@emnapi/core@2.0.0-beta.2': + dependencies: + '@emnapi/wasi-threads': 2.2.0 + tslib: 2.9.1 + optional: true + + '@emnapi/runtime@2.0.0-beta.2': + dependencies: + tslib: 2.9.1 + optional: true + + '@emnapi/wasi-threads@2.2.0': + dependencies: + tslib: 2.9.1 + optional: true + + '@inquirer/ansi@2.1.0': {} + + '@inquirer/checkbox@5.3.0': + dependencies: + '@inquirer/ansi': 2.1.0 + '@inquirer/core': 12.1.0 + '@inquirer/figures': 2.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/confirm@6.4.0': + dependencies: + '@inquirer/core': 12.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/core@12.1.0': + dependencies: + '@inquirer/ansi': 2.1.0 + '@inquirer/figures': 2.1.0 + '@inquirer/type': 4.3.0 + cli-width: 4.1.0 + fast-wrap-ansi: 0.2.2 + mute-stream: 4.0.0 + signal-exit: 4.1.0 + + '@inquirer/editor@5.4.0': + dependencies: + '@inquirer/core': 12.1.0 + '@inquirer/external-editor': 3.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/expand@5.2.0': + dependencies: + '@inquirer/core': 12.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/external-editor@3.1.0': + dependencies: + chardet: 2.2.0 + iconv-lite: 0.7.3 + + '@inquirer/figures@2.1.0': {} + + '@inquirer/input@5.2.0': + dependencies: + '@inquirer/core': 12.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/number@4.3.0': + dependencies: + '@inquirer/core': 12.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/password@5.3.0': + dependencies: + '@inquirer/ansi': 2.1.0 + '@inquirer/core': 12.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/prompts@8.7.2': + dependencies: + '@inquirer/checkbox': 5.3.0 + '@inquirer/confirm': 6.4.0 + '@inquirer/editor': 5.4.0 + '@inquirer/expand': 5.2.0 + '@inquirer/input': 5.2.0 + '@inquirer/number': 4.3.0 + '@inquirer/password': 5.3.0 + '@inquirer/rawlist': 5.4.0 + '@inquirer/search': 4.4.0 + '@inquirer/select': 5.3.0 + + '@inquirer/prompts@8.8.0': + dependencies: + '@inquirer/checkbox': 5.3.0 + '@inquirer/confirm': 6.4.0 + '@inquirer/editor': 5.4.0 + '@inquirer/expand': 5.2.0 + '@inquirer/input': 5.2.0 + '@inquirer/number': 4.3.0 + '@inquirer/password': 5.3.0 + '@inquirer/rawlist': 5.4.0 + '@inquirer/search': 4.4.0 + '@inquirer/select': 5.3.0 + + '@inquirer/rawlist@5.4.0': + dependencies: + '@inquirer/core': 12.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/search@4.4.0': + dependencies: + '@inquirer/core': 12.1.0 + '@inquirer/figures': 2.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/select@5.3.0': + dependencies: + '@inquirer/ansi': 2.1.0 + '@inquirer/core': 12.1.0 + '@inquirer/figures': 2.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/type@4.3.0': {} + + '@isaacs/fs-minipass@4.0.1': + dependencies: + minipass: 7.1.3 + + '@jridgewell/sourcemap-codec@1.6.0': {} + + '@nanoforge-dev/asset@3.0.0': + dependencies: + '@nanoforge-dev/common': 3.0.0 + + '@nanoforge-dev/cli@3.0.1': + dependencies: + '@angular-devkit/schematics': 22.2.7(chokidar@5.0.0) + '@angular-devkit/schematics-cli': 22.2.7(chokidar@5.0.0) + '@inquirer/prompts': 8.8.0 + '@nanoforge-dev/config': 3.0.1 + '@nanoforge-dev/editor': 0.1.4 + '@nanoforge-dev/loader-client': 1.7.0 + '@nanoforge-dev/loader-server': 1.7.0 + '@nanoforge-dev/registry': 3.0.1 + '@nanoforge-dev/schematics': 3.0.1(chokidar@5.0.0) + ansis: 4.5.0 + bun: 1.4.4 + chokidar: 5.0.0 + commander: 15.1.0 + dotenv: 18.0.10 + node-emoji: 2.2.0 + open: 11.0.4 + ora: 9.4.1 + rc9: 3.1.0 + transitivePeerDependencies: + - '@types/node' + - synckit + + '@nanoforge-dev/common@3.0.0': {} + + '@nanoforge-dev/config@3.0.1': + dependencies: + unrun: 0.3.1 + zod: 4.6.7 + transitivePeerDependencies: + - synckit + + '@nanoforge-dev/core@3.0.0': + dependencies: + '@nanoforge-dev/asset': 3.0.0 + '@nanoforge-dev/common': 3.0.0 + + '@nanoforge-dev/ecs@3.0.0(@nanoforge-dev/editor-lib@3.0.0)': + dependencies: + '@nanoforge-dev/common': 3.0.0 + optionalDependencies: + '@nanoforge-dev/editor-lib': 3.0.0 + + '@nanoforge-dev/editor-lib@3.0.0': + dependencies: + '@nanoforge-dev/common': 3.0.0 + + '@nanoforge-dev/editor@0.1.4': + dependencies: + bun: 1.4.4 + class-transformer: 0.5.1 + class-validator: 0.15.1 + dotenv: 17.4.2 + micromatch: 4.0.8 + tar: 7.5.23 + typescript: 6.0.3 + + '@nanoforge-dev/env@3.0.0': + dependencies: + '@nanoforge-dev/common': 3.0.0 + class-transformer: 0.5.1 + class-validator: 0.14.4 + + '@nanoforge-dev/graphics-2d@3.0.0': + dependencies: + '@nanoforge-dev/common': 3.0.0 + konva: 10.9.1 + transitivePeerDependencies: + - canvas + - skia-canvas + + '@nanoforge-dev/loader-client@1.7.0': + dependencies: + '@nanoforge-dev/loader-website': 1.7.0 + bun: 1.4.4 + commander: 15.1.0 + + '@nanoforge-dev/loader-server@1.7.0': + dependencies: + bun: 1.4.4 + commander: 15.1.0 + + '@nanoforge-dev/loader-website@1.7.0': {} + + '@nanoforge-dev/registry@3.0.1': + dependencies: + fflate: 0.8.3 + semver: 7.8.6 + zod: 4.6.7 + + '@nanoforge-dev/schematics@3.0.1(chokidar@5.0.0)': + dependencies: + '@angular-devkit/core': 22.2.7(chokidar@5.0.0) + '@angular-devkit/schematics': 22.2.7(chokidar@5.0.0) + rxjs: 7.8.2 + transitivePeerDependencies: + - chokidar + + '@napi-rs/wasm-runtime@1.2.6(@emnapi/core@2.0.0-beta.2)(@emnapi/runtime@2.0.0-beta.2)': + dependencies: + '@emnapi/core': 2.0.0-beta.2 + '@emnapi/runtime': 2.0.0-beta.2 + '@tybys/wasm-util': 0.10.4 + optional: true + + '@oven/bun-darwin-aarch64@1.4.4': + optional: true + + '@oven/bun-darwin-x64@1.4.4': + optional: true + + '@oven/bun-freebsd-aarch64@1.4.4': + optional: true + + '@oven/bun-freebsd-x64@1.4.4': + optional: true + + '@oven/bun-linux-aarch64-android@1.4.4': + optional: true + + '@oven/bun-linux-aarch64-musl@1.4.4': + optional: true + + '@oven/bun-linux-aarch64@1.4.4': + optional: true + + '@oven/bun-linux-x64-android@1.4.4': + optional: true + + '@oven/bun-linux-x64-musl@1.4.4': + optional: true + + '@oven/bun-linux-x64@1.4.4': + optional: true + + '@oven/bun-windows-aarch64@1.4.4': + optional: true + + '@oven/bun-windows-x64@1.4.4': + optional: true + + '@oxc-project/types@0.158.0': {} + + '@rolldown/binding-android-arm-eabi@1.3.2': + optional: true + + '@rolldown/binding-android-arm64@1.3.2': + optional: true + + '@rolldown/binding-darwin-arm64@1.3.2': + optional: true + + '@rolldown/binding-darwin-x64@1.3.2': + optional: true + + '@rolldown/binding-freebsd-x64@1.3.2': + optional: true + + '@rolldown/binding-linux-arm-gnueabihf@1.3.2': + optional: true + + '@rolldown/binding-linux-arm64-gnu@1.3.2': + optional: true + + '@rolldown/binding-linux-arm64-musl@1.3.2': + optional: true + + '@rolldown/binding-linux-ppc64-gnu@1.3.2': + optional: true + + '@rolldown/binding-linux-s390x-gnu@1.3.2': + optional: true + + '@rolldown/binding-linux-x64-gnu@1.3.2': + optional: true + + '@rolldown/binding-linux-x64-musl@1.3.2': + optional: true + + '@rolldown/binding-openharmony-arm64@1.3.2': + optional: true + + '@rolldown/binding-wasm32-wasi@1.3.2': + dependencies: + '@emnapi/core': 2.0.0-beta.2 + '@emnapi/runtime': 2.0.0-beta.2 + '@napi-rs/wasm-runtime': 1.2.6(@emnapi/core@2.0.0-beta.2)(@emnapi/runtime@2.0.0-beta.2) + optional: true + + '@rolldown/binding-win32-arm64-msvc@1.3.2': + optional: true + + '@rolldown/binding-win32-x64-msvc@1.3.2': + optional: true + + '@rolldown/pluginutils@1.1.0': {} + + '@sindresorhus/is@4.6.0': {} + + '@tybys/wasm-util@0.10.4': + dependencies: + tslib: 2.9.1 + optional: true + + '@types/validator@13.15.10': {} + + ajv-formats@3.0.1(ajv@8.20.0): + optionalDependencies: + ajv: 8.20.0 + + ajv@8.20.0: + dependencies: + fast-deep-equal: 3.1.3 + fast-uri: 3.1.9 + json-schema-traverse: 1.0.0 + require-from-string: 2.0.2 + + ansi-regex@6.6.0: {} + + ansis@4.5.0: {} + + braces@3.0.3: + dependencies: + fill-range: 7.1.1 + + bun@1.4.4: + optionalDependencies: + '@oven/bun-darwin-aarch64': 1.4.4 + '@oven/bun-darwin-x64': 1.4.4 + '@oven/bun-freebsd-aarch64': 1.4.4 + '@oven/bun-freebsd-x64': 1.4.4 + '@oven/bun-linux-aarch64': 1.4.4 + '@oven/bun-linux-aarch64-android': 1.4.4 + '@oven/bun-linux-aarch64-musl': 1.4.4 + '@oven/bun-linux-x64': 1.4.4 + '@oven/bun-linux-x64-android': 1.4.4 + '@oven/bun-linux-x64-musl': 1.4.4 + '@oven/bun-windows-aarch64': 1.4.4 + '@oven/bun-windows-x64': 1.4.4 + + bundle-name@4.1.1: + dependencies: + run-applescript: 7.1.0 + + chalk@5.6.2: {} + + char-regex@1.0.2: {} + + chardet@2.2.0: {} + + chokidar@5.0.0: + dependencies: + readdirp: 5.1.1 + + chownr@3.0.0: {} + + class-transformer@0.5.1: {} + + class-validator@0.14.4: + dependencies: + '@types/validator': 13.15.10 + libphonenumber-js: 1.13.16 + validator: 13.15.35 + + class-validator@0.15.1: + dependencies: + '@types/validator': 13.15.10 + libphonenumber-js: 1.13.16 + validator: 13.15.35 + + cli-cursor@5.0.0: + dependencies: + restore-cursor: 5.1.0 + + cli-spinners@3.4.0: {} + + cli-width@4.1.0: {} + + commander@15.1.0: {} + + default-browser-id@5.0.1: {} + + default-browser@5.5.1: + dependencies: + bundle-name: 4.1.1 + default-browser-id: 5.0.1 + + define-lazy-prop@3.0.0: {} + + defu@6.1.7: {} + + destr@2.0.5: {} + + dotenv@17.4.2: {} + + dotenv@18.0.10: {} + + emojilib@2.4.0: {} + + fast-deep-equal@3.1.3: {} + + fast-string-truncated-width@3.0.3: {} + + fast-string-width@3.0.2: + dependencies: + fast-string-truncated-width: 3.0.3 + + fast-uri@3.1.9: {} + + fast-wrap-ansi@0.2.2: + dependencies: + fast-string-width: 3.0.2 + + fflate@0.8.3: {} + + fill-range@7.1.1: + dependencies: + to-regex-range: 5.0.1 + + get-east-asian-width@1.7.0: {} + + iconv-lite@0.7.3: + dependencies: + safer-buffer: 2.1.2 + + is-docker@3.0.0: {} + + is-in-ssh@1.0.0: {} + + is-inside-container@1.0.0: + dependencies: + is-docker: 3.0.0 + + is-interactive@2.0.0: {} + + is-number@7.0.0: {} + + is-unicode-supported@2.1.0: {} + + is-wsl@3.1.1: + dependencies: + is-inside-container: 1.0.0 + + json-schema-traverse@1.0.0: {} + + jsonc-parser@3.3.1: {} + + konva@10.9.1: {} + + libphonenumber-js@1.13.16: {} + + log-symbols@7.0.1: + dependencies: + is-unicode-supported: 2.1.0 + yoctocolors: 2.2.0 + + magic-string@1.4.1: + dependencies: + '@jridgewell/sourcemap-codec': 1.6.0 + + micromatch@4.0.8: + dependencies: + braces: 3.0.3 + picomatch: 2.3.2 + + mimic-function@5.0.1: {} + + minipass@7.1.3: {} + + minizlib@3.1.0: + dependencies: + minipass: 7.1.3 + + mute-stream@4.0.0: {} + + node-emoji@2.2.0: + dependencies: + '@sindresorhus/is': 4.6.0 + char-regex: 1.0.2 + emojilib: 2.4.0 + skin-tone: 2.0.0 + + onetime@7.0.0: + dependencies: + mimic-function: 5.0.1 + + open@11.0.4: + dependencies: + default-browser: 5.5.1 + define-lazy-prop: 3.0.0 + is-in-ssh: 1.0.0 + is-inside-container: 1.0.0 + powershell-utils: 0.2.1 + wsl-utils: 1.0.1 + + ora@9.4.1: + dependencies: + chalk: 5.6.2 + cli-cursor: 5.0.0 + cli-spinners: 3.4.0 + is-interactive: 2.0.0 + is-unicode-supported: 2.1.0 + log-symbols: 7.0.1 + stdin-discarder: 0.3.2 + string-width: 8.3.0 + + picomatch@2.3.2: {} + + picomatch@4.0.7: {} + + powershell-utils@0.2.1: {} + + rc9@3.1.0: + dependencies: + defu: 6.1.7 + destr: 2.0.5 + + readdirp@5.1.1: {} + + require-from-string@2.0.2: {} + + restore-cursor@5.1.0: + dependencies: + onetime: 7.0.0 + signal-exit: 4.1.0 + + rolldown@1.3.2: + dependencies: + '@oxc-project/types': 0.158.0 + '@rolldown/pluginutils': 1.1.0 + optionalDependencies: + '@rolldown/binding-android-arm-eabi': 1.3.2 + '@rolldown/binding-android-arm64': 1.3.2 + '@rolldown/binding-darwin-arm64': 1.3.2 + '@rolldown/binding-darwin-x64': 1.3.2 + '@rolldown/binding-freebsd-x64': 1.3.2 + '@rolldown/binding-linux-arm-gnueabihf': 1.3.2 + '@rolldown/binding-linux-arm64-gnu': 1.3.2 + '@rolldown/binding-linux-arm64-musl': 1.3.2 + '@rolldown/binding-linux-ppc64-gnu': 1.3.2 + '@rolldown/binding-linux-s390x-gnu': 1.3.2 + '@rolldown/binding-linux-x64-gnu': 1.3.2 + '@rolldown/binding-linux-x64-musl': 1.3.2 + '@rolldown/binding-openharmony-arm64': 1.3.2 + '@rolldown/binding-wasm32-wasi': 1.3.2 + '@rolldown/binding-win32-arm64-msvc': 1.3.2 + '@rolldown/binding-win32-x64-msvc': 1.3.2 + + run-applescript@7.1.0: {} + + rxjs@7.8.2: + dependencies: + tslib: 2.9.1 + + safer-buffer@2.1.2: {} + + semver@7.8.6: {} + + signal-exit@4.1.0: {} + + skin-tone@2.0.0: + dependencies: + unicode-emoji-modifier-base: 1.0.0 + + source-map@0.8.0: {} + + stdin-discarder@0.3.2: {} + + string-width@8.3.0: + dependencies: + get-east-asian-width: 1.7.0 + strip-ansi: 7.2.0 + + strip-ansi@7.2.0: + dependencies: + ansi-regex: 6.6.0 + + tar@7.5.23: + dependencies: + '@isaacs/fs-minipass': 4.0.1 + chownr: 3.0.0 + minipass: 7.1.3 + minizlib: 3.1.0 + yallist: 5.0.0 + + to-regex-range@5.0.1: + dependencies: + is-number: 7.0.0 + + tslib@2.9.1: {} + + typescript@6.0.3: {} + + unicode-emoji-modifier-base@1.0.0: {} + + unrun@0.3.1: + dependencies: + rolldown: 1.3.2 + + validator@13.15.35: {} + + wsl-utils@1.0.1: + dependencies: + is-wsl: 3.1.1 + powershell-utils: 0.2.1 + + yallist@5.0.0: {} + + yoctocolors@2.2.0: {} + + zod@4.6.7: {} diff --git a/basics/sprite-2d/pnpm-workspace.yaml b/basics/sprite-2d/pnpm-workspace.yaml new file mode 100644 index 0000000..96ca535 --- /dev/null +++ b/basics/sprite-2d/pnpm-workspace.yaml @@ -0,0 +1,5 @@ +allowBuilds: + bun: true +# NanoForge packages are ours: take a release as soon as it is out. +minimumReleaseAgeExclude: + - "@nanoforge-dev/*" diff --git a/basics/sprite-2d/src/components/drawable-circle-2d.component.ts b/basics/sprite-2d/src/components/drawable-circle-2d.component.ts new file mode 100644 index 0000000..1066155 --- /dev/null +++ b/basics/sprite-2d/src/components/drawable-circle-2d.component.ts @@ -0,0 +1,62 @@ +import type { AssetContext } from "@nanoforge-dev/common"; +import { Circle, type Layer } from "@nanoforge-dev/graphics-2d"; +import type { Position2D } from "./position-2d.component"; + +import { imageFill } from "../image-fill"; + +/** + * Draws a circle at the entity's `Position2D` (its center). Needs the `draw2D` system. + * + * @remarks + * `shape` is the Konva `Circle` on screen: change it from code for anything the parameters don't + * offer (shadows, strokes...). + * + * @component + * @side client + * @group Shape color=#e86fb0 - Size of the circle. + * @group Look color=#b18cff - What the circle looks like. + * @group Advanced hidden - Less common settings. + */ +export class DrawableCircle2D { + name = "DrawableCircle2D"; + + /** The circle on screen, made by `draw2D` the first time it draws it. */ + shape?: Circle; + + constructor( + /** In pixels. @group Shape */ + public radius = 25, + /** A CSS color: `red`, `#ff0000`, `rgba(255, 0, 0, 0.5)`... @group Look @preset color */ + public fillColor = "#4aa3ff", + /** An image stretched over the circle, shown instead of the color. @group Look @asset .png .jpg .jpeg .gif .webp .svg */ + public image = "", + /** From 0 (invisible) to 1 (opaque). @group Look */ + public opacity = 1, + /** Clockwise, in degrees, around the center. @group Advanced */ + public rotation = 0, + /** Whether it is drawn. @group Advanced */ + public visible = true, + ) {} + + /** Puts the circle on `layer` at `position`, up to date with the parameters. */ + draw(layer: Layer, position: Position2D, assets: AssetContext): void { + this.shape ??= new Circle(); + if (this.shape.getParent() !== layer) layer.add(this.shape); + this.shape.setAttrs({ + x: position.x, + y: position.y, + radius: this.radius, + fill: this.fillColor, + opacity: this.opacity, + rotation: this.rotation, + visible: this.visible, + ...imageFill(assets, this.image, this.radius * 2, this.radius * 2, true), + }); + } + + /** Removes the circle from the screen. */ + destroy(): void { + this.shape?.destroy(); + this.shape = undefined; + } +} diff --git a/basics/sprite-2d/src/components/drawable-rect-2d.component.ts b/basics/sprite-2d/src/components/drawable-rect-2d.component.ts new file mode 100644 index 0000000..d3586ca --- /dev/null +++ b/basics/sprite-2d/src/components/drawable-rect-2d.component.ts @@ -0,0 +1,69 @@ +import type { AssetContext } from "@nanoforge-dev/common"; +import { type Layer, Rect } from "@nanoforge-dev/graphics-2d"; +import type { Position2D } from "./position-2d.component"; + +import { imageFill } from "../image-fill"; + +/** + * Draws a rectangle at the entity's `Position2D` (its top-left corner). Needs the `draw2D` + * system. + * + * @remarks + * `shape` is the Konva `Rect` on screen: change it from code for anything the parameters don't + * offer (shadows, strokes...). + * + * @component + * @side client + * @group Shape color=#e86fb0 - Size of the rectangle. + * @group Look color=#b18cff - What the rectangle looks like. + * @group Advanced hidden - Less common settings. + */ +export class DrawableRect2D { + name = "DrawableRect2D"; + + /** The rectangle on screen, made by `draw2D` the first time it draws it. */ + shape?: Rect; + + constructor( + /** In pixels. @group Shape @preset size.width */ + public width = 50, + /** In pixels. @group Shape @preset size.height */ + public height = 50, + /** A CSS color: `red`, `#ff0000`, `rgba(255, 0, 0, 0.5)`... @group Look @preset color */ + public fillColor = "#4aa3ff", + /** An image stretched over the rectangle, shown instead of the color. @group Look @asset .png .jpg .jpeg .gif .webp .svg */ + public image = "", + /** From 0 (invisible) to 1 (opaque). @group Look */ + public opacity = 1, + /** Clockwise, in degrees, around the top-left corner. @group Advanced */ + public rotation = 0, + /** Rounds the corners, in pixels. @group Advanced */ + public cornerRadius = 0, + /** Whether it is drawn. @group Advanced */ + public visible = true, + ) {} + + /** Puts the rectangle on `layer` at `position`, up to date with the parameters. */ + draw(layer: Layer, position: Position2D, assets: AssetContext): void { + this.shape ??= new Rect(); + if (this.shape.getParent() !== layer) layer.add(this.shape); + this.shape.setAttrs({ + x: position.x, + y: position.y, + width: this.width, + height: this.height, + fill: this.fillColor, + opacity: this.opacity, + rotation: this.rotation, + cornerRadius: this.cornerRadius, + visible: this.visible, + ...imageFill(assets, this.image, this.width, this.height), + }); + } + + /** Removes the rectangle from the screen. */ + destroy(): void { + this.shape?.destroy(); + this.shape = undefined; + } +} diff --git a/basics/sprite-2d/src/components/drawable-text-2d.component.ts b/basics/sprite-2d/src/components/drawable-text-2d.component.ts new file mode 100644 index 0000000..adba963 --- /dev/null +++ b/basics/sprite-2d/src/components/drawable-text-2d.component.ts @@ -0,0 +1,62 @@ +import { type Layer, Text } from "@nanoforge-dev/graphics-2d"; +import type { Position2D } from "./position-2d.component"; + +/** + * Draws a text at the entity's `Position2D` (its top-left corner). Needs the `draw2D` system. + * + * @remarks + * Change `text` from a system to show a score, a timer... `shape` is the Konva `Text` on screen: + * change it from code for anything the parameters don't offer. + * + * @component + * @side client + * @group Text color=#e86fb0 - What is written. + * @group Look color=#b18cff - What the text looks like. + * @group Advanced hidden - Less common settings. + */ +export class DrawableText2D { + name = "DrawableText2D"; + + /** The text on screen, made by `draw2D` the first time it draws it. */ + shape?: Text; + + constructor( + /** What is written. @group Text */ + public text = "Hello", + /** Height of the letters, in pixels. @group Text */ + public fontSize = 24, + /** A CSS color: `white`, `#ffffff`... @group Look @preset color */ + public fillColor = "#ffffff", + /** From 0 (invisible) to 1 (opaque). @group Look */ + public opacity = 1, + /** A CSS font family: `Arial`, `monospace`... @group Advanced */ + public fontFamily = "Arial", + /** Clockwise, in degrees, around the top-left corner. @group Advanced */ + public rotation = 0, + /** Whether it is drawn. @group Advanced */ + public visible = true, + ) {} + + /** Puts the text on `layer` at `position`, up to date with the parameters. */ + draw(layer: Layer, position: Position2D): void { + this.shape ??= new Text(); + if (this.shape.getParent() !== layer) layer.add(this.shape); + this.shape.setAttrs({ + x: position.x, + y: position.y, + text: this.text, + fontSize: this.fontSize, + fontFamily: this.fontFamily, + fill: this.fillColor, + opacity: this.opacity, + rotation: this.rotation, + visible: this.visible, + }); + } + + /** Removes the text from the screen. */ + destroy(): void { + this.shape?.destroy(); + this.shape = undefined; + } +} diff --git a/basics/sprite-2d/src/components/position-2d.component.ts b/basics/sprite-2d/src/components/position-2d.component.ts new file mode 100644 index 0000000..0a35624 --- /dev/null +++ b/basics/sprite-2d/src/components/position-2d.component.ts @@ -0,0 +1,20 @@ +/** + * Where an entity is, in pixels from the top-left corner of the screen. + * + * @remarks + * For rectangles it is their top-left corner, for circles their center. + * + * @component + * @side shared + * @group Position color=#4aa3ff - Pixels from the top-left corner of the screen. + */ +export class Position2D { + name = "Position2D"; + + constructor( + /** Pixels from the left edge. @group Position @preset vector.x */ + public x = 0, + /** Pixels from the top edge. @group Position @preset vector.y */ + public y = 0, + ) {} +} diff --git a/basics/sprite-2d/src/image-fill.ts b/basics/sprite-2d/src/image-fill.ts new file mode 100644 index 0000000..c7fc737 --- /dev/null +++ b/basics/sprite-2d/src/image-fill.ts @@ -0,0 +1,43 @@ +import type { AssetContext } from "@nanoforge-dev/common"; +import type { ShapeConfig } from "@nanoforge-dev/graphics-2d"; + +const images = new Map(); + +/** + * The fill of a shape of `width` by `height` pixels showing the image at `path` (an asset path + * such as `/textures/hero.png`, found in `assets`) stretched over it. Without an image, until it + * is loaded, or when there is no asset at `path`, the shape is filled with its color. + * + * @param centered - Whether the shape's origin is its center (a circle) instead of its top-left + * corner (a rectangle). + */ +export const imageFill = ( + assets: AssetContext, + path: string, + width: number, + height: number, + centered = false, +): ShapeConfig => { + if (!path) return { fillPriority: "color", fillPatternImage: undefined }; + let image = images.get(path); + if (!image) { + image = document.createElement("img"); + try { + image.src = assets.getAsset(path).path; + } catch (error) { + // Once per path, not every frame: the shape keeps its color. + console.warn(`No image at "${path}":`, error); + } + images.set(path, image); + } + if (!image.naturalWidth) return { fillPriority: "color", fillPatternImage: undefined }; + return { + fillPriority: "pattern", + fillPatternImage: image, + fillPatternRepeat: "no-repeat", + fillPatternScaleX: width / image.naturalWidth, + fillPatternScaleY: height / image.naturalHeight, + fillPatternOffsetX: centered ? image.naturalWidth / 2 : 0, + fillPatternOffsetY: centered ? image.naturalHeight / 2 : 0, + }; +}; diff --git a/basics/sprite-2d/src/main.ts b/basics/sprite-2d/src/main.ts new file mode 100644 index 0000000..f573613 --- /dev/null +++ b/basics/sprite-2d/src/main.ts @@ -0,0 +1,46 @@ +import type { ClientRunOptions } from "@nanoforge-dev/common"; +import { NanoforgeFactory } from "@nanoforge-dev/core"; +import { EcsLibrary } from "@nanoforge-dev/ecs/client"; +import { EditorLibrary } from "@nanoforge-dev/editor-lib"; +import { Graphics2DLibrary } from "@nanoforge-dev/graphics-2d"; + +import { DrawableCircle2D } from "./components/drawable-circle-2d.component"; +import { DrawableRect2D } from "./components/drawable-rect-2d.component"; +import { Position2D } from "./components/position-2d.component"; +import { draw2D } from "./systems/draw-2d.system"; + +export const main = async (options: ClientRunOptions): Promise => { + const app = NanoforgeFactory.createClient({ + tickRate: 60, + viewport: { width: 288, height: 512, fit: "contain" }, + }); + const ecs = new EcsLibrary(); + + app.use(new Graphics2DLibrary()); + app.use(ecs); + app.use(new EditorLibrary()); + + await app.init(options); + + const registry = ecs.registry; + + const background = registry.spawnEntity(); + registry.addComponent(background, new Position2D(0, 0)); + registry.addComponent(background, new DrawableRect2D(288, 512, "#4ec0ca", "/background-day.png")); + + const pipe = registry.spawnEntity(); + registry.addComponent(pipe, new Position2D(180, 300)); + registry.addComponent(pipe, new DrawableRect2D(52, 320, "#5ee270", "/pipe-green.png")); + + const bird = registry.spawnEntity(); + registry.addComponent(bird, new Position2D(60, 220)); + registry.addComponent(bird, new DrawableRect2D(68, 48, "#f8d030", "/yellowbird-midflap.png")); + + const roundBird = registry.spawnEntity(); + registry.addComponent(roundBird, new Position2D(100, 380)); + registry.addComponent(roundBird, new DrawableCircle2D(30, "#f8d030", "/yellowbird-midflap.png")); + + registry.addSystem(draw2D); + + await app.run(); +}; diff --git a/basics/sprite-2d/src/systems/draw-2d.system.ts b/basics/sprite-2d/src/systems/draw-2d.system.ts new file mode 100644 index 0000000..937eeeb --- /dev/null +++ b/basics/sprite-2d/src/systems/draw-2d.system.ts @@ -0,0 +1,45 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; +import "@nanoforge-dev/graphics-2d"; +import { Position2D } from "../components/position-2d.component"; + +import { DrawableCircle2D } from "../components/drawable-circle-2d.component"; +import { DrawableRect2D } from "../components/drawable-rect-2d.component"; +import { DrawableText2D } from "../components/drawable-text-2d.component"; + +type Drawable = DrawableRect2D | DrawableCircle2D | DrawableText2D; + +/** The drawables shown by the last frame. */ +let shown = new Set(); + +/** + * Draws every entity that has a `Position2D` and a `DrawableRect2D`, `DrawableCircle2D` or + * `DrawableText2D`, where it is. Add it last, after the systems that move entities. + * + * @remarks + * The shape of a killed entity, or of a removed drawable, is removed from the screen. + * + * @system + * @side client + */ +export const draw2D = (registry: Registry, ctx: Context) => { + const layer = ctx.graphics.baseLayer; + const drawn = new Set(); + + registry.getZipper([DrawableRect2D, Position2D]).forEach(({ DrawableRect2D, Position2D }) => { + DrawableRect2D.draw(layer, Position2D, ctx.assets); + drawn.add(DrawableRect2D); + }); + registry.getZipper([DrawableCircle2D, Position2D]).forEach(({ DrawableCircle2D, Position2D }) => { + DrawableCircle2D.draw(layer, Position2D, ctx.assets); + drawn.add(DrawableCircle2D); + }); + registry.getZipper([DrawableText2D, Position2D]).forEach(({ DrawableText2D, Position2D }) => { + DrawableText2D.draw(layer, Position2D); + drawn.add(DrawableText2D); + }); + + // `killEntity` doesn't call `destroy()`: a drawable no longer in the world loses its shape here. + for (const drawable of shown) if (!drawn.has(drawable)) drawable.destroy(); + shown = drawn; +}; diff --git a/basics/sprite-2d/tsconfig.json b/basics/sprite-2d/tsconfig.json new file mode 100644 index 0000000..c0ae4f2 --- /dev/null +++ b/basics/sprite-2d/tsconfig.json @@ -0,0 +1,39 @@ +{ + "$schema": "https://json.schemastore.org/tsconfig.json", + // Mapped from https://www.typescriptlang.org/tsconfig + "compilerOptions": { + // Type Checking + "allowUnreachableCode": false, + "allowUnusedLabels": false, + "noFallthroughCasesInSwitch": true, + "noImplicitOverride": true, + "noImplicitReturns": true, + "noPropertyAccessFromIndexSignature": false, + "noUncheckedIndexedAccess": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "strict": true, + + // Modules + "allowArbitraryExtensions": false, + "allowImportingTsExtensions": false, + "module": "ESNext", + "moduleResolution": "Bundler", + "resolveJsonModule": true, + "resolvePackageJsonExports": true, + "resolvePackageJsonImports": true, + + // Interop Constraints + "allowSyntheticDefaultImports": true, + "forceConsistentCasingInFileNames": true, + "isolatedModules": true, + + // Language and Environment + "experimentalDecorators": true, + "lib": ["ESNext", "esnext.disposable", "DOM"], + "target": "ESNext", + "useDefineForClassFields": true + }, + "include": ["src"], + "exclude": ["node_modules", ".nanoforge", "dist"] +} diff --git a/demos/pong-3d/.env.example b/demos/pong-3d/.env.example new file mode 100644 index 0000000..9fddc90 --- /dev/null +++ b/demos/pong-3d/.env.example @@ -0,0 +1,7 @@ +# Copy to .env (`cp .env.example .env`): `nf start` and `nf dev` read it. +# The client connects to the server at this address and port. +NANOFORGE_CLIENT_SERVER_ADDRESS=127.0.0.1 +NANOFORGE_CLIENT_SERVER_TCP_PORT=4444 + +# The server listens on this port. +NANOFORGE_SERVER_LISTENING_TCP_PORT=4444 diff --git a/demos/pong-3d/.gitignore b/demos/pong-3d/.gitignore new file mode 100644 index 0000000..f28e2dc --- /dev/null +++ b/demos/pong-3d/.gitignore @@ -0,0 +1,5 @@ +node_modules/ +dist/ +.nanoforge/ +nf_modules/ +.env diff --git a/demos/pong-3d/README.md b/demos/pong-3d/README.md new file mode 100644 index 0000000..8d8199c --- /dev/null +++ b/demos/pong-3d/README.md @@ -0,0 +1,45 @@ +# pong-3d + +Pong in 3D for two players, without a game server: the first player hosts the game in their +browser tab, the second joins it (`network: "p2p"` in `nanoforge.config.ts`). + +| Key | Does | +| ----- | ----------------------------------------- | +| ← / → | Moves your paddle, as seen from behind it | + +The camera stands behind your paddle and follows it; a third player watches from above the +table. + +## Run it + +```sh +pnpm install +cp .env.example .env +pnpm build && pnpm start # or pnpm dev +pnpm editor # open it in the editor +``` + +Open the client's address: that tab hosts a game and logs its invite link (`?room=CODE`). Open +the link in another tab, or send it to the other player. + +The Bun server only pairs the players (WebRTC signaling). `.env` sets where it listens and where +the clients find it (the shell's variables win over it): + +| Variable | Default | What | +| ------------------------------------- | ----------- | ---------------------------------------- | +| `NANOFORGE_CLIENT_SERVER_ADDRESS` | `127.0.0.1` | The signaling server's address | +| `NANOFORGE_CLIENT_SERVER_TCP_PORT` | `4444` | The signaling server's port | +| `NANOFORGE_SERVER_LISTENING_TCP_PORT` | `4444` | The port the signaling server listens on | + +## How it works + +`apps/server` is the same as `pong-network`'s, file for file: the game runs on a 1920 × 1080 +field in 2D, in the host's tab. `apps/client` draws that field in 3D, 100 field units to a world +unit: `DrawableBox3D` and `DrawableSphere3D` draw a box or a ball (in world units) at their +entity's `Transform3D`, `placeOnField` keeps each `Transform3D` where its `Position2D` says, +resting on the table, `draw3D` puts the meshes in the scene, and `followCamera` moves the camera. +`PaddleInput` is `mirrored`: for the right paddle, whose camera faces the other way, the keys +swap. + +The files of `src/` that are also in `shared/2d`, `shared/3d`, `shared/network` or +`shared/paddle` are copies (see the repository's README). diff --git a/demos/pong-3d/apps/client/assets/.gitkeep b/demos/pong-3d/apps/client/assets/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/demos/pong-3d/apps/client/nanoforge.config.ts b/demos/pong-3d/apps/client/nanoforge.config.ts new file mode 100644 index 0000000..77607cb --- /dev/null +++ b/demos/pong-3d/apps/client/nanoforge.config.ts @@ -0,0 +1,5 @@ +import { defineConfig } from "@nanoforge-dev/config"; + +export default defineConfig({ + type: "client", +}); diff --git a/demos/pong-3d/apps/client/package.json b/demos/pong-3d/apps/client/package.json new file mode 100644 index 0000000..3702d7b --- /dev/null +++ b/demos/pong-3d/apps/client/package.json @@ -0,0 +1,19 @@ +{ + "$schema": "https://json.schemastore.org/package.json", + "name": "pong-3d-client", + "description": "The client of pong-3d: draws the game in 3D and sends the player's keys", + "private": true, + "type": "module", + "devDependencies": { + "@nanoforge-dev/asset": "^3.0.0", + "@nanoforge-dev/common": "^3.0.0", + "@nanoforge-dev/core": "^3.0.0", + "@nanoforge-dev/ecs": "^3.0.0", + "@nanoforge-dev/editor-lib": "^3.0.0", + "@nanoforge-dev/env": "^3.0.0", + "@nanoforge-dev/graphics-3d": "^3.0.0", + "@nanoforge-dev/input": "^3.0.0", + "@nanoforge-dev/network": "^3.0.0", + "typescript": "^6.0.0" + } +} diff --git a/demos/pong-3d/apps/client/src/components/acceleration-2d.component.ts b/demos/pong-3d/apps/client/src/components/acceleration-2d.component.ts new file mode 100644 index 0000000..5d4097f --- /dev/null +++ b/demos/pong-3d/apps/client/src/components/acceleration-2d.component.ts @@ -0,0 +1,18 @@ +/** + * How fast the velocity of an entity changes, in pixels per second, per second. Needs + * `Velocity2D` and the `move2D` system. + * + * @component + * @side shared + * @group Acceleration color=#f0a33a - Pixels per second, per second. + */ +export class Acceleration2D { + name = "Acceleration2D"; + + constructor( + /** Added to the horizontal velocity every second. @group Acceleration @preset vector.x */ + public x = 0, + /** Added to the vertical velocity every second. @group Acceleration @preset vector.y */ + public y = 0, + ) {} +} diff --git a/demos/pong-3d/apps/client/src/components/camera-rig.component.ts b/demos/pong-3d/apps/client/src/components/camera-rig.component.ts new file mode 100644 index 0000000..e4f3243 --- /dev/null +++ b/demos/pong-3d/apps/client/src/components/camera-rig.component.ts @@ -0,0 +1,15 @@ +import type { Vector3 } from "@nanoforge-dev/graphics-3d/three"; + +/** + * Moves the camera: behind the local player's paddle, or above the table while watching. Needs a + * `PaddleInput` on the same entity and the `followCamera` system. + * + * @component + * @side client + */ +export class CameraRig { + name = "CameraRig"; + + /** Where the camera looks, eased toward its goal every tick. */ + look: Vector3 | undefined = undefined; +} diff --git a/demos/pong-3d/apps/client/src/components/drawable-box-3d.component.ts b/demos/pong-3d/apps/client/src/components/drawable-box-3d.component.ts new file mode 100644 index 0000000..638eb08 --- /dev/null +++ b/demos/pong-3d/apps/client/src/components/drawable-box-3d.component.ts @@ -0,0 +1,71 @@ +import { + BoxGeometry, + MathUtils, + Mesh, + MeshStandardMaterial, + type Scene, +} from "@nanoforge-dev/graphics-3d/three"; + +import type { Transform3D } from "./transform-3d.component"; + +/** + * Draws a box at the entity's `Transform3D` (its center), turned like it. Needs the `draw3D` + * system. + * + * @remarks + * `mesh` is the Three.js `Mesh` in the scene: change it from code for anything the parameters + * don't offer. It casts and receives shadows when the renderer's shadow map is on. + * + * @component + * @side client + * @group Shape color=#e86fb0 - Size of the box, in world units. + * @group Look color=#b18cff - What the box looks like. + */ +export class DrawableBox3D { + name = "DrawableBox3D"; + + /** The box in the scene, made by `draw3D` the first time it draws it. */ + mesh?: Mesh; + + constructor( + /** Along x. @group Shape @preset size.width */ + public width = 1, + /** Along y, up. @group Shape @preset size.height */ + public height = 1, + /** Along z. @group Shape */ + public depth = 1, + /** A CSS color: `red`, `#ff0000`... @group Look @preset color */ + public color = "#44aa88", + /** From 0 (a mirror) to 1 (matte). @group Look */ + public roughness = 1, + /** Whether it is drawn. @group Look */ + public visible = true, + ) {} + + /** Puts the box in `scene` at `transform`, up to date with the parameters. */ + draw(scene: Scene, transform: Transform3D): void { + if (!this.mesh) { + this.mesh = new Mesh(new BoxGeometry(), new MeshStandardMaterial()); + this.mesh.castShadow = this.mesh.receiveShadow = true; + } + if (this.mesh.parent !== scene) scene.add(this.mesh); + this.mesh.scale.set(this.width, this.height, this.depth); + this.mesh.material.color.set(this.color); + this.mesh.material.roughness = this.roughness; + this.mesh.visible = this.visible; + this.mesh.position.set(transform.x, transform.y, transform.z); + this.mesh.rotation.set( + MathUtils.degToRad(transform.rotationX), + MathUtils.degToRad(transform.rotationY), + MathUtils.degToRad(transform.rotationZ), + ); + } + + /** Removes the box from the scene and frees its GPU memory. */ + destroy(): void { + this.mesh?.removeFromParent(); + this.mesh?.geometry.dispose(); + this.mesh?.material.dispose(); + this.mesh = undefined; + } +} diff --git a/demos/pong-3d/apps/client/src/components/drawable-sphere-3d.component.ts b/demos/pong-3d/apps/client/src/components/drawable-sphere-3d.component.ts new file mode 100644 index 0000000..bdc9c91 --- /dev/null +++ b/demos/pong-3d/apps/client/src/components/drawable-sphere-3d.component.ts @@ -0,0 +1,66 @@ +import { + MathUtils, + Mesh, + MeshStandardMaterial, + type Scene, + SphereGeometry, +} from "@nanoforge-dev/graphics-3d/three"; + +import type { Transform3D } from "./transform-3d.component"; + +/** + * Draws a ball at the entity's `Transform3D` (its center). Needs the `draw3D` system. + * + * @remarks + * `mesh` is the Three.js `Mesh` in the scene: change it from code for anything the parameters + * don't offer. It casts shadows when the renderer's shadow map is on. + * + * @component + * @side client + * @group Shape color=#e86fb0 - Size of the ball, in world units. + * @group Look color=#b18cff - What the ball looks like. + */ +export class DrawableSphere3D { + name = "DrawableSphere3D"; + + /** The ball in the scene, made by `draw3D` the first time it draws it. */ + mesh?: Mesh; + + constructor( + /** @group Shape */ + public radius = 0.5, + /** A CSS color: `red`, `#ff0000`... @group Look @preset color */ + public color = "#ff4d3d", + /** From 0 (a mirror) to 1 (matte). @group Look */ + public roughness = 1, + /** Whether it is drawn. @group Look */ + public visible = true, + ) {} + + /** Puts the ball in `scene` at `transform`, up to date with the parameters. */ + draw(scene: Scene, transform: Transform3D): void { + if (!this.mesh) { + this.mesh = new Mesh(new SphereGeometry(1, 32, 16), new MeshStandardMaterial()); + this.mesh.castShadow = true; + } + if (this.mesh.parent !== scene) scene.add(this.mesh); + this.mesh.scale.setScalar(this.radius); + this.mesh.material.color.set(this.color); + this.mesh.material.roughness = this.roughness; + this.mesh.visible = this.visible; + this.mesh.position.set(transform.x, transform.y, transform.z); + this.mesh.rotation.set( + MathUtils.degToRad(transform.rotationX), + MathUtils.degToRad(transform.rotationY), + MathUtils.degToRad(transform.rotationZ), + ); + } + + /** Removes the ball from the scene and frees its GPU memory. */ + destroy(): void { + this.mesh?.removeFromParent(); + this.mesh?.geometry.dispose(); + this.mesh?.material.dispose(); + this.mesh = undefined; + } +} diff --git a/demos/pong-3d/apps/client/src/components/network-id.component.ts b/demos/pong-3d/apps/client/src/components/network-id.component.ts new file mode 100644 index 0000000..084289d --- /dev/null +++ b/demos/pong-3d/apps/client/src/components/network-id.component.ts @@ -0,0 +1,20 @@ +/** + * The id of an entity on the network: the server and the clients know the entity by it, and the + * messages about the entity carry it. + * + * @component + * @side shared + */ +export class NetworkId { + name = "NetworkId"; + + /** The velocity last sent to the clients (by pong's `syncMoves`). NaN: to send again. */ + sentX = Number.NaN; + /** See `sentX`. */ + sentY = Number.NaN; + + constructor( + /** Same on the server and the clients. */ + public id = 0, + ) {} +} diff --git a/demos/pong-3d/apps/client/src/components/paddle-input.component.ts b/demos/pong-3d/apps/client/src/components/paddle-input.component.ts new file mode 100644 index 0000000..7270b37 --- /dev/null +++ b/demos/pong-3d/apps/client/src/components/paddle-input.component.ts @@ -0,0 +1,27 @@ +import { InputEnum } from "@nanoforge-dev/input"; + +/** + * The local player's keys: the `sendInput` system sends them to the server, which moves the + * player's paddle. + * + * @component + * @side client + * @group Keys color=#f0a33a - The keys that move the paddle. + */ +export class PaddleInput { + name = "PaddleInput"; + + /** The paddle the server gave this player (`Seated`): 1, 2, or 0 while watching. */ + seat = 0; + /** The last key sent to the server. */ + sent: "up" | "down" | "stop" = "stop"; + + constructor( + /** Moves the paddle up the field. @group Keys */ + public up: InputEnum = InputEnum.ArrowUp, + /** Moves the paddle down the field. @group Keys */ + public down: InputEnum = InputEnum.ArrowDown, + /** Swaps the keys for seat 2, whose camera faces the other way. @group Keys */ + public mirrored = false, + ) {} +} diff --git a/demos/pong-3d/apps/client/src/components/position-2d.component.ts b/demos/pong-3d/apps/client/src/components/position-2d.component.ts new file mode 100644 index 0000000..0a35624 --- /dev/null +++ b/demos/pong-3d/apps/client/src/components/position-2d.component.ts @@ -0,0 +1,20 @@ +/** + * Where an entity is, in pixels from the top-left corner of the screen. + * + * @remarks + * For rectangles it is their top-left corner, for circles their center. + * + * @component + * @side shared + * @group Position color=#4aa3ff - Pixels from the top-left corner of the screen. + */ +export class Position2D { + name = "Position2D"; + + constructor( + /** Pixels from the left edge. @group Position @preset vector.x */ + public x = 0, + /** Pixels from the top edge. @group Position @preset vector.y */ + public y = 0, + ) {} +} diff --git a/demos/pong-3d/apps/client/src/components/transform-3d.component.ts b/demos/pong-3d/apps/client/src/components/transform-3d.component.ts new file mode 100644 index 0000000..1d2f8d0 --- /dev/null +++ b/demos/pong-3d/apps/client/src/components/transform-3d.component.ts @@ -0,0 +1,26 @@ +/** + * Where an entity is in the 3D world, and how it is turned. + * + * @component + * @side shared + * @group Position color=#4aa3ff - World units from the origin. + * @group Rotation color=#36c5a0 - Degrees around each axis. + */ +export class Transform3D { + name = "Transform3D"; + + constructor( + /** @group Position @preset vector.x */ + public x = 0, + /** @group Position @preset vector.y */ + public y = 0, + /** @group Position */ + public z = 0, + /** @group Rotation */ + public rotationX = 0, + /** @group Rotation */ + public rotationY = 0, + /** @group Rotation */ + public rotationZ = 0, + ) {} +} diff --git a/demos/pong-3d/apps/client/src/components/velocity-2d.component.ts b/demos/pong-3d/apps/client/src/components/velocity-2d.component.ts new file mode 100644 index 0000000..3b93d4e --- /dev/null +++ b/demos/pong-3d/apps/client/src/components/velocity-2d.component.ts @@ -0,0 +1,20 @@ +/** + * How fast an entity moves, in pixels per second. Needs `Position2D` and the `move2D` system. + * + * @example + * `new Velocity2D(100, 0)` moves 100 pixels to the right every second. + * + * @component + * @side shared + * @group Velocity color=#36c5a0 - Pixels per second. + */ +export class Velocity2D { + name = "Velocity2D"; + + constructor( + /** Pixels per second to the right (negative: to the left). @group Velocity @preset vector.x */ + public x = 0, + /** Pixels per second downward (negative: upward). @group Velocity @preset vector.y */ + public y = 0, + ) {} +} diff --git a/demos/pong-3d/apps/client/src/field.ts b/demos/pong-3d/apps/client/src/field.ts new file mode 100644 index 0000000..3a7f36f --- /dev/null +++ b/demos/pong-3d/apps/client/src/field.ts @@ -0,0 +1,14 @@ +import { Vector3 } from "@nanoforge-dev/graphics-3d/three"; + +/** The field the server plays on, in its units: x to the right, y down. */ +export const FIELD = { width: 1920, height: 1080 } as const; + +/** World units per field unit: the 1920 × 1080 field is 19.2 × 10.8 in 3D. */ +export const SCALE = 1 / 100; + +/** + * Field point → world point. The field lies on the ground, centered on the origin: field x goes + * along world x, field y (down) along world z, and `height` (in field units) up. + */ +export const fieldToWorld = (x: number, y: number, height = 0, target = new Vector3()): Vector3 => + target.set((x - FIELD.width / 2) * SCALE, height * SCALE, (y - FIELD.height / 2) * SCALE); diff --git a/demos/pong-3d/apps/client/src/lights.ts b/demos/pong-3d/apps/client/src/lights.ts new file mode 100644 index 0000000..34a5a1e --- /dev/null +++ b/demos/pong-3d/apps/client/src/lights.ts @@ -0,0 +1,19 @@ +import { + Color, + DirectionalLight, + HemisphereLight, + type Scene, +} from "@nanoforge-dev/graphics-3d/three"; + +/** Adds the background and the lights to the scene: a sky light and a sun that casts shadows. */ +export const addLights = (scene: Scene): void => { + scene.background = new Color("#10141c"); + + const sun = new DirectionalLight("white", 2.5); + sun.position.set(-4, 12, 6); + sun.castShadow = true; + sun.shadow.mapSize.set(2048, 2048); + Object.assign(sun.shadow.camera, { left: -12, right: 12, top: 8, bottom: -8 }); + + scene.add(new HemisphereLight("#dfe8ff", "#20301c", 1.2), sun); +}; diff --git a/demos/pong-3d/apps/client/src/main.ts b/demos/pong-3d/apps/client/src/main.ts new file mode 100644 index 0000000..0b5421e --- /dev/null +++ b/demos/pong-3d/apps/client/src/main.ts @@ -0,0 +1,104 @@ +import type { ClientRunOptions } from "@nanoforge-dev/common"; +import { NanoforgeFactory } from "@nanoforge-dev/core"; +import { EcsLibrary } from "@nanoforge-dev/ecs/client"; +import { EditorLibrary } from "@nanoforge-dev/editor-lib"; +import { Graphics3DLibrary } from "@nanoforge-dev/graphics-3d"; +import { InputEnum, InputLibrary } from "@nanoforge-dev/input"; +import { NetworkClientLibrary } from "@nanoforge-dev/network/client"; + +import { CameraRig } from "./components/camera-rig.component"; +import { DrawableBox3D } from "./components/drawable-box-3d.component"; +import { DrawableSphere3D } from "./components/drawable-sphere-3d.component"; +import { NetworkId } from "./components/network-id.component"; +import { PaddleInput } from "./components/paddle-input.component"; +import { Position2D } from "./components/position-2d.component"; +import { Transform3D } from "./components/transform-3d.component"; +import { Velocity2D } from "./components/velocity-2d.component"; +import { addLights } from "./lights"; +import { Play } from "./pong-protocol"; +import { applyMoves } from "./systems/apply-moves.system"; +import { draw3D } from "./systems/draw-3d.system"; +import { followCamera } from "./systems/follow-camera.system"; +import { move2D } from "./systems/move-2d.system"; +import { placeOnField } from "./systems/place-on-field.system"; +import { sendInput } from "./systems/send-input.system"; + +export const main = async (options: ClientRunOptions): Promise => { + const app = NanoforgeFactory.createClient({ + tickRate: 60, + viewport: { width: 1920, height: 1080, fit: "contain" }, + }); + const graphics = new Graphics3DLibrary(); + const ecs = new EcsLibrary(); + const network = new NetworkClientLibrary(); + + app.use(graphics); + app.use(ecs); + app.use(network); + app.use(new InputLibrary()); + app.use(new EditorLibrary()); + + await app.init(options); + + graphics.renderer.shadowMap.enabled = true; + addLights(graphics.scene); + + const registry = ecs.registry; + + // 3D sizes are in world units: the field is 19.2 × 10.8 (`SCALE`, in field.ts). + const table = registry.spawnEntity(); + registry.addComponent(table, new Position2D(0, 0)); + registry.addComponent(table, new Transform3D()); + registry.addComponent(table, new DrawableBox3D(19.2, 0.01, 10.8, "#2f6b2a", 0.6)); + + const centerLine = registry.spawnEntity(); + registry.addComponent(centerLine, new Position2D(955, 0)); + registry.addComponent(centerLine, new Transform3D()); + registry.addComponent(centerLine, new DrawableBox3D(0.1, 0.02, 10.8, "#94cc75", 0.6)); + + const topBorder = registry.spawnEntity(); + registry.addComponent(topBorder, new Position2D(-20, -20)); + registry.addComponent(topBorder, new Transform3D()); + registry.addComponent(topBorder, new DrawableBox3D(19.6, 0.4, 0.2, "#c8d0dc", 0.6)); + + const bottomBorder = registry.spawnEntity(); + registry.addComponent(bottomBorder, new Position2D(-20, 1080)); + registry.addComponent(bottomBorder, new Transform3D()); + registry.addComponent(bottomBorder, new DrawableBox3D(19.6, 0.4, 0.2, "#c8d0dc", 0.6)); + + const ball = registry.spawnEntity(); + registry.addComponent(ball, new Position2D(945, 525)); + registry.addComponent(ball, new Velocity2D(0, 0)); + registry.addComponent(ball, new NetworkId(0)); + registry.addComponent(ball, new Transform3D()); + registry.addComponent(ball, new DrawableSphere3D(0.15, "#ff4d3d", 0.3)); + + const leftPaddle = registry.spawnEntity(); + registry.addComponent(leftPaddle, new Position2D(20, 390)); + registry.addComponent(leftPaddle, new Velocity2D(0, 0)); + registry.addComponent(leftPaddle, new NetworkId(1)); + registry.addComponent(leftPaddle, new Transform3D()); + registry.addComponent(leftPaddle, new DrawableBox3D(0.3, 0.4, 3, "#4d8dff", 0.6)); + + const rightPaddle = registry.spawnEntity(); + registry.addComponent(rightPaddle, new Position2D(1870, 390)); + registry.addComponent(rightPaddle, new Velocity2D(0, 0)); + registry.addComponent(rightPaddle, new NetworkId(2)); + registry.addComponent(rightPaddle, new Transform3D()); + registry.addComponent(rightPaddle, new DrawableBox3D(0.3, 0.4, 3, "#ff9f40", 0.6)); + + const player = registry.spawnEntity(); + registry.addComponent(player, new PaddleInput(InputEnum.ArrowLeft, InputEnum.ArrowRight, true)); + registry.addComponent(player, new CameraRig()); + + registry.addSystem(sendInput); + registry.addSystem(applyMoves); + registry.addSystem(move2D); + registry.addSystem(placeOnField); + registry.addSystem(draw3D); + registry.addSystem(followCamera); + + network.packets.send(Play); + + await app.run(); +}; diff --git a/demos/pong-3d/apps/client/src/pong-protocol.ts b/demos/pong-3d/apps/client/src/pong-protocol.ts new file mode 100644 index 0000000..c889517 --- /dev/null +++ b/demos/pong-3d/apps/client/src/pong-protocol.ts @@ -0,0 +1,21 @@ +import { definePacket } from "@nanoforge-dev/network"; + +type Vector = { x: number; y: number }; +type Key = "up" | "down" | "stop"; + +const KEYS: unknown[] = ["up", "down", "stop"] satisfies Key[]; + +/** Sent once by a client to join: the server answers with `Seated`. */ +export const Play = definePacket("play"); + +/** The paddle a client plays: 1 (left), 2 (right), or 0 when it watches. */ +export const Seated = definePacket<{ paddle: number }>("seated"); + +/** Where a client wants its paddle to go. Anything else than the three keys is dropped. */ +export const Input = definePacket<{ key: Key }>("input", { + validate: (data): data is { key: Key } => + typeof data === "object" && data !== null && KEYS.includes((data as { key?: unknown }).key), +}); + +/** The position and velocity of the entity of `NetworkId` `id`, sent when its velocity changes. */ +export const Move = definePacket<{ id: number; position: Vector; velocity: Vector }>("move"); diff --git a/demos/pong-3d/apps/client/src/systems/apply-moves.system.ts b/demos/pong-3d/apps/client/src/systems/apply-moves.system.ts new file mode 100644 index 0000000..0621cec --- /dev/null +++ b/demos/pong-3d/apps/client/src/systems/apply-moves.system.ts @@ -0,0 +1,27 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; + +import { NetworkId } from "../components/network-id.component"; +import { Position2D } from "../components/position-2d.component"; +import { Velocity2D } from "../components/velocity-2d.component"; +import { Move } from "../pong-protocol"; + +/** + * Applies the server's `Move` packets to the `NetworkId` entities: `move2D` moves them the same + * way until the next one. Add it before `move2D`. + * + * @system + * @side client + */ +export const applyMoves = (registry: Registry, ctx: Context) => { + const entities = registry.getZipper([NetworkId, Position2D, Velocity2D]); + + for (const { data } of ctx.network.packets.read(Move)) { + const entity = entities.find(({ NetworkId }) => NetworkId.id === data.id); + if (!entity) continue; + entity.Position2D.x = data.position.x; + entity.Position2D.y = data.position.y; + entity.Velocity2D.x = data.velocity.x; + entity.Velocity2D.y = data.velocity.y; + } +}; diff --git a/demos/pong-3d/apps/client/src/systems/draw-3d.system.ts b/demos/pong-3d/apps/client/src/systems/draw-3d.system.ts new file mode 100644 index 0000000..d9e3948 --- /dev/null +++ b/demos/pong-3d/apps/client/src/systems/draw-3d.system.ts @@ -0,0 +1,43 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; +import "@nanoforge-dev/graphics-3d"; + +import { DrawableBox3D } from "../components/drawable-box-3d.component"; +import { DrawableSphere3D } from "../components/drawable-sphere-3d.component"; +import { Transform3D } from "../components/transform-3d.component"; + +type Drawable = DrawableBox3D | DrawableSphere3D; + +/** The drawables shown by the last frame. */ +let shown = new Set(); + +/** + * Puts every entity that has a `Transform3D` and a `DrawableBox3D` or `DrawableSphere3D` in the + * 3D scene, where it is. Add it after the systems that move entities: graphics-3d renders the + * scene after the systems. + * + * @remarks + * The mesh of a killed entity, or of a removed drawable, is removed from the scene. + * + * @system + * @side client + */ +export const draw3D = (registry: Registry, ctx: Context) => { + const scene = ctx.graphics.scene; + const drawn = new Set(); + + registry.getZipper([DrawableBox3D, Transform3D]).forEach(({ DrawableBox3D, Transform3D }) => { + DrawableBox3D.draw(scene, Transform3D); + drawn.add(DrawableBox3D); + }); + registry + .getZipper([DrawableSphere3D, Transform3D]) + .forEach(({ DrawableSphere3D, Transform3D }) => { + DrawableSphere3D.draw(scene, Transform3D); + drawn.add(DrawableSphere3D); + }); + + // `killEntity` doesn't call `destroy()`: a drawable no longer in the world loses its mesh here. + for (const drawable of shown) if (!drawn.has(drawable)) drawable.destroy(); + shown = drawn; +}; diff --git a/demos/pong-3d/apps/client/src/systems/follow-camera.system.ts b/demos/pong-3d/apps/client/src/systems/follow-camera.system.ts new file mode 100644 index 0000000..9e0adfb --- /dev/null +++ b/demos/pong-3d/apps/client/src/systems/follow-camera.system.ts @@ -0,0 +1,57 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; +import { Vector3 } from "@nanoforge-dev/graphics-3d/three"; + +import { CameraRig } from "../components/camera-rig.component"; +import { NetworkId } from "../components/network-id.component"; +import { PaddleInput } from "../components/paddle-input.component"; +import { Transform3D } from "../components/transform-3d.component"; +import { FIELD, SCALE, fieldToWorld } from "../field"; + +// Above and behind the right end of the table, framing both paddles. +const SPECTATOR_EYE = fieldToWorld(FIELD.width + 900, FIELD.height / 2, 1200); +const SPECTATOR_LOOK = fieldToWorld(FIELD.width / 2 + 270, FIELD.height / 2); +const eye = new Vector3(); +const look = new Vector3(); + +/** + * Players see the table from just above and behind their own paddle (the one whose `NetworkId` + * is their seat), following it. Watchers see it from above its right end. + * + * @system + * @side client + */ +export const followCamera = (registry: Registry, ctx: Context) => { + const paddles = registry.getZipper([NetworkId, Transform3D]); + + registry + .getZipper([PaddleInput, CameraRig]) + .forEach(({ PaddleInput: player, CameraRig: rig }) => { + const paddle = + player.seat === 0 + ? undefined + : paddles.find(({ NetworkId }) => NetworkId.id === player.seat); + if (paddle) { + const side = player.seat === 1 ? 1 : -1; + // The paddle's center, in world units (`placeOnField` keeps it up to date). + const { x, z } = paddle.Transform3D; + // Behind and above the paddle, looking short of the center line: the paddle stays in view. + eye.set(x - side * 400 * SCALE, 300 * SCALE, z); + look.set(-side * 200 * SCALE, 0, z / 2); + } else { + eye.copy(SPECTATOR_EYE); + look.copy(SPECTATOR_LOOK); + } + + const camera = ctx.graphics.camera; + if (!rig.look) { + rig.look = look.clone(); + camera.position.copy(eye); + } + // Eases toward the goal in about a fifth of a second, whatever the frame rate. + const t = 1 - Math.exp(-ctx.app.delta / 120); + camera.position.lerp(eye, t); + rig.look.lerp(look, t); + camera.lookAt(rig.look); + }); +}; diff --git a/demos/pong-3d/apps/client/src/systems/move-2d.system.ts b/demos/pong-3d/apps/client/src/systems/move-2d.system.ts new file mode 100644 index 0000000..514766a --- /dev/null +++ b/demos/pong-3d/apps/client/src/systems/move-2d.system.ts @@ -0,0 +1,26 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; + +import { Acceleration2D } from "../components/acceleration-2d.component"; +import { Position2D } from "../components/position-2d.component"; +import { Velocity2D } from "../components/velocity-2d.component"; + +/** + * Moves entities: their `Acceleration2D` changes their `Velocity2D`, then their `Velocity2D` + * changes their `Position2D`, by the time elapsed since the last frame. + * + * @system + * @side shared + */ +export const move2D = (registry: Registry, ctx: Context) => { + const seconds = ctx.app.delta / 1000; + + registry.getZipper([Acceleration2D, Velocity2D]).forEach(({ Acceleration2D, Velocity2D }) => { + Velocity2D.x += Acceleration2D.x * seconds; + Velocity2D.y += Acceleration2D.y * seconds; + }); + registry.getZipper([Position2D, Velocity2D]).forEach(({ Position2D, Velocity2D }) => { + Position2D.x += Velocity2D.x * seconds; + Position2D.y += Velocity2D.y * seconds; + }); +}; diff --git a/demos/pong-3d/apps/client/src/systems/place-on-field.system.ts b/demos/pong-3d/apps/client/src/systems/place-on-field.system.ts new file mode 100644 index 0000000..7170470 --- /dev/null +++ b/demos/pong-3d/apps/client/src/systems/place-on-field.system.ts @@ -0,0 +1,32 @@ +import type { Registry } from "@nanoforge-dev/ecs"; + +import { DrawableBox3D } from "../components/drawable-box-3d.component"; +import { DrawableSphere3D } from "../components/drawable-sphere-3d.component"; +import { Position2D } from "../components/position-2d.component"; +import { Transform3D } from "../components/transform-3d.component"; +import { FIELD, SCALE } from "../field"; + +/** + * Places each drawable on the field: its `Transform3D` follows its `Position2D` (the top-left + * corner of its shape on the 2D field, in field units), with the shape resting on the ground. + * Add it after the systems that move entities, before `draw3D`. + * + * @system + * @side client + */ +export const placeOnField = (registry: Registry) => { + registry + .getZipper([Position2D, Transform3D, DrawableBox3D]) + .forEach(({ Position2D: at, Transform3D: transform, DrawableBox3D: box }) => { + transform.x = (at.x - FIELD.width / 2) * SCALE + box.width / 2; + transform.y = box.height / 2; + transform.z = (at.y - FIELD.height / 2) * SCALE + box.depth / 2; + }); + registry + .getZipper([Position2D, Transform3D, DrawableSphere3D]) + .forEach(({ Position2D: at, Transform3D: transform, DrawableSphere3D: ball }) => { + transform.x = (at.x - FIELD.width / 2) * SCALE + ball.radius; + transform.y = ball.radius; + transform.z = (at.y - FIELD.height / 2) * SCALE + ball.radius; + }); +}; diff --git a/demos/pong-3d/apps/client/src/systems/send-input.system.ts b/demos/pong-3d/apps/client/src/systems/send-input.system.ts new file mode 100644 index 0000000..a8f6a0d --- /dev/null +++ b/demos/pong-3d/apps/client/src/systems/send-input.system.ts @@ -0,0 +1,30 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; +import "@nanoforge-dev/input"; + +import { PaddleInput } from "../components/paddle-input.component"; +import { Input, Seated } from "../pong-protocol"; + +/** + * Sends the local player's `PaddleInput` keys to the server when they change, once it has a + * seat (`Seated`). + * + * @system + * @side client + */ +export const sendInput = (registry: Registry, ctx: Context) => { + const seated = ctx.network.packets.read(Seated).at(-1); + + registry.getZipper([PaddleInput]).forEach(({ PaddleInput: player }) => { + if (seated) player.seat = seated.data.paddle; + if (player.seat === 0) return; + const up = ctx.input.isKeyPressed(player.up) === true; + const down = ctx.input.isKeyPressed(player.down) === true; + const flip = player.mirrored && player.seat === 2; + let key: "up" | "down" | "stop" = "stop"; + if (up !== down) key = up !== flip ? "up" : "down"; + if (key === player.sent) return; + ctx.network.packets.send(Input, { key }); + player.sent = key; + }); +}; diff --git a/demos/pong-3d/apps/client/tsconfig.json b/demos/pong-3d/apps/client/tsconfig.json new file mode 100644 index 0000000..c0ae4f2 --- /dev/null +++ b/demos/pong-3d/apps/client/tsconfig.json @@ -0,0 +1,39 @@ +{ + "$schema": "https://json.schemastore.org/tsconfig.json", + // Mapped from https://www.typescriptlang.org/tsconfig + "compilerOptions": { + // Type Checking + "allowUnreachableCode": false, + "allowUnusedLabels": false, + "noFallthroughCasesInSwitch": true, + "noImplicitOverride": true, + "noImplicitReturns": true, + "noPropertyAccessFromIndexSignature": false, + "noUncheckedIndexedAccess": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "strict": true, + + // Modules + "allowArbitraryExtensions": false, + "allowImportingTsExtensions": false, + "module": "ESNext", + "moduleResolution": "Bundler", + "resolveJsonModule": true, + "resolvePackageJsonExports": true, + "resolvePackageJsonImports": true, + + // Interop Constraints + "allowSyntheticDefaultImports": true, + "forceConsistentCasingInFileNames": true, + "isolatedModules": true, + + // Language and Environment + "experimentalDecorators": true, + "lib": ["ESNext", "esnext.disposable", "DOM"], + "target": "ESNext", + "useDefineForClassFields": true + }, + "include": ["src"], + "exclude": ["node_modules", ".nanoforge", "dist"] +} diff --git a/demos/pong-3d/apps/server/assets/.gitkeep b/demos/pong-3d/apps/server/assets/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/demos/pong-3d/apps/server/nanoforge.config.ts b/demos/pong-3d/apps/server/nanoforge.config.ts new file mode 100644 index 0000000..43a3fef --- /dev/null +++ b/demos/pong-3d/apps/server/nanoforge.config.ts @@ -0,0 +1,5 @@ +import { defineConfig } from "@nanoforge-dev/config"; + +export default defineConfig({ + type: "server", +}); diff --git a/demos/pong-3d/apps/server/package.json b/demos/pong-3d/apps/server/package.json new file mode 100644 index 0000000..478ed1e --- /dev/null +++ b/demos/pong-3d/apps/server/package.json @@ -0,0 +1,17 @@ +{ + "$schema": "https://json.schemastore.org/package.json", + "name": "pong-3d-server", + "description": "The server of pong-3d: runs the game and sends it to the clients", + "private": true, + "type": "module", + "devDependencies": { + "@nanoforge-dev/asset": "^3.0.0", + "@nanoforge-dev/common": "^3.0.0", + "@nanoforge-dev/core": "^3.0.0", + "@nanoforge-dev/ecs": "^3.0.0", + "@nanoforge-dev/editor-lib": "^3.0.0", + "@nanoforge-dev/env": "^3.0.0", + "@nanoforge-dev/network": "^3.0.0", + "typescript": "^6.0.0" + } +} diff --git a/demos/pong-3d/apps/server/src/collisions.ts b/demos/pong-3d/apps/server/src/collisions.ts new file mode 100644 index 0000000..fa825fa --- /dev/null +++ b/demos/pong-3d/apps/server/src/collisions.ts @@ -0,0 +1,32 @@ +import type { HitboxRect2D } from "./components/hitbox-rect-2d.component"; +import type { Position2D } from "./components/position-2d.component"; +import type { Velocity2D } from "./components/velocity-2d.component"; + +/** Whether two hitboxes overlap (touching edges don't). */ +export const overlap = (a: Position2D, aBox: HitboxRect2D, b: Position2D, bBox: HitboxRect2D) => + a.x < b.x + bBox.width && + a.x + aBox.width > b.x && + a.y < b.y + bBox.height && + a.y + aBox.height > b.y; + +/** + * Pushes `a` out of `b` on the axis it went in the least. On that axis, its velocity turns away + * from `b` when it `bounces`, and stops otherwise. + */ +export const pushOut = ( + a: Position2D, + aBox: HitboxRect2D, + velocity: Velocity2D, + b: Position2D, + bBox: HitboxRect2D, + bounces: boolean, +) => { + const left = a.x + aBox.width - b.x; + const right = b.x + bBox.width - a.x; + const up = a.y + aBox.height - b.y; + const down = b.y + bBox.height - a.y; + const axis = Math.min(left, right) < Math.min(up, down) ? "x" : "y"; + const back = axis === "x" ? left < right : up < down; + a[axis] += back ? -(axis === "x" ? left : up) : axis === "x" ? right : down; + velocity[axis] = bounces ? (back ? -1 : 1) * Math.abs(velocity[axis]) : 0; +}; diff --git a/demos/pong-3d/apps/server/src/components/acceleration-2d.component.ts b/demos/pong-3d/apps/server/src/components/acceleration-2d.component.ts new file mode 100644 index 0000000..5d4097f --- /dev/null +++ b/demos/pong-3d/apps/server/src/components/acceleration-2d.component.ts @@ -0,0 +1,18 @@ +/** + * How fast the velocity of an entity changes, in pixels per second, per second. Needs + * `Velocity2D` and the `move2D` system. + * + * @component + * @side shared + * @group Acceleration color=#f0a33a - Pixels per second, per second. + */ +export class Acceleration2D { + name = "Acceleration2D"; + + constructor( + /** Added to the horizontal velocity every second. @group Acceleration @preset vector.x */ + public x = 0, + /** Added to the vertical velocity every second. @group Acceleration @preset vector.y */ + public y = 0, + ) {} +} diff --git a/demos/pong-3d/apps/server/src/components/ball.component.ts b/demos/pong-3d/apps/server/src/components/ball.component.ts new file mode 100644 index 0000000..b39d38d --- /dev/null +++ b/demos/pong-3d/apps/server/src/components/ball.component.ts @@ -0,0 +1,10 @@ +/** + * A ball: it bounces off `Paddle` and `Wall` entities, and scores in `Goal` entities. Needs + * `Position2D`, `Velocity2D`, `HitboxRect2D` and the `bounceBall` system. + * + * @component + * @side shared + */ +export class Ball { + name = "Ball"; +} diff --git a/demos/pong-3d/apps/server/src/components/goal.component.ts b/demos/pong-3d/apps/server/src/components/goal.component.ts new file mode 100644 index 0000000..a9a834d --- /dev/null +++ b/demos/pong-3d/apps/server/src/components/goal.component.ts @@ -0,0 +1,18 @@ +/** + * A goal: a `Ball` that enters it gives a point to `player`, and is served again. Needs + * `Position2D`, `HitboxRect2D` and the `scoreGoals` system. + * + * @component + * @side shared + */ +export class Goal { + name = "Goal"; + + /** Points scored in this goal, added by `scoreGoals`. */ + points = 0; + + constructor( + /** The player who scores when the ball enters it. */ + public player = 1, + ) {} +} diff --git a/demos/pong-3d/apps/server/src/components/hitbox-rect-2d.component.ts b/demos/pong-3d/apps/server/src/components/hitbox-rect-2d.component.ts new file mode 100644 index 0000000..5c82bd3 --- /dev/null +++ b/demos/pong-3d/apps/server/src/components/hitbox-rect-2d.component.ts @@ -0,0 +1,22 @@ +/** + * Makes an entity collide as a rectangle whose top-left corner is its `Position2D`. + * + * @remarks + * The library's `HitboxRect2D` (`@nanoforge/physics-2d`) has the same parameters, plus the + * `collisions` that its `detectCollisions2D` system fills. Here `bounceBall`, `blockPaddles` and + * `scoreGoals` test the hitboxes they need themselves. + * + * @component + * @side shared + * @group Size color=#5ec26a - Size of the hitbox. + */ +export class HitboxRect2D { + name = "HitboxRect2D"; + + constructor( + /** In pixels. @group Size @preset size.width */ + public width = 50, + /** In pixels. @group Size @preset size.height */ + public height = 50, + ) {} +} diff --git a/demos/pong-3d/apps/server/src/components/network-id.component.ts b/demos/pong-3d/apps/server/src/components/network-id.component.ts new file mode 100644 index 0000000..084289d --- /dev/null +++ b/demos/pong-3d/apps/server/src/components/network-id.component.ts @@ -0,0 +1,20 @@ +/** + * The id of an entity on the network: the server and the clients know the entity by it, and the + * messages about the entity carry it. + * + * @component + * @side shared + */ +export class NetworkId { + name = "NetworkId"; + + /** The velocity last sent to the clients (by pong's `syncMoves`). NaN: to send again. */ + sentX = Number.NaN; + /** See `sentX`. */ + sentY = Number.NaN; + + constructor( + /** Same on the server and the clients. */ + public id = 0, + ) {} +} diff --git a/demos/pong-3d/apps/server/src/components/paddle.component.ts b/demos/pong-3d/apps/server/src/components/paddle.component.ts new file mode 100644 index 0000000..1141ab5 --- /dev/null +++ b/demos/pong-3d/apps/server/src/components/paddle.component.ts @@ -0,0 +1,32 @@ +/** + * A paddle: it sends a `Ball` back, at a wider angle the further from its middle the ball hits + * it. Walls stop it. Needs `Position2D` and `HitboxRect2D`, and the `bounceBall` and + * `blockPaddles` systems. + * + * @example + * The left paddle of a pong sends the ball to the right: `new Paddle(1, 0)`. A breakout paddle + * sends it up: `new Paddle(0, -1)`. + * + * @component + * @side shared + * @group Bounce color=#4aa3ff - How the ball leaves the paddle. + */ +export class Paddle { + name = "Paddle"; + + constructor( + /** Where the ball goes, hit in the middle: 1 to the right, -1 to the left. @group Bounce */ + public normalX = 0, + /** Where the ball goes, hit in the middle: 1 down, -1 up. @group Bounce */ + public normalY = -1, + /** Angle off that direction when hit at an end, in degrees. @group Bounce */ + public maxAngle = 60, + /** The ball's speed is multiplied by it at each hit: 1 keeps it. @group Bounce */ + public speedUp = 1, + /** + * The most `speedUp` takes the ball to, in pixels per second. A faster ball goes through + * walls in one frame on a slow machine. @group Bounce + */ + public maxSpeed = 1600, + ) {} +} diff --git a/demos/pong-3d/apps/server/src/components/position-2d.component.ts b/demos/pong-3d/apps/server/src/components/position-2d.component.ts new file mode 100644 index 0000000..0a35624 --- /dev/null +++ b/demos/pong-3d/apps/server/src/components/position-2d.component.ts @@ -0,0 +1,20 @@ +/** + * Where an entity is, in pixels from the top-left corner of the screen. + * + * @remarks + * For rectangles it is their top-left corner, for circles their center. + * + * @component + * @side shared + * @group Position color=#4aa3ff - Pixels from the top-left corner of the screen. + */ +export class Position2D { + name = "Position2D"; + + constructor( + /** Pixels from the left edge. @group Position @preset vector.x */ + public x = 0, + /** Pixels from the top edge. @group Position @preset vector.y */ + public y = 0, + ) {} +} diff --git a/demos/pong-3d/apps/server/src/components/seat.component.ts b/demos/pong-3d/apps/server/src/components/seat.component.ts new file mode 100644 index 0000000..8e5cc74 --- /dev/null +++ b/demos/pong-3d/apps/server/src/components/seat.component.ts @@ -0,0 +1,22 @@ +import type { ClientId } from "@nanoforge-dev/network/server"; + +/** + * A paddle a client can play: the first clients to join take the free seats. Needs `Velocity2D` + * and the `seatPlayers` and `steerPaddles` systems. + * + * @component + * @side server + */ +export class Seat { + name = "Seat"; + + /** The client playing this paddle, until it leaves. */ + client: ClientId | undefined = undefined; + + constructor( + /** The seat's number, sent to the client that takes it (1 left, 2 right). */ + public player = 1, + /** In pixels per second. */ + public speed = 1000, + ) {} +} diff --git a/demos/pong-3d/apps/server/src/components/serve.component.ts b/demos/pong-3d/apps/server/src/components/serve.component.ts new file mode 100644 index 0000000..8cb04c4 --- /dev/null +++ b/demos/pong-3d/apps/server/src/components/serve.component.ts @@ -0,0 +1,30 @@ +/** + * Serves a `Ball`: after `delay` seconds it leaves horizontally at `speed`, toward each side in + * turn. A goal puts it back at (`x`, `y`) and serves it again. Needs `Velocity2D` and the + * `serveBall` system. + * + * @component + * @side shared + * @group Serve color=#f0a33a - Where and how the ball is served. + */ +export class Serve { + name = "Serve"; + + /** Seconds left before the serve, 0 once served. */ + wait: number; + /** The side the next serve goes to: 1 right, -1 left. */ + side = 1; + + constructor( + /** Where a goal puts the ball back, from the left. @group Serve @preset vector.x */ + public x = 0, + /** Where a goal puts the ball back, from the top. @group Serve @preset vector.y */ + public y = 0, + /** In pixels per second. @group Serve */ + public speed = 600, + /** Seconds before each serve. @group Serve */ + public delay = 3, + ) { + this.wait = delay; + } +} diff --git a/demos/pong-3d/apps/server/src/components/velocity-2d.component.ts b/demos/pong-3d/apps/server/src/components/velocity-2d.component.ts new file mode 100644 index 0000000..3b93d4e --- /dev/null +++ b/demos/pong-3d/apps/server/src/components/velocity-2d.component.ts @@ -0,0 +1,20 @@ +/** + * How fast an entity moves, in pixels per second. Needs `Position2D` and the `move2D` system. + * + * @example + * `new Velocity2D(100, 0)` moves 100 pixels to the right every second. + * + * @component + * @side shared + * @group Velocity color=#36c5a0 - Pixels per second. + */ +export class Velocity2D { + name = "Velocity2D"; + + constructor( + /** Pixels per second to the right (negative: to the left). @group Velocity @preset vector.x */ + public x = 0, + /** Pixels per second downward (negative: upward). @group Velocity @preset vector.y */ + public y = 0, + ) {} +} diff --git a/demos/pong-3d/apps/server/src/components/wall.component.ts b/demos/pong-3d/apps/server/src/components/wall.component.ts new file mode 100644 index 0000000..3e54fda --- /dev/null +++ b/demos/pong-3d/apps/server/src/components/wall.component.ts @@ -0,0 +1,16 @@ +/** + * A wall: a `Ball` bounces off it, and a `Paddle` can't go through it. Needs `Position2D` and + * `HitboxRect2D`. + * + * @remarks + * `hits` counts the bounces, for a system that breaks bricks. + * + * @component + * @side shared + */ +export class Wall { + name = "Wall"; + + /** Bounces of a ball off this wall, added by `bounceBall`. Set it back to 0 once handled. */ + hits = 0; +} diff --git a/demos/pong-3d/apps/server/src/main.ts b/demos/pong-3d/apps/server/src/main.ts new file mode 100644 index 0000000..14a1f66 --- /dev/null +++ b/demos/pong-3d/apps/server/src/main.ts @@ -0,0 +1,92 @@ +import type { RunOptions } from "@nanoforge-dev/common"; +import { NanoforgeFactory } from "@nanoforge-dev/core"; +import { EcsLibrary } from "@nanoforge-dev/ecs/server"; +import { EditorLibrary } from "@nanoforge-dev/editor-lib"; +import { NetworkServerLibrary } from "@nanoforge-dev/network/server"; + +import { Ball } from "./components/ball.component"; +import { Goal } from "./components/goal.component"; +import { HitboxRect2D } from "./components/hitbox-rect-2d.component"; +import { NetworkId } from "./components/network-id.component"; +import { Paddle } from "./components/paddle.component"; +import { Position2D } from "./components/position-2d.component"; +import { Seat } from "./components/seat.component"; +import { Serve } from "./components/serve.component"; +import { Velocity2D } from "./components/velocity-2d.component"; +import { Wall } from "./components/wall.component"; +import { blockPaddles } from "./systems/block-paddles.system"; +import { bounceBall } from "./systems/bounce-ball.system"; +import { move2D } from "./systems/move-2d.system"; +import { scoreGoals } from "./systems/score-goals.system"; +import { seatPlayers } from "./systems/seat-players.system"; +import { serveBall } from "./systems/serve-ball.system"; +import { steerPaddles } from "./systems/steer-paddles.system"; +import { syncMoves } from "./systems/sync-moves.system"; + +export const main = async (options: RunOptions): Promise => { + const app = NanoforgeFactory.createServer({ tickRate: 60 }); + const ecs = new EcsLibrary(); + + app.use(ecs); + app.use(new NetworkServerLibrary()); + app.use(new EditorLibrary()); + + await app.init(options); + + const registry = ecs.registry; + + const topWall = registry.spawnEntity(); + registry.addComponent(topWall, new Position2D(0, -100)); + registry.addComponent(topWall, new HitboxRect2D(1920, 100)); + registry.addComponent(topWall, new Wall()); + + const bottomWall = registry.spawnEntity(); + registry.addComponent(bottomWall, new Position2D(0, 1080)); + registry.addComponent(bottomWall, new HitboxRect2D(1920, 100)); + registry.addComponent(bottomWall, new Wall()); + + const leftGoal = registry.spawnEntity(); + registry.addComponent(leftGoal, new Position2D(-100, 0)); + registry.addComponent(leftGoal, new HitboxRect2D(100, 1080)); + registry.addComponent(leftGoal, new Goal(2)); + + const rightGoal = registry.spawnEntity(); + registry.addComponent(rightGoal, new Position2D(1920, 0)); + registry.addComponent(rightGoal, new HitboxRect2D(100, 1080)); + registry.addComponent(rightGoal, new Goal(1)); + + const ball = registry.spawnEntity(); + registry.addComponent(ball, new Position2D(945, 525)); + registry.addComponent(ball, new Velocity2D(0, 0)); + registry.addComponent(ball, new HitboxRect2D(30, 30)); + registry.addComponent(ball, new Ball()); + registry.addComponent(ball, new Serve(945, 525, 1000, 3)); + registry.addComponent(ball, new NetworkId(0)); + + const leftPaddle = registry.spawnEntity(); + registry.addComponent(leftPaddle, new Position2D(20, 390)); + registry.addComponent(leftPaddle, new Velocity2D(0, 0)); + registry.addComponent(leftPaddle, new HitboxRect2D(30, 300)); + registry.addComponent(leftPaddle, new Paddle(1, 0, 67.5, 1.1)); + registry.addComponent(leftPaddle, new Seat(1, 1000)); + registry.addComponent(leftPaddle, new NetworkId(1)); + + const rightPaddle = registry.spawnEntity(); + registry.addComponent(rightPaddle, new Position2D(1870, 390)); + registry.addComponent(rightPaddle, new Velocity2D(0, 0)); + registry.addComponent(rightPaddle, new HitboxRect2D(30, 300)); + registry.addComponent(rightPaddle, new Paddle(-1, 0, 67.5, 1.1)); + registry.addComponent(rightPaddle, new Seat(2, 1000)); + registry.addComponent(rightPaddle, new NetworkId(2)); + + registry.addSystem(seatPlayers); + registry.addSystem(steerPaddles); + registry.addSystem(serveBall); + registry.addSystem(move2D); + registry.addSystem(blockPaddles); + registry.addSystem(bounceBall); + registry.addSystem(scoreGoals); + registry.addSystem(syncMoves); + + await app.run(); +}; diff --git a/demos/pong-3d/apps/server/src/pong-protocol.ts b/demos/pong-3d/apps/server/src/pong-protocol.ts new file mode 100644 index 0000000..c889517 --- /dev/null +++ b/demos/pong-3d/apps/server/src/pong-protocol.ts @@ -0,0 +1,21 @@ +import { definePacket } from "@nanoforge-dev/network"; + +type Vector = { x: number; y: number }; +type Key = "up" | "down" | "stop"; + +const KEYS: unknown[] = ["up", "down", "stop"] satisfies Key[]; + +/** Sent once by a client to join: the server answers with `Seated`. */ +export const Play = definePacket("play"); + +/** The paddle a client plays: 1 (left), 2 (right), or 0 when it watches. */ +export const Seated = definePacket<{ paddle: number }>("seated"); + +/** Where a client wants its paddle to go. Anything else than the three keys is dropped. */ +export const Input = definePacket<{ key: Key }>("input", { + validate: (data): data is { key: Key } => + typeof data === "object" && data !== null && KEYS.includes((data as { key?: unknown }).key), +}); + +/** The position and velocity of the entity of `NetworkId` `id`, sent when its velocity changes. */ +export const Move = definePacket<{ id: number; position: Vector; velocity: Vector }>("move"); diff --git a/demos/pong-3d/apps/server/src/systems/block-paddles.system.ts b/demos/pong-3d/apps/server/src/systems/block-paddles.system.ts new file mode 100644 index 0000000..434c715 --- /dev/null +++ b/demos/pong-3d/apps/server/src/systems/block-paddles.system.ts @@ -0,0 +1,28 @@ +import type { Registry } from "@nanoforge-dev/ecs"; + +import { overlap, pushOut } from "../collisions"; +import { HitboxRect2D } from "../components/hitbox-rect-2d.component"; +import { Paddle } from "../components/paddle.component"; +import { Position2D } from "../components/position-2d.component"; +import { Velocity2D } from "../components/velocity-2d.component"; +import { Wall } from "../components/wall.component"; + +/** + * Stops each `Paddle` at the `Wall` entities: pushed out of them, and stopped on that axis. Add it + * after `move2D`. + * + * @system + * @side shared + */ +export const blockPaddles = (registry: Registry) => { + const walls = registry.getZipper([Wall, Position2D, HitboxRect2D]); + + registry + .getZipper([Paddle, Position2D, Velocity2D, HitboxRect2D]) + .forEach(({ Position2D: paddle, Velocity2D: velocity, HitboxRect2D: box }) => { + for (const { Position2D, HitboxRect2D } of walls) { + if (overlap(paddle, box, Position2D, HitboxRect2D)) + pushOut(paddle, box, velocity, Position2D, HitboxRect2D, false); + } + }); +}; diff --git a/demos/pong-3d/apps/server/src/systems/bounce-ball.system.ts b/demos/pong-3d/apps/server/src/systems/bounce-ball.system.ts new file mode 100644 index 0000000..3dd79f5 --- /dev/null +++ b/demos/pong-3d/apps/server/src/systems/bounce-ball.system.ts @@ -0,0 +1,65 @@ +import type { Registry } from "@nanoforge-dev/ecs"; + +import { overlap, pushOut } from "../collisions"; +import { Ball } from "../components/ball.component"; +import { HitboxRect2D } from "../components/hitbox-rect-2d.component"; +import { Paddle } from "../components/paddle.component"; +import { Position2D } from "../components/position-2d.component"; +import { Velocity2D } from "../components/velocity-2d.component"; +import { Wall } from "../components/wall.component"; + +/** + * Bounces each `Ball` off the `Paddle` it moves into, or else off the first `Wall` it touches. + * Add it after `move2D`. + * + * @remarks + * Off a paddle, the ball leaves in the paddle's direction, turned toward the end it hit, up to + * the paddle's `maxAngle`, and `speedUp` times faster, up to its `maxSpeed` (a ball already + * faster keeps its speed). Off a wall, it goes back on the axis it went in the least, and the + * wall counts a hit. + * + * @system + * @side shared + */ +export const bounceBall = (registry: Registry) => { + const paddles = registry.getZipper([Paddle, Position2D, HitboxRect2D]); + const walls = registry.getZipper([Wall, Position2D, HitboxRect2D]); + + registry + .getZipper([Ball, Position2D, Velocity2D, HitboxRect2D]) + .forEach(({ Position2D: ball, Velocity2D: velocity, HitboxRect2D: box }) => { + const hit = paddles.find( + ({ Paddle: paddle, Position2D, HitboxRect2D }) => + velocity.x * paddle.normalX + velocity.y * paddle.normalY < 0 && + overlap(ball, box, Position2D, HitboxRect2D), + ); + if (hit) { + const { Paddle: paddle, Position2D: at, HitboxRect2D: size } = hit; + // Along the paddle: its normal turned a quarter clockwise. + const alongX = -paddle.normalY; + const alongY = paddle.normalX; + const length = Math.abs(alongX) * size.width + Math.abs(alongY) * size.height; + const offset = + (alongX * (ball.x + box.width / 2 - at.x - size.width / 2) + + alongY * (ball.y + box.height / 2 - at.y - size.height / 2)) / + (length / 2); + const angle = (Math.max(-1, Math.min(1, offset)) * paddle.maxAngle * Math.PI) / 180; + const before = Math.hypot(velocity.x, velocity.y); + const speed = Math.min(before * paddle.speedUp, Math.max(before, paddle.maxSpeed)); + velocity.x = speed * (paddle.normalX * Math.cos(angle) + alongX * Math.sin(angle)); + velocity.y = speed * (paddle.normalY * Math.cos(angle) + alongY * Math.sin(angle)); + if (paddle.normalX > 0) ball.x = at.x + size.width; + if (paddle.normalX < 0) ball.x = at.x - box.width; + if (paddle.normalY > 0) ball.y = at.y + size.height; + if (paddle.normalY < 0) ball.y = at.y - box.height; + return; + } + + const wall = walls.find(({ Position2D, HitboxRect2D }) => + overlap(ball, box, Position2D, HitboxRect2D), + ); + if (!wall) return; + pushOut(ball, box, velocity, wall.Position2D, wall.HitboxRect2D, true); + wall.Wall.hits++; + }); +}; diff --git a/demos/pong-3d/apps/server/src/systems/move-2d.system.ts b/demos/pong-3d/apps/server/src/systems/move-2d.system.ts new file mode 100644 index 0000000..514766a --- /dev/null +++ b/demos/pong-3d/apps/server/src/systems/move-2d.system.ts @@ -0,0 +1,26 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; + +import { Acceleration2D } from "../components/acceleration-2d.component"; +import { Position2D } from "../components/position-2d.component"; +import { Velocity2D } from "../components/velocity-2d.component"; + +/** + * Moves entities: their `Acceleration2D` changes their `Velocity2D`, then their `Velocity2D` + * changes their `Position2D`, by the time elapsed since the last frame. + * + * @system + * @side shared + */ +export const move2D = (registry: Registry, ctx: Context) => { + const seconds = ctx.app.delta / 1000; + + registry.getZipper([Acceleration2D, Velocity2D]).forEach(({ Acceleration2D, Velocity2D }) => { + Velocity2D.x += Acceleration2D.x * seconds; + Velocity2D.y += Acceleration2D.y * seconds; + }); + registry.getZipper([Position2D, Velocity2D]).forEach(({ Position2D, Velocity2D }) => { + Position2D.x += Velocity2D.x * seconds; + Position2D.y += Velocity2D.y * seconds; + }); +}; diff --git a/demos/pong-3d/apps/server/src/systems/score-goals.system.ts b/demos/pong-3d/apps/server/src/systems/score-goals.system.ts new file mode 100644 index 0000000..b53a7cd --- /dev/null +++ b/demos/pong-3d/apps/server/src/systems/score-goals.system.ts @@ -0,0 +1,78 @@ +import type { Registry } from "@nanoforge-dev/ecs"; + +import { overlap } from "../collisions"; +import { Ball } from "../components/ball.component"; +import { Goal } from "../components/goal.component"; +import { HitboxRect2D } from "../components/hitbox-rect-2d.component"; +import { Position2D } from "../components/position-2d.component"; +import { Serve } from "../components/serve.component"; +import { Velocity2D } from "../components/velocity-2d.component"; +import { Wall } from "../components/wall.component"; + +type Box = { Position2D: Position2D; HitboxRect2D: HitboxRect2D }; + +/** The goal nearest to (`x`, `y`) among those that span it on one axis, if any. */ +const goalAcross = (goals: T[], x: number, y: number): T | undefined => { + let nearest: T | undefined; + let best = Infinity; + for (const goal of goals) { + const { Position2D: at, HitboxRect2D: size } = goal; + const across = (x >= at.x && x <= at.x + size.width) || (y >= at.y && y <= at.y + size.height); + const distance = Math.hypot(at.x + size.width / 2 - x, at.y + size.height / 2 - y); + if (across && distance < best) { + best = distance; + nearest = goal; + } + } + return nearest; +}; + +/** + * Gives a point to a `Goal`'s player when a `Ball` enters it, and puts the ball back where its + * `Serve` says, to be served again. Add it after `move2D`. + * + * @remarks + * A ball whose center left the field (the box around every `Wall` and `Goal`) is served again + * too: a long frame (a hidden tab) can move it past a goal or a wall without touching it. It + * scores in the nearest goal it is in line with, past its goal line; through a wall, nobody + * scores. + * + * @system + * @side shared + */ +export const scoreGoals = (registry: Registry) => { + const goals = registry.getZipper([Goal, Position2D, HitboxRect2D]); + const walls = registry.getZipper([Wall, Position2D, HitboxRect2D]); + + let left = Infinity; + let top = Infinity; + let right = -Infinity; + let bottom = -Infinity; + const grow = ({ Position2D: at, HitboxRect2D: size }: Box) => { + left = Math.min(left, at.x); + top = Math.min(top, at.y); + right = Math.max(right, at.x + size.width); + bottom = Math.max(bottom, at.y + size.height); + }; + goals.forEach(grow); + walls.forEach(grow); + + registry + .getZipper([Ball, Serve, Position2D, Velocity2D, HitboxRect2D]) + .forEach(({ Serve: serve, Position2D: ball, Velocity2D: velocity, HitboxRect2D: box }) => { + const x = ball.x + box.width / 2; + const y = ball.y + box.height / 2; + const out = left <= right && (x < left || x > right || y < top || y > bottom); + const goal = + goals.find(({ Position2D, HitboxRect2D }) => + overlap(ball, box, Position2D, HitboxRect2D), + ) ?? (out ? goalAcross(goals, x, y) : undefined); + if (!goal && !out) return; + if (goal) goal.Goal.points++; + ball.x = serve.x; + ball.y = serve.y; + velocity.x = 0; + velocity.y = 0; + serve.wait = serve.delay; + }); +}; diff --git a/demos/pong-3d/apps/server/src/systems/seat-players.system.ts b/demos/pong-3d/apps/server/src/systems/seat-players.system.ts new file mode 100644 index 0000000..20eee85 --- /dev/null +++ b/demos/pong-3d/apps/server/src/systems/seat-players.system.ts @@ -0,0 +1,34 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; + +import { NetworkId } from "../components/network-id.component"; +import { Seat } from "../components/seat.component"; +import { Velocity2D } from "../components/velocity-2d.component"; +import { Play, Seated } from "../pong-protocol"; + +/** + * Seats each client that sends `Play` on a free `Seat`, or as a watcher, tells it with `Seated`, + * and has the whole game sent again. A seat whose client left is freed, and its paddle stops. + * + * @system + * @side server + */ +export const seatPlayers = (registry: Registry, ctx: Context) => { + const seats = registry.getZipper([Seat, Velocity2D]); + + for (const { Seat: seat, Velocity2D: velocity } of seats) { + if (seat.client === undefined || ctx.network.getClientInfo(seat.client)) continue; + seat.client = undefined; + velocity.y = 0; + } + + for (const { clientId } of ctx.network.packets.read(Play)) { + if (seats.some(({ Seat }) => Seat.client === clientId)) continue; + const free = seats.find(({ Seat }) => Seat.client === undefined); + if (free) free.Seat.client = clientId; + ctx.network.packets.sendToClient(clientId, Seated, { paddle: free?.Seat.player ?? 0 }); + registry.getZipper([NetworkId]).forEach(({ NetworkId }) => { + NetworkId.sentX = Number.NaN; + }); + } +}; diff --git a/demos/pong-3d/apps/server/src/systems/serve-ball.system.ts b/demos/pong-3d/apps/server/src/systems/serve-ball.system.ts new file mode 100644 index 0000000..e0aa1ab --- /dev/null +++ b/demos/pong-3d/apps/server/src/systems/serve-ball.system.ts @@ -0,0 +1,24 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; + +import { Serve } from "../components/serve.component"; +import { Velocity2D } from "../components/velocity-2d.component"; + +/** + * Serves each `Serve` entity once its wait is over: horizontally, at its speed, toward each side + * in turn. + * + * @system + * @side shared + */ +export const serveBall = (registry: Registry, ctx: Context) => { + registry.getZipper([Serve, Velocity2D]).forEach(({ Serve: serve, Velocity2D: velocity }) => { + if (serve.wait <= 0) return; + serve.wait -= ctx.app.delta / 1000; + if (serve.wait > 0) return; + serve.wait = 0; + velocity.x = serve.side * serve.speed; + velocity.y = 0; + serve.side = -serve.side; + }); +}; diff --git a/demos/pong-3d/apps/server/src/systems/steer-paddles.system.ts b/demos/pong-3d/apps/server/src/systems/steer-paddles.system.ts new file mode 100644 index 0000000..993b2cb --- /dev/null +++ b/demos/pong-3d/apps/server/src/systems/steer-paddles.system.ts @@ -0,0 +1,24 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; + +import { Seat } from "../components/seat.component"; +import { Velocity2D } from "../components/velocity-2d.component"; +import { Input } from "../pong-protocol"; + +const DIRECTIONS = { up: -1, down: 1, stop: 0 }; + +/** + * Moves each `Seat`'s paddle as its client's `Input` says. Inputs of clients without a seat are + * ignored. + * + * @system + * @side server + */ +export const steerPaddles = (registry: Registry, ctx: Context) => { + const seats = registry.getZipper([Seat, Velocity2D]); + + for (const { clientId, data } of ctx.network.packets.read(Input)) { + const seat = seats.find(({ Seat }) => Seat.client === clientId); + if (seat) seat.Velocity2D.y = DIRECTIONS[data.key] * seat.Seat.speed; + } +}; diff --git a/demos/pong-3d/apps/server/src/systems/sync-moves.system.ts b/demos/pong-3d/apps/server/src/systems/sync-moves.system.ts new file mode 100644 index 0000000..7170009 --- /dev/null +++ b/demos/pong-3d/apps/server/src/systems/sync-moves.system.ts @@ -0,0 +1,29 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; + +import { NetworkId } from "../components/network-id.component"; +import { Position2D } from "../components/position-2d.component"; +import { Velocity2D } from "../components/velocity-2d.component"; +import { Move } from "../pong-protocol"; + +/** + * Sends a `Move` to every client for each `NetworkId` entity whose velocity changed: the clients + * move it the same way until the next one. Add it last. + * + * @system + * @side server + */ +export const syncMoves = (registry: Registry, ctx: Context) => { + registry + .getZipper([NetworkId, Position2D, Velocity2D]) + .forEach(({ NetworkId: sync, Position2D: position, Velocity2D: velocity }) => { + if (velocity.x === sync.sentX && velocity.y === sync.sentY) return; + ctx.network.packets.sendToAll(Move, { + id: sync.id, + position: { x: position.x, y: position.y }, + velocity: { x: velocity.x, y: velocity.y }, + }); + sync.sentX = velocity.x; + sync.sentY = velocity.y; + }); +}; diff --git a/demos/pong-3d/apps/server/tsconfig.json b/demos/pong-3d/apps/server/tsconfig.json new file mode 100644 index 0000000..c0ae4f2 --- /dev/null +++ b/demos/pong-3d/apps/server/tsconfig.json @@ -0,0 +1,39 @@ +{ + "$schema": "https://json.schemastore.org/tsconfig.json", + // Mapped from https://www.typescriptlang.org/tsconfig + "compilerOptions": { + // Type Checking + "allowUnreachableCode": false, + "allowUnusedLabels": false, + "noFallthroughCasesInSwitch": true, + "noImplicitOverride": true, + "noImplicitReturns": true, + "noPropertyAccessFromIndexSignature": false, + "noUncheckedIndexedAccess": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "strict": true, + + // Modules + "allowArbitraryExtensions": false, + "allowImportingTsExtensions": false, + "module": "ESNext", + "moduleResolution": "Bundler", + "resolveJsonModule": true, + "resolvePackageJsonExports": true, + "resolvePackageJsonImports": true, + + // Interop Constraints + "allowSyntheticDefaultImports": true, + "forceConsistentCasingInFileNames": true, + "isolatedModules": true, + + // Language and Environment + "experimentalDecorators": true, + "lib": ["ESNext", "esnext.disposable", "DOM"], + "target": "ESNext", + "useDefineForClassFields": true + }, + "include": ["src"], + "exclude": ["node_modules", ".nanoforge", "dist"] +} diff --git a/demos/pong-3d/nanoforge.config.ts b/demos/pong-3d/nanoforge.config.ts new file mode 100644 index 0000000..af48def --- /dev/null +++ b/demos/pong-3d/nanoforge.config.ts @@ -0,0 +1,7 @@ +import { defineConfig } from "@nanoforge-dev/config"; + +export default defineConfig({ + type: "workspace", + packages: ["apps/*"], + network: "p2p", +}); diff --git a/demos/pong-3d/package.json b/demos/pong-3d/package.json new file mode 100644 index 0000000..d4400b5 --- /dev/null +++ b/demos/pong-3d/package.json @@ -0,0 +1,18 @@ +{ + "$schema": "https://json.schemastore.org/package.json", + "name": "pong-3d", + "description": "Pong in 3D for two players: one hosts the game in their browser, the other joins", + "private": true, + "type": "module", + "scripts": { + "dev": "nf dev", + "build": "nf build", + "start": "nf start", + "editor": "nf editor ." + }, + "devDependencies": { + "@nanoforge-dev/cli": "^3.0.1", + "@nanoforge-dev/config": "^3.0.1", + "typescript": "^6.0.0" + } +} diff --git a/demos/pong-3d/pnpm-lock.yaml b/demos/pong-3d/pnpm-lock.yaml new file mode 100644 index 0000000..e57001a --- /dev/null +++ b/demos/pong-3d/pnpm-lock.yaml @@ -0,0 +1,1700 @@ +lockfileVersion: '9.0' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + +importers: + + .: + devDependencies: + '@nanoforge-dev/cli': + specifier: ^3.0.1 + version: 3.0.1 + '@nanoforge-dev/config': + specifier: ^3.0.1 + version: 3.0.1 + typescript: + specifier: ^6.0.0 + version: 6.0.3 + + apps/client: + devDependencies: + '@nanoforge-dev/asset': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/common': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/core': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/ecs': + specifier: ^3.0.0 + version: 3.0.0(@nanoforge-dev/editor-lib@3.0.0) + '@nanoforge-dev/editor-lib': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/env': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/graphics-3d': + specifier: ^3.0.0 + version: 3.0.0(@nanoforge-dev/editor-lib@3.0.0)(three@0.187.0) + '@nanoforge-dev/input': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/network': + specifier: ^3.0.0 + version: 3.0.0(@nanoforge-dev/editor-lib@3.0.0) + typescript: + specifier: ^6.0.0 + version: 6.0.3 + + apps/server: + devDependencies: + '@nanoforge-dev/asset': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/common': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/core': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/ecs': + specifier: ^3.0.0 + version: 3.0.0(@nanoforge-dev/editor-lib@3.0.0) + '@nanoforge-dev/editor-lib': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/env': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/network': + specifier: ^3.0.0 + version: 3.0.0(@nanoforge-dev/editor-lib@3.0.0) + typescript: + specifier: ^6.0.0 + version: 6.0.3 + +packages: + + '@angular-devkit/core@22.2.7': + resolution: {integrity: sha512-cchZAMsV4d76RDZBlWzPhYxM/Hb6bmq71oUngdrwehMbBbdQu3W9C2tGlvxuPxbRKru9ZlUa14YVXQ0+QnhFtw==} + engines: {node: ^22.22.3 || ^24.15.0 || >=26.0.0, npm: ^6.11.0 || ^7.5.6 || >=8.0.0, yarn: '>= 1.13.0'} + peerDependencies: + chokidar: ^5.0.0 + peerDependenciesMeta: + chokidar: + optional: true + + '@angular-devkit/schematics-cli@22.2.7': + resolution: {integrity: sha512-9Od0E8TiYTQWm/03QjYWnsryZA8ZSjTf/k5z61nPd/jgloVNvSW8kxC7/YMw+RoXh2idMzjiJxraKxg+gJxzPw==} + engines: {node: ^22.22.3 || ^24.15.0 || >=26.0.0, npm: ^6.11.0 || ^7.5.6 || >=8.0.0, yarn: '>= 1.13.0'} + hasBin: true + + '@angular-devkit/schematics@22.2.7': + resolution: {integrity: sha512-a1h7xNqBLQVo1e5eCyOU3axSbA9AFU6nnSH5QhlNhggfMeZde+eBrueSt25xsewoxlKO8EvkVT3+knMUkDYiGQ==} + engines: {node: ^22.22.3 || ^24.15.0 || >=26.0.0, npm: ^6.11.0 || ^7.5.6 || >=8.0.0, yarn: '>= 1.13.0'} + + '@dimforge/rapier3d-compat@0.12.0': + resolution: {integrity: sha512-uekIGetywIgopfD97oDL5PfeezkFpNhwlzlaEYNOA0N6ghdsOvh/HYjSMek5Q2O1PYvRSDFcqFVJl4r4ZBwOow==} + + '@emnapi/core@2.0.0-beta.2': + resolution: {integrity: sha512-MzCVoWtcg4Pm2B3je5mMvYMvj3MmBKw+fU7vbsJc9/iT8ip6/eYIHo/Dsm/mr+wsHB6SEyJDuxB09Yy6r/8+4A==} + + '@emnapi/runtime@2.0.0-beta.2': + resolution: {integrity: sha512-JcrSPzPvZuNZvJqPTF9Fw25LbOJ8avzFVlaf2grmH4Cku0oGP47tRgqPZadcfj3YoZMHkFVnCYFbQM8I+i5QEw==} + + '@emnapi/wasi-threads@2.2.0': + resolution: {integrity: sha512-JP7OYH38Q7+pyTAe14raZHLQIK7BDKbdwji+Xi3pcd/6QkJYQH3SX4wu6EplGrGJWRepoNzedfm0G3B9Z4e9Rw==} + + '@inquirer/ansi@2.1.0': + resolution: {integrity: sha512-63GU5AD9KhNbWM0jlhHoMJTEFck2upFOPxHlnCKf3xYTV3rjTUUQfodihmTnfYQzMLS29oy8lK/gA1eJgu4bhA==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + + '@inquirer/checkbox@5.3.0': + resolution: {integrity: sha512-3QQSO87A+JoRtOtjtsgX2enwTL+3+VBVrkUpdqrIxMOgn5+W5sE57PcCPAiNUIESHxV4Q6mNEGxq2xLmRa0/yw==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/confirm@6.4.0': + resolution: {integrity: sha512-+DCZxrOF01Q/1SzTQkgycAQPS/Jf+Yol0h1P/MVmopukTsxGOu1h/LKqf30y0eHKFZYYrgUMVhGDhEbPmSPi9A==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/core@12.1.0': + resolution: {integrity: sha512-6H7usRWw4Gdjgpaem10CA5MfZ/xoYPGyInriR1Xubqjv+SVo8LIJ1erpFxW5JgCza6VZVZiKLTko7RtUU3AQMg==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/editor@5.4.0': + resolution: {integrity: sha512-L7vdCe4jnMpzhDisu1tAnr4WGvfPOVz+vNFXyIIL7O2Ycn/n90sn1ARvg+4cwzLf+us51BE/cX7uhnrLcal3+g==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/expand@5.2.0': + resolution: {integrity: sha512-AOp2KQk7QojUyWOP7VkqdBWmxLRaVH58wQMx3N4//P530EDtpVp1EWIjAJubx9ZohWS/UCEpIkA1TuiNki0iOA==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/external-editor@3.1.0': + resolution: {integrity: sha512-27JAkF38nXqXaoveU28iA/+Z8nutnF8B3JsbdToPHn9WnkrsMtZ0/YoJ29YwbtFexYIo+tIy6ikMvTdHKjjmGA==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/figures@2.1.0': + resolution: {integrity: sha512-CR9u2PME23jxy2SOyTb117efwAAPm98Zr+LoWI+PiQ55D6U8Yeu/HyFTxwytKhPa6oxAGzdsm2Kg7oLS6B9z8w==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + + '@inquirer/input@5.2.0': + resolution: {integrity: sha512-sIUPnN2X7M+7dq3RUd+e9QRacYnM+6B+kSucwQgj5VC5Eo/f+CIr2NyPBumxsViI+wzfokkgop/3x3KfHxNyJw==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/number@4.3.0': + resolution: {integrity: sha512-xYkX4sPVgox0F7yQwpz/MByWjOGdLEf1pdjH+Lji2gAzSs2xezz5bN5YgS1n0tx9wo0mRhGvq1KJGtvDZ9XXcQ==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/password@5.3.0': + resolution: {integrity: sha512-KVqW4G/UbMK06uBN76xF89JKYC9YBWU7v+Kc2tUwMCO8pg3ASBr0HVabl1KaSqF94O2KiRu8aKx4EicN78PK+A==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/prompts@8.7.2': + resolution: {integrity: sha512-QoRB4wFIjgH5iOhSjoIKMkTvSHDuV+O3OITlIqAYO0oK5x364GJILXiMBvlPiE+klg7Xx9tq5XVqQHcGUDYYPA==} + engines: {node: '>=23.5.0 || ^22.13.0 || ^20.17.0'} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/prompts@8.8.0': + resolution: {integrity: sha512-yYVT2Eo3mafb9tnU2Mr3+wh5wLCWyspExqVoPSMCIfBIn3ZUTE4IDfbCMbMgXaOH0tH+JZEhOtfczQhDzOjIGg==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/rawlist@5.4.0': + resolution: {integrity: sha512-x42wcy465GM5/mHNKBFdAJbLlLyzmYqr/DEa6F49nHpI+03EFwRCRKeLGQakx5XqZ4unc2yFuS78qAD4Rb0iFA==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/search@4.4.0': + resolution: {integrity: sha512-UJ+9tkzPT1AjnvjuPFYcOdO3BVeN28bfSXajYRFZTRgA9OiNl4k2Nn2cHHPwiIDyPHlvOnmE9ZOHyXhPHtvb+A==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/select@5.3.0': + resolution: {integrity: sha512-Fmgfl0qjqCQo+/tjQpgnRXKh5N7/VpYcJh+AlYU2eHmHZLMGUBDzo+Gwc2ODzWJfXNRZmgaMhz4qULcO/C/rXg==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/type@4.3.0': + resolution: {integrity: sha512-/IA8q2nyjgyl0NGSjqiRXB8gh3We7Pzx9C0c+6Zoolu905jFc79anerrUG7+n65+qs310DRK43yi2WDI8nY59A==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@isaacs/fs-minipass@4.0.1': + resolution: {integrity: sha512-wgm9Ehl2jpeqP3zw/7mo3kRHFp5MEDhqAdwy1fTGkHAwnkGOVsgpvQhL8B5n1qlb01jV3n/bI0ZfZp5lWA1k4w==} + engines: {node: '>=18.0.0'} + + '@jridgewell/sourcemap-codec@1.6.0': + resolution: {integrity: sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw==} + + '@nanoforge-dev/asset@3.0.0': + resolution: {integrity: sha512-jqXcyCMbdcCCj7wZ/dyIpjY8hza02Pt/vY8KrNcaXTlxpTc9EE+VKuO5+fHdUXWWPgJSFt96TqAPhug+z+KH3Q==} + engines: {node: '26'} + + '@nanoforge-dev/cli@3.0.1': + resolution: {integrity: sha512-ZfrbETcAcX3vsPLO1WLSCJc2ERCAcIpbdi9Df5bmH3XLinQkDAcESkN9JkaI/vgV08A7xhTjV8zSDSwF0T73Xg==} + engines: {node: '26'} + hasBin: true + + '@nanoforge-dev/common@3.0.0': + resolution: {integrity: sha512-lzMvQ1vCElh9OcP4EqhffbY+AQXOH4IiuD1pj7VvJlpcY6hh7Bs/s4NVS0gXoJ+ibpBMe5mAq23RyzqTwk8czg==} + engines: {node: '26'} + + '@nanoforge-dev/config@3.0.1': + resolution: {integrity: sha512-XWRScOotb8IirerRx/mWLmUVYye3lo0PN/5a0MUp/eoSrhz0S6zzhGHEupRuC8aeHTjsQT7ctM3P6YyKSHZLaQ==} + engines: {node: '26'} + + '@nanoforge-dev/core@3.0.0': + resolution: {integrity: sha512-pa7Fr3TFkZVfAADBC17Qt5ru/W9vXtYB8e5eb7wurAtu8/jH/ZtqfW3kafTuWC9513MXp/h6LOCdZQhjnCt6UA==} + engines: {node: '26'} + + '@nanoforge-dev/ecs@3.0.0': + resolution: {integrity: sha512-csrXJtCzqohxtvEQs+O//xabnaLR3BXe0QpSpl7NVihF3f0iX2fNYURxNjQKxzoPYBokCnnyNxN2KFc7UmIsdA==} + engines: {node: '26'} + peerDependencies: + '@nanoforge-dev/editor-lib': 3.0.0 + '@nanoforge-dev/scene': 3.0.0 + peerDependenciesMeta: + '@nanoforge-dev/editor-lib': + optional: true + '@nanoforge-dev/scene': + optional: true + + '@nanoforge-dev/editor-lib@3.0.0': + resolution: {integrity: sha512-fSWm6bHelbxqeVESYoUUKDi9RGNxvRu6p1r41KE1DddM0RrP0/WzkFOWBvgl+psHbYNotXe723Y2Fd3p+tqPDQ==} + engines: {node: '26'} + + '@nanoforge-dev/editor@0.1.4': + resolution: {integrity: sha512-bqbrH8ulFSiZz1iisJHtHeEzj1RV/70uErCYHeW4DIhVPsWbBfWKFvg/ghAbmPk5vsj0YnhDX6DSpik4S1QoiQ==} + engines: {node: '25'} + + '@nanoforge-dev/env@3.0.0': + resolution: {integrity: sha512-kXYXl9/09Bn8VStTTFuZY3dYDG9b76VhOi9PHMnaLe75XcFRLKJ2dYkXf3ut6RCL2+6H7HAEIOALjR15CHnJ5A==} + engines: {node: '26'} + + '@nanoforge-dev/graphics-3d@3.0.0': + resolution: {integrity: sha512-yRY2ktlzgHQS0fdrdj+k5FjrBMGPQ3vFnw+Ag3vMv2mRRrFCwFBDzofpf1tSzluOyyTpJkgD2tmRpQZqC5CsLg==} + engines: {node: '26'} + peerDependencies: + '@nanoforge-dev/editor-lib': 3.0.0 + three: ^0.187.0 + peerDependenciesMeta: + '@nanoforge-dev/editor-lib': + optional: true + + '@nanoforge-dev/input@3.0.0': + resolution: {integrity: sha512-8pWU28c99VAvn37onNbVFfwXTgyQGxm5DVnTdBEzgrF3KPCzU77kEaexB1AWOlga+4qNGU7/XNm3hNZ+YS49Ig==} + engines: {node: '26'} + + '@nanoforge-dev/loader-client@1.7.0': + resolution: {integrity: sha512-zDj0yQ8cZyHHjAYDVIyB79mh4dK7WRgZG7Kc+d/43t2WX/pX2HqBVkpLcDPkA9cNOKpCRYWd3LyYISlz53gzyg==} + engines: {node: '26'} + + '@nanoforge-dev/loader-server@1.7.0': + resolution: {integrity: sha512-Yd/BYORhoar5znNSD7kGirAc1Al0q5t8iscbb07QWKeXWA+DLKjPSuKJC6ykysFkbs9HiZU59oOfxyvNL4h3Pw==} + engines: {node: '26'} + + '@nanoforge-dev/loader-website@1.7.0': + resolution: {integrity: sha512-x1fV3RYUUxru39sF5HJcfutNnifMMTIEHW92jgkR9gz06ZlZ+rQofuegXgAnEzs0dEXa+rhNQ/iXYbqOZvq6YQ==} + engines: {node: '26'} + + '@nanoforge-dev/network@3.0.0': + resolution: {integrity: sha512-T0+s6vmiBuY3/KPK8s4wYcqQju6YDpoIJgpJy6eTelUD2+cHkWjav4WjfXxfVsE89JVu7ariXoRD+VuozhjUpA==} + engines: {node: '26'} + peerDependencies: + '@nanoforge-dev/editor-lib': 3.0.0 + peerDependenciesMeta: + '@nanoforge-dev/editor-lib': + optional: true + + '@nanoforge-dev/registry@3.0.1': + resolution: {integrity: sha512-EzSaszYtrPldD5Do7jdQK3TLLb8uCirY6NQjKXkeGw31X+sUXor4h5GAaoxELWMzPnv9BbKtggSaVaQIt7s8IQ==} + engines: {node: '26'} + + '@nanoforge-dev/schematics@3.0.1': + resolution: {integrity: sha512-iK2vC0gPEh2mQ81IB4+jfGw/ZNOLMDnS9HRBXH5tWB0mdN5GA32viblhW0oYPX2/tWrLC9YiCPgEE4AL8Zwz6w==} + engines: {node: '26'} + + '@napi-rs/wasm-runtime@1.2.6': + resolution: {integrity: sha512-mRyDmEw9/fCDXCGfL1sbgIw/GUK0PVxRW4YwgPN61F3LQ+fSyoBFarJVzgGyhF6kRzEQZ0FejDqm4WLXSeqQmw==} + engines: {node: ^20.19.0 || ^22.13.0 || >=23.5.0} + peerDependencies: + '@emnapi/core': ^1.7.1 || 2.0.0-beta.2 + '@emnapi/runtime': ^1.7.1 || 2.0.0-beta.2 + + '@node-datachannel/android-arm64@0.33.6': + resolution: {integrity: sha512-UzSnd1vSN//3pqyvuufbaIQemvRfIHn/7DAy7wjoYk9tzkJp4SMk1FrNhkhmev89SH/h7yTac6PlGxGe5oHcKw==} + cpu: [arm64] + os: [android] + + '@node-datachannel/darwin-arm64@0.33.6': + resolution: {integrity: sha512-vE2fN6D0BJJ3yZo5guJo2j1q7JeQbl+VyIs6vbkjEp654tQtTo3y7a4l3xB0bwDD27TOlkOlaSLJQRj6ZXqQdQ==} + cpu: [arm64] + os: [darwin] + + '@node-datachannel/darwin-x64@0.33.6': + resolution: {integrity: sha512-EtRB2THMR11XMzbNhMEwaZtipaUxFz+PgeVx7hE+er6Ai1Fzzv7XexrMWDG11ahdpEZ8fAxlxuyELs33/WH1Cg==} + cpu: [x64] + os: [darwin] + + '@node-datachannel/linux-arm64-gnu@0.33.6': + resolution: {integrity: sha512-phMRjx8NEfW70i768LCQDEF2C6Q2vtYsS4DPXv/zbb2cJClaU5fjKFQfQ1XBCNIi1ClfpSd3Cl/rn/7SS+paTQ==} + cpu: [arm64] + os: [linux] + libc: [glibc] + + '@node-datachannel/linux-arm64-musl@0.33.6': + resolution: {integrity: sha512-T9bqllJ9YkpgqgRFEfsPpfgfMDXdA7CIiJ4c1XXGPLSeqVFgDbf/WCewkE7q4xA+tKRLoOOtc2XgMGwVnlxXVQ==} + cpu: [arm64] + os: [linux] + libc: [musl] + + '@node-datachannel/linux-x64-gnu@0.33.6': + resolution: {integrity: sha512-NUTbne64++ZxwEJ9uppAAmYnFAfJAggf7gboioPdhr13P17GTQRCUgmipYrh1V0D4333x6NCBZyQaNv0n4WmpQ==} + cpu: [x64] + os: [linux] + libc: [glibc] + + '@node-datachannel/linux-x64-musl@0.33.6': + resolution: {integrity: sha512-dlWP4ycOJrTAl9UvxGofq0zwPhl6iAr1b0ZcBUgDfb2CXmbcJWCvg6OsJ6u8BVSV41eNXALmaRpU0wttas/f1g==} + cpu: [x64] + os: [linux] + libc: [musl] + + '@node-datachannel/win32-arm64-msvc@0.33.6': + resolution: {integrity: sha512-ttly7XRUrSOcOOGJvtm9gh2beAPUNOBOUc3Hk82LfMHHP7jJMkXNDns/ML+UVGommAcNyPhoZkRH62O7tSVQYw==} + cpu: [arm64] + os: [win32] + + '@node-datachannel/win32-x64-msvc@0.33.6': + resolution: {integrity: sha512-N5GW6XH11Iuu+kyHLTiCMcCHdwWwpKqvtYril0LzQm6xBgmGQN3JXxFmgi4g4usw1nLy6WhBWADjbhSXJiiEMA==} + cpu: [x64] + os: [win32] + + '@oven/bun-darwin-aarch64@1.4.4': + resolution: {integrity: sha512-zW/hxwc8sJAILGwB5eTC4i48ouGXf0V4lrxmEOk3JIE6JkYVW1TZh1E2pIempqsezgW1sckTIIDudFON8bJ2Mw==} + cpu: [arm64] + os: [darwin] + + '@oven/bun-darwin-x64@1.4.4': + resolution: {integrity: sha512-oKGcxLsvh4oHjAo28nPm8c/xN0o/OmGyj1IHYc94vprkWsW2hNg2keEZt5f40cI5Hvu4jDlSRTR0UNpv1UIAxw==} + cpu: [x64] + os: [darwin] + + '@oven/bun-freebsd-aarch64@1.4.4': + resolution: {integrity: sha512-klvA9FlwLxZj3JYIOPQA4bbnHIC3uas8kBE4GaGGkeVgAQP/k8hAzYkOqkSaqHBDbxLrTyFEQArEAevJq6NJzg==} + cpu: [arm64] + os: [freebsd] + + '@oven/bun-freebsd-x64@1.4.4': + resolution: {integrity: sha512-sF1xS/scbyN94P2d0eTiarO6JHxrIvhZNT9hnWjQXW5nwKRtfuP+UYnIMNyvW1BQPcZFP/cvfLBNUIe1ea4zPA==} + cpu: [x64] + os: [freebsd] + + '@oven/bun-linux-aarch64-android@1.4.4': + resolution: {integrity: sha512-5lvn3at5vRC0GxvmiqEiV2/e23tnRi0q5pzR40yfDvDA3OW7PSkt4chF1nA9vnAJhro4/l+ol1FmNP6D3cf/oA==} + cpu: [arm64] + os: [android] + + '@oven/bun-linux-aarch64-musl@1.4.4': + resolution: {integrity: sha512-QFd0P+mHJxbZFbUla4MgiE5OwxysHaUIYxL2pPNkpWtaI7v4ShOpr8OhBmsuyB0xn5rv/ZJnPsj2y8+bB9+g/A==} + cpu: [arm64] + os: [linux] + libc: [musl] + + '@oven/bun-linux-aarch64@1.4.4': + resolution: {integrity: sha512-ZTVtpf9zmHSBVPX1sBwe5agGb/rN34yPGg/Hby8e2Ax2uCUA2URZKlZH7qLntK7qaFJCMXh9v0GWNYN2zINz1w==} + cpu: [arm64] + os: [linux] + libc: [glibc] + + '@oven/bun-linux-x64-android@1.4.4': + resolution: {integrity: sha512-3dMicj9C1DhaIfDkwt/9GtpU0W+q+GazbG9OIlEyL3Q1BBEz2e6ZRz/JiO8D/ECC0caXAqvnpFudehcLlgIwWQ==} + cpu: [x64] + os: [android] + + '@oven/bun-linux-x64-musl@1.4.4': + resolution: {integrity: sha512-lEEjNOJJrbGZu2NVcPI4uXdILcpspezWkA8R/Jr0RCGhM6zQd0Y7JBIIKNAmbX59EeWpeEz7Q78iLbpcAUypUA==} + cpu: [x64] + os: [linux] + libc: [musl] + + '@oven/bun-linux-x64@1.4.4': + resolution: {integrity: sha512-CHbbkmHVM28T1GFq+6GL4Ao4ujwwYwj1CxFFwEFzLanPfNsId9AhbIP0Q4reWuWBkGimUkoQygrK7Rgjtj3vog==} + cpu: [x64] + os: [linux] + libc: [glibc] + + '@oven/bun-windows-aarch64@1.4.4': + resolution: {integrity: sha512-n0ep5ZRPCZY1+dqFJpnnRUZB1wy4GYU6At8RF+pyzySCLjkN9R4rFh2PtBHAgF/lg1vOl3/CeER3pDM+p40ATA==} + cpu: [arm64] + os: [win32] + + '@oven/bun-windows-x64@1.4.4': + resolution: {integrity: sha512-a3LNctBVO8PjePsFZfwDleF2JXYf2BfQ1u/PLRnBDLnC2Riml+4+LgJpKj4xRGhB92KweGyQI5PXaTkP9qypMQ==} + cpu: [x64] + os: [win32] + + '@oxc-project/types@0.158.0': + resolution: {integrity: sha512-xZ66qA4WmLbTLlxH3mqMd8f9UKbaOzOT0ATwFf4DH/14pMgpUrtqtjyYzOQmgfl2a0iRAAMbQ9G1th/67jRzGw==} + + '@rolldown/binding-android-arm-eabi@1.3.2': + resolution: {integrity: sha512-kqR2xcygEx3WwDY69LsKeyf7SVmx4yzMtKZRknyaHieVJdRvvnAM97L0Gq6tUFc9T2YXcW/Ghij2+Um6He0LTw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [android] + + '@rolldown/binding-android-arm64@1.3.2': + resolution: {integrity: sha512-gXM4GAAvvIZA7qUuSCQS+Zz91H2fagKa5MNppUdjzysJ8LXMWm9D/gQj4nfOKo6okquDQ5pkjsuo2SUMXNW0Rw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [android] + + '@rolldown/binding-darwin-arm64@1.3.2': + resolution: {integrity: sha512-OBs5hp3W+LwMEUmDMMMnu08ncG0t6DDgnFU+6TAucKtAfNgerYLZSr2jtREKb/JuPQ1J7bJnWIgKKkxvjuAw1g==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [darwin] + + '@rolldown/binding-darwin-x64@1.3.2': + resolution: {integrity: sha512-X0VGYd4v/gdjfa/IP6uHuMhofPoUDYvK/byk3bC0jQ1pKKgt6RZ4B4puMqP0AHkjmIHAsxA471mM6AxZ39IaTA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [darwin] + + '@rolldown/binding-freebsd-x64@1.3.2': + resolution: {integrity: sha512-mr04K4cp9J/fj9fknrX8e4QvI/V48Sp+4v64PoLwhoirIH8b8L8EBrF/0bTjV1It2IL91hoNG13GblnWLglkxA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [freebsd] + + '@rolldown/binding-linux-arm-gnueabihf@1.3.2': + resolution: {integrity: sha512-VgWy02HU9Tiy6tU8U+kF3Fd4TQwTNdIBvs2MlgViP1ksMtAnQQTIPAj0ZsJzIQXKIOugqQSpqxQgELJ3fkuL5w==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [linux] + + '@rolldown/binding-linux-arm64-gnu@1.3.2': + resolution: {integrity: sha512-0wloJFYqV844gv6boiERbHpErxbxHbmlgnMX5VxP1Ux+DLBqGrUOn0cIpBmCZEcTITes3QUelxya4u8c9ziQvQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-arm64-musl@1.3.2': + resolution: {integrity: sha512-Kys8wgFQy8H8vua0MNpC0akMBFoNO8455RHk2yycBM0iayMIAtVAL6xmV9TWAkehFgrrlImTL2fZdX5LXfYtAA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + libc: [musl] + + '@rolldown/binding-linux-ppc64-gnu@1.3.2': + resolution: {integrity: sha512-L8eej7+/StRxUHHOPsOVl7Fzx/3tumuGB4hGQZKT73xRI16KZhaSJr0gi3C3WBjNRxeJRKKps2UD4lQukP+oBw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [ppc64] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-s390x-gnu@1.3.2': + resolution: {integrity: sha512-MV5CEb/nV8neQOj7l6945q1vy62HXtWO8zPDvfySPusoUzdBoLoJ/DfXXwaYThGTXZCniF+5bCf253WTPPK7Yw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [s390x] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-x64-gnu@1.3.2': + resolution: {integrity: sha512-3qssvvVvkwQookZ1/1avlKWc5orAR85vgKdzDd5noZS8nnHiI/ejOAEt0xfNYvtBBF7/DZmP8dANWkRBJVOBCA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-x64-musl@1.3.2': + resolution: {integrity: sha512-rJqoFTm/bCZFKKgaT4NzWn/TuJkFDToZ/rzYFnYVBL28jH1nIfg6snx2mDri30nal9H+wcYfKpoPR9jrMQgQQg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + libc: [musl] + + '@rolldown/binding-openharmony-arm64@1.3.2': + resolution: {integrity: sha512-ozdbCjHfh0N//wJNExjJlSlcDaeIKo8k1ktzkLUyESr2Gu/Qw7nBYxKe3jgtoaxda570vg10WdYosre82263hQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [openharmony] + + '@rolldown/binding-wasm32-wasi@1.3.2': + resolution: {integrity: sha512-p5VA6Vk/2cXZPVWf+dDbuE0dkhrcoAo6pISTJmzUnsSdQqNJdusyR8lZgHku095+r27zrYISNLZnJoqrcePW0A==} + engines: {node: ^20.19.0 || ^22.13.0 || >=23.5.0} + cpu: [wasm32] + + '@rolldown/binding-win32-arm64-msvc@1.3.2': + resolution: {integrity: sha512-XDb2U14Orf4r76SwzvJ7avePL00w4gHBmi1Ig4B/itYFEUTmYMNDHVU0dcYuBa0LgNBqyREoJOrQKxQlyYJA7A==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [win32] + + '@rolldown/binding-win32-x64-msvc@1.3.2': + resolution: {integrity: sha512-lEsKzKJqIUDZVCBhS4lkZuyQUhV1oRg5UHkI72qlOAqJn7qEXcoVdTridFS7PHNWdZknBl95EAF/4P1Xv0K1eQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [win32] + + '@rolldown/pluginutils@1.1.0': + resolution: {integrity: sha512-K+NU2HDCEem4sClgHH4ZZXwdJeNFkJo+hRk479DIwdIviAPN2hFJH1KHHwg8CxHQXvi0M5XY4deTXINfIiSG6w==} + + '@sindresorhus/is@4.6.0': + resolution: {integrity: sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==} + engines: {node: '>=10'} + + '@tweenjs/tween.js@23.1.3': + resolution: {integrity: sha512-vJmvvwFxYuGnF2axRtPYocag6Clbb5YS7kLL+SO/TeVFzHqDIWrNKYtcsPMibjDx9O+bu+psAy9NKfWklassUA==} + + '@tybys/wasm-util@0.10.4': + resolution: {integrity: sha512-W3c4gRigFS0T/Ma4qIYF3GDAc5AQdHb1yL5znJT1Zv1YaD9Kitx656wBjvr19qbiosmZT8lWDM5BEMynUqX65A==} + + '@types/stats.js@0.17.4': + resolution: {integrity: sha512-jIBvWWShCvlBqBNIZt0KAshWpvSjhkwkEu4ZUcASoAvhmrgAUI2t1dXrjSL4xXVLB4FznPrIsX3nKXFl/Dt4vA==} + + '@types/three@0.187.0': + resolution: {integrity: sha512-v+vKNarUtk4n2QRZ4+CN5ygMM0ARUjXjIQl0R/unMUfmStFeVqGbgqarbrpoGTXRZoulSH16ePrVJVxPJEbMUA==} + + '@types/validator@13.15.10': + resolution: {integrity: sha512-T8L6i7wCuyoK8A/ZeLYt1+q0ty3Zb9+qbSSvrIVitzT3YjZqkTZ40IbRsPanlB4h1QB3JVL1SYCdR6ngtFYcuA==} + + '@types/webxr@0.5.24': + resolution: {integrity: sha512-h8fgEd/DpoS9CBrjEQXR+dIDraopAEfu4wYVNY2tEPwk60stPWhvZMf4Foo5FakuQ7HFZoa8WceaWFervK2Ovg==} + + ajv-formats@3.0.1: + resolution: {integrity: sha512-8iUql50EUR+uUcdRQ3HDqa6EVyo3docL8g5WJ3FNcWmu62IbkGUue/pEyLBW8VGKKucTPgqeks4fIU1DA4yowQ==} + peerDependencies: + ajv: ^8.0.0 + peerDependenciesMeta: + ajv: + optional: true + + ajv@8.20.0: + resolution: {integrity: sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA==} + + ansi-regex@6.6.0: + resolution: {integrity: sha512-XZ5apbzreCbXSKwPjJstu8R0zOi247w3XYwWxtwBXgpZrCyc1Ka7p9/xY0A9/diMewmHbEKz+FIraWaEWjlN5g==} + engines: {node: '>=12'} + + ansis@4.5.0: + resolution: {integrity: sha512-KwIVkfFfJSSzBmZhDGuTmkhWqTdyB5oNVzzznBJbBZ5bZtHiqSrcugRF0RKJKT4Ss3d7ZrcjnlFVDlQNmtWfWw==} + engines: {node: '>=14'} + + braces@3.0.3: + resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} + engines: {node: '>=8'} + + bun@1.4.4: + resolution: {integrity: sha512-hj0ASdG6PNjLZGFAXktWb3Uaj/dcv/1wCsIttoEXADNIQBsGjTr+5uLKYbrDkuc7NT0Tkj4yPIqJI2jDxXdvVg==} + cpu: [arm64, x64] + os: [darwin, linux, android, freebsd, win32] + hasBin: true + + bundle-name@4.1.1: + resolution: {integrity: sha512-DdH81/zPLVS11EUgWq3tEu/xn+EzljlMYooDNdzWEnFha3R3NBMpMV1UqYIpjYHV/SgpFKMIX1Oh7o06SjM/oA==} + engines: {node: '>=18'} + + chalk@5.6.2: + resolution: {integrity: sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA==} + engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} + + char-regex@1.0.2: + resolution: {integrity: sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==} + engines: {node: '>=10'} + + chardet@2.2.0: + resolution: {integrity: sha512-rddelWYNPRrXq6PtNEN2S3f6t9ILzvqaN5pVgi4kqt9jHQaXIial9PznB5iSPVlQSLNaaH22ItWz3EJtQ10+OA==} + + chokidar@5.0.0: + resolution: {integrity: sha512-TQMmc3w+5AxjpL8iIiwebF73dRDF4fBIieAqGn9RGCWaEVwQ6Fb2cGe31Yns0RRIzii5goJ1Y7xbMwo1TxMplw==} + engines: {node: '>= 20.19.0'} + + chownr@3.0.0: + resolution: {integrity: sha512-+IxzY9BZOQd/XuYPRmrvEVjF/nqj5kgT4kEq7VofrDoM1MxoRjEWkrCC3EtLi59TVawxTAn+orJwFQcrqEN1+g==} + engines: {node: '>=18'} + + class-transformer@0.5.1: + resolution: {integrity: sha512-SQa1Ws6hUbfC98vKGxZH3KFY0Y1lm5Zm0SY8XX9zbK7FJCyVEac3ATW0RIpwzW+oOfmHE5PMPufDG9hCfoEOMw==} + + class-validator@0.14.4: + resolution: {integrity: sha512-AwNusCCam51q703dW82x95tOqQp6oC9HNUl724KxJJOfnKscI8dOloXFgyez7LbTTKWuRBA37FScqVbJEoq8Yw==} + + class-validator@0.15.1: + resolution: {integrity: sha512-LqoS80HBBSCVhz/3KloUly0ovokxpdOLR++Al3J3+dHXWt9sTKlKd4eYtoxhxyUjoe5+UcIM+5k9MIxyBWnRTw==} + + cli-cursor@5.0.0: + resolution: {integrity: sha512-aCj4O5wKyszjMmDT4tZj93kxyydN/K5zPWSCe6/0AV/AA1pqe5ZBIw0a2ZfPQV7lL5/yb5HsUreJ6UFAF1tEQw==} + engines: {node: '>=18'} + + cli-spinners@3.4.0: + resolution: {integrity: sha512-bXfOC4QcT1tKXGorxL3wbJm6XJPDqEnij2gQ2m7ESQuE+/z9YFIWnl/5RpTiKWbMq3EVKR4fRLJGn6DVfu0mpw==} + engines: {node: '>=18.20'} + + cli-width@4.1.0: + resolution: {integrity: sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==} + engines: {node: '>= 12'} + + commander@15.1.0: + resolution: {integrity: sha512-cgnQ88TRrWcC7pVq46RzJVRMktu3W2RcbnoidnfBsl1bmDCBwJS/udcIZpKoCrbAYYaCqsz1yZCVIgbIaU3ddQ==} + engines: {node: '>=22.12.0'} + + default-browser-id@5.0.1: + resolution: {integrity: sha512-x1VCxdX4t+8wVfd1so/9w+vQ4vx7lKd2Qp5tDRutErwmR85OgmfX7RlLRMWafRMY7hbEiXIbudNrjOAPa/hL8Q==} + engines: {node: '>=18'} + + default-browser@5.5.1: + resolution: {integrity: sha512-m1pAzaJgZ/gssEqlOhJkPJp8Xly7QyW6xcrkUa2KKcDeDSEMP7X8xipU3snUcfisTQx0w1AGae+9UtJSfVnXGw==} + engines: {node: '>=18'} + + define-lazy-prop@3.0.0: + resolution: {integrity: sha512-N+MeXYoqr3pOgn8xfyRPREN7gHakLYjhsHhWGT3fWAiL4IkAt0iDw14QiiEm2bE30c5XX5q0FtAA3CK5f9/BUg==} + engines: {node: '>=12'} + + defu@6.1.7: + resolution: {integrity: sha512-7z22QmUWiQ/2d0KkdYmANbRUVABpZ9SNYyH5vx6PZ+nE5bcC0l7uFvEfHlyld/HcGBFTL536ClDt3DEcSlEJAQ==} + + destr@2.0.5: + resolution: {integrity: sha512-ugFTXCtDZunbzasqBxrK93Ik/DRYsO6S/fedkWEMKqt04xZ4csmnmwGDBAb07QWNaGMAmnTIemsYZCksjATwsA==} + + detect-libc@2.1.2: + resolution: {integrity: sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==} + engines: {node: '>=8'} + + dotenv@17.4.2: + resolution: {integrity: sha512-nI4U3TottKAcAD9LLud4Cb7b2QztQMUEfHbvhTH09bqXTxnSie8WnjPALV/WMCrJZ6UV/qHJ6L03OqO3LcdYZw==} + engines: {node: '>=12'} + + dotenv@18.0.10: + resolution: {integrity: sha512-89FAA1xchzK2mxVWdr5F/0rldwiueXs6zJM86rO66EzekR1iBdiXRthyG+m5GvkJaFH3C2LESzamTkgndmLT2A==} + engines: {node: '>=12'} + hasBin: true + + emojilib@2.4.0: + resolution: {integrity: sha512-5U0rVMU5Y2n2+ykNLQqMoqklN9ICBT/KsvC1Gz6vqHbz2AXXGkG+Pm5rMWk/8Vjrr/mY9985Hi8DYzn1F09Nyw==} + + fast-deep-equal@3.1.3: + resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} + + fast-string-truncated-width@3.0.3: + resolution: {integrity: sha512-0jjjIEL6+0jag3l2XWWizO64/aZVtpiGE3t0Zgqxv0DPuxiMjvB3M24fCyhZUO4KomJQPj3LTSUnDP3GpdwC0g==} + + fast-string-width@3.0.2: + resolution: {integrity: sha512-gX8LrtNEI5hq8DVUfRQMbr5lpaS4nMIWV+7XEbXk2b8kiQIizgnlr12B4dA3ZEx3308ze0O4Q1R+cHts8kyUJg==} + + fast-uri@3.1.9: + resolution: {integrity: sha512-hS/0Wt3Ya043oKXs0sIxrMpKQITXhMLIrVAKKXi4gozGC9v7YRWVnXIZzjNPTO02M9BdxLCWqK1yRXgNziVyJQ==} + + fast-wrap-ansi@0.2.2: + resolution: {integrity: sha512-7F2Fl+TjRSenLqlU3UjSH0iyqopqoZIu7eZVpEirP2g1GtWa2G/ecEmBdgz31+Mxr+ELclgg6sokpSFIQiZ02Q==} + + fflate@0.8.3: + resolution: {integrity: sha512-tbZNuJrLwGUp3zshBtdy4W+ORxZuIh8a5ilyIEQDC5rY1f3U20JMry0Ll3WBzU58EZKsEuJFXhb5gwv8CsPvgA==} + + fill-range@7.1.1: + resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} + engines: {node: '>=8'} + + get-east-asian-width@1.7.0: + resolution: {integrity: sha512-XjH1AECxf0giL2V1aU8vKyRR2ppRUb5c0EvT7zuJTokQ74bNo52zOtghqdWIqrhUD79fo3x0WfKZdOqxF6LG1Q==} + engines: {node: '>=18'} + + iconv-lite@0.7.3: + resolution: {integrity: sha512-IKXpvIzjnC9XTAUbVBcMfGS0EPaIXtW6v+zr+RRp+hqULEpo0owZax6wyRwPOJbWbzjYspQwusTsfVr0ifh4uQ==} + engines: {node: '>=0.10.0'} + + is-docker@3.0.0: + resolution: {integrity: sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + hasBin: true + + is-in-ssh@1.0.0: + resolution: {integrity: sha512-jYa6Q9rH90kR1vKB6NM7qqd1mge3Fx4Dhw5TVlK1MUBqhEOuCagrEHMevNuCcbECmXZ0ThXkRm+Ymr51HwEPAw==} + engines: {node: '>=20'} + + is-inside-container@1.0.0: + resolution: {integrity: sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA==} + engines: {node: '>=14.16'} + hasBin: true + + is-interactive@2.0.0: + resolution: {integrity: sha512-qP1vozQRI+BMOPcjFzrjXuQvdak2pHNUMZoeG2eRbiSqyvbEf/wQtEOTOX1guk6E3t36RkaqiSt8A/6YElNxLQ==} + engines: {node: '>=12'} + + is-number@7.0.0: + resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} + engines: {node: '>=0.12.0'} + + is-unicode-supported@2.1.0: + resolution: {integrity: sha512-mE00Gnza5EEB3Ds0HfMyllZzbBrmLOX3vfWoj9A9PEnTfratQ/BcaJOuMhnkhjXvb2+FkY3VuHqtAGpTPmglFQ==} + engines: {node: '>=18'} + + is-wsl@3.1.1: + resolution: {integrity: sha512-e6rvdUCiQCAuumZslxRJWR/Doq4VpPR82kqclvcS0efgt430SlGIk05vdCN58+VrzgtIcfNODjozVielycD4Sw==} + engines: {node: '>=16'} + + json-schema-traverse@1.0.0: + resolution: {integrity: sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==} + + jsonc-parser@3.3.1: + resolution: {integrity: sha512-HUgH65KyejrUFPvHFPbqOY0rsFip3Bo5wb4ngvdi1EpCYWUQDC5V+Y7mZws+DLkr4M//zQJoanu1SP+87Dv1oQ==} + + libphonenumber-js@1.13.16: + resolution: {integrity: sha512-tIOCM9yx2Go6d5/ZANe0K+G4AZek1Ymx81HxQpf19Sri4zMP95eQbKdnUGHAvFQ4nx0PeLhFqvAfisTADXj3tQ==} + + log-symbols@7.0.1: + resolution: {integrity: sha512-ja1E3yCr9i/0hmBVaM0bfwDjnGy8I/s6PP4DFp+yP+a+mrHO4Rm7DtmnqROTUkHIkqffC84YY7AeqX6oFk0WFg==} + engines: {node: '>=18'} + + magic-string@1.4.1: + resolution: {integrity: sha512-8lyCu36ErXR0J9uaGKlKQoiLZKmtI63YGLE8G2o9jyRPdr4X47LusSOwgOJOzcVtp81fTAAjxR7BwKz682Jhow==} + + meshoptimizer@1.1.1: + resolution: {integrity: sha512-oRFNWJRDA/WTrVj7NWvqa5HqE1t9MYDj2VaWirQCzCCrAd2GHrqR/sQezCxiWATPNlKTcRaPRHPJwIRoPBAp5g==} + + micromatch@4.0.8: + resolution: {integrity: sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==} + engines: {node: '>=8.6'} + + mimic-function@5.0.1: + resolution: {integrity: sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==} + engines: {node: '>=18'} + + minipass@7.1.3: + resolution: {integrity: sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A==} + engines: {node: '>=16 || 14 >=14.17'} + + minizlib@3.1.0: + resolution: {integrity: sha512-KZxYo1BUkWD2TVFLr0MQoM8vUUigWD3LlD83a/75BqC+4qE0Hb1Vo5v1FgcfaNXvfXzr+5EhQ6ing/CaBijTlw==} + engines: {node: '>= 18'} + + mute-stream@4.0.0: + resolution: {integrity: sha512-gSrprq0fJ3EiOErzjdIZrjysVVmJ4uu1QWfCDss5LypA5OXvrMje5Ym5z6V6RLyJ2eF87lasX7t6a0AnFvZblg==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + + node-datachannel@0.33.6: + resolution: {integrity: sha512-n7RzImzysrOVFx/lXfkQQ4fL0wsuPXBFc8KM69V29iyIor/UX7Ej+edzNGWJm+3mApZG9nkLi7FsGAZhQCDA4w==} + engines: {node: '>=18.20.0'} + + node-emoji@2.2.0: + resolution: {integrity: sha512-Z3lTE9pLaJF47NyMhd4ww1yFTAP8YhYI8SleJiHzM46Fgpm5cnNzSl9XfzFNqbaz+VlJrIj3fXQ4DeN1Rjm6cw==} + engines: {node: '>=18'} + + onetime@7.0.0: + resolution: {integrity: sha512-VXJjc87FScF88uafS3JllDgvAm+c/Slfz06lorj2uAY34rlUu0Nt+v8wreiImcrgAjjIHp1rXpTDlLOGw29WwQ==} + engines: {node: '>=18'} + + open@11.0.4: + resolution: {integrity: sha512-++Zlftm0kVLPmzC06t6epuWmcRMDbI4z5P3NNX979WA/k23+NtSOynEGzsVfZwguKw2mi5umVgnBlJQMwRz4Pg==} + engines: {node: '>=20'} + + ora@9.4.1: + resolution: {integrity: sha512-6VlU9MLXbjVQD04AZCMX28hVtA5bUoadvUqO76MUCVA0ilwJbMiHsITRPfyVm6p/BC0Av/BXMujx39WCe1LEqw==} + engines: {node: '>=20'} + + picomatch@2.3.2: + resolution: {integrity: sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==} + engines: {node: '>=8.6'} + + picomatch@4.0.7: + resolution: {integrity: sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA==} + engines: {node: '>=12'} + + powershell-utils@0.2.1: + resolution: {integrity: sha512-C+y9x90UElAddDZmV4qOx9W53B61PO7cIqWz2dQsWlwswuq4mr8NEwytdGKboYbQlGZ3awrkTeNvcZiZNHnQ8A==} + engines: {node: '>=20'} + + rc9@3.1.0: + resolution: {integrity: sha512-ufjkNVzbRHKcCOmTahZkmVsyc3W+MSk3jY03m+a7tGHkIsdVMG9l10/3HvFbWkkKzY5VFp3pkRsIo/UYgmFL7Q==} + + readdirp@5.1.1: + resolution: {integrity: sha512-Kko+Y5XQ6fM+Ce3dq3m9YGxnacYZYl9cA1wZjaF3Vbry2L3i1qVg8+CAgNPsXRArPMUMCaOR7oa9Nqntc43JKA==} + engines: {node: '>= 20.19.0'} + + require-from-string@2.0.2: + resolution: {integrity: sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==} + engines: {node: '>=0.10.0'} + + restore-cursor@5.1.0: + resolution: {integrity: sha512-oMA2dcrw6u0YfxJQXm342bFKX/E4sG9rbTzO9ptUcR/e8A33cHuvStiYOwH7fszkZlZ1z/ta9AAoPk2F4qIOHA==} + engines: {node: '>=18'} + + rolldown@1.3.2: + resolution: {integrity: sha512-EFHqbVkXiYZA6akmYm2bvJhNbEGdUwAResRhYwl/BO8QhB5KxsG+t3RVHJSIOy5jBEb0XCACvrIGnnl6Z8sMGA==} + engines: {node: ^20.19.0 || >=22.12.0} + hasBin: true + + run-applescript@7.1.0: + resolution: {integrity: sha512-DPe5pVFaAsinSaV6QjQ6gdiedWDcRCbUuiQfQa2wmWV7+xC9bGulGI8+TdRmoFkAPaBXk8CrAbnlY2ISniJ47Q==} + engines: {node: '>=18'} + + rxjs@7.8.2: + resolution: {integrity: sha512-dhKf903U/PQZY6boNNtAGdWbG85WAbjT/1xYoZIC7FAY0yWapOBQVsVrDl58W86//e1VpMNBtRV4MaXfdMySFA==} + + safer-buffer@2.1.2: + resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} + + semver@7.8.6: + resolution: {integrity: sha512-9lpSSU4Mly3mrtruwLs1eLK6+gzbzqeBFwRNjIjE+9LuDpWdYctrQlQ3ej1Ilgi7gknpsTRnPoLP8DpCHqHIJw==} + engines: {node: '>=10'} + hasBin: true + + signal-exit@4.1.0: + resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} + engines: {node: '>=14'} + + skin-tone@2.0.0: + resolution: {integrity: sha512-kUMbT1oBJCpgrnKoSr0o6wPtvRWT9W9UKvGLwfJYO2WuahZRHOpEyL1ckyMGgMWh0UdpmaoFqKKD29WTomNEGA==} + engines: {node: '>=8'} + + source-map@0.8.0: + resolution: {integrity: sha512-d8EqvL+k/SOXCreS/SUzg2ciyHqBBLcN/yuRjFsbvVhHTE2pgei7oAhmPM7kWFbkX6OSMQfUq4KbkF3au9lhYQ==} + engines: {node: '>= 12'} + + stdin-discarder@0.3.2: + resolution: {integrity: sha512-eCPu1qRxPVkl5605OTWF8Wz40b4Mf45NY5LQmVPQ599knfs5QhASUm9GbJ5BDMDOXgrnh0wyEdvzmL//YMlw0A==} + engines: {node: '>=18'} + + string-width@8.3.0: + resolution: {integrity: sha512-ZbmZM0JCihQN91dWnxoipT2KOEyHqEyfRXUyjuRhW8b/xnqPDoq4gWEVApTVa9db2wN8mmoikgFBbjh71+cGeQ==} + engines: {node: '>=20'} + + strip-ansi@7.2.0: + resolution: {integrity: sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==} + engines: {node: '>=12'} + + tar@7.5.23: + resolution: {integrity: sha512-lkukzdoGngZHJZXxW4S/E4Fp9ghTDlyZXrQGRNoJ/LXvDKcXUTq2sg5yQe74po7Voea6n/IN09+wE/QvJMiifA==} + engines: {node: '>=18'} + + three@0.187.0: + resolution: {integrity: sha512-Qiu7R+Cmh8CstZsY1uJOSWnVlfo7ZtNLV7mF8Jltk3LB3AtDu9cRZlcnRKkAk8Y4z6KKw35z7Y7Urd7jWY8etA==} + + to-regex-range@5.0.1: + resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} + engines: {node: '>=8.0'} + + tslib@2.9.1: + resolution: {integrity: sha512-a4Ux9VKuIMHsOS7ENbEq6hK2ZGYIT27Rtl0E4eD9KqwxhKiQeMZE/9xb3IdYwWaSOyIBQLExhQgXDTYoiCxnWA==} + + typescript@6.0.3: + resolution: {integrity: sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw==} + engines: {node: '>=14.17'} + hasBin: true + + unicode-emoji-modifier-base@1.0.0: + resolution: {integrity: sha512-yLSH4py7oFH3oG/9K+XWrz1pSi3dfUrWEnInbxMfArOfc1+33BlGPQtLsOYwvdMy11AwUBetYuaRxSPqgkq+8g==} + engines: {node: '>=4'} + + unrun@0.3.1: + resolution: {integrity: sha512-onIck/oNnCaytwths1ZVp1LK2Gq2hPoyFhiHebObuUXqR3S0uHuLLaBK8K6mRRgV7Ptip8AnNvaUsgzwWwBZuA==} + engines: {node: ^22.13.0 || >=24.0.0} + hasBin: true + peerDependencies: + synckit: ^0.11.11 + peerDependenciesMeta: + synckit: + optional: true + + validator@13.15.35: + resolution: {integrity: sha512-TQ5pAGhd5whStmqWvYF4OjQROlmv9SMFVt37qoCBdqRffuuklWYQlCNnEs2ZaIBD1kZRNnikiZOS1eqgkar0iw==} + engines: {node: '>= 0.10'} + + wsl-utils@1.0.1: + resolution: {integrity: sha512-c16PKLIRxBYpR3jSWsdS7SFp0COm5SOQdiFjY818dYFHJbMGuLBszpF07LBWmOS1uzrHa9VGdynsEgoeKy0oOQ==} + engines: {node: '>=20'} + + yallist@5.0.0: + resolution: {integrity: sha512-YgvUTfwqyc7UXVMrB+SImsVYSmTS8X/tSrtdNZMImM+n7+QTriRXyXim0mBrTXNeqzVF0KWGgHPeiyViFFrNDw==} + engines: {node: '>=18'} + + yoctocolors@2.2.0: + resolution: {integrity: sha512-xYqdZFUK/VYazNl/oCDYN+3WloWQwMfZxBoiNt6qNyk+xfOdi598muWE42rNZFp1kNOiqW936q5RhUdnpqElSg==} + engines: {node: '>=18'} + + zod@4.6.7: + resolution: {integrity: sha512-g8W2D2kU6a8untc053fX1uVBKzM7yqAxW/3zwk83+6RyF2+SKOuV+c0wBDhUwzV1PaGapmZH+rmcUzPf+3CGwg==} + +snapshots: + + '@angular-devkit/core@22.2.7(chokidar@5.0.0)': + dependencies: + ajv: 8.20.0 + ajv-formats: 3.0.1(ajv@8.20.0) + jsonc-parser: 3.3.1 + picomatch: 4.0.7 + rxjs: 7.8.2 + source-map: 0.8.0 + optionalDependencies: + chokidar: 5.0.0 + + '@angular-devkit/schematics-cli@22.2.7(chokidar@5.0.0)': + dependencies: + '@angular-devkit/core': 22.2.7(chokidar@5.0.0) + '@angular-devkit/schematics': 22.2.7(chokidar@5.0.0) + '@inquirer/prompts': 8.7.2 + transitivePeerDependencies: + - '@types/node' + - chokidar + + '@angular-devkit/schematics@22.2.7(chokidar@5.0.0)': + dependencies: + '@angular-devkit/core': 22.2.7(chokidar@5.0.0) + jsonc-parser: 3.3.1 + magic-string: 1.4.1 + ora: 9.4.1 + rxjs: 7.8.2 + transitivePeerDependencies: + - chokidar + + '@dimforge/rapier3d-compat@0.12.0': {} + + '@emnapi/core@2.0.0-beta.2': + dependencies: + '@emnapi/wasi-threads': 2.2.0 + tslib: 2.9.1 + optional: true + + '@emnapi/runtime@2.0.0-beta.2': + dependencies: + tslib: 2.9.1 + optional: true + + '@emnapi/wasi-threads@2.2.0': + dependencies: + tslib: 2.9.1 + optional: true + + '@inquirer/ansi@2.1.0': {} + + '@inquirer/checkbox@5.3.0': + dependencies: + '@inquirer/ansi': 2.1.0 + '@inquirer/core': 12.1.0 + '@inquirer/figures': 2.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/confirm@6.4.0': + dependencies: + '@inquirer/core': 12.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/core@12.1.0': + dependencies: + '@inquirer/ansi': 2.1.0 + '@inquirer/figures': 2.1.0 + '@inquirer/type': 4.3.0 + cli-width: 4.1.0 + fast-wrap-ansi: 0.2.2 + mute-stream: 4.0.0 + signal-exit: 4.1.0 + + '@inquirer/editor@5.4.0': + dependencies: + '@inquirer/core': 12.1.0 + '@inquirer/external-editor': 3.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/expand@5.2.0': + dependencies: + '@inquirer/core': 12.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/external-editor@3.1.0': + dependencies: + chardet: 2.2.0 + iconv-lite: 0.7.3 + + '@inquirer/figures@2.1.0': {} + + '@inquirer/input@5.2.0': + dependencies: + '@inquirer/core': 12.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/number@4.3.0': + dependencies: + '@inquirer/core': 12.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/password@5.3.0': + dependencies: + '@inquirer/ansi': 2.1.0 + '@inquirer/core': 12.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/prompts@8.7.2': + dependencies: + '@inquirer/checkbox': 5.3.0 + '@inquirer/confirm': 6.4.0 + '@inquirer/editor': 5.4.0 + '@inquirer/expand': 5.2.0 + '@inquirer/input': 5.2.0 + '@inquirer/number': 4.3.0 + '@inquirer/password': 5.3.0 + '@inquirer/rawlist': 5.4.0 + '@inquirer/search': 4.4.0 + '@inquirer/select': 5.3.0 + + '@inquirer/prompts@8.8.0': + dependencies: + '@inquirer/checkbox': 5.3.0 + '@inquirer/confirm': 6.4.0 + '@inquirer/editor': 5.4.0 + '@inquirer/expand': 5.2.0 + '@inquirer/input': 5.2.0 + '@inquirer/number': 4.3.0 + '@inquirer/password': 5.3.0 + '@inquirer/rawlist': 5.4.0 + '@inquirer/search': 4.4.0 + '@inquirer/select': 5.3.0 + + '@inquirer/rawlist@5.4.0': + dependencies: + '@inquirer/core': 12.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/search@4.4.0': + dependencies: + '@inquirer/core': 12.1.0 + '@inquirer/figures': 2.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/select@5.3.0': + dependencies: + '@inquirer/ansi': 2.1.0 + '@inquirer/core': 12.1.0 + '@inquirer/figures': 2.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/type@4.3.0': {} + + '@isaacs/fs-minipass@4.0.1': + dependencies: + minipass: 7.1.3 + + '@jridgewell/sourcemap-codec@1.6.0': {} + + '@nanoforge-dev/asset@3.0.0': + dependencies: + '@nanoforge-dev/common': 3.0.0 + + '@nanoforge-dev/cli@3.0.1': + dependencies: + '@angular-devkit/schematics': 22.2.7(chokidar@5.0.0) + '@angular-devkit/schematics-cli': 22.2.7(chokidar@5.0.0) + '@inquirer/prompts': 8.8.0 + '@nanoforge-dev/config': 3.0.1 + '@nanoforge-dev/editor': 0.1.4 + '@nanoforge-dev/loader-client': 1.7.0 + '@nanoforge-dev/loader-server': 1.7.0 + '@nanoforge-dev/registry': 3.0.1 + '@nanoforge-dev/schematics': 3.0.1(chokidar@5.0.0) + ansis: 4.5.0 + bun: 1.4.4 + chokidar: 5.0.0 + commander: 15.1.0 + dotenv: 18.0.10 + node-emoji: 2.2.0 + open: 11.0.4 + ora: 9.4.1 + rc9: 3.1.0 + transitivePeerDependencies: + - '@types/node' + - synckit + + '@nanoforge-dev/common@3.0.0': {} + + '@nanoforge-dev/config@3.0.1': + dependencies: + unrun: 0.3.1 + zod: 4.6.7 + transitivePeerDependencies: + - synckit + + '@nanoforge-dev/core@3.0.0': + dependencies: + '@nanoforge-dev/asset': 3.0.0 + '@nanoforge-dev/common': 3.0.0 + + '@nanoforge-dev/ecs@3.0.0(@nanoforge-dev/editor-lib@3.0.0)': + dependencies: + '@nanoforge-dev/common': 3.0.0 + optionalDependencies: + '@nanoforge-dev/editor-lib': 3.0.0 + + '@nanoforge-dev/editor-lib@3.0.0': + dependencies: + '@nanoforge-dev/common': 3.0.0 + + '@nanoforge-dev/editor@0.1.4': + dependencies: + bun: 1.4.4 + class-transformer: 0.5.1 + class-validator: 0.15.1 + dotenv: 17.4.2 + micromatch: 4.0.8 + tar: 7.5.23 + typescript: 6.0.3 + + '@nanoforge-dev/env@3.0.0': + dependencies: + '@nanoforge-dev/common': 3.0.0 + class-transformer: 0.5.1 + class-validator: 0.14.4 + + '@nanoforge-dev/graphics-3d@3.0.0(@nanoforge-dev/editor-lib@3.0.0)(three@0.187.0)': + dependencies: + '@nanoforge-dev/common': 3.0.0 + '@types/three': 0.187.0 + three: 0.187.0 + optionalDependencies: + '@nanoforge-dev/editor-lib': 3.0.0 + + '@nanoforge-dev/input@3.0.0': + dependencies: + '@nanoforge-dev/common': 3.0.0 + + '@nanoforge-dev/loader-client@1.7.0': + dependencies: + '@nanoforge-dev/loader-website': 1.7.0 + bun: 1.4.4 + commander: 15.1.0 + + '@nanoforge-dev/loader-server@1.7.0': + dependencies: + bun: 1.4.4 + commander: 15.1.0 + + '@nanoforge-dev/loader-website@1.7.0': {} + + '@nanoforge-dev/network@3.0.0(@nanoforge-dev/editor-lib@3.0.0)': + dependencies: + '@nanoforge-dev/common': 3.0.0 + '@nanoforge-dev/env': 3.0.0 + node-datachannel: 0.33.6 + optionalDependencies: + '@nanoforge-dev/editor-lib': 3.0.0 + + '@nanoforge-dev/registry@3.0.1': + dependencies: + fflate: 0.8.3 + semver: 7.8.6 + zod: 4.6.7 + + '@nanoforge-dev/schematics@3.0.1(chokidar@5.0.0)': + dependencies: + '@angular-devkit/core': 22.2.7(chokidar@5.0.0) + '@angular-devkit/schematics': 22.2.7(chokidar@5.0.0) + rxjs: 7.8.2 + transitivePeerDependencies: + - chokidar + + '@napi-rs/wasm-runtime@1.2.6(@emnapi/core@2.0.0-beta.2)(@emnapi/runtime@2.0.0-beta.2)': + dependencies: + '@emnapi/core': 2.0.0-beta.2 + '@emnapi/runtime': 2.0.0-beta.2 + '@tybys/wasm-util': 0.10.4 + optional: true + + '@node-datachannel/android-arm64@0.33.6': + optional: true + + '@node-datachannel/darwin-arm64@0.33.6': + optional: true + + '@node-datachannel/darwin-x64@0.33.6': + optional: true + + '@node-datachannel/linux-arm64-gnu@0.33.6': + optional: true + + '@node-datachannel/linux-arm64-musl@0.33.6': + optional: true + + '@node-datachannel/linux-x64-gnu@0.33.6': + optional: true + + '@node-datachannel/linux-x64-musl@0.33.6': + optional: true + + '@node-datachannel/win32-arm64-msvc@0.33.6': + optional: true + + '@node-datachannel/win32-x64-msvc@0.33.6': + optional: true + + '@oven/bun-darwin-aarch64@1.4.4': + optional: true + + '@oven/bun-darwin-x64@1.4.4': + optional: true + + '@oven/bun-freebsd-aarch64@1.4.4': + optional: true + + '@oven/bun-freebsd-x64@1.4.4': + optional: true + + '@oven/bun-linux-aarch64-android@1.4.4': + optional: true + + '@oven/bun-linux-aarch64-musl@1.4.4': + optional: true + + '@oven/bun-linux-aarch64@1.4.4': + optional: true + + '@oven/bun-linux-x64-android@1.4.4': + optional: true + + '@oven/bun-linux-x64-musl@1.4.4': + optional: true + + '@oven/bun-linux-x64@1.4.4': + optional: true + + '@oven/bun-windows-aarch64@1.4.4': + optional: true + + '@oven/bun-windows-x64@1.4.4': + optional: true + + '@oxc-project/types@0.158.0': {} + + '@rolldown/binding-android-arm-eabi@1.3.2': + optional: true + + '@rolldown/binding-android-arm64@1.3.2': + optional: true + + '@rolldown/binding-darwin-arm64@1.3.2': + optional: true + + '@rolldown/binding-darwin-x64@1.3.2': + optional: true + + '@rolldown/binding-freebsd-x64@1.3.2': + optional: true + + '@rolldown/binding-linux-arm-gnueabihf@1.3.2': + optional: true + + '@rolldown/binding-linux-arm64-gnu@1.3.2': + optional: true + + '@rolldown/binding-linux-arm64-musl@1.3.2': + optional: true + + '@rolldown/binding-linux-ppc64-gnu@1.3.2': + optional: true + + '@rolldown/binding-linux-s390x-gnu@1.3.2': + optional: true + + '@rolldown/binding-linux-x64-gnu@1.3.2': + optional: true + + '@rolldown/binding-linux-x64-musl@1.3.2': + optional: true + + '@rolldown/binding-openharmony-arm64@1.3.2': + optional: true + + '@rolldown/binding-wasm32-wasi@1.3.2': + dependencies: + '@emnapi/core': 2.0.0-beta.2 + '@emnapi/runtime': 2.0.0-beta.2 + '@napi-rs/wasm-runtime': 1.2.6(@emnapi/core@2.0.0-beta.2)(@emnapi/runtime@2.0.0-beta.2) + optional: true + + '@rolldown/binding-win32-arm64-msvc@1.3.2': + optional: true + + '@rolldown/binding-win32-x64-msvc@1.3.2': + optional: true + + '@rolldown/pluginutils@1.1.0': {} + + '@sindresorhus/is@4.6.0': {} + + '@tweenjs/tween.js@23.1.3': {} + + '@tybys/wasm-util@0.10.4': + dependencies: + tslib: 2.9.1 + optional: true + + '@types/stats.js@0.17.4': {} + + '@types/three@0.187.0': + dependencies: + '@dimforge/rapier3d-compat': 0.12.0 + '@tweenjs/tween.js': 23.1.3 + '@types/stats.js': 0.17.4 + '@types/webxr': 0.5.24 + fflate: 0.8.3 + meshoptimizer: 1.1.1 + + '@types/validator@13.15.10': {} + + '@types/webxr@0.5.24': {} + + ajv-formats@3.0.1(ajv@8.20.0): + optionalDependencies: + ajv: 8.20.0 + + ajv@8.20.0: + dependencies: + fast-deep-equal: 3.1.3 + fast-uri: 3.1.9 + json-schema-traverse: 1.0.0 + require-from-string: 2.0.2 + + ansi-regex@6.6.0: {} + + ansis@4.5.0: {} + + braces@3.0.3: + dependencies: + fill-range: 7.1.1 + + bun@1.4.4: + optionalDependencies: + '@oven/bun-darwin-aarch64': 1.4.4 + '@oven/bun-darwin-x64': 1.4.4 + '@oven/bun-freebsd-aarch64': 1.4.4 + '@oven/bun-freebsd-x64': 1.4.4 + '@oven/bun-linux-aarch64': 1.4.4 + '@oven/bun-linux-aarch64-android': 1.4.4 + '@oven/bun-linux-aarch64-musl': 1.4.4 + '@oven/bun-linux-x64': 1.4.4 + '@oven/bun-linux-x64-android': 1.4.4 + '@oven/bun-linux-x64-musl': 1.4.4 + '@oven/bun-windows-aarch64': 1.4.4 + '@oven/bun-windows-x64': 1.4.4 + + bundle-name@4.1.1: + dependencies: + run-applescript: 7.1.0 + + chalk@5.6.2: {} + + char-regex@1.0.2: {} + + chardet@2.2.0: {} + + chokidar@5.0.0: + dependencies: + readdirp: 5.1.1 + + chownr@3.0.0: {} + + class-transformer@0.5.1: {} + + class-validator@0.14.4: + dependencies: + '@types/validator': 13.15.10 + libphonenumber-js: 1.13.16 + validator: 13.15.35 + + class-validator@0.15.1: + dependencies: + '@types/validator': 13.15.10 + libphonenumber-js: 1.13.16 + validator: 13.15.35 + + cli-cursor@5.0.0: + dependencies: + restore-cursor: 5.1.0 + + cli-spinners@3.4.0: {} + + cli-width@4.1.0: {} + + commander@15.1.0: {} + + default-browser-id@5.0.1: {} + + default-browser@5.5.1: + dependencies: + bundle-name: 4.1.1 + default-browser-id: 5.0.1 + + define-lazy-prop@3.0.0: {} + + defu@6.1.7: {} + + destr@2.0.5: {} + + detect-libc@2.1.2: {} + + dotenv@17.4.2: {} + + dotenv@18.0.10: {} + + emojilib@2.4.0: {} + + fast-deep-equal@3.1.3: {} + + fast-string-truncated-width@3.0.3: {} + + fast-string-width@3.0.2: + dependencies: + fast-string-truncated-width: 3.0.3 + + fast-uri@3.1.9: {} + + fast-wrap-ansi@0.2.2: + dependencies: + fast-string-width: 3.0.2 + + fflate@0.8.3: {} + + fill-range@7.1.1: + dependencies: + to-regex-range: 5.0.1 + + get-east-asian-width@1.7.0: {} + + iconv-lite@0.7.3: + dependencies: + safer-buffer: 2.1.2 + + is-docker@3.0.0: {} + + is-in-ssh@1.0.0: {} + + is-inside-container@1.0.0: + dependencies: + is-docker: 3.0.0 + + is-interactive@2.0.0: {} + + is-number@7.0.0: {} + + is-unicode-supported@2.1.0: {} + + is-wsl@3.1.1: + dependencies: + is-inside-container: 1.0.0 + + json-schema-traverse@1.0.0: {} + + jsonc-parser@3.3.1: {} + + libphonenumber-js@1.13.16: {} + + log-symbols@7.0.1: + dependencies: + is-unicode-supported: 2.1.0 + yoctocolors: 2.2.0 + + magic-string@1.4.1: + dependencies: + '@jridgewell/sourcemap-codec': 1.6.0 + + meshoptimizer@1.1.1: {} + + micromatch@4.0.8: + dependencies: + braces: 3.0.3 + picomatch: 2.3.2 + + mimic-function@5.0.1: {} + + minipass@7.1.3: {} + + minizlib@3.1.0: + dependencies: + minipass: 7.1.3 + + mute-stream@4.0.0: {} + + node-datachannel@0.33.6: + dependencies: + detect-libc: 2.1.2 + optionalDependencies: + '@node-datachannel/android-arm64': 0.33.6 + '@node-datachannel/darwin-arm64': 0.33.6 + '@node-datachannel/darwin-x64': 0.33.6 + '@node-datachannel/linux-arm64-gnu': 0.33.6 + '@node-datachannel/linux-arm64-musl': 0.33.6 + '@node-datachannel/linux-x64-gnu': 0.33.6 + '@node-datachannel/linux-x64-musl': 0.33.6 + '@node-datachannel/win32-arm64-msvc': 0.33.6 + '@node-datachannel/win32-x64-msvc': 0.33.6 + + node-emoji@2.2.0: + dependencies: + '@sindresorhus/is': 4.6.0 + char-regex: 1.0.2 + emojilib: 2.4.0 + skin-tone: 2.0.0 + + onetime@7.0.0: + dependencies: + mimic-function: 5.0.1 + + open@11.0.4: + dependencies: + default-browser: 5.5.1 + define-lazy-prop: 3.0.0 + is-in-ssh: 1.0.0 + is-inside-container: 1.0.0 + powershell-utils: 0.2.1 + wsl-utils: 1.0.1 + + ora@9.4.1: + dependencies: + chalk: 5.6.2 + cli-cursor: 5.0.0 + cli-spinners: 3.4.0 + is-interactive: 2.0.0 + is-unicode-supported: 2.1.0 + log-symbols: 7.0.1 + stdin-discarder: 0.3.2 + string-width: 8.3.0 + + picomatch@2.3.2: {} + + picomatch@4.0.7: {} + + powershell-utils@0.2.1: {} + + rc9@3.1.0: + dependencies: + defu: 6.1.7 + destr: 2.0.5 + + readdirp@5.1.1: {} + + require-from-string@2.0.2: {} + + restore-cursor@5.1.0: + dependencies: + onetime: 7.0.0 + signal-exit: 4.1.0 + + rolldown@1.3.2: + dependencies: + '@oxc-project/types': 0.158.0 + '@rolldown/pluginutils': 1.1.0 + optionalDependencies: + '@rolldown/binding-android-arm-eabi': 1.3.2 + '@rolldown/binding-android-arm64': 1.3.2 + '@rolldown/binding-darwin-arm64': 1.3.2 + '@rolldown/binding-darwin-x64': 1.3.2 + '@rolldown/binding-freebsd-x64': 1.3.2 + '@rolldown/binding-linux-arm-gnueabihf': 1.3.2 + '@rolldown/binding-linux-arm64-gnu': 1.3.2 + '@rolldown/binding-linux-arm64-musl': 1.3.2 + '@rolldown/binding-linux-ppc64-gnu': 1.3.2 + '@rolldown/binding-linux-s390x-gnu': 1.3.2 + '@rolldown/binding-linux-x64-gnu': 1.3.2 + '@rolldown/binding-linux-x64-musl': 1.3.2 + '@rolldown/binding-openharmony-arm64': 1.3.2 + '@rolldown/binding-wasm32-wasi': 1.3.2 + '@rolldown/binding-win32-arm64-msvc': 1.3.2 + '@rolldown/binding-win32-x64-msvc': 1.3.2 + + run-applescript@7.1.0: {} + + rxjs@7.8.2: + dependencies: + tslib: 2.9.1 + + safer-buffer@2.1.2: {} + + semver@7.8.6: {} + + signal-exit@4.1.0: {} + + skin-tone@2.0.0: + dependencies: + unicode-emoji-modifier-base: 1.0.0 + + source-map@0.8.0: {} + + stdin-discarder@0.3.2: {} + + string-width@8.3.0: + dependencies: + get-east-asian-width: 1.7.0 + strip-ansi: 7.2.0 + + strip-ansi@7.2.0: + dependencies: + ansi-regex: 6.6.0 + + tar@7.5.23: + dependencies: + '@isaacs/fs-minipass': 4.0.1 + chownr: 3.0.0 + minipass: 7.1.3 + minizlib: 3.1.0 + yallist: 5.0.0 + + three@0.187.0: {} + + to-regex-range@5.0.1: + dependencies: + is-number: 7.0.0 + + tslib@2.9.1: {} + + typescript@6.0.3: {} + + unicode-emoji-modifier-base@1.0.0: {} + + unrun@0.3.1: + dependencies: + rolldown: 1.3.2 + + validator@13.15.35: {} + + wsl-utils@1.0.1: + dependencies: + is-wsl: 3.1.1 + powershell-utils: 0.2.1 + + yallist@5.0.0: {} + + yoctocolors@2.2.0: {} + + zod@4.6.7: {} diff --git a/demos/pong-3d/pnpm-workspace.yaml b/demos/pong-3d/pnpm-workspace.yaml new file mode 100644 index 0000000..db54857 --- /dev/null +++ b/demos/pong-3d/pnpm-workspace.yaml @@ -0,0 +1,7 @@ +packages: + - "apps/*" +allowBuilds: + bun: true +# NanoForge packages are ours: take a release as soon as it is out. +minimumReleaseAgeExclude: + - "@nanoforge-dev/*" diff --git a/demos/pong-network/.env.example b/demos/pong-network/.env.example new file mode 100644 index 0000000..9fddc90 --- /dev/null +++ b/demos/pong-network/.env.example @@ -0,0 +1,7 @@ +# Copy to .env (`cp .env.example .env`): `nf start` and `nf dev` read it. +# The client connects to the server at this address and port. +NANOFORGE_CLIENT_SERVER_ADDRESS=127.0.0.1 +NANOFORGE_CLIENT_SERVER_TCP_PORT=4444 + +# The server listens on this port. +NANOFORGE_SERVER_LISTENING_TCP_PORT=4444 diff --git a/demos/pong-network/.gitignore b/demos/pong-network/.gitignore new file mode 100644 index 0000000..f28e2dc --- /dev/null +++ b/demos/pong-network/.gitignore @@ -0,0 +1,5 @@ +node_modules/ +dist/ +.nanoforge/ +nf_modules/ +.env diff --git a/demos/pong-network/README.md b/demos/pong-network/README.md new file mode 100644 index 0000000..80f93d0 --- /dev/null +++ b/demos/pong-network/README.md @@ -0,0 +1,50 @@ +# pong-network + +Pong for two players over the network. The server runs the game; each client draws it and sends +its player's keys. + +| Key | Does | +| ----- | ----------------- | +| ↑ / ↓ | Moves your paddle | + +The first client to join plays the left paddle, the second the right one, and the next ones +watch. A paddle is free again when its player leaves. + +## Run it + +```sh +pnpm install +cp .env.example .env +pnpm build && pnpm start # or pnpm dev +pnpm editor # open it in the editor +``` + +Open the client's address in two tabs (or on two computers). The ball is served three seconds +after the server starts, and after each goal. + +`.env` sets where the server listens and where the client finds it (`nf start` and `nf dev` +read it, and the shell's variables win over it): + +| Variable | Default | What | +| ------------------------------------- | ----------- | ------------------------------------ | +| `NANOFORGE_CLIENT_SERVER_ADDRESS` | `127.0.0.1` | The server's address, for the client | +| `NANOFORGE_CLIENT_SERVER_TCP_PORT` | `4444` | The server's port, for the client | +| `NANOFORGE_SERVER_LISTENING_TCP_PORT` | `4444` | The port the server listens on | + +To play on a network, set `NANOFORGE_CLIENT_SERVER_ADDRESS` to the server's address. + +## How it works + +- `apps/server` is authoritative: it spawns the walls, the goals, the ball and the paddles, and + runs the same physics as the local `pong` (`bounceBall`, `blockPaddles`, `scoreGoals`, + `serveBall`, `move2D`). `seatPlayers` seats the clients that send `Play`, `steerPaddles` moves + a paddle from its client's `Input`, and `syncMoves` sends a `Move` when an entity's velocity + changes. +- `apps/client` spawns the same entities with the same `NetworkId`, `applyMoves` applies the + `Move` packets and `move2D` moves the entities between two of them. `sendInput` sends the keys + when they change. +- `src/protocol.ts` (the packets) is the same file in both apps. The server drops an `Input` with + another key than `up`, `down` or `stop`. + +`apps/server/src` is the same as `pong-3d`'s, file for file. The files of `src/` that are also in +`shared/2d` or `shared/paddle` are copies (see the repository's README). diff --git a/demos/pong-network/apps/client/assets/.gitkeep b/demos/pong-network/apps/client/assets/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/demos/pong-network/apps/client/nanoforge.config.ts b/demos/pong-network/apps/client/nanoforge.config.ts new file mode 100644 index 0000000..77607cb --- /dev/null +++ b/demos/pong-network/apps/client/nanoforge.config.ts @@ -0,0 +1,5 @@ +import { defineConfig } from "@nanoforge-dev/config"; + +export default defineConfig({ + type: "client", +}); diff --git a/demos/pong-network/apps/client/package.json b/demos/pong-network/apps/client/package.json new file mode 100644 index 0000000..4de8a5f --- /dev/null +++ b/demos/pong-network/apps/client/package.json @@ -0,0 +1,19 @@ +{ + "$schema": "https://json.schemastore.org/package.json", + "name": "pong-network-client", + "description": "The client of pong-network: draws the game and sends the player's keys", + "private": true, + "type": "module", + "devDependencies": { + "@nanoforge-dev/asset": "^3.0.0", + "@nanoforge-dev/common": "^3.0.0", + "@nanoforge-dev/core": "^3.0.0", + "@nanoforge-dev/ecs": "^3.0.0", + "@nanoforge-dev/editor-lib": "^3.0.0", + "@nanoforge-dev/env": "^3.0.0", + "@nanoforge-dev/graphics-2d": "^3.0.0", + "@nanoforge-dev/input": "^3.0.0", + "@nanoforge-dev/network": "^3.0.0", + "typescript": "^6.0.0" + } +} diff --git a/demos/pong-network/apps/client/src/components/acceleration-2d.component.ts b/demos/pong-network/apps/client/src/components/acceleration-2d.component.ts new file mode 100644 index 0000000..5d4097f --- /dev/null +++ b/demos/pong-network/apps/client/src/components/acceleration-2d.component.ts @@ -0,0 +1,18 @@ +/** + * How fast the velocity of an entity changes, in pixels per second, per second. Needs + * `Velocity2D` and the `move2D` system. + * + * @component + * @side shared + * @group Acceleration color=#f0a33a - Pixels per second, per second. + */ +export class Acceleration2D { + name = "Acceleration2D"; + + constructor( + /** Added to the horizontal velocity every second. @group Acceleration @preset vector.x */ + public x = 0, + /** Added to the vertical velocity every second. @group Acceleration @preset vector.y */ + public y = 0, + ) {} +} diff --git a/demos/pong-network/apps/client/src/components/drawable-circle-2d.component.ts b/demos/pong-network/apps/client/src/components/drawable-circle-2d.component.ts new file mode 100644 index 0000000..1066155 --- /dev/null +++ b/demos/pong-network/apps/client/src/components/drawable-circle-2d.component.ts @@ -0,0 +1,62 @@ +import type { AssetContext } from "@nanoforge-dev/common"; +import { Circle, type Layer } from "@nanoforge-dev/graphics-2d"; +import type { Position2D } from "./position-2d.component"; + +import { imageFill } from "../image-fill"; + +/** + * Draws a circle at the entity's `Position2D` (its center). Needs the `draw2D` system. + * + * @remarks + * `shape` is the Konva `Circle` on screen: change it from code for anything the parameters don't + * offer (shadows, strokes...). + * + * @component + * @side client + * @group Shape color=#e86fb0 - Size of the circle. + * @group Look color=#b18cff - What the circle looks like. + * @group Advanced hidden - Less common settings. + */ +export class DrawableCircle2D { + name = "DrawableCircle2D"; + + /** The circle on screen, made by `draw2D` the first time it draws it. */ + shape?: Circle; + + constructor( + /** In pixels. @group Shape */ + public radius = 25, + /** A CSS color: `red`, `#ff0000`, `rgba(255, 0, 0, 0.5)`... @group Look @preset color */ + public fillColor = "#4aa3ff", + /** An image stretched over the circle, shown instead of the color. @group Look @asset .png .jpg .jpeg .gif .webp .svg */ + public image = "", + /** From 0 (invisible) to 1 (opaque). @group Look */ + public opacity = 1, + /** Clockwise, in degrees, around the center. @group Advanced */ + public rotation = 0, + /** Whether it is drawn. @group Advanced */ + public visible = true, + ) {} + + /** Puts the circle on `layer` at `position`, up to date with the parameters. */ + draw(layer: Layer, position: Position2D, assets: AssetContext): void { + this.shape ??= new Circle(); + if (this.shape.getParent() !== layer) layer.add(this.shape); + this.shape.setAttrs({ + x: position.x, + y: position.y, + radius: this.radius, + fill: this.fillColor, + opacity: this.opacity, + rotation: this.rotation, + visible: this.visible, + ...imageFill(assets, this.image, this.radius * 2, this.radius * 2, true), + }); + } + + /** Removes the circle from the screen. */ + destroy(): void { + this.shape?.destroy(); + this.shape = undefined; + } +} diff --git a/demos/pong-network/apps/client/src/components/drawable-rect-2d.component.ts b/demos/pong-network/apps/client/src/components/drawable-rect-2d.component.ts new file mode 100644 index 0000000..d3586ca --- /dev/null +++ b/demos/pong-network/apps/client/src/components/drawable-rect-2d.component.ts @@ -0,0 +1,69 @@ +import type { AssetContext } from "@nanoforge-dev/common"; +import { type Layer, Rect } from "@nanoforge-dev/graphics-2d"; +import type { Position2D } from "./position-2d.component"; + +import { imageFill } from "../image-fill"; + +/** + * Draws a rectangle at the entity's `Position2D` (its top-left corner). Needs the `draw2D` + * system. + * + * @remarks + * `shape` is the Konva `Rect` on screen: change it from code for anything the parameters don't + * offer (shadows, strokes...). + * + * @component + * @side client + * @group Shape color=#e86fb0 - Size of the rectangle. + * @group Look color=#b18cff - What the rectangle looks like. + * @group Advanced hidden - Less common settings. + */ +export class DrawableRect2D { + name = "DrawableRect2D"; + + /** The rectangle on screen, made by `draw2D` the first time it draws it. */ + shape?: Rect; + + constructor( + /** In pixels. @group Shape @preset size.width */ + public width = 50, + /** In pixels. @group Shape @preset size.height */ + public height = 50, + /** A CSS color: `red`, `#ff0000`, `rgba(255, 0, 0, 0.5)`... @group Look @preset color */ + public fillColor = "#4aa3ff", + /** An image stretched over the rectangle, shown instead of the color. @group Look @asset .png .jpg .jpeg .gif .webp .svg */ + public image = "", + /** From 0 (invisible) to 1 (opaque). @group Look */ + public opacity = 1, + /** Clockwise, in degrees, around the top-left corner. @group Advanced */ + public rotation = 0, + /** Rounds the corners, in pixels. @group Advanced */ + public cornerRadius = 0, + /** Whether it is drawn. @group Advanced */ + public visible = true, + ) {} + + /** Puts the rectangle on `layer` at `position`, up to date with the parameters. */ + draw(layer: Layer, position: Position2D, assets: AssetContext): void { + this.shape ??= new Rect(); + if (this.shape.getParent() !== layer) layer.add(this.shape); + this.shape.setAttrs({ + x: position.x, + y: position.y, + width: this.width, + height: this.height, + fill: this.fillColor, + opacity: this.opacity, + rotation: this.rotation, + cornerRadius: this.cornerRadius, + visible: this.visible, + ...imageFill(assets, this.image, this.width, this.height), + }); + } + + /** Removes the rectangle from the screen. */ + destroy(): void { + this.shape?.destroy(); + this.shape = undefined; + } +} diff --git a/demos/pong-network/apps/client/src/components/drawable-text-2d.component.ts b/demos/pong-network/apps/client/src/components/drawable-text-2d.component.ts new file mode 100644 index 0000000..adba963 --- /dev/null +++ b/demos/pong-network/apps/client/src/components/drawable-text-2d.component.ts @@ -0,0 +1,62 @@ +import { type Layer, Text } from "@nanoforge-dev/graphics-2d"; +import type { Position2D } from "./position-2d.component"; + +/** + * Draws a text at the entity's `Position2D` (its top-left corner). Needs the `draw2D` system. + * + * @remarks + * Change `text` from a system to show a score, a timer... `shape` is the Konva `Text` on screen: + * change it from code for anything the parameters don't offer. + * + * @component + * @side client + * @group Text color=#e86fb0 - What is written. + * @group Look color=#b18cff - What the text looks like. + * @group Advanced hidden - Less common settings. + */ +export class DrawableText2D { + name = "DrawableText2D"; + + /** The text on screen, made by `draw2D` the first time it draws it. */ + shape?: Text; + + constructor( + /** What is written. @group Text */ + public text = "Hello", + /** Height of the letters, in pixels. @group Text */ + public fontSize = 24, + /** A CSS color: `white`, `#ffffff`... @group Look @preset color */ + public fillColor = "#ffffff", + /** From 0 (invisible) to 1 (opaque). @group Look */ + public opacity = 1, + /** A CSS font family: `Arial`, `monospace`... @group Advanced */ + public fontFamily = "Arial", + /** Clockwise, in degrees, around the top-left corner. @group Advanced */ + public rotation = 0, + /** Whether it is drawn. @group Advanced */ + public visible = true, + ) {} + + /** Puts the text on `layer` at `position`, up to date with the parameters. */ + draw(layer: Layer, position: Position2D): void { + this.shape ??= new Text(); + if (this.shape.getParent() !== layer) layer.add(this.shape); + this.shape.setAttrs({ + x: position.x, + y: position.y, + text: this.text, + fontSize: this.fontSize, + fontFamily: this.fontFamily, + fill: this.fillColor, + opacity: this.opacity, + rotation: this.rotation, + visible: this.visible, + }); + } + + /** Removes the text from the screen. */ + destroy(): void { + this.shape?.destroy(); + this.shape = undefined; + } +} diff --git a/demos/pong-network/apps/client/src/components/network-id.component.ts b/demos/pong-network/apps/client/src/components/network-id.component.ts new file mode 100644 index 0000000..084289d --- /dev/null +++ b/demos/pong-network/apps/client/src/components/network-id.component.ts @@ -0,0 +1,20 @@ +/** + * The id of an entity on the network: the server and the clients know the entity by it, and the + * messages about the entity carry it. + * + * @component + * @side shared + */ +export class NetworkId { + name = "NetworkId"; + + /** The velocity last sent to the clients (by pong's `syncMoves`). NaN: to send again. */ + sentX = Number.NaN; + /** See `sentX`. */ + sentY = Number.NaN; + + constructor( + /** Same on the server and the clients. */ + public id = 0, + ) {} +} diff --git a/demos/pong-network/apps/client/src/components/paddle-input.component.ts b/demos/pong-network/apps/client/src/components/paddle-input.component.ts new file mode 100644 index 0000000..7270b37 --- /dev/null +++ b/demos/pong-network/apps/client/src/components/paddle-input.component.ts @@ -0,0 +1,27 @@ +import { InputEnum } from "@nanoforge-dev/input"; + +/** + * The local player's keys: the `sendInput` system sends them to the server, which moves the + * player's paddle. + * + * @component + * @side client + * @group Keys color=#f0a33a - The keys that move the paddle. + */ +export class PaddleInput { + name = "PaddleInput"; + + /** The paddle the server gave this player (`Seated`): 1, 2, or 0 while watching. */ + seat = 0; + /** The last key sent to the server. */ + sent: "up" | "down" | "stop" = "stop"; + + constructor( + /** Moves the paddle up the field. @group Keys */ + public up: InputEnum = InputEnum.ArrowUp, + /** Moves the paddle down the field. @group Keys */ + public down: InputEnum = InputEnum.ArrowDown, + /** Swaps the keys for seat 2, whose camera faces the other way. @group Keys */ + public mirrored = false, + ) {} +} diff --git a/demos/pong-network/apps/client/src/components/position-2d.component.ts b/demos/pong-network/apps/client/src/components/position-2d.component.ts new file mode 100644 index 0000000..0a35624 --- /dev/null +++ b/demos/pong-network/apps/client/src/components/position-2d.component.ts @@ -0,0 +1,20 @@ +/** + * Where an entity is, in pixels from the top-left corner of the screen. + * + * @remarks + * For rectangles it is their top-left corner, for circles their center. + * + * @component + * @side shared + * @group Position color=#4aa3ff - Pixels from the top-left corner of the screen. + */ +export class Position2D { + name = "Position2D"; + + constructor( + /** Pixels from the left edge. @group Position @preset vector.x */ + public x = 0, + /** Pixels from the top edge. @group Position @preset vector.y */ + public y = 0, + ) {} +} diff --git a/demos/pong-network/apps/client/src/components/velocity-2d.component.ts b/demos/pong-network/apps/client/src/components/velocity-2d.component.ts new file mode 100644 index 0000000..3b93d4e --- /dev/null +++ b/demos/pong-network/apps/client/src/components/velocity-2d.component.ts @@ -0,0 +1,20 @@ +/** + * How fast an entity moves, in pixels per second. Needs `Position2D` and the `move2D` system. + * + * @example + * `new Velocity2D(100, 0)` moves 100 pixels to the right every second. + * + * @component + * @side shared + * @group Velocity color=#36c5a0 - Pixels per second. + */ +export class Velocity2D { + name = "Velocity2D"; + + constructor( + /** Pixels per second to the right (negative: to the left). @group Velocity @preset vector.x */ + public x = 0, + /** Pixels per second downward (negative: upward). @group Velocity @preset vector.y */ + public y = 0, + ) {} +} diff --git a/demos/pong-network/apps/client/src/image-fill.ts b/demos/pong-network/apps/client/src/image-fill.ts new file mode 100644 index 0000000..c7fc737 --- /dev/null +++ b/demos/pong-network/apps/client/src/image-fill.ts @@ -0,0 +1,43 @@ +import type { AssetContext } from "@nanoforge-dev/common"; +import type { ShapeConfig } from "@nanoforge-dev/graphics-2d"; + +const images = new Map(); + +/** + * The fill of a shape of `width` by `height` pixels showing the image at `path` (an asset path + * such as `/textures/hero.png`, found in `assets`) stretched over it. Without an image, until it + * is loaded, or when there is no asset at `path`, the shape is filled with its color. + * + * @param centered - Whether the shape's origin is its center (a circle) instead of its top-left + * corner (a rectangle). + */ +export const imageFill = ( + assets: AssetContext, + path: string, + width: number, + height: number, + centered = false, +): ShapeConfig => { + if (!path) return { fillPriority: "color", fillPatternImage: undefined }; + let image = images.get(path); + if (!image) { + image = document.createElement("img"); + try { + image.src = assets.getAsset(path).path; + } catch (error) { + // Once per path, not every frame: the shape keeps its color. + console.warn(`No image at "${path}":`, error); + } + images.set(path, image); + } + if (!image.naturalWidth) return { fillPriority: "color", fillPatternImage: undefined }; + return { + fillPriority: "pattern", + fillPatternImage: image, + fillPatternRepeat: "no-repeat", + fillPatternScaleX: width / image.naturalWidth, + fillPatternScaleY: height / image.naturalHeight, + fillPatternOffsetX: centered ? image.naturalWidth / 2 : 0, + fillPatternOffsetY: centered ? image.naturalHeight / 2 : 0, + }; +}; diff --git a/demos/pong-network/apps/client/src/main.ts b/demos/pong-network/apps/client/src/main.ts new file mode 100644 index 0000000..ba98b56 --- /dev/null +++ b/demos/pong-network/apps/client/src/main.ts @@ -0,0 +1,75 @@ +import type { ClientRunOptions } from "@nanoforge-dev/common"; +import { NanoforgeFactory } from "@nanoforge-dev/core"; +import { EcsLibrary } from "@nanoforge-dev/ecs/client"; +import { EditorLibrary } from "@nanoforge-dev/editor-lib"; +import { Graphics2DLibrary } from "@nanoforge-dev/graphics-2d"; +import { InputLibrary } from "@nanoforge-dev/input"; +import { NetworkClientLibrary } from "@nanoforge-dev/network/client"; + +import { DrawableRect2D } from "./components/drawable-rect-2d.component"; +import { NetworkId } from "./components/network-id.component"; +import { PaddleInput } from "./components/paddle-input.component"; +import { Position2D } from "./components/position-2d.component"; +import { Velocity2D } from "./components/velocity-2d.component"; +import { Play } from "./pong-protocol"; +import { applyMoves } from "./systems/apply-moves.system"; +import { draw2D } from "./systems/draw-2d.system"; +import { move2D } from "./systems/move-2d.system"; +import { sendInput } from "./systems/send-input.system"; + +export const main = async (options: ClientRunOptions): Promise => { + const app = NanoforgeFactory.createClient({ + tickRate: 60, + viewport: { width: 1920, height: 1080, fit: "contain" }, + }); + const ecs = new EcsLibrary(); + const network = new NetworkClientLibrary(); + + app.use(new Graphics2DLibrary()); + app.use(ecs); + app.use(network); + app.use(new InputLibrary()); + app.use(new EditorLibrary()); + + await app.init(options); + + const registry = ecs.registry; + + const field = registry.spawnEntity(); + registry.addComponent(field, new Position2D(0, 0)); + registry.addComponent(field, new DrawableRect2D(1920, 1080, "#3a6327")); + + const centerLine = registry.spawnEntity(); + registry.addComponent(centerLine, new Position2D(955, 0)); + registry.addComponent(centerLine, new DrawableRect2D(10, 1080, "#94cc75")); + + const ball = registry.spawnEntity(); + registry.addComponent(ball, new Position2D(945, 525)); + registry.addComponent(ball, new Velocity2D(0, 0)); + registry.addComponent(ball, new NetworkId(0)); + registry.addComponent(ball, new DrawableRect2D(30, 30, "#ff4d3d", "", 1, 0, 15)); + + const leftPaddle = registry.spawnEntity(); + registry.addComponent(leftPaddle, new Position2D(20, 390)); + registry.addComponent(leftPaddle, new Velocity2D(0, 0)); + registry.addComponent(leftPaddle, new NetworkId(1)); + registry.addComponent(leftPaddle, new DrawableRect2D(30, 300, "#4d8dff")); + + const rightPaddle = registry.spawnEntity(); + registry.addComponent(rightPaddle, new Position2D(1870, 390)); + registry.addComponent(rightPaddle, new Velocity2D(0, 0)); + registry.addComponent(rightPaddle, new NetworkId(2)); + registry.addComponent(rightPaddle, new DrawableRect2D(30, 300, "#ff9f40")); + + const player = registry.spawnEntity(); + registry.addComponent(player, new PaddleInput()); + + registry.addSystem(sendInput); + registry.addSystem(applyMoves); + registry.addSystem(move2D); + registry.addSystem(draw2D); + + network.packets.send(Play); + + await app.run(); +}; diff --git a/demos/pong-network/apps/client/src/pong-protocol.ts b/demos/pong-network/apps/client/src/pong-protocol.ts new file mode 100644 index 0000000..c889517 --- /dev/null +++ b/demos/pong-network/apps/client/src/pong-protocol.ts @@ -0,0 +1,21 @@ +import { definePacket } from "@nanoforge-dev/network"; + +type Vector = { x: number; y: number }; +type Key = "up" | "down" | "stop"; + +const KEYS: unknown[] = ["up", "down", "stop"] satisfies Key[]; + +/** Sent once by a client to join: the server answers with `Seated`. */ +export const Play = definePacket("play"); + +/** The paddle a client plays: 1 (left), 2 (right), or 0 when it watches. */ +export const Seated = definePacket<{ paddle: number }>("seated"); + +/** Where a client wants its paddle to go. Anything else than the three keys is dropped. */ +export const Input = definePacket<{ key: Key }>("input", { + validate: (data): data is { key: Key } => + typeof data === "object" && data !== null && KEYS.includes((data as { key?: unknown }).key), +}); + +/** The position and velocity of the entity of `NetworkId` `id`, sent when its velocity changes. */ +export const Move = definePacket<{ id: number; position: Vector; velocity: Vector }>("move"); diff --git a/demos/pong-network/apps/client/src/systems/apply-moves.system.ts b/demos/pong-network/apps/client/src/systems/apply-moves.system.ts new file mode 100644 index 0000000..0621cec --- /dev/null +++ b/demos/pong-network/apps/client/src/systems/apply-moves.system.ts @@ -0,0 +1,27 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; + +import { NetworkId } from "../components/network-id.component"; +import { Position2D } from "../components/position-2d.component"; +import { Velocity2D } from "../components/velocity-2d.component"; +import { Move } from "../pong-protocol"; + +/** + * Applies the server's `Move` packets to the `NetworkId` entities: `move2D` moves them the same + * way until the next one. Add it before `move2D`. + * + * @system + * @side client + */ +export const applyMoves = (registry: Registry, ctx: Context) => { + const entities = registry.getZipper([NetworkId, Position2D, Velocity2D]); + + for (const { data } of ctx.network.packets.read(Move)) { + const entity = entities.find(({ NetworkId }) => NetworkId.id === data.id); + if (!entity) continue; + entity.Position2D.x = data.position.x; + entity.Position2D.y = data.position.y; + entity.Velocity2D.x = data.velocity.x; + entity.Velocity2D.y = data.velocity.y; + } +}; diff --git a/demos/pong-network/apps/client/src/systems/draw-2d.system.ts b/demos/pong-network/apps/client/src/systems/draw-2d.system.ts new file mode 100644 index 0000000..937eeeb --- /dev/null +++ b/demos/pong-network/apps/client/src/systems/draw-2d.system.ts @@ -0,0 +1,45 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; +import "@nanoforge-dev/graphics-2d"; +import { Position2D } from "../components/position-2d.component"; + +import { DrawableCircle2D } from "../components/drawable-circle-2d.component"; +import { DrawableRect2D } from "../components/drawable-rect-2d.component"; +import { DrawableText2D } from "../components/drawable-text-2d.component"; + +type Drawable = DrawableRect2D | DrawableCircle2D | DrawableText2D; + +/** The drawables shown by the last frame. */ +let shown = new Set(); + +/** + * Draws every entity that has a `Position2D` and a `DrawableRect2D`, `DrawableCircle2D` or + * `DrawableText2D`, where it is. Add it last, after the systems that move entities. + * + * @remarks + * The shape of a killed entity, or of a removed drawable, is removed from the screen. + * + * @system + * @side client + */ +export const draw2D = (registry: Registry, ctx: Context) => { + const layer = ctx.graphics.baseLayer; + const drawn = new Set(); + + registry.getZipper([DrawableRect2D, Position2D]).forEach(({ DrawableRect2D, Position2D }) => { + DrawableRect2D.draw(layer, Position2D, ctx.assets); + drawn.add(DrawableRect2D); + }); + registry.getZipper([DrawableCircle2D, Position2D]).forEach(({ DrawableCircle2D, Position2D }) => { + DrawableCircle2D.draw(layer, Position2D, ctx.assets); + drawn.add(DrawableCircle2D); + }); + registry.getZipper([DrawableText2D, Position2D]).forEach(({ DrawableText2D, Position2D }) => { + DrawableText2D.draw(layer, Position2D); + drawn.add(DrawableText2D); + }); + + // `killEntity` doesn't call `destroy()`: a drawable no longer in the world loses its shape here. + for (const drawable of shown) if (!drawn.has(drawable)) drawable.destroy(); + shown = drawn; +}; diff --git a/demos/pong-network/apps/client/src/systems/move-2d.system.ts b/demos/pong-network/apps/client/src/systems/move-2d.system.ts new file mode 100644 index 0000000..514766a --- /dev/null +++ b/demos/pong-network/apps/client/src/systems/move-2d.system.ts @@ -0,0 +1,26 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; + +import { Acceleration2D } from "../components/acceleration-2d.component"; +import { Position2D } from "../components/position-2d.component"; +import { Velocity2D } from "../components/velocity-2d.component"; + +/** + * Moves entities: their `Acceleration2D` changes their `Velocity2D`, then their `Velocity2D` + * changes their `Position2D`, by the time elapsed since the last frame. + * + * @system + * @side shared + */ +export const move2D = (registry: Registry, ctx: Context) => { + const seconds = ctx.app.delta / 1000; + + registry.getZipper([Acceleration2D, Velocity2D]).forEach(({ Acceleration2D, Velocity2D }) => { + Velocity2D.x += Acceleration2D.x * seconds; + Velocity2D.y += Acceleration2D.y * seconds; + }); + registry.getZipper([Position2D, Velocity2D]).forEach(({ Position2D, Velocity2D }) => { + Position2D.x += Velocity2D.x * seconds; + Position2D.y += Velocity2D.y * seconds; + }); +}; diff --git a/demos/pong-network/apps/client/src/systems/send-input.system.ts b/demos/pong-network/apps/client/src/systems/send-input.system.ts new file mode 100644 index 0000000..a8f6a0d --- /dev/null +++ b/demos/pong-network/apps/client/src/systems/send-input.system.ts @@ -0,0 +1,30 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; +import "@nanoforge-dev/input"; + +import { PaddleInput } from "../components/paddle-input.component"; +import { Input, Seated } from "../pong-protocol"; + +/** + * Sends the local player's `PaddleInput` keys to the server when they change, once it has a + * seat (`Seated`). + * + * @system + * @side client + */ +export const sendInput = (registry: Registry, ctx: Context) => { + const seated = ctx.network.packets.read(Seated).at(-1); + + registry.getZipper([PaddleInput]).forEach(({ PaddleInput: player }) => { + if (seated) player.seat = seated.data.paddle; + if (player.seat === 0) return; + const up = ctx.input.isKeyPressed(player.up) === true; + const down = ctx.input.isKeyPressed(player.down) === true; + const flip = player.mirrored && player.seat === 2; + let key: "up" | "down" | "stop" = "stop"; + if (up !== down) key = up !== flip ? "up" : "down"; + if (key === player.sent) return; + ctx.network.packets.send(Input, { key }); + player.sent = key; + }); +}; diff --git a/demos/pong-network/apps/client/tsconfig.json b/demos/pong-network/apps/client/tsconfig.json new file mode 100644 index 0000000..c0ae4f2 --- /dev/null +++ b/demos/pong-network/apps/client/tsconfig.json @@ -0,0 +1,39 @@ +{ + "$schema": "https://json.schemastore.org/tsconfig.json", + // Mapped from https://www.typescriptlang.org/tsconfig + "compilerOptions": { + // Type Checking + "allowUnreachableCode": false, + "allowUnusedLabels": false, + "noFallthroughCasesInSwitch": true, + "noImplicitOverride": true, + "noImplicitReturns": true, + "noPropertyAccessFromIndexSignature": false, + "noUncheckedIndexedAccess": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "strict": true, + + // Modules + "allowArbitraryExtensions": false, + "allowImportingTsExtensions": false, + "module": "ESNext", + "moduleResolution": "Bundler", + "resolveJsonModule": true, + "resolvePackageJsonExports": true, + "resolvePackageJsonImports": true, + + // Interop Constraints + "allowSyntheticDefaultImports": true, + "forceConsistentCasingInFileNames": true, + "isolatedModules": true, + + // Language and Environment + "experimentalDecorators": true, + "lib": ["ESNext", "esnext.disposable", "DOM"], + "target": "ESNext", + "useDefineForClassFields": true + }, + "include": ["src"], + "exclude": ["node_modules", ".nanoforge", "dist"] +} diff --git a/demos/pong-network/apps/server/assets/.gitkeep b/demos/pong-network/apps/server/assets/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/demos/pong-network/apps/server/nanoforge.config.ts b/demos/pong-network/apps/server/nanoforge.config.ts new file mode 100644 index 0000000..43a3fef --- /dev/null +++ b/demos/pong-network/apps/server/nanoforge.config.ts @@ -0,0 +1,5 @@ +import { defineConfig } from "@nanoforge-dev/config"; + +export default defineConfig({ + type: "server", +}); diff --git a/demos/pong-network/apps/server/package.json b/demos/pong-network/apps/server/package.json new file mode 100644 index 0000000..8d7235c --- /dev/null +++ b/demos/pong-network/apps/server/package.json @@ -0,0 +1,17 @@ +{ + "$schema": "https://json.schemastore.org/package.json", + "name": "pong-network-server", + "description": "The server of pong-network: runs the game and sends it to the clients", + "private": true, + "type": "module", + "devDependencies": { + "@nanoforge-dev/asset": "^3.0.0", + "@nanoforge-dev/common": "^3.0.0", + "@nanoforge-dev/core": "^3.0.0", + "@nanoforge-dev/ecs": "^3.0.0", + "@nanoforge-dev/editor-lib": "^3.0.0", + "@nanoforge-dev/env": "^3.0.0", + "@nanoforge-dev/network": "^3.0.0", + "typescript": "^6.0.0" + } +} diff --git a/demos/pong-network/apps/server/src/collisions.ts b/demos/pong-network/apps/server/src/collisions.ts new file mode 100644 index 0000000..fa825fa --- /dev/null +++ b/demos/pong-network/apps/server/src/collisions.ts @@ -0,0 +1,32 @@ +import type { HitboxRect2D } from "./components/hitbox-rect-2d.component"; +import type { Position2D } from "./components/position-2d.component"; +import type { Velocity2D } from "./components/velocity-2d.component"; + +/** Whether two hitboxes overlap (touching edges don't). */ +export const overlap = (a: Position2D, aBox: HitboxRect2D, b: Position2D, bBox: HitboxRect2D) => + a.x < b.x + bBox.width && + a.x + aBox.width > b.x && + a.y < b.y + bBox.height && + a.y + aBox.height > b.y; + +/** + * Pushes `a` out of `b` on the axis it went in the least. On that axis, its velocity turns away + * from `b` when it `bounces`, and stops otherwise. + */ +export const pushOut = ( + a: Position2D, + aBox: HitboxRect2D, + velocity: Velocity2D, + b: Position2D, + bBox: HitboxRect2D, + bounces: boolean, +) => { + const left = a.x + aBox.width - b.x; + const right = b.x + bBox.width - a.x; + const up = a.y + aBox.height - b.y; + const down = b.y + bBox.height - a.y; + const axis = Math.min(left, right) < Math.min(up, down) ? "x" : "y"; + const back = axis === "x" ? left < right : up < down; + a[axis] += back ? -(axis === "x" ? left : up) : axis === "x" ? right : down; + velocity[axis] = bounces ? (back ? -1 : 1) * Math.abs(velocity[axis]) : 0; +}; diff --git a/demos/pong-network/apps/server/src/components/acceleration-2d.component.ts b/demos/pong-network/apps/server/src/components/acceleration-2d.component.ts new file mode 100644 index 0000000..5d4097f --- /dev/null +++ b/demos/pong-network/apps/server/src/components/acceleration-2d.component.ts @@ -0,0 +1,18 @@ +/** + * How fast the velocity of an entity changes, in pixels per second, per second. Needs + * `Velocity2D` and the `move2D` system. + * + * @component + * @side shared + * @group Acceleration color=#f0a33a - Pixels per second, per second. + */ +export class Acceleration2D { + name = "Acceleration2D"; + + constructor( + /** Added to the horizontal velocity every second. @group Acceleration @preset vector.x */ + public x = 0, + /** Added to the vertical velocity every second. @group Acceleration @preset vector.y */ + public y = 0, + ) {} +} diff --git a/demos/pong-network/apps/server/src/components/ball.component.ts b/demos/pong-network/apps/server/src/components/ball.component.ts new file mode 100644 index 0000000..b39d38d --- /dev/null +++ b/demos/pong-network/apps/server/src/components/ball.component.ts @@ -0,0 +1,10 @@ +/** + * A ball: it bounces off `Paddle` and `Wall` entities, and scores in `Goal` entities. Needs + * `Position2D`, `Velocity2D`, `HitboxRect2D` and the `bounceBall` system. + * + * @component + * @side shared + */ +export class Ball { + name = "Ball"; +} diff --git a/demos/pong-network/apps/server/src/components/goal.component.ts b/demos/pong-network/apps/server/src/components/goal.component.ts new file mode 100644 index 0000000..a9a834d --- /dev/null +++ b/demos/pong-network/apps/server/src/components/goal.component.ts @@ -0,0 +1,18 @@ +/** + * A goal: a `Ball` that enters it gives a point to `player`, and is served again. Needs + * `Position2D`, `HitboxRect2D` and the `scoreGoals` system. + * + * @component + * @side shared + */ +export class Goal { + name = "Goal"; + + /** Points scored in this goal, added by `scoreGoals`. */ + points = 0; + + constructor( + /** The player who scores when the ball enters it. */ + public player = 1, + ) {} +} diff --git a/demos/pong-network/apps/server/src/components/hitbox-rect-2d.component.ts b/demos/pong-network/apps/server/src/components/hitbox-rect-2d.component.ts new file mode 100644 index 0000000..5c82bd3 --- /dev/null +++ b/demos/pong-network/apps/server/src/components/hitbox-rect-2d.component.ts @@ -0,0 +1,22 @@ +/** + * Makes an entity collide as a rectangle whose top-left corner is its `Position2D`. + * + * @remarks + * The library's `HitboxRect2D` (`@nanoforge/physics-2d`) has the same parameters, plus the + * `collisions` that its `detectCollisions2D` system fills. Here `bounceBall`, `blockPaddles` and + * `scoreGoals` test the hitboxes they need themselves. + * + * @component + * @side shared + * @group Size color=#5ec26a - Size of the hitbox. + */ +export class HitboxRect2D { + name = "HitboxRect2D"; + + constructor( + /** In pixels. @group Size @preset size.width */ + public width = 50, + /** In pixels. @group Size @preset size.height */ + public height = 50, + ) {} +} diff --git a/demos/pong-network/apps/server/src/components/network-id.component.ts b/demos/pong-network/apps/server/src/components/network-id.component.ts new file mode 100644 index 0000000..084289d --- /dev/null +++ b/demos/pong-network/apps/server/src/components/network-id.component.ts @@ -0,0 +1,20 @@ +/** + * The id of an entity on the network: the server and the clients know the entity by it, and the + * messages about the entity carry it. + * + * @component + * @side shared + */ +export class NetworkId { + name = "NetworkId"; + + /** The velocity last sent to the clients (by pong's `syncMoves`). NaN: to send again. */ + sentX = Number.NaN; + /** See `sentX`. */ + sentY = Number.NaN; + + constructor( + /** Same on the server and the clients. */ + public id = 0, + ) {} +} diff --git a/demos/pong-network/apps/server/src/components/paddle.component.ts b/demos/pong-network/apps/server/src/components/paddle.component.ts new file mode 100644 index 0000000..1141ab5 --- /dev/null +++ b/demos/pong-network/apps/server/src/components/paddle.component.ts @@ -0,0 +1,32 @@ +/** + * A paddle: it sends a `Ball` back, at a wider angle the further from its middle the ball hits + * it. Walls stop it. Needs `Position2D` and `HitboxRect2D`, and the `bounceBall` and + * `blockPaddles` systems. + * + * @example + * The left paddle of a pong sends the ball to the right: `new Paddle(1, 0)`. A breakout paddle + * sends it up: `new Paddle(0, -1)`. + * + * @component + * @side shared + * @group Bounce color=#4aa3ff - How the ball leaves the paddle. + */ +export class Paddle { + name = "Paddle"; + + constructor( + /** Where the ball goes, hit in the middle: 1 to the right, -1 to the left. @group Bounce */ + public normalX = 0, + /** Where the ball goes, hit in the middle: 1 down, -1 up. @group Bounce */ + public normalY = -1, + /** Angle off that direction when hit at an end, in degrees. @group Bounce */ + public maxAngle = 60, + /** The ball's speed is multiplied by it at each hit: 1 keeps it. @group Bounce */ + public speedUp = 1, + /** + * The most `speedUp` takes the ball to, in pixels per second. A faster ball goes through + * walls in one frame on a slow machine. @group Bounce + */ + public maxSpeed = 1600, + ) {} +} diff --git a/demos/pong-network/apps/server/src/components/position-2d.component.ts b/demos/pong-network/apps/server/src/components/position-2d.component.ts new file mode 100644 index 0000000..0a35624 --- /dev/null +++ b/demos/pong-network/apps/server/src/components/position-2d.component.ts @@ -0,0 +1,20 @@ +/** + * Where an entity is, in pixels from the top-left corner of the screen. + * + * @remarks + * For rectangles it is their top-left corner, for circles their center. + * + * @component + * @side shared + * @group Position color=#4aa3ff - Pixels from the top-left corner of the screen. + */ +export class Position2D { + name = "Position2D"; + + constructor( + /** Pixels from the left edge. @group Position @preset vector.x */ + public x = 0, + /** Pixels from the top edge. @group Position @preset vector.y */ + public y = 0, + ) {} +} diff --git a/demos/pong-network/apps/server/src/components/seat.component.ts b/demos/pong-network/apps/server/src/components/seat.component.ts new file mode 100644 index 0000000..8e5cc74 --- /dev/null +++ b/demos/pong-network/apps/server/src/components/seat.component.ts @@ -0,0 +1,22 @@ +import type { ClientId } from "@nanoforge-dev/network/server"; + +/** + * A paddle a client can play: the first clients to join take the free seats. Needs `Velocity2D` + * and the `seatPlayers` and `steerPaddles` systems. + * + * @component + * @side server + */ +export class Seat { + name = "Seat"; + + /** The client playing this paddle, until it leaves. */ + client: ClientId | undefined = undefined; + + constructor( + /** The seat's number, sent to the client that takes it (1 left, 2 right). */ + public player = 1, + /** In pixels per second. */ + public speed = 1000, + ) {} +} diff --git a/demos/pong-network/apps/server/src/components/serve.component.ts b/demos/pong-network/apps/server/src/components/serve.component.ts new file mode 100644 index 0000000..8cb04c4 --- /dev/null +++ b/demos/pong-network/apps/server/src/components/serve.component.ts @@ -0,0 +1,30 @@ +/** + * Serves a `Ball`: after `delay` seconds it leaves horizontally at `speed`, toward each side in + * turn. A goal puts it back at (`x`, `y`) and serves it again. Needs `Velocity2D` and the + * `serveBall` system. + * + * @component + * @side shared + * @group Serve color=#f0a33a - Where and how the ball is served. + */ +export class Serve { + name = "Serve"; + + /** Seconds left before the serve, 0 once served. */ + wait: number; + /** The side the next serve goes to: 1 right, -1 left. */ + side = 1; + + constructor( + /** Where a goal puts the ball back, from the left. @group Serve @preset vector.x */ + public x = 0, + /** Where a goal puts the ball back, from the top. @group Serve @preset vector.y */ + public y = 0, + /** In pixels per second. @group Serve */ + public speed = 600, + /** Seconds before each serve. @group Serve */ + public delay = 3, + ) { + this.wait = delay; + } +} diff --git a/demos/pong-network/apps/server/src/components/velocity-2d.component.ts b/demos/pong-network/apps/server/src/components/velocity-2d.component.ts new file mode 100644 index 0000000..3b93d4e --- /dev/null +++ b/demos/pong-network/apps/server/src/components/velocity-2d.component.ts @@ -0,0 +1,20 @@ +/** + * How fast an entity moves, in pixels per second. Needs `Position2D` and the `move2D` system. + * + * @example + * `new Velocity2D(100, 0)` moves 100 pixels to the right every second. + * + * @component + * @side shared + * @group Velocity color=#36c5a0 - Pixels per second. + */ +export class Velocity2D { + name = "Velocity2D"; + + constructor( + /** Pixels per second to the right (negative: to the left). @group Velocity @preset vector.x */ + public x = 0, + /** Pixels per second downward (negative: upward). @group Velocity @preset vector.y */ + public y = 0, + ) {} +} diff --git a/demos/pong-network/apps/server/src/components/wall.component.ts b/demos/pong-network/apps/server/src/components/wall.component.ts new file mode 100644 index 0000000..3e54fda --- /dev/null +++ b/demos/pong-network/apps/server/src/components/wall.component.ts @@ -0,0 +1,16 @@ +/** + * A wall: a `Ball` bounces off it, and a `Paddle` can't go through it. Needs `Position2D` and + * `HitboxRect2D`. + * + * @remarks + * `hits` counts the bounces, for a system that breaks bricks. + * + * @component + * @side shared + */ +export class Wall { + name = "Wall"; + + /** Bounces of a ball off this wall, added by `bounceBall`. Set it back to 0 once handled. */ + hits = 0; +} diff --git a/demos/pong-network/apps/server/src/main.ts b/demos/pong-network/apps/server/src/main.ts new file mode 100644 index 0000000..14a1f66 --- /dev/null +++ b/demos/pong-network/apps/server/src/main.ts @@ -0,0 +1,92 @@ +import type { RunOptions } from "@nanoforge-dev/common"; +import { NanoforgeFactory } from "@nanoforge-dev/core"; +import { EcsLibrary } from "@nanoforge-dev/ecs/server"; +import { EditorLibrary } from "@nanoforge-dev/editor-lib"; +import { NetworkServerLibrary } from "@nanoforge-dev/network/server"; + +import { Ball } from "./components/ball.component"; +import { Goal } from "./components/goal.component"; +import { HitboxRect2D } from "./components/hitbox-rect-2d.component"; +import { NetworkId } from "./components/network-id.component"; +import { Paddle } from "./components/paddle.component"; +import { Position2D } from "./components/position-2d.component"; +import { Seat } from "./components/seat.component"; +import { Serve } from "./components/serve.component"; +import { Velocity2D } from "./components/velocity-2d.component"; +import { Wall } from "./components/wall.component"; +import { blockPaddles } from "./systems/block-paddles.system"; +import { bounceBall } from "./systems/bounce-ball.system"; +import { move2D } from "./systems/move-2d.system"; +import { scoreGoals } from "./systems/score-goals.system"; +import { seatPlayers } from "./systems/seat-players.system"; +import { serveBall } from "./systems/serve-ball.system"; +import { steerPaddles } from "./systems/steer-paddles.system"; +import { syncMoves } from "./systems/sync-moves.system"; + +export const main = async (options: RunOptions): Promise => { + const app = NanoforgeFactory.createServer({ tickRate: 60 }); + const ecs = new EcsLibrary(); + + app.use(ecs); + app.use(new NetworkServerLibrary()); + app.use(new EditorLibrary()); + + await app.init(options); + + const registry = ecs.registry; + + const topWall = registry.spawnEntity(); + registry.addComponent(topWall, new Position2D(0, -100)); + registry.addComponent(topWall, new HitboxRect2D(1920, 100)); + registry.addComponent(topWall, new Wall()); + + const bottomWall = registry.spawnEntity(); + registry.addComponent(bottomWall, new Position2D(0, 1080)); + registry.addComponent(bottomWall, new HitboxRect2D(1920, 100)); + registry.addComponent(bottomWall, new Wall()); + + const leftGoal = registry.spawnEntity(); + registry.addComponent(leftGoal, new Position2D(-100, 0)); + registry.addComponent(leftGoal, new HitboxRect2D(100, 1080)); + registry.addComponent(leftGoal, new Goal(2)); + + const rightGoal = registry.spawnEntity(); + registry.addComponent(rightGoal, new Position2D(1920, 0)); + registry.addComponent(rightGoal, new HitboxRect2D(100, 1080)); + registry.addComponent(rightGoal, new Goal(1)); + + const ball = registry.spawnEntity(); + registry.addComponent(ball, new Position2D(945, 525)); + registry.addComponent(ball, new Velocity2D(0, 0)); + registry.addComponent(ball, new HitboxRect2D(30, 30)); + registry.addComponent(ball, new Ball()); + registry.addComponent(ball, new Serve(945, 525, 1000, 3)); + registry.addComponent(ball, new NetworkId(0)); + + const leftPaddle = registry.spawnEntity(); + registry.addComponent(leftPaddle, new Position2D(20, 390)); + registry.addComponent(leftPaddle, new Velocity2D(0, 0)); + registry.addComponent(leftPaddle, new HitboxRect2D(30, 300)); + registry.addComponent(leftPaddle, new Paddle(1, 0, 67.5, 1.1)); + registry.addComponent(leftPaddle, new Seat(1, 1000)); + registry.addComponent(leftPaddle, new NetworkId(1)); + + const rightPaddle = registry.spawnEntity(); + registry.addComponent(rightPaddle, new Position2D(1870, 390)); + registry.addComponent(rightPaddle, new Velocity2D(0, 0)); + registry.addComponent(rightPaddle, new HitboxRect2D(30, 300)); + registry.addComponent(rightPaddle, new Paddle(-1, 0, 67.5, 1.1)); + registry.addComponent(rightPaddle, new Seat(2, 1000)); + registry.addComponent(rightPaddle, new NetworkId(2)); + + registry.addSystem(seatPlayers); + registry.addSystem(steerPaddles); + registry.addSystem(serveBall); + registry.addSystem(move2D); + registry.addSystem(blockPaddles); + registry.addSystem(bounceBall); + registry.addSystem(scoreGoals); + registry.addSystem(syncMoves); + + await app.run(); +}; diff --git a/demos/pong-network/apps/server/src/pong-protocol.ts b/demos/pong-network/apps/server/src/pong-protocol.ts new file mode 100644 index 0000000..c889517 --- /dev/null +++ b/demos/pong-network/apps/server/src/pong-protocol.ts @@ -0,0 +1,21 @@ +import { definePacket } from "@nanoforge-dev/network"; + +type Vector = { x: number; y: number }; +type Key = "up" | "down" | "stop"; + +const KEYS: unknown[] = ["up", "down", "stop"] satisfies Key[]; + +/** Sent once by a client to join: the server answers with `Seated`. */ +export const Play = definePacket("play"); + +/** The paddle a client plays: 1 (left), 2 (right), or 0 when it watches. */ +export const Seated = definePacket<{ paddle: number }>("seated"); + +/** Where a client wants its paddle to go. Anything else than the three keys is dropped. */ +export const Input = definePacket<{ key: Key }>("input", { + validate: (data): data is { key: Key } => + typeof data === "object" && data !== null && KEYS.includes((data as { key?: unknown }).key), +}); + +/** The position and velocity of the entity of `NetworkId` `id`, sent when its velocity changes. */ +export const Move = definePacket<{ id: number; position: Vector; velocity: Vector }>("move"); diff --git a/demos/pong-network/apps/server/src/systems/block-paddles.system.ts b/demos/pong-network/apps/server/src/systems/block-paddles.system.ts new file mode 100644 index 0000000..434c715 --- /dev/null +++ b/demos/pong-network/apps/server/src/systems/block-paddles.system.ts @@ -0,0 +1,28 @@ +import type { Registry } from "@nanoforge-dev/ecs"; + +import { overlap, pushOut } from "../collisions"; +import { HitboxRect2D } from "../components/hitbox-rect-2d.component"; +import { Paddle } from "../components/paddle.component"; +import { Position2D } from "../components/position-2d.component"; +import { Velocity2D } from "../components/velocity-2d.component"; +import { Wall } from "../components/wall.component"; + +/** + * Stops each `Paddle` at the `Wall` entities: pushed out of them, and stopped on that axis. Add it + * after `move2D`. + * + * @system + * @side shared + */ +export const blockPaddles = (registry: Registry) => { + const walls = registry.getZipper([Wall, Position2D, HitboxRect2D]); + + registry + .getZipper([Paddle, Position2D, Velocity2D, HitboxRect2D]) + .forEach(({ Position2D: paddle, Velocity2D: velocity, HitboxRect2D: box }) => { + for (const { Position2D, HitboxRect2D } of walls) { + if (overlap(paddle, box, Position2D, HitboxRect2D)) + pushOut(paddle, box, velocity, Position2D, HitboxRect2D, false); + } + }); +}; diff --git a/demos/pong-network/apps/server/src/systems/bounce-ball.system.ts b/demos/pong-network/apps/server/src/systems/bounce-ball.system.ts new file mode 100644 index 0000000..3dd79f5 --- /dev/null +++ b/demos/pong-network/apps/server/src/systems/bounce-ball.system.ts @@ -0,0 +1,65 @@ +import type { Registry } from "@nanoforge-dev/ecs"; + +import { overlap, pushOut } from "../collisions"; +import { Ball } from "../components/ball.component"; +import { HitboxRect2D } from "../components/hitbox-rect-2d.component"; +import { Paddle } from "../components/paddle.component"; +import { Position2D } from "../components/position-2d.component"; +import { Velocity2D } from "../components/velocity-2d.component"; +import { Wall } from "../components/wall.component"; + +/** + * Bounces each `Ball` off the `Paddle` it moves into, or else off the first `Wall` it touches. + * Add it after `move2D`. + * + * @remarks + * Off a paddle, the ball leaves in the paddle's direction, turned toward the end it hit, up to + * the paddle's `maxAngle`, and `speedUp` times faster, up to its `maxSpeed` (a ball already + * faster keeps its speed). Off a wall, it goes back on the axis it went in the least, and the + * wall counts a hit. + * + * @system + * @side shared + */ +export const bounceBall = (registry: Registry) => { + const paddles = registry.getZipper([Paddle, Position2D, HitboxRect2D]); + const walls = registry.getZipper([Wall, Position2D, HitboxRect2D]); + + registry + .getZipper([Ball, Position2D, Velocity2D, HitboxRect2D]) + .forEach(({ Position2D: ball, Velocity2D: velocity, HitboxRect2D: box }) => { + const hit = paddles.find( + ({ Paddle: paddle, Position2D, HitboxRect2D }) => + velocity.x * paddle.normalX + velocity.y * paddle.normalY < 0 && + overlap(ball, box, Position2D, HitboxRect2D), + ); + if (hit) { + const { Paddle: paddle, Position2D: at, HitboxRect2D: size } = hit; + // Along the paddle: its normal turned a quarter clockwise. + const alongX = -paddle.normalY; + const alongY = paddle.normalX; + const length = Math.abs(alongX) * size.width + Math.abs(alongY) * size.height; + const offset = + (alongX * (ball.x + box.width / 2 - at.x - size.width / 2) + + alongY * (ball.y + box.height / 2 - at.y - size.height / 2)) / + (length / 2); + const angle = (Math.max(-1, Math.min(1, offset)) * paddle.maxAngle * Math.PI) / 180; + const before = Math.hypot(velocity.x, velocity.y); + const speed = Math.min(before * paddle.speedUp, Math.max(before, paddle.maxSpeed)); + velocity.x = speed * (paddle.normalX * Math.cos(angle) + alongX * Math.sin(angle)); + velocity.y = speed * (paddle.normalY * Math.cos(angle) + alongY * Math.sin(angle)); + if (paddle.normalX > 0) ball.x = at.x + size.width; + if (paddle.normalX < 0) ball.x = at.x - box.width; + if (paddle.normalY > 0) ball.y = at.y + size.height; + if (paddle.normalY < 0) ball.y = at.y - box.height; + return; + } + + const wall = walls.find(({ Position2D, HitboxRect2D }) => + overlap(ball, box, Position2D, HitboxRect2D), + ); + if (!wall) return; + pushOut(ball, box, velocity, wall.Position2D, wall.HitboxRect2D, true); + wall.Wall.hits++; + }); +}; diff --git a/demos/pong-network/apps/server/src/systems/move-2d.system.ts b/demos/pong-network/apps/server/src/systems/move-2d.system.ts new file mode 100644 index 0000000..514766a --- /dev/null +++ b/demos/pong-network/apps/server/src/systems/move-2d.system.ts @@ -0,0 +1,26 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; + +import { Acceleration2D } from "../components/acceleration-2d.component"; +import { Position2D } from "../components/position-2d.component"; +import { Velocity2D } from "../components/velocity-2d.component"; + +/** + * Moves entities: their `Acceleration2D` changes their `Velocity2D`, then their `Velocity2D` + * changes their `Position2D`, by the time elapsed since the last frame. + * + * @system + * @side shared + */ +export const move2D = (registry: Registry, ctx: Context) => { + const seconds = ctx.app.delta / 1000; + + registry.getZipper([Acceleration2D, Velocity2D]).forEach(({ Acceleration2D, Velocity2D }) => { + Velocity2D.x += Acceleration2D.x * seconds; + Velocity2D.y += Acceleration2D.y * seconds; + }); + registry.getZipper([Position2D, Velocity2D]).forEach(({ Position2D, Velocity2D }) => { + Position2D.x += Velocity2D.x * seconds; + Position2D.y += Velocity2D.y * seconds; + }); +}; diff --git a/demos/pong-network/apps/server/src/systems/score-goals.system.ts b/demos/pong-network/apps/server/src/systems/score-goals.system.ts new file mode 100644 index 0000000..b53a7cd --- /dev/null +++ b/demos/pong-network/apps/server/src/systems/score-goals.system.ts @@ -0,0 +1,78 @@ +import type { Registry } from "@nanoforge-dev/ecs"; + +import { overlap } from "../collisions"; +import { Ball } from "../components/ball.component"; +import { Goal } from "../components/goal.component"; +import { HitboxRect2D } from "../components/hitbox-rect-2d.component"; +import { Position2D } from "../components/position-2d.component"; +import { Serve } from "../components/serve.component"; +import { Velocity2D } from "../components/velocity-2d.component"; +import { Wall } from "../components/wall.component"; + +type Box = { Position2D: Position2D; HitboxRect2D: HitboxRect2D }; + +/** The goal nearest to (`x`, `y`) among those that span it on one axis, if any. */ +const goalAcross = (goals: T[], x: number, y: number): T | undefined => { + let nearest: T | undefined; + let best = Infinity; + for (const goal of goals) { + const { Position2D: at, HitboxRect2D: size } = goal; + const across = (x >= at.x && x <= at.x + size.width) || (y >= at.y && y <= at.y + size.height); + const distance = Math.hypot(at.x + size.width / 2 - x, at.y + size.height / 2 - y); + if (across && distance < best) { + best = distance; + nearest = goal; + } + } + return nearest; +}; + +/** + * Gives a point to a `Goal`'s player when a `Ball` enters it, and puts the ball back where its + * `Serve` says, to be served again. Add it after `move2D`. + * + * @remarks + * A ball whose center left the field (the box around every `Wall` and `Goal`) is served again + * too: a long frame (a hidden tab) can move it past a goal or a wall without touching it. It + * scores in the nearest goal it is in line with, past its goal line; through a wall, nobody + * scores. + * + * @system + * @side shared + */ +export const scoreGoals = (registry: Registry) => { + const goals = registry.getZipper([Goal, Position2D, HitboxRect2D]); + const walls = registry.getZipper([Wall, Position2D, HitboxRect2D]); + + let left = Infinity; + let top = Infinity; + let right = -Infinity; + let bottom = -Infinity; + const grow = ({ Position2D: at, HitboxRect2D: size }: Box) => { + left = Math.min(left, at.x); + top = Math.min(top, at.y); + right = Math.max(right, at.x + size.width); + bottom = Math.max(bottom, at.y + size.height); + }; + goals.forEach(grow); + walls.forEach(grow); + + registry + .getZipper([Ball, Serve, Position2D, Velocity2D, HitboxRect2D]) + .forEach(({ Serve: serve, Position2D: ball, Velocity2D: velocity, HitboxRect2D: box }) => { + const x = ball.x + box.width / 2; + const y = ball.y + box.height / 2; + const out = left <= right && (x < left || x > right || y < top || y > bottom); + const goal = + goals.find(({ Position2D, HitboxRect2D }) => + overlap(ball, box, Position2D, HitboxRect2D), + ) ?? (out ? goalAcross(goals, x, y) : undefined); + if (!goal && !out) return; + if (goal) goal.Goal.points++; + ball.x = serve.x; + ball.y = serve.y; + velocity.x = 0; + velocity.y = 0; + serve.wait = serve.delay; + }); +}; diff --git a/demos/pong-network/apps/server/src/systems/seat-players.system.ts b/demos/pong-network/apps/server/src/systems/seat-players.system.ts new file mode 100644 index 0000000..20eee85 --- /dev/null +++ b/demos/pong-network/apps/server/src/systems/seat-players.system.ts @@ -0,0 +1,34 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; + +import { NetworkId } from "../components/network-id.component"; +import { Seat } from "../components/seat.component"; +import { Velocity2D } from "../components/velocity-2d.component"; +import { Play, Seated } from "../pong-protocol"; + +/** + * Seats each client that sends `Play` on a free `Seat`, or as a watcher, tells it with `Seated`, + * and has the whole game sent again. A seat whose client left is freed, and its paddle stops. + * + * @system + * @side server + */ +export const seatPlayers = (registry: Registry, ctx: Context) => { + const seats = registry.getZipper([Seat, Velocity2D]); + + for (const { Seat: seat, Velocity2D: velocity } of seats) { + if (seat.client === undefined || ctx.network.getClientInfo(seat.client)) continue; + seat.client = undefined; + velocity.y = 0; + } + + for (const { clientId } of ctx.network.packets.read(Play)) { + if (seats.some(({ Seat }) => Seat.client === clientId)) continue; + const free = seats.find(({ Seat }) => Seat.client === undefined); + if (free) free.Seat.client = clientId; + ctx.network.packets.sendToClient(clientId, Seated, { paddle: free?.Seat.player ?? 0 }); + registry.getZipper([NetworkId]).forEach(({ NetworkId }) => { + NetworkId.sentX = Number.NaN; + }); + } +}; diff --git a/demos/pong-network/apps/server/src/systems/serve-ball.system.ts b/demos/pong-network/apps/server/src/systems/serve-ball.system.ts new file mode 100644 index 0000000..e0aa1ab --- /dev/null +++ b/demos/pong-network/apps/server/src/systems/serve-ball.system.ts @@ -0,0 +1,24 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; + +import { Serve } from "../components/serve.component"; +import { Velocity2D } from "../components/velocity-2d.component"; + +/** + * Serves each `Serve` entity once its wait is over: horizontally, at its speed, toward each side + * in turn. + * + * @system + * @side shared + */ +export const serveBall = (registry: Registry, ctx: Context) => { + registry.getZipper([Serve, Velocity2D]).forEach(({ Serve: serve, Velocity2D: velocity }) => { + if (serve.wait <= 0) return; + serve.wait -= ctx.app.delta / 1000; + if (serve.wait > 0) return; + serve.wait = 0; + velocity.x = serve.side * serve.speed; + velocity.y = 0; + serve.side = -serve.side; + }); +}; diff --git a/demos/pong-network/apps/server/src/systems/steer-paddles.system.ts b/demos/pong-network/apps/server/src/systems/steer-paddles.system.ts new file mode 100644 index 0000000..993b2cb --- /dev/null +++ b/demos/pong-network/apps/server/src/systems/steer-paddles.system.ts @@ -0,0 +1,24 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; + +import { Seat } from "../components/seat.component"; +import { Velocity2D } from "../components/velocity-2d.component"; +import { Input } from "../pong-protocol"; + +const DIRECTIONS = { up: -1, down: 1, stop: 0 }; + +/** + * Moves each `Seat`'s paddle as its client's `Input` says. Inputs of clients without a seat are + * ignored. + * + * @system + * @side server + */ +export const steerPaddles = (registry: Registry, ctx: Context) => { + const seats = registry.getZipper([Seat, Velocity2D]); + + for (const { clientId, data } of ctx.network.packets.read(Input)) { + const seat = seats.find(({ Seat }) => Seat.client === clientId); + if (seat) seat.Velocity2D.y = DIRECTIONS[data.key] * seat.Seat.speed; + } +}; diff --git a/demos/pong-network/apps/server/src/systems/sync-moves.system.ts b/demos/pong-network/apps/server/src/systems/sync-moves.system.ts new file mode 100644 index 0000000..7170009 --- /dev/null +++ b/demos/pong-network/apps/server/src/systems/sync-moves.system.ts @@ -0,0 +1,29 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; + +import { NetworkId } from "../components/network-id.component"; +import { Position2D } from "../components/position-2d.component"; +import { Velocity2D } from "../components/velocity-2d.component"; +import { Move } from "../pong-protocol"; + +/** + * Sends a `Move` to every client for each `NetworkId` entity whose velocity changed: the clients + * move it the same way until the next one. Add it last. + * + * @system + * @side server + */ +export const syncMoves = (registry: Registry, ctx: Context) => { + registry + .getZipper([NetworkId, Position2D, Velocity2D]) + .forEach(({ NetworkId: sync, Position2D: position, Velocity2D: velocity }) => { + if (velocity.x === sync.sentX && velocity.y === sync.sentY) return; + ctx.network.packets.sendToAll(Move, { + id: sync.id, + position: { x: position.x, y: position.y }, + velocity: { x: velocity.x, y: velocity.y }, + }); + sync.sentX = velocity.x; + sync.sentY = velocity.y; + }); +}; diff --git a/demos/pong-network/apps/server/tsconfig.json b/demos/pong-network/apps/server/tsconfig.json new file mode 100644 index 0000000..c0ae4f2 --- /dev/null +++ b/demos/pong-network/apps/server/tsconfig.json @@ -0,0 +1,39 @@ +{ + "$schema": "https://json.schemastore.org/tsconfig.json", + // Mapped from https://www.typescriptlang.org/tsconfig + "compilerOptions": { + // Type Checking + "allowUnreachableCode": false, + "allowUnusedLabels": false, + "noFallthroughCasesInSwitch": true, + "noImplicitOverride": true, + "noImplicitReturns": true, + "noPropertyAccessFromIndexSignature": false, + "noUncheckedIndexedAccess": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "strict": true, + + // Modules + "allowArbitraryExtensions": false, + "allowImportingTsExtensions": false, + "module": "ESNext", + "moduleResolution": "Bundler", + "resolveJsonModule": true, + "resolvePackageJsonExports": true, + "resolvePackageJsonImports": true, + + // Interop Constraints + "allowSyntheticDefaultImports": true, + "forceConsistentCasingInFileNames": true, + "isolatedModules": true, + + // Language and Environment + "experimentalDecorators": true, + "lib": ["ESNext", "esnext.disposable", "DOM"], + "target": "ESNext", + "useDefineForClassFields": true + }, + "include": ["src"], + "exclude": ["node_modules", ".nanoforge", "dist"] +} diff --git a/demos/pong-network/nanoforge.config.ts b/demos/pong-network/nanoforge.config.ts new file mode 100644 index 0000000..99f2478 --- /dev/null +++ b/demos/pong-network/nanoforge.config.ts @@ -0,0 +1,6 @@ +import { defineConfig } from "@nanoforge-dev/config"; + +export default defineConfig({ + type: "workspace", + packages: ["apps/*"], +}); diff --git a/demos/pong-network/package.json b/demos/pong-network/package.json new file mode 100644 index 0000000..f542dd7 --- /dev/null +++ b/demos/pong-network/package.json @@ -0,0 +1,18 @@ +{ + "$schema": "https://json.schemastore.org/package.json", + "name": "pong-network", + "description": "Pong for two players over the network: the server runs the game", + "private": true, + "type": "module", + "scripts": { + "dev": "nf dev", + "build": "nf build", + "start": "nf start", + "editor": "nf editor ." + }, + "devDependencies": { + "@nanoforge-dev/cli": "^3.0.1", + "@nanoforge-dev/config": "^3.0.1", + "typescript": "^6.0.0" + } +} diff --git a/demos/pong-network/pnpm-lock.yaml b/demos/pong-network/pnpm-lock.yaml new file mode 100644 index 0000000..5d373a7 --- /dev/null +++ b/demos/pong-network/pnpm-lock.yaml @@ -0,0 +1,1665 @@ +lockfileVersion: '9.0' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + +importers: + + .: + devDependencies: + '@nanoforge-dev/cli': + specifier: ^3.0.1 + version: 3.0.1 + '@nanoforge-dev/config': + specifier: ^3.0.1 + version: 3.0.1 + typescript: + specifier: ^6.0.0 + version: 6.0.3 + + apps/client: + devDependencies: + '@nanoforge-dev/asset': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/common': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/core': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/ecs': + specifier: ^3.0.0 + version: 3.0.0(@nanoforge-dev/editor-lib@3.0.0) + '@nanoforge-dev/editor-lib': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/env': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/graphics-2d': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/input': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/network': + specifier: ^3.0.0 + version: 3.0.0(@nanoforge-dev/editor-lib@3.0.0) + typescript: + specifier: ^6.0.0 + version: 6.0.3 + + apps/server: + devDependencies: + '@nanoforge-dev/asset': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/common': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/core': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/ecs': + specifier: ^3.0.0 + version: 3.0.0(@nanoforge-dev/editor-lib@3.0.0) + '@nanoforge-dev/editor-lib': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/env': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/network': + specifier: ^3.0.0 + version: 3.0.0(@nanoforge-dev/editor-lib@3.0.0) + typescript: + specifier: ^6.0.0 + version: 6.0.3 + +packages: + + '@angular-devkit/core@22.2.7': + resolution: {integrity: sha512-cchZAMsV4d76RDZBlWzPhYxM/Hb6bmq71oUngdrwehMbBbdQu3W9C2tGlvxuPxbRKru9ZlUa14YVXQ0+QnhFtw==} + engines: {node: ^22.22.3 || ^24.15.0 || >=26.0.0, npm: ^6.11.0 || ^7.5.6 || >=8.0.0, yarn: '>= 1.13.0'} + peerDependencies: + chokidar: ^5.0.0 + peerDependenciesMeta: + chokidar: + optional: true + + '@angular-devkit/schematics-cli@22.2.7': + resolution: {integrity: sha512-9Od0E8TiYTQWm/03QjYWnsryZA8ZSjTf/k5z61nPd/jgloVNvSW8kxC7/YMw+RoXh2idMzjiJxraKxg+gJxzPw==} + engines: {node: ^22.22.3 || ^24.15.0 || >=26.0.0, npm: ^6.11.0 || ^7.5.6 || >=8.0.0, yarn: '>= 1.13.0'} + hasBin: true + + '@angular-devkit/schematics@22.2.7': + resolution: {integrity: sha512-a1h7xNqBLQVo1e5eCyOU3axSbA9AFU6nnSH5QhlNhggfMeZde+eBrueSt25xsewoxlKO8EvkVT3+knMUkDYiGQ==} + engines: {node: ^22.22.3 || ^24.15.0 || >=26.0.0, npm: ^6.11.0 || ^7.5.6 || >=8.0.0, yarn: '>= 1.13.0'} + + '@emnapi/core@2.0.0-beta.2': + resolution: {integrity: sha512-MzCVoWtcg4Pm2B3je5mMvYMvj3MmBKw+fU7vbsJc9/iT8ip6/eYIHo/Dsm/mr+wsHB6SEyJDuxB09Yy6r/8+4A==} + + '@emnapi/runtime@2.0.0-beta.2': + resolution: {integrity: sha512-JcrSPzPvZuNZvJqPTF9Fw25LbOJ8avzFVlaf2grmH4Cku0oGP47tRgqPZadcfj3YoZMHkFVnCYFbQM8I+i5QEw==} + + '@emnapi/wasi-threads@2.2.0': + resolution: {integrity: sha512-JP7OYH38Q7+pyTAe14raZHLQIK7BDKbdwji+Xi3pcd/6QkJYQH3SX4wu6EplGrGJWRepoNzedfm0G3B9Z4e9Rw==} + + '@inquirer/ansi@2.1.0': + resolution: {integrity: sha512-63GU5AD9KhNbWM0jlhHoMJTEFck2upFOPxHlnCKf3xYTV3rjTUUQfodihmTnfYQzMLS29oy8lK/gA1eJgu4bhA==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + + '@inquirer/checkbox@5.3.0': + resolution: {integrity: sha512-3QQSO87A+JoRtOtjtsgX2enwTL+3+VBVrkUpdqrIxMOgn5+W5sE57PcCPAiNUIESHxV4Q6mNEGxq2xLmRa0/yw==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/confirm@6.4.0': + resolution: {integrity: sha512-+DCZxrOF01Q/1SzTQkgycAQPS/Jf+Yol0h1P/MVmopukTsxGOu1h/LKqf30y0eHKFZYYrgUMVhGDhEbPmSPi9A==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/core@12.1.0': + resolution: {integrity: sha512-6H7usRWw4Gdjgpaem10CA5MfZ/xoYPGyInriR1Xubqjv+SVo8LIJ1erpFxW5JgCza6VZVZiKLTko7RtUU3AQMg==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/editor@5.4.0': + resolution: {integrity: sha512-L7vdCe4jnMpzhDisu1tAnr4WGvfPOVz+vNFXyIIL7O2Ycn/n90sn1ARvg+4cwzLf+us51BE/cX7uhnrLcal3+g==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/expand@5.2.0': + resolution: {integrity: sha512-AOp2KQk7QojUyWOP7VkqdBWmxLRaVH58wQMx3N4//P530EDtpVp1EWIjAJubx9ZohWS/UCEpIkA1TuiNki0iOA==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/external-editor@3.1.0': + resolution: {integrity: sha512-27JAkF38nXqXaoveU28iA/+Z8nutnF8B3JsbdToPHn9WnkrsMtZ0/YoJ29YwbtFexYIo+tIy6ikMvTdHKjjmGA==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/figures@2.1.0': + resolution: {integrity: sha512-CR9u2PME23jxy2SOyTb117efwAAPm98Zr+LoWI+PiQ55D6U8Yeu/HyFTxwytKhPa6oxAGzdsm2Kg7oLS6B9z8w==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + + '@inquirer/input@5.2.0': + resolution: {integrity: sha512-sIUPnN2X7M+7dq3RUd+e9QRacYnM+6B+kSucwQgj5VC5Eo/f+CIr2NyPBumxsViI+wzfokkgop/3x3KfHxNyJw==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/number@4.3.0': + resolution: {integrity: sha512-xYkX4sPVgox0F7yQwpz/MByWjOGdLEf1pdjH+Lji2gAzSs2xezz5bN5YgS1n0tx9wo0mRhGvq1KJGtvDZ9XXcQ==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/password@5.3.0': + resolution: {integrity: sha512-KVqW4G/UbMK06uBN76xF89JKYC9YBWU7v+Kc2tUwMCO8pg3ASBr0HVabl1KaSqF94O2KiRu8aKx4EicN78PK+A==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/prompts@8.7.2': + resolution: {integrity: sha512-QoRB4wFIjgH5iOhSjoIKMkTvSHDuV+O3OITlIqAYO0oK5x364GJILXiMBvlPiE+klg7Xx9tq5XVqQHcGUDYYPA==} + engines: {node: '>=23.5.0 || ^22.13.0 || ^20.17.0'} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/prompts@8.8.0': + resolution: {integrity: sha512-yYVT2Eo3mafb9tnU2Mr3+wh5wLCWyspExqVoPSMCIfBIn3ZUTE4IDfbCMbMgXaOH0tH+JZEhOtfczQhDzOjIGg==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/rawlist@5.4.0': + resolution: {integrity: sha512-x42wcy465GM5/mHNKBFdAJbLlLyzmYqr/DEa6F49nHpI+03EFwRCRKeLGQakx5XqZ4unc2yFuS78qAD4Rb0iFA==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/search@4.4.0': + resolution: {integrity: sha512-UJ+9tkzPT1AjnvjuPFYcOdO3BVeN28bfSXajYRFZTRgA9OiNl4k2Nn2cHHPwiIDyPHlvOnmE9ZOHyXhPHtvb+A==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/select@5.3.0': + resolution: {integrity: sha512-Fmgfl0qjqCQo+/tjQpgnRXKh5N7/VpYcJh+AlYU2eHmHZLMGUBDzo+Gwc2ODzWJfXNRZmgaMhz4qULcO/C/rXg==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/type@4.3.0': + resolution: {integrity: sha512-/IA8q2nyjgyl0NGSjqiRXB8gh3We7Pzx9C0c+6Zoolu905jFc79anerrUG7+n65+qs310DRK43yi2WDI8nY59A==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@isaacs/fs-minipass@4.0.1': + resolution: {integrity: sha512-wgm9Ehl2jpeqP3zw/7mo3kRHFp5MEDhqAdwy1fTGkHAwnkGOVsgpvQhL8B5n1qlb01jV3n/bI0ZfZp5lWA1k4w==} + engines: {node: '>=18.0.0'} + + '@jridgewell/sourcemap-codec@1.6.0': + resolution: {integrity: sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw==} + + '@nanoforge-dev/asset@3.0.0': + resolution: {integrity: sha512-jqXcyCMbdcCCj7wZ/dyIpjY8hza02Pt/vY8KrNcaXTlxpTc9EE+VKuO5+fHdUXWWPgJSFt96TqAPhug+z+KH3Q==} + engines: {node: '26'} + + '@nanoforge-dev/cli@3.0.1': + resolution: {integrity: sha512-ZfrbETcAcX3vsPLO1WLSCJc2ERCAcIpbdi9Df5bmH3XLinQkDAcESkN9JkaI/vgV08A7xhTjV8zSDSwF0T73Xg==} + engines: {node: '26'} + hasBin: true + + '@nanoforge-dev/common@3.0.0': + resolution: {integrity: sha512-lzMvQ1vCElh9OcP4EqhffbY+AQXOH4IiuD1pj7VvJlpcY6hh7Bs/s4NVS0gXoJ+ibpBMe5mAq23RyzqTwk8czg==} + engines: {node: '26'} + + '@nanoforge-dev/config@3.0.1': + resolution: {integrity: sha512-XWRScOotb8IirerRx/mWLmUVYye3lo0PN/5a0MUp/eoSrhz0S6zzhGHEupRuC8aeHTjsQT7ctM3P6YyKSHZLaQ==} + engines: {node: '26'} + + '@nanoforge-dev/core@3.0.0': + resolution: {integrity: sha512-pa7Fr3TFkZVfAADBC17Qt5ru/W9vXtYB8e5eb7wurAtu8/jH/ZtqfW3kafTuWC9513MXp/h6LOCdZQhjnCt6UA==} + engines: {node: '26'} + + '@nanoforge-dev/ecs@3.0.0': + resolution: {integrity: sha512-csrXJtCzqohxtvEQs+O//xabnaLR3BXe0QpSpl7NVihF3f0iX2fNYURxNjQKxzoPYBokCnnyNxN2KFc7UmIsdA==} + engines: {node: '26'} + peerDependencies: + '@nanoforge-dev/editor-lib': 3.0.0 + '@nanoforge-dev/scene': 3.0.0 + peerDependenciesMeta: + '@nanoforge-dev/editor-lib': + optional: true + '@nanoforge-dev/scene': + optional: true + + '@nanoforge-dev/editor-lib@3.0.0': + resolution: {integrity: sha512-fSWm6bHelbxqeVESYoUUKDi9RGNxvRu6p1r41KE1DddM0RrP0/WzkFOWBvgl+psHbYNotXe723Y2Fd3p+tqPDQ==} + engines: {node: '26'} + + '@nanoforge-dev/editor@0.1.4': + resolution: {integrity: sha512-bqbrH8ulFSiZz1iisJHtHeEzj1RV/70uErCYHeW4DIhVPsWbBfWKFvg/ghAbmPk5vsj0YnhDX6DSpik4S1QoiQ==} + engines: {node: '25'} + + '@nanoforge-dev/env@3.0.0': + resolution: {integrity: sha512-kXYXl9/09Bn8VStTTFuZY3dYDG9b76VhOi9PHMnaLe75XcFRLKJ2dYkXf3ut6RCL2+6H7HAEIOALjR15CHnJ5A==} + engines: {node: '26'} + + '@nanoforge-dev/graphics-2d@3.0.0': + resolution: {integrity: sha512-0I0WUr5495jORdYR+HtyP4kmAfCMvixmG+EH/gE5bN33S8RO6/Ly4oMLZOLUywcDTAFuLn28BlHuVor2YfXrsg==} + engines: {node: '26'} + + '@nanoforge-dev/input@3.0.0': + resolution: {integrity: sha512-8pWU28c99VAvn37onNbVFfwXTgyQGxm5DVnTdBEzgrF3KPCzU77kEaexB1AWOlga+4qNGU7/XNm3hNZ+YS49Ig==} + engines: {node: '26'} + + '@nanoforge-dev/loader-client@1.7.0': + resolution: {integrity: sha512-zDj0yQ8cZyHHjAYDVIyB79mh4dK7WRgZG7Kc+d/43t2WX/pX2HqBVkpLcDPkA9cNOKpCRYWd3LyYISlz53gzyg==} + engines: {node: '26'} + + '@nanoforge-dev/loader-server@1.7.0': + resolution: {integrity: sha512-Yd/BYORhoar5znNSD7kGirAc1Al0q5t8iscbb07QWKeXWA+DLKjPSuKJC6ykysFkbs9HiZU59oOfxyvNL4h3Pw==} + engines: {node: '26'} + + '@nanoforge-dev/loader-website@1.7.0': + resolution: {integrity: sha512-x1fV3RYUUxru39sF5HJcfutNnifMMTIEHW92jgkR9gz06ZlZ+rQofuegXgAnEzs0dEXa+rhNQ/iXYbqOZvq6YQ==} + engines: {node: '26'} + + '@nanoforge-dev/network@3.0.0': + resolution: {integrity: sha512-T0+s6vmiBuY3/KPK8s4wYcqQju6YDpoIJgpJy6eTelUD2+cHkWjav4WjfXxfVsE89JVu7ariXoRD+VuozhjUpA==} + engines: {node: '26'} + peerDependencies: + '@nanoforge-dev/editor-lib': 3.0.0 + peerDependenciesMeta: + '@nanoforge-dev/editor-lib': + optional: true + + '@nanoforge-dev/registry@3.0.1': + resolution: {integrity: sha512-EzSaszYtrPldD5Do7jdQK3TLLb8uCirY6NQjKXkeGw31X+sUXor4h5GAaoxELWMzPnv9BbKtggSaVaQIt7s8IQ==} + engines: {node: '26'} + + '@nanoforge-dev/schematics@3.0.1': + resolution: {integrity: sha512-iK2vC0gPEh2mQ81IB4+jfGw/ZNOLMDnS9HRBXH5tWB0mdN5GA32viblhW0oYPX2/tWrLC9YiCPgEE4AL8Zwz6w==} + engines: {node: '26'} + + '@napi-rs/wasm-runtime@1.2.6': + resolution: {integrity: sha512-mRyDmEw9/fCDXCGfL1sbgIw/GUK0PVxRW4YwgPN61F3LQ+fSyoBFarJVzgGyhF6kRzEQZ0FejDqm4WLXSeqQmw==} + engines: {node: ^20.19.0 || ^22.13.0 || >=23.5.0} + peerDependencies: + '@emnapi/core': ^1.7.1 || 2.0.0-beta.2 + '@emnapi/runtime': ^1.7.1 || 2.0.0-beta.2 + + '@node-datachannel/android-arm64@0.33.6': + resolution: {integrity: sha512-UzSnd1vSN//3pqyvuufbaIQemvRfIHn/7DAy7wjoYk9tzkJp4SMk1FrNhkhmev89SH/h7yTac6PlGxGe5oHcKw==} + cpu: [arm64] + os: [android] + + '@node-datachannel/darwin-arm64@0.33.6': + resolution: {integrity: sha512-vE2fN6D0BJJ3yZo5guJo2j1q7JeQbl+VyIs6vbkjEp654tQtTo3y7a4l3xB0bwDD27TOlkOlaSLJQRj6ZXqQdQ==} + cpu: [arm64] + os: [darwin] + + '@node-datachannel/darwin-x64@0.33.6': + resolution: {integrity: sha512-EtRB2THMR11XMzbNhMEwaZtipaUxFz+PgeVx7hE+er6Ai1Fzzv7XexrMWDG11ahdpEZ8fAxlxuyELs33/WH1Cg==} + cpu: [x64] + os: [darwin] + + '@node-datachannel/linux-arm64-gnu@0.33.6': + resolution: {integrity: sha512-phMRjx8NEfW70i768LCQDEF2C6Q2vtYsS4DPXv/zbb2cJClaU5fjKFQfQ1XBCNIi1ClfpSd3Cl/rn/7SS+paTQ==} + cpu: [arm64] + os: [linux] + libc: [glibc] + + '@node-datachannel/linux-arm64-musl@0.33.6': + resolution: {integrity: sha512-T9bqllJ9YkpgqgRFEfsPpfgfMDXdA7CIiJ4c1XXGPLSeqVFgDbf/WCewkE7q4xA+tKRLoOOtc2XgMGwVnlxXVQ==} + cpu: [arm64] + os: [linux] + libc: [musl] + + '@node-datachannel/linux-x64-gnu@0.33.6': + resolution: {integrity: sha512-NUTbne64++ZxwEJ9uppAAmYnFAfJAggf7gboioPdhr13P17GTQRCUgmipYrh1V0D4333x6NCBZyQaNv0n4WmpQ==} + cpu: [x64] + os: [linux] + libc: [glibc] + + '@node-datachannel/linux-x64-musl@0.33.6': + resolution: {integrity: sha512-dlWP4ycOJrTAl9UvxGofq0zwPhl6iAr1b0ZcBUgDfb2CXmbcJWCvg6OsJ6u8BVSV41eNXALmaRpU0wttas/f1g==} + cpu: [x64] + os: [linux] + libc: [musl] + + '@node-datachannel/win32-arm64-msvc@0.33.6': + resolution: {integrity: sha512-ttly7XRUrSOcOOGJvtm9gh2beAPUNOBOUc3Hk82LfMHHP7jJMkXNDns/ML+UVGommAcNyPhoZkRH62O7tSVQYw==} + cpu: [arm64] + os: [win32] + + '@node-datachannel/win32-x64-msvc@0.33.6': + resolution: {integrity: sha512-N5GW6XH11Iuu+kyHLTiCMcCHdwWwpKqvtYril0LzQm6xBgmGQN3JXxFmgi4g4usw1nLy6WhBWADjbhSXJiiEMA==} + cpu: [x64] + os: [win32] + + '@oven/bun-darwin-aarch64@1.4.4': + resolution: {integrity: sha512-zW/hxwc8sJAILGwB5eTC4i48ouGXf0V4lrxmEOk3JIE6JkYVW1TZh1E2pIempqsezgW1sckTIIDudFON8bJ2Mw==} + cpu: [arm64] + os: [darwin] + + '@oven/bun-darwin-x64@1.4.4': + resolution: {integrity: sha512-oKGcxLsvh4oHjAo28nPm8c/xN0o/OmGyj1IHYc94vprkWsW2hNg2keEZt5f40cI5Hvu4jDlSRTR0UNpv1UIAxw==} + cpu: [x64] + os: [darwin] + + '@oven/bun-freebsd-aarch64@1.4.4': + resolution: {integrity: sha512-klvA9FlwLxZj3JYIOPQA4bbnHIC3uas8kBE4GaGGkeVgAQP/k8hAzYkOqkSaqHBDbxLrTyFEQArEAevJq6NJzg==} + cpu: [arm64] + os: [freebsd] + + '@oven/bun-freebsd-x64@1.4.4': + resolution: {integrity: sha512-sF1xS/scbyN94P2d0eTiarO6JHxrIvhZNT9hnWjQXW5nwKRtfuP+UYnIMNyvW1BQPcZFP/cvfLBNUIe1ea4zPA==} + cpu: [x64] + os: [freebsd] + + '@oven/bun-linux-aarch64-android@1.4.4': + resolution: {integrity: sha512-5lvn3at5vRC0GxvmiqEiV2/e23tnRi0q5pzR40yfDvDA3OW7PSkt4chF1nA9vnAJhro4/l+ol1FmNP6D3cf/oA==} + cpu: [arm64] + os: [android] + + '@oven/bun-linux-aarch64-musl@1.4.4': + resolution: {integrity: sha512-QFd0P+mHJxbZFbUla4MgiE5OwxysHaUIYxL2pPNkpWtaI7v4ShOpr8OhBmsuyB0xn5rv/ZJnPsj2y8+bB9+g/A==} + cpu: [arm64] + os: [linux] + libc: [musl] + + '@oven/bun-linux-aarch64@1.4.4': + resolution: {integrity: sha512-ZTVtpf9zmHSBVPX1sBwe5agGb/rN34yPGg/Hby8e2Ax2uCUA2URZKlZH7qLntK7qaFJCMXh9v0GWNYN2zINz1w==} + cpu: [arm64] + os: [linux] + libc: [glibc] + + '@oven/bun-linux-x64-android@1.4.4': + resolution: {integrity: sha512-3dMicj9C1DhaIfDkwt/9GtpU0W+q+GazbG9OIlEyL3Q1BBEz2e6ZRz/JiO8D/ECC0caXAqvnpFudehcLlgIwWQ==} + cpu: [x64] + os: [android] + + '@oven/bun-linux-x64-musl@1.4.4': + resolution: {integrity: sha512-lEEjNOJJrbGZu2NVcPI4uXdILcpspezWkA8R/Jr0RCGhM6zQd0Y7JBIIKNAmbX59EeWpeEz7Q78iLbpcAUypUA==} + cpu: [x64] + os: [linux] + libc: [musl] + + '@oven/bun-linux-x64@1.4.4': + resolution: {integrity: sha512-CHbbkmHVM28T1GFq+6GL4Ao4ujwwYwj1CxFFwEFzLanPfNsId9AhbIP0Q4reWuWBkGimUkoQygrK7Rgjtj3vog==} + cpu: [x64] + os: [linux] + libc: [glibc] + + '@oven/bun-windows-aarch64@1.4.4': + resolution: {integrity: sha512-n0ep5ZRPCZY1+dqFJpnnRUZB1wy4GYU6At8RF+pyzySCLjkN9R4rFh2PtBHAgF/lg1vOl3/CeER3pDM+p40ATA==} + cpu: [arm64] + os: [win32] + + '@oven/bun-windows-x64@1.4.4': + resolution: {integrity: sha512-a3LNctBVO8PjePsFZfwDleF2JXYf2BfQ1u/PLRnBDLnC2Riml+4+LgJpKj4xRGhB92KweGyQI5PXaTkP9qypMQ==} + cpu: [x64] + os: [win32] + + '@oxc-project/types@0.158.0': + resolution: {integrity: sha512-xZ66qA4WmLbTLlxH3mqMd8f9UKbaOzOT0ATwFf4DH/14pMgpUrtqtjyYzOQmgfl2a0iRAAMbQ9G1th/67jRzGw==} + + '@rolldown/binding-android-arm-eabi@1.3.2': + resolution: {integrity: sha512-kqR2xcygEx3WwDY69LsKeyf7SVmx4yzMtKZRknyaHieVJdRvvnAM97L0Gq6tUFc9T2YXcW/Ghij2+Um6He0LTw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [android] + + '@rolldown/binding-android-arm64@1.3.2': + resolution: {integrity: sha512-gXM4GAAvvIZA7qUuSCQS+Zz91H2fagKa5MNppUdjzysJ8LXMWm9D/gQj4nfOKo6okquDQ5pkjsuo2SUMXNW0Rw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [android] + + '@rolldown/binding-darwin-arm64@1.3.2': + resolution: {integrity: sha512-OBs5hp3W+LwMEUmDMMMnu08ncG0t6DDgnFU+6TAucKtAfNgerYLZSr2jtREKb/JuPQ1J7bJnWIgKKkxvjuAw1g==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [darwin] + + '@rolldown/binding-darwin-x64@1.3.2': + resolution: {integrity: sha512-X0VGYd4v/gdjfa/IP6uHuMhofPoUDYvK/byk3bC0jQ1pKKgt6RZ4B4puMqP0AHkjmIHAsxA471mM6AxZ39IaTA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [darwin] + + '@rolldown/binding-freebsd-x64@1.3.2': + resolution: {integrity: sha512-mr04K4cp9J/fj9fknrX8e4QvI/V48Sp+4v64PoLwhoirIH8b8L8EBrF/0bTjV1It2IL91hoNG13GblnWLglkxA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [freebsd] + + '@rolldown/binding-linux-arm-gnueabihf@1.3.2': + resolution: {integrity: sha512-VgWy02HU9Tiy6tU8U+kF3Fd4TQwTNdIBvs2MlgViP1ksMtAnQQTIPAj0ZsJzIQXKIOugqQSpqxQgELJ3fkuL5w==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [linux] + + '@rolldown/binding-linux-arm64-gnu@1.3.2': + resolution: {integrity: sha512-0wloJFYqV844gv6boiERbHpErxbxHbmlgnMX5VxP1Ux+DLBqGrUOn0cIpBmCZEcTITes3QUelxya4u8c9ziQvQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-arm64-musl@1.3.2': + resolution: {integrity: sha512-Kys8wgFQy8H8vua0MNpC0akMBFoNO8455RHk2yycBM0iayMIAtVAL6xmV9TWAkehFgrrlImTL2fZdX5LXfYtAA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + libc: [musl] + + '@rolldown/binding-linux-ppc64-gnu@1.3.2': + resolution: {integrity: sha512-L8eej7+/StRxUHHOPsOVl7Fzx/3tumuGB4hGQZKT73xRI16KZhaSJr0gi3C3WBjNRxeJRKKps2UD4lQukP+oBw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [ppc64] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-s390x-gnu@1.3.2': + resolution: {integrity: sha512-MV5CEb/nV8neQOj7l6945q1vy62HXtWO8zPDvfySPusoUzdBoLoJ/DfXXwaYThGTXZCniF+5bCf253WTPPK7Yw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [s390x] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-x64-gnu@1.3.2': + resolution: {integrity: sha512-3qssvvVvkwQookZ1/1avlKWc5orAR85vgKdzDd5noZS8nnHiI/ejOAEt0xfNYvtBBF7/DZmP8dANWkRBJVOBCA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-x64-musl@1.3.2': + resolution: {integrity: sha512-rJqoFTm/bCZFKKgaT4NzWn/TuJkFDToZ/rzYFnYVBL28jH1nIfg6snx2mDri30nal9H+wcYfKpoPR9jrMQgQQg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + libc: [musl] + + '@rolldown/binding-openharmony-arm64@1.3.2': + resolution: {integrity: sha512-ozdbCjHfh0N//wJNExjJlSlcDaeIKo8k1ktzkLUyESr2Gu/Qw7nBYxKe3jgtoaxda570vg10WdYosre82263hQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [openharmony] + + '@rolldown/binding-wasm32-wasi@1.3.2': + resolution: {integrity: sha512-p5VA6Vk/2cXZPVWf+dDbuE0dkhrcoAo6pISTJmzUnsSdQqNJdusyR8lZgHku095+r27zrYISNLZnJoqrcePW0A==} + engines: {node: ^20.19.0 || ^22.13.0 || >=23.5.0} + cpu: [wasm32] + + '@rolldown/binding-win32-arm64-msvc@1.3.2': + resolution: {integrity: sha512-XDb2U14Orf4r76SwzvJ7avePL00w4gHBmi1Ig4B/itYFEUTmYMNDHVU0dcYuBa0LgNBqyREoJOrQKxQlyYJA7A==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [win32] + + '@rolldown/binding-win32-x64-msvc@1.3.2': + resolution: {integrity: sha512-lEsKzKJqIUDZVCBhS4lkZuyQUhV1oRg5UHkI72qlOAqJn7qEXcoVdTridFS7PHNWdZknBl95EAF/4P1Xv0K1eQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [win32] + + '@rolldown/pluginutils@1.1.0': + resolution: {integrity: sha512-K+NU2HDCEem4sClgHH4ZZXwdJeNFkJo+hRk479DIwdIviAPN2hFJH1KHHwg8CxHQXvi0M5XY4deTXINfIiSG6w==} + + '@sindresorhus/is@4.6.0': + resolution: {integrity: sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==} + engines: {node: '>=10'} + + '@tybys/wasm-util@0.10.4': + resolution: {integrity: sha512-W3c4gRigFS0T/Ma4qIYF3GDAc5AQdHb1yL5znJT1Zv1YaD9Kitx656wBjvr19qbiosmZT8lWDM5BEMynUqX65A==} + + '@types/validator@13.15.10': + resolution: {integrity: sha512-T8L6i7wCuyoK8A/ZeLYt1+q0ty3Zb9+qbSSvrIVitzT3YjZqkTZ40IbRsPanlB4h1QB3JVL1SYCdR6ngtFYcuA==} + + ajv-formats@3.0.1: + resolution: {integrity: sha512-8iUql50EUR+uUcdRQ3HDqa6EVyo3docL8g5WJ3FNcWmu62IbkGUue/pEyLBW8VGKKucTPgqeks4fIU1DA4yowQ==} + peerDependencies: + ajv: ^8.0.0 + peerDependenciesMeta: + ajv: + optional: true + + ajv@8.20.0: + resolution: {integrity: sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA==} + + ansi-regex@6.6.0: + resolution: {integrity: sha512-XZ5apbzreCbXSKwPjJstu8R0zOi247w3XYwWxtwBXgpZrCyc1Ka7p9/xY0A9/diMewmHbEKz+FIraWaEWjlN5g==} + engines: {node: '>=12'} + + ansis@4.5.0: + resolution: {integrity: sha512-KwIVkfFfJSSzBmZhDGuTmkhWqTdyB5oNVzzznBJbBZ5bZtHiqSrcugRF0RKJKT4Ss3d7ZrcjnlFVDlQNmtWfWw==} + engines: {node: '>=14'} + + braces@3.0.3: + resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} + engines: {node: '>=8'} + + bun@1.4.4: + resolution: {integrity: sha512-hj0ASdG6PNjLZGFAXktWb3Uaj/dcv/1wCsIttoEXADNIQBsGjTr+5uLKYbrDkuc7NT0Tkj4yPIqJI2jDxXdvVg==} + cpu: [arm64, x64] + os: [darwin, linux, android, freebsd, win32] + hasBin: true + + bundle-name@4.1.1: + resolution: {integrity: sha512-DdH81/zPLVS11EUgWq3tEu/xn+EzljlMYooDNdzWEnFha3R3NBMpMV1UqYIpjYHV/SgpFKMIX1Oh7o06SjM/oA==} + engines: {node: '>=18'} + + chalk@5.6.2: + resolution: {integrity: sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA==} + engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} + + char-regex@1.0.2: + resolution: {integrity: sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==} + engines: {node: '>=10'} + + chardet@2.2.0: + resolution: {integrity: sha512-rddelWYNPRrXq6PtNEN2S3f6t9ILzvqaN5pVgi4kqt9jHQaXIial9PznB5iSPVlQSLNaaH22ItWz3EJtQ10+OA==} + + chokidar@5.0.0: + resolution: {integrity: sha512-TQMmc3w+5AxjpL8iIiwebF73dRDF4fBIieAqGn9RGCWaEVwQ6Fb2cGe31Yns0RRIzii5goJ1Y7xbMwo1TxMplw==} + engines: {node: '>= 20.19.0'} + + chownr@3.0.0: + resolution: {integrity: sha512-+IxzY9BZOQd/XuYPRmrvEVjF/nqj5kgT4kEq7VofrDoM1MxoRjEWkrCC3EtLi59TVawxTAn+orJwFQcrqEN1+g==} + engines: {node: '>=18'} + + class-transformer@0.5.1: + resolution: {integrity: sha512-SQa1Ws6hUbfC98vKGxZH3KFY0Y1lm5Zm0SY8XX9zbK7FJCyVEac3ATW0RIpwzW+oOfmHE5PMPufDG9hCfoEOMw==} + + class-validator@0.14.4: + resolution: {integrity: sha512-AwNusCCam51q703dW82x95tOqQp6oC9HNUl724KxJJOfnKscI8dOloXFgyez7LbTTKWuRBA37FScqVbJEoq8Yw==} + + class-validator@0.15.1: + resolution: {integrity: sha512-LqoS80HBBSCVhz/3KloUly0ovokxpdOLR++Al3J3+dHXWt9sTKlKd4eYtoxhxyUjoe5+UcIM+5k9MIxyBWnRTw==} + + cli-cursor@5.0.0: + resolution: {integrity: sha512-aCj4O5wKyszjMmDT4tZj93kxyydN/K5zPWSCe6/0AV/AA1pqe5ZBIw0a2ZfPQV7lL5/yb5HsUreJ6UFAF1tEQw==} + engines: {node: '>=18'} + + cli-spinners@3.4.0: + resolution: {integrity: sha512-bXfOC4QcT1tKXGorxL3wbJm6XJPDqEnij2gQ2m7ESQuE+/z9YFIWnl/5RpTiKWbMq3EVKR4fRLJGn6DVfu0mpw==} + engines: {node: '>=18.20'} + + cli-width@4.1.0: + resolution: {integrity: sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==} + engines: {node: '>= 12'} + + commander@15.1.0: + resolution: {integrity: sha512-cgnQ88TRrWcC7pVq46RzJVRMktu3W2RcbnoidnfBsl1bmDCBwJS/udcIZpKoCrbAYYaCqsz1yZCVIgbIaU3ddQ==} + engines: {node: '>=22.12.0'} + + default-browser-id@5.0.1: + resolution: {integrity: sha512-x1VCxdX4t+8wVfd1so/9w+vQ4vx7lKd2Qp5tDRutErwmR85OgmfX7RlLRMWafRMY7hbEiXIbudNrjOAPa/hL8Q==} + engines: {node: '>=18'} + + default-browser@5.5.1: + resolution: {integrity: sha512-m1pAzaJgZ/gssEqlOhJkPJp8Xly7QyW6xcrkUa2KKcDeDSEMP7X8xipU3snUcfisTQx0w1AGae+9UtJSfVnXGw==} + engines: {node: '>=18'} + + define-lazy-prop@3.0.0: + resolution: {integrity: sha512-N+MeXYoqr3pOgn8xfyRPREN7gHakLYjhsHhWGT3fWAiL4IkAt0iDw14QiiEm2bE30c5XX5q0FtAA3CK5f9/BUg==} + engines: {node: '>=12'} + + defu@6.1.7: + resolution: {integrity: sha512-7z22QmUWiQ/2d0KkdYmANbRUVABpZ9SNYyH5vx6PZ+nE5bcC0l7uFvEfHlyld/HcGBFTL536ClDt3DEcSlEJAQ==} + + destr@2.0.5: + resolution: {integrity: sha512-ugFTXCtDZunbzasqBxrK93Ik/DRYsO6S/fedkWEMKqt04xZ4csmnmwGDBAb07QWNaGMAmnTIemsYZCksjATwsA==} + + detect-libc@2.1.2: + resolution: {integrity: sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==} + engines: {node: '>=8'} + + dotenv@17.4.2: + resolution: {integrity: sha512-nI4U3TottKAcAD9LLud4Cb7b2QztQMUEfHbvhTH09bqXTxnSie8WnjPALV/WMCrJZ6UV/qHJ6L03OqO3LcdYZw==} + engines: {node: '>=12'} + + dotenv@18.0.10: + resolution: {integrity: sha512-89FAA1xchzK2mxVWdr5F/0rldwiueXs6zJM86rO66EzekR1iBdiXRthyG+m5GvkJaFH3C2LESzamTkgndmLT2A==} + engines: {node: '>=12'} + hasBin: true + + emojilib@2.4.0: + resolution: {integrity: sha512-5U0rVMU5Y2n2+ykNLQqMoqklN9ICBT/KsvC1Gz6vqHbz2AXXGkG+Pm5rMWk/8Vjrr/mY9985Hi8DYzn1F09Nyw==} + + fast-deep-equal@3.1.3: + resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} + + fast-string-truncated-width@3.0.3: + resolution: {integrity: sha512-0jjjIEL6+0jag3l2XWWizO64/aZVtpiGE3t0Zgqxv0DPuxiMjvB3M24fCyhZUO4KomJQPj3LTSUnDP3GpdwC0g==} + + fast-string-width@3.0.2: + resolution: {integrity: sha512-gX8LrtNEI5hq8DVUfRQMbr5lpaS4nMIWV+7XEbXk2b8kiQIizgnlr12B4dA3ZEx3308ze0O4Q1R+cHts8kyUJg==} + + fast-uri@3.1.9: + resolution: {integrity: sha512-hS/0Wt3Ya043oKXs0sIxrMpKQITXhMLIrVAKKXi4gozGC9v7YRWVnXIZzjNPTO02M9BdxLCWqK1yRXgNziVyJQ==} + + fast-wrap-ansi@0.2.2: + resolution: {integrity: sha512-7F2Fl+TjRSenLqlU3UjSH0iyqopqoZIu7eZVpEirP2g1GtWa2G/ecEmBdgz31+Mxr+ELclgg6sokpSFIQiZ02Q==} + + fflate@0.8.3: + resolution: {integrity: sha512-tbZNuJrLwGUp3zshBtdy4W+ORxZuIh8a5ilyIEQDC5rY1f3U20JMry0Ll3WBzU58EZKsEuJFXhb5gwv8CsPvgA==} + + fill-range@7.1.1: + resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} + engines: {node: '>=8'} + + get-east-asian-width@1.7.0: + resolution: {integrity: sha512-XjH1AECxf0giL2V1aU8vKyRR2ppRUb5c0EvT7zuJTokQ74bNo52zOtghqdWIqrhUD79fo3x0WfKZdOqxF6LG1Q==} + engines: {node: '>=18'} + + iconv-lite@0.7.3: + resolution: {integrity: sha512-IKXpvIzjnC9XTAUbVBcMfGS0EPaIXtW6v+zr+RRp+hqULEpo0owZax6wyRwPOJbWbzjYspQwusTsfVr0ifh4uQ==} + engines: {node: '>=0.10.0'} + + is-docker@3.0.0: + resolution: {integrity: sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + hasBin: true + + is-in-ssh@1.0.0: + resolution: {integrity: sha512-jYa6Q9rH90kR1vKB6NM7qqd1mge3Fx4Dhw5TVlK1MUBqhEOuCagrEHMevNuCcbECmXZ0ThXkRm+Ymr51HwEPAw==} + engines: {node: '>=20'} + + is-inside-container@1.0.0: + resolution: {integrity: sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA==} + engines: {node: '>=14.16'} + hasBin: true + + is-interactive@2.0.0: + resolution: {integrity: sha512-qP1vozQRI+BMOPcjFzrjXuQvdak2pHNUMZoeG2eRbiSqyvbEf/wQtEOTOX1guk6E3t36RkaqiSt8A/6YElNxLQ==} + engines: {node: '>=12'} + + is-number@7.0.0: + resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} + engines: {node: '>=0.12.0'} + + is-unicode-supported@2.1.0: + resolution: {integrity: sha512-mE00Gnza5EEB3Ds0HfMyllZzbBrmLOX3vfWoj9A9PEnTfratQ/BcaJOuMhnkhjXvb2+FkY3VuHqtAGpTPmglFQ==} + engines: {node: '>=18'} + + is-wsl@3.1.1: + resolution: {integrity: sha512-e6rvdUCiQCAuumZslxRJWR/Doq4VpPR82kqclvcS0efgt430SlGIk05vdCN58+VrzgtIcfNODjozVielycD4Sw==} + engines: {node: '>=16'} + + json-schema-traverse@1.0.0: + resolution: {integrity: sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==} + + jsonc-parser@3.3.1: + resolution: {integrity: sha512-HUgH65KyejrUFPvHFPbqOY0rsFip3Bo5wb4ngvdi1EpCYWUQDC5V+Y7mZws+DLkr4M//zQJoanu1SP+87Dv1oQ==} + + konva@10.9.1: + resolution: {integrity: sha512-m49x+GatSxEUSvqahYhxpTjgKbtrLtw4P4o4B4iux953ZFpceaK52Ea+CFsAsd7W4I0Y5u6mMoRUsY/eltNZmw==} + peerDependencies: + canvas: ^3.0.0 + skia-canvas: ^3.0.0 + peerDependenciesMeta: + canvas: + optional: true + skia-canvas: + optional: true + + libphonenumber-js@1.13.16: + resolution: {integrity: sha512-tIOCM9yx2Go6d5/ZANe0K+G4AZek1Ymx81HxQpf19Sri4zMP95eQbKdnUGHAvFQ4nx0PeLhFqvAfisTADXj3tQ==} + + log-symbols@7.0.1: + resolution: {integrity: sha512-ja1E3yCr9i/0hmBVaM0bfwDjnGy8I/s6PP4DFp+yP+a+mrHO4Rm7DtmnqROTUkHIkqffC84YY7AeqX6oFk0WFg==} + engines: {node: '>=18'} + + magic-string@1.4.1: + resolution: {integrity: sha512-8lyCu36ErXR0J9uaGKlKQoiLZKmtI63YGLE8G2o9jyRPdr4X47LusSOwgOJOzcVtp81fTAAjxR7BwKz682Jhow==} + + micromatch@4.0.8: + resolution: {integrity: sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==} + engines: {node: '>=8.6'} + + mimic-function@5.0.1: + resolution: {integrity: sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==} + engines: {node: '>=18'} + + minipass@7.1.3: + resolution: {integrity: sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A==} + engines: {node: '>=16 || 14 >=14.17'} + + minizlib@3.1.0: + resolution: {integrity: sha512-KZxYo1BUkWD2TVFLr0MQoM8vUUigWD3LlD83a/75BqC+4qE0Hb1Vo5v1FgcfaNXvfXzr+5EhQ6ing/CaBijTlw==} + engines: {node: '>= 18'} + + mute-stream@4.0.0: + resolution: {integrity: sha512-gSrprq0fJ3EiOErzjdIZrjysVVmJ4uu1QWfCDss5LypA5OXvrMje5Ym5z6V6RLyJ2eF87lasX7t6a0AnFvZblg==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + + node-datachannel@0.33.6: + resolution: {integrity: sha512-n7RzImzysrOVFx/lXfkQQ4fL0wsuPXBFc8KM69V29iyIor/UX7Ej+edzNGWJm+3mApZG9nkLi7FsGAZhQCDA4w==} + engines: {node: '>=18.20.0'} + + node-emoji@2.2.0: + resolution: {integrity: sha512-Z3lTE9pLaJF47NyMhd4ww1yFTAP8YhYI8SleJiHzM46Fgpm5cnNzSl9XfzFNqbaz+VlJrIj3fXQ4DeN1Rjm6cw==} + engines: {node: '>=18'} + + onetime@7.0.0: + resolution: {integrity: sha512-VXJjc87FScF88uafS3JllDgvAm+c/Slfz06lorj2uAY34rlUu0Nt+v8wreiImcrgAjjIHp1rXpTDlLOGw29WwQ==} + engines: {node: '>=18'} + + open@11.0.4: + resolution: {integrity: sha512-++Zlftm0kVLPmzC06t6epuWmcRMDbI4z5P3NNX979WA/k23+NtSOynEGzsVfZwguKw2mi5umVgnBlJQMwRz4Pg==} + engines: {node: '>=20'} + + ora@9.4.1: + resolution: {integrity: sha512-6VlU9MLXbjVQD04AZCMX28hVtA5bUoadvUqO76MUCVA0ilwJbMiHsITRPfyVm6p/BC0Av/BXMujx39WCe1LEqw==} + engines: {node: '>=20'} + + picomatch@2.3.2: + resolution: {integrity: sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==} + engines: {node: '>=8.6'} + + picomatch@4.0.7: + resolution: {integrity: sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA==} + engines: {node: '>=12'} + + powershell-utils@0.2.1: + resolution: {integrity: sha512-C+y9x90UElAddDZmV4qOx9W53B61PO7cIqWz2dQsWlwswuq4mr8NEwytdGKboYbQlGZ3awrkTeNvcZiZNHnQ8A==} + engines: {node: '>=20'} + + rc9@3.1.0: + resolution: {integrity: sha512-ufjkNVzbRHKcCOmTahZkmVsyc3W+MSk3jY03m+a7tGHkIsdVMG9l10/3HvFbWkkKzY5VFp3pkRsIo/UYgmFL7Q==} + + readdirp@5.1.1: + resolution: {integrity: sha512-Kko+Y5XQ6fM+Ce3dq3m9YGxnacYZYl9cA1wZjaF3Vbry2L3i1qVg8+CAgNPsXRArPMUMCaOR7oa9Nqntc43JKA==} + engines: {node: '>= 20.19.0'} + + require-from-string@2.0.2: + resolution: {integrity: sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==} + engines: {node: '>=0.10.0'} + + restore-cursor@5.1.0: + resolution: {integrity: sha512-oMA2dcrw6u0YfxJQXm342bFKX/E4sG9rbTzO9ptUcR/e8A33cHuvStiYOwH7fszkZlZ1z/ta9AAoPk2F4qIOHA==} + engines: {node: '>=18'} + + rolldown@1.3.2: + resolution: {integrity: sha512-EFHqbVkXiYZA6akmYm2bvJhNbEGdUwAResRhYwl/BO8QhB5KxsG+t3RVHJSIOy5jBEb0XCACvrIGnnl6Z8sMGA==} + engines: {node: ^20.19.0 || >=22.12.0} + hasBin: true + + run-applescript@7.1.0: + resolution: {integrity: sha512-DPe5pVFaAsinSaV6QjQ6gdiedWDcRCbUuiQfQa2wmWV7+xC9bGulGI8+TdRmoFkAPaBXk8CrAbnlY2ISniJ47Q==} + engines: {node: '>=18'} + + rxjs@7.8.2: + resolution: {integrity: sha512-dhKf903U/PQZY6boNNtAGdWbG85WAbjT/1xYoZIC7FAY0yWapOBQVsVrDl58W86//e1VpMNBtRV4MaXfdMySFA==} + + safer-buffer@2.1.2: + resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} + + semver@7.8.6: + resolution: {integrity: sha512-9lpSSU4Mly3mrtruwLs1eLK6+gzbzqeBFwRNjIjE+9LuDpWdYctrQlQ3ej1Ilgi7gknpsTRnPoLP8DpCHqHIJw==} + engines: {node: '>=10'} + hasBin: true + + signal-exit@4.1.0: + resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} + engines: {node: '>=14'} + + skin-tone@2.0.0: + resolution: {integrity: sha512-kUMbT1oBJCpgrnKoSr0o6wPtvRWT9W9UKvGLwfJYO2WuahZRHOpEyL1ckyMGgMWh0UdpmaoFqKKD29WTomNEGA==} + engines: {node: '>=8'} + + source-map@0.8.0: + resolution: {integrity: sha512-d8EqvL+k/SOXCreS/SUzg2ciyHqBBLcN/yuRjFsbvVhHTE2pgei7oAhmPM7kWFbkX6OSMQfUq4KbkF3au9lhYQ==} + engines: {node: '>= 12'} + + stdin-discarder@0.3.2: + resolution: {integrity: sha512-eCPu1qRxPVkl5605OTWF8Wz40b4Mf45NY5LQmVPQ599knfs5QhASUm9GbJ5BDMDOXgrnh0wyEdvzmL//YMlw0A==} + engines: {node: '>=18'} + + string-width@8.3.0: + resolution: {integrity: sha512-ZbmZM0JCihQN91dWnxoipT2KOEyHqEyfRXUyjuRhW8b/xnqPDoq4gWEVApTVa9db2wN8mmoikgFBbjh71+cGeQ==} + engines: {node: '>=20'} + + strip-ansi@7.2.0: + resolution: {integrity: sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==} + engines: {node: '>=12'} + + tar@7.5.23: + resolution: {integrity: sha512-lkukzdoGngZHJZXxW4S/E4Fp9ghTDlyZXrQGRNoJ/LXvDKcXUTq2sg5yQe74po7Voea6n/IN09+wE/QvJMiifA==} + engines: {node: '>=18'} + + to-regex-range@5.0.1: + resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} + engines: {node: '>=8.0'} + + tslib@2.9.1: + resolution: {integrity: sha512-a4Ux9VKuIMHsOS7ENbEq6hK2ZGYIT27Rtl0E4eD9KqwxhKiQeMZE/9xb3IdYwWaSOyIBQLExhQgXDTYoiCxnWA==} + + typescript@6.0.3: + resolution: {integrity: sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw==} + engines: {node: '>=14.17'} + hasBin: true + + unicode-emoji-modifier-base@1.0.0: + resolution: {integrity: sha512-yLSH4py7oFH3oG/9K+XWrz1pSi3dfUrWEnInbxMfArOfc1+33BlGPQtLsOYwvdMy11AwUBetYuaRxSPqgkq+8g==} + engines: {node: '>=4'} + + unrun@0.3.1: + resolution: {integrity: sha512-onIck/oNnCaytwths1ZVp1LK2Gq2hPoyFhiHebObuUXqR3S0uHuLLaBK8K6mRRgV7Ptip8AnNvaUsgzwWwBZuA==} + engines: {node: ^22.13.0 || >=24.0.0} + hasBin: true + peerDependencies: + synckit: ^0.11.11 + peerDependenciesMeta: + synckit: + optional: true + + validator@13.15.35: + resolution: {integrity: sha512-TQ5pAGhd5whStmqWvYF4OjQROlmv9SMFVt37qoCBdqRffuuklWYQlCNnEs2ZaIBD1kZRNnikiZOS1eqgkar0iw==} + engines: {node: '>= 0.10'} + + wsl-utils@1.0.1: + resolution: {integrity: sha512-c16PKLIRxBYpR3jSWsdS7SFp0COm5SOQdiFjY818dYFHJbMGuLBszpF07LBWmOS1uzrHa9VGdynsEgoeKy0oOQ==} + engines: {node: '>=20'} + + yallist@5.0.0: + resolution: {integrity: sha512-YgvUTfwqyc7UXVMrB+SImsVYSmTS8X/tSrtdNZMImM+n7+QTriRXyXim0mBrTXNeqzVF0KWGgHPeiyViFFrNDw==} + engines: {node: '>=18'} + + yoctocolors@2.2.0: + resolution: {integrity: sha512-xYqdZFUK/VYazNl/oCDYN+3WloWQwMfZxBoiNt6qNyk+xfOdi598muWE42rNZFp1kNOiqW936q5RhUdnpqElSg==} + engines: {node: '>=18'} + + zod@4.6.7: + resolution: {integrity: sha512-g8W2D2kU6a8untc053fX1uVBKzM7yqAxW/3zwk83+6RyF2+SKOuV+c0wBDhUwzV1PaGapmZH+rmcUzPf+3CGwg==} + +snapshots: + + '@angular-devkit/core@22.2.7(chokidar@5.0.0)': + dependencies: + ajv: 8.20.0 + ajv-formats: 3.0.1(ajv@8.20.0) + jsonc-parser: 3.3.1 + picomatch: 4.0.7 + rxjs: 7.8.2 + source-map: 0.8.0 + optionalDependencies: + chokidar: 5.0.0 + + '@angular-devkit/schematics-cli@22.2.7(chokidar@5.0.0)': + dependencies: + '@angular-devkit/core': 22.2.7(chokidar@5.0.0) + '@angular-devkit/schematics': 22.2.7(chokidar@5.0.0) + '@inquirer/prompts': 8.7.2 + transitivePeerDependencies: + - '@types/node' + - chokidar + + '@angular-devkit/schematics@22.2.7(chokidar@5.0.0)': + dependencies: + '@angular-devkit/core': 22.2.7(chokidar@5.0.0) + jsonc-parser: 3.3.1 + magic-string: 1.4.1 + ora: 9.4.1 + rxjs: 7.8.2 + transitivePeerDependencies: + - chokidar + + '@emnapi/core@2.0.0-beta.2': + dependencies: + '@emnapi/wasi-threads': 2.2.0 + tslib: 2.9.1 + optional: true + + '@emnapi/runtime@2.0.0-beta.2': + dependencies: + tslib: 2.9.1 + optional: true + + '@emnapi/wasi-threads@2.2.0': + dependencies: + tslib: 2.9.1 + optional: true + + '@inquirer/ansi@2.1.0': {} + + '@inquirer/checkbox@5.3.0': + dependencies: + '@inquirer/ansi': 2.1.0 + '@inquirer/core': 12.1.0 + '@inquirer/figures': 2.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/confirm@6.4.0': + dependencies: + '@inquirer/core': 12.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/core@12.1.0': + dependencies: + '@inquirer/ansi': 2.1.0 + '@inquirer/figures': 2.1.0 + '@inquirer/type': 4.3.0 + cli-width: 4.1.0 + fast-wrap-ansi: 0.2.2 + mute-stream: 4.0.0 + signal-exit: 4.1.0 + + '@inquirer/editor@5.4.0': + dependencies: + '@inquirer/core': 12.1.0 + '@inquirer/external-editor': 3.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/expand@5.2.0': + dependencies: + '@inquirer/core': 12.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/external-editor@3.1.0': + dependencies: + chardet: 2.2.0 + iconv-lite: 0.7.3 + + '@inquirer/figures@2.1.0': {} + + '@inquirer/input@5.2.0': + dependencies: + '@inquirer/core': 12.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/number@4.3.0': + dependencies: + '@inquirer/core': 12.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/password@5.3.0': + dependencies: + '@inquirer/ansi': 2.1.0 + '@inquirer/core': 12.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/prompts@8.7.2': + dependencies: + '@inquirer/checkbox': 5.3.0 + '@inquirer/confirm': 6.4.0 + '@inquirer/editor': 5.4.0 + '@inquirer/expand': 5.2.0 + '@inquirer/input': 5.2.0 + '@inquirer/number': 4.3.0 + '@inquirer/password': 5.3.0 + '@inquirer/rawlist': 5.4.0 + '@inquirer/search': 4.4.0 + '@inquirer/select': 5.3.0 + + '@inquirer/prompts@8.8.0': + dependencies: + '@inquirer/checkbox': 5.3.0 + '@inquirer/confirm': 6.4.0 + '@inquirer/editor': 5.4.0 + '@inquirer/expand': 5.2.0 + '@inquirer/input': 5.2.0 + '@inquirer/number': 4.3.0 + '@inquirer/password': 5.3.0 + '@inquirer/rawlist': 5.4.0 + '@inquirer/search': 4.4.0 + '@inquirer/select': 5.3.0 + + '@inquirer/rawlist@5.4.0': + dependencies: + '@inquirer/core': 12.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/search@4.4.0': + dependencies: + '@inquirer/core': 12.1.0 + '@inquirer/figures': 2.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/select@5.3.0': + dependencies: + '@inquirer/ansi': 2.1.0 + '@inquirer/core': 12.1.0 + '@inquirer/figures': 2.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/type@4.3.0': {} + + '@isaacs/fs-minipass@4.0.1': + dependencies: + minipass: 7.1.3 + + '@jridgewell/sourcemap-codec@1.6.0': {} + + '@nanoforge-dev/asset@3.0.0': + dependencies: + '@nanoforge-dev/common': 3.0.0 + + '@nanoforge-dev/cli@3.0.1': + dependencies: + '@angular-devkit/schematics': 22.2.7(chokidar@5.0.0) + '@angular-devkit/schematics-cli': 22.2.7(chokidar@5.0.0) + '@inquirer/prompts': 8.8.0 + '@nanoforge-dev/config': 3.0.1 + '@nanoforge-dev/editor': 0.1.4 + '@nanoforge-dev/loader-client': 1.7.0 + '@nanoforge-dev/loader-server': 1.7.0 + '@nanoforge-dev/registry': 3.0.1 + '@nanoforge-dev/schematics': 3.0.1(chokidar@5.0.0) + ansis: 4.5.0 + bun: 1.4.4 + chokidar: 5.0.0 + commander: 15.1.0 + dotenv: 18.0.10 + node-emoji: 2.2.0 + open: 11.0.4 + ora: 9.4.1 + rc9: 3.1.0 + transitivePeerDependencies: + - '@types/node' + - synckit + + '@nanoforge-dev/common@3.0.0': {} + + '@nanoforge-dev/config@3.0.1': + dependencies: + unrun: 0.3.1 + zod: 4.6.7 + transitivePeerDependencies: + - synckit + + '@nanoforge-dev/core@3.0.0': + dependencies: + '@nanoforge-dev/asset': 3.0.0 + '@nanoforge-dev/common': 3.0.0 + + '@nanoforge-dev/ecs@3.0.0(@nanoforge-dev/editor-lib@3.0.0)': + dependencies: + '@nanoforge-dev/common': 3.0.0 + optionalDependencies: + '@nanoforge-dev/editor-lib': 3.0.0 + + '@nanoforge-dev/editor-lib@3.0.0': + dependencies: + '@nanoforge-dev/common': 3.0.0 + + '@nanoforge-dev/editor@0.1.4': + dependencies: + bun: 1.4.4 + class-transformer: 0.5.1 + class-validator: 0.15.1 + dotenv: 17.4.2 + micromatch: 4.0.8 + tar: 7.5.23 + typescript: 6.0.3 + + '@nanoforge-dev/env@3.0.0': + dependencies: + '@nanoforge-dev/common': 3.0.0 + class-transformer: 0.5.1 + class-validator: 0.14.4 + + '@nanoforge-dev/graphics-2d@3.0.0': + dependencies: + '@nanoforge-dev/common': 3.0.0 + konva: 10.9.1 + transitivePeerDependencies: + - canvas + - skia-canvas + + '@nanoforge-dev/input@3.0.0': + dependencies: + '@nanoforge-dev/common': 3.0.0 + + '@nanoforge-dev/loader-client@1.7.0': + dependencies: + '@nanoforge-dev/loader-website': 1.7.0 + bun: 1.4.4 + commander: 15.1.0 + + '@nanoforge-dev/loader-server@1.7.0': + dependencies: + bun: 1.4.4 + commander: 15.1.0 + + '@nanoforge-dev/loader-website@1.7.0': {} + + '@nanoforge-dev/network@3.0.0(@nanoforge-dev/editor-lib@3.0.0)': + dependencies: + '@nanoforge-dev/common': 3.0.0 + '@nanoforge-dev/env': 3.0.0 + node-datachannel: 0.33.6 + optionalDependencies: + '@nanoforge-dev/editor-lib': 3.0.0 + + '@nanoforge-dev/registry@3.0.1': + dependencies: + fflate: 0.8.3 + semver: 7.8.6 + zod: 4.6.7 + + '@nanoforge-dev/schematics@3.0.1(chokidar@5.0.0)': + dependencies: + '@angular-devkit/core': 22.2.7(chokidar@5.0.0) + '@angular-devkit/schematics': 22.2.7(chokidar@5.0.0) + rxjs: 7.8.2 + transitivePeerDependencies: + - chokidar + + '@napi-rs/wasm-runtime@1.2.6(@emnapi/core@2.0.0-beta.2)(@emnapi/runtime@2.0.0-beta.2)': + dependencies: + '@emnapi/core': 2.0.0-beta.2 + '@emnapi/runtime': 2.0.0-beta.2 + '@tybys/wasm-util': 0.10.4 + optional: true + + '@node-datachannel/android-arm64@0.33.6': + optional: true + + '@node-datachannel/darwin-arm64@0.33.6': + optional: true + + '@node-datachannel/darwin-x64@0.33.6': + optional: true + + '@node-datachannel/linux-arm64-gnu@0.33.6': + optional: true + + '@node-datachannel/linux-arm64-musl@0.33.6': + optional: true + + '@node-datachannel/linux-x64-gnu@0.33.6': + optional: true + + '@node-datachannel/linux-x64-musl@0.33.6': + optional: true + + '@node-datachannel/win32-arm64-msvc@0.33.6': + optional: true + + '@node-datachannel/win32-x64-msvc@0.33.6': + optional: true + + '@oven/bun-darwin-aarch64@1.4.4': + optional: true + + '@oven/bun-darwin-x64@1.4.4': + optional: true + + '@oven/bun-freebsd-aarch64@1.4.4': + optional: true + + '@oven/bun-freebsd-x64@1.4.4': + optional: true + + '@oven/bun-linux-aarch64-android@1.4.4': + optional: true + + '@oven/bun-linux-aarch64-musl@1.4.4': + optional: true + + '@oven/bun-linux-aarch64@1.4.4': + optional: true + + '@oven/bun-linux-x64-android@1.4.4': + optional: true + + '@oven/bun-linux-x64-musl@1.4.4': + optional: true + + '@oven/bun-linux-x64@1.4.4': + optional: true + + '@oven/bun-windows-aarch64@1.4.4': + optional: true + + '@oven/bun-windows-x64@1.4.4': + optional: true + + '@oxc-project/types@0.158.0': {} + + '@rolldown/binding-android-arm-eabi@1.3.2': + optional: true + + '@rolldown/binding-android-arm64@1.3.2': + optional: true + + '@rolldown/binding-darwin-arm64@1.3.2': + optional: true + + '@rolldown/binding-darwin-x64@1.3.2': + optional: true + + '@rolldown/binding-freebsd-x64@1.3.2': + optional: true + + '@rolldown/binding-linux-arm-gnueabihf@1.3.2': + optional: true + + '@rolldown/binding-linux-arm64-gnu@1.3.2': + optional: true + + '@rolldown/binding-linux-arm64-musl@1.3.2': + optional: true + + '@rolldown/binding-linux-ppc64-gnu@1.3.2': + optional: true + + '@rolldown/binding-linux-s390x-gnu@1.3.2': + optional: true + + '@rolldown/binding-linux-x64-gnu@1.3.2': + optional: true + + '@rolldown/binding-linux-x64-musl@1.3.2': + optional: true + + '@rolldown/binding-openharmony-arm64@1.3.2': + optional: true + + '@rolldown/binding-wasm32-wasi@1.3.2': + dependencies: + '@emnapi/core': 2.0.0-beta.2 + '@emnapi/runtime': 2.0.0-beta.2 + '@napi-rs/wasm-runtime': 1.2.6(@emnapi/core@2.0.0-beta.2)(@emnapi/runtime@2.0.0-beta.2) + optional: true + + '@rolldown/binding-win32-arm64-msvc@1.3.2': + optional: true + + '@rolldown/binding-win32-x64-msvc@1.3.2': + optional: true + + '@rolldown/pluginutils@1.1.0': {} + + '@sindresorhus/is@4.6.0': {} + + '@tybys/wasm-util@0.10.4': + dependencies: + tslib: 2.9.1 + optional: true + + '@types/validator@13.15.10': {} + + ajv-formats@3.0.1(ajv@8.20.0): + optionalDependencies: + ajv: 8.20.0 + + ajv@8.20.0: + dependencies: + fast-deep-equal: 3.1.3 + fast-uri: 3.1.9 + json-schema-traverse: 1.0.0 + require-from-string: 2.0.2 + + ansi-regex@6.6.0: {} + + ansis@4.5.0: {} + + braces@3.0.3: + dependencies: + fill-range: 7.1.1 + + bun@1.4.4: + optionalDependencies: + '@oven/bun-darwin-aarch64': 1.4.4 + '@oven/bun-darwin-x64': 1.4.4 + '@oven/bun-freebsd-aarch64': 1.4.4 + '@oven/bun-freebsd-x64': 1.4.4 + '@oven/bun-linux-aarch64': 1.4.4 + '@oven/bun-linux-aarch64-android': 1.4.4 + '@oven/bun-linux-aarch64-musl': 1.4.4 + '@oven/bun-linux-x64': 1.4.4 + '@oven/bun-linux-x64-android': 1.4.4 + '@oven/bun-linux-x64-musl': 1.4.4 + '@oven/bun-windows-aarch64': 1.4.4 + '@oven/bun-windows-x64': 1.4.4 + + bundle-name@4.1.1: + dependencies: + run-applescript: 7.1.0 + + chalk@5.6.2: {} + + char-regex@1.0.2: {} + + chardet@2.2.0: {} + + chokidar@5.0.0: + dependencies: + readdirp: 5.1.1 + + chownr@3.0.0: {} + + class-transformer@0.5.1: {} + + class-validator@0.14.4: + dependencies: + '@types/validator': 13.15.10 + libphonenumber-js: 1.13.16 + validator: 13.15.35 + + class-validator@0.15.1: + dependencies: + '@types/validator': 13.15.10 + libphonenumber-js: 1.13.16 + validator: 13.15.35 + + cli-cursor@5.0.0: + dependencies: + restore-cursor: 5.1.0 + + cli-spinners@3.4.0: {} + + cli-width@4.1.0: {} + + commander@15.1.0: {} + + default-browser-id@5.0.1: {} + + default-browser@5.5.1: + dependencies: + bundle-name: 4.1.1 + default-browser-id: 5.0.1 + + define-lazy-prop@3.0.0: {} + + defu@6.1.7: {} + + destr@2.0.5: {} + + detect-libc@2.1.2: {} + + dotenv@17.4.2: {} + + dotenv@18.0.10: {} + + emojilib@2.4.0: {} + + fast-deep-equal@3.1.3: {} + + fast-string-truncated-width@3.0.3: {} + + fast-string-width@3.0.2: + dependencies: + fast-string-truncated-width: 3.0.3 + + fast-uri@3.1.9: {} + + fast-wrap-ansi@0.2.2: + dependencies: + fast-string-width: 3.0.2 + + fflate@0.8.3: {} + + fill-range@7.1.1: + dependencies: + to-regex-range: 5.0.1 + + get-east-asian-width@1.7.0: {} + + iconv-lite@0.7.3: + dependencies: + safer-buffer: 2.1.2 + + is-docker@3.0.0: {} + + is-in-ssh@1.0.0: {} + + is-inside-container@1.0.0: + dependencies: + is-docker: 3.0.0 + + is-interactive@2.0.0: {} + + is-number@7.0.0: {} + + is-unicode-supported@2.1.0: {} + + is-wsl@3.1.1: + dependencies: + is-inside-container: 1.0.0 + + json-schema-traverse@1.0.0: {} + + jsonc-parser@3.3.1: {} + + konva@10.9.1: {} + + libphonenumber-js@1.13.16: {} + + log-symbols@7.0.1: + dependencies: + is-unicode-supported: 2.1.0 + yoctocolors: 2.2.0 + + magic-string@1.4.1: + dependencies: + '@jridgewell/sourcemap-codec': 1.6.0 + + micromatch@4.0.8: + dependencies: + braces: 3.0.3 + picomatch: 2.3.2 + + mimic-function@5.0.1: {} + + minipass@7.1.3: {} + + minizlib@3.1.0: + dependencies: + minipass: 7.1.3 + + mute-stream@4.0.0: {} + + node-datachannel@0.33.6: + dependencies: + detect-libc: 2.1.2 + optionalDependencies: + '@node-datachannel/android-arm64': 0.33.6 + '@node-datachannel/darwin-arm64': 0.33.6 + '@node-datachannel/darwin-x64': 0.33.6 + '@node-datachannel/linux-arm64-gnu': 0.33.6 + '@node-datachannel/linux-arm64-musl': 0.33.6 + '@node-datachannel/linux-x64-gnu': 0.33.6 + '@node-datachannel/linux-x64-musl': 0.33.6 + '@node-datachannel/win32-arm64-msvc': 0.33.6 + '@node-datachannel/win32-x64-msvc': 0.33.6 + + node-emoji@2.2.0: + dependencies: + '@sindresorhus/is': 4.6.0 + char-regex: 1.0.2 + emojilib: 2.4.0 + skin-tone: 2.0.0 + + onetime@7.0.0: + dependencies: + mimic-function: 5.0.1 + + open@11.0.4: + dependencies: + default-browser: 5.5.1 + define-lazy-prop: 3.0.0 + is-in-ssh: 1.0.0 + is-inside-container: 1.0.0 + powershell-utils: 0.2.1 + wsl-utils: 1.0.1 + + ora@9.4.1: + dependencies: + chalk: 5.6.2 + cli-cursor: 5.0.0 + cli-spinners: 3.4.0 + is-interactive: 2.0.0 + is-unicode-supported: 2.1.0 + log-symbols: 7.0.1 + stdin-discarder: 0.3.2 + string-width: 8.3.0 + + picomatch@2.3.2: {} + + picomatch@4.0.7: {} + + powershell-utils@0.2.1: {} + + rc9@3.1.0: + dependencies: + defu: 6.1.7 + destr: 2.0.5 + + readdirp@5.1.1: {} + + require-from-string@2.0.2: {} + + restore-cursor@5.1.0: + dependencies: + onetime: 7.0.0 + signal-exit: 4.1.0 + + rolldown@1.3.2: + dependencies: + '@oxc-project/types': 0.158.0 + '@rolldown/pluginutils': 1.1.0 + optionalDependencies: + '@rolldown/binding-android-arm-eabi': 1.3.2 + '@rolldown/binding-android-arm64': 1.3.2 + '@rolldown/binding-darwin-arm64': 1.3.2 + '@rolldown/binding-darwin-x64': 1.3.2 + '@rolldown/binding-freebsd-x64': 1.3.2 + '@rolldown/binding-linux-arm-gnueabihf': 1.3.2 + '@rolldown/binding-linux-arm64-gnu': 1.3.2 + '@rolldown/binding-linux-arm64-musl': 1.3.2 + '@rolldown/binding-linux-ppc64-gnu': 1.3.2 + '@rolldown/binding-linux-s390x-gnu': 1.3.2 + '@rolldown/binding-linux-x64-gnu': 1.3.2 + '@rolldown/binding-linux-x64-musl': 1.3.2 + '@rolldown/binding-openharmony-arm64': 1.3.2 + '@rolldown/binding-wasm32-wasi': 1.3.2 + '@rolldown/binding-win32-arm64-msvc': 1.3.2 + '@rolldown/binding-win32-x64-msvc': 1.3.2 + + run-applescript@7.1.0: {} + + rxjs@7.8.2: + dependencies: + tslib: 2.9.1 + + safer-buffer@2.1.2: {} + + semver@7.8.6: {} + + signal-exit@4.1.0: {} + + skin-tone@2.0.0: + dependencies: + unicode-emoji-modifier-base: 1.0.0 + + source-map@0.8.0: {} + + stdin-discarder@0.3.2: {} + + string-width@8.3.0: + dependencies: + get-east-asian-width: 1.7.0 + strip-ansi: 7.2.0 + + strip-ansi@7.2.0: + dependencies: + ansi-regex: 6.6.0 + + tar@7.5.23: + dependencies: + '@isaacs/fs-minipass': 4.0.1 + chownr: 3.0.0 + minipass: 7.1.3 + minizlib: 3.1.0 + yallist: 5.0.0 + + to-regex-range@5.0.1: + dependencies: + is-number: 7.0.0 + + tslib@2.9.1: {} + + typescript@6.0.3: {} + + unicode-emoji-modifier-base@1.0.0: {} + + unrun@0.3.1: + dependencies: + rolldown: 1.3.2 + + validator@13.15.35: {} + + wsl-utils@1.0.1: + dependencies: + is-wsl: 3.1.1 + powershell-utils: 0.2.1 + + yallist@5.0.0: {} + + yoctocolors@2.2.0: {} + + zod@4.6.7: {} diff --git a/demos/pong-network/pnpm-workspace.yaml b/demos/pong-network/pnpm-workspace.yaml new file mode 100644 index 0000000..db54857 --- /dev/null +++ b/demos/pong-network/pnpm-workspace.yaml @@ -0,0 +1,7 @@ +packages: + - "apps/*" +allowBuilds: + bun: true +# NanoForge packages are ours: take a release as soon as it is out. +minimumReleaseAgeExclude: + - "@nanoforge-dev/*" diff --git a/demos/pong/.gitignore b/demos/pong/.gitignore new file mode 100644 index 0000000..f28e2dc --- /dev/null +++ b/demos/pong/.gitignore @@ -0,0 +1,5 @@ +node_modules/ +dist/ +.nanoforge/ +nf_modules/ +.env diff --git a/demos/pong/README.md b/demos/pong/README.md new file mode 100644 index 0000000..a8708d3 --- /dev/null +++ b/demos/pong/README.md @@ -0,0 +1,28 @@ +# pong + +Pong for two players on one keyboard: the first to five points wins. + +| Key | Does | +| ----- | ---------------------------------- | +| Enter | Starts a match, leaves the end one | +| W / S | Moves the left paddle | +| ↑ / ↓ | Moves the right paddle | + +It shows **scenes** (`@nanoforge-dev/scene`): `Menu`, `Match` and `Win`, each in +`src/scenes/`, listed in `SceneLibrary` in `src/main.ts`. A scene spawns its entities and adds its +systems in `setup`, and they go away when the next scene is loaded. The match length is the +`pointsToWin` scene var, the winner comes to `Win` as a param. + +The ball, the paddles, the walls and the goals are plain entities: `bounceBall` sends the ball +back from a `Paddle` or a `Wall`, `blockPaddles` stops the paddles at the walls, `scoreGoals` +counts a point when the ball enters a `Goal` and `serveBall` serves it again. The servers of +`pong-network` and `pong-3d` run the same systems. + +```sh +pnpm install +pnpm dev # play it +pnpm editor # open it in the editor +``` + +The files of `src/` that are also in `shared/2d` or `shared/paddle` are copies (see the +repository's README). diff --git a/demos/pong/assets/.gitkeep b/demos/pong/assets/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/demos/pong/nanoforge.config.ts b/demos/pong/nanoforge.config.ts new file mode 100644 index 0000000..77607cb --- /dev/null +++ b/demos/pong/nanoforge.config.ts @@ -0,0 +1,5 @@ +import { defineConfig } from "@nanoforge-dev/config"; + +export default defineConfig({ + type: "client", +}); diff --git a/demos/pong/package.json b/demos/pong/package.json new file mode 100644 index 0000000..aa23d47 --- /dev/null +++ b/demos/pong/package.json @@ -0,0 +1,27 @@ +{ + "$schema": "https://json.schemastore.org/package.json", + "name": "pong", + "description": "Pong for two players on one keyboard, first to five points", + "private": true, + "type": "module", + "scripts": { + "dev": "nf dev", + "build": "nf build", + "start": "nf start", + "editor": "nf editor ." + }, + "devDependencies": { + "@nanoforge-dev/asset": "^3.0.0", + "@nanoforge-dev/cli": "^3.0.1", + "@nanoforge-dev/common": "^3.0.0", + "@nanoforge-dev/config": "^3.0.1", + "@nanoforge-dev/core": "^3.0.0", + "@nanoforge-dev/ecs": "^3.0.0", + "@nanoforge-dev/editor-lib": "^3.0.0", + "@nanoforge-dev/env": "^3.0.0", + "@nanoforge-dev/graphics-2d": "^3.0.0", + "@nanoforge-dev/input": "^3.0.0", + "@nanoforge-dev/scene": "^3.0.0", + "typescript": "^6.0.0" + } +} diff --git a/demos/pong/pnpm-lock.yaml b/demos/pong/pnpm-lock.yaml new file mode 100644 index 0000000..a1c8333 --- /dev/null +++ b/demos/pong/pnpm-lock.yaml @@ -0,0 +1,1531 @@ +lockfileVersion: '9.0' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + +importers: + + .: + devDependencies: + '@nanoforge-dev/asset': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/cli': + specifier: ^3.0.1 + version: 3.0.1 + '@nanoforge-dev/common': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/config': + specifier: ^3.0.1 + version: 3.0.1 + '@nanoforge-dev/core': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/ecs': + specifier: ^3.0.0 + version: 3.0.0(@nanoforge-dev/editor-lib@3.0.0)(@nanoforge-dev/scene@3.0.0(@nanoforge-dev/editor-lib@3.0.0)) + '@nanoforge-dev/editor-lib': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/env': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/graphics-2d': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/input': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/scene': + specifier: ^3.0.0 + version: 3.0.0(@nanoforge-dev/editor-lib@3.0.0) + typescript: + specifier: ^6.0.0 + version: 6.0.3 + +packages: + + '@angular-devkit/core@22.2.7': + resolution: {integrity: sha512-cchZAMsV4d76RDZBlWzPhYxM/Hb6bmq71oUngdrwehMbBbdQu3W9C2tGlvxuPxbRKru9ZlUa14YVXQ0+QnhFtw==} + engines: {node: ^22.22.3 || ^24.15.0 || >=26.0.0, npm: ^6.11.0 || ^7.5.6 || >=8.0.0, yarn: '>= 1.13.0'} + peerDependencies: + chokidar: ^5.0.0 + peerDependenciesMeta: + chokidar: + optional: true + + '@angular-devkit/schematics-cli@22.2.7': + resolution: {integrity: sha512-9Od0E8TiYTQWm/03QjYWnsryZA8ZSjTf/k5z61nPd/jgloVNvSW8kxC7/YMw+RoXh2idMzjiJxraKxg+gJxzPw==} + engines: {node: ^22.22.3 || ^24.15.0 || >=26.0.0, npm: ^6.11.0 || ^7.5.6 || >=8.0.0, yarn: '>= 1.13.0'} + hasBin: true + + '@angular-devkit/schematics@22.2.7': + resolution: {integrity: sha512-a1h7xNqBLQVo1e5eCyOU3axSbA9AFU6nnSH5QhlNhggfMeZde+eBrueSt25xsewoxlKO8EvkVT3+knMUkDYiGQ==} + engines: {node: ^22.22.3 || ^24.15.0 || >=26.0.0, npm: ^6.11.0 || ^7.5.6 || >=8.0.0, yarn: '>= 1.13.0'} + + '@emnapi/core@2.0.0-beta.2': + resolution: {integrity: sha512-MzCVoWtcg4Pm2B3je5mMvYMvj3MmBKw+fU7vbsJc9/iT8ip6/eYIHo/Dsm/mr+wsHB6SEyJDuxB09Yy6r/8+4A==} + + '@emnapi/runtime@2.0.0-beta.2': + resolution: {integrity: sha512-JcrSPzPvZuNZvJqPTF9Fw25LbOJ8avzFVlaf2grmH4Cku0oGP47tRgqPZadcfj3YoZMHkFVnCYFbQM8I+i5QEw==} + + '@emnapi/wasi-threads@2.2.0': + resolution: {integrity: sha512-JP7OYH38Q7+pyTAe14raZHLQIK7BDKbdwji+Xi3pcd/6QkJYQH3SX4wu6EplGrGJWRepoNzedfm0G3B9Z4e9Rw==} + + '@inquirer/ansi@2.1.0': + resolution: {integrity: sha512-63GU5AD9KhNbWM0jlhHoMJTEFck2upFOPxHlnCKf3xYTV3rjTUUQfodihmTnfYQzMLS29oy8lK/gA1eJgu4bhA==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + + '@inquirer/checkbox@5.3.0': + resolution: {integrity: sha512-3QQSO87A+JoRtOtjtsgX2enwTL+3+VBVrkUpdqrIxMOgn5+W5sE57PcCPAiNUIESHxV4Q6mNEGxq2xLmRa0/yw==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/confirm@6.4.0': + resolution: {integrity: sha512-+DCZxrOF01Q/1SzTQkgycAQPS/Jf+Yol0h1P/MVmopukTsxGOu1h/LKqf30y0eHKFZYYrgUMVhGDhEbPmSPi9A==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/core@12.1.0': + resolution: {integrity: sha512-6H7usRWw4Gdjgpaem10CA5MfZ/xoYPGyInriR1Xubqjv+SVo8LIJ1erpFxW5JgCza6VZVZiKLTko7RtUU3AQMg==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/editor@5.4.0': + resolution: {integrity: sha512-L7vdCe4jnMpzhDisu1tAnr4WGvfPOVz+vNFXyIIL7O2Ycn/n90sn1ARvg+4cwzLf+us51BE/cX7uhnrLcal3+g==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/expand@5.2.0': + resolution: {integrity: sha512-AOp2KQk7QojUyWOP7VkqdBWmxLRaVH58wQMx3N4//P530EDtpVp1EWIjAJubx9ZohWS/UCEpIkA1TuiNki0iOA==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/external-editor@3.1.0': + resolution: {integrity: sha512-27JAkF38nXqXaoveU28iA/+Z8nutnF8B3JsbdToPHn9WnkrsMtZ0/YoJ29YwbtFexYIo+tIy6ikMvTdHKjjmGA==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/figures@2.1.0': + resolution: {integrity: sha512-CR9u2PME23jxy2SOyTb117efwAAPm98Zr+LoWI+PiQ55D6U8Yeu/HyFTxwytKhPa6oxAGzdsm2Kg7oLS6B9z8w==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + + '@inquirer/input@5.2.0': + resolution: {integrity: sha512-sIUPnN2X7M+7dq3RUd+e9QRacYnM+6B+kSucwQgj5VC5Eo/f+CIr2NyPBumxsViI+wzfokkgop/3x3KfHxNyJw==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/number@4.3.0': + resolution: {integrity: sha512-xYkX4sPVgox0F7yQwpz/MByWjOGdLEf1pdjH+Lji2gAzSs2xezz5bN5YgS1n0tx9wo0mRhGvq1KJGtvDZ9XXcQ==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/password@5.3.0': + resolution: {integrity: sha512-KVqW4G/UbMK06uBN76xF89JKYC9YBWU7v+Kc2tUwMCO8pg3ASBr0HVabl1KaSqF94O2KiRu8aKx4EicN78PK+A==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/prompts@8.7.2': + resolution: {integrity: sha512-QoRB4wFIjgH5iOhSjoIKMkTvSHDuV+O3OITlIqAYO0oK5x364GJILXiMBvlPiE+klg7Xx9tq5XVqQHcGUDYYPA==} + engines: {node: '>=23.5.0 || ^22.13.0 || ^20.17.0'} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/prompts@8.8.0': + resolution: {integrity: sha512-yYVT2Eo3mafb9tnU2Mr3+wh5wLCWyspExqVoPSMCIfBIn3ZUTE4IDfbCMbMgXaOH0tH+JZEhOtfczQhDzOjIGg==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/rawlist@5.4.0': + resolution: {integrity: sha512-x42wcy465GM5/mHNKBFdAJbLlLyzmYqr/DEa6F49nHpI+03EFwRCRKeLGQakx5XqZ4unc2yFuS78qAD4Rb0iFA==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/search@4.4.0': + resolution: {integrity: sha512-UJ+9tkzPT1AjnvjuPFYcOdO3BVeN28bfSXajYRFZTRgA9OiNl4k2Nn2cHHPwiIDyPHlvOnmE9ZOHyXhPHtvb+A==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/select@5.3.0': + resolution: {integrity: sha512-Fmgfl0qjqCQo+/tjQpgnRXKh5N7/VpYcJh+AlYU2eHmHZLMGUBDzo+Gwc2ODzWJfXNRZmgaMhz4qULcO/C/rXg==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/type@4.3.0': + resolution: {integrity: sha512-/IA8q2nyjgyl0NGSjqiRXB8gh3We7Pzx9C0c+6Zoolu905jFc79anerrUG7+n65+qs310DRK43yi2WDI8nY59A==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@isaacs/fs-minipass@4.0.1': + resolution: {integrity: sha512-wgm9Ehl2jpeqP3zw/7mo3kRHFp5MEDhqAdwy1fTGkHAwnkGOVsgpvQhL8B5n1qlb01jV3n/bI0ZfZp5lWA1k4w==} + engines: {node: '>=18.0.0'} + + '@jridgewell/sourcemap-codec@1.6.0': + resolution: {integrity: sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw==} + + '@nanoforge-dev/asset@3.0.0': + resolution: {integrity: sha512-jqXcyCMbdcCCj7wZ/dyIpjY8hza02Pt/vY8KrNcaXTlxpTc9EE+VKuO5+fHdUXWWPgJSFt96TqAPhug+z+KH3Q==} + engines: {node: '26'} + + '@nanoforge-dev/cli@3.0.1': + resolution: {integrity: sha512-ZfrbETcAcX3vsPLO1WLSCJc2ERCAcIpbdi9Df5bmH3XLinQkDAcESkN9JkaI/vgV08A7xhTjV8zSDSwF0T73Xg==} + engines: {node: '26'} + hasBin: true + + '@nanoforge-dev/common@3.0.0': + resolution: {integrity: sha512-lzMvQ1vCElh9OcP4EqhffbY+AQXOH4IiuD1pj7VvJlpcY6hh7Bs/s4NVS0gXoJ+ibpBMe5mAq23RyzqTwk8czg==} + engines: {node: '26'} + + '@nanoforge-dev/config@3.0.1': + resolution: {integrity: sha512-XWRScOotb8IirerRx/mWLmUVYye3lo0PN/5a0MUp/eoSrhz0S6zzhGHEupRuC8aeHTjsQT7ctM3P6YyKSHZLaQ==} + engines: {node: '26'} + + '@nanoforge-dev/core@3.0.0': + resolution: {integrity: sha512-pa7Fr3TFkZVfAADBC17Qt5ru/W9vXtYB8e5eb7wurAtu8/jH/ZtqfW3kafTuWC9513MXp/h6LOCdZQhjnCt6UA==} + engines: {node: '26'} + + '@nanoforge-dev/ecs@3.0.0': + resolution: {integrity: sha512-csrXJtCzqohxtvEQs+O//xabnaLR3BXe0QpSpl7NVihF3f0iX2fNYURxNjQKxzoPYBokCnnyNxN2KFc7UmIsdA==} + engines: {node: '26'} + peerDependencies: + '@nanoforge-dev/editor-lib': 3.0.0 + '@nanoforge-dev/scene': 3.0.0 + peerDependenciesMeta: + '@nanoforge-dev/editor-lib': + optional: true + '@nanoforge-dev/scene': + optional: true + + '@nanoforge-dev/editor-lib@3.0.0': + resolution: {integrity: sha512-fSWm6bHelbxqeVESYoUUKDi9RGNxvRu6p1r41KE1DddM0RrP0/WzkFOWBvgl+psHbYNotXe723Y2Fd3p+tqPDQ==} + engines: {node: '26'} + + '@nanoforge-dev/editor@0.1.4': + resolution: {integrity: sha512-bqbrH8ulFSiZz1iisJHtHeEzj1RV/70uErCYHeW4DIhVPsWbBfWKFvg/ghAbmPk5vsj0YnhDX6DSpik4S1QoiQ==} + engines: {node: '25'} + + '@nanoforge-dev/env@3.0.0': + resolution: {integrity: sha512-kXYXl9/09Bn8VStTTFuZY3dYDG9b76VhOi9PHMnaLe75XcFRLKJ2dYkXf3ut6RCL2+6H7HAEIOALjR15CHnJ5A==} + engines: {node: '26'} + + '@nanoforge-dev/graphics-2d@3.0.0': + resolution: {integrity: sha512-0I0WUr5495jORdYR+HtyP4kmAfCMvixmG+EH/gE5bN33S8RO6/Ly4oMLZOLUywcDTAFuLn28BlHuVor2YfXrsg==} + engines: {node: '26'} + + '@nanoforge-dev/input@3.0.0': + resolution: {integrity: sha512-8pWU28c99VAvn37onNbVFfwXTgyQGxm5DVnTdBEzgrF3KPCzU77kEaexB1AWOlga+4qNGU7/XNm3hNZ+YS49Ig==} + engines: {node: '26'} + + '@nanoforge-dev/loader-client@1.7.0': + resolution: {integrity: sha512-zDj0yQ8cZyHHjAYDVIyB79mh4dK7WRgZG7Kc+d/43t2WX/pX2HqBVkpLcDPkA9cNOKpCRYWd3LyYISlz53gzyg==} + engines: {node: '26'} + + '@nanoforge-dev/loader-server@1.7.0': + resolution: {integrity: sha512-Yd/BYORhoar5znNSD7kGirAc1Al0q5t8iscbb07QWKeXWA+DLKjPSuKJC6ykysFkbs9HiZU59oOfxyvNL4h3Pw==} + engines: {node: '26'} + + '@nanoforge-dev/loader-website@1.7.0': + resolution: {integrity: sha512-x1fV3RYUUxru39sF5HJcfutNnifMMTIEHW92jgkR9gz06ZlZ+rQofuegXgAnEzs0dEXa+rhNQ/iXYbqOZvq6YQ==} + engines: {node: '26'} + + '@nanoforge-dev/registry@3.0.1': + resolution: {integrity: sha512-EzSaszYtrPldD5Do7jdQK3TLLb8uCirY6NQjKXkeGw31X+sUXor4h5GAaoxELWMzPnv9BbKtggSaVaQIt7s8IQ==} + engines: {node: '26'} + + '@nanoforge-dev/scene@3.0.0': + resolution: {integrity: sha512-4+QajCZCW8eVdQPZeSoLDQ/ueQOFwAoFvd0pRL06FeuzWJMxCVNTCeZp9UHZLTMqmEJKAC29OnBQuHvhGkuBVg==} + engines: {node: '26'} + peerDependencies: + '@nanoforge-dev/editor-lib': 3.0.0 + peerDependenciesMeta: + '@nanoforge-dev/editor-lib': + optional: true + + '@nanoforge-dev/schematics@3.0.1': + resolution: {integrity: sha512-iK2vC0gPEh2mQ81IB4+jfGw/ZNOLMDnS9HRBXH5tWB0mdN5GA32viblhW0oYPX2/tWrLC9YiCPgEE4AL8Zwz6w==} + engines: {node: '26'} + + '@napi-rs/wasm-runtime@1.2.6': + resolution: {integrity: sha512-mRyDmEw9/fCDXCGfL1sbgIw/GUK0PVxRW4YwgPN61F3LQ+fSyoBFarJVzgGyhF6kRzEQZ0FejDqm4WLXSeqQmw==} + engines: {node: ^20.19.0 || ^22.13.0 || >=23.5.0} + peerDependencies: + '@emnapi/core': ^1.7.1 || 2.0.0-beta.2 + '@emnapi/runtime': ^1.7.1 || 2.0.0-beta.2 + + '@oven/bun-darwin-aarch64@1.4.4': + resolution: {integrity: sha512-zW/hxwc8sJAILGwB5eTC4i48ouGXf0V4lrxmEOk3JIE6JkYVW1TZh1E2pIempqsezgW1sckTIIDudFON8bJ2Mw==} + cpu: [arm64] + os: [darwin] + + '@oven/bun-darwin-x64@1.4.4': + resolution: {integrity: sha512-oKGcxLsvh4oHjAo28nPm8c/xN0o/OmGyj1IHYc94vprkWsW2hNg2keEZt5f40cI5Hvu4jDlSRTR0UNpv1UIAxw==} + cpu: [x64] + os: [darwin] + + '@oven/bun-freebsd-aarch64@1.4.4': + resolution: {integrity: sha512-klvA9FlwLxZj3JYIOPQA4bbnHIC3uas8kBE4GaGGkeVgAQP/k8hAzYkOqkSaqHBDbxLrTyFEQArEAevJq6NJzg==} + cpu: [arm64] + os: [freebsd] + + '@oven/bun-freebsd-x64@1.4.4': + resolution: {integrity: sha512-sF1xS/scbyN94P2d0eTiarO6JHxrIvhZNT9hnWjQXW5nwKRtfuP+UYnIMNyvW1BQPcZFP/cvfLBNUIe1ea4zPA==} + cpu: [x64] + os: [freebsd] + + '@oven/bun-linux-aarch64-android@1.4.4': + resolution: {integrity: sha512-5lvn3at5vRC0GxvmiqEiV2/e23tnRi0q5pzR40yfDvDA3OW7PSkt4chF1nA9vnAJhro4/l+ol1FmNP6D3cf/oA==} + cpu: [arm64] + os: [android] + + '@oven/bun-linux-aarch64-musl@1.4.4': + resolution: {integrity: sha512-QFd0P+mHJxbZFbUla4MgiE5OwxysHaUIYxL2pPNkpWtaI7v4ShOpr8OhBmsuyB0xn5rv/ZJnPsj2y8+bB9+g/A==} + cpu: [arm64] + os: [linux] + libc: [musl] + + '@oven/bun-linux-aarch64@1.4.4': + resolution: {integrity: sha512-ZTVtpf9zmHSBVPX1sBwe5agGb/rN34yPGg/Hby8e2Ax2uCUA2URZKlZH7qLntK7qaFJCMXh9v0GWNYN2zINz1w==} + cpu: [arm64] + os: [linux] + libc: [glibc] + + '@oven/bun-linux-x64-android@1.4.4': + resolution: {integrity: sha512-3dMicj9C1DhaIfDkwt/9GtpU0W+q+GazbG9OIlEyL3Q1BBEz2e6ZRz/JiO8D/ECC0caXAqvnpFudehcLlgIwWQ==} + cpu: [x64] + os: [android] + + '@oven/bun-linux-x64-musl@1.4.4': + resolution: {integrity: sha512-lEEjNOJJrbGZu2NVcPI4uXdILcpspezWkA8R/Jr0RCGhM6zQd0Y7JBIIKNAmbX59EeWpeEz7Q78iLbpcAUypUA==} + cpu: [x64] + os: [linux] + libc: [musl] + + '@oven/bun-linux-x64@1.4.4': + resolution: {integrity: sha512-CHbbkmHVM28T1GFq+6GL4Ao4ujwwYwj1CxFFwEFzLanPfNsId9AhbIP0Q4reWuWBkGimUkoQygrK7Rgjtj3vog==} + cpu: [x64] + os: [linux] + libc: [glibc] + + '@oven/bun-windows-aarch64@1.4.4': + resolution: {integrity: sha512-n0ep5ZRPCZY1+dqFJpnnRUZB1wy4GYU6At8RF+pyzySCLjkN9R4rFh2PtBHAgF/lg1vOl3/CeER3pDM+p40ATA==} + cpu: [arm64] + os: [win32] + + '@oven/bun-windows-x64@1.4.4': + resolution: {integrity: sha512-a3LNctBVO8PjePsFZfwDleF2JXYf2BfQ1u/PLRnBDLnC2Riml+4+LgJpKj4xRGhB92KweGyQI5PXaTkP9qypMQ==} + cpu: [x64] + os: [win32] + + '@oxc-project/types@0.158.0': + resolution: {integrity: sha512-xZ66qA4WmLbTLlxH3mqMd8f9UKbaOzOT0ATwFf4DH/14pMgpUrtqtjyYzOQmgfl2a0iRAAMbQ9G1th/67jRzGw==} + + '@rolldown/binding-android-arm-eabi@1.3.2': + resolution: {integrity: sha512-kqR2xcygEx3WwDY69LsKeyf7SVmx4yzMtKZRknyaHieVJdRvvnAM97L0Gq6tUFc9T2YXcW/Ghij2+Um6He0LTw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [android] + + '@rolldown/binding-android-arm64@1.3.2': + resolution: {integrity: sha512-gXM4GAAvvIZA7qUuSCQS+Zz91H2fagKa5MNppUdjzysJ8LXMWm9D/gQj4nfOKo6okquDQ5pkjsuo2SUMXNW0Rw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [android] + + '@rolldown/binding-darwin-arm64@1.3.2': + resolution: {integrity: sha512-OBs5hp3W+LwMEUmDMMMnu08ncG0t6DDgnFU+6TAucKtAfNgerYLZSr2jtREKb/JuPQ1J7bJnWIgKKkxvjuAw1g==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [darwin] + + '@rolldown/binding-darwin-x64@1.3.2': + resolution: {integrity: sha512-X0VGYd4v/gdjfa/IP6uHuMhofPoUDYvK/byk3bC0jQ1pKKgt6RZ4B4puMqP0AHkjmIHAsxA471mM6AxZ39IaTA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [darwin] + + '@rolldown/binding-freebsd-x64@1.3.2': + resolution: {integrity: sha512-mr04K4cp9J/fj9fknrX8e4QvI/V48Sp+4v64PoLwhoirIH8b8L8EBrF/0bTjV1It2IL91hoNG13GblnWLglkxA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [freebsd] + + '@rolldown/binding-linux-arm-gnueabihf@1.3.2': + resolution: {integrity: sha512-VgWy02HU9Tiy6tU8U+kF3Fd4TQwTNdIBvs2MlgViP1ksMtAnQQTIPAj0ZsJzIQXKIOugqQSpqxQgELJ3fkuL5w==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [linux] + + '@rolldown/binding-linux-arm64-gnu@1.3.2': + resolution: {integrity: sha512-0wloJFYqV844gv6boiERbHpErxbxHbmlgnMX5VxP1Ux+DLBqGrUOn0cIpBmCZEcTITes3QUelxya4u8c9ziQvQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-arm64-musl@1.3.2': + resolution: {integrity: sha512-Kys8wgFQy8H8vua0MNpC0akMBFoNO8455RHk2yycBM0iayMIAtVAL6xmV9TWAkehFgrrlImTL2fZdX5LXfYtAA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + libc: [musl] + + '@rolldown/binding-linux-ppc64-gnu@1.3.2': + resolution: {integrity: sha512-L8eej7+/StRxUHHOPsOVl7Fzx/3tumuGB4hGQZKT73xRI16KZhaSJr0gi3C3WBjNRxeJRKKps2UD4lQukP+oBw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [ppc64] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-s390x-gnu@1.3.2': + resolution: {integrity: sha512-MV5CEb/nV8neQOj7l6945q1vy62HXtWO8zPDvfySPusoUzdBoLoJ/DfXXwaYThGTXZCniF+5bCf253WTPPK7Yw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [s390x] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-x64-gnu@1.3.2': + resolution: {integrity: sha512-3qssvvVvkwQookZ1/1avlKWc5orAR85vgKdzDd5noZS8nnHiI/ejOAEt0xfNYvtBBF7/DZmP8dANWkRBJVOBCA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-x64-musl@1.3.2': + resolution: {integrity: sha512-rJqoFTm/bCZFKKgaT4NzWn/TuJkFDToZ/rzYFnYVBL28jH1nIfg6snx2mDri30nal9H+wcYfKpoPR9jrMQgQQg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + libc: [musl] + + '@rolldown/binding-openharmony-arm64@1.3.2': + resolution: {integrity: sha512-ozdbCjHfh0N//wJNExjJlSlcDaeIKo8k1ktzkLUyESr2Gu/Qw7nBYxKe3jgtoaxda570vg10WdYosre82263hQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [openharmony] + + '@rolldown/binding-wasm32-wasi@1.3.2': + resolution: {integrity: sha512-p5VA6Vk/2cXZPVWf+dDbuE0dkhrcoAo6pISTJmzUnsSdQqNJdusyR8lZgHku095+r27zrYISNLZnJoqrcePW0A==} + engines: {node: ^20.19.0 || ^22.13.0 || >=23.5.0} + cpu: [wasm32] + + '@rolldown/binding-win32-arm64-msvc@1.3.2': + resolution: {integrity: sha512-XDb2U14Orf4r76SwzvJ7avePL00w4gHBmi1Ig4B/itYFEUTmYMNDHVU0dcYuBa0LgNBqyREoJOrQKxQlyYJA7A==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [win32] + + '@rolldown/binding-win32-x64-msvc@1.3.2': + resolution: {integrity: sha512-lEsKzKJqIUDZVCBhS4lkZuyQUhV1oRg5UHkI72qlOAqJn7qEXcoVdTridFS7PHNWdZknBl95EAF/4P1Xv0K1eQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [win32] + + '@rolldown/pluginutils@1.1.0': + resolution: {integrity: sha512-K+NU2HDCEem4sClgHH4ZZXwdJeNFkJo+hRk479DIwdIviAPN2hFJH1KHHwg8CxHQXvi0M5XY4deTXINfIiSG6w==} + + '@sindresorhus/is@4.6.0': + resolution: {integrity: sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==} + engines: {node: '>=10'} + + '@tybys/wasm-util@0.10.4': + resolution: {integrity: sha512-W3c4gRigFS0T/Ma4qIYF3GDAc5AQdHb1yL5znJT1Zv1YaD9Kitx656wBjvr19qbiosmZT8lWDM5BEMynUqX65A==} + + '@types/validator@13.15.10': + resolution: {integrity: sha512-T8L6i7wCuyoK8A/ZeLYt1+q0ty3Zb9+qbSSvrIVitzT3YjZqkTZ40IbRsPanlB4h1QB3JVL1SYCdR6ngtFYcuA==} + + ajv-formats@3.0.1: + resolution: {integrity: sha512-8iUql50EUR+uUcdRQ3HDqa6EVyo3docL8g5WJ3FNcWmu62IbkGUue/pEyLBW8VGKKucTPgqeks4fIU1DA4yowQ==} + peerDependencies: + ajv: ^8.0.0 + peerDependenciesMeta: + ajv: + optional: true + + ajv@8.20.0: + resolution: {integrity: sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA==} + + ansi-regex@6.6.0: + resolution: {integrity: sha512-XZ5apbzreCbXSKwPjJstu8R0zOi247w3XYwWxtwBXgpZrCyc1Ka7p9/xY0A9/diMewmHbEKz+FIraWaEWjlN5g==} + engines: {node: '>=12'} + + ansis@4.5.0: + resolution: {integrity: sha512-KwIVkfFfJSSzBmZhDGuTmkhWqTdyB5oNVzzznBJbBZ5bZtHiqSrcugRF0RKJKT4Ss3d7ZrcjnlFVDlQNmtWfWw==} + engines: {node: '>=14'} + + braces@3.0.3: + resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} + engines: {node: '>=8'} + + bun@1.4.4: + resolution: {integrity: sha512-hj0ASdG6PNjLZGFAXktWb3Uaj/dcv/1wCsIttoEXADNIQBsGjTr+5uLKYbrDkuc7NT0Tkj4yPIqJI2jDxXdvVg==} + cpu: [arm64, x64] + os: [darwin, linux, android, freebsd, win32] + hasBin: true + + bundle-name@4.1.1: + resolution: {integrity: sha512-DdH81/zPLVS11EUgWq3tEu/xn+EzljlMYooDNdzWEnFha3R3NBMpMV1UqYIpjYHV/SgpFKMIX1Oh7o06SjM/oA==} + engines: {node: '>=18'} + + chalk@5.6.2: + resolution: {integrity: sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA==} + engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} + + char-regex@1.0.2: + resolution: {integrity: sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==} + engines: {node: '>=10'} + + chardet@2.2.0: + resolution: {integrity: sha512-rddelWYNPRrXq6PtNEN2S3f6t9ILzvqaN5pVgi4kqt9jHQaXIial9PznB5iSPVlQSLNaaH22ItWz3EJtQ10+OA==} + + chokidar@5.0.0: + resolution: {integrity: sha512-TQMmc3w+5AxjpL8iIiwebF73dRDF4fBIieAqGn9RGCWaEVwQ6Fb2cGe31Yns0RRIzii5goJ1Y7xbMwo1TxMplw==} + engines: {node: '>= 20.19.0'} + + chownr@3.0.0: + resolution: {integrity: sha512-+IxzY9BZOQd/XuYPRmrvEVjF/nqj5kgT4kEq7VofrDoM1MxoRjEWkrCC3EtLi59TVawxTAn+orJwFQcrqEN1+g==} + engines: {node: '>=18'} + + class-transformer@0.5.1: + resolution: {integrity: sha512-SQa1Ws6hUbfC98vKGxZH3KFY0Y1lm5Zm0SY8XX9zbK7FJCyVEac3ATW0RIpwzW+oOfmHE5PMPufDG9hCfoEOMw==} + + class-validator@0.14.4: + resolution: {integrity: sha512-AwNusCCam51q703dW82x95tOqQp6oC9HNUl724KxJJOfnKscI8dOloXFgyez7LbTTKWuRBA37FScqVbJEoq8Yw==} + + class-validator@0.15.1: + resolution: {integrity: sha512-LqoS80HBBSCVhz/3KloUly0ovokxpdOLR++Al3J3+dHXWt9sTKlKd4eYtoxhxyUjoe5+UcIM+5k9MIxyBWnRTw==} + + cli-cursor@5.0.0: + resolution: {integrity: sha512-aCj4O5wKyszjMmDT4tZj93kxyydN/K5zPWSCe6/0AV/AA1pqe5ZBIw0a2ZfPQV7lL5/yb5HsUreJ6UFAF1tEQw==} + engines: {node: '>=18'} + + cli-spinners@3.4.0: + resolution: {integrity: sha512-bXfOC4QcT1tKXGorxL3wbJm6XJPDqEnij2gQ2m7ESQuE+/z9YFIWnl/5RpTiKWbMq3EVKR4fRLJGn6DVfu0mpw==} + engines: {node: '>=18.20'} + + cli-width@4.1.0: + resolution: {integrity: sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==} + engines: {node: '>= 12'} + + commander@15.1.0: + resolution: {integrity: sha512-cgnQ88TRrWcC7pVq46RzJVRMktu3W2RcbnoidnfBsl1bmDCBwJS/udcIZpKoCrbAYYaCqsz1yZCVIgbIaU3ddQ==} + engines: {node: '>=22.12.0'} + + default-browser-id@5.0.1: + resolution: {integrity: sha512-x1VCxdX4t+8wVfd1so/9w+vQ4vx7lKd2Qp5tDRutErwmR85OgmfX7RlLRMWafRMY7hbEiXIbudNrjOAPa/hL8Q==} + engines: {node: '>=18'} + + default-browser@5.5.1: + resolution: {integrity: sha512-m1pAzaJgZ/gssEqlOhJkPJp8Xly7QyW6xcrkUa2KKcDeDSEMP7X8xipU3snUcfisTQx0w1AGae+9UtJSfVnXGw==} + engines: {node: '>=18'} + + define-lazy-prop@3.0.0: + resolution: {integrity: sha512-N+MeXYoqr3pOgn8xfyRPREN7gHakLYjhsHhWGT3fWAiL4IkAt0iDw14QiiEm2bE30c5XX5q0FtAA3CK5f9/BUg==} + engines: {node: '>=12'} + + defu@6.1.7: + resolution: {integrity: sha512-7z22QmUWiQ/2d0KkdYmANbRUVABpZ9SNYyH5vx6PZ+nE5bcC0l7uFvEfHlyld/HcGBFTL536ClDt3DEcSlEJAQ==} + + destr@2.0.5: + resolution: {integrity: sha512-ugFTXCtDZunbzasqBxrK93Ik/DRYsO6S/fedkWEMKqt04xZ4csmnmwGDBAb07QWNaGMAmnTIemsYZCksjATwsA==} + + dotenv@17.4.2: + resolution: {integrity: sha512-nI4U3TottKAcAD9LLud4Cb7b2QztQMUEfHbvhTH09bqXTxnSie8WnjPALV/WMCrJZ6UV/qHJ6L03OqO3LcdYZw==} + engines: {node: '>=12'} + + dotenv@18.0.10: + resolution: {integrity: sha512-89FAA1xchzK2mxVWdr5F/0rldwiueXs6zJM86rO66EzekR1iBdiXRthyG+m5GvkJaFH3C2LESzamTkgndmLT2A==} + engines: {node: '>=12'} + hasBin: true + + emojilib@2.4.0: + resolution: {integrity: sha512-5U0rVMU5Y2n2+ykNLQqMoqklN9ICBT/KsvC1Gz6vqHbz2AXXGkG+Pm5rMWk/8Vjrr/mY9985Hi8DYzn1F09Nyw==} + + fast-deep-equal@3.1.3: + resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} + + fast-string-truncated-width@3.0.3: + resolution: {integrity: sha512-0jjjIEL6+0jag3l2XWWizO64/aZVtpiGE3t0Zgqxv0DPuxiMjvB3M24fCyhZUO4KomJQPj3LTSUnDP3GpdwC0g==} + + fast-string-width@3.0.2: + resolution: {integrity: sha512-gX8LrtNEI5hq8DVUfRQMbr5lpaS4nMIWV+7XEbXk2b8kiQIizgnlr12B4dA3ZEx3308ze0O4Q1R+cHts8kyUJg==} + + fast-uri@3.1.9: + resolution: {integrity: sha512-hS/0Wt3Ya043oKXs0sIxrMpKQITXhMLIrVAKKXi4gozGC9v7YRWVnXIZzjNPTO02M9BdxLCWqK1yRXgNziVyJQ==} + + fast-wrap-ansi@0.2.2: + resolution: {integrity: sha512-7F2Fl+TjRSenLqlU3UjSH0iyqopqoZIu7eZVpEirP2g1GtWa2G/ecEmBdgz31+Mxr+ELclgg6sokpSFIQiZ02Q==} + + fflate@0.8.3: + resolution: {integrity: sha512-tbZNuJrLwGUp3zshBtdy4W+ORxZuIh8a5ilyIEQDC5rY1f3U20JMry0Ll3WBzU58EZKsEuJFXhb5gwv8CsPvgA==} + + fill-range@7.1.1: + resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} + engines: {node: '>=8'} + + get-east-asian-width@1.7.0: + resolution: {integrity: sha512-XjH1AECxf0giL2V1aU8vKyRR2ppRUb5c0EvT7zuJTokQ74bNo52zOtghqdWIqrhUD79fo3x0WfKZdOqxF6LG1Q==} + engines: {node: '>=18'} + + iconv-lite@0.7.3: + resolution: {integrity: sha512-IKXpvIzjnC9XTAUbVBcMfGS0EPaIXtW6v+zr+RRp+hqULEpo0owZax6wyRwPOJbWbzjYspQwusTsfVr0ifh4uQ==} + engines: {node: '>=0.10.0'} + + is-docker@3.0.0: + resolution: {integrity: sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + hasBin: true + + is-in-ssh@1.0.0: + resolution: {integrity: sha512-jYa6Q9rH90kR1vKB6NM7qqd1mge3Fx4Dhw5TVlK1MUBqhEOuCagrEHMevNuCcbECmXZ0ThXkRm+Ymr51HwEPAw==} + engines: {node: '>=20'} + + is-inside-container@1.0.0: + resolution: {integrity: sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA==} + engines: {node: '>=14.16'} + hasBin: true + + is-interactive@2.0.0: + resolution: {integrity: sha512-qP1vozQRI+BMOPcjFzrjXuQvdak2pHNUMZoeG2eRbiSqyvbEf/wQtEOTOX1guk6E3t36RkaqiSt8A/6YElNxLQ==} + engines: {node: '>=12'} + + is-number@7.0.0: + resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} + engines: {node: '>=0.12.0'} + + is-unicode-supported@2.1.0: + resolution: {integrity: sha512-mE00Gnza5EEB3Ds0HfMyllZzbBrmLOX3vfWoj9A9PEnTfratQ/BcaJOuMhnkhjXvb2+FkY3VuHqtAGpTPmglFQ==} + engines: {node: '>=18'} + + is-wsl@3.1.1: + resolution: {integrity: sha512-e6rvdUCiQCAuumZslxRJWR/Doq4VpPR82kqclvcS0efgt430SlGIk05vdCN58+VrzgtIcfNODjozVielycD4Sw==} + engines: {node: '>=16'} + + json-schema-traverse@1.0.0: + resolution: {integrity: sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==} + + jsonc-parser@3.3.1: + resolution: {integrity: sha512-HUgH65KyejrUFPvHFPbqOY0rsFip3Bo5wb4ngvdi1EpCYWUQDC5V+Y7mZws+DLkr4M//zQJoanu1SP+87Dv1oQ==} + + konva@10.9.1: + resolution: {integrity: sha512-m49x+GatSxEUSvqahYhxpTjgKbtrLtw4P4o4B4iux953ZFpceaK52Ea+CFsAsd7W4I0Y5u6mMoRUsY/eltNZmw==} + peerDependencies: + canvas: ^3.0.0 + skia-canvas: ^3.0.0 + peerDependenciesMeta: + canvas: + optional: true + skia-canvas: + optional: true + + libphonenumber-js@1.13.16: + resolution: {integrity: sha512-tIOCM9yx2Go6d5/ZANe0K+G4AZek1Ymx81HxQpf19Sri4zMP95eQbKdnUGHAvFQ4nx0PeLhFqvAfisTADXj3tQ==} + + log-symbols@7.0.1: + resolution: {integrity: sha512-ja1E3yCr9i/0hmBVaM0bfwDjnGy8I/s6PP4DFp+yP+a+mrHO4Rm7DtmnqROTUkHIkqffC84YY7AeqX6oFk0WFg==} + engines: {node: '>=18'} + + magic-string@1.4.1: + resolution: {integrity: sha512-8lyCu36ErXR0J9uaGKlKQoiLZKmtI63YGLE8G2o9jyRPdr4X47LusSOwgOJOzcVtp81fTAAjxR7BwKz682Jhow==} + + micromatch@4.0.8: + resolution: {integrity: sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==} + engines: {node: '>=8.6'} + + mimic-function@5.0.1: + resolution: {integrity: sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==} + engines: {node: '>=18'} + + minipass@7.1.3: + resolution: {integrity: sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A==} + engines: {node: '>=16 || 14 >=14.17'} + + minizlib@3.1.0: + resolution: {integrity: sha512-KZxYo1BUkWD2TVFLr0MQoM8vUUigWD3LlD83a/75BqC+4qE0Hb1Vo5v1FgcfaNXvfXzr+5EhQ6ing/CaBijTlw==} + engines: {node: '>= 18'} + + mute-stream@4.0.0: + resolution: {integrity: sha512-gSrprq0fJ3EiOErzjdIZrjysVVmJ4uu1QWfCDss5LypA5OXvrMje5Ym5z6V6RLyJ2eF87lasX7t6a0AnFvZblg==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + + node-emoji@2.2.0: + resolution: {integrity: sha512-Z3lTE9pLaJF47NyMhd4ww1yFTAP8YhYI8SleJiHzM46Fgpm5cnNzSl9XfzFNqbaz+VlJrIj3fXQ4DeN1Rjm6cw==} + engines: {node: '>=18'} + + onetime@7.0.0: + resolution: {integrity: sha512-VXJjc87FScF88uafS3JllDgvAm+c/Slfz06lorj2uAY34rlUu0Nt+v8wreiImcrgAjjIHp1rXpTDlLOGw29WwQ==} + engines: {node: '>=18'} + + open@11.0.4: + resolution: {integrity: sha512-++Zlftm0kVLPmzC06t6epuWmcRMDbI4z5P3NNX979WA/k23+NtSOynEGzsVfZwguKw2mi5umVgnBlJQMwRz4Pg==} + engines: {node: '>=20'} + + ora@9.4.1: + resolution: {integrity: sha512-6VlU9MLXbjVQD04AZCMX28hVtA5bUoadvUqO76MUCVA0ilwJbMiHsITRPfyVm6p/BC0Av/BXMujx39WCe1LEqw==} + engines: {node: '>=20'} + + picomatch@2.3.2: + resolution: {integrity: sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==} + engines: {node: '>=8.6'} + + picomatch@4.0.7: + resolution: {integrity: sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA==} + engines: {node: '>=12'} + + powershell-utils@0.2.1: + resolution: {integrity: sha512-C+y9x90UElAddDZmV4qOx9W53B61PO7cIqWz2dQsWlwswuq4mr8NEwytdGKboYbQlGZ3awrkTeNvcZiZNHnQ8A==} + engines: {node: '>=20'} + + rc9@3.1.0: + resolution: {integrity: sha512-ufjkNVzbRHKcCOmTahZkmVsyc3W+MSk3jY03m+a7tGHkIsdVMG9l10/3HvFbWkkKzY5VFp3pkRsIo/UYgmFL7Q==} + + readdirp@5.1.1: + resolution: {integrity: sha512-Kko+Y5XQ6fM+Ce3dq3m9YGxnacYZYl9cA1wZjaF3Vbry2L3i1qVg8+CAgNPsXRArPMUMCaOR7oa9Nqntc43JKA==} + engines: {node: '>= 20.19.0'} + + require-from-string@2.0.2: + resolution: {integrity: sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==} + engines: {node: '>=0.10.0'} + + restore-cursor@5.1.0: + resolution: {integrity: sha512-oMA2dcrw6u0YfxJQXm342bFKX/E4sG9rbTzO9ptUcR/e8A33cHuvStiYOwH7fszkZlZ1z/ta9AAoPk2F4qIOHA==} + engines: {node: '>=18'} + + rolldown@1.3.2: + resolution: {integrity: sha512-EFHqbVkXiYZA6akmYm2bvJhNbEGdUwAResRhYwl/BO8QhB5KxsG+t3RVHJSIOy5jBEb0XCACvrIGnnl6Z8sMGA==} + engines: {node: ^20.19.0 || >=22.12.0} + hasBin: true + + run-applescript@7.1.0: + resolution: {integrity: sha512-DPe5pVFaAsinSaV6QjQ6gdiedWDcRCbUuiQfQa2wmWV7+xC9bGulGI8+TdRmoFkAPaBXk8CrAbnlY2ISniJ47Q==} + engines: {node: '>=18'} + + rxjs@7.8.2: + resolution: {integrity: sha512-dhKf903U/PQZY6boNNtAGdWbG85WAbjT/1xYoZIC7FAY0yWapOBQVsVrDl58W86//e1VpMNBtRV4MaXfdMySFA==} + + safer-buffer@2.1.2: + resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} + + semver@7.8.6: + resolution: {integrity: sha512-9lpSSU4Mly3mrtruwLs1eLK6+gzbzqeBFwRNjIjE+9LuDpWdYctrQlQ3ej1Ilgi7gknpsTRnPoLP8DpCHqHIJw==} + engines: {node: '>=10'} + hasBin: true + + signal-exit@4.1.0: + resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} + engines: {node: '>=14'} + + skin-tone@2.0.0: + resolution: {integrity: sha512-kUMbT1oBJCpgrnKoSr0o6wPtvRWT9W9UKvGLwfJYO2WuahZRHOpEyL1ckyMGgMWh0UdpmaoFqKKD29WTomNEGA==} + engines: {node: '>=8'} + + source-map@0.8.0: + resolution: {integrity: sha512-d8EqvL+k/SOXCreS/SUzg2ciyHqBBLcN/yuRjFsbvVhHTE2pgei7oAhmPM7kWFbkX6OSMQfUq4KbkF3au9lhYQ==} + engines: {node: '>= 12'} + + stdin-discarder@0.3.2: + resolution: {integrity: sha512-eCPu1qRxPVkl5605OTWF8Wz40b4Mf45NY5LQmVPQ599knfs5QhASUm9GbJ5BDMDOXgrnh0wyEdvzmL//YMlw0A==} + engines: {node: '>=18'} + + string-width@8.3.0: + resolution: {integrity: sha512-ZbmZM0JCihQN91dWnxoipT2KOEyHqEyfRXUyjuRhW8b/xnqPDoq4gWEVApTVa9db2wN8mmoikgFBbjh71+cGeQ==} + engines: {node: '>=20'} + + strip-ansi@7.2.0: + resolution: {integrity: sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==} + engines: {node: '>=12'} + + tar@7.5.23: + resolution: {integrity: sha512-lkukzdoGngZHJZXxW4S/E4Fp9ghTDlyZXrQGRNoJ/LXvDKcXUTq2sg5yQe74po7Voea6n/IN09+wE/QvJMiifA==} + engines: {node: '>=18'} + + to-regex-range@5.0.1: + resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} + engines: {node: '>=8.0'} + + tslib@2.9.1: + resolution: {integrity: sha512-a4Ux9VKuIMHsOS7ENbEq6hK2ZGYIT27Rtl0E4eD9KqwxhKiQeMZE/9xb3IdYwWaSOyIBQLExhQgXDTYoiCxnWA==} + + typescript@6.0.3: + resolution: {integrity: sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw==} + engines: {node: '>=14.17'} + hasBin: true + + unicode-emoji-modifier-base@1.0.0: + resolution: {integrity: sha512-yLSH4py7oFH3oG/9K+XWrz1pSi3dfUrWEnInbxMfArOfc1+33BlGPQtLsOYwvdMy11AwUBetYuaRxSPqgkq+8g==} + engines: {node: '>=4'} + + unrun@0.3.1: + resolution: {integrity: sha512-onIck/oNnCaytwths1ZVp1LK2Gq2hPoyFhiHebObuUXqR3S0uHuLLaBK8K6mRRgV7Ptip8AnNvaUsgzwWwBZuA==} + engines: {node: ^22.13.0 || >=24.0.0} + hasBin: true + peerDependencies: + synckit: ^0.11.11 + peerDependenciesMeta: + synckit: + optional: true + + validator@13.15.35: + resolution: {integrity: sha512-TQ5pAGhd5whStmqWvYF4OjQROlmv9SMFVt37qoCBdqRffuuklWYQlCNnEs2ZaIBD1kZRNnikiZOS1eqgkar0iw==} + engines: {node: '>= 0.10'} + + wsl-utils@1.0.1: + resolution: {integrity: sha512-c16PKLIRxBYpR3jSWsdS7SFp0COm5SOQdiFjY818dYFHJbMGuLBszpF07LBWmOS1uzrHa9VGdynsEgoeKy0oOQ==} + engines: {node: '>=20'} + + yallist@5.0.0: + resolution: {integrity: sha512-YgvUTfwqyc7UXVMrB+SImsVYSmTS8X/tSrtdNZMImM+n7+QTriRXyXim0mBrTXNeqzVF0KWGgHPeiyViFFrNDw==} + engines: {node: '>=18'} + + yoctocolors@2.2.0: + resolution: {integrity: sha512-xYqdZFUK/VYazNl/oCDYN+3WloWQwMfZxBoiNt6qNyk+xfOdi598muWE42rNZFp1kNOiqW936q5RhUdnpqElSg==} + engines: {node: '>=18'} + + zod@4.6.7: + resolution: {integrity: sha512-g8W2D2kU6a8untc053fX1uVBKzM7yqAxW/3zwk83+6RyF2+SKOuV+c0wBDhUwzV1PaGapmZH+rmcUzPf+3CGwg==} + +snapshots: + + '@angular-devkit/core@22.2.7(chokidar@5.0.0)': + dependencies: + ajv: 8.20.0 + ajv-formats: 3.0.1(ajv@8.20.0) + jsonc-parser: 3.3.1 + picomatch: 4.0.7 + rxjs: 7.8.2 + source-map: 0.8.0 + optionalDependencies: + chokidar: 5.0.0 + + '@angular-devkit/schematics-cli@22.2.7(chokidar@5.0.0)': + dependencies: + '@angular-devkit/core': 22.2.7(chokidar@5.0.0) + '@angular-devkit/schematics': 22.2.7(chokidar@5.0.0) + '@inquirer/prompts': 8.7.2 + transitivePeerDependencies: + - '@types/node' + - chokidar + + '@angular-devkit/schematics@22.2.7(chokidar@5.0.0)': + dependencies: + '@angular-devkit/core': 22.2.7(chokidar@5.0.0) + jsonc-parser: 3.3.1 + magic-string: 1.4.1 + ora: 9.4.1 + rxjs: 7.8.2 + transitivePeerDependencies: + - chokidar + + '@emnapi/core@2.0.0-beta.2': + dependencies: + '@emnapi/wasi-threads': 2.2.0 + tslib: 2.9.1 + optional: true + + '@emnapi/runtime@2.0.0-beta.2': + dependencies: + tslib: 2.9.1 + optional: true + + '@emnapi/wasi-threads@2.2.0': + dependencies: + tslib: 2.9.1 + optional: true + + '@inquirer/ansi@2.1.0': {} + + '@inquirer/checkbox@5.3.0': + dependencies: + '@inquirer/ansi': 2.1.0 + '@inquirer/core': 12.1.0 + '@inquirer/figures': 2.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/confirm@6.4.0': + dependencies: + '@inquirer/core': 12.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/core@12.1.0': + dependencies: + '@inquirer/ansi': 2.1.0 + '@inquirer/figures': 2.1.0 + '@inquirer/type': 4.3.0 + cli-width: 4.1.0 + fast-wrap-ansi: 0.2.2 + mute-stream: 4.0.0 + signal-exit: 4.1.0 + + '@inquirer/editor@5.4.0': + dependencies: + '@inquirer/core': 12.1.0 + '@inquirer/external-editor': 3.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/expand@5.2.0': + dependencies: + '@inquirer/core': 12.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/external-editor@3.1.0': + dependencies: + chardet: 2.2.0 + iconv-lite: 0.7.3 + + '@inquirer/figures@2.1.0': {} + + '@inquirer/input@5.2.0': + dependencies: + '@inquirer/core': 12.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/number@4.3.0': + dependencies: + '@inquirer/core': 12.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/password@5.3.0': + dependencies: + '@inquirer/ansi': 2.1.0 + '@inquirer/core': 12.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/prompts@8.7.2': + dependencies: + '@inquirer/checkbox': 5.3.0 + '@inquirer/confirm': 6.4.0 + '@inquirer/editor': 5.4.0 + '@inquirer/expand': 5.2.0 + '@inquirer/input': 5.2.0 + '@inquirer/number': 4.3.0 + '@inquirer/password': 5.3.0 + '@inquirer/rawlist': 5.4.0 + '@inquirer/search': 4.4.0 + '@inquirer/select': 5.3.0 + + '@inquirer/prompts@8.8.0': + dependencies: + '@inquirer/checkbox': 5.3.0 + '@inquirer/confirm': 6.4.0 + '@inquirer/editor': 5.4.0 + '@inquirer/expand': 5.2.0 + '@inquirer/input': 5.2.0 + '@inquirer/number': 4.3.0 + '@inquirer/password': 5.3.0 + '@inquirer/rawlist': 5.4.0 + '@inquirer/search': 4.4.0 + '@inquirer/select': 5.3.0 + + '@inquirer/rawlist@5.4.0': + dependencies: + '@inquirer/core': 12.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/search@4.4.0': + dependencies: + '@inquirer/core': 12.1.0 + '@inquirer/figures': 2.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/select@5.3.0': + dependencies: + '@inquirer/ansi': 2.1.0 + '@inquirer/core': 12.1.0 + '@inquirer/figures': 2.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/type@4.3.0': {} + + '@isaacs/fs-minipass@4.0.1': + dependencies: + minipass: 7.1.3 + + '@jridgewell/sourcemap-codec@1.6.0': {} + + '@nanoforge-dev/asset@3.0.0': + dependencies: + '@nanoforge-dev/common': 3.0.0 + + '@nanoforge-dev/cli@3.0.1': + dependencies: + '@angular-devkit/schematics': 22.2.7(chokidar@5.0.0) + '@angular-devkit/schematics-cli': 22.2.7(chokidar@5.0.0) + '@inquirer/prompts': 8.8.0 + '@nanoforge-dev/config': 3.0.1 + '@nanoforge-dev/editor': 0.1.4 + '@nanoforge-dev/loader-client': 1.7.0 + '@nanoforge-dev/loader-server': 1.7.0 + '@nanoforge-dev/registry': 3.0.1 + '@nanoforge-dev/schematics': 3.0.1(chokidar@5.0.0) + ansis: 4.5.0 + bun: 1.4.4 + chokidar: 5.0.0 + commander: 15.1.0 + dotenv: 18.0.10 + node-emoji: 2.2.0 + open: 11.0.4 + ora: 9.4.1 + rc9: 3.1.0 + transitivePeerDependencies: + - '@types/node' + - synckit + + '@nanoforge-dev/common@3.0.0': {} + + '@nanoforge-dev/config@3.0.1': + dependencies: + unrun: 0.3.1 + zod: 4.6.7 + transitivePeerDependencies: + - synckit + + '@nanoforge-dev/core@3.0.0': + dependencies: + '@nanoforge-dev/asset': 3.0.0 + '@nanoforge-dev/common': 3.0.0 + + '@nanoforge-dev/ecs@3.0.0(@nanoforge-dev/editor-lib@3.0.0)(@nanoforge-dev/scene@3.0.0(@nanoforge-dev/editor-lib@3.0.0))': + dependencies: + '@nanoforge-dev/common': 3.0.0 + optionalDependencies: + '@nanoforge-dev/editor-lib': 3.0.0 + '@nanoforge-dev/scene': 3.0.0(@nanoforge-dev/editor-lib@3.0.0) + + '@nanoforge-dev/editor-lib@3.0.0': + dependencies: + '@nanoforge-dev/common': 3.0.0 + + '@nanoforge-dev/editor@0.1.4': + dependencies: + bun: 1.4.4 + class-transformer: 0.5.1 + class-validator: 0.15.1 + dotenv: 17.4.2 + micromatch: 4.0.8 + tar: 7.5.23 + typescript: 6.0.3 + + '@nanoforge-dev/env@3.0.0': + dependencies: + '@nanoforge-dev/common': 3.0.0 + class-transformer: 0.5.1 + class-validator: 0.14.4 + + '@nanoforge-dev/graphics-2d@3.0.0': + dependencies: + '@nanoforge-dev/common': 3.0.0 + konva: 10.9.1 + transitivePeerDependencies: + - canvas + - skia-canvas + + '@nanoforge-dev/input@3.0.0': + dependencies: + '@nanoforge-dev/common': 3.0.0 + + '@nanoforge-dev/loader-client@1.7.0': + dependencies: + '@nanoforge-dev/loader-website': 1.7.0 + bun: 1.4.4 + commander: 15.1.0 + + '@nanoforge-dev/loader-server@1.7.0': + dependencies: + bun: 1.4.4 + commander: 15.1.0 + + '@nanoforge-dev/loader-website@1.7.0': {} + + '@nanoforge-dev/registry@3.0.1': + dependencies: + fflate: 0.8.3 + semver: 7.8.6 + zod: 4.6.7 + + '@nanoforge-dev/scene@3.0.0(@nanoforge-dev/editor-lib@3.0.0)': + dependencies: + '@nanoforge-dev/common': 3.0.0 + optionalDependencies: + '@nanoforge-dev/editor-lib': 3.0.0 + + '@nanoforge-dev/schematics@3.0.1(chokidar@5.0.0)': + dependencies: + '@angular-devkit/core': 22.2.7(chokidar@5.0.0) + '@angular-devkit/schematics': 22.2.7(chokidar@5.0.0) + rxjs: 7.8.2 + transitivePeerDependencies: + - chokidar + + '@napi-rs/wasm-runtime@1.2.6(@emnapi/core@2.0.0-beta.2)(@emnapi/runtime@2.0.0-beta.2)': + dependencies: + '@emnapi/core': 2.0.0-beta.2 + '@emnapi/runtime': 2.0.0-beta.2 + '@tybys/wasm-util': 0.10.4 + optional: true + + '@oven/bun-darwin-aarch64@1.4.4': + optional: true + + '@oven/bun-darwin-x64@1.4.4': + optional: true + + '@oven/bun-freebsd-aarch64@1.4.4': + optional: true + + '@oven/bun-freebsd-x64@1.4.4': + optional: true + + '@oven/bun-linux-aarch64-android@1.4.4': + optional: true + + '@oven/bun-linux-aarch64-musl@1.4.4': + optional: true + + '@oven/bun-linux-aarch64@1.4.4': + optional: true + + '@oven/bun-linux-x64-android@1.4.4': + optional: true + + '@oven/bun-linux-x64-musl@1.4.4': + optional: true + + '@oven/bun-linux-x64@1.4.4': + optional: true + + '@oven/bun-windows-aarch64@1.4.4': + optional: true + + '@oven/bun-windows-x64@1.4.4': + optional: true + + '@oxc-project/types@0.158.0': {} + + '@rolldown/binding-android-arm-eabi@1.3.2': + optional: true + + '@rolldown/binding-android-arm64@1.3.2': + optional: true + + '@rolldown/binding-darwin-arm64@1.3.2': + optional: true + + '@rolldown/binding-darwin-x64@1.3.2': + optional: true + + '@rolldown/binding-freebsd-x64@1.3.2': + optional: true + + '@rolldown/binding-linux-arm-gnueabihf@1.3.2': + optional: true + + '@rolldown/binding-linux-arm64-gnu@1.3.2': + optional: true + + '@rolldown/binding-linux-arm64-musl@1.3.2': + optional: true + + '@rolldown/binding-linux-ppc64-gnu@1.3.2': + optional: true + + '@rolldown/binding-linux-s390x-gnu@1.3.2': + optional: true + + '@rolldown/binding-linux-x64-gnu@1.3.2': + optional: true + + '@rolldown/binding-linux-x64-musl@1.3.2': + optional: true + + '@rolldown/binding-openharmony-arm64@1.3.2': + optional: true + + '@rolldown/binding-wasm32-wasi@1.3.2': + dependencies: + '@emnapi/core': 2.0.0-beta.2 + '@emnapi/runtime': 2.0.0-beta.2 + '@napi-rs/wasm-runtime': 1.2.6(@emnapi/core@2.0.0-beta.2)(@emnapi/runtime@2.0.0-beta.2) + optional: true + + '@rolldown/binding-win32-arm64-msvc@1.3.2': + optional: true + + '@rolldown/binding-win32-x64-msvc@1.3.2': + optional: true + + '@rolldown/pluginutils@1.1.0': {} + + '@sindresorhus/is@4.6.0': {} + + '@tybys/wasm-util@0.10.4': + dependencies: + tslib: 2.9.1 + optional: true + + '@types/validator@13.15.10': {} + + ajv-formats@3.0.1(ajv@8.20.0): + optionalDependencies: + ajv: 8.20.0 + + ajv@8.20.0: + dependencies: + fast-deep-equal: 3.1.3 + fast-uri: 3.1.9 + json-schema-traverse: 1.0.0 + require-from-string: 2.0.2 + + ansi-regex@6.6.0: {} + + ansis@4.5.0: {} + + braces@3.0.3: + dependencies: + fill-range: 7.1.1 + + bun@1.4.4: + optionalDependencies: + '@oven/bun-darwin-aarch64': 1.4.4 + '@oven/bun-darwin-x64': 1.4.4 + '@oven/bun-freebsd-aarch64': 1.4.4 + '@oven/bun-freebsd-x64': 1.4.4 + '@oven/bun-linux-aarch64': 1.4.4 + '@oven/bun-linux-aarch64-android': 1.4.4 + '@oven/bun-linux-aarch64-musl': 1.4.4 + '@oven/bun-linux-x64': 1.4.4 + '@oven/bun-linux-x64-android': 1.4.4 + '@oven/bun-linux-x64-musl': 1.4.4 + '@oven/bun-windows-aarch64': 1.4.4 + '@oven/bun-windows-x64': 1.4.4 + + bundle-name@4.1.1: + dependencies: + run-applescript: 7.1.0 + + chalk@5.6.2: {} + + char-regex@1.0.2: {} + + chardet@2.2.0: {} + + chokidar@5.0.0: + dependencies: + readdirp: 5.1.1 + + chownr@3.0.0: {} + + class-transformer@0.5.1: {} + + class-validator@0.14.4: + dependencies: + '@types/validator': 13.15.10 + libphonenumber-js: 1.13.16 + validator: 13.15.35 + + class-validator@0.15.1: + dependencies: + '@types/validator': 13.15.10 + libphonenumber-js: 1.13.16 + validator: 13.15.35 + + cli-cursor@5.0.0: + dependencies: + restore-cursor: 5.1.0 + + cli-spinners@3.4.0: {} + + cli-width@4.1.0: {} + + commander@15.1.0: {} + + default-browser-id@5.0.1: {} + + default-browser@5.5.1: + dependencies: + bundle-name: 4.1.1 + default-browser-id: 5.0.1 + + define-lazy-prop@3.0.0: {} + + defu@6.1.7: {} + + destr@2.0.5: {} + + dotenv@17.4.2: {} + + dotenv@18.0.10: {} + + emojilib@2.4.0: {} + + fast-deep-equal@3.1.3: {} + + fast-string-truncated-width@3.0.3: {} + + fast-string-width@3.0.2: + dependencies: + fast-string-truncated-width: 3.0.3 + + fast-uri@3.1.9: {} + + fast-wrap-ansi@0.2.2: + dependencies: + fast-string-width: 3.0.2 + + fflate@0.8.3: {} + + fill-range@7.1.1: + dependencies: + to-regex-range: 5.0.1 + + get-east-asian-width@1.7.0: {} + + iconv-lite@0.7.3: + dependencies: + safer-buffer: 2.1.2 + + is-docker@3.0.0: {} + + is-in-ssh@1.0.0: {} + + is-inside-container@1.0.0: + dependencies: + is-docker: 3.0.0 + + is-interactive@2.0.0: {} + + is-number@7.0.0: {} + + is-unicode-supported@2.1.0: {} + + is-wsl@3.1.1: + dependencies: + is-inside-container: 1.0.0 + + json-schema-traverse@1.0.0: {} + + jsonc-parser@3.3.1: {} + + konva@10.9.1: {} + + libphonenumber-js@1.13.16: {} + + log-symbols@7.0.1: + dependencies: + is-unicode-supported: 2.1.0 + yoctocolors: 2.2.0 + + magic-string@1.4.1: + dependencies: + '@jridgewell/sourcemap-codec': 1.6.0 + + micromatch@4.0.8: + dependencies: + braces: 3.0.3 + picomatch: 2.3.2 + + mimic-function@5.0.1: {} + + minipass@7.1.3: {} + + minizlib@3.1.0: + dependencies: + minipass: 7.1.3 + + mute-stream@4.0.0: {} + + node-emoji@2.2.0: + dependencies: + '@sindresorhus/is': 4.6.0 + char-regex: 1.0.2 + emojilib: 2.4.0 + skin-tone: 2.0.0 + + onetime@7.0.0: + dependencies: + mimic-function: 5.0.1 + + open@11.0.4: + dependencies: + default-browser: 5.5.1 + define-lazy-prop: 3.0.0 + is-in-ssh: 1.0.0 + is-inside-container: 1.0.0 + powershell-utils: 0.2.1 + wsl-utils: 1.0.1 + + ora@9.4.1: + dependencies: + chalk: 5.6.2 + cli-cursor: 5.0.0 + cli-spinners: 3.4.0 + is-interactive: 2.0.0 + is-unicode-supported: 2.1.0 + log-symbols: 7.0.1 + stdin-discarder: 0.3.2 + string-width: 8.3.0 + + picomatch@2.3.2: {} + + picomatch@4.0.7: {} + + powershell-utils@0.2.1: {} + + rc9@3.1.0: + dependencies: + defu: 6.1.7 + destr: 2.0.5 + + readdirp@5.1.1: {} + + require-from-string@2.0.2: {} + + restore-cursor@5.1.0: + dependencies: + onetime: 7.0.0 + signal-exit: 4.1.0 + + rolldown@1.3.2: + dependencies: + '@oxc-project/types': 0.158.0 + '@rolldown/pluginutils': 1.1.0 + optionalDependencies: + '@rolldown/binding-android-arm-eabi': 1.3.2 + '@rolldown/binding-android-arm64': 1.3.2 + '@rolldown/binding-darwin-arm64': 1.3.2 + '@rolldown/binding-darwin-x64': 1.3.2 + '@rolldown/binding-freebsd-x64': 1.3.2 + '@rolldown/binding-linux-arm-gnueabihf': 1.3.2 + '@rolldown/binding-linux-arm64-gnu': 1.3.2 + '@rolldown/binding-linux-arm64-musl': 1.3.2 + '@rolldown/binding-linux-ppc64-gnu': 1.3.2 + '@rolldown/binding-linux-s390x-gnu': 1.3.2 + '@rolldown/binding-linux-x64-gnu': 1.3.2 + '@rolldown/binding-linux-x64-musl': 1.3.2 + '@rolldown/binding-openharmony-arm64': 1.3.2 + '@rolldown/binding-wasm32-wasi': 1.3.2 + '@rolldown/binding-win32-arm64-msvc': 1.3.2 + '@rolldown/binding-win32-x64-msvc': 1.3.2 + + run-applescript@7.1.0: {} + + rxjs@7.8.2: + dependencies: + tslib: 2.9.1 + + safer-buffer@2.1.2: {} + + semver@7.8.6: {} + + signal-exit@4.1.0: {} + + skin-tone@2.0.0: + dependencies: + unicode-emoji-modifier-base: 1.0.0 + + source-map@0.8.0: {} + + stdin-discarder@0.3.2: {} + + string-width@8.3.0: + dependencies: + get-east-asian-width: 1.7.0 + strip-ansi: 7.2.0 + + strip-ansi@7.2.0: + dependencies: + ansi-regex: 6.6.0 + + tar@7.5.23: + dependencies: + '@isaacs/fs-minipass': 4.0.1 + chownr: 3.0.0 + minipass: 7.1.3 + minizlib: 3.1.0 + yallist: 5.0.0 + + to-regex-range@5.0.1: + dependencies: + is-number: 7.0.0 + + tslib@2.9.1: {} + + typescript@6.0.3: {} + + unicode-emoji-modifier-base@1.0.0: {} + + unrun@0.3.1: + dependencies: + rolldown: 1.3.2 + + validator@13.15.35: {} + + wsl-utils@1.0.1: + dependencies: + is-wsl: 3.1.1 + powershell-utils: 0.2.1 + + yallist@5.0.0: {} + + yoctocolors@2.2.0: {} + + zod@4.6.7: {} diff --git a/demos/pong/pnpm-workspace.yaml b/demos/pong/pnpm-workspace.yaml new file mode 100644 index 0000000..96ca535 --- /dev/null +++ b/demos/pong/pnpm-workspace.yaml @@ -0,0 +1,5 @@ +allowBuilds: + bun: true +# NanoForge packages are ours: take a release as soon as it is out. +minimumReleaseAgeExclude: + - "@nanoforge-dev/*" diff --git a/demos/pong/src/collisions.ts b/demos/pong/src/collisions.ts new file mode 100644 index 0000000..fa825fa --- /dev/null +++ b/demos/pong/src/collisions.ts @@ -0,0 +1,32 @@ +import type { HitboxRect2D } from "./components/hitbox-rect-2d.component"; +import type { Position2D } from "./components/position-2d.component"; +import type { Velocity2D } from "./components/velocity-2d.component"; + +/** Whether two hitboxes overlap (touching edges don't). */ +export const overlap = (a: Position2D, aBox: HitboxRect2D, b: Position2D, bBox: HitboxRect2D) => + a.x < b.x + bBox.width && + a.x + aBox.width > b.x && + a.y < b.y + bBox.height && + a.y + aBox.height > b.y; + +/** + * Pushes `a` out of `b` on the axis it went in the least. On that axis, its velocity turns away + * from `b` when it `bounces`, and stops otherwise. + */ +export const pushOut = ( + a: Position2D, + aBox: HitboxRect2D, + velocity: Velocity2D, + b: Position2D, + bBox: HitboxRect2D, + bounces: boolean, +) => { + const left = a.x + aBox.width - b.x; + const right = b.x + bBox.width - a.x; + const up = a.y + aBox.height - b.y; + const down = b.y + bBox.height - a.y; + const axis = Math.min(left, right) < Math.min(up, down) ? "x" : "y"; + const back = axis === "x" ? left < right : up < down; + a[axis] += back ? -(axis === "x" ? left : up) : axis === "x" ? right : down; + velocity[axis] = bounces ? (back ? -1 : 1) * Math.abs(velocity[axis]) : 0; +}; diff --git a/demos/pong/src/components/acceleration-2d.component.ts b/demos/pong/src/components/acceleration-2d.component.ts new file mode 100644 index 0000000..5d4097f --- /dev/null +++ b/demos/pong/src/components/acceleration-2d.component.ts @@ -0,0 +1,18 @@ +/** + * How fast the velocity of an entity changes, in pixels per second, per second. Needs + * `Velocity2D` and the `move2D` system. + * + * @component + * @side shared + * @group Acceleration color=#f0a33a - Pixels per second, per second. + */ +export class Acceleration2D { + name = "Acceleration2D"; + + constructor( + /** Added to the horizontal velocity every second. @group Acceleration @preset vector.x */ + public x = 0, + /** Added to the vertical velocity every second. @group Acceleration @preset vector.y */ + public y = 0, + ) {} +} diff --git a/demos/pong/src/components/ball.component.ts b/demos/pong/src/components/ball.component.ts new file mode 100644 index 0000000..b39d38d --- /dev/null +++ b/demos/pong/src/components/ball.component.ts @@ -0,0 +1,10 @@ +/** + * A ball: it bounces off `Paddle` and `Wall` entities, and scores in `Goal` entities. Needs + * `Position2D`, `Velocity2D`, `HitboxRect2D` and the `bounceBall` system. + * + * @component + * @side shared + */ +export class Ball { + name = "Ball"; +} diff --git a/demos/pong/src/components/drawable-circle-2d.component.ts b/demos/pong/src/components/drawable-circle-2d.component.ts new file mode 100644 index 0000000..1066155 --- /dev/null +++ b/demos/pong/src/components/drawable-circle-2d.component.ts @@ -0,0 +1,62 @@ +import type { AssetContext } from "@nanoforge-dev/common"; +import { Circle, type Layer } from "@nanoforge-dev/graphics-2d"; +import type { Position2D } from "./position-2d.component"; + +import { imageFill } from "../image-fill"; + +/** + * Draws a circle at the entity's `Position2D` (its center). Needs the `draw2D` system. + * + * @remarks + * `shape` is the Konva `Circle` on screen: change it from code for anything the parameters don't + * offer (shadows, strokes...). + * + * @component + * @side client + * @group Shape color=#e86fb0 - Size of the circle. + * @group Look color=#b18cff - What the circle looks like. + * @group Advanced hidden - Less common settings. + */ +export class DrawableCircle2D { + name = "DrawableCircle2D"; + + /** The circle on screen, made by `draw2D` the first time it draws it. */ + shape?: Circle; + + constructor( + /** In pixels. @group Shape */ + public radius = 25, + /** A CSS color: `red`, `#ff0000`, `rgba(255, 0, 0, 0.5)`... @group Look @preset color */ + public fillColor = "#4aa3ff", + /** An image stretched over the circle, shown instead of the color. @group Look @asset .png .jpg .jpeg .gif .webp .svg */ + public image = "", + /** From 0 (invisible) to 1 (opaque). @group Look */ + public opacity = 1, + /** Clockwise, in degrees, around the center. @group Advanced */ + public rotation = 0, + /** Whether it is drawn. @group Advanced */ + public visible = true, + ) {} + + /** Puts the circle on `layer` at `position`, up to date with the parameters. */ + draw(layer: Layer, position: Position2D, assets: AssetContext): void { + this.shape ??= new Circle(); + if (this.shape.getParent() !== layer) layer.add(this.shape); + this.shape.setAttrs({ + x: position.x, + y: position.y, + radius: this.radius, + fill: this.fillColor, + opacity: this.opacity, + rotation: this.rotation, + visible: this.visible, + ...imageFill(assets, this.image, this.radius * 2, this.radius * 2, true), + }); + } + + /** Removes the circle from the screen. */ + destroy(): void { + this.shape?.destroy(); + this.shape = undefined; + } +} diff --git a/demos/pong/src/components/drawable-rect-2d.component.ts b/demos/pong/src/components/drawable-rect-2d.component.ts new file mode 100644 index 0000000..d3586ca --- /dev/null +++ b/demos/pong/src/components/drawable-rect-2d.component.ts @@ -0,0 +1,69 @@ +import type { AssetContext } from "@nanoforge-dev/common"; +import { type Layer, Rect } from "@nanoforge-dev/graphics-2d"; +import type { Position2D } from "./position-2d.component"; + +import { imageFill } from "../image-fill"; + +/** + * Draws a rectangle at the entity's `Position2D` (its top-left corner). Needs the `draw2D` + * system. + * + * @remarks + * `shape` is the Konva `Rect` on screen: change it from code for anything the parameters don't + * offer (shadows, strokes...). + * + * @component + * @side client + * @group Shape color=#e86fb0 - Size of the rectangle. + * @group Look color=#b18cff - What the rectangle looks like. + * @group Advanced hidden - Less common settings. + */ +export class DrawableRect2D { + name = "DrawableRect2D"; + + /** The rectangle on screen, made by `draw2D` the first time it draws it. */ + shape?: Rect; + + constructor( + /** In pixels. @group Shape @preset size.width */ + public width = 50, + /** In pixels. @group Shape @preset size.height */ + public height = 50, + /** A CSS color: `red`, `#ff0000`, `rgba(255, 0, 0, 0.5)`... @group Look @preset color */ + public fillColor = "#4aa3ff", + /** An image stretched over the rectangle, shown instead of the color. @group Look @asset .png .jpg .jpeg .gif .webp .svg */ + public image = "", + /** From 0 (invisible) to 1 (opaque). @group Look */ + public opacity = 1, + /** Clockwise, in degrees, around the top-left corner. @group Advanced */ + public rotation = 0, + /** Rounds the corners, in pixels. @group Advanced */ + public cornerRadius = 0, + /** Whether it is drawn. @group Advanced */ + public visible = true, + ) {} + + /** Puts the rectangle on `layer` at `position`, up to date with the parameters. */ + draw(layer: Layer, position: Position2D, assets: AssetContext): void { + this.shape ??= new Rect(); + if (this.shape.getParent() !== layer) layer.add(this.shape); + this.shape.setAttrs({ + x: position.x, + y: position.y, + width: this.width, + height: this.height, + fill: this.fillColor, + opacity: this.opacity, + rotation: this.rotation, + cornerRadius: this.cornerRadius, + visible: this.visible, + ...imageFill(assets, this.image, this.width, this.height), + }); + } + + /** Removes the rectangle from the screen. */ + destroy(): void { + this.shape?.destroy(); + this.shape = undefined; + } +} diff --git a/demos/pong/src/components/drawable-text-2d.component.ts b/demos/pong/src/components/drawable-text-2d.component.ts new file mode 100644 index 0000000..adba963 --- /dev/null +++ b/demos/pong/src/components/drawable-text-2d.component.ts @@ -0,0 +1,62 @@ +import { type Layer, Text } from "@nanoforge-dev/graphics-2d"; +import type { Position2D } from "./position-2d.component"; + +/** + * Draws a text at the entity's `Position2D` (its top-left corner). Needs the `draw2D` system. + * + * @remarks + * Change `text` from a system to show a score, a timer... `shape` is the Konva `Text` on screen: + * change it from code for anything the parameters don't offer. + * + * @component + * @side client + * @group Text color=#e86fb0 - What is written. + * @group Look color=#b18cff - What the text looks like. + * @group Advanced hidden - Less common settings. + */ +export class DrawableText2D { + name = "DrawableText2D"; + + /** The text on screen, made by `draw2D` the first time it draws it. */ + shape?: Text; + + constructor( + /** What is written. @group Text */ + public text = "Hello", + /** Height of the letters, in pixels. @group Text */ + public fontSize = 24, + /** A CSS color: `white`, `#ffffff`... @group Look @preset color */ + public fillColor = "#ffffff", + /** From 0 (invisible) to 1 (opaque). @group Look */ + public opacity = 1, + /** A CSS font family: `Arial`, `monospace`... @group Advanced */ + public fontFamily = "Arial", + /** Clockwise, in degrees, around the top-left corner. @group Advanced */ + public rotation = 0, + /** Whether it is drawn. @group Advanced */ + public visible = true, + ) {} + + /** Puts the text on `layer` at `position`, up to date with the parameters. */ + draw(layer: Layer, position: Position2D): void { + this.shape ??= new Text(); + if (this.shape.getParent() !== layer) layer.add(this.shape); + this.shape.setAttrs({ + x: position.x, + y: position.y, + text: this.text, + fontSize: this.fontSize, + fontFamily: this.fontFamily, + fill: this.fillColor, + opacity: this.opacity, + rotation: this.rotation, + visible: this.visible, + }); + } + + /** Removes the text from the screen. */ + destroy(): void { + this.shape?.destroy(); + this.shape = undefined; + } +} diff --git a/demos/pong/src/components/goal.component.ts b/demos/pong/src/components/goal.component.ts new file mode 100644 index 0000000..a9a834d --- /dev/null +++ b/demos/pong/src/components/goal.component.ts @@ -0,0 +1,18 @@ +/** + * A goal: a `Ball` that enters it gives a point to `player`, and is served again. Needs + * `Position2D`, `HitboxRect2D` and the `scoreGoals` system. + * + * @component + * @side shared + */ +export class Goal { + name = "Goal"; + + /** Points scored in this goal, added by `scoreGoals`. */ + points = 0; + + constructor( + /** The player who scores when the ball enters it. */ + public player = 1, + ) {} +} diff --git a/demos/pong/src/components/hitbox-rect-2d.component.ts b/demos/pong/src/components/hitbox-rect-2d.component.ts new file mode 100644 index 0000000..5c82bd3 --- /dev/null +++ b/demos/pong/src/components/hitbox-rect-2d.component.ts @@ -0,0 +1,22 @@ +/** + * Makes an entity collide as a rectangle whose top-left corner is its `Position2D`. + * + * @remarks + * The library's `HitboxRect2D` (`@nanoforge/physics-2d`) has the same parameters, plus the + * `collisions` that its `detectCollisions2D` system fills. Here `bounceBall`, `blockPaddles` and + * `scoreGoals` test the hitboxes they need themselves. + * + * @component + * @side shared + * @group Size color=#5ec26a - Size of the hitbox. + */ +export class HitboxRect2D { + name = "HitboxRect2D"; + + constructor( + /** In pixels. @group Size @preset size.width */ + public width = 50, + /** In pixels. @group Size @preset size.height */ + public height = 50, + ) {} +} diff --git a/demos/pong/src/components/move-controller-2d.component.ts b/demos/pong/src/components/move-controller-2d.component.ts new file mode 100644 index 0000000..75ffcf0 --- /dev/null +++ b/demos/pong/src/components/move-controller-2d.component.ts @@ -0,0 +1,33 @@ +import { InputEnum } from "@nanoforge-dev/input"; + +/** + * Moves an entity with the keyboard, by setting its `Velocity2D`. Needs the `moveControl2D` + * system. + * + * @example + * For a platformer, set `axes` to `horizontal`: the vertical velocity is left to gravity and + * jumps. + * + * @component + * @side client + * @group Movement color=#9d7bff - How the entity moves. + * @group Keys color=#f0a33a - The keys that move it. + */ +export class MoveController2D { + name = "MoveController2D"; + + constructor( + /** In pixels per second. @group Movement */ + public speed = 200, + /** Which directions the keys move it in. @group Movement */ + public axes: "both" | "horizontal" | "vertical" = "both", + /** @group Keys */ + public left: InputEnum = InputEnum.ArrowLeft, + /** @group Keys */ + public right: InputEnum = InputEnum.ArrowRight, + /** @group Keys */ + public up: InputEnum = InputEnum.ArrowUp, + /** @group Keys */ + public down: InputEnum = InputEnum.ArrowDown, + ) {} +} diff --git a/demos/pong/src/components/paddle.component.ts b/demos/pong/src/components/paddle.component.ts new file mode 100644 index 0000000..1141ab5 --- /dev/null +++ b/demos/pong/src/components/paddle.component.ts @@ -0,0 +1,32 @@ +/** + * A paddle: it sends a `Ball` back, at a wider angle the further from its middle the ball hits + * it. Walls stop it. Needs `Position2D` and `HitboxRect2D`, and the `bounceBall` and + * `blockPaddles` systems. + * + * @example + * The left paddle of a pong sends the ball to the right: `new Paddle(1, 0)`. A breakout paddle + * sends it up: `new Paddle(0, -1)`. + * + * @component + * @side shared + * @group Bounce color=#4aa3ff - How the ball leaves the paddle. + */ +export class Paddle { + name = "Paddle"; + + constructor( + /** Where the ball goes, hit in the middle: 1 to the right, -1 to the left. @group Bounce */ + public normalX = 0, + /** Where the ball goes, hit in the middle: 1 down, -1 up. @group Bounce */ + public normalY = -1, + /** Angle off that direction when hit at an end, in degrees. @group Bounce */ + public maxAngle = 60, + /** The ball's speed is multiplied by it at each hit: 1 keeps it. @group Bounce */ + public speedUp = 1, + /** + * The most `speedUp` takes the ball to, in pixels per second. A faster ball goes through + * walls in one frame on a slow machine. @group Bounce + */ + public maxSpeed = 1600, + ) {} +} diff --git a/demos/pong/src/components/position-2d.component.ts b/demos/pong/src/components/position-2d.component.ts new file mode 100644 index 0000000..0a35624 --- /dev/null +++ b/demos/pong/src/components/position-2d.component.ts @@ -0,0 +1,20 @@ +/** + * Where an entity is, in pixels from the top-left corner of the screen. + * + * @remarks + * For rectangles it is their top-left corner, for circles their center. + * + * @component + * @side shared + * @group Position color=#4aa3ff - Pixels from the top-left corner of the screen. + */ +export class Position2D { + name = "Position2D"; + + constructor( + /** Pixels from the left edge. @group Position @preset vector.x */ + public x = 0, + /** Pixels from the top edge. @group Position @preset vector.y */ + public y = 0, + ) {} +} diff --git a/demos/pong/src/components/score-text.component.ts b/demos/pong/src/components/score-text.component.ts new file mode 100644 index 0000000..a955e19 --- /dev/null +++ b/demos/pong/src/components/score-text.component.ts @@ -0,0 +1,14 @@ +/** + * Shows the points of a player in its `DrawableText2D`. Needs the `showScores` system. + * + * @component + * @side client + */ +export class ScoreText { + name = "ScoreText"; + + constructor( + /** The player whose points are shown: the one a `Goal` gives them to. */ + public player = 1, + ) {} +} diff --git a/demos/pong/src/components/serve.component.ts b/demos/pong/src/components/serve.component.ts new file mode 100644 index 0000000..8cb04c4 --- /dev/null +++ b/demos/pong/src/components/serve.component.ts @@ -0,0 +1,30 @@ +/** + * Serves a `Ball`: after `delay` seconds it leaves horizontally at `speed`, toward each side in + * turn. A goal puts it back at (`x`, `y`) and serves it again. Needs `Velocity2D` and the + * `serveBall` system. + * + * @component + * @side shared + * @group Serve color=#f0a33a - Where and how the ball is served. + */ +export class Serve { + name = "Serve"; + + /** Seconds left before the serve, 0 once served. */ + wait: number; + /** The side the next serve goes to: 1 right, -1 left. */ + side = 1; + + constructor( + /** Where a goal puts the ball back, from the left. @group Serve @preset vector.x */ + public x = 0, + /** Where a goal puts the ball back, from the top. @group Serve @preset vector.y */ + public y = 0, + /** In pixels per second. @group Serve */ + public speed = 600, + /** Seconds before each serve. @group Serve */ + public delay = 3, + ) { + this.wait = delay; + } +} diff --git a/demos/pong/src/components/velocity-2d.component.ts b/demos/pong/src/components/velocity-2d.component.ts new file mode 100644 index 0000000..3b93d4e --- /dev/null +++ b/demos/pong/src/components/velocity-2d.component.ts @@ -0,0 +1,20 @@ +/** + * How fast an entity moves, in pixels per second. Needs `Position2D` and the `move2D` system. + * + * @example + * `new Velocity2D(100, 0)` moves 100 pixels to the right every second. + * + * @component + * @side shared + * @group Velocity color=#36c5a0 - Pixels per second. + */ +export class Velocity2D { + name = "Velocity2D"; + + constructor( + /** Pixels per second to the right (negative: to the left). @group Velocity @preset vector.x */ + public x = 0, + /** Pixels per second downward (negative: upward). @group Velocity @preset vector.y */ + public y = 0, + ) {} +} diff --git a/demos/pong/src/components/wall.component.ts b/demos/pong/src/components/wall.component.ts new file mode 100644 index 0000000..3e54fda --- /dev/null +++ b/demos/pong/src/components/wall.component.ts @@ -0,0 +1,16 @@ +/** + * A wall: a `Ball` bounces off it, and a `Paddle` can't go through it. Needs `Position2D` and + * `HitboxRect2D`. + * + * @remarks + * `hits` counts the bounces, for a system that breaks bricks. + * + * @component + * @side shared + */ +export class Wall { + name = "Wall"; + + /** Bounces of a ball off this wall, added by `bounceBall`. Set it back to 0 once handled. */ + hits = 0; +} diff --git a/demos/pong/src/components/winner-text.component.ts b/demos/pong/src/components/winner-text.component.ts new file mode 100644 index 0000000..5fad50f --- /dev/null +++ b/demos/pong/src/components/winner-text.component.ts @@ -0,0 +1,9 @@ +/** + * Writes who won the match in its `DrawableText2D`. Needs the `showWinner` system. + * + * @component + * @side client + */ +export class WinnerText { + name = "WinnerText"; +} diff --git a/demos/pong/src/image-fill.ts b/demos/pong/src/image-fill.ts new file mode 100644 index 0000000..c7fc737 --- /dev/null +++ b/demos/pong/src/image-fill.ts @@ -0,0 +1,43 @@ +import type { AssetContext } from "@nanoforge-dev/common"; +import type { ShapeConfig } from "@nanoforge-dev/graphics-2d"; + +const images = new Map(); + +/** + * The fill of a shape of `width` by `height` pixels showing the image at `path` (an asset path + * such as `/textures/hero.png`, found in `assets`) stretched over it. Without an image, until it + * is loaded, or when there is no asset at `path`, the shape is filled with its color. + * + * @param centered - Whether the shape's origin is its center (a circle) instead of its top-left + * corner (a rectangle). + */ +export const imageFill = ( + assets: AssetContext, + path: string, + width: number, + height: number, + centered = false, +): ShapeConfig => { + if (!path) return { fillPriority: "color", fillPatternImage: undefined }; + let image = images.get(path); + if (!image) { + image = document.createElement("img"); + try { + image.src = assets.getAsset(path).path; + } catch (error) { + // Once per path, not every frame: the shape keeps its color. + console.warn(`No image at "${path}":`, error); + } + images.set(path, image); + } + if (!image.naturalWidth) return { fillPriority: "color", fillPatternImage: undefined }; + return { + fillPriority: "pattern", + fillPatternImage: image, + fillPatternRepeat: "no-repeat", + fillPatternScaleX: width / image.naturalWidth, + fillPatternScaleY: height / image.naturalHeight, + fillPatternOffsetX: centered ? image.naturalWidth / 2 : 0, + fillPatternOffsetY: centered ? image.naturalHeight / 2 : 0, + }; +}; diff --git a/demos/pong/src/just-pressed.ts b/demos/pong/src/just-pressed.ts new file mode 100644 index 0000000..bd8dac9 --- /dev/null +++ b/demos/pong/src/just-pressed.ts @@ -0,0 +1,19 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { InputEnum } from "@nanoforge-dev/input"; + +/** Whether each key was down the last time a system asked. */ +const down = new Map(); + +/** + * Whether `key` went down since the last time a system asked about it. + * + * @remarks + * The state is shared by every system: a key that opens a scene does not also act in that scene + * while it is still held. + */ +export const justPressed = (ctx: Context, key: InputEnum): boolean => { + const now = ctx.input.isKeyPressed(key) === true; + const before = down.get(key) ?? false; + down.set(key, now); + return now && !before; +}; diff --git a/demos/pong/src/main.ts b/demos/pong/src/main.ts new file mode 100644 index 0000000..e78a727 --- /dev/null +++ b/demos/pong/src/main.ts @@ -0,0 +1,44 @@ +import type { ClientRunOptions } from "@nanoforge-dev/common"; +import { NanoforgeFactory } from "@nanoforge-dev/core"; +import { EcsLibrary } from "@nanoforge-dev/ecs/client"; +import { EditorLibrary } from "@nanoforge-dev/editor-lib"; +import { Graphics2DLibrary } from "@nanoforge-dev/graphics-2d"; +import { InputLibrary } from "@nanoforge-dev/input"; +import { SceneLibrary } from "@nanoforge-dev/scene"; + +import { DrawableRect2D } from "./components/drawable-rect-2d.component"; +import { Position2D } from "./components/position-2d.component"; +import "./scene-vars"; +import { Match } from "./scenes/match.scene"; +import { Menu } from "./scenes/menu.scene"; +import { Win } from "./scenes/win.scene"; +import { draw2D } from "./systems/draw-2d.system"; + +export const main = async (options: ClientRunOptions): Promise => { + const app = NanoforgeFactory.createClient({ + tickRate: 60, + viewport: { width: 1920, height: 1080, fit: "contain" }, + }); + const ecs = new EcsLibrary(); + + app.use(new Graphics2DLibrary()); + app.use(ecs); + app.use(new InputLibrary()); + app.use(new SceneLibrary({ initial: Menu, scenes: { Menu, Match, Win } })); + app.use(new EditorLibrary()); + + await app.init(options); + + const registry = ecs.registry; + + // The field, under every scene: `draw2D` stacks the shapes of one frame in entity order, and a + // scene's entities reuse the ids of the scene before, so a field spawned by a scene could hide + // what it spawned before it. + const background = registry.spawnEntity(); + registry.addComponent(background, new Position2D(0, 0)); + registry.addComponent(background, new DrawableRect2D(1920, 1080, "#3a6327")); + + registry.addSystem(draw2D); + + await app.run(); +}; diff --git a/demos/pong/src/scene-vars.ts b/demos/pong/src/scene-vars.ts new file mode 100644 index 0000000..e9aed5f --- /dev/null +++ b/demos/pong/src/scene-vars.ts @@ -0,0 +1,14 @@ +/** + * The scene vars of the game. A var belongs to the scene that made it, and goes away when that + * scene is unloaded. + */ +declare module "@nanoforge-dev/scene" { + interface SceneVars { + /** Points a player needs to win the match (made by `Match`). @default 5 */ + pointsToWin: number; + /** The player who won (made by `Win`). @default 1 */ + winner: number; + } +} + +export {}; diff --git a/demos/pong/src/scenes/match.scene.ts b/demos/pong/src/scenes/match.scene.ts new file mode 100644 index 0000000..91a38cf --- /dev/null +++ b/demos/pong/src/scenes/match.scene.ts @@ -0,0 +1,116 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; +import { EcsScene } from "@nanoforge-dev/ecs/scene"; +import { InputEnum } from "@nanoforge-dev/input"; + +import { Ball } from "../components/ball.component"; +import { DrawableRect2D } from "../components/drawable-rect-2d.component"; +import { DrawableText2D } from "../components/drawable-text-2d.component"; +import { Goal } from "../components/goal.component"; +import { HitboxRect2D } from "../components/hitbox-rect-2d.component"; +import { MoveController2D } from "../components/move-controller-2d.component"; +import { Paddle } from "../components/paddle.component"; +import { Position2D } from "../components/position-2d.component"; +import { ScoreText } from "../components/score-text.component"; +import { Serve } from "../components/serve.component"; +import { Velocity2D } from "../components/velocity-2d.component"; +import { Wall } from "../components/wall.component"; +import { blockPaddles } from "../systems/block-paddles.system"; +import { bounceBall } from "../systems/bounce-ball.system"; +import { move2D } from "../systems/move-2d.system"; +import { moveControl2D } from "../systems/move-control-2d.system"; +import { scoreGoals } from "../systems/score-goals.system"; +import { serveBall } from "../systems/serve-ball.system"; +import { showScores } from "../systems/show-scores.system"; +import { winMatch } from "../systems/win-match.system"; + +/** + * A match: the field, the two paddles, the ball and the scores. W and S move the left paddle, + * the up and down arrows the right one. + * + * @scene + * @side client + * @vars pointsToWin + */ +export class Match extends EcsScene { + override setup(registry: Registry, ctx: Context) { + ctx.scenes.vars.init("pointsToWin", 5); + + const centerLine = registry.spawnEntity(); + registry.addComponent(centerLine, new Position2D(955, 0)); + registry.addComponent(centerLine, new DrawableRect2D(10, 1080, "#94cc75")); + + const topWall = registry.spawnEntity(); + registry.addComponent(topWall, new Position2D(0, -100)); + registry.addComponent(topWall, new HitboxRect2D(1920, 100)); + registry.addComponent(topWall, new Wall()); + + const bottomWall = registry.spawnEntity(); + registry.addComponent(bottomWall, new Position2D(0, 1080)); + registry.addComponent(bottomWall, new HitboxRect2D(1920, 100)); + registry.addComponent(bottomWall, new Wall()); + + const leftGoal = registry.spawnEntity(); + registry.addComponent(leftGoal, new Position2D(-100, 0)); + registry.addComponent(leftGoal, new HitboxRect2D(100, 1080)); + registry.addComponent(leftGoal, new Goal(2)); + + const rightGoal = registry.spawnEntity(); + registry.addComponent(rightGoal, new Position2D(1920, 0)); + registry.addComponent(rightGoal, new HitboxRect2D(100, 1080)); + registry.addComponent(rightGoal, new Goal(1)); + + const leftPaddle = registry.spawnEntity(); + registry.addComponent(leftPaddle, new Position2D(20, 390)); + registry.addComponent(leftPaddle, new Velocity2D(0, 0)); + registry.addComponent(leftPaddle, new HitboxRect2D(30, 300)); + registry.addComponent(leftPaddle, new Paddle(1, 0, 67.5, 1.1)); + registry.addComponent( + leftPaddle, + new MoveController2D( + 1000, + "vertical", + InputEnum.KeyA, + InputEnum.KeyD, + InputEnum.KeyW, + InputEnum.KeyS, + ), + ); + registry.addComponent(leftPaddle, new DrawableRect2D(30, 300, "#4d8dff")); + + const rightPaddle = registry.spawnEntity(); + registry.addComponent(rightPaddle, new Position2D(1870, 390)); + registry.addComponent(rightPaddle, new Velocity2D(0, 0)); + registry.addComponent(rightPaddle, new HitboxRect2D(30, 300)); + registry.addComponent(rightPaddle, new Paddle(-1, 0, 67.5, 1.1)); + registry.addComponent(rightPaddle, new MoveController2D(1000, "vertical")); + registry.addComponent(rightPaddle, new DrawableRect2D(30, 300, "#ff9f40")); + + const ball = registry.spawnEntity(); + registry.addComponent(ball, new Position2D(945, 525)); + registry.addComponent(ball, new Velocity2D(0, 0)); + registry.addComponent(ball, new HitboxRect2D(30, 30)); + registry.addComponent(ball, new Ball()); + registry.addComponent(ball, new Serve(945, 525, 1000, 1.5)); + registry.addComponent(ball, new DrawableRect2D(30, 30, "#ff4d3d", "", 1, 0, 15)); + + const leftScore = registry.spawnEntity(); + registry.addComponent(leftScore, new Position2D(840, 40)); + registry.addComponent(leftScore, new ScoreText(1)); + registry.addComponent(leftScore, new DrawableText2D("0", 72, "#ffffff", 1, "monospace")); + + const rightScore = registry.spawnEntity(); + registry.addComponent(rightScore, new Position2D(1040, 40)); + registry.addComponent(rightScore, new ScoreText(2)); + registry.addComponent(rightScore, new DrawableText2D("0", 72, "#ffffff", 1, "monospace")); + + registry.addSystem(moveControl2D); + registry.addSystem(serveBall); + registry.addSystem(move2D); + registry.addSystem(blockPaddles); + registry.addSystem(bounceBall); + registry.addSystem(scoreGoals); + registry.addSystem(showScores); + registry.addSystem(winMatch); + } +} diff --git a/demos/pong/src/scenes/menu.scene.ts b/demos/pong/src/scenes/menu.scene.ts new file mode 100644 index 0000000..da3a8b9 --- /dev/null +++ b/demos/pong/src/scenes/menu.scene.ts @@ -0,0 +1,44 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; +import { EcsScene } from "@nanoforge-dev/ecs/scene"; + +import { DrawableText2D } from "../components/drawable-text-2d.component"; +import { Position2D } from "../components/position-2d.component"; +import { startMatch } from "../systems/start-match.system"; + +/** + * The title screen. Enter starts a match. + * + * @scene + * @side client + */ +export class Menu extends EcsScene { + override setup(registry: Registry, _ctx: Context) { + const title = registry.spawnEntity(); + registry.addComponent(title, new Position2D(780, 300)); + registry.addComponent(title, new DrawableText2D("PONG", 140, "#cdd6f4", 1, "monospace")); + + const prompt = registry.spawnEntity(); + registry.addComponent(prompt, new Position2D(700, 520)); + registry.addComponent( + prompt, + new DrawableText2D("Press Enter to play", 48, "#cdd6f4", 1, "monospace"), + ); + + const keys = registry.spawnEntity(); + registry.addComponent(keys, new Position2D(560, 700)); + registry.addComponent( + keys, + new DrawableText2D("Left: W / S Right: Up / Down", 40, "#8a93ad", 1, "monospace"), + ); + + const rules = registry.spawnEntity(); + registry.addComponent(rules, new Position2D(740, 780)); + registry.addComponent( + rules, + new DrawableText2D("First to 5 points wins", 40, "#8a93ad", 1, "monospace"), + ); + + registry.addSystem(startMatch); + } +} diff --git a/demos/pong/src/scenes/win.scene.ts b/demos/pong/src/scenes/win.scene.ts new file mode 100644 index 0000000..35b03d2 --- /dev/null +++ b/demos/pong/src/scenes/win.scene.ts @@ -0,0 +1,42 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; +import { EcsScene } from "@nanoforge-dev/ecs/scene"; +import type { SceneLoadContext } from "@nanoforge-dev/scene"; + +import { DrawableText2D } from "../components/drawable-text-2d.component"; +import { Position2D } from "../components/position-2d.component"; +import { WinnerText } from "../components/winner-text.component"; +import { backToMenu } from "../systems/back-to-menu.system"; +import { showWinner } from "../systems/show-winner.system"; + +/** + * Shown when a player wins the match. Enter goes back to the menu. + * + * @scene + * @side client + * @vars winner + */ +export class Win extends EcsScene<{ + /** The player who won. */ + player: number; +}> { + override setup( + registry: Registry, + ctx: Context, + { params }: SceneLoadContext<{ player: number }>, + ) { + ctx.scenes.vars.init("winner", params?.player ?? 1); + + const title = registry.spawnEntity(); + registry.addComponent(title, new Position2D(560, 380)); + registry.addComponent(title, new WinnerText()); + registry.addComponent(title, new DrawableText2D("", 100, "#a6e3a1", 1, "monospace")); + + const prompt = registry.spawnEntity(); + registry.addComponent(prompt, new Position2D(840, 600)); + registry.addComponent(prompt, new DrawableText2D("Press Enter", 48, "#8a93ad", 1, "monospace")); + + registry.addSystem(showWinner); + registry.addSystem(backToMenu); + } +} diff --git a/demos/pong/src/systems/back-to-menu.system.ts b/demos/pong/src/systems/back-to-menu.system.ts new file mode 100644 index 0000000..65fb9eb --- /dev/null +++ b/demos/pong/src/systems/back-to-menu.system.ts @@ -0,0 +1,16 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; +import { InputEnum } from "@nanoforge-dev/input"; + +import { justPressed } from "../just-pressed"; +import { Menu } from "../scenes/menu.scene"; + +/** + * Goes back to the menu when Enter is pressed (the end screens). + * + * @system + * @side client + */ +export const backToMenu = (_registry: Registry, ctx: Context) => { + if (justPressed(ctx, InputEnum.Enter)) void ctx.scenes.load(ctx, Menu); +}; diff --git a/demos/pong/src/systems/block-paddles.system.ts b/demos/pong/src/systems/block-paddles.system.ts new file mode 100644 index 0000000..434c715 --- /dev/null +++ b/demos/pong/src/systems/block-paddles.system.ts @@ -0,0 +1,28 @@ +import type { Registry } from "@nanoforge-dev/ecs"; + +import { overlap, pushOut } from "../collisions"; +import { HitboxRect2D } from "../components/hitbox-rect-2d.component"; +import { Paddle } from "../components/paddle.component"; +import { Position2D } from "../components/position-2d.component"; +import { Velocity2D } from "../components/velocity-2d.component"; +import { Wall } from "../components/wall.component"; + +/** + * Stops each `Paddle` at the `Wall` entities: pushed out of them, and stopped on that axis. Add it + * after `move2D`. + * + * @system + * @side shared + */ +export const blockPaddles = (registry: Registry) => { + const walls = registry.getZipper([Wall, Position2D, HitboxRect2D]); + + registry + .getZipper([Paddle, Position2D, Velocity2D, HitboxRect2D]) + .forEach(({ Position2D: paddle, Velocity2D: velocity, HitboxRect2D: box }) => { + for (const { Position2D, HitboxRect2D } of walls) { + if (overlap(paddle, box, Position2D, HitboxRect2D)) + pushOut(paddle, box, velocity, Position2D, HitboxRect2D, false); + } + }); +}; diff --git a/demos/pong/src/systems/bounce-ball.system.ts b/demos/pong/src/systems/bounce-ball.system.ts new file mode 100644 index 0000000..3dd79f5 --- /dev/null +++ b/demos/pong/src/systems/bounce-ball.system.ts @@ -0,0 +1,65 @@ +import type { Registry } from "@nanoforge-dev/ecs"; + +import { overlap, pushOut } from "../collisions"; +import { Ball } from "../components/ball.component"; +import { HitboxRect2D } from "../components/hitbox-rect-2d.component"; +import { Paddle } from "../components/paddle.component"; +import { Position2D } from "../components/position-2d.component"; +import { Velocity2D } from "../components/velocity-2d.component"; +import { Wall } from "../components/wall.component"; + +/** + * Bounces each `Ball` off the `Paddle` it moves into, or else off the first `Wall` it touches. + * Add it after `move2D`. + * + * @remarks + * Off a paddle, the ball leaves in the paddle's direction, turned toward the end it hit, up to + * the paddle's `maxAngle`, and `speedUp` times faster, up to its `maxSpeed` (a ball already + * faster keeps its speed). Off a wall, it goes back on the axis it went in the least, and the + * wall counts a hit. + * + * @system + * @side shared + */ +export const bounceBall = (registry: Registry) => { + const paddles = registry.getZipper([Paddle, Position2D, HitboxRect2D]); + const walls = registry.getZipper([Wall, Position2D, HitboxRect2D]); + + registry + .getZipper([Ball, Position2D, Velocity2D, HitboxRect2D]) + .forEach(({ Position2D: ball, Velocity2D: velocity, HitboxRect2D: box }) => { + const hit = paddles.find( + ({ Paddle: paddle, Position2D, HitboxRect2D }) => + velocity.x * paddle.normalX + velocity.y * paddle.normalY < 0 && + overlap(ball, box, Position2D, HitboxRect2D), + ); + if (hit) { + const { Paddle: paddle, Position2D: at, HitboxRect2D: size } = hit; + // Along the paddle: its normal turned a quarter clockwise. + const alongX = -paddle.normalY; + const alongY = paddle.normalX; + const length = Math.abs(alongX) * size.width + Math.abs(alongY) * size.height; + const offset = + (alongX * (ball.x + box.width / 2 - at.x - size.width / 2) + + alongY * (ball.y + box.height / 2 - at.y - size.height / 2)) / + (length / 2); + const angle = (Math.max(-1, Math.min(1, offset)) * paddle.maxAngle * Math.PI) / 180; + const before = Math.hypot(velocity.x, velocity.y); + const speed = Math.min(before * paddle.speedUp, Math.max(before, paddle.maxSpeed)); + velocity.x = speed * (paddle.normalX * Math.cos(angle) + alongX * Math.sin(angle)); + velocity.y = speed * (paddle.normalY * Math.cos(angle) + alongY * Math.sin(angle)); + if (paddle.normalX > 0) ball.x = at.x + size.width; + if (paddle.normalX < 0) ball.x = at.x - box.width; + if (paddle.normalY > 0) ball.y = at.y + size.height; + if (paddle.normalY < 0) ball.y = at.y - box.height; + return; + } + + const wall = walls.find(({ Position2D, HitboxRect2D }) => + overlap(ball, box, Position2D, HitboxRect2D), + ); + if (!wall) return; + pushOut(ball, box, velocity, wall.Position2D, wall.HitboxRect2D, true); + wall.Wall.hits++; + }); +}; diff --git a/demos/pong/src/systems/draw-2d.system.ts b/demos/pong/src/systems/draw-2d.system.ts new file mode 100644 index 0000000..937eeeb --- /dev/null +++ b/demos/pong/src/systems/draw-2d.system.ts @@ -0,0 +1,45 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; +import "@nanoforge-dev/graphics-2d"; +import { Position2D } from "../components/position-2d.component"; + +import { DrawableCircle2D } from "../components/drawable-circle-2d.component"; +import { DrawableRect2D } from "../components/drawable-rect-2d.component"; +import { DrawableText2D } from "../components/drawable-text-2d.component"; + +type Drawable = DrawableRect2D | DrawableCircle2D | DrawableText2D; + +/** The drawables shown by the last frame. */ +let shown = new Set(); + +/** + * Draws every entity that has a `Position2D` and a `DrawableRect2D`, `DrawableCircle2D` or + * `DrawableText2D`, where it is. Add it last, after the systems that move entities. + * + * @remarks + * The shape of a killed entity, or of a removed drawable, is removed from the screen. + * + * @system + * @side client + */ +export const draw2D = (registry: Registry, ctx: Context) => { + const layer = ctx.graphics.baseLayer; + const drawn = new Set(); + + registry.getZipper([DrawableRect2D, Position2D]).forEach(({ DrawableRect2D, Position2D }) => { + DrawableRect2D.draw(layer, Position2D, ctx.assets); + drawn.add(DrawableRect2D); + }); + registry.getZipper([DrawableCircle2D, Position2D]).forEach(({ DrawableCircle2D, Position2D }) => { + DrawableCircle2D.draw(layer, Position2D, ctx.assets); + drawn.add(DrawableCircle2D); + }); + registry.getZipper([DrawableText2D, Position2D]).forEach(({ DrawableText2D, Position2D }) => { + DrawableText2D.draw(layer, Position2D); + drawn.add(DrawableText2D); + }); + + // `killEntity` doesn't call `destroy()`: a drawable no longer in the world loses its shape here. + for (const drawable of shown) if (!drawn.has(drawable)) drawable.destroy(); + shown = drawn; +}; diff --git a/demos/pong/src/systems/move-2d.system.ts b/demos/pong/src/systems/move-2d.system.ts new file mode 100644 index 0000000..514766a --- /dev/null +++ b/demos/pong/src/systems/move-2d.system.ts @@ -0,0 +1,26 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; + +import { Acceleration2D } from "../components/acceleration-2d.component"; +import { Position2D } from "../components/position-2d.component"; +import { Velocity2D } from "../components/velocity-2d.component"; + +/** + * Moves entities: their `Acceleration2D` changes their `Velocity2D`, then their `Velocity2D` + * changes their `Position2D`, by the time elapsed since the last frame. + * + * @system + * @side shared + */ +export const move2D = (registry: Registry, ctx: Context) => { + const seconds = ctx.app.delta / 1000; + + registry.getZipper([Acceleration2D, Velocity2D]).forEach(({ Acceleration2D, Velocity2D }) => { + Velocity2D.x += Acceleration2D.x * seconds; + Velocity2D.y += Acceleration2D.y * seconds; + }); + registry.getZipper([Position2D, Velocity2D]).forEach(({ Position2D, Velocity2D }) => { + Position2D.x += Velocity2D.x * seconds; + Position2D.y += Velocity2D.y * seconds; + }); +}; diff --git a/demos/pong/src/systems/move-control-2d.system.ts b/demos/pong/src/systems/move-control-2d.system.ts new file mode 100644 index 0000000..71ad4f7 --- /dev/null +++ b/demos/pong/src/systems/move-control-2d.system.ts @@ -0,0 +1,23 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; +import "@nanoforge-dev/input"; +import { Velocity2D } from "../components/velocity-2d.component"; + +import { MoveController2D } from "../components/move-controller-2d.component"; + +/** + * Sets the `Velocity2D` of `MoveController2D` entities from the keys held down. Add it before + * `move2D`. + * + * @system + * @side client + */ +export const moveControl2D = (registry: Registry, ctx: Context) => { + const held = (key: MoveController2D["left"]) => Number(ctx.input.isKeyPressed(key) === true); + + registry.getZipper([MoveController2D, Velocity2D]).forEach(({ MoveController2D, Velocity2D }) => { + const { speed, axes, left, right, up, down } = MoveController2D as MoveController2D; + if (axes !== "vertical") Velocity2D.x = (held(right) - held(left)) * speed; + if (axes !== "horizontal") Velocity2D.y = (held(down) - held(up)) * speed; + }); +}; diff --git a/demos/pong/src/systems/score-goals.system.ts b/demos/pong/src/systems/score-goals.system.ts new file mode 100644 index 0000000..b53a7cd --- /dev/null +++ b/demos/pong/src/systems/score-goals.system.ts @@ -0,0 +1,78 @@ +import type { Registry } from "@nanoforge-dev/ecs"; + +import { overlap } from "../collisions"; +import { Ball } from "../components/ball.component"; +import { Goal } from "../components/goal.component"; +import { HitboxRect2D } from "../components/hitbox-rect-2d.component"; +import { Position2D } from "../components/position-2d.component"; +import { Serve } from "../components/serve.component"; +import { Velocity2D } from "../components/velocity-2d.component"; +import { Wall } from "../components/wall.component"; + +type Box = { Position2D: Position2D; HitboxRect2D: HitboxRect2D }; + +/** The goal nearest to (`x`, `y`) among those that span it on one axis, if any. */ +const goalAcross = (goals: T[], x: number, y: number): T | undefined => { + let nearest: T | undefined; + let best = Infinity; + for (const goal of goals) { + const { Position2D: at, HitboxRect2D: size } = goal; + const across = (x >= at.x && x <= at.x + size.width) || (y >= at.y && y <= at.y + size.height); + const distance = Math.hypot(at.x + size.width / 2 - x, at.y + size.height / 2 - y); + if (across && distance < best) { + best = distance; + nearest = goal; + } + } + return nearest; +}; + +/** + * Gives a point to a `Goal`'s player when a `Ball` enters it, and puts the ball back where its + * `Serve` says, to be served again. Add it after `move2D`. + * + * @remarks + * A ball whose center left the field (the box around every `Wall` and `Goal`) is served again + * too: a long frame (a hidden tab) can move it past a goal or a wall without touching it. It + * scores in the nearest goal it is in line with, past its goal line; through a wall, nobody + * scores. + * + * @system + * @side shared + */ +export const scoreGoals = (registry: Registry) => { + const goals = registry.getZipper([Goal, Position2D, HitboxRect2D]); + const walls = registry.getZipper([Wall, Position2D, HitboxRect2D]); + + let left = Infinity; + let top = Infinity; + let right = -Infinity; + let bottom = -Infinity; + const grow = ({ Position2D: at, HitboxRect2D: size }: Box) => { + left = Math.min(left, at.x); + top = Math.min(top, at.y); + right = Math.max(right, at.x + size.width); + bottom = Math.max(bottom, at.y + size.height); + }; + goals.forEach(grow); + walls.forEach(grow); + + registry + .getZipper([Ball, Serve, Position2D, Velocity2D, HitboxRect2D]) + .forEach(({ Serve: serve, Position2D: ball, Velocity2D: velocity, HitboxRect2D: box }) => { + const x = ball.x + box.width / 2; + const y = ball.y + box.height / 2; + const out = left <= right && (x < left || x > right || y < top || y > bottom); + const goal = + goals.find(({ Position2D, HitboxRect2D }) => + overlap(ball, box, Position2D, HitboxRect2D), + ) ?? (out ? goalAcross(goals, x, y) : undefined); + if (!goal && !out) return; + if (goal) goal.Goal.points++; + ball.x = serve.x; + ball.y = serve.y; + velocity.x = 0; + velocity.y = 0; + serve.wait = serve.delay; + }); +}; diff --git a/demos/pong/src/systems/serve-ball.system.ts b/demos/pong/src/systems/serve-ball.system.ts new file mode 100644 index 0000000..e0aa1ab --- /dev/null +++ b/demos/pong/src/systems/serve-ball.system.ts @@ -0,0 +1,24 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; + +import { Serve } from "../components/serve.component"; +import { Velocity2D } from "../components/velocity-2d.component"; + +/** + * Serves each `Serve` entity once its wait is over: horizontally, at its speed, toward each side + * in turn. + * + * @system + * @side shared + */ +export const serveBall = (registry: Registry, ctx: Context) => { + registry.getZipper([Serve, Velocity2D]).forEach(({ Serve: serve, Velocity2D: velocity }) => { + if (serve.wait <= 0) return; + serve.wait -= ctx.app.delta / 1000; + if (serve.wait > 0) return; + serve.wait = 0; + velocity.x = serve.side * serve.speed; + velocity.y = 0; + serve.side = -serve.side; + }); +}; diff --git a/demos/pong/src/systems/show-scores.system.ts b/demos/pong/src/systems/show-scores.system.ts new file mode 100644 index 0000000..bdcd287 --- /dev/null +++ b/demos/pong/src/systems/show-scores.system.ts @@ -0,0 +1,20 @@ +import type { Registry } from "@nanoforge-dev/ecs"; + +import { DrawableText2D } from "../components/drawable-text-2d.component"; +import { Goal } from "../components/goal.component"; +import { ScoreText } from "../components/score-text.component"; + +/** + * Writes each player's points in their `ScoreText`. + * + * @system + * @side client + */ +export const showScores = (registry: Registry) => { + const goals = registry.getZipper([Goal]); + + registry.getZipper([ScoreText, DrawableText2D]).forEach(({ ScoreText, DrawableText2D }) => { + const goal = goals.find(({ Goal }) => Goal.player === ScoreText.player); + if (goal) DrawableText2D.text = `${goal.Goal.points}`; + }); +}; diff --git a/demos/pong/src/systems/show-winner.system.ts b/demos/pong/src/systems/show-winner.system.ts new file mode 100644 index 0000000..04a8ca8 --- /dev/null +++ b/demos/pong/src/systems/show-winner.system.ts @@ -0,0 +1,19 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; + +import { DrawableText2D } from "../components/drawable-text-2d.component"; +import { WinnerText } from "../components/winner-text.component"; + +/** + * Writes the `winner` var in each `WinnerText`. + * + * @system + * @side client + */ +export const showWinner = (registry: Registry, ctx: Context) => { + const winner = ctx.scenes.vars.get("winner") ?? 1; + + registry.getZipper([WinnerText, DrawableText2D]).forEach(({ DrawableText2D }) => { + DrawableText2D.text = `Player ${winner} wins!`; + }); +}; diff --git a/demos/pong/src/systems/start-match.system.ts b/demos/pong/src/systems/start-match.system.ts new file mode 100644 index 0000000..3108262 --- /dev/null +++ b/demos/pong/src/systems/start-match.system.ts @@ -0,0 +1,16 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; +import { InputEnum } from "@nanoforge-dev/input"; + +import { justPressed } from "../just-pressed"; +import { Match } from "../scenes/match.scene"; + +/** + * Starts a match when Enter is pressed. + * + * @system + * @side client + */ +export const startMatch = (_registry: Registry, ctx: Context) => { + if (justPressed(ctx, InputEnum.Enter)) void ctx.scenes.load(ctx, Match); +}; diff --git a/demos/pong/src/systems/win-match.system.ts b/demos/pong/src/systems/win-match.system.ts new file mode 100644 index 0000000..7a3008f --- /dev/null +++ b/demos/pong/src/systems/win-match.system.ts @@ -0,0 +1,18 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; + +import { Goal } from "../components/goal.component"; +import { Win } from "../scenes/win.scene"; + +/** + * Ends the match once a player has `pointsToWin` points: loads `Win` with that player. + * + * @system + * @side client + */ +export const winMatch = (registry: Registry, ctx: Context) => { + const pointsToWin = ctx.scenes.vars.get("pointsToWin") ?? 5; + + const won = registry.getZipper([Goal]).find(({ Goal }) => Goal.points >= pointsToWin); + if (won) void ctx.scenes.load(ctx, Win, { params: { player: won.Goal.player } }); +}; diff --git a/demos/pong/tsconfig.json b/demos/pong/tsconfig.json new file mode 100644 index 0000000..c0ae4f2 --- /dev/null +++ b/demos/pong/tsconfig.json @@ -0,0 +1,39 @@ +{ + "$schema": "https://json.schemastore.org/tsconfig.json", + // Mapped from https://www.typescriptlang.org/tsconfig + "compilerOptions": { + // Type Checking + "allowUnreachableCode": false, + "allowUnusedLabels": false, + "noFallthroughCasesInSwitch": true, + "noImplicitOverride": true, + "noImplicitReturns": true, + "noPropertyAccessFromIndexSignature": false, + "noUncheckedIndexedAccess": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "strict": true, + + // Modules + "allowArbitraryExtensions": false, + "allowImportingTsExtensions": false, + "module": "ESNext", + "moduleResolution": "Bundler", + "resolveJsonModule": true, + "resolvePackageJsonExports": true, + "resolvePackageJsonImports": true, + + // Interop Constraints + "allowSyntheticDefaultImports": true, + "forceConsistentCasingInFileNames": true, + "isolatedModules": true, + + // Language and Environment + "experimentalDecorators": true, + "lib": ["ESNext", "esnext.disposable", "DOM"], + "target": "ESNext", + "useDefineForClassFields": true + }, + "include": ["src"], + "exclude": ["node_modules", ".nanoforge", "dist"] +} diff --git a/docs/shared-components.md b/docs/shared-components.md new file mode 100644 index 0000000..0f8ae9b --- /dev/null +++ b/docs/shared-components.md @@ -0,0 +1,114 @@ +# Shared components and systems + +Code that several examples need, kept **identical** in each of them (`pnpm check` enforces it: +a file at `src/` whose `` is in `shared//` must be an exact copy). It is +temporary: each entry names the package of the +[components-systems](https://github.com/NanoForge-dev/components-systems) registry that has it, or +should get it. Once an example can install that package (`nf install`), delete its copies and import +the package instead. + +A shared path must be unique across all groups: `pnpm check` fails when two groups hold the same +``. It also takes every game file at a shared path for a copy: it fails when that file is +not one, and `pnpm fix` overwrites it (and prints it). So a shared path is reserved in every +example: give a new shared file a specific name (`pong-protocol.ts`, not `protocol.ts`). The +`paddle` group keeps its generic file names for now (`collisions.ts`, +`components/ball.component.ts`, `systems/serve-ball.system.ts`…): a game with its own ball must +name its file differently. + +## 1. Already in the library: `shared/2d` + +A copy of the library (registry 2.0.0) with its imports made relative, its systems written as arrow +functions, and each file renamed with the CLI's `.component.ts` / `.system.ts` suffix. Replacing a +copy with the package changes no game logic. + +| File | Package | Used by | +| -------------------------------------------- | ------------------------ | ---------------------------------------------------------------------------------------------------------------------------- | +| `components/position-2d.component.ts` | `@nanoforge/basics` | every 2D example, both apps of the network games, raid-survival server | +| `components/velocity-2d.component.ts` | `@nanoforge/basics` | input-gamepad, input-keyboard, network server, pong, pong-network, pong-3d, breakout, flappy-bird, raid-survival (both apps) | +| `components/acceleration-2d.component.ts` | `@nanoforge/basics` | same as `move2D` | +| `systems/move-2d.system.ts` | `@nanoforge/basics` | input-gamepad, input-keyboard, network server, pong, pong-network, pong-3d, breakout, raid-survival server | +| `components/drawable-rect-2d.component.ts` | `@nanoforge/graphics-2d` | every 2D client | +| `components/drawable-circle-2d.component.ts` | `@nanoforge/graphics-2d` | every 2D client | +| `components/drawable-text-2d.component.ts` | `@nanoforge/graphics-2d` | every 2D client | +| `image-fill.ts` (helper) | `@nanoforge/graphics-2d` | every 2D client | +| `systems/draw-2d.system.ts` | `@nanoforge/graphics-2d` | every 2D client | +| `components/move-controller-2d.component.ts` | `@nanoforge/controls-2d` | input-keyboard, pong, breakout | +| `systems/move-control-2d.system.ts` | `@nanoforge/controls-2d` | input-keyboard, pong, breakout | + +"Every 2D client": input-gamepad, input-keyboard, input-mouse, music, network, scenes, sound, +sprite-2d, pong, pong-network, breakout, flappy-bird, tic-tac-toe. + +## 2. Not in the library yet: shared by several examples + +| File | Used by | Proposed package | +| -------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------- | +| `paddle/components/hitbox-rect-2d.component.ts` | pong, pong-network, pong-3d (servers), breakout | `@nanoforge/physics-2d` (see below) | +| `paddle/collisions.ts`, `components/{ball,paddle,wall}`, `systems/{bounce-ball,block-paddles}` | pong, pong-network, pong-3d (servers), breakout | new `@nanoforge/arcade-2d` | +| `paddle/components/{goal,serve}`, `systems/{score-goals,serve-ball}` | pong, pong-network, pong-3d (servers) | new `@nanoforge/arcade-2d` | +| `network/components/network-id.component.ts` | pong-network, pong-3d (both apps), raid-survival client | new `@nanoforge/network` (replication) | +| `paddle/systems/{sync-moves,apply-moves}` | pong-network, pong-3d | new `@nanoforge/network` (replication) | +| `paddle/components/{seat,paddle-input}`, `systems/{seat-players,steer-paddles,send-input}`, `pong-protocol.ts` | pong-network, pong-3d | stays with the pong demos | +| `input/just-pressed.ts` (helper) | pong, breakout, flappy-bird, tic-tac-toe | `@nanoforge/controls-2d`; better, an engine `input` feature: a key's just-pressed state | +| `scenes/components/scene-var-text.component.ts`, `systems/show-scene-var.system.ts` | scenes, breakout, tic-tac-toe | new `@nanoforge/scenes` | +| `3d/components/{transform-3d,drawable-box-3d,drawable-sphere-3d}`, `systems/draw-3d` | graphics-3d, pong-3d (client) | new `@nanoforge/graphics-3d` | +| `paddle/systems/back-to-menu.system.ts` | pong, breakout | stays with the examples (game flow) | +| `arcade/components/draw-order-2d.component.ts`, `systems/draw-order-2d.system.ts` | flappy-bird, tic-tac-toe; raid-survival client (the component, with its own `zOrderSystem` on sprites) | `@nanoforge/graphics-2d`: a z-order for `draw2D` | +| `arcade/components/sound-effect.component.ts`, `systems/load-sounds.system.ts` | flappy-bird, tic-tac-toe | new `@nanoforge/audio` | +| `basics/components/{play-on-key,mute-on-key}` | sound, music | new `@nanoforge/audio` | + +**`HitboxRect2D`** is the library's (physics-2d) minus its `collisions` field, filled by the +library's `detectCollisions2D`, which these games don't use (their `bounceBall` and `blockPaddles` +resolve contacts themselves). Adding the field back makes the copy the library's; the games then +need no change. + +**`SceneVarText`** shows a scene var through a template (`"Score {}"`), and `-` while the var +does not exist. It replaces three versions: `SceneVarText` (scenes, a label before the value), +`HudText` (breakout, a fixed label per var) and `VarText` (tic-tac-toe, a template). + +**The 3D drawables** are in world units, at their entity's `Transform3D` (its center). pong-3d +plays on a 2D field: its own `placeOnField` system writes each `Transform3D` from the entity's +`Position2D` (100 field units to a world unit). graphics-3d copies `DrawableSphere3D` without +using it, because `draw3D` draws both shapes. + +**A ball that left the field** (see §4): `Paddle.maxSpeed` (1600 px/s by default) caps what +`speedUp` adds, and `scoreGoals` serves again a ball whose center is out of the box around every +`Wall` and `Goal`, scoring in the goal it passed, if any. Breakout's own `loseBall` puts back on +the paddle a ball out through the top or a side. + +**The pong servers** (`demos/pong-network/apps/server/src` and `demos/pong-3d/apps/server/src`) are +byte-identical, `main.ts` included. `pnpm check` can't enforce it for `main.ts` (a shared `main.ts` +would apply to every example): keep them identical by hand. + +## 3. Generic items in one example: library candidates + +| Item | Example | Proposed package | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------- | ------------------------------------------------- | +| `FollowMouse2D` + `followMouse2D`, `Draggable2D` + `drag2D` | input-mouse | `@nanoforge/controls-2d` | +| `Clickable2D` + `click2D` | tic-tac-toe | `@nanoforge/controls-2d` | +| `ControllerMove2D` + `controllerMove2D` | input-gamepad | `@nanoforge/controls-2d` | +| `CenterText2D` + `centerText2D` | tic-tac-toe | `@nanoforge/graphics-2d` | +| `ScrollLoop` + `scrollGround` | flappy-bird | `@nanoforge/graphics-2d` | +| `Spin3D` + `spin3D` | graphics-3d | new `@nanoforge/graphics-3d` | +| `ChildrenComponent` + `transformChildrenToParentSystem`, `zOrderSystem` (on `DrawOrder2D`), `FloatingText`, `SpriteComponent` + `spriteSystem` + `spriteAnimator`, `CollisionBox` + `resolveCollision`, `cameraFollowSystem` | raid-survival | `@nanoforge/graphics-2d`, `@nanoforge/physics-2d` | + +**Kept apart on purpose** (raid-survival client and server): + +- `TransformComponent` is not `Position2D`: it adds a rotation, and its `x`/`y` is where the + sprite's pivot is drawn, not a top-left corner. +- `MoveController` is not `MoveController2D`: it holds the WASD bindings and only reports the held + keys to the server, which moves the player; `MoveController2D` sets a local `Velocity2D`. +- The server's `Hitbox` is `HitboxRect2D` plus an offset from the position (16×16 by default), which + the weapon and tower systems use to find the center. + +## 4. Gaps found in the library while writing the examples + +- `draw2D` has no z-order: shapes stack in entity-id order, and scenes reuse freed ids, so a shape + of a newly loaded scene can be hidden (`DrawOrder2D` works around it). +- `move2D` and `moveControl2D` have no pause gate (breakout wraps them). +- The engine's `ctx.app.delta` is the wall-clock time since the last tick, unclamped: a hidden tab + ticks about once a second, and `move2D` moves by the whole delta. The paddle systems test + overlap only, so a fast ball, or any ball after a long tick, can jump over a wall or a goal. + The examples cap the ball's speed and serve again a ball out of the field; the library needs a + clamped delta or swept collisions (`@nanoforge/physics-2d`). +- `DrawableText2D` has no width, alignment or font style; `DrawableRect2D` has no stroke, crop, + repeat or pivot (flappy-bird sets the Konva offset itself to rotate the bird around its center). diff --git a/flappy-bird/.dockerignore b/flappy-bird/.dockerignore deleted file mode 100644 index c2658d7..0000000 --- a/flappy-bird/.dockerignore +++ /dev/null @@ -1 +0,0 @@ -node_modules/ diff --git a/flappy-bird/.gitignore b/flappy-bird/.gitignore deleted file mode 100644 index 0b4fc4e..0000000 --- a/flappy-bird/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/.nanoforge/client diff --git a/flappy-bird/.prettierignore b/flappy-bird/.prettierignore deleted file mode 100644 index 2f0ede7..0000000 --- a/flappy-bird/.prettierignore +++ /dev/null @@ -1,8 +0,0 @@ -# Ignore files for PNPM, NPM and YARN -pnpm-lock.yaml -package-lock.json -yarn.lock -bun.lock - -/node_modules -/.nanoforge diff --git a/flappy-bird/Dockerfile b/flappy-bird/Dockerfile deleted file mode 100644 index b421fa2..0000000 --- a/flappy-bird/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -FROM node:26-slim - -ENV PNPM_HOME="/pnpm" -ENV PATH="$PNPM_HOME:$PATH" -RUN npm install -g pnpm - -WORKDIR /app - -COPY package.json ./ -COPY pnpm-lock.yaml ./ - -RUN pnpm install --frozen-lockfile --allow-build=bun - -COPY . . - -RUN pnpm run build - -CMD ["pnpm", "run", "start"] diff --git a/flappy-bird/README.md b/flappy-bird/README.md deleted file mode 100644 index 1e185f3..0000000 --- a/flappy-bird/README.md +++ /dev/null @@ -1 +0,0 @@ -# flappy-bird diff --git a/flappy-bird/client/assets.ts b/flappy-bird/client/assets.ts deleted file mode 100644 index 56ddf01..0000000 --- a/flappy-bird/client/assets.ts +++ /dev/null @@ -1,56 +0,0 @@ -import type { AssetManagerLibrary } from "@nanoforge-dev/asset-manager"; -import { Image } from "@nanoforge-dev/graphics-2d"; - -export interface Sprites { - background: HTMLImageElement; - ground: HTMLImageElement; - birdFrames: HTMLImageElement[]; - pipe: HTMLImageElement; - gameover: HTMLImageElement; - message: HTMLImageElement; - digits: HTMLImageElement[]; -} - -function loadImage(url: string): Promise { - return new Promise((resolve, reject) => { - Image.fromURL( - url, - (node) => { - const image = node.image(); - if (image) resolve(image as HTMLImageElement); - else reject(new Error(`Failed to load image: ${url}`)); - }, - () => reject(new Error(`Failed to load image: ${url}`)), - ); - }); -} - -export async function loadSprites(assetManager: AssetManagerLibrary): Promise { - const url = (path: string): string => assetManager.getAsset(path).path; - - const [background, ground, up, mid, down, pipe, gameover, message, ...digits] = await Promise.all( - [ - loadImage(url("background-day.png")), - loadImage(url("base.png")), - loadImage(url("yellowbird-upflap.png")), - loadImage(url("yellowbird-midflap.png")), - loadImage(url("yellowbird-downflap.png")), - loadImage(url("pipe-green.png")), - loadImage(url("gameover.png")), - loadImage(url("message.png")), - ...Array.from({ length: 10 }, (_, i) => loadImage(url(`${i}.png`))), - ], - ); - return { background, ground, birdFrames: [up, mid, down], pipe, gameover, message, digits }; -} - -export async function loadSounds( - assetManager: AssetManagerLibrary, - sound: { load: (key: string, file: string) => void }, -): Promise { - sound.load("wing", assetManager.getAsset("wing.wav").path); - sound.load("hit", assetManager.getAsset("hit.wav").path); - sound.load("point", assetManager.getAsset("point.wav").path); - sound.load("die", assetManager.getAsset("die.wav").path); - sound.load("swoosh", assetManager.getAsset("swoosh.wav").path); -} diff --git a/flappy-bird/client/components/bird.component.ts b/flappy-bird/client/components/bird.component.ts deleted file mode 100644 index be99ea0..0000000 --- a/flappy-bird/client/components/bird.component.ts +++ /dev/null @@ -1,18 +0,0 @@ -import type { Component } from "@nanoforge-dev/ecs-client"; - -export class PositionComponent implements Component { - name = this.constructor.name; - constructor( - public x: number, - public y: number, - ) {} -} - -export class VelocityComponent implements Component { - name = this.constructor.name; - constructor(public vy: number) {} -} - -export class BirdComponent implements Component { - name = this.constructor.name; -} diff --git a/flappy-bird/client/components/pipe.component.ts b/flappy-bird/client/components/pipe.component.ts deleted file mode 100644 index 4d46996..0000000 --- a/flappy-bird/client/components/pipe.component.ts +++ /dev/null @@ -1,33 +0,0 @@ -import type { Component, Entity } from "@nanoforge-dev/ecs-client"; -import type { Group } from "@nanoforge-dev/graphics-2d"; - -export interface HitRect { - x: number; - y: number; - width: number; - height: number; -} - -export class PipeComponent implements Component { - name = this.constructor.name; - scored: boolean; - prevX: number; - hitTop: HitRect; - hitBottom: HitRect; - constructor( - public entity: Entity, - public x: number, - topY: number, - topHeight: number, - pipeWidth: number, - bottomY: number, - bottomHeight: number, - public topGroup: Group, - public bottomGroup: Group, - ) { - this.scored = false; - this.prevX = x; - this.hitTop = { x, y: topY, width: pipeWidth, height: topHeight }; - this.hitBottom = { x, y: bottomY, width: pipeWidth, height: bottomHeight }; - } -} diff --git a/flappy-bird/client/game-state.ts b/flappy-bird/client/game-state.ts deleted file mode 100644 index 7dbb5ec..0000000 --- a/flappy-bird/client/game-state.ts +++ /dev/null @@ -1,20 +0,0 @@ -import type { PipeComponent } from "./components/pipe.component"; - -type ZippedPipe = { PipeComponent: PipeComponent }; - -export class GameState { - running = false; - gameOver = false; - score = 0; - gameOverAt = 0; - pipeSpawnTimer = 0; - pipesTick: ZippedPipe[] = []; - - lastTickAt = 0; - prevBirdY = 0; - currBirdY = 0; - prevBirdRotation = 0; - currBirdRotation = 0; - prevGroundX = 0; - currGroundX = 0; -} diff --git a/flappy-bird/client/game.ts b/flappy-bird/client/game.ts deleted file mode 100644 index 7343e2b..0000000 --- a/flappy-bird/client/game.ts +++ /dev/null @@ -1,205 +0,0 @@ -import { Image, Rect, type Graphics2DLibrary } from "@nanoforge-dev/graphics-2d"; -import type { AssetManagerLibrary } from "@nanoforge-dev/asset-manager"; -import type { InputLibrary } from "@nanoforge-dev/input"; -import type { ECSClientLibrary } from "@nanoforge-dev/ecs-client"; -import { PositionComponent, VelocityComponent, BirdComponent } from "./components/bird.component"; -import { PipeComponent } from "./components/pipe.component"; -import { GameState } from "./game-state"; -import { loadSprites, loadSounds } from "./assets"; -import type { SoundManager } from "./sound-manager"; -import { createInputSystem } from "./systems/input.system"; -import { createPhysicsSystem, flap } from "./systems/physics.system"; -import { createPipesSystem } from "./systems/pipes.system"; -import { createCollisionSystem } from "./systems/collision.system"; -import { createScoreSystem } from "./systems/score.system"; -import { startRenderLoop } from "./render-loop"; - -const BIRD_X = 60; -const GROUND_HEIGHT = 112; -const RESTART_COOLDOWN_MS = 400; - -export interface GameLibraries { - graphics: Graphics2DLibrary; - input: InputLibrary; - sound: SoundManager; - ecs: ECSClientLibrary; - assetManager: AssetManagerLibrary; -} - -export interface GameHandle { - flap: () => void; -} - -export async function registerGame(libs: GameLibraries): Promise { - const { graphics, input, sound, ecs, assetManager } = libs; - const stage = graphics.stage; - const layer = graphics.baseLayer; - const stageWidth = stage.width(); - const stageHeight = stage.height(); - - layer.listening(false); - - const [sprites] = await Promise.all([loadSprites(assetManager), loadSounds(assetManager, sound)]); - - const state = new GameState(); - - const background = new Image({ - image: sprites.background, - x: 0, - y: 0, - width: stageWidth, - height: stageHeight, - }); - layer.add(background); - - const ground = new Rect({ - x: 0, - y: stageHeight - GROUND_HEIGHT, - width: stageWidth, - height: GROUND_HEIGHT, - fillPatternImage: sprites.ground, - fillPatternRepeat: "repeat-x", - }); - layer.add(ground); - - const registry = ecs.registry; - const bird = registry.spawnEntity(); - registry.addComponent(bird, new PositionComponent(BIRD_X, stageHeight / 2)); - registry.addComponent(bird, new VelocityComponent(0)); - registry.addComponent(bird, new BirdComponent()); - - const birdFrameWidth = sprites.birdFrames[1]?.naturalWidth ?? 34; - const birdFrameHeight = sprites.birdFrames[1]?.naturalHeight ?? 24; - const birdNode = new Image({ - image: sprites.birdFrames[1], - x: BIRD_X, - y: stageHeight / 2, - width: birdFrameWidth, - height: birdFrameHeight, - offsetX: birdFrameWidth / 2, - offsetY: birdFrameHeight / 2, - }); - layer.add(birdNode); - - state.lastTickAt = performance.now(); - state.prevBirdY = stageHeight / 2; - state.currBirdY = stageHeight / 2; - - const message = new Image({ - image: sprites.message, - x: (stageWidth - sprites.message.naturalWidth) / 2, - y: stageHeight / 4, - width: sprites.message.naturalWidth, - height: sprites.message.naturalHeight, - }); - layer.add(message); - - const pipeWidth = sprites.pipe.naturalWidth || 52; - - const scoreCtl = createScoreSystem({ - birdX: BIRD_X, - pipeWidth, - layer, - digits: sprites.digits, - stageWidth, - sound, - state, - }); - - let gameoverNode: Image | null = null; - - function handleGameOver(): void { - gameoverNode = new Image({ - image: sprites.gameover, - x: (stageWidth - sprites.gameover.naturalWidth) / 2, - y: stageHeight / 3, - width: sprites.gameover.naturalWidth, - height: sprites.gameover.naturalHeight, - }); - layer.add(gameoverNode); - layer.batchDraw(); - state.gameOverAt = performance.now(); - } - - function resetGame(): void { - const pipes = registry.getZipper([PipeComponent]) as { PipeComponent: PipeComponent }[]; - for (const { PipeComponent: pipe } of pipes) { - pipe.topGroup.destroy(); - pipe.bottomGroup.destroy(); - registry.killEntity(pipe.entity); - } - state.pipeSpawnTimer = 0; - state.pipesTick = []; - - gameoverNode?.destroy(); - gameoverNode = null; - - const pos = registry.getEntityComponent(bird, new PositionComponent(0, 0)) as PositionComponent; - const vel = registry.getEntityComponent(bird, new VelocityComponent(0)) as VelocityComponent; - pos.x = BIRD_X; - pos.y = stageHeight / 2; - vel.vy = 0; - birdNode.x(BIRD_X); - birdNode.y(stageHeight / 2); - birdNode.rotation(0); - - state.prevBirdY = stageHeight / 2; - state.currBirdY = stageHeight / 2; - state.prevBirdRotation = 0; - state.currBirdRotation = 0; - - state.score = 0; - state.gameOver = false; - scoreCtl.resetDisplay(); - } - - function handleFlap(): void { - if (state.gameOver) { - if (performance.now() - state.gameOverAt < RESTART_COOLDOWN_MS) return; - resetGame(); - state.running = true; - sound.play("swoosh"); - flap(registry, bird); - sound.play("wing"); - return; - } - if (!state.running) { - state.running = true; - message.destroy(); - sound.play("swoosh"); - } - flap(registry, bird); - sound.play("wing"); - } - - registry.addSystem(createInputSystem(input, handleFlap)); - registry.addSystem(createPhysicsSystem(bird, birdNode, state)); - registry.addSystem( - createPipesSystem({ - layer, - pipeImage: sprites.pipe, - stageWidth, - stageHeight, - groundHeight: GROUND_HEIGHT, - ground, - state, - }), - ); - registry.addSystem( - createCollisionSystem({ - birdNode, - groundY: stageHeight - GROUND_HEIGHT, - sound, - state, - onGameOver: handleGameOver, - }), - ); - registry.addSystem(scoreCtl.tick); - registry.addSystem(() => { - state.lastTickAt = performance.now(); - }); - - startRenderLoop({ layer, birdNode, ground, state }); - - return { flap: handleFlap }; -} diff --git a/flappy-bird/client/main.ts b/flappy-bird/client/main.ts deleted file mode 100644 index c19909c..0000000 --- a/flappy-bird/client/main.ts +++ /dev/null @@ -1,64 +0,0 @@ -import { NanoforgeFactory } from "@nanoforge-dev/core"; -import { type IRunClientOptions, type IRunOptions } from "@nanoforge-dev/common"; -import { AssetManagerLibrary } from "@nanoforge-dev/asset-manager"; -import { Graphics2DLibrary } from "@nanoforge-dev/graphics-2d"; -import { InputLibrary } from "@nanoforge-dev/input"; -import { ECSClientLibrary } from "@nanoforge-dev/ecs-client"; - -import { registerGame } from "./game"; -import { SoundManager } from "./sound-manager"; - -const GAME_WIDTH = 420; -const GAME_HEIGHT = 560; - -export async function main(options: IRunOptions) { - const { container } = options as IRunClientOptions; - - const client = NanoforgeFactory.createClient({ tickRate: 60 }); - const assetManager = new AssetManagerLibrary(); - const graphics = new Graphics2DLibrary(); - const input = new InputLibrary(); - const ecs = new ECSClientLibrary(); - const sound = new SoundManager(); - - client.useAssetManager(assetManager); - client.useGraphics(graphics); - client.useInput(input); - client.useComponentSystem(ecs); - - await client.init(options); - - const stage = graphics.stage; - stage.size({ width: GAME_WIDTH, height: GAME_HEIGHT }); - - container.style.display = "flex"; - container.style.alignItems = "center"; - container.style.justifyContent = "center"; - const canvas = container.querySelector("canvas"); - - function applyResponsiveScale(): void { - const scale = Math.min( - container.clientWidth / GAME_WIDTH, - container.clientHeight / GAME_HEIGHT, - ); - if (canvas) { - canvas.style.transform = `scale(${scale > 0 ? scale : 1})`; - } - } - - applyResponsiveScale(); - requestAnimationFrame(applyResponsiveScale); - window.addEventListener("resize", applyResponsiveScale); - - const game = await registerGame({ graphics, input, sound, ecs, assetManager }); - await client.run(); - - container.addEventListener( - "touchstart", - (event) => { - event.preventDefault(); - game.flap(); - }, - { passive: false }, - ); -} diff --git a/flappy-bird/client/render-loop.ts b/flappy-bird/client/render-loop.ts deleted file mode 100644 index 1353161..0000000 --- a/flappy-bird/client/render-loop.ts +++ /dev/null @@ -1,43 +0,0 @@ -import type { Image, Layer, Rect } from "@nanoforge-dev/graphics-2d"; -import type { GameState } from "./game-state"; - -// Must match NanoforgeFactory.createClient({ tickRate: 60 }) in main.ts. -const TICK_INTERVAL_MS = 1000 / 60; - -function lerp(from: number, to: number, alpha: number): number { - return from + (to - from) * alpha; -} - -export interface RenderLoopDeps { - layer: Layer; - birdNode: Image; - ground: Rect; - state: GameState; -} - -export function startRenderLoop(deps: RenderLoopDeps): void { - const { layer, birdNode, ground, state } = deps; - - function render(): void { - try { - const alpha = Math.min(1, (performance.now() - state.lastTickAt) / TICK_INTERVAL_MS); - - birdNode.y(lerp(state.prevBirdY, state.currBirdY, alpha)); - birdNode.rotation(lerp(state.prevBirdRotation, state.currBirdRotation, alpha)); - ground.fillPatternX(lerp(state.prevGroundX, state.currGroundX, alpha)); - - for (const { PipeComponent: pipe } of state.pipesTick) { - const x = lerp(pipe.prevX, pipe.x, alpha); - pipe.topGroup.x(x); - pipe.bottomGroup.x(x); - } - - layer.batchDraw(); - } catch (err) { - console.error("render-loop: skipping frame after error", err); - } - requestAnimationFrame(render); - } - - requestAnimationFrame(render); -} diff --git a/flappy-bird/client/sound-manager.ts b/flappy-bird/client/sound-manager.ts deleted file mode 100644 index c2d1ada..0000000 --- a/flappy-bird/client/sound-manager.ts +++ /dev/null @@ -1,34 +0,0 @@ -const DEFAULT_VOLUME = 0.5; - -export class SoundManager { - private ctx = new AudioContext(); - private gain = this.ctx.createGain(); - private buffers = new Map(); - - constructor() { - this.gain.gain.value = DEFAULT_VOLUME; - this.gain.connect(this.ctx.destination); - } - - load(key: string, url: string): void { - fetch(url) - .then((response) => response.arrayBuffer()) - .then((data) => this.ctx.decodeAudioData(data)) - .then((buffer) => { - this.buffers.set(key, buffer); - }) - .catch(() => {}); - } - - play(key: string): void { - const buffer = this.buffers.get(key); - if (!buffer) return; - if (this.ctx.state === "suspended") { - this.ctx.resume().catch(() => {}); - } - const source = this.ctx.createBufferSource(); - source.buffer = buffer; - source.connect(this.gain); - source.start(); - } -} diff --git a/flappy-bird/client/systems/collision.system.ts b/flappy-bird/client/systems/collision.system.ts deleted file mode 100644 index 545ac4d..0000000 --- a/flappy-bird/client/systems/collision.system.ts +++ /dev/null @@ -1,67 +0,0 @@ -import type { Registry, System } from "@nanoforge-dev/ecs-client"; -import type { Image as KonvaImage } from "@nanoforge-dev/graphics-2d"; -import type { SoundManager } from "../sound-manager"; -import type { GameState } from "../game-state"; - -type Rect = { x: number; y: number; width: number; height: number }; - -function overlaps(a: Rect, b: Rect): boolean { - return a.x < b.x + b.width && a.x + a.width > b.x && a.y < b.y + b.height && a.y + a.height > b.y; -} - -const BIRD_HITBOX_INSET_RATIO = 0.25; - -function shrink(rect: Rect, ratio: number): Rect { - const insetX = rect.width * ratio; - const insetY = rect.height * ratio; - return { - x: rect.x + insetX, - y: rect.y + insetY, - width: rect.width - insetX * 2, - height: rect.height - insetY * 2, - }; -} - -export interface CollisionSystemDeps { - birdNode: KonvaImage; - groundY: number; - sound: SoundManager; - state: GameState; - onGameOver: () => void; -} - -export function createCollisionSystem(deps: CollisionSystemDeps): System { - const { birdNode, groundY, sound, state, onGameOver } = deps; - - return (registry: Registry) => { - if (!state.running || state.gameOver) return; - void registry; - - const bird = shrink( - { - x: birdNode.x() - birdNode.width() / 2, - y: state.currBirdY - birdNode.height() / 2, - width: birdNode.width(), - height: birdNode.height(), - }, - BIRD_HITBOX_INSET_RATIO, - ); - - let hit = bird.y + bird.height >= groundY; - if (!hit) { - for (const { PipeComponent: pipe } of state.pipesTick) { - if (overlaps(bird, pipe.hitTop) || overlaps(bird, pipe.hitBottom)) { - hit = true; - break; - } - } - } - - if (hit) { - state.gameOver = true; - sound.play("hit"); - window.setTimeout(() => sound.play("die"), 150); - onGameOver(); - } - }; -} diff --git a/flappy-bird/client/systems/input.system.ts b/flappy-bird/client/systems/input.system.ts deleted file mode 100644 index 6ad6aee..0000000 --- a/flappy-bird/client/systems/input.system.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { Registry, System } from "@nanoforge-dev/ecs-client"; -import { InputEnum, type InputLibrary } from "@nanoforge-dev/input"; - -export function createInputSystem(input: InputLibrary, onFlap: () => void): System { - let wasPressed = false; - return (_registry: Registry) => { - const pressed = Boolean( - input.isKeyPressed(InputEnum.Space) || input.isKeyPressed(InputEnum.MouseLeft), - ); - if (pressed && !wasPressed) { - onFlap(); - } - wasPressed = pressed; - }; -} diff --git a/flappy-bird/client/systems/physics.system.ts b/flappy-bird/client/systems/physics.system.ts deleted file mode 100644 index d154e70..0000000 --- a/flappy-bird/client/systems/physics.system.ts +++ /dev/null @@ -1,43 +0,0 @@ -import type { Context } from "@nanoforge-dev/common"; -import type { Entity, Registry, System } from "@nanoforge-dev/ecs-client"; -import type { Image } from "@nanoforge-dev/graphics-2d"; -import { PositionComponent, VelocityComponent } from "../components/bird.component"; -import type { GameState } from "../game-state"; - -const GRAVITY = 1500; -const FLAP_VELOCITY = -430; -const MAX_FALL_SPEED = 640; - -export function createPhysicsSystem(bird: Entity, birdNode: Image, state: GameState): System { - return (registry: Registry, ctx: Context) => { - if (!state.running || state.gameOver) { - state.prevBirdY = state.currBirdY; - state.prevBirdRotation = state.currBirdRotation; - return; - } - - const pos = registry.getEntityComponent(bird, new PositionComponent(0, 0)) as PositionComponent; - const vel = registry.getEntityComponent(bird, new VelocityComponent(0)) as VelocityComponent; - if (!pos || !vel) return; - - const dt = Math.min(ctx.app.delta / 1000, 1 / 30); - vel.vy = Math.min(vel.vy + GRAVITY * dt, MAX_FALL_SPEED); - pos.y += vel.vy * dt; - - const rect = { y: pos.y - birdNode.height() / 2 }; - if (rect.y < 0) { - pos.y -= rect.y; - if (vel.vy < 0) vel.vy = 0; - } - - state.prevBirdY = state.currBirdY; - state.currBirdY = pos.y; - state.prevBirdRotation = state.currBirdRotation; - state.currBirdRotation = Math.max(-25, Math.min(90, vel.vy / 8)); - }; -} - -export function flap(registry: Registry, bird: Entity): void { - const vel = registry.getEntityComponent(bird, new VelocityComponent(0)) as VelocityComponent; - if (vel) vel.vy = FLAP_VELOCITY; -} diff --git a/flappy-bird/client/systems/pipes.system.ts b/flappy-bird/client/systems/pipes.system.ts deleted file mode 100644 index cac2a62..0000000 --- a/flappy-bird/client/systems/pipes.system.ts +++ /dev/null @@ -1,142 +0,0 @@ -import type { Context } from "@nanoforge-dev/common"; -import type { Registry, System } from "@nanoforge-dev/ecs-client"; -import { Group, Image, type Layer, type Rect } from "@nanoforge-dev/graphics-2d"; -import { PipeComponent } from "../components/pipe.component"; -import type { GameState } from "../game-state"; - -const BASE_PIPE_GAP = 150; -const MIN_PIPE_GAP = 110; -const GAP_DIFFICULTY_STEP = 2.5; -const GAP_JITTER = 16; -const PIPE_SPEED = 150; -const SPAWN_INTERVAL = 1.5; -const CAP_HEIGHT = 24; -const EDGE_MARGIN = 60; -const MAX_DT = 1 / 30; - -export interface PipesSystemDeps { - layer: Layer; - pipeImage: HTMLImageElement; - stageWidth: number; - stageHeight: number; - groundHeight: number; - ground: Rect; - state: GameState; -} - -function createPipeSegment( - pipeImage: HTMLImageElement, - pipeWidth: number, - totalHeight: number, - flipped: boolean, -): Group { - const group = new Group(); - const bodyHeight = Math.max(0, totalHeight - CAP_HEIGHT); - - const body = new Image({ - image: pipeImage, - crop: { x: 0, y: CAP_HEIGHT, width: pipeWidth, height: 320 - CAP_HEIGHT }, - x: 0, - y: flipped ? 0 : CAP_HEIGHT, - width: pipeWidth, - height: bodyHeight, - }); - const cap = new Image({ - image: pipeImage, - crop: { x: 0, y: 0, width: pipeWidth, height: CAP_HEIGHT }, - x: 0, - y: flipped ? bodyHeight : 0, - width: pipeWidth, - height: CAP_HEIGHT, - scaleY: flipped ? -1 : 1, - offsetY: flipped ? CAP_HEIGHT : 0, - }); - group.add(body); - group.add(cap); - return group; -} - -export function createPipesSystem(deps: PipesSystemDeps): System { - const { layer, pipeImage, stageWidth, stageHeight, groundHeight, ground, state } = deps; - const pipeWidth = pipeImage.naturalWidth || 52; - const groundY = stageHeight - groundHeight; - const playableHeight = groundY; - - return (registry: Registry, ctx: Context) => { - const dt = Math.min(ctx.app.delta / 1000, MAX_DT); - if (state.running) { - state.prevGroundX = state.currGroundX; - state.currGroundX -= PIPE_SPEED * dt; - } - if (!state.running || state.gameOver) { - for (const { PipeComponent: pipe } of state.pipesTick) { - pipe.prevX = pipe.x; - } - return; - } - - state.pipeSpawnTimer -= dt; - if (state.pipeSpawnTimer <= 0) { - state.pipeSpawnTimer = SPAWN_INTERVAL; - - const difficultyGap = Math.max( - MIN_PIPE_GAP, - BASE_PIPE_GAP - state.score * GAP_DIFFICULTY_STEP, - ); - const gap = Math.max(MIN_PIPE_GAP, difficultyGap + (Math.random() * 2 - 1) * GAP_JITTER); - - const centerMin = gap / 2 + EDGE_MARGIN; - const centerMax = playableHeight - gap / 2 - EDGE_MARGIN; - const gapCenterY = centerMin + Math.random() * Math.max(0, centerMax - centerMin); - const topHeight = gapCenterY - gap / 2; - const bottomHeight = groundY - (gapCenterY + gap / 2); - - const entity = registry.spawnEntity(); - const topGroup = createPipeSegment(pipeImage, pipeWidth, topHeight, true); - topGroup.position({ x: stageWidth, y: 0 }); - const bottomGroup = createPipeSegment(pipeImage, pipeWidth, bottomHeight, false); - bottomGroup.position({ x: stageWidth, y: gapCenterY + gap / 2 }); - - layer.add(topGroup); - layer.add(bottomGroup); - ground.moveToTop(); - registry.addComponent( - entity, - new PipeComponent( - entity, - stageWidth, - 0, - topHeight, - pipeWidth, - gapCenterY + gap / 2, - bottomHeight, - topGroup, - bottomGroup, - ), - ); - } - - const pipes = registry.getZipper([PipeComponent]) as { PipeComponent: PipeComponent }[]; - - const dead: PipeComponent[] = []; - const alive: { PipeComponent: PipeComponent }[] = []; - for (const row of pipes) { - const pipe = row.PipeComponent; - pipe.prevX = pipe.x; - pipe.x -= PIPE_SPEED * dt; - pipe.hitTop.x = pipe.x; - pipe.hitBottom.x = pipe.x; - if (pipe.x + pipeWidth < 0) { - dead.push(pipe); - } else { - alive.push(row); - } - } - for (const pipe of dead) { - registry.killEntity(pipe.entity); - pipe.topGroup.destroy(); - pipe.bottomGroup.destroy(); - } - state.pipesTick = alive; - }; -} diff --git a/flappy-bird/client/systems/score.system.ts b/flappy-bird/client/systems/score.system.ts deleted file mode 100644 index a8f1638..0000000 --- a/flappy-bird/client/systems/score.system.ts +++ /dev/null @@ -1,62 +0,0 @@ -import type { Registry, System } from "@nanoforge-dev/ecs-client"; -import { Group, Image, type Layer } from "@nanoforge-dev/graphics-2d"; -import type { SoundManager } from "../sound-manager"; -import type { GameState } from "../game-state"; - -export interface ScoreSystemDeps { - birdX: number; - pipeWidth: number; - layer: Layer; - digits: HTMLImageElement[]; - stageWidth: number; - sound: SoundManager; - state: GameState; -} - -function renderScore(deps: ScoreSystemDeps, group: Group): void { - group.destroyChildren(); - - const text = String(deps.state.score); - const digitWidth = deps.digits[0]?.naturalWidth ?? 24; - const digitHeight = deps.digits[0]?.naturalHeight ?? 36; - const totalWidth = text.length * digitWidth; - let x = (deps.stageWidth - totalWidth) / 2; - - for (const char of text) { - const image = deps.digits[Number(char)]; - if (!image) continue; - group.add(new Image({ image, x, y: 20, width: digitWidth, height: digitHeight })); - x += digitWidth; - } -} - -export interface ScoreSystemControls { - tick: System; - resetDisplay: () => void; -} - -export function createScoreSystem(deps: ScoreSystemDeps): ScoreSystemControls { - const group = new Group(); - deps.layer.add(group); - renderScore(deps, group); - - const tick: System = (registry: Registry) => { - group.moveToTop(); - if (!deps.state.running || deps.state.gameOver) return; - void registry; - - for (const { PipeComponent: pipe } of deps.state.pipesTick) { - if (!pipe.scored && pipe.x + deps.pipeWidth < deps.birdX) { - pipe.scored = true; - deps.state.score += 1; - deps.sound.play("point"); - renderScore(deps, group); - } - } - }; - - return { - tick, - resetDisplay: () => renderScore(deps, group), - }; -} diff --git a/flappy-bird/eslint.config.js b/flappy-bird/eslint.config.js deleted file mode 100644 index d3db057..0000000 --- a/flappy-bird/eslint.config.js +++ /dev/null @@ -1,23 +0,0 @@ -import pluginJs from "@eslint/js"; -import eslintConfigPrettier from "eslint-config-prettier"; -import globals from "globals"; -import tseslint from "typescript-eslint"; - -export default [ - { files: ["{client,server}/**/*.{ts}"] }, - { languageOptions: { globals: globals.node } }, - - pluginJs.configs.recommended, - ...tseslint.configs.recommended, - ...tseslint.configs.strict, - eslintConfigPrettier, - { - rules: { - "@typescript-eslint/no-unused-vars": [ - "error", - { argsIgnorePattern: "^_", varsIgnorePattern: "^_" }, - ], - }, - }, - { ignores: ["**/*.js", "**/*.d.ts"] }, -]; diff --git a/flappy-bird/nanoforge.config.json b/flappy-bird/nanoforge.config.json deleted file mode 100644 index 135d579..0000000 --- a/flappy-bird/nanoforge.config.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "name": "flappy-bird", - "language": "ts", - "initFunctions": false, - "client": { - "enable": true, - "build": { - "entry": "client/main.ts", - "staticDir": "client/static" - }, - "outDir": ".nanoforge/client" - }, - "server": { - "enable": false - } -} diff --git a/flappy-bird/package.json b/flappy-bird/package.json deleted file mode 100644 index d60aeb8..0000000 --- a/flappy-bird/package.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "flappy-bird", - "version": "0.0.0", - "description": "", - "author": "", - "scripts": { - "build": "nf build", - "start": "nf start", - "lint": "prettier --check . && eslint \"{client,server}/**/*.ts\"", - "format": "prettier --write . && eslint --fix \"{client,server}/**/*.ts\"" - }, - "dependencies": { - "@nanoforge-dev/asset-manager": "^1", - "@nanoforge-dev/common": "^1", - "@nanoforge-dev/core": "^1", - "@nanoforge-dev/ecs-client": "^1", - "@nanoforge-dev/graphics-2d": "^1", - "@nanoforge-dev/input": "^1" - }, - "devDependencies": { - "@eslint/js": "^9.39.0", - "@nanoforge-dev/cli": "1.6.2", - "@nanoforge-dev/config": "^1", - "@typescript-eslint/eslint-plugin": "^8.46.2", - "@typescript-eslint/parser": "^8.46.2", - "eslint": "^9.39.0", - "eslint-config-prettier": "^10.1.8", - "eslint-plugin-prettier": "^5.5.4", - "globals": "^16.5.0", - "prettier": "^3.6.2", - "typescript": "^5.9.3", - "typescript-eslint": "^8.46.2" - }, - "private": true -} diff --git a/flappy-bird/pnpm-lock.yaml b/flappy-bird/pnpm-lock.yaml deleted file mode 100644 index 4691997..0000000 --- a/flappy-bird/pnpm-lock.yaml +++ /dev/null @@ -1,2238 +0,0 @@ -lockfileVersion: '9.0' - -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false - -importers: - - .: - dependencies: - '@nanoforge-dev/asset-manager': - specifier: ^1 - version: 1.4.2 - '@nanoforge-dev/common': - specifier: ^1 - version: 1.4.2 - '@nanoforge-dev/core': - specifier: ^1 - version: 1.4.2 - '@nanoforge-dev/ecs-client': - specifier: ^1 - version: 1.4.2 - '@nanoforge-dev/graphics-2d': - specifier: ^1 - version: 1.4.2 - '@nanoforge-dev/input': - specifier: ^1 - version: 1.4.2 - devDependencies: - '@eslint/js': - specifier: ^9.39.0 - version: 9.39.5 - '@nanoforge-dev/cli': - specifier: 1.6.2 - version: 1.6.2 - '@nanoforge-dev/config': - specifier: ^1 - version: 1.4.2 - '@typescript-eslint/eslint-plugin': - specifier: ^8.46.2 - version: 8.70.0(@typescript-eslint/parser@8.70.0(eslint@9.39.5)(typescript@5.9.3))(eslint@9.39.5)(typescript@5.9.3) - '@typescript-eslint/parser': - specifier: ^8.46.2 - version: 8.70.0(eslint@9.39.5)(typescript@5.9.3) - eslint: - specifier: ^9.39.0 - version: 9.39.5 - eslint-config-prettier: - specifier: ^10.1.8 - version: 10.1.8(eslint@9.39.5) - eslint-plugin-prettier: - specifier: ^5.5.4 - version: 5.5.6(eslint-config-prettier@10.1.8(eslint@9.39.5))(eslint@9.39.5)(prettier@3.9.6) - globals: - specifier: ^16.5.0 - version: 16.5.0 - prettier: - specifier: ^3.6.2 - version: 3.9.6 - typescript: - specifier: ^5.9.3 - version: 5.9.3 - typescript-eslint: - specifier: ^8.46.2 - version: 8.70.0(eslint@9.39.5)(typescript@5.9.3) - -packages: - - '@angular-devkit/core@22.1.7': - resolution: {integrity: sha512-RKayeOOjhcIe/iBOM1fmtI5pjXwBEJh+u55VnSeIwYvFNXyxI0/jdRw4T6uhwusQ+1bzyya4d8q1mT9oaOQ/5A==} - engines: {node: ^22.22.3 || ^24.15.0 || >=26.0.0, npm: ^6.11.0 || ^7.5.6 || >=8.0.0, yarn: '>= 1.13.0'} - peerDependencies: - chokidar: ^5.0.0 - peerDependenciesMeta: - chokidar: - optional: true - - '@angular-devkit/schematics-cli@22.1.7': - resolution: {integrity: sha512-T/uGBiUqbBEHYwO3iUiyjGc9blPYA1U3N+4CT7IxA0GCYikDbbPfPaoYDQTsGny+DN5YKx4HGhXZp1htBbbPhQ==} - engines: {node: ^22.22.3 || ^24.15.0 || >=26.0.0, npm: ^6.11.0 || ^7.5.6 || >=8.0.0, yarn: '>= 1.13.0'} - hasBin: true - - '@angular-devkit/schematics@22.1.7': - resolution: {integrity: sha512-KOcVeT4MCsoPt6AMnXH7AbWZnzlKXhMyua2ITWij4UbLaNWCDwfIug/xrZssYLHUFwebCIqsR8iuG/BPH8Cz2w==} - engines: {node: ^22.22.3 || ^24.15.0 || >=26.0.0, npm: ^6.11.0 || ^7.5.6 || >=8.0.0, yarn: '>= 1.13.0'} - - '@eslint-community/eslint-utils@4.10.1': - resolution: {integrity: sha512-cuadcxVFE8sDK6iWJbs8Sn0av2Nrh2QSGQhVlBW9AaAHqHwjWsZHT8LJ4hFGPh7ASBV2deFdM7H/DPjulmh8rg==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - peerDependencies: - eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 - - '@eslint-community/regexpp@4.12.2': - resolution: {integrity: sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew==} - engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} - - '@eslint/config-array@0.21.2': - resolution: {integrity: sha512-nJl2KGTlrf9GjLimgIru+V/mzgSK0ABCDQRvxw5BjURL7WfH5uoWmizbH7QB6MmnMBd8cIC9uceWnezL1VZWWw==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - - '@eslint/config-helpers@0.4.2': - resolution: {integrity: sha512-gBrxN88gOIf3R7ja5K9slwNayVcZgK6SOUORm2uBzTeIEfeVaIhOpCtTox3P6R7o2jLFwLFTLnC7kU/RGcYEgw==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - - '@eslint/core@0.17.0': - resolution: {integrity: sha512-yL/sLrpmtDaFEiUj1osRP4TI2MDz1AddJL+jZ7KSqvBuliN4xqYY54IfdN8qD8Toa6g1iloph1fxQNkjOxrrpQ==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - - '@eslint/eslintrc@3.3.7': - resolution: {integrity: sha512-F42g89Qd5oAWtp0k0nnSrjziAKza7w8SVT4mStc18LZMaRb4J1HQAHLCalEtDCxrTuksx7NU9qsmeLwpOfPqWw==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - - '@eslint/js@9.39.5': - resolution: {integrity: sha512-QywQuszQh77pIXCsq998c8hbhSTI/azTty1Z6N53dmAudKHhy573j3yvRLsX2BSp8YpLtoCEG8E9DJe+8zUh4A==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - - '@eslint/object-schema@2.1.7': - resolution: {integrity: sha512-VtAOaymWVfZcmZbp6E2mympDIHvyjXs/12LqWYjVw6qjrfF+VK+fyG33kChz3nnK+SU5/NeHOqrTEHS8sXO3OA==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - - '@eslint/plugin-kit@0.4.1': - resolution: {integrity: sha512-43/qtrDUokr7LJqoF2c3+RInu/t4zfrpYdoSDfYyhg52rwLV6TnOvdG4fXm7IkSB3wErkcmJS9iEhjVtOSEjjA==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - - '@humanfs/core@0.19.2': - resolution: {integrity: sha512-UhXNm+CFMWcbChXywFwkmhqjs3PRCmcSa/hfBgLIb7oQ5HNb1wS0icWsGtSAUNgefHeI+eBrA8I1fxmbHsGdvA==} - engines: {node: '>=18.18.0'} - - '@humanfs/node@0.16.8': - resolution: {integrity: sha512-gE1eQNZ3R++kTzFUpdGlpmy8kDZD/MLyHqDwqjkVQI0JMdI1D51sy1H958PNXYkM2rAac7e5/CnIKZrHtPh3BQ==} - engines: {node: '>=18.18.0'} - - '@humanfs/types@0.15.0': - resolution: {integrity: sha512-ZZ1w0aoQkwuUuC7Yf+7sdeaNfqQiiLcSRbfI08oAxqLtpXQr9AIVX7Ay7HLDuiLYAaFPu8oBYNq/QIi9URHJ3Q==} - engines: {node: '>=18.18.0'} - - '@humanwhocodes/module-importer@1.0.1': - resolution: {integrity: sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==} - engines: {node: '>=12.22'} - - '@humanwhocodes/retry@0.4.3': - resolution: {integrity: sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==} - engines: {node: '>=18.18'} - - '@inquirer/ansi@2.0.8': - resolution: {integrity: sha512-WpQM+Ti6Z40EFwwt+uL2p4UabT+W179zHp6HhLVOzfbwnVn05IPO/eXIZXGNqcT1jbQ15SujNLzQ39k4QPPxBQ==} - engines: {node: '>=23.5.0 || ^22.13.0 || ^20.17.0'} - - '@inquirer/checkbox@5.2.5': - resolution: {integrity: sha512-bRt8J8m+Fot9CXv+zNQGXUq2ET0MggR1fPz7v6edN6MFYmsbfGnMmkmWZJEegMKqrAC8ej/o1sqisHZXZJMAfQ==} - engines: {node: '>=23.5.0 || ^22.13.0 || ^20.17.0'} - peerDependencies: - '@types/node': '>=18' - peerDependenciesMeta: - '@types/node': - optional: true - - '@inquirer/confirm@6.3.2': - resolution: {integrity: sha512-Xvr/0HggjddPtGppuqVmxhTw+Hr8PvsZ/k0HmOEaAqQEt80OITNkFWnsdNmyT0/eM4Ab+iJLx2R8rctlEyfSVg==} - engines: {node: '>=23.5.0 || ^22.13.0 || ^20.17.0'} - peerDependencies: - '@types/node': '>=18' - peerDependenciesMeta: - '@types/node': - optional: true - - '@inquirer/core@12.0.3': - resolution: {integrity: sha512-wsSy0sznmXwkty+2PzZwx00Cazc/E0r0B7mAzdGROz2Ct+DFZXaK7WDjGZvgjRldxH5ZhFVfF2lgkYrqgOw2KA==} - engines: {node: '>=23.5.0 || ^22.13.0 || ^20.17.0'} - peerDependencies: - '@types/node': '>=18' - peerDependenciesMeta: - '@types/node': - optional: true - - '@inquirer/editor@5.3.3': - resolution: {integrity: sha512-YsKkS2q63IiLtaDK/9nqzdComN97SDQrmKiyNggN+ceP4ty+Z6VwyTz3FpjeUWeW1Efss2xHFKCC9sx7hnrsxg==} - engines: {node: '>=23.5.0 || ^22.13.0 || ^20.17.0'} - peerDependencies: - '@types/node': '>=18' - peerDependenciesMeta: - '@types/node': - optional: true - - '@inquirer/expand@5.1.5': - resolution: {integrity: sha512-uHuXLmXW+TtIfT/9vSBotypAkqn1n34Ul+CLGPos/xANyO4Ff5xZzkYhbKR4NEcfVK4a9mHQOpwVZzluSHFRGw==} - engines: {node: '>=23.5.0 || ^22.13.0 || ^20.17.0'} - peerDependencies: - '@types/node': '>=18' - peerDependenciesMeta: - '@types/node': - optional: true - - '@inquirer/external-editor@3.0.5': - resolution: {integrity: sha512-f3QQJRIX5ZEneBHNUIuPjmbdzHnmRFJA8r2dkcb8q+OM5Uv5KtnuAttQumnrjcBVBM3mcTX1CkmtAkU58VRZxg==} - engines: {node: '>=23.5.0 || ^22.13.0 || ^20.17.0'} - peerDependencies: - '@types/node': '>=18' - peerDependenciesMeta: - '@types/node': - optional: true - - '@inquirer/figures@2.0.9': - resolution: {integrity: sha512-EAWgUTGQ/Umgga51dE3B2PUHbufuXarDfg86uVgoSgNHNNQnyFKcOrQLWVqYMghuSyHh8+2HUH0Js9cTC1WAdg==} - engines: {node: '>=23.5.0 || ^22.13.0 || ^20.17.0'} - - '@inquirer/input@5.1.6': - resolution: {integrity: sha512-HtcJhB2QFVXbLuJ5S3syhNbTUVxYvwqV4VRBDkQceBloC9bmTViUoRFP5PbSaDZb3HzfPmpuU/gG4ybVBz4FHA==} - engines: {node: '>=23.5.0 || ^22.13.0 || ^20.17.0'} - peerDependencies: - '@types/node': '>=18' - peerDependenciesMeta: - '@types/node': - optional: true - - '@inquirer/number@4.2.3': - resolution: {integrity: sha512-6Yuwh1NGSbu1Lo4N1EWjXs1jKRntLg/ZCwhmeorEHde90v1XxAozdbd4Iu30eOQLW+6h1hp2O9ujNfLSbTPJnA==} - engines: {node: '>=23.5.0 || ^22.13.0 || ^20.17.0'} - peerDependencies: - '@types/node': '>=18' - peerDependenciesMeta: - '@types/node': - optional: true - - '@inquirer/password@5.2.2': - resolution: {integrity: sha512-W9zYdyzogK+6110mqwaSJWCBu2yA5Q/OfnGSjjZB1bNpHlmUozXxTl0+QOZBNeVd6Qo81/qT75gW05gLAtITxw==} - engines: {node: '>=23.5.0 || ^22.13.0 || ^20.17.0'} - peerDependencies: - '@types/node': '>=18' - peerDependenciesMeta: - '@types/node': - optional: true - - '@inquirer/prompts@8.5.2': - resolution: {integrity: sha512-IYR/3C/paEVVQYQvdDlFZVjRCJVYHHON0XXMH91KO9GSxs0TdKYWlUdvfQl2EfAHDxUaN3IBffkE/BDTh5nJ6g==} - engines: {node: '>=23.5.0 || ^22.13.0 || ^20.17.0'} - peerDependencies: - '@types/node': '>=18' - peerDependenciesMeta: - '@types/node': - optional: true - - '@inquirer/prompts@8.7.2': - resolution: {integrity: sha512-QoRB4wFIjgH5iOhSjoIKMkTvSHDuV+O3OITlIqAYO0oK5x364GJILXiMBvlPiE+klg7Xx9tq5XVqQHcGUDYYPA==} - engines: {node: '>=23.5.0 || ^22.13.0 || ^20.17.0'} - peerDependencies: - '@types/node': '>=18' - peerDependenciesMeta: - '@types/node': - optional: true - - '@inquirer/rawlist@5.3.5': - resolution: {integrity: sha512-1oHky1ONfCOwNrnkQGDE1oaSij/3fI6HFMSf2H/WsGO2lEyDX9My82iggITSy9ddSZ8yk8j9v41OI0fVoSIoaA==} - engines: {node: '>=23.5.0 || ^22.13.0 || ^20.17.0'} - peerDependencies: - '@types/node': '>=18' - peerDependenciesMeta: - '@types/node': - optional: true - - '@inquirer/search@4.3.3': - resolution: {integrity: sha512-fyuIU1Nbpvwlikjg3gXwJFDI11+EFjqQ7P+iByfmivIKQ1vmaykNrD/vy5unHuUqUpsOsnvJ25//tPF7E/RBRA==} - engines: {node: '>=23.5.0 || ^22.13.0 || ^20.17.0'} - peerDependencies: - '@types/node': '>=18' - peerDependenciesMeta: - '@types/node': - optional: true - - '@inquirer/select@5.2.5': - resolution: {integrity: sha512-9kc15hr8r/kI+3DO/xLog5nOzTz1jqsHXa6JBFzmQKhkoJ8Slda1I1L/uD8ZSZ9tF1yp79wwXe7mclvX1rqR2Q==} - engines: {node: '>=23.5.0 || ^22.13.0 || ^20.17.0'} - peerDependencies: - '@types/node': '>=18' - peerDependenciesMeta: - '@types/node': - optional: true - - '@inquirer/type@4.1.1': - resolution: {integrity: sha512-yJoHYrMnxIsJZCY+0Vb66Dy3he3kL3e2wOBKhoSwWWAzZAY82emlxwgprCtp6yRixvNRNq9ztfRWQYPNr3Go7A==} - engines: {node: '>=23.5.0 || ^22.13.0 || ^20.17.0'} - peerDependencies: - '@types/node': '>=18' - peerDependenciesMeta: - '@types/node': - optional: true - - '@isaacs/fs-minipass@4.0.1': - resolution: {integrity: sha512-wgm9Ehl2jpeqP3zw/7mo3kRHFp5MEDhqAdwy1fTGkHAwnkGOVsgpvQhL8B5n1qlb01jV3n/bI0ZfZp5lWA1k4w==} - engines: {node: '>=18.0.0'} - - '@jridgewell/sourcemap-codec@1.6.0': - resolution: {integrity: sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw==} - - '@nanoforge-dev/asset-manager@1.4.2': - resolution: {integrity: sha512-CtUoNc5tc2QVdEs6nDER2WutBArS72RFod+cM+fwwrq+1btNeI7ed4sjbxqCBJLASqvZ7HQ3av6P8FGpfjRI6g==} - engines: {node: '25'} - - '@nanoforge-dev/cli@1.6.2': - resolution: {integrity: sha512-BtjWOu6cX7A3sk256cCNA+wyem9oobzhfjg4/7tNt/zN1vLYTb5is3s+D5IRRG6M1ZovW0W1InN53ss5boBxVQ==} - engines: {node: '25'} - hasBin: true - - '@nanoforge-dev/common@1.4.2': - resolution: {integrity: sha512-Km7eTwmpQ0XTx5o15Cu05ojRCL8px/DANVc0eYBLzKnG2/LamKs5P/e3HG+woULPz0/fc+ah/RPKyQwFtx5lBw==} - engines: {node: '25'} - - '@nanoforge-dev/config@1.4.2': - resolution: {integrity: sha512-SdV/nINKC5VQyvKZs6s6T+vlsSfKE47lhYgcacWqSBdi9BTDSTj6GNZRoWpwSMyiKCZ+Wj6DbmyJvPXDc/wTgA==} - engines: {node: '25'} - - '@nanoforge-dev/core@1.4.2': - resolution: {integrity: sha512-Ja7zNj78f/gMipBR7n+4u7Xb/UOZZzPMt55jb/mEj7g+0Qloq66cPwT1lHhx+8owi+lOncJ1bjIu2QUzThHvqg==} - engines: {node: '25'} - - '@nanoforge-dev/ecs-client@1.4.2': - resolution: {integrity: sha512-toeySsQfH0VMsA1UKUrhRWACYj7g7ikru8SqMf5e4LdacQAOkIenMRDyuyo52OVq1fJs1e47jM4XBkX6wGghQA==} - engines: {node: '25'} - - '@nanoforge-dev/ecs-lib@1.4.2': - resolution: {integrity: sha512-FM7lhHvBWvsaZs03biagHAu3P2Hlw1hoEye2b3xjj3EeVbRE8r8CNFcYtCoSbM2cVFKZBr3Z0N0UJBXLnizkgw==} - engines: {node: '25'} - - '@nanoforge-dev/editor@0.1.4': - resolution: {integrity: sha512-bqbrH8ulFSiZz1iisJHtHeEzj1RV/70uErCYHeW4DIhVPsWbBfWKFvg/ghAbmPk5vsj0YnhDX6DSpik4S1QoiQ==} - engines: {node: '25'} - - '@nanoforge-dev/graphics-2d@1.4.2': - resolution: {integrity: sha512-wH275hs9nl48HVI8GN5UjUIupylJ9Q9dJAxA8MCxKvgkEUcKwtC2gYXIjxaf5b2CoqG1O+qipnHzpnrAQCqrgA==} - engines: {node: '25'} - - '@nanoforge-dev/input@1.4.2': - resolution: {integrity: sha512-U38Eo1anJe9Fehzq4iQ/xIpDWnoWxXVLkAZ5CPf/k4iKLNm0scUg5LHZ8TswGEoaBtJmwFeiIGWU6OHfYYHcJw==} - engines: {node: '25'} - - '@nanoforge-dev/loader-client@1.5.0': - resolution: {integrity: sha512-FUcrfXlcaG4dsjya7fUUFkr5zwKB0nCihYeEOC1K54gl4XV6S1lgNnAfdkl4jZfzyyw4jcZUB+73t4ymBhz08g==} - engines: {node: '25'} - - '@nanoforge-dev/loader-server@1.5.0': - resolution: {integrity: sha512-1rly9IgunGz8Ux6lGDugUXgmNbnNjWGM8ABy7EsdrKWV74gyj7cuU6X69UolO28XUPCdbeISNcBEZV5hLK8Rlg==} - engines: {node: '25'} - - '@nanoforge-dev/loader-website@1.5.0': - resolution: {integrity: sha512-X37wlYyoL/q8ZPk5I8W3z01novfDSopizVQXbk/sw0dRXoONtIb6xnZLlN3z4jkDkPOy6IVes0bLGr8h4aFOcA==} - engines: {node: '25'} - - '@nanoforge-dev/schematics@2.2.1': - resolution: {integrity: sha512-MdmhFncakgejGRIf1HTPKTskhdv8bIst21uWRSZCXGgGv0UNYEfDiziOsWPVCzGc9dXei59RIDznBwgpAMeXLg==} - engines: {node: '25'} - - '@oven/bun-darwin-aarch64@1.4.2': - resolution: {integrity: sha512-MXdZkP1featqxZ+/VTXWG1BVjM4OGBehVY2Q88EeUj/7L0UMeCGItmyPYTN+wxvlGJ6F66JEtzsw+GvQWewnag==} - cpu: [arm64] - os: [darwin] - - '@oven/bun-darwin-x64@1.4.2': - resolution: {integrity: sha512-gZTxZuLjkUhAWjTETu3tw0WhsEdNkJ64daj60ybhPf835a2yollV3yTkK9JozvzKPx4TRFzLSl8C+U525pxVbw==} - cpu: [x64] - os: [darwin] - - '@oven/bun-freebsd-aarch64@1.4.2': - resolution: {integrity: sha512-SMNItMw1Z8QeeQVKnw8jA7xQNkeXdP+OPgin4Wi/QTx/B8RHHLnuZfqmFy7NtVeT2NF0kKYppW4WWd2CCYZjhQ==} - cpu: [arm64] - os: [freebsd] - - '@oven/bun-freebsd-x64@1.4.2': - resolution: {integrity: sha512-THbPKXhO54N0DpFRKZNDZpQ7dpbX0bWASuARckAUS9wRtFIHsiY+uULXJvxJGo2YD1YewvXQ4G8Fj7XT5oBCiw==} - cpu: [x64] - os: [freebsd] - - '@oven/bun-linux-aarch64-android@1.4.2': - resolution: {integrity: sha512-3mZKO2rhsNgbAUtAHC1UKUlF2zTxFraDZT/Elv8wzyH0fJL9h+Iv3TgB9lO63w89PRn3eFe+NRA1bhVgikKNPQ==} - cpu: [arm64] - os: [android] - - '@oven/bun-linux-aarch64-musl@1.4.2': - resolution: {integrity: sha512-+Sm6y+lSiSFBOtXmnekp5Q6n1tUKlyv71FCPWBc61Cgb14T5eBs8SN/nh4MUCOKzONkI3O+as3MGUgikS4aCBQ==} - cpu: [arm64] - os: [linux] - - '@oven/bun-linux-aarch64@1.4.2': - resolution: {integrity: sha512-3BBP9ovJ2RGHFH6Ae1CAtxNtG1+YY6GD6rmYbsUosoAk9+OEl6zeDQ/k4fBkc6dYOJCtWnx8hUxzNzQATSmvYQ==} - cpu: [arm64] - os: [linux] - - '@oven/bun-linux-x64-android@1.4.2': - resolution: {integrity: sha512-6HC5tzcC79113n2IHCTJMWv+HsQImv4ZFEK2XpYLxY6HbT8tM4cUM2Zv1bHZBQsS3jv/zYBamDJ1UX7If0d5tw==} - cpu: [x64] - os: [android] - - '@oven/bun-linux-x64-musl@1.4.2': - resolution: {integrity: sha512-vVTKUg1bnPhRP/Hp73jIVoFh2vPFNYEqYX0ERKfZBOQEEHitNAeukZzzuUDZS0SoDCIpuWUGSpd/CDMbjdR+Uw==} - cpu: [x64] - os: [linux] - - '@oven/bun-linux-x64@1.4.2': - resolution: {integrity: sha512-9/E/UXOTpSo3YsV5g+FhtTd/qTpiWoKuxS12cqtuYA1ssu9fRAoPQnipFgGyck3tWO63iUdxBiygq+kELFawng==} - cpu: [x64] - os: [linux] - - '@oven/bun-windows-aarch64@1.4.2': - resolution: {integrity: sha512-8EJ1ST7339WJE3poPW5nBgVW/lWf9HBz4W27ZUNhburKmcBLOByPyE6DP9fHD8FQGm5c+ilUN2hX1mrW0jxq9Q==} - cpu: [arm64] - os: [win32] - - '@oven/bun-windows-x64@1.4.2': - resolution: {integrity: sha512-+bN6OuVld/9diT/RLSXSW7JE6CvNE3gL9XsAEjULi1nUsXd6DNO6GuA9jNdNb3r8PdJFnYHr5aypNV1Oj3Rd9g==} - cpu: [x64] - os: [win32] - - '@pkgr/core@0.3.6': - resolution: {integrity: sha512-SEeaJLb3qBNF/OaXnaR1NmmBbFYk1zC0ZH/52fATcRPLFg/p791YrcyFFy44Bo9sLaGuSuLp5Q6axbb/O+v/RA==} - engines: {node: ^14.18.0 || >=16.0.0} - - '@sindresorhus/is@4.6.0': - resolution: {integrity: sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==} - engines: {node: '>=10'} - - '@types/estree@1.0.9': - resolution: {integrity: sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==} - - '@types/json-schema@7.0.15': - resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==} - - '@types/validator@13.15.10': - resolution: {integrity: sha512-T8L6i7wCuyoK8A/ZeLYt1+q0ty3Zb9+qbSSvrIVitzT3YjZqkTZ40IbRsPanlB4h1QB3JVL1SYCdR6ngtFYcuA==} - - '@typescript-eslint/eslint-plugin@8.70.0': - resolution: {integrity: sha512-/v8HZt6RlyIZxB3ntehELOcUcfxKPVGWXnQdJuHRmzrqgF8nQypcC/oxGW+Ot4VGKDq81XugPKxx0n5PBtf9PA==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - peerDependencies: - '@typescript-eslint/parser': ^8.70.0 - eslint: ^8.57.0 || ^9.0.0 || ^10.0.0 - typescript: '>=4.8.4 <6.1.0' - - '@typescript-eslint/parser@8.70.0': - resolution: {integrity: sha512-zYvrmj9Yxd63UGaXw+kdt6A0F0s0qveJyuatIM77bYC2DE4pgmg7a50u8LR7PRtXd0x+h+Tl3eXabGm06SWd3Q==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - peerDependencies: - eslint: ^8.57.0 || ^9.0.0 || ^10.0.0 - typescript: '>=4.8.4 <6.1.0' - - '@typescript-eslint/project-service@8.70.0': - resolution: {integrity: sha512-hFHbTNqhU9G+2eKFXCBVb1tjFT/LceiJ4+HfLO4pTpDI0KHi6iajpcFFkaSQ9gXmCh7n82A0PthaayEdN6mspQ==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - peerDependencies: - typescript: '>=4.8.4 <6.1.0' - - '@typescript-eslint/scope-manager@8.70.0': - resolution: {integrity: sha512-8nP3Kwh5hlgZ4FicGvmznAmJe8UL4sdU8tLukrPaMuQmDuk4Y8xYfzu/aYZW4xT2JCgc7H/TpDI5cGlxcWJSqQ==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - - '@typescript-eslint/tsconfig-utils@8.70.0': - resolution: {integrity: sha512-adnkeeNq9Sq1sUf4+FRVc0KdgYghzsgFpZSQVZVvY0LCuUuN0FnQgyGzCJeC4fW1cdXseBAjU2EOqUIjbNcZUw==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - peerDependencies: - typescript: '>=4.8.4 <6.1.0' - - '@typescript-eslint/type-utils@8.70.0': - resolution: {integrity: sha512-NUMKIhYVaVIVLnRL9CRt+VVcuLgSHUCpXn4/+K8wql+vdInUzvx8BjUO1oJ7cG9shjFJKtF8F8Hh2kCh3/KBVw==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - peerDependencies: - eslint: ^8.57.0 || ^9.0.0 || ^10.0.0 - typescript: '>=4.8.4 <6.1.0' - - '@typescript-eslint/types@8.70.0': - resolution: {integrity: sha512-asTOIYhDg4zdzOScCyaytrsV3cR6B4ecPQlXw/dJIm7J/MZTtCtfVII9JD8Geh4jTCrK/Xe6cg5UevoleMcoJQ==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - - '@typescript-eslint/typescript-estree@8.70.0': - resolution: {integrity: sha512-d9NmHMPEKQ7QCLLm1jI3zmoQBwT5KwFYjXBJ9ymZfKCUU+5rmTRykKAFvH5Qn/ZCds3CEAFS9OC9M/jkl0X2bA==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - peerDependencies: - typescript: '>=4.8.4 <6.1.0' - - '@typescript-eslint/utils@8.70.0': - resolution: {integrity: sha512-oZmtKJz/4fufZ2p3+Cn3ijEojcdfR+1zYDH2xKYrEly0dR/Q/1xUPRCOlKGxod78nWlU2UnDe09GZ3TaknBFGA==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - peerDependencies: - eslint: ^8.57.0 || ^9.0.0 || ^10.0.0 - typescript: '>=4.8.4 <6.1.0' - - '@typescript-eslint/visitor-keys@8.70.0': - resolution: {integrity: sha512-BoC8PiO4Hkdo0TVJh9Ntxr5MxPDI7/oFsrygN5ADelFSeXG/qgNuucIGA+L5Z6JpPTE/uRfcTWtscjbUaufepQ==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - - acorn-jsx@5.3.2: - resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} - peerDependencies: - acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 - - acorn@8.18.0: - resolution: {integrity: sha512-lGq+9yr1/GuAWaVYIHRjvvySG5/4VfKIvC8EWxStPdcDh/Ka7FG3twP6v4d5BkravUilhIAsG4Qj83t02LWUPQ==} - engines: {node: '>=0.4.0'} - hasBin: true - - ajv-formats@3.0.1: - resolution: {integrity: sha512-8iUql50EUR+uUcdRQ3HDqa6EVyo3docL8g5WJ3FNcWmu62IbkGUue/pEyLBW8VGKKucTPgqeks4fIU1DA4yowQ==} - peerDependencies: - ajv: ^8.0.0 - peerDependenciesMeta: - ajv: - optional: true - - ajv@6.15.0: - resolution: {integrity: sha512-fgFx7Hfoq60ytK2c7DhnF8jIvzYgOMxfugjLOSMHjLIPgenqa7S7oaagATUq99mV6IYvN2tRmC0wnTYX6iPbMw==} - - ajv@8.20.0: - resolution: {integrity: sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA==} - - ansi-regex@6.3.0: - resolution: {integrity: sha512-WpDfL7NO6j7tH88IDBNVdUJxDh9nmCteAVW9dsep846XdwF4naCBK+/tGLX3KJgcpgMRXCFlTM2hKGoK9FsdrQ==} - engines: {node: '>=12'} - - ansi-styles@4.3.0: - resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} - engines: {node: '>=8'} - - ansis@4.3.1: - resolution: {integrity: sha512-BJ8/l4R5LRE7hW9WdSuGYrLSHi2ynxeFpDFbH0K/CgNeY/tyhk+vO6TYxXC5r5CpUhNVX310xzPsN/H9lCdfOA==} - engines: {node: '>=14'} - - argparse@2.0.1: - resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} - - balanced-match@1.0.2: - resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} - - balanced-match@4.0.4: - resolution: {integrity: sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==} - engines: {node: 18 || 20 || >=22} - - brace-expansion@1.1.18: - resolution: {integrity: sha512-Edep/X9fGqVNmzKBVsDYIOtD+z1tuezV70LBjdCst9Tqu76lsnvRiZ6oTic1n+/BIwX6QDGAO94PN4N2SADvtw==} - - brace-expansion@5.0.9: - resolution: {integrity: sha512-ScQ4IuvIEF1TMlP7Zt+vjJ//9zlPb2SDcxWxM3bk8s6t6GGdJ7KO1dCcTidOPJKePW30LE/2cT7wCyPho9/Wxg==} - engines: {node: 20 || >=22} - - braces@3.0.3: - resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} - engines: {node: '>=8'} - - bun@1.4.2: - resolution: {integrity: sha512-TrSXo6HJfIEaczpb3kjX82I2pL47vK1QUNmHRCUdz9IzaOwa9lzOXSWwu2l18YHE3sNfGRapVLd4nNm+22vVVA==} - cpu: [arm64, x64] - os: [darwin, linux, android, freebsd, win32] - hasBin: true - - bundle-name@4.1.0: - resolution: {integrity: sha512-tjwM5exMg6BGRI+kNmTntNsvdZS1X8BFYS6tnJ2hdH0kVxM6/eVZ2xy+FqStSWvYmtfFMDLIxurorHwDKfDz5Q==} - engines: {node: '>=18'} - - callsites@3.1.0: - resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} - engines: {node: '>=6'} - - chalk@4.1.2: - resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} - engines: {node: '>=10'} - - chalk@5.6.2: - resolution: {integrity: sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA==} - engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} - - char-regex@1.0.2: - resolution: {integrity: sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==} - engines: {node: '>=10'} - - chardet@2.2.0: - resolution: {integrity: sha512-rddelWYNPRrXq6PtNEN2S3f6t9ILzvqaN5pVgi4kqt9jHQaXIial9PznB5iSPVlQSLNaaH22ItWz3EJtQ10+OA==} - - chokidar@5.0.0: - resolution: {integrity: sha512-TQMmc3w+5AxjpL8iIiwebF73dRDF4fBIieAqGn9RGCWaEVwQ6Fb2cGe31Yns0RRIzii5goJ1Y7xbMwo1TxMplw==} - engines: {node: '>= 20.19.0'} - - chownr@3.0.0: - resolution: {integrity: sha512-+IxzY9BZOQd/XuYPRmrvEVjF/nqj5kgT4kEq7VofrDoM1MxoRjEWkrCC3EtLi59TVawxTAn+orJwFQcrqEN1+g==} - engines: {node: '>=18'} - - class-transformer@0.5.1: - resolution: {integrity: sha512-SQa1Ws6hUbfC98vKGxZH3KFY0Y1lm5Zm0SY8XX9zbK7FJCyVEac3ATW0RIpwzW+oOfmHE5PMPufDG9hCfoEOMw==} - - class-validator@0.14.4: - resolution: {integrity: sha512-AwNusCCam51q703dW82x95tOqQp6oC9HNUl724KxJJOfnKscI8dOloXFgyez7LbTTKWuRBA37FScqVbJEoq8Yw==} - - class-validator@0.15.1: - resolution: {integrity: sha512-LqoS80HBBSCVhz/3KloUly0ovokxpdOLR++Al3J3+dHXWt9sTKlKd4eYtoxhxyUjoe5+UcIM+5k9MIxyBWnRTw==} - - cli-cursor@5.0.0: - resolution: {integrity: sha512-aCj4O5wKyszjMmDT4tZj93kxyydN/K5zPWSCe6/0AV/AA1pqe5ZBIw0a2ZfPQV7lL5/yb5HsUreJ6UFAF1tEQw==} - engines: {node: '>=18'} - - cli-spinners@3.4.0: - resolution: {integrity: sha512-bXfOC4QcT1tKXGorxL3wbJm6XJPDqEnij2gQ2m7ESQuE+/z9YFIWnl/5RpTiKWbMq3EVKR4fRLJGn6DVfu0mpw==} - engines: {node: '>=18.20'} - - cli-width@4.1.0: - resolution: {integrity: sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==} - engines: {node: '>= 12'} - - color-convert@2.0.1: - resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} - engines: {node: '>=7.0.0'} - - color-name@1.1.4: - resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} - - commander@15.0.0: - resolution: {integrity: sha512-z67u4ZhzCL/Tydu1lJARtEZYWbWaN7oYLHbsuzocr6y4N6WZAagG3RQ4FW61V1/0+jImpj293XfrcYnd1qxtPg==} - engines: {node: '>=22.12.0'} - - concat-map@0.0.1: - resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} - - cross-spawn@7.0.6: - resolution: {integrity: sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==} - engines: {node: '>= 8'} - - debug@4.4.3: - resolution: {integrity: sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==} - engines: {node: '>=6.0'} - peerDependencies: - supports-color: '*' - peerDependenciesMeta: - supports-color: - optional: true - - deep-is@0.1.4: - resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==} - - default-browser-id@5.0.1: - resolution: {integrity: sha512-x1VCxdX4t+8wVfd1so/9w+vQ4vx7lKd2Qp5tDRutErwmR85OgmfX7RlLRMWafRMY7hbEiXIbudNrjOAPa/hL8Q==} - engines: {node: '>=18'} - - default-browser@5.5.1: - resolution: {integrity: sha512-m1pAzaJgZ/gssEqlOhJkPJp8Xly7QyW6xcrkUa2KKcDeDSEMP7X8xipU3snUcfisTQx0w1AGae+9UtJSfVnXGw==} - engines: {node: '>=18'} - - define-lazy-prop@3.0.0: - resolution: {integrity: sha512-N+MeXYoqr3pOgn8xfyRPREN7gHakLYjhsHhWGT3fWAiL4IkAt0iDw14QiiEm2bE30c5XX5q0FtAA3CK5f9/BUg==} - engines: {node: '>=12'} - - defu@6.1.7: - resolution: {integrity: sha512-7z22QmUWiQ/2d0KkdYmANbRUVABpZ9SNYyH5vx6PZ+nE5bcC0l7uFvEfHlyld/HcGBFTL536ClDt3DEcSlEJAQ==} - - destr@2.0.5: - resolution: {integrity: sha512-ugFTXCtDZunbzasqBxrK93Ik/DRYsO6S/fedkWEMKqt04xZ4csmnmwGDBAb07QWNaGMAmnTIemsYZCksjATwsA==} - - dotenv@17.4.2: - resolution: {integrity: sha512-nI4U3TottKAcAD9LLud4Cb7b2QztQMUEfHbvhTH09bqXTxnSie8WnjPALV/WMCrJZ6UV/qHJ6L03OqO3LcdYZw==} - engines: {node: '>=12'} - - emojilib@2.4.0: - resolution: {integrity: sha512-5U0rVMU5Y2n2+ykNLQqMoqklN9ICBT/KsvC1Gz6vqHbz2AXXGkG+Pm5rMWk/8Vjrr/mY9985Hi8DYzn1F09Nyw==} - - escape-string-regexp@4.0.0: - resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==} - engines: {node: '>=10'} - - eslint-config-prettier@10.1.8: - resolution: {integrity: sha512-82GZUjRS0p/jganf6q1rEO25VSoHH0hKPCTrgillPjdI/3bgBhAE1QzHrHTizjpRvy6pGAvKjDJtk2pF9NDq8w==} - hasBin: true - peerDependencies: - eslint: '>=7.0.0' - - eslint-plugin-prettier@5.5.6: - resolution: {integrity: sha512-ifetmTcxWfz+4qRW3pH/ujdTq2jQIj59AxJMIN26K5avYgU8dxycUETQonWiW+wPrYXA0j3Try0l1CnwVQtDqQ==} - engines: {node: ^14.18.0 || >=16.0.0} - peerDependencies: - '@types/eslint': '>=8.0.0' - eslint: '>=8.0.0' - eslint-config-prettier: '>= 7.0.0 <10.0.0 || >=10.1.0' - prettier: '>=3.0.0' - peerDependenciesMeta: - '@types/eslint': - optional: true - eslint-config-prettier: - optional: true - - eslint-scope@8.4.0: - resolution: {integrity: sha512-sNXOfKCn74rt8RICKMvJS7XKV/Xk9kA7DyJr8mJik3S7Cwgy3qlkkmyS2uQB3jiJg6VNdZd/pDBJu0nvG2NlTg==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - - eslint-visitor-keys@3.4.3: - resolution: {integrity: sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - - eslint-visitor-keys@4.2.1: - resolution: {integrity: sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - - eslint-visitor-keys@5.0.1: - resolution: {integrity: sha512-tD40eHxA35h0PEIZNeIjkHoDR4YjjJp34biM0mDvplBe//mB+IHCqHDGV7pxF+7MklTvighcCPPZC7ynWyjdTA==} - engines: {node: ^20.19.0 || ^22.13.0 || >=24} - - eslint@9.39.5: - resolution: {integrity: sha512-DgZS62aPLXKlnxILS/AYCoRvHaZeXceIzlXPkkGGzJWSow1aEk0lbTlxUSlyjC8jcaKxAdOnTDz+o1JFSBsyjw==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - deprecated: This version is no longer supported. Please see https://eslint.org/version-support for other options. - hasBin: true - peerDependencies: - jiti: '*' - peerDependenciesMeta: - jiti: - optional: true - - espree@10.4.0: - resolution: {integrity: sha512-j6PAQ2uUr79PZhBjP5C5fhl8e39FmRnOjsD5lGnWrFU8i2G776tBK7+nP8KuQUTTyAZUwfQqXAgrVH5MbH9CYQ==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - - esquery@1.7.0: - resolution: {integrity: sha512-Ap6G0WQwcU/LHsvLwON1fAQX9Zp0A2Y6Y/cJBl9r/JbW90Zyg4/zbG6zzKa2OTALELarYHmKu0GhpM5EO+7T0g==} - engines: {node: '>=0.10'} - - esrecurse@4.3.0: - resolution: {integrity: sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==} - engines: {node: '>=4.0'} - - estraverse@5.3.0: - resolution: {integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==} - engines: {node: '>=4.0'} - - esutils@2.0.3: - resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} - engines: {node: '>=0.10.0'} - - fast-deep-equal@3.1.3: - resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} - - fast-diff@1.3.0: - resolution: {integrity: sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==} - - fast-json-stable-stringify@2.1.0: - resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==} - - fast-levenshtein@2.0.6: - resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==} - - fast-string-truncated-width@3.0.3: - resolution: {integrity: sha512-0jjjIEL6+0jag3l2XWWizO64/aZVtpiGE3t0Zgqxv0DPuxiMjvB3M24fCyhZUO4KomJQPj3LTSUnDP3GpdwC0g==} - - fast-string-width@3.0.2: - resolution: {integrity: sha512-gX8LrtNEI5hq8DVUfRQMbr5lpaS4nMIWV+7XEbXk2b8kiQIizgnlr12B4dA3ZEx3308ze0O4Q1R+cHts8kyUJg==} - - fast-uri@3.1.7: - resolution: {integrity: sha512-dOvZVzjdZdz7phd9v6jCbwxrBW3fK6n8Rc0CtdmM4bumzMnxywBYhuph6J819RRw/ku+rLbelwfMunktuzVVHg==} - - fast-wrap-ansi@0.2.2: - resolution: {integrity: sha512-7F2Fl+TjRSenLqlU3UjSH0iyqopqoZIu7eZVpEirP2g1GtWa2G/ecEmBdgz31+Mxr+ELclgg6sokpSFIQiZ02Q==} - - fdir@6.5.0: - resolution: {integrity: sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==} - engines: {node: '>=12.0.0'} - peerDependencies: - picomatch: ^3 || ^4 - peerDependenciesMeta: - picomatch: - optional: true - - file-entry-cache@8.0.0: - resolution: {integrity: sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==} - engines: {node: '>=16.0.0'} - - fill-range@7.1.1: - resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} - engines: {node: '>=8'} - - find-up@5.0.0: - resolution: {integrity: sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==} - engines: {node: '>=10'} - - flat-cache@4.0.1: - resolution: {integrity: sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==} - engines: {node: '>=16'} - - flatted@3.4.4: - resolution: {integrity: sha512-5+ybhBZANEJxaH3X5evAFatUxLfEHSr7n6kYJ+1Qd0mUqr4eu9gIf6GDbWHf8RJijHrjjO8G+la14SlL2SeS1Q==} - - get-east-asian-width@1.6.0: - resolution: {integrity: sha512-QRbvDIbx6YklUe6RxeTeleMR0yv3cYH6PsPZHcnVn7xv7zO1BHN8r0XETu8n6Ye3Q+ahtSarc3WgtNWmehIBfA==} - engines: {node: '>=18'} - - glob-parent@6.0.2: - resolution: {integrity: sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==} - engines: {node: '>=10.13.0'} - - globals@14.0.0: - resolution: {integrity: sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==} - engines: {node: '>=18'} - - globals@16.5.0: - resolution: {integrity: sha512-c/c15i26VrJ4IRt5Z89DnIzCGDn9EcebibhAOjw5ibqEHsE1wLUgkPn9RDmNcUKyU87GeaL633nyJ+pplFR2ZQ==} - engines: {node: '>=18'} - - has-flag@4.0.0: - resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} - engines: {node: '>=8'} - - iconv-lite@0.7.3: - resolution: {integrity: sha512-IKXpvIzjnC9XTAUbVBcMfGS0EPaIXtW6v+zr+RRp+hqULEpo0owZax6wyRwPOJbWbzjYspQwusTsfVr0ifh4uQ==} - engines: {node: '>=0.10.0'} - - ignore@5.3.2: - resolution: {integrity: sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==} - engines: {node: '>= 4'} - - ignore@7.0.9: - resolution: {integrity: sha512-brTTsvFRt5C1gGHtPst/281UjPD5t9fBqbgoMPlVWy11ZLTPfu7HxK4ZYqO9H7o/yC9rSTCI85EaQ4OoY12qYw==} - engines: {node: '>= 4'} - - import-fresh@3.3.1: - resolution: {integrity: sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==} - engines: {node: '>=6'} - - imurmurhash@0.1.4: - resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} - engines: {node: '>=0.8.19'} - - is-docker@3.0.0: - resolution: {integrity: sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - hasBin: true - - is-extglob@2.1.1: - resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} - engines: {node: '>=0.10.0'} - - is-glob@4.0.3: - resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} - engines: {node: '>=0.10.0'} - - is-in-ssh@1.0.0: - resolution: {integrity: sha512-jYa6Q9rH90kR1vKB6NM7qqd1mge3Fx4Dhw5TVlK1MUBqhEOuCagrEHMevNuCcbECmXZ0ThXkRm+Ymr51HwEPAw==} - engines: {node: '>=20'} - - is-inside-container@1.0.0: - resolution: {integrity: sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA==} - engines: {node: '>=14.16'} - hasBin: true - - is-interactive@2.0.0: - resolution: {integrity: sha512-qP1vozQRI+BMOPcjFzrjXuQvdak2pHNUMZoeG2eRbiSqyvbEf/wQtEOTOX1guk6E3t36RkaqiSt8A/6YElNxLQ==} - engines: {node: '>=12'} - - is-number@7.0.0: - resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} - engines: {node: '>=0.12.0'} - - is-unicode-supported@2.1.0: - resolution: {integrity: sha512-mE00Gnza5EEB3Ds0HfMyllZzbBrmLOX3vfWoj9A9PEnTfratQ/BcaJOuMhnkhjXvb2+FkY3VuHqtAGpTPmglFQ==} - engines: {node: '>=18'} - - is-wsl@3.1.1: - resolution: {integrity: sha512-e6rvdUCiQCAuumZslxRJWR/Doq4VpPR82kqclvcS0efgt430SlGIk05vdCN58+VrzgtIcfNODjozVielycD4Sw==} - engines: {node: '>=16'} - - isexe@2.0.0: - resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} - - js-yaml@4.3.2: - resolution: {integrity: sha512-SFNOvSJ+Dgf/9An904Yx+CgSlIPCkIpao4qo51lpee25TIRejdH3rhR4EZMGoNx3/TP3O+wzWuiTFl4sqbltzA==} - hasBin: true - - json-buffer@3.0.1: - resolution: {integrity: sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==} - - json-schema-traverse@0.4.1: - resolution: {integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==} - - json-schema-traverse@1.0.0: - resolution: {integrity: sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==} - - json-stable-stringify-without-jsonify@1.0.1: - resolution: {integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==} - - jsonc-parser@3.3.1: - resolution: {integrity: sha512-HUgH65KyejrUFPvHFPbqOY0rsFip3Bo5wb4ngvdi1EpCYWUQDC5V+Y7mZws+DLkr4M//zQJoanu1SP+87Dv1oQ==} - - keyv@4.5.4: - resolution: {integrity: sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==} - - konva@10.5.0: - resolution: {integrity: sha512-gTVQ12CVE2vCaP8g+Ag6lYf9LIo1s1lr7bXLNTbF5pcXbdRFCA3Oy1fFxDN/wK7RklJ9e8oqTiSsqmUtfQx91w==} - peerDependencies: - canvas: ^3.0.0 - skia-canvas: ^3.0.0 - peerDependenciesMeta: - canvas: - optional: true - skia-canvas: - optional: true - - levn@0.4.1: - resolution: {integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==} - engines: {node: '>= 0.8.0'} - - libphonenumber-js@1.13.12: - resolution: {integrity: sha512-uLVeV1c9OTk6qkdqnj+mpMD+ZdnZ0szVyWu58HwMmpwkHA1gCEkyjd3veZQXDnuw9KEwSRjcc9B1pS9XKIN1fA==} - - locate-path@6.0.0: - resolution: {integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==} - engines: {node: '>=10'} - - lodash.merge@4.6.2: - resolution: {integrity: sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==} - - log-symbols@7.0.1: - resolution: {integrity: sha512-ja1E3yCr9i/0hmBVaM0bfwDjnGy8I/s6PP4DFp+yP+a+mrHO4Rm7DtmnqROTUkHIkqffC84YY7AeqX6oFk0WFg==} - engines: {node: '>=18'} - - magic-string@1.0.0: - resolution: {integrity: sha512-CGvjzMN08iv6w1mm4/x3Gh1hLb4VnyRUA15FFpl6CsCIGGoe36k7kY5KNz9QDbSBN5I/fWHM6ZlIkUTa5xdUEA==} - - micromatch@4.0.8: - resolution: {integrity: sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==} - engines: {node: '>=8.6'} - - mimic-function@5.0.1: - resolution: {integrity: sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==} - engines: {node: '>=18'} - - minimatch@10.2.6: - resolution: {integrity: sha512-vpLQEs+VLCr1nU0BXS07maYoFwlDAH0gngQuuttxIwutDFEMHq2blX+8vpgxDdK3J1PwjCJiep77OitTZ4Ll1A==} - engines: {node: 18 || 20 || >=22} - - minimatch@3.1.5: - resolution: {integrity: sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==} - - minipass@7.1.3: - resolution: {integrity: sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A==} - engines: {node: '>=16 || 14 >=14.17'} - - minizlib@3.1.0: - resolution: {integrity: sha512-KZxYo1BUkWD2TVFLr0MQoM8vUUigWD3LlD83a/75BqC+4qE0Hb1Vo5v1FgcfaNXvfXzr+5EhQ6ing/CaBijTlw==} - engines: {node: '>= 18'} - - ms@2.1.3: - resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} - - mute-stream@3.0.0: - resolution: {integrity: sha512-dkEJPVvun4FryqBmZ5KhDo0K9iDXAwn08tMLDinNdRBNPcYEDiWYysLcc6k3mjTMlbP9KyylvRpd4wFtwrT9rw==} - engines: {node: ^20.17.0 || >=22.9.0} - - natural-compare@1.4.0: - resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} - - node-emoji@2.2.0: - resolution: {integrity: sha512-Z3lTE9pLaJF47NyMhd4ww1yFTAP8YhYI8SleJiHzM46Fgpm5cnNzSl9XfzFNqbaz+VlJrIj3fXQ4DeN1Rjm6cw==} - engines: {node: '>=18'} - - onetime@7.0.0: - resolution: {integrity: sha512-VXJjc87FScF88uafS3JllDgvAm+c/Slfz06lorj2uAY34rlUu0Nt+v8wreiImcrgAjjIHp1rXpTDlLOGw29WwQ==} - engines: {node: '>=18'} - - open@11.0.2: - resolution: {integrity: sha512-RWqF+pBSkqecEvCKOn8QYhaNdRMJDZRIrlS/7rTDdLHaPcfXGCZ/h8zb413NfvdeAV0MR7T1yJcA34/q+CSm1Q==} - engines: {node: '>=20'} - - optionator@0.9.4: - resolution: {integrity: sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==} - engines: {node: '>= 0.8.0'} - - ora@9.4.1: - resolution: {integrity: sha512-6VlU9MLXbjVQD04AZCMX28hVtA5bUoadvUqO76MUCVA0ilwJbMiHsITRPfyVm6p/BC0Av/BXMujx39WCe1LEqw==} - engines: {node: '>=20'} - - p-limit@3.1.0: - resolution: {integrity: sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==} - engines: {node: '>=10'} - - p-locate@5.0.0: - resolution: {integrity: sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==} - engines: {node: '>=10'} - - parent-module@1.0.1: - resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==} - engines: {node: '>=6'} - - path-exists@4.0.0: - resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} - engines: {node: '>=8'} - - path-key@3.1.1: - resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} - engines: {node: '>=8'} - - picomatch@2.3.2: - resolution: {integrity: sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==} - engines: {node: '>=8.6'} - - picomatch@4.0.5: - resolution: {integrity: sha512-RvwwcruNjI1ncT5xRakeyS9Lf8lcItv34KD+aif+VH9kduAyfYBipGh12274xtenIPZ119/R9BdTBa8gAwSh0A==} - engines: {node: '>=12'} - - picomatch@4.0.7: - resolution: {integrity: sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA==} - engines: {node: '>=12'} - - powershell-utils@0.1.0: - resolution: {integrity: sha512-dM0jVuXJPsDN6DvRpea484tCUaMiXWjuCn++HGTqUWzGDjv5tZkEZldAJ/UMlqRYGFrD/etByo4/xOuC/snX2A==} - engines: {node: '>=20'} - - powershell-utils@0.2.1: - resolution: {integrity: sha512-C+y9x90UElAddDZmV4qOx9W53B61PO7cIqWz2dQsWlwswuq4mr8NEwytdGKboYbQlGZ3awrkTeNvcZiZNHnQ8A==} - engines: {node: '>=20'} - - prelude-ls@1.2.1: - resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} - engines: {node: '>= 0.8.0'} - - prettier-linter-helpers@1.0.1: - resolution: {integrity: sha512-SxToR7P8Y2lWmv/kTzVLC1t/GDI2WGjMwNhLLE9qtH8Q13C+aEmuRlzDst4Up4s0Wc8sF2M+J57iB3cMLqftfg==} - engines: {node: '>=6.0.0'} - - prettier@3.9.6: - resolution: {integrity: sha512-OpN0zzVdiaiAhxpuuj5efpIS4sY9j7bY6uR5mnj5yPzGkdkjNKSJeUThPb60Jw29QuAZgA4o+/iB49kFiaBX6g==} - engines: {node: '>=14'} - hasBin: true - - punycode@2.3.1: - resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} - engines: {node: '>=6'} - - rc9@3.1.0: - resolution: {integrity: sha512-ufjkNVzbRHKcCOmTahZkmVsyc3W+MSk3jY03m+a7tGHkIsdVMG9l10/3HvFbWkkKzY5VFp3pkRsIo/UYgmFL7Q==} - - readdirp@5.1.1: - resolution: {integrity: sha512-Kko+Y5XQ6fM+Ce3dq3m9YGxnacYZYl9cA1wZjaF3Vbry2L3i1qVg8+CAgNPsXRArPMUMCaOR7oa9Nqntc43JKA==} - engines: {node: '>= 20.19.0'} - - reflect-metadata@0.2.2: - resolution: {integrity: sha512-urBwgfrvVP/eAyXx4hluJivBKzuEbSQs9rKWCrCkbSxNv8mxPcUZKeuoF3Uy4mJl3Lwprp6yy5/39VWigZ4K6Q==} - - require-from-string@2.0.2: - resolution: {integrity: sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==} - engines: {node: '>=0.10.0'} - - resolve-from@4.0.0: - resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==} - engines: {node: '>=4'} - - restore-cursor@5.1.0: - resolution: {integrity: sha512-oMA2dcrw6u0YfxJQXm342bFKX/E4sG9rbTzO9ptUcR/e8A33cHuvStiYOwH7fszkZlZ1z/ta9AAoPk2F4qIOHA==} - engines: {node: '>=18'} - - run-applescript@7.1.0: - resolution: {integrity: sha512-DPe5pVFaAsinSaV6QjQ6gdiedWDcRCbUuiQfQa2wmWV7+xC9bGulGI8+TdRmoFkAPaBXk8CrAbnlY2ISniJ47Q==} - engines: {node: '>=18'} - - rxjs@7.8.2: - resolution: {integrity: sha512-dhKf903U/PQZY6boNNtAGdWbG85WAbjT/1xYoZIC7FAY0yWapOBQVsVrDl58W86//e1VpMNBtRV4MaXfdMySFA==} - - safer-buffer@2.1.2: - resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} - - semver@7.8.5: - resolution: {integrity: sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==} - engines: {node: '>=10'} - hasBin: true - - shebang-command@2.0.0: - resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} - engines: {node: '>=8'} - - shebang-regex@3.0.0: - resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} - engines: {node: '>=8'} - - signal-exit@4.1.0: - resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} - engines: {node: '>=14'} - - skin-tone@2.0.0: - resolution: {integrity: sha512-kUMbT1oBJCpgrnKoSr0o6wPtvRWT9W9UKvGLwfJYO2WuahZRHOpEyL1ckyMGgMWh0UdpmaoFqKKD29WTomNEGA==} - engines: {node: '>=8'} - - source-map@0.7.6: - resolution: {integrity: sha512-i5uvt8C3ikiWeNZSVZNWcfZPItFQOsYTUAOkcUPGd8DqDy1uOUikjt5dG+uRlwyvR108Fb9DOd4GvXfT0N2/uQ==} - engines: {node: '>= 12'} - - stdin-discarder@0.3.2: - resolution: {integrity: sha512-eCPu1qRxPVkl5605OTWF8Wz40b4Mf45NY5LQmVPQ599knfs5QhASUm9GbJ5BDMDOXgrnh0wyEdvzmL//YMlw0A==} - engines: {node: '>=18'} - - string-width@8.2.2: - resolution: {integrity: sha512-GaPUh5gfdrYzqeVNZvUfT23vYYxXzKYidUcnMtJg/3rxRV63EFZy3k6xfKlmfeJD0176lnUV/Usr3XcwSvFzpg==} - engines: {node: '>=20'} - - strip-ansi@7.2.0: - resolution: {integrity: sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==} - engines: {node: '>=12'} - - strip-json-comments@3.1.1: - resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} - engines: {node: '>=8'} - - supports-color@7.2.0: - resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} - engines: {node: '>=8'} - - synckit@0.11.13: - resolution: {integrity: sha512-eNRKgb3z66Yp3D2CixVujOUvXLFUTij/zVnV8KRyvFdQwpz7I5DS8UfRkTeLzb64u+dkzDSdelE24izu+zSSUg==} - engines: {node: ^14.18.0 || >=16.0.0} - - tar@7.5.22: - resolution: {integrity: sha512-MFO/QzvtAOmJbkhOaCTvbGcFN9L9b+JunIsDwaKljSOdcLMea3NJ1k9Usz/rjdfSXTq4dfzfeS7W4p4YOAAHeA==} - engines: {node: '>=18'} - - tinyglobby@0.2.17: - resolution: {integrity: sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==} - engines: {node: '>=12.0.0'} - - to-regex-range@5.0.1: - resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} - engines: {node: '>=8.0'} - - ts-api-utils@2.5.0: - resolution: {integrity: sha512-OJ/ibxhPlqrMM0UiNHJ/0CKQkoKF243/AEmplt3qpRgkW8VG7IfOS41h7V8TjITqdByHzrjcS/2si+y4lIh8NA==} - engines: {node: '>=18.12'} - peerDependencies: - typescript: '>=4.8.4' - - tslib@2.8.1: - resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==} - - type-check@0.4.0: - resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==} - engines: {node: '>= 0.8.0'} - - typescript-eslint@8.70.0: - resolution: {integrity: sha512-P/W5cz70/cQAuKfY3xwQMWWTV7BvJ0mAQmi+9mBcsVPaBUpd6Ohpa+fECv9rBFrQcig86jAiNBFNWUqnTjr4pw==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - peerDependencies: - eslint: ^8.57.0 || ^9.0.0 || ^10.0.0 - typescript: '>=4.8.4 <6.1.0' - - typescript@5.9.3: - resolution: {integrity: sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==} - engines: {node: '>=14.17'} - hasBin: true - - typescript@6.0.3: - resolution: {integrity: sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw==} - engines: {node: '>=14.17'} - hasBin: true - - unicode-emoji-modifier-base@1.0.0: - resolution: {integrity: sha512-yLSH4py7oFH3oG/9K+XWrz1pSi3dfUrWEnInbxMfArOfc1+33BlGPQtLsOYwvdMy11AwUBetYuaRxSPqgkq+8g==} - engines: {node: '>=4'} - - uri-js@4.4.1: - resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} - - validator@13.15.35: - resolution: {integrity: sha512-TQ5pAGhd5whStmqWvYF4OjQROlmv9SMFVt37qoCBdqRffuuklWYQlCNnEs2ZaIBD1kZRNnikiZOS1eqgkar0iw==} - engines: {node: '>= 0.10'} - - which@2.0.2: - resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} - engines: {node: '>= 8'} - hasBin: true - - word-wrap@1.2.5: - resolution: {integrity: sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==} - engines: {node: '>=0.10.0'} - - wsl-utils@1.0.0: - resolution: {integrity: sha512-Hl0ZOAs672vg+06kfujwRhoS6/jehvULrlFkuF2dRu6pHgA8U06h3xqNIqNNU1LTXPcedxByAR4GS6pwQK0mgA==} - engines: {node: '>=20'} - - yallist@5.0.0: - resolution: {integrity: sha512-YgvUTfwqyc7UXVMrB+SImsVYSmTS8X/tSrtdNZMImM+n7+QTriRXyXim0mBrTXNeqzVF0KWGgHPeiyViFFrNDw==} - engines: {node: '>=18'} - - yocto-queue@0.1.0: - resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} - engines: {node: '>=10'} - - yoctocolors@2.2.0: - resolution: {integrity: sha512-xYqdZFUK/VYazNl/oCDYN+3WloWQwMfZxBoiNt6qNyk+xfOdi598muWE42rNZFp1kNOiqW936q5RhUdnpqElSg==} - engines: {node: '>=18'} - -snapshots: - - '@angular-devkit/core@22.1.7(chokidar@5.0.0)': - dependencies: - ajv: 8.20.0 - ajv-formats: 3.0.1(ajv@8.20.0) - jsonc-parser: 3.3.1 - picomatch: 4.0.5 - rxjs: 7.8.2 - source-map: 0.7.6 - optionalDependencies: - chokidar: 5.0.0 - - '@angular-devkit/schematics-cli@22.1.7(chokidar@5.0.0)': - dependencies: - '@angular-devkit/core': 22.1.7(chokidar@5.0.0) - '@angular-devkit/schematics': 22.1.7(chokidar@5.0.0) - '@inquirer/prompts': 8.5.2 - transitivePeerDependencies: - - '@types/node' - - chokidar - - '@angular-devkit/schematics@22.1.7(chokidar@5.0.0)': - dependencies: - '@angular-devkit/core': 22.1.7(chokidar@5.0.0) - jsonc-parser: 3.3.1 - magic-string: 1.0.0 - ora: 9.4.1 - rxjs: 7.8.2 - transitivePeerDependencies: - - chokidar - - '@eslint-community/eslint-utils@4.10.1(eslint@9.39.5)': - dependencies: - eslint: 9.39.5 - eslint-visitor-keys: 3.4.3 - - '@eslint-community/regexpp@4.12.2': {} - - '@eslint/config-array@0.21.2': - dependencies: - '@eslint/object-schema': 2.1.7 - debug: 4.4.3 - minimatch: 3.1.5 - transitivePeerDependencies: - - supports-color - - '@eslint/config-helpers@0.4.2': - dependencies: - '@eslint/core': 0.17.0 - - '@eslint/core@0.17.0': - dependencies: - '@types/json-schema': 7.0.15 - - '@eslint/eslintrc@3.3.7': - dependencies: - ajv: 6.15.0 - debug: 4.4.3 - espree: 10.4.0 - globals: 14.0.0 - ignore: 5.3.2 - import-fresh: 3.3.1 - js-yaml: 4.3.2 - minimatch: 3.1.5 - strip-json-comments: 3.1.1 - transitivePeerDependencies: - - supports-color - - '@eslint/js@9.39.5': {} - - '@eslint/object-schema@2.1.7': {} - - '@eslint/plugin-kit@0.4.1': - dependencies: - '@eslint/core': 0.17.0 - levn: 0.4.1 - - '@humanfs/core@0.19.2': - dependencies: - '@humanfs/types': 0.15.0 - - '@humanfs/node@0.16.8': - dependencies: - '@humanfs/core': 0.19.2 - '@humanfs/types': 0.15.0 - '@humanwhocodes/retry': 0.4.3 - - '@humanfs/types@0.15.0': {} - - '@humanwhocodes/module-importer@1.0.1': {} - - '@humanwhocodes/retry@0.4.3': {} - - '@inquirer/ansi@2.0.8': {} - - '@inquirer/checkbox@5.2.5': - dependencies: - '@inquirer/ansi': 2.0.8 - '@inquirer/core': 12.0.3 - '@inquirer/figures': 2.0.9 - '@inquirer/type': 4.1.1 - - '@inquirer/confirm@6.3.2': - dependencies: - '@inquirer/core': 12.0.3 - '@inquirer/type': 4.1.1 - - '@inquirer/core@12.0.3': - dependencies: - '@inquirer/ansi': 2.0.8 - '@inquirer/figures': 2.0.9 - '@inquirer/type': 4.1.1 - cli-width: 4.1.0 - fast-wrap-ansi: 0.2.2 - mute-stream: 3.0.0 - signal-exit: 4.1.0 - - '@inquirer/editor@5.3.3': - dependencies: - '@inquirer/core': 12.0.3 - '@inquirer/external-editor': 3.0.5 - '@inquirer/type': 4.1.1 - - '@inquirer/expand@5.1.5': - dependencies: - '@inquirer/core': 12.0.3 - '@inquirer/type': 4.1.1 - - '@inquirer/external-editor@3.0.5': - dependencies: - chardet: 2.2.0 - iconv-lite: 0.7.3 - - '@inquirer/figures@2.0.9': {} - - '@inquirer/input@5.1.6': - dependencies: - '@inquirer/core': 12.0.3 - '@inquirer/type': 4.1.1 - - '@inquirer/number@4.2.3': - dependencies: - '@inquirer/core': 12.0.3 - '@inquirer/type': 4.1.1 - - '@inquirer/password@5.2.2': - dependencies: - '@inquirer/ansi': 2.0.8 - '@inquirer/core': 12.0.3 - '@inquirer/type': 4.1.1 - - '@inquirer/prompts@8.5.2': - dependencies: - '@inquirer/checkbox': 5.2.5 - '@inquirer/confirm': 6.3.2 - '@inquirer/editor': 5.3.3 - '@inquirer/expand': 5.1.5 - '@inquirer/input': 5.1.6 - '@inquirer/number': 4.2.3 - '@inquirer/password': 5.2.2 - '@inquirer/rawlist': 5.3.5 - '@inquirer/search': 4.3.3 - '@inquirer/select': 5.2.5 - - '@inquirer/prompts@8.7.2': - dependencies: - '@inquirer/checkbox': 5.2.5 - '@inquirer/confirm': 6.3.2 - '@inquirer/editor': 5.3.3 - '@inquirer/expand': 5.1.5 - '@inquirer/input': 5.1.6 - '@inquirer/number': 4.2.3 - '@inquirer/password': 5.2.2 - '@inquirer/rawlist': 5.3.5 - '@inquirer/search': 4.3.3 - '@inquirer/select': 5.2.5 - - '@inquirer/rawlist@5.3.5': - dependencies: - '@inquirer/core': 12.0.3 - '@inquirer/type': 4.1.1 - - '@inquirer/search@4.3.3': - dependencies: - '@inquirer/core': 12.0.3 - '@inquirer/figures': 2.0.9 - '@inquirer/type': 4.1.1 - - '@inquirer/select@5.2.5': - dependencies: - '@inquirer/ansi': 2.0.8 - '@inquirer/core': 12.0.3 - '@inquirer/figures': 2.0.9 - '@inquirer/type': 4.1.1 - - '@inquirer/type@4.1.1': {} - - '@isaacs/fs-minipass@4.0.1': - dependencies: - minipass: 7.1.3 - optional: true - - '@jridgewell/sourcemap-codec@1.6.0': {} - - '@nanoforge-dev/asset-manager@1.4.2': - dependencies: - '@nanoforge-dev/common': 1.4.2 - - '@nanoforge-dev/cli@1.6.2': - dependencies: - '@angular-devkit/schematics': 22.1.7(chokidar@5.0.0) - '@angular-devkit/schematics-cli': 22.1.7(chokidar@5.0.0) - '@inquirer/prompts': 8.7.2 - '@nanoforge-dev/loader-client': 1.5.0 - '@nanoforge-dev/loader-server': 1.5.0 - '@nanoforge-dev/schematics': 2.2.1(chokidar@5.0.0) - ansis: 4.3.1 - bun: 1.4.2 - chokidar: 5.0.0 - class-transformer: 0.5.1 - class-validator: 0.15.1 - commander: 15.0.0 - dotenv: 17.4.2 - node-emoji: 2.2.0 - open: 11.0.2 - ora: 9.4.1 - rc9: 3.1.0 - reflect-metadata: 0.2.2 - optionalDependencies: - '@nanoforge-dev/editor': 0.1.4 - transitivePeerDependencies: - - '@types/node' - - '@nanoforge-dev/common@1.4.2': {} - - '@nanoforge-dev/config@1.4.2': - dependencies: - class-transformer: 0.5.1 - class-validator: 0.14.4 - - '@nanoforge-dev/core@1.4.2': - dependencies: - '@nanoforge-dev/asset-manager': 1.4.2 - '@nanoforge-dev/common': 1.4.2 - '@nanoforge-dev/input': 1.4.2 - class-transformer: 0.5.1 - class-validator: 0.14.4 - - '@nanoforge-dev/ecs-client@1.4.2': - dependencies: - '@nanoforge-dev/common': 1.4.2 - '@nanoforge-dev/ecs-lib': 1.4.2 - - '@nanoforge-dev/ecs-lib@1.4.2': - dependencies: - '@nanoforge-dev/common': 1.4.2 - - '@nanoforge-dev/editor@0.1.4': - dependencies: - bun: 1.4.2 - class-transformer: 0.5.1 - class-validator: 0.15.1 - dotenv: 17.4.2 - micromatch: 4.0.8 - tar: 7.5.22 - typescript: 6.0.3 - optional: true - - '@nanoforge-dev/graphics-2d@1.4.2': - dependencies: - '@nanoforge-dev/common': 1.4.2 - konva: 10.5.0 - transitivePeerDependencies: - - canvas - - skia-canvas - - '@nanoforge-dev/input@1.4.2': - dependencies: - '@nanoforge-dev/common': 1.4.2 - - '@nanoforge-dev/loader-client@1.5.0': - dependencies: - '@nanoforge-dev/loader-website': 1.5.0 - bun: 1.4.2 - commander: 15.0.0 - - '@nanoforge-dev/loader-server@1.5.0': - dependencies: - commander: 15.0.0 - - '@nanoforge-dev/loader-website@1.5.0': {} - - '@nanoforge-dev/schematics@2.2.1(chokidar@5.0.0)': - dependencies: - '@angular-devkit/core': 22.1.7(chokidar@5.0.0) - '@angular-devkit/schematics': 22.1.7(chokidar@5.0.0) - rxjs: 7.8.2 - transitivePeerDependencies: - - chokidar - - '@oven/bun-darwin-aarch64@1.4.2': - optional: true - - '@oven/bun-darwin-x64@1.4.2': - optional: true - - '@oven/bun-freebsd-aarch64@1.4.2': - optional: true - - '@oven/bun-freebsd-x64@1.4.2': - optional: true - - '@oven/bun-linux-aarch64-android@1.4.2': - optional: true - - '@oven/bun-linux-aarch64-musl@1.4.2': - optional: true - - '@oven/bun-linux-aarch64@1.4.2': - optional: true - - '@oven/bun-linux-x64-android@1.4.2': - optional: true - - '@oven/bun-linux-x64-musl@1.4.2': - optional: true - - '@oven/bun-linux-x64@1.4.2': - optional: true - - '@oven/bun-windows-aarch64@1.4.2': - optional: true - - '@oven/bun-windows-x64@1.4.2': - optional: true - - '@pkgr/core@0.3.6': {} - - '@sindresorhus/is@4.6.0': {} - - '@types/estree@1.0.9': {} - - '@types/json-schema@7.0.15': {} - - '@types/validator@13.15.10': {} - - '@typescript-eslint/eslint-plugin@8.70.0(@typescript-eslint/parser@8.70.0(eslint@9.39.5)(typescript@5.9.3))(eslint@9.39.5)(typescript@5.9.3)': - dependencies: - '@eslint-community/regexpp': 4.12.2 - '@typescript-eslint/parser': 8.70.0(eslint@9.39.5)(typescript@5.9.3) - '@typescript-eslint/scope-manager': 8.70.0 - '@typescript-eslint/type-utils': 8.70.0(eslint@9.39.5)(typescript@5.9.3) - '@typescript-eslint/utils': 8.70.0(eslint@9.39.5)(typescript@5.9.3) - '@typescript-eslint/visitor-keys': 8.70.0 - eslint: 9.39.5 - ignore: 7.0.9 - natural-compare: 1.4.0 - ts-api-utils: 2.5.0(typescript@5.9.3) - typescript: 5.9.3 - transitivePeerDependencies: - - supports-color - - '@typescript-eslint/parser@8.70.0(eslint@9.39.5)(typescript@5.9.3)': - dependencies: - '@typescript-eslint/scope-manager': 8.70.0 - '@typescript-eslint/types': 8.70.0 - '@typescript-eslint/typescript-estree': 8.70.0(typescript@5.9.3) - '@typescript-eslint/visitor-keys': 8.70.0 - debug: 4.4.3 - eslint: 9.39.5 - typescript: 5.9.3 - transitivePeerDependencies: - - supports-color - - '@typescript-eslint/project-service@8.70.0(typescript@5.9.3)': - dependencies: - '@typescript-eslint/tsconfig-utils': 8.70.0(typescript@5.9.3) - '@typescript-eslint/types': 8.70.0 - debug: 4.4.3 - typescript: 5.9.3 - transitivePeerDependencies: - - supports-color - - '@typescript-eslint/scope-manager@8.70.0': - dependencies: - '@typescript-eslint/types': 8.70.0 - '@typescript-eslint/visitor-keys': 8.70.0 - - '@typescript-eslint/tsconfig-utils@8.70.0(typescript@5.9.3)': - dependencies: - typescript: 5.9.3 - - '@typescript-eslint/type-utils@8.70.0(eslint@9.39.5)(typescript@5.9.3)': - dependencies: - '@typescript-eslint/types': 8.70.0 - '@typescript-eslint/typescript-estree': 8.70.0(typescript@5.9.3) - '@typescript-eslint/utils': 8.70.0(eslint@9.39.5)(typescript@5.9.3) - debug: 4.4.3 - eslint: 9.39.5 - ts-api-utils: 2.5.0(typescript@5.9.3) - typescript: 5.9.3 - transitivePeerDependencies: - - supports-color - - '@typescript-eslint/types@8.70.0': {} - - '@typescript-eslint/typescript-estree@8.70.0(typescript@5.9.3)': - dependencies: - '@typescript-eslint/project-service': 8.70.0(typescript@5.9.3) - '@typescript-eslint/tsconfig-utils': 8.70.0(typescript@5.9.3) - '@typescript-eslint/types': 8.70.0 - '@typescript-eslint/visitor-keys': 8.70.0 - debug: 4.4.3 - minimatch: 10.2.6 - semver: 7.8.5 - tinyglobby: 0.2.17 - ts-api-utils: 2.5.0(typescript@5.9.3) - typescript: 5.9.3 - transitivePeerDependencies: - - supports-color - - '@typescript-eslint/utils@8.70.0(eslint@9.39.5)(typescript@5.9.3)': - dependencies: - '@eslint-community/eslint-utils': 4.10.1(eslint@9.39.5) - '@typescript-eslint/scope-manager': 8.70.0 - '@typescript-eslint/types': 8.70.0 - '@typescript-eslint/typescript-estree': 8.70.0(typescript@5.9.3) - eslint: 9.39.5 - typescript: 5.9.3 - transitivePeerDependencies: - - supports-color - - '@typescript-eslint/visitor-keys@8.70.0': - dependencies: - '@typescript-eslint/types': 8.70.0 - eslint-visitor-keys: 5.0.1 - - acorn-jsx@5.3.2(acorn@8.18.0): - dependencies: - acorn: 8.18.0 - - acorn@8.18.0: {} - - ajv-formats@3.0.1(ajv@8.20.0): - optionalDependencies: - ajv: 8.20.0 - - ajv@6.15.0: - dependencies: - fast-deep-equal: 3.1.3 - fast-json-stable-stringify: 2.1.0 - json-schema-traverse: 0.4.1 - uri-js: 4.4.1 - - ajv@8.20.0: - dependencies: - fast-deep-equal: 3.1.3 - fast-uri: 3.1.7 - json-schema-traverse: 1.0.0 - require-from-string: 2.0.2 - - ansi-regex@6.3.0: {} - - ansi-styles@4.3.0: - dependencies: - color-convert: 2.0.1 - - ansis@4.3.1: {} - - argparse@2.0.1: {} - - balanced-match@1.0.2: {} - - balanced-match@4.0.4: {} - - brace-expansion@1.1.18: - dependencies: - balanced-match: 1.0.2 - concat-map: 0.0.1 - - brace-expansion@5.0.9: - dependencies: - balanced-match: 4.0.4 - - braces@3.0.3: - dependencies: - fill-range: 7.1.1 - optional: true - - bun@1.4.2: - optionalDependencies: - '@oven/bun-darwin-aarch64': 1.4.2 - '@oven/bun-darwin-x64': 1.4.2 - '@oven/bun-freebsd-aarch64': 1.4.2 - '@oven/bun-freebsd-x64': 1.4.2 - '@oven/bun-linux-aarch64': 1.4.2 - '@oven/bun-linux-aarch64-android': 1.4.2 - '@oven/bun-linux-aarch64-musl': 1.4.2 - '@oven/bun-linux-x64': 1.4.2 - '@oven/bun-linux-x64-android': 1.4.2 - '@oven/bun-linux-x64-musl': 1.4.2 - '@oven/bun-windows-aarch64': 1.4.2 - '@oven/bun-windows-x64': 1.4.2 - - bundle-name@4.1.0: - dependencies: - run-applescript: 7.1.0 - - callsites@3.1.0: {} - - chalk@4.1.2: - dependencies: - ansi-styles: 4.3.0 - supports-color: 7.2.0 - - chalk@5.6.2: {} - - char-regex@1.0.2: {} - - chardet@2.2.0: {} - - chokidar@5.0.0: - dependencies: - readdirp: 5.1.1 - - chownr@3.0.0: - optional: true - - class-transformer@0.5.1: {} - - class-validator@0.14.4: - dependencies: - '@types/validator': 13.15.10 - libphonenumber-js: 1.13.12 - validator: 13.15.35 - - class-validator@0.15.1: - dependencies: - '@types/validator': 13.15.10 - libphonenumber-js: 1.13.12 - validator: 13.15.35 - - cli-cursor@5.0.0: - dependencies: - restore-cursor: 5.1.0 - - cli-spinners@3.4.0: {} - - cli-width@4.1.0: {} - - color-convert@2.0.1: - dependencies: - color-name: 1.1.4 - - color-name@1.1.4: {} - - commander@15.0.0: {} - - concat-map@0.0.1: {} - - cross-spawn@7.0.6: - dependencies: - path-key: 3.1.1 - shebang-command: 2.0.0 - which: 2.0.2 - - debug@4.4.3: - dependencies: - ms: 2.1.3 - - deep-is@0.1.4: {} - - default-browser-id@5.0.1: {} - - default-browser@5.5.1: - dependencies: - bundle-name: 4.1.0 - default-browser-id: 5.0.1 - - define-lazy-prop@3.0.0: {} - - defu@6.1.7: {} - - destr@2.0.5: {} - - dotenv@17.4.2: {} - - emojilib@2.4.0: {} - - escape-string-regexp@4.0.0: {} - - eslint-config-prettier@10.1.8(eslint@9.39.5): - dependencies: - eslint: 9.39.5 - - eslint-plugin-prettier@5.5.6(eslint-config-prettier@10.1.8(eslint@9.39.5))(eslint@9.39.5)(prettier@3.9.6): - dependencies: - eslint: 9.39.5 - prettier: 3.9.6 - prettier-linter-helpers: 1.0.1 - synckit: 0.11.13 - optionalDependencies: - eslint-config-prettier: 10.1.8(eslint@9.39.5) - - eslint-scope@8.4.0: - dependencies: - esrecurse: 4.3.0 - estraverse: 5.3.0 - - eslint-visitor-keys@3.4.3: {} - - eslint-visitor-keys@4.2.1: {} - - eslint-visitor-keys@5.0.1: {} - - eslint@9.39.5: - dependencies: - '@eslint-community/eslint-utils': 4.10.1(eslint@9.39.5) - '@eslint-community/regexpp': 4.12.2 - '@eslint/config-array': 0.21.2 - '@eslint/config-helpers': 0.4.2 - '@eslint/core': 0.17.0 - '@eslint/eslintrc': 3.3.7 - '@eslint/js': 9.39.5 - '@eslint/plugin-kit': 0.4.1 - '@humanfs/node': 0.16.8 - '@humanwhocodes/module-importer': 1.0.1 - '@humanwhocodes/retry': 0.4.3 - '@types/estree': 1.0.9 - ajv: 6.15.0 - chalk: 4.1.2 - cross-spawn: 7.0.6 - debug: 4.4.3 - escape-string-regexp: 4.0.0 - eslint-scope: 8.4.0 - eslint-visitor-keys: 4.2.1 - espree: 10.4.0 - esquery: 1.7.0 - esutils: 2.0.3 - fast-deep-equal: 3.1.3 - file-entry-cache: 8.0.0 - find-up: 5.0.0 - glob-parent: 6.0.2 - ignore: 5.3.2 - imurmurhash: 0.1.4 - is-glob: 4.0.3 - json-stable-stringify-without-jsonify: 1.0.1 - lodash.merge: 4.6.2 - minimatch: 3.1.5 - natural-compare: 1.4.0 - optionator: 0.9.4 - transitivePeerDependencies: - - supports-color - - espree@10.4.0: - dependencies: - acorn: 8.18.0 - acorn-jsx: 5.3.2(acorn@8.18.0) - eslint-visitor-keys: 4.2.1 - - esquery@1.7.0: - dependencies: - estraverse: 5.3.0 - - esrecurse@4.3.0: - dependencies: - estraverse: 5.3.0 - - estraverse@5.3.0: {} - - esutils@2.0.3: {} - - fast-deep-equal@3.1.3: {} - - fast-diff@1.3.0: {} - - fast-json-stable-stringify@2.1.0: {} - - fast-levenshtein@2.0.6: {} - - fast-string-truncated-width@3.0.3: {} - - fast-string-width@3.0.2: - dependencies: - fast-string-truncated-width: 3.0.3 - - fast-uri@3.1.7: {} - - fast-wrap-ansi@0.2.2: - dependencies: - fast-string-width: 3.0.2 - - fdir@6.5.0(picomatch@4.0.7): - optionalDependencies: - picomatch: 4.0.7 - - file-entry-cache@8.0.0: - dependencies: - flat-cache: 4.0.1 - - fill-range@7.1.1: - dependencies: - to-regex-range: 5.0.1 - optional: true - - find-up@5.0.0: - dependencies: - locate-path: 6.0.0 - path-exists: 4.0.0 - - flat-cache@4.0.1: - dependencies: - flatted: 3.4.4 - keyv: 4.5.4 - - flatted@3.4.4: {} - - get-east-asian-width@1.6.0: {} - - glob-parent@6.0.2: - dependencies: - is-glob: 4.0.3 - - globals@14.0.0: {} - - globals@16.5.0: {} - - has-flag@4.0.0: {} - - iconv-lite@0.7.3: - dependencies: - safer-buffer: 2.1.2 - - ignore@5.3.2: {} - - ignore@7.0.9: {} - - import-fresh@3.3.1: - dependencies: - parent-module: 1.0.1 - resolve-from: 4.0.0 - - imurmurhash@0.1.4: {} - - is-docker@3.0.0: {} - - is-extglob@2.1.1: {} - - is-glob@4.0.3: - dependencies: - is-extglob: 2.1.1 - - is-in-ssh@1.0.0: {} - - is-inside-container@1.0.0: - dependencies: - is-docker: 3.0.0 - - is-interactive@2.0.0: {} - - is-number@7.0.0: - optional: true - - is-unicode-supported@2.1.0: {} - - is-wsl@3.1.1: - dependencies: - is-inside-container: 1.0.0 - - isexe@2.0.0: {} - - js-yaml@4.3.2: - dependencies: - argparse: 2.0.1 - - json-buffer@3.0.1: {} - - json-schema-traverse@0.4.1: {} - - json-schema-traverse@1.0.0: {} - - json-stable-stringify-without-jsonify@1.0.1: {} - - jsonc-parser@3.3.1: {} - - keyv@4.5.4: - dependencies: - json-buffer: 3.0.1 - - konva@10.5.0: {} - - levn@0.4.1: - dependencies: - prelude-ls: 1.2.1 - type-check: 0.4.0 - - libphonenumber-js@1.13.12: {} - - locate-path@6.0.0: - dependencies: - p-locate: 5.0.0 - - lodash.merge@4.6.2: {} - - log-symbols@7.0.1: - dependencies: - is-unicode-supported: 2.1.0 - yoctocolors: 2.2.0 - - magic-string@1.0.0: - dependencies: - '@jridgewell/sourcemap-codec': 1.6.0 - - micromatch@4.0.8: - dependencies: - braces: 3.0.3 - picomatch: 2.3.2 - optional: true - - mimic-function@5.0.1: {} - - minimatch@10.2.6: - dependencies: - brace-expansion: 5.0.9 - - minimatch@3.1.5: - dependencies: - brace-expansion: 1.1.18 - - minipass@7.1.3: - optional: true - - minizlib@3.1.0: - dependencies: - minipass: 7.1.3 - optional: true - - ms@2.1.3: {} - - mute-stream@3.0.0: {} - - natural-compare@1.4.0: {} - - node-emoji@2.2.0: - dependencies: - '@sindresorhus/is': 4.6.0 - char-regex: 1.0.2 - emojilib: 2.4.0 - skin-tone: 2.0.0 - - onetime@7.0.0: - dependencies: - mimic-function: 5.0.1 - - open@11.0.2: - dependencies: - default-browser: 5.5.1 - define-lazy-prop: 3.0.0 - is-in-ssh: 1.0.0 - is-inside-container: 1.0.0 - powershell-utils: 0.2.1 - wsl-utils: 1.0.0 - - optionator@0.9.4: - dependencies: - deep-is: 0.1.4 - fast-levenshtein: 2.0.6 - levn: 0.4.1 - prelude-ls: 1.2.1 - type-check: 0.4.0 - word-wrap: 1.2.5 - - ora@9.4.1: - dependencies: - chalk: 5.6.2 - cli-cursor: 5.0.0 - cli-spinners: 3.4.0 - is-interactive: 2.0.0 - is-unicode-supported: 2.1.0 - log-symbols: 7.0.1 - stdin-discarder: 0.3.2 - string-width: 8.2.2 - - p-limit@3.1.0: - dependencies: - yocto-queue: 0.1.0 - - p-locate@5.0.0: - dependencies: - p-limit: 3.1.0 - - parent-module@1.0.1: - dependencies: - callsites: 3.1.0 - - path-exists@4.0.0: {} - - path-key@3.1.1: {} - - picomatch@2.3.2: - optional: true - - picomatch@4.0.5: {} - - picomatch@4.0.7: {} - - powershell-utils@0.1.0: {} - - powershell-utils@0.2.1: {} - - prelude-ls@1.2.1: {} - - prettier-linter-helpers@1.0.1: - dependencies: - fast-diff: 1.3.0 - - prettier@3.9.6: {} - - punycode@2.3.1: {} - - rc9@3.1.0: - dependencies: - defu: 6.1.7 - destr: 2.0.5 - - readdirp@5.1.1: {} - - reflect-metadata@0.2.2: {} - - require-from-string@2.0.2: {} - - resolve-from@4.0.0: {} - - restore-cursor@5.1.0: - dependencies: - onetime: 7.0.0 - signal-exit: 4.1.0 - - run-applescript@7.1.0: {} - - rxjs@7.8.2: - dependencies: - tslib: 2.8.1 - - safer-buffer@2.1.2: {} - - semver@7.8.5: {} - - shebang-command@2.0.0: - dependencies: - shebang-regex: 3.0.0 - - shebang-regex@3.0.0: {} - - signal-exit@4.1.0: {} - - skin-tone@2.0.0: - dependencies: - unicode-emoji-modifier-base: 1.0.0 - - source-map@0.7.6: {} - - stdin-discarder@0.3.2: {} - - string-width@8.2.2: - dependencies: - get-east-asian-width: 1.6.0 - strip-ansi: 7.2.0 - - strip-ansi@7.2.0: - dependencies: - ansi-regex: 6.3.0 - - strip-json-comments@3.1.1: {} - - supports-color@7.2.0: - dependencies: - has-flag: 4.0.0 - - synckit@0.11.13: - dependencies: - '@pkgr/core': 0.3.6 - - tar@7.5.22: - dependencies: - '@isaacs/fs-minipass': 4.0.1 - chownr: 3.0.0 - minipass: 7.1.3 - minizlib: 3.1.0 - yallist: 5.0.0 - optional: true - - tinyglobby@0.2.17: - dependencies: - fdir: 6.5.0(picomatch@4.0.7) - picomatch: 4.0.7 - - to-regex-range@5.0.1: - dependencies: - is-number: 7.0.0 - optional: true - - ts-api-utils@2.5.0(typescript@5.9.3): - dependencies: - typescript: 5.9.3 - - tslib@2.8.1: {} - - type-check@0.4.0: - dependencies: - prelude-ls: 1.2.1 - - typescript-eslint@8.70.0(eslint@9.39.5)(typescript@5.9.3): - dependencies: - '@typescript-eslint/eslint-plugin': 8.70.0(@typescript-eslint/parser@8.70.0(eslint@9.39.5)(typescript@5.9.3))(eslint@9.39.5)(typescript@5.9.3) - '@typescript-eslint/parser': 8.70.0(eslint@9.39.5)(typescript@5.9.3) - '@typescript-eslint/typescript-estree': 8.70.0(typescript@5.9.3) - '@typescript-eslint/utils': 8.70.0(eslint@9.39.5)(typescript@5.9.3) - eslint: 9.39.5 - typescript: 5.9.3 - transitivePeerDependencies: - - supports-color - - typescript@5.9.3: {} - - typescript@6.0.3: - optional: true - - unicode-emoji-modifier-base@1.0.0: {} - - uri-js@4.4.1: - dependencies: - punycode: 2.3.1 - - validator@13.15.35: {} - - which@2.0.2: - dependencies: - isexe: 2.0.0 - - word-wrap@1.2.5: {} - - wsl-utils@1.0.0: - dependencies: - is-wsl: 3.1.1 - powershell-utils: 0.1.0 - - yallist@5.0.0: - optional: true - - yocto-queue@0.1.0: {} - - yoctocolors@2.2.0: {} diff --git a/flappy-bird/prettier.config.js b/flappy-bird/prettier.config.js deleted file mode 100644 index 8e5015d..0000000 --- a/flappy-bird/prettier.config.js +++ /dev/null @@ -1,6 +0,0 @@ -export default { - useTabs: false, - singleQuote: false, - trailingComma: "all", - printWidth: 100, -}; diff --git a/flappy-bird/tsconfig.json b/flappy-bird/tsconfig.json deleted file mode 100644 index fe75abc..0000000 --- a/flappy-bird/tsconfig.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "$schema": "https://json.schemastore.org/tsconfig.json", - // Mapped from https://www.typescriptlang.org/tsconfig - "compilerOptions": { - // Type Checking - "allowUnreachableCode": false, - "allowUnusedLabels": false, - "exactOptionalPropertyTypes": true, - "noFallthroughCasesInSwitch": true, - "noImplicitOverride": true, - "noImplicitReturns": true, - "noPropertyAccessFromIndexSignature": false, - "noUncheckedIndexedAccess": true, - "noUnusedLocals": true, - "noUnusedParameters": true, - "strict": true, - - // Modules - "allowArbitraryExtensions": false, - "allowImportingTsExtensions": false, - "module": "ESNext", - "moduleResolution": "Bundler", - "resolveJsonModule": true, - "resolvePackageJsonExports": true, - "resolvePackageJsonImports": true, - - // Interop Constraints - "allowSyntheticDefaultImports": true, - "esModuleInterop": false, - "forceConsistentCasingInFileNames": true, - "isolatedModules": true, - - // Language and Environment - "experimentalDecorators": true, - "lib": ["ESNext", "esnext.disposable", "DOM"], - "target": "ESNext", - "useDefineForClassFields": true - }, - "include": ["client/**/*.ts"], - "exclude": ["node_modules", ".nanoforge"] -} diff --git a/games/breakout/.gitignore b/games/breakout/.gitignore new file mode 100644 index 0000000..f28e2dc --- /dev/null +++ b/games/breakout/.gitignore @@ -0,0 +1,5 @@ +node_modules/ +dist/ +.nanoforge/ +nf_modules/ +.env diff --git a/games/breakout/README.md b/games/breakout/README.md new file mode 100644 index 0000000..79d1ae6 --- /dev/null +++ b/games/breakout/README.md @@ -0,0 +1,71 @@ +# breakout + +A breakout made of **scenes** (`@nanoforge-dev/scene`): a menu, a game with three levels, a +pause menu and two end screens. Every entity and every system but the background and `draw2D` +belongs to a scene, and goes away with it. + +| Key | Does | +| ---------- | ----------------------------------- | +| Enter | Starts a game, leaves an end screen | +| ← → | Moves the paddle | +| Space | Serves the ball | +| Esc or P | Pauses, resumes | +| Q (paused) | Quits to the menu | + +```sh +pnpm install +pnpm dev # play it +pnpm editor # open it in the editor +``` + +## The scenes + +```text +Menu root: the title, the best score +Run root: walls, paddle, ball, top bar; vars score, lives +├── Level1 bricks; vars level, bricksLeft, ballSpeed, served +├── Level2 +├── Level3 +└── (Pause) no parent of its own: loaded over the current level +GameOver, Victory roots: the score comes as a param +``` + +The vars follow their scenes (`src/scene-vars.ts` types and documents them): `score` and `lives` +go with `Run`, so a new game starts from 0 and 3 lives; a level's `bricksLeft` and `served` are +made again by the next level; `paused` exists only while `Pause` is loaded, and the game's +systems wait while it does; `best` is persistent. + +## Layout + +```text +src/ +├── main.ts the libraries; SceneLibrary starts on Menu and lists every scene by id +├── scenes/ one scene per file: menu, run, level-1 to level-3, pause, game-over, victory +├── systems/ one system per file +├── components/ one component per file +├── level.ts Level, the base class of the levels (their parent and the next level) +├── scene-vars.ts the scene vars' types and docs +├── just-pressed.ts justPressed: a key down since the last time a system asked (shared copy) +├── collisions.ts contact tests of the ball, paddle and walls (shared copy) +└── record-best.ts keeps the best score +``` + +The paddle, the ball and the walls are the ones of the pong demos: `bounceBall` sends the ball +back from the `Paddle` and the `Wall` entities (a brick is a `Wall` with a `Brick`), and +`breakBricks` counts the hits. The game's own systems (`controlPaddle`, `moveAll`, `collide`) +call the shared ones unless the game is paused. + +Three things to know when writing scenes like these: + +- **A scene's parent is read when its module is evaluated** (`static override parent = Run`, in + `level.ts`). `run.scene.ts` imports no other scene, so the levels always find `Run` defined. +- **The ECS finds a component by its class name.** A component named like a class the bundle + already has (graphics-2d's `Sprite`, `Text`, `Rect`…) is renamed by the bundler (`Sprite2`), and + no longer matches its `name` field. `SceneLibrary`'s `scenes` gives each scene an id for the + same reason. +- **`draw2D` stacks the shapes of one frame in entity order**, and a scene's entities reuse the + ids of the scene before: two shapes of one scene that overlap may stack either way. The + background is spawned by `main.ts` for that reason. + +The files of `src/` that are also in `shared/2d`, `shared/paddle` or `shared/scenes` are copies (see the +repository's README). diff --git a/games/breakout/assets/.gitkeep b/games/breakout/assets/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/games/breakout/nanoforge.config.ts b/games/breakout/nanoforge.config.ts new file mode 100644 index 0000000..77607cb --- /dev/null +++ b/games/breakout/nanoforge.config.ts @@ -0,0 +1,5 @@ +import { defineConfig } from "@nanoforge-dev/config"; + +export default defineConfig({ + type: "client", +}); diff --git a/games/breakout/package.json b/games/breakout/package.json new file mode 100644 index 0000000..9c6fd30 --- /dev/null +++ b/games/breakout/package.json @@ -0,0 +1,27 @@ +{ + "$schema": "https://json.schemastore.org/package.json", + "name": "breakout", + "description": "A breakout made of scenes: a menu, three levels, a pause menu and two end screens", + "private": true, + "type": "module", + "scripts": { + "dev": "nf dev", + "build": "nf build", + "start": "nf start", + "editor": "nf editor ." + }, + "devDependencies": { + "@nanoforge-dev/asset": "^3.0.0", + "@nanoforge-dev/cli": "^3.0.1", + "@nanoforge-dev/common": "^3.0.0", + "@nanoforge-dev/config": "^3.0.1", + "@nanoforge-dev/core": "^3.0.0", + "@nanoforge-dev/ecs": "^3.0.0", + "@nanoforge-dev/editor-lib": "^3.0.0", + "@nanoforge-dev/env": "^3.0.0", + "@nanoforge-dev/graphics-2d": "^3.0.0", + "@nanoforge-dev/input": "^3.0.0", + "@nanoforge-dev/scene": "^3.0.0", + "typescript": "^6.0.0" + } +} diff --git a/games/breakout/pnpm-lock.yaml b/games/breakout/pnpm-lock.yaml new file mode 100644 index 0000000..a1c8333 --- /dev/null +++ b/games/breakout/pnpm-lock.yaml @@ -0,0 +1,1531 @@ +lockfileVersion: '9.0' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + +importers: + + .: + devDependencies: + '@nanoforge-dev/asset': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/cli': + specifier: ^3.0.1 + version: 3.0.1 + '@nanoforge-dev/common': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/config': + specifier: ^3.0.1 + version: 3.0.1 + '@nanoforge-dev/core': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/ecs': + specifier: ^3.0.0 + version: 3.0.0(@nanoforge-dev/editor-lib@3.0.0)(@nanoforge-dev/scene@3.0.0(@nanoforge-dev/editor-lib@3.0.0)) + '@nanoforge-dev/editor-lib': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/env': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/graphics-2d': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/input': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/scene': + specifier: ^3.0.0 + version: 3.0.0(@nanoforge-dev/editor-lib@3.0.0) + typescript: + specifier: ^6.0.0 + version: 6.0.3 + +packages: + + '@angular-devkit/core@22.2.7': + resolution: {integrity: sha512-cchZAMsV4d76RDZBlWzPhYxM/Hb6bmq71oUngdrwehMbBbdQu3W9C2tGlvxuPxbRKru9ZlUa14YVXQ0+QnhFtw==} + engines: {node: ^22.22.3 || ^24.15.0 || >=26.0.0, npm: ^6.11.0 || ^7.5.6 || >=8.0.0, yarn: '>= 1.13.0'} + peerDependencies: + chokidar: ^5.0.0 + peerDependenciesMeta: + chokidar: + optional: true + + '@angular-devkit/schematics-cli@22.2.7': + resolution: {integrity: sha512-9Od0E8TiYTQWm/03QjYWnsryZA8ZSjTf/k5z61nPd/jgloVNvSW8kxC7/YMw+RoXh2idMzjiJxraKxg+gJxzPw==} + engines: {node: ^22.22.3 || ^24.15.0 || >=26.0.0, npm: ^6.11.0 || ^7.5.6 || >=8.0.0, yarn: '>= 1.13.0'} + hasBin: true + + '@angular-devkit/schematics@22.2.7': + resolution: {integrity: sha512-a1h7xNqBLQVo1e5eCyOU3axSbA9AFU6nnSH5QhlNhggfMeZde+eBrueSt25xsewoxlKO8EvkVT3+knMUkDYiGQ==} + engines: {node: ^22.22.3 || ^24.15.0 || >=26.0.0, npm: ^6.11.0 || ^7.5.6 || >=8.0.0, yarn: '>= 1.13.0'} + + '@emnapi/core@2.0.0-beta.2': + resolution: {integrity: sha512-MzCVoWtcg4Pm2B3je5mMvYMvj3MmBKw+fU7vbsJc9/iT8ip6/eYIHo/Dsm/mr+wsHB6SEyJDuxB09Yy6r/8+4A==} + + '@emnapi/runtime@2.0.0-beta.2': + resolution: {integrity: sha512-JcrSPzPvZuNZvJqPTF9Fw25LbOJ8avzFVlaf2grmH4Cku0oGP47tRgqPZadcfj3YoZMHkFVnCYFbQM8I+i5QEw==} + + '@emnapi/wasi-threads@2.2.0': + resolution: {integrity: sha512-JP7OYH38Q7+pyTAe14raZHLQIK7BDKbdwji+Xi3pcd/6QkJYQH3SX4wu6EplGrGJWRepoNzedfm0G3B9Z4e9Rw==} + + '@inquirer/ansi@2.1.0': + resolution: {integrity: sha512-63GU5AD9KhNbWM0jlhHoMJTEFck2upFOPxHlnCKf3xYTV3rjTUUQfodihmTnfYQzMLS29oy8lK/gA1eJgu4bhA==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + + '@inquirer/checkbox@5.3.0': + resolution: {integrity: sha512-3QQSO87A+JoRtOtjtsgX2enwTL+3+VBVrkUpdqrIxMOgn5+W5sE57PcCPAiNUIESHxV4Q6mNEGxq2xLmRa0/yw==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/confirm@6.4.0': + resolution: {integrity: sha512-+DCZxrOF01Q/1SzTQkgycAQPS/Jf+Yol0h1P/MVmopukTsxGOu1h/LKqf30y0eHKFZYYrgUMVhGDhEbPmSPi9A==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/core@12.1.0': + resolution: {integrity: sha512-6H7usRWw4Gdjgpaem10CA5MfZ/xoYPGyInriR1Xubqjv+SVo8LIJ1erpFxW5JgCza6VZVZiKLTko7RtUU3AQMg==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/editor@5.4.0': + resolution: {integrity: sha512-L7vdCe4jnMpzhDisu1tAnr4WGvfPOVz+vNFXyIIL7O2Ycn/n90sn1ARvg+4cwzLf+us51BE/cX7uhnrLcal3+g==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/expand@5.2.0': + resolution: {integrity: sha512-AOp2KQk7QojUyWOP7VkqdBWmxLRaVH58wQMx3N4//P530EDtpVp1EWIjAJubx9ZohWS/UCEpIkA1TuiNki0iOA==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/external-editor@3.1.0': + resolution: {integrity: sha512-27JAkF38nXqXaoveU28iA/+Z8nutnF8B3JsbdToPHn9WnkrsMtZ0/YoJ29YwbtFexYIo+tIy6ikMvTdHKjjmGA==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/figures@2.1.0': + resolution: {integrity: sha512-CR9u2PME23jxy2SOyTb117efwAAPm98Zr+LoWI+PiQ55D6U8Yeu/HyFTxwytKhPa6oxAGzdsm2Kg7oLS6B9z8w==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + + '@inquirer/input@5.2.0': + resolution: {integrity: sha512-sIUPnN2X7M+7dq3RUd+e9QRacYnM+6B+kSucwQgj5VC5Eo/f+CIr2NyPBumxsViI+wzfokkgop/3x3KfHxNyJw==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/number@4.3.0': + resolution: {integrity: sha512-xYkX4sPVgox0F7yQwpz/MByWjOGdLEf1pdjH+Lji2gAzSs2xezz5bN5YgS1n0tx9wo0mRhGvq1KJGtvDZ9XXcQ==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/password@5.3.0': + resolution: {integrity: sha512-KVqW4G/UbMK06uBN76xF89JKYC9YBWU7v+Kc2tUwMCO8pg3ASBr0HVabl1KaSqF94O2KiRu8aKx4EicN78PK+A==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/prompts@8.7.2': + resolution: {integrity: sha512-QoRB4wFIjgH5iOhSjoIKMkTvSHDuV+O3OITlIqAYO0oK5x364GJILXiMBvlPiE+klg7Xx9tq5XVqQHcGUDYYPA==} + engines: {node: '>=23.5.0 || ^22.13.0 || ^20.17.0'} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/prompts@8.8.0': + resolution: {integrity: sha512-yYVT2Eo3mafb9tnU2Mr3+wh5wLCWyspExqVoPSMCIfBIn3ZUTE4IDfbCMbMgXaOH0tH+JZEhOtfczQhDzOjIGg==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/rawlist@5.4.0': + resolution: {integrity: sha512-x42wcy465GM5/mHNKBFdAJbLlLyzmYqr/DEa6F49nHpI+03EFwRCRKeLGQakx5XqZ4unc2yFuS78qAD4Rb0iFA==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/search@4.4.0': + resolution: {integrity: sha512-UJ+9tkzPT1AjnvjuPFYcOdO3BVeN28bfSXajYRFZTRgA9OiNl4k2Nn2cHHPwiIDyPHlvOnmE9ZOHyXhPHtvb+A==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/select@5.3.0': + resolution: {integrity: sha512-Fmgfl0qjqCQo+/tjQpgnRXKh5N7/VpYcJh+AlYU2eHmHZLMGUBDzo+Gwc2ODzWJfXNRZmgaMhz4qULcO/C/rXg==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/type@4.3.0': + resolution: {integrity: sha512-/IA8q2nyjgyl0NGSjqiRXB8gh3We7Pzx9C0c+6Zoolu905jFc79anerrUG7+n65+qs310DRK43yi2WDI8nY59A==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@isaacs/fs-minipass@4.0.1': + resolution: {integrity: sha512-wgm9Ehl2jpeqP3zw/7mo3kRHFp5MEDhqAdwy1fTGkHAwnkGOVsgpvQhL8B5n1qlb01jV3n/bI0ZfZp5lWA1k4w==} + engines: {node: '>=18.0.0'} + + '@jridgewell/sourcemap-codec@1.6.0': + resolution: {integrity: sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw==} + + '@nanoforge-dev/asset@3.0.0': + resolution: {integrity: sha512-jqXcyCMbdcCCj7wZ/dyIpjY8hza02Pt/vY8KrNcaXTlxpTc9EE+VKuO5+fHdUXWWPgJSFt96TqAPhug+z+KH3Q==} + engines: {node: '26'} + + '@nanoforge-dev/cli@3.0.1': + resolution: {integrity: sha512-ZfrbETcAcX3vsPLO1WLSCJc2ERCAcIpbdi9Df5bmH3XLinQkDAcESkN9JkaI/vgV08A7xhTjV8zSDSwF0T73Xg==} + engines: {node: '26'} + hasBin: true + + '@nanoforge-dev/common@3.0.0': + resolution: {integrity: sha512-lzMvQ1vCElh9OcP4EqhffbY+AQXOH4IiuD1pj7VvJlpcY6hh7Bs/s4NVS0gXoJ+ibpBMe5mAq23RyzqTwk8czg==} + engines: {node: '26'} + + '@nanoforge-dev/config@3.0.1': + resolution: {integrity: sha512-XWRScOotb8IirerRx/mWLmUVYye3lo0PN/5a0MUp/eoSrhz0S6zzhGHEupRuC8aeHTjsQT7ctM3P6YyKSHZLaQ==} + engines: {node: '26'} + + '@nanoforge-dev/core@3.0.0': + resolution: {integrity: sha512-pa7Fr3TFkZVfAADBC17Qt5ru/W9vXtYB8e5eb7wurAtu8/jH/ZtqfW3kafTuWC9513MXp/h6LOCdZQhjnCt6UA==} + engines: {node: '26'} + + '@nanoforge-dev/ecs@3.0.0': + resolution: {integrity: sha512-csrXJtCzqohxtvEQs+O//xabnaLR3BXe0QpSpl7NVihF3f0iX2fNYURxNjQKxzoPYBokCnnyNxN2KFc7UmIsdA==} + engines: {node: '26'} + peerDependencies: + '@nanoforge-dev/editor-lib': 3.0.0 + '@nanoforge-dev/scene': 3.0.0 + peerDependenciesMeta: + '@nanoforge-dev/editor-lib': + optional: true + '@nanoforge-dev/scene': + optional: true + + '@nanoforge-dev/editor-lib@3.0.0': + resolution: {integrity: sha512-fSWm6bHelbxqeVESYoUUKDi9RGNxvRu6p1r41KE1DddM0RrP0/WzkFOWBvgl+psHbYNotXe723Y2Fd3p+tqPDQ==} + engines: {node: '26'} + + '@nanoforge-dev/editor@0.1.4': + resolution: {integrity: sha512-bqbrH8ulFSiZz1iisJHtHeEzj1RV/70uErCYHeW4DIhVPsWbBfWKFvg/ghAbmPk5vsj0YnhDX6DSpik4S1QoiQ==} + engines: {node: '25'} + + '@nanoforge-dev/env@3.0.0': + resolution: {integrity: sha512-kXYXl9/09Bn8VStTTFuZY3dYDG9b76VhOi9PHMnaLe75XcFRLKJ2dYkXf3ut6RCL2+6H7HAEIOALjR15CHnJ5A==} + engines: {node: '26'} + + '@nanoforge-dev/graphics-2d@3.0.0': + resolution: {integrity: sha512-0I0WUr5495jORdYR+HtyP4kmAfCMvixmG+EH/gE5bN33S8RO6/Ly4oMLZOLUywcDTAFuLn28BlHuVor2YfXrsg==} + engines: {node: '26'} + + '@nanoforge-dev/input@3.0.0': + resolution: {integrity: sha512-8pWU28c99VAvn37onNbVFfwXTgyQGxm5DVnTdBEzgrF3KPCzU77kEaexB1AWOlga+4qNGU7/XNm3hNZ+YS49Ig==} + engines: {node: '26'} + + '@nanoforge-dev/loader-client@1.7.0': + resolution: {integrity: sha512-zDj0yQ8cZyHHjAYDVIyB79mh4dK7WRgZG7Kc+d/43t2WX/pX2HqBVkpLcDPkA9cNOKpCRYWd3LyYISlz53gzyg==} + engines: {node: '26'} + + '@nanoforge-dev/loader-server@1.7.0': + resolution: {integrity: sha512-Yd/BYORhoar5znNSD7kGirAc1Al0q5t8iscbb07QWKeXWA+DLKjPSuKJC6ykysFkbs9HiZU59oOfxyvNL4h3Pw==} + engines: {node: '26'} + + '@nanoforge-dev/loader-website@1.7.0': + resolution: {integrity: sha512-x1fV3RYUUxru39sF5HJcfutNnifMMTIEHW92jgkR9gz06ZlZ+rQofuegXgAnEzs0dEXa+rhNQ/iXYbqOZvq6YQ==} + engines: {node: '26'} + + '@nanoforge-dev/registry@3.0.1': + resolution: {integrity: sha512-EzSaszYtrPldD5Do7jdQK3TLLb8uCirY6NQjKXkeGw31X+sUXor4h5GAaoxELWMzPnv9BbKtggSaVaQIt7s8IQ==} + engines: {node: '26'} + + '@nanoforge-dev/scene@3.0.0': + resolution: {integrity: sha512-4+QajCZCW8eVdQPZeSoLDQ/ueQOFwAoFvd0pRL06FeuzWJMxCVNTCeZp9UHZLTMqmEJKAC29OnBQuHvhGkuBVg==} + engines: {node: '26'} + peerDependencies: + '@nanoforge-dev/editor-lib': 3.0.0 + peerDependenciesMeta: + '@nanoforge-dev/editor-lib': + optional: true + + '@nanoforge-dev/schematics@3.0.1': + resolution: {integrity: sha512-iK2vC0gPEh2mQ81IB4+jfGw/ZNOLMDnS9HRBXH5tWB0mdN5GA32viblhW0oYPX2/tWrLC9YiCPgEE4AL8Zwz6w==} + engines: {node: '26'} + + '@napi-rs/wasm-runtime@1.2.6': + resolution: {integrity: sha512-mRyDmEw9/fCDXCGfL1sbgIw/GUK0PVxRW4YwgPN61F3LQ+fSyoBFarJVzgGyhF6kRzEQZ0FejDqm4WLXSeqQmw==} + engines: {node: ^20.19.0 || ^22.13.0 || >=23.5.0} + peerDependencies: + '@emnapi/core': ^1.7.1 || 2.0.0-beta.2 + '@emnapi/runtime': ^1.7.1 || 2.0.0-beta.2 + + '@oven/bun-darwin-aarch64@1.4.4': + resolution: {integrity: sha512-zW/hxwc8sJAILGwB5eTC4i48ouGXf0V4lrxmEOk3JIE6JkYVW1TZh1E2pIempqsezgW1sckTIIDudFON8bJ2Mw==} + cpu: [arm64] + os: [darwin] + + '@oven/bun-darwin-x64@1.4.4': + resolution: {integrity: sha512-oKGcxLsvh4oHjAo28nPm8c/xN0o/OmGyj1IHYc94vprkWsW2hNg2keEZt5f40cI5Hvu4jDlSRTR0UNpv1UIAxw==} + cpu: [x64] + os: [darwin] + + '@oven/bun-freebsd-aarch64@1.4.4': + resolution: {integrity: sha512-klvA9FlwLxZj3JYIOPQA4bbnHIC3uas8kBE4GaGGkeVgAQP/k8hAzYkOqkSaqHBDbxLrTyFEQArEAevJq6NJzg==} + cpu: [arm64] + os: [freebsd] + + '@oven/bun-freebsd-x64@1.4.4': + resolution: {integrity: sha512-sF1xS/scbyN94P2d0eTiarO6JHxrIvhZNT9hnWjQXW5nwKRtfuP+UYnIMNyvW1BQPcZFP/cvfLBNUIe1ea4zPA==} + cpu: [x64] + os: [freebsd] + + '@oven/bun-linux-aarch64-android@1.4.4': + resolution: {integrity: sha512-5lvn3at5vRC0GxvmiqEiV2/e23tnRi0q5pzR40yfDvDA3OW7PSkt4chF1nA9vnAJhro4/l+ol1FmNP6D3cf/oA==} + cpu: [arm64] + os: [android] + + '@oven/bun-linux-aarch64-musl@1.4.4': + resolution: {integrity: sha512-QFd0P+mHJxbZFbUla4MgiE5OwxysHaUIYxL2pPNkpWtaI7v4ShOpr8OhBmsuyB0xn5rv/ZJnPsj2y8+bB9+g/A==} + cpu: [arm64] + os: [linux] + libc: [musl] + + '@oven/bun-linux-aarch64@1.4.4': + resolution: {integrity: sha512-ZTVtpf9zmHSBVPX1sBwe5agGb/rN34yPGg/Hby8e2Ax2uCUA2URZKlZH7qLntK7qaFJCMXh9v0GWNYN2zINz1w==} + cpu: [arm64] + os: [linux] + libc: [glibc] + + '@oven/bun-linux-x64-android@1.4.4': + resolution: {integrity: sha512-3dMicj9C1DhaIfDkwt/9GtpU0W+q+GazbG9OIlEyL3Q1BBEz2e6ZRz/JiO8D/ECC0caXAqvnpFudehcLlgIwWQ==} + cpu: [x64] + os: [android] + + '@oven/bun-linux-x64-musl@1.4.4': + resolution: {integrity: sha512-lEEjNOJJrbGZu2NVcPI4uXdILcpspezWkA8R/Jr0RCGhM6zQd0Y7JBIIKNAmbX59EeWpeEz7Q78iLbpcAUypUA==} + cpu: [x64] + os: [linux] + libc: [musl] + + '@oven/bun-linux-x64@1.4.4': + resolution: {integrity: sha512-CHbbkmHVM28T1GFq+6GL4Ao4ujwwYwj1CxFFwEFzLanPfNsId9AhbIP0Q4reWuWBkGimUkoQygrK7Rgjtj3vog==} + cpu: [x64] + os: [linux] + libc: [glibc] + + '@oven/bun-windows-aarch64@1.4.4': + resolution: {integrity: sha512-n0ep5ZRPCZY1+dqFJpnnRUZB1wy4GYU6At8RF+pyzySCLjkN9R4rFh2PtBHAgF/lg1vOl3/CeER3pDM+p40ATA==} + cpu: [arm64] + os: [win32] + + '@oven/bun-windows-x64@1.4.4': + resolution: {integrity: sha512-a3LNctBVO8PjePsFZfwDleF2JXYf2BfQ1u/PLRnBDLnC2Riml+4+LgJpKj4xRGhB92KweGyQI5PXaTkP9qypMQ==} + cpu: [x64] + os: [win32] + + '@oxc-project/types@0.158.0': + resolution: {integrity: sha512-xZ66qA4WmLbTLlxH3mqMd8f9UKbaOzOT0ATwFf4DH/14pMgpUrtqtjyYzOQmgfl2a0iRAAMbQ9G1th/67jRzGw==} + + '@rolldown/binding-android-arm-eabi@1.3.2': + resolution: {integrity: sha512-kqR2xcygEx3WwDY69LsKeyf7SVmx4yzMtKZRknyaHieVJdRvvnAM97L0Gq6tUFc9T2YXcW/Ghij2+Um6He0LTw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [android] + + '@rolldown/binding-android-arm64@1.3.2': + resolution: {integrity: sha512-gXM4GAAvvIZA7qUuSCQS+Zz91H2fagKa5MNppUdjzysJ8LXMWm9D/gQj4nfOKo6okquDQ5pkjsuo2SUMXNW0Rw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [android] + + '@rolldown/binding-darwin-arm64@1.3.2': + resolution: {integrity: sha512-OBs5hp3W+LwMEUmDMMMnu08ncG0t6DDgnFU+6TAucKtAfNgerYLZSr2jtREKb/JuPQ1J7bJnWIgKKkxvjuAw1g==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [darwin] + + '@rolldown/binding-darwin-x64@1.3.2': + resolution: {integrity: sha512-X0VGYd4v/gdjfa/IP6uHuMhofPoUDYvK/byk3bC0jQ1pKKgt6RZ4B4puMqP0AHkjmIHAsxA471mM6AxZ39IaTA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [darwin] + + '@rolldown/binding-freebsd-x64@1.3.2': + resolution: {integrity: sha512-mr04K4cp9J/fj9fknrX8e4QvI/V48Sp+4v64PoLwhoirIH8b8L8EBrF/0bTjV1It2IL91hoNG13GblnWLglkxA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [freebsd] + + '@rolldown/binding-linux-arm-gnueabihf@1.3.2': + resolution: {integrity: sha512-VgWy02HU9Tiy6tU8U+kF3Fd4TQwTNdIBvs2MlgViP1ksMtAnQQTIPAj0ZsJzIQXKIOugqQSpqxQgELJ3fkuL5w==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [linux] + + '@rolldown/binding-linux-arm64-gnu@1.3.2': + resolution: {integrity: sha512-0wloJFYqV844gv6boiERbHpErxbxHbmlgnMX5VxP1Ux+DLBqGrUOn0cIpBmCZEcTITes3QUelxya4u8c9ziQvQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-arm64-musl@1.3.2': + resolution: {integrity: sha512-Kys8wgFQy8H8vua0MNpC0akMBFoNO8455RHk2yycBM0iayMIAtVAL6xmV9TWAkehFgrrlImTL2fZdX5LXfYtAA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + libc: [musl] + + '@rolldown/binding-linux-ppc64-gnu@1.3.2': + resolution: {integrity: sha512-L8eej7+/StRxUHHOPsOVl7Fzx/3tumuGB4hGQZKT73xRI16KZhaSJr0gi3C3WBjNRxeJRKKps2UD4lQukP+oBw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [ppc64] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-s390x-gnu@1.3.2': + resolution: {integrity: sha512-MV5CEb/nV8neQOj7l6945q1vy62HXtWO8zPDvfySPusoUzdBoLoJ/DfXXwaYThGTXZCniF+5bCf253WTPPK7Yw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [s390x] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-x64-gnu@1.3.2': + resolution: {integrity: sha512-3qssvvVvkwQookZ1/1avlKWc5orAR85vgKdzDd5noZS8nnHiI/ejOAEt0xfNYvtBBF7/DZmP8dANWkRBJVOBCA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-x64-musl@1.3.2': + resolution: {integrity: sha512-rJqoFTm/bCZFKKgaT4NzWn/TuJkFDToZ/rzYFnYVBL28jH1nIfg6snx2mDri30nal9H+wcYfKpoPR9jrMQgQQg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + libc: [musl] + + '@rolldown/binding-openharmony-arm64@1.3.2': + resolution: {integrity: sha512-ozdbCjHfh0N//wJNExjJlSlcDaeIKo8k1ktzkLUyESr2Gu/Qw7nBYxKe3jgtoaxda570vg10WdYosre82263hQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [openharmony] + + '@rolldown/binding-wasm32-wasi@1.3.2': + resolution: {integrity: sha512-p5VA6Vk/2cXZPVWf+dDbuE0dkhrcoAo6pISTJmzUnsSdQqNJdusyR8lZgHku095+r27zrYISNLZnJoqrcePW0A==} + engines: {node: ^20.19.0 || ^22.13.0 || >=23.5.0} + cpu: [wasm32] + + '@rolldown/binding-win32-arm64-msvc@1.3.2': + resolution: {integrity: sha512-XDb2U14Orf4r76SwzvJ7avePL00w4gHBmi1Ig4B/itYFEUTmYMNDHVU0dcYuBa0LgNBqyREoJOrQKxQlyYJA7A==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [win32] + + '@rolldown/binding-win32-x64-msvc@1.3.2': + resolution: {integrity: sha512-lEsKzKJqIUDZVCBhS4lkZuyQUhV1oRg5UHkI72qlOAqJn7qEXcoVdTridFS7PHNWdZknBl95EAF/4P1Xv0K1eQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [win32] + + '@rolldown/pluginutils@1.1.0': + resolution: {integrity: sha512-K+NU2HDCEem4sClgHH4ZZXwdJeNFkJo+hRk479DIwdIviAPN2hFJH1KHHwg8CxHQXvi0M5XY4deTXINfIiSG6w==} + + '@sindresorhus/is@4.6.0': + resolution: {integrity: sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==} + engines: {node: '>=10'} + + '@tybys/wasm-util@0.10.4': + resolution: {integrity: sha512-W3c4gRigFS0T/Ma4qIYF3GDAc5AQdHb1yL5znJT1Zv1YaD9Kitx656wBjvr19qbiosmZT8lWDM5BEMynUqX65A==} + + '@types/validator@13.15.10': + resolution: {integrity: sha512-T8L6i7wCuyoK8A/ZeLYt1+q0ty3Zb9+qbSSvrIVitzT3YjZqkTZ40IbRsPanlB4h1QB3JVL1SYCdR6ngtFYcuA==} + + ajv-formats@3.0.1: + resolution: {integrity: sha512-8iUql50EUR+uUcdRQ3HDqa6EVyo3docL8g5WJ3FNcWmu62IbkGUue/pEyLBW8VGKKucTPgqeks4fIU1DA4yowQ==} + peerDependencies: + ajv: ^8.0.0 + peerDependenciesMeta: + ajv: + optional: true + + ajv@8.20.0: + resolution: {integrity: sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA==} + + ansi-regex@6.6.0: + resolution: {integrity: sha512-XZ5apbzreCbXSKwPjJstu8R0zOi247w3XYwWxtwBXgpZrCyc1Ka7p9/xY0A9/diMewmHbEKz+FIraWaEWjlN5g==} + engines: {node: '>=12'} + + ansis@4.5.0: + resolution: {integrity: sha512-KwIVkfFfJSSzBmZhDGuTmkhWqTdyB5oNVzzznBJbBZ5bZtHiqSrcugRF0RKJKT4Ss3d7ZrcjnlFVDlQNmtWfWw==} + engines: {node: '>=14'} + + braces@3.0.3: + resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} + engines: {node: '>=8'} + + bun@1.4.4: + resolution: {integrity: sha512-hj0ASdG6PNjLZGFAXktWb3Uaj/dcv/1wCsIttoEXADNIQBsGjTr+5uLKYbrDkuc7NT0Tkj4yPIqJI2jDxXdvVg==} + cpu: [arm64, x64] + os: [darwin, linux, android, freebsd, win32] + hasBin: true + + bundle-name@4.1.1: + resolution: {integrity: sha512-DdH81/zPLVS11EUgWq3tEu/xn+EzljlMYooDNdzWEnFha3R3NBMpMV1UqYIpjYHV/SgpFKMIX1Oh7o06SjM/oA==} + engines: {node: '>=18'} + + chalk@5.6.2: + resolution: {integrity: sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA==} + engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} + + char-regex@1.0.2: + resolution: {integrity: sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==} + engines: {node: '>=10'} + + chardet@2.2.0: + resolution: {integrity: sha512-rddelWYNPRrXq6PtNEN2S3f6t9ILzvqaN5pVgi4kqt9jHQaXIial9PznB5iSPVlQSLNaaH22ItWz3EJtQ10+OA==} + + chokidar@5.0.0: + resolution: {integrity: sha512-TQMmc3w+5AxjpL8iIiwebF73dRDF4fBIieAqGn9RGCWaEVwQ6Fb2cGe31Yns0RRIzii5goJ1Y7xbMwo1TxMplw==} + engines: {node: '>= 20.19.0'} + + chownr@3.0.0: + resolution: {integrity: sha512-+IxzY9BZOQd/XuYPRmrvEVjF/nqj5kgT4kEq7VofrDoM1MxoRjEWkrCC3EtLi59TVawxTAn+orJwFQcrqEN1+g==} + engines: {node: '>=18'} + + class-transformer@0.5.1: + resolution: {integrity: sha512-SQa1Ws6hUbfC98vKGxZH3KFY0Y1lm5Zm0SY8XX9zbK7FJCyVEac3ATW0RIpwzW+oOfmHE5PMPufDG9hCfoEOMw==} + + class-validator@0.14.4: + resolution: {integrity: sha512-AwNusCCam51q703dW82x95tOqQp6oC9HNUl724KxJJOfnKscI8dOloXFgyez7LbTTKWuRBA37FScqVbJEoq8Yw==} + + class-validator@0.15.1: + resolution: {integrity: sha512-LqoS80HBBSCVhz/3KloUly0ovokxpdOLR++Al3J3+dHXWt9sTKlKd4eYtoxhxyUjoe5+UcIM+5k9MIxyBWnRTw==} + + cli-cursor@5.0.0: + resolution: {integrity: sha512-aCj4O5wKyszjMmDT4tZj93kxyydN/K5zPWSCe6/0AV/AA1pqe5ZBIw0a2ZfPQV7lL5/yb5HsUreJ6UFAF1tEQw==} + engines: {node: '>=18'} + + cli-spinners@3.4.0: + resolution: {integrity: sha512-bXfOC4QcT1tKXGorxL3wbJm6XJPDqEnij2gQ2m7ESQuE+/z9YFIWnl/5RpTiKWbMq3EVKR4fRLJGn6DVfu0mpw==} + engines: {node: '>=18.20'} + + cli-width@4.1.0: + resolution: {integrity: sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==} + engines: {node: '>= 12'} + + commander@15.1.0: + resolution: {integrity: sha512-cgnQ88TRrWcC7pVq46RzJVRMktu3W2RcbnoidnfBsl1bmDCBwJS/udcIZpKoCrbAYYaCqsz1yZCVIgbIaU3ddQ==} + engines: {node: '>=22.12.0'} + + default-browser-id@5.0.1: + resolution: {integrity: sha512-x1VCxdX4t+8wVfd1so/9w+vQ4vx7lKd2Qp5tDRutErwmR85OgmfX7RlLRMWafRMY7hbEiXIbudNrjOAPa/hL8Q==} + engines: {node: '>=18'} + + default-browser@5.5.1: + resolution: {integrity: sha512-m1pAzaJgZ/gssEqlOhJkPJp8Xly7QyW6xcrkUa2KKcDeDSEMP7X8xipU3snUcfisTQx0w1AGae+9UtJSfVnXGw==} + engines: {node: '>=18'} + + define-lazy-prop@3.0.0: + resolution: {integrity: sha512-N+MeXYoqr3pOgn8xfyRPREN7gHakLYjhsHhWGT3fWAiL4IkAt0iDw14QiiEm2bE30c5XX5q0FtAA3CK5f9/BUg==} + engines: {node: '>=12'} + + defu@6.1.7: + resolution: {integrity: sha512-7z22QmUWiQ/2d0KkdYmANbRUVABpZ9SNYyH5vx6PZ+nE5bcC0l7uFvEfHlyld/HcGBFTL536ClDt3DEcSlEJAQ==} + + destr@2.0.5: + resolution: {integrity: sha512-ugFTXCtDZunbzasqBxrK93Ik/DRYsO6S/fedkWEMKqt04xZ4csmnmwGDBAb07QWNaGMAmnTIemsYZCksjATwsA==} + + dotenv@17.4.2: + resolution: {integrity: sha512-nI4U3TottKAcAD9LLud4Cb7b2QztQMUEfHbvhTH09bqXTxnSie8WnjPALV/WMCrJZ6UV/qHJ6L03OqO3LcdYZw==} + engines: {node: '>=12'} + + dotenv@18.0.10: + resolution: {integrity: sha512-89FAA1xchzK2mxVWdr5F/0rldwiueXs6zJM86rO66EzekR1iBdiXRthyG+m5GvkJaFH3C2LESzamTkgndmLT2A==} + engines: {node: '>=12'} + hasBin: true + + emojilib@2.4.0: + resolution: {integrity: sha512-5U0rVMU5Y2n2+ykNLQqMoqklN9ICBT/KsvC1Gz6vqHbz2AXXGkG+Pm5rMWk/8Vjrr/mY9985Hi8DYzn1F09Nyw==} + + fast-deep-equal@3.1.3: + resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} + + fast-string-truncated-width@3.0.3: + resolution: {integrity: sha512-0jjjIEL6+0jag3l2XWWizO64/aZVtpiGE3t0Zgqxv0DPuxiMjvB3M24fCyhZUO4KomJQPj3LTSUnDP3GpdwC0g==} + + fast-string-width@3.0.2: + resolution: {integrity: sha512-gX8LrtNEI5hq8DVUfRQMbr5lpaS4nMIWV+7XEbXk2b8kiQIizgnlr12B4dA3ZEx3308ze0O4Q1R+cHts8kyUJg==} + + fast-uri@3.1.9: + resolution: {integrity: sha512-hS/0Wt3Ya043oKXs0sIxrMpKQITXhMLIrVAKKXi4gozGC9v7YRWVnXIZzjNPTO02M9BdxLCWqK1yRXgNziVyJQ==} + + fast-wrap-ansi@0.2.2: + resolution: {integrity: sha512-7F2Fl+TjRSenLqlU3UjSH0iyqopqoZIu7eZVpEirP2g1GtWa2G/ecEmBdgz31+Mxr+ELclgg6sokpSFIQiZ02Q==} + + fflate@0.8.3: + resolution: {integrity: sha512-tbZNuJrLwGUp3zshBtdy4W+ORxZuIh8a5ilyIEQDC5rY1f3U20JMry0Ll3WBzU58EZKsEuJFXhb5gwv8CsPvgA==} + + fill-range@7.1.1: + resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} + engines: {node: '>=8'} + + get-east-asian-width@1.7.0: + resolution: {integrity: sha512-XjH1AECxf0giL2V1aU8vKyRR2ppRUb5c0EvT7zuJTokQ74bNo52zOtghqdWIqrhUD79fo3x0WfKZdOqxF6LG1Q==} + engines: {node: '>=18'} + + iconv-lite@0.7.3: + resolution: {integrity: sha512-IKXpvIzjnC9XTAUbVBcMfGS0EPaIXtW6v+zr+RRp+hqULEpo0owZax6wyRwPOJbWbzjYspQwusTsfVr0ifh4uQ==} + engines: {node: '>=0.10.0'} + + is-docker@3.0.0: + resolution: {integrity: sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + hasBin: true + + is-in-ssh@1.0.0: + resolution: {integrity: sha512-jYa6Q9rH90kR1vKB6NM7qqd1mge3Fx4Dhw5TVlK1MUBqhEOuCagrEHMevNuCcbECmXZ0ThXkRm+Ymr51HwEPAw==} + engines: {node: '>=20'} + + is-inside-container@1.0.0: + resolution: {integrity: sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA==} + engines: {node: '>=14.16'} + hasBin: true + + is-interactive@2.0.0: + resolution: {integrity: sha512-qP1vozQRI+BMOPcjFzrjXuQvdak2pHNUMZoeG2eRbiSqyvbEf/wQtEOTOX1guk6E3t36RkaqiSt8A/6YElNxLQ==} + engines: {node: '>=12'} + + is-number@7.0.0: + resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} + engines: {node: '>=0.12.0'} + + is-unicode-supported@2.1.0: + resolution: {integrity: sha512-mE00Gnza5EEB3Ds0HfMyllZzbBrmLOX3vfWoj9A9PEnTfratQ/BcaJOuMhnkhjXvb2+FkY3VuHqtAGpTPmglFQ==} + engines: {node: '>=18'} + + is-wsl@3.1.1: + resolution: {integrity: sha512-e6rvdUCiQCAuumZslxRJWR/Doq4VpPR82kqclvcS0efgt430SlGIk05vdCN58+VrzgtIcfNODjozVielycD4Sw==} + engines: {node: '>=16'} + + json-schema-traverse@1.0.0: + resolution: {integrity: sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==} + + jsonc-parser@3.3.1: + resolution: {integrity: sha512-HUgH65KyejrUFPvHFPbqOY0rsFip3Bo5wb4ngvdi1EpCYWUQDC5V+Y7mZws+DLkr4M//zQJoanu1SP+87Dv1oQ==} + + konva@10.9.1: + resolution: {integrity: sha512-m49x+GatSxEUSvqahYhxpTjgKbtrLtw4P4o4B4iux953ZFpceaK52Ea+CFsAsd7W4I0Y5u6mMoRUsY/eltNZmw==} + peerDependencies: + canvas: ^3.0.0 + skia-canvas: ^3.0.0 + peerDependenciesMeta: + canvas: + optional: true + skia-canvas: + optional: true + + libphonenumber-js@1.13.16: + resolution: {integrity: sha512-tIOCM9yx2Go6d5/ZANe0K+G4AZek1Ymx81HxQpf19Sri4zMP95eQbKdnUGHAvFQ4nx0PeLhFqvAfisTADXj3tQ==} + + log-symbols@7.0.1: + resolution: {integrity: sha512-ja1E3yCr9i/0hmBVaM0bfwDjnGy8I/s6PP4DFp+yP+a+mrHO4Rm7DtmnqROTUkHIkqffC84YY7AeqX6oFk0WFg==} + engines: {node: '>=18'} + + magic-string@1.4.1: + resolution: {integrity: sha512-8lyCu36ErXR0J9uaGKlKQoiLZKmtI63YGLE8G2o9jyRPdr4X47LusSOwgOJOzcVtp81fTAAjxR7BwKz682Jhow==} + + micromatch@4.0.8: + resolution: {integrity: sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==} + engines: {node: '>=8.6'} + + mimic-function@5.0.1: + resolution: {integrity: sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==} + engines: {node: '>=18'} + + minipass@7.1.3: + resolution: {integrity: sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A==} + engines: {node: '>=16 || 14 >=14.17'} + + minizlib@3.1.0: + resolution: {integrity: sha512-KZxYo1BUkWD2TVFLr0MQoM8vUUigWD3LlD83a/75BqC+4qE0Hb1Vo5v1FgcfaNXvfXzr+5EhQ6ing/CaBijTlw==} + engines: {node: '>= 18'} + + mute-stream@4.0.0: + resolution: {integrity: sha512-gSrprq0fJ3EiOErzjdIZrjysVVmJ4uu1QWfCDss5LypA5OXvrMje5Ym5z6V6RLyJ2eF87lasX7t6a0AnFvZblg==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + + node-emoji@2.2.0: + resolution: {integrity: sha512-Z3lTE9pLaJF47NyMhd4ww1yFTAP8YhYI8SleJiHzM46Fgpm5cnNzSl9XfzFNqbaz+VlJrIj3fXQ4DeN1Rjm6cw==} + engines: {node: '>=18'} + + onetime@7.0.0: + resolution: {integrity: sha512-VXJjc87FScF88uafS3JllDgvAm+c/Slfz06lorj2uAY34rlUu0Nt+v8wreiImcrgAjjIHp1rXpTDlLOGw29WwQ==} + engines: {node: '>=18'} + + open@11.0.4: + resolution: {integrity: sha512-++Zlftm0kVLPmzC06t6epuWmcRMDbI4z5P3NNX979WA/k23+NtSOynEGzsVfZwguKw2mi5umVgnBlJQMwRz4Pg==} + engines: {node: '>=20'} + + ora@9.4.1: + resolution: {integrity: sha512-6VlU9MLXbjVQD04AZCMX28hVtA5bUoadvUqO76MUCVA0ilwJbMiHsITRPfyVm6p/BC0Av/BXMujx39WCe1LEqw==} + engines: {node: '>=20'} + + picomatch@2.3.2: + resolution: {integrity: sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==} + engines: {node: '>=8.6'} + + picomatch@4.0.7: + resolution: {integrity: sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA==} + engines: {node: '>=12'} + + powershell-utils@0.2.1: + resolution: {integrity: sha512-C+y9x90UElAddDZmV4qOx9W53B61PO7cIqWz2dQsWlwswuq4mr8NEwytdGKboYbQlGZ3awrkTeNvcZiZNHnQ8A==} + engines: {node: '>=20'} + + rc9@3.1.0: + resolution: {integrity: sha512-ufjkNVzbRHKcCOmTahZkmVsyc3W+MSk3jY03m+a7tGHkIsdVMG9l10/3HvFbWkkKzY5VFp3pkRsIo/UYgmFL7Q==} + + readdirp@5.1.1: + resolution: {integrity: sha512-Kko+Y5XQ6fM+Ce3dq3m9YGxnacYZYl9cA1wZjaF3Vbry2L3i1qVg8+CAgNPsXRArPMUMCaOR7oa9Nqntc43JKA==} + engines: {node: '>= 20.19.0'} + + require-from-string@2.0.2: + resolution: {integrity: sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==} + engines: {node: '>=0.10.0'} + + restore-cursor@5.1.0: + resolution: {integrity: sha512-oMA2dcrw6u0YfxJQXm342bFKX/E4sG9rbTzO9ptUcR/e8A33cHuvStiYOwH7fszkZlZ1z/ta9AAoPk2F4qIOHA==} + engines: {node: '>=18'} + + rolldown@1.3.2: + resolution: {integrity: sha512-EFHqbVkXiYZA6akmYm2bvJhNbEGdUwAResRhYwl/BO8QhB5KxsG+t3RVHJSIOy5jBEb0XCACvrIGnnl6Z8sMGA==} + engines: {node: ^20.19.0 || >=22.12.0} + hasBin: true + + run-applescript@7.1.0: + resolution: {integrity: sha512-DPe5pVFaAsinSaV6QjQ6gdiedWDcRCbUuiQfQa2wmWV7+xC9bGulGI8+TdRmoFkAPaBXk8CrAbnlY2ISniJ47Q==} + engines: {node: '>=18'} + + rxjs@7.8.2: + resolution: {integrity: sha512-dhKf903U/PQZY6boNNtAGdWbG85WAbjT/1xYoZIC7FAY0yWapOBQVsVrDl58W86//e1VpMNBtRV4MaXfdMySFA==} + + safer-buffer@2.1.2: + resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} + + semver@7.8.6: + resolution: {integrity: sha512-9lpSSU4Mly3mrtruwLs1eLK6+gzbzqeBFwRNjIjE+9LuDpWdYctrQlQ3ej1Ilgi7gknpsTRnPoLP8DpCHqHIJw==} + engines: {node: '>=10'} + hasBin: true + + signal-exit@4.1.0: + resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} + engines: {node: '>=14'} + + skin-tone@2.0.0: + resolution: {integrity: sha512-kUMbT1oBJCpgrnKoSr0o6wPtvRWT9W9UKvGLwfJYO2WuahZRHOpEyL1ckyMGgMWh0UdpmaoFqKKD29WTomNEGA==} + engines: {node: '>=8'} + + source-map@0.8.0: + resolution: {integrity: sha512-d8EqvL+k/SOXCreS/SUzg2ciyHqBBLcN/yuRjFsbvVhHTE2pgei7oAhmPM7kWFbkX6OSMQfUq4KbkF3au9lhYQ==} + engines: {node: '>= 12'} + + stdin-discarder@0.3.2: + resolution: {integrity: sha512-eCPu1qRxPVkl5605OTWF8Wz40b4Mf45NY5LQmVPQ599knfs5QhASUm9GbJ5BDMDOXgrnh0wyEdvzmL//YMlw0A==} + engines: {node: '>=18'} + + string-width@8.3.0: + resolution: {integrity: sha512-ZbmZM0JCihQN91dWnxoipT2KOEyHqEyfRXUyjuRhW8b/xnqPDoq4gWEVApTVa9db2wN8mmoikgFBbjh71+cGeQ==} + engines: {node: '>=20'} + + strip-ansi@7.2.0: + resolution: {integrity: sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==} + engines: {node: '>=12'} + + tar@7.5.23: + resolution: {integrity: sha512-lkukzdoGngZHJZXxW4S/E4Fp9ghTDlyZXrQGRNoJ/LXvDKcXUTq2sg5yQe74po7Voea6n/IN09+wE/QvJMiifA==} + engines: {node: '>=18'} + + to-regex-range@5.0.1: + resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} + engines: {node: '>=8.0'} + + tslib@2.9.1: + resolution: {integrity: sha512-a4Ux9VKuIMHsOS7ENbEq6hK2ZGYIT27Rtl0E4eD9KqwxhKiQeMZE/9xb3IdYwWaSOyIBQLExhQgXDTYoiCxnWA==} + + typescript@6.0.3: + resolution: {integrity: sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw==} + engines: {node: '>=14.17'} + hasBin: true + + unicode-emoji-modifier-base@1.0.0: + resolution: {integrity: sha512-yLSH4py7oFH3oG/9K+XWrz1pSi3dfUrWEnInbxMfArOfc1+33BlGPQtLsOYwvdMy11AwUBetYuaRxSPqgkq+8g==} + engines: {node: '>=4'} + + unrun@0.3.1: + resolution: {integrity: sha512-onIck/oNnCaytwths1ZVp1LK2Gq2hPoyFhiHebObuUXqR3S0uHuLLaBK8K6mRRgV7Ptip8AnNvaUsgzwWwBZuA==} + engines: {node: ^22.13.0 || >=24.0.0} + hasBin: true + peerDependencies: + synckit: ^0.11.11 + peerDependenciesMeta: + synckit: + optional: true + + validator@13.15.35: + resolution: {integrity: sha512-TQ5pAGhd5whStmqWvYF4OjQROlmv9SMFVt37qoCBdqRffuuklWYQlCNnEs2ZaIBD1kZRNnikiZOS1eqgkar0iw==} + engines: {node: '>= 0.10'} + + wsl-utils@1.0.1: + resolution: {integrity: sha512-c16PKLIRxBYpR3jSWsdS7SFp0COm5SOQdiFjY818dYFHJbMGuLBszpF07LBWmOS1uzrHa9VGdynsEgoeKy0oOQ==} + engines: {node: '>=20'} + + yallist@5.0.0: + resolution: {integrity: sha512-YgvUTfwqyc7UXVMrB+SImsVYSmTS8X/tSrtdNZMImM+n7+QTriRXyXim0mBrTXNeqzVF0KWGgHPeiyViFFrNDw==} + engines: {node: '>=18'} + + yoctocolors@2.2.0: + resolution: {integrity: sha512-xYqdZFUK/VYazNl/oCDYN+3WloWQwMfZxBoiNt6qNyk+xfOdi598muWE42rNZFp1kNOiqW936q5RhUdnpqElSg==} + engines: {node: '>=18'} + + zod@4.6.7: + resolution: {integrity: sha512-g8W2D2kU6a8untc053fX1uVBKzM7yqAxW/3zwk83+6RyF2+SKOuV+c0wBDhUwzV1PaGapmZH+rmcUzPf+3CGwg==} + +snapshots: + + '@angular-devkit/core@22.2.7(chokidar@5.0.0)': + dependencies: + ajv: 8.20.0 + ajv-formats: 3.0.1(ajv@8.20.0) + jsonc-parser: 3.3.1 + picomatch: 4.0.7 + rxjs: 7.8.2 + source-map: 0.8.0 + optionalDependencies: + chokidar: 5.0.0 + + '@angular-devkit/schematics-cli@22.2.7(chokidar@5.0.0)': + dependencies: + '@angular-devkit/core': 22.2.7(chokidar@5.0.0) + '@angular-devkit/schematics': 22.2.7(chokidar@5.0.0) + '@inquirer/prompts': 8.7.2 + transitivePeerDependencies: + - '@types/node' + - chokidar + + '@angular-devkit/schematics@22.2.7(chokidar@5.0.0)': + dependencies: + '@angular-devkit/core': 22.2.7(chokidar@5.0.0) + jsonc-parser: 3.3.1 + magic-string: 1.4.1 + ora: 9.4.1 + rxjs: 7.8.2 + transitivePeerDependencies: + - chokidar + + '@emnapi/core@2.0.0-beta.2': + dependencies: + '@emnapi/wasi-threads': 2.2.0 + tslib: 2.9.1 + optional: true + + '@emnapi/runtime@2.0.0-beta.2': + dependencies: + tslib: 2.9.1 + optional: true + + '@emnapi/wasi-threads@2.2.0': + dependencies: + tslib: 2.9.1 + optional: true + + '@inquirer/ansi@2.1.0': {} + + '@inquirer/checkbox@5.3.0': + dependencies: + '@inquirer/ansi': 2.1.0 + '@inquirer/core': 12.1.0 + '@inquirer/figures': 2.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/confirm@6.4.0': + dependencies: + '@inquirer/core': 12.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/core@12.1.0': + dependencies: + '@inquirer/ansi': 2.1.0 + '@inquirer/figures': 2.1.0 + '@inquirer/type': 4.3.0 + cli-width: 4.1.0 + fast-wrap-ansi: 0.2.2 + mute-stream: 4.0.0 + signal-exit: 4.1.0 + + '@inquirer/editor@5.4.0': + dependencies: + '@inquirer/core': 12.1.0 + '@inquirer/external-editor': 3.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/expand@5.2.0': + dependencies: + '@inquirer/core': 12.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/external-editor@3.1.0': + dependencies: + chardet: 2.2.0 + iconv-lite: 0.7.3 + + '@inquirer/figures@2.1.0': {} + + '@inquirer/input@5.2.0': + dependencies: + '@inquirer/core': 12.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/number@4.3.0': + dependencies: + '@inquirer/core': 12.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/password@5.3.0': + dependencies: + '@inquirer/ansi': 2.1.0 + '@inquirer/core': 12.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/prompts@8.7.2': + dependencies: + '@inquirer/checkbox': 5.3.0 + '@inquirer/confirm': 6.4.0 + '@inquirer/editor': 5.4.0 + '@inquirer/expand': 5.2.0 + '@inquirer/input': 5.2.0 + '@inquirer/number': 4.3.0 + '@inquirer/password': 5.3.0 + '@inquirer/rawlist': 5.4.0 + '@inquirer/search': 4.4.0 + '@inquirer/select': 5.3.0 + + '@inquirer/prompts@8.8.0': + dependencies: + '@inquirer/checkbox': 5.3.0 + '@inquirer/confirm': 6.4.0 + '@inquirer/editor': 5.4.0 + '@inquirer/expand': 5.2.0 + '@inquirer/input': 5.2.0 + '@inquirer/number': 4.3.0 + '@inquirer/password': 5.3.0 + '@inquirer/rawlist': 5.4.0 + '@inquirer/search': 4.4.0 + '@inquirer/select': 5.3.0 + + '@inquirer/rawlist@5.4.0': + dependencies: + '@inquirer/core': 12.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/search@4.4.0': + dependencies: + '@inquirer/core': 12.1.0 + '@inquirer/figures': 2.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/select@5.3.0': + dependencies: + '@inquirer/ansi': 2.1.0 + '@inquirer/core': 12.1.0 + '@inquirer/figures': 2.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/type@4.3.0': {} + + '@isaacs/fs-minipass@4.0.1': + dependencies: + minipass: 7.1.3 + + '@jridgewell/sourcemap-codec@1.6.0': {} + + '@nanoforge-dev/asset@3.0.0': + dependencies: + '@nanoforge-dev/common': 3.0.0 + + '@nanoforge-dev/cli@3.0.1': + dependencies: + '@angular-devkit/schematics': 22.2.7(chokidar@5.0.0) + '@angular-devkit/schematics-cli': 22.2.7(chokidar@5.0.0) + '@inquirer/prompts': 8.8.0 + '@nanoforge-dev/config': 3.0.1 + '@nanoforge-dev/editor': 0.1.4 + '@nanoforge-dev/loader-client': 1.7.0 + '@nanoforge-dev/loader-server': 1.7.0 + '@nanoforge-dev/registry': 3.0.1 + '@nanoforge-dev/schematics': 3.0.1(chokidar@5.0.0) + ansis: 4.5.0 + bun: 1.4.4 + chokidar: 5.0.0 + commander: 15.1.0 + dotenv: 18.0.10 + node-emoji: 2.2.0 + open: 11.0.4 + ora: 9.4.1 + rc9: 3.1.0 + transitivePeerDependencies: + - '@types/node' + - synckit + + '@nanoforge-dev/common@3.0.0': {} + + '@nanoforge-dev/config@3.0.1': + dependencies: + unrun: 0.3.1 + zod: 4.6.7 + transitivePeerDependencies: + - synckit + + '@nanoforge-dev/core@3.0.0': + dependencies: + '@nanoforge-dev/asset': 3.0.0 + '@nanoforge-dev/common': 3.0.0 + + '@nanoforge-dev/ecs@3.0.0(@nanoforge-dev/editor-lib@3.0.0)(@nanoforge-dev/scene@3.0.0(@nanoforge-dev/editor-lib@3.0.0))': + dependencies: + '@nanoforge-dev/common': 3.0.0 + optionalDependencies: + '@nanoforge-dev/editor-lib': 3.0.0 + '@nanoforge-dev/scene': 3.0.0(@nanoforge-dev/editor-lib@3.0.0) + + '@nanoforge-dev/editor-lib@3.0.0': + dependencies: + '@nanoforge-dev/common': 3.0.0 + + '@nanoforge-dev/editor@0.1.4': + dependencies: + bun: 1.4.4 + class-transformer: 0.5.1 + class-validator: 0.15.1 + dotenv: 17.4.2 + micromatch: 4.0.8 + tar: 7.5.23 + typescript: 6.0.3 + + '@nanoforge-dev/env@3.0.0': + dependencies: + '@nanoforge-dev/common': 3.0.0 + class-transformer: 0.5.1 + class-validator: 0.14.4 + + '@nanoforge-dev/graphics-2d@3.0.0': + dependencies: + '@nanoforge-dev/common': 3.0.0 + konva: 10.9.1 + transitivePeerDependencies: + - canvas + - skia-canvas + + '@nanoforge-dev/input@3.0.0': + dependencies: + '@nanoforge-dev/common': 3.0.0 + + '@nanoforge-dev/loader-client@1.7.0': + dependencies: + '@nanoforge-dev/loader-website': 1.7.0 + bun: 1.4.4 + commander: 15.1.0 + + '@nanoforge-dev/loader-server@1.7.0': + dependencies: + bun: 1.4.4 + commander: 15.1.0 + + '@nanoforge-dev/loader-website@1.7.0': {} + + '@nanoforge-dev/registry@3.0.1': + dependencies: + fflate: 0.8.3 + semver: 7.8.6 + zod: 4.6.7 + + '@nanoforge-dev/scene@3.0.0(@nanoforge-dev/editor-lib@3.0.0)': + dependencies: + '@nanoforge-dev/common': 3.0.0 + optionalDependencies: + '@nanoforge-dev/editor-lib': 3.0.0 + + '@nanoforge-dev/schematics@3.0.1(chokidar@5.0.0)': + dependencies: + '@angular-devkit/core': 22.2.7(chokidar@5.0.0) + '@angular-devkit/schematics': 22.2.7(chokidar@5.0.0) + rxjs: 7.8.2 + transitivePeerDependencies: + - chokidar + + '@napi-rs/wasm-runtime@1.2.6(@emnapi/core@2.0.0-beta.2)(@emnapi/runtime@2.0.0-beta.2)': + dependencies: + '@emnapi/core': 2.0.0-beta.2 + '@emnapi/runtime': 2.0.0-beta.2 + '@tybys/wasm-util': 0.10.4 + optional: true + + '@oven/bun-darwin-aarch64@1.4.4': + optional: true + + '@oven/bun-darwin-x64@1.4.4': + optional: true + + '@oven/bun-freebsd-aarch64@1.4.4': + optional: true + + '@oven/bun-freebsd-x64@1.4.4': + optional: true + + '@oven/bun-linux-aarch64-android@1.4.4': + optional: true + + '@oven/bun-linux-aarch64-musl@1.4.4': + optional: true + + '@oven/bun-linux-aarch64@1.4.4': + optional: true + + '@oven/bun-linux-x64-android@1.4.4': + optional: true + + '@oven/bun-linux-x64-musl@1.4.4': + optional: true + + '@oven/bun-linux-x64@1.4.4': + optional: true + + '@oven/bun-windows-aarch64@1.4.4': + optional: true + + '@oven/bun-windows-x64@1.4.4': + optional: true + + '@oxc-project/types@0.158.0': {} + + '@rolldown/binding-android-arm-eabi@1.3.2': + optional: true + + '@rolldown/binding-android-arm64@1.3.2': + optional: true + + '@rolldown/binding-darwin-arm64@1.3.2': + optional: true + + '@rolldown/binding-darwin-x64@1.3.2': + optional: true + + '@rolldown/binding-freebsd-x64@1.3.2': + optional: true + + '@rolldown/binding-linux-arm-gnueabihf@1.3.2': + optional: true + + '@rolldown/binding-linux-arm64-gnu@1.3.2': + optional: true + + '@rolldown/binding-linux-arm64-musl@1.3.2': + optional: true + + '@rolldown/binding-linux-ppc64-gnu@1.3.2': + optional: true + + '@rolldown/binding-linux-s390x-gnu@1.3.2': + optional: true + + '@rolldown/binding-linux-x64-gnu@1.3.2': + optional: true + + '@rolldown/binding-linux-x64-musl@1.3.2': + optional: true + + '@rolldown/binding-openharmony-arm64@1.3.2': + optional: true + + '@rolldown/binding-wasm32-wasi@1.3.2': + dependencies: + '@emnapi/core': 2.0.0-beta.2 + '@emnapi/runtime': 2.0.0-beta.2 + '@napi-rs/wasm-runtime': 1.2.6(@emnapi/core@2.0.0-beta.2)(@emnapi/runtime@2.0.0-beta.2) + optional: true + + '@rolldown/binding-win32-arm64-msvc@1.3.2': + optional: true + + '@rolldown/binding-win32-x64-msvc@1.3.2': + optional: true + + '@rolldown/pluginutils@1.1.0': {} + + '@sindresorhus/is@4.6.0': {} + + '@tybys/wasm-util@0.10.4': + dependencies: + tslib: 2.9.1 + optional: true + + '@types/validator@13.15.10': {} + + ajv-formats@3.0.1(ajv@8.20.0): + optionalDependencies: + ajv: 8.20.0 + + ajv@8.20.0: + dependencies: + fast-deep-equal: 3.1.3 + fast-uri: 3.1.9 + json-schema-traverse: 1.0.0 + require-from-string: 2.0.2 + + ansi-regex@6.6.0: {} + + ansis@4.5.0: {} + + braces@3.0.3: + dependencies: + fill-range: 7.1.1 + + bun@1.4.4: + optionalDependencies: + '@oven/bun-darwin-aarch64': 1.4.4 + '@oven/bun-darwin-x64': 1.4.4 + '@oven/bun-freebsd-aarch64': 1.4.4 + '@oven/bun-freebsd-x64': 1.4.4 + '@oven/bun-linux-aarch64': 1.4.4 + '@oven/bun-linux-aarch64-android': 1.4.4 + '@oven/bun-linux-aarch64-musl': 1.4.4 + '@oven/bun-linux-x64': 1.4.4 + '@oven/bun-linux-x64-android': 1.4.4 + '@oven/bun-linux-x64-musl': 1.4.4 + '@oven/bun-windows-aarch64': 1.4.4 + '@oven/bun-windows-x64': 1.4.4 + + bundle-name@4.1.1: + dependencies: + run-applescript: 7.1.0 + + chalk@5.6.2: {} + + char-regex@1.0.2: {} + + chardet@2.2.0: {} + + chokidar@5.0.0: + dependencies: + readdirp: 5.1.1 + + chownr@3.0.0: {} + + class-transformer@0.5.1: {} + + class-validator@0.14.4: + dependencies: + '@types/validator': 13.15.10 + libphonenumber-js: 1.13.16 + validator: 13.15.35 + + class-validator@0.15.1: + dependencies: + '@types/validator': 13.15.10 + libphonenumber-js: 1.13.16 + validator: 13.15.35 + + cli-cursor@5.0.0: + dependencies: + restore-cursor: 5.1.0 + + cli-spinners@3.4.0: {} + + cli-width@4.1.0: {} + + commander@15.1.0: {} + + default-browser-id@5.0.1: {} + + default-browser@5.5.1: + dependencies: + bundle-name: 4.1.1 + default-browser-id: 5.0.1 + + define-lazy-prop@3.0.0: {} + + defu@6.1.7: {} + + destr@2.0.5: {} + + dotenv@17.4.2: {} + + dotenv@18.0.10: {} + + emojilib@2.4.0: {} + + fast-deep-equal@3.1.3: {} + + fast-string-truncated-width@3.0.3: {} + + fast-string-width@3.0.2: + dependencies: + fast-string-truncated-width: 3.0.3 + + fast-uri@3.1.9: {} + + fast-wrap-ansi@0.2.2: + dependencies: + fast-string-width: 3.0.2 + + fflate@0.8.3: {} + + fill-range@7.1.1: + dependencies: + to-regex-range: 5.0.1 + + get-east-asian-width@1.7.0: {} + + iconv-lite@0.7.3: + dependencies: + safer-buffer: 2.1.2 + + is-docker@3.0.0: {} + + is-in-ssh@1.0.0: {} + + is-inside-container@1.0.0: + dependencies: + is-docker: 3.0.0 + + is-interactive@2.0.0: {} + + is-number@7.0.0: {} + + is-unicode-supported@2.1.0: {} + + is-wsl@3.1.1: + dependencies: + is-inside-container: 1.0.0 + + json-schema-traverse@1.0.0: {} + + jsonc-parser@3.3.1: {} + + konva@10.9.1: {} + + libphonenumber-js@1.13.16: {} + + log-symbols@7.0.1: + dependencies: + is-unicode-supported: 2.1.0 + yoctocolors: 2.2.0 + + magic-string@1.4.1: + dependencies: + '@jridgewell/sourcemap-codec': 1.6.0 + + micromatch@4.0.8: + dependencies: + braces: 3.0.3 + picomatch: 2.3.2 + + mimic-function@5.0.1: {} + + minipass@7.1.3: {} + + minizlib@3.1.0: + dependencies: + minipass: 7.1.3 + + mute-stream@4.0.0: {} + + node-emoji@2.2.0: + dependencies: + '@sindresorhus/is': 4.6.0 + char-regex: 1.0.2 + emojilib: 2.4.0 + skin-tone: 2.0.0 + + onetime@7.0.0: + dependencies: + mimic-function: 5.0.1 + + open@11.0.4: + dependencies: + default-browser: 5.5.1 + define-lazy-prop: 3.0.0 + is-in-ssh: 1.0.0 + is-inside-container: 1.0.0 + powershell-utils: 0.2.1 + wsl-utils: 1.0.1 + + ora@9.4.1: + dependencies: + chalk: 5.6.2 + cli-cursor: 5.0.0 + cli-spinners: 3.4.0 + is-interactive: 2.0.0 + is-unicode-supported: 2.1.0 + log-symbols: 7.0.1 + stdin-discarder: 0.3.2 + string-width: 8.3.0 + + picomatch@2.3.2: {} + + picomatch@4.0.7: {} + + powershell-utils@0.2.1: {} + + rc9@3.1.0: + dependencies: + defu: 6.1.7 + destr: 2.0.5 + + readdirp@5.1.1: {} + + require-from-string@2.0.2: {} + + restore-cursor@5.1.0: + dependencies: + onetime: 7.0.0 + signal-exit: 4.1.0 + + rolldown@1.3.2: + dependencies: + '@oxc-project/types': 0.158.0 + '@rolldown/pluginutils': 1.1.0 + optionalDependencies: + '@rolldown/binding-android-arm-eabi': 1.3.2 + '@rolldown/binding-android-arm64': 1.3.2 + '@rolldown/binding-darwin-arm64': 1.3.2 + '@rolldown/binding-darwin-x64': 1.3.2 + '@rolldown/binding-freebsd-x64': 1.3.2 + '@rolldown/binding-linux-arm-gnueabihf': 1.3.2 + '@rolldown/binding-linux-arm64-gnu': 1.3.2 + '@rolldown/binding-linux-arm64-musl': 1.3.2 + '@rolldown/binding-linux-ppc64-gnu': 1.3.2 + '@rolldown/binding-linux-s390x-gnu': 1.3.2 + '@rolldown/binding-linux-x64-gnu': 1.3.2 + '@rolldown/binding-linux-x64-musl': 1.3.2 + '@rolldown/binding-openharmony-arm64': 1.3.2 + '@rolldown/binding-wasm32-wasi': 1.3.2 + '@rolldown/binding-win32-arm64-msvc': 1.3.2 + '@rolldown/binding-win32-x64-msvc': 1.3.2 + + run-applescript@7.1.0: {} + + rxjs@7.8.2: + dependencies: + tslib: 2.9.1 + + safer-buffer@2.1.2: {} + + semver@7.8.6: {} + + signal-exit@4.1.0: {} + + skin-tone@2.0.0: + dependencies: + unicode-emoji-modifier-base: 1.0.0 + + source-map@0.8.0: {} + + stdin-discarder@0.3.2: {} + + string-width@8.3.0: + dependencies: + get-east-asian-width: 1.7.0 + strip-ansi: 7.2.0 + + strip-ansi@7.2.0: + dependencies: + ansi-regex: 6.6.0 + + tar@7.5.23: + dependencies: + '@isaacs/fs-minipass': 4.0.1 + chownr: 3.0.0 + minipass: 7.1.3 + minizlib: 3.1.0 + yallist: 5.0.0 + + to-regex-range@5.0.1: + dependencies: + is-number: 7.0.0 + + tslib@2.9.1: {} + + typescript@6.0.3: {} + + unicode-emoji-modifier-base@1.0.0: {} + + unrun@0.3.1: + dependencies: + rolldown: 1.3.2 + + validator@13.15.35: {} + + wsl-utils@1.0.1: + dependencies: + is-wsl: 3.1.1 + powershell-utils: 0.2.1 + + yallist@5.0.0: {} + + yoctocolors@2.2.0: {} + + zod@4.6.7: {} diff --git a/games/breakout/pnpm-workspace.yaml b/games/breakout/pnpm-workspace.yaml new file mode 100644 index 0000000..96ca535 --- /dev/null +++ b/games/breakout/pnpm-workspace.yaml @@ -0,0 +1,5 @@ +allowBuilds: + bun: true +# NanoForge packages are ours: take a release as soon as it is out. +minimumReleaseAgeExclude: + - "@nanoforge-dev/*" diff --git a/games/breakout/src/collisions.ts b/games/breakout/src/collisions.ts new file mode 100644 index 0000000..fa825fa --- /dev/null +++ b/games/breakout/src/collisions.ts @@ -0,0 +1,32 @@ +import type { HitboxRect2D } from "./components/hitbox-rect-2d.component"; +import type { Position2D } from "./components/position-2d.component"; +import type { Velocity2D } from "./components/velocity-2d.component"; + +/** Whether two hitboxes overlap (touching edges don't). */ +export const overlap = (a: Position2D, aBox: HitboxRect2D, b: Position2D, bBox: HitboxRect2D) => + a.x < b.x + bBox.width && + a.x + aBox.width > b.x && + a.y < b.y + bBox.height && + a.y + aBox.height > b.y; + +/** + * Pushes `a` out of `b` on the axis it went in the least. On that axis, its velocity turns away + * from `b` when it `bounces`, and stops otherwise. + */ +export const pushOut = ( + a: Position2D, + aBox: HitboxRect2D, + velocity: Velocity2D, + b: Position2D, + bBox: HitboxRect2D, + bounces: boolean, +) => { + const left = a.x + aBox.width - b.x; + const right = b.x + bBox.width - a.x; + const up = a.y + aBox.height - b.y; + const down = b.y + bBox.height - a.y; + const axis = Math.min(left, right) < Math.min(up, down) ? "x" : "y"; + const back = axis === "x" ? left < right : up < down; + a[axis] += back ? -(axis === "x" ? left : up) : axis === "x" ? right : down; + velocity[axis] = bounces ? (back ? -1 : 1) * Math.abs(velocity[axis]) : 0; +}; diff --git a/games/breakout/src/components/acceleration-2d.component.ts b/games/breakout/src/components/acceleration-2d.component.ts new file mode 100644 index 0000000..5d4097f --- /dev/null +++ b/games/breakout/src/components/acceleration-2d.component.ts @@ -0,0 +1,18 @@ +/** + * How fast the velocity of an entity changes, in pixels per second, per second. Needs + * `Velocity2D` and the `move2D` system. + * + * @component + * @side shared + * @group Acceleration color=#f0a33a - Pixels per second, per second. + */ +export class Acceleration2D { + name = "Acceleration2D"; + + constructor( + /** Added to the horizontal velocity every second. @group Acceleration @preset vector.x */ + public x = 0, + /** Added to the vertical velocity every second. @group Acceleration @preset vector.y */ + public y = 0, + ) {} +} diff --git a/games/breakout/src/components/ball.component.ts b/games/breakout/src/components/ball.component.ts new file mode 100644 index 0000000..b39d38d --- /dev/null +++ b/games/breakout/src/components/ball.component.ts @@ -0,0 +1,10 @@ +/** + * A ball: it bounces off `Paddle` and `Wall` entities, and scores in `Goal` entities. Needs + * `Position2D`, `Velocity2D`, `HitboxRect2D` and the `bounceBall` system. + * + * @component + * @side shared + */ +export class Ball { + name = "Ball"; +} diff --git a/games/breakout/src/components/brick.component.ts b/games/breakout/src/components/brick.component.ts new file mode 100644 index 0000000..9207bb6 --- /dev/null +++ b/games/breakout/src/components/brick.component.ts @@ -0,0 +1,17 @@ +/** + * A brick: the ball breaks it in `hits` hits. Needs a `Wall` (the ball bounces off it) and the + * `breakBricks` system. + * + * @component + * @side client + */ +export class Brick { + name = "Brick"; + + constructor( + /** Hits left before it breaks. */ + public hits = 1, + /** Added to the score when it breaks. */ + public points = 10, + ) {} +} diff --git a/games/breakout/src/components/drawable-circle-2d.component.ts b/games/breakout/src/components/drawable-circle-2d.component.ts new file mode 100644 index 0000000..1066155 --- /dev/null +++ b/games/breakout/src/components/drawable-circle-2d.component.ts @@ -0,0 +1,62 @@ +import type { AssetContext } from "@nanoforge-dev/common"; +import { Circle, type Layer } from "@nanoforge-dev/graphics-2d"; +import type { Position2D } from "./position-2d.component"; + +import { imageFill } from "../image-fill"; + +/** + * Draws a circle at the entity's `Position2D` (its center). Needs the `draw2D` system. + * + * @remarks + * `shape` is the Konva `Circle` on screen: change it from code for anything the parameters don't + * offer (shadows, strokes...). + * + * @component + * @side client + * @group Shape color=#e86fb0 - Size of the circle. + * @group Look color=#b18cff - What the circle looks like. + * @group Advanced hidden - Less common settings. + */ +export class DrawableCircle2D { + name = "DrawableCircle2D"; + + /** The circle on screen, made by `draw2D` the first time it draws it. */ + shape?: Circle; + + constructor( + /** In pixels. @group Shape */ + public radius = 25, + /** A CSS color: `red`, `#ff0000`, `rgba(255, 0, 0, 0.5)`... @group Look @preset color */ + public fillColor = "#4aa3ff", + /** An image stretched over the circle, shown instead of the color. @group Look @asset .png .jpg .jpeg .gif .webp .svg */ + public image = "", + /** From 0 (invisible) to 1 (opaque). @group Look */ + public opacity = 1, + /** Clockwise, in degrees, around the center. @group Advanced */ + public rotation = 0, + /** Whether it is drawn. @group Advanced */ + public visible = true, + ) {} + + /** Puts the circle on `layer` at `position`, up to date with the parameters. */ + draw(layer: Layer, position: Position2D, assets: AssetContext): void { + this.shape ??= new Circle(); + if (this.shape.getParent() !== layer) layer.add(this.shape); + this.shape.setAttrs({ + x: position.x, + y: position.y, + radius: this.radius, + fill: this.fillColor, + opacity: this.opacity, + rotation: this.rotation, + visible: this.visible, + ...imageFill(assets, this.image, this.radius * 2, this.radius * 2, true), + }); + } + + /** Removes the circle from the screen. */ + destroy(): void { + this.shape?.destroy(); + this.shape = undefined; + } +} diff --git a/games/breakout/src/components/drawable-rect-2d.component.ts b/games/breakout/src/components/drawable-rect-2d.component.ts new file mode 100644 index 0000000..d3586ca --- /dev/null +++ b/games/breakout/src/components/drawable-rect-2d.component.ts @@ -0,0 +1,69 @@ +import type { AssetContext } from "@nanoforge-dev/common"; +import { type Layer, Rect } from "@nanoforge-dev/graphics-2d"; +import type { Position2D } from "./position-2d.component"; + +import { imageFill } from "../image-fill"; + +/** + * Draws a rectangle at the entity's `Position2D` (its top-left corner). Needs the `draw2D` + * system. + * + * @remarks + * `shape` is the Konva `Rect` on screen: change it from code for anything the parameters don't + * offer (shadows, strokes...). + * + * @component + * @side client + * @group Shape color=#e86fb0 - Size of the rectangle. + * @group Look color=#b18cff - What the rectangle looks like. + * @group Advanced hidden - Less common settings. + */ +export class DrawableRect2D { + name = "DrawableRect2D"; + + /** The rectangle on screen, made by `draw2D` the first time it draws it. */ + shape?: Rect; + + constructor( + /** In pixels. @group Shape @preset size.width */ + public width = 50, + /** In pixels. @group Shape @preset size.height */ + public height = 50, + /** A CSS color: `red`, `#ff0000`, `rgba(255, 0, 0, 0.5)`... @group Look @preset color */ + public fillColor = "#4aa3ff", + /** An image stretched over the rectangle, shown instead of the color. @group Look @asset .png .jpg .jpeg .gif .webp .svg */ + public image = "", + /** From 0 (invisible) to 1 (opaque). @group Look */ + public opacity = 1, + /** Clockwise, in degrees, around the top-left corner. @group Advanced */ + public rotation = 0, + /** Rounds the corners, in pixels. @group Advanced */ + public cornerRadius = 0, + /** Whether it is drawn. @group Advanced */ + public visible = true, + ) {} + + /** Puts the rectangle on `layer` at `position`, up to date with the parameters. */ + draw(layer: Layer, position: Position2D, assets: AssetContext): void { + this.shape ??= new Rect(); + if (this.shape.getParent() !== layer) layer.add(this.shape); + this.shape.setAttrs({ + x: position.x, + y: position.y, + width: this.width, + height: this.height, + fill: this.fillColor, + opacity: this.opacity, + rotation: this.rotation, + cornerRadius: this.cornerRadius, + visible: this.visible, + ...imageFill(assets, this.image, this.width, this.height), + }); + } + + /** Removes the rectangle from the screen. */ + destroy(): void { + this.shape?.destroy(); + this.shape = undefined; + } +} diff --git a/games/breakout/src/components/drawable-text-2d.component.ts b/games/breakout/src/components/drawable-text-2d.component.ts new file mode 100644 index 0000000..adba963 --- /dev/null +++ b/games/breakout/src/components/drawable-text-2d.component.ts @@ -0,0 +1,62 @@ +import { type Layer, Text } from "@nanoforge-dev/graphics-2d"; +import type { Position2D } from "./position-2d.component"; + +/** + * Draws a text at the entity's `Position2D` (its top-left corner). Needs the `draw2D` system. + * + * @remarks + * Change `text` from a system to show a score, a timer... `shape` is the Konva `Text` on screen: + * change it from code for anything the parameters don't offer. + * + * @component + * @side client + * @group Text color=#e86fb0 - What is written. + * @group Look color=#b18cff - What the text looks like. + * @group Advanced hidden - Less common settings. + */ +export class DrawableText2D { + name = "DrawableText2D"; + + /** The text on screen, made by `draw2D` the first time it draws it. */ + shape?: Text; + + constructor( + /** What is written. @group Text */ + public text = "Hello", + /** Height of the letters, in pixels. @group Text */ + public fontSize = 24, + /** A CSS color: `white`, `#ffffff`... @group Look @preset color */ + public fillColor = "#ffffff", + /** From 0 (invisible) to 1 (opaque). @group Look */ + public opacity = 1, + /** A CSS font family: `Arial`, `monospace`... @group Advanced */ + public fontFamily = "Arial", + /** Clockwise, in degrees, around the top-left corner. @group Advanced */ + public rotation = 0, + /** Whether it is drawn. @group Advanced */ + public visible = true, + ) {} + + /** Puts the text on `layer` at `position`, up to date with the parameters. */ + draw(layer: Layer, position: Position2D): void { + this.shape ??= new Text(); + if (this.shape.getParent() !== layer) layer.add(this.shape); + this.shape.setAttrs({ + x: position.x, + y: position.y, + text: this.text, + fontSize: this.fontSize, + fontFamily: this.fontFamily, + fill: this.fillColor, + opacity: this.opacity, + rotation: this.rotation, + visible: this.visible, + }); + } + + /** Removes the text from the screen. */ + destroy(): void { + this.shape?.destroy(); + this.shape = undefined; + } +} diff --git a/games/breakout/src/components/hitbox-rect-2d.component.ts b/games/breakout/src/components/hitbox-rect-2d.component.ts new file mode 100644 index 0000000..5c82bd3 --- /dev/null +++ b/games/breakout/src/components/hitbox-rect-2d.component.ts @@ -0,0 +1,22 @@ +/** + * Makes an entity collide as a rectangle whose top-left corner is its `Position2D`. + * + * @remarks + * The library's `HitboxRect2D` (`@nanoforge/physics-2d`) has the same parameters, plus the + * `collisions` that its `detectCollisions2D` system fills. Here `bounceBall`, `blockPaddles` and + * `scoreGoals` test the hitboxes they need themselves. + * + * @component + * @side shared + * @group Size color=#5ec26a - Size of the hitbox. + */ +export class HitboxRect2D { + name = "HitboxRect2D"; + + constructor( + /** In pixels. @group Size @preset size.width */ + public width = 50, + /** In pixels. @group Size @preset size.height */ + public height = 50, + ) {} +} diff --git a/games/breakout/src/components/move-controller-2d.component.ts b/games/breakout/src/components/move-controller-2d.component.ts new file mode 100644 index 0000000..75ffcf0 --- /dev/null +++ b/games/breakout/src/components/move-controller-2d.component.ts @@ -0,0 +1,33 @@ +import { InputEnum } from "@nanoforge-dev/input"; + +/** + * Moves an entity with the keyboard, by setting its `Velocity2D`. Needs the `moveControl2D` + * system. + * + * @example + * For a platformer, set `axes` to `horizontal`: the vertical velocity is left to gravity and + * jumps. + * + * @component + * @side client + * @group Movement color=#9d7bff - How the entity moves. + * @group Keys color=#f0a33a - The keys that move it. + */ +export class MoveController2D { + name = "MoveController2D"; + + constructor( + /** In pixels per second. @group Movement */ + public speed = 200, + /** Which directions the keys move it in. @group Movement */ + public axes: "both" | "horizontal" | "vertical" = "both", + /** @group Keys */ + public left: InputEnum = InputEnum.ArrowLeft, + /** @group Keys */ + public right: InputEnum = InputEnum.ArrowRight, + /** @group Keys */ + public up: InputEnum = InputEnum.ArrowUp, + /** @group Keys */ + public down: InputEnum = InputEnum.ArrowDown, + ) {} +} diff --git a/games/breakout/src/components/paddle.component.ts b/games/breakout/src/components/paddle.component.ts new file mode 100644 index 0000000..1141ab5 --- /dev/null +++ b/games/breakout/src/components/paddle.component.ts @@ -0,0 +1,32 @@ +/** + * A paddle: it sends a `Ball` back, at a wider angle the further from its middle the ball hits + * it. Walls stop it. Needs `Position2D` and `HitboxRect2D`, and the `bounceBall` and + * `blockPaddles` systems. + * + * @example + * The left paddle of a pong sends the ball to the right: `new Paddle(1, 0)`. A breakout paddle + * sends it up: `new Paddle(0, -1)`. + * + * @component + * @side shared + * @group Bounce color=#4aa3ff - How the ball leaves the paddle. + */ +export class Paddle { + name = "Paddle"; + + constructor( + /** Where the ball goes, hit in the middle: 1 to the right, -1 to the left. @group Bounce */ + public normalX = 0, + /** Where the ball goes, hit in the middle: 1 down, -1 up. @group Bounce */ + public normalY = -1, + /** Angle off that direction when hit at an end, in degrees. @group Bounce */ + public maxAngle = 60, + /** The ball's speed is multiplied by it at each hit: 1 keeps it. @group Bounce */ + public speedUp = 1, + /** + * The most `speedUp` takes the ball to, in pixels per second. A faster ball goes through + * walls in one frame on a slow machine. @group Bounce + */ + public maxSpeed = 1600, + ) {} +} diff --git a/games/breakout/src/components/position-2d.component.ts b/games/breakout/src/components/position-2d.component.ts new file mode 100644 index 0000000..0a35624 --- /dev/null +++ b/games/breakout/src/components/position-2d.component.ts @@ -0,0 +1,20 @@ +/** + * Where an entity is, in pixels from the top-left corner of the screen. + * + * @remarks + * For rectangles it is their top-left corner, for circles their center. + * + * @component + * @side shared + * @group Position color=#4aa3ff - Pixels from the top-left corner of the screen. + */ +export class Position2D { + name = "Position2D"; + + constructor( + /** Pixels from the left edge. @group Position @preset vector.x */ + public x = 0, + /** Pixels from the top edge. @group Position @preset vector.y */ + public y = 0, + ) {} +} diff --git a/games/breakout/src/components/scene-var-text.component.ts b/games/breakout/src/components/scene-var-text.component.ts new file mode 100644 index 0000000..5eaa09a --- /dev/null +++ b/games/breakout/src/components/scene-var-text.component.ts @@ -0,0 +1,24 @@ +import type { SceneVarKey } from "@nanoforge-dev/scene"; + +/** + * Shows a scene var in the entity's `DrawableText2D`: its text becomes `template`, with `{}` + * replaced by the var's value, or by `-` while the var does not exist. Needs the `showSceneVar` + * system. + * + * @example + * `new SceneVarText("score", "Score {}")` shows "Score 120" while `score` is 120. + * + * @component + * @side client + * @group Text color=#e86fb0 - What is shown. + */ +export class SceneVarText { + name = "SceneVarText"; + + constructor( + /** The key of the var in `ctx.scenes.vars`. @group Text */ + public variable: SceneVarKey = "", + /** The text, where `{}` is the var's value. @group Text */ + public template = "{}", + ) {} +} diff --git a/games/breakout/src/components/velocity-2d.component.ts b/games/breakout/src/components/velocity-2d.component.ts new file mode 100644 index 0000000..3b93d4e --- /dev/null +++ b/games/breakout/src/components/velocity-2d.component.ts @@ -0,0 +1,20 @@ +/** + * How fast an entity moves, in pixels per second. Needs `Position2D` and the `move2D` system. + * + * @example + * `new Velocity2D(100, 0)` moves 100 pixels to the right every second. + * + * @component + * @side shared + * @group Velocity color=#36c5a0 - Pixels per second. + */ +export class Velocity2D { + name = "Velocity2D"; + + constructor( + /** Pixels per second to the right (negative: to the left). @group Velocity @preset vector.x */ + public x = 0, + /** Pixels per second downward (negative: upward). @group Velocity @preset vector.y */ + public y = 0, + ) {} +} diff --git a/games/breakout/src/components/wall.component.ts b/games/breakout/src/components/wall.component.ts new file mode 100644 index 0000000..3e54fda --- /dev/null +++ b/games/breakout/src/components/wall.component.ts @@ -0,0 +1,16 @@ +/** + * A wall: a `Ball` bounces off it, and a `Paddle` can't go through it. Needs `Position2D` and + * `HitboxRect2D`. + * + * @remarks + * `hits` counts the bounces, for a system that breaks bricks. + * + * @component + * @side shared + */ +export class Wall { + name = "Wall"; + + /** Bounces of a ball off this wall, added by `bounceBall`. Set it back to 0 once handled. */ + hits = 0; +} diff --git a/games/breakout/src/image-fill.ts b/games/breakout/src/image-fill.ts new file mode 100644 index 0000000..c7fc737 --- /dev/null +++ b/games/breakout/src/image-fill.ts @@ -0,0 +1,43 @@ +import type { AssetContext } from "@nanoforge-dev/common"; +import type { ShapeConfig } from "@nanoforge-dev/graphics-2d"; + +const images = new Map(); + +/** + * The fill of a shape of `width` by `height` pixels showing the image at `path` (an asset path + * such as `/textures/hero.png`, found in `assets`) stretched over it. Without an image, until it + * is loaded, or when there is no asset at `path`, the shape is filled with its color. + * + * @param centered - Whether the shape's origin is its center (a circle) instead of its top-left + * corner (a rectangle). + */ +export const imageFill = ( + assets: AssetContext, + path: string, + width: number, + height: number, + centered = false, +): ShapeConfig => { + if (!path) return { fillPriority: "color", fillPatternImage: undefined }; + let image = images.get(path); + if (!image) { + image = document.createElement("img"); + try { + image.src = assets.getAsset(path).path; + } catch (error) { + // Once per path, not every frame: the shape keeps its color. + console.warn(`No image at "${path}":`, error); + } + images.set(path, image); + } + if (!image.naturalWidth) return { fillPriority: "color", fillPatternImage: undefined }; + return { + fillPriority: "pattern", + fillPatternImage: image, + fillPatternRepeat: "no-repeat", + fillPatternScaleX: width / image.naturalWidth, + fillPatternScaleY: height / image.naturalHeight, + fillPatternOffsetX: centered ? image.naturalWidth / 2 : 0, + fillPatternOffsetY: centered ? image.naturalHeight / 2 : 0, + }; +}; diff --git a/games/breakout/src/just-pressed.ts b/games/breakout/src/just-pressed.ts new file mode 100644 index 0000000..bd8dac9 --- /dev/null +++ b/games/breakout/src/just-pressed.ts @@ -0,0 +1,19 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { InputEnum } from "@nanoforge-dev/input"; + +/** Whether each key was down the last time a system asked. */ +const down = new Map(); + +/** + * Whether `key` went down since the last time a system asked about it. + * + * @remarks + * The state is shared by every system: a key that opens a scene does not also act in that scene + * while it is still held. + */ +export const justPressed = (ctx: Context, key: InputEnum): boolean => { + const now = ctx.input.isKeyPressed(key) === true; + const before = down.get(key) ?? false; + down.set(key, now); + return now && !before; +}; diff --git a/games/breakout/src/level.ts b/games/breakout/src/level.ts new file mode 100644 index 0000000..363ba5a --- /dev/null +++ b/games/breakout/src/level.ts @@ -0,0 +1,19 @@ +import { EcsScene } from "@nanoforge-dev/ecs/scene"; +import type { SceneClass } from "@nanoforge-dev/scene"; + +import { Run } from "./scenes/run.scene"; + +/** + * What every level has: its parent, `Run`, and the level after it. Levels are siblings under + * `Run`: moving to the next one unloads this one (its bricks and its vars) and keeps the paddle, + * the ball, the score and the lives. Each level writes its own bricks in its `setup`. + * + * It is outside `scenes/`, which holds one scene per file, and imports no scene but `Run`: the + * levels extend it when their module is evaluated. + */ +export abstract class Level extends EcsScene { + static override parent = Run; + + /** The level after this one; the last one has none. */ + abstract readonly next: SceneClass | undefined; +} diff --git a/games/breakout/src/main.ts b/games/breakout/src/main.ts new file mode 100644 index 0000000..1a4f779 --- /dev/null +++ b/games/breakout/src/main.ts @@ -0,0 +1,52 @@ +import type { ClientRunOptions } from "@nanoforge-dev/common"; +import { NanoforgeFactory } from "@nanoforge-dev/core"; +import { EcsLibrary } from "@nanoforge-dev/ecs/client"; +import { EditorLibrary } from "@nanoforge-dev/editor-lib"; +import { Graphics2DLibrary } from "@nanoforge-dev/graphics-2d"; +import { InputLibrary } from "@nanoforge-dev/input"; +import { SceneLibrary } from "@nanoforge-dev/scene"; + +import { DrawableRect2D } from "./components/drawable-rect-2d.component"; +import { Position2D } from "./components/position-2d.component"; +import "./scene-vars"; +import { GameOver } from "./scenes/game-over.scene"; +import { Level1 } from "./scenes/level-1.scene"; +import { Level2 } from "./scenes/level-2.scene"; +import { Level3 } from "./scenes/level-3.scene"; +import { Menu } from "./scenes/menu.scene"; +import { Pause } from "./scenes/pause.scene"; +import { Run } from "./scenes/run.scene"; +import { Victory } from "./scenes/victory.scene"; +import { draw2D } from "./systems/draw-2d.system"; + +export const main = async (options: ClientRunOptions): Promise => { + const app = NanoforgeFactory.createClient({ + tickRate: 60, + viewport: { width: 1280, height: 720, fit: "contain" }, + }); + const ecs = new EcsLibrary(); + + app.use(new Graphics2DLibrary()); + app.use(ecs); + app.use(new InputLibrary()); + // Every entity on screen but the background belongs to a scene: the menu loads at the first tick. + app.use( + new SceneLibrary({ + initial: Menu, + scenes: { Menu, Run, Level1, Level2, Level3, Pause, GameOver, Victory }, + }), + ); + app.use(new EditorLibrary()); + + await app.init(options); + + const registry = ecs.registry; + + const background = registry.spawnEntity(); + registry.addComponent(background, new Position2D(0, 0)); + registry.addComponent(background, new DrawableRect2D(1280, 720, "#10141f")); + + registry.addSystem(draw2D); + + await app.run(); +}; diff --git a/games/breakout/src/record-best.ts b/games/breakout/src/record-best.ts new file mode 100644 index 0000000..450e711 --- /dev/null +++ b/games/breakout/src/record-best.ts @@ -0,0 +1,14 @@ +import type { Context } from "@nanoforge-dev/common"; + +/** + * Keeps the best score (a persistent var). + * + * @returns Whether `score` is a new best score. + */ +export const recordBest = (ctx: Context, score: number): boolean => { + const vars = ctx.scenes.vars; + vars.init("best", 0, { persistent: true }); + if (score <= (vars.get("best") ?? 0)) return false; + vars.set("best", score); + return true; +}; diff --git a/games/breakout/src/scene-vars.ts b/games/breakout/src/scene-vars.ts new file mode 100644 index 0000000..161e5bb --- /dev/null +++ b/games/breakout/src/scene-vars.ts @@ -0,0 +1,26 @@ +/** + * The scene vars of the game. A var belongs to the scene that made it, and goes away when that + * scene is unloaded, unless it is persistent. + */ +declare module "@nanoforge-dev/scene" { + interface SceneVars { + /** The best score, kept from one game to the next (persistent). @default 0 */ + best: number; + /** Points of the current game (made by `Run`, and by the end screens to show it). @default 0 */ + score: number; + /** Balls left in the current game (made by `Run`). @default 3 */ + lives: number; + /** Number of the current level, shown in the top bar. @default 1 */ + level: number; + /** Bricks of the level not broken yet. @default 0 */ + bricksLeft: number; + /** Speed of the ball in this level, in pixels per second. @default 450 */ + ballSpeed: number; + /** The ball left the paddle. @default false */ + served: boolean; + /** The pause menu is open: the game's systems wait. @default true */ + paused: boolean; + } +} + +export {}; diff --git a/games/breakout/src/scenes/game-over.scene.ts b/games/breakout/src/scenes/game-over.scene.ts new file mode 100644 index 0000000..84649f3 --- /dev/null +++ b/games/breakout/src/scenes/game-over.scene.ts @@ -0,0 +1,57 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; +import { EcsScene } from "@nanoforge-dev/ecs/scene"; +import type { SceneLoadContext } from "@nanoforge-dev/scene"; + +import { DrawableText2D } from "../components/drawable-text-2d.component"; +import { SceneVarText } from "../components/scene-var-text.component"; +import { Position2D } from "../components/position-2d.component"; +import { recordBest } from "../record-best"; +import { backToMenu } from "../systems/back-to-menu.system"; +import { showSceneVar } from "../systems/show-scene-var.system"; + +/** + * Shown when the last life is lost, with the score and the best score. + * + * It is a root scene: loading it unloads the level and `Run`, whose vars (`score`, `lives`…) + * go with them, so the score comes as a param. + * + * @scene + * @side client + * @vars best, score + */ +export class GameOver extends EcsScene<{ + /** The score of the game that ended. */ + score: number; +}> { + override setup( + registry: Registry, + ctx: Context, + { params }: SceneLoadContext<{ score: number }>, + ) { + const score = params?.score ?? 0; + recordBest(ctx, score); + ctx.scenes.vars.init("score", score); + + const title = registry.spawnEntity(); + registry.addComponent(title, new Position2D(381, 200)); + registry.addComponent(title, new DrawableText2D("Game over", 96, "#eb4d4b", 1, "monospace")); + + const scoreText = registry.spawnEntity(); + registry.addComponent(scoreText, new Position2D(532, 340)); + registry.addComponent(scoreText, new SceneVarText("score", "Score {}")); + registry.addComponent(scoreText, new DrawableText2D("", 40, "#e8ecf8", 1, "monospace")); + + const bestScore = registry.spawnEntity(); + registry.addComponent(bestScore, new Position2D(515, 400)); + registry.addComponent(bestScore, new SceneVarText("best", "Best score {}")); + registry.addComponent(bestScore, new DrawableText2D("", 28, "#f9ca24", 1, "monospace")); + + const prompt = registry.spawnEntity(); + registry.addComponent(prompt, new Position2D(541, 520)); + registry.addComponent(prompt, new DrawableText2D("Press Enter", 30, "#8a93ad", 1, "monospace")); + + registry.addSystem(showSceneVar); + registry.addSystem(backToMenu); + } +} diff --git a/games/breakout/src/scenes/level-1.scene.ts b/games/breakout/src/scenes/level-1.scene.ts new file mode 100644 index 0000000..1a8fe18 --- /dev/null +++ b/games/breakout/src/scenes/level-1.scene.ts @@ -0,0 +1,202 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; + +import { Brick } from "../components/brick.component"; +import { DrawableRect2D } from "../components/drawable-rect-2d.component"; +import { HitboxRect2D } from "../components/hitbox-rect-2d.component"; +import { Position2D } from "../components/position-2d.component"; +import { Wall } from "../components/wall.component"; +import { Level } from "../level"; +import { levelFlow } from "../systems/level-flow.system"; +import { pauseOnEscape } from "../systems/pause-on-escape.system"; +import { Level2 } from "./level-2.scene"; + +/** + * Level 1: three rows that break in one hit. + * + * @scene + * @side client + * @vars level, bricksLeft, ballSpeed, served + */ +export class Level1 extends Level { + readonly next = Level2; + + override setup(registry: Registry, ctx: Context) { + // Owned by the level: gone when the next one is loaded, which makes its own. + ctx.scenes.vars.init("level", 1); + ctx.scenes.vars.init("bricksLeft", 24); + ctx.scenes.vars.init("ballSpeed", 450); + ctx.scenes.vars.init("served", false); + + const brick1 = registry.spawnEntity(); + registry.addComponent(brick1, new Position2D(48, 130)); + registry.addComponent(brick1, new HitboxRect2D(141, 26)); + registry.addComponent(brick1, new Wall()); + registry.addComponent(brick1, new Brick(1, 10)); + registry.addComponent(brick1, new DrawableRect2D(141, 26, "#eb4d4b", "", 1, 0, 4)); + + const brick2 = registry.spawnEntity(); + registry.addComponent(brick2, new Position2D(197, 130)); + registry.addComponent(brick2, new HitboxRect2D(141, 26)); + registry.addComponent(brick2, new Wall()); + registry.addComponent(brick2, new Brick(1, 10)); + registry.addComponent(brick2, new DrawableRect2D(141, 26, "#eb4d4b", "", 1, 0, 4)); + + const brick3 = registry.spawnEntity(); + registry.addComponent(brick3, new Position2D(346, 130)); + registry.addComponent(brick3, new HitboxRect2D(141, 26)); + registry.addComponent(brick3, new Wall()); + registry.addComponent(brick3, new Brick(1, 10)); + registry.addComponent(brick3, new DrawableRect2D(141, 26, "#eb4d4b", "", 1, 0, 4)); + + const brick4 = registry.spawnEntity(); + registry.addComponent(brick4, new Position2D(495, 130)); + registry.addComponent(brick4, new HitboxRect2D(141, 26)); + registry.addComponent(brick4, new Wall()); + registry.addComponent(brick4, new Brick(1, 10)); + registry.addComponent(brick4, new DrawableRect2D(141, 26, "#eb4d4b", "", 1, 0, 4)); + + const brick5 = registry.spawnEntity(); + registry.addComponent(brick5, new Position2D(644, 130)); + registry.addComponent(brick5, new HitboxRect2D(141, 26)); + registry.addComponent(brick5, new Wall()); + registry.addComponent(brick5, new Brick(1, 10)); + registry.addComponent(brick5, new DrawableRect2D(141, 26, "#eb4d4b", "", 1, 0, 4)); + + const brick6 = registry.spawnEntity(); + registry.addComponent(brick6, new Position2D(793, 130)); + registry.addComponent(brick6, new HitboxRect2D(141, 26)); + registry.addComponent(brick6, new Wall()); + registry.addComponent(brick6, new Brick(1, 10)); + registry.addComponent(brick6, new DrawableRect2D(141, 26, "#eb4d4b", "", 1, 0, 4)); + + const brick7 = registry.spawnEntity(); + registry.addComponent(brick7, new Position2D(942, 130)); + registry.addComponent(brick7, new HitboxRect2D(141, 26)); + registry.addComponent(brick7, new Wall()); + registry.addComponent(brick7, new Brick(1, 10)); + registry.addComponent(brick7, new DrawableRect2D(141, 26, "#eb4d4b", "", 1, 0, 4)); + + const brick8 = registry.spawnEntity(); + registry.addComponent(brick8, new Position2D(1091, 130)); + registry.addComponent(brick8, new HitboxRect2D(141, 26)); + registry.addComponent(brick8, new Wall()); + registry.addComponent(brick8, new Brick(1, 10)); + registry.addComponent(brick8, new DrawableRect2D(141, 26, "#eb4d4b", "", 1, 0, 4)); + + const brick9 = registry.spawnEntity(); + registry.addComponent(brick9, new Position2D(48, 164)); + registry.addComponent(brick9, new HitboxRect2D(141, 26)); + registry.addComponent(brick9, new Wall()); + registry.addComponent(brick9, new Brick(1, 10)); + registry.addComponent(brick9, new DrawableRect2D(141, 26, "#f0932b", "", 1, 0, 4)); + + const brick10 = registry.spawnEntity(); + registry.addComponent(brick10, new Position2D(197, 164)); + registry.addComponent(brick10, new HitboxRect2D(141, 26)); + registry.addComponent(brick10, new Wall()); + registry.addComponent(brick10, new Brick(1, 10)); + registry.addComponent(brick10, new DrawableRect2D(141, 26, "#f0932b", "", 1, 0, 4)); + + const brick11 = registry.spawnEntity(); + registry.addComponent(brick11, new Position2D(346, 164)); + registry.addComponent(brick11, new HitboxRect2D(141, 26)); + registry.addComponent(brick11, new Wall()); + registry.addComponent(brick11, new Brick(1, 10)); + registry.addComponent(brick11, new DrawableRect2D(141, 26, "#f0932b", "", 1, 0, 4)); + + const brick12 = registry.spawnEntity(); + registry.addComponent(brick12, new Position2D(495, 164)); + registry.addComponent(brick12, new HitboxRect2D(141, 26)); + registry.addComponent(brick12, new Wall()); + registry.addComponent(brick12, new Brick(1, 10)); + registry.addComponent(brick12, new DrawableRect2D(141, 26, "#f0932b", "", 1, 0, 4)); + + const brick13 = registry.spawnEntity(); + registry.addComponent(brick13, new Position2D(644, 164)); + registry.addComponent(brick13, new HitboxRect2D(141, 26)); + registry.addComponent(brick13, new Wall()); + registry.addComponent(brick13, new Brick(1, 10)); + registry.addComponent(brick13, new DrawableRect2D(141, 26, "#f0932b", "", 1, 0, 4)); + + const brick14 = registry.spawnEntity(); + registry.addComponent(brick14, new Position2D(793, 164)); + registry.addComponent(brick14, new HitboxRect2D(141, 26)); + registry.addComponent(brick14, new Wall()); + registry.addComponent(brick14, new Brick(1, 10)); + registry.addComponent(brick14, new DrawableRect2D(141, 26, "#f0932b", "", 1, 0, 4)); + + const brick15 = registry.spawnEntity(); + registry.addComponent(brick15, new Position2D(942, 164)); + registry.addComponent(brick15, new HitboxRect2D(141, 26)); + registry.addComponent(brick15, new Wall()); + registry.addComponent(brick15, new Brick(1, 10)); + registry.addComponent(brick15, new DrawableRect2D(141, 26, "#f0932b", "", 1, 0, 4)); + + const brick16 = registry.spawnEntity(); + registry.addComponent(brick16, new Position2D(1091, 164)); + registry.addComponent(brick16, new HitboxRect2D(141, 26)); + registry.addComponent(brick16, new Wall()); + registry.addComponent(brick16, new Brick(1, 10)); + registry.addComponent(brick16, new DrawableRect2D(141, 26, "#f0932b", "", 1, 0, 4)); + + const brick17 = registry.spawnEntity(); + registry.addComponent(brick17, new Position2D(48, 198)); + registry.addComponent(brick17, new HitboxRect2D(141, 26)); + registry.addComponent(brick17, new Wall()); + registry.addComponent(brick17, new Brick(1, 10)); + registry.addComponent(brick17, new DrawableRect2D(141, 26, "#f9ca24", "", 1, 0, 4)); + + const brick18 = registry.spawnEntity(); + registry.addComponent(brick18, new Position2D(197, 198)); + registry.addComponent(brick18, new HitboxRect2D(141, 26)); + registry.addComponent(brick18, new Wall()); + registry.addComponent(brick18, new Brick(1, 10)); + registry.addComponent(brick18, new DrawableRect2D(141, 26, "#f9ca24", "", 1, 0, 4)); + + const brick19 = registry.spawnEntity(); + registry.addComponent(brick19, new Position2D(346, 198)); + registry.addComponent(brick19, new HitboxRect2D(141, 26)); + registry.addComponent(brick19, new Wall()); + registry.addComponent(brick19, new Brick(1, 10)); + registry.addComponent(brick19, new DrawableRect2D(141, 26, "#f9ca24", "", 1, 0, 4)); + + const brick20 = registry.spawnEntity(); + registry.addComponent(brick20, new Position2D(495, 198)); + registry.addComponent(brick20, new HitboxRect2D(141, 26)); + registry.addComponent(brick20, new Wall()); + registry.addComponent(brick20, new Brick(1, 10)); + registry.addComponent(brick20, new DrawableRect2D(141, 26, "#f9ca24", "", 1, 0, 4)); + + const brick21 = registry.spawnEntity(); + registry.addComponent(brick21, new Position2D(644, 198)); + registry.addComponent(brick21, new HitboxRect2D(141, 26)); + registry.addComponent(brick21, new Wall()); + registry.addComponent(brick21, new Brick(1, 10)); + registry.addComponent(brick21, new DrawableRect2D(141, 26, "#f9ca24", "", 1, 0, 4)); + + const brick22 = registry.spawnEntity(); + registry.addComponent(brick22, new Position2D(793, 198)); + registry.addComponent(brick22, new HitboxRect2D(141, 26)); + registry.addComponent(brick22, new Wall()); + registry.addComponent(brick22, new Brick(1, 10)); + registry.addComponent(brick22, new DrawableRect2D(141, 26, "#f9ca24", "", 1, 0, 4)); + + const brick23 = registry.spawnEntity(); + registry.addComponent(brick23, new Position2D(942, 198)); + registry.addComponent(brick23, new HitboxRect2D(141, 26)); + registry.addComponent(brick23, new Wall()); + registry.addComponent(brick23, new Brick(1, 10)); + registry.addComponent(brick23, new DrawableRect2D(141, 26, "#f9ca24", "", 1, 0, 4)); + + const brick24 = registry.spawnEntity(); + registry.addComponent(brick24, new Position2D(1091, 198)); + registry.addComponent(brick24, new HitboxRect2D(141, 26)); + registry.addComponent(brick24, new Wall()); + registry.addComponent(brick24, new Brick(1, 10)); + registry.addComponent(brick24, new DrawableRect2D(141, 26, "#f9ca24", "", 1, 0, 4)); + + registry.addSystem(levelFlow); + registry.addSystem(pauseOnEscape); + } +} diff --git a/games/breakout/src/scenes/level-2.scene.ts b/games/breakout/src/scenes/level-2.scene.ts new file mode 100644 index 0000000..e2c65f5 --- /dev/null +++ b/games/breakout/src/scenes/level-2.scene.ts @@ -0,0 +1,174 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; + +import { Brick } from "../components/brick.component"; +import { DrawableRect2D } from "../components/drawable-rect-2d.component"; +import { HitboxRect2D } from "../components/hitbox-rect-2d.component"; +import { Position2D } from "../components/position-2d.component"; +import { Wall } from "../components/wall.component"; +import { Level } from "../level"; +import { levelFlow } from "../systems/level-flow.system"; +import { pauseOnEscape } from "../systems/pause-on-escape.system"; +import { Level3 } from "./level-3.scene"; + +/** + * Level 2: a pyramid, faster. + * + * @scene + * @side client + * @vars level, bricksLeft, ballSpeed, served + */ +export class Level2 extends Level { + readonly next = Level3; + + override setup(registry: Registry, ctx: Context) { + // Owned by the level: gone when the next one is loaded, which makes its own. + ctx.scenes.vars.init("level", 2); + ctx.scenes.vars.init("bricksLeft", 20); + ctx.scenes.vars.init("ballSpeed", 550); + ctx.scenes.vars.init("served", false); + + const brick1 = registry.spawnEntity(); + registry.addComponent(brick1, new Position2D(495, 130)); + registry.addComponent(brick1, new HitboxRect2D(141, 26)); + registry.addComponent(brick1, new Wall()); + registry.addComponent(brick1, new Brick(1, 10)); + registry.addComponent(brick1, new DrawableRect2D(141, 26, "#eb4d4b", "", 1, 0, 4)); + + const brick2 = registry.spawnEntity(); + registry.addComponent(brick2, new Position2D(644, 130)); + registry.addComponent(brick2, new HitboxRect2D(141, 26)); + registry.addComponent(brick2, new Wall()); + registry.addComponent(brick2, new Brick(1, 10)); + registry.addComponent(brick2, new DrawableRect2D(141, 26, "#eb4d4b", "", 1, 0, 4)); + + const brick3 = registry.spawnEntity(); + registry.addComponent(brick3, new Position2D(346, 164)); + registry.addComponent(brick3, new HitboxRect2D(141, 26)); + registry.addComponent(brick3, new Wall()); + registry.addComponent(brick3, new Brick(1, 10)); + registry.addComponent(brick3, new DrawableRect2D(141, 26, "#f0932b", "", 1, 0, 4)); + + const brick4 = registry.spawnEntity(); + registry.addComponent(brick4, new Position2D(495, 164)); + registry.addComponent(brick4, new HitboxRect2D(141, 26)); + registry.addComponent(brick4, new Wall()); + registry.addComponent(brick4, new Brick(1, 10)); + registry.addComponent(brick4, new DrawableRect2D(141, 26, "#f0932b", "", 1, 0, 4)); + + const brick5 = registry.spawnEntity(); + registry.addComponent(brick5, new Position2D(644, 164)); + registry.addComponent(brick5, new HitboxRect2D(141, 26)); + registry.addComponent(brick5, new Wall()); + registry.addComponent(brick5, new Brick(1, 10)); + registry.addComponent(brick5, new DrawableRect2D(141, 26, "#f0932b", "", 1, 0, 4)); + + const brick6 = registry.spawnEntity(); + registry.addComponent(brick6, new Position2D(793, 164)); + registry.addComponent(brick6, new HitboxRect2D(141, 26)); + registry.addComponent(brick6, new Wall()); + registry.addComponent(brick6, new Brick(1, 10)); + registry.addComponent(brick6, new DrawableRect2D(141, 26, "#f0932b", "", 1, 0, 4)); + + const brick7 = registry.spawnEntity(); + registry.addComponent(brick7, new Position2D(197, 198)); + registry.addComponent(brick7, new HitboxRect2D(141, 26)); + registry.addComponent(brick7, new Wall()); + registry.addComponent(brick7, new Brick(1, 10)); + registry.addComponent(brick7, new DrawableRect2D(141, 26, "#f9ca24", "", 1, 0, 4)); + + const brick8 = registry.spawnEntity(); + registry.addComponent(brick8, new Position2D(346, 198)); + registry.addComponent(brick8, new HitboxRect2D(141, 26)); + registry.addComponent(brick8, new Wall()); + registry.addComponent(brick8, new Brick(1, 10)); + registry.addComponent(brick8, new DrawableRect2D(141, 26, "#f9ca24", "", 1, 0, 4)); + + const brick9 = registry.spawnEntity(); + registry.addComponent(brick9, new Position2D(495, 198)); + registry.addComponent(brick9, new HitboxRect2D(141, 26)); + registry.addComponent(brick9, new Wall()); + registry.addComponent(brick9, new Brick(1, 10)); + registry.addComponent(brick9, new DrawableRect2D(141, 26, "#f9ca24", "", 1, 0, 4)); + + const brick10 = registry.spawnEntity(); + registry.addComponent(brick10, new Position2D(644, 198)); + registry.addComponent(brick10, new HitboxRect2D(141, 26)); + registry.addComponent(brick10, new Wall()); + registry.addComponent(brick10, new Brick(1, 10)); + registry.addComponent(brick10, new DrawableRect2D(141, 26, "#f9ca24", "", 1, 0, 4)); + + const brick11 = registry.spawnEntity(); + registry.addComponent(brick11, new Position2D(793, 198)); + registry.addComponent(brick11, new HitboxRect2D(141, 26)); + registry.addComponent(brick11, new Wall()); + registry.addComponent(brick11, new Brick(1, 10)); + registry.addComponent(brick11, new DrawableRect2D(141, 26, "#f9ca24", "", 1, 0, 4)); + + const brick12 = registry.spawnEntity(); + registry.addComponent(brick12, new Position2D(942, 198)); + registry.addComponent(brick12, new HitboxRect2D(141, 26)); + registry.addComponent(brick12, new Wall()); + registry.addComponent(brick12, new Brick(1, 10)); + registry.addComponent(brick12, new DrawableRect2D(141, 26, "#f9ca24", "", 1, 0, 4)); + + const brick13 = registry.spawnEntity(); + registry.addComponent(brick13, new Position2D(48, 232)); + registry.addComponent(brick13, new HitboxRect2D(141, 26)); + registry.addComponent(brick13, new Wall()); + registry.addComponent(brick13, new Brick(1, 10)); + registry.addComponent(brick13, new DrawableRect2D(141, 26, "#6ab04c", "", 1, 0, 4)); + + const brick14 = registry.spawnEntity(); + registry.addComponent(brick14, new Position2D(197, 232)); + registry.addComponent(brick14, new HitboxRect2D(141, 26)); + registry.addComponent(brick14, new Wall()); + registry.addComponent(brick14, new Brick(1, 10)); + registry.addComponent(brick14, new DrawableRect2D(141, 26, "#6ab04c", "", 1, 0, 4)); + + const brick15 = registry.spawnEntity(); + registry.addComponent(brick15, new Position2D(346, 232)); + registry.addComponent(brick15, new HitboxRect2D(141, 26)); + registry.addComponent(brick15, new Wall()); + registry.addComponent(brick15, new Brick(1, 10)); + registry.addComponent(brick15, new DrawableRect2D(141, 26, "#6ab04c", "", 1, 0, 4)); + + const brick16 = registry.spawnEntity(); + registry.addComponent(brick16, new Position2D(495, 232)); + registry.addComponent(brick16, new HitboxRect2D(141, 26)); + registry.addComponent(brick16, new Wall()); + registry.addComponent(brick16, new Brick(1, 10)); + registry.addComponent(brick16, new DrawableRect2D(141, 26, "#6ab04c", "", 1, 0, 4)); + + const brick17 = registry.spawnEntity(); + registry.addComponent(brick17, new Position2D(644, 232)); + registry.addComponent(brick17, new HitboxRect2D(141, 26)); + registry.addComponent(brick17, new Wall()); + registry.addComponent(brick17, new Brick(1, 10)); + registry.addComponent(brick17, new DrawableRect2D(141, 26, "#6ab04c", "", 1, 0, 4)); + + const brick18 = registry.spawnEntity(); + registry.addComponent(brick18, new Position2D(793, 232)); + registry.addComponent(brick18, new HitboxRect2D(141, 26)); + registry.addComponent(brick18, new Wall()); + registry.addComponent(brick18, new Brick(1, 10)); + registry.addComponent(brick18, new DrawableRect2D(141, 26, "#6ab04c", "", 1, 0, 4)); + + const brick19 = registry.spawnEntity(); + registry.addComponent(brick19, new Position2D(942, 232)); + registry.addComponent(brick19, new HitboxRect2D(141, 26)); + registry.addComponent(brick19, new Wall()); + registry.addComponent(brick19, new Brick(1, 10)); + registry.addComponent(brick19, new DrawableRect2D(141, 26, "#6ab04c", "", 1, 0, 4)); + + const brick20 = registry.spawnEntity(); + registry.addComponent(brick20, new Position2D(1091, 232)); + registry.addComponent(brick20, new HitboxRect2D(141, 26)); + registry.addComponent(brick20, new Wall()); + registry.addComponent(brick20, new Brick(1, 10)); + registry.addComponent(brick20, new DrawableRect2D(141, 26, "#6ab04c", "", 1, 0, 4)); + + registry.addSystem(levelFlow); + registry.addSystem(pauseOnEscape); + } +} diff --git a/games/breakout/src/scenes/level-3.scene.ts b/games/breakout/src/scenes/level-3.scene.ts new file mode 100644 index 0000000..f89fda7 --- /dev/null +++ b/games/breakout/src/scenes/level-3.scene.ts @@ -0,0 +1,201 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; + +import { Brick } from "../components/brick.component"; +import { DrawableRect2D } from "../components/drawable-rect-2d.component"; +import { HitboxRect2D } from "../components/hitbox-rect-2d.component"; +import { Position2D } from "../components/position-2d.component"; +import { Wall } from "../components/wall.component"; +import { Level } from "../level"; +import { levelFlow } from "../systems/level-flow.system"; +import { pauseOnEscape } from "../systems/pause-on-escape.system"; + +/** + * Level 3: bricks that take two hits, faster still. The last level. + * + * @scene + * @side client + * @vars level, bricksLeft, ballSpeed, served + */ +export class Level3 extends Level { + readonly next = undefined; + + override setup(registry: Registry, ctx: Context) { + // Owned by the level: gone when the next one is loaded, which makes its own. + ctx.scenes.vars.init("level", 3); + ctx.scenes.vars.init("bricksLeft", 24); + ctx.scenes.vars.init("ballSpeed", 650); + ctx.scenes.vars.init("served", false); + + const brick1 = registry.spawnEntity(); + registry.addComponent(brick1, new Position2D(48, 130)); + registry.addComponent(brick1, new HitboxRect2D(141, 26)); + registry.addComponent(brick1, new Wall()); + registry.addComponent(brick1, new Brick(2, 20)); + registry.addComponent(brick1, new DrawableRect2D(141, 26, "#eb4d4b", "", 1, 0, 0)); + + const brick2 = registry.spawnEntity(); + registry.addComponent(brick2, new Position2D(197, 130)); + registry.addComponent(brick2, new HitboxRect2D(141, 26)); + registry.addComponent(brick2, new Wall()); + registry.addComponent(brick2, new Brick(2, 20)); + registry.addComponent(brick2, new DrawableRect2D(141, 26, "#eb4d4b", "", 1, 0, 0)); + + const brick3 = registry.spawnEntity(); + registry.addComponent(brick3, new Position2D(346, 130)); + registry.addComponent(brick3, new HitboxRect2D(141, 26)); + registry.addComponent(brick3, new Wall()); + registry.addComponent(brick3, new Brick(2, 20)); + registry.addComponent(brick3, new DrawableRect2D(141, 26, "#eb4d4b", "", 1, 0, 0)); + + const brick4 = registry.spawnEntity(); + registry.addComponent(brick4, new Position2D(495, 130)); + registry.addComponent(brick4, new HitboxRect2D(141, 26)); + registry.addComponent(brick4, new Wall()); + registry.addComponent(brick4, new Brick(2, 20)); + registry.addComponent(brick4, new DrawableRect2D(141, 26, "#eb4d4b", "", 1, 0, 0)); + + const brick5 = registry.spawnEntity(); + registry.addComponent(brick5, new Position2D(644, 130)); + registry.addComponent(brick5, new HitboxRect2D(141, 26)); + registry.addComponent(brick5, new Wall()); + registry.addComponent(brick5, new Brick(2, 20)); + registry.addComponent(brick5, new DrawableRect2D(141, 26, "#eb4d4b", "", 1, 0, 0)); + + const brick6 = registry.spawnEntity(); + registry.addComponent(brick6, new Position2D(793, 130)); + registry.addComponent(brick6, new HitboxRect2D(141, 26)); + registry.addComponent(brick6, new Wall()); + registry.addComponent(brick6, new Brick(2, 20)); + registry.addComponent(brick6, new DrawableRect2D(141, 26, "#eb4d4b", "", 1, 0, 0)); + + const brick7 = registry.spawnEntity(); + registry.addComponent(brick7, new Position2D(942, 130)); + registry.addComponent(brick7, new HitboxRect2D(141, 26)); + registry.addComponent(brick7, new Wall()); + registry.addComponent(brick7, new Brick(2, 20)); + registry.addComponent(brick7, new DrawableRect2D(141, 26, "#eb4d4b", "", 1, 0, 0)); + + const brick8 = registry.spawnEntity(); + registry.addComponent(brick8, new Position2D(1091, 130)); + registry.addComponent(brick8, new HitboxRect2D(141, 26)); + registry.addComponent(brick8, new Wall()); + registry.addComponent(brick8, new Brick(2, 20)); + registry.addComponent(brick8, new DrawableRect2D(141, 26, "#eb4d4b", "", 1, 0, 0)); + + const brick9 = registry.spawnEntity(); + registry.addComponent(brick9, new Position2D(48, 164)); + registry.addComponent(brick9, new HitboxRect2D(141, 26)); + registry.addComponent(brick9, new Wall()); + registry.addComponent(brick9, new Brick(1, 10)); + registry.addComponent(brick9, new DrawableRect2D(141, 26, "#f0932b", "", 1, 0, 4)); + + const brick10 = registry.spawnEntity(); + registry.addComponent(brick10, new Position2D(346, 164)); + registry.addComponent(brick10, new HitboxRect2D(141, 26)); + registry.addComponent(brick10, new Wall()); + registry.addComponent(brick10, new Brick(1, 10)); + registry.addComponent(brick10, new DrawableRect2D(141, 26, "#f0932b", "", 1, 0, 4)); + + const brick11 = registry.spawnEntity(); + registry.addComponent(brick11, new Position2D(793, 164)); + registry.addComponent(brick11, new HitboxRect2D(141, 26)); + registry.addComponent(brick11, new Wall()); + registry.addComponent(brick11, new Brick(1, 10)); + registry.addComponent(brick11, new DrawableRect2D(141, 26, "#f0932b", "", 1, 0, 4)); + + const brick12 = registry.spawnEntity(); + registry.addComponent(brick12, new Position2D(1091, 164)); + registry.addComponent(brick12, new HitboxRect2D(141, 26)); + registry.addComponent(brick12, new Wall()); + registry.addComponent(brick12, new Brick(1, 10)); + registry.addComponent(brick12, new DrawableRect2D(141, 26, "#f0932b", "", 1, 0, 4)); + + const brick13 = registry.spawnEntity(); + registry.addComponent(brick13, new Position2D(48, 198)); + registry.addComponent(brick13, new HitboxRect2D(141, 26)); + registry.addComponent(brick13, new Wall()); + registry.addComponent(brick13, new Brick(2, 20)); + registry.addComponent(brick13, new DrawableRect2D(141, 26, "#f9ca24", "", 1, 0, 0)); + + const brick14 = registry.spawnEntity(); + registry.addComponent(brick14, new Position2D(197, 198)); + registry.addComponent(brick14, new HitboxRect2D(141, 26)); + registry.addComponent(brick14, new Wall()); + registry.addComponent(brick14, new Brick(1, 10)); + registry.addComponent(brick14, new DrawableRect2D(141, 26, "#f9ca24", "", 1, 0, 4)); + + const brick15 = registry.spawnEntity(); + registry.addComponent(brick15, new Position2D(346, 198)); + registry.addComponent(brick15, new HitboxRect2D(141, 26)); + registry.addComponent(brick15, new Wall()); + registry.addComponent(brick15, new Brick(2, 20)); + registry.addComponent(brick15, new DrawableRect2D(141, 26, "#f9ca24", "", 1, 0, 0)); + + const brick16 = registry.spawnEntity(); + registry.addComponent(brick16, new Position2D(495, 198)); + registry.addComponent(brick16, new HitboxRect2D(141, 26)); + registry.addComponent(brick16, new Wall()); + registry.addComponent(brick16, new Brick(1, 10)); + registry.addComponent(brick16, new DrawableRect2D(141, 26, "#f9ca24", "", 1, 0, 4)); + + const brick17 = registry.spawnEntity(); + registry.addComponent(brick17, new Position2D(644, 198)); + registry.addComponent(brick17, new HitboxRect2D(141, 26)); + registry.addComponent(brick17, new Wall()); + registry.addComponent(brick17, new Brick(1, 10)); + registry.addComponent(brick17, new DrawableRect2D(141, 26, "#f9ca24", "", 1, 0, 4)); + + const brick18 = registry.spawnEntity(); + registry.addComponent(brick18, new Position2D(793, 198)); + registry.addComponent(brick18, new HitboxRect2D(141, 26)); + registry.addComponent(brick18, new Wall()); + registry.addComponent(brick18, new Brick(2, 20)); + registry.addComponent(brick18, new DrawableRect2D(141, 26, "#f9ca24", "", 1, 0, 0)); + + const brick19 = registry.spawnEntity(); + registry.addComponent(brick19, new Position2D(942, 198)); + registry.addComponent(brick19, new HitboxRect2D(141, 26)); + registry.addComponent(brick19, new Wall()); + registry.addComponent(brick19, new Brick(1, 10)); + registry.addComponent(brick19, new DrawableRect2D(141, 26, "#f9ca24", "", 1, 0, 4)); + + const brick20 = registry.spawnEntity(); + registry.addComponent(brick20, new Position2D(1091, 198)); + registry.addComponent(brick20, new HitboxRect2D(141, 26)); + registry.addComponent(brick20, new Wall()); + registry.addComponent(brick20, new Brick(2, 20)); + registry.addComponent(brick20, new DrawableRect2D(141, 26, "#f9ca24", "", 1, 0, 0)); + + const brick21 = registry.spawnEntity(); + registry.addComponent(brick21, new Position2D(48, 232)); + registry.addComponent(brick21, new HitboxRect2D(141, 26)); + registry.addComponent(brick21, new Wall()); + registry.addComponent(brick21, new Brick(2, 20)); + registry.addComponent(brick21, new DrawableRect2D(141, 26, "#6ab04c", "", 1, 0, 0)); + + const brick22 = registry.spawnEntity(); + registry.addComponent(brick22, new Position2D(346, 232)); + registry.addComponent(brick22, new HitboxRect2D(141, 26)); + registry.addComponent(brick22, new Wall()); + registry.addComponent(brick22, new Brick(2, 20)); + registry.addComponent(brick22, new DrawableRect2D(141, 26, "#6ab04c", "", 1, 0, 0)); + + const brick23 = registry.spawnEntity(); + registry.addComponent(brick23, new Position2D(793, 237)); + registry.addComponent(brick23, new HitboxRect2D(141, 26)); + registry.addComponent(brick23, new Wall()); + registry.addComponent(brick23, new Brick(2, 20)); + registry.addComponent(brick23, new DrawableRect2D(141, 26, "#6ab04c", "", 1, 0, 0)); + + const brick24 = registry.spawnEntity(); + registry.addComponent(brick24, new Position2D(1091, 232)); + registry.addComponent(brick24, new HitboxRect2D(141, 26)); + registry.addComponent(brick24, new Wall()); + registry.addComponent(brick24, new Brick(2, 20)); + registry.addComponent(brick24, new DrawableRect2D(141, 26, "#6ab04c", "", 1, 0, 0)); + + registry.addSystem(levelFlow); + registry.addSystem(pauseOnEscape); + } +} diff --git a/games/breakout/src/scenes/menu.scene.ts b/games/breakout/src/scenes/menu.scene.ts new file mode 100644 index 0000000..4b5c318 --- /dev/null +++ b/games/breakout/src/scenes/menu.scene.ts @@ -0,0 +1,49 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; +import { EcsScene } from "@nanoforge-dev/ecs/scene"; + +import { DrawableText2D } from "../components/drawable-text-2d.component"; +import { SceneVarText } from "../components/scene-var-text.component"; +import { Position2D } from "../components/position-2d.component"; +import { startOnEnter } from "../systems/start-on-enter.system"; +import { showSceneVar } from "../systems/show-scene-var.system"; + +/** + * The title screen. Enter starts a game at level 1, which loads `Run` first. + * + * @scene + * @side client + * @vars best + */ +export class Menu extends EcsScene { + override setup(registry: Registry, ctx: Context) { + // Persistent: kept from one game to the next, while every other var goes with its scene. + ctx.scenes.vars.init("best", 0, { persistent: true }); + + const title = registry.spawnEntity(); + registry.addComponent(title, new Position2D(376, 170)); + registry.addComponent(title, new DrawableText2D("BREAKOUT", 110, "#4aa3ff", 1, "monospace")); + + const prompt = registry.spawnEntity(); + registry.addComponent(prompt, new Position2D(435, 360)); + registry.addComponent( + prompt, + new DrawableText2D("Press Enter to play", 36, "#e8ecf8", 1, "monospace"), + ); + + const bestScore = registry.spawnEntity(); + registry.addComponent(bestScore, new Position2D(515, 430)); + registry.addComponent(bestScore, new SceneVarText("best", "Best score {}")); + registry.addComponent(bestScore, new DrawableText2D("", 28, "#f9ca24", 1, "monospace")); + + const keys = registry.spawnEntity(); + registry.addComponent(keys, new Position2D(395, 600)); + registry.addComponent( + keys, + new DrawableText2D("← → move Space serve Esc pause", 24, "#8a93ad", 1, "monospace"), + ); + + registry.addSystem(startOnEnter); + registry.addSystem(showSceneVar); + } +} diff --git a/games/breakout/src/scenes/pause.scene.ts b/games/breakout/src/scenes/pause.scene.ts new file mode 100644 index 0000000..9d5adab --- /dev/null +++ b/games/breakout/src/scenes/pause.scene.ts @@ -0,0 +1,40 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; +import { EcsScene } from "@nanoforge-dev/ecs/scene"; + +import { DrawableRect2D } from "../components/drawable-rect-2d.component"; +import { DrawableText2D } from "../components/drawable-text-2d.component"; +import { Position2D } from "../components/position-2d.component"; +import { pauseMenu } from "../systems/pause-menu.system"; + +/** + * The pause menu. It has no parent of its own: it is loaded over the current level + * (`parent: "current"`), so unloading it goes back to that level as it was. + * + * @scene + * @side client + * @vars paused + */ +export class Pause extends EcsScene { + override setup(registry: Registry, ctx: Context) { + // The game's systems stop while it exists, and it goes with this scene. + ctx.scenes.vars.init("paused", true); + + const shade = registry.spawnEntity(); + registry.addComponent(shade, new Position2D(0, 0)); + registry.addComponent(shade, new DrawableRect2D(1280, 720, "rgba(8, 10, 18, 0.72)")); + + const title = registry.spawnEntity(); + registry.addComponent(title, new Position2D(510, 250)); + registry.addComponent(title, new DrawableText2D("Paused", 72, "#e8ecf8", 1, "monospace")); + + const keys = registry.spawnEntity(); + registry.addComponent(keys, new Position2D(316, 370)); + registry.addComponent( + keys, + new DrawableText2D("Esc resume Q quit to the menu", 30, "#8a93ad", 1, "monospace"), + ); + + registry.addSystem(pauseMenu); + } +} diff --git a/games/breakout/src/scenes/run.scene.ts b/games/breakout/src/scenes/run.scene.ts new file mode 100644 index 0000000..f43503d --- /dev/null +++ b/games/breakout/src/scenes/run.scene.ts @@ -0,0 +1,96 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; +import { EcsScene } from "@nanoforge-dev/ecs/scene"; + +import { Ball } from "../components/ball.component"; +import { DrawableRect2D } from "../components/drawable-rect-2d.component"; +import { DrawableText2D } from "../components/drawable-text-2d.component"; +import { HitboxRect2D } from "../components/hitbox-rect-2d.component"; +import { SceneVarText } from "../components/scene-var-text.component"; +import { MoveController2D } from "../components/move-controller-2d.component"; +import { Paddle } from "../components/paddle.component"; +import { Position2D } from "../components/position-2d.component"; +import { Velocity2D } from "../components/velocity-2d.component"; +import { Wall } from "../components/wall.component"; +import { breakBricks } from "../systems/break-bricks.system"; +import { collide } from "../systems/collide.system"; +import { controlPaddle } from "../systems/control-paddle.system"; +import { holdBall } from "../systems/hold-ball.system"; +import { loseBall } from "../systems/lose-ball.system"; +import { moveAll } from "../systems/move-all.system"; +import { showSceneVar } from "../systems/show-scene-var.system"; + +/** + * A game, from the first level to the last or to the last life: the walls, the paddle, the ball + * and the top bar. The levels are loaded under it, so they keep the paddle, the ball, the score + * and the lives. + * + * It must not import a level (or anything that does): the levels name it as their parent when + * their module is evaluated. + * + * @scene + * @side client + * @vars score, lives + */ +export class Run extends EcsScene { + override setup(registry: Registry, ctx: Context) { + ctx.scenes.vars.init("score", 0); + ctx.scenes.vars.init("lives", 3); + + const topBar = registry.spawnEntity(); + registry.addComponent(topBar, new Position2D(0, 0)); + registry.addComponent(topBar, new HitboxRect2D(1280, 90)); + registry.addComponent(topBar, new Wall()); + registry.addComponent(topBar, new DrawableRect2D(1280, 80, "#1b2133")); + + const leftWall = registry.spawnEntity(); + registry.addComponent(leftWall, new Position2D(0, 80)); + registry.addComponent(leftWall, new HitboxRect2D(40, 640)); + registry.addComponent(leftWall, new Wall()); + registry.addComponent(leftWall, new DrawableRect2D(40, 640, "#2a3350")); + + const rightWall = registry.spawnEntity(); + registry.addComponent(rightWall, new Position2D(1240, 80)); + registry.addComponent(rightWall, new HitboxRect2D(40, 640)); + registry.addComponent(rightWall, new Wall()); + registry.addComponent(rightWall, new DrawableRect2D(40, 640, "#2a3350")); + + const score = registry.spawnEntity(); + registry.addComponent(score, new Position2D(60, 28)); + registry.addComponent(score, new SceneVarText("score", "Score {}")); + registry.addComponent(score, new DrawableText2D("", 30, "#e8ecf8", 1, "monospace")); + + const level = registry.spawnEntity(); + registry.addComponent(level, new Position2D(577, 28)); + registry.addComponent(level, new SceneVarText("level", "Level {}")); + registry.addComponent(level, new DrawableText2D("", 30, "#e8ecf8", 1, "monospace")); + + const lives = registry.spawnEntity(); + registry.addComponent(lives, new Position2D(1094, 28)); + registry.addComponent(lives, new SceneVarText("lives", "Lives {}")); + registry.addComponent(lives, new DrawableText2D("", 30, "#e8ecf8", 1, "monospace")); + + const paddle = registry.spawnEntity(); + registry.addComponent(paddle, new Position2D(560, 660)); + registry.addComponent(paddle, new Velocity2D(0, 0)); + registry.addComponent(paddle, new HitboxRect2D(160, 18)); + registry.addComponent(paddle, new Paddle(0, -1, 60, 1)); + registry.addComponent(paddle, new MoveController2D(900, "horizontal")); + registry.addComponent(paddle, new DrawableRect2D(160, 18, "#4aa3ff", "", 1, 0, 6)); + + const ball = registry.spawnEntity(); + registry.addComponent(ball, new Position2D(631, 640)); + registry.addComponent(ball, new Velocity2D(0, 0)); + registry.addComponent(ball, new HitboxRect2D(18, 18)); + registry.addComponent(ball, new Ball()); + registry.addComponent(ball, new DrawableRect2D(18, 18, "#ffffff", "", 1, 0, 9)); + + registry.addSystem(controlPaddle); + registry.addSystem(moveAll); + registry.addSystem(collide); + registry.addSystem(holdBall); + registry.addSystem(breakBricks); + registry.addSystem(loseBall); + registry.addSystem(showSceneVar); + } +} diff --git a/games/breakout/src/scenes/victory.scene.ts b/games/breakout/src/scenes/victory.scene.ts new file mode 100644 index 0000000..7de660f --- /dev/null +++ b/games/breakout/src/scenes/victory.scene.ts @@ -0,0 +1,57 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; +import { EcsScene } from "@nanoforge-dev/ecs/scene"; +import type { SceneLoadContext } from "@nanoforge-dev/scene"; + +import { DrawableText2D } from "../components/drawable-text-2d.component"; +import { SceneVarText } from "../components/scene-var-text.component"; +import { Position2D } from "../components/position-2d.component"; +import { recordBest } from "../record-best"; +import { backToMenu } from "../systems/back-to-menu.system"; +import { showSceneVar } from "../systems/show-scene-var.system"; + +/** + * Shown when the last level is cleared, with the score and the best score. + * + * It is a root scene: loading it unloads the level and `Run`, whose vars (`score`, `lives`…) + * go with them, so the score comes as a param. + * + * @scene + * @side client + * @vars best, score + */ +export class Victory extends EcsScene<{ + /** The score of the game that ended. */ + score: number; +}> { + override setup( + registry: Registry, + ctx: Context, + { params }: SceneLoadContext<{ score: number }>, + ) { + const score = params?.score ?? 0; + recordBest(ctx, score); + ctx.scenes.vars.init("score", score); + + const title = registry.spawnEntity(); + registry.addComponent(title, new Position2D(410, 200)); + registry.addComponent(title, new DrawableText2D("You win!", 96, "#6ab04c", 1, "monospace")); + + const scoreText = registry.spawnEntity(); + registry.addComponent(scoreText, new Position2D(532, 340)); + registry.addComponent(scoreText, new SceneVarText("score", "Score {}")); + registry.addComponent(scoreText, new DrawableText2D("", 40, "#e8ecf8", 1, "monospace")); + + const bestScore = registry.spawnEntity(); + registry.addComponent(bestScore, new Position2D(515, 400)); + registry.addComponent(bestScore, new SceneVarText("best", "Best score {}")); + registry.addComponent(bestScore, new DrawableText2D("", 28, "#f9ca24", 1, "monospace")); + + const prompt = registry.spawnEntity(); + registry.addComponent(prompt, new Position2D(541, 520)); + registry.addComponent(prompt, new DrawableText2D("Press Enter", 30, "#8a93ad", 1, "monospace")); + + registry.addSystem(showSceneVar); + registry.addSystem(backToMenu); + } +} diff --git a/games/breakout/src/systems/back-to-menu.system.ts b/games/breakout/src/systems/back-to-menu.system.ts new file mode 100644 index 0000000..65fb9eb --- /dev/null +++ b/games/breakout/src/systems/back-to-menu.system.ts @@ -0,0 +1,16 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; +import { InputEnum } from "@nanoforge-dev/input"; + +import { justPressed } from "../just-pressed"; +import { Menu } from "../scenes/menu.scene"; + +/** + * Goes back to the menu when Enter is pressed (the end screens). + * + * @system + * @side client + */ +export const backToMenu = (_registry: Registry, ctx: Context) => { + if (justPressed(ctx, InputEnum.Enter)) void ctx.scenes.load(ctx, Menu); +}; diff --git a/games/breakout/src/systems/block-paddles.system.ts b/games/breakout/src/systems/block-paddles.system.ts new file mode 100644 index 0000000..434c715 --- /dev/null +++ b/games/breakout/src/systems/block-paddles.system.ts @@ -0,0 +1,28 @@ +import type { Registry } from "@nanoforge-dev/ecs"; + +import { overlap, pushOut } from "../collisions"; +import { HitboxRect2D } from "../components/hitbox-rect-2d.component"; +import { Paddle } from "../components/paddle.component"; +import { Position2D } from "../components/position-2d.component"; +import { Velocity2D } from "../components/velocity-2d.component"; +import { Wall } from "../components/wall.component"; + +/** + * Stops each `Paddle` at the `Wall` entities: pushed out of them, and stopped on that axis. Add it + * after `move2D`. + * + * @system + * @side shared + */ +export const blockPaddles = (registry: Registry) => { + const walls = registry.getZipper([Wall, Position2D, HitboxRect2D]); + + registry + .getZipper([Paddle, Position2D, Velocity2D, HitboxRect2D]) + .forEach(({ Position2D: paddle, Velocity2D: velocity, HitboxRect2D: box }) => { + for (const { Position2D, HitboxRect2D } of walls) { + if (overlap(paddle, box, Position2D, HitboxRect2D)) + pushOut(paddle, box, velocity, Position2D, HitboxRect2D, false); + } + }); +}; diff --git a/games/breakout/src/systems/bounce-ball.system.ts b/games/breakout/src/systems/bounce-ball.system.ts new file mode 100644 index 0000000..3dd79f5 --- /dev/null +++ b/games/breakout/src/systems/bounce-ball.system.ts @@ -0,0 +1,65 @@ +import type { Registry } from "@nanoforge-dev/ecs"; + +import { overlap, pushOut } from "../collisions"; +import { Ball } from "../components/ball.component"; +import { HitboxRect2D } from "../components/hitbox-rect-2d.component"; +import { Paddle } from "../components/paddle.component"; +import { Position2D } from "../components/position-2d.component"; +import { Velocity2D } from "../components/velocity-2d.component"; +import { Wall } from "../components/wall.component"; + +/** + * Bounces each `Ball` off the `Paddle` it moves into, or else off the first `Wall` it touches. + * Add it after `move2D`. + * + * @remarks + * Off a paddle, the ball leaves in the paddle's direction, turned toward the end it hit, up to + * the paddle's `maxAngle`, and `speedUp` times faster, up to its `maxSpeed` (a ball already + * faster keeps its speed). Off a wall, it goes back on the axis it went in the least, and the + * wall counts a hit. + * + * @system + * @side shared + */ +export const bounceBall = (registry: Registry) => { + const paddles = registry.getZipper([Paddle, Position2D, HitboxRect2D]); + const walls = registry.getZipper([Wall, Position2D, HitboxRect2D]); + + registry + .getZipper([Ball, Position2D, Velocity2D, HitboxRect2D]) + .forEach(({ Position2D: ball, Velocity2D: velocity, HitboxRect2D: box }) => { + const hit = paddles.find( + ({ Paddle: paddle, Position2D, HitboxRect2D }) => + velocity.x * paddle.normalX + velocity.y * paddle.normalY < 0 && + overlap(ball, box, Position2D, HitboxRect2D), + ); + if (hit) { + const { Paddle: paddle, Position2D: at, HitboxRect2D: size } = hit; + // Along the paddle: its normal turned a quarter clockwise. + const alongX = -paddle.normalY; + const alongY = paddle.normalX; + const length = Math.abs(alongX) * size.width + Math.abs(alongY) * size.height; + const offset = + (alongX * (ball.x + box.width / 2 - at.x - size.width / 2) + + alongY * (ball.y + box.height / 2 - at.y - size.height / 2)) / + (length / 2); + const angle = (Math.max(-1, Math.min(1, offset)) * paddle.maxAngle * Math.PI) / 180; + const before = Math.hypot(velocity.x, velocity.y); + const speed = Math.min(before * paddle.speedUp, Math.max(before, paddle.maxSpeed)); + velocity.x = speed * (paddle.normalX * Math.cos(angle) + alongX * Math.sin(angle)); + velocity.y = speed * (paddle.normalY * Math.cos(angle) + alongY * Math.sin(angle)); + if (paddle.normalX > 0) ball.x = at.x + size.width; + if (paddle.normalX < 0) ball.x = at.x - box.width; + if (paddle.normalY > 0) ball.y = at.y + size.height; + if (paddle.normalY < 0) ball.y = at.y - box.height; + return; + } + + const wall = walls.find(({ Position2D, HitboxRect2D }) => + overlap(ball, box, Position2D, HitboxRect2D), + ); + if (!wall) return; + pushOut(ball, box, velocity, wall.Position2D, wall.HitboxRect2D, true); + wall.Wall.hits++; + }); +}; diff --git a/games/breakout/src/systems/break-bricks.system.ts b/games/breakout/src/systems/break-bricks.system.ts new file mode 100644 index 0000000..b844d13 --- /dev/null +++ b/games/breakout/src/systems/break-bricks.system.ts @@ -0,0 +1,33 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; + +import { Brick } from "../components/brick.component"; +import { DrawableRect2D } from "../components/drawable-rect-2d.component"; +import { Wall } from "../components/wall.component"; + +/** + * Takes a hit from each brick the ball bounced off. A hit brick fades; a broken one disappears, + * stops the ball no more, adds its points to `score` and takes one from `bricksLeft`. + * + * @system + * @side client + */ +export const breakBricks = (registry: Registry, ctx: Context) => { + const vars = ctx.scenes.vars; + + registry + .getIndexedZipper([Brick, Wall, DrawableRect2D]) + .forEach(({ id, Brick: brick, Wall: wall, DrawableRect2D: look }) => { + if (wall.hits === 0) return; + brick.hits -= wall.hits; + wall.hits = 0; + if (brick.hits > 0) { + look.opacity = 0.55; + return; + } + look.visible = false; + registry.removeComponent(registry.entityFromIndex(id), Wall); + vars.set("score", (vars.get("score") ?? 0) + brick.points); + vars.set("bricksLeft", (vars.get("bricksLeft") ?? 1) - 1); + }); +}; diff --git a/games/breakout/src/systems/collide.system.ts b/games/breakout/src/systems/collide.system.ts new file mode 100644 index 0000000..f92259b --- /dev/null +++ b/games/breakout/src/systems/collide.system.ts @@ -0,0 +1,18 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; + +import { blockPaddles } from "./block-paddles.system"; +import { bounceBall } from "./bounce-ball.system"; + +/** + * Stops the paddle at the walls (`blockPaddles`) and bounces the ball off the paddle, the walls + * and the bricks (`bounceBall`), unless the game is paused. + * + * @system + * @side client + */ +export const collide = (registry: Registry, ctx: Context) => { + if (ctx.scenes.vars.has("paused")) return; + blockPaddles(registry); + bounceBall(registry); +}; diff --git a/games/breakout/src/systems/control-paddle.system.ts b/games/breakout/src/systems/control-paddle.system.ts new file mode 100644 index 0000000..a62f196 --- /dev/null +++ b/games/breakout/src/systems/control-paddle.system.ts @@ -0,0 +1,15 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; + +import { moveControl2D } from "./move-control-2d.system"; + +/** + * Moves the paddle with the left and right arrows (`moveControl2D`), unless the game is paused. + * + * @system + * @side client + */ +export const controlPaddle = (registry: Registry, ctx: Context) => { + if (ctx.scenes.vars.has("paused")) return; + moveControl2D(registry, ctx); +}; diff --git a/games/breakout/src/systems/draw-2d.system.ts b/games/breakout/src/systems/draw-2d.system.ts new file mode 100644 index 0000000..937eeeb --- /dev/null +++ b/games/breakout/src/systems/draw-2d.system.ts @@ -0,0 +1,45 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; +import "@nanoforge-dev/graphics-2d"; +import { Position2D } from "../components/position-2d.component"; + +import { DrawableCircle2D } from "../components/drawable-circle-2d.component"; +import { DrawableRect2D } from "../components/drawable-rect-2d.component"; +import { DrawableText2D } from "../components/drawable-text-2d.component"; + +type Drawable = DrawableRect2D | DrawableCircle2D | DrawableText2D; + +/** The drawables shown by the last frame. */ +let shown = new Set(); + +/** + * Draws every entity that has a `Position2D` and a `DrawableRect2D`, `DrawableCircle2D` or + * `DrawableText2D`, where it is. Add it last, after the systems that move entities. + * + * @remarks + * The shape of a killed entity, or of a removed drawable, is removed from the screen. + * + * @system + * @side client + */ +export const draw2D = (registry: Registry, ctx: Context) => { + const layer = ctx.graphics.baseLayer; + const drawn = new Set(); + + registry.getZipper([DrawableRect2D, Position2D]).forEach(({ DrawableRect2D, Position2D }) => { + DrawableRect2D.draw(layer, Position2D, ctx.assets); + drawn.add(DrawableRect2D); + }); + registry.getZipper([DrawableCircle2D, Position2D]).forEach(({ DrawableCircle2D, Position2D }) => { + DrawableCircle2D.draw(layer, Position2D, ctx.assets); + drawn.add(DrawableCircle2D); + }); + registry.getZipper([DrawableText2D, Position2D]).forEach(({ DrawableText2D, Position2D }) => { + DrawableText2D.draw(layer, Position2D); + drawn.add(DrawableText2D); + }); + + // `killEntity` doesn't call `destroy()`: a drawable no longer in the world loses its shape here. + for (const drawable of shown) if (!drawn.has(drawable)) drawable.destroy(); + shown = drawn; +}; diff --git a/games/breakout/src/systems/hold-ball.system.ts b/games/breakout/src/systems/hold-ball.system.ts new file mode 100644 index 0000000..ea12b53 --- /dev/null +++ b/games/breakout/src/systems/hold-ball.system.ts @@ -0,0 +1,40 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; +import { InputEnum } from "@nanoforge-dev/input"; + +import { Ball } from "../components/ball.component"; +import { HitboxRect2D } from "../components/hitbox-rect-2d.component"; +import { Paddle } from "../components/paddle.component"; +import { Position2D } from "../components/position-2d.component"; +import { Velocity2D } from "../components/velocity-2d.component"; +import { justPressed } from "../just-pressed"; + +/** The angle of a serve, from vertical. */ +const SERVE_ANGLE = (30 * Math.PI) / 180; + +/** + * Keeps the ball on the paddle until Space serves it, at the level's `ballSpeed`. + * + * @system + * @side client + */ +export const holdBall = (registry: Registry, ctx: Context) => { + const vars = ctx.scenes.vars; + if (vars.has("paused") || vars.get("served")) return; + const paddle = registry.getZipper([Paddle, Position2D, HitboxRect2D])[0]; + if (!paddle) return; + + registry + .getZipper([Ball, Position2D, Velocity2D, HitboxRect2D]) + .forEach(({ Position2D: ball, Velocity2D: velocity, HitboxRect2D: box }) => { + ball.x = paddle.Position2D.x + (paddle.HitboxRect2D.width - box.width) / 2; + ball.y = paddle.Position2D.y - box.height - 2; + velocity.x = 0; + velocity.y = 0; + if (!justPressed(ctx, InputEnum.Space)) return; + const speed = vars.get("ballSpeed") ?? 450; + vars.set("served", true); + velocity.x = speed * Math.sin(SERVE_ANGLE); + velocity.y = -speed * Math.cos(SERVE_ANGLE); + }); +}; diff --git a/games/breakout/src/systems/level-flow.system.ts b/games/breakout/src/systems/level-flow.system.ts new file mode 100644 index 0000000..c8d3c1d --- /dev/null +++ b/games/breakout/src/systems/level-flow.system.ts @@ -0,0 +1,28 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; + +import { Level } from "../level"; +import { GameOver } from "../scenes/game-over.scene"; +import { Victory } from "../scenes/victory.scene"; + +/** + * Moves on when the level ends: to the next level once every brick is broken, or to the end + * screen when the last life is lost. + * + * @system + * @side client + */ +export const levelFlow = (_registry: Registry, ctx: Context) => { + const vars = ctx.scenes.vars; + if (vars.has("paused")) return; + const score = vars.get("score") ?? 0; + + if ((vars.get("lives") ?? 0) <= 0) { + void ctx.scenes.load(ctx, GameOver, { params: { score } }); + return; + } + if ((vars.get("bricksLeft") ?? 1) > 0) return; + const level = ctx.scenes.loaded.find((scene) => scene instanceof Level); + if (level?.next) void ctx.scenes.load(ctx, level.next); + else void ctx.scenes.load(ctx, Victory, { params: { score } }); +}; diff --git a/games/breakout/src/systems/lose-ball.system.ts b/games/breakout/src/systems/lose-ball.system.ts new file mode 100644 index 0000000..e9bba4b --- /dev/null +++ b/games/breakout/src/systems/lose-ball.system.ts @@ -0,0 +1,28 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; + +import { Ball } from "../components/ball.component"; +import { Position2D } from "../components/position-2d.component"; + +/** + * Takes a life when the ball falls below the paddle, out of the screen: `holdBall` then puts it + * back on the paddle. + * + * @remarks + * A ball out through the top or a side is put back on the paddle too, without taking a life: a + * long frame (a hidden tab) can move it past a wall without touching it. + * + * @system + * @side client + */ +export const loseBall = (registry: Registry, ctx: Context) => { + const vars = ctx.scenes.vars; + if (vars.has("paused") || !vars.get("served")) return; + + registry.getZipper([Ball, Position2D]).forEach(({ Position2D }) => { + const { x, y } = Position2D; + if (y >= 720) vars.set("lives", (vars.get("lives") ?? 1) - 1); + else if (y >= 0 && x >= 0 && x <= 1280) return; + vars.set("served", false); + }); +}; diff --git a/games/breakout/src/systems/move-2d.system.ts b/games/breakout/src/systems/move-2d.system.ts new file mode 100644 index 0000000..514766a --- /dev/null +++ b/games/breakout/src/systems/move-2d.system.ts @@ -0,0 +1,26 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; + +import { Acceleration2D } from "../components/acceleration-2d.component"; +import { Position2D } from "../components/position-2d.component"; +import { Velocity2D } from "../components/velocity-2d.component"; + +/** + * Moves entities: their `Acceleration2D` changes their `Velocity2D`, then their `Velocity2D` + * changes their `Position2D`, by the time elapsed since the last frame. + * + * @system + * @side shared + */ +export const move2D = (registry: Registry, ctx: Context) => { + const seconds = ctx.app.delta / 1000; + + registry.getZipper([Acceleration2D, Velocity2D]).forEach(({ Acceleration2D, Velocity2D }) => { + Velocity2D.x += Acceleration2D.x * seconds; + Velocity2D.y += Acceleration2D.y * seconds; + }); + registry.getZipper([Position2D, Velocity2D]).forEach(({ Position2D, Velocity2D }) => { + Position2D.x += Velocity2D.x * seconds; + Position2D.y += Velocity2D.y * seconds; + }); +}; diff --git a/games/breakout/src/systems/move-all.system.ts b/games/breakout/src/systems/move-all.system.ts new file mode 100644 index 0000000..ad06f98 --- /dev/null +++ b/games/breakout/src/systems/move-all.system.ts @@ -0,0 +1,15 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; + +import { move2D } from "./move-2d.system"; + +/** + * Moves the paddle and the ball (`move2D`), unless the game is paused. + * + * @system + * @side client + */ +export const moveAll = (registry: Registry, ctx: Context) => { + if (ctx.scenes.vars.has("paused")) return; + move2D(registry, ctx); +}; diff --git a/games/breakout/src/systems/move-control-2d.system.ts b/games/breakout/src/systems/move-control-2d.system.ts new file mode 100644 index 0000000..71ad4f7 --- /dev/null +++ b/games/breakout/src/systems/move-control-2d.system.ts @@ -0,0 +1,23 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; +import "@nanoforge-dev/input"; +import { Velocity2D } from "../components/velocity-2d.component"; + +import { MoveController2D } from "../components/move-controller-2d.component"; + +/** + * Sets the `Velocity2D` of `MoveController2D` entities from the keys held down. Add it before + * `move2D`. + * + * @system + * @side client + */ +export const moveControl2D = (registry: Registry, ctx: Context) => { + const held = (key: MoveController2D["left"]) => Number(ctx.input.isKeyPressed(key) === true); + + registry.getZipper([MoveController2D, Velocity2D]).forEach(({ MoveController2D, Velocity2D }) => { + const { speed, axes, left, right, up, down } = MoveController2D as MoveController2D; + if (axes !== "vertical") Velocity2D.x = (held(right) - held(left)) * speed; + if (axes !== "horizontal") Velocity2D.y = (held(down) - held(up)) * speed; + }); +}; diff --git a/games/breakout/src/systems/pause-menu.system.ts b/games/breakout/src/systems/pause-menu.system.ts new file mode 100644 index 0000000..ba28e65 --- /dev/null +++ b/games/breakout/src/systems/pause-menu.system.ts @@ -0,0 +1,20 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; +import { InputEnum } from "@nanoforge-dev/input"; + +import { justPressed } from "../just-pressed"; +import { Menu } from "../scenes/menu.scene"; +import { Pause } from "../scenes/pause.scene"; + +/** + * Resumes the level with Escape or P, or quits to the menu with Q. + * + * @system + * @side client + */ +export const pauseMenu = (_registry: Registry, ctx: Context) => { + const escape = justPressed(ctx, InputEnum.Escape); + const p = justPressed(ctx, InputEnum.KeyP); + if (escape || p) void ctx.scenes.unload(ctx, Pause); + else if (justPressed(ctx, InputEnum.KeyQ)) void ctx.scenes.load(ctx, Menu); +}; diff --git a/games/breakout/src/systems/pause-on-escape.system.ts b/games/breakout/src/systems/pause-on-escape.system.ts new file mode 100644 index 0000000..2fed402 --- /dev/null +++ b/games/breakout/src/systems/pause-on-escape.system.ts @@ -0,0 +1,19 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; +import { InputEnum } from "@nanoforge-dev/input"; + +import { justPressed } from "../just-pressed"; +import { Pause } from "../scenes/pause.scene"; + +/** + * Opens the pause menu over the level with Escape or P. + * + * @system + * @side client + */ +export const pauseOnEscape = (_registry: Registry, ctx: Context) => { + if (ctx.scenes.vars.has("paused")) return; + const escape = justPressed(ctx, InputEnum.Escape); + const p = justPressed(ctx, InputEnum.KeyP); + if (escape || p) void ctx.scenes.load(ctx, Pause, { parent: "current" }); +}; diff --git a/games/breakout/src/systems/show-scene-var.system.ts b/games/breakout/src/systems/show-scene-var.system.ts new file mode 100644 index 0000000..b6c608b --- /dev/null +++ b/games/breakout/src/systems/show-scene-var.system.ts @@ -0,0 +1,20 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; +import "@nanoforge-dev/scene"; + +import { DrawableText2D } from "../components/drawable-text-2d.component"; +import { SceneVarText } from "../components/scene-var-text.component"; + +/** + * Writes the var of every `SceneVarText` in its entity's `DrawableText2D`, through its template; + * a var that does not exist shows as `-`. + * + * @system + * @side client + */ +export const showSceneVar = (registry: Registry, ctx: Context) => { + registry.getZipper([SceneVarText, DrawableText2D]).forEach(({ SceneVarText, DrawableText2D }) => { + const { variable, template } = SceneVarText as SceneVarText; + DrawableText2D.text = template.replace("{}", String(ctx.scenes.vars.get(variable) ?? "-")); + }); +}; diff --git a/games/breakout/src/systems/start-on-enter.system.ts b/games/breakout/src/systems/start-on-enter.system.ts new file mode 100644 index 0000000..20a9f67 --- /dev/null +++ b/games/breakout/src/systems/start-on-enter.system.ts @@ -0,0 +1,16 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; +import { InputEnum } from "@nanoforge-dev/input"; + +import { justPressed } from "../just-pressed"; +import { Level1 } from "../scenes/level-1.scene"; + +/** + * Starts a game at level 1, which loads `Run` first, when Enter is pressed. + * + * @system + * @side client + */ +export const startOnEnter = (_registry: Registry, ctx: Context) => { + if (justPressed(ctx, InputEnum.Enter)) void ctx.scenes.load(ctx, Level1); +}; diff --git a/games/breakout/tsconfig.json b/games/breakout/tsconfig.json new file mode 100644 index 0000000..c0ae4f2 --- /dev/null +++ b/games/breakout/tsconfig.json @@ -0,0 +1,39 @@ +{ + "$schema": "https://json.schemastore.org/tsconfig.json", + // Mapped from https://www.typescriptlang.org/tsconfig + "compilerOptions": { + // Type Checking + "allowUnreachableCode": false, + "allowUnusedLabels": false, + "noFallthroughCasesInSwitch": true, + "noImplicitOverride": true, + "noImplicitReturns": true, + "noPropertyAccessFromIndexSignature": false, + "noUncheckedIndexedAccess": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "strict": true, + + // Modules + "allowArbitraryExtensions": false, + "allowImportingTsExtensions": false, + "module": "ESNext", + "moduleResolution": "Bundler", + "resolveJsonModule": true, + "resolvePackageJsonExports": true, + "resolvePackageJsonImports": true, + + // Interop Constraints + "allowSyntheticDefaultImports": true, + "forceConsistentCasingInFileNames": true, + "isolatedModules": true, + + // Language and Environment + "experimentalDecorators": true, + "lib": ["ESNext", "esnext.disposable", "DOM"], + "target": "ESNext", + "useDefineForClassFields": true + }, + "include": ["src"], + "exclude": ["node_modules", ".nanoforge", "dist"] +} diff --git a/games/flappy-bird/.gitignore b/games/flappy-bird/.gitignore new file mode 100644 index 0000000..f28e2dc --- /dev/null +++ b/games/flappy-bird/.gitignore @@ -0,0 +1,5 @@ +node_modules/ +dist/ +.nanoforge/ +nf_modules/ +.env diff --git a/games/flappy-bird/README.md b/games/flappy-bird/README.md new file mode 100644 index 0000000..c010c91 --- /dev/null +++ b/games/flappy-bird/README.md @@ -0,0 +1,42 @@ +# flappy-bird + +Flappy Bird: the bird falls, you flap it up through the gaps between the pipes. Each pair of +pipes passed is a point, and the gap shrinks as the score grows. + +| Control | Action | +| ------------------- | ----------------------------------------- | +| Space, click or tap | Flap (and start, or restart after a fall) | + +```sh +pnpm install +pnpm dev # play it +pnpm editor # open it in the editor +``` + +## How it is made + +Four scenes (`src/scenes`), each with its entities written out in its `setup`: + +| Scene | Parent | What | +| ---------- | ----------- | ------------------------------------------------------------------ | +| `Sky` | none | The background and the scrolling ground (three `ScrollLoop` tiles) | +| `Ready` | `Sky` | The "get ready" message, until the first flap | +| `Play` | `Sky` | The bird, three pairs of pipes that come back again, the score | +| `GameOver` | `"current"` | Loaded over `Play`: its `over` var stops the world | + +- The pipes are not spawned while playing: `movePipes` brings back a pair that left the screen, + with a new gap. The top pipe is a `DrawableRect2D` turned by 180 degrees, so the pipe image + needs no cropping. +- `DrawOrder2D` stacks the shapes (pipes under the ground, the score on top): without it, a scene + loaded again can draw in another order. +- Sounds are `SoundEffect` entities of `main.ts`, played with `ctx.sound.play(key)`. +- The tunings are component parameters, editable in the editor: `Bird` (gravity, flap, fall + speed), `PipeSpawner` (speed, interval, gap), `ScrollLoop`, `RestartDelay`. + +The files of `src` that are also in `shared/2d` or `shared/arcade` are copies (see the +repository's README). + +## Credits + +The images and sounds of `assets/` are by Samuel Custodio, under the MIT license +(`assets/LICENSE`). diff --git a/flappy-bird/client/static/0.png b/games/flappy-bird/assets/0.png similarity index 100% rename from flappy-bird/client/static/0.png rename to games/flappy-bird/assets/0.png diff --git a/flappy-bird/client/static/1.png b/games/flappy-bird/assets/1.png similarity index 100% rename from flappy-bird/client/static/1.png rename to games/flappy-bird/assets/1.png diff --git a/flappy-bird/client/static/2.png b/games/flappy-bird/assets/2.png similarity index 100% rename from flappy-bird/client/static/2.png rename to games/flappy-bird/assets/2.png diff --git a/flappy-bird/client/static/3.png b/games/flappy-bird/assets/3.png similarity index 100% rename from flappy-bird/client/static/3.png rename to games/flappy-bird/assets/3.png diff --git a/flappy-bird/client/static/4.png b/games/flappy-bird/assets/4.png similarity index 100% rename from flappy-bird/client/static/4.png rename to games/flappy-bird/assets/4.png diff --git a/flappy-bird/client/static/5.png b/games/flappy-bird/assets/5.png similarity index 100% rename from flappy-bird/client/static/5.png rename to games/flappy-bird/assets/5.png diff --git a/flappy-bird/client/static/6.png b/games/flappy-bird/assets/6.png similarity index 100% rename from flappy-bird/client/static/6.png rename to games/flappy-bird/assets/6.png diff --git a/flappy-bird/client/static/7.png b/games/flappy-bird/assets/7.png similarity index 100% rename from flappy-bird/client/static/7.png rename to games/flappy-bird/assets/7.png diff --git a/flappy-bird/client/static/8.png b/games/flappy-bird/assets/8.png similarity index 100% rename from flappy-bird/client/static/8.png rename to games/flappy-bird/assets/8.png diff --git a/flappy-bird/client/static/9.png b/games/flappy-bird/assets/9.png similarity index 100% rename from flappy-bird/client/static/9.png rename to games/flappy-bird/assets/9.png diff --git a/games/flappy-bird/assets/LICENSE b/games/flappy-bird/assets/LICENSE new file mode 100644 index 0000000..18a448b --- /dev/null +++ b/games/flappy-bird/assets/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2019 Samuel Custodio + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/games/flappy-bird/assets/background-day.png b/games/flappy-bird/assets/background-day.png new file mode 100644 index 0000000..afcb5ec Binary files /dev/null and b/games/flappy-bird/assets/background-day.png differ diff --git a/flappy-bird/client/static/base.png b/games/flappy-bird/assets/base.png similarity index 100% rename from flappy-bird/client/static/base.png rename to games/flappy-bird/assets/base.png diff --git a/flappy-bird/client/static/die.wav b/games/flappy-bird/assets/die.wav similarity index 100% rename from flappy-bird/client/static/die.wav rename to games/flappy-bird/assets/die.wav diff --git a/flappy-bird/client/static/gameover.png b/games/flappy-bird/assets/gameover.png similarity index 100% rename from flappy-bird/client/static/gameover.png rename to games/flappy-bird/assets/gameover.png diff --git a/games/flappy-bird/assets/hit.wav b/games/flappy-bird/assets/hit.wav new file mode 100644 index 0000000..9d9b77c Binary files /dev/null and b/games/flappy-bird/assets/hit.wav differ diff --git a/flappy-bird/client/static/message.png b/games/flappy-bird/assets/message.png similarity index 100% rename from flappy-bird/client/static/message.png rename to games/flappy-bird/assets/message.png diff --git a/games/flappy-bird/assets/pipe-green.png b/games/flappy-bird/assets/pipe-green.png new file mode 100644 index 0000000..4664401 Binary files /dev/null and b/games/flappy-bird/assets/pipe-green.png differ diff --git a/flappy-bird/client/static/point.wav b/games/flappy-bird/assets/point.wav similarity index 100% rename from flappy-bird/client/static/point.wav rename to games/flappy-bird/assets/point.wav diff --git a/flappy-bird/client/static/swoosh.wav b/games/flappy-bird/assets/swoosh.wav similarity index 100% rename from flappy-bird/client/static/swoosh.wav rename to games/flappy-bird/assets/swoosh.wav diff --git a/games/flappy-bird/assets/wing.wav b/games/flappy-bird/assets/wing.wav new file mode 100644 index 0000000..9ae2c67 Binary files /dev/null and b/games/flappy-bird/assets/wing.wav differ diff --git a/flappy-bird/client/static/yellowbird-downflap.png b/games/flappy-bird/assets/yellowbird-downflap.png similarity index 100% rename from flappy-bird/client/static/yellowbird-downflap.png rename to games/flappy-bird/assets/yellowbird-downflap.png diff --git a/games/flappy-bird/assets/yellowbird-midflap.png b/games/flappy-bird/assets/yellowbird-midflap.png new file mode 100644 index 0000000..2ca3c2d Binary files /dev/null and b/games/flappy-bird/assets/yellowbird-midflap.png differ diff --git a/flappy-bird/client/static/yellowbird-upflap.png b/games/flappy-bird/assets/yellowbird-upflap.png similarity index 100% rename from flappy-bird/client/static/yellowbird-upflap.png rename to games/flappy-bird/assets/yellowbird-upflap.png diff --git a/games/flappy-bird/nanoforge.config.ts b/games/flappy-bird/nanoforge.config.ts new file mode 100644 index 0000000..77607cb --- /dev/null +++ b/games/flappy-bird/nanoforge.config.ts @@ -0,0 +1,5 @@ +import { defineConfig } from "@nanoforge-dev/config"; + +export default defineConfig({ + type: "client", +}); diff --git a/games/flappy-bird/package.json b/games/flappy-bird/package.json new file mode 100644 index 0000000..dcc3285 --- /dev/null +++ b/games/flappy-bird/package.json @@ -0,0 +1,28 @@ +{ + "$schema": "https://json.schemastore.org/package.json", + "name": "flappy-bird", + "description": "Flappy Bird: fly between the pipes, one tap at a time", + "private": true, + "type": "module", + "scripts": { + "dev": "nf dev", + "build": "nf build", + "start": "nf start", + "editor": "nf editor ." + }, + "devDependencies": { + "@nanoforge-dev/asset": "^3.0.0", + "@nanoforge-dev/cli": "^3.0.1", + "@nanoforge-dev/common": "^3.0.0", + "@nanoforge-dev/config": "^3.0.1", + "@nanoforge-dev/core": "^3.0.0", + "@nanoforge-dev/ecs": "^3.0.0", + "@nanoforge-dev/editor-lib": "^3.0.0", + "@nanoforge-dev/env": "^3.0.0", + "@nanoforge-dev/graphics-2d": "^3.0.0", + "@nanoforge-dev/input": "^3.0.0", + "@nanoforge-dev/scene": "^3.0.0", + "@nanoforge-dev/sound": "^3.0.0", + "typescript": "^6.0.0" + } +} diff --git a/games/flappy-bird/pnpm-lock.yaml b/games/flappy-bird/pnpm-lock.yaml new file mode 100644 index 0000000..0786d33 --- /dev/null +++ b/games/flappy-bird/pnpm-lock.yaml @@ -0,0 +1,1549 @@ +lockfileVersion: '9.0' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + +importers: + + .: + devDependencies: + '@nanoforge-dev/asset': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/cli': + specifier: ^3.0.1 + version: 3.0.1 + '@nanoforge-dev/common': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/config': + specifier: ^3.0.1 + version: 3.0.1 + '@nanoforge-dev/core': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/ecs': + specifier: ^3.0.0 + version: 3.0.0(@nanoforge-dev/editor-lib@3.0.0)(@nanoforge-dev/scene@3.0.0(@nanoforge-dev/editor-lib@3.0.0)) + '@nanoforge-dev/editor-lib': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/env': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/graphics-2d': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/input': + specifier: ^3.0.0 + version: 3.0.0 + '@nanoforge-dev/scene': + specifier: ^3.0.0 + version: 3.0.0(@nanoforge-dev/editor-lib@3.0.0) + '@nanoforge-dev/sound': + specifier: ^3.0.0 + version: 3.0.0(@nanoforge-dev/editor-lib@3.0.0) + typescript: + specifier: ^6.0.0 + version: 6.0.3 + +packages: + + '@angular-devkit/core@22.2.7': + resolution: {integrity: sha512-cchZAMsV4d76RDZBlWzPhYxM/Hb6bmq71oUngdrwehMbBbdQu3W9C2tGlvxuPxbRKru9ZlUa14YVXQ0+QnhFtw==} + engines: {node: ^22.22.3 || ^24.15.0 || >=26.0.0, npm: ^6.11.0 || ^7.5.6 || >=8.0.0, yarn: '>= 1.13.0'} + peerDependencies: + chokidar: ^5.0.0 + peerDependenciesMeta: + chokidar: + optional: true + + '@angular-devkit/schematics-cli@22.2.7': + resolution: {integrity: sha512-9Od0E8TiYTQWm/03QjYWnsryZA8ZSjTf/k5z61nPd/jgloVNvSW8kxC7/YMw+RoXh2idMzjiJxraKxg+gJxzPw==} + engines: {node: ^22.22.3 || ^24.15.0 || >=26.0.0, npm: ^6.11.0 || ^7.5.6 || >=8.0.0, yarn: '>= 1.13.0'} + hasBin: true + + '@angular-devkit/schematics@22.2.7': + resolution: {integrity: sha512-a1h7xNqBLQVo1e5eCyOU3axSbA9AFU6nnSH5QhlNhggfMeZde+eBrueSt25xsewoxlKO8EvkVT3+knMUkDYiGQ==} + engines: {node: ^22.22.3 || ^24.15.0 || >=26.0.0, npm: ^6.11.0 || ^7.5.6 || >=8.0.0, yarn: '>= 1.13.0'} + + '@emnapi/core@2.0.0-beta.2': + resolution: {integrity: sha512-MzCVoWtcg4Pm2B3je5mMvYMvj3MmBKw+fU7vbsJc9/iT8ip6/eYIHo/Dsm/mr+wsHB6SEyJDuxB09Yy6r/8+4A==} + + '@emnapi/runtime@2.0.0-beta.2': + resolution: {integrity: sha512-JcrSPzPvZuNZvJqPTF9Fw25LbOJ8avzFVlaf2grmH4Cku0oGP47tRgqPZadcfj3YoZMHkFVnCYFbQM8I+i5QEw==} + + '@emnapi/wasi-threads@2.2.0': + resolution: {integrity: sha512-JP7OYH38Q7+pyTAe14raZHLQIK7BDKbdwji+Xi3pcd/6QkJYQH3SX4wu6EplGrGJWRepoNzedfm0G3B9Z4e9Rw==} + + '@inquirer/ansi@2.1.0': + resolution: {integrity: sha512-63GU5AD9KhNbWM0jlhHoMJTEFck2upFOPxHlnCKf3xYTV3rjTUUQfodihmTnfYQzMLS29oy8lK/gA1eJgu4bhA==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + + '@inquirer/checkbox@5.3.0': + resolution: {integrity: sha512-3QQSO87A+JoRtOtjtsgX2enwTL+3+VBVrkUpdqrIxMOgn5+W5sE57PcCPAiNUIESHxV4Q6mNEGxq2xLmRa0/yw==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/confirm@6.4.0': + resolution: {integrity: sha512-+DCZxrOF01Q/1SzTQkgycAQPS/Jf+Yol0h1P/MVmopukTsxGOu1h/LKqf30y0eHKFZYYrgUMVhGDhEbPmSPi9A==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/core@12.1.0': + resolution: {integrity: sha512-6H7usRWw4Gdjgpaem10CA5MfZ/xoYPGyInriR1Xubqjv+SVo8LIJ1erpFxW5JgCza6VZVZiKLTko7RtUU3AQMg==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/editor@5.4.0': + resolution: {integrity: sha512-L7vdCe4jnMpzhDisu1tAnr4WGvfPOVz+vNFXyIIL7O2Ycn/n90sn1ARvg+4cwzLf+us51BE/cX7uhnrLcal3+g==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/expand@5.2.0': + resolution: {integrity: sha512-AOp2KQk7QojUyWOP7VkqdBWmxLRaVH58wQMx3N4//P530EDtpVp1EWIjAJubx9ZohWS/UCEpIkA1TuiNki0iOA==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/external-editor@3.1.0': + resolution: {integrity: sha512-27JAkF38nXqXaoveU28iA/+Z8nutnF8B3JsbdToPHn9WnkrsMtZ0/YoJ29YwbtFexYIo+tIy6ikMvTdHKjjmGA==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/figures@2.1.0': + resolution: {integrity: sha512-CR9u2PME23jxy2SOyTb117efwAAPm98Zr+LoWI+PiQ55D6U8Yeu/HyFTxwytKhPa6oxAGzdsm2Kg7oLS6B9z8w==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + + '@inquirer/input@5.2.0': + resolution: {integrity: sha512-sIUPnN2X7M+7dq3RUd+e9QRacYnM+6B+kSucwQgj5VC5Eo/f+CIr2NyPBumxsViI+wzfokkgop/3x3KfHxNyJw==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/number@4.3.0': + resolution: {integrity: sha512-xYkX4sPVgox0F7yQwpz/MByWjOGdLEf1pdjH+Lji2gAzSs2xezz5bN5YgS1n0tx9wo0mRhGvq1KJGtvDZ9XXcQ==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/password@5.3.0': + resolution: {integrity: sha512-KVqW4G/UbMK06uBN76xF89JKYC9YBWU7v+Kc2tUwMCO8pg3ASBr0HVabl1KaSqF94O2KiRu8aKx4EicN78PK+A==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/prompts@8.7.2': + resolution: {integrity: sha512-QoRB4wFIjgH5iOhSjoIKMkTvSHDuV+O3OITlIqAYO0oK5x364GJILXiMBvlPiE+klg7Xx9tq5XVqQHcGUDYYPA==} + engines: {node: '>=23.5.0 || ^22.13.0 || ^20.17.0'} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/prompts@8.8.0': + resolution: {integrity: sha512-yYVT2Eo3mafb9tnU2Mr3+wh5wLCWyspExqVoPSMCIfBIn3ZUTE4IDfbCMbMgXaOH0tH+JZEhOtfczQhDzOjIGg==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/rawlist@5.4.0': + resolution: {integrity: sha512-x42wcy465GM5/mHNKBFdAJbLlLyzmYqr/DEa6F49nHpI+03EFwRCRKeLGQakx5XqZ4unc2yFuS78qAD4Rb0iFA==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/search@4.4.0': + resolution: {integrity: sha512-UJ+9tkzPT1AjnvjuPFYcOdO3BVeN28bfSXajYRFZTRgA9OiNl4k2Nn2cHHPwiIDyPHlvOnmE9ZOHyXhPHtvb+A==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/select@5.3.0': + resolution: {integrity: sha512-Fmgfl0qjqCQo+/tjQpgnRXKh5N7/VpYcJh+AlYU2eHmHZLMGUBDzo+Gwc2ODzWJfXNRZmgaMhz4qULcO/C/rXg==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/type@4.3.0': + resolution: {integrity: sha512-/IA8q2nyjgyl0NGSjqiRXB8gh3We7Pzx9C0c+6Zoolu905jFc79anerrUG7+n65+qs310DRK43yi2WDI8nY59A==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@isaacs/fs-minipass@4.0.1': + resolution: {integrity: sha512-wgm9Ehl2jpeqP3zw/7mo3kRHFp5MEDhqAdwy1fTGkHAwnkGOVsgpvQhL8B5n1qlb01jV3n/bI0ZfZp5lWA1k4w==} + engines: {node: '>=18.0.0'} + + '@jridgewell/sourcemap-codec@1.6.0': + resolution: {integrity: sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw==} + + '@nanoforge-dev/asset@3.0.0': + resolution: {integrity: sha512-jqXcyCMbdcCCj7wZ/dyIpjY8hza02Pt/vY8KrNcaXTlxpTc9EE+VKuO5+fHdUXWWPgJSFt96TqAPhug+z+KH3Q==} + engines: {node: '26'} + + '@nanoforge-dev/cli@3.0.1': + resolution: {integrity: sha512-ZfrbETcAcX3vsPLO1WLSCJc2ERCAcIpbdi9Df5bmH3XLinQkDAcESkN9JkaI/vgV08A7xhTjV8zSDSwF0T73Xg==} + engines: {node: '26'} + hasBin: true + + '@nanoforge-dev/common@3.0.0': + resolution: {integrity: sha512-lzMvQ1vCElh9OcP4EqhffbY+AQXOH4IiuD1pj7VvJlpcY6hh7Bs/s4NVS0gXoJ+ibpBMe5mAq23RyzqTwk8czg==} + engines: {node: '26'} + + '@nanoforge-dev/config@3.0.1': + resolution: {integrity: sha512-XWRScOotb8IirerRx/mWLmUVYye3lo0PN/5a0MUp/eoSrhz0S6zzhGHEupRuC8aeHTjsQT7ctM3P6YyKSHZLaQ==} + engines: {node: '26'} + + '@nanoforge-dev/core@3.0.0': + resolution: {integrity: sha512-pa7Fr3TFkZVfAADBC17Qt5ru/W9vXtYB8e5eb7wurAtu8/jH/ZtqfW3kafTuWC9513MXp/h6LOCdZQhjnCt6UA==} + engines: {node: '26'} + + '@nanoforge-dev/ecs@3.0.0': + resolution: {integrity: sha512-csrXJtCzqohxtvEQs+O//xabnaLR3BXe0QpSpl7NVihF3f0iX2fNYURxNjQKxzoPYBokCnnyNxN2KFc7UmIsdA==} + engines: {node: '26'} + peerDependencies: + '@nanoforge-dev/editor-lib': 3.0.0 + '@nanoforge-dev/scene': 3.0.0 + peerDependenciesMeta: + '@nanoforge-dev/editor-lib': + optional: true + '@nanoforge-dev/scene': + optional: true + + '@nanoforge-dev/editor-lib@3.0.0': + resolution: {integrity: sha512-fSWm6bHelbxqeVESYoUUKDi9RGNxvRu6p1r41KE1DddM0RrP0/WzkFOWBvgl+psHbYNotXe723Y2Fd3p+tqPDQ==} + engines: {node: '26'} + + '@nanoforge-dev/editor@0.1.4': + resolution: {integrity: sha512-bqbrH8ulFSiZz1iisJHtHeEzj1RV/70uErCYHeW4DIhVPsWbBfWKFvg/ghAbmPk5vsj0YnhDX6DSpik4S1QoiQ==} + engines: {node: '25'} + + '@nanoforge-dev/env@3.0.0': + resolution: {integrity: sha512-kXYXl9/09Bn8VStTTFuZY3dYDG9b76VhOi9PHMnaLe75XcFRLKJ2dYkXf3ut6RCL2+6H7HAEIOALjR15CHnJ5A==} + engines: {node: '26'} + + '@nanoforge-dev/graphics-2d@3.0.0': + resolution: {integrity: sha512-0I0WUr5495jORdYR+HtyP4kmAfCMvixmG+EH/gE5bN33S8RO6/Ly4oMLZOLUywcDTAFuLn28BlHuVor2YfXrsg==} + engines: {node: '26'} + + '@nanoforge-dev/input@3.0.0': + resolution: {integrity: sha512-8pWU28c99VAvn37onNbVFfwXTgyQGxm5DVnTdBEzgrF3KPCzU77kEaexB1AWOlga+4qNGU7/XNm3hNZ+YS49Ig==} + engines: {node: '26'} + + '@nanoforge-dev/loader-client@1.7.0': + resolution: {integrity: sha512-zDj0yQ8cZyHHjAYDVIyB79mh4dK7WRgZG7Kc+d/43t2WX/pX2HqBVkpLcDPkA9cNOKpCRYWd3LyYISlz53gzyg==} + engines: {node: '26'} + + '@nanoforge-dev/loader-server@1.7.0': + resolution: {integrity: sha512-Yd/BYORhoar5znNSD7kGirAc1Al0q5t8iscbb07QWKeXWA+DLKjPSuKJC6ykysFkbs9HiZU59oOfxyvNL4h3Pw==} + engines: {node: '26'} + + '@nanoforge-dev/loader-website@1.7.0': + resolution: {integrity: sha512-x1fV3RYUUxru39sF5HJcfutNnifMMTIEHW92jgkR9gz06ZlZ+rQofuegXgAnEzs0dEXa+rhNQ/iXYbqOZvq6YQ==} + engines: {node: '26'} + + '@nanoforge-dev/registry@3.0.1': + resolution: {integrity: sha512-EzSaszYtrPldD5Do7jdQK3TLLb8uCirY6NQjKXkeGw31X+sUXor4h5GAaoxELWMzPnv9BbKtggSaVaQIt7s8IQ==} + engines: {node: '26'} + + '@nanoforge-dev/scene@3.0.0': + resolution: {integrity: sha512-4+QajCZCW8eVdQPZeSoLDQ/ueQOFwAoFvd0pRL06FeuzWJMxCVNTCeZp9UHZLTMqmEJKAC29OnBQuHvhGkuBVg==} + engines: {node: '26'} + peerDependencies: + '@nanoforge-dev/editor-lib': 3.0.0 + peerDependenciesMeta: + '@nanoforge-dev/editor-lib': + optional: true + + '@nanoforge-dev/schematics@3.0.1': + resolution: {integrity: sha512-iK2vC0gPEh2mQ81IB4+jfGw/ZNOLMDnS9HRBXH5tWB0mdN5GA32viblhW0oYPX2/tWrLC9YiCPgEE4AL8Zwz6w==} + engines: {node: '26'} + + '@nanoforge-dev/sound@3.0.0': + resolution: {integrity: sha512-vNMYm3dp7A3A+4taJpSXwPEu/t1VtZ1BAUkY6a3D40Uz3q785+u79o3q21/yYGigCswuPlIQ5gT4ApcT+6J4tg==} + engines: {node: '26'} + peerDependencies: + '@nanoforge-dev/editor-lib': 3.0.0 + peerDependenciesMeta: + '@nanoforge-dev/editor-lib': + optional: true + + '@napi-rs/wasm-runtime@1.2.6': + resolution: {integrity: sha512-mRyDmEw9/fCDXCGfL1sbgIw/GUK0PVxRW4YwgPN61F3LQ+fSyoBFarJVzgGyhF6kRzEQZ0FejDqm4WLXSeqQmw==} + engines: {node: ^20.19.0 || ^22.13.0 || >=23.5.0} + peerDependencies: + '@emnapi/core': ^1.7.1 || 2.0.0-beta.2 + '@emnapi/runtime': ^1.7.1 || 2.0.0-beta.2 + + '@oven/bun-darwin-aarch64@1.4.4': + resolution: {integrity: sha512-zW/hxwc8sJAILGwB5eTC4i48ouGXf0V4lrxmEOk3JIE6JkYVW1TZh1E2pIempqsezgW1sckTIIDudFON8bJ2Mw==} + cpu: [arm64] + os: [darwin] + + '@oven/bun-darwin-x64@1.4.4': + resolution: {integrity: sha512-oKGcxLsvh4oHjAo28nPm8c/xN0o/OmGyj1IHYc94vprkWsW2hNg2keEZt5f40cI5Hvu4jDlSRTR0UNpv1UIAxw==} + cpu: [x64] + os: [darwin] + + '@oven/bun-freebsd-aarch64@1.4.4': + resolution: {integrity: sha512-klvA9FlwLxZj3JYIOPQA4bbnHIC3uas8kBE4GaGGkeVgAQP/k8hAzYkOqkSaqHBDbxLrTyFEQArEAevJq6NJzg==} + cpu: [arm64] + os: [freebsd] + + '@oven/bun-freebsd-x64@1.4.4': + resolution: {integrity: sha512-sF1xS/scbyN94P2d0eTiarO6JHxrIvhZNT9hnWjQXW5nwKRtfuP+UYnIMNyvW1BQPcZFP/cvfLBNUIe1ea4zPA==} + cpu: [x64] + os: [freebsd] + + '@oven/bun-linux-aarch64-android@1.4.4': + resolution: {integrity: sha512-5lvn3at5vRC0GxvmiqEiV2/e23tnRi0q5pzR40yfDvDA3OW7PSkt4chF1nA9vnAJhro4/l+ol1FmNP6D3cf/oA==} + cpu: [arm64] + os: [android] + + '@oven/bun-linux-aarch64-musl@1.4.4': + resolution: {integrity: sha512-QFd0P+mHJxbZFbUla4MgiE5OwxysHaUIYxL2pPNkpWtaI7v4ShOpr8OhBmsuyB0xn5rv/ZJnPsj2y8+bB9+g/A==} + cpu: [arm64] + os: [linux] + libc: [musl] + + '@oven/bun-linux-aarch64@1.4.4': + resolution: {integrity: sha512-ZTVtpf9zmHSBVPX1sBwe5agGb/rN34yPGg/Hby8e2Ax2uCUA2URZKlZH7qLntK7qaFJCMXh9v0GWNYN2zINz1w==} + cpu: [arm64] + os: [linux] + libc: [glibc] + + '@oven/bun-linux-x64-android@1.4.4': + resolution: {integrity: sha512-3dMicj9C1DhaIfDkwt/9GtpU0W+q+GazbG9OIlEyL3Q1BBEz2e6ZRz/JiO8D/ECC0caXAqvnpFudehcLlgIwWQ==} + cpu: [x64] + os: [android] + + '@oven/bun-linux-x64-musl@1.4.4': + resolution: {integrity: sha512-lEEjNOJJrbGZu2NVcPI4uXdILcpspezWkA8R/Jr0RCGhM6zQd0Y7JBIIKNAmbX59EeWpeEz7Q78iLbpcAUypUA==} + cpu: [x64] + os: [linux] + libc: [musl] + + '@oven/bun-linux-x64@1.4.4': + resolution: {integrity: sha512-CHbbkmHVM28T1GFq+6GL4Ao4ujwwYwj1CxFFwEFzLanPfNsId9AhbIP0Q4reWuWBkGimUkoQygrK7Rgjtj3vog==} + cpu: [x64] + os: [linux] + libc: [glibc] + + '@oven/bun-windows-aarch64@1.4.4': + resolution: {integrity: sha512-n0ep5ZRPCZY1+dqFJpnnRUZB1wy4GYU6At8RF+pyzySCLjkN9R4rFh2PtBHAgF/lg1vOl3/CeER3pDM+p40ATA==} + cpu: [arm64] + os: [win32] + + '@oven/bun-windows-x64@1.4.4': + resolution: {integrity: sha512-a3LNctBVO8PjePsFZfwDleF2JXYf2BfQ1u/PLRnBDLnC2Riml+4+LgJpKj4xRGhB92KweGyQI5PXaTkP9qypMQ==} + cpu: [x64] + os: [win32] + + '@oxc-project/types@0.158.0': + resolution: {integrity: sha512-xZ66qA4WmLbTLlxH3mqMd8f9UKbaOzOT0ATwFf4DH/14pMgpUrtqtjyYzOQmgfl2a0iRAAMbQ9G1th/67jRzGw==} + + '@rolldown/binding-android-arm-eabi@1.3.2': + resolution: {integrity: sha512-kqR2xcygEx3WwDY69LsKeyf7SVmx4yzMtKZRknyaHieVJdRvvnAM97L0Gq6tUFc9T2YXcW/Ghij2+Um6He0LTw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [android] + + '@rolldown/binding-android-arm64@1.3.2': + resolution: {integrity: sha512-gXM4GAAvvIZA7qUuSCQS+Zz91H2fagKa5MNppUdjzysJ8LXMWm9D/gQj4nfOKo6okquDQ5pkjsuo2SUMXNW0Rw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [android] + + '@rolldown/binding-darwin-arm64@1.3.2': + resolution: {integrity: sha512-OBs5hp3W+LwMEUmDMMMnu08ncG0t6DDgnFU+6TAucKtAfNgerYLZSr2jtREKb/JuPQ1J7bJnWIgKKkxvjuAw1g==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [darwin] + + '@rolldown/binding-darwin-x64@1.3.2': + resolution: {integrity: sha512-X0VGYd4v/gdjfa/IP6uHuMhofPoUDYvK/byk3bC0jQ1pKKgt6RZ4B4puMqP0AHkjmIHAsxA471mM6AxZ39IaTA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [darwin] + + '@rolldown/binding-freebsd-x64@1.3.2': + resolution: {integrity: sha512-mr04K4cp9J/fj9fknrX8e4QvI/V48Sp+4v64PoLwhoirIH8b8L8EBrF/0bTjV1It2IL91hoNG13GblnWLglkxA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [freebsd] + + '@rolldown/binding-linux-arm-gnueabihf@1.3.2': + resolution: {integrity: sha512-VgWy02HU9Tiy6tU8U+kF3Fd4TQwTNdIBvs2MlgViP1ksMtAnQQTIPAj0ZsJzIQXKIOugqQSpqxQgELJ3fkuL5w==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [linux] + + '@rolldown/binding-linux-arm64-gnu@1.3.2': + resolution: {integrity: sha512-0wloJFYqV844gv6boiERbHpErxbxHbmlgnMX5VxP1Ux+DLBqGrUOn0cIpBmCZEcTITes3QUelxya4u8c9ziQvQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-arm64-musl@1.3.2': + resolution: {integrity: sha512-Kys8wgFQy8H8vua0MNpC0akMBFoNO8455RHk2yycBM0iayMIAtVAL6xmV9TWAkehFgrrlImTL2fZdX5LXfYtAA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + libc: [musl] + + '@rolldown/binding-linux-ppc64-gnu@1.3.2': + resolution: {integrity: sha512-L8eej7+/StRxUHHOPsOVl7Fzx/3tumuGB4hGQZKT73xRI16KZhaSJr0gi3C3WBjNRxeJRKKps2UD4lQukP+oBw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [ppc64] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-s390x-gnu@1.3.2': + resolution: {integrity: sha512-MV5CEb/nV8neQOj7l6945q1vy62HXtWO8zPDvfySPusoUzdBoLoJ/DfXXwaYThGTXZCniF+5bCf253WTPPK7Yw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [s390x] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-x64-gnu@1.3.2': + resolution: {integrity: sha512-3qssvvVvkwQookZ1/1avlKWc5orAR85vgKdzDd5noZS8nnHiI/ejOAEt0xfNYvtBBF7/DZmP8dANWkRBJVOBCA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-x64-musl@1.3.2': + resolution: {integrity: sha512-rJqoFTm/bCZFKKgaT4NzWn/TuJkFDToZ/rzYFnYVBL28jH1nIfg6snx2mDri30nal9H+wcYfKpoPR9jrMQgQQg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + libc: [musl] + + '@rolldown/binding-openharmony-arm64@1.3.2': + resolution: {integrity: sha512-ozdbCjHfh0N//wJNExjJlSlcDaeIKo8k1ktzkLUyESr2Gu/Qw7nBYxKe3jgtoaxda570vg10WdYosre82263hQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [openharmony] + + '@rolldown/binding-wasm32-wasi@1.3.2': + resolution: {integrity: sha512-p5VA6Vk/2cXZPVWf+dDbuE0dkhrcoAo6pISTJmzUnsSdQqNJdusyR8lZgHku095+r27zrYISNLZnJoqrcePW0A==} + engines: {node: ^20.19.0 || ^22.13.0 || >=23.5.0} + cpu: [wasm32] + + '@rolldown/binding-win32-arm64-msvc@1.3.2': + resolution: {integrity: sha512-XDb2U14Orf4r76SwzvJ7avePL00w4gHBmi1Ig4B/itYFEUTmYMNDHVU0dcYuBa0LgNBqyREoJOrQKxQlyYJA7A==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [win32] + + '@rolldown/binding-win32-x64-msvc@1.3.2': + resolution: {integrity: sha512-lEsKzKJqIUDZVCBhS4lkZuyQUhV1oRg5UHkI72qlOAqJn7qEXcoVdTridFS7PHNWdZknBl95EAF/4P1Xv0K1eQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [win32] + + '@rolldown/pluginutils@1.1.0': + resolution: {integrity: sha512-K+NU2HDCEem4sClgHH4ZZXwdJeNFkJo+hRk479DIwdIviAPN2hFJH1KHHwg8CxHQXvi0M5XY4deTXINfIiSG6w==} + + '@sindresorhus/is@4.6.0': + resolution: {integrity: sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==} + engines: {node: '>=10'} + + '@tybys/wasm-util@0.10.4': + resolution: {integrity: sha512-W3c4gRigFS0T/Ma4qIYF3GDAc5AQdHb1yL5znJT1Zv1YaD9Kitx656wBjvr19qbiosmZT8lWDM5BEMynUqX65A==} + + '@types/validator@13.15.10': + resolution: {integrity: sha512-T8L6i7wCuyoK8A/ZeLYt1+q0ty3Zb9+qbSSvrIVitzT3YjZqkTZ40IbRsPanlB4h1QB3JVL1SYCdR6ngtFYcuA==} + + ajv-formats@3.0.1: + resolution: {integrity: sha512-8iUql50EUR+uUcdRQ3HDqa6EVyo3docL8g5WJ3FNcWmu62IbkGUue/pEyLBW8VGKKucTPgqeks4fIU1DA4yowQ==} + peerDependencies: + ajv: ^8.0.0 + peerDependenciesMeta: + ajv: + optional: true + + ajv@8.20.0: + resolution: {integrity: sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA==} + + ansi-regex@6.6.0: + resolution: {integrity: sha512-XZ5apbzreCbXSKwPjJstu8R0zOi247w3XYwWxtwBXgpZrCyc1Ka7p9/xY0A9/diMewmHbEKz+FIraWaEWjlN5g==} + engines: {node: '>=12'} + + ansis@4.5.0: + resolution: {integrity: sha512-KwIVkfFfJSSzBmZhDGuTmkhWqTdyB5oNVzzznBJbBZ5bZtHiqSrcugRF0RKJKT4Ss3d7ZrcjnlFVDlQNmtWfWw==} + engines: {node: '>=14'} + + braces@3.0.3: + resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} + engines: {node: '>=8'} + + bun@1.4.4: + resolution: {integrity: sha512-hj0ASdG6PNjLZGFAXktWb3Uaj/dcv/1wCsIttoEXADNIQBsGjTr+5uLKYbrDkuc7NT0Tkj4yPIqJI2jDxXdvVg==} + cpu: [arm64, x64] + os: [darwin, linux, android, freebsd, win32] + hasBin: true + + bundle-name@4.1.1: + resolution: {integrity: sha512-DdH81/zPLVS11EUgWq3tEu/xn+EzljlMYooDNdzWEnFha3R3NBMpMV1UqYIpjYHV/SgpFKMIX1Oh7o06SjM/oA==} + engines: {node: '>=18'} + + chalk@5.6.2: + resolution: {integrity: sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA==} + engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} + + char-regex@1.0.2: + resolution: {integrity: sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==} + engines: {node: '>=10'} + + chardet@2.2.0: + resolution: {integrity: sha512-rddelWYNPRrXq6PtNEN2S3f6t9ILzvqaN5pVgi4kqt9jHQaXIial9PznB5iSPVlQSLNaaH22ItWz3EJtQ10+OA==} + + chokidar@5.0.0: + resolution: {integrity: sha512-TQMmc3w+5AxjpL8iIiwebF73dRDF4fBIieAqGn9RGCWaEVwQ6Fb2cGe31Yns0RRIzii5goJ1Y7xbMwo1TxMplw==} + engines: {node: '>= 20.19.0'} + + chownr@3.0.0: + resolution: {integrity: sha512-+IxzY9BZOQd/XuYPRmrvEVjF/nqj5kgT4kEq7VofrDoM1MxoRjEWkrCC3EtLi59TVawxTAn+orJwFQcrqEN1+g==} + engines: {node: '>=18'} + + class-transformer@0.5.1: + resolution: {integrity: sha512-SQa1Ws6hUbfC98vKGxZH3KFY0Y1lm5Zm0SY8XX9zbK7FJCyVEac3ATW0RIpwzW+oOfmHE5PMPufDG9hCfoEOMw==} + + class-validator@0.14.4: + resolution: {integrity: sha512-AwNusCCam51q703dW82x95tOqQp6oC9HNUl724KxJJOfnKscI8dOloXFgyez7LbTTKWuRBA37FScqVbJEoq8Yw==} + + class-validator@0.15.1: + resolution: {integrity: sha512-LqoS80HBBSCVhz/3KloUly0ovokxpdOLR++Al3J3+dHXWt9sTKlKd4eYtoxhxyUjoe5+UcIM+5k9MIxyBWnRTw==} + + cli-cursor@5.0.0: + resolution: {integrity: sha512-aCj4O5wKyszjMmDT4tZj93kxyydN/K5zPWSCe6/0AV/AA1pqe5ZBIw0a2ZfPQV7lL5/yb5HsUreJ6UFAF1tEQw==} + engines: {node: '>=18'} + + cli-spinners@3.4.0: + resolution: {integrity: sha512-bXfOC4QcT1tKXGorxL3wbJm6XJPDqEnij2gQ2m7ESQuE+/z9YFIWnl/5RpTiKWbMq3EVKR4fRLJGn6DVfu0mpw==} + engines: {node: '>=18.20'} + + cli-width@4.1.0: + resolution: {integrity: sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==} + engines: {node: '>= 12'} + + commander@15.1.0: + resolution: {integrity: sha512-cgnQ88TRrWcC7pVq46RzJVRMktu3W2RcbnoidnfBsl1bmDCBwJS/udcIZpKoCrbAYYaCqsz1yZCVIgbIaU3ddQ==} + engines: {node: '>=22.12.0'} + + default-browser-id@5.0.1: + resolution: {integrity: sha512-x1VCxdX4t+8wVfd1so/9w+vQ4vx7lKd2Qp5tDRutErwmR85OgmfX7RlLRMWafRMY7hbEiXIbudNrjOAPa/hL8Q==} + engines: {node: '>=18'} + + default-browser@5.5.1: + resolution: {integrity: sha512-m1pAzaJgZ/gssEqlOhJkPJp8Xly7QyW6xcrkUa2KKcDeDSEMP7X8xipU3snUcfisTQx0w1AGae+9UtJSfVnXGw==} + engines: {node: '>=18'} + + define-lazy-prop@3.0.0: + resolution: {integrity: sha512-N+MeXYoqr3pOgn8xfyRPREN7gHakLYjhsHhWGT3fWAiL4IkAt0iDw14QiiEm2bE30c5XX5q0FtAA3CK5f9/BUg==} + engines: {node: '>=12'} + + defu@6.1.7: + resolution: {integrity: sha512-7z22QmUWiQ/2d0KkdYmANbRUVABpZ9SNYyH5vx6PZ+nE5bcC0l7uFvEfHlyld/HcGBFTL536ClDt3DEcSlEJAQ==} + + destr@2.0.5: + resolution: {integrity: sha512-ugFTXCtDZunbzasqBxrK93Ik/DRYsO6S/fedkWEMKqt04xZ4csmnmwGDBAb07QWNaGMAmnTIemsYZCksjATwsA==} + + dotenv@17.4.2: + resolution: {integrity: sha512-nI4U3TottKAcAD9LLud4Cb7b2QztQMUEfHbvhTH09bqXTxnSie8WnjPALV/WMCrJZ6UV/qHJ6L03OqO3LcdYZw==} + engines: {node: '>=12'} + + dotenv@18.0.10: + resolution: {integrity: sha512-89FAA1xchzK2mxVWdr5F/0rldwiueXs6zJM86rO66EzekR1iBdiXRthyG+m5GvkJaFH3C2LESzamTkgndmLT2A==} + engines: {node: '>=12'} + hasBin: true + + emojilib@2.4.0: + resolution: {integrity: sha512-5U0rVMU5Y2n2+ykNLQqMoqklN9ICBT/KsvC1Gz6vqHbz2AXXGkG+Pm5rMWk/8Vjrr/mY9985Hi8DYzn1F09Nyw==} + + fast-deep-equal@3.1.3: + resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} + + fast-string-truncated-width@3.0.3: + resolution: {integrity: sha512-0jjjIEL6+0jag3l2XWWizO64/aZVtpiGE3t0Zgqxv0DPuxiMjvB3M24fCyhZUO4KomJQPj3LTSUnDP3GpdwC0g==} + + fast-string-width@3.0.2: + resolution: {integrity: sha512-gX8LrtNEI5hq8DVUfRQMbr5lpaS4nMIWV+7XEbXk2b8kiQIizgnlr12B4dA3ZEx3308ze0O4Q1R+cHts8kyUJg==} + + fast-uri@3.1.9: + resolution: {integrity: sha512-hS/0Wt3Ya043oKXs0sIxrMpKQITXhMLIrVAKKXi4gozGC9v7YRWVnXIZzjNPTO02M9BdxLCWqK1yRXgNziVyJQ==} + + fast-wrap-ansi@0.2.2: + resolution: {integrity: sha512-7F2Fl+TjRSenLqlU3UjSH0iyqopqoZIu7eZVpEirP2g1GtWa2G/ecEmBdgz31+Mxr+ELclgg6sokpSFIQiZ02Q==} + + fflate@0.8.3: + resolution: {integrity: sha512-tbZNuJrLwGUp3zshBtdy4W+ORxZuIh8a5ilyIEQDC5rY1f3U20JMry0Ll3WBzU58EZKsEuJFXhb5gwv8CsPvgA==} + + fill-range@7.1.1: + resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} + engines: {node: '>=8'} + + get-east-asian-width@1.7.0: + resolution: {integrity: sha512-XjH1AECxf0giL2V1aU8vKyRR2ppRUb5c0EvT7zuJTokQ74bNo52zOtghqdWIqrhUD79fo3x0WfKZdOqxF6LG1Q==} + engines: {node: '>=18'} + + iconv-lite@0.7.3: + resolution: {integrity: sha512-IKXpvIzjnC9XTAUbVBcMfGS0EPaIXtW6v+zr+RRp+hqULEpo0owZax6wyRwPOJbWbzjYspQwusTsfVr0ifh4uQ==} + engines: {node: '>=0.10.0'} + + is-docker@3.0.0: + resolution: {integrity: sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + hasBin: true + + is-in-ssh@1.0.0: + resolution: {integrity: sha512-jYa6Q9rH90kR1vKB6NM7qqd1mge3Fx4Dhw5TVlK1MUBqhEOuCagrEHMevNuCcbECmXZ0ThXkRm+Ymr51HwEPAw==} + engines: {node: '>=20'} + + is-inside-container@1.0.0: + resolution: {integrity: sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA==} + engines: {node: '>=14.16'} + hasBin: true + + is-interactive@2.0.0: + resolution: {integrity: sha512-qP1vozQRI+BMOPcjFzrjXuQvdak2pHNUMZoeG2eRbiSqyvbEf/wQtEOTOX1guk6E3t36RkaqiSt8A/6YElNxLQ==} + engines: {node: '>=12'} + + is-number@7.0.0: + resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} + engines: {node: '>=0.12.0'} + + is-unicode-supported@2.1.0: + resolution: {integrity: sha512-mE00Gnza5EEB3Ds0HfMyllZzbBrmLOX3vfWoj9A9PEnTfratQ/BcaJOuMhnkhjXvb2+FkY3VuHqtAGpTPmglFQ==} + engines: {node: '>=18'} + + is-wsl@3.1.1: + resolution: {integrity: sha512-e6rvdUCiQCAuumZslxRJWR/Doq4VpPR82kqclvcS0efgt430SlGIk05vdCN58+VrzgtIcfNODjozVielycD4Sw==} + engines: {node: '>=16'} + + json-schema-traverse@1.0.0: + resolution: {integrity: sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==} + + jsonc-parser@3.3.1: + resolution: {integrity: sha512-HUgH65KyejrUFPvHFPbqOY0rsFip3Bo5wb4ngvdi1EpCYWUQDC5V+Y7mZws+DLkr4M//zQJoanu1SP+87Dv1oQ==} + + konva@10.9.1: + resolution: {integrity: sha512-m49x+GatSxEUSvqahYhxpTjgKbtrLtw4P4o4B4iux953ZFpceaK52Ea+CFsAsd7W4I0Y5u6mMoRUsY/eltNZmw==} + peerDependencies: + canvas: ^3.0.0 + skia-canvas: ^3.0.0 + peerDependenciesMeta: + canvas: + optional: true + skia-canvas: + optional: true + + libphonenumber-js@1.13.16: + resolution: {integrity: sha512-tIOCM9yx2Go6d5/ZANe0K+G4AZek1Ymx81HxQpf19Sri4zMP95eQbKdnUGHAvFQ4nx0PeLhFqvAfisTADXj3tQ==} + + log-symbols@7.0.1: + resolution: {integrity: sha512-ja1E3yCr9i/0hmBVaM0bfwDjnGy8I/s6PP4DFp+yP+a+mrHO4Rm7DtmnqROTUkHIkqffC84YY7AeqX6oFk0WFg==} + engines: {node: '>=18'} + + magic-string@1.4.1: + resolution: {integrity: sha512-8lyCu36ErXR0J9uaGKlKQoiLZKmtI63YGLE8G2o9jyRPdr4X47LusSOwgOJOzcVtp81fTAAjxR7BwKz682Jhow==} + + micromatch@4.0.8: + resolution: {integrity: sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==} + engines: {node: '>=8.6'} + + mimic-function@5.0.1: + resolution: {integrity: sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==} + engines: {node: '>=18'} + + minipass@7.1.3: + resolution: {integrity: sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A==} + engines: {node: '>=16 || 14 >=14.17'} + + minizlib@3.1.0: + resolution: {integrity: sha512-KZxYo1BUkWD2TVFLr0MQoM8vUUigWD3LlD83a/75BqC+4qE0Hb1Vo5v1FgcfaNXvfXzr+5EhQ6ing/CaBijTlw==} + engines: {node: '>= 18'} + + mute-stream@4.0.0: + resolution: {integrity: sha512-gSrprq0fJ3EiOErzjdIZrjysVVmJ4uu1QWfCDss5LypA5OXvrMje5Ym5z6V6RLyJ2eF87lasX7t6a0AnFvZblg==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + + node-emoji@2.2.0: + resolution: {integrity: sha512-Z3lTE9pLaJF47NyMhd4ww1yFTAP8YhYI8SleJiHzM46Fgpm5cnNzSl9XfzFNqbaz+VlJrIj3fXQ4DeN1Rjm6cw==} + engines: {node: '>=18'} + + onetime@7.0.0: + resolution: {integrity: sha512-VXJjc87FScF88uafS3JllDgvAm+c/Slfz06lorj2uAY34rlUu0Nt+v8wreiImcrgAjjIHp1rXpTDlLOGw29WwQ==} + engines: {node: '>=18'} + + open@11.0.4: + resolution: {integrity: sha512-++Zlftm0kVLPmzC06t6epuWmcRMDbI4z5P3NNX979WA/k23+NtSOynEGzsVfZwguKw2mi5umVgnBlJQMwRz4Pg==} + engines: {node: '>=20'} + + ora@9.4.1: + resolution: {integrity: sha512-6VlU9MLXbjVQD04AZCMX28hVtA5bUoadvUqO76MUCVA0ilwJbMiHsITRPfyVm6p/BC0Av/BXMujx39WCe1LEqw==} + engines: {node: '>=20'} + + picomatch@2.3.2: + resolution: {integrity: sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==} + engines: {node: '>=8.6'} + + picomatch@4.0.7: + resolution: {integrity: sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA==} + engines: {node: '>=12'} + + powershell-utils@0.2.1: + resolution: {integrity: sha512-C+y9x90UElAddDZmV4qOx9W53B61PO7cIqWz2dQsWlwswuq4mr8NEwytdGKboYbQlGZ3awrkTeNvcZiZNHnQ8A==} + engines: {node: '>=20'} + + rc9@3.1.0: + resolution: {integrity: sha512-ufjkNVzbRHKcCOmTahZkmVsyc3W+MSk3jY03m+a7tGHkIsdVMG9l10/3HvFbWkkKzY5VFp3pkRsIo/UYgmFL7Q==} + + readdirp@5.1.1: + resolution: {integrity: sha512-Kko+Y5XQ6fM+Ce3dq3m9YGxnacYZYl9cA1wZjaF3Vbry2L3i1qVg8+CAgNPsXRArPMUMCaOR7oa9Nqntc43JKA==} + engines: {node: '>= 20.19.0'} + + require-from-string@2.0.2: + resolution: {integrity: sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==} + engines: {node: '>=0.10.0'} + + restore-cursor@5.1.0: + resolution: {integrity: sha512-oMA2dcrw6u0YfxJQXm342bFKX/E4sG9rbTzO9ptUcR/e8A33cHuvStiYOwH7fszkZlZ1z/ta9AAoPk2F4qIOHA==} + engines: {node: '>=18'} + + rolldown@1.3.2: + resolution: {integrity: sha512-EFHqbVkXiYZA6akmYm2bvJhNbEGdUwAResRhYwl/BO8QhB5KxsG+t3RVHJSIOy5jBEb0XCACvrIGnnl6Z8sMGA==} + engines: {node: ^20.19.0 || >=22.12.0} + hasBin: true + + run-applescript@7.1.0: + resolution: {integrity: sha512-DPe5pVFaAsinSaV6QjQ6gdiedWDcRCbUuiQfQa2wmWV7+xC9bGulGI8+TdRmoFkAPaBXk8CrAbnlY2ISniJ47Q==} + engines: {node: '>=18'} + + rxjs@7.8.2: + resolution: {integrity: sha512-dhKf903U/PQZY6boNNtAGdWbG85WAbjT/1xYoZIC7FAY0yWapOBQVsVrDl58W86//e1VpMNBtRV4MaXfdMySFA==} + + safer-buffer@2.1.2: + resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} + + semver@7.8.6: + resolution: {integrity: sha512-9lpSSU4Mly3mrtruwLs1eLK6+gzbzqeBFwRNjIjE+9LuDpWdYctrQlQ3ej1Ilgi7gknpsTRnPoLP8DpCHqHIJw==} + engines: {node: '>=10'} + hasBin: true + + signal-exit@4.1.0: + resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} + engines: {node: '>=14'} + + skin-tone@2.0.0: + resolution: {integrity: sha512-kUMbT1oBJCpgrnKoSr0o6wPtvRWT9W9UKvGLwfJYO2WuahZRHOpEyL1ckyMGgMWh0UdpmaoFqKKD29WTomNEGA==} + engines: {node: '>=8'} + + source-map@0.8.0: + resolution: {integrity: sha512-d8EqvL+k/SOXCreS/SUzg2ciyHqBBLcN/yuRjFsbvVhHTE2pgei7oAhmPM7kWFbkX6OSMQfUq4KbkF3au9lhYQ==} + engines: {node: '>= 12'} + + stdin-discarder@0.3.2: + resolution: {integrity: sha512-eCPu1qRxPVkl5605OTWF8Wz40b4Mf45NY5LQmVPQ599knfs5QhASUm9GbJ5BDMDOXgrnh0wyEdvzmL//YMlw0A==} + engines: {node: '>=18'} + + string-width@8.3.0: + resolution: {integrity: sha512-ZbmZM0JCihQN91dWnxoipT2KOEyHqEyfRXUyjuRhW8b/xnqPDoq4gWEVApTVa9db2wN8mmoikgFBbjh71+cGeQ==} + engines: {node: '>=20'} + + strip-ansi@7.2.0: + resolution: {integrity: sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==} + engines: {node: '>=12'} + + tar@7.5.23: + resolution: {integrity: sha512-lkukzdoGngZHJZXxW4S/E4Fp9ghTDlyZXrQGRNoJ/LXvDKcXUTq2sg5yQe74po7Voea6n/IN09+wE/QvJMiifA==} + engines: {node: '>=18'} + + to-regex-range@5.0.1: + resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} + engines: {node: '>=8.0'} + + tslib@2.9.1: + resolution: {integrity: sha512-a4Ux9VKuIMHsOS7ENbEq6hK2ZGYIT27Rtl0E4eD9KqwxhKiQeMZE/9xb3IdYwWaSOyIBQLExhQgXDTYoiCxnWA==} + + typescript@6.0.3: + resolution: {integrity: sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw==} + engines: {node: '>=14.17'} + hasBin: true + + unicode-emoji-modifier-base@1.0.0: + resolution: {integrity: sha512-yLSH4py7oFH3oG/9K+XWrz1pSi3dfUrWEnInbxMfArOfc1+33BlGPQtLsOYwvdMy11AwUBetYuaRxSPqgkq+8g==} + engines: {node: '>=4'} + + unrun@0.3.1: + resolution: {integrity: sha512-onIck/oNnCaytwths1ZVp1LK2Gq2hPoyFhiHebObuUXqR3S0uHuLLaBK8K6mRRgV7Ptip8AnNvaUsgzwWwBZuA==} + engines: {node: ^22.13.0 || >=24.0.0} + hasBin: true + peerDependencies: + synckit: ^0.11.11 + peerDependenciesMeta: + synckit: + optional: true + + validator@13.15.35: + resolution: {integrity: sha512-TQ5pAGhd5whStmqWvYF4OjQROlmv9SMFVt37qoCBdqRffuuklWYQlCNnEs2ZaIBD1kZRNnikiZOS1eqgkar0iw==} + engines: {node: '>= 0.10'} + + wsl-utils@1.0.1: + resolution: {integrity: sha512-c16PKLIRxBYpR3jSWsdS7SFp0COm5SOQdiFjY818dYFHJbMGuLBszpF07LBWmOS1uzrHa9VGdynsEgoeKy0oOQ==} + engines: {node: '>=20'} + + yallist@5.0.0: + resolution: {integrity: sha512-YgvUTfwqyc7UXVMrB+SImsVYSmTS8X/tSrtdNZMImM+n7+QTriRXyXim0mBrTXNeqzVF0KWGgHPeiyViFFrNDw==} + engines: {node: '>=18'} + + yoctocolors@2.2.0: + resolution: {integrity: sha512-xYqdZFUK/VYazNl/oCDYN+3WloWQwMfZxBoiNt6qNyk+xfOdi598muWE42rNZFp1kNOiqW936q5RhUdnpqElSg==} + engines: {node: '>=18'} + + zod@4.6.7: + resolution: {integrity: sha512-g8W2D2kU6a8untc053fX1uVBKzM7yqAxW/3zwk83+6RyF2+SKOuV+c0wBDhUwzV1PaGapmZH+rmcUzPf+3CGwg==} + +snapshots: + + '@angular-devkit/core@22.2.7(chokidar@5.0.0)': + dependencies: + ajv: 8.20.0 + ajv-formats: 3.0.1(ajv@8.20.0) + jsonc-parser: 3.3.1 + picomatch: 4.0.7 + rxjs: 7.8.2 + source-map: 0.8.0 + optionalDependencies: + chokidar: 5.0.0 + + '@angular-devkit/schematics-cli@22.2.7(chokidar@5.0.0)': + dependencies: + '@angular-devkit/core': 22.2.7(chokidar@5.0.0) + '@angular-devkit/schematics': 22.2.7(chokidar@5.0.0) + '@inquirer/prompts': 8.7.2 + transitivePeerDependencies: + - '@types/node' + - chokidar + + '@angular-devkit/schematics@22.2.7(chokidar@5.0.0)': + dependencies: + '@angular-devkit/core': 22.2.7(chokidar@5.0.0) + jsonc-parser: 3.3.1 + magic-string: 1.4.1 + ora: 9.4.1 + rxjs: 7.8.2 + transitivePeerDependencies: + - chokidar + + '@emnapi/core@2.0.0-beta.2': + dependencies: + '@emnapi/wasi-threads': 2.2.0 + tslib: 2.9.1 + optional: true + + '@emnapi/runtime@2.0.0-beta.2': + dependencies: + tslib: 2.9.1 + optional: true + + '@emnapi/wasi-threads@2.2.0': + dependencies: + tslib: 2.9.1 + optional: true + + '@inquirer/ansi@2.1.0': {} + + '@inquirer/checkbox@5.3.0': + dependencies: + '@inquirer/ansi': 2.1.0 + '@inquirer/core': 12.1.0 + '@inquirer/figures': 2.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/confirm@6.4.0': + dependencies: + '@inquirer/core': 12.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/core@12.1.0': + dependencies: + '@inquirer/ansi': 2.1.0 + '@inquirer/figures': 2.1.0 + '@inquirer/type': 4.3.0 + cli-width: 4.1.0 + fast-wrap-ansi: 0.2.2 + mute-stream: 4.0.0 + signal-exit: 4.1.0 + + '@inquirer/editor@5.4.0': + dependencies: + '@inquirer/core': 12.1.0 + '@inquirer/external-editor': 3.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/expand@5.2.0': + dependencies: + '@inquirer/core': 12.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/external-editor@3.1.0': + dependencies: + chardet: 2.2.0 + iconv-lite: 0.7.3 + + '@inquirer/figures@2.1.0': {} + + '@inquirer/input@5.2.0': + dependencies: + '@inquirer/core': 12.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/number@4.3.0': + dependencies: + '@inquirer/core': 12.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/password@5.3.0': + dependencies: + '@inquirer/ansi': 2.1.0 + '@inquirer/core': 12.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/prompts@8.7.2': + dependencies: + '@inquirer/checkbox': 5.3.0 + '@inquirer/confirm': 6.4.0 + '@inquirer/editor': 5.4.0 + '@inquirer/expand': 5.2.0 + '@inquirer/input': 5.2.0 + '@inquirer/number': 4.3.0 + '@inquirer/password': 5.3.0 + '@inquirer/rawlist': 5.4.0 + '@inquirer/search': 4.4.0 + '@inquirer/select': 5.3.0 + + '@inquirer/prompts@8.8.0': + dependencies: + '@inquirer/checkbox': 5.3.0 + '@inquirer/confirm': 6.4.0 + '@inquirer/editor': 5.4.0 + '@inquirer/expand': 5.2.0 + '@inquirer/input': 5.2.0 + '@inquirer/number': 4.3.0 + '@inquirer/password': 5.3.0 + '@inquirer/rawlist': 5.4.0 + '@inquirer/search': 4.4.0 + '@inquirer/select': 5.3.0 + + '@inquirer/rawlist@5.4.0': + dependencies: + '@inquirer/core': 12.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/search@4.4.0': + dependencies: + '@inquirer/core': 12.1.0 + '@inquirer/figures': 2.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/select@5.3.0': + dependencies: + '@inquirer/ansi': 2.1.0 + '@inquirer/core': 12.1.0 + '@inquirer/figures': 2.1.0 + '@inquirer/type': 4.3.0 + + '@inquirer/type@4.3.0': {} + + '@isaacs/fs-minipass@4.0.1': + dependencies: + minipass: 7.1.3 + + '@jridgewell/sourcemap-codec@1.6.0': {} + + '@nanoforge-dev/asset@3.0.0': + dependencies: + '@nanoforge-dev/common': 3.0.0 + + '@nanoforge-dev/cli@3.0.1': + dependencies: + '@angular-devkit/schematics': 22.2.7(chokidar@5.0.0) + '@angular-devkit/schematics-cli': 22.2.7(chokidar@5.0.0) + '@inquirer/prompts': 8.8.0 + '@nanoforge-dev/config': 3.0.1 + '@nanoforge-dev/editor': 0.1.4 + '@nanoforge-dev/loader-client': 1.7.0 + '@nanoforge-dev/loader-server': 1.7.0 + '@nanoforge-dev/registry': 3.0.1 + '@nanoforge-dev/schematics': 3.0.1(chokidar@5.0.0) + ansis: 4.5.0 + bun: 1.4.4 + chokidar: 5.0.0 + commander: 15.1.0 + dotenv: 18.0.10 + node-emoji: 2.2.0 + open: 11.0.4 + ora: 9.4.1 + rc9: 3.1.0 + transitivePeerDependencies: + - '@types/node' + - synckit + + '@nanoforge-dev/common@3.0.0': {} + + '@nanoforge-dev/config@3.0.1': + dependencies: + unrun: 0.3.1 + zod: 4.6.7 + transitivePeerDependencies: + - synckit + + '@nanoforge-dev/core@3.0.0': + dependencies: + '@nanoforge-dev/asset': 3.0.0 + '@nanoforge-dev/common': 3.0.0 + + '@nanoforge-dev/ecs@3.0.0(@nanoforge-dev/editor-lib@3.0.0)(@nanoforge-dev/scene@3.0.0(@nanoforge-dev/editor-lib@3.0.0))': + dependencies: + '@nanoforge-dev/common': 3.0.0 + optionalDependencies: + '@nanoforge-dev/editor-lib': 3.0.0 + '@nanoforge-dev/scene': 3.0.0(@nanoforge-dev/editor-lib@3.0.0) + + '@nanoforge-dev/editor-lib@3.0.0': + dependencies: + '@nanoforge-dev/common': 3.0.0 + + '@nanoforge-dev/editor@0.1.4': + dependencies: + bun: 1.4.4 + class-transformer: 0.5.1 + class-validator: 0.15.1 + dotenv: 17.4.2 + micromatch: 4.0.8 + tar: 7.5.23 + typescript: 6.0.3 + + '@nanoforge-dev/env@3.0.0': + dependencies: + '@nanoforge-dev/common': 3.0.0 + class-transformer: 0.5.1 + class-validator: 0.14.4 + + '@nanoforge-dev/graphics-2d@3.0.0': + dependencies: + '@nanoforge-dev/common': 3.0.0 + konva: 10.9.1 + transitivePeerDependencies: + - canvas + - skia-canvas + + '@nanoforge-dev/input@3.0.0': + dependencies: + '@nanoforge-dev/common': 3.0.0 + + '@nanoforge-dev/loader-client@1.7.0': + dependencies: + '@nanoforge-dev/loader-website': 1.7.0 + bun: 1.4.4 + commander: 15.1.0 + + '@nanoforge-dev/loader-server@1.7.0': + dependencies: + bun: 1.4.4 + commander: 15.1.0 + + '@nanoforge-dev/loader-website@1.7.0': {} + + '@nanoforge-dev/registry@3.0.1': + dependencies: + fflate: 0.8.3 + semver: 7.8.6 + zod: 4.6.7 + + '@nanoforge-dev/scene@3.0.0(@nanoforge-dev/editor-lib@3.0.0)': + dependencies: + '@nanoforge-dev/common': 3.0.0 + optionalDependencies: + '@nanoforge-dev/editor-lib': 3.0.0 + + '@nanoforge-dev/schematics@3.0.1(chokidar@5.0.0)': + dependencies: + '@angular-devkit/core': 22.2.7(chokidar@5.0.0) + '@angular-devkit/schematics': 22.2.7(chokidar@5.0.0) + rxjs: 7.8.2 + transitivePeerDependencies: + - chokidar + + '@nanoforge-dev/sound@3.0.0(@nanoforge-dev/editor-lib@3.0.0)': + dependencies: + '@nanoforge-dev/common': 3.0.0 + optionalDependencies: + '@nanoforge-dev/editor-lib': 3.0.0 + + '@napi-rs/wasm-runtime@1.2.6(@emnapi/core@2.0.0-beta.2)(@emnapi/runtime@2.0.0-beta.2)': + dependencies: + '@emnapi/core': 2.0.0-beta.2 + '@emnapi/runtime': 2.0.0-beta.2 + '@tybys/wasm-util': 0.10.4 + optional: true + + '@oven/bun-darwin-aarch64@1.4.4': + optional: true + + '@oven/bun-darwin-x64@1.4.4': + optional: true + + '@oven/bun-freebsd-aarch64@1.4.4': + optional: true + + '@oven/bun-freebsd-x64@1.4.4': + optional: true + + '@oven/bun-linux-aarch64-android@1.4.4': + optional: true + + '@oven/bun-linux-aarch64-musl@1.4.4': + optional: true + + '@oven/bun-linux-aarch64@1.4.4': + optional: true + + '@oven/bun-linux-x64-android@1.4.4': + optional: true + + '@oven/bun-linux-x64-musl@1.4.4': + optional: true + + '@oven/bun-linux-x64@1.4.4': + optional: true + + '@oven/bun-windows-aarch64@1.4.4': + optional: true + + '@oven/bun-windows-x64@1.4.4': + optional: true + + '@oxc-project/types@0.158.0': {} + + '@rolldown/binding-android-arm-eabi@1.3.2': + optional: true + + '@rolldown/binding-android-arm64@1.3.2': + optional: true + + '@rolldown/binding-darwin-arm64@1.3.2': + optional: true + + '@rolldown/binding-darwin-x64@1.3.2': + optional: true + + '@rolldown/binding-freebsd-x64@1.3.2': + optional: true + + '@rolldown/binding-linux-arm-gnueabihf@1.3.2': + optional: true + + '@rolldown/binding-linux-arm64-gnu@1.3.2': + optional: true + + '@rolldown/binding-linux-arm64-musl@1.3.2': + optional: true + + '@rolldown/binding-linux-ppc64-gnu@1.3.2': + optional: true + + '@rolldown/binding-linux-s390x-gnu@1.3.2': + optional: true + + '@rolldown/binding-linux-x64-gnu@1.3.2': + optional: true + + '@rolldown/binding-linux-x64-musl@1.3.2': + optional: true + + '@rolldown/binding-openharmony-arm64@1.3.2': + optional: true + + '@rolldown/binding-wasm32-wasi@1.3.2': + dependencies: + '@emnapi/core': 2.0.0-beta.2 + '@emnapi/runtime': 2.0.0-beta.2 + '@napi-rs/wasm-runtime': 1.2.6(@emnapi/core@2.0.0-beta.2)(@emnapi/runtime@2.0.0-beta.2) + optional: true + + '@rolldown/binding-win32-arm64-msvc@1.3.2': + optional: true + + '@rolldown/binding-win32-x64-msvc@1.3.2': + optional: true + + '@rolldown/pluginutils@1.1.0': {} + + '@sindresorhus/is@4.6.0': {} + + '@tybys/wasm-util@0.10.4': + dependencies: + tslib: 2.9.1 + optional: true + + '@types/validator@13.15.10': {} + + ajv-formats@3.0.1(ajv@8.20.0): + optionalDependencies: + ajv: 8.20.0 + + ajv@8.20.0: + dependencies: + fast-deep-equal: 3.1.3 + fast-uri: 3.1.9 + json-schema-traverse: 1.0.0 + require-from-string: 2.0.2 + + ansi-regex@6.6.0: {} + + ansis@4.5.0: {} + + braces@3.0.3: + dependencies: + fill-range: 7.1.1 + + bun@1.4.4: + optionalDependencies: + '@oven/bun-darwin-aarch64': 1.4.4 + '@oven/bun-darwin-x64': 1.4.4 + '@oven/bun-freebsd-aarch64': 1.4.4 + '@oven/bun-freebsd-x64': 1.4.4 + '@oven/bun-linux-aarch64': 1.4.4 + '@oven/bun-linux-aarch64-android': 1.4.4 + '@oven/bun-linux-aarch64-musl': 1.4.4 + '@oven/bun-linux-x64': 1.4.4 + '@oven/bun-linux-x64-android': 1.4.4 + '@oven/bun-linux-x64-musl': 1.4.4 + '@oven/bun-windows-aarch64': 1.4.4 + '@oven/bun-windows-x64': 1.4.4 + + bundle-name@4.1.1: + dependencies: + run-applescript: 7.1.0 + + chalk@5.6.2: {} + + char-regex@1.0.2: {} + + chardet@2.2.0: {} + + chokidar@5.0.0: + dependencies: + readdirp: 5.1.1 + + chownr@3.0.0: {} + + class-transformer@0.5.1: {} + + class-validator@0.14.4: + dependencies: + '@types/validator': 13.15.10 + libphonenumber-js: 1.13.16 + validator: 13.15.35 + + class-validator@0.15.1: + dependencies: + '@types/validator': 13.15.10 + libphonenumber-js: 1.13.16 + validator: 13.15.35 + + cli-cursor@5.0.0: + dependencies: + restore-cursor: 5.1.0 + + cli-spinners@3.4.0: {} + + cli-width@4.1.0: {} + + commander@15.1.0: {} + + default-browser-id@5.0.1: {} + + default-browser@5.5.1: + dependencies: + bundle-name: 4.1.1 + default-browser-id: 5.0.1 + + define-lazy-prop@3.0.0: {} + + defu@6.1.7: {} + + destr@2.0.5: {} + + dotenv@17.4.2: {} + + dotenv@18.0.10: {} + + emojilib@2.4.0: {} + + fast-deep-equal@3.1.3: {} + + fast-string-truncated-width@3.0.3: {} + + fast-string-width@3.0.2: + dependencies: + fast-string-truncated-width: 3.0.3 + + fast-uri@3.1.9: {} + + fast-wrap-ansi@0.2.2: + dependencies: + fast-string-width: 3.0.2 + + fflate@0.8.3: {} + + fill-range@7.1.1: + dependencies: + to-regex-range: 5.0.1 + + get-east-asian-width@1.7.0: {} + + iconv-lite@0.7.3: + dependencies: + safer-buffer: 2.1.2 + + is-docker@3.0.0: {} + + is-in-ssh@1.0.0: {} + + is-inside-container@1.0.0: + dependencies: + is-docker: 3.0.0 + + is-interactive@2.0.0: {} + + is-number@7.0.0: {} + + is-unicode-supported@2.1.0: {} + + is-wsl@3.1.1: + dependencies: + is-inside-container: 1.0.0 + + json-schema-traverse@1.0.0: {} + + jsonc-parser@3.3.1: {} + + konva@10.9.1: {} + + libphonenumber-js@1.13.16: {} + + log-symbols@7.0.1: + dependencies: + is-unicode-supported: 2.1.0 + yoctocolors: 2.2.0 + + magic-string@1.4.1: + dependencies: + '@jridgewell/sourcemap-codec': 1.6.0 + + micromatch@4.0.8: + dependencies: + braces: 3.0.3 + picomatch: 2.3.2 + + mimic-function@5.0.1: {} + + minipass@7.1.3: {} + + minizlib@3.1.0: + dependencies: + minipass: 7.1.3 + + mute-stream@4.0.0: {} + + node-emoji@2.2.0: + dependencies: + '@sindresorhus/is': 4.6.0 + char-regex: 1.0.2 + emojilib: 2.4.0 + skin-tone: 2.0.0 + + onetime@7.0.0: + dependencies: + mimic-function: 5.0.1 + + open@11.0.4: + dependencies: + default-browser: 5.5.1 + define-lazy-prop: 3.0.0 + is-in-ssh: 1.0.0 + is-inside-container: 1.0.0 + powershell-utils: 0.2.1 + wsl-utils: 1.0.1 + + ora@9.4.1: + dependencies: + chalk: 5.6.2 + cli-cursor: 5.0.0 + cli-spinners: 3.4.0 + is-interactive: 2.0.0 + is-unicode-supported: 2.1.0 + log-symbols: 7.0.1 + stdin-discarder: 0.3.2 + string-width: 8.3.0 + + picomatch@2.3.2: {} + + picomatch@4.0.7: {} + + powershell-utils@0.2.1: {} + + rc9@3.1.0: + dependencies: + defu: 6.1.7 + destr: 2.0.5 + + readdirp@5.1.1: {} + + require-from-string@2.0.2: {} + + restore-cursor@5.1.0: + dependencies: + onetime: 7.0.0 + signal-exit: 4.1.0 + + rolldown@1.3.2: + dependencies: + '@oxc-project/types': 0.158.0 + '@rolldown/pluginutils': 1.1.0 + optionalDependencies: + '@rolldown/binding-android-arm-eabi': 1.3.2 + '@rolldown/binding-android-arm64': 1.3.2 + '@rolldown/binding-darwin-arm64': 1.3.2 + '@rolldown/binding-darwin-x64': 1.3.2 + '@rolldown/binding-freebsd-x64': 1.3.2 + '@rolldown/binding-linux-arm-gnueabihf': 1.3.2 + '@rolldown/binding-linux-arm64-gnu': 1.3.2 + '@rolldown/binding-linux-arm64-musl': 1.3.2 + '@rolldown/binding-linux-ppc64-gnu': 1.3.2 + '@rolldown/binding-linux-s390x-gnu': 1.3.2 + '@rolldown/binding-linux-x64-gnu': 1.3.2 + '@rolldown/binding-linux-x64-musl': 1.3.2 + '@rolldown/binding-openharmony-arm64': 1.3.2 + '@rolldown/binding-wasm32-wasi': 1.3.2 + '@rolldown/binding-win32-arm64-msvc': 1.3.2 + '@rolldown/binding-win32-x64-msvc': 1.3.2 + + run-applescript@7.1.0: {} + + rxjs@7.8.2: + dependencies: + tslib: 2.9.1 + + safer-buffer@2.1.2: {} + + semver@7.8.6: {} + + signal-exit@4.1.0: {} + + skin-tone@2.0.0: + dependencies: + unicode-emoji-modifier-base: 1.0.0 + + source-map@0.8.0: {} + + stdin-discarder@0.3.2: {} + + string-width@8.3.0: + dependencies: + get-east-asian-width: 1.7.0 + strip-ansi: 7.2.0 + + strip-ansi@7.2.0: + dependencies: + ansi-regex: 6.6.0 + + tar@7.5.23: + dependencies: + '@isaacs/fs-minipass': 4.0.1 + chownr: 3.0.0 + minipass: 7.1.3 + minizlib: 3.1.0 + yallist: 5.0.0 + + to-regex-range@5.0.1: + dependencies: + is-number: 7.0.0 + + tslib@2.9.1: {} + + typescript@6.0.3: {} + + unicode-emoji-modifier-base@1.0.0: {} + + unrun@0.3.1: + dependencies: + rolldown: 1.3.2 + + validator@13.15.35: {} + + wsl-utils@1.0.1: + dependencies: + is-wsl: 3.1.1 + powershell-utils: 0.2.1 + + yallist@5.0.0: {} + + yoctocolors@2.2.0: {} + + zod@4.6.7: {} diff --git a/games/flappy-bird/pnpm-workspace.yaml b/games/flappy-bird/pnpm-workspace.yaml new file mode 100644 index 0000000..96ca535 --- /dev/null +++ b/games/flappy-bird/pnpm-workspace.yaml @@ -0,0 +1,5 @@ +allowBuilds: + bun: true +# NanoForge packages are ours: take a release as soon as it is out. +minimumReleaseAgeExclude: + - "@nanoforge-dev/*" diff --git a/games/flappy-bird/src/components/bird.component.ts b/games/flappy-bird/src/components/bird.component.ts new file mode 100644 index 0000000..7eab2a0 --- /dev/null +++ b/games/flappy-bird/src/components/bird.component.ts @@ -0,0 +1,29 @@ +/** + * The bird: it falls, flaps up when the player presses Space, clicks or taps, and dies on a pipe + * or the ground. Needs `Position2D` (its center), `Velocity2D`, `DrawableRect2D` and the `flap`, + * `fly` and `collide` systems. + * + * @component + * @side client + * @group Flight color=#f0a33a - How the bird moves. + * @group Hit color=#eb4d4b - When the bird dies. + */ +export class Bird { + name = "Bird"; + + /** Whether it hit a pipe or the ground, set by `collide`. */ + dead = false; + + constructor( + /** Added to the falling speed every second, in pixels per second, per second. @group Flight */ + public gravity = 1500, + /** Upward speed of a flap, in pixels per second. @group Flight */ + public flapSpeed = 430, + /** The fastest it falls, in pixels per second. @group Flight */ + public maxFallSpeed = 640, + /** Pixels from the top of the screen to the ground. @group Hit */ + public groundY = 448, + /** Part of its size left out of its hitbox on each side, from 0 to 0.5. @group Hit */ + public hitboxInset = 0.25, + ) {} +} diff --git a/games/flappy-bird/src/components/draw-order-2d.component.ts b/games/flappy-bird/src/components/draw-order-2d.component.ts new file mode 100644 index 0000000..a08cac6 --- /dev/null +++ b/games/flappy-bird/src/components/draw-order-2d.component.ts @@ -0,0 +1,23 @@ +/** + * Where an entity's drawable is in the stack: a higher `z` is drawn over a lower one. A system + * applies it: `drawOrder2D` for the `Drawable*2D` shapes, or the game's own. + * + * @remarks + * Without such a system, a shape is drawn over the shapes that appeared before it, and a scene + * loaded again can stack its shapes in another order. + * + * @component + * @side client + * @group Order color=#b18cff - Drawing order. + */ +export class DrawOrder2D { + name = "DrawOrder2D"; + + /** The `z` the shape was last stacked at, set by `drawOrder2D`. */ + stackedZ?: number; + + constructor( + /** Higher is drawn over lower; entities without it are under every one with it. @group Order */ + public z = 0, + ) {} +} diff --git a/games/flappy-bird/src/components/drawable-circle-2d.component.ts b/games/flappy-bird/src/components/drawable-circle-2d.component.ts new file mode 100644 index 0000000..1066155 --- /dev/null +++ b/games/flappy-bird/src/components/drawable-circle-2d.component.ts @@ -0,0 +1,62 @@ +import type { AssetContext } from "@nanoforge-dev/common"; +import { Circle, type Layer } from "@nanoforge-dev/graphics-2d"; +import type { Position2D } from "./position-2d.component"; + +import { imageFill } from "../image-fill"; + +/** + * Draws a circle at the entity's `Position2D` (its center). Needs the `draw2D` system. + * + * @remarks + * `shape` is the Konva `Circle` on screen: change it from code for anything the parameters don't + * offer (shadows, strokes...). + * + * @component + * @side client + * @group Shape color=#e86fb0 - Size of the circle. + * @group Look color=#b18cff - What the circle looks like. + * @group Advanced hidden - Less common settings. + */ +export class DrawableCircle2D { + name = "DrawableCircle2D"; + + /** The circle on screen, made by `draw2D` the first time it draws it. */ + shape?: Circle; + + constructor( + /** In pixels. @group Shape */ + public radius = 25, + /** A CSS color: `red`, `#ff0000`, `rgba(255, 0, 0, 0.5)`... @group Look @preset color */ + public fillColor = "#4aa3ff", + /** An image stretched over the circle, shown instead of the color. @group Look @asset .png .jpg .jpeg .gif .webp .svg */ + public image = "", + /** From 0 (invisible) to 1 (opaque). @group Look */ + public opacity = 1, + /** Clockwise, in degrees, around the center. @group Advanced */ + public rotation = 0, + /** Whether it is drawn. @group Advanced */ + public visible = true, + ) {} + + /** Puts the circle on `layer` at `position`, up to date with the parameters. */ + draw(layer: Layer, position: Position2D, assets: AssetContext): void { + this.shape ??= new Circle(); + if (this.shape.getParent() !== layer) layer.add(this.shape); + this.shape.setAttrs({ + x: position.x, + y: position.y, + radius: this.radius, + fill: this.fillColor, + opacity: this.opacity, + rotation: this.rotation, + visible: this.visible, + ...imageFill(assets, this.image, this.radius * 2, this.radius * 2, true), + }); + } + + /** Removes the circle from the screen. */ + destroy(): void { + this.shape?.destroy(); + this.shape = undefined; + } +} diff --git a/games/flappy-bird/src/components/drawable-rect-2d.component.ts b/games/flappy-bird/src/components/drawable-rect-2d.component.ts new file mode 100644 index 0000000..d3586ca --- /dev/null +++ b/games/flappy-bird/src/components/drawable-rect-2d.component.ts @@ -0,0 +1,69 @@ +import type { AssetContext } from "@nanoforge-dev/common"; +import { type Layer, Rect } from "@nanoforge-dev/graphics-2d"; +import type { Position2D } from "./position-2d.component"; + +import { imageFill } from "../image-fill"; + +/** + * Draws a rectangle at the entity's `Position2D` (its top-left corner). Needs the `draw2D` + * system. + * + * @remarks + * `shape` is the Konva `Rect` on screen: change it from code for anything the parameters don't + * offer (shadows, strokes...). + * + * @component + * @side client + * @group Shape color=#e86fb0 - Size of the rectangle. + * @group Look color=#b18cff - What the rectangle looks like. + * @group Advanced hidden - Less common settings. + */ +export class DrawableRect2D { + name = "DrawableRect2D"; + + /** The rectangle on screen, made by `draw2D` the first time it draws it. */ + shape?: Rect; + + constructor( + /** In pixels. @group Shape @preset size.width */ + public width = 50, + /** In pixels. @group Shape @preset size.height */ + public height = 50, + /** A CSS color: `red`, `#ff0000`, `rgba(255, 0, 0, 0.5)`... @group Look @preset color */ + public fillColor = "#4aa3ff", + /** An image stretched over the rectangle, shown instead of the color. @group Look @asset .png .jpg .jpeg .gif .webp .svg */ + public image = "", + /** From 0 (invisible) to 1 (opaque). @group Look */ + public opacity = 1, + /** Clockwise, in degrees, around the top-left corner. @group Advanced */ + public rotation = 0, + /** Rounds the corners, in pixels. @group Advanced */ + public cornerRadius = 0, + /** Whether it is drawn. @group Advanced */ + public visible = true, + ) {} + + /** Puts the rectangle on `layer` at `position`, up to date with the parameters. */ + draw(layer: Layer, position: Position2D, assets: AssetContext): void { + this.shape ??= new Rect(); + if (this.shape.getParent() !== layer) layer.add(this.shape); + this.shape.setAttrs({ + x: position.x, + y: position.y, + width: this.width, + height: this.height, + fill: this.fillColor, + opacity: this.opacity, + rotation: this.rotation, + cornerRadius: this.cornerRadius, + visible: this.visible, + ...imageFill(assets, this.image, this.width, this.height), + }); + } + + /** Removes the rectangle from the screen. */ + destroy(): void { + this.shape?.destroy(); + this.shape = undefined; + } +} diff --git a/games/flappy-bird/src/components/drawable-text-2d.component.ts b/games/flappy-bird/src/components/drawable-text-2d.component.ts new file mode 100644 index 0000000..adba963 --- /dev/null +++ b/games/flappy-bird/src/components/drawable-text-2d.component.ts @@ -0,0 +1,62 @@ +import { type Layer, Text } from "@nanoforge-dev/graphics-2d"; +import type { Position2D } from "./position-2d.component"; + +/** + * Draws a text at the entity's `Position2D` (its top-left corner). Needs the `draw2D` system. + * + * @remarks + * Change `text` from a system to show a score, a timer... `shape` is the Konva `Text` on screen: + * change it from code for anything the parameters don't offer. + * + * @component + * @side client + * @group Text color=#e86fb0 - What is written. + * @group Look color=#b18cff - What the text looks like. + * @group Advanced hidden - Less common settings. + */ +export class DrawableText2D { + name = "DrawableText2D"; + + /** The text on screen, made by `draw2D` the first time it draws it. */ + shape?: Text; + + constructor( + /** What is written. @group Text */ + public text = "Hello", + /** Height of the letters, in pixels. @group Text */ + public fontSize = 24, + /** A CSS color: `white`, `#ffffff`... @group Look @preset color */ + public fillColor = "#ffffff", + /** From 0 (invisible) to 1 (opaque). @group Look */ + public opacity = 1, + /** A CSS font family: `Arial`, `monospace`... @group Advanced */ + public fontFamily = "Arial", + /** Clockwise, in degrees, around the top-left corner. @group Advanced */ + public rotation = 0, + /** Whether it is drawn. @group Advanced */ + public visible = true, + ) {} + + /** Puts the text on `layer` at `position`, up to date with the parameters. */ + draw(layer: Layer, position: Position2D): void { + this.shape ??= new Text(); + if (this.shape.getParent() !== layer) layer.add(this.shape); + this.shape.setAttrs({ + x: position.x, + y: position.y, + text: this.text, + fontSize: this.fontSize, + fontFamily: this.fontFamily, + fill: this.fillColor, + opacity: this.opacity, + rotation: this.rotation, + visible: this.visible, + }); + } + + /** Removes the text from the screen. */ + destroy(): void { + this.shape?.destroy(); + this.shape = undefined; + } +} diff --git a/games/flappy-bird/src/components/pipe-spawner.component.ts b/games/flappy-bird/src/components/pipe-spawner.component.ts new file mode 100644 index 0000000..b8f5856 --- /dev/null +++ b/games/flappy-bird/src/components/pipe-spawner.component.ts @@ -0,0 +1,39 @@ +/** + * How the pipes come: how fast, how often, and how wide their gap is. The `movePipes` system + * takes a pair of `Pipe` entities that left the screen and brings it back on the right. + * + * @remarks + * The gap shrinks by `gapStep` for every point, down to `minGap`, give or take `gapJitter`. + * + * @component + * @side client + * @group Flow color=#36c5a0 - How fast and how often the pipes come. + * @group Gap color=#f0a33a - The opening between two pipes. + */ +export class PipeSpawner { + name = "PipeSpawner"; + + /** Seconds left before the next pair comes. */ + timer = 0; + + constructor( + /** Pixels per second to the left. @group Flow */ + public speed = 150, + /** Seconds between two pairs. @group Flow */ + public interval = 1.5, + /** Where a pair comes in, in pixels from the left (the right edge of the screen). @group Flow */ + public startX = 420, + /** Height of the gap at the start, in pixels. @group Gap */ + public baseGap = 150, + /** The smallest gap, in pixels. @group Gap */ + public minGap = 110, + /** Pixels the gap loses for every point. @group Gap */ + public gapStep = 2.5, + /** Random pixels added to or taken from the gap. @group Gap */ + public gapJitter = 16, + /** The least room between the gap and the sky or the ground, in pixels. @group Gap */ + public margin = 60, + /** Pixels from the top of the screen to the ground. @group Gap */ + public groundY = 448, + ) {} +} diff --git a/games/flappy-bird/src/components/pipe.component.ts b/games/flappy-bird/src/components/pipe.component.ts new file mode 100644 index 0000000..54a73d0 --- /dev/null +++ b/games/flappy-bird/src/components/pipe.component.ts @@ -0,0 +1,25 @@ +/** + * One half of a pair of pipes: the top one hangs from the sky, the bottom one stands on the + * ground. Needs `Position2D`, `DrawableRect2D` and the `movePipes` system. + * + * @remarks + * The top pipe's `DrawableRect2D` is turned by 180 degrees: its `Position2D` is its bottom-right + * corner, the edge of the gap. + * + * @component + * @side client + * @group Pipe color=#73bf2e - Which pipe it is. + */ +export class Pipe { + name = "Pipe"; + + /** Whether the bird flew past it, set by `scorePipes`. */ + scored = false; + + constructor( + /** The pair it belongs to: both halves of a pair move together. @group Pipe */ + public pair = 0, + /** Whether it is the top half. @group Pipe */ + public top = false, + ) {} +} diff --git a/games/flappy-bird/src/components/position-2d.component.ts b/games/flappy-bird/src/components/position-2d.component.ts new file mode 100644 index 0000000..0a35624 --- /dev/null +++ b/games/flappy-bird/src/components/position-2d.component.ts @@ -0,0 +1,20 @@ +/** + * Where an entity is, in pixels from the top-left corner of the screen. + * + * @remarks + * For rectangles it is their top-left corner, for circles their center. + * + * @component + * @side shared + * @group Position color=#4aa3ff - Pixels from the top-left corner of the screen. + */ +export class Position2D { + name = "Position2D"; + + constructor( + /** Pixels from the left edge. @group Position @preset vector.x */ + public x = 0, + /** Pixels from the top edge. @group Position @preset vector.y */ + public y = 0, + ) {} +} diff --git a/games/flappy-bird/src/components/restart-delay.component.ts b/games/flappy-bird/src/components/restart-delay.component.ts new file mode 100644 index 0000000..9b3d27b --- /dev/null +++ b/games/flappy-bird/src/components/restart-delay.component.ts @@ -0,0 +1,19 @@ +/** + * How long the game over screen waits before a flap restarts the game, so that a flap made just + * as the bird died doesn't. Needs the `restart` system. + * + * @component + * @side client + * @group Restart color=#eb4d4b - The wait before a restart. + */ +export class RestartDelay { + name = "RestartDelay"; + + /** Seconds since the game over screen came. */ + elapsed = 0; + + constructor( + /** In seconds. @group Restart */ + public seconds = 0.4, + ) {} +} diff --git a/games/flappy-bird/src/components/score-digit.component.ts b/games/flappy-bird/src/components/score-digit.component.ts new file mode 100644 index 0000000..60ef677 --- /dev/null +++ b/games/flappy-bird/src/components/score-digit.component.ts @@ -0,0 +1,21 @@ +/** + * One digit of the score, drawn with the digit images (`/0.png` to `/9.png`). Needs + * `Position2D`, `DrawableRect2D` and the `showScore` system. + * + * @remarks + * `showScore` centers the digits, and hides the ones the score doesn't need. + * + * @component + * @side client + * @group Digit color=#f9ca24 - Which digit it shows. + */ +export class ScoreDigit { + name = "ScoreDigit"; + + constructor( + /** Its place from the left: 0 is the first digit. @group Digit */ + public index = 0, + /** Where the score is centered, in pixels from the left. @group Digit */ + public centerX = 210, + ) {} +} diff --git a/games/flappy-bird/src/components/scroll-loop.component.ts b/games/flappy-bird/src/components/scroll-loop.component.ts new file mode 100644 index 0000000..5466902 --- /dev/null +++ b/games/flappy-bird/src/components/scroll-loop.component.ts @@ -0,0 +1,22 @@ +/** + * Scrolls an entity to the left, and brings it back on the right once it has left the screen: a + * few tiles side by side make an endless strip. Needs `Position2D`, `DrawableRect2D` and the + * `scrollGround` system. + * + * @example + * Three 336-pixel tiles at x 0, 336 and 672, each with `new ScrollLoop(150, 1008)`. + * + * @component + * @side client + * @group Scroll color=#36c5a0 - How the entity scrolls. + */ +export class ScrollLoop { + name = "ScrollLoop"; + + constructor( + /** Pixels per second to the left. @group Scroll */ + public speed = 150, + /** Pixels it jumps to the right once out of the screen: the width of all the tiles. @group Scroll */ + public span = 1008, + ) {} +} diff --git a/games/flappy-bird/src/components/sound-effect.component.ts b/games/flappy-bird/src/components/sound-effect.component.ts new file mode 100644 index 0000000..4476f31 --- /dev/null +++ b/games/flappy-bird/src/components/sound-effect.component.ts @@ -0,0 +1,20 @@ +/** + * A sound the game plays by its `key` with `ctx.sound.play(key)`. Needs the `loadSounds` system. + * + * @component + * @side client + * @group Sound color=#36c5a0 - The sound and its name. + */ +export class SoundEffect { + name = "SoundEffect"; + + /** Whether `loadSounds` gave it to the sound library. */ + loaded = false; + + constructor( + /** The name systems play it by. @group Sound */ + public key = "click", + /** The sound file. @group Sound @asset .wav .mp3 .ogg */ + public path = "", + ) {} +} diff --git a/games/flappy-bird/src/components/velocity-2d.component.ts b/games/flappy-bird/src/components/velocity-2d.component.ts new file mode 100644 index 0000000..3b93d4e --- /dev/null +++ b/games/flappy-bird/src/components/velocity-2d.component.ts @@ -0,0 +1,20 @@ +/** + * How fast an entity moves, in pixels per second. Needs `Position2D` and the `move2D` system. + * + * @example + * `new Velocity2D(100, 0)` moves 100 pixels to the right every second. + * + * @component + * @side shared + * @group Velocity color=#36c5a0 - Pixels per second. + */ +export class Velocity2D { + name = "Velocity2D"; + + constructor( + /** Pixels per second to the right (negative: to the left). @group Velocity @preset vector.x */ + public x = 0, + /** Pixels per second downward (negative: upward). @group Velocity @preset vector.y */ + public y = 0, + ) {} +} diff --git a/games/flappy-bird/src/flap-pressed.ts b/games/flappy-bird/src/flap-pressed.ts new file mode 100644 index 0000000..991a1fc --- /dev/null +++ b/games/flappy-bird/src/flap-pressed.ts @@ -0,0 +1,37 @@ +import type { Context } from "@nanoforge-dev/common"; +import { InputEnum } from "@nanoforge-dev/input"; + +import { justPressed } from "./just-pressed"; + +/** Whether the game was touched since the last call. */ +let tapped = false; +let listening = false; + +/** + * Whether the player flapped since the last call: Space, a click or a tap on the game. + * + * @remarks + * The input library has no touch events, and the mouse events a browser makes from a tap are + * likely to go down and up between two frames, where no system sees them: taps are listened to + * here. + */ +export const flapPressed = (ctx: Context): boolean => { + if (!listening) { + listening = true; + window.addEventListener( + "touchstart", + (event) => { + if (!(event.target instanceof HTMLCanvasElement)) return; + // No scrolling or zooming the page, and no mouse events made from the tap. + event.preventDefault(); + tapped = true; + }, + { passive: false }, + ); + } + const space = justPressed(ctx, InputEnum.Space); + const click = justPressed(ctx, InputEnum.MouseLeft); + const tap = tapped; + tapped = false; + return space || click || tap; +}; diff --git a/games/flappy-bird/src/image-fill.ts b/games/flappy-bird/src/image-fill.ts new file mode 100644 index 0000000..c7fc737 --- /dev/null +++ b/games/flappy-bird/src/image-fill.ts @@ -0,0 +1,43 @@ +import type { AssetContext } from "@nanoforge-dev/common"; +import type { ShapeConfig } from "@nanoforge-dev/graphics-2d"; + +const images = new Map(); + +/** + * The fill of a shape of `width` by `height` pixels showing the image at `path` (an asset path + * such as `/textures/hero.png`, found in `assets`) stretched over it. Without an image, until it + * is loaded, or when there is no asset at `path`, the shape is filled with its color. + * + * @param centered - Whether the shape's origin is its center (a circle) instead of its top-left + * corner (a rectangle). + */ +export const imageFill = ( + assets: AssetContext, + path: string, + width: number, + height: number, + centered = false, +): ShapeConfig => { + if (!path) return { fillPriority: "color", fillPatternImage: undefined }; + let image = images.get(path); + if (!image) { + image = document.createElement("img"); + try { + image.src = assets.getAsset(path).path; + } catch (error) { + // Once per path, not every frame: the shape keeps its color. + console.warn(`No image at "${path}":`, error); + } + images.set(path, image); + } + if (!image.naturalWidth) return { fillPriority: "color", fillPatternImage: undefined }; + return { + fillPriority: "pattern", + fillPatternImage: image, + fillPatternRepeat: "no-repeat", + fillPatternScaleX: width / image.naturalWidth, + fillPatternScaleY: height / image.naturalHeight, + fillPatternOffsetX: centered ? image.naturalWidth / 2 : 0, + fillPatternOffsetY: centered ? image.naturalHeight / 2 : 0, + }; +}; diff --git a/games/flappy-bird/src/just-pressed.ts b/games/flappy-bird/src/just-pressed.ts new file mode 100644 index 0000000..bd8dac9 --- /dev/null +++ b/games/flappy-bird/src/just-pressed.ts @@ -0,0 +1,19 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { InputEnum } from "@nanoforge-dev/input"; + +/** Whether each key was down the last time a system asked. */ +const down = new Map(); + +/** + * Whether `key` went down since the last time a system asked about it. + * + * @remarks + * The state is shared by every system: a key that opens a scene does not also act in that scene + * while it is still held. + */ +export const justPressed = (ctx: Context, key: InputEnum): boolean => { + const now = ctx.input.isKeyPressed(key) === true; + const before = down.get(key) ?? false; + down.set(key, now); + return now && !before; +}; diff --git a/games/flappy-bird/src/main.ts b/games/flappy-bird/src/main.ts new file mode 100644 index 0000000..a6a7008 --- /dev/null +++ b/games/flappy-bird/src/main.ts @@ -0,0 +1,54 @@ +import type { ClientRunOptions } from "@nanoforge-dev/common"; +import { NanoforgeFactory } from "@nanoforge-dev/core"; +import { EcsLibrary } from "@nanoforge-dev/ecs/client"; +import { EditorLibrary } from "@nanoforge-dev/editor-lib"; +import { Graphics2DLibrary } from "@nanoforge-dev/graphics-2d"; +import { InputLibrary } from "@nanoforge-dev/input"; +import { SceneLibrary } from "@nanoforge-dev/scene"; +import { SoundLibrary } from "@nanoforge-dev/sound"; + +import { SoundEffect } from "./components/sound-effect.component"; +import "./scene-vars"; +import { GameOver } from "./scenes/game-over.scene"; +import { Play } from "./scenes/play.scene"; +import { Ready } from "./scenes/ready.scene"; +import { Sky } from "./scenes/sky.scene"; +import { draw2D } from "./systems/draw-2d.system"; +import { drawOrder2D } from "./systems/draw-order-2d.system"; +import { loadSounds } from "./systems/load-sounds.system"; + +export const main = async (options: ClientRunOptions): Promise => { + const app = NanoforgeFactory.createClient({ + tickRate: 60, + viewport: { width: 420, height: 560, fit: "contain" }, + }); + const ecs = new EcsLibrary(); + + app.use(new Graphics2DLibrary()); + app.use(ecs); + app.use(new InputLibrary()); + app.use(new SoundLibrary()); + app.use(new SceneLibrary({ initial: Ready, scenes: { Sky, Ready, Play, GameOver } })); + app.use(new EditorLibrary()); + + await app.init(options); + + const registry = ecs.registry; + + const wing = registry.spawnEntity(); + registry.addComponent(wing, new SoundEffect("wing", "/wing.wav")); + const point = registry.spawnEntity(); + registry.addComponent(point, new SoundEffect("point", "/point.wav")); + const hit = registry.spawnEntity(); + registry.addComponent(hit, new SoundEffect("hit", "/hit.wav")); + const die = registry.spawnEntity(); + registry.addComponent(die, new SoundEffect("die", "/die.wav")); + const swoosh = registry.spawnEntity(); + registry.addComponent(swoosh, new SoundEffect("swoosh", "/swoosh.wav")); + + registry.addSystem(loadSounds); + registry.addSystem(draw2D); + registry.addSystem(drawOrder2D); + + await app.run(); +}; diff --git a/games/flappy-bird/src/scene-vars.ts b/games/flappy-bird/src/scene-vars.ts new file mode 100644 index 0000000..6882508 --- /dev/null +++ b/games/flappy-bird/src/scene-vars.ts @@ -0,0 +1,14 @@ +/** + * The scene vars of the game. A var belongs to the scene that made it, and goes away when that + * scene is unloaded. + */ +declare module "@nanoforge-dev/scene" { + interface SceneVars { + /** Pipes passed in the current flight (made by `Play`). @default 0 */ + score: number; + /** The bird died: the world stops (made by `GameOver`). @default true */ + over: boolean; + } +} + +export {}; diff --git a/games/flappy-bird/src/scenes/game-over.scene.ts b/games/flappy-bird/src/scenes/game-over.scene.ts new file mode 100644 index 0000000..254701b --- /dev/null +++ b/games/flappy-bird/src/scenes/game-over.scene.ts @@ -0,0 +1,31 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; +import { EcsScene } from "@nanoforge-dev/ecs/scene"; + +import { DrawOrder2D } from "../components/draw-order-2d.component"; +import { DrawableRect2D } from "../components/drawable-rect-2d.component"; +import { Position2D } from "../components/position-2d.component"; +import { RestartDelay } from "../components/restart-delay.component"; +import { restart } from "../systems/restart.system"; + +/** + * The game over screen, over the flight that ended. It has no parent of its own: it is loaded + * over `Play` (`parent: "current"`), whose world stops while `over` exists. + * + * @scene + * @side client + * @vars over + */ +export class GameOver extends EcsScene { + override setup(registry: Registry, ctx: Context) { + ctx.scenes.vars.init("over", true); + + const title = registry.spawnEntity(); + registry.addComponent(title, new Position2D(114, 186)); + registry.addComponent(title, new DrawableRect2D(192, 42, "#ffffff", "/gameover.png")); + registry.addComponent(title, new RestartDelay(0.4)); + registry.addComponent(title, new DrawOrder2D(6)); + + registry.addSystem(restart); + } +} diff --git a/games/flappy-bird/src/scenes/play.scene.ts b/games/flappy-bird/src/scenes/play.scene.ts new file mode 100644 index 0000000..f8f6f85 --- /dev/null +++ b/games/flappy-bird/src/scenes/play.scene.ts @@ -0,0 +1,115 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; +import { EcsScene } from "@nanoforge-dev/ecs/scene"; + +import { Bird } from "../components/bird.component"; +import { DrawOrder2D } from "../components/draw-order-2d.component"; +import { DrawableRect2D } from "../components/drawable-rect-2d.component"; +import { Pipe } from "../components/pipe.component"; +import { PipeSpawner } from "../components/pipe-spawner.component"; +import { Position2D } from "../components/position-2d.component"; +import { ScoreDigit } from "../components/score-digit.component"; +import { Velocity2D } from "../components/velocity-2d.component"; +import { collide } from "../systems/collide.system"; +import { flap } from "../systems/flap.system"; +import { fly } from "../systems/fly.system"; +import { movePipes } from "../systems/move-pipes.system"; +import { scorePipes } from "../systems/score-pipes.system"; +import { showScore } from "../systems/show-score.system"; +import { Sky } from "./sky.scene"; + +/** + * A flight: the bird, three pairs of pipes that come back again and again, and the score. The + * bird starts with a flap: the one that started the flight. + * + * @scene + * @side client + * @vars score + */ +export class Play extends EcsScene { + static override parent = Sky; + + override setup(registry: Registry, ctx: Context) { + ctx.scenes.vars.init("score", 0); + + const pipe1Top = registry.spawnEntity(); + registry.addComponent(pipe1Top, new Position2D(-100, 0)); + registry.addComponent( + pipe1Top, + new DrawableRect2D(52, 320, "#73bf2e", "/pipe-green.png", 1, 180), + ); + registry.addComponent(pipe1Top, new Pipe(0, true)); + registry.addComponent(pipe1Top, new DrawOrder2D(1)); + + const pipe1Bottom = registry.spawnEntity(); + registry.addComponent(pipe1Bottom, new Position2D(-100, 0)); + registry.addComponent(pipe1Bottom, new DrawableRect2D(52, 320, "#73bf2e", "/pipe-green.png")); + registry.addComponent(pipe1Bottom, new Pipe(0, false)); + registry.addComponent(pipe1Bottom, new DrawOrder2D(1)); + + const pipe2Top = registry.spawnEntity(); + registry.addComponent(pipe2Top, new Position2D(-100, 0)); + registry.addComponent( + pipe2Top, + new DrawableRect2D(52, 320, "#73bf2e", "/pipe-green.png", 1, 180), + ); + registry.addComponent(pipe2Top, new Pipe(1, true)); + registry.addComponent(pipe2Top, new DrawOrder2D(1)); + + const pipe2Bottom = registry.spawnEntity(); + registry.addComponent(pipe2Bottom, new Position2D(-100, 0)); + registry.addComponent(pipe2Bottom, new DrawableRect2D(52, 320, "#73bf2e", "/pipe-green.png")); + registry.addComponent(pipe2Bottom, new Pipe(1, false)); + registry.addComponent(pipe2Bottom, new DrawOrder2D(1)); + + const pipe3Top = registry.spawnEntity(); + registry.addComponent(pipe3Top, new Position2D(-100, 0)); + registry.addComponent( + pipe3Top, + new DrawableRect2D(52, 320, "#73bf2e", "/pipe-green.png", 1, 180), + ); + registry.addComponent(pipe3Top, new Pipe(2, true)); + registry.addComponent(pipe3Top, new DrawOrder2D(1)); + + const pipe3Bottom = registry.spawnEntity(); + registry.addComponent(pipe3Bottom, new Position2D(-100, 0)); + registry.addComponent(pipe3Bottom, new DrawableRect2D(52, 320, "#73bf2e", "/pipe-green.png")); + registry.addComponent(pipe3Bottom, new Pipe(2, false)); + registry.addComponent(pipe3Bottom, new DrawOrder2D(1)); + + const spawner = registry.spawnEntity(); + registry.addComponent(spawner, new PipeSpawner(150, 1.5, 420, 150, 110, 2.5, 16, 60, 448)); + + const bird = registry.spawnEntity(); + registry.addComponent(bird, new Position2D(60, 280)); + registry.addComponent(bird, new Velocity2D(0, -430)); + registry.addComponent(bird, new DrawableRect2D(34, 24, "#f8e71c", "/yellowbird-midflap.png")); + registry.addComponent(bird, new Bird(1500, 430, 640, 448, 0.25)); + registry.addComponent(bird, new DrawOrder2D(3)); + + const digit1 = registry.spawnEntity(); + registry.addComponent(digit1, new Position2D(198, 20)); + registry.addComponent(digit1, new DrawableRect2D(24, 36, "#ffffff", "/0.png")); + registry.addComponent(digit1, new ScoreDigit(0, 210)); + registry.addComponent(digit1, new DrawOrder2D(5)); + + const digit2 = registry.spawnEntity(); + registry.addComponent(digit2, new Position2D(198, 20)); + registry.addComponent(digit2, new DrawableRect2D(24, 36, "#ffffff", "/0.png", 1, 0, 0, false)); + registry.addComponent(digit2, new ScoreDigit(1, 210)); + registry.addComponent(digit2, new DrawOrder2D(5)); + + const digit3 = registry.spawnEntity(); + registry.addComponent(digit3, new Position2D(198, 20)); + registry.addComponent(digit3, new DrawableRect2D(24, 36, "#ffffff", "/0.png", 1, 0, 0, false)); + registry.addComponent(digit3, new ScoreDigit(2, 210)); + registry.addComponent(digit3, new DrawOrder2D(5)); + + registry.addSystem(flap); + registry.addSystem(fly); + registry.addSystem(movePipes); + registry.addSystem(collide); + registry.addSystem(scorePipes); + registry.addSystem(showScore); + } +} diff --git a/games/flappy-bird/src/scenes/ready.scene.ts b/games/flappy-bird/src/scenes/ready.scene.ts new file mode 100644 index 0000000..e9bc393 --- /dev/null +++ b/games/flappy-bird/src/scenes/ready.scene.ts @@ -0,0 +1,33 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; +import { EcsScene } from "@nanoforge-dev/ecs/scene"; + +import { DrawOrder2D } from "../components/draw-order-2d.component"; +import { DrawableRect2D } from "../components/drawable-rect-2d.component"; +import { Position2D } from "../components/position-2d.component"; +import { startFlight } from "../systems/start-flight.system"; +import { Sky } from "./sky.scene"; + +/** + * The title screen: the "get ready" message and the bird, waiting for the first flap. + * + * @scene + * @side client + */ +export class Ready extends EcsScene { + static override parent = Sky; + + override setup(registry: Registry, _ctx: Context) { + const message = registry.spawnEntity(); + registry.addComponent(message, new Position2D(118, 100)); + registry.addComponent(message, new DrawableRect2D(184, 267, "#ffffff", "/message.png")); + registry.addComponent(message, new DrawOrder2D(4)); + + const bird = registry.spawnEntity(); + registry.addComponent(bird, new Position2D(43, 268)); + registry.addComponent(bird, new DrawableRect2D(34, 24, "#f8e71c", "/yellowbird-midflap.png")); + registry.addComponent(bird, new DrawOrder2D(3)); + + registry.addSystem(startFlight); + } +} diff --git a/games/flappy-bird/src/scenes/sky.scene.ts b/games/flappy-bird/src/scenes/sky.scene.ts new file mode 100644 index 0000000..1a1b1ca --- /dev/null +++ b/games/flappy-bird/src/scenes/sky.scene.ts @@ -0,0 +1,52 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; +import { EcsScene } from "@nanoforge-dev/ecs/scene"; + +import { DrawOrder2D } from "../components/draw-order-2d.component"; +import { DrawableRect2D } from "../components/drawable-rect-2d.component"; +import { Position2D } from "../components/position-2d.component"; +import { ScrollLoop } from "../components/scroll-loop.component"; +import { scrollGround } from "../systems/scroll-ground.system"; + +/** + * The world every screen is drawn in: the sky and the scrolling ground. `Ready` and `Play` are + * loaded under it. The ground tiles are 336 pixels apart and one pixel wider, so that no seam + * shows between them. + * + * It must not import them (or anything that does): they name it as their parent when their + * module is evaluated. + * + * @scene + * @side client + */ +export class Sky extends EcsScene { + override setup(registry: Registry, _ctx: Context) { + const background = registry.spawnEntity(); + registry.addComponent(background, new Position2D(0, 0)); + registry.addComponent( + background, + new DrawableRect2D(420, 560, "#4ec0ca", "/background-day.png"), + ); + registry.addComponent(background, new DrawOrder2D(0)); + + const ground1 = registry.spawnEntity(); + registry.addComponent(ground1, new Position2D(0, 448)); + registry.addComponent(ground1, new DrawableRect2D(337, 112, "#ded895", "/base.png")); + registry.addComponent(ground1, new ScrollLoop(150, 1008)); + registry.addComponent(ground1, new DrawOrder2D(2)); + + const ground2 = registry.spawnEntity(); + registry.addComponent(ground2, new Position2D(336, 448)); + registry.addComponent(ground2, new DrawableRect2D(337, 112, "#ded895", "/base.png")); + registry.addComponent(ground2, new ScrollLoop(150, 1008)); + registry.addComponent(ground2, new DrawOrder2D(2)); + + const ground3 = registry.spawnEntity(); + registry.addComponent(ground3, new Position2D(672, 448)); + registry.addComponent(ground3, new DrawableRect2D(337, 112, "#ded895", "/base.png")); + registry.addComponent(ground3, new ScrollLoop(150, 1008)); + registry.addComponent(ground3, new DrawOrder2D(2)); + + registry.addSystem(scrollGround); + } +} diff --git a/games/flappy-bird/src/systems/collide.system.ts b/games/flappy-bird/src/systems/collide.system.ts new file mode 100644 index 0000000..0cf86d9 --- /dev/null +++ b/games/flappy-bird/src/systems/collide.system.ts @@ -0,0 +1,51 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; +import "@nanoforge-dev/scene"; +import "@nanoforge-dev/sound"; + +import { Bird } from "../components/bird.component"; +import { DrawableRect2D } from "../components/drawable-rect-2d.component"; +import { Pipe } from "../components/pipe.component"; +import { Position2D } from "../components/position-2d.component"; +import { GameOver } from "../scenes/game-over.scene"; + +/** Milliseconds between the hit sound and the fall sound. */ +const DIE_DELAY_MS = 150; + +/** + * Kills the bird when it touches a pipe or the ground, and shows the game over screen over the + * flight. + * + * @system + * @side client + */ +export const collide = (registry: Registry, ctx: Context) => { + const pipes = registry.getZipper([Pipe, Position2D, DrawableRect2D]); + + registry + .getZipper([Bird, Position2D, DrawableRect2D]) + .forEach(({ Bird, Position2D, DrawableRect2D }) => { + if (Bird.dead) return; + const halfWidth = (DrawableRect2D.width / 2) * (1 - 2 * Bird.hitboxInset); + const halfHeight = (DrawableRect2D.height / 2) * (1 - 2 * Bird.hitboxInset); + const left = Position2D.x - halfWidth; + const right = Position2D.x + halfWidth; + const top = Position2D.y - halfHeight; + const bottom = Position2D.y + halfHeight; + + const hit = + bottom >= Bird.groundY || + pipes.some(({ Pipe, Position2D: pipe, DrawableRect2D: shape }) => { + // The top pipe is turned by 180 degrees: its position is its bottom-right corner. + const x = Pipe.top ? pipe.x - shape.width : pipe.x; + if (right <= x || left >= x + shape.width) return false; + return Pipe.top ? top < pipe.y : bottom > pipe.y; + }); + if (!hit) return; + + Bird.dead = true; + ctx.sound.play("hit"); + setTimeout(() => ctx.sound.play("die"), DIE_DELAY_MS); + void ctx.scenes.load(ctx, GameOver, { parent: "current" }); + }); +}; diff --git a/games/flappy-bird/src/systems/draw-2d.system.ts b/games/flappy-bird/src/systems/draw-2d.system.ts new file mode 100644 index 0000000..937eeeb --- /dev/null +++ b/games/flappy-bird/src/systems/draw-2d.system.ts @@ -0,0 +1,45 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; +import "@nanoforge-dev/graphics-2d"; +import { Position2D } from "../components/position-2d.component"; + +import { DrawableCircle2D } from "../components/drawable-circle-2d.component"; +import { DrawableRect2D } from "../components/drawable-rect-2d.component"; +import { DrawableText2D } from "../components/drawable-text-2d.component"; + +type Drawable = DrawableRect2D | DrawableCircle2D | DrawableText2D; + +/** The drawables shown by the last frame. */ +let shown = new Set(); + +/** + * Draws every entity that has a `Position2D` and a `DrawableRect2D`, `DrawableCircle2D` or + * `DrawableText2D`, where it is. Add it last, after the systems that move entities. + * + * @remarks + * The shape of a killed entity, or of a removed drawable, is removed from the screen. + * + * @system + * @side client + */ +export const draw2D = (registry: Registry, ctx: Context) => { + const layer = ctx.graphics.baseLayer; + const drawn = new Set(); + + registry.getZipper([DrawableRect2D, Position2D]).forEach(({ DrawableRect2D, Position2D }) => { + DrawableRect2D.draw(layer, Position2D, ctx.assets); + drawn.add(DrawableRect2D); + }); + registry.getZipper([DrawableCircle2D, Position2D]).forEach(({ DrawableCircle2D, Position2D }) => { + DrawableCircle2D.draw(layer, Position2D, ctx.assets); + drawn.add(DrawableCircle2D); + }); + registry.getZipper([DrawableText2D, Position2D]).forEach(({ DrawableText2D, Position2D }) => { + DrawableText2D.draw(layer, Position2D); + drawn.add(DrawableText2D); + }); + + // `killEntity` doesn't call `destroy()`: a drawable no longer in the world loses its shape here. + for (const drawable of shown) if (!drawn.has(drawable)) drawable.destroy(); + shown = drawn; +}; diff --git a/games/flappy-bird/src/systems/draw-order-2d.system.ts b/games/flappy-bird/src/systems/draw-order-2d.system.ts new file mode 100644 index 0000000..ff3ced0 --- /dev/null +++ b/games/flappy-bird/src/systems/draw-order-2d.system.ts @@ -0,0 +1,59 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; +import "@nanoforge-dev/graphics-2d"; + +import { DrawOrder2D } from "../components/draw-order-2d.component"; +import { DrawableCircle2D } from "../components/drawable-circle-2d.component"; +import { DrawableRect2D } from "../components/drawable-rect-2d.component"; +import { DrawableText2D } from "../components/drawable-text-2d.component"; + +type Stacked = { order: DrawOrder2D; drawable: DrawableRect2D | DrawableCircle2D | DrawableText2D }; + +/** The number of shapes on the layer the last time it was stacked. */ +let stackedShapes = -1; + +/** + * Stacks the shapes of `DrawOrder2D` entities by their `z`, over the other shapes. Add it right + * after `draw2D`. + * + * @remarks + * It only stacks again when a shape appeared or went away, or a `z` changed. + * + * @system + * @side client + */ +export const drawOrder2D = (registry: Registry, ctx: Context) => { + const layer = ctx.graphics.baseLayer; + const rects = registry.getZipper([DrawOrder2D, DrawableRect2D]); + const circles = registry.getZipper([DrawOrder2D, DrawableCircle2D]); + const texts = registry.getZipper([DrawOrder2D, DrawableText2D]); + const moved = ({ DrawOrder2D }: { DrawOrder2D: DrawOrder2D }) => + DrawOrder2D.stackedZ !== DrawOrder2D.z; + const changed = + layer.children.length !== stackedShapes || + rects.some(moved) || + circles.some(moved) || + texts.some(moved); + if (!changed) return; + + const rows: Stacked[] = [ + ...rects.map(({ DrawOrder2D, DrawableRect2D }) => ({ + order: DrawOrder2D, + drawable: DrawableRect2D, + })), + ...circles.map(({ DrawOrder2D, DrawableCircle2D }) => ({ + order: DrawOrder2D, + drawable: DrawableCircle2D, + })), + ...texts.map(({ DrawOrder2D, DrawableText2D }) => ({ + order: DrawOrder2D, + drawable: DrawableText2D, + })), + ]; + // A stable sort keeps the entity order between equal `z`. + for (const { order, drawable } of rows.sort((a, b) => a.order.z - b.order.z)) { + drawable.shape?.moveToTop(); + order.stackedZ = order.z; + } + stackedShapes = layer.children.length; +}; diff --git a/games/flappy-bird/src/systems/flap.system.ts b/games/flappy-bird/src/systems/flap.system.ts new file mode 100644 index 0000000..98d1324 --- /dev/null +++ b/games/flappy-bird/src/systems/flap.system.ts @@ -0,0 +1,27 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; +import "@nanoforge-dev/scene"; +import "@nanoforge-dev/sound"; + +import { Bird } from "../components/bird.component"; +import { Velocity2D } from "../components/velocity-2d.component"; +import { flapPressed } from "../flap-pressed"; + +/** + * Makes the bird flap up when the player presses Space, clicks or taps. + * + * @remarks + * It leaves the presses to the game over screen once `over` exists: a press is seen only once. + * + * @system + * @side client + */ +export const flap = (registry: Registry, ctx: Context) => { + if (ctx.scenes.vars.has("over") || !flapPressed(ctx)) return; + + registry.getZipper([Bird, Velocity2D]).forEach(({ Bird, Velocity2D }) => { + if (Bird.dead) return; + Velocity2D.y = -Bird.flapSpeed; + ctx.sound.play("wing"); + }); +}; diff --git a/games/flappy-bird/src/systems/fly.system.ts b/games/flappy-bird/src/systems/fly.system.ts new file mode 100644 index 0000000..b2e52a9 --- /dev/null +++ b/games/flappy-bird/src/systems/fly.system.ts @@ -0,0 +1,40 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; + +import { Bird } from "../components/bird.component"; +import { DrawableRect2D } from "../components/drawable-rect-2d.component"; +import { Position2D } from "../components/position-2d.component"; +import { Velocity2D } from "../components/velocity-2d.component"; + +/** The longest step, in seconds: a slow frame doesn't throw the bird through a pipe. */ +const MAX_STEP = 1 / 30; + +/** + * Makes the bird fall, keeps it under the sky, and tilts it with its speed: nose up when it + * flaps, nose down when it falls. + * + * @system + * @side client + */ +export const fly = (registry: Registry, ctx: Context) => { + const seconds = Math.min(ctx.app.delta / 1000, MAX_STEP); + + registry + .getZipper([Bird, Position2D, Velocity2D, DrawableRect2D]) + .forEach(({ Bird, Position2D, Velocity2D, DrawableRect2D }) => { + if (Bird.dead) return; + Velocity2D.y = Math.min(Velocity2D.y + Bird.gravity * seconds, Bird.maxFallSpeed); + Position2D.y += Velocity2D.y * seconds; + + const top = Position2D.y - DrawableRect2D.height / 2; + if (top < 0) { + Position2D.y -= top; + Velocity2D.y = Math.max(0, Velocity2D.y); + } + + DrawableRect2D.rotation = Math.max(-25, Math.min(90, Velocity2D.y / 8)); + // `draw2D` turns a shape around its top-left corner and never sets its offset: turn the + // bird around its center, which is its `Position2D`. + DrawableRect2D.shape?.offset({ x: DrawableRect2D.width / 2, y: DrawableRect2D.height / 2 }); + }); +}; diff --git a/games/flappy-bird/src/systems/load-sounds.system.ts b/games/flappy-bird/src/systems/load-sounds.system.ts new file mode 100644 index 0000000..cb0daf3 --- /dev/null +++ b/games/flappy-bird/src/systems/load-sounds.system.ts @@ -0,0 +1,30 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; +import "@nanoforge-dev/sound"; + +import { SoundEffect } from "../components/sound-effect.component"; + +/** Whether the sound library was unmuted. */ +let unmuted = false; + +/** + * Loads every `SoundEffect` into the sound library, so that systems can play it by its key. + * + * @remarks + * The sound library starts muted: the first run unmutes it. + * + * @system + * @side client + */ +export const loadSounds = (registry: Registry, ctx: Context) => { + registry.getZipper([SoundEffect]).forEach(({ SoundEffect }) => { + if (SoundEffect.loaded) return; + ctx.sound.load(SoundEffect.key, ctx.assets.getAsset(SoundEffect.path).path); + SoundEffect.loaded = true; + }); + // shortcut: `mute()` is a toggle with no getter, so this assumes one sound library per page load. + if (!unmuted) { + ctx.sound.mute(); + unmuted = true; + } +}; diff --git a/games/flappy-bird/src/systems/move-pipes.system.ts b/games/flappy-bird/src/systems/move-pipes.system.ts new file mode 100644 index 0000000..3a8cee1 --- /dev/null +++ b/games/flappy-bird/src/systems/move-pipes.system.ts @@ -0,0 +1,51 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; +import "@nanoforge-dev/scene"; + +import { DrawableRect2D } from "../components/drawable-rect-2d.component"; +import { Pipe } from "../components/pipe.component"; +import { PipeSpawner } from "../components/pipe-spawner.component"; +import { Position2D } from "../components/position-2d.component"; + +/** + * Moves the pipes to the left and, every `interval`, brings back a pair that left the screen on + * the right, with a new gap: smaller as the score grows. Stops when the bird dies. + * + * @system + * @side client + */ +export const movePipes = (registry: Registry, ctx: Context) => { + const vars = ctx.scenes.vars; + if (vars.has("over")) return; + const seconds = Math.min(ctx.app.delta / 1000, 1 / 30); + const pipes = registry.getZipper([Pipe, Position2D, DrawableRect2D]); + + registry.getZipper([PipeSpawner]).forEach(({ PipeSpawner: spawner }) => { + for (const { Position2D } of pipes) Position2D.x -= spawner.speed * seconds; + + spawner.timer -= seconds; + if (spawner.timer > 0) return; + spawner.timer = spawner.interval; + + const free = pipes.find( + ({ Pipe, Position2D, DrawableRect2D }) => + !Pipe.top && Position2D.x + DrawableRect2D.width < 0, + ); + if (!free) return; + + const score = vars.get("score") ?? 0; + const shrunk = Math.max(spawner.minGap, spawner.baseGap - score * spawner.gapStep); + const gap = Math.max(spawner.minGap, shrunk + (Math.random() * 2 - 1) * spawner.gapJitter); + const lowest = gap / 2 + spawner.margin; + const highest = spawner.groundY - gap / 2 - spawner.margin; + const center = lowest + Math.random() * Math.max(0, highest - lowest); + + for (const { Pipe, Position2D, DrawableRect2D } of pipes) { + if (Pipe.pair !== free.Pipe.pair) continue; + Pipe.scored = false; + // The top pipe is turned by 180 degrees around its `Position2D`. + Position2D.x = Pipe.top ? spawner.startX + DrawableRect2D.width : spawner.startX; + Position2D.y = Pipe.top ? center - gap / 2 : center + gap / 2; + } + }); +}; diff --git a/games/flappy-bird/src/systems/restart.system.ts b/games/flappy-bird/src/systems/restart.system.ts new file mode 100644 index 0000000..e43f929 --- /dev/null +++ b/games/flappy-bird/src/systems/restart.system.ts @@ -0,0 +1,28 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; +import "@nanoforge-dev/scene"; +import "@nanoforge-dev/sound"; + +import { RestartDelay } from "../components/restart-delay.component"; +import { flapPressed } from "../flap-pressed"; +import { Play } from "../scenes/play.scene"; + +/** + * Starts a new flight at the first flap once the `RestartDelay` is over. + * + * @system + * @side client + */ +export const restart = (registry: Registry, ctx: Context) => { + const pressed = flapPressed(ctx); + + registry.getZipper([RestartDelay]).forEach(({ RestartDelay }) => { + RestartDelay.elapsed += ctx.app.delta / 1000; + if (!pressed || RestartDelay.elapsed < RestartDelay.seconds) return; + ctx.sound.play("swoosh"); + ctx.sound.play("wing"); + // Unloading `Play` (and this screen) then loading it again gives a new bird and new pipes. + void ctx.scenes.unload(ctx, Play); + void ctx.scenes.load(ctx, Play); + }); +}; diff --git a/games/flappy-bird/src/systems/score-pipes.system.ts b/games/flappy-bird/src/systems/score-pipes.system.ts new file mode 100644 index 0000000..9fc18bb --- /dev/null +++ b/games/flappy-bird/src/systems/score-pipes.system.ts @@ -0,0 +1,33 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; +import "@nanoforge-dev/scene"; +import "@nanoforge-dev/sound"; + +import { Bird } from "../components/bird.component"; +import { DrawableRect2D } from "../components/drawable-rect-2d.component"; +import { Pipe } from "../components/pipe.component"; +import { Position2D } from "../components/position-2d.component"; + +/** + * Adds a point to `score` for each pair of pipes the bird flies past. + * + * @system + * @side client + * @vars score + */ +export const scorePipes = (registry: Registry, ctx: Context) => { + const vars = ctx.scenes.vars; + const pipes = registry.getZipper([Pipe, Position2D, DrawableRect2D]); + + registry.getZipper([Bird, Position2D]).forEach(({ Bird, Position2D: bird }) => { + if (Bird.dead) return; + for (const { Pipe, Position2D, DrawableRect2D } of pipes) { + const right = Position2D.x + DrawableRect2D.width; + // A pipe waiting off the screen (`right < 0`) was never flown past. + if (Pipe.top || Pipe.scored || right >= bird.x || right < 0) continue; + Pipe.scored = true; + vars.set("score", (vars.get("score") ?? 0) + 1); + ctx.sound.play("point"); + } + }); +}; diff --git a/games/flappy-bird/src/systems/scroll-ground.system.ts b/games/flappy-bird/src/systems/scroll-ground.system.ts new file mode 100644 index 0000000..bbdbae3 --- /dev/null +++ b/games/flappy-bird/src/systems/scroll-ground.system.ts @@ -0,0 +1,25 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; +import "@nanoforge-dev/scene"; + +import { DrawableRect2D } from "../components/drawable-rect-2d.component"; +import { Position2D } from "../components/position-2d.component"; +import { ScrollLoop } from "../components/scroll-loop.component"; + +/** + * Scrolls the `ScrollLoop` entities (the ground) to the left, until the bird dies. + * + * @system + * @side client + */ +export const scrollGround = (registry: Registry, ctx: Context) => { + if (ctx.scenes.vars.has("over")) return; + const seconds = ctx.app.delta / 1000; + + registry + .getZipper([ScrollLoop, Position2D, DrawableRect2D]) + .forEach(({ ScrollLoop, Position2D, DrawableRect2D }) => { + Position2D.x -= ScrollLoop.speed * seconds; + if (Position2D.x <= -DrawableRect2D.width) Position2D.x += ScrollLoop.span; + }); +}; diff --git a/games/flappy-bird/src/systems/show-score.system.ts b/games/flappy-bird/src/systems/show-score.system.ts new file mode 100644 index 0000000..e0a1cf8 --- /dev/null +++ b/games/flappy-bird/src/systems/show-score.system.ts @@ -0,0 +1,30 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; +import "@nanoforge-dev/scene"; + +import { DrawableRect2D } from "../components/drawable-rect-2d.component"; +import { Position2D } from "../components/position-2d.component"; +import { ScoreDigit } from "../components/score-digit.component"; + +/** + * Shows `score` with the `ScoreDigit` entities: each one gets its digit's image, centered, and + * the digits the score doesn't need are hidden. + * + * @system + * @side client + * @vars score + */ +export const showScore = (registry: Registry, ctx: Context) => { + const digits = String(ctx.scenes.vars.get("score") ?? 0); + + registry + .getZipper([ScoreDigit, Position2D, DrawableRect2D]) + .forEach(({ ScoreDigit, Position2D, DrawableRect2D }) => { + const digit = digits[ScoreDigit.index]; + DrawableRect2D.visible = digit !== undefined; + if (digit === undefined) return; + DrawableRect2D.image = `/${digit}.png`; + Position2D.x = + ScoreDigit.centerX + (ScoreDigit.index - digits.length / 2) * DrawableRect2D.width; + }); +}; diff --git a/games/flappy-bird/src/systems/start-flight.system.ts b/games/flappy-bird/src/systems/start-flight.system.ts new file mode 100644 index 0000000..d9eccb9 --- /dev/null +++ b/games/flappy-bird/src/systems/start-flight.system.ts @@ -0,0 +1,20 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs"; +import "@nanoforge-dev/scene"; +import "@nanoforge-dev/sound"; + +import { flapPressed } from "../flap-pressed"; +import { Play } from "../scenes/play.scene"; + +/** + * Starts the flight at the first flap: Space, a click or a tap. + * + * @system + * @side client + */ +export const startFlight = (_registry: Registry, ctx: Context) => { + if (!flapPressed(ctx)) return; + ctx.sound.play("swoosh"); + ctx.sound.play("wing"); + void ctx.scenes.load(ctx, Play); +}; diff --git a/games/flappy-bird/tsconfig.json b/games/flappy-bird/tsconfig.json new file mode 100644 index 0000000..c0ae4f2 --- /dev/null +++ b/games/flappy-bird/tsconfig.json @@ -0,0 +1,39 @@ +{ + "$schema": "https://json.schemastore.org/tsconfig.json", + // Mapped from https://www.typescriptlang.org/tsconfig + "compilerOptions": { + // Type Checking + "allowUnreachableCode": false, + "allowUnusedLabels": false, + "noFallthroughCasesInSwitch": true, + "noImplicitOverride": true, + "noImplicitReturns": true, + "noPropertyAccessFromIndexSignature": false, + "noUncheckedIndexedAccess": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "strict": true, + + // Modules + "allowArbitraryExtensions": false, + "allowImportingTsExtensions": false, + "module": "ESNext", + "moduleResolution": "Bundler", + "resolveJsonModule": true, + "resolvePackageJsonExports": true, + "resolvePackageJsonImports": true, + + // Interop Constraints + "allowSyntheticDefaultImports": true, + "forceConsistentCasingInFileNames": true, + "isolatedModules": true, + + // Language and Environment + "experimentalDecorators": true, + "lib": ["ESNext", "esnext.disposable", "DOM"], + "target": "ESNext", + "useDefineForClassFields": true + }, + "include": ["src"], + "exclude": ["node_modules", ".nanoforge", "dist"] +} diff --git a/games/raid-survival/.env.example b/games/raid-survival/.env.example new file mode 100644 index 0000000..9c62d4b --- /dev/null +++ b/games/raid-survival/.env.example @@ -0,0 +1,6 @@ +# Copy to .env. nf gives NANOFORGE_CLIENT_X to the client and NANOFORGE_SERVER_X to the server, as +# X. Everything the client gets reaches the browser. +NANOFORGE_CLIENT_SERVER_ADDRESS=127.0.0.1 +NANOFORGE_CLIENT_SERVER_TCP_PORT=4945 + +NANOFORGE_SERVER_LISTENING_TCP_PORT=4945 diff --git a/games/raid-survival/.gitignore b/games/raid-survival/.gitignore new file mode 100644 index 0000000..f28e2dc --- /dev/null +++ b/games/raid-survival/.gitignore @@ -0,0 +1,5 @@ +node_modules/ +dist/ +.nanoforge/ +nf_modules/ +.env diff --git a/games/raid-survival/README.md b/games/raid-survival/README.md new file mode 100644 index 0000000..37f18e2 --- /dev/null +++ b/games/raid-survival/README.md @@ -0,0 +1,61 @@ +# raid-survival + +A co-op survival game for one to four players: defend the lobby against waves of zombies. Kill +zombies for coins, then spend them on weapons, ammo, walls and towers. Revive a teammate who goes +down before the whole team falls. The game is won when the last wave is cleared. + +It is a client and a server (`apps/client`, `apps/server`), which share the catalogs, the map and +the messages in `libs/shared`. + +```sh +pnpm install +cp .env.example .env +pnpm dev # play it: the server, and the client at the loader's address +pnpm editor # open it in the editor +``` + +## Environment + +`nf` gives the `NANOFORGE_CLIENT_*` variables to the client and the `NANOFORGE_SERVER_*` ones to +the server, without the prefix. Everything the client gets reaches the browser. + +| Variable | Side | What | +| ------------------------------------- | ------ | ---------------------------------------------- | +| `NANOFORGE_CLIENT_SERVER_ADDRESS` | client | Address of the game server | +| `NANOFORGE_CLIENT_SERVER_TCP_PORT` | client | Its TCP (WebSocket) port | +| `NANOFORGE_SERVER_LISTENING_TCP_PORT` | server | The TCP (WebSocket) port the server listens on | + +## Controls + +| Key or button | Action | +| ------------- | ------------------------------------------------------------ | +| W A S D | Move | +| Mouse | Aim | +| Left click | Shoot; in build mode, place a building or use a button | +| R | Reload | +| E | Next to the lobby or a building, heal it, or upgrade a tower | +| E (hold) | Next to a downed teammate, revive them | +| B | Build mode: walls and towers on the grid, zoom buttons | + +The weapon shop on the right of the screen buys weapons and ammo, and picks the weapon in hand. + +## Assets + +The images of `apps/client/assets` came with the original game, without a license or credits: +their source and their terms are not recorded. + +## Layout + +- `apps/client/src`: three scenes (`Menu`, `Game`, `GameOver`). The menu and the game over screen + are built by hand in `views/`; `build-world.ts` builds a game from its `startGame` message. + `handlers/` holds what the client does with each message, called by `packetDispatch`. +- `apps/server/src`: the lobby, the waves, the zombies' AI, the weapons, the buildings and the + revives. `handlers/` holds what the server does with each message of a client. +- `libs/shared/src`: the protocol (one packet each way, `ClientPacket` and `ServerPacket`), the + weapon, building and player class catalogs, the map and the tower numbers. + +`Position2D`, `Velocity2D`, `Acceleration2D` and `move2D` of the server, and `Velocity2D`, +`DrawOrder2D` and `NetworkId` of the client, are copies of `shared/2d`, `shared/arcade` and +`shared/network` (see the repository's README). The client moves `Velocity2D` with its own +`moveSystem` (on `TransformComponent`) and stacks sprites by `DrawOrder2D` with its own +`zOrderSystem`, not with `move2D` and `drawOrder2D`. diff --git a/raid-survival/client/static/AK-Reload.png b/games/raid-survival/apps/client/assets/AK-Reload.png similarity index 100% rename from raid-survival/client/static/AK-Reload.png rename to games/raid-survival/apps/client/assets/AK-Reload.png diff --git a/raid-survival/client/static/AK-Shot.png b/games/raid-survival/apps/client/assets/AK-Shot.png similarity index 100% rename from raid-survival/client/static/AK-Shot.png rename to games/raid-survival/apps/client/assets/AK-Shot.png diff --git a/raid-survival/client/static/Character-Becca-Idle-Shot.png b/games/raid-survival/apps/client/assets/Character-Becca-Idle-Shot.png similarity index 100% rename from raid-survival/client/static/Character-Becca-Idle-Shot.png rename to games/raid-survival/apps/client/assets/Character-Becca-Idle-Shot.png diff --git a/raid-survival/client/static/Character-Becca-Idle.png b/games/raid-survival/apps/client/assets/Character-Becca-Idle.png similarity index 100% rename from raid-survival/client/static/Character-Becca-Idle.png rename to games/raid-survival/apps/client/assets/Character-Becca-Idle.png diff --git a/raid-survival/client/static/Character-Becca-Run.png b/games/raid-survival/apps/client/assets/Character-Becca-Run.png similarity index 100% rename from raid-survival/client/static/Character-Becca-Run.png rename to games/raid-survival/apps/client/assets/Character-Becca-Run.png diff --git a/raid-survival/client/static/Character-Joe-Idle-Shot.png b/games/raid-survival/apps/client/assets/Character-Joe-Idle-Shot.png similarity index 100% rename from raid-survival/client/static/Character-Joe-Idle-Shot.png rename to games/raid-survival/apps/client/assets/Character-Joe-Idle-Shot.png diff --git a/raid-survival/client/static/Character-Joe-Idle.png b/games/raid-survival/apps/client/assets/Character-Joe-Idle.png similarity index 100% rename from raid-survival/client/static/Character-Joe-Idle.png rename to games/raid-survival/apps/client/assets/Character-Joe-Idle.png diff --git a/raid-survival/client/static/Character-Joe-Run.png b/games/raid-survival/apps/client/assets/Character-Joe-Run.png similarity index 100% rename from raid-survival/client/static/Character-Joe-Run.png rename to games/raid-survival/apps/client/assets/Character-Joe-Run.png diff --git a/raid-survival/client/static/Character-Unknow-Idle-shot.png b/games/raid-survival/apps/client/assets/Character-Unknow-Idle-shot.png similarity index 100% rename from raid-survival/client/static/Character-Unknow-Idle-shot.png rename to games/raid-survival/apps/client/assets/Character-Unknow-Idle-shot.png diff --git a/raid-survival/client/static/Character-Unknow-Idle.png b/games/raid-survival/apps/client/assets/Character-Unknow-Idle.png similarity index 100% rename from raid-survival/client/static/Character-Unknow-Idle.png rename to games/raid-survival/apps/client/assets/Character-Unknow-Idle.png diff --git a/raid-survival/client/static/Character-Unknow-Run.png b/games/raid-survival/apps/client/assets/Character-Unknow-Run.png similarity index 100% rename from raid-survival/client/static/Character-Unknow-Run.png rename to games/raid-survival/apps/client/assets/Character-Unknow-Run.png diff --git a/raid-survival/client/static/GZ2-Zombie-Heavy.png b/games/raid-survival/apps/client/assets/GZ2-Zombie-Heavy.png similarity index 100% rename from raid-survival/client/static/GZ2-Zombie-Heavy.png rename to games/raid-survival/apps/client/assets/GZ2-Zombie-Heavy.png diff --git a/raid-survival/client/static/GZ2-Zombie-Puncher.png b/games/raid-survival/apps/client/assets/GZ2-Zombie-Puncher.png similarity index 100% rename from raid-survival/client/static/GZ2-Zombie-Puncher.png rename to games/raid-survival/apps/client/assets/GZ2-Zombie-Puncher.png diff --git a/raid-survival/client/static/Shotgun-Reload.png b/games/raid-survival/apps/client/assets/Shotgun-Reload.png similarity index 100% rename from raid-survival/client/static/Shotgun-Reload.png rename to games/raid-survival/apps/client/assets/Shotgun-Reload.png diff --git a/raid-survival/client/static/Shotgun-Shot.png b/games/raid-survival/apps/client/assets/Shotgun-Shot.png similarity index 100% rename from raid-survival/client/static/Shotgun-Shot.png rename to games/raid-survival/apps/client/assets/Shotgun-Shot.png diff --git a/raid-survival/client/static/Uzi-Reload.png b/games/raid-survival/apps/client/assets/Uzi-Reload.png similarity index 100% rename from raid-survival/client/static/Uzi-Reload.png rename to games/raid-survival/apps/client/assets/Uzi-Reload.png diff --git a/raid-survival/client/static/Uzi-Shot.png b/games/raid-survival/apps/client/assets/Uzi-Shot.png similarity index 100% rename from raid-survival/client/static/Uzi-Shot.png rename to games/raid-survival/apps/client/assets/Uzi-Shot.png diff --git a/raid-survival/client/static/Zombie-Atk.png b/games/raid-survival/apps/client/assets/Zombie-Atk.png similarity index 100% rename from raid-survival/client/static/Zombie-Atk.png rename to games/raid-survival/apps/client/assets/Zombie-Atk.png diff --git a/raid-survival/client/static/Zombie-Dead.png b/games/raid-survival/apps/client/assets/Zombie-Dead.png similarity index 100% rename from raid-survival/client/static/Zombie-Dead.png rename to games/raid-survival/apps/client/assets/Zombie-Dead.png diff --git a/raid-survival/client/static/Zombie-Walk.png b/games/raid-survival/apps/client/assets/Zombie-Walk.png similarity index 100% rename from raid-survival/client/static/Zombie-Walk.png rename to games/raid-survival/apps/client/assets/Zombie-Walk.png diff --git a/raid-survival/client/static/ak-reload-animations.txt b/games/raid-survival/apps/client/assets/ak-reload-animations.txt similarity index 100% rename from raid-survival/client/static/ak-reload-animations.txt rename to games/raid-survival/apps/client/assets/ak-reload-animations.txt diff --git a/raid-survival/client/static/ak-shot-animations.txt b/games/raid-survival/apps/client/assets/ak-shot-animations.txt similarity index 100% rename from raid-survival/client/static/ak-shot-animations.txt rename to games/raid-survival/apps/client/assets/ak-shot-animations.txt diff --git a/raid-survival/client/static/buildings.png b/games/raid-survival/apps/client/assets/buildings.png similarity index 100% rename from raid-survival/client/static/buildings.png rename to games/raid-survival/apps/client/assets/buildings.png diff --git a/raid-survival/client/static/bullet-animations.txt b/games/raid-survival/apps/client/assets/bullet-animations.txt similarity index 100% rename from raid-survival/client/static/bullet-animations.txt rename to games/raid-survival/apps/client/assets/bullet-animations.txt diff --git a/raid-survival/client/static/hand.png b/games/raid-survival/apps/client/assets/hand.png similarity index 100% rename from raid-survival/client/static/hand.png rename to games/raid-survival/apps/client/assets/hand.png diff --git a/raid-survival/client/static/hands.png b/games/raid-survival/apps/client/assets/hands.png similarity index 100% rename from raid-survival/client/static/hands.png rename to games/raid-survival/apps/client/assets/hands.png diff --git a/raid-survival/client/static/health-bar-fill-animations.txt b/games/raid-survival/apps/client/assets/health-bar-fill-animations.txt similarity index 100% rename from raid-survival/client/static/health-bar-fill-animations.txt rename to games/raid-survival/apps/client/assets/health-bar-fill-animations.txt diff --git a/raid-survival/client/static/health-bar-frame-animations.txt b/games/raid-survival/apps/client/assets/health-bar-frame-animations.txt similarity index 100% rename from raid-survival/client/static/health-bar-frame-animations.txt rename to games/raid-survival/apps/client/assets/health-bar-frame-animations.txt diff --git a/raid-survival/client/static/loot-ammo-animations.txt b/games/raid-survival/apps/client/assets/loot-ammo-animations.txt similarity index 100% rename from raid-survival/client/static/loot-ammo-animations.txt rename to games/raid-survival/apps/client/assets/loot-ammo-animations.txt diff --git a/raid-survival/client/static/loot-gold-animations.txt b/games/raid-survival/apps/client/assets/loot-gold-animations.txt similarity index 100% rename from raid-survival/client/static/loot-gold-animations.txt rename to games/raid-survival/apps/client/assets/loot-gold-animations.txt diff --git a/raid-survival/client/static/loot-heal-animations.txt b/games/raid-survival/apps/client/assets/loot-heal-animations.txt similarity index 100% rename from raid-survival/client/static/loot-heal-animations.txt rename to games/raid-survival/apps/client/assets/loot-heal-animations.txt diff --git a/raid-survival/client/static/map.png b/games/raid-survival/apps/client/assets/map.png similarity index 100% rename from raid-survival/client/static/map.png rename to games/raid-survival/apps/client/assets/map.png diff --git a/raid-survival/client/static/npc-animations.txt b/games/raid-survival/apps/client/assets/npc-animations.txt similarity index 100% rename from raid-survival/client/static/npc-animations.txt rename to games/raid-survival/apps/client/assets/npc-animations.txt diff --git a/raid-survival/client/static/npc.png b/games/raid-survival/apps/client/assets/npc.png similarity index 100% rename from raid-survival/client/static/npc.png rename to games/raid-survival/apps/client/assets/npc.png diff --git a/raid-survival/client/static/objects-animations.txt b/games/raid-survival/apps/client/assets/objects-animations.txt similarity index 100% rename from raid-survival/client/static/objects-animations.txt rename to games/raid-survival/apps/client/assets/objects-animations.txt diff --git a/raid-survival/client/static/objects.png b/games/raid-survival/apps/client/assets/objects.png similarity index 100% rename from raid-survival/client/static/objects.png rename to games/raid-survival/apps/client/assets/objects.png diff --git a/raid-survival/client/static/player-animations.txt b/games/raid-survival/apps/client/assets/player-animations.txt similarity index 100% rename from raid-survival/client/static/player-animations.txt rename to games/raid-survival/apps/client/assets/player-animations.txt diff --git a/raid-survival/client/static/player1.png b/games/raid-survival/apps/client/assets/player1.png similarity index 100% rename from raid-survival/client/static/player1.png rename to games/raid-survival/apps/client/assets/player1.png diff --git a/raid-survival/client/static/player2.png b/games/raid-survival/apps/client/assets/player2.png similarity index 100% rename from raid-survival/client/static/player2.png rename to games/raid-survival/apps/client/assets/player2.png diff --git a/raid-survival/client/static/player3.png b/games/raid-survival/apps/client/assets/player3.png similarity index 100% rename from raid-survival/client/static/player3.png rename to games/raid-survival/apps/client/assets/player3.png diff --git a/raid-survival/client/static/shotgun-reload-animations.txt b/games/raid-survival/apps/client/assets/shotgun-reload-animations.txt similarity index 100% rename from raid-survival/client/static/shotgun-reload-animations.txt rename to games/raid-survival/apps/client/assets/shotgun-reload-animations.txt diff --git a/raid-survival/client/static/shotgun-shot-animations.txt b/games/raid-survival/apps/client/assets/shotgun-shot-animations.txt similarity index 100% rename from raid-survival/client/static/shotgun-shot-animations.txt rename to games/raid-survival/apps/client/assets/shotgun-shot-animations.txt diff --git a/raid-survival/client/static/tower-animations.txt b/games/raid-survival/apps/client/assets/tower-animations.txt similarity index 100% rename from raid-survival/client/static/tower-animations.txt rename to games/raid-survival/apps/client/assets/tower-animations.txt diff --git a/raid-survival/client/static/ui-crosshair-animations.txt b/games/raid-survival/apps/client/assets/ui-crosshair-animations.txt similarity index 100% rename from raid-survival/client/static/ui-crosshair-animations.txt rename to games/raid-survival/apps/client/assets/ui-crosshair-animations.txt diff --git a/raid-survival/client/static/ui-reload-animations.txt b/games/raid-survival/apps/client/assets/ui-reload-animations.txt similarity index 100% rename from raid-survival/client/static/ui-reload-animations.txt rename to games/raid-survival/apps/client/assets/ui-reload-animations.txt diff --git a/raid-survival/client/static/ui.png b/games/raid-survival/apps/client/assets/ui.png similarity index 100% rename from raid-survival/client/static/ui.png rename to games/raid-survival/apps/client/assets/ui.png diff --git a/raid-survival/client/static/uzi-reload-animations.txt b/games/raid-survival/apps/client/assets/uzi-reload-animations.txt similarity index 100% rename from raid-survival/client/static/uzi-reload-animations.txt rename to games/raid-survival/apps/client/assets/uzi-reload-animations.txt diff --git a/raid-survival/client/static/uzi-shot-animations.txt b/games/raid-survival/apps/client/assets/uzi-shot-animations.txt similarity index 100% rename from raid-survival/client/static/uzi-shot-animations.txt rename to games/raid-survival/apps/client/assets/uzi-shot-animations.txt diff --git a/raid-survival/client/static/wall-animations.txt b/games/raid-survival/apps/client/assets/wall-animations.txt similarity index 100% rename from raid-survival/client/static/wall-animations.txt rename to games/raid-survival/apps/client/assets/wall-animations.txt diff --git a/raid-survival/client/static/weapons-animations.txt b/games/raid-survival/apps/client/assets/weapons-animations.txt similarity index 100% rename from raid-survival/client/static/weapons-animations.txt rename to games/raid-survival/apps/client/assets/weapons-animations.txt diff --git a/raid-survival/client/static/weapons.png b/games/raid-survival/apps/client/assets/weapons.png similarity index 100% rename from raid-survival/client/static/weapons.png rename to games/raid-survival/apps/client/assets/weapons.png diff --git a/raid-survival/client/static/zombie-animations.txt b/games/raid-survival/apps/client/assets/zombie-animations.txt similarity index 100% rename from raid-survival/client/static/zombie-animations.txt rename to games/raid-survival/apps/client/assets/zombie-animations.txt diff --git a/raid-survival/client/static/zombie_cop.png b/games/raid-survival/apps/client/assets/zombie_cop.png similarity index 100% rename from raid-survival/client/static/zombie_cop.png rename to games/raid-survival/apps/client/assets/zombie_cop.png diff --git a/games/raid-survival/apps/client/nanoforge.config.ts b/games/raid-survival/apps/client/nanoforge.config.ts new file mode 100644 index 0000000..5690555 --- /dev/null +++ b/games/raid-survival/apps/client/nanoforge.config.ts @@ -0,0 +1,6 @@ +import { defineConfig } from "@nanoforge-dev/config"; + +export default defineConfig({ + type: "client", + libs: ["../../libs/shared"], +}); diff --git a/games/raid-survival/apps/client/package.json b/games/raid-survival/apps/client/package.json new file mode 100644 index 0000000..529a867 --- /dev/null +++ b/games/raid-survival/apps/client/package.json @@ -0,0 +1,20 @@ +{ + "$schema": "https://json.schemastore.org/package.json", + "name": "raid-survival-client", + "private": true, + "type": "module", + "devDependencies": { + "@nanoforge-dev/asset": "^3.0.0", + "@nanoforge-dev/common": "^3.0.0", + "@nanoforge-dev/core": "^3.0.0", + "@nanoforge-dev/ecs": "^3.0.0", + "@nanoforge-dev/editor-lib": "^3.0.0", + "@nanoforge-dev/env": "^3.0.0", + "@nanoforge-dev/graphics-2d": "^3.0.0", + "@nanoforge-dev/input": "^3.0.0", + "@nanoforge-dev/network": "^3.0.0", + "@nanoforge-dev/scene": "^3.0.0", + "@raid-survival/shared": "workspace:*", + "typescript": "^6.0.0" + } +} diff --git a/games/raid-survival/apps/client/src/build-world.ts b/games/raid-survival/apps/client/src/build-world.ts new file mode 100644 index 0000000..f01aac4 --- /dev/null +++ b/games/raid-survival/apps/client/src/build-world.ts @@ -0,0 +1,1282 @@ +import type { Context } from "@nanoforge-dev/common"; +import type { Registry } from "@nanoforge-dev/ecs/client"; +import "@nanoforge-dev/graphics-2d"; +import { Arc, Circle, Layer, Rect, Ring, Shape } from "@nanoforge-dev/graphics-2d"; +import "@nanoforge-dev/scene"; +import { BUILDING_CATALOG, type BuildingType } from "@raid-survival/shared/building-catalog"; +import { TILE_SIZE } from "@raid-survival/shared/map"; +import type { ServerMessageOf, StartingPlayer, Vector } from "@raid-survival/shared/protocol"; +import { TOWER_RANGE } from "@raid-survival/shared/tower"; +import { WEAPON_CATALOG, type WeaponType } from "@raid-survival/shared/weapon-catalog"; + +import { AmmoHudComponent } from "./components/ammo-hud.component"; +import { BuildModeComponent, type BuildBarButton } from "./components/build-mode.component"; +import { BuildingInteractIndicatorComponent } from "./components/building-interact-indicator.component"; +import { ChildrenComponent } from "./components/children.component"; +import { CursorComponent } from "./components/cursor.component"; +import { DirectionRotatorComponent } from "./components/direction-rotator.component"; +import { Direction } from "./components/direction.component"; +import { DrawOrder2D } from "./components/draw-order-2d.component"; +import { GameView } from "./components/game-view.component"; +import { HealthBarFill } from "./components/health-bar-fill.component"; +import { Health } from "./components/health.component"; +import { Lobby } from "./components/lobby.component"; +import { MoneyHudComponent } from "./components/money-hud.component"; +import { MoveController } from "./components/move-controller.component"; +import { NetworkId } from "./components/network-id.component"; +import { Player } from "./components/player.component"; +import { RectComponent } from "./components/rect.component"; +import { ReloadIndicatorComponent } from "./components/reload-indicator.component"; +import { ReviveController } from "./components/revive-controller.component"; +import { ReviveHintIndicatorComponent } from "./components/revive-hint-indicator.component"; +import { ReviveIndicatorComponent } from "./components/revive-indicator.component"; +import { ShootController } from "./components/shoot-controller.component"; +import { SpriteComponent } from "./components/sprite.component"; +import { TextComponent } from "./components/text.component"; +import { TransformComponent } from "./components/transform.component"; +import { Velocity2D } from "./components/velocity-2d.component"; +import { WaveHudComponent } from "./components/wave-hud.component"; +import { WeaponReloadOverlayComponent } from "./components/weapon-reload-overlay.component"; +import { WeaponShopComponent } from "./components/weapon-shop.component"; +import { Weapon } from "./components/weapon.component"; +import { addCoinIcon } from "./hud-helpers"; +import { + AMMO_ICON_SIZE, + CURSOR_SCALE, + MAX_ZOOM, + MIN_ZOOM, + WEAPON_LOCAL_OFFSET, + ZOOM_STEP, +} from "./hud-layout"; + +const HEALTH_BAR_Z_INDEX = 30; // above hands (20) - health bars must render above nearby sprites +// Strictly higher than the frame, not equal - zOrderSystem sorts ties by enumeration order, not +// construction order, so an equal z-index could render the frame's border over the fill. +const HEALTH_BAR_FILL_Z_INDEX = HEALTH_BAR_Z_INDEX + 1; + +// Native player sprite size (player-animations.txt, unscaled). +const PLAYER_SPRITE_SIZE = { width: 24, height: 24 }; + +// Native size of the truck+house crop defined in objects-animations.txt's "idle" frame. +const LOBBY_SPRITE_SIZE = { width: 187, height: 143 }; + +// ui.png health bar sprites (see health-bar-frame-animations.txt / health-bar-fill-animations.txt). +const HEALTH_BAR_FRAME_SIZE = { width: 23, height: 6 }; +const HEALTH_BAR_FILL_SIZE = { width: 12, height: 2 }; +// The gray cavity inside the frame's border, in frame-local pixels, where the fill sits. +const HEALTH_BAR_FILL_CAVITY = { x: 2, y: 2, width: 19, height: 2 }; +const HEALTH_BAR_FILL_MAX_SCALE_X = HEALTH_BAR_FILL_CAVITY.width / HEALTH_BAR_FILL_SIZE.width; +const HEALTH_BAR_GAP_ABOVE = 10; + +// "Hold E to revive" progress circle above each player's health bar. +const REVIVE_RING_RADIUS = 8; +const REVIVE_RING_THICKNESS = 3; +const REVIVE_RING_GAP_ABOVE = 20; +// Above both the revive ring and the "Reloading..." text so a downed player's hint never overlaps. +const REVIVE_HINT_TEXT_GAP_ABOVE = 34; + +// "Press E to..." proximity hint above a tower/wall/the lobby's own health bar. +const INTERACT_INDICATOR_GAP_ABOVE = 22; + +// Wave HUD: "Wave x/y", a sub-wave progress bar, the live zombie count. +const WAVE_TEXT_SIZE = { width: 110, height: 24 }; +const WAVE_PROGRESS_BAR_SIZE = { width: 180, height: 14 }; +const ALIVE_TEXT_SIZE = { width: 100, height: 24 }; +const WAVE_HUD_GAP = 12; +const WAVE_HUD_TOP_MARGIN = 14; +// "Next round in Ns" - handlers/wave-info.handler.ts owns showing/hiding it during cooldown. +const WAVE_COUNTDOWN_TEXT_SIZE = { height: 18 }; +const WAVE_COUNTDOWN_GAP = 6; + +const MONEY_TEXT_SIZE = { width: 140, height: 24 }; +const MONEY_HUD_LEFT_MARGIN = 14; +const MONEY_HUD_TOP_MARGIN = 14; + +const BUILD_BUTTON_SIZE = { width: 90, height: 70 }; +const BUILD_BAR_GAP = 10; +const BUILD_BAR_BOTTOM_MARGIN = 20; +const GRID_STROKE = "rgba(245, 242, 233, 0.25)"; +const ZOOM_BUTTON_SIZE = { width: 36, height: 36 }; +const ZOOM_BUTTON_GAP = 8; +const ZOOM_BUTTON_MARGIN = 16; + +// Above bullets/zombies so a bullet fired from the player's own center renders tucked behind the +// player's body instead of floating on top of it. +const PLAYER_Z_INDEX = 16; + +// Held weapon sprite, just above the hand in z-order. Each weapon's rest-angle rotation offset +// lives in weapon-catalog.ts, since a shotgun's art doesn't rest at the same angle as the pistol's. +const WEAPON_Z_INDEX = 21; + +// A weapon's (or its reload overlay's) LocalTransform: WEAPON_LOCAL_OFFSET plus its own +// handOffsetDelta, if it has one. The hand and its weapon share one LocalTransform, but each +// sprite's own pivot renders at its own position plus its own pivot - so unless a weapon's pivot +// numerically matches hand.png's default center pivot (8,8), the two land at different world +// points; handOffsetDelta corrects that gap (see weapon-catalog.ts for the derivation). +const weaponLocalOffset = (catalog: { spriteKey: string; handOffsetDelta?: Vector }): Vector => { + const delta = catalog.handOffsetDelta; + return delta + ? { x: WEAPON_LOCAL_OFFSET.x + delta.x, y: WEAPON_LOCAL_OFFSET.y + delta.y } + : WEAPON_LOCAL_OFFSET; +}; + +// Ammo HUD, bottom-left of the screen. Hidden entirely whenever nothing is equipped - see +// reload-indicator.system.ts. +const AMMO_HUD_LEFT_MARGIN = 14; +const AMMO_HUD_BOTTOM_MARGIN = 14; +const AMMO_TEXT_SIZE = { width: 100, height: 32 }; +const AMMO_HUD_GAP = 10; + +// World-space "Reloading..." label above every player's health bar while their weapon reloads - +// visible to everyone nearby, not just a local HUD element (reload-indicator.system.ts). +const RELOAD_TEXT_GAP_ABOVE = 22; + +// Custom crosshair cursor, replacing the OS cursor during a game. Size/scale shared with +// cursor.system.ts (which positions it every tick), so they can't drift apart. +const CURSOR_Z_INDEX = 100; + +// No coin sprite exists in this game's art (see hud-helpers.ts), so currency is drawn as a circle. +const COIN_ICON_RADIUS = 7; +const COIN_ICON_GAP = 4; // between the coin and the number that follows it + +// Weapon shop panel, right edge of the screen, shown/hidden alongside the build bar. +const SHOP_PANEL_RIGHT_MARGIN = 20; +const SHOP_ENTRY_WIDTH = 100; +const SHOP_BUY_HEIGHT = 64; +const SHOP_SELECT_BUTTON_HEIGHT = 24; +const SHOP_SELECT_BUTTON_GAP = 4; +const SHOP_ENTRY_GAP = 14; +const SHOP_ENTRY_HEIGHT = SHOP_BUY_HEIGHT + SHOP_SELECT_BUTTON_GAP + SHOP_SELECT_BUTTON_HEIGHT; +const SHOP_TOP_MARGIN = 110; // clears the wave HUD + +export const buildHealthBar = ( + layer: Layer, + registry: Registry, + parentEntity: ReturnType, + parentWidth: number, + health: { current: number; max: number }, +) => { + const frameLocalX = (parentWidth - HEALTH_BAR_FRAME_SIZE.width) / 2; + const frameLocalY = -HEALTH_BAR_GAP_ABOVE; + + const frame = registry.spawnEntity(); + registry.addComponent(frame, new TransformComponent(0, 0)); + registry.addComponent( + frame, + new SpriteComponent("ui.png", { layer, animationsKey: "health-bar-frame-animations.txt" }), + ); + registry.addComponent( + frame, + new ChildrenComponent(parentEntity.getId(), { + LocalTransform: { x: frameLocalX, y: frameLocalY }, + }), + ); + registry.addComponent(frame, new Direction(0, 0)); + registry.addComponent(frame, new DrawOrder2D(HEALTH_BAR_Z_INDEX)); + + const fraction = health.max > 0 ? health.current / health.max : 0; + const fillScaleX = HEALTH_BAR_FILL_MAX_SCALE_X * fraction; + // A sprite scales around its own center, so shrinking it would eat into both edges symmetrically + // - compensate the local X so the fill's left edge stays anchored regardless of scale. + const cavityLocalX = frameLocalX + HEALTH_BAR_FILL_CAVITY.x; + const fillLocalX = cavityLocalX - (HEALTH_BAR_FILL_SIZE.width / 2) * (1 - fillScaleX); + const fillLocalY = frameLocalY + HEALTH_BAR_FILL_CAVITY.y; + + const fill = registry.spawnEntity(); + registry.addComponent(fill, new TransformComponent(0, 0)); + registry.addComponent( + fill, + new SpriteComponent("ui.png", { + layer, + animationsKey: "health-bar-fill-animations.txt", + scale: { x: fillScaleX, y: 1 }, + }), + ); + registry.addComponent( + fill, + new ChildrenComponent(parentEntity.getId(), { + LocalTransform: { x: fillLocalX, y: fillLocalY }, + }), + ); + registry.addComponent(fill, new Direction(0, 0)); + registry.addComponent(fill, new DrawOrder2D(HEALTH_BAR_FILL_Z_INDEX)); + registry.addComponent(fill, new HealthBarFill(cavityLocalX)); +}; + +// "Press E to..." hint text above a tower/wall/the lobby's own health bar - starts empty/hidden; +// building-interact-indicator.system.ts drives its text/visibility every tick. +export const buildInteractIndicator = ( + layer: Layer, + registry: Registry, + parentEntity: ReturnType, + parentWidth: number, +) => { + const localX = parentWidth / 2; + const localY = -INTERACT_INDICATOR_GAP_ABOVE; + + const textComponent = new TextComponent(layer, { + text: "", + x: 0, + y: 0, + width: 160, + align: "center", + offsetX: 80, + fontSize: 11, + fontStyle: "bold", + fill: "#F5F2E9", + stroke: "#000000", + strokeWidth: 2, + fillAfterStrokeEnabled: true, + listening: false, + visible: false, + }); + + const indicator = registry.spawnEntity(); + registry.addComponent(indicator, new TransformComponent(0, 0)); + registry.addComponent( + indicator, + new ChildrenComponent(parentEntity.getId(), { LocalTransform: { x: localX, y: localY } }), + ); + registry.addComponent(indicator, new Direction(0, 0)); + registry.addComponent(indicator, new BuildingInteractIndicatorComponent(textComponent.text)); +}; + +// Grey->green "hold E to revive" progress circle, one per player, starting hidden. +// handlers/revive.handler.ts drives its visibility/progress from the server's revive.system.ts +// events; revive-indicator.system.ts positions it every tick (raw Konva shapes, not a +// SpriteComponent, so spriteSystem never touches it). +const buildReviveIndicator = ( + layer: Layer, + registry: Registry, + parentEntity: ReturnType, + parentWidth: number, +) => { + const localX = parentWidth / 2; + const localY = -REVIVE_RING_GAP_ABOVE; + + const background = new Ring({ + innerRadius: REVIVE_RING_RADIUS - REVIVE_RING_THICKNESS, + outerRadius: REVIVE_RING_RADIUS, + fill: "rgba(90, 90, 90, 0.85)", + visible: false, + }); + // rotation: -90 so the fill starts from the top and grows clockwise as `angle` increases, + // rather than starting at Konva's default 3-o'clock position. + const fill = new Arc({ + innerRadius: REVIVE_RING_RADIUS - REVIVE_RING_THICKNESS, + outerRadius: REVIVE_RING_RADIUS, + angle: 0, + rotation: -90, + fill: "#4caf50", + visible: false, + }); + layer.add(background); + layer.add(fill); + + const indicator = registry.spawnEntity(); + registry.addComponent(indicator, new TransformComponent(0, 0)); + registry.addComponent( + indicator, + new ChildrenComponent(parentEntity.getId(), { LocalTransform: { x: localX, y: localY } }), + ); + registry.addComponent(indicator, new Direction(0, 0)); + registry.addComponent(indicator, new ReviveIndicatorComponent(background, fill)); +}; + +// "Hold E to revive" hint text above a player's own revive ring, starting hidden - +// revive-hint-indicator.system.ts drives its visibility every tick. +const buildReviveHintIndicator = ( + layer: Layer, + registry: Registry, + parentEntity: ReturnType, + parentWidth: number, +) => { + const localX = parentWidth / 2; + const localY = -REVIVE_HINT_TEXT_GAP_ABOVE; + + const textComponent = new TextComponent(layer, { + text: "Hold E to revive", + x: 0, + y: 0, + width: 160, + align: "center", + offsetX: 80, + fontSize: 11, + fontStyle: "bold", + fill: "#F5F2E9", + stroke: "#000000", + strokeWidth: 2, + fillAfterStrokeEnabled: true, + listening: false, + visible: false, + }); + + const indicator = registry.spawnEntity(); + registry.addComponent(indicator, new TransformComponent(0, 0)); + registry.addComponent( + indicator, + new ChildrenComponent(parentEntity.getId(), { LocalTransform: { x: localX, y: localY } }), + ); + registry.addComponent(indicator, new Direction(0, 0)); + registry.addComponent(indicator, new ReviveHintIndicatorComponent(textComponent.text)); +}; + +// World-space "Reloading..." label above each player's health bar, starting hidden - +// reload-indicator.system.ts drives visibility and repositions it every tick (Text isn't a +// Sprite, so spriteSystem never touches it). +const buildReloadIndicator = ( + layer: Layer, + registry: Registry, + parentEntity: ReturnType, + parentWidth: number, +) => { + const localX = parentWidth / 2; + const localY = -RELOAD_TEXT_GAP_ABOVE; + + const textComponent = new TextComponent(layer, { + text: "Reloading...", + x: 0, + y: 0, + width: 100, + align: "center", + offsetX: 50, + fontSize: 12, + fontStyle: "bold", + fill: "#F5F2E9", + listening: false, + visible: false, + }); + + const indicator = registry.spawnEntity(); + registry.addComponent(indicator, new TransformComponent(0, 0)); + registry.addComponent( + indicator, + new ChildrenComponent(parentEntity.getId(), { LocalTransform: { x: localX, y: localY } }), + ); + registry.addComponent(indicator, new Direction(0, 0)); + registry.addComponent(indicator, new ReloadIndicatorComponent(textComponent.text)); +}; + +// The single hand + its held weapon for a player. `weaponType` null means unequipped: the weapon +// sprite still exists (so handlers/weapon-inventory.handler.ts has something to re-point later), +// just hidden - reload-indicator.system.ts/weapon-visibility.system.ts own that visibility. +const buildHandAndWeapon = ( + world: Layer, + registry: Registry, + playerEntity: ReturnType, + playerPosition: Vector, + weaponType: WeaponType | null, +) => { + const localOffset = WEAPON_LOCAL_OFFSET; + + const handEntity = registry.spawnEntity(); + registry.addComponent(handEntity, new TransformComponent(playerPosition.x, playerPosition.y)); + registry.addComponent(handEntity, new SpriteComponent("hand.png", { layer: world })); + registry.addComponent( + handEntity, + new ChildrenComponent(playerEntity.getId(), { LocalTransform: localOffset }), + ); + registry.addComponent(handEntity, new Direction(0, 0)); + // mirrorWhenFacingLeft: true - must match the weapon's own DirectionRotatorComponent below, or + // the hand and gun rotate by different formulas while aiming left and visibly diverge. + registry.addComponent(handEntity, new DirectionRotatorComponent(-98, true, true)); + registry.addComponent(handEntity, new DrawOrder2D(20)); + + // An unequipped player has no weaponType to key off yet, so this defaults to smallGun's art + // (hidden regardless - see weapon-visibility.system.ts/build-mode.system.ts). Once a real + // weaponType is equipped, weapon-reload-animation.system.ts re-points spriteKey/animationsKey. + const initialCatalog = weaponType ? WEAPON_CATALOG[weaponType] : WEAPON_CATALOG.smallGun; + const rotationOffset = weaponType ? WEAPON_CATALOG[weaponType].rotationOffset : 0; + const weaponEntity = registry.spawnEntity(); + registry.addComponent(weaponEntity, new TransformComponent(playerPosition.x, playerPosition.y)); + registry.addComponent( + weaponEntity, + new SpriteComponent(initialCatalog.spriteKey, { + layer: world, + animationsKey: initialCatalog.animationsKey, + scale: { x: initialCatalog.scale, y: initialCatalog.scale }, + // Where the hand actually grips this weapon's art, if not the frame's default center pivot. + ...("pivot" in initialCatalog ? { pivot: initialCatalog.pivot } : {}), + // Only meaningful for a weapon with its own "shoot" animation. Set once at construction, + // like the reload overlay's frameRate below, since SpriteComponent.frameRate isn't reactive. + ...("shootFrameCount" in initialCatalog + ? { frameRate: initialCatalog.shootFrameCount / initialCatalog.shootSeconds } + : {}), + }), + ); + registry.addComponent( + weaponEntity, + new ChildrenComponent(playerEntity.getId(), { + LocalTransform: weaponLocalOffset(initialCatalog), + }), + ); + registry.addComponent(weaponEntity, new Direction(0, 0)); + // mirrorWhenFacingLeft: true - the gun rotates through the full circle, so without this it + // reads upside-down for the whole left half of the arc. + registry.addComponent(weaponEntity, new DirectionRotatorComponent(rotationOffset, true, true)); + registry.addComponent(weaponEntity, new DrawOrder2D(WEAPON_Z_INDEX)); + registry.addComponent(weaponEntity, new Weapon(weaponType, rotationOffset)); + + // Reload-animation overlay - built once, hidden by default. weapon-reload-animation.system.ts + // shows it (hiding the main weapon sprite) only while the equipped weapon is reloading. + // Hardcoded to the shotgun's reload asset - the only weapon with one right now. A separate + // sprite entity rather than swapping the main weapon's image at reload time: swapping destroys + // and recreates the Konva node asynchronously, which visibly flickered; toggling visibility + // between two sprites that already exist is instant. + const reloadOverlayCatalog = WEAPON_CATALOG.shotgun; + const reloadOverlayEntity = registry.spawnEntity(); + registry.addComponent( + reloadOverlayEntity, + new TransformComponent(playerPosition.x, playerPosition.y), + ); + registry.addComponent( + reloadOverlayEntity, + // Not currentAnimation: "reload" - spriteSystem always constructs its Konva node hardcoded on + // "idle", so weapon-reload-animation.system.ts applies the real "reload" key once the sprite + // actually exists. + new SpriteComponent(reloadOverlayCatalog.reloadSpriteKey, { + layer: world, + animationsKey: reloadOverlayCatalog.reloadAnimationsKey, + frameRate: reloadOverlayCatalog.reloadFrameCount / reloadOverlayCatalog.reloadSeconds, + // Same world-space scale and pivot as the held sprite - it's the same asset pack, same + // resting pose in frame 0. + scale: { x: reloadOverlayCatalog.scale, y: reloadOverlayCatalog.scale }, + pivot: reloadOverlayCatalog.pivot, + }), + ); + registry.addComponent( + reloadOverlayEntity, + // This overlay always displays the shotgun's reload asset regardless of what's equipped, so + // its offset never changes at runtime - fine to compute once here. + new ChildrenComponent(playerEntity.getId(), { + LocalTransform: weaponLocalOffset(reloadOverlayCatalog), + }), + ); + registry.addComponent(reloadOverlayEntity, new Direction(0, 0)); + registry.addComponent( + reloadOverlayEntity, + new DirectionRotatorComponent(reloadOverlayCatalog.rotationOffset, true, true), + ); + registry.addComponent(reloadOverlayEntity, new DrawOrder2D(WEAPON_Z_INDEX)); + registry.addComponent(reloadOverlayEntity, new WeaponReloadOverlayComponent()); +}; + +const buildPlayer = ( + world: Layer, + playerPacket: StartingPlayer, + registry: Registry, + playerId: number | undefined, +) => { + const playerEntity = registry.spawnEntity(); + registry.addComponent(playerEntity, new NetworkId(playerPacket.id)); + registry.addComponent(playerEntity, new Player()); + registry.addComponent(playerEntity, new Direction(0, 0)); + registry.addComponent(playerEntity, new DrawOrder2D(PLAYER_Z_INDEX)); + registry.addComponent( + playerEntity, + new TransformComponent(playerPacket.position.x, playerPacket.position.y), + ); + registry.addComponent(playerEntity, new Velocity2D(0, 0)); + // player1.png..player3.png share the same 24x24 idle/walk/death layout (see + // player-animations.txt) - picked in MenuView's skin swatches and carried through the + // joinLobby/startGame packets, clamped again here in case a stale/malformed value slipped in. + const skin = + Number.isInteger(playerPacket.skin) && playerPacket.skin >= 1 && playerPacket.skin <= 3 + ? playerPacket.skin + : 1; + registry.addComponent( + playerEntity, + new SpriteComponent(`player${skin}.png`, { + layer: world, + animationsKey: "player-animations.txt", + }), + ); + if (playerId === playerPacket.id) { + registry.addComponent(playerEntity, new MoveController()); + registry.addComponent(playerEntity, new ShootController()); + registry.addComponent(playerEntity, new ReviveController()); + } + registry.addComponent( + playerEntity, + new Health(playerPacket.health.current, playerPacket.health.max), + ); + buildHealthBar(world, registry, playerEntity, PLAYER_SPRITE_SIZE.width, playerPacket.health); + buildReviveIndicator(world, registry, playerEntity, PLAYER_SPRITE_SIZE.width); + buildReviveHintIndicator(world, registry, playerEntity, PLAYER_SPRITE_SIZE.width); + buildReloadIndicator(world, registry, playerEntity, PLAYER_SPRITE_SIZE.width); + + // Every player visibly holds their weapon (not just the local one), so everyone agrees on what + // everyone else's loadout looks like. + buildHandAndWeapon( + world, + registry, + playerEntity, + playerPacket.position, + playerPacket.weaponType ?? null, + ); +}; + +const buildAmmoHud = ( + hudLayer: Layer, + registry: Registry, + weaponType: WeaponType | null, + ammo: { magazineAmmo: number; reserveAmmo: number } | undefined, +) => { + const iconX = AMMO_HUD_LEFT_MARGIN; + const iconY = window.innerHeight - AMMO_ICON_SIZE.height - AMMO_HUD_BOTTOM_MARGIN; + + // Each weapon can have a different native crop size (e.g. Shotgun-Shot.png's 52x32 vs. a 16x16 + // pistol crop) - fit-scale uniformly into the fixed AMMO_ICON_SIZE box rather than assuming + // they're all the same size. Nothing equipped defaults to smallGun's icon (hidden regardless). + const initialIconCatalog = weaponType ? WEAPON_CATALOG[weaponType] : WEAPON_CATALOG.smallGun; + const iconFitScale = Math.min( + AMMO_ICON_SIZE.width / initialIconCatalog.iconSize.width, + AMMO_ICON_SIZE.height / initialIconCatalog.iconSize.height, + ); + const iconEntity = registry.spawnEntity(); + const iconSprite = new SpriteComponent(initialIconCatalog.spriteKey, { + layer: hudLayer, + animationsKey: initialIconCatalog.animationsKey, + scale: { x: iconFitScale, y: iconFitScale }, + }); + // Not setAnimation() here - spriteSystem builds the sprite lazily, hardcoded on "idle" - + // reload-indicator.system.ts asserts the real icon animation every tick once it actually exists. + registry.addComponent(iconEntity, iconSprite); + registry.addComponent(iconEntity, new TransformComponent(iconX, iconY)); + + const magazineAmmo = ammo?.magazineAmmo ?? 0; + const reserve = ammo?.reserveAmmo === -1 ? "∞" : (ammo?.reserveAmmo ?? 0); + const textEntity = registry.spawnEntity(); + const textComponent = new TextComponent(hudLayer, { + text: `${magazineAmmo} / ${reserve}`, + x: iconX + AMMO_ICON_SIZE.width + AMMO_HUD_GAP, + y: iconY, + width: AMMO_TEXT_SIZE.width, + height: AMMO_TEXT_SIZE.height, + fontSize: 20, + fontStyle: "bold", + verticalAlign: "middle", + fill: "#F5F2E9", + }); + registry.addComponent(textEntity, textComponent); + + const hudEntity = registry.spawnEntity(); + registry.addComponent(hudEntity, new AmmoHudComponent(textComponent.text, iconSprite)); +}; + +const buildCursor = (hudLayer: Layer, registry: Registry) => { + const cursorEntity = registry.spawnEntity(); + registry.addComponent( + cursorEntity, + new SpriteComponent("ui.png", { + layer: hudLayer, + animationsKey: "ui-crosshair-animations.txt", + scale: { x: CURSOR_SCALE, y: CURSOR_SCALE }, + }), + ); + registry.addComponent(cursorEntity, new TransformComponent(0, 0)); + registry.addComponent(cursorEntity, new CursorComponent()); + // Must never end up buried under other z-indexed sprites once anything else on the HUD changes + // - zOrderSystem only reorders entities that have both DrawOrder2D and SpriteComponent. + registry.addComponent(cursorEntity, new DrawOrder2D(CURSOR_Z_INDEX)); +}; + +const buildLobby = ( + world: Layer, + lobbyPacket: ServerMessageOf<"startGame">["lobby"], + registry: Registry, +) => { + const lobbyEntity = registry.spawnEntity(); + registry.addComponent(lobbyEntity, new NetworkId(lobbyPacket.id)); + registry.addComponent( + lobbyEntity, + new TransformComponent(lobbyPacket.position.x, lobbyPacket.position.y), + ); + registry.addComponent( + lobbyEntity, + new SpriteComponent("objects.png", { + layer: world, + animationsKey: "objects-animations.txt", + }), + ); + registry.addComponent(lobbyEntity, new Lobby()); + registry.addComponent(lobbyEntity, new DrawOrder2D(10)); + registry.addComponent( + lobbyEntity, + new Health(lobbyPacket.health.current, lobbyPacket.health.max), + ); + buildHealthBar(world, registry, lobbyEntity, LOBBY_SPRITE_SIZE.width, lobbyPacket.health); + buildInteractIndicator(world, registry, lobbyEntity, LOBBY_SPRITE_SIZE.width); +}; + +const buildWaveHud = (layer: Layer, registry: Registry) => { + const totalWidth = + WAVE_TEXT_SIZE.width + + WAVE_HUD_GAP + + WAVE_PROGRESS_BAR_SIZE.width + + WAVE_HUD_GAP + + ALIVE_TEXT_SIZE.width; + const startX = window.innerWidth / 2 - totalWidth / 2; + + const waveTextEntity = registry.spawnEntity(); + const waveTextComponent = new TextComponent(layer, { + text: "Wave -/-", + x: startX, + y: WAVE_HUD_TOP_MARGIN, + width: WAVE_TEXT_SIZE.width, + height: WAVE_TEXT_SIZE.height, + fontSize: 18, + fontStyle: "bold", + verticalAlign: "middle", + fill: "#F5F2E9", + }); + registry.addComponent(waveTextEntity, waveTextComponent); + + const barX = startX + WAVE_TEXT_SIZE.width + WAVE_HUD_GAP; + const barY = WAVE_HUD_TOP_MARGIN + (WAVE_TEXT_SIZE.height - WAVE_PROGRESS_BAR_SIZE.height) / 2; + + const trackEntity = registry.spawnEntity(); + const trackComponent = new RectComponent(layer, { + x: barX, + y: barY, + width: WAVE_PROGRESS_BAR_SIZE.width, + height: WAVE_PROGRESS_BAR_SIZE.height, + fill: "#2B2B2B", + stroke: "#F5F2E9", + strokeWidth: 1, + cornerRadius: 3, + }); + registry.addComponent(trackEntity, trackComponent); + + // Drawn on top of the track, grown from 0 width by handlers/wave-info.handler.ts as sub-waves + // complete. + const fillEntity = registry.spawnEntity(); + const fillComponent = new RectComponent(layer, { + x: barX, + y: barY, + width: 0, + height: WAVE_PROGRESS_BAR_SIZE.height, + fill: "#4CAF50", + cornerRadius: 3, + }); + registry.addComponent(fillEntity, fillComponent); + + const aliveTextEntity = registry.spawnEntity(); + const aliveTextComponent = new TextComponent(layer, { + text: "0 zombies", + x: barX + WAVE_PROGRESS_BAR_SIZE.width + WAVE_HUD_GAP, + y: WAVE_HUD_TOP_MARGIN, + width: ALIVE_TEXT_SIZE.width, + height: ALIVE_TEXT_SIZE.height, + fontSize: 18, + fontStyle: "bold", + verticalAlign: "middle", + fill: "#F5F2E9", + }); + registry.addComponent(aliveTextEntity, aliveTextComponent); + + // Centered under the progress bar, hidden except during the between-waves cooldown - + // handlers/wave-info.handler.ts owns both its text and visibility. + const countdownTextEntity = registry.spawnEntity(); + const countdownTextComponent = new TextComponent(layer, { + text: "", + x: barX, + y: barY + WAVE_PROGRESS_BAR_SIZE.height + WAVE_COUNTDOWN_GAP, + width: WAVE_PROGRESS_BAR_SIZE.width, + height: WAVE_COUNTDOWN_TEXT_SIZE.height, + align: "center", + fontSize: 14, + fontStyle: "bold", + fill: "#F5F2E9", + visible: false, + }); + registry.addComponent(countdownTextEntity, countdownTextComponent); + + const hudEntity = registry.spawnEntity(); + registry.addComponent( + hudEntity, + new WaveHudComponent( + waveTextComponent.text, + trackComponent.rect, + fillComponent.rect, + aliveTextComponent.text, + countdownTextComponent.text, + ), + ); +}; + +const buildMoneyHud = (layer: Layer, registry: Registry, amount: number) => { + const coinIcon = addCoinIcon( + layer, + MONEY_HUD_LEFT_MARGIN, + MONEY_HUD_TOP_MARGIN + (MONEY_TEXT_SIZE.height - COIN_ICON_RADIUS * 2) / 2, + COIN_ICON_RADIUS, + ); + + const moneyTextEntity = registry.spawnEntity(); + const moneyTextComponent = new TextComponent(layer, { + text: `${amount}`, + x: MONEY_HUD_LEFT_MARGIN + COIN_ICON_RADIUS * 2 + COIN_ICON_GAP, + y: MONEY_HUD_TOP_MARGIN, + width: MONEY_TEXT_SIZE.width, + height: MONEY_TEXT_SIZE.height, + fontSize: 18, + fontStyle: "bold", + verticalAlign: "middle", + fill: "#F5F2E9", + }); + registry.addComponent(moneyTextEntity, moneyTextComponent); + + const hudEntity = registry.spawnEntity(); + registry.addComponent( + hudEntity, + new MoneyHudComponent(moneyTextComponent.text, amount, coinIcon), + ); +}; + +const buildBuildMode = (worldLayer: Layer, hudLayer: Layer, registry: Registry) => { + // World-space, so it pans/scales with the camera and aligns to real tiles for free. + const gridShape = new Shape({ + stroke: GRID_STROKE, + strokeWidth: 1, + listening: false, + visible: false, + sceneFunc: (context, shape) => { + const layer = shape.getLayer(); + if (!layer) return; + const scale = layer.scaleX() || 1; + const pos = layer.position(); + + // Inverts cameraFollowSystem's own math to find which tile range is on screen - drawing the + // whole 100x100 map grid regardless of zoom/pan would be thousands of unnecessary lines. + const minX = -pos.x / scale; + const minY = -pos.y / scale; + const maxX = (layer.width() - pos.x) / scale; + const maxY = (layer.height() - pos.y) / scale; + + const startCol = Math.floor(minX / TILE_SIZE); + const endCol = Math.ceil(maxX / TILE_SIZE); + const startRow = Math.floor(minY / TILE_SIZE); + const endRow = Math.ceil(maxY / TILE_SIZE); + + context.beginPath(); + for (let col = startCol; col <= endCol; col++) { + const x = col * TILE_SIZE; + context.moveTo(x, minY); + context.lineTo(x, maxY); + } + for (let row = startRow; row <= endRow; row++) { + const y = row * TILE_SIZE; + context.moveTo(minX, y); + context.lineTo(maxX, y); + } + context.strokeShape(shape); + }, + }); + worldLayer.add(gridShape); + + const previewRect = new Rect({ + x: 0, + y: 0, + width: TILE_SIZE, + height: TILE_SIZE, + fill: "rgba(76, 175, 80, 0.55)", + visible: false, + listening: false, + }); + worldLayer.add(previewRect); + + // Shown only while the tower build-bar entry is selected, previewing its range before placement. + // Radius is set every tick by build-mode.system.ts. + const rangeCircle = new Circle({ + x: 0, + y: 0, + radius: 0, + stroke: "rgba(245, 242, 233, 0.6)", + strokeWidth: 1, + dash: [4, 4], + fill: "rgba(245, 242, 233, 0.08)", + visible: false, + listening: false, + }); + worldLayer.add(rangeCircle); + + // Every already-built tower's range, drawn by one Shape rather than a Circle per tower - a + // destroyed tower then needs no cleanup, it just stops being drawn. Distinct from `rangeCircle` + // above, which only previews one not-yet-placed tower. + // + // sceneFunc reads only this plain array, never the registry directly - Konva can call it from + // its own render loop, off build-mode.system.ts's tick, where registry.getZipper() isn't safe. + // build-mode.system.ts refills this same array by reference once per tick instead. + const towerRangeCenters: { x: number; y: number }[] = []; + const towerRangeCircles = new Shape({ + stroke: "rgba(245, 242, 233, 0.35)", + strokeWidth: 1, + dash: [4, 4], + listening: false, + visible: false, + sceneFunc: (context, shape) => { + context.beginPath(); + for (const { x: centerX, y: centerY } of towerRangeCenters) { + context.moveTo(centerX + TOWER_RANGE, centerY); + context.arc(centerX, centerY, TOWER_RANGE, 0, Math.PI * 2); + } + context.strokeShape(shape); + }, + }); + worldLayer.add(towerRangeCircles); + + const catalogEntries = Object.entries(BUILDING_CATALOG) as [ + BuildingType, + (typeof BUILDING_CATALOG)[BuildingType], + ][]; + // +1 slot for the "Destroy" button, appended after every catalog entry. + const buttonCount = catalogEntries.length + 1; + const totalWidth = buttonCount * BUILD_BUTTON_SIZE.width + (buttonCount - 1) * BUILD_BAR_GAP; + const barX = window.innerWidth / 2 - totalWidth / 2; + const barY = window.innerHeight - BUILD_BUTTON_SIZE.height - BUILD_BAR_BOTTOM_MARGIN; + + const destroyX = barX + catalogEntries.length * (BUILD_BUTTON_SIZE.width + BUILD_BAR_GAP); + const destroyRectComponent = new RectComponent(hudLayer, { + x: destroyX, + y: barY, + width: BUILD_BUTTON_SIZE.width, + height: BUILD_BUTTON_SIZE.height, + fill: "#521010", + stroke: "#8C5E5E", + strokeWidth: 2, + cornerRadius: 6, + visible: false, + }); + registry.addComponent(registry.spawnEntity(), destroyRectComponent); + const destroyTextComponent = new TextComponent(hudLayer, { + text: "Destroy\n(50% refund)", + x: destroyX, + y: barY, + width: BUILD_BUTTON_SIZE.width, + height: BUILD_BUTTON_SIZE.height, + align: "center", + verticalAlign: "middle", + fontSize: 13, + fontStyle: "bold", + fill: "#F5F2E9", + visible: false, + listening: false, + }); + registry.addComponent(registry.spawnEntity(), destroyTextComponent); + + // "-" / "+" zoom buttons, top-right corner. Clicks only move targetZoomLevel; build-mode.system.ts + // eases the live zoomLevel toward it every tick. + const zoomInX = window.innerWidth - ZOOM_BUTTON_MARGIN - ZOOM_BUTTON_SIZE.width; + const zoomOutX = zoomInX - ZOOM_BUTTON_GAP - ZOOM_BUTTON_SIZE.width; + const zoomY = ZOOM_BUTTON_MARGIN; + + const buildZoomButton = (x: number, label: string) => { + const rectComponent = new RectComponent(hudLayer, { + x, + y: zoomY, + width: ZOOM_BUTTON_SIZE.width, + height: ZOOM_BUTTON_SIZE.height, + fill: "#104522", + stroke: "#5E8C61", + strokeWidth: 2, + cornerRadius: 6, + visible: false, + }); + registry.addComponent(registry.spawnEntity(), rectComponent); + rectComponent.rect.on("mouseover", () => { + const stage = hudLayer.getStage(); + if (stage) stage.container().style.cursor = "pointer"; + }); + rectComponent.rect.on("mouseout", () => { + const stage = hudLayer.getStage(); + if (stage) stage.container().style.cursor = "default"; + }); + + const textComponent = new TextComponent(hudLayer, { + text: label, + x, + y: zoomY, + width: ZOOM_BUTTON_SIZE.width, + height: ZOOM_BUTTON_SIZE.height, + align: "center", + verticalAlign: "middle", + fontSize: 20, + fontStyle: "bold", + fill: "#F5F2E9", + visible: false, + listening: false, + }); + registry.addComponent(registry.spawnEntity(), textComponent); + + return { rect: rectComponent.rect, text: textComponent.text }; + }; + + const zoomInButton = buildZoomButton(zoomInX, "+"); + const zoomOutButton = buildZoomButton(zoomOutX, "-"); + + const buildMode = new BuildModeComponent( + gridShape, + previewRect, + rangeCircle, + [], + { + rect: destroyRectComponent.rect, + text: destroyTextComponent.text, + }, + { + x: barX, + y: barY, + width: totalWidth, + height: BUILD_BUTTON_SIZE.height, + }, + towerRangeCircles, + towerRangeCenters, + zoomInButton, + zoomOutButton, + { + x: Math.min(zoomInX, zoomOutX), + y: zoomY, + width: Math.max(zoomInX, zoomOutX) + ZOOM_BUTTON_SIZE.width - Math.min(zoomInX, zoomOutX), + height: ZOOM_BUTTON_SIZE.height, + }, + ); + registry.addComponent(registry.spawnEntity(), buildMode); + + // Only ever moves `targetZoomLevel` - build-mode.system.ts eases the LIVE `zoomLevel` toward it + // a little every tick rather than snapping straight there, so a click doesn't jump the camera. + zoomInButton.rect.on("click", () => { + buildMode.targetZoomLevel = Math.min(MAX_ZOOM, buildMode.targetZoomLevel + ZOOM_STEP); + }); + zoomOutButton.rect.on("click", () => { + buildMode.targetZoomLevel = Math.max(MIN_ZOOM, buildMode.targetZoomLevel - ZOOM_STEP); + }); + + destroyRectComponent.rect.on("click", () => { + // Click again to turn it off - same toggle-off-on-reclick idiom the building buttons use. + buildMode.destroyMode = !buildMode.destroyMode; + if (buildMode.destroyMode) buildMode.selectedBuildingType = null; + }); + destroyRectComponent.rect.on("mouseover", () => { + const stage = hudLayer.getStage(); + if (stage) stage.container().style.cursor = "pointer"; + }); + destroyRectComponent.rect.on("mouseout", () => { + const stage = hudLayer.getStage(); + if (stage) stage.container().style.cursor = "default"; + }); + + catalogEntries.forEach(([buildingType, entry], index) => { + const x = barX + index * (BUILD_BUTTON_SIZE.width + BUILD_BAR_GAP); + + const rectComponent = new RectComponent(hudLayer, { + x, + y: barY, + width: BUILD_BUTTON_SIZE.width, + height: BUILD_BUTTON_SIZE.height, + fill: "#104522", + stroke: "#5E8C61", + strokeWidth: 2, + cornerRadius: 6, + visible: false, + }); + registry.addComponent(registry.spawnEntity(), rectComponent); + + rectComponent.rect.on("click", () => { + // Click again to deselect. + buildMode.selectedBuildingType = + buildMode.selectedBuildingType === buildingType ? null : buildingType; + if (buildMode.selectedBuildingType) buildMode.destroyMode = false; + }); + rectComponent.rect.on("mouseover", () => { + const stage = hudLayer.getStage(); + if (stage) stage.container().style.cursor = "pointer"; + }); + rectComponent.rect.on("mouseout", () => { + const stage = hudLayer.getStage(); + // "default", not "none" - build mode wants the normal OS cursor, not the crosshair. + if (stage) stage.container().style.cursor = "default"; + }); + + const textComponent = new TextComponent(hudLayer, { + text: entry.label, + x, + y: barY + 8, + width: BUILD_BUTTON_SIZE.width, + height: BUILD_BUTTON_SIZE.height / 2, + align: "center", + verticalAlign: "middle", + fontSize: 14, + fill: "#F5F2E9", + visible: false, + listening: false, + }); + registry.addComponent(registry.spawnEntity(), textComponent); + + const costY = barY + BUILD_BUTTON_SIZE.height - COIN_ICON_RADIUS * 2 - 10; + const costDigits = String(entry.cost).length; + const costRowWidth = COIN_ICON_RADIUS * 2 + COIN_ICON_GAP + costDigits * 9; + const costX = x + (BUILD_BUTTON_SIZE.width - costRowWidth) / 2; + const coin = addCoinIcon(hudLayer, costX, costY, COIN_ICON_RADIUS); + coin.visible(false); + const costTextComponent = new TextComponent(hudLayer, { + text: `${entry.cost}`, + x: costX + COIN_ICON_RADIUS * 2 + COIN_ICON_GAP, + y: costY - 3, + width: costDigits * 12, + height: COIN_ICON_RADIUS * 2 + 6, + fontSize: 14, + fontStyle: "bold", + verticalAlign: "middle", + fill: "#F5F2E9", + visible: false, + listening: false, + }); + registry.addComponent(registry.spawnEntity(), costTextComponent); + + const button: BuildBarButton = { + buildingType, + rect: rectComponent.rect, + text: textComponent.text, + costText: costTextComponent.text, + costIcon: coin, + }; + buildMode.barButtons.push(button); + }); +}; + +// One column, one entry per catalog weapon, shown/hidden alongside the build bar. Clicking a +// weapon's top row buys it if unowned, refills ammo if already owned; the row underneath +// equips/unequips it - build-mode.system.ts owns the per-tick button state and click handling. +const buildWeaponShop = ( + hudLayer: Layer, + registry: Registry, + localPlayer: StartingPlayer | undefined, +) => { + const catalogEntries = Object.entries(WEAPON_CATALOG) as [ + WeaponType, + (typeof WEAPON_CATALOG)[WeaponType], + ][]; + const panelX = window.innerWidth - SHOP_ENTRY_WIDTH - SHOP_PANEL_RIGHT_MARGIN; + const totalHeight = + catalogEntries.length * SHOP_ENTRY_HEIGHT + (catalogEntries.length - 1) * SHOP_ENTRY_GAP; + + // One caption for the whole column rather than repeating it on every entry - SHOP_ENTRY_WIDTH is + // only 100px, too narrow for a per-entry hint alongside the price/ammo count. + const hintTextComponent = new TextComponent(hudLayer, { + text: "Click a weapon to buy it or refill its ammo", + x: panelX, + y: SHOP_TOP_MARGIN + totalHeight + SHOP_ENTRY_GAP, + width: SHOP_ENTRY_WIDTH, + align: "center", + fontSize: 10, + fontStyle: "italic", + fill: "#9CB89C", + visible: false, + listening: false, + }); + registry.addComponent(registry.spawnEntity(), hintTextComponent); + + const weaponShop = new WeaponShopComponent( + [], + { + x: panelX, + y: SHOP_TOP_MARGIN, + width: SHOP_ENTRY_WIDTH, + height: totalHeight, + }, + hintTextComponent.text, + ); + // Seeded from the local player's starting loadout - nothing broadcasts a weaponInventory/ammo + // packet at spawn, so without this the shop would show smallGun as unowned until first purchase. + if (localPlayer) { + weaponShop.equippedWeaponType = localPlayer.weaponType ?? null; + for (const w of localPlayer.weapons ?? []) { + weaponShop.owned.set(w.weaponType, { reserveAmmo: w.reserveAmmo }); + } + } + registry.addComponent(registry.spawnEntity(), weaponShop); + + catalogEntries.forEach(([weaponType, catalogEntry], index) => { + const entryY = SHOP_TOP_MARGIN + index * (SHOP_ENTRY_HEIGHT + SHOP_ENTRY_GAP); + + const buyRectComponent = new RectComponent(hudLayer, { + x: panelX, + y: entryY, + width: SHOP_ENTRY_WIDTH, + height: SHOP_BUY_HEIGHT, + fill: "#104522", + stroke: "#5E8C61", + strokeWidth: 2, + cornerRadius: 6, + visible: false, + }); + registry.addComponent(registry.spawnEntity(), buyRectComponent); + + const buyTextComponent = new TextComponent(hudLayer, { + text: catalogEntry.label, + x: panelX, + y: entryY + 4, + width: SHOP_ENTRY_WIDTH, + height: SHOP_BUY_HEIGHT - 24, + align: "center", + fontSize: 13, + fontStyle: "bold", + fill: "#F5F2E9", + visible: false, + listening: false, + }); + registry.addComponent(registry.spawnEntity(), buyTextComponent); + + // alwaysOwned weapons never show a cost row at all, not just a hidden/zeroed one. + const costY = entryY + SHOP_BUY_HEIGHT - COIN_ICON_RADIUS * 2 - 6; + const coinX = panelX + 14; + const costTextComponent = new TextComponent(hudLayer, { + text: "", + x: coinX + COIN_ICON_RADIUS * 2 + COIN_ICON_GAP, + y: costY - 3, + width: SHOP_ENTRY_WIDTH - (coinX - panelX) - COIN_ICON_RADIUS * 2 - COIN_ICON_GAP, + height: COIN_ICON_RADIUS * 2 + 6, + fontSize: 14, + fontStyle: "bold", + verticalAlign: "middle", + fill: "#F5F2E9", + visible: false, + listening: false, + }); + registry.addComponent(registry.spawnEntity(), costTextComponent); + + let costIcon: ReturnType | undefined; + if (!catalogEntry.alwaysOwned) { + costIcon = addCoinIcon(hudLayer, coinX, costY, COIN_ICON_RADIUS); + costIcon.visible(false); + + buyRectComponent.rect.on("click", () => { + weaponShop.pendingBuyType = weaponType; + }); + buyRectComponent.rect.on("mouseover", () => { + const stage = hudLayer.getStage(); + if (stage) stage.container().style.cursor = "pointer"; + }); + buyRectComponent.rect.on("mouseout", () => { + const stage = hudLayer.getStage(); + if (stage) stage.container().style.cursor = "default"; + }); + } + + // Toggles this weapon equipped/unequipped when owned; label flips between + // "Select"/"Selected"/"Buy" - build-mode.system.ts owns that per tick. + const selectButtonComponent = new RectComponent(hudLayer, { + x: panelX, + y: entryY + SHOP_BUY_HEIGHT + SHOP_SELECT_BUTTON_GAP, + width: SHOP_ENTRY_WIDTH, + height: SHOP_SELECT_BUTTON_HEIGHT, + fill: "#104522", + stroke: "#5E8C61", + strokeWidth: 2, + cornerRadius: 4, + visible: false, + }); + registry.addComponent(registry.spawnEntity(), selectButtonComponent); + const selectLabelComponent = new TextComponent(hudLayer, { + text: "Select", + x: panelX, + y: entryY + SHOP_BUY_HEIGHT + SHOP_SELECT_BUTTON_GAP, + width: SHOP_ENTRY_WIDTH, + height: SHOP_SELECT_BUTTON_HEIGHT, + align: "center", + verticalAlign: "middle", + fontSize: 12, + fill: "#F5F2E9", + visible: false, + listening: false, + }); + registry.addComponent(registry.spawnEntity(), selectLabelComponent); + selectButtonComponent.rect.on("click", () => { + // Not owned yet - this button reads "Buy" (build-mode.system.ts), so clicking it should buy + // the weapon, not fire off an equip request the server can only reject ("not owned"). + if (!weaponShop.owned.has(weaponType)) { + weaponShop.pendingBuyType = weaponType; + return; + } + weaponShop.pendingEquip = { + weaponType: weaponShop.equippedWeaponType === weaponType ? null : weaponType, + }; + }); + selectButtonComponent.rect.on("mouseover", () => { + const stage = hudLayer.getStage(); + if (stage) stage.container().style.cursor = "pointer"; + }); + selectButtonComponent.rect.on("mouseout", () => { + const stage = hudLayer.getStage(); + if (stage) stage.container().style.cursor = "default"; + }); + + weaponShop.entries.push({ + weaponType, + buyRect: buyRectComponent.rect, + buyText: buyTextComponent.text, + costText: costTextComponent.text, + costIcon, + selectButton: selectButtonComponent.rect, + selectLabel: selectLabelComponent.text, + }); + }); +}; + +/** + * Builds a game from its `startGame` message: the layers, the map, the lobby, the players and the + * HUD. + */ +export const buildWorld = ( + registry: Registry, + ctx: Context, + packet: ServerMessageOf<"startGame">, +): void => { + const view = new GameView(); + view.world.scale({ x: view.worldScale, y: view.worldScale }); + const stage = ctx.graphics.stage; + stage.add(view.world); + stage.add(view.hud); + // The crosshair of cursor.system.ts replaces the OS cursor; GameView.destroy() restores it. + stage.container().style.cursor = "none"; + stage.container().oncontextmenu = (event) => event.preventDefault(); + registry.addComponent(registry.spawnEntity(), view); + + const map = registry.spawnEntity(); + registry.addComponent(map, new TransformComponent(0, 0)); + registry.addComponent(map, new SpriteComponent("map.png", { layer: view.world })); + + buildLobby(view.world, packet.lobby, registry); + + const playerId = ctx.scenes.vars.get("playerId"); + packet.players.forEach((player) => { + buildPlayer(view.world, player, registry, playerId); + }); + + buildWaveHud(view.hud, registry); + buildMoneyHud(view.hud, registry, packet.money); + buildBuildMode(view.world, view.hud, registry); + + const localPlayer = packet.players.find((player) => player.id === playerId); + buildWeaponShop(view.hud, registry, localPlayer); + + if (localPlayer) { + // Reserve comes from the shared per-type record; magazine is on the equipped weapon's own + // state and arrives as its own field instead of living inside the weapons[] entry. + const findAmmo = (weaponType: WeaponType | null, magazineAmmo: number) => { + if (!weaponType) return undefined; + const reserveAmmo = + localPlayer.weapons.find((w) => w.weaponType === weaponType)?.reserveAmmo ?? 0; + return { magazineAmmo, reserveAmmo }; + }; + buildAmmoHud( + view.hud, + registry, + localPlayer.weaponType, + findAmmo(localPlayer.weaponType, localPlayer.magazineAmmo), + ); + } + + buildCursor(view.hud, registry); +}; diff --git a/games/raid-survival/apps/client/src/components/ammo-hud.component.ts b/games/raid-survival/apps/client/src/components/ammo-hud.component.ts new file mode 100644 index 0000000..f7b8eee --- /dev/null +++ b/games/raid-survival/apps/client/src/components/ammo-hud.component.ts @@ -0,0 +1,21 @@ +import { Text } from "@nanoforge-dev/graphics-2d"; + +import { SpriteComponent } from "./sprite.component"; + +/** + * `icon` is the weapon-icon SpriteComponent (not just its Konva node) so reload-indicator.system.ts + * can toggle this row's visibility based on whether anything is equipped. + * + * @component + * @side client + */ +export class AmmoHudComponent { + name = "AmmoHudComponent"; + + constructor( + /** The "magazine / reserve" text. */ + public text: Text, + /** The sprite of the equipped weapon. */ + public icon: SpriteComponent, + ) {} +} diff --git a/games/raid-survival/apps/client/src/components/build-mode.component.ts b/games/raid-survival/apps/client/src/components/build-mode.component.ts new file mode 100644 index 0000000..9ee2fc5 --- /dev/null +++ b/games/raid-survival/apps/client/src/components/build-mode.component.ts @@ -0,0 +1,82 @@ +import { Circle, Rect, Shape, Text } from "@nanoforge-dev/graphics-2d"; +import { type BuildingType } from "@raid-survival/shared/building-catalog"; + +export interface BuildBarButton { + buildingType: BuildingType; + rect: Rect; + text: Text; + costText: Text; + costIcon: Circle; +} + +// Mutually exclusive with selecting a BuildingType to place - see build-mode.system.ts. +export interface DestroyButton { + rect: Rect; + text: Text; +} + +export interface ZoomButton { + rect: Rect; + text: Text; +} + +// Screen-space (hudLayer-local) bounds used to guard against a UI click also registering as a +// world-space placement/destroy click on whatever tile is behind it. +export interface ScreenBox { + x: number; + y: number; + width: number; + height: number; +} + +/** + * The build mode of the local player: the grid, the placement preview, the build bar, the destroy + * button and the zoom buttons, all Konva nodes made by `buildWorld`. Driven by `buildModeSystem`. + * + * @component + * @side client + */ +export class BuildModeComponent { + name = "BuildModeComponent"; + + active: boolean = false; + selectedBuildingType: BuildingType | null = null; + destroyMode: boolean = false; + // Edge-detection for level-triggered inputs (isKeyPressed reports "held", not "just pressed"). + wasTogglePressed: boolean = false; + wasPlaceClickPressed: boolean = false; + + constructor( + /** The tile grid drawn over the map. */ + public gridShape: Shape, + /** The placement preview under the cursor. */ + public previewRect: Rect, + /** The range of the tower being placed. */ + public rangeCircle: Circle, + /** The buttons of the build bar, one per building. */ + public barButtons: BuildBarButton[], + /** The button of the destroy mode. */ + public destroyButton: DestroyButton, + /** Screen box of the build bar, where a click is not a placement. */ + public barBounds: ScreenBox, + // One Shape draws every built tower's range circle at once, reading `towerRangeCenters` in + // its sceneFunc - avoids per-tower cleanup on destroy. + /** Draws the range of every built tower. */ + public towerRangeCircles: Shape, + // Same array instance towerRangeCircles' sceneFunc closure reads; build-mode.system.ts + // refills it each tick. Konva can invoke sceneFunc off-tick during its own render loop, so + // this must stay a plain array read, not a live registry query. + /** Centers of the built towers, read by `towerRangeCircles`. */ + public towerRangeCenters: { x: number; y: number }[], + /** The zoom in button. */ + public zoomInButton: ZoomButton, + /** The zoom out button. */ + public zoomOutButton: ZoomButton, + /** Screen box of the zoom buttons. */ + public zoomBounds: ScreenBox, + /** Zoom applied now: eases toward `targetZoomLevel` each tick, so the camera doesn't jump. */ + public zoomLevel: number = 1, + /** Zoom asked by the zoom buttons. */ + public targetZoomLevel: number = 1, + ) {} +} diff --git a/games/raid-survival/apps/client/src/components/building-interact-indicator.component.ts b/games/raid-survival/apps/client/src/components/building-interact-indicator.component.ts new file mode 100644 index 0000000..b16c262 --- /dev/null +++ b/games/raid-survival/apps/client/src/components/building-interact-indicator.component.ts @@ -0,0 +1,17 @@ +import { Text } from "@nanoforge-dev/graphics-2d"; + +/** + * "Press E to..." hint shown above an interactable building's health bar. The proximity check is + * approximated client-side since Hitbox is server-only - see building-interact-indicator.system.ts. + * + * @component + * @side client + */ +export class BuildingInteractIndicatorComponent { + name = "BuildingInteractIndicatorComponent"; + + constructor( + /** The hint shown next to a building the player can heal or upgrade. */ + public text: Text, + ) {} +} diff --git a/games/raid-survival/apps/client/src/components/building.component.ts b/games/raid-survival/apps/client/src/components/building.component.ts new file mode 100644 index 0000000..41a551f --- /dev/null +++ b/games/raid-survival/apps/client/src/components/building.component.ts @@ -0,0 +1,17 @@ +import { type BuildingType } from "@raid-survival/shared/building-catalog"; + +/** + * Marker + which catalog entry - used by build-mode's occupancy preview to know where existing + * buildings already are. + * + * @component + * @side client + */ +export class Building { + name = "Building"; + + constructor( + /** The kind of building. */ + public buildingType: BuildingType, + ) {} +} diff --git a/games/raid-survival/apps/client/src/components/children.component.ts b/games/raid-survival/apps/client/src/components/children.component.ts new file mode 100644 index 0000000..74fb5a7 --- /dev/null +++ b/games/raid-survival/apps/client/src/components/children.component.ts @@ -0,0 +1,27 @@ +import type { Vector } from "@raid-survival/shared/protocol"; + +export interface ChildrenOptions { + LocalTransform?: Vector; +} + +/** + * Makes an entity follow another one (`parentId`), at an offset, with `transformChildrenToParentSystem`. + * + * @component + * @side client + */ +export class ChildrenComponent { + name = "ChildrenComponent"; + parentId: number; + options: ChildrenOptions; + + constructor( + /** Entity id of the entity to follow. */ + parentId: number, + /** The offset, and what of the parent to follow. */ + options: ChildrenOptions, + ) { + this.parentId = parentId; + this.options = options; + } +} diff --git a/games/raid-survival/apps/client/src/components/cursor.component.ts b/games/raid-survival/apps/client/src/components/cursor.component.ts new file mode 100644 index 0000000..1bbb069 --- /dev/null +++ b/games/raid-survival/apps/client/src/components/cursor.component.ts @@ -0,0 +1,9 @@ +/** + * Marker on the custom crosshair HUD sprite entity - lets cursor.system.ts find it. + * + * @component + * @side client + */ +export class CursorComponent { + name = "CursorComponent"; +} diff --git a/games/raid-survival/apps/client/src/components/direction-rotator.component.ts b/games/raid-survival/apps/client/src/components/direction-rotator.component.ts new file mode 100644 index 0000000..4e261cd --- /dev/null +++ b/games/raid-survival/apps/client/src/components/direction-rotator.component.ts @@ -0,0 +1,27 @@ +/** + * Rotates the sprite of an entity toward its `Direction`, with `rotateToDirectionSystem`. + * + * @component + * @side client + */ +export class DirectionRotatorComponent { + name = "DirectionRotatorComponent"; + enable: boolean = true; + offset: number; + // A sprite that rotates through the full circle reads upside-down for half its arc unless + // mirrored vertically while aiming left - see rotate-to-direction.system.ts. + mirrorWhenFacingLeft: boolean; + + constructor( + /** Angle added to the direction, in degrees. */ + offset: number = 0, + /** Whether the sprite rotates. */ + enable: boolean = true, + /** Flips the sprite vertically while it aims left. */ + mirrorWhenFacingLeft: boolean = false, + ) { + this.offset = offset; + this.enable = enable; + this.mirrorWhenFacingLeft = mirrorWhenFacingLeft; + } +} diff --git a/games/raid-survival/apps/client/src/components/direction.component.ts b/games/raid-survival/apps/client/src/components/direction.component.ts new file mode 100644 index 0000000..ce7c98c --- /dev/null +++ b/games/raid-survival/apps/client/src/components/direction.component.ts @@ -0,0 +1,16 @@ +/** + * Where an entity aims, as a vector, from the server or the mouse. + * + * @component + * @side client + */ +export class Direction { + name = "Direction"; + + constructor( + /** Horizontal part of the direction. */ + public x: number, + /** Vertical part of the direction. */ + public y: number, + ) {} +} diff --git a/games/raid-survival/apps/client/src/components/draw-order-2d.component.ts b/games/raid-survival/apps/client/src/components/draw-order-2d.component.ts new file mode 100644 index 0000000..a08cac6 --- /dev/null +++ b/games/raid-survival/apps/client/src/components/draw-order-2d.component.ts @@ -0,0 +1,23 @@ +/** + * Where an entity's drawable is in the stack: a higher `z` is drawn over a lower one. A system + * applies it: `drawOrder2D` for the `Drawable*2D` shapes, or the game's own. + * + * @remarks + * Without such a system, a shape is drawn over the shapes that appeared before it, and a scene + * loaded again can stack its shapes in another order. + * + * @component + * @side client + * @group Order color=#b18cff - Drawing order. + */ +export class DrawOrder2D { + name = "DrawOrder2D"; + + /** The `z` the shape was last stacked at, set by `drawOrder2D`. */ + stackedZ?: number; + + constructor( + /** Higher is drawn over lower; entities without it are under every one with it. @group Order */ + public z = 0, + ) {} +} diff --git a/games/raid-survival/apps/client/src/components/floating-text.component.ts b/games/raid-survival/apps/client/src/components/floating-text.component.ts new file mode 100644 index 0000000..a71b83c --- /dev/null +++ b/games/raid-survival/apps/client/src/components/floating-text.component.ts @@ -0,0 +1,17 @@ +/** + * Marks a free-standing (no ChildrenComponent) Text entity that rises/fades over `duration` + * seconds - not swept by a server "kill" packet's child cascade, purely client-local/ephemeral. + * + * @component + * @side client + */ +export class FloatingTextComponent { + name = "FloatingTextComponent"; + + constructor( + /** Seconds before the text is removed. */ + public duration: number, + ) {} + + elapsed: number = 0; +} diff --git a/games/raid-survival/apps/client/src/components/game-view.component.ts b/games/raid-survival/apps/client/src/components/game-view.component.ts new file mode 100644 index 0000000..9537c82 --- /dev/null +++ b/games/raid-survival/apps/client/src/components/game-view.component.ts @@ -0,0 +1,30 @@ +import { Layer } from "@nanoforge-dev/graphics-2d"; + +/** + * The layers a game is drawn on: `world`, scaled and moved by the camera, and `hud`, fixed on + * screen. `buildWorld` puts them on the stage; `destroy()` removes them, and gives the OS + * cursor back, when the game scene is unloaded. + * + * @component + * @side client + */ +export class GameView { + name = "GameView"; + + /** The map, the players, the zombies and the buildings. */ + readonly world = new Layer({ imageSmoothingEnabled: false }); + /** The screen-space interface: wave, money, ammo, shop, build bar and crosshair. */ + readonly hud = new Layer(); + + constructor( + /** Pixels on screen per world pixel, before the build mode's zoom. */ + public worldScale = 3, + ) {} + + destroy(): void { + const container = this.world.getStage()?.container(); + if (container) container.style.cursor = "default"; + this.world.destroy(); + this.hud.destroy(); + } +} diff --git a/games/raid-survival/apps/client/src/components/group.component.ts b/games/raid-survival/apps/client/src/components/group.component.ts new file mode 100644 index 0000000..1c77d45 --- /dev/null +++ b/games/raid-survival/apps/client/src/components/group.component.ts @@ -0,0 +1,22 @@ +import { GroupConfig, Group, Container } from "@nanoforge-dev/graphics-2d"; + +/** + * A Konva group added to a parent node, to lay out and move a widget as one. + * + * @component + * @side client + */ +export class GroupComponent { + name = "GroupComponent"; + group: Group; + + constructor( + /** The node the group is added to. */ + parent: Container, + /** Konva options of the group. */ + options: GroupConfig, + ) { + this.group = new Group(options); + parent.add(this.group); + } +} diff --git a/games/raid-survival/apps/client/src/components/health-bar-fill.component.ts b/games/raid-survival/apps/client/src/components/health-bar-fill.component.ts new file mode 100644 index 0000000..72dbb4d --- /dev/null +++ b/games/raid-survival/apps/client/src/components/health-bar-fill.component.ts @@ -0,0 +1,16 @@ +/** + * The fill of a health bar, scaled to the health of the entity it follows (`updateHealthBar`). + * + * @component + * @side client + */ +export class HealthBarFill { + name = "HealthBarFill"; + + // Fill's cavity-left-edge X in parent-local space - constant per instance, used to recompute + // LocalTransform.x on a health change. + constructor( + /** Left edge of the bar's cavity, in the bar's local space. */ + public cavityLocalX: number, + ) {} +} diff --git a/games/raid-survival/apps/client/src/components/health.component.ts b/games/raid-survival/apps/client/src/components/health.component.ts new file mode 100644 index 0000000..29ba464 --- /dev/null +++ b/games/raid-survival/apps/client/src/components/health.component.ts @@ -0,0 +1,16 @@ +/** + * Health of an entity, as the server sent it. + * + * @component + * @side client + */ +export class Health { + name = "Health"; + + constructor( + /** Health left. */ + public current: number, + /** Health at full. */ + public max: number, + ) {} +} diff --git a/games/raid-survival/apps/client/src/components/lobby-status.component.ts b/games/raid-survival/apps/client/src/components/lobby-status.component.ts new file mode 100644 index 0000000..060adba --- /dev/null +++ b/games/raid-survival/apps/client/src/components/lobby-status.component.ts @@ -0,0 +1,36 @@ +export interface LobbyPlayer { + id: number; + username: string; + skin: number; +} + +export enum LobbyState { + UNJOINED, + LOADING, + JOINED, +} + +export enum LobbyAction { + EMPTY, + JOIN_LOBBY, + START_GAME, +} + +/** + * What the menu knows of the lobby: the username and skin entered, whether it joined, the + * players in it, the last error, and the action to send (`lobbyActionSenders`). + * + * @component + * @side client + */ +export class LobbyStatusComponent { + name = "LobbyStatusComponent"; + username = ""; + // Chosen character skin (player1.png..player3.png) - sent with the join request. + skin: number = 1; + state: LobbyState = LobbyState.UNJOINED; + action: LobbyAction = LobbyAction.EMPTY; + players: LobbyPlayer[] = []; + // Set on a rejected join, rendered by MenuView, cleared on the next successful join. + error: string | null = null; +} diff --git a/games/raid-survival/apps/client/src/components/lobby.component.ts b/games/raid-survival/apps/client/src/components/lobby.component.ts new file mode 100644 index 0000000..5320ed2 --- /dev/null +++ b/games/raid-survival/apps/client/src/components/lobby.component.ts @@ -0,0 +1,9 @@ +/** + * Marks the lobby, the building the players defend. + * + * @component + * @side client + */ +export class Lobby { + name = "Lobby"; +} diff --git a/games/raid-survival/apps/client/src/components/money-hud.component.ts b/games/raid-survival/apps/client/src/components/money-hud.component.ts new file mode 100644 index 0000000..2ddefbc --- /dev/null +++ b/games/raid-survival/apps/client/src/components/money-hud.component.ts @@ -0,0 +1,22 @@ +import { Text, Circle } from "@nanoforge-dev/graphics-2d"; + +/** + * `amount` is tracked as a plain number (not just baked into the display text) so other systems + * (build-mode's affordability checks) can read the balance directly. `coinIcon` is a raw Konva + * node with no SpriteComponent, so zOrderSystem never manages it - needs its own moveToTop(). + * + * @component + * @side client + */ +export class MoneyHudComponent { + name = "MoneyHudComponent"; + + constructor( + /** The amount text. */ + public text: Text, + /** Coins of the team. */ + public amount: number, + /** The coin drawn before the amount. */ + public coinIcon: Circle, + ) {} +} diff --git a/games/raid-survival/apps/client/src/components/move-controller.component.ts b/games/raid-survival/apps/client/src/components/move-controller.component.ts new file mode 100644 index 0000000..b900ad6 --- /dev/null +++ b/games/raid-survival/apps/client/src/components/move-controller.component.ts @@ -0,0 +1,40 @@ +import { InputEnum } from "@nanoforge-dev/input"; + +/** + * Moves the local player with the keyboard: `moveControl` reads the keys, `sendMoveControl` sends + * them to the server when they change. + * + * @component + * @side client + */ +export class MoveController { + name = "MoveController"; + public keyUp: InputEnum; + public keyDown: InputEnum; + public keyLeft: InputEnum; + public keyRight: InputEnum; + public movingUp: boolean = false; + public movingDown: boolean = false; + public movingLeft: boolean = false; + public movingRight: boolean = false; + public lastMoveKeys: string[] = []; + + constructor( + /** The keys that move up, left, down and right. */ + clientConfig: { + keybinds: { up: InputEnum; left: InputEnum; down: InputEnum; right: InputEnum }; + } = { + keybinds: { + up: InputEnum.KeyW, + left: InputEnum.KeyA, + down: InputEnum.KeyS, + right: InputEnum.KeyD, + }, + }, + ) { + this.keyUp = clientConfig.keybinds.up; + this.keyDown = clientConfig.keybinds.down; + this.keyLeft = clientConfig.keybinds.left; + this.keyRight = clientConfig.keybinds.right; + } +} diff --git a/games/raid-survival/apps/client/src/components/network-id.component.ts b/games/raid-survival/apps/client/src/components/network-id.component.ts new file mode 100644 index 0000000..084289d --- /dev/null +++ b/games/raid-survival/apps/client/src/components/network-id.component.ts @@ -0,0 +1,20 @@ +/** + * The id of an entity on the network: the server and the clients know the entity by it, and the + * messages about the entity carry it. + * + * @component + * @side shared + */ +export class NetworkId { + name = "NetworkId"; + + /** The velocity last sent to the clients (by pong's `syncMoves`). NaN: to send again. */ + sentX = Number.NaN; + /** See `sentX`. */ + sentY = Number.NaN; + + constructor( + /** Same on the server and the clients. */ + public id = 0, + ) {} +} diff --git a/games/raid-survival/apps/client/src/components/player.component.ts b/games/raid-survival/apps/client/src/components/player.component.ts new file mode 100644 index 0000000..7861d76 --- /dev/null +++ b/games/raid-survival/apps/client/src/components/player.component.ts @@ -0,0 +1,9 @@ +/** + * Marker identifying a player entity (e.g. for player-death.system.ts). + * + * @component + * @side client + */ +export class Player { + name = "Player"; +} diff --git a/games/raid-survival/apps/client/src/components/rect.component.ts b/games/raid-survival/apps/client/src/components/rect.component.ts new file mode 100644 index 0000000..9a1be6c --- /dev/null +++ b/games/raid-survival/apps/client/src/components/rect.component.ts @@ -0,0 +1,22 @@ +import { Container, Rect, RectConfig } from "@nanoforge-dev/graphics-2d"; + +/** + * A Konva rectangle added to a parent node. + * + * @component + * @side client + */ +export class RectComponent { + name = "RectComponent"; + rect: Rect; + + constructor( + /** The node the rectangle is added to. */ + parent: Container, + /** Konva options of the rectangle. */ + options: RectConfig, + ) { + this.rect = new Rect(options); + parent.add(this.rect); + } +} diff --git a/games/raid-survival/apps/client/src/components/reload-indicator.component.ts b/games/raid-survival/apps/client/src/components/reload-indicator.component.ts new file mode 100644 index 0000000..777cb78 --- /dev/null +++ b/games/raid-survival/apps/client/src/components/reload-indicator.component.ts @@ -0,0 +1,17 @@ +import { Text } from "@nanoforge-dev/graphics-2d"; + +/** + * World-space "Reloading..." label above a player's health bar. Positioned every tick by + * reload-indicator.system.ts since Text isn't a Sprite - spriteSystem never touches it. + * + * @component + * @side client + */ +export class ReloadIndicatorComponent { + name = "ReloadIndicatorComponent"; + + constructor( + /** The "Reloading" text above the player. */ + public text: Text, + ) {} +} diff --git a/games/raid-survival/apps/client/src/components/revive-controller.component.ts b/games/raid-survival/apps/client/src/components/revive-controller.component.ts new file mode 100644 index 0000000..905715c --- /dev/null +++ b/games/raid-survival/apps/client/src/components/revive-controller.component.ts @@ -0,0 +1,22 @@ +import { InputEnum } from "@nanoforge-dev/input"; + +/** + * Local-player-only controller for the hold-E revive channel. `held` is a plain level-triggered + * hold; range/timing is server-authoritative (see revive.system.ts). + * + * @component + * @side client + */ +export class ReviveController { + name = "ReviveController"; + + keyRevive: InputEnum = InputEnum.KeyE; + held: boolean = false; + lastSentHeld: boolean = false; + + // Edge-detected companion for the same key's other action - an instant heal/upgrade on a + // nearby building (building-interact.system.ts, server). `wasHeld` detects the rising edge; + // `interactRequested` is the one-shot request, cleared once sent. + wasHeld: boolean = false; + interactRequested: boolean = false; +} diff --git a/games/raid-survival/apps/client/src/components/revive-hint-indicator.component.ts b/games/raid-survival/apps/client/src/components/revive-hint-indicator.component.ts new file mode 100644 index 0000000..8325a4b --- /dev/null +++ b/games/raid-survival/apps/client/src/components/revive-hint-indicator.component.ts @@ -0,0 +1,17 @@ +import { Text } from "@nanoforge-dev/graphics-2d"; + +/** + * "Hold E to revive" hint shown above a downed player, visible only to the local player when + * close enough - revive-hint-indicator.system.ts owns the (client-side-approximated) range check. + * + * @component + * @side client + */ +export class ReviveHintIndicatorComponent { + name = "ReviveHintIndicatorComponent"; + + constructor( + /** The "Hold E to revive" text above a downed teammate. */ + public text: Text, + ) {} +} diff --git a/games/raid-survival/apps/client/src/components/revive-indicator.component.ts b/games/raid-survival/apps/client/src/components/revive-indicator.component.ts new file mode 100644 index 0000000..84c02e2 --- /dev/null +++ b/games/raid-survival/apps/client/src/components/revive-indicator.component.ts @@ -0,0 +1,24 @@ +import { Arc, Ring } from "@nanoforge-dev/graphics-2d"; + +/** + * Grey->green "hold E to revive" progress circle above a downed player, visible to everyone + * nearby. `background` is the static grey Ring; `fill` is the green Arc whose angle grows 0-360 + * as progress advances. Driven by revive.system.ts's server events via handlers/revive.handler.ts. + * + * @component + * @side client + */ +export class ReviveIndicatorComponent { + name = "ReviveIndicatorComponent"; + + constructor( + /** The ring behind the progress. */ + public background: Ring, + /** The arc of the revive progress. */ + public fill: Arc, + ) {} + + active: boolean = false; + elapsed: number = 0; + durationSeconds: number = 0; +} diff --git a/games/raid-survival/apps/client/src/components/screen.component.ts b/games/raid-survival/apps/client/src/components/screen.component.ts new file mode 100644 index 0000000..53395df --- /dev/null +++ b/games/raid-survival/apps/client/src/components/screen.component.ts @@ -0,0 +1,21 @@ +import type { ScreenView } from "../views/screen-view"; + +/** + * The screen a menu scene shows. Spawned by the scene's system on its first tick, which then + * ticks it; `destroy()` unloads it when the scene is unloaded. + * + * @component + * @side client + */ +export class Screen { + name = "Screen"; + + constructor( + /** The screen, built on the first tick. */ + public view: ScreenView, + ) {} + + destroy(): void { + this.view.unload(); + } +} diff --git a/games/raid-survival/apps/client/src/components/shoot-controller.component.ts b/games/raid-survival/apps/client/src/components/shoot-controller.component.ts new file mode 100644 index 0000000..5b348d1 --- /dev/null +++ b/games/raid-survival/apps/client/src/components/shoot-controller.component.ts @@ -0,0 +1,42 @@ +import { InputEnum } from "@nanoforge-dev/input"; +import type { Vector } from "@raid-survival/shared/protocol"; + +/** + * Aims and fires the weapon of the local player: `shootControl` reads the mouse and the keys, + * `sendShootControl` sends them. + * + * @component + * @side client + */ +export class ShootController { + name = "ShootController"; + public position: Vector = { x: 0, y: 0 }; + + public aimingMode: "mouse" | "arrows" | "joystick"; + public keyShoot: InputEnum; + public shooting: boolean = false; + // Last value sent to the server - lets sendShootControl only send on change. + public lastSentShooting: boolean = false; + // Edge-detected "R" state (isKeyPressed is level/held, not "just pressed"). + public wasReloadKeyPressed: boolean = false; + // One-shot - set true on a fresh R press, sent once by sendShootControl then cleared. + public reloadRequested: boolean = false; + + constructor( + /** How the player aims, and the button that shoots. */ + clientConfig: { + keybinds: { + aimingMode: "mouse" | "arrows" | "joystick"; + shoot: InputEnum; + }; + } = { + keybinds: { + aimingMode: "mouse", + shoot: InputEnum.MouseLeft, + }, + }, + ) { + this.aimingMode = clientConfig.keybinds.aimingMode; + this.keyShoot = clientConfig.keybinds.shoot; + } +} diff --git a/raid-survival/client/components/renderable/sprite.component.ts b/games/raid-survival/apps/client/src/components/sprite.component.ts similarity index 81% rename from raid-survival/client/components/renderable/sprite.component.ts rename to games/raid-survival/apps/client/src/components/sprite.component.ts index 7498a75..8268a93 100644 --- a/raid-survival/client/components/renderable/sprite.component.ts +++ b/games/raid-survival/apps/client/src/components/sprite.component.ts @@ -1,19 +1,27 @@ -import { Layer, Sprite, Vector2d } from "@nanoforge-dev/graphics-2d"; +import { Layer, Sprite } from "@nanoforge-dev/graphics-2d"; +import type { Vector } from "@raid-survival/shared/protocol"; interface SpriteComponentOptions { animationsKey?: string; layer?: Layer; - scale?: Vector2d; + scale?: Vector; currentAnimation?: string; frameRate?: number; // Native-pixel point within the frame that rotation pivots around and that TransformComponent's // position resolves to (see sprite.system.ts). Defaults to the frame's geometric center; needed // when the art's actual grip/anchor point isn't centered in its crop. - pivot?: Vector2d; + pivot?: Vector; } +/** + * An animated sprite from an image of the assets and its animations file, drawn by `spriteSystem` + * on its layer and animated by `spriteAnimator`. + * + * @component + * @side client + */ export class SpriteComponent { - name = this.constructor.name; + name = "SpriteComponent"; spriteKey: string; sprite: Sprite | undefined; animationsKey?: string | undefined; @@ -26,13 +34,18 @@ export class SpriteComponent { // next setSpriteKey-triggered rebuild, not on an already-live sprite. frameRate: number = 7; - private _scale: Vector2d = { x: 1, y: 1 }; + private _scale: Vector = { x: 1, y: 1 }; private _currentAnimation: string = "idle"; private _flipped: boolean = false; private _flippedY: boolean = false; - private _pivot: Vector2d | undefined; - - constructor(spriteKey: string, options?: SpriteComponentOptions) { + private _pivot: Vector | undefined; + + constructor( + /** Path of the image in the assets. */ + spriteKey: string, + /** The animations file, the layer, the scale, the pivot and the first animation. */ + options?: SpriteComponentOptions, + ) { this.spriteKey = spriteKey; if (options?.animationsKey) this.animationsKey = options.animationsKey; if (options?.scale) this._scale = options.scale; @@ -68,22 +81,22 @@ export class SpriteComponent { this.sprite?.animation(animation); } - getScale(): Vector2d { + getScale(): Vector { return this._scale; } - setScale(scale: Vector2d) { + setScale(scale: Vector) { this._scale = scale; this.sprite?.scale(scale); } - getPivot(): Vector2d | undefined { + getPivot(): Vector | undefined { return this._pivot; } // Like frameRate, read by spriteSystem only at construction time - takes effect on the next // setSpriteKey-triggered rebuild, not the live sprite. - setPivot(pivot: Vector2d | undefined) { + setPivot(pivot: Vector | undefined) { this._pivot = pivot; } @@ -117,6 +130,3 @@ export class SpriteComponent { this.sprite?.scaleY(this._scale.y); } } - -// * Required to generate code -export default SpriteComponent.name; \ No newline at end of file diff --git a/games/raid-survival/apps/client/src/components/text.component.ts b/games/raid-survival/apps/client/src/components/text.component.ts new file mode 100644 index 0000000..160676a --- /dev/null +++ b/games/raid-survival/apps/client/src/components/text.component.ts @@ -0,0 +1,22 @@ +import { Container, Text, TextConfig } from "@nanoforge-dev/graphics-2d"; + +/** + * A Konva text added to a parent node. + * + * @component + * @side client + */ +export class TextComponent { + name = "TextComponent"; + text: Text; + + constructor( + /** The node the text is added to. */ + parent: Container, + /** Konva options of the text. */ + options: TextConfig, + ) { + this.text = new Text(options); + parent.add(this.text); + } +} diff --git a/raid-survival/client/components/renderable/textarea.component.ts b/games/raid-survival/apps/client/src/components/textarea.component.ts similarity index 90% rename from raid-survival/client/components/renderable/textarea.component.ts rename to games/raid-survival/apps/client/src/components/textarea.component.ts index 37f1dd4..c843b72 100644 --- a/raid-survival/client/components/renderable/textarea.component.ts +++ b/games/raid-survival/apps/client/src/components/textarea.component.ts @@ -8,15 +8,26 @@ import { TextConfig, } from "@nanoforge-dev/graphics-2d"; +/** + * A text field: a DOM textarea laid over a Konva text, clipped to its group, for the username. + * + * @component + * @side client + */ export class TextAreaComponent { - name = this.constructor.name; + name = "TextAreaComponent"; text: Text; wrapper: HTMLDivElement; textarea: HTMLTextAreaElement; value: string = ""; private readonly clipAncestor: Group | Layer | Stage | null; - constructor(parent: Container, options: TextConfig) { + constructor( + /** The node the field is added to. */ + parent: Container, + /** Konva options of the text it lays the field over. */ + options: TextConfig, + ) { this.text = new Text(options); parent.add(this.text); this.text.hide(); @@ -58,7 +69,9 @@ export class TextAreaComponent { // Konva Text's verticalAlign only affects the hidden `this.text` node, never the visible //