Skip to content

Lower nvm#3

Merged
mshriver merged 5 commits intoibutsu:mainfrom
mshriver:lower-nvm
Nov 21, 2025
Merged

Lower nvm#3
mshriver merged 5 commits intoibutsu:mainfrom
mshriver:lower-nvm

Conversation

@mshriver
Copy link
Contributor

@mshriver mshriver commented Nov 21, 2025

Summary by Sourcery

Standardize the project on Node.js 20 and introduce a tag-driven release and publishing flow.

New Features:

  • Add automated extraction of the version from git tags during the publish workflow to drive package versioning.

Enhancements:

  • Switch the package to use a development placeholder version in package.json that is replaced at publish time based on the release tag.
  • Document the full release process, including tagging, GitHub releases, and automated npm publication.

Build:

  • Update GitHub Actions workflows for build, test, and publish to run on Node.js 20 instead of Node.js 22 and align Codecov upload conditions with the new Node.js version.
  • Relax the Node.js engine requirement in package.json from >=22 to >=20 to match the updated workflows.

Documentation:

  • Add a RELEASE.md guide describing the release workflow, semantic versioning scheme, and troubleshooting steps.

Copilot AI review requested due to automatic review settings November 21, 2025 14:53
@sourcery-ai
Copy link

sourcery-ai bot commented Nov 21, 2025

Reviewer's Guide

Aligns the project and CI workflows to Node.js 20, introduces tag-driven dynamic versioning for releases, and documents the release process.

Sequence diagram for tag-driven publish workflow

sequenceDiagram
    actor "Maintainer" as Maintainer
    participant "Git" as Git
    participant "GitHub" as GitHub
    participant "GitHub Actions - publish.yml" as PublishWorkflow
    participant "Node.js Environment" as NodeEnv
    participant "NPM Registry" as NpmRegistry

    Maintainer->>Git: Create version tag (e.g., v0.0.2)
    Maintainer->>GitHub: Push tag to remote
    GitHub->>GitHub: Create GitHub release for tag
    GitHub-->>PublishWorkflow: Trigger publish.yml on release

    activate PublishWorkflow
    PublishWorkflow->>NodeEnv: Setup Node.js with version 20
    PublishWorkflow->>NodeEnv: Install dependencies with yarn install --frozen-lockfile
    PublishWorkflow->>PublishWorkflow: Extract version from GITHUB_REF (remove optional v prefix)
    PublishWorkflow->>NodeEnv: Run npm version <extracted version> --no-git-tag-version --allow-same-version
    PublishWorkflow->>NodeEnv: Run yarn test
    PublishWorkflow->>NodeEnv: Build package (using existing build step)
    PublishWorkflow->>NpmRegistry: Publish package with extracted version
    deactivate PublishWorkflow
Loading

File-Level Changes

Change Details Files
Standardize Node.js version to 20 across CI workflows and engines.
  • Update Node.js version from 22 to 20 in publish, tests, and build GitHub Actions workflows.
  • Adjust the test matrix and Codecov upload condition to refer to Node.js 20 instead of 22.
  • Relax the package.json engines.node requirement from >=22.0.0 to >=20.0.0.
.github/workflows/publish.yml
.github/workflows/tests.yaml
.github/workflows/build.yml
package.json
Implement tag-based dynamic versioning for npm publishes.
  • Change package.json version to a placeholder development value that is not meant for actual releases.
  • In the publish workflow, add a step to extract the version from the pushed Git tag, stripping a leading 'v' if present.
  • Add a step to update package.json at publish time using npm version with the extracted version, without creating git tags or requiring a version bump.
.github/workflows/publish.yml
package.json
Document the new release process based on tags and automated publishing.
  • Add RELEASE.md explaining the dynamic versioning model and how to cut a release via git tags and GitHub Releases.
  • Describe troubleshooting steps for failed releases and how to handle pre-release tags.
RELEASE.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey there - I've reviewed your changes - here's some feedback:

  • Consider keeping a .nvmrc file (or updating the existing one instead of removing it) in sync with the engines.node and workflow Node versions so local development uses the same Node.js version as CI and publish.
  • In the publish.yml workflow, you might want to guard the tag-based version extraction with a condition (e.g., only run on refs/tags/*) to avoid failures if the workflow is ever triggered from non-tag refs.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Consider keeping a `.nvmrc` file (or updating the existing one instead of removing it) in sync with the `engines.node` and workflow Node versions so local development uses the same Node.js version as CI and publish.
- In the `publish.yml` workflow, you might want to guard the tag-based version extraction with a condition (e.g., only run on `refs/tags/*`) to avoid failures if the workflow is ever triggered from non-tag refs.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Copy link

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 lowers the Node.js version requirement from 22 to 20 and introduces dynamic versioning for the package release process.

  • Reduced Node.js version requirement from >=22.0.0 to >=20.0.0 across all configuration files
  • Implemented dynamic versioning using Git tags (package.json version set to 0.0.0-development)
  • Added comprehensive release process documentation and automated version extraction in the publish workflow

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
package.json Updated engines.node to >=20.0.0 and changed version to 0.0.0-development for dynamic versioning
.nvmrc Changed Node.js version from 22 to 20
.github/workflows/tests.yaml Updated all Node.js version references to 20 for CI test jobs
.github/workflows/publish.yml Updated Node.js version to 20 and added steps to extract version from Git tags and update package.json dynamically
.github/workflows/build.yml Updated Node.js version to 20 for build jobs
RELEASE.md Added comprehensive documentation for the release process including Git tagging, versioning, and troubleshooting

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov
Copy link

codecov bot commented Nov 21, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.43%. Comparing base (3958848) to head (9230a8e).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main       #3      +/-   ##
==========================================
+ Coverage   92.21%   92.43%   +0.21%     
==========================================
  Files           4        4              
  Lines         244      251       +7     
  Branches       69       61       -8     
==========================================
+ Hits          225      232       +7     
  Misses         19       19              
Flag Coverage Δ
unittests 92.43% <100.00%> (+0.21%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/config.ts 100.00% <100.00%> (ø)
src/types.ts 82.25% <ø> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3958848...9230a8e. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mshriver mshriver merged commit 79055b9 into ibutsu:main Nov 21, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants