bun-git-hooks 0.2.18 → 0.3.0
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/bin/cli.js +4561 -2440
- package/dist/config.d.ts +1 -2
- package/dist/git-hooks.d.ts +35 -59
- package/dist/index.d.ts +4 -3
- package/dist/index.js +2317 -301
- package/dist/staged-lint.d.ts +59 -0
- package/dist/types.d.ts +25 -12
- package/package.json +29 -14
- package/scripts/postinstall.ts +60 -0
- package/scripts/uninstall.ts +20 -0
package/dist/config.d.ts
CHANGED
package/dist/git-hooks.d.ts
CHANGED
|
@@ -1,64 +1,40 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
'applypatch-msg' |
|
|
6
|
-
'pre-applypatch' |
|
|
7
|
-
'post-applypatch' |
|
|
8
|
-
'pre-commit' |
|
|
9
|
-
'pre-merge-commit' |
|
|
10
|
-
'prepare-commit-msg' |
|
|
11
|
-
'commit-msg' |
|
|
12
|
-
'post-commit' |
|
|
13
|
-
'pre-rebase' |
|
|
14
|
-
'post-checkout' |
|
|
15
|
-
'post-merge' |
|
|
16
|
-
'pre-push' |
|
|
17
|
-
'pre-receive' |
|
|
18
|
-
'update' |
|
|
19
|
-
'proc-receive' |
|
|
20
|
-
'post-receive' |
|
|
21
|
-
'post-update' |
|
|
22
|
-
'reference-transaction' |
|
|
23
|
-
'push-to-checkout' |
|
|
24
|
-
'pre-auto-gc' |
|
|
25
|
-
'post-rewrite' |
|
|
26
|
-
'sendemail-validate' |
|
|
27
|
-
'fsmonitor-watchman' |
|
|
28
|
-
'p4-changelist' |
|
|
29
|
-
'p4-prepare-changelist' |
|
|
30
|
-
'p4-post-changelist' |
|
|
31
|
-
'p4-pre-submit' |
|
|
32
|
-
'post-index-change'
|
|
33
|
-
>;
|
|
34
|
-
export declare const VALID_OPTIONS: Array<'preserveUnused' | 'verbose' | 'staged-lint'>;
|
|
35
|
-
export declare const PREPEND_SCRIPT: unknown;
|
|
1
|
+
import type { SetHooksFromConfigOptions } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Recursively gets the .git folder path from provided directory
|
|
4
|
+
*/
|
|
36
5
|
export declare function getGitProjectRoot(directory?: string): string | undefined;
|
|
6
|
+
/**
|
|
7
|
+
* Transforms the <project>/node_modules/bun-git-hooks to <project>
|
|
8
|
+
*/
|
|
9
|
+
export declare function getProjectRootDirectoryFromNodeModules(projectPath: string): string | undefined;
|
|
10
|
+
/**
|
|
11
|
+
* Checks the 'bun-git-hooks' in dependencies of the project
|
|
12
|
+
*/
|
|
37
13
|
export declare function checkBunGitHooksInDependencies(projectRootPath: string): boolean;
|
|
38
|
-
|
|
14
|
+
/**
|
|
15
|
+
* Checks if git hooks are already installed and up-to-date
|
|
16
|
+
*/
|
|
17
|
+
export declare function areHooksInstalled(projectRootPath?: string): boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Parses the config and sets git hooks
|
|
20
|
+
*/
|
|
39
21
|
export declare function setHooksFromConfig(projectRootPath?: string, options?: SetHooksFromConfigOptions): void;
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
declare function
|
|
44
|
-
declare
|
|
45
|
-
declare
|
|
46
|
-
declare
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
removeHooks: typeof removeHooks
|
|
57
|
-
checkBunGitHooksInDependencies: typeof checkBunGitHooksInDependencies
|
|
58
|
-
getProjectRootDirectoryFromNodeModules: typeof getProjectRootDirectoryFromNodeModules
|
|
59
|
-
getGitProjectRoot: typeof getGitProjectRoot
|
|
60
|
-
runStagedLint: typeof runStagedLint
|
|
61
|
-
getStagedFiles: typeof getStagedFiles
|
|
62
|
-
};
|
|
22
|
+
/**
|
|
23
|
+
* Deletes all git hooks
|
|
24
|
+
*/
|
|
25
|
+
export declare function removeHooks(projectRoot?: string, verbose?: any): void;
|
|
26
|
+
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
|
+
export declare const VALID_OPTIONS: readonly ['preserveUnused', 'verbose', 'staged-lint'];
|
|
28
|
+
export declare const PREPEND_SCRIPT: `#!/bin/sh
|
|
29
|
+
|
|
30
|
+
if [ "$SKIP_BUN_GIT_HOOKS" = "1" ]; then
|
|
31
|
+
echo "[INFO] SKIP_BUN_GIT_HOOKS is set to 1, skipping hook."
|
|
32
|
+
exit 0
|
|
33
|
+
fi
|
|
34
|
+
|
|
35
|
+
if [ -f "$BUN_GIT_HOOKS_RC" ]; then
|
|
36
|
+
. "$BUN_GIT_HOOKS_RC"
|
|
37
|
+
fi
|
|
63
38
|
|
|
39
|
+
`;
|
|
64
40
|
export default gitHooks;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
export * from './config'
|
|
2
|
-
export * from './git-hooks'
|
|
3
|
-
export * from './
|
|
1
|
+
export * from './config';
|
|
2
|
+
export * from './git-hooks';
|
|
3
|
+
export * from './staged-lint';
|
|
4
|
+
export * from './types';
|