Chore: Add @types/react to optional peer dependency to avoid version conflict in monorepos

This commit is contained in:
Fuma Nama
2025-06-13 10:35:11 +08:00
parent 07e94ec1b3
commit 1b7bc4b232
18 changed files with 102 additions and 36 deletions
+15
View File
@@ -0,0 +1,15 @@
---
'@fumadocs/content-collections': patch
'@fumadocs/mdx-remote': patch
'fumadocs-typescript': patch
'fumadocs-twoslash': patch
'fumadocs-docgen': patch
'fumadocs-openapi': patch
'fumadocs-python': patch
'fumadocs-core': patch
'@fumadocs/cli': patch
'fumadocs-mdx': patch
'fumadocs-ui': patch
---
Add `@types/react` to optional peer dependency to avoid version conflict in monorepos
-1
View File
@@ -43,7 +43,6 @@
},
"devDependencies": {
"@types/node": "24.0.1",
"@types/react": "^19.1.8",
"eslint-config-custom": "workspace:*",
"tsconfig": "workspace:*",
"tsx": "^4.20.2"
+6 -2
View File
@@ -1,9 +1,13 @@
{
"extends": "tsconfig/react-library.json",
"extends": "tsconfig/base.json",
"compilerOptions": {
"paths": {
"@/*": ["./src/*"]
}
},
"noEmit": true,
"lib": ["ESNext"],
"module": "ESNext",
"target": "ES2020"
},
"exclude": ["node_modules", "test/repo", "test/repo-2", "eslint.config.mjs"]
}
+6 -2
View File
@@ -1,9 +1,13 @@
{
"extends": "tsconfig/react-library.json",
"extends": "tsconfig/base.json",
"compilerOptions": {
"paths": {
"@/*": ["./src/*"]
}
},
"noEmit": true,
"lib": ["ESNext"],
"module": "ESNext",
"target": "ES2020"
},
"exclude": ["node_modules", "dist", "eslint.config.mjs"]
}
+5 -1
View File
@@ -137,9 +137,13 @@
"algoliasearch": "5.x.x",
"next": "14.x.x || 15.x.x",
"react": "18.x.x || 19.x.x",
"react-dom": "18.x.x || 19.x.x"
"react-dom": "18.x.x || 19.x.x",
"@types/react": "*"
},
"peerDependenciesMeta": {
"@types/react": {
"optional": true
},
"@oramacloud/client": {
"optional": true
},
+2 -2
View File
@@ -1,5 +1,5 @@
'use client';
import React from 'react';
import React, { type ReactNode } from 'react';
const isEmpty = (node: HTMLElement) => {
for (let i = 0; i < node.childNodes.length; i++) {
@@ -23,7 +23,7 @@ const isEmpty = (node: HTMLElement) => {
*
* This can be expensive, please avoid this whenever possible.
*/
export function HideIfEmpty({ children }: { children: React.ReactNode }) {
export function HideIfEmpty({ children }: { children: ReactNode }) {
const id = React.useId();
const [empty, setEmpty] = React.useState<boolean | undefined>();
+6 -2
View File
@@ -1,9 +1,13 @@
{
"extends": "tsconfig/react-library.json",
"extends": "tsconfig/base.json",
"compilerOptions": {
"paths": {
"@/*": ["./src/*"]
}
},
"noEmit": true,
"lib": ["ESNext"],
"module": "ESNext",
"target": "ES2020"
},
"exclude": ["node_modules", "dist", "eslint.config.mjs"]
}
+6 -1
View File
@@ -53,7 +53,12 @@
},
"peerDependencies": {
"fumadocs-core": "^14.0.0 || ^15.0.0",
"react": "18.x.x || 19.x.x"
"@types/react": "*"
},
"peerDependenciesMeta": {
"@types/react": {
"optional": true
}
},
"publishConfig": {
"access": "public"
+6 -2
View File
@@ -1,9 +1,13 @@
{
"extends": "tsconfig/react-library.json",
"extends": "tsconfig/base.json",
"compilerOptions": {
"paths": {
"@/*": ["./src/*"]
}
},
"noEmit": true,
"lib": ["ESNext", "DOM"],
"module": "ESNext",
"target": "ES2020"
},
"exclude": ["node_modules", "eslint.config.mjs"]
}
+6 -2
View File
@@ -1,9 +1,13 @@
{
"extends": "tsconfig/react-library.json",
"extends": "tsconfig/base.json",
"compilerOptions": {
"paths": {
"@/*": ["./src/*"]
}
},
"noEmit": true,
"lib": ["ESNext"],
"module": "ESNext",
"target": "ES2020"
},
"exclude": ["node_modules", "eslint.config.mjs"]
}
+5 -1
View File
@@ -92,9 +92,13 @@
"@scalar/api-client-react": "*",
"next": "14.x.x || 15.x.x",
"react": "18.x.x || 19.x.x",
"react-dom": "18.x.x || 19.x.x"
"react-dom": "18.x.x || 19.x.x",
"@types/react": "*"
},
"peerDependenciesMeta": {
"@types/react": {
"optional": true
},
"@scalar/api-client-react": {
"optional": true
}
@@ -10,7 +10,7 @@ import type { OpenAPIV3_1 } from 'openapi-types';
import { useForm } from 'react-hook-form';
import { Input, labelVariants } from '@/ui/components/input';
import { useQuery } from '@/utils/use-query';
import { useEffect, useState } from 'react';
import { type ReactNode, useEffect, useState } from 'react';
import { cn } from 'fumadocs-ui/utils/cn';
import { buttonVariants } from 'fumadocs-ui/components/ui/button';
import {
@@ -30,7 +30,7 @@ export interface AuthDialogProps {
open: boolean;
setOpen: (v: boolean) => void;
setToken: (token: string) => void;
children: React.ReactNode;
children: ReactNode;
}
interface FormValues {
@@ -2,6 +2,7 @@
import {
createContext,
type HTMLAttributes,
type ReactNode,
useContext,
useEffect,
useMemo,
@@ -54,7 +55,7 @@ export function CodeExampleProvider({
data: RequestData;
}[];
initialKey?: string;
children: React.ReactNode;
children: ReactNode;
}) {
const [key, setKey] = useState(initialKey ?? examples[0].key);
const listeners = useRef<UpdateListener[]>([]);
+7 -1
View File
@@ -50,7 +50,13 @@
},
"peerDependencies": {
"fumadocs-core": "15.x.x",
"fumadocs-ui": "15.x.x"
"fumadocs-ui": "15.x.x",
"@types/react": "*"
},
"peerDependenciesMeta": {
"@types/react": {
"optional": true
}
},
"publishConfig": {
"access": "public"
+7 -2
View File
@@ -47,6 +47,7 @@
"mdast-util-gfm": "^3.1.0",
"mdast-util-to-hast": "^13.2.0",
"tailwind-merge": "^3.3.1",
"shiki": "^3.6.0",
"twoslash": "^0.3.1"
},
"devDependencies": {
@@ -56,13 +57,17 @@
"@types/react": "^19.1.8",
"eslint-config-custom": "workspace:*",
"fumadocs-ui": "workspace:*",
"shiki": "^3.6.0",
"tsconfig": "workspace:*"
},
"peerDependencies": {
"fumadocs-ui": "^15.0.0",
"react": "18.x.x || 19.x.x",
"shiki": "1.x.x || 2.x.x || 3.x.x"
"@types/react": "*"
},
"peerDependenciesMeta": {
"@types/react": {
"optional": true
}
},
"publishConfig": {
"access": "public"
+7 -1
View File
@@ -61,7 +61,13 @@
"unified": "^11.0.5"
},
"peerDependencies": {
"typescript": "*"
"typescript": "*",
"@types/react": "*"
},
"peerDependenciesMeta": {
"@types/react": {
"optional": true
}
},
"publishConfig": {
"access": "public"
+8 -1
View File
@@ -119,9 +119,16 @@
"next": "14.x.x || 15.x.x",
"react": "18.x.x || 19.x.x",
"react-dom": "18.x.x || 19.x.x",
"tailwindcss": "^3.4.14 || ^4.0.0"
"tailwindcss": "^3.4.14 || ^4.0.0",
"@types/react": "*"
},
"peerDependenciesMeta": {
"next": {
"optional": true
},
"@types/react": {
"optional": true
},
"tailwindcss": {
"optional": true
}
+6 -12
View File
@@ -279,7 +279,7 @@ importers:
version: 0.2.2(@content-collections/[email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])
'@content-collections/next':
specifier: ^0.2.6
version: 0.2.6(@content-collections/[email protected]([email protected]))([email protected](@opentelemetry/[email protected])([email protected]([email protected]))([email protected]))
version: 0.2.6(@content-collections/[email protected]([email protected]))([email protected](@babel/[email protected])(@opentelemetry/[email protected])([email protected])([email protected]([email protected]))([email protected]))
'@types/mdx':
specifier: ^2.0.13
version: 2.0.13
@@ -663,9 +663,6 @@ importers:
'@types/node':
specifier: 24.0.1
version: 24.0.1
'@types/react':
specifier: ^19.1.8
version: 19.1.8
eslint-config-custom:
specifier: workspace:*
version: link:../eslint-config-custom
@@ -862,7 +859,7 @@ importers:
version: 0.2.2(@content-collections/[email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])
'@content-collections/next':
specifier: ^0.2.6
version: 0.2.6(@content-collections/[email protected]([email protected]))([email protected](@opentelemetry/[email protected])([email protected]([email protected]))([email protected]))
version: 0.2.6(@content-collections/[email protected]([email protected]))([email protected](@babel/[email protected])(@opentelemetry/[email protected])([email protected])([email protected]([email protected]))([email protected]))
'@react-router/dev':
specifier: ^7.6.2
version: 7.6.2(@react-router/[email protected]([email protected]([email protected]([email protected]))([email protected]))([email protected]))(@types/[email protected])([email protected])([email protected])([email protected])([email protected]([email protected]([email protected]))([email protected]))([email protected])([email protected])([email protected])([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected]))([email protected])
@@ -1095,9 +1092,6 @@ importers:
gray-matter:
specifier: ^4.0.3
version: 4.0.3
react:
specifier: 18.x.x || 19.x.x
version: 19.1.0
zod:
specifier: ^3.25.63
version: 3.25.63
@@ -1295,6 +1289,9 @@ importers:
react:
specifier: 18.x.x || 19.x.x
version: 19.1.0
shiki:
specifier: ^3.6.0
version: 3.6.0
tailwind-merge:
specifier: ^3.3.1
version: 3.3.1
@@ -1320,9 +1317,6 @@ importers:
fumadocs-ui:
specifier: workspace:*
version: link:../ui
shiki:
specifier: ^3.6.0
version: 3.6.0
tsconfig:
specifier: workspace:*
version: link:../tsconfig
@@ -10273,7 +10267,7 @@ snapshots:
- acorn
- supports-color
'@content-collections/[email protected](@content-collections/[email protected]([email protected]))([email protected](@opentelemetry/[email protected])([email protected]([email protected]))([email protected]))':
'@content-collections/[email protected](@content-collections/[email protected]([email protected]))([email protected](@babel/[email protected])(@opentelemetry/[email protected])([email protected])([email protected]([email protected]))([email protected]))':
dependencies:
'@content-collections/core': 0.9.0([email protected])
'@content-collections/integrations': 0.2.1(@content-collections/[email protected]([email protected]))