Skip to content

Conversation

@kingston
Copy link
Collaborator

@kingston kingston commented Jan 6, 2026

Summary by CodeRabbit

  • Chores
    • Updated test configuration across multiple applications to use default test discovery behavior instead of explicit settings.
    • Improved internal path handling utilities for test setup file resolution.
    • Released patch updates for two core packages.

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

@vercel
Copy link

vercel bot commented Jan 6, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
baseplate-project-builder-web Ready Ready Preview, Comment Jan 6, 2026 1:29pm

@changeset-bot
Copy link

changeset-bot bot commented Jan 6, 2026

🦋 Changeset detected

Latest commit: 390e002

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 18 packages
Name Type
@baseplate-dev/fastify-generators Patch
@baseplate-dev/core-generators Patch
@baseplate-dev/project-builder-server Patch
@baseplate-dev/plugin-auth Patch
@baseplate-dev/plugin-queue Patch
@baseplate-dev/plugin-storage Patch
@baseplate-dev/react-generators Patch
@baseplate-dev/create-project Patch
@baseplate-dev/project-builder-cli Patch
@baseplate-dev/project-builder-common Patch
@baseplate-dev/project-builder-test Patch
@baseplate-dev/project-builder-web Patch
@baseplate-dev/code-morph Patch
@baseplate-dev/project-builder-lib Patch
@baseplate-dev/sync Patch
@baseplate-dev/tools Patch
@baseplate-dev/ui-components Patch
@baseplate-dev/utils Patch

Not sure what this means? Click here to learn what changesets are.

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

@coderabbitai
Copy link

coderabbitai bot commented Jan 6, 2026

📝 Walkthrough

Walkthrough

Removes explicit root: './src' Vitest configuration from example applications and generators, relying on default test discovery instead. Updates path handling in Fastify generators to use a normalizePathToOutputPath utility function.

Changes

Cohort / File(s) Summary
Changeset & Core Generator Updates
.changeset/funny-seals-scream.md, packages/core-generators/src/generators/node/vitest/vitest.generator.ts
Patch version updates to @baseplate-dev/fastify-generators and @baseplate-dev/core-generators; removed quot('./src') import and usage from core-generators Vitest generator
Example Application Vitest Configurations
examples/blog-with-auth/apps/admin/vitest.config.ts, examples/blog-with-auth/apps/backend/vitest.config.ts, examples/todo-with-auth0/apps/admin/vitest.config.ts, examples/todo-with-auth0/apps/backend/vitest.config.ts, examples/todo-with-auth0/apps/web/vitest.config.ts
Removed root: './src' property from Vitest configs; updated backend global setup paths from './tests/...' to 'src/tests/...'
Fastify Generator Path Normalization
packages/fastify-generators/src/generators/core/fastify-redis/fastify-redis.generator.ts, packages/fastify-generators/src/generators/vitest/prisma-vitest/prisma-vitest.generator.ts
Replaced manual path string manipulation with normalizePathToOutputPath() utility for global setup file path computation

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: removing root: 'src/' from vitest.config.ts across multiple configuration files and generators.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 97bd14e and 390e002.

⛔ Files ignored due to path filters (5)
  • examples/blog-with-auth/apps/admin/baseplate/generated/vitest.config.ts is excluded by !**/generated/**, !**/generated/**
  • examples/blog-with-auth/apps/backend/baseplate/generated/vitest.config.ts is excluded by !**/generated/**, !**/generated/**
  • examples/todo-with-auth0/apps/admin/baseplate/generated/vitest.config.ts is excluded by !**/generated/**, !**/generated/**
  • examples/todo-with-auth0/apps/backend/baseplate/generated/vitest.config.ts is excluded by !**/generated/**, !**/generated/**
  • examples/todo-with-auth0/apps/web/baseplate/generated/vitest.config.ts is excluded by !**/generated/**, !**/generated/**
📒 Files selected for processing (9)
  • .changeset/funny-seals-scream.md
  • examples/blog-with-auth/apps/admin/vitest.config.ts
  • examples/blog-with-auth/apps/backend/vitest.config.ts
  • examples/todo-with-auth0/apps/admin/vitest.config.ts
  • examples/todo-with-auth0/apps/backend/vitest.config.ts
  • examples/todo-with-auth0/apps/web/vitest.config.ts
  • packages/core-generators/src/generators/node/vitest/vitest.generator.ts
  • packages/fastify-generators/src/generators/core/fastify-redis/fastify-redis.generator.ts
  • packages/fastify-generators/src/generators/vitest/prisma-vitest/prisma-vitest.generator.ts
💤 Files with no reviewable changes (4)
  • examples/todo-with-auth0/apps/web/vitest.config.ts
  • packages/core-generators/src/generators/node/vitest/vitest.generator.ts
  • examples/todo-with-auth0/apps/admin/vitest.config.ts
  • examples/blog-with-auth/apps/admin/vitest.config.ts
🧰 Additional context used
📓 Path-based instructions (11)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/code-style.mdc)

**/*.{ts,tsx}: Use TypeScript with strict type checking enabled
Always include return types on top-level functions including React components (React.ReactElement)
Include absolute paths in import statements via tsconfig paths (@src/ is the alias for src/)
If a particular interface or type is not exported, change the file so it is exported
If caught on a typing loop where forcing the any type is necessary, do not iterate too much - leave the typing as broken and let the user fix it

If target code is not easily testable, refactor it to be more testable (e.g., export types or functions)

If a particular interface or type is not exported, change the file so it is exported

Files:

  • packages/fastify-generators/src/generators/core/fastify-redis/fastify-redis.generator.ts
  • packages/fastify-generators/src/generators/vitest/prisma-vitest/prisma-vitest.generator.ts
  • examples/todo-with-auth0/apps/backend/vitest.config.ts
  • examples/blog-with-auth/apps/backend/vitest.config.ts
**/*.{ts,tsx,js}

📄 CodeRabbit inference engine (.cursor/rules/code-style.mdc)

**/*.{ts,tsx,js}: Node 16 module resolution - include file extensions in imports (.js)
Sort imports by group: external libs first, then local imports
Use camelCase for variables/functions, PascalCase for types/classes
Order functions such that functions are placed below the variables/functions they use
Prefer using nullish coalescing operator (??) instead of logical or (||), enforced via ESLint rule
Prefer barrel exports e.g. export * from './foo.js' instead of individual named exports
Use console.info/warn/error instead of console.log

Files:

  • packages/fastify-generators/src/generators/core/fastify-redis/fastify-redis.generator.ts
  • packages/fastify-generators/src/generators/vitest/prisma-vitest/prisma-vitest.generator.ts
  • examples/todo-with-auth0/apps/backend/vitest.config.ts
  • examples/blog-with-auth/apps/backend/vitest.config.ts
**/*.{js,ts,tsx,jsx}

📄 CodeRabbit inference engine (.cursor/rules/mcp-actions.mdc)

**/*.{js,ts,tsx,jsx}: Use mcp__baseplate_dev_server__diff_project() to generate a diff between generated and current working directory state, with optional parameters for compact format, specific packages, and file glob filtering
Use mcp__baseplate_dev_server__sync_project() to sync a specified project using the baseplate sync engine, with optional parameters for overwrite behavior, command skipping, and custom snapshot directory
Use mcp__baseplate_dev_server__delete_template() to delete templates by providing a file path and optionally the project name, which removes the template file, metadata, and generated files
Use mcp__baseplate_dev_server__extract_templates() to extract templates from a project and app, with optional auto-generation of extractor.json files and directory cleanup control
Use mcp__baseplate_dev_server__generate_templates() to generate typed template files from existing extractor.json configurations with optional project specification and cleanup control
Use mcp__baseplate_dev_server__create_generator() to create new generators with boilerplate code, using naming format 'category/name' and specifying the target directory
Use mcp__baseplate_dev_server__list_templates() to list all available generators with their templates, optionally filtered by project
Use mcp__baseplate_dev_server__show_template_metadata() to retrieve template metadata for a file from .templates-info.json using file path and optional project specification
Use mcp__baseplate_dev_server__snapshot_add() to track files in snapshots for persistent difference tracking, specifying project, app, file paths, and optional deletion markers
Use mcp__baseplate_dev_server__snapshot_remove() to untrack files from snapshot management with project, app, and file path specifications
Use mcp__baseplate_dev_server__snapshot_save() to persist current differences to snapshot with optional force flag to bypass confirmation
Use mcp__baseplate_dev_server__snapshot_show() to dis...

Files:

  • packages/fastify-generators/src/generators/core/fastify-redis/fastify-redis.generator.ts
  • packages/fastify-generators/src/generators/vitest/prisma-vitest/prisma-vitest.generator.ts
  • examples/todo-with-auth0/apps/backend/vitest.config.ts
  • examples/blog-with-auth/apps/backend/vitest.config.ts
**/*.{tsx,ts,jsx,js}

📄 CodeRabbit inference engine (.cursor/rules/ui-components.mdc)

Import components from '@baseplate-dev/ui-components' package using destructured imports (e.g., import { Button, Input, Card, Dialog } from '@baseplate-dev/ui-components';)

Files:

  • packages/fastify-generators/src/generators/core/fastify-redis/fastify-redis.generator.ts
  • packages/fastify-generators/src/generators/vitest/prisma-vitest/prisma-vitest.generator.ts
  • examples/todo-with-auth0/apps/backend/vitest.config.ts
  • examples/blog-with-auth/apps/backend/vitest.config.ts
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

Always use compareStrings from @baseplate-dev/utils instead of String.prototype.localeCompare() for code generation, file sorting, and internal data structures

Files:

  • packages/fastify-generators/src/generators/core/fastify-redis/fastify-redis.generator.ts
  • packages/fastify-generators/src/generators/vitest/prisma-vitest/prisma-vitest.generator.ts
  • examples/todo-with-auth0/apps/backend/vitest.config.ts
  • examples/blog-with-auth/apps/backend/vitest.config.ts
**/generators/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/generators/**/*.{ts,tsx}: Follow task-based architecture for generators using createGenerator and createGeneratorTask
Use provider scopes for explicit wiring and to control visibility and prevent collisions between tasks
Use TsCodeFragment for composable code pieces and TsCodeUtils for manipulating fragments in TypeScript code generation
Use the import builder for managing dependencies in TypeScript code generation
Organize complex generation with Task Phases for ordered execution
Use Dynamic Tasks for data-driven generation

