From eec422661b46aefacd87c75caafc125d4069ab7a Mon Sep 17 00:00:00 2001 From: Shane Maynard Date: Thu, 30 Jul 2026 16:06:18 -0400 Subject: [PATCH] Version static app assets for CDN releases --- public/account.html | 4 ++-- public/admin.html | 4 ++-- public/cupping.html | 4 ++-- public/forgot.html | 4 ++-- public/index.html | 4 ++-- public/inventory.html | 4 ++-- public/js/account.js | 6 +++--- public/js/admin.js | 6 +++--- public/js/cupping.js | 10 +++++----- public/js/inventory.js | 6 +++--- public/js/lot-picker.js | 4 ++-- public/js/main.js | 26 +++++++++++++------------- public/landing.html | 2 +- public/login.html | 4 ++-- public/reset.html | 4 ++-- public/setup.html | 4 ++-- public/signup.html | 4 ++-- public/sw.js | 40 ++++++++++++++++++++-------------------- shared/curve.js | 2 +- shared/ledger.js | 4 ++-- shared/reference-data.js | 2 +- test/auth.test.js | 2 +- 22 files changed, 75 insertions(+), 75 deletions(-) diff --git a/public/account.html b/public/account.html index 64ac523..aabbc8b 100644 --- a/public/account.html +++ b/public/account.html @@ -4,7 +4,7 @@ Account — Roast Planner - + @@ -254,6 +254,6 @@ - + diff --git a/public/admin.html b/public/admin.html index a13c92b..5ba958b 100644 --- a/public/admin.html +++ b/public/admin.html @@ -4,7 +4,7 @@ Admin — Roast Planner - + @@ -197,6 +197,6 @@ - + diff --git a/public/cupping.html b/public/cupping.html index b704027..d396298 100644 --- a/public/cupping.html +++ b/public/cupping.html @@ -4,7 +4,7 @@ Cupping — Roast Planner - + @@ -260,6 +260,6 @@ document.getElementById("cupping-session-view").classList.remove("hidden"); } - + diff --git a/public/forgot.html b/public/forgot.html index c3f0944..8ea65e3 100644 --- a/public/forgot.html +++ b/public/forgot.html @@ -4,7 +4,7 @@ Reset your password — Roast Planner - + @@ -38,6 +38,6 @@ - + diff --git a/public/index.html b/public/index.html index f654844..d6567c7 100644 --- a/public/index.html +++ b/public/index.html @@ -11,7 +11,7 @@ - +
@@ -2492,6 +2492,6 @@ - + diff --git a/public/inventory.html b/public/inventory.html index e883945..f4bdd1d 100644 --- a/public/inventory.html +++ b/public/inventory.html @@ -4,7 +4,7 @@ Inventory — Roast Planner - + @@ -217,6 +217,6 @@
- + diff --git a/public/js/account.js b/public/js/account.js index e2427a4..974953f 100644 --- a/public/js/account.js +++ b/public/js/account.js @@ -1,6 +1,6 @@ -import { api, protectedFetch } from "./api.js"; -import { initSideNav, loadNavUser } from "./nav.js"; -import { showToast } from "./toast.js"; +import { api, protectedFetch } from "./api.js?v=20260730-release2"; +import { initSideNav, loadNavUser } from "./nav.js?v=20260730-release2"; +import { showToast } from "./toast.js?v=20260730-release2"; function fmtDate(value) { return value ? new Date(value).toLocaleString() : "—"; diff --git a/public/js/admin.js b/public/js/admin.js index 197b5e4..7541517 100644 --- a/public/js/admin.js +++ b/public/js/admin.js @@ -1,6 +1,6 @@ -import { api, protectedFetch } from "./api.js"; -import { initSideNav, loadNavUser } from "./nav.js"; -import { showToast } from "./toast.js"; +import { api, protectedFetch } from "./api.js?v=20260730-release2"; +import { initSideNav, loadNavUser } from "./nav.js?v=20260730-release2"; +import { showToast } from "./toast.js?v=20260730-release2"; let currentUsers = []; let planFilterUserId = null; diff --git a/public/js/cupping.js b/public/js/cupping.js index d34b8b7..05c34b8 100644 --- a/public/js/cupping.js +++ b/public/js/cupping.js @@ -1,7 +1,7 @@ -import { api, protectedFetch } from "./api.js"; -import { initSideNav, loadNavUser } from "./nav.js"; -import { showToast } from "./toast.js"; -import { wireWhyPanels } from "./why-panels.js"; +import { api, protectedFetch } from "./api.js?v=20260730-release2"; +import { initSideNav, loadNavUser } from "./nav.js?v=20260730-release2"; +import { showToast } from "./toast.js?v=20260730-release2"; +import { wireWhyPanels } from "./why-panels.js?v=20260730-release2"; import { SCORE_ATTRS, SCORE_LABELS, @@ -11,7 +11,7 @@ import { MAX_FLAVOR_TAGS, MAX_CUP_COUNT, computeTotalScore, -} from "/shared/cupping.js"; +} from "/shared/cupping.js?v=20260730-release2"; const sessionId = new URLSearchParams(location.search).get("session"); diff --git a/public/js/inventory.js b/public/js/inventory.js index 4d6a1fa..0a17bed 100644 --- a/public/js/inventory.js +++ b/public/js/inventory.js @@ -1,6 +1,6 @@ -import { api, protectedFetch } from "./api.js"; -import { initSideNav, loadNavUser } from "./nav.js"; -import { showToast } from "./toast.js"; +import { api, protectedFetch } from "./api.js?v=20260730-release2"; +import { initSideNav, loadNavUser } from "./nav.js?v=20260730-release2"; +import { showToast } from "./toast.js?v=20260730-release2"; let lots = []; let showArchived = false; diff --git a/public/js/lot-picker.js b/public/js/lot-picker.js index 83b5a5a..028e88a 100644 --- a/public/js/lot-picker.js +++ b/public/js/lot-picker.js @@ -1,5 +1,5 @@ -import { api, protectedFetch } from "./api.js"; -import { showToast } from "./toast.js"; +import { api, protectedFetch } from "./api.js?v=20260730-release2"; +import { showToast } from "./toast.js?v=20260730-release2"; let lots = []; diff --git a/public/js/main.js b/public/js/main.js index 402dd56..f1cc6c4 100644 --- a/public/js/main.js +++ b/public/js/main.js @@ -1,19 +1,19 @@ -import { FIELD_IDS, blankPlan } from "/shared/fields.js"; -import { computeLedger } from "/shared/ledger.js"; +import { FIELD_IDS, blankPlan } from "/shared/fields.js?v=20260730-release2"; +import { computeLedger } from "/shared/ledger.js?v=20260730-release2"; import { formatDuration, formatSigned, parseRangeMidpoint, -} from "/shared/time.js"; -import { CULTIVARS, findCultivar } from "/shared/reference-data.js"; -import { buildPlanCurve, pointsToPathD, tToX, tempToY } from "/shared/curve.js"; -import { initPrefillPanel } from "./prefill-ui.js"; -import { initAlogPanel } from "./alog-ui.js"; -import { initPrint } from "./print.js"; -import { initLotPicker } from "./lot-picker.js"; -import { protectedFetch, csrfToken } from "./api.js"; -import { initSideNav } from "./nav.js"; -import { wireWhyPanels } from "./why-panels.js"; +} from "/shared/time.js?v=20260730-release2"; +import { CULTIVARS, findCultivar } from "/shared/reference-data.js?v=20260730-release2"; +import { buildPlanCurve, pointsToPathD, tToX, tempToY } from "/shared/curve.js?v=20260730-release2"; +import { initPrefillPanel } from "./prefill-ui.js?v=20260730-release2"; +import { initAlogPanel } from "./alog-ui.js?v=20260730-release2"; +import { initPrint } from "./print.js?v=20260730-release2"; +import { initLotPicker } from "./lot-picker.js?v=20260730-release2"; +import { protectedFetch, csrfToken } from "./api.js?v=20260730-release2"; +import { initSideNav } from "./nav.js?v=20260730-release2"; +import { wireWhyPanels } from "./why-panels.js?v=20260730-release2"; const FIELD_ID_SET = new Set(FIELD_IDS); const STORAGE_PREFIX = "roastPlannerPlan.v2"; @@ -903,7 +903,7 @@ function wirePwa() { const hadController = !!navigator.serviceWorker.controller; window.addEventListener("load", () => { navigator.serviceWorker - .register("/sw.js") + .register("/sw.js?v=20260730-release2") .then((registration) => { const showUpdate = () => document.getElementById("btn-refresh").classList.remove("hidden"); diff --git a/public/landing.html b/public/landing.html index a89ab83..6045270 100644 --- a/public/landing.html +++ b/public/landing.html @@ -8,7 +8,7 @@ name="description" content="A structured worksheet that computes first crack, development, and drop from your bean — then keeps the plan next to what actually happened." /> - + diff --git a/public/login.html b/public/login.html index c28fa9c..7bd9154 100644 --- a/public/login.html +++ b/public/login.html @@ -4,7 +4,7 @@ Log in — Roast Planner - + @@ -44,6 +44,6 @@ - + diff --git a/public/reset.html b/public/reset.html index e8b3943..7698575 100644 --- a/public/reset.html +++ b/public/reset.html @@ -4,7 +4,7 @@ Set a new password — Roast Planner - + @@ -46,6 +46,6 @@ - + diff --git a/public/setup.html b/public/setup.html index 967cf52..e55a058 100644 --- a/public/setup.html +++ b/public/setup.html @@ -4,7 +4,7 @@ Administrator setup — Roast Planner - + @@ -58,6 +58,6 @@ - + diff --git a/public/signup.html b/public/signup.html index 94e21fe..042ffc5 100644 --- a/public/signup.html +++ b/public/signup.html @@ -4,7 +4,7 @@ Create an account — Roast Planner - + @@ -55,6 +55,6 @@ - + diff --git a/public/sw.js b/public/sw.js index f379012..597415e 100644 --- a/public/sw.js +++ b/public/sw.js @@ -1,4 +1,4 @@ -const CACHE_NAME = "roast-planner-static-v7"; +const CACHE_NAME = "roast-planner-static-v8"; // Only /app is precached as a navigable page: it is a data-free authenticated shell (draft // data lives only in account-scoped local storage, and logout clears that namespace), so it is // the one page that is both safe and useful to relaunch offline. The marketing page, auth @@ -7,25 +7,25 @@ const CACHE_NAME = "roast-planner-static-v7"; // stale content. const APP_SHELL = [ "/app", - "/app.css?v=20260730-5ef8274", - "/worksheet.css", - "/manifest.webmanifest", - "/icon.svg", - "/js/main.js", - "/js/api.js", - "/js/nav.js", - "/js/toast.js", - "/js/why-panels.js", - "/js/lot-picker.js", - "/js/prefill-ui.js", - "/js/alog-ui.js", - "/js/print.js", - "/shared/fields.js", - "/shared/ledger.js", - "/shared/time.js", - "/shared/reference-data.js", - "/shared/curve.js", - "/shared/cupping.js", + "/app.css?v=20260730-release2", + "/worksheet.css?v=20260730-release2", + "/manifest.webmanifest?v=20260730-release2", + "/icon.svg?v=20260730-release2", + "/js/main.js?v=20260730-release2", + "/js/api.js?v=20260730-release2", + "/js/nav.js?v=20260730-release2", + "/js/toast.js?v=20260730-release2", + "/js/why-panels.js?v=20260730-release2", + "/js/lot-picker.js?v=20260730-release2", + "/js/prefill-ui.js?v=20260730-release2", + "/js/alog-ui.js?v=20260730-release2", + "/js/print.js?v=20260730-release2", + "/shared/fields.js?v=20260730-release2", + "/shared/ledger.js?v=20260730-release2", + "/shared/time.js?v=20260730-release2", + "/shared/reference-data.js?v=20260730-release2", + "/shared/curve.js?v=20260730-release2", + "/shared/cupping.js?v=20260730-release2", ]; self.addEventListener("install", (event) => { diff --git a/shared/curve.js b/shared/curve.js index c3eaf48..ad685e7 100644 --- a/shared/curve.js +++ b/shared/curve.js @@ -1,7 +1,7 @@ // Browser-safe. Geometry for the roast-curve SVG grid (viewBox 0 0 714 334), matching // manual-roast-planner.html's worksheet box 10 grid exactly. -import { MACHINE } from "./reference-data.js"; +import { MACHINE } from "./reference-data.js?v=20260730-release2"; export const PLOT = { x0: 52, x1: 652, y0: 24, y1: 294, tMaxS: 900 }; diff --git a/shared/ledger.js b/shared/ledger.js index a2301ff..d33234b 100644 --- a/shared/ledger.js +++ b/shared/ledger.js @@ -2,8 +2,8 @@ // Mirrors manual-roast-planner.html's worksheet box 6 (lines 1-9, totals A/C/D) // and box 7 (the four sanity checks) exactly. Imported by both server and browser. -import { parseDuration, parseRangeMidpoint } from "./time.js"; -import { YELLOW_RATIO, SANITY_BANDS } from "./reference-data.js"; +import { parseDuration, parseRangeMidpoint } from "./time.js?v=20260730-release2"; +import { YELLOW_RATIO, SANITY_BANDS } from "./reference-data.js?v=20260730-release2"; /** * @param {import("./fields.js").Plan} plan diff --git a/shared/reference-data.js b/shared/reference-data.js index 956d149..a38a865 100644 --- a/shared/reference-data.js +++ b/shared/reference-data.js @@ -2,7 +2,7 @@ // (Step 1 cultivar table, Step 3 processing table, Step 4 roast-level table, Step 8 machine bands, // Step 7 sanity bands). Keep this the single source of truth — don't retype these numbers elsewhere. -import { parseRangeMidpoint } from "./time.js"; +import { parseRangeMidpoint } from "./time.js?v=20260730-release2"; export const YELLOW_RATIO = 0.56; const DEFAULT_DEV_THIRD_S = 90; // "1:30", the modal third-profile-number most cultivar rows share diff --git a/test/auth.test.js b/test/auth.test.js index ae8a54d..17beff4 100644 --- a/test/auth.test.js +++ b/test/auth.test.js @@ -25,7 +25,7 @@ test("strict CSP/static modules, no-store data, auth lifecycle, and ownership sh assert.equal(login.status, 200); assert.match( login.text, - /