59299d3c2b
- axios@^1.16 + pinia@^3.0 (--legacy-peer-deps). - api/client.ts: axios с withCredentials+withXSRFToken (Sanctum SPA auto-XSRF). ensureCsrfCookie() + extractValidationErrors/Message helpers. - api/auth.ts: типизированные login/register/me/logout с AuthUser interface. - stores/auth.ts: Pinia composition-store (user/loading/requires2fa + isAuthenticated computed + login/register/fetchMe/logout actions). logout() catch-swallow - UI всегда выходит локально. - LoginView/RegisterView: useAuthStore интеграция, real POST через store, errors из 422 на v-text-fields, redirect на /dashboard или /2fa, :loading на btn'ах. - Auth-guard в router.beforeEach: meta.requiresAuth на 10 routes (6 app + 4 admin), meta.guestOnly на login/register/forgot. При первом переходе fetchMe() restore-session. Unauth → /login?redirect=<original>. - / redirect → /dashboard (auth-guard перехватит если не залогинен). - Pinia в app.ts через app.use(createPinia()). - cspell-words.txt: мокаем. Vitest +10 (всего 139/139 за 10.11s): - auth-store 7 (initial state + login success/reject + register + fetchMe success/401 + logout swallow). - router 5 переписан (login.guestOnly + 6 protected + admin layout + 3 error без auth + unauth /dashboard → /login?redirect). - LoginView/RegisterView/router тесты получили createPinia в plugins. - vi.mock api/auth в router+auth-store specs. Регресс: lint+type+format OK; vitest 139/139; vite build (main app-chunk 105→153.64 KB +axios+pinia+auth gzipped 54.54 KB) 806ms; story:build 21/28 за 31.73s; Pest 61/61 за 5.86s. CLAUDE.md v1.32->v1.33, реестр Открытых_вопросов v1.41->v1.42. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
46 lines
1.6 KiB
JSON
46 lines
1.6 KiB
JSON
{
|
|
"$schema": "https://www.schemastore.org/package.json",
|
|
"private": true,
|
|
"type": "module",
|
|
"scripts": {
|
|
"build": "vite build",
|
|
"dev": "vite",
|
|
"lint:vue": "eslint \"resources/js/**/*.{ts,vue}\" \"tests/Frontend/**/*.ts\"",
|
|
"format": "prettier --write \"resources/js/**/*.{ts,vue,css}\" \"tests/Frontend/**/*.ts\"",
|
|
"format:check": "prettier --check \"resources/js/**/*.{ts,vue,css}\" \"tests/Frontend/**/*.ts\"",
|
|
"type-check": "vue-tsc --noEmit",
|
|
"test:vue": "vitest run",
|
|
"story": "histoire dev",
|
|
"story:build": "histoire build",
|
|
"story:preview": "histoire preview"
|
|
},
|
|
"devDependencies": {
|
|
"@eslint/js": "^10.0.1",
|
|
"@histoire/plugin-vue": "^1.0.0-beta.1",
|
|
"@vitejs/plugin-vue": "^6.0.6",
|
|
"@vitest/coverage-v8": "^4.1.5",
|
|
"@vue/eslint-config-typescript": "^14.7.0",
|
|
"@vue/test-utils": "^2.4.10",
|
|
"axios": "^1.16.0",
|
|
"concurrently": "^9.0.1",
|
|
"eslint": "^10.3.0",
|
|
"eslint-config-prettier": "^10.1.8",
|
|
"eslint-plugin-vue": "^10.9.1",
|
|
"histoire": "^1.0.0-beta.1",
|
|
"jsdom": "^29.1.1",
|
|
"laravel-vite-plugin": "^3.1",
|
|
"pinia": "^3.0.4",
|
|
"prettier": "^3.8.3",
|
|
"sass-embedded": "^1.99.0",
|
|
"typescript": "^6.0.3",
|
|
"vite": "^8.0.0",
|
|
"vite-plugin-vuetify": "^2.1.3",
|
|
"vitest": "^4.1.5",
|
|
"vue": "^3.5.34",
|
|
"vue-router": "^4.6.4",
|
|
"vue-tsc": "^3.2.8",
|
|
"vuedraggable": "^4.1.0",
|
|
"vuetify": "^3.12.5"
|
|
}
|
|
}
|