From 194e682bc9267f1bb8e0b8916f42118c52d6e738 Mon Sep 17 00:00:00 2001 From: Oh Xyz Date: Tue, 30 Jun 2026 11:59:54 +1000 Subject: [PATCH] chore: add build:watch script and document react-bwin dev workflow build:watch (vite build --watch) regenerates dist/bwin.js on save so a linked react-bwin picks up changes via HMR. Document the link + watch loop in CONTRIBUTING. --- CONTRIBUTING.md | 27 +++++++++++++++++++++++++++ package.json | 1 + 2 files changed, 28 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d1cd255..4e91535 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -19,3 +19,30 @@ Create a `.env.local` to set the default minimum width/height (in pixels) for a VITE_DEFAULT_SASH_MIN_WIDTH=100 VITE_DEFAULT_SASH_MIN_HEIGHT=100 ``` + +## Working with react-bwin + +[`react-bwin`](https://github.com/bhjsdev/react-bwin) consumes bwin's **built** +output (`dist/bwin.js`), not `src/`. To develop both together (assuming the +repos are siblings), link them and rebuild bwin on save: + +In `react-bwin`, symlink to your local bwin checkout (don't commit this): + +```sh +pnpm add bwin@link:../bwin +``` + +In `bwin`, regenerate `dist/bwin.js` on every change: + +```sh +pnpm build:watch +``` + +In `react-bwin`, start the dev server (hot-reloads through the symlink): + +```sh +pnpm dev +``` + +`pnpm dev` still works in bwin alongside `build:watch` if you want bwin's own +dev pages running at the same time. diff --git a/package.json b/package.json index 528d6d5..0c6286c 100644 --- a/package.json +++ b/package.json @@ -33,6 +33,7 @@ "scripts": { "dev": "vite --port 7100", "build": "vite build", + "build:watch": "vite build --watch", "test": "vitest", "format": "prettier --write .", "format:check": "prettier --check .",