@codigodoleo/wp-kit 3.1.0 → 3.2.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.
Files changed (70) hide show
  1. package/lib/commands/init.js +19 -10
  2. package/lib/config/versions.js +5 -5
  3. package/lib/prompts/index.js +24 -14
  4. package/lib/utils/git.js +50 -13
  5. package/modules/deploy/.github/workflows/deploy-docker.yml +102 -0
  6. package/modules/deploy/.github/workflows/deploy-ssh.yml +126 -0
  7. package/modules/deploy/.github/workflows/release.yml +55 -0
  8. package/modules/deploy/index.js +39 -0
  9. package/modules/deploy/prompts.js +1 -3
  10. package/modules/deploy/templates/.gitlab/ci/deploy-docker.yml.hbs +35 -0
  11. package/modules/deploy/templates/.gitlab/ci/deploy-ssh.yml.hbs +83 -0
  12. package/modules/deploy/templates/.gitlab/ci/release.yml.hbs +26 -0
  13. package/modules/git/.husky/commit-msg +8 -4
  14. package/modules/git/.husky/pre-commit +0 -3
  15. package/modules/git/index.js +34 -38
  16. package/modules/git/templates/.lando.yml.hbs +13 -5
  17. package/modules/git/templates/package.json.hbs +4 -4
  18. package/modules/git/templates/workspace.json.hbs +114 -28
  19. package/modules/lint/templates/.lando.yml.hbs +10 -2
  20. package/modules/lint/templates/package.json.hbs +4 -4
  21. package/modules/lint/templates/workspace.json.hbs +56 -15
  22. package/modules/php/templates/.lando.yml.hbs +11 -2
  23. package/modules/php/templates/composer.json.hbs +1 -1
  24. package/modules/php/templates/workspace.json.hbs +74 -15
  25. package/modules/redis/templates/.lando.yml.hbs +8 -1
  26. package/modules/sage/index.js +114 -15
  27. package/modules/sage/prompts.js +1 -1
  28. package/modules/sage/templates/.devcontainer/devcontainer.json.hbs +7 -0
  29. package/modules/sage/templates/.devcontainer/docker-compose.override.yml.hbs +6 -0
  30. package/modules/sage/templates/.devcontainer/post-create.sh.hbs +11 -0
  31. package/modules/sage/templates/.lando.yml.hbs +49 -20
  32. package/modules/sage/templates/server/cmd/setup-sage-node.sh.hbs +23 -0
  33. package/modules/sage/templates/server/cmd/setup-sage-php.sh.hbs +24 -0
  34. package/modules/sage/templates/theme/app/Blocks/.gitkeep.hbs +0 -0
  35. package/modules/sage/templates/theme/app/Fields/.gitkeep.hbs +0 -0
  36. package/modules/sage/templates/theme/composer.json.hbs +25 -3
  37. package/modules/sage/templates/theme/package.json.hbs +15 -3
  38. package/modules/sage/templates/theme/resources/views/blocks/.gitkeep.hbs +0 -0
  39. package/modules/sage/templates/theme/vite.config.js.hbs +55 -13
  40. package/modules/sage/templates/workspace.json.hbs +155 -12
  41. package/modules/skills/index.js +18 -0
  42. package/modules/skills/prompts.js +21 -0
  43. package/modules/test/index.js +19 -0
  44. package/modules/test/prompts.js +8 -0
  45. package/modules/test/templates/composer.json.hbs +16 -0
  46. package/modules/test/templates/package.json.hbs +11 -0
  47. package/modules/test/templates/playwright.config.js.hbs +29 -0
  48. package/modules/test/tests/Pest.php +39 -0
  49. package/modules/test/tests/SmokeTest.php +15 -0
  50. package/modules/test/tests/e2e/example.spec.js +11 -0
  51. package/modules/test/tests/e2e/helpers/loginHelper.js +40 -0
  52. package/package.json +1 -1
  53. package/templates/.devcontainer/Dockerfile.hbs +24 -0
  54. package/templates/.devcontainer/config/nginx.conf +23 -0
  55. package/templates/.devcontainer/config/nginx.conf.hbs +23 -0
  56. package/templates/.devcontainer/devcontainer.json.hbs +29 -0
  57. package/templates/.devcontainer/docker-compose.yml.hbs +73 -0
  58. package/templates/.devcontainer/setup.sh.hbs +17 -0
  59. package/templates/.env.hbs +38 -15
  60. package/templates/.gitignore.hbs +2 -2
  61. package/templates/.lando.yml.hbs +88 -11
  62. package/templates/README.md.hbs +23 -7
  63. package/templates/composer.json.hbs +4 -3
  64. package/templates/package.json.hbs +0 -2
  65. package/templates/server/cmd/install-wp.sh.hbs +54 -43
  66. package/templates/server/cmd/setup-node.sh.hbs +11 -0
  67. package/templates/server/cmd/setup-php.sh.hbs +14 -0
  68. package/templates/server/www/vhosts.conf.hbs +54 -17
  69. package/templates/workspace.json.hbs +233 -40
  70. package/templates/wp-cli.yml.hbs +1 -0
