From 369b8e2490f7e58807734e921ebe381578e50ee1 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Tue, 10 Jan 2023 14:34:34 +0100 Subject: [PATCH] move reactPeerCheck to addon docs --- code/{lib/cli => addons/docs}/src/ensure-react-peer-deps.ts | 0 code/addons/docs/src/preset.ts | 3 +++ code/lib/cli/package.json | 4 ---- code/lib/cli/src/build.ts | 3 --- code/lib/cli/src/dev.ts | 3 --- code/yarn.lock | 3 --- 6 files changed, 3 insertions(+), 13 deletions(-) rename code/{lib/cli => addons/docs}/src/ensure-react-peer-deps.ts (100%) diff --git a/code/lib/cli/src/ensure-react-peer-deps.ts b/code/addons/docs/src/ensure-react-peer-deps.ts similarity index 100% rename from code/lib/cli/src/ensure-react-peer-deps.ts rename to code/addons/docs/src/ensure-react-peer-deps.ts diff --git a/code/addons/docs/src/preset.ts b/code/addons/docs/src/preset.ts index 8e81b9e4e55a..3b7ac4a87a7a 100644 --- a/code/addons/docs/src/preset.ts +++ b/code/addons/docs/src/preset.ts @@ -7,6 +7,7 @@ import type { IndexerOptions, StoryIndexer, DocsOptions, Options } from '@storyb import type { CsfPluginOptions } from '@storybook/csf-plugin'; import type { JSXOptions } from '@storybook/mdx2-csf'; import { loadCsf } from '@storybook/csf-tools'; +import { ensureReactPeerDeps } from './ensure-react-peer-deps'; async function webpack( webpackConfig: any = {}, @@ -164,4 +165,6 @@ const webpackX = webpack as any; const storyIndexersX = storyIndexers as any; const docsX = docs as any; +ensureReactPeerDeps(); + export { webpackX as webpack, storyIndexersX as storyIndexers, docsX as docs }; diff --git a/code/lib/cli/package.json b/code/lib/cli/package.json index 620ee723890a..50d274eed646 100644 --- a/code/lib/cli/package.json +++ b/code/lib/cli/package.json @@ -88,10 +88,6 @@ "strip-json-comments": "^3.1.1", "typescript": "~4.9.3" }, - "peerDependencies": { - "react": "^16.8.0 || ^17.0.0 || ^18.0.0", - "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" - }, "publishConfig": { "access": "public" }, diff --git a/code/lib/cli/src/build.ts b/code/lib/cli/src/build.ts index e7e98899606f..2110be45d4fa 100644 --- a/code/lib/cli/src/build.ts +++ b/code/lib/cli/src/build.ts @@ -2,11 +2,8 @@ import { sync as readUpSync } from 'read-pkg-up'; import { logger } from '@storybook/node-logger'; import { buildStaticStandalone, withTelemetry } from '@storybook/core-server'; import { cache } from '@storybook/core-common'; -import { ensureReactPeerDeps } from './ensure-react-peer-deps'; export const build = async (cliOptions: any) => { - ensureReactPeerDeps(); - try { const options = { ...cliOptions, diff --git a/code/lib/cli/src/dev.ts b/code/lib/cli/src/dev.ts index 9f32b4547f5b..b50da7466229 100644 --- a/code/lib/cli/src/dev.ts +++ b/code/lib/cli/src/dev.ts @@ -3,13 +3,10 @@ import { sync as readUpSync } from 'read-pkg-up'; import { logger, instance as npmLog } from '@storybook/node-logger'; import { buildDevStandalone, withTelemetry } from '@storybook/core-server'; import { cache } from '@storybook/core-common'; -import { ensureReactPeerDeps } from './ensure-react-peer-deps'; export const dev = async (cliOptions: any) => { process.env.NODE_ENV = process.env.NODE_ENV || 'development'; - ensureReactPeerDeps(); - try { const options = { ...cliOptions, diff --git a/code/yarn.lock b/code/yarn.lock index f02a900b09bf..aaca185cfdf4 100644 --- a/code/yarn.lock +++ b/code/yarn.lock @@ -6185,9 +6185,6 @@ __metadata: ts-dedent: ^2.0.0 typescript: ~4.9.3 util-deprecate: ^1.0.2 - peerDependencies: - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 bin: getstorybook: ./bin/index.js sb: ./bin/index.js