Add @rushstack/storybook-telemetry-stub package#5695
Conversation
…tests Co-authored-by: dmichon-msft <26827560+dmichon-msft@users.noreply.github.com>
Co-authored-by: dmichon-msft <26827560+dmichon-msft@users.noreply.github.com>
dmichon-msft
left a comment
There was a problem hiding this comment.
@copilot Since this is adding a new project, you will also need to update the readme:
rush build -t repo-toolbox
node repo-scripts/repo-toolbox/lib-commonjs/start.js readme
Commit the modified repo readme.
storybook/storybook-telemetry-stub/src/test/telemetryStubV7.test.ts
Outdated
Show resolved
Hide resolved
storybook/storybook-telemetry-stub/src/test/telemetryStubV7.test.ts
Outdated
Show resolved
Hide resolved
storybook/storybook-telemetry-stub/src/test/telemetryStubV8.test.ts
Outdated
Show resolved
Hide resolved
… remove CHANGELOG files Co-authored-by: dmichon-msft <26827560+dmichon-msft@users.noreply.github.com>
…e Object.entries in tests Co-authored-by: dmichon-msft <26827560+dmichon-msft@users.noreply.github.com>
|
@copilot needs a standard Rush change file (i.e. the one produced by |
Co-authored-by: dmichon-msft <26827560+dmichon-msft@users.noreply.github.com>
|
@copilot The build is failing because the lockfiles contain a ton of unrelated version bumps. Revert the lockfiles to the version in main, then rerun |
Co-authored-by: dmichon-msft <26827560+dmichon-msft@users.noreply.github.com>
Reverted both lockfiles to main and reran |
|
@copilot Since storybook 6 and 7 are officially out of support, go ahead and just hardcode the expected types for them instead of actually installing the corresponding @storybook/telemetry package version. Be sure to reset the lockfiles to the version from origin/main and regenerate them with |
…, reset lockfiles Co-authored-by: dmichon-msft <26827560+dmichon-msft@users.noreply.github.com>
Removed the |
|
|
||
| A stub replacement of `@storybook/telemetry` for use in environments that absolutely forbid outbound | ||
| network connections and want to ensure that Storybook doesn't probe outside of its project folder, | ||
| e.g. for discovering what kind of package manager the repository uses. |
There was a problem hiding this comment.
This README is important, since the usage and underlying motivations are not obvious from looking at the package itself. I think the README can be organized a bit better, along the lines of:
- The problem: Storybook makes network calls (why), mutates package.json (how? why?) during normal operation, etc. These are really separate behaviors, so let's call them out individually rather than rolling them into one sentence.
- Alternatives: Do certain versions of Storybook support environment variables or "off" switches? People from the Storybook community may claim that this stub is not needed for whatever reason, but maybe they are wrong in some edge cases. The README can provide a paragraph that we can use to track those details.
- How does it work: Explain stubbing.
- How do you use it? Briefly explain how somebody enables this in their Rush repo.
octogonz
left a comment
There was a problem hiding this comment.
Approved with comments
|
@copilot Add clarity that this is really targeting old, out-of-support versions (6 and 7 mostly). Newer versions have more complete support for disabling the telemetry layer and not writing the root package.json. |
|
Abandoning this for now in favor of setting the right environment variables when invoking Storybook. |
storybook/storybook-telemetry-stubtostorybook/telemetry-stuband update rush.jsonsrc/index.tstosrc/storybook-telemetry-stub.tsCHANGELOG.jsonandCHANGELOG.mdpackage.json: version0.0.0, removeexportsfield, update directorysanitizeErrorto use generic typeimport * as, remove local expected-export objects, use proper castingrush build -t repo-toolboxand update README@storybook/telemetryfrombrowser-approved-packages.jsontononbrowser-approved-packages.jsonObject.entriesin test loops instead of separate key lookup@rushstack/storybook-telemetry-stubrush updatefor minimal diff@storybook/telemetry-7dependency, hardcode v7 exports in test✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.