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 docs: Add safe check in Webpack preset #23687

Merged
merged 1 commit into from
Aug 3, 2023

Conversation

yannbf
Copy link
Member

@yannbf yannbf commented Aug 2, 2023

Closes #23945

What I did

This PR adds a fix to addon-docs in circumstances where users have custom webpack configs which end up not having module.rules, and therefore the following error is thrown:

module2.rules is not iterable

How to test

  1. Run a sandbox for template, e.g. yarn task --task sandbox --start-from auto --template react-webpack/18-ts
  2. Add a webpack final that removes module.rules
  3. Run Storybook

It should not break

Checklist

  • Make sure your changes are tested (stories and/or unit, integration, or end-to-end tests)
  • Make sure to add/update documentation regarding your changes
  • If you are deprecating/removing a feature, make sure to update
    MIGRATION.MD

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/src/sandbox-templates.ts
  • Make sure this PR contains one of the labels below.

["cleanup", "BREAKING CHANGE", "feature request", "bug", "build", "documentation", "maintenance", "dependencies", "other"]

🦋 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>

@yannbf yannbf added bug patch:yes Bugfix & documentation PR that need to be picked to main branch addon: docs ci:merged Run the CI jobs that normally run when merged. labels Aug 2, 2023
Copy link
Contributor

@kasperpeulen kasperpeulen left a comment

Choose a reason for hiding this comment

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

LGTM

@yannbf yannbf merged commit ac1a3e2 into next Aug 3, 2023
15 checks passed
@yannbf yannbf deleted the yann/fix-addon-docs-webpack branch August 3, 2023 11:28
@github-actions github-actions bot mentioned this pull request Aug 3, 2023
14 tasks
storybook-bot pushed a commit that referenced this pull request Aug 3, 2023
Addon docs: Add safe check in Webpack preset

(cherry picked from commit ac1a3e2)
@github-actions github-actions bot mentioned this pull request Aug 3, 2023
32 tasks
storybook-bot pushed a commit that referenced this pull request Aug 4, 2023
Addon docs: Add safe check in Webpack preset

(cherry picked from commit ac1a3e2)
storybook-bot pushed a commit that referenced this pull request Aug 7, 2023
Addon docs: Add safe check in Webpack preset

(cherry picked from commit ac1a3e2)
storybook-bot pushed a commit that referenced this pull request Aug 7, 2023
Addon docs: Add safe check in Webpack preset

(cherry picked from commit ac1a3e2)
storybook-bot pushed a commit that referenced this pull request Aug 7, 2023
Addon docs: Add safe check in Webpack preset

(cherry picked from commit ac1a3e2)
storybook-bot pushed a commit that referenced this pull request Aug 7, 2023
Addon docs: Add safe check in Webpack preset

(cherry picked from commit ac1a3e2)
storybook-bot pushed a commit that referenced this pull request Aug 8, 2023
Addon docs: Add safe check in Webpack preset

(cherry picked from commit ac1a3e2)
storybook-bot pushed a commit that referenced this pull request Aug 9, 2023
Addon docs: Add safe check in Webpack preset

(cherry picked from commit ac1a3e2)
storybook-bot pushed a commit that referenced this pull request Aug 9, 2023
Addon docs: Add safe check in Webpack preset

(cherry picked from commit ac1a3e2)
storybook-bot pushed a commit that referenced this pull request Aug 9, 2023
Addon docs: Add safe check in Webpack preset

(cherry picked from commit ac1a3e2)
@kasperpeulen kasperpeulen removed the patch:yes Bugfix & documentation PR that need to be picked to main branch label Aug 9, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Aug 9, 2023

Fails
🚫

PR is not labeled with one of: ["patch:no","patch:yes"]

Generated by 🚫 dangerJS against 2d5a757

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
addon: docs bug ci:merged Run the CI jobs that normally run when merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error: module2.rules is not iterable
2 participants