Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parse yarn.lock file directly #3

Open
madjam002 opened this issue Nov 3, 2022 · 1 comment
Open

Parse yarn.lock file directly #3

madjam002 opened this issue Nov 3, 2022 · 1 comment

Comments

@madjam002
Copy link
Owner

madjam002 commented Nov 3, 2022

Investigate whether we can just parse yarn.lock instead of relying on yarn-manifest.nix.

The manifest would still be a useful optional addon for automatically calculated outputHashes for unplugged modules.

Most info is there in the lock file, dependencies, package names and references, but the difficult bits will probably be:

  • Working out Yarn virtual packages (for peer dependencies, see https://yarnpkg.com/advanced/lexicon#virtual-package), we rely on virtual packages quite a bit. I don't see any easy way of doing this without hacks like import-from-derivation, as virtual package info isn't found in the yarn lockfile.
    Perhaps we first investigate removing virtuals from the manifest file and calculating them at runtime in generate-pnp-file and generate-lockfile, and then we're better positioned to parse the lockfile directly.

  • devDependencies... we'd probably have to source in package.json's of local packages into Nix and then read those to see which dependencies are devDependencies

  • bin paths, we can get this from the lock file, but we should source in the package.json for local packages and read the bin from there so that the lock file doesn't need to be regenerated when adding a new bin during local development

  • shouldBeUnplugged this is a real PITA, I don't think there's any way to avoid this one, so we'll still need the manifest for this and perhaps if the manifest is not provided (as we want to make it optional) then a side effect is any unplugged packages won't be unplugged, perhaps this isn't such a big deal

@madjam002
Copy link
Owner Author

Ongoing work in #4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant