From c62bbdc688d07b8804d129b760198f2676253c28 Mon Sep 17 00:00:00 2001 From: Vernon Stinebaker Date: Tue, 5 May 2026 19:35:42 +0800 Subject: [PATCH 1/2] fix(release): package embeddable chat module NullHub loads nullclaw-chat-ui through module.js, so release archives need to ship the module build alongside the static app bundle. --- scripts/package-release.sh | 3 +++ scripts/verify-release-package.sh | 1 + 2 files changed, 4 insertions(+) diff --git a/scripts/package-release.sh b/scripts/package-release.sh index 1ea3039..9f43830 100755 --- a/scripts/package-release.sh +++ b/scripts/package-release.sh @@ -11,6 +11,9 @@ rm -rf "${OUTDIR}" mkdir -p "${PKG_DIR}/bin" cp -R build "${PKG_DIR}/build" +if [[ -d dist ]]; then + cp -R dist/. "${PKG_DIR}/" +fi cp bin/nullclaw-chat-ui.js "${PKG_DIR}/bin/nullclaw-chat-ui.js" cp package.json "${PKG_DIR}/package.json" cp README.md "${PKG_DIR}/README.md" diff --git a/scripts/verify-release-package.sh b/scripts/verify-release-package.sh index 4fcdb38..7d25d29 100755 --- a/scripts/verify-release-package.sh +++ b/scripts/verify-release-package.sh @@ -57,6 +57,7 @@ required_entries=( "nullclaw-chat-ui/nullclaw-chat-ui" "nullclaw-chat-ui/nullclaw-chat-ui.cmd" "nullclaw-chat-ui/bin/nullclaw-chat-ui.js" + "nullclaw-chat-ui/module.js" "nullclaw-chat-ui/build/index.html" ) From d1da0fa53d13384f055778c2a28739057a7be63a Mon Sep 17 00:00:00 2001 From: Igor Somov Date: Mon, 18 May 2026 22:42:31 -0300 Subject: [PATCH 2/2] fix(release): build module before packaging --- .github/workflows/ci.yml | 4 ++-- .github/workflows/release.yml | 4 ++-- .gitignore | 1 + README.md | 4 +++- docs/operations.md | 8 +++++--- package.json | 1 + scripts/package-release.sh | 7 +++++-- scripts/verify-release-package.sh | 1 + 8 files changed, 20 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4ea8d16..991a864 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,8 +27,8 @@ jobs: - name: Run type and Svelte checks run: npm run check - - name: Build - run: npm run build + - name: Build release bundles + run: npm run build:release - name: Package release artifacts (smoke) run: bash ./scripts/package-release.sh "v0.0.0-ci" release diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3ce92f3..a29c243 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -27,8 +27,8 @@ jobs: npm run test npm run check - - name: Build production bundle - run: npm run build + - name: Build release bundles + run: npm run build:release - name: Package release archives run: bash ./scripts/package-release.sh "${GITHUB_REF_NAME}" release diff --git a/.gitignore b/.gitignore index 8a03fc1..cd7e26e 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,7 @@ reference/ .wrangler /.svelte-kit /build +/dist # OS .DS_Store diff --git a/README.md b/README.md index c6cb7ad..f871196 100644 --- a/README.md +++ b/README.md @@ -57,6 +57,8 @@ Open `http://localhost:5173`. - `npm run dev` - local development server. - `npm run build` - production build. +- `npm run build:module` - embeddable module build. +- `npm run build:release` - static app and embeddable module builds for release archives. - `npm run preview` - preview built app. - `npm run cli -- run` - serve built UI via local CLI entrypoint. - `npm run test` - run Vitest suite. @@ -66,7 +68,7 @@ Open `http://localhost:5173`. ## Global CLI Usage -GitHub release artifacts include a runnable CLI bundle with `build/` assets and launchers. +GitHub release artifacts include a runnable CLI bundle with `build/` assets, launchers, and the embeddable `module.js`. After extracting a release archive, put the launcher on your `$PATH`: ```bash diff --git a/docs/operations.md b/docs/operations.md index 2827071..dc92fea 100644 --- a/docs/operations.md +++ b/docs/operations.md @@ -6,10 +6,10 @@ npm ci npm run test npm run check -npm run build +npm run build:release ``` -Output is generated into `build/` (static app bundle). +Output is generated into `build/` (static app bundle) and `dist/module.js` (embeddable module). ## Deployment Model @@ -48,7 +48,7 @@ Security expectations: 1. Ensure docs match current runtime behavior. 2. Run `npm run test` and `npm run check`. 3. Manual verification of pairing, chat, approvals, logout. -4. Build production bundle. +4. Build release bundles: `npm run build:release`. 5. Verify CLI startup: `npm run cli -- run --host 127.0.0.1 --port 4173`. 6. Validate release archive layout: `bash ./scripts/package-release.sh vX.Y.Z release && bash ./scripts/verify-release-package.sh vX.Y.Z release`. 7. Tag a release: `git tag vYYYY.M.D && git push origin vYYYY.M.D`. @@ -67,6 +67,8 @@ Each archive contains: - `nullclaw-chat-ui` (Unix launcher) - `nullclaw-chat-ui.cmd` (Windows launcher) - `bin/nullclaw-chat-ui.js` +- `module.js` (embeddable module) +- `nullclaw-chat-ui.css` (embeddable module styles) - `build/` (static app bundle) ## Troubleshooting diff --git a/package.json b/package.json index 62f900a..fbf47e7 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,7 @@ "scripts": { "dev": "vite dev", "build": "vite build", + "build:release": "npm run build && npm run build:module", "preview": "vite preview", "cli": "node ./bin/nullclaw-chat-ui.js", "test": "vitest run", diff --git a/scripts/package-release.sh b/scripts/package-release.sh index 9f43830..808f3c9 100755 --- a/scripts/package-release.sh +++ b/scripts/package-release.sh @@ -11,9 +11,12 @@ rm -rf "${OUTDIR}" mkdir -p "${PKG_DIR}/bin" cp -R build "${PKG_DIR}/build" -if [[ -d dist ]]; then - cp -R dist/. "${PKG_DIR}/" +if [[ ! -f dist/module.js ]]; then + echo "Module build output was not found: dist/module.js" >&2 + echo "Run \`npm run build:module\` before packaging release archives." >&2 + exit 1 fi +cp -R dist/. "${PKG_DIR}/" cp bin/nullclaw-chat-ui.js "${PKG_DIR}/bin/nullclaw-chat-ui.js" cp package.json "${PKG_DIR}/package.json" cp README.md "${PKG_DIR}/README.md" diff --git a/scripts/verify-release-package.sh b/scripts/verify-release-package.sh index 7d25d29..4023889 100755 --- a/scripts/verify-release-package.sh +++ b/scripts/verify-release-package.sh @@ -58,6 +58,7 @@ required_entries=( "nullclaw-chat-ui/nullclaw-chat-ui.cmd" "nullclaw-chat-ui/bin/nullclaw-chat-ui.js" "nullclaw-chat-ui/module.js" + "nullclaw-chat-ui/nullclaw-chat-ui.css" "nullclaw-chat-ui/build/index.html" )