Skip to content

Conversation

@Sidnioulz
Copy link
Member

@Sidnioulz Sidnioulz commented Jan 14, 2026

What I did

Handled an edge case in the fixed up build and check scripts which I forgot to test. When CLI flags --watch, --no-watch, --prod, --no-prod are set, they are correctly used to skip the relevant questions, BUT I forgot to edit the code that applies prompt replies to the final config, so those flags were still being overridden even though they already had a value.

Checklist for Contributors

Testing

Manual testing

Run yarn build --watch, select some packages, and verify that you are indeed in watch mode.

Run yarn build, verify that you get prompted watch mode and that your choice is respected.

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 publish.yml --field pr=<PR_NUMBER>

Summary by CodeRabbit

  • Bug Fixes
    • CLI-provided watch and production mode flags are now properly preserved during build and check operations instead of being overwritten by default values.

✏️ Tip: You can customize this high-level summary in your review settings.

@Sidnioulz Sidnioulz requested a review from ndelangen January 14, 2026 16:48
@Sidnioulz Sidnioulz added build Internal-facing build tooling & test updates ci:normal labels Jan 14, 2026
@nx-cloud
Copy link

nx-cloud bot commented Jan 14, 2026

View your CI Pipeline Execution ↗ for commit 89c268b

Command Status Duration Result
nx run-many -t compile,check,knip,test,pretty-d... ✅ Succeeded 12m 17s View ↗

☁️ Nx Cloud last updated this comment at 2026-01-20 18:31:51 UTC

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 14, 2026

📝 Walkthrough

Walkthrough

Modified assignment logic in build scripts to use nullish coalescing operators. Instead of unconditionally overwriting watchMode and prodMode flags, the scripts now only assign values when they are currently undefined. This preserves pre-existing flag values such as those from CLI arguments.

Changes

Cohort / File(s) Change Summary
Flag assignment behavior
scripts/build-package.ts, scripts/check-package.ts
Replaced unconditional assignments (watchMode = watch, prodMode = prod) with nullish coalescing assignments (??=). Preserves pre-existing flag values and only assigns when currently undefined.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

✨ Finishing touches
  • 📝 Generate docstrings


📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a215458 and aabca7c.

📒 Files selected for processing (2)
  • scripts/build-package.ts
  • scripts/check-package.ts
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{js,jsx,ts,tsx,json,md,html,css,scss}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Format code using Prettier with yarn prettier --write <file>

Files:

  • scripts/build-package.ts
  • scripts/check-package.ts
**/*.{js,jsx,json,html,ts,tsx,mjs}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Run ESLint checks using yarn lint:js:cmd <file> or the full command cross-env NODE_ENV=production eslint --cache --cache-location=../.cache/eslint --ext .js,.jsx,.json,.html,.ts,.tsx,.mjs --report-unused-disable-directives to fix linting errors before committing

Files:

  • scripts/build-package.ts
  • scripts/check-package.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Enable TypeScript strict mode across all packages

Files:

  • scripts/build-package.ts
  • scripts/check-package.ts
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

**/*.{ts,tsx,js,jsx}: Export functions from modules if they need to be tested
Do not use console.log, console.warn, or console.error directly unless in isolated files where importing loggers would significantly increase bundle size

Files:

  • scripts/build-package.ts
  • scripts/check-package.ts
