kvz/fakefile

Yarn support?

Spaceface16518 opened this issue · 4 comments

The popular package manager Yarn uses the same system as NPM to execute scripts, so the only change would be replacing the:


npm run $(subst -,:,$(MAKECMDGOALS))

and

install:
           npm install

with


yarn run $(subst -,:,$(MAKECMDGOALS))

and

install:
           yarn install

Would there be any way to detect the package manager being used from the makefile? I am not very learned in Makefile, so I wouldn't know.

I do know that users may list engines in the package.json file.

"engines": {
  "yarn":  "^1.5.1"
  }

Maybe check to see if Yarn is the engine, then change the keywords. You would, of course, have to default to NPM.

Just some suggestions.

Amazing package, by the way; helps me a lot!

kvz commented

Thanks for the kind words and the suggestion! I’d be happy to support this, as I am a yarn user myself (but don’t mind npm run for my scripts currently) but also not a makefile expert. Fakefile is the result of much trial & error :) I’d be happy to merge sth that checks for the yarn engine, would you want to give it a shot? Not sure if I’ll find the time to do this shortly

Wow! All that without being a Makefile expert? I'm impressed. I am currently working on an important project, but if I get the time I will try to make so adjustments after learning a little Makefile.

kvz commented

Hey @Spaceface16518 I just added this and will publish 1.0

Wow I kinda forgot that I did this. Hope the project is going well!