bun-git-hooks 0.2.13 → 0.2.15

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<
@@ -31,7 +31,7 @@ export declare const VALID_GIT_HOOKS: Array<
31
31
  'p4-pre-submit' |
32
32
  'post-index-change'
33
33
  >;
34
- export declare const VALID_OPTIONS: Array<'preserveUnused'>;
34
+ export declare const VALID_OPTIONS: Array<'preserveUnused' | 'verbose' | 'staged-lint'>;
35
35
  export declare const PREPEND_SCRIPT: unknown;
36
36
  export declare function getGitProjectRoot(directory: string): string | undefined;
37
37
  export declare function checkBunGitHooksInDependencies(projectRootPath: string): boolean;
@@ -42,11 +42,12 @@ declare function matchesGlob(file: string, pattern: string): boolean;
42
42
  declare function filterFilesByPattern(files: string[], pattern: string): string[];
43
43
  declare function runCommandOnStagedFiles(command: string | string[], files: string[], projectRoot: string, verbose): Promise<boolean>;
44
44
  declare function processStagedLint(stagedLintConfig: StagedLintConfig, projectRoot: string, verbose): Promise<boolean>;
45
- declare function _setHook(hook: string, commandOrConfig: string | { stagedLint?: StagedLintConfig }, projectRoot: string): void;
45
+ declare function _setHook(hook: string, commandOrConfig: string | { stagedLint?: StagedLintConfig; 'staged-lint'?: StagedLintConfig }, projectRoot: string): void;
46
46
  export declare function removeHooks(projectRoot: string, verbose): void;
47
47
  declare function _removeHook(hook: string, projectRoot, verbose): void;
48
48
  export declare function runStagedLint(hook: string): Promise<boolean>;
49
49
  declare function _validateHooks(config: Record<string, any>): boolean;
50
+ declare function _validateStagedLintConfig(config: GitHooksConfig): void;
50
51
  declare const gitHooks: {
51
52
  PREPEND_SCRIPT: typeof PREPEND_SCRIPT
52
53
  setHooksFromConfig: typeof setHooksFromConfig
@@ -5,10 +5,14 @@ export interface StagedLintConfig {
5
5
  }
6
6
 
7
7
  export type GitHooksConfig = {
8
- [K in typeof VALID_GIT_HOOKS[number]]?: string | { stagedLint?: StagedLintConfig }
8
+ [K in typeof VALID_GIT_HOOKS[number]]?: string | {
9
+ 'stagedLint'?: StagedLintConfig
10
+ 'staged-lint'?: StagedLintConfig
11
+ }
9
12
  } & {
10
- preserveUnused?: boolean | typeof VALID_GIT_HOOKS[number][]
11
- verbose?: boolean
13
+ 'preserveUnused'?: boolean | typeof VALID_GIT_HOOKS[number][]
14
+ 'verbose'?: boolean
15
+ 'staged-lint'?: StagedLintConfig
12
16
  }
13
17
 
14
18
  export interface SetHooksFromConfigOptions {
@@ -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<
@@ -31,7 +31,7 @@ export declare const VALID_GIT_HOOKS: Array<
31
31
  'p4-pre-submit' |
32
32
  'post-index-change'
33
33
  >;
34
- export declare const VALID_OPTIONS: Array<'preserveUnused'>;
34
+ export declare const VALID_OPTIONS: Array<'preserveUnused' | 'verbose' | 'staged-lint'>;
35
35
  export declare const PREPEND_SCRIPT: unknown;
36
36
  export declare function getGitProjectRoot(directory: string): string | undefined;
37
37
  export declare function checkBunGitHooksInDependencies(projectRootPath: string): boolean;
@@ -42,11 +42,12 @@ declare function matchesGlob(file: string, pattern: string): boolean;
42
42
  declare function filterFilesByPattern(files: string[], pattern: string): string[];
43
43
  declare function runCommandOnStagedFiles(command: string | string[], files: string[], projectRoot: string, verbose): Promise<boolean>;
44
44
  declare function processStagedLint(stagedLintConfig: StagedLintConfig, projectRoot: string, verbose): Promise<boolean>;
45
- declare function _setHook(hook: string, commandOrConfig: string | { stagedLint?: StagedLintConfig }, projectRoot: string): void;
45
+ declare function _setHook(hook: string, commandOrConfig: string | { stagedLint?: StagedLintConfig; 'staged-lint'?: StagedLintConfig }, projectRoot: string): void;
46
46
  export declare function removeHooks(projectRoot: string, verbose): void;
47
47
  declare function _removeHook(hook: string, projectRoot, verbose): void;
48
48
  export declare function runStagedLint(hook: string): Promise<boolean>;
49
49
  declare function _validateHooks(config: Record<string, any>): boolean;
50
+ declare function _validateStagedLintConfig(config: GitHooksConfig): void;
50
51
  declare const gitHooks: {
51
52
  PREPEND_SCRIPT: typeof PREPEND_SCRIPT
52
53
  setHooksFromConfig: typeof setHooksFromConfig