Skip to content

Commit

Permalink
chore: update all deps
Browse files Browse the repository at this point in the history
  • Loading branch information
jorisre committed Jul 3, 2024
1 parent e9c798d commit 5466f6a
Show file tree
Hide file tree
Showing 121 changed files with 722 additions and 8,584 deletions.
33 changes: 0 additions & 33 deletions .eslintrc.js

This file was deleted.

12 changes: 7 additions & 5 deletions .github/workflows/compressedSize.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 9.0
- name: Checkout repo
uses: actions/checkout@v4

- name: Setup bun
uses: oven-sh/setup-bun@v1

- uses: preactjs/compressed-size-action@v2
with:
repo-token: '${{ secrets.GITHUB_TOKEN }}'
install-script: 'bun i'
45 changes: 14 additions & 31 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,30 +20,20 @@ jobs:
- name: Checkout repo
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 9.0
- name: Setup bun
uses: oven-sh/setup-bun@v1

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'

- name: Install dependencies
run: pnpm install
- name: Install Dependencies
run: bun install

- name: Lint
run: |
pnpm lint
pnpm lint:types
- name: Test
run: pnpm test
run: bun lint

- name: TS
run: bun lint:types

- name: Build
run: pnpm build
run: bun run build

publish-module:
name: 'Publish Module to NPM on Node ${{ matrix.node }} and ${{ matrix.os }}'
Expand All @@ -53,22 +43,15 @@ jobs:
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 9.0

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
- name: Setup bun
uses: oven-sh/setup-bun@v1

- name: Install dependencies
run: pnpm install
- name: Install Dependencies
run: bun install

- name: Build
run: pnpm build
run: bun run build

- name: Publish
run: npx semantic-release
Expand Down
1 change: 0 additions & 1 deletion .husky/.gitignore

This file was deleted.

60 changes: 57 additions & 3 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,5 +1,59 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

pnpm lint:types
pnpm lint-staged
if [ "$LEFTHOOK_VERBOSE" = "1" -o "$LEFTHOOK_VERBOSE" = "true" ]; then
set -x
fi

if [ "$LEFTHOOK" = "0" ]; then
exit 0
fi

call_lefthook()
{
if test -n "$LEFTHOOK_BIN"
then
"$LEFTHOOK_BIN" "$@"
elif lefthook -h >/dev/null 2>&1
then
lefthook "$@"
else
dir="$(git rev-parse --show-toplevel)"
if test -f "$dir/node_modules/lefthook/bin/index.js"
then
"$dir/node_modules/lefthook/bin/index.js" "$@"
else
osArch=$(uname | tr '[:upper:]' '[:lower:]')
cpuArch=$(uname -m | sed 's/aarch64/arm64/')
if test -f "$dir/node_modules/@evilmartians/lefthook/bin/lefthook_${osArch}_${cpuArch}/lefthook"
then
"$dir/node_modules/@evilmartians/lefthook/bin/lefthook_${osArch}_${cpuArch}/lefthook" "$@"
elif test -f "$dir/node_modules/@evilmartians/lefthook-installer/bin/lefthook_${osArch}_${cpuArch}/lefthook"
then
"$dir/node_modules/@evilmartians/lefthook-installer/bin/lefthook_${osArch}_${cpuArch}/lefthook" "$@"

elif bundle exec lefthook -h >/dev/null 2>&1
then
bundle exec lefthook "$@"
elif yarn lefthook -h >/dev/null 2>&1
then
yarn lefthook "$@"
elif pnpm lefthook -h >/dev/null 2>&1
then
pnpm lefthook "$@"
elif swift package plugin lefthook >/dev/null 2>&1
then
swift package --disable-sandbox plugin lefthook "$@"
elif command -v mint >/dev/null 2>&1
then
mint run csjones/lefthook-plugin "$@"
elif command -v npx >/dev/null 2>&1
then
npx lefthook "$@"
else
echo "Can't find lefthook in PATH"
fi
fi
fi
}

call_lefthook run "pre-commit" "$@"
59 changes: 59 additions & 0 deletions .husky/prepare-commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
#!/bin/sh

if [ "$LEFTHOOK_VERBOSE" = "1" -o "$LEFTHOOK_VERBOSE" = "true" ]; then
set -x
fi

if [ "$LEFTHOOK" = "0" ]; then
exit 0
fi

