@adobe/aio-cli-plugin-app 10.5.0 → 10.6.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/README.md +36 -34
- package/oclif.manifest.json +8 -2
- package/package.json +2 -2
- package/src/BaseCommand.js +16 -0
- package/src/commands/app/add/event.js +59 -17
package/README.md
CHANGED
|
@@ -71,7 +71,7 @@ DESCRIPTION
|
|
|
71
71
|
Create, run, test, and deploy Adobe I/O Apps
|
|
72
72
|
```
|
|
73
73
|
|
|
74
|
-
_See code: [src/commands/app/index.ts](https://github.com/adobe/aio-cli-plugin-app/blob/10.
|
|
74
|
+
_See code: [src/commands/app/index.ts](https://github.com/adobe/aio-cli-plugin-app/blob/10.6.0/src/commands/app/index.ts)_
|
|
75
75
|
|
|
76
76
|
## `aio app add`
|
|
77
77
|
|
|
@@ -89,7 +89,7 @@ DESCRIPTION
|
|
|
89
89
|
Add a new component to an existing Adobe I/O App
|
|
90
90
|
```
|
|
91
91
|
|
|
92
|
-
_See code: [src/commands/app/add/index.ts](https://github.com/adobe/aio-cli-plugin-app/blob/10.
|
|
92
|
+
_See code: [src/commands/app/add/index.ts](https://github.com/adobe/aio-cli-plugin-app/blob/10.6.0/src/commands/app/add/index.ts)_
|
|
93
93
|
|
|
94
94
|
## `aio app add action`
|
|
95
95
|
|
|
@@ -114,7 +114,7 @@ ALIASES
|
|
|
114
114
|
$ aio app add actions
|
|
115
115
|
```
|
|
116
116
|
|
|
117
|
-
_See code: [src/commands/app/add/action.ts](https://github.com/adobe/aio-cli-plugin-app/blob/10.
|
|
117
|
+
_See code: [src/commands/app/add/action.ts](https://github.com/adobe/aio-cli-plugin-app/blob/10.6.0/src/commands/app/add/action.ts)_
|
|
118
118
|
|
|
119
119
|
## `aio app add ci`
|
|
120
120
|
|
|
@@ -132,7 +132,7 @@ DESCRIPTION
|
|
|
132
132
|
Add CI files
|
|
133
133
|
```
|
|
134
134
|
|
|
135
|
-
_See code: [src/commands/app/add/ci.ts](https://github.com/adobe/aio-cli-plugin-app/blob/10.
|
|
135
|
+
_See code: [src/commands/app/add/ci.ts](https://github.com/adobe/aio-cli-plugin-app/blob/10.6.0/src/commands/app/add/ci.ts)_
|
|
136
136
|
|
|
137
137
|
## `aio app add event`
|
|
138
138
|
|
|
@@ -140,14 +140,16 @@ Add a new Adobe I/O Events action
|
|
|
140
140
|
|
|
141
141
|
```
|
|
142
142
|
USAGE
|
|
143
|
-
$ aio app add event [-v] [--version] [--install] [-y] [-e <value>]
|
|
143
|
+
$ aio app add event [-v] [--version] [--install] [-y] [-e <value>] [--experimental-allow-events-templates]
|
|
144
144
|
|
|
145
145
|
FLAGS
|
|
146
|
-
-e, --extension=<value>
|
|
147
|
-
-v, --verbose
|
|
148
|
-
-y, --yes
|
|
149
|
-
--
|
|
150
|
-
|
|
146
|
+
-e, --extension=<value> Add events to a specific extension
|
|
147
|
+
-v, --verbose Verbose output
|
|
148
|
+
-y, --yes Skip questions, and use all default values
|
|
149
|
+
--experimental-allow-events-templates Feature flag to enable events templates. NOTE: skip-prompt will have no effect
|
|
150
|
+
if this flag is enabled.
|
|
151
|
+
--[no-]install [default: true] Run npm installation after files are created
|
|
152
|
+
--version Show version
|
|
151
153
|
|
|
152
154
|
DESCRIPTION
|
|
153
155
|
Add a new Adobe I/O Events action
|
|
@@ -157,7 +159,7 @@ ALIASES
|
|
|
157
159
|
$ aio app add events
|
|
158
160
|
```
|
|
159
161
|
|
|
160
|
-
_See code: [src/commands/app/add/event.ts](https://github.com/adobe/aio-cli-plugin-app/blob/10.
|
|
162
|
+
_See code: [src/commands/app/add/event.ts](https://github.com/adobe/aio-cli-plugin-app/blob/10.6.0/src/commands/app/add/event.ts)_
|
|
161
163
|
|
|
162
164
|
## `aio app add extension`
|
|
163
165
|
|
|
@@ -183,7 +185,7 @@ ALIASES
|
|
|
183
185
|
$ aio app add extensions
|
|
184
186
|
```
|
|
185
187
|
|
|
186
|
-
_See code: [src/commands/app/add/extension.ts](https://github.com/adobe/aio-cli-plugin-app/blob/10.
|
|
188
|
+
_See code: [src/commands/app/add/extension.ts](https://github.com/adobe/aio-cli-plugin-app/blob/10.6.0/src/commands/app/add/extension.ts)_
|
|
187
189
|
|
|
188
190
|
## `aio app add service`
|
|
189
191
|
|
|
@@ -207,7 +209,7 @@ ALIASES
|
|
|
207
209
|
$ aio app add services
|
|
208
210
|
```
|
|
209
211
|
|
|
210
|
-
_See code: [src/commands/app/add/service.ts](https://github.com/adobe/aio-cli-plugin-app/blob/10.
|
|
212
|
+
_See code: [src/commands/app/add/service.ts](https://github.com/adobe/aio-cli-plugin-app/blob/10.6.0/src/commands/app/add/service.ts)_
|
|
211
213
|
|
|
212
214
|
## `aio app add web-assets`
|
|
213
215
|
|
|
@@ -228,7 +230,7 @@ DESCRIPTION
|
|
|
228
230
|
Add web assets support
|
|
229
231
|
```
|
|
230
232
|
|
|
231
|
-
_See code: [src/commands/app/add/web-assets.ts](https://github.com/adobe/aio-cli-plugin-app/blob/10.
|
|
233
|
+
_See code: [src/commands/app/add/web-assets.ts](https://github.com/adobe/aio-cli-plugin-app/blob/10.6.0/src/commands/app/add/web-assets.ts)_
|
|
232
234
|
|
|
233
235
|
## `aio app build`
|
|
234
236
|
|
|
@@ -257,7 +259,7 @@ DESCRIPTION
|
|
|
257
259
|
This will always force a rebuild unless --no-force-build is set.
|
|
258
260
|
```
|
|
259
261
|
|
|
260
|
-
_See code: [src/commands/app/build.ts](https://github.com/adobe/aio-cli-plugin-app/blob/10.
|
|
262
|
+
_See code: [src/commands/app/build.ts](https://github.com/adobe/aio-cli-plugin-app/blob/10.6.0/src/commands/app/build.ts)_
|
|
261
263
|
|
|
262
264
|
## `aio app create [PATH]`
|
|
263
265
|
|
|
@@ -279,7 +281,7 @@ DESCRIPTION
|
|
|
279
281
|
Create a new Adobe I/O App with default parameters
|
|
280
282
|
```
|
|
281
283
|
|
|
282
|
-
_See code: [src/commands/app/create.ts](https://github.com/adobe/aio-cli-plugin-app/blob/10.
|
|
284
|
+
_See code: [src/commands/app/create.ts](https://github.com/adobe/aio-cli-plugin-app/blob/10.6.0/src/commands/app/create.ts)_
|
|
283
285
|
|
|
284
286
|
## `aio app delete`
|
|
285
287
|
|
|
@@ -297,7 +299,7 @@ DESCRIPTION
|
|
|
297
299
|
Delete a component from an existing Adobe I/O App
|
|
298
300
|
```
|
|
299
301
|
|
|
300
|
-
_See code: [src/commands/app/delete/index.ts](https://github.com/adobe/aio-cli-plugin-app/blob/10.
|
|
302
|
+
_See code: [src/commands/app/delete/index.ts](https://github.com/adobe/aio-cli-plugin-app/blob/10.6.0/src/commands/app/delete/index.ts)_
|
|
301
303
|
|
|
302
304
|
## `aio app delete action [ACTION-NAME]`
|
|
303
305
|
|
|
@@ -323,7 +325,7 @@ ALIASES
|
|
|
323
325
|
$ aio app delete actions
|
|
324
326
|
```
|
|
325
327
|
|
|
326
|
-
_See code: [src/commands/app/delete/action.ts](https://github.com/adobe/aio-cli-plugin-app/blob/10.
|
|
328
|
+
_See code: [src/commands/app/delete/action.ts](https://github.com/adobe/aio-cli-plugin-app/blob/10.6.0/src/commands/app/delete/action.ts)_
|
|
327
329
|
|
|
328
330
|
## `aio app delete ci`
|
|
329
331
|
|
|
@@ -342,7 +344,7 @@ DESCRIPTION
|
|
|
342
344
|
Delete existing CI files
|
|
343
345
|
```
|
|
344
346
|
|
|
345
|
-
_See code: [src/commands/app/delete/ci.ts](https://github.com/adobe/aio-cli-plugin-app/blob/10.
|
|
347
|
+
_See code: [src/commands/app/delete/ci.ts](https://github.com/adobe/aio-cli-plugin-app/blob/10.6.0/src/commands/app/delete/ci.ts)_
|
|
346
348
|
|
|
347
349
|
## `aio app delete event [EVENT-ACTION-NAME]`
|
|
348
350
|
|
|
@@ -368,7 +370,7 @@ ALIASES
|
|
|
368
370
|
$ aio app delete events
|
|
369
371
|
```
|
|
370
372
|
|
|
371
|
-
_See code: [src/commands/app/delete/event.ts](https://github.com/adobe/aio-cli-plugin-app/blob/10.
|
|
373
|
+
_See code: [src/commands/app/delete/event.ts](https://github.com/adobe/aio-cli-plugin-app/blob/10.6.0/src/commands/app/delete/event.ts)_
|
|
372
374
|
|
|
373
375
|
## `aio app delete extension`
|
|
374
376
|
|
|
@@ -394,7 +396,7 @@ ALIASES
|
|
|
394
396
|
$ aio app delete extensions
|
|
395
397
|
```
|
|
396
398
|
|
|
397
|
-
_See code: [src/commands/app/delete/extension.ts](https://github.com/adobe/aio-cli-plugin-app/blob/10.
|
|
399
|
+
_See code: [src/commands/app/delete/extension.ts](https://github.com/adobe/aio-cli-plugin-app/blob/10.6.0/src/commands/app/delete/extension.ts)_
|
|
398
400
|
|
|
399
401
|
## `aio app delete service`
|
|
400
402
|
|
|
@@ -418,7 +420,7 @@ ALIASES
|
|
|
418
420
|
$ aio app delete services
|
|
419
421
|
```
|
|
420
422
|
|
|
421
|
-
_See code: [src/commands/app/delete/service.ts](https://github.com/adobe/aio-cli-plugin-app/blob/10.
|
|
423
|
+
_See code: [src/commands/app/delete/service.ts](https://github.com/adobe/aio-cli-plugin-app/blob/10.6.0/src/commands/app/delete/service.ts)_
|
|
422
424
|
|
|
423
425
|
## `aio app delete web-assets`
|
|
424
426
|
|
|
@@ -437,7 +439,7 @@ DESCRIPTION
|
|
|
437
439
|
Delete existing web assets
|
|
438
440
|
```
|
|
439
441
|
|
|
440
|
-
_See code: [src/commands/app/delete/web-assets.ts](https://github.com/adobe/aio-cli-plugin-app/blob/10.
|
|
442
|
+
_See code: [src/commands/app/delete/web-assets.ts](https://github.com/adobe/aio-cli-plugin-app/blob/10.6.0/src/commands/app/delete/web-assets.ts)_
|
|
441
443
|
|
|
442
444
|
## `aio app deploy`
|
|
443
445
|
|
|
@@ -477,7 +479,7 @@ DESCRIPTION
|
|
|
477
479
|
This will always force a rebuild unless --no-force-build is set.
|
|
478
480
|
```
|
|
479
481
|
|
|
480
|
-
_See code: [src/commands/app/deploy.ts](https://github.com/adobe/aio-cli-plugin-app/blob/10.
|
|
482
|
+
_See code: [src/commands/app/deploy.ts](https://github.com/adobe/aio-cli-plugin-app/blob/10.6.0/src/commands/app/deploy.ts)_
|
|
481
483
|
|
|
482
484
|
## `aio app get-url [ACTION]`
|
|
483
485
|
|
|
@@ -500,7 +502,7 @@ DESCRIPTION
|
|
|
500
502
|
Get action URLs
|
|
501
503
|
```
|
|
502
504
|
|
|
503
|
-
_See code: [src/commands/app/get-url.ts](https://github.com/adobe/aio-cli-plugin-app/blob/10.
|
|
505
|
+
_See code: [src/commands/app/get-url.ts](https://github.com/adobe/aio-cli-plugin-app/blob/10.6.0/src/commands/app/get-url.ts)_
|
|
504
506
|
|
|
505
507
|
## `aio app info`
|
|
506
508
|
|
|
@@ -522,7 +524,7 @@ DESCRIPTION
|
|
|
522
524
|
Display settings/configuration in use by an Adobe I/O App
|
|
523
525
|
```
|
|
524
526
|
|
|
525
|
-
_See code: [src/commands/app/info.ts](https://github.com/adobe/aio-cli-plugin-app/blob/10.
|
|
527
|
+
_See code: [src/commands/app/info.ts](https://github.com/adobe/aio-cli-plugin-app/blob/10.6.0/src/commands/app/info.ts)_
|
|
526
528
|
|
|
527
529
|
## `aio app init [PATH]`
|
|
528
530
|
|
|
@@ -556,7 +558,7 @@ DESCRIPTION
|
|
|
556
558
|
Create a new Adobe I/O App
|
|
557
559
|
```
|
|
558
560
|
|
|
559
|
-
_See code: [src/commands/app/init.ts](https://github.com/adobe/aio-cli-plugin-app/blob/10.
|
|
561
|
+
_See code: [src/commands/app/init.ts](https://github.com/adobe/aio-cli-plugin-app/blob/10.6.0/src/commands/app/init.ts)_
|
|
560
562
|
|
|
561
563
|
## `aio app list`
|
|
562
564
|
|
|
@@ -574,7 +576,7 @@ DESCRIPTION
|
|
|
574
576
|
List components for Adobe I/O App
|
|
575
577
|
```
|
|
576
578
|
|
|
577
|
-
_See code: [src/commands/app/list/index.ts](https://github.com/adobe/aio-cli-plugin-app/blob/10.
|
|
579
|
+
_See code: [src/commands/app/list/index.ts](https://github.com/adobe/aio-cli-plugin-app/blob/10.6.0/src/commands/app/list/index.ts)_
|
|
578
580
|
|
|
579
581
|
## `aio app list extension`
|
|
580
582
|
|
|
@@ -599,7 +601,7 @@ ALIASES
|
|
|
599
601
|
$ aio app list extensions
|
|
600
602
|
```
|
|
601
603
|
|
|
602
|
-
_See code: [src/commands/app/list/extension.ts](https://github.com/adobe/aio-cli-plugin-app/blob/10.
|
|
604
|
+
_See code: [src/commands/app/list/extension.ts](https://github.com/adobe/aio-cli-plugin-app/blob/10.6.0/src/commands/app/list/extension.ts)_
|
|
603
605
|
|
|
604
606
|
## `aio app logs`
|
|
605
607
|
|
|
@@ -623,7 +625,7 @@ DESCRIPTION
|
|
|
623
625
|
Fetch logs for an Adobe I/O App
|
|
624
626
|
```
|
|
625
627
|
|
|
626
|
-
_See code: [src/commands/app/logs.ts](https://github.com/adobe/aio-cli-plugin-app/blob/10.
|
|
628
|
+
_See code: [src/commands/app/logs.ts](https://github.com/adobe/aio-cli-plugin-app/blob/10.6.0/src/commands/app/logs.ts)_
|
|
627
629
|
|
|
628
630
|
## `aio app run`
|
|
629
631
|
|
|
@@ -646,7 +648,7 @@ DESCRIPTION
|
|
|
646
648
|
Run an Adobe I/O App
|
|
647
649
|
```
|
|
648
650
|
|
|
649
|
-
_See code: [src/commands/app/run.ts](https://github.com/adobe/aio-cli-plugin-app/blob/10.
|
|
651
|
+
_See code: [src/commands/app/run.ts](https://github.com/adobe/aio-cli-plugin-app/blob/10.6.0/src/commands/app/run.ts)_
|
|
650
652
|
|
|
651
653
|
## `aio app test`
|
|
652
654
|
|
|
@@ -674,7 +676,7 @@ DESCRIPTION
|
|
|
674
676
|
If the extension has a hook called 'test' in its 'ext.config.yaml', the script specified will be run instead.
|
|
675
677
|
```
|
|
676
678
|
|
|
677
|
-
_See code: [src/commands/app/test.ts](https://github.com/adobe/aio-cli-plugin-app/blob/10.
|
|
679
|
+
_See code: [src/commands/app/test.ts](https://github.com/adobe/aio-cli-plugin-app/blob/10.6.0/src/commands/app/test.ts)_
|
|
678
680
|
|
|
679
681
|
## `aio app undeploy`
|
|
680
682
|
|
|
@@ -699,7 +701,7 @@ DESCRIPTION
|
|
|
699
701
|
Undeploys an Adobe I/O App
|
|
700
702
|
```
|
|
701
703
|
|
|
702
|
-
_See code: [src/commands/app/undeploy.ts](https://github.com/adobe/aio-cli-plugin-app/blob/10.
|
|
704
|
+
_See code: [src/commands/app/undeploy.ts](https://github.com/adobe/aio-cli-plugin-app/blob/10.6.0/src/commands/app/undeploy.ts)_
|
|
703
705
|
|
|
704
706
|
## `aio app use [CONFIG_FILE_PATH]`
|
|
705
707
|
|
|
@@ -747,5 +749,5 @@ DESCRIPTION
|
|
|
747
749
|
page in https://developer.adobe.com/console/
|
|
748
750
|
```
|
|
749
751
|
|
|
750
|
-
_See code: [src/commands/app/use.ts](https://github.com/adobe/aio-cli-plugin-app/blob/10.
|
|
752
|
+
_See code: [src/commands/app/use.ts](https://github.com/adobe/aio-cli-plugin-app/blob/10.6.0/src/commands/app/use.ts)_
|
|
751
753
|
<!-- commandsstop -->
|
package/oclif.manifest.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "10.
|
|
2
|
+
"version": "10.6.0",
|
|
3
3
|
"commands": {
|
|
4
4
|
"app:build": {
|
|
5
5
|
"id": "app:build",
|
|
@@ -1104,8 +1104,14 @@
|
|
|
1104
1104
|
"name": "extension",
|
|
1105
1105
|
"type": "option",
|
|
1106
1106
|
"char": "e",
|
|
1107
|
-
"description": "Add
|
|
1107
|
+
"description": "Add events to a specific extension",
|
|
1108
1108
|
"multiple": false
|
|
1109
|
+
},
|
|
1110
|
+
"experimental-allow-events-templates": {
|
|
1111
|
+
"name": "experimental-allow-events-templates",
|
|
1112
|
+
"type": "boolean",
|
|
1113
|
+
"description": "Feature flag to enable events templates. NOTE: skip-prompt will have no effect if this flag is enabled.",
|
|
1114
|
+
"allowNo": false
|
|
1109
1115
|
}
|
|
1110
1116
|
},
|
|
1111
1117
|
"args": {}
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adobe/aio-cli-plugin-app",
|
|
3
3
|
"description": "Create, Build and Deploy Adobe I/O Applications",
|
|
4
|
-
"version": "10.
|
|
4
|
+
"version": "10.6.0",
|
|
5
5
|
"author": "Adobe Inc.",
|
|
6
6
|
"bugs": "https://github.com/adobe/aio-cli-plugin-app/issues",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@adobe/aio-cli-lib-app-config": "^1.0
|
|
8
|
+
"@adobe/aio-cli-lib-app-config": "^1.1.0",
|
|
9
9
|
"@adobe/aio-cli-lib-console": "^4.1.0",
|
|
10
10
|
"@adobe/aio-lib-core-config": "^4.0.0",
|
|
11
11
|
"@adobe/aio-lib-core-logging": "^2.0.0",
|
package/src/BaseCommand.js
CHANGED
|
@@ -118,6 +118,22 @@ class BaseCommand extends Command {
|
|
|
118
118
|
return configData
|
|
119
119
|
}
|
|
120
120
|
|
|
121
|
+
getEventsConfigFile (implName) {
|
|
122
|
+
let configKey
|
|
123
|
+
if (implName === APPLICATION_CONFIG_KEY) {
|
|
124
|
+
configKey = APPLICATION_CONFIG_KEY
|
|
125
|
+
} else {
|
|
126
|
+
configKey = `${EXTENSIONS_CONFIG_KEY}.${implName}`
|
|
127
|
+
}
|
|
128
|
+
let configData = this.getConfigFileForKey(`${configKey}.events`)
|
|
129
|
+
if (!configData.file) {
|
|
130
|
+
// first events manifest is not defined
|
|
131
|
+
configData = this.getConfigFileForKey(`${configKey}`)
|
|
132
|
+
configData.key = configData.key + '.events'
|
|
133
|
+
}
|
|
134
|
+
return configData
|
|
135
|
+
}
|
|
136
|
+
|
|
121
137
|
getConfigFileForKey (fullKey) {
|
|
122
138
|
// NOTE: the index returns undefined if the key is loaded from a legacy configuration file
|
|
123
139
|
const fullConfig = this.getFullConfig()
|
|
@@ -10,14 +10,16 @@ governing permissions and limitations under the License.
|
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
const AddCommand = require('../../../AddCommand')
|
|
13
|
+
const TemplatesCommand = require('../../../TemplatesCommand')
|
|
13
14
|
const yeoman = require('yeoman-environment')
|
|
14
15
|
const aioLogger = require('@adobe/aio-lib-core-logging')('@adobe/aio-cli-plugin-app:add:event', { provider: 'debug' })
|
|
15
16
|
const { Flags } = require('@oclif/core')
|
|
16
17
|
const ora = require('ora')
|
|
17
18
|
const path = require('path')
|
|
18
19
|
const generators = require('@adobe/generator-aio-app')
|
|
20
|
+
const TemplateRegistryAPI = require('@adobe/aio-lib-templates')
|
|
19
21
|
|
|
20
|
-
class AddEventCommand extends
|
|
22
|
+
class AddEventCommand extends TemplatesCommand {
|
|
21
23
|
async run () {
|
|
22
24
|
const { flags } = await this.parse(AddEventCommand)
|
|
23
25
|
|
|
@@ -29,27 +31,63 @@ class AddEventCommand extends AddCommand {
|
|
|
29
31
|
if (entries.length > 1) {
|
|
30
32
|
this.error('Please use the \'-e\' flag to specify to which implementation you want to add events to.')
|
|
31
33
|
}
|
|
34
|
+
|
|
32
35
|
const configName = entries[0][0]
|
|
33
36
|
const config = entries[0][1]
|
|
34
37
|
const actionFolder = path.relative(config.root, config.actions.src)
|
|
35
|
-
const
|
|
38
|
+
const runtimeManifestData = this.getRuntimeManifestConfigFile(configName)
|
|
39
|
+
|
|
40
|
+
const templateOptions = {
|
|
41
|
+
'skip-prompt': false,
|
|
42
|
+
'action-folder': actionFolder,
|
|
43
|
+
'config-path': runtimeManifestData.file,
|
|
44
|
+
'full-key-to-manifest': runtimeManifestData.key
|
|
45
|
+
}
|
|
36
46
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
'
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
47
|
+
if (flags['experimental-allow-events-templates']) {
|
|
48
|
+
const eventsData = this.getEventsConfigFile(configName)
|
|
49
|
+
templateOptions['full-key-to-events-manifest'] = eventsData.key
|
|
50
|
+
const [searchCriteria, orderByCriteria] = await this.getSearchCriteria()
|
|
51
|
+
const templates = await this.selectTemplates(searchCriteria, orderByCriteria)
|
|
52
|
+
if (templates.length === 0) {
|
|
53
|
+
this.error('No events templates were chosen to be installed.')
|
|
54
|
+
} else {
|
|
55
|
+
await this.installTemplates({
|
|
56
|
+
useDefaultValues: flags.yes,
|
|
57
|
+
installNpm: flags.install,
|
|
58
|
+
templateOptions,
|
|
59
|
+
templates
|
|
60
|
+
})
|
|
48
61
|
}
|
|
49
|
-
|
|
50
|
-
|
|
62
|
+
// by default yeoman runs the install, we control installation from the app plugin
|
|
63
|
+
} else {
|
|
64
|
+
templateOptions['skip-prompt'] = flags.yes
|
|
65
|
+
templateOptions.force = true
|
|
66
|
+
const env = yeoman.createEnv()
|
|
67
|
+
env.options = { skipInstall: true }
|
|
68
|
+
const eventsGen = env.instantiate(generators['add-events'], {
|
|
69
|
+
options: templateOptions
|
|
70
|
+
})
|
|
71
|
+
await env.runGenerator(eventsGen)
|
|
51
72
|
|
|
52
|
-
|
|
73
|
+
await this.runInstallPackages(flags, spinner)
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
async getSearchCriteria () {
|
|
78
|
+
const TEMPLATE_CATEGORIES = ['events', 'helper-template']
|
|
79
|
+
const searchCriteria = {
|
|
80
|
+
[TemplateRegistryAPI.SEARCH_CRITERIA_STATUSES]: TemplateRegistryAPI.TEMPLATE_STATUS_APPROVED,
|
|
81
|
+
[TemplateRegistryAPI.SEARCH_CRITERIA_CATEGORIES]: TEMPLATE_CATEGORIES,
|
|
82
|
+
[TemplateRegistryAPI.SEARCH_CRITERIA_EXTENSIONS]: TemplateRegistryAPI.SEARCH_CRITERIA_FILTER_NONE
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// an optional OrderBy Criteria object
|
|
86
|
+
const orderByCriteria = {
|
|
87
|
+
[TemplateRegistryAPI.ORDER_BY_CRITERIA_PUBLISH_DATE]: TemplateRegistryAPI.ORDER_BY_CRITERIA_SORT_DESC
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
return [searchCriteria, orderByCriteria]
|
|
53
91
|
}
|
|
54
92
|
}
|
|
55
93
|
|
|
@@ -63,11 +101,15 @@ AddEventCommand.flags = {
|
|
|
63
101
|
char: 'y'
|
|
64
102
|
}),
|
|
65
103
|
extension: Flags.string({
|
|
66
|
-
description: 'Add
|
|
104
|
+
description: 'Add events to a specific extension',
|
|
67
105
|
char: 'e',
|
|
68
106
|
multiple: false,
|
|
69
107
|
parse: str => [str]
|
|
70
108
|
}),
|
|
109
|
+
'experimental-allow-events-templates': Flags.boolean({
|
|
110
|
+
description: 'Feature flag to enable events templates. NOTE: skip-prompt will have no effect if this flag is enabled.',
|
|
111
|
+
default: false
|
|
112
|
+
}),
|
|
71
113
|
...AddCommand.flags
|
|
72
114
|
}
|
|
73
115
|
|