vulcan-next icon indicating copy to clipboard operation
vulcan-next copied to clipboard

NPM_PACKAGE_DIRS to mimick a local package directory

Open eric-burel opened this issue 4 years ago • 0 comments

Is your feature request related to a problem? Please describe. Mimick Meteor beloved METEOR_PACKAGE_DIRS feature in NPM.

  • When this variable is set, Meteor will consider each directory listed as a registry package. It will fetch packages from there in priority, and fetch on Atmosphere otherwise
  • When it is not set, it goes back to getting the packages from Atmosphere
  • This behaviour happens at runtime => it means we would need a vulcan CLI command (like vercel, blitz already do for next)

Describe the solution you'd like

Run development mode like this: NPM_PACKAGE_DIRS=<your-vulcan-npm-copy> vulcan dev And so on for each next command that may rely on NPM packages.

Describe alternatives you've considered

  • yalc for the setup. Commands are already documented in the docs.
  • See this ticket: https://github.com/wclr/yalc/issues/50. Yalc seems to also need an install command afterward? To be confirmed.
  • https://github.com/google/zx for writing scripts easily in JS if we need to run commands? Or we might need a more cross-plateform alternative like https://www.npmjs.com/package/shelljs
    • Verdaccio might be something to dig, as it spawns an actual NPM registry locally

Additional context

  • More explanation about why we need this feature, with the example of React: https://github.com/facebook/react/issues/14257
  • Meteor doc: https://docs.meteor.com/environment-variables.html

eric-burel avatar May 10 '21 07:05 eric-burel