Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Protector Lombada - Instruções para Claude

## Versionamento Automático (OBRIGATÓRIO)

Após TODA alteração de código, executar o script de versionamento antes do commit:

```bash
# Melhorias, ajustes de estilo, correções de bug → bump de BUILD
./scripts/version-bump.sh build

# Novas funcionalidades → bump de MINOR
./scripts/version-bump.sh minor

# Mudanças radicais / breaking changes / redesign completo → bump de MAJOR
./scripts/version-bump.sh major
```

### Formato: MAJOR.MINOR.BUILD
- **major** (ex: 1.0.0 → 2.0.0): mudança radical, redesign, breaking changes
- **minor** (ex: 1.0.0 → 1.1.0): nova funcionalidade
- **build** (ex: 1.0.0 → 1.0.1): melhoria visual, ajuste de estilo, correção de bug, refatoração

### Fluxo de commit:
1. Fazer as alterações no código
2. `git add` dos arquivos alterados
3. `git commit` das alterações
4. Rodar `./scripts/version-bump.sh <tipo>`
5. `git add` dos arquivos de versão (package.json, dashboard/index.html, dashboard/manual.html)
6. `git commit` com mensagem "bump: vX.Y.Z"
7. `git push`

## Deploy (OBRIGATÓRIO)

O deploy é feito automaticamente pela **Vercel** ao detectar push no branch `master`.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Point deploy instructions to the actual default branch

These instructions mandate merge/push to master, but this repository uses main; following the documented flow can cause failed pushes or deployments to never trigger on the intended branch. The operational guidance should reference the real default branch so release steps are executable.

Useful? React with 👍 / 👎.


### Após finalizar alterações, SEMPRE:
1. Fazer merge do branch de feature para `master`
2. Push para `master` — a Vercel faz deploy automático
3. Se push direto no `master` estiver bloqueado (403), criar PR e fazer merge pelo GitHub

### Branch principal: `master`
4 changes: 2 additions & 2 deletions dashboard/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1335,7 +1335,7 @@ <h1>PROTECTOR TRAFFIC CONTROL</h1>
<a href="#" onclick="hideResetPassword(event)" style="display:block;margin-top:10px;color:var(--text-secondary);font-size:12px;text-decoration:none;">Voltar ao login</a>
</div>
<div class="app-version" style="margin-top:24px;padding-top:16px;border-top:1px solid var(--border);text-align:center;font-size:11px;color:var(--text-muted);letter-spacing:0.5px">
v1.0.1 &middot; Build 2ea9b40 &middot; 2026-03-12
v1.0.3 &middot; Build e9bb95e &middot; 2026-03-12
</div>
</div>
</div>
Expand Down Expand Up @@ -1526,7 +1526,7 @@ <h3>Top 10 Placas (15 dias)</h3>
</div>

<div style="text-align:center;padding:16px 0 24px;font-size:11px;color:var(--text-muted);letter-spacing:0.3px">
Protector Traffic Control &middot; v1.0.1 &middot; Build 2ea9b40
Protector Traffic Control &middot; v1.0.3 &middot; Build e9bb95e
<br>
<a href="/dashboard/manual.html" target="_blank" style="color:var(--accent);text-decoration:none;font-weight:500;margin-top:4px;display:inline-block">Manual do Usuario</a>
</div>
Expand Down
4 changes: 2 additions & 2 deletions dashboard/manual.html
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@

<h1>Manual do Usuário</h1>
<p class="subtitle">Lombada Educativa Inteligente</p>
<p class="version">Versão 1.0.0 | Março 2026</p>
<p class="version">Versão 1.0.3 | Março 2026</p>

<hr>

Expand Down Expand Up @@ -675,7 +675,7 @@ <h2 id="suporte">Suporte</h2>
<hr>

