Skip to content

Commit 64706a7

Browse files
authored
Merge pull request #238 from adobe/oclif-core-upgrade
Update @adobe/aio-cli-plugin-console to @oclif/core v2
2 parents a403997 + b1730b4 commit 64706a7

File tree

23 files changed

+87
-99
lines changed

23 files changed

+87
-99
lines changed

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@
1010
"@adobe/aio-lib-core-logging": "^3",
1111
"@adobe/aio-lib-env": "^3",
1212
"@adobe/aio-lib-ims": "^7",
13-
"@oclif/core": "^1.4.0",
14-
"js-yaml": "^4.1.0"
13+
"@oclif/core": "^2.0.0",
14+
"js-yaml": "^4.1.0",
15+
"open": "^10.2.0"
1516
},
1617
"devDependencies": {
1718
"@adobe/eslint-config-aio-lib-config": "^4.0.0",
@@ -34,7 +35,6 @@
3435
"jest": "^29",
3536
"jest-haste-map": "^29.6.1",
3637
"jest-junit": "^16.0.0",
37-
"jest-plugin-fs": "^2.9.0",
3838
"oclif": "^4.17.13",
3939
"stdout-stderr": "^0.1.9"
4040
},
@@ -69,7 +69,7 @@
6969
"scripts": {
7070
"eslint": "eslint src test e2e",
7171
"test": "npm run unit-tests && npm run eslint",
72-
"unit-tests": "jest --ci -w=2",
72+
"unit-tests": "node --experimental-vm-modules node_modules/jest/bin/jest.js --ci -w=2",
7373
"prepack": "oclif manifest && oclif readme --no-aliases",
7474
"postpack": "rm -f oclif.manifest.json",
7575
"version": "oclif readme && git add README.md",

src/commands/console/open.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,8 @@ governing permissions and limitations under the License.
1010
*/
1111
const aioLogger = require('@adobe/aio-lib-core-logging')('@adobe/aio-cli-plugin-console:open', { provider: 'debug' })
1212
const { getCliEnv } = require('@adobe/aio-lib-env')
13-
const { CliUx } = require('@oclif/core')
1413
const { OPEN_URLS } = require('../../config')
15-
14+
const open = require('open')
1615
const ConsoleCommand = require('./index')
1716
class OpenCommand extends ConsoleCommand {
1817
async run () {
@@ -33,7 +32,7 @@ class OpenCommand extends ConsoleCommand {
3332
}
3433
}
3534
aioLogger.debug(`opening url ${url}`)
36-
CliUx.ux.open(url)
35+
open(url)
3736
}
3837
}
3938

src/commands/console/org/list.js

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

1313
const aioConsoleLogger = require('@adobe/aio-lib-core-logging')('@adobe/aio-cli-plugin-console:org:list', { provider: 'debug' })
14-
const { Flags, CliUx: { ux: cli } } = require('@oclif/core')
14+
const { Flags, ux } = require('@oclif/core')
1515
const { ORG_TYPE_ENTERPRISE } = require('../../../config')
1616

1717
const ConsoleCommand = require('../index')
@@ -73,7 +73,7 @@ class ListCommand extends ConsoleCommand {
7373
header: 'Org Name'
7474
}
7575
}
76-
cli.table(orgs, columns)
76+
ux.table(orgs, columns)
7777
}
7878
}
7979

src/commands/console/org/select.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
const aioConsoleLogger = require('@adobe/aio-lib-core-logging')('@adobe/aio-cli-plugin-console:org:select', { provider: 'debug' })
1313
const { CONFIG_KEYS } = require('../../../config')
14-
14+
const { Args } = require('@oclif/core')
1515
const ConsoleCommand = require('../index')
1616

1717
class SelectCommand extends ConsoleCommand {
@@ -53,13 +53,12 @@ class SelectCommand extends ConsoleCommand {
5353

5454
SelectCommand.description = 'Select an Organization'
5555

56-
SelectCommand.args = [
57-
{
58-
name: 'orgCode',
56+
SelectCommand.args = {
57+
orgCode: Args.string({
5958
required: false,
6059
description: 'Adobe Developer Console Org code'
61-
}
62-
]
60+
})
61+
}
6362

6463
SelectCommand.aliases = [
6564
'console:org:sel'

src/commands/console/project/list.js

Lines changed: 2 additions & 2 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
const aioConsoleLogger = require('@adobe/aio-lib-core-logging')('@adobe/aio-cli-plugin-console:project:list', { provider: 'debug' })
13-
const { Flags, CliUx: { ux: cli } } = require('@oclif/core')
13+
const { Flags, ux } = require('@oclif/core')
1414
const ConsoleCommand = require('../index')
1515

1616
class ListCommand extends ConsoleCommand {
@@ -67,7 +67,7 @@ class ListCommand extends ConsoleCommand {
6767
header: 'Title'
6868
}
6969
}
70-
cli.table(projects, columns)
70+
ux.table(projects, columns)
7171
}
7272
}
7373

src/commands/console/project/select.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,8 @@ OF ANY KIND, either express or implied. See the License for the specific languag
1010
governing permissions and limitations under the License.
1111
*/
1212
const aioConsoleLogger = require('@adobe/aio-lib-core-logging')('@adobe/aio-cli-plugin-console:project:select', { provider: 'debug' })
13-
const { Flags } = require('@oclif/core')
13+
const { Flags, Args } = require('@oclif/core')
1414
const { CONFIG_KEYS } = require('../../../config')
15-
1615
const ConsoleCommand = require('../index')
1716

1817
class SelectCommand extends ConsoleCommand {
@@ -59,13 +58,12 @@ class SelectCommand extends ConsoleCommand {
5958

6059
SelectCommand.description = 'Select a Project for the selected Organization'
6160

62-
SelectCommand.args = [
63-
{
64-
name: 'projectIdOrName',
61+
SelectCommand.args = {
62+
projectIdOrName: Args.string({
6563
required: false,
6664
description: 'Adobe Developer Console Project id or Project name'
67-
}
68-
]
65+
})
66+
}
6967

7068
SelectCommand.flags = {
7169
...ConsoleCommand.flags,

src/commands/console/publickey/delete.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ governing permissions and limitations under the License.
1010
*/
1111

1212
const aioConsoleLogger = require('@adobe/aio-lib-core-logging')('@adobe/aio-cli-plugin-console:publickey:list', { provider: 'debug' })
13-
const { Flags } = require('@oclif/core')
13+
const { Flags, Args } = require('@oclif/core')
1414
const { CONFIG_KEYS } = require('../../../config')
1515
const ConsoleCommand = require('../index')
1616

@@ -83,13 +83,12 @@ DeleteCommand.flags = {
8383
})
8484
}
8585

86-
DeleteCommand.args = [
87-
{
88-
name: 'idOrFingerprint',
86+
DeleteCommand.args = {
87+
idOrFingerprint: Args.string({
8988
required: true,
9089
description: 'The bindingId or the fingerprint of the public key binding to delete'
91-
}
92-
]
90+
})
91+
}
9392

9493
DeleteCommand.aliases = []
9594

src/commands/console/publickey/index.js

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

12-
const { Help, CliUx: { ux: cli } } = require('@oclif/core')
12+
const { Help, ux } = require('@oclif/core')
1313
const ConsoleCommand = require('../')
1414

1515
class IndexCommand extends ConsoleCommand {
@@ -47,7 +47,7 @@ IndexCommand.printBindings = function (bindings) {
4747
decorated.expiresString = binding.notAfter ? this.formatExpiry(binding.notAfter) : ''
4848
decorateds.push(decorated)
4949
})
50-
cli.table(decorateds, columns)
50+
ux.table(decorateds, columns)
5151
}
5252

5353
/**

src/commands/console/publickey/upload.js

Lines changed: 5 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 { Flags, Args } = require('@oclif/core')
1313
const ConsoleCommand = require('../index')
1414
const IndexCommand = require('./index')
1515
const fs = require('fs')
@@ -122,12 +122,11 @@ UploadAndBindCommand.flags = {
122122

123123
UploadAndBindCommand.aliases = []
124124

125-
UploadAndBindCommand.args = [
126-
{
127-
name: 'file',
125+
UploadAndBindCommand.args = {
126+
file: Args.string({
128127
required: true,
129128
description: 'Path to public key certificate file in PEM format'
130-
}
131-
]
129+
})
130+
}
132131

133132
module.exports = UploadAndBindCommand

src/commands/console/workspace/download.js

Lines changed: 7 additions & 4 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 { Flags, Args } = require('@oclif/core')
1313
const path = require('path')
1414
const ConsoleCommand = require('../index')
1515
const aioConsoleLogger = require('@adobe/aio-lib-core-logging')('@adobe/aio-cli-plugin-console:workspace:download', { provider: 'debug' })
@@ -102,8 +102,11 @@ DownloadCommand.aliases = [
102102
'console:ws:dl'
103103
]
104104

105-
DownloadCommand.args = [
106-
{ name: 'destination', required: false, description: 'Output file name or folder name where the Console Workspace configuration file should be saved' }
107-
]
105+
DownloadCommand.args = {
106+
destination: Args.string({
107+
required: false,
108+
description: 'Output file name or folder name where the Console Workspace configuration file should be saved'
109+
})
110+
}
108111

109112
module.exports = DownloadCommand

0 commit comments

Comments
 (0)