@codigodoleo/wp-kit 2.0.4 β†’ 3.0.1

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 (67) hide show
  1. package/.cspell.json +5 -25
  2. package/README.md +127 -2
  3. package/lib/cli.js +1 -0
  4. package/lib/commands/init.js +32 -10
  5. package/lib/config/versions.js +163 -0
  6. package/lib/core/generator.js +63 -46
  7. package/lib/core/hook-manager.js +2 -2
  8. package/lib/core/infer-ci-capabilities.js +13 -24
  9. package/lib/prompts/index.js +31 -19
  10. package/lib/prompts/loadModulePrompts.js +4 -2
  11. package/lib/utils/generate-from-template.js +1 -0
  12. package/modules/deploy/index.js +34 -7
  13. package/modules/deploy/prompts.js +5 -5
  14. package/modules/deploy/templates/.github/workflows/ci.yml.hbs +49 -103
  15. package/modules/deploy/templates/.gitlab/gitlab-ci.yml.hbs +45 -145
  16. package/modules/deploy/templates/bitbucket-pipelines.yml.hbs +46 -97
  17. package/modules/docs/prompts.js +2 -2
  18. package/modules/docs/templates/README.md.hbs +67 -160
  19. package/modules/docs/templates/docs/Arquitetura.md +113 -92
  20. package/modules/docs/templates/docs/Deploy-Pipeline.md +22 -8
  21. package/modules/docs/templates/docs/Desenvolvimento.md +187 -164
  22. package/modules/docs/templates/docs/Getting-Started.md +37 -7
  23. package/modules/docs/templates/docs/Infraestrutura.md +41 -12
  24. package/modules/docs/templates/docs/Monitoramento.md +83 -45
  25. package/modules/docs/templates/docs/Sync-the-Production-DB-with-the-Staging-DB.md +6 -7
  26. package/modules/docs/templates/docs/Troubleshooting.md +1 -1
  27. package/modules/git/.github/PULL_REQUEST_TEMPLATE.md +1 -0
  28. package/modules/git/.gitlab/merge_request_templates/default.md +1 -0
  29. package/modules/git/.vscode/commit-instructions.md +7 -0
  30. package/modules/git/.vscode/conventional-commits.code-snippets +13 -43
  31. package/modules/git/docs/CONVENTIONAL-COMMITS.md +14 -14
  32. package/modules/git/index.js +39 -34
  33. package/modules/git/prompts.js +4 -4
  34. package/modules/git/templates/.lando.yml.hbs +5 -13
  35. package/modules/git/templates/package.json.hbs +4 -15
  36. package/modules/git/templates/workspace.json.hbs +28 -114
  37. package/modules/lint/eslint.config.mjs +36 -0
  38. package/modules/lint/index.js +1 -2
  39. package/modules/lint/prompts.js +3 -3
  40. package/modules/lint/templates/.lando.yml.hbs +2 -10
  41. package/modules/lint/templates/package.json.hbs +4 -16
  42. package/modules/lint/templates/workspace.json.hbs +15 -56
  43. package/modules/php/prompts.js +2 -2
  44. package/modules/php/templates/.lando.yml.hbs +2 -11
  45. package/modules/php/templates/composer.json.hbs +1 -6
  46. package/modules/php/templates/workspace.json.hbs +15 -74
  47. package/modules/redis/prompts.js +2 -2
  48. package/modules/redis/templates/.lando.yml.hbs +1 -8
  49. package/modules/sage/index.js +115 -7
  50. package/modules/sage/prompts.js +3 -3
  51. package/modules/sage/templates/.lando.yml.hbs +20 -64
  52. package/modules/sage/templates/theme/composer.json.hbs +3 -18
  53. package/modules/sage/templates/theme/package.json.hbs +3 -11
  54. package/modules/sage/templates/theme/style.css.hbs +20 -13
  55. package/modules/sage/templates/theme/vite.config.js.hbs +13 -53
  56. package/modules/sage/templates/workspace.json.hbs +12 -67
  57. package/modules/test-directory/prompts.js +2 -2
  58. package/package.json +20 -1
  59. package/templates/.editorconfig.hbs +5 -39
  60. package/templates/.env.hbs +14 -35
  61. package/templates/.gitignore.hbs +13 -86
  62. package/templates/.lando.yml.hbs +11 -44
  63. package/templates/README.md.hbs +7 -8
  64. package/templates/composer.json.hbs +12 -60
  65. package/templates/server/cmd/install-wp.sh.hbs +43 -58
  66. package/templates/server/www/vhosts.conf.hbs +21 -71
  67. package/templates/workspace.json.hbs +40 -177
