-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
feat(core): add package manager parsers and stringifiers #11953
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
8f33e6d
to
23c6d57
Compare
9eef2c1
to
8ef53cd
Compare
8ef53cd
to
afcc443
Compare
877f63d
to
afcc443
Compare
scripts/check-lock-files.js
Outdated
@@ -24,7 +24,7 @@ function checkLockFiles() { | |||
} | |||
try { | |||
require('child_process').execSync( | |||
'yarn lockfile-lint -s -n -p yarn.lock -a hosts yarn npm', | |||
'yarn lockfile-lint -s -p yarn.lock -a hosts yarn npm', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We disable this explicitly, because of pnpm
's package name hacks.
237ca9b
to
7f4decf
Compare
I think the pair of parseLockFIle/writeLockFile is a good interface. Some notes and questions:
After all, we want to write lock-file-oriented code in a polymorphic way. E.g., if we want to prune the lock file, we would want to write that code without any specific yarn, npm etc stuff. If it is possible, the parse/write functions cannot be generic. If it is not possible, then I don't think hose functions are needed because the if statement you have inside will have to outside. Does it make sense? We use generics in the same way when creating a project graph. The generic parameter there is not used.
I don't think it should cause I imagine all the unit testing will be done around package-specific functions (you will test npm,yarn,pnpm versions directly).
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some comments.
Thank you for checking the PR. I'll check if we can get rid of generics without making code too messy. But generally, all callers of parse, stringify (and future prune) should be agnostic of package manager (and lock file generic type). Regarding the lock files in script folder, all of that will be gone. It was more convenient while debugging, but I'll drop that entire folder and add tests with fixtures. This would also make the working directory param obsolete. Once I add tests, the PR will be ready for full review. |
ae35845
to
a30e337
Compare
a30e337
to
b27d94b
Compare
Hey guys, why was https://www.npmjs.com/package/@zkochan/js-yaml/v/0.0.6 |
@Nikamura Because of the lock file pruning. The |
This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request. |
This PR adds
parseLockFile
andwriteLockFile
functions tonx
necessary for future pruning functionality and dependency tracking during tasks.Current Behavior
Expected Behavior
Related Issue(s)
Related to #9761