chore: Bump version to 1.0.3 and enhance update handling in the desktop application. Introduce release date stamping before build, add version listing functionality, and improve update prompts with detailed version information. Update README and scripts for clarity on release date management and version publishing.

This commit is contained in:
erik
2026-07-11 01:02:00 -05:00
parent c8853de808
commit f355a954a3
17 changed files with 917 additions and 56 deletions
@@ -0,0 +1,60 @@
/**
* Escribe src/shared/version.json con la fecha de release.
* Default: hoy. Override: RELEASE_DATE=DD/MM/YYYY (env o .env.minio).
*
* Debe ejecutarse ANTES de vite build: la UI inyecta esta fecha en compile-time.
*/
import { existsSync, readFileSync, writeFileSync } from "node:fs";
import { dirname, join } from "node:path";
import { fileURLToPath } from "node:url";
const __dirname = dirname(fileURLToPath(import.meta.url));
const root = join(__dirname, "..");
function loadEnvFile(filePath) {
if (!existsSync(filePath)) return;
const text = readFileSync(filePath, "utf8");
for (const line of text.split(/\r?\n/)) {
const trimmed = line.trim();
if (!trimmed || trimmed.startsWith("#")) continue;
const eq = trimmed.indexOf("=");
if (eq <= 0) continue;
const key = trimmed.slice(0, eq).trim();
let value = trimmed.slice(eq + 1).trim();
if (
(value.startsWith('"') && value.endsWith('"')) ||
(value.startsWith("'") && value.endsWith("'"))
) {
value = value.slice(1, -1);
}
if (!(key in process.env) || process.env[key] === "") {
process.env[key] = value;
}
}
}
loadEnvFile(join(root, ".env.minio"));
loadEnvFile(join(root, ".env"));
function todayIso() {
const d = new Date();
const dd = String(d.getDate()).padStart(2, "0");
const mm = String(d.getMonth() + 1).padStart(2, "0");
const yyyy = d.getFullYear();
return `${yyyy}-${mm}-${dd}`;
}
function isoFromDisplay(display) {
const m = String(display).trim().match(/^(\d{1,2})\/(\d{1,2})\/(\d{4})$/);
if (!m) return null;
const [, dd, mm, yyyy] = m;
return `${yyyy}-${mm.padStart(2, "0")}-${dd.padStart(2, "0")}`;
}
const releaseDateIso = process.env.RELEASE_DATE
? isoFromDisplay(process.env.RELEASE_DATE) || todayIso()
: todayIso();
const outPath = join(root, "src/shared/version.json");
writeFileSync(outPath, `${JSON.stringify({ releaseDate: releaseDateIso }, null, 2)}\n`, "utf8");
console.log(`releaseDate → ${releaseDateIso} (${outPath})`);