Open peteward opened 8 years ago
Hi Peteward,
I have add the same need few days ago. I forked npm-cache to add this functionnality, and I have contacted Swaraj today to propose him to merge my changes.
If you want to try the version I did, you can check it out from the Dashlane repository: https://github.com/Dashlane/npm-cache/tree/add-yarn I have not published anything as I hope I can work with Swaraj to merge it to the npm-cache module
I already tested it with our project using yarn, and so far so good. If you have any issue when testing the yarn support, please tell me so I can fix it.
Best, Guillaume
Thanks Guillaume, I don't unfortunately have much time to work on npm-cache these days. Once every month or so, I go through the PRs and accept them. Check [these docs] for info on how to submit a PR
hi @guillaumemaron,
I took a look at your yarn branch - it looks good to me! (from my limited knowledge).
My only thought is if you should really check for yarn.lock
and would be better checking for package.json
? Although you would expect people to work from a lock file, it's not a requirement.
This would make it more like the composer file version: https://github.com/swarajban/npm-cache/blob/master/cacheDependencyManagers/composerConfig.js
If you open up a PR I would be happy to comment further.
I opened the PR for it, since it seems to have everything we need.
Please review and merge it, when you find the time, @swarajban :)
Has anyone thought about adding support for yarn?
Although yarn is much faster than npm due to caching, for our deployment process (which is on Platform.sh) it still needs to rebuild the entire deps tree, so takes about 45 seconds compared to npm-cache taking 2 seconds to drop in a cached version.
While we can obviously continue using npm, there are other advantages to yarn (especially when dependencies DO change) so it would be great to add this support.