typedoc 0.26.9 → 0.26.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,27 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
2
25
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
26
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
27
  };
@@ -12,7 +35,7 @@ const models_1 = require("../../models");
12
35
  const utils_1 = require("../../utils");
13
36
  const declaration_1 = require("../../utils/options/declaration");
14
37
  const paths_1 = require("../../utils/paths");
15
- const assert_1 = require("assert");
38
+ const assert_1 = __importStar(require("assert"));
16
39
  const array_1 = require("../../utils/array");
17
40
  const variablePropertyKinds = [
18
41
  typescript_1.default.SyntaxKind.PropertyDeclaration,
@@ -375,11 +398,30 @@ function declarationToCommentNodes(node, checker) {
375
398
  inheritedFromParentDeclaration: false,
376
399
  },
377
400
  ];
401
+ let overloadIndex = undefined;
402
+ if (typescript_1.default.isMethodDeclaration(node)) {
403
+ const symbol = checker.getSymbolAtLocation(node.name || node);
404
+ if (symbol) {
405
+ overloadIndex = symbol.declarations
406
+ ?.filter((d) => d.kind === node.kind)
407
+ .indexOf(node);
408
+ (0, assert_1.default)(overloadIndex !== -1, "Should always find declaration");
409
+ }
410
+ }
378
411
  const seenSymbols = new Set();
379
412
  const bases = findBaseOfDeclaration(checker, node, (symbol) => {
380
413
  if (!seenSymbols.has(symbol)) {
381
414
  seenSymbols.add(symbol);
382
- return symbol.declarations?.map((node) => declarationToCommentNodeIgnoringParents(node) || node);
415
+ if (overloadIndex === undefined) {
416
+ return symbol.declarations?.map((node) => declarationToCommentNodeIgnoringParents(node) || node);
417
+ }
418
+ else if (symbol.declarations?.[overloadIndex]) {
419
+ const parentSigNode = symbol.declarations[overloadIndex];
420
+ return [
421
+ declarationToCommentNodeIgnoringParents(parentSigNode) ||
422
+ parentSigNode,
423
+ ];
424
+ }
383
425
  }
384
426
  });
385
427
  for (const parentCommentNode of bases || []) {
@@ -3,6 +3,27 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.defaultLayout = void 0;
4
4
  const utils_1 = require("../../../../utils");
5
5
  const lib_1 = require("../../lib");
6
+ // See #2760
7
+ function buildSiteMetadata(context) {
8
+ try {
9
+ // We have to know where we are hosted in order to generate this block
10
+ const url = new URL(context.options.getValue("hostedBaseUrl"));
11
+ // No point in generating this if we aren't the root page on the site
12
+ if (url.pathname !== "/") {
13
+ return null;
14
+ }
15
+ return (utils_1.JSX.createElement("script", { type: "application/ld+json" },
16
+ utils_1.JSX.createElement(utils_1.Raw, { html: JSON.stringify({
17
+ "@context": "https://schema.org",
18
+ "@type": "WebSite",
19
+ name: context.page.project.name,
20
+ url: url.toString(),
21
+ }) })));
22
+ }
23
+ catch {
24
+ return null;
25
+ }
26
+ }
6
27
  const defaultLayout = (context, template, props) => (utils_1.JSX.createElement("html", { class: "default", lang: context.options.getValue("lang") },
7
28
  utils_1.JSX.createElement("head", null,
8
29
  utils_1.JSX.createElement("meta", { charset: "utf-8" }),
@@ -11,6 +32,7 @@ const defaultLayout = (context, template, props) => (utils_1.JSX.createElement("
11
32
  utils_1.JSX.createElement("title", null, props.model.isProject()
12
33
  ? (0, lib_1.getDisplayName)(props.model)
13
34
  : `${(0, lib_1.getDisplayName)(props.model)} | ${(0, lib_1.getDisplayName)(props.project)}`),
35
+ props.url === "index.html" && buildSiteMetadata(context),
14
36
  utils_1.JSX.createElement("meta", { name: "description", content: "Documentation for " + props.project.name }),
15
37
  utils_1.JSX.createElement("meta", { name: "viewport", content: "width=device-width, initial-scale=1" }),
16
38
  utils_1.JSX.createElement("link", { rel: "stylesheet", href: context.relativeURL("assets/style.css", true) }),
@@ -26,7 +26,7 @@ const header = (context, props) => {
26
26
  }
27
27
  else {
28
28
  renderTitle = true;
29
- titleKindString = " " + context.internationalization.kindSingularString(props.model.kind);
29
+ titleKindString = context.internationalization.kindSingularString(props.model.kind) + " ";
30
30
  }
31
31
  return (utils_1.JSX.createElement("div", { class: "tsd-page-title" },
32
32
  renderBreadcrumbs && utils_1.JSX.createElement("ul", { class: "tsd-breadcrumb" }, context.breadcrumb(props.model)),
@@ -6,7 +6,7 @@ export declare class DefaultMap<K, V> extends Map<K, V> {
6
6
  }
7
7
  export declare class StableKeyMap<K extends {
8
8
  getStableKey(): string;
9
- }, V> implements Map<K, V> {
9
+ }, V> {
10
10
  [Symbol.toStringTag]: string;
11
11
  private impl;
12
12
  get size(): number;
@@ -90,21 +90,10 @@ class TypeDocReader {
90
90
  }
91
91
  else {
92
92
  try {
93
- try {
94
- // eslint-disable-next-line @typescript-eslint/no-require-imports
95
- fileContent = await require(file);
96
- }
97
- catch (error) {
98
- if (error?.code === "ERR_REQUIRE_ESM") {
99
- // On Windows, we need to ensure this path is a file path.
100
- // Or we'll get ERR_UNSUPPORTED_ESM_URL_SCHEME
101
- const esmPath = (0, url_1.pathToFileURL)(file).toString();
102
- fileContent = await (await import(esmPath)).default;
103
- }
104
- else {
105
- throw error;
106
- }
107
- }
93
+ // On Windows, we need to ensure this path is a file path.
94
+ // Or we'll get ERR_UNSUPPORTED_ESM_URL_SCHEME
95
+ const esmPath = (0, url_1.pathToFileURL)(file).toString();
96
+ fileContent = await (await import(esmPath)).default;
108
97
  }
109
98
  catch (error) {
110
99
  logger.error(logger.i18n.failed_read_options_file_0((0, paths_1.nicePath)(file)));
@@ -9,18 +9,20 @@ async function loadPlugins(app, plugins) {
9
9
  const pluginDisplay = getPluginDisplayName(plugin);
10
10
  try {
11
11
  let instance;
12
+ // Try importing first to avoid warnings about requiring ESM being experimental.
13
+ // If that fails due to importing a directory, fall back to require.
12
14
  try {
13
- // eslint-disable-next-line @typescript-eslint/no-require-imports
14
- instance = require(plugin);
15
+ // On Windows, we need to ensure this path is a file path.
16
+ // Or we'll get ERR_UNSUPPORTED_ESM_URL_SCHEME
17
+ const esmPath = (0, path_1.isAbsolute)(plugin)
18
+ ? (0, url_1.pathToFileURL)(plugin).toString()
19
+ : plugin;
20
+ instance = await import(esmPath);
15
21
  }
16
22
  catch (error) {
17
- if (error.code === "ERR_REQUIRE_ESM") {
18
- // On Windows, we need to ensure this path is a file path.
19
- // Or we'll get ERR_UNSUPPORTED_ESM_URL_SCHEME
20
- const esmPath = (0, path_1.isAbsolute)(plugin)
21
- ? (0, url_1.pathToFileURL)(plugin).toString()
22
- : plugin;
23
- instance = await import(esmPath);
23
+ if (error.code === "ERR_UNSUPPORTED_DIR_IMPORT") {
24
+ // eslint-disable-next-line @typescript-eslint/no-require-imports
25
+ instance = require(plugin);
24
26
  }
25
27
  else {
26
28
  throw error;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "typedoc",
3
3
  "description": "Create api documentation for TypeScript projects.",
4
- "version": "0.26.9",
4
+ "version": "0.26.11",
5
5
  "homepage": "https://typedoc.org",
6
6
  "exports": {
7
7
  ".": "./dist/index.js",
@@ -46,7 +46,7 @@
46
46
  "prettier": "3.3.3",
47
47
  "puppeteer": "^23.3.0",
48
48
  "ts-node": "^10.9.2",
49
- "typescript": "5.6.1-rc",
49
+ "typescript": "5.6.3",
50
50
  "typescript-eslint": "^8.4.0"
51
51
  },
52
52
  "files": [