Skip to content

Commit 87862aa

Browse files
Merge branch 'master' into DeployAuditUser
2 parents 7b544aa + 93d3d4f commit 87862aa

File tree

11 files changed

+265
-57
lines changed

11 files changed

+265
-57
lines changed

README.md

Lines changed: 38 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ DESCRIPTION
7474
Create, run, test, and deploy Adobe I/O Apps
7575
```
7676

77-
_See code: [src/commands/app/index.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.1.3/src/commands/app/index.js)_
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)_
7878

7979
## `aio app add`
8080

@@ -92,7 +92,7 @@ DESCRIPTION
9292
Add a new component to an existing Adobe I/O App
9393
```
9494

95-
_See code: [src/commands/app/add/index.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.1.3/src/commands/app/add/index.js)_
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)_
9696

9797
## `aio app add action`
9898

@@ -117,7 +117,7 @@ ALIASES
117117
$ aio app add actions
118118
```
119119

120-
_See code: [src/commands/app/add/action.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.1.3/src/commands/app/add/action.js)_
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)_
121121

122122
## `aio app add ci`
123123

@@ -135,7 +135,7 @@ DESCRIPTION
135135
Add CI files
136136
```
137137

138-
_See code: [src/commands/app/add/ci.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.1.3/src/commands/app/add/ci.js)_
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)_
139139

140140
## `aio app add event`
141141

@@ -160,7 +160,7 @@ ALIASES
160160
$ aio app add events
161161
```
162162

163-
_See code: [src/commands/app/add/event.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.1.3/src/commands/app/add/event.js)_
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)_
164164

165165
## `aio app add extension`
166166

@@ -186,7 +186,7 @@ ALIASES
186186
$ aio app add extensions
187187
```
188188

189-
_See code: [src/commands/app/add/extension.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.1.3/src/commands/app/add/extension.js)_
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)_
190190

191191
## `aio app add service`
192192

@@ -210,7 +210,7 @@ ALIASES
210210
$ aio app add services
211211
```
212212

213-
_See code: [src/commands/app/add/service.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.1.3/src/commands/app/add/service.js)_
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)_
214214

215215
## `aio app add web-assets`
216216

@@ -231,7 +231,7 @@ DESCRIPTION
231231
Add web assets support
232232
```
233233

234-
_See code: [src/commands/app/add/web-assets.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.1.3/src/commands/app/add/web-assets.js)_
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)_
235235

236236
## `aio app build`
237237

@@ -261,7 +261,7 @@ DESCRIPTION
261261
Use the --force-build flag to force a build even if one already exists.
262262
```
263263

264-
_See code: [src/commands/app/build.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.1.3/src/commands/app/build.js)_
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)_
265265

266266
## `aio app clean`
267267

@@ -286,7 +286,7 @@ DESCRIPTION
286286
Note that this will require a full rebuild on your next build command.
287287
```
288288

289-
_See code: [src/commands/app/clean.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.1.3/src/commands/app/clean.js)_
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)_
290290

291291
## `aio app create [PATH]`
292292

@@ -308,7 +308,7 @@ DESCRIPTION
308308
Create a new Adobe I/O App with default parameters
309309
```
310310

311-
_See code: [src/commands/app/create.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.1.3/src/commands/app/create.js)_
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)_
312312

313313
## `aio app delete`
314314

@@ -326,7 +326,7 @@ DESCRIPTION
326326
Delete a component from an existing Adobe I/O App
327327
```
328328

329-
_See code: [src/commands/app/delete/index.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.1.3/src/commands/app/delete/index.js)_
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)_
330330

331331
## `aio app delete action [ACTION-NAME]`
332332

@@ -352,7 +352,7 @@ ALIASES
352352
$ aio app delete actions
353353
```
354354

355-
_See code: [src/commands/app/delete/action.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.1.3/src/commands/app/delete/action.js)_
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)_
356356

357357
## `aio app delete ci`
358358

@@ -371,7 +371,7 @@ DESCRIPTION
371371
Delete existing CI files
372372
```
373373

374-
_See code: [src/commands/app/delete/ci.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.1.3/src/commands/app/delete/ci.js)_
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)_
375375

376376
## `aio app delete extension`
377377

