@nimbuslab/cli 0.8.0 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,148 @@
1
+ # nimbus analyze
2
+
3
+ Analisa a stack de um projeto existente e sugere melhorias baseadas na stack nimbuslab.
4
+
5
+ ## Uso
6
+
7
+ ```bash
8
+ # Analisar diretorio atual
9
+ nimbus analyze
10
+
11
+ # Analisar diretorio especifico
12
+ nimbus analyze ./meu-projeto
13
+ nimbus analyze ~/www/nimbuslab/projeto
14
+
15
+ # Output em JSON (para automacao)
16
+ nimbus analyze --json
17
+ ```
18
+
19
+ ## O que Detecta
20
+
21
+ ### Framework
22
+ - Next.js (com versao)
23
+ - React (standalone)
24
+ - Angular
25
+ - Vue
26
+ - Svelte
27
+
28
+ ### Styling
29
+ - Tailwind CSS (com versao)
30
+ - styled-components
31
+ - Emotion
32
+ - Sass/SCSS
33
+ - Less
34
+ - CSS puro
35
+
36
+ ### Package Manager
37
+ - bun (recomendado)
38
+ - pnpm
39
+ - npm
40
+ - yarn
41
+
42
+ ### Monorepo
43
+ - Turborepo
44
+ - Nx
45
+ - Lerna
46
+ - Workspaces nativo
47
+
48
+ ### Autenticacao
49
+ - Better Auth (recomendado)
50
+ - NextAuth / Auth.js
51
+ - Clerk
52
+ - Auth0
53
+ - Supabase Auth
54
+
55
+ ### Banco de Dados
56
+ - Drizzle ORM (recomendado)
57
+ - Prisma
58
+ - TypeORM
59
+ - Mongoose
60
+ - pg / mysql2 direto
61
+
62
+ ### Outros
63
+ - TypeScript (tsconfig.json)
64
+ - ESLint
65
+ - Prettier
66
+
67
+ ## Recomendacoes Automaticas
68
+
69
+ O comando gera recomendacoes baseadas na stack nimbuslab:
70
+
71
+ | Detectado | Recomendacao |
72
+ |-----------|--------------|
73
+ | pnpm/npm/yarn | Migrar para bun |
74
+ | Next.js < 16 | Atualizar para Next.js 16 |
75
+ | React < 19 | Atualizar para React 19 |
76
+ | Tailwind < 4 | Atualizar para Tailwind 4 |
77
+ | Prisma | Considerar Drizzle ORM |
78
+ | NextAuth | Considerar Better Auth |
79
+ | Sem auth | Adicionar autenticacao |
80
+ | Sem DB | Adicionar banco de dados |
81
+
82
+ ## Exemplo de Output
83
+
84
+ ```
85
+ Analisando projeto...
86
+
87
+ Projeto: meu-app v1.0.0
88
+
89
+ Stack Detectada:
90
+ Framework: nextjs@15.0.2
91
+ Styling: tailwind@3.4.1
92
+ Package Manager: pnpm
93
+ TypeScript: sim
94
+ Monorepo: turborepo
95
+ Auth: next-auth
96
+ Database: prisma
97
+
98
+ Recomendacoes:
99
+ 1. Migrar pnpm -> bun (nimbus codemod bun)
100
+ 2. Atualizar Next.js 15 -> 16 (nimbus upgrade next)
101
+ 3. Atualizar React 18 -> 19 (nimbus upgrade react)
102
+ 4. Atualizar Tailwind 3 -> 4 (nimbus upgrade tailwind)
103
+ 5. Considerar migrar Prisma -> Drizzle (nimbus codemod drizzle)
104
+ ```
105
+
106
+ ## Output JSON
107
+
108
+ Com `--json`, retorna estrutura para automacao:
109
+
110
+ ```json
111
+ {
112
+ "name": "meu-app",
113
+ "version": "1.0.0",
114
+ "framework": "nextjs",
115
+ "frameworkVersion": "15.0.2",
116
+ "styling": ["tailwind@3.4.1"],
117
+ "packageManager": "pnpm",
118
+ "monorepo": "turborepo",
119
+ "auth": "next-auth",
120
+ "database": "prisma",
121
+ "typescript": true,
122
+ "recommendations": [
123
+ "Migrar pnpm -> bun",
124
+ "Atualizar Next.js 15 -> 16"
125
+ ]
126
+ }
127
+ ```
128
+
129
+ ## Integracao com Outros Comandos
130
+
131
+ ```bash
132
+ # Analisar e depois ver plano de upgrade
133
+ nimbus analyze
134
+ nimbus upgrade --plan
135
+
136
+ # Pipeline completo
137
+ nimbus analyze ./projeto && nimbus upgrade --plan
138
+ ```
139
+
140
+ ## Limitacoes
141
+
142
+ - Analisa apenas `package.json` e arquivos de config
143
+ - Nao analisa codigo-fonte
144
+ - Requer projeto Node.js (package.json)
145
+
146
+ ---
147
+
148
+ [Voltar ao README](../README.md) | [create](./create.md) | [upgrade](./upgrade.md) | [migrate](./migrate.md)
package/docs/create.md ADDED
@@ -0,0 +1,219 @@
1
+ # nimbus create
2
+
3
+ Cria novo projeto com a stack nimbuslab.
4
+
5
+ ---
6
+
7
+ ## Uso
8
+
9
+ ```bash
10
+ nimbus create # Interativo
11
+ nimbus create meu-projeto # Com nome
12
+ nimbus create meu-projeto --landing # Landing page
13
+ nimbus create meu-projeto --app # Web app completo
14
+ nimbus create meu-projeto --turborepo # Monorepo
15
+ nimbus create meu-pacote --package # Pacote npm
16
+ ```
17
+
18
+ ---
19
+
20
+ ## Templates
21
+
22
+ ### Landing Page (`--landing`)
23
+
24
+ Stack minima para landing pages de alta conversao.
25
+
26
+ | Tecnologia | Versao |
27
+ |------------|--------|
28
+ | Next.js | 16+ |
29
+ | React | 19+ |
30
+ | Tailwind CSS | 4+ |
31
+ | shadcn/ui | latest |
32
+ | TypeScript | 5.7+ |
33
+
34
+ **Estrutura:**
35
+ ```
36
+ app/
37
+ ├── page.tsx # Home
38
+ ├── layout.tsx # Layout root
39
+ └── globals.css # Estilos globais
40
+ components/
41
+ ├── ui/ # shadcn/ui
42
+ ├── hero.tsx
43
+ ├── features.tsx
44
+ ├── cta.tsx
45
+ └── footer.tsx
46
+ ```
47
+
48
+ **Repo:** [create-next-landing](https://github.com/nimbuslab/create-next-landing)
49
+
50
+ ---
51
+
52
+ ### Web App (`--app`)
53
+
54
+ Landing + autenticacao + banco de dados.
55
+
56
+ | Tecnologia | Versao |
57
+ |------------|--------|
58
+ | Next.js | 16+ |
59
+ | React | 19+ |
60
+ | Tailwind CSS | 4+ |
61
+ | shadcn/ui | latest |
62
+ | Better Auth | latest |
63
+ | Drizzle ORM | latest |
64
+ | Docker | Compose |
65
+
66
+ **Estrutura:**
67
+ ```
68
+ app/
69
+ ├── (auth)/ # Rotas autenticacao
70
+ │ ├── login/
71
+ │ └── register/
72
+ ├── (dashboard)/ # Rotas protegidas
73
+ │ └── dashboard/
74
+ ├── api/ # API routes
75
+ └── page.tsx # Landing
76
+ components/
77
+ ├── ui/ # shadcn/ui
78
+ └── auth/ # Componentes auth
79
+ lib/
80
+ ├── auth.ts # Config Better Auth
81
+ └── db.ts # Config Drizzle
82
+ ```
83
+
84
+ **Repo:** [create-next-app](https://github.com/nimbuslab/create-next-app)
85
+
86
+ ---
87
+
88
+ ### Turborepo (`--turborepo`)
89
+
90
+ Monorepo com apps e packages compartilhados.
91
+
92
+ | Tecnologia | Uso |
93
+ |------------|-----|
94
+ | Turborepo | Build system |
95
+ | pnpm | Workspaces |
96
+ | TypeScript | Config compartilhada |
97
+ | ESLint | Config compartilhada |
98
+
99
+ **Estrutura:**
100
+ ```
101
+ apps/
102
+ ├── web/ # App principal
103
+ ├── docs/ # Documentacao
104
+ └── admin/ # Painel admin
105
+ packages/
106
+ ├── ui/ # Design system
107
+ ├── config/ # Configs (TS, ESLint)
108
+ └── utils/ # Utilitarios
109
+ ```
110
+
111
+ **Repo:** [create-turborepo](https://github.com/nimbuslab/create-turborepo)
112
+
113
+ ---
114
+
115
+ ### Pacote npm (`--package`)
116
+
117
+ Pacote npm pronto para publicar.
118
+
119
+ | Tecnologia | Uso |
120
+ |------------|-----|
121
+ | TypeScript | Linguagem |
122
+ | tsup | Build (ESM + CJS) |
123
+ | Bun | Runtime e testes |
124
+
125
+ **Estrutura:**
126
+ ```
127
+ meu-pacote/
128
+ ├── src/
129
+ │ └── index.ts # Entry point
130
+ ├── package.json # Configurado para npm
131
+ ├── tsconfig.json
132
+ ├── tsup.config.ts # Build config
133
+ ├── CHANGELOG.md
134
+ └── .github/
135
+ └── workflows/
136
+ └── publish.yml # CI/CD automatico
137
+ ```
138
+
139
+ **Documentacao completa:** [docs/package.md](./package.md)
140
+
141
+ ---
142
+
143
+ ## Opcoes
144
+
145
+ | Flag | Descricao |
146
+ |------|-----------|
147
+ | `-y, --yes` | Aceitar todos os padroes |
148
+ | `--no-git` | Nao inicializar repositorio Git |
149
+ | `--no-install` | Nao instalar dependencias |
150
+ | `--template <url>` | Usar template customizado |
151
+
152
+ ---
153
+
154
+ ## Fluxo Interativo
155
+
156
+ Quando executado sem flags, o CLI pergunta:
157
+
158
+ 1. **Nome do projeto** - Nome da pasta
159
+ 2. **Tipo de projeto** - landing, app ou turborepo
160
+ 3. **Tema** - dark, light ou system
161
+ 4. **Assistente IA** - Claude, Cursor, Gemini, Copilot, Windsurf
162
+ 5. **Criar repo GitHub?** - Se sim, busca orgs do usuario
163
+
164
+ ---
165
+
166
+ ## Exemplos
167
+
168
+ ### Criar landing page rapida
169
+
170
+ ```bash
171
+ nimbus create meu-site --landing -y
172
+ cd meu-site
173
+ bun dev
174
+ ```
175
+
176
+ ### Criar app com banco de dados
177
+
178
+ ```bash
179
+ nimbus create meu-app --app
180
+ cd meu-app
181
+ bun setup # Configura Docker + Drizzle
182
+ bun dev
183
+ ```
184
+
185
+ ### Criar monorepo
186
+
187
+ ```bash
188
+ nimbus create minha-empresa --turborepo
189
+ cd minha-empresa
190
+ turbo dev
191
+ ```
192
+
193
+ ---
194
+
195
+ ## Pos-criacao
196
+
197
+ ### Landing Page
198
+
199
+ ```bash
200
+ bun dev # Iniciar servidor
201
+ ```
202
+
203
+ ### Web App
204
+
205
+ ```bash
206
+ bun setup # Configurar ambiente (Docker, banco)
207
+ bun dev # Iniciar servidor
208
+ ```
209
+
210
+ ### Turborepo
211
+
212
+ ```bash
213
+ turbo dev # Iniciar todos os apps
214
+ turbo build # Build de producao
215
+ ```
216
+
217
+ ---
218
+
219
+ [Voltar ao README](../README.md) | [analyze](./analyze.md) | [upgrade](./upgrade.md) | [migrate](./migrate.md)
@@ -0,0 +1,177 @@
1
+ # nimbus migrate
2
+
3
+ Migra projetos de outras tecnologias para a stack nimbuslab usando Strangler Fig Pattern.
4
+
5
+ > **Status:** Em desenvolvimento - Veja [MIGRATION-ROADMAP.md](../MIGRATION-ROADMAP.md)
6
+
7
+ ## Uso
8
+
9
+ ```bash
10
+ # Ver plano de migracao
11
+ nimbus migrate --from=angular --plan
12
+
13
+ # Executar migracao (futuro)
14
+ nimbus migrate --execute
15
+
16
+ # Verificar resultado (futuro)
17
+ nimbus migrate --verify
18
+ ```
19
+
20
+ ## Strangler Fig Pattern
21
+
22
+ Padrao criado por Martin Fowler para migrar sistemas sem "big bang rewrite".
23
+
24
+ ### Como Funciona
25
+
26
+ ```
27
+ 1. Sistema Antigo (100% trafego)
28
+
29
+ 2. Criar facade/gateway
30
+
31
+ 3. Migrar primeira fatia (10% no novo)
32
+
33
+ 4. Aumentar gradualmente (50%, 80%, 100%)
34
+
35
+ 5. Aposentar sistema antigo
36
+ ```
37
+
38
+ ### Por que NAO fazer Big Bang?
39
+
40
+ | Big Bang | Strangler Fig |
41
+ |----------|---------------|
42
+ | Alto risco | Risco controlado |
43
+ | Tudo ou nada | Entregas continuas |
44
+ | Meses sem valor | Valor a cada sprint |
45
+ | Rollback impossivel | Rollback facil |
46
+
47
+ ## Tipos de Migracao
48
+
49
+ ### 1. Upgrade de Versao (Baixo Risco)
50
+
51
+ ```
52
+ Next.js 15 -> 16
53
+ React 18 -> 19
54
+ Tailwind 3 -> 4
55
+ ```
56
+
57
+ **Estrategia:** Codemods automaticos
58
+
59
+ ### 2. Mudanca de Stack (Medio Risco)
60
+
61
+ ```
62
+ pnpm -> bun
63
+ Prisma -> Drizzle
64
+ NextAuth -> Better Auth
65
+ ```
66
+
67
+ **Estrategia:** Dual write + feature flags
68
+
69
+ ### 3. Mudanca de Tecnologia (Alto Risco)
70
+
71
+ ```
72
+ Angular -> Next.js
73
+ PHP/Laravel -> Next.js
74
+ Vue -> React
75
+ ```
76
+
77
+ **Estrategia:** Strangler Fig completo
78
+
79
+ ### 4. Mudanca de Arquitetura (Muito Alto Risco)
80
+
81
+ ```
82
+ Monolito -> Microservices
83
+ Projeto solo -> Monorepo
84
+ ```
85
+
86
+ **Estrategia:** Strangler Fig + event sourcing
87
+
88
+ ## Padroes de Migracao
89
+
90
+ ### Feature Flag Migration
91
+
92
+ ```typescript
93
+ if (featureFlags.newCheckout) {
94
+ return <NewCheckout /> // Next.js
95
+ } else {
96
+ return <LegacyCheckout /> // Angular
97
+ }
98
+ ```
99
+
100
+ ### Dual Write
101
+
102
+ ```typescript
103
+ async function saveUser(data) {
104
+ await legacyDB.save(data) // Sistema antigo
105
+ await newDB.save(data) // Sistema novo
106
+ }
107
+ ```
108
+
109
+ ### API Gateway
110
+
111
+ ```
112
+ Cliente -> Gateway -> /api/v1/* -> Sistema Antigo
113
+ -> /api/v2/* -> Sistema Novo
114
+ ```
115
+
116
+ ## Checklist de Migracao
117
+
118
+ ### Pre-Migracao
119
+ - [ ] Inventario de features
120
+ - [ ] Mapa de dependencias
121
+ - [ ] Cobertura de testes
122
+ - [ ] Backup completo
123
+ - [ ] Branch de migracao
124
+ - [ ] CI/CD configurado
125
+ - [ ] Feature flags prontos
126
+
127
+ ### Durante (por fatia)
128
+ - [ ] Fatia isolada
129
+ - [ ] Testes primeiro
130
+ - [ ] Implementacao
131
+ - [ ] Code review
132
+ - [ ] Deploy staging
133
+ - [ ] Rollout gradual
134
+ - [ ] Monitoramento
135
+
136
+ ### Pos-Migracao
137
+ - [ ] Codigo antigo removido
138
+ - [ ] Docs atualizados
139
+ - [ ] Retrospectiva
140
+
141
+ ## Anti-Patterns
142
+
143
+ ### 1. Big Bang Rewrite
144
+ **Problema:** Meses sem entregar valor, risco total
145
+ **Solucao:** Strangler Fig
146
+
147
+ ### 2. Migracao sem Testes
148
+ **Problema:** Bugs em producao
149
+ **Solucao:** Testes antes de migrar
150
+
151
+ ### 3. Dual Write Infinito
152
+ **Problema:** Dois sistemas para sempre
153
+ **Solucao:** Prazo para aposentar
154
+
155
+ ### 4. Ignorar Dados
156
+ **Problema:** Inconsistencia
157
+ **Solucao:** Event sourcing
158
+
159
+ ## Roadmap
160
+
161
+ Veja [MIGRATION-ROADMAP.md](../MIGRATION-ROADMAP.md) para milestones detalhadas:
162
+
163
+ - **Fase 1:** Fundacao (analyze, upgrade)
164
+ - **Fase 2:** Codemods (Tailwind, React, Prisma)
165
+ - **Fase 3:** Templates modulares
166
+ - **Fase 4:** Migracao assistida
167
+ - **Fase 5:** Automacao completa
168
+
169
+ ## Referencias
170
+
171
+ - [Strangler Fig Pattern - Martin Fowler](https://martinfowler.com/bliki/StranglerFigApplication.html)
172
+ - [Codemods API Refactoring](https://martinfowler.com/articles/codemods-api-refactoring.html)
173
+ - [ThoughtWorks - Strangler Fig](https://www.thoughtworks.com/insights/articles/embracing-strangler-fig-pattern-legacy-modernization-part-one)
174
+
175
+ ---
176
+
177
+ [Voltar ao README](../README.md) | [create](./create.md) | [analyze](./analyze.md) | [upgrade](./upgrade.md)