Skip to content

Commit 8016c1c

Browse files
authored
feat: upgrade oclif deps (#75)
* feat: upgrade oclif deps * fix: lint
1 parent b9dcece commit 8016c1c

File tree

16 files changed

+2008
-775
lines changed

16 files changed

+2008
-775
lines changed

package-lock.json

Lines changed: 1953 additions & 720 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88
"bugs": "https://github.com/hackmdio/hackmd-cli/issues",
99
"dependencies": {
1010
"@hackmd/api": "^2.0.0",
11-
"@oclif/core": "^1.3.6",
12-
"@oclif/plugin-help": "^2.2.3",
13-
"@oclif/plugin-version": "^1.0.4",
11+
"@oclif/core": "2.8.2",
12+
"@oclif/plugin-help": "5.2.9",
13+
"@oclif/plugin-version": "1.3.3",
1414
"cli-ux": "^5.4.4",
1515
"fs-extra": "^8.1.0",
1616
"lodash.defaults": "^4.2.0",
17-
"oclif": "^2.5.0",
17+
"oclif": "3.8.1",
1818
"tslib": "^1.10.0"
1919
},
2020
"devDependencies": {

src/command.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import API from '@hackmd/api'
2-
import {CliUx, Command} from '@oclif/core'
2+
import {Command, ux} from '@oclif/core'
33

44
import config from './config'
55
import {setAccessTokenConfig} from './utils'
66

77
export default abstract class HackMDCommand extends Command {
88
async getAPIClient() {
9-
const token = config.accessToken || await CliUx.ux.prompt('Enter your access token', {
9+
const token = config.accessToken || await ux.prompt('Enter your access token', {
1010
type: 'hide'
1111
})
1212
const APIClient = new API(token, config.hackmdAPIEndpointURL)

src/commands/export.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export default class Export extends HackMDCommand {
1414

1515
static flags = {
1616
help: Flags.help({char: 'h'}),
17-
noteId: noteId()
17+
noteId
1818
}
1919

2020
async run() {

src/commands/history.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {CliUx, Flags} from '@oclif/core'
1+
import {Flags, ux} from '@oclif/core'
22

33
import HackMDCommand from '../command'
44

@@ -15,7 +15,7 @@ BnC6gN0_TfStV2KKmPPXeg Welcome to your team's workspace null C
1515

1616
static flags = {
1717
help: Flags.help({char: 'h'}),
18-
...CliUx.ux.table.flags(),
18+
...ux.table.flags(),
1919
}
2020

2121
async run() {
@@ -25,7 +25,7 @@ BnC6gN0_TfStV2KKmPPXeg Welcome to your team's workspace null C
2525
const APIClient = await this.getAPIClient()
2626
const history = await APIClient.getHistory()
2727

28-
CliUx.ux.table(history, {
28+
ux.table(history, {
2929
id: {
3030
header: 'ID',
3131
},

src/commands/notes/create.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import {
33
CreateNoteOptions,
44
NotePermissionRole,
55
} from '@hackmd/api/dist/type'
6-
import {CliUx, Flags} from '@oclif/core'
6+
import {Flags, ux} from '@oclif/core'
77
import * as fs from 'fs'
88

99
import HackMDCommand from '../../command'
@@ -33,13 +33,13 @@ raUuSTetT5uQbqQfLnz9lA A new note gvfz2UB5THiKABQJQnLs6Q
3333

3434
static flags = {
3535
help: Flags.help({char: 'h'}),
36-
title: noteTitle(),
37-
content: noteContent(),
38-
readPermission: notePermission(),
39-
writePermission: notePermission(),
40-
commentPermission: commentPermission(),
36+
title: noteTitle,
37+
content: noteContent,
38+
readPermission: notePermission,
39+
writePermission: notePermission,
40+
commentPermission,
4141
editor,
42-
...CliUx.ux.table.flags(),
42+
...ux.table.flags(),
4343
}
4444

4545
async run() {
@@ -69,7 +69,7 @@ raUuSTetT5uQbqQfLnz9lA A new note gvfz2UB5THiKABQJQnLs6Q
6969
const APIClient = await this.getAPIClient()
7070
const note = await APIClient.createNote(options)
7171

72-
CliUx.ux.table(
72+
ux.table(
7373
[note],
7474
{
7575
id: {

src/commands/notes/delete.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export default class Delete extends HackMDCommand {
1212

1313
static flags = {
1414
help: Flags.help({char: 'h'}),
15-
noteId: noteId(),
15+
noteId,
1616
}
1717

1818
async run() {

src/commands/notes/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {CliUx, Flags} from '@oclif/core'
1+
import {Flags, ux} from '@oclif/core'
22

33
import HackMDCommand from '../../command'
44
import {noteId} from '../../flags'
@@ -15,8 +15,8 @@ raUuSTetT5uQbqQfLnz9lA CLI test note gvfz2UB5THiKABQJQnLs6Q n
1515

1616
static flags = {
1717
help: Flags.help({char: 'h'}),
18-
noteId: noteId(),
19-
...CliUx.ux.table.flags(),
18+
noteId,
19+
...ux.table.flags(),
2020
}
2121

2222
async run() {
@@ -26,7 +26,7 @@ raUuSTetT5uQbqQfLnz9lA CLI test note gvfz2UB5THiKABQJQnLs6Q n
2626
const APIClient = await this.getAPIClient()
2727
const notes = flags.noteId ? [await APIClient.getNote(flags.noteId)] : await APIClient.getNoteList()
2828

29-
CliUx.ux.table(notes, {
29+
ux.table(notes, {
3030
id: {
3131
header: 'ID',
3232
},

src/commands/notes/update.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ export default class Update extends HackMDCommand {
1212

1313
static flags = {
1414
help: Flags.help({char: 'h'}),
15-
noteId: noteId(),
16-
content: noteContent()
15+
noteId,
16+
content: noteContent
1717
}
1818

1919
async run() {

src/commands/team-notes/create.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {CommentPermissionType, CreateNoteOptions, NotePermissionRole} from '@hackmd/api/dist/type'
2-
import {CliUx, Flags} from '@oclif/core'
2+
import {Flags, ux} from '@oclif/core'
33
import fs from 'fs'
44

55
import HackMDCommand from '../../command'
@@ -22,14 +22,14 @@ raUuSTetT5uQbqQfLnz9lA A new note gvfz2UB5THiKABQJQnLs6Q n
2222

2323
static flags = {
2424
help: Flags.help({char: 'h'}),
25-
teamPath: teamPath(),
26-
title: noteTitle(),
27-
content: noteContent(),
28-
readPermission: notePermission(),
29-
writePermission: notePermission(),
30-
commentPermission: commentPermission(),
25+
teamPath,
26+
title: noteTitle,
27+
content: noteContent,
28+
readPermission: notePermission,
29+
writePermission: notePermission,
30+
commentPermission,
3131
editor,
32-
...CliUx.ux.table.flags(),
32+
...ux.table.flags(),
3333
}
3434

3535
async run() {
@@ -64,7 +64,7 @@ raUuSTetT5uQbqQfLnz9lA A new note gvfz2UB5THiKABQJQnLs6Q n
6464
const APIClient = await this.getAPIClient()
6565
const note = await APIClient.createTeamNote(teamPath, options)
6666

67-
CliUx.ux.table([note], {
67+
ux.table([note], {
6868
id: {
6969
header: 'ID',
7070
},

0 commit comments

Comments
 (0)