@codigodoleo/wp-kit 3.2.0 → 3.3.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 (64) hide show
  1. package/lib/core/infer-ci-capabilities.js +17 -0
  2. package/lib/prompts/index.js +3 -3
  3. package/modules/blank-theme/index.js +71 -0
  4. package/modules/blank-theme/lint/.prettierrc.json +12 -0
  5. package/modules/blank-theme/lint/.stylelintrc.json +7 -0
  6. package/modules/{lint → blank-theme/lint}/eslint.config.mjs +2 -8
  7. package/modules/blank-theme/lint/pint.json +11 -0
  8. package/modules/blank-theme/prompts.js +36 -0
  9. package/modules/blank-theme/templates/.lando.yml.hbs +26 -0
  10. package/modules/blank-theme/templates/functions.php.hbs +46 -0
  11. package/modules/blank-theme/templates/package.json.hbs +16 -0
  12. package/modules/blank-theme/templates/style.css.hbs +7 -0
  13. package/modules/blank-theme/templates/vite.config.js.hbs +23 -0
  14. package/modules/deploy/.github/workflows/deploy-docker.yml +2 -0
  15. package/modules/deploy/.github/workflows/deploy-ssh.yml +2 -0
  16. package/modules/deploy/.github/workflows/release.yml +2 -0
  17. package/modules/deploy/index.js +38 -0
  18. package/modules/deploy/templates/.github/workflows/ci.yml.hbs +29 -1
  19. package/modules/deploy/templates/.gitlab/ci/lint-blank-theme.yml.hbs +35 -0
  20. package/modules/deploy/templates/.gitlab/ci/lint-mu-plugin.yml.hbs +19 -0
  21. package/modules/deploy/templates/.gitlab/ci/lint-plugin.yml.hbs +19 -0
  22. package/modules/deploy/templates/.gitlab/ci/lint-sage.yml.hbs +47 -0
  23. package/modules/git/templates/workspace.json.hbs +1 -1
  24. package/modules/lint/.commitlintrc.json +21 -0
  25. package/modules/lint/.prettierignore +15 -25
  26. package/modules/lint/.prettierrc.json +5 -16
  27. package/modules/lint/index.js +75 -8
  28. package/modules/lint/prompts.js +1 -8
  29. package/modules/lint/templates/.lando.yml.hbs +3 -8
  30. package/modules/lint/templates/workspace.json.hbs +3 -3
  31. package/modules/mu-plugin/index.js +49 -0
  32. package/modules/mu-plugin/lint/.prettierrc.json +7 -0
  33. package/modules/mu-plugin/lint/eslint.config.mjs +30 -0
  34. package/modules/mu-plugin/lint/pint.json +11 -0
  35. package/modules/mu-plugin/prompts.js +29 -0
  36. package/modules/mu-plugin/templates/.lando.yml.hbs +15 -0
  37. package/modules/mu-plugin/templates/composer.json.hbs +14 -0
  38. package/modules/mu-plugin/templates/plugin.php.hbs +15 -0
  39. package/modules/php/templates/composer.json.hbs +15 -1
  40. package/modules/plugin/index.js +45 -0
  41. package/modules/plugin/lint/.prettierrc.json +7 -0
  42. package/modules/plugin/lint/eslint.config.mjs +30 -0
  43. package/modules/plugin/lint/pint.json +11 -0
  44. package/modules/plugin/prompts.js +29 -0
  45. package/modules/plugin/templates/.lando.yml.hbs +15 -0
  46. package/modules/plugin/templates/composer.json.hbs +14 -0
  47. package/modules/plugin/templates/plugin.php.hbs +15 -0
  48. package/modules/sage/index.js +25 -0
  49. package/modules/sage/lint/.prettierrc.json +12 -0
  50. package/modules/sage/lint/.stylelintrc.json +7 -0
  51. package/modules/sage/lint/eslint.config.mjs +30 -0
  52. package/modules/sage/lint/pint.json +11 -0
  53. package/modules/sage/prompts.js +21 -0
  54. package/modules/sage/templates/.lando.yml.hbs +13 -1
  55. package/modules/sage/templates/theme/vite.config.js.hbs +4 -4
  56. package/package.json +1 -1
  57. package/templates/.gitignore.hbs +84 -13
  58. package/templates/composer.json.hbs +60 -13
  59. package/templates/workspace.json.hbs +1 -1
  60. package/modules/lint/.eslintignore +0 -36
  61. package/modules/lint/.eslintrc.json +0 -8
  62. package/modules/lint/.stylelintignore +0 -19
  63. package/modules/lint/.stylelintrc.json +0 -9
  64. package/modules/lint/pint.json +0 -26
