Skip to content

chore: configure release tooling for @brutils/core#3

Open
youphenrique wants to merge 4 commits into
mainfrom
codex/install-and-configure-release-tooling
Open

chore: configure release tooling for @brutils/core#3
youphenrique wants to merge 4 commits into
mainfrom
codex/install-and-configure-release-tooling

Conversation

@youphenrique
Copy link
Copy Markdown
Owner

Motivation

  • Add a reproducible, conventional-commits based release process for the @brutils/core package using Changesets and release-it and detect unused exports/deps with knip.
  • Replace the old bumpp workflow with a CI-driven Changesets publishing flow and add automation to generate changelogs and GitHub releases.
  • Provide CI and release GitHub Actions so versioning/publishing can be performed from merges to main and to ensure builds/tests run on PRs and merges.

Description

  • Added workspace dev dependencies and scripts in package.json to support Changesets, release-it, and knip, and added a typecheck helper script for CI (changeset, version-packages, release, knip).
  • Removed bumpp from packages/core/package.json devDependencies and ensured the package still builds with tsdown and has exports/main/module/types configured.
  • Added Changesets configuration and an initial major changeset at .changeset/config.json and .changeset/initial-v1-release.md to represent the v1.0.0 breaking release.
  • Added .release-it.json and knip.json to the repository root and added GitHub Actions workflows at .github/workflows/ci.yml and .github/workflows/release.yml to run CI checks and open/publish Changesets-based releases.

Testing

  • Ran pnpm lint which succeeded (oxlint reported 0 warnings/errors).
  • Ran pnpm --filter @brutils/core build which succeeded and produced dist/ artifacts via tsdown.
  • Attempted pnpm install and pnpm add -D for 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 -- --run at the repo root failed because the vitest binary is not available in the root environment (missing install of newly added dev deps).
  • pnpm knip and pnpm changeset status could not be executed locally because the required binaries were not installed due to the registry/proxy error.

Codex Task

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +5 to +6
tags:
- "v*"
Copy link

Copilot AI Mar 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
tags:
- "v*"
branches:
- main
workflow_dispatch:

Copilot uses AI. Check for mistakes.
"@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.
Copy link

Copilot AI Mar 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Suggested change
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.

Copilot uses AI. Check for mistakes.
Comment thread .github/workflows/ci.yml

- run: pnpm lint
- run: pnpm typecheck
- run: pnpm test -- --run
Copy link

Copilot AI Mar 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
- run: pnpm test -- --run
- run: pnpm test

Copilot uses AI. Check for mistakes.
Comment thread .release-it.json
}
},
"hooks": {
"before:init": ["pnpm lint", "pnpm test -- --run"],
Copy link

Copilot AI Mar 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
"before:init": ["pnpm lint", "pnpm test -- --run"],
"before:init": ["pnpm lint", "pnpm test"],

Copilot uses AI. Check for mistakes.
Comment thread .release-it.json
Comment on lines +2 to +14
"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}"
},
Copy link

Copilot AI Mar 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Copilot uses AI. Check for mistakes.
@youphenrique
Copy link
Copy Markdown
Owner Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants