From 664987f69de581cfece157742e16b5050b6ee8b9 Mon Sep 17 00:00:00 2001 From: Shinrai Date: Sat, 8 Aug 2026 22:59:07 -0700 Subject: [PATCH] chore(types): regenerate stale declarations for .gitignore support (v1.3.0) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The .gitignore/root-anchor-ignores feature (74c34da) landed on next without its generated TypeScript declarations, leaving types/src/constants.d.mts, types/src/core/file-discovery.d.mts, types/src/core/fix-headers.d.mts, and types/src/detectors/index.d.mts out of sync with the JSDoc source — missing the gitignore option, the ALWAYS_IGNORE_FOLDERS/ROOT_IGNORE_FOLDERS split, and the detectors override param. Regenerated via npm run types:build. --- types/src/constants.d.mts | 24 ++++++++++++++++++++++-- types/src/core/file-discovery.d.mts | 7 +++++-- types/src/core/fix-headers.d.mts | 1 + types/src/detectors/index.d.mts | 3 ++- 4 files changed, 30 insertions(+), 5 deletions(-) diff --git a/types/src/constants.d.mts b/types/src/constants.d.mts index 3c8b3e9..c39eb54 100644 --- a/types/src/constants.d.mts +++ b/types/src/constants.d.mts @@ -1,7 +1,27 @@ /** @type {string} */ export const DEFAULT_COMPANY_NAME: string; -/** @type {number} */ +/** Header must sit near the top of the file, but a metadata block can legitimately + * run long; cap the scan generously so a long block's closing `*​/` is still seen. + * @type {number} */ export const DEFAULT_MAX_HEADER_SCAN_LINES: number; -/** @type {Set} */ +/** + * Folders skipped at ANY depth — vendored / VCS directories that are never source and can + * legitimately nest (hoisted `node_modules`, submodule `.git`). + * @type {Set} + */ +export const ALWAYS_IGNORE_FOLDERS: Set; +/** + * Folders skipped ONLY at the project root — build / cache output directories. Anchored to + * the root so a nested SOURCE directory that happens to share the name (e.g. `tools/build`, + * `packages/x/dist`-style source) is still processed; only the top-level `/build`, `/dist`, + * `/coverage`, … are ignored. + * @type {Set} + */ +export const ROOT_IGNORE_FOLDERS: Set; +/** + * Backward-compatible union of {@link ALWAYS_IGNORE_FOLDERS} and {@link ROOT_IGNORE_FOLDERS}. + * Discovery applies the two sets with different scoping; prefer the specific sets. + * @type {Set} + */ export const DEFAULT_IGNORE_FOLDERS: Set; export { DETECTOR_PROFILES, getAllowedExtensions, getEnabledDetectors } from "./detectors/index.mjs"; diff --git a/types/src/core/file-discovery.d.mts b/types/src/core/file-discovery.d.mts index db289cb..b364b62 100644 --- a/types/src/core/file-discovery.d.mts +++ b/types/src/core/file-discovery.d.mts @@ -7,8 +7,10 @@ * enabledDetectors?: string[], * disabledDetectors?: string[], * includeFolders?: string[], - * excludeFolders?: string[] - * }} options - File discovery options. + * excludeFolders?: string[], + * gitignore?: boolean | string | string[] + * }} options - File discovery options. `gitignore`: `false` disables; a path or array of + * paths loads those ignore files; anything else / omitted auto-detects `/.gitignore`. * @returns {Promise} Absolute file paths. */ export function discoverFiles(options: { @@ -19,4 +21,5 @@ export function discoverFiles(options: { disabledDetectors?: string[]; includeFolders?: string[]; excludeFolders?: string[]; + gitignore?: boolean | string | string[]; }): Promise; diff --git a/types/src/core/fix-headers.d.mts b/types/src/core/fix-headers.d.mts index bd3fc93..0351b7a 100644 --- a/types/src/core/fix-headers.d.mts +++ b/types/src/core/fix-headers.d.mts @@ -28,6 +28,7 @@ export type FixHeadersOptions = { includeFolders?: string[]; excludeFolders?: string[]; includeExtensions?: string[]; + gitignore?: boolean | string | string[]; projectName?: string; language?: string; projectRoot?: string; diff --git a/types/src/detectors/index.d.mts b/types/src/detectors/index.d.mts index 3a932d7..d8aa5d9 100644 --- a/types/src/detectors/index.d.mts +++ b/types/src/detectors/index.d.mts @@ -26,13 +26,14 @@ export function getDetectorById(id: string): (typeof DETECTOR_PROFILES)[number] /** * Resolves comment syntax for a file path using detector-specific templates. * @param {string} filePath - File path. - * @param {{ language?: string, enabledDetectors?: string[], disabledDetectors?: string[], detectorSyntaxOverrides?: Record }} [options={}] - Runtime options. + * @param {{ language?: string, enabledDetectors?: string[], disabledDetectors?: string[], detectors?: DetectorProfile[], detectorSyntaxOverrides?: Record }} [options={}] - Runtime options. `detectors` overrides the enabled-detector set (matching {@link detectProjectFromMarkers}). * @returns {{kind: "block" | "line" | "html", linePrefix?: string, lineSeparator?: string, blockStart?: string, blockLinePrefix?: string, blockEnd?: string}} Syntax descriptor. */ export function getCommentSyntaxForFile(filePath: string, options?: { language?: string; enabledDetectors?: string[]; disabledDetectors?: string[]; + detectors?: DetectorProfile[]; detectorSyntaxOverrides?: Record