Files:

  • packages/fastify-generators/src/generators/core/fastify-redis/fastify-redis.generator.ts
  • packages/fastify-generators/src/generators/vitest/prisma-vitest/prisma-vitest.generator.ts
.changeset/*.md

📄 CodeRabbit inference engine (AGENTS.md)

Add a new Changeset for any new feature or existing feature change in the .changeset/ directory following the form with patch changes

Files:

  • .changeset/funny-seals-scream.md
examples/todo-with-auth0/**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (examples/todo-with-auth0/CLAUDE.md)

Always use .js extensions in import statements, even for TypeScript files. Example: import { getSystemInfo } from '@src/system-info.js';

Files:

  • examples/todo-with-auth0/apps/backend/vitest.config.ts
examples/todo-with-auth0/**/*.{ts,tsx}

📄 CodeRabbit inference engine (examples/todo-with-auth0/CLAUDE.md)

examples/todo-with-auth0/**/*.{ts,tsx}: Use import type for type-only imports
Always specify explicit return types for functions
Add JSDocs to all exported functions, interfaces, and classes with documentation of the function, its parameters, return value, and all fields

Files:

  • examples/todo-with-auth0/apps/backend/vitest.config.ts
examples/blog-with-auth/**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (examples/blog-with-auth/CLAUDE.md)

examples/blog-with-auth/**/*.{ts,tsx,js,jsx}: Always use .js extensions in import statements, even for TypeScript files (e.g., import { getSystemInfo } from '@src/system-info.js';)
Follow ESM module resolution with TypeScript's NodeNext setting
Add JSDocs to all exported functions, interfaces, and classes with documentation of the function, its parameters, return value, and all fields

Files:

  • examples/blog-with-auth/apps/backend/vitest.config.ts
examples/blog-with-auth/**/*.{ts,tsx}

📄 CodeRabbit inference engine (examples/blog-with-auth/CLAUDE.md)

examples/blog-with-auth/**/*.{ts,tsx}: Use import type for type-only imports in TypeScript
Always specify explicit return types for functions in TypeScript

Files:

  • examples/blog-with-auth/apps/backend/vitest.config.ts
🧠 Learnings (40)
📓 Common learnings
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: examples/todo-with-auth0/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:44:46.506Z
Learning: Applies to examples/todo-with-auth0/**/*.{unit,int}.test.ts : Import test functions explicitly from 'vitest' instead of using globals. Example: `import { describe, expect, it } from 'vitest';`
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: examples/blog-with-auth/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:44:33.994Z
Learning: Applies to examples/blog-with-auth/**/*.test.ts : Import test functions explicitly from 'vitest' instead of relying on globals (e.g., `import { describe, expect, it } from 'vitest';`)
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: examples/blog-with-auth/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:44:33.994Z
Learning: Run tests from `./src` root directory in Vitest
Learnt from: kingston
Repo: halfdomelabs/baseplate PR: 510
File: packages/project-builder-server/src/sync/conflict-file-monitor.test.ts:19-24
Timestamp: 2025-04-23T06:44:30.952Z
Learning: In the project-builder-server test suite, Vitest automocks for 'node:fs' and 'node:fs/promises' are already configured to use memfs without needing explicit implementation replacement in each test file.
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: .cursor/rules/code-style.mdc:0-0
Timestamp: 2025-11-24T19:45:01.582Z
Learning: Applies to **/*.{unit.test.ts,int.test.ts} : Always import vitest globals explicitly (describe, it, expect)
Learnt from: kingston
Repo: halfdomelabs/baseplate PR: 505
File: packages/create-project/tsconfig.json:6-6
Timestamp: 2025-04-21T06:32:22.476Z
Learning: Since TypeScript 4.1, baseUrl is not required for paths mapping when using explicit relative paths (with "./"). Removing baseUrl from tsconfig.json while updating paths to use relative paths (e.g., changing "src/*": ["src/*"] to "src/*": ["./src/*"]) prevents bare path imports from node_modules while maintaining path alias functionality.
Learnt from: kingston
Repo: halfdomelabs/baseplate PR: 505
File: packages/create-project/tsconfig.json:6-6
Timestamp: 2025-04-21T06:32:22.476Z
Learning: Since TypeScript 4.1, baseUrl is not required for paths mapping in tsconfig.json. Removing baseUrl and using explicit relative paths with "./" prefix (e.g., changing "src/*": ["src/*"] to "src/*": ["./src/*"]) prevents bare path imports from node_modules while maintaining path alias functionality.
Learnt from: kingston
Repo: halfdomelabs/baseplate PR: 510
File: packages/project-builder-server/src/sync/conflict-file-monitor.test.ts:19-24
Timestamp: 2025-04-23T06:44:30.952Z
Learning: When testing file operations in this codebase, the pattern is to use Vitest automocks for 'node:fs' and 'node:fs/promises' (without explicit implementation replacement) while populating a virtual filesystem with vol.fromJSON() from memfs. File operations in tests are performed directly via vol.promises methods.
Learnt from: kingston
Repo: halfdomelabs/baseplate PR: 510
File: packages/project-builder-server/src/sync/conflict-file-monitor.test.ts:19-24
Timestamp: 2025-04-23T06:44:30.952Z
Learning: In this codebase, when testing file operations, Vitest's automocks for 'node:fs' and 'node:fs/promises' are used in conjunction with memfs, but without replacing the mock implementation explicitly in each test file. The virtual filesystem is populated using vol.fromJSON or similar methods, which works seamlessly with the automocks.
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: .cursor/rules/code-style.mdc:0-0
Timestamp: 2025-11-24T19:45:01.582Z
Learning: Applies to **/*.{ts,tsx} : Include absolute paths in import statements via tsconfig paths (`src/` is the alias for `src/`)
📚 Learning: 2025-11-24T19:44:46.506Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: examples/todo-with-auth0/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:44:46.506Z
Learning: Applies to examples/todo-with-auth0/**/*.{unit,int}.test.ts : Import test functions explicitly from 'vitest' instead of using globals. Example: `import { describe, expect, it } from 'vitest';`

