mirror of
https://github.com/tiennm99/thptqg.git
synced 2026-10-11 03:13:48 +00:00
The pipeline is now Go outside web/. differential-parity.mjs becomes
assembler/internal/verify, reachable as `assemble verify A B`. The port fixed a
real weakness: the JavaScript hashed each row's fields joined bare, so a value
shifted across a column boundary produced the same digest. A test now pins that.
The hub still rendered "Phiên bản cũ của trang 2017" above a permanently empty
list — it split datasets on id.includes("old"), and both such datasets are gone.
The heading and the filter are removed. index.html titled every page "THPT QG
2017", including 2016 and the hub, because one file is copied to every route;
the static title is now neutral and the app sets the dataset's own.
Dead code removed: the isOld2/containsOld branches in the stats block, which
only 2017-old2 could ever reach; SUBJECT_LABELS, DATASET_IDS and the unread
`short` subject field; an unused vite.svg and a favicon link to a file that
never existed; two unused CSS rules and --shadow-sm; site.Paths.Root.
Corrected comments that were confidently wrong rather than merely stale: the
reader claimed to be row-streaming when both implementations decode the whole
workbook into memory first, and the fidelity oracle still spoke of 299 input
files when it covers 182. Candidate counts in the hub now derive from
datasets.json instead of being written a second time as prose.
plans/ is emptied. The parity report it held was cited by docs/data-pipeline.md,
so the evidence that the recovered foreign-language scores are real — not the
citation, the four arguments themselves — is now inline there.
Verified: 2017 rebuilt after the writer change hashes identically to the build
before it.
29 lines
1.4 KiB
JavaScript
29 lines
1.4 KiB
JavaScript
import { defineConfig } from "vite";
|
|
import react from "@vitejs/plugin-react";
|
|
|
|
// One build serves every page. The app resolves which dataset to show from the
|
|
// URL (src/router.js), so there are no per-dataset build variants.
|
|
//
|
|
// `base` is absolute, which is what lets the single emitted index.html work as
|
|
// an entry point at any depth: it references /thptqg/assets/... regardless of
|
|
// the directory it is served from. The deploy step copies it to each dataset
|
|
// path, so every URL is a real static file and no SPA 404-fallback is needed —
|
|
// and the existing ?q= deep links keep working, which that fallback would break.
|
|
//
|
|
// publicDir holds only the gzipped databases, staged there by the assembler
|
|
// (assembler/internal/databases). Nothing uncompressed is ever placed in it.
|
|
//
|
|
// It sits at the repository root rather than inside this workspace because
|
|
// parser writes it, so the path has to climb out of web/. Vite resolves
|
|
// publicDir against the project root, which is this directory.
|
|
//
|
|
// outDir is left at its default, so the build lands in web/dist and this
|
|
// workspace stays self-contained. The Pages artifact (_site) is assembled at
|
|
// the repository root by the assembler (assembler/internal/site), since that is
|
|
// where the deploy action uploads from.
|
|
export default defineConfig({
|
|
plugins: [react()],
|
|
base: "/thptqg/",
|
|
publicDir: "../.build/public",
|
|
});
|