@adobe/aio-cli-plugin-app 14.2.0 → 14.3.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 +38 -36
- package/oclif.manifest.json +13 -1
- package/package.json +1 -1
- package/src/commands/app/install.js +27 -4
- package/src/commands/app/pack.js +21 -7
- package/src/lib/audit-logger.js +1 -1
- package/src/lib/auth-helper.js +1 -1
- package/src/lib/defaults.js +1 -0
package/README.md
CHANGED
|
@@ -74,7 +74,7 @@ DESCRIPTION
|
|
|
74
74
|
Create, run, test, and deploy Adobe I/O Apps
|
|
75
75
|
```
|
|
76
76
|
|
|
77
|
-
_See code: [src/commands/app/index.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.
|
|
77
|
+
_See code: [src/commands/app/index.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.3.0/src/commands/app/index.js)_
|
|
78
78
|
|
|
79
79
|
## `aio app add`
|
|
80
80
|
|
|
@@ -92,7 +92,7 @@ DESCRIPTION
|
|
|
92
92
|
Add a new component to an existing Adobe I/O App
|
|
93
93
|
```
|
|
94
94
|
|
|
95
|
-
_See code: [src/commands/app/add/index.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.
|
|
95
|
+
_See code: [src/commands/app/add/index.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.3.0/src/commands/app/add/index.js)_
|
|
96
96
|
|
|
97
97
|
## `aio app add action`
|
|
98
98
|
|
|
@@ -117,7 +117,7 @@ ALIASES
|
|
|
117
117
|
$ aio app add actions
|
|
118
118
|
```
|
|
119
119
|
|
|
120
|
-
_See code: [src/commands/app/add/action.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.
|
|
120
|
+
_See code: [src/commands/app/add/action.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.3.0/src/commands/app/add/action.js)_
|
|
121
121
|
|
|
122
122
|
## `aio app add ci`
|
|
123
123
|
|
|
@@ -135,7 +135,7 @@ DESCRIPTION
|
|
|
135
135
|
Add CI files
|
|
136
136
|
```
|
|
137
137
|
|
|
138
|
-
_See code: [src/commands/app/add/ci.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.
|
|
138
|
+
_See code: [src/commands/app/add/ci.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.3.0/src/commands/app/add/ci.js)_
|
|
139
139
|
|
|
140
140
|
## `aio app add event`
|
|
141
141
|
|
|
@@ -160,7 +160,7 @@ ALIASES
|
|
|
160
160
|
$ aio app add events
|
|
161
161
|
```
|
|
162
162
|
|
|
163
|
-
_See code: [src/commands/app/add/event.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.
|
|
163
|
+
_See code: [src/commands/app/add/event.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.3.0/src/commands/app/add/event.js)_
|
|
164
164
|
|
|
165
165
|
## `aio app add extension`
|
|
166
166
|
|
|
@@ -186,7 +186,7 @@ ALIASES
|
|
|
186
186
|
$ aio app add extensions
|
|
187
187
|
```
|
|
188
188
|
|
|
189
|
-
_See code: [src/commands/app/add/extension.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.
|
|
189
|
+
_See code: [src/commands/app/add/extension.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.3.0/src/commands/app/add/extension.js)_
|
|
190
190
|
|
|
191
191
|
## `aio app add service`
|
|
192
192
|
|
|
@@ -210,7 +210,7 @@ ALIASES
|
|
|
210
210
|
$ aio app add services
|
|
211
211
|
```
|
|
212
212
|
|
|
213
|
-
_See code: [src/commands/app/add/service.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.
|
|
213
|
+
_See code: [src/commands/app/add/service.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.3.0/src/commands/app/add/service.js)_
|
|
214
214
|
|
|
215
215
|
## `aio app add web-assets`
|
|
216
216
|
|
|
@@ -231,7 +231,7 @@ DESCRIPTION
|
|
|
231
231
|
Add web assets support
|
|
232
232
|
```
|
|
233
233
|
|
|
234
|
-
_See code: [src/commands/app/add/web-assets.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.
|
|
234
|
+
_See code: [src/commands/app/add/web-assets.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.3.0/src/commands/app/add/web-assets.js)_
|
|
235
235
|
|
|
236
236
|
## `aio app build`
|
|
237
237
|
|
|
@@ -261,7 +261,7 @@ DESCRIPTION
|
|
|
261
261
|
Use the --force-build flag to force a build even if one already exists.
|
|
262
262
|
```
|
|
263
263
|
|
|
264
|
-
_See code: [src/commands/app/build.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.
|
|
264
|
+
_See code: [src/commands/app/build.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.3.0/src/commands/app/build.js)_
|
|
265
265
|
|
|
266
266
|
## `aio app clean`
|
|
267
267
|
|
|
@@ -286,7 +286,7 @@ DESCRIPTION
|
|
|
286
286
|
Note that this will require a full rebuild on your next build command.
|
|
287
287
|
```
|
|
288
288
|
|
|
289
|
-
_See code: [src/commands/app/clean.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.
|
|
289
|
+
_See code: [src/commands/app/clean.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.3.0/src/commands/app/clean.js)_
|
|
290
290
|
|
|
291
291
|
## `aio app create [PATH]`
|
|
292
292
|
|
|
@@ -308,7 +308,7 @@ DESCRIPTION
|
|
|
308
308
|
Create a new Adobe I/O App with default parameters
|
|
309
309
|
```
|
|
310
310
|
|
|
311
|
-
_See code: [src/commands/app/create.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.
|
|
311
|
+
_See code: [src/commands/app/create.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.3.0/src/commands/app/create.js)_
|
|
312
312
|
|
|
313
313
|
## `aio app delete`
|
|
314
314
|
|
|
@@ -326,7 +326,7 @@ DESCRIPTION
|
|
|
326
326
|
Delete a component from an existing Adobe I/O App
|
|
327
327
|
```
|
|
328
328
|
|
|
329
|
-
_See code: [src/commands/app/delete/index.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.
|
|
329
|
+
_See code: [src/commands/app/delete/index.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.3.0/src/commands/app/delete/index.js)_
|
|
330
330
|
|
|
331
331
|
## `aio app delete action [ACTION-NAME]`
|
|
332
332
|
|
|
@@ -352,7 +352,7 @@ ALIASES
|
|
|
352
352
|
$ aio app delete actions
|
|
353
353
|
```
|
|
354
354
|
|
|
355
|
-
_See code: [src/commands/app/delete/action.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.
|
|
355
|
+
_See code: [src/commands/app/delete/action.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.3.0/src/commands/app/delete/action.js)_
|
|
356
356
|
|
|
357
357
|
## `aio app delete ci`
|
|
358
358
|
|
|
@@ -371,7 +371,7 @@ DESCRIPTION
|
|
|
371
371
|
Delete existing CI files
|
|
372
372
|
```
|
|
373
373
|
|
|
374
|
-
_See code: [src/commands/app/delete/ci.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.
|
|
374
|
+
_See code: [src/commands/app/delete/ci.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.3.0/src/commands/app/delete/ci.js)_
|
|
375
375
|
|
|
376
376
|
## `aio app delete extension`
|
|
377
377
|
|
|
@@ -397,7 +397,7 @@ ALIASES
|
|
|
397
397
|
$ aio app delete extensions
|
|
398
398
|
```
|
|
399
399
|
|
|
400
|
-
_See code: [src/commands/app/delete/extension.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.
|
|
400
|
+
_See code: [src/commands/app/delete/extension.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.3.0/src/commands/app/delete/extension.js)_
|
|
401
401
|
|
|
402
402
|
## `aio app delete service`
|
|
403
403
|
|
|
@@ -421,7 +421,7 @@ ALIASES
|
|
|
421
421
|
$ aio app delete services
|
|
422
422
|
```
|
|
423
423
|
|
|
424
|
-
_See code: [src/commands/app/delete/service.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.
|
|
424
|
+
_See code: [src/commands/app/delete/service.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.3.0/src/commands/app/delete/service.js)_
|
|
425
425
|
|
|
426
426
|
## `aio app delete web-assets`
|
|
427
427
|
|
|
@@ -440,7 +440,7 @@ DESCRIPTION
|
|
|
440
440
|
Delete existing web assets
|
|
441
441
|
```
|
|
442
442
|
|
|
443
|
-
_See code: [src/commands/app/delete/web-assets.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.
|
|
443
|
+
_See code: [src/commands/app/delete/web-assets.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.3.0/src/commands/app/delete/web-assets.js)_
|
|
444
444
|
|
|
445
445
|
## `aio app deploy`
|
|
446
446
|
|
|
@@ -486,7 +486,7 @@ DESCRIPTION
|
|
|
486
486
|
Use the --force-deploy flag to force deploy changes, regardless of production Workspace being published in Exchange.
|
|
487
487
|
```
|
|
488
488
|
|
|
489
|
-
_See code: [src/commands/app/deploy.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.
|
|
489
|
+
_See code: [src/commands/app/deploy.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.3.0/src/commands/app/deploy.js)_
|
|
490
490
|
|
|
491
491
|
## `aio app get-url [ACTION]`
|
|
492
492
|
|
|
@@ -508,7 +508,7 @@ DESCRIPTION
|
|
|
508
508
|
Get action URLs
|
|
509
509
|
```
|
|
510
510
|
|
|
511
|
-
_See code: [src/commands/app/get-url.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.
|
|
511
|
+
_See code: [src/commands/app/get-url.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.3.0/src/commands/app/get-url.js)_
|
|
512
512
|
|
|
513
513
|
## `aio app info`
|
|
514
514
|
|
|
@@ -530,7 +530,7 @@ DESCRIPTION
|
|
|
530
530
|
Display settings/configuration in use by an Adobe I/O App
|
|
531
531
|
```
|
|
532
532
|
|
|
533
|
-
_See code: [src/commands/app/info.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.
|
|
533
|
+
_See code: [src/commands/app/info.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.3.0/src/commands/app/info.js)_
|
|
534
534
|
|
|
535
535
|
## `aio app init [PATH]`
|
|
536
536
|
|
|
@@ -572,7 +572,7 @@ DESCRIPTION
|
|
|
572
572
|
Create a new Adobe I/O App
|
|
573
573
|
```
|
|
574
574
|
|
|
575
|
-
_See code: [src/commands/app/init.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.
|
|
575
|
+
_See code: [src/commands/app/init.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.3.0/src/commands/app/init.js)_
|
|
576
576
|
|
|
577
577
|
## `aio app install PATH`
|
|
578
578
|
|
|
@@ -580,22 +580,23 @@ This command will support installing apps packaged by 'aio app pack'.
|
|
|
580
580
|
|
|
581
581
|
```
|
|
582
582
|
USAGE
|
|
583
|
-
$ aio app install PATH [-v] [--version] [-o <value>] [--tests]
|
|
583
|
+
$ aio app install PATH [-v] [--version] [--allow-scripts] [-o <value>] [--tests]
|
|
584
584
|
|
|
585
585
|
ARGUMENTS
|
|
586
586
|
PATH Path to the app package to install
|
|
587
587
|
|
|
588
588
|
FLAGS
|
|
589
|
-
-o, --output=<value>
|
|
590
|
-
-v, --verbose
|
|
591
|
-
--[no-]
|
|
592
|
-
--
|
|
589
|
+
-o, --output=<value> [default: .] The packaged app output folder path
|
|
590
|
+
-v, --verbose Verbose output
|
|
591
|
+
--[no-]allow-scripts Allow post and preinstall scripts during npm install/npm ci
|
|
592
|
+
--[no-]tests Run packaged app unit tests (e.g. aio app:test)
|
|
593
|
+
--version Show version
|
|
593
594
|
|
|
594
595
|
DESCRIPTION
|
|
595
596
|
This command will support installing apps packaged by 'aio app pack'.
|
|
596
597
|
```
|
|
597
598
|
|
|
598
|
-
_See code: [src/commands/app/install.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.
|
|
599
|
+
_See code: [src/commands/app/install.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.3.0/src/commands/app/install.js)_
|
|
599
600
|
|
|
600
601
|
## `aio app list`
|
|
601
602
|
|
|
@@ -613,7 +614,7 @@ DESCRIPTION
|
|
|
613
614
|
List components for Adobe I/O App
|
|
614
615
|
```
|
|
615
616
|
|
|
616
|
-
_See code: [src/commands/app/list/index.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.
|
|
617
|
+
_See code: [src/commands/app/list/index.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.3.0/src/commands/app/list/index.js)_
|
|
617
618
|
|
|
618
619
|
## `aio app list extension`
|
|
619
620
|
|
|
@@ -638,7 +639,7 @@ ALIASES
|
|
|
638
639
|
$ aio app list extensions
|
|
639
640
|
```
|
|
640
641
|
|
|
641
|
-
_See code: [src/commands/app/list/extension.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.
|
|
642
|
+
_See code: [src/commands/app/list/extension.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.3.0/src/commands/app/list/extension.js)_
|
|
642
643
|
|
|
643
644
|
## `aio app logs`
|
|
644
645
|
|
|
@@ -662,7 +663,7 @@ DESCRIPTION
|
|
|
662
663
|
Fetch logs for an Adobe I/O App
|
|
663
664
|
```
|
|
664
665
|
|
|
665
|
-
_See code: [src/commands/app/logs.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.
|
|
666
|
+
_See code: [src/commands/app/logs.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.3.0/src/commands/app/logs.js)_
|
|
666
667
|
|
|
667
668
|
## `aio app pack [PATH]`
|
|
668
669
|
|
|
@@ -670,7 +671,7 @@ This command will support packaging apps for redistribution.
|
|
|
670
671
|
|
|
671
672
|
```
|
|
672
673
|
USAGE
|
|
673
|
-
$ aio app pack [PATH] [-v] [--version] [-o <value>]
|
|
674
|
+
$ aio app pack [PATH] [-v] [--version] [--lock-file] [-o <value>]
|
|
674
675
|
|
|
675
676
|
ARGUMENTS
|
|
676
677
|
PATH [default: .] Path to the app directory to package
|
|
@@ -678,13 +679,14 @@ ARGUMENTS
|
|
|
678
679
|
FLAGS
|
|
679
680
|
-o, --output=<value> [default: dist/app.zip] The packaged app output file path
|
|
680
681
|
-v, --verbose Verbose output
|
|
682
|
+
--[no-]lock-file Include the package-lock.json file in the packaged app
|
|
681
683
|
--version Show version
|
|
682
684
|
|
|
683
685
|
DESCRIPTION
|
|
684
686
|
This command will support packaging apps for redistribution.
|
|
685
687
|
```
|
|
686
688
|
|
|
687
|
-
_See code: [src/commands/app/pack.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.
|
|
689
|
+
_See code: [src/commands/app/pack.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.3.0/src/commands/app/pack.js)_
|
|
688
690
|
|
|
689
691
|
## `aio app run`
|
|
690
692
|
|
|
@@ -706,7 +708,7 @@ DESCRIPTION
|
|
|
706
708
|
Run an Adobe I/O App
|
|
707
709
|
```
|
|
708
710
|
|
|
709
|
-
_See code: [src/commands/app/run.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.
|
|
711
|
+
_See code: [src/commands/app/run.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.3.0/src/commands/app/run.js)_
|
|
710
712
|
|
|
711
713
|
## `aio app test`
|
|
712
714
|
|
|
@@ -734,7 +736,7 @@ DESCRIPTION
|
|
|
734
736
|
If the extension has a hook called 'test' in its 'ext.config.yaml', the script specified will be run instead.
|
|
735
737
|
```
|
|
736
738
|
|
|
737
|
-
_See code: [src/commands/app/test.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.
|
|
739
|
+
_See code: [src/commands/app/test.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.3.0/src/commands/app/test.js)_
|
|
738
740
|
|
|
739
741
|
## `aio app undeploy`
|
|
740
742
|
|
|
@@ -759,7 +761,7 @@ DESCRIPTION
|
|
|
759
761
|
Undeploys an Adobe I/O App
|
|
760
762
|
```
|
|
761
763
|
|
|
762
|
-
_See code: [src/commands/app/undeploy.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.
|
|
764
|
+
_See code: [src/commands/app/undeploy.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.3.0/src/commands/app/undeploy.js)_
|
|
763
765
|
|
|
764
766
|
## `aio app use [CONFIG_FILE_PATH]`
|
|
765
767
|
|
|
@@ -806,5 +808,5 @@ DESCRIPTION
|
|
|
806
808
|
page in https://developer.adobe.com/console/
|
|
807
809
|
```
|
|
808
810
|
|
|
809
|
-
_See code: [src/commands/app/use.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.
|
|
811
|
+
_See code: [src/commands/app/use.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.3.0/src/commands/app/use.js)_
|
|
810
812
|
<!-- commandsstop -->
|
package/oclif.manifest.json
CHANGED
|
@@ -704,6 +704,12 @@
|
|
|
704
704
|
"allowNo": false,
|
|
705
705
|
"type": "boolean"
|
|
706
706
|
},
|
|
707
|
+
"allow-scripts": {
|
|
708
|
+
"description": "Allow post and preinstall scripts during npm install/npm ci",
|
|
709
|
+
"name": "allow-scripts",
|
|
710
|
+
"allowNo": true,
|
|
711
|
+
"type": "boolean"
|
|
712
|
+
},
|
|
707
713
|
"output": {
|
|
708
714
|
"char": "o",
|
|
709
715
|
"description": "The packaged app output folder path",
|
|
@@ -850,6 +856,12 @@
|
|
|
850
856
|
"allowNo": false,
|
|
851
857
|
"type": "boolean"
|
|
852
858
|
},
|
|
859
|
+
"lock-file": {
|
|
860
|
+
"description": "Include the package-lock.json file in the packaged app",
|
|
861
|
+
"name": "lock-file",
|
|
862
|
+
"allowNo": true,
|
|
863
|
+
"type": "boolean"
|
|
864
|
+
},
|
|
853
865
|
"output": {
|
|
854
866
|
"char": "o",
|
|
855
867
|
"description": "The packaged app output file path",
|
|
@@ -2200,5 +2212,5 @@
|
|
|
2200
2212
|
]
|
|
2201
2213
|
}
|
|
2202
2214
|
},
|
|
2203
|
-
"version": "14.
|
|
2215
|
+
"version": "14.3.0"
|
|
2204
2216
|
}
|
package/package.json
CHANGED
|
@@ -19,7 +19,7 @@ const execa = require('execa')
|
|
|
19
19
|
const unzipper = require('unzipper')
|
|
20
20
|
const { validateJsonWithSchema } = require('../../lib/install-helper')
|
|
21
21
|
const jsYaml = require('js-yaml')
|
|
22
|
-
const { USER_CONFIG_FILE, DEPLOY_CONFIG_FILE } = require('../../lib/defaults')
|
|
22
|
+
const { USER_CONFIG_FILE, DEPLOY_CONFIG_FILE, PACKAGE_LOCK_FILE } = require('../../lib/defaults')
|
|
23
23
|
const ora = require('ora')
|
|
24
24
|
|
|
25
25
|
// eslint-disable-next-line node/no-missing-require
|
|
@@ -51,7 +51,14 @@ class InstallCommand extends BaseCommand {
|
|
|
51
51
|
await this.unzipFile(args.path, outputPath)
|
|
52
52
|
await this.validateAppConfig(outputPath, USER_CONFIG_FILE)
|
|
53
53
|
await this.validateDeployConfig(outputPath, DEPLOY_CONFIG_FILE)
|
|
54
|
-
|
|
54
|
+
|
|
55
|
+
const packageLockPath = path.join(outputPath, PACKAGE_LOCK_FILE)
|
|
56
|
+
if (fs.existsSync(packageLockPath)) {
|
|
57
|
+
await this.npmCI(flags.verbose, flags['allow-scripts'])
|
|
58
|
+
} else {
|
|
59
|
+
this.warn('No lockfile found, running standard npm install. It is recommended that you include a lockfile with your app bundle.')
|
|
60
|
+
await this.npmInstall(flags.verbose, flags['allow-scripts'])
|
|
61
|
+
}
|
|
55
62
|
if (flags.tests) {
|
|
56
63
|
await this.runTests()
|
|
57
64
|
}
|
|
@@ -131,15 +138,26 @@ class InstallCommand extends BaseCommand {
|
|
|
131
138
|
}
|
|
132
139
|
}
|
|
133
140
|
|
|
134
|
-
async npmInstall (isVerbose) {
|
|
141
|
+
async npmInstall (isVerbose = false, allowScripts = true) {
|
|
142
|
+
const ignoreScripts = allowScripts ? undefined : '--ignore-scripts'
|
|
135
143
|
this.spinner.start('Running npm install...')
|
|
136
144
|
const stdio = isVerbose ? 'inherit' : 'ignore'
|
|
137
|
-
return execa('npm', ['install'], { stdio })
|
|
145
|
+
return execa('npm', ['install', ignoreScripts], { stdio })
|
|
138
146
|
.then(() => {
|
|
139
147
|
this.spinner.succeed('Ran npm install')
|
|
140
148
|
})
|
|
141
149
|
}
|
|
142
150
|
|
|
151
|
+
async npmCI (isVerbose = false, allowScripts = true) {
|
|
152
|
+
const ignoreScripts = allowScripts ? undefined : '--ignore-scripts'
|
|
153
|
+
this.spinner.start('Running npm ci...')
|
|
154
|
+
const stdio = isVerbose ? 'inherit' : 'ignore'
|
|
155
|
+
return execa('npm', ['ci', ignoreScripts], { stdio })
|
|
156
|
+
.then(() => {
|
|
157
|
+
this.spinner.succeed('Ran npm ci')
|
|
158
|
+
})
|
|
159
|
+
}
|
|
160
|
+
|
|
143
161
|
async runTests (isVerbose) {
|
|
144
162
|
this.spinner.start('Running app tests...')
|
|
145
163
|
return this.config.runCommand('app:test').then((result) => {
|
|
@@ -157,6 +175,11 @@ InstallCommand.description = `This command will support installing apps packaged
|
|
|
157
175
|
|
|
158
176
|
InstallCommand.flags = {
|
|
159
177
|
...BaseCommand.flags,
|
|
178
|
+
'allow-scripts': Flags.boolean({
|
|
179
|
+
description: 'Allow post and preinstall scripts during npm install/npm ci',
|
|
180
|
+
default: true,
|
|
181
|
+
allowNo: true
|
|
182
|
+
}),
|
|
160
183
|
output: Flags.string({
|
|
161
184
|
description: 'The packaged app output folder path',
|
|
162
185
|
char: 'o',
|
package/src/commands/app/pack.js
CHANGED
|
@@ -71,8 +71,13 @@ class Pack extends BaseCommand {
|
|
|
71
71
|
this.error(hookResults.failures.map(f => `${f.plugin.name} : ${f.error.message}`).join('\nError: '), { exit: 1 })
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
+
const filesToInclude = flags['lock-file'] ? ['package-lock.json'] : []
|
|
75
|
+
|
|
74
76
|
// 1a. Get file list to pack
|
|
75
|
-
const fileList = await this.filesToPack({
|
|
77
|
+
const fileList = await this.filesToPack({
|
|
78
|
+
filesToExclude: [flags.output, DEFAULTS.DIST_FOLDER, ...distLocations],
|
|
79
|
+
filesToInclude
|
|
80
|
+
})
|
|
76
81
|
this.log('=== Files to pack ===')
|
|
77
82
|
fileList.forEach((file) => {
|
|
78
83
|
this.log(` ${file}`)
|
|
@@ -265,10 +270,11 @@ class Pack extends BaseCommand {
|
|
|
265
270
|
*
|
|
266
271
|
* @param {object} options the options for the method
|
|
267
272
|
* @param {Array<string>} options.filesToExclude a list of files to exclude
|
|
273
|
+
* @param {Array<string>} options.filesToInclude a list of files to include (will always be included)
|
|
268
274
|
* @param {string} options.workingDirectory the working directory to run `npm pack` in
|
|
269
275
|
* @returns {Array<string>} a list of files that are to be packed
|
|
270
276
|
*/
|
|
271
|
-
async filesToPack ({ filesToExclude = [], workingDirectory = process.cwd() } = {}) {
|
|
277
|
+
async filesToPack ({ filesToExclude = [], filesToInclude = [], workingDirectory = process.cwd() } = {}) {
|
|
272
278
|
const { stdout } = await execa('npm', ['pack', '--dry-run', '--json'], { cwd: workingDirectory })
|
|
273
279
|
|
|
274
280
|
const noJunkFiles = (file) => {
|
|
@@ -290,11 +296,14 @@ class Pack extends BaseCommand {
|
|
|
290
296
|
}
|
|
291
297
|
|
|
292
298
|
const { files } = JSON.parse(stdout)[0]
|
|
293
|
-
return
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
299
|
+
return [
|
|
300
|
+
...files
|
|
301
|
+
.map(file => file.path)
|
|
302
|
+
.filter(file => !filesToExclude.includes(file))
|
|
303
|
+
.filter(noJunkFiles) // no junk files like .DS_Store
|
|
304
|
+
.filter(noDotFiles), // no files that start with a '.'
|
|
305
|
+
...filesToInclude
|
|
306
|
+
]
|
|
298
307
|
}
|
|
299
308
|
|
|
300
309
|
/**
|
|
@@ -361,6 +370,11 @@ Pack.description = `This command will support packaging apps for redistribution.
|
|
|
361
370
|
|
|
362
371
|
Pack.flags = {
|
|
363
372
|
...BaseCommand.flags,
|
|
373
|
+
'lock-file': Flags.boolean({
|
|
374
|
+
description: 'Include the package-lock.json file in the packaged app',
|
|
375
|
+
default: true,
|
|
376
|
+
allowNo: true
|
|
377
|
+
}),
|
|
364
378
|
output: Flags.string({
|
|
365
379
|
description: 'The packaged app output file path',
|
|
366
380
|
char: 'o',
|
package/src/lib/audit-logger.js
CHANGED
|
@@ -18,7 +18,7 @@ const OPERATIONS = {
|
|
|
18
18
|
|
|
19
19
|
const AUDIT_SERVICE_ENDPOINT_ROUTE = '/audit-log-api/event-post'
|
|
20
20
|
const AUDIT_SERVICE_ENDPOINTS = {
|
|
21
|
-
stage: 'https://deploy-service.stg.app-builder.
|
|
21
|
+
stage: 'https://deploy-service.stg.app-builder.adp.adobe.io',
|
|
22
22
|
prod: 'https://deploy-service.app-builder.adp.adobe.io'
|
|
23
23
|
}
|
|
24
24
|
|
package/src/lib/auth-helper.js
CHANGED
|
@@ -15,7 +15,7 @@ const { getCliEnv } = require('@adobe/aio-lib-env')
|
|
|
15
15
|
const aioLogger = require('@adobe/aio-lib-core-logging')('@adobe/aio-cli-plugin-app:auth-helper', { provider: 'debug' })
|
|
16
16
|
|
|
17
17
|
const DEPLOY_SERVICE_ENDPOINTS = {
|
|
18
|
-
stage: 'https://deploy-service.stg.app-builder.
|
|
18
|
+
stage: 'https://deploy-service.stg.app-builder.adp.adobe.io',
|
|
19
19
|
prod: 'https://deploy-service.app-builder.adp.adobe.io'
|
|
20
20
|
}
|
|
21
21
|
|
package/src/lib/defaults.js
CHANGED
|
@@ -33,6 +33,7 @@ module.exports = {
|
|
|
33
33
|
IMPORT_CONFIG_FILE: 'config.json',
|
|
34
34
|
USER_CONFIG_FILE: 'app.config.yaml',
|
|
35
35
|
DEPLOY_CONFIG_FILE: 'deploy.yaml',
|
|
36
|
+
PACKAGE_LOCK_FILE: 'package-lock.json',
|
|
36
37
|
LEGACY_RUNTIME_MANIFEST: 'manifest.yml',
|
|
37
38
|
INCLUDE_DIRECTIVE: '$include',
|
|
38
39
|
APPLICATION_CONFIG_KEY: 'application',
|