Skip to content

Commit a6ea4e1

Browse files
authored
Merge pull request #390 from adobe/core-upgrade-v2
Update @adobe/aio-cli-plugin-runtime to @oclif/core v2
2 parents 3ca5176 + 19a9943 commit a6ea4e1

86 files changed

Lines changed: 694 additions & 556 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

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: 8 additions & 9 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,14 @@ class ActionCreate extends DeployServiceCommand {
224224
}
225225
}
226226

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

237236
ActionCreate.flags = {
238237
...DeployServiceCommand.flags,

src/commands/runtime/action/delete.js

Lines changed: 5 additions & 6 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,11 @@ class ActionDelete extends DeployServiceCommand {
2929
}
3030
}
3131

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

3938
ActionDelete.flags = {
4039
...DeployServiceCommand.flags,

src/commands/runtime/action/get.js

Lines changed: 5 additions & 6 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,11 @@ class ActionGet extends RuntimeBaseCommand {
9393
}
9494
}
9595

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

103102
ActionGet.flags = {
104103
...RuntimeBaseCommand.flags,

src/commands/runtime/action/invoke.js

Lines changed: 5 additions & 6 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,11 @@ class ActionInvoke extends RuntimeBaseCommand {
4949
}
5050
}
5151

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

5958
ActionInvoke.flags = {
6059
...RuntimeBaseCommand.flags,

src/commands/runtime/action/list.js

Lines changed: 6 additions & 7 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,19 @@ 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',
97+
ActionList.args = {
98+
packageName: Args.string({
10099
required: false
101-
}
102-
]
100+
})
101+
}
103102

104103
ActionList.flags = {
105104
...RuntimeBaseCommand.flags,

src/commands/runtime/action/update.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,20 @@ 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',
20+
ActionUpdate.args = {
21+
actionName: Args.string({
2222
required: true
23-
},
24-
{
25-
name: 'actionPath'
26-
}
27-
]
23+
}),
24+
actionPath: Args.string({
25+
required: false
26+
})
27+
}
2828

2929
ActionUpdate.flags = ActionCreate.flags
3030

src/commands/runtime/activation/get.js

Lines changed: 6 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,11 @@ class ActivationGet extends RuntimeBaseCommand {
4545
}
4646
}
4747

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

5454
ActivationGet.flags = {
5555
...RuntimeBaseCommand.flags,

src/commands/runtime/activation/list.js

Lines changed: 7 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,11 @@ 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({
203+
required: false
204+
})
205+
}
206206

207207
ActivationList.flags = {
208208
...RuntimeBaseCommand.flags,

src/commands/runtime/activation/logs.js

Lines changed: 6 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,11 @@ class ActivationLogs extends RuntimeBaseCommand {
8686
}
8787
}
8888

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

9595
ActivationLogs.flags = {
9696
...RuntimeBaseCommand.flags,

0 commit comments

Comments
 (0)