Skip to content

Commit fb556da

Browse files
committed
Update master-ko with upstream changes (excluding src)
1 parent 33dfa97 commit fb556da

16 files changed

+2533
-1918
lines changed

.gitignore

-7
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,8 @@
33
# dependencies
44
/node_modules
55
/.pnp
6-
.yarn/*
7-
!.yarn/patches
8-
!.yarn/releases
9-
!.yarn/plugins
10-
!.yarn/sdks
11-
!.yarn/versions
126
.pnp.*
137

14-
158
# testing
169
/coverage
1710

.nvmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
20.18.1

.prettierignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
pnpm-lock.yaml
2+
.cache/
3+
.contentlayer/
4+
.next/

.prettierrc

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"$schema": "https://json.schemastore.org/prettierrc",
23
"endOfLine": "lf",
34
"semi": false,
45
"singleQuote": false,

CONTRIBUTING.md

+31-4
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,52 @@ Here is a quick guide to doing code contributions to the library.
1212

1313
3. Install packages by running:
1414

15-
> yarn
15+
```shellscript
16+
pnpm install
17+
```
1618

1719
4. Startup a local version of the docs
1820

19-
> yarn start
21+
```shellscript
22+
pnpm run dev
23+
```
2024

2125
5. Ensure your code is formatted properly
2226

23-
> yarn format
27+
```shellscript
28+
pnpm run format
29+
```
2430

2531
6. Push your branch: `git push -u origin your-meaningful-branch-name`
2632

2733
7. Submit a pull request to the upstream react-hook-form repository.
2834

2935
8. Choose a descriptive title and describe your changes briefly.
3036

37+
## Testing production build
38+
39+
To test the documentation production site on your local machine,
40+
first execute the build script:
41+
42+
```shellscript
43+
pnpm run build
44+
```
45+
46+
Then start a local server which serves the file created by executing
47+
48+
```shellscript
49+
pnpm run start
50+
```
51+
3152
## Coding style
3253

33-
Please follow the coding style of the project. React Hook Form uses prettier. If possible, enable the prettier plugin in your editor to get real-time feedback. The formatting can be run manually with the following command: `yarn format`
54+
Please follow the coding style of the project.
55+
React Hook Form uses prettier.
56+
If possible, enable the prettier plugin in your editor to get real-time feedback. The formatting can be run manually with the following command:
57+
58+
```shellscript
59+
pnpm run format:fix
60+
```
3461

3562
## License
3663

README.md

+14-8
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,24 @@
88

99
<p align="center">Performant, flexible and extensible forms with easy to use validation.</p>
1010

11-
## 목표
11+
## Install
1212

13-
**React-Ko-Form** 레포지토리는 **React Hook Form**의 공식 문서([https://react-hook-form.com/docs](https://react-hook-form.com/docs)) 를 한국어로 번역하는 프로젝트입니다. 이 레포지토리는 비공식 한국어 문서로서, React Hook Form의 공식 레포지토리와는 별개로 유지됩니다.
13+
```shellscript
14+
pnpm install && pnpm dev
15+
```
1416

15-
이 프로젝트는 React Hook Form을 사용하는 한국어 개발자들의 편의성을 높이는 것을 목표로 합니다.
17+
## Backers
1618

17-
단, 공식 문서 업데이트 및 changes 발생 시에는, 그에 맞춰 업데이트될 예정입니다. 관련 사항이 발생하면, Issue 탭에서 공유됩니다.
19+
Thanks goes to all our backers! [[Become a backer](https://opencollective.com/react-hook-form#backer)].
1820

19-
## 설치
21+
<a href="https://opencollective.com/react-hook-form#backers">
22+
<img src="https://opencollective.com/react-hook-form/backers.svg?width=950" />
23+
</a>
2024

21-
yarn && yarn start
25+
## Contributors
2226

23-
## 기여자
27+
Thanks goes to these wonderful people. [[Become a contributor](https://github.com/react-hook-form/documentation/blob/master/CONTRIBUTING.md)].
2428

25-
이 프로젝트에 기여해 주신 멋진 분들께 감사드립니다. [[기여자가 되려면](https://github.com/hamsurang/react-ko-form/blob/master-ko/.github/CONTRIBUTING.md)].
29+
<a href="https://github.com/react-hook-form/react-hook-form/graphs/contributors">
30+
<img src="https://opencollective.com/react-hook-form/contributors.svg?width=950" />
31+
</a>

changes.diff

Whitespace-only changes.

contentlayer.config.ts

+13-3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import remarkGfm from "remark-gfm"
44
import rehypeMdxCodeProps from "rehype-mdx-code-props"
55
import emoji from "remark-emoji"
66
import * as sidebar from "./src/components/Menu/MenuLinks"
7+
import type { Pages } from "./src/types/types"
78

89
export const Doc = defineDocumentType(() => ({
910
name: "Doc",
@@ -33,13 +34,22 @@ export const Doc = defineDocumentType(() => ({
3334
type: "string",
3435
resolve: (doc) => doc._raw.flattenedPath.split("/").slice(1).join("/"),
3536
},
37+
38+
/**
39+
* Can't define value different from primitives, so hardcoding the correct type
40+
* @see https://github.com/contentlayerdev/contentlayer/issues/149
41+
*/
3642
segment: {
37-
type: "list",
43+
type: "string[]" as "list",
3844
resolve: (doc) => doc._raw.flattenedPath.split("/"),
3945
},
4046
pages: {
41-
type: "list",
42-
resolve: (doc) => sidebar[doc.sidebar] ?? [],
47+
type: "json",
48+
resolve: (doc) => {
49+
// added explicit type casting to keep track of this data structure
50+
// in case in the future contentlayer will support values different than primitives
51+
return sidebar[doc.sidebar] as unknown as Pages
52+
},
4353
},
4454
},
4555
}))

eslint.config.mjs

+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
// @ts-check
2+
import tseslint from "typescript-eslint"
3+
import { FlatCompat } from "@eslint/eslintrc"
4+
import eslintPluginJsxA11y from "eslint-plugin-jsx-a11y"
5+
import eslintPluginReact from "eslint-plugin-react"
6+
7+
const compat = new FlatCompat({
8+
baseDirectory: import.meta.dirname,
9+
})
10+
11+
export default tseslint.config(
12+
tseslint.configs.recommendedTypeChecked,
13+
14+
...compat.config({
15+
extends: ["next"],
16+
rules: {
17+
// react
18+
"react/prop-types": "off",
19+
"react/no-unescaped-entities": "off",
20+
"react/jsx-curly-brace-presence": "warn",
21+
22+
// jsx-ally is already included in next-js so
23+
// we are adding only recommended rules directly here
24+
...eslintPluginJsxA11y.flatConfigs.recommended.rules,
25+
"jsx-a11y/no-onchange": "warn",
26+
27+
// import
28+
"import/no-anonymous-default-export": "off",
29+
30+
// next
31+
"@next/next/no-img-element": "off",
32+
},
33+
}),
34+
35+
// @ts-expect-error eslintPluginReact.configs.flat, but runtime is always defined
36+
eslintPluginReact.configs.flat["jsx-runtime"],
37+
38+
{
39+
linterOptions: {
40+
reportUnusedDisableDirectives: "error",
41+
},
42+
languageOptions: {
43+
parserOptions: {
44+
projectService: true,
45+
tsconfigRootDir: import.meta.dirname,
46+
},
47+
},
48+
rules: {
49+
// typescript
50+
"@typescript-eslint/explicit-function-return-type": "off",
51+
"@typescript-eslint/explicit-module-boundary-types": "off",
52+
"@typescript-eslint/interface-name-prefix": "off",
53+
"@typescript-eslint/no-floating-promises": "off",
54+
"@typescript-eslint/restrict-template-expressions": [
55+
"error",
56+
{
57+
allowAny: false,
58+
allowBoolean: false,
59+
allowNever: false,
60+
allowNullish: false,
61+
allowNumber: true,
62+
allowRegExp: false,
63+
},
64+
],
65+
},
66+
}
67+
)

next-env.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
/// <reference types="next/image-types/global" />
33

44
// NOTE: This file should not be edited
5-
// see https://nextjs.org/docs/basic-features/typescript for more information.
5+
// see https://nextjs.org/docs/pages/api-reference/config/typescript for more information.

next.config.ts

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import type { NextConfig } from "next"
2+
import { withContentlayer } from "next-contentlayer"
3+
import withBundleAnalyzer from "@next/bundle-analyzer"
4+
5+
const nextConfig: NextConfig = {
6+
eslint: {
7+
/**
8+
* Now eslint requires typecheck so we have to run build before executing lint
9+
* These check are performed via `.github/workflows/ci.yml` action
10+
*
11+
* @see https://github.com/react-hook-form/documentation/pull/1107
12+
*/
13+
ignoreDuringBuilds: true,
14+
},
15+
typescript: {
16+
/** @see `eslint.ignoreDuringBuilds` comment */
17+
ignoreBuildErrors: true,
18+
},
19+
reactStrictMode: true,
20+
pageExtensions: ["ts", "tsx", "js", "jsx", "md", "mdx"],
21+
}
22+
23+
const bundleAnalyzer = withBundleAnalyzer({
24+
enabled: process.env.ANALYZE === "true",
25+
})
26+
27+
export default bundleAnalyzer(withContentlayer(nextConfig))

package.json

+41-29
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,21 @@
77
"@hookform/devtools": "4.3.1",
88
"@mdx-js/loader": "^2.3.0",
99
"@mdx-js/react": "^2.3.0",
10-
"@next/mdx": "^13.4.5",
11-
"@types/node": "^20.3.1",
12-
"class-variance-authority": "^0.6.0",
10+
"@next/mdx": "15.1.0",
11+
"class-variance-authority": "^0.6.1",
1312
"clsx": "^1.2.1",
14-
"contentlayer": "^0.3.3",
15-
"date-fns": "^2.30.0",
16-
"little-state-machine": "^4.8.0",
17-
"next": "^14.1.1",
18-
"next-contentlayer": "^0.3.3",
13+
"contentlayer": "^0.3.4",
14+
"little-state-machine": "^4.8.1",
15+
"next": "15.1.2",
16+
"next-contentlayer": "^0.3.4",
1917
"next-themes": "^0.2.1",
20-
"prism-react-renderer": "^2.0.5",
18+
"prism-react-renderer": "^2.4.1",
2119
"prismjs": "^1.29.0",
22-
"react": "18.2.0",
23-
"react-dom": "18.2.0",
20+
"react": "18.3.1",
21+
"react-dom": "18.3.1",
2422
"react-github-btn": "1.4.0",
2523
"react-hook-form": "7.44.3",
26-
"react-simple-animate": "^3.5.2",
24+
"react-simple-animate": "^3.5.3",
2725
"react-simple-img": "3.0.0",
2826
"react-sortablejs": "1.5.1",
2927
"rehype-mdx-code-props": "^1.0.0",
@@ -33,21 +31,24 @@
3331
"sortablejs": "1.15.0"
3432
},
3533
"devDependencies": {
36-
"@next/bundle-analyzer": "^13.4.5",
37-
"@types/react-helmet": "^6.1.6",
38-
"@typescript-eslint/eslint-plugin": "^5.59.11",
39-
"@typescript-eslint/parser": "^5.59.11",
34+
"@next/bundle-analyzer": "15.1.0",
35+
"@types/eslint-plugin-jsx-a11y": "6.10.0",
36+
"@types/eslint__eslintrc": "2.1.2",
37+
"@types/node": "20.17.10",
38+
"@types/react": "18.3.17",
39+
"@types/react-dom": "18.3.5",
40+
"@types/react-helmet": "^6.1.11",
4041
"cross-env": "^7.0.3",
41-
"eslint": "^8.42.0",
42-
"eslint-config-next": "^13.4.5",
43-
"eslint-config-prettier": "^8.8.0",
44-
"eslint-plugin-jsx-a11y": "^6.7.1",
45-
"eslint-plugin-react": "^7.32.2",
46-
"eslint-plugin-react-hooks": "^4.6.0",
42+
"eslint": "9.17.0",
43+
"eslint-config-next": "15.1.0",
44+
"eslint-plugin-jsx-a11y": "6.10.2",
45+
"eslint-plugin-react": "7.37.2",
46+
"eslint-plugin-react-hooks": "5.1.0",
4747
"husky": "^8.0.3",
48-
"lint-staged": "^13.2.2",
49-
"prettier": "^2.8.8",
50-
"typescript": "^5.1.3"
48+
"lint-staged": "^13.3.0",
49+
"prettier": "^3.4.2",
50+
"typescript": "^5.7.3",
51+
"typescript-eslint": "8.18.1"
5152
},
5253
"keywords": [
5354
"react-hook-form",
@@ -58,16 +59,27 @@
5859
"analyze": "cross-env ANALYZE=true next build",
5960
"build": "next build",
6061
"dev": "next dev",
61-
"format": "prettier --write",
62-
"lint": "next lint --fix",
63-
"now-build": "npm run build",
62+
"format": "prettier . --check",
63+
"format:fix": "prettier . --write",
64+
"lint": "next lint",
65+
"lint:fix": "next lint --fix",
66+
"lint:ci": "next build --no-lint && next lint",
67+
"now-build": "pnpm run build",
6468
"start": "next start",
6569
"typecheck": "tsc --noEmit",
70+
"typecheck:ci": "next build --no-lint && tsc --noEmit",
6671
"prepare": "husky install"
6772
},
6873
"lint-staged": {
6974
"*.{ts,tsx,mdx,css,json}": [
70-
"npm run format"
75+
"pnpm run format:fix"
7176
]
77+
},
78+
"packageManager": "pnpm@9.15.0+sha512.76e2379760a4328ec4415815bcd6628dee727af3779aaa4c914e3944156c4299921a89f976381ee107d41f12cfa4b66681ca9c718f0668fa0831ed4c6d8ba56c",
79+
"pnpm": {
80+
"overrides": {
81+
"@types/react": "18.3.17",
82+
"@types/react-dom": "18.3.5"
83+
}
7284
}
7385
}

0 commit comments

Comments
 (0)