@airfleet/generator-init 0.38.0 → 0.39.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.
- package/generators/plugin/index.js +122 -26
- package/generators/plugin/templates/.browserslistrc +2 -0
- package/generators/plugin/templates/.dprint.json +3 -0
- package/generators/plugin/templates/.github/workflows/release-plugin-preview.yml +197 -0
- package/generators/plugin/templates/.github/workflows/release-plugin.yml +24 -18
- package/generators/plugin/templates/.github/workflows/test-wordpress.yml +43 -10
- package/generators/plugin/templates/.husky/pre-commit +1 -4
- package/generators/plugin/templates/.lintstagedrc.json +12 -0
- package/generators/plugin/templates/.node-version.ejs +1 -0
- package/generators/plugin/templates/.oxlintrc.json +3 -0
- package/generators/plugin/templates/.parcelrc +1 -2
- package/generators/plugin/templates/.stylelintrc.json +4 -0
- package/generators/plugin/templates/.vscode/airfleet.code-snippets.ejs +5 -1
- package/generators/plugin/templates/.vscode/settings.json +18 -8
- package/generators/plugin/templates/README.md.ejs +0 -11
- package/generators/plugin/templates/composer-scoped-empty.json.ejs +6 -0
- package/generators/plugin/templates/composer-scoped-empty.lock.ejs +18 -0
- package/generators/{project-plugin/templates/composer-scoped.json.ejs → plugin/templates/composer-scoped-framework.json.ejs} +1 -1
- package/generators/{project-plugin/templates/composer-scoped.lock.ejs → plugin/templates/composer-scoped-framework.lock.ejs} +19 -20
- package/generators/{project-plugin/templates/composer.json.ejs → plugin/templates/composer-with-scoper.json.ejs} +5 -4
- package/generators/plugin/templates/composer-without-scoper.json.ejs +40 -0
- package/generators/plugin/templates/gitignore +1 -0
- package/generators/plugin/templates/globals.d.ts +1 -0
- package/generators/plugin/templates/inc/AjaxVariables.php.ejs +1 -1
- package/generators/plugin/templates/inc/AjaxVariablesAdmin.php.ejs +1 -1
- package/generators/plugin/templates/inc/Options/GeneralOptions.php.ejs +2 -2
- package/generators/plugin/templates/inc/Pages.php.ejs +3 -3
- package/generators/plugin/templates/inc/RegisterViews.php.ejs +1 -1
- package/generators/plugin/templates/inc/Setup.php.ejs +6 -6
- package/generators/plugin/templates/package.json.ejs +9 -53
- package/generators/plugin/templates/plugin-name-api.php +1 -0
- package/generators/{project-plugin/templates/plugin-name.php.ejs → plugin/templates/plugin-name-scoped-framework.php.ejs} +11 -1
- package/generators/plugin/templates/plugin-name-unscoped-framework.php.ejs +82 -0
- package/generators/project/index.js +17 -21
- package/generators/project/info.js +2 -2
- package/generators/project/prompts.js +10 -16
- package/generators/project/templates/.deployignore +8 -0
- package/generators/project/templates/.github/workflows/test-wordpress-root-lightyear.yml +46 -9
- package/generators/project/templates/.husky/pre-commit +1 -4
- package/generators/project/templates/.vscode/airfleet.code-snippets +2 -2
- package/generators/project/templates/.vscode/settings.json +18 -8
- package/generators/project/templates/README.md.ejs +0 -9
- package/generators/project-plugin/index.js +92 -14
- package/generators/project-plugin/templates/.browserslistrc +2 -0
- package/generators/project-plugin/templates/.deployignore +38 -8
- package/generators/project-plugin/templates/.dprint.json +3 -0
- package/generators/project-plugin/templates/.github/workflows/test-wordpress.yml +43 -12
- package/generators/project-plugin/templates/.husky/pre-commit +1 -4
- package/generators/project-plugin/templates/.lintstagedrc.json +12 -0
- package/generators/project-plugin/templates/.node-version.ejs +1 -0
- package/generators/project-plugin/templates/.oxlintrc.json +3 -0
- package/generators/project-plugin/templates/.parcelrc +1 -2
- package/generators/project-plugin/templates/.stylelintrc.json +4 -0
- package/generators/project-plugin/templates/.vscode/airfleet.code-snippets.ejs +5 -1
- package/generators/project-plugin/templates/.vscode/settings.json +18 -8
- package/generators/project-plugin/templates/README.md.ejs +0 -7
- package/generators/project-plugin/templates/assets/admin/styles/admin.entry.scss +2 -2
- package/generators/project-plugin/templates/assets/editor/styles/editor.entry.scss +8 -7
- package/generators/project-plugin/templates/assets/frontend/styles/_main.scss +7 -3
- package/generators/project-plugin/templates/assets/frontend/styles/_placeholders.scss +9 -3
- package/generators/project-plugin/templates/assets/frontend/styles/_root.scss +2 -2
- package/generators/project-plugin/templates/assets/frontend/styles/critical.entry.scss +1 -1
- package/generators/project-plugin/templates/assets/frontend/styles/index.entry.scss +7 -5
- package/generators/project-plugin/templates/assets/frontend/styles/main/_body.scss +6 -4
- package/generators/project-plugin/templates/assets/frontend/styles/main/_reset.scss +98 -96
- package/generators/project-plugin/templates/assets/frontend/styles/placeholders/_button.scss +42 -40
- package/generators/project-plugin/templates/assets/frontend/styles/placeholders/_container.scss +12 -10
- package/generators/project-plugin/templates/assets/frontend/styles/placeholders/_sections.scss +6 -4
- package/generators/project-plugin/templates/assets/frontend/styles/root/_fonts.scss +2 -2
- package/generators/project-plugin/templates/assets/shared/styles/_figma-variables.scss +2 -5
- package/generators/project-plugin/templates/assets/shared/styles/_lib.scss +2 -2
- package/generators/project-plugin/templates/assets/shared/styles/_root.scss +2 -2
- package/generators/project-plugin/templates/assets/shared/styles/lib/_mixins.scss +6 -6
- package/generators/project-plugin/templates/assets/shared/styles/lib/mixins/_breakpoints.scss +1 -0
- package/generators/project-plugin/templates/composer-scoped-empty.json.ejs +6 -0
- package/generators/project-plugin/templates/composer-scoped-empty.lock.ejs +18 -0
- package/generators/{plugin/templates/composer-scoped.json.ejs → project-plugin/templates/composer-scoped-framework.json.ejs} +1 -1
- package/generators/{plugin/templates/composer-scoped.lock.ejs → project-plugin/templates/composer-scoped-framework.lock.ejs} +19 -20
- package/generators/{plugin/templates/composer.json.ejs → project-plugin/templates/composer-with-scoper.json.ejs} +5 -4
- package/generators/project-plugin/templates/composer-without-scoper.json.ejs +40 -0
- package/generators/project-plugin/templates/gitignore +1 -0
- package/generators/project-plugin/templates/globals.d.ts +1 -0
- package/generators/project-plugin/templates/inc/Features/Menus.php.ejs +1 -1
- package/generators/project-plugin/templates/inc/Setup/AjaxVariables.php.ejs +1 -1
- package/generators/project-plugin/templates/inc/Setup/AjaxVariablesAdmin.php.ejs +1 -1
- package/generators/project-plugin/templates/inc/Setup/Breakpoints.php.ejs +1 -1
- package/generators/project-plugin/templates/inc/Setup/Colors.php.ejs +1 -1
- package/generators/project-plugin/templates/inc/Setup/RegisterViews.php.ejs +1 -1
- package/generators/project-plugin/templates/inc/Setup.php.ejs +3 -3
- package/generators/project-plugin/templates/package.json.ejs +9 -58
- package/generators/{plugin/templates/plugin-name.php.ejs → project-plugin/templates/plugin-name-scoped-framework.php.ejs} +6 -1
- package/generators/project-plugin/templates/plugin-name-unscoped-framework.php.ejs +79 -0
- package/generators/snippets/templates/airfleet.code-snippets.ejs +2 -2
- package/package.json +1 -1
- package/utils/configureBunPackageManager.js +13 -0
- 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 %>
|
|
@@ -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.
|
|
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": "
|
|
14
|
+
"editor.defaultFormatter": "dprint.dprint"
|
|
14
15
|
},
|
|
15
16
|
"[javascriptreact]": {
|
|
16
|
-
"editor.defaultFormatter": "
|
|
17
|
+
"editor.defaultFormatter": "dprint.dprint"
|
|
17
18
|
},
|
|
18
19
|
"[typescript]": {
|
|
19
|
-
"editor.defaultFormatter": "
|
|
20
|
+
"editor.defaultFormatter": "dprint.dprint"
|
|
20
21
|
},
|
|
21
22
|
"[typescriptreact]": {
|
|
22
|
-
"editor.defaultFormatter": "
|
|
23
|
+
"editor.defaultFormatter": "dprint.dprint"
|
|
23
24
|
},
|
|
24
25
|
"[postcss]": {
|
|
25
|
-
"editor.defaultFormatter": "
|
|
26
|
+
"editor.defaultFormatter": "dprint.dprint"
|
|
26
27
|
},
|
|
27
28
|
"[scss]": {
|
|
28
|
-
"editor.defaultFormatter": "
|
|
29
|
+
"editor.defaultFormatter": "dprint.dprint"
|
|
29
30
|
},
|
|
30
31
|
"[css]": {
|
|
31
|
-
"editor.defaultFormatter": "
|
|
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,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
|
+
}
|
|
@@ -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": "
|
|
7
|
+
"content-hash": "4e99e5cbc4901186086cdeb9b82bac6f",
|
|
8
8
|
"packages": [
|
|
9
9
|
{
|
|
10
10
|
"name": "airfleet/wordpress-framework",
|
|
11
|
-
"version": "1.
|
|
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": "
|
|
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/
|
|
20
|
-
"reference": "
|
|
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.
|
|
43
|
+
"source": "https://github.com/airfleet/airfleet-wordpress-framework-php/tree/1.19.1"
|
|
44
44
|
},
|
|
45
|
-
"time": "
|
|
45
|
+
"time": "2025-11-21T10:22:03+00:00"
|
|
46
46
|
},
|
|
47
47
|
{
|
|
48
48
|
"name": "jawira/case-converter",
|
|
49
|
-
"version": "v3.
|
|
49
|
+
"version": "v3.6.0",
|
|
50
50
|
"source": {
|
|
51
51
|
"type": "git",
|
|
52
52
|
"url": "https://github.com/jawira/case-converter.git",
|
|
53
|
-
"reference": "
|
|
53
|
+
"reference": "de9956122568743a83e0fc7e2eaa92c1b0de3f18"
|
|
54
54
|
},
|
|
55
55
|
"dist": {
|
|
56
56
|
"type": "zip",
|
|
57
|
-
"url": "https://api.github.com/repos/jawira/case-converter/zipball/
|
|
58
|
-
"reference": "
|
|
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": "^
|
|
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.
|
|
109
|
+
"source": "https://github.com/jawira/case-converter/tree/v3.6.0"
|
|
111
110
|
},
|
|
112
|
-
"time": "
|
|
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.
|
|
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": "^
|
|
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": "
|
|
25
|
-
"fix": "
|
|
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
|
+
}
|
|
@@ -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
|
|
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
|
|
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
|
|
6
|
-
use
|
|
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
|
|
6
|
-
use
|
|
7
|
-
use
|
|
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
|
|
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
|
|
6
|
-
use
|
|
5
|
+
use <%= frameworkNamespace %>\Assets\Enqueue;
|
|
6
|
+
use <%= frameworkNamespace %>\Features\PluginFeatures;
|
|
7
7
|
<%_ if (optionsPage === 'framework' ) { _%>
|
|
8
|
-
use
|
|
8
|
+
use <%= frameworkNamespace %>\Plugin\SettingsLink;
|
|
9
9
|
<%_ } _%>
|
|
10
10
|
<%_ if (optionsPage === 'acf' ) { _%>
|
|
11
|
-
use
|
|
12
|
-
use
|
|
11
|
+
use <%= frameworkNamespace %>\Plugin\AcfSettingsOptionsSubPage;
|
|
12
|
+
use <%= frameworkNamespace %>\Plugin\AcfSettingsLink;
|
|
13
13
|
<%_ } _%>
|
|
14
14
|
<%_ if (answers.pluginAcfLocalJson) { _%>
|
|
15
|
-
use
|
|
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": "
|
|
7
|
-
"start": "
|
|
8
|
-
"watch": "
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"
|
|
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.
|
|
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
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<?php
|
|
@@ -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
|
+
*/
|