/** * Built-in ignore glob patterns for file scanning and watching. * * This module owns the pattern catalog and option toggles only. Each group is * compiled into {@link PathMatchPredicate} instances via {@link toPathMatcher}; * composition (`and`/`or`/`negate`) lives in {@link ./match}. * * Consumers: * - {@link ignorePatterns} - yields the enabled glob strings (for projen * prettier/gitignore). Pass `{ test: false }` there: the `test` group is for * filesystem scanning only (skip test dirs when discovering packages / * watching), not for VCS or formatter ignore files. * - {@link ignorePathMatcher} - returns a single {@link PathMatcher} for * {@link findFiles} and {@link watchFiles} (keeps `test: true` by default). * * @module */ import { type Sequence } from "@dbx-tools/shared-core"; import { PathMatcher } from "./match.ts"; /** Toggles for each built-in ignore group; omitted flags default to `true`. */ export type IgnorePatternOptions = { /** Build artifacts, dependency dirs, caches, logs, and OS junk files. */ defaults?: boolean; /** Hidden dot-files and dot-directories (`.git`, `.vscode`, `.gitignore`, etc.). */ dot?: boolean; /** Temporary directories (`tmp`, `.tmp`, `scratch`, etc.). */ temp?: boolean; /** * Test directories and `*.test.*` / `*.spec.*` naming conventions. * Scanning/watch default on; omit (`false`) when emitting `.gitignore` / * `.prettierignore` so tests stay tracked and formatable. */ test?: boolean; /** * Lockfile ignore group (`package-lock.json`, `pnpm-lock.yaml`, `yarn.lock`, * `bun.lockb`, etc.). * * - `true` - always ignore lockfiles. * - `false` - never ignore lockfiles. * - `"auto"` (default) - ignore when the active npm registry is not the public * npm registry (`registry.npmjs.org`), e.g. a company-internal registry. */ lock?: boolean | "auto"; }; /** * Yields the glob strings for each enabled built-in ignore group. * * Useful when a consumer needs literal patterns (e.g. projen `.gitignore` / * `.prettierignore`) rather than a compiled {@link PathMatcher}. For those * file emitters pass `{ test: false }` - the test group belongs to scanning * only ({@link ignorePathMatcher}), not VCS/formatter ignores. * * @param options - Group toggles; omitted flags default to enabled. */ export declare function ignorePatterns(options?: IgnorePatternOptions): Sequence; /** * Returns a {@link PathMatcher} for paths ignored by the enabled built-in groups. * * Matchers for each group are compiled once at module load; `options` only * selects which groups participate. The lock group is included when * {@link lockIgnoreMatchersEnabled} returns `true`. * * @param options - Group toggles; omitted flags default to enabled. */ export declare function ignorePathMatcher(options?: IgnorePatternOptions): PathMatcher;