Skip to content

docs: add missing v1.2.21 features to documentation - #23085

Merged
Jarred-Sumner merged 2 commits into
mainfrom
claude/update-docs-v1.2.21
Sep 30, 2025
Merged

Jarred-Sumner merged 2 commits into
mainfrom
claude/update-docs-v1.2.21

Conversation

@robobun

@robobun robobun commented Sep 29, 2025

Copy link
Copy Markdown
Collaborator

Summary

  • Added documentation for 5 features introduced in Bun v1.2.21 that were missing from the docs
  • Kept updates minimal with high information density as requested

Changes

  • bun audit filtering options (docs/install/audit.md)

    • --audit-level=<low|moderate|high|critical> - filter by severity
    • --prod - audit only production dependencies
    • --ignore <CVE> - ignore specific vulnerabilities
  • --compile-exec-argv flag (docs/bundler/executables.md)

    • Embed runtime arguments in compiled executables
    • Arguments available via process.execArgv
  • bunx --package/-p flag (docs/cli/bunx.md)

    • Run binaries from specific packages when name differs
  • package.json sideEffects glob patterns (docs/bundler/index.md)

    • Support for *, ?, **, [], {} patterns
  • --user-agent CLI flag (docs/cli/run.md)

    • Customize User-Agent header for all fetch() requests

Test plan

  • Reviewed all changes match Bun v1.2.21 blog post features
  • Verified documentation style is concise with code examples
  • Checked no existing documentation was removed

🤖 Generated with Claude Code

Add documentation for features introduced in Bun v1.2.21:
- bun audit filtering options (--audit-level, --prod, --ignore)
- --compile-exec-argv flag for embedding runtime args
- bunx --package/-p flag for running binaries from packages
- package.json sideEffects glob pattern support
- --user-agent CLI flag for customizing fetch requests

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@robobun

robobun commented Sep 29, 2025 •

Copy link
Copy Markdown
Collaborator Author
Updated 8:12 AM PT - Sep 29th, 2025

❌ Your commit 70ca6e02 has 6 failures in Build #27443 (All Failures):


🧪   To try this PR locally:

bunx bun-pr 23085

That installs a local version of the PR into your bun-23085 executable, so you can run:

bun-23085 --bun

@coderabbitai

coderabbitai Bot commented Sep 29, 2025 •

Copy link
Copy Markdown
Contributor

Warning

Rate limit exceeded

@robobun has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 12 minutes and 46 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 61882b6 and 70ca6e0.

📒 Files selected for processing (4)
  • docs/bundler/executables.md (1 hunks)
  • docs/cli/bunx.md (1 hunks)
  • docs/cli/run.md (1 hunks)
  • docs/install/audit.md (1 hunks)

Walkthrough

Documentation updates add new sections across bundler, CLI, and audit pages describing flags and options. Several additions are duplicated within the same files. No code or runtime changes; only doc content and placement updates.

Changes

Cohort / File(s) Summary of Changes
Bundler docs
docs/bundler/executables.md, docs/bundler/index.md
Added “Embedding runtime arguments” with --compile-exec-argv="args" (duplicated block) in executables docs. Introduced sideEffects field section with JSON example and glob patterns in bundler index, inserted twice in the document.
CLI docs
docs/cli/bunx.md, docs/cli/run.md
bunx: Added “Package flag” describing --package / -p with examples, appearing twice. run: Added --user-agent flag description with example, appearing twice.
Audit docs
docs/install/audit.md
Added “Filtering options”: --audit-level=<low

Suggested reviewers

  • alii

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The pull request description does not follow the repository’s required template, as it uses custom headings like “## Summary,” “## Changes,” and “## Test plan” instead of the mandated “### What does this PR do?” and “### How did you verify your code works?” sections. Please update the description to use the prescribed template headings exactly, placing the overview under “### What does this PR do?” and the verification steps under “### How did you verify your code works?”, and ensure each section clearly covers the required information.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The title succinctly describes the primary change, indicating that documentation for v1.2.21 features is being added and matches the pull request’s goal of updating docs for five new features without extraneous details.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (5)
docs/bundler/executables.md (1)

143-155: Clarify quoting/precedence for embedded args; add Windows example

  • Please state how embedded args are ordered relative to runtime args in process.execArgv and whether runtime flags can override embedded ones.
  • Add a Windows cmd.exe/PowerShell example (quoting differs), and note escaping for spaces/equals.
  • Optional: link to the flag’s reference and process.execArgv.

