@adobe/aio-cli-plugin-app 14.3.2 → 14.4.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.
@@ -16,7 +16,8 @@ const { setRuntimeApiHostAndAuthHandler } = require('../../../../lib/auth-helper
16
16
 
17
17
  class LogForwardingCommand extends BaseCommand {
18
18
  async run () {
19
- let aioConfig = (await this.getFullConfig()).aio
19
+ const { flags } = await this.parse(LogForwardingCommand)
20
+ let aioConfig = (await this.getFullConfig({}, flags)).aio
20
21
  aioConfig = setRuntimeApiHostAndAuthHandler(aioConfig)
21
22
  const lf = await LogForwarding.init(aioConfig)
22
23
 
@@ -50,5 +51,8 @@ class LogForwardingCommand extends BaseCommand {
50
51
 
51
52
  LogForwardingCommand.description = 'Set log forwarding destination configuration'
52
53
  LogForwardingCommand.aliases = ['app:config:set:log-forwarding', 'app:config:set:lf']
54
+ LogForwardingCommand.flags = {
55
+ ...BaseCommand.flags
56
+ }
53
57
 
54
58
  module.exports = LogForwardingCommand
@@ -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 = await this.getFullConfig()
34
- const { actions, actionsByImpl } = await this.getAllActions(fullConfig)
33
+ const fullConfig = await this.getFullConfig({}, flags)
34
+ const { actions, actionsByImpl } = await this.getAllActions(fullConfig, flags)
35
35
  if (actions.length <= 0) {
36
36
  this.error('There are no actions in this project!')
37
37
  }
@@ -108,7 +108,7 @@ class DeleteActionCommand extends BaseCommand {
108
108
  )))
109
109
  }
110
110
 
111
- async getAllActions (config) {
111
+ async getAllActions (config, flags = {}) {
112
112
  const actions = []
113
113
  const actionsByImpl = {}
114
114
  const allConfigEntries = Object.entries(config.all)
@@ -121,7 +121,7 @@ class DeleteActionCommand extends BaseCommand {
121
121
  for (const [actionName, action] of actionEntries) {
122
122
  const fullActionName = `${pkgName}/${actionName}`
123
123
  const startKey = implName === 'application' ? 'application' : `extensions.${implName}`
124
- const configData = await this.getConfigFileForKey(`${startKey}.runtimeManifest.packages.${pkgName}.actions.${actionName}`)
124
+ const configData = await this.getConfigFileForKey(`${startKey}.runtimeManifest.packages.${pkgName}.actions.${actionName}`, flags)
125
125
  const actionObj = {
126
126
  // assumes path is not relative
127
127
  path: action.function,
@@ -157,13 +157,13 @@ DeleteActionCommand.flags = {
157
157
  }
158
158
 
159
159
  DeleteActionCommand.args =
160
- {
161
- 'action-name': Args.string({
162
- description: 'Action `pkg/name` to delete, you can specify multiple actions via a comma separated list',
163
- default: '',
164
- required: false
165
- })
166
- }
160
+ {
161
+ 'action-name': Args.string({
162
+ description: 'Action `pkg/name` to delete, you can specify multiple actions via a comma separated list',
163
+ default: '',
164
+ required: false
165
+ })
166
+ }
167
167
 
168
168
  DeleteActionCommand.aliases = ['app:delete:actions']
169
169
 
@@ -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 = await this.getFullConfig({ allowNoImpl: true })
31
+ const fullConfig = await this.getFullConfig({ allowNoImpl: true }, flags)
32
32
  const configs = await this.selectOrGetConfigsToDelete(flags, fullConfig)
33
33
 
34
34
  const resConfirm = await this.prompt([
@@ -44,7 +44,7 @@ class DeleteExtensionCommand extends BaseCommand {
44
44
  this.error('aborting..')
45
45
  }
46
46
 
47
- await this.deleteImplementations(configs)
47
+ await this.deleteImplementations(configs, flags)
48
48
 
49
49
  this.log(chalk.bold(chalk.green(
50
50
  `✔ Successfully deleted implementation(s) '${Object.keys(configs)}'` + EOL +
@@ -71,7 +71,7 @@ class DeleteExtensionCommand extends BaseCommand {
71
71
  return await this.getAppExtConfigs(flags)
72
72
  }
73
73
 
74
- async deleteImplementations (configs) {
74
+ async deleteImplementations (configs, flags) {
75
75
  for (const [id, c] of Object.entries(configs)) {
76
76
  // delete actions
77
77
  if (c.app.hasBackend) {
@@ -89,12 +89,12 @@ 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 = await this.getConfigFileForKey(configKey + '.operations')
92
+ const configDataOp = await this.getConfigFileForKey(configKey + '.operations', flags)
93
93
  if (configDataOp.file) {
94
94
  fs.removeSync(configDataOp.file)
95
95
  }
96
96
  // delete config in parent config file
97
- const configData = await this.getConfigFileForKey(configKey)
97
+ const configData = await this.getConfigFileForKey(configKey, flags)
98
98
  deleteUserConfig(configData)
99
99
  }
100
100
  }
@@ -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 = await this.getFullConfig()
28
+ const fullConfig = await this.getFullConfig({}, flags)
29
29
  const webAssetsByImpl = this.getAllWebAssets(fullConfig)
30
30
  if (!webAssetsByImpl) {
31
31
  this.error('web-assets not found')
@@ -57,7 +57,7 @@ class Deploy extends BuildCommand {
57
57
  const spinner = ora()
58
58
 
59
59
  try {
60
- const { aio: aioConfig, packagejson: packageJson } = await this.getFullConfig()
60
+ const { aio: aioConfig, packagejson: packageJson } = await this.getFullConfig({}, flags)
61
61
  const cliDetails = await getAccessToken({ useCachedToken: !flags.publish })
62
62
  const appInfo = {
63
63
  name: packageJson.name,
@@ -30,7 +30,7 @@ class GetUrlCommand extends BaseCommand {
30
30
  options.cdn = flags.cdn
31
31
 
32
32
  const urls = {}
33
- const fullConfig = await this.getFullConfig()
33
+ const fullConfig = await this.getFullConfig({}, flags)
34
34
  if (options.action) {
35
35
  let action
36
36
  // search for action
@@ -107,9 +107,9 @@ GetUrlCommand.flags = {
107
107
  }
108
108
 
109
109
  GetUrlCommand.args =
110
- {
111
- action: Args.string({
112
- })
113
- }
110
+ {
111
+ action: Args.string({
112
+ })
113
+ }
114
114
 
115
115
  module.exports = GetUrlCommand
@@ -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(await this.getFullConfig({ allowNoImpl: true }))
22
+ const appConfig = deepCopy(await this.getFullConfig({ allowNoImpl: true }, flags))
23
23
 
24
24
  // includes .env secret delete all aio config for now
25
25
  delete appConfig.aio
@@ -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 = await this.getFullConfig()
39
+ const fullConfig = await this.getFullConfig({}, flags)
40
40
 
41
41
  // has any backend
42
42
  const hasAnyBackend = Object.values(fullConfig.all).reduce((hasBackend, config) => hasBackend && config.app.hasBackend, true)
@@ -383,11 +383,11 @@ Pack.flags = {
383
383
  }
384
384
 
385
385
  Pack.args =
386
- {
387
- path: Args.string({
388
- description: 'Path to the app directory to package',
389
- default: '.'
390
- })
391
- }
386
+ {
387
+ path: Args.string({
388
+ description: 'Path to the app directory to package',
389
+ default: '.'
390
+ })
391
+ }
392
392
 
393
393
  module.exports = Pack
@@ -31,7 +31,7 @@ class Test extends BaseCommand {
31
31
  unit = true
32
32
  }
33
33
 
34
- const buildConfigs = await this.getAppExtConfigs({ extension })
34
+ const buildConfigs = await this.getAppExtConfigs(flags, { extension })
35
35
  aioLogger.debug(`run buildConfigs:${JSON.stringify(buildConfigs, null, 2)}`)
36
36
 
37
37
  const totalResults = []
@@ -202,6 +202,7 @@ class Test extends BaseCommand {
202
202
  }
203
203
 
204
204
  Test.flags = {
205
+ ...BaseCommand.flags,
205
206
  extension: Flags.string({
206
207
  char: 'e',
207
208
  description: 'the extension(s) to test',
@@ -51,7 +51,7 @@ class Undeploy extends BaseCommand {
51
51
 
52
52
  const spinner = ora()
53
53
  try {
54
- const { aio: aioConfig, packagejson: packageJson } = await this.getFullConfig()
54
+ const { aio: aioConfig, packagejson: packageJson } = await this.getFullConfig({}, flags)
55
55
  const cliDetails = await getAccessToken({ useCachedToken: !flags.unpublish })
56
56
  const appInfo = {
57
57
  name: packageJson.name,