From fb2abe9c0bf65f8e42e4d8d35fcc385c9cfecd2f Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Tue, 11 Oct 2022 23:49:24 +0200 Subject: [PATCH] make ui stories work --- ...otificationList.stories.js => NotificationList.stories.jsx} | 0 .../ui/src/settings/{about.stories.js => about.stories.jsx} | 0 code/package.json | 2 +- code/sb-for-sb-ui/main.ts | 3 +-- code/vite.config.ts | 3 ++- 5 files changed, 4 insertions(+), 4 deletions(-) rename code/lib/ui/src/components/notifications/{NotificationList.stories.js => NotificationList.stories.jsx} (100%) rename code/lib/ui/src/settings/{about.stories.js => about.stories.jsx} (100%) diff --git a/code/lib/ui/src/components/notifications/NotificationList.stories.js b/code/lib/ui/src/components/notifications/NotificationList.stories.jsx similarity index 100% rename from code/lib/ui/src/components/notifications/NotificationList.stories.js rename to code/lib/ui/src/components/notifications/NotificationList.stories.jsx diff --git a/code/lib/ui/src/settings/about.stories.js b/code/lib/ui/src/settings/about.stories.jsx similarity index 100% rename from code/lib/ui/src/settings/about.stories.js rename to code/lib/ui/src/settings/about.stories.jsx diff --git a/code/package.json b/code/package.json index 09080174974..b6d648a007a 100644 --- a/code/package.json +++ b/code/package.json @@ -80,7 +80,7 @@ "sandbox": "ts-node ../scripts/sandbox.ts", "serve-storybooks": "http-server ./built-storybooks -p 8001", "smoketest-storybooks": "cross-env STORYBOOK_DISPLAY_WARNING=true DISPLAY_WARNING=true node -r esm ../scripts/smoketest-storybooks.js", - "storybook:ui": "./lib/cli/bin/index.js dev -p 6006 --config-dir sb-for-sb-ui", + "storybook:ui": "./lib/cli/bin/index.js dev --config-dir sb-for-sb-ui --port 6006 --no-manager-cache", "test": "NODE_OPTIONS=--max_old_space_size=4096 jest --config ./jest.config.js", "test:cli": "npm --prefix lib/cli run test", "test:e2e-examples-playwright": "playwright test", diff --git a/code/sb-for-sb-ui/main.ts b/code/sb-for-sb-ui/main.ts index 419afdb8b6b..dab64348942 100644 --- a/code/sb-for-sb-ui/main.ts +++ b/code/sb-for-sb-ui/main.ts @@ -2,8 +2,7 @@ import type { StorybookConfig } from '../frameworks/react-vite/dist'; const config: StorybookConfig = { stories: [ - '../lib/ui/src/components/notifications/NotificationItem.stories.jsx', - // '../lib/ui/src/**/*.stories.@(ts|tsx|js|jsx|mdx)', + '../lib/ui/src/**/*.stories.@(ts|tsx|js|jsx|mdx)', // '../lib/components/src/**/*.stories.@(js|jsx|ts|tsx|mdx)', // './../../addons/interactions/**/*.stories.@(ts|tsx|js|jsx|mdx)', ], diff --git a/code/vite.config.ts b/code/vite.config.ts index 662550be670..64dc4cb3864 100644 --- a/code/vite.config.ts +++ b/code/vite.config.ts @@ -4,5 +4,6 @@ import react from '@vitejs/plugin-react'; // https://vitejs.dev/config/ export default defineConfig({ - plugins: [react()], + // TODO: remove classic jsxRuntime once we upgrade to React 18 + plugins: [react({ jsxRuntime: 'classic' })], });