-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Introduce component usage stats #96882
base: trunk
Are you sure you want to change the base?
Changes from 5 commits
c0fa42a
ebed2a8
e40a557
d072008
79aefcd
1088e62
e0934b3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -87,6 +87,7 @@ | |
"clean:packages": "yarn workspaces foreach --all --parallel --verbose --exclude 'wp-calypso' run clean", | ||
"clean:public": "rm -rf public", | ||
"clean:translations": "rm -rf build/strings calypso-strings.pot chunks-map.*.json || true", | ||
"component-usage-stats": "node ./node_modules/react-scanner/bin/react-scanner -c ./react-scanner.config.js", | ||
"components:storybook:start": "echo 'Storybook in Calypso moved into the root directory. Run `yarn storybook:start` instead.'", | ||
"composite-checkout:storybook:start": "echo 'Deprecated, run `yarn workspace @automattic/composite-checkout run storybook` instead'", | ||
"distclean": "yarn run clean && rm -rf **/node_modules **/.cache .yarn/install-state.gz || true", | ||
|
@@ -303,6 +304,7 @@ | |
"postcss-custom-properties": "^11.0.0", | ||
"prettier": "npm:[email protected]", | ||
"react-refresh": "^0.14.0", | ||
"react-scanner": "1.2.0", | ||
"readline-sync": "^1.4.10", | ||
"recursive-copy": "^2.0.14", | ||
"replace": "^1.1.5", | ||
|
@@ -313,7 +315,7 @@ | |
"stacktrace-gps": "^3.0.3", | ||
"stylelint": "^16.8.2", | ||
"tslib": "^2.3.0", | ||
"typescript": "^5.3.3", | ||
"typescript": "5.3.3", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. React Scanner comes with a newer TS version, so I'm pinning the current one. |
||
"webpack": "^5.95.0", | ||
"webpack-bundle-analyzer": "^4.10.2", | ||
"webpack-cli": "^4.10.0", | ||
|
@@ -413,7 +415,8 @@ | |
"@wordpress/viewport": "6.8.0", | ||
"@wordpress/warning": "3.8.0", | ||
"@wordpress/widgets": "4.8.0", | ||
"@wordpress/wordcount": "4.8.0" | ||
"@wordpress/wordcount": "4.8.0", | ||
"typescript": "5.3.3" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In order for React Scanner to pick our TS version up, we need to specifically pin the resolution version here. |
||
}, | ||
"packageManager": "[email protected]", | ||
"dependenciesMeta": { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
module.exports = { | ||
// Crawl the entire repo | ||
crawlFrom: './', | ||
// Needed for properly reporting components with dot notation | ||
includeSubComponents: true, | ||
// Exclude usage in tests and stories. | ||
globs: [ '**/!(test|stories)/!(*stories).@(js|ts)?(x)' ], | ||
tyxla marked this conversation as resolved.
Show resolved
Hide resolved
|
||
// Exclude any vendor or docs directories | ||
exclude: [ | ||
'bin', | ||
'build', | ||
'build-tools', | ||
'config', | ||
'docs', | ||
'node_modules', | ||
'public', | ||
'results', | ||
'static', | ||
'test', | ||
tyxla marked this conversation as resolved.
Show resolved
Hide resolved
|
||
], | ||
// Consider only imports of `@wordpress/components` | ||
importedFrom: '@wordpress/components', | ||
// Full usage report | ||
processors: [ [ 'raw-report', { outputTo: './results/calypso.json' } ] ], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I understand this is mostly just for automated execution on a server somewhere, but it might be helpful to have There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree - I got this feedback multiple times and I'll be addressing it, first in Gutenberg and in the related script, then here and in the Jetpack PR. |
||
}; |
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.
Ignoring the result dir.
We're going with the same naming choice as in the Gutenberg repo.