Skip to content

pnpm migrate: copy some settings to bunfig.toml too - #25248

Closed
RiskyMH wants to merge 3 commits into
mainfrom
riskymh/pnpm-migrate-more-to-bunfig
Closed

RiskyMH wants to merge 3 commits into
mainfrom
riskymh/pnpm-migrate-more-to-bunfig

Conversation

@RiskyMH

@RiskyMH RiskyMH commented Nov 30, 2025 •

Copy link
Copy Markdown
Contributor

i wish we had a TOML.stringify api though

  • onlyBuiltDependencies → trustedDependencies (package.json)
  • minimumReleaseAge → minimumReleaseAge (bunfig.toml, minutes → seconds)
  • minimumReleaseAgeExclude → minimumReleaseAgeExcludes (bunfig.toml)
  • publicHoistPattern → publicHoistPattern (bunfig.toml)
  • hoistPattern → hoistPattern (bunfig.toml)
  • shamefullyHoist → prepends "*" to publicHoistPattern (bunfig.toml)

@robobun

robobun commented Nov 30, 2025 •

Copy link
Copy Markdown
Collaborator
Updated 6:37 AM PT - Nov 30th, 2025

❌ @RiskyMH, your commit 6c054c8 has 5 failures in Build #32710 (All Failures):


🧪   To try this PR locally:

bunx bun-pr 25248

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

bun-25248 --bun

@RiskyMH
RiskyMH marked this pull request as ready for review November 30, 2025 13:26
@RiskyMH
RiskyMH requested a review from dylan-conway November 30, 2025 13:26
@coderabbitai

coderabbitai Bot commented Nov 30, 2025 •

Copy link
Copy Markdown
Contributor

Walkthrough

Replaces the post-lockfile-migration hook to migrate pnpm-workspace.yaml settings into both package.json and bunfig.toml. Converts and merges trustedDependencies, minimumReleaseAge (minutes→seconds), hoist patterns, and shamefullyHoist, preserving and deduplicating existing bunfig.toml and package.json entries.

Changes

Cohort / File(s) Summary
Implementation
src/install/pnpm.zig
Renamed updatePackageJsonAfterMigration() → migrateSettingsAfterLockfileMigration() and added logic to parse pnpm-workspace.yaml and bunfig.toml, migrate onlyBuiltDependencies → trustedDependencies, convert minimumReleaseAge (minutes→seconds) into bunfig.toml [install], migrate hoist/publicHoistPattern and shamefullyHoist (prepend "*" when needed), dedupe/merge entries, and create/update bunfig.toml when appropriate.
Test Suite
test/cli/install/migration/pnpm-migration.test.ts
Added tests exercising pnpm settings migration: trustedDependencies conversion, minimumReleaseAge conversion and exclusion preservation, hoist/publicHoistPattern and shamefullyHoist behavior, and idempotency across repeated installs.
Test Fixtures
test/cli/install/migration/pnpm/settings-existing/*, test/cli/install/migration/pnpm/settings-hoist/*, test/cli/install/migration/pnpm/settings-minage/*, test/cli/install/migration/pnpm/settings-trusted/*
Added fixture directories with package.json and pnpm-workspace.yaml (and an existing bunfig.toml in settings-existing) to cover migration scenarios for trusted deps, minimumReleaseAge/minimumReleaseAgeExclude, and hoist/shamefullyHoist behaviour.

Possibly related PRs

Suggested reviewers

  • dylan-conway
  • Jarred-Sumner

Pre-merge checks

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description lacks required sections from the template and does not adequately explain what the PR does or how it was verified. Add a clear 'What does this PR do?' section explaining the changes and add a 'How did you verify your code works?' section detailing verification steps.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed Title clearly and concisely describes the main change: extending pnpm migration to copy settings to bunfig.toml.

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: 7

📜 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.

📥 Commits

Reviewing files that changed from the base of the PR and between cc3fc5a and c58483c.

⛔ Files ignored due to path filters (4)
  • test/cli/install/migration/pnpm/settings-existing/pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
  • test/cli/install/migration/pnpm/settings-hoist/pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
  • test/cli/install/migration/pnpm/settings-minage/pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
  • test/cli/install/migration/pnpm/settings-trusted/pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (11)
  • src/install/pnpm.zig (7 hunks)
  • test/cli/install/migration/pnpm-migration.test.ts (1 hunks)
  • test/cli/install/migration/pnpm/settings-existing/bunfig.toml (1 hunks)
  • test/cli/install/migration/pnpm/settings-existing/package.json (1 hunks)
  • test/cli/install/migration/pnpm/settings-existing/pnpm-workspace.yaml (1 hunks)
  • test/cli/install/migration/pnpm/settings-hoist/package.json (1 hunks)
  • test/cli/install/migration/pnpm/settings-hoist/pnpm-workspace.yaml (1 hunks)
  • test/cli/install/migration/pnpm/settings-minage/package.json (1 hunks)
  • test/cli/install/migration/pnpm/settings-minage/pnpm-workspace.yaml (1 hunks)
  • test/cli/install/migration/pnpm/settings-trusted/package.json (1 hunks)
  • test/cli/install/migration/pnpm/settings-trusted/pnpm-workspace.yaml (1 hunks)
🧰 Additional context used
📓 Path-based instructions (10)
src/**/*.{cpp,zig}

