Repository navigation
Bun and Deno: Ward now installs and runs hooks on Node, Bun and Deno, with the same config.
Warning
Ward is in early development (0.x). Until 1.0, any minor release may change the config and behavior.
Install
# npm
npm install -D @hexlabelposition/ward
npm pkg set scripts.prepare=ward
npm run prepare
# Bun: the same "prepare": "ward" script, run by bun install
bun add -d @hexlabelposition/ward
# Deno: add "prepare": "deno run -A npm:@hexlabelposition/ward" to deno.json tasks
deno add npm:@hexlabelposition/ward
deno task preparePublished with npm provenance. Requires Git 2.20 or later and Node.js 24 or later, Bun or Deno 2. Two runtime dependencies (yaml, picomatch), ESM-only.
What's in v0.3
Bun
bun installrunsprepareand installs the hooks, also from a workspace package.- Stubs start Ward on the runtime that ran the install: Node when it is installed, Bun when it is not.
ward.config.tsaccepts full TypeScript syntax (enum,namespace, parameter properties), and syntax errors point at the line.
Deno
- Install from a
deno.jsontask:deno task prepare. Deno has nopreparelifecycle, so run it after cloning and after updating Ward. - Hooks run
deno run -A npm:@hexlabelposition/ward, at the version fromdeno.jsonorpackage.jsonand the lockfile. Nonode_modulesis needed. ward.config.tsaccepts full TypeScript syntax, and syntax errors point at the line.
All runtimes
WARD_RUNTIME=node,bunordenooverrides the runtime of the stubs for one command:WARD_RUNTIME=node git commit. An unknown value or a runtime that is not installed fails the hook with a hint.- Install hints show the command for the runtime in use (
npx ward,bunx ward,deno run -A npm:@hexlabelposition/ward). - On Windows, the binary Bun writes for a workspace package (
ward.exe) is found.
Tested on
Ubuntu, macOS and Windows, on Node.js 24 and the current release, the latest Bun and Deno 2.x. The full test suite runs on every runtime.
What's next
- v0.4: the same config in CI (
--from-ref,--all-files,--ci) and shared configs withextends. - v0.5:
ward init, and hooks without tasks that exit without starting a runtime.
See BACKLOG.md.
Full Changelog: v0.2.0...v0.3.0