@airfleet/generator-init 0.17.0 → 0.17.2

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.
@@ -166,18 +166,38 @@ jobs:
166
166
  # Reference https://trentm.com/json/
167
167
  run: |
168
168
  NL=$'\n'
169
+ echo "Plugins current:"
170
+ cat $RUNNER_TEMP/plugins.json | json
171
+ echo "$NL $NL $NL"
169
172
  PLUGIN_SLUG=$(cat $RUNNER_TEMP/plugin.json | json slug)
170
173
  echo "Plugin slug: $PLUGIN_SLUG"
171
- PLUGIN_VERSIONS=$(echo "$(cat $RUNNER_TEMP/plugin.json | json versions)${NL}$(cat $RUNNER_TEMP/plugins.json | json plugins | json -c "this.slug === '$PLUGIN_SLUG'" | json 0.versions)" | json --group)
174
+ echo "$NL $NL $NL"
172
175
  echo "Plugin versions:"
173
- echo $PLUGIN_VERSIONS | json
174
- PLUGIN_UPDATED=$(echo "$(cat $RUNNER_TEMP/plugins.json | json plugins | json -c "this.slug === '$PLUGIN_SLUG'" | json 0)${NL}$(cat $RUNNER_TEMP/plugin.json | json)" | json --merge | json -e "this.versions = $PLUGIN_VERSIONS" | json)
176
+ cat $RUNNER_TEMP/plugin.json | json versions > $RUNNER_TEMP/plugin_new_version.json
177
+ cat $RUNNER_TEMP/plugins.json | json plugins | json -c "this.slug === '$PLUGIN_SLUG'" | json 0.versions > $RUNNER_TEMP/plugin_existing_versions.json
178
+ cat $RUNNER_TEMP/plugin_new_version.json $RUNNER_TEMP/plugin_existing_versions.json | json --group > $RUNNER_TEMP/plugin_versions.json
179
+ printf '%s\n%s\n%s\n' '{"versions":' "$(cat $RUNNER_TEMP/plugin_versions.json)" '}' | json > $RUNNER_TEMP/plugin_versions_final.json
180
+ cat $RUNNER_TEMP/plugin_versions_final.json
181
+ echo "$NL $NL $NL"
175
182
  echo "Plugin updated:"
176
- echo $PLUGIN_UPDATED | json
177
- PLUGINS_LIST_UPDATED=$(echo "$(cat $RUNNER_TEMP/plugins.json | json plugins | json -c "this.slug !== '$PLUGIN_SLUG'")${NL}$(echo $(echo $PLUGIN_UPDATED) | json --group)" | json --group)
183
+ cat $RUNNER_TEMP/plugins.json | json plugins | json -c "this.slug === '$PLUGIN_SLUG'" | json 0 > $RUNNER_TEMP/plugin_existing.json
184
+ cat $RUNNER_TEMP/plugin.json | json > $RUNNER_TEMP/plugin_formatted.json
185
+ cat $RUNNER_TEMP/plugin_existing.json $RUNNER_TEMP/plugin_formatted.json $RUNNER_TEMP/plugin_versions_final.json | json --merge | json > $RUNNER_TEMP/plugin_updated.json
186
+ cat $RUNNER_TEMP/plugin_updated.json
187
+ echo "$NL $NL $NL"
178
188
  echo "Plugins list updated:"
179
- echo $PLUGINS_LIST_UPDATED | json
180
- cat $RUNNER_TEMP/plugins.json | json -e "this.plugins = $PLUGINS_LIST_UPDATED" | json > $RUNNER_TEMP/plugins_updated.json
189
+ cat $RUNNER_TEMP/plugins.json | json plugins | json -c "this.slug !== '$PLUGIN_SLUG'" > $RUNNER_TEMP/plugins_list_excluded.json
190
+ cat $RUNNER_TEMP/plugin_updated.json | json --group > $RUNNER_TEMP/plugins_list_added.json
191
+ cat $RUNNER_TEMP/plugins_list_excluded.json $RUNNER_TEMP/plugins_list_added.json | json --group > $RUNNER_TEMP/plugins_list_updated.json
192
+ cat $RUNNER_TEMP/plugins_list_updated.json
193
+ echo "$NL $NL $NL"
194
+ echo "Plugins updated:"
195
+ printf '%s\n%s\n%s\n' '{"plugins":' "$(cat $RUNNER_TEMP/plugins_list_updated.json)" '}' | json > $RUNNER_TEMP/plugins_new.json
196
+ cat $RUNNER_TEMP/plugins_new.json
197
+ echo "$NL $NL $NL"
198
+ echo "Final merge:"
199
+ cat $RUNNER_TEMP/plugins.json $RUNNER_TEMP/plugins_new.json | json --merge > $RUNNER_TEMP/plugins_updated.json
200
+ cat $RUNNER_TEMP/plugins_updated.json
181
201
 
182
202
  - name: 🚀 Upload updated plugins list to AWS
183
203
  run: |
@@ -20,25 +20,27 @@ class Setup extends PluginFeatures {
20
20
  <%_ if (optionsPage === 'framework' ) { _%>
21
21
  $options = new Options();
22
22
  <%_ } _%>
23
- $this->features = [
24
- new Enqueue( $config ),
25
- <%_ if (optionsPage === 'framework' ) { _%>
26
- new Pages( $options ),
27
- new SettingsLink( $config ),
28
- <%_ } _%>
29
- <%_ if (optionsPage === 'acf' ) { _%>
30
- new AcfAirfleetOptionsSubPage( $config ),
31
- new AcfSettingsLink( $config ),
32
- <%_ } _%>
33
- <%_ if (ajaxVariables.frontend) { _%>
34
- new AjaxVariables(),
35
- <%_ } _%>
36
- <%_ if (ajaxVariables.admin) { _%>
37
- new AjaxVariablesAdmin(),
38
- <%_ } _%>
39
- <%_ if (answers.pluginAcfLocalJson) { _%>
40
- new LocalJson( $config['path'] . 'acf-json' ),
41
- <%_ } _%>
42
- ];
23
+ parent::__construct(
24
+ [
25
+ new Enqueue( $config ),
26
+ <%_ if (optionsPage === 'framework' ) { _%>
27
+ new Pages( $options ),
28
+ new SettingsLink( $config ),
29
+ <%_ } _%>
30
+ <%_ if (optionsPage === 'acf' ) { _%>
31
+ new AcfAirfleetOptionsSubPage( $config ),
32
+ new AcfSettingsLink( $config ),
33
+ <%_ } _%>
34
+ <%_ if (ajaxVariables.frontend) { _%>
35
+ new AjaxVariables(),
36
+ <%_ } _%>
37
+ <%_ if (ajaxVariables.admin) { _%>
38
+ new AjaxVariablesAdmin(),
39
+ <%_ } _%>
40
+ <%_ if (answers.pluginAcfLocalJson) { _%>
41
+ new LocalJson( $config['path'] . 'acf-json' ),
42
+ <%_ } _%>
43
+ ]
44
+ );
43
45
  }
44
46
  }
@@ -55,7 +55,7 @@ $<%= name.snake %> = new \Airfleet\Plugins\<%= nameNoAirfleet.pascal %>\Setup(
55
55
  );
56
56
  register_activation_hook( __FILE__, [ $<%= name.snake %>, 'on_activation' ] );
57
57
  register_deactivation_hook( __FILE__, [ $<%= name.snake %>, 'on_deactivation' ] );
58
- register_uninstall_hook( __FILE__, [ '\Airfleet\Plugins\<%= nameNoAirfleet.pascal %>\Setup', 'uninstall' ] );
58
+ register_uninstall_hook( __FILE__, '\Airfleet\Plugins\<%= nameNoAirfleet.pascal %>\Setup::uninstall' );
59
59
  $<%= name.snake %>->initialize();
60
60
 
61
61
  /**
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.17.0",
4
+ "version": "0.17.2",
5
5
  "scripts": {},
6
6
  "publishConfig": {
7
7
  "access": "public"