Wires the script step and preview server into the build
The build now moves inline scripts and fails on a violation. Lighthouse audits /404.html, because it refuses a page with a real 404 status. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -31,6 +31,12 @@ export default tseslint.config(
|
||||
globals: globals.browser,
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ['config/**/*.ts', 'e2e/**/*.ts', 'vitest.e2e.config.ts'],
|
||||
languageOptions: {
|
||||
globals: globals.node,
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ['*.{js,cjs}'],
|
||||
extends: [js.configs.recommended],
|
||||
|
||||
@@ -19,7 +19,7 @@ const indexedPaths = [
|
||||
'/contact',
|
||||
];
|
||||
const noindexPaths = ['/privacyverklaring'];
|
||||
const notFoundPath = '/bestaat-niet';
|
||||
const notFoundPath = '/404.html';
|
||||
|
||||
// Homepage mobiel voorlopig 0,8: de foto's zijn nog niet responsive en de
|
||||
// titel verschijnt pas na de JavaScript. Komt terug op 0,9 met responsive
|
||||
|
||||
+4
-3
@@ -6,8 +6,9 @@
|
||||
"packageManager": "pnpm@12.11.2",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "tsc && vite build",
|
||||
"preview": "vite preview",
|
||||
"build": "tsc && vite build && node config/externalizeInlineScripts.ts",
|
||||
"preview": "node config/previewServer.ts",
|
||||
"e2e": "vitest run --config vitest.e2e.config.ts",
|
||||
"postinstall": "chakra typegen ./src/theme.ts",
|
||||
"typegen": "chakra typegen ./src/theme.ts",
|
||||
"typegen:watch": "chakra typegen ./src/theme.ts --watch",
|
||||
@@ -19,7 +20,7 @@
|
||||
"audit:dev": "pnpm audit || echo Meldingen in ontwikkeltools blokkeren niet, zie NFR-SEC-05",
|
||||
"lighthouse": "lhci autorun && lhci autorun --config=lighthouserc.desktop.cjs",
|
||||
"server-config": "node config/writeServerConfig.ts",
|
||||
"check": "pnpm lint && pnpm format:check && pnpm test && pnpm build && pnpm audit:deps && pnpm audit:dev && pnpm lighthouse"
|
||||
"check": "pnpm lint && pnpm format:check && pnpm test && pnpm build && pnpm e2e && pnpm audit:deps && pnpm audit:dev && pnpm lighthouse"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@chakra-ui/cli": "^3.37.0",
|
||||
|
||||
@@ -642,5 +642,8 @@ describe('pagina-register', () => {
|
||||
.map(([path]) => path);
|
||||
expect(lighthouseConfig.indexedPaths).toEqual(indexed);
|
||||
expect(lighthouseConfig.noindexPaths).toEqual(noindex);
|
||||
// Lighthouse weigert een 404-pagina; de preview-server geeft het
|
||||
// bestand 404.html als bestandsverzoek met status 200 (BR-SRV-04)
|
||||
expect(lighthouseConfig.notFoundPath).toBe('/404.html');
|
||||
});
|
||||
});
|
||||
|
||||
+7
-1
@@ -24,5 +24,11 @@
|
||||
"erasableSyntaxOnly": true,
|
||||
"noFallthroughCasesInSwitch": true
|
||||
},
|
||||
"include": ["src", "config", "vite.config.ts"]
|
||||
"include": [
|
||||
"src",
|
||||
"config",
|
||||
"e2e",
|
||||
"vite.config.ts",
|
||||
"vitest.e2e.config.ts"
|
||||
]
|
||||
}
|
||||
|
||||
+3
-6
@@ -1,15 +1,11 @@
|
||||
/// <reference types="vitest/config" />
|
||||
import { defineConfig } from 'vite';
|
||||
import { configDefaults, defineConfig } from 'vitest/config';
|
||||
import react from '@vitejs/plugin-react';
|
||||
import { tanstackStart } from '@tanstack/react-start/plugin/vite';
|
||||
import { NOT_FOUND_FILE, NOT_FOUND_PATH } from './config/pageFiles.ts';
|
||||
import { securityHeaders } from './config/securityHeaders.ts';
|
||||
import sitemapPlugin from './config/sitemapPlugin.ts';
|
||||
import sitePages from './src/sitePages.ts';
|
||||
|
||||
// Tijdelijk hier; Stap 7 maakt config/pageFiles.ts, Stap 24 schakelt over
|
||||
const NOT_FOUND_PATH = '/404';
|
||||
const NOT_FOUND_FILE = '404.html';
|
||||
|
||||
// 100% dekking voor de pure functies (NFR-M-02); de rest wordt alleen gerapporteerd
|
||||
const fullCoverage = {
|
||||
statements: 100,
|
||||
@@ -74,6 +70,7 @@ export default defineConfig(({ mode }) => ({
|
||||
globalSetup: ['./config/testSeed.ts'],
|
||||
setupFiles: ['./src/test/setup.ts'],
|
||||
css: false,
|
||||
exclude: [...configDefaults.exclude, 'e2e/**'],
|
||||
coverage: {
|
||||
provider: 'v8',
|
||||
include: ['src/**/*.{ts,tsx}', 'config/**/*.ts'],
|
||||
|
||||
Reference in New Issue
Block a user