Skip to content

fix(cli): stop installing the native Biome binary with every CLI install - #564

Merged
dmealing merged 4 commits into
mainfrom
fm/mo-drop-biome-peer
Nov 13, 2026
Merged

dmealing merged 4 commits into
mainfrom
fm/mo-drop-biome-peer

Conversation

@dmealing

@dmealing dmealing commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

Install size

Fresh npm install of @metaobjectsdev/cli, packed from the workspace with its @metaobjectsdev/* dependencies (bun pm pack) and installed into an empty project, before and after this change:

node_modules native Biome
before (main) 245 MB (233,466,154 bytes) @biomejs/cli-linux-x64 94 MB + @biomejs/biome 2 MB
after 151 MB (134,462,986 bytes) none; @biomejs/wasm-nodejs (14 MB) stays

The pipeline's own test install of the packed tarballs measured 148 MB with no @biomejs/biome or @biomejs/cli-*. The libSQL driver change was reverted during review, so @libsql/kysely-libsql stays a regular dependency.

What Changed

  • Removes the @biomejs/biome peer dependency from codegen-ts-react, codegen-ts-tanstack and codegen-ts-angular, so npm no longer auto-installs the ~94 MB native @biomejs/cli-<platform> binary into every @metaobjectsdev/cli install. Biome stays a devDependency, and bun.lock drops the matching peer entries. Codegen formats through the WebAssembly build, which is unchanged.
  • scripts/check-peer-ranges.ts now fails when a publishable package requires @biomejs/biome or @biomejs/cli-* through dependencies or a non-optional peer. scripts/check-reference-templates-lint.ts comment updated to match the devDependency placement.
  • server/typescript/packages/cli/README.md now says codegen formats through @biomejs/wasm-nodejs and the native Biome binary is not installed with the CLI. CHANGELOG.md gets an entry under the unreleased 1.3.0 notes.
Validation

Risk Assessment

✅ Low: Change only removes three unused Biome peer deps (no shipped code spawns the native binary; formatting uses the WASM build), adds a guard script, and the libSQL change is fully reverted; net diff is small and bounded.

Testing

The intent is met. A fresh install of the packed 1.3.0 CLI and generator tarballs gives 148 MB node_modules with no @biomejs/biome or @biomejs/cli-* package. meta gen in that project still writes Biome-formatted TypeScript through the WASM build. The peer-range gate passes. Codegen-ts tests pass (3461/0). I did not run the full repo regression suite; only the baseline ts-fast/ts-unit lanes and codegen-ts tests ran. The React and TanStack UI generators wrote nothing for my test model, so their live output is untested (unit tests only). The size comparison is against the 1.2.0 figure in the intent, not a live baseline build.

  • Live validation: ✅ go - 2 of 4 scenarios driven live against the product
Scenario Result Live Evidence
Fresh CLI install carries no native Biome binary: packed 1.3.0 tarballs installed with npm into an empty project; node_modules has no @biomejs/biome or @biomejs/cli-* package ✅ pass live local evidence (not published)
meta gen still formats generated TypeScript after the peer removal: real meta CLI run in a disposable project writes Biome-style output (double quotes, semicolons, trailing commas) with no native bina… ✅ pass live local evidence (not published)
Adversarial: a publishable package that requires @biomejs/biome through dependencies or a required peer fails the guard ⏸️ untested no I did not inject a violating manifest to confirm the guard fails. Only the passing tree was run.
React and TanStack UI generators (form-file, tanstack-query, tanstack-grid) still emit formatted output after the peer removal ⏸️ untested no Test model had no UI-tier trigger. Finding the trigger needed more time than the budget allowed. Their behavior is covered only by unit tests, not driven live.
Evidence: Install of packed 1.3.0 tarballs (148M, no @biomejs/cli-*) and formatted meta gen output
## npm install of packed 1.3.0 CLI + generator tarballs
148M	node_modules
js-api
wasm-nodejs
consumer@1.0.0 <scratch>/consumer
├── @libsql/client@0.18.0 extraneous
├── @libsql/core@0.18.0 extraneous
├── @libsql/hrana-client@0.10.0 extraneous
├── @libsql/linux-x64-gnu@0.5.29 extraneous
## meta gen output (formatted by WASM Biome)
// @generated by @metaobjectsdev/codegen-ts — hand edits are kept by a three-way merge on regeneration; meta verify --codegen checks only the generated parts.
// Source metadata: Product (Product)
// Extend in your own module (e.g. Product.extra.ts) — nothing imports it for you.
import { z } from "zod";

export interface Product {
  sku?: string | undefined;
  title?: string | undefined;
  stock?: number | undefined;
}
export const ProductInsertSchema = z.object({
  sku: z.string().max(40).optional(),
  title: z.string().optional(),
  stock: z.number().int().optional(),
});
  • Outcome: ⚠️ 1 warning across 1 run (20m1s)

Pipeline

Updates from git push no-mistakes

✅ **Intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

⚠️ **Review** - 2 issues (1 warning, 1 info)
  • ⚠️ server/typescript/packages/cli/package.json:66 - Commit c27faec goes beyond the stated intent. The intent is to stop the ~94 MB native Biome binary from landing in every CLI install. This commit also moves @libsql/kysely-libsql from dependencies to an optional peer (package.json:53 removed, :66/:71 added; bun.lock; README.md:15-17,48; CHANGELOG.md:51-58). That is a user-visible break for existing users. Node projects that run meta migrate, meta verify --db or meta verify --replay against SQLite now fail until they install the driver by hand. It also ships inside a MINOR release. No intent requirement needs this component. Recommended remedy: drop the libSQL commit from this branch, or get explicit approval for it as a separate breaking-change decision.
  • ℹ️ CHANGELOG.md:55 - The upgrade note is incomplete for Bun users. meta verify --replay opens its SQLite engine through @libsql/kysely-libsql in every runtime (migrate-ts/src/verify/replay-engine.ts:54-64), with no bun:sqlite fallback. So a Bun user who runs verify --replay against SQLite also breaks after this change. The CHANGELOG addresses only Node users, and README.md:17 files --replay under 'on Node'. The changelog also says 'a missing driver prints the install command for your package manager'. The replay path prints a fixed message instead, not the package-manager-aware hint from missingDriver. A related comment in an unchanged file is now stale: replay-engine.ts:16-17 still says 'cli already depends on @libsql/kysely-libsql outright, so only a direct embedder can miss that one'. Moot if the libSQL commit is dropped.

🔧 Fix applied.
2 issues (1 warning, 1 info) still open:

  • ⚠️ server/typescript/packages/cli/package.json:66 - Commit c27faec goes beyond the stated intent. The intent is to stop the ~94 MB native Biome binary from landing in every CLI install. This commit also moves @libsql/kysely-libsql from dependencies to an optional peer (package.json:53 removed, :66/:71 added; bun.lock; README.md:15-17,48; CHANGELOG.md:51-58). That is a user-visible break for existing users. Node projects that run meta migrate, meta verify --db or meta verify --replay against SQLite now fail until they install the driver by hand. It also ships inside a MINOR release. No intent requirement needs this component. Recommended remedy: drop the libSQL commit from this branch, or get explicit approval for it as a separate breaking-change decision.
  • ℹ️ CHANGELOG.md:55 - The upgrade note is incomplete for Bun users. meta verify --replay opens its SQLite engine through @libsql/kysely-libsql in every runtime (migrate-ts/src/verify/replay-engine.ts:54-64), with no bun:sqlite fallback. So a Bun user who runs verify --replay against SQLite also breaks after this change. The CHANGELOG addresses only Node users, and README.md:17 files --replay under 'on Node'. The changelog also says 'a missing driver prints the install command for your package manager'. The replay path prints a fixed message instead, not the package-manager-aware hint from missingDriver. A related comment in an unchanged file is now stale: replay-engine.ts:16-17 still says 'cli already depends on @libsql/kysely-libsql outright, so only a direct embedder can miss that one'. Moot if the libSQL commit is dropped.
⚠️ **Test** - 1 warning
  • ⚠️ server/typescript/packages/codegen-ts-tanstack - React and TanStack UI generators were not exercised live. The test model did not trigger them, so their formatted output after the peer removal is unverified beyond unit tests.
  • Live validation: ✅ go - 2 of 4 scenarios driven live against the product
Scenario Result Live Evidence
Fresh CLI install carries no native Biome binary: packed 1.3.0 tarballs installed with npm into an empty project; node_modules has no @biomejs/biome or @biomejs/cli-* package ✅ pass live local evidence (not published)
meta gen still formats generated TypeScript after the peer removal: real meta CLI run in a disposable project writes Biome-style output (double quotes, semicolons, trailing commas) with no native bina… ✅ pass live local evidence (not published)
Adversarial: a publishable package that requires @biomejs/biome through dependencies or a required peer fails the guard ⏸️ untested no I did not inject a violating manifest to confirm the guard fails. Only the passing tree was run.
React and TanStack UI generators (form-file, tanstack-query, tanstack-grid) still emit formatted output after the peer removal ⏸️ untested no Test model had no UI-tier trigger. Finding the trigger needed more time than the budget allowed. Their behavior is covered only by unit tests, not driven live.
  • scripts/ci-local.sh --only ts-fast --only ts-unit --strict-toolchains
  • scripts/ci-local.sh --only ts-fast --only ts-unit --strict-toolchains (baseline, passed)
  • bun pm pack of cli, codegen-ts, codegen-ts-react, codegen-ts-tanstack, metadata, sdk, runtime-ts, migrate-ts, docs-site, render into a temp dir outside the worktree
  • npm install of the 10 packed 1.3.0 tarballs into a fresh disposable consumer project, then du and ls of node_modules/@biomejs and npm ls
  • meta init and meta gen in the disposable project with entityFile/barrel/formFile/tanstackQuery/tanstackGrid wired; inspected src/generated/Product.ts for Biome-style formatting
  • bun scripts/check-peer-ranges.ts (exit 0, 25 peer ranges bounded, no native formatter required)
  • cd server/typescript && bun test packages/codegen-ts/test (3461 pass, 0 fail)
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

…alling the native binary

codegen-ts-react, codegen-ts-tanstack and codegen-ts-angular declared @biomejs/biome as a
peer, which npm auto-installs, putting the ~94 MB native @biomejs/cli-<platform> binary into
every CLI install. Nothing shipped uses it: formatting goes through @biomejs/wasm-nodejs.
The devDependency stays for the repo's lint gate. check-peer-ranges.ts now rejects a
publishable package that requires the native formatter. Fresh CLI install: 245 MB -> 151 MB.
…install skips it

@libsql/kysely-libsql was a direct dependency of @metaobjectsdev/cli, so every install
carried it and its native addon. The CLI already imports it lazily, only for a sqlite URL on
Node, and prints a package-manager-specific install command when it is missing. It is now an
optional peer bounded like migrate-ts's, kept as a devDependency for the CLI's own tests.
Fresh CLI install with the Biome change: 245 MB -> 101 MB.
@dmealing
dmealing merged commit 30b2897 into main Nov 13, 2026
9 checks passed
@dmealing
dmealing deleted the fm/mo-drop-biome-peer branch November 13, 2026 05:09
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