@@ -1,74 +1,15 @@
1
- {
2
- "settings": {
3
- "php.validate.enable": true,
4
- "php.validate.executablePath": "${workspaceFolder}/scripts/php-wrapper.sh",
5
- "php.validate.run": "onSave",
6
- "php.suggest.basic": false,
7
- "intelephense.files.maxSize": 5000000,
8
- "intelephense.files.exclude": [
9
- "**/.git/**",
10
- "**/node_modules/**",
11
- "**/vendor/**/{Test,test,Tests,tests}/**",
12
- "**/.lando/**",
13
- "**/wp/**",
14
- "**/content/cache/**"
15
- ],
16
- "intelephense.stubs": [
17
- "wordpress"
18
- ],
19
- "[php]": {
20
- "editor.defaultFormatter": "open-southeners.laravel-pint",
21
- "editor.formatOnSave": true,
22
- "editor.insertSpaces": true,
23
- "editor.tabSize": 4
24
- }
25
- },
26
- "extensions": {
27
- "recommendations": [
28
- "open-southeners.laravel-pint"
29
- ]
30
- },
31
- "tasks": {
32
- "tasks": [
33
- {
34
- "label": "πŸ”§ PHP: Fix Code Style (Pint)",
35
- "type": "shell",
36
- "command": "lando",
37
- "args": ["pint"],
38
- "group": "build",
39
- "presentation": {
40
- "echo": true,
41
- "reveal": "always",
42
- "focus": false,
43
- "panel": "shared"
44
- },
45
- "problemMatcher": []
46
- },
47
- {
48
- "label": "πŸ” PHP: Check Code Style (Pint)",
49
- "type": "shell",
50
- "command": "lando",
51
- "args": ["pint", "--test"],
52
- "group": "test",
53
- "presentation": {
54
- "echo": true,
55
- "reveal": "always",
56
- "focus": false,
57
- "panel": "shared"
58
- },
59
- "problemMatcher": {
60
- "owner": "pint",
61
- "fileLocation": "absolute",
62
- "pattern": {
63
- "regexp": "^(.*):(\\d+):(\\d+):\\s+(warning|error)\\s+-\\s+(.*)$",
64
- "file": 1,
65
- "line": 2,
66
- "column": 3,
67
- "severity": 4,
68
- "message": 5
69
- }
70
- }
71
- }
72
- ]
73
- }
74
- }
1
+ { "settings": { "php.validate.enable": true, "php.validate.executablePath":
2
+ "${workspaceFolder}/scripts/php-wrapper.sh", "php.validate.run": "onSave", "php.suggest.basic":
3
+ false, "intelephense.files.maxSize": 5000000, "intelephense.files.exclude": [ "**/.git/**",
4
+ "**/node_modules/**", "**/vendor/**/{Test,test,Tests,tests}/**", "**/.lando/**", "**/wp/**",
5
+ "**/content/cache/**" ], "intelephense.stubs": [ "wordpress" ], "[php]": {
6
+ "editor.defaultFormatter": "open-southeners.laravel-pint", "editor.formatOnSave": true,
7
+ "editor.insertSpaces": true, "editor.tabSize": 4 } }, "extensions": { "recommendations": [
8
+ "open-southeners.laravel-pint" ] }, "tasks": { "tasks": [ { "label": "πŸ”§ PHP: Fix Code Style
9
+ (Pint)", "type": "shell", "command": "lando", "args": ["pint"], "group": "build", "presentation": {
10
+ "echo": true, "reveal": "always", "focus": false, "panel": "shared" }, "problemMatcher": [] }, {
11
+ "label": "πŸ” PHP: Check Code Style (Pint)", "type": "shell", "command": "lando", "args": ["pint",
12
+ "--test"], "group": "test", "presentation": { "echo": true, "reveal": "always", "focus": false,
13
+ "panel": "shared" }, "problemMatcher": { "owner": "pint", "fileLocation": "absolute", "pattern": {
14
+ "regexp": "^(.*):(\\d+):(\\d+):\\s+(warning|error)\\s+-\\s+(.*)$", "file": 1, "line": 2, "column":
15
+ 3, "severity": 4, "message": 5 } } } ] } }
@@ -3,6 +3,6 @@ export default [
3
3
  type: 'confirm',
4
4
  name: 'enable_redis',
5
5
  message: 'Enable Redis support?',
6
- default: true
7
- }
6
+ default: true,
7
+ },
8
8
  ];
