Skip to content

Commit b346612

Browse files
committed
Update @adobe/aio-cli-plugin-runtime to @oclif/core v2
1 parent 3ca5176 commit b346612

39 files changed

Lines changed: 202 additions & 319 deletions

‎package.json‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"@adobe/aio-lib-env": "^3.0.1",
1414
"@adobe/aio-lib-ims": "^8.0.1",
1515
"@adobe/aio-lib-runtime": "^7.1.0",
16-
"@oclif/core": "^1.3.0",
16+
"@oclif/core": "^2.8.12",
1717
"@types/jest": "^29.5.3",
1818
"chalk": "^4.1.2",
1919
"dayjs": "^1.10.4",
@@ -46,7 +46,6 @@
4646
"execa": "^4.0.0",
4747
"jest": "^29.6.2",
4848
"jest-junit": "^16.0.0",
49-
"jest-plugin-fs": "^2.9.0",
5049
"oclif": "^3.2.0",
5150
"stdout-stderr": "^0.1.9"
5251
},

‎src/commands/runtime/action/create.js‎

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ governing permissions and limitations under the License.
1313
const fs = require('fs')
1414
const { createKeyValueArrayFromFlag, createKeyValueArrayFromFile, createComponentsfromSequence, getKeyValueArrayFromMergedParameters } = require('@adobe/aio-lib-runtime').utils
1515
const { kindForFileExtension } = require('../../../kinds')
16-
const { Flags } = require('@oclif/core')
16+
const { Args, Flags } = require('@oclif/core')
1717
const DeployServiceCommand = require('../../../DeployServiceCommand')
1818

1919
class ActionCreate extends DeployServiceCommand {
@@ -224,15 +224,10 @@ class ActionCreate extends DeployServiceCommand {
224224
}
225225
}
226226

227-
ActionCreate.args = [
228-
{
229-
name: 'actionName',
230-
required: true
231-
},
232-
{
233-
name: 'actionPath'
234-
}
235-
]
227+
ActionCreate.args = {
228+
actionName: Args.string({ required: true }),
229+
actionPath: Args.string({ required: false })
230+
}
236231

