bun-git-hooks 0.2.1 → 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.
@@ -604,7 +604,7 @@ class CAC extends EventEmitter {
604
604
  }
605
605
  }
606
606
  // package.json
607
- var version = "0.2.1";
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 ./config.ts").example("bun-git-hooks --verbose").action(async (configPath, options) => {
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,4 @@
1
+ import type { GitHooksConfig } from 'bun-git-hooks';
2
+
3
+ export declare const defaultConfig: GitHooksConfig;
4
+ export declare const config: GitHooksConfig;
@@ -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,3 @@
1
+ export * from './config'
2
+ export * from './git-hooks'
3
+ export * from './types'
@@ -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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bun-git-hooks",
3
3
  "type": "module",
4
- "version": "0.2.1",
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",