@@ -0,0 +1,83 @@
1
+ # Job reutilizável — SSH Deploy via rsync
2
+ #
3
+ # Como usar no .gitlab-ci.yml principal:
4
+ #
5
+ # include:
6
+ # - local: '.gitlab/ci/deploy-ssh.yml'
7
+ #
8
+ # stages:
9
+ # - build
10
+ # - deploy
11
+ #
12
+ # Variáveis necessárias (Settings → CI/CD → Variables):
13
+ # SSH_PRIVATE_KEY — chave SSH privada (sem passphrase para CI)
14
+ # SSH_KNOWN_HOSTS — saída de: ssh-keyscan -H <host>
15
+ # DEPLOY_HOST — endereço do servidor (ex: meu-servidor.example.com)
16
+ # DEPLOY_USER — usuário SSH (ex: deploy)
17
+ # DEPLOY_PATH — caminho absoluto no servidor (ex: /var/www/html)
18
+ #
19
+ # O rsync usa --no-perms --no-owner --no-group, portanto não altera
20
+ # permissões nem proprietários existentes no servidor de destino.
21
+
22
+ .ssh-agent-setup: &ssh-agent-setup
23
+ - eval "$(ssh-agent -s)"
24
+ - echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
25
+ - mkdir -p ~/.ssh && chmod 700 ~/.ssh
26
+ - echo "$SSH_KNOWN_HOSTS" >> ~/.ssh/known_hosts && chmod 600 ~/.ssh/known_hosts
27
+
28
+ build:deps:
29
+ stage: build
30
+ image: composer:latest
31
+ script:
32
+ - composer install --no-dev --optimize-autoloader --no-interaction
33
+ artifacts:
34
+ paths:
35
+ - vendor/
36
+ expire_in: 1 hour
37
+ rules:
38
+ - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
39
+
40
+ build:assets:
41
+ stage: build
42
+ image: node:{{nodeVersion}}-alpine
43
+ before_script:
44
+ - apk add --no-cache git
45
+ script:
46
+ - |
47
+ {{#if ci.theme.paths.themeRoot}}
48
+ if [ -d "{{ci.theme.paths.themeRoot}}" ]; then
49
+ npm install --prefix "{{ci.theme.paths.themeRoot}}"
50
+ npm run build --prefix "{{ci.theme.paths.themeRoot}}"
51
+ fi
52
+ {{else}}
53
+ if [ -f package.json ]; then npm ci && npm run build --if-present; fi
54
+ {{/if}}
55
+ artifacts:
56
+ paths:
57
+ - content/themes/*/public/
58
+ - public/
59
+ expire_in: 1 hour
60
+ rules:
61
+ - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
62
+
63
+ deploy:ssh:
64
+ stage: deploy
65
+ image: alpine:latest
66
+ needs:
67
+ - job: build:deps
68
+ - job: build:assets
69
+ before_script:
70
+ - apk add --no-cache rsync openssh-client
71
+ - *ssh-agent-setup
72
+ script:
73
+ - |
74
+ rsync -avz --delete \
75
+ --no-perms --no-owner --no-group \
76
+ --exclude='.git' \
77
+ --exclude='.env' \
78
+ --exclude='node_modules' \
79
+ --exclude='node_modules/.cache' \
80
+ ./ \
81
+ "$DEPLOY_USER@$DEPLOY_HOST:$DEPLOY_PATH/"
82
+ rules:
83
+ - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
@@ -0,0 +1,26 @@
1
+ # Job reutilizável — Semantic Release
2
+ #
3
+ # Como usar no .gitlab-ci.yml principal:
4
+ #
5
+ # include:
6
+ # - local: '.gitlab/ci/release.yml'
7
+ #
8
+ # stages:
9
+ # - release
10
+ #
11
+ # Variáveis necessárias (Settings → CI/CD → Variables):
12
+ # GITLAB_TOKEN — Personal/Project Access Token com scope "api"
13
+ # NPM_TOKEN — Token npm (omita se o projeto não publicar no npm)
14
+
15
+ semantic-release:
16
+ stage: release
17
+ image: node:{{nodeVersion}}-alpine
18
+ rules:
19
+ - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
20
+ before_script:
21
+ - npm ci
22
+ script:
23
+ - npx semantic-release
24
+ variables:
25
+ GITLAB_TOKEN: $GITLAB_TOKEN
26
+ NPM_TOKEN: $NPM_TOKEN
@@ -1,4 +1,8 @@
1
- #!/bin/sh
2
- . "$(dirname "$0")/_/husky.sh"
3
-
4
- npx --no -- commitlint --edit "$1"
1
+ echo "🔍 Validating commit message..."
2
+ if command -v lando >/dev/null 2>&1 && lando info >/dev/null 2>&1; then
3
+ echo "🐳 Using Lando environment..."
4
+ lando commitlint --edit "$1"
5
+ else
6
+ echo "🏠 Using local environment..."
7
+ npx --no commitlint --edit "$1"
8
+ fi
@@ -1,6 +1,3 @@
1
- #!/bin/sh
2
- . "$(dirname "$0")/_/husky.sh"
3
-
4
1
  echo "🔍 Running pre-commit checks..."
5
2
 
6
3
  # Check if lint-staged config exists
@@ -1,10 +1,14 @@
1
1
  import path from 'path';
2
- import { execSync } from 'child_process';
2
+ import { execFileSync } from 'child_process';
3
3
 
4
4
  import fs from 'fs-extra';
5
5
 
6
6
  import { log, color } from '../../lib/utils/logger.js';
7
7
 
8
+ function runGitCommand(args, cwd, stdio = 'ignore') {
9
+ return execFileSync('git', args, { cwd, stdio });
10
+ }
11
+
8
12
  export async function setupModule(context, generator) {
9
13
  const gitDir = path.join(generator.cwd, '.git');
10
14
 
@@ -25,17 +29,14 @@ export async function setupModule(context, generator) {
25
29
 
26
30
  if (!(await fs.pathExists(gitDir))) {
27
31
  log(color.orange, '[git] Initializing Git repository');
28
- execSync('git init', { cwd: generator.cwd, stdio: 'ignore' });
32
+ runGitCommand(['init'], generator.cwd);
29
33
  await generator.copyFile('.gitmessage', 'git');
30
34
 
31
35
  if (context.defaultBranch && context.defaultBranch !== 'main') {
32
36
  try {
33
- execSync(`git branch -M ${context.defaultBranch}`, {
34
- cwd: generator.cwd,
35
- stdio: 'ignore',
36
- });
37
+ runGitCommand(['branch', '-M', context.defaultBranch], generator.cwd);
37
38
  log(color.green, `[git] Default branch set to: ${context.defaultBranch}`);
38
- } catch (error) {
39
+ } catch {
39
40
  log(color.yellow, '[git] Warning: Could not rename default branch');
40
41
  }
41
42
  }
@@ -50,39 +51,30 @@ export async function setupModule(context, generator) {
50
51
 
51
52
  for (const [key, value] of gitConfigs) {
52
53
  try {
53
- execSync(`git config ${key} ${value}`, {
54
- cwd: generator.cwd,
55
- stdio: 'ignore',
56
- });
57
- } catch (error) {
54
+ runGitCommand(['config', key, value], generator.cwd);
55
+ } catch {
58
56
  log(color.yellow, `[git] Warning: Could not set ${key}`);
59
57
  }
60
58
  }
61
59
 
62
60
  try {
63
- execSync(`git config user.name ${context.author}`, {
64
- cwd: generator.cwd,
65
- stdio: 'ignore',
66
- });
67
- } catch (error) {
61
+ runGitCommand(['config', 'user.name', context.author], generator.cwd);
62
+ } catch {
68
63
  log(color.yellow, `[git] Warning: Could not set user.name`);
69
64
  }
70
65
 
71
66
  try {
72
- execSync(`git config user.email ${context.authorEmail}`, {
73
- cwd: generator.cwd,
74
- stdio: 'ignore',
75
- });
76
- } catch (error) {
67
+ runGitCommand(['config', 'user.email', context.authorEmail], generator.cwd);
68
+ } catch {
77
69
  log(color.yellow, `[git] Warning: Could not set user.email`);
78
70
  }
79
71
 
80
72
  try {
81
- execSync(`git config commit.template ${path.join(generator.cwd, '.gitmessage')}`, {
82
- cwd: generator.cwd,
83
- stdio: 'ignore',
84
- });
85
- } catch (error) {
73
+ runGitCommand(
74
+ ['config', 'commit.template', path.join(generator.cwd, '.gitmessage')],
75
+ generator.cwd
76
+ );
77
+ } catch {
86
78
  log(color.yellow, `[git] Warning: Could not set commit.template`);
87
79
  }
88
80
  }
@@ -110,7 +102,7 @@ export async function setupModule(context, generator) {
110
102
  // Registra hook para fazer o commit inicial após todo o setup
111
103
  generator.hooks.addAction(
112
104
  'after_setup_complete',
113
- async (context, generator) => {
105
+ async (context, _generator) => {
114
106
  const projectGitDir = path.join(context.cwd, '.git');
115
107
  if (!(await fs.pathExists(projectGitDir))) {
116
108
  return; // Repositório não foi inicializado neste setup
@@ -120,16 +112,20 @@ export async function setupModule(context, generator) {
120
112
  log(color.blue, '[git] Making initial commit...');
121
113
 
122
114
  // Adiciona todos os arquivos
123
- execSync('git add .', {
124
- cwd: context.cwd,
125
- stdio: 'ignore',
126
- });
127
-
128
- // Faz o commit inicial
129
- execSync(`git commit -m "chore: initial project setup"`, {
130
- cwd: context.cwd,
131
- stdio: 'ignore',
132
- });
115
+ runGitCommand(['add', '.'], context.cwd);
116
+
117
+ // Ignora assinatura e hooks neste commit automático para não depender do ambiente local.
118
+ runGitCommand(
119
+ [
120
+ '-c',
121
+ 'commit.gpgsign=false',
122
+ 'commit',
123
+ '--no-verify',
124
+ '-m',
125
+ 'chore: initial project setup',
126
+ ],
127
+ context.cwd
128
+ );
133
129
 
134
130
  log(color.green, '[git] ✅ Initial commit created successfully');
135
131
  } catch (error) {
@@ -1,5 +1,13 @@
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
+ 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
@@ -1,4 +1,4 @@
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
+ { "scripts": { "prepare": "husky", "commit": "lando git-cz" }, "devDependencies": {
2
+ "@commitlint/cli": "^19.7.1", "@commitlint/config-conventional": "^19.7.1", "@commitlint/prompt":
3
+ "^19.5.0", "commitizen": "^4.3.1", "husky": "^9.0.11",
4
+ "lint-staged": "^15.5.0" } }
@@ -1,28 +1,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": [] } ] } }
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
+ }
@@ -1,2 +1,10 @@
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
+ tooling:
2
+ eslint:
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,4 +1,4 @@
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
+ { "scripts": { "format": "prettier --write .", "lint": "lando eslint .", "lint:fix":
2
+ "lando eslint . --fix" }, "devDependencies": { "globals": "^16.3.0",
3
+ "@eslint/eslintrc": "^3.3.1", "@eslint/js": "^9.30.1", "eslint": "^9.30.1",
4
+ "eslint-config-prettier": "^10.1.5", "eslint-plugin-prettier": "^5.3.1", "prettier": "^3.6.2" } }
@@ -1,15 +1,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" ] } }
1
+ {
2
+ "settings": {
3
+ "editor.defaultFormatter": "esbenp.prettier-vscode",
4
+ "editor.formatOnSave": false,
5
+ "editor.codeActionsOnSave": {
6
+ "source.fixAll": true,
7
+ "source.fixAll.eslint": true,
8
+ "source.organizeImports": true
9
+ },
10
+ "prettier.requireConfig": true,
11
+ "prettier.useEditorConfig": true,
12
+ "[blade]": {
13
+ "editor.defaultFormatter": "esbenp.prettier-vscode",
14
+ "editor.formatOnSave": false,
15
+ "editor.insertSpaces": true,
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,2 +1,11 @@
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
1
+ tooling:
2
+ pint:
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 +1 @@
1
- { "require-dev": { "laravel/pint": "^1.23", "phpunit/phpunit": "^9.5" } }
1
+ { "require-dev": { "laravel/pint": "^1.29", "phpunit/phpunit": "^11.5", "phpstan/phpstan": "^2.1", "phpstan/extension-installer": "^1.4", "szepeviktor/phpstan-wordpress": "^2.0", "php-stubs/wordpress-stubs": "^6.8" }, "config": { "allow-plugins": { "phpstan/extension-installer": true } } }
@@ -1,15 +1,74 @@
1
- { "settings": { "php.validate.enable": true, "php.validate.executablePath":
2
- "${workspaceFolder}/scripts/php-wrapper.sh", "php.validate.run": "onSave", "php.suggest.basic":
3
- false, "intelephense.files.maxSize": 5000000, "intelephense.files.exclude": [ "**/.git/**",
4
- "**/node_modules/**", "**/vendor/**/{Test,test,Tests,tests}/**", "**/.lando/**", "**/wp/**",
5
- "**/content/cache/**" ], "intelephense.stubs": [ "wordpress" ], "[php]": {
6
- "editor.defaultFormatter": "open-southeners.laravel-pint", "editor.formatOnSave": true,
7
- "editor.insertSpaces": true, "editor.tabSize": 4 } }, "extensions": { "recommendations": [
8
- "open-southeners.laravel-pint" ] }, "tasks": { "tasks": [ { "label": "🔧 PHP: Fix Code Style
9
- (Pint)", "type": "shell", "command": "lando", "args": ["pint"], "group": "build", "presentation": {
10
- "echo": true, "reveal": "always", "focus": false, "panel": "shared" }, "problemMatcher": [] }, {
11
- "label": "🔍 PHP: Check Code Style (Pint)", "type": "shell", "command": "lando", "args": ["pint",
12
- "--test"], "group": "test", "presentation": { "echo": true, "reveal": "always", "focus": false,
13
- "panel": "shared" }, "problemMatcher": { "owner": "pint", "fileLocation": "absolute", "pattern": {
14
- "regexp": "^(.*):(\\d+):(\\d+):\\s+(warning|error)\\s+-\\s+(.*)$", "file": 1, "line": 2, "column":
15
- 3, "severity": 4, "message": 5 } } } ] } }
1
+ {
2
+ "settings": {
3
+ "php.validate.enable": true,
4
+ "php.validate.executablePath": "${workspaceFolder}/scripts/php-wrapper.sh",
5
+ "php.validate.run": "onSave",
6
+ "php.suggest.basic": false,
7
+ "intelephense.files.maxSize": 5000000,
8
+ "intelephense.files.exclude": [
9
+ "**/.git/**",
10
+ "**/node_modules/**",
11
+ "**/vendor/**/{Test,test,Tests,tests}/**",
12
+ "**/.lando/**",
13
+ "**/wp/**",
14
+ "**/content/cache/**"
15
+ ],
16
+ "intelephense.stubs": [
17
+ "wordpress"
18
+ ],
19
+ "[php]": {
20
+ "editor.defaultFormatter": "open-southeners.laravel-pint",
21
+ "editor.formatOnSave": true,
22
+ "editor.insertSpaces": true,
23
+ "editor.tabSize": 4
24
+ }
25
+ },
26
+ "extensions": {
27
+ "recommendations": [
28
+ "open-southeners.laravel-pint"
29
+ ]
30
+ },
31
+ "tasks": {
32
+ "tasks": [
33
+ {
34
+ "label": "🔧 PHP: Fix Code Style (Pint)",
35
+ "type": "shell",
36
+ "command": "lando",
37
+ "args": ["pint"],
38
+ "group": "build",
39
+ "presentation": {
40
+ "echo": true,
41
+ "reveal": "always",
42
+ "focus": false,
43
+ "panel": "shared"
44
+ },
45
+ "problemMatcher": []
46
+ },
47
+ {
48
+ "label": "🔍 PHP: Check Code Style (Pint)",
49
+ "type": "shell",
50
+ "command": "lando",
51
+ "args": ["pint", "--test"],
52
+ "group": "test",
53
+ "presentation": {
54
+ "echo": true,
55
+ "reveal": "always",
56
+ "focus": false,
57
+ "panel": "shared"
58
+ },
59
+ "problemMatcher": {
60
+ "owner": "pint",
61
+ "fileLocation": "absolute",
62
+ "pattern": {
63
+ "regexp": "^(.*):(\\d+):(\\d+):\\s+(warning|error)\\s+-\\s+(.*)$",
64
+ "file": 1,
65
+ "line": 2,
66
+ "column": 3,
67
+ "severity": 4,
68
+ "message": 5
69
+ }
70
+ }
71
+ }
72
+ ]
73
+ }
74
+ }