bun-git-hooks 0.3.1 → 0.3.2

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.
package/dist/config.d.ts CHANGED
@@ -1,2 +1,4 @@
1
- // eslint-disable-next-line antfu/no-top-level-await
2
- export declare const config: GitHooksConfig;
1
+ import type { GitHooksConfig } from './types';
2
+ export declare function getConfig(): Promise<GitHooksConfig>;
3
+ // For backwards compatibility - synchronous access with default fallback
4
+ export declare const config: GitHooksConfig;
@@ -1,4 +1,4 @@
1
- import type { SetHooksFromConfigOptions } from './types';
1
+ import type { GitHooksConfig, SetHooksFromConfigOptions } from './types';
2
2
  /**
3
3
  * Recursively gets the .git folder path from provided directory
4
4
  */
@@ -15,14 +15,22 @@ export declare function checkBunGitHooksInDependencies(projectRootPath: string):
15
15
  * Checks if git hooks are already installed and up-to-date
16
16
  */
17
17
  export declare function areHooksInstalled(projectRootPath?: string): boolean;
18
+ /**
19
+ * Reads git-hooks config from package.json if present
20
+ */
21
+ export declare function getConfigFromPackageJson(projectPath: string): GitHooksConfig | undefined;
18
22
  /**
19
23
  * Parses the config and sets git hooks
20
24
  */
21
25
  export declare function setHooksFromConfig(projectRootPath?: string, options?: SetHooksFromConfigOptions): void;
26
+ /**
27
+ * Gets the list of staged files in the git repository
28
+ */
29
+ declare function getStagedFiles(projectRoot?: string): Promise<string[]>;
22
30
  /**
23
31
  * Deletes all git hooks
24
32
  */
25
- export declare function removeHooks(projectRoot?: string, verbose?: any): void;
33
+ export declare function removeHooks(projectRoot?: string, verbose?: boolean): void;
26
34
  export declare const VALID_GIT_HOOKS: readonly ['applypatch-msg', 'pre-applypatch', 'post-applypatch', 'pre-commit', 'pre-merge-commit', 'prepare-commit-msg', 'commit-msg', 'post-commit', 'pre-rebase', 'post-checkout', 'post-merge', 'pre-push', 'pre-receive', 'update', 'proc-receive', 'post-receive', 'post-update', 'reference-transaction', 'push-to-checkout', 'pre-auto-gc', 'post-rewrite', 'sendemail-validate', 'fsmonitor-watchman', 'p4-changelist', 'p4-prepare-changelist', 'p4-post-changelist', 'p4-pre-submit', 'post-index-change'];
27
35
  export declare const VALID_OPTIONS: readonly ['preserveUnused', 'verbose', 'staged-lint'];
28
36
  export declare const PREPEND_SCRIPT: `#!/bin/sh
@@ -37,4 +45,14 @@ if [ -f "$BUN_GIT_HOOKS_RC" ]; then
37
45
  fi
38
46
 
39
47
  `;
40
- export default gitHooks;
48
+ declare const gitHooks: {
49
+ PREPEND_SCRIPT: typeof PREPEND_SCRIPT
50
+ setHooksFromConfig: typeof setHooksFromConfig
51
+ removeHooks: typeof removeHooks
52
+ checkBunGitHooksInDependencies: typeof checkBunGitHooksInDependencies
53
+ getProjectRootDirectoryFromNodeModules: typeof getProjectRootDirectoryFromNodeModules
54
+ getGitProjectRoot: typeof getGitProjectRoot
55
+ getStagedFiles: typeof getStagedFiles
56
+ areHooksInstalled: typeof areHooksInstalled
57
+ };
58
+ export default gitHooks;
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  export * from './config';
2
2
  export * from './git-hooks';
3
3
  export * from './staged-lint';
4
- export * from './types';
4
+ export * from './types';