Nouvelle app Vite/React independante (workspace apps/*), calquee sur apps/web : port 5174, sa propre image Docker (nginx statique), son propre domaine/deploiement. - AdminApiClient (VITE_ADMIN_API_URL, credentials: include) + ApiError. - AdminAuthContext / RequireAdmin : restaure la session admin via GET /admin/auth/me, garde de route (miroir de AuthContext/RequireAuth). - LoginPage (/login) : validation cliente via adminLoginSchema partage, erreurs traduites via ErrorMessageService. - AdminLayout : sidebar (Tableau de bord / Monitoring / Corrections) + deconnexion, rendu une fois autour du groupe RequireAdmin. - Pages Dashboard / Monitoring / Corrections en placeholder (remplies aux PR 3-5). - i18n fr (bloc admin.* + sous-ensemble errors.*), tokens _theme.scss copies de apps/web (extraction en package partage : suivi separe). - Dockerfile multi-stage (node build -> nginx:alpine) + nginx.conf (SPA fallback). Service admin-web dans docker-compose.yml (port ADMIN_WEB_PORT, VITE_ADMIN_API_URL en build arg). - Cypress : login.feature (KO -> message, OK -> dashboard) + admin-layout .cy.ts (redirection /login sans session, nav entre sections, logout). Job "Run admin-web E2E tests" ajoute a ci.yml. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
28 lines
1 KiB
TypeScript
28 lines
1 KiB
TypeScript
import { addCucumberPreprocessorPlugin } from "@badeball/cypress-cucumber-preprocessor";
|
|
import { createEsbuildPlugin } from "@badeball/cypress-cucumber-preprocessor/esbuild";
|
|
import createBundler from "@bahmutov/cypress-esbuild-preprocessor";
|
|
import { defineConfig } from "cypress";
|
|
|
|
// Disable GPU for headless/sandboxed environments where no GPU device is
|
|
// available — same helper as apps/web's cypress.config.ts.
|
|
function disableGpu(on: Cypress.PluginEvents) {
|
|
on("before:browser:launch", (browser, launchOptions) => {
|
|
if (browser.family === "chromium") {
|
|
launchOptions.args.push("--disable-gpu", "--no-sandbox");
|
|
}
|
|
return launchOptions;
|
|
});
|
|
}
|
|
|
|
export default defineConfig({
|
|
e2e: {
|
|
baseUrl: "http://localhost:5174",
|
|
specPattern: ["cypress/e2e/**/*.cy.ts", "cypress/e2e/**/*.feature"],
|
|
async setupNodeEvents(on, config) {
|
|
disableGpu(on);
|
|
await addCucumberPreprocessorPlugin(on, config);
|
|
on("file:preprocessor", createBundler({ plugins: [createEsbuildPlugin(config)] }));
|
|
return config;
|
|
},
|
|
},
|
|
});
|