@codigodoleo/wp-kit 5.0.2 → 5.1.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 (59) hide show
  1. package/lib/commands/init.js +87 -78
  2. package/lib/config/versions.js +45 -45
  3. package/lib/core/infer-ci-capabilities.js +39 -26
  4. package/lib/prompts/index.js +113 -92
  5. package/modules/blank-theme/index.js +23 -34
  6. package/modules/blank-theme/prompts.js +9 -25
  7. package/modules/blank-theme/templates/.lando.yml.hbs +5 -8
  8. package/modules/blank-theme/templates/package.json.hbs +1 -1
  9. package/modules/deploy/index.js +51 -61
  10. package/modules/deploy/prompts.js +36 -12
  11. package/modules/deploy/templates/.github/workflows/ci.yml.hbs +356 -63
  12. package/modules/deploy/templates/.gitlab/ci/lint-blank-theme.yml.hbs +4 -4
  13. package/modules/deploy/templates/.gitlab/ci/lint-mu-plugin.yml.hbs +3 -2
  14. package/modules/deploy/templates/.gitlab/ci/lint-plugin.yml.hbs +3 -2
  15. package/modules/deploy/templates/.gitlab/ci/lint-sage.yml.hbs +17 -14
  16. package/modules/git/.lintstagedrc.json +2 -5
  17. package/modules/lint/.oxlintrc.json +19 -0
  18. package/modules/lint/.prettierignore +16 -1
  19. package/modules/lint/index.js +32 -40
  20. package/modules/lint/templates/mago.toml.hbs +83 -0
  21. package/modules/lint/templates/package.json.hbs +6 -10
  22. package/modules/lint/templates/workspace.json.hbs +2 -36
  23. package/modules/mu-plugin/index.js +39 -51
  24. package/modules/mu-plugin/prompts.js +10 -28
  25. package/modules/mu-plugin/templates/.lando.yml.hbs +8 -10
  26. package/modules/mu-plugin/templates/acorn/composer.json.hbs +6 -5
  27. package/modules/mu-plugin/templates/composer.json.hbs +4 -2
  28. package/modules/php/templates/.lando.yml.hbs +13 -8
  29. package/modules/php/templates/composer.json.hbs +15 -7
  30. package/modules/php/templates/workspace.json.hbs +22 -19
  31. package/modules/plugin/index.js +10 -18
  32. package/modules/plugin/prompts.js +5 -19
  33. package/modules/plugin/templates/.lando.yml.hbs +8 -10
  34. package/modules/plugin/templates/composer.json.hbs +4 -2
  35. package/modules/sage/index.js +78 -88
  36. package/modules/sage/prompts.js +10 -24
  37. package/modules/sage/templates/.lando.yml.hbs +17 -7
  38. package/modules/sage/templates/theme/composer.json.hbs +36 -23
  39. package/modules/sage/templates/theme/package.json.hbs +24 -13
  40. package/modules/test/templates/composer.json.hbs +1 -1
  41. package/package.json +30 -35
  42. package/templates/.devcontainer/devcontainer.json.hbs +2 -2
  43. package/templates/.gitignore.hbs +1 -0
  44. package/templates/auth.json.hbs +8 -0
  45. package/templates/composer.json.hbs +13 -5
  46. package/templates/package.json.hbs +2 -4
  47. package/templates/workspace.json.hbs +3 -4
  48. package/wp-config.php +5 -0
  49. package/modules/blank-theme/lint/eslint.config.mjs +0 -30
  50. package/modules/blank-theme/lint/pint.json +0 -11
  51. package/modules/deploy/.github/workflows/deploy-docker.yml +0 -104
  52. package/modules/deploy/.github/workflows/deploy-ssh.yml +0 -128
  53. package/modules/deploy/.github/workflows/release.yml +0 -57
  54. package/modules/mu-plugin/lint/eslint.config.mjs +0 -30
  55. package/modules/mu-plugin/lint/pint.json +0 -11
  56. package/modules/plugin/lint/eslint.config.mjs +0 -30
  57. package/modules/plugin/lint/pint.json +0 -11
  58. package/modules/sage/lint/eslint.config.mjs +0 -30
  59. package/modules/sage/lint/pint.json +0 -11
