-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Telemetry: Add portable stories #26764
Conversation
☁️ Nx Cloud ReportCI is running/has finished running commands for commit fee2848. As they complete they will appear below. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this CI Pipeline Execution ✅ Successfully ran 1 targetSent with 💌 from NxCloud. |
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.
Searching the files ourselves seems like a pretty slow way to do it - did you see if there was a file search solution? This package seems like it'd be significantly faster, although it doesn't have many downloads: https://www.npmjs.com/package/fast-find-in-files
Probably having looked around, it's best to do similar to what we have, but perhaps use .read()
or createReadStream()
to avoid having to read the whole file into memory.
@shilman, please consider updating the documentation regarding telemetry. |
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.
LGTM but not sure why there are lockfile changes
describe('getPortableStoriesFileCountUncached', () => { | ||
it('should ignores node_modules, non-source files', async () => { | ||
const usage = await getPortableStoriesFileCountUncached(); | ||
// verify git grep -m1 -c composeStor | wc -l |
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.
Is this comment indicating something is still TODO?
Closes N/A
What I did
Count the number of files that use portable stories and add to Storybook metadata
Checklist for Contributors
Testing
The changes in this PR are covered in the following automated tests:
Manual testing
Run the canary in a test project with
STORYBOOK_TELEMETRY_DEBUG=1
and observeportableStoriesFileCount
.null
"composeStor"
in git then it should be0
"composeStor"
NOTE: The results will be cached for 24h. You can clear the cache by removing
node_modules/.cache
🦋 Canary release
This pull request has been released as version
0.0.0-pr-26764-sha-e9d28dba
. Try it out in a new sandbox by runningnpx storybook@0.0.0-pr-26764-sha-e9d28dba sandbox
or in an existing project withnpx storybook@0.0.0-pr-26764-sha-e9d28dba upgrade
.More information
0.0.0-pr-26764-sha-e9d28dba
shilman/portable-stories-stats
e9d28dba
1720493888
)To request a new release of this pull request, mention the
@storybookjs/core
team.core team members can create a new canary release here or locally with
gh workflow run --repo storybookjs/storybook canary-release-pr.yml --field pr=26764