@@ -397,7 +397,7 @@ ALIASES
397397
$ aio app delete extensions
398398
```
399399

400-
_See code: [src/commands/app/delete/extension.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.1.3/src/commands/app/delete/extension.js)_
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)_
401401

402402
## `aio app delete service`
403403

@@ -421,7 +421,7 @@ ALIASES
421421
$ aio app delete services
422422
```
423423

424-
_See code: [src/commands/app/delete/service.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.1.3/src/commands/app/delete/service.js)_
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)_
425425

426426
## `aio app delete web-assets`
427427

@@ -440,7 +440,7 @@ DESCRIPTION
440440
Delete existing web assets
441441
```
442442

443-
_See code: [src/commands/app/delete/web-assets.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.1.3/src/commands/app/delete/web-assets.js)_
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)_
444444

445445
## `aio app deploy`
446446

@@ -486,7 +486,7 @@ DESCRIPTION
486486
Use the --force-deploy flag to force deploy changes, regardless of production Workspace being published in Exchange.
487487
```
488488

489-
_See code: [src/commands/app/deploy.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.1.3/src/commands/app/deploy.js)_
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)_
490490

491491
## `aio app get-url [ACTION]`
492492

@@ -508,7 +508,7 @@ DESCRIPTION
508508
Get action URLs
509509
```
510510

511-
_See code: [src/commands/app/get-url.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.1.3/src/commands/app/get-url.js)_
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)_
512512

513513
## `aio app info`
514514

@@ -530,7 +530,7 @@ DESCRIPTION
530530
Display settings/configuration in use by an Adobe I/O App
531531
```
532532

533-
_See code: [src/commands/app/info.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.1.3/src/commands/app/info.js)_
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)_
534534

535535
## `aio app init [PATH]`
536536

@@ -572,30 +572,31 @@ DESCRIPTION
572572
Create a new Adobe I/O App
573573
```
574574

575-
_See code: [src/commands/app/init.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.1.3/src/commands/app/init.js)_
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)_
576576

577577
## `aio app install PATH`
578578

579579
This command will support installing apps packaged by 'aio app pack'.
580580

581581
```
582582
USAGE
583-
$ aio app install PATH [-v] [--version] [-o <value>] [--tests]
583+
$ aio app install PATH [-v] [--version] [--allow-scripts] [-o <value>] [--tests]
584584
585585
ARGUMENTS
586586
PATH Path to the app package to install
587587
588588
FLAGS
589-
-o, --output=<value> [default: .] The packaged app output folder path
590-
-v, --verbose Verbose output
591-
--[no-]tests Run packaged app unit tests (e.g. aio app:test)
592-
--version Show version
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
593594
594595
DESCRIPTION
595596
This command will support installing apps packaged by 'aio app pack'.
596597
```
597598

598-
_See code: [src/commands/app/install.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.1.3/src/commands/app/install.js)_
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)_
599600

600601
## `aio app list`
601602

@@ -613,7 +614,7 @@ DESCRIPTION
613614
List components for Adobe I/O App
614615
```
615616

616-
_See code: [src/commands/app/list/index.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.1.3/src/commands/app/list/index.js)_
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)_
617618

618619
## `aio app list extension`
619620

@@ -638,7 +639,7 @@ ALIASES
638639
$ aio app list extensions
639640
```
640641

641-
_See code: [src/commands/app/list/extension.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.1.3/src/commands/app/list/extension.js)_
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)_
642643

643644
## `aio app logs`
644645

@@ -662,29 +663,30 @@ DESCRIPTION
662663
Fetch logs for an Adobe I/O App
663664
```
664665

665-
_See code: [src/commands/app/logs.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.1.3/src/commands/app/logs.js)_
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)_
666667

667668
## `aio app pack [PATH]`
668669

669670
This command will support packaging apps for redistribution.
670671

671672
```
672673
USAGE
673-
$ aio app pack [PATH] [-v] [--version] [-o <value>]
674+
$ aio app pack [PATH] [-v] [--version] [--lock-file] [-o <value>]
674675
675676
ARGUMENTS
676677
PATH [default: .] Path to the app directory to package
677678
678679
FLAGS
679680
-o, --output=<value> [default: dist/app.zip] The packaged app output file path
680681
-v, --verbose Verbose output
682+
--[no-]lock-file Include the package-lock.json file in the packaged app
681683
--version Show version
682684
683685
DESCRIPTION
684686
This command will support packaging apps for redistribution.
685687
```
686688

