Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to oclif core v3 #102

Closed
wants to merge 11 commits into from
1 change: 1 addition & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodejs 18.16.1
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"bugs": "https://github.com/heroku/heroku-cli-command/issues",
"dependencies": {
"@heroku-cli/color": "^1.1.14",
"@oclif/core": "^2.8.11",
"@oclif/core": "^3.1.0",
"cli-ux": "^6.0.9",
"debug": "^4.1.1",
"fs-extra": "^7.0.1",
Expand All @@ -33,15 +33,15 @@
"chai": "^4.2.0",
"fancy-test": "^1.4.3",
"mocha": "^6.1.4",
"nock": "^10.0.6",
"nock": "^11.9.1",
"proxyquire": "^2.1.0",
"sinon": "^9.0.3",
"ts-node": "^8.1.0",
"tslint": "^6.1.3",
"typescript": "^4.8.4"
},
"engines": {
"node": ">=14.0.0"
"node": ">=18.0.0"
},
"files": [
"lib"
Expand Down
17 changes: 16 additions & 1 deletion src/completions.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,26 @@
import {Interfaces} from '@oclif/core'
import {CLIError} from '@oclif/core/lib/errors'
import {Completion} from '@oclif/core/lib/interfaces/parser'
import * as path from 'path'

import deps from './deps'
import {configRemote, getGitRemotes} from './git'

// These completion types were removed in @oclif/core v3. Copied from v2:
// https://github.com/oclif/core/blob/2.15.0/src/interfaces/parser.ts#L345-L357
export type CompletionContext = {
args?: { [name: string]: string };
flags?: { [name: string]: string };
argv?: string[];
config: Interfaces.Config;
}

export type Completion = {
skipCache?: boolean;
cacheDuration?: number;
cacheKey?(ctx: CompletionContext): Promise<string>;
options(ctx: CompletionContext): Promise<string[]>;
}

export const oneDay = 60 * 60 * 24

export const herokuGet = async (resource: string, ctx: {config: Interfaces.Config}): Promise<string[]> => {
Expand Down
2 changes: 1 addition & 1 deletion src/request-id.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as uuid from 'uuid'

export const requestIdHeader = 'Request-Id'
export const requestIdHeader = 'request-id'
ryandagg marked this conversation as resolved.
Show resolved Hide resolved

// tslint:disable-next-line: no-unnecessary-class
export class RequestId {
Expand Down
Loading
Loading