@codigodoleo/wp-kit 4.0.0 β†’ 5.0.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.
@@ -1,5 +1,41 @@
1
+ /**
2
+ * Stack-agnostic context derivation. Derives only what we can know from
3
+ * existing prompts (git_provider, useSage, repository*); everything stack-
4
+ * specific (cloud, orchestrator, database, monitoring) lives in `{{TODO}}`
5
+ * placeholders inside the generated docs for the team to fill in.
6
+ */
7
+ function deriveDocContext(context) {
8
+ const isGitHub = context.gitProvider === 'github';
9
+ const isGitLab = context.gitProvider === 'gitlab';
10
+ const isBitbucket = context.gitProvider === 'bitbucket';
11
+
12
+ // Pull request terminology varies by provider; the docs reference it
13
+ // dozens of times so a single derived string keeps the templates clean.
14
+ const prTerm = isGitLab ? 'Merge Request (MR)' : 'Pull Request (PR)';
15
+ const prTermShort = isGitLab ? 'MR' : 'PR';
16
+ const ciSystem = isGitLab
17
+ ? 'GitLab CI/CD'
18
+ : isBitbucket
19
+ ? 'Bitbucket Pipelines'
20
+ : 'GitHub Actions';
21
+
22
+ return {
23
+ ...context,
24
+ isGitHub,
25
+ isGitLab,
26
+ isBitbucket,
27
+ prTerm,
28
+ prTermShort,
29
+ ciSystem,
30
+ };
31
+ }
32
+
1
33
  export async function setupModule(context, generator) {
2
- await generator.generateFile('README.md', context, 'docs');
34
+ const docContext = deriveDocContext(context);
35
+
36
+ // README.md lands at the docs/ entry point (not the project root README,
37
+ // which is generated by the kit core).
38
+ await generator.generateFile('README.md', docContext, 'docs', 'docs/README.md');
3
39
 
4
40
  const docFiles = [
5
41
  'Arquitetura.md',
@@ -12,7 +48,11 @@ export async function setupModule(context, generator) {
12
48
  'Troubleshooting.md',
13
49
  ];
14
50
 
51
+ // Bug fix: the previous implementation passed `file` as the 4th arg
52
+ // (outputName), which dumped every doc to the project root instead of
53
+ // inside docs/. Removing that arg restores the template path as the
54
+ // output path (docs/${file}).
15
55
  for (const file of docFiles) {
16
- await generator.generateFile(`docs/${file}`, context, 'docs', file);
56
+ await generator.generateFile(`docs/${file}`, docContext, 'docs');
17
57
  }
18
58
  }
@@ -1,160 +1,33 @@
1
- # 🏠 {{projectTitle}} WordPress Website
2
-
3
- Bem-vindo Γ  documentaΓ§Γ£o oficial do site **{{projectName}}.com** - um projeto WordPress robusto e moderno da {{projectTitle}}.
4
-
5
- ## 🎯 **Visão Geral**
6
-
7
- Este Γ© o repositΓ³rio principal do site institucional da {{projectTitle}}, construΓ­do com **WordPress** e uma infraestrutura cloud-native moderna. O projeto utiliza tecnologias de ponta para garantir performance, escalabilidade e facilidade de manutenΓ§Γ£o.
8
-
9
- ### πŸ“Š **Status do Projeto**
10
- - **VersΓ£o Atual**: `1.1.7` (2025-05-23)
11
- - **WordPress**: Customizado com tema {{projectTitle}} Theme
12
- - **Ambiente**: Multi-ambiente (Local, Development, Staging, Production)
13
- - **Deploy**: Automatizado via GitLab CI/CD + Kubernetes
14
-
15
- ## πŸš€ **Quick Start**
16
-
17
- ### PrΓ©-requisitos
18
- - [Lando](https://lando.dev/) (para desenvolvimento local)
19
- - [Docker](https://docker.com/)
20
- - [Git](https://git-scm.com/)
21
- - [Node.js](https://nodejs.org/) (versΓ£o especificada em `.nvmrc`)
22
-
23
- ### Setup RΓ‘pido
24
- ```bash
25
- # 1. Clone o repositΓ³rio
26
- git clone {{gitRepository}}
27
- cd {{projectName}}
28
-
29
- # 2. Inicie o ambiente local
30
- lando start
31
-
32
- # 3. Configure WordPress
33
- lando ssh -c "development/scripts/init-wp.sh --user=seu-email@{{projectName}}.com"
34
-
35
- # 4. Acesse o site
36
- # Frontend: https://{{projectDomain}}
37
- # Admin: https://{{projectDomain}}/wp-admin
38
- ```
39
-
40
- ## πŸ—οΈ **Arquitetura**
41
-
42
- ```
43
- β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
44
- β”‚ Local │────│ Development │────│ Staging │────│ Production β”‚
45
- β”‚ {{projectDomain}}β”‚ β”‚development-www β”‚ β”‚ staging-www β”‚ β”‚ {{projectProductionDomain}} β”‚
46
- β”‚ β”‚ β”‚ .{{projectName}}.com β”‚ β”‚ .{{projectName}}.com β”‚ β”‚ β”‚
47
- β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
48
- β”‚ β”‚ β”‚ β”‚
49
- β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
50
- β”‚ β”‚
51
- β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
52
- β”‚ GitLab CI/CD β”‚ β”‚ Kubernetes β”‚
53
- β”‚ Pipelines β”‚ β”‚ + CloudFlare β”‚
54
- β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
55
- ```
56
-
57
- ### πŸ› οΈ **Stack TecnolΓ³gico**
58
-
59
- | Categoria | Tecnologia |
60
- |-----------|------------|
61
- | **CMS** | WordPress (customizado) |
62
- | **Tema** | {{projectTitle}} Theme (custom theme) |
63
- | **Frontend** | PHP, JavaScript, Sass, Gutenberg Blocks |
64
- | **ContainerizaΓ§Γ£o** | Docker, Lando |
65
- | **OrquestraΓ§Γ£o** | Kubernetes, Helm |
66
- | **CI/CD** | GitLab CI/CD |
67
- | **Infraestrutura** | Terraform, OCI (Oracle Cloud) |
68
- | **CDN/DNS** | CloudFlare |
69
- | **Monitoramento** | Custom health checks |
70
-
71
- ## πŸ“ **Estrutura do Projeto**
72
-
73
- ```
74
- {{projectName}}/
75
- β”œβ”€β”€ πŸ“‚ dist/ # WordPress core + customizaΓ§Γ΅es
76
- β”‚ └── πŸ“‚ wp-content/
77
- β”‚ β”œβ”€β”€ πŸ“‚ themes/{{projectThemeSlug}}/ # Tema principal
78
- β”‚ β”œβ”€β”€ πŸ“‚ plugins/ # Plugins WordPress
79
- β”‚ └── πŸ“‚ mu-plugins/ # Must-use plugins
80
- β”œβ”€β”€ πŸ“‚ development/ # Scripts e config. desenvolvimento
81
- β”œβ”€β”€ πŸ“‚ helm/ # Charts Kubernetes
82
- β”œβ”€β”€ πŸ“‚ k8s/ # Manifests Kubernetes
83
- β”œβ”€β”€ πŸ“‚ terraform/ # Infraestrutura como cΓ³digo
84
- β”œβ”€β”€ πŸ“‚ .gitlab/ # Templates GitLab CI/CD
85
- β”œβ”€β”€ πŸ“„ .lando.yml # ConfiguraΓ§Γ£o ambiente local
86
- β”œβ”€β”€ πŸ“„ .gitlab-ci.yml # Pipeline CI/CD
87
- └── πŸ“„ CHANGELOG.md # HistΓ³rico de mudanΓ§as
88
- ```
89
-
90
- ## 🌍 **Ambientes**
91
-
92
- | Ambiente | URL | Branch | Namespace K8s | Finalidade |
93
- |----------|-----|--------|---------------|------------|
94
- | **Local** | `{{projectDomain}}` | `feature/*` | - | Desenvolvimento local |
95
- | **Development** | `{{projectDevDomain}}` | `development` | `website-dev` | Testes contΓ­nuos |
96
- | **Staging** | `{{projectStagingDomain}}` | `staging` | `website-stg` | HomologaΓ§Γ£o |
97
- | **Production** | `{{projectProductionDomain}}` | `master` | `website-prod` | Site oficial |
98
-
99
- ## πŸ”„ **Workflow de Desenvolvimento**
100
-
101
- ```mermaid
102
- graph LR
103
- A[Feature Branch] --> B[Pull Request]
104
- B --> C[Code Review]
105
- C --> D[Merge to Development]
106
- D --> E["πŸš€ {{projectDevDomain}}"]
107
- E --> F[Merge to Staging]
108
- F --> G["πŸ” {{projectStagingDomain}}"]
109
- G --> H[Tests + QA]
110
- H --> I[Merge to Master]
111
- I --> J["βœ… {{projectProductionDomain}}"]
112
- ```
113
-
114
- ## πŸ“š **DocumentaΓ§Γ£o Principal**
115
-
116
- ### πŸš€ **Para Desenvolvedores**
117
- - [Getting Started](Getting-Started) - Setup completo do ambiente
118
- - [Arquitetura](Arquitetura) - Estrutura tΓ©cnica detalhada
119
- - [Desenvolvimento](Desenvolvimento) - Guias de desenvolvimento
120
- - [Deploy Pipeline](Deploy-Pipeline) - Processo de deploy
121
-
122
- ### πŸ”§ **Para DevOps**
123
- - [Infraestrutura](Infraestrutura) - Kubernetes, Terraform, AWS
124
- - [Monitoramento](Monitoramento) - Health checks e observabilidade
125
- - [Troubleshooting](Troubleshooting) - ResoluΓ§Γ£o de problemas
126
-
127
- ### πŸ“¦ **Para GestΓ£o**
128
- - [Plugins & IntegraΓ§Γ΅es](Plugins-Integracoes) - Componentes externos
129
- - [Changelog]({{repositoryWebUrl}}/-/blob/master/CHANGELOG.md) - HistΓ³rico de versΓ΅es
130
- - [CODEOWNERS]({{repositoryWebUrl}}/-/blob/master/CODEOWNERS) - Responsabilidades
131
-
132
- ## πŸ†˜ **Precisa de Ajuda?**
133
-
134
- ### πŸ› **Problemas Comuns**
135
- - [Troubleshooting](Troubleshooting) - Guia de resoluΓ§Γ£o
136
- - [FAQ](FAQ) - Perguntas frequentes
137
-
138
- ### πŸ“ž **Contatos**
139
- - **Equipe**: @Approvers (conforme [CODEOWNERS]({{repositoryWebUrl}}/-/blob/master/CODEOWNERS))
140
- - **Issues**: [GitLab Issues]({{repositoryWebUrl}}/-/issues)
141
- - **{{projectTitle}} Cards**: Vinculados no [CHANGELOG.md]({{repositoryWebUrl}}/-/blob/master/CHANGELOG.md)
142
-
143
- ## 🎯 **Links Importantes**
144
-
145
- | Recurso | Link | Ambiente |
146
- |---------|------|----------|
147
- | **Site ProduΓ§Γ£o** | [{{projectProductionDomain}}](https://{{projectProductionDomain}}) | πŸ”΄ Production |
148
- | **Site Staging** | [{{projectStagingDomain}}](https://{{projectStagingDomain}}) | 🟑 Staging |
149
- | **Site Development** | [{{projectDevDomain}}](https://{{projectDevDomain}}) | 🟠 Development |
150
- | **Site Local** | [{{projectDomain}}](https://{{projectDomain}}) | πŸ”΅ Local |
151
- | **GitLab Project** | [{{repositoryPath}}]({{repositoryWebUrl}}) | - |
152
- | **CI/CD Pipelines** | [Pipelines]({{repositoryWebUrl}}/-/pipelines) | - |
153
- | **Kubernetes Dashboards** | *[Links internos conforme ambiente]* | - |
154
-
155
- ---
156
-
157
- πŸ“ **Última atualizaΓ§Γ£o**: Junho 2025
158
- πŸ”„ **VersΓ£o da documentaΓ§Γ£o**: 1.1
159
- ✨ **Criado com**: AnÑlise automatizada do projeto + GitHub Copilot
160
- 🌐 **Ambientes atualizados**: Local, Development, Staging, Production
1
+ # {{projectTitle}} β€” Documentation
2
+
3
+ Project documentation lives in this directory. Each file is a starting
4
+ point β€” fill in stack-specific details (cloud provider, orchestrator,
5
+ monitoring tools) as your infrastructure decisions get made.
6
+
7
+ ## Index
8
+
9
+ | Document | Purpose |
10
+ | --- | --- |
11
+ | [Getting-Started](./Getting-Started.md) | Local environment setup |
12
+ | [Desenvolvimento](./Desenvolvimento.md) | Workflow, branching, commit hygiene |
13
+ | [Arquitetura](./Arquitetura.md) | High-level technical architecture |
14
+ | [Infraestrutura](./Infraestrutura.md) | Cloud / network / runtime topology |
15
+ | [Deploy-Pipeline](./Deploy-Pipeline.md) | CI/CD flow and environments |
16
+ | [Monitoramento](./Monitoramento.md) | Observability stack and alerts |
17
+ | [Sync-the-Production-DB-with-the-Staging-DB](./Sync-the-Production-DB-with-the-Staging-DB.md) | Database refresh procedure |
18
+ | [Troubleshooting](./Troubleshooting.md) | Common issues and recovery steps |
19
+
20
+ ## Conventions
21
+
22
+ - **TODO markers** (`{{ "{{TODO: …}}" }}`) flag sections that depend on stack
23
+ decisions this scaffold can't make for you. Replace them as decisions
24
+ are finalised.
25
+ - Diagrams use [Mermaid](https://mermaid.js.org/) so they render inline
26
+ in GitHub, GitLab, and most static-site generators.
27
+ - Keep this index up to date when adding new docs.
28
+
29
+ ## Quick links
30
+
31
+ - Repository: [{{repositoryPath}}]({{repositoryWebUrl}})
32
+ - Local dev: see [Getting-Started](./Getting-Started.md)
33
+ - CI/CD: {{ciSystem}} β€” see [Deploy-Pipeline](./Deploy-Pipeline.md)