feat: migrate vanilla js to react vite spa
continuous-integration/webhook Falha no deploy (VPS4)

This commit is contained in:
VPS 4 Deploy Agent
2026-05-30 18:26:56 +02:00
parent 3bc1161d95
commit d6ae290e56
47 changed files with 5374 additions and 24 deletions
+4 -10
View File
@@ -1,12 +1,12 @@
#!/usr/bin/env node
// update-version.js — sincroniza version.txt → package.json + index.html
// update-version.js — sincroniza version.txt
// Incrementa o PATCH automaticamente a cada deploy.
// Fonte de verdade: dental-server/version.txt
// NOTA: O index.html agora é gerado pelo React/Vite — não é mais editado aqui.
const fs = require('fs');
const path = require('path');
const versionFile = path.join(__dirname, 'dental-server', 'version.txt');
const indexFile = path.join(__dirname, 'dental-server', 'public', 'index.html');
const current = fs.readFileSync(versionFile, 'utf8').trim();
const parts = current.split('.').map(Number);
@@ -14,15 +14,9 @@ parts[2]++; // bump PATCH
const next = parts.join('.');
// version.txt — fonte de verdade do número de versão
// O React serve /version.txt diretamente pelo Express static (dental-client/dist/)
fs.writeFileSync(versionFile, next + '\n');
// index.html — substitui v{X.Y.Z} dentro do <span> da sidebar
// (package.json NÃO é alterado para preservar o cache de npm install no Docker)
let html = fs.readFileSync(indexFile, 'utf8');
html = html.replace(
/(RF Dental.*?<span[^>]*>)\s*v[\d.]+\s*(<\/span>)/s,
`$1v${next}$2`
);
fs.writeFileSync(indexFile, html);
// package.json NÃO é alterado para preservar o cache de npm install no Docker
console.log(`version: ${current}${next}`);