diff options
-rw-r--r-- | package.json | 2 | ||||
-rw-r--r-- | tsconfigdoc.json | 3 | ||||
-rw-r--r-- | typedoc-plugin-external-module-name/README.md | 21 | ||||
-rw-r--r-- | typedoc-plugin-external-module-name/index.js | 22 |
4 files changed, 2 insertions, 46 deletions
diff --git a/package.json b/package.json index 2c14cf8..f407192 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "ts-jest": "^27.0.5", "ts-morph": "^11.0.3", "ts-node": "^10.2.1", - "typedoc": "^0.21.0-beta.4", + "typedoc": "^0.21.6", "typescript": "^4.3.5" }, "husky": { diff --git a/tsconfigdoc.json b/tsconfigdoc.json index 17338e2..0fc1bd0 100644 --- a/tsconfigdoc.json +++ b/tsconfigdoc.json @@ -20,7 +20,6 @@ "readme": "./DOCS.md", "name": "@SimpleWebAuthn", "excludeExternals": true, - "excludePrivate": true, - "plugin": ["./typedoc-plugin-external-module-name"] + "excludePrivate": true } } diff --git a/typedoc-plugin-external-module-name/README.md b/typedoc-plugin-external-module-name/README.md deleted file mode 100644 index 32d3f5f..0000000 --- a/typedoc-plugin-external-module-name/README.md +++ /dev/null @@ -1,21 +0,0 @@ -# ATTENTION - -This folder contains a slightly-modified version of `typedoc-plugin-external-module-name@3.1.0` - -This folder exists because of a perfect storm of issues with TypeDoc package versioning: - -I'm using `typedoc@next` because it's the only version of TypeDoc that supports "--mode library" (see https://github.com/TypeStrong/typedoc/pull/1184), which is capable of generating awesome documentation despite this being a more complex monorepo project. - -The **typedoc-plugin-external-module-name** plugin (see https://github.com/christopherthielen/typedoc-plugin-external-module-name) was incorporated because it made it easy to rename package names in the docs to follow an easier-to-read naming convention versus what TypeDoc was generating. - -The original plugin as available on NPM is written with branching logic in `typedocVersionCompatibility.js > removeTags()` that checks for TypeDoc's version to be able to support removing tags from comments in a backwards-compatible manner. - -`typedoc@next` is version `0.17.0-3`, which semver coerces to "0.17.0". This causes `removeTags()` to throw an error saying: - -``` -TypeError: comment.removeTags is not a function -``` - -**The reality is that this version of TypeDoc is actually still a 0.16.x version of the library**, so this plugin fails because `removeTags()` isn't available on `comment`'s available will 0.17.0. - -To get docs hosting working, I've decided to temporarily host a modified version of this plugin in this repo until TypeDoc gets proper support for a "library" rendering mode. [It's pretty high up the priority list for whenever v0.18.0 drops](https://github.com/TypeStrong/typedoc/issues/1266) so hopefully this won't have to stick around for long... diff --git a/typedoc-plugin-external-module-name/index.js b/typedoc-plugin-external-module-name/index.js deleted file mode 100644 index d59e36c..0000000 --- a/typedoc-plugin-external-module-name/index.js +++ /dev/null @@ -1,22 +0,0 @@ -//@ts-check - -/* eslint-disable @typescript-eslint/no-var-requires */ -const { ReflectionKind } = require('typedoc'); -const { Converter } = require('typedoc/dist/lib/converter'); - -/** @param {import("typedoc/dist/lib/utils/plugins").PluginHost} host */ -exports.load = function (host) { - host.application.converter.on(Converter.EVENT_RESOLVE_BEGIN, context => { - /** @type {import("typedoc").ProjectReflection} */ - const project = context.project; - - for (const mod of (project.children || []).filter( - child => child.kind === ReflectionKind.Module, - )) { - const tag = mod.comment ? mod.comment.getTag('module') : void 0; - if (!tag) continue; - mod.name = tag.text; - mod.comment.removeTags('module'); - } - }); -}; |