1 Commits

Author SHA1 Message Date
d7d4bbc099 fixes version not showing up in web ui
All checks were successful
Build / test (push) Successful in 9m28s
Build / release (push) Successful in 1s
Build / build (push) Successful in 18s
2026-03-28 02:08:58 -04:00
6 changed files with 12 additions and 6 deletions

View File

@@ -3,3 +3,6 @@
Dockerfile Dockerfile
.dockerignore .dockerignore
docker-compose.yml docker-compose.yml
node_modules
tests
vitest.config.js

1
.gitignore vendored
View File

@@ -1 +1,2 @@
node_modules/ node_modules/
js/version.js

View File

@@ -1,3 +1,6 @@
FROM nginx:alpine FROM nginx:alpine
COPY nginx.conf /etc/nginx/conf.d/default.conf COPY nginx.conf /etc/nginx/conf.d/default.conf
COPY . /usr/share/nginx/html COPY . /usr/share/nginx/html
RUN awk -F'"' '/"version"/{printf "const VERSION = \"%s\";\n", $4; exit}' \
/usr/share/nginx/html/package.json \
> /usr/share/nginx/html/js/version.js

View File

@@ -177,6 +177,7 @@
</div> </div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/sql.js/1.10.2/sql-wasm.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/sql.js/1.10.2/sql-wasm.js"></script>
<script src="js/version.js" onerror="window.VERSION=null"></script>
<script src="js/config.js"></script> <script src="js/config.js"></script>
<script src="js/db.js"></script> <script src="js/db.js"></script>
<script src="js/ui.js"></script> <script src="js/ui.js"></script>

View File

@@ -37,10 +37,7 @@ window.addEventListener('popstate', e => {
// ── Bootstrap ───────────────────────────────────────────────────────────────── // ── Bootstrap ─────────────────────────────────────────────────────────────────
fetch('/package.json') if (VERSION) document.getElementById('nav-version').textContent = `v${VERSION}`;
.then(r => r.json())
.then(pkg => { document.getElementById('nav-version').textContent = `v${pkg.version}`; })
.catch(() => {});
initDB().then(() => { initDB().then(() => {
renderDashboard(); renderDashboard();

View File

@@ -1,10 +1,11 @@
{ {
"name": "catalyst", "name": "catalyst",
"version": "1.0.2", "version": "1.0.3",
"type": "module", "type": "module",
"scripts": { "scripts": {
"test": "vitest run", "test": "vitest run",
"test:watch": "vitest" "test:watch": "vitest",
"version:write": "node -e \"const {version}=JSON.parse(require('fs').readFileSync('package.json','utf8'));require('fs').writeFileSync('js/version.js','const VERSION = \\\"'+version+'\\\";\\n');\""
}, },
"devDependencies": { "devDependencies": {
"vitest": "^2.0.0", "vitest": "^2.0.0",