@airfleet/generator-init 0.30.0 → 0.32.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 (100) hide show
  1. package/generators/plugin/templates/.github/workflows/release-plugin.yml +6 -3
  2. package/generators/plugin/templates/.github/workflows/test-wordpress.yml +0 -2
  3. package/generators/plugin/templates/composer-scoped.json.ejs +1 -1
  4. package/generators/plugin/templates/composer-scoped.lock.ejs +122 -122
  5. package/generators/plugin/templates/gitignore +1 -0
  6. package/generators/plugin/templates/package.json.ejs +1 -1
  7. package/generators/project/templates/.deployignore +4 -0
  8. package/generators/project/templates/.github/workflows/test-wordpress-root-lightyear.yml +0 -2
  9. package/generators/project-plugin/index.js +230 -0
  10. package/generators/project-plugin/templates/.airfleet-release +1 -0
  11. package/generators/project-plugin/templates/.deployignore +54 -0
  12. package/generators/project-plugin/templates/.editorconfig +18 -0
  13. package/generators/project-plugin/templates/.env +0 -0
  14. package/generators/project-plugin/templates/.gitattributes +12 -0
  15. package/generators/project-plugin/templates/.github/workflows/create-asana-attachment.yaml +19 -0
  16. package/generators/project-plugin/templates/.github/workflows/test-wordpress.yml +44 -0
  17. package/generators/project-plugin/templates/.husky/gitignore +1 -0
  18. package/generators/project-plugin/templates/.husky/pre-commit +4 -0
  19. package/generators/project-plugin/templates/.parcelrc +4 -0
  20. package/generators/project-plugin/templates/.prettierignore +15 -0
  21. package/generators/project-plugin/templates/.vscode/airfleet.code-snippets.ejs +186 -0
  22. package/generators/project-plugin/templates/.vscode/settings.json +33 -0
  23. package/generators/project-plugin/templates/CHANGELOG.md +10 -0
  24. package/generators/project-plugin/templates/LICENSE.ejs +2 -0
  25. package/generators/project-plugin/templates/README.md.ejs +16 -0
  26. package/generators/project-plugin/templates/acf-json/.gitkeep +0 -0
  27. package/generators/project-plugin/templates/acf-json/field-groups/.gitkeep +0 -0
  28. package/generators/project-plugin/templates/acf-json/option-pages/.gitkeep +0 -0
  29. package/generators/project-plugin/templates/acf-json/option-pages/airfleet-site-settings.json +22 -0
  30. package/generators/project-plugin/templates/acf-json/post-types/.gitkeep +0 -0
  31. package/generators/project-plugin/templates/acf-json/taxonomies/.gitkeep +0 -0
  32. package/generators/project-plugin/templates/assets/admin/styles/admin.entry.scss +2 -0
  33. package/generators/project-plugin/templates/assets/editor/styles/editor.entry.scss +23 -0
  34. package/generators/project-plugin/templates/assets/frontend/fonts/.gitkeep +0 -0
  35. package/generators/project-plugin/templates/assets/frontend/images/.gitkeep +0 -0
  36. package/generators/project-plugin/templates/assets/frontend/scripts/index.entry.js +3 -0
  37. package/generators/project-plugin/templates/assets/frontend/styles/_main.scss +3 -0
  38. package/generators/project-plugin/templates/assets/frontend/styles/_placeholders.scss +3 -0
  39. package/generators/project-plugin/templates/assets/frontend/styles/_root.scss +4 -0
  40. package/generators/project-plugin/templates/assets/frontend/styles/critical.entry.scss +1 -0
  41. package/generators/project-plugin/templates/assets/frontend/styles/index.entry.scss +6 -0
  42. package/generators/project-plugin/templates/assets/frontend/styles/main/_body.scss +6 -0
  43. package/generators/project-plugin/templates/assets/frontend/styles/main/_reset.scss +121 -0
  44. package/generators/project-plugin/templates/assets/frontend/styles/placeholders/_button.scss +43 -0
  45. package/generators/project-plugin/templates/assets/frontend/styles/placeholders/_container.scss +12 -0
  46. package/generators/project-plugin/templates/assets/frontend/styles/placeholders/_sections.scss +6 -0
  47. package/generators/project-plugin/templates/assets/frontend/styles/root/_fonts.scss +21 -0
  48. package/generators/project-plugin/templates/assets/login/.gitkeep +0 -0
  49. package/generators/project-plugin/templates/assets/shared/styles/_figma-variables.scss +7 -0
  50. package/generators/project-plugin/templates/assets/shared/styles/_lib.scss +4 -0
  51. package/generators/project-plugin/templates/assets/shared/styles/_root.scss +6 -0
  52. package/generators/project-plugin/templates/assets/shared/styles/_shared.scss +1 -0
  53. package/generators/project-plugin/templates/assets/shared/styles/lib/_mixins.scss +6 -0
  54. package/generators/project-plugin/templates/assets/shared/styles/lib/_scss-variables.scss +2 -0
  55. package/generators/project-plugin/templates/assets/shared/styles/lib/mixins/_background.scss +11 -0
  56. package/generators/project-plugin/templates/assets/shared/styles/lib/mixins/_body.scss +4 -0
  57. package/generators/project-plugin/templates/assets/shared/styles/lib/mixins/_breakpoints.scss +79 -0
  58. package/generators/project-plugin/templates/assets/shared/styles/lib/mixins/_helpers.scss +35 -0
  59. package/generators/project-plugin/templates/assets/shared/styles/lib/mixins/_list-inline.scss +23 -0
  60. package/generators/project-plugin/templates/assets/shared/styles/lib/mixins/_position.scss +24 -0
  61. package/generators/project-plugin/templates/composer-scoped.json.ejs +8 -0
  62. package/generators/project-plugin/templates/composer-scoped.lock.ejs +124 -0
  63. package/generators/project-plugin/templates/composer.json.ejs +52 -0
  64. package/generators/project-plugin/templates/figma/design-tokens/.gitkeep +0 -0
  65. package/generators/project-plugin/templates/figma/design-tokens/manifest.json +5 -0
  66. package/generators/project-plugin/templates/gitignore +15 -0
  67. package/generators/project-plugin/templates/inc/Features/Menus.php.ejs +22 -0
  68. package/generators/project-plugin/templates/inc/Setup/AjaxVariables.php.ejs +22 -0
  69. package/generators/project-plugin/templates/inc/Setup/AjaxVariablesAdmin.php.ejs +22 -0
  70. package/generators/project-plugin/templates/inc/Setup/Breakpoints.php.ejs +18 -0
  71. package/generators/project-plugin/templates/inc/Setup/Colors.php.ejs +17 -0
  72. package/generators/project-plugin/templates/inc/Setup/RegisterViews.php.ejs +64 -0
  73. package/generators/project-plugin/templates/inc/Setup.php.ejs +30 -0
  74. package/generators/project-plugin/templates/index.php +1 -0
  75. package/generators/project-plugin/templates/package.json.ejs +85 -0
  76. package/generators/project-plugin/templates/phpcs.xml.ejs +23 -0
  77. package/generators/project-plugin/templates/plugin-name.php.ejs +65 -0
  78. package/generators/project-plugin/templates/scoper.custom.php.ejs +8 -0
  79. package/generators/project-plugin/templates/views/blocks/.gitkeep +0 -0
  80. package/generators/project-plugin/templates/views/components/.gitkeep +0 -0
  81. package/generators/project-plugin/templates/views/custom-templates/.gitkeep +0 -0
  82. package/generators/project-plugin/templates/views/parcelkeep.entry.scss +0 -0
  83. package/generators/project-plugin/templates/views/partials/footer/footer.blade.php.ejs +4 -0
  84. package/generators/project-plugin/templates/views/partials/footer/footer.php.ejs +4 -0
  85. package/generators/project-plugin/templates/views/partials/header/header.blade.php.ejs +12 -0
  86. package/generators/project-plugin/templates/views/partials/header/header.php.ejs +12 -0
  87. package/generators/project-plugin/templates/views/partials/layout/layout.blade.php.ejs +3 -0
  88. package/generators/project-plugin/templates/views/partials/layout/layout.php.ejs +5 -0
  89. package/generators/project-plugin/templates/views/templates/index/index.blade.php.ejs +30 -0
  90. package/generators/project-plugin/templates/views/templates/index/index.php.ejs +32 -0
  91. package/generators/project-plugin/templates/views/templates/not-found/not-found.blade.php.ejs +3 -0
  92. package/generators/project-plugin/templates/views/templates/not-found/not-found.php.ejs +5 -0
  93. package/generators/project-plugin/templates/views/templates/page/page.blade.php.ejs +10 -0
  94. package/generators/project-plugin/templates/views/templates/page/page.php.ejs +12 -0
  95. package/generators/project-plugin/templates/views/templates/single/single.blade.php.ejs +28 -0
  96. package/generators/project-plugin/templates/views/templates/single/single.php.ejs +30 -0
  97. package/generators/project-plugin/templates/views-elements/.gitkeep +0 -0
  98. package/generators/project-plugin/templates/views-elements/partials/button/ButtonSetup.php.ejs +32 -0
  99. package/generators/project-plugin/templates/views-elements/partials/button/button.entry.scss +13 -0
  100. package/package.json +1 -1
@@ -12,6 +12,8 @@ jobs:
12
12
  steps:
13
13
  - name: 🚚 Get latest code
14
14
  uses: actions/checkout@v3
15
+ with:
16
+ token: ${{ secrets.CI_WRITE_TOKEN }}
15
17
 
16
18
  - name: ⚙️ Setup PHP
17
19
  uses: shivammathur/setup-php@v2
@@ -19,7 +21,7 @@ jobs:
19
21
  php-version: "8.2"
20
22
  ini-values: short_open_tag=1
21
23
  env:
22
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24
+ GITHUB_TOKEN: ${{ secrets.CI_WRITE_TOKEN }}
23
25
 
24
26
  - name: ⚙️ Setup Node
25
27
  uses: actions/setup-node@v3
@@ -95,6 +97,7 @@ jobs:
95
97
  --hooks.before:release='cp -R $RUNNER_TEMP/.release-dist dist/.release-dist'
96
98
  --git.pushArgs='--follow-tags'
97
99
  --git.pushArgs='-o ci.skip'
100
+ --git.commitMessage='Release ${version} [skip ci]'
98
101
  --no-npm.publish
99
102
  --github.release
100
103
  --github.assets='dist/.release-dist/**/*'
@@ -106,7 +109,7 @@ jobs:
106
109
  --plugins.@release-it/bumper.out.file=*.php
