@airfleet/generator-init 0.37.0 → 0.39.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 (97) hide show
  1. package/generators/plugin/index.js +115 -26
  2. package/generators/plugin/templates/.browserslistrc +2 -0
  3. package/generators/plugin/templates/.dprint.json +3 -0
  4. package/generators/plugin/templates/.github/workflows/release-plugin-preview.yml +197 -0
  5. package/generators/plugin/templates/.github/workflows/release-plugin.yml +24 -18
  6. package/generators/plugin/templates/.github/workflows/test-wordpress.yml +43 -10
  7. package/generators/plugin/templates/.husky/pre-commit +1 -4
  8. package/generators/plugin/templates/.lintstagedrc.json +12 -0
  9. package/generators/plugin/templates/.node-version +1 -0
  10. package/generators/plugin/templates/.oxlintrc.json +3 -0
  11. package/generators/plugin/templates/.parcelrc +1 -2
  12. package/generators/plugin/templates/.stylelintrc.json +4 -0
  13. package/generators/plugin/templates/.vscode/airfleet.code-snippets.ejs +5 -1
  14. package/generators/plugin/templates/.vscode/settings.json +18 -8
  15. package/generators/plugin/templates/README.md.ejs +0 -11
  16. package/generators/plugin/templates/composer-scoped-empty.json.ejs +6 -0
  17. package/generators/plugin/templates/composer-scoped-empty.lock.ejs +18 -0
  18. package/generators/{project-plugin/templates/composer-scoped.json.ejs → plugin/templates/composer-scoped-framework.json.ejs} +1 -1
  19. package/generators/{project-plugin/templates/composer-scoped.lock.ejs → plugin/templates/composer-scoped-framework.lock.ejs} +19 -20
  20. package/generators/{project-plugin/templates/composer.json.ejs → plugin/templates/composer-with-scoper.json.ejs} +5 -4
  21. package/generators/plugin/templates/composer-without-scoper.json.ejs +40 -0
  22. package/generators/plugin/templates/gitignore +1 -0
  23. package/generators/plugin/templates/globals.d.ts +1 -0
  24. package/generators/plugin/templates/inc/AjaxVariables.php.ejs +1 -1
  25. package/generators/plugin/templates/inc/AjaxVariablesAdmin.php.ejs +1 -1
  26. package/generators/plugin/templates/inc/Options/GeneralOptions.php.ejs +2 -2
  27. package/generators/plugin/templates/inc/Pages.php.ejs +3 -3
  28. package/generators/plugin/templates/inc/RegisterViews.php.ejs +1 -1
  29. package/generators/plugin/templates/inc/Setup.php.ejs +6 -6
  30. package/generators/plugin/templates/package.json.ejs +9 -53
  31. package/generators/plugin/templates/plugin-name-api.php +1 -0
  32. package/generators/{project-plugin/templates/plugin-name.php.ejs → plugin/templates/plugin-name-scoped-framework.php.ejs} +11 -1
  33. package/generators/plugin/templates/plugin-name-unscoped-framework.php.ejs +82 -0
  34. package/generators/plugin/templates/scoper.custom.php.ejs +1 -0
  35. package/generators/project/index.js +14 -21
  36. package/generators/project/info.js +2 -2
  37. package/generators/project/prompts.js +10 -16
  38. package/generators/project/templates/.deployignore +8 -0
  39. package/generators/project/templates/.github/workflows/test-wordpress-root-lightyear.yml +46 -9
  40. package/generators/project/templates/.husky/pre-commit +1 -4
  41. package/generators/project/templates/.vscode/airfleet.code-snippets +2 -2
  42. package/generators/project/templates/.vscode/settings.json +18 -8
  43. package/generators/project/templates/README.md.ejs +0 -9
  44. package/generators/project-plugin/index.js +85 -14
  45. package/generators/project-plugin/templates/.browserslistrc +2 -0
  46. package/generators/project-plugin/templates/.deployignore +38 -8
  47. package/generators/project-plugin/templates/.dprint.json +3 -0
  48. package/generators/project-plugin/templates/.github/workflows/test-wordpress.yml +43 -12
  49. package/generators/project-plugin/templates/.husky/pre-commit +1 -4
  50. package/generators/project-plugin/templates/.lintstagedrc.json +12 -0
  51. package/generators/project-plugin/templates/.node-version +1 -0
  52. package/generators/project-plugin/templates/.oxlintrc.json +3 -0
  53. package/generators/project-plugin/templates/.parcelrc +1 -2
  54. package/generators/project-plugin/templates/.stylelintrc.json +4 -0
  55. package/generators/project-plugin/templates/.vscode/airfleet.code-snippets.ejs +5 -1
  56. package/generators/project-plugin/templates/.vscode/settings.json +18 -8
  57. package/generators/project-plugin/templates/README.md.ejs +0 -7
  58. package/generators/project-plugin/templates/assets/admin/styles/admin.entry.scss +2 -2
  59. package/generators/project-plugin/templates/assets/editor/styles/editor.entry.scss +8 -7
  60. package/generators/project-plugin/templates/assets/frontend/styles/_main.scss +7 -3
  61. package/generators/project-plugin/templates/assets/frontend/styles/_placeholders.scss +9 -3
  62. package/generators/project-plugin/templates/assets/frontend/styles/_root.scss +2 -2
  63. package/generators/project-plugin/templates/assets/frontend/styles/critical.entry.scss +1 -1
  64. package/generators/project-plugin/templates/assets/frontend/styles/index.entry.scss +7 -5
  65. package/generators/project-plugin/templates/assets/frontend/styles/main/_body.scss +6 -4
  66. package/generators/project-plugin/templates/assets/frontend/styles/main/_reset.scss +98 -96
  67. package/generators/project-plugin/templates/assets/frontend/styles/placeholders/_button.scss +42 -40
  68. package/generators/project-plugin/templates/assets/frontend/styles/placeholders/_container.scss +12 -10
  69. package/generators/project-plugin/templates/assets/frontend/styles/placeholders/_sections.scss +6 -4
  70. package/generators/project-plugin/templates/assets/frontend/styles/root/_fonts.scss +2 -2
  71. package/generators/project-plugin/templates/assets/shared/styles/_figma-variables.scss +2 -5
  72. package/generators/project-plugin/templates/assets/shared/styles/_lib.scss +2 -2
  73. package/generators/project-plugin/templates/assets/shared/styles/_root.scss +2 -2
  74. package/generators/project-plugin/templates/assets/shared/styles/lib/_mixins.scss +6 -6
  75. package/generators/project-plugin/templates/assets/shared/styles/lib/mixins/_breakpoints.scss +1 -0
  76. package/generators/project-plugin/templates/composer-scoped-empty.json.ejs +6 -0
  77. package/generators/project-plugin/templates/composer-scoped-empty.lock.ejs +18 -0
  78. package/generators/{plugin/templates/composer-scoped.json.ejs → project-plugin/templates/composer-scoped-framework.json.ejs} +1 -1
  79. package/generators/{plugin/templates/composer-scoped.lock.ejs → project-plugin/templates/composer-scoped-framework.lock.ejs} +19 -20
  80. package/generators/{plugin/templates/composer.json.ejs → project-plugin/templates/composer-with-scoper.json.ejs} +5 -4
  81. package/generators/project-plugin/templates/composer-without-scoper.json.ejs +40 -0
  82. package/generators/project-plugin/templates/gitignore +1 -0
  83. package/generators/project-plugin/templates/globals.d.ts +1 -0
  84. package/generators/project-plugin/templates/inc/Features/Menus.php.ejs +1 -1
  85. package/generators/project-plugin/templates/inc/Setup/AjaxVariables.php.ejs +1 -1
  86. package/generators/project-plugin/templates/inc/Setup/AjaxVariablesAdmin.php.ejs +1 -1
  87. package/generators/project-plugin/templates/inc/Setup/Breakpoints.php.ejs +1 -1
  88. package/generators/project-plugin/templates/inc/Setup/Colors.php.ejs +1 -1
  89. package/generators/project-plugin/templates/inc/Setup/RegisterViews.php.ejs +1 -1
  90. package/generators/project-plugin/templates/inc/Setup.php.ejs +3 -3
  91. package/generators/project-plugin/templates/package.json.ejs +9 -58
  92. package/generators/{plugin/templates/plugin-name.php.ejs → project-plugin/templates/plugin-name-scoped-framework.php.ejs} +6 -1
  93. package/generators/project-plugin/templates/plugin-name-unscoped-framework.php.ejs +79 -0
  94. package/generators/project-plugin/templates/scoper.custom.php.ejs +1 -0
  95. package/generators/snippets/templates/airfleet.code-snippets.ejs +2 -2
  96. package/package.json +1 -1
  97. package/generators/plugin/templates/.prettierignore +0 -15
