feat(version): versão em runtime via /api/version (Passos 1/3/4)

- buildInfo.ts: hook useAppVersion() consome GET /api/version (fonte única = backend),
  com fallback ao carimbo do bundle; deixa de depender do APP_VERSION manual.
- Versão exibida em Configurações ("Sobre o sistema") + telas públicas (Login/WaitingInvite);
  removida do rodapé do Sidebar.
- compose.prod/deploy-prod.sh: injetam APP_VERSION (=tag) e APP_ENV=PROD em runtime,
  desacoplando a versão semântica do build (commit/build seguem da imagem).
- constants.ts marcado legado + bump V1.0.15 (transitório até o Passo 5; evita colisão de tag).
- DEPLOY-PRODUCAO.md reescrito com status /🧪/🎯 + nota de fase transitória.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
VPS 4 Builder
2026-06-17 05:19:27 +02:00
parent 6e81718725
commit a991f1fe2c
9 changed files with 187 additions and 164 deletions
+3 -2
View File
@@ -1,7 +1,7 @@
import React, { useState } from 'react';
import { Mail, LogOut, Stethoscope, Clock, CheckCircle2, ArrowRight, MapPin, Users, Wrench, ChevronDown, ChevronUp, Loader2 } from 'lucide-react';
import { HybridBackend } from '../services/backend.ts';
import { APP_VERSION } from '../constants.ts';
import { useAppVersion } from '../buildInfo.ts';
const UF_LIST = ['AC','AL','AM','AP','BA','CE','DF','ES','GO','MA','MG','MS','MT','PA','PB','PE','PI','PR','RJ','RN','RO','RR','RS','SC','SE','SP','TO'];
@@ -13,6 +13,7 @@ const ROLE_CONFIG: Record<string, { label: string; icon: React.ElementType; colo
};
export const WaitingInviteView: React.FC = () => {
const ver = useAppVersion();
const userData = localStorage.getItem('SCOREODONTO_USER_DATA');
const user = userData ? JSON.parse(userData) : null;
const role = user?.role ?? 'dentista';
@@ -229,7 +230,7 @@ export const WaitingInviteView: React.FC = () => {
</div>
<div className="px-8 py-4 bg-gray-50 border-t border-gray-100 flex items-center justify-center">
<span className="text-[10px] font-black text-gray-400 uppercase tracking-widest">{APP_VERSION}</span>
<span className="text-[10px] font-black text-gray-400 uppercase tracking-widest">{ver.version}</span>
</div>
</div>
</div>