@@ -1,22 +1,22 @@
1
- import path from 'path';
2
- import { fileURLToPath } from 'url';
1
+ import path from "path";
2
+ import { fileURLToPath } from "url";
3
3
 
4
- import { Command } from 'commander';
5
- import fs from 'fs-extra';
4
+ import { Command } from "commander";
5
+ import fs from "fs-extra";
6
6
 
7
- import { runPrompts } from '../prompts/index.js';
8
- import { Generator } from '../core/generator.js';
9
- import { log, color } from '../utils/logger.js';
10
- import { inferCiCapabilities } from '../core/infer-ci-capabilities.js';
11
- import { validateVersionCompatibility } from '../config/versions.js';
7
+ import { runPrompts } from "../prompts/index.js";
8
+ import { Generator } from "../core/generator.js";
9
+ import { log, color } from "../utils/logger.js";
10
+ import { inferCiCapabilities } from "../core/infer-ci-capabilities.js";
11
+ import { validateVersionCompatibility } from "../config/versions.js";
12
12
 
13
13
  const __filename = fileURLToPath(import.meta.url);
14
14
  const __dirname = path.dirname(__filename);
15
15
 
16
- export const initCommand = new Command('init')
17
- .option('-o, --output <dir>', 'Output directory', '__test-sandbox__/test-project')
18
- .option('--defaults', 'Use default answers without prompting')
19
- .option('--debug', 'Ativa modo debug para logs detalhados')
16
+ export const initCommand = new Command("init")
17
+ .option("-o, --output <dir>", "Output directory", "__test-sandbox__/test-project")
18
+ .option("--defaults", "Use default answers without prompting")
19
+ .option("--debug", "Ativa modo debug para logs detalhados")
20
20
  .action(async ({ output, defaults, debug }) => {
21
21
  const target = path.resolve(output);
22
22
  const { enabledModules: promptedModules, ...context } = await runPrompts({ defaults });
@@ -29,15 +29,15 @@ export const initCommand = new Command('init')
29
29
  }
30
30
 
31
31
  // 🔧 Ajustes automáticos para Sage 11
32
- if (context.useSage && context.sageVersion === '11') {
33
- context.phpVersion = '8.3';
34
- context.nodeVersion = '22';
35
- context.wpCoreVersion = '6.9.4';
36
-
37
- log(color.orange, '🔧 Sage 11 selected — automatically adjusting versions:');
38
- log(color.orange, ' → PHP: 8.3');
39
- log(color.orange, ' → Node: 22');
40
- log(color.orange, ' → WP Core: 6.9.4');
32
+ if (context.useSage && context.sageVersion === "11") {
33
+ context.phpVersion = "8.4";
34
+ context.nodeVersion = "24";
35
+ context.wpCoreVersion = "7.0";
36
+
37
+ log(color.orange, "🔧 Sage 11 selected — automatically adjusting versions:");
38
+ log(color.orange, " → PHP: 8.4");
39
+ log(color.orange, " → Node: 24");
40
+ log(color.orange, " → WP Core: 7.0");
41
41
  }
42
42
 
43
43
  // 📋 Validar compatibilidade de versões (se Sage está habilitado)
@@ -46,11 +46,11 @@ export const initCommand = new Command('init')
46
46
  context.sageVersion,
47
47
  context.phpVersion,
48
48
  context.nodeVersion,
49
- context.wpCoreVersion
49
+ context.wpCoreVersion,
50
50
  );
51
51
 
52
52
  if (validation.warnings.length > 0) {
53
- log(color.orange, '⚠️ Version compatibility warnings:');
53
+ log(color.orange, "⚠️ Version compatibility warnings:");
54
54
  validation.warnings.forEach((warn) => log(color.orange, ` - ${warn}`));
55
55
  }
56
56
  }
