From 69ac39aa48a37b5dae2eb51cca9cdb6909e08afb Mon Sep 17 00:00:00 2001 From: dobromirts Date: Wed, 18 Dec 2024 10:57:11 +0200 Subject: [PATCH] Update typedoc version and migrate to ESM --- package-lock.json | 231 ++++++++++++++++++------- package.json | 11 +- src/index.tsx | 71 ++++---- src/layouts/default.tsx | 28 +-- src/partials/analytics.tsx | 2 +- src/partials/breadcrumb.tsx | 4 +- src/partials/footer.tsx | 4 +- src/partials/header.tsx | 10 +- src/partials/index.tsx | 2 +- src/partials/member.declarations.tsx | 10 +- src/partials/member.signature.body.tsx | 14 +- src/partials/member.sources.tsx | 12 +- src/partials/navigation.tsx | 2 +- src/templates/reflection.tsx | 19 +- src/utils/lib.tsx | 12 +- tsconfig.json | 8 +- webpack.config.js | 13 +- 17 files changed, 285 insertions(+), 168 deletions(-) diff --git a/package-lock.json b/package-lock.json index d223025..84ca37e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,12 +9,12 @@ "version": "1.0.0", "license": "MIT", "dependencies": { - "typedoc-plugin-localization": "^3.0.5" + "typedoc-plugin-localization": "file:../../../typedoc-plugin-localization-1.0.4.tgz" }, "devDependencies": { "@types/fs-extra": "^9.0.13", "@types/lunr": "^2.3.3", - "@types/node": "^18.11.0", + "@types/node": "^20.17.6", "@types/react": "^17.0.40", "autoprefixer": "^9.8.6", "clean-webpack-plugin": "^3.0.0", @@ -31,7 +31,7 @@ "sass-loader": "^10.1.0", "style-loader": "^3.3.1", "ts-loader": "^8.0.12", - "typedoc": "^0.26.2", + "typedoc": "^0.27.0", "typescript": "^5.5.2", "url-loader": "^4.1.1", "webpack": "^5.11.1", @@ -39,8 +39,7 @@ "webpack-merge": "^5.7.3" }, "peerDependencies": { - "typedoc": "^0.26.2", - "typedoc-plugin-localization": "^3.0.5" + "typedoc": "^0.27.0" } }, "node_modules/@discoveryjs/json-ext": { @@ -52,6 +51,18 @@ "node": ">=10.0.0" } }, + "node_modules/@gerrit0/mini-shiki": { + "version": "1.24.4", + "resolved": "https://registry.npmjs.org/@gerrit0/mini-shiki/-/mini-shiki-1.24.4.tgz", + "integrity": "sha512-YEHW1QeAg6UmxEmswiQbOVEg1CW22b1XUD/lNTliOsu0LD0wqoyleFMnmbTp697QE0pcadQiR5cVtbbAPncvpw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@shikijs/engine-oniguruma": "^1.24.2", + "@shikijs/types": "^1.24.2", + "@shikijs/vscode-textmate": "^9.3.1" + } + }, "node_modules/@jridgewell/gen-mapping": { "version": "0.3.5", "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", @@ -145,11 +156,34 @@ "node": ">= 8" } }, - "node_modules/@shikijs/core": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/@shikijs/core/-/core-1.9.1.tgz", - "integrity": "sha512-EmUful2MQtY8KgCF1OkBtOuMcvaZEvmdubhW0UHCGXi21O9dRLeADVCj+k6ZS+de7Mz9d2qixOXJ+GLhcK3pXg==", - "dev": true + "node_modules/@shikijs/engine-oniguruma": { + "version": "1.24.2", + "resolved": "https://registry.npmjs.org/@shikijs/engine-oniguruma/-/engine-oniguruma-1.24.2.tgz", + "integrity": "sha512-ZN6k//aDNWRJs1uKB12pturKHh7GejKugowOFGAuG7TxDRLod1Bd5JhpOikOiFqPmKjKEPtEA6mRCf7q3ulDyQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@shikijs/types": "1.24.2", + "@shikijs/vscode-textmate": "^9.3.0" + } + }, + "node_modules/@shikijs/types": { + "version": "1.24.2", + "resolved": "https://registry.npmjs.org/@shikijs/types/-/types-1.24.2.tgz", + "integrity": "sha512-bdeWZiDtajGLG9BudI0AHet0b6e7FbR0EsE4jpGaI0YwHm/XJunI9+3uZnzFtX65gsyJ6ngCIWUfA4NWRPnBkQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@shikijs/vscode-textmate": "^9.3.0", + "@types/hast": "^3.0.4" + } + }, + "node_modules/@shikijs/vscode-textmate": { + "version": "9.3.1", + "resolved": "https://registry.npmjs.org/@shikijs/vscode-textmate/-/vscode-textmate-9.3.1.tgz", + "integrity": "sha512-79QfK1393x9Ho60QFyLti+QfdJzRQCVLFb97kOIV7Eo9vQU/roINgk7m24uv0a7AUvN//RDH36FLjjK48v0s9g==", + "dev": true, + "license": "MIT" }, "node_modules/@types/estree": { "version": "1.0.5", @@ -176,6 +210,16 @@ "@types/node": "*" } }, + "node_modules/@types/hast": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@types/hast/-/hast-3.0.4.tgz", + "integrity": "sha512-WPs+bbQw5aCj+x6laNGWLH3wviHtoCv/P3+otBhbOhJgG8qtpdAMlTCxLtsTWA7LH1Oh/bFCHsBn0TPS5m30EQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/unist": "*" + } + }, "node_modules/@types/json-schema": { "version": "7.0.11", "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz", @@ -195,10 +239,14 @@ "dev": true }, "node_modules/@types/node": { - "version": "18.11.9", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.9.tgz", - "integrity": "sha512-CRpX21/kGdzjOpFsZSkcrXMGIBWMGNIHXXBVFSH+ggkftxg+XYP20TESbh+zFvFj3EQOl5byk0HTRn1IL6hbqg==", - "dev": true + "version": "20.17.10", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.17.10.tgz", + "integrity": "sha512-/jrvh5h6NXhEauFFexRin69nA0uHJ5gwk4iDivp/DeoEua3uwCUto6PC86IpRITBOs4+6i2I56K5x5b6WYGXHA==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~6.19.2" + } }, "node_modules/@types/prop-types": { "version": "15.7.5", @@ -244,6 +292,13 @@ "source-map": "^0.6.1" } }, + "node_modules/@types/unist": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.3.tgz", + "integrity": "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==", + "dev": true, + "license": "MIT" + }, "node_modules/@types/webpack": { "version": "4.41.33", "resolved": "https://registry.npmjs.org/@types/webpack/-/webpack-4.41.33.tgz", @@ -5864,15 +5919,6 @@ "node": ">=8" } }, - "node_modules/shiki": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/shiki/-/shiki-1.9.1.tgz", - "integrity": "sha512-8PDkgb5ja3nfujTjvC4VytL6wGOGCtFAClUb2r3QROevYXxcq+/shVJK5s6gy0HZnjaJgFxd6BpPqpRfqne5rA==", - "dev": true, - "dependencies": { - "@shikijs/core": "1.9.1" - } - }, "node_modules/signal-exit": { "version": "3.0.7", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", @@ -6590,16 +6636,17 @@ "dev": true }, "node_modules/typedoc": { - "version": "0.26.2", - "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.26.2.tgz", - "integrity": "sha512-q/t+M+PZqhN9gPWLBZ3CCvP+KT8O1tyYkSzEYbcQ6mo89avdIrMlBEl3vfo5BgSzwC6Lbmq0W64E8RkY+eVsLA==", + "version": "0.27.5", + "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.27.5.tgz", + "integrity": "sha512-x+fhKJtTg4ozXwKayh/ek4wxZQI/+2hmZUdO2i2NGDBRUflDble70z+ewHod3d4gRpXSO6fnlnjbDTnJk7HlkQ==", "dev": true, + "license": "Apache-2.0", "dependencies": { + "@gerrit0/mini-shiki": "^1.24.0", "lunr": "^2.3.9", "markdown-it": "^14.1.0", - "minimatch": "^9.0.4", - "shiki": "^1.9.0", - "yaml": "^2.4.5" + "minimatch": "^9.0.5", + "yaml": "^2.6.1" }, "bin": { "typedoc": "bin/typedoc" @@ -6608,13 +6655,14 @@ "node": ">= 18" }, "peerDependencies": { - "typescript": "4.6.x || 4.7.x || 4.8.x || 4.9.x || 5.0.x || 5.1.x || 5.2.x || 5.3.x || 5.4.x || 5.5.x" + "typescript": "5.0.x || 5.1.x || 5.2.x || 5.3.x || 5.4.x || 5.5.x || 5.6.x || 5.7.x" } }, "node_modules/typedoc-plugin-localization": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/typedoc-plugin-localization/-/typedoc-plugin-localization-3.0.5.tgz", - "integrity": "sha512-mvk0/DyjlFWcjxl2d0AsDeM6X8TjFE8FlbVyPDjY0mg54mHk9INp1rAbx9zZ5jtiLUVHrE8t9fb8FacmbmvqwA==", + "version": "1.0.4", + "resolved": "file:../../../typedoc-plugin-localization-1.0.4.tgz", + "integrity": "sha512-ta81KJkrYoKM8e5oZ6a1eHPmMkKP7bBuYGcNvJMsoZEUccHmMHiQSFlXK5HFsPJEjW/YnRTfqQZZpaW44/JNJw==", + "license": "MIT", "dependencies": { "fs-extra": "^11.2.0" } @@ -6705,6 +6753,13 @@ "optional": true, "peer": true }, + "node_modules/undici-types": { + "version": "6.19.8", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", + "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==", + "dev": true, + "license": "MIT" + }, "node_modules/union-value": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", @@ -7594,10 +7649,11 @@ "dev": true }, "node_modules/yaml": { - "version": "2.4.5", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.4.5.tgz", - "integrity": "sha512-aBx2bnqDzVOyNKfsysjA2ms5ZlnjSAW2eG3/L5G/CSujfjLJTJsEw1bGw8kCf04KodQWk1pxlGnZ56CRxiawmg==", + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.6.1.tgz", + "integrity": "sha512-7r0XPzioN/Q9kXBro/XPnA6kznR73DHq+GXh5ON7ZozRO6aMjbmiBuKste2wslTFkC5d1dw0GooOCepZXJ2SAg==", "dev": true, + "license": "ISC", "bin": { "yaml": "bin.mjs" }, @@ -7677,6 +7733,17 @@ "integrity": "sha512-dBVuXR082gk3jsFp7Rd/JI4kytwGHecnCoTtXFb7DB6CNHp4rg5k1bhg0nWdLGLnOV71lmDzGQaLMy8iPLY0pw==", "dev": true }, + "@gerrit0/mini-shiki": { + "version": "1.24.4", + "resolved": "https://registry.npmjs.org/@gerrit0/mini-shiki/-/mini-shiki-1.24.4.tgz", + "integrity": "sha512-YEHW1QeAg6UmxEmswiQbOVEg1CW22b1XUD/lNTliOsu0LD0wqoyleFMnmbTp697QE0pcadQiR5cVtbbAPncvpw==", + "dev": true, + "requires": { + "@shikijs/engine-oniguruma": "^1.24.2", + "@shikijs/types": "^1.24.2", + "@shikijs/vscode-textmate": "^9.3.1" + } + }, "@jridgewell/gen-mapping": { "version": "0.3.5", "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", @@ -7752,10 +7819,30 @@ "fastq": "^1.6.0" } }, - "@shikijs/core": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/@shikijs/core/-/core-1.9.1.tgz", - "integrity": "sha512-EmUful2MQtY8KgCF1OkBtOuMcvaZEvmdubhW0UHCGXi21O9dRLeADVCj+k6ZS+de7Mz9d2qixOXJ+GLhcK3pXg==", + "@shikijs/engine-oniguruma": { + "version": "1.24.2", + "resolved": "https://registry.npmjs.org/@shikijs/engine-oniguruma/-/engine-oniguruma-1.24.2.tgz", + "integrity": "sha512-ZN6k//aDNWRJs1uKB12pturKHh7GejKugowOFGAuG7TxDRLod1Bd5JhpOikOiFqPmKjKEPtEA6mRCf7q3ulDyQ==", + "dev": true, + "requires": { + "@shikijs/types": "1.24.2", + "@shikijs/vscode-textmate": "^9.3.0" + } + }, + "@shikijs/types": { + "version": "1.24.2", + "resolved": "https://registry.npmjs.org/@shikijs/types/-/types-1.24.2.tgz", + "integrity": "sha512-bdeWZiDtajGLG9BudI0AHet0b6e7FbR0EsE4jpGaI0YwHm/XJunI9+3uZnzFtX65gsyJ6ngCIWUfA4NWRPnBkQ==", + "dev": true, + "requires": { + "@shikijs/vscode-textmate": "^9.3.0", + "@types/hast": "^3.0.4" + } + }, + "@shikijs/vscode-textmate": { + "version": "9.3.1", + "resolved": "https://registry.npmjs.org/@shikijs/vscode-textmate/-/vscode-textmate-9.3.1.tgz", + "integrity": "sha512-79QfK1393x9Ho60QFyLti+QfdJzRQCVLFb97kOIV7Eo9vQU/roINgk7m24uv0a7AUvN//RDH36FLjjK48v0s9g==", "dev": true }, "@types/estree": { @@ -7783,6 +7870,15 @@ "@types/node": "*" } }, + "@types/hast": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@types/hast/-/hast-3.0.4.tgz", + "integrity": "sha512-WPs+bbQw5aCj+x6laNGWLH3wviHtoCv/P3+otBhbOhJgG8qtpdAMlTCxLtsTWA7LH1Oh/bFCHsBn0TPS5m30EQ==", + "dev": true, + "requires": { + "@types/unist": "*" + } + }, "@types/json-schema": { "version": "7.0.11", "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz", @@ -7802,10 +7898,13 @@ "dev": true }, "@types/node": { - "version": "18.11.9", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.9.tgz", - "integrity": "sha512-CRpX21/kGdzjOpFsZSkcrXMGIBWMGNIHXXBVFSH+ggkftxg+XYP20TESbh+zFvFj3EQOl5byk0HTRn1IL6hbqg==", - "dev": true + "version": "20.17.10", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.17.10.tgz", + "integrity": "sha512-/jrvh5h6NXhEauFFexRin69nA0uHJ5gwk4iDivp/DeoEua3uwCUto6PC86IpRITBOs4+6i2I56K5x5b6WYGXHA==", + "dev": true, + "requires": { + "undici-types": "~6.19.2" + } }, "@types/prop-types": { "version": "15.7.5", @@ -7851,6 +7950,12 @@ "source-map": "^0.6.1" } }, + "@types/unist": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.3.tgz", + "integrity": "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==", + "dev": true + }, "@types/webpack": { "version": "4.41.33", "resolved": "https://registry.npmjs.org/@types/webpack/-/webpack-4.41.33.tgz", @@ -12347,15 +12452,6 @@ "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", "dev": true }, - "shiki": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/shiki/-/shiki-1.9.1.tgz", - "integrity": "sha512-8PDkgb5ja3nfujTjvC4VytL6wGOGCtFAClUb2r3QROevYXxcq+/shVJK5s6gy0HZnjaJgFxd6BpPqpRfqne5rA==", - "dev": true, - "requires": { - "@shikijs/core": "1.9.1" - } - }, "signal-exit": { "version": "3.0.7", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", @@ -12933,16 +13029,16 @@ "dev": true }, "typedoc": { - "version": "0.26.2", - "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.26.2.tgz", - "integrity": "sha512-q/t+M+PZqhN9gPWLBZ3CCvP+KT8O1tyYkSzEYbcQ6mo89avdIrMlBEl3vfo5BgSzwC6Lbmq0W64E8RkY+eVsLA==", + "version": "0.27.5", + "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.27.5.tgz", + "integrity": "sha512-x+fhKJtTg4ozXwKayh/ek4wxZQI/+2hmZUdO2i2NGDBRUflDble70z+ewHod3d4gRpXSO6fnlnjbDTnJk7HlkQ==", "dev": true, "requires": { + "@gerrit0/mini-shiki": "^1.24.0", "lunr": "^2.3.9", "markdown-it": "^14.1.0", - "minimatch": "^9.0.4", - "shiki": "^1.9.0", - "yaml": "^2.4.5" + "minimatch": "^9.0.5", + "yaml": "^2.6.1" }, "dependencies": { "brace-expansion": { @@ -12966,9 +13062,8 @@ } }, "typedoc-plugin-localization": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/typedoc-plugin-localization/-/typedoc-plugin-localization-3.0.5.tgz", - "integrity": "sha512-mvk0/DyjlFWcjxl2d0AsDeM6X8TjFE8FlbVyPDjY0mg54mHk9INp1rAbx9zZ5jtiLUVHrE8t9fb8FacmbmvqwA==", + "version": "file:..\\..\\..\\typedoc-plugin-localization-1.0.4.tgz", + "integrity": "sha512-ta81KJkrYoKM8e5oZ6a1eHPmMkKP7bBuYGcNvJMsoZEUccHmMHiQSFlXK5HFsPJEjW/YnRTfqQZZpaW44/JNJw==", "requires": { "fs-extra": "^11.2.0" }, @@ -13023,6 +13118,12 @@ "optional": true, "peer": true }, + "undici-types": { + "version": "6.19.8", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", + "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==", + "dev": true + }, "union-value": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", @@ -13730,9 +13831,9 @@ "dev": true }, "yaml": { - "version": "2.4.5", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.4.5.tgz", - "integrity": "sha512-aBx2bnqDzVOyNKfsysjA2ms5ZlnjSAW2eG3/L5G/CSujfjLJTJsEw1bGw8kCf04KodQWk1pxlGnZ56CRxiawmg==", + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.6.1.tgz", + "integrity": "sha512-7r0XPzioN/Q9kXBro/XPnA6kznR73DHq+GXh5ON7ZozRO6aMjbmiBuKste2wslTFkC5d1dw0GooOCepZXJ2SAg==", "dev": true }, "yargs": { diff --git a/package.json b/package.json index 87c2f16..527b308 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,7 @@ "author": "Infragistics", "license": "MIT", "main": "dist/index.js", + "type": "module", "files": [ "dist", "LICENSE" @@ -26,7 +27,7 @@ "devDependencies": { "@types/fs-extra": "^9.0.13", "@types/lunr": "^2.3.3", - "@types/node": "^18.11.0", + "@types/node": "^20.17.6", "@types/react": "^17.0.40", "autoprefixer": "^9.8.6", "clean-webpack-plugin": "^3.0.0", @@ -43,7 +44,7 @@ "sass-loader": "^10.1.0", "style-loader": "^3.3.1", "ts-loader": "^8.0.12", - "typedoc": "^0.26.2", + "typedoc": "^0.27.0", "typescript": "^5.5.2", "url-loader": "^4.1.1", "webpack": "^5.11.1", @@ -51,10 +52,10 @@ "webpack-merge": "^5.7.3" }, "peerDependencies": { - "typedoc": "^0.26.2", - "typedoc-plugin-localization": "^3.0.5" + "typedoc": "^0.27.0", + "typedoc-plugin-localization": "file:../../../typedoc-plugin-localization-1.0.4.tgz" }, "dependencies": { - "typedoc-plugin-localization": "^3.0.5" + "typedoc-plugin-localization": "file:../../../typedoc-plugin-localization-1.0.4.tgz" } } diff --git a/src/index.tsx b/src/index.tsx index f6a3abc..290d72d 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -1,15 +1,32 @@ -import { cpSync } from 'fs'; -import { resolve } from 'path'; -import { navigation } from './partials/navigation'; -import { index } from './partials/index'; -import { memberSources } from './partials/member.sources'; -import { memberDeclaration } from './partials/member.declarations'; -import { reflectionTemplate } from './templates/reflection'; -import { memberSignatureBody } from './partials/member.signature.body'; -import { breadcrumb } from './partials/breadcrumb'; +import { cpSync } from "fs"; +import path from "path"; +import { fileURLToPath } from "url"; + +import { navigation } from "./partials/navigation.js"; +import { index } from "./partials/index.js"; +import { memberSources } from "./partials/member.sources.js"; +import { memberDeclaration } from "./partials/member.declarations.js"; +import { reflectionTemplate } from "./templates/reflection.js"; +import { memberSignatureBody } from "./partials/member.signature.body.js"; +import { breadcrumb } from "./partials/breadcrumb.js"; + +import { + Application, + DefaultTheme, + DefaultThemeRenderContext, + JSX, + Options, + PageEvent, + Reflection, + RenderTemplate, + Renderer, + RendererEvent, +} from "typedoc"; +import { defaultLayout } from "./layouts/default.js"; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); -import { Application, DefaultTheme, DefaultThemeRenderContext, JSX, Options, PageEvent, Reflection, RenderTemplate, Renderer, RendererEvent } from "typedoc"; -import { defaultLayout } from "./layouts/default"; function bind(fn: (f: F, ...a: L) => R, first: F) { return (...r: L) => fn(first, ...r); @@ -28,12 +45,10 @@ export class IgThemeRenderContext extends DefaultThemeRenderContext { this.breadcrumb = bind(breadcrumb, this); this.defaultLayout = (template: RenderTemplate>, props: PageEvent) => { - return ( - defaultLayout(this, template, props) - ); - } + return defaultLayout(this, template, props); + }; } -}; +} export class IgTheme extends DefaultTheme { private _ctx?: IgThemeRenderContext; @@ -43,35 +58,31 @@ export class IgTheme extends DefaultTheme { } override getRenderContext(pageEvent: PageEvent): IgThemeRenderContext { - this._ctx ||= new IgThemeRenderContext( - this, - pageEvent, - this.application.options - ); + this._ctx ||= new IgThemeRenderContext(this, pageEvent, this.application.options); return this._ctx; } } export function load(app: Application) { app.renderer.hooks.on( - 'head.end', + "head.end", (context): JSX.Element => ( - + ) - ) + ); app.renderer.hooks.on( - 'body.end', + "body.end", (context): JSX.Element => ( -