@@ -0,0 +1,12 @@
1
+ {
2
+ "*.{js,mjs,cjs,jsx,ts,mts,cts,tsx}": ["oxlint --fix", "dprint fmt"],
3
+ "*.{json,jsonc,md,yaml,yml}": "dprint fmt",
4
+ "*.{css,scss}": [
5
+ "stylelint --cache --ignore-path .gitignore --allow-empty-input --fix",
6
+ "dprint fmt"
7
+ ],
8
+ "*.php": [
9
+ "composer exec phpcbf",
10
+ "composer exec \"parallel-lint . --show-deprecated --exclude .git --exclude .parcel-cache --exclude dist --exclude node_modules --exclude wp-content --exclude vendor --exclude vendor-scoped\""
11
+ ]
12
+ }
@@ -0,0 +1 @@
1
+ <%- answers.pluginNodeVersion %>
@@ -0,0 +1,3 @@
1
+ {
2
+ "extends": ["./node_modules/@airfleet/wordpress-dev/config/.oxlintrc.json"]
3
+ }
@@ -1,4 +1,3 @@
1
1
  {
2
- "extends": "@parcel/config-default",
3
- "reporters": ["...", "parcel-reporter-bundle-manifest"]
2
+ "extends": "./node_modules/@airfleet/wordpress-dev/config/.parcelrc"
4
3
  }
@@ -0,0 +1,4 @@
1
+ {
2
+ "extends": ["@airfleet/stylelint-config-wordpress"],
3
+ "ignoreFiles": ["**/_figma-variables.scss"]
4
+ }
@@ -7,7 +7,11 @@
7
7
  "",
8
8
  "namespace Airfleet\\Plugins\\<%= nameNoAirfleet.pascal %>\\\\${TM_DIRECTORY/^.+[\\/\\\\]+(.*)$/$1/};",
9
9
  "",
10
+ <%_ if (answers.addScoper) { _%>
10
11
  "use Airfleet\\Plugins\\<%= nameNoAirfleet.pascal %>\\Vendor\\Airfleet\\Framework\\Features\\BasePluginFeature;",
12
+ <% } else { %>,
13
+ "use Airfleet\\Framework\\Features\\BasePluginFeature;",
14
+ <% } _%>
11
15
  "",
12
16
  "class $TM_FILENAME_BASE extends BasePluginFeature {",
13
17
  " public function initialize(): void {",
@@ -181,4 +185,4 @@
181
185
  ],
182
186
  "description": "Bootstrap a Blade template for a partial"
183
187
  }
184
- }
188
+ }
@@ -1,8 +1,9 @@
1
1
  {
2
2
  "editor.codeActionsOnSave": {
3
3
  "source.fixAll": "explicit",
4
- "source.fixAll.eslint": "explicit"
4
+ "source.fixAll.oxc": "explicit"
5
5
  },
6
+ "editor.defaultFormatter": "dprint.dprint",
6
7
  "editor.formatOnSave": true,
7
8
  "stylelint.validate": ["css", "scss", "postcss"],
8
9
  "phpSniffer.autoDetect": true,
@@ -10,24 +11,33 @@
10
11
  "editor.defaultFormatter": "wongjn.php-sniffer"
11
12
  },
12
13
  "[javascript]": {
13
- "editor.defaultFormatter": "dbaeumer.vscode-eslint"
14
+ "editor.defaultFormatter": "dprint.dprint"
14
15
  },
15
16
  "[javascriptreact]": {
16
- "editor.defaultFormatter": "dbaeumer.vscode-eslint"
17
+ "editor.defaultFormatter": "dprint.dprint"
17
18
  },
18
19
  "[typescript]": {
19
- "editor.defaultFormatter": "dbaeumer.vscode-eslint"
20
+ "editor.defaultFormatter": "dprint.dprint"
20
21
  },
21
22
  "[typescriptreact]": {
22
- "editor.defaultFormatter": "dbaeumer.vscode-eslint"
23
+ "editor.defaultFormatter": "dprint.dprint"
23
24
  },
24
25
  "[postcss]": {
25
- "editor.defaultFormatter": "esbenp.prettier-vscode"
26
+ "editor.defaultFormatter": "dprint.dprint"
26
27
  },
27
28
  "[scss]": {
28
- "editor.defaultFormatter": "esbenp.prettier-vscode"
29
+ "editor.defaultFormatter": "dprint.dprint"
29
30
  },
30
31
  "[css]": {
31
- "editor.defaultFormatter": "esbenp.prettier-vscode"
32
+ "editor.defaultFormatter": "dprint.dprint"
33
+ },
34
+ "[json]": {
35
+ "editor.defaultFormatter": "dprint.dprint"
36
+ },
37
+ "[yaml]": {
38
+ "editor.defaultFormatter": "dprint.dprint"
39
+ },
40
+ "[markdown]": {
41
+ "editor.defaultFormatter": "dprint.dprint"
32
42
  }
33
43
  }
@@ -5,17 +5,6 @@
5
5
 
6
6
  <%= answers.pluginDescription %>
7
7
 
8
- ## Getting Started
9
-
10
- ```bash
11
- composer install
12
- npm install
13
- ```
14
-
15
- ## Documentation
16
-
17
- - [Documentation](<%= answers.pluginDocumentationUrl %>).
18
-
19
8
  ## License
20
9
 
