turbo icon indicating copy to clipboard operation
turbo copied to clipboard

Using {} syntax for OR conditions in inputs does not work when combined with path travesal input

Open sppatel opened this issue 3 years ago • 1 comments

What version of Turborepo are you using?

1.4.6

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

Yarn v1

What operating system are you using?

Mac

Describe the Bug

In testing out https://github.com/vercel/turborepo/issues/1249 - the issue with using {} syntax in inputs appears to be resolved. However I discovered an edge case scenario where it does not work.

This task below works as expected considering all file extensions specified in the input.

  "format": {
    "inputs": ["**/*.{js,jsx,ts,tsx,json,md,mdx}"],
    "outputs": []
  },

This task does not work whenever you change any tsx or ts files in the package.

  "build:types": {
    "dependsOn": ["^build:types"],
    "inputs": ["**/*.{tsx,ts}", "../../tsconfig.json"],
    "outputs": ["./dist/types/**"]
  },

When you take out the path traversal input ../../tsconfig.json then the inputs are correctly considered. It looks like the inclusion of the path traversal input is somehow disregarding the first input in its entirety.

Expected Behavior

The example above should work :)

To Reproduce

Add a task with two inputs, one using the OR syntax and the second with the path traversal input.

sppatel avatar Sep 15 '22 19:09 sppatel

Knowing how this works under the hood, yeah, I'd believe this.

Thank you for the reduction!

nathanhammond avatar Sep 16 '22 03:09 nathanhammond

A lot has changed with globbing since 1.4 to today. If you can still reproduce this problem using canary, please open a new issue with a reproduction there.

anthonyshew avatar Dec 06 '23 04:12 anthonyshew