Skip to content
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): peer/dev/optional = false lockfile fix #15874

Merged
merged 16 commits into from
Dec 20, 2024

Conversation

dylan-conway
Copy link
Member

@dylan-conway dylan-conway commented Dec 19, 2024

What does this PR do?

Ensures the dependency tree saved to the lockfile includes dependencies that are disabled through configuration. This fixes bugs where your lockfile would fail to load due to it being unresolvable.

fixes #15858

Also fixes a crash caused by the lockfile containing an invalid url.

Implements bun install --omit <dependency type> for dev, peer, and optional.

closes #5571

Adds support for omit and include in .npmrc.

closes #15107

Fixes inconsistent total package install count in progress. Now it will report total number of package copies instead of unique packages.

fixes (unconfirmed) #15598

Fixes an infinite loop caused by disabling optional dependencies and installing with a populated cache.

How did you verify your code works?

Added a test for invalid url bug, --omit, and valid text lockfiles after disabling dependency groups.

@robobun
Copy link

robobun commented Dec 19, 2024

Updated 1:02 AM PT - Dec 20th, 2024

@Jarred-Sumner, your commit d84c9ea has passed in #8330! 🎉


🧪   try this PR locally:

bunx bun-pr 15874

const trees = this.list.items(.tree);
const dependencies = this.list.items(.dependencies);

while (i < end) : (i += 1) {
Copy link
Collaborator

@Jarred-Sumner Jarred-Sumner Dec 20, 2024

Choose a reason for hiding this comment

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

Suggested change
while (i < end) : (i += 1) {
for (trees[i..end]) |*tree| {

&pkg_metas[pkg_id],
)) {
if (log_level.isVerbose()) {
const meta = pkg_metas[pkg_id];
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
const meta = pkg_metas[pkg_id];
const meta = &pkg_metas[pkg_id];

@Jarred-Sumner Jarred-Sumner merged commit 45ca9e0 into main Dec 20, 2024
62 of 64 checks passed
@Jarred-Sumner Jarred-Sumner deleted the dylan/disable-dependencies branch December 20, 2024 08:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants