Skip to content

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

Description

@dyoshikawa

Background

PR #2540 introduced a shared runOxfmt helper in scripts/generate-docs-content.ts that formats generated markdown via execFileSync("npx", ["oxfmt", ...]) with shell: process.platform === "win32", so the invocation also works on Windows. The final review of that PR noted one non-blocking (low) follow-up: scripts/generate-supported-tools-tables.ts still formats its generated tables with its own inline invocation, which predates the helper.

Details

  • scripts/generate-docs-content.ts:22 defines runOxfmt, including the Windows shell handling.
  • scripts/generate-supported-tools-tables.ts:148 runs execFileSync("pnpm", ["exec", "oxfmt", ...targets.map((t) => t.path)], { stdio: "inherit" }) directly, without the Windows shell option and with a different runner (pnpm exec vs npx).

The two invocations do the same job (let oxfmt own the final markdown layout of generated files), so the duplication is a small drift risk: a future fix to one call site (e.g. the Windows handling) can silently miss the other.

Solution / Next Steps

  • Extract runOxfmt into a small shared module under scripts/ (e.g. alongside scripts/markdown-markers.ts) and accept one or more paths.
  • Use it from both generate-docs-content.ts and generate-supported-tools-tables.ts, unifying on a single runner and keeping the shell: process.platform === "win32" handling.
  • Verify pnpm run generate:tables and pnpm run generate:docs-content still produce byte-identical output (CI drift gates cover both).

Severity: low — cleanup only, no functional change expected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    maintainer-scrapRough notes for AI implementation. Not for human eyes.refactoring

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions