-
Notifications
You must be signed in to change notification settings - Fork 50
[Major refactor] Upgrade to Storbook 10 and align with Storybook Addon Kit #149
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
base: main
Are you sure you want to change the base?
Conversation
src/withHTML.ts
Outdated
| const prettierPluginEstree = await import('prettier/plugins/estree'); | ||
|
|
||
| code = await prettier.format(code, { | ||
| parser: 'babel', |
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.
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.
I've made a PR to this PR that resolves this and updates the major version.
I've also made a build branch on my fork for easy local testing:
"@whitespace/storybook-addon-html": "github:khawkins98/storybook-addon-html#build",
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.
When i use "@whitespace/storybook-addon-html": "github:khawkins98/storybook-addon-html#build", with Storybook 10.1.6. i get this message when starting the project:
▲ Could not resolve addon "@whitespace/storybook-addon-html", skipping. Is it │ installed?
Its correctly located in the node_modules folder.
bug: use html parser for output, bump version
|
@jeanfredrik grateful if you could have a look at this PR as it's holding us back from storybook 10. |
|
How can we get this pushed? I'm using Storybook 10 and I'd love to have this addon |

This pull requests is a suggestion of a major refactoring of the
storybook-addon-htmladdon to solve #145, #147 and #148.Description
Following the Storybook migration guide and the Storybook Addon migration guide this PR suggest the following major changes:
A huge benefit of this change is that the project structure is supported by Storybook. It will make future upgrades easier and the whole addon setup familiar. Changes to align include:
package.jsonstructure and"scripts".scripts/.10.x.This is the latest major version of Storybook. This change requires Storybook files to be ESM only.
Note: projects using this addon can still build component libraries for CJS, but Storybook itself runs and builds as ESM only.
Bonus bug fix
As a bonus this PR also fixes the formatting of the code in the

HTMLtab by using Prettier (which is already an included dependency):Testing
Since this PR contains many significant changes, it should be thoroughly tested. Verify that it builds using
Lint using
And format the code using
Start storybook and verify that the
HTMLtab is correctly displayed and formatted on http://localhost:6006/ usingThank you @jeanfredrik for maintaining this plugin. I hope this PR finds you well.