-
Notifications
You must be signed in to change notification settings - Fork 587
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
[lockfile-explorer]Add version validation capability #4712
base: main
Are you sure you want to change the base?
Conversation
import type { Subspace } from '@microsoft/rush-lib/lib/api/Subspace'; | ||
import type { RushConfigurationProject } from '@microsoft/rush-lib/lib/api/RushConfigurationProject'; | ||
import { FileSystem } from '@rushstack/node-core-library'; | ||
import type { CommandModule } from 'yargs'; |
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.
Could you add a test that makes a Jest snapshot of the CLI help? Otherwise it's difficult for code reviewers to review it.
lockfile-explorer [command]
Commands:
lockfile-explorer check Check if the specified package has a
<package-specifier> inconsistent package versions in
target project
lockfile-explorer start Start the application
Options:
-h, --help Show help [boolean]
--version Show version number [boolean]
lockfile-explorer check <package-specifier>
Check if the specified package has a inconsistent package versions in target
project
Positionals:
packageSpecifier The name of the package and version to check [string]
Options:
-h, --help Show help [boolean]
--version Show version number [boolean]
--project The name of the project that should be checked [string]
etc.
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.
done😊
@L-Qun This sounds somewhat related to the earlier Design Proposal: Lockfile Lint which @william2958 prototyped in #4094 🤔 Besides checking "Does this project's dependency tree include multiple copies of And the UX has several possible approaches:
(In fact, it would be possible to provide all 3 approaches for each check.) So your PR seems like a good idea, but I wonder if it maybe it could be a bit more flexible, or build on the Lockfile Lint design. |
Do you mean to update the content here? https://github.com/microsoft/rushstack-websites/blob/main/websites/lfx.rushstack.io/docs |
I think making the lockfile-explorer tool better is a long-term process. Perhaps we can first merge this PR after I update the documentation, and then I will gradually iterate and optimize it. |
3b8cee2
to
57a3144
Compare
Summary
Our team currently has a requirement to analyze whether the dependency tree contains multiple versions of a target package, so I have implemented this feature into lockfile-explorer.
Details
In this PR, I have introduced an additional dependency on yargs to parse arguments. At the same time, we have added new commands
lockfile-lint
andlflint
to verify whether the project complies with the rules specified in thelockfile-lint.json
file.How it was tested
Manually tested with Rushstack repo locally.
Impacted documentation
@william2958