237232
ActionCreate.flags = {
238233
...DeployServiceCommand.flags,

‎src/commands/runtime/action/delete.js‎

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ governing permissions and limitations under the License.
1111
*/
1212

1313
const DeployServiceCommand = require('../../../DeployServiceCommand')
14-
const { Flags } = require('@oclif/core')
14+
const { Args, Flags } = require('@oclif/core')
1515

1616
class ActionDelete extends DeployServiceCommand {
1717
async run () {
@@ -29,12 +29,9 @@ class ActionDelete extends DeployServiceCommand {
2929
}
3030
}
3131

32-
ActionDelete.args = [
33-
{
34-
name: 'actionName',
35-
required: true
36-
}
37-
]
32+
ActionDelete.args = {
33+
actionName: Args.string({ required: true })
34+
}
3835

3936
ActionDelete.flags = {
4037
...DeployServiceCommand.flags,

‎src/commands/runtime/action/get.js‎

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ governing permissions and limitations under the License.
1313
const fs = require('fs')
1414
const RuntimeBaseCommand = require('../../../RuntimeBaseCommand')
1515
const { fileExtensionForKind } = require('../../../kinds')
16-
const { Flags } = require('@oclif/core')
16+
const { Args, Flags } = require('@oclif/core')
1717

1818
class ActionGet extends RuntimeBaseCommand {
1919
async run () {
@@ -93,12 +93,9 @@ class ActionGet extends RuntimeBaseCommand {
9393
}
9494
}
9595

96-
ActionGet.args = [
97-
{
98-
name: 'actionName',
99-
required: true
100-
}
101-
]
96+
ActionGet.args = {
97+
actionName: Args.string({ required: true })
98+
}
10299

103100
ActionGet.flags = {
104101
...RuntimeBaseCommand.flags,

‎src/commands/runtime/action/invoke.js‎

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ governing permissions and limitations under the License.
1111
*/
1212

1313
const RuntimeBaseCommand = require('../../../RuntimeBaseCommand')
14-
const { Flags } = require('@oclif/core')
14+
const { Args, Flags } = require('@oclif/core')
1515
const { getKeyValueObjectFromMergedParameters } = require('@adobe/aio-lib-runtime').utils
1616

1717
class ActionInvoke extends RuntimeBaseCommand {
@@ -49,12 +49,9 @@ class ActionInvoke extends RuntimeBaseCommand {
4949
}
5050
}
5151

52-
ActionInvoke.args = [
53-
{
54-
name: 'actionName',
55-
required: true
56-
}
57-
]
52+
ActionInvoke.args = {
53+
actionName: Args.string({ required: true })
54+
}
5855

5956
ActionInvoke.flags = {
6057
...RuntimeBaseCommand.flags,

‎src/commands/runtime/action/list.js‎

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ governing permissions and limitations under the License.
1313
const moment = require('dayjs')
1414
const RuntimeBaseCommand = require('../../../RuntimeBaseCommand')
1515
const { parsePackageName } = require('@adobe/aio-lib-runtime').utils
16-
const { Flags, CliUx: cli } = require('@oclif/core')
16+
const { Args, Flags, ux } = require('@oclif/core')
1717
const decorators = require('../../../decorators').decorators()
1818

1919
class ActionList extends RuntimeBaseCommand {
@@ -86,20 +86,17 @@ class ActionList extends RuntimeBaseCommand {
8686
}
8787
}
8888
}
89-
cli.ux.table(result, columns)
89+
ux.table(result, columns)
9090
}
9191
} catch (err) {
9292
await this.handleError('failed to list the actions', err)
9393
}
9494
}
9595
}
9696

97-
ActionList.args = [
98-
{
99-
name: 'packageName',
100-
required: false
101-
}
102-
]
97+
ActionList.args = {
98+
packageName: Args.string({ required: false })
99+
}
103100

104101
ActionList.flags = {
105102
...RuntimeBaseCommand.flags,

‎src/commands/runtime/action/update.js‎

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,16 @@ governing permissions and limitations under the License.
1111
*/
1212

1313
const ActionCreate = require('./create')
14+
const { Args } = require('@oclif/core')
1415

1516
class ActionUpdate extends ActionCreate {
1617
isUpdate () { return true }
1718
}
1819

19-
ActionUpdate.args = [
20-
{
21-
name: 'actionName',
22-
required: true
23-
},
24-
{
25-
name: 'actionPath'
26-
}
27-
]
20+
ActionUpdate.args = {
21+
actionName: Args.string({ required: true }),
22+
actionPath: Args.string({ required: false })
23+
}
2824

2925
ActionUpdate.flags = ActionCreate.flags
3026

‎src/commands/runtime/activation/get.js‎

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTA
99
OF ANY KIND, either express or implied. See the License for the specific language
1010
governing permissions and limitations under the License.
1111
*/
12-
const { Flags } = require('@oclif/core')
12+
const { Args, Flags } = require('@oclif/core')
1313
const RuntimeBaseCommand = require('../../../RuntimeBaseCommand')
1414
const { printLogs } = require('@adobe/aio-lib-runtime').utils
1515

@@ -45,11 +45,9 @@ class ActivationGet extends RuntimeBaseCommand {
4545
}
4646
}
4747

48-
ActivationGet.args = [
49-
{
50-
name: 'activationID'
51-
}
52-
]
48+
ActivationGet.args = {
49+
activationID: Args.string({ required: false })
50+
}
5351

5452
ActivationGet.flags = {
5553
...RuntimeBaseCommand.flags,

‎src/commands/runtime/activation/list.js‎

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ governing permissions and limitations under the License.
1212

1313
const moment = require('dayjs')
1414
const RuntimeBaseCommand = require('../../../RuntimeBaseCommand')
15-
const { Flags, CliUx: cli } = require('@oclif/core')
15+
const { Args, Flags, ux } = require('@oclif/core')
1616
const decorators = require('../../../decorators').decorators()
1717
const statusStrings = ['success', 'app error', 'dev error', 'sys error']
1818

@@ -187,7 +187,7 @@ class ActivationList extends RuntimeBaseCommand {
187187
}
188188
}
189189
if (listActivation) {
190-
cli.ux.table(listActivation, columns, {
190+
ux.table(listActivation, columns, {
191191
'no-truncate': true
192192
})
193193
}
@@ -198,11 +198,9 @@ class ActivationList extends RuntimeBaseCommand {
198198
}
199199
}
200200

201-
ActivationList.args = [
202-
{
203-
name: 'action_name'
204-
}
205-
]
201+
ActivationList.args = {
202+
action_name: Args.string({ required: false })
203+
}
206204

207205
ActivationList.flags = {
208206
...RuntimeBaseCommand.flags,

‎src/commands/runtime/activation/logs.js‎

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ OF ANY KIND, either express or implied. See the License for the specific languag
1010
governing permissions and limitations under the License.
1111
*/
1212

13-
const { Flags } = require('@oclif/core')
13+
const { Args, Flags } = require('@oclif/core')
1414
const RuntimeBaseCommand = require('../../../RuntimeBaseCommand')
1515
const rtLib = require('@adobe/aio-lib-runtime')
1616
const printLogs = rtLib.utils.printLogs
@@ -86,11 +86,9 @@ class ActivationLogs extends RuntimeBaseCommand {
8686
}
8787
}
8888

89-
ActivationLogs.args = [
90-
{
91-
name: 'activationId'
92-
}
93-
]
89+
ActivationLogs.args = {
90+
activationId: Args.string({ required: false })
91+
}
9492

9593
ActivationLogs.flags = {
9694
...RuntimeBaseCommand.flags,

0 commit comments

Comments
 (0)