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

add --filter and package pattern arguments to bun outdated #13557

Merged
merged 9 commits into from
Aug 27, 2024

Conversation

dylan-conway
Copy link
Collaborator

@dylan-conway dylan-conway commented Aug 27, 2024

What does this PR do?

  • Adds workspace filtering to bun outdated through --filter. You can glob for workspace package names or workspace paths. Examples:
# Path patterns:
# Matches all workspaces in `./packages`
bun outdated --filter="./packages/*"

# Name patterns:
# All workspaces with names starting with `pkg`
bun outdated --filter="pkg*"

# All workspaces excluding `pkg1`
bun outdated --filter="*" --filter="!pkg1"
  • Adds dependency name filtering. Works the same as workspace name patterns, and can be used in combination with --filter. Example:
# All dependencies starting with `is-` (could display `is-even`, `is-odd`, ...)
bun outdated "is-*"

# With `--filter`. Matches all outdated `jquery` dependencies in all workspaces.
bun outdated jquery --filter="*"
  • fixes a bug that would occur when printing versions with tags in the bun outdated table

How did you verify your code works?

Added tests for --filter and args

}

const length = bun.simdutf.length.utf32.from.utf8.le(arg);
const convert_buf = bun.default_allocator.alloc(u32, length) catch bun.outOfMemory();
Copy link
Collaborator

Choose a reason for hiding this comment

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

seems crazy to me that we have to drop down to simdutf here

else => unreachable,
};

const abs_res_path = path.joinAbsString(FileSystem.instance.top_level_dir, &[_]string{res_path}, .posix);
Copy link
Collaborator

Choose a reason for hiding this comment

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

probably should use joinAbsStringBuf incase something else is making use of the shared string buffer?

}

// move all matched workspaces to front of array
var i: usize = 0;
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
var i: usize = 0;
var i: usize = 0;
var abs_res_path_buf: bun.PathBuffer = undefined;

else => unreachable,
};

const abs_res_path = path.joinAbsString(FileSystem.instance.top_level_dir, &[_]string{res_path}, .posix);
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 abs_res_path = path.joinAbsString(FileSystem.instance.top_level_dir, &[_]string{res_path}, .posix);
const abs_res_path = path.joinAbsStringBuf(&abs_res_path_buf, FileSystem.instance.top_level_dir, &[_]string{res_path}, .posix);

@Jarred-Sumner
Copy link
Collaborator

This is mergeable so I'm going to merge it

I do think that we should have some canonical way to "get a validated UTF-8 string from bytes" that doesn't directly involve simdutf

@Jarred-Sumner Jarred-Sumner merged commit ba2ea6f into main Aug 27, 2024
45 checks passed
@Jarred-Sumner Jarred-Sumner deleted the dylan/outdated-tagged-version-fix branch August 27, 2024 07:18
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.

3 participants