-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce React Scanner for component usage stats (#65463)
* Try: React Scanner for componenent usage stats * Fix globs and exclude dirs * Update glob to avoid native files * Filter out non-component elements * Add comments and exclude more dirs * Merge experimental and unstable components with canonical names * Specify processors explicitly * Count component usage only * Add back omitted comment * Bump react-scanner to v1.2.0 * Only count wp/components imports from outside the package * Default to components and props processor * Default to raw-report * Specify output directory, gitignore it * Fix globs to properly exclude native files * Do not merge unstable and experimental stats with canonical ones * Exclude a few more dirs Co-authored-by: tyxla <[email protected]> Co-authored-by: ciampo <[email protected]>
- Loading branch information
1 parent
2b67cd9
commit 09def42
Showing
4 changed files
with
270 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
module.exports = { | ||
// Crawl the entire repo | ||
crawlFrom: './', | ||
// Needed for properly reporting components with dot notation | ||
includeSubComponents: true, | ||
// Exclude usage in tests, stories, and React Native files. | ||
globs: [ '**/!(test|stories)/!(*native).@(js|ts)?(x)' ], | ||
// Exclude any vendor or docs directories | ||
exclude: [ | ||
'bin', | ||
'build', | ||
'build-module', | ||
'docs', | ||
'node_modules', | ||
'patches', | ||
'platform-docs', | ||
'results', | ||
'schemas', | ||
'storybook', | ||
'test', | ||
'tools', | ||
'typings', | ||
'vendor', | ||
], | ||
/* | ||
* Filter out any non-component React elements and consider only imports of | ||
* `@wordpress/components` outside of the package. | ||
*/ | ||
importedFrom: '@wordpress/components', | ||
processors: [ [ 'raw-report', { outputTo: './results/gutenberg.json' } ] ], | ||
}; |