-
Notifications
You must be signed in to change notification settings - Fork 9
feat(storybook): add storybook-webmcp addon for AI agents #1116
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
Changes from 3 commits
3987e27
e1e822f
8efc869
7ae3673
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 |
|---|---|---|
| @@ -1 +1,8 @@ | ||
| legacy-peer-deps=true | ||
|
|
||
| # storybook-webmcp lives on GitHub Packages. Even for public packages, | ||
| # the GHPR npm registry requires a token with read:packages scope. | ||
| # Local dev: export NODE_AUTH_TOKEN=$(gh auth token) | ||
| # CI: pass NODE_AUTH_TOKEN via secrets (e.g. ${{ secrets.GITHUB_TOKEN }}). | ||
| @jbwatenbergscality:registry=https://npm.pkg.github.com | ||
|
Contributor
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.
Combined with |
||
| //npm.pkg.github.com/:_authToken=${NODE_AUTH_TOKEN} | ||
|
Contributor
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. All three CI workflows ( Each workflow needs something like: - run: npm ci
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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.
setup-nodewithregistry-url: "https://registry.npmjs.org"writes//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}to~/.npmrc. SettingNODE_AUTH_TOKENtoGITHUB_TOKENhere means the GitHub token is sent toregistry.npmjs.orgduringnpm ci— credential leakage to a third-party service.The other three workflows don't use
registry-url, so they're fine.To avoid the collision, inject GHPR auth directly instead of through
NODE_AUTH_TOKEN:This keeps GHPR auth out of the
NODE_AUTH_TOKENchannel thatsetup-nodereserves for npmjs, and also means the_authToken=${NODE_AUTH_TOKEN}line in the project.npmrccan be dropped (reducing the local-dev setup burden flagged in the PR description).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.
Good catch — fixed in 7ae3673.
Switched post-release.yml's npm ci step to write the GHPR auth line directly to ~/.npmrc (your exact suggested pattern) so the GitHub token never goes through NODE_AUTH_TOKEN where setup-node's npmjs auth line could pick it up.
I kept the other three workflows (storybook-build, tests, github-pages) on the NODE_AUTH_TOKEN env pattern since none of them call setup-node with registry-url, so the leak path doesn't exist there. Happy to unify all four onto the echo pattern if you'd prefer consistency over minimal-diff.