[ rush scan] feat: modify rush scan, support executing projects under rush and custom scanning folders.
Summary
- Support for using -o to specify the project to be scanned in a repository that has been connected to rush.
- Support for specifying the folder to be scanned.
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
I think it may be useful to follow the rush approach and allow special filter types, ex. -o path:<path-to-folder> would include only the projects under a specific folder, instead of using a dedicated parameter. This would mean that you would be selecting all projects under that folder though, but I think that's pretty much what you're trying to accomplish here.
oh, rush already has this -o path:<path-to-folder> filter ? i can change to use SelectionParameterSet to allow all rush filter. So in future, we can add other special filter in SelectionParameterSet @D4N14L what do you think ?