Skip to content

chore: format generated type files in their generators#324

Open
MarioCadenas wants to merge 2 commits intomainfrom
mario/d1fbcc83
Open

chore: format generated type files in their generators#324
MarioCadenas wants to merge 2 commits intomainfrom
mario/d1fbcc83

Conversation

@MarioCadenas
Copy link
Copy Markdown
Collaborator

Summary

Every pnpm build and pnpm dev was leaving packages/shared/src/schemas/plugin-manifest.generated.ts and packages/appkit/src/registry/types.generated.ts dirty until pnpm format was run.

The per-package build:package scripts run the schema/registry generators before tsdown:

  • packages/shared: tsx ../../tools/generate-schema-types.ts && tsdown ...
  • packages/appkit: tsx ../../tools/generate-registry-types.ts && tsdown ...

Only the root-level pnpm generate:types script piped their output through Biome — but pnpm build / pnpm dev don't invoke it, so the files always landed in their unformatted state.

Changes

  • tools/generate-schema-types.ts and tools/generate-registry-types.ts now run pnpm exec biome check --write on their output file immediately after writing it, via child_process.spawnSync.
  • Dropped the trailing biome check --write … from the root generate:types script in package.json since it's now redundant.

Test plan

  • Reverted both generated files to their committed state, ran each generator individually — Biome reported "Fixed 1 file" once and git diff was empty afterwards.
  • Ran a full pnpm buildgit status no longer reports the .generated.ts files as modified.
  • CI green.

The per-package `build:package` scripts run the schema/registry type
generators before `tsdown`, but only the root `generate:types` script
piped the output through Biome. Since `pnpm build` and `pnpm dev` skip
that root script, every build left `plugin-manifest.generated.ts` and
`types.generated.ts` dirty until `pnpm format` was run.

Have each generator invoke `biome check --write` on its own output so
the file lands formatted regardless of how it was produced. The trailing
biome step in the root `generate:types` script is now redundant and
removed.
@MarioCadenas MarioCadenas requested a review from pkosiec April 29, 2026 08:54
Both generate-schema-types.ts and generate-registry-types.ts had the
same helper for spawning `biome check --write`. Move it into a single
tools/format-with-biome.ts module so both generators share one copy.
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.

1 participant