From ad4cd4f5b56f1e16d0ee4c04a28a41c593231b3d Mon Sep 17 00:00:00 2001 From: Stijn Van Hulle Date: Sun, 15 Dec 2024 00:35:28 +0100 Subject: [PATCH] fix: resolve typings for react 18 and react 19 --- docs/package.json | 8 +- e2e/package.json | 2 +- examples/react-query/package.json | 4 +- examples/react-query/src/App.tsx | 4 +- package.json | 2 +- packages/plugin-redoc/src/redoc.tsx | 2 +- packages/react/package.json | 8 +- packages/react/src/ReactTemplate.tsx | 3 + packages/react/src/components/App.tsx | 2 +- packages/react/src/components/Const.tsx | 5 +- packages/react/src/components/File.tsx | 18 +- packages/react/src/components/Function.tsx | 7 +- packages/react/src/components/Root.tsx | 4 +- packages/react/src/components/Text.tsx | 8 +- packages/react/src/components/Type.tsx | 5 +- packages/react/src/globals.ts | 52 +++++ packages/react/src/hooks/useIndent.ts | 2 +- packages/react/src/index.ts | 2 + packages/react/src/jsx-runtime.ts | 29 +-- packages/react/src/types.ts | 26 +-- pnpm-lock.yaml | 260 ++++++++++----------- pnpm-workspace.yaml | 27 ++- 22 files changed, 253 insertions(+), 227 deletions(-) create mode 100644 packages/react/src/globals.ts diff --git a/docs/package.json b/docs/package.json index 623c16afd..da4e5e862 100644 --- a/docs/package.json +++ b/docs/package.json @@ -45,13 +45,13 @@ "@kubb/react": "workspace:*", "@mermaid-js/mermaid-cli": "^11.4.2", "@types/node": "^20.17.10", - "@types/react": "^18.3.16", + "@types/react": "catalog:", "cross-env": "^7.0.3", - "react": "^18.3.1", + "react": "catalog:", "unplugin-kubb": "workspace:^", - "vite": "^5.4.11" + "vite": "^6.0.3" }, - "packageManager": "pnpm@9.12.0", + "packageManager": "pnpm@9.15.0", "engines": { "node": ">=20", "pnpm": ">=8.15.0" diff --git a/e2e/package.json b/e2e/package.json index 76888e1ac..656e13e99 100644 --- a/e2e/package.json +++ b/e2e/package.json @@ -38,7 +38,7 @@ "@tanstack/vue-query": "^5.62.7", "axios": "^1.7.9", "msw": "^2.6.8", - "react": "^18.3.1", + "react": "catalog:", "solid-js": "^1.9.3", "svelte": "^3.59.2", "swr": "^2.2.5", diff --git a/examples/react-query/package.json b/examples/react-query/package.json index fab49ac7f..699e84756 100644 --- a/examples/react-query/package.json +++ b/examples/react-query/package.json @@ -32,12 +32,12 @@ "@tanstack/react-query": "^5.62.7", "@tanstack/react-query-devtools": "^5.62.7", "axios": "^1.7.9", - "react": "^19.0.0", + "react": "^18.3.1", "react-dom": "^19.0.0", "unplugin-kubb": "workspace:*" }, "devDependencies": { - "@types/react": "^19.0.1", + "@types/react": "^18.3.16", "@types/react-dom": "^19.0.2", "@vitejs/plugin-react": "^4.3.4", "msw": "^1.3.5", diff --git a/examples/react-query/src/App.tsx b/examples/react-query/src/App.tsx index 73b98cfa9..b03a969a0 100644 --- a/examples/react-query/src/App.tsx +++ b/examples/react-query/src/App.tsx @@ -5,7 +5,7 @@ import type { FindPetsByStatusQueryParamsStatusEnum } from './gen/models' const queryClient = new QueryClient() -function Pets(): JSX.Element { +function Pets() { const [status, setStatus] = useState('available') const { data: pets, queryKey } = useFindPetsByStatusHook({ status }, { query: { enabled: true } }) const { data } = useUpdatePetWithFormHook(2) @@ -105,7 +105,7 @@ function Pets(): JSX.Element { ) } -export function App(): JSX.Element { +export function App() { return ( diff --git a/package.json b/package.json index fdc594804..ad496b8ec 100644 --- a/package.json +++ b/package.json @@ -66,7 +66,7 @@ "vite-tsconfig-paths": "5.1.0", "vitest": "^2.1.8" }, - "packageManager": "pnpm@9.12.0", + "packageManager": "pnpm@9.15.0", "engines": { "node": ">=20", "pnpm": ">=8.15.0" diff --git a/packages/plugin-redoc/src/redoc.tsx b/packages/plugin-redoc/src/redoc.tsx index 0ffe9b1f1..d6da401aa 100644 --- a/packages/plugin-redoc/src/redoc.tsx +++ b/packages/plugin-redoc/src/redoc.tsx @@ -43,7 +43,7 @@ export async function getPageHTML(api: OasTypes.OASDocument, { title, disableGoo const App = Redoc as any - const html = renderToString(sheet.collectStyles()) + const html = renderToString(sheet.collectStyles()) const state = await store.toJS() const css = sheet.getStyleTags() diff --git a/packages/react/package.json b/packages/react/package.json index 7d1ccd924..f1fc64f42 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -87,17 +87,17 @@ "@kubb/parser-ts": "workspace:*", "execa": "^9.5.2", "natural-orderby": "^4.0.0", - "react": "^18.3.1", + "react": "catalog:react18", "react-devtools-core": "^5.3.2", - "react-reconciler": "^0.29.2", + "react-reconciler": "catalog:react18", "signal-exit": "^4.1.0", "ws": "^8.18.0" }, "devDependencies": { "@kubb/config-ts": "workspace:*", "@kubb/config-tsup": "workspace:*", - "@types/react": "^18.3.16", - "@types/react-reconciler": "^0.28.9", + "@types/react": "catalog:react18", + "@types/react-reconciler": "catalog:react18", "@types/signal-exit": "^3.0.4", "@types/ws": "^8.5.13", "tsup": "catalog:", diff --git a/packages/react/src/ReactTemplate.tsx b/packages/react/src/ReactTemplate.tsx index 0b18dc6ce..ebfbe6d1e 100644 --- a/packages/react/src/ReactTemplate.tsx +++ b/packages/react/src/ReactTemplate.tsx @@ -67,6 +67,9 @@ export class ReactTemplate = Record{children} diff --git a/packages/react/src/components/Const.tsx b/packages/react/src/components/Const.tsx index e851e9129..1fd8c5447 100644 --- a/packages/react/src/components/Const.tsx +++ b/packages/react/src/components/Const.tsx @@ -2,9 +2,10 @@ import { createJSDocBlockText } from '@kubb/core/transformers' import { Text } from './Text.tsx' -import type { JSDoc, KubbNode } from '../types.ts' +import type { JSDoc, Key, KubbNode } from '../types.ts' type Props = { + key?: Key /** * Name of the const */ @@ -28,7 +29,7 @@ type Props = { children?: KubbNode } -export function Const({ name, export: canExport, type, JSDoc, asConst, children }: Props): KubbNode { +export function Const({ name, export: canExport, type, JSDoc, asConst, children }: Props) { return ( <> {JSDoc?.comments && ( diff --git a/packages/react/src/components/File.tsx b/packages/react/src/components/File.tsx index 77933d087..37ea65da6 100644 --- a/packages/react/src/components/File.tsx +++ b/packages/react/src/components/File.tsx @@ -2,7 +2,7 @@ import { createContext } from 'react' import type { FileMetaBase } from '@kubb/core' import type * as KubbFile from '@kubb/fs/types' -import type { KubbNode } from '../types.ts' +import type { Key, KubbNode } from '../types.ts' export type FileContextProps = { /** @@ -43,6 +43,7 @@ type BasePropsWithoutBaseName = { type BaseProps = BasePropsWithBaseName | BasePropsWithoutBaseName type Props = BaseProps & { + key?: Key /** * This will call fileManager.add instead of fileManager.addOrAppend, adding the source when the files already exists. * This will also ignore the combinefiles utils @@ -55,9 +56,9 @@ type Props = BaseProps & { children?: KubbNode } -export function File({ children, ...rest }: Props): KubbNode { +export function File({ children, ...rest }: Props) { if (!rest.baseName || !rest.path) { - return children + return <>{children} } return ( @@ -70,10 +71,11 @@ export function File({ children, ...r File.displayName = 'KubbFile' type FileSourceProps = Omit & { + key?: Key children?: KubbNode } -function FileSource({ isTypeOnly, name, isExportable, isIndexable, children }: FileSourceProps): KubbNode { +function FileSource({ isTypeOnly, name, isExportable, isIndexable, children }: FileSourceProps) { return ( {children} @@ -83,17 +85,17 @@ function FileSource({ isTypeOnly, name, isExportable, isIndexable, children }: F FileSource.displayName = 'KubbFileSource' -type FileExportProps = KubbFile.Export +type FileExportProps = KubbFile.Export & { key?: Key } -function FileExport({ name, path, isTypeOnly, asAlias }: FileExportProps): KubbNode { +function FileExport({ name, path, isTypeOnly, asAlias }: FileExportProps) { return } FileExport.displayName = 'KubbFileExport' -type FileImportProps = KubbFile.Import +type FileImportProps = KubbFile.Import & { key?: Key } -function FileImport({ name, root, path, isTypeOnly, isNameSpace }: FileImportProps): KubbNode { +function FileImport({ name, root, path, isTypeOnly, isNameSpace }: FileImportProps) { return } diff --git a/packages/react/src/components/Function.tsx b/packages/react/src/components/Function.tsx index 750c539dd..943336a67 100644 --- a/packages/react/src/components/Function.tsx +++ b/packages/react/src/components/Function.tsx @@ -2,9 +2,10 @@ import { createJSDocBlockText } from '@kubb/core/transformers' import { Text } from './Text.tsx' -import type { JSDoc, KubbNode } from '../types.ts' +import type { JSDoc, Key, KubbNode } from '../types.ts' type Props = { + key?: Key /** * Name of the function. */ @@ -38,7 +39,7 @@ type Props = { children?: KubbNode } -export function Function({ name, export: canExport, async, generics, params, returnType, JSDoc, children }: Props): KubbNode { +export function Function({ name, export: canExport, async, generics, params, returnType, JSDoc, children }: Props) { return ( <> {JSDoc?.comments && ( @@ -94,7 +95,7 @@ type ArrowFunctionProps = Props & { singleLine?: boolean } -function ArrowFunction({ name, export: canExport, async, generics, params, returnType, JSDoc, singleLine, children }: ArrowFunctionProps): KubbNode { +function ArrowFunction({ name, export: canExport, async, generics, params, returnType, JSDoc, singleLine, children }: ArrowFunctionProps) { return ( <> {JSDoc?.comments && ( diff --git a/packages/react/src/components/Root.tsx b/packages/react/src/components/Root.tsx index 7d106cf80..b5fe2b96d 100644 --- a/packages/react/src/components/Root.tsx +++ b/packages/react/src/components/Root.tsx @@ -13,7 +13,7 @@ type ErrorBoundaryProps = Record { state = { hasError: false } @@ -63,7 +63,7 @@ type RootProps = Record> = readonly children?: KubbNode } -export function Root = Record>({ onError, onExit, logger, meta, children }: RootProps): KubbNode { +export function Root = Record>({ onError, onExit, logger, meta, children }: RootProps) { try { return ( {indentBefore} diff --git a/packages/react/src/components/Type.tsx b/packages/react/src/components/Type.tsx index 22adbeb55..9895548af 100644 --- a/packages/react/src/components/Type.tsx +++ b/packages/react/src/components/Type.tsx @@ -2,9 +2,10 @@ import { createJSDocBlockText } from '@kubb/core/transformers' import { Text } from './Text.tsx' -import type { JSDoc, KubbNode } from '../types.ts' +import type { JSDoc, Key, KubbNode } from '../types.ts' type Props = { + key?: Key /** * Name of the type, this needs to start with a capital letter. */ @@ -20,7 +21,7 @@ type Props = { children?: KubbNode } -export function Type({ name, export: canExport, JSDoc, children }: Props): KubbNode { +export function Type({ name, export: canExport, JSDoc, children }: Props) { if (name.charAt(0).toUpperCase() !== name.charAt(0)) { throw new Error('Name should start with a capital letter(see TypeScript types)') } diff --git a/packages/react/src/globals.ts b/packages/react/src/globals.ts new file mode 100644 index 000000000..65b9bac92 --- /dev/null +++ b/packages/react/src/globals.ts @@ -0,0 +1,52 @@ +import type * as KubbFile from '@kubb/fs/types' +import type React from 'react' +import type { KubbNode } from './types.ts' + +declare module 'react' { + namespace JSX { + interface IntrinsicElements { + 'kubb-text': { + children?: KubbNode + } + 'kubb-file': { + id?: string + children?: KubbNode + baseName: string + path: string + override?: boolean + meta?: KubbFile.File['meta'] + } + 'kubb-source': KubbFile.Source & { + children?: KubbNode + } + 'kubb-import': KubbFile.Import + 'kubb-export': KubbFile.Export + br: React.DetailedHTMLProps, HTMLBRElement> + } + } +} + +// @ts-ignore +declare module '@kubb/react/jsx-runtime' { + namespace JSX { + interface IntrinsicElements { + 'kubb-text': { + children?: KubbNode + } + 'kubb-file': { + id?: string + children?: KubbNode + baseName: string + path: string + override?: boolean + meta?: KubbFile.File['meta'] + } + 'kubb-source': KubbFile.Source & { + children?: KubbNode + } + 'kubb-import': KubbFile.Import + 'kubb-export': KubbFile.Export + br: React.DetailedHTMLProps, HTMLBRElement> + } + } +} diff --git a/packages/react/src/hooks/useIndent.ts b/packages/react/src/hooks/useIndent.ts index 623c25600..671cc0152 100644 --- a/packages/react/src/hooks/useIndent.ts +++ b/packages/react/src/hooks/useIndent.ts @@ -10,7 +10,7 @@ type Props = { children?: KubbNode } -export function useIndent({ size, children }: Props): KubbNode { +export function useIndent({ size, children }: Props) { let indentWithChildren: KubbNode if (!children) { diff --git a/packages/react/src/index.ts b/packages/react/src/index.ts index 2c0d25d04..a941f7ca2 100644 --- a/packages/react/src/index.ts +++ b/packages/react/src/index.ts @@ -1,3 +1,5 @@ +import './globals.ts' + export { createRoot, createRoot as createRootServer } from './createRoot.ts' export { File } from './components/File.tsx' export { Function } from './components/Function.tsx' diff --git a/packages/react/src/jsx-runtime.ts b/packages/react/src/jsx-runtime.ts index c6f893eaa..b47e931b1 100644 --- a/packages/react/src/jsx-runtime.ts +++ b/packages/react/src/jsx-runtime.ts @@ -1,31 +1,6 @@ -import ReactJSXRuntime from 'react/jsx-runtime' - -import type * as KubbFile from '@kubb/fs/types' -import type { ReactNode } from 'react' -import type { KubbNode } from './types.ts' +import './globals.ts' -declare global { - namespace JSX { - interface IntrinsicElements { - 'kubb-text': { - children?: ReactNode - } - 'kubb-file': { - id?: string - children?: ReactNode - baseName: string - path: string - override?: boolean - meta?: KubbFile.File['meta'] - } - 'kubb-source': KubbFile.Source & { - children?: KubbNode - } - 'kubb-import': KubbFile.Import - 'kubb-export': KubbFile.Export - } - } -} +import ReactJSXRuntime from 'react/jsx-runtime' // @ts-ignore export const Fragment = ReactJSXRuntime.Fragment diff --git a/packages/react/src/types.ts b/packages/react/src/types.ts index d7eea8142..021a6d3d1 100644 --- a/packages/react/src/types.ts +++ b/packages/react/src/types.ts @@ -1,30 +1,6 @@ -import type * as KubbFile from '@kubb/fs/types' import type { ReactNode } from 'react' type ReactElementNames = 'br' | 'div' -declare global { - namespace JSX { - interface IntrinsicElements { - 'kubb-text': { - children?: ReactNode - } - 'kubb-file': { - id?: string - children?: ReactNode - baseName: string - path: string - override?: boolean - meta?: KubbFile.File['meta'] - } - 'kubb-source': KubbFile.Source & { - children?: KubbNode - } - 'kubb-import': KubbFile.Import - 'kubb-export': KubbFile.Export - } - } -} - export type ElementNames = ReactElementNames | 'kubb-text' | 'kubb-file' | 'kubb-source' | 'kubb-import' | 'kubb-export' | 'kubb-root' | 'kubb-app' type Node = { @@ -68,6 +44,8 @@ type NodeNames = ElementNames | TextName export type KubbNode = ReactNode +export type { Key } from 'react' + export type JSDoc = { comments: string[] } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 0a757ee1f..aa68c4b4c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -7,23 +7,36 @@ settings: catalogs: default: '@types/react': - specifier: ^19.0.1 - version: 19.0.1 + specifier: ^18.3.16 + version: 18.3.16 '@types/react-dom': - specifier: ^19.0.1 - version: 19.0.2 + specifier: ^18.3.1 + version: 18.3.5 react: - specifier: ^19.0.0 - version: 19.0.0 + specifier: ^18.3.1 + version: 18.3.1 react-dom: - specifier: ^19.0.0 - version: 19.0.0 + specifier: ^18.3.1 + version: 18.3.1 tsup: specifier: ^8.3.5 version: 8.3.5 typescript: specifier: ^5.7.2 version: 5.7.2 + react18: + '@types/react': + specifier: ^18.3.16 + version: 18.3.16 + '@types/react-reconciler': + specifier: 0.28.9 + version: 0.28.9 + react: + specifier: ^18.3.1 + version: 18.3.1 + react-reconciler: + specifier: 0.29.2 + version: 0.29.2 overrides: '@changesets/assemble-release-plan': 6.0.0 @@ -96,7 +109,7 @@ importers: version: 8.0.0 vitepress: specifier: ^1.5.0 - version: 1.5.0(@algolia/client-search@5.17.1)(@types/node@20.17.10)(@types/react@18.3.16)(axios@1.7.9)(change-case@5.4.4)(postcss@8.4.49)(react@18.3.1)(search-insights@2.17.3)(terser@5.37.0)(typescript@5.7.2) + version: 1.5.0(@algolia/client-search@5.17.1)(@types/node@20.17.10)(@types/react@18.3.16)(axios@1.7.9)(change-case@5.4.4)(postcss@8.4.49)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(search-insights@2.17.3)(terser@5.37.0)(typescript@5.7.2) vitepress-plugin-group-icons: specifier: ^1.3.1 version: 1.3.1 @@ -153,20 +166,20 @@ importers: specifier: ^20.17.10 version: 20.17.10 '@types/react': - specifier: ^18.3.16 + specifier: 'catalog:' version: 18.3.16 cross-env: specifier: ^7.0.3 version: 7.0.3 react: - specifier: ^18.3.1 + specifier: 'catalog:' version: 18.3.1 unplugin-kubb: specifier: workspace:^ version: link:../packages/unplugin-kubb vite: - specifier: ^5.4.11 - version: 5.4.11(@types/node@20.17.10)(terser@5.37.0) + specifier: ^6.0.3 + version: 6.0.3(@types/node@20.17.10)(jiti@2.4.1)(terser@5.37.0)(yaml@2.6.1) e2e: dependencies: @@ -225,7 +238,7 @@ importers: specifier: ^2.6.8 version: 2.6.8(@types/node@20.17.10)(typescript@5.7.2) react: - specifier: ^18.3.1 + specifier: 'catalog:' version: 18.3.1 solid-js: specifier: ^1.9.3 @@ -597,29 +610,29 @@ importers: version: link:../../packages/react '@tanstack/react-query': specifier: ^5.62.7 - version: 5.62.7(react@19.0.0) + version: 5.62.7(react@18.3.1) '@tanstack/react-query-devtools': specifier: ^5.62.7 - version: 5.62.7(@tanstack/react-query@5.62.7(react@19.0.0))(react@19.0.0) + version: 5.62.7(@tanstack/react-query@5.62.7(react@18.3.1))(react@18.3.1) axios: specifier: ^1.7.9 version: 1.7.9 react: - specifier: ^19.0.0 - version: 19.0.0 + specifier: ^18.3.1 + version: 18.3.1 react-dom: specifier: ^19.0.0 - version: 19.0.0(react@19.0.0) + version: 19.0.0(react@18.3.1) unplugin-kubb: specifier: workspace:* version: link:../../packages/unplugin-kubb devDependencies: '@types/react': - specifier: ^19.0.1 - version: 19.0.1 + specifier: ^18.3.16 + version: 18.3.16 '@types/react-dom': specifier: ^19.0.2 - version: 19.0.2(@types/react@19.0.1) + version: 19.0.2(@types/react@18.3.16) '@vitejs/plugin-react': specifier: ^4.3.4 version: 4.3.4(vite@6.0.3(@types/node@20.17.10)(jiti@2.4.1)(terser@5.37.0)(yaml@2.6.1)) @@ -1305,10 +1318,10 @@ importers: version: link:../config-tsup '@types/react': specifier: 'catalog:' - version: 19.0.1 + version: 18.3.16 react: specifier: 'catalog:' - version: 19.0.0 + version: 18.3.1 tsup: specifier: 'catalog:' version: 8.3.5(@microsoft/api-extractor@7.48.1(@types/node@20.17.10))(jiti@2.4.1)(postcss@8.4.49)(typescript@5.7.2)(yaml@2.6.1) @@ -1345,10 +1358,10 @@ importers: version: link:../config-tsup '@types/react': specifier: 'catalog:' - version: 19.0.1 + version: 18.3.16 react: specifier: 'catalog:' - version: 19.0.0 + version: 18.3.1 tsup: specifier: 'catalog:' version: 8.3.5(@microsoft/api-extractor@7.48.1(@types/node@20.17.10))(jiti@2.4.1)(postcss@8.4.49)(typescript@5.7.2)(yaml@2.6.1) @@ -1391,10 +1404,10 @@ importers: version: link:../config-tsup '@types/react': specifier: 'catalog:' - version: 19.0.1 + version: 18.3.16 react: specifier: 'catalog:' - version: 19.0.0 + version: 18.3.1 tsup: specifier: 'catalog:' version: 8.3.5(@microsoft/api-extractor@7.48.1(@types/node@20.17.10))(jiti@2.4.1)(postcss@8.4.49)(typescript@5.7.2)(yaml@2.6.1) @@ -1424,16 +1437,16 @@ importers: version: 6.13.5 react: specifier: 'catalog:' - version: 19.0.0 + version: 18.3.1 react-dom: specifier: 'catalog:' - version: 19.0.0(react@19.0.0) + version: 18.3.1(react@18.3.1) redoc: specifier: ^2.2.0 - version: 2.2.0(core-js@3.39.0)(enzyme@3.11.0)(mobx@6.13.5)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(styled-components@6.1.13(react-dom@19.0.0(react@19.0.0))(react@19.0.0)) + version: 2.2.0(core-js@3.39.0)(enzyme@3.11.0)(mobx@6.13.5)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(styled-components@6.1.13(react-dom@18.3.1(react@18.3.1))(react@18.3.1)) styled-components: specifier: ^6.1.13 - version: 6.1.13(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + version: 6.1.13(react-dom@18.3.1(react@18.3.1))(react@18.3.1) devDependencies: '@kubb/config-ts': specifier: workspace:* @@ -1443,10 +1456,10 @@ importers: version: link:../config-tsup '@types/react': specifier: 'catalog:' - version: 19.0.1 + version: 18.3.16 '@types/react-dom': specifier: 'catalog:' - version: 19.0.2(@types/react@19.0.1) + version: 18.3.5(@types/react@18.3.16) tsup: specifier: 'catalog:' version: 8.3.5(@microsoft/api-extractor@7.48.1(@types/node@20.17.10))(jiti@2.4.1)(postcss@8.4.49)(typescript@5.7.2)(yaml@2.6.1) @@ -1489,10 +1502,10 @@ importers: version: link:../config-tsup '@types/react': specifier: 'catalog:' - version: 19.0.1 + version: 18.3.16 react: specifier: 'catalog:' - version: 19.0.0 + version: 18.3.1 tsup: specifier: 'catalog:' version: 8.3.5(@microsoft/api-extractor@7.48.1(@types/node@20.17.10))(jiti@2.4.1)(postcss@8.4.49)(typescript@5.7.2)(yaml@2.6.1) @@ -1535,10 +1548,10 @@ importers: version: link:../config-tsup '@types/react': specifier: 'catalog:' - version: 19.0.1 + version: 18.3.16 react: specifier: 'catalog:' - version: 19.0.0 + version: 18.3.1 tsup: specifier: 'catalog:' version: 8.3.5(@microsoft/api-extractor@7.48.1(@types/node@20.17.10))(jiti@2.4.1)(postcss@8.4.49)(typescript@5.7.2)(yaml@2.6.1) @@ -1584,10 +1597,10 @@ importers: version: link:../config-tsup '@types/react': specifier: 'catalog:' - version: 19.0.1 + version: 18.3.16 react: specifier: 'catalog:' - version: 19.0.0 + version: 18.3.1 tsup: specifier: 'catalog:' version: 8.3.5(@microsoft/api-extractor@7.48.1(@types/node@20.17.10))(jiti@2.4.1)(postcss@8.4.49)(typescript@5.7.2)(yaml@2.6.1) @@ -1624,10 +1637,10 @@ importers: version: link:../config-tsup '@types/react': specifier: 'catalog:' - version: 19.0.1 + version: 18.3.16 react: specifier: 'catalog:' - version: 19.0.0 + version: 18.3.1 tsup: specifier: 'catalog:' version: 8.3.5(@microsoft/api-extractor@7.48.1(@types/node@20.17.10))(jiti@2.4.1)(postcss@8.4.49)(typescript@5.7.2)(yaml@2.6.1) @@ -1670,10 +1683,10 @@ importers: version: link:../config-tsup '@types/react': specifier: 'catalog:' - version: 19.0.1 + version: 18.3.16 react: specifier: 'catalog:' - version: 19.0.0 + version: 18.3.1 tsup: specifier: 'catalog:' version: 8.3.5(@microsoft/api-extractor@7.48.1(@types/node@20.17.10))(jiti@2.4.1)(postcss@8.4.49)(typescript@5.7.2)(yaml@2.6.1) @@ -1736,14 +1749,14 @@ importers: specifier: ^4.0.0 version: 4.0.0 react: - specifier: 'catalog:' - version: 19.0.0 + specifier: catalog:react18 + version: 18.3.1 react-devtools-core: - specifier: ^6.0.1 - version: 6.0.1 + specifier: ^5.3.2 + version: 5.3.2 react-reconciler: - specifier: 0.31.0 - version: 0.31.0(react@19.0.0) + specifier: catalog:react18 + version: 0.29.2(react@18.3.1) signal-exit: specifier: ^4.1.0 version: 4.1.0 @@ -1758,11 +1771,11 @@ importers: specifier: workspace:* version: link:../config-tsup '@types/react': - specifier: 'catalog:' - version: 19.0.1 + specifier: catalog:react18 + version: 18.3.16 '@types/react-reconciler': - specifier: 0.28.9 - version: 0.28.9(@types/react@19.0.1) + specifier: catalog:react18 + version: 0.28.9(@types/react@18.3.16) '@types/signal-exit': specifier: ^3.0.4 version: 3.0.4 @@ -3226,6 +3239,11 @@ packages: '@types/range-parser@1.2.7': resolution: {integrity: sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==} + '@types/react-dom@18.3.5': + resolution: {integrity: sha512-P4t6saawp+b/dFrUr2cvkVsfvPguwsxtH6dNIYRllMsefqFzkZk5UIjzyDOv5g1dXIPdG4Sp1yCR4Z6RCUsG/Q==} + peerDependencies: + '@types/react': ^18.0.0 + '@types/react-dom@19.0.2': resolution: {integrity: sha512-c1s+7TKFaDRRxr1TxccIX2u7sfCnc3RxkVyBIUA2lCpyqCF+QoAwQ/CBg7bsMdVwP120HEH143VQezKtef5nCg==} peerDependencies: @@ -3239,9 +3257,6 @@ packages: '@types/react@18.3.16': resolution: {integrity: sha512-oh8AMIC4Y2ciKufU8hnKgs+ufgbA/dhPTACaZPM86AbwX9QwnFtSoPWEeRUj8fge+v6kFt78BXcDhAU1SrrAsw==} - '@types/react@19.0.1': - resolution: {integrity: sha512-YW6614BDhqbpR5KtUYzTA+zlA7nayzJRA9ljz9CQoxthR0sDisYZLuvSMsil36t4EH/uAt8T52Xb4sVw17G+SQ==} - '@types/sax@1.2.7': resolution: {integrity: sha512-rO73L89PJxeYM3s3pPPjiPgVVcymqU490g0YO5n5By0k2Erzj6tay/4lr1CHAAU4JyOWd1rpQ8bCf6cZfHU96A==} @@ -6329,8 +6344,10 @@ packages: react-devtools-core@5.3.2: resolution: {integrity: sha512-crr9HkVrDiJ0A4zot89oS0Cgv0Oa4OG1Em4jit3P3ZxZSKPMYyMjfwMqgcJna9o625g8oN87rBm8SWWrSTBZxg==} - react-devtools-core@6.0.1: - resolution: {integrity: sha512-II3iSJhnR5nAscYDa9FCgPLq8mO5aEx/EKKtdXYTDnvdFEa3K7gs3jn1SKRXwQf9maOmIilmjnnx7Qy+3annPA==} + react-dom@18.3.1: + resolution: {integrity: sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==} + peerDependencies: + react: ^18.3.1 react-dom@19.0.0: resolution: {integrity: sha512-4GV5sHFG0e/0AD4X+ySy6UJd3jVl1iNsNHdpad0qhABJ11twS3TTBnseqsKurKcsNqCEFeGL3uLpVChpIO3QfQ==} @@ -6349,12 +6366,6 @@ packages: peerDependencies: react: ^18.3.1 - react-reconciler@0.31.0: - resolution: {integrity: sha512-7Ob7Z+URmesIsIVRjnLoDGwBEG/tVitidU0nMsqX/eeJaLY89RISO/10ERe0MqmzuKUUB1rmY+h1itMbUHg9BQ==} - engines: {node: '>=0.10.0'} - peerDependencies: - react: ^19.0.0 - react-refresh@0.14.2: resolution: {integrity: sha512-jCvmsr+1IUSMUyzOkRcvnVbX3ZYC6g9TDrDbFuFmRDq7PD4yaGbLKNQL6k2jnArV8hjYxh7hVhAZB6s9HDGpZA==} engines: {node: '>=0.10.0'} @@ -6373,10 +6384,6 @@ packages: resolution: {integrity: sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==} engines: {node: '>=0.10.0'} - react@19.0.0: - resolution: {integrity: sha512-V8AVnmPIICiWpGfm6GLzCR/W5FXLchHop40W4nXBmdlEceh16rCN8O8LNWm5bh5XUX91fh7KpA+W0TgMKmgTpQ==} - engines: {node: '>=0.10.0'} - read-cache@1.0.0: resolution: {integrity: sha512-Owdv/Ft7IjOgm/i0xvNDZ1LrRANRfew4b2prF3OWMQLxLfu3bS8FVhCsrSCMK4lR56Y9ya+AThoTpDCTxCmpRA==} @@ -7977,16 +7984,16 @@ snapshots: '@types/tough-cookie': 4.0.5 tough-cookie: 4.1.4 - '@cfaester/enzyme-adapter-react-18@0.8.0(enzyme@3.11.0)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)': + '@cfaester/enzyme-adapter-react-18@0.8.0(enzyme@3.11.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': dependencies: enzyme: 3.11.0 enzyme-shallow-equal: 1.0.7 function.prototype.name: 1.1.6 has: 1.0.4 - react: 19.0.0 - react-dom: 19.0.0(react@19.0.0) + react: 18.3.1 + react-dom: 18.3.1(react@18.3.1) react-is: 18.3.1 - react-shallow-renderer: 16.15.0(react@19.0.0) + react-shallow-renderer: 16.15.0(react@18.3.1) '@changesets/apply-release-plan@7.0.6': dependencies: @@ -8168,9 +8175,9 @@ snapshots: '@docsearch/css@3.8.0': {} - '@docsearch/js@3.8.0(@algolia/client-search@5.17.1)(@types/react@18.3.16)(react@18.3.1)(search-insights@2.17.3)': + '@docsearch/js@3.8.0(@algolia/client-search@5.17.1)(@types/react@18.3.16)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(search-insights@2.17.3)': dependencies: - '@docsearch/react': 3.8.0(@algolia/client-search@5.17.1)(@types/react@18.3.16)(react@18.3.1)(search-insights@2.17.3) + '@docsearch/react': 3.8.0(@algolia/client-search@5.17.1)(@types/react@18.3.16)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(search-insights@2.17.3) preact: 10.25.2 transitivePeerDependencies: - '@algolia/client-search' @@ -8179,7 +8186,7 @@ snapshots: - react-dom - search-insights - '@docsearch/react@3.8.0(@algolia/client-search@5.17.1)(@types/react@18.3.16)(react@18.3.1)(search-insights@2.17.3)': + '@docsearch/react@3.8.0(@algolia/client-search@5.17.1)(@types/react@18.3.16)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(search-insights@2.17.3)': dependencies: '@algolia/autocomplete-core': 1.17.7(@algolia/client-search@5.17.1)(algoliasearch@5.17.1)(search-insights@2.17.3) '@algolia/autocomplete-preset-algolia': 1.17.7(@algolia/client-search@5.17.1)(algoliasearch@5.17.1) @@ -8188,6 +8195,7 @@ snapshots: optionalDependencies: '@types/react': 18.3.16 react: 18.3.1 + react-dom: 18.3.1(react@18.3.1) search-insights: 2.17.3 transitivePeerDependencies: - '@algolia/client-search' @@ -9001,22 +9009,17 @@ snapshots: '@tanstack/query-devtools@5.61.4': {} - '@tanstack/react-query-devtools@5.62.7(@tanstack/react-query@5.62.7(react@19.0.0))(react@19.0.0)': + '@tanstack/react-query-devtools@5.62.7(@tanstack/react-query@5.62.7(react@18.3.1))(react@18.3.1)': dependencies: '@tanstack/query-devtools': 5.61.4 - '@tanstack/react-query': 5.62.7(react@19.0.0) - react: 19.0.0 + '@tanstack/react-query': 5.62.7(react@18.3.1) + react: 18.3.1 '@tanstack/react-query@5.62.7(react@18.3.1)': dependencies: '@tanstack/query-core': 5.62.7 react: 18.3.1 - '@tanstack/react-query@5.62.7(react@19.0.0)': - dependencies: - '@tanstack/query-core': 5.62.7 - react: 19.0.0 - '@tanstack/solid-query@5.62.7(solid-js@1.9.3)': dependencies: '@tanstack/query-core': 5.62.7 @@ -9303,21 +9306,21 @@ snapshots: '@types/range-parser@1.2.7': {} - '@types/react-dom@19.0.2(@types/react@19.0.1)': + '@types/react-dom@18.3.5(@types/react@18.3.16)': dependencies: - '@types/react': 19.0.1 + '@types/react': 18.3.16 - '@types/react-reconciler@0.28.9(@types/react@19.0.1)': + '@types/react-dom@19.0.2(@types/react@18.3.16)': dependencies: - '@types/react': 19.0.1 + '@types/react': 18.3.16 - '@types/react@18.3.16': + '@types/react-reconciler@0.28.9(@types/react@18.3.16)': dependencies: - '@types/prop-types': 15.7.14 - csstype: 3.1.3 + '@types/react': 18.3.16 - '@types/react@19.0.1': + '@types/react@18.3.16': dependencies: + '@types/prop-types': 15.7.14 csstype: 3.1.3 '@types/sax@1.2.7': @@ -12208,21 +12211,21 @@ snapshots: pkg-types: 1.2.1 ufo: 1.5.4 - mobx-react-lite@4.1.0(mobx@6.13.5)(react-dom@19.0.0(react@19.0.0))(react@19.0.0): + mobx-react-lite@4.1.0(mobx@6.13.5)(react-dom@18.3.1(react@18.3.1))(react@18.3.1): dependencies: mobx: 6.13.5 - react: 19.0.0 - use-sync-external-store: 1.4.0(react@19.0.0) + react: 18.3.1 + use-sync-external-store: 1.4.0(react@18.3.1) optionalDependencies: - react-dom: 19.0.0(react@19.0.0) + react-dom: 18.3.1(react@18.3.1) - mobx-react@9.2.0(mobx@6.13.5)(react-dom@19.0.0(react@19.0.0))(react@19.0.0): + mobx-react@9.2.0(mobx@6.13.5)(react-dom@18.3.1(react@18.3.1))(react@18.3.1): dependencies: mobx: 6.13.5 - mobx-react-lite: 4.1.0(mobx@6.13.5)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - react: 19.0.0 + mobx-react-lite: 4.1.0(mobx@6.13.5)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + react: 18.3.1 optionalDependencies: - react-dom: 19.0.0(react@19.0.0) + react-dom: 18.3.1(react@18.3.1) mobx@6.13.5: {} @@ -12912,17 +12915,15 @@ snapshots: - bufferutil - utf-8-validate - react-devtools-core@6.0.1: + react-dom@18.3.1(react@18.3.1): dependencies: - shell-quote: 1.8.2 - ws: 7.5.10 - transitivePeerDependencies: - - bufferutil - - utf-8-validate + loose-envify: 1.4.0 + react: 18.3.1 + scheduler: 0.23.2 - react-dom@19.0.0(react@19.0.0): + react-dom@19.0.0(react@18.3.1): dependencies: - react: 19.0.0 + react: 18.3.1 scheduler: 0.25.0 react-is@16.13.1: {} @@ -12935,31 +12936,24 @@ snapshots: react: 18.3.1 scheduler: 0.23.2 - react-reconciler@0.31.0(react@19.0.0): - dependencies: - react: 19.0.0 - scheduler: 0.25.0 - react-refresh@0.14.2: {} - react-shallow-renderer@16.15.0(react@19.0.0): + react-shallow-renderer@16.15.0(react@18.3.1): dependencies: object-assign: 4.1.1 - react: 19.0.0 + react: 18.3.1 react-is: 18.3.1 - react-tabs@6.0.2(react@19.0.0): + react-tabs@6.0.2(react@18.3.1): dependencies: clsx: 2.1.1 prop-types: 15.8.1 - react: 19.0.0 + react: 18.3.1 react@18.3.1: dependencies: loose-envify: 1.4.0 - react@19.0.0: {} - read-cache@1.0.0: dependencies: pify: 2.3.0 @@ -12993,9 +12987,9 @@ snapshots: real-require@0.2.0: {} - redoc@2.2.0(core-js@3.39.0)(enzyme@3.11.0)(mobx@6.13.5)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(styled-components@6.1.13(react-dom@19.0.0(react@19.0.0))(react@19.0.0)): + redoc@2.2.0(core-js@3.39.0)(enzyme@3.11.0)(mobx@6.13.5)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(styled-components@6.1.13(react-dom@18.3.1(react@18.3.1))(react@18.3.1)): dependencies: - '@cfaester/enzyme-adapter-react-18': 0.8.0(enzyme@3.11.0)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@cfaester/enzyme-adapter-react-18': 0.8.0(enzyme@3.11.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@redocly/openapi-core': 1.26.0 classnames: 2.5.1 core-js: 3.39.0 @@ -13007,19 +13001,19 @@ snapshots: mark.js: 8.11.1 marked: 4.3.0 mobx: 6.13.5 - mobx-react: 9.2.0(mobx@6.13.5)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + mobx-react: 9.2.0(mobx@6.13.5)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) openapi-sampler: 1.6.1 path-browserify: 1.0.1 perfect-scrollbar: 1.5.6 polished: 4.3.1 prismjs: 1.29.0 prop-types: 15.8.1 - react: 19.0.0 - react-dom: 19.0.0(react@19.0.0) - react-tabs: 6.0.2(react@19.0.0) + react: 18.3.1 + react-dom: 18.3.1(react@18.3.1) + react-tabs: 6.0.2(react@18.3.1) slugify: 1.4.7 stickyfill: 1.1.1 - styled-components: 6.1.13(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + styled-components: 6.1.13(react-dom@18.3.1(react@18.3.1))(react@18.3.1) swagger2openapi: 7.0.8 url-template: 2.0.8 transitivePeerDependencies: @@ -13520,7 +13514,7 @@ snapshots: strnum@1.0.5: {} - styled-components@6.1.13(react-dom@19.0.0(react@19.0.0))(react@19.0.0): + styled-components@6.1.13(react-dom@18.3.1(react@18.3.1))(react@18.3.1): dependencies: '@emotion/is-prop-valid': 1.2.2 '@emotion/unitless': 0.8.1 @@ -13528,8 +13522,8 @@ snapshots: css-to-react-native: 3.2.0 csstype: 3.1.3 postcss: 8.4.38 - react: 19.0.0 - react-dom: 19.0.0(react@19.0.0) + react: 18.3.1 + react-dom: 18.3.1(react@18.3.1) shallowequal: 1.1.0 stylis: 4.3.2 tslib: 2.6.2 @@ -14058,10 +14052,6 @@ snapshots: dependencies: react: 18.3.1 - use-sync-external-store@1.4.0(react@19.0.0): - dependencies: - react: 19.0.0 - util-deprecate@1.0.2: {} util@0.12.5: @@ -14166,10 +14156,10 @@ snapshots: transitivePeerDependencies: - supports-color - vitepress@1.5.0(@algolia/client-search@5.17.1)(@types/node@20.17.10)(@types/react@18.3.16)(axios@1.7.9)(change-case@5.4.4)(postcss@8.4.49)(react@18.3.1)(search-insights@2.17.3)(terser@5.37.0)(typescript@5.7.2): + vitepress@1.5.0(@algolia/client-search@5.17.1)(@types/node@20.17.10)(@types/react@18.3.16)(axios@1.7.9)(change-case@5.4.4)(postcss@8.4.49)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(search-insights@2.17.3)(terser@5.37.0)(typescript@5.7.2): dependencies: '@docsearch/css': 3.8.0 - '@docsearch/js': 3.8.0(@algolia/client-search@5.17.1)(@types/react@18.3.16)(react@18.3.1)(search-insights@2.17.3) + '@docsearch/js': 3.8.0(@algolia/client-search@5.17.1)(@types/react@18.3.16)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(search-insights@2.17.3) '@iconify-json/simple-icons': 1.2.15 '@shikijs/core': 1.24.2 '@shikijs/transformers': 1.24.2 diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index ebece8501..5d20ed3c1 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -4,10 +4,29 @@ packages: - 'docs' - 'examples/*' - 'e2e' + +catalogs: + react18: + react: ^18.3.1 + react-dom: ^18.3.1 + "@types/react": ^18.3.16 + "@types/react-dom": ^18.3.1 + "@types/react-reconciler": 0.28.9 + "react-reconciler": 0.29.2 + react19: + react: ^19.0.0 + react-dom: ^19.0.0 + "@types/react": ^19.0.1 + "@types/react-dom": ^19.0.1 + "@types/react-reconciler": 0.28.9 + "react-reconciler": 0.31.0 + catalog: tsup: ^8.3.5 typescript: ^5.7.2 - react: ^19.0.0 - react-dom: ^19.0.0 - "@types/react": ^19.0.1 - "@types/react-dom": ^19.0.1 + react: ^18.3.1 + react-dom: ^18.3.1 + "@types/react": ^18.3.16 + "@types/react-dom": ^18.3.1 + "@types/react-reconciler": 0.28.9 + "react-reconciler": 0.29.2