@codigodoleo/wp-kit 3.1.0 → 3.1.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.
@@ -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,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,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,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
+ }
@@ -1 +1,8 @@
1
- services: cache: type: redis:6 tooling: redis-cli: service: cache cmd: redis-cli
1
+ services:
2
+ cache:
3
+ type: redis:6
4
+
5
+ tooling:
6
+ redis-cli:
7
+ service: cache
8
+ cmd: redis-cli
@@ -1,20 +1,63 @@
1
- events: post-start: - cd /app/content/themes/{{projectName}}
2
- && composer install --no-interaction --no-progress --optimize-autoloader - cd /app/content/themes/{{projectName}}
3
- && yarn install && yarn build - wp theme activate
4
- {{projectName}}
5
- - cd /app/content/themes/{{projectName}}
6
- && wp acorn optimize:clear && wp acorn optimize tooling: theme-build: service: appserver
7
- description: "Build the Sage theme" dir: /app/content/themes/{{projectName}}
8
- cmd: - composer install --no-interaction --no-progress --optimize-autoloader - yarn install - yarn
9
- build theme-lint: service: appserver description: "Lint the Sage theme" dir: /app/content/themes/{{projectName}}
10
- cmd: - yarn lint - pint --test theme-dev: service: appserver description: "Dev the Sage theme" dir:
11
- /app/content/themes/{{projectName}}
12
- cmd: - yarn dev acorn-make: service: appserver description: Create new Acorn classes interactively
13
- dir: /app/content/themes/{{projectName}}
14
- cmd: wp acorn make:$ACORN_TYPE $ACORN_NAME options: type: passthrough: true alias: - t describe:
15
- Type of class to create interactive: type: list message: What type of class would you like to
16
- create? choices: - name: Command (Artisan command) value: command - name: Component (View component
17
- class) value: component - name: Composer (View composer class) value: composer - name: Provider
18
- (Service provider class) value: provider weight: 100 env: ACORN_TYPE filename: passthrough: true
19
- alias: - n describe: Name of the class to create interactive: type: input message: What is the name
20
- of the class? weight: 200 env: ACORN_NAME
1
+ events:
2
+ post-start:
3
+ - cd /app/content/themes/{{projectName}} && composer install --no-interaction --no-progress --optimize-autoloader
4
+ - cd /app/content/themes/{{projectName}} && yarn install && yarn build
5
+ - wp theme activate {{projectName}}
6
+ - cd /app/content/themes/{{projectName}} && wp acorn optimize:clear && wp acorn optimize
7
+ tooling:
8
+ theme-build:
9
+ service: appserver
10
+ description: "Build the Sage theme"
11
+ dir: /app/content/themes/{{projectName}}
12
+ cmd:
13
+ - composer install --no-interaction --no-progress --optimize-autoloader
14
+ - yarn install
15
+ - yarn build
16
+ theme-lint:
17
+ service: appserver
18
+ description: "Lint the Sage theme"
19
+ dir: /app/content/themes/{{projectName}}
20
+ cmd:
21
+ - yarn lint
22
+ - pint --test
23
+ theme-dev:
24
+ service: appserver
25
+ description: "Dev the Sage theme"
26
+ dir: /app/content/themes/{{projectName}}
27
+ cmd:
28
+ - yarn dev
29
+ acorn-make:
30
+ service: appserver
31
+ description: Create new Acorn classes interactively
32
+ dir: /app/content/themes/{{projectName}}
33
+ cmd: wp acorn make:$ACORN_TYPE $ACORN_NAME
34
+ options:
35
+ type:
36
+ passthrough: true
37
+ alias:
38
+ - t
39
+ describe: Type of class to create
40
+ interactive:
41
+ type: list
42
+ message: What type of class would you like to create?
43
+ choices:
44
+ - name: Command (Artisan command)
45
+ value: command
46
+ - name: Component (View component class)
47
+ value: component
48
+ - name: Composer (View composer class)
49
+ value: composer
50
+ - name: Provider (Service provider class)
51
+ value: provider
52
+ weight: 100
53
+ env: ACORN_TYPE
54
+ filename:
55
+ passthrough: true
56
+ alias:
57
+ - n
58
+ describe: Name of the class to create
59
+ interactive:
60
+ type: input
61
+ message: What is the name of the class?
62
+ weight: 200
63
+ env: ACORN_NAME
@@ -1,12 +1,67 @@
1
- { "folders": [ { "path": "./content/themes/{{projectName}}", "name": "🎨 Theme" } ], "settings": {
2
- "gitlens.hovers.detailsMarkdownFormat": "testing" }, "tasks": { "tasks": [ { "label": "🏗️ Theme:
3
- Build Assets", "type": "shell", "command": "lando", "args": ["yarn", "build"], "options": { "cwd":
4
- "${workspaceFolder}/content/themes/wordpress-dev" }, "group": "build", "presentation": { "echo":
5
- true, "reveal": "always", "focus": false, "panel": "shared" }, "problemMatcher": [] }, { "label":
6
- "👀 Theme: Watch Assets", "type": "shell", "command": "lando", "args": ["yarn", "dev"], "options": {
7
- "cwd": "${workspaceFolder}/content/themes/wordpress-dev" }, "group": "build", "isBackground": true,
8
- "presentation": { "echo": true, "reveal": "always", "focus": false, "panel": "shared" },
9
- "problemMatcher": [] }, { "label": "📦 Theme: Composer Install", "type": "shell", "command":
10
- "lando", "args": ["composer", "install"], "options": { "cwd":
11
- "${workspaceFolder}/content/themes/wordpress-dev" }, "group": "build", "presentation": { "echo":
12
- true, "reveal": "always", "focus": false, "panel": "shared" }, "problemMatcher": [] } ] } }
1
+ {
2
+ "folders": [
3
+ {
4
+ "path": "./content/themes/{{projectName}}",
5
+ "name": "🎨 Theme"
6
+ }
7
+ ],
8
+ "settings": {
9
+ "gitlens.hovers.detailsMarkdownFormat": "testing"
10
+ },
11
+ "tasks": {
12
+ "tasks": [
13
+ {
14
+ "label": "🏗️ Theme: Build Assets",
15
+ "type": "shell",
16
+ "command": "lando",
17
+ "args": ["yarn", "build"],
18
+ "options": {
19
+ "cwd": "${workspaceFolder}/content/themes/{{projectName}}"
20
+ },
21
+ "group": "build",
22
+ "presentation": {
23
+ "echo": true,
24
+ "reveal": "always",
25
+ "focus": false,
26
+ "panel": "shared"
27
+ },
28
+ "problemMatcher": []
29
+ },
30
+ {
31
+ "label": "👀 Theme: Watch Assets",
32
+ "type": "shell",
33
+ "command": "lando",
34
+ "args": ["yarn", "dev"],
35
+ "options": {
36
+ "cwd": "${workspaceFolder}/content/themes/{{projectName}}"
37
+ },
38
+ "group": "build",
39
+ "isBackground": true,
40
+ "presentation": {
41
+ "echo": true,
42
+ "reveal": "always",
43
+ "focus": false,
44
+ "panel": "shared"
45
+ },
46
+ "problemMatcher": []
47
+ },
48
+ {
49
+ "label": "📦 Theme: Composer Install",
50
+ "type": "shell",
51
+ "command": "lando",
52
+ "args": ["composer", "install"],
53
+ "options": {
54
+ "cwd": "${workspaceFolder}/content/themes/{{projectName}}"
55
+ },
56
+ "group": "build",
57
+ "presentation": {
58
+ "echo": true,
59
+ "reveal": "always",
60
+ "focus": false,
61
+ "panel": "shared"
62
+ },
63
+ "problemMatcher": []
64
+ }
65
+ ]
66
+ }
67
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codigodoleo/wp-kit",
3
- "version": "3.1.0",
3
+ "version": "3.1.1",
4
4
  "description": "Kit opinativo para padronizar projetos WordPress com CI/CD dinâmico.",
5
5
  "main": "bin/index.js",
6
6
  "bin": {
@@ -1,11 +1,44 @@
1
- name:
2
- {{projectName}}
3
- recipe: wordpress config: webroot: ./ via: nginx php: "{{phpVersion}}" xdebug: true
4
- extra_php_extensions: - bcmath - exif - gd - mysqli - zip - imagick - redis config: php:
5
- ./server/php/php.ini vhosts: ./server/www/vhosts.conf env_file: - .env services: appserver:
6
- build_as_root: - apt-get update - apt-get install -y curl gnupg - curl -fsSL
7
- https://deb.nodesource.com/setup_23.x | bash - - apt-get install -y nodejs - npm install -g
8
- npm@latest - npm install -g yarn@1.22 cache: type: redis:6 events: post-start: - bash
9
- ./server/cmd/install-wp.sh - composer install --no-interaction --no-progress --optimize-autoloader
10
- tooling: yarn: service: appserver yarn-upgrade: service: appserver cmd: yarn upgrade --latest
11
- yarn-clean-install: service: appserver cmd: - rm -rf node_modules - yarn install
1
+ name: {{projectName}}
2
+ recipe: wordpress
3
+ config:
4
+ webroot: ./
5
+ via: nginx
6
+ php: "{{phpVersion}}"
7
+ xdebug: true
8
+ extra_php_extensions:
9
+ - bcmath
10
+ - exif
11
+ - gd
12
+ - mysqli
13
+ - zip
14
+ - imagick
15
+ - redis
16
+ config:
17
+ php: ./server/php/php.ini
18
+ vhosts: ./server/www/vhosts.conf
19
+ env_file:
20
+ - .env
21
+ services:
22
+ appserver:
23
+ build_as_root:
24
+ - apt-get update
25
+ - apt-get install -y curl gnupg
26
+ - curl -fsSL https://deb.nodesource.com/setup_23.x | bash -
27
+ - apt-get install -y nodejs
28
+ - npm install -g npm@latest
29
+ - npm install -g yarn@1.22
30
+ events:
31
+ post-start:
32
+ - bash ./server/cmd/install-wp.sh
33
+ - composer install --no-interaction --no-progress --optimize-autoloader
34
+ tooling:
35
+ yarn:
36
+ service: appserver
37
+ yarn-upgrade:
38
+ service: appserver
39
+ cmd: yarn upgrade --latest
40
+ yarn-clean-install:
41
+ service: appserver
42
+ cmd:
43
+ - rm -rf node_modules
44
+ - yarn install
@@ -1,40 +1,177 @@
1
- { "folders": [ { "name": "🌿
2
- {{projectName}}", "path": "." } ], "settings": { "git.inputValidation": "always",
3
- "git.inputValidationLength": 100, "git.inputValidationSubjectLength": 100, "git.confirmSync": false,
4
- "git.autofetch": true, "git.enableSmartCommit": true, "git.suggestSmartCommit": true,
5
- "git.autoStash": true, "git.allowNoVerifyCommit": false, "editor.formatOnSave": false,
6
- "editor.codeActionsOnSave": { "source.fixAll.eslint": "explicit", "source.organizeImports":
7
- "explicit" }, "editor.tabSize": 4, "editor.insertSpaces": true, "search.exclude": {
8
- "**/node_modules": true, "**/vendor": true, "**/.lando": true, "**/public/build": true, "**/dist":
9
- true, "**/.git": true, "**/wp": true }, "files.exclude": { "**/node_modules": true, "**/vendor":
10
- true, "**/.git": true, "**/.DS_Store": true, "**/Thumbs.db": true },
11
- "extensions.ignoreRecommendations": false, "emmet.includeLanguages": { "blade": "html", "php":
12
- "html" }, "files.autoSave": "onFocusChange", "files.trimTrailingWhitespace": true,
13
- "files.insertFinalNewline": true }, "extensions": { "recommendations": [ "eamodio.gitlens",
14
- "ms-vscode.vscode-json", "streetsidesoftware.code-spell-checker",
15
- "vivaxy.vscode-conventional-commits", "bmewburn.vscode-intelephense-client",
16
- "wordpresstoolbox.wordpress-toolbox", "tungvn.wordpress-snippet", "junstyle.php-cs-fixer",
17
- "felixfbecker.php-debug", "esbenp.prettier-vscode", "dbaeumer.vscode-eslint",
18
- "bradlc.vscode-tailwindcss", "ms-azuretools.vscode-docker", "ms-vscode-remote.remote-containers",
19
- "ms-vscode.vscode-typescript-next", "formulahendry.auto-rename-tag",
20
- "christian-kohler.path-intellisense", "ms-vscode.vscode-todo-highlight", "mhutchie.git-graph",
21
- "pkief.material-icon-theme", "zhuangtongfa.material-theme", "xdebug.php-debug",
22
- "yzhang.markdown-all-in-one", "davidanson.vscode-markdownlint", "editorconfig.editorconfig",
23
- "ms-vscode.js-debug", "johnbillion.vscode-wordpress-hooks", "valeryanm.vscode-phpsab",
24
- "GitHub.copilot", "GitHub.copilot-chat", "ms-vscode-remote.remote-wsl", "Catppuccin.catppuccin-vsc",
25
- "sainnhe.everforest" ] }, "tasks": { "version": "2.0.0", "tasks": [ { "label": "🚀 Lando: Start",
26
- "type": "shell", "command": "lando", "args": ["start"], "group": "build", "presentation": { "echo":
27
- true, "reveal": "always", "focus": false, "panel": "shared" }, "isBackground": true,
28
- "problemMatcher": [] }, { "label": "🛑 Lando: Stop", "type": "shell", "command": "lando", "args":
29
- ["stop"], "group": "build", "presentation": { "echo": true, "reveal": "always", "focus": false,
30
- "panel": "shared" }, "problemMatcher": [] }, { "label": "ℹ️ Lando: Info", "type": "shell",
31
- "command": "lando", "args": ["info"], "group": "build", "presentation": { "echo": true, "reveal":
32
- "always", "focus": false, "panel": "shared" }, "problemMatcher": [] }, { "label": "🌐 Yarn: Install
33
- (Node)", "type": "shell", "command": "lando", "args": ["yarn", "install"], "group": "build",
34
- "presentation": { "echo": true, "reveal": "always", "focus": false, "panel": "shared" },
35
- "problemMatcher": [] }, { "label": "📦 Composer: Install Dependencies", "type": "shell", "command":
36
- "lando", "args": ["composer", "install"], "group": "build", "presentation": { "echo": true,
37
- "reveal": "always", "focus": false, "panel": "shared" }, "problemMatcher": [] }, { "label": "🗄️
38
- Redis CLI", "type": "shell", "command": "lando", "args": ["redis-cli"], "group": "build",
39
- "presentation": { "echo": true, "reveal": "always", "focus": false, "panel": "shared" },
40
- "problemMatcher": [] } ] } }
1
+ {
2
+ "folders": [
3
+ {
4
+ "name": "🌿 {{projectName}}",
5
+ "path": "."
6
+ }
7
+ ],
8
+ "settings": {
9
+ "git.inputValidation": "always",
10
+ "git.inputValidationLength": 100,
11
+ "git.inputValidationSubjectLength": 100,
12
+ "git.confirmSync": false,
13
+ "git.autofetch": true,
14
+ "git.enableSmartCommit": true,
15
+ "git.suggestSmartCommit": true,
16
+ "git.autoStash": true,
17
+ "git.allowNoVerifyCommit": false,
18
+ "editor.formatOnSave": false,
19
+ "editor.codeActionsOnSave": {
20
+ "source.fixAll.eslint": "explicit",
21
+ "source.organizeImports": "explicit"
22
+ },
23
+ "editor.tabSize": 4,
24
+ "editor.insertSpaces": true,
25
+ "search.exclude": {
26
+ "**/node_modules": true,
27
+ "**/vendor": true,
28
+ "**/.lando": true,
29
+ "**/public/build": true,
30
+ "**/dist": true,
31
+ "**/.git": true,
32
+ "**/wp": true
33
+ },
34
+ "files.exclude": {
35
+ "**/node_modules": true,
36
+ "**/vendor": true,
37
+ "**/.git": true,
38
+ "**/.DS_Store": true,
39
+ "**/Thumbs.db": true
40
+ },
41
+ "extensions.ignoreRecommendations": false,
42
+ "emmet.includeLanguages": {
43
+ "blade": "html",
44
+ "php": "html"
45
+ },
46
+ "files.autoSave": "onFocusChange",
47
+ "files.trimTrailingWhitespace": true,
48
+ "files.insertFinalNewline": true
49
+ },
50
+ "extensions": {
51
+ "recommendations": [
52
+ "eamodio.gitlens",
53
+ "ms-vscode.vscode-json",
54
+ "streetsidesoftware.code-spell-checker",
55
+ "vivaxy.vscode-conventional-commits",
56
+ "bmewburn.vscode-intelephense-client",
57
+ "wordpresstoolbox.wordpress-toolbox",
58
+ "tungvn.wordpress-snippet",
59
+ "junstyle.php-cs-fixer",
60
+ "felixfbecker.php-debug",
61
+ "esbenp.prettier-vscode",
62
+ "dbaeumer.vscode-eslint",
63
+ "bradlc.vscode-tailwindcss",
64
+ "ms-azuretools.vscode-docker",
65
+ "ms-vscode-remote.remote-containers",
66
+ "ms-vscode.vscode-typescript-next",
67
+ "formulahendry.auto-rename-tag",
68
+ "christian-kohler.path-intellisense",
69
+ "ms-vscode.vscode-todo-highlight",
70
+ "mhutchie.git-graph",
71
+ "pkief.material-icon-theme",
72
+ "zhuangtongfa.material-theme",
73
+ "xdebug.php-debug",
74
+ "yzhang.markdown-all-in-one",
75
+ "davidanson.vscode-markdownlint",
76
+ "editorconfig.editorconfig",
77
+ "ms-vscode.js-debug",
78
+ "johnbillion.vscode-wordpress-hooks",
79
+ "valeryanm.vscode-phpsab",
80
+ "GitHub.copilot",
81
+ "GitHub.copilot-chat",
82
+ "ms-vscode-remote.remote-wsl",
83
+ "Catppuccin.catppuccin-vsc",
84
+ "sainnhe.everforest"
85
+ ]
86
+ },
87
+ "tasks": {
88
+ "version": "2.0.0",
89
+ "tasks": [
90
+ {
91
+ "label": "🚀 Lando: Start",
92
+ "type": "shell",
93
+ "command": "lando",
94
+ "args": ["start"],
95
+ "group": "build",
96
+ "presentation": {
97
+ "echo": true,
98
+ "reveal": "always",
99
+ "focus": false,
100
+ "panel": "shared"
101
+ },
102
+ "isBackground": true,
103
+ "problemMatcher": []
104
+ },
105
+ {
106
+ "label": "🛑 Lando: Stop",
107
+ "type": "shell",
108
+ "command": "lando",
109
+ "args": ["stop"],
110
+ "group": "build",
111
+ "presentation": {
112
+ "echo": true,
113
+ "reveal": "always",
114
+ "focus": false,
115
+ "panel": "shared"
116
+ },
117
+ "problemMatcher": []
118
+ },
119
+ {
120
+ "label": "ℹ️ Lando: Info",
121
+ "type": "shell",
122
+ "command": "lando",
123
+ "args": ["info"],
124
+ "group": "build",
125
+ "presentation": {
126
+ "echo": true,
127
+ "reveal": "always",
128
+ "focus": false,
129
+ "panel": "shared"
130
+ },
131
+ "problemMatcher": []
132
+ },
133
+ {
134
+ "label": "🌐 Yarn: Install (Node)",
135
+ "type": "shell",
136
+ "command": "lando",
137
+ "args": ["yarn", "install"],
138
+ "group": "build",
139
+ "presentation": {
140
+ "echo": true,
141
+ "reveal": "always",
142
+ "focus": false,
143
+ "panel": "shared"
144
+ },
145
+ "problemMatcher": []
146
+ },
147
+ {
148
+ "label": "📦 Composer: Install Dependencies",
149
+ "type": "shell",
150
+ "command": "lando",
151
+ "args": ["composer", "install"],
152
+ "group": "build",
153
+ "presentation": {
154
+ "echo": true,
155
+ "reveal": "always",
156
+ "focus": false,
157
+ "panel": "shared"
158
+ },
159
+ "problemMatcher": []
160
+ },
161
+ {
162
+ "label": "🗄️ Redis CLI",
163
+ "type": "shell",
164
+ "command": "lando",
165
+ "args": ["redis-cli"],
166
+ "group": "build",
167
+ "presentation": {
168
+ "echo": true,
169
+ "reveal": "always",
170
+ "focus": false,
171
+ "panel": "shared"
172
+ },
173
+ "problemMatcher": []
174
+ }
175
+ ]
176
+ }
177
+ }