Skip to content

Commit fe53179

Browse files
authored
V2 🚀 (#108)
* feat: V2 init BREAKING CHANGE: there will be some breaking changes in the next versions * feat: improve modules support * fix: yup resolver typescript errors * Fix: vest validate all criteria + better TypeSript support + add tests * test: add components test to ensure TypeScript is working as expected Related to #97 * chore: improve zod resolvers types * chore(eslint): remove warnings * test: add severals tests & improve typings * chore: setup compressed-size * test: update describe * feat: add Zod sync validation (#114) * feat: add Joi sync validation (#116) * feat: add Joi sync validation * fix(joi): sync error * test: add validateAllCriteria test * test(joi): update test description * feat: add Yup sync validation (#115) * feat: add Yup sync validation * test(zod): add tests * test(zod): update tests * test(yup): add validateAllCriteria test * feat: add Vest sync validation + update to v3 (#117) * feat: update to react-hook-form v7 BREAKING CHANGE: Require react-hook-form >= 7 * chore: fix typescript error (#123) * chore: update deps * chore: fix TypeScript error * refactor: replace deprecated transformToNestObject (#125) * fix: pass down Joi context (#124) * fix: zod union error + reduce size (#126) * test: extract fixtures * fix: zod resolver union error + reduce resolver size * feat: add error's ref (#127) * feat: add error's ref * test: add error's ref + extract fixtures * test: add nested test * refactor: rename toNestObject to toNestError * Reduce superstruct resolver size (#128) * test: extract test's fixtures * test: jest fixtures config * perf: reduce superstruct resolver size * feat: add error's ref * test: add error's ref + extract fixtures * test: add nested test * refactor: rename toNestObject to toNestError * refactor: remove duplicate line * chore: update superstruct peer dep * perf: reduce vest resolver size (#129) * test: extract test's fixtures * test: jest fixtures config * perf: reduce superstruct resolver size * feat: add error's ref * test: add error's ref + extract fixtures * test: add nested test * refactor: rename toNestObject to toNestError * refactor: remove duplicate line * perf: recude vest resolver bundle size * perf: reduce joi resolver's size (#131) * perf: reduce Joi resolver's size * perf: reduce Vest resolver's size * perf: reduce yup resolver's size (#130) * refactor: remove convertArrayToPathName (#132) * perf: reduce joi and yup bundle size (#134) * fix(types): add Lazy schema support to resolver * docs: v2 doc (#136)
1 parent 5672e65 commit fe53179

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+3609
-2752
lines changed

.github/FUNDING.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# These are supported funding model platforms
2+
3+
github: [bluebill1049, jorisre]
4+
patreon: bluebill1049
5+
open_collective: react-hook-form
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
---
8+
9+
**Describe the bug**
10+
A clear and concise description of what the bug is.
11+
12+
**To Reproduce**
13+
Steps to reproduce the behavior:
14+
15+
1. Go to '...'
16+
2. Click on '....'
17+
3. Scroll down to '....'
18+
4. See error
19+
20+
**Codesandbox link (Required)**
21+
Include a codesandbox will help us to investigate the issue quicker.
22+
23+
- [Yup resolver](https://codesandbox.io/s/react-hook-form-validationschema-v6-2l77g) Template
24+
- [Zod resolver](https://codesandbox.io/s/react-hook-form-zod-resolver-example-forked-ko5ll) Template
25+
- [Joi resolver](https://codesandbox.io/s/react-hook-form-joiresolver-v6-yejqe) Template
26+
- [Superstruct resolver](https://codesandbox.io/s/react-hook-form-v6-superstructresolver-ed67i) Template
27+
- [Vest resolver](https://codesandbox.io/s/vest-k6gbd) Template
28+
- [Custom resolver](https://codesandbox.io/s/react-hook-form-customresoliver-v6-h4ti6) Template
29+
30+
**Expected behavior**
31+
A clear and concise description of what you expected to happen.
32+
33+
**Screenshots**
34+
If applicable, add screenshots to help explain your problem.
35+
36+
**Desktop (please complete the following information):**
37+
38+
- OS: [e.g. iOS]
39+
- Browser [e.g. chrome, safari]
40+
- Version [e.g. 22]
41+
42+
**Smartphone (please complete the following information):**
43+
44+
- Device: [e.g. iPhone6]
45+
- OS: [e.g. iOS8.1]
46+
- Browser [e.g. stock browser, safari]
47+
- Version [e.g. 22]
48+
49+
**Additional context**
50+
Add any other context about the problem here.

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: Ask a question
4+
url: https://github.com/react-hook-form/react-hook-form/discussions
5+
about: Ask questions and discuss with other community members
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
---
8+
9+
**Is your feature request related to a problem? Please describe.**
10+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
11+
12+
**Describe the solution you'd like**
13+
A clear and concise description of what you want to happen.
14+
15+
**Describe alternatives you've considered**
16+
A clear and concise description of any alternative solutions or features you've considered.
17+
18+
**Additional context**
19+
Add any other context or screenshots about the feature request here.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Fixes #
2+
3+
## Proposed Changes
4+
5+
-
6+
-
7+
-
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: Compressed Size
2+
3+
on: [pull_request]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- uses: actions/checkout@v2
11+
- uses: preactjs/compressed-size-action@v2
12+
with:
13+
repo-token: '${{ secrets.GITHUB_TOKEN }}'

.github/workflows/main.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ on:
33
push:
44
branches:
55
- master
6+
- beta
67
pull_request:
78
paths-ignore:
89
- '.gitignore'
@@ -40,7 +41,7 @@ jobs:
4041
publish-module:
4142
name: 'Publish Module to NPM on Node ${{ matrix.node }} and ${{ matrix.os }}'
4243
needs: build
43-
if: github.repository == 'react-hook-form/resolvers' && (github.ref =='refs/heads/master')
44+
if: github.repository == 'react-hook-form/resolvers' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/beta')
4445
runs-on: ubuntu-latest
4546
steps:
4647
- name: Checkout repo

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ dist
2828
.idea/
2929
.rpt2_cache
3030
.coveralls.yml
31-
package-lock.json
31+
package-lock.json

.vscode/settings.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
"typescriptreact"
77
],
88
"prettier.configPath": "./.prettierrc",
9-
"eslint.enable": true,
109
"editor.formatOnSave": true,
1110
"editor.codeActionsOnSave": {
1211
"source.fixAll.eslint": true

CODE_OF_CONDUCT.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as
6+
contributors and maintainers pledge to making participation in our project and
7+
our community a harassment-free experience for everyone, regardless of age, body
8+
size, disability, ethnicity, sex characteristics, gender identity and expression,
9+
level of experience, education, socio-economic status, nationality, personal
10+
appearance, race, religion, or sexual identity and orientation.
11+
12+
## Our Standards
13+
14+
Examples of behavior that contributes to creating a positive environment
15+
include:
16+
17+
- Using welcoming and inclusive language
18+
- Being respectful of differing viewpoints and experiences
19+
- Gracefully accepting constructive criticism
20+
- Focusing on what is best for the community
21+
- Showing empathy towards other community members
22+
23+
Examples of unacceptable behavior by participants include:
24+
25+
- The use of sexualized language or imagery and unwelcome sexual attention or
26+
advances
27+
- Trolling, insulting/derogatory comments, and personal or political attacks
28+
- Public or private harassment
29+
- Publishing others' private information, such as a physical or electronic
30+
address, without explicit permission
31+
- Other conduct which could reasonably be considered inappropriate in a
32+
professional setting
33+
34+
## Our Responsibilities
35+
36+
Project maintainers are responsible for clarifying the standards of acceptable
37+
behavior and are expected to take appropriate and fair corrective action in
38+
response to any instances of unacceptable behavior.
39+
40+
Project maintainers have the right and responsibility to remove, edit, or
41+
reject comments, commits, code, wiki edits, issues, and other contributions
42+
that are not aligned to this Code of Conduct, or to ban temporarily or
43+
permanently any contributor for other behaviors that they deem inappropriate,
44+
threatening, offensive, or harmful.
45+
46+
## Scope
47+
48+
This Code of Conduct applies both within project spaces and in public spaces
49+
when an individual is representing the project or its community. Examples of
50+
representing a project or community include using an official project e-mail
51+
address, posting via an official social media account, or acting as an appointed
52+
representative at an online or offline event. Representation of a project may be
53+
further defined and clarified by project maintainers.
54+
55+
## Enforcement
56+
57+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
58+
reported by contacting the project team at [email protected]. All
59+
complaints will be reviewed and investigated and will result in a response that
60+
is deemed necessary and appropriate to the circumstances. The project team is
61+
obligated to maintain confidentiality with regard to the reporter of an incident.
62+
Further details of specific enforcement policies may be posted separately.
63+
64+
Project maintainers who do not follow or enforce the Code of Conduct in good
65+
faith may face temporary or permanent repercussions as determined by other
66+
members of the project's leadership.
67+
68+
## Attribution
69+
70+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71+
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72+
73+
[homepage]: https://www.contributor-covenant.org
74+
75+
For answers to common questions about this code of conduct, see
76+
https://www.contributor-covenant.org/faq

0 commit comments

Comments
 (0)