@@ -60,7 +60,7 @@ export const initCommand = new Command('init')
60
60
  // 🧠 Inferência de capacidades de CI
61
61
  context.ci = inferCiCapabilities(context);
62
62
 
63
- log(color.blue, '[ci] Capacidades inferidas:');
63
+ log(color.blue, "[ci] Capacidades inferidas:");
64
64
  log(color.blue, ` → composer: ${context.ci.build.composer}`);
65
65
  log(color.blue, ` → node: ${context.ci.build.node}`);
66
66
  log(color.blue, ` → sage: ${context.ci.build.sage}`);
@@ -70,89 +70,98 @@ export const initCommand = new Command('init')
70
70
  log(color.blue, ` → themeRoot: ${context.ci.theme.paths.themeRoot}`);
71
71
  }
72
72
  if (context.useSage) {
73
- log(color.blue, ' → sageMode: advanced (automatic when Sage is enabled)');
73
+ log(color.blue, " → sageMode: advanced (automatic when Sage is enabled)");
74
74
  }
75
75
 
76
76
  const generator = new Generator(target);
77
77
  await fs.ensureDir(target);
78
78
 
79
- await generator.generateFile('.gitignore', context);
80
- await generator.generateFile('README.md', context);
81
- await generator.generateFile('.env', context);
82
- await generator.generateFile('.editorconfig', context);
83
- await generator.generateFile('server/cmd/install-wp.sh', context);
84
- await generator.generateFile('server/cmd/setup-php.sh', context);
85
- await generator.generateFile('server/cmd/setup-node.sh', context);
86
- await generator.generateFile('.devcontainer/devcontainer.json', context);
87
- await generator.generateFile('.devcontainer/docker-compose.yml', context);
88
- await generator.generateFile('.devcontainer/Dockerfile', context);
89
- await generator.generateFile('.devcontainer/setup.sh', context);
90
- await generator.generateFile('.devcontainer/config/nginx.conf', context);
91
-
92
- await generator.copyFile('.cspell.json');
93
-
94
- await generator.copyFile('server/php/php.ini');
95
-
96
- await generator.copyFile('.gitkeep', null, 'content/uploads/.gitkeep');
97
- await generator.copyFile('.gitkeep', null, 'content/plugins/.gitkeep');
98
- await generator.copyFile('.gitkeep', null, 'content/themes/.gitkeep');
99
- await generator.copyFile('.gitkeep', null, 'content/mu-plugins/.gitkeep');
100
- await generator.copyFile('.gitkeep', null, 'content/languages/.gitkeep');
101
-
102
- await fs.chmod(path.join(target, 'content/uploads'), 0o777);
103
- await fs.chmod(path.join(target, 'server/cmd/install-wp.sh'), 0o755);
104
- await fs.chmod(path.join(target, 'server/cmd/setup-php.sh'), 0o755);
105
- await fs.chmod(path.join(target, 'server/cmd/setup-node.sh'), 0o755);
106
- await fs.chmod(path.join(target, '.devcontainer/setup.sh'), 0o755);
107
-
108
- await generator.generateFile('server/www/vhosts.conf', context);
79
+ await generator.generateFile(".gitignore", context);
80
+ await generator.generateFile("README.md", context);
81
+ await generator.generateFile(".env", context);
82
+ if (context.enable_acf_pro && context.acf_license_key) {
83
+ await generator.generateFile("auth.json", context);
84
+ } else if (context.enable_acf_pro) {
85
+ log(
86
+ color.orange,
87
+ "⚠️ auth.json not generated: add your ACF license key to auth.json manually.",
88
+ );
89
+ log(color.orange, " See: https://www.advancedcustomfields.com/my-account/");
90
+ }
91
+ await generator.generateFile(".editorconfig", context);
92
+ await generator.generateFile("server/cmd/install-wp.sh", context);
93
+ await generator.generateFile("server/cmd/setup-php.sh", context);
94
+ await generator.generateFile("server/cmd/setup-node.sh", context);
95
+ await generator.generateFile(".devcontainer/devcontainer.json", context);
96
+ await generator.generateFile(".devcontainer/docker-compose.yml", context);
97
+ await generator.generateFile(".devcontainer/Dockerfile", context);
98
+ await generator.generateFile(".devcontainer/setup.sh", context);
99
+ await generator.generateFile(".devcontainer/config/nginx.conf", context);
100
+
101
+ await generator.copyFile(".cspell.json");
102
+
103
+ await generator.copyFile("server/php/php.ini");
104
+
105
+ await generator.copyFile(".gitkeep", null, "content/uploads/.gitkeep");
106
+ await generator.copyFile(".gitkeep", null, "content/plugins/.gitkeep");
107
+ await generator.copyFile(".gitkeep", null, "content/themes/.gitkeep");
108
+ await generator.copyFile(".gitkeep", null, "content/mu-plugins/.gitkeep");
109
+ await generator.copyFile(".gitkeep", null, "content/languages/.gitkeep");
110
+
111
+ await fs.chmod(path.join(target, "content/uploads"), 0o777);
112
+ await fs.chmod(path.join(target, "server/cmd/install-wp.sh"), 0o755);
113
+ await fs.chmod(path.join(target, "server/cmd/setup-php.sh"), 0o755);
114
+ await fs.chmod(path.join(target, "server/cmd/setup-node.sh"), 0o755);
115
+ await fs.chmod(path.join(target, ".devcontainer/setup.sh"), 0o755);
116
+
117
+ await generator.generateFile("server/www/vhosts.conf", context);
109
118
  if (context.useRocket) {
110
- await generator.copyFile('server/www/rocket.conf');
119
+ await generator.copyFile("server/www/rocket.conf");
111
120
  }
