-
Notifications
You must be signed in to change notification settings - Fork 3.9k
docs(bunfig): add missing configuration options #25784
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Updated 5:58 AM PT - Dec 31st, 2025
✅ Your commit 3b9951c has passed in 🧪 To try this PR locally: bunx bun-pr 25784That installs a local version of the PR into your bun-25784 --bun |
Documents configuration fields that exist in bunfig.zig but were missing from the docs, including: - Top-level: origin, macros, external - New [serve] section: port, static.plugins, static.hmr, static.minify, static.define, static.publicPath, static.env - [test]: coverageIgnoreSourcemaps - [install]: concurrentScripts, ignoreScripts, prefer, logLevel, lockfile.path, lockfile.savePath, hoistPattern, publicHoistPattern - [run]: elide-lines - New [bundle] section: entryPoints, outdir, logLevel, packages 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
28afdfe to
65c68ef
Compare
WalkthroughAdds extensive bunfig.toml documentation in a single file, introducing new sections and examples for macros, serve, test, install, run, and bundle configuration options without changing code or exports. (47 words) Changes
Possibly related PRs
Suggested reviewers
Pre-merge checks✅ Passed checks (2 passed)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Disabled knowledge base sources:
📒 Files selected for processing (1)
🧰 Additional context used🧠 Learnings (10)📓 Common learnings📚 Learning: 2025-11-14T16:07:01.064ZApplied to files:
📚 Learning: 2025-11-30T13:44:16.488ZApplied to files:
📚 Learning: 2025-09-13T17:01:41.393ZApplied to files:
📚 Learning: 2025-10-19T02:44:46.354ZApplied to files:
📚 Learning: 2025-11-24T18:37:30.259ZApplied to files:
📚 Learning: 2025-11-24T18:37:30.259ZApplied to files:
📚 Learning: 2025-10-19T02:52:37.412ZApplied to files:
📚 Learning: 2025-11-24T18:37:11.466ZApplied to files:
📚 Learning: 2025-12-16T00:21:32.179ZApplied to files:
🔇 Additional comments (5)
Comment |
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
docs/runtime/bunfig.mdx (1)
773-794: Incorrect section placement: Debug section is within the Install section.The
## Debugheading and its content (lines 773-794) are placed in the middle of the Package manager ([install]) section, betweeninstall.publicHoistPatternandinstall.security.scanner. This breaks the document structure.The Debug section should either:
- Be moved to appear after all install-related sections (after line 834)
- Or be removed from this location if it already exists elsewhere in the file
🔎 Suggested fix
Move the Debug section (lines 773-794) to after the install section completes (after line 834), before the
## bun runsection (line 836).
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
docs/runtime/bunfig.mdx
🧰 Additional context used
🧠 Learnings (9)
📓 Common learnings
Learnt from: RiskyMH
Repo: oven-sh/bun PR: 24719
File: docs/bundler/executables.mdx:527-560
Timestamp: 2025-11-14T16:07:01.064Z
Learning: In the Bun repository, certain bundler features like compile with code splitting (--compile --splitting) are CLI-only and not supported in the Bun.build() JavaScript API. Tests for CLI-only features use backend: "cli" flag (e.g., test/bundler/bundler_compile_splitting.test.ts). The CompileBuildConfig interface correctly restricts these with splitting?: never;. When documenting CLI-only bundler features, add a note clarifying they're not available via the programmatic API.
Learnt from: RiskyMH
Repo: oven-sh/bun PR: 25248
File: src/install/pnpm.zig:1747-1762
Timestamp: 2025-11-30T13:44:16.488Z
Learning: Bun's TOML parser (bun.interchange.toml.TOML) gracefully handles duplicate section headers by merging keys from multiple sections with the same name into a single table. For example, two [install] sections in bunfig.toml will be merged into one install configuration object. This lenient behavior differs from strict TOML parsers but is intentional in Bun.
📚 Learning: 2025-11-14T16:07:01.064Z
Learnt from: RiskyMH
Repo: oven-sh/bun PR: 24719
File: docs/bundler/executables.mdx:527-560
Timestamp: 2025-11-14T16:07:01.064Z
Learning: In the Bun repository, certain bundler features like compile with code splitting (--compile --splitting) are CLI-only and not supported in the Bun.build() JavaScript API. Tests for CLI-only features use backend: "cli" flag (e.g., test/bundler/bundler_compile_splitting.test.ts). The CompileBuildConfig interface correctly restricts these with splitting?: never;. When documenting CLI-only bundler features, add a note clarifying they're not available via the programmatic API.
Applied to files:
docs/runtime/bunfig.mdx
📚 Learning: 2025-11-30T13:44:16.488Z
Learnt from: RiskyMH
Repo: oven-sh/bun PR: 25248
File: src/install/pnpm.zig:1747-1762
Timestamp: 2025-11-30T13:44:16.488Z
Learning: Bun's TOML parser (bun.interchange.toml.TOML) gracefully handles duplicate section headers by merging keys from multiple sections with the same name into a single table. For example, two [install] sections in bunfig.toml will be merged into one install configuration object. This lenient behavior differs from strict TOML parsers but is intentional in Bun.
Applied to files:
docs/runtime/bunfig.mdx
📚 Learning: 2025-10-19T02:44:46.354Z
Learnt from: theshadow27
Repo: oven-sh/bun PR: 23798
File: packages/bun-otel/context-propagation.test.ts:1-1
Timestamp: 2025-10-19T02:44:46.354Z
Learning: In the Bun repository, standalone packages under packages/ (e.g., bun-vscode, bun-inspector-protocol, bun-plugin-yaml, bun-plugin-svelte, bun-debug-adapter-protocol, bun-otel) co-locate their tests with package source code using *.test.ts files. This follows standard npm/monorepo patterns. The test/ directory hierarchy (test/js/bun/, test/cli/, test/js/node/) is reserved for testing Bun's core runtime APIs and built-in functionality, not standalone packages.
Applied to files:
docs/runtime/bunfig.mdx
📚 Learning: 2025-11-24T18:37:30.259Z
Learnt from: CR
Repo: oven-sh/bun PR: 0
File: test/CLAUDE.md:0-0
Timestamp: 2025-11-24T18:37:30.259Z
Learning: Applies to test/**/*.test.{ts,js,jsx,tsx,mjs,cjs} : When spawning Bun processes in tests, use `bunExe` and `bunEnv` from `harness` to ensure the same build of Bun is used and debug logging is silenced
Applied to files:
docs/runtime/bunfig.mdx
📚 Learning: 2025-11-24T18:37:30.259Z
Learnt from: CR
Repo: oven-sh/bun PR: 0
File: test/CLAUDE.md:0-0
Timestamp: 2025-11-24T18:37:30.259Z
Learning: Applies to test/**/*.test.{ts,js,jsx,tsx,mjs,cjs} : Use `bun:test` with files that end in `*.test.{ts,js,jsx,tsx,mjs,cjs}`
Applied to files:
docs/runtime/bunfig.mdx
📚 Learning: 2025-10-19T02:52:37.412Z
Learnt from: theshadow27
Repo: oven-sh/bun PR: 23798
File: packages/bun-otel/tsconfig.json:1-15
Timestamp: 2025-10-19T02:52:37.412Z
Learning: In the Bun repository, packages under packages/ (e.g., bun-otel) can follow a TypeScript-first pattern where package.json exports point directly to .ts files (not compiled .js files). Bun natively runs TypeScript, so consumers import .ts sources directly and receive full type information without needing compiled .d.ts declaration files. For such packages, adding "declaration": true or "outDir" in tsconfig.json is unnecessary and would break the export structure.
<!-- [remove_learning]
ceedde95-980e-4898-a2c6-40ff73913664
Applied to files:
docs/runtime/bunfig.mdx
📚 Learning: 2025-11-24T18:37:11.466Z
Learnt from: CR
Repo: oven-sh/bun PR: 0
File: src/js/CLAUDE.md:0-0
Timestamp: 2025-11-24T18:37:11.466Z
Learning: Write JS builtins for Bun's Node.js compatibility and APIs, and run `bun bd` after changes
Applied to files:
docs/runtime/bunfig.mdx
📚 Learning: 2025-12-16T00:21:32.179Z
Learnt from: CR
Repo: oven-sh/bun PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-16T00:21:32.179Z
Learning: Use `BUN_DEBUG_QUIET_LOGS=1` to disable debug logging, or `BUN_DEBUG_<scopeName>=1` to enable specific scoped debug logging in Zig
Applied to files:
docs/runtime/bunfig.mdx
🪛 LanguageTool
docs/runtime/bunfig.mdx
[style] ~204-~204: To form a complete sentence, be sure to include a subject or ‘there’.
Context: ...nify` Configure minification settings. Can be a boolean to enable/disable all mini...
(MISSING_IT_THERE)
🔇 Additional comments (6)
docs/runtime/bunfig.mdx (6)
723-735: Lockfile path configuration options are correctly implemented.Both
pathandsavePathoptions for custom lockfile paths are properly implemented in the bunfig configuration (lines 640 and 646 of src/bunfig.zig). The documentation accurately reflects the available functionality.
358-365: Verify coverageIgnoreSourcemaps option exists in bunfig.zig.Manual verification required—unable to access repository to confirm this option is actually implemented in the codebase.
564-607: The documentation for the install configuration options (concurrentScripts, ignoreScripts, prefer, logLevel) is accurate and complete. All options exist in the source code with the correct types and enum values as documented:
preferenum values match: "online", "offline", "latest"logLevelenum values match: "debug", "info", "warn", "error"concurrentScriptsaccepts a number as documentedignoreScriptsaccepts a boolean as documentedNo changes required.
755-771: All details verified. ThehoistPatternandpublicHoistPatternoptions are correctly implemented in the codebase, the documentation examples are accurate, and the restriction tolinker = "isolated"is properly enforced by the implementation. Both options use the samePnpmMatcherparsing mechanism as their pnpm counterparts, and the TOML syntax examples in the documentation match the actual configuration patterns used throughout the test suite.
162-249: All [serve] section configuration options are correctly implemented.Verified in bunfig.zig and schema.zig:
serve.portdefaults to 3000 ✓serve.static.plugins✓serve.static.hmrdefaults to enabled (true) ✓serve.static.minifywith syntax, whitespace, and identifiers options ✓serve.static.define✓serve.static.publicPath✓serve.static.envwith behavior and prefix support ✓All documented default values match the implementation.
940-986: Add note clarifying thatbundle.logLevelis CLI-only.The
bundle.logLeveloption only applies to thebun buildCLI command and is not available when using theBun.build()programmatic API. The other bundle options (entryPoints,outdir,packages) work in both contexts.
- Add macro object mapping example - Fix grammar in minify description 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Summary
bunfig.zigbut were missing from the docs[serve]and[bundle]that were entirely undocumented[test],[install],[run])New fields documented:
Top-level runtime:
origin- Origin URL for the applicationmacros- Enable/disable macrosexternal- Modules to exclude from bundlingNew
[serve]section:serve.port- Dev server portserve.static.plugins- Plugins to loadserve.static.hmr- Hot Module Replacement toggleserve.static.minify- Minification settingsserve.static.define- Define constants for dev serverserve.static.publicPath- Public path for assetsserve.static.env- Environment variable handling[test]:test.coverageIgnoreSourcemaps- Ignore sourcemaps when computing coverage[install]:install.concurrentScripts- Number of concurrent lifecycle scriptsinstall.ignoreScripts- Skip lifecycle scriptsinstall.prefer- Resolution mode (online/offline/latest)install.logLevel- Log level for package installationinstall.lockfile.path- Custom path to read lockfile frominstall.lockfile.savePath- Custom path to save lockfile toinstall.hoistPattern- Glob patterns for hoisting (pnpm-style)install.publicHoistPattern- Glob patterns for public hoisting[run]:run.elide-lines- Lines to elide in error outputNew
[bundle]section:bundle.entryPoints- Entry points for bundlingbundle.outdir- Output directorybundle.logLevel- Log level for bundlerbundle.packages- Per-package bundling configurationTest plan
src/bunfig.zigto identify all configuration fields🤖 Generated with Claude Code