@airfleet/generator-init 0.20.10 → 0.20.12

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.
@@ -140,6 +140,7 @@ export default class extends Generator {
140
140
  ajaxVariables: this.ajaxVariables,
141
141
  optionsPage: this.optionsPage,
142
142
  viewsPrefix: this.viewsPrefix,
143
+ phpVersion: this._getPhpVersion(this.answers.pluginPhpVersion),
143
144
  };
144
145
  }
145
146
 
@@ -249,4 +250,18 @@ export default class extends Generator {
249
250
  }
250
251
  }
251
252
 
253
+ _getPhpVersion(pluginPhpVersion) {
254
+ const toFind = ['=','>'];
255
+
256
+ for (const char of toFind) {
257
+ const index = pluginPhpVersion.indexOf(char);
258
+
259
+ if (index >= 0) {
260
+ return pluginPhpVersion.substring(index + 1);
261
+ }
262
+ }
263
+
264
+ return pluginPhpVersion;
265
+ }
266
+
252
267
  }
@@ -12,6 +12,7 @@
12
12
  * Plugin URI: <%= answers.pluginDocumentationUrl %>
13
13
  * Description: <%= answers.pluginDescription %>
14
14
  * Version: <%= answers.pluginVersion %>
15
+ * Requires PHP: <%= phpVersion %>
15
16
  * Author: Airfleet
16
17
  * Author URI: https://www.airfleet.co/
17
18
  * Text Domain: <%= name.slug %>
@@ -4,18 +4,12 @@ import './<%= stylesheet %>';
4
4
  <% } _%>
5
5
  export class <%= name.pascal %> {
6
6
  initialize() {
7
- this.onReady(() => {
7
+ const { domReady } = window._airfleet.elements.core;
8
+
9
+ domReady(() => {
8
10
  // TODO
9
11
  });
10
12
  }
11
-
12
- onReady(callBack) {
13
- if (document.readyState === 'loading') {
14
- document.addEventListener('DOMContentLoaded', callBack);
15
- } else {
16
- callBack();
17
- }
18
- };
19
13
  }
20
14
 
21
15
  new <%= name.pascal %>().initialize();
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.20.10",
4
+ "version": "0.20.12",
5
5
  "scripts": {},
6
6
  "publishConfig": {
7
7
  "access": "public"