Applied to files:

  • packages/fastify-generators/src/generators/core/fastify-redis/fastify-redis.generator.ts
  • packages/fastify-generators/src/generators/vitest/prisma-vitest/prisma-vitest.generator.ts
  • .changeset/funny-seals-scream.md
  • examples/todo-with-auth0/apps/backend/vitest.config.ts
  • examples/blog-with-auth/apps/backend/vitest.config.ts
📚 Learning: 2025-12-30T13:55:38.721Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: .cursor/rules/mcp-actions.mdc:0-0
Timestamp: 2025-12-30T13:55:38.721Z
Learning: Applies to **/*.{js,ts,tsx,jsx} : Use `mcp__baseplate_dev_server__diff_project()` to generate a diff between generated and current working directory state, with optional parameters for compact format, specific packages, and file glob filtering

Applied to files:

  • packages/fastify-generators/src/generators/core/fastify-redis/fastify-redis.generator.ts
  • packages/fastify-generators/src/generators/vitest/prisma-vitest/prisma-vitest.generator.ts
  • .changeset/funny-seals-scream.md
📚 Learning: 2025-12-30T13:55:38.721Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: .cursor/rules/mcp-actions.mdc:0-0
Timestamp: 2025-12-30T13:55:38.721Z
Learning: Applies to **/*.{js,ts,tsx,jsx} : Use `mcp__baseplate_dev_server__create_generator()` to create new generators with boilerplate code, using naming format 'category/name' and specifying the target directory

Applied to files:

  • packages/fastify-generators/src/generators/core/fastify-redis/fastify-redis.generator.ts
  • packages/fastify-generators/src/generators/vitest/prisma-vitest/prisma-vitest.generator.ts
  • .changeset/funny-seals-scream.md
📚 Learning: 2025-12-30T13:56:01.652Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-30T13:56:01.652Z
Learning: Applies to **/generators/**/*.{ts,tsx} : Follow task-based architecture for generators using `createGenerator` and `createGeneratorTask`

Applied to files:

  • packages/fastify-generators/src/generators/core/fastify-redis/fastify-redis.generator.ts
  • packages/fastify-generators/src/generators/vitest/prisma-vitest/prisma-vitest.generator.ts
📚 Learning: 2025-12-30T13:56:01.652Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-30T13:56:01.652Z
Learning: Applies to **/generators/**/*.{ts,tsx} : Organize complex generation with Task Phases for ordered execution

Applied to files:

  • packages/fastify-generators/src/generators/core/fastify-redis/fastify-redis.generator.ts
  • packages/fastify-generators/src/generators/vitest/prisma-vitest/prisma-vitest.generator.ts
📚 Learning: 2025-12-30T13:56:01.652Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-30T13:56:01.652Z
Learning: Applies to **/generators/**/*.{ts,tsx} : Use provider scopes for explicit wiring and to control visibility and prevent collisions between tasks

Applied to files:

  • packages/fastify-generators/src/generators/core/fastify-redis/fastify-redis.generator.ts
  • packages/fastify-generators/src/generators/vitest/prisma-vitest/prisma-vitest.generator.ts
📚 Learning: 2025-12-30T13:56:01.652Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-30T13:56:01.652Z
Learning: Applies to **/generators/**/*.{ts,tsx} : Use Dynamic Tasks for data-driven generation

Applied to files:

  • packages/fastify-generators/src/generators/core/fastify-redis/fastify-redis.generator.ts
  • packages/fastify-generators/src/generators/vitest/prisma-vitest/prisma-vitest.generator.ts
📚 Learning: 2025-05-05T06:35:13.300Z
Learnt from: kingston
Repo: halfdomelabs/baseplate PR: 521
File: packages/react-generators/src/generators/admin/admin-components/admin-components.generator.ts:55-61
Timestamp: 2025-05-05T06:35:13.300Z
Learning: In generators, paths should be merged with forward slashes (/) only since JavaScript generated files use POSIX style separators. The system handles conversion to Windows style separators at later stages when writing out files.

Applied to files:

  • packages/fastify-generators/src/generators/core/fastify-redis/fastify-redis.generator.ts
📚 Learning: 2025-12-30T13:55:38.721Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: .cursor/rules/mcp-actions.mdc:0-0
Timestamp: 2025-12-30T13:55:38.721Z
Learning: Applies to **/*.{js,ts,tsx,jsx} : Use `mcp__baseplate_dev_server__extract_templates()` to extract templates from a project and app, with optional auto-generation of extractor.json files and directory cleanup control

Applied to files:

  • packages/fastify-generators/src/generators/core/fastify-redis/fastify-redis.generator.ts
  • packages/fastify-generators/src/generators/vitest/prisma-vitest/prisma-vitest.generator.ts
📚 Learning: 2025-12-30T13:56:01.652Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-30T13:56:01.652Z
Learning: Applies to **/generators/**/*.{ts,tsx} : Use the import builder for managing dependencies in TypeScript code generation

Applied to files:

  • packages/fastify-generators/src/generators/core/fastify-redis/fastify-redis.generator.ts
  • packages/fastify-generators/src/generators/vitest/prisma-vitest/prisma-vitest.generator.ts
📚 Learning: 2025-12-30T13:55:38.721Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: .cursor/rules/mcp-actions.mdc:0-0
Timestamp: 2025-12-30T13:55:38.721Z
Learning: Applies to **/*.{js,ts,tsx,jsx} : Use `mcp__baseplate_dev_server__list_templates()` to list all available generators with their templates, optionally filtered by project

Applied to files:

  • packages/fastify-generators/src/generators/core/fastify-redis/fastify-redis.generator.ts
  • packages/fastify-generators/src/generators/vitest/prisma-vitest/prisma-vitest.generator.ts
📚 Learning: 2025-12-30T13:55:38.721Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: .cursor/rules/mcp-actions.mdc:0-0
Timestamp: 2025-12-30T13:55:38.721Z
Learning: Applies to **/*.{js,ts,tsx,jsx} : Use `mcp__baseplate_dev_server__sync_project()` to sync a specified project using the baseplate sync engine, with optional parameters for overwrite behavior, command skipping, and custom snapshot directory

Applied to files:

  • packages/fastify-generators/src/generators/core/fastify-redis/fastify-redis.generator.ts
📚 Learning: 2025-04-23T06:44:30.952Z
Learnt from: kingston
Repo: halfdomelabs/baseplate PR: 510
File: packages/project-builder-server/src/sync/conflict-file-monitor.test.ts:19-24
Timestamp: 2025-04-23T06:44:30.952Z
Learning: In the project-builder-server test suite, Vitest automocks for 'node:fs' and 'node:fs/promises' are already configured to use memfs without needing explicit implementation replacement in each test file.

Applied to files:

  • packages/fastify-generators/src/generators/core/fastify-redis/fastify-redis.generator.ts
  • packages/fastify-generators/src/generators/vitest/prisma-vitest/prisma-vitest.generator.ts
  • .changeset/funny-seals-scream.md
  • examples/todo-with-auth0/apps/backend/vitest.config.ts
📚 Learning: 2025-04-23T06:44:30.952Z
Learnt from: kingston
Repo: halfdomelabs/baseplate PR: 510
File: packages/project-builder-server/src/sync/conflict-file-monitor.test.ts:19-24
Timestamp: 2025-04-23T06:44:30.952Z
Learning: When testing file operations in this codebase, the pattern is to use Vitest automocks for 'node:fs' and 'node:fs/promises' (without explicit implementation replacement) while populating a virtual filesystem with vol.fromJSON() from memfs. File operations in tests are performed directly via vol.promises methods.

Applied to files:

  • packages/fastify-generators/src/generators/core/fastify-redis/fastify-redis.generator.ts
📚 Learning: 2025-11-24T19:45:01.582Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: .cursor/rules/code-style.mdc:0-0
Timestamp: 2025-11-24T19:45:01.582Z
Learning: Applies to **/*.{unit.test.ts,int.test.ts} : Always import vitest globals explicitly (describe, it, expect)

Applied to files:

  • packages/fastify-generators/src/generators/core/fastify-redis/fastify-redis.generator.ts
  • packages/fastify-generators/src/generators/vitest/prisma-vitest/prisma-vitest.generator.ts
  • .changeset/funny-seals-scream.md
  • examples/todo-with-auth0/apps/backend/vitest.config.ts
  • examples/blog-with-auth/apps/backend/vitest.config.ts
📚 Learning: 2025-11-24T19:44:33.994Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: examples/blog-with-auth/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:44:33.994Z
Learning: Applies to examples/blog-with-auth/**/*.test.ts : Import test functions explicitly from 'vitest' instead of relying on globals (e.g., `import { describe, expect, it } from 'vitest';`)

Applied to files:

  • packages/fastify-generators/src/generators/core/fastify-redis/fastify-redis.generator.ts
  • packages/fastify-generators/src/generators/vitest/prisma-vitest/prisma-vitest.generator.ts
  • .changeset/funny-seals-scream.md
  • examples/todo-with-auth0/apps/backend/vitest.config.ts
  • examples/blog-with-auth/apps/backend/vitest.config.ts
📚 Learning: 2025-04-23T06:44:30.952Z
Learnt from: kingston
Repo: halfdomelabs/baseplate PR: 510
File: packages/project-builder-server/src/sync/conflict-file-monitor.test.ts:19-24
Timestamp: 2025-04-23T06:44:30.952Z
Learning: In this codebase, when testing file operations, Vitest's automocks for 'node:fs' and 'node:fs/promises' are used in conjunction with memfs, but without replacing the mock implementation explicitly in each test file. The virtual filesystem is populated using vol.fromJSON or similar methods, which works seamlessly with the automocks.

Applied to files:

  • packages/fastify-generators/src/generators/core/fastify-redis/fastify-redis.generator.ts
📚 Learning: 2025-11-24T19:45:19.136Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-11-24T19:45:19.136Z
Learning: Applies to **/*.test-helper.{ts,tsx} : Extract common setup code into test helpers in `*.test-helper.ts` files

Applied to files:

  • packages/fastify-generators/src/generators/core/fastify-redis/fastify-redis.generator.ts
  • packages/fastify-generators/src/generators/vitest/prisma-vitest/prisma-vitest.generator.ts
  • examples/todo-with-auth0/apps/backend/vitest.config.ts
  • examples/blog-with-auth/apps/backend/vitest.config.ts
📚 Learning: 2025-11-24T19:45:01.582Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: .cursor/rules/code-style.mdc:0-0
Timestamp: 2025-11-24T19:45:01.582Z
Learning: Applies to **/*.{ts,tsx} : Include absolute paths in import statements via tsconfig paths (`src/` is the alias for `src/`)

Applied to files:

  • packages/fastify-generators/src/generators/vitest/prisma-vitest/prisma-vitest.generator.ts
  • .changeset/funny-seals-scream.md
📚 Learning: 2025-04-21T06:32:22.476Z
Learnt from: kingston
Repo: halfdomelabs/baseplate PR: 505
File: packages/create-project/tsconfig.json:6-6
Timestamp: 2025-04-21T06:32:22.476Z
Learning: Since TypeScript 4.1, baseUrl is not required for paths mapping when using explicit relative paths (with "./"). Removing baseUrl from tsconfig.json while updating paths to use relative paths (e.g., changing "src/*": ["src/*"] to "src/*": ["./src/*"]) prevents bare path imports from node_modules while maintaining path alias functionality.

Applied to files:

  • packages/fastify-generators/src/generators/vitest/prisma-vitest/prisma-vitest.generator.ts
  • .changeset/funny-seals-scream.md
  • examples/todo-with-auth0/apps/backend/vitest.config.ts
📚 Learning: 2025-04-21T06:32:22.476Z
Learnt from: kingston
Repo: halfdomelabs/baseplate PR: 505
File: packages/create-project/tsconfig.json:6-6
Timestamp: 2025-04-21T06:32:22.476Z
Learning: Since TypeScript 4.1, baseUrl is not required for paths mapping in tsconfig.json. Removing baseUrl and using explicit relative paths with "./" prefix (e.g., changing "src/*": ["src/*"] to "src/*": ["./src/*"]) prevents bare path imports from node_modules while maintaining path alias functionality.

Applied to files:

  • packages/fastify-generators/src/generators/vitest/prisma-vitest/prisma-vitest.generator.ts
  • .changeset/funny-seals-scream.md
  • examples/todo-with-auth0/apps/backend/vitest.config.ts
  • examples/blog-with-auth/apps/backend/vitest.config.ts
📚 Learning: 2025-12-30T13:55:38.721Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: .cursor/rules/mcp-actions.mdc:0-0
Timestamp: 2025-12-30T13:55:38.721Z
Learning: Applies to **/*.{js,ts,tsx,jsx} : Use `mcp__baseplate_dev_server__generate_templates()` to generate typed template files from existing extractor.json configurations with optional project specification and cleanup control

Applied to files:

  • packages/fastify-generators/src/generators/vitest/prisma-vitest/prisma-vitest.generator.ts
📚 Learning: 2025-12-30T13:56:01.652Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-30T13:56:01.652Z
Learning: Applies to **/generators/**/*.{ts,tsx} : Use `TsCodeFragment` for composable code pieces and `TsCodeUtils` for manipulating fragments in TypeScript code generation

Applied to files:

  • packages/fastify-generators/src/generators/vitest/prisma-vitest/prisma-vitest.generator.ts
📚 Learning: 2025-12-30T13:56:01.652Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-30T13:56:01.652Z
Learning: Applies to .changeset/*.md : Add a new Changeset for any new feature or existing feature change in the `.changeset/` directory following the form with patch changes

Applied to files:

  • .changeset/funny-seals-scream.md
📚 Learning: 2025-11-24T19:44:33.994Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: examples/blog-with-auth/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:44:33.994Z
Learning: Run tests from `./src` root directory in Vitest

Applied to files:

  • .changeset/funny-seals-scream.md
  • examples/blog-with-auth/apps/backend/vitest.config.ts
📚 Learning: 2025-11-24T19:44:46.506Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: examples/todo-with-auth0/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:44:46.506Z
Learning: Applies to examples/todo-with-auth0/**/*.{unit,int}.test.ts : Use `.unit.test.ts` or `.int.test.ts` suffixes for test files in TypeScript

Applied to files:

  • examples/todo-with-auth0/apps/backend/vitest.config.ts
  • examples/blog-with-auth/apps/backend/vitest.config.ts
📚 Learning: 2025-06-03T09:11:29.651Z
Learnt from: kingston
Repo: halfdomelabs/baseplate PR: 562
File: plugins/plugin-auth/package.json:32-36
Timestamp: 2025-06-03T09:11:29.651Z
Learning: With TypeScript project references, TypeScript compilation is watched from the root level using "watch:tsc:root" script, so individual packages no longer need to include their "tsc:watch" scripts in their local "watch" commands. The local "tsc:watch" scripts are renamed from "watch:tsc" but are not meant to be run as part of the package's watch command since TypeScript watching is handled centrally at the workspace root.

Applied to files:

  • examples/todo-with-auth0/apps/backend/vitest.config.ts
📚 Learning: 2025-11-24T19:44:33.994Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: examples/blog-with-auth/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:44:33.994Z
Learning: Applies to examples/blog-with-auth/**/tsconfig.json : Use `NodeNext` module resolution in TypeScript configuration

Applied to files:

  • examples/todo-with-auth0/apps/backend/vitest.config.ts
  • examples/blog-with-auth/apps/backend/vitest.config.ts
📚 Learning: 2025-11-24T19:44:33.994Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: examples/blog-with-auth/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:44:33.994Z
Learning: Applies to examples/blog-with-auth/**/tsconfig.json : Enable `isolatedModules` in TypeScript configuration

Applied to files:

  • examples/todo-with-auth0/apps/backend/vitest.config.ts
  • examples/blog-with-auth/apps/backend/vitest.config.ts
📚 Learning: 2025-11-24T19:45:19.136Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-11-24T19:45:19.136Z
Learning: Applies to src/tests/**/*.{ts,tsx} : Test helpers are located in `src/tests/` directory

Applied to files:

  • examples/todo-with-auth0/apps/backend/vitest.config.ts
  • examples/blog-with-auth/apps/backend/vitest.config.ts
📚 Learning: 2025-11-24T19:45:19.136Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-11-24T19:45:19.136Z
Learning: Applies to **/*.{unit,int}.test.{ts,tsx} : Always mock external API calls and file system operations

Applied to files:

  • examples/todo-with-auth0/apps/backend/vitest.config.ts
  • examples/blog-with-auth/apps/backend/vitest.config.ts
📚 Learning: 2025-11-24T19:45:19.136Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-11-24T19:45:19.136Z
Learning: Applies to **/*.{unit,int}.test.{ts,tsx} : Structure tests with Arrange-Act-Assert: clear setup, execution, and verification phases

Applied to files:

  • examples/todo-with-auth0/apps/backend/vitest.config.ts
  • examples/blog-with-auth/apps/backend/vitest.config.ts
📚 Learning: 2025-11-24T19:45:19.136Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-11-24T19:45:19.136Z
Learning: Applies to **/*.{unit,int}.test.{ts,tsx} : Test broad behavior and common edge cases intelligently to avoid slowing down CI with excessive tests

Applied to files:

  • examples/todo-with-auth0/apps/backend/vitest.config.ts
  • examples/blog-with-auth/apps/backend/vitest.config.ts
📚 Learning: 2025-11-24T19:45:19.136Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-11-24T19:45:19.136Z
Learning: Applies to **/*.{unit,int}.test.{ts,tsx} : For file system operations in tests, use memfs and mock `node:fs` and `node:fs/promises`

Applied to files:

  • examples/todo-with-auth0/apps/backend/vitest.config.ts
📚 Learning: 2025-06-30T11:52:28.745Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-06-30T11:52:28.745Z
Learning: Applies to **/*.test.{ts,tsx} : For file system operations in tests, use memfs and mock 'node:fs' and 'node:fs/promises' with vi.mock

Applied to files:

  • examples/todo-with-auth0/apps/backend/vitest.config.ts
📚 Learning: 2025-06-30T11:52:28.745Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-06-30T11:52:28.745Z
Learning: Applies to src/__mocks__/**/*.{ts,tsx} : Manual mocks are in `src/__mocks__/` directory

Applied to files:

  • examples/todo-with-auth0/apps/backend/vitest.config.ts
  • examples/blog-with-auth/apps/backend/vitest.config.ts
📚 Learning: 2025-11-24T19:44:33.994Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: examples/blog-with-auth/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:44:33.994Z
Learning: Applies to examples/blog-with-auth/**/*.{unit,int}.test.ts : Use `.unit.test.ts` or `.int.test.ts` suffixes for test files and collocate tests with source files

Applied to files:

  • examples/blog-with-auth/apps/backend/vitest.config.ts
📚 Learning: 2025-11-24T19:44:33.994Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: examples/blog-with-auth/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:44:33.994Z
Learning: Applies to examples/blog-with-auth/**/tsconfig.json : Use strict type checking in TypeScript configuration

Applied to files:

  • examples/blog-with-auth/apps/backend/vitest.config.ts
📚 Learning: 2025-11-24T19:45:19.136Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-11-24T19:45:19.136Z
Learning: Applies to **/*.{unit,int}.test.{ts,tsx} : Leverage TypeScript for type-safe mocking in tests

Applied to files:

  • examples/blog-with-auth/apps/backend/vitest.config.ts
🧬 Code graph analysis (2)
packages/fastify-generators/src/generators/core/fastify-redis/fastify-redis.generator.ts (1)
packages/sync/src/utils/canonical-path.ts (1)
  • normalizePathToOutputPath (16-21)
packages/fastify-generators/src/generators/vitest/prisma-vitest/prisma-vitest.generator.ts (1)
packages/sync/src/utils/canonical-path.ts (1)
  • normalizePathToOutputPath (16-21)
⏰ 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). (7)
  • GitHub Check: Verify Sync (todo-with-auth0)
  • GitHub Check: Verify Sync (blog-with-auth)
  • GitHub Check: Lint Examples (todo-with-auth0)
  • GitHub Check: Lint Examples (blog-with-auth)
  • GitHub Check: Test E2E
  • GitHub Check: test
  • GitHub Check: Lint
🔇 Additional comments (7)
.changeset/funny-seals-scream.md (1)

1-6: LGTM!

The changeset correctly documents the patch changes to both affected generator packages and provides a clear description of the modification.

packages/fastify-generators/src/generators/core/fastify-redis/fastify-redis.generator.ts (2)

13-13: LGTM!

Good addition of the normalizePathToOutputPath utility import for consistent path handling.


110-110: Excellent refactor to use normalizePathToOutputPath utility.

Replacing the manual string manipulation (./${paths.globalSetupRedis.replace('@/src/', '')}) with normalizePathToOutputPath(paths.globalSetupRedis) is a cleaner and more maintainable approach. This utility correctly converts canonical paths (e.g., @/src/tests/...) to output paths (e.g., src/tests/...), which aligns with the removal of explicit root settings in Vitest configurations.

packages/fastify-generators/src/generators/vitest/prisma-vitest/prisma-vitest.generator.ts (2)

8-12: LGTM!

Good addition of the normalizePathToOutputPath import to support the updated path handling approach.


82-82: Excellent consistency with the fastify-redis generator changes.

Replacing the manual path manipulation with normalizePathToOutputPath(paths.globalSetupPrisma) provides a cleaner, more maintainable solution. This change is consistent with the similar update in the fastify-redis generator (line 110 of fastify-redis.generator.ts) and aligns with the broader effort to remove explicit root configurations from Vitest setups.

examples/todo-with-auth0/apps/backend/vitest.config.ts (1)

12-13: LGTM! Path changes are correctly configured.

The paths align correctly with the removal of the root: './src' configuration. Verification confirms:

  • Global setup scripts exist at the expected locations and are properly exported
  • Test files are correctly discovered (7 test files with .unit.test.ts, .int.test.ts, and .e2e.test.ts suffixes found)
  • Path aliases resolve correctly via the tsconfigPaths() plugin and tsconfig.json configuration
examples/blog-with-auth/apps/backend/vitest.config.ts (1)

11-11: Approve: globalSetup path is correct.

The globalSetup path src/tests/scripts/global-setup-prisma.ts is correctly configured. The file exists and is properly structured, with correct imports using .js extensions and proper typing. The setup function correctly handles test database creation via Prisma.


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.

@kingston kingston merged commit fbabdec into main Jan 6, 2026
17 checks passed
@kingston kingston deleted the kingston/eng-968-get-rid-of-rootsrc-in-vitest branch January 6, 2026 13:43
@github-actions github-actions bot mentioned this pull request Jan 5, 2026
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.

2 participants