Core: Improve globbing using dynamic CWD#32990
Merged
ndelangen merged 4 commits intoNov 12, 2025
Merged
Conversation
- calculate dynamic CWD for each story specifier - ensure globby correctly excludes `node_modules` when glob pattern references parent directories
|
View your CI Pipeline Execution ↗ for commit c464c38
☁️ Nx Cloud last updated this comment at |
This comment was marked as spam.
This comment was marked as spam.
Package BenchmarksCommit: The following packages have significant changes to their size or dependencies:
|
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 2 | 2 | 0 |
| Self size | 181 KB | 509 KB | 🚨 +328 KB 🚨 |
| Dependency size | 2.97 MB | 2.97 MB | 🎉 -3 B 🎉 |
| Bundle Size Analyzer | Link | Link |
@storybook/addon-docs
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 18 | 18 | 0 |
| Self size | 1.65 MB | 1.89 MB | 🚨 +232 KB 🚨 |
| Dependency size | 9.25 MB | 10.21 MB | 🚨 +963 KB 🚨 |
| Bundle Size Analyzer | Link | Link |
storybook-addon-pseudo-states
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 0 | 0 | 0 |
| Self size | 21 KB | 24 KB | 🚨 +3 KB 🚨 |
| Dependency size | 692 B | 689 B | 🎉 -3 B 🎉 |
| Bundle Size Analyzer | Link | Link |
@storybook/addon-themes
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 1 | 1 | 0 |
| Self size | 18 KB | 20 KB | 🚨 +2 KB 🚨 |
| Dependency size | 28 KB | 28 KB | 🎉 -3 B 🎉 |
| Bundle Size Analyzer | Link | Link |
@storybook/addon-vitest
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 2 | 6 | 🚨 +4 🚨 |
| Self size | 376 KB | 509 KB | 🚨 +134 KB 🚨 |
| Dependency size | 338 KB | 1.53 MB | 🚨 +1.19 MB 🚨 |
| Bundle Size Analyzer | Link | Link |
@storybook/builder-vite
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 17 | 11 | 🎉 -6 🎉 |
| Self size | 304 KB | 330 KB | 🚨 +25 KB 🚨 |
| Dependency size | 2.00 MB | 1.30 MB | 🎉 -700 KB 🎉 |
| Bundle Size Analyzer | Link | Link |
@storybook/builder-webpack5
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 191 | 187 | 🎉 -4 🎉 |
| Self size | 75 KB | 73 KB | 🎉 -3 KB 🎉 |
| Dependency size | 32.19 MB | 31.98 MB | 🎉 -214 KB 🎉 |
| Bundle Size Analyzer | Link | Link |
storybook
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 39 | 43 | 🚨 +4 🚨 |
| Self size | 19.65 MB | 23.02 MB | 🚨 +3.37 MB 🚨 |
| Dependency size | 16.40 MB | 17.36 MB | 🚨 +959 KB 🚨 |
| Bundle Size Analyzer | Link | Link |
@storybook/angular
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 191 | 187 | 🎉 -4 🎉 |
| Self size | 118 KB | 126 KB | 🚨 +8 KB 🚨 |
| Dependency size | 30.31 MB | 30.00 MB | 🎉 -309 KB 🎉 |
| Bundle Size Analyzer | Link | Link |
@storybook/ember
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 195 | 191 | 🎉 -4 🎉 |
| Self size | 15 KB | 17 KB | 🚨 +1 KB 🚨 |
| Dependency size | 28.91 MB | 28.70 MB | 🎉 -216 KB 🎉 |
| Bundle Size Analyzer | Link | Link |
@storybook/html-vite
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 20 | 14 | 🎉 -6 🎉 |
| Self size | 22 KB | 23 KB | 🚨 +906 B 🚨 |
| Dependency size | 2.34 MB | 1.67 MB | 🎉 -674 KB 🎉 |
| Bundle Size Analyzer | Link | Link |
@storybook/nextjs
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 537 | 533 | 🎉 -4 🎉 |
| Self size | 645 KB | 749 KB | 🚨 +104 KB 🚨 |
| Dependency size | 59.13 MB | 59.04 MB | 🎉 -93 KB 🎉 |
| Bundle Size Analyzer | Link | Link |
@storybook/nextjs-vite
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 128 | 124 | 🎉 -4 🎉 |
| Self size | 1.12 MB | 3.83 MB | 🚨 +2.71 MB 🚨 |
| Dependency size | 21.95 MB | 21.88 MB | 🎉 -66 KB 🎉 |
| Bundle Size Analyzer | Link | Link |
@storybook/preact-vite
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 20 | 14 | 🎉 -6 🎉 |
| Self size | 13 KB | 14 KB | 🚨 +979 B 🚨 |
| Dependency size | 2.33 MB | 1.65 MB | 🎉 -674 KB 🎉 |
| Bundle Size Analyzer | Link | Link |
@storybook/react-native-web-vite
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 160 | 156 | 🎉 -4 🎉 |
| Self size | 30 KB | 31 KB | 🚨 +1 KB 🚨 |
| Dependency size | 23.13 MB | 23.06 MB | 🎉 -68 KB 🎉 |
| Bundle Size Analyzer | Link | Link |
@storybook/react-vite
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 118 | 114 | 🎉 -4 🎉 |
| Self size | 35 KB | 37 KB | 🚨 +2 KB 🚨 |
| Dependency size | 19.75 MB | 19.68 MB | 🎉 -67 KB 🎉 |
| Bundle Size Analyzer | Link | Link |
@storybook/react-webpack5
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 277 | 273 | 🎉 -4 🎉 |
| Self size | 24 KB | 25 KB | 🚨 +1 KB 🚨 |
| Dependency size | 44.08 MB | 43.98 MB | 🎉 -93 KB 🎉 |
| Bundle Size Analyzer | Link | Link |
@storybook/server-webpack5
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 203 | 199 | 🎉 -4 🎉 |
| Self size | 16 KB | 17 KB | 🚨 +962 B 🚨 |
| Dependency size | 33.45 MB | 33.24 MB | 🎉 -214 KB 🎉 |
| Bundle Size Analyzer | Link | Link |
@storybook/svelte-vite
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 24 | 19 | 🎉 -5 🎉 |
| Self size | 56 KB | 59 KB | 🚨 +3 KB 🚨 |
| Dependency size | 27.00 MB | 26.79 MB | 🎉 -212 KB 🎉 |
| Bundle Size Analyzer | Link | Link |
@storybook/sveltekit
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 25 | 20 | 🎉 -5 🎉 |
| Self size | 56 KB | 58 KB | 🚨 +2 KB 🚨 |
| Dependency size | 27.06 MB | 26.85 MB | 🎉 -209 KB 🎉 |
| Bundle Size Analyzer | Link | Link |
@storybook/vue3-vite
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 114 | 109 | 🎉 -5 🎉 |
| Self size | 35 KB | 38 KB | 🚨 +3 KB 🚨 |
| Dependency size | 44.15 MB | 43.95 MB | 🎉 -209 KB 🎉 |
| Bundle Size Analyzer | Link | Link |
@storybook/web-components-vite
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 21 | 15 | 🎉 -6 🎉 |
| Self size | 19 KB | 20 KB | 🚨 +888 B 🚨 |
| Dependency size | 2.37 MB | 1.70 MB | 🎉 -673 KB 🎉 |
| Bundle Size Analyzer | Link | Link |
@storybook/cli
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 173 | 187 | 🚨 +14 🚨 |
| Self size | 773 KB | 928 KB | 🚨 +155 KB 🚨 |
| Dependency size | 66.62 MB | 73.00 MB | 🚨 +6.38 MB 🚨 |
| Bundle Size Analyzer | Link | Link |
@storybook/codemod
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 166 | 169 | 🚨 +3 🚨 |
| Self size | 30 KB | 35 KB | 🚨 +5 KB 🚨 |
| Dependency size | 65.19 MB | 69.43 MB | 🚨 +4.24 MB 🚨 |
| Bundle Size Analyzer | Link | Link |
create-storybook
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 40 | 44 | 🚨 +4 🚨 |
| Self size | 999 KB | 1.55 MB | 🚨 +549 KB 🚨 |
| Dependency size | 36.05 MB | 40.38 MB | 🚨 +4.33 MB 🚨 |
| Bundle Size Analyzer | node | node |
@storybook/csf-plugin
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 9 | 9 | 0 |
| Self size | 8 KB | 9 KB | 🚨 +1 KB 🚨 |
| Dependency size | 1.27 MB | 1.27 MB | 🎉 -3 B 🎉 |
| Bundle Size Analyzer | Link | Link |
@storybook/react-dom-shim
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 0 | 0 | 0 |
| Self size | 18 KB | 22 KB | 🚨 +4 KB 🚨 |
| Dependency size | 791 B | 788 B | 🎉 -3 B 🎉 |
| Bundle Size Analyzer | Link | Link |
@storybook/preset-create-react-app
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 68 | 68 | 0 |
| Self size | 32 KB | 36 KB | 🚨 +4 KB 🚨 |
| Dependency size | 5.98 MB | 5.98 MB | 🎉 -3 B 🎉 |
| Bundle Size Analyzer | Link | Link |
@storybook/preset-react-webpack
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 170 | 170 | 0 |
| Self size | 18 KB | 21 KB | 🚨 +2 KB 🚨 |
| Dependency size | 31.32 MB | 31.32 MB | 🚨 +1 KB 🚨 |
| Bundle Size Analyzer | Link | Link |
@storybook/preset-server-webpack
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 10 | 10 | 0 |
| Self size | 7 KB | 8 KB | 🚨 +2 KB 🚨 |
| Dependency size | 1.20 MB | 1.20 MB | 🚨 +1 KB 🚨 |
| Bundle Size Analyzer | Link | Link |
@storybook/react
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 57 | 57 | 0 |
| Self size | 716 KB | 833 KB | 🚨 +117 KB 🚨 |
| Dependency size | 12.92 MB | 12.92 MB | 🚨 +4 KB 🚨 |
| Bundle Size Analyzer | Link | Link |
@storybook/vue3
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 3 | 3 | 0 |
| Self size | 55 KB | 61 KB | 🚨 +6 KB 🚨 |
| Dependency size | 211 KB | 211 KB | 🎉 -3 B 🎉 |
| Bundle Size Analyzer | Link | Link |
ndelangen
requested changes
Nov 10, 2025
ndelangen
approved these changes
Nov 12, 2025
This was referenced Nov 12, 2025
Member
Member
Author
I have some guesses, and I want to wait for his reply at "#33197 (comment)". |
8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #32835
What I did
node_moduleswhen glob pattern references parent directoriesChecklist for Contributors
Testing
The changes in this PR are covered in the following automated tests:
Manual testing
After the change, the repository mentioned in the issue runs normally, and no errors were found.
Documentation
MIGRATION.MD
Checklist for Maintainers
When this PR is ready for testing, make sure to add
ci:normal,ci:mergedorci:dailyGH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found incode/lib/cli-storybook/src/sandbox-templates.tsMake 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/coreteam here.core team members can create a canary release here or locally with
gh workflow run --repo storybookjs/storybook publish.yml --field pr=<PR_NUMBER>Summary by CodeRabbit