112
121
 
113
- await generator.copyFile('wp-config.php');
114
- await generator.copyFile('index.php');
115
- await generator.generateFile('wp-cli.yml', context);
122
+ await generator.copyFile("wp-config.php");
123
+ await generator.copyFile("index.php");
124
+ await generator.generateFile("wp-cli.yml", context);
116
125
 
117
- log(color.blue, `🧩 Enabled modules: ${enabledModules.join(', ')}`);
126
+ log(color.blue, `🧩 Enabled modules: ${enabledModules.join(", ")}`);
118
127
 
119
128
  await generator.generateModularFile({
120
- baseTemplate: 'package.json',
129
+ baseTemplate: "package.json",
121
130
  modules: enabledModules,
122
131
  context,
123
- format: 'json',
124
- mergeStrategy: 'concat',
132
+ format: "json",
133
+ mergeStrategy: "concat",
125
134
  });
126
135
 
127
136
  await generator.generateModularFile({
128
- baseTemplate: 'composer.json',
137
+ baseTemplate: "composer.json",
129
138
  modules: enabledModules,
130
139
  context,
131
- format: 'json',
132
- mergeStrategy: 'concat',
140
+ format: "json",
141
+ mergeStrategy: "concat",
133
142
  });
134
143
 
135
144
  await generator.generateModularFile({
136
- baseTemplate: '.lando.yml',
145
+ baseTemplate: ".lando.yml",
137
146
  modules: enabledModules,
138
147
  context,
139
- mergeStrategy: 'concat',
148
+ mergeStrategy: "concat",
140
149
  });
141
150
 
142
151
  await generator.generateModularFile({
143
- baseTemplate: 'workspace.json',
152
+ baseTemplate: "workspace.json",
144
153
  outputFile: `${context.projectName}.code-workspace`,
145
154
  modules: enabledModules,
146
155
  context,
147
- format: 'json',
148
- mergeStrategy: 'concat',
156
+ format: "json",
157
+ mergeStrategy: "concat",
149
158
  });
