wclr / yalc

Work with yarn/npm packages locally like a boss.
MIT License
5.65k stars 148 forks source link

Customize package location #97

Open soanvig opened 5 years ago

soanvig commented 5 years ago

It would be extemely useful for me to customize package location (by --dir switch or something) in both add and publish methods.

In my particular case, I would need that to do some advanced CI jobs. I would like to store yalc packages in directory shared between all my projects. That way I could work with yalc like with private npm repository.

I may implement it in PR if you agree

wclr commented 5 years ago

not sure what you want to achieve with that

soanvig commented 5 years ago

Project A has a pipeline, and builds - let's say - the library.

I run yalc publish with --dir /shared (where /shared is alternative to default ~/.yalc).

Project B has dependency to project A, so during pipeline I can run yalc link --dir /shared projectA.

The primary problem though is the uncustomizable packages path. There at least few reasons why ~/.yalc may be a bad directory.

wclr commented 5 years ago

There at least few reasons why ~/.yalc may be a bad directory.

What reasons?

soanvig commented 5 years ago

Well, not directly bad, but not necessarily wanted for any usage but local development.

  1. Maybe I cannot store such data on $HOME, because it may be mounted/unmounted, which I cannot control. Or the other way - I have to store my data on given directory, and it's not $HOME. Which is not that uncommon, to be honest.
  2. Maybe $HOME is backed up, and I don't want my development packages to be backed up
  3. Maybe I store 99 of other things like that in some shared directory (which is my case already), and that home location is just well, not for THAT.
  4. There may be some permission issues

I don't know, just storage path configurations seems like an obvious feature to me.

wclr commented 5 years ago

Ok I've added --store-folder flag option. You may check.