[Feature] A command to just download and cache dependencies from lockfile #4380
Replies: 3 comments
-
I created #4529 before finding this discussion. (I only searched issues, not discussions!) I've been able to write a plugin that does this, but ended up having to reimplement parts of the resolution process within the plugin, since there is no API to resolve dependencies without reading |
Beta Was this translation helpful? Give feedback.
-
I created a small package that recreates the full workspace structure with dummy Using it like this COPY .yarn ./.yarn
COPY yarn.lock .yarnrc.yml ./
RUN yarn dlx yarn-lock-to-package-json
RUN yarn install --immutable |
Beta Was this translation helpful? Give feedback.
-
here is my plugin (based on yarn-lock-to-package-json): |
Beta Was this translation helpful? Give feedback.
-
I had an idea for something, discovered
pnpm
already has the feature. Would like to create it as a plugin, any ideas where to start?Describe the user story
As a developer using Dockerfiles with my monorepo based application, I often have to do lots of hacks to maintain docker cache of yarn install (including creating subsets of package.json with
jq
, https://stackoverflow.com/a/59606373 ). I would like to be able to separate the download and install/link steps ofyarn install
so that the download part can be cached in a separate layer (that can then be used as a base image by all the applications in the monorepo).Describe the solution you'd like
A command similar to
pnpm fetch
that uses the lockfile to populate the yarn cache with the dependencies required for a full install or a focus install.This cmd will use just the
yarn.lock
,.yarnrc.yml
, and.yarn
folder to populate the yarn cache.Describe the drawbacks of your solution
Would add some complexity and need to work without a
package.json
.Describe alternatives you've considered
Beta Was this translation helpful? Give feedback.
All reactions