Skip to content

turbopack-230324.1

@chris-olszewski chris-olszewski tagged this 23 Mar 23:31
### Description

With #4223, we started checking and throwing on commands that look like
they invoke turbo. The regex is fairly permissive and would match any
command that contained a path that ended in `turbo` e.g. `rm ~/.turbo`
would get marked as invoking turbo.

This PR restricts the regex so it only matches commands that contain
`turbo` surrounded by whitespace. This means that we now won't throw if
the user directly invokes turbo via a path e.g.
`./node_modules/turbo/bin/turbo`. I think this is the correct tradeoff
as it's much more likely a user will invoke turbo via either `turbo foo`
or `pnpm turbo foo`.

Another possibility would be to attempt parse the scripts and do more
exact analysis, but to do this and correctly handle Windows would be
*fun*.

### Testing Instructions

See new unit tests
Assets 2
Loading