📄 CodeRabbit inference engine (.cursor/rules/building-bun.mdc)

src/**/*.{cpp,zig}: Use bun bd or bun run build:debug to build debug versions for C++ and Zig source files; creates debug build at ./build/debug/bun-debug
Run tests using bun bd test <test-file> with the debug build; never use bun test directly as it will not include your changes
Execute files using bun bd <file> <...args>; never use bun <file> directly as it will not include your changes
Enable debug logs for specific scopes using BUN_DEBUG_$(SCOPE)=1 environment variable
Code generation happens automatically as part of the build process; no manual code generation commands are required

Files:

  • src/install/pnpm.zig
src/**/*.zig

📄 CodeRabbit inference engine (.cursor/rules/building-bun.mdc)

Use bun.Output.scoped(.${SCOPE}, .hidden) for creating debug logs in Zig code

Implement core functionality in Zig, typically in its own directory in src/

src/**/*.zig: Zig source code should be organized in src/*.zig for core runtime, JavaScript bindings, and package manager
In Zig code, be careful with allocators and use defer for cleanup to manage memory properly
Use BUN_DEBUG_QUIET_LOGS=1 to disable debug logging, or BUN_DEBUG_<scopeName>=1 to enable specific Output.scoped calls in debug builds
Run bun run zig:check-all to compile the Zig code on all platforms when making platform-specific changes

src/**/*.zig: Private fields in Zig are fully supported using the # prefix: struct { #foo: u32 };
Use decl literals in Zig for declaration initialization: const decl: Decl = .{ .binding = 0, .value = 0 };
Prefer @import at the bottom of the file (auto formatter will move them automatically)

Files:

  • src/install/pnpm.zig
**/*.zig

📄 CodeRabbit inference engine (.cursor/rules/zig-javascriptcore-classes.mdc)

**/*.zig: Expose generated bindings in Zig structs using pub const js = JSC.Codegen.JS<ClassName> with trait conversion methods: toJS, fromJS, and fromJSDirect
Use consistent parameter name globalObject instead of ctx in Zig constructor and method implementations
Use bun.JSError!JSValue return type for Zig methods and constructors to enable proper error handling and exception propagation
Implement resource cleanup using deinit() method that releases resources, followed by finalize() called by the GC that invokes deinit() and frees the pointer
Use JSC.markBinding(@src()) in finalize methods for debugging purposes before calling deinit()
For methods returning cached properties in Zig, declare external C++ functions using extern fn and callconv(JSC.conv) calling convention
Implement getter functions with naming pattern get<PropertyName> in Zig that accept this and globalObject parameters and return JSC.JSValue
Access JavaScript CallFrame arguments using callFrame.argument(i), check argument count with callFrame.argumentCount(), and get this with callFrame.thisValue()
For reference-counted objects, use .deref() in finalize instead of destroy() to release references to other JS objects

Files:

  • src/install/pnpm.zig
src/**/*.{ts,zig,cpp}

📄 CodeRabbit inference engine (CLAUDE.md)

Always use absolute paths in file operations

Files:

  • src/install/pnpm.zig