call_lefthook()
{
if test -n "$LEFTHOOK_BIN"
then
"$LEFTHOOK_BIN" "$@"
elif lefthook -h >/dev/null 2>&1
then
lefthook "$@"
else
dir="$(git rev-parse --show-toplevel)"
if test -f "$dir/node_modules/lefthook/bin/index.js"
then
"$dir/node_modules/lefthook/bin/index.js" "$@"
else
osArch=$(uname | tr '[:upper:]' '[:lower:]')
cpuArch=$(uname -m | sed 's/aarch64/arm64/')
if test -f "$dir/node_modules/@evilmartians/lefthook/bin/lefthook_${osArch}_${cpuArch}/lefthook"
then
"$dir/node_modules/@evilmartians/lefthook/bin/lefthook_${osArch}_${cpuArch}/lefthook" "$@"
elif test -f "$dir/node_modules/@evilmartians/lefthook-installer/bin/lefthook_${osArch}_${cpuArch}/lefthook"
then
"$dir/node_modules/@evilmartians/lefthook-installer/bin/lefthook_${osArch}_${cpuArch}/lefthook" "$@"

elif bundle exec lefthook -h >/dev/null 2>&1
then
bundle exec lefthook "$@"
elif yarn lefthook -h >/dev/null 2>&1
then
yarn lefthook "$@"
elif pnpm lefthook -h >/dev/null 2>&1
then
pnpm lefthook "$@"
elif swift package plugin lefthook >/dev/null 2>&1
then
swift package --disable-sandbox plugin lefthook "$@"
elif command -v mint >/dev/null 2>&1
then
mint run csjones/lefthook-plugin "$@"
elif command -v npx >/dev/null 2>&1
then
npx lefthook "$@"
else
echo "Can't find lefthook in PATH"
fi
fi
fi
}

call_lefthook run "prepare-commit-msg" "$@"
10 changes: 5 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,21 @@ Here is a quick guide to doing code contributions to the library.

3. Install packages by running:

> pnpm install
> bun install
4. If you've added a code that should be tested, ensure the test suite still passes.

> pnpm test
> bun test
5. Try to write some unit tests to cover as much of your code as possible.

6. Ensure your code lints without errors.

> pnpm lint
> bun lint
7. Ensure build passes.

> pnpm build
> bun run build
8. Push your branch: `git push -u origin your-meaningful-branch-name`

Expand All @@ -36,7 +36,7 @@ Here is a quick guide to doing code contributions to the library.

## Coding style

Please follow the coding style of the project. React Hook Form uses eslint and prettier. If possible, enable their respective plugins in your editor to get real-time feedback. The linting can be run manually with the following command: `pnpm lint`
Please follow the coding style of the project. React Hook Form uses eslint and prettier. If possible, enable their respective plugins in your editor to get real-time feedback. The linting can be run manually with the following command: `bun lint`

## License

Expand Down
8 changes: 7 additions & 1 deletion ajv/src/__tests__/ajv.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
import { ajvResolver } from '..';
import { fields, invalidData, invalidDataWithUndefined, schema, validData } from './__fixtures__/data';
import {
fields,
invalidData,
invalidDataWithUndefined,
schema,
validData,
} from './__fixtures__/data';

const shouldUseNativeValidation = false;

Expand Down
2 changes: 1 addition & 1 deletion ajv/src/ajv.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { toNestErrors, validateFieldsNatively } from '@hookform/resolvers';
import Ajv, { DefinedError } from 'ajv';
import ajvErrors from 'ajv-errors';
import { appendErrors, FieldError } from 'react-hook-form';
import { FieldError, appendErrors } from 'react-hook-form';
import { Resolver } from './types';

const parseErrorSchema = (
Expand Down
6 changes: 1 addition & 5 deletions ajv/src/types.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import {
FieldValues,
ResolverOptions,
ResolverResult,
} from 'react-hook-form';
import * as Ajv from 'ajv';
import { FieldValues, ResolverOptions, ResolverResult } from 'react-hook-form';

export type Resolver = <T>(
schema: Ajv.JSONSchemaType<T>,
Expand Down
10 changes: 5 additions & 5 deletions arktype/src/__tests__/Form-native-validation.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React from 'react';
import { useForm } from 'react-hook-form';
import { render, screen } from '@testing-library/react';
import user from '@testing-library/user-event';
import { arktypeResolver } from '..';
import { type } from 'arktype';
import React from 'react';
import { useForm } from 'react-hook-form';
import { arktypeResolver } from '..';

const schema = type({
username: 'string>1',
Expand Down Expand Up @@ -57,14 +57,14 @@ test("form's native validation with Zod", async () => {
usernameField = screen.getByPlaceholderText(/username/i) as HTMLInputElement;
expect(usernameField.validity.valid).toBe(false);
expect(usernameField.validationMessage).toBe(
'username must be more than length 1 (was 0)',
'username must be more than length 1',
);

// password
passwordField = screen.getByPlaceholderText(/password/i) as HTMLInputElement;
expect(passwordField.validity.valid).toBe(false);
expect(passwordField.validationMessage).toBe(
'password must be more than length 1 (was 0)',
'password must be more than length 1',
);

await user.type(screen.getByPlaceholderText(/username/i), 'joe');
Expand Down
4 changes: 2 additions & 2 deletions arktype/src/__tests__/Form.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React from 'react';
import { render, screen } from '@testing-library/react';
import user from '@testing-library/user-event';
import { type } from 'arktype';
import React from 'react';
import { useForm } from 'react-hook-form';
import { arktypeResolver } from '..';
import { type } from 'arktype';

const schema = type({
username: 'string>1',
Expand Down
2 changes: 1 addition & 1 deletion arktype/src/__tests__/__fixtures__/data.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Field, InternalFieldName } from 'react-hook-form';
import { type } from 'arktype';
import { Field, InternalFieldName } from 'react-hook-form';

export const schema = type({
username: 'string>2',
Expand Down
Loading

0 comments on commit 5466f6a

Please sign in to comment.