Skip to content

Workspace packages are not trusted by default #12960

Description

@vktrl

What version of Bun is running?

1.1.20+ae1948925

What platform is your computer?

Darwin 23.5.0 arm64 arm

What steps can reproduce the bug?

Basic monorepo:

app
├── /libs
│   └── /foo
│       └── package.json
└── package.json

./package.json

{
  "name": "app",
  "workspaces": ["./libs/*"],
  "scripts": {
    "postinstall": "echo Workspace postinstall runs fine"
  }
}

./libs/foo/package.json

{
  "name": "foo",
  "scripts": {
    "postinstall": "echo I would expect this to run because I trust myself explicitly"
  }
}

What is the expected behavior?

Monorepo packages should be tusted and their scripts should run.

What do you see instead?

> bun install
bun install v1.1.20 (ae194892)

$ echo Workspace postinstall runs fine
Workspace postinstall runs fine

Checked 7 installs across 8 packages (no changes) [46.00ms]

> bun pm untrusted
bun pm untrusted v1.1.20 (ae194892)

./node_modules/foo @workspace:libs/foo
 » [postinstall]: echo I would expect this to run because I trust myself explicitly.

These dependencies had their lifecycle scripts blocked during install.

If you trust them and wish to run their scripts, use `bun pm trust`.

Additional information

It would be nice for the trustedDependencies setting to support glob patterns like @foo/* to trust libraries that are using namespaced submodules extensively.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions