-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
CLI: Re-Add Nuxt support #28607
CLI: Re-Add Nuxt support #28607
Conversation
☁️ Nx Cloud ReportCI is running/has finished running commands for commit 54ec63f. As they complete they will appear below. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this CI Pipeline Execution ✅ Successfully ran 1 targetSent with 💌 from NxCloud. |
@tobiasdiez
|
@tobiasdiez npx nuxi@latest init (pnpm)
@ndelangen This might be CPC related, though. |
Thanks for this PR and your tests!
I can reproduce it as well. The problem is that in our setup Simplest solution: just add More involved solution: make it possible that presets return a javascript object as builder, instead of only a module name. (Similar to how eslint v9 is handling plugins now). Do you have any preference, or another idea? |
I've fixed this already in the main branch by adding lodash to optimizeDeps: |
@tobiasdiez Take a look at https://github.com/storybookjs/storybook/blob/next/code/frameworks/angular/src/preset.ts#L31. You can see that you can also just pass an absolute path as a value. With this approach, you make sure that |
Many thanks. This worked like a charm! 🚀 In nuxt-modules/storybook#729, I've now also added e2e tests (using this PR here to add storybook to a nuxt starter). Running |
@valentinpalkovic @tobiasdiez Maybe it is best if we have Nuxt sandbox over here:
|
@tobiasdiez As Kasper mentioned, we could add Nuxt to our sandboxes, and you could test the sandbox on this PR and rerun it every time you release a new Canary version. Otherwise, I don't see an easy way to copy over our test suite setup to your repository. |
Hello @tobiasdiez do you have any news when this draft will be merged ? |
@kasperpeulen @valentinpalkovic Thanks for the suggestion. Adding a sandbox would indeed give some confidence that things are working, but I was hoping for a solution that we can apply in downstream projects (e.g. that PRs to the nuxt storybook addon are not breaking things). Similar to https://www.npmjs.com/package/@apollo/server-integration-testsuite. @KeremTurkyilmaz We first need to fix the major bugs in the nuxt module. Help moving this forward is of course very welcome! |
@tobiasdiez Unfortunately, we don't have a dedicated testsuite solution like Apollo does. :/ |
@hacknug I think we should go for something like that. Making sure both CI in storybook works, and the nuxt framework is not forced to use it for Another way might be to just somehow hardcode in the CLI that the nuxt generator always get the cli templates from the vue3 package when sandboxes are generated. |
This assumption was not correct as those are the arguments passed to From what I can see, the change should be made to I'd say adding Only issue I see is that the repo description for |
const hasFrameworkTemplates = (framework?: SupportedFrameworks) => { | ||
if (!framework) { | ||
return false; | ||
} | ||
// Nuxt has framework templates, but for sandboxes we create them from the Vue3 renderer | ||
// As the Nuxt framework templates are not compatible with the stories we need for CI. | ||
// See: https://github.com/storybookjs/storybook/pull/28607#issuecomment-2467903327 | ||
if (framework === 'nuxt') { | ||
return process.env.IN_STORYBOOK_SANDBOX !== 'true'; | ||
} |
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.
@tobiasdiez @hacknug I now only create the default stories (using those from the vue3 renderer) in the sandboxes.
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.
Sounds good to me!
Ideally, you would test against https://github.com/nuxt-modules/storybook/tree/main/examples/showcase, which has the highest coverage of features.
…6884 # Conflicts: # code/lib/create-storybook/src/generators/baseGenerator.ts
@tobiasdiez
to Otherwise I get this warning:
I saw that other people got the same warning: We do add this automatically in the vue3-vite framework: storybook/code/frameworks/vue3-vite/src/plugins/vue-template.ts Lines 3 to 14 in a70b069
Maybe this PR would solve this? |
These stories use render functions with string templates, which means they need to be compiled at runtime. |
Yes, this is the proper way to fix it. But for this to work, we first need #29795. How should we coordinate the new releases? Can you temporarily add the special vite config for nuxt in the e2e tests? Then once #29795 is released, we merge nuxt-modules/storybook#740 and cut a new release? Afterwards the workaround can be removed again here in the main repo. |
Awesome! I merged #29795 and will be making a release soon. Also added the e2e workaround for now! 🤞 |
Package BenchmarksCommit: The following packages have significant changes to their size or dependencies:
|
Before | After | Difference | |
---|---|---|---|
Dependency count | 61 | 61 | 0 |
Self size | 799 KB | 695 KB | 🎉 -104 KB 🎉 |
Dependency size | 13.86 MB | 13.86 MB | 0 B |
Bundle Size Analyzer | Link | Link |
@tobiasdiez the fix you wanted is now part of v8.4.7 (as well as 8.5.0-alpha.18)! I merged the latest |
…6884 # Conflicts: # .circleci/config.yml
CI is allmost green, one failing E2E test, trying to get this merged this week. |
Package BenchmarksCommit: The following packages have significant changes to their size or dependencies:
|
Before | After | Difference | |
---|---|---|---|
Dependency count | 230 | 234 | 🚨 +4 🚨 |
Self size | 79 KB | 79 KB | 0 B |
Dependency size | 29.77 MB | 31.03 MB | 🚨 +1.26 MB 🚨 |
Bundle Size Analyzer | Link | Link |
@storybook/angular
Before | After | Difference | |
---|---|---|---|
Dependency count | 265 | 261 | 🎉 -4 🎉 |
Self size | 363 KB | 363 KB | 0 B |
Dependency size | 34.67 MB | 33.56 MB | 🎉 -1.11 MB 🎉 |
Bundle Size Analyzer | Link | Link |
@storybook/ember
Before | After | Difference | |
---|---|---|---|
Dependency count | 257 | 253 | 🎉 -4 🎉 |
Self size | 22 KB | 22 KB | 0 B |
Dependency size | 32.17 MB | 31.06 MB | 🎉 -1.11 MB 🎉 |
Bundle Size Analyzer | Link | Link |
@storybook/html-webpack5
Before | After | Difference | |
---|---|---|---|
Dependency count | 240 | 244 | 🚨 +4 🚨 |
Self size | 6 KB | 6 KB | 0 B |
Dependency size | 30.32 MB | 31.58 MB | 🚨 +1.26 MB 🚨 |
Bundle Size Analyzer | Link | Link |
@storybook/nextjs
Before | After | Difference | |
---|---|---|---|
Dependency count | 593 | 589 | 🎉 -4 🎉 |
Self size | 471 KB | 471 KB | 0 B |
Dependency size | 84.29 MB | 83.19 MB | 🎉 -1.11 MB 🎉 |
Bundle Size Analyzer | Link | Link |
@storybook/preact-webpack5
Before | After | Difference | |
---|---|---|---|
Dependency count | 238 | 242 | 🚨 +4 🚨 |
Self size | 6 KB | 6 KB | 0 B |
Dependency size | 29.89 MB | 31.16 MB | 🚨 +1.26 MB 🚨 |
Bundle Size Analyzer | Link | Link |
@storybook/react-webpack5
Before | After | Difference | |
---|---|---|---|
Dependency count | 316 | 320 | 🚨 +4 🚨 |
Self size | 6 KB | 6 KB | 0 B |
Dependency size | 41.06 MB | 42.32 MB | 🚨 +1.26 MB 🚨 |
Bundle Size Analyzer | Link | Link |
@storybook/server-webpack5
Before | After | Difference | |
---|---|---|---|
Dependency count | 248 | 252 | 🚨 +4 🚨 |
Self size | 14 KB | 14 KB | 0 B |
Dependency size | 31.30 MB | 32.56 MB | 🚨 +1.26 MB 🚨 |
Bundle Size Analyzer | Link | Link |
@storybook/svelte-webpack5
Before | After | Difference | |
---|---|---|---|
Dependency count | 303 | 307 | 🚨 +4 🚨 |
Self size | 6 KB | 6 KB | 0 B |
Dependency size | 37.89 MB | 39.15 MB | 🚨 +1.26 MB 🚨 |
Bundle Size Analyzer | Link | Link |
@storybook/vue3-webpack5
Before | After | Difference | |
---|---|---|---|
Dependency count | 489 | 493 | 🚨 +4 🚨 |
Self size | 6 KB | 6 KB | 0 B |
Dependency size | 54.29 MB | 55.55 MB | 🚨 +1.26 MB 🚨 |
Bundle Size Analyzer | Link | Link |
@storybook/web-components-webpack5
Before | After | Difference | |
---|---|---|---|
Dependency count | 238 | 242 | 🚨 +4 🚨 |
Self size | 5 KB | 5 KB | 0 B |
Dependency size | 29.94 MB | 31.20 MB | 🚨 +1.26 MB 🚨 |
Bundle Size Analyzer | Link | Link |
@storybook/preset-html-webpack
Before | After | Difference | |
---|---|---|---|
Dependency count | 93 | 102 | 🚨 +9 🚨 |
Self size | 4 KB | 4 KB | 0 B |
Dependency size | 20.23 MB | 22.71 MB | 🚨 +2.48 MB 🚨 |
Bundle Size Analyzer | Link | Link |
@storybook/preset-react-webpack
Before | After | Difference | |
---|---|---|---|
Dependency count | 182 | 191 | 🚨 +9 🚨 |
Self size | 24 KB | 24 KB | 0 B |
Dependency size | 30.99 MB | 33.47 MB | 🚨 +2.48 MB 🚨 |
Bundle Size Analyzer | Link | Link |
@storybook/preset-vue3-webpack
Before | After | Difference | |
---|---|---|---|
Dependency count | 369 | 378 | 🚨 +9 🚨 |
Self size | 9 KB | 9 KB | 0 B |
Dependency size | 45.16 MB | 47.64 MB | 🚨 +2.48 MB 🚨 |
Bundle Size Analyzer | Link | Link |
Thanks so much, @kasperpeulen and @yannbf, for shepherding this in! |
What I did
Reverts #28479
Checklist for Contributors
Testing
The changes in this PR are covered in the following automated tests:
Manual testing
This section is mandatory for all contributions. If you believe no manual test is necessary, please state so explicitly. Thanks!
Documentation
MIGRATION.MD
Checklist for Maintainers
When this PR is ready for testing, make sure to add
ci:normal
,ci:merged
orci:daily
GH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found incode/lib/cli/src/sandbox-templates.ts
Make sure this PR contains one of the labels below:
Available labels
bug
: Internal changes that fixes incorrect behavior.maintenance
: User-facing maintenance tasks.dependencies
: Upgrading (sometimes downgrading) dependencies.build
: Internal-facing build tooling & test updates. Will not show up in release changelog.cleanup
: Minor cleanup style change. Will not show up in release changelog.documentation
: Documentation only changes. Will not show up in release changelog.feature request
: Introducing a new feature.BREAKING CHANGE
: Changes that break compatibility in some way with current major version.other
: Changes that don't fit in the above categories.🦋 Canary release
This pull request has been released as version
0.0.0-pr-28607-sha-54ec63fe
. Try it out in a new sandbox by runningnpx storybook@0.0.0-pr-28607-sha-54ec63fe sandbox
or in an existing project withnpx storybook@0.0.0-pr-28607-sha-54ec63fe upgrade
.More information
0.0.0-pr-28607-sha-54ec63fe
revert-28479-revert/26884
54ec63fe
1734193152
)To request a new release of this pull request, mention the
@storybookjs/core
team.core team members can create a new canary release here or locally with
gh workflow run --repo storybookjs/storybook canary-release-pr.yml --field pr=28607
Greptile Summary
This PR reverts the removal of Nuxt support in Storybook, restoring functionality that was previously removed due to QA issues before the 8.2 release.
detect.ts
andproject_types.ts
, using@storybook-vue/nuxt
packagegenerators/NUXT/index.ts
, including@nuxtjs/storybook
module integrationnuxt-vite/default-ts
marked asinDevelopment
with Vite builderThe changes appear comprehensive but lack test coverage and documentation updates that should be addressed before merging.