fuzzyworld

fuzzyworld-tools / commit

Add TypeScript declarations for the vite plugin; v1.0.1

45b1fe3805ad7ec86b864e4604b7ad89a0e25a78 · Pavel Safronov · 2026-10-26 17:59:10 -0700 · parents f9ca0752208e

Claude Code usage: this commit ~135.5K out / ~42.6M cached · cost unknown (no per-model trailer) · session 1 tally 1.3K in / 781.9K out / 158.6M cached · usage by commit and session

Add TypeScript declarations for the vite plugin; v1.0.1

Apps that typecheck vite.config.ts (tsc --noEmit) failed with TS7016.
App repos now depend on #semver:^1.0.0 so fixes like this need no
per-app commit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Usage: 1.3K in / 781.9K out / 158.6M cached (session tally)
rtk:   2.3M saved, 55.5% over 4975 cmds (global/lifetime)
 README.md         |  4 ++--
 package.json      |  7 +++++--
 server/install.sh |  7 +++++++
 vite/index.d.ts   | 18 ++++++++++++++++++
 4 files changed, 32 insertions(+), 4 deletions(-)

diff --git a/README.md b/README.md
index 3fc975e..11b5bcb 100644
--- a/README.md
+++ b/README.md
@@ -23,7 +23,7 @@ Add to the app repo's `package.json`:
   "build": "make public",            // default: `<pm> run build`
   "out": "dist"                      // default: dist, else public, else build
 },
-"devDependencies": { "fuzzyworld-tools": "git+https://code.fuzzyworld.net/fuzzyworld-tools.git#v1" }
+"devDependencies": { "fuzzyworld-tools": "git+https://code.fuzzyworld.net/fuzzyworld-tools.git#semver:^1.0.0" }
 ```
 
 For vite, add the plugin; it sets `base` to `/<app>/` for builds (dev server unchanged):
@@ -122,4 +122,4 @@ server/install.sh --publish  # ...and republish every repo
 
 Requirements on DreamHost: git, Python 3.12, `flock`, `setsid`. On the laptop: Node ≥ 18, git, rsync, ssh with the `dh` alias.
 
-Using `fw` outside an app repo (e.g. on a second laptop): `npm install -g git+https://code.fuzzyworld.net/fuzzyworld-tools.git#v1`.
+Using `fw` outside an app repo (e.g. on a second laptop): `npm install -g "git+https://code.fuzzyworld.net/fuzzyworld-tools.git#semver:^1.0.0"`.
diff --git a/package.json b/package.json
index 31beb98..995515c 100644
--- a/package.json
+++ b/package.json
@@ -1,13 +1,16 @@
 {
   "name": "fuzzyworld-tools",
-  "version": "1.0.0",
+  "version": "1.0.1",
   "description": "Tooling for code.fuzzyworld.net and apps.fuzzyworld.net: fw command, deploy, vite plugin.",
   "type": "module",
   "bin": {
     "fw": "bin/fw"
   },
   "exports": {
-    "./vite": "./vite/index.js",
+    "./vite": {
+      "types": "./vite/index.d.ts",
+      "default": "./vite/index.js"
+    },
     "./package.json": "./package.json"
   },
   "files": [
diff --git a/server/install.sh b/server/install.sh
index 5956cbf..34338fc 100755
--- a/server/install.sh
+++ b/server/install.sh
@@ -11,6 +11,13 @@ rsync -az --delete --exclude '__pycache__' server/ "$HOST:fw/tools/server/"
 ssh "$HOST" bash -s <<'EOF'
 set -euo pipefail
 chmod +x ~/fw/tools/server/fw ~/fw/tools/server/hooks/*
+# DreamHost's process watchdog kills git-upload-pack when pack-objects uses its defaults
+# (2 threads, unbounded delta window) on large repos, so clones/fetches over ssh of e.g.
+# when-am-i (284 MB) die with "git-pack-objects died". These limits keep it under the radar.
+git config --global pack.threads 1
+git config --global pack.windowMemory 64m
+git config --global pack.deltaCacheSize 16m
+git config --global core.bigFileThreshold 16m
 mkdir -p ~/bin ~/fw/state ~/fw/logs
 ln -sfn ~/fw/tools/server/fw ~/bin/fw
 site=~/code.fuzzyworld.net
diff --git a/vite/index.d.ts b/vite/index.d.ts
new file mode 100644
index 0000000..5e67545
--- /dev/null
+++ b/vite/index.d.ts
@@ -0,0 +1,18 @@
+import type { Plugin } from 'vite';
+
+export interface FuzzyworldAppConfig {
+  app: string;
+  title?: string;
+  description?: string;
+  repo?: string;
+  prebuild?: string[];
+  checks?: string[];
+  build?: string;
+  out?: string;
+}
+
+/** Reads the "fuzzyworld" section of package.json in `root` (default: cwd). */
+export function readAppConfig(root?: string): FuzzyworldAppConfig;
+
+/** Sets `base` to `/<app>/` for builds, from package.json `fuzzyworld.app`. */
+export default function fuzzyworld(): Plugin;