687-
_See code: [src/commands/app/pack.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.1.3/src/commands/app/pack.js)_
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)_
688690

689691
## `aio app run`
690692

@@ -706,7 +708,7 @@ DESCRIPTION
706708
Run an Adobe I/O App
707709
```
708710

709-
_See code: [src/commands/app/run.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.1.3/src/commands/app/run.js)_
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)_
710712

711713
## `aio app test`
712714

@@ -734,7 +736,7 @@ DESCRIPTION
734736
If the extension has a hook called 'test' in its 'ext.config.yaml', the script specified will be run instead.
735737
```
736738

737-
_See code: [src/commands/app/test.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.1.3/src/commands/app/test.js)_
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)_
738740

739741
## `aio app undeploy`
740742

@@ -759,7 +761,7 @@ DESCRIPTION
759761
Undeploys an Adobe I/O App
760762
```
761763

762-
_See code: [src/commands/app/undeploy.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.1.3/src/commands/app/undeploy.js)_
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)_
763765

764766
## `aio app use [CONFIG_FILE_PATH]`
765767

@@ -806,5 +808,5 @@ DESCRIPTION
806808
page in https://developer.adobe.com/console/
807809
```
808810

809-
_See code: [src/commands/app/use.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.1.3/src/commands/app/use.js)_
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)_
810812
<!-- commandsstop -->

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@adobe/aio-cli-plugin-app",
33
"description": "Create, Build and Deploy Adobe I/O Applications",
4-
"version": "14.1.3",
4+
"version": "14.3.0",
55
"author": "Adobe Inc.",
66
"bugs": "https://github.com/adobe/aio-cli-plugin-app/issues",
77
"dependencies": {
@@ -14,7 +14,7 @@
1414
"@adobe/aio-lib-ims": "^7",
1515
"@adobe/aio-lib-runtime": "^7.1.3",
1616
"@adobe/aio-lib-templates": "^3",
17-
"@adobe/aio-lib-web": "^7",
17+
"@adobe/aio-lib-web": "^7.0.6",
1818
"@adobe/generator-aio-app": "^9",
1919
"@adobe/generator-app-common-lib": "^3",
2020
"@adobe/inquirer-table-checkbox": "^2",

src/commands/app/install.js

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const execa = require('execa')
1919
const unzipper = require('unzipper')
2020
const { validateJsonWithSchema } = require('../../lib/install-helper')
2121
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')
2323
const ora = require('ora')
2424

2525
// eslint-disable-next-line node/no-missing-require
@@ -51,7 +51,14 @@ class InstallCommand extends BaseCommand {
5151
await this.unzipFile(args.path, outputPath)
5252
await this.validateAppConfig(outputPath, USER_CONFIG_FILE)
5353
await this.validateDeployConfig(outputPath, DEPLOY_CONFIG_FILE)
54-
await this.npmInstall(flags.verbose)
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+
}
5562
if (flags.tests) {
5663
await this.runTests()
5764
}
@@ -131,15 +138,26 @@ class InstallCommand extends BaseCommand {
131138
}
132139
}
133140

134-
async npmInstall (isVerbose) {
141+
async npmInstall (isVerbose = false, allowScripts = true) {
142+
const ignoreScripts = allowScripts ? undefined : '--ignore-scripts'
135143
this.spinner.start('Running npm install...')
136144
const stdio = isVerbose ? 'inherit' : 'ignore'
137-
return execa('npm', ['install'], { stdio })
145+
return execa('npm', ['install', ignoreScripts], { stdio })
138146
.then(() => {
139147
this.spinner.succeed('Ran npm install')
140148
})
141149
}
142150

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+
143161
async runTests (isVerbose) {
144162
this.spinner.start('Running app tests...')
145163
return this.config.runCommand('app:test').then((result) => {
@@ -157,6 +175,11 @@ InstallCommand.description = `This command will support installing apps packaged
157175

158176
InstallCommand.flags = {
159177
...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+
}),
160183
output: Flags.string({
161184
description: 'The packaged app output folder path',
162185
char: 'o',

0 commit comments

Comments
 (0)