Repository navigation
fix(cli): stop installing the native Biome binary with every CLI install - #564
Merged
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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@biomejs/cli-linux-x6494 MB +@biomejs/biome2 MB@biomejs/wasm-nodejs(14 MB) staysThe pipeline's own test install of the packed tarballs measured 148 MB with no
@biomejs/biomeor@biomejs/cli-*. The libSQL driver change was reverted during review, so@libsql/kysely-libsqlstays a regular dependency.What Changed
@biomejs/biomepeer dependency fromcodegen-ts-react,codegen-ts-tanstackandcodegen-ts-angular, so npm no longer auto-installs the ~94 MB native@biomejs/cli-<platform>binary into every@metaobjectsdev/cliinstall. Biome stays a devDependency, andbun.lockdrops the matching peer entries. Codegen formats through the WebAssembly build, which is unchanged.scripts/check-peer-ranges.tsnow fails when a publishable package requires@biomejs/biomeor@biomejs/cli-*throughdependenciesor a non-optional peer.scripts/check-reference-templates-lint.tscomment updated to match the devDependency placement.server/typescript/packages/cli/README.mdnow says codegen formats through@biomejs/wasm-nodejsand the native Biome binary is not installed with the CLI.CHANGELOG.mdgets 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 genin 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.Evidence: Install of packed 1.3.0 tarballs (148M, no @biomejs/cli-*) and formatted meta gen output
Pipeline
Updates from git push no-mistakes
✅ **Intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
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-libsqlfromdependenciesto 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 runmeta migrate,meta verify --dbormeta verify --replayagainst 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 --replayopens its SQLite engine through@libsql/kysely-libsqlin every runtime (migrate-ts/src/verify/replay-engine.ts:54-64), with nobun:sqlitefallback. So a Bun user who runsverify --replayagainst SQLite also breaks after this change. The CHANGELOG addresses only Node users, and README.md:17 files--replayunder '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 frommissingDriver. A related comment in an unchanged file is now stale: replay-engine.ts:16-17 still says 'clialready depends on@libsql/kysely-libsqloutright, 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-libsqlfromdependenciesto 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 runmeta migrate,meta verify --dbormeta verify --replayagainst 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 --replayopens its SQLite engine through@libsql/kysely-libsqlin every runtime (migrate-ts/src/verify/replay-engine.ts:54-64), with nobun:sqlitefallback. So a Bun user who runsverify --replayagainst SQLite also breaks after this change. The CHANGELOG addresses only Node users, and README.md:17 files--replayunder '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 frommissingDriver. A related comment in an unchanged file is now stale: replay-engine.ts:16-17 still says 'clialready depends on@libsql/kysely-libsqloutright, so only a direct embedder can miss that one'. Moot if the libSQL commit is dropped.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.scripts/ci-local.sh --only ts-fast --only ts-unit --strict-toolchainsscripts/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 worktreenpm 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 lsmeta init and meta gen in the disposable project with entityFile/barrel/formFile/tanstackQuery/tanstackGrid wired; inspected src/generated/Product.ts for Biome-style formattingbun 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.