jsdoczoom 0.4.18 → 0.4.20
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 +13 -4
- package/dist/jsdoc-parser.js +5 -2
- package/dist/lint.js +10 -7
- package/dist/validate.js +15 -5
- package/package.json +1 -1
- package/types/types.d.ts +0 -1
package/dist/drilldown.js
CHANGED
|
@@ -62,8 +62,15 @@ function sortKey(entry) {
|
|
|
62
62
|
* If the requested depth level is null (empty), advance to the next non-null level.
|
|
63
63
|
* Output contains next_id when more detail is available, or id at terminal level.
|
|
64
64
|
*/
|
|
65
|
-
function processFile(
|
|
66
|
-
|
|
65
|
+
function processFile(
|
|
66
|
+
filePath,
|
|
67
|
+
info,
|
|
68
|
+
typeDeclarations,
|
|
69
|
+
fileContent,
|
|
70
|
+
depth,
|
|
71
|
+
cwd,
|
|
72
|
+
) {
|
|
73
|
+
const idPath = displayPath(filePath, cwd);
|
|
67
74
|
const levels = buildLevels(info, typeDeclarations, fileContent);
|
|
68
75
|
// Clamp depth to [1, TERMINAL_LEVEL], advance past null levels
|
|
69
76
|
let effectiveDepth = Math.max(1, Math.min(depth, TERMINAL_LEVEL));
|
|
@@ -149,7 +156,7 @@ async function processFileSafe(filePath, depth, cwd, config) {
|
|
|
149
156
|
effectiveDepth,
|
|
150
157
|
config,
|
|
151
158
|
);
|
|
152
|
-
return processFile(info, typeDeclarations, content, depth, cwd);
|
|
159
|
+
return processFile(filePath, info, typeDeclarations, content, depth, cwd);
|
|
153
160
|
} catch (error) {
|
|
154
161
|
if (isParseError(error)) return makeParseErrorItem(filePath, error, cwd);
|
|
155
162
|
throw error;
|
|
@@ -371,7 +378,9 @@ export async function drilldown(
|
|
|
371
378
|
effectiveDepth,
|
|
372
379
|
config,
|
|
373
380
|
);
|
|
374
|
-
const items = [
|
|
381
|
+
const items = [
|
|
382
|
+
processFile(filePath, info, typeDeclarations, content, depth, cwd),
|
|
383
|
+
];
|
|
375
384
|
return { items, truncated: false };
|
|
376
385
|
}
|
|
377
386
|
// Glob selector — apply barrel gating
|
package/dist/jsdoc-parser.js
CHANGED
|
@@ -118,6 +118,11 @@ function getAllBlockComments(sourceText, start, end) {
|
|
|
118
118
|
pos++;
|
|
119
119
|
continue;
|
|
120
120
|
}
|
|
121
|
+
// Skip shebang line (e.g. #!/usr/bin/env node) — only valid at position 0
|
|
122
|
+
if (pos === 0 && sourceText[0] === "#" && sourceText[1] === "!") {
|
|
123
|
+
pos = findLineCommentEnd(sourceText, pos + 2);
|
|
124
|
+
continue;
|
|
125
|
+
}
|
|
121
126
|
const nextChar = sourceText[pos + 1];
|
|
122
127
|
if (sourceText[pos] !== "/" || pos + 1 >= end) break;
|
|
123
128
|
if (nextChar === "*") {
|
|
@@ -225,7 +230,6 @@ export function parseFileSummaries(filePath) {
|
|
|
225
230
|
const jsdocText = extractFileJsdoc(sourceText, filePath);
|
|
226
231
|
if (jsdocText === null) {
|
|
227
232
|
return {
|
|
228
|
-
path: filePath,
|
|
229
233
|
summary: null,
|
|
230
234
|
description: null,
|
|
231
235
|
summaryCount: 0,
|
|
@@ -234,7 +238,6 @@ export function parseFileSummaries(filePath) {
|
|
|
234
238
|
}
|
|
235
239
|
const { summary, description, summaryCount } = parseJsdocContent(jsdocText);
|
|
236
240
|
return {
|
|
237
|
-
path: filePath,
|
|
238
241
|
summary,
|
|
239
242
|
description,
|
|
240
243
|
summaryCount,
|
package/dist/lint.js
CHANGED
|
@@ -28,13 +28,16 @@ import { DEFAULT_CACHE_DIR } from "./types.js";
|
|
|
28
28
|
*/
|
|
29
29
|
async function lintSingleFile(eslint, filePath, cwd, config) {
|
|
30
30
|
const sourceText = await readFile(filePath, "utf-8");
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
31
|
+
const { diagnostics } = await processWithCache(
|
|
32
|
+
config,
|
|
33
|
+
"lint",
|
|
34
|
+
sourceText,
|
|
35
|
+
async () => {
|
|
36
|
+
const diagnostics = await lintFileForLint(eslint, sourceText, filePath);
|
|
37
|
+
return { diagnostics };
|
|
38
|
+
},
|
|
39
|
+
);
|
|
40
|
+
return { filePath: relative(cwd, filePath), diagnostics };
|
|
38
41
|
}
|
|
39
42
|
/**
|
|
40
43
|
* Build a LintResult from per-file results, applying a limit to files with issues.
|
package/dist/validate.js
CHANGED
|
@@ -27,11 +27,21 @@ async function classifyFile(eslint, filePath, cwd, config) {
|
|
|
27
27
|
} catch {
|
|
28
28
|
throw new JsdocError("FILE_NOT_FOUND", `File not found: ${filePath}`);
|
|
29
29
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
30
|
+
const { status } = await processWithCache(
|
|
31
|
+
config,
|
|
32
|
+
"validate",
|
|
33
|
+
sourceText,
|
|
34
|
+
async () => {
|
|
35
|
+
const messages = await lintFileForValidation(
|
|
36
|
+
eslint,
|
|
37
|
+
sourceText,
|
|
38
|
+
filePath,
|
|
39
|
+
);
|
|
40
|
+
const status = mapToValidationStatus(messages);
|
|
41
|
+
return { status };
|
|
42
|
+
},
|
|
43
|
+
);
|
|
44
|
+
return { path: relativePath, status };
|
|
35
45
|
}
|
|
36
46
|
/**
|
|
37
47
|
* Group file statuses into a ValidationResult, applying a limit
|
package/package.json
CHANGED
package/types/types.d.ts
CHANGED