Skip to content
Contributor documentation: how the project is built and released. Not needed to use the library.

Releasing

This package publishes from GitHub Actions when a v* tag is pushed.

This package intends to stay on 0.x indefinitely — there is no planned 1.0.0 (“ZeroVer”). Staying pre-1.0 keeps iteration cheap and avoids the implicit “frozen forever” contract a 1.0.0 signals. A 1.0.0 is only on the table if the API surface genuinely stabilizes for a broad external audience.

We follow standard semver within 0.x to choose the bump direction (this matches changelogen’s conventional-commit inference). The resulting version is still passed explicitly via -r <version> at release time — see Pre-1.0 Versions for why.

Change Bump Example Conventional commit
New feature, backward compatible minor 0.4.0 → 0.5.0 feat:
Bug fix, backward compatible patch 0.4.0 → 0.4.1 fix:
Breaking change minor + flag 0.4.0 → 0.5.0 feat!: / fix!: / BREAKING CHANGE: footer

Always flag breaking changes with a ! (feat!:) or a BREAKING CHANGE: commit footer. changelogen renders them under a ⚠️ Breaking Changes heading in the CHANGELOG and they surface in the GitHub release notes — that is how consumers are warned.

Caveat (accepted): because a breaking change lands as a 0.x minor, a ^0.x range will still upgrade across it (the classic ^0.x footgun). The primary consumers here pin exact versions (e.g. catalog versioning), so this is acceptable; anyone wanting hard protection should pin ~0.x. If the package ever gains many external ^-pinning consumers, switch to the caret-protective “0ver” convention (breaking → minor, everything else → patch) at that point.

Note: the ⚠️ heading changelogen emits can have a double space after the emoji that oxfmt rewrites — after a breaking release run bun run format and commit the CHANGELOG fix so format:check stays green (the publish workflow is unaffected, but the main CI runs format:check).

.github/workflows/ci.yml runs on pushes and pull requests to main:

  • bun install
  • bunx playwright install --with-deps chromium
  • bun run lint
  • bun run format:check
  • npx tsc --noEmit
  • bun run test
  • bun run build

.github/workflows/publish.yml runs on pushed tags matching v*:

  • bun install
  • bunx playwright install --with-deps chromium
  • bun run test
  • bun run build
  • npm publish --provenance --access public
  • gh release create <tag> --generate-notes || echo "Release already exists"

npm auth is trusted publishing (OIDC), with no NPM_TOKEN secret: npmjs.com trusts this repository’s publish.yml, set up once with

Terminal window
npm trust github @xtandard/lib --repo xantiagoma/xtandard --file publish.yml

(or in the package’s settings on npmjs.com). It needs npm 11.5.1 or later, which the workflow gets from Node 24. GitHub release creation uses the workflow GITHUB_TOKEN.

If the publish step fails after the tag is pushed, fix the cause and publish the same tag again from the workflow’s manual trigger (no new tag needed):

Terminal window
gh workflow run publish.yml -f tag=v0.6.0
  1. Ensure all feature/fix changes are already committed.
  2. Run local validation:
Terminal window
bun run format
bun run check
bun run test
bun run build
npm pack --dry-run
  1. Create the release commit and tag with an explicit version:
Terminal window
bunx changelogen --release -r 0.2.0 --push --no-open

Replace 0.2.0 with the intended version.

  1. Watch GitHub Actions:
Terminal window
gh run list --limit 5
gh run watch <run-id>
  1. Confirm npm and GitHub release state:
Terminal window
npm view @xtandard/lib version
gh release list --limit 5

Do not use --minor to create a 0.x minor release. Changelogen follows pre-1.0 semver behavior and may convert a minor bump such as 0.2.0 into the next patch, e.g. 0.1.3.

Use an explicit version instead:

Terminal window
bunx changelogen --release -r 0.2.0 --push --no-open

The package script bun run release uses automatic bump detection. Use it only when the inferred version is acceptable. For planned minor releases, prefer the explicit -r <version> command above.

If a wrong tag is pushed but npm has not published it yet:

Terminal window
gh run list --workflow Publish --limit 5
gh run cancel <publish-run-id>
git tag -d v0.1.3
git push origin :refs/tags/v0.1.3

Then create the intended release with an explicit version.

If npm has already published the wrong version, do not delete or rewrite it. Publish a new corrected version instead.

Run bun run recs:check before a release. Besides the recommended libraries, it checks this package’s own peerDependencies and warns when npm’s latest is above a peer range: a prerelease of a new major (track it) or a new stable major (test it and widen the range).

Tracked now:

  • unstorage 2.0. npm’s latest is 2.0.0-beta.0; the peer stays ^1.14.4 while 2.x is beta. When 2.0 is stable, test @xtandard/lib/unstorage against it, widen the peer to ^1.14.4 || ^2.0.0 (and the devDependency), and drop the unstorage@^1 notes from the unstorage integration page and the recommendation’s caveat in recs/libraries.ts.

  • effect 3 → 4. The peer is ^3.10.0 || ^4.0.0. Effect 4 changed the Schema API, so one source can’t serve both: @xtandard/lib/effect and @xtandard/lib/filters/effect are built on effect 3 (the effect devDependency), and @xtandard/lib/effect/v4 and @xtandard/lib/filters/effect/v4 on effect 4 (sources src/*-v4.ts import the effect-v4 devDependency alias, which the build remaps to effect; scripts/check-dist.ts guards it). At the next breaking release, flip it: move the -v4 sources into /effect and /filters/effect (importing effect), drop the /v4 entries, the effect 3 sources and the effect-v4 alias, and set the peer and devDependency to ^4.

package.json controls published files. Keep docs in the files list because the README links to docs/PAGINATION.md and docs/sync-async-adaptive.md.

Before publishing, verify package contents:

Terminal window
npm pack --dry-run --json