@@ -29,8 +29,20 @@ tooling:
29
29
  cmd: npm run build --prefix /app/content/themes/{{projectName}}
30
30
  theme-lint:
31
31
  service: build
32
- description: Lint the Sage theme
32
+ description: Lint the Sage theme (JS/TS/Vue)
33
33
  cmd: npm run lint --prefix /app/content/themes/{{projectName}}
34
+ {{#if enable_lint}}
35
+ pint:
36
+ service: appserver
37
+ description: Lint PHP in the Sage theme
38
+ dir: /app/content/themes/{{projectName}}
39
+ cmd: ./vendor/bin/pint
40
+ stylelint:
41
+ service: build
42
+ description: Lint CSS/SCSS in the Sage theme
43
+ cmd: npx stylelint --fix "resources/**/*.{css,scss}" --config /app/content/themes/{{projectName}}/.stylelintrc.json
44
+ dir: /app/content/themes/{{projectName}}
45
+ {{/if}}
34
46
  acorn:
35
47
  service: appserver
36
48
  description: Run Acorn artisan commands
@@ -1,8 +1,8 @@
1
- import fs from 'fs';
2
- import { defineConfig } from 'vite';
1
+ import { wordpressPlugin, wordpressThemeJson } from '@roots/vite-plugin';
3
2
  import tailwindcss from '@tailwindcss/vite';
3
+ import fs from 'fs';
4
4
  import laravel from 'laravel-vite-plugin';
5
- import { wordpressPlugin, wordpressThemeJson } from '@roots/vite-plugin';
5
+ import { defineConfig } from 'vite';
6
6
 
7
7
  export default defineConfig({
8
8
  base: '/app/content/themes/{{projectName}}/',
@@ -45,7 +45,7 @@ export default defineConfig({
45
45
  cert: fs.readFileSync('/certs/cert.crt'),
46
46
  },
47
47
  host: true,
48
- port: 3009,
48
+ port: 5173,
49
49
  strictPort: true,
50
50
  hmr: {
51
51
  host: 'localhost',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codigodoleo/wp-kit",
3
- "version": "3.2.0",
3
+ "version": "3.3.0",
4
4
  "description": "Kit opinativo para padronizar projetos WordPress com CI/CD dinâmico.",
5
5
  "main": "bin/index.js",
6
6
  "bin": {
@@ -1,13 +1,84 @@
1
- # WordPress wp/ content/uploads/* !content/uploads/.gitkeep content/upgrade/* content/backup-db/*
2
- content/backups/* content/blogs.dir/* content/cache/* content/advanced-cache.php
3
- content/wp-cache-config.php content/plugins/* !content/plugins/.gitkeep content/themes/*
4
- content/languages/* !content/languages/.gitkeep content/mu-plugins/* !content/mu-plugins/.gitkeep #
5
- Theme{{#if enable_sage}}
6
- !content/themes/{{projectName}}{{/if}}
7
-
8
- # Composer vendor/ composer.phar # Node.js
9
- node_modules/ npm-debug.log* yarn-debug.log* yarn-error.log* .npm .yarn-integrity # IDE/Editor *.swp
10
- *.swo *~ # OS .DS_Store .DS_Store? ._* .Spotlight-V100 .Trashes ehthumbs.db Thumbs.db # Logs *.log
11
- logs/ # Temporary files *.tmp *.temp .cache/ # Build artifacts dist/ build/ public/build/ # Database
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
1
+ # WordPress
2
+ wp/
3
+ content/uploads/*
4
+ !content/uploads/.gitkeep
5
+ content/upgrade/*
6
+ content/backup-db/*
7
+ content/backups/*
8
+ content/blogs.dir/*
9
+ content/cache/*
10
+ content/advanced-cache.php
11
+ content/wp-cache-config.php
12
+ content/plugins/*
13
+ !content/plugins/.gitkeep
14
+ content/themes/*
15
+ content/languages/*
16
+ !content/languages/.gitkeep
17
+ content/mu-plugins/*
18
+ !content/mu-plugins/.gitkeep
19
+
20
+ # Theme{{#if enable_sage}}
21
+ !content/themes/{{projectName}}{{/if}}
22
+
23
+
24
+ # Composer
25
+ vendor/
26
+ composer.phar
27
+
28
+ # Node.js
29
+ node_modules/
30
+ npm-debug.log*
31
+ yarn-debug.log*
32
+ yarn-error.log*
33
+ .npm
34
+ .yarn-integrity
35
+
36
+
37
+ # IDE/Editor
38
+ *.swp
39
+ *.swo
40
+ *~
41
+
42
+ # OS
43
+ .DS_Store
44
+ .DS_Store?
45
+ ._*
46
+ .Spotlight-V100
47
+ .Trashes
48
+ ehthumbs.db
49
+ Thumbs.db
50
+
51
+ # Logs
52
+ *.log
53
+ logs/
54
+
55
+ # Temporary files
56
+ *.tmp
57
+ *.temp
58
+ .cache/
59
+
60
+ # Build artifacts
61
+ dist/
62
+ build/
63
+ public/build/
64
+
65
+ # Database
66
+ *.sql
67
+ *.sqlite
68
+
69
+ # Backup files
70
+ *.bak
71
+ *.backup
72
+ *.old
73
+
74
+ # Lando
75
+ .lando.local.yml
76
+
77
+ # PHP
78
+ *.php~
79
+ *.php.bak
80
+ php_errors.log
81
+
82
+ # Testing
83
+ coverage/
84
+ .phpunit.result.cache
@@ -1,13 +1,60 @@
1
- { "name": "{{projectName}}/wordpress", "type": "project", "description": "{{projectDescription}}",
2
- "authors": [ { "name": "{{author}}", "email": "{{authorEmail}}" } ], "repositories": { "wpackagist":
3
- { "type": "composer", "url": "https://wpackagist.org" } }, "license": "MIT", "require": { "php": ">={{phpVersion}}",
4
- "roots/wordpress": "{{wpCoreVersion}}", "roots/bedrock-autoloader": "^1.0",
5
- "inpsyde/wp-translation-downloader": "^2.5",
6
- "vlucas/phpdotenv": "^5.5" }, "config": { "allow-plugins": { "roots/wordpress-core-installer": true,
7
- "inpsyde/wp-translation-downloader": true, "composer/installers": true } }, "extra": {
8
- "wordpress-install-dir": "wp", "installer-paths": { "content/plugins/{$name}/": [
9
- "type:wordpress-plugin" ], "content/themes/{$name}/": [ "type:wordpress-theme" ],
10
- "content/mu-plugins/{$name}/": [ "type:wordpress-muplugin" ] }, "wp-translation-downloader": {
11
- "languages": [ "pt_BR", "en_US" ], "languageRootDir": "content/languages",
12
- "virtual-packages": [ { "name": "wordpress/wordpress", "type": "wordpress-core", "version": "{{wpCoreVersion}}"
13
- } ] } } }
1
+ {
2
+ "name": "{{projectName}}/wordpress",
3
+ "type": "project",
4
+ "description": "{{projectDescription}}",
5
+ "authors": [
6
+ {
7
+ "name": "{{author}}",
8
+ "email": "{{authorEmail}}"
9
+ }
10
+ ],
11
+ "repositories": {
12
+ "wpackagist": {
13
+ "type": "composer",
14
+ "url": "https://wpackagist.org"
15
+ }
16
+ },
17
+ "license": "MIT",
18
+ "require": {
19
+ "php": ">={{phpVersion}}",
20
+ "roots/wordpress": "{{wpCoreVersion}}",
21
+ "roots/bedrock-autoloader": "^1.0",
22
+ "inpsyde/wp-translation-downloader": "^2.5",
23
+ "vlucas/phpdotenv": "^5.5"
24
+ },
25
+ "config": {
26
+ "allow-plugins": {
27
+ "roots/wordpress-core-installer": true,
28
+ "inpsyde/wp-translation-downloader": true,
29
+ "composer/installers": true
30
+ }
31
+ },
32
+ "extra": {
33
+ "wordpress-install-dir": "wp",
34
+ "installer-paths": {
35
+ "content/plugins/{$name}/": [
36
+ "type:wordpress-plugin"
37
+ ],
38
+ "content/themes/{$name}/": [
39
+ "type:wordpress-theme"
40
+ ],
41
+ "content/mu-plugins/{$name}/": [
42
+ "type:wordpress-muplugin"
43
+ ]
44
+ },
45
+ "wp-translation-downloader": {
46
+ "languages": [
47
+ "pt_BR",
48
+ "en_US"
49
+ ],
50
+ "languageRootDir": "content/languages",
51
+ "virtual-packages": [
52
+ {
53
+ "name": "wordpress/wordpress",
54
+ "type": "wordpress-core",
55
+ "version": "{{wpCoreVersion}}"
56
+ }
57
+ ]
58
+ }
59
+ }
60
+ }
@@ -6,7 +6,7 @@
6
6
  }
7
7
  ],
8
8
  "settings": {
9
- "git.inputValidation": "always",
9
+ "git.inputValidation": true,
10
10
  "git.inputValidationLength": 100,
11
11
  "git.inputValidationSubjectLength": 100,
12
12
  "git.confirmSync": false,
@@ -1,36 +0,0 @@
1
- # Node and vendor
2
- node_modules/
3
- vendor/
4
- dist/
5
- build/
6
-
7
- # Tests
8
- __tests__/
9
- __test__/
10
- *.test.js
11
- *.spec.js
12
-
13
- # IDE and system
14
- .vscode/
15
- .idea/
16
- .history/
17
- .cursor/
18
-
19
- # WordPress and uploads
20
- wp/
21
- wp-content/uploads/
22
- wp-content/upgrade/
23
- wp-content/cache/
24
- wp-content/ai1wm-backups/
25
-
26
- # Misc
27
- *.min.js
28
- *.min.css
29
- *.log
30
- .cache/
31
- .next/
32
- out/
33
- coverage/
34
- .nyc_output/
35
- .env
36
- .env.*
@@ -1,8 +0,0 @@
1
- {
2
- "extends": ["eslint:recommended", "plugin:prettier/recommended"],
3
- "env": {
4
- "browser": true,
5
- "node": true,
6
- "es2021": true
7
- }
8
- }
@@ -1,19 +0,0 @@
1
- # Node and vendor
2
- node_modules/
3
- vendor/
4
- dist/
5
- build/
6
-
7
- # CSS / SCSS minified
8
- **/*.min.css
9
- **/*.min.scss
10
- **/vendor/**/*.css
11
-
12
- # WordPress and uploads
13
- wp/
14
- content/**/*
15
-
16
- # Misc
17
- out/
18
- coverage/
19
- **/.*
@@ -1,9 +0,0 @@
1
- {
2
- "extends": ["stylelint-config-standard"],
3
- "rules": {
4
- "indentation": 2,
5
- "number-leading-zero": "always",
6
- "string-quotes": "double",
7
- "color-hex-case": "lower"
8
- }
9
- }
@@ -1,26 +0,0 @@
1
- {
2
- "preset": "psr12",
3
- "rules": {
4
- "array_syntax": {
5
- "syntax": "short"
6
- },
7
- "binary_operator_spaces": {
8
- "default": "single_space"
9
- }
10
- },
11
- "exclude": [
12
- "wp",
13
- "content",
14
- "vendor",
15
- "node_modules",
16
- ".git",
17
- "storage",
18
- "bootstrap/cache",
19
- "public/build",
20
- "public/hot",
21
- "public/storage",
22
- "public/vendor",
23
- "tests/coverage",
24
- "tests/reports"
25
- ]
26
- }