src/**/*.{ts,zig}

📄 CodeRabbit inference engine (CLAUDE.md)

Avoid shell commands in code - don't use find or grep; use Bun's Glob and built-in tools instead

Files:

  • src/install/pnpm.zig
test/**/*.{js,ts,jsx,tsx}

📄 CodeRabbit inference engine (.cursor/rules/writing-tests.mdc)

test/**/*.{js,ts,jsx,tsx}: Write tests as JavaScript and TypeScript files using Jest-style APIs (test, describe, expect) and import from bun:test
Use test.each and data-driven tests to reduce boilerplate when testing multiple similar cases

Files:

  • test/cli/install/migration/pnpm-migration.test.ts
test/cli/**/*.{js,ts,jsx,tsx}

📄 CodeRabbit inference engine (.cursor/rules/writing-tests.mdc)

When testing Bun as a CLI, use the spawn API from bun with the bunExe() and bunEnv from harness to execute Bun commands and validate exit codes, stdout, and stderr

Files:

  • test/cli/install/migration/pnpm-migration.test.ts
test/cli/**/*.test.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

For CLI command tests, use the test/cli/ directory (install, run, test, etc.)

Files:

  • test/cli/install/migration/pnpm-migration.test.ts
**/*.test.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.test.{ts,tsx}: For single-file tests, prefer using -e flag over tempDir
For multi-file tests, prefer using tempDir from harness and Bun.spawn over other temporary directory creation methods
Always use port: 0 for network tests and do not hardcode ports or use custom random port number functions
Use normalizeBunSnapshot to normalize snapshot output of tests
Never write tests that check for no 'panic' or 'uncaught exception' or similar in the test output - that is NOT a valid test
Use tempDir from harness to create temporary directories, do not use tmpdirSync or fs.mkdtempSync
When spawning processes in tests, check stdout/stderr expectations BEFORE checking exit code to get more useful error messages on test failure
Do not write flaky tests - do not use setTimeout in tests, instead await the condition to be met as you are testing the CONDITION not the TIME PASSING
Verify your test fails with USE_SYSTEM_BUN=1 bun test <file> and passes with bun bd test <file> - your test is NOT VALID if it passes with USE_SYSTEM_BUN=1

Files:

  • test/cli/install/migration/pnpm-migration.test.ts
test/**/*.test.{ts,js,jsx,tsx,mjs,cjs}

📄 CodeRabbit inference engine (test/CLAUDE.md)

test/**/*.test.{ts,js,jsx,tsx,mjs,cjs}: Use bun:test with files that end in *.test.{ts,js,jsx,tsx,mjs,cjs}
Do not write flaky tests. Never wait for time to pass in tests; always wait for the condition to be met instead of using an arbitrary amount of time
Never use hardcoded port numbers in tests. Always use port: 0 to get a random port
Prefer concurrent tests over sequential tests using test.concurrent or describe.concurrent when multiple tests spawn processes or write files, unless it's very difficult to make them concurrent
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
Use -e flag for single-file tests when spawning Bun processes
Use tempDir() from harness to create temporary directories with files for multi-file tests instead of creating files manually
Prefer async/await over callbacks in tests
When callbacks must be used and it's just a single callback, use Promise.withResolvers to create a promise that can be resolved or rejected from a callback
Do not set a timeout on tests. Bun already has timeouts
Use Buffer.alloc(count, fill).toString() instead of 'A'.repeat(count) to create repetitive strings in tests, as ''.repeat is very slow in debug JavaScriptCore builds
Use describe blocks for grouping related tests
Always use await using or using to ensure proper resource cleanup in tests for APIs like Bun.listen, Bun.connect, Bun.spawn, Bun.serve, etc
Always check exit codes and test error scenarios in error tests
Use describe.each() for parameterized tests
Use toMatchSnapshot() for snapshot testing
Use beforeAll(), afterEach(), beforeEach() for setup/teardown in tests
Track resources (servers, clients) in arrays for cleanup in afterEach()

Files:

  • test/cli/install/migration/pnpm-migration.test.ts
