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 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(info, typeDeclarations, fileContent, depth, cwd) {
66
- const idPath = displayPath(info.path, cwd);
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 = [processFile(info, typeDeclarations, content, depth, cwd)];
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
@@ -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
- return processWithCache(config, "lint", sourceText, async () => {
32
- const diagnostics = await lintFileForLint(eslint, sourceText, filePath);
33
- return {
34
- filePath: relative(cwd, filePath),
35
- diagnostics,
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
- return processWithCache(config, "validate", sourceText, async () => {
31
- const messages = await lintFileForValidation(eslint, sourceText, filePath);
32
- const status = mapToValidationStatus(messages);
33
- return { path: relativePath, status };
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jsdoczoom",
3
- "version": "0.4.18",
3
+ "version": "0.4.20",
4
4
  "description": "CLI tool for extracting JSDoc summaries at configurable depths",
5
5
  "type": "module",
6
6
  "sideEffects": false,
package/types/types.d.ts CHANGED
@@ -69,7 +69,6 @@ export interface ValidationResult {
69
69
  }
70
70
  /** Parsed summary and description from a file's JSDoc */
71
71
  export interface ParsedFileInfo {
72
- path: string;
73
72
  summary: string | null;
74
73
  description: string | null;
75
74
  summaryCount: number;