From e0c9354a7c92ad6e511ca77aadeb61668e7a2629 Mon Sep 17 00:00:00 2001 From: ClaydeCode Date: Mon, 7 Sep 2026 11:46:47 +0000 Subject: [PATCH 1/3] ci: run the unit tests before the build on every push and pull request The Jest suite has never run in CI. Both workflows went straight from `npm install` to `npm run build`, so the three suites under tests/unit were green only on whichever machine last bothered to run them, and a regression could reach a pushed image unnoticed. The step goes into snapshot.yml only. That workflow already triggers on every branch push and every pull request, so it is the gate every commit passes; release.yml builds from a tag whose commit has already been through it. Placing the step before the build means a failing test stops the job before the image is pushed to ghcr.io. agents.md did not list `npm run test:unit` among the commands at all, which is part of why the gap survived this long. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01JMHRfVM4Mzy1bhEUTc3se9 --- .github/workflows/snapshot.yml | 3 +++ agents.md | 3 +++ 2 files changed, 6 insertions(+) diff --git a/.github/workflows/snapshot.yml b/.github/workflows/snapshot.yml index 3f37bf5..6e71245 100644 --- a/.github/workflows/snapshot.yml +++ b/.github/workflows/snapshot.yml @@ -29,6 +29,9 @@ jobs: - name: Install dependencies run: npm install + - name: Run unit tests + run: npm run test:unit + - name: Build project run: npm run build diff --git a/agents.md b/agents.md index d479e42..d4de165 100644 --- a/agents.md +++ b/agents.md @@ -16,8 +16,11 @@ Browser-based UI for controlling a Freeshard. Users manage apps, pair devices, c npm run serve # Dev server with hot-reload npm run build # Production build npm run lint # ESLint +npm run test:unit # Jest unit tests ``` +Unit tests run in CI on every push and pull request, before the build. + ## Project Structure ``` From d568db14115446b069db4f9eeae73d904f3d52e5 Mon Sep 17 00:00:00 2001 From: ClaydeCode Date: Mon, 7 Sep 2026 11:46:47 +0000 Subject: [PATCH 2/3] meta: gitignore .worktrees/ Agent sessions create git worktrees under .worktrees/. Untracked, they show up in `git status` and can be swept into the generated `set version to ` commits, where a worktree directory lands as a broken gitlink rather than as files. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01JMHRfVM4Mzy1bhEUTc3se9 --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 403adbc..5723c84 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,5 @@ pnpm-debug.log* *.njsproj *.sln *.sw? + +.worktrees/ From f0edf6d47bda11643546933a74d7865de90cacde Mon Sep 17 00:00:00 2001 From: ClaydeCode Date: Mon, 7 Sep 2026 12:11:13 +0000 Subject: [PATCH 3/3] meta: set the version in package-lock.json too `just set-version` rewrote only package.json, so the two version fields in package-lock.json kept whatever value they had when npm last wrote the file. main carried 0.38.1 in the lockfile against 0.40.0 in package.json, two releases of drift. The recipe now walks both files: `.version` in each, plus `.packages[""].version` in the lockfile, which is where npm keeps the root package's own version in lockfileVersion 2. A json round-trip of package-lock.json reproduces the file byte for byte, so writing it back with the same indent changes nothing but the version lines. This commit also carries the correction to 0.40.0, so the drift is not left waiting for the next release. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01JMHRfVM4Mzy1bhEUTc3se9 --- justfile | 18 ++++++++++++------ package-lock.json | 4 ++-- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/justfile b/justfile index de05317..ce3dc31 100644 --- a/justfile +++ b/justfile @@ -10,9 +10,15 @@ default: _set-version-files version: #!/usr/bin/env python3 import json - with open('package.json') as f: - pkg = json.load(f) - pkg['version'] = '{{version}}' - with open('package.json', 'w') as f: - json.dump(pkg, f, indent=2) - f.write('\n') + for path, keys in (('package.json', (('version',),)), + ('package-lock.json', (('version',), ('packages', '', 'version')))): + with open(path) as f: + doc = json.load(f) + for key in keys: + node = doc + for step in key[:-1]: + node = node[step] + node[key[-1]] = '{{version}}' + with open(path, 'w') as f: + json.dump(doc, f, indent=2) + f.write('\n') diff --git a/package-lock.json b/package-lock.json index 6da0950..5363770 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "web-terminal", - "version": "0.38.1", + "version": "0.40.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "web-terminal", - "version": "0.38.1", + "version": "0.40.0", "dependencies": { "axios": ">=1.8.2", "bootstrap": "^4.5.3",