fuzzyworld-tools / commit
Add TypeScript declarations for the vite plugin; v1.0.1
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;