fuzzyworld

basin / commit

Deploy to apps.fuzzyworld.net with fuzzyworld-tools

f8e9c765a20c5403ae4b04bd1486b375f8f333df · Pavel Safronov · 2026-10-26 18:24:04 -0700 · parents 36e6a8b94ff1

Deploy to apps.fuzzyworld.net with fuzzyworld-tools

Adds the fuzzyworld package.json section, a deploy script (fw deploy) and the fuzzyworld-tools dependency, and points gitlab.io / gitlab.com links at apps.fuzzyworld.net and code.fuzzyworld.net.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
 index.html        |  2 +-
 package-lock.json | 13 +++++++++++++
 package.json      |  8 +++++++-
 readme.md         |  6 +++---
 vite.config.ts    | 12 ++++++------
 5 files changed, 30 insertions(+), 11 deletions(-)

diff --git a/index.html b/index.html
index bd9a190..5e38e8d 100644
--- a/index.html
+++ b/index.html
@@ -80,7 +80,7 @@
           explore the terrain; land on a spring and it locks in.
         </p>
         <footer class="credit">
-          <a href="https://gitlab.com/PavelSafronov/basin" target="_blank" rel="noopener">Source on GitLab</a>
+          <a href="https://code.fuzzyworld.net/basin/" target="_blank" rel="noopener">Source code</a>
           · Logo by
           <a href="https://www.flaticon.com/authors/icongeek26" target="_blank" rel="noopener">icongeek26</a>
           on Flaticon
diff --git a/package-lock.json b/package-lock.json
index 78cfe58..68c7606 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -8,6 +8,7 @@
       "name": "basin",
       "version": "0.0.0",
       "devDependencies": {
+        "fuzzyworld-tools": "git+https://code.fuzzyworld.net/fuzzyworld-tools.git#semver:^1.0.0",
         "typescript": "^5.6.3",
         "vite": "^6.0.7",
         "vitest": "^4.1.9"
@@ -1086,6 +1087,18 @@
         "node": "^8.16.0 || ^10.6.0 || >=11.0.0"
       }
     },
+    "node_modules/fuzzyworld-tools": {
+      "version": "1.0.1",
+      "resolved": "git+https://code.fuzzyworld.net/fuzzyworld-tools.git#45b1fe3805ad7ec86b864e4604b7ad89a0e25a78",
+      "dev": true,
+      "license": "MIT",
+      "bin": {
+        "fw": "bin/fw"
+      },
+      "engines": {
+        "node": ">=18"
+      }
+    },
     "node_modules/magic-string": {
       "version": "0.30.21",
       "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz",
diff --git a/package.json b/package.json
index f750f6b..13a679c 100644
--- a/package.json
+++ b/package.json
@@ -8,11 +8,17 @@
     "build": "tsc && vite build",
     "preview": "vite preview",
     "test": "vitest run",
-    "test:watch": "vitest"
+    "test:watch": "vitest",
+    "deploy": "fw deploy"
   },
   "devDependencies": {
+    "fuzzyworld-tools": "git+https://code.fuzzyworld.net/fuzzyworld-tools.git#semver:^1.0.0",
     "typescript": "^5.6.3",
     "vite": "^6.0.7",
     "vitest": "^4.1.9"
+  },
+  "fuzzyworld": {
+    "app": "basin",
+    "title": "basin"
   }
 }
diff --git a/readme.md b/readme.md
index 576b940..31e54ea 100644
--- a/readme.md
+++ b/readme.md
@@ -3,8 +3,8 @@
 A browser puzzle game about water basins — read a coastline and deduce where the
 rivers begin.
 
-- **▶ Play:** <https://pavelsafronov.gitlab.io/basin/>
-- **Source:** <https://gitlab.com/PavelSafronov/basin>
+- **▶ Play:** <https://apps.fuzzyworld.net/basin/>
+- **Source:** <https://code.fuzzyworld.net/basin/>
 
 Built with Vite + vanilla TypeScript + Canvas2D; no framework, no backend. Every
 board is a seed, so a board is just a link.
@@ -91,7 +91,7 @@ npm test         # run the model tests (Vitest)
 `.gitlab-ci.yml` builds the app and publishes it to **GitLab Pages** on every push
 to the default branch. Vite is configured with `base: '/basin/'` and builds into
 `public/` (the dir Pages serves), so the live site is
-<https://pavelsafronov.gitlab.io/basin/>.
+<https://apps.fuzzyworld.net/basin/>.
 
 ## Architecture
 
diff --git a/vite.config.ts b/vite.config.ts
index 4425139..4e4ea4c 100644
--- a/vite.config.ts
+++ b/vite.config.ts
@@ -1,12 +1,12 @@
 import { defineConfig } from 'vite';
+import fuzzyworld from 'fuzzyworld-tools/vite';
 
-// GitLab Pages serves this project under https://pavelsafronov.gitlab.io/basin/,
-// so assets must be referenced relative to /basin/. Pages publishes the `public`
-// dir, hence the custom outDir.
+// Served at https://apps.fuzzyworld.net/basin/: fuzzyworld() sets base to /basin/.
+// The build goes to `public/` (kept from GitLab Pages days; `fw deploy` finds it).
 export default defineConfig({
-  base: '/basin/',
-  // We build *into* `public/` (GitLab Pages' required dir), so disable Vite's
-  // default `public/` static-assets folder to avoid the name collision.
+  plugins: [fuzzyworld()],
+  // We build *into* `public/`, so disable Vite's default `public/` static-assets
+  // folder to avoid the name collision.
   publicDir: false,
   build: {
     outDir: 'public',