- Scaffold via npm create vite@latest --template vue-ts (create-vue interactive prompts require manual selection; create-vite supports non-interactive flags) - Dependencies: vue-router (SPA routing, createWebHistory for clean URLs), pinia (centralised state management), vitest + @vue/test-utils + jsdom (unit testing with browser DOM simulation) - Dev tooling: eslint (v10 flat config) + eslint-plugin-vue + @vue/eslint-config-typescript + @vue/eslint-config-prettier (ESLint-Prettier integration via vueTsConfigs), prettier (semi: false, singleQuote, trailingComma: all), jiti (bridges ESLint with TypeScript config files) - vite.config.ts: dev server on port 3000, @ alias resolving to src/, vitest with jsdom environment - eslint.config.ts: defineConfigWithVueTs wraps tseslint.config with Vue SFC support (vue-eslint-parser, <script setup lang="ts">), vue/multi-word off - tsconfig.app.json: path alias @/* -> src/* for TypeScript module resolution - src/router/index.ts: single route mapping / to HomePage - src/pages/HomePage.vue: minimal <script setup lang="ts"> placeholder - src/main.ts: bootstraps app with Pinia plugin + Vue Router - src/App.vue: delegates rendering to <RouterView /> - src/__tests__/HomePage.spec.ts: smoke test verifying component mounts - Directory structure: src/stores/, src/api/, src/composables/ with .gitkeep placeholders matching AGENTS.md convention (PascalCase pages, camelCase stores/composables) - index.html: lang="sv", title BilHälsning (Swedish UI convention) - Cleaned up: HelloWorld.vue, style.css, template boilerplate SVGs/PNGs - Update AGENTS.md + CODING_GUIDELINES.md: .js extensions → .ts across all file naming examples (useXxx.ts, authStore.ts, orders.ts, client.ts) - Verification: npm run dev serves blank page on http://localhost:3000, npm run lint passes (0 errors, 0 warnings), npm test passes (1 test, 1 file)
38 lines
947 B
JSON
38 lines
947 B
JSON
{
|
|
"name": "frontend",
|
|
"private": true,
|
|
"version": "0.0.0",
|
|
"type": "module",
|
|
"scripts": {
|
|
"dev": "vite",
|
|
"build": "vue-tsc -b && vite build",
|
|
"preview": "vite preview",
|
|
"lint": "eslint src/ --fix",
|
|
"format": "prettier --write src/",
|
|
"test": "vitest run",
|
|
"test:watch": "vitest"
|
|
},
|
|
"dependencies": {
|
|
"pinia": "^3.0.4",
|
|
"vue": "^3.5.32",
|
|
"vue-router": "^5.0.6"
|
|
},
|
|
"devDependencies": {
|
|
"@rushstack/eslint-patch": "^1.16.1",
|
|
"@types/node": "^24.12.2",
|
|
"@vitejs/plugin-vue": "^6.0.6",
|
|
"@vue/eslint-config-prettier": "^10.2.0",
|
|
"@vue/eslint-config-typescript": "^14.7.0",
|
|
"@vue/test-utils": "^2.4.10",
|
|
"@vue/tsconfig": "^0.9.1",
|
|
"eslint": "^10.2.1",
|
|
"eslint-plugin-vue": "^10.9.0",
|
|
"jiti": "^2.6.1",
|
|
"jsdom": "^29.1.1",
|
|
"prettier": "^3.8.3",
|
|
"typescript": "~6.0.2",
|
|
"vite": "^8.0.10",
|
|
"vitest": "^4.1.5",
|
|
"vue-tsc": "^3.2.7"
|
|
}
|
|
}
|