Monorepo Turborepo (pnpm workspaces) avec 3 packages :
- apps/web : SPA React 19 + Vite 8 + Tailwind v4 (CSS-first)
• TanStack Router (file-based, auto code-splitting), Query, Form
• Radix primitives bruts + CVA + clsx + tailwind-merge
• MSW pour mocker l'API tant qu'Adonis n'est pas branché
• Polices Bricolage Grotesque + Inter self-hostées via fontsource
• Tokens marque (rubis, cream, ink) exposés via @theme
• Primitives maison : Gem, Brand, Eyebrow, Button, Input, Field
• Route /login full flow : TanStack Form + Zod + mutation Query
- apps/api : Adonis 7 (kit api, scaffold via create-adonisjs)
• Auth access tokens (Bearer) — cf. ADR-017
• Tuyau core déjà câblé pour la génération de types
• Routes /api/v1/auth/{signup,login} + /api/v1/account/{profile,logout}
• Minimal — uniquement le pont front ↔ back
- packages/shared : types TS + schemas Zod + constantes
• Source unique de vérité partagée api ↔ web
• Domaines : User, Org, Auth, Client, Invoice, Plan
Tooling racine : Turbo, ESLint v9 flat, Prettier, husky, lint-staged.
CLAUDE.md et docs/decisions.md mis à jour avec ADR-014 à ADR-018
(stack, monorepo, PG existant, Bearer tokens, MinIO existant)
et le pointeur vers docs/tech/architecture.md.
Logo Rubis déplacé de landing/assets/ vers /assets/ (source unique
réutilisée par la landing et l'app).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
57 lines
1.7 KiB
TypeScript
57 lines
1.7 KiB
TypeScript
import { assert } from '@japa/assert'
|
|
import { apiClient } from '@japa/api-client'
|
|
import app from '@adonisjs/core/services/app'
|
|
import type { Config } from '@japa/runner/types'
|
|
import { pluginAdonisJS } from '@japa/plugin-adonisjs'
|
|
import { dbAssertions } from '@adonisjs/lucid/plugins/db'
|
|
import testUtils from '@adonisjs/core/services/test_utils'
|
|
import { authApiClient } from '@adonisjs/auth/plugins/api_client'
|
|
import { sessionApiClient } from '@adonisjs/session/plugins/api_client'
|
|
import type { Registry } from '../.adonisjs/client/registry/schema.d.ts'
|
|
|
|
/**
|
|
* This file is imported by the "bin/test.ts" entrypoint file
|
|
*/
|
|
declare module '@japa/api-client/types' {
|
|
interface RoutesRegistry extends Registry {}
|
|
}
|
|
|
|
/**
|
|
* This file is imported by the "bin/test.ts" entrypoint file
|
|
*/
|
|
|
|
/**
|
|
* Configure Japa plugins in the plugins array.
|
|
* Learn more - https://japa.dev/docs/runner-config#plugins-optional
|
|
*/
|
|
export const plugins: Config['plugins'] = [
|
|
assert(),
|
|
pluginAdonisJS(app),
|
|
dbAssertions(app),
|
|
apiClient(),
|
|
sessionApiClient(app),
|
|
authApiClient(app),
|
|
]
|
|
|
|
/**
|
|
* Configure lifecycle function to run before and after all the
|
|
* tests.
|
|
*
|
|
* The setup functions are executed before all the tests
|
|
* The teardown functions are executed after all the tests
|
|
*/
|
|
export const runnerHooks: Required<Pick<Config, 'setup' | 'teardown'>> = {
|
|
setup: [],
|
|
teardown: [],
|
|
}
|
|
|
|
/**
|
|
* Configure suites by tapping into the test suite instance.
|
|
* Learn more - https://japa.dev/docs/test-suites#lifecycle-hooks
|
|
*/
|
|
export const configureSuite: Config['configureSuite'] = (suite) => {
|
|
if (['browser', 'functional', 'e2e'].includes(suite.name)) {
|
|
return suite.setup(() => testUtils.httpServer().start())
|
|
}
|
|
}
|