Skip to content

chore: shared vitest conf#2751

Merged
davydkov merged 2 commits into
mainfrom
shared-vitest
Mar 16, 2026
Merged

chore: shared vitest conf#2751
davydkov merged 2 commits into
mainfrom
shared-vitest

Conversation

@davydkov

@davydkov davydkov commented Mar 16, 2026

Copy link
Copy Markdown
Member

This pull request introduces a shared Vitest configuration for the monorepo, centralizing and simplifying the test setup across packages. It adds a new devops/vitest.ts module that provides a reusable defineVitest function, updates all package-level Vitest configs to use this shared setup, and makes minor improvements to dependencies and workflow configuration.

Summary by CodeRabbit

  • Chores
    • Updated CI workflow formatting and removed redundant build steps for select checks.
    • Added a new devops testing helper and package export, plus related testing dependencies.
  • Refactor
    • Simplified and centralized test configuration across multiple packages for consistency.

@changeset-bot

changeset-bot Bot commented Mar 16, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 1c89665

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai

coderabbitai Bot commented Mar 16, 2026

Copy link
Copy Markdown
Contributor

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 7c68b266-09bd-4074-b6b8-77d2b6c37716

📥 Commits

Reviewing files that changed from the base of the PR and between a32fb1f and 1c89665.

📒 Files selected for processing (1)
  • devops/vitest.ts

📝 Walkthrough

Walkthrough

Adds a shared Vitest configuration factory in devops/vitest.ts and exposes it via devops/package.json; updates multiple package vitest.config.ts files to call defineVitest(...). Also tweaks .github/workflows/checks.yaml quoting and removes build steps; renames a PostCSS constant in packages/react/vite.config.mjs.

Changes

Cohort / File(s) Summary
GitHub Actions Workflow
.github/workflows/checks.yaml
Consistent single-quote quoting for env/cache values; removed the 📦 build steps from several check jobs (check-types, check-on-windows, check-tests).
Devops Vitest infra
devops/package.json, devops/vitest.ts
New devops/vitest.ts adds defineVitest(...) factory; devops/package.json adds ./vitest export and dependencies: vitest, defu, pathe.
Package Vitest configs
packages/config/vitest.config.ts, packages/core/vitest.config.ts, packages/diagram/vitest.config.ts, packages/generators/vitest.config.ts, packages/language-server/vitest.config.ts, packages/layouts/vitest.config.ts, packages/leanix-bridge/vitest.config.ts, packages/likec4/vitest.config.ts
Replaced per-package object configs that used defineProject(...) and custom resolve/alias blocks with calls to defineVitest('<name>') (imports changed to @likec4/devops/vitest).
React Vite config
packages/react/vite.config.mjs
Renamed PostCSS plugin identifier from rewriteRootSelector to _rewriteRootSelector; plugin remains unused (no runtime change).

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

  • chore: shared vitest conf #2751 — Adds devops/vitest.ts and updates package vitest.config.ts files to use the shared defineVitest helper (strong code-level overlap).

Poem

🐰
I hopped through configs, quiet and spry,
Found aliases nested, gave them one sky,
A shared little factory, neat and bright,
Now tests call my name and bounce with delight,
Nibble the carrots of DRY tonight!

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description explains the main changes (shared Vitest config, new defineVitest function, updated package configs) but lacks the required checklist items from the repository template. Add the contribution checklist from the repository template to confirm compliance with guidelines, testing, documentation updates, and commit message conventions.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title 'chore: shared vitest conf' directly reflects the main change—introducing shared Vitest configuration for the monorepo, which is the primary objective of the PR.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch shared-vitest
📝 Coding Plan
  • Generate coding plan for human review comments

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.

Tip

CodeRabbit can use OpenGrep to find security vulnerabilities and bugs across 17+ programming languages.

OpenGrep is compatible with Semgrep configurations. Add an opengrep.yml or semgrep.yml configuration file to your project to enable OpenGrep analysis.

@coderabbitai coderabbitai Bot left a comment

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.

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 `@devops/vitest.ts`:
- Around line 23-24: The shared vite/ vitest alias has a typo: change both
occurrences of the misspelled alias and path from '@likec4/digram' and
src('digram') to the correct '@likec4/diagram' and src('diagram') so imports
resolve correctly; update the mapping entry where '@likec4/digram' and
src('digram') are defined in devops/vitest.ts to use '@likec4/diagram' and
src('diagram') instead.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 319cd2ea-ce50-4922-b55b-5ca528c3ba14

📥 Commits

Reviewing files that changed from the base of the PR and between a563f7d and a32fb1f.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (12)
  • .github/workflows/checks.yaml
  • devops/package.json
  • devops/vitest.ts
  • packages/config/vitest.config.ts
  • packages/core/vitest.config.ts
  • packages/diagram/vitest.config.ts
  • packages/generators/vitest.config.ts
  • packages/language-server/vitest.config.ts
  • packages/layouts/vitest.config.ts
  • packages/leanix-bridge/vitest.config.ts
  • packages/likec4/vitest.config.ts
  • packages/react/vite.config.mjs

Comment thread devops/vitest.ts Outdated
@davydkov davydkov merged commit 28b1d4a into main Mar 16, 2026
9 of 10 checks passed
@davydkov davydkov deleted the shared-vitest branch March 16, 2026 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant