Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions completions/bun-cli.json
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@
},
{
"name": "ignore-scripts",
"description": "Skip lifecycle scripts in the project's package.json (dependency scripts are never run)",
"description": "Skip lifecycle scripts for all packages, including the project's package.json and trusted dependencies",
"hasValue": false,
"required": false,
"multiple": false
Expand Down Expand Up @@ -694,7 +694,7 @@
},
{
"name": "ignore-scripts",
"description": "Skip lifecycle scripts in the project's package.json (dependency scripts are never run)",
"description": "Skip lifecycle scripts for all packages, including the project's package.json and trusted dependencies",
"hasValue": false,
"required": false,
"multiple": false
Expand Down Expand Up @@ -1025,7 +1025,7 @@
},
{
"name": "ignore-scripts",
"description": "Skip lifecycle scripts in the project's package.json (dependency scripts are never run)",
"description": "Skip lifecycle scripts for all packages, including the project's package.json and trusted dependencies",
"hasValue": false,
"required": false,
"multiple": false
Expand Down Expand Up @@ -1296,7 +1296,7 @@
},
{
"name": "ignore-scripts",
"description": "Skip lifecycle scripts in the project's package.json (dependency scripts are never run)",
"description": "Skip lifecycle scripts for all packages, including the project's package.json and trusted dependencies",
"hasValue": false,
"required": false,
"multiple": false
Expand Down Expand Up @@ -1714,7 +1714,7 @@
},
{
"name": "ignore-scripts",
"description": "Skip lifecycle scripts in the project's package.json (dependency scripts are never run)",
"description": "Skip lifecycle scripts for all packages, including the project's package.json and trusted dependencies",
"hasValue": false,
"required": false,
"multiple": false
Expand Down Expand Up @@ -2095,7 +2095,7 @@
},
{
"name": "ignore-scripts",
"description": "Skip lifecycle scripts in the project's package.json (dependency scripts are never run)",
"description": "Skip lifecycle scripts for all packages, including the project's package.json and trusted dependencies",
"hasValue": false,
"required": false,
"multiple": false
Expand Down Expand Up @@ -2378,7 +2378,7 @@
},
{
"name": "ignore-scripts",
"description": "Skip lifecycle scripts in the project's package.json (dependency scripts are never run)",
"description": "Skip lifecycle scripts for all packages, including the project's package.json and trusted dependencies",
"hasValue": false,
"required": false,
"multiple": false
Expand Down Expand Up @@ -2637,7 +2637,7 @@
},
{
"name": "ignore-scripts",
"description": "Skip lifecycle scripts in the project's package.json (dependency scripts are never run)",
"description": "Skip lifecycle scripts for all packages, including the project's package.json and trusted dependencies",
"hasValue": false,
"required": false,
"multiple": false
Expand Down Expand Up @@ -2889,7 +2889,7 @@
},
{
"name": "ignore-scripts",
"description": "Skip lifecycle scripts in the project's package.json (dependency scripts are never run)",
"description": "Skip lifecycle scripts for all packages, including the project's package.json and trusted dependencies",
"hasValue": false,
"required": false,
"multiple": false
Expand Down Expand Up @@ -3194,7 +3194,7 @@
},
{
"name": "ignore-scripts",
"description": "Skip lifecycle scripts in the project's package.json (dependency scripts are never run)",
"description": "Skip lifecycle scripts for all packages, including the project's package.json and trusted dependencies",
"hasValue": false,
"required": false,
"multiple": false
Expand Down Expand Up @@ -3623,7 +3623,7 @@
},
{
"name": "ignore-scripts",
"description": "Skip lifecycle scripts in the project's package.json (dependency scripts are never run)",
"description": "Skip lifecycle scripts for all packages, including the project's package.json and trusted dependencies",
"hasValue": false,
"required": false,
"multiple": false
Expand Down
14 changes: 7 additions & 7 deletions completions/bun.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ _bun_add_completion() {
'--no-progress[Disable the progress bar]' \
'--no-summary[Don'"'"'t print a summary]' \
'--no-verify[Skip verifying integrity of newly downloaded packages]' \
'--ignore-scripts[Skip lifecycle scripts in the package.json (dependency scripts are never run)]' \
'--ignore-scripts[Skip lifecycle scripts for all packages, including the project'"'"'s package.json and trusted dependencies]' \
'--global[Add a package globally]' \
'-g[Add a package globally]' \
'--cwd[Set a specific cwd]:cwd' \
Expand Down Expand Up @@ -77,7 +77,7 @@ _bun_unlink_completion() {
'--no-progress[Disable the progress bar]' \
'--no-summary[Don'"'"'t print a summary]' \
'--no-verify[Skip verifying integrity of newly downloaded packages]' \
'--ignore-scripts[Skip lifecycle scripts in the package.json (dependency scripts are never run)]' \
'--ignore-scripts[Skip lifecycle scripts for all packages, including the project'"'"'s package.json and trusted dependencies]' \
'--global[Add a package globally]' \
'-g[Add a package globally]' \
'--cwd[Set a specific cwd]:cwd' \
Expand Down Expand Up @@ -121,7 +121,7 @@ _bun_link_completion() {
'--no-progress[Disable the progress bar]' \
'--no-summary[Don'"'"'t print a summary]' \
'--no-verify[Skip verifying integrity of newly downloaded packages]' \
'--ignore-scripts[Skip lifecycle scripts in the package.json (dependency scripts are never run)]' \
'--ignore-scripts[Skip lifecycle scripts for all packages, including the project'"'"'s package.json and trusted dependencies]' \
'--global[Add a package globally]' \
'-g[Add a package globally]' \
'--cwd[Set a specific cwd]:cwd' \
Expand Down Expand Up @@ -387,7 +387,7 @@ _bun_install_completion() {
'--no-progress[Disable the progress bar]' \
'--no-summary[Don'"'"'t print a summary]' \
'--no-verify[Skip verifying integrity of newly downloaded packages]' \
'--ignore-scripts[Skip lifecycle scripts in the package.json (dependency scripts are never run)]' \
'--ignore-scripts[Skip lifecycle scripts for all packages, including the project'"'"'s package.json and trusted dependencies]' \
'--global[Add a package globally]' \
'-g[Add a package globally]' \
'--cwd[Set a specific cwd]:cwd' \
Expand Down Expand Up @@ -437,7 +437,7 @@ _bun_remove_completion() {
'--no-progress[Disable the progress bar]' \
'--no-summary[Don'"'"'t print a summary]' \
'--no-verify[Skip verifying integrity of newly downloaded packages]' \
'--ignore-scripts[Skip lifecycle scripts in the package.json (dependency scripts are never run)]' \
'--ignore-scripts[Skip lifecycle scripts for all packages, including the project'"'"'s package.json and trusted dependencies]' \
'--global[Add a package globally]' \
'-g[Add a package globally]' \
'--cwd[Set a specific cwd]:cwd' \
Expand Down Expand Up @@ -656,7 +656,7 @@ _bun_update_completion() {
'--no-progress[Disable the progress bar]' \
'--no-summary[Don'"'"'t print a summary]' \
'--no-verify[Skip verifying integrity of newly downloaded packages]' \
'--ignore-scripts[Skip lifecycle scripts in the package.json (dependency scripts are never run)]' \
'--ignore-scripts[Skip lifecycle scripts for all packages, including the project'"'"'s package.json and trusted dependencies]' \
'-g[Add a package globally]' \
'--global[Add a package globally]' \
'--cwd[Set a specific cwd]:cwd' \
Expand Down Expand Up @@ -713,7 +713,7 @@ _bun_dedupe_completion() {
'--no-progress[Disable the progress bar]' \
'--no-summary[Don'"'"'t print a summary]' \
'--no-verify[Skip verifying integrity of newly downloaded packages]' \
'--ignore-scripts[Skip lifecycle scripts in the package.json (dependency scripts are never run)]' \
'--ignore-scripts[Skip lifecycle scripts for all packages, including the project'"'"'s package.json and trusted dependencies]' \
'--cwd[Set a specific cwd]:cwd' \
'--backend[Platform-specific optimizations for installing dependencies]:backend:("copyfile" "hardlink" "symlink")' \
'--linker[Linker strategy]:linker:(isolated hoisted)' \
Expand Down
2 changes: 1 addition & 1 deletion src/install/PackageManager/CommandLineArguments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ const SHARED_TAIL_PARAMS: &[ParamType] = &[
"--no-verify Skip verifying integrity of newly downloaded packages"
),
clap::param!(
"--ignore-scripts Skip lifecycle scripts in the project's package.json (dependency scripts are never run)"
"--ignore-scripts Skip lifecycle scripts for all packages, including the project's package.json and trusted dependencies"
),
clap::param!(
"--trust Add to trustedDependencies in the project's package.json and install the package(s)"
Expand Down
33 changes: 33 additions & 0 deletions test/cli/install/bun-install-lifecycle-scripts.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -732,6 +732,39 @@ test.concurrent(
},
);

// Every subcommand below prints the flag table shared by the install family. The behavior the
// entry describes is covered by "ignore-scripts is read from npmrc" (above) and "--ignore-scripts
// should skip lifecycle scripts" (below): both install a trustedDependencies package.
test.concurrent.each([
"install",
"add",
"update",
"remove",
"link",
"unlink",
"patch",
"patch-commit",
"outdated",
"publish",
"info",
])("bun %s --help says --ignore-scripts also skips the scripts of trusted dependencies", async subcommand => {
await using proc = spawn({
cmd: [bunExe(), subcommand, "--help"],
env: baseEnv,
stdout: "pipe",
stderr: "pipe",
});
const [stdout, stderr, exitCode] = await Promise.all([proc.stdout.text(), proc.stderr.text(), proc.exited]);

const entry = stdout.split(/\r?\n/).find(line => line.includes("--ignore-scripts"));
expect(entry).toBeDefined();
expect(entry).toContain("trusted dependencies");
// The wording from before trustedDependencies existed.
expect(entry).not.toContain("dependency scripts are never run");
expect(stderr).toBe("");
expect(exitCode).toBe(0);
});

// waiter thread is only a thing on Linux.
for (const forceWaiterThread of isLinux ? [false, true] : [false]) {
describe.concurrent("lifecycle scripts" + (forceWaiterThread ? " (waiter thread)" : ""), async () => {
Expand Down
Loading