Skip to content

Commit

Permalink
fix: resolve typescript compilation errors (#290)
Browse files Browse the repository at this point in the history
* fix: resolve typescript compilation errors

* chore: test failures
  • Loading branch information
mdonnalley committed Nov 18, 2021
1 parent b4831e5 commit 7079932
Show file tree
Hide file tree
Showing 6 changed files with 80 additions and 258 deletions.
11 changes: 7 additions & 4 deletions package.json
Expand Up @@ -2,7 +2,7 @@
"name": "@oclif/core",
"description": "base library for oclif CLIs",
"version": "1.0.3",
"author": "Jeff Dickey @jdxcode",
"author": "Salesforce",
"bugs": "https://github.com/oclif/core/issues",
"dependencies": {
"@oclif/linewrap": "^1.0.0",
Expand All @@ -26,8 +26,7 @@
"devDependencies": {
"@commitlint/config-conventional": "^12.1.1",
"@oclif/plugin-help": "^5.1.2",
"@oclif/plugin-legacy": "^1.2.0",
"@oclif/plugin-plugins": "^1.10.1",
"@oclif/plugin-plugins": "^2.0.1",
"@oclif/test": "^1.2.8",
"@types/chai": "^4.1.7",
"@types/chai-as-promised": "^7.1.3",
Expand Down Expand Up @@ -60,7 +59,11 @@
"shx": "^0.3.3",
"sinon": "^11.1.1",
"ts-node": "^9.0.0",
"typescript": "4.4.3"
"typescript": "4.5.2"
},
"resolutions": {
"@oclif/command": "1.8.1",
"@oclif/parser": "3.8.6"
},
"engines": {
"node": ">=12.0.0"
Expand Down
4 changes: 2 additions & 2 deletions src/interfaces/parser.ts
Expand Up @@ -47,9 +47,9 @@ export interface CLIParseErrorOptions {
};
}

export type OutputArgs<T extends ParserInput['args']> = { [P in keyof T]: any }
export type OutputArgs = { [name: string]: any }
export type OutputFlags<T extends ParserInput['flags']> = { [P in keyof T]: any }
export type ParserOutput<TFlags extends OutputFlags<any>, TArgs extends OutputArgs<any>> = {
export type ParserOutput<TFlags extends OutputFlags<any>, TArgs extends OutputArgs> = {
// Add in global flags so that they show up in the types
// This is necessary because there's no easy way to optionally return
// the individual flags based on wether they're enabled or not
Expand Down
2 changes: 1 addition & 1 deletion src/parser/parse.ts
Expand Up @@ -33,7 +33,7 @@ const readStdin = async () => {
return result
}

export class Parser<T extends ParserInput, TFlags extends OutputFlags<T['flags']>, TArgs extends OutputArgs<T['args']>> {
export class Parser<T extends ParserInput, TFlags extends OutputFlags<T['flags']>, TArgs extends OutputArgs> {
private readonly argv: string[]

private readonly raw: ParsingToken[] = []
Expand Down
6 changes: 3 additions & 3 deletions test/command/main-esm.test.ts
Expand Up @@ -17,7 +17,7 @@ describe('main-esm', () => {
fancy
.stdout()
.do(() => run(['plugins'], root))
.do((output: any) => expect(output.stdout).to.equal('no plugins installed\n'))
.do((output: any) => expect(output.stdout).to.equal('No plugins installed.\n'))
.it('runs plugins')

fancy
Expand All @@ -38,11 +38,11 @@ USAGE
$ oclif [COMMAND]
TOPICS
plugins list installed plugins
plugins List installed plugins.
COMMANDS
help Display help for oclif.
plugins list installed plugins
plugins List installed plugins.
`))
.it('runs --help')
Expand Down
6 changes: 3 additions & 3 deletions test/command/main.test.ts
Expand Up @@ -11,7 +11,7 @@ describe('main', () => {
fancy
.stdout()
.do(() => run(['plugins'], root))
.do((output: any) => expect(output.stdout).to.equal('no plugins installed\n'))
.do((output: any) => expect(output.stdout).to.equal('No plugins installed.\n'))
.it('runs plugins')

fancy
Expand All @@ -32,11 +32,11 @@ USAGE
$ oclif [COMMAND]
TOPICS
plugins list installed plugins
plugins List installed plugins.
COMMANDS
help Display help for oclif.
plugins list installed plugins
plugins List installed plugins.
`))
.it('runs --help')
Expand Down

0 comments on commit 7079932

Please sign in to comment.