jsdoczoom 1.2.2 → 1.2.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.
- package/dist/drilldown.js +23 -5
- package/package.json +1 -1
- package/types/debug.d.ts +10 -10
package/dist/drilldown.js
CHANGED
|
@@ -6,7 +6,10 @@ import { debugDrilldown } from "./debug.js";
|
|
|
6
6
|
import { JsdocError } from "./errors.js";
|
|
7
7
|
import { discoverFiles, loadGitignore } from "./file-discovery.js";
|
|
8
8
|
import { parseFileSummaries } from "./jsdoc-parser.js";
|
|
9
|
-
import {
|
|
9
|
+
import {
|
|
10
|
+
generateTypeDeclarations,
|
|
11
|
+
splitDeclarations,
|
|
12
|
+
} from "./type-declarations.js";
|
|
10
13
|
import { DEFAULT_CACHE_DIR } from "./types.js";
|
|
11
14
|
|
|
12
15
|
/** Terminal level (1-indexed): 1=summary, 2=description, 3=type declarations, 4=full file. */
|
|
@@ -28,16 +31,31 @@ const DEFAULT_CACHE_CONFIG = {
|
|
|
28
31
|
* Type declarations and file content are pre-computed and passed in to support
|
|
29
32
|
* async cache integration.
|
|
30
33
|
*/
|
|
34
|
+
/**
|
|
35
|
+
* Build the text for level 3 (type declarations).
|
|
36
|
+
* Description is rendered as plain markdown prose; declaration blocks
|
|
37
|
+
* (those starting with a `// L` annotation) are each wrapped in a
|
|
38
|
+
* typescript code fence. The module-level chunk (JSDoc + imports) is dropped.
|
|
39
|
+
*/
|
|
40
|
+
function buildLevel3Text(description, typeDeclarations) {
|
|
41
|
+
const parts = [];
|
|
42
|
+
if (description !== null) parts.push(description);
|
|
43
|
+
if (typeDeclarations.length > 0) {
|
|
44
|
+
const fenced = splitDeclarations(typeDeclarations)
|
|
45
|
+
.filter((chunk) => chunk.startsWith("// L"))
|
|
46
|
+
.map((chunk) => `\`\`\`typescript\n${chunk}\n\`\`\``)
|
|
47
|
+
.join("\n\n");
|
|
48
|
+
if (fenced) parts.push(fenced);
|
|
49
|
+
}
|
|
50
|
+
return parts.join("\n\n");
|
|
51
|
+
}
|
|
31
52
|
function buildLevels(info, typeDeclarations, fileContent) {
|
|
32
53
|
const { summary, description } = info;
|
|
33
54
|
return [
|
|
34
55
|
summary !== null ? { text: summary } : null,
|
|
35
56
|
description !== null ? { text: description } : null,
|
|
36
57
|
{
|
|
37
|
-
text:
|
|
38
|
-
typeDeclarations.length > 0
|
|
39
|
-
? `\`\`\`typescript\n${typeDeclarations}\n\`\`\``
|
|
40
|
-
: typeDeclarations,
|
|
58
|
+
text: buildLevel3Text(description, typeDeclarations),
|
|
41
59
|
},
|
|
42
60
|
{ text: `\`\`\`typescript\n${fileContent}\n\`\`\`` },
|
|
43
61
|
];
|
package/package.json
CHANGED
package/types/debug.d.ts
CHANGED
|
@@ -8,17 +8,17 @@
|
|
|
8
8
|
*
|
|
9
9
|
* @summary Namespaced debug loggers and perf_hooks timing helper
|
|
10
10
|
*/
|
|
11
|
-
import createDebug from "debug";
|
|
12
11
|
import type { Debugger } from "debug";
|
|
13
|
-
|
|
14
|
-
export declare const
|
|
15
|
-
export declare const
|
|
16
|
-
export declare const
|
|
17
|
-
export declare const
|
|
18
|
-
export declare const
|
|
19
|
-
export declare const
|
|
20
|
-
export declare const
|
|
21
|
-
export declare const
|
|
12
|
+
import createDebug from "debug";
|
|
13
|
+
export declare const debugDiscovery: Debugger;
|
|
14
|
+
export declare const debugSearch: Debugger;
|
|
15
|
+
export declare const debugCache: Debugger;
|
|
16
|
+
export declare const debugEslint: Debugger;
|
|
17
|
+
export declare const debugLint: Debugger;
|
|
18
|
+
export declare const debugValidate: Debugger;
|
|
19
|
+
export declare const debugBarrel: Debugger;
|
|
20
|
+
export declare const debugDrilldown: Debugger;
|
|
21
|
+
export declare const debugTs: Debugger;
|
|
22
22
|
export { createDebug };
|
|
23
23
|
/** Record a cache hit without emitting a log line. */
|
|
24
24
|
export declare function recordCacheHit(): void;
|