Skip to content

feat: CI/CD, Claude Code config / chore: atualização de pacotes - #26

Open
zuff0 wants to merge 11 commits into
mainfrom
dev
Open

feat: CI/CD, Claude Code config / chore: atualização de pacotes#26
zuff0 wants to merge 11 commits into
mainfrom
dev

Conversation

@zuff0

@zuff0 zuff0 commented Jun 23, 2026

Copy link
Copy Markdown

O que esse PR faz

Três entregas pra mehorar umas coisas, adicionar funcionalidades e manter o template atualizado.
Tem umas coisas escritas no README novo, leia


CI/CD (GitHub Actions + Husky)

  • ci-web.yml — novo workflow para o workspace web: lint, typecheck
    (exec tsc --noEmit), testes de integração (Vitest) e e2e (Playwright,
    apenas em PRs para main/dev)
  • eas.yml — reescrita completa: preview build em PRs, production build
    no push para main, OTA separado de store submit, --no-wait com link
    para o dashboard do EAS
  • .husky/pre-commit — lint seletivo por workspace (só roda web se
    arquivos web/ mudaram; idem mobile)
  • .husky/pre-push — typecheck seletivo por workspace via exec tsc
    (corrige bug onde pnpm run tsc retornava exit 0 silencioso)
  • web/playwright.config.tspnpm start em CI, pnpm dev local;
    e2e test substituído por health-check genérico (sem texto hardcoded do
    projeto Noctiluz)

Claude Code — .claude/

  • 3 agents especializados: frontend (Next.js App Router, shadcn/ui,
    SWR), backend (controller/service/schema, Better Auth, Prisma, Zod),
    security (OWASP Top 10, auditoria de auth)
  • Skills de scaffolding: /setup, /new-route, /new-page,
    /new-screen, /check
  • Skills Caveman (compressão ~75% de tokens): /caveman,
    /caveman-commit, /caveman-compress, /caveman-review, /cavecrew
  • Skills model-invoked: backend-patterns, frontend-patterns,
    security-patterns (ativam automaticamente por contexto)
  • CLAUDE.md — guia completo de arquitetura, padrões e comandos
  • README.md — seção de Claude Code com tabelas de agents e skills

Atualização de stack (web)

  • @auth/prisma-adapter removido — pacote do NextAuth.js, incompatível
    com Better Auth que usa better-auth/adapters/prisma
  • tailwindcss 4.1.16 → 4.3.1 + @tailwindcss/postcss alinhado
  • react-hot-toast → Sonner — padrão atual do shadcn/ui; API idêntica,
    zero mudança nos call sites (toast.success/toast.error)

Checklist

  • Lint passa (web + mobile)
  • TypeScript sem erros (web + mobile)
  • Testes de integração passam
  • E2e health-check genérico (sem dependência de conteúdo do projeto)
  • Hooks testados localmente (pre-commit seletivo, pre-push com exec tsc)
  • CI no GitHub Actions (aguarda push)

zuff0 and others added 10 commits June 13, 2026 06:45
- Add ci-web.yml: parallel lint, typecheck, integration tests on every
  PR/push to dev and main; e2e tests run only on PRs targeting main
- Fix eas.yml: move credentials setup before Android build (was after),
  split into preview (PRs) and production (push to main) jobs, fix
  workflow_dispatch submit condition, remove false-positive PR comment
- Simplify pre-commit to fast lint-only (web + mobile staged files)
- Simplify pre-push to typecheck for web, lint for mobile; remove e2e
  from local hooks (moved to CI where a server can be provisioned)
- Add CLAUDE.md with codebase documentation

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- playwright.config.ts: uncomment webServer (pnpm start) and baseURL so
  e2e tests have a server to connect to; was failing with ECONNREFUSED
- ci-web.yml: install all Playwright browsers (not just chromium) to
  match the three active projects in playwright.config.ts; remove
  redundant NEXT_PUBLIC_APP_URL from test step (baked in at build time)
- eas.yml: gate OTA update on push or dispatch-with-platform=all so a
  partial platform build cannot push a mismatched JS bundle
- eas.yml: re-add OTA deploy to the preview branch (was dropped in the
  previous refactor, leaving preview-channel testers on stale builds)
- eas.yml: remove unconditional store submission on push; submission now
  requires explicit workflow_dispatch with submit=true and the correct
  platform selection, preventing accidental store releases on every merge
- eas.yml: add platform guard to submit steps so iOS submit cannot run
  when only an Android build was produced (and vice versa)
- pre-push: fix fallback diff to use merge-base against origin/main
  instead of HEAD~1 which was empty on first push of a new branch,
  silently skipping all typecheck/lint hooks

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- playwright.config.ts: webServer.command now uses 'pnpm start' in CI
  (app already built by Build app step) and 'pnpm dev' locally (no prior
  build required), fixing cold-start breakage for developers
