Skip to content

Commit

Permalink
feat: Support for TypeScript 4.4
Browse files Browse the repository at this point in the history
Closes #1664
  • Loading branch information
Gerrit0 committed Aug 27, 2021
1 parent 77552ff commit da04509
Show file tree
Hide file tree
Showing 11 changed files with 596 additions and 385 deletions.
614 changes: 337 additions & 277 deletions package-lock.json

Large diffs are not rendered by default.

28 changes: 14 additions & 14 deletions package.json
Expand Up @@ -23,29 +23,29 @@
"glob": "^7.1.7",
"handlebars": "^4.7.7",
"lunr": "^2.3.9",
"marked": "^2.1.1",
"marked": "^3.0.2",
"minimatch": "^3.0.0",
"progress": "^2.0.3",
"shiki": "^0.9.3",
"typedoc-default-themes": "^0.12.10"
},
"peerDependencies": {
"typescript": "4.0.x || 4.1.x || 4.2.x || 4.3.x"
"typescript": "4.0.x || 4.1.x || 4.2.x || 4.3.x || 4.4.x"
},
"devDependencies": {
"@types/glob": "^7.1.3",
"@types/lunr": "^2.3.3",
"@types/marked": "^2.0.3",
"@types/minimatch": "3.0.4",
"@types/mocha": "^8.2.2",
"@types/node": "^15.12.2",
"@typescript-eslint/eslint-plugin": "^4.27.0",
"@typescript-eslint/parser": "^4.27.0",
"eslint": "^7.28.0",
"mocha": "^9.0.0",
"@types/glob": "^7.1.4",
"@types/lunr": "^2.3.4",
"@types/marked": "^3.0.0",
"@types/minimatch": "3.0.5",
"@types/mocha": "^9.0.0",
"@types/node": "^16.7.3",
"@typescript-eslint/eslint-plugin": "^4.29.3",
"@typescript-eslint/parser": "^4.29.3",
"eslint": "^7.32.0",
"mocha": "^9.1.0",
"nyc": "^15.1.0",
"prettier": "2.3.1",
"typescript": "^4.3.4"
"prettier": "2.3.2",
"typescript": "^4.4.2"
},
"files": [
"bin",
Expand Down
2 changes: 2 additions & 0 deletions src/lib/application.ts
Expand Up @@ -35,6 +35,7 @@ import {
ignorePackage,
loadPackageManifest,
} from "./utils/package-manifest";
import { ok } from "assert";

// eslint-disable-next-line @typescript-eslint/no-var-requires
const packageInfo = require("../../package.json") as {
Expand Down Expand Up @@ -264,6 +265,7 @@ export class Application extends ChildableComponent<
try {
this.options.setValue(key as keyof TypeDocOptions, val);
} catch (error) {
ok(error instanceof Error);
this.logger.error(error.message);
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/lib/utils/options/readers/arguments.ts
@@ -1,3 +1,4 @@
import { ok } from "assert";
import { OptionsReader, Options } from "..";
import { Logger } from "../../loggers";
import { ParameterType } from "../declaration";
Expand Down Expand Up @@ -35,6 +36,7 @@ export class ArgumentsReader implements OptionsReader {
try {
options.setValue(name, value);
} catch (err) {
ok(err instanceof Error);
logger.error(err.message);
}
};
Expand Down
2 changes: 2 additions & 0 deletions src/lib/utils/options/readers/tsconfig.ts
Expand Up @@ -6,6 +6,7 @@ import * as ts from "typescript";
import { OptionsReader, Options } from "../options";
import { Logger } from "../../loggers";
import { normalizePath } from "../../fs";
import { ok } from "assert";

function isFile(file: string) {
return existsSync(file) && statSync(file).isFile();
Expand Down Expand Up @@ -93,6 +94,7 @@ export class TSConfigReader implements OptionsReader {
join(fileToRead, "..")
);
} catch (error) {
ok(error instanceof Error);
logger.error(error.message);
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/lib/utils/options/readers/typedoc.ts
Expand Up @@ -4,6 +4,7 @@ import * as FS from "fs";
import { OptionsReader } from "..";
import { Logger } from "../../loggers";
import { Options } from "../options";
import { ok } from "assert";

/**
* Obtains option values from typedoc.json
Expand Down Expand Up @@ -93,6 +94,7 @@ export class TypeDocReader implements OptionsReader {
resolve(dirname(file))
);
} catch (error) {
ok(error instanceof Error);
logger.error(error.message);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/utils/package-manifest.ts
Expand Up @@ -232,7 +232,7 @@ export function getTsEntryPointForPackage(
if (/\.tsx?$/.test(entryPointPath) && existsSync(entryPointPath)) {
return entryPointPath;
}
} catch (e) {
} catch (e: any) {
if (e.code !== "MODULE_NOT_FOUND") {
throw e;
} else {
Expand Down
4 changes: 3 additions & 1 deletion src/lib/utils/plugins.ts
Expand Up @@ -35,7 +35,9 @@ export function loadPlugins(app: Application, plugins: readonly string[]) {
}
} catch (error) {
app.logger.error(`The plugin ${plugin} could not be loaded.`);
app.logger.error(error.stack);
if (error instanceof Error && error.stack) {
app.logger.error(error.stack);
}
}
}
}
Expand Down
11 changes: 11 additions & 0 deletions src/test/converter/types/index-signature.ts
@@ -0,0 +1,11 @@
export interface SymbolIndex {
[sym: symbol]: unknown;
}

export interface PartialIndex {
[optName: `data-${string}`]: unknown;
}

export interface UnionIndex {
[optName: string | symbol]: unknown;
}

0 comments on commit da04509

Please sign in to comment.