Compare commits

...

3 Commits

Author SHA1 Message Date
Chris Wanstrath
6c493a667d update build.js 2025-10-01 12:20:28 -07:00
Chris Wanstrath
ff88168e63 version bundled js 2025-10-01 12:20:20 -07:00
Chris Wanstrath
062640c390 shortsha, version command 2025-10-01 12:20:11 -07:00
4 changed files with 8 additions and 3 deletions

4
bin/version.ts Normal file
View File

@ -0,0 +1,4 @@
import { GIT_SHA } from "@/config"
export default function () {
return GIT_SHA
}

View File

@ -1,5 +1,5 @@
//// ////
// version: 1d6a7bc // version: ff88168
// src/js/dom.ts // src/js/dom.ts
var cmdLine = $("command-line"); var cmdLine = $("command-line");

View File

@ -13,4 +13,4 @@ export const NOSE_WWW = join(NOSE_DIR, "www")
export const NOSE_DATA = resolve("./data") export const NOSE_DATA = resolve("./data")
export const NOSE_STARTED = Date.now() export const NOSE_STARTED = Date.now()
export const GIT_SHA = (await $`git rev-parse HEAD`.text()).trim() export const GIT_SHA = (await $`git rev-parse --short HEAD`.text()).trim()

View File

@ -1,4 +1,5 @@
import type { FC } from "hono/jsx" import type { FC } from "hono/jsx"
import { GIT_SHA } from "../config"
export const Layout: FC = async ({ children, title }) => ( export const Layout: FC = async ({ children, title }) => (
<html lang="en"> <html lang="en">
@ -12,7 +13,7 @@ export const Layout: FC = async ({ children, title }) => (
<link href="/css/game.css" rel="stylesheet" /> <link href="/css/game.css" rel="stylesheet" />
<script type="importmap" dangerouslySetInnerHTML={{ __html: `{ "imports": { "@/": "/" } }` }} /> <script type="importmap" dangerouslySetInnerHTML={{ __html: `{ "imports": { "@/": "/" } }` }} />
<script src={process.env.NODE_ENV === "production" ? "/bundle.js" : "/js/main.js"} type="module" async></script> <script src={process.env.NODE_ENV === "production" ? `/bundle.js?${GIT_SHA}` : "/js/main.js"} type="module" async></script>
</head> </head>
<body data-mode="tall"> <body data-mode="tall">
<main> <main>