- pre-push: switch two-dot to three-dot range (origin/BRANCH...HEAD) so
  only commits being pushed are diffed, not the entire working tree —
  unstaged files no longer trigger checks spuriously
- eas.yml: pin eas-version to '16.13.3' in both preview and production
  jobs (restored from original); expo-github-action resolves 'latest' at
  runtime so an EAS CLI breaking release would have silently hit both
  pipelines simultaneously with no canary
- eas.yml: add 'pnpm-lock.yaml' to pull_request paths, mirroring the
  push trigger; a lockfile-only dependency bump now correctly triggers a
  preview build on the PR instead of only post-merge
- ci-web.yml: extend e2e job condition to include base_ref == 'dev' so
  E2E tests run on all day-to-day feature→dev PRs, not only dev→main

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- ci-web: fix playwright install to use root node_modules/.bin (hoisted linker)
- ci-web: promote runtime secrets to job-level env so next start sees them
- ci-web/eas: replace pnpm-lock.yaml path filter with app-specific package.json to prevent cross-contamination
- eas: replace silent || echo on OTA preview with continue-on-error: true
- pre-push: run tsc --noEmit for mobile instead of duplicating lint

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…template flexibility

- Rename mobile package from 'mobile-2' to 'mobile' so --filter mobile actually matches
- Replace 'pnpm --filter X tsc' with 'pnpm --filter X exec tsc' (exec runs the binary; run looks for a script and exits 0 when not found, masking all TypeScript errors)
- Remove service-specific secrets (RESEND_API_KEY, GOOGLE_ID, GOOGLE_SECRET) from e2e job env — template projects may not use these services; only DATABASE_URL and BETTER_AUTH_SECRET are truly required
- Remove redundant web/package.json path entry in ci-web.yml (already covered by web/**)
- Remove redundant mobile/package.json path entry in eas.yml (already covered by mobile/**)
- Fix pre-existing TypeScript error in users test exposed by the now-working tsc command
- Fix mobile Prettier formatting issues now surfaced by the working hook

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Agents (Next.js specialized):
- frontend: App Router, shadcn/ui, SWR, component structure
- backend: controller/service/schema, Better Auth, Prisma, Zod
- security: OWASP, auth audit, input validation, code review

User-invoked skills (slash commands):
- /setup: project initialization wizard with full skill overview
- /new-route: scaffold API route + services + schema + test stub
- /new-page: scaffold Next.js page with _components/ and actions/
- /new-screen: scaffold Expo screen with NativeWind and auth guard
- /check: lint + tsc for web and/or mobile

Caveman skills (juliusbrussee/caveman — ~75% token reduction):
- /caveman, /caveman-commit, /caveman-compress, /caveman-review, /cavecrew

Model-invoked skills (auto-triggered by context):
- backend-patterns, frontend-patterns, security-patterns

Updated README with full Claude Code section documenting all agents,
commands, and skills.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The previous test referenced UI text specific to the Noctiluz project
("Embarque agora", "Aprenda se divertindo!") and would fail on every
project derived from this template. Replaced with a project-agnostic
homepage status check.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Feature: Enhance CI/CD workflows and address code review findings

ninguem revisou essa porra, mesmo eu pedindo, ent só dei merge foda-se
@zuff0

zuff0 commented Jun 23, 2026

Copy link
Copy Markdown
Author

@LourencoPeronti @nalberthkagiya @Gaaudio @mathiasdev00 revisem o PR fazendo favor

@zuff0

zuff0 commented Jun 23, 2026

Copy link
Copy Markdown
Author

@jv-aquino se tiver tempo e conseguir revisar, agradeço

@zuff0 zuff0 added bug Something isn't working documentation Improvements or additions to documentation enhancement New feature or request labels Jun 23, 2026
@zuff0 zuff0 self-assigned this Jun 23, 2026
@zuff0 zuff0 changed the title feat: CI/CD, Claude Code config / chore: atualização de stack feat: CI/CD, Claude Code config / chore: atualização de pacotes Jun 23, 2026
@zuff0

zuff0 commented Jun 23, 2026

Copy link
Copy Markdown
Author

Ainda preciso atualizar o SDK 55 -> 56, mas o @better-auth/expo ainda não suporta oficialmente o SDK 56. Como a galera do tec é cabaço e NUNCA vai conseguir identificar se algum erro acontecer por causa disso vou só subir a atualização na branch feature/stack-update e subir PR pra dev. Quando o better-auth tiver suporte oficial pro SDK 56 ai faz merge na main.

Como é uma breaking change requer um pouco mais de tempo e carinho na revisão de vcs.

@LourencoPeronti LourencoPeronti left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Revisado!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants