-
Notifications
You must be signed in to change notification settings - Fork 604
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
[ rush scan] feat: modify rush scan, support executing projects under rush and custom scanning folders. #5046
base: main
Are you sure you want to change the base?
[ rush scan] feat: modify rush scan, support executing projects under rush and custom scanning folders. #5046
Conversation
56179b4
to
6ce11b3
Compare
this._folders = this.defineStringListParameter({ | ||
parameterLongName: '--folder', | ||
parameterShortName: '-f', | ||
argumentName: 'FOLDER', | ||
description: | ||
'The folders that need to be scanned, default is src and lib.' + | ||
'Normally we can input all the folders under the project directory, excluding the ignored folders.' | ||
}); | ||
this._projects = this.defineStringListParameter({ | ||
parameterLongName: '--only', | ||
parameterShortName: '-o', | ||
argumentName: 'PROJECT', | ||
description: 'Projects that need to be checked for phantom dependencies.' | ||
}); |
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.
Ideally this would support all project selection parameters. There is a way to do that for an arbitrary action.
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.
yeah, but i feel that this place is not very suitable for other selection capabilities, such as --to, because some projects may have their own directory structure. If it is --to, it will scan the same folder for these projects.
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.
In actual use, I will detect which folders under the project will be submitted, and then pass these folders to the scan command one by one for scanning, so I think using the --project flag is sufficient.
description: | ||
'The folders that need to be scanned, default is src and lib.' + | ||
'Normally we can input all the folders under the project directory, excluding the ignored folders.' | ||
}); |
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.
Stick the default value here.
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.
Don't quite understand what this [stick] is for.
6ce11b3
to
f2fe6b2
Compare
…tom scanning folders.
f2fe6b2
to
5a2532a
Compare
Co-authored-by: Ian Clanton-Thuon <[email protected]>
Co-authored-by: Ian Clanton-Thuon <[email protected]>
Co-authored-by: Ian Clanton-Thuon <[email protected]>
Co-authored-by: Ian Clanton-Thuon <[email protected]>
Co-authored-by: Ian Clanton-Thuon <[email protected]>
I think it may be useful to follow the |
oh, |
Summary
Details
When I was migrating a pnpm workspace project to rush.
I first set up rush.json and wrote in all the projects.
Using -o to specify the project to be scanned can avoid me going into each project directory to execute scan.
The folders to be scanned under the project are not uniform,
so I got all the folders under the project, and used ignore to read the .gitignore file to exclude,
and finally got all the folders to be scanned,
so this requires customizing the folders to be scanned.
How it was tested
build rush-lib
cd
libraries/rush-lib/src/cli/actions/test/scanRepo
execute
node <path to rush>/libraries/rush-lib/lib-commonjs/start.js scan --json -o b --folder test-folder1
execute
node <path to rush>/libraries/rush-lib/lib-commonjs/start.js scan --json -o a
Why skip ScanAction.test.ts