bun-git-hooks 0.2.6 → 0.2.8
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 → cli.js} +18 -31
- package/dist/index.js +109 -116
- package/package.json +7 -7
- package/dist/bin/config.d.ts +0 -4
- package/dist/bin/git-hooks.d.ts +0 -50
- package/dist/bin/index.d.ts +0 -3
- package/dist/bin/types.d.ts +0 -43
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// @bun
|
|
3
3
|
|
|
4
4
|
// bin/cli.ts
|
|
5
|
-
import
|
|
5
|
+
import process5 from "process";
|
|
6
6
|
|
|
7
7
|
// node_modules/cac/dist/index.mjs
|
|
8
8
|
import { EventEmitter } from "events";
|
|
@@ -604,15 +604,15 @@ class CAC extends EventEmitter {
|
|
|
604
604
|
}
|
|
605
605
|
}
|
|
606
606
|
// package.json
|
|
607
|
-
var version = "0.2.
|
|
607
|
+
var version = "0.2.8";
|
|
608
608
|
|
|
609
609
|
// src/git-hooks.ts
|
|
610
610
|
import fs from "fs";
|
|
611
611
|
import path from "path";
|
|
612
|
-
import
|
|
612
|
+
import process4 from "process";
|
|
613
613
|
|
|
614
614
|
// src/config.ts
|
|
615
|
-
import
|
|
615
|
+
import process3 from "process";
|
|
616
616
|
|
|
617
617
|
// node_modules/bunfig/dist/index.js
|
|
618
618
|
import { existsSync, mkdirSync, readdirSync, writeFileSync } from "fs";
|
|
@@ -788,16 +788,14 @@ var defaultConfigDir = resolve(process2.cwd(), "config");
|
|
|
788
788
|
var defaultGeneratedDir = resolve(process2.cwd(), "src/generated");
|
|
789
789
|
|
|
790
790
|
// src/config.ts
|
|
791
|
-
var __dirname = "/home/runner/work/bun-git-hooks/bun-git-hooks/src";
|
|
792
791
|
var defaultConfig = {
|
|
793
792
|
verbose: true
|
|
794
793
|
};
|
|
795
794
|
var config = await loadConfig({
|
|
796
795
|
name: "git-hooks",
|
|
797
|
-
cwd:
|
|
796
|
+
cwd: process3.cwd(),
|
|
798
797
|
defaultConfig
|
|
799
798
|
});
|
|
800
|
-
console.log("cwd", resolve2(__dirname, ".."));
|
|
801
799
|
|
|
802
800
|
// src/git-hooks.ts
|
|
803
801
|
var VALID_GIT_HOOKS = [
|
|
@@ -842,7 +840,7 @@ if [ -f "$BUN_GIT_HOOKS_RC" ]; then
|
|
|
842
840
|
fi
|
|
843
841
|
|
|
844
842
|
`;
|
|
845
|
-
function getGitProjectRoot(directory =
|
|
843
|
+
function getGitProjectRoot(directory = process4.cwd()) {
|
|
846
844
|
if (directory.endsWith(".git")) {
|
|
847
845
|
return path.normalize(directory);
|
|
848
846
|
}
|
|
@@ -873,32 +871,25 @@ function getGitProjectRoot(directory = process3.cwd()) {
|
|
|
873
871
|
}
|
|
874
872
|
return getGitProjectRoot(parentDir);
|
|
875
873
|
}
|
|
876
|
-
function setHooksFromConfig(projectRootPath =
|
|
874
|
+
function setHooksFromConfig(projectRootPath = process4.cwd(), options = {}) {
|
|
877
875
|
if (!config || Object.keys(config).length === 0)
|
|
878
876
|
throw new Error("[ERROR] Config was not found! Please add `.git-hooks.config.{ts,js,mjs,cjs,mts,cts,json}` or `git-hooks.config.{ts,js,mjs,cjs,mts,cts,json}` or the `git-hooks` entry in package.json.\r\nCheck README for details");
|
|
879
|
-
console.log("setHooksFromConfig config", config);
|
|
880
877
|
const hookKeys = Object.keys(config).filter((key) => key !== "preserveUnused" && key !== "verbose");
|
|
881
|
-
console.log("hookKeys", hookKeys);
|
|
882
878
|
const isValidConfig = hookKeys.every((key) => VALID_GIT_HOOKS.includes(key));
|
|
883
|
-
console.log("isValidConfig", isValidConfig);
|
|
884
879
|
if (!isValidConfig)
|
|
885
880
|
throw new Error("[ERROR] Config was not in correct format. Please check git hooks or options name");
|
|
886
881
|
const preserveUnused = Array.isArray(config.preserveUnused) ? config.preserveUnused : config.preserveUnused ? VALID_GIT_HOOKS : [];
|
|
887
882
|
for (const hook of VALID_GIT_HOOKS) {
|
|
888
|
-
console.log("hook", hook);
|
|
889
883
|
if (Object.prototype.hasOwnProperty.call(config, hook)) {
|
|
890
|
-
console.log("hook in config");
|
|
891
884
|
if (!config[hook])
|
|
892
885
|
throw new Error(`[ERROR] Command for ${hook} is not set`);
|
|
893
|
-
console.log(`Hook ${hook}: `, config[hook]);
|
|
894
886
|
_setHook(hook, config[hook], projectRootPath);
|
|
895
887
|
} else if (!preserveUnused.includes(hook)) {
|
|
896
|
-
console.log("Remove hook", hook);
|
|
897
888
|
_removeHook(hook, projectRootPath);
|
|
898
889
|
}
|
|
899
890
|
}
|
|
900
891
|
}
|
|
901
|
-
function _setHook(hook, command, projectRoot =
|
|
892
|
+
function _setHook(hook, command, projectRoot = process4.cwd()) {
|
|
902
893
|
const gitRoot = getGitProjectRoot(projectRoot);
|
|
903
894
|
if (!gitRoot) {
|
|
904
895
|
console.info("[INFO] No `.git` root folder found, skipping");
|
|
@@ -907,19 +898,16 @@ function _setHook(hook, command, projectRoot = process3.cwd()) {
|
|
|
907
898
|
const hookCommand = PREPEND_SCRIPT + command;
|
|
908
899
|
const hookDirectory = path.join(gitRoot, "hooks");
|
|
909
900
|
const hookPath = path.normalize(path.join(hookDirectory, hook));
|
|
910
|
-
console.log("hook", { hookPath, hookCommand, hookDirectory });
|
|
911
901
|
if (!fs.existsSync(hookDirectory)) {
|
|
912
|
-
console.log("hook folder not exists");
|
|
913
902
|
fs.mkdirSync(hookDirectory, { recursive: true });
|
|
914
903
|
}
|
|
915
|
-
console.log("Create/Write hook");
|
|
916
904
|
fs.writeFileSync(hookPath, hookCommand, { mode: 493 });
|
|
917
905
|
}
|
|
918
|
-
function removeHooks(projectRoot =
|
|
906
|
+
function removeHooks(projectRoot = process4.cwd(), verbose = false) {
|
|
919
907
|
for (const configEntry of VALID_GIT_HOOKS)
|
|
920
908
|
_removeHook(configEntry, projectRoot, verbose);
|
|
921
909
|
}
|
|
922
|
-
function _removeHook(hook, projectRoot =
|
|
910
|
+
function _removeHook(hook, projectRoot = process4.cwd(), verbose = false) {
|
|
923
911
|
const gitRoot = getGitProjectRoot(projectRoot);
|
|
924
912
|
const hookPath = path.normalize(`${gitRoot}/hooks/${hook}`);
|
|
925
913
|
if (fs.existsSync(hookPath))
|
|
@@ -930,35 +918,34 @@ function _removeHook(hook, projectRoot = process3.cwd(), verbose = false) {
|
|
|
930
918
|
|
|
931
919
|
// bin/cli.ts
|
|
932
920
|
var cli = new CAC("git-hooks");
|
|
933
|
-
var { SKIP_INSTALL_GIT_HOOKS } =
|
|
921
|
+
var { SKIP_INSTALL_GIT_HOOKS } = process5.env;
|
|
934
922
|
if (["1", "true"].includes(SKIP_INSTALL_GIT_HOOKS || "")) {
|
|
935
923
|
console.log(`[INFO] SKIP_INSTALL_GIT_HOOKS is set to "${SKIP_INSTALL_GIT_HOOKS}", skipping installing hooks.`);
|
|
936
|
-
|
|
924
|
+
process5.exit(0);
|
|
937
925
|
}
|
|
938
926
|
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) => {
|
|
939
927
|
try {
|
|
940
928
|
if (options?.verbose) {
|
|
941
929
|
console.log("[DEBUG] Config path:", configPath || "using default");
|
|
942
|
-
console.log("[DEBUG] Working directory:",
|
|
930
|
+
console.log("[DEBUG] Working directory:", process5.cwd());
|
|
943
931
|
}
|
|
944
|
-
|
|
945
|
-
setHooksFromConfig(process4.cwd(), { configFile: configPath });
|
|
932
|
+
setHooksFromConfig(process5.cwd(), { configFile: configPath });
|
|
946
933
|
console.log("[INFO] Successfully set all git hooks");
|
|
947
934
|
} catch (err) {
|
|
948
935
|
console.error("[ERROR] Was not able to set git hooks. Error:", err);
|
|
949
|
-
|
|
936
|
+
process5.exit(1);
|
|
950
937
|
}
|
|
951
938
|
});
|
|
952
939
|
cli.command("uninstall", "Remove all git hooks").alias("remove").option("--verbose", "Enable verbose logging").example("bun-git-hooks uninstall").example("bunx bun-git-hooks remove").example("bunx git-hooks uninstall --verbose").action(async (options) => {
|
|
953
940
|
try {
|
|
954
941
|
if (options?.verbose) {
|
|
955
|
-
console.log("[DEBUG] Removing hooks from:",
|
|
942
|
+
console.log("[DEBUG] Removing hooks from:", process5.cwd());
|
|
956
943
|
}
|
|
957
|
-
removeHooks(
|
|
944
|
+
removeHooks(process5.cwd(), options?.verbose);
|
|
958
945
|
console.log("[INFO] Successfully removed all git hooks");
|
|
959
946
|
} catch (err) {
|
|
960
947
|
console.error("[ERROR] Was not able to remove git hooks. Error:", err);
|
|
961
|
-
|
|
948
|
+
process5.exit(1);
|
|
962
949
|
}
|
|
963
950
|
});
|
|
964
951
|
cli.version(version);
|
package/dist/index.js
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
2
2
|
|
|
3
3
|
// node:process
|
|
4
|
-
var C,
|
|
4
|
+
var C, T, q, A, I, Q, S = (e, t) => () => (t || e((t = { exports: {} }).exports, t), t.exports), N = (e, t) => {
|
|
5
5
|
for (var n in t)
|
|
6
|
-
|
|
6
|
+
T(e, n, { get: t[n], enumerable: true });
|
|
7
7
|
}, d = (e, t, n, w) => {
|
|
8
8
|
if (t && typeof t == "object" || typeof t == "function")
|
|
9
9
|
for (let l of A(t))
|
|
10
|
-
!
|
|
10
|
+
!Q.call(e, l) && l !== n && T(e, l, { get: () => t[l], enumerable: !(w = q(t, l)) || w.enumerable });
|
|
11
11
|
return e;
|
|
12
|
-
},
|
|
12
|
+
}, h = (e, t, n) => (d(e, t, "default"), n && d(n, t, "default")), y = (e, t, n) => (n = e != null ? C(I(e)) : {}, d(t || !e || !e.__esModule ? T(n, "default", { value: e, enumerable: true }) : n, e)), v, f, j;
|
|
13
13
|
var init_process = __esm(() => {
|
|
14
14
|
C = Object.create;
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
T = Object.defineProperty;
|
|
16
|
+
q = Object.getOwnPropertyDescriptor;
|
|
17
17
|
A = Object.getOwnPropertyNames;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
v =
|
|
21
|
-
var r =
|
|
18
|
+
I = Object.getPrototypeOf;
|
|
19
|
+
Q = Object.prototype.hasOwnProperty;
|
|
20
|
+
v = S((B, E) => {
|
|
21
|
+
var r = E.exports = {}, i, u;
|
|
22
22
|
function p() {
|
|
23
23
|
throw new Error("setTimeout has not been defined");
|
|
24
24
|
}
|
|
25
|
-
function
|
|
25
|
+
function g() {
|
|
26
26
|
throw new Error("clearTimeout has not been defined");
|
|
27
27
|
}
|
|
28
28
|
(function() {
|
|
@@ -32,9 +32,9 @@ var init_process = __esm(() => {
|
|
|
32
32
|
i = p;
|
|
33
33
|
}
|
|
34
34
|
try {
|
|
35
|
-
typeof clearTimeout == "function" ?
|
|
35
|
+
typeof clearTimeout == "function" ? u = clearTimeout : u = g;
|
|
36
36
|
} catch {
|
|
37
|
-
|
|
37
|
+
u = g;
|
|
38
38
|
}
|
|
39
39
|
})();
|
|
40
40
|
function b(e) {
|
|
@@ -52,35 +52,35 @@ var init_process = __esm(() => {
|
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
|
-
function
|
|
56
|
-
if (
|
|
55
|
+
function O(e) {
|
|
56
|
+
if (u === clearTimeout)
|
|
57
57
|
return clearTimeout(e);
|
|
58
|
-
if ((
|
|
59
|
-
return
|
|
58
|
+
if ((u === g || !u) && clearTimeout)
|
|
59
|
+
return u = clearTimeout, clearTimeout(e);
|
|
60
60
|
try {
|
|
61
|
-
return
|
|
61
|
+
return u(e);
|
|
62
62
|
} catch {
|
|
63
63
|
try {
|
|
64
|
-
return
|
|
64
|
+
return u.call(null, e);
|
|
65
65
|
} catch {
|
|
66
|
-
return
|
|
66
|
+
return u.call(this, e);
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
var o = [], s = false, a, m = -1;
|
|
71
|
-
function
|
|
72
|
-
!s || !a || (s = false, a.length ? o = a.concat(o) : m = -1, o.length &&
|
|
71
|
+
function U() {
|
|
72
|
+
!s || !a || (s = false, a.length ? o = a.concat(o) : m = -1, o.length && x());
|
|
73
73
|
}
|
|
74
|
-
function
|
|
74
|
+
function x() {
|
|
75
75
|
if (!s) {
|
|
76
|
-
var e = b(
|
|
76
|
+
var e = b(U);
|
|
77
77
|
s = true;
|
|
78
78
|
for (var t = o.length;t; ) {
|
|
79
79
|
for (a = o, o = [];++m < t; )
|
|
80
80
|
a && a[m].run();
|
|
81
81
|
m = -1, t = o.length;
|
|
82
82
|
}
|
|
83
|
-
a = null, s = false,
|
|
83
|
+
a = null, s = false, O(e);
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
86
|
r.nextTick = function(e) {
|
|
@@ -88,12 +88,12 @@ var init_process = __esm(() => {
|
|
|
88
88
|
if (arguments.length > 1)
|
|
89
89
|
for (var n = 1;n < arguments.length; n++)
|
|
90
90
|
t[n - 1] = arguments[n];
|
|
91
|
-
o.push(new
|
|
91
|
+
o.push(new L(e, t)), o.length === 1 && !s && b(x);
|
|
92
92
|
};
|
|
93
|
-
function
|
|
93
|
+
function L(e, t) {
|
|
94
94
|
this.fun = e, this.array = t;
|
|
95
95
|
}
|
|
96
|
-
|
|
96
|
+
L.prototype.run = function() {
|
|
97
97
|
this.fun.apply(null, this.array);
|
|
98
98
|
};
|
|
99
99
|
r.title = "browser";
|
|
@@ -129,32 +129,38 @@ var init_process = __esm(() => {
|
|
|
129
129
|
};
|
|
130
130
|
});
|
|
131
131
|
f = {};
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
132
|
+
N(f, { default: () => j });
|
|
133
|
+
h(f, y(v()));
|
|
134
|
+
j = y(v());
|
|
135
135
|
});
|
|
136
136
|
|
|
137
|
+
// src/config.ts
|
|
138
|
+
init_process();
|
|
139
|
+
|
|
140
|
+
// node_modules/bunfig/dist/index.js
|
|
141
|
+
var {existsSync, mkdirSync, readdirSync, writeFileSync} = (() => ({}));
|
|
142
|
+
|
|
137
143
|
// node:path
|
|
138
144
|
var L = Object.create;
|
|
139
|
-
var
|
|
145
|
+
var h2 = Object.defineProperty;
|
|
140
146
|
var D = Object.getOwnPropertyDescriptor;
|
|
141
|
-
var
|
|
147
|
+
var T2 = Object.getOwnPropertyNames;
|
|
142
148
|
var _ = Object.getPrototypeOf;
|
|
143
149
|
var E = Object.prototype.hasOwnProperty;
|
|
144
150
|
var R = (s, e) => () => (e || s((e = { exports: {} }).exports, e), e.exports);
|
|
145
|
-
var
|
|
151
|
+
var N2 = (s, e, r, t) => {
|
|
146
152
|
if (e && typeof e == "object" || typeof e == "function")
|
|
147
|
-
for (let i of
|
|
148
|
-
!E.call(s, i) && i !== r &&
|
|
153
|
+
for (let i of T2(e))
|
|
154
|
+
!E.call(s, i) && i !== r && h2(s, i, { get: () => e[i], enumerable: !(t = D(e, i)) || t.enumerable });
|
|
149
155
|
return s;
|
|
150
156
|
};
|
|
151
|
-
var
|
|
157
|
+
var j2 = (s, e, r) => (r = s != null ? L(_(s)) : {}, N2(e || !s || !s.__esModule ? h2(r, "default", { value: s, enumerable: true }) : r, s));
|
|
152
158
|
var k = R((W, w) => {
|
|
153
|
-
function
|
|
159
|
+
function v2(s) {
|
|
154
160
|
if (typeof s != "string")
|
|
155
161
|
throw new TypeError("Path must be a string. Received " + JSON.stringify(s));
|
|
156
162
|
}
|
|
157
|
-
function
|
|
163
|
+
function C2(s, e) {
|
|
158
164
|
for (var r = "", t = 0, i = -1, a = 0, n, l = 0;l <= s.length; ++l) {
|
|
159
165
|
if (l < s.length)
|
|
160
166
|
n = s.charCodeAt(l);
|
|
@@ -168,9 +174,9 @@ var k = R((W, w) => {
|
|
|
168
174
|
if (i !== l - 1 && a === 2) {
|
|
169
175
|
if (r.length < 2 || t !== 2 || r.charCodeAt(r.length - 1) !== 46 || r.charCodeAt(r.length - 2) !== 46) {
|
|
170
176
|
if (r.length > 2) {
|
|
171
|
-
var
|
|
172
|
-
if (
|
|
173
|
-
|
|
177
|
+
var f2 = r.lastIndexOf("/");
|
|
178
|
+
if (f2 !== r.length - 1) {
|
|
179
|
+
f2 === -1 ? (r = "", t = 0) : (r = r.slice(0, f2), t = r.length - 1 - r.lastIndexOf("/")), i = l, a = 0;
|
|
174
180
|
continue;
|
|
175
181
|
}
|
|
176
182
|
} else if (r.length === 2 || r.length === 1) {
|
|
@@ -194,55 +200,55 @@ var k = R((W, w) => {
|
|
|
194
200
|
var m = { resolve: function() {
|
|
195
201
|
for (var e = "", r = false, t, i = arguments.length - 1;i >= -1 && !r; i--) {
|
|
196
202
|
var a;
|
|
197
|
-
i >= 0 ? a = arguments[i] : (t === undefined && (t = process.cwd()), a = t),
|
|
203
|
+
i >= 0 ? a = arguments[i] : (t === undefined && (t = process.cwd()), a = t), v2(a), a.length !== 0 && (e = a + "/" + e, r = a.charCodeAt(0) === 47);
|
|
198
204
|
}
|
|
199
|
-
return e =
|
|
205
|
+
return e = C2(e, !r), r ? e.length > 0 ? "/" + e : "/" : e.length > 0 ? e : ".";
|
|
200
206
|
}, normalize: function(e) {
|
|
201
|
-
if (
|
|
207
|
+
if (v2(e), e.length === 0)
|
|
202
208
|
return ".";
|
|
203
209
|
var r = e.charCodeAt(0) === 47, t = e.charCodeAt(e.length - 1) === 47;
|
|
204
|
-
return e =
|
|
210
|
+
return e = C2(e, !r), e.length === 0 && !r && (e = "."), e.length > 0 && t && (e += "/"), r ? "/" + e : e;
|
|
205
211
|
}, isAbsolute: function(e) {
|
|
206
|
-
return
|
|
212
|
+
return v2(e), e.length > 0 && e.charCodeAt(0) === 47;
|
|
207
213
|
}, join: function() {
|
|
208
214
|
if (arguments.length === 0)
|
|
209
215
|
return ".";
|
|
210
216
|
for (var e, r = 0;r < arguments.length; ++r) {
|
|
211
217
|
var t = arguments[r];
|
|
212
|
-
|
|
218
|
+
v2(t), t.length > 0 && (e === undefined ? e = t : e += "/" + t);
|
|
213
219
|
}
|
|
214
220
|
return e === undefined ? "." : m.normalize(e);
|
|
215
221
|
}, relative: function(e, r) {
|
|
216
|
-
if (
|
|
222
|
+
if (v2(e), v2(r), e === r || (e = m.resolve(e), r = m.resolve(r), e === r))
|
|
217
223
|
return "";
|
|
218
224
|
for (var t = 1;t < e.length && e.charCodeAt(t) === 47; ++t)
|
|
219
225
|
;
|
|
220
226
|
for (var i = e.length, a = i - t, n = 1;n < r.length && r.charCodeAt(n) === 47; ++n)
|
|
221
227
|
;
|
|
222
|
-
for (var l = r.length,
|
|
228
|
+
for (var l = r.length, f2 = l - n, c = a < f2 ? a : f2, d2 = -1, o = 0;o <= c; ++o) {
|
|
223
229
|
if (o === c) {
|
|
224
|
-
if (
|
|
230
|
+
if (f2 > c) {
|
|
225
231
|
if (r.charCodeAt(n + o) === 47)
|
|
226
232
|
return r.slice(n + o + 1);
|
|
227
233
|
if (o === 0)
|
|
228
234
|
return r.slice(n + o);
|
|
229
235
|
} else
|
|
230
|
-
a > c && (e.charCodeAt(t + o) === 47 ?
|
|
236
|
+
a > c && (e.charCodeAt(t + o) === 47 ? d2 = o : o === 0 && (d2 = 0));
|
|
231
237
|
break;
|
|
232
238
|
}
|
|
233
|
-
var
|
|
234
|
-
if (
|
|
239
|
+
var A2 = e.charCodeAt(t + o), z = r.charCodeAt(n + o);
|
|
240
|
+
if (A2 !== z)
|
|
235
241
|
break;
|
|
236
|
-
|
|
242
|
+
A2 === 47 && (d2 = o);
|
|
237
243
|
}
|
|
238
244
|
var b = "";
|
|
239
|
-
for (o = t +
|
|
245
|
+
for (o = t + d2 + 1;o <= i; ++o)
|
|
240
246
|
(o === i || e.charCodeAt(o) === 47) && (b.length === 0 ? b += ".." : b += "/..");
|
|
241
|
-
return b.length > 0 ? b + r.slice(n +
|
|
247
|
+
return b.length > 0 ? b + r.slice(n + d2) : (n += d2, r.charCodeAt(n) === 47 && ++n, r.slice(n));
|
|
242
248
|
}, _makeLong: function(e) {
|
|
243
249
|
return e;
|
|
244
250
|
}, dirname: function(e) {
|
|
245
|
-
if (
|
|
251
|
+
if (v2(e), e.length === 0)
|
|
246
252
|
return ".";
|
|
247
253
|
for (var r = e.charCodeAt(0), t = r === 47, i = -1, a = true, n = e.length - 1;n >= 1; --n)
|
|
248
254
|
if (r = e.charCodeAt(n), r === 47) {
|
|
@@ -256,12 +262,12 @@ var k = R((W, w) => {
|
|
|
256
262
|
}, basename: function(e, r) {
|
|
257
263
|
if (r !== undefined && typeof r != "string")
|
|
258
264
|
throw new TypeError('"ext" argument must be a string');
|
|
259
|
-
|
|
265
|
+
v2(e);
|
|
260
266
|
var t = 0, i = -1, a = true, n;
|
|
261
267
|
if (r !== undefined && r.length > 0 && r.length <= e.length) {
|
|
262
268
|
if (r.length === e.length && r === e)
|
|
263
269
|
return "";
|
|
264
|
-
var l = r.length - 1,
|
|
270
|
+
var l = r.length - 1, f2 = -1;
|
|
265
271
|
for (n = e.length - 1;n >= 0; --n) {
|
|
266
272
|
var c = e.charCodeAt(n);
|
|
267
273
|
if (c === 47) {
|
|
@@ -270,9 +276,9 @@ var k = R((W, w) => {
|
|
|
270
276
|
break;
|
|
271
277
|
}
|
|
272
278
|
} else
|
|
273
|
-
|
|
279
|
+
f2 === -1 && (a = false, f2 = n + 1), l >= 0 && (c === r.charCodeAt(l) ? --l === -1 && (i = n) : (l = -1, i = f2));
|
|
274
280
|
}
|
|
275
|
-
return t === i ? i =
|
|
281
|
+
return t === i ? i = f2 : i === -1 && (i = e.length), e.slice(t, i);
|
|
276
282
|
} else {
|
|
277
283
|
for (n = e.length - 1;n >= 0; --n)
|
|
278
284
|
if (e.charCodeAt(n) === 47) {
|
|
@@ -285,17 +291,17 @@ var k = R((W, w) => {
|
|
|
285
291
|
return i === -1 ? "" : e.slice(t, i);
|
|
286
292
|
}
|
|
287
293
|
}, extname: function(e) {
|
|
288
|
-
|
|
294
|
+
v2(e);
|
|
289
295
|
for (var r = -1, t = 0, i = -1, a = true, n = 0, l = e.length - 1;l >= 0; --l) {
|
|
290
|
-
var
|
|
291
|
-
if (
|
|
296
|
+
var f2 = e.charCodeAt(l);
|
|
297
|
+
if (f2 === 47) {
|
|
292
298
|
if (!a) {
|
|
293
299
|
t = l + 1;
|
|
294
300
|
break;
|
|
295
301
|
}
|
|
296
302
|
continue;
|
|
297
303
|
}
|
|
298
|
-
i === -1 && (a = false, i = l + 1),
|
|
304
|
+
i === -1 && (a = false, i = l + 1), f2 === 46 ? r === -1 ? r = l : n !== 1 && (n = 1) : r !== -1 && (n = -1);
|
|
299
305
|
}
|
|
300
306
|
return r === -1 || i === -1 || n === 0 || n === 1 && r === i - 1 && r === t + 1 ? "" : e.slice(r, i);
|
|
301
307
|
}, format: function(e) {
|
|
@@ -303,47 +309,46 @@ var k = R((W, w) => {
|
|
|
303
309
|
throw new TypeError('The "pathObject" argument must be of type Object. Received type ' + typeof e);
|
|
304
310
|
return F("/", e);
|
|
305
311
|
}, parse: function(e) {
|
|
306
|
-
|
|
312
|
+
v2(e);
|
|
307
313
|
var r = { root: "", dir: "", base: "", ext: "", name: "" };
|
|
308
314
|
if (e.length === 0)
|
|
309
315
|
return r;
|
|
310
316
|
var t = e.charCodeAt(0), i = t === 47, a;
|
|
311
317
|
i ? (r.root = "/", a = 1) : a = 0;
|
|
312
|
-
for (var n = -1, l = 0,
|
|
313
|
-
if (t = e.charCodeAt(
|
|
318
|
+
for (var n = -1, l = 0, f2 = -1, c = true, d2 = e.length - 1, o = 0;d2 >= a; --d2) {
|
|
319
|
+
if (t = e.charCodeAt(d2), t === 47) {
|
|
314
320
|
if (!c) {
|
|
315
|
-
l =
|
|
321
|
+
l = d2 + 1;
|
|
316
322
|
break;
|
|
317
323
|
}
|
|
318
324
|
continue;
|
|
319
325
|
}
|
|
320
|
-
|
|
326
|
+
f2 === -1 && (c = false, f2 = d2 + 1), t === 46 ? n === -1 ? n = d2 : o !== 1 && (o = 1) : n !== -1 && (o = -1);
|
|
321
327
|
}
|
|
322
|
-
return n === -1 ||
|
|
328
|
+
return n === -1 || f2 === -1 || o === 0 || o === 1 && n === f2 - 1 && n === l + 1 ? f2 !== -1 && (l === 0 && i ? r.base = r.name = e.slice(1, f2) : r.base = r.name = e.slice(l, f2)) : (l === 0 && i ? (r.name = e.slice(1, n), r.base = e.slice(1, f2)) : (r.name = e.slice(l, n), r.base = e.slice(l, f2)), r.ext = e.slice(n, f2)), l > 0 ? r.dir = e.slice(0, l - 1) : i && (r.dir = "/"), r;
|
|
323
329
|
}, sep: "/", delimiter: ":", win32: null, posix: null };
|
|
324
330
|
m.posix = m;
|
|
325
331
|
w.exports = m;
|
|
326
332
|
});
|
|
327
|
-
var x =
|
|
333
|
+
var x = j2(k());
|
|
328
334
|
var u = x;
|
|
329
335
|
var J = x;
|
|
330
336
|
var P = function(s) {
|
|
331
337
|
return s;
|
|
332
338
|
};
|
|
333
|
-
var
|
|
339
|
+
var S2 = function() {
|
|
334
340
|
throw new Error("Not implemented");
|
|
335
341
|
};
|
|
336
|
-
u.parse ??=
|
|
337
|
-
J.parse ??=
|
|
342
|
+
u.parse ??= S2;
|
|
343
|
+
J.parse ??= S2;
|
|
338
344
|
var g = { resolve: u.resolve.bind(u), normalize: u.normalize.bind(u), isAbsolute: u.isAbsolute.bind(u), join: u.join.bind(u), relative: u.relative.bind(u), toNamespacedPath: P, dirname: u.dirname.bind(u), basename: u.basename.bind(u), extname: u.extname.bind(u), format: u.format.bind(u), parse: u.parse.bind(u), sep: "/", delimiter: ":", win32: undefined, posix: undefined, _makeLong: P };
|
|
339
|
-
var
|
|
340
|
-
g.win32 =
|
|
345
|
+
var y2 = { sep: "\\", delimiter: ";", win32: undefined, ...g, posix: g };
|
|
346
|
+
g.win32 = y2.win32 = y2;
|
|
341
347
|
g.posix = g;
|
|
342
|
-
var
|
|
343
|
-
var { resolve: B, normalize: G, isAbsolute: H, join: K, relative:
|
|
348
|
+
var q2 = g;
|
|
349
|
+
var { resolve: B, normalize: G, isAbsolute: H, join: K, relative: Q2, toNamespacedPath: U, dirname: V, basename: X, extname: Y, format: Z, parse: $, sep: I2, delimiter: O } = g;
|
|
344
350
|
|
|
345
351
|
// node_modules/bunfig/dist/index.js
|
|
346
|
-
var {existsSync, mkdirSync, readdirSync, writeFileSync} = (() => ({}));
|
|
347
352
|
init_process();
|
|
348
353
|
function deepMerge(target, source) {
|
|
349
354
|
if (Array.isArray(source) && Array.isArray(target) && source.length === 2 && target.length === 2 && isObject(source[0]) && "id" in source[0] && source[0].id === 3 && isObject(source[1]) && "id" in source[1] && source[1].id === 4) {
|
|
@@ -492,7 +497,7 @@ async function loadConfig({
|
|
|
492
497
|
cwd,
|
|
493
498
|
defaultConfig
|
|
494
499
|
}) {
|
|
495
|
-
const baseDir = cwd ||
|
|
500
|
+
const baseDir = cwd || j.cwd();
|
|
496
501
|
const extensions = [".ts", ".js", ".mjs", ".cjs", ".json"];
|
|
497
502
|
const configPaths = [
|
|
498
503
|
`${name}.config`,
|
|
@@ -511,20 +516,18 @@ async function loadConfig({
|
|
|
511
516
|
console.error("Failed to load client config from any expected location");
|
|
512
517
|
return defaultConfig;
|
|
513
518
|
}
|
|
514
|
-
var defaultConfigDir = B(
|
|
515
|
-
var defaultGeneratedDir = B(
|
|
519
|
+
var defaultConfigDir = B(j.cwd(), "config");
|
|
520
|
+
var defaultGeneratedDir = B(j.cwd(), "src/generated");
|
|
516
521
|
|
|
517
522
|
// src/config.ts
|
|
518
|
-
var __dirname = "/home/runner/work/bun-git-hooks/bun-git-hooks/src";
|
|
519
523
|
var defaultConfig = {
|
|
520
524
|
verbose: true
|
|
521
525
|
};
|
|
522
526
|
var config = await loadConfig({
|
|
523
527
|
name: "git-hooks",
|
|
524
|
-
cwd:
|
|
528
|
+
cwd: j.cwd(),
|
|
525
529
|
defaultConfig
|
|
526
530
|
});
|
|
527
|
-
console.log("cwd", B(__dirname, ".."));
|
|
528
531
|
// src/git-hooks.ts
|
|
529
532
|
var { default: fs} = (() => ({}));
|
|
530
533
|
init_process();
|
|
@@ -571,32 +574,32 @@ if [ -f "$BUN_GIT_HOOKS_RC" ]; then
|
|
|
571
574
|
fi
|
|
572
575
|
|
|
573
576
|
`;
|
|
574
|
-
function getGitProjectRoot(directory =
|
|
577
|
+
function getGitProjectRoot(directory = j.cwd()) {
|
|
575
578
|
if (directory.endsWith(".git")) {
|
|
576
|
-
return
|
|
579
|
+
return q2.normalize(directory);
|
|
577
580
|
}
|
|
578
|
-
let start =
|
|
579
|
-
if (!start || start ===
|
|
581
|
+
let start = q2.normalize(directory);
|
|
582
|
+
if (!start || start === q2.sep || start === ".") {
|
|
580
583
|
return;
|
|
581
584
|
}
|
|
582
|
-
const fullPath =
|
|
585
|
+
const fullPath = q2.join(start, ".git");
|
|
583
586
|
if (fs.existsSync(fullPath)) {
|
|
584
587
|
if (!fs.lstatSync(fullPath).isDirectory()) {
|
|
585
588
|
const content = fs.readFileSync(fullPath, { encoding: "utf-8" });
|
|
586
589
|
const match = /^gitdir: (.*)\s*$/.exec(content);
|
|
587
590
|
if (match) {
|
|
588
591
|
const gitDir = match[1];
|
|
589
|
-
let commonDir =
|
|
592
|
+
let commonDir = q2.join(gitDir, "commondir");
|
|
590
593
|
if (fs.existsSync(commonDir)) {
|
|
591
594
|
commonDir = fs.readFileSync(commonDir, "utf8").trim();
|
|
592
|
-
return
|
|
595
|
+
return q2.resolve(gitDir, commonDir);
|
|
593
596
|
}
|
|
594
|
-
return
|
|
597
|
+
return q2.normalize(gitDir);
|
|
595
598
|
}
|
|
596
599
|
}
|
|
597
|
-
return
|
|
600
|
+
return q2.normalize(fullPath);
|
|
598
601
|
}
|
|
599
|
-
const parentDir =
|
|
602
|
+
const parentDir = q2.dirname(start);
|
|
600
603
|
if (parentDir === start) {
|
|
601
604
|
return;
|
|
602
605
|
}
|
|
@@ -633,66 +636,56 @@ function checkBunGitHooksInDependencies(projectRootPath) {
|
|
|
633
636
|
}
|
|
634
637
|
return "bun-git-hooks" in packageJsonContent.devDependencies;
|
|
635
638
|
}
|
|
636
|
-
function _getPackageJson(projectPath =
|
|
639
|
+
function _getPackageJson(projectPath = j.cwd()) {
|
|
637
640
|
if (typeof projectPath !== "string") {
|
|
638
641
|
throw new TypeError("projectPath is not a string");
|
|
639
642
|
}
|
|
640
|
-
const targetPackageJson =
|
|
643
|
+
const targetPackageJson = q2.normalize(`${projectPath}/package.json`);
|
|
641
644
|
if (!fs.statSync(targetPackageJson).isFile()) {
|
|
642
645
|
throw new Error("Package.json doesn't exist");
|
|
643
646
|
}
|
|
644
647
|
const packageJsonDataRaw = fs.readFileSync(targetPackageJson, { encoding: "utf-8" });
|
|
645
648
|
return { packageJsonContent: JSON.parse(packageJsonDataRaw), packageJsonPath: targetPackageJson };
|
|
646
649
|
}
|
|
647
|
-
function setHooksFromConfig(projectRootPath =
|
|
650
|
+
function setHooksFromConfig(projectRootPath = j.cwd(), options = {}) {
|
|
648
651
|
if (!config || Object.keys(config).length === 0)
|
|
649
652
|
throw new Error("[ERROR] Config was not found! Please add `.git-hooks.config.{ts,js,mjs,cjs,mts,cts,json}` or `git-hooks.config.{ts,js,mjs,cjs,mts,cts,json}` or the `git-hooks` entry in package.json.\r\nCheck README for details");
|
|
650
|
-
console.log("setHooksFromConfig config", config);
|
|
651
653
|
const hookKeys = Object.keys(config).filter((key) => key !== "preserveUnused" && key !== "verbose");
|
|
652
|
-
console.log("hookKeys", hookKeys);
|
|
653
654
|
const isValidConfig = hookKeys.every((key) => VALID_GIT_HOOKS.includes(key));
|
|
654
|
-
console.log("isValidConfig", isValidConfig);
|
|
655
655
|
if (!isValidConfig)
|
|
656
656
|
throw new Error("[ERROR] Config was not in correct format. Please check git hooks or options name");
|
|
657
657
|
const preserveUnused = Array.isArray(config.preserveUnused) ? config.preserveUnused : config.preserveUnused ? VALID_GIT_HOOKS : [];
|
|
658
658
|
for (const hook of VALID_GIT_HOOKS) {
|
|
659
|
-
console.log("hook", hook);
|
|
660
659
|
if (Object.prototype.hasOwnProperty.call(config, hook)) {
|
|
661
|
-
console.log("hook in config");
|
|
662
660
|
if (!config[hook])
|
|
663
661
|
throw new Error(`[ERROR] Command for ${hook} is not set`);
|
|
664
|
-
console.log(`Hook ${hook}: `, config[hook]);
|
|
665
662
|
_setHook(hook, config[hook], projectRootPath);
|
|
666
663
|
} else if (!preserveUnused.includes(hook)) {
|
|
667
|
-
console.log("Remove hook", hook);
|
|
668
664
|
_removeHook(hook, projectRootPath);
|
|
669
665
|
}
|
|
670
666
|
}
|
|
671
667
|
}
|
|
672
|
-
function _setHook(hook, command, projectRoot =
|
|
668
|
+
function _setHook(hook, command, projectRoot = j.cwd()) {
|
|
673
669
|
const gitRoot = getGitProjectRoot(projectRoot);
|
|
674
670
|
if (!gitRoot) {
|
|
675
671
|
console.info("[INFO] No `.git` root folder found, skipping");
|
|
676
672
|
return;
|
|
677
673
|
}
|
|
678
674
|
const hookCommand = PREPEND_SCRIPT + command;
|
|
679
|
-
const hookDirectory =
|
|
680
|
-
const hookPath =
|
|
681
|
-
console.log("hook", { hookPath, hookCommand, hookDirectory });
|
|
675
|
+
const hookDirectory = q2.join(gitRoot, "hooks");
|
|
676
|
+
const hookPath = q2.normalize(q2.join(hookDirectory, hook));
|
|
682
677
|
if (!fs.existsSync(hookDirectory)) {
|
|
683
|
-
console.log("hook folder not exists");
|
|
684
678
|
fs.mkdirSync(hookDirectory, { recursive: true });
|
|
685
679
|
}
|
|
686
|
-
console.log("Create/Write hook");
|
|
687
680
|
fs.writeFileSync(hookPath, hookCommand, { mode: 493 });
|
|
688
681
|
}
|
|
689
|
-
function removeHooks(projectRoot =
|
|
682
|
+
function removeHooks(projectRoot = j.cwd(), verbose = false) {
|
|
690
683
|
for (const configEntry of VALID_GIT_HOOKS)
|
|
691
684
|
_removeHook(configEntry, projectRoot, verbose);
|
|
692
685
|
}
|
|
693
|
-
function _removeHook(hook, projectRoot =
|
|
686
|
+
function _removeHook(hook, projectRoot = j.cwd(), verbose = false) {
|
|
694
687
|
const gitRoot = getGitProjectRoot(projectRoot);
|
|
695
|
-
const hookPath =
|
|
688
|
+
const hookPath = q2.normalize(`${gitRoot}/hooks/${hook}`);
|
|
696
689
|
if (fs.existsSync(hookPath))
|
|
697
690
|
fs.unlinkSync(hookPath);
|
|
698
691
|
if (verbose)
|
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.8",
|
|
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",
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
"module": "./dist/index.js",
|
|
39
39
|
"types": "./dist/index.d.ts",
|
|
40
40
|
"bin": {
|
|
41
|
-
"git-hooks": "./dist/
|
|
42
|
-
"bun-git-hooks": "./dist/
|
|
41
|
+
"git-hooks": "./dist/cli.js",
|
|
42
|
+
"bun-git-hooks": "./dist/cli.js"
|
|
43
43
|
},
|
|
44
44
|
"files": ["README.md", "dist"],
|
|
45
45
|
"scripts": {
|
|
@@ -74,10 +74,10 @@
|
|
|
74
74
|
},
|
|
75
75
|
"devDependencies": {
|
|
76
76
|
"@iconify-json/carbon": "^1.2.8",
|
|
77
|
-
"@shikijs/vitepress-twoslash": "^3.2.
|
|
77
|
+
"@shikijs/vitepress-twoslash": "^3.2.2",
|
|
78
78
|
"@stacksjs/eslint-config": "^4.10.2-beta.3",
|
|
79
|
-
"@types/bun": "^1.2.
|
|
80
|
-
"@types/node": "^22.
|
|
79
|
+
"@types/bun": "^1.2.9",
|
|
80
|
+
"@types/node": "^22.14.0",
|
|
81
81
|
"@vite-pwa/vitepress": "^1.0.0",
|
|
82
82
|
"bumpp": "^10.1.0",
|
|
83
83
|
"bun-plugin-dtsx": "^0.21.9",
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
"cac": "^6.7.14",
|
|
86
86
|
"changelogen": "^0.6.1",
|
|
87
87
|
"lint-staged": "^15.5.0",
|
|
88
|
-
"typescript": "^5.8.
|
|
88
|
+
"typescript": "^5.8.3",
|
|
89
89
|
"unocss": "^66.0.0",
|
|
90
90
|
"unplugin-icons": "^22.1.0",
|
|
91
91
|
"unplugin-vue-components": "^28.4.1",
|
package/dist/bin/config.d.ts
DELETED
package/dist/bin/git-hooks.d.ts
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
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;
|
package/dist/bin/index.d.ts
DELETED
package/dist/bin/types.d.ts
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
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
|
-
}
|