🧠 Learnings (30)
📓 Common learnings
Learnt from: cirospaciari
Repo: oven-sh/bun PR: 22946
File: test/js/sql/sql.test.ts:195-202
Timestamp: 2025-09-25T22:07:13.851Z
Learning: PR oven-sh/bun#22946: JSON/JSONB result parsing updates (e.g., returning parsed arrays instead of legacy strings) are out of scope for this PR; tests keep current expectations with a TODO. Handle parsing fixes in a separate PR.
Learnt from: markovejnovic
Repo: oven-sh/bun PR: 24880
File: packages/bun-vscode/package.json:382-385
Timestamp: 2025-11-20T19:51:32.288Z
Learning: In the Bun repository, dependencies may be explicitly added to package.json files (even when not directly imported in code) to force version upgrades on transitive dependencies, particularly as part of Aikido security scanner remediation to ensure vulnerable transitive dependencies resolve to patched versions.
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
Learnt from: markovejnovic
Repo: oven-sh/bun PR: 24880
File: packages/bun-lambda/package.json:12-13
Timestamp: 2025-11-20T19:51:59.485Z
Learning: In the bun repository, explicitly adding transitive dependencies as direct dependencies in package.json is acceptable and encouraged when addressing security vulnerabilities (e.g., adding "braces": "^3.0.3" to force upgrade from vulnerable versions < 3.0.3 affected by CVE-2024-4068). This pattern ensures vulnerable transitive dependencies are upgraded even when direct dependencies haven't updated their requirements.
📚 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: Applies to src/js/{builtins,node,bun,thirdparty,internal}/**/*.{ts,js} : Use private globals and methods with `$` prefix (e.g., `$Array`, `map.$set()`) instead of public JavaScript globals

Applied to files:

  • test/cli/install/migration/pnpm/settings-hoist/pnpm-workspace.yaml
📚 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:

  • test/cli/install/migration/pnpm/settings-existing/bunfig.toml
📚 Learning: 2025-11-20T19:51:32.288Z
Learnt from: markovejnovic
Repo: oven-sh/bun PR: 24880
File: packages/bun-vscode/package.json:382-385
Timestamp: 2025-11-20T19:51:32.288Z
Learning: In the Bun repository, dependencies may be explicitly added to package.json files (even when not directly imported in code) to force version upgrades on transitive dependencies, particularly as part of Aikido security scanner remediation to ensure vulnerable transitive dependencies resolve to patched versions.

Applied to files:

  • test/cli/install/migration/pnpm/settings-existing/bunfig.toml
  • test/cli/install/migration/pnpm/settings-hoist/package.json
  • src/install/pnpm.zig
  • test/cli/install/migration/pnpm/settings-trusted/package.json
  • test/cli/install/migration/pnpm/settings-minage/package.json
  • test/cli/install/migration/pnpm/settings-trusted/pnpm-workspace.yaml
📚 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:

  • test/cli/install/migration/pnpm/settings-existing/bunfig.toml
📚 Learning: 2025-11-24T18:34:55.173Z
Learnt from: CR
Repo: oven-sh/bun PR: 0
File: .cursor/rules/building-bun.mdc:0-0
Timestamp: 2025-11-24T18:34:55.173Z
Learning: Applies to src/**/*.{cpp,zig} : Use `bun bd` or `bun run build:debug` to build debug versions for C++ and Zig source files; creates debug build at `./build/debug/bun-debug`

Applied to files:

  • src/install/pnpm.zig
📚 Learning: 2025-11-24T18:36:33.069Z
Learnt from: CR
Repo: oven-sh/bun PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T18:36:33.069Z
Learning: Applies to src/**/*.zig : Use `BUN_DEBUG_QUIET_LOGS=1` to disable debug logging, or `BUN_DEBUG_<scopeName>=1` to enable specific Output.scoped calls in debug builds

Applied to files:

  • src/install/pnpm.zig
📚 Learning: 2025-11-24T18:34:55.173Z
Learnt from: CR
Repo: oven-sh/bun PR: 0
File: .cursor/rules/building-bun.mdc:0-0
Timestamp: 2025-11-24T18:34:55.173Z
Learning: Applies to src/**/*.{cpp,zig} : Execute files using `bun bd <file> <...args>`; never use `bun <file>` directly as it will not include your changes

Applied to files:

  • src/install/pnpm.zig
