@codigodoleo/wp-kit 3.1.0 → 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/lib/commands/init.js +19 -10
  2. package/lib/config/versions.js +5 -5
  3. package/lib/prompts/index.js +24 -14
  4. package/lib/utils/git.js +50 -13
  5. package/modules/deploy/.github/workflows/deploy-docker.yml +102 -0
  6. package/modules/deploy/.github/workflows/deploy-ssh.yml +126 -0
  7. package/modules/deploy/.github/workflows/release.yml +55 -0
  8. package/modules/deploy/index.js +39 -0
  9. package/modules/deploy/prompts.js +1 -3
  10. package/modules/deploy/templates/.gitlab/ci/deploy-docker.yml.hbs +35 -0
  11. package/modules/deploy/templates/.gitlab/ci/deploy-ssh.yml.hbs +83 -0
  12. package/modules/deploy/templates/.gitlab/ci/release.yml.hbs +26 -0
  13. package/modules/git/.husky/commit-msg +8 -4
  14. package/modules/git/.husky/pre-commit +0 -3
  15. package/modules/git/index.js +34 -38
  16. package/modules/git/templates/.lando.yml.hbs +13 -5
  17. package/modules/git/templates/package.json.hbs +4 -4
  18. package/modules/git/templates/workspace.json.hbs +114 -28
  19. package/modules/lint/templates/.lando.yml.hbs +10 -2
  20. package/modules/lint/templates/package.json.hbs +4 -4
  21. package/modules/lint/templates/workspace.json.hbs +56 -15
  22. package/modules/php/templates/.lando.yml.hbs +11 -2
  23. package/modules/php/templates/composer.json.hbs +1 -1
  24. package/modules/php/templates/workspace.json.hbs +74 -15
  25. package/modules/redis/templates/.lando.yml.hbs +8 -1
  26. package/modules/sage/index.js +114 -15
  27. package/modules/sage/prompts.js +1 -1
  28. package/modules/sage/templates/.devcontainer/devcontainer.json.hbs +7 -0
  29. package/modules/sage/templates/.devcontainer/docker-compose.override.yml.hbs +6 -0
  30. package/modules/sage/templates/.devcontainer/post-create.sh.hbs +11 -0
  31. package/modules/sage/templates/.lando.yml.hbs +49 -20
  32. package/modules/sage/templates/server/cmd/setup-sage-node.sh.hbs +23 -0
  33. package/modules/sage/templates/server/cmd/setup-sage-php.sh.hbs +24 -0
  34. package/modules/sage/templates/theme/app/Blocks/.gitkeep.hbs +0 -0
  35. package/modules/sage/templates/theme/app/Fields/.gitkeep.hbs +0 -0
  36. package/modules/sage/templates/theme/composer.json.hbs +25 -3
  37. package/modules/sage/templates/theme/package.json.hbs +15 -3
  38. package/modules/sage/templates/theme/resources/views/blocks/.gitkeep.hbs +0 -0
  39. package/modules/sage/templates/theme/vite.config.js.hbs +55 -13
  40. package/modules/sage/templates/workspace.json.hbs +155 -12
  41. package/modules/skills/index.js +18 -0
  42. package/modules/skills/prompts.js +21 -0
  43. package/modules/test/index.js +19 -0
  44. package/modules/test/prompts.js +8 -0
  45. package/modules/test/templates/composer.json.hbs +16 -0
  46. package/modules/test/templates/package.json.hbs +11 -0
  47. package/modules/test/templates/playwright.config.js.hbs +29 -0
  48. package/modules/test/tests/Pest.php +39 -0
  49. package/modules/test/tests/SmokeTest.php +15 -0
  50. package/modules/test/tests/e2e/example.spec.js +11 -0
  51. package/modules/test/tests/e2e/helpers/loginHelper.js +40 -0
  52. package/package.json +1 -1
  53. package/templates/.devcontainer/Dockerfile.hbs +24 -0
  54. package/templates/.devcontainer/config/nginx.conf +23 -0
  55. package/templates/.devcontainer/config/nginx.conf.hbs +23 -0
  56. package/templates/.devcontainer/devcontainer.json.hbs +29 -0
  57. package/templates/.devcontainer/docker-compose.yml.hbs +73 -0
  58. package/templates/.devcontainer/setup.sh.hbs +17 -0
  59. package/templates/.env.hbs +38 -15
  60. package/templates/.gitignore.hbs +2 -2
  61. package/templates/.lando.yml.hbs +88 -11
  62. package/templates/README.md.hbs +23 -7
  63. package/templates/composer.json.hbs +4 -3
  64. package/templates/package.json.hbs +0 -2
  65. package/templates/server/cmd/install-wp.sh.hbs +54 -43
  66. package/templates/server/cmd/setup-node.sh.hbs +11 -0
  67. package/templates/server/cmd/setup-php.sh.hbs +14 -0
  68. package/templates/server/www/vhosts.conf.hbs +54 -17
  69. package/templates/workspace.json.hbs +233 -40
  70. package/templates/wp-cli.yml.hbs +1 -0
