@airfleet/generator-init 0.2.0 → 0.5.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 (35) hide show
  1. package/README.md +2 -0
  2. package/generators/block/index.js +72 -3
  3. package/generators/block/templates/acf/{group.json.ejs → barebones.json.ejs} +0 -0
  4. package/generators/block/templates/acf/building-block.json.ejs +348 -0
  5. package/generators/block/templates/acf/building-repeater-block.json.ejs +547 -0
  6. package/generators/block/templates/{block.blade.php.ejs → barebones.blade.php.ejs} +2 -2
  7. package/generators/block/templates/building-block.blade.php.ejs +20 -0
  8. package/generators/block/templates/building-repeater-block.blade.php.ejs +52 -0
  9. package/generators/component/index.js +1 -1
  10. package/generators/npm/index.js +110 -0
  11. package/generators/npm/templates/.airfleet-release +1 -0
  12. package/generators/npm/templates/.editorconfig +18 -0
  13. package/generators/npm/templates/.gitattributes +11 -0
  14. package/generators/npm/templates/.gitlab-ci.yml +8 -0
  15. package/generators/npm/templates/CHANGELOG.md +10 -0
  16. package/generators/npm/templates/LICENSE.ejs +2 -0
  17. package/generators/npm/templates/README.md.ejs +20 -0
  18. package/generators/npm/templates/package.json.ejs +27 -0
  19. package/generators/plugin/index.js +144 -0
  20. package/generators/plugin/templates/.airfleet-release +1 -0
  21. package/generators/plugin/templates/.editorconfig +18 -0
  22. package/generators/plugin/templates/.gitattributes +11 -0
  23. package/generators/plugin/templates/.gitlab-ci.yml +8 -0
  24. package/generators/plugin/templates/CHANGELOG.md +10 -0
  25. package/generators/plugin/templates/LICENSE.ejs +2 -0
  26. package/generators/plugin/templates/README.md.ejs +20 -0
  27. package/generators/plugin/templates/composer.json.ejs +19 -0
  28. package/generators/plugin/templates/index.php +1 -0
  29. package/generators/plugin/templates/package.json.ejs +27 -0
  30. package/generators/plugin/templates/plugin-name.php.ejs +44 -0
  31. package/generators/plugin/templates/src/Plugin.php.ejs +45 -0
  32. package/package.json +1 -5
  33. package/utils/acfData.js +5 -2
  34. package/utils/mapFilesToTemplates.js +13 -0
  35. package/utils/nameCases.js +9 -1