150
159
 
151
160
  for (const mod of enabledModules) {
152
- const modIndexPath = path.resolve(__dirname, '../../modules', mod, 'index.js');
161
+ const modIndexPath = path.resolve(__dirname, "../../modules", mod, "index.js");
153
162
  if (await fs.pathExists(modIndexPath)) {
154
163
  const { setupModule } = await import(modIndexPath);
155
- if (typeof setupModule === 'function') {
164
+ if (typeof setupModule === "function") {
156
165
  log(color.blue, `↪ Running setup for module: ${mod}`);
157
166
  await setupModule(context, generator);
158
167
  }
@@ -160,11 +169,11 @@ export const initCommand = new Command('init')
160
169
  }
161
170
 
162
171
  // Executa hooks após todo o setup dos módulos
163
- log(color.blue, '🔗 Executing post-setup hooks...');
164
- generator.hooks.doAction('after_setup_complete', context, generator);
172
+ log(color.blue, "🔗 Executing post-setup hooks...");
173
+ generator.hooks.doAction("after_setup_complete", context, generator);
165
174
 
166
175
  // Gera CLAUDE.md com overview do projeto e referência ao AI Co-Pilot
167
- await generator.generateFile('CLAUDE.md', context);
176
+ await generator.generateFile("CLAUDE.md", context);
168
177
 
169
- log(color.green, '✅ Project initialized with templates.');
178
+ log(color.green, "✅ Project initialized with templates.");
170
179
  });
