build(frontend): add Vitest setup and update Angular/TypeScript config

This commit is contained in:
Andras Schmelczer 2026-05-31 10:49:26 +01:00
parent 5a364ce638
commit 757cae5dcf
6 changed files with 22 additions and 29 deletions

View file

@ -5,9 +5,9 @@
"packageManager": "npm",
"schematicCollections": [
"angular-eslint"
]
],
"analytics": false
},
"newProjectRoot": "projects",
"projects": {
"frontend": {
"projectType": "application",
@ -76,9 +76,6 @@
"proxyConfig": "proxy.conf.json"
}
},
"test": {
"builder": "@angular/build:unit-test"
},
"lint": {
"builder": "@angular-eslint/builder:lint",
"options": {
@ -91,4 +88,4 @@
}
}
}
}
}

View file

@ -14,8 +14,8 @@
"@angular/core": "^21.2.0",
"@angular/forms": "^21.2.0",
"@angular/platform-browser": "^21.2.0",
"@angular/router": "^21.2.0",
"@angular/service-worker": "^21.2.0",
"@plausible-analytics/tracker": "^0.4.5",
"rxjs": "~7.8.0",
"tslib": "^2.3.0"
},
@ -718,24 +718,6 @@
}
}
},
"node_modules/@angular/router": {
"version": "21.2.14",
"resolved": "https://registry.npmjs.org/@angular/router/-/router-21.2.14.tgz",
"integrity": "sha512-Yo3LdgcqkfMu2/Ycl8o/4QjCBqZhtA+a7B8JVdW5cWdrpFTxKCOrzm+YRUMuIFmH5nzSv9oGnUuz64uk1+7r5Q==",
"license": "MIT",
"dependencies": {
"tslib": "^2.3.0"
},
"engines": {
"node": "^20.19.0 || ^22.12.0 || >=24.0.0"
},
"peerDependencies": {
"@angular/common": "21.2.14",
"@angular/core": "21.2.14",
"@angular/platform-browser": "21.2.14",
"rxjs": "^6.5.3 || ^7.4.0"
}
},
"node_modules/@angular/service-worker": {
"version": "21.2.14",
"resolved": "https://registry.npmjs.org/@angular/service-worker/-/service-worker-21.2.14.tgz",
@ -3519,6 +3501,12 @@
"license": "MIT",
"optional": true
},
"node_modules/@plausible-analytics/tracker": {
"version": "0.4.5",
"resolved": "https://registry.npmjs.org/@plausible-analytics/tracker/-/tracker-0.4.5.tgz",
"integrity": "sha512-6BfAGejXY+YA3Cw6LYT2Zpn4hTxDtPQAawFsYUsQCOg78wIS5C4deAGXTfJffa5VleMWITv5lpJ/EYuQBl1tPA==",
"license": "MIT"
},
"node_modules/@playwright/test": {
"version": "1.60.0",
"resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.60.0.tgz",

View file

@ -15,12 +15,12 @@
"packageManager": "npm@10.9.2",
"dependencies": {
"@angular/cdk": "^21.2.13",
"@plausible-analytics/tracker": "^0.4.5",
"@angular/common": "^21.2.0",
"@angular/compiler": "^21.2.0",
"@angular/core": "^21.2.0",
"@angular/forms": "^21.2.0",
"@angular/platform-browser": "^21.2.0",
"@angular/router": "^21.2.0",
"@angular/service-worker": "^21.2.0",
"rxjs": "~7.8.0",
"tslib": "^2.3.0"

View file

@ -10,6 +10,6 @@
"src/**/*.ts"
],
"exclude": [
"src/**/*.spec.ts"
"src/**/*.vitest.ts"
]
}

View file

@ -10,6 +10,6 @@
},
"include": [
"src/**/*.d.ts",
"src/**/*.spec.ts"
"src/**/*.vitest.ts"
]
}

View file

@ -1,10 +1,18 @@
import { defineConfig } from 'vitest/config';
export default defineConfig({
resolve: {
alias: {
// The package ships only a `module` field, which Vite's resolver
// can't always find — point it at the file directly.
'@plausible-analytics/tracker':
'@plausible-analytics/tracker/plausible.js',
},
},
test: {
globals: true,
environment: 'jsdom',
include: ['src/**/*.vitest.ts', 'src/**/*.spec.vitest.ts'],
include: ['src/**/*.vitest.ts'],
setupFiles: ['./vitest.setup.ts'],
coverage: {
provider: 'v8',