Commit Graph

33 Commits

Author SHA1 Message Date
robobun
7dcd49f832 fix(install): only apply default trusted dependencies to npm packages (#25163)
## Summary
- The default trusted dependencies list should only apply to packages
installed from npm
- Non-npm sources (file:, link:, git:, github:) now require explicit
trustedDependencies
- This prevents malicious packages from spoofing trusted names through
local paths or git repos

## Test plan
- [x] Added test: file: dependency named "esbuild" does NOT auto-run
postinstall scripts
- [x] Added test: file: dependency runs scripts when explicitly added to
trustedDependencies
- [x] Verified tests fail with system bun (old behavior) and pass with
new build
- [x] Build compiles successfully

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

---------

Co-authored-by: Claude Bot <claude-bot@bun.sh>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: Dylan Conway <dylan.conway567@gmail.com>
2025-12-11 17:44:41 -08:00
Dylan Conway
6f9843ea9a fix(install): bun pm ls with unresolved dependencies (#24541)
### What does this PR do?
Fixes `bun pm ls --all` crash with unresolved optional peer
dependencies.
Fixes `bun pm ls` crash with empty lockfiles.

Fixes #24502 
### How did you verify your code works?
Added a test for both crashes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-11-10 11:19:57 -08:00
Michael H
ba20670da3 implement pnpm migration (#22262)
### What does this PR do?

fixes #7157, fixes #14662

migrates pnpm-workspace.yaml data to package.json & converts
pnpm-lock.yml to bun.lock

---

### How did you verify your code works?

manually, tests and real world examples

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Dylan Conway <dylan.conway567@gmail.com>
2025-09-27 00:45:29 -07:00
taylor.fish
07cd45deae Refactor Zig imports and file structure (part 1) (#21270)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-07-22 17:51:38 -07:00
pfg
83760fc446 Sort imports in all files (#21119)
Co-authored-by: taylor.fish <contact@taylor.fish>
2025-07-21 13:26:47 -07:00
Jarred Sumner
55a9cccac0 bun.sh -> bun.com (#20909) 2025-07-10 00:10:43 -07:00
Dylan Conway
f24e8cb98a implement "nodeLinker": "isolated" in bun install (#20440)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2025-07-09 00:19:57 -07:00
Dylan Conway
3773ceeb7e Remove PreparePatchPackageInstall (#20457) 2025-06-17 17:23:29 -07:00
chloe caruso
4ec410e0d7 internal: make @import("bun") work in zig (#19096) 2025-04-17 12:32:47 -07:00
Don Isaac
f730a355bf fix: BufferWriter never returns an error (#18981)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2025-04-13 08:57:41 -07:00
Jarred Sumner
e39305dd91 Remove deprecated shim wrapper for zig <> c++ fns (#18269)
Co-authored-by: Jarred-Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Co-authored-by: Dylan Conway <dylan.conway567@gmail.com>
2025-03-19 15:40:08 -07:00
Zack Radisic
e6cb0de539 CSS modules (#17958) 2025-03-06 23:35:06 -08:00
Jarred Sumner
aac951bd47 Move semver-related structs into their own files (#16987) 2025-02-02 00:20:45 -08:00
Dylan Conway
7410da9c71 fix(install): bun.lockb -> bun.lock with incorrect optional peer dependencies (#16743)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2025-01-26 04:29:54 -08:00
Dylan Conway
0a7cc1f1c2 Make bun.lock the default for new projects (#16540) 2025-01-20 23:17:52 -08:00
Jarred Sumner
5326a998c7 Don't open node_modules 1,618 times (#15762) 2024-12-14 04:48:57 -08:00
Dylan Conway
b55ca429c7 Implement text-based lockfile (#15705) 2024-12-11 05:05:49 -08:00
Jarred Sumner
5bcaf32ba3 Fix lockfile print crash (#15332) 2024-11-22 02:07:11 -08:00
Dylan Conway
62881ee36b Redact secrets in bunfig.toml and npmrc logs (#14919) 2024-10-31 18:44:24 -07:00
Dylan Conway
247456b675 fix(install): continue install if optional postinstall fails (#14783) 2024-10-23 21:58:53 -07:00
Dylan Conway
f374ae6db1 add bun publish (#14215) 2024-10-02 20:47:22 -07:00
Dylan Conway
4fefb8507c respect package.json indentation in bun install (#12328) 2024-07-03 23:10:34 -07:00
dave caruso
688ddbda74 feat(bundler): implement enum inlining / more constant folding (#12144)
Co-authored-by: paperdave <paperdave@users.noreply.github.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com>
2024-07-03 04:23:17 -07:00
Dylan Conway
d5aa7265df fix(install): bun pm trust with updated dependencies (#12215)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-06-28 16:51:06 -07:00
Isaiah Banks
b37f94d396 Fix typo in pm_trusted_command.zig (#12162) 2024-06-27 16:12:00 -07:00
dave caruso
b76376f8a6 chore: upgrade zig to 0.13.0 (#9965)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: Grigory <grigory.orlov.set@gmail.com>
Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com>
Co-authored-by: Meghan Denny <hello@nektro.net>
Co-authored-by: Kenta Iwasaki <63115601+lithdew@users.noreply.github.com>
Co-authored-by: John-David Dalton <john.david.dalton@gmail.com>
Co-authored-by: Dale Seo <5466341+DaleSeo@users.noreply.github.com>
Co-authored-by: Zack Radisic <56137411+zackradisic@users.noreply.github.com>
Co-authored-by: paperdave <paperdave@users.noreply.github.com>
Co-authored-by: Georgijs Vilums <georgijs.vilums@gmail.com>
Co-authored-by: Dylan Conway <dylan.conway567@gmail.com>
2024-06-20 13:48:39 -07:00
Dylan Conway
12f070d1a0 fix #11649 (#11659) 2024-06-06 17:26:39 -07:00
Dylan Conway
4b8f89cb73 Allow bun update to edit package.json (#11340)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-05-30 02:14:01 -07:00
Jarred Sumner
688844b472 refactor: ban std.debug.assert (#10168)
* Ban `std.debug.assert`

* Create .clangd

* Update lint.yml

* Update linter.ts

* update

* lint

* Update linter.ts

* Update linter.ts

* update

* Update linter.ts

* update

* Update linter.ts

* more

* Update install.zig

* words

* Remove UB
2024-04-11 17:52:29 -07:00
dave caruso
a01b01ae72 chore!: enable 1.1's breaking changes (#9724)
* root scripts in foreground

* ignore if silent

* test for breaking changes

* move back to installPackages

* [autofix.ci] apply automated fixes

* boolean variable, comptime, 1_1_0

* flip the 1.1 flag

* add for the next batch of breakings

* make it buidl

* enable breaking changes tests

* fix version fmt

* silent node-gyp

* comment change

---------

Co-authored-by: Dylan Conway <dylan.conway567@gmail.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com>
2024-03-31 16:12:59 -07:00
Dylan Conway
cee6be12cc test for #9472 and bun pm trust waiter thread bugfix (#9498)
* test max concurrent scripts

* stress test, waiter thread bugfix

* different verbose

* escape

* Update src/install/lockfile.zig

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>

* resource usage test

* fix invalid pointer

* another test

* update test

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-03-19 21:46:03 -07:00
Dylan Conway
9512f5240f bun pm trust bugfix (#9426)
* check error

* test missing packages

* Update test/cli/install/registry/bun-install-registry.test.ts

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-03-15 21:22:12 -07:00
Dylan Conway
e45ece05d9 improve bun pm trust output (#9371)
* fix recursion

* accurate count of blocked package scripts

* update

* fix merge

* reset pipereaders, set bin linker error correctly

* more pretty

* small changes

* e

* update tests

* this one too

* bun.start_time, iterate package_ids, remove put
2024-03-12 19:50:46 -07:00