Skip to content

Commit 93aa1fc

Browse files
committed
refactor: vitest monorepo setup
1 parent ee08b43 commit 93aa1fc

26 files changed

+217
-242
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@apitree.cz/prettier-config': patch
3+
---
4+
5+
fix: use import.meta.resolve for ESM plugin resolution

.changeset/readme-updates.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
'@apitree.cz/eslint-config': patch
3+
'@apitree.cz/prettier-config': patch
4+
'@apitree.cz/ts-config': patch
5+
'@apitree.cz/vitest-config': patch
6+
---
7+
8+
docs: update README files with improved documentation
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
'apitree.cz-toolbox': patch
3+
'@apitree.cz/eslint-config': patch
4+
'@apitree.cz/testing-library': patch
5+
'@apitree.cz/vitest-config': patch
6+
---
7+
8+
feat: implement Vitest monorepo setup with project-based configuration
9+
10+
- Added root vitest.config.ts with Vitest Projects support
11+
- Converted package-level vitest.config.ts to vitest.config.js using defineProject
12+
- Updated ESLint config to recognize vitest.config.js (previously .ts)
13+
- Moved vitest dependencies to root (vitest, @vitest/coverage-v8, @vitest/ui)
14+
- Made @vitest/coverage-v8 an optional peer dependency in vitest-config
15+
- Removed internal test suite from eslint-config package
16+
- Updated root lint and format scripts to include .ts files
17+
- Added test:ui script for interactive Vitest UI

package.json

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@
2222
"fix:root": "run-p ts format:root:fix lint:root:fix",
2323
"format": "turbo run format format:root --no-daemon --parallel",
2424
"format:fix": "turbo run format:fix format:root:fix --no-daemon --parallel",
25-
"format:root": "prettier --ignore-path .prettierignore --check \"./*.{js,json,md,yaml}\" \".changeset/**/*.md\" \".claude/**/*.{json,md}\" \".github/**/*.{js,json,md,yml,yaml}\"",
25+
"format:root": "prettier --ignore-path .prettierignore --check \"./*.{js,json,md,ts,yaml}\" \".changeset/**/*.md\" \".claude/**/*.{json,md}\" \".github/**/*.{js,json,md,yml,yaml}\"",
2626
"format:root:fix": "pnpm run format:root --write",
2727
"postinstall": "is-ci || run-s postinstall:check postinstall:husky postinstall:cli postinstall:sync",
2828
"lint": "turbo run lint lint:root --no-daemon",
2929
"lint:fix": "turbo run lint:fix lint:root:fix --no-daemon",
30-
"lint:root": "eslint --cache ./*.js",
30+
"lint:root": "eslint --cache \"./*.js\" \"./*.ts\"",
3131
"lint:root:fix": "pnpm run lint:root --fix",
3232
"postinstall:check": "manypkg check",
3333
"postinstall:cli": "turbo build --filter=\"./packages/cli\"",
@@ -39,6 +39,7 @@
3939
"sync-project-references": "apitree sync-project-references",
4040
"test": "turbo run test --no-daemon",
4141
"test:coverage": "turbo run test:coverage --no-daemon",
42+
"test:ui": "vitest --ui",
4243
"ts": "turbo run ts ts:root --no-daemon",
4344
"ts:root": "tsc --project tsconfig.json"
4445
},
@@ -53,11 +54,14 @@
5354
"@apitree.cz/prettier-config": "workspace:*",
5455
"@apitree.cz/ts-config": "workspace:*",
5556
"@apitree.cz/typedoc-config": "workspace:*",
57+
"@apitree.cz/vitest-config": "^0.8.4",
5658
"@changesets/cli": "^2.29.8",
5759
"@commitlint/cli": "^20.2.0",
5860
"@commitlint/config-conventional": "^20.2.0",
5961
"@manypkg/cli": "^0.25.1",
6062
"@types/node": "^24.10.3",
63+
"@vitest/coverage-v8": "^4.0.15",
64+
"@vitest/ui": "^4.0.15",
6165
"del-cli": "^7.0.0",
6266
"eslint": "^9.39.1",
6367
"husky": "^9.1.7",
@@ -66,7 +70,8 @@
6670
"prettier": "^3.7.4",
6771
"turbo": "^2.6.3",
6872
"typedoc": "^0.28.15",
69-
"typescript": "^5.9.3"
73+
"typescript": "^5.9.3",
74+
"vitest": "^4.0.15"
7075
},
7176
"packageManager": "[email protected]",
7277
"engines": {

packages/eslint-config/README.md

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,7 @@
1818
pnpm add --save-dev @apitree.cz/eslint-config eslint
1919
```
2020

21-
### PNPM Monorepos
22-
23-
Prior to the installation, add the following to your repository root `pnpm-workspace.yaml`:
24-
25-
```yaml
26-
publicHoistPattern:
27-
- '*eslint*'
28-
```
21+
### Monorepos
2922

3023
Install and use the package in the root only.
3124

packages/eslint-config/package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,10 @@
8484
"typescript-eslint": "^8.49.0"
8585
},
8686
"devDependencies": {
87-
"@apitree.cz/vitest-config": "workspace:*",
8887
"eslint": "^9.39.1",
8988
"react": "^19.2.3",
9089
"storybook": "^10.1.7",
91-
"typescript": "^5.9.3",
92-
"vitest": "^4.0.15"
90+
"typescript": "^5.9.3"
9391
},
9492
"peerDependencies": {
9593
"eslint": "^9.39.0",

packages/eslint-config/src/base/config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export const config = defineConfig(
4949
parserOptions: {
5050
ecmaVersion: 'latest',
5151
projectService: {
52-
allowDefaultProject: ['lint-staged.config.js', 'typedoc.config.js', 'vitest.config.ts'],
52+
allowDefaultProject: ['lint-staged.config.js', 'typedoc.config.js', 'vitest.config.js'],
5353
},
5454
tsconfigRootDir: process.cwd(),
5555
sourceType: 'module',
@@ -100,7 +100,7 @@ export const config = defineConfig(
100100
rules: rules.dts,
101101
},
102102
{
103-
files: ['**/lint-staged.config.js', '**/typedoc.config.js'],
103+
files: ['**/lint-staged.config.js', '**/typedoc.config.js', '**/vitest.config.js'],
104104
rules: rules.monorepo,
105105
},
106106
prettier,

packages/eslint-config/tests/base/common.test.ts

Lines changed: 0 additions & 50 deletions
This file was deleted.

packages/eslint-config/tests/make-test-rule.ts

Lines changed: 0 additions & 72 deletions
This file was deleted.

packages/eslint-config/tests/react/common.test.ts

Lines changed: 0 additions & 43 deletions
This file was deleted.

0 commit comments

Comments
 (0)