Example additions:

 ## Embedding runtime arguments

 **`--compile-exec-argv="args"`** - Embed runtime arguments that are available via `process.execArgv`:
 
 ```bash
 $ bun build --compile --compile-exec-argv="--smol --user-agent=MyBot" ./app.ts --outfile myapp

+On Windows (PowerShell):
+
+powershell +PS> bun build --compile --compile-exec-argv '--smol --user-agent=MyBot' .\app.ts --outfile myapp.exe +
+
+Precedence: embedded args appear in process.execArgv before CLI‑time args. If the same flag is provided at runtime, the runtime value takes precedence. (Please confirm.)
+

// In the compiled app
console.log(process.execArgv); // ["--smol", "--user-agent=MyBot"]

</blockquote></details>
<details>
<summary>docs/cli/bunx.md (1)</summary><blockquote>

`66-73`: **Explain scope of `--package/-p` and multiple-use behavior**

- Note that `-p/--package` selects the package supplying the binary (affects resolution/install), and is not forwarded to the target binary.
- Clarify whether multiple `-p` flags are supported (and how conflicts are resolved).
- Consider adding one example where binary name differs from package name but both exist on PATH to show why `-p` is needed.




```diff
 ## Package flag
 
 **`--package <pkg>` or `-p <pkg>`** - Run binary from specific package. Useful when binary name differs from package name:
 
 ```bash
 $ bunx -p renovate renovate-config-validator
 $ bunx --package @angular/cli ng

+Notes:
+- --package affects which package is installed/resolved; it is not passed through to the binary.
+- Only one --package value is used (later flags override earlier ones). (Please confirm.)


</blockquote></details>
<details>
<summary>docs/cli/run.md (1)</summary><blockquote>

`215-221`: **Clarify scope and precedence of `--user-agent`**

- Confirm it applies to Bun’s `fetch()` only (not third‑party HTTP libs).
- State precedence: per‑request `headers: { "User-Agent": ... }` should override the global flag if set.
- If relevant, note whether redirects/retries preserve the header.

</blockquote></details>
<details>
<summary>docs/bundler/index.md (1)</summary><blockquote>

`788-799`: **Expand `sideEffects` semantics and path rules**

Great to document glob support. Please also cover:
- Boolean vs array behavior (`false` ⇒ tree‑shake all except explicitly imported side‑effect files).
- Path base (globs are resolved relative to package root where `package.json` lives).
- Negation patterns support (if supported) or explicitly say not supported.
- Common pitfalls (mark CSS or setup files as side‑effectful to avoid accidental removal).



```diff
 ### `sideEffects`
 
 Bun supports `package.json` `sideEffects` field with glob pattern matching:
 
 ```json
 {
   "sideEffects": ["**/*.css", "./src/setup.js"]
 }

-Supported glob patterns: *, ?, **, [], {}.
+Supported glob patterns: *, ?, **, [], {}. Globs are resolved relative to the package root (the directory containing package.json).
+You can also use:
+- true — treat all files as having side effects (disable DCE for the package)
+- false — assume files are side‑effect free unless matched by the array (enables aggressive tree‑shaking)
+
+Tip: keep CSS and initialization files (e.g. src/setup.ts) listed to prevent their removal during bundling.


</blockquote></details>
<details>
<summary>docs/install/audit.md (1)</summary><blockquote>

`27-46`: **Define exit code semantics with filters and ignored CVEs**

- Please state whether exit status is based on the post‑filter set (after `--audit-level`, `--prod`, and `--ignore`) and whether `--json` output is filtered accordingly.
- Add one combined example to show typical usage.




```diff
 ### Filtering options
@@
 **`--ignore <CVE>`** - Ignore specific CVEs (can be used multiple times):
@@
 $ bun audit --ignore CVE-2022-25883 --ignore CVE-2023-26136

+Exit codes: the exit status reflects vulnerabilities remaining after applying all filters/ignores. (Please confirm.)
+
+Example (combine flags):
+bash +$ bun audit --prod --audit-level=high --ignore CVE-2023-26136 +


</blockquote></details>

</blockquote></details>

<details>
<summary>📜 Review details</summary>

**Configuration used**: CodeRabbit UI

**Review profile**: CHILL

**Plan**: Pro

**Disabled knowledge base sources:**

- Linear integration is disabled by default for public repositories

> You can enable these sources in your CodeRabbit configuration.

<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between 9c75db45fa955b5d968abc0bd7bc650966ee3fb1 and 61882b6c7ddb35fd037ec7f6e46f8bb0b073c2ec.