107
110
  --plugins.@release-it/bumper.out.type=text/php
108
111
  env:
109
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
112
+ GITHUB_TOKEN: ${{ secrets.CI_WRITE_TOKEN }}
110
113
 
111
114
  - name: ⚒️ Build plugin.json
112
115
  run: |
@@ -190,4 +193,4 @@ jobs:
190
193
  - name: 🚀 Upload updated plugins list to AWS
191
194
  run: |
192
195
  BUCKET="${{ secrets.AWS_S3_BUCKET }}"
193
- aws s3 cp $RUNNER_TEMP/plugins_updated.json s3://$BUCKET/plugins.json
196
+ aws s3 cp $RUNNER_TEMP/plugins_updated.json s3://$BUCKET/plugins.json
@@ -20,8 +20,6 @@ jobs:
20
20
  with:
21
21
  php-version: "8.2"
22
22
  ini-values: short_open_tag=1
23
- env:
24
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25
23
 
26
24
  - name: ⚙️ Setup Node
27
25
  uses: actions/setup-node@v3
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "require": {
3
- "airfleet/wordpress-framework": "^1.3.0"
3
+ "airfleet/wordpress-framework": "^1.5.0"
4
4
  },
5
5
  "config": {
6
6
  "autoloader-suffix": "<%= name.pascal %>"
@@ -1,124 +1,124 @@
1
1
  {
2
- "_readme": [
3
- "This file locks the dependencies of your project to a known state",
4
- "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
5
- "This file is @generated automatically"
6
- ],
7
- "content-hash": "0bc133803c8119982f80c3cdd959905e",
8
- "packages": [
9
- {
10
- "name": "airfleet/wordpress-framework",
11
- "version": "1.3.0",
12
- "source": {
13
- "type": "git",
14
- "url": "https://github.com/airfleet/airfleet-wordpress-framework-php.git",
15
- "reference": "4b50080dea677541b5df35dc17812b8cc93f5f9c"
16
- },
17
- "dist": {
18
- "type": "zip",
19
- "url": "https://api.github.com/repos/airfleet/airfleet-wordpress-framework-php/zipball/4b50080dea677541b5df35dc17812b8cc93f5f9c",
20
- "reference": "4b50080dea677541b5df35dc17812b8cc93f5f9c",
21
- "shasum": ""
22
- },
23
- "require": {
24
- "jawira/case-converter": "^3.5",
25
- "php": ">=8.0"
26
- },
27
- "type": "library",
28
- "autoload": {
29
- "psr-4": {
30
- "Airfleet\\Framework\\": "inc/"
31
- }
32
- },
33
- "notification-url": "https://packagist.org/downloads/",
34
- "authors": [
35
- {
36
- "name": "Airfleet",
37
- "email": "dev@airfleet.co"
38
- }
39
- ],
40
- "description": "Airfleet framework for WordPress",
41
- "support": {
42
- "issues": "https://github.com/airfleet/airfleet-wordpress-framework-php/issues",
43
- "source": "https://github.com/airfleet/airfleet-wordpress-framework-php/tree/1.3.0"
44
- },
45
- "time": "2024-04-18T11:18:51+00:00"
46
- },
47
- {
48
- "name": "jawira/case-converter",
49
- "version": "v3.5.1",
50
- "source": {
51
- "type": "git",
52
- "url": "https://github.com/jawira/case-converter.git",
53
- "reference": "2be05b98dcb743bef60ab6f849145bd3434ed003"
54
- },
55
- "dist": {
56
- "type": "zip",
57
- "url": "https://api.github.com/repos/jawira/case-converter/zipball/2be05b98dcb743bef60ab6f849145bd3434ed003",
58
- "reference": "2be05b98dcb743bef60ab6f849145bd3434ed003",
59
- "shasum": ""
60
- },
61
- "require": {
62
- "ext-mbstring": "*",
63
- "php": ">=7.4"
64
- },
65
- "require-dev": {
66
- "behat/behat": "^3.0",
67
- "phpstan/phpstan": "^1.0",
68
- "phpunit/phpunit": "^9.0",
69
- "vimeo/psalm": "^4.0"
70
- },
71
- "suggest": {
72
- "pds/skeleton": "PHP Package Development Standards",
73
- "phing/phing": "PHP Build Tool"
74
- },
75
- "type": "library",
76
- "autoload": {
77
- "psr-4": {
78
- "Jawira\\CaseConverter\\": "src/"
79
- }
80
- },
81
- "notification-url": "https://packagist.org/downloads/",
82
- "license": [
83
- "MIT"
84
- ],
85
- "authors": [
86
- {
87
- "name": "Jawira Portugal",
88
- "email": "dev@tugal.be"
89
- }
90
- ],
91
- "description": "Convert strings between 13 naming conventions: Snake case, Camel case, Pascal case, Kebab case, Ada case, Train case, Cobol case, Macro case, Upper case, Lower case, Sentence case, Title case and Dot notation.",
92
- "homepage": "https://jawira.github.io/case-converter/",
93
- "keywords": [
94
- "Ada case",
95
- "Cobol case",
96
- "Macro case",
97
- "Train case",
98
- "camel case",
99
- "dot notation",
100
- "kebab case",
101
- "lower case",
102
- "pascal case",
103
- "sentence case",
104
- "snake case",
105
- "title case",
106
- "upper case"
107
- ],
108
- "support": {
109
- "issues": "https://github.com/jawira/case-converter/issues",
110
- "source": "https://github.com/jawira/case-converter/tree/v3.5.1"
111
- },
112
- "time": "2022-08-14T11:40:18+00:00"
113
- }
114
- ],
115
- "packages-dev": [],
116
- "aliases": [],
117
- "minimum-stability": "stable",
118
- "stability-flags": [],
119
- "prefer-stable": false,
120
- "prefer-lowest": false,
121
- "platform": [],
122
- "platform-dev": [],
123
- "plugin-api-version": "2.6.0"
2
+ "_readme": [
3
+ "This file locks the dependencies of your project to a known state",
4
+ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
5
+ "This file is @generated automatically"
6
+ ],
7
+ "content-hash": "9c5f20589b695e0465c3e3f17445638a",
8
+ "packages": [
9
+ {
10
+ "name": "airfleet/wordpress-framework",
11
+ "version": "1.5.0",
12
+ "source": {
13
+ "type": "git",
14
+ "url": "https://github.com/airfleet/airfleet-wordpress-framework-php.git",
15
+ "reference": "5847995d05980b5215458b8cacd74d223a5e0d8b"
16
+ },
17
+ "dist": {
18
+ "type": "zip",
19
+ "url": "https://api.github.com/repos/airfleet/airfleet-wordpress-framework-php/zipball/5847995d05980b5215458b8cacd74d223a5e0d8b",
20
+ "reference": "5847995d05980b5215458b8cacd74d223a5e0d8b",
21
+ "shasum": ""
22
+ },
23
+ "require": {
24
+ "jawira/case-converter": "^3.5",
25
+ "php": ">=8.0"
26
+ },
27
+ "type": "library",
28
+ "autoload": {
29
+ "psr-4": {
30
+ "Airfleet\\Framework\\": "inc/"
31
+ }
32
+ },
33
+ "notification-url": "https://packagist.org/downloads/",
34
+ "authors": [
35
+ {
36
+ "name": "Airfleet",
37
+ "email": "dev@airfleet.co"
38
+ }
39
+ ],
40
+ "description": "Airfleet framework for WordPress",
41
+ "support": {
42
+ "issues": "https://github.com/airfleet/airfleet-wordpress-framework-php/issues",
43
+ "source": "https://github.com/airfleet/airfleet-wordpress-framework-php/tree/1.5.0"
44
+ },
45
+ "time": "2024-05-28T17:03:25+00:00"
46
+ },
47
+ {
48
+ "name": "jawira/case-converter",
49
+ "version": "v3.5.1",
50
+ "source": {
51
+ "type": "git",
52
+ "url": "https://github.com/jawira/case-converter.git",
53
+ "reference": "2be05b98dcb743bef60ab6f849145bd3434ed003"
54
+ },
55
+ "dist": {
56
+ "type": "zip",
57
+ "url": "https://api.github.com/repos/jawira/case-converter/zipball/2be05b98dcb743bef60ab6f849145bd3434ed003",
58
+ "reference": "2be05b98dcb743bef60ab6f849145bd3434ed003",
59
+ "shasum": ""
60
+ },
61
+ "require": {
62
+ "ext-mbstring": "*",
63
+ "php": ">=7.4"
64
+ },
65
+ "require-dev": {
66
+ "behat/behat": "^3.0",
67
+ "phpstan/phpstan": "^1.0",
68
+ "phpunit/phpunit": "^9.0",
69
+ "vimeo/psalm": "^4.0"
70
+ },
71
+ "suggest": {
72
+ "pds/skeleton": "PHP Package Development Standards",
73
+ "phing/phing": "PHP Build Tool"
74
+ },
75
+ "type": "library",
76
+ "autoload": {
77
+ "psr-4": {
78
+ "Jawira\\CaseConverter\\": "src/"
79
+ }
80
+ },
81
+ "notification-url": "https://packagist.org/downloads/",
82
+ "license": [
83
+ "MIT"
84
+ ],
85
+ "authors": [
86
+ {
87
+ "name": "Jawira Portugal",
88
+ "email": "dev@tugal.be"
89
+ }
90
+ ],
91
+ "description": "Convert strings between 13 naming conventions: Snake case, Camel case, Pascal case, Kebab case, Ada case, Train case, Cobol case, Macro case, Upper case, Lower case, Sentence case, Title case and Dot notation.",
92
+ "homepage": "https://jawira.github.io/case-converter/",
93
+ "keywords": [
94
+ "Ada case",
95
+ "Cobol case",
96
+ "Macro case",
97
+ "Train case",
98
+ "camel case",
99
+ "dot notation",
100
+ "kebab case",
101
+ "lower case",
102
+ "pascal case",
103
+ "sentence case",
104
+ "snake case",
105
+ "title case",
106
+ "upper case"
107
+ ],
108
+ "support": {
109
+ "issues": "https://github.com/jawira/case-converter/issues",
110
+ "source": "https://github.com/jawira/case-converter/tree/v3.5.1"
111
+ },
112
+ "time": "2022-08-14T11:40:18+00:00"
113
+ }
114
+ ],
115
+ "packages-dev": [],
116
+ "aliases": [],
117
+ "minimum-stability": "stable",
118
+ "stability-flags": [],
119
+ "prefer-stable": false,
120
+ "prefer-lowest": false,
121
+ "platform": [],
122
+ "platform-dev": [],
123
+ "plugin-api-version": "2.6.0"
124
124
  }
@@ -12,3 +12,4 @@ dist
12
12
  vendor-scoped
13
13
  wp-content
14
14
  .DS_Store
15
+ .idea
@@ -42,7 +42,7 @@
42
42
  },
