whitespace-se / storybook-addon-html

A Storybook addon that extracts and displays compiled syntax-highlighted HTML
Other
95 stars 43 forks source link

Storybook 8 compatibility #112

Closed joevaugh4n closed 5 months ago

joevaugh4n commented 6 months ago

Hey @jeanfredrik! I’m reaching out from the core SB team :)

Storybook 8 (our next major release) is coming soon, and it introduces some breaking changes that your addon might need to account for.

We’ve listed all the key changes in a new Storybook 8 migration guide, and we’d encourage you to check it out and see if your addon is impacted.

We also have an addons channel in our Discord community, which we’d like to use to better communicate with addon authors in the future. If you’re not part of the server, consider joining here and message me (@joevaugh4n) so that I can give you the addon creator role! If you’re already in the server, please just ping me and I’ll respond to you there.

Thanks for being a part of our addon community!

Joe

JamesIves commented 6 months ago

This is incompatible after the version 8 update.

dgonzalezr commented 6 months ago

Not sure if this plugin is still maintained. There is a pull request pending from months to update to Prettier 3 and still nothing, so, I assume this request will also be held 😕

soullivaneuh commented 6 months ago

This is incompatible after the version 8 update.

@JamesIves What do you mean by incompatible? I indeed have the following warning message:

WARN The following packages are incompatible with Storybook 8.0.0 as they depend on different major versions of Storybook packages:
WARN - @whitespace/storybook-addon-html@5.1.6

However, the plugin looks to do is job by showing the html source code of the rendered componenent.

JamesIves commented 6 months ago

That warning is what I'm referring to.

jbascue commented 6 months ago

Despite the error/warning message, this addon still appears to work correctly in Storybook V8.
I'm hesitant to use this in a production environment, though.

jeanfredrik commented 5 months ago

Hello everyone! Sorry for not taking a look at this. I will look into it now.

jeanfredrik commented 5 months ago

We just released version 6.0.0 which uses Storybook 8 and Prettier 3. Please try to update to the latest version and see if everything works.

francescocaveglia commented 5 months ago

Hi @jeanfredrik

storybook is failing with error

Storybook failed to load the following preset: /my-project/.storybook/main.ts.
Please check whether your setup is correct, the Storybook dependencies (and their peer dependencies) are installed correctly and there are no package version clashes.
If you believe this is a bug, please open an issue on Github.
SB_CORE-SERVER_0002 (CriticalPresetLoadError): Storybook failed to load the following preset: /my-project/node_modules/@whitespace/storybook-addon-html.
Please check whether your setup is correct, the Storybook dependencies (and their peer dependencies) are installed correctly and there are no package version clashes.
If you believe this is a bug, please open an issue on Github.
SB_CORE-SERVER_0002 (CriticalPresetLoadError): Storybook failed to load the following preset: /my-project/node_modules/@whitespace/storybook-addon-html/preset.js.
Please check whether your setup is correct, the Storybook dependencies (and their peer dependencies) are installed correctly and there are no package version clashes.
If you believe this is a bug, please open an issue on Github.
Error: Cannot find module './dist/preset.cjs'

'./dist/preset.cjs' is referenced in package.json but not present in node_modules

jeanfredrik commented 5 months ago

Seems it was built incorrectly before publishing. Try again now with v6.0.1

francescocaveglia commented 5 months ago

File still missing. Same error.

jeanfredrik commented 5 months ago

Thank you for the fast feedback. I removed the reference to the preset in package.json now and published v6.0.2. Hope it works for you!

francescocaveglia commented 5 months ago

Sorry to bother but seems that v6.0.2 is not published


npm info @whitespace/storybook-addon-html

@whitespace/storybook-addon-html@6.0.1 | AGPL-3.0-or-later | deps: none | versions: 28
A Storybook addon that extracts and displays compiled syntax-highlighted HTML
https://github.com/whitespace-se/storybook-addon-html#readme

keywords: storybook-addon, html, code, popular, storybook-addons

dist
.tarball: https://registry.npmjs.org/@whitespace/storybook-addon-html/-/storybook-addon-html-6.0.1.tgz
.shasum: 99fbd126a2d1fef9269dce552eb0fd7879ccce26
.integrity: sha512-JVAaztF/TYNiPJE5z03q6YMQJFuj0TOK6NXR7RvFVMdOLWecv3oKwh8qQOXy7QYEmQXBR6QhElaow14GPm0Igg==
.unpackedSize: 27.4 kB

maintainers:
- olofsandell <olof.sandell@protonmail.com>
- christina.grannas <christina.grannas@gmail.com>
- ynwuay <ynwuay@gmail.com>
- tsubarah <benjamin@tsubarah.com>
- jeanfredrik <jeanfredrik@gmail.com>
- whitespace-se <code@whitespace.se>
- pbrotherton <paul.brotherton@whitespace.se>
- johan-westin <johan.westin@whitespace.se>
- degeer <johan.de.geer@whitespace.se>

dist-tags:
latest: 6.0.1  

published 3 hours ago by jeanfredrik <jeanfredrik@gmail.com>
jeanfredrik commented 5 months ago

Sorry, it is published now.

francescocaveglia commented 5 months ago

Unfortunately I still see the same error on module.exports = require("./dist/preset.cjs");

jeanfredrik commented 5 months ago

What is your config?

francescocaveglia commented 5 months ago

Hi @jeanfredrik the issue was with the getAbsolutePath function (suggested by storybook). Removed it (not really needed in our project) and now works fine.