@adobe/aio-cli-plugin-app 8.5.0 → 8.6.1-pre.2022-06-25.2ab6c018
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 +686 -256
- package/oclif.manifest.json +1 -1
- package/package.json +23 -27
- package/schema/config.schema.json +10 -1
- package/src/AddCommand.js +3 -3
- package/src/BaseCommand.js +13 -8
- package/src/commands/app/add/action.js +4 -4
- package/src/commands/app/add/ci.js +2 -2
- package/src/commands/app/add/event.js +4 -4
- package/src/commands/app/add/extension.js +4 -4
- package/src/commands/app/add/index.js +3 -3
- package/src/commands/app/add/service.js +3 -3
- package/src/commands/app/add/web-assets.js +4 -4
- package/src/commands/app/build.js +13 -13
- package/src/commands/app/config/get/index.js +3 -3
- package/src/commands/app/config/index.js +3 -3
- package/src/commands/app/config/set/index.js +3 -3
- package/src/commands/app/create.js +3 -3
- package/src/commands/app/delete/action.js +3 -3
- package/src/commands/app/delete/ci.js +3 -3
- package/src/commands/app/delete/event.js +3 -3
- package/src/commands/app/delete/extension.js +6 -6
- package/src/commands/app/delete/index.js +3 -3
- package/src/commands/app/delete/web-assets.js +3 -3
- package/src/commands/app/deploy.js +19 -21
- package/src/commands/app/get-url.js +20 -9
- package/src/commands/app/index.js +3 -3
- package/src/commands/app/info.js +7 -7
- package/src/commands/app/init.js +28 -9
- package/src/commands/app/list/extension-points.js +4 -4
- package/src/commands/app/list/extension.js +4 -4
- package/src/commands/app/list/index.js +3 -3
- package/src/commands/app/logs.js +20 -12
- package/src/commands/app/run.js +12 -11
- package/src/commands/app/test.js +7 -7
- package/src/commands/app/undeploy.js +10 -10
- package/src/commands/app/use.js +11 -11
- package/src/lib/build-actions.js +3 -2
- package/src/lib/deploy-actions.js +3 -3
- package/src/lib/run-dev.js +3 -4
- package/src/lib/run-local-runtime.js +22 -12
|
@@ -12,7 +12,7 @@ governing permissions and limitations under the License.
|
|
|
12
12
|
const AddCommand = require('../../../AddCommand')
|
|
13
13
|
const yeoman = require('yeoman-environment')
|
|
14
14
|
const aioLogger = require('@adobe/aio-lib-core-logging')('@adobe/aio-cli-plugin-app:add:web-assets', { provider: 'debug' })
|
|
15
|
-
const {
|
|
15
|
+
const { Flags } = require('@oclif/core')
|
|
16
16
|
const ora = require('ora')
|
|
17
17
|
const generators = require('@adobe/generator-aio-app')
|
|
18
18
|
const aioConfigLoader = require('@adobe/aio-lib-core-config')
|
|
@@ -20,7 +20,7 @@ const { servicesToGeneratorInput } = require('../../../lib/app-helper')
|
|
|
20
20
|
|
|
21
21
|
class AddWebAssetsCommand extends AddCommand {
|
|
22
22
|
async run () {
|
|
23
|
-
const { flags } = this.parse(AddWebAssetsCommand)
|
|
23
|
+
const { flags } = await this.parse(AddWebAssetsCommand)
|
|
24
24
|
const spinner = ora()
|
|
25
25
|
aioLogger.debug(`add web-assets with flags: ${JSON.stringify(flags)}`)
|
|
26
26
|
|
|
@@ -60,12 +60,12 @@ AddWebAssetsCommand.description = `Add web assets support
|
|
|
60
60
|
`
|
|
61
61
|
|
|
62
62
|
AddWebAssetsCommand.flags = {
|
|
63
|
-
yes:
|
|
63
|
+
yes: Flags.boolean({
|
|
64
64
|
description: 'Skip questions, and use all default values',
|
|
65
65
|
default: false,
|
|
66
66
|
char: 'y'
|
|
67
67
|
}),
|
|
68
|
-
extension:
|
|
68
|
+
extension: Flags.string({
|
|
69
69
|
description: 'Add web-assets to a specific extension',
|
|
70
70
|
char: 'e',
|
|
71
71
|
multiple: false,
|
|
@@ -14,7 +14,7 @@ const ora = require('ora')
|
|
|
14
14
|
const chalk = require('chalk')
|
|
15
15
|
|
|
16
16
|
const BaseCommand = require('../../BaseCommand')
|
|
17
|
-
const {
|
|
17
|
+
const { Flags } = require('@oclif/core')
|
|
18
18
|
const { runScript, writeConfig } = require('../../lib/app-helper')
|
|
19
19
|
const RuntimeLib = require('@adobe/aio-lib-runtime')
|
|
20
20
|
const { bundle } = require('@adobe/aio-lib-web')
|
|
@@ -24,7 +24,7 @@ const aioLogger = require('@adobe/aio-lib-core-logging')('@adobe/aio-cli-plugin-
|
|
|
24
24
|
class Build extends BaseCommand {
|
|
25
25
|
async run () {
|
|
26
26
|
// cli input
|
|
27
|
-
const { flags } = this.parse(Build)
|
|
27
|
+
const { flags } = await this.parse(Build)
|
|
28
28
|
// flags
|
|
29
29
|
flags['web-assets'] = flags['web-assets'] && !flags['skip-static'] && !flags['skip-web-assets'] && !flags.action
|
|
30
30
|
flags.actions = flags.actions && !flags['skip-actions']
|
|
@@ -101,7 +101,7 @@ class Build extends BaseCommand {
|
|
|
101
101
|
if (flags['web-assets']) {
|
|
102
102
|
if (config.app.hasFrontend && (flags['force-build'] || !fs.existsSync(config.web.distProd))) {
|
|
103
103
|
if (config.app.hasBackend) {
|
|
104
|
-
const urls =
|
|
104
|
+
const urls = RuntimeLib.utils.getActionUrls(config, false, false, true)
|
|
105
105
|
await writeConfig(config.web.injectedConfig, urls)
|
|
106
106
|
}
|
|
107
107
|
spinner.start('Building web assets')
|
|
@@ -144,47 +144,47 @@ This will always force a rebuild unless --no-force-build is set.
|
|
|
144
144
|
|
|
145
145
|
Build.flags = {
|
|
146
146
|
...BaseCommand.flags,
|
|
147
|
-
'skip-static':
|
|
147
|
+
'skip-static': Flags.boolean({
|
|
148
148
|
description: '[deprecated] Please use --no-web-assets'
|
|
149
149
|
}),
|
|
150
|
-
'skip-web-assets':
|
|
150
|
+
'skip-web-assets': Flags.boolean({
|
|
151
151
|
description: '[deprecated] Please use --no-web-assets'
|
|
152
152
|
}),
|
|
153
|
-
'skip-actions':
|
|
153
|
+
'skip-actions': Flags.boolean({
|
|
154
154
|
description: '[deprecated] Please use --no-actions'
|
|
155
155
|
}),
|
|
156
|
-
actions:
|
|
156
|
+
actions: Flags.boolean({
|
|
157
157
|
description: '[default: true] Build actions if any',
|
|
158
158
|
default: true,
|
|
159
159
|
allowNo: true,
|
|
160
160
|
exclusive: ['action'] // should be action exclusive --no-action but see https://github.com/oclif/oclif/issues/600
|
|
161
161
|
}),
|
|
162
|
-
action:
|
|
162
|
+
action: Flags.string({
|
|
163
163
|
description: 'Build only a specific action, the flags can be specified multiple times, this will set --no-publish',
|
|
164
164
|
char: 'a',
|
|
165
165
|
exclusive: ['extension'],
|
|
166
166
|
multiple: true
|
|
167
167
|
}),
|
|
168
|
-
'web-assets':
|
|
168
|
+
'web-assets': Flags.boolean({
|
|
169
169
|
description: '[default: true] Build web-assets if any',
|
|
170
170
|
default: true,
|
|
171
171
|
allowNo: true
|
|
172
172
|
}),
|
|
173
|
-
'force-build':
|
|
173
|
+
'force-build': Flags.boolean({
|
|
174
174
|
description: '[default: true] Force a build even if one already exists',
|
|
175
175
|
default: true,
|
|
176
176
|
allowNo: true
|
|
177
177
|
}),
|
|
178
|
-
'content-hash':
|
|
178
|
+
'content-hash': Flags.boolean({
|
|
179
179
|
description: '[default: true] Enable content hashing in browser code',
|
|
180
180
|
default: true,
|
|
181
181
|
allowNo: true
|
|
182
182
|
}),
|
|
183
|
-
'web-optimize':
|
|
183
|
+
'web-optimize': Flags.boolean({
|
|
184
184
|
description: '[default: false] Enable optimization (minification) of js/css/html',
|
|
185
185
|
default: false
|
|
186
186
|
}),
|
|
187
|
-
extension:
|
|
187
|
+
extension: Flags.string({
|
|
188
188
|
description: 'Build only a specific extension point, the flags can be specified multiple times',
|
|
189
189
|
exclusive: ['action'],
|
|
190
190
|
multiple: true,
|
|
@@ -9,13 +9,13 @@ OF ANY KIND, either express or implied. See the License for the specific languag
|
|
|
9
9
|
governing permissions and limitations under the License.
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
const
|
|
12
|
+
const { Help } = require('@oclif/core')
|
|
13
13
|
const BaseCommand = require('../../../../BaseCommand')
|
|
14
14
|
|
|
15
15
|
class IndexCommand extends BaseCommand {
|
|
16
16
|
async run () {
|
|
17
|
-
const help = new
|
|
18
|
-
help.showHelp(['app:config:get', '--help'])
|
|
17
|
+
const help = new Help(this.config)
|
|
18
|
+
await help.showHelp(['app:config:get', '--help'])
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
|
|
@@ -9,13 +9,13 @@ OF ANY KIND, either express or implied. See the License for the specific languag
|
|
|
9
9
|
governing permissions and limitations under the License.
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
const
|
|
12
|
+
const { Help } = require('@oclif/core')
|
|
13
13
|
const BaseCommand = require('../../../BaseCommand')
|
|
14
14
|
|
|
15
15
|
class IndexCommand extends BaseCommand {
|
|
16
16
|
async run () {
|
|
17
|
-
const help = new
|
|
18
|
-
help.showHelp(['app:config', '--help'])
|
|
17
|
+
const help = new Help(this.config)
|
|
18
|
+
await help.showHelp(['app:config', '--help'])
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
|
|
@@ -9,13 +9,13 @@ OF ANY KIND, either express or implied. See the License for the specific languag
|
|
|
9
9
|
governing permissions and limitations under the License.
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
const
|
|
12
|
+
const { Help } = require('@oclif/core')
|
|
13
13
|
const BaseCommand = require('../../../../BaseCommand')
|
|
14
14
|
|
|
15
15
|
class IndexCommand extends BaseCommand {
|
|
16
16
|
async run () {
|
|
17
|
-
const help = new
|
|
18
|
-
help.showHelp(['app:config:set', '--help'])
|
|
17
|
+
const help = new Help(this.config)
|
|
18
|
+
await help.showHelp(['app:config:set', '--help'])
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
|
|
@@ -11,11 +11,11 @@ governing permissions and limitations under the License.
|
|
|
11
11
|
|
|
12
12
|
const BaseCommand = require('../../BaseCommand')
|
|
13
13
|
const InitCommand = require('./init')
|
|
14
|
-
const {
|
|
14
|
+
const { Flags } = require('@oclif/core')
|
|
15
15
|
|
|
16
16
|
class Create extends BaseCommand {
|
|
17
17
|
async run () {
|
|
18
|
-
const { args, flags } = this.parse(Create)
|
|
18
|
+
const { args, flags } = await this.parse(Create)
|
|
19
19
|
|
|
20
20
|
if (flags.import) {
|
|
21
21
|
return InitCommand.run([args.path, '-y', '--import', flags.import])
|
|
@@ -29,7 +29,7 @@ Create.description = `Create a new Adobe I/O App with default parameters
|
|
|
29
29
|
|
|
30
30
|
Create.flags = {
|
|
31
31
|
...BaseCommand.flags,
|
|
32
|
-
import:
|
|
32
|
+
import: Flags.string({
|
|
33
33
|
description: 'Import an Adobe I/O Developer Console configuration file',
|
|
34
34
|
char: 'i'
|
|
35
35
|
})
|
|
@@ -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 {
|
|
15
|
+
const { Flags } = require('@oclif/core')
|
|
16
16
|
const fs = require('fs-extra')
|
|
17
17
|
const path = require('path')
|
|
18
18
|
const chalk = require('chalk')
|
|
@@ -21,7 +21,7 @@ const { atLeastOne, deleteUserConfig } = require('../../../lib/app-helper')
|
|
|
21
21
|
|
|
22
22
|
class DeleteActionCommand extends BaseCommand {
|
|
23
23
|
async run () {
|
|
24
|
-
const { args, flags } = this.parse(DeleteActionCommand)
|
|
24
|
+
const { args, flags } = await this.parse(DeleteActionCommand)
|
|
25
25
|
|
|
26
26
|
aioLogger.debug(`deleting actions from the project, with args ${JSON.stringify(args)}, and flags: ${JSON.stringify(flags)}`)
|
|
27
27
|
|
|
@@ -145,7 +145,7 @@ DeleteActionCommand.description = `Delete existing actions
|
|
|
145
145
|
`
|
|
146
146
|
|
|
147
147
|
DeleteActionCommand.flags = {
|
|
148
|
-
yes:
|
|
148
|
+
yes: Flags.boolean({
|
|
149
149
|
description: 'Skip questions, and use all default values',
|
|
150
150
|
char: 'y',
|
|
151
151
|
default: false
|
|
@@ -12,12 +12,12 @@ governing permissions and limitations under the License.
|
|
|
12
12
|
const BaseCommand = require('../../../BaseCommand')
|
|
13
13
|
const yeoman = require('yeoman-environment')
|
|
14
14
|
const aioLogger = require('@adobe/aio-lib-core-logging')('@adobe/aio-cli-plugin-app:add:action', { provider: 'debug' })
|
|
15
|
-
const {
|
|
15
|
+
const { Flags } = require('@oclif/core')
|
|
16
16
|
const generators = require('@adobe/generator-aio-app')
|
|
17
17
|
|
|
18
18
|
class DeleteCICommand extends BaseCommand {
|
|
19
19
|
async run () {
|
|
20
|
-
const { flags } = this.parse(DeleteCICommand)
|
|
20
|
+
const { flags } = await this.parse(DeleteCICommand)
|
|
21
21
|
|
|
22
22
|
aioLogger.debug(`deleting CI files from the project, using flags: ${JSON.stringify(flags)}`)
|
|
23
23
|
|
|
@@ -37,7 +37,7 @@ DeleteCICommand.description = `Delete existing CI files
|
|
|
37
37
|
`
|
|
38
38
|
|
|
39
39
|
DeleteCICommand.flags = {
|
|
40
|
-
yes:
|
|
40
|
+
yes: Flags.boolean({
|
|
41
41
|
description: 'Skip questions, and use all default values',
|
|
42
42
|
default: false,
|
|
43
43
|
char: 'y'
|
|
@@ -11,13 +11,13 @@ 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 {
|
|
14
|
+
const { Flags } = require('@oclif/core')
|
|
15
15
|
const DeleteActionCommand = require('./action')
|
|
16
16
|
const chalk = require('chalk')
|
|
17
17
|
|
|
18
18
|
class DeleteEventCommand extends BaseCommand {
|
|
19
19
|
async run () {
|
|
20
|
-
const { args, flags } = this.parse(DeleteEventCommand)
|
|
20
|
+
const { args, flags } = await this.parse(DeleteEventCommand)
|
|
21
21
|
|
|
22
22
|
aioLogger.debug(`deleting events from the project, with args ${JSON.stringify(args)}, and flags: ${JSON.stringify(flags)}`)
|
|
23
23
|
|
|
@@ -46,7 +46,7 @@ DeleteEventCommand.description = `Delete existing Adobe I/O Events actions
|
|
|
46
46
|
`
|
|
47
47
|
|
|
48
48
|
DeleteEventCommand.flags = {
|
|
49
|
-
yes:
|
|
49
|
+
yes: Flags.boolean({
|
|
50
50
|
description: 'Skip questions, and use all default values',
|
|
51
51
|
char: 'y',
|
|
52
52
|
default: false
|
|
@@ -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:add:action', { provider: 'debug' })
|
|
14
|
-
const {
|
|
14
|
+
const { Flags } = require('@oclif/core')
|
|
15
15
|
|
|
16
16
|
const { atLeastOne, deleteUserConfig } = require('../../../lib/app-helper')
|
|
17
17
|
const { implPromptChoices } = require('../../../lib/defaults')
|
|
@@ -21,7 +21,7 @@ const { EOL } = require('os')
|
|
|
21
21
|
|
|
22
22
|
class DeleteExtensionCommand extends BaseCommand {
|
|
23
23
|
async run () {
|
|
24
|
-
const { flags } = this.parse(DeleteExtensionCommand)
|
|
24
|
+
const { flags } = await this.parse(DeleteExtensionCommand)
|
|
25
25
|
|
|
26
26
|
aioLogger.debug(`delete extension with flags: ${JSON.stringify(flags)}`)
|
|
27
27
|
|
|
@@ -102,19 +102,19 @@ class DeleteExtensionCommand extends BaseCommand {
|
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
104
|
|
|
105
|
-
DeleteExtensionCommand.description = `
|
|
105
|
+
DeleteExtensionCommand.description = `Delete existing extensions
|
|
106
106
|
`
|
|
107
107
|
DeleteExtensionCommand.flags = {
|
|
108
|
-
yes:
|
|
108
|
+
yes: Flags.boolean({
|
|
109
109
|
description: 'Skip questions, and use all default values',
|
|
110
110
|
default: false,
|
|
111
111
|
char: 'y'
|
|
112
112
|
}),
|
|
113
|
-
'skip-install':
|
|
113
|
+
'skip-install': Flags.boolean({
|
|
114
114
|
description: 'Skip npm installation after files are created',
|
|
115
115
|
default: false
|
|
116
116
|
}),
|
|
117
|
-
extension:
|
|
117
|
+
extension: Flags.string({
|
|
118
118
|
description: 'Specify extensions to delete, skips selection prompt',
|
|
119
119
|
char: 'e',
|
|
120
120
|
multiple: true
|
|
@@ -9,13 +9,13 @@ OF ANY KIND, either express or implied. See the License for the specific languag
|
|
|
9
9
|
governing permissions and limitations under the License.
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
const
|
|
12
|
+
const { Help } = require('@oclif/core')
|
|
13
13
|
const BaseCommand = require('../../../BaseCommand')
|
|
14
14
|
|
|
15
15
|
class DeleteCommand extends BaseCommand {
|
|
16
16
|
async run () {
|
|
17
|
-
const help = new
|
|
18
|
-
help.showHelp(['app:delete', '--help'])
|
|
17
|
+
const help = new Help(this.config)
|
|
18
|
+
await help.showHelp(['app:delete', '--help'])
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
|
|
@@ -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:add:action', { provider: 'debug' })
|
|
14
|
-
const {
|
|
14
|
+
const { Flags } = require('@oclif/core')
|
|
15
15
|
const fs = require('fs-extra')
|
|
16
16
|
const inquirer = require('inquirer')
|
|
17
17
|
const { atLeastOne } = require('../../../lib/app-helper')
|
|
@@ -21,7 +21,7 @@ const path = require('path')
|
|
|
21
21
|
|
|
22
22
|
class DeleteWebAssetsCommand extends BaseCommand {
|
|
23
23
|
async run () {
|
|
24
|
-
const { flags } = this.parse(DeleteWebAssetsCommand)
|
|
24
|
+
const { flags } = await this.parse(DeleteWebAssetsCommand)
|
|
25
25
|
|
|
26
26
|
aioLogger.debug(`deleting web assets from the project, using flags: ${JSON.stringify(flags)}`)
|
|
27
27
|
|
|
@@ -90,7 +90,7 @@ DeleteWebAssetsCommand.description = `Delete existing web assets
|
|
|
90
90
|
`
|
|
91
91
|
|
|
92
92
|
DeleteWebAssetsCommand.flags = {
|
|
93
|
-
yes:
|
|
93
|
+
yes: Flags.boolean({
|
|
94
94
|
description: 'Skip questions, and use all default values',
|
|
95
95
|
default: false,
|
|
96
96
|
char: 'y'
|
|
@@ -12,13 +12,11 @@ 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
|
-
const { cli } = require('cli-ux')
|
|
17
15
|
|
|
18
16
|
const BaseCommand = require('../../BaseCommand')
|
|
19
17
|
const BuildCommand = require('./build')
|
|
20
18
|
const webLib = require('@adobe/aio-lib-web')
|
|
21
|
-
const {
|
|
19
|
+
const { Flags, CliUx: { ux: cli } } = require('@oclif/core')
|
|
22
20
|
const { createWebExportFilter, runScript, buildExtensionPointPayloadWoMetadata, buildExcShellViewExtensionMetadata } = require('../../lib/app-helper')
|
|
23
21
|
const rtLib = require('@adobe/aio-lib-runtime')
|
|
24
22
|
const LogForwarding = require('../../lib/log-forwarding')
|
|
@@ -26,7 +24,7 @@ const LogForwarding = require('../../lib/log-forwarding')
|
|
|
26
24
|
class Deploy extends BuildCommand {
|
|
27
25
|
async run () {
|
|
28
26
|
// cli input
|
|
29
|
-
const { flags } = this.parse(Deploy)
|
|
27
|
+
const { flags } = await this.parse(Deploy)
|
|
30
28
|
|
|
31
29
|
// flags
|
|
32
30
|
flags['web-assets'] = flags['web-assets'] && !flags['skip-web-assets'] && !flags['skip-static'] && !flags.action
|
|
@@ -260,80 +258,80 @@ This will always force a rebuild unless --no-force-build is set.
|
|
|
260
258
|
|
|
261
259
|
Deploy.flags = {
|
|
262
260
|
...BaseCommand.flags,
|
|
263
|
-
'skip-build':
|
|
261
|
+
'skip-build': Flags.boolean({
|
|
264
262
|
description: '[deprecated] Please use --no-build'
|
|
265
263
|
}),
|
|
266
|
-
'skip-deploy':
|
|
264
|
+
'skip-deploy': Flags.boolean({
|
|
267
265
|
description: '[deprecated] Please use \'aio app build\''
|
|
268
266
|
}),
|
|
269
|
-
'skip-static':
|
|
267
|
+
'skip-static': Flags.boolean({
|
|
270
268
|
description: '[deprecated] Please use --no-web-assets'
|
|
271
269
|
}),
|
|
272
|
-
'skip-web-assets':
|
|
270
|
+
'skip-web-assets': Flags.boolean({
|
|
273
271
|
description: '[deprecated] Please use --no-web-assets'
|
|
274
272
|
}),
|
|
275
|
-
'skip-actions':
|
|
273
|
+
'skip-actions': Flags.boolean({
|
|
276
274
|
description: '[deprecated] Please use --no-actions'
|
|
277
275
|
}),
|
|
278
|
-
actions:
|
|
276
|
+
actions: Flags.boolean({
|
|
279
277
|
description: '[default: true] Deploy actions if any',
|
|
280
278
|
default: true,
|
|
281
279
|
allowNo: true,
|
|
282
280
|
exclusive: ['action'] // should be action exclusive --no-action but see https://github.com/oclif/oclif/issues/600
|
|
283
281
|
}),
|
|
284
|
-
action:
|
|
282
|
+
action: Flags.string({
|
|
285
283
|
description: 'Deploy only a specific action, the flags can be specified multiple times, this will set --no-publish',
|
|
286
284
|
char: 'a',
|
|
287
285
|
exclusive: ['extension'],
|
|
288
286
|
multiple: true
|
|
289
287
|
}),
|
|
290
|
-
'web-assets':
|
|
288
|
+
'web-assets': Flags.boolean({
|
|
291
289
|
description: '[default: true] Deploy web-assets if any',
|
|
292
290
|
default: true,
|
|
293
291
|
allowNo: true
|
|
294
292
|
}),
|
|
295
|
-
build:
|
|
293
|
+
build: Flags.boolean({
|
|
296
294
|
description: '[default: true] Run the build phase before deployment',
|
|
297
295
|
default: true,
|
|
298
296
|
allowNo: true
|
|
299
297
|
}),
|
|
300
|
-
'force-build':
|
|
298
|
+
'force-build': Flags.boolean({
|
|
301
299
|
description: '[default: true] Force a build even if one already exists',
|
|
302
300
|
exclusive: ['no-build'], // no-build
|
|
303
301
|
default: true,
|
|
304
302
|
allowNo: true
|
|
305
303
|
}),
|
|
306
|
-
'content-hash':
|
|
304
|
+
'content-hash': Flags.boolean({
|
|
307
305
|
description: '[default: true] Enable content hashing in browser code',
|
|
308
306
|
default: true,
|
|
309
307
|
allowNo: true
|
|
310
308
|
}),
|
|
311
|
-
open:
|
|
309
|
+
open: Flags.boolean({
|
|
312
310
|
description: 'Open the default web browser after a successful deploy, only valid if your app has a front-end',
|
|
313
311
|
default: false
|
|
314
312
|
}),
|
|
315
|
-
extension:
|
|
313
|
+
extension: Flags.string({
|
|
316
314
|
description: 'Deploy only a specific extension, the flags can be specified multiple times',
|
|
317
315
|
exclusive: ['action'],
|
|
318
316
|
char: 'e',
|
|
319
317
|
multiple: true
|
|
320
318
|
}),
|
|
321
|
-
publish:
|
|
319
|
+
publish: Flags.boolean({
|
|
322
320
|
description: '[default: true] Publish extension(s) to Exchange',
|
|
323
321
|
allowNo: true,
|
|
324
322
|
default: true,
|
|
325
323
|
exclusive: ['action']
|
|
326
324
|
}),
|
|
327
|
-
'force-publish':
|
|
325
|
+
'force-publish': Flags.boolean({
|
|
328
326
|
description: 'Force publish extension(s) to Exchange, delete previously published extension points',
|
|
329
327
|
default: false,
|
|
330
328
|
exclusive: ['action', 'publish'] // no-publish is excluded
|
|
331
329
|
}),
|
|
332
|
-
'web-optimize':
|
|
330
|
+
'web-optimize': Flags.boolean({
|
|
333
331
|
description: '[default: false] Enable optimization (minification) of web js/css/html',
|
|
334
332
|
default: false
|
|
335
333
|
}),
|
|
336
|
-
'log-forwarding-update':
|
|
334
|
+
'log-forwarding-update': Flags.boolean({
|
|
337
335
|
description: '[default: true] Update log forwarding configuration on server',
|
|
338
336
|
default: true,
|
|
339
337
|
allowNo: true
|
|
@@ -12,17 +12,18 @@ governing permissions and limitations under the License.
|
|
|
12
12
|
|
|
13
13
|
const chalk = require('chalk')
|
|
14
14
|
|
|
15
|
-
const {
|
|
15
|
+
const { Flags } = require('@oclif/core')
|
|
16
16
|
|
|
17
17
|
const BaseCommand = require('../../BaseCommand')
|
|
18
18
|
const { wrapError } = require('../../lib/app-helper')
|
|
19
19
|
const { getActionUrls } = require('@adobe/aio-lib-runtime').utils
|
|
20
20
|
const yaml = require('js-yaml')
|
|
21
|
+
const { loadLocalDevConfig } = require('../../lib/run-local-runtime')
|
|
21
22
|
|
|
22
23
|
class GetUrlCommand extends BaseCommand {
|
|
23
24
|
async run () {
|
|
24
25
|
// cli input
|
|
25
|
-
const { args, flags } = this.parse(GetUrlCommand)
|
|
26
|
+
const { args, flags } = await this.parse(GetUrlCommand)
|
|
26
27
|
|
|
27
28
|
try {
|
|
28
29
|
const options = {}
|
|
@@ -45,9 +46,16 @@ class GetUrlCommand extends BaseCommand {
|
|
|
45
46
|
}
|
|
46
47
|
|
|
47
48
|
const actionUrls = {}
|
|
48
|
-
|
|
49
|
-
Object.
|
|
50
|
-
|
|
49
|
+
if (flags.local) {
|
|
50
|
+
Object.values(fullConfig.all).forEach(config => {
|
|
51
|
+
const localDevConfig = loadLocalDevConfig(config)
|
|
52
|
+
Object.assign(actionUrls, getActionUrls(localDevConfig, false, true))
|
|
53
|
+
})
|
|
54
|
+
} else {
|
|
55
|
+
Object.values(fullConfig.all).forEach(config => {
|
|
56
|
+
Object.assign(actionUrls, getActionUrls(config, true))
|
|
57
|
+
})
|
|
58
|
+
}
|
|
51
59
|
urls.runtime = actionUrls
|
|
52
60
|
const cdnUrls = {}
|
|
53
61
|
if (options.cdn) {
|
|
@@ -88,20 +96,23 @@ GetUrlCommand.description = 'Get action URLs'
|
|
|
88
96
|
|
|
89
97
|
GetUrlCommand.flags = {
|
|
90
98
|
...BaseCommand.flags,
|
|
91
|
-
cdn:
|
|
99
|
+
cdn: Flags.boolean({
|
|
92
100
|
description: 'Display CDN based action URLs'
|
|
93
101
|
}),
|
|
94
|
-
json:
|
|
102
|
+
json: Flags.boolean({
|
|
95
103
|
description: 'Output json',
|
|
96
104
|
char: 'j'
|
|
97
105
|
}),
|
|
98
|
-
hson:
|
|
106
|
+
hson: Flags.boolean({
|
|
99
107
|
description: 'Output human readable json',
|
|
100
108
|
char: 'h'
|
|
101
109
|
}),
|
|
102
|
-
yml:
|
|
110
|
+
yml: Flags.boolean({
|
|
103
111
|
description: 'Output yml',
|
|
104
112
|
char: 'y'
|
|
113
|
+
}),
|
|
114
|
+
local: Flags.boolean({
|
|
115
|
+
description: 'Display locally based action URLs'
|
|
105
116
|
})
|
|
106
117
|
}
|
|
107
118
|
|
|
@@ -10,13 +10,13 @@ OF ANY KIND, either express or implied. See the License for the specific languag
|
|
|
10
10
|
governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
const
|
|
13
|
+
const { Help } = require('@oclif/core')
|
|
14
14
|
const BaseCommand = require('../../BaseCommand')
|
|
15
15
|
|
|
16
16
|
class IndexCommand extends BaseCommand {
|
|
17
17
|
async run () {
|
|
18
|
-
const help = new
|
|
19
|
-
help.showHelp(['app', '--help'])
|
|
18
|
+
const help = new Help(this.config)
|
|
19
|
+
await help.showHelp(['app', '--help'])
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
|
package/src/commands/app/info.js
CHANGED
|
@@ -11,14 +11,14 @@ governing permissions and limitations under the License.
|
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
const BaseCommand = require('../../BaseCommand')
|
|
14
|
-
const {
|
|
14
|
+
const { Flags } = require('@oclif/core')
|
|
15
15
|
const yaml = require('js-yaml')
|
|
16
16
|
const deepCopy = require('lodash.clonedeep')
|
|
17
17
|
|
|
18
18
|
class Info extends BaseCommand {
|
|
19
19
|
async run () {
|
|
20
20
|
// cli input
|
|
21
|
-
const { flags } = this.parse(Info)
|
|
21
|
+
const { flags } = await this.parse(Info)
|
|
22
22
|
const appConfig = deepCopy(this.getFullConfig({ allowNoImpl: true }))
|
|
23
23
|
|
|
24
24
|
// includes .env secret delete all aio config for now
|
|
@@ -39,7 +39,7 @@ class Info extends BaseCommand {
|
|
|
39
39
|
this.log(JSON.stringify(appConfig))
|
|
40
40
|
} else if (flags.yml) {
|
|
41
41
|
// remove undefined fields
|
|
42
|
-
this.log(yaml.safeDump(JSON.parse(JSON.stringify(appConfig))))
|
|
42
|
+
this.log(yaml.safeDump(JSON.parse(JSON.stringify(appConfig)), {}))
|
|
43
43
|
} else { // flags.hson
|
|
44
44
|
this.log(JSON.stringify(appConfig, null, 2))
|
|
45
45
|
}
|
|
@@ -56,23 +56,23 @@ Info.description = `Display settings/configuration in use by an Adobe I/O App
|
|
|
56
56
|
|
|
57
57
|
Info.flags = {
|
|
58
58
|
...BaseCommand.flags,
|
|
59
|
-
json:
|
|
59
|
+
json: Flags.boolean({
|
|
60
60
|
description: 'Output json',
|
|
61
61
|
char: 'j',
|
|
62
62
|
exclusive: ['hson', 'yml']
|
|
63
63
|
}),
|
|
64
|
-
hson:
|
|
64
|
+
hson: Flags.boolean({
|
|
65
65
|
default: true,
|
|
66
66
|
description: 'Output human readable json',
|
|
67
67
|
char: 'h',
|
|
68
68
|
exclusive: ['json', 'yml']
|
|
69
69
|
}),
|
|
70
|
-
yml:
|
|
70
|
+
yml: Flags.boolean({
|
|
71
71
|
description: 'Output yml',
|
|
72
72
|
char: 'y',
|
|
73
73
|
exclusive: ['hson', 'json']
|
|
74
74
|
}),
|
|
75
|
-
mask:
|
|
75
|
+
mask: Flags.boolean({
|
|
76
76
|
description: 'Hide known private info',
|
|
77
77
|
default: true,
|
|
78
78
|
allowNo: true
|