turbo icon indicating copy to clipboard operation
turbo copied to clipboard

Input of `**/*.js` does not match *.js files in root directory of package.

Open sppatel opened this issue 3 years ago • 1 comments

What version of Turborepo are you using?

1.2.9

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

Yarn v1

What operating system are you using?

Mac

Describe the Bug

Consider a package with the following structure.

./foo.js ./somedir/foo.js

An input for a task with **/*.js should match on both files.

However it only matches on ./somedir/foo.js`

Expected Behavior

**/*.js should be matching on files in the root of the package. The workaround is having to add both **/*.js and *.js which is not ideal.

To Reproduce

Create a task with the following input.

"inputs": [
        "**/*.js",
      ],

Modify a js file in a nested directory - the finger print will change.

Modify a js file in the root of the package - the finger print will not change.

sppatel avatar May 17 '22 15:05 sppatel

The pipeline inputs feature is simply not usable safely at the moment since we cannot exclude nor reuse common glob patterns, only workaround is to repeat/duplicate/copy-paste indeed.

hubertkuoch avatar Aug 10 '22 10:08 hubertkuoch

inputs use a different globbing syntax than outputs. I've opened a PR to document this here:

https://github.com/vercel/turborepo/pull/1690

dobesv avatar Aug 12 '22 22:08 dobesv

This is fixed in #1699 and will be available with the next canary

gsoltis avatar Aug 17 '22 17:08 gsoltis