📚 Learning: 2025-10-16T17:32:03.074Z
Learnt from: markovejnovic
Repo: oven-sh/bun PR: 23710
File: src/install/PackageManager/PackageManagerOptions.zig:187-193
Timestamp: 2025-10-16T17:32:03.074Z
Learning: In Bun's codebase (particularly in files like src/install/PackageManager/PackageManagerOptions.zig), mixing bun.EnvVar.*.get() and bun.EnvVar.*.platformGet() for environment variable lookups is intentional and safe. The code is protected by compile-time platform checks (Environment.isWindows, etc.), and compilation will fail if the wrong function is used on the wrong platform. This pattern should not be flagged as a consistency issue.

Applied to files:

  • src/install/pnpm.zig
📚 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:

  • src/install/pnpm.zig
  • test/cli/install/migration/pnpm/settings-trusted/pnpm-workspace.yaml
📚 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:

  • src/install/pnpm.zig
  • test/cli/install/migration/pnpm-migration.test.ts
📚 Learning: 2025-10-01T22:13:08.081Z
Learnt from: taylordotfish
Repo: oven-sh/bun PR: 23169
File: src/codegen/bindgenv2/internal/base.ts:120-125
Timestamp: 2025-10-01T22:13:08.081Z
Learning: Iterator.some() and other Iterator helper methods (map, filter, etc.) are supported in Bun and modern Node.js (22+) runtimes and can be safely used on string iterators and other iterator objects.

Applied to files:

  • src/install/pnpm.zig
📚 Learning: 2025-11-24T18:36:33.069Z
Learnt from: CR
Repo: oven-sh/bun PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T18:36:33.069Z
Learning: Applies to test/js/bun/**/*.test.{ts,tsx} : For Bun-specific API tests, use the `test/js/bun/` directory (for http, crypto, ffi, shell, etc.)

Applied to files:

  • src/install/pnpm.zig
  • test/cli/install/migration/pnpm-migration.test.ts
