@codigodoleo/wp-kit 1.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.
- package/.cspell.json +104 -0
- package/.editorconfig +13 -0
- package/.eslintignore +3 -0
- package/.eslintrc.json +24 -0
- package/.github/workflows/publish-npm.yml +32 -0
- package/.github/workflows/release-please.yml +25 -0
- package/.gitkeep +0 -0
- package/.husky/_/post-merge +0 -0
- package/.prettierignore +4 -0
- package/.prettierrc +8 -0
- package/.vscode/settings.json +19 -0
- package/CHANGELOG.md +47 -0
- package/README.md +115 -0
- package/VSCODE_EXTENSIONS.md +11 -0
- package/bin/index.js +4 -0
- package/docs/HOOKS-SYSTEM.md +172 -0
- package/git-deploy.sh +74 -0
- package/index.php +17 -0
- package/lib/cli.js +15 -0
- package/lib/commands/init.js +132 -0
- package/lib/core/generator.js +261 -0
- package/lib/core/hook-manager.js +172 -0
- package/lib/core/infer-ci-capabilities.js +119 -0
- package/lib/prompts/index.js +105 -0
- package/lib/prompts/loadModulePrompts.js +27 -0
- package/lib/utils/generate-from-template.js +17 -0
- package/lib/utils/git.js +17 -0
- package/lib/utils/logger.js +28 -0
- package/modules/deploy/index.js +39 -0
- package/modules/deploy/prompts.js +27 -0
- package/modules/deploy/templates/.github/workflows/ci.yml.hbs +103 -0
- package/modules/deploy/templates/.gitlab/gitlab-ci.yml.hbs +154 -0
- package/modules/deploy/templates/bitbucket-pipelines.yml.hbs +97 -0
- package/modules/docs/index.js +3 -0
- package/modules/docs/prompts.js +8 -0
- package/modules/docs/templates/README.md.hbs +160 -0
- package/modules/docs/templates/docs/Arquitetura.md +399 -0
- package/modules/docs/templates/docs/Deploy-Pipeline.md +113 -0
- package/modules/docs/templates/docs/Desenvolvimento.md +1116 -0
- package/modules/docs/templates/docs/Getting-Started.md +493 -0
- package/modules/docs/templates/docs/Infraestrutura.md +211 -0
- package/modules/docs/templates/docs/Monitoramento.md +302 -0
- package/modules/docs/templates/docs/Sync-the-Production-DB-with-the-Staging-DB.md +8 -0
- package/modules/docs/templates/docs/Troubleshooting.md +3 -0
- package/modules/git/.commitlintrc.json +136 -0
- package/modules/git/.github/PULL_REQUEST_TEMPLATE.md +42 -0
- package/modules/git/.gitlab/merge_request_templates/default.md +42 -0
- package/modules/git/.gitmessage +29 -0
- package/modules/git/.husky/commit-msg +4 -0
- package/modules/git/.husky/pre-commit +27 -0
- package/modules/git/.lintstagedrc.json +7 -0
- package/modules/git/.vscode/commit-instructions.md +59 -0
- package/modules/git/.vscode/conventional-commits.code-snippets +62 -0
- package/modules/git/.vscode/copilot.json +39 -0
- package/modules/git/docs/CONVENTIONAL-COMMITS.md +131 -0
- package/modules/git/index.js +137 -0
- package/modules/git/prompts.js +23 -0
- package/modules/git/templates/.lando.yml.hbs +13 -0
- package/modules/git/templates/package.json.hbs +15 -0
- package/modules/git/templates/workspace.json.hbs +114 -0
- package/modules/lint/.eslintignore +36 -0
- package/modules/lint/.eslintrc.json +8 -0
- package/modules/lint/.prettierignore +36 -0
- package/modules/lint/.prettierrc.json +29 -0
- package/modules/lint/.stylelintignore +19 -0
- package/modules/lint/.stylelintrc.json +9 -0
- package/modules/lint/index.js +15 -0
- package/modules/lint/pint.json +26 -0
- package/modules/lint/prompts.js +16 -0
- package/modules/lint/templates/.lando.yml.hbs +10 -0
- package/modules/lint/templates/package.json.hbs +16 -0
- package/modules/lint/templates/workspace.json.hbs +56 -0
- package/modules/php/index.js +3 -0
- package/modules/php/prompts.js +8 -0
- package/modules/php/scripts/php-wrapper.sh +38 -0
- package/modules/php/scripts/pint-wrapper.sh +44 -0
- package/modules/php/templates/.lando.yml.hbs +11 -0
- package/modules/php/templates/composer.json.hbs +6 -0
- package/modules/php/templates/workspace.json.hbs +74 -0
- package/modules/redis/prompts.js +8 -0
- package/modules/redis/templates/.lando.yml.hbs +8 -0
- package/modules/sage/index.js +20 -0
- package/modules/sage/prompts.js +16 -0
- package/modules/sage/templates/.lando.yml.hbs +64 -0
- package/modules/sage/templates/theme/composer.json.hbs +18 -0
- package/modules/sage/templates/theme/package.json.hbs +11 -0
- package/modules/sage/templates/theme/style.css.hbs +13 -0
- package/modules/sage/templates/theme/vite.config.js.hbs +53 -0
- package/modules/sage/templates/workspace.json.hbs +67 -0
- package/modules/test-directory/assets/module-file.txt +1 -0
- package/modules/test-directory/index.js +19 -0
- package/modules/test-directory/prompts.js +8 -0
- package/modules/test-directory/test-assets/file1.txt +1 -0
- package/modules/test-directory/test-assets/file2.txt +1 -0
- package/modules/test-directory/test-assets/subfolder/config.json +4 -0
- package/package.json +54 -0
- package/release-please-config.json +17 -0
- package/server/php/php.ini +48 -0
- package/server/www/rocket.conf +283 -0
- package/templates/.editorconfig.hbs +39 -0
- package/templates/.env.hbs +48 -0
- package/templates/.gitignore.hbs +86 -0
- package/templates/.lando.yml.hbs +44 -0
- package/templates/README.md.hbs +12 -0
- package/templates/composer.json.hbs +60 -0
- package/templates/package.json.hbs +47 -0
- package/templates/server/cmd/install-wp.sh.hbs +58 -0
- package/templates/server/www/vhosts.conf.hbs +71 -0
- package/templates/workspace.json.hbs +177 -0
- package/test-copy-directory.js +43 -0
- package/test-overwrite.js +45 -0
- package/wp-config.php +190 -0
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
{
|
|
2
|
+
"Conventional Commit - feat": {
|
|
3
|
+
"prefix": "cc-feat",
|
|
4
|
+
"body": [
|
|
5
|
+
"feat($1): $2",
|
|
6
|
+
"",
|
|
7
|
+
"$3",
|
|
8
|
+
"",
|
|
9
|
+
"$4"
|
|
10
|
+
],
|
|
11
|
+
"description": "Template for new feature"
|
|
12
|
+
},
|
|
13
|
+
"Conventional Commit - fix": {
|
|
14
|
+
"prefix": "cc-fix",
|
|
15
|
+
"body": [
|
|
16
|
+
"fix($1): $2",
|
|
17
|
+
"",
|
|
18
|
+
"$3",
|
|
19
|
+
"",
|
|
20
|
+
"Fixes #$4"
|
|
21
|
+
],
|
|
22
|
+
"description": "Template for bug fix"
|
|
23
|
+
},
|
|
24
|
+
"Conventional Commit - docs": {
|
|
25
|
+
"prefix": "cc-docs",
|
|
26
|
+
"body": [
|
|
27
|
+
"docs($1): $2",
|
|
28
|
+
"",
|
|
29
|
+
"$3"
|
|
30
|
+
],
|
|
31
|
+
"description": "Template for documentation"
|
|
32
|
+
},
|
|
33
|
+
"Conventional Commit - refactor": {
|
|
34
|
+
"prefix": "cc-refactor",
|
|
35
|
+
"body": [
|
|
36
|
+
"refactor($1): $2",
|
|
37
|
+
"",
|
|
38
|
+
"$3"
|
|
39
|
+
],
|
|
40
|
+
"description": "Template for refactoring"
|
|
41
|
+
},
|
|
42
|
+
"Conventional Commit - chore": {
|
|
43
|
+
"prefix": "cc-chore",
|
|
44
|
+
"body": [
|
|
45
|
+
"chore($1): $2",
|
|
46
|
+
"",
|
|
47
|
+
"$3"
|
|
48
|
+
],
|
|
49
|
+
"description": "Template for maintenance tasks"
|
|
50
|
+
},
|
|
51
|
+
"Conventional Commit - breaking change": {
|
|
52
|
+
"prefix": "cc-breaking",
|
|
53
|
+
"body": [
|
|
54
|
+
"$1($2): $3",
|
|
55
|
+
"",
|
|
56
|
+
"BREAKING CHANGE: $4",
|
|
57
|
+
"",
|
|
58
|
+
"$5"
|
|
59
|
+
],
|
|
60
|
+
"description": "Template for breaking change"
|
|
61
|
+
}
|
|
62
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"commitMessage": {
|
|
3
|
+
"format": "conventional",
|
|
4
|
+
"template": "<type>(<scope>): <description>\n\n<body>\n\n<footer>",
|
|
5
|
+
"rules": {
|
|
6
|
+
"maxLength": 72,
|
|
7
|
+
"types": [
|
|
8
|
+
"feat",
|
|
9
|
+
"fix",
|
|
10
|
+
"docs",
|
|
11
|
+
"style",
|
|
12
|
+
"refactor",
|
|
13
|
+
"perf",
|
|
14
|
+
"test",
|
|
15
|
+
"chore",
|
|
16
|
+
"ci",
|
|
17
|
+
"build",
|
|
18
|
+
"revert",
|
|
19
|
+
"hotfix",
|
|
20
|
+
"release"
|
|
21
|
+
],
|
|
22
|
+
"imperative": true,
|
|
23
|
+
"lowercase": true,
|
|
24
|
+
"noEndingDot": true
|
|
25
|
+
},
|
|
26
|
+
"examples": [
|
|
27
|
+
"feat(auth): add login functionality",
|
|
28
|
+
"fix(ui): resolve button alignment issue",
|
|
29
|
+
"docs(readme): update installation instructions",
|
|
30
|
+
"style(css): format spacing in header component",
|
|
31
|
+
"refactor(api): optimize database queries",
|
|
32
|
+
"perf(images): compress and lazy load thumbnails",
|
|
33
|
+
"test(auth): add unit tests for login validation",
|
|
34
|
+
"chore(deps): update npm dependencies",
|
|
35
|
+
"ci(github): add automated testing workflow",
|
|
36
|
+
"build(webpack): optimize bundle size configuration"
|
|
37
|
+
]
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
# Conventional Commits Guide
|
|
2
|
+
|
|
3
|
+
## How to Use in Your IDE
|
|
4
|
+
|
|
5
|
+
### 1. Recommended VS Code Extensions
|
|
6
|
+
|
|
7
|
+
Install the recommended extensions that will appear automatically:
|
|
8
|
+
|
|
9
|
+
* **Conventional Commits**: Assistant to help you create commits following the standard
|
|
10
|
+
* **GitLens**: Advanced Git visualization
|
|
11
|
+
* **Git Graph**: Graphical history view
|
|
12
|
+
|
|
13
|
+
### 2. Ways to Make Commits
|
|
14
|
+
|
|
15
|
+
#### Option 1: Via Integrated Command
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npm run commit
|
|
19
|
+
# or
|
|
20
|
+
lando git-cz
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
#### Option 2: Via Conventional Commits Extension
|
|
24
|
+
|
|
25
|
+
1. Open the Command Palette (`Ctrl+Shift+P`)
|
|
26
|
+
2. Type "Conventional Commits"
|
|
27
|
+
3. Follow the interactive assistant
|
|
28
|
+
|
|
29
|
+
#### Option 3: Via Terminal with Template
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
git commit
|
|
33
|
+
# The .gitmessage template will be loaded automatically
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
#### Option 4: Via VS Code Snippets
|
|
37
|
+
|
|
38
|
+
* Type `cc-feat` + Tab for a new feature
|
|
39
|
+
* Type `cc-fix` + Tab for a bug fix
|
|
40
|
+
* Type `cc-docs` + Tab for documentation
|
|
41
|
+
* And so on...
|
|
42
|
+
|
|
43
|
+
### 3. Available Commit Types
|
|
44
|
+
|
|
45
|
+
| Type | Description | Example |
|
|
46
|
+
| ---------- | ----------------------- | -------------------------------------- |
|
|
47
|
+
| `feat` | New feature | `feat(auth): add social login` |
|
|
48
|
+
| `fix` | Bug fix | `fix(api): fix timeout error` |
|
|
49
|
+
| `docs` | Documentation | `docs(readme): update install steps` |
|
|
50
|
+
| `style` | Code style changes | `style(css): fix indentation` |
|
|
51
|
+
| `refactor` | Code refactoring | `refactor(utils): simplify validation` |
|
|
52
|
+
| `perf` | Performance improvement | `perf(db): optimize user query` |
|
|
53
|
+
| `test` | Tests | `test(auth): add integration tests` |
|
|
54
|
+
| `chore` | Maintenance tasks | `chore(deps): update dependencies` |
|
|
55
|
+
| `ci` | CI/CD configuration | `ci(github): add deploy workflow` |
|
|
56
|
+
| `build` | Build-related changes | `build(webpack): update config` |
|
|
57
|
+
|
|
58
|
+
### 4. Commit Message Structure
|
|
59
|
+
|
|
60
|
+
```
|
|
61
|
+
<type>(<scope>): <description>
|
|
62
|
+
|
|
63
|
+
<optional body>
|
|
64
|
+
|
|
65
|
+
<optional footer>
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
**Full Example:**
|
|
69
|
+
|
|
70
|
+
```
|
|
71
|
+
feat(user-profile): add custom avatar
|
|
72
|
+
|
|
73
|
+
Allows users to upload a custom image
|
|
74
|
+
to use as a profile avatar.
|
|
75
|
+
|
|
76
|
+
Closes #123
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### 5. Breaking Changes
|
|
80
|
+
|
|
81
|
+
For changes that break backward compatibility:
|
|
82
|
+
|
|
83
|
+
```
|
|
84
|
+
feat(api): change API response structure
|
|
85
|
+
|
|
86
|
+
BREAKING CHANGE: The API now returns
|
|
87
|
+
an object with data instead of a direct array.
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### 6. Automatic Validation
|
|
91
|
+
|
|
92
|
+
The project is set up with:
|
|
93
|
+
|
|
94
|
+
* ✅ **Husky**: Git hooks
|
|
95
|
+
* ✅ **CommitLint**: Commit message validation
|
|
96
|
+
* ✅ **Lint-staged**: Linting only modified files
|
|
97
|
+
|
|
98
|
+
### 7. Useful Commands
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
# Interactive commit
|
|
102
|
+
npm run commit
|
|
103
|
+
|
|
104
|
+
# Check last commit message
|
|
105
|
+
lando commitlint-check
|
|
106
|
+
|
|
107
|
+
# Generate changelog
|
|
108
|
+
lando conventional-changelog
|
|
109
|
+
|
|
110
|
+
# Create release
|
|
111
|
+
npm run release
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### 8. VS Code Configuration
|
|
115
|
+
|
|
116
|
+
Settings are located in `.vscode/settings.json`:
|
|
117
|
+
|
|
118
|
+
* Message validation enabled
|
|
119
|
+
* Predefined scopes for the project
|
|
120
|
+
* Character limit configured
|
|
121
|
+
* Integrated terminal setup
|
|
122
|
+
|
|
123
|
+
## Key Tips
|
|
124
|
+
|
|
125
|
+
1. **Use the imperative mood**: "add", not "added"
|
|
126
|
+
2. **Be concise**: First line max 72 characters
|
|
127
|
+
3. **Use consistent scopes**: core, theme, plugins, config, etc.
|
|
128
|
+
4. **Reference issues**: Use "Closes #123" or "Fixes #123"
|
|
129
|
+
5. **Breaking changes**: Always document in the footer
|
|
130
|
+
|
|
131
|
+
---
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import path from 'path';
|
|
2
|
+
import fs from 'fs-extra';
|
|
3
|
+
import { log, color } from '../../lib/utils/logger.js';
|
|
4
|
+
import { execSync } from 'child_process';
|
|
5
|
+
|
|
6
|
+
export async function setupModule(context, generator) {
|
|
7
|
+
|
|
8
|
+
const gitDir = path.join(generator.cwd, '.git');
|
|
9
|
+
|
|
10
|
+
const gitProviderHandlers = {
|
|
11
|
+
github: async () => {
|
|
12
|
+
await generator.copyFile('.github/PULL_REQUEST_TEMPLATE.md', 'git');
|
|
13
|
+
},
|
|
14
|
+
gitlab: async () => {
|
|
15
|
+
await generator.copyFile('.gitlab/merge_request_templates/default.md', 'git');
|
|
16
|
+
},
|
|
17
|
+
bitbucket: async () => {
|
|
18
|
+
// await generator.copyFile('.bitbucket/PULL_REQUEST_TEMPLATE.md', '.bitbucket/PULL_REQUEST_TEMPLATE.md', 'git');
|
|
19
|
+
},
|
|
20
|
+
custom: async () => {
|
|
21
|
+
// await generator.copyFile('.custom/PULL_REQUEST_TEMPLATE.md', '.custom/PULL_REQUEST_TEMPLATE.md', 'git');
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
if (!await fs.pathExists(gitDir)) {
|
|
26
|
+
log(color.orange, '[git] Initializing Git repository');
|
|
27
|
+
execSync('git init', { cwd: generator.cwd, stdio: 'ignore' });
|
|
28
|
+
await generator.copyFile('.gitmessage', 'git');
|
|
29
|
+
|
|
30
|
+
if (context.defaultBranch && context.defaultBranch !== 'main') {
|
|
31
|
+
try {
|
|
32
|
+
execSync(`git branch -M ${context.defaultBranch}`, {
|
|
33
|
+
cwd: generator.cwd,
|
|
34
|
+
stdio: 'ignore'
|
|
35
|
+
});
|
|
36
|
+
log(color.green, `[git] Default branch set to: ${context.defaultBranch}`);
|
|
37
|
+
} catch (error) {
|
|
38
|
+
log(color.yellow, '[git] Warning: Could not rename default branch');
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const gitConfigs = [
|
|
43
|
+
['core.autocrlf', 'input'],
|
|
44
|
+
['core.eol', 'lf'],
|
|
45
|
+
['core.filemode', 'false'],
|
|
46
|
+
['pull.rebase', 'false'],
|
|
47
|
+
['init.defaultBranch', context.defaultBranch || 'main']
|
|
48
|
+
];
|
|
49
|
+
|
|
50
|
+
for (const [key, value] of gitConfigs) {
|
|
51
|
+
try {
|
|
52
|
+
execSync(`git config ${key} ${value}`, {
|
|
53
|
+
cwd: generator.cwd,
|
|
54
|
+
stdio: 'ignore'
|
|
55
|
+
});
|
|
56
|
+
} catch (error) {
|
|
57
|
+
log(color.yellow, `[git] Warning: Could not set ${key}`);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
try {
|
|
62
|
+
execSync(`git config user.name ${context.author}`, {
|
|
63
|
+
cwd: generator.cwd,
|
|
64
|
+
stdio: 'ignore'
|
|
65
|
+
});
|
|
66
|
+
} catch (error) {
|
|
67
|
+
log(color.yellow, `[git] Warning: Could not set user.name`);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
try {
|
|
71
|
+
execSync(`git config user.email ${context.authorEmail}`, {
|
|
72
|
+
cwd: generator.cwd,
|
|
73
|
+
stdio: 'ignore'
|
|
74
|
+
});
|
|
75
|
+
} catch (error) {
|
|
76
|
+
log(color.yellow, `[git] Warning: Could not set user.email`);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
try {
|
|
80
|
+
execSync(`git config commit.template ${path.join(generator.cwd, '.gitmessage')}`, {
|
|
81
|
+
cwd: generator.cwd,
|
|
82
|
+
stdio: 'ignore'
|
|
83
|
+
});
|
|
84
|
+
} catch (error) {
|
|
85
|
+
log(color.yellow, `[git] Warning: Could not set commit.template`);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
log(color.blue, '[git] Installing Git configuration');
|
|
90
|
+
|
|
91
|
+
await generator.copyFile('.commitlintrc.json', 'git');
|
|
92
|
+
await generator.copyFile('.lintstagedrc.json', 'git');
|
|
93
|
+
await generator.copyFile('.husky/commit-msg', 'git');
|
|
94
|
+
await generator.copyFile('.husky/pre-commit', 'git');
|
|
95
|
+
|
|
96
|
+
await generator.copyFile('.vscode/conventional-commits.code-snippets', 'git');
|
|
97
|
+
await generator.copyFile('.vscode/copilot.json', 'git');
|
|
98
|
+
await generator.copyFile('.vscode/commit-instructions.md', 'git');
|
|
99
|
+
await generator.copyFile('docs/CONVENTIONAL-COMMITS.md', 'git');
|
|
100
|
+
|
|
101
|
+
await fs.chmod(path.join(generator.cwd, '.husky/commit-msg'), 0o755);
|
|
102
|
+
await fs.chmod(path.join(generator.cwd, '.husky/pre-commit'), 0o755);
|
|
103
|
+
|
|
104
|
+
const handler = gitProviderHandlers[context.gitProvider];
|
|
105
|
+
if (handler) {
|
|
106
|
+
await handler();
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// Registra hook para fazer o commit inicial após todo o setup
|
|
110
|
+
generator.hooks.addAction('after_setup_complete', async (context, generator) => {
|
|
111
|
+
const projectGitDir = path.join(context.cwd, '.git');
|
|
112
|
+
if (!await fs.pathExists(projectGitDir)) {
|
|
113
|
+
return; // Repositório não foi inicializado neste setup
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
try {
|
|
117
|
+
log(color.blue, '[git] Making initial commit...');
|
|
118
|
+
|
|
119
|
+
// Adiciona todos os arquivos
|
|
120
|
+
execSync('git add .', {
|
|
121
|
+
cwd: context.cwd,
|
|
122
|
+
stdio: 'ignore'
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
// Faz o commit inicial
|
|
126
|
+
execSync(`git commit -m "chore: initial project setup"`, {
|
|
127
|
+
cwd: context.cwd,
|
|
128
|
+
stdio: 'ignore'
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
log(color.green, '[git] ✅ Initial commit created successfully');
|
|
132
|
+
} catch (error) {
|
|
133
|
+
log(color.orange, '[git] Warning: Could not create initial commit');
|
|
134
|
+
log(color.yellow, `[git] Error: ${error.message}`);
|
|
135
|
+
}
|
|
136
|
+
}, 10); // Prioridade 10 (executa após outros hooks com prioridade menor)
|
|
137
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export default [
|
|
2
|
+
{
|
|
3
|
+
type: 'confirm',
|
|
4
|
+
name: 'enable_git',
|
|
5
|
+
message: 'Enable Git (commitlint, lint-staged, husky, etc.)?',
|
|
6
|
+
default: true
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
type: 'list',
|
|
10
|
+
name: 'gitProvider',
|
|
11
|
+
message: 'Git provider:',
|
|
12
|
+
choices: ['github', 'gitlab', 'bitbucket', 'custom'],
|
|
13
|
+
default: 'gitlab',
|
|
14
|
+
when: (answers) => answers.enable_git
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
type: 'input',
|
|
18
|
+
name: 'defaultBranch',
|
|
19
|
+
message: 'Default branch:',
|
|
20
|
+
default: 'main',
|
|
21
|
+
when: (answers) => answers.enable_git
|
|
22
|
+
}
|
|
23
|
+
];
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
tooling:
|
|
2
|
+
git-cz:
|
|
3
|
+
service: appserver
|
|
4
|
+
description: Make commit using Conventional Commits
|
|
5
|
+
cmd: npx git-cz
|
|
6
|
+
commitlint-check:
|
|
7
|
+
service: appserver
|
|
8
|
+
description: Verificar se a mensagem de commit segue o padrão
|
|
9
|
+
cmd: npx commitlint --from HEAD~1 --to HEAD --verbose
|
|
10
|
+
conventional-changelog:
|
|
11
|
+
service: appserver
|
|
12
|
+
description: Gerar changelog baseado em commits convencionais
|
|
13
|
+
cmd: npx conventional-changelog -p angular -i CHANGELOG.md -s
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"scripts": {
|
|
3
|
+
"prepare": "husky install",
|
|
4
|
+
"commit": "lando git-cz"
|
|
5
|
+
},
|
|
6
|
+
"devDependencies": {
|
|
7
|
+
"@commitlint/cli": "^18.4.3",
|
|
8
|
+
"@commitlint/config-conventional": "^18.4.3",
|
|
9
|
+
"@commitlint/prompt": "^18.4.3",
|
|
10
|
+
"commitizen": "^4.3.0",
|
|
11
|
+
"conventional-changelog-cli": "^4.1.0",
|
|
12
|
+
"husky": "^8.0.3",
|
|
13
|
+
"lint-staged": "^15.2.1"
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
{
|
|
2
|
+
"settings": {
|
|
3
|
+
"git.inputValidation": "always",
|
|
4
|
+
"git.inputValidationSubjectLength": 72,
|
|
5
|
+
"git.inputValidationLength": 72,
|
|
6
|
+
"git.verboseCommit": true,
|
|
7
|
+
"git.useCommitInputAsStashMessage": true,
|
|
8
|
+
"git.promptToSaveFilesBeforeCommit": "always",
|
|
9
|
+
"git.confirmSync": false,
|
|
10
|
+
"git.autofetch": true,
|
|
11
|
+
"git.enableSmartCommit": true,
|
|
12
|
+
"git.smartCommitChanges": "tracked",
|
|
13
|
+
"git.allowForcePush": false,
|
|
14
|
+
"git.alwaysSignOff": false,
|
|
15
|
+
"git.enableCommitSigning": true,
|
|
16
|
+
"conventionalCommits.emojiFormat": "emoji",
|
|
17
|
+
"conventionalCommits.showEditor": true,
|
|
18
|
+
"conventionalCommits.silent": false,
|
|
19
|
+
"conventionalCommits.autoCommit": false,
|
|
20
|
+
"conventionalCommits.promptBody": true,
|
|
21
|
+
"conventionalCommits.promptFooter": true,
|
|
22
|
+
"conventionalCommits.promptScope": true,
|
|
23
|
+
"conventionalCommits.scopes": [
|
|
24
|
+
"ui",
|
|
25
|
+
"api",
|
|
26
|
+
"auth",
|
|
27
|
+
"config",
|
|
28
|
+
"deps",
|
|
29
|
+
"docs",
|
|
30
|
+
"tests",
|
|
31
|
+
"build",
|
|
32
|
+
"ci",
|
|
33
|
+
"theme",
|
|
34
|
+
"plugin",
|
|
35
|
+
"database",
|
|
36
|
+
"security",
|
|
37
|
+
"performance",
|
|
38
|
+
"core",
|
|
39
|
+
"docker",
|
|
40
|
+
"lando"
|
|
41
|
+
],
|
|
42
|
+
"conventionalCommits.gitmoji": false,
|
|
43
|
+
"conventionalCommits.lineBreak": "\\n",
|
|
44
|
+
"gitlens.ai.experimental.generateCommitMessage.enabled": true,
|
|
45
|
+
"gitlens.experimental.generateCommitMessage.enabled": true,
|
|
46
|
+
"gitlens.ai.experimental.generateCommitMessage.model": "gpt-4",
|
|
47
|
+
"gitlens.ai.experimental.generateCommitMessage.maxTokens": 200,
|
|
48
|
+
"gitlens.ai.experimental.generateCommitMessage.temperature": 0.2,
|
|
49
|
+
"github.copilot.enable": {
|
|
50
|
+
"*": true,
|
|
51
|
+
"yaml": true,
|
|
52
|
+
"plaintext": true,
|
|
53
|
+
"markdown": true,
|
|
54
|
+
"scminput": true
|
|
55
|
+
},
|
|
56
|
+
"github.copilot.advanced": {
|
|
57
|
+
"debug.overrideEngine": "copilot-chat",
|
|
58
|
+
"debug.useNodeFetcher": true
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
"extensions": {
|
|
62
|
+
"recommendations": [
|
|
63
|
+
"eamodio.gitlens",
|
|
64
|
+
"mhutchie.git-graph",
|
|
65
|
+
"vivaxy.vscode-conventional-commits"
|
|
66
|
+
]
|
|
67
|
+
},
|
|
68
|
+
"tasks": {
|
|
69
|
+
"tasks": [
|
|
70
|
+
{
|
|
71
|
+
"label": "📝 Conventional Commit (via Lando)",
|
|
72
|
+
"type": "shell",
|
|
73
|
+
"command": "lando",
|
|
74
|
+
"args": ["git-cz"],
|
|
75
|
+
"group": "build",
|
|
76
|
+
"presentation": {
|
|
77
|
+
"echo": true,
|
|
78
|
+
"reveal": "always",
|
|
79
|
+
"focus": false,
|
|
80
|
+
"panel": "shared"
|
|
81
|
+
},
|
|
82
|
+
"problemMatcher": []
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"label": "🔍 CommitLint: Check Last Commit",
|
|
86
|
+
"type": "shell",
|
|
87
|
+
"command": "lando",
|
|
88
|
+
"args": ["commitlint-check"],
|
|
89
|
+
"group": "test",
|
|
90
|
+
"presentation": {
|
|
91
|
+
"echo": true,
|
|
92
|
+
"reveal": "always",
|
|
93
|
+
"focus": false,
|
|
94
|
+
"panel": "shared"
|
|
95
|
+
},
|
|
96
|
+
"problemMatcher": []
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"label": "📋 Generate Changelog",
|
|
100
|
+
"type": "shell",
|
|
101
|
+
"command": "lando",
|
|
102
|
+
"args": ["conventional-changelog"],
|
|
103
|
+
"group": "build",
|
|
104
|
+
"presentation": {
|
|
105
|
+
"echo": true,
|
|
106
|
+
"reveal": "always",
|
|
107
|
+
"focus": false,
|
|
108
|
+
"panel": "shared"
|
|
109
|
+
},
|
|
110
|
+
"problemMatcher": []
|
|
111
|
+
}
|
|
112
|
+
]
|
|
113
|
+
}
|
|
114
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Node and vendor
|
|
2
|
+
node_modules/
|
|
3
|
+
vendor/
|
|
4
|
+
dist/
|
|
5
|
+
build/
|
|
6
|
+
|
|
7
|
+
# Tests
|
|
8
|
+
__tests__/
|
|
9
|
+
__test__/
|
|
10
|
+
*.test.js
|
|
11
|
+
*.spec.js
|
|
12
|
+
|
|
13
|
+
# IDE and system
|
|
14
|
+
.vscode/
|
|
15
|
+
.idea/
|
|
16
|
+
.history/
|
|
17
|
+
.cursor/
|
|
18
|
+
|
|
19
|
+
# WordPress and uploads
|
|
20
|
+
wp/
|
|
21
|
+
wp-content/uploads/
|
|
22
|
+
wp-content/upgrade/
|
|
23
|
+
wp-content/cache/
|
|
24
|
+
wp-content/ai1wm-backups/
|
|
25
|
+
|
|
26
|
+
# Misc
|
|
27
|
+
*.min.js
|
|
28
|
+
*.min.css
|
|
29
|
+
*.log
|
|
30
|
+
.cache/
|
|
31
|
+
.next/
|
|
32
|
+
out/
|
|
33
|
+
coverage/
|
|
34
|
+
.nyc_output/
|
|
35
|
+
.env
|
|
36
|
+
.env.*
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Ignore node_modules and build directories
|
|
2
|
+
node_modules/
|
|
3
|
+
dist/
|
|
4
|
+
build/
|
|
5
|
+
|
|
6
|
+
# Ignore WordPress core
|
|
7
|
+
wp/
|
|
8
|
+
wp-content/plugins/
|
|
9
|
+
wp-content/mu-plugins/
|
|
10
|
+
wp-content/uploads/
|
|
11
|
+
wp-content/upgrade/
|
|
12
|
+
|
|
13
|
+
content/plugins/
|
|
14
|
+
content/mu-plugins/
|
|
15
|
+
content/uploads/
|
|
16
|
+
content/upgrade/
|
|
17
|
+
|
|
18
|
+
# Ignore Composer dependencies
|
|
19
|
+
vendor/
|
|
20
|
+
|
|
21
|
+
# Ignore logs and environment
|
|
22
|
+
*.log
|
|
23
|
+
.env
|
|
24
|
+
.env.*
|
|
25
|
+
|
|
26
|
+
# Ignore IDE and system files
|
|
27
|
+
.DS_Store
|
|
28
|
+
Thumbs.db
|
|
29
|
+
|
|
30
|
+
# Ignore Lando config cache
|
|
31
|
+
.lando/
|
|
32
|
+
|
|
33
|
+
# Ignore anything temporary
|
|
34
|
+
*.tmp
|
|
35
|
+
*.temp
|
|
36
|
+
*.bak
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"semi": true,
|
|
3
|
+
"singleQuote": true,
|
|
4
|
+
"trailingComma": "es5",
|
|
5
|
+
"tabWidth": 2,
|
|
6
|
+
"printWidth": 100,
|
|
7
|
+
"bracketSpacing": true,
|
|
8
|
+
"arrowParens": "avoid",
|
|
9
|
+
"overrides": [
|
|
10
|
+
{
|
|
11
|
+
"files": ["*.scss", "*.css", "*.sass"],
|
|
12
|
+
"options": {
|
|
13
|
+
"singleQuote": false
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"files": ["*.json", "*.yml", "*.yaml"],
|
|
18
|
+
"options": {
|
|
19
|
+
"tabWidth": 2
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"files": "*.html",
|
|
24
|
+
"options": {
|
|
25
|
+
"htmlWhitespaceSensitivity": "ignore"
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
]
|
|
29
|
+
}
|