@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,15 @@
|
|
|
1
|
+
export async function setupModule(context, generator) {
|
|
2
|
+
await generator.copyFile('.eslintrc.json', 'lint');
|
|
3
|
+
await generator.copyFile('.prettierrc.json', 'lint');
|
|
4
|
+
|
|
5
|
+
await generator.copyFile('.prettierrc.json', 'lint');
|
|
6
|
+
await generator.copyFile('.prettierignore', 'lint');
|
|
7
|
+
|
|
8
|
+
await generator.copyFile('pint.json', 'lint');
|
|
9
|
+
|
|
10
|
+
if (context.enable_stylelint) {
|
|
11
|
+
await generator.copyFile('.stylelintrc.json', 'lint');
|
|
12
|
+
await generator.copyFile('.stylelintignore', 'lint');
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"preset": "psr12",
|
|
3
|
+
"rules": {
|
|
4
|
+
"array_syntax": {
|
|
5
|
+
"syntax": "short"
|
|
6
|
+
},
|
|
7
|
+
"binary_operator_spaces": {
|
|
8
|
+
"default": "single_space"
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
"exclude": [
|
|
12
|
+
"wp",
|
|
13
|
+
"content",
|
|
14
|
+
"vendor",
|
|
15
|
+
"node_modules",
|
|
16
|
+
".git",
|
|
17
|
+
"storage",
|
|
18
|
+
"bootstrap/cache",
|
|
19
|
+
"public/build",
|
|
20
|
+
"public/hot",
|
|
21
|
+
"public/storage",
|
|
22
|
+
"public/vendor",
|
|
23
|
+
"tests/coverage",
|
|
24
|
+
"tests/reports"
|
|
25
|
+
]
|
|
26
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// modules/lint/prompts.js
|
|
2
|
+
export default [
|
|
3
|
+
{
|
|
4
|
+
type: 'confirm',
|
|
5
|
+
name: 'enable_lint',
|
|
6
|
+
message: 'Enable linting and formatting tools (ESLint + Prettier)?',
|
|
7
|
+
default: true
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
type: 'confirm',
|
|
11
|
+
name: 'enable_stylelint',
|
|
12
|
+
message: 'Include Stylelint config?',
|
|
13
|
+
default: true,
|
|
14
|
+
when: (answers) => answers.enable_lint
|
|
15
|
+
}
|
|
16
|
+
];
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"scripts": {
|
|
3
|
+
"format": "prettier --write .",
|
|
4
|
+
"lint": "lando eslint . --ext .js,.ts",
|
|
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
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
# PHP Wrapper Script for Lando/Local Environment Detection
|
|
4
|
+
# This script automatically detects whether to use Lando or local PHP
|
|
5
|
+
|
|
6
|
+
# Function to check if Lando is available and project is running
|
|
7
|
+
check_lando() {
|
|
8
|
+
if command -v lando &> /dev/null && [ -f .lando.yml ]; then
|
|
9
|
+
# Check if Lando project is running
|
|
10
|
+
if lando info &> /dev/null 2>&1; then
|
|
11
|
+
return 0
|
|
12
|
+
fi
|
|
13
|
+
fi
|
|
14
|
+
return 1
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
# Function to check if local PHP is available
|
|
18
|
+
check_local_php() {
|
|
19
|
+
if command -v php &> /dev/null; then
|
|
20
|
+
return 0
|
|
21
|
+
fi
|
|
22
|
+
return 1
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
# Main execution logic
|
|
26
|
+
if check_lando; then
|
|
27
|
+
# Use Lando PHP
|
|
28
|
+
exec lando php "$@"
|
|
29
|
+
elif check_local_php; then
|
|
30
|
+
# Use local PHP as fallback
|
|
31
|
+
exec php "$@"
|
|
32
|
+
else
|
|
33
|
+
echo "Error: No PHP executable found (neither Lando nor local)" >&2
|
|
34
|
+
echo "Please ensure either:" >&2
|
|
35
|
+
echo " 1. Lando is running: lando start" >&2
|
|
36
|
+
echo " 2. PHP is installed locally" >&2
|
|
37
|
+
exit 1
|
|
38
|
+
fi
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
# Pint Wrapper Script for Lando/Local Environment Detection
|
|
4
|
+
# This script automatically detects whether to use Lando or local Pint
|
|
5
|
+
|
|
6
|
+
# Function to check if Lando is available and project is running
|
|
7
|
+
check_lando() {
|
|
8
|
+
if command -v lando &> /dev/null && [ -f .lando.yml ]; then
|
|
9
|
+
# Check if Lando project is running
|
|
10
|
+
if lando info &> /dev/null 2>&1; then
|
|
11
|
+
return 0
|
|
12
|
+
fi
|
|
13
|
+
fi
|
|
14
|
+
return 1
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
# Function to check if local Pint is available
|
|
18
|
+
check_local_pint() {
|
|
19
|
+
if [ -f ./vendor/bin/pint ]; then
|
|
20
|
+
return 0
|
|
21
|
+
elif command -v pint &> /dev/null; then
|
|
22
|
+
return 0
|
|
23
|
+
fi
|
|
24
|
+
return 1
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
# Main execution logic
|
|
28
|
+
if check_lando; then
|
|
29
|
+
# Use Lando Pint
|
|
30
|
+
exec lando pint "$@"
|
|
31
|
+
elif [ -f ./vendor/bin/pint ]; then
|
|
32
|
+
# Use project-local Pint
|
|
33
|
+
exec ./vendor/bin/pint "$@"
|
|
34
|
+
elif command -v pint &> /dev/null; then
|
|
35
|
+
# Use globally installed Pint
|
|
36
|
+
exec pint "$@"
|
|
37
|
+
else
|
|
38
|
+
echo "Error: Pint not found" >&2
|
|
39
|
+
echo "Please ensure either:" >&2
|
|
40
|
+
echo " 1. Lando is running: lando start" >&2
|
|
41
|
+
echo " 2. Pint is installed via Composer in project or theme" >&2
|
|
42
|
+
echo " 3. Pint is installed globally" >&2
|
|
43
|
+
exit 1
|
|
44
|
+
fi
|
|
@@ -0,0 +1,74 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
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
|
+
const themeDir = path.join(context.cwd, 'content', 'themes', context.projectName);
|
|
8
|
+
const relativeThemeDir = `content/themes/${context.projectName}`;
|
|
9
|
+
|
|
10
|
+
await fs.ensureDir(themeDir);
|
|
11
|
+
|
|
12
|
+
const cmd = `composer create-project roots/sage ${themeDir} ${context.sageVersion === '11' ? 'v11.0.1' : 'v10.8.2'} --no-interaction --ignore-platform-reqs`;
|
|
13
|
+
|
|
14
|
+
log(color.blue, `[sage] Installing Sage theme at: ${themeDir}`);
|
|
15
|
+
execSync(cmd, { stdio: 'inherit' });
|
|
16
|
+
|
|
17
|
+
await generator.generateFile('theme/vite.config.js', context, 'sage', `${relativeThemeDir}/vite.config.js`);
|
|
18
|
+
await generator.generateFile('theme/style.css', context, 'sage', `${relativeThemeDir}/style.css`);
|
|
19
|
+
|
|
20
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export default [
|
|
2
|
+
{
|
|
3
|
+
type: 'confirm',
|
|
4
|
+
name: 'enable_sage',
|
|
5
|
+
message: 'Enable Sage theme?',
|
|
6
|
+
default: true
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
type: 'list',
|
|
10
|
+
name: 'sageVersion',
|
|
11
|
+
message: 'Sage version:',
|
|
12
|
+
choices: ['11', '10'],
|
|
13
|
+
default: '11',
|
|
14
|
+
when: (answers) => answers.enable_sage
|
|
15
|
+
}
|
|
16
|
+
];
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
services:
|
|
2
|
+
appserver:
|
|
3
|
+
run:
|
|
4
|
+
- cd /app/content/themes/{{projectName}} && composer install --no-interaction --no-progress --optimize-autoloader
|
|
5
|
+
- cd /app/content/themes/{{projectName}} && yarn install && yarn build
|
|
6
|
+
- wp theme activate {{projectName}}
|
|
7
|
+
- cd /app/content/themes/{{projectName}} && wp acorn optimize:clear && wp acorn optimize
|
|
8
|
+
tooling:
|
|
9
|
+
theme-build:
|
|
10
|
+
service: appserver
|
|
11
|
+
description: "Build the Sage theme"
|
|
12
|
+
dir: /app/content/themes/{{projectName}}
|
|
13
|
+
cmd:
|
|
14
|
+
- composer install --no-interaction --no-progress --optimize-autoloader
|
|
15
|
+
- yarn install
|
|
16
|
+
- yarn build
|
|
17
|
+
theme-lint:
|
|
18
|
+
service: appserver
|
|
19
|
+
description: "Lint the Sage theme"
|
|
20
|
+
dir: /app/content/themes/{{projectName}}
|
|
21
|
+
cmd:
|
|
22
|
+
- yarn lint
|
|
23
|
+
- pint --test
|
|
24
|
+
theme-dev:
|
|
25
|
+
service: appserver
|
|
26
|
+
description: "Dev the Sage theme"
|
|
27
|
+
dir: /app/content/themes/{{projectName}}
|
|
28
|
+
cmd:
|
|
29
|
+
- yarn dev
|
|
30
|
+
acorn-make:
|
|
31
|
+
service: appserver
|
|
32
|
+
description: Create new Acorn classes interactively
|
|
33
|
+
dir: /app/content/themes/{{projectName}}
|
|
34
|
+
cmd: wp acorn make:$ACORN_TYPE $ACORN_NAME
|
|
35
|
+
options:
|
|
36
|
+
type:
|
|
37
|
+
passthrough: true
|
|
38
|
+
alias:
|
|
39
|
+
- t
|
|
40
|
+
describe: Type of class to create
|
|
41
|
+
interactive:
|
|
42
|
+
type: list
|
|
43
|
+
message: What type of class would you like to create?
|
|
44
|
+
choices:
|
|
45
|
+
- name: Command (Artisan command)
|
|
46
|
+
value: command
|
|
47
|
+
- name: Component (View component class)
|
|
48
|
+
value: component
|
|
49
|
+
- name: Composer (View composer class)
|
|
50
|
+
value: composer
|
|
51
|
+
- name: Provider (Service provider class)
|
|
52
|
+
value: provider
|
|
53
|
+
weight: 100
|
|
54
|
+
env: ACORN_TYPE
|
|
55
|
+
filename:
|
|
56
|
+
passthrough: true
|
|
57
|
+
alias:
|
|
58
|
+
- n
|
|
59
|
+
describe: Name of the class to create
|
|
60
|
+
interactive:
|
|
61
|
+
type: input
|
|
62
|
+
message: What is the name of the class?
|
|
63
|
+
weight: 200
|
|
64
|
+
env: ACORN_NAME
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "{{projectName}}/wordpress",
|
|
3
|
+
"type": "wordpress-theme",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"description": "{{projectDescription}}",
|
|
6
|
+
"authors": [
|
|
7
|
+
{
|
|
8
|
+
"name": "{{author}}",
|
|
9
|
+
"email": "{{authorEmail}}"
|
|
10
|
+
}
|
|
11
|
+
],
|
|
12
|
+
"support": { },
|
|
13
|
+
"require": {
|
|
14
|
+
"php": ">={{phpVersion}}",
|
|
15
|
+
"roots/acorn": "^5.0",
|
|
16
|
+
"log1x/sage-directives": "^2.0"
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Theme Name: {{projectName}}
|
|
3
|
+
Theme URI: {{gitRepository}}
|
|
4
|
+
Description: {{projectDescription}}
|
|
5
|
+
Version: {{projectVersion}}
|
|
6
|
+
Author: {{author}}
|
|
7
|
+
Author URI: {{gitRepository}}
|
|
8
|
+
Text Domain: {{projectName}}
|
|
9
|
+
License: MIT License
|
|
10
|
+
License URI: {{gitRepository}}/blob/main/LICENSE
|
|
11
|
+
Requires PHP: {{phpVersion}}
|
|
12
|
+
Requires at least: {{wpCoreVersion}}
|
|
13
|
+
*/
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import fs from 'fs';
|
|
2
|
+
import { defineConfig } from 'vite';
|
|
3
|
+
import tailwindcss from '@tailwindcss/vite';
|
|
4
|
+
import laravel from 'laravel-vite-plugin';
|
|
5
|
+
import { wordpressPlugin, wordpressThemeJson } from '@roots/vite-plugin';
|
|
6
|
+
|
|
7
|
+
export default defineConfig({
|
|
8
|
+
base: '/app/content/themes/{{projectName}}/',
|
|
9
|
+
plugins: [
|
|
10
|
+
tailwindcss(),
|
|
11
|
+
laravel({
|
|
12
|
+
input: [
|
|
13
|
+
'resources/css/app.css',
|
|
14
|
+
'resources/js/app.js',
|
|
15
|
+
'resources/css/editor.css',
|
|
16
|
+
'resources/js/editor.js',
|
|
17
|
+
],
|
|
18
|
+
refresh: true,
|
|
19
|
+
watch: {
|
|
20
|
+
usePolling: true,
|
|
21
|
+
interval: 1000,
|
|
22
|
+
ignored: ['node_modules', 'public/build/hot'],
|
|
23
|
+
},
|
|
24
|
+
}),
|
|
25
|
+
|
|
26
|
+
wordpressPlugin(),
|
|
27
|
+
|
|
28
|
+
// Generate the theme.json file in the public/build/assets directory
|
|
29
|
+
// based on the Tailwind config and the theme.json file from base theme folder
|
|
30
|
+
wordpressThemeJson({
|
|
31
|
+
disableTailwindColors: false,
|
|
32
|
+
disableTailwindFonts: false,
|
|
33
|
+
disableTailwindFontSizes: false,
|
|
34
|
+
}),
|
|
35
|
+
],
|
|
36
|
+
resolve: {
|
|
37
|
+
alias: {
|
|
38
|
+
'@scripts': '/resources/js',
|
|
39
|
+
'@styles': '/resources/css',
|
|
40
|
+
'@fonts': '/resources/fonts',
|
|
41
|
+
'@images': '/resources/images',
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
server: {
|
|
45
|
+
https: {
|
|
46
|
+
key: fs.readFileSync('/certs/cert.key'),
|
|
47
|
+
cert: fs.readFileSync('/certs/cert.crt'),
|
|
48
|
+
},
|
|
49
|
+
host: true,
|
|
50
|
+
port: 3009,
|
|
51
|
+
hmr: { host: 'localhost', protocol: 'wss' },
|
|
52
|
+
},
|
|
53
|
+
});
|
|
@@ -0,0 +1,67 @@
|
|
|
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/wordpress-dev"
|
|
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/wordpress-dev"
|
|
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/wordpress-dev"
|
|
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
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Arquivo específico do módulo test-directory.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { log, color } from '../../lib/utils/logger.js';
|
|
2
|
+
|
|
3
|
+
export async function setupModule(context, generator) {
|
|
4
|
+
log(color.blue, '[test-directory] Testing copyDirectory functionality...');
|
|
5
|
+
|
|
6
|
+
// Exemplo 1: Copiar pasta simples (sobrescrevendo por padrão)
|
|
7
|
+
await generator.copyDirectory('test-assets', 'test-directory');
|
|
8
|
+
|
|
9
|
+
// Exemplo 2: Copiar pasta com nome personalizado
|
|
10
|
+
await generator.copyDirectory('test-assets', 'test-directory', 'custom-assets');
|
|
11
|
+
|
|
12
|
+
// Exemplo 3: Copiar pasta sem sobrescrever
|
|
13
|
+
await generator.copyDirectory('test-assets', 'test-directory', 'protected-assets', false);
|
|
14
|
+
|
|
15
|
+
// Exemplo 4: Copiar pasta de um módulo específico
|
|
16
|
+
await generator.copyDirectory('assets', 'test-directory', 'module-assets');
|
|
17
|
+
|
|
18
|
+
log(color.green, '[test-directory] ✅ Directory copy tests completed');
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Este é um arquivo de teste para demonstrar a funcionalidade copyDirectory.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Segundo arquivo de teste para demonstrar a funcionalidade copyDirectory.
|