Skip to content

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 a repository that matches this GitHub repository (npm provenance rejects a mismatch).
  • Every @ghostvue/* entry in a publishable package's dependencies, peerDependencies, or optionalDependencies uses workspace:^, 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.json puts the five publishable packages in one fixed group, so they always share a version: a minor Changeset for any one of them bumps all five. tests/integration/release-dry-run.test.ts simulates 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: write for provenance. Actions are pinned by commit SHA per the CI policy.

Release dry run ​

bash
pnpm build
pnpm release:dry-run --expect-version 0.1.0

scripts/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:

  1. checks the source manifest invariants above;
  2. uses a scratch copy to apply pending Changesets or read the committed release versions and changelogs;
  3. packs the package with pnpm pack, which applies files and rewrites workspace:^ to a caret range;
  4. 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 private from that temporary copy only;
  5. runs npm pack and npm publish --dry-run on 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 bare multiple attribute, and the native fieldset and input group recipes), whose submitted FormData is checked after selecting, resetting, disabling, and clearing. It is set up as Getting started documents: it imports only @ghostvue/themes/calm.css, never default.css. The production build must emit the base @layer ghostvue-theme recipes that the @ghostvue/themes entry 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 invalid Ghost* 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.

  1. Get the archives. Locally they are in reports/release-dry-run/tarballs/. From CI, download the release-dry-run-evidence artifact of the Release dry run run and open its tarballs/ folder. Each package has one archive, such as ghostvue-vue-0.5.0.tgz.

  2. 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 a src/main.js that mounts your App.vue, then install vue, vite, and @vitejs/plugin-vue.

  3. Copy the headless archive into the app folder and install it:

    bash
    npm install ./ghostvue-vue-0.5.0.tgz

    npm records "@ghostvue/vue": "file:ghostvue-vue-0.5.0.tgz". Import components from @ghostvue/vue and run npm run build.

  4. For themed imports, copy the matching themes archive and install it after the headless one. @ghostvue/themes declares @ghostvue/vue as a peer, and an unpublished version can only come from the archive already installed:

    bash
    npm install ./ghostvue-themes-0.5.0.tgz

    Then switch imports to @ghostvue/themes, import one palette such as @ghostvue/themes/calm.css as Getting started shows, and build again. npm ls @ghostvue/vue should 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 the release-dry-run-evidence artifact. 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 no id-token: write. This approval job is skipped when the publish workflow calls the rehearsal.

First release checklist ​

  • [x] Scope ownership. The @ghostvue scope is owned by the maintainer's npm user account ghostvue (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: true in scripts/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.0 in all five manifests and changelogs. The release rehearsal checks the exact version.
  • [x] Packaging metadata. publishConfig (public access, provenance) and repository.directory added 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:packed and pnpm mcp:packed exercise 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.json and https://ghostvue.dev/schemas/v1/manifest-collection.schema.json, served from byte-identical copies in docs/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-run of staged tarballs with evidence uploaded as a workflow artifact.
  • [x] Approval gate. The maintainer-approval job uses the npm-release environment. The separate publish job also uses this environment.
  • [x] Environment reviewers. The npm-release environment has a required reviewer and allows deployments from master.
  • [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 generated 0.1.0 changelog previews in the evidence artifact. Repeat the dry run on the final 0.1.0 release 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.0 and 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.

  1. Cut release/X.Y.x from the vX.Y.0 tag. The publish workflow runs from the branch's own copy, so if that tag predates the commit that accepts any release/X.Y.x branch in .github/workflows/release-publish.yml and scripts/publish-release.mjs, backport that commit first. Carry over only the selected fixes and release tooling.
  2. In Settings → Environments → npm-release → Deployment branches and tags, allow the exact branch release/X.Y.x in addition to master. Each maintenance branch needs its own entry. Keep the required reviewers. Require PR and CI checks for the maintenance branch before accepting fixes there.
  3. Create the label backport:X.Y.x for the new line, for example backport:0.2.x for release/0.2.x. See Backport a fix.
  4. Use a patch Changeset for a package fix. Backport each selected fix from master with its label, or by hand with git cherry-pick -x so that its Changeset comes with it, and target the backport PR at release/X.Y.x. After the backport PRs land, run pnpm changeset version in 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 -x onto release/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 if master has consumed it since. No other master commit is included. A rebase merge replays each of the pull request's commits.
  • It pushes backport/<pr>-to-X.Y.x and opens a pull request against release/X.Y.x that 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 master with 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.x already 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:

    bash
    git 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.x

    Open the pull request against release/X.Y.x and link the original.

Publish an approved version ​

  1. 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.x is X.Y.1 or later within that line.
  2. After explicit maintainer authorization, dispatch Publish npm release on that branch with expected_version set to the version approved for all five packages. Review the rehearsal evidence and approve the npm-release deployment when it pauses.
  3. The publish job checks the commit, version, package names, and tarball hashes, then publishes with npm provenance. master uses npm's latest tag. A release/X.Y.x branch uses maintenance so it cannot move latest off the main line. scripts/publish-release.mjs rejects any other branch, a version from another line, and X.Y.0. Install a maintained line with npm install @ghostvue/vue@0.2, or opt in to @ghostvue/vue@maintenance for the most recent maintenance patch of any line. Use matching versions for the other packages.
  4. 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.Z tag 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.
  5. For a master release, 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:

  1. Install the exact published versions by name. This replaces the file: specs and re-resolves the lockfile entries:

    bash
    npm install --save-exact @ghostvue/vue@0.5.0 @ghostvue/themes@0.5.0
  2. Compare each GhostVue entry in package-lock.json with the registry. Both resolved and integrity must match, because a matching version alone does not prove the package came from npm:

    bash
    npm 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) }"

    resolved must be the https://registry.npmjs.org/... tarball URL, not file:. Repeat npm view for @ghostvue/themes.

  3. Delete the copied archives and node_modules, run a clean npm 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-latest from Deploy GhostVue docs. A retry of an older release job skips publishing once npm latest has 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.