From 379dd52c7f8f2dfa9b5d55696d347c374e5bf504 Mon Sep 17 00:00:00 2001 From: larssand Date: Tue, 10 Nov 2026 16:05:53 +0100 Subject: [PATCH] fix(guide): escape quotes that broke app.js; add a syntax check for src/ (1.89.1) --- CHANGELOG.md | 4 ++++ package-lock.json | 4 ++-- package.json | 2 +- src/app.js | 4 ++-- tests/frontend_syntax.test.js | 23 +++++++++++++++++++++++ tests/run.js | 1 + 6 files changed, 33 insertions(+), 5 deletions(-) create mode 100644 tests/frontend_syntax.test.js diff --git a/CHANGELOG.md b/CHANGELOG.md index 8a5e0cc..f55e7d7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,10 @@ The application version is maintained in `package.json` and displayed in the adm No changes recorded yet. +## 1.89.1 + +- Fix: the app loaded as a blank page after 1.89.0 (a quote in a guide text broke app.js). A new test checks that every file in src/ parses. + ## 1.89.0 - Day autopilot: when qualifying is done for a class but its finals are not created yet, the status says "Waiting: check qualifying and press 🏁 Create finals for " instead of "every heat has been run". Finals are still never created automatically. diff --git a/package-lock.json b/package-lock.json index 21a493a..4193a3c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "rc-racecore", - "version": "1.89.0", + "version": "1.89.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "rc-racecore", - "version": "1.89.0", + "version": "1.89.1", "hasInstallScript": true, "dependencies": { "better-sqlite3": "^12.11.1", diff --git a/package.json b/package.json index 5272ddb..244f6b5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rc-racecore", - "version": "1.89.0", + "version": "1.89.1", "private": true, "description": "RC RaceCore live timing and race control with AMMC ingest and SQLite persistence", "engines": { diff --git a/src/app.js b/src/app.js index ce9e587..7a1053c 100644 --- a/src/app.js +++ b/src/app.js @@ -2357,7 +2357,7 @@ const TRANSLATIONS = { "guide.day_flow_5": "5. Kvalet skapas direkt som riktiga heat (Q1 H1, Q1 H2 
) enligt Förare per kvalheat och Antal kvalrundor. Antal varv, tider och starttyp kan finjusteras under Hantera → Raceformat.", "guide.day_flow_6": "6. NĂ€r practice Ă€r kört: Hantera → Skapa kval frĂ„n practice. Kvalheaten byggs dĂ„ om efter practice-resultatet och ersĂ€tter de gamla, sĂ„ inga dubbletter uppstĂ„r. Hoppar du över det körs kvalet i deltagarlistans ordning.", "guide.day_flow_7": "7. Kör kvalet pĂ„ Race Day. Flest varv vinner och vid lika antal varv vinner lĂ€gst total tid. Vill du sortera om kommande heat efter aktuell ranking: Reseeda kommande kval.", - "guide.day_flow_8": "8. NĂ€r alla kval Ă€r körda: tryck 🏁 Alla kval Ă€r körda – skapa finaler pĂ„ Race Day (eller Hantera → Format → Skapa finaler frĂ„n kval). Korrigera kvalet först om det behövs; finalerna skapas aldrig automatiskt, och med ▶ Kör dagen automatiskt vĂ€ntar den med texten "Skapa finaler för 
" och klassernas namn. A-, B- och C-finaler byggs enligt Förare per final, antal finalheat och rĂ€knade finalheat.", + "guide.day_flow_8": "8. NĂ€r alla kval Ă€r körda: tryck 🏁 Alla kval Ă€r körda – skapa finaler pĂ„ Race Day (eller Hantera → Format → Skapa finaler frĂ„n kval). Korrigera kvalet först om det behövs; finalerna skapas aldrig automatiskt, och med ▶ Kör dagen automatiskt vĂ€ntar den med texten \"Skapa finaler för 
\" och klassernas namn. A-, B- och C-finaler byggs enligt Förare per final, antal finalheat och rĂ€knade finalheat.", "guide.day_flow_9": "9. Kör finalerna, lĂ€gsta finalen först. Vid gridstart rĂ€knar speakern ner 10 
 3, sĂ€ger \"Start pĂ„ tonen\" och sedan kommer tonen. Med bump-ups: Applicera bump-ups nĂ€r en lĂ€gre final Ă€r klar. Dagens schema pĂ„ Race Day lĂ€gger alla klasser i en körordning med tider.", "guide.race_wizard_title": "Create Race Wizard", "guide.race_wizard_1": "1. Börja i Race Setup och anvĂ€nd wizarden nĂ€r du skapar ett nytt race, i stĂ€llet för att bygga allt direkt i Hantera.", @@ -4617,7 +4617,7 @@ const TRANSLATIONS = { "guide.day_flow_5": "5. Qualifying is created straight away as real heats (Q1 H1, Q1 H2 
) by Drivers per qualifying heat and Qualifying rounds. Laps, times and start type can be fine-tuned under Manage → Race format.", "guide.day_flow_6": "6. When practice has run: Manage → Generate qualifying from practice. The heats are rebuilt from the practice result and replace the old ones, so nothing is duplicated. Skip it and qualifying runs in entry-list order.", "guide.day_flow_7": "7. Run qualifying on Race Day. Most laps wins; on equal laps the lowest total time wins. To re-sort the coming heats by the current ranking: Reseed upcoming qualifying.", - "guide.day_flow_8": "8. When all qualifying has run: press 🏁 All qualifying run – create finals on Race Day (or Manage → Format → Create finals from qualifying). Correct qualifying first if needed; finals are never created automatically, and ▶ Run the day automatically waits, saying "Create finals for 
" with the class names. A, B and C finals are built by Drivers per final, final legs and counted legs.", + "guide.day_flow_8": "8. When all qualifying has run: press 🏁 All qualifying run – create finals on Race Day (or Manage → Format → Create finals from qualifying). Correct qualifying first if needed; finals are never created automatically, and ▶ Run the day automatically waits, saying \"Create finals for 
\" with the class names. A, B and C finals are built by Drivers per final, final legs and counted legs.", "guide.day_flow_9": "9. Run the finals, lowest final first. On a grid start the announcer counts 10 
 3, says \"Starting to the sound of the tone\" and the tone follows. With bump-ups: Apply bump-ups when a lower final is done. Today's schedule on Race Day puts every class in one running order with times.", "guide.race_wizard_title": "Create Race Wizard", "guide.race_wizard_1": "1. Start in Race Setup and use the wizard when creating a new race instead of building everything directly in Manage.", diff --git a/tests/frontend_syntax.test.js b/tests/frontend_syntax.test.js new file mode 100644 index 0000000..cd48694 --- /dev/null +++ b/tests/frontend_syntax.test.js @@ -0,0 +1,23 @@ +// Every browser file must parse: unit tests never load app.js, so a stray quote in a +// translation string would otherwise only show up as a blank page. +import test from "node:test"; +import assert from "node:assert/strict"; +import { spawnSync } from "node:child_process"; +import { copyFileSync, mkdtempSync, readdirSync, rmSync } from "node:fs"; +import { tmpdir } from "node:os"; +import { join } from "node:path"; + +test("every file in src/ parses as JavaScript", () => { + const src = new URL("../src/", import.meta.url).pathname; + const dir = mkdtempSync(join(tmpdir(), "rc-syntax-")); + try { + const bad = readdirSync(src).filter((name) => name.endsWith(".js")).filter((name) => { + const copy = join(dir, name.replace(/\.js$/, ".mjs")); + copyFileSync(join(src, name), copy); + return spawnSync(process.execPath, ["--check", copy], { encoding: "utf8" }).status !== 0; + }); + assert.deepEqual(bad, []); + } finally { + rmSync(dir, { recursive: true, force: true }); + } +}); diff --git a/tests/run.js b/tests/run.js index f49574d..772fb27 100644 --- a/tests/run.js +++ b/tests/run.js @@ -1,4 +1,5 @@ import "./auth.test.js"; +import "./frontend_syntax.test.js"; import "./backend_url.test.js"; import "./houseofrc_logic.test.js"; import "./stint_laps_view.test.js";