Skip to content

Commit f11d7e2

Browse files
committed
chore(version): automate inject-version via npm version hook
1 parent 1401b72 commit f11d7e2

2 files changed

Lines changed: 10 additions & 6 deletions

File tree

CONTRIBUTING.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,18 @@ The `inject-version` script keeps them in sync — `package.json` is the source
3434

3535
### Bumping a version
3636

37+
The `version` npm hook automatically syncs `src/config.js` and stages it,
38+
so a single command creates the commit + tag:
39+
3740
```bash
38-
npm version minor --no-git-tag-version # or: major, patch
39-
npm run inject-version
40-
git add package.json src/config.js
41-
git commit -m "chore: bump to v$(node -p "require('./package.json').version")"
42-
git tag "v$(node -p "require('./package.json').version")"
43-
git push origin main --tags
41+
npm version patch # or: minor, major
42+
git push --follow-tags
4443
```
4544

45+
This bumps `package.json`, injects the version into `src/config.js`,
46+
commits both files, creates a `vX.Y.Z` tag, and the push triggers
47+
the CI release workflow.
48+
4649
## Python Scripts (uv)
4750

4851
The repository includes Python helper scripts in `scripts/` (e.g. the screenshot tool).

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
"dist-mac": "npm run dist:prep && electron-builder --mac --publish=never && npm run substitute-gll end",
2828
"dist": "npm run dist-linux && npm run dist-windows",
2929
"serve": "npx http-server src -p 8000 --cors -o /graph_lens_lite.html ",
30+
"version": "npm run inject-version && git add src/config.js",
3031
"test": "vitest run",
3132
"test:watch": "vitest"
3233
},

0 commit comments

Comments
 (0)