Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 22 additions & 2 deletions types/src/constants.d.mts
Original file line number Diff line number Diff line change
@@ -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<string>} */
/**
* Folders skipped at ANY depth β€” vendored / VCS directories that are never source and can
* legitimately nest (hoisted `node_modules`, submodule `.git`).
* @type {Set<string>}
*/
export const ALWAYS_IGNORE_FOLDERS: Set<string>;
/**
* 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<string>}
*/
export const ROOT_IGNORE_FOLDERS: Set<string>;
/**
* 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<string>}
*/
export const DEFAULT_IGNORE_FOLDERS: Set<string>;
export { DETECTOR_PROFILES, getAllowedExtensions, getEnabledDetectors } from "./detectors/index.mjs";
7 changes: 5 additions & 2 deletions types/src/core/file-discovery.d.mts
Original file line number Diff line number Diff line change
Expand Up @@ -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 `<projectRoot>/.gitignore`.
* @returns {Promise<string[]>} Absolute file paths.
*/
export function discoverFiles(options: {
Expand All @@ -19,4 +21,5 @@ export function discoverFiles(options: {
disabledDetectors?: string[];
includeFolders?: string[];
excludeFolders?: string[];
gitignore?: boolean | string | string[];
}): Promise<string[]>;
1 change: 1 addition & 0 deletions types/src/core/fix-headers.d.mts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export type FixHeadersOptions = {
includeFolders?: string[];
excludeFolders?: string[];
includeExtensions?: string[];
gitignore?: boolean | string | string[];
projectName?: string;
language?: string;
projectRoot?: string;
Expand Down
3 changes: 2 additions & 1 deletion types/src/detectors/index.d.mts
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, { linePrefix?: string, lineSeparator?: string, blockStart?: string, blockLinePrefix?: string, blockEnd?: string }> }} [options={}] - Runtime options.
* @param {{ language?: string, enabledDetectors?: string[], disabledDetectors?: string[], detectors?: DetectorProfile[], detectorSyntaxOverrides?: Record<string, { linePrefix?: string, lineSeparator?: string, blockStart?: string, blockLinePrefix?: string, blockEnd?: string }> }} [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<string, {
linePrefix?: string;
lineSeparator?: string;
Expand Down
Loading