-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
fix: install vendored node_modules when using hardlinks #9007
Conversation
beforeEach(dummyBeforeEach); | ||
afterEach(dummyAfterEach); | ||
|
||
it("should install vendored node_modules with hardlink", async () => { |
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.
Similar testing approach as tests in test/cli/install/bun-install.test.ts
and more specifically test case should prefer latest-tagged dependency
@@ -1366,7 +1366,7 @@ pub const PackageInstall = struct { | |||
cached_package_dir, | |||
this.allocator, | |||
&[_]bun.OSPathSlice{}, | |||
&[_]bun.OSPathSlice{bun.OSPathLiteral("node_modules")}, |
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.
TIL you can publish an npm package with a node_modules
folder as long as it isn't top level
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.
Looks good to me. Will wait for CI to run
We probably also want to do this for |
Thank you |
What does this PR do?
Fixes issue where vendored
node_modules
aren't installed with hardlink backend.Vendored
node_module
is a folder inside an installed package which is callednode_module
. So the library has bundled some of their dependencies into the published package instead of specifying it in theirpackage.json
. For exampleAn npm package is called
vendor-baz
and it contains the following files:The contents of
cjs/node_modules/foo-dep/
is a vendored package.How did you verify your code works?
I wrote automated tests
bun-debug test test-file-name.test
)