21
10
  © [Airfleet](https://www.airfleet.co/)
@@ -0,0 +1,6 @@
1
+ {
2
+ "require": {},
3
+ "config": {
4
+ "autoloader-suffix": "<%= name.pascal %>"
5
+ }
6
+ }
@@ -0,0 +1,18 @@
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": "8d070178755c320c69f93ee4800660ef",
8
+ "packages": [],
9
+ "packages-dev": [],
10
+ "aliases": [],
11
+ "minimum-stability": "stable",
12
+ "stability-flags": {},
13
+ "prefer-stable": false,
14
+ "prefer-lowest": false,
15
+ "platform": {},
16
+ "platform-dev": {},
17
+ "plugin-api-version": "2.9.0"
18
+ }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "require": {
3
- "airfleet/wordpress-framework": "^1.5.0"
3
+ "airfleet/wordpress-framework": "^1.19.1"
4
4
  },
5
5
  "config": {
6
6
  "autoloader-suffix": "<%= name.pascal %>"
@@ -4,20 +4,20 @@
4
4
  "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
5
5
  "This file is @generated automatically"
6
6
  ],
7
- "content-hash": "9c5f20589b695e0465c3e3f17445638a",
7
+ "content-hash": "4e99e5cbc4901186086cdeb9b82bac6f",
8
8
  "packages": [
9
9
  {
10
10
  "name": "airfleet/wordpress-framework",
11
- "version": "1.5.0",
11
+ "version": "1.19.1",
12
12
  "source": {
13
13
  "type": "git",
14
14
  "url": "https://github.com/airfleet/airfleet-wordpress-framework-php.git",
15
- "reference": "5847995d05980b5215458b8cacd74d223a5e0d8b"
15
+ "reference": "b21dbfd5a3e3696762bb9e9c3f13cb1d73bd14de"
16
16
  },
17
17
  "dist": {
18
18
  "type": "zip",
19
- "url": "https://api.github.com/repos/airfleet/airfleet-wordpress-framework-php/zipball/5847995d05980b5215458b8cacd74d223a5e0d8b",
20
- "reference": "5847995d05980b5215458b8cacd74d223a5e0d8b",
19
+ "url": "https://api.github.com/repos/airfleet/airfleet-wordpress-framework-php/zipball/b21dbfd5a3e3696762bb9e9c3f13cb1d73bd14de",
20
+ "reference": "b21dbfd5a3e3696762bb9e9c3f13cb1d73bd14de",
21
21
  "shasum": ""
22
22
  },
23
23
  "require": {
@@ -40,22 +40,22 @@
40
40
  "description": "Airfleet framework for WordPress",
41
41
  "support": {
42
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"
43
+ "source": "https://github.com/airfleet/airfleet-wordpress-framework-php/tree/1.19.1"
44
44
  },
45
- "time": "2024-05-28T17:03:25+00:00"
45
+ "time": "2025-11-21T10:22:03+00:00"
46
46
  },
47
47
  {
48
48
  "name": "jawira/case-converter",
49
- "version": "v3.5.1",
49
+ "version": "v3.6.0",
50
50
  "source": {
51
51
  "type": "git",
52
52
  "url": "https://github.com/jawira/case-converter.git",
53
- "reference": "2be05b98dcb743bef60ab6f849145bd3434ed003"
53
+ "reference": "de9956122568743a83e0fc7e2eaa92c1b0de3f18"
54
54
  },
55
55
  "dist": {
56
56
  "type": "zip",
57
- "url": "https://api.github.com/repos/jawira/case-converter/zipball/2be05b98dcb743bef60ab6f849145bd3434ed003",
58
- "reference": "2be05b98dcb743bef60ab6f849145bd3434ed003",
57
+ "url": "https://api.github.com/repos/jawira/case-converter/zipball/de9956122568743a83e0fc7e2eaa92c1b0de3f18",
58
+ "reference": "de9956122568743a83e0fc7e2eaa92c1b0de3f18",
59
59
  "shasum": ""
60
60
  },
61
61
  "require": {
@@ -64,9 +64,8 @@
64
64
  },
65
65
  "require-dev": {
66
66
  "behat/behat": "^3.0",
67
- "phpstan/phpstan": "^1.0",
68
- "phpunit/phpunit": "^9.0",
69
- "vimeo/psalm": "^4.0"
67
+ "phpstan/phpstan": "^v2",
68
+ "phpunit/phpunit": "^9.0"
70
69
  },
71
70
  "suggest": {
72
71
  "pds/skeleton": "PHP Package Development Standards",
@@ -107,18 +106,18 @@
107
106
  ],
108
107
  "support": {
109
108
  "issues": "https://github.com/jawira/case-converter/issues",
110
- "source": "https://github.com/jawira/case-converter/tree/v3.5.1"
109
+ "source": "https://github.com/jawira/case-converter/tree/v3.6.0"
111
110
  },
112
- "time": "2022-08-14T11:40:18+00:00"
111
+ "time": "2025-06-13T21:12:55+00:00"
113
112
  }
114
113
  ],
115
114
  "packages-dev": [],
116
115
  "aliases": [],
117
116
  "minimum-stability": "stable",
118
- "stability-flags": [],
117
+ "stability-flags": {},
119
118
  "prefer-stable": false,
120
119
  "prefer-lowest": false,
121
- "platform": [],
122
- "platform-dev": [],
123
- "plugin-api-version": "2.6.0"
120
+ "platform": {},
121
+ "platform-dev": {},
122
+ "plugin-api-version": "2.9.0"
124
123
  }