@@ -0,0 +1,547 @@
1
+ {
2
+ "key": "<%= acf.key %>",
3
+ "title": "Block: <%= name.title %>",
4
+ "fields": [
5
+ {
6
+ "key": "<%= acf.fields.headerTab %>",
7
+ "label": "Header",
8
+ "name": "",
9
+ "type": "tab",
10
+ "instructions": "",
11
+ "required": 0,
12
+ "conditional_logic": 0,
13
+ "wrapper": {
14
+ "width": "",
15
+ "class": "",
16
+ "id": ""
17
+ },
18
+ "placement": "left",
19
+ "endpoint": 0
20
+ },
21
+ {
22
+ "key": "<%= acf.fields.headerGroup %>",
23
+ "label": "Header",
24
+ "name": "header",
25
+ "type": "group",
26
+ "instructions": "",
27
+ "required": 0,
28
+ "conditional_logic": 0,
29
+ "wrapper": {
30
+ "width": "",
31
+ "class": "",
32
+ "id": ""
33
+ },
34
+ "layout": "block",
35
+ "sub_fields": [
36
+ {
37
+ "key": "<%= acf.fields.headerClone %>",
38
+ "label": "Header",
39
+ "name": "header",
40
+ "type": "clone",
41
+ "instructions": "",
42
+ "required": 0,
43
+ "conditional_logic": 0,
44
+ "wrapper": {
45
+ "width": "",
46
+ "class": "",
47
+ "id": ""
48
+ },
49
+ "clone": [
50
+ "group_5d10c6c72aa88"
51
+ ],
52
+ "display": "seamless",
53
+ "layout": "block",
54
+ "prefix_label": 0,
55
+ "prefix_name": 0
56
+ }
57
+ ]
58
+ },
59
+ {
60
+ "key": "<%= acf.fields.textTab %>",
61
+ "label": "Text",
62
+ "name": "",
63
+ "type": "tab",
64
+ "instructions": "",
65
+ "required": 0,
66
+ "conditional_logic": 0,
67
+ "wrapper": {
68
+ "width": "",
69
+ "class": "",
70
+ "id": ""
71
+ },
72
+ "placement": "left",
73
+ "endpoint": 0
74
+ },
75
+ {
76
+ "key": "<%= acf.fields.showText %>",
77
+ "label": "Show text",
78
+ "name": "show_text",
79
+ "type": "true_false",
80
+ "instructions": "",
81
+ "required": 0,
82
+ "conditional_logic": 0,
83
+ "wrapper": {
84
+ "width": "",
85
+ "class": "",
86
+ "id": ""
87
+ },
88
+ "message": "",
89
+ "default_value": 0,
90
+ "ui": 1,
91
+ "ui_on_text": "",
92
+ "ui_off_text": ""
93
+ },
94
+ {
95
+ "key": "<%= acf.fields.textGroup %>",
96
+ "label": "Text",
97
+ "name": "text",
98
+ "type": "group",
99
+ "instructions": "",
100
+ "required": 0,
101
+ "conditional_logic": [
102
+ [
103
+ {
104
+ "field": "<%= acf.fields.showText %>",
105
+ "operator": "==",
106
+ "value": "1"
107
+ }
108
+ ]
109
+ ],
110
+ "wrapper": {
111
+ "width": "",
112
+ "class": "",
113
+ "id": ""
114
+ },
115
+ "layout": "block",
116
+ "sub_fields": [
117
+ {
118
+ "key": "<%= acf.fields.textClone %>",
119
+ "label": "Text",
120
+ "name": "text",
121
+ "type": "clone",
122
+ "instructions": "",
123
+ "required": 0,
124
+ "conditional_logic": 0,
125
+ "wrapper": {
126
+ "width": "",
127
+ "class": "",
128
+ "id": ""
129
+ },
130
+ "clone": [
131
+ "group_5d10c3212d211"
132
+ ],
133
+ "display": "seamless",
134
+ "layout": "block",
135
+ "prefix_label": 0,
136
+ "prefix_name": 0
137
+ }
138
+ ]
139
+ },
140
+ {
141
+ "key": "<%= acf.fields.columnsTab %>",
142
+ "label": "Columns",
143
+ "name": "",
144
+ "type": "tab",
145
+ "instructions": "",
146
+ "required": 0,
147
+ "conditional_logic": 0,
148
+ "wrapper": {
149
+ "width": "",
150
+ "class": "",
151
+ "id": ""
152
+ },
153
+ "placement": "left",
154
+ "endpoint": 0
155
+ },
156
+ {
157
+ "key": "<%= acf.fields.columnsRepeater %>",
158
+ "label": "Columns",
159
+ "name": "items",
160
+ "type": "repeater",
161
+ "instructions": "",
162
+ "required": 0,
163
+ "conditional_logic": 0,
164
+ "wrapper": {
165
+ "width": "",
166
+ "class": "",
167
+ "id": ""
168
+ },
169
+ "collapsed": "",
170
+ "min": 0,
171
+ "max": 0,
172
+ "layout": "block",
173
+ "button_label": "Add column",
174
+ "sub_fields": [
175
+ {
176
+ "key": "<%= acf.fields.columnsMediaTab %>",
177
+ "label": "Media",
178
+ "name": "",
179
+ "type": "tab",
180
+ "instructions": "",
181
+ "required": 0,
182
+ "conditional_logic": 0,
183
+ "wrapper": {
184
+ "width": "",
185
+ "class": "",
186
+ "id": ""
187
+ },
188
+ "placement": "top",
189
+ "endpoint": 0
190
+ },
191
+ {
192
+ "key": "<%= acf.fields.columnsMediaGroup %>",
193
+ "label": "Column media",
194
+ "name": "column_media",
195
+ "type": "group",
196
+ "instructions": "",
197
+ "required": 0,
198
+ "conditional_logic": 0,
199
+ "wrapper": {
200
+ "width": "",
201
+ "class": "",
202
+ "id": ""
203
+ },
204
+ "layout": "block",
205
+ "sub_fields": [
206
+ {
207
+ "key": "<%= acf.fields.columnsMediaClone %>",
208
+ "label": "Media",
209
+ "name": "media",
210
+ "type": "clone",
211
+ "instructions": "",
212
+ "required": 0,
213
+ "conditional_logic": 0,
214
+ "wrapper": {
215
+ "width": "",
216
+ "class": "",
217
+ "id": ""
218
+ },
219
+ "clone": [
220
+ "group_5dd2ebd632e0c"
221
+ ],
222
+ "display": "seamless",
223
+ "layout": "block",
224
+ "prefix_label": 0,
225
+ "prefix_name": 0
226
+ }
227
+ ]
228
+ },
229
+ {
230
+ "key": "<%= acf.fields.columnsTitleTab %>",
231
+ "label": "Title",
232
+ "name": "",
233
+ "type": "tab",
234
+ "instructions": "",
235
+ "required": 0,
236
+ "conditional_logic": 0,
237
+ "wrapper": {
238
+ "width": "",
239
+ "class": "",
240
+ "id": ""
241
+ },
242
+ "placement": "top",
243
+ "endpoint": 0
244
+ },
245
+ {
246
+ "key": "<%= acf.fields.columnsTitleGroup %>",
247
+ "label": "Column title",
248
+ "name": "column_title",
249
+ "type": "group",
250
+ "instructions": "",
251
+ "required": 0,
252
+ "conditional_logic": 0,
253
+ "wrapper": {
254
+ "width": "",
255
+ "class": "",
256
+ "id": ""
257
+ },
258
+ "layout": "block",
259
+ "sub_fields": [
260
+ {
261
+ "key": "<%= acf.fields.columnsTitleClone %>",
262
+ "label": "Title",
263
+ "name": "title",
264
+ "type": "clone",
265
+ "instructions": "",
266
+ "required": 0,
267
+ "conditional_logic": 0,
268
+ "wrapper": {
269
+ "width": "",
270
+ "class": "",
271
+ "id": ""
272
+ },
273
+ "clone": [
274
+ "group_5d10c483ebf4e"
275
+ ],
276
+ "display": "seamless",
277
+ "layout": "block",
278
+ "prefix_label": 0,
279
+ "prefix_name": 0
280
+ }
281
+ ]
282
+ },
283
+ {
284
+ "key": "<%= acf.fields.columnsTextTab %>",
285
+ "label": "Text",
286
+ "name": "",
287
+ "type": "tab",
288
+ "instructions": "",
289
+ "required": 0,
290
+ "conditional_logic": 0,
291
+ "wrapper": {
292
+ "width": "",
293
+ "class": "",
294
+ "id": ""
295
+ },
296
+ "placement": "top",
297
+ "endpoint": 0
298
+ },
299
+ {
300
+ "key": "<%= acf.fields.columnsTextGroup %>",
301
+ "label": "Column text",
302
+ "name": "column_text",
303
+ "type": "group",
304
+ "instructions": "",
305
+ "required": 0,
306
+ "conditional_logic": 0,
307
+ "wrapper": {
308
+ "width": "",
309
+ "class": "",
310
+ "id": ""
311
+ },
312
+ "layout": "block",
313
+ "sub_fields": [
314
+ {
315
+ "key": "<%= acf.fields.columnsTextClone %>",
316
+ "label": "Text",
317
+ "name": "text",
318
+ "type": "clone",
319
+ "instructions": "",
320
+ "required": 0,
321
+ "conditional_logic": 0,
322
+ "wrapper": {
323
+ "width": "",
324
+ "class": "",
325
+ "id": ""
326
+ },
327
+ "clone": [
328
+ "group_5d10c3212d211"
329
+ ],
330
+ "display": "seamless",
331
+ "layout": "block",
332
+ "prefix_label": 0,
333
+ "prefix_name": 0
334
+ }
335
+ ]
336
+ },
337
+ {
338
+ "key": "<%= acf.fields.columnsCtaTab %>",
339
+ "label": "CTA",
340
+ "name": "",
341
+ "type": "tab",
342
+ "instructions": "",
343
+ "required": 0,
344
+ "conditional_logic": 0,
345
+ "wrapper": {
346
+ "width": "",
347
+ "class": "",
348
+ "id": ""
349
+ },
350
+ "placement": "top",
351
+ "endpoint": 0
352
+ },
353
+ {
354
+ "key": "<%= acf.fields.columnsCtaGroup %>",
355
+ "label": "Column CTA",
356
+ "name": "column_cta",
357
+ "type": "group",
358
+ "instructions": "",
359
+ "required": 0,
360
+ "conditional_logic": 0,
361
+ "wrapper": {
362
+ "width": "",
363
+ "class": "",
364
+ "id": ""
365
+ },
366
+ "layout": "block",
367
+ "sub_fields": [
368
+ {
369
+ "key": "<%= acf.fields.columnsCtaClone %>",
370
+ "label": "CTA",
371
+ "name": "cta",
372
+ "type": "clone",
373
+ "instructions": "",
374
+ "required": 0,
375
+ "conditional_logic": 0,
376
+ "wrapper": {
377
+ "width": "",
378
+ "class": "",
379
+ "id": ""
380
+ },
381
+ "clone": [
382
+ "group_5d10a747c1ff5"
383
+ ],
384
+ "display": "seamless",
385
+ "layout": "block",
386
+ "prefix_label": 0,
387
+ "prefix_name": 0
388
+ }
389
+ ]
390
+ }
391
+ ]
392
+ },
393
+ {
394
+ "key": "<%= acf.fields.buttonsTab %>",
395
+ "label": "Buttons below columns",
396
+ "name": "",
397
+ "type": "tab",
398
+ "instructions": "",
399
+ "required": 0,
400
+ "conditional_logic": 0,
401
+ "wrapper": {
402
+ "width": "",
403
+ "class": "",
404
+ "id": ""
405
+ },
406
+ "placement": "left",
407
+ "endpoint": 0
408
+ },
409
+ {
410
+ "key": "<%= acf.fields.showButtons %>",
411
+ "label": "Show buttons",
412
+ "name": "show_buttons",
413
+ "type": "true_false",
414
+ "instructions": "",
415
+ "required": 0,
416
+ "conditional_logic": 0,
417
+ "wrapper": {
418
+ "width": "",
419
+ "class": "",
420
+ "id": ""
421
+ },
422
+ "message": "",
423
+ "default_value": 0,
424
+ "ui": 1,
425
+ "ui_on_text": "",
426
+ "ui_off_text": ""
427
+ },
428
+ {
429
+ "key": "<%= acf.fields.buttonsGroup %>",
430
+ "label": "Buttons",
431
+ "name": "buttons",
432
+ "type": "group",
433
+ "instructions": "",
434
+ "required": 0,
435
+ "conditional_logic": [
436
+ [
437
+ {
438
+ "field": "<%= acf.fields.showButtons %>",
439
+ "operator": "==",
440
+ "value": "1"
441
+ }
442
+ ]
443
+ ],
444
+ "wrapper": {
445
+ "width": "",
446
+ "class": "",
447
+ "id": ""
448
+ },
449
+ "layout": "block",
450
+ "sub_fields": [
451
+ {
452
+ "key": "<%= acf.fields.buttonsClone %>",
453
+ "label": "Buttons",
454
+ "name": "buttons",
455
+ "type": "clone",
456
+ "instructions": "",
457
+ "required": 0,
458
+ "conditional_logic": 0,
459
+ "wrapper": {
460
+ "width": "",
461
+ "class": "",
462
+ "id": ""
463
+ },
464
+ "clone": [
465
+ "group_5d10a747c1ff5"
466
+ ],
467
+ "display": "seamless",
468
+ "layout": "block",
469
+ "prefix_label": 0,
470
+ "prefix_name": 0
471
+ }
472
+ ]
473
+ },
474
+ {
475
+ "key": "<%= acf.fields.settingsTab %>",
476
+ "label": "Settings",
477
+ "name": "",
478
+ "type": "tab",
479
+ "instructions": "",
480
+ "required": 0,
481
+ "conditional_logic": 0,
482
+ "wrapper": {
483
+ "width": "",
484
+ "class": "",
485
+ "id": ""
486
+ },
487
+ "placement": "left",
488
+ "endpoint": 0
489
+ },
490
+ {
491
+ "key": "<%= acf.fields.backgroundGroup %>",
492
+ "label": "Background",
493
+ "name": "background",
494
+ "type": "group",
495
+ "instructions": "",
496
+ "required": 0,
497
+ "conditional_logic": 0,
498
+ "wrapper": {
499
+ "width": "",
500
+ "class": "",
501
+ "id": ""
502
+ },
503
+ "layout": "block",
504
+ "sub_fields": [
505
+ {
506
+ "key": "<%= acf.fields.backgroundClone %>",
507
+ "label": "Background",
508
+ "name": "background",
509
+ "type": "clone",
510
+ "instructions": "",
511
+ "required": 0,
512
+ "conditional_logic": 0,
513
+ "wrapper": {
514
+ "width": "",
515
+ "class": "",
516
+ "id": ""
517
+ },
518
+ "clone": [
519
+ "group_5d10cb5bb41ca"
520
+ ],
521
+ "display": "seamless",
522
+ "layout": "block",
523
+ "prefix_label": 0,
524
+ "prefix_name": 0
525
+ }
526
+ ]
527
+ }
528
+ ],
529
+ "location": [
530
+ [
531
+ {
532
+ "param": "block",
533
+ "operator": "==",
534
+ "value": "acf\/<%= name.slug %>"
535
+ }
536
+ ]
537
+ ],
538
+ "menu_order": 0,
539
+ "position": "normal",
540
+ "style": "default",
541
+ "label_placement": "top",
542
+ "instruction_placement": "label",
543
+ "hide_on_screen": "",
544
+ "active": 1,
545
+ "description": "",
546
+ "modified": <%= acf.timestamp %>
547
+ }
@@ -1,8 +1,8 @@
1
- <%_ if (answers.blockDescription) { _%>
2
1
  {{--
2
+ Title: <%= name.title %>
3
3
  Description: <%= answers.blockDescription %>
4
+ Keywords: airfleet <%= name.noCase %>
4
5
  --}}
5
- <% } _%>
6
6
  @block([ 'block' => $block ])
