Skip to content

build: migrate to oxfmt#7016

Open
TheAlexLichter wants to merge 4 commits intonetlify:mainfrom
TheAlexLichter:build/oxfmt
Open

build: migrate to oxfmt#7016
TheAlexLichter wants to merge 4 commits intonetlify:mainfrom
TheAlexLichter:build/oxfmt

Conversation

@TheAlexLichter
Copy link
Copy Markdown
Contributor

🎉 Thanks for submitting a pull request! 🎉

Summary

Fixes #7015

Faster formatting goes brrrrr


For us to review and ship your PR efficiently, please perform the following steps:

  • Open a bug/issue before writing your code 🧑‍💻. This ensures
    we can discuss the changes and get feedback from everyone that should be involved. If you`re fixing a typo or
    something that`s on fire 🔥 (e.g. incident related), you can skip this step.
  • Read the contribution guidelines 📖. This ensures
    your code follows our style guide and passes our tests.
  • Update or add tests (if any source code was changed or added) 🧪
  • Update or add documentation (if features were changed or added) 📝
  • Make sure the status checks below are successful ✅

A picture of a cute animal (not mandatory, but encouraged)

@TheAlexLichter TheAlexLichter requested a review from a team as a code owner April 1, 2026 06:38
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 1, 2026

📝 Walkthrough

Summary by CodeRabbit

  • Chores
    • Migrated code formatting tool from Prettier to oxfmt. Updated development dependencies and CI/CD pipeline configuration to use the new formatter.

Walkthrough

This PR migrates the repository's formatter from Prettier to Oxfmt: it removes .prettierrc.json and .prettierignore, adds .oxfmtrc.json, updates package.json format scripts and devDependencies to use oxfmt, and adds an explicit @oxfmt/binding-linux-x64-gnu install step in CircleCI. It also removes eslint-config-prettier from eslint.config.js and adds a trailing newline to .github/.kodiak.toml.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'build: migrate to oxfmt' clearly and concisely summarizes the primary change in the changeset: migrating the project's code formatting toolchain from Prettier to oxfmt.
Description check ✅ Passed The PR description follows the required template structure, includes a linked issue reference (#7015), provides context about the motivation (faster formatting), and has completed checklist items for issue opening and contribution guidelines.
Linked Issues check ✅ Passed The PR successfully implements the coding requirements from issue #7015: replaces Prettier with oxfmt in build scripts, configuration, and dependencies, achieving the objective of substantially faster formatting (from ~1m40s to <1s).
Out of Scope Changes check ✅ Passed All changes are directly aligned with the objective of migrating to oxfmt: formatter configuration, build scripts, dependencies, and CI setup. No extraneous modifications are present.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@package.json`:
- Around line 62-63: Remove the unused "prettier" devDependency from
package.json (the entry named "prettier" in devDependencies) because formatting
is handled by "oxfmt" (see the "format" script) and only
"eslint-config-prettier" is needed for ESLint; update package.json to delete the
"prettier" entry so installs and toolchain ambiguity are reduced.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3f7f3966-b47b-4c86-98d7-da49fbd2e777

📥 Commits

Reviewing files that changed from the base of the PR and between 230dfbf and 0a693c0.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (5)
  • .github/.kodiak.toml
  • .oxfmtrc.json
  • .prettierignore
  • .prettierrc.json
  • package.json
💤 Files with no reviewable changes (2)
  • .prettierrc.json
  • .prettierignore

@serhalp
Copy link
Copy Markdown
Member

serhalp commented Apr 3, 2026

@TheAlexLichter
Copy link
Copy Markdown
Contributor Author

TheAlexLichter commented Apr 3, 2026

npm/cli#4828 😮‍💨

@serhalp Addded a workaround which needs to be tested in the CI workflow.

EDIT: Seems like it worked. formatting down from 11s to 2s 👏🏻

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.circleci/config.yml:
- Around line 123-125: Update the CircleCI job that installs the native binding
by pinning the binding package version to match oxfmt: replace the bare package
install of `@oxfmt/binding-linux-x64-gnu` used in the run step with a versioned
install (e.g., `@oxfmt/binding-linux-x64-gnu`@^0.43.0) so the native binding stays
aligned with oxfmt; locate the run step that currently contains "npm i -D
`@oxfmt/binding-linux-x64-gnu`" and change it to include the version specifier.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 0292d7de-98f9-4874-8f59-8ab8dfac57d7

📥 Commits

Reviewing files that changed from the base of the PR and between 0a693c0 and 81954cf.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (3)
  • .circleci/config.yml
  • eslint.config.js
  • package.json
💤 Files with no reviewable changes (1)
  • eslint.config.js
🚧 Files skipped from review as they are similar to previous changes (1)
  • package.json

Comment on lines +123 to +125
# This is necessary to work around platform-specific optional dependencies bug
# (https://github.com/npm/cli/issues/4828).
- run: npm i -D @oxfmt/binding-linux-x64-gnu
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify that oxfmt and its binding package exist on npm and check version alignment

echo "=== Checking oxfmt package ==="
curl -s https://registry.npmjs.org/oxfmt | jq '{name: .name, latest: .["dist-tags"].latest, versions: (.versions | keys | .[-5:])}'

echo ""
echo "=== Checking `@oxfmt/binding-linux-x64-gnu` package ==="
curl -s https://registry.npmjs.org/@oxfmt/binding-linux-x64-gnu | jq '{name: .name, latest: .["dist-tags"].latest, versions: (.versions | keys | .[-5:])}'

Repository: netlify/build

Length of output: 428


Pin the binding version to match oxfmt.

While @oxfmt/binding-linux-x64-gnu and oxfmt are currently both at version 0.43.0, pinning the binding version to @^0.43.0 ensures they stay in sync. Native bindings should explicitly declare version alignment with their parent packages to prevent future mismatches if versions diverge.

Proposed fix
      # This is necessary to work around platform-specific optional dependencies bug
      # (https://github.com/npm/cli/issues/4828).
-      - run: npm i -D `@oxfmt/binding-linux-x64-gnu`
+      - run: npm i -D `@oxfmt/binding-linux-x64-gnu`@^0.43.0
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# This is necessary to work around platform-specific optional dependencies bug
# (https://github.com/npm/cli/issues/4828).
- run: npm i -D @oxfmt/binding-linux-x64-gnu
# This is necessary to work around platform-specific optional dependencies bug
# (https://github.com/npm/cli/issues/4828).
- run: npm i -D `@oxfmt/binding-linux-x64-gnu`@^0.43.0
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.circleci/config.yml around lines 123 - 125, Update the CircleCI job that
installs the native binding by pinning the binding package version to match
oxfmt: replace the bare package install of `@oxfmt/binding-linux-x64-gnu` used in
the run step with a versioned install (e.g.,
`@oxfmt/binding-linux-x64-gnu`@^0.43.0) so the native binding stays aligned with
oxfmt; locate the run step that currently contains "npm i -D
`@oxfmt/binding-linux-x64-gnu`" and change it to include the version specifier.

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.

Migrate to Oxfmt

2 participants