Versioning and releases
Changesets records consumer-visible package changes and drives semantic versions and changelogs. Add a Changeset with pnpm changeset, select affected publishable packages, choose patch/minor/major impact, and write a consumer-focused summary. Never name @ghostvue/core or @ghostvue/shared in a Changeset: they are internal and never released (tests/integration/release-pipeline.test.ts rejects it).
Internal refactors, tests, and documentation that do not affect a package release usually need no Changeset. Pre-1.0 versions still require explicit compatibility judgment; zero-major status is not permission for surprise breakage.
CI (scripts/check-pr-changeset.mjs in .github/workflows/pr-changeset.yml) enforces that pull requests touching publishable package inputs (packages/{vue,themes,nuxt,eslint-plugin,mcp}/src/**, packages/themes/tokens/**, or packages/*/package.json, excluding *.test.*, *.spec.*, manifests/**, and AGENTS.md) either add or update a .changeset/<slug>.md entry or carry the no-changeset label. Use no-changeset when a change inside a publishable package is purely internal and has no consumer-visible impact. Dependabot dependencies-labeled PRs that only bump devDependencies (without changing dependencies, peerDependencies, or optionalDependencies) are exempted automatically.
Publication status
The first public release shipped at 0.1.0 on npm with five packages under the @ghostvue npm scope: @ghostvue/vue, @ghostvue/themes, @ghostvue/nuxt, @ghostvue/eslint-plugin, and @ghostvue/mcp. These are the entries with publishable: true in scripts/workspace-packages.mjs (publishableWorkspacePackages), which every release script and test reads. @ghostvue/core and @ghostvue/shared are internal (publishable: false): they stay in the catalog for boundary and adapter checks, have no publishConfig, and no published package may depend on them (GHO-217). The maintainer approved the release candidate in #335. Publication requires separate, explicit maintainer authorization (GHO-57).
These invariants are enforced by tests/integration/release-pipeline.test.ts:
- Every package, publishable or internal, keeps
"private": true. npm refuses to publish a private package. Only the verified, staged tarballs are published. - Every publishable package declares
publishConfig.access: "public"(required for a scoped package),publishConfig.provenance: true, and arepositorythat matches this GitHub repository (npm provenance rejects a mismatch). - Every
@ghostvue/*entry in a publishable package'sdependencies,peerDependencies, oroptionalDependenciesusesworkspace:^, which packs to a caret range such as^0.1.0.workspace:*and exact versions pack to pins that nest duplicate copies or fail installs with ERESOLVE (#345). See the dependency policy. .changeset/config.jsonputs the five publishable packages in onefixedgroup, so they always share a version: a minor Changeset for any one of them bumps all five.tests/integration/release-dry-run.test.tssimulates a@ghostvue/vue-only minor after 0.1.0 and expects all five at 0.2.0.- The dry-run workflow has no npm credentials or OIDC permissions. Only the approved publish job gets
id-token: writefor provenance. Actions are pinned by commit SHA per the CI policy.
Release dry run
pnpm build
pnpm release:dry-run --expect-version 0.1.0scripts/release-dry-run.mjs never publishes. It refuses to run without --dry-run (the root script passes it) and exits with code 2 on flags such as --publish, --no-dry-run, or --otp. It covers the five publishable packages only and refuses an entry marked publishable: false. For each package it:
- checks the source manifest invariants above;
- uses a scratch copy to apply pending Changesets or read the committed release versions and changelogs;
- packs the package with
pnpm pack, which appliesfilesand rewritesworkspace:^to a caret range; - stages the packed tree in a temporary directory, sets the planned version and caret ranges on the planned internal versions (refusing any internal range that packed to an exact pin), and removes
privatefrom that temporary copy only; - runs
npm packandnpm publish --dry-runon the staged copy and checks that both report the same sha1 as the tarball on disk.
Child npm processes get an empty user and global npmrc, no NODE_AUTH_TOKEN, NPM_TOKEN, or npm_config_* variables, no GitHub OIDC request variables, and https://registry.invalid/ as the registry. Even if the dry-run flag were bypassed there would be no credential and no reachable registry.
Evidence lands in reports/release-dry-run/ (ignored by git): summary.json, summary.md, the exact tarballs, raw npm publish --dry-run --json output, and changelog previews. pnpm release:dry-run --verify-evidence <dir> re-checks a copy of that evidence.
If Changesets fails during version planning, the dry run prints its stdout and stderr and returns its nonzero exit status.
Packed-export quality is not duplicated here: run pnpm published-exports, pnpm exports:check (publint, attw, packed define smoke), pnpm mcp:packed (@ghostvue/mcp contents, 18 MiB installed-size gate, and stdio smoke that calls every tool and checks the manifestSchemaId stamp; see the MCP server guide), and pnpm consumer:packed first, as CI does.
pnpm consumer:packed (scripts/consumer-packed-smoke.mjs) installs the packed tarballs with npm into consumer projects outside the monorepo, copied from tests/fixtures/consumer-packed/:
@ghostvue/vue+@ghostvue/themes: a Vite + Vue app with themed Field, Input, Select, Dialog, Drawer, and Toast, plus the 0.2.0 form additions (CheckboxGroup, a Select with a baremultipleattribute, and the native fieldset and input group recipes), whose submittedFormDatais checked after selecting, resetting, disabling, and clearing. It is set up as Getting started documents: it imports only@ghostvue/themes/calm.css, neverdefault.css. The production build must emit the base@layer ghostvue-themerecipes that the@ghostvue/themesentry imports, plus the calm token host, and the built bundle is mounted in jsdom and driven once per component.@ghostvue/nuxt: a Nuxt app that uses only module auto-imports. The headless default is built and server-rendered; the themed opt-in must resolve tags to@ghostvue/themes.@ghostvue/eslint-plugin: ESLint flags an invalidGhost*usage with all three rules and passes a valid one.
Third-party consumer dependencies are pinned to the workspace's own versions, so the check needs the npm registry but no credentials.
Try candidate archives in a clean app
Use this to check a release candidate the way an outside app would, before anything is on npm. The archives are the exact tarballs the dry run staged.
Get the archives. Locally they are in
reports/release-dry-run/tarballs/. From CI, download therelease-dry-run-evidenceartifact of the Release dry run run and open itstarballs/folder. Each package has one archive, such asghostvue-vue-0.5.0.tgz.Create or open a Vue + Vite app outside this repository. The packed Vite fixture is a minimal starting point: copy its
index.html,vite.config.js, and asrc/main.jsthat mounts yourApp.vue, then installvue,vite, and@vitejs/plugin-vue.Copy the headless archive into the app folder and install it:
bashnpm install ./ghostvue-vue-0.5.0.tgznpm records
"@ghostvue/vue": "file:ghostvue-vue-0.5.0.tgz". Import components from@ghostvue/vueand runnpm run build.For themed imports, copy the matching themes archive and install it after the headless one.
@ghostvue/themesdeclares@ghostvue/vueas a peer, and an unpublished version can only come from the archive already installed:bashnpm install ./ghostvue-themes-0.5.0.tgzThen switch imports to
@ghostvue/themes, import one palette such as@ghostvue/themes/calm.cssas Getting started shows, and build again.npm ls @ghostvue/vueshould list one copy, deduped under@ghostvue/themes.
Release workflow
.github/workflows/release-dry-run.yml runs on manual dispatch or as a reusable rehearsal, with expected_version (required for each run). Workflow permissions default to none.
dry-run(contents: read): install, build,published-exports,exports:check,mcp:packed,consumer:packed,release:dry-run, confirm the checkout is unchanged, and upload therelease-dry-run-evidenceartifact. It runs on any branch.maintainer-approval(master only,environment: npm-release,contents: read): waits for a required reviewer, verifies the downloaded evidence, and records that publication is disabled. It has no publish step and noid-token: write. This approval job is skipped when the publish workflow calls the rehearsal.
First release checklist
- [x] Scope ownership. The
@ghostvuescope is owned by the maintainer's npm user accountghostvue(confirmed Nov 12). No npm organization exists yet; converting to one is optional and only needed when other maintainers join. - [x] Package names.
@ghostvue/vue,@ghostvue/themes,@ghostvue/nuxt,@ghostvue/eslint-plugin, and@ghostvue/mcp(publishable: trueinscripts/workspace-packages.mjs).@ghostvue/core,@ghostvue/shared, and the apps (@ghostvue/docs,@ghostvue/playground,@ghostvue/nuxt-fixture) stay private and unpublished. - [x] Version plan. Changesets recorded
0.1.0in all five manifests and changelogs. The release rehearsal checks the exact version. - [x] Packaging metadata.
publishConfig(public access, provenance) andrepository.directoryadded while packages stay private. - [x] Packed exports. publint, attw, declaration and packed smoke checks (GHO-55, GHO-6) run before the dry run.
- [x] Packed consumers.
pnpm consumer:packedandpnpm mcp:packedexercise every publishable tarball as an external consumer (GHO-217). - [x] Schema URLs. The manifest schemas are identified by
https://ghostvue.dev/schemas/v1/manifest.schema.jsonandhttps://ghostvue.dev/schemas/v1/manifest-collection.schema.json, served from byte-identical copies indocs/public/schemas/v1/(ADR 0006). - [x] Live schema URLs. #335 verified both responses against the checked-in JSON from
https://ghostvue.dev. - [x] Dry run. Credential-free
npm publish --dry-runof staged tarballs with evidence uploaded as a workflow artifact. - [x] Approval gate. The
maintainer-approvaljob uses thenpm-releaseenvironment. The separate publish job also uses this environment. - [x] Environment reviewers. The
npm-releaseenvironment has a required reviewer and allows deployments frommaster. - [x] Changelog policy. Pre-release Changesets (including the slop-ui rename history) were consolidated into one first-release summary,
.changeset/initial-release-0-1-0.md. Review the generated0.1.0changelog previews in the evidence artifact. Repeat the dry run on the final0.1.0release candidate. - [x] Support matrix. #335 ran the packed consumer checks on Node 22. The Vue peer range is
^3.5.0. - [x] Explicit publication authorization. The maintainer authorized
0.1.0and approved the protected deployment. The verification evidence records all five npm packages.
Release operation
Use master for the active development release and a release/X.Y.x maintenance branch, such as release/0.2.x, for approved compatibility fixes to an already published X.Y line. See release routing and branching for issue pickup and PR targets. The board target selects work. Package manifests and changelogs determine the build version.
Start a maintenance line
A patch for a line ships from its maintenance branch once master holds a minor or major Changeset, because master can then only release the next minor or major version.
- Cut
release/X.Y.xfrom thevX.Y.0tag. The publish workflow runs from the branch's own copy, so if that tag predates the commit that accepts anyrelease/X.Y.xbranch in.github/workflows/release-publish.ymlandscripts/publish-release.mjs, backport that commit first. Carry over only the selected fixes and release tooling. - In Settings → Environments → npm-release → Deployment branches and tags, allow the exact branch
release/X.Y.xin addition tomaster. Each maintenance branch needs its own entry. Keep the required reviewers. Require PR and CI checks for the maintenance branch before accepting fixes there. - Create the label
backport:X.Y.xfor the new line, for examplebackport:0.2.xforrelease/0.2.x. See Backport a fix. - Use a patch Changeset for a package fix. Backport each selected fix from
masterwith its label, or by hand withgit cherry-pick -xso that its Changeset comes with it, and target the backport PR atrelease/X.Y.x. After the backport PRs land, runpnpm changeset versionin a release PR, review all five manifests and changelogs, and commit the lockfile if it changes. Repeat from the same branch for later patches. Keep the version commit on the maintenance branch.
Backport a fix
Label a pull request into master with backport:X.Y.x to backport it to the existing release/X.Y.x branch. One workflow serves every line: backport:1.4.x targets release/1.4.x. Apply the label before or after the merge, and add one label per line. Once the pull request is both merged and labeled, Backport (.github/workflows/backport.yml) runs scripts/backport.mjs from master:
- It cherry-picks only the merged change with
git cherry-pick -xontorelease/X.Y.x. This includes the regression tests and the original patch Changeset at its original path with unchanged packages, bump types, and summary, even ifmasterhas consumed it since. No othermastercommit is included. A rebase merge replays each of the pull request's commits. - It pushes
backport/<pr>-to-X.Y.xand opens a pull request againstrelease/X.Y.xthat links the original. That pull request runs the branch's normal CI checks and needs review. Merging it and publishing a patch remain separate maintainer decisions. - It comments on the original pull request with each new backport and each line that needs attention, then fails the run if any line does. Other labeled lines proceed independently.
- A rerun or a reapplied label reuses the existing backport pull request, open or closed. To rerun one pull request, dispatch Backport on
masterwith its number.
The workflow pushes and opens pull requests with DEPENDENCY_REFRESH_TOKEN from the dependency-refresh environment, because a pull request opened with GITHUB_TOKEN does not start CI. The job never checks out or runs code from the pull request head.
The report names what needs attention:
Missing branch. Cut
release/X.Y.x(step 1), then rerun.Missing or non-patch Changeset. A line ships only patch Changesets. If the fix still belongs on the line, backport it by hand (as for a conflict) and add a patch Changeset in that backport PR.
Already applied.
release/X.Y.xalready holds the change. Nothing was pushed.Conflict. The report names the target, the source commits, the conflicting files, and the failed run, and lists commits the line already has. Nothing is pushed and the target is unchanged. Finish the backport by hand on the same branch name, so that a later rerun reuses your pull request:
bashgit fetch origin git switch -c backport/<pr>-to-X.Y.x origin/release/X.Y.x # One pick per source commit listed in the report, in order. Add -m 1 # for a merge commit. git cherry-pick -x <source commit> # On a conflict: resolve it, keep the Changeset unchanged, then git cherry-pick --continue # If git reports the pick is empty, the line already has that commit: git cherry-pick --skip git push -u origin backport/<pr>-to-X.Y.xOpen the pull request against
release/X.Y.xand link the original.
Publish an approved version
- On the selected release branch, commit the exact versions and changelogs and complete the credential-free Release dry run. Pass the expected version explicitly. A patch from
release/X.Y.xisX.Y.1or later within that line. - After explicit maintainer authorization, dispatch Publish npm release on that branch with
expected_versionset to the version approved for all five packages. Review the rehearsal evidence and approve thenpm-releasedeployment when it pauses. - The publish job checks the commit, version, package names, and tarball hashes, then publishes with npm provenance.
masteruses npm'slatesttag. Arelease/X.Y.xbranch usesmaintenanceso it cannot movelatestoff the main line.scripts/publish-release.mjsrejects any other branch, a version from another line, andX.Y.0. Install a maintained line withnpm install @ghostvue/vue@0.2, or opt in to@ghostvue/vue@maintenancefor the most recent maintenance patch of any line. Use matching versions for the other packages. - The verification job waits for npm's install index, installs all five exact versions, and checks signatures and attestations. On success, the workflow creates a GitHub Release and a
vX.Y.Ztag at the published commit. The notes come from the package changelogs and link to npm and the verification run. A maintenance release leaves GitHub's latest release badge on the main line. - For a
masterrelease, Deploy GhostVue docs builds the same commit in GitHub Actions and publishes the staged site after smoke checks pass. A docs deployment failure leaves the npm packages and GitHub Release available.
Move a preview app to the npm release
An app that tried candidate archives keeps file: resolutions until it is moved to the registry. When the archives and the published release share a version, a plain npm install after editing package.json can leave package-lock.json pointing at the archives (seen with npm 10.9.9 during the 0.1.0 release). Re-resolve the GhostVue entries explicitly:
Install the exact published versions by name. This replaces the
file:specs and re-resolves the lockfile entries:bashnpm install --save-exact @ghostvue/vue@0.5.0 @ghostvue/themes@0.5.0Compare each GhostVue entry in
package-lock.jsonwith the registry. Bothresolvedandintegritymust match, because a matching version alone does not prove the package came from npm:bashnpm view @ghostvue/vue@0.5.0 dist.tarball dist.integrity --json node -e "const l = require('./package-lock.json'); for (const name of ['@ghostvue/vue', '@ghostvue/themes']) { const { resolved, integrity } = l.packages['node_modules/' + name]; console.log(name, resolved, integrity) }"resolvedmust be thehttps://registry.npmjs.org/...tarball URL, notfile:. Repeatnpm viewfor@ghostvue/themes.Delete the copied archives and
node_modules, run a cleannpm ci, and run the Vite build.
npm credentials
Configure npm Trusted Publishing for each of the five npm packages. Select GitHub Actions and enter zprue743, ghostvue, workflow filename release-publish.yml, and environment npm-release. Allow publishing and wait until the next release is ready to configure it. npm requires the first successful publish within two days of registration.
The protected publish job has OIDC permission. It can also use a short-lived granular NPM_TOKEN environment secret during the transition, while npm permits direct publishing with tokens. Scope a temporary token to the five packages, enable bypass 2FA, and revoke it after use. Delete its environment secret.
Recovery
If only part of the release uploads, rerun the failed publish job in the same run to reuse the exact tarballs. The job skips an existing package version only when the registry integrity and provenance match the evidence.
If verification or GitHub release creation fails after upload, retry that job in the same run. Check an existing tag or draft before retrying if it conflicts with the published commit. Record the run and package links in the release issue.
If the docs deployment fails, rerun the failed job or run
publish-latestfrom Deploy GhostVue docs. A retry of an older release job skips publishing once npmlatesthas moved on.
CI policy
The release workflow follows the CI policy: actions pinned by commit SHA, a read-only default token, and write or id-token scopes only on the job that needs them.