@@ -1,8 +1 @@
1
- services:
2
- cache:
3
- type: redis:6
4
-
5
- tooling:
6
- redis-cli:
7
- service: cache
8
- cmd: redis-cli
1
+ services: cache: type: redis:6 tooling: redis-cli: service: cache cmd: redis-cli
@@ -1,20 +1,128 @@
1
1
  import path from 'path';
2
+ import { execSync } from 'child_process';
3
+
2
4
  import fs from 'fs-extra';
5
+
3
6
  import { log, color } from '../../lib/utils/logger.js';
4
- import { execSync } from 'child_process';
7
+ import { VERSION_REGISTRY, validateVersionCompatibility } from '../../lib/config/versions.js';
5
8
 
9
+ /**
10
+ * Install Sage theme with enhanced error handling and validation
11
+ * - Validates version compatibility
12
+ * - Provides detailed error messages
13
+ * - Validates installation success
14
+ * - Better logging and progress tracking
15
+ */
6
16
  export async function setupModule(context, generator) {
7
17
  const themeDir = path.join(context.cwd, 'content', 'themes', context.projectName);
8
18
  const relativeThemeDir = `content/themes/${context.projectName}`;
9
19
 
10
- await fs.ensureDir(themeDir);
20
+ try {
21
+ // 1. Validate version compatibility
22
+ const validation = validateVersionCompatibility(
23
+ context.sageVersion,
24
+ context.phpVersion,
25
+ context.nodeVersion,
26
+ context.wpCoreVersion
27
+ );
28
+
29
+ if (validation.errors.length > 0) {
30
+ log(color.red, '❌ Version compatibility errors:');
31
+ validation.errors.forEach((err) => log(color.red, ` - ${err}`));
32
+ throw new Error('Version compatibility check failed');
33
+ }
34
+
35
+ if (validation.warnings.length > 0) {
36
+ log(color.orange, '⚠️ Version compatibility warnings:');
37
+ validation.warnings.forEach((warn) => log(color.orange, ` - ${warn}`));
38
+ }
39
+
40
+ // 2. Get Sage configuration
41
+ const sageConfig = VERSION_REGISTRY.sage[context.sageVersion];
42
+ if (!sageConfig) {
43
+ throw new Error(`Sage version ${context.sageVersion} is not supported. Use 11 or 10.`);
44
+ }
45
+
46
+ // 3. Prepare and validate directory
47
+ await fs.ensureDir(themeDir);
48
+ const files = await fs.readdir(themeDir);
49
+ if (files.length > 0) {
50
+ log(
51
+ color.orange,
52
+ `⚠️ Warning: ${themeDir} is not empty. Existing files may be overwritten.`
53
+ );
54
+ }
55
+
56
+ // 4. Build composer command with proper error handling
57
+ const cmd = [
58
+ 'composer create-project',
59
+ 'roots/sage',
60
+ `"${themeDir}"`,
61
+ sageConfig.tag,
62
+ '--no-interaction',
63
+ '--ignore-platform-reqs',
64
+ ].join(' ');
65
+
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 });
71
+
72
+ // 6. Validate theme installation
73
+ await validateThemeInstallation(themeDir, sageConfig);
74
+ log(color.green, `[sage] βœ… Theme installation verified`);
75
+
76
+ // 7. Generate customizations
77
+ log(color.blue, `[sage] πŸ“ Generating theme customizations...`);
78
+ await generator.generateFile(
79
+ 'theme/vite.config.js',
80
+ context,
81
+ 'sage',
82
+ `${relativeThemeDir}/vite.config.js`
83
+ );
84
+ await generator.generateFile(
85
+ 'theme/style.css',
86
+ context,
87
+ 'sage',
88
+ `${relativeThemeDir}/style.css`
89
+ );
90
+
91
+ log(color.green, `[sage] βœ… Sage theme setup completed successfully`);
92
+ } catch (error) {
93
+ log(color.red, `[sage] ❌ Installation failed: ${error.message}`);
94
+ throw error;
95
+ }
96
+ }
97
+
98
+ /**
99
+ * Validate that Sage theme installation was successful
100
+ */
101
+ async function validateThemeInstallation(themeDir, sageConfig) {
102
+ const requiredFiles = ['package.json', 'composer.json', 'theme.json'];
103
+ const missingFiles = [];
104
+
105
+ for (const file of requiredFiles) {
106
+ const filePath = path.join(themeDir, file);
107
+ if (!(await fs.pathExists(filePath))) {
108
+ missingFiles.push(file);
109
+ }
110
+ }
111
+
112
+ if (missingFiles.length > 0) {
113
+ throw new Error(`Theme installation incomplete. Missing files: ${missingFiles.join(', ')}`);
114
+ }
11
115
 
12
- const cmd = `composer create-project roots/sage ${themeDir} ${context.sageVersion === '11' ? 'v11.0.1' : 'v10.8.2'} --no-interaction --ignore-platform-reqs`;
116
+ // Additional validation: check if package.json has correct structure
117
+ const packageJsonPath = path.join(themeDir, 'package.json');
118
+ const packageJson = await fs.readJson(packageJsonPath);
13
119
 
14
- log(color.blue, `[sage] Installing Sage theme at: ${themeDir}`);
15
- execSync(cmd, { stdio: 'inherit' });
120
+ // Sage packages typically have devDependencies (which is valid)
121
+ const hasDeps = packageJson.dependencies || packageJson.devDependencies;
16
122
 
17
- await generator.generateFile('theme/vite.config.js', context, 'sage', `${relativeThemeDir}/vite.config.js`);
18
- await generator.generateFile('theme/style.css', context, 'sage', `${relativeThemeDir}/style.css`);
123
+ if (!hasDeps) {
124
+ throw new Error('Theme package.json is missing dependency sections');
125
+ }
19
126
 
127
+ log(color.blue, `[sage] ℹ️ Theme info: ${packageJson.name} v${packageJson.version || '1.0.0'}`);
20
128
  }
