@adobe/aio-cli-plugin-app 10.4.0 → 10.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.
- package/README.md +56 -2
- package/oclif.manifest.json +2 -2
- package/package.json +16 -13
- package/src/BaseCommand.js +5 -1
- package/src/commands/app/add/action.js +1 -1
- package/src/commands/app/add/ci.js +1 -1
- package/src/commands/app/add/event.js +1 -1
- package/src/commands/app/add/extension.js +1 -1
- package/src/commands/app/add/index.js +1 -1
- package/src/commands/app/add/service.js +1 -1
- package/src/commands/app/add/web-assets.js +1 -1
- package/src/commands/app/create.js +6 -6
- package/src/commands/app/delete/action.js +7 -7
- package/src/commands/app/delete/ci.js +1 -1
- package/src/commands/app/delete/event.js +6 -6
- package/src/commands/app/delete/extension.js +1 -1
- package/src/commands/app/delete/index.js +1 -1
- package/src/commands/app/delete/service.js +1 -1
- package/src/commands/app/delete/web-assets.js +1 -1
- package/src/commands/app/deploy.js +4 -3
- package/src/commands/app/get-url.js +6 -4
- package/src/commands/app/index.js +1 -1
- package/src/commands/app/info.js +1 -1
- package/src/commands/app/init.js +6 -6
- package/src/commands/app/install.js +71 -6
- package/src/commands/app/list/extension-points.js +1 -1
- package/src/commands/app/list/extension.js +1 -1
- package/src/commands/app/list/index.js +1 -1
- package/src/commands/app/pack.js +24 -55
- package/src/commands/app/run.js +10 -7
- package/src/commands/app/undeploy.js +9 -12
- package/src/commands/app/use.js +7 -7
- package/src/lib/app-helper.js +2 -2
- package/src/lib/import-helper.js +9 -9
- package/src/lib/log-poller.js +1 -0
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.
|
|
74
|
+
_See code: [src/commands/app/index.ts](https://github.com/adobe/aio-cli-plugin-app/blob/10.5.0/src/commands/app/index.ts)_
|
|
75
75
|
|
|
76
76
|
## `aio app add`
|
|
77
77
|
|
|
@@ -89,6 +89,8 @@ 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.5.0/src/commands/app/add/index.ts)_
|
|
93
|
+
|
|
92
94
|
## `aio app add action`
|
|
93
95
|
|
|
94
96
|
Add new actions
|
|
@@ -112,6 +114,8 @@ ALIASES
|
|
|
112
114
|
$ aio app add actions
|
|
113
115
|
```
|
|
114
116
|
|
|
117
|
+
_See code: [src/commands/app/add/action.ts](https://github.com/adobe/aio-cli-plugin-app/blob/10.5.0/src/commands/app/add/action.ts)_
|
|
118
|
+
|
|
115
119
|
## `aio app add ci`
|
|
116
120
|
|
|
117
121
|
Add CI files
|
|
@@ -128,6 +132,8 @@ DESCRIPTION
|
|
|
128
132
|
Add CI files
|
|
129
133
|
```
|
|
130
134
|
|
|
135
|
+
_See code: [src/commands/app/add/ci.ts](https://github.com/adobe/aio-cli-plugin-app/blob/10.5.0/src/commands/app/add/ci.ts)_
|
|
136
|
+
|
|
131
137
|
## `aio app add event`
|
|
132
138
|
|
|
133
139
|
Add a new Adobe I/O Events action
|
|
@@ -151,6 +157,8 @@ ALIASES
|
|
|
151
157
|
$ aio app add events
|
|
152
158
|
```
|
|
153
159
|
|
|
160
|
+
_See code: [src/commands/app/add/event.ts](https://github.com/adobe/aio-cli-plugin-app/blob/10.5.0/src/commands/app/add/event.ts)_
|
|
161
|
+
|
|
154
162
|
## `aio app add extension`
|
|
155
163
|
|
|
156
164
|
Add new extensions to the project
|
|
@@ -175,6 +183,8 @@ ALIASES
|
|
|
175
183
|
$ aio app add extensions
|
|
176
184
|
```
|
|
177
185
|
|
|
186
|
+
_See code: [src/commands/app/add/extension.ts](https://github.com/adobe/aio-cli-plugin-app/blob/10.5.0/src/commands/app/add/extension.ts)_
|
|
187
|
+
|
|
178
188
|
## `aio app add service`
|
|
179
189
|
|
|
180
190
|
Subscribe to Services in the current Workspace
|
|
@@ -197,6 +207,8 @@ ALIASES
|
|
|
197
207
|
$ aio app add services
|
|
198
208
|
```
|
|
199
209
|
|
|
210
|
+
_See code: [src/commands/app/add/service.ts](https://github.com/adobe/aio-cli-plugin-app/blob/10.5.0/src/commands/app/add/service.ts)_
|
|
211
|
+
|
|
200
212
|
## `aio app add web-assets`
|
|
201
213
|
|
|
202
214
|
Add web assets support
|
|
@@ -216,6 +228,8 @@ DESCRIPTION
|
|
|
216
228
|
Add web assets support
|
|
217
229
|
```
|
|
218
230
|
|
|
231
|
+
_See code: [src/commands/app/add/web-assets.ts](https://github.com/adobe/aio-cli-plugin-app/blob/10.5.0/src/commands/app/add/web-assets.ts)_
|
|
232
|
+
|
|
219
233
|
## `aio app build`
|
|
220
234
|
|
|
221
235
|
Build an Adobe I/O App
|
|
@@ -243,6 +257,8 @@ DESCRIPTION
|
|
|
243
257
|
This will always force a rebuild unless --no-force-build is set.
|
|
244
258
|
```
|
|
245
259
|
|
|
260
|
+
_See code: [src/commands/app/build.ts](https://github.com/adobe/aio-cli-plugin-app/blob/10.5.0/src/commands/app/build.ts)_
|
|
261
|
+
|
|
246
262
|
## `aio app create [PATH]`
|
|
247
263
|
|
|
248
264
|
Create a new Adobe I/O App with default parameters
|
|
@@ -263,6 +279,8 @@ DESCRIPTION
|
|
|
263
279
|
Create a new Adobe I/O App with default parameters
|
|
264
280
|
```
|
|
265
281
|
|
|
282
|
+
_See code: [src/commands/app/create.ts](https://github.com/adobe/aio-cli-plugin-app/blob/10.5.0/src/commands/app/create.ts)_
|
|
283
|
+
|
|
266
284
|
## `aio app delete`
|
|
267
285
|
|
|
268
286
|
Delete a component from an existing Adobe I/O App
|
|
@@ -279,6 +297,8 @@ DESCRIPTION
|
|
|
279
297
|
Delete a component from an existing Adobe I/O App
|
|
280
298
|
```
|
|
281
299
|
|
|
300
|
+
_See code: [src/commands/app/delete/index.ts](https://github.com/adobe/aio-cli-plugin-app/blob/10.5.0/src/commands/app/delete/index.ts)_
|
|
301
|
+
|
|
282
302
|
## `aio app delete action [ACTION-NAME]`
|
|
283
303
|
|
|
284
304
|
Delete existing actions
|
|
@@ -303,6 +323,8 @@ ALIASES
|
|
|
303
323
|
$ aio app delete actions
|
|
304
324
|
```
|
|
305
325
|
|
|
326
|
+
_See code: [src/commands/app/delete/action.ts](https://github.com/adobe/aio-cli-plugin-app/blob/10.5.0/src/commands/app/delete/action.ts)_
|
|
327
|
+
|
|
306
328
|
## `aio app delete ci`
|
|
307
329
|
|
|
308
330
|
Delete existing CI files
|
|
@@ -320,6 +342,8 @@ DESCRIPTION
|
|
|
320
342
|
Delete existing CI files
|
|
321
343
|
```
|
|
322
344
|
|
|
345
|
+
_See code: [src/commands/app/delete/ci.ts](https://github.com/adobe/aio-cli-plugin-app/blob/10.5.0/src/commands/app/delete/ci.ts)_
|
|
346
|
+
|
|
323
347
|
## `aio app delete event [EVENT-ACTION-NAME]`
|
|
324
348
|
|
|
325
349
|
Delete existing Adobe I/O Events actions
|
|
@@ -344,6 +368,8 @@ ALIASES
|
|
|
344
368
|
$ aio app delete events
|
|
345
369
|
```
|
|
346
370
|
|
|
371
|
+
_See code: [src/commands/app/delete/event.ts](https://github.com/adobe/aio-cli-plugin-app/blob/10.5.0/src/commands/app/delete/event.ts)_
|
|
372
|
+
|
|
347
373
|
## `aio app delete extension`
|
|
348
374
|
|
|
349
375
|
Delete existing extensions
|
|
@@ -368,6 +394,8 @@ ALIASES
|
|
|
368
394
|
$ aio app delete extensions
|
|
369
395
|
```
|
|
370
396
|
|
|
397
|
+
_See code: [src/commands/app/delete/extension.ts](https://github.com/adobe/aio-cli-plugin-app/blob/10.5.0/src/commands/app/delete/extension.ts)_
|
|
398
|
+
|
|
371
399
|
## `aio app delete service`
|
|
372
400
|
|
|
373
401
|
Delete Services in the current Workspace
|
|
@@ -390,6 +418,8 @@ ALIASES
|
|
|
390
418
|
$ aio app delete services
|
|
391
419
|
```
|
|
392
420
|
|
|
421
|
+
_See code: [src/commands/app/delete/service.ts](https://github.com/adobe/aio-cli-plugin-app/blob/10.5.0/src/commands/app/delete/service.ts)_
|
|
422
|
+
|
|
393
423
|
## `aio app delete web-assets`
|
|
394
424
|
|
|
395
425
|
Delete existing web assets
|
|
@@ -407,6 +437,8 @@ DESCRIPTION
|
|
|
407
437
|
Delete existing web assets
|
|
408
438
|
```
|
|
409
439
|
|
|
440
|
+
_See code: [src/commands/app/delete/web-assets.ts](https://github.com/adobe/aio-cli-plugin-app/blob/10.5.0/src/commands/app/delete/web-assets.ts)_
|
|
441
|
+
|
|
410
442
|
## `aio app deploy`
|
|
411
443
|
|
|
412
444
|
Build and deploy an Adobe I/O App
|
|
@@ -445,6 +477,8 @@ DESCRIPTION
|
|
|
445
477
|
This will always force a rebuild unless --no-force-build is set.
|
|
446
478
|
```
|
|
447
479
|
|
|
480
|
+
_See code: [src/commands/app/deploy.ts](https://github.com/adobe/aio-cli-plugin-app/blob/10.5.0/src/commands/app/deploy.ts)_
|
|
481
|
+
|
|
448
482
|
## `aio app get-url [ACTION]`
|
|
449
483
|
|
|
450
484
|
Get action URLs
|
|
@@ -466,6 +500,8 @@ DESCRIPTION
|
|
|
466
500
|
Get action URLs
|
|
467
501
|
```
|
|
468
502
|
|
|
503
|
+
_See code: [src/commands/app/get-url.ts](https://github.com/adobe/aio-cli-plugin-app/blob/10.5.0/src/commands/app/get-url.ts)_
|
|
504
|
+
|
|
469
505
|
## `aio app info`
|
|
470
506
|
|
|
471
507
|
Display settings/configuration in use by an Adobe I/O App
|
|
@@ -486,6 +522,8 @@ DESCRIPTION
|
|
|
486
522
|
Display settings/configuration in use by an Adobe I/O App
|
|
487
523
|
```
|
|
488
524
|
|
|
525
|
+
_See code: [src/commands/app/info.ts](https://github.com/adobe/aio-cli-plugin-app/blob/10.5.0/src/commands/app/info.ts)_
|
|
526
|
+
|
|
489
527
|
## `aio app init [PATH]`
|
|
490
528
|
|
|
491
529
|
Create a new Adobe I/O App
|
|
@@ -518,6 +556,8 @@ DESCRIPTION
|
|
|
518
556
|
Create a new Adobe I/O App
|
|
519
557
|
```
|
|
520
558
|
|
|
559
|
+
_See code: [src/commands/app/init.ts](https://github.com/adobe/aio-cli-plugin-app/blob/10.5.0/src/commands/app/init.ts)_
|
|
560
|
+
|
|
521
561
|
## `aio app list`
|
|
522
562
|
|
|
523
563
|
List components for Adobe I/O App
|
|
@@ -534,6 +574,8 @@ DESCRIPTION
|
|
|
534
574
|
List components for Adobe I/O App
|
|
535
575
|
```
|
|
536
576
|
|
|
577
|
+
_See code: [src/commands/app/list/index.ts](https://github.com/adobe/aio-cli-plugin-app/blob/10.5.0/src/commands/app/list/index.ts)_
|
|
578
|
+
|
|
537
579
|
## `aio app list extension`
|
|
538
580
|
|
|
539
581
|
List implemented extensions
|
|
@@ -557,6 +599,8 @@ ALIASES
|
|
|
557
599
|
$ aio app list extensions
|
|
558
600
|
```
|
|
559
601
|
|
|
602
|
+
_See code: [src/commands/app/list/extension.ts](https://github.com/adobe/aio-cli-plugin-app/blob/10.5.0/src/commands/app/list/extension.ts)_
|
|
603
|
+
|
|
560
604
|
## `aio app logs`
|
|
561
605
|
|
|
562
606
|
Fetch logs for an Adobe I/O App
|
|
@@ -579,6 +623,8 @@ DESCRIPTION
|
|
|
579
623
|
Fetch logs for an Adobe I/O App
|
|
580
624
|
```
|
|
581
625
|
|
|
626
|
+
_See code: [src/commands/app/logs.ts](https://github.com/adobe/aio-cli-plugin-app/blob/10.5.0/src/commands/app/logs.ts)_
|
|
627
|
+
|
|
582
628
|
## `aio app run`
|
|
583
629
|
|
|
584
630
|
Run an Adobe I/O App
|
|
@@ -600,6 +646,8 @@ DESCRIPTION
|
|
|
600
646
|
Run an Adobe I/O App
|
|
601
647
|
```
|
|
602
648
|
|
|
649
|
+
_See code: [src/commands/app/run.ts](https://github.com/adobe/aio-cli-plugin-app/blob/10.5.0/src/commands/app/run.ts)_
|
|
650
|
+
|
|
603
651
|
## `aio app test`
|
|
604
652
|
|
|
605
653
|
Run tests for an Adobe I/O App
|
|
@@ -626,6 +674,8 @@ DESCRIPTION
|
|
|
626
674
|
If the extension has a hook called 'test' in its 'ext.config.yaml', the script specified will be run instead.
|
|
627
675
|
```
|
|
628
676
|
|
|
677
|
+
_See code: [src/commands/app/test.ts](https://github.com/adobe/aio-cli-plugin-app/blob/10.5.0/src/commands/app/test.ts)_
|
|
678
|
+
|
|
629
679
|
## `aio app undeploy`
|
|
630
680
|
|
|
631
681
|
Undeploys an Adobe I/O App
|
|
@@ -649,6 +699,8 @@ DESCRIPTION
|
|
|
649
699
|
Undeploys an Adobe I/O App
|
|
650
700
|
```
|
|
651
701
|
|
|
702
|
+
_See code: [src/commands/app/undeploy.ts](https://github.com/adobe/aio-cli-plugin-app/blob/10.5.0/src/commands/app/undeploy.ts)_
|
|
703
|
+
|
|
652
704
|
## `aio app use [CONFIG_FILE_PATH]`
|
|
653
705
|
|
|
654
706
|
Import an Adobe Developer Console configuration file.
|
|
@@ -692,6 +744,8 @@ DESCRIPTION
|
|
|
692
744
|
To set these global config values, see the help text for 'aio console --help'.
|
|
693
745
|
|
|
694
746
|
To download the configuration file for your project, select the 'Download' button in the toolbar of your project's
|
|
695
|
-
page in https://
|
|
747
|
+
page in https://developer.adobe.com/console/
|
|
696
748
|
```
|
|
749
|
+
|
|
750
|
+
_See code: [src/commands/app/use.ts](https://github.com/adobe/aio-cli-plugin-app/blob/10.5.0/src/commands/app/use.ts)_
|
|
697
751
|
<!-- commandsstop -->
|
package/oclif.manifest.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "10.
|
|
2
|
+
"version": "10.5.0",
|
|
3
3
|
"commands": {
|
|
4
4
|
"app:build": {
|
|
5
5
|
"id": "app:build",
|
|
@@ -874,7 +874,7 @@
|
|
|
874
874
|
},
|
|
875
875
|
"app:use": {
|
|
876
876
|
"id": "app:use",
|
|
877
|
-
"description": "Import an Adobe Developer Console configuration file.\n\nIf the optional configuration file is not set, this command will retrieve the console org, project, and workspace settings from the global config.\n\nTo set these global config values, see the help text for 'aio console --help'.\n\nTo download the configuration file for your project, select the 'Download' button in the toolbar of your project's page in https://
|
|
877
|
+
"description": "Import an Adobe Developer Console configuration file.\n\nIf the optional configuration file is not set, this command will retrieve the console org, project, and workspace settings from the global config.\n\nTo set these global config values, see the help text for 'aio console --help'.\n\nTo download the configuration file for your project, select the 'Download' button in the toolbar of your project's page in https://developer.adobe.com/console/\n",
|
|
878
878
|
"strict": true,
|
|
879
879
|
"pluginName": "@adobe/aio-cli-plugin-app",
|
|
880
880
|
"pluginAlias": "@adobe/aio-cli-plugin-app",
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
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.5.0",
|
|
5
5
|
"author": "Adobe Inc.",
|
|
6
6
|
"bugs": "https://github.com/adobe/aio-cli-plugin-app/issues",
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"@adobe/aio-cli-lib-app-config": "^1.0.1",
|
|
9
9
|
"@adobe/aio-cli-lib-console": "^4.1.0",
|
|
10
|
-
"@adobe/aio-lib-core-config": "^
|
|
10
|
+
"@adobe/aio-lib-core-config": "^4.0.0",
|
|
11
11
|
"@adobe/aio-lib-core-logging": "^2.0.0",
|
|
12
12
|
"@adobe/aio-lib-core-networking": "^4.1.0",
|
|
13
13
|
"@adobe/aio-lib-env": "^2.0.0",
|
|
@@ -16,9 +16,9 @@
|
|
|
16
16
|
"@adobe/aio-lib-templates": "^2.2.0",
|
|
17
17
|
"@adobe/aio-lib-web": "^6.1.0",
|
|
18
18
|
"@adobe/generator-aio-app": "^5.1.0",
|
|
19
|
-
"@adobe/generator-app-common-lib": "^0.
|
|
19
|
+
"@adobe/generator-app-common-lib": "^0.4.0",
|
|
20
20
|
"@adobe/inquirer-table-checkbox": "^1.2.0",
|
|
21
|
-
"@oclif/core": "^
|
|
21
|
+
"@oclif/core": "^2.11.6",
|
|
22
22
|
"@parcel/core": "^2.7.0",
|
|
23
23
|
"@parcel/reporter-cli": "^2.7.0",
|
|
24
24
|
"ajv": "^8",
|
|
@@ -38,7 +38,9 @@
|
|
|
38
38
|
"inquirer": "^8",
|
|
39
39
|
"js-yaml": "^4.1.0",
|
|
40
40
|
"lodash.clonedeep": "^4.5.0",
|
|
41
|
+
"node-abort-controller": "^3.1.1",
|
|
41
42
|
"node-fetch": "^2.6.7",
|
|
43
|
+
"open": "^8.4.2",
|
|
42
44
|
"ora": "^5",
|
|
43
45
|
"pure-http": "^3",
|
|
44
46
|
"serve-static": "^1.14.1",
|
|
@@ -50,23 +52,24 @@
|
|
|
50
52
|
},
|
|
51
53
|
"devDependencies": {
|
|
52
54
|
"@adobe/aio-lib-test-proxy": "^1.0.0",
|
|
53
|
-
"@adobe/eslint-config-aio-lib-config": "^2.0.
|
|
55
|
+
"@adobe/eslint-config-aio-lib-config": "^2.0.1",
|
|
54
56
|
"@types/jest": "^29",
|
|
55
57
|
"babel-runtime": "^6.26.0",
|
|
56
58
|
"core-js": "^3",
|
|
57
59
|
"eol": "^0.9.1",
|
|
58
|
-
"eslint": "^8.
|
|
59
|
-
"eslint-config-standard": "^17",
|
|
60
|
-
"eslint-plugin-import": "^2.
|
|
61
|
-
"eslint-plugin-jest": "^
|
|
62
|
-
"eslint-plugin-jsdoc": "^
|
|
63
|
-
"eslint-plugin-n": "^
|
|
60
|
+
"eslint": "^8.46.0",
|
|
61
|
+
"eslint-config-standard": "^17.1.0",
|
|
62
|
+
"eslint-plugin-import": "^2.28.0",
|
|
63
|
+
"eslint-plugin-jest": "^27.2.3",
|
|
64
|
+
"eslint-plugin-jsdoc": "^42.0.0",
|
|
65
|
+
"eslint-plugin-n": "^16.0.1",
|
|
64
66
|
"eslint-plugin-node": "^11.1.0",
|
|
65
|
-
"eslint-plugin-promise": "^6.
|
|
67
|
+
"eslint-plugin-promise": "^6.1.1",
|
|
66
68
|
"jest": "^29.5.0",
|
|
67
69
|
"nock": "^13.2.9",
|
|
68
70
|
"oclif": "^3.2.0",
|
|
69
|
-
"stdout-stderr": "^0.1.9"
|
|
71
|
+
"stdout-stderr": "^0.1.9",
|
|
72
|
+
"typescript": "^5.1.6"
|
|
70
73
|
},
|
|
71
74
|
"engines": {
|
|
72
75
|
"node": "^14.18 || ^16.13 || >=18"
|
package/src/BaseCommand.js
CHANGED
|
@@ -9,6 +9,10 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTA
|
|
|
9
9
|
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
10
|
governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
|
+
|
|
13
|
+
const { AbortController } = require('node-abort-controller')
|
|
14
|
+
global.AbortController = AbortController
|
|
15
|
+
|
|
12
16
|
const { Command, Flags } = require('@oclif/core')
|
|
13
17
|
const chalk = require('chalk')
|
|
14
18
|
const coreConfig = require('@adobe/aio-lib-core-config')
|
|
@@ -176,6 +180,6 @@ BaseCommand.flags = {
|
|
|
176
180
|
version: Flags.boolean({ description: 'Show version' })
|
|
177
181
|
}
|
|
178
182
|
|
|
179
|
-
BaseCommand.args =
|
|
183
|
+
BaseCommand.args = {}
|
|
180
184
|
|
|
181
185
|
module.exports = BaseCommand
|
|
@@ -11,7 +11,7 @@ governing permissions and limitations under the License.
|
|
|
11
11
|
|
|
12
12
|
const BaseCommand = require('../../BaseCommand')
|
|
13
13
|
const InitCommand = require('./init')
|
|
14
|
-
const { Flags } = require('@oclif/core')
|
|
14
|
+
const { Flags, Args } = require('@oclif/core')
|
|
15
15
|
|
|
16
16
|
class Create extends BaseCommand {
|
|
17
17
|
async run () {
|
|
@@ -35,12 +35,12 @@ Create.flags = {
|
|
|
35
35
|
})
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
Create.args =
|
|
38
|
+
Create.args =
|
|
39
39
|
{
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
path: Args.string({
|
|
41
|
+
description: 'Path to the app directory',
|
|
42
|
+
default: '.'
|
|
43
|
+
})
|
|
43
44
|
}
|
|
44
|
-
]
|
|
45
45
|
|
|
46
46
|
module.exports = Create
|
|
@@ -12,7 +12,7 @@ governing permissions and limitations under the License.
|
|
|
12
12
|
const BaseCommand = require('../../../BaseCommand')
|
|
13
13
|
const inquirer = require('inquirer')
|
|
14
14
|
const aioLogger = require('@adobe/aio-lib-core-logging')('@adobe/aio-cli-plugin-app:delete:action', { provider: 'debug' })
|
|
15
|
-
const { Flags } = require('@oclif/core')
|
|
15
|
+
const { Flags, Args } = require('@oclif/core')
|
|
16
16
|
const fs = require('fs-extra')
|
|
17
17
|
const path = require('path')
|
|
18
18
|
const chalk = require('chalk')
|
|
@@ -153,14 +153,14 @@ DeleteActionCommand.flags = {
|
|
|
153
153
|
...BaseCommand.flags
|
|
154
154
|
}
|
|
155
155
|
|
|
156
|
-
DeleteActionCommand.args =
|
|
156
|
+
DeleteActionCommand.args =
|
|
157
157
|
{
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
158
|
+
'action-name': Args.string({
|
|
159
|
+
description: 'Action `pkg/name` to delete, you can specify multiple actions via a comma separated list',
|
|
160
|
+
default: '',
|
|
161
|
+
required: false
|
|
162
|
+
})
|
|
162
163
|
}
|
|
163
|
-
]
|
|
164
164
|
|
|
165
165
|
DeleteActionCommand.aliases = ['app:delete:actions']
|
|
166
166
|
|
|
@@ -11,7 +11,7 @@ governing permissions and limitations under the License.
|
|
|
11
11
|
|
|
12
12
|
const BaseCommand = require('../../../BaseCommand')
|
|
13
13
|
const aioLogger = require('@adobe/aio-lib-core-logging')('@adobe/aio-cli-plugin-app:delete:event', { provider: 'debug' })
|
|
14
|
-
const { Flags } = require('@oclif/core')
|
|
14
|
+
const { Flags, Args } = require('@oclif/core')
|
|
15
15
|
const DeleteActionCommand = require('./action')
|
|
16
16
|
const chalk = require('chalk')
|
|
17
17
|
|
|
@@ -54,13 +54,13 @@ DeleteEventCommand.flags = {
|
|
|
54
54
|
...BaseCommand.flags
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
DeleteEventCommand.args =
|
|
57
|
+
DeleteEventCommand.args =
|
|
58
58
|
{
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
59
|
+
'event-action-name': Args.string({
|
|
60
|
+
description: 'Action `pkg/name` to delete, you can specify multiple actions via a comma separated list',
|
|
61
|
+
required: false
|
|
62
|
+
})
|
|
62
63
|
}
|
|
63
|
-
]
|
|
64
64
|
|
|
65
65
|
DeleteEventCommand.aliases = ['app:delete:events']
|
|
66
66
|
|
|
@@ -12,11 +12,12 @@ governing permissions and limitations under the License.
|
|
|
12
12
|
|
|
13
13
|
const ora = require('ora')
|
|
14
14
|
const chalk = require('chalk')
|
|
15
|
+
const open = require('open')
|
|
15
16
|
|
|
16
17
|
const BaseCommand = require('../../BaseCommand')
|
|
17
18
|
const BuildCommand = require('./build')
|
|
18
19
|
const webLib = require('@adobe/aio-lib-web')
|
|
19
|
-
const { Flags
|
|
20
|
+
const { Flags } = require('@oclif/core')
|
|
20
21
|
const { createWebExportFilter, runInProcess, buildExtensionPointPayloadWoMetadata, buildExcShellViewExtensionMetadata } = require('../../lib/app-helper')
|
|
21
22
|
const rtLib = require('@adobe/aio-lib-runtime')
|
|
22
23
|
const LogForwarding = require('../../lib/log-forwarding')
|
|
@@ -241,7 +242,7 @@ class Deploy extends BuildCommand {
|
|
|
241
242
|
const launchUrl = this.getLaunchUrlPrefix() + deployedFrontendUrl
|
|
242
243
|
if (flags.open) {
|
|
243
244
|
this.log(chalk.blue(chalk.bold(`Opening your deployed application in the Experience Cloud shell:\n -> ${launchUrl}`)))
|
|
244
|
-
|
|
245
|
+
open(launchUrl)
|
|
245
246
|
} else {
|
|
246
247
|
this.log(chalk.blue(chalk.bold(`To view your deployed application in the Experience Cloud shell:\n -> ${launchUrl}`)))
|
|
247
248
|
}
|
|
@@ -375,6 +376,6 @@ Deploy.flags = {
|
|
|
375
376
|
})
|
|
376
377
|
}
|
|
377
378
|
|
|
378
|
-
Deploy.args =
|
|
379
|
+
Deploy.args = {}
|
|
379
380
|
|
|
380
381
|
module.exports = Deploy
|
|
@@ -12,7 +12,7 @@ governing permissions and limitations under the License.
|
|
|
12
12
|
|
|
13
13
|
const chalk = require('chalk')
|
|
14
14
|
|
|
15
|
-
const { Flags } = require('@oclif/core')
|
|
15
|
+
const { Flags, Args } = require('@oclif/core')
|
|
16
16
|
|
|
17
17
|
const BaseCommand = require('../../BaseCommand')
|
|
18
18
|
const { wrapError } = require('../../lib/app-helper')
|
|
@@ -116,8 +116,10 @@ GetUrlCommand.flags = {
|
|
|
116
116
|
})
|
|
117
117
|
}
|
|
118
118
|
|
|
119
|
-
GetUrlCommand.args =
|
|
120
|
-
{
|
|
121
|
-
|
|
119
|
+
GetUrlCommand.args =
|
|
120
|
+
{
|
|
121
|
+
action: Args.string({
|
|
122
|
+
})
|
|
123
|
+
}
|
|
122
124
|
|
|
123
125
|
module.exports = GetUrlCommand
|
package/src/commands/app/info.js
CHANGED
package/src/commands/app/init.js
CHANGED
|
@@ -15,7 +15,7 @@ const path = require('path')
|
|
|
15
15
|
const fs = require('fs-extra')
|
|
16
16
|
const ora = require('ora')
|
|
17
17
|
const chalk = require('chalk')
|
|
18
|
-
const { Flags } = require('@oclif/core')
|
|
18
|
+
const { Flags, Args } = require('@oclif/core')
|
|
19
19
|
const generators = require('@adobe/generator-aio-app')
|
|
20
20
|
const TemplateRegistryAPI = require('@adobe/aio-lib-templates')
|
|
21
21
|
const inquirer = require('inquirer')
|
|
@@ -400,12 +400,12 @@ InitCommand.flags = {
|
|
|
400
400
|
})
|
|
401
401
|
}
|
|
402
402
|
|
|
403
|
-
InitCommand.args =
|
|
403
|
+
InitCommand.args =
|
|
404
404
|
{
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
405
|
+
path: Args.string({
|
|
406
|
+
description: 'Path to the app directory',
|
|
407
|
+
default: '.'
|
|
408
|
+
})
|
|
408
409
|
}
|
|
409
|
-
]
|
|
410
410
|
|
|
411
411
|
module.exports = InitCommand
|
|
@@ -11,13 +11,15 @@ governing permissions and limitations under the License.
|
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
const BaseCommand = require('../../BaseCommand')
|
|
14
|
-
const { Flags } = require('@oclif/core')
|
|
14
|
+
const { Flags, Args } = require('@oclif/core')
|
|
15
15
|
const aioLogger = require('@adobe/aio-lib-core-logging')('@adobe/aio-cli-plugin-app:install', { provider: 'debug' })
|
|
16
16
|
const path = require('node:path')
|
|
17
17
|
const fs = require('fs-extra')
|
|
18
18
|
const execa = require('execa')
|
|
19
19
|
const unzipper = require('unzipper')
|
|
20
20
|
const { validateJsonWithSchema } = require('../../lib/install-helper')
|
|
21
|
+
const { loadConfigFile, writeFile } = require('../../lib/import-helper')
|
|
22
|
+
const { getObjectValue } = require('../../lib/app-helper')
|
|
21
23
|
const jsYaml = require('js-yaml')
|
|
22
24
|
const { USER_CONFIG_FILE, DEPLOY_CONFIG_FILE } = require('../../lib/defaults')
|
|
23
25
|
const ora = require('ora')
|
|
@@ -28,6 +30,7 @@ class InstallCommand extends BaseCommand {
|
|
|
28
30
|
const { args, flags } = await this.parse(InstallCommand)
|
|
29
31
|
|
|
30
32
|
this.preRelease()
|
|
33
|
+
const appConfig = this.getFullConfig()
|
|
31
34
|
|
|
32
35
|
aioLogger.debug(`flags: ${JSON.stringify(flags, null, 2)}`)
|
|
33
36
|
aioLogger.debug(`args: ${JSON.stringify(args, null, 2)}`)
|
|
@@ -49,6 +52,7 @@ class InstallCommand extends BaseCommand {
|
|
|
49
52
|
try {
|
|
50
53
|
await this.validateZipDirectoryStructure(args.path)
|
|
51
54
|
await this.unzipFile(args.path, outputPath)
|
|
55
|
+
await this.addCodeDownloadAnnotation(outputPath, appConfig)
|
|
52
56
|
await this.validateConfig(outputPath, USER_CONFIG_FILE)
|
|
53
57
|
await this.validateConfig(outputPath, DEPLOY_CONFIG_FILE)
|
|
54
58
|
await this.npmInstall(flags.verbose)
|
|
@@ -139,6 +143,67 @@ class InstallCommand extends BaseCommand {
|
|
|
139
143
|
}
|
|
140
144
|
})
|
|
141
145
|
}
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* An annotation called disable-download will be added to all actions in app.config.yaml
|
|
149
|
+
* (and linked yaml configs for example in extensions). This value will be set to true.
|
|
150
|
+
* The annotation will by default be false if not set.
|
|
151
|
+
*
|
|
152
|
+
* @param {object} outputPath the path to the app package
|
|
153
|
+
* @param {object} appConfig the app's configuration file
|
|
154
|
+
*/
|
|
155
|
+
async addCodeDownloadAnnotation (outputPath, appConfig) {
|
|
156
|
+
this.spinner.start('Adding disable-download annotations...')
|
|
157
|
+
// get each annotation key relative to the file it is defined in
|
|
158
|
+
/// iterate only over extensions that have actions defined
|
|
159
|
+
const fileToAnnotationKey = {}
|
|
160
|
+
Object.entries(appConfig.all)
|
|
161
|
+
.filter(([_, extConf]) => extConf.manifest?.full?.packages)
|
|
162
|
+
.forEach(([ext, extConf]) => {
|
|
163
|
+
Object.entries(extConf.manifest.full.packages)
|
|
164
|
+
.filter(([pkg, pkgConf]) => pkgConf.actions)
|
|
165
|
+
.forEach(([pkg, pkgConf]) => {
|
|
166
|
+
Object.entries(pkgConf.actions).forEach(([action, actionConf]) => {
|
|
167
|
+
const baseFullKey = ext === 'application'
|
|
168
|
+
? `application.runtimeManifest.packages.${pkg}.actions.${action}`
|
|
169
|
+
: `extensions.${ext}.runtimeManifest.packages.${pkg}.actions.${action}`
|
|
170
|
+
|
|
171
|
+
let index
|
|
172
|
+
if (actionConf.annotations) {
|
|
173
|
+
index = appConfig.includeIndex[`${baseFullKey}.annotations`]
|
|
174
|
+
} else {
|
|
175
|
+
// the annotation object is not defined, take the parent key
|
|
176
|
+
index = appConfig.includeIndex[baseFullKey]
|
|
177
|
+
}
|
|
178
|
+
if (!fileToAnnotationKey[index.file]) {
|
|
179
|
+
fileToAnnotationKey[index.file] = []
|
|
180
|
+
}
|
|
181
|
+
fileToAnnotationKey[index.file].push(index.key) // index.key is relative to the file
|
|
182
|
+
})
|
|
183
|
+
})
|
|
184
|
+
})
|
|
185
|
+
|
|
186
|
+
// rewrite config files
|
|
187
|
+
for (const [file, keys] of Object.entries(fileToAnnotationKey)) {
|
|
188
|
+
const configFilePath = path.join(outputPath, file)
|
|
189
|
+
const { values } = loadConfigFile(configFilePath)
|
|
190
|
+
|
|
191
|
+
keys.forEach(key => {
|
|
192
|
+
const object = getObjectValue(values, key)
|
|
193
|
+
if (key.endsWith('.annotations') || key === 'annotations') {
|
|
194
|
+
// object is the annotations object
|
|
195
|
+
object['disable-download'] = true
|
|
196
|
+
} else {
|
|
197
|
+
// annotation object is not defined, the object is the action object
|
|
198
|
+
object.annotations = { 'disable-download': true }
|
|
199
|
+
}
|
|
200
|
+
})
|
|
201
|
+
|
|
202
|
+
// write back the modified manifest to disk
|
|
203
|
+
await writeFile(configFilePath, jsYaml.dump(values), { overwrite: true })
|
|
204
|
+
}
|
|
205
|
+
this.spinner.succeed('Added disable-download annotations')
|
|
206
|
+
}
|
|
142
207
|
}
|
|
143
208
|
|
|
144
209
|
InstallCommand.hidden = true // hide from help for pre-release
|
|
@@ -155,12 +220,12 @@ InstallCommand.flags = {
|
|
|
155
220
|
})
|
|
156
221
|
}
|
|
157
222
|
|
|
158
|
-
InstallCommand.args =
|
|
223
|
+
InstallCommand.args =
|
|
159
224
|
{
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
225
|
+
path: Args.string({
|
|
226
|
+
description: 'Path to the app package to install',
|
|
227
|
+
required: true
|
|
228
|
+
})
|
|
163
229
|
}
|
|
164
|
-
]
|
|
165
230
|
|
|
166
231
|
module.exports = InstallCommand
|
|
@@ -66,6 +66,6 @@ ListExtensionPointsCommand.flags = {
|
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
ListExtensionPointsCommand.aliases = ['app:list:ext-points', 'app:list:extension-points']
|
|
69
|
-
ListExtensionPointsCommand.args =
|
|
69
|
+
ListExtensionPointsCommand.args = {}
|
|
70
70
|
|
|
71
71
|
module.exports = ListExtensionPointsCommand
|
package/src/commands/app/pack.js
CHANGED
|
@@ -10,15 +10,14 @@ governing permissions and limitations under the License.
|
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
const BaseCommand = require('../../BaseCommand')
|
|
13
|
-
const { Flags } = require('@oclif/core')
|
|
13
|
+
const { Flags, Args } = require('@oclif/core')
|
|
14
14
|
const path = require('node:path')
|
|
15
15
|
const fs = require('fs-extra')
|
|
16
16
|
const aioLogger = require('@adobe/aio-lib-core-logging')('@adobe/aio-cli-plugin-app:pack', { provider: 'debug' })
|
|
17
17
|
const archiver = require('archiver')
|
|
18
18
|
const yaml = require('js-yaml')
|
|
19
19
|
const execa = require('execa')
|
|
20
|
-
const {
|
|
21
|
-
const { getObjectValue } = require('../../lib/app-helper')
|
|
20
|
+
const { writeFile } = require('../../lib/import-helper')
|
|
22
21
|
const ora = require('ora')
|
|
23
22
|
const chalk = require('chalk')
|
|
24
23
|
|
|
@@ -70,10 +69,6 @@ class Pack extends BaseCommand {
|
|
|
70
69
|
await this.createDeployYamlFile(appConfig)
|
|
71
70
|
this.spinner.succeed('Created configuration files')
|
|
72
71
|
|
|
73
|
-
this.spinner.start('Adding code-download annotations...')
|
|
74
|
-
await this.addCodeDownloadAnnotation(appConfig)
|
|
75
|
-
this.spinner.succeed('Added code-download annotations')
|
|
76
|
-
|
|
77
72
|
// doing this before zip so other things can be added to the zip
|
|
78
73
|
await this.config.runHook('post-pack', { appConfig, artifactsFolder: DEFAULTS.ARTIFACTS_FOLDER })
|
|
79
74
|
|
|
@@ -135,13 +130,23 @@ class Pack extends BaseCommand {
|
|
|
135
130
|
// TODO: send a PR to their plugin to have a `--json` flag
|
|
136
131
|
const command = await this.config.findCommand('api-mesh:get')
|
|
137
132
|
if (command) {
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
133
|
+
try {
|
|
134
|
+
this.spinner.start('Getting api-mesh config...')
|
|
135
|
+
const { stdout } = await execa('aio', ['api-mesh', 'get'], { cwd: process.cwd() })
|
|
136
|
+
// until we get the --json flag, we parse the output
|
|
137
|
+
const idx = stdout.indexOf('{')
|
|
138
|
+
meshConfig = JSON.parse(stdout.substring(idx))
|
|
139
|
+
aioLogger.debug(`api-mesh:get - ${JSON.stringify(meshConfig, null, 2)}`)
|
|
140
|
+
this.spinner.succeed('Got api-mesh config')
|
|
141
|
+
} catch (err) {
|
|
142
|
+
// Ignore error if no mesh found, otherwise throw
|
|
143
|
+
if (err?.stderr.includes('Error: Unable to get mesh config. No mesh found for Org')) {
|
|
144
|
+
aioLogger.debug('No api-mesh config found')
|
|
145
|
+
} else {
|
|
146
|
+
console.error(err)
|
|
147
|
+
throw err
|
|
148
|
+
}
|
|
149
|
+
}
|
|
145
150
|
} else {
|
|
146
151
|
aioLogger.debug('api-mesh:get command was not found, meshConfig is not available for app:pack')
|
|
147
152
|
}
|
|
@@ -233,42 +238,6 @@ class Pack extends BaseCommand {
|
|
|
233
238
|
.map(file => file.path)
|
|
234
239
|
.filter(file => !filesToExclude.includes(file))
|
|
235
240
|
}
|
|
236
|
-
|
|
237
|
-
/**
|
|
238
|
-
* An annotation called code-download will be added to all actions in app.config.yaml
|
|
239
|
-
* (and linked yaml configs for example in extensions). This value will be set to false.
|
|
240
|
-
* The annotation will by default be true if not set.
|
|
241
|
-
*
|
|
242
|
-
* @param {object} appConfig the app's configuration file
|
|
243
|
-
*/
|
|
244
|
-
async addCodeDownloadAnnotation (appConfig) {
|
|
245
|
-
// get the configFiles that have runtime manifests
|
|
246
|
-
const configFiles = []
|
|
247
|
-
for (const [, value] of Object.entries(appConfig.includeIndex)) {
|
|
248
|
-
const { key } = value
|
|
249
|
-
if (key === 'runtimeManifest' || key === 'application.runtimeManifest') {
|
|
250
|
-
configFiles.push(value)
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
// for each configFile, we modify each action to have the "code-download: false" annotation
|
|
255
|
-
for (const configFile of configFiles) {
|
|
256
|
-
const configFilePath = path.join(DEFAULTS.ARTIFACTS_FOLDER, configFile.file)
|
|
257
|
-
const { values } = loadConfigFile(configFilePath)
|
|
258
|
-
|
|
259
|
-
const runtimeManifest = getObjectValue(values, configFile.key)
|
|
260
|
-
for (const [, pkgManifest] of Object.entries(runtimeManifest.packages)) {
|
|
261
|
-
// key is the package name (unused), value is the package manifest. we iterate through each package's "actions"
|
|
262
|
-
for (const [, actionManifest] of Object.entries(pkgManifest.actions)) {
|
|
263
|
-
// key is the action name (unused), value is the action manifest. we add the "code-download: false" annotation
|
|
264
|
-
actionManifest.annotations['code-download'] = false
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
// write back the modified manifest to disk
|
|
269
|
-
await writeFile(configFilePath, yaml.dump(values), { overwrite: true })
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
241
|
}
|
|
273
242
|
|
|
274
243
|
Pack.hidden = true // hide from help for pre-release
|
|
@@ -285,12 +254,12 @@ Pack.flags = {
|
|
|
285
254
|
})
|
|
286
255
|
}
|
|
287
256
|
|
|
288
|
-
Pack.args =
|
|
257
|
+
Pack.args =
|
|
289
258
|
{
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
259
|
+
path: Args.string({
|
|
260
|
+
description: 'Path to the app directory to package',
|
|
261
|
+
default: '.'
|
|
262
|
+
})
|
|
293
263
|
}
|
|
294
|
-
]
|
|
295
264
|
|
|
296
265
|
module.exports = Pack
|
package/src/commands/app/run.js
CHANGED
|
@@ -15,8 +15,9 @@ const chalk = require('chalk')
|
|
|
15
15
|
const fs = require('fs-extra')
|
|
16
16
|
const https = require('https')
|
|
17
17
|
const getPort = require('get-port')
|
|
18
|
+
const open = require('open')
|
|
18
19
|
|
|
19
|
-
const { Flags,
|
|
20
|
+
const { Flags, ux } = require('@oclif/core')
|
|
20
21
|
const coreConfig = require('@adobe/aio-lib-core-config')
|
|
21
22
|
|
|
22
23
|
const BaseCommand = require('../../BaseCommand')
|
|
@@ -117,7 +118,7 @@ class Run extends BaseCommand {
|
|
|
117
118
|
const launchUrl = this.getLaunchUrlPrefix() + frontendUrl
|
|
118
119
|
if (flags.open) {
|
|
119
120
|
this.log(chalk.blue(chalk.bold(`Opening your deployed application in the Experience Cloud shell:\n -> ${launchUrl}`)))
|
|
120
|
-
|
|
121
|
+
open(launchUrl)
|
|
121
122
|
} else {
|
|
122
123
|
this.log(chalk.blue(chalk.bold(`To view your deployed application in the Experience Cloud shell:\n -> ${launchUrl}`)))
|
|
123
124
|
}
|
|
@@ -178,17 +179,17 @@ class Run extends BaseCommand {
|
|
|
178
179
|
const actualPort = await getPort({ port })
|
|
179
180
|
server.listen(actualPort)
|
|
180
181
|
this.log('A self signed development certificate has been generated, you will need to accept it in your browser in order to use it.')
|
|
181
|
-
|
|
182
|
-
|
|
182
|
+
open(`https://localhost:${actualPort}`)
|
|
183
|
+
ux.action.start('Waiting for the certificate to be accepted.')
|
|
183
184
|
// eslint-disable-next-line no-unmodified-loop-condition
|
|
184
185
|
while (!certAccepted && Date.now() - startTime < 20000) {
|
|
185
|
-
await
|
|
186
|
+
await ux.wait()
|
|
186
187
|
}
|
|
187
188
|
if (certAccepted) {
|
|
188
|
-
|
|
189
|
+
ux.action.stop()
|
|
189
190
|
this.log('Great, you accepted the certificate!')
|
|
190
191
|
} else {
|
|
191
|
-
|
|
192
|
+
ux.action.stop('timed out')
|
|
192
193
|
}
|
|
193
194
|
server.close()
|
|
194
195
|
|
|
@@ -198,6 +199,8 @@ class Run extends BaseCommand {
|
|
|
198
199
|
|
|
199
200
|
Run.description = 'Run an Adobe I/O App'
|
|
200
201
|
|
|
202
|
+
Run.args = {}
|
|
203
|
+
|
|
201
204
|
Run.flags = {
|
|
202
205
|
...BaseCommand.flags,
|
|
203
206
|
local: Flags.boolean({
|
|
@@ -12,7 +12,6 @@ governing permissions and limitations under the License.
|
|
|
12
12
|
|
|
13
13
|
const ora = require('ora')
|
|
14
14
|
const chalk = require('chalk')
|
|
15
|
-
// const path = require('path')
|
|
16
15
|
|
|
17
16
|
const { Flags } = require('@oclif/core')
|
|
18
17
|
|
|
@@ -79,6 +78,14 @@ class Undeploy extends BaseCommand {
|
|
|
79
78
|
// undeploy
|
|
80
79
|
try {
|
|
81
80
|
await runInProcess(config.hooks['pre-app-undeploy'], config)
|
|
81
|
+
if (flags['feature-event-hooks'] && flags.events) {
|
|
82
|
+
this.log('feature-event-hooks is enabled, running pre-undeploy-event-reg hook')
|
|
83
|
+
const hookResults = await this.config.runHook('pre-undeploy-event-reg', { appConfig: config })
|
|
84
|
+
if (hookResults?.failures?.length > 0) {
|
|
85
|
+
// output should be "Error : <plugin-name> : <error-message>\n" for each failure
|
|
86
|
+
this.error(hookResults.failures.map(f => `${f.plugin.name} : ${f.error.message}`).join('\nError: '), { exit: 1 })
|
|
87
|
+
}
|
|
88
|
+
}
|
|
82
89
|
} catch (err) {
|
|
83
90
|
this.log(err)
|
|
84
91
|
}
|
|
@@ -86,7 +93,6 @@ class Undeploy extends BaseCommand {
|
|
|
86
93
|
if (flags.actions) {
|
|
87
94
|
if (config.app.hasBackend) {
|
|
88
95
|
try {
|
|
89
|
-
this.config.runHook('pre-undeploy-event-reg', { appConfig: config })
|
|
90
96
|
const script = await runInProcess(config.hooks['undeploy-actions'], config)
|
|
91
97
|
if (!script) {
|
|
92
98
|
await rtLib.undeployActions(config)
|
|
@@ -118,16 +124,7 @@ class Undeploy extends BaseCommand {
|
|
|
118
124
|
}
|
|
119
125
|
|
|
120
126
|
try {
|
|
121
|
-
this.config.runHook('post-undeploy-event-reg', { appConfig: config })
|
|
122
127
|
await runInProcess(config.hooks['post-app-undeploy'], config)
|
|
123
|
-
if (flags['feature-event-hooks'] && flags.events) {
|
|
124
|
-
this.log('feature-event-hooks is enabled, running post-undeploy-event-reg hook')
|
|
125
|
-
const hookResults = await this.config.runHook('post-undeploy-event-reg', { appConfig: config })
|
|
126
|
-
if (hookResults?.failures?.length > 0) {
|
|
127
|
-
// output should be "Error : <plugin-name> : <error-message>\n" for each failure
|
|
128
|
-
this.error(hookResults.failures.map(f => `${f.plugin.name} : ${f.error.message}`).join('\nError: '), { exit: 1 })
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
128
|
} catch (err) {
|
|
132
129
|
this.log(err)
|
|
133
130
|
}
|
|
@@ -190,6 +187,6 @@ Undeploy.flags = {
|
|
|
190
187
|
})
|
|
191
188
|
}
|
|
192
189
|
|
|
193
|
-
Undeploy.args =
|
|
190
|
+
Undeploy.args = {}
|
|
194
191
|
|
|
195
192
|
module.exports = Undeploy
|
package/src/commands/app/use.js
CHANGED
|
@@ -12,7 +12,7 @@ governing permissions and limitations under the License.
|
|
|
12
12
|
const BaseCommand = require('../../BaseCommand')
|
|
13
13
|
const { CONSOLE_CONFIG_KEY, getProjectCredentialType } = require('../../lib/import-helper')
|
|
14
14
|
const { importConsoleConfig, downloadConsoleConfigToBuffer } = require('../../lib/import')
|
|
15
|
-
const { Flags } = require('@oclif/core')
|
|
15
|
+
const { Flags, Args } = require('@oclif/core')
|
|
16
16
|
const inquirer = require('inquirer')
|
|
17
17
|
const config = require('@adobe/aio-lib-core-config')
|
|
18
18
|
const { EOL } = require('os')
|
|
@@ -341,7 +341,7 @@ If the optional configuration file is not set, this command will retrieve the co
|
|
|
341
341
|
|
|
342
342
|
To set these global config values, see the help text for 'aio console --help'.
|
|
343
343
|
|
|
344
|
-
To download the configuration file for your project, select the 'Download' button in the toolbar of your project's page in https://
|
|
344
|
+
To download the configuration file for your project, select the 'Download' button in the toolbar of your project's page in https://developer.adobe.com/console/
|
|
345
345
|
`
|
|
346
346
|
|
|
347
347
|
Use.flags = {
|
|
@@ -398,12 +398,12 @@ Use.flags = {
|
|
|
398
398
|
})
|
|
399
399
|
}
|
|
400
400
|
|
|
401
|
-
Use.args =
|
|
401
|
+
Use.args =
|
|
402
402
|
{
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
403
|
+
config_file_path: Args.string({
|
|
404
|
+
description: 'path to an Adobe I/O Developer Console configuration file',
|
|
405
|
+
required: false
|
|
406
|
+
})
|
|
406
407
|
}
|
|
407
|
-
]
|
|
408
408
|
|
|
409
409
|
module.exports = Use
|
package/src/lib/app-helper.js
CHANGED
|
@@ -71,6 +71,7 @@ async function installPackages (dir, options = { spinner: null, verbose: false }
|
|
|
71
71
|
* @param {string} scriptName npm script name
|
|
72
72
|
* @param {string} dir directory to run npm script in
|
|
73
73
|
* @param {string[]} cmdArgs args to pass to npm script
|
|
74
|
+
* @returns {object} the child process
|
|
74
75
|
*/
|
|
75
76
|
async function runPackageScript (scriptName, dir, cmdArgs = []) {
|
|
76
77
|
aioLogger.debug(`running npm run-script ${scriptName} in dir: ${dir}`)
|
|
@@ -85,7 +86,6 @@ async function runPackageScript (scriptName, dir, cmdArgs = []) {
|
|
|
85
86
|
}
|
|
86
87
|
|
|
87
88
|
/**
|
|
88
|
-
*
|
|
89
89
|
* @param {string} hookPath to be require()'d and run. Should export an async function that takes a config object as its only argument
|
|
90
90
|
* @param {object} config which will be passed to the hook
|
|
91
91
|
* @returns {Promise<*>} whatever the hook returns
|
|
@@ -357,7 +357,7 @@ async function runOpenWhiskJar (jarFile, runtimeConfigFile, apihost, waitInitTim
|
|
|
357
357
|
|
|
358
358
|
/**
|
|
359
359
|
*
|
|
360
|
-
*
|
|
360
|
+
*Converts a service array to an input string that can be consumed by generator-aio-app
|
|
361
361
|
*
|
|
362
362
|
* @param {Array} services array of services [{ code: 'xxx', name: 'xxx' }, ...]
|
|
363
363
|
* @returns {string} 'code1,code2,code3'
|
package/src/lib/import-helper.js
CHANGED
|
@@ -200,24 +200,24 @@ async function checkFileConflict (filePath) {
|
|
|
200
200
|
* Transform a json object to a flattened version. Any nesting is separated by the `separator` string.
|
|
201
201
|
* For example, if you have the `_` separator string, flattening this:
|
|
202
202
|
*
|
|
203
|
+
* @example
|
|
203
204
|
* {
|
|
204
|
-
*
|
|
205
|
-
*
|
|
206
|
-
*
|
|
207
|
-
*
|
|
208
|
-
*
|
|
209
|
-
*
|
|
205
|
+
* foo: {
|
|
206
|
+
* bar: 'a',
|
|
207
|
+
* baz: {
|
|
208
|
+
* faz: 'b'
|
|
209
|
+
* }
|
|
210
|
+
* }
|
|
210
211
|
* }
|
|
211
212
|
*
|
|
212
213
|
* const result = flattenObjectWithSeparator(json, {}, '', '_)
|
|
213
214
|
* The result would then be:
|
|
214
215
|
* {
|
|
215
|
-
*
|
|
216
|
-
*
|
|
216
|
+
* 'foo_bar': 'a',
|
|
217
|
+
* 'foo_baz_faz': 'b'
|
|
217
218
|
* }
|
|
218
219
|
*
|
|
219
220
|
* Any underscores in the object key are escaped with an underscore.
|
|
220
|
-
*
|
|
221
221
|
* @param {object} json the json object to transform
|
|
222
222
|
* @param {object} result the result object to initialize the function with
|
|
223
223
|
* @param {string} prefix the prefix to add to the final key
|