Skip to content

Core: Fix staticCopy not copying index.html to sub directory#32259

Merged
ndelangen merged 2 commits into
nextfrom
norbert/fix/static-copy
Aug 14, 2025
Merged

Core: Fix staticCopy not copying index.html to sub directory#32259
ndelangen merged 2 commits into
nextfrom
norbert/fix/static-copy

Conversation

@ndelangen
Copy link
Copy Markdown
Member

@ndelangen ndelangen commented Aug 13, 2025

What I did

When a user adds a static assets directory without a to location, it's assumed to be at the top level.
In that case, adding index.html and iframe.html are not allowed, because they'd break the static storybook.

So in the past we added some code to prevent those files from getting copied.

However I discovered a bug, where copying to a-sub-directory/index.html was also blocked.

This PR fixes that bug.

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>

@nx-cloud
Copy link
Copy Markdown

nx-cloud Bot commented Aug 13, 2025

View your CI Pipeline Execution ↗ for commit 32046f0

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

☁️ Nx Cloud last updated this comment at 2025-08-13 20:10:04 UTC

@storybook-app-bot
Copy link
Copy Markdown

Package Benchmarks

Commit: 32046f0, ran on 13 August 2025 at 20:03:27 UTC

The following packages have significant changes to their size or dependencies:

@storybook/cli

Before After Difference
Dependency count 220 219 🎉 -1 🎉
Self size 878 KB 878 KB 🚨 +90 B 🚨
Dependency size 83.28 MB 81.87 MB 🎉 -1.41 MB 🎉
Bundle Size Analyzer Link Link

@storybook/codemod

Before After Difference
Dependency count 189 188 🎉 -1 🎉
Self size 34 KB 35 KB 🚨 +42 B 🚨
Dependency size 78.36 MB 76.95 MB 🎉 -1.41 MB 🎉
Bundle Size Analyzer Link Link

create-storybook

Before After Difference
Dependency count 50 49 🎉 -1 🎉
Self size 1.52 MB 1.52 MB 0 B
Dependency size 49.72 MB 48.32 MB 🎉 -1.41 MB 🎉
Bundle Size Analyzer node node

@ndelangen ndelangen marked this pull request as ready for review August 14, 2025 07:31
Copy link
Copy Markdown
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.

1 file reviewed, no comments

Edit Code Review Bot Settings | Greptile

@ndelangen ndelangen merged commit 5fb9160 into next Aug 14, 2025
53 of 56 checks passed
@ndelangen ndelangen deleted the norbert/fix/static-copy branch August 14, 2025 07:34
@ndelangen ndelangen changed the title Core: Fix staticCopy bug Core: Fix staticCopy not copying index.html to sub directory Aug 20, 2025
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.

1 participant