@@ -12,7 +12,7 @@
12
12
  "composer/installers": "^2.2.0"
13
13
  },
14
14
  "require-dev": {
15
- "airfleet/wordpress-dev": "^3.2.0",
15
+ "airfleet/wordpress-dev": "^4.0.1",
16
16
  "wpify/scoper": "2.5.4"
17
17
  },
18
18
  "autoload": {
@@ -21,8 +21,8 @@
21
21
  }
22
22
  },
23
23
  "scripts": {
24
- "lint": "phpcs",
25
- "fix": "phpcbf",
24
+ "lint": "bunx afwp lint --php",
25
+ "fix": "bunx afwp fix --php",
26
26
  "install-codestandards": [
27
27
  "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin::run"
28
28
  ],
@@ -48,5 +48,6 @@
48
48
  "composerlock": "composer-scoped.lock"
49
49
  }
50
50
  },
51
- "minimum-stability": "dev"
51
+ "minimum-stability": "dev",
52
+ "prefer-stable": true
52
53
  }
@@ -0,0 +1,40 @@
1
+ {
2
+ "name": "airfleet/<%= name.slug %>",
3
+ "type": "wordpress-plugin",
4
+ "authors": [
5
+ {
6
+ "name": "Airfleet",
7
+ "email": "dev@airfleet.co"
8
+ }
9
+ ],
10
+ "require": {
11
+ "php": "<%- answers.pluginPhpVersion %>",
12
+ "composer/installers": "^2.2.0"
13
+ },
14
+ "require-dev": {
15
+ "airfleet/wordpress-dev": "^4.0.1"
16
+ },
17
+ "autoload": {
18
+ "psr-4": {
19
+ "Airfleet\\Plugins\\<%= nameNoAirfleet.pascal %>\\": "inc/"
20
+ }
21
+ },
22
+ "scripts": {
23
+ "lint": "bunx afwp lint --php",
24
+ "fix": "bunx afwp fix --php",
25
+ "install-codestandards": [
26
+ "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin::run"
27
+ ],
28
+ "post-install-cmd": [
29
+ "@install-codestandards"
30
+ ]
31
+ },
32
+ "config": {
33
+ "allow-plugins": {
34
+ "composer/installers": true,
35
+ "dealerdirect/phpcodesniffer-composer-installer": true
36
+ }
37
+ },
38
+ "minimum-stability": "dev",
39
+ "prefer-stable": true
40
+ }
@@ -13,3 +13,4 @@ vendor-scoped
13
13
  wp-content
14
14
  .DS_Store
15
15
  .idea
16
+ package-lock.json
@@ -0,0 +1 @@
1
+ /// <reference types="@airfleet/wordpress-types" />
@@ -2,7 +2,7 @@
2
2
 
3
3
  namespace Airfleet\Plugins\<%= nameNoAirfleet.pascal %>;
4
4
 
5
- use Airfleet\Plugins\<%= nameNoAirfleet.pascal %>\Vendor\Airfleet\Framework\Assets\FrontendVariables;
5
+ use <%= frameworkNamespace %>\Assets\FrontendVariables;
6
6
 