📚 Learning: 2025-10-26T01:32:04.844Z
Learnt from: Jarred-Sumner
Repo: oven-sh/bun PR: 24082
File: test/cli/test/coverage.test.ts:60-112
Timestamp: 2025-10-26T01:32:04.844Z
Learning: In the Bun repository test files (test/cli/test/*.test.ts), when spawning Bun CLI commands with Bun.spawnSync for testing, prefer using stdio: ["inherit", "inherit", "inherit"] to inherit stdio streams rather than piping them.

Applied to files:

  • src/install/pnpm.zig
📚 Learning: 2025-10-18T01:49:31.037Z
Learnt from: taylordotfish
Repo: oven-sh/bun PR: 23755
File: src/bun.js/api/bun/socket/SocketConfig.bindv2.ts:58-58
Timestamp: 2025-10-18T01:49:31.037Z
Learning: In Bun's bindgenv2 TypeScript bindings (e.g., src/bun.js/api/bun/socket/SocketConfig.bindv2.ts), the pattern `b.String.loose.nullable.loose` is intentional and not a duplicate. The first `.loose` applies to the String type (loose string conversion), while the second `.loose` applies to the nullable (loose nullable, treating all falsy values as null rather than just null/undefined).

Applied to files:

  • src/install/pnpm.zig
📚 Learning: 2025-11-24T18:35:50.422Z
Learnt from: CR
Repo: oven-sh/bun PR: 0
File: .cursor/rules/writing-tests.mdc:0-0
Timestamp: 2025-11-24T18:35:50.422Z
Learning: Applies to test/cli/**/*.{js,ts,jsx,tsx} : When testing Bun as a CLI, use the `spawn` API from `bun` with the `bunExe()` and `bunEnv` from `harness` to execute Bun commands and validate exit codes, stdout, and stderr

Applied to files:

  • src/install/pnpm.zig
  • test/cli/install/migration/pnpm-migration.test.ts
📚 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:

  • src/install/pnpm.zig
  • test/cli/install/migration/pnpm-migration.test.ts
📚 Learning: 2025-11-24T18:36:59.706Z
Learnt from: CR
Repo: oven-sh/bun PR: 0
File: src/bun.js/bindings/v8/CLAUDE.md:0-0
Timestamp: 2025-11-24T18:36:59.706Z
Learning: Applies to src/bun.js/bindings/v8/test/v8/v8.test.ts : Add corresponding test cases to test/v8/v8.test.ts using checkSameOutput() function to compare Node.js and Bun output

Applied to files:

  • test/cli/install/migration/pnpm-migration.test.ts
📚 Learning: 2025-11-24T18:35:50.422Z
Learnt from: CR
Repo: oven-sh/bun PR: 0
File: .cursor/rules/writing-tests.mdc:0-0
Timestamp: 2025-11-24T18:35:50.422Z
Learning: Applies to test/**/*.{js,ts,jsx,tsx} : Write tests as JavaScript and TypeScript files using Jest-style APIs (`test`, `describe`, `expect`) and import from `bun:test`

Applied to files:

  • test/cli/install/migration/pnpm-migration.test.ts
📚 Learning: 2025-11-24T18:35:08.612Z
Learnt from: CR
Repo: oven-sh/bun PR: 0
File: .cursor/rules/dev-server-tests.mdc:0-0
Timestamp: 2025-11-24T18:35:08.612Z
Learning: Applies to test/bake/dev/bundle.test.ts : Organize bundle tests in bundle.test.ts for tests concerning bundling bugs that only occur in DevServer

Applied to files:

  • test/cli/install/migration/pnpm-migration.test.ts
📚 Learning: 2025-11-24T18:36:33.069Z
Learnt from: CR
Repo: oven-sh/bun PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T18:36:33.069Z
Learning: Applies to **/*.test.{ts,tsx} : Use `normalizeBunSnapshot` to normalize snapshot output of tests

Applied to files:

  • test/cli/install/migration/pnpm-migration.test.ts
📚 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:

  • test/cli/install/migration/pnpm-migration.test.ts
📚 Learning: 2025-11-24T18:36:33.069Z
Learnt from: CR
Repo: oven-sh/bun PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T18:36:33.069Z
Learning: Applies to **/*.test.{ts,tsx} : Verify your test fails with `USE_SYSTEM_BUN=1 bun test <file>` and passes with `bun bd test <file>` - your test is NOT VALID if it passes with `USE_SYSTEM_BUN=1`

Applied to files:

  • test/cli/install/migration/pnpm-migration.test.ts
📚 Learning: 2025-11-24T18:35:08.612Z
Learnt from: CR
Repo: oven-sh/bun PR: 0
File: .cursor/rules/dev-server-tests.mdc:0-0
Timestamp: 2025-11-24T18:35:08.612Z
Learning: Applies to test/bake/dev/esm.test.ts : Organize ESM tests in esm.test.ts for tests about various ESM features in development mode

Applied to files:

  • test/cli/install/migration/pnpm-migration.test.ts
📚 Learning: 2025-11-24T18:35:08.612Z
Learnt from: CR
Repo: oven-sh/bun PR: 0
File: .cursor/rules/dev-server-tests.mdc:0-0
Timestamp: 2025-11-24T18:35:08.612Z
Learning: Applies to test/bake/dev/ecosystem.test.ts : Organize ecosystem tests in ecosystem.test.ts for tests involving ensuring certain libraries are correct; prefer testing concrete bugs over testing entire packages

Applied to files:

  • test/cli/install/migration/pnpm-migration.test.ts
📚 Learning: 2025-11-24T18:36:33.069Z
Learnt from: CR
Repo: oven-sh/bun PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T18:36:33.069Z
Learning: Applies to test/bundler/**/*.test.{ts,tsx} : For bundler and transpiler tests, use the `test/bundler/` directory and the `itBundled` helper

Applied to files:

  • test/cli/install/migration/pnpm-migration.test.ts
📚 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} : Prefer concurrent tests over sequential tests using `test.concurrent` or `describe.concurrent` when multiple tests spawn processes or write files, unless it's very difficult to make them concurrent

Applied to files:

  • test/cli/install/migration/pnpm-migration.test.ts
📚 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: Applies to src/js/{builtins,node,bun,thirdparty,internal}/**/*.{ts,js} : Use `process.platform` and `process.arch` for platform detection; these values are inlined and dead-code eliminated at build time

Applied to files:

  • test/cli/install/migration/pnpm/settings-trusted/pnpm-workspace.yaml
