Versioning: package.json carries the app version (0.1.2 here; one bump per task with `npm run version:bump`, patch 0-9 rolling into the minor at 10), baked into the build via lib/version.ts, reported by /api/healthz and shown in Settings next to the running commit. AGENTS.md documents the rule; the native suite checks both the API and the Settings row. Fix: on desktop the app header is hidden, so every page owns its top padding — /create was the only one without `lg:pt-10`, which slammed the Study deck / Make my homework switch against the top of the window while /homework had a comfortable gap. Both now sit at 40px; the wizard suite asserts the clearance and that the two pages stay in step (90 checks). SW -> freezmo-v50.
41 lines
1.3 KiB
JavaScript
41 lines
1.3 KiB
JavaScript
#!/usr/bin/env node
|
|
/**
|
|
* Bump the app version one step: 0.1.7 -> 0.1.8, and 0.1.9 -> 0.2.0 — the
|
|
* patch digit never reaches two digits (the working rule is one bump per
|
|
* task; see AGENTS.md).
|
|
*
|
|
* npm run version:bump # one step up, prints old -> new
|
|
* npm run version:bump -- 0.3.0 # set an explicit version
|
|
*
|
|
* The version is baked into the build (lib/version.ts) and shown in Settings
|
|
* next to the running commit.
|
|
*/
|
|
import { readFileSync, writeFileSync } from "node:fs";
|
|
import path from "node:path";
|
|
|
|
const file = path.join(import.meta.dirname, "..", "package.json");
|
|
const raw = readFileSync(file, "utf8");
|
|
const current = JSON.parse(raw).version;
|
|
|
|
const explicit = process.argv[2];
|
|
let next = explicit;
|
|
|
|
if (!next) {
|
|
const match = /^(\d+)\.(\d+)\.(\d+)$/.exec(current);
|
|
if (!match) {
|
|
console.error(`package.json version "${current}" is not x.y.z — pass one explicitly`);
|
|
process.exit(1);
|
|
}
|
|
const major = Number(match[1]);
|
|
const minor = Number(match[2]);
|
|
const patch = Number(match[3]);
|
|
next = patch >= 9 ? `${major}.${minor + 1}.0` : `${major}.${minor}.${patch + 1}`;
|
|
}
|
|
|
|
if (!/^\d+\.\d+\.\d+$/.test(next)) {
|
|
console.error(`"${next}" is not a valid x.y.z version`);
|
|
process.exit(1);
|
|
}
|
|
|
|
writeFileSync(file, raw.replace(`"version": "${current}"`, `"version": "${next}"`));
|
|
console.log(`${current} -> ${next}`);
|