@airfleet/generator-init 0.6.0 → 0.7.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.
- package/generators/plugin/index.js +8 -2
- package/generators/plugin/templates/.env +1 -0
- package/generators/plugin/templates/.parcelrc +4 -0
- package/generators/plugin/templates/assets/admin/scripts/admin.entry.js +1 -0
- package/generators/plugin/templates/assets/{styles/index.scss → admin/styles/admin.scss} +0 -0
- package/generators/plugin/templates/assets/frontend/fonts/.gitkeep +0 -0
- package/generators/plugin/templates/assets/frontend/images/.gitkeep +0 -0
- package/generators/plugin/templates/assets/frontend/scripts/index.entry.js +5 -0
- package/generators/plugin/templates/assets/frontend/styles/index.scss +0 -0
- package/generators/plugin/templates/gitignore +1 -0
- package/generators/plugin/templates/inc/Setup.php.ejs +66 -17
- package/generators/plugin/templates/package.json.ejs +4 -3
- package/package.json +1 -1
- package/generators/plugin/templates/assets/scripts/index.js +0 -1
|
@@ -112,13 +112,19 @@ export default class extends Generator {
|
|
|
112
112
|
".husky/.gitignore",
|
|
113
113
|
".husky/pre-commit",
|
|
114
114
|
".vscode/settings.json",
|
|
115
|
-
"assets/scripts/
|
|
116
|
-
"assets/styles/
|
|
115
|
+
"assets/admin/scripts/admin.entry.js",
|
|
116
|
+
"assets/admin/styles/admin.scss",
|
|
117
|
+
"assets/frontend/fonts/.gitkeep",
|
|
118
|
+
"assets/frontend/images/.gitkeep",
|
|
119
|
+
"assets/frontend/scripts/index.entry.js",
|
|
120
|
+
"assets/frontend/styles/index.scss",
|
|
117
121
|
"inc/Setup.php.ejs",
|
|
118
122
|
".airfleet-release",
|
|
119
123
|
".editorconfig",
|
|
124
|
+
".env",
|
|
120
125
|
".gitattributes",
|
|
121
126
|
".gitlab-ci.yml",
|
|
127
|
+
".parcelrc",
|
|
122
128
|
".prettierignore",
|
|
123
129
|
"CHANGELOG.md",
|
|
124
130
|
"composer.json.ejs",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
PARCEL_WORKER_BACKEND=process
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../styles/admin.scss";
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -11,8 +11,55 @@ class Setup {
|
|
|
11
11
|
*/
|
|
12
12
|
public function initialize() {
|
|
13
13
|
<%_ if (answers.pluginCreateOptions) { _%>
|
|
14
|
-
|
|
14
|
+
$this->add_option_pages();
|
|
15
15
|
<%_ } _%>
|
|
16
|
+
$this->enqueue();
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Enqueue the scripts and styles.
|
|
21
|
+
*
|
|
22
|
+
* @return void
|
|
23
|
+
*/
|
|
24
|
+
public function enqueue() {
|
|
25
|
+
$version = <%= name.constant %>_VERSION;
|
|
26
|
+
|
|
27
|
+
add_action(
|
|
28
|
+
'wp_enqueue_scripts',
|
|
29
|
+
function () use ( $version ) {
|
|
30
|
+
wp_enqueue_style(
|
|
31
|
+
'<%= name.slug %>-styles',
|
|
32
|
+
plugins_url( '/dist/frontend/scripts/index.entry.css', __DIR__ ),
|
|
33
|
+
[],
|
|
34
|
+
$version
|
|
35
|
+
);
|
|
36
|
+
wp_enqueue_script(
|
|
37
|
+
'<%= name.slug %>-scripts',
|
|
38
|
+
plugins_url( '/dist/frontend/scripts/index.entry.js', __DIR__ ),
|
|
39
|
+
[],
|
|
40
|
+
$version,
|
|
41
|
+
true
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
add_action(
|
|
46
|
+
'admin_enqueue_scripts',
|
|
47
|
+
function () use ( $version ) {
|
|
48
|
+
wp_enqueue_style(
|
|
49
|
+
'<%= name.slug %>-admin-styles',
|
|
50
|
+
plugins_url( '/dist/admin/scripts/admin.entry.css', __DIR__ ),
|
|
51
|
+
[],
|
|
52
|
+
$version
|
|
53
|
+
);
|
|
54
|
+
wp_enqueue_script(
|
|
55
|
+
'<%= name.slug %>-admin-scripts',
|
|
56
|
+
plugins_url( '/dist/admin/scripts/admin.entry.js', __DIR__ ),
|
|
57
|
+
[],
|
|
58
|
+
$version,
|
|
59
|
+
true
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
);
|
|
16
63
|
}
|
|
17
64
|
<%_ if (answers.pluginCreateOptions) {%>
|
|
18
65
|
/**
|
|
@@ -21,22 +68,24 @@ class Setup {
|
|
|
21
68
|
* @return void
|
|
22
69
|
*/
|
|
23
70
|
public function add_option_pages() {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
71
|
+
add_action(
|
|
72
|
+
'acf/init',
|
|
73
|
+
function () {
|
|
74
|
+
\acf_add_options_page(
|
|
75
|
+
[
|
|
76
|
+
'page_title' => __( 'Airfleet Theme Settings', 'airfleet' ),
|
|
77
|
+
'menu_title' => __( 'Airfleet', 'airfleet' ),
|
|
78
|
+
'menu_slug' => 'airfleet-settings',
|
|
79
|
+
]
|
|
80
|
+
);
|
|
81
|
+
\acf_add_options_sub_page(
|
|
82
|
+
[
|
|
83
|
+
'page_title' => __( '<%= name.title %> Settings', '<%= name.slug %>' ),
|
|
84
|
+
'menu_title' => __( '<%= nameNoAirfleet.title %>', '<%= name.slug %>' ),
|
|
85
|
+
'parent_slug' => 'airfleet-settings',
|
|
86
|
+
]
|
|
87
|
+
);
|
|
88
|
+
}
|
|
40
89
|
);
|
|
41
90
|
}
|
|
42
91
|
<% } _%>
|
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
"description": "<%= answers.pluginDescription %>",
|
|
4
4
|
"version": "<%= answers.pluginVersion %>",
|
|
5
5
|
"scripts": {
|
|
6
|
-
"build": "
|
|
7
|
-
"
|
|
6
|
+
"build": "dotenv -- parcel build --log-level verbose ./assets/**/*.entry.js",
|
|
7
|
+
"start": "dotenv -- parcel serve --hmr-port 1236 --port 1234 --log-level verbose ./assets/**/*.entry.js",
|
|
8
|
+
"base:eslint": "eslint assets --ext .js,.jsx --cache --ignore-path .gitignore",
|
|
8
9
|
"base:prettier": "prettier \"**/*.{js,jsx,ts,tsx,json,css,scss,xml,yaml,yml,md}\"",
|
|
9
10
|
"base:stylelint": "stylelint \"**/*.{css,scss}\" --cache --ignore-path .gitignore",
|
|
10
11
|
"lint": "run-s --continue-on-error lint:*",
|
|
@@ -41,7 +42,7 @@
|
|
|
41
42
|
},
|
|
42
43
|
"dependencies": {},
|
|
43
44
|
"devDependencies": {
|
|
44
|
-
"@airfleet/wordpress-dev": "^0.
|
|
45
|
+
"@airfleet/wordpress-dev": "^0.3.0"
|
|
45
46
|
},
|
|
46
47
|
"browserslist": [
|
|
47
48
|
"defaults",
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/* eslint-disable unicorn/no-empty-file */
|