@kuncat/avoidant 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +62 -0
- package/dist/assets/OpenSans-VariableFont_wdth,wght.ttf +0 -0
- package/dist/assets/favicon.svg +1 -0
- package/dist/components/AvoidantGame.svelte +814 -0
- package/dist/components/AvoidantGame.svelte.d.ts +6 -0
- package/dist/components/board.svelte +448 -0
- package/dist/components/board.svelte.d.ts +32 -0
- package/dist/components/fragment.glsl +98 -0
- package/dist/components/vertex.glsl +31 -0
- package/dist/generated/shared-constants.d.ts +6 -0
- package/dist/generated/shared-constants.js +9 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/styles/global.css +205 -0
- package/dist/vitest-examples/Welcome.svelte +8 -0
- package/dist/vitest-examples/Welcome.svelte.d.ts +13 -0
- package/dist/vitest-examples/greet.d.ts +1 -0
- package/dist/vitest-examples/greet.js +3 -0
- package/dist/wasm/LICENSE_APACHE +190 -0
- package/dist/wasm/LICENSE_MIT +25 -0
- package/dist/wasm/avoidant_wasm.d.ts +379 -0
- package/dist/wasm/avoidant_wasm.js +1851 -0
- package/dist/wasm/avoidant_wasm_bg.wasm +0 -0
- package/dist/wasm/avoidant_wasm_bg.wasm.d.ts +86 -0
- package/dist/wasm/package.json +26 -0
- package/dist/workers/mapgen-client.d.ts +7 -0
- package/dist/workers/mapgen-client.js +53 -0
- package/dist/workers/mapgen.worker.d.ts +18 -0
- package/dist/workers/mapgen.worker.js +41 -0
- package/package.json +86 -0
package/README.md
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# Avoidant
|
|
2
|
+
|
|
3
|
+
## Developing
|
|
4
|
+
|
|
5
|
+
### Prerequisites
|
|
6
|
+
|
|
7
|
+
WebAssembly compilation target
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
rustup target add wasm32-unknown-unknown
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
wasm-pack
|
|
14
|
+
|
|
15
|
+
```sh
|
|
16
|
+
cargo install wasm-pack
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Nightly Rust toolchain (required for WebAssembly threads via wasm-bindgen-rayon)
|
|
20
|
+
|
|
21
|
+
```sh
|
|
22
|
+
rustup toolchain install nightly --component rust-src --target wasm32-unknown-unknown
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
On static hosting, ensure cross-origin isolation headers (for browser WebAssembly threads):
|
|
26
|
+
`Cross-Origin-Opener-Policy: same-origin` and
|
|
27
|
+
`Cross-Origin-Embedder-Policy: require-corp`
|
|
28
|
+
|
|
29
|
+
### Running
|
|
30
|
+
|
|
31
|
+
Install dependencies with `npm install` then start a development server:
|
|
32
|
+
|
|
33
|
+
```sh
|
|
34
|
+
npm run dev
|
|
35
|
+
|
|
36
|
+
# or start the server and open the app in a new browser tab
|
|
37
|
+
npm run dev -- --open
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Building
|
|
41
|
+
|
|
42
|
+
### WASM
|
|
43
|
+
|
|
44
|
+
```
|
|
45
|
+
npm run build:wasm
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### App
|
|
49
|
+
|
|
50
|
+
```sh
|
|
51
|
+
npm run build
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
You can preview the production build with `npm run preview`.
|
|
55
|
+
|
|
56
|
+
## Testing
|
|
57
|
+
|
|
58
|
+
### WASM Headless Browser test
|
|
59
|
+
|
|
60
|
+
```
|
|
61
|
+
cd crates/game && wasm-pack test --headless --firefox
|
|
62
|
+
```
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><title>Avoidant</title><g fill="silver" stroke="#000" stroke-linejoin="round" stroke-width="1.25"><path d="m1 1 13 1 1 15-15 2Z"/><path d="M14 2 29.366.106l-.326 17.577L15 17Zm18 16-2.044 11.956-12.379.211L15 17Z"/><path d="M2.467 18.894 15 17l5 15H2Z"/></g></svg>
|