From 6edc3a99009ffc6d84b6aeba4e010ee1f81f241a Mon Sep 17 00:00:00 2001 From: nobkd <44443899+nobkd@users.noreply.github.com> Date: Tue, 3 Jun 2025 23:37:03 +0200 Subject: [PATCH] remove `audit` from `bun pm` help (#20167) --- completions/bun.zsh | 3 +-- src/cli/package_manager_command.zig | 1 - src/install/install.zig | 4 ---- .../registry/fixtures/audit/generate-audit-fixtures.ts | 4 ++-- 4 files changed, 3 insertions(+), 9 deletions(-) diff --git a/completions/bun.zsh b/completions/bun.zsh index bc7143ac8b..ca9fbfaeed 100644 --- a/completions/bun.zsh +++ b/completions/bun.zsh @@ -260,7 +260,6 @@ _bun_pm_completion() { 'hash\:"generate & print the hash of the current lockfile" ' 'hash-string\:"print the string used to hash the lockfile" ' 'hash-print\:"print the hash stored in the current lockfile" ' - 'audit\:"run a security audit of dependencies in Bun'\''s lockfile"' 'cache\:"print the path to the cache folder" ' ) @@ -573,7 +572,7 @@ _bun_outdated_completion() { '--no-progress[Disable the progress bar]' \ '--help[Print this help menu]' && ret=0 - + case $state in config) _bun_list_bunfig_toml diff --git a/src/cli/package_manager_command.zig b/src/cli/package_manager_command.zig index 35f3f62a70..75a9e07a4b 100644 --- a/src/cli/package_manager_command.zig +++ b/src/cli/package_manager_command.zig @@ -130,7 +130,6 @@ pub const PackageManagerCommand = struct { \\ bun pm hash generate & print the hash of the current lockfile \\ bun pm hash-string print the string used to hash the lockfile \\ bun pm hash-print print the hash stored in the current lockfile - \\ bun pm audit check installed packages for vulnerabilities \\ bun pm cache print the path to the cache folder \\ bun pm cache rm clear the cache \\ bun pm migrate migrate another package manager's lockfile without installing anything diff --git a/src/install/install.zig b/src/install/install.zig index ab74b8f2f2..aa91191385 100644 --- a/src/install/install.zig +++ b/src/install/install.zig @@ -7519,10 +7519,6 @@ pub const PackageManager = struct { break :brk loader; }; - if (subcommand == .pm and cli.positionals.len >= 2 and strings.eqlComptime(cli.positionals[1], "audit")) { - env.quiet = true; - } - env.loadProcess(); try env.load(entries_option.entries, &[_][]u8{}, .production, false); diff --git a/test/cli/install/registry/fixtures/audit/generate-audit-fixtures.ts b/test/cli/install/registry/fixtures/audit/generate-audit-fixtures.ts index 34cb1e4916..84dd61f520 100644 --- a/test/cli/install/registry/fixtures/audit/generate-audit-fixtures.ts +++ b/test/cli/install/registry/fixtures/audit/generate-audit-fixtures.ts @@ -39,7 +39,7 @@ for (const packageJsonPath of absolutes) { await $`bun i`.cwd(tmp); await spawn({ - cmd: [bunExe(), "pm", "audit"], + cmd: [bunExe(), "audit"], cwd: tmp, env: { ...bunEnv, @@ -50,7 +50,7 @@ for (const packageJsonPath of absolutes) { const body = await requestBodyPromise; const { stdout, exited } = spawn({ - cmd: [bunExe(), "pm", "audit", "--json"], + cmd: [bunExe(), "audit", "--json"], cwd: tmp, stdout: "pipe", stderr: "ignore",