feat(devops): add Oxfmt alongside Prettier for incremental migration#3871
feat(devops): add Oxfmt alongside Prettier for incremental migration#3871wraith4081 wants to merge 1 commit intoopenfrontio:mainfrom
Conversation
WalkthroughThis PR introduces Oxfmt as an opt-in incremental code formatter alongside the default Prettier setup. It adds an oxfmt configuration file, multiple npm format scripts, a new devDependency, and updates documentation to guide developers on both formatter options during the migration. ChangesOxfmt Formatter Migration
Estimated Code Review Effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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. Comment |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
There was a problem hiding this comment.
🧹 Nitpick comments (2)
package.json (2)
19-20: ⚡ Quick winConsider adding
--disable-nested-configto the oxfmt scripts for a small performance gain.Oxfmt supports nested config lookup per file; passing
--disable-nested-configmakes it resolve the config once instead of per file, which is faster. Since this project has a single root-level.oxfmtrc.jsonwith no package-level overrides, this flag is safe to add.⚡ Proposed change
- "format:oxfmt": "oxfmt", - "format:oxfmt:check": "oxfmt --check", + "format:oxfmt": "oxfmt --disable-nested-config", + "format:oxfmt:check": "oxfmt --check --disable-nested-config",🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@package.json` around lines 19 - 20, The oxfmt NPM scripts "format:oxfmt" and "format:oxfmt:check" perform per-file nested config lookup which is unnecessary for this repo; update both script values in package.json to append the flag --disable-nested-config so oxfmt resolves config once (e.g., change the "format:oxfmt" and "format:oxfmt:check" script strings to include --disable-nested-config).
70-70: 💤 Low value
^0.48.0will receive only patch-level updates for this 0.x dependency.The latest published version is 0.48.0, and there are already 50 versions in the registry, reflecting a very fast release cadence. With a
0.xmajor, npm's^range resolves to>=0.48.0 <0.49.0, so every minor bump (e.g., 0.49.0) will require a manual dependency update. This is intentionally conservative for an opt-in tool, but worth being aware of — a~0.48.0(same effective range) or a periodic version bump strategy may be preferable once the migration is complete.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@package.json` at line 70, The package.json currently pins the oxfmt dependency using the caret range "oxfmt": "^0.48.0", which for 0.x releases only allows patch updates and will not pick up 0.49.0+ minors; change the version specifier to a tilde range "oxfmt": "~0.48.0" (or another agreed range/policy) to make it explicit that you want the same effective update behavior but clearer intent, or add a comment/maintenance note to the repo stating you will perform periodic manual bumps of "oxfmt" to follow its rapid 0.x release cadence; update the package.json entry for "oxfmt" accordingly and ensure any CI or dependency update tooling is aligned with that policy.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@package.json`:
- Around line 19-20: The oxfmt NPM scripts "format:oxfmt" and
"format:oxfmt:check" perform per-file nested config lookup which is unnecessary
for this repo; update both script values in package.json to append the flag
--disable-nested-config so oxfmt resolves config once (e.g., change the
"format:oxfmt" and "format:oxfmt:check" script strings to include
--disable-nested-config).
- Line 70: The package.json currently pins the oxfmt dependency using the caret
range "oxfmt": "^0.48.0", which for 0.x releases only allows patch updates and
will not pick up 0.49.0+ minors; change the version specifier to a tilde range
"oxfmt": "~0.48.0" (or another agreed range/policy) to make it explicit that you
want the same effective update behavior but clearer intent, or add a
comment/maintenance note to the repo stating you will perform periodic manual
bumps of "oxfmt" to follow its rapid 0.x release cadence; update the
package.json entry for "oxfmt" accordingly and ensure any CI or dependency
update tooling is aligned with that policy.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 37cbd324-d5de-4ed4-8091-6949d636f337
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (5)
.oxfmtrc.jsonCLAUDE.mdCONTRIBUTING.mdmap-generator/README.mdpackage.json
Description:
Adds Oxfmt to the project without removing Prettier yet.
This is intended as a first migration step: Oxfmt is now available through opt-in local scripts, while Prettier stays as the default formatter to keep the existing formatting workflow unchanged.
Changes
oxfmt..oxfmtrc.json.npm run formaton Prettier for now.prettier-plugin-organize-imports, andprettier-plugin-shin place.Why not replace Prettier yet?
Oxfmt looks promising and is much faster, but this PR intentionally avoids a large mechanical reformat.
A full Oxfmt switch would touch hundreds of files, which would make this tooling PR harder to review. Prettier also still handles current repo behavior that we do not want to change in this first step, including shell formatting and import organization.
Because of that, this PR keeps Prettier as the default formatter and adds Oxfmt as an opt-in formatter first.
Current Oxfmt config
Oxfmt is configured conservatively so it stays close to the current Prettier setup.
Enabled config:
printWidth: 80sortImports: falsesortPackageJson: falseImport sorting and package.json sorting are disabled for now to avoid unrelated formatting churn.
Notes
npm run formatstill runs Prettier.npm run format:oxfmtruns Oxfmt.npm run format:oxfmt:checkchecks formatting with Oxfmt.lint-stagedare intentionally unchanged in this first PR.lint-staged.Local timing
Initial local timings:
13.455s1.491swall time (997msreported by Oxfmt over 734 files)This is a strong signal that Oxfmt is worth continuing to migrate toward, but this PR keeps the rollout incremental instead of changing the whole formatting pipeline at once. (Ryzen 9 7940HS, 8x2 Thread, 40GB 4800MT/s DDR5, 990 Pro, Node v25.8.1)
Please complete the following:
Please put your Discord username so you can be contacted if a bug or regression is found:
wraith4081