Skip to content

Chore(cli): Add react-vite-plus sandbox#34503

Open
huang-julien wants to merge 6 commits intonextfrom
chore/react-viteplus-sadbox
Open

Chore(cli): Add react-vite-plus sandbox#34503
huang-julien wants to merge 6 commits intonextfrom
chore/react-viteplus-sadbox

Conversation

@huang-julien
Copy link
Copy Markdown
Contributor

@huang-julien huang-julien commented Apr 8, 2026

Closes #

What I did

This PR adds a new sandbox for React + Vite plus to allow us to test against vite-plus and detect potential issues.

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

Caution

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

Summary by CodeRabbit

  • New Features

    • Added a new React Vite Plus TypeScript sandbox template with Storybook support.
  • Chores

    • Updated CI/CD workflows to include the new sandbox template in daily builds.

@huang-julien huang-julien requested a review from JReinhold April 8, 2026 15:43
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 8, 2026

Fails
🚫 The "#### Manual testing" section must be filled in. Please describe how to test the changes you've made, step by step, so that reviewers can confirm your PR works as intended.

Generated by 🚫 dangerJS against 54f15ec

@huang-julien huang-julien added ci:normal build Internal-facing build tooling & test updates labels Apr 9, 2026
@nx-cloud
Copy link
Copy Markdown

nx-cloud bot commented Apr 9, 2026

View your CI Pipeline Execution ↗ for commit 54f15ec

Command Status Duration Result
nx run-many -t compile,check,knip,test,lint,fmt... ✅ Succeeded 8m 20s View ↗

☁️ Nx Cloud last updated this comment at 2026-04-13 08:55:38 UTC

@huang-julien huang-julien changed the title chore(lib): add react-vite-plus sandbox Chore(cli): add react-vite-plus sandbox Apr 9, 2026
@huang-julien huang-julien changed the title Chore(cli): add react-vite-plus sandbox Chore(cli): Add react-vite-plus sandbox Apr 9, 2026
@huang-julien huang-julien marked this pull request as ready for review April 10, 2026 12:16
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 10, 2026

📝 Walkthrough

Walkthrough

The changes introduce a new React Vite+ sandbox template (react-vite-plus/default-ts) to the Storybook test infrastructure by enabling push-triggered workflow runs on a feature branch, registering the template in the sandbox configuration, and defining its Nx project structure with dependencies and build targets.

Changes

Cohort / File(s) Summary
GitHub Actions Workflow
.github/workflows/generate-sandboxes.yml
Enabled push-triggered workflow runs on branch chore/react-viteplus-sadbox, updated generate-next job checkout target to match the feature branch, and disabled the generate-main job entirely.
Sandbox Template Registry
code/lib/cli-storybook/src/sandbox-templates.ts
Added new template entry react-vite-plus/default-ts with Vite-based project generation, Storybook React/Vite builder expectations, and experimental features (useCsfFactory, experimentalTestSyntax, developmentModeForBuild). Updated daily cadence list to include the new template.
Nx Project Configuration
code/sandbox/react-vite-plus-default-ts/project.json
Created new Nx project definition for react-vite-plus/default-ts application with implicit dependencies on core, CLI, and addon packages, declaring multiple targets (sandbox, dev, build, chromatic, etc.) and tagged for daily CI runs.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
code/lib/cli-storybook/src/sandbox-templates.ts (1)

427-447: Match the TypeScript coverage of react-vite/default-ts.

This new TS template does not opt into typeCheck: true, unlike the existing react-vite/default-ts template. That means the new daily sandbox can miss type-only regressions in the Vite Plus scaffold, which undercuts the main value of adding it.

