yarnpkg / yarn

The 1.x line is frozen - features and bugfixes now happen on https://github.com/yarnpkg/berry
https://classic.yarnpkg.com
Other
41.39k stars 2.73k forks source link

Support `yarn package` and `yarn install --local` like bundler #1242

Closed catkins closed 7 years ago

catkins commented 7 years ago

Do you want to request a feature or report a bug?

Feature

Desired behavior

Bundler supports 'vendoring' dependencies out of the box with the bundle package command. This command saves your gems as .gem files into your repo at vendor/cache. You can install from the saved versions using bundle install --local.

http://bundler.io/v1.13/bundle_package.html

This is really handy for deployment and also allows one to be able to do docker builds from a fresh checkout of your application. This is particularly handy if you depend on private packages, and don't want to leak secrets, like git or npm credentials, into your docker image layers.

To get this behaviour on node our team currently use shrinkpack, but a more integrated solution would be ideal. This would help us take advantage of the power of Yarn, whilst still being able to bundle our node packages in our repo.

lime commented 7 years ago

A related discussion that may be of interest can be found in #393.

The way I read that discussion, it sounds like the yarn-offline-mirror setting already does this to some extent..? I can't find any documentation for it though.

Maybe @bestander could shine some light on the current behaviour? They seem to have a solid understanding of what the offline mirror can & can't currently do. :)

bestander commented 7 years ago

Sorry guys, my blog post about this feature is in the last phases. Once I release 0.17.1, I'll push it through. It will be published on the website

catkins commented 7 years ago

Thanks @bestander!

I just read through https://yarnpkg.com/blog/2016/11/24/offline-mirror and it looks like it solves our exact problem.