fix(manifest): read plugin version from package.json at build time (HOM-551) #10

Open
aaron wants to merge 1 commit from paperclip/HOM-551-manifest-version-drift into live
Owner
No description provided.
HOM-143 follow-up: `src/manifest.ts` hardcoded `version: "0.1.0"` while
`package.json` is at 0.2.0, so plugin metadata drifts from the npm-shipped
version on every release.

- `esbuild.config.mjs` reads `package.json` once and injects a
  `__PLUGIN_VERSION__` define into the manifest preset only (worker and UI
  presets are untouched).
- `vitest.config.ts` mirrors the same define so the test runner resolves the
  identifier that the production bundle uses.
- `src/manifest.ts` replaces the hardcoded string with `__PLUGIN_VERSION__`
  (typed via a `declare const` shim) so `package.json` is the single source
  of truth.

Verified:
- `npm run typecheck` clean.
- `npm run test` 15/15 passing.
- `npm run build` produces `dist/manifest.js` with `version: "0.2.0"`,
  matching `package.json`.
- Sanity bump of `package.json` to `0.2.1-bumpsanity` rebuilt the manifest
  without touching `src/manifest.ts`; reverted.

Refs HOM-143, HOM-152, HOM-153.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin paperclip/HOM-551-manifest-version-drift:paperclip/HOM-551-manifest-version-drift
git switch paperclip/HOM-551-manifest-version-drift

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch live
git merge --no-ff paperclip/HOM-551-manifest-version-drift
git switch paperclip/HOM-551-manifest-version-drift
git rebase live
git switch live
git merge --ff-only paperclip/HOM-551-manifest-version-drift
git switch paperclip/HOM-551-manifest-version-drift
git rebase live
git switch live
git merge --no-ff paperclip/HOM-551-manifest-version-drift
git switch live
git merge --squash paperclip/HOM-551-manifest-version-drift
git switch live
git merge --ff-only paperclip/HOM-551-manifest-version-drift
git switch live
git merge paperclip/HOM-551-manifest-version-drift
git push origin live
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
aaron/paperclip-alertmanager-plugin!10
No description provided.