@@ -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
@@ -16,6 +16,7 @@ import { VERSION_REGISTRY, validateVersionCompatibility } from '../../lib/config
16
16
  export async function setupModule(context, generator) {
17
17
  const themeDir = path.join(context.cwd, 'content', 'themes', context.projectName);
18
18
  const relativeThemeDir = `content/themes/${context.projectName}`;
19
+ const relativeDevcontainerDir = '.devcontainer';
19
20
 
20
21
  try {
21
22
  // 1. Validate version compatibility
@@ -46,11 +47,17 @@ export async function setupModule(context, generator) {
46
47
  // 3. Prepare and validate directory
47
48
  await fs.ensureDir(themeDir);
48
49
  const files = await fs.readdir(themeDir);
50
+ let shouldInstallSage = true;
51
+
49
52
  if (files.length > 0) {
50
- log(
51
- color.orange,
52
- `⚠️ Warning: ${themeDir} is not empty. Existing files may be overwritten.`
53
- );
53
+ const alreadyInstalled = await isSageThemeInstalled(themeDir);
54
+ if (alreadyInstalled) {
55
+ shouldInstallSage = false;
56
+ log(color.blue, '[sage] ♻️ Existing Sage theme detected. Reusing installation.');
57
+ } else {
58
+ log(color.orange, `⚠️ ${themeDir} has stale files. Cleaning before installation.`);
59
+ await fs.emptyDir(themeDir);
60
+ }
54
61
  }
55
62
 
56
63
  // 4. Build composer command with proper error handling
@@ -63,32 +70,114 @@ export async function setupModule(context, generator) {
63
70
  '--ignore-platform-reqs',
64
71
  ].join(' ');
65
72
 
66
- log(color.blue, `[sage] 📦 Installing Sage ${context.sageVersion} (${sageConfig.tag})...`);
67
- log(color.blue, `[sage] 📍 Location: ${relativeThemeDir}`);
68
-
69
- // 5. Execute installation
70
- execSync(cmd, { stdio: 'inherit', cwd: context.cwd });
73
+ if (shouldInstallSage) {
74
+ log(color.blue, `[sage] 📦 Installing Sage ${context.sageVersion} (${sageConfig.tag})...`);
75
+ log(color.blue, `[sage] 📍 Location: ${relativeThemeDir}`);
76
+ execSync(cmd, { stdio: 'inherit', cwd: context.cwd });
77
+ }
71
78
 
72
79
  // 6. Validate theme installation
73
80
  await validateThemeInstallation(themeDir, sageConfig);
74
81
  log(color.green, `[sage] ✅ Theme installation verified`);
75
82
 
76
83
  // 7. Generate customizations
77
- log(color.blue, `[sage] 📝 Generating theme customizations...`);
84
+ log(color.blue, '[sage] 🛠️ Applying advanced Sage DX customizations...');
85
+ if (context.sageVersion === '11') {
86
+ await generator.generateFile(
87
+ 'theme/vite.config.js',
88
+ context,
89
+ 'sage',
90
+ `${relativeThemeDir}/vite.config.js`
91
+ );
92
+ } else {
93
+ log(color.blue, '[sage] ℹ️ Keeping default Vite config for Sage 10 compatibility.');
94
+ }
78
95
  await generator.generateFile(
79
- 'theme/vite.config.js',
96
+ 'theme/style.css',
80
97
  context,
81
98
  'sage',
82
- `${relativeThemeDir}/vite.config.js`
99
+ `${relativeThemeDir}/style.css`
83
100
  );
101
+
84
102
  await generator.generateFile(
85
- 'theme/style.css',
103
+ 'theme/app/Blocks/.gitkeep',
86
104
  context,
87
105
  'sage',
88
- `${relativeThemeDir}/style.css`
106
+ `${relativeThemeDir}/app/Blocks/.gitkeep`
107
+ );
108
+ await generator.generateFile(
109
+ 'theme/app/Fields/.gitkeep',
110
+ context,
111
+ 'sage',
112
+ `${relativeThemeDir}/app/Fields/.gitkeep`
113
+ );
114
+ await generator.generateFile(
115
+ 'theme/resources/views/blocks/.gitkeep',
116
+ context,
117
+ 'sage',
118
+ `${relativeThemeDir}/resources/views/blocks/.gitkeep`
89
119
  );
90
120
 
91
- log(color.green, `[sage] ✅ Sage theme setup completed successfully`);
121
+ await generator.mergeWithExistingFile({
122
+ existingFile: `${relativeThemeDir}/package.json`,
123
+ moduleTemplatePath: 'theme/package.json',
124
+ context,
125
+ format: 'json',
126
+ moduleName: 'sage',
127
+ mergeStrategy: 'replace',
128
+ });
129
+
130
+ await generator.mergeWithExistingFile({
131
+ existingFile: `${relativeThemeDir}/composer.json`,
132
+ moduleTemplatePath: 'theme/composer.json',
133
+ context,
134
+ format: 'json',
135
+ moduleName: 'sage',
136
+ mergeStrategy: 'replace',
137
+ });
138
+
139
+ await generator.generateFile(
140
+ '.devcontainer/docker-compose.override.yml',
141
+ context,
142
+ 'sage',
143
+ `${relativeDevcontainerDir}/docker-compose.override.yml`
144
+ );
145
+ await generator.generateFile(
146
+ '.devcontainer/post-create.sh',
147
+ context,
148
+ 'sage',
149
+ `${relativeDevcontainerDir}/post-create.sh`
150
+ );
151
+ await fs.chmod(path.join(context.cwd, relativeDevcontainerDir, 'post-create.sh'), 0o755);
152
+
153
+ // Unified setup scripts for Sage — shared between Lando, devcontainer and CI/CD
154
+ await generator.generateFile(
155
+ 'server/cmd/setup-sage-php.sh',
156
+ context,
157
+ 'sage',
158
+ 'server/cmd/setup-sage-php.sh'
159
+ );
160
+ await generator.generateFile(
161
+ 'server/cmd/setup-sage-node.sh',
162
+ context,
163
+ 'sage',
164
+ 'server/cmd/setup-sage-node.sh'
165
+ );
166
+ await fs.chmod(path.join(context.cwd, 'server/cmd/setup-sage-php.sh'), 0o755);
167
+ await fs.chmod(path.join(context.cwd, 'server/cmd/setup-sage-node.sh'), 0o755);
168
+
169
+ await generator.mergeWithExistingFile({
170
+ existingFile: `${relativeDevcontainerDir}/devcontainer.json`,
171
+ moduleTemplatePath: '.devcontainer/devcontainer.json',
172
+ context,
173
+ format: 'json',
174
+ moduleName: 'sage',
175
+ mergeStrategy: 'replace',
176
+ });
177
+
178
+ log(color.green, '[sage] ✅ Advanced Sage setup completed successfully');
179
+ log(color.green, `[sage] ✅ Theme directory: ${relativeThemeDir}`);
180
+ log(color.green, '[sage] ✅ Lando + Devcontainer command parity enabled');
92
181
  } catch (error) {
93
182
  log(color.red, `[sage] ❌ Installation failed: ${error.message}`);
94
183
  throw error;
@@ -126,3 +215,13 @@ async function validateThemeInstallation(themeDir, sageConfig) {
126
215
 
127
216
  log(color.blue, `[sage] ℹ️ Theme info: ${packageJson.name} v${packageJson.version || '1.0.0'}`);
128
217
  }
218
+
219
+ async function isSageThemeInstalled(themeDir) {
220
+ const requiredFiles = ['package.json', 'composer.json', 'theme.json'];
221
+ for (const file of requiredFiles) {
222
+ if (!(await fs.pathExists(path.join(themeDir, file)))) {
223
+ return false;
224
+ }
225
+ }
226
+ return true;
227
+ }
@@ -2,7 +2,7 @@ export default [
2
2
  {
3
3
  type: 'confirm',
4
4
  name: 'enable_sage',
5
- message: 'Enable Sage theme?',
5
+ message: 'Enable Sage theme (advanced setup is automatic)?',
6
6
  default: true,
7
7
  },
8
8
  {
@@ -0,0 +1,7 @@
1
+ {
2
+ "dockerComposeFile": [
3
+ "docker-compose.yml",
4
+ "docker-compose.override.yml"
5
+ ],
6
+ "postCreateCommand": "bash .devcontainer/setup.sh && bash .devcontainer/post-create.sh"
7
+ }
@@ -0,0 +1,6 @@
1
+ services:
2
+ wordpress:
3
+ environment:
4
+ SAGE_THEME_DIR: /workspace/content/themes/{{projectName}}
5
+ ports:
6
+ - "3009:3009"
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env bash
2
+ # Sage devcontainer post-create — delegates to unified setup scripts.
3
+ # Invoked from: devcontainer.json postCreateCommand.
4
+ set -euo pipefail
5
+
6
+ PROJECT_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.."; pwd)"
7
+
8
+ bash "${PROJECT_ROOT}/server/cmd/setup-sage-php.sh"
9
+ bash "${PROJECT_ROOT}/server/cmd/setup-sage-node.sh"
10
+
11
+ echo "Sage post-create bootstrap completed."
@@ -1,20 +1,49 @@
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
+ services:
2
+ build:
3
+ type: node:24
4
+ ssl: true
5
+ build:
6
+ - bash /app/server/cmd/setup-sage-node.sh
7
+ scanner: false
8
+ events:
9
+ post-start:
10
+ - bash ./server/cmd/setup-sage-php.sh
11
+ - bash ./server/cmd/setup-sage-node.sh
12
+ - wp theme activate {{projectName}}
13
+ - cd /app/content/themes/{{projectName}} && wp acorn optimize:clear
14
+ tooling:
15
+ dev:
16
+ service: build
17
+ description: Run the Sage/Vite development server
18
+ cmd: npm run dev --prefix /app/content/themes/{{projectName}}
19
+ theme-bootstrap:
20
+ service: appserver
21
+ description: Install theme dependencies
22
+ dir: /app/content/themes/{{projectName}}
23
+ cmd:
24
+ - appserver: bash /app/server/cmd/setup-sage-php.sh
25
+ - build: bash /app/server/cmd/setup-sage-node.sh
26
+ theme-build:
27
+ service: build
28
+ description: Build the Sage theme
29
+ cmd: npm run build --prefix /app/content/themes/{{projectName}}
30
+ theme-lint:
31
+ service: build
32
+ description: Lint the Sage theme
33
+ cmd: npm run lint --prefix /app/content/themes/{{projectName}}
34
+ acorn:
35
+ service: appserver
36
+ description: Run Acorn artisan commands
37
+ dir: /app/content/themes/{{projectName}}
38
+ cmd: wp acorn $ACORN_COMMAND
39
+ options:
40
+ command:
41
+ passthrough: true
42
+ alias:
43
+ - c
44
+ describe: Acorn command to execute
45
+ interactive:
46
+ type: input
47
+ message: "Acorn command (example: make:component Hero)"
48
+ weight: 100
49
+ env: ACORN_COMMAND
@@ -0,0 +1,23 @@
1
+ #!/usr/bin/env bash
2
+ # Installs and builds Sage theme Node.js dependencies.
3
+ # Invoked from: Lando (build service build step + post-start), Devcontainer (post-create.sh), CI/CD.
4
+ set -euo pipefail
5
+
6
+ PROJECT_ROOT="${PROJECT_ROOT:-$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)}"
7
+ THEME_DIR="${PROJECT_ROOT}/content/themes/{{projectName}}"
8
+
9
+ if [ ! -d "${THEME_DIR}" ]; then
10
+ echo "Theme directory not found: ${THEME_DIR}" && exit 0
11
+ fi
12
+
13
+ if [ ! -d "${THEME_DIR}/node_modules" ]; then
14
+ echo "Installing Sage theme Node.js dependencies..."
15
+ npm install --prefix "${THEME_DIR}"
16
+ fi
17
+
18
+ if [ ! -f "${THEME_DIR}/public/build/manifest.json" ]; then
19
+ echo "Building Sage theme..."
20
+ npm run build --prefix "${THEME_DIR}"
21
+ fi
22
+
23
+ echo "Sage theme Node.js setup complete."
@@ -0,0 +1,24 @@
1
+ #!/usr/bin/env bash
2
+ # Installs Sage theme PHP dependencies via Composer.
3
+ # Invoked from: Lando (post-start), Devcontainer (post-create.sh), CI/CD.
4
+ set -euo pipefail
5
+
6
+ PROJECT_ROOT="${PROJECT_ROOT:-$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)}"
7
+ THEME_DIR="${PROJECT_ROOT}/content/themes/{{projectName}}"
8
+
9
+ if [ ! -d "${THEME_DIR}" ]; then
10
+ echo "Theme directory not found: ${THEME_DIR}" && exit 0
11
+ fi
12
+
13
+ if [ -f "${THEME_DIR}/vendor/autoload.php" ]; then
14
+ echo "Sage PHP dependencies already installed, skipping."
15
+ exit 0
16
+ fi
17
+
18
+ echo "Installing Sage theme PHP dependencies..."
19
+ composer install \
20
+ --working-dir="${THEME_DIR}" \
21
+ --no-interaction \
22
+ --no-progress \
23
+ --optimize-autoloader
24
+ echo "Sage PHP dependencies installed."
@@ -1,3 +1,25 @@
1
- { "name": "{{projectName}}/wordpress", "type": "wordpress-theme", "license": "MIT", "description": "{{projectDescription}}",
2
- "authors": [ { "name": "{{author}}", "email": "{{authorEmail}}" } ], "support": { }, "require": {
3
- "php": ">={{phpVersion}}", "roots/acorn": "^5.0", "log1x/sage-directives": "^2.0" } }
1
+ {
2
+ "description": "{{projectDescription}}",
3
+ "authors": [
4
+ {
5
+ "name": "{{author}}",
6
+ "email": "{{authorEmail}}"
7
+ }
8
+ ],
9
+ "require": {
10
+ "php": ">={{phpVersion}}",
11
+ "log1x/sage-directives": "^2.0",
12
+ "log1x/acf-composer": "^2.0 || ^3.0"
13
+ },
14
+ "require-dev": {
15
+ "laravel/pint": "^1.21"
16
+ },
17
+ "scripts": {
18
+ "lint": [
19
+ "./vendor/bin/pint --test"
20
+ ],
21
+ "acorn:optimize": [
22
+ "wp acorn optimize"
23
+ ]
24
+ }
25
+ }
@@ -1,3 +1,15 @@
1
- { "name": "{{projectName}}", "author": "{{author}}", "description": "{{projectDescription}}",
2
- "version": "{{projectVersion}}", "license": "MIT", "repository": { "type": "git", "url": "{{gitRepository}}"
3
- } }
1
+ {
2
+ "author": "{{author}}",
3
+ "description": "{{projectDescription}}",
4
+ "version": "{{projectVersion}}",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "{{gitRepository}}"
9
+ },
10
+ "scripts": {
11
+ "dev": "vite",
12
+ "build": "vite build",
13
+ "lint": "eslint resources --ext .js,.ts,.vue"
14
+ }
15
+ }
@@ -1,13 +1,55 @@
1
- import fs from 'fs'; import { defineConfig } from 'vite'; import tailwindcss from
2
- '@tailwindcss/vite'; import laravel from 'laravel-vite-plugin'; import { wordpressPlugin,
3
- wordpressThemeJson } from '@roots/vite-plugin'; export default defineConfig({ base:
4
- '/app/content/themes/{{projectName}}/', plugins: [ tailwindcss(), laravel({ input: [
5
- 'resources/css/app.css', 'resources/js/app.js', 'resources/css/editor.css',
6
- 'resources/js/editor.js', ], refresh: true, watch: { usePolling: true, interval: 1000, ignored:
7
- ['node_modules', 'public/build/hot'], }, }), wordpressPlugin(), // Generate the theme.json file in
8
- the public/build/assets directory // based on the Tailwind config and the theme.json file from base
9
- theme folder wordpressThemeJson({ disableTailwindColors: false, disableTailwindFonts: false,
10
- disableTailwindFontSizes: false, }), ], resolve: { alias: { '@scripts': '/resources/js', '@styles':
11
- '/resources/css', '@fonts': '/resources/fonts', '@images': '/resources/images', }, }, server: {
12
- https: { key: fs.readFileSync('/certs/cert.key'), cert: fs.readFileSync('/certs/cert.crt'), }, host:
13
- true, port: 3009, hmr: { host: 'localhost', protocol: 'wss' }, }, });
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
+ wordpressPlugin(),
26
+ wordpressThemeJson({
27
+ disableTailwindColors: false,
28
+ disableTailwindFonts: false,
29
+ disableTailwindFontSizes: false,
30
+ }),
31
+ ],
32
+ resolve: {
33
+ alias: {
34
+ '@scripts': '/resources/js',
35
+ '@styles': '/resources/css',
36
+ '@fonts': '/resources/fonts',
37
+ '@images': '/resources/images',
38
+ '@blocks': '/app/Blocks',
39
+ '@fields': '/app/Fields',
40
+ },
41
+ },
42
+ server: {
43
+ https: {
44
+ key: fs.readFileSync('/certs/cert.key'),
45
+ cert: fs.readFileSync('/certs/cert.crt'),
46
+ },
47
+ host: true,
48
+ port: 3009,
49
+ strictPort: true,
50
+ hmr: {
51
+ host: 'localhost',
52
+ protocol: 'wss',
53
+ },
54
+ },
55
+ });
@@ -1,12 +1,155 @@
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": "🛶 Lando: theme-bootstrap",
15
+ "type": "shell",
16
+ "command": "lando",
17
+ "args": ["theme-bootstrap"],
18
+ "group": "build",
19
+ "presentation": {
20
+ "echo": true,
21
+ "reveal": "always",
22
+ "focus": false,
23
+ "panel": "shared"
24
+ },
25
+ "problemMatcher": []
26
+ },
27
+ {
28
+ "label": "🛶 Lando: theme-build",
29
+ "type": "shell",
30
+ "command": "lando",
31
+ "args": ["theme-build"],
32
+ "options": {
33
+ "cwd": "${workspaceFolder}/content/themes/{{projectName}}"
34
+ },
35
+ "group": "build",
36
+ "presentation": {
37
+ "echo": true,
38
+ "reveal": "always",
39
+ "focus": false,
40
+ "panel": "shared"
41
+ },
42
+ "problemMatcher": []
43
+ },
44
+ {
45
+ "label": "🛶 Lando: theme-dev",
46
+ "type": "shell",
47
+ "command": "lando",
48
+ "args": ["theme-dev"],
49
+ "options": {
50
+ "cwd": "${workspaceFolder}/content/themes/{{projectName}}"
51
+ },
52
+ "group": "build",
53
+ "isBackground": true,
54
+ "presentation": {
55
+ "echo": true,
56
+ "reveal": "always",
57
+ "focus": false,
58
+ "panel": "shared"
59
+ },
60
+ "problemMatcher": []
61
+ },
62
+ {
63
+ "label": "🛶 Lando: theme-lint",
64
+ "type": "shell",
65
+ "command": "lando",
66
+ "args": ["theme-lint"],
67
+ "options": {
68
+ "cwd": "${workspaceFolder}/content/themes/{{projectName}}"
69
+ },
70
+ "group": "build",
71
+ "presentation": {
72
+ "echo": true,
73
+ "reveal": "always",
74
+ "focus": false,
75
+ "panel": "shared"
76
+ },
77
+ "problemMatcher": []
78
+ },
79
+ {
80
+ "label": "🛶 Lando: acorn",
81
+ "type": "shell",
82
+ "command": "lando",
83
+ "args": ["acorn", "make:component", "ExampleBlock"],
84
+ "options": {
85
+ "cwd": "${workspaceFolder}/content/themes/{{projectName}}"
86
+ },
87
+ "group": "build",
88
+ "presentation": {
89
+ "echo": true,
90
+ "reveal": "always",
91
+ "focus": false,
92
+ "panel": "shared"
93
+ },
94
+ "problemMatcher": []
95
+ },
96
+ {
97
+ "label": "🐳 Devcontainer: theme-build",
98
+ "type": "shell",
99
+ "command": "docker",
100
+ "args": ["compose", "-f", ".devcontainer/docker-compose.yml", "-f", ".devcontainer/docker-compose.override.yml", "exec", "wordpress", "bash", "-lc", "cd /workspace/content/themes/{{projectName}} && yarn build"],
101
+ "group": "build",
102
+ "presentation": {
103
+ "echo": true,
104
+ "reveal": "always",
105
+ "focus": false,
106
+ "panel": "shared"
107
+ },
108
+ "problemMatcher": []
109
+ },
110
+ {
111
+ "label": "🐳 Devcontainer: theme-dev",
112
+ "type": "shell",
113
+ "command": "docker",
114
+ "args": ["compose", "-f", ".devcontainer/docker-compose.yml", "-f", ".devcontainer/docker-compose.override.yml", "exec", "wordpress", "bash", "-lc", "cd /workspace/content/themes/{{projectName}} && yarn dev"],
115
+ "group": "build",
116
+ "isBackground": true,
117
+ "presentation": {
118
+ "echo": true,
119
+ "reveal": "always",
120
+ "focus": false,
121
+ "panel": "shared"
122
+ },
123
+ "problemMatcher": []
124
+ },
125
+ {
126
+ "label": "🐳 Devcontainer: theme-lint",
127
+ "type": "shell",
128
+ "command": "docker",
129
+ "args": ["compose", "-f", ".devcontainer/docker-compose.yml", "-f", ".devcontainer/docker-compose.override.yml", "exec", "wordpress", "bash", "-lc", "cd /workspace/content/themes/{{projectName}} && yarn lint"],
130
+ "group": "build",
131
+ "presentation": {
132
+ "echo": true,
133
+ "reveal": "always",
134
+ "focus": false,
135
+ "panel": "shared"
136
+ },
137
+ "problemMatcher": []
138
+ },
139
+ {
140
+ "label": "🐳 Devcontainer: acorn",
141
+ "type": "shell",
142
+ "command": "docker",
143
+ "args": ["compose", "-f", ".devcontainer/docker-compose.yml", "-f", ".devcontainer/docker-compose.override.yml", "exec", "wordpress", "bash", "-lc", "cd /workspace/content/themes/{{projectName}} && wp acorn make:component ExampleBlock"],
144
+ "group": "build",
145
+ "presentation": {
146
+ "echo": true,
147
+ "reveal": "always",
148
+ "focus": false,
149
+ "panel": "shared"
150
+ },
151
+ "problemMatcher": []
152
+ }
153
+ ]
154
+ }
155
+ }
@@ -0,0 +1,18 @@
1
+ import { installSuperpowersSage } from '../../lib/utils/git.js';
2
+ import { log, color } from '../../lib/utils/logger.js';
3
+
4
+ export async function setupModule(context, _generator) {
5
+ if (!context.enable_skills) {
6
+ log(color.orange, '[skills] Instalação de skills desabilitada. Pulando.');
7
+ return;
8
+ }
9
+
10
+ const targets = context.skills_targets ?? ['claude'];
11
+
12
+ if (targets.length === 0) {
13
+ log(color.orange, '[skills] Nenhum destino selecionado. Pulando.');
14
+ return;
15
+ }
16
+
17
+ await installSuperpowersSage(context.cwd, targets);
18
+ }