Skip to content

Commit 9a94555

Browse files
authored
chore: update dependencies (#736)
* chore: update dependencies * doc
1 parent 3da2054 commit 9a94555

File tree

14 files changed

+178
-562
lines changed

14 files changed

+178
-562
lines changed

.husky/pre-commit

+29-31
Original file line numberDiff line numberDiff line change
@@ -18,40 +18,38 @@ call_lefthook()
1818
lefthook "$@"
1919
else
2020
dir="$(git rev-parse --show-toplevel)"
21-
if test -f "$dir/node_modules/lefthook/bin/index.js"
21+
osArch=$(uname | tr '[:upper:]' '[:lower:]')
22+
cpuArch=$(uname -m | sed 's/aarch64/arm64/;s/x86_64/x64/')
23+
if test -f "$dir/node_modules/lefthook-${osArch}-${cpuArch}/bin/lefthook"
24+
then
25+
"$dir/node_modules/lefthook-${osArch}-${cpuArch}/bin/lefthook" "$@"
26+
elif test -f "$dir/node_modules/@evilmartians/lefthook/bin/lefthook-${osArch}-${cpuArch}/lefthook"
27+
then
28+
"$dir/node_modules/@evilmartians/lefthook/bin/lefthook-${osArch}-${cpuArch}/lefthook" "$@"
29+
elif test -f "$dir/node_modules/@evilmartians/lefthook-installer/bin/lefthook"
30+
then
31+
"$dir/node_modules/@evilmartians/lefthook-installer/bin/lefthook" "$@"
32+
elif test -f "$dir/node_modules/lefthook/bin/index.js"
2233
then
2334
"$dir/node_modules/lefthook/bin/index.js" "$@"
35+
36+
elif bundle exec lefthook -h >/dev/null 2>&1
37+
then
38+
bundle exec lefthook "$@"
39+
elif yarn lefthook -h >/dev/null 2>&1
40+
then
41+
yarn lefthook "$@"
42+
elif pnpm lefthook -h >/dev/null 2>&1
43+
then
44+
pnpm lefthook "$@"
45+
elif swift package plugin lefthook >/dev/null 2>&1
46+
then
47+
swift package --disable-sandbox plugin lefthook "$@"
48+
elif command -v mint >/dev/null 2>&1
49+
then
50+
mint run csjones/lefthook-plugin "$@"
2451
else
25-
osArch=$(uname | tr '[:upper:]' '[:lower:]')
26-
cpuArch=$(uname -m | sed 's/aarch64/arm64/')
27-
if test -f "$dir/node_modules/@evilmartians/lefthook/bin/lefthook_${osArch}_${cpuArch}/lefthook"
28-
then
29-
"$dir/node_modules/@evilmartians/lefthook/bin/lefthook_${osArch}_${cpuArch}/lefthook" "$@"
30-
elif test -f "$dir/node_modules/@evilmartians/lefthook-installer/bin/lefthook_${osArch}_${cpuArch}/lefthook"
31-
then
32-
"$dir/node_modules/@evilmartians/lefthook-installer/bin/lefthook_${osArch}_${cpuArch}/lefthook" "$@"
33-
34-
elif bundle exec lefthook -h >/dev/null 2>&1
35-
then
36-
bundle exec lefthook "$@"
37-
elif yarn lefthook -h >/dev/null 2>&1
38-
then
39-
yarn lefthook "$@"
40-
elif pnpm lefthook -h >/dev/null 2>&1
41-
then
42-
pnpm lefthook "$@"
43-
elif swift package plugin lefthook >/dev/null 2>&1
44-
then
45-
swift package --disable-sandbox plugin lefthook "$@"
46-
elif command -v mint >/dev/null 2>&1
47-
then
48-
mint run csjones/lefthook-plugin "$@"
49-
elif command -v npx >/dev/null 2>&1
50-
then
51-
npx lefthook "$@"
52-
else
53-
echo "Can't find lefthook in PATH"
54-
fi
52+
echo "Can't find lefthook in PATH"
5553
fi
5654
fi
5755
}

.husky/prepare-commit-msg

+29-31
Original file line numberDiff line numberDiff line change
@@ -18,40 +18,38 @@ call_lefthook()
1818
lefthook "$@"
1919
else
2020
dir="$(git rev-parse --show-toplevel)"
21-
if test -f "$dir/node_modules/lefthook/bin/index.js"
21+
osArch=$(uname | tr '[:upper:]' '[:lower:]')
22+
cpuArch=$(uname -m | sed 's/aarch64/arm64/;s/x86_64/x64/')
23+
if test -f "$dir/node_modules/lefthook-${osArch}-${cpuArch}/bin/lefthook"
24+
then
25+
"$dir/node_modules/lefthook-${osArch}-${cpuArch}/bin/lefthook" "$@"
26+
elif test -f "$dir/node_modules/@evilmartians/lefthook/bin/lefthook-${osArch}-${cpuArch}/lefthook"
27+
then
28+
"$dir/node_modules/@evilmartians/lefthook/bin/lefthook-${osArch}-${cpuArch}/lefthook" "$@"
29+
elif test -f "$dir/node_modules/@evilmartians/lefthook-installer/bin/lefthook"
30+
then
31+
"$dir/node_modules/@evilmartians/lefthook-installer/bin/lefthook" "$@"
32+
elif test -f "$dir/node_modules/lefthook/bin/index.js"
2233
then
2334
"$dir/node_modules/lefthook/bin/index.js" "$@"
35+
36+
elif bundle exec lefthook -h >/dev/null 2>&1
37+
then
38+
bundle exec lefthook "$@"
39+
elif yarn lefthook -h >/dev/null 2>&1
40+
then
41+
yarn lefthook "$@"
42+
elif pnpm lefthook -h >/dev/null 2>&1
43+
then
44+
pnpm lefthook "$@"
45+
elif swift package plugin lefthook >/dev/null 2>&1
46+
then
47+
swift package --disable-sandbox plugin lefthook "$@"
48+
elif command -v mint >/dev/null 2>&1
49+
then
50+
mint run csjones/lefthook-plugin "$@"
2451
else
25-
osArch=$(uname | tr '[:upper:]' '[:lower:]')
26-
cpuArch=$(uname -m | sed 's/aarch64/arm64/')
27-
if test -f "$dir/node_modules/@evilmartians/lefthook/bin/lefthook_${osArch}_${cpuArch}/lefthook"
28-
then
29-
"$dir/node_modules/@evilmartians/lefthook/bin/lefthook_${osArch}_${cpuArch}/lefthook" "$@"
30-
elif test -f "$dir/node_modules/@evilmartians/lefthook-installer/bin/lefthook_${osArch}_${cpuArch}/lefthook"
31-
then
32-
"$dir/node_modules/@evilmartians/lefthook-installer/bin/lefthook_${osArch}_${cpuArch}/lefthook" "$@"
33-
34-
elif bundle exec lefthook -h >/dev/null 2>&1
35-
then
36-
bundle exec lefthook "$@"
37-
elif yarn lefthook -h >/dev/null 2>&1
38-
then
39-
yarn lefthook "$@"
40-
elif pnpm lefthook -h >/dev/null 2>&1
41-
then
42-
pnpm lefthook "$@"
43-
elif swift package plugin lefthook >/dev/null 2>&1
44-
then
45-
swift package --disable-sandbox plugin lefthook "$@"
46-
elif command -v mint >/dev/null 2>&1
47-
then
48-
mint run csjones/lefthook-plugin "$@"
49-
elif command -v npx >/dev/null 2>&1
50-
then
51-
npx lefthook "$@"
52-
else
53-
echo "Can't find lefthook in PATH"
54-
fi
52+
echo "Can't find lefthook in PATH"
5553
fi
5654
fi
5755
}

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818

1919
## Install
2020

21+
Install your preferred validation library alongside `@hookform/resolvers`.
22+
2123
npm install @hookform/resolvers
2224

2325
## Links

arktype/src/__tests__/Form-native-validation.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ function TestComponent({ onSubmit }: Props) {
3333
);
3434
}
3535

36-
test("form's native validation with Zod", async () => {
36+
test("form's native validation with Arktype", async () => {
3737
const handleSubmit = vi.fn();
3838
render(<TestComponent onSubmit={handleSubmit} />);
3939

@@ -57,14 +57,14 @@ test("form's native validation with Zod", async () => {
5757
usernameField = screen.getByPlaceholderText(/username/i) as HTMLInputElement;
5858
expect(usernameField.validity.valid).toBe(false);
5959
expect(usernameField.validationMessage).toBe(
60-
'username must be more than length 1',
60+
'username must be at least length 2',
6161
);
6262

6363
// password
6464
passwordField = screen.getByPlaceholderText(/password/i) as HTMLInputElement;
6565
expect(passwordField.validity.valid).toBe(false);
6666
expect(passwordField.validationMessage).toBe(
67-
'password must be more than length 1',
67+
'password must be at least length 2',
6868
);
6969

7070
await user.type(screen.getByPlaceholderText(/username/i), 'joe');

arktype/src/__tests__/Form.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ test("form's validation with arkType and TypeScript's integration", async () =>
4747
await user.click(screen.getByText(/submit/i));
4848

4949
expect(
50-
screen.getByText('username must be more than length 1'),
50+
screen.getByText('username must be at least length 2'),
5151
).toBeInTheDocument();
5252
expect(
53-
screen.getByText('password must be more than length 1'),
53+
screen.getByText('password must be at least length 2'),
5454
).toBeInTheDocument();
5555
expect(handleSubmit).not.toHaveBeenCalled();
5656
});

arktype/src/__tests__/__fixtures__/data.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export const schema = type({
77
repeatPassword: 'string>1',
88
accessToken: 'string|number',
99
birthYear: '1900<number<2013',
10-
email: 'email',
10+
email: 'string.email',
1111
tags: 'string[]',
1212
enabled: 'boolean',
1313
url: 'string>1',

0 commit comments

Comments
 (0)