@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.
- package/lib/commands/init.js +19 -10
- package/lib/config/versions.js +5 -5
- package/lib/prompts/index.js +24 -14
- package/lib/utils/git.js +50 -13
- package/modules/deploy/.github/workflows/deploy-docker.yml +102 -0
- package/modules/deploy/.github/workflows/deploy-ssh.yml +126 -0
- package/modules/deploy/.github/workflows/release.yml +55 -0
- package/modules/deploy/index.js +39 -0
- package/modules/deploy/prompts.js +1 -3
- package/modules/deploy/templates/.gitlab/ci/deploy-docker.yml.hbs +35 -0
- package/modules/deploy/templates/.gitlab/ci/deploy-ssh.yml.hbs +83 -0
- package/modules/deploy/templates/.gitlab/ci/release.yml.hbs +26 -0
- package/modules/git/.husky/commit-msg +8 -4
- package/modules/git/.husky/pre-commit +0 -3
- package/modules/git/index.js +34 -38
- package/modules/git/templates/.lando.yml.hbs +13 -5
- package/modules/git/templates/package.json.hbs +4 -4
- package/modules/git/templates/workspace.json.hbs +114 -28
- package/modules/lint/templates/.lando.yml.hbs +10 -2
- package/modules/lint/templates/package.json.hbs +4 -4
- package/modules/lint/templates/workspace.json.hbs +56 -15
- package/modules/php/templates/.lando.yml.hbs +11 -2
- package/modules/php/templates/composer.json.hbs +1 -1
- package/modules/php/templates/workspace.json.hbs +74 -15
- package/modules/redis/templates/.lando.yml.hbs +8 -1
- package/modules/sage/index.js +114 -15
- package/modules/sage/prompts.js +1 -1
- package/modules/sage/templates/.devcontainer/devcontainer.json.hbs +7 -0
- package/modules/sage/templates/.devcontainer/docker-compose.override.yml.hbs +6 -0
- package/modules/sage/templates/.devcontainer/post-create.sh.hbs +11 -0
- package/modules/sage/templates/.lando.yml.hbs +49 -20
- package/modules/sage/templates/server/cmd/setup-sage-node.sh.hbs +23 -0
- package/modules/sage/templates/server/cmd/setup-sage-php.sh.hbs +24 -0
- package/modules/sage/templates/theme/app/Blocks/.gitkeep.hbs +0 -0
- package/modules/sage/templates/theme/app/Fields/.gitkeep.hbs +0 -0
- package/modules/sage/templates/theme/composer.json.hbs +25 -3
- package/modules/sage/templates/theme/package.json.hbs +15 -3
- package/modules/sage/templates/theme/resources/views/blocks/.gitkeep.hbs +0 -0
- package/modules/sage/templates/theme/vite.config.js.hbs +55 -13
- package/modules/sage/templates/workspace.json.hbs +155 -12
- package/modules/skills/index.js +18 -0
- package/modules/skills/prompts.js +21 -0
- package/modules/test/index.js +19 -0
- package/modules/test/prompts.js +8 -0
- package/modules/test/templates/composer.json.hbs +16 -0
- package/modules/test/templates/package.json.hbs +11 -0
- package/modules/test/templates/playwright.config.js.hbs +29 -0
- package/modules/test/tests/Pest.php +39 -0
- package/modules/test/tests/SmokeTest.php +15 -0
- package/modules/test/tests/e2e/example.spec.js +11 -0
- package/modules/test/tests/e2e/helpers/loginHelper.js +40 -0
- package/package.json +1 -1
- package/templates/.devcontainer/Dockerfile.hbs +24 -0
- package/templates/.devcontainer/config/nginx.conf +23 -0
- package/templates/.devcontainer/config/nginx.conf.hbs +23 -0
- package/templates/.devcontainer/devcontainer.json.hbs +29 -0
- package/templates/.devcontainer/docker-compose.yml.hbs +73 -0
- package/templates/.devcontainer/setup.sh.hbs +17 -0
- package/templates/.env.hbs +38 -15
- package/templates/.gitignore.hbs +2 -2
- package/templates/.lando.yml.hbs +88 -11
- package/templates/README.md.hbs +23 -7
- package/templates/composer.json.hbs +4 -3
- package/templates/package.json.hbs +0 -2
- package/templates/server/cmd/install-wp.sh.hbs +54 -43
- package/templates/server/cmd/setup-node.sh.hbs +11 -0
- package/templates/server/cmd/setup-php.sh.hbs +14 -0
- package/templates/server/www/vhosts.conf.hbs +54 -17
- package/templates/workspace.json.hbs +233 -40
- package/templates/wp-cli.yml.hbs +1 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export default [
|
|
2
|
+
{
|
|
3
|
+
type: 'confirm',
|
|
4
|
+
name: 'enable_skills',
|
|
5
|
+
message: 'Instalar AI skills (superpowers-sage) no projeto?',
|
|
6
|
+
default: true,
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
type: 'checkbox',
|
|
10
|
+
name: 'skills_targets',
|
|
11
|
+
message: 'Onde instalar as skills?',
|
|
12
|
+
choices: [
|
|
13
|
+
{ name: 'Claude Code → .claude/', value: 'claude' },
|
|
14
|
+
{ name: 'Cursor → .cursor/', value: 'cursor' },
|
|
15
|
+
{ name: 'Agnóstico → .ai/', value: 'ai' },
|
|
16
|
+
],
|
|
17
|
+
default: ['claude'],
|
|
18
|
+
when: (answers) => answers.enable_skills,
|
|
19
|
+
validate: (selected) => (selected.length > 0 ? true : 'Selecione ao menos um destino.'),
|
|
20
|
+
},
|
|
21
|
+
];
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import path from 'path';
|
|
2
|
+
|
|
3
|
+
import fs from 'fs-extra';
|
|
4
|
+
|
|
5
|
+
export async function setupModule(context, generator) {
|
|
6
|
+
const testsDir = path.join(context.cwd, 'tests');
|
|
7
|
+
await fs.ensureDir(path.join(testsDir, 'e2e', 'helpers'));
|
|
8
|
+
|
|
9
|
+
await generator.copyFile('tests/Pest.php', 'test', 'tests/Pest.php');
|
|
10
|
+
await generator.copyFile('tests/SmokeTest.php', 'test', 'tests/SmokeTest.php');
|
|
11
|
+
await generator.copyFile('tests/e2e/example.spec.js', 'test', 'tests/e2e/example.spec.js');
|
|
12
|
+
await generator.copyFile(
|
|
13
|
+
'tests/e2e/helpers/loginHelper.js',
|
|
14
|
+
'test',
|
|
15
|
+
'tests/e2e/helpers/loginHelper.js'
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
await generator.generateFile('playwright.config.js', context, 'test');
|
|
19
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"require-dev": {
|
|
3
|
+
"pestphp/pest": "^4.4"
|
|
4
|
+
},
|
|
5
|
+
"config": {
|
|
6
|
+
"allow-plugins": {
|
|
7
|
+
"pestphp/pest-plugin": true
|
|
8
|
+
}
|
|
9
|
+
},
|
|
10
|
+
"scripts": {
|
|
11
|
+
"test": "pest",
|
|
12
|
+
"test:coverage": "pest --coverage"
|
|
13
|
+
},
|
|
14
|
+
"minimum-stability": "dev",
|
|
15
|
+
"prefer-stable": true
|
|
16
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { devices } from '@playwright/test';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Playwright E2E test configuration.
|
|
5
|
+
* @see https://playwright.dev/docs/test-configuration
|
|
6
|
+
*/
|
|
7
|
+
const config = {
|
|
8
|
+
testDir: './tests/e2e',
|
|
9
|
+
timeout: 30 * 1000,
|
|
10
|
+
forbidOnly: !!process.env.CI,
|
|
11
|
+
retries: process.env.CI ? 2 : 0,
|
|
12
|
+
workers: process.env.CI ? 1 : undefined,
|
|
13
|
+
reporter: process.env.CI ? 'github' : 'list',
|
|
14
|
+
use: {
|
|
15
|
+
actionTimeout: 0,
|
|
16
|
+
baseURL: process.env.WP_HOME || 'https://{{projectName}}.lndo.site',
|
|
17
|
+
trace: 'on-first-retry',
|
|
18
|
+
},
|
|
19
|
+
projects: [
|
|
20
|
+
{
|
|
21
|
+
name: 'chromium',
|
|
22
|
+
use: {
|
|
23
|
+
...devices['Desktop Chrome'],
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
],
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export default config;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
|
|
3
|
+
declare(strict_types=1);
|
|
4
|
+
|
|
5
|
+
/*
|
|
6
|
+
|--------------------------------------------------------------------------
|
|
7
|
+
| Test Case
|
|
8
|
+
|--------------------------------------------------------------------------
|
|
9
|
+
|
|
|
10
|
+
| The closure you provide to your test functions is always bound to a specific
|
|
11
|
+
| PHPUnit test case class. By default, that class is "PHPUnit\Framework\TestCase".
|
|
12
|
+
| You can change this by specifying a `uses()` call at the top of your file.
|
|
13
|
+
|
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
// uses(Tests\TestCase::class)->in('Feature');
|
|
17
|
+
|
|
18
|
+
/*
|
|
19
|
+
|--------------------------------------------------------------------------
|
|
20
|
+
| Expectations
|
|
21
|
+
|--------------------------------------------------------------------------
|
|
22
|
+
|
|
|
23
|
+
| When you're writing tests, you often need to check that values meet certain
|
|
24
|
+
| conditions. The "expect()" function gives you access to a set of "expectations"
|
|
25
|
+
| methods that you can use to assert different things. Of course, you may use
|
|
26
|
+
| the default PHPUnit assertions at any time as well.
|
|
27
|
+
|
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
/*
|
|
31
|
+
|--------------------------------------------------------------------------
|
|
32
|
+
| Functions
|
|
33
|
+
|--------------------------------------------------------------------------
|
|
34
|
+
|
|
|
35
|
+
| While Pest is very powerful out-of-the-box, you may have some testing
|
|
36
|
+
| helpers that you want to share between tests. Here you can also set
|
|
37
|
+
| up global helper functions that are available in every test file.
|
|
38
|
+
|
|
|
39
|
+
*/
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
|
|
3
|
+
// phpcs:disable
|
|
4
|
+
|
|
5
|
+
use GuzzleHttp\Client;
|
|
6
|
+
|
|
7
|
+
it('returns a 200 status code on the homepage', function () {
|
|
8
|
+
$client = new Client([
|
|
9
|
+
'verify' => in_array(env('WP_ENV'), ['production', 'staging']),
|
|
10
|
+
]);
|
|
11
|
+
|
|
12
|
+
$response = $client->request('GET', env('WP_HOME'));
|
|
13
|
+
|
|
14
|
+
expect($response->getStatusCode())->toBe(200);
|
|
15
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { test, expect } from '@playwright/test';
|
|
2
|
+
|
|
3
|
+
test('homepage returns 200', async ({ page }) => {
|
|
4
|
+
const response = await page.goto('/');
|
|
5
|
+
expect(response?.status()).toBe(200);
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
test('homepage has a title', async ({ page }) => {
|
|
9
|
+
await page.goto('/');
|
|
10
|
+
await expect(page).toHaveTitle(/.+/);
|
|
11
|
+
});
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Helper: authenticate an admin user in the WordPress admin panel.
|
|
3
|
+
*
|
|
4
|
+
* @param {import('@playwright/test').Page} page
|
|
5
|
+
* @param {string} [user='admin']
|
|
6
|
+
* @param {string} [pass='admin']
|
|
7
|
+
*/
|
|
8
|
+
export async function login(page, user = 'admin', pass = 'admin') {
|
|
9
|
+
await page.goto('/wp/wp-login.php');
|
|
10
|
+
await page.fill('#user_login', user);
|
|
11
|
+
await page.fill('#user_pass', pass);
|
|
12
|
+
await page.click('#wp-submit');
|
|
13
|
+
await page.waitForURL(/wp-admin/);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Helper: dismiss any WordPress welcome modal that may appear.
|
|
18
|
+
*
|
|
19
|
+
* @param {import('@playwright/test').Page} page
|
|
20
|
+
*/
|
|
21
|
+
export async function dismissWelcomeModal(page) {
|
|
22
|
+
try {
|
|
23
|
+
await page.waitForSelector('.components-modal__screen-overlay', { timeout: 3000 });
|
|
24
|
+
const closeButton = page.locator(
|
|
25
|
+
'.components-modal__header button.components-button[aria-label="Close"]'
|
|
26
|
+
);
|
|
27
|
+
if (await closeButton.isVisible()) {
|
|
28
|
+
await closeButton.click();
|
|
29
|
+
await page.waitForSelector('.components-modal__screen-overlay', {
|
|
30
|
+
state: 'detached',
|
|
31
|
+
timeout: 2000,
|
|
32
|
+
});
|
|
33
|
+
} else {
|
|
34
|
+
await page.keyboard.press('Escape');
|
|
35
|
+
await page.waitForTimeout(500);
|
|
36
|
+
}
|
|
37
|
+
} catch {
|
|
38
|
+
// Modal not present or already dismissed — continue.
|
|
39
|
+
}
|
|
40
|
+
}
|
package/package.json
CHANGED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
FROM thecodingmachine/php:8.4-v5-fpm-node24
|
|
2
|
+
|
|
3
|
+
# Enable PHP extensions needed for WordPress
|
|
4
|
+
# (mysqli, mysqlnd, redis, zip already enabled by default in the fat image)
|
|
5
|
+
ENV PHP_EXTENSION_BCMATH=1 \
|
|
6
|
+
PHP_EXTENSION_GD=1 \
|
|
7
|
+
PHP_EXTENSION_PDO_MYSQL=1
|
|
8
|
+
|
|
9
|
+
# The base image ends with USER docker — switch to root for installations
|
|
10
|
+
USER root
|
|
11
|
+
|
|
12
|
+
# Install only what is NOT bundled in the base image.
|
|
13
|
+
# Already pre-installed: PHP 8.4, Node 24, npm, yarn (corepack),
|
|
14
|
+
# Composer, mysqli, mysqlnd, redis, zip, curl, git, unzip
|
|
15
|
+
RUN apt-get update \
|
|
16
|
+
&& apt-get install -y --no-install-recommends default-mysql-client redis-tools \
|
|
17
|
+
&& rm -rf /var/lib/apt/lists/*
|
|
18
|
+
|
|
19
|
+
# WP-CLI (not included in the base image)
|
|
20
|
+
RUN curl -fsSL -o /usr/local/bin/wp https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar \
|
|
21
|
+
&& chmod +x /usr/local/bin/wp \
|
|
22
|
+
&& wp --info
|
|
23
|
+
|
|
24
|
+
USER docker
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
server {
|
|
2
|
+
listen 80;
|
|
3
|
+
root /workspace/wp;
|
|
4
|
+
index index.php;
|
|
5
|
+
|
|
6
|
+
client_max_body_size 64M;
|
|
7
|
+
|
|
8
|
+
location / {
|
|
9
|
+
try_files $uri $uri/ /index.php$is_args$args;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
location ~ \.php$ {
|
|
13
|
+
fastcgi_pass app:9000;
|
|
14
|
+
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
|
15
|
+
include fastcgi_params;
|
|
16
|
+
fastcgi_read_timeout 120;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {
|
|
20
|
+
expires max;
|
|
21
|
+
log_not_found off;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
server {
|
|
2
|
+
listen 80;
|
|
3
|
+
root /workspace/wp;
|
|
4
|
+
index index.php;
|
|
5
|
+
|
|
6
|
+
client_max_body_size 64M;
|
|
7
|
+
|
|
8
|
+
location / {
|
|
9
|
+
try_files $uri $uri/ /index.php$is_args$args;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
location ~ \.php$ {
|
|
13
|
+
fastcgi_pass app:9000;
|
|
14
|
+
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
|
15
|
+
include fastcgi_params;
|
|
16
|
+
fastcgi_read_timeout 120;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {
|
|
20
|
+
expires max;
|
|
21
|
+
log_not_found off;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "{{projectName}} Devcontainer",
|
|
3
|
+
"dockerComposeFile": [
|
|
4
|
+
"docker-compose.yml"
|
|
5
|
+
],
|
|
6
|
+
"service": "app",
|
|
7
|
+
"workspaceFolder": "/workspace",
|
|
8
|
+
"postCreateCommand": "bash .devcontainer/setup.sh",
|
|
9
|
+
"customizations": {
|
|
10
|
+
"vscode": {
|
|
11
|
+
"extensions": [
|
|
12
|
+
"bmewburn.vscode-intelephense-client",
|
|
13
|
+
"esbenp.prettier-vscode",
|
|
14
|
+
"dbaeumer.vscode-eslint",
|
|
15
|
+
"ms-azuretools.vscode-docker"
|
|
16
|
+
],
|
|
17
|
+
"settings": {
|
|
18
|
+
"editor.formatOnSave": false,
|
|
19
|
+
"terminal.integrated.defaultProfile.linux": "bash"
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"forwardPorts": [
|
|
24
|
+
8080,
|
|
25
|
+
3307,
|
|
26
|
+
6380,
|
|
27
|
+
5173
|
|
28
|
+
]
|
|
29
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
services:
|
|
2
|
+
app:
|
|
3
|
+
build:
|
|
4
|
+
context: ..
|
|
5
|
+
dockerfile: .devcontainer/Dockerfile
|
|
6
|
+
container_name: {{projectName}}-app
|
|
7
|
+
working_dir: /workspace
|
|
8
|
+
env_file:
|
|
9
|
+
- ../.env
|
|
10
|
+
volumes:
|
|
11
|
+
- ..:/workspace:cached
|
|
12
|
+
environment:
|
|
13
|
+
WORDPRESS_DB_HOST: db
|
|
14
|
+
WORDPRESS_DB_USER: wordpress
|
|
15
|
+
WORDPRESS_DB_PASSWORD: wordpress
|
|
16
|
+
WORDPRESS_DB_NAME: wordpress
|
|
17
|
+
depends_on:
|
|
18
|
+
db:
|
|
19
|
+
condition: service_healthy
|
|
20
|
+
redis:
|
|
21
|
+
condition: service_started
|
|
22
|
+
networks:
|
|
23
|
+
- wp
|
|
24
|
+
|
|
25
|
+
web:
|
|
26
|
+
image: nginx:alpine
|
|
27
|
+
container_name: {{projectName}}-web
|
|
28
|
+
ports:
|
|
29
|
+
- "8080:80"
|
|
30
|
+
- "5173:5173"
|
|
31
|
+
volumes:
|
|
32
|
+
- ..:/workspace:ro
|
|
33
|
+
- ./.devcontainer/config/nginx.conf:/etc/nginx/conf.d/default.conf:ro
|
|
34
|
+
depends_on:
|
|
35
|
+
- app
|
|
36
|
+
networks:
|
|
37
|
+
- wp
|
|
38
|
+
|
|
39
|
+
db:
|
|
40
|
+
image: mariadb:11
|
|
41
|
+
container_name: {{projectName}}-db
|
|
42
|
+
restart: unless-stopped
|
|
43
|
+
environment:
|
|
44
|
+
MYSQL_DATABASE: wordpress
|
|
45
|
+
MYSQL_USER: wordpress
|
|
46
|
+
MYSQL_PASSWORD: wordpress
|
|
47
|
+
MYSQL_ROOT_PASSWORD: root
|
|
48
|
+
ports:
|
|
49
|
+
- "3307:3306"
|
|
50
|
+
volumes:
|
|
51
|
+
- db-data:/var/lib/mysql
|
|
52
|
+
networks:
|
|
53
|
+
- wp
|
|
54
|
+
healthcheck:
|
|
55
|
+
test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"]
|
|
56
|
+
timeout: 20s
|
|
57
|
+
retries: 10
|
|
58
|
+
|
|
59
|
+
redis:
|
|
60
|
+
image: redis:7-alpine
|
|
61
|
+
container_name: {{projectName}}-redis
|
|
62
|
+
restart: unless-stopped
|
|
63
|
+
ports:
|
|
64
|
+
- "6380:6379"
|
|
65
|
+
networks:
|
|
66
|
+
- wp
|
|
67
|
+
|
|
68
|
+
networks:
|
|
69
|
+
wp:
|
|
70
|
+
driver: bridge
|
|
71
|
+
|
|
72
|
+
volumes:
|
|
73
|
+
db-data:
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Devcontainer post-create setup — runs once after the container is created.
|
|
3
|
+
# Delegates to unified scripts so Lando, CI/CD and devcontainer share the same logic.
|
|
4
|
+
set -euo pipefail
|
|
5
|
+
|
|
6
|
+
git config --global --add safe.directory /workspace || true
|
|
7
|
+
|
|
8
|
+
PROJECT_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.."; pwd)"
|
|
9
|
+
|
|
10
|
+
bash "${PROJECT_ROOT}/server/cmd/setup-php.sh"
|
|
11
|
+
bash "${PROJECT_ROOT}/server/cmd/setup-node.sh"
|
|
12
|
+
|
|
13
|
+
if command -v wp >/dev/null 2>&1; then
|
|
14
|
+
bash "${PROJECT_ROOT}/server/cmd/install-wp.sh"
|
|
15
|
+
fi
|
|
16
|
+
|
|
17
|
+
echo "Devcontainer setup completed."
|
package/templates/.env.hbs
CHANGED
|
@@ -1,27 +1,50 @@
|
|
|
1
|
-
PROJECT_NAME="{{projectName}}"
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
PROJECT_NAME="{{projectName}}"
|
|
2
|
+
PROJECT_VERSION="{{projectVersion}}"
|
|
3
|
+
PROJECT_DOMAIN="{{projectDomain}}"
|
|
4
|
+
APP_URL="https://{{projectDomain}}"
|
|
5
|
+
AUTHOR="{{author}}"
|
|
6
|
+
PHP_VERSION="{{phpVersion}}"
|
|
7
|
+
NODE_VERSION="{{nodeVersion}}"
|
|
8
|
+
WP_CORE_VERSION="{{wpCoreVersion}}"
|
|
9
|
+
{{#if enable_sage}}
|
|
10
|
+
SAGE_VERSION="{{sageVersion}}"
|
|
11
|
+
{{/if}}
|
|
12
|
+
GIT_REPOSITORY="{{gitRepository}}"
|
|
13
|
+
|
|
14
|
+
WORDPRESS_SITE_URL="https://{{projectDomain}}"
|
|
15
|
+
WORDPRESS_DB_NAME="wordpress"
|
|
16
|
+
WORDPRESS_DB_USER="wordpress"
|
|
17
|
+
WORDPRESS_DB_PASSWORD="wordpress"
|
|
18
|
+
WORDPRESS_DB_HOST="database"
|
|
19
|
+
WORDPRESS_DB_CHARSET="utf8"
|
|
20
|
+
WORDPRESS_DB_COLLATE=""
|
|
21
|
+
WORDPRESS_TABLE_PREFIX="wp_"
|
|
22
|
+
WORDPRESS_DEBUG={{enableDebug}}
|
|
9
23
|
WORDPRESS_DEBUG_DISPLAY={{enableDebug}}
|
|
10
24
|
WORDPRESS_DEBUG_LOG={{enableDebug}}
|
|
11
25
|
WORDPRESS_SCRIPT_DEBUG={{enableDebug}}
|
|
12
|
-
WORDPRESS_DISABLE_UPDATE=true
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
26
|
+
WORDPRESS_DISABLE_UPDATE=true
|
|
27
|
+
WORDPRESS_DISABLE_CRON=true
|
|
28
|
+
WORDPRESS_AUTOSAVE_INTERVAL="600"
|
|
29
|
+
WORDPRESS_POST_REVISIONS="2"
|
|
30
|
+
WORDPRESS_WP_ENVIRONMENT_TYPE="local"
|
|
31
|
+
WORDPRESS_DISALLOW_FILE_MODS=true
|
|
32
|
+
WORDPRESS_FORCE_SSL_ADMIN=true
|
|
33
|
+
WORDPRESS_AUTOMATIC_UPDATER_DISABLED=true
|
|
34
|
+
WORDPRESS_WP_AUTO_UPDATE_CORE=false
|
|
35
|
+
|
|
36
|
+
### Redis ###
|
|
16
37
|
{{#if enable_redis}}
|
|
17
|
-
|
|
38
|
+
WORDPRESS_REDIS_HOST=redis
|
|
39
|
+
WORDPRESS_REDIS_PORT=6379
|
|
18
40
|
{{/if}}
|
|
19
41
|
|
|
20
|
-
### WordPress salts ###
|
|
42
|
+
### WordPress salts ###
|
|
43
|
+
WORDPRESS_AUTH_KEY={{{salts.AUTH_KEY}}}
|
|
21
44
|
WORDPRESS_SECURE_AUTH_KEY={{{salts.SECURE_AUTH_KEY}}}
|
|
22
45
|
WORDPRESS_LOGGED_IN_KEY={{{salts.LOGGED_IN_KEY}}}
|
|
23
46
|
WORDPRESS_NONCE_KEY={{{salts.NONCE_KEY}}}
|
|
24
47
|
WORDPRESS_AUTH_SALT={{{salts.AUTH_SALT}}}
|
|
25
48
|
WORDPRESS_SECURE_AUTH_SALT={{{salts.SECURE_AUTH_SALT}}}
|
|
26
49
|
WORDPRESS_LOGGED_IN_SALT={{{salts.LOGGED_IN_SALT}}}
|
|
27
|
-
WORDPRESS_NONCE_SALT={{{salts.NONCE_SALT}}}
|
|
50
|
+
WORDPRESS_NONCE_SALT={{{salts.NONCE_SALT}}}
|
package/templates/.gitignore.hbs
CHANGED
|
@@ -5,9 +5,9 @@ content/languages/* !content/languages/.gitkeep content/mu-plugins/* !content/mu
|
|
|
5
5
|
Theme{{#if enable_sage}}
|
|
6
6
|
!content/themes/{{projectName}}{{/if}}
|
|
7
7
|
|
|
8
|
-
# Composer vendor/ composer.phar
|
|
8
|
+
# Composer vendor/ composer.phar # Node.js
|
|
9
9
|
node_modules/ npm-debug.log* yarn-debug.log* yarn-error.log* .npm .yarn-integrity # IDE/Editor *.swp
|
|
10
10
|
*.swo *~ # OS .DS_Store .DS_Store? ._* .Spotlight-V100 .Trashes ehthumbs.db Thumbs.db # Logs *.log
|
|
11
11
|
logs/ # Temporary files *.tmp *.temp .cache/ # Build artifacts dist/ build/ public/build/ # Database
|
|
12
12
|
*.sql *.sqlite # Backup files *.bak *.backup *.old # Lando .lando.local.yml # PHP *.php~ *.php.bak
|
|
13
|
-
php_errors.log # Testing coverage/ .phpunit.result.cache
|
|
13
|
+
php_errors.log # Testing coverage/ .phpunit.result.cache
|
package/templates/.lando.yml.hbs
CHANGED
|
@@ -1,11 +1,88 @@
|
|
|
1
|
-
name:
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
./
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
name: {{projectName}}
|
|
2
|
+
recipe: wordpress
|
|
3
|
+
env_file:
|
|
4
|
+
- .env
|
|
5
|
+
excludes:
|
|
6
|
+
- vendor
|
|
7
|
+
- node_modules
|
|
8
|
+
config:
|
|
9
|
+
webroot: ./
|
|
10
|
+
via: nginx
|
|
11
|
+
php: "8.4"
|
|
12
|
+
database: mariadb
|
|
13
|
+
cache: redis
|
|
14
|
+
xdebug: true
|
|
15
|
+
extra_php_extensions:
|
|
16
|
+
- bcmath
|
|
17
|
+
- exif
|
|
18
|
+
- gd
|
|
19
|
+
- mysqli
|
|
20
|
+
- zip
|
|
21
|
+
- imagick
|
|
22
|
+
- redis
|
|
23
|
+
config:
|
|
24
|
+
php: ./server/php/php.ini
|
|
25
|
+
vhosts: ./server/www/vhosts.conf
|
|
26
|
+
services:
|
|
27
|
+
appserver:
|
|
28
|
+
build:
|
|
29
|
+
- bash /app/server/cmd/setup-php.sh
|
|
30
|
+
overrides:
|
|
31
|
+
extra_hosts:
|
|
32
|
+
- "host.docker.internal:host-gateway"
|
|
33
|
+
environment:
|
|
34
|
+
PHP_IDE_CONFIG: "${PHP_IDE_CONFIG:-serverName=appserver}"
|
|
35
|
+
XDEBUG_MODE: "${XDEBUG_MODE:-develop,debug}"
|
|
36
|
+
XDEBUG_CONFIG: "${XDEBUG_CONFIG:-client_host=host.docker.internal discover_client_host=true}"
|
|
37
|
+
build:
|
|
38
|
+
type: node:24
|
|
39
|
+
ssl: true
|
|
40
|
+
build:
|
|
41
|
+
- bash /app/server/cmd/setup-node.sh
|
|
42
|
+
scanner: false
|
|
43
|
+
overrides:
|
|
44
|
+
ports:
|
|
45
|
+
- 5173:5173
|
|
46
|
+
database:
|
|
47
|
+
type: mariadb:10.11
|
|
48
|
+
portforward: true
|
|
49
|
+
cache:
|
|
50
|
+
type: redis
|
|
51
|
+
portforward: true
|
|
52
|
+
mailhog:
|
|
53
|
+
type: mailhog
|
|
54
|
+
portforward: true
|
|
55
|
+
hogfrom:
|
|
56
|
+
- appserver
|
|
57
|
+
events:
|
|
58
|
+
post-start:
|
|
59
|
+
- bash ./server/cmd/install-wp.sh
|
|
60
|
+
tooling:
|
|
61
|
+
node:
|
|
62
|
+
service: build
|
|
63
|
+
npm:
|
|
64
|
+
service: build
|
|
65
|
+
dev:
|
|
66
|
+
service: build
|
|
67
|
+
description: Run the Vite development server
|
|
68
|
+
cmd: npm run dev
|
|
69
|
+
redis-cli:
|
|
70
|
+
service: cache
|
|
71
|
+
acorn:
|
|
72
|
+
service: appserver
|
|
73
|
+
cmd: wp acorn
|
|
74
|
+
flush:
|
|
75
|
+
service: appserver
|
|
76
|
+
description: Flush WordPress and Redis caches
|
|
77
|
+
cmd:
|
|
78
|
+
- appserver: wp rewrite flush
|
|
79
|
+
- appserver: wp cache flush
|
|
80
|
+
- cache: redis-cli FLUSHDB
|
|
81
|
+
dir: /app
|
|
82
|
+
reset-deps:
|
|
83
|
+
service: appserver
|
|
84
|
+
description: Clean and reinstall all dependencies
|
|
85
|
+
cmd:
|
|
86
|
+
- appserver: rm -rf /app/vendor /app/node_modules
|
|
87
|
+
- appserver: bash /app/server/cmd/setup-php.sh
|
|
88
|
+
- build: bash /app/server/cmd/setup-node.sh
|
package/templates/README.md.hbs
CHANGED
|
@@ -1,11 +1,27 @@
|
|
|
1
|
-
#
|
|
2
|
-
{{projectName}}
|
|
1
|
+
# {{projectName}}
|
|
3
2
|
|
|
4
|
-
Scaffolded by wp-devops.
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
Scaffolded by wp-devops.
|
|
4
|
+
|
|
5
|
+
## 🧱 Stack
|
|
6
|
+
|
|
7
|
+
- PHP {{phpVersion}}
|
|
8
|
+
- Node.js {{nodeVersion}}
|
|
9
|
+
|
|
10
|
+
## 🧩 Blocos com ACF Composer
|
|
11
|
+
|
|
12
|
+
Quando Sage estiver habilitado, o projeto usa o fluxo de blocos via ACF Composer.
|
|
13
|
+
|
|
14
|
+
- Classes de blocos: `content/themes/{{projectName}}/app/Blocks`
|
|
15
|
+
- Fields do ACF: `content/themes/{{projectName}}/app/Fields`
|
|
16
|
+
- Views Blade dos blocos: `content/themes/{{projectName}}/resources/views/blocks`
|
|
17
|
+
|
|
18
|
+
Fluxo rapido:
|
|
19
|
+
1. Criar classe do bloco com `wp acorn make:component NomeDoBloco`.
|
|
20
|
+
2. Definir fields em `app/Fields` com ACF Composer.
|
|
21
|
+
3. Renderizar o bloco em `resources/views/blocks`.
|
|
22
|
+
|
|
23
|
+
Requisito: plugin Advanced Custom Fields (ACF) ativo no WordPress.
|
|
8
24
|
|
|
9
25
|
## 👤 Author
|
|
10
26
|
|
|
11
|
-
{{author}}
|
|
27
|
+
{{author}}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{ "name": "{{projectName}}/wordpress", "type": "project", "description": "{{projectDescription}}",
|
|
2
2
|
"authors": [ { "name": "{{author}}", "email": "{{authorEmail}}" } ], "repositories": { "wpackagist":
|
|
3
3
|
{ "type": "composer", "url": "https://wpackagist.org" } }, "license": "MIT", "require": { "php": ">={{phpVersion}}",
|
|
4
|
-
"roots/wordpress": "{{wpCoreVersion}}", "
|
|
4
|
+
"roots/wordpress": "{{wpCoreVersion}}", "roots/bedrock-autoloader": "^1.0",
|
|
5
|
+
"inpsyde/wp-translation-downloader": "^2.5",
|
|
5
6
|
"vlucas/phpdotenv": "^5.5" }, "config": { "allow-plugins": { "roots/wordpress-core-installer": true,
|
|
6
7
|
"inpsyde/wp-translation-downloader": true, "composer/installers": true } }, "extra": {
|
|
7
8
|
"wordpress-install-dir": "wp", "installer-paths": { "content/plugins/{$name}/": [
|
|
8
9
|
"type:wordpress-plugin" ], "content/themes/{$name}/": [ "type:wordpress-theme" ],
|
|
9
10
|
"content/mu-plugins/{$name}/": [ "type:wordpress-muplugin" ] }, "wp-translation-downloader": {
|
|
10
|
-
"languages": [ "pt_BR", "en_US"
|
|
11
|
+
"languages": [ "pt_BR", "en_US" ], "languageRootDir": "content/languages",
|
|
11
12
|
"virtual-packages": [ { "name": "wordpress/wordpress", "type": "wordpress-core", "version": "{{wpCoreVersion}}"
|
|
12
|
-
} ] } } }
|
|
13
|
+
} ] } } }
|