📚 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: Applies to src/js/{builtins,node,bun,thirdparty,internal}/**/*.{ts,js} : Use `$debug()` for debug logging and `$assert()` for assertions; both are stripped in release builds

Applied to files:

  • test/cli/install/migration/pnpm/settings-trusted/pnpm-workspace.yaml
📚 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: The build process converts source TS/JS through preprocessing, bundling, and C++ header generation; assign numeric IDs in A-Z sorted order

Applied to files:

  • test/cli/install/migration/pnpm/settings-trusted/pnpm-workspace.yaml
🧬 Code graph analysis (1)
test/cli/install/migration/pnpm-migration.test.ts (2)
test/bake/bake-harness.ts (2)
  • join (438-440)
  • expect (670-672)
test/harness.ts (1)
  • bunExe (102-105)
🔇 Additional comments (11)
test/cli/install/migration/pnpm/settings-trusted/package.json (1)

1-6: LGTM!

Simple and appropriate test fixture for validating the onlyBuiltDependencies to trustedDependencies migration.

src/install/pnpm.zig (5)

829-829: LGTM!

The function call is correctly placed after lockfile migration and properly passes the required parameters.


1781-1781: LGTM!

TOML import is correctly added to support parsing existing bunfig.toml contents.


1465-1478: LGTM!

The shamefullyHoist handling correctly prepends "*" to publicHoistPattern, matching pnpm's behavior where shamefullyHoist: true is equivalent to adding "*" to the public hoist patterns.


1614-1646: LGTM!

The trustedDependencies migration correctly deduplicates entries when merging with existing values and properly creates a new array when none exists.


1714-1723: No issues found. The code correctly reads minimumReleaseAgeExclude (singular) from pnpm-workspace.yaml and writes minimumReleaseAgeExcludes (plural) to bunfig.toml. This naming difference is intentional and matches bunfig's parser, test suite, and official documentation.

test/cli/install/migration/pnpm/settings-existing/pnpm-workspace.yaml (1)

1-1: LGTM!

Appropriate test fixture for validating minimumReleaseAge migration from pnpm (minutes) to bunfig.toml (seconds). The value of 1440 minutes (24 hours) will convert to 86400 seconds.

test/cli/install/migration/pnpm/settings-trusted/pnpm-workspace.yaml (1)

1-3: LGTM!

This fixture correctly defines onlyBuiltDependencies for testing migration to trustedDependencies in package.json.

test/cli/install/migration/pnpm/settings-minage/pnpm-workspace.yaml (1)

1-4: LGTM!

This fixture correctly defines minimumReleaseAge in minutes (pnpm format) and exclusions for testing conversion to seconds (bun format) in bunfig.toml.

test/cli/install/migration/pnpm/settings-hoist/pnpm-workspace.yaml (1)

1-6: LGTM!

This fixture correctly defines hoisting configuration for testing migration to bunfig.toml, including the shamefullyHoist behavior that prepends "*" to publicHoistPattern.

test/cli/install/migration/pnpm/settings-existing/package.json (1)

1-6: Remove the unused settings-existing test fixture directory.

The settings-existing fixture directory is not referenced anywhere in the test suite and serves no purpose. Delete test/cli/install/migration/pnpm/settings-existing/ entirely.

⛔ Skipped due to learnings
Learnt from: CR
Repo: oven-sh/bun PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T18:36:33.069Z
Learning: Applies to test/napi/**/*.test.{ts,tsx} : For N-API compatibility tests, use the `test/napi/` directory
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/**/*-fixture.ts : Test files that spawn Bun processes should end in `*-fixture.ts` to identify them as test fixtures and not tests themselves

Comment thread src/install/pnpm.zig Resolved
Comment thread src/install/pnpm.zig Resolved
@robobun

robobun commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator

Closing as stale: this PR predates the Rust rewrite. Every src/ file it modifies has since been removed or relocated on main (Zig sources deleted; src/bun.js/ reorganized into src/jsc/), so it can no longer merge.

If the underlying change is still wanted, it will need to be redone against the current Rust/C++ tree. Apologies for the churn, and thank you for the contribution.

@robobun robobun closed this Jun 26, 2026
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.

2 participants