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.
- package/dist/bin/cli.js +725 -3605
- package/dist/git-hooks.d.ts +13 -10
- package/dist/index.js +370 -3250
- package/package.json +6 -5
- package/dist/bin/config.d.ts +0 -3
- package/dist/bin/git-hooks.d.ts +0 -61
- package/dist/bin/index.d.ts +0 -3
- package/dist/bin/types.d.ts +0 -20
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bun-git-hooks",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.16",
|
|
5
5
|
"description": "A modern, zero dependency tool for managing git hooks in Bun projects.",
|
|
6
6
|
"author": "Chris Breuer <chris@stacksjs.org>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -73,13 +73,14 @@
|
|
|
73
73
|
"zip:darwin-arm64": "zip -j bin/git-hooks-darwin-arm64.zip bin/git-hooks-darwin-arm64"
|
|
74
74
|
},
|
|
75
75
|
"devDependencies": {
|
|
76
|
-
"@stacksjs/clarity": "0.3.
|
|
76
|
+
"@stacksjs/clarity": "^0.3.15",
|
|
77
77
|
"@stacksjs/docs": "^0.70.23",
|
|
78
78
|
"@stacksjs/eslint-config": "^4.10.2-beta.3",
|
|
79
|
-
"@
|
|
79
|
+
"@stacksjs/gitlint": "^0.1.5",
|
|
80
|
+
"@types/bun": "^1.2.12",
|
|
80
81
|
"bumpp": "^10.1.0",
|
|
81
|
-
"bun-plugin-dtsx": "^0.21.
|
|
82
|
-
"bunfig": "^0.8.
|
|
82
|
+
"bun-plugin-dtsx": "^0.21.12",
|
|
83
|
+
"bunfig": "^0.8.5",
|
|
83
84
|
"cac": "^6.7.14",
|
|
84
85
|
"changelogen": "^0.6.1",
|
|
85
86
|
"typescript": "^5.8.3"
|
package/dist/bin/config.d.ts
DELETED
package/dist/bin/git-hooks.d.ts
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import type { SetHooksFromConfigOptions, StagedLintConfig } from './types';
|
|
2
|
-
|
|
3
|
-
declare const execAsync: unknown;
|
|
4
|
-
export declare const VALID_GIT_HOOKS: Array<
|
|
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;
|
|
36
|
-
export declare function getGitProjectRoot(directory: string): string | undefined;
|
|
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[]>;
|
|
41
|
-
declare function matchesGlob(file: string, pattern: string): boolean;
|
|
42
|
-
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;
|
|
48
|
-
export declare function runStagedLint(hook: string): Promise<boolean>;
|
|
49
|
-
declare function _validateHooks(config: Record<string, any>): boolean;
|
|
50
|
-
declare const gitHooks: {
|
|
51
|
-
PREPEND_SCRIPT: typeof PREPEND_SCRIPT
|
|
52
|
-
setHooksFromConfig: typeof setHooksFromConfig
|
|
53
|
-
removeHooks: typeof removeHooks
|
|
54
|
-
checkBunGitHooksInDependencies: typeof checkBunGitHooksInDependencies
|
|
55
|
-
getProjectRootDirectoryFromNodeModules: typeof getProjectRootDirectoryFromNodeModules
|
|
56
|
-
getGitProjectRoot: typeof getGitProjectRoot
|
|
57
|
-
runStagedLint: typeof runStagedLint
|
|
58
|
-
getStagedFiles: typeof getStagedFiles
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
export default gitHooks;
|
package/dist/bin/index.d.ts
DELETED
package/dist/bin/types.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export declare type StagedLintTask = string | string[]
|
|
2
|
-
|
|
3
|
-
export interface StagedLintConfig {
|
|
4
|
-
[pattern: string]: StagedLintTask
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export type GitHooksConfig = {
|
|
8
|
-
[K in typeof VALID_GIT_HOOKS[number]]?: string | {
|
|
9
|
-
'stagedLint'?: StagedLintConfig
|
|
10
|
-
'staged-lint'?: StagedLintConfig
|
|
11
|
-
}
|
|
12
|
-
} & {
|
|
13
|
-
'preserveUnused'?: boolean | typeof VALID_GIT_HOOKS[number][]
|
|
14
|
-
'verbose'?: boolean
|
|
15
|
-
'staged-lint'?: StagedLintConfig
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export interface SetHooksFromConfigOptions {
|
|
19
|
-
configFile?: GitHooksConfig
|
|
20
|
-
}
|