From 5e7e505db92e9a5ad3fdb49b635983e7d9a28fa5 Mon Sep 17 00:00:00 2001 From: gaoyuan Date: Mon, 19 Feb 2024 18:07:15 +0800 Subject: [PATCH] feat(storybook): use uni-builder instead of modern.js builder as build tool (#5371) Co-authored-by: neverland --- .changeset/light-games-shave.md | 7 + .changeset/slimy-dogs-hang.md | 2 +- packages/storybook/builder/package.json | 34 +-- packages/storybook/builder/src/build.ts | 2 +- packages/storybook/builder/src/core.ts | 46 ++-- .../storybook/builder/src/docgen/index.ts | 3 +- .../storybook/builder/src/plugin-storybook.ts | 165 ++++++------ packages/storybook/builder/src/preset.ts | 9 +- packages/storybook/builder/src/types.ts | 19 +- packages/storybook/builder/src/utils.ts | 36 --- packages/storybook/framework/package.json | 2 +- packages/storybook/framework/src/preset.ts | 1 - pnpm-lock.yaml | 247 ++++++++++++++---- 13 files changed, 336 insertions(+), 237 deletions(-) create mode 100644 .changeset/light-games-shave.md diff --git a/.changeset/light-games-shave.md b/.changeset/light-games-shave.md new file mode 100644 index 000000000000..1def667e4aae --- /dev/null +++ b/.changeset/light-games-shave.md @@ -0,0 +1,7 @@ +--- +'@modern-js/storybook-builder': minor +--- + +feat(storybook): use uni-builder instead of modern.js builder as build tool + +feat(storybook): 使用 uni-builder 代替 modern.js builder 作为底层构建工具 diff --git a/.changeset/slimy-dogs-hang.md b/.changeset/slimy-dogs-hang.md index b782bca0ca5f..28a528f3f174 100644 --- a/.changeset/slimy-dogs-hang.md +++ b/.changeset/slimy-dogs-hang.md @@ -2,6 +2,6 @@ '@modern-js/builder-doc': patch --- -chore(plugin-vue): builder vue & vue2 plugin is no longer maintained,, please use rsbuild instead +chore(plugin-vue): builder vue & vue2 plugin is no longer maintained, please use rsbuild instead chore(plugin-vue): builder vue & vue2 插件不再维护, 请使用 rsbuild 代替 diff --git a/packages/storybook/builder/package.json b/packages/storybook/builder/package.json index 0af29eee6bf2..ebafad1f7fa8 100644 --- a/packages/storybook/builder/package.json +++ b/packages/storybook/builder/package.json @@ -56,23 +56,23 @@ }, "license": "MIT", "dependencies": { - "@modern-js/builder": "workspace:*", - "@modern-js/builder-shared": "workspace:*", + "@rsbuild/shared": "0.4.3", + "@modern-js/uni-builder": "workspace:*", "@modern-js/core": "workspace:*", "@modern-js/runtime": "workspace:*", "@modern-js/utils": "workspace:*", "@rspack/plugin-react-refresh": "0.4.5", - "@storybook/components": "~7.6.1", - "@storybook/core-common": "~7.6.1", - "@storybook/csf-plugin": "~7.6.1", + "@storybook/components": "~7.6.12", + "@storybook/core-common": "~7.6.12", + "@storybook/csf-plugin": "~7.6.12", "@storybook/global": "~5.0.0", "@storybook/mdx1-csf": "~1.0.0", "@storybook/mdx2-csf": "~1.1.0", - "@storybook/preview": "~7.6.1", - "@storybook/preview-api": "~7.6.1", + "@storybook/preview": "~7.6.12", + "@storybook/preview-api": "~7.6.12", "@storybook/react-docgen-typescript-plugin": "1.0.6--canary.9.0c3f3b7.0", - "@storybook/router": "~7.6.1", - "@storybook/theming": "~7.6.1", + "@storybook/router": "~7.6.12", + "@storybook/theming": "~7.6.12", "ast-types": "^0.14.2", "minimatch": "^9.0.3", "react-docgen": "6.0.0-alpha.3", @@ -83,28 +83,14 @@ "webpack-hot-middleware": "^2.25.4" }, "devDependencies": { - "@modern-js/builder-rspack-provider": "workspace:*", - "@modern-js/builder-webpack-provider": "workspace:*", "@modern-js/core": "workspace:*", "@scripts/build": "workspace:*", - "@storybook/types": "~7.6.1", + "@storybook/types": "~7.6.12", "@types/babel__core": "^7.20.1", "@types/serve-static": "^1.13.10", "@types/webpack-hot-middleware": "^2.25.6", "typescript": "^5.2.2" }, - "peerDependencies": { - "@modern-js/builder-webpack-provider": "workspace:^2.46.1", - "@modern-js/builder-rspack-provider": "workspace:^2.46.1" - }, - "peerDependenciesMeta": { - "@modern-js/builder-webpack-provider": { - "optional": true - }, - "@modern-js/builder-rspack-provider": { - "optional": true - } - }, "publishConfig": { "registry": "https://registry.npmjs.org/", "access": "public", diff --git a/packages/storybook/builder/src/build.ts b/packages/storybook/builder/src/build.ts index 9851d5a32d3c..a9cf99348064 100644 --- a/packages/storybook/builder/src/build.ts +++ b/packages/storybook/builder/src/build.ts @@ -1,5 +1,5 @@ import { dirname, join, parse } from 'path'; -import webpackDevMiddleware from '@modern-js/builder-shared/webpack-dev-middleware'; +import webpackDevMiddleware from '@rsbuild/shared/webpack-dev-middleware'; import webpackHotMiddleware from 'webpack-hot-middleware'; import serveStatic from 'serve-static'; import type { Builder as RawStorybookBuilder, Stats } from '@storybook/types'; diff --git a/packages/storybook/builder/src/core.ts b/packages/storybook/builder/src/core.ts index adc738a8a5e4..cc2b2a071207 100644 --- a/packages/storybook/builder/src/core.ts +++ b/packages/storybook/builder/src/core.ts @@ -1,10 +1,11 @@ -import { createBuilder, mergeBuilderConfig } from '@modern-js/builder'; +import { createUniBuilder } from '@modern-js/uni-builder'; +import { mergeRsbuildConfig, type RsbuildConfig } from '@rsbuild/shared'; import { loadConfig } from '@modern-js/core'; import type { Options } from '@storybook/types'; -import type { Compiler } from '@modern-js/builder-shared/webpack-dev-middleware'; -import type { BuilderConfig, BuilderOptions } from './types'; -import { getConfigFileName, getProvider, runWithErrorMsg } from './utils'; -import { pluginStorybook } from './plugin-storybook'; +import type { Compiler } from '@rsbuild/shared/webpack-dev-middleware'; +import type { BuilderOptions, BuilderConfig } from './types'; +import { getConfigFileName, runWithErrorMsg } from './utils'; +import { pluginStorybook, addonBabelAdapter } from './plugin-storybook'; export async function getCompiler( cwd: string, @@ -27,27 +28,24 @@ export async function getCompiler( (await presets.apply('modern', loadedConfig)) || loadedConfig; - const provider = await getProvider( - bundler, - mergeBuilderConfig(finalConfig, builderOptions.builderConfig) || {}, - ); + const uniBuilderConfig = builderOptions.builderConfig + ? (mergeRsbuildConfig( + finalConfig as RsbuildConfig, + builderOptions.builderConfig as RsbuildConfig, + ) as BuilderConfig) + : finalConfig || {}; + + const bundlerType = bundler || 'webpack'; - if (!provider) { - if (bundler) { - throw new Error( - `You choose to use ${bundler}, but @modern-js/builder-${bundler}-provider not found in your project, please install it`, - ); - } else { - throw new Error( - `Please install one provider first, try install @modern-js/builder-rspack-provider or @modern-js/builder-webpack-provider first`, - ); - } - } - - const builder = await createBuilder(provider, { + const builder = await createUniBuilder({ + bundlerType, cwd, target: 'web', - framework: 'modern.js storybook', + frameworkConfigPath: res?.path ? res.path : undefined, + config: + bundlerType === 'webpack' + ? await addonBabelAdapter(uniBuilderConfig, options) + : uniBuilderConfig, entry: { main: entries, }, @@ -58,5 +56,5 @@ export async function getCompiler( ...(finalConfig.builderPlugins || []), ]); - return builder.createCompiler() as Promise; + return builder.createCompiler(); } diff --git a/packages/storybook/builder/src/docgen/index.ts b/packages/storybook/builder/src/docgen/index.ts index 7f2d5f375605..28c473ddd057 100644 --- a/packages/storybook/builder/src/docgen/index.ts +++ b/packages/storybook/builder/src/docgen/index.ts @@ -1,7 +1,6 @@ import type { Options } from '@storybook/types'; import { CHAIN_ID, logger } from '@modern-js/utils'; -import { RspackConfig } from '@modern-js/builder-rspack-provider'; -import { WebpackChain } from '@modern-js/builder-webpack-provider'; +import type { RspackConfig, WebpackChain } from '@rsbuild/shared'; export type DocgenOptions = { reactDocgen?: 'react-docgen' | 'react-docgen-typescript' | false; diff --git a/packages/storybook/builder/src/plugin-storybook.ts b/packages/storybook/builder/src/plugin-storybook.ts index ba899eece72a..7a2f03800449 100644 --- a/packages/storybook/builder/src/plugin-storybook.ts +++ b/packages/storybook/builder/src/plugin-storybook.ts @@ -7,12 +7,6 @@ import { applyOptionsChain, logger, } from '@modern-js/utils'; -import { - BuilderPlugin, - SharedBuilderConfig, - ToolsBabelConfig, - mergeBuilderConfig, -} from '@modern-js/builder-shared'; import { CompileOptions } from '@storybook/mdx2-csf'; import type { CoreConfig, @@ -30,17 +24,19 @@ import { } from '@storybook/core-common'; import { globalsNameReferenceMap } from '@storybook/preview/globals'; import type { PluginItem } from '@babel/core'; -import type { - BuilderPluginAPI as WebpackAPI, - WebpackConfig, -} from '@modern-js/builder-webpack-provider'; -import type { - BuilderPluginAPI as RspackAPI, - RspackConfig, -} from '@modern-js/builder-rspack-provider'; +import { + type RsbuildPlugin, + type RsbuildPluginAPI, + type RsbuildConfig, + type WebpackConfig, + type RspackConfig, + mergeRsbuildConfig, +} from '@rsbuild/shared'; + import { unplugin as csfPlugin } from '@storybook/csf-plugin'; import { minimatch } from 'minimatch'; -import { AllBuilderConfig, BuilderOptions } from './types'; +import type { UniBuilderConfig } from '@modern-js/uni-builder'; +import { BuilderConfig, BuilderOptions } from './types'; import { toImportFn, virtualModule, @@ -64,7 +60,7 @@ export async function finalize() { export const pluginStorybook: ( cwd: string, options: Options, -) => BuilderPlugin = (cwd, options) => { +) => RsbuildPlugin = (cwd, options) => { return { name: 'builder-plugin-storybook', @@ -89,7 +85,7 @@ export const pluginStorybook: ( return absolutePattern; }); - api.modifyBuilderConfig(async builderConfig => { + api.modifyRsbuildConfig(async builderConfig => { // storybook needs a virtual entry, // when new stories get created, the // entry needs to be recauculated @@ -120,14 +116,14 @@ export const pluginStorybook: ( await applyCsfPlugin(config, options); }; - if ('modifyWebpackConfig' in api) { + if (api.context.bundlerType === 'webpack') { addonAdapter(api, options); api.modifyWebpackConfig(modifyConfig); api.modifyWebpackChain(async chain => { await applyDocgenWebpack(chain, options); }); - } else if ('modifyRspackConfig' in api) { + } else { api.modifyRspackConfig(async config => { await modifyConfig(config); await applyDocgenRspack(config, options); @@ -168,7 +164,7 @@ async function prepareStorybookModules( tempDir: string, cwd: string, options: Options, - builderConfig: SharedBuilderConfig, + builderConfig: RsbuildConfig, storyPatterns: string[], ) { const mappings = await createStorybookModules(cwd, options, storyPatterns); @@ -196,6 +192,7 @@ async function prepareStorybookModules( ...mappingsAlias, }, builderConfig.source.alias, + { target: 'web' }, ); if (isDev()) { @@ -206,7 +203,7 @@ async function prepareStorybookModules( } } -async function applyDefines(builderConfig: AllBuilderConfig, options: Options) { +async function applyDefines(builderConfig: RsbuildConfig, options: Options) { const { presets } = options; const envs = await presets.apply>('env'); @@ -219,7 +216,7 @@ async function applyDefines(builderConfig: AllBuilderConfig, options: Options) { }; } -async function applyHTML(builderConfig: AllBuilderConfig, options: Options) { +async function applyHTML(builderConfig: RsbuildConfig, options: Options) { const { presets, packageJson, @@ -338,8 +335,8 @@ async function applyMdxLoader( ); } -function applyExternals(builderConfig: AllBuilderConfig) { - const config = mergeBuilderConfig( +function applyExternals(builderConfig: RsbuildConfig) { + const config = mergeRsbuildConfig( { output: { ...builderConfig.output, @@ -422,7 +419,7 @@ async function createStoriesEntry(cwd: string, storyPatterns: string[]) { return await toImportFn(cwd, stories); } -async function applyReact(config: AllBuilderConfig, options: Options) { +async function applyReact(config: RsbuildConfig, options: Options) { let version = '18.0.0'; try { // @ts-expect-error @@ -443,6 +440,7 @@ async function applyReact(config: AllBuilderConfig, options: Options) { '@storybook/react-dom-shim': '@storybook/react-dom-shim/dist/react-18', }, config.source.alias, + { target: 'web' }, ); } } @@ -488,63 +486,10 @@ async function watchStories( /** * Some addons expose babel plugins and presets, or modify webpack */ -function addonAdapter(api: WebpackAPI | RspackAPI, options: Options) { +function addonAdapter(api: RsbuildPluginAPI, options: Options) { const { presets } = options; - api.modifyBuilderConfig(async finalConfig => { - const babelOptions = await presets.apply('babel', {}, { ...options }); - finalConfig.tools ??= {}; - const userConfig = finalConfig.tools.babel; - finalConfig.tools.babel = (config, utils) => { - const getPluginName = (plugin: PluginItem) => - Array.isArray(plugin) ? plugin[0] : plugin; - const getOptions = (plugin: PluginItem) => - Array.isArray(plugin) ? plugin[1] : null; - - const replaceOrInsert = (plugin: PluginItem, plugins: PluginItem[]) => { - const pluginName = getPluginName(plugin); - - for (let i = 0; i < plugins.length; i++) { - if (getPluginName(plugins[i]) === pluginName) { - if (getOptions(plugin)) { - logger.info( - `Detected duplicated babel plugin or presets: ${pluginName}, overrides with the new one`, - ); - plugins[i] = plugin; - } - return; - } - } - - plugins.push(plugin); - }; - - const currentPlugins = config.plugins || []; - const currentPresets = config.presets || []; - - // O(n * n) but the number of plugins should be small - for (const plugin of babelOptions.plugins || []) { - replaceOrInsert(plugin, currentPlugins); - } - for (const preset of babelOptions.presets || []) { - replaceOrInsert(preset, currentPresets); - } - - const finalConfig: ToolsBabelConfig = { - ...babelOptions, - plugins: currentPlugins, - presets: currentPresets, - }; - - if (userConfig) { - return applyOptionsChain(finalConfig, userConfig, utils); - } else { - return finalConfig; - } - }; - }); - - (api as WebpackAPI).modifyWebpackConfig(async config => { + api.modifyWebpackConfig(async config => { const finalDefaultConfig = await presets.apply( 'webpackFinal', config, @@ -553,3 +498,63 @@ function addonAdapter(api: WebpackAPI | RspackAPI, options: Options) { return finalDefaultConfig; }); } + +export async function addonBabelAdapter( + finalConfig: BuilderConfig, + options: Options, +) { + const { presets } = options; + + const babelOptions = await presets.apply('babel', {}, { ...options }); + finalConfig.tools ??= {}; + const userConfig = finalConfig.tools.babel; + finalConfig.tools.babel = (config, utils) => { + const getPluginName = (plugin: PluginItem) => + Array.isArray(plugin) ? plugin[0] : plugin; + const getOptions = (plugin: PluginItem) => + Array.isArray(plugin) ? plugin[1] : null; + + const replaceOrInsert = (plugin: PluginItem, plugins: PluginItem[]) => { + const pluginName = getPluginName(plugin); + + for (let i = 0; i < plugins.length; i++) { + if (getPluginName(plugins[i]) === pluginName) { + if (getOptions(plugin)) { + logger.info( + `Detected duplicated babel plugin or presets: ${pluginName}, overrides with the new one`, + ); + plugins[i] = plugin; + } + return; + } + } + + plugins.push(plugin); + }; + + const currentPlugins = config.plugins || []; + const currentPresets = config.presets || []; + + // O(n * n) but the number of plugins should be small + for (const plugin of babelOptions.plugins || []) { + replaceOrInsert(plugin, currentPlugins); + } + for (const preset of babelOptions.presets || []) { + replaceOrInsert(preset, currentPresets); + } + + const finalConfig: NonNullable['babel'] = { + ...babelOptions, + plugins: currentPlugins, + presets: currentPresets, + }; + + if (userConfig) { + return applyOptionsChain(finalConfig, userConfig, utils); + } else { + return finalConfig; + } + }; + + return finalConfig; +} diff --git a/packages/storybook/builder/src/preset.ts b/packages/storybook/builder/src/preset.ts index 6d8d5d7cb420..154aca29af45 100644 --- a/packages/storybook/builder/src/preset.ts +++ b/packages/storybook/builder/src/preset.ts @@ -1,8 +1,8 @@ import { join, resolve } from 'path'; import type { Options } from '@storybook/types'; +import type { UniBuilderConfig } from '@modern-js/uni-builder'; import { getConfig } from './build'; import { STORYBOOK_CONFIG_ENTRY } from './utils'; -import { BuilderConfig } from './types'; export const previewMainTemplate = () => { return require.resolve('@modern-js/storybook-builder/templates/preview.ejs'); @@ -38,12 +38,13 @@ export const entries = async (_: unknown, options: Options) => { }; export const modern = ( - builderConfig: BuilderConfig, + builderConfig: UniBuilderConfig, options: Options, -): BuilderConfig => { - // @ts-expect-error +): UniBuilderConfig => { return { ...builderConfig, + // modern plugin can't be used as Rsbuild plugin + plugins: [], output: { ...builderConfig.output, diff --git a/packages/storybook/builder/src/types.ts b/packages/storybook/builder/src/types.ts index 916e2d77a827..a8e0768199f8 100644 --- a/packages/storybook/builder/src/types.ts +++ b/packages/storybook/builder/src/types.ts @@ -1,21 +1,18 @@ -import type { BuilderConfig as WebpackBuilderConfig } from '@modern-js/builder-webpack-provider'; -import type { BuilderConfig as RspackBuilderConfig } from '@modern-js/builder-rspack-provider'; -import { BuilderPlugin } from '@modern-js/builder-shared'; +import type { RsbuildPlugin } from '@rsbuild/shared'; +import type { UniBuilderConfig } from '@modern-js/uni-builder'; export type BundlerType = 'webpack' | 'rspack'; -export type { WebpackBuilderConfig, RspackBuilderConfig }; - -export type AllBuilderConfig = WebpackBuilderConfig | RspackBuilderConfig; - export type BuilderOptions = { bundler?: BundlerType; - builderConfig?: AllBuilderConfig; + builderConfig?: UniBuilderConfig; configPath?: string; }; -export type BuilderConfig = AllBuilderConfig & { - builderPlugins?: BuilderPlugin[]; +export type BuilderConfig = UniBuilderConfig & { + builderPlugins?: RsbuildPlugin[]; }; -export { defineConfig } from '@modern-js/builder/cli'; +export function defineConfig(config: UniBuilderConfig) { + return config; +} diff --git a/packages/storybook/builder/src/utils.ts b/packages/storybook/builder/src/utils.ts index 15fa9b91ea42..6d9a4f00010f 100644 --- a/packages/storybook/builder/src/utils.ts +++ b/packages/storybook/builder/src/utils.ts @@ -2,13 +2,6 @@ import path, { dirname, join } from 'path'; import { createRequire } from 'node:module'; import { fs, logger } from '@modern-js/utils'; -import { BuilderWebpackProvider } from '@modern-js/builder-webpack-provider'; -import { BuilderRspackProvider } from '@modern-js/builder-rspack-provider'; -import { - AllBuilderConfig, - RspackBuilderConfig, - WebpackBuilderConfig, -} from './types'; export const VIRTUAL_MODULE_BASE = '.MODERN_STORYBOOK'; @@ -20,35 +13,6 @@ export const requireResolve = (importer: string, path: string) => { require.resolve(path); }; -export async function getProvider( - bundler: 'webpack' | 'rspack' | undefined, - builderConfig: AllBuilderConfig, -): Promise { - try { - if (bundler === 'webpack') { - const { builderWebpackProvider } = await import( - '@modern-js/builder-webpack-provider' - ); - return builderWebpackProvider({ - builderConfig: builderConfig as WebpackBuilderConfig, - }); - } else if (bundler === 'rspack') { - const { builderRspackProvider } = await import( - '@modern-js/builder-rspack-provider' - ); - return builderRspackProvider({ - builderConfig: builderConfig as RspackBuilderConfig, - }); - } else { - // auto detect - return ( - (await getProvider('webpack', builderConfig)) || - (await getProvider('rspack', builderConfig)) - ); - } - } catch (e) {} -} - // use this instead of virtualModuleWebpackPlugin for rspack compatibility export async function virtualModule( tempDir: string, diff --git a/packages/storybook/framework/package.json b/packages/storybook/framework/package.json index 7a68d806b062..f879d2081c9e 100644 --- a/packages/storybook/framework/package.json +++ b/packages/storybook/framework/package.json @@ -68,7 +68,7 @@ "storybook": "~7.6.1" }, "devDependencies": { - "@storybook/types": "~7.6.1", + "@storybook/types": "~7.6.12", "typescript": "^5.2.2", "@types/node": "^20.5.6" }, diff --git a/packages/storybook/framework/src/preset.ts b/packages/storybook/framework/src/preset.ts index 3eeb2a89175d..fdc29c01bad5 100644 --- a/packages/storybook/framework/src/preset.ts +++ b/packages/storybook/framework/src/preset.ts @@ -31,7 +31,6 @@ export const modern = ( config: BuilderConfig, _options: Options, ): BuilderConfig => { - // @ts-expect-error return { ...config, source: { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 107c2295aad9..28657480a92b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -4850,33 +4850,33 @@ importers: packages/storybook/builder: dependencies: - '@modern-js/builder': - specifier: workspace:* - version: link:../../builder/builder - '@modern-js/builder-shared': - specifier: workspace:* - version: link:../../builder/builder-shared '@modern-js/core': specifier: workspace:* version: link:../../cli/core '@modern-js/runtime': specifier: workspace:* version: link:../../runtime/plugin-runtime + '@modern-js/uni-builder': + specifier: workspace:* + version: link:../../builder/uni-builder '@modern-js/utils': specifier: workspace:* version: link:../../toolkit/utils + '@rsbuild/shared': + specifier: 0.4.3 + version: 0.4.3(@swc/helpers@0.5.3) '@rspack/plugin-react-refresh': specifier: 0.4.5 version: 0.4.5(react-refresh@0.14.0) '@storybook/components': - specifier: ~7.6.1 - version: 7.6.3(@types/react-dom@18.0.6)(@types/react@18.0.21)(react-dom@18.2.0)(react@18.2.0) + specifier: ~7.6.12 + version: 7.6.12(@types/react-dom@18.0.6)(@types/react@18.0.21)(react-dom@18.2.0)(react@18.2.0) '@storybook/core-common': - specifier: ~7.6.1 - version: 7.6.3 + specifier: ~7.6.12 + version: 7.6.12 '@storybook/csf-plugin': - specifier: ~7.6.1 - version: 7.6.3 + specifier: ~7.6.12 + version: 7.6.12 '@storybook/global': specifier: ~5.0.0 version: 5.0.0 @@ -4887,20 +4887,20 @@ importers: specifier: ~1.1.0 version: 1.1.0 '@storybook/preview': - specifier: ~7.6.1 - version: 7.6.3 + specifier: ~7.6.12 + version: 7.6.12 '@storybook/preview-api': - specifier: ~7.6.1 - version: 7.6.3 + specifier: ~7.6.12 + version: 7.6.12 '@storybook/react-docgen-typescript-plugin': specifier: 1.0.6--canary.9.0c3f3b7.0 version: 1.0.6--canary.9.0c3f3b7.0(typescript@5.3.3)(webpack@5.89.0) '@storybook/router': - specifier: ~7.6.1 - version: 7.6.3 + specifier: ~7.6.12 + version: 7.6.12 '@storybook/theming': - specifier: ~7.6.1 - version: 7.6.3(react-dom@18.2.0)(react@18.2.0) + specifier: ~7.6.12 + version: 7.6.12(react-dom@18.2.0)(react@18.2.0) ast-types: specifier: ^0.14.2 version: 0.14.2 @@ -4926,18 +4926,12 @@ importers: specifier: ^2.25.4 version: 2.25.4 devDependencies: - '@modern-js/builder-rspack-provider': - specifier: workspace:* - version: link:../../builder/builder-rspack-provider - '@modern-js/builder-webpack-provider': - specifier: workspace:* - version: link:../../builder/builder-webpack-provider '@scripts/build': specifier: workspace:* version: link:../../../scripts/build '@storybook/types': - specifier: ~7.6.1 - version: 7.6.3 + specifier: ~7.6.12 + version: 7.6.12 '@types/babel__core': specifier: ^7.20.1 version: 7.20.3 @@ -4967,8 +4961,8 @@ importers: version: 7.6.3 devDependencies: '@storybook/types': - specifier: ~7.6.1 - version: 7.6.3 + specifier: ~7.6.12 + version: 7.6.12 '@types/node': specifier: ^20.5.6 version: 20.8.8 @@ -12366,7 +12360,7 @@ packages: resolution: {integrity: sha512-51Uv2oueWru4BvoE7VHai03wT0VZ1VFNPrDXR3Rd3DanRdM5BDBs28mB6+pz68SFQPjK7/f2ZgqRr0FjGWhUvg==} dependencies: '@swc/helpers': 0.5.1 - caniuse-lite: 1.0.30001566 + caniuse-lite: 1.0.30001584 lodash: 4.17.21 rslog: 1.1.0 @@ -15686,13 +15680,23 @@ packages: - supports-color dev: false + /@storybook/channels@7.6.12: + resolution: {integrity: sha512-TaPl5Y3lOoVi5kTLgKNRX8xh2sUPekH0Id1l4Ymw+lpgriEY6r60bmkZLysLG1GhlskpQ/da2+S2ap2ht8P2TQ==} + dependencies: + '@storybook/client-logger': 7.6.12 + '@storybook/core-events': 7.6.12 + '@storybook/global': 5.0.0 + qs: 6.11.2 + telejson: 7.2.0 + tiny-invariant: 1.3.1 + /@storybook/channels@7.6.3: resolution: {integrity: sha512-o9J0TBbFon16tUlU5V6kJgzAlsloJcS1cTHWqh3VWczohbRm+X1PLNUihJ7Q8kBWXAuuJkgBu7RQH7Ib46WyYg==} dependencies: '@storybook/client-logger': 7.6.3 '@storybook/core-events': 7.6.3 '@storybook/global': 5.0.0 - qs: 6.11.0 + qs: 6.11.2 telejson: 7.2.0 tiny-invariant: 1.3.1 @@ -15748,6 +15752,11 @@ packages: - utf-8-validate dev: false + /@storybook/client-logger@7.6.12: + resolution: {integrity: sha512-hiRv6dXsOttMPqm9SxEuFoAtDe9rs7TUS8XcO5rmJ9BgfwBJsYlHzAxXkazxmvlyZtKL7gMx6m8OYbCdZgUqtA==} + dependencies: + '@storybook/global': 5.0.0 + /@storybook/client-logger@7.6.3: resolution: {integrity: sha512-BpsCnefrBFdxD6ukMjAblm1D6zB4U5HR1I85VWw6LOqZrfzA6l/1uBxItz0XG96HTjngbvAabWf5k7ZFCx5UCg==} dependencies: @@ -15774,6 +15783,29 @@ packages: - supports-color dev: false + /@storybook/components@7.6.12(@types/react-dom@18.0.6)(@types/react@18.0.21)(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-PCijPqmlZd7qyTzNr+vD0Kf8sAI9vWJIaxbSjXwn/De3e63m4fsEcIf8FaUT8cMZ46AWZvaxaxX5km2u0UISJQ==} + peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 + dependencies: + '@radix-ui/react-select': 1.2.2(@types/react-dom@18.0.6)(@types/react@18.0.21)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-toolbar': 1.0.4(@types/react-dom@18.0.6)(@types/react@18.0.21)(react-dom@18.2.0)(react@18.2.0) + '@storybook/client-logger': 7.6.12 + '@storybook/csf': 0.1.2 + '@storybook/global': 5.0.0 + '@storybook/theming': 7.6.12(react-dom@18.2.0)(react@18.2.0) + '@storybook/types': 7.6.12 + memoizerific: 1.11.3 + react: 18.2.0 + react-dom: 18.2.0(react@18.2.0) + use-resize-observer: 9.1.0(react-dom@18.2.0)(react@18.2.0) + util-deprecate: 1.0.2 + transitivePeerDependencies: + - '@types/react' + - '@types/react-dom' + dev: false + /@storybook/components@7.6.3(@types/react-dom@18.0.6)(@types/react@18.0.21)(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-UNV0WoUo+W0huOLvoEMuqRN/VB4p0CNswrXN1mi/oGWvAFJ8idu63lSuV4uQ/LKxAZ6v3Kpdd+oK/o+OeOoL6w==} peerDependencies: @@ -15795,6 +15827,7 @@ packages: transitivePeerDependencies: - '@types/react' - '@types/react-dom' + dev: true /@storybook/core-client@7.6.3: resolution: {integrity: sha512-RM0Svlajddl8PP4Vq7LK8T22sFefNcTDgo82iRPZzGz0oH8LT0oXGFanj2Nkn0jruOBFClkiJ7EcwrbGJZHELg==} @@ -15803,6 +15836,37 @@ packages: '@storybook/preview-api': 7.6.3 dev: false + /@storybook/core-common@7.6.12: + resolution: {integrity: sha512-kM9YiBBMM2x5v/oylL7gdO1PS4oehgJC21MivS9p5QZ8uuXKtCQ6UQvI3rzaV+1ZzUA4n+I8MyaMrNIQk8KDbw==} + dependencies: + '@storybook/core-events': 7.6.12 + '@storybook/node-logger': 7.6.12 + '@storybook/types': 7.6.12 + '@types/find-cache-dir': 3.2.1 + '@types/node': 18.11.17 + '@types/node-fetch': 2.6.7 + '@types/pretty-hrtime': 1.0.1 + chalk: 4.1.2 + esbuild: 0.18.20 + esbuild-register: 3.5.0(esbuild@0.18.20) + file-system-cache: 2.3.0 + find-cache-dir: 3.3.2 + find-up: 5.0.0 + fs-extra: 11.2.0 + glob: 10.3.10 + handlebars: 4.7.7 + lazy-universal-dotenv: 4.0.0 + node-fetch: 2.6.7(encoding@0.1.13) + picomatch: 2.3.1 + pkg-dir: 5.0.0 + pretty-hrtime: 1.0.3 + resolve-from: 5.0.0 + ts-dedent: 2.2.0 + transitivePeerDependencies: + - encoding + - supports-color + dev: false + /@storybook/core-common@7.6.3: resolution: {integrity: sha512-/ZE4BEyGwBHCQCOo681GyBKF4IqCiwVV/ZJCHTMTHFCPLJT2r+Qwv4tnI7xt1kwflOlbBlG6B6CvAqTjjVw/Ew==} dependencies: @@ -15819,7 +15883,7 @@ packages: file-system-cache: 2.3.0 find-cache-dir: 3.3.2 find-up: 5.0.0 - fs-extra: 11.1.1 + fs-extra: 11.2.0 glob: 10.3.10 handlebars: 4.7.7 lazy-universal-dotenv: 4.0.0 @@ -15833,6 +15897,11 @@ packages: - encoding - supports-color + /@storybook/core-events@7.6.12: + resolution: {integrity: sha512-IO4cwk7bBCKH6lLnnIlHO9FwQXt/9CzLUAoZSY9msWsdPppCdKlw8ynJI5YarSNKDBUn8ArIfnRf0Mve0KQr9Q==} + dependencies: + ts-dedent: 2.2.0 + /@storybook/core-events@7.6.3: resolution: {integrity: sha512-Vu3JX1mjtR8AX84lyqWsi2s2lhD997jKRWVznI3wx+UpTk8t7TTMLFk2rGYJRjaornhrqwvLYpnmtxRSxW9BOQ==} dependencies: @@ -15889,13 +15958,39 @@ packages: - utf-8-validate dev: false + /@storybook/csf-plugin@7.6.12: + resolution: {integrity: sha512-fe/84AyctJcrpH1F/tTBxKrbjv0ilmG3ZTwVcufEiAzupZuYjQ/0P+Pxs8m8VxiGJZZ1pWofFFDbYi+wERjamQ==} + dependencies: + '@storybook/csf-tools': 7.6.12 + unplugin: 1.6.0 + transitivePeerDependencies: + - supports-color + dev: false + /@storybook/csf-plugin@7.6.3: resolution: {integrity: sha512-8bMYPsWw2tv+fqZ5H436l4x1KLSB6gIcm6snsjyF916yCHG6WcWm+EI6+wNUoySEtrQY2AiwFJqE37wI5OUJFg==} dependencies: '@storybook/csf-tools': 7.6.3 - unplugin: 1.5.0 + unplugin: 1.6.0 + transitivePeerDependencies: + - supports-color + dev: true + + /@storybook/csf-tools@7.6.12: + resolution: {integrity: sha512-MdhkYYxSW5I6Jpk34gTkAZsuj9sxe0xdyeUQpNa8CgJxG43F+ehZ6scW/IPjoSG9gCXBUJMekq26UrmbVfsLCQ==} + dependencies: + '@babel/generator': 7.23.6 + '@babel/parser': 7.23.6 + '@babel/traverse': 7.23.6 + '@babel/types': 7.23.6 + '@storybook/csf': 0.1.2 + '@storybook/types': 7.6.12 + fs-extra: 11.2.0 + recast: 0.23.4 + ts-dedent: 2.2.0 transitivePeerDependencies: - supports-color + dev: false /@storybook/csf-tools@7.6.3: resolution: {integrity: sha512-Zi3pg2pg88/mvBKewkfWhFUR1J4uYpHI5fSjOE+J/FeZObX/DIE7r+wJxZ0UBGyrk0Wy7Jajlb2uSP56Y0i19w==} @@ -15978,6 +16073,10 @@ packages: /@storybook/mdx2-csf@1.1.0: resolution: {integrity: sha512-TXJJd5RAKakWx4BtpwvSNdgTDkKM6RkXU8GK34S/LhidQ5Pjz3wcnqb0TxEkfhK/ztbP8nKHqXFwLfa2CYkvQw==} + /@storybook/node-logger@7.6.12: + resolution: {integrity: sha512-iS44/EjfF6hLecKzICmcpQoB9bmVi4tXx5gVXnbI5ZyziBibRQcg/U191Njl7wY2ScN/RCQOr8lh5k57rI3Prg==} + dev: false + /@storybook/node-logger@7.6.3: resolution: {integrity: sha512-7yL0CMHuh1DhpUAoKCU0a53DvxBpkUom9SX5RaC1G2A9BK/B3XcHtDPAC0uyUwNCKLJMZo9QtmJspvxWjR0LtA==} @@ -15985,6 +16084,25 @@ packages: resolution: {integrity: sha512-WpgdpJpY6rionluxjFZLbKiSDjvQJ5cPgufjvBRuXTsnVOsH3JNRWnPdkQkJLT9uTUMoNcyBMxbjYkK3vU6wSg==} dev: true + /@storybook/preview-api@7.6.12: + resolution: {integrity: sha512-uSzeMSLnCRROjiofJP0F0niLWL+sboQ5ktHW6BAYoPwprumXduPxKBUVEZNxMbVYoAz9v/kEZmaLauh8LRP2Hg==} + dependencies: + '@storybook/channels': 7.6.12 + '@storybook/client-logger': 7.6.12 + '@storybook/core-events': 7.6.12 + '@storybook/csf': 0.1.2 + '@storybook/global': 5.0.0 + '@storybook/types': 7.6.12 + '@types/qs': 6.9.7 + dequal: 2.0.3 + lodash: 4.17.21 + memoizerific: 1.11.3 + qs: 6.11.2 + synchronous-promise: 2.0.15 + ts-dedent: 2.2.0 + util-deprecate: 1.0.2 + dev: false + /@storybook/preview-api@7.6.3: resolution: {integrity: sha512-uPaK7yLE1P++F+IOb/1j9pgdCwfMYZrUPHogF/Mf9r4cfEjDCcIeKgGMcsbU1KnkzNQQGPh8JRzRr/iYnLjswg==} dependencies: @@ -15998,13 +16116,13 @@ packages: dequal: 2.0.3 lodash: 4.17.21 memoizerific: 1.11.3 - qs: 6.11.0 + qs: 6.11.2 synchronous-promise: 2.0.15 ts-dedent: 2.2.0 util-deprecate: 1.0.2 - /@storybook/preview@7.6.3: - resolution: {integrity: sha512-obSmKN8arWSHuLbCDM1H0lTVRMvAP/l7vOi6TQtFi6TxBz9MRCJA3Ugc0PZrbDADVZP+cp0ZJA0JQtAm+SqNAA==} + /@storybook/preview@7.6.12: + resolution: {integrity: sha512-7vbeqQY3X+FCt/ccgCuBmj4rkbQebLHGEBAt8elcX0E2pr7SGW57lWhnasU3jeMaz7tNrkcs0gfl4hyVRWUHDg==} dev: false /@storybook/react-docgen-typescript-plugin@1.0.6--canary.9.0c3f3b7.0(typescript@5.3.3)(webpack@5.89.0): @@ -16075,12 +16193,21 @@ packages: - supports-color dev: false + /@storybook/router@7.6.12: + resolution: {integrity: sha512-1fqscJbePFJXhapqiv7fAIIqAvouSsdPnqWjJGJrUMR6JBtRYMcrb3MnDeqi9OYnU73r65BrQBPtSzWM8nP0LQ==} + dependencies: + '@storybook/client-logger': 7.6.12 + memoizerific: 1.11.3 + qs: 6.11.2 + dev: false + /@storybook/router@7.6.3: resolution: {integrity: sha512-NZfhJqsXYca9mZCL/LGx6FmZDbrxX2S4ImW7Tqdtcc/sSlZ0BpCDkNUTesCA287cmoKMhXZRh/+bU+C2h2a+bw==} dependencies: '@storybook/client-logger': 7.6.3 memoizerific: 1.11.3 - qs: 6.11.0 + qs: 6.11.2 + dev: true /@storybook/telemetry@7.6.3: resolution: {integrity: sha512-NDCZWhVIUI3M6Lq4M/HPOvZqDXqANDNbI3kyHr4pFGoVaCUXuDPokL9wR+CZcMvATkJ1gHrfLPBdcRq6Biw3Iw==} @@ -16098,6 +16225,20 @@ packages: - supports-color dev: false + /@storybook/theming@7.6.12(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-P4zoMKlSYbNrWJjQROuz+DZSDEpdf3TUvk203EqBRdElqw2EMHcqZ8+0HGPFfVHpqEj05+B9Mr6R/Z/BURj0lw==} + peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 + dependencies: + '@emotion/use-insertion-effect-with-fallbacks': 1.0.1(react@18.2.0) + '@storybook/client-logger': 7.6.12 + '@storybook/global': 5.0.0 + memoizerific: 1.11.3 + react: 18.2.0 + react-dom: 18.2.0(react@18.2.0) + dev: false + /@storybook/theming@7.6.3(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-9ToNU2LM6a2kVBjOXitXEeEOuMurVLhn+uaZO1dJjv8NGnJVYiLwNPwrLsImiUD8/XXNuil972aanBR6+Aj9jw==} peerDependencies: @@ -16110,6 +16251,15 @@ packages: memoizerific: 1.11.3 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) + dev: true + + /@storybook/types@7.6.12: + resolution: {integrity: sha512-Wsbd+NS10/2yMHQ/26rXHflXam0hm2qufTFiHOX6VXZWxij3slRU88Fnwzp+1QSyjXb0qkEr8dOx7aG00+ItVw==} + dependencies: + '@storybook/channels': 7.6.12 + '@types/babel__core': 7.20.3 + '@types/express': 4.17.13 + file-system-cache: 2.3.0 /@storybook/types@7.6.3: resolution: {integrity: sha512-vj9Jzg5eR52l8O9512QywbQpNdo67Z6BQWR8QoZRcG+/Bhzt08YI8IZMPQLFMKzcmWDPK0blQ4GfyKDYplMjPA==} @@ -19271,7 +19421,7 @@ packages: resolution: {integrity: sha512-sX/LQ7LqUhgyaxzbe7IqwPeTr2yfpfUIQ/dgpKo6ZI4y4lpQA0YxAomWIY+7I7rHWcG02PG+OuPREzMW/5tszQ==} dependencies: inflation: 2.0.0 - qs: 6.11.0 + qs: 6.11.2 raw-body: 2.5.1 type-is: 1.6.18 dev: false @@ -28367,18 +28517,11 @@ packages: dependencies: side-channel: 1.0.4 - /qs@6.11.0: - resolution: {integrity: sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==} - engines: {node: '>=0.6'} - dependencies: - side-channel: 1.0.4 - /qs@6.11.2: resolution: {integrity: sha512-tDNIz22aBzCDxLtVH++VnTfzxlfeK5CbqohpSqpJgj1Wg/cQbStNAz3NuqCs5vV+pjBsK4x4pN9HlVh7rcYRiA==} engines: {node: '>=0.6'} dependencies: side-channel: 1.0.4 - dev: false /qs@6.9.3: resolution: {integrity: sha512-EbZYNarm6138UKKq46tdx08Yo/q9ZhFoAXAI1meAFd2GtbRDhbZY2WQSICskT0c5q99aFzLG1D4nvTk9tqfXIw==} @@ -31437,7 +31580,7 @@ packages: formidable: 2.0.1 methods: 1.1.2 mime: 2.6.0 - qs: 6.11.0 + qs: 6.11.2 readable-stream: 3.6.0 semver: 7.6.0 transitivePeerDependencies: @@ -32640,13 +32783,13 @@ packages: resolution: {integrity: sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==} engines: {node: '>= 0.8'} - /unplugin@1.5.0: - resolution: {integrity: sha512-9ZdRwbh/4gcm1JTOkp9lAkIDrtOyOxgHmY7cjuwI8L/2RTikMcVG25GsZwNAgRuap3iDw2jeq7eoqtAsz5rW3A==} + /unplugin@1.6.0: + resolution: {integrity: sha512-BfJEpWBu3aE/AyHx8VaNE/WgouoQxgH9baAiH82JjX8cqVyi3uJQstqwD5J+SZxIK326SZIhsSZlALXVBCknTQ==} dependencies: acorn: 8.11.2 chokidar: 3.5.3 webpack-sources: 3.2.3 - webpack-virtual-modules: 0.5.0 + webpack-virtual-modules: 0.6.1 /untildify@4.0.0: resolution: {integrity: sha512-KK8xQ1mkzZeg9inewmFVDNkg3l5LUhoq9kN6iWYB/CC9YMG8HA+c1Q8HwDe6dEX7kErrEVNVBO3fWsVq5iDgtw==} @@ -33295,8 +33438,8 @@ packages: webpack: 5.89.0(esbuild@0.17.19) dev: false - /webpack-virtual-modules@0.5.0: - resolution: {integrity: sha512-kyDivFZ7ZM0BVOUteVbDFhlRt7Ah/CSPwJdi8hBpkK7QLumUqdLtVfm/PX/hkcnrvr0i77fO5+TjZ94Pe+C9iw==} + /webpack-virtual-modules@0.6.1: + resolution: {integrity: sha512-poXpCylU7ExuvZK8z+On3kX+S8o/2dQ/SVYueKA0D4WEMXROXgY8Ez50/bQEUmvoSMMrWcrJqCHuhAbsiwg7Dg==} /webpack@5.89.0(@swc/core@1.3.42)(esbuild@0.17.19): resolution: {integrity: sha512-qyfIC10pOr70V+jkmud8tMfajraGCZMBWJtrmuBymQKCrLTRejBI8STDp1MCyZu/QTdZSeacCQYpYNQVOzX5kw==}