Skip to content

Commit 271a0d3

Browse files
committed
Update master-ko (deep-merge package.json, keep local files including README.md)
1 parent 10ed6d3 commit 271a0d3

19 files changed

Lines changed: 3118 additions & 2225 deletions

.gitignore

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,10 @@
11
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
22

33
# dependencies
4-
node_modules
4+
/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

@@ -33,13 +26,9 @@ yarn-error.log*
3326
.idea
3427
.cache/
3528
package-lock.json
29+
.vscode
3630
tsconfig.tsbuildinfo
3731
.next/
3832

3933
# contentlayer
4034
.contentlayer
41-
42-
# llms.txt (build artifacts)
43-
public/llms.txt
44-
public/llms-full.txt
45-
public/md/

.husky/pre-commit

100644100755
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/usr/bin/env sh
22
. "$(dirname -- "$0")/_/husky.sh"
33

4-
npx lint-staged
4+
pnpm exec lint-staged

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
20.18.1

.prettierignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
pnpm-lock.yaml
2+
.cache/
3+
.contentlayer/
4+
.next/

.prettierrc

Lines changed: 1 addition & 0 deletions
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

Lines changed: 32 additions & 5 deletions
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

17-
4. Startup a local version of the docs
19+
4. Start 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

changes.diff

Whitespace-only changes.

contentlayer.config.ts

Lines changed: 15 additions & 4 deletions
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",
@@ -12,6 +13,7 @@ export const Doc = defineDocumentType(() => ({
1213
fields: {
1314
title: { type: "string", required: true },
1415
description: { type: "string", required: true },
16+
metaDescription: { type: "string", required: false },
1517
sidebar: {
1618
type: "enum",
1719
options: [
@@ -20,7 +22,7 @@ export const Doc = defineDocumentType(() => ({
2022
"tsLinks",
2123
"faqLinks",
2224
"getStartedLinks",
23-
"aiIntegrationLinks",
25+
"migrateV7ToV8Links",
2426
],
2527
required: true,
2628
},
@@ -34,13 +36,22 @@ export const Doc = defineDocumentType(() => ({
3436
type: "string",
3537
resolve: (doc) => doc._raw.flattenedPath.split("/").slice(1).join("/"),
3638
},
39+
40+
/**
41+
* Can't define value different from primitives, so hardcoding the correct type
42+
* @see https://github.com/contentlayerdev/contentlayer/issues/149
43+
*/
3744
segment: {
38-
type: "list",
45+
type: "string[]" as "list",
3946
resolve: (doc) => doc._raw.flattenedPath.split("/"),
4047
},
4148
pages: {
42-
type: "list",
43-
resolve: (doc) => sidebar[doc.sidebar] ?? [],
49+
type: "json",
50+
resolve: (doc) => {
51+
// added explicit type casting to keep track of this data structure
52+
// in case in the future contentlayer will support values different than primitives
53+
return sidebar[doc.sidebar] as unknown as Pages
54+
},
4455
},
4556
},
4657
}))

eslint.config.mjs

Lines changed: 67 additions & 0 deletions
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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/// <reference types="next" />
22
/// <reference types="next/image-types/global" />
3+
/// <reference path="./.next/types/routes.d.ts" />
34

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

0 commit comments

Comments
 (0)