Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
This adds a new `--formatter` option, which can be set to either "prettier" or "oxfmt", and deprecates the `--prettier` option. I've also refactored the logic to load Prettier dynamically, so both Oxfmt and Prettier are now _optional_ peer dependencies. Tested in `MetaMask/core`: - MetaMask/core#8442 <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Moderate risk: changes CLI flags and formatting behavior via dynamic imports, which could affect consumers relying on the deprecated `--prettier` flag or missing optional peer deps at runtime. > > **Overview** > Adds a new `--formatter` CLI option to choose changelog formatting (`prettier` or `oxfmt`, with `none` for `validate`) and deprecates the legacy `--prettier` flag (which still takes precedence when provided). > > Refactors changelog formatting to route through new `src/formatters.ts` helpers that dynamically import Prettier/Oxfmt and throw clearer errors when the chosen formatter isn’t installed, and updates tests and package metadata to treat `prettier`/`oxfmt` as *optional* peer dependencies. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit b0fc35a. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
4cb9678 to
9756ff8
Compare
| "build:types": "tsc --build tsconfig.build.json --verbose", | ||
| "changelog:update": "yarn workspaces foreach --all --no-private --parallel --interlaced --verbose run changelog:update", | ||
| "changelog:validate": "yarn workspaces foreach --all --no-private --parallel --interlaced --verbose run changelog:validate", | ||
| "create-release-branch": "create-release-branch --formatter oxfmt", |
There was a problem hiding this comment.
This overrides the binary create-release-branch when running yarn create-release-branch, but Yarn is still able to resolve the actual binary in the script. It's a bit hacky though, so we may also want to consider creating a script with a different name (yarn create-release?).
There was a problem hiding this comment.
Hmm... good point.
I'd hate to have two different commands to do the same thing. I feel like that would be confusing. Maybe we should give create-release-branch the ability to read from a createReleaseBranch property in package.json, and we can set formatter there instead of using a command-line option?
There was a problem hiding this comment.
Was thinking about having a config option as well. We already have release.config.json, so maybe it makes sense to add the option there, and have auto-changelog and create-release-branch read from that?
Do you think we should do that before merging this?
There was a problem hiding this comment.
True, we do have that config file. It's currently used by action-publish-release, but we could certainly reuse it for this purpose.
Do you think we should do that before merging this?
I was thinking we would at first, but perhaps we don't have to. I guess hardly anyone uses yarn exec create-release-branch to run this tool; it's more likely they use yarn create-release-branch (and I believe this is what we advise in the release instructions anyway). So maybe it would only be confusing for us.
I do think it would be a good idea for create-release-branch to read formatter from a config file so we wouldn't need this line, but maybe having a "hack" for now isn't so bad.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit b9e7abd. Configure here.

Explanation
This updates changelog validation to use Oxfmt instead of Prettier.
References
Checklist
Note
Low Risk
Primarily build/lint tooling and dependency bumps; no runtime/controller logic changes, with only minor risk of CI/release automation differences due to formatter changes.
Overview
Updates changelog automation to use Oxfmt instead of Prettier by passing
--formatter oxfmtinscripts/update-changelog.shandscripts/validate-changelog.sh, and by wiringcreate-release-branchto use the same formatter.Bumps
@metamask/auto-changelogto^6.1.0across packages (and updates@metamask/create-release-branch), removes changelog-specific lint steps from some packages, and tweaks.oxfmtrc.json/lint:miscso Oxfmt is the primary formatter and changelogs are no longer specially ignored.Reviewed by Cursor Bugbot for commit da6cf29. Bugbot is set up for automated code reviews on this repo. Configure here.