43
43
  "dependencies": {},
44
44
  "devDependencies": {
45
- "@airfleet/wordpress-dev": "^3.1.0"
45
+ "@airfleet/wordpress-dev": "^3.2.0"
46
46
  },
47
47
  "browserslist": [
48
48
  "defaults",
@@ -12,11 +12,14 @@
12
12
  **/.airfleet-release
13
13
  **/.deployignore
14
14
  **/.editorconfig
15
+ .editorconfig
15
16
  **/.env
16
17
  **/.eslintcache
17
18
  **/.eslintrc.js
18
19
  **/.gitattributes
20
+ .gitattributes
19
21
  **/.gitignore
22
+ .gitignore
20
23
  **/.gitkeep
21
24
  **/.gitlab-ci.yml
22
25
  **/.parcelrc
@@ -39,4 +42,5 @@
39
42
  **/phpcs.xml
40
43
  **/README
41
44
  **/README.md
45
+ README.md
42
46
  **/yarn.lock
@@ -24,8 +24,6 @@ jobs:
24
24
  with:
25
25
  php-version: "8.2"
26
26
  ini-values: short_open_tag=1
27
- env:
28
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29
27
 
30
28
  - name: ⚙️ Setup Node
31
29
  uses: actions/setup-node@v3
@@ -0,0 +1,230 @@
1
+ "use strict";
2
+ import Generator from "yeoman-generator";
3
+ import { paramCase } from "change-case";
4
+
5
+ import nameCases from "../../utils/nameCases.js";
6
+ import copyTemplates from "../../utils/copyTemplates.js";
7
+ import mapFilesToTemplates from "../../utils/mapFilesToTemplates.js";
8
+ import requiredText from "../../utils/validation/requiredText.js";
9
+ import title from "../../utils/log/title.js";
10
+ import highlightText from "../../utils/log/text/highlightText.js";
11
+ import lines from "../../utils/log/text/lines.js";
12
+ import infoBox from "../../utils/log/boxes/infoBox.js";
13
+ import objectPropertyFromValue from '../../utils/objectPropertyFromValue.js';
14
+
15
+ export default class extends Generator {
16
+ async prompting() {
17
+ this.log(
18
+ lines([
19
+ title(`Let's generate a ${highlightText("WordPress client plugin")}!`),
20
+ infoBox(
21
+ lines([
22
+ "This will create the files for a WP plugin.",
23
+ "",
24
+ "Before starting you should have:",
25
+ " - Created a repository",
26
+ "",
27
+ "All the files will be created in the current",
28
+ "folder. Make sure to navigate to repo folder",
29
+ "first.",
30
+ ])
31
+ ),
32
+ "",
33
+ ])
34
+ );
35
+
36
+ const prompts = [
37
+ {
38
+ type: "input",
39
+ name: "pluginName",
40
+ message: 'What is the name of the plugin? (e.g. "Airfleet Cyberproof")',
41
+ validate: requiredText("Please enter a name"),
42
+ },
43
+ {
44
+ type: "input",
45
+ name: "pluginDescription",
46
+ message: "How would you describe the plugin?",
47
+ validate: requiredText("Please enter a description"),
48
+ },
49
+ {
50
+ type: "input",
51
+ name: "pluginRepository",
52
+ message:
53
+ "What's the repository URL? (start with https and end with .git)",
54
+ validate: requiredText("Please enter the repository URL"),
55
+ },
56
+ {
57
+ type: "input",
58
+ name: "pluginPhpVersion",
59
+ message: "What's the required PHP version?",
60
+ validate: requiredText("Please enter the PHP version"),
61
+ default: ">=8.2",
62
+ },
63
+ {
64
+ type: "input",
65
+ name: "pluginNodeVersion",
66
+ message: "What's the required Node version?",
67
+ validate: requiredText("Please enter the Node version"),
68
+ default: ">=16",
69
+ },
70
+ {
71
+ type: "confirm",
72
+ name: "pluginUseBlade",
73
+ message: "Use Blade?",
74
+ default: false,
75
+ },
76
+ ];
77
+
78
+ this.answers = await this.prompt(prompts);
79
+ this.name = nameCases(this.answers.pluginName);
80
+
81
+ const nameNoAirfleet = this.answers.pluginName
82
+ .replace(/^airfleet/i, "")
83
+ .trim();
84
+ this.nameNoAirfleet = nameCases(nameNoAirfleet);
85
+ this.data = {
86
+ answers: this.answers,
87
+ name: this.name,
88
+ nameNoAirfleet: this.nameNoAirfleet,
89
+ repositoryBase: this.answers.pluginRepository.replace(/\.git$/, ""),
90
+ packageName: `@airfleet/${this.nameNoAirfleet.slug}-wp-plugin`,
91
+ mainBranch: "main",
92
+ year: new Date().getFullYear(),
93
+ phpVersion: this._getPhpVersion(this.answers.pluginPhpVersion),
94
+ };
95
+ }
96
+
97
+ writing() {
98
+ const templateExtension = this.answers.pluginUseBlade ? 'blade.php' : 'php';
99
+
100
+ const files = [
101
+ ".github/workflows/create-asana-attachment.yaml",
102
+ ".github/workflows/test-wordpress.yml",
103
+ ".husky/pre-commit",
104
+ ".vscode/settings.json",
105
+ "acf-json/.gitkeep",
106
+ "acf-json/field-groups/.gitkeep",
107
+ "acf-json/option-pages/.gitkeep",
108
+ "acf-json/option-pages/airfleet-site-settings.json",
109
+ "acf-json/post-types/.gitkeep",
110
+ "acf-json/taxonomies/.gitkeep",
111
+ "assets/admin/styles/admin.entry.scss",
112
+ "assets/editor/styles/editor.entry.scss",
113
+ "assets/frontend/fonts/.gitkeep",
114
+ "assets/frontend/images/.gitkeep",
115
+ "assets/frontend/scripts/index.entry.js",
116
+ "assets/frontend/styles/main/_body.scss",
117
+ "assets/frontend/styles/main/_reset.scss",
118
+ "assets/frontend/styles/placeholders/_button.scss",
119
+ "assets/frontend/styles/placeholders/_container.scss",
120
+ "assets/frontend/styles/placeholders/_sections.scss",
121
+ "assets/frontend/styles/root/_fonts.scss",
122
+ "assets/frontend/styles/_main.scss",
123
+ "assets/frontend/styles/_placeholders.scss",
124
+ "assets/frontend/styles/_root.scss",
125
+ "assets/frontend/styles/critical.entry.scss",
126
+ "assets/frontend/styles/index.entry.scss",
127
+ "assets/login/.gitkeep",
128
+ "assets/shared/styles/lib/mixins/_background.scss",
129
+ "assets/shared/styles/lib/mixins/_body.scss",
130
+ "assets/shared/styles/lib/mixins/_breakpoints.scss",
131
+ "assets/shared/styles/lib/mixins/_helpers.scss",
132
+ "assets/shared/styles/lib/mixins/_list-inline.scss",
133
+ "assets/shared/styles/lib/mixins/_position.scss",
134
+ "assets/shared/styles/lib/_mixins.scss",
135
+ "assets/shared/styles/lib/_scss-variables.scss",
136
+ "assets/shared/styles/_figma-variables.scss",
137
+ "assets/shared/styles/_lib.scss",
138
+ "assets/shared/styles/_root.scss",
139
+ "assets/shared/styles/_shared.scss",
140
+ "figma/design-tokens/.gitkeep",
141
+ "figma/design-tokens/manifest.json",
142
+ "inc/Features/Menus.php.ejs",
143
+ "inc/Setup/AjaxVariables.php.ejs",
144
+ "inc/Setup/AjaxVariablesAdmin.php.ejs",
145
+ "inc/Setup/Breakpoints.php.ejs",
146
+ "inc/Setup/Colors.php.ejs",
147
+ "inc/Setup/RegisterViews.php.ejs",
148
+ "inc/Setup.php.ejs",
149
+ "views/blocks/.gitkeep",
150
+ "views/components/.gitkeep",
151
+ "views/custom-templates/.gitkeep",
152
+ `views/partials/footer/footer.${templateExtension}.ejs`,
153
+ `views/partials/header/header.${templateExtension}.ejs`,
154
+ `views/partials/layout/layout.${templateExtension}.ejs`,
155
+ `views/templates/index/index.${templateExtension}.ejs`,
156
+ `views/templates/not-found/not-found.${templateExtension}.ejs`,
157
+ `views/templates/page/page.${templateExtension}.ejs`,
158
+ `views/templates/single/single.${templateExtension}.ejs`,
159
+ "views/parcelkeep.entry.scss",
160
+ "views-elements/partials/button/button.entry.scss",
161
+ "views-elements/partials/button/ButtonSetup.php.ejs",
162
+ "views-elements/.gitkeep",
163
+ ".airfleet-release",
164
+ ".editorconfig",
165
+ ".env",
166
+ ".gitattributes",
167
+ ".parcelrc",
168
+ ".prettierignore",
169
+ "CHANGELOG.md",
170
+ "composer.json.ejs",
171
+ "composer-scoped.json.ejs",
172
+ "index.php",
173
+ "LICENSE.ejs",
174
+ "package.json.ejs",
175
+ "phpcs.xml.ejs",
176
+ "README.md.ejs",
177
+ "scoper.custom.php.ejs",
178
+ ".deployignore",
179
+ ];
180
+ const templates = [
181
+ ...mapFilesToTemplates(files),
182
+ {
183
+ template: "gitignore",
184
+ destination: `.gitignore`,
185
+ isEnabled: true,
186
+ },
187
+ {
188
+ template: ".husky/gitignore",
189
+ destination: `.husky/.gitignore`,
190
+ isEnabled: true,
191
+ },
192
+ {
193
+ template: "plugin-name.php.ejs",
194
+ destination: `${this.name.slug}.php`,
195
+ isEnabled: true,
196
+ },
197
+ {
198
+ template: "acf-json/.gitkeep",
199
+ destination: `acf-json/.gitkeep`,
200
+ isEnabled: true,
201
+ },
202
+ {
203
+ template: ".vscode/airfleet.code-snippets.ejs",
204
+ destination: ".vscode/airfleet.code-snippets",
205
+ isEnabled: true,
206
+ },
207
+ ];
208
+
209
+ copyTemplates(this, templates, this.data);
210
+ }
211
+
212
+ install() {
213
+ this.spawnCommand("composer", ["install"]);
214
+ }
215
+
216
+ _getPhpVersion(pluginPhpVersion) {
217
+ const toFind = ['=','>'];
218
+
219
+ for (const char of toFind) {
220
+ const index = pluginPhpVersion.indexOf(char);
221
+
222
+ if (index >= 0) {
223
+ return pluginPhpVersion.substring(index + 1);
224
+ }
225
+ }
226
+
227
+ return pluginPhpVersion;
228
+ }
229
+
230
+ }
@@ -0,0 +1,54 @@
1
+ **/.cache-loader/**
2
+ **/.composer-cache/**
3
+ **/.husky/**
4
+ **/.imagemin-cache/**
5
+ **/.gitlab/**
6
+ **/.github/**
7
+ **/.parcel-cache/**
8
+ **/.vscode/**
9
+ **/.yarn/**
10
+ **/node_modules/**
11
+ **/*.scss
12
+ **/.airfleet-release
13
+ .airfleet-release
14
+ **/.deployignore
15
+ **/.editorconfig
16
+ .editorconfig
17
+ **/.env
18
+ .env
19
+ **/.eslintcache
20
+ **/.eslintrc.js
21
+ **/.gitattributes
22
+ .gitattributes
23
+ **/.parcelrc
24
+ .parcelrc
25
+ **/.prettierignore
26
+ .prettierignore
27
+ **/CHANGELOG.md
28
+ CHANGELOG.md
29
+ **/LICENSE
30
+ LICENSE
31
+ **/README.md
32
+ README.md
33
+ **/.gitignore
34
+ .gitignore
35
+ **/package.json
36
+ package.json
37
+ **/composer-scoped.json
38
+ composer-scoped.json
39
+ **/composer-scoped.lock
40
+ composer-scoped.lock
41
+ **/composer.json
42
+ composer.json
43
+ **/composer.lock
44
+ composer.lock
45
+ **/package-lock.json
46
+ package-lock.json
47
+ **/phpcs.xml
48
+ phpcs.xml
49
+ **/scoper.custom.php
50
+ scoper.custom.php
51
+
52
+
53
+
54
+
@@ -0,0 +1,18 @@
1
+ # editorconfig.org
2
+
3
+ root = true
4
+
5
+ [*]
6
+ charset = utf-8
7
+ end_of_line = lf
8
+ indent_style = space
9
+ indent_size = 2
10
+ trim_trailing_whitespace = true
11
+ insert_final_newline = true
12
+
13
+ [*.md]
14
+ trim_trailing_whitespace = false
15
+
16
+ [*.php]
17
+ indent_style = tab
18
+ indent_size = 4
File without changes