这是indexloc提供的服务,不要输入任何密码
Skip to content

Turbo 1.2.0 runs task against all packages when result of filtering is empty #958

@uhyo

Description

@uhyo

What version of Turborepo are you using?

1.2.0-canary.3

What package manager are you using / does the bug impact?

npm

What operating system are you using?

Mac

Describe the Bug

If no package is found with --filter or --scope options, turbo 1.2.0 runs task against all packages instead of none.

1.1.6 fails with following message:

 ERROR  failed resolve packages to run invalid scope: No packages found matching the provided scope pattern.

Expected Behavior

Either do nothing or error out.

Personally I prefer the former; if the latter is adopted, an option to suppress the error would be nice.
Our particular use case is to copy subset of entire monorepo into Docker image.

To Reproduce

Commands:

npx create-turbo
# proceed with default answers
cd my-turborepo
npm i -D turbo@canary
npx turbo run build --filter=aaaaa

Output:

• Packages in scope: 
• Running build in 0 packages
docs:build: cache miss, executing 6f8372745fc556e1
web:build: cache miss, executing 3f7cbe2bf762546c
web:build: 
web:build: > web@0.0.0 build
web:build: > next build
web:build: 
docs:build: 
docs:build: > docs@0.0.0 build
docs:build: > next build
docs:build: 
web:build: info  - Checking validity of types...
docs:build: info  - Checking validity of types...
web:build: info  - Creating an optimized production build...
docs:build: info  - Creating an optimized production build...
web:build: info  - Compiled successfully
web:build: info  - Collecting page data...
docs:build: info  - Compiled successfully
docs:build: info  - Collecting page data...
web:build: info  - Generating static pages (0/3)
docs:build: info  - Generating static pages (0/3)
web:build: info  - Generating static pages (3/3)
web:build: info  - Finalizing page optimization...
web:build: 
web:build: Page                                       Size     First Load JS
web:build: ┌ ○ /                                      304 B          71.3 kB
web:build: └ ○ /404                                   193 B          71.2 kB
web:build: + First Load JS shared by all              71 kB
web:build:   ├ chunks/framework-71b7ac9748a53568.js   42 kB
web:build:   ├ chunks/main-24e9726f06e44d56.js        26.9 kB
web:build:   ├ chunks/pages/_app-2ad88a182aea1df3.js  1.37 kB
web:build:   └ chunks/webpack-45f9f9587e6c08e1.js     729 B
web:build: 
web:build: ○  (Static)  automatically rendered as static HTML (uses no initial props)
web:build: 
docs:build: info  - Generating static pages (3/3)
docs:build: info  - Finalizing page optimization...
docs:build: 
docs:build: Page                                       Size     First Load JS
docs:build: ┌ ○ /                                      305 B          71.3 kB
docs:build: └ ○ /404                                   193 B          71.2 kB
docs:build: + First Load JS shared by all              71 kB
docs:build:   ├ chunks/framework-71b7ac9748a53568.js   42 kB
docs:build:   ├ chunks/main-24e9726f06e44d56.js        26.9 kB
docs:build:   ├ chunks/pages/_app-2ad88a182aea1df3.js  1.37 kB
docs:build:   └ chunks/webpack-45f9f9587e6c08e1.js     729 B
docs:build: 
docs:build: ○  (Static)  automatically rendered as static HTML (uses no initial props)
docs:build: 

 Tasks:    2 successful, 2 total
Cached:    0 cached, 2 total
  Time:    10.953s 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions