mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-01-30 06:12:03 +00:00
refactor: use Vitest projects config instead of deprecated workspace
- Add root vitest.config.ts with projects array (replaces deprecated workspace) - Add name property to each project's vitest.config.ts for filtering - Update package.json test scripts to use vitest projects - Add vitest to root devDependencies This addresses the Vitest warning about multiple configs impacting performance by running all projects in a single Vitest process. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -3,6 +3,7 @@ import path from 'path';
|
|||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
test: {
|
test: {
|
||||||
|
name: 'server',
|
||||||
reporters: ['verbose'],
|
reporters: ['verbose'],
|
||||||
globals: true,
|
globals: true,
|
||||||
environment: 'node',
|
environment: 'node',
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import { defineConfig } from 'vitest/config';
|
|||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
test: {
|
test: {
|
||||||
|
name: 'dependency-resolver',
|
||||||
globals: true,
|
globals: true,
|
||||||
environment: 'node',
|
environment: 'node',
|
||||||
include: ['tests/**/*.test.ts'],
|
include: ['tests/**/*.test.ts'],
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import { defineConfig } from 'vitest/config';
|
|||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
test: {
|
test: {
|
||||||
|
name: 'git-utils',
|
||||||
globals: true,
|
globals: true,
|
||||||
environment: 'node',
|
environment: 'node',
|
||||||
include: ['tests/**/*.test.ts'],
|
include: ['tests/**/*.test.ts'],
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import { defineConfig } from 'vitest/config';
|
|||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
test: {
|
test: {
|
||||||
|
name: 'model-resolver',
|
||||||
globals: true,
|
globals: true,
|
||||||
environment: 'node',
|
environment: 'node',
|
||||||
include: ['tests/**/*.test.ts'],
|
include: ['tests/**/*.test.ts'],
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import { defineConfig } from 'vitest/config';
|
|||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
test: {
|
test: {
|
||||||
|
name: 'platform',
|
||||||
globals: true,
|
globals: true,
|
||||||
environment: 'node',
|
environment: 'node',
|
||||||
include: ['tests/**/*.test.ts'],
|
include: ['tests/**/*.test.ts'],
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import { defineConfig } from 'vitest/config';
|
|||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
test: {
|
test: {
|
||||||
|
name: 'prompts',
|
||||||
globals: true,
|
globals: true,
|
||||||
environment: 'node',
|
environment: 'node',
|
||||||
include: ['tests/**/*.test.ts'],
|
include: ['tests/**/*.test.ts'],
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import { defineConfig } from 'vitest/config';
|
|||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
test: {
|
test: {
|
||||||
|
name: 'utils',
|
||||||
globals: true,
|
globals: true,
|
||||||
environment: 'node',
|
environment: 'node',
|
||||||
include: ['tests/**/*.test.ts'],
|
include: ['tests/**/*.test.ts'],
|
||||||
|
|||||||
13
package.json
13
package.json
@@ -42,10 +42,12 @@
|
|||||||
"lint": "npm run lint --workspace=apps/ui",
|
"lint": "npm run lint --workspace=apps/ui",
|
||||||
"test": "npm run test --workspace=apps/ui",
|
"test": "npm run test --workspace=apps/ui",
|
||||||
"test:headed": "npm run test:headed --workspace=apps/ui",
|
"test:headed": "npm run test:headed --workspace=apps/ui",
|
||||||
"test:server": "npm run test --workspace=apps/server",
|
"test:packages": "vitest run --project=utils --project=platform --project=prompts --project=model-resolver --project=dependency-resolver --project=git-utils",
|
||||||
"test:server:coverage": "npm run test:cov --workspace=apps/server",
|
"test:server": "vitest run --project=server",
|
||||||
"test:packages": "npm run test -w @automaker/types -w @automaker/utils -w @automaker/prompts -w @automaker/platform -w @automaker/model-resolver -w @automaker/dependency-resolver -w @automaker/git-utils --if-present",
|
"test:server:coverage": "vitest run --project=server --coverage",
|
||||||
"test:all": "npm run test:packages && npm run test:server",
|
"test:unit": "vitest run",
|
||||||
|
"test:unit:watch": "vitest",
|
||||||
|
"test:all": "vitest run",
|
||||||
"lint:lockfile": "node scripts/lint-lockfile.mjs",
|
"lint:lockfile": "node scripts/lint-lockfile.mjs",
|
||||||
"format": "prettier --write .",
|
"format": "prettier --write .",
|
||||||
"format:check": "prettier --check .",
|
"format:check": "prettier --check .",
|
||||||
@@ -64,6 +66,7 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"husky": "9.1.7",
|
"husky": "9.1.7",
|
||||||
"lint-staged": "16.2.7",
|
"lint-staged": "16.2.7",
|
||||||
"prettier": "3.7.4"
|
"prettier": "3.7.4",
|
||||||
|
"vitest": "4.0.16"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
16
vitest.config.ts
Normal file
16
vitest.config.ts
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
import { defineConfig } from 'vitest/config';
|
||||||
|
|
||||||
|
export default defineConfig({
|
||||||
|
test: {
|
||||||
|
// Use projects instead of deprecated workspace
|
||||||
|
projects: [
|
||||||
|
'libs/utils',
|
||||||
|
'libs/platform',
|
||||||
|
'libs/prompts',
|
||||||
|
'libs/model-resolver',
|
||||||
|
'libs/dependency-resolver',
|
||||||
|
'libs/git-utils',
|
||||||
|
'apps/server',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
});
|
||||||
Reference in New Issue
Block a user