@@ -16,11 +16,11 @@ export const VERSION_REGISTRY = {
16
16
  * Maintains LTS and supported versions
17
17
  */
18
18
  wordpress: {
19
- latest: '6.9.4',
20
- lts: ['6.9.4', '6.8.1', '6.7'],
21
- all: ['6.9.4', '6.8.1', '6.7', '6.6'],
22
- eol: ['6.5', '6.0', '5.9'],
23
- description: 'Available WordPress core versions for new projects',
19
+ latest: "7.0",
20
+ lts: ["7.0", "6.8.1", "6.7"],
21
+ all: ["7.0", "6.8.1", "6.7", "6.6"],
22
+ eol: ["6.5", "6.0", "5.9"],
23
+ description: "Available WordPress core versions for new projects",
24
24
  },
25
25
 
26
26
  /**
@@ -29,22 +29,22 @@ export const VERSION_REGISTRY = {
29
29
  */
30
30
  sage: {
31
31
  11: {
32
- tag: 'v11.0.1', // Update this when new versions are released
33
- minPhp: '8.1',
34
- acornVersion: '5.1.0',
35
- nodeMin: '18',
36
- status: 'active',
37
- releaseDate: '2024-09-27',
38
- url: 'https://github.com/roots/sage/releases/tag/v11.0.1',
32
+ tag: "v11.0.1",
33
+ minPhp: "8.2",
34
+ acornVersion: "6.1.0",
35
+ nodeMin: "20",
36
+ status: "active",
37
+ releaseDate: "2024-09-27",
38
+ url: "https://github.com/roots/sage/releases/tag/v11.0.1",
39
39
  },
40
40
  10: {
41
- tag: 'v10.8.2', // Legacy - consider only for compatibility projects
42
- minPhp: '8.0',
43
- acornVersion: '4.x',
44
- nodeMin: '16',
45
- status: 'legacy',
46
- releaseDate: '2023-06-01',
47
- url: 'https://github.com/roots/sage/releases/tag/v10.8.2',
41
+ tag: "v10.8.2", // Legacy - consider only for compatibility projects
42
+ minPhp: "8.0",
43
+ acornVersion: "4.x",
44
+ nodeMin: "16",
45
+ status: "legacy",
46
+ releaseDate: "2023-06-01",
47
+ url: "https://github.com/roots/sage/releases/tag/v10.8.2",
48
48
  },
49
49
  },
50
50
 
@@ -53,15 +53,15 @@ export const VERSION_REGISTRY = {
53
53
  * Only actively supported versions per php.net
54
54
  */
55
55
  php: {
56
- latest: '8.4',
57
- supported: ['8.4', '8.3', '8.2', '8.1'],
58
- eol: ['8.0', '7.4', '7.3', '7.2'], // Deprecated - do not use
59
- description: 'Supported PHP versions. PHP 7.4+ reached EOL on 2022-11-28',
56
+ latest: "8.4",
57
+ supported: ["8.4", "8.3", "8.2"],
58
+ eol: ["8.0", "7.4", "7.3", "7.2"], // Deprecated - do not use
59
+ description: "Supported PHP versions. PHP 7.4+ reached EOL on 2022-11-28",
60
60
  // PHP version dates: https://www.php.net/supported-versions.php
61
61
  eolDates: {
62
- 8.1: '2025-11-25',
63
- '8.0': '2023-11-26',
64
- 7.4: '2022-11-28',
62
+ 8.1: "2025-11-25",
63
+ "8.0": "2023-11-26",
64
+ 7.4: "2022-11-28",
65
65
  },
66
66
  },
67
67
 
@@ -70,16 +70,16 @@ export const VERSION_REGISTRY = {
70
70
  * Tracks LTS and current stable releases
71
71
  */
72
72
  node: {
73
- latest: '24',
74
- lts: ['24', '22', '20', '18'],
75
- all: ['24', '22', '20', '18'],
76
- deprecated: ['16', '14', '12', '10'],
77
- description: 'Supported Node.js versions - prefer LTS releases',
73
+ latest: "24",
74
+ lts: ["24", "22", "20", "18"],
75
+ all: ["24", "22", "20", "18"],
76
+ deprecated: ["16", "14", "12", "10"],
77
+ description: "Supported Node.js versions - prefer LTS releases",
78
78
  // LTS information: https://nodejs.org/en/about/releases/
79
79
  ltsDates: {
80
- 22: { start: '2024-10-29', end: '2027-04-30' },
81
- 20: { start: '2023-10-24', end: '2026-04-30' },
82
- 18: { start: '2022-10-25', end: '2025-04-30' },
80
+ 22: { start: "2024-10-29", end: "2027-04-30" },
81
+ 20: { start: "2023-10-24", end: "2026-04-30" },
82
+ 18: { start: "2022-10-25", end: "2025-04-30" },
83
83
  },
84
84
  },
85
85
  };
@@ -93,9 +93,9 @@ export const VERSION_REGISTRY = {
93
93
  */
94
94
  export function getMinWordPresForSage(sageVersion) {
95
95
  // Sage 11 requires WordPress 5.9+ due to theme.json requirements
96
- if (sageVersion === '11') return '6.0'; // Recommend 6.5+
97
- if (sageVersion === '10') return '5.9';
98
- return '5.9';
96
+ if (sageVersion === "11") return "6.0"; // Recommend 6.5+
97
+ if (sageVersion === "10") return "5.9";
98
+ return "5.9";
99
99
  }
100
100
 
101
101
  /**
@@ -115,7 +115,7 @@ export function validateVersionCompatibility(sage, php, node, wp) {
115
115
  errors.push(`Sage ${sage} requires PHP ${minPhp}+ (got ${php})`);
116
116
  }
117
117
 
118
- if (sageConfig.status === 'legacy') {
118
+ if (sageConfig.status === "legacy") {
119
119
  warnings.push(`Sage ${sage} is in legacy status. Consider upgrading.`);
120
120
  }
121
121
  }
@@ -141,12 +141,12 @@ export function validateVersionCompatibility(sage, php, node, wp) {
141
141
  /**
142
142
  * Get recommended version combination for a given Sage version
143
143
  */
144
- export function getRecommendedVersions(sageVersion = '11') {
144
+ export function getRecommendedVersions(sageVersion = "11") {
145
145
  return {
146
146
  sage: sageVersion,
147
- php: '8.3',
148
- node: '22',
149
- wp: '6.9.4',
147
+ php: "8.4",
148
+ node: "24",
149
+ wp: "7.0",
150
150
  };
151
151
  }
152
152
 
@@ -155,9 +155,9 @@ export function getRecommendedVersions(sageVersion = '11') {
155
155
  */
156
156
  export function formatVersionInfo() {
157
157
  return `
158
- WordPress: ${VERSION_REGISTRY.wordpress.all.join(', ')}
159
- PHP: ${VERSION_REGISTRY.php.supported.join(', ')}
160
- Node.js: ${VERSION_REGISTRY.node.lts.join(', ')}
158
+ WordPress: ${VERSION_REGISTRY.wordpress.all.join(", ")}
159
+ PHP: ${VERSION_REGISTRY.php.supported.join(", ")}
160
+ Node.js: ${VERSION_REGISTRY.node.lts.join(", ")}
161
161
  Sage: 11 (${VERSION_REGISTRY.sage[11].tag}), 10 (${VERSION_REGISTRY.sage[10].tag})
162
162
  `;
163
163
  }
@@ -1,6 +1,6 @@
1
- import path from 'path';
1
+ import path from "path";
2
2
 
3
- import fs from 'fs-extra';
3
+ import fs from "fs-extra";
4
4
 
5
5
  function fileExists(filePath) {
6
6
  try {
@@ -13,9 +13,9 @@ function fileExists(filePath) {
13
13
  function detectThemePaths(context, hasSage) {
14
14
  const projectName = context.projectName;
15
15
  const candidates = [
16
- path.join(context.cwd, 'content', 'themes', projectName),
17
- path.join(context.cwd, 'web', 'app', 'themes', projectName),
18
- path.join(context.cwd, 'wp-content', 'themes', projectName),
16
+ path.join(context.cwd, "content", "themes", projectName),
17
+ path.join(context.cwd, "web", "app", "themes", projectName),
18
+ path.join(context.cwd, "wp-content", "themes", projectName),
19
19
  ];
20
20
 
21
21
  for (const abs of candidates) {
@@ -24,24 +24,24 @@ function detectThemePaths(context, hasSage) {
24
24
  return {
25
25
  themeRootAbs: abs,
26
26
  themeRoot: rel,
27
- packageJson: path.join(abs, 'package.json'),
28
- composerJson: path.join(abs, 'composer.json'),
27
+ packageJson: path.join(abs, "package.json"),
28
+ composerJson: path.join(abs, "composer.json"),
29
29
  // Bud/Sage pode gerar em public/ ou dist/
30
- distCandidates: [path.join(rel, 'public'), path.join(rel, 'dist')],
30
+ distCandidates: [path.join(rel, "public"), path.join(rel, "dist")],
31
31
  };
32
32
  }
33
33
  }
34
34
 
35
35
  // Se Sage estiver habilitado, assumir caminho preferencial mesmo antes de existir
36
36
  if (hasSage && projectName) {
37
- const abs = path.join(context.cwd, 'content', 'themes', projectName);
37
+ const abs = path.join(context.cwd, "content", "themes", projectName);
38
38
  const rel = path.relative(context.cwd, abs);
39
39
  return {
40
40
  themeRootAbs: abs,
41
41
  themeRoot: rel,
42
- packageJson: path.join(abs, 'package.json'),
43
- composerJson: path.join(abs, 'composer.json'),
44
- distCandidates: [path.join(rel, 'public'), path.join(rel, 'dist')],
42
+ packageJson: path.join(abs, "package.json"),
43
+ composerJson: path.join(abs, "composer.json"),
44
+ distCandidates: [path.join(rel, "public"), path.join(rel, "dist")],
45
45
  };
46
46
  }
47
47
 
@@ -58,8 +58,8 @@ export function inferCiCapabilities(context) {
58
58
  const hasSage = Boolean(context.enable_sage || context.useSage);
59
59
  const theme = detectThemePaths(context, hasSage);
60
60
 
61
- const rootComposer = path.join(context.cwd, 'composer.json');
62
- const rootPackage = path.join(context.cwd, 'package.json');
61
+ const rootComposer = path.join(context.cwd, "composer.json");
62
+ const rootPackage = path.join(context.cwd, "package.json");
63
63
  const existsRootComposer = fileExists(rootComposer);
64
64
  const existsThemeComposer = Boolean(theme.composerJson && fileExists(theme.composerJson));
65
65
  const existsRootPackage = fileExists(rootPackage);
@@ -71,13 +71,18 @@ export function inferCiCapabilities(context) {
71
71
 
72
72
  let nodeVersion = context.nodeVersion;
73
73
  if (!nodeVersion) {
74
- if (hasSage && context.sageVersion === '11') {
75
- nodeVersion = '23';
74
+ if (hasSage && context.sageVersion === "11") {
75
+ nodeVersion = "23";
76
76
  } else {
77
- nodeVersion = '18';
77
+ nodeVersion = "18";
78
78
  }
79
79
  }
80
80
 
81
+ const deployDocker = context.deploy_strategy === "docker";
82
+ const deploySsh = context.deploy_strategy === "ssh";
83
+ const sshTransport = context.ssh_transport || "direct";
84
+ const dockerRegistry = context.docker_registry || "ghcr";
85
+
81
86
  const ci = {
82
87
  build: {
83
88
  composer: hasComposer,
@@ -85,12 +90,7 @@ export function inferCiCapabilities(context) {
85
90
  sage: hasSage,
86
91
  },
87
92
  lint: {
88
- sage:
89
- hasSage &&
90
- Boolean(context.enable_lint) &&
91
- (context.sage_lint_eslint !== false ||
92
- context.sage_lint_pint !== false ||
93
- context.sage_lint_stylelint !== false),
93
+ sage: hasSage && Boolean(context.enable_lint),
94
94
  mu_plugin: Boolean(context.enable_mu_plugin && context.enable_lint),
95
95
  plugin: Boolean(context.enable_plugin && context.enable_lint),
96
96
  blank_theme: Boolean(context.enable_blank_theme && context.enable_lint),
@@ -102,7 +102,20 @@ export function inferCiCapabilities(context) {
102
102
  Boolean(context.enable_blank_theme)),
103
103
  },
104
104
  deploy: {
105
- docker: context.deploy_strategy === 'docker',
105
+ docker: deployDocker,
106
+ ssh: deploySsh,
107
+ },
108
+ ssh: {
109
+ transport: sshTransport,
110
+ useCloudflare: sshTransport === "cloudflare-tunnel",
111
+ useDirect: sshTransport === "direct",
112
+ },
113
+ docker: {
114
+ registry: dockerRegistry,
115
+ registryGhcr: dockerRegistry === "ghcr",
116
+ registryEcr: dockerRegistry === "ecr",
117
+ registryDockerHub: dockerRegistry === "dockerhub",
118
+ registryGitlab: dockerRegistry === "gitlab",
106
119
  },
107
120
  nodeVersion,
108
121
  theme: {
@@ -116,8 +129,8 @@ export function inferCiCapabilities(context) {
116
129
  themeRootExists: Boolean(theme.themeRootAbs && fileExists(theme.themeRootAbs)),
117
130
  },
118
131
  cache: {
119
- packageGlobs: ['**/package.json'],
120
- composerGlobs: ['**/composer.json'],
132
+ packageGlobs: ["**/package.json"],
133
+ composerGlobs: ["**/composer.json"],
121
134
  },
122
135
  };
123
136