Skip to content
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

feat(storybook): from addon knobs to controls #6068

Merged
merged 1 commit into from
Jun 25, 2021

Conversation

mandarini
Copy link
Member

@mandarini mandarini commented Jun 18, 2021

Our Storybook package now uses @storybook/addon-knobs. This will be deprecated in Storybook v7. The time has come to move to @storybook/addon-controls

note: please be patient, still working on it

What this includes

For new Nx workspaces

  • Generators that will generate your Storybook configuration files and your Stories using Controls/args instead of knobs
  • The same generator (storybook-configuration) will install the @storybook/addon-essentials package, part of which is @storybook/addon-controls, and it includes some more "essential" Storybook features (eg. docs). You can disable features you do not need anytime in your main.js.
  • Cypress e2e tests will be generated, using the args URL to set args in the controls.

For existing Nx workspaces

  • If you nx migrate to the latest version, your package.json will be updated to include the @storybook/addon-essentials package. The @storybook/addon-essentials addon will be added in your addons array in your root main.js file. You will need to run npm/yarn install to have it installed.
  • If you install manually the latest version of @nrwl/storybook, @nrwl/workspace and @nrwl/angular or @nrwl/react, you will need to manually do yarn add -D @storybook/addon-essentials. You will also need to add the addon manually in your addons array in your root main.js file.
  • All the stories you generate from that moment on will be using controls/args
  • Your existing stories will not be touched and will still work

@vercel
Copy link

vercel bot commented Jun 18, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/nrwl/nx-dev/DKKv6aorbFF9P62hrxCmLETwW94v
✅ Preview: https://nx-dev-git-fork-mandarini-feat-storybook-controls-nrwl.vercel.app

@nx-cloud
Copy link

nx-cloud bot commented Jun 18, 2021

Nx Cloud Report

CI ran the following commands for commit 7c993ae. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this branch

Status Command
#000000 nx affected --target=build --parallel --max-parallel=3
#000000 nx affected --target=e2e
#000000 nx affected --target=lint --parallel --max-parallel=4
#000000 nx affected --target=test --parallel --max-parallel=2
#000000 nx build typedoc-theme

Sent with 💌 from NxCloud.

Copy link

@yannbf yannbf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome stuff!!! Can't wait to see controls included in the upcoming versions 😎

I added a few comments, feel free to ignore or reach out about them!

@mandarini
Copy link
Member Author

mandarini commented Jun 22, 2021

Updated todo list:

  • On the Angular side, it does not install the Storybook dependencies (fix coming up fix(angular): fix storybook-configuration not installing deps #6109)
  • How to treat existing older migrations? - do not change anything there
  • Bring back the knobs dependency, we don't want to break existing solutions - not removing knobs during any migration in any case

Copy link
Member

@juristr juristr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@github-actions
Copy link

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
scope: storybook Issues related to Storybook support in Nx
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants