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: Improve support for mono-repos #30216

Merged

Conversation

valentinpalkovic
Copy link
Contributor

@valentinpalkovic valentinpalkovic commented Jan 8, 2025

Closes #

What I did

This PR improves the compatibility of @storybook/experimental-addon-test in mono repos.

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 pull request has been released as version 0.0.0-pr-30216-sha-fd79fd61. Try it out in a new sandbox by running npx [email protected] sandbox or in an existing project with npx [email protected] upgrade.

More information
Published version 0.0.0-pr-30216-sha-fd79fd61
Triggered by @valentinpalkovic
Repository storybookjs/storybook
Branch valentin/improve-monorepo-support-for-addon-test
Commit fd79fd61
Datetime Wed Jan 8 13:37:21 UTC 2025 (1736343441)
Workflow run 12671715430

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=30216

name before after diff z %
createSize 0 B 0 B 0 B - -
generateSize 77.8 MB 77.8 MB 692 B -0.31 0%
initSize 131 MB 131 MB 692 B -0.65 0%
diffSize 53 MB 53 MB 0 B -0.65 0%
buildSize 7.19 MB 7.19 MB 0 B 1.67 0%
buildSbAddonsSize 1.85 MB 1.85 MB 0 B - 0%
buildSbCommonSize 195 kB 195 kB 0 B - 0%
buildSbManagerSize 1.87 MB 1.87 MB 0 B -1.22 0%
buildSbPreviewSize 0 B 0 B 0 B - -
buildStaticSize 0 B 0 B 0 B - -
buildPrebuildSize 3.91 MB 3.91 MB 0 B -1.22 0%
buildPreviewSize 3.28 MB 3.28 MB 0 B 1.7 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 6.6s 23.9s 17.3s 1.27 🔺72.3%
generateTime 19.2s 20.6s 1.3s -0.02 6.5%
initTime 13.7s 13.8s 13ms -0.17 0.1%
buildTime 9s 9.6s 519ms -0.12 5.4%
testBuildTime 0ms 0ms 0ms - -
devPreviewResponsive 4.9s 5s 73ms -0.43 1.5%
devManagerResponsive 3.7s 3.6s -86ms -0.67 -2.4%
devManagerHeaderVisible 586ms 722ms 136ms 1.38 🔺18.8%
devManagerIndexVisible 617ms 748ms 131ms 1.12 17.5%
devStoryVisibleUncached 2s 1.6s -380ms -0.97 -22.7%
devStoryVisible 618ms 746ms 128ms 1.02 17.2%
devAutodocsVisible 444ms 697ms 253ms 1.41 🔺36.3%
devMDXVisible 502ms 663ms 161ms 1.56 🔺24.3%
buildManagerHeaderVisible 642ms 604ms -38ms -0.4 -6.3%
buildManagerIndexVisible 741ms 695ms -46ms -0.52 -6.6%
buildStoryVisible 610ms 585ms -25ms -0.39 -4.3%
buildAutodocsVisible 548ms 574ms 26ms 1.13 4.5%
buildMDXVisible 487ms 541ms 54ms 0.89 10%

Greptile Summary

Improved path resolution and configuration handling for the Storybook test addon to better support monorepo setups.

  • Added findUp utility to locate Vitest config files in parent directories in code/addons/test/src/node/vitest-manager.ts
  • Updated path resolution in postinstall script using path.join() with proper dirname handling for ESM/CJS compatibility
  • Added support for multiple Vitest config file extensions (.ts, .js, .json) in workspace configurations
  • Updated documentation with proper path resolution examples for React, Vue, and Svelte configurations in monorepos

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.

3 file(s) reviewed, 2 comment(s)
Edit PR Review Bot Settings | Greptile

code/addons/test/src/node/vitest-manager.ts Show resolved Hide resolved
docs/_snippets/vitest-plugin-vitest-workspace.md Outdated Show resolved Hide resolved
Copy link

nx-cloud bot commented Jan 8, 2025

View your CI Pipeline Execution ↗ for commit 39c08e9.

Command Status Duration Result
nx run-many -t build --parallel=3 ✅ Succeeded 1m 37s View ↗

☁️ Nx Cloud last updated this comment at 2025-01-08 14:48:10 UTC

@valentinpalkovic valentinpalkovic self-assigned this Jan 8, 2025
@valentinpalkovic valentinpalkovic merged commit e3b6c66 into next Jan 9, 2025
58 of 60 checks passed
@valentinpalkovic valentinpalkovic deleted the valentin/improve-monorepo-support-for-addon-test branch January 9, 2025 08:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants