bun-git-hooks 0.2.14 → 0.2.16

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.
@@ -1,4 +1,4 @@
1
- import type { SetHooksFromConfigOptions, StagedLintConfig } from './types';
1
+ import type { GitHooksConfig, SetHooksFromConfigOptions, StagedLintConfig } from './types';
2
2
 
3
3
  declare const execAsync: unknown;
4
4
  export declare const VALID_GIT_HOOKS: Array<
@@ -33,20 +33,23 @@ export declare const VALID_GIT_HOOKS: Array<
33
33
  >;
34
34
  export declare const VALID_OPTIONS: Array<'preserveUnused' | 'verbose' | 'staged-lint'>;
35
35
  export declare const PREPEND_SCRIPT: unknown;
36
- export declare function getGitProjectRoot(directory: string): string | undefined;
36
+ export declare function getGitProjectRoot(directory?: string): string | undefined;
37
37
  export declare function checkBunGitHooksInDependencies(projectRootPath: string): boolean;
38
- declare function _getPackageJson(projectPath): void;
39
- export declare function setHooksFromConfig(projectRootPath: string, options?: SetHooksFromConfigOptions): void;
40
- declare function getStagedFiles(projectRoot: string): Promise<string[]>;
38
+ declare function _getPackageJson(projectPath?: any): void;
39
+ export declare function setHooksFromConfig(projectRootPath?: string, options?: SetHooksFromConfigOptions): void;
40
+ declare function getStagedFiles(projectRoot?: string): Promise<string[]>;
41
+ declare function expandBracePattern(pattern: string): string[];
42
+ declare const results: string[];
41
43
  declare function matchesGlob(file: string, pattern: string): boolean;
42
44
  declare function filterFilesByPattern(files: string[], pattern: string): string[];
43
- declare function runCommandOnStagedFiles(command: string | string[], files: string[], projectRoot: string, verbose): Promise<boolean>;
44
- declare function processStagedLint(stagedLintConfig: StagedLintConfig, projectRoot: string, verbose): Promise<boolean>;
45
- declare function _setHook(hook: string, commandOrConfig: string | { stagedLint?: StagedLintConfig; 'staged-lint'?: StagedLintConfig }, projectRoot: string): void;
46
- export declare function removeHooks(projectRoot: string, verbose): void;
47
- declare function _removeHook(hook: string, projectRoot, verbose): void;
45
+ declare function runCommandOnStagedFiles(command: string | string[], files: string[], projectRoot?: string, verbose?: boolean): Promise<boolean>;
46
+ declare function processStagedLint(stagedLintConfig: StagedLintConfig, projectRoot: string, verbose?: boolean): Promise<boolean>;
47
+ declare function _setHook(hook: string, commandOrConfig: string | { stagedLint?: StagedLintConfig; 'staged-lint'?: StagedLintConfig }, projectRoot: string = process.cwd()): void;
48
+ export declare function removeHooks(projectRoot?: string, verbose?: boolean): void;
49
+ declare function _removeHook(hook: string, projectRoot?: any, verbose?: boolean): void;
48
50
  export declare function runStagedLint(hook: string): Promise<boolean>;
49
51
  declare function _validateHooks(config: Record<string, any>): boolean;
52
+ declare function _validateStagedLintConfig(config: GitHooksConfig): void;
50
53
  declare const gitHooks: {
51
54
  PREPEND_SCRIPT: typeof PREPEND_SCRIPT
52
55
  setHooksFromConfig: typeof setHooksFromConfig