Do you want to request a feature or report a bug?
Feature
What is the current behavior?
yarn generate-lock-entry emits a file with only root dependencies.
If the current behavior is a bug, please provide the steps to reproduce.
What is the expected behavior?
To have a command/option for emitting a complete lock-file like with yarn install.
Please mention your node.js, yarn and operating system version.
Yarn: 1.6.0
npm has npm install --package-lock-only command for this.
I like the idea. Shouldn't be too hard to implement.
I found myself needing this today as well. Would this be a difficult thing to implement?
Wow, a feature that npm has that yarn doesn't. Must be a first :)
A few other sites ask why this is necessary. In my case, I need to generate the lockfile because one of the dependencies of some package is failing to build, so I can't install. However I can't trace it down without having a lockfile to show what those dependencies are.
This would be awesome for when you keep your yarn.lock tracked in git, but build your app inside Docker. Without this feature, you always have a useless node_modules folder.
Following https://stackoverflow.com/questions/44438303/is-it-possibile-to-generate-a-yarn-lock-file-without-installing-the-packages you could perhaps work around this with:
npm install --package-lock-only; yarn import; rm package-lock.json
@sesam wouldn't this have the issues of creating a different lockfile compared to generating it through yarn install?
From what I know, yarn and npm handles the dependencies tree a bit different (granted that the differences are really small).
I've seen cases where yarn installs different versions of dependencies compared to npm, therefore creating a different yarn.lock each time you generate it through install vs import from package-lock.json.
Having this in mind, I still think that this feature is required in yarn, as there is no true alternative to it, besides installing all the dependencies and the delete the node_modules folder.
Most helpful comment
A few other sites ask why this is necessary. In my case, I need to generate the lockfile because one of the dependencies of some package is failing to build, so I can't install. However I can't trace it down without having a lockfile to show what those dependencies are.