@@ -3,7 +3,7 @@ export default [
3
3
  type: 'confirm',
4
4
  name: 'enable_sage',
5
5
  message: 'Enable Sage theme?',
6
- default: true
6
+ default: true,
7
7
  },
8
8
  {
9
9
  type: 'list',
@@ -11,6 +11,6 @@ export default [
11
11
  message: 'Sage version:',
12
12
  choices: ['11', '10'],
13
13
  default: '11',
14
- when: (answers) => answers.enable_sage
15
- }
14
+ when: (answers) => answers.enable_sage,
15
+ },
16
16
  ];
@@ -1,64 +1,20 @@
1
- services:
2
- appserver:
3
- run:
4
- - cd /app/content/themes/{{projectName}} && composer install --no-interaction --no-progress --optimize-autoloader
5
- - cd /app/content/themes/{{projectName}} && yarn install && yarn build
6
- - wp theme activate {{projectName}}
7
- - cd /app/content/themes/{{projectName}} && wp acorn optimize:clear && wp acorn optimize
8
- tooling:
9
- theme-build:
10
- service: appserver
11
- description: "Build the Sage theme"
12
- dir: /app/content/themes/{{projectName}}
13
- cmd:
14
- - composer install --no-interaction --no-progress --optimize-autoloader
15
- - yarn install
16
- - yarn build
17
- theme-lint:
18
- service: appserver
19
- description: "Lint the Sage theme"
20
- dir: /app/content/themes/{{projectName}}
21
- cmd:
22
- - yarn lint
23
- - pint --test
24
- theme-dev:
25
- service: appserver
26
- description: "Dev the Sage theme"
27
- dir: /app/content/themes/{{projectName}}
28
- cmd:
29
- - yarn dev
30
- acorn-make:
31
- service: appserver
32
- description: Create new Acorn classes interactively
33
- dir: /app/content/themes/{{projectName}}
34
- cmd: wp acorn make:$ACORN_TYPE $ACORN_NAME
35
- options:
36
- type:
37
- passthrough: true
38
- alias:
39
- - t
40
- describe: Type of class to create
41
- interactive:
42
- type: list
43
- message: What type of class would you like to create?
44
- choices:
45
- - name: Command (Artisan command)
46
- value: command
47
- - name: Component (View component class)
48
- value: component
49
- - name: Composer (View composer class)
50
- value: composer
51
- - name: Provider (Service provider class)
52
- value: provider
53
- weight: 100
54
- env: ACORN_TYPE
55
- filename:
56
- passthrough: true
57
- alias:
58
- - n
59
- describe: Name of the class to create
60
- interactive:
61
- type: input
62
- message: What is the name of the class?
63
- weight: 200
64
- env: ACORN_NAME
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,18 +1,3 @@
1
- {
2
- "name": "{{projectName}}/wordpress",
3
- "type": "wordpress-theme",
4
- "license": "MIT",
5
- "description": "{{projectDescription}}",
6
- "authors": [
7
- {
8
- "name": "{{author}}",
9
- "email": "{{authorEmail}}"
10
- }
11
- ],
12
- "support": { },
13
- "require": {
14
- "php": ">={{phpVersion}}",
15
- "roots/acorn": "^5.0",
16
- "log1x/sage-directives": "^2.0"
17
- }
18
- }
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,11 +1,3 @@
1
- {
2
- "name": "{{projectName}}",
3
- "author": "{{author}}",
4
- "description": "{{projectDescription}}",
5
- "version": "{{projectVersion}}",
6
- "license": "MIT",
7
- "repository": {
8
- "type": "git",
9
- "url": "{{gitRepository}}"
10
- }
11
- }
1
+ { "name": "{{projectName}}", "author": "{{author}}", "description": "{{projectDescription}}",
2
+ "version": "{{projectVersion}}", "license": "MIT", "repository": { "type": "git", "url": "{{gitRepository}}"
3
+ } }
@@ -1,13 +1,20 @@
1
- /*
2
- Theme Name: {{projectName}}
3
- Theme URI: {{gitRepository}}
4
- Description: {{projectDescription}}
5
- Version: {{projectVersion}}
6
- Author: {{author}}
7
- Author URI: {{gitRepository}}
8
- Text Domain: {{projectName}}
9
- License: MIT License
10
- License URI: {{gitRepository}}/blob/main/LICENSE
11
- Requires PHP: {{phpVersion}}
12
- Requires at least: {{wpCoreVersion}}
13
- */
1
+ /* Theme Name:
2
+ {{projectName}}
3
+ Theme URI:
4
+ {{gitRepository}}
5
+ Description:
6
+ {{projectDescription}}
7
+ Version:
8
+ {{projectVersion}}
9
+ Author:
10
+ {{author}}
11
+ Author URI:
12
+ {{gitRepository}}
13
+ Text Domain:
14
+ {{projectName}}
15
+ License: MIT License License URI:
16
+ {{gitRepository}}/blob/main/LICENSE Requires PHP:
17
+ {{phpVersion}}
18
+ Requires at least:
19
+ {{wpCoreVersion}}
20
+ */
@@ -1,53 +1,13 @@
1
- import fs from 'fs';
2
- import { defineConfig } from 'vite';
3
- import tailwindcss from '@tailwindcss/vite';
4
- import laravel from 'laravel-vite-plugin';
5
- import { wordpressPlugin, wordpressThemeJson } from '@roots/vite-plugin';
6
-
7
- export default defineConfig({
8
- base: '/app/content/themes/{{projectName}}/',
9
- plugins: [
10
- tailwindcss(),
11
- laravel({
12
- input: [
13
- 'resources/css/app.css',
14
- 'resources/js/app.js',
15
- 'resources/css/editor.css',
16
- 'resources/js/editor.js',
17
- ],
18
- refresh: true,
19
- watch: {
20
- usePolling: true,
21
- interval: 1000,
22
- ignored: ['node_modules', 'public/build/hot'],
23
- },
24
- }),
25
-
26
- wordpressPlugin(),
27
-
28
- // Generate the theme.json file in the public/build/assets directory
29
- // based on the Tailwind config and the theme.json file from base theme folder
30
- wordpressThemeJson({
31
- disableTailwindColors: false,
32
- disableTailwindFonts: false,
33
- disableTailwindFontSizes: false,
34
- }),
35
- ],
36
- resolve: {
37
- alias: {
38
- '@scripts': '/resources/js',
39
- '@styles': '/resources/css',
40
- '@fonts': '/resources/fonts',
41
- '@images': '/resources/images',
42
- },
43
- },
44
- server: {
45
- https: {
46
- key: fs.readFileSync('/certs/cert.key'),
47
- cert: fs.readFileSync('/certs/cert.crt'),
48
- },
49
- host: true,
50
- port: 3009,
51
- hmr: { host: 'localhost', protocol: 'wss' },
52
- },
53
- });
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,67 +1,12 @@
1
- {
2
- "folders": [
3
- {
4
- "path": "./content/themes/{{projectName}}",
5
- "name": "🎨 Theme"
6
- }
7
- ],
8
- "settings": {
9
- "gitlens.hovers.detailsMarkdownFormat": "testing"
10
- },
11
- "tasks": {
12
- "tasks": [
13
- {
14
- "label": "πŸ—οΈ Theme: Build Assets",
15
- "type": "shell",
16
- "command": "lando",
17
- "args": ["yarn", "build"],
18
- "options": {
19
- "cwd": "${workspaceFolder}/content/themes/wordpress-dev"
20
- },
21
- "group": "build",
22
- "presentation": {
23
- "echo": true,
24
- "reveal": "always",
25
- "focus": false,
26
- "panel": "shared"
27
- },
28
- "problemMatcher": []
29
- },
30
- {
31
- "label": "πŸ‘€ Theme: Watch Assets",
32
- "type": "shell",
33
- "command": "lando",
34
- "args": ["yarn", "dev"],
35
- "options": {
36
- "cwd": "${workspaceFolder}/content/themes/wordpress-dev"
37
- },
38
- "group": "build",
39
- "isBackground": true,
40
- "presentation": {
41
- "echo": true,
42
- "reveal": "always",
43
- "focus": false,
44
- "panel": "shared"
45
- },
46
- "problemMatcher": []
47
- },
48
- {
49
- "label": "πŸ“¦ Theme: Composer Install",
50
- "type": "shell",
51
- "command": "lando",
52
- "args": ["composer", "install"],
53
- "options": {
54
- "cwd": "${workspaceFolder}/content/themes/wordpress-dev"
55
- },
56
- "group": "build",
57
- "presentation": {
58
- "echo": true,
59
- "reveal": "always",
60
- "focus": false,
61
- "panel": "shared"
62
- },
63
- "problemMatcher": []
64
- }
65
- ]
66
- }
67
- }
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": [] } ] } }
@@ -3,6 +3,6 @@ export default [
3
3
  type: 'confirm',
4
4
  name: 'enable_test_directory',
5
5
  message: 'Enable test directory module (demonstrates copyDirectory functionality)?',
6
- default: false
7
- }
6
+ default: false,
7
+ },
8
8
  ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codigodoleo/wp-kit",