🧠 Learnings (1)
📚 Learning: 2025-12-22T22:03:40.123Z
Learnt from: CR
Repo: storybookjs/storybook PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-22T22:03:40.123Z
Learning: Applies to **/*.{ts,tsx} : Enable TypeScript strict mode across all packages

Applied to files:

  • scripts/build-package.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: normal
  • GitHub Check: Core Unit Tests, windows-latest
  • GitHub Check: nx
  • GitHub Check: nx
  • GitHub Check: nx
🔇 Additional comments (2)
scripts/check-package.ts (1)

100-100: LGTM! Correctly preserves CLI-provided watchMode value.

The nullish coalescing assignment ensures that when the watch prompt is skipped (because watchMode was already set via --watch or --no-watch), the undefined value from the skipped prompt doesn't overwrite the CLI-provided value.

scripts/build-package.ts (1)

143-144: LGTM! Correctly preserves CLI-provided flag values.

The nullish coalescing assignments ensure that:

  • --watch/--no-watch values are preserved when the watch prompt is skipped
  • --prod/--no-prod values are preserved when the prod prompt is skipped

This is consistent with the same fix applied in check-package.ts.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

@storybook-app-bot
Copy link

Package Benchmarks

Commit: 89c268b, ran on 20 January 2026 at 18:27:13 UTC

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

@storybook/builder-webpack5

Before After Difference
Dependency count 192 192 0
Self size 75 KB 75 KB 🎉 -6 B 🎉
Dependency size 32.24 MB 32.25 MB 🚨 +11 KB 🚨
Bundle Size Analyzer Link Link

storybook

Before After Difference
Dependency count 49 49 0
Self size 20.30 MB 20.32 MB 🚨 +21 KB 🚨
Dependency size 16.52 MB 16.52 MB 🎉 -4 B 🎉
Bundle Size Analyzer Link Link

@storybook/ember

Before After Difference
Dependency count 196 196 0
Self size 15 KB 15 KB 🚨 +30 B 🚨
Dependency size 28.96 MB 28.97 MB 🚨 +11 KB 🚨
Bundle Size Analyzer Link Link

@storybook/nextjs

Before After Difference
Dependency count 538 538 0
Self size 646 KB 646 KB 🎉 -130 B 🎉
Dependency size 59.22 MB 59.73 MB 🚨 +505 KB 🚨
Bundle Size Analyzer Link Link

@storybook/nextjs-vite

Before After Difference
Dependency count 127 127 0
Self size 1.12 MB 1.12 MB 🚨 +14 B 🚨
Dependency size 21.82 MB 22.32 MB 🚨 +496 KB 🚨
Bundle Size Analyzer Link Link

@storybook/react-native-web-vite

Before After Difference
Dependency count 159 159 0
Self size 30 KB 30 KB 🚨 +8 B 🚨
Dependency size 23.00 MB 23.61 MB 🚨 +610 KB 🚨
Bundle Size Analyzer Link Link

@storybook/react-vite

Before After Difference
Dependency count 117 117 0
Self size 35 KB 35 KB 🎉 -26 B 🎉
Dependency size 19.62 MB 20.11 MB 🚨 +496 KB 🚨
Bundle Size Analyzer Link Link

@storybook/react-webpack5

Before After Difference
Dependency count 278 278 0
Self size 24 KB 24 KB 🎉 -10 B 🎉
Dependency size 44.13 MB 44.64 MB 🚨 +505 KB 🚨
Bundle Size Analyzer Link Link

@storybook/server-webpack5

Before After Difference
Dependency count 204 204 0
Self size 16 KB 16 KB 🎉 -10 B 🎉
Dependency size 33.49 MB 33.50 MB 🚨 +11 KB 🚨
Bundle Size Analyzer Link Link

@storybook/cli

Before After Difference
Dependency count 183 183 0
Self size 775 KB 775 KB 🚨 +219 B 🚨
Dependency size 67.38 MB 67.47 MB 🚨 +92 KB 🚨
Bundle Size Analyzer Link Link

@storybook/codemod

Before After Difference
Dependency count 176 176 0
Self size 30 KB 30 KB 🎉 -40 B 🎉
Dependency size 65.95 MB 66.05 MB 🚨 +92 KB 🚨
Bundle Size Analyzer Link Link

create-storybook

Before After Difference
Dependency count 50 50 0
Self size 1000 KB 999 KB 🎉 -48 B 🎉
Dependency size 36.82 MB 36.84 MB 🚨 +21 KB 🚨
Bundle Size Analyzer node node

@storybook/preset-react-webpack

Before After Difference
Dependency count 170 170 0
Self size 18 KB 18 KB 🎉 -6 B 🎉
Dependency size 31.26 MB 31.28 MB 🚨 +11 KB 🚨
Bundle Size Analyzer Link Link

@storybook/react

Before After Difference
Dependency count 57 57 0
Self size 732 KB 1.23 MB 🚨 +494 KB 🚨
Dependency size 12.94 MB 12.94 MB 🚨 +2 KB 🚨
Bundle Size Analyzer Link Link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build Internal-facing build tooling & test updates ci:normal

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants