Skip to content

Commit 6ba2b0a

Browse files
authored
📦 Core (#1)
* first version * update readme * update with unit tests * fix path * update with lint * github actions * fix build * api extrator * add missing package * change path * include missing config * update api extrator * add reports
1 parent aad0d5a commit 6ba2b0a

File tree

183 files changed

+18431
-0
lines changed

Some content is hidden

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

183 files changed

+18431
-0
lines changed

.eslintignore

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/app
2+
/examples
3+
/node_modules
4+
/dist
5+
/coverage
6+
/src/types/global.d.ts
7+
!.*.js
8+
/reports
9+
/scripts/README

.eslintrc

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
{
2+
"parser": "@typescript-eslint/parser",
3+
"plugins": ["@typescript-eslint", "simple-import-sort"],
4+
"extends": [
5+
"plugin:@typescript-eslint/recommended",
6+
"plugin:prettier/recommended"
7+
],
8+
"parserOptions": {
9+
"ecmaVersion": 2020,
10+
"sourceType": "module",
11+
"ecmaFeatures": {
12+
"jsx": true
13+
}
14+
},
15+
"rules": {
16+
"curly": "error",
17+
"no-extra-boolean-cast": "error",
18+
"@typescript-eslint/no-non-null-assertion": "off",
19+
"@typescript-eslint/no-empty-function": "off",
20+
"@typescript-eslint/ban-ts-comment": "warn",
21+
"@typescript-eslint/ban-types": "off",
22+
"@typescript-eslint/no-explicit-any": "off",
23+
"@typescript-eslint/explicit-module-boundary-types": "off",
24+
"@typescript-eslint/no-object-literal-type-assertion": "off",
25+
"@typescript-eslint/no-unused-vars": [
26+
"warn",
27+
{ "ignoreRestSiblings": true }
28+
],
29+
"no-console": ["error"],
30+
"simple-import-sort/imports": [
31+
"error",
32+
{
33+
"groups": [
34+
// Side effect imports.
35+
["^\\u0000"],
36+
// Parent imports. Put `..` last.
37+
["^\\.\\.(?!/?$)", "^\\.\\./?$"],
38+
// Other relative imports. Put same-folder imports and `.` last.
39+
["^\\./(?=.*/)(?!/?$)", "^\\.(?!/?$)", "^\\./?$"]
40+
]
41+
}
42+
],
43+
"simple-import-sort/exports": "error"
44+
},
45+
"overrides": [
46+
{
47+
"files": ["*.test.ts", "*.test.tsx"],
48+
"rules": {
49+
// Allow testing runtime errors to suppress TS errors
50+
"@typescript-eslint/ban-ts-comment": "off"
51+
}
52+
}
53+
]
54+
}

.github/FUNDING.yml

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# These are supported funding model platforms
2+
3+
github: [bluebill1049]
4+
open_collective: react-hook-form
5+
custom: https://youtube.com/@bluebill1049

.github/ISSUE_TEMPLATE/bug_report.yml

+75
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: Bug Report
2+
description: File a bug report
3+
title: 'issue: '
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: |
8+
Thanks for taking the time to fill out this bug report!
9+
- type: input
10+
id: version
11+
attributes:
12+
label: Version Number
13+
description: What's the version number?
14+
placeholder: Version number.
15+
validations:
16+
required: true
17+
- type: input
18+
id: codesandbox
19+
attributes:
20+
label: Codesandbox/Expo snack
21+
description: Codesandbox/Expo snack link
22+
validations:
23+
required: true
24+
- type: markdown
25+
attributes:
26+
value: |
27+
V7
28+
- [JS](https://codesandbox.io/s/great-paper-deove) Template
29+
- [TS](https://codesandbox.io/s/eager-sun-jt4df) Template
30+
31+
V6
32+
- [JS](https://codesandbox.io/s/mystifying-keller-5jwf5) Template
33+
- [TS](https://codesandbox.io/s/romantic-moon-0chz7) Template
34+
- type: textarea
35+
id: what-happened
36+
attributes:
37+
label: Steps to reproduce
38+
placeholder: Tell us what you see!
39+
value: |
40+
1. Go to '...'
41+
2. Click on '....'
42+
3. Scroll down to '....'
43+
4. See error
44+
validations:
45+
required: true
46+
- type: textarea
47+
id: what-expect
48+
attributes:
49+
label: Expected behaviour
50+
validations:
51+
required: true
52+
- type: dropdown
53+
id: browsers
54+
attributes:
55+
label: What browsers are you seeing the problem on?
56+
multiple: true
57+
options:
58+
- Firefox
59+
- Chrome
60+
- Safari
61+
- Edge
62+
- type: textarea
63+
id: logs
64+
attributes:
65+
label: Relevant log output
66+
description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks.
67+
render: shell
68+
- type: checkboxes
69+
id: terms
70+
attributes:
71+
label: Code of Conduct
72+
description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/react-hook-form/react-hook-form/blob/master/CODE_OF_CONDUCT.md)
73+
options:
74+
- label: I agree to follow this project's Code of Conduct
75+
required: true

.github/ISSUE_TEMPLATE/config.yml

+5
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
+19
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: 'feature request, waiting-up-vote'
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.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Pull Request Template
2+
3+
## Proposed Changes
4+
5+
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
6+
7+
Fixes # (issue)
8+
9+
## Type of change
10+
11+
Please delete options that are not relevant.
12+
13+
- [ ] Bug fix (non-breaking change which fixes an issue)
14+
- [ ] New feature (non-breaking change which adds functionality)
15+
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
16+
- [ ] This change requires a documentation update
17+
18+
## Checklist:
19+
20+
- [ ] My code follows the style guidelines of this project
21+
- [ ] I have performed a self-review of my own code
22+
- [ ] My changes generate no new warnings
23+
- [ ] I have added tests that prove my fix is effective or that my feature works
24+
- [ ] New and existing tests pass locally with my changes

.github/stale.yml

+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# Configuration for probot-stale - https://github.com/probot/stale
2+
3+
# Number of days of inactivity before an Issue or Pull Request becomes stale
4+
daysUntilStale: 30
5+
6+
# Number of days of inactivity before an Issue or Pull Request with the stale label is closed.
7+
# Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale.
8+
daysUntilClose: 10
9+
10+
# Only issues or pull requests with all of these labels are check if stale. Defaults to `[]` (disabled)
11+
onlyLabels: []
12+
13+
# Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable
14+
exemptLabels:
15+
- waiting-up-vote
16+
- question
17+
- pinned
18+
- security
19+
- 'Status: under investigation'
20+
- 'status: working in progress'
21+
22+
# Set to true to ignore issues in a project (defaults to false)
23+
exemptProjects: false
24+
25+
# Set to true to ignore issues in a milestone (defaults to false)
26+
exemptMilestones: false
27+
28+
# Set to true to ignore issues with an assignee (defaults to false)
29+
exemptAssignees: false
30+
31+
# Label to use when marking as stale
32+
staleLabel: stale
33+
34+
# Comment to post when marking as stale. Set to `false` to disable
35+
markComment: >
36+
Thank you for your contributions! This Pull Request has been automatically marked as stale
37+
because it has not had any recent activity. It will be closed if no further activity occurs.
38+
Best, RHF Team ❤️
39+
40+
# Comment to post when removing the stale label.
41+
# unmarkComment: >
42+
# Your comment here.
43+
44+
# Comment to post when closing a stale Issue or Pull Request.
45+
closeComment: >
46+
Thank you for your contributions! This Pull Request is being closed because it has
47+
not had any recent activity. Feel free to re-open the issue and begin work again!
48+
Best, RHF Team ❤️
49+
50+
# Limit the number of actions per hour, from 1-30. Default is 30
51+
limitPerRun: 10
52+
53+
# Limit to only `issues` or `pulls`
54+
only: pulls
55+
# Optionally, specify configuration settings that are specific to just 'issues' or 'pulls':
56+
# pulls:
57+
# daysUntilStale: 30
58+
# markComment: >
59+
# This pull request has been automatically marked as stale because it has not had
60+
# recent activity. It will be closed if no further activity occurs. Thank you
61+
# for your contributions.
62+
63+
# issues:
64+
# exemptLabels:
65+
# - confirmed

.github/workflows/README.yml

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name : README
2+
3+
on:
4+
pull_request:
5+
types : [ opened , synchronize ]
6+
paths:
7+
- docs/Helpers.yaml
8+
- docs/Sponsors.yaml
9+
- docs/Template.md
10+
11+
jobs:
12+
Update-README:
13+
runs-on : ubuntu-latest
14+
steps:
15+
16+
- uses : denoland/setup-deno@v1
17+
with:
18+
deno-version : 1.23.4
19+
20+
- uses : actions/checkout@v3
21+
with:
22+
repository: ${{ github.event.pull_request.head.repo.full_name }}
23+
ref: ${{ github.event.pull_request.head.ref }}
24+
25+
- name : Run README updater
26+
run : 'deno run
27+
--allow-read
28+
--allow-write
29+
--importmap=scripts/README/Imports.json
30+
scripts/README/Updater.js'
31+
32+
- name : Commit generated README
33+
uses : EndBug/add-and-commit@v9
34+
with:
35+
default_author : github_actor
36+
message : 'Regenerated README'
37+
add: 'README.md'

.github/workflows/api-extrator.yml

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: API Extrator
2+
3+
on: [pull_request]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
matrix:
10+
# Do we want to run with multiple versions of node?
11+
node-version: [16]
12+
13+
steps:
14+
- name: Checkout repo
15+
uses: actions/checkout@v3
16+
17+
- name: Setup pnpm
18+
uses: pnpm/action-setup@v2
19+
with:
20+
version: 7
21+
22+
- name: Use Node.js ${{ matrix.node-version }}
23+
uses: actions/setup-node@v3
24+
with:
25+
node-version: ${{ matrix.node-version }}
26+
cache: 'pnpm'
27+
28+
- name: Install dependencies
29+
run: pnpm install
30+
31+
- name: Build
32+
run: pnpm build
33+
34+
- name: API Extractor
35+
run: pnpm api-extractor:ci

.github/workflows/build-test.yml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Unit Test / Lint
2+
3+
on: [pull_request]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
matrix:
10+
# Do we want to run with multiple versions of node?
11+
node-version: [16]
12+
13+
steps:
14+
- name: Checkout repo
15+
uses: actions/checkout@v3
16+
17+
- name: Setup pnpm
18+
uses: pnpm/action-setup@v2
19+
with:
20+
version: 7
21+
22+
- name: Use Node.js ${{ matrix.node-version }}
23+
uses: actions/setup-node@v3
24+
with:
25+
node-version: ${{ matrix.node-version }}
26+
cache: 'pnpm'
27+
28+
- name: Install dependencies
29+
run: pnpm install
30+
31+
- name: Lint
32+
run: |
33+
pnpm lint
34+
pnpm type
35+
36+
# What is --ci?
37+
- name: Test
38+
run: |
39+
pnpm run test --ci
40+
pnpm test:type

0 commit comments

Comments
 (0)