3
- "version": "2.0.4",
3
+ "version": "3.0.1",
4
4
  "description": "Kit opinativo para padronizar projetos WordPress com CI/CD dinΓ’mico.",
5
5
  "main": "bin/index.js",
6
6
  "bin": {
@@ -22,8 +22,11 @@
22
22
  ".gitkeep"
23
23
  ],
24
24
  "scripts": {
25
+ "prepare": "husky install",
25
26
  "lint": "eslint .",
27
+ "lint:fix": "eslint . --fix",
26
28
  "format": "prettier --write .",
29
+ "commit": "cz",
27
30
  "test:setup": "npm run test:clean && npm run test:scaffold",
28
31
  "test:clean": "rm -rf __test-sandbox__",
29
32
  "test:scaffold": "node ./bin/index.js init --output=__test-sandbox__/test-project --defaults",
@@ -41,12 +44,23 @@
41
44
  "license": "ISC",
42
45
  "type": "module",
43
46
  "devDependencies": {
47
+ "@commitlint/cli": "^18.4.3",
48
+ "@commitlint/config-conventional": "^18.4.3",
49
+ "@commitlint/prompt": "^18.4.3",
44
50
  "@cspell/dict-php": "^4.0.14",
45
51
  "@cspell/dict-pt-br": "^2.4.0",
52
+ "@eslint/js": "^9.30.1",
53
+ "commitizen": "^4.3.0",
54
+ "conventional-changelog-cli": "^4.1.0",
46
55
  "eslint": "^9.30.1",
47
56
  "eslint-config-prettier": "^10.1.5",
48
57
  "eslint-plugin-import": "^2.32.0",
58
+ "eslint-plugin-prettier": "^5.2.0",
59
+ "globals": "^16.3.0",
60
+ "husky": "^8.0.3",
61
+ "lint-staged": "^15.2.1",
49
62
  "prettier": "^3.6.2",
63
+ "standard-version": "^9.5.0",
50
64
  "stylelint": "^16.21.1",
51
65
  "stylelint-config-standard-scss": "^15.0.1"
52
66
  },
@@ -58,5 +72,10 @@
58
72
  "inquirer": "^12.7.0",
59
73
  "js-yaml": "^4.1.0",
60
74
  "lodash.mergewith": "^4.6.2"
75
+ },
76
+ "config": {
77
+ "commitizen": {
78
+ "path": "@commitlint/prompt"
79
+ }
61
80
  }
62
81
  }