Dead code, each checked for callers first: - graph::ReverseDeps::leaves (only its own test called it), health::run::sink_for (no caller, and a doc describing something else), SnapshotProof::id and is_waived (no caller). - Two whitespace collapsers become one, errors::catalog::collapse_whitespace; the classifier's normalize is that plus lowercase. Three hand-folded SHA-256 hex digests become model::sha256_hex (build.rs keeps its own: a build script cannot use the crate it builds). - Six copies of asPdError become one, beside isPdError in ipc/errors.ts. - Thirteen strings no screen renders, from both catalogs (status.resolving/executing/ready, actions.confirm/browse/retry/openLogs, env.requiresPython/unusable, packages.updateSelectedSoon, health.notInstalled, settings.localeSystem/saved). - fixtures.rs is compiled only for tests and for xtask (feature `fixtures`), not into release. Half-wired, finished rather than deleted: engine_info had a typed wrapper and no caller, while ARCHITECTURE §7 promised a version beside each engine radio. Settings now shows it for the selected environment, and says "not found" for an engine that is not installed. Docs that described another project: core's "Phase 0" status, model.rs's specta, pip.rs's "lands in M1", snapshot.rs's "execute takes a Snapshot" (it takes a SnapshotProof), declared_source's doc stranded on validate_project, the pin validators' "character-class check" (they share pep440::is_version now), three health wrappers in ipc/index.ts each under another's doc, and three %LOCALAPPDATA% paths missing the data\ folder. Repo: production builds carry no source maps - Tauri embeds dist/ in the executable, so `sourcemap: true` shipped 2 MB of them to every user (X51). .gitignore covers insta's pending snapshots and a downloaded SHA256SUMS.txt. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
41 lines
1.4 KiB
TypeScript
41 lines
1.4 KiB
TypeScript
import { fileURLToPath, URL } from 'node:url'
|
|
|
|
import { defineConfig } from 'vitest/config'
|
|
import react from '@vitejs/plugin-react'
|
|
import tailwindcss from '@tailwindcss/vite'
|
|
|
|
// The frontend lives in ui/ per ARCHITECTURE §2, but package.json sits at the repo root so the
|
|
// ops-repo `reusable-web-react.yml` — which has no working-directory input — can run `npm ci` and
|
|
// `npm run build` unmodified. Hence root: './ui' with the bundle emitted to the repo-root dist/,
|
|
// which is that workflow's default dist-dir.
|
|
export default defineConfig({
|
|
root: './ui',
|
|
plugins: [react(), tailwindcss()],
|
|
resolve: {
|
|
alias: {
|
|
'@': fileURLToPath(new URL('./ui/src', import.meta.url)),
|
|
},
|
|
},
|
|
build: {
|
|
outDir: '../dist',
|
|
emptyOutDir: true,
|
|
// Tauri ships its own WebView2; there is no legacy browser to support.
|
|
target: 'esnext',
|
|
// No source maps: Tauri embeds dist/ in the executable, so `sourcemap: true` shipped 2 MB of
|
|
// them to every user, and nothing in a release build ever reads one (X51).
|
|
sourcemap: false,
|
|
},
|
|
server: {
|
|
port: 1420,
|
|
// Fail loudly rather than silently moving ports — tauri.conf.json pins devUrl to 1420.
|
|
strictPort: true,
|
|
},
|
|
test: {
|
|
environment: 'jsdom',
|
|
globals: true,
|
|
setupFiles: [fileURLToPath(new URL('./ui/src/test/setup.ts', import.meta.url))],
|
|
include: ['ui/src/**/*.test.{ts,tsx}'],
|
|
root: fileURLToPath(new URL('.', import.meta.url)),
|
|
},
|
|
})
|