chore: configure release tooling for @brutils/core#3
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces a Changesets-based release/versioning setup for @brutils/core, adds CI automation (lint/typecheck/test/knip/build), and wires in tooling for release automation (Changesets, release-it, and Vitest coverage configuration).
Changes:
- Add Vitest root config + workspace test scripts, including coverage support.
- Add Changesets configuration (including an initial changeset) and Knip config.
- Add GitHub Actions workflows for CI and release/publish automation.
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
vitest.config.ts |
Adds shared Vitest + coverage configuration for workspace tests. |
package.json |
Adds scripts/devDeps for Changesets, release-it, Knip, and Vitest coverage. |
packages/core/package.json |
Removes bumpp, adjusts test scripts (run/watch/coverage). |
knip.json |
Configures unused exports/deps detection for the workspace/core package. |
.release-it.json |
Adds release-it configuration for tagging/changelog/GitHub release. |
.github/workflows/ci.yml |
Adds CI pipeline running lint/typecheck/tests/knip/build. |
.github/workflows/release.yml |
Adds release workflow using changesets/action + npm publish. |
.changeset/config.json |
Adds Changesets configuration (GitHub changelog integration). |
.changeset/initial-v1-release.md |
Adds an initial changeset intended to represent the v1 release. |
pnpm-lock.yaml |
Locks new tooling dependencies (Changesets, release-it, Knip, Vitest/coverage). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| tags: | ||
| - "v*" |
There was a problem hiding this comment.
The release workflow is triggered only on tag pushes ("v*") but uses changesets/action to create a version PR or publish. changesets/action is designed to run on pushes to the base branch (typically main) so it can open/update the version PR; running it on a tag ref will not be able to create a PR and can break the release flow. Consider triggering this workflow on push to main (and optionally workflow_dispatch), and keep tag creation/publishing inside that flow instead of relying on tag pushes.
| tags: | |
| - "v*" | |
| branches: | |
| - main | |
| workflow_dispatch: |
| "@brutils/core": major | ||
| --- | ||
|
|
||
| Initial v1.0.0 release with breaking changes from the 0.x API. This is a rewrite of the library in TypeScript with an ESM-only module system. |
There was a problem hiding this comment.
This changeset marks @brutils/core for a major bump to represent the initial v1 release, but packages/core/package.json already has version 1.0.0. Applying this changeset would bump to 2.0.0, which doesn't match the intent of an initial v1.0.0 release. Either remove this changeset, or adjust package versioning so the first Changesets run results in 1.0.0 (e.g., start from 0.x before applying a major bump).
| Initial v1.0.0 release with breaking changes from the 0.x API. This is a rewrite of the library in TypeScript with an ESM-only module system. | |
| Major release with breaking changes from the 0.x API. This is a rewrite of the library in TypeScript with an ESM-only module system. |
|
|
||
| - run: pnpm lint | ||
| - run: pnpm typecheck | ||
| - run: pnpm test -- --run |
There was a problem hiding this comment.
pnpm test -- --run will execute the root test script (vitest run) with an extra --run argument, resulting in vitest run --run. This extra flag is redundant and may fail depending on Vitest CLI parsing. Prefer running just pnpm test here, or change the test script to vitest --run and keep CI invoking pnpm test without additional args.
| - run: pnpm test -- --run | |
| - run: pnpm test |
| } | ||
| }, | ||
| "hooks": { | ||
| "before:init": ["pnpm lint", "pnpm test -- --run"], |
There was a problem hiding this comment.
The release-it hook runs pnpm test -- --run, which (given the root test script is vitest run) becomes vitest run --run. This is redundant and can be fragile if the CLI doesn't accept --run with the run subcommand. Prefer pnpm test (or adjust the test script) so the hook executes a single, well-defined test command.
| "before:init": ["pnpm lint", "pnpm test -- --run"], | |
| "before:init": ["pnpm lint", "pnpm test"], |
| "git": { | ||
| "commitMessage": "chore: release @brutils/core v${version}", | ||
| "tagName": "v${version}", | ||
| "tagAnnotation": "Release @brutils/core v${version}", | ||
| "requireCleanWorkingDir": true, | ||
| "requireBranch": "main", | ||
| "push": true | ||
| }, | ||
| "npm": false, | ||
| "github": { | ||
| "release": true, | ||
| "releaseName": "v${version}" | ||
| }, |
There was a problem hiding this comment.
This release-it config is set up to create version commits and tags on main (and create a GitHub release), while the repository is also introducing a Changesets-driven versioning/publishing workflow. Having two independent version/tagging mechanisms is likely to cause drift (e.g., tags/CHANGELOG generated by release-it not matching versions produced by Changesets). Consider consolidating on a single source of truth for versioning (preferably Changesets if that’s the chosen flow) and configuring/removing release-it accordingly (e.g., disable version bumping/tagging if you keep it only for GitHub release creation).
Motivation
@brutils/corepackage using Changesets andrelease-itand detect unused exports/deps withknip.bumppworkflow with a CI-driven Changesets publishing flow and add automation to generate changelogs and GitHub releases.mainand to ensure builds/tests run on PRs and merges.Description
package.jsonto support Changesets,release-it, andknip, and added atypecheckhelper script for CI (changeset,version-packages,release,knip).bumppfrompackages/core/package.jsondevDependencies and ensured the package still builds withtsdownand hasexports/main/module/typesconfigured..changeset/config.jsonand.changeset/initial-v1-release.mdto represent the v1.0.0 breaking release..release-it.jsonandknip.jsonto the repository root and added GitHub Actions workflows at.github/workflows/ci.ymland.github/workflows/release.ymlto run CI checks and open/publish Changesets-based releases.Testing
pnpm lintwhich succeeded (oxlintreported 0 warnings/errors).pnpm --filter @brutils/core buildwhich succeeded and produceddist/artifacts viatsdown.pnpm installandpnpm add -Dfor new dev dependencies but this was blocked by the environment registry/proxy (ERR_PNPM_FETCH_403) so workspace dependency installation could not complete.pnpm test -- --runat the repo root failed because thevitestbinary is not available in the root environment (missing install of newly added dev deps).pnpm knipandpnpm changeset statuscould not be executed locally because the required binaries were not installed due to the registry/proxy error.Codex Task