boltpkg / bolt

⚡️ Super-powered JavaScript project management
MIT License
2.35k stars 82 forks source link

Local paths containing '@' aren't handled properly #239

Closed Blasz closed 5 years ago

Blasz commented 5 years ago
Title Description
Version v0.23.3
Type Issue
node v10.9.0

Ran into a gnarly bug where running an upgrade command with a local path that includes an '@' chops off the path afterwards. E.g. bolt upgrade @atlaskit/button@file:.yalc/@atlaskit/button results in the version being parsed as file:.yalc/ due to https://github.com/boltpkg/bolt/blob/master/src/utils/options.js#L68 splitting on '@'.

I'm running this problem after:

  1. Linking an external dependency via yalc - which updates package.json to a local path containing the package name
  2. Running bolt afterwards to reinstall new dependencies after pulling master
  3. Bolt workspace validation complains after noticing version discrepancies between the local path in the root and each workspace containing the version that was installed previously
  4. Running the upgrade command above to enforce them to all be the same local path

It's a bit convoluted since the better way to fix the bolt validation errors is to just revert the yalc changes, run bolt and then re-apply them.