</details>

<details>
<summary>📒 Files selected for processing (5)</summary>

* `docs/bundler/executables.md` (1 hunks)
* `docs/bundler/index.md` (1 hunks)
* `docs/cli/bunx.md` (1 hunks)
* `docs/cli/run.md` (1 hunks)
* `docs/install/audit.md` (1 hunks)

</details>

<details>
<summary>🧰 Additional context used</summary>

<details>
<summary>🧠 Learnings (5)</summary>

<details>
<summary>📚 Learning: 2025-09-03T17:10:13.486Z</summary>

Learnt from: CR
PR: oven-sh/bun#0
File: test/CLAUDE.md:0-0
Timestamp: 2025-09-03T17:10:13.486Z
Learning: Use bun bd <...cmd> to run commands with your debug build of Bun


**Applied to files:**
- `docs/bundler/executables.md`
- `docs/cli/bunx.md`

</details>
<details>
<summary>📚 Learning: 2025-08-30T00:12:56.803Z</summary>

Learnt from: CR
PR: oven-sh/bun#0
File: .cursor/rules/writing-tests.mdc:0-0
Timestamp: 2025-08-30T00:12:56.803Z
Learning: Applies to test/cli/**/*.{js,ts} : When testing Bun as a CLI, use spawn with bunExe() and bunEnv from harness, and capture stdout/stderr via pipes


**Applied to files:**
- `docs/bundler/executables.md`
- `docs/cli/run.md`

</details>
<details>
<summary>📚 Learning: 2025-08-30T00:07:54.573Z</summary>

Learnt from: CR
PR: oven-sh/bun#0
File: .cursor/rules/building-bun.mdc:0-0
Timestamp: 2025-08-30T00:07:54.573Z
Learning: To run a file, use bun bd <file> <...args>; never use bun <file> directly


**Applied to files:**
- `docs/bundler/executables.md`
- `docs/cli/bunx.md`

</details>
<details>
<summary>📚 Learning: 2025-09-12T22:27:19.572Z</summary>

Learnt from: RiskyMH
PR: #22613
File: src/cli/package_manager_command.zig:0-0
Timestamp: 2025-09-12T22:27:19.572Z
Learning: In Bun's CLI architecture, commands that go through the standard Command.Context flow should use ctx.positionals (which excludes flags) rather than manually parsing bun.argv. Manual bun.argv parsing is only used for standalone commands like bun info that bypass the normal command routing.


**Applied to files:**
- `docs/cli/bunx.md`

</details>
<details>
<summary>📚 Learning: 2025-09-12T22:30:48.490Z</summary>

Learnt from: RiskyMH
PR: #22613
File: src/cli/package_manager_command.zig:0-0
Timestamp: 2025-09-12T22:30:48.490Z
Learning: Commands like bun info and bun whoami that are promoted from pm-only subcommands to top-level commands use manual bun.argv parsing to detect direct invocation vs. pm invocation. This is different from regular commands that should use ctx.positionals.


**Applied to files:**
- `docs/cli/bunx.md`

</details>

</details><details>
<summary>🪛 markdownlint-cli2 (0.18.1)</summary>

<details>
<summary>docs/bundler/executables.md</summary>

148-148: Dollar signs used before commands without showing output

(MD014, commands-show-output)

</details>
<details>
<summary>docs/install/audit.md</summary>

32-32: Dollar signs used before commands without showing output

(MD014, commands-show-output)

---

38-38: Dollar signs used before commands without showing output

(MD014, commands-show-output)

---

44-44: Dollar signs used before commands without showing output

(MD014, commands-show-output)

</details>
<details>
<summary>docs/cli/bunx.md</summary>

71-71: Dollar signs used before commands without showing output

(MD014, commands-show-output)

---

72-72: Dollar signs used before commands without showing output

(MD014, commands-show-output)

</details>
<details>
<summary>docs/cli/run.md</summary>

220-220: Dollar signs used before commands without showing output

(MD014, commands-show-output)

</details>

</details>

</details>

<details>
<summary>⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)</summary>

* GitHub Check: Format

</details>

</details>

<!-- This is an auto-generated comment by CodeRabbit for review status -->

Comment thread docs/bundler/index.md Outdated

boolean; -->

### `sideEffects`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this if anything should explain what side effect means, but also the docs here is for Bun.build options...

- Remove sideEffects docs from Bun.build options (it's a package.json field)
- Remove dollar signs from command examples per markdownlint

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants