typedoc 0.24.2 → 0.24.3

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.
@@ -373,6 +373,9 @@ let Application = Application_1 = class Application extends component_1.Childabl
373
373
  _merge() {
374
374
  const start = Date.now();
375
375
  const rootDir = (0, fs_1.deriveRootDir)(this.entryPoints);
376
+ this.logger.verbose(`Derived root dir is ${rootDir}, will expand ${this.entryPoints
377
+ .map(index_2.normalizePath)
378
+ .join(", ")}`);
376
379
  const entryPoints = this.entryPoints.flatMap((entry) => (0, fs_1.glob)(entry, rootDir));
377
380
  this.logger.verbose(`Merging entry points:\n\t${entryPoints.map(paths_1.nicePath).join("\n\t")}`);
378
381
  if (entryPoints.length < 1) {
@@ -10,6 +10,7 @@ const typescript_1 = __importDefault(require("typescript"));
10
10
  const fs_2 = require("../../utils/fs");
11
11
  const tsutils_1 = require("../../utils/tsutils");
12
12
  const validation_1 = require("../../utils/validation");
13
+ const paths_1 = require("../../utils/paths");
13
14
  /**
14
15
  * This exists so that TypeDoc can store a unique identifier for a `ts.Symbol` without
15
16
  * keeping a reference to the `ts.Symbol` itself. This identifier should be stable across
@@ -19,7 +20,7 @@ class ReflectionSymbolId {
19
20
  constructor(symbol, declaration) {
20
21
  if ("name" in symbol) {
21
22
  declaration ?? (declaration = symbol?.declarations?.[0]);
22
- this.fileName = declaration?.getSourceFile().fileName ?? "\0";
23
+ this.fileName = (0, paths_1.normalizePath)(declaration?.getSourceFile().fileName ?? "\0");
23
24
  if (symbol.declarations?.some(typescript_1.default.isSourceFile)) {
24
25
  this.qualifiedName = "";
25
26
  }
@@ -45,7 +46,7 @@ class ReflectionSymbolId {
45
46
  toObject(serializer) {
46
47
  return {
47
48
  sourceFileName: (0, path_1.isAbsolute)(this.fileName)
48
- ? (0, path_1.relative)(serializer.projectRoot, resolveDeclarationMaps(this.fileName))
49
+ ? (0, paths_1.normalizePath)((0, path_1.relative)(serializer.projectRoot, resolveDeclarationMaps(this.fileName)))
49
50
  : this.fileName,
50
51
  qualifiedName: this.qualifiedName,
51
52
  };
@@ -50,11 +50,17 @@ function isDir(path) {
50
50
  }
51
51
  exports.isDir = isDir;
52
52
  function deriveRootDir(globPaths) {
53
- const globs = (0, paths_1.createMinimatch)(globPaths);
54
- const rootPaths = globs.flatMap((glob) => (0, array_1.filterMap)(glob.set, (set) => {
53
+ const normalized = globPaths.map(paths_1.normalizePath);
54
+ const globs = (0, paths_1.createMinimatch)(normalized);
55
+ const rootPaths = globs.flatMap((glob, i) => (0, array_1.filterMap)(glob.set, (set) => {
55
56
  const stop = set.findIndex((part) => typeof part !== "string");
56
- const path = stop === -1 ? set : set.slice(0, stop);
57
- return `/${path.join("/").replace(/^\//, "")}`;
57
+ if (stop === -1) {
58
+ return normalized[i];
59
+ }
60
+ else {
61
+ const kept = set.slice(0, stop).join("/");
62
+ return normalized[i].substring(0, normalized[i].indexOf(kept) + kept.length);
63
+ }
58
64
  }));
59
65
  return getCommonDirectory(rootPaths);
60
66
  }
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.24.2",
4
+ "version": "0.24.3",
5
5
  "homepage": "https://typedoc.org",
6
6
  "exports": {
7
7
  ".": "./dist/index.js",