@codigodoleo/wp-kit 2.0.4 → 3.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/.cspell.json +5 -25
- package/README.md +127 -2
- package/lib/cli.js +1 -0
- package/lib/commands/init.js +32 -10
- package/lib/config/versions.js +163 -0
- package/lib/core/generator.js +63 -46
- package/lib/core/hook-manager.js +2 -2
- package/lib/core/infer-ci-capabilities.js +13 -24
- package/lib/prompts/index.js +31 -19
- package/lib/prompts/loadModulePrompts.js +4 -2
- package/lib/utils/generate-from-template.js +1 -0
- package/modules/deploy/index.js +34 -7
- package/modules/deploy/prompts.js +5 -5
- package/modules/deploy/templates/.github/workflows/ci.yml.hbs +49 -103
- package/modules/deploy/templates/.gitlab/gitlab-ci.yml.hbs +45 -145
- package/modules/deploy/templates/bitbucket-pipelines.yml.hbs +46 -97
- package/modules/docs/prompts.js +2 -2
- package/modules/docs/templates/README.md.hbs +67 -160
- package/modules/docs/templates/docs/Arquitetura.md +113 -92
- package/modules/docs/templates/docs/Deploy-Pipeline.md +22 -8
- package/modules/docs/templates/docs/Desenvolvimento.md +187 -164
- package/modules/docs/templates/docs/Getting-Started.md +37 -7
- package/modules/docs/templates/docs/Infraestrutura.md +41 -12
- package/modules/docs/templates/docs/Monitoramento.md +83 -45
- package/modules/docs/templates/docs/Sync-the-Production-DB-with-the-Staging-DB.md +6 -7
- package/modules/docs/templates/docs/Troubleshooting.md +1 -1
- package/modules/git/.github/PULL_REQUEST_TEMPLATE.md +1 -0
- package/modules/git/.gitlab/merge_request_templates/default.md +1 -0
- package/modules/git/.vscode/commit-instructions.md +7 -0
- package/modules/git/.vscode/conventional-commits.code-snippets +13 -43
- package/modules/git/docs/CONVENTIONAL-COMMITS.md +14 -14
- package/modules/git/index.js +39 -34
- package/modules/git/prompts.js +4 -4
- package/modules/git/templates/.lando.yml.hbs +5 -13
- package/modules/git/templates/package.json.hbs +4 -15
- package/modules/git/templates/workspace.json.hbs +28 -114
- package/modules/lint/eslint.config.mjs +36 -0
- package/modules/lint/index.js +1 -2
- package/modules/lint/prompts.js +3 -3
- package/modules/lint/templates/.lando.yml.hbs +2 -10
- package/modules/lint/templates/package.json.hbs +4 -16
- package/modules/lint/templates/workspace.json.hbs +15 -56
- package/modules/php/prompts.js +2 -2
- package/modules/php/templates/.lando.yml.hbs +2 -11
- package/modules/php/templates/composer.json.hbs +1 -6
- package/modules/php/templates/workspace.json.hbs +15 -74
- package/modules/redis/prompts.js +2 -2
- package/modules/redis/templates/.lando.yml.hbs +1 -8
- package/modules/sage/index.js +115 -7
- package/modules/sage/prompts.js +3 -3
- package/modules/sage/templates/.lando.yml.hbs +20 -64
- package/modules/sage/templates/theme/composer.json.hbs +3 -18
- package/modules/sage/templates/theme/package.json.hbs +3 -11
- package/modules/sage/templates/theme/style.css.hbs +20 -13
- package/modules/sage/templates/theme/vite.config.js.hbs +13 -53
- package/modules/sage/templates/workspace.json.hbs +12 -67
- package/modules/test-directory/prompts.js +2 -2
- package/package.json +20 -1
- package/templates/.editorconfig.hbs +5 -39
- package/templates/.env.hbs +14 -35
- package/templates/.gitignore.hbs +13 -86
- package/templates/.lando.yml.hbs +11 -44
- package/templates/README.md.hbs +7 -8
- package/templates/composer.json.hbs +12 -60
- package/templates/server/cmd/install-wp.sh.hbs +43 -58
- package/templates/server/www/vhosts.conf.hbs +21 -71
- package/templates/workspace.json.hbs +40 -177
package/modules/git/index.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import path from 'path';
|
|
2
|
+
import { execSync } from 'child_process';
|
|
3
|
+
|
|
2
4
|
import fs from 'fs-extra';
|
|
5
|
+
|
|
3
6
|
import { log, color } from '../../lib/utils/logger.js';
|
|
4
|
-
import { execSync } from 'child_process';
|
|
5
7
|
|
|
6
8
|
export async function setupModule(context, generator) {
|
|
7
|
-
|
|
8
9
|
const gitDir = path.join(generator.cwd, '.git');
|
|
9
10
|
|
|
10
11
|
const gitProviderHandlers = {
|
|
@@ -19,10 +20,10 @@ export async function setupModule(context, generator) {
|
|
|
19
20
|
},
|
|
20
21
|
custom: async () => {
|
|
21
22
|
// await generator.copyFile('.custom/PULL_REQUEST_TEMPLATE.md', '.custom/PULL_REQUEST_TEMPLATE.md', 'git');
|
|
22
|
-
}
|
|
23
|
+
},
|
|
23
24
|
};
|
|
24
25
|
|
|
25
|
-
if (!await fs.pathExists(gitDir)) {
|
|
26
|
+
if (!(await fs.pathExists(gitDir))) {
|
|
26
27
|
log(color.orange, '[git] Initializing Git repository');
|
|
27
28
|
execSync('git init', { cwd: generator.cwd, stdio: 'ignore' });
|
|
28
29
|
await generator.copyFile('.gitmessage', 'git');
|
|
@@ -31,7 +32,7 @@ export async function setupModule(context, generator) {
|
|
|
31
32
|
try {
|
|
32
33
|
execSync(`git branch -M ${context.defaultBranch}`, {
|
|
33
34
|
cwd: generator.cwd,
|
|
34
|
-
stdio: 'ignore'
|
|
35
|
+
stdio: 'ignore',
|
|
35
36
|
});
|
|
36
37
|
log(color.green, `[git] Default branch set to: ${context.defaultBranch}`);
|
|
37
38
|
} catch (error) {
|
|
@@ -44,14 +45,14 @@ export async function setupModule(context, generator) {
|
|
|
44
45
|
['core.eol', 'lf'],
|
|
45
46
|
['core.filemode', 'false'],
|
|
46
47
|
['pull.rebase', 'false'],
|
|
47
|
-
['init.defaultBranch', context.defaultBranch || 'main']
|
|
48
|
+
['init.defaultBranch', context.defaultBranch || 'main'],
|
|
48
49
|
];
|
|
49
50
|
|
|
50
51
|
for (const [key, value] of gitConfigs) {
|
|
51
52
|
try {
|
|
52
53
|
execSync(`git config ${key} ${value}`, {
|
|
53
54
|
cwd: generator.cwd,
|
|
54
|
-
stdio: 'ignore'
|
|
55
|
+
stdio: 'ignore',
|
|
55
56
|
});
|
|
56
57
|
} catch (error) {
|
|
57
58
|
log(color.yellow, `[git] Warning: Could not set ${key}`);
|
|
@@ -61,7 +62,7 @@ export async function setupModule(context, generator) {
|
|
|
61
62
|
try {
|
|
62
63
|
execSync(`git config user.name ${context.author}`, {
|
|
63
64
|
cwd: generator.cwd,
|
|
64
|
-
stdio: 'ignore'
|
|
65
|
+
stdio: 'ignore',
|
|
65
66
|
});
|
|
66
67
|
} catch (error) {
|
|
67
68
|
log(color.yellow, `[git] Warning: Could not set user.name`);
|
|
@@ -70,7 +71,7 @@ export async function setupModule(context, generator) {
|
|
|
70
71
|
try {
|
|
71
72
|
execSync(`git config user.email ${context.authorEmail}`, {
|
|
72
73
|
cwd: generator.cwd,
|
|
73
|
-
stdio: 'ignore'
|
|
74
|
+
stdio: 'ignore',
|
|
74
75
|
});
|
|
75
76
|
} catch (error) {
|
|
76
77
|
log(color.yellow, `[git] Warning: Could not set user.email`);
|
|
@@ -79,7 +80,7 @@ export async function setupModule(context, generator) {
|
|
|
79
80
|
try {
|
|
80
81
|
execSync(`git config commit.template ${path.join(generator.cwd, '.gitmessage')}`, {
|
|
81
82
|
cwd: generator.cwd,
|
|
82
|
-
stdio: 'ignore'
|
|
83
|
+
stdio: 'ignore',
|
|
83
84
|
});
|
|
84
85
|
} catch (error) {
|
|
85
86
|
log(color.yellow, `[git] Warning: Could not set commit.template`);
|
|
@@ -106,32 +107,36 @@ export async function setupModule(context, generator) {
|
|
|
106
107
|
await handler();
|
|
107
108
|
}
|
|
108
109
|
|
|
109
|
-
|
|
110
|
-
generator.hooks.addAction(
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
110
|
+
// Registra hook para fazer o commit inicial após todo o setup
|
|
111
|
+
generator.hooks.addAction(
|
|
112
|
+
'after_setup_complete',
|
|
113
|
+
async (context, generator) => {
|
|
114
|
+
const projectGitDir = path.join(context.cwd, '.git');
|
|
115
|
+
if (!(await fs.pathExists(projectGitDir))) {
|
|
116
|
+
return; // Repositório não foi inicializado neste setup
|
|
117
|
+
}
|
|
115
118
|
|
|
116
|
-
|
|
117
|
-
|
|
119
|
+
try {
|
|
120
|
+
log(color.blue, '[git] Making initial commit...');
|
|
118
121
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
122
|
+
// Adiciona todos os arquivos
|
|
123
|
+
execSync('git add .', {
|
|
124
|
+
cwd: context.cwd,
|
|
125
|
+
stdio: 'ignore',
|
|
126
|
+
});
|
|
124
127
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
128
|
+
// Faz o commit inicial
|
|
129
|
+
execSync(`git commit -m "chore: initial project setup"`, {
|
|
130
|
+
cwd: context.cwd,
|
|
131
|
+
stdio: 'ignore',
|
|
132
|
+
});
|
|
130
133
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
134
|
+
log(color.green, '[git] ✅ Initial commit created successfully');
|
|
135
|
+
} catch (error) {
|
|
136
|
+
log(color.orange, '[git] Warning: Could not create initial commit');
|
|
137
|
+
log(color.yellow, `[git] Error: ${error.message}`);
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
10
|
|
141
|
+
); // Prioridade 10 (executa após outros hooks com prioridade menor)
|
|
137
142
|
}
|
package/modules/git/prompts.js
CHANGED
|
@@ -3,7 +3,7 @@ export default [
|
|
|
3
3
|
type: 'confirm',
|
|
4
4
|
name: 'enable_git',
|
|
5
5
|
message: 'Enable Git (commitlint, lint-staged, husky, etc.)?',
|
|
6
|
-
default: true
|
|
6
|
+
default: true,
|
|
7
7
|
},
|
|
8
8
|
{
|
|
9
9
|
type: 'list',
|
|
@@ -11,13 +11,13 @@ export default [
|
|
|
11
11
|
message: 'Git provider:',
|
|
12
12
|
choices: ['github', 'gitlab', 'bitbucket', 'custom'],
|
|
13
13
|
default: 'gitlab',
|
|
14
|
-
when: (answers) => answers.enable_git
|
|
14
|
+
when: (answers) => answers.enable_git,
|
|
15
15
|
},
|
|
16
16
|
{
|
|
17
17
|
type: 'input',
|
|
18
18
|
name: 'defaultBranch',
|
|
19
19
|
message: 'Default branch:',
|
|
20
20
|
default: 'main',
|
|
21
|
-
when: (answers) => answers.enable_git
|
|
22
|
-
}
|
|
21
|
+
when: (answers) => answers.enable_git,
|
|
22
|
+
},
|
|
23
23
|
];
|
|
@@ -1,13 +1,5 @@
|
|
|
1
|
-
tooling:
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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
|
|
1
|
+
tooling: git-cz: service: appserver description: Make commit using Conventional Commits cmd: npx
|
|
2
|
+
git-cz commitlint-check: service: appserver description: Verificar se a mensagem de commit segue o
|
|
3
|
+
padrão cmd: npx commitlint --from HEAD~1 --to HEAD --verbose conventional-changelog: service:
|
|
4
|
+
appserver description: Gerar changelog baseado em commits convencionais cmd: npx
|
|
5
|
+
conventional-changelog -p angular -i CHANGELOG.md -s
|
|
@@ -1,15 +1,4 @@
|
|
|
1
|
-
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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
|
-
}
|
|
1
|
+
{ "scripts": { "prepare": "husky install", "commit": "lando git-cz" }, "devDependencies": {
|
|
2
|
+
"@commitlint/cli": "^18.4.3", "@commitlint/config-conventional": "^18.4.3", "@commitlint/prompt":
|
|
3
|
+
"^18.4.3", "commitizen": "^4.3.0", "conventional-changelog-cli": "^4.1.0", "husky": "^8.0.3",
|
|
4
|
+
"lint-staged": "^15.2.1" } }
|
|
@@ -1,114 +1,28 @@
|
|
|
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
|
-
"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
|
-
}
|
|
1
|
+
{ "settings": { "git.inputValidation": "always", "git.inputValidationSubjectLength": 72,
|
|
2
|
+
"git.inputValidationLength": 72, "git.verboseCommit": true, "git.useCommitInputAsStashMessage":
|
|
3
|
+
true, "git.promptToSaveFilesBeforeCommit": "always", "git.confirmSync": false, "git.autofetch":
|
|
4
|
+
true, "git.enableSmartCommit": true, "git.smartCommitChanges": "tracked", "git.allowForcePush":
|
|
5
|
+
false, "git.alwaysSignOff": false, "git.enableCommitSigning": true,
|
|
6
|
+
"conventionalCommits.emojiFormat": "emoji", "conventionalCommits.showEditor": true,
|
|
7
|
+
"conventionalCommits.silent": false, "conventionalCommits.autoCommit": false,
|
|
8
|
+
"conventionalCommits.promptBody": true, "conventionalCommits.promptFooter": true,
|
|
9
|
+
"conventionalCommits.promptScope": true, "conventionalCommits.scopes": [ "ui", "api", "auth",
|
|
10
|
+
"config", "deps", "docs", "tests", "build", "ci", "theme", "plugin", "database", "security",
|
|
11
|
+
"performance", "core", "docker", "lando" ], "conventionalCommits.gitmoji": false,
|
|
12
|
+
"conventionalCommits.lineBreak": "\\n", "gitlens.ai.experimental.generateCommitMessage.enabled":
|
|
13
|
+
true, "gitlens.experimental.generateCommitMessage.enabled": true,
|
|
14
|
+
"gitlens.ai.experimental.generateCommitMessage.model": "gpt-4",
|
|
15
|
+
"gitlens.ai.experimental.generateCommitMessage.maxTokens": 200,
|
|
16
|
+
"gitlens.ai.experimental.generateCommitMessage.temperature": 0.2, "github.copilot.enable": { "*":
|
|
17
|
+
true, "yaml": true, "plaintext": true, "markdown": true, "scminput": true },
|
|
18
|
+
"github.copilot.advanced": { "debug.overrideEngine": "copilot-chat", "debug.useNodeFetcher": true }
|
|
19
|
+
}, "extensions": { "recommendations": [ "eamodio.gitlens", "mhutchie.git-graph",
|
|
20
|
+
"vivaxy.vscode-conventional-commits" ] }, "tasks": { "tasks": [ { "label": "📝 Conventional Commit
|
|
21
|
+
(via Lando)", "type": "shell", "command": "lando", "args": ["git-cz"], "group": "build",
|
|
22
|
+
"presentation": { "echo": true, "reveal": "always", "focus": false, "panel": "shared" },
|
|
23
|
+
"problemMatcher": [] }, { "label": "🔍 CommitLint: Check Last Commit", "type": "shell", "command":
|
|
24
|
+
"lando", "args": ["commitlint-check"], "group": "test", "presentation": { "echo": true, "reveal":
|
|
25
|
+
"always", "focus": false, "panel": "shared" }, "problemMatcher": [] }, { "label": "📋 Generate
|
|
26
|
+
Changelog", "type": "shell", "command": "lando", "args": ["conventional-changelog"], "group":
|
|
27
|
+
"build", "presentation": { "echo": true, "reveal": "always", "focus": false, "panel": "shared" },
|
|
28
|
+
"problemMatcher": [] } ] } }
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import js from '@eslint/js';
|
|
2
|
+
import eslintConfigPrettier from 'eslint-config-prettier/flat';
|
|
3
|
+
import prettierPlugin from 'eslint-plugin-prettier';
|
|
4
|
+
import globals from 'globals';
|
|
5
|
+
|
|
6
|
+
export default [
|
|
7
|
+
{
|
|
8
|
+
ignores: [
|
|
9
|
+
'**/node_modules/**',
|
|
10
|
+
'**/vendor/**',
|
|
11
|
+
'**/wp/**',
|
|
12
|
+
'**/public/build/**',
|
|
13
|
+
'**/dist/**',
|
|
14
|
+
'eslint.config.mjs',
|
|
15
|
+
],
|
|
16
|
+
},
|
|
17
|
+
js.configs.recommended,
|
|
18
|
+
{
|
|
19
|
+
languageOptions: {
|
|
20
|
+
ecmaVersion: 2022,
|
|
21
|
+
sourceType: 'module',
|
|
22
|
+
globals: {
|
|
23
|
+
...globals.browser,
|
|
24
|
+
...globals.node,
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
plugins: {
|
|
28
|
+
prettier: prettierPlugin,
|
|
29
|
+
},
|
|
30
|
+
rules: {
|
|
31
|
+
'prettier/prettier': 'error',
|
|
32
|
+
'no-unused-vars': ['error', { argsIgnorePattern: '^_', varsIgnorePattern: '^_' }],
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
eslintConfigPrettier,
|
|
36
|
+
];
|
package/modules/lint/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export async function setupModule(context, generator) {
|
|
2
|
-
await generator.copyFile('.
|
|
2
|
+
await generator.copyFile('eslint.config.mjs', 'lint');
|
|
3
3
|
await generator.copyFile('.prettierrc.json', 'lint');
|
|
4
4
|
|
|
5
5
|
await generator.copyFile('.prettierrc.json', 'lint');
|
|
@@ -11,5 +11,4 @@ export async function setupModule(context, generator) {
|
|
|
11
11
|
await generator.copyFile('.stylelintrc.json', 'lint');
|
|
12
12
|
await generator.copyFile('.stylelintignore', 'lint');
|
|
13
13
|
}
|
|
14
|
-
|
|
15
14
|
}
|
package/modules/lint/prompts.js
CHANGED
|
@@ -4,13 +4,13 @@ export default [
|
|
|
4
4
|
type: 'confirm',
|
|
5
5
|
name: 'enable_lint',
|
|
6
6
|
message: 'Enable linting and formatting tools (ESLint + Prettier)?',
|
|
7
|
-
default: true
|
|
7
|
+
default: true,
|
|
8
8
|
},
|
|
9
9
|
{
|
|
10
10
|
type: 'confirm',
|
|
11
11
|
name: 'enable_stylelint',
|
|
12
12
|
message: 'Include Stylelint config?',
|
|
13
13
|
default: true,
|
|
14
|
-
when:
|
|
15
|
-
}
|
|
14
|
+
when: answers => answers.enable_lint,
|
|
15
|
+
},
|
|
16
16
|
];
|
|
@@ -1,10 +1,2 @@
|
|
|
1
|
-
tooling:
|
|
2
|
-
|
|
3
|
-
service: appserver
|
|
4
|
-
cmd: yarn eslint
|
|
5
|
-
prettier:
|
|
6
|
-
service: appserver
|
|
7
|
-
cmd: yarn prettier
|
|
8
|
-
stylelint:
|
|
9
|
-
service: appserver
|
|
10
|
-
cmd: yarn stylelint **/*.{css,scss,vue}
|
|
1
|
+
tooling: eslint: service: appserver cmd: yarn eslint prettier: service: appserver cmd: yarn prettier
|
|
2
|
+
stylelint: service: appserver cmd: yarn stylelint **/*.{css,scss,vue}
|
|
@@ -1,16 +1,4 @@
|
|
|
1
|
-
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
"lint:fix": "lando eslint . --ext .js,.ts --fix"
|
|
6
|
-
},
|
|
7
|
-
"devDependencies": {
|
|
8
|
-
"globals": "^16.3.0",
|
|
9
|
-
"@eslint/eslintrc": "^3.3.1",
|
|
10
|
-
"@eslint/js": "^9.30.1",
|
|
11
|
-
"eslint": "^8.56.0",
|
|
12
|
-
"eslint-config-prettier": "^8.10.0",
|
|
13
|
-
"eslint-plugin-prettier": "^4.2.1",
|
|
14
|
-
"prettier": "^2.8.8"
|
|
15
|
-
}
|
|
16
|
-
}
|
|
1
|
+
{ "scripts": { "format": "prettier --write .", "lint": "lando eslint . --ext .js,.ts", "lint:fix":
|
|
2
|
+
"lando eslint . --ext .js,.ts --fix" }, "devDependencies": { "globals": "^16.3.0",
|
|
3
|
+
"@eslint/eslintrc": "^3.3.1", "@eslint/js": "^9.30.1", "eslint": "^8.56.0",
|
|
4
|
+
"eslint-config-prettier": "^8.10.0", "eslint-plugin-prettier": "^4.2.1", "prettier": "^2.8.8" } }
|
|
@@ -1,56 +1,15 @@
|
|
|
1
|
-
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
"editor.tabSize": 2
|
|
17
|
-
},
|
|
18
|
-
"[javascript]": {
|
|
19
|
-
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
|
20
|
-
"editor.formatOnSave": false,
|
|
21
|
-
"editor.insertSpaces": true,
|
|
22
|
-
"editor.tabSize": 2
|
|
23
|
-
},
|
|
24
|
-
"[typescript]": {
|
|
25
|
-
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
|
26
|
-
"editor.formatOnSave": false,
|
|
27
|
-
"editor.insertSpaces": true,
|
|
28
|
-
"editor.tabSize": 2
|
|
29
|
-
},
|
|
30
|
-
"[css]": {
|
|
31
|
-
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
|
32
|
-
"editor.formatOnSave": false,
|
|
33
|
-
"editor.insertSpaces": true,
|
|
34
|
-
"editor.tabSize": 2
|
|
35
|
-
},
|
|
36
|
-
"[scss]": {
|
|
37
|
-
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
|
38
|
-
"editor.formatOnSave": false,
|
|
39
|
-
"editor.insertSpaces": true,
|
|
40
|
-
"editor.tabSize": 2
|
|
41
|
-
},
|
|
42
|
-
"files.eol": "\n",
|
|
43
|
-
"files.trimTrailingWhitespace": true,
|
|
44
|
-
"files.insertFinalNewline": true
|
|
45
|
-
},
|
|
46
|
-
"extensions": {
|
|
47
|
-
"recommendations": [
|
|
48
|
-
"esbenp.prettier-vscode",
|
|
49
|
-
"dbaeumer.vscode-eslint",
|
|
50
|
-
"editorconfig.editorconfig",
|
|
51
|
-
"stylelint.vscode-stylelint",
|
|
52
|
-
"bmewburn.vscode-intelephense-client",
|
|
53
|
-
"bradlc.vscode-tailwindcss"
|
|
54
|
-
]
|
|
55
|
-
}
|
|
56
|
-
}
|
|
1
|
+
{ "settings": { "editor.defaultFormatter": "esbenp.prettier-vscode", "editor.formatOnSave": false,
|
|
2
|
+
"editor.codeActionsOnSave": { "source.fixAll": true, "source.fixAll.eslint": true,
|
|
3
|
+
"source.organizeImports": true }, "prettier.requireConfig": true, "prettier.useEditorConfig": true,
|
|
4
|
+
"[blade]": { "editor.defaultFormatter": "esbenp.prettier-vscode", "editor.formatOnSave": false,
|
|
5
|
+
"editor.insertSpaces": true, "editor.tabSize": 2 }, "[javascript]": { "editor.defaultFormatter":
|
|
6
|
+
"esbenp.prettier-vscode", "editor.formatOnSave": false, "editor.insertSpaces": true,
|
|
7
|
+
"editor.tabSize": 2 }, "[typescript]": { "editor.defaultFormatter": "esbenp.prettier-vscode",
|
|
8
|
+
"editor.formatOnSave": false, "editor.insertSpaces": true, "editor.tabSize": 2 }, "[css]": {
|
|
9
|
+
"editor.defaultFormatter": "esbenp.prettier-vscode", "editor.formatOnSave": false,
|
|
10
|
+
"editor.insertSpaces": true, "editor.tabSize": 2 }, "[scss]": { "editor.defaultFormatter":
|
|
11
|
+
"esbenp.prettier-vscode", "editor.formatOnSave": false, "editor.insertSpaces": true,
|
|
12
|
+
"editor.tabSize": 2 }, "files.eol": "\n", "files.trimTrailingWhitespace": true,
|
|
13
|
+
"files.insertFinalNewline": true }, "extensions": { "recommendations": [ "esbenp.prettier-vscode",
|
|
14
|
+
"dbaeumer.vscode-eslint", "editorconfig.editorconfig", "stylelint.vscode-stylelint",
|
|
15
|
+
"bmewburn.vscode-intelephense-client", "bradlc.vscode-tailwindcss" ] } }
|
package/modules/php/prompts.js
CHANGED
|
@@ -1,11 +1,2 @@
|
|
|
1
|
-
tooling:
|
|
2
|
-
|
|
3
|
-
service: appserver
|
|
4
|
-
description: PHP Code Style (modern PSR-12)
|
|
5
|
-
cmd:
|
|
6
|
-
- pint
|
|
7
|
-
pint-check:
|
|
8
|
-
service: appserver
|
|
9
|
-
description: Check code style without fixing
|
|
10
|
-
cmd:
|
|
11
|
-
- pint --test
|
|
1
|
+
tooling: pint: service: appserver description: PHP Code Style (modern PSR-12) cmd: - pint
|
|
2
|
+
pint-check: service: appserver description: Check code style without fixing cmd: - pint --test
|