@codigodoleo/wp-kit 3.2.0 → 3.4.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/README.md +73 -194
- package/lib/core/infer-ci-capabilities.js +17 -0
- package/lib/prompts/index.js +64 -4
- package/modules/blank-theme/index.js +71 -0
- package/modules/blank-theme/lint/.prettierrc.json +12 -0
- package/modules/blank-theme/lint/.stylelintrc.json +7 -0
- package/modules/{lint → blank-theme/lint}/eslint.config.mjs +2 -8
- package/modules/blank-theme/lint/pint.json +11 -0
- package/modules/blank-theme/prompts.js +33 -0
- package/modules/blank-theme/templates/.lando.yml.hbs +26 -0
- package/modules/blank-theme/templates/functions.php.hbs +46 -0
- package/modules/blank-theme/templates/package.json.hbs +16 -0
- package/modules/blank-theme/templates/style.css.hbs +7 -0
- package/modules/blank-theme/templates/vite.config.js.hbs +23 -0
- package/modules/deploy/.github/workflows/deploy-docker.yml +2 -0
- package/modules/deploy/.github/workflows/deploy-ssh.yml +2 -0
- package/modules/deploy/.github/workflows/release.yml +2 -0
- package/modules/deploy/index.js +38 -0
- package/modules/deploy/templates/.github/workflows/ci.yml.hbs +29 -1
- package/modules/deploy/templates/.gitlab/ci/lint-blank-theme.yml.hbs +35 -0
- package/modules/deploy/templates/.gitlab/ci/lint-mu-plugin.yml.hbs +19 -0
- package/modules/deploy/templates/.gitlab/ci/lint-plugin.yml.hbs +19 -0
- package/modules/deploy/templates/.gitlab/ci/lint-sage.yml.hbs +47 -0
- package/modules/git/templates/workspace.json.hbs +1 -1
- package/modules/lint/.commitlintrc.json +21 -0
- package/modules/lint/.prettierignore +15 -25
- package/modules/lint/.prettierrc.json +5 -16
- package/modules/lint/index.js +75 -8
- package/modules/lint/prompts.js +1 -8
- package/modules/lint/templates/.lando.yml.hbs +3 -8
- package/modules/lint/templates/workspace.json.hbs +3 -3
- package/modules/mu-plugin/index.js +49 -0
- package/modules/mu-plugin/lint/.prettierrc.json +7 -0
- package/modules/mu-plugin/lint/eslint.config.mjs +30 -0
- package/modules/mu-plugin/lint/pint.json +11 -0
- package/modules/mu-plugin/prompts.js +23 -0
- package/modules/mu-plugin/templates/.lando.yml.hbs +15 -0
- package/modules/mu-plugin/templates/composer.json.hbs +14 -0
- package/modules/mu-plugin/templates/plugin.php.hbs +15 -0
- package/modules/php/templates/composer.json.hbs +15 -1
- package/modules/plugin/index.js +45 -0
- package/modules/plugin/lint/.prettierrc.json +7 -0
- package/modules/plugin/lint/eslint.config.mjs +30 -0
- package/modules/plugin/lint/pint.json +11 -0
- package/modules/plugin/prompts.js +23 -0
- package/modules/plugin/templates/.lando.yml.hbs +15 -0
- package/modules/plugin/templates/composer.json.hbs +14 -0
- package/modules/plugin/templates/plugin.php.hbs +15 -0
- package/modules/sage/index.js +25 -0
- package/modules/sage/lint/.prettierrc.json +12 -0
- package/modules/sage/lint/.stylelintrc.json +7 -0
- package/modules/sage/lint/eslint.config.mjs +30 -0
- package/modules/sage/lint/pint.json +11 -0
- package/modules/sage/prompts.js +22 -7
- package/modules/sage/templates/.devcontainer/docker-compose.override.yml.hbs +1 -3
- package/modules/sage/templates/.lando.yml.hbs +17 -5
- package/modules/sage/templates/theme/vite.config.js.hbs +4 -4
- package/package.json +7 -1
- package/templates/.devcontainer/docker-compose.yml.hbs +3 -0
- package/templates/.gitignore.hbs +84 -13
- package/templates/.lando.yml.hbs +2 -0
- package/templates/composer.json.hbs +60 -13
- package/templates/workspace.json.hbs +1 -1
- package/modules/lint/.eslintignore +0 -36
- package/modules/lint/.eslintrc.json +0 -8
- package/modules/lint/.stylelintignore +0 -19
- package/modules/lint/.stylelintrc.json +0 -9
- package/modules/lint/pint.json +0 -26
|
@@ -0,0 +1,30 @@
|
|
|
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: ['node_modules/**', 'vendor/**', 'dist/**'],
|
|
9
|
+
},
|
|
10
|
+
js.configs.recommended,
|
|
11
|
+
{
|
|
12
|
+
files: ['resources/**/*.{js,mjs,ts}'],
|
|
13
|
+
languageOptions: {
|
|
14
|
+
ecmaVersion: 2022,
|
|
15
|
+
sourceType: 'module',
|
|
16
|
+
globals: {
|
|
17
|
+
...globals.browser,
|
|
18
|
+
...globals.node,
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
plugins: {
|
|
22
|
+
prettier: prettierPlugin,
|
|
23
|
+
},
|
|
24
|
+
rules: {
|
|
25
|
+
'prettier/prettier': 'error',
|
|
26
|
+
'no-unused-vars': ['error', { argsIgnorePattern: '^_', varsIgnorePattern: '^_' }],
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
eslintConfigPrettier,
|
|
30
|
+
];
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export default [
|
|
2
|
+
{
|
|
3
|
+
type: 'input',
|
|
4
|
+
name: 'mu_plugin_name',
|
|
5
|
+
message: 'MU Plugin slug (used as directory name):',
|
|
6
|
+
default: (answers) => `${answers.projectName || 'wordpress'}-core`,
|
|
7
|
+
when: (answers) => answers.selectedContentModules?.includes('mu-plugin'),
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
type: 'confirm',
|
|
11
|
+
name: 'mu_plugin_lint_pint',
|
|
12
|
+
message: 'MU Plugin: enable Pint for PHP?',
|
|
13
|
+
default: true,
|
|
14
|
+
when: (answers) => answers.selectedContentModules?.includes('mu-plugin') && answers.enable_lint,
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
type: 'confirm',
|
|
18
|
+
name: 'mu_plugin_lint_eslint',
|
|
19
|
+
message: 'MU Plugin: enable ESLint for JS/TS?',
|
|
20
|
+
default: false,
|
|
21
|
+
when: (answers) => answers.selectedContentModules?.includes('mu-plugin') && answers.enable_lint,
|
|
22
|
+
},
|
|
23
|
+
];
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
tooling:
|
|
2
|
+
{{#if enable_lint}}
|
|
3
|
+
mu-pint:
|
|
4
|
+
service: appserver
|
|
5
|
+
description: Lint PHP in the MU plugin
|
|
6
|
+
dir: /app/content/mu-plugins/{{mu_plugin_name}}
|
|
7
|
+
cmd: ./vendor/bin/pint
|
|
8
|
+
{{#if mu_plugin_lint_eslint}}
|
|
9
|
+
mu-eslint:
|
|
10
|
+
service: build
|
|
11
|
+
description: Lint JS/TS in the MU plugin
|
|
12
|
+
dir: /app/content/mu-plugins/{{mu_plugin_name}}
|
|
13
|
+
cmd: npx eslint --fix resources/
|
|
14
|
+
{{/if}}
|
|
15
|
+
{{/if}}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
/**
|
|
3
|
+
* Plugin Name: {{mu_plugin_name}}
|
|
4
|
+
* Description: {{projectDescription}}
|
|
5
|
+
* Version: {{projectVersion}}
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
if (!defined('ABSPATH')) {
|
|
9
|
+
exit;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
// Autoload via Composer
|
|
13
|
+
if (file_exists(__DIR__ . '/vendor/autoload.php')) {
|
|
14
|
+
require_once __DIR__ . '/vendor/autoload.php';
|
|
15
|
+
}
|
|
@@ -1 +1,15 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"require-dev": {
|
|
3
|
+
"laravel/pint": "^1.29",
|
|
4
|
+
"phpunit/phpunit": "^12.5",
|
|
5
|
+
"phpstan/phpstan": "^2.1",
|
|
6
|
+
"phpstan/extension-installer": "^1.4",
|
|
7
|
+
"szepeviktor/phpstan-wordpress": "^2.0",
|
|
8
|
+
"php-stubs/wordpress-stubs": "^6.8"
|
|
9
|
+
},
|
|
10
|
+
"config": {
|
|
11
|
+
"allow-plugins": {
|
|
12
|
+
"phpstan/extension-installer": true
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import path from 'path';
|
|
2
|
+
|
|
3
|
+
import fs from 'fs-extra';
|
|
4
|
+
|
|
5
|
+
import { log, color } from '../../lib/utils/logger.js';
|
|
6
|
+
|
|
7
|
+
export async function setupModule(context, generator) {
|
|
8
|
+
const pluginName = context.plugin_name || `${context.projectName}-plugin`;
|
|
9
|
+
const pluginDir = `content/plugins/${pluginName}`;
|
|
10
|
+
const absolutePluginDir = path.join(generator.cwd, pluginDir);
|
|
11
|
+
|
|
12
|
+
log(color.blue, `[plugin] 📂 Scaffolding plugin: ${pluginDir}`);
|
|
13
|
+
|
|
14
|
+
// 1. Ensure directory exists
|
|
15
|
+
await fs.ensureDir(absolutePluginDir);
|
|
16
|
+
|
|
17
|
+
// 2. Generate main plugin entry file
|
|
18
|
+
await generator.generateFile(
|
|
19
|
+
'plugin.php',
|
|
20
|
+
{ ...context, plugin_name: pluginName },
|
|
21
|
+
'plugin',
|
|
22
|
+
`${pluginDir}/${pluginName}.php`
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
// 3. Generate composer.json
|
|
26
|
+
await generator.generateFile(
|
|
27
|
+
'composer.json',
|
|
28
|
+
{ ...context, plugin_name: pluginName },
|
|
29
|
+
'plugin',
|
|
30
|
+
`${pluginDir}/composer.json`
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
// 4. Create src/ scaffold
|
|
34
|
+
await fs.ensureFile(path.join(absolutePluginDir, 'src', '.gitkeep'));
|
|
35
|
+
|
|
36
|
+
// 5. Lint configs co-located in plugin — always installed (IDE/editor support)
|
|
37
|
+
log(color.blue, '[plugin] 🔧 Installing lint configurations...');
|
|
38
|
+
await generator.copyFile('lint/.prettierrc.json', 'plugin', `${pluginDir}/.prettierrc.json`);
|
|
39
|
+
await generator.copyFile('lint/pint.json', 'plugin', `${pluginDir}/pint.json`);
|
|
40
|
+
if (context.plugin_lint_eslint === true) {
|
|
41
|
+
await generator.copyFile('lint/eslint.config.mjs', 'plugin', `${pluginDir}/eslint.config.mjs`);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
log(color.green, `[plugin] ✅ Plugin scaffolded: ${pluginDir}`);
|
|
45
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
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: ['node_modules/**', 'vendor/**', 'dist/**'],
|
|
9
|
+
},
|
|
10
|
+
js.configs.recommended,
|
|
11
|
+
{
|
|
12
|
+
files: ['resources/**/*.{js,mjs,ts}'],
|
|
13
|
+
languageOptions: {
|
|
14
|
+
ecmaVersion: 2022,
|
|
15
|
+
sourceType: 'module',
|
|
16
|
+
globals: {
|
|
17
|
+
...globals.browser,
|
|
18
|
+
...globals.node,
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
plugins: {
|
|
22
|
+
prettier: prettierPlugin,
|
|
23
|
+
},
|
|
24
|
+
rules: {
|
|
25
|
+
'prettier/prettier': 'error',
|
|
26
|
+
'no-unused-vars': ['error', { argsIgnorePattern: '^_', varsIgnorePattern: '^_' }],
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
eslintConfigPrettier,
|
|
30
|
+
];
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export default [
|
|
2
|
+
{
|
|
3
|
+
type: 'input',
|
|
4
|
+
name: 'plugin_name',
|
|
5
|
+
message: 'Plugin slug (used as directory name):',
|
|
6
|
+
default: (answers) => `${answers.projectName || 'wordpress'}-plugin`,
|
|
7
|
+
when: (answers) => answers.selectedContentModules?.includes('plugin'),
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
type: 'confirm',
|
|
11
|
+
name: 'plugin_lint_pint',
|
|
12
|
+
message: 'Plugin: enable Pint for PHP?',
|
|
13
|
+
default: true,
|
|
14
|
+
when: (answers) => answers.selectedContentModules?.includes('plugin') && answers.enable_lint,
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
type: 'confirm',
|
|
18
|
+
name: 'plugin_lint_eslint',
|
|
19
|
+
message: 'Plugin: enable ESLint for JS/TS?',
|
|
20
|
+
default: false,
|
|
21
|
+
when: (answers) => answers.selectedContentModules?.includes('plugin') && answers.enable_lint,
|
|
22
|
+
},
|
|
23
|
+
];
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
tooling:
|
|
2
|
+
{{#if enable_lint}}
|
|
3
|
+
plugin-pint:
|
|
4
|
+
service: appserver
|
|
5
|
+
description: Lint PHP in the plugin
|
|
6
|
+
dir: /app/content/plugins/{{plugin_name}}
|
|
7
|
+
cmd: ./vendor/bin/pint
|
|
8
|
+
{{#if plugin_lint_eslint}}
|
|
9
|
+
plugin-eslint:
|
|
10
|
+
service: build
|
|
11
|
+
description: Lint JS/TS in the plugin
|
|
12
|
+
dir: /app/content/plugins/{{plugin_name}}
|
|
13
|
+
cmd: npx eslint --fix resources/
|
|
14
|
+
{{/if}}
|
|
15
|
+
{{/if}}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
/**
|
|
3
|
+
* Plugin Name: {{plugin_name}}
|
|
4
|
+
* Description: {{projectDescription}}
|
|
5
|
+
* Version: {{projectVersion}}
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
if (!defined('ABSPATH')) {
|
|
9
|
+
exit;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
// Autoload via Composer
|
|
13
|
+
if (file_exists(__DIR__ . '/vendor/autoload.php')) {
|
|
14
|
+
require_once __DIR__ . '/vendor/autoload.php';
|
|
15
|
+
}
|
package/modules/sage/index.js
CHANGED
|
@@ -175,6 +175,31 @@ export async function setupModule(context, generator) {
|
|
|
175
175
|
mergeStrategy: 'replace',
|
|
176
176
|
});
|
|
177
177
|
|
|
178
|
+
// 8. Lint configs co-located in theme — always installed (IDE/editor support)
|
|
179
|
+
log(color.blue, '[sage] 🔧 Installing lint configurations...');
|
|
180
|
+
await generator.copyFile(
|
|
181
|
+
'lint/.prettierrc.json',
|
|
182
|
+
'sage',
|
|
183
|
+
`${relativeThemeDir}/.prettierrc.json`
|
|
184
|
+
);
|
|
185
|
+
if (context.sage_lint_eslint !== false) {
|
|
186
|
+
await generator.copyFile(
|
|
187
|
+
'lint/eslint.config.mjs',
|
|
188
|
+
'sage',
|
|
189
|
+
`${relativeThemeDir}/eslint.config.mjs`
|
|
190
|
+
);
|
|
191
|
+
}
|
|
192
|
+
if (context.sage_lint_pint !== false) {
|
|
193
|
+
await generator.copyFile('lint/pint.json', 'sage', `${relativeThemeDir}/pint.json`);
|
|
194
|
+
}
|
|
195
|
+
if (context.sage_lint_stylelint !== false) {
|
|
196
|
+
await generator.copyFile(
|
|
197
|
+
'lint/.stylelintrc.json',
|
|
198
|
+
'sage',
|
|
199
|
+
`${relativeThemeDir}/.stylelintrc.json`
|
|
200
|
+
);
|
|
201
|
+
}
|
|
202
|
+
|
|
178
203
|
log(color.green, '[sage] ✅ Advanced Sage setup completed successfully');
|
|
179
204
|
log(color.green, `[sage] ✅ Theme directory: ${relativeThemeDir}`);
|
|
180
205
|
log(color.green, '[sage] ✅ Lando + Devcontainer command parity enabled');
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"semi": true,
|
|
3
|
+
"singleQuote": true,
|
|
4
|
+
"trailingComma": "es5",
|
|
5
|
+
"printWidth": 100,
|
|
6
|
+
"tabWidth": 2,
|
|
7
|
+
"overrides": [
|
|
8
|
+
{ "files": "*.blade.php", "options": { "parser": "html" } },
|
|
9
|
+
{ "files": "*.vue", "options": { "parser": "vue" } },
|
|
10
|
+
{ "files": "*.scss", "options": { "singleQuote": false } }
|
|
11
|
+
]
|
|
12
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
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: ['node_modules/**', 'vendor/**', 'public/build/**'],
|
|
9
|
+
},
|
|
10
|
+
js.configs.recommended,
|
|
11
|
+
{
|
|
12
|
+
files: ['resources/**/*.{js,mjs,ts,vue}'],
|
|
13
|
+
languageOptions: {
|
|
14
|
+
ecmaVersion: 2022,
|
|
15
|
+
sourceType: 'module',
|
|
16
|
+
globals: {
|
|
17
|
+
...globals.browser,
|
|
18
|
+
...globals.node,
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
plugins: {
|
|
22
|
+
prettier: prettierPlugin,
|
|
23
|
+
},
|
|
24
|
+
rules: {
|
|
25
|
+
'prettier/prettier': 'error',
|
|
26
|
+
'no-unused-vars': ['error', { argsIgnorePattern: '^_', varsIgnorePattern: '^_' }],
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
eslintConfigPrettier,
|
|
30
|
+
];
|
package/modules/sage/prompts.js
CHANGED
|
@@ -1,16 +1,31 @@
|
|
|
1
1
|
export default [
|
|
2
|
-
{
|
|
3
|
-
type: 'confirm',
|
|
4
|
-
name: 'enable_sage',
|
|
5
|
-
message: 'Enable Sage theme (advanced setup is automatic)?',
|
|
6
|
-
default: true,
|
|
7
|
-
},
|
|
8
2
|
{
|
|
9
3
|
type: 'list',
|
|
10
4
|
name: 'sageVersion',
|
|
11
5
|
message: 'Sage version:',
|
|
12
6
|
choices: ['11', '10'],
|
|
13
7
|
default: '11',
|
|
14
|
-
when: (answers) => answers.
|
|
8
|
+
when: (answers) => answers.selectedContentModules?.includes('sage'),
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
type: 'confirm',
|
|
12
|
+
name: 'sage_lint_eslint',
|
|
13
|
+
message: 'Sage: enable ESLint for JS/TS/Vue?',
|
|
14
|
+
default: true,
|
|
15
|
+
when: (answers) => answers.selectedContentModules?.includes('sage') && answers.enable_lint,
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
type: 'confirm',
|
|
19
|
+
name: 'sage_lint_stylelint',
|
|
20
|
+
message: 'Sage: enable Stylelint for CSS/SCSS?',
|
|
21
|
+
default: true,
|
|
22
|
+
when: (answers) => answers.selectedContentModules?.includes('sage') && answers.enable_lint,
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
type: 'confirm',
|
|
26
|
+
name: 'sage_lint_pint',
|
|
27
|
+
message: 'Sage: enable Pint for PHP?',
|
|
28
|
+
default: true,
|
|
29
|
+
when: (answers) => answers.selectedContentModules?.includes('sage') && answers.enable_lint,
|
|
15
30
|
},
|
|
16
31
|
];
|
|
@@ -7,10 +7,10 @@ services:
|
|
|
7
7
|
scanner: false
|
|
8
8
|
events:
|
|
9
9
|
post-start:
|
|
10
|
-
- bash ./server/cmd/setup-sage-php.sh
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
10
|
+
- appserver: bash ./server/cmd/setup-sage-php.sh
|
|
11
|
+
- appserver: wp theme activate {{projectName}}
|
|
12
|
+
- appserver: cd /app/content/themes/{{projectName}} && wp acorn optimize:clear
|
|
13
|
+
- build: bash ./server/cmd/setup-sage-node.sh
|
|
14
14
|
tooling:
|
|
15
15
|
dev:
|
|
16
16
|
service: build
|
|
@@ -29,8 +29,20 @@ tooling:
|
|
|
29
29
|
cmd: npm run build --prefix /app/content/themes/{{projectName}}
|
|
30
30
|
theme-lint:
|
|
31
31
|
service: build
|
|
32
|
-
description: Lint the Sage theme
|
|
32
|
+
description: Lint the Sage theme (JS/TS/Vue)
|
|
33
33
|
cmd: npm run lint --prefix /app/content/themes/{{projectName}}
|
|
34
|
+
{{#if enable_lint}}
|
|
35
|
+
pint:
|
|
36
|
+
service: appserver
|
|
37
|
+
description: Lint PHP in the Sage theme
|
|
38
|
+
dir: /app/content/themes/{{projectName}}
|
|
39
|
+
cmd: ./vendor/bin/pint
|
|
40
|
+
stylelint:
|
|
41
|
+
service: build
|
|
42
|
+
description: Lint CSS/SCSS in the Sage theme
|
|
43
|
+
cmd: npx stylelint --fix "resources/**/*.{css,scss}" --config /app/content/themes/{{projectName}}/.stylelintrc.json
|
|
44
|
+
dir: /app/content/themes/{{projectName}}
|
|
45
|
+
{{/if}}
|
|
34
46
|
acorn:
|
|
35
47
|
service: appserver
|
|
36
48
|
description: Run Acorn artisan commands
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { defineConfig } from 'vite';
|
|
1
|
+
import { wordpressPlugin, wordpressThemeJson } from '@roots/vite-plugin';
|
|
3
2
|
import tailwindcss from '@tailwindcss/vite';
|
|
3
|
+
import fs from 'fs';
|
|
4
4
|
import laravel from 'laravel-vite-plugin';
|
|
5
|
-
import {
|
|
5
|
+
import { defineConfig } from 'vite';
|
|
6
6
|
|
|
7
7
|
export default defineConfig({
|
|
8
8
|
base: '/app/content/themes/{{projectName}}/',
|
|
@@ -45,7 +45,7 @@ export default defineConfig({
|
|
|
45
45
|
cert: fs.readFileSync('/certs/cert.crt'),
|
|
46
46
|
},
|
|
47
47
|
host: true,
|
|
48
|
-
port:
|
|
48
|
+
port: 5173,
|
|
49
49
|
strictPort: true,
|
|
50
50
|
hmr: {
|
|
51
51
|
host: 'localhost',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codigodoleo/wp-kit",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.4.0",
|
|
4
4
|
"description": "Kit opinativo para padronizar projetos WordPress com CI/CD dinâmico.",
|
|
5
5
|
"main": "bin/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -30,6 +30,12 @@
|
|
|
30
30
|
"test:setup": "npm run test:clean && npm run test:scaffold",
|
|
31
31
|
"test:clean": "rm -rf __test-sandbox__",
|
|
32
32
|
"test:scaffold": "node ./bin/index.js init --output=__test-sandbox__/test-project --defaults",
|
|
33
|
+
"test:e2e": "bash scripts/validate-e2e.sh",
|
|
34
|
+
"test:e2e:base": "bash scripts/validate-e2e.sh base",
|
|
35
|
+
"test:e2e:sage": "bash scripts/validate-e2e.sh sage",
|
|
36
|
+
"test:e2e:blank-theme": "bash scripts/validate-e2e.sh blank-theme",
|
|
37
|
+
"test:e2e:mu-plugin": "bash scripts/validate-e2e.sh mu-plugin",
|
|
38
|
+
"test:e2e:all": "bash scripts/validate-e2e.sh all",
|
|
33
39
|
"open-cursor": "cursor ./__test-sandbox__/test-project/wordpress-dev.code-workspace"
|
|
34
40
|
},
|
|
35
41
|
"keywords": [
|
|
@@ -3,6 +3,9 @@ services:
|
|
|
3
3
|
build:
|
|
4
4
|
context: ..
|
|
5
5
|
dockerfile: .devcontainer/Dockerfile
|
|
6
|
+
# Force linux/amd64 for Apple Silicon (ARM) compatibility via Rosetta 2.
|
|
7
|
+
# Remove this line if the base image gains a native linux/arm64 variant.
|
|
8
|
+
platform: linux/amd64
|
|
6
9
|
container_name: {{projectName}}-app
|
|
7
10
|
working_dir: /workspace
|
|
8
11
|
env_file:
|
package/templates/.gitignore.hbs
CHANGED
|
@@ -1,13 +1,84 @@
|
|
|
1
|
-
# WordPress
|
|
2
|
-
|
|
3
|
-
content/
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
# WordPress
|
|
2
|
+
wp/
|
|
3
|
+
content/uploads/*
|
|
4
|
+
!content/uploads/.gitkeep
|
|
5
|
+
content/upgrade/*
|
|
6
|
+
content/backup-db/*
|
|
7
|
+
content/backups/*
|
|
8
|
+
content/blogs.dir/*
|
|
9
|
+
content/cache/*
|
|
10
|
+
content/advanced-cache.php
|
|
11
|
+
content/wp-cache-config.php
|
|
12
|
+
content/plugins/*
|
|
13
|
+
!content/plugins/.gitkeep
|
|
14
|
+
content/themes/*
|
|
15
|
+
content/languages/*
|
|
16
|
+
!content/languages/.gitkeep
|
|
17
|
+
content/mu-plugins/*
|
|
18
|
+
!content/mu-plugins/.gitkeep
|
|
19
|
+
|
|
20
|
+
# Theme{{#if enable_sage}}
|
|
21
|
+
!content/themes/{{projectName}}{{/if}}
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
# Composer
|
|
25
|
+
vendor/
|
|
26
|
+
composer.phar
|
|
27
|
+
|
|
28
|
+
# Node.js
|
|
29
|
+
node_modules/
|
|
30
|
+
npm-debug.log*
|
|
31
|
+
yarn-debug.log*
|
|
32
|
+
yarn-error.log*
|
|
33
|
+
.npm
|
|
34
|
+
.yarn-integrity
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
# IDE/Editor
|
|
38
|
+
*.swp
|
|
39
|
+
*.swo
|
|
40
|
+
*~
|
|
41
|
+
|
|
42
|
+
# OS
|
|
43
|
+
.DS_Store
|
|
44
|
+
.DS_Store?
|
|
45
|
+
._*
|
|
46
|
+
.Spotlight-V100
|
|
47
|
+
.Trashes
|
|
48
|
+
ehthumbs.db
|
|
49
|
+
Thumbs.db
|
|
50
|
+
|
|
51
|
+
# Logs
|
|
52
|
+
*.log
|
|
53
|
+
logs/
|
|
54
|
+
|
|
55
|
+
# Temporary files
|
|
56
|
+
*.tmp
|
|
57
|
+
*.temp
|
|
58
|
+
.cache/
|
|
59
|
+
|
|
60
|
+
# Build artifacts
|
|
61
|
+
dist/
|
|
62
|
+
build/
|
|
63
|
+
public/build/
|
|
64
|
+
|
|
65
|
+
# Database
|
|
66
|
+
*.sql
|
|
67
|
+
*.sqlite
|
|
68
|
+
|
|
69
|
+
# Backup files
|
|
70
|
+
*.bak
|
|
71
|
+
*.backup
|
|
72
|
+
*.old
|
|
73
|
+
|
|
74
|
+
# Lando
|
|
75
|
+
.lando.local.yml
|
|
76
|
+
|
|
77
|
+
# PHP
|
|
78
|
+
*.php~
|
|
79
|
+
*.php.bak
|
|
80
|
+
php_errors.log
|
|
81
|
+
|
|
82
|
+
# Testing
|
|
83
|
+
coverage/
|
|
84
|
+
.phpunit.result.cache
|
package/templates/.lando.yml.hbs
CHANGED
|
@@ -28,6 +28,7 @@ services:
|
|
|
28
28
|
build:
|
|
29
29
|
- bash /app/server/cmd/setup-php.sh
|
|
30
30
|
overrides:
|
|
31
|
+
platform: linux/amd64
|
|
31
32
|
extra_hosts:
|
|
32
33
|
- "host.docker.internal:host-gateway"
|
|
33
34
|
environment:
|
|
@@ -41,6 +42,7 @@ services:
|
|
|
41
42
|
- bash /app/server/cmd/setup-node.sh
|
|
42
43
|
scanner: false
|
|
43
44
|
overrides:
|
|
45
|
+
platform: linux/amd64
|
|
44
46
|
ports:
|
|
45
47
|
- 5173:5173
|
|
46
48
|
database:
|