Skip to content

Build: Update internal Vitest dependencies to 4.1#34147

Closed
valentinpalkovic wants to merge 3 commits into
nextfrom
valentin/update-to-vitest-4.1
Closed

Build: Update internal Vitest dependencies to 4.1#34147
valentinpalkovic wants to merge 3 commits into
nextfrom
valentin/update-to-vitest-4.1

Conversation

@valentinpalkovic
Copy link
Copy Markdown
Contributor

@valentinpalkovic valentinpalkovic commented Mar 15, 2026

Closes #

What I did

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

  • Chores

    • Upgraded the Vitest testing toolchain to 4.1.0 across the project.
  • Documentation

    • Rewrote test and workflow guidance to use agent-focused commands and the agent reporter.
    • Clarified sandbox, CI-parity, and testing expectations with condensed, practical instructions.
  • New Features

    • Added a dedicated lint-js target to streamline JavaScript linting workflows.

@valentinpalkovic valentinpalkovic self-assigned this Mar 15, 2026
@valentinpalkovic valentinpalkovic added build Internal-facing build tooling & test updates ci:normal labels Mar 15, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 15, 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 d9ef2de

@nx-cloud
Copy link
Copy Markdown

nx-cloud Bot commented Mar 15, 2026

View your CI Pipeline Execution ↗ for commit d9ef2de

Command Status Duration Result
nx run-many -t compile -c production --parallel=1 ✅ Succeeded 5m 36s View ↗

☁️ Nx Cloud last updated this comment at 2026-03-16 09:11:45 UTC

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 15, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: de91cd13-e0eb-415a-aba2-4c2829dcae03

📥 Commits

Reviewing files that changed from the base of the PR and between e6ac327 and d9ef2de.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (4)
  • AGENTS.md
  • CLAUDE.md
  • CLAUDE.md
  • code/project.json
✅ Files skipped from review due to trivial changes (2)
  • CLAUDE.md
  • CLAUDE.md

📝 Walkthrough

Walkthrough

Reworks AGENTS.md to an agent-focused command reference (replacing legacy narratives with explicit agent-oriented commands and adding NX notes). Bumps Vitest-related packages from 4.0.x to 4.1.0 across multiple package.json files. Adds a new lint-js target to code/project.json. Adds CLAUDE.md (single-line).

Changes

Cohort / File(s) Summary
Agent docs
AGENTS.md, CLAUDE.md
Rewrote AGENTS.md to replace narrative instructions with explicit agent-focused commands (tests, lint, sandbox flows), updated examples to use --reporter=agent, added NX task/dependency notes. Added CLAUDE.md (single-line file).
Vitest dependency upgrades
code/addons/vitest/package.json, code/package.json, scripts/package.json, test-storybooks/portable-stories-kitchen-sink/react/package.json, test-storybooks/yarn-pnp/package.json, code/lib/eslint-plugin/package.json
Bumped Vitest-related packages to ^4.1.0 (includes vitest, @vitest/*, coverage adapters, runner). Watch for possible test runner/coverage adapter behavior changes.
NX project config
code/project.json
Added new lint-js target that mirrors existing lint target but runs yarn lint:js:cmd (dependsOn compile).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

📝 Coding Plan
  • Generate coding plan for human review comments

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: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@AGENTS.md`:
- Line 230: Update the command example so it explicitly runs from the code/
workspace: change the coverage example that currently shows `yarn vitest run
--coverage <test-file> --reporter=agent` to run from the project’s code
directory by prefixing with `cd code &&` (so use `cd code && yarn vitest run
--coverage <test-file> --reporter=agent`), ensuring vitest resolves and tests
run with the correct root; update the AGENTS.md entry where that example string
appears.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c0609197-e7b2-49ce-a701-a0de942c32bb

📥 Commits

Reviewing files that changed from the base of the PR and between 4c960ec and e6ac327.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (7)
  • AGENTS.md
  • code/addons/vitest/package.json
  • code/lib/eslint-plugin/package.json
  • code/package.json
  • scripts/package.json
  • test-storybooks/portable-stories-kitchen-sink/react/package.json
  • test-storybooks/yarn-pnp/package.json

Comment thread AGENTS.md
- Export functions that need direct tests
- Test real behavior, not just syntax patterns
- Use coverage when useful: `yarn vitest run --coverage <test-file>`
- Use coverage when useful: `yarn vitest run --coverage <test-file> --reporter=agent`
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 | 🟡 Minor

Make the coverage command explicitly run from the code/ workspace.

Line 230 omits cd code &&, which conflicts with the repo-root default and can fail when vitest isn’t resolved from root.

Suggested doc fix
-- Use coverage when useful: `yarn vitest run --coverage <test-file> --reporter=agent`
+- Use coverage when useful: `cd code && yarn vitest run --coverage <test-file> --reporter=agent`

Based on learnings: Tests are located in the code/ directory with root directory for test execution at ./code/.

📝 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
- Use coverage when useful: `yarn vitest run --coverage <test-file> --reporter=agent`
- Use coverage when useful: `cd code && yarn vitest run --coverage <test-file> --reporter=agent`
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@AGENTS.md` at line 230, Update the command example so it explicitly runs from
the code/ workspace: change the coverage example that currently shows `yarn
vitest run --coverage <test-file> --reporter=agent` to run from the project’s
code directory by prefixing with `cd code &&` (so use `cd code && yarn vitest
run --coverage <test-file> --reporter=agent`), ensuring vitest resolves and
tests run with the correct root; update the AGENTS.md entry where that example
string appears.

@valentinpalkovic
Copy link
Copy Markdown
Contributor Author

Superseded by #34172

@github-project-automation github-project-automation Bot moved this from In Progress to Done in Core Team Projects Mar 18, 2026
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

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant