bun-git-hooks 0.2.0 → 0.2.3
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/{cli.js → bin/cli.js} +2 -2
- package/dist/bin/config.d.ts +4 -0
- package/dist/bin/git-hooks.d.ts +50 -0
- package/dist/bin/index.d.ts +3 -0
- package/dist/bin/types.d.ts +43 -0
- package/dist/config.d.ts +1 -1
- package/package.json +6 -6
|
@@ -604,7 +604,7 @@ class CAC extends EventEmitter {
|
|
|
604
604
|
}
|
|
605
605
|
}
|
|
606
606
|
// package.json
|
|
607
|
-
var version = "0.2.
|
|
607
|
+
var version = "0.2.3";
|
|
608
608
|
|
|
609
609
|
// src/git-hooks.ts
|
|
610
610
|
import fs from "fs";
|
|
@@ -922,7 +922,7 @@ if (["1", "true"].includes(SKIP_INSTALL_GIT_HOOKS || "")) {
|
|
|
922
922
|
console.log(`[INFO] SKIP_INSTALL_GIT_HOOKS is set to "${SKIP_INSTALL_GIT_HOOKS}", skipping installing hooks.`);
|
|
923
923
|
process4.exit(0);
|
|
924
924
|
}
|
|
925
|
-
cli.command("[configPath]", "Install git hooks, optionally from specified config file").option("--verbose", "Enable verbose logging").example("bun-git-hooks").example("bun-git-hooks
|
|
925
|
+
cli.command("[configPath]", "Install git hooks, optionally from specified config file").option("--verbose", "Enable verbose logging").example("bun-git-hooks").example("bun-git-hooks ../src/config.ts").example("bun-git-hooks --verbose").action(async (configPath, options) => {
|
|
926
926
|
try {
|
|
927
927
|
if (options?.verbose) {
|
|
928
928
|
console.log("[DEBUG] Config path:", configPath || "using default");
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
export declare const VALID_GIT_HOOKS: Array<
|
|
2
|
+
'applypatch-msg' |
|
|
3
|
+
'pre-applypatch' |
|
|
4
|
+
'post-applypatch' |
|
|
5
|
+
'pre-commit' |
|
|
6
|
+
'pre-merge-commit' |
|
|
7
|
+
'prepare-commit-msg' |
|
|
8
|
+
'commit-msg' |
|
|
9
|
+
'post-commit' |
|
|
10
|
+
'pre-rebase' |
|
|
11
|
+
'post-checkout' |
|
|
12
|
+
'post-merge' |
|
|
13
|
+
'pre-push' |
|
|
14
|
+
'pre-receive' |
|
|
15
|
+
'update' |
|
|
16
|
+
'proc-receive' |
|
|
17
|
+
'post-receive' |
|
|
18
|
+
'post-update' |
|
|
19
|
+
'reference-transaction' |
|
|
20
|
+
'push-to-checkout' |
|
|
21
|
+
'pre-auto-gc' |
|
|
22
|
+
'post-rewrite' |
|
|
23
|
+
'sendemail-validate' |
|
|
24
|
+
'fsmonitor-watchman' |
|
|
25
|
+
'p4-changelist' |
|
|
26
|
+
'p4-prepare-changelist' |
|
|
27
|
+
'p4-post-changelist' |
|
|
28
|
+
'p4-pre-submit' |
|
|
29
|
+
'post-index-change'
|
|
30
|
+
>;
|
|
31
|
+
export declare const VALID_OPTIONS: Array<'preserveUnused'>;
|
|
32
|
+
export declare const PREPEND_SCRIPT: unknown;
|
|
33
|
+
export declare function getGitProjectRoot(directory: string): string | undefined;
|
|
34
|
+
export declare function checkBunGitHooksInDependencies(projectRootPath: string): boolean;
|
|
35
|
+
declare function _getPackageJson(projectPath): void;
|
|
36
|
+
export declare function setHooksFromConfig(projectRootPath: string, options?: { configFile?: , string }): void;
|
|
37
|
+
declare function _setHook(hook: string, command: string, projectRoot: string): void;
|
|
38
|
+
export declare function removeHooks(projectRoot: string, verbose): void;
|
|
39
|
+
declare function _removeHook(hook: string, projectRoot, verbose): void;
|
|
40
|
+
declare function _validateHooks(config: Record<string, string>): void;
|
|
41
|
+
declare const gitHooks: {
|
|
42
|
+
PREPEND_SCRIPT: typeof PREPEND_SCRIPT
|
|
43
|
+
setHooksFromConfig: typeof setHooksFromConfig
|
|
44
|
+
removeHooks: typeof removeHooks
|
|
45
|
+
checkBunGitHooksInDependencies: typeof checkBunGitHooksInDependencies
|
|
46
|
+
getProjectRootDirectoryFromNodeModules: typeof getProjectRootDirectoryFromNodeModules
|
|
47
|
+
getGitProjectRoot: typeof getGitProjectRoot
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export default gitHooks;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { Buffer } from 'node:buffer';
|
|
2
|
+
|
|
3
|
+
export declare interface RawImageData<T> {
|
|
4
|
+
width: number
|
|
5
|
+
height: number
|
|
6
|
+
data: T
|
|
7
|
+
}
|
|
8
|
+
export declare interface BufferRet {
|
|
9
|
+
data: Buffer | Uint8ClampedArray
|
|
10
|
+
width: number
|
|
11
|
+
height: number
|
|
12
|
+
exifBuffer?: ArrayBuffer
|
|
13
|
+
comments?: string[]
|
|
14
|
+
}
|
|
15
|
+
export declare type UintArrRet = ImageData & {
|
|
16
|
+
exifBuffer?: ArrayBuffer
|
|
17
|
+
comments?: string[]
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface ImageData {
|
|
21
|
+
width: number
|
|
22
|
+
height: number
|
|
23
|
+
data: Uint8ClampedArray | Buffer
|
|
24
|
+
colorSpace?: 'srgb'
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export type BufferLike = Buffer | Uint8Array | ArrayLike<number> | Iterable<number> | ArrayBuffer
|
|
28
|
+
|
|
29
|
+
export interface DecoderOptions {
|
|
30
|
+
useTArray: boolean
|
|
31
|
+
colorTransform?: boolean
|
|
32
|
+
formatAsRGBA?: boolean
|
|
33
|
+
tolerantDecoding?: boolean
|
|
34
|
+
maxResolutionInMP?: number
|
|
35
|
+
maxMemoryUsageInMB?: number
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export type GitHooksConfig = {
|
|
39
|
+
[K in typeof VALID_GIT_HOOKS[number]]?: string
|
|
40
|
+
} & {
|
|
41
|
+
preserveUnused?: boolean | typeof VALID_GIT_HOOKS[number][]
|
|
42
|
+
verbose?: boolean
|
|
43
|
+
}
|
package/dist/config.d.ts
CHANGED
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.3",
|
|
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",
|
|
@@ -46,11 +46,11 @@
|
|
|
46
46
|
"build": "bun build.ts && bun run compile",
|
|
47
47
|
"compile": "bun build ./bin/cli.ts --compile --minify --outfile bin/git-hooks",
|
|
48
48
|
"compile:all": "bun run compile:linux-x64 && bun run compile:linux-arm64 && bun run compile:windows-x64 && bun run compile:darwin-x64 && bun run compile:darwin-arm64",
|
|
49
|
-
"compile:linux-x64": "bun build ./bin/cli.ts --compile --minify --target=bun-linux-x64 --outfile bin/git-hooks-linux-x64
|
|
50
|
-
"compile:linux-arm64": "bun build ./bin/cli.ts --compile --minify --target=bun-linux-arm64 --outfile bin/git-hooks-linux-arm64
|
|
51
|
-
"compile:windows-x64": "bun build ./bin/cli.ts --compile --minify --target=bun-windows-x64 --outfile bin/git-hooks-windows-x64.
|
|
52
|
-
"compile:darwin-x64": "bun build ./bin/cli.ts --compile --minify --target=bun-darwin-x64 --outfile bin/git-hooks-darwin-x64
|
|
53
|
-
"compile:darwin-arm64": "bun build ./bin/cli.ts --compile --minify --target=bun-darwin-arm64 --outfile bin/git-hooks-darwin-arm64
|
|
49
|
+
"compile:linux-x64": "bun build ./bin/cli.ts --compile --minify --target=bun-linux-x64 --outfile bin/git-hooks-linux-x64",
|
|
50
|
+
"compile:linux-arm64": "bun build ./bin/cli.ts --compile --minify --target=bun-linux-arm64 --outfile bin/git-hooks-linux-arm64",
|
|
51
|
+
"compile:windows-x64": "bun build ./bin/cli.ts --compile --minify --target=bun-windows-x64 --outfile bin/git-hooks-windows-x64.exe",
|
|
52
|
+
"compile:darwin-x64": "bun build ./bin/cli.ts --compile --minify --target=bun-darwin-x64 --outfile bin/git-hooks-darwin-x64",
|
|
53
|
+
"compile:darwin-arm64": "bun build ./bin/cli.ts --compile --minify --target=bun-darwin-arm64 --outfile bin/git-hooks-darwin-arm64",
|
|
54
54
|
"postinstall": "bun ./scripts/postinstall.ts",
|
|
55
55
|
"uninstall": "bun ./scripts/uninstall.ts",
|
|
56
56
|
"lint": "bunx --bun eslint .",
|