@nimbuslab/cli 0.9.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.
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)
@@ -0,0 +1,229 @@
1
+ # nimbus create --package
2
+
3
+ Cria um pacote npm pronto para publicar.
4
+
5
+ ---
6
+
7
+ ## Uso
8
+
9
+ ```bash
10
+ nimbus create meu-pacote --package
11
+ ```
12
+
13
+ ---
14
+
15
+ ## Estrutura gerada
16
+
17
+ ```
18
+ meu-pacote/
19
+ ├── src/
20
+ │ └── index.ts # Entry point
21
+ ├── dist/ # Build output (gitignored)
22
+ ├── package.json # Configurado para npm
23
+ ├── tsconfig.json # TypeScript config
24
+ ├── tsup.config.ts # Build config
25
+ ├── README.md # Documentacao
26
+ ├── CHANGELOG.md # Historico de versoes
27
+ ├── LICENSE # MIT
28
+ └── .github/
29
+ └── workflows/
30
+ └── publish.yml # CI/CD para npm
31
+ ```
32
+
33
+ ---
34
+
35
+ ## package.json
36
+
37
+ ```json
38
+ {
39
+ "name": "@nimbuslab/meu-pacote",
40
+ "version": "0.1.0",
41
+ "type": "module",
42
+ "main": "./dist/index.js",
43
+ "module": "./dist/index.mjs",
44
+ "types": "./dist/index.d.ts",
45
+ "exports": {
46
+ ".": {
47
+ "import": "./dist/index.mjs",
48
+ "require": "./dist/index.js",
49
+ "types": "./dist/index.d.ts"
50
+ }
51
+ },
52
+ "files": ["dist"],
53
+ "scripts": {
54
+ "build": "tsup",
55
+ "dev": "tsup --watch",
56
+ "prepublishOnly": "bun run build"
57
+ }
58
+ }
59
+ ```
60
+
61
+ ---
62
+
63
+ ## Build com tsup
64
+
65
+ O template usa [tsup](https://tsup.egoist.dev/) para build:
66
+
67
+ ```typescript
68
+ // tsup.config.ts
69
+ import { defineConfig } from "tsup"
70
+
71
+ export default defineConfig({
72
+ entry: ["src/index.ts"],
73
+ format: ["cjs", "esm"],
74
+ dts: true,
75
+ clean: true,
76
+ minify: true,
77
+ })
78
+ ```
79
+
80
+ **Por que tsup?**
81
+ - Zero config
82
+ - ESM + CJS em um comando
83
+ - TypeScript declarations automaticas
84
+ - Rapido (usa esbuild)
85
+
86
+ ---
87
+
88
+ ## Workflow de desenvolvimento
89
+
90
+ ### 1. Desenvolver
91
+
92
+ ```bash
93
+ cd meu-pacote
94
+ bun run dev # Watch mode
95
+ ```
96
+
97
+ ### 2. Testar localmente
98
+
99
+ ```bash
100
+ # Em outro projeto
101
+ bun add ../meu-pacote
102
+
103
+ # Ou com link
104
+ cd meu-pacote && bun link
105
+ cd outro-projeto && bun link @nimbuslab/meu-pacote
106
+ ```
107
+
108
+ ### 3. Build
109
+
110
+ ```bash
111
+ bun run build
112
+ ```
113
+
114
+ ### 4. Publicar
115
+
116
+ ```bash
117
+ # Bump version
118
+ npm version patch # 0.1.0 -> 0.1.1
119
+ npm version minor # 0.1.0 -> 0.2.0
120
+ npm version major # 0.1.0 -> 1.0.0
121
+
122
+ # Publicar
123
+ npm publish --access public
124
+ ```
125
+
126
+ ---
127
+
128
+ ## CI/CD automatico
129
+
130
+ O template inclui GitHub Action para publicar automaticamente:
131
+
132
+ ```yaml
133
+ # .github/workflows/publish.yml
134
+ name: Publish
135
+
136
+ on:
137
+ push:
138
+ tags:
139
+ - "v*"
140
+
141
+ jobs:
142
+ publish:
143
+ runs-on: ubuntu-latest
144
+ steps:
145
+ - uses: actions/checkout@v4
146
+ - uses: oven-sh/setup-bun@v1
147
+ - run: bun install
148
+ - run: bun run build
149
+ - run: npm publish --access public
150
+ env:
151
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
152
+ ```
153
+
154
+ **Para usar:**
155
+ 1. Criar token em npmjs.com
156
+ 2. Adicionar `NPM_TOKEN` nos secrets do repo
157
+ 3. Criar tag: `git tag v0.1.0 && git push --tags`
158
+
159
+ ---
160
+
161
+ ## Escopo @nimbuslab
162
+
163
+ Para publicar no escopo `@nimbuslab`:
164
+
165
+ ```bash
166
+ # Primeira vez: logar no npm
167
+ npm login
168
+
169
+ # Verificar organizacao
170
+ npm org ls nimbuslab
171
+ ```
172
+
173
+ **Nota:** Pacotes com escopo precisam de `--access public` para serem publicos.
174
+
175
+ ---
176
+
177
+ ## Boas praticas
178
+
179
+ ### Versionamento (SemVer)
180
+
181
+ | Tipo | Quando usar | Exemplo |
182
+ |------|-------------|---------|
183
+ | `patch` | Bug fixes | 0.1.0 -> 0.1.1 |
184
+ | `minor` | Novas features (retrocompativeis) | 0.1.0 -> 0.2.0 |
185
+ | `major` | Breaking changes | 0.1.0 -> 1.0.0 |
186
+
187
+ ### CHANGELOG
188
+
189
+ Manter atualizado com cada release:
190
+
191
+ ```markdown
192
+ # Changelog
193
+
194
+ ## [0.2.0] - 2026-01-28
195
+
196
+ ### Added
197
+ - Nova funcionalidade X
198
+
199
+ ### Fixed
200
+ - Bug Y corrigido
201
+
202
+ ## [0.1.0] - 2026-01-27
203
+
204
+ - Release inicial
205
+ ```
206
+
207
+ ### README
208
+
209
+ Incluir:
210
+ - O que o pacote faz
211
+ - Como instalar
212
+ - Como usar (exemplos)
213
+ - API reference
214
+ - License
215
+
216
+ ---
217
+
218
+ ## Exemplos de pacotes
219
+
220
+ | Pacote | Descricao |
221
+ |--------|-----------|
222
+ | `@nimbuslab/cli` | CLI oficial |
223
+ | `@nimbuslab/utils` | Utilitarios compartilhados |
224
+ | `@nimbuslab/ui` | Design system |
225
+ | `@nimbuslab/config` | Configs compartilhadas |
226
+
227
+ ---
228
+
229
+ [Voltar ao README](../README.md) | [create](./create.md) | [analyze](./analyze.md)