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

Addon Test: Fix post-install logic for Next.js Vite framework support #29524

Conversation

valentinpalkovic
Copy link
Contributor

@valentinpalkovic valentinpalkovic commented Nov 4, 2024

Closes #

What I did

The @storybook/experimental-nextjs-vite/vite-plugin wasn't set up during @storybook/experimental-addon-test's postinstall script when @storybook/experimental-nextjs-vite is used as a framework.

Checklist for Contributors

Testing

The changes in this PR are covered in the following automated tests:

  • stories
  • unit tests
  • integration tests
  • end-to-end tests

Manual testing

This section is mandatory for all contributions. If you believe no manual test is necessary, please state so explicitly. Thanks!

Documentation

  • Add or update documentation reflecting your changes
  • If you are deprecating/removing a feature, make sure to update
    MIGRATION.MD

Checklist for Maintainers

  • When this PR is ready for testing, make sure to add ci:normal, ci:merged or ci:daily GH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found in code/lib/cli-storybook/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 PR does not have a canary release associated. You can request a canary release of this pull request by mentioning the @storybookjs/core team here.

core team members can create a canary release here or locally with gh workflow run --repo storybookjs/storybook canary-release-pr.yml --field pr=<PR_NUMBER>

name before after diff z %
createSize 0 B 0 B 0 B - -
generateSize 78.1 MB 78.2 MB 51.9 kB 1.28 0.1%
initSize 143 MB 143 MB 51.9 kB 1.3 0%
diffSize 65.1 MB 65.1 MB 0 B 1.41 0%
buildSize 6.88 MB 6.88 MB 0 B 1.7 0%
buildSbAddonsSize 1.51 MB 1.51 MB 0 B - 0%
buildSbCommonSize 195 kB 195 kB 0 B - 0%
buildSbManagerSize 1.9 MB 1.9 MB 0 B 1.67 0%
buildSbPreviewSize 271 kB 271 kB 0 B - 0%
buildStaticSize 0 B 0 B 0 B - -
buildPrebuildSize 3.88 MB 3.88 MB 0 B 1.67 0%
buildPreviewSize 3 MB 3 MB 0 B 1.73 0%
testBuildSize 0 B 0 B 0 B - -
testBuildSbAddonsSize 0 B 0 B 0 B - -
testBuildSbCommonSize 0 B 0 B 0 B - -
testBuildSbManagerSize 0 B 0 B 0 B - -
testBuildSbPreviewSize 0 B 0 B 0 B - -
testBuildStaticSize 0 B 0 B 0 B - -
testBuildPrebuildSize 0 B 0 B 0 B - -
testBuildPreviewSize 0 B 0 B 0 B - -
name before after diff z %
createTime 8.2s 6.5s -1s -687ms -0.96 -25.7%
generateTime 25.5s 19.3s -6s -126ms -0.99 -31.6%
initTime 17.6s 13s -4s -674ms -1.59 🔰-35.9%
buildTime 8.7s 9.2s 496ms 0.32 5.4%
testBuildTime 0ms 0ms 0ms - -
devPreviewResponsive 6.5s 7.2s 696ms 1.29 🔺9.6%
devManagerResponsive 4.4s 4.4s -32ms 0.89 -0.7%
devManagerHeaderVisible 604ms 672ms 68ms 0.39 10.1%
devManagerIndexVisible 693ms 750ms 57ms 0.5 7.6%
devStoryVisibleUncached 1.1s 1.2s 66ms 0.45 5.3%
devStoryVisible 686ms 752ms 66ms 0.63 8.8%
devAutodocsVisible 577ms 684ms 107ms 1.25 🔺15.6%
devMDXVisible 558ms 610ms 52ms 0.72 8.5%
buildManagerHeaderVisible 682ms 632ms -50ms 0.33 -7.9%
buildManagerIndexVisible 704ms 645ms -59ms 0.3 -9.1%
buildStoryVisible 680ms 635ms -45ms 0.37 -7.1%
buildAutodocsVisible 478ms 502ms 24ms 0.25 4.8%
buildMDXVisible 511ms 546ms 35ms 0.74 6.4%

Greptile Summary

Enhanced post-install logic for Next.js Vite framework support in the Storybook test addon, focusing on proper framework detection and plugin configuration.

  • Added support for @storybook/experimental-nextjs-vite annotations import in postinstall.ts
  • Fixed framework detection to handle both @storybook/nextjs and @storybook/experimental-nextjs-vite
  • Added automatic installation of @storybook/experimental-nextjs-vite when using Next.js
  • Updated Vite plugin configuration to properly handle Next.js framework variants

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

LGTM

1 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile

Copy link

nx-cloud bot commented Nov 4, 2024

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 39a13d1. 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 target

Sent with 💌 from NxCloud.

@valentinpalkovic valentinpalkovic added the patch:yes Bugfix & documentation PR that need to be picked to main branch label Nov 4, 2024
@valentinpalkovic valentinpalkovic merged commit 18aaf10 into next Nov 4, 2024
66 of 77 checks passed
@valentinpalkovic valentinpalkovic deleted the valentin/fix-addon-test-init-in-experimental-nextjs-vite branch November 4, 2024 12:06
@shilman shilman changed the title Addon Test: Enhance post-install logic for Next.js Vite framework support Addon Test: Fix post-install logic for Next.js Vite framework support Nov 5, 2024
shilman pushed a commit that referenced this pull request Nov 5, 2024
…it-in-experimental-nextjs-vite

Addon Test: Enhance post-install logic for Next.js Vite framework support

(cherry picked from commit 18aaf10)
@github-actions github-actions bot added the patch:done Patch/release PRs already cherry-picked to main/release branch label Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
addon: test bug ci:normal nextjs patch:done Patch/release PRs already cherry-picked to main/release branch patch:yes Bugfix & documentation PR that need to be picked to main branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants