Conversation
Co-authored-by: noahwc <7761715+noahwc@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR adds the changesets tool to the mint-components package to automate version management and changelog generation. The setup includes configuration files, npm scripts for creating changesets and publishing releases, and a GitHub Actions workflow to automate the release process when changes are merged to main.
Key Changes:
- Added changesets dependencies and configuration
- Created npm scripts for version management workflow
- Added GitHub Actions workflow for automated releases
- Documented the changeset workflow in the README
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/mint-components/package.json | Added changesets dependencies and npm scripts for managing versions and releases |
| packages/mint-components/.changeset/config.json | Configured changesets with GitHub changelog integration and baseBranch set to "master" |
| packages/mint-components/.changeset/README.md | Auto-generated documentation about using changesets |
| packages/mint-components/readme.md | Added comprehensive documentation about the changeset workflow and release process |
| .github/workflows/mint-components-merge-to-main.yml | Created GitHub Actions workflow to automate version bumps and npm publishing |
Files not reviewed (1)
- packages/mint-components/package-lock.json: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 6 changed files in this pull request and generated 7 comments.
Files not reviewed (1)
- packages/mint-components/package-lock.json: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| When changesets are merged to the `main` branch, the GitHub Actions workflow will automatically: | ||
|
|
||
| 1. Create or update a "Version Packages" pull request that: | ||
| - Bumps the version in `package.json` | ||
| - Updates `CHANGELOG.md` with all changeset summaries | ||
| - Removes the processed changeset files | ||
|
|
||
| 2. When you're ready to release, simply **merge the "Version Packages" PR** to `main` |
There was a problem hiding this comment.
This section states releases happen after changesets are merged to the main branch, but the changeset config and new workflow are set up for master as the base branch. Align the documentation with the actual release branch to avoid contributors targeting the wrong branch.
| When changesets are merged to the `main` branch, the GitHub Actions workflow will automatically: | |
| 1. Create or update a "Version Packages" pull request that: | |
| - Bumps the version in `package.json` | |
| - Updates `CHANGELOG.md` with all changeset summaries | |
| - Removes the processed changeset files | |
| 2. When you're ready to release, simply **merge the "Version Packages" PR** to `main` | |
| When changesets are merged to the `master` branch, the GitHub Actions workflow will automatically: | |
| 1. Create or update a "Version Packages" pull request that: | |
| - Bumps the version in `package.json` | |
| - Updates `CHANGELOG.md` with all changeset summaries | |
| - Removes the processed changeset files | |
| 2. When you're ready to release, simply **merge the "Version Packages" PR** to `master` |
| x.y.z-prerelease_number | ||
| ``` | ||
|
|
||
| For example: `1.2.3-prerelease_1`, `1.2.3-prerelease_2`, etc. |
There was a problem hiding this comment.
The prerelease version format shown (x.y.z-prerelease_number, e.g. 1.2.3-prerelease_1) is not valid SemVer because _ is not allowed in prerelease identifiers. Use a SemVer-valid format such as 1.2.3-prerelease.1 (or 1.2.3-prerelease-1).
| x.y.z-prerelease_number | |
| ``` | |
| For example: `1.2.3-prerelease_1`, `1.2.3-prerelease_2`, etc. | |
| x.y.z-prerelease.number |
For example: 1.2.3-prerelease.1, 1.2.3-prerelease.2, etc.
| name: mint-components merge to master branch | ||
| on: | ||
| push: | ||
| branches: [master] | ||
| paths: | ||
| - "packages/mint-components/**" | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| id-token: write | ||
| contents: write | ||
| packages: write | ||
| pull-requests: write | ||
| issues: read | ||
|
|
||
| jobs: | ||
| deploy_storybook: | ||
| runs-on: ubuntu-latest | ||
| name: Deploy Storybook to Github Pages | ||
| defaults: | ||
| run: | ||
| working-directory: packages/mint-components | ||
| steps: |
There was a problem hiding this comment.
Workflow file/path and job naming are inconsistent with what it actually does: the filename is mint-components-merge-to-main.yml but it triggers on master, and the job is named deploy_storybook / "Deploy Storybook to Github Pages" even though there are no GitHub Pages deployment steps. Renaming these to reflect the release/changesets purpose will make future maintenance/troubleshooting easier.
| jobs: | ||
| deploy_storybook: | ||
| runs-on: ubuntu-latest | ||
| name: Deploy Storybook to Github Pages |
There was a problem hiding this comment.
Use consistent capitalization: "Github" should be "GitHub" in the job name.
| name: Deploy Storybook to Github Pages | |
| name: Deploy Storybook to GitHub Pages |
| - name: Create Release Pull Request or Publish to npm | ||
| id: changesets | ||
| uses: changesets/action@v1 | ||
| with: | ||
| # Runs `npm i` after changeset to make sure that `package-lock.json` files are also updated | ||
| # Without this change only `package.json` files are updated, without `package-lock.json` changes. | ||
| version: npm run version | ||
| # Runs changesets on publish - will create tags and deploy to NPM | ||
| publish: npm run release | ||
| title: "mint-components - Version Packages" |
There was a problem hiding this comment.
The changesets/action step will execute from the repository root (GitHub Actions defaults.run.working-directory does not apply to uses: steps). Since this repo root has no package.json, version: npm run version / publish: npm run release will fail. Update the commands to cd packages/mint-components && ... or configure the action's supported cwd/workingDirectory input (if available) so it runs within packages/mint-components.
| with: | ||
| ref: ${{ github.head_ref }} |
There was a problem hiding this comment.
actions/checkout is configured with ref: ${{ github.head_ref }}, but github.head_ref is empty for push events. This can cause the workflow to check out the wrong ref or fail. Prefer omitting ref (defaults to github.sha) or set it to ${{ github.ref }} / ${{ github.sha }} for push workflows.
| with: | |
| ref: ${{ github.head_ref }} |
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} |
There was a problem hiding this comment.
NODE_AUTH_TOKEN is set to secrets.GITHUB_TOKEN, which is not a valid authentication token for publishing to the public npm registry. Either remove NODE_AUTH_TOKEN (if using npm trusted publishing/OIDC) or set it to an npm token secret (commonly NPM_TOKEN) and ensure setup-node is configured for the npm registry.
|
Jayden Chan (@jayden-chan), wondering if we want to reconcile this with the current |
None of the features in changesets are necessary for those packages, so in my opinion it's definitely not worth adding another external dependency and increasing our attack surface area just for the sake of consistency. If you want to take on the responsibility of implementing and maintaining changesets for those packages then you are welcome to, but I do not see the value and most likely won't be doing it myself. |
Overview
This PR adds and configures the changesets tool to the
packages/mint-componentspackage to streamline version management and changelog generation.Changes
Dependencies
@changesets/cli(v2.29.7) as a dev dependencyConfiguration
.changesetdirectory with configuration files:config.json: Configured for public npm package publishing withmasteras the base branchREADME.md: Auto-generated documentation about using changesetsScripts
Added three npm scripts for managing releases:
npm run changeset- Create a new changeset interactivelynpm run version- Apply changesets and update package version/CHANGELOGnpm run release- Publish the package to npmUsage
When making changes to mint-components:
Create a changeset to document your changes:
This prompts you to select the change type (patch/minor/major) and provide a summary.
Version the package when ready to release:
This consumes all pending changesets and updates
package.jsonandCHANGELOG.md.Publish to npm:
Benefits
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
googlechromelabs.github.ionode install.mjs(dns block)https://storage.googleapis.com/chrome-for-testing-public/125.0.6422.78/linux64/chrome-headless-shell-linux64.zipnode install.mjs(http block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.