Suggested change
   'react-vite-plus/default-ts': {
     name: 'React Vite-Plus Latest (Vite | TypeScript)',
@@
     modifications: {
       useCsfFactory: true,
       extraDependencies: ['prop-types', '@types/prop-types'],
@@
     },
     skipTasks: ['e2e-tests', 'bench'],
+    typeCheck: true,
   },
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@code/lib/cli-storybook/src/sandbox-templates.ts` around lines 427 - 447, The
new 'react-vite-plus/default-ts' template is missing the same TypeScript
type-check opt-in as 'react-vite/default-ts'; update the
modifications.mainConfig.features for the 'react-vite-plus/default-ts' entry to
include typeCheck: true (alongside developmentModeForBuild and
experimentalTestSyntax) so the sandbox runs type checking like the existing TS
template.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/generate-sandboxes.yml:
- Around line 9-11: The workflow currently hardcodes a temporary branch in the
push trigger and checkout (the push: branches: - chore/react-viteplus-sadbox
override) and disables the generate-main behavior, so revert those temporary
changes: remove the branch-specific override (delete the
chore/react-viteplus-sadbox entry) and restore the original triggers and any
generate-main job/steps that were disabled so scheduled runs and main sandboxes
publish from the intended refs; ensure no hard-coded branch names remain in this
workflow file and re-enable the generate-main job/steps.

In `@code/sandbox/react-vite-plus-default-ts/project.json`:
- Around line 14-31: The targets set is missing the standard "check-sandbox"
target expected by the sandbox template; add a "check-sandbox" entry to the
targets object (matching how the other Vite template projects include it) so the
project JSON includes "check-sandbox": {} (or the appropriate options used by
the other template), ensuring consistency with
scripts/create-nx-sandbox-projects.ts and the react-vite-default-ts project
configuration.

---

Nitpick comments:
In `@code/lib/cli-storybook/src/sandbox-templates.ts`:
- Around line 427-447: The new 'react-vite-plus/default-ts' template is missing
the same TypeScript type-check opt-in as 'react-vite/default-ts'; update the
modifications.mainConfig.features for the 'react-vite-plus/default-ts' entry to
include typeCheck: true (alongside developmentModeForBuild and
experimentalTestSyntax) so the sandbox runs type checking like the existing TS
template.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: df738cf2-a8eb-42aa-bf86-31a82f9dbac8

📥 Commits

Reviewing files that changed from the base of the PR and between aae6c95 and 1a9ffaa.

📒 Files selected for processing (3)
  • .github/workflows/generate-sandboxes.yml
  • code/lib/cli-storybook/src/sandbox-templates.ts
  • code/sandbox/react-vite-plus-default-ts/project.json

Comment on lines +9 to +11
push:
branches:
- chore/react-viteplus-sadbox
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Remove the temporary branch-specific workflow overrides before merge.

This still hard-codes the feature branch in the trigger and checkout step, and it disables generate-main entirely. After this lands on next, scheduled runs will either generate from the wrong ref or fail once chore/react-viteplus-sadbox is deleted, and main sandboxes will stop publishing.

Suggested revert
 on:
   schedule:
     - cron: '2 2 */1 * *'
   workflow_dispatch:
-  push:
-    branches:
-      - chore/react-viteplus-sadbox
+  # push:
+  #   branches:
+  #     - <your-branch-name>

@@
       - uses: actions/checkout@v4
         with:
-          ref: chore/react-viteplus-sadbox
+          ref: next

@@
-  # generate-main:
-    # name: Generate to main
-    # if: github.repository_owner == 'storybookjs'
-    # runs-on: ubuntu-latest
-    # steps:
-    #   ...
+  generate-main:
+    name: Generate to main
+    if: github.repository_owner == 'storybookjs'
+    runs-on: ubuntu-latest
+    steps:
+      # restore the existing main generation steps here

Also applies to: 50-50, 96-163

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/generate-sandboxes.yml around lines 9 - 11, The workflow
currently hardcodes a temporary branch in the push trigger and checkout (the
push: branches: - chore/react-viteplus-sadbox override) and disables the
generate-main behavior, so revert those temporary changes: remove the
branch-specific override (delete the chore/react-viteplus-sadbox entry) and
restore the original triggers and any generate-main job/steps that were disabled
so scheduled runs and main sandboxes publish from the intended refs; ensure no
hard-coded branch names remain in this workflow file and re-enable the
generate-main job/steps.

Comment on lines +14 to +31
"targets": {
"sandbox": {
"options": {
"dir": "react-vite-plus-default-ts"
}
},
"dev": {},
"vitest-integration": {},
"build": {
"options": {
"dir": "react-vite-plus-default-ts"
}
},
"chromatic": {},
"serve": {},
"e2e-tests-dev": {},
"test-runner": {},
"test-runner-dev": {}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

check-sandbox is missing from the generated target set.

This diverges from the standard Nx sandbox shape: scripts/create-nx-sandbox-projects.ts adds check-sandbox unless the template explicitly skips it, and code/sandbox/react-vite-default-ts/project.json includes it. Without that target, this new sandbox misses one of the normal validation steps the comparable Vite template gets.

Suggested fix
   "targets": {
     "sandbox": {
       "options": {
         "dir": "react-vite-plus-default-ts"
       }
     },
     "dev": {},
+    "check-sandbox": {},
     "vitest-integration": {},
     "build": {
       "options": {
         "dir": "react-vite-plus-default-ts"
       }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"targets": {
"sandbox": {
"options": {
"dir": "react-vite-plus-default-ts"
}
},
"dev": {},
"vitest-integration": {},
"build": {
"options": {
"dir": "react-vite-plus-default-ts"
}
},
"chromatic": {},
"serve": {},
"e2e-tests-dev": {},
"test-runner": {},
"test-runner-dev": {}
"targets": {
"sandbox": {
"options": {
"dir": "react-vite-plus-default-ts"
}
},
"dev": {},
"check-sandbox": {},
"vitest-integration": {},
"build": {
"options": {
"dir": "react-vite-plus-default-ts"
}
},
"chromatic": {},
"serve": {},
"e2e-tests-dev": {},
"test-runner": {},
"test-runner-dev": {}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@code/sandbox/react-vite-plus-default-ts/project.json` around lines 14 - 31,
The targets set is missing the standard "check-sandbox" target expected by the
sandbox template; add a "check-sandbox" entry to the targets object (matching
how the other Vite template projects include it) so the project JSON includes
"check-sandbox": {} (or the appropriate options used by the other template),
ensuring consistency with scripts/create-nx-sandbox-projects.ts and the
react-vite-default-ts project configuration.

@storybook-app-bot
Copy link
Copy Markdown

storybook-app-bot bot commented Apr 10, 2026

Package Benchmarks

Commit: 54f15ec, ran on 13 April 2026 at 08:56:59 UTC

No significant changes detected, all good. 👏

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.

1 participant