@codigodoleo/wp-kit 4.0.0 β 5.0.1
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/modules/docs/index.js +42 -2
- package/modules/docs/templates/README.md.hbs +33 -160
- package/modules/docs/templates/docs/Arquitetura.md.hbs +74 -388
- package/modules/docs/templates/docs/Deploy-Pipeline.md.hbs +60 -102
- package/modules/docs/templates/docs/Desenvolvimento.md.hbs +87 -1099
- package/modules/docs/templates/docs/Getting-Started.md.hbs +50 -490
- package/modules/docs/templates/docs/Infraestrutura.md.hbs +45 -220
- package/modules/docs/templates/docs/Monitoramento.md.hbs +39 -322
- package/modules/docs/templates/docs/Sync-the-Production-DB-with-the-Staging-DB.md.hbs +68 -7
- package/modules/docs/templates/docs/Troubleshooting.md.hbs +64 -2
- package/modules/mu-plugin/index.js +5 -5
- package/modules/mu-plugin/prompts.js +1 -1
- package/package.json +1 -1
package/modules/docs/index.js
CHANGED
|
@@ -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
|
-
|
|
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}`,
|
|
56
|
+
await generator.generateFile(`docs/${file}`, docContext, 'docs');
|
|
17
57
|
}
|
|
18
58
|
}
|
|
@@ -1,160 +1,33 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
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)
|