@adobe/aio-cli-plugin-app 11.1.0 → 12.0.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 CHANGED
@@ -70,7 +70,7 @@ DESCRIPTION
70
70
  Create, run, test, and deploy Adobe I/O Apps
71
71
  ```
72
72
 
73
- _See code: [src/commands/app/index.ts](https://github.com/adobe/aio-cli-plugin-app/blob/11.1.0/src/commands/app/index.ts)_
73
+ _See code: [src/commands/app/index.ts](https://github.com/adobe/aio-cli-plugin-app/blob/12.0.0/src/commands/app/index.ts)_
74
74
 
75
75
  ## `aio app add`
76
76
 
@@ -88,7 +88,7 @@ DESCRIPTION
88
88
  Add a new component to an existing Adobe I/O App
89
89
  ```
90
90
 
91
- _See code: [src/commands/app/add/index.ts](https://github.com/adobe/aio-cli-plugin-app/blob/11.1.0/src/commands/app/add/index.ts)_
91
+ _See code: [src/commands/app/add/index.ts](https://github.com/adobe/aio-cli-plugin-app/blob/12.0.0/src/commands/app/add/index.ts)_
92
92
 
93
93
  ## `aio app add action`
94
94
 
@@ -113,7 +113,7 @@ ALIASES
113
113
  $ aio app add actions
114
114
  ```
115
115
 
116
- _See code: [src/commands/app/add/action.ts](https://github.com/adobe/aio-cli-plugin-app/blob/11.1.0/src/commands/app/add/action.ts)_
116
+ _See code: [src/commands/app/add/action.ts](https://github.com/adobe/aio-cli-plugin-app/blob/12.0.0/src/commands/app/add/action.ts)_
117
117
 
118
118
  ## `aio app add ci`
119
119
 
@@ -131,7 +131,7 @@ DESCRIPTION
131
131
  Add CI files
132
132
  ```
133
133
 
134
- _See code: [src/commands/app/add/ci.ts](https://github.com/adobe/aio-cli-plugin-app/blob/11.1.0/src/commands/app/add/ci.ts)_
134
+ _See code: [src/commands/app/add/ci.ts](https://github.com/adobe/aio-cli-plugin-app/blob/12.0.0/src/commands/app/add/ci.ts)_
135
135
 
136
136
  ## `aio app add event`
137
137
 
@@ -156,7 +156,7 @@ ALIASES
156
156
  $ aio app add events
157
157
  ```
158
158
 
159
- _See code: [src/commands/app/add/event.ts](https://github.com/adobe/aio-cli-plugin-app/blob/11.1.0/src/commands/app/add/event.ts)_
159
+ _See code: [src/commands/app/add/event.ts](https://github.com/adobe/aio-cli-plugin-app/blob/12.0.0/src/commands/app/add/event.ts)_
160
160
 
161
161
  ## `aio app add extension`
162
162
 
@@ -182,7 +182,7 @@ ALIASES
182
182
  $ aio app add extensions
183
183
  ```
184
184
 
185
- _See code: [src/commands/app/add/extension.ts](https://github.com/adobe/aio-cli-plugin-app/blob/11.1.0/src/commands/app/add/extension.ts)_
185
+ _See code: [src/commands/app/add/extension.ts](https://github.com/adobe/aio-cli-plugin-app/blob/12.0.0/src/commands/app/add/extension.ts)_
186
186
 
187
187
  ## `aio app add service`
188
188
 
@@ -206,7 +206,7 @@ ALIASES
206
206
  $ aio app add services
207
207
  ```
208
208
 
209
- _See code: [src/commands/app/add/service.ts](https://github.com/adobe/aio-cli-plugin-app/blob/11.1.0/src/commands/app/add/service.ts)_
209
+ _See code: [src/commands/app/add/service.ts](https://github.com/adobe/aio-cli-plugin-app/blob/12.0.0/src/commands/app/add/service.ts)_
210
210
 
211
211
  ## `aio app add web-assets`
212
212
 
@@ -227,7 +227,7 @@ DESCRIPTION
227
227
  Add web assets support
228
228
  ```
229
229
 
230
- _See code: [src/commands/app/add/web-assets.ts](https://github.com/adobe/aio-cli-plugin-app/blob/11.1.0/src/commands/app/add/web-assets.ts)_
230
+ _See code: [src/commands/app/add/web-assets.ts](https://github.com/adobe/aio-cli-plugin-app/blob/12.0.0/src/commands/app/add/web-assets.ts)_
231
231
 
232
232
  ## `aio app build`
233
233
 
@@ -256,7 +256,7 @@ DESCRIPTION
256
256
  This will always force a rebuild unless --no-force-build is set.
257
257
  ```
258
258
 
259
- _See code: [src/commands/app/build.ts](https://github.com/adobe/aio-cli-plugin-app/blob/11.1.0/src/commands/app/build.ts)_
259
+ _See code: [src/commands/app/build.ts](https://github.com/adobe/aio-cli-plugin-app/blob/12.0.0/src/commands/app/build.ts)_
260
260
 
261
261
  ## `aio app create [PATH]`
262
262
 
@@ -278,7 +278,7 @@ DESCRIPTION
278
278
  Create a new Adobe I/O App with default parameters
279
279
  ```
280
280
 
281
- _See code: [src/commands/app/create.ts](https://github.com/adobe/aio-cli-plugin-app/blob/11.1.0/src/commands/app/create.ts)_
281
+ _See code: [src/commands/app/create.ts](https://github.com/adobe/aio-cli-plugin-app/blob/12.0.0/src/commands/app/create.ts)_
282
282
 
283
283
  ## `aio app delete`
284
284
 
@@ -296,7 +296,7 @@ DESCRIPTION
296
296
  Delete a component from an existing Adobe I/O App
297
297
  ```
298
298
 
299
- _See code: [src/commands/app/delete/index.ts](https://github.com/adobe/aio-cli-plugin-app/blob/11.1.0/src/commands/app/delete/index.ts)_
299
+ _See code: [src/commands/app/delete/index.ts](https://github.com/adobe/aio-cli-plugin-app/blob/12.0.0/src/commands/app/delete/index.ts)_
300
300
 
301
301
  ## `aio app delete action [ACTION-NAME]`
302
302
 
@@ -322,7 +322,7 @@ ALIASES
322
322
  $ aio app delete actions
323
323
  ```
324
324
 
325
- _See code: [src/commands/app/delete/action.ts](https://github.com/adobe/aio-cli-plugin-app/blob/11.1.0/src/commands/app/delete/action.ts)_
325
+ _See code: [src/commands/app/delete/action.ts](https://github.com/adobe/aio-cli-plugin-app/blob/12.0.0/src/commands/app/delete/action.ts)_
326
326
 
327
327
  ## `aio app delete ci`
328
328
 
@@ -341,7 +341,7 @@ DESCRIPTION
341
341
  Delete existing CI files
342
342
  ```
343
343
 
344
- _See code: [src/commands/app/delete/ci.ts](https://github.com/adobe/aio-cli-plugin-app/blob/11.1.0/src/commands/app/delete/ci.ts)_
344
+ _See code: [src/commands/app/delete/ci.ts](https://github.com/adobe/aio-cli-plugin-app/blob/12.0.0/src/commands/app/delete/ci.ts)_
345
345
 
346
346
  ## `aio app delete extension`
347
347
 
@@ -367,7 +367,7 @@ ALIASES
367
367
  $ aio app delete extensions
368
368
  ```
369
369
 
370
- _See code: [src/commands/app/delete/extension.ts](https://github.com/adobe/aio-cli-plugin-app/blob/11.1.0/src/commands/app/delete/extension.ts)_
370
+ _See code: [src/commands/app/delete/extension.ts](https://github.com/adobe/aio-cli-plugin-app/blob/12.0.0/src/commands/app/delete/extension.ts)_
371
371
 
372
372
  ## `aio app delete service`
373
373
 
@@ -391,7 +391,7 @@ ALIASES
391
391
  $ aio app delete services
392
392
  ```
393
393
 
394
- _See code: [src/commands/app/delete/service.ts](https://github.com/adobe/aio-cli-plugin-app/blob/11.1.0/src/commands/app/delete/service.ts)_
394
+ _See code: [src/commands/app/delete/service.ts](https://github.com/adobe/aio-cli-plugin-app/blob/12.0.0/src/commands/app/delete/service.ts)_
395
395
 
396
396
  ## `aio app delete web-assets`
397
397
 
@@ -410,7 +410,7 @@ DESCRIPTION
410
410
  Delete existing web assets
411
411
  ```
412
412
 
413
- _See code: [src/commands/app/delete/web-assets.ts](https://github.com/adobe/aio-cli-plugin-app/blob/11.1.0/src/commands/app/delete/web-assets.ts)_
413
+ _See code: [src/commands/app/delete/web-assets.ts](https://github.com/adobe/aio-cli-plugin-app/blob/12.0.0/src/commands/app/delete/web-assets.ts)_
414
414
 
415
415
  ## `aio app deploy`
416
416
 
@@ -451,7 +451,7 @@ DESCRIPTION
451
451
  This will always force a rebuild unless --no-force-build is set.
452
452
  ```
453
453
 
454
- _See code: [src/commands/app/deploy.ts](https://github.com/adobe/aio-cli-plugin-app/blob/11.1.0/src/commands/app/deploy.ts)_
454
+ _See code: [src/commands/app/deploy.ts](https://github.com/adobe/aio-cli-plugin-app/blob/12.0.0/src/commands/app/deploy.ts)_
455
455
 
456
456
  ## `aio app get-url [ACTION]`
457
457
 
@@ -474,7 +474,7 @@ DESCRIPTION
474
474
  Get action URLs
475
475
  ```
476
476
 
477
- _See code: [src/commands/app/get-url.ts](https://github.com/adobe/aio-cli-plugin-app/blob/11.1.0/src/commands/app/get-url.ts)_
477
+ _See code: [src/commands/app/get-url.ts](https://github.com/adobe/aio-cli-plugin-app/blob/12.0.0/src/commands/app/get-url.ts)_
478
478
 
479
479
  ## `aio app info`
480
480
 
@@ -496,7 +496,7 @@ DESCRIPTION
496
496
  Display settings/configuration in use by an Adobe I/O App
497
497
  ```
498
498
 
499
- _See code: [src/commands/app/info.ts](https://github.com/adobe/aio-cli-plugin-app/blob/11.1.0/src/commands/app/info.ts)_
499
+ _See code: [src/commands/app/info.ts](https://github.com/adobe/aio-cli-plugin-app/blob/12.0.0/src/commands/app/info.ts)_
500
500
 
501
501
  ## `aio app init [PATH]`
502
502
 
@@ -505,33 +505,34 @@ Create a new Adobe I/O App
505
505
  ```
506
506
  USAGE
507
507
  $ aio app init [PATH] [-v] [--version] [--install] [-y] [--login] [-e <value> | -t <value> | --repo <value>]
508
- [--standalone-app | | ] [-w <value> | -i <value>] [--confirm-new-workspace] [--use-jwt]
508
+ [--standalone-app | | ] [-w <value> | -i <value>] [--confirm-new-workspace] [--use-jwt] [--github-pat <value> ]
509
509
 
510
510
  ARGUMENTS
511
511
  PATH [default: .] Path to the app directory
512
512
 
513
513
  FLAGS
514
- -e, --extension=<value>... Extension point(s) to implement
515
- -i, --import=<value> Import an Adobe I/O Developer Console configuration file
516
- -t, --template=<value>... Specify a link to a template that will be installed
517
- -v, --verbose Verbose output
518
- -w, --workspace=<value> [default: Stage] Specify the Adobe Developer Console Workspace to init from, defaults to
519
- Stage
520
- -y, --yes Skip questions, and use all default values
521
- --confirm-new-workspace Skip and confirm prompt for creating a new workspace
522
- --[no-]install [default: true] Run npm installation after files are created
523
- --[no-]login Login using your Adobe ID for interacting with Adobe I/O Developer Console
524
- --repo=<value> Init from gh quick-start repo. Expected to be of the form <owner>/<repo>/<path>
525
- --standalone-app Create a stand-alone application
526
- --use-jwt if the config has both jwt and OAuth Server to Server Credentials (while migrating),
527
- prefer the JWT credentials
528
- --version Show version
514
+ -e, --extension=<value>... Extension point(s) to implement
515
+ -i, --import=<value> Import an Adobe I/O Developer Console configuration file
516
+ -t, --template=<value>... Specify a link to a template that will be installed
517
+ -v, --verbose Verbose output
518
+ -w, --workspace=<value> [default: Stage] Specify the Adobe Developer Console Workspace to init from, defaults to
519
+ Stage
520
+ -y, --yes Skip questions, and use all default values
521
+ --[no-]confirm-new-workspace Prompt to confirm before creating a new workspace
522
+ --github-pat=<value> github personal access token to use for downloading private quickstart repos
523
+ --[no-]install [default: true] Run npm installation after files are created
524
+ --[no-]login Login using your Adobe ID for interacting with Adobe I/O Developer Console
525
+ --repo=<value> Init from gh quick-start repo. Expected to be of the form <owner>/<repo>/<path>
526
+ --standalone-app Create a stand-alone application
527
+ --use-jwt if the config has both jwt and OAuth Server to Server Credentials (while migrating),
528
+ prefer the JWT credentials
529
+ --version Show version
529
530
 
530
531
  DESCRIPTION
531
532
  Create a new Adobe I/O App
532
533
  ```
533
534
 
534
- _See code: [src/commands/app/init.ts](https://github.com/adobe/aio-cli-plugin-app/blob/11.1.0/src/commands/app/init.ts)_
535
+ _See code: [src/commands/app/init.ts](https://github.com/adobe/aio-cli-plugin-app/blob/12.0.0/src/commands/app/init.ts)_
535
536
 
536
537
  ## `aio app list`
537
538
 
@@ -549,7 +550,7 @@ DESCRIPTION
549
550
  List components for Adobe I/O App
550
551
  ```
551
552
 
552
- _See code: [src/commands/app/list/index.ts](https://github.com/adobe/aio-cli-plugin-app/blob/11.1.0/src/commands/app/list/index.ts)_
553
+ _See code: [src/commands/app/list/index.ts](https://github.com/adobe/aio-cli-plugin-app/blob/12.0.0/src/commands/app/list/index.ts)_
553
554
 
554
555
  ## `aio app list extension`
555
556
 
@@ -574,7 +575,7 @@ ALIASES
574
575
  $ aio app list extensions
575
576
  ```
576
577
 
577
- _See code: [src/commands/app/list/extension.ts](https://github.com/adobe/aio-cli-plugin-app/blob/11.1.0/src/commands/app/list/extension.ts)_
578
+ _See code: [src/commands/app/list/extension.ts](https://github.com/adobe/aio-cli-plugin-app/blob/12.0.0/src/commands/app/list/extension.ts)_
578
579
 
579
580
  ## `aio app logs`
580
581
 
@@ -598,7 +599,7 @@ DESCRIPTION
598
599
  Fetch logs for an Adobe I/O App
599
600
  ```
600
601
 
601
- _See code: [src/commands/app/logs.ts](https://github.com/adobe/aio-cli-plugin-app/blob/11.1.0/src/commands/app/logs.ts)_
602
+ _See code: [src/commands/app/logs.ts](https://github.com/adobe/aio-cli-plugin-app/blob/12.0.0/src/commands/app/logs.ts)_
602
603
 
603
604
  ## `aio app run`
604
605
 
@@ -621,7 +622,7 @@ DESCRIPTION
621
622
  Run an Adobe I/O App
622
623
  ```
623
624
 
624
- _See code: [src/commands/app/run.ts](https://github.com/adobe/aio-cli-plugin-app/blob/11.1.0/src/commands/app/run.ts)_
625
+ _See code: [src/commands/app/run.ts](https://github.com/adobe/aio-cli-plugin-app/blob/12.0.0/src/commands/app/run.ts)_
625
626
 
626
627
  ## `aio app test`
627
628
 
@@ -649,7 +650,7 @@ DESCRIPTION
649
650
  If the extension has a hook called 'test' in its 'ext.config.yaml', the script specified will be run instead.
650
651
  ```
651
652
 
652
- _See code: [src/commands/app/test.ts](https://github.com/adobe/aio-cli-plugin-app/blob/11.1.0/src/commands/app/test.ts)_
653
+ _See code: [src/commands/app/test.ts](https://github.com/adobe/aio-cli-plugin-app/blob/12.0.0/src/commands/app/test.ts)_
653
654
 
654
655
  ## `aio app undeploy`
655
656
 
@@ -674,7 +675,7 @@ DESCRIPTION
674
675
  Undeploys an Adobe I/O App
675
676
  ```
676
677
 
677
- _See code: [src/commands/app/undeploy.ts](https://github.com/adobe/aio-cli-plugin-app/blob/11.1.0/src/commands/app/undeploy.ts)_
678
+ _See code: [src/commands/app/undeploy.ts](https://github.com/adobe/aio-cli-plugin-app/blob/12.0.0/src/commands/app/undeploy.ts)_
678
679
 
679
680
  ## `aio app use [CONFIG_FILE_PATH]`
680
681
 
@@ -682,8 +683,8 @@ Import an Adobe Developer Console configuration file.
682
683
 
683
684
  ```
684
685
  USAGE
685
- $ aio app use [CONFIG_FILE_PATH] [-v] [--version] [--overwrite | --merge] [--confirm-new-workspace] [-w
686
- <value> | [-g | -w <value>] | ] [--no-service-sync | --confirm-service-sync] [--no-input] [--use-jwt]
686
+ $ aio app use [CONFIG_FILE_PATH] [-v] [--version] [--overwrite | --merge] [-g | -w <value>]
687
+ [--confirm-new-workspace] [--no-service-sync | --confirm-service-sync] [--no-input] [--use-jwt]
687
688
 
688
689
  ARGUMENTS
689
690
  CONFIG_FILE_PATH path to an Adobe I/O Developer Console configuration file
@@ -694,8 +695,7 @@ FLAGS
694
695
  -v, --verbose Verbose output
695
696
  -w, --workspace=<value> Specify the Adobe Developer Console Workspace name or Workspace id to import the
696
697
  configuration from
697
- -w, --workspace-name=<value> [DEPRECATED]: please use --workspace instead
698
- --confirm-new-workspace Skip and confirm prompt for creating a new workspace
698
+ --[no-]confirm-new-workspace Prompt to confirm before creating a new workspace
699
699
  --confirm-service-sync Skip the Service sync prompt and overwrite Service subscriptions in the new Workspace
700
700
  with current subscriptions
701
701
  --merge Merge any .aio and .env files during import of the Adobe Developer Console configuration
@@ -722,5 +722,5 @@ DESCRIPTION
722
722
  page in https://developer.adobe.com/console/
723
723
  ```
724
724
 
725
- _See code: [src/commands/app/use.ts](https://github.com/adobe/aio-cli-plugin-app/blob/11.1.0/src/commands/app/use.ts)_
725
+ _See code: [src/commands/app/use.ts](https://github.com/adobe/aio-cli-plugin-app/blob/12.0.0/src/commands/app/use.ts)_
726
726
  <!-- commandsstop -->
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "11.1.0",
2
+ "version": "12.0.0",
3
3
  "commands": {
4
4
  "app:build": {
5
5
  "id": "app:build",
@@ -512,8 +512,8 @@
512
512
  "confirm-new-workspace": {
513
513
  "name": "confirm-new-workspace",
514
514
  "type": "boolean",
515
- "description": "Skip and confirm prompt for creating a new workspace",
516
- "allowNo": false
515
+ "description": "Prompt to confirm before creating a new workspace",
516
+ "allowNo": true
517
517
  },
518
518
  "repo": {
519
519
  "name": "repo",
@@ -531,6 +531,15 @@
531
531
  "type": "boolean",
532
532
  "description": "if the config has both jwt and OAuth Server to Server Credentials (while migrating), prefer the JWT credentials",
533
533
  "allowNo": false
534
+ },
535
+ "github-pat": {
536
+ "name": "github-pat",
537
+ "type": "option",
538
+ "description": "github personal access token to use for downloading private quickstart repos",
539
+ "multiple": false,
540
+ "dependsOn": [
541
+ "repo"
542
+ ]
534
543
  }
535
544
  },
536
545
  "args": {
@@ -571,6 +580,12 @@
571
580
  "description": "The packaged app output folder path",
572
581
  "multiple": false,
573
582
  "default": "."
583
+ },
584
+ "tests": {
585
+ "name": "tests",
586
+ "type": "boolean",
587
+ "description": "Run packaged app unit tests (e.g. aio app:test)",
588
+ "allowNo": true
574
589
  }
575
590
  },
576
591
  "args": {
@@ -953,20 +968,18 @@
953
968
  "confirm-new-workspace": {
954
969
  "name": "confirm-new-workspace",
955
970
  "type": "boolean",
956
- "description": "Skip and confirm prompt for creating a new workspace",
957
- "allowNo": false
958
- },
959
- "workspace-name": {
960
- "name": "workspace-name",
961
- "type": "option",
962
- "char": "w",
963
- "description": "[DEPRECATED]: please use --workspace instead",
964
- "multiple": false,
965
- "exclusive": [
966
- "global",
967
- "workspace"
968
- ],
969
- "default": ""
971
+ "description": "Prompt to confirm before creating a new workspace",
972
+ "allowNo": true,
973
+ "relationships": [
974
+ {
975
+ "type": "all",
976
+ "flags": [
977
+ {
978
+ "name": "workspace"
979
+ }
980
+ ]
981
+ }
982
+ ]
970
983
  },
971
984
  "no-service-sync": {
972
985
  "name": "no-service-sync",
package/package.json CHANGED
@@ -1,24 +1,23 @@
1
1
  {
2
2
  "name": "@adobe/aio-cli-plugin-app",
3
3
  "description": "Create, Build and Deploy Adobe I/O Applications",
4
- "version": "11.1.0",
4
+ "version": "12.0.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.1.0",
9
- "@adobe/aio-cli-lib-app-config-next": "npm:@adobe/aio-cli-lib-app-config@^3.0.0",
10
- "@adobe/aio-cli-lib-console": "^4.1.0",
11
- "@adobe/aio-lib-core-config": "^4.0.0",
12
- "@adobe/aio-lib-core-logging": "^2.0.0",
13
- "@adobe/aio-lib-core-networking": "^4.1.0",
14
- "@adobe/aio-lib-env": "^2.0.0",
15
- "@adobe/aio-lib-ims": "^6.0.0",
16
- "@adobe/aio-lib-runtime": "^5.0.0",
17
- "@adobe/aio-lib-templates": "^2.2.0",
18
- "@adobe/aio-lib-web": "^6.1.0",
19
- "@adobe/generator-aio-app": "^6.0.0",
20
- "@adobe/generator-app-common-lib": "^1.0.0",
21
- "@adobe/inquirer-table-checkbox": "^1.2.0",
8
+ "@adobe/aio-cli-lib-app-config": "^4",
9
+ "@adobe/aio-cli-lib-console": "^5",
10
+ "@adobe/aio-lib-core-config": "^5",
11
+ "@adobe/aio-lib-core-logging": "^3",
12
+ "@adobe/aio-lib-core-networking": "^5",
13
+ "@adobe/aio-lib-env": "^3",
14
+ "@adobe/aio-lib-ims": "^7",
15
+ "@adobe/aio-lib-runtime": "^6",
16
+ "@adobe/aio-lib-templates": "^3",
17
+ "@adobe/aio-lib-web": "^7",
18
+ "@adobe/generator-aio-app": "^7",
19
+ "@adobe/generator-app-common-lib": "^2",
20
+ "@adobe/inquirer-table-checkbox": "^2",
22
21
  "@octokit/rest": "^19.0.11",
23
22
  "@oclif/core": "^2.11.6",
24
23
  "@parcel/core": "^2.7.0",
@@ -54,7 +53,7 @@
54
53
  "yeoman-environment": "^3.2.0"
55
54
  },
56
55
  "devDependencies": {
57
- "@adobe/aio-lib-test-proxy": "^1.0.0",
56
+ "@adobe/aio-lib-test-proxy": "^2",
58
57
  "@adobe/eslint-config-aio-lib-config": "^2.0.2",
59
58
  "@types/jest": "^29",
60
59
  "babel-runtime": "^6.26.0",
@@ -75,7 +74,7 @@
75
74
  "typescript": "^5.1.6"
76
75
  },
77
76
  "engines": {
78
- "node": "^14.18 || ^16.13 || >=18"
77
+ "node": ">=18"
79
78
  },
80
79
  "files": [
81
80
  "bin/run",
@@ -18,7 +18,7 @@ const chalk = require('chalk')
18
18
  const coreConfig = require('@adobe/aio-lib-core-config')
19
19
  const DEFAULT_LAUNCH_PREFIX = 'https://experience.adobe.com/?devMode=true#/custom-apps/?localDevUrl='
20
20
  const STAGE_LAUNCH_PREFIX = 'https://experience-stage.adobe.com/?devMode=true#/custom-apps/?localDevUrl='
21
- const loadConfig = require('@adobe/aio-cli-lib-app-config')
21
+ const appConfig = require('@adobe/aio-cli-lib-app-config')
22
22
  const inquirer = require('inquirer')
23
23
  const { CONSOLE_API_KEYS, APPLICATION_CONFIG_KEY, EXTENSIONS_CONFIG_KEY } = require('./lib/defaults')
24
24
  const { getCliInfo } = require('./lib/app-helper')
@@ -35,20 +35,7 @@ class BaseCommand extends Command {
35
35
  async catch (error) {
36
36
  const { flags } = await this.parse(this.prototype)
37
37
  aioLogger.error(error) // debug log
38
- this.handleError(error, flags.verbose)
39
- }
40
-
41
- handleError (error, verbose) {
42
- const errorMessages = ['no such file or directory', 'find configuration']
43
- if (errorMessages.find(msg => error.message.includes(msg))) {
44
- const errorList = [
45
- 'Not a valid application root folder.',
46
- 'Please run \'aio app\' commands from a folder generated by aio app init',
47
- verbose ? error.stack : error.message
48
- ]
49
- this.error(errorList.join('\n'))
50
- }
51
- this.error(error.message)
38
+ this.error(flags.verbose ? error.stack : error.message)
52
39
  }
53
40
 
54
41
  async init () {
@@ -71,8 +58,8 @@ class BaseCommand extends Command {
71
58
  LibConsoleCLI.cleanStdOut()
72
59
  }
73
60
 
74
- getAppExtConfigs (flags, options = {}) {
75
- const all = this.getFullConfig(options).all
61
+ async getAppExtConfigs (flags, options = {}) {
62
+ const all = (await this.getFullConfig(options)).all
76
63
 
77
64
  // default case: no flags, return all
78
65
  let ret = all
@@ -102,41 +89,41 @@ class BaseCommand extends Command {
102
89
  return ret
103
90
  }
104
91
 
105
- getRuntimeManifestConfigFile (implName) {
92
+ async getRuntimeManifestConfigFile (implName) {
106
93
  let configKey
107
94
  if (implName === APPLICATION_CONFIG_KEY) {
108
95
  configKey = APPLICATION_CONFIG_KEY
109
96
  } else {
110
97
  configKey = `${EXTENSIONS_CONFIG_KEY}.${implName}`
111
98
  }
112
- let configData = this.getConfigFileForKey(`${configKey}.runtimeManifest`)
99
+ let configData = await this.getConfigFileForKey(`${configKey}.runtimeManifest`)
113
100
  if (!configData.file) {
114
101
  // first action manifest is not defined
115
- configData = this.getConfigFileForKey(`${configKey}`)
102
+ configData = await this.getConfigFileForKey(`${configKey}`)
116
103
  configData.key = configData.key + '.runtimeManifest'
117
104
  }
118
105
  return configData
119
106
  }
120
107
 
121
- getEventsConfigFile (implName) {
108
+ async getEventsConfigFile (implName) {
122
109
  let configKey
123
110
  if (implName === APPLICATION_CONFIG_KEY) {
124
111
  configKey = APPLICATION_CONFIG_KEY
125
112
  } else {
126
113
  configKey = `${EXTENSIONS_CONFIG_KEY}.${implName}`
127
114
  }
128
- let configData = this.getConfigFileForKey(`${configKey}.events`)
115
+ let configData = await this.getConfigFileForKey(`${configKey}.events`)
129
116
  if (!configData.file) {
130
117
  // first events manifest is not defined
131
- configData = this.getConfigFileForKey(`${configKey}`)
118
+ configData = await this.getConfigFileForKey(`${configKey}`)
132
119
  configData.key = configData.key + '.events'
133
120
  }
134
121
  return configData
135
122
  }
136
123
 
137
- getConfigFileForKey (fullKey) {
124
+ async getConfigFileForKey (fullKey) {
138
125
  // NOTE: the index returns undefined if the key is loaded from a legacy configuration file
139
- const fullConfig = this.getFullConfig()
126
+ const fullConfig = await this.getFullConfig()
140
127
  // full key like 'extensions.dx/excshell/1.runtimeManifest'
141
128
  // returns { key: relKey, file: configFile}
142
129
  const configData = fullConfig.includeIndex[fullKey]
@@ -148,9 +135,13 @@ class BaseCommand extends Command {
148
135
  return configData || {}
149
136
  }
150
137
 
151
- getFullConfig (options = {}) {
138
+ async getFullConfig (options = {}) {
139
+ // validate appConfig defaults to false for now
140
+ const validateAppConfig = options.validateAppConfig === true
141
+
152
142
  if (!this.appConfig) {
153
- this.appConfig = loadConfig(options)
143
+ // this will explicitly set validateAppConfig=false if not set
144
+ this.appConfig = await appConfig.load({ ...options, validateAppConfig })
154
145
  }
155
146
  return this.appConfig
156
147
  }
@@ -24,7 +24,7 @@ class AddActionCommand extends TemplatesCommand {
24
24
  aioLogger.debug(`add actions with flags: ${JSON.stringify(flags)}`)
25
25
 
26
26
  // guaranteed to have at least one, otherwise would throw in config load or in matching the ext name
27
- const entries = Object.entries(this.getAppExtConfigs(flags))
27
+ const entries = Object.entries(await this.getAppExtConfigs(flags))
28
28
  if (entries.length > 1) {
29
29
  this.error('Please use the \'-e\' flag to specify to which implementation you want to add actions to.')
30
30
  }
@@ -32,7 +32,7 @@ class AddActionCommand extends TemplatesCommand {
32
32
  const config = entries[0][1]
33
33
 
34
34
  const actionFolder = path.relative(config.root, config.actions.src)
35
- const configData = this.getRuntimeManifestConfigFile(configName)
35
+ const configData = await this.getRuntimeManifestConfigFile(configName)
36
36
 
37
37
  const projectOrgId = aioConfigLoader.get('project.org.id')
38
38
  if (!projectOrgId) {
@@ -23,7 +23,7 @@ class AddEventCommand extends TemplatesCommand {
23
23
  aioLogger.debug(`add events with flags: ${JSON.stringify(flags)}`)
24
24
 
25
25
  // guaranteed to have at least one, otherwise would throw in config load or in matching the ext name
26
- const entries = Object.entries(this.getAppExtConfigs(flags))
26
+ const entries = Object.entries(await this.getAppExtConfigs(flags))
27
27
  if (entries.length > 1) {
28
28
  this.error('Please use the \'-e\' flag to specify to which implementation you want to add events to.')
29
29
  }
@@ -31,8 +31,8 @@ class AddEventCommand extends TemplatesCommand {
31
31
  const configName = entries[0][0]
32
32
  const config = entries[0][1]
33
33
  const actionFolder = path.relative(config.root, config.actions.src)
34
- const runtimeManifestData = this.getRuntimeManifestConfigFile(configName)
35
- const eventsData = this.getEventsConfigFile(configName)
34
+ const runtimeManifestData = await this.getRuntimeManifestConfigFile(configName)
35
+ const eventsData = await this.getEventsConfigFile(configName)
36
36
  const templateOptions = {
37
37
  'skip-prompt': false,
38
38
  'action-folder': actionFolder,
@@ -24,7 +24,7 @@ class AddExtensionCommand extends TemplatesCommand {
24
24
  this.error('--extension= must also be provided when using --yes')
25
25
  }
26
26
 
27
- const fullConfig = this.getFullConfig({ allowNoImpl: true })
27
+ const fullConfig = await this.getFullConfig({ allowNoImpl: true })
28
28
  const alreadyImplemented = fullConfig.implements
29
29
 
30
30
  if (flags.extension) {
@@ -19,9 +19,9 @@ class AddWebAssetsCommand extends TemplatesCommand {
19
19
  const { flags } = await this.parse(AddWebAssetsCommand)
20
20
  aioLogger.debug(`add web-assets with flags: ${JSON.stringify(flags)}`)
21
21
 
22
- const projectName = this.getFullConfig().packagejson.name
22
+ const projectName = (await this.getFullConfig()).packagejson.name
23
23
  // guaranteed to have at least one, otherwise would throw in config load or in matching the ext name
24
- const entries = Object.entries(this.getAppExtConfigs(flags))
24
+ const entries = Object.entries(await this.getAppExtConfigs(flags))
25
25
  if (entries.length > 1) {
26
26
  this.error('Please use the \'-e\' flag to specify to which implementation you want to add web-assets to.')
27
27
  }
@@ -28,7 +28,7 @@ class Build extends BaseCommand {
28
28
  // flags
29
29
  flags['web-assets'] = flags['web-assets'] && !flags.action
30
30
 
31
- const buildConfigs = this.getAppExtConfigs(flags)
31
+ const buildConfigs = await this.getAppExtConfigs(flags)
32
32
 
33
33
  // 1. build actions and web assets for each extension
34
34
  const keys = Object.keys(buildConfigs)
@@ -116,6 +116,8 @@ class Build extends BaseCommand {
116
116
  shouldOptimize: flags['web-optimize'],
117
117
  logLevel: flags.verbose ? 'verbose' : 'warn'
118
118
  }
119
+ // empty the dist folder to prevent an S3 explosion
120
+ fs.emptyDirSync(config.web.distProd)
119
121
  const bundler = await bundle(entries, config.web.distProd, bundleOptions, onProgress)
120
122
  await bundler.run()
121
123
  spinner.succeed(chalk.green(`Building web assets for '${name}'`))
@@ -30,7 +30,7 @@ class ErrorsCommand extends BaseCommand {
30
30
  }
31
31
 
32
32
  async getLogForwarding () {
33
- const runtimeConfig = this.getFullConfig().aio.runtime
33
+ const runtimeConfig = (await this.getFullConfig()).aio.runtime
34
34
  rtLib.utils.checkOpenWhiskCredentials({ ow: runtimeConfig })
35
35
  const rt = await rtLib.init({
36
36
  ...runtimeConfig,
@@ -14,7 +14,7 @@ const LogForwarding = require('../../../../lib/log-forwarding')
14
14
 
15
15
  class LogForwardingCommand extends BaseCommand {
16
16
  async run () {
17
- const lf = await LogForwarding.init(this.getFullConfig().aio)
17
+ const lf = await LogForwarding.init(await this.getFullConfig().aio)
18
18
 
19
19
  const localConfig = lf.getLocalConfig()
20
20
  const serverConfig = await lf.getServerConfig()
@@ -11,10 +11,11 @@ governing permissions and limitations under the License.
11
11
 
12
12
  const BaseCommand = require('../../../../BaseCommand')
13
13
  const LogForwarding = require('../../../../lib/log-forwarding')
14
+ const aioLogger = require('@adobe/aio-lib-core-logging')('@adobe/aio-cli-plugin-app:lf:set', { provider: 'debug' })
14
15
 
15
16
  class LogForwardingCommand extends BaseCommand {
16
17
  async run () {
17
- const lf = await LogForwarding.init(this.getFullConfig().aio)
18
+ const lf = await LogForwarding.init((await this.getFullConfig()).aio)
18
19
 
19
20
  const destination = await this.promptDestination(lf.getSupportedDestinations())
20
21
  const destinationSettingsConfig = lf.getSettingsConfig(destination)
@@ -25,8 +26,12 @@ class LogForwardingCommand extends BaseCommand {
25
26
  this.log(`Log forwarding is set to '${destination}'`)
26
27
 
27
28
  const fullSanitizedConfig = lfConfig.getMergedConfig(lf.getConfigFromJson(res))
28
- await lf.updateLocalConfig(fullSanitizedConfig)
29
- this.log('Log forwarding settings are saved to the local configuration')
29
+ lf.updateLocalConfig(fullSanitizedConfig).then(() => {
30
+ this.log('Log forwarding settings are saved to the local configuration')
31
+ }).catch(e => {
32
+ this.warn('Log forwarding settings could not be saved to the local configuration.')
33
+ aioLogger.error(e.message)
34
+ })
30
35
  }
31
36
 
32
37
  async promptDestination (supportedDestinations) {
@@ -30,8 +30,8 @@ class DeleteActionCommand extends BaseCommand {
30
30
  this.error('<action-name> must also be provided when using --yes')
31
31
  }
32
32
 
33
- const fullConfig = this.getFullConfig()
34
- const { actions, actionsByImpl } = this.getAllActions(fullConfig)
33
+ const fullConfig = await this.getFullConfig()
34
+ const { actions, actionsByImpl } = await this.getAllActions(fullConfig)
35
35
  if (actions.length <= 0) {
36
36
  this.error('There are no actions in this project!')
37
37
  }
@@ -108,17 +108,20 @@ class DeleteActionCommand extends BaseCommand {
108
108
  )))
109
109
  }
110
110
 
111
- getAllActions (config) {
111
+ async getAllActions (config) {
112
112
  const actions = []
113
113
  const actionsByImpl = {}
114
- Object.entries(config.all).forEach(([implName, implConfig]) => {
114
+ const allConfigEntries = Object.entries(config.all)
115
+ for (const [implName, implConfig] of allConfigEntries) {
115
116
  if (implConfig.app.hasBackend) {
116
117
  actionsByImpl[implName] = []
117
- Object.entries(implConfig.manifest.full.packages).forEach(([pkgName, pkg]) => {
118
- Object.entries(pkg.actions).forEach(([actionName, action]) => {
118
+ const allPackagesEntries = Object.entries(implConfig.manifest.full.packages)
119
+ for (const [pkgName, pkg] of allPackagesEntries) {
120
+ const actionEntries = Object.entries(pkg.actions)
121
+ for (const [actionName, action] of actionEntries) {
119
122
  const fullActionName = `${pkgName}/${actionName}`
120
123
  const startKey = implName === 'application' ? 'application' : `extensions.${implName}`
121
- const configData = this.getConfigFileForKey(`${startKey}.runtimeManifest.packages.${pkgName}.actions.${actionName}`)
124
+ const configData = await this.getConfigFileForKey(`${startKey}.runtimeManifest.packages.${pkgName}.actions.${actionName}`)
122
125
  const actionObj = {
123
126
  // assumes path is not relative
124
127
  path: action.function,
@@ -131,12 +134,12 @@ class DeleteActionCommand extends BaseCommand {
131
134
  }
132
135
  actions.push(actionObj)
133
136
  actionsByImpl[implName].push(actionObj)
134
- })
135
- })
137
+ }
138
+ }
136
139
  } else {
137
140
  aioLogger.debug(`'${implName}' .app.hasBackend is not true`)
138
141
  }
139
- })
142
+ }
140
143
  return { actions, actionsByImpl }
141
144
  }
142
145
  }
@@ -28,7 +28,7 @@ class DeleteExtensionCommand extends BaseCommand {
28
28
  this.error('--extension= must also be provided when using --yes')
29
29
  }
30
30
 
31
- const fullConfig = this.getFullConfig({ allowNoImpl: true })
31
+ const fullConfig = await this.getFullConfig({ allowNoImpl: true })
32
32
  const configs = await this.selectOrGetConfigsToDelete(flags, fullConfig)
33
33
 
34
34
  const resConfirm = await this.prompt([
@@ -68,11 +68,11 @@ class DeleteExtensionCommand extends BaseCommand {
68
68
  }])
69
69
  flags.extension = answers.res
70
70
  }
71
- return this.getAppExtConfigs(flags)
71
+ return await this.getAppExtConfigs(flags)
72
72
  }
73
73
 
74
- deleteImplementations (configs) {
75
- Object.entries(configs).forEach(([id, c]) => {
74
+ async deleteImplementations (configs) {
75
+ for (const [id, c] of Object.entries(configs)) {
76
76
  // delete actions
77
77
  if (c.app.hasBackend) {
78
78
  fs.removeSync(c.actions.src)
@@ -89,14 +89,14 @@ class DeleteExtensionCommand extends BaseCommand {
89
89
  // delete config
90
90
  // try to find another config file => case of init extension in another folder
91
91
  const configKey = id === 'application' ? 'application' : `extensions.${id}`
92
- const configDataOp = this.getConfigFileForKey(configKey + '.operations')
92
+ const configDataOp = await this.getConfigFileForKey(configKey + '.operations')
93
93
  if (configDataOp.file) {
94
94
  fs.removeSync(configDataOp.file)
95
95
  }
96
96
  // delete config in parent config file
97
- const configData = this.getConfigFileForKey(configKey)
97
+ const configData = await this.getConfigFileForKey(configKey)
98
98
  deleteUserConfig(configData)
99
- })
99
+ }
100
100
  }
101
101
  }
102
102
 
@@ -25,7 +25,7 @@ class DeleteWebAssetsCommand extends BaseCommand {
25
25
 
26
26
  aioLogger.debug(`deleting web assets from the project, using flags: ${JSON.stringify(flags)}`)
27
27
 
28
- const fullConfig = this.getFullConfig()
28
+ const fullConfig = await this.getFullConfig()
29
29
  const webAssetsByImpl = this.getAllWebAssets(fullConfig)
30
30
  if (!webAssetsByImpl) {
31
31
  this.error('web-assets not found')
@@ -34,7 +34,7 @@ class Deploy extends BuildCommand {
34
34
  flags['web-assets'] = flags['web-assets'] && !flags.action
35
35
  flags.publish = flags.publish && !flags.action
36
36
 
37
- const deployConfigs = this.getAppExtConfigs(flags)
37
+ const deployConfigs = await this.getAppExtConfigs(flags)
38
38
  const keys = Object.keys(deployConfigs)
39
39
  const values = Object.values(deployConfigs)
40
40
  const isStandaloneApp = (keys.length === 1 && keys[0] === 'application')
@@ -55,7 +55,7 @@ class Deploy extends BuildCommand {
55
55
  const spinner = ora()
56
56
 
57
57
  try {
58
- const aioConfig = this.getFullConfig().aio
58
+ const aioConfig = (await this.getFullConfig()).aio
59
59
 
60
60
  // 1. update log forwarding configuration
61
61
  // note: it is possible that .aio file does not exist, which means there is no local lg config
@@ -31,7 +31,7 @@ class GetUrlCommand extends BaseCommand {
31
31
  options.cdn = flags.cdn
32
32
 
33
33
  const urls = {}
34
- const fullConfig = this.getFullConfig()
34
+ const fullConfig = await this.getFullConfig()
35
35
  if (options.action) {
36
36
  let action
37
37
  // search for action
@@ -19,7 +19,7 @@ class Info extends BaseCommand {
19
19
  async run () {
20
20
  // cli input
21
21
  const { flags } = await this.parse(Info)
22
- const appConfig = deepCopy(this.getFullConfig({ allowNoImpl: true }))
22
+ const appConfig = deepCopy(await this.getFullConfig({ allowNoImpl: true }))
23
23
 
24
24
  // includes .env secret delete all aio config for now
25
25
  delete appConfig.aio
@@ -104,7 +104,7 @@ class InitCommand extends TemplatesCommand {
104
104
  }
105
105
 
106
106
  if (flags.repo) {
107
- await this.withQuickstart(flags.repo)
107
+ await this.withQuickstart(flags.repo, flags['github-pat'])
108
108
  } else {
109
109
  // 2. prompt for templates to be installed
110
110
  const templates = await this.getTemplatesForFlags(flags)
@@ -134,7 +134,7 @@ class InitCommand extends TemplatesCommand {
134
134
 
135
135
  async initWithLogin (flags) {
136
136
  if (flags.repo) {
137
- await this.withQuickstart(flags.repo)
137
+ await this.withQuickstart(flags.repo, flags['github-pat'])
138
138
  }
139
139
  // this will trigger a login
140
140
  const consoleCLI = await this.getLibConsoleCLI()
@@ -367,9 +367,10 @@ class InitCommand extends TemplatesCommand {
367
367
  )
368
368
  }
369
369
 
370
- async withQuickstart (fullRepo) {
370
+ async withQuickstart (fullRepo, githubPat) {
371
371
  const octokit = new Octokit({
372
- auth: ''
372
+ auth: githubPat ?? '',
373
+ userAgent: 'ADP App Builder v1'
373
374
  })
374
375
  const spinner = ora('Downloading quickstart repo').start()
375
376
  /** @private */
@@ -468,8 +469,9 @@ InitCommand.flags = {
468
469
  exclusive: ['import'] // also no-login
469
470
  }),
470
471
  'confirm-new-workspace': Flags.boolean({
471
- description: 'Skip and confirm prompt for creating a new workspace',
472
- default: false
472
+ description: 'Prompt to confirm before creating a new workspace',
473
+ default: true,
474
+ allowNo: true
473
475
  }),
474
476
  repo: Flags.string({
475
477
  description: 'Init from gh quick-start repo. Expected to be of the form <owner>/<repo>/<path>',
@@ -478,6 +480,10 @@ InitCommand.flags = {
478
480
  'use-jwt': Flags.boolean({
479
481
  description: 'if the config has both jwt and OAuth Server to Server Credentials (while migrating), prefer the JWT credentials',
480
482
  default: false
483
+ }),
484
+ 'github-pat': Flags.string({
485
+ description: 'github personal access token to use for downloading private quickstart repos',
486
+ dependsOn: ['repo']
481
487
  })
482
488
  }
483
489
 
@@ -24,7 +24,7 @@ const ora = require('ora')
24
24
  const chalk = require('chalk')
25
25
 
26
26
  // eslint-disable-next-line node/no-missing-require
27
- const libConfigNext = require('@adobe/aio-cli-lib-app-config-next')
27
+ const libConfig = require('@adobe/aio-cli-lib-app-config')
28
28
 
29
29
  class InstallCommand extends BaseCommand {
30
30
  async run () {
@@ -55,7 +55,9 @@ class InstallCommand extends BaseCommand {
55
55
  await this.validateAppConfig(outputPath, USER_CONFIG_FILE)
56
56
  await this.validateDeployConfig(outputPath, DEPLOY_CONFIG_FILE)
57
57
  await this.npmInstall(flags.verbose)
58
- await this.runTests()
58
+ if (flags.tests) {
59
+ await this.runTests()
60
+ }
59
61
  this.spinner.succeed('Install done.')
60
62
  } catch (e) {
61
63
  this.spinner.fail(e.message)
@@ -114,8 +116,8 @@ class InstallCommand extends BaseCommand {
114
116
  this.spinner.start(`Validating ${configFileName}...`)
115
117
  aioLogger.debug(`validateConfig: ${configFileName} at ${configFilePath}`)
116
118
  // first coalesce the app config (resolving $include files), then validate it
117
- const config = (await libConfigNext.coalesce(configFilePath)).config
118
- await libConfigNext.validate(config, { throws: true }) // throws on error
119
+ const config = (await libConfig.coalesce(configFilePath)).config
120
+ await libConfig.validate(config, { throws: true }) // throws on error
119
121
  this.spinner.succeed(`Validated ${configFileName}`)
120
122
  }
121
123
 
@@ -164,6 +166,11 @@ InstallCommand.flags = {
164
166
  description: 'The packaged app output folder path',
165
167
  char: 'o',
166
168
  default: '.'
169
+ }),
170
+ tests: Flags.boolean({
171
+ description: 'Run packaged app unit tests (e.g. aio app:test)',
172
+ default: true,
173
+ allowNo: true
167
174
  })
168
175
  }
169
176
 
@@ -22,7 +22,7 @@ class ListExtensionPointsCommand extends BaseCommand {
22
22
  const { flags } = await this.parse(ListExtensionPointsCommand)
23
23
  aioLogger.debug(`list all extensions points with flags: ${JSON.stringify(flags)}`)
24
24
 
25
- const extConfig = this.getAppExtConfigs(flags)
25
+ const extConfig = await this.getAppExtConfigs(flags)
26
26
  const extPointList = {}
27
27
 
28
28
  Object.keys(extConfig).forEach(name => {
@@ -22,7 +22,7 @@ class ListExtensionCommand extends BaseCommand {
22
22
  const { flags } = await this.parse(ListExtensionCommand)
23
23
  aioLogger.debug(`list extensions with flags: ${JSON.stringify(flags)}`)
24
24
 
25
- const extConfig = this.getAppExtConfigs(flags)
25
+ const extConfig = await this.getAppExtConfigs(flags)
26
26
  const extSummary = {}
27
27
 
28
28
  Object.keys(extConfig).forEach(extPoint => {
@@ -36,7 +36,7 @@ class Logs extends BaseCommand {
36
36
 
37
37
  async run () {
38
38
  const { flags } = await this.parse(Logs)
39
- const fullConfig = this.getFullConfig()
39
+ const fullConfig = await this.getFullConfig()
40
40
 
41
41
  // has any backend
42
42
  const hasAnyBackend = Object.values(fullConfig.all).reduce((hasBackend, config) => hasBackend && config.app.hasBackend, true)
@@ -24,7 +24,7 @@ const chalk = require('chalk')
24
24
  const junk = require('junk')
25
25
 
26
26
  // eslint-disable-next-line node/no-missing-require
27
- const libConfigNext = require('@adobe/aio-cli-lib-app-config-next')
27
+ const libConfig = require('@adobe/aio-cli-lib-app-config')
28
28
 
29
29
  const DIST_FOLDER = 'dist'
30
30
  const DEFAULTS = {
@@ -43,7 +43,7 @@ class Pack extends BaseCommand {
43
43
  aioLogger.debug(`args: ${JSON.stringify(args, null, 2)}`)
44
44
 
45
45
  // this will also validate the app.config.yaml
46
- const appConfig = await libConfigNext.load()
46
+ const appConfig = await libConfig.load({ validateAppConfig: true })
47
47
 
48
48
  // resolve to absolute path before any chdir
49
49
  const outputZipFile = path.resolve(flags.output)
@@ -37,7 +37,7 @@ class Run extends BaseCommand {
37
37
 
38
38
  const spinner = ora()
39
39
 
40
- const runConfigs = this.getAppExtConfigs(flags)
40
+ const runConfigs = await this.getAppExtConfigs(flags)
41
41
  const entries = Object.entries(runConfigs)
42
42
  if (entries.length > 1) {
43
43
  this.error('Your app implements multiple extensions. You can only run one at the time, please select which extension to run with the \'-e\' flag.')
@@ -31,7 +31,7 @@ class Test extends BaseCommand {
31
31
  unit = true
32
32
  }
33
33
 
34
- const buildConfigs = this.getAppExtConfigs({ extension })
34
+ const buildConfigs = await this.getAppExtConfigs({ extension })
35
35
  aioLogger.debug(`run buildConfigs:${JSON.stringify(buildConfigs, null, 2)}`)
36
36
 
37
37
  const totalResults = []
@@ -25,7 +25,7 @@ class Undeploy extends BaseCommand {
25
25
  // cli input
26
26
  const { flags } = await this.parse(Undeploy)
27
27
 
28
- const undeployConfigs = this.getAppExtConfigs(flags)
28
+ const undeployConfigs = await this.getAppExtConfigs(flags)
29
29
  let libConsoleCLI
30
30
  if (flags.unpublish) {
31
31
  // force login at beginning (if required)
@@ -51,7 +51,7 @@ class Undeploy extends BaseCommand {
51
51
  }
52
52
  // 2. unpublish extension manifest
53
53
  if (flags.unpublish && !(keys.length === 1 && keys[0] === 'application')) {
54
- const aioConfig = this.getFullConfig().aio
54
+ const aioConfig = (await this.getFullConfig()).aio
55
55
  const payload = await this.unpublishExtensionPoints(libConsoleCLI, undeployConfigs, aioConfig, flags['force-unpublish'])
56
56
  this.log(chalk.blue(chalk.bold(`New Extension Point(s) in Workspace '${aioConfig.project.workspace.name}': '${Object.keys(payload.endpoints)}'`)))
57
57
  } else {
@@ -28,8 +28,6 @@ class Use extends BaseCommand {
28
28
  async run () {
29
29
  const { flags, args } = await this.parse(Use)
30
30
 
31
- flags.workspace = flags.workspace || flags['workspace-name'] || ''
32
-
33
31
  aioLogger.debug(`args: ${JSON.stringify(args, null, 2)}, flags: ${JSON.stringify(flags, null, 2)}`)
34
32
 
35
33
  // some additional checks and updates of flags and args on top of what oclif provides
@@ -196,15 +194,23 @@ class Use extends BaseCommand {
196
194
  let workspace
197
195
  let workspaceData = { name: workspaceNameOrId }
198
196
  // does not prompt if workspaceNameOrId is defined via the flag
199
- workspace = await consoleCLI.promptForSelectWorkspace(workspaces, { workspaceId: workspaceNameOrId, workspaceName: workspaceNameOrId }, { allowCreate: true })
197
+ workspace = await consoleCLI.promptForSelectWorkspace(workspaces, {
198
+ workspaceId: workspaceNameOrId,
199
+ workspaceName: workspaceNameOrId
200
+ }, {
201
+ allowCreate: true
202
+ })
203
+
200
204
  if (!workspace) {
201
205
  aioLogger.debug(`--workspace=${workspaceNameOrId} was not found in the current Project ${project.name}`)
202
206
  if (workspaceNameOrId) {
203
- if (!flags['confirm-new-workspace']) {
207
+ if (flags['confirm-new-workspace']) {
204
208
  const shouldNewWorkspace = await consoleCLI.prompt.promptConfirm(`Workspace '${workspaceNameOrId}' does not exist \n > Do you wish to create a new workspace?`)
205
209
  if (!shouldNewWorkspace) {
206
210
  this.error('Workspace creation aborted')
207
211
  }
212
+ } else {
213
+ // this is not an error, if we end up here we just use `workspaceData` later
208
214
  }
209
215
  } else {
210
216
  workspaceData = await consoleCLI.promptForCreateWorkspaceDetails()
@@ -369,15 +375,26 @@ Use.flags = {
369
375
  exclusive: ['global', 'workspace-name']
370
376
  }),
371
377
  'confirm-new-workspace': Flags.boolean({
372
- description: 'Skip and confirm prompt for creating a new workspace',
373
- default: false
374
- }),
375
- 'workspace-name': Flags.string({
376
- description: '[DEPRECATED]: please use --workspace instead',
377
- default: '',
378
- char: 'w',
379
- exclusive: ['global', 'workspace']
378
+ description: 'Prompt to confirm before creating a new workspace',
379
+ default: true,
380
+ allowNo: true,
381
+ relationships: [
382
+ // if prompt is false, then the workspace flag MUST be specified
383
+ {
384
+ type: 'all',
385
+ flags: [{
386
+ name: 'workspace',
387
+ when: async (flags) => flags['confirm-new-workspace'] === false
388
+ }]
389
+ }
390
+ ]
380
391
  }),
392
+ // 'workspace-name': Flags.string({
393
+ // description: '[DEPRECATED]: please use --workspace instead',
394
+ // default: '',
395
+ // char: 'w',
396
+ // exclusive: ['global', 'workspace']
397
+ // }),
381
398
  'no-service-sync': Flags.boolean({
382
399
  description: 'Skip the Service sync prompt and do not attach current Service subscriptions to the new Workspace',
383
400
  default: false,
@@ -129,10 +129,9 @@ class LogForwarding {
129
129
  projectConfig.project.workspace.log_forwarding = {
130
130
  [destination]: nonSecretSettings
131
131
  }
132
- const interactive = false
133
- const merge = true
134
- await writeAio(projectConfig, '', { interactive, merge })
135
- await writeEnv({}, '', { interactive, merge }, secretSettings)
132
+ const writeOptions = { interactive: false, merge: true }
133
+ await writeAio(projectConfig, '', writeOptions)
134
+ await writeEnv({}, '', writeOptions, secretSettings)
136
135
  }
137
136
 
138
137
  isLocalConfigChanged () {