@adobe/aio-cli-plugin-app 11.1.0 → 12.0.1
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 +96 -49
- package/oclif.manifest.json +37 -22
- package/package.json +22 -23
- package/src/BaseCommand.js +18 -27
- package/src/commands/app/add/action.js +2 -2
- package/src/commands/app/add/event.js +3 -3
- package/src/commands/app/add/extension.js +1 -1
- package/src/commands/app/add/web-assets.js +2 -2
- package/src/commands/app/build.js +3 -1
- package/src/commands/app/config/get/log-forwarding/errors.js +1 -1
- package/src/commands/app/config/get/log-forwarding.js +1 -1
- package/src/commands/app/config/set/log-forwarding.js +8 -3
- package/src/commands/app/delete/action.js +13 -10
- package/src/commands/app/delete/extension.js +7 -7
- package/src/commands/app/delete/web-assets.js +1 -1
- package/src/commands/app/deploy.js +12 -8
- package/src/commands/app/get-url.js +1 -1
- package/src/commands/app/info.js +1 -1
- package/src/commands/app/init.js +12 -6
- package/src/commands/app/install.js +13 -11
- package/src/commands/app/list/extension-points.js +1 -1
- package/src/commands/app/list/extension.js +1 -1
- package/src/commands/app/logs.js +1 -1
- package/src/commands/app/pack.js +4 -9
- package/src/commands/app/run.js +1 -1
- package/src/commands/app/test.js +1 -1
- package/src/commands/app/undeploy.js +2 -2
- package/src/commands/app/use.js +29 -12
- package/src/lib/log-forwarding.js +3 -4
package/src/commands/app/use.js
CHANGED
|
@@ -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, {
|
|
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 (
|
|
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: '
|
|
373
|
-
default:
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
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
|
|
133
|
-
|
|
134
|
-
await
|
|
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 () {
|