jsdoczoom 0.4.17 → 0.4.19
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/cli.js +1 -0
- package/dist/drilldown.js +13 -4
- package/dist/jsdoc-parser.js +0 -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/cli.js
CHANGED
|
@@ -421,6 +421,7 @@ function writeValidationResult(result, pretty) {
|
|
|
421
421
|
* Write lint result to stdout and set exit code 2 if issues found.
|
|
422
422
|
*/
|
|
423
423
|
function writeLintResult(result, pretty) {
|
|
424
|
+
if (result.summary.filesWithIssues === 0) return;
|
|
424
425
|
writeResult(result, pretty);
|
|
425
426
|
if (result.summary.filesWithIssues > 0) {
|
|
426
427
|
process.exitCode = 2;
|
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
|
@@ -225,7 +225,6 @@ export function parseFileSummaries(filePath) {
|
|
|
225
225
|
const jsdocText = extractFileJsdoc(sourceText, filePath);
|
|
226
226
|
if (jsdocText === null) {
|
|
227
227
|
return {
|
|
228
|
-
path: filePath,
|
|
229
228
|
summary: null,
|
|
230
229
|
description: null,
|
|
231
230
|
summaryCount: 0,
|
|
@@ -234,7 +233,6 @@ export function parseFileSummaries(filePath) {
|
|
|
234
233
|
}
|
|
235
234
|
const { summary, description, summaryCount } = parseJsdocContent(jsdocText);
|
|
236
235
|
return {
|
|
237
|
-
path: filePath,
|
|
238
236
|
summary,
|
|
239
237
|
description,
|
|
240
238
|
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