Replaces LICENSE (GPLv3 -> AGPLv3) and prepends `SPDX-License-Identifier: AGPL-3.0-or-later` to every source file across decnet/, decnet_web/, tests/, scripts/, and tools/. Rationale: closes the GPLv3 ASP loophole so any party operating a modified DECNET as a network service must offer their modified source. Personal copyright (Samuel Paschuan) + inbound=outbound contributions make a future unilateral relicense infeasible. - LICENSE: full AGPL-3.0 text (gnu.org/licenses/agpl-3.0.txt) - COPYRIGHT: project copyright notice - tools/add_spdx_headers.py: idempotent header injector (shebang- and PEP 263-aware) Touches 1565 source files (.py, .ts, .tsx, .js, .jsx, .css, .sh). No behavior change; comments only.
67 lines
2.3 KiB
TypeScript
67 lines
2.3 KiB
TypeScript
// SPDX-License-Identifier: AGPL-3.0-or-later
|
|
import { defineConfig } from 'vitest/config'
|
|
import react from '@vitejs/plugin-react'
|
|
|
|
// https://vite.dev/config/
|
|
export default defineConfig({
|
|
plugins: [react()],
|
|
test: {
|
|
environment: 'jsdom',
|
|
globals: true,
|
|
setupFiles: ['./src/test/setup.ts'],
|
|
css: false,
|
|
coverage: {
|
|
provider: 'v8',
|
|
reporter: ['text', 'html'],
|
|
include: ['src/**/*.{ts,tsx}'],
|
|
exclude: ['src/**/*.d.ts', 'src/test/**', 'src/main.tsx'],
|
|
// Baseline floors. Each refactor PR raises these; never lower.
|
|
// Phase 11 (MazeNET/Inspector split): Inspector.tsx (606 LOC)
|
|
// split into per-selection panels. Inspector/index.tsx is now
|
|
// a 175 LOC dispatcher; NodeInspector keeps the 7 form-state
|
|
// useStates that are node-only. 10 new dispatcher tests. Suite:
|
|
// 51 files, 259 tests, 25.68% lines / 21.43% branches.
|
|
thresholds: {
|
|
lines: 25,
|
|
functions: 22,
|
|
branches: 21,
|
|
statements: 24,
|
|
},
|
|
},
|
|
},
|
|
server: {
|
|
proxy: {
|
|
'/api': {
|
|
target: 'http://127.0.0.1:8000',
|
|
changeOrigin: true,
|
|
},
|
|
},
|
|
},
|
|
build: {
|
|
// Split heavy third-party libs into their own chunks so the main
|
|
// bundle stays small and the rarely-changing vendor code stays
|
|
// cacheable across deploys. Recharts + asciinema-player + lucide
|
|
// together made up most of the weight that was tripping the 500kB
|
|
// warning.
|
|
rollupOptions: {
|
|
output: {
|
|
manualChunks: (id: string) => {
|
|
if (!id.includes('node_modules')) return undefined
|
|
// d3-* ships alongside recharts as its plotting engine —
|
|
// grouping them keeps tree-shaken subsets together.
|
|
if (id.includes('recharts') || id.includes('/d3-')) return 'charts'
|
|
if (id.includes('asciinema-player')) return 'player'
|
|
if (id.includes('lucide-react')) return 'icons'
|
|
if (id.includes('react-router')) return 'router'
|
|
if (id.includes('react-dom')) return 'react-dom'
|
|
if (id.includes('/react/') || id.endsWith('/react')) return 'react'
|
|
return 'vendor'
|
|
},
|
|
},
|
|
},
|
|
// Legitimate ceiling for any single chunk after splitting; anything
|
|
// larger is a real bloat regression worth investigating.
|
|
chunkSizeWarningLimit: 600,
|
|
},
|
|
})
|