@airfleet/generator-init 0.9.0 → 0.11.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.
@@ -1,6 +1,6 @@
1
1
  # <%= answers.npmTitle %>
2
2
 
3
- ![npm](https://img.shields.io/npm/v/<%= packageName %>)
3
+ [![npm](https://img.shields.io/npm/v/<%= packageName %>)](https://www.npmjs.com/package/<%= packageName %>)
4
4
  [![pipeline status](<%= repositoryBase %>/badges/main/pipeline.svg)](<%= repositoryBase %>/-/commits/main)
5
5
 
6
6
  <%= answers.npmDescription %>
@@ -117,7 +117,9 @@ export default class extends Generator {
117
117
  "assets/admin/styles/admin.scss",
118
118
  "assets/frontend/fonts/.gitkeep",
119
119
  "assets/frontend/images/.gitkeep",
120
+ "assets/frontend/scripts/critical.entry.js",
120
121
  "assets/frontend/scripts/index.entry.js",
122
+ "assets/frontend/styles/critical.scss",
121
123
  "assets/frontend/styles/index.scss",
122
124
  "inc/Setup.php.ejs",
123
125
  ".airfleet-release",
@@ -142,6 +144,11 @@ export default class extends Generator {
142
144
  destination: `.gitignore`,
143
145
  isEnabled: true,
144
146
  },
147
+ {
148
+ template: ".husky/gitignore",
149
+ destination: `.husky/.gitignore`,
150
+ isEnabled: true,
151
+ },
145
152
  {
146
153
  template: "plugin-name.php.ejs",
147
154
  destination: `${this.name.slug}.php`,
@@ -1,6 +1,7 @@
1
1
  stages:
2
2
  - test
3
3
  - release
4
+ - upload
4
5
 
5
6
  include:
6
7
  # Test
@@ -0,0 +1 @@
1
+ import "../styles/critical.scss";
@@ -14,26 +14,36 @@ class Setup {
14
14
  add_action(
15
15
  'airfleet/init',
16
16
  function () {
17
- $plugin = new \Airfleet\Plugin(
18
- [
19
- 'slug' => '<%= name.slug %>',
20
- 'title' => '<%= name.title %>',
21
- 'short_title' => '<%= nameNoAirfleet.title %>',
22
- 'url' => \<%= name.constant %>_URL,
23
- 'path' => \<%= name.constant %>_PATH,
24
- 'version' => \<%= name.constant %>_VERSION,
25
- ]
26
- );
27
- $plugin->setup_acf_json();
28
- $plugin->enqueue();
29
- $plugin->enqueue_admin();
30
- <%_ if (answers.pluginCreateOptions) { _%>
31
- $plugin->add_options_page();
32
- <%_ } _%>
17
+ $this->plugin_basic_setup();
33
18
  }
34
19
  );
35
20
  }
36
21
 
22
+ /**
23
+ * Basic setup for the plugin. Enqueue assets and add options page
24
+ *
25
+ * @return void
26
+ */
27
+ public function plugin_basic_setup(): void {
28
+ $plugin = new \Airfleet\Plugin(
29
+ [
30
+ 'slug' => '<%= name.slug %>',
31
+ 'title' => '<%= name.title %>',
32
+ 'short_title' => '<%= nameNoAirfleet.title %>',
33
+ 'url' => \<%= name.constant %>_URL,
34
+ 'path' => \<%= name.constant %>_PATH,
35
+ 'version' => \<%= name.constant %>_VERSION,
36
+ ]
37
+ );
38
+ $plugin->setup_acf_json();
39
+ $plugin->enqueue();
40
+ $plugin->enqueue_critical();
41
+ $plugin->enqueue_admin();
42
+ <%_ if (answers.pluginCreateOptions) { _%>
43
+ $plugin->add_options_page();
44
+ <%_ } _%>
45
+ }
46
+
37
47
  /**
38
48
  * Show and admin notification if the Airfleet Framework plugin is not enabled.
39
49
  *
@@ -42,7 +42,7 @@
42
42
  },
43
43
  "dependencies": {},
44
44
  "devDependencies": {
45
- "@airfleet/wordpress-dev": "^0.3.1"
45
+ "@airfleet/wordpress-dev": "^0.3.2"
46
46
  },
47
47
  "browserslist": [
48
48
  "defaults",
@@ -26,7 +26,7 @@ if ( ! defined( 'ABSPATH' ) ) {
26
26
  die;
27
27
  }
28
28
 
29
- // Plugin version.
29
+ // Plugin constants.
30
30
  define( '<%= name.constant %>_VERSION', '<%= answers.pluginVersion %>' );
31
31
  define( '<%= name.constant %>_PATH', plugin_dir_path( __FILE__ ) );
32
32
  define( '<%= name.constant %>_URL', plugin_dir_url( __FILE__ ) );
@@ -41,6 +41,6 @@ $<%= name.snake %>->initialize();
41
41
  /**
42
42
  * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
43
43
  * ! Do not make changes to this file.
44
- * ! Edit the plugin class in folder src/.
44
+ * ! Edit the plugin class in folder inc/.
45
45
  * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
46
46
  */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@airfleet/generator-init",
3
3
  "description": "A Yeoman generator to scaffold common Airfleet features",
4
- "version": "0.9.0",
4
+ "version": "0.11.0",
5
5
  "scripts": {},
6
6
  "publishConfig": {
7
7
  "access": "public"