<p style="text-align:center; color:#888; font-size:13px; margin-top:40px;">
<strong>Protector Traffic Control</strong> - v1.0.0 | Março 2026<br>
<strong>Protector Traffic Control</strong> - v1.0.3 | Março 2026<br>
<em>Sistema de Lombada Educativa Inteligente</em>
</p>

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "protector-lombada",
"version": "1.0.0-final",
"version": "1.0.3",
"description": "Plataforma web para gerenciamento de Lombadas Educativas ALPHADIGI",
"private": true,
"scripts": {
Expand Down
86 changes: 86 additions & 0 deletions scripts/version-bump.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
#!/bin/bash
# =============================================================================
# version-bump.sh - Script de versionamento automático do Protector Lombada
#
# Uso:
# ./scripts/version-bump.sh build # Melhorias, ajustes, correções
# ./scripts/version-bump.sh minor # Novas funcionalidades
# ./scripts/version-bump.sh major # Mudanças radicais / breaking changes
#
# Formato: MAJOR.MINOR.BUILD
# - major: mudança radical (breaking change, redesign completo)
# - minor: nova funcionalidade
# - build: melhoria, ajuste de estilo, correção de bug
# =============================================================================

set -e

BUMP_TYPE="${1:-build}"
ROOT_DIR="$(cd "$(dirname "$0")/.." && pwd)"
PKG="$ROOT_DIR/package.json"
DASH="$ROOT_DIR/dashboard/index.html"
MANUAL="$ROOT_DIR/dashboard/manual.html"

# Lê versão atual do package.json
CURRENT=$(grep '"version"' "$PKG" | head -1 | sed 's/.*"\([0-9]*\.[0-9]*\.[0-9]*\).*/\1/')
MAJOR=$(echo "$CURRENT" | cut -d. -f1)
MINOR=$(echo "$CURRENT" | cut -d. -f2)
BUILD=$(echo "$CURRENT" | cut -d. -f3)

echo "Versão atual: $CURRENT"

case "$BUMP_TYPE" in
major)
MAJOR=$((MAJOR + 1))
MINOR=0
BUILD=0
;;
minor)
MINOR=$((MINOR + 1))
BUILD=0
;;
build)
BUILD=$((BUILD + 1))
;;
*)
echo "Uso: $0 [major|minor|build]"
echo " major - mudança radical (breaking changes)"
echo " minor - nova funcionalidade"
echo " build - melhoria, ajuste, correção"
exit 1
;;
esac

NEW_VERSION="$MAJOR.$MINOR.$BUILD"
COMMIT_HASH=$(git -C "$ROOT_DIR" rev-parse --short HEAD 2>/dev/null || echo "0000000")
TODAY=$(date +%Y-%m-%d)
MONTH_YEAR=$(date +"%B %Y" | sed 's/January/Janeiro/;s/February/Fevereiro/;s/March/Março/;s/April/Abril/;s/May/Maio/;s/June/Junho/;s/July/Julho/;s/August/Agosto/;s/September/Setembro/;s/October/Outubro/;s/November/Novembro/;s/December/Dezembro/')

echo "Nova versão: $NEW_VERSION ($BUMP_TYPE)"
echo "Build hash: $COMMIT_HASH"
echo "Data: $TODAY"
echo ""

# 1. Atualiza package.json
sed -i "s/\"version\": \"[^\"]*\"/\"version\": \"$NEW_VERSION\"/" "$PKG"
echo "[OK] package.json → $NEW_VERSION"

# 2. Atualiza dashboard/index.html - versão na tela de login
sed -i "s/v[0-9]*\.[0-9]*\.[0-9]* \&middot; Build [a-f0-9]* \&middot; [0-9\-]*/v$NEW_VERSION \&middot; Build $COMMIT_HASH \&middot; $TODAY/" "$DASH"
echo "[OK] dashboard/index.html (login)"

# 3. Atualiza dashboard/index.html - rodapé
sed -i "s/Protector Traffic Control \&middot; v[0-9]*\.[0-9]*\.[0-9]* \&middot; Build [a-f0-9]*/Protector Traffic Control \&middot; v$NEW_VERSION \&middot; Build $COMMIT_HASH/" "$DASH"
echo "[OK] dashboard/index.html (footer)"

# 4. Atualiza manual.html - versão no topo
sed -i "s/Versão [0-9]*\.[0-9]*\.[0-9]* | .*/Versão $NEW_VERSION | $MONTH_YEAR<\/p>/" "$MANUAL"
echo "[OK] manual.html (header)"

# 5. Atualiza manual.html - versão no rodapé
sed -i "s/v[0-9]*\.[0-9]*\.[0-9]* | [A-ZÇa-zçã]* [0-9]*/v$NEW_VERSION | $MONTH_YEAR/" "$MANUAL"
echo "[OK] manual.html (footer)"

echo ""
echo "Versão atualizada: v$NEW_VERSION (Build $COMMIT_HASH) - $TODAY"
echo "Arquivos modificados: package.json, dashboard/index.html, dashboard/manual.html"