Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"$schema": "https://unpkg.com/@changesets/config@3/schema.json",
"changelog": [
"@changesets/changelog-github",
{ "repo": "youphenrique/brutils" }
],
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
5 changes: 5 additions & 0 deletions .changeset/initial-v1-release.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@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.
32 changes: 32 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]

concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true

jobs:
ci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v4

- uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
cache: pnpm

- run: pnpm install

- 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.
- run: pnpm knip
- run: pnpm --filter @brutils/core build
43 changes: 43 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Release

on:
push:
tags:
- "v*"
Comment on lines +5 to +6
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.

concurrency:
group: release-${{ github.ref }}
cancel-in-progress: false

permissions:
contents: write
pull-requests: write
id-token: write

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v4

- uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
cache: pnpm
registry-url: "https://registry.npmjs.org"

- run: pnpm install
- run: pnpm --filter @brutils/core build

- name: Create Release PR or Publish
id: changesets
uses: changesets/action@v1
with:
version: pnpm version-packages
publish: pnpm --filter @brutils/core exec npm publish --provenance --access public
commit: "chore: version packages"
title: "chore: version packages"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36 changes: 36 additions & 0 deletions .release-it.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"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}"
},
Comment on lines +2 to +14
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.
"plugins": {
"@release-it/conventional-changelog": {
"preset": {
"name": "conventionalcommits",
"types": [
{ "type": "feat", "section": "Features" },
{ "type": "fix", "section": "Bug Fixes" },
{ "type": "perf", "section": "Performance" },
{ "type": "refactor", "section": "Refactors" },
{ "type": "docs", "section": "Documentation" },
{ "type": "test", "hidden": true },
{ "type": "chore", "hidden": true }
]
},
"infile": "CHANGELOG.md"
}
},
"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.
"after:bump": "pnpm --filter @brutils/core build"
}
}
15 changes: 15 additions & 0 deletions knip.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"$schema": "https://unpkg.com/knip@latest/schema.json",
"workspaces": {
".": {
"ignoreDependencies": [
"@changesets/changelog-github"
]
},
"packages/core": {
"entry": ["src/index.ts"],
"project": ["src/**/*.ts"],
"ignore": ["dist/**"]
}
}
}
18 changes: 16 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,31 @@
},
"scripts": {
"test": "vitest run",
"test:watch": "vitest",
"test:coverage": "vitest run --coverage",
"format": "turbo run format",
"format:fix": "oxfmt --write",
"lint": "oxlint",
"lint:fix": "oxlint --fix"
"lint:fix": "oxlint --fix",
"changeset": "changeset",
"version-packages": "changeset version",
"release": "release-it",
"knip": "knip",
"typecheck": "pnpm --filter @brutils/core typecheck"
},
"keywords": [],
"license": "MIT",
"packageManager": "pnpm@10.27.0",
"devDependencies": {
"@changesets/changelog-github": "^0.5.1",
"@changesets/cli": "^2.29.7",
"@release-it/conventional-changelog": "^10.0.1",
"@vitest/coverage-v8": "^4.0.18",
"knip": "^5.62.0",
"oxfmt": "^0.35.0",
"oxlint": "^1.50.0",
"turbo": "^2.8.10"
"release-it": "^19.0.4",
"turbo": "^2.8.10",
"vitest": "^4.0.18"
}
}
5 changes: 3 additions & 2 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,14 @@
"scripts": {
"build": "tsdown",
"dev": "tsdown --watch",
"test": "vitest",
"test": "vitest run",
"test:watch": "vitest",
"test:coverage": "vitest run --coverage",
"typecheck": "tsc --noEmit",
"prepublishOnly": "pnpm run build"
},
"devDependencies": {
"@types/node": "^25.0.3",
"bumpp": "^10.4.1",
"tsdown": "^0.20.3",
"typescript": "^5.9.3",
"vitest": "^4.0.18"
Expand Down
Loading