Skip to content

refactor: unify oxfmt invocation behind a shared runOxfmt helper - #2569

Merged
dyoshikawa merged 2 commits into
mainfrom
resolve-issue-2559-unify-oxfmt
Aug 4, 2026
Merged

refactor: unify oxfmt invocation behind a shared runOxfmt helper#2569
dyoshikawa merged 2 commits into
mainfrom
resolve-issue-2559-unify-oxfmt

Conversation

@dyoshikawa

Copy link
Copy Markdown
Owner

Summary

Unify the three oxfmt invocations in scripts/ behind a single shared helper.

  • Add scripts/run-oxfmt.ts exporting runOxfmt(paths: string[]), standardized on npx with shell: process.platform === "win32" and repo-root-relative paths.
  • scripts/generate-docs-content.ts now imports the helper instead of defining its own copy.
  • scripts/generate-supported-tools-tables.ts no longer uses its own pnpm exec oxfmt call, which was missing the Windows shell handling.
  • scripts/generate-json-schema.ts no longer uses its own npx oxfmt call, which was also missing the Windows shell handling.

No functional change to generated output: pnpm run generate:tables, pnpm run generate:docs-content, and pnpm run generate:schema all leave git diff empty.

Test plan

  • pnpm cicheck (full: code + content, including the docs-content and supported-tools drift gates) passes.

Closes #2559

🤖 Generated with Claude Code

Extract the runOxfmt helper from generate-docs-content.ts into scripts/run-oxfmt.ts and use it from generate-supported-tools-tables.ts and generate-json-schema.ts. All three call sites now share one runner (npx) and the Windows shell handling, so a future fix cannot silently miss one of them.
Address review feedback: pass --no-install so npx cannot silently fetch an oxfmt version other than the pinned devDependency, export repoRoot so generate-docs-content.ts reuses the single definition, and add unit tests covering the empty-path guard, relative path handling, and the Windows-only shell branch.
@dyoshikawa
dyoshikawa merged commit d5e8ff4 into main Aug 4, 2026
9 checks passed
@dyoshikawa
dyoshikawa deleted the resolve-issue-2559-unify-oxfmt branch August 4, 2026 01:48
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.

Unify the oxfmt invocation in generate-supported-tools-tables.ts with the shared runOxfmt helper (PR #2540 follow-up)

2 participants