@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
@@ -0,0 +1,21 @@
1
+ @import '../../../shared/styles/lib';
2
+
3
+ // Declare font-faces here.
4
+ // Use https://transfonter.org/ to convert fonts to other formats.
5
+
6
+ // ! Instead of hard-coding the font path, use the variable below like this:
7
+ // url($font-src + 'FontName.woff')
8
+
9
+ $font-src: '/assets/frontend/fonts';
10
+
11
+ // ! EXAMPLE
12
+ // @font-face {
13
+ // font-family: 'Roboto Condensed';
14
+ // src: local('Roboto Condensed Italic'), local('RobotoCondensed-Italic'),
15
+ // url($font-src + '/RobotoCondensed-Italic.woff2') format('woff2'),
16
+ // url($font-src + '/RobotoCondensed-Italic.woff') format('woff'),
17
+ // url($font-src + '/RobotoCondensed-Italic.ttf') format('truetype');
18
+ // font-weight: normal;
19
+ // font-style: italic;
20
+ // font-display: swap;
21
+ // }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * * Generated by @airfleet/figma-bridge
3
+ * * !!! Do not edit directly
4
+ */
5
+
6
+ :root {
7
+ }
@@ -0,0 +1,4 @@
1
+ // ! Import here all the variables, mixins, functions
2
+ // ! i.e. everything that does not output CSS by default
3
+ @import 'lib/scss-variables';
4
+ @import 'lib/mixins';
@@ -0,0 +1,6 @@
1
+ @import 'lib';
2
+ @import 'figma-variables';
3
+
4
+ :root {
5
+ // Add root styles here
6
+ }
@@ -0,0 +1 @@
1
+ // Add shared styles here
@@ -0,0 +1,6 @@
1
+ @import 'mixins/body';
2
+ @import 'mixins/breakpoints';
3
+ @import 'mixins/list-inline';
4
+ @import 'mixins/position';
5
+ @import 'mixins/background';
6
+ @import 'mixins/helpers';
@@ -0,0 +1,2 @@
1
+ // ? Add variables here
2
+ // ! Do not add CSS variables here, only SCSS. Add CSS variables in `_root.scss`
@@ -0,0 +1,11 @@
1
+ /**
2
+ *
3
+ * Background
4
+ *
5
+ */
6
+
7
+ @mixin background($size: cover, $position: center, $repeat: no-repeat) {
8
+ background-position: $position;
9
+ background-repeat: $repeat;
10
+ background-size: $size;
11
+ }
@@ -0,0 +1,4 @@
1
+ // ! Body styles. The reason we do a separate mixin is to help us override styles in the block editor
2
+ @mixin theme-body-styles {
3
+ // Add styles here
4
+ }
@@ -0,0 +1,79 @@
1
+ @mixin tablet-up {
2
+ @media (width >= 768px) {
3
+ @content;
4
+ }
5
+ }
6
+
7
+ @mixin laptop-up {
8
+ @media (width >= 1280px) {
9
+ @content;
10
+ }
11
+ }
12
+
13
+ @mixin desktop-up {
14
+ @media (width >= 1920px) {
15
+ @content;
16
+ }
17
+ }
18
+
19
+ /**
20
+ *
21
+ * Desktop First
22
+ *
23
+ */
24
+
25
+ @mixin desktop-down {
26
+ @media (width < 1920px) {
27
+ @content;
28
+ }
29
+ }
30
+
31
+ @mixin laptop-down {
32
+ @media (width < 1280px) {
33
+ @content;
34
+ }
35
+ }
36
+
37
+ @mixin tablet-down {
38
+ @media (width < 768px) {
39
+ @content;
40
+ }
41
+ }
42
+
43
+ /**
44
+ *
45
+ * Specific Resolution Breakpoints
46
+ *
47
+ */
48
+
49
+ @mixin tablet-only() {
50
+ @media (width >= 768px) and (width < 1280px) {
51
+ @content;
52
+ }
53
+ }
54
+
55
+ @mixin laptop-only() {
56
+ @media (width >= 1280px) and (width < 1920px) {
57
+ @content;
58
+ }
59
+ }
60
+
61
+ /**
62
+ *
63
+ * WordPress Breakpoints
64
+ *
65
+ */
66
+
67
+ // mobile with admin bar
68
+ @mixin admin-bar-mobile {
69
+ @media (width < 600px) {
70
+ @content;
71
+ }
72
+ }
73
+
74
+ // tablet with admin bar
75
+ @mixin admin-bar-tablet {
76
+ @media (width < 782px) {
77
+ @content;
78
+ }
79
+ }
@@ -0,0 +1,35 @@
1
+ // Center flex children
2
+ @mixin afu-flex-center {
3
+ align-items: center;
4
+ display: flex;
5
+ justify-content: center;
6
+ }
7
+
8
+ // Center block element horizontally
9
+ @mixin afu-center-block($w) {
10
+ margin-inline: auto;
11
+ max-width: $w;
12
+ }
13
+
14
+ // Create columns with even vertical spacing
15
+ @mixin afu-vertical-gap($gap: 20px) {
16
+ display: flex;
17
+ flex-direction: column;
18
+ gap: $gap;
19
+ }
20
+
21
+ // Set an image element to object fit
22
+ @mixin afu-image-size($type: cover) {
23
+ height: 100%;
24
+ object-fit: $type;
25
+ width: 100%;
26
+ }
27
+
28
+ // Truncate text to specific lines
29
+ @mixin afu-truncate-text-lines($lines) {
30
+ -webkit-box-orient: vertical;
31
+ display: -webkit-box;
32
+ -webkit-line-clamp: $lines;
33
+ overflow: hidden;
34
+ text-overflow: ellipsis;
35
+ }
@@ -0,0 +1,23 @@
1
+ @mixin list-inline($li-margin-right: 0.5rem) {
2
+ padding-left: 0;
3
+ list-style: none;
4
+
5
+ li {
6
+ display: inline-block;
7
+
8
+ &:not(:last-child) {
9
+ margin-right: $li-margin-right;
10
+ }
11
+ }
12
+ }
13
+
14
+ // Set elements in row with gap
15
+ // Better use this than just list-inline
16
+ @mixin afu-list-inline-flex($gap) {
17
+ padding-left: 0;
18
+ list-style: none;
19
+ align-items: center;
20
+ display: flex;
21
+ flex-wrap: wrap;
22
+ gap: $gap;
23
+ }
@@ -0,0 +1,24 @@
1
+ @mixin position-fill($position: absolute) {
2
+ height: 100%;
3
+ left: 0;
4
+ position: $position;
5
+ top: 0;
6
+ width: 100%;
7
+ }
8
+
9
+ // Position the element absolutely centered.
10
+ @mixin position-absolute-center() {
11
+ left: 50%;
12
+ position: absolute;
13
+ top: 50%;
14
+ transform: translateX(-50%) translateY(-50%);
15
+ }
16
+
17
+ // Similar to Bootstrap's fixed top, but with optional position.
18
+ @mixin position-top($position, $zindex: 1030) {
19
+ left: 0;
20
+ position: $position;
21
+ right: 0;
22
+ top: 0;
23
+ z-index: $zindex;
24
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "require": {
3
+ "airfleet/wordpress-framework": "^1.5.0"
4
+ },
5
+ "config": {
6
+ "autoloader-suffix": "<%= name.pascal %>"
7
+ }
8
+ }
@@ -0,0 +1,124 @@
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": "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
+ }
@@ -0,0 +1,52 @@
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": "^3.2.0",
16
+ "wpify/scoper": "2.5.4"
17
+ },
18
+ "autoload": {
19
+ "psr-4": {
20
+ "Airfleet\\Plugins\\<%= nameNoAirfleet.pascal %>\\": "inc/"
21
+ }
22
+ },
23
+ "scripts": {
24
+ "lint": "phpcs",
25
+ "fix": "phpcbf",
26
+ "install-codestandards": [
27
+ "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin::run"
28
+ ],
29
+ "post-install-cmd": [
30
+ "@install-codestandards"
31
+ ]
32
+ },
33
+ "config": {
34
+ "allow-plugins": {
35
+ "composer/installers": true,
36
+ "dealerdirect/phpcodesniffer-composer-installer": true,
37
+ "wpify/scoper": true
38
+ }
39
+ },
40
+ "extra": {
41
+ "wpify-scoper": {
42
+ "prefix": "Airfleet\\Plugins\\<%= nameNoAirfleet.pascal %>\\Vendor",
43
+ "folder": "vendor-scoped",
44
+ "globals": [
45
+ "wordpress"
46
+ ],
47
+ "composerjson": "composer-scoped.json",
48
+ "composerlock": "composer-scoped.lock"
49
+ }
50
+ },
51
+ "minimum-stability": "dev"
52
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "name": "Design Tokens",
3
+ "collections": {},
4
+ "styles": {}
5
+ }
@@ -0,0 +1,15 @@
1
+ node_modules
2
+ coverage
3
+ .npmrc
4
+ vendor
5
+ dist
6
+ .parcel-cache
7
+ .eslintcache
8
+ .stylelintcache
9
+ .phpcscache
10
+ .composer-cache
11
+ .env
12
+ vendor-scoped
13
+ wp-content
14
+ .DS_Store
15
+ .idea
@@ -0,0 +1,22 @@
1
+ <?php
2
+
3
+ namespace Airfleet\Plugins\<%= nameNoAirfleet.pascal %>\Features;
4
+
5
+ use Airfleet\Plugins\<%= nameNoAirfleet.pascal %>\Vendor\Airfleet\Framework\Features\Feature;
6
+
7
+ class Menus implements Feature {
8
+ public function initialize(): void {
9
+ add_action(
10
+ 'after_setup_theme',
11
+ function () {
12
+ register_nav_menus(
13
+ [
14
+ 'main-menu' => __( 'Main Menu', 'airfleet' ),
15
+ 'footer-menu' => __( 'Footer Menu', 'airfleet' ),
16
+ 'privacy-menu' => __( 'Privacy Menu', 'airfleet' ),
17
+ ]
18
+ );
19
+ }
20
+ );
21
+ }
22
+ }
@@ -0,0 +1,22 @@
1
+ <?php
2
+
3
+ namespace Airfleet\Plugins\<%= nameNoAirfleet.pascal %>\Setup;
4
+
5
+ use Airfleet\Plugins\<%= nameNoAirfleet.pascal %>\Vendor\Airfleet\Framework\Assets\FrontendVariables;
6
+
7
+ class AjaxVariables extends FrontendVariables {
8
+ public function __construct() {
9
+ parent::__construct(
10
+ [
11
+ 'slug' => \<%= name.constant %>_SLUG,
12
+ 'name' => '_<%= name.camel %>',
13
+ 'variables' => function (): array {
14
+ return [
15
+ 'ajaxUrl' => admin_url( 'admin-ajax.php' ),
16
+ 'ajaxNonce' => wp_create_nonce( '<%= name.camel %>Nonce' ),
17
+ ];
18
+ },
19
+ ]
20
+ );
21
+ }
22
+ }
@@ -0,0 +1,22 @@
1
+ <?php
2
+
3
+ namespace Airfleet\Plugins\<%= nameNoAirfleet.pascal %>\Setup;
4
+
5
+ use Airfleet\Plugins\<%= nameNoAirfleet.pascal %>\Vendor\Airfleet\Framework\Assets\AdminVariables;
6
+
7
+ class AjaxVariablesAdmin extends AdminVariables {
8
+ public function __construct() {
9
+ parent::__construct(
10
+ [
11
+ 'slug' => \<%= name.constant %>_SLUG,
12
+ 'name' => '_<%= name.camel %>',
13
+ 'variables' => function (): array {
14
+ return [
15
+ 'ajaxUrl' => admin_url( 'admin-ajax.php' ),
16
+ 'ajaxNonce' => wp_create_nonce( '<%= name.camel %>Nonce' ),
17
+ ];
18
+ },
19
+ ]
20
+ );
21
+ }
22
+ }
@@ -0,0 +1,18 @@
1
+ <?php
2
+
3
+ namespace Airfleet\Plugins\<%= nameNoAirfleet.pascal %>\Setup;
4
+
5
+ use Airfleet\Plugins\<%= nameNoAirfleet.pascal %>\Vendor\Airfleet\Framework\Features\Feature;
6
+
7
+ class Breakpoints implements Feature {
8
+ public function initialize(): void {
9
+ add_filter(
10
+ 'airfleet/elements/breakpoints',
11
+ function ( $breakpoints ): array {
12
+ // ? Customize breakpoints. See https://www.notion.so/codersclan/Breakpoints-filter-40496c68b30543c3ae78bfcbe5193f4b
13
+ // ! If you update this, you should also update mixins/_breakpoints.scss
14
+ return $breakpoints;
15
+ }
16
+ );
17
+ }
18
+ }
@@ -0,0 +1,17 @@
1
+ <?php
2
+
3
+ namespace Airfleet\Plugins\<%= nameNoAirfleet.pascal %>\Setup;
4
+
5
+ use Airfleet\Plugins\<%= nameNoAirfleet.pascal %>\Vendor\Airfleet\Framework\Features\Feature;
6
+
7
+ class Colors implements Feature {
8
+ public function initialize(): void {
9
+ add_filter(
10
+ 'airfleet/elements/colors',
11
+ function ( $colors ): array {
12
+ // ? Customize colors. See https://www.notion.so/codersclan/Colors-filter-5f5ed8f4b8f647fdb76bd8494fe5a217
13
+ return $colors;
14
+ }
15
+ );
16
+ }
17
+ }
@@ -0,0 +1,64 @@
1
+ <?php
2
+
3
+ namespace Airfleet\Plugins\<%= nameNoAirfleet.pascal %>\Setup;
4
+
5
+ use Airfleet\Plugins\<%= nameNoAirfleet.pascal %>\Vendor\Airfleet\Framework\Features\BasePluginFeature;
6
+
7
+ class RegisterViews extends BasePluginFeature {
8
+ public function initialize(): void {
9
+ add_filter(
10
+ 'airfleet/views/config',
11
+ function ( array $views ): array {
12
+ // Views
13
+ $views[] = [
14
+ 'namespace' => 'Airfleet\\Plugins\\<%= nameNoAirfleet.pascal %>\\Views',
15
+ 'path' => \<%= name.constant %>_PATH . DIRECTORY_SEPARATOR . 'views',
16
+ 'version' => \<%= name.constant %>_VERSION,
17
+ 'url' => \<%= name.constant %>_URL . '/views',
18
+ 'source' => \<%= name.constant %>_SLUG,
19
+ 'prefix' => '',
20
+ 'priority' => 99,
21
+ 'enqueue' => false,
22
+ ];
23
+
24
+ // Register dist folder for compiled assets
25
+ $views[] = [
26
+ 'namespace' => 'Airfleet\\Plugins\\<%= nameNoAirfleet.pascal %>\\Views',
27
+ 'path' => \<%= name.constant %>_PATH . DIRECTORY_SEPARATOR . 'dist' . DIRECTORY_SEPARATOR . 'views',
28
+ 'version' => \<%= name.constant %>_VERSION,
29
+ 'url' => \<%= name.constant %>_URL . '/dist/views',
30
+ 'source' => \<%= name.constant %>_SLUG,
31
+ 'prefix' => '',
32
+ 'priority' => 99,
33
+ 'enqueue_only' => true,
34
+ ];
35
+
36
+ // Views Elements
37
+ $views[] = [
38
+ 'namespace' => 'Airfleet\\Plugins\\<%= nameNoAirfleet.pascal %>\\ViewsElements',
39
+ 'path' => \<%= name.constant %>_PATH . DIRECTORY_SEPARATOR . 'views-elements',
40
+ 'version' => \<%= name.constant %>_VERSION,
41
+ 'url' => \<%= name.constant %>_URL . '/views-elements',
42
+ 'source' => \<%= name.constant %>_SLUG,
43
+ 'prefix' => 'elements',
44
+ 'priority' => 99,
45
+ 'enqueue' => false,
46
+ ];
47
+
48
+ // Register dist folder for compiled assets
49
+ $views[] = [
50
+ 'namespace' => 'Airfleet\\Plugins\\<%= nameNoAirfleet.pascal %>\\ViewsElements',
51
+ 'path' => \<%= name.constant %>_PATH . DIRECTORY_SEPARATOR . 'dist' . DIRECTORY_SEPARATOR . 'views-elements',
52
+ 'version' => \<%= name.constant %>_VERSION,
53
+ 'url' => \<%= name.constant %>_URL . '/dist/views-elements',
54
+ 'source' => \<%= name.constant %>_SLUG,
55
+ 'prefix' => 'elements',
56
+ 'priority' => 99,
57
+ 'enqueue_only' => true,
58
+ ];
59
+
60
+ return $views;
61
+ }
62
+ );
63
+ }
64
+ }
@@ -0,0 +1,30 @@
1
+ <?php
2
+
3
+ namespace Airfleet\Plugins\<%= nameNoAirfleet.pascal %>;
4
+
5
+ use Airfleet\Plugins\<%= nameNoAirfleet.pascal %>\Features\Menus;
6
+ use Airfleet\Plugins\<%= nameNoAirfleet.pascal %>\Setup\AjaxVariables;
7
+ use Airfleet\Plugins\<%= nameNoAirfleet.pascal %>\Setup\AjaxVariablesAdmin;
8
+ use Airfleet\Plugins\<%= nameNoAirfleet.pascal %>\Setup\Breakpoints;
9
+ use Airfleet\Plugins\<%= nameNoAirfleet.pascal %>\Setup\Colors;
10
+ use Airfleet\Plugins\<%= nameNoAirfleet.pascal %>\Setup\RegisterViews;
11
+ use Airfleet\Plugins\<%= nameNoAirfleet.pascal %>\Vendor\Airfleet\Framework\Acf\LocalJsonCategorized;
12
+ use Airfleet\Plugins\<%= nameNoAirfleet.pascal %>\Vendor\Airfleet\Framework\Assets\Enqueue;
13
+ use Airfleet\Plugins\<%= nameNoAirfleet.pascal %>\Vendor\Airfleet\Framework\Features\Features;
14
+
15
+ class Setup extends Features {
16
+ public function __construct( array $config ) {
17
+ parent::__construct(
18
+ [
19
+ new LocalJsonCategorized( $config['path'] . 'acf-json' ),
20
+ new Enqueue( $config ),
21
+ new AjaxVariables(),
22
+ new AjaxVariablesAdmin(),
23
+ new RegisterViews(),
24
+ new Breakpoints(),
25
+ new Colors(),
26
+ new Menus(),
27
+ ]
28
+ );
29
+ }
30
+ }
@@ -0,0 +1 @@
1
+ <?php // Silence is golden