7
7
  class AjaxVariables extends FrontendVariables {
8
8
  public function __construct() {
@@ -2,7 +2,7 @@
2
2
 
3
3
  namespace Airfleet\Plugins\<%= nameNoAirfleet.pascal %>;
4
4
 
5
- use Airfleet\Plugins\<%= nameNoAirfleet.pascal %>\Vendor\Airfleet\Framework\Assets\AdminVariables;
5
+ use <%= frameworkNamespace %>\Assets\AdminVariables;
6
6
 
7
7
  class AjaxVariablesAdmin extends AdminVariables {
8
8
  public function __construct() {
@@ -2,8 +2,8 @@
2
2
 
3
3
  namespace Airfleet\Plugins\<%= nameNoAirfleet.pascal %>\Options;
4
4
 
5
- use Airfleet\Plugins\<%= nameNoAirfleet.pascal %>\Vendor\Airfleet\Framework\Options\Group;
6
- use Airfleet\Plugins\<%= nameNoAirfleet.pascal %>\Vendor\Airfleet\Framework\Options\Wizard;
5
+ use <%= frameworkNamespace %>\Options\Group;
6
+ use <%= frameworkNamespace %>\Options\Wizard;
7
7
 
8
8
  class GeneralOptions extends Group {
9
9
  private const IS_ENABLED = 'is_enabled';
@@ -2,9 +2,9 @@
2
2
 
3
3
  namespace Airfleet\Plugins\<%= nameNoAirfleet.pascal %>;
4
4
 
5
- use Airfleet\Plugins\<%= nameNoAirfleet.pascal %>\Vendor\Airfleet\Framework\Features\BasePluginFeature;
6
- use Airfleet\Plugins\<%= nameNoAirfleet.pascal %>\Vendor\Airfleet\Framework\Options\Pages\MenuTabsPage;
7
- use Airfleet\Plugins\<%= nameNoAirfleet.pascal %>\Vendor\Airfleet\Framework\Options\Tabs\OptionsTab;
5
+ use <%= frameworkNamespace %>\Features\BasePluginFeature;
6
+ use <%= frameworkNamespace %>\Options\Pages\MenuTabsPage;
7
+ use <%= frameworkNamespace %>\Options\Tabs\OptionsTab;
8
8
  use Airfleet\Plugins\<%= nameNoAirfleet.pascal %>\Options;
9
9
 
10
10
  class Pages extends BasePluginFeature {
@@ -2,7 +2,7 @@
2
2
 
3
3
  namespace Airfleet\Plugins\<%= nameNoAirfleet.pascal %>;
4
4
 
5
- use Airfleet\Plugins\<%= nameNoAirfleet.pascal %>\Vendor\Airfleet\Framework\Features\BasePluginFeature;
5
+ use <%= frameworkNamespace %>\Features\BasePluginFeature;
6
6
 
7
7
  class RegisterViews extends BasePluginFeature {
8
8
  public function initialize(): void {
@@ -2,17 +2,17 @@
2
2
 
3
3
  namespace Airfleet\Plugins\<%= nameNoAirfleet.pascal %>;
4
4
 
5
- use Airfleet\Plugins\<%= nameNoAirfleet.pascal %>\Vendor\Airfleet\Framework\Assets\Enqueue;
6
- use Airfleet\Plugins\<%= nameNoAirfleet.pascal %>\Vendor\Airfleet\Framework\Features\PluginFeatures;
5
+ use <%= frameworkNamespace %>\Assets\Enqueue;
6
+ use <%= frameworkNamespace %>\Features\PluginFeatures;
7
7
  <%_ if (optionsPage === 'framework' ) { _%>
8
- use Airfleet\Plugins\<%= nameNoAirfleet.pascal %>\Vendor\Airfleet\Framework\Plugin\SettingsLink;
8
+ use <%= frameworkNamespace %>\Plugin\SettingsLink;
9
9
  <%_ } _%>
10
10
  <%_ if (optionsPage === 'acf' ) { _%>
11
- use Airfleet\Plugins\<%= nameNoAirfleet.pascal %>\Vendor\Airfleet\Framework\Plugin\AcfSettingsOptionsSubPage;
12
- use Airfleet\Plugins\<%= nameNoAirfleet.pascal %>\Vendor\Airfleet\Framework\Plugin\AcfSettingsLink;
11
+ use <%= frameworkNamespace %>\Plugin\AcfSettingsOptionsSubPage;
12
+ use <%= frameworkNamespace %>\Plugin\AcfSettingsLink;
13
13
  <%_ } _%>
14
14
  <%_ if (answers.pluginAcfLocalJson) { _%>
15
- use Airfleet\Plugins\<%= nameNoAirfleet.pascal %>\Vendor\Airfleet\Framework\Acf\LocalJson;
15
+ use <%= frameworkNamespace %>\Acf\LocalJson;
16
16
  <%_ } _%>
17
17
 
18
18
  class Setup extends PluginFeatures {
@@ -3,25 +3,14 @@
3
3
  "description": "<%= answers.pluginDescription %>",
4
4
  "version": "<%= answers.pluginVersion %>",
5
5
  "scripts": {
6
- "build": "dotenv -- parcel build --no-source-maps --log-level verbose \"./!(dist|node_modules)/**/*.entry.{js,css,scss}\"",
7
- "start": "dotenv -- parcel serve --hmr-port 1236 --port 1234 --log-level verbose \"./!(dist|node_modules)/**/*.entry.{js,css,scss}\"",
8
- "watch": "dotenv -- parcel watch --no-hmr --log-level verbose \"./!(dist|node_modules)/**/*.entry.{js,css,scss}\"",
9
- "base:eslint": "eslint \"**/*.js\" --cache --ignore-path .gitignore",
10
- "base:prettier": "prettier \"**/*.{css,scss}\"",
11
- "base:stylelint": "stylelint \"**/*.{css,scss}\" --cache --ignore-path .gitignore --allow-empty-input",
12
- "lint": "run-s --continue-on-error lint:*",
13
- "lint:prettier": "npm run base:prettier -- --check",
14
- "lint:eslint": "npm run base:eslint",
15
- "lint:stylelint": "npm run base:stylelint",
16
- "lint:phpcs": "composer run lint",
17
- "fix": "run-s fix:*",
18
- "fix:prettier": "npm run base:prettier -- --write",
19
- "fix:eslint": "npm run base:eslint -- --fix",
20
- "fix:stylelint": "npm run base:stylelint -- --fix",
21
- "fix:phpcs": "composer run fix",
22
- "pretest": "npm run lint",
23
- "test": "echo Testing done",
24
- "prepare": "husky install"
6
+ "build": "afwp build",
7
+ "start": "afwp serve",
8
+ "watch": "afwp watch",
9
+ "lint": "afwp lint",
10
+ "fix": "afwp fix",
11
+ "format": "afwp format",
12
+ "test": "afwp test",
13
+ "prepare": "afwp prepare"
25
14
  },
26
15
  "private": true,
27
16
  "keywords": [
@@ -42,39 +31,6 @@
42
31
  },
43
32
  "dependencies": {},
44
33
  "devDependencies": {
45
- "@airfleet/wordpress-dev": "^3.2.0"
46
- },
47
- "browserslist": [
48
- "defaults",
49
- "not dead",
50
- "not op_mini all",
51
- "not op_mob > 0",
52
- "not opera > 0",
53
- "not kaios > 0",
54
- "not and_qq > 0",
55
- "not and_uc > 0"
56
- ],
57
- "prettier": "@airfleet/prettier-config-wordpress",
58
- "stylelint": {
59
- "extends": [
60
- "@airfleet/stylelint-config-wordpress"
61
- ]
62
- },
63
- "eslintConfig": {
64
- "extends": [
65
- "@airfleet/eslint-config-wordpress",
66
- "plugin:no-jquery/all"
67
- ]
68
- },
69
- "lint-staged": {
70
- "*.{js,jsx}": "eslint --cache --ignore-path .gitignore --fix",
71
- "*.{css,scss}": [
72
- "prettier --write",
73
- "stylelint --cache --ignore-path .gitignore --fix"
74
- ],
75
- "*.php": [
76
- "composer run fix",
77
- "composer run lint"
78
- ]
34
+ "@airfleet/wordpress-dev": "^4.3.0"
79
35
  }
80
36
  }
@@ -19,6 +19,9 @@
19
19
  * GitHub Plugin URI: <%= repositoryBase %>
20
20
  * Primary Branch: <%= mainBranch %>
21
21
  * Release Asset: true
22
+ <%_ if (answers.hasDependencies) { _%>
23
+ * Requires Plugins: <%= answers.dependencies %>
24
+ <% } _%>
22
25
  */
23
26
 
24
27
  // Exit if accessed directly.
@@ -40,7 +43,12 @@ define( '<%= name.constant %>_IMAGES_OPTIONS_URL', <%= name.constant %>_URL . '/
40
43
 
41
44
  // Autoload classes.
42
45
  require_once __DIR__ . '/vendor/autoload.php';
46
+ <%_ if (answers.addScoper) { _%>
43
47
  require_once __DIR__ . '/vendor-scoped/scoper-autoload.php';
48
+ <% } _%>
49
+
50
+ // Public functions API
51
+ require_once __DIR__ . '/<%= name.slug %>-api.php';
44
52
 
45
53
  // Initialize plugin.
46
54
  $<%= name.snake %> = new \Airfleet\Plugins\<%= nameNoAirfleet.pascal %>\Setup(
@@ -54,7 +62,9 @@ $<%= name.snake %> = new \Airfleet\Plugins\<%= nameNoAirfleet.pascal %>\Setup(
54
62
  'version' => \<%= name.constant %>_VERSION,
55
63
  ]
56
64
  );
57
-
65
+ register_activation_hook( __FILE__, [ $<%= name.snake %>, 'on_activation' ] );
66
+ register_deactivation_hook( __FILE__, [ $<%= name.snake %>, 'on_deactivation' ] );
67
+ register_uninstall_hook( __FILE__, '\Airfleet\Plugins\<%= nameNoAirfleet.pascal %>\Setup::uninstall' );
58
68
  $<%= name.snake %>->initialize();
59
69
 
60
70
  /**
@@ -0,0 +1,82 @@
1
+ <?php
2
+ /**
3
+ * <%= name.title %>
4
+ *
5
+ * @package Airfleet\Plugins\<%= nameNoAirfleet.pascal %>
6
+ * @version <%= answers.pluginVersion %>
7
+ * @author Airfleet
8
+ * @link https://www.airfleet.co/
9
+ *
10
+ * @wordpress-plugin
11
+ * Plugin Name: <%= name.title %>
12
+ * Plugin URI: https://www.airfleet.co/
13
+ * Description: <%= answers.pluginDescription %>
14
+ * Version: <%= answers.pluginVersion %>
15
+ * Requires PHP: <%= phpVersion %>
16
+ * Author: Airfleet
17
+ * Author URI: https://www.airfleet.co/
18
+ * Text Domain: <%= name.slug %>
19
+ * GitHub Plugin URI: <%= repositoryBase %>
20
+ * Primary Branch: <%= mainBranch %>
21
+ * Release Asset: true
22
+ <%_ if (answers.hasDependencies) { _%>
23
+ * Requires Plugins: <%= answers.dependencies %>
24
+ <% } _%>
25
+ */
26
+
27
+ // Exit if accessed directly.
28
+ if ( ! defined( 'ABSPATH' ) ) {
29
+ die;
30
+ }
31
+
32
+ // Plugin constants.
33
+ define( '<%= name.constant %>_VERSION', '<%= answers.pluginVersion %>' );
34
+ define( '<%= name.constant %>_SLUG', '<%= name.slug %>' );
35
+ define( '<%= name.constant %>_SLUG_SHORT', '<%= nameNoAirfleet.slug %>' );
36
+ define( '<%= name.constant %>_TITLE', '<%= name.title %>' );
37
+ define( '<%= name.constant %>_TITLE_SHORT', '<%= nameNoAirfleet.title %>' );
38
+ define( '<%= name.constant %>_PATH', plugin_dir_path( __FILE__ ) );
39
+ define( '<%= name.constant %>_URL', plugin_dir_url( __FILE__ ) );
40
+ define( '<%= name.constant %>_FILE', __FILE__ );
41
+ define( '<%= name.constant %>_DIR', __DIR__ );
42
+ define( '<%= name.constant %>_IMAGES_OPTIONS_URL', <%= name.constant %>_URL . '/assets/admin/images/options' );
43
+
44
+ // Autoload classes.
45
+ require_once __DIR__ . '/vendor/autoload.php';
46
+ <%_ if (answers.addScoper) { _%>
47
+ require_once __DIR__ . '/vendor-scoped/scoper-autoload.php';
48
+ <% } _%>
49
+
50
+ // Public functions API
51
+ require_once __DIR__ . '/<%= name.slug %>-api.php';
52
+
53
+ // Initialize plugin.
54
+ function <%= name.snake %>_uninstall() {
55
+ if ( ! class_exists( 'Airfleet\Framework\Features\PluginFeatures' ) ) {
56
+ return;
57
+ }
58
+ \Airfleet\Plugins\<%= nameNoAirfleet.pascal %>\Setup::uninstall();
59
+ }
60
+ $framework_enabled = fn () => class_exists( 'Airfleet\Framework\Features\PluginFeatures' );
61
+ $get_setup = fn () => new \Airfleet\Plugins\<%= nameNoAirfleet.pascal %>\Setup(
62
+ [
63
+ 'slug' => \<%= name.constant %>_SLUG,
64
+ 'short_slug' => \<%= name.constant %>_SLUG_SHORT,
65
+ 'title' => \<%= name.constant %>_TITLE,
66
+ 'short_title' => \<%= name.constant %>_TITLE_SHORT,
67
+ 'url' => \<%= name.constant %>_URL,
68
+ 'path' => \<%= name.constant %>_PATH,
69
+ 'version' => \<%= name.constant %>_VERSION,
70
+ ]
71
+ );
72
+ register_activation_hook( __FILE__, fn () => $framework_enabled() ? $get_setup()->on_activation() : null );
73
+ register_deactivation_hook( __FILE__, fn () => $framework_enabled() ? $get_setup()->on_deactivation() : null );
74
+ register_uninstall_hook( __FILE__, '<%= name.snake %>_uninstall' );
75
+ add_action( 'airfleet/framework/loaded', fn () => $get_setup()->initialize() );
76
+
77
+ /**
78
+ * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
79
+ * ! Do not make changes to this file.
80
+ * ! Edit the plugin class in folder inc/.
81
+ * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
82
+ */
@@ -3,6 +3,7 @@
3
3
  // phpcs:ignore
4
4
  function customize_php_scoper_config( array $config ): array {
5
5
  $config['exclude-functions'] = [ 'af_field', 'get_current_screen', 'get_post_type', '/acf\_*/' ];
6
+ $config['exclude-constants'] = [ 'REST_REQUEST', 'XMLRPC_REQUEST', 'WP_CLI', 'DOING_CRON', 'DOING_AJAX', 'JSON_REQUEST', 'IFRAME_REQUEST', 'WC_API_REQUEST' ];
6
7
 
7
8
  return $config;
8
9
  }