7
7
 
8
8
  @endblock
@@ -0,0 +1,20 @@
1
+ {{--
2
+ Title: <%= name.title %>
3
+ Description: <%= answers.blockDescription %>
4
+ Keywords: airfleet <%= name.noCase %>
5
+ --}}
6
+ @block([ 'block' => $block ])
7
+ @background( $background )
8
+ <div class="container">
9
+ <div class="row">
10
+ <div class="col">
11
+ @sectionheader( $section_header )@endsectionheader
12
+ @text( $text )@endtext
13
+ @media( $media )@endmedia
14
+ @buttoncollection( $buttons )@endbuttoncollection
15
+ @form( $form )@endform
16
+ </div>
17
+ </div>
18
+ </div>
19
+ @endbackground
20
+ @endblock
@@ -0,0 +1,52 @@
1
+ {{--
2
+ Title: <%= name.title %>
3
+ Description: <%= answers.blockDescription %>
4
+ Keywords: airfleet <%= name.noCase %>
5
+ --}}
6
+ @block([ 'block' => $block ])
7
+ @background( $background )
8
+ <div class="container">
9
+ <div class="b-building-repeater-block__inner">
10
+ <div class="b-building-repeater-block__head">
11
+ @sectionheader( $header )@endsectionheader
12
+ @if( $show_text )
13
+ @text( $text )@endtext
14
+ @endif
15
+ </div>
16
+ <div class="b-building-repeater-block__body">
17
+ <div class="b-building-repeater-block__items">
18
+ <div class="b-building-repeater-block__row row"
19
+ data-af-eq-items=".b-building-repeater-block__item-title, .b-building-repeater-block__item-text"
20
+ data-af-eq-group-by="720: 2, 1280: 3, 1680: 2"
21
+ >
22
+ @foreach( $items as $item )
23
+ <div class="b-building-repeater-block__item col-12 col-md-6 col-lg">
24
+ <div class="b-building-repeater-block__item-wrap">
25
+ @media(
26
+ $item[ 'column_media' ] + [ 'class' => 'b-building-repeater-block__item-media' ]
27
+ )@endmedia
28
+ @title(
29
+ $item[ 'column_title' ] + [ 'class' => 'b-building-repeater-block__item-title' ]
30
+ )@endtitle
31
+ @text(
32
+ $item[ 'column_text' ] + [ 'class' => 'b-building-repeater-block__item-text' ]
33
+ )@endtext
34
+ @buttoncollection(
35
+ $item[ 'column_cta' ]
36
+ + [ 'container_class' => 'b-building-repeater-block__item-cta' ]
37
+ )@endbuttoncollection
38
+ </div>
39
+ </div>
40
+ @endforeach
41
+ </div>
42
+ </div>
43
+ </div>
44
+ </div>
45
+ @if( $show_buttons )
46
+ <div class="b-building-repeater-block__footer">
47
+ @buttoncollection( $buttons )@endbuttoncollection
48
+ </div>
49
+ @endif
50
+ </div>
51
+ @endbackground
52
+ @endblock
@@ -52,7 +52,7 @@ export default class extends Generator {
52
52
 
53
53
  this.answers = await this.prompt(prompts);
54
54
  this.name = nameCases(this.answers.componentName);
55
- this.acf = acfData({ prefix: "group_" });
55
+ this.acf = acfData();
56
56
  this.data = {
57
57
  answers: this.answers,
58
58
  name: this.name,