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/.gitignore b/.gitignore index 403adbc..5723c84 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,5 @@ pnpm-debug.log* *.njsproj *.sln *.sw? + +.worktrees/ 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 ``` 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",