-
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
Solid: Add Solid to the list of supported frameworks for addon-vitest #33084
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
Solid: Add Solid to the list of supported frameworks for addon-vitest #33084
Conversation
…s in sandbox templates
|
View your CI Pipeline Execution ↗ for commit fd5ede7
☁️ Nx Cloud last updated this comment at |
📝 WalkthroughWalkthroughRemoved the Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant CLI as CLI
participant Dirs as dirs.getRendererDir
participant Resolver as resolvePackageDir / resolveUsingBranchInstall
participant Helpers as helpers.copyTemplateFiles
participant FS as Filesystem
CLI->>Dirs: request renderer dir for <renderer>
Note right of Dirs: lookup using\nframeworkPackages + rendererPackages
alt mapping found
Dirs->>Resolver: resolve package path (externalFramework)
Resolver-->>Dirs: packageDir
Dirs-->>CLI: return packageDir
CLI->>Helpers: templatePath(packageDir)
Helpers-->>Helpers: templatePath may return null
alt path returned
Helpers->>FS: copy template files
FS-->>Helpers: success
Helpers-->>CLI: copied
else no path
Helpers-->>CLI: skip copy (no template)
end
else no mapping
Dirs-->>CLI: return null (no renderer mapping)
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
Possibly related PRs
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ 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). (2)
Comment |
…-supported-frameworks-for-addon-vitest
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (1)
code/lib/cli-storybook/src/sandbox-templates.ts (1)
484-493: Solid Vite TS template: confirmyarn createargs and vitest skip behaviorThe switch to:
script: 'yarn create solid {{beforeDir}} --vanilla --ts --template=with-vitest', skipTasks: ['e2e-tests', 'bench', 'vitest-integration'],looks consistent with the repo’s Yarn‑first setup and ensures the generated app has Vitest in place. However, two things are worth double‑checking:
- CLI invocation – Please confirm locally that
yarn create solid … --vanilla --ts --template=with-vitestmatches the current Solid scaffolding CLI, as these flags can evolve over time.- Vitest integration coverage – By adding
vitest-integrationtoskipTasks, thevitest-integrationCircleCI job will not exercise this Solid sandbox, even though this PR is about Solid support for addon‑vitest. If that’s intentional (e.g., current flakiness), consider adding a short// TODO: re-enable vitest-integration once Solid is stablehere to make the intent explicit; otherwise, drop'vitest-integration'fromskipTasksand keep the CI coverage.Based on learnings
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
.circleci/config.yml(3 hunks).circleci/src/workflows/daily.yml(2 hunks).circleci/src/workflows/merged.yml(1 hunks).github/workflows/generate-sandboxes.yml(2 hunks)code/lib/cli-storybook/src/sandbox-templates.ts(2 hunks)code/sandbox/solid-vite-default-js/project.json(0 hunks)
💤 Files with no reviewable changes (1)
- code/sandbox/solid-vite-default-js/project.json
✅ Files skipped from review due to trivial changes (1)
- .circleci/src/workflows/daily.yml
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-10-02T09:22:13.215Z
Learnt from: JReinhold
Repo: storybookjs/storybook PR: 32607
File: code/package.json:243-243
Timestamp: 2025-10-02T09:22:13.215Z
Learning: The Storybook repository uses Yarn v^4 (any 4.x version) as the package manager, configured via .yarnrc.yml and package.json packageManager field. Specific patch versions within v4 can be upgraded as needed.
Applied to files:
.circleci/config.yml
📚 Learning: 2025-11-05T09:38:47.712Z
Learnt from: Sidnioulz
Repo: storybookjs/storybook PR: 32458
File: code/core/src/components/components/Select/Select.tsx:200-204
Timestamp: 2025-11-05T09:38:47.712Z
Learning: Repo: storybookjs/storybook — Guidance: Until Storybook 11 is released, do not suggest using React.useId anywhere (e.g., in code/core/src/components/components/Select/Select.tsx) to maintain compatibility with React 17 runtimes. Prefer advising: accept a caller-provided props.id and, if needed, generate a client-only fallback id to minimize SSR hydration issues — but avoid useId. Resume prompting for useId after Storybook 11.
Applied to files:
.circleci/config.yml
⏰ 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). (4)
- GitHub Check: normal
- GitHub Check: Core Unit Tests, windows-latest
- GitHub Check: Generate to next
- GitHub Check: Generate to main
🔇 Additional comments (5)
.circleci/src/workflows/merged.yml (1)
37-54: Parallelism adjustments for merged workflow look consistentThe +1 bumps on
create-sandboxes,chromatic-sandboxes,e2e-dev, andtest-runner-productionare internally consistent and match the merged workflow configuration in.circleci/config.yml. No issues from my side.code/lib/cli-storybook/src/sandbox-templates.ts (1)
930-939: Addingsolid-vite/default-tsto the merged cadence is appropriateIncluding
solid-vite/default-tsinmerged(and thus indailyvia...merged) ensures the Solid sandbox participates in post‑merge and daily CI without impacting the lighternormalpipeline. This wiring looks correct..circleci/config.yml (3)
948-955: More verbosecreate-storybookin test-init-featuresAdding
--loglevel=debugto:npx create-storybook --yes --package-manager npm --features docs test a11y --loglevel=debugis a reasonable trade‑off to get more signal from this flaky‑prone step. As long as log volume is acceptable in CI, this seems fine; if logs become too noisy, you might later gate the log level behind an env flag.
1175-1195: Daily workflow parallelism bumps align with new sandbox mixThe daily workflow’s
parallelismincreases forcreate-sandboxes,chromatic-sandboxes,e2e-dev, andtest-runner-productionline up with addingsolid-vite/default-tsto the daily/merged template set and with itsskipTasks. This keeps one executor per participating template and should keepscripts/yarn get-template --checkhappy.
1289-1305: Merged workflow parallelism updates are coherent with template changesSimilarly, the merged workflow’s
parallelismvalues forcreate-sandboxes,chromatic-sandboxes,e2e-dev, andtest-runner-productionhave been bumped to reflect the extra Solid template. The configuration remains internally consistent with the template cadence definitions.
…-supported-frameworks-for-addon-vitest
…-supported-frameworks-for-addon-vitest
There was a problem hiding this 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
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
.circleci/config.yml(0 hunks)code/lib/cli-storybook/src/sandbox-templates.ts(2 hunks)
💤 Files with no reviewable changes (1)
- .circleci/config.yml
⏰ 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). (3)
- GitHub Check: Core Unit Tests, windows-latest
- GitHub Check: Generate to main
- GitHub Check: Generate to next
🔇 Additional comments (2)
code/lib/cli-storybook/src/sandbox-templates.ts (2)
513-513: Clarify whyvitest-integrationis skipped when adding Vitest support.The PR objective is to add Solid to the list of supported frameworks for addon-vitest, and the script now includes
--template=with-vitest. However,vitest-integrationis included inskipTasks. Please clarify whether:
- The template includes Vitest but Storybook's vitest-integration task is not yet compatible with Solid
- This is a temporary skip that should be removed in a follow-up PR
- There's another reason for this configuration
507-507: LGTM: Script updated to use Vitest-enabled template.The script change from
npx degittoyarn create solidwith the--template=with-vitestflag appropriately enables Vitest integration for the Solid template, which aligns with the PR objective.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
code/core/src/cli/helpers.ts (1)
180-210: Consider adding logging when template path resolution fails.The early return at lines 183-185 changes the error-handling behavior from throwing an exception to silently returning
null. While this defensive approach is useful for edge cases (e.g., optional templates in sandbox environments), it could mask configuration issues.Additionally, the error thrown at line 209 appears unreachable now—if none of the path checks succeed, the function would have already returned
nullat line 184.Consider one of these approaches:
Option 1: Add logging when baseDir is missing
const templatePath = async () => { const baseDir = await getRendererDir(packageManager, templateLocation); if (!baseDir) { + logger.warn(`No base directory found for template: ${templateLocation}`); return null; }Option 2: Log when no valid template path is found
// As a last resort, look for the root of the asset directory if (existsSync(assetsDir)) { return assetsDir; } - throw new Error(`Unsupported renderer: ${templateLocation} (${baseDir})`); + logger.warn(`No template directory found for renderer: ${templateLocation} at ${baseDir}`); + return null; };
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
code/core/src/cli/dirs.ts(2 hunks)code/core/src/cli/helpers.ts(2 hunks)code/lib/create-storybook/src/generators/SOLID/index.ts(1 hunks)code/lib/create-storybook/src/generators/baseGenerator.ts(1 hunks)
🧰 Additional context used
🧠 Learnings (3)
📚 Learning: 2025-09-17T07:31:04.432Z
Learnt from: ndelangen
Repo: storybookjs/storybook PR: 32484
File: code/core/package.json:326-326
Timestamp: 2025-09-17T07:31:04.432Z
Learning: In Storybook's core package, dependencies like `open` are bundled into the final distribution during the build process, so they should remain in devDependencies rather than being moved to dependencies. End users don't need these packages as separate runtime dependencies since they're included in the bundled code.
Applied to files:
code/core/src/cli/dirs.ts
📚 Learning: 2025-09-29T13:20:23.346Z
Learnt from: mrginglymus
Repo: storybookjs/storybook PR: 32556
File: code/core/package.json:309-313
Timestamp: 2025-09-29T13:20:23.346Z
Learning: The `fast-printf` dependency in Storybook's core package is bundled into the final distribution during the build process, so it should remain in devDependencies rather than being moved to dependencies, following the same pattern as other bundled dependencies like `open`.
Applied to files:
code/core/src/cli/dirs.ts
📚 Learning: 2025-10-02T09:22:13.215Z
Learnt from: JReinhold
Repo: storybookjs/storybook PR: 32607
File: code/package.json:243-243
Timestamp: 2025-10-02T09:22:13.215Z
Learning: The Storybook repository uses Yarn v^4 (any 4.x version) as the package manager, configured via .yarnrc.yml and package.json packageManager field. Specific patch versions within v4 can be upgraded as needed.
Applied to files:
code/core/src/cli/dirs.ts
🧬 Code graph analysis (1)
code/core/src/cli/dirs.ts (2)
code/core/src/common/utils/get-storybook-info.ts (2)
frameworkPackages(38-61)rendererPackages(22-36)code/core/src/shared/utils/module.ts (1)
resolvePackageDir(28-38)
⏰ 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). (3)
- GitHub Check: Core Unit Tests, windows-latest
- GitHub Check: Generate to main
- GitHub Check: Generate to next
🔇 Additional comments (6)
code/core/src/cli/dirs.ts (3)
7-15: LGTM! Import changes support the dynamic framework lookup.The addition of
frameworkPackagesandrendererPackagesenables the new runtime-based resolution approach, which is more maintainable than hardcoded mappings.
66-84: LGTM! Correct usage of the resolved package name.The
externalFrameworkvariable (the npm package name) is correctly used for:
- Constructing the
package.jsonpath- Both resolution strategies (
resolvePackageDirandresolveUsingBranchInstall)- Error reporting
Since the function returns
nullearly if no framework is found, the error path will always have a valid package name.
57-64: No action required—callers already handle the null return properly.The single call site in
helpers.ts(line 181) correctly checks for a null return value and propagates it:const baseDir = await getRendererDir(packageManager, templateLocation); if (!baseDir) { return null; }The dynamic lookup approach is sound and callers are already equipped to handle null returns.
code/lib/create-storybook/src/generators/SOLID/index.ts (1)
15-15: LGTM! Enabling component addition aligns with template support.Setting
addComponents: trueis appropriate now that SOLID is included in the frameworks with templates list (per changes inbaseGenerator.ts).code/core/src/cli/helpers.ts (1)
217-221: Silent skip is appropriate with logging added upstream.The conditional template copying correctly prevents errors when templates are unavailable. If logging is added to the
templatePathfunction (as suggested above), this silent skip behavior will be properly observable.code/lib/create-storybook/src/generators/baseGenerator.ts (1)
119-119: LGTM! SOLID added to frameworks with templates.The addition correctly enables template copying for SOLID projects and maintains alphabetical ordering.
Verify that SOLID templates exist in the expected location:
This reverts commit 4757933.
…-supported-frameworks-for-addon-vitest
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
.circleci/src/workflows/daily.yml(3 hunks).circleci/src/workflows/merged.yml(2 hunks)code/lib/cli-storybook/src/sandbox-templates.ts(2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- .circleci/src/workflows/merged.yml
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{ts,tsx,js,jsx,mjs}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Use camelCase for variable and function names
Files:
code/lib/cli-storybook/src/sandbox-templates.ts
**/*.{ts,tsx}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
**/*.{ts,tsx}: Enable TypeScript strict mode
Export functions from modules for testing purposes
Files:
code/lib/cli-storybook/src/sandbox-templates.ts
**/*.{ts,tsx,js,jsx,json,html,mjs}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
**/*.{ts,tsx,js,jsx,json,html,mjs}: Use ESLint and Prettier for code style enforcement
Run 'yarn prettier --write ' to format code after making changes
Run 'yarn lint:js:cmd ' to check for ESLint issues after making changes
Files:
code/lib/cli-storybook/src/sandbox-templates.ts
code/**/!(*.test).{ts,tsx,js,mjs}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
code/**/!(*.test).{ts,tsx,js,mjs}: Use 'logger' from 'storybook/internal/node-logger' for server-side (Node.js) logging, not console.log/console.warn/console.error
Use 'logger' from 'storybook/internal/client-logger' for client-side (browser) logging, not console.log/console.warn/console.error
Do not use console.log, console.warn, or console.error directly unless in isolated files where importing loggers would significantly increase bundle size
Files:
code/lib/cli-storybook/src/sandbox-templates.ts
🧠 Learnings (16)
📓 Common learnings
Learnt from: CR
Repo: storybookjs/storybook PR: 0
File: .cursor/rules/spy-mocking.mdc:0-0
Timestamp: 2025-11-24T17:49:59.268Z
Learning: Applies to **/*.test.{ts,tsx,js,jsx} : Avoid mocking only a subset of required dependencies in Vitest tests
Learnt from: CR
Repo: storybookjs/storybook PR: 0
File: .cursor/rules/spy-mocking.mdc:0-0
Timestamp: 2025-11-24T17:49:59.268Z
Learning: Applies to **/*.test.{ts,tsx,js,jsx} : Avoid inline mock implementations within test cases in Vitest tests
Learnt from: CR
Repo: storybookjs/storybook PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-24T17:49:47.649Z
Learning: Use 'yarn task --task sandbox --template <framework-template>' to generate sandbox test environments for different framework combinations
Learnt from: CR
Repo: storybookjs/storybook PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-24T17:49:31.811Z
Learning: Applies to code/vitest.workspace.ts : Vitest configuration is centralized in `code/vitest.workspace.ts` for workspace setup
Learnt from: CR
Repo: storybookjs/storybook PR: 0
File: .cursor/rules/spy-mocking.mdc:0-0
Timestamp: 2025-11-24T17:49:59.268Z
Learning: Applies to **/*.test.{ts,tsx,js,jsx} : Keep mock implementations simple and focused in Vitest tests
📚 Learning: 2025-11-24T17:49:47.649Z
Learnt from: CR
Repo: storybookjs/storybook PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-24T17:49:47.649Z
Learning: Applies to **/*.{ts,tsx,js,jsx,mjs} : Use camelCase for variable and function names
Applied to files:
code/lib/cli-storybook/src/sandbox-templates.ts
📚 Learning: 2025-11-24T17:49:47.649Z
Learnt from: CR
Repo: storybookjs/storybook PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-24T17:49:47.649Z
Learning: Applies to **/*.{ts,tsx,js,jsx,json,html,mjs} : Run 'yarn lint:js:cmd <file>' to check for ESLint issues after making changes
Applied to files:
code/lib/cli-storybook/src/sandbox-templates.ts
📚 Learning: 2025-11-24T17:49:47.649Z
Learnt from: CR
Repo: storybookjs/storybook PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-24T17:49:47.649Z
Learning: Applies to **/*.{ts,tsx,js,jsx,json,html,mjs} : Run 'yarn prettier --write <file>' to format code after making changes
Applied to files:
code/lib/cli-storybook/src/sandbox-templates.ts
📚 Learning: 2025-11-24T17:49:47.649Z
Learnt from: CR
Repo: storybookjs/storybook PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-24T17:49:47.649Z
Learning: Applies to **/*.{ts,tsx} : Enable TypeScript strict mode
Applied to files:
code/lib/cli-storybook/src/sandbox-templates.ts
📚 Learning: 2025-11-05T09:38:47.712Z
Learnt from: Sidnioulz
Repo: storybookjs/storybook PR: 32458
File: code/core/src/components/components/Select/Select.tsx:200-204
Timestamp: 2025-11-05T09:38:47.712Z
Learning: Repo: storybookjs/storybook — Guidance: Until Storybook 11 is released, do not suggest using React.useId anywhere (e.g., in code/core/src/components/components/Select/Select.tsx) to maintain compatibility with React 17 runtimes. Prefer advising: accept a caller-provided props.id and, if needed, generate a client-only fallback id to minimize SSR hydration issues — but avoid useId. Resume prompting for useId after Storybook 11.
Applied to files:
code/lib/cli-storybook/src/sandbox-templates.ts
📚 Learning: 2025-11-24T17:49:59.268Z
Learnt from: CR
Repo: storybookjs/storybook PR: 0
File: .cursor/rules/spy-mocking.mdc:0-0
Timestamp: 2025-11-24T17:49:59.268Z
Learning: Applies to **/*.test.{ts,tsx,js,jsx} : Avoid mocking only a subset of required dependencies in Vitest tests
Applied to files:
code/lib/cli-storybook/src/sandbox-templates.ts
📚 Learning: 2025-11-24T17:49:59.268Z
Learnt from: CR
Repo: storybookjs/storybook PR: 0
File: .cursor/rules/spy-mocking.mdc:0-0
Timestamp: 2025-11-24T17:49:59.268Z
Learning: Applies to **/*.test.{ts,tsx,js,jsx} : Avoid inline mock implementations within test cases in Vitest tests
Applied to files:
code/lib/cli-storybook/src/sandbox-templates.ts
📚 Learning: 2025-11-24T17:49:59.268Z
Learnt from: CR
Repo: storybookjs/storybook PR: 0
File: .cursor/rules/spy-mocking.mdc:0-0
Timestamp: 2025-11-24T17:49:59.268Z
Learning: Applies to **/*.test.{ts,tsx,js,jsx} : Keep mock implementations simple and focused in Vitest tests
Applied to files:
code/lib/cli-storybook/src/sandbox-templates.ts
📚 Learning: 2025-11-24T17:49:59.268Z
Learnt from: CR
Repo: storybookjs/storybook PR: 0
File: .cursor/rules/spy-mocking.mdc:0-0
Timestamp: 2025-11-24T17:49:59.268Z
Learning: Applies to **/*.test.{ts,tsx,js,jsx} : Avoid mocking without the `spy: true` option in Vitest tests
Applied to files:
code/lib/cli-storybook/src/sandbox-templates.ts
📚 Learning: 2025-11-24T17:49:59.268Z
Learnt from: CR
Repo: storybookjs/storybook PR: 0
File: .cursor/rules/spy-mocking.mdc:0-0
Timestamp: 2025-11-24T17:49:59.268Z
Learning: Applies to **/*.test.{ts,tsx,js,jsx} : Document complex mock behaviors in Vitest tests
Applied to files:
code/lib/cli-storybook/src/sandbox-templates.ts
📚 Learning: 2025-11-24T17:49:59.268Z
Learnt from: CR
Repo: storybookjs/storybook PR: 0
File: .cursor/rules/spy-mocking.mdc:0-0
Timestamp: 2025-11-24T17:49:59.268Z
Learning: Applies to **/*.test.{ts,tsx,js,jsx} : Implement mock behaviors in `beforeEach` blocks in Vitest tests
Applied to files:
code/lib/cli-storybook/src/sandbox-templates.ts
📚 Learning: 2025-11-24T17:49:59.268Z
Learnt from: CR
Repo: storybookjs/storybook PR: 0
File: .cursor/rules/spy-mocking.mdc:0-0
Timestamp: 2025-11-24T17:49:59.268Z
Learning: Applies to **/*.test.{ts,tsx,js,jsx} : Mock all required properties and methods that the test subject uses in Vitest tests
Applied to files:
code/lib/cli-storybook/src/sandbox-templates.ts
📚 Learning: 2025-11-24T17:49:47.649Z
Learnt from: CR
Repo: storybookjs/storybook PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-24T17:49:47.649Z
Learning: Applies to **/*.test.{ts,tsx} : Use 'yarn vitest run --coverage <test-file>' to run tests with coverage reports and aim for 75%+ coverage of statements/lines
Applied to files:
code/lib/cli-storybook/src/sandbox-templates.ts
📚 Learning: 2025-11-24T17:49:59.268Z
Learnt from: CR
Repo: storybookjs/storybook PR: 0
File: .cursor/rules/spy-mocking.mdc:0-0
Timestamp: 2025-11-24T17:49:59.268Z
Learning: Applies to **/*.test.{ts,tsx,js,jsx} : Group related mocks together in Vitest tests
Applied to files:
code/lib/cli-storybook/src/sandbox-templates.ts
📚 Learning: 2025-11-24T17:49:59.268Z
Learnt from: CR
Repo: storybookjs/storybook PR: 0
File: .cursor/rules/spy-mocking.mdc:0-0
Timestamp: 2025-11-24T17:49:59.268Z
Learning: Applies to **/*.test.{ts,tsx,js,jsx} : Avoid mock implementations outside of `beforeEach` blocks in Vitest tests
Applied to files:
code/lib/cli-storybook/src/sandbox-templates.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). (2)
- GitHub Check: merged
- GitHub Check: Core Unit Tests, windows-latest
🔇 Additional comments (2)
.circleci/src/workflows/daily.yml (1)
33-59: Perfect! I now have all the information needed. The PR makes these key changes:
- Removes
'solid-vite/default-js'template- Updates
'solid-vite/default-ts'to use vitest (--template=with-vitest)- Adds
'solid-vite/default-ts'to themergedarray (critical!)- Updates skip tasks for Solid template
The parallelism increments make sense: adding Solid to the merged array means it now participates in merged workflow tests, which cascades to daily workflow.
Parallelism increments align with adding Solid template to the merged workflow.
The changes to
sandbox-templates.tshave been verified:
'solid-vite/default-ts'script updated to useyarn create solid ... --template=with-vitest- Solid template is now added to the
mergedarray (previously missing)- This enables vitest integration for Solid and accounts for the parallelism increments
code/lib/cli-storybook/src/sandbox-templates.ts (1)
1004-1014: Solid template inclusion inmerged/dailysets looks consistentAdding
'solid-vite/default-ts'to themergedlist (and thus todailyvia spread) aligns this Solid sandbox with how other non‑core templates likepreact-vite/default-tsandhtml-vite/default-tsare scheduled. The key matches the base template definition andTemplateKeytyping, so this wiring looks correct.
| 'solid-vite/default-ts': { | ||
| name: 'SolidJS Latest (Vite | TypeScript)', | ||
| script: 'npx degit solidjs/templates/ts {{beforeDir}}', | ||
| script: 'yarn create solid {{beforeDir}} --vanilla --ts --template=with-vitest', | ||
| expected: { | ||
| framework: 'storybook-solidjs-vite', | ||
| renderer: 'storybook-solidjs-vite', | ||
| builder: '@storybook/builder-vite', | ||
| }, | ||
| skipTasks: ['e2e-tests', 'bench'], | ||
| skipTasks: ['e2e-tests', 'e2e-tests-dev', 'bench', 'vitest-integration'], | ||
| }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
Script executed:
# First, let's examine the file context around the review area
cat -n code/lib/cli-storybook/src/sandbox-templates.ts | sed -n '500,520p'Repository: storybookjs/storybook
<shell_result>
Repository: storybookjs/storybook
Exit code: 0
stdout:
500 },
501 skipMocking: true,
502 },
503 skipTasks: ['e2e-tests', 'e2e-tests-dev', 'bench', 'vitest-integration'],
504 },
505 'solid-vite/default-ts': {
506 name: 'SolidJS Latest (Vite | TypeScript)',
507 script: 'yarn create solid {{beforeDir}} --vanilla --ts --template=with-vitest',
508 expected: {
509 framework: 'storybook-solidjs-vite',
510 renderer: 'storybook-solidjs-vite',
511 builder: '@storybook/builder-vite',
512 },
513 skipTasks: ['e2e-tests', 'e2e-tests-dev', 'bench', 'vitest-integration'],
514 },
515 'vue3-vite/default-js': {
516 name: 'Vue v3 (Vite | JavaScript)',
517 script: 'npm create vite --yes {{beforeDir}} -- --template vue',
518 expected: {
519 framework: '@storybook/vue3-vite',
520 renderer: '@storybook/vue3',
</shell_result>
Script executed:
# Also check the merged templates section mentioned in the comment
cat -n code/lib/cli-storybook/src/sandbox-templates.ts | sed -n '1000,1020p'Repository: storybookjs/storybook
<shell_result>
Repository: storybookjs/storybook
Exit code: 0
stdout:
1000 'ember/default-js',
1001 'react-rsbuild/default-ts',
1002 ];
1003
1004 export const merged: TemplateKey[] = [
1005 ...normal,
1006 'react-webpack/18-ts',
1007 'react-webpack/17-ts',
1008 'nextjs/15-ts',
1009 'nextjs-vite/15-ts',
1010 'preact-vite/default-ts',
1011 'html-vite/default-ts',
1012 'solid-vite/default-ts',
1013 'vue3-rsbuild/default-ts',
1014 ];
1015
1016 export const daily: TemplateKey[] = [
1017 ...merged,
1018 'angular-cli/prerelease',
1019 // TODO: Add this back once we resolve the React 19 issues
1020 // 'cra/default-js',
</shell_result>
Script executed:
# Search for other Solid template references in the file
rg -n "solid" code/lib/cli-storybook/src/sandbox-templates.ts -iRepository: storybookjs/storybook
<shell_result>
Repository: storybookjs/storybook
Exit code: 0
stdout:
505: 'solid-vite/default-ts': {
506: name: 'SolidJS Latest (Vite | TypeScript)',
507: script: 'yarn create solid {{beforeDir}} --vanilla --ts --template=with-vitest',
509: framework: 'storybook-solidjs-vite',
510: renderer: 'storybook-solidjs-vite',
1012: 'solid-vite/default-ts',
</shell_result>
Script executed:
# Check if there are any existing tests or documentation about create-solid flags
rg -n "create solid" . -i -A2 -B2Repository: storybookjs/storybook
<shell_result>
Repository: storybookjs/storybook
Exit code: 0
stdout:
./code/lib/cli-storybook/src/sandbox-templates.ts-505- 'solid-vite/default-ts': {
./code/lib/cli-storybook/src/sandbox-templates.ts-506- name: 'SolidJS Latest (Vite | TypeScript)',
./code/lib/cli-storybook/src/sandbox-templates.ts:507: script: 'yarn create solid {{beforeDir}} --vanilla --ts --template=with-vitest',
./code/lib/cli-storybook/src/sandbox-templates.ts-508- expected: {
./code/lib/cli-storybook/src/sandbox-templates.ts-509- framework: 'storybook-solidjs-vite',
</shell_result>
Script executed:
# Check if there are any comments or context around the solid templates
cat -n code/lib/cli-storybook/src/sandbox-templates.ts | sed -n '495,520p'Repository: storybookjs/storybook
<shell_result>
Repository: storybookjs/storybook
Exit code: 0
stdout:
495 useCsfFactory: true,
496 mainConfig: {
497 features: {
498 experimentalTestSyntax: true,
499 },
500 },
501 skipMocking: true,
502 },
503 skipTasks: ['e2e-tests', 'e2e-tests-dev', 'bench', 'vitest-integration'],
504 },
505 'solid-vite/default-ts': {
506 name: 'SolidJS Latest (Vite | TypeScript)',
507 script: 'yarn create solid {{beforeDir}} --vanilla --ts --template=with-vitest',
508 expected: {
509 framework: 'storybook-solidjs-vite',
510 renderer: 'storybook-solidjs-vite',
511 builder: '@storybook/builder-vite',
512 },
513 skipTasks: ['e2e-tests', 'e2e-tests-dev', 'bench', 'vitest-integration'],
514 },
515 'vue3-vite/default-js': {
516 name: 'Vue v3 (Vite | JavaScript)',
517 script: 'npm create vite --yes {{beforeDir}} -- --template vue',
518 expected: {
519 framework: '@storybook/vue3-vite',
520 renderer: '@storybook/vue3',
</shell_result>
Script executed:
# Search for any TODOs or comments related to vitest-integration
rg -n "vitest-integration" code/lib/cli-storybook/src/sandbox-templates.ts -B3 -A1Repository: storybookjs/storybook
<shell_result>
Repository: storybookjs/storybook
Exit code: 0
stdout:
8- | 'smoke-test'
9- | 'test-runner'
10- | 'test-runner-dev'
11: | 'vitest-integration'
12- | 'chromatic'
--
125- builder: '@storybook/builder-webpack5',
126- },
127-
128: skipTasks: ['e2e-tests', 'bench', 'vitest-integration'],
129- modifications: {
--
153- jq '.browserslist.production[0] = ">0.9%"' package.json > tmp.json && mv tmp.json package.json
154- `,
155- // Re-enable once https://github.com/storybookjs/storybook/issues/19351 is fixed.
156: skipTasks: ['smoke-test', 'bench', 'vitest-integration'],
157- expected: {
--
193- initOptions: {
194- builder: SupportedBuilder.WEBPACK5,
195- },
196: skipTasks: ['e2e-tests-dev', 'e2e-tests', 'bench', 'vitest-integration'],
197- },
--
218- initOptions: {
219- builder: SupportedBuilder.WEBPACK5,
220- },
221: skipTasks: ['e2e-tests', 'bench', 'vitest-integration'],
222- },
--
243- initOptions: {
244- builder: SupportedBuilder.WEBPACK5,
245- },
246: skipTasks: ['bench', 'vitest-integration'],
247- },
--
268- initOptions: {
269- builder: SupportedBuilder.WEBPACK5,
270- },
271: skipTasks: ['e2e-tests', 'bench', 'vitest-integration'],
272- },
--
430- },
431- },
432- },
433: skipTasks: ['e2e-tests', 'bench', 'vitest-integration'],
434- },
--
450- },
451- },
452- },
453: skipTasks: ['e2e-tests', 'bench', 'vitest-integration'],
454- },
--
480- },
481- },
482- },
483: skipTasks: ['e2e-tests', 'bench', 'vitest-integration'],
484- },
--
500- },
501- skipMocking: true,
502- },
503: skipTasks: ['e2e-tests', 'e2e-tests-dev', 'bench', 'vitest-integration'],
504- },
--
510- renderer: 'storybook-solidjs-vite',
511- builder: '@storybook/builder-vite',
512- },
513: skipTasks: ['e2e-tests', 'e2e-tests-dev', 'bench', 'vitest-integration'],
514- },
--
549- },
550- skipMocking: true,
551- },
552: skipTasks: ['e2e-tests', 'e2e-tests-dev', 'bench', 'vitest-integration'],
553- },
--
559- // renderer: '@storybook/vue3',
560- // builder: '@storybook/builder-vite',
561- // },
562: // skipTasks: ['e2e-tests', 'bench', 'vitest-integration'],
563- // },
--
570- renderer: '@storybook/html',
571- builder: '@storybook/builder-vite',
572- },
573: skipTasks: ['e2e-tests', 'bench', 'vitest-integration'],
574- initOptions: {
--
584- renderer: '@storybook/html',
585- builder: '@storybook/builder-vite',
586- },
587: skipTasks: ['e2e-tests', 'bench', 'vitest-integration'],
588- initOptions: {
--
601- extraDependencies: ['storybook-html-rsbuild@^3.0.0-beta.1'],
602- skipMocking: true,
603- },
604: skipTasks: ['e2e-tests', 'e2e-tests-dev', 'bench', 'vitest-integration'],
605- },
--
637- renderer: '@storybook/angular',
638- builder: '@storybook/builder-webpack5',
639- },
640: skipTasks: ['e2e-tests', 'bench', 'vitest-integration'],
641- },
--
651- renderer: '@storybook/angular',
652- builder: '@storybook/builder-webpack5',
653- },
654: skipTasks: ['bench', 'vitest-integration'],
655- },
--
674- builder: '@storybook/builder-vite',
675- },
676- // Remove smoke-test from the list once https://github.com/storybookjs/storybook/issues/19351 is fixed.
677: skipTasks: ['smoke-test', 'e2e-tests', 'bench', 'vitest-integration'],
678- },
--
686- builder: '@storybook/builder-vite',
687- },
688- // Remove smoke-test from the list once https://github.com/storybookjs/storybook/issues/19351 is fixed.
689: skipTasks: ['smoke-test', 'e2e-tests', 'bench', 'vitest-integration'],
690- },
--
700- extraDependencies: ['storybook-web-components-rsbuild@^3.0.0-beta.1'],
701- skipMocking: true,
702- },
703: skipTasks: ['e2e-tests', 'e2e-tests-dev', 'bench', 'vitest-integration'],
704- },
--
739- builder: 'storybook-framework-qwik',
740- },
741- // TODO: The community template does not provide standard stories, which is required for e2e tests.
742: skipTasks: ['e2e-tests-dev', 'e2e-tests', 'bench', 'vitest-integration'],
743- },
--
786- },
787- },
788- },
789: skipTasks: ['bench', 'vitest-integration'],
790- initOptions: {
--
808- renderer: '@storybook/react',
809- builder: '@storybook/builder-vite',
810- },
811: skipTasks: ['e2e-tests', 'bench', 'vitest-integration'],
812- initOptions: {
--
843- },
844- },
845- isInternal: true,
846: skipTasks: ['e2e-tests', 'bench', 'vitest-integration'],
847- },
--
863- },
864- },
865- },
866: skipTasks: ['e2e-tests', 'bench', 'vitest-integration'],
867- isInternal: true,
--
875- builder: '@storybook/builder-webpack5',
876- },
877- isInternal: true,
878: skipTasks: ['bench', 'vitest-integration'],
879- initOptions: {
--
897- 'test-runner-dev',
898- 'e2e-tests-dev',
899- 'chromatic',
900: 'vitest-integration',
901- ],
--
915- 'test-runner-dev',
916- 'e2e-tests-dev',
917- 'chromatic',
918: 'vitest-integration',
919- ],
--
933- 'test-runner-dev',
934- 'e2e-tests-dev',
935- 'chromatic',
936: 'vitest-integration',
937- ],
--
951- 'test-runner',
952- 'test-runner-dev',
953- 'e2e-tests-dev',
954: 'vitest-integration',
955- ],
--
969- 'test-runner',
970- 'test-runner-dev',
971- 'e2e-tests-dev',
972: 'vitest-integration',
973- ],
</shell_result>
Script executed:
# Check if there's any documentation or examples of create-solid usage
fd "package.json" | xargs grep -l "create-solid" 2>/dev/null | head -5Repository: storybookjs/storybook
<shell_result>
Repository: storybookjs/storybook
Exit code: 0
</shell_result>
Script executed:
# Search for addon-vitest usage to understand what vitest-integration task does
rg -n "vitest-integration" . --type=ts --type=js | head -20Repository: storybookjs/storybook
<shell_result>
Repository: storybookjs/storybook
Exit code: 0
stdout:
./scripts/task.ts:106: 'vitest-integration': vitestTests,
./scripts/tasks/sandbox.ts:38: 'vitest-integration',
./scripts/tasks/sandbox.ts:93: const shouldAddVitestIntegration = !details.template.skipTasks?.includes('vitest-integration');
./scripts/get-template.ts:101: 'vitest-integration': 'vitest-integration',
./scripts/event-log-checker.ts:64: // two or three events are logged, depending on whether the template has a `vitest-integration` task
./code/lib/cli-storybook/src/sandbox-templates.ts:11: | 'vitest-integration'
./code/lib/cli-storybook/src/sandbox-templates.ts:128: skipTasks: ['e2e-tests', 'bench', 'vitest-integration'],
./code/lib/cli-storybook/src/sandbox-templates.ts:156: skipTasks: ['smoke-test', 'bench', 'vitest-integration'],
./code/lib/cli-storybook/src/sandbox-templates.ts:196: skipTasks: ['e2e-tests-dev', 'e2e-tests', 'bench', 'vitest-integration'],
./code/lib/cli-storybook/src/sandbox-templates.ts:221: skipTasks: ['e2e-tests', 'bench', 'vitest-integration'],
./code/lib/cli-storybook/src/sandbox-templates.ts:246: skipTasks: ['bench', 'vitest-integration'],
./code/lib/cli-storybook/src/sandbox-templates.ts:271: skipTasks: ['e2e-tests', 'bench', 'vitest-integration'],
./code/lib/cli-storybook/src/sandbox-templates.ts:433: skipTasks: ['e2e-tests', 'bench', 'vitest-integration'],
./code/lib/cli-storybook/src/sandbox-templates.ts:453: skipTasks: ['e2e-tests', 'bench', 'vitest-integration'],
./code/lib/cli-storybook/src/sandbox-templates.ts:483: skipTasks: ['e2e-tests', 'bench', 'vitest-integration'],
./code/lib/cli-storybook/src/sandbox-templates.ts:503: skipTasks: ['e2e-tests', 'e2e-tests-dev', 'bench', 'vitest-integration'],
./code/lib/cli-storybook/src/sandbox-templates.ts:513: skipTasks: ['e2e-tests', 'e2e-tests-dev', 'bench', 'vitest-integration'],
./code/lib/cli-storybook/src/sandbox-templates.ts:552: skipTasks: ['e2e-tests', 'e2e-tests-dev', 'bench', 'vitest-integration'],
./code/lib/cli-storybook/src/sandbox-templates.ts:562: // skipTasks: ['e2e-tests', 'bench', 'vitest-integration'],
./code/lib/cli-storybook/src/sandbox-templates.ts:573: skipTasks: ['e2e-tests', 'bench', 'vitest-integration'],
</shell_result>
Script executed:
# Check git history or any related issues/PRs for context
git log --oneline -20 -- code/lib/cli-storybook/src/sandbox-templates.ts 2>/dev/null | head -10Repository: storybookjs/storybook
<shell_result>
Repository: storybookjs/storybook
Exit code: 0
stdout:
a6d4931f6c Exclude solid from e2e tests
</shell_result>
Script executed:
# Search for any comments explaining vitest-integration skip decision
rg -n "vitest-integration" code/lib/cli-storybook/src/sandbox-templates.ts -B5 | grep -E "(TODO|FIXME|NOTE|Re-enable|once)"Repository: storybookjs/storybook
<shell_result>
Repository: storybookjs/storybook
Exit code: 0
stdout:
155- // Re-enable once https://github.com/storybookjs/storybook/issues/19351 is fixed.
676- // Remove smoke-test from the list once https://github.com/storybookjs/storybook/issues/19351 is fixed.
688- // Remove smoke-test from the list once https://github.com/storybookjs/storybook/issues/19351 is fixed.
741- // TODO: The community template does not provide standard stories, which is required for e2e tests.
</shell_result>
Script executed:
# Check what the vitest-integration task actually does
cat -n scripts/tasks/sandbox.ts | head -100Repository: storybookjs/storybook
<shell_result>
Repository: storybookjs/storybook
Exit code: 0
stdout:
1 import { access, rm } from 'node:fs/promises';
2 import path, { join } from 'node:path';
3 import { promisify } from 'node:util';
4
5 import dirSize from 'fast-folder-size';
6
7 import { now, saveBench } from '../bench/utils';
8 import type { Task, TaskKey } from '../task';
9
10 const logger = console;
11
12 const pathExists = async (path: string) => {
13 try {
14 await access(path);
15 return true;
16 } catch {
17 return false;
18 }
19 };
20
21 export const sandbox: Task = {
22 description: 'Create the sandbox from a template',
23 dependsOn: ({ template }, { link }) => {
24 if ('inDevelopment' in template && template.inDevelopment) {
25 return ['run-registry', 'generate'];
26 }
27
28 if (link) {
29 return ['compile'];
30 }
31
32 return ['run-registry'];
33 },
34 async ready({ sandboxDir }, { task: selectedTask }) {
35 // If the selected task requires the sandbox to exist, we check it. Else we always assume it needs to be created
36 // This avoids issues where you want to overwrite a sandbox and it will stop because it already exists
37 const tasksAfterSandbox: TaskKey[] = [
38 'vitest-integration',
39 'test-runner',
40 'test-runner-dev',
41 'e2e-tests',
42 'e2e-tests-dev',
43 'smoke-test',
44 'dev',
45 'build',
46 'serve',
47 'chromatic',
48 'bench',
49 'check-sandbox',
50 ];
51 const isSelectedTaskAfterSandboxCreation = tasksAfterSandbox.includes(selectedTask);
52 return isSelectedTaskAfterSandboxCreation && pathExists(sandboxDir);
53 },
54 async run(details, options) {
55 if (options.link && details.template.inDevelopment) {
56 logger.log(
57 `The ${options.template} has inDevelopment property enabled, therefore the sandbox for that template cannot be linked. Enabling --no-link mode..`
58 );
59
60 options.link = false;
61 }
62
63 if (!(await this.ready(details, options))) {
64 logger.info('🗑 Removing old sandbox dir');
65 await rm(details.sandboxDir, { force: true, recursive: true });
66 }
67
68 const {
69 create,
70 install,
71 addGlobalMocks,
72 addStories,
73 extendMain,
74 extendPreview,
75 init,
76 addExtraDependencies,
77 setImportMap,
78 setupVitest,
79 runMigrations,
80 } = await import('./sandbox-parts');
81
82 const extraDeps = [
83 ...(details.template.modifications?.extraDependencies ?? []),
84 // The storybook package forwards some CLI commands to @storybook/cli with npx.
85 // Adding the dep makes sure that even npx will use the linked workspace version.
86 '@storybook/cli',
87 'lodash-es',
88 '@types/lodash-es',
89 '@types/aria-query',
90 'uuid',
91 ];
92
93 const shouldAddVitestIntegration = !details.template.skipTasks?.includes('vitest-integration');
94
95 if (shouldAddVitestIntegration) {
96 extraDeps.push('happy-dom');
97
98 if (details.template.expected.framework.includes('nextjs')) {
99 extraDeps.push('jsdom');
100 }
</shell_result>
Script executed:
# Check the git commit that added this template
git show a6d4931f6c --stat 2>/dev/null | head -20Repository: storybookjs/storybook
<shell_result>
Repository: storybookjs/storybook
Exit code: 0
stdout:
commit a6d4931f6c77cecd9256f7a796cccedba63093ba
Author: Valentin Palkovic <[email protected]>
Date: Tue Nov 25 21:45:39 2025 +0100
Exclude solid from e2e tests
.circleci/README.md | 73 +
.circleci/config.yml | 1437 +
.circleci/src/@orbs.yml | 15 +
.circleci/src/@parameters.yml | 14 +
.circleci/src/@version.yml | 1 +
.../src/commands/cancel-workflow-on-failure.yml | 10 +
.../src/commands/report-workflow-on-failure.yml | 17 +
.circleci/src/commands/start-event-collector.yml | 8 +
.circleci/src/executors/sb_node_18_browsers.yml | 15 +
.circleci/src/executors/sb_node_22_browsers.yml | 15 +
.circleci/src/executors/sb_node_22_classic.yml | 15 +
.circleci/src/executors/sb_playwright.yml | 15 +
.circleci/src/jobs/bench-packages.yml | 61 +
.circleci/src/jobs/bench-sandboxes.yml | 28 +
</shell_result>
Script executed:
# Look for any SolidJS-specific setup in the codebase
rg -n "solid" code/lib/cli-storybook/src/sandbox-templates.ts -C5 | grep -E "(script|modifications|skipTasks)" -A2 -B2Repository: storybookjs/storybook
<shell_result>
Repository: storybookjs/storybook
Exit code: 0
stdout:
501- skipMocking: true,
502- },
503- skipTasks: ['e2e-tests', 'e2e-tests-dev', 'bench', 'vitest-integration'],
504- },
505: 'solid-vite/default-ts': {
506- name: 'SolidJS Latest (Vite | TypeScript)',
507: script: 'yarn create solid {{beforeDir}} --vanilla --ts --template=with-vitest',
508- expected: {
509: framework: 'storybook-solidjs-vite',
--
511- builder: '@storybook/builder-vite',
512- },
513- skipTasks: ['e2e-tests', 'e2e-tests-dev', 'bench', 'vitest-integration'],
514- },
515- 'vue3-vite/default-js': {
</shell_result>
Script executed:
# Check if there's a setup-vitest or vitest configuration for Solid
rg -n "setupVitest\|vitest" scripts/tasks/sandbox-parts/ -lRepository: storybookjs/storybook
<shell_result>
Repository: storybookjs/storybook
Exit code: 2
stderr:
scripts/tasks/sandbox-parts/: No such file or directory (os error 2)
</shell_result>
Script executed:
# Find sandbox-parts files
find scripts -name "*sandbox*" -type fRepository: storybookjs/storybook
<shell_result>
Repository: storybookjs/storybook
Exit code: 0
stdout:
scripts/create-nx-sandbox-projects.ts
scripts/get-sandbox-dir.ts
scripts/tasks/check-sandbox.ts
scripts/tasks/sandbox.ts
scripts/tasks/sandbox-parts.ts
</shell_result>
Script executed:
# Check the full commit for context
git show a6d4931f6c code/lib/cli-storybook/src/sandbox-templates.ts 2>/dev/null | grep -A30 "solid-vite"Repository: storybookjs/storybook
<shell_result>
Repository: storybookjs/storybook
Exit code: 0
stdout:
+ 'solid-vite/default-ts': {
+ name: 'SolidJS Latest (Vite | TypeScript)',
+ script: 'yarn create solid {{beforeDir}} --vanilla --ts --template=with-vitest',
+ expected: {
+ framework: 'storybook-solidjs-vite',
+ renderer: 'storybook-solidjs-vite',
+ builder: '@storybook/builder-vite',
+ },
+ skipTasks: ['e2e-tests', 'e2e-tests-dev', 'bench', 'vitest-integration'],
+ },
+ 'vue3-vite/default-js': {
+ name: 'Vue v3 (Vite | JavaScript)',
+ script: 'npm create vite --yes {{beforeDir}} -- --template vue',
+ expected: {
+ framework: '@storybook/vue3-vite',
+ renderer: '@storybook/vue3',
+ builder: '@storybook/builder-vite',
+ },
+ skipTasks: ['e2e-tests', 'bench'],
+ },
+ 'vue3-vite/default-ts': {
+ name: 'Vue v3 (Vite | TypeScript)',
+ script: 'npm create vite --yes {{beforeDir}} -- --template vue-ts',
+ expected: {
+ framework: '@storybook/vue3-vite',
+ renderer: '@storybook/vue3',
+ builder: '@storybook/builder-vite',
+ },
+ skipTasks: ['bench'],
+ },
+ 'vue3-rsbuild/default-ts': {
--
+ 'solid-vite/default-ts',
+ 'vue3-rsbuild/default-ts',
+];
+
+export const daily: TemplateKey[] = [
+ ...merged,
+ 'angular-cli/prerelease',
+ // TODO: Add this back once we resolve the React 19 issues
+ // 'cra/default-js',
+ 'react-vite/default-js',
+ 'react-vite/prerelease-ts',
+ 'react-webpack/prerelease-ts',
+ 'nextjs-vite/14-ts',
+ 'nextjs/14-ts',
+ 'vue3-vite/default-js',
+ 'lit-vite/default-js',
+ 'svelte-vite/default-js',
+ 'nextjs/prerelease',
+ 'qwik-vite/default-ts',
+ 'preact-vite/default-js',
+ 'html-vite/default-js',
+ 'internal/react16-webpack',
+ 'internal/react18-webpack-babel',
+ 'react-native-web-vite/expo-ts',
+ 'lit-rsbuild/default-ts',
+ 'html-rsbuild/default-ts',
+ // 'react-native-web-vite/rn-cli-ts',
+];
+
+export const templatesByCadence = { normal, merged, daily };
</shell_result>
Script executed:
# Check the sandbox-parts.ts file to understand vitest setup
cat -n scripts/tasks/sandbox-parts.ts | grep -A20 "setupVitest"Repository: storybookjs/storybook
<shell_result>
Repository: storybookjs/storybook
Exit code: 0
stdout:
448 export async function setupVitest(details: TemplateDetails, options: PassedOptionValues) {
449 const { sandboxDir, template } = details;
450 const packageJsonPath = join(sandboxDir, 'package.json');
451 const packageJson = await readJson(packageJsonPath);
452
453 packageJson.scripts = {
454 ...packageJson.scripts,
455 vitest: 'vitest --reporter=default --reporter=hanging-process --test-timeout=5000',
456 };
457
458 // This workaround is needed because Vitest seems to have issues in link mode
459 // so the /setup-file and /global-setup files from the vitest addon won't work in portal protocol
460 if (options.link) {
461 const vitestAddonPath = relative(sandboxDir, join(CODE_DIRECTORY, 'addons', 'vitest'));
462 packageJson.resolutions = {
463 ...packageJson.resolutions,
464 '@storybook/addon-vitest': `file:${vitestAddonPath}`,
465 };
466 }
467
468 await writeFile(packageJsonPath, JSON.stringify(packageJson, null, 2));
</shell_result>
Script executed:
# Search the repo for any comments or documentation about why solid skips vitest-integration
rg -n "solid.*vitest\|vitest.*solid" . -i -A2 -B2 | head -40Repository: storybookjs/storybook
<shell_result>
Repository: storybookjs/storybook
Exit code: 0
</shell_result>
Script executed:
# Let's check if there are other recent commits or PRs mentioning solid or vitest
git log --all --oneline --grep="solid\|vitest" -i | head -20Repository: storybookjs/storybook
<shell_result>
Repository: storybookjs/storybook
Exit code: 0
stdout:
a6d4931f6c Exclude solid from e2e tests
</shell_result>
Script executed:
# Check if create-solid is documented anywhere in the repo
rg -n "create-solid" . -i --type=md --type=txt | head -20Repository: storybookjs/storybook
<shell_result>
Repository: storybookjs/storybook
Exit code: 0
</shell_result>
Script executed:
# Double-check the comparison: does vue3-vite actually run vitest-integration?
rg -n "vue3-vite" code/lib/cli-storybook/src/sandbox-templates.ts -A8 | grep -E "name|script|skipTasks"Repository: storybookjs/storybook
<shell_result>
Repository: storybookjs/storybook
Exit code: 0
stdout:
516- name: 'Vue v3 (Vite | JavaScript)',
517- script: 'npm create vite --yes {{beforeDir}} -- --template vue',
523- skipTasks: ['e2e-tests', 'bench'],
526- name: 'Vue v3 (Vite | TypeScript)',
527- script: 'npm create vite --yes {{beforeDir}} -- --template vue-ts',
533- skipTasks: ['bench'],
536- name: 'Vue Latest (RsBuild | TypeScript)',
537- script: 'yarn create rsbuild -d {{beforeDir}} -t vue-ts --tools eslint',
</shell_result>
Based on my verification of the codebase, I can now provide the rewritten review comment:
Confirm create-solid CLI flags and verify Vitest integration skip for Solid sandbox
The solid-vite/default-ts template wiring has two issues that need clarification:
-
Non-standard CLI invocation
The script uses:
script: 'yarn create solid {{beforeDir}} --vanilla --ts --template=with-vitest',
These flags (
--vanilla,--ts,--template=with-vitest) are not documented in public Solid documentation. In contrast, all other Vite templates in this file use well-documented, standard commands:npm create vite --yes(React, Vue, etc.)yarn create rsbuild(official RsBuild)
Please verify that this command:
- Runs non-interactively in CI without user prompts
- Produces the expected Solid+Vitest starter layout
- Won't break if
create-solidchanges behavior in future versions
-
Inconsistent
vitest-integrationskipUnlike
vue3-vite/default-ts(which only skips['bench']and runs vitest-integration),solid-vite/default-tsskips vitest-integration:skipTasks: ['e2e-tests', 'e2e-tests-dev', 'bench', 'vitest-integration'],
Since this PR's goal is to add Solid support to addon-vitest, the sandbox should participate in vitest integration tests. Either:
- Remove
vitest-integrationfrom skipTasks to align with the PR intent and other Vite templates, or - Add a TODO comment explaining the skip and when it will be re-enabled
- Remove
🤖 Prompt for AI Agents
In code/lib/cli-storybook/src/sandbox-templates.ts around lines 505–514, the
Solid template uses an undocumented/non-standard create command and
unnecessarily skips vitest integration; update the script to invoke the official
non-interactive create command or equivalent documented flags that reliably
produce a Solid+Vitest starter (confirm it runs CI-safe/non-interactively and
yields the expected layout), and remove "vitest-integration" from skipTasks so
the sandbox participates in vitest integration tests (or if skipping is
currently necessary, add a TODO comment explaining why and when it will be
re-enabled).
…orted-frameworks-for-addon-vitest Solid: Add Solid to the list of supported frameworks for addon-vitest (cherry picked from commit 0a02926)
Closes #
What I did
Checklist for Contributors
Testing
The changes in this PR are covered in the following automated tests:
Manual testing
This section is mandatory for all contributions. If you believe no manual test is necessary, please state so explicitly. Thanks!
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 pull request has been released as version
0.0.0-pr-33084-sha-3117a6ae. Try it out in a new sandbox by runningnpx [email protected] sandboxor in an existing project withnpx [email protected] upgrade.More information
0.0.0-pr-33084-sha-3117a6aevalentin/add-solid-to-supported-frameworks-for-addon-vitest3117a6ae1763735360)To request a new release of this pull request, mention the
@storybookjs/coreteam.core team members can create a new canary release here or locally with
gh workflow run --repo storybookjs/storybook publish.yml --field pr=33084Summary by CodeRabbit
New Features
Chores
✏️ Tip: You can customize this high-level summary in your review settings.