Skip to content

Commit 8d80329

Browse files
ibrahimcesarclaude
andcommitted
✨ feat: adicionar comandos build, serve e dev no Makefile
- `make dev`: Inicia servidor de desenvolvimento com hot-reload - `make build`: Compila site estático para produção - `make serve`: Serve build local para testes - Adiciona verificações de dependências - Mensagens coloridas e instruções claras - Fluxo: dev para desenvolvimento, build+serve para produção local 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 4a92637 commit 8d80329

File tree

1 file changed

+61
-1
lines changed

1 file changed

+61
-1
lines changed

Makefile

Lines changed: 61 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Structure and Interpretation of Computer Programs - JavaScript Adaptation
33
# Estrutura e Interpretação de Programas de Computador - Adaptação em JavaScript
44

5-
.PHONY: help lint spell-check link-check check format clean install test colaborar translation-status docker-check wordlist-stats ci-local reorder-wordlist pr
5+
.PHONY: help lint spell-check link-check check format clean install test colaborar translation-status docker-check wordlist-stats ci-local reorder-wordlist pr build serve dev
66

77
# Default target
88
.DEFAULT_GOAL := help
@@ -33,6 +33,66 @@ help: ## 📖 Mostra esta mensagem de ajuda com todos os comandos disponíveis
3333

3434
##@ 🛠️ Desenvolvimento
3535

36+
dev: ## 🚀 Inicia servidor de desenvolvimento com hot-reload (localhost:3000)
37+
@echo "$(BOLD)$(CYAN)🚀 Iniciando servidor de desenvolvimento...$(NC)"
38+
@echo ""
39+
@if [ -f node_modules/.bin/docusaurus ]; then \
40+
echo "$(GREEN)✓ Docusaurus encontrado!$(NC)"; \
41+
echo ""; \
42+
echo "$(BOLD)$(YELLOW)📌 O servidor será iniciado em:$(NC) $(CYAN)http://localhost:3000$(NC)"; \
43+
echo "$(YELLOW)⏱️ Aguarde alguns segundos enquanto compilamos...$(NC)"; \
44+
echo ""; \
45+
npm start; \
46+
else \
47+
echo "$(BOLD)$(RED)✗ Erro: Docusaurus não está instalado!$(NC)"; \
48+
echo "$(YELLOW)➜ Execute primeiro:$(NC) $(CYAN)make install$(NC)"; \
49+
echo ""; \
50+
exit 1; \
51+
fi
52+
53+
build: ## 🏗️ Compila o site estático para produção (pasta build/)
54+
@echo "$(BOLD)$(CYAN)🏗️ Compilando site para produção...$(NC)"
55+
@echo ""
56+
@if [ -f node_modules/.bin/docusaurus ]; then \
57+
if npm run build; then \
58+
echo ""; \
59+
echo "$(BOLD)$(GREEN)✅ Build concluído com sucesso!$(NC)"; \
60+
echo ""; \
61+
echo "$(BOLD)$(YELLOW)📁 Arquivos gerados em:$(NC) $(CYAN)./build/$(NC)"; \
62+
echo ""; \
63+
echo "$(MAGENTA)📌 Próximo passo:$(NC) Execute $(CYAN)make serve$(NC) para visualizar o build localmente"; \
64+
echo ""; \
65+
else \
66+
echo ""; \
67+
echo "$(BOLD)$(RED)✗ Erro durante o build!$(NC)"; \
68+
echo "$(YELLOW)➜ Verifique os erros acima e corrija$(NC)"; \
69+
echo ""; \
70+
exit 1; \
71+
fi \
72+
else \
73+
echo "$(BOLD)$(RED)✗ Erro: Docusaurus não está instalado!$(NC)"; \
74+
echo "$(YELLOW)➜ Execute primeiro:$(NC) $(CYAN)make install$(NC)"; \
75+
echo ""; \
76+
exit 1; \
77+
fi
78+
79+
serve: ## 🌐 Serve o build local para testes (localhost:3000)
80+
@echo "$(BOLD)$(CYAN)🌐 Servindo build local...$(NC)"
81+
@echo ""
82+
@if [ -d build ]; then \
83+
echo "$(GREEN)✓ Diretório build/ encontrado!$(NC)"; \
84+
echo ""; \
85+
echo "$(BOLD)$(YELLOW)📌 O site será servido em:$(NC) $(CYAN)http://localhost:3000$(NC)"; \
86+
echo "$(YELLOW)⏱️ Servidor iniciando...$(NC)"; \
87+
echo ""; \
88+
npm run serve; \
89+
else \
90+
echo "$(BOLD)$(RED)✗ Erro: Diretório build/ não encontrado!$(NC)"; \
91+
echo "$(YELLOW)➜ Execute primeiro:$(NC) $(CYAN)make build$(NC)"; \
92+
echo ""; \
93+
exit 1; \
94+
fi
95+
3696
install: ## 📦 Instala todas as dependências necessárias (Node.js, Python, aspell)
3797
@echo "$(BOLD)$(CYAN)🚀 Instalando dependências...$(NC)"
3898
@echo ""

0 commit comments

Comments
 (0)