From 3ab2cc20346aae74487adaa0ac85e034aebc2092 Mon Sep 17 00:00:00 2001 From: Morgan Roderick Date: Fri, 17 Jul 2026 14:07:19 +0200 Subject: [PATCH 1/2] feat: version static assets with deployed git SHA Replace the manual ?v=N cache buster on /static/auth-client.js with an automatic version derived from HEROKU_SLUG_COMMIT (set by Heroku at runtime). Falls back to SOURCE_VERSION, then 'dev' for local dev. This ensures browsers re-download static assets after every deploy without manual version bumps. Ready for future assets (CSS, images) to use the same STATIC_VERSION in their URLs. --- src/app/components/layout.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/app/components/layout.js b/src/app/components/layout.js index 8c9f4b3..63a9769 100644 --- a/src/app/components/layout.js +++ b/src/app/components/layout.js @@ -1,5 +1,14 @@ import { html } from "hono/html"; +// Derive a version stamp for cache-busting static assets. +// HEROKU_SLUG_COMMIT is the deployed git SHA, set automatically by Heroku. +// Falls back to SOURCE_VERSION (build-time env), then 'dev' for local. +const STATIC_VERSION = + (process.env.HEROKU_SLUG_COMMIT || process.env.SOURCE_VERSION || "").slice( + 0, + 7, + ) || "dev"; + // Base layout component export const Layout = ({ title, children }) => html` @@ -21,7 +30,10 @@ export const Layout = ({ title, children }) => html`
${children}
- + `; From 5f9307e2809d484e083e00f6d8a14509a3f4abe1 Mon Sep 17 00:00:00 2001 From: Morgan Roderick Date: Fri, 17 Jul 2026 14:13:09 +0200 Subject: [PATCH 2/2] style: fix pre-existing prettier formatting violations Fix formatting in admin.js, common.js, and home.js that was committed before prettier checks were enforced in CI. These are not related to the versioning feature but block the CI smoke job. --- src/app/components/admin.js | 106 ++++++++++++++++++----------------- src/app/components/common.js | 24 ++++---- src/app/components/home.js | 30 +++++----- 3 files changed, 86 insertions(+), 74 deletions(-) diff --git a/src/app/components/admin.js b/src/app/components/admin.js index 84c7207..97dac5a 100644 --- a/src/app/components/admin.js +++ b/src/app/components/admin.js @@ -5,55 +5,61 @@ import { formatISO } from "date-fns"; export const UsersList = ({ users, total }) => html`

Users (${total} total)

- ${users && users.length > 0 - ? html` - - - - - - - - - - - - ${users.map( - (user) => html` - - - - - - - - `, - )} - -
NameEmailVerifiedRoleCreated
${user.name}${user.email}${user.emailVerified ? "✅" : "❌"} -
- - -
-
- ${formatISO(new Date(user.createdAt), { - representation: "date", - })} -
- ` - : html`

No users found.

`} + ${ + users && users.length > 0 + ? html` + + + + + + + + + + + + ${users.map( + (user) => html` + + + + + + + + `, + )} + +
NameEmailVerifiedRoleCreated
${user.name}${user.email}${user.emailVerified ? "✅" : "❌"} +
+ + +
+
+ ${formatISO(new Date(user.createdAt), { + representation: "date", + })} +
+ ` + : html`

No users found.

` + }
`; diff --git a/src/app/components/common.js b/src/app/components/common.js index 9e36798..4e6a076 100644 --- a/src/app/components/common.js +++ b/src/app/components/common.js @@ -5,14 +5,18 @@ export const FormSection = ({ children }) => html`
${children}
`; // Message display component export const Message = ({ error, success }) => html` - ${error - ? html`
- ${decodeURIComponent(error)} -
` - : ""} - ${success - ? html`
- ${decodeURIComponent(success)} -
` - : ""} + ${ + error + ? html`
+ ${decodeURIComponent(error)} +
` + : "" + } + ${ + success + ? html`
+ ${decodeURIComponent(success)} +
` + : "" + } `; diff --git a/src/app/components/home.js b/src/app/components/home.js index 66bb5d6..f8de595 100644 --- a/src/app/components/home.js +++ b/src/app/components/home.js @@ -2,18 +2,20 @@ import { html } from "hono/html"; // Login status display export const LoginStatus = ({ user }) => html` - ${user - ? html` -
- ✅ Logged in as: ${user.name} (${user.email}) -
- View Profile | -
- -
- ` - : html` -
❌ Not logged in
- Sign In - `} + ${ + user + ? html` +
+ ✅ Logged in as: ${user.name} (${user.email}) +
+ View Profile | +
+ +
+ ` + : html` +
❌ Not logged in
+ Sign In + ` + } `;