diff --git a/code/frameworks/react-vite/package.json b/code/frameworks/react-vite/package.json index 4bea1cbcb3e9..bf3ed6153b21 100644 --- a/code/frameworks/react-vite/package.json +++ b/code/frameworks/react-vite/package.json @@ -54,9 +54,6 @@ "@joshwooding/vite-plugin-react-docgen-typescript": "^0.0.5", "@rollup/pluginutils": "^4.2.0", "@storybook/builder-vite": "7.0.0-alpha.54", - "@storybook/channel-postmessage": "7.0.0-alpha.54", - "@storybook/channel-websocket": "7.0.0-alpha.54", - "@storybook/preview-api": "7.0.0-alpha.54", "@storybook/react": "7.0.0-alpha.54", "@vitejs/plugin-react": "^2.0.0", "ast-types": "^0.14.2", diff --git a/code/frameworks/react-vite/src/index.ts b/code/frameworks/react-vite/src/index.ts index 8b0346b167de..d3ded0cdbbb9 100644 --- a/code/frameworks/react-vite/src/index.ts +++ b/code/frameworks/react-vite/src/index.ts @@ -1,11 +1 @@ -// TODO: figure out if any of this is required -// possibly make it not required, framework should never be imported directly, except for types in config files - -export { createChannel as createPostMessageChannel } from '@storybook/channel-postmessage'; -export { createChannel as createWebSocketChannel } from '@storybook/channel-websocket'; - -export { addons } from '@storybook/preview-api'; -export { composeConfigs, PreviewWeb } from '@storybook/preview-api'; -export { ClientApi } from '@storybook/preview-api'; - export type { StorybookConfig } from '@storybook/builder-vite'; diff --git a/code/frameworks/svelte-vite/package.json b/code/frameworks/svelte-vite/package.json index 4e980a220dca..f5141d28baee 100644 --- a/code/frameworks/svelte-vite/package.json +++ b/code/frameworks/svelte-vite/package.json @@ -53,10 +53,7 @@ "dependencies": { "@storybook/addon-svelte-csf": "^2.0.0", "@storybook/builder-vite": "7.0.0-alpha.54", - "@storybook/channel-postmessage": "7.0.0-alpha.54", - "@storybook/channel-websocket": "7.0.0-alpha.54", "@storybook/node-logger": "7.0.0-alpha.54", - "@storybook/preview-api": "7.0.0-alpha.54", "@storybook/svelte": "7.0.0-alpha.54", "@sveltejs/vite-plugin-svelte": "^1.0.0", "magic-string": "^0.26.1", diff --git a/code/frameworks/svelte-vite/src/index.ts b/code/frameworks/svelte-vite/src/index.ts index 1aa9b0bb063e..d3ded0cdbbb9 100644 --- a/code/frameworks/svelte-vite/src/index.ts +++ b/code/frameworks/svelte-vite/src/index.ts @@ -1,8 +1 @@ -export { createChannel as createPostMessageChannel } from '@storybook/channel-postmessage'; -export { createChannel as createWebSocketChannel } from '@storybook/channel-websocket'; - -export { addons } from '@storybook/preview-api'; -export { composeConfigs, PreviewWeb } from '@storybook/preview-api'; -export { ClientApi } from '@storybook/preview-api'; - export type { StorybookConfig } from '@storybook/builder-vite'; diff --git a/code/frameworks/vue-vite/package.json b/code/frameworks/vue-vite/package.json index a0f8202e61e1..cd79bffbe48a 100644 --- a/code/frameworks/vue-vite/package.json +++ b/code/frameworks/vue-vite/package.json @@ -51,11 +51,8 @@ }, "dependencies": { "@storybook/builder-vite": "7.0.0-alpha.54", - "@storybook/channel-postmessage": "7.0.0-alpha.54", - "@storybook/channel-websocket": "7.0.0-alpha.54", "@storybook/core-common": "7.0.0-alpha.54", "@storybook/core-server": "7.0.0-alpha.54", - "@storybook/preview-api": "7.0.0-alpha.54", "@storybook/vue": "7.0.0-alpha.54", "magic-string": "^0.26.1", "vite": "^3.1.3", diff --git a/code/frameworks/vue-vite/src/index.ts b/code/frameworks/vue-vite/src/index.ts index 1aa9b0bb063e..d3ded0cdbbb9 100644 --- a/code/frameworks/vue-vite/src/index.ts +++ b/code/frameworks/vue-vite/src/index.ts @@ -1,8 +1 @@ -export { createChannel as createPostMessageChannel } from '@storybook/channel-postmessage'; -export { createChannel as createWebSocketChannel } from '@storybook/channel-websocket'; - -export { addons } from '@storybook/preview-api'; -export { composeConfigs, PreviewWeb } from '@storybook/preview-api'; -export { ClientApi } from '@storybook/preview-api'; - export type { StorybookConfig } from '@storybook/builder-vite'; diff --git a/code/frameworks/vue3-vite/package.json b/code/frameworks/vue3-vite/package.json index 3339785d6dd3..2c2b7faa229e 100644 --- a/code/frameworks/vue3-vite/package.json +++ b/code/frameworks/vue3-vite/package.json @@ -52,10 +52,7 @@ }, "dependencies": { "@storybook/builder-vite": "7.0.0-alpha.54", - "@storybook/channel-postmessage": "7.0.0-alpha.54", - "@storybook/channel-websocket": "7.0.0-alpha.54", "@storybook/core-server": "7.0.0-alpha.54", - "@storybook/preview-api": "7.0.0-alpha.54", "@storybook/vue3": "7.0.0-alpha.54", "@vitejs/plugin-vue": "^3.0.0", "magic-string": "^0.26.1", diff --git a/code/frameworks/vue3-vite/src/index.ts b/code/frameworks/vue3-vite/src/index.ts index 1aa9b0bb063e..d3ded0cdbbb9 100644 --- a/code/frameworks/vue3-vite/src/index.ts +++ b/code/frameworks/vue3-vite/src/index.ts @@ -1,8 +1 @@ -export { createChannel as createPostMessageChannel } from '@storybook/channel-postmessage'; -export { createChannel as createWebSocketChannel } from '@storybook/channel-websocket'; - -export { addons } from '@storybook/preview-api'; -export { composeConfigs, PreviewWeb } from '@storybook/preview-api'; -export { ClientApi } from '@storybook/preview-api'; - export type { StorybookConfig } from '@storybook/builder-vite'; diff --git a/code/frameworks/web-components-vite/package.json b/code/frameworks/web-components-vite/package.json index 893a25fb134e..0e37fa66f14b 100644 --- a/code/frameworks/web-components-vite/package.json +++ b/code/frameworks/web-components-vite/package.json @@ -52,11 +52,8 @@ }, "dependencies": { "@storybook/builder-vite": "7.0.0-alpha.54", - "@storybook/channel-postmessage": "7.0.0-alpha.54", - "@storybook/channel-websocket": "7.0.0-alpha.54", "@storybook/core-server": "7.0.0-alpha.54", "@storybook/node-logger": "7.0.0-alpha.54", - "@storybook/preview-api": "7.0.0-alpha.54", "@storybook/web-components": "7.0.0-alpha.54", "magic-string": "^0.26.1", "vite": "3" diff --git a/code/frameworks/web-components-vite/src/index.ts b/code/frameworks/web-components-vite/src/index.ts index 1aa9b0bb063e..d3ded0cdbbb9 100644 --- a/code/frameworks/web-components-vite/src/index.ts +++ b/code/frameworks/web-components-vite/src/index.ts @@ -1,8 +1 @@ -export { createChannel as createPostMessageChannel } from '@storybook/channel-postmessage'; -export { createChannel as createWebSocketChannel } from '@storybook/channel-websocket'; - -export { addons } from '@storybook/preview-api'; -export { composeConfigs, PreviewWeb } from '@storybook/preview-api'; -export { ClientApi } from '@storybook/preview-api'; - export type { StorybookConfig } from '@storybook/builder-vite'; diff --git a/code/lib/builder-vite/input/iframe.html b/code/lib/builder-vite/input/iframe.html index c26846fa2b73..5e522dda6c44 100644 --- a/code/lib/builder-vite/input/iframe.html +++ b/code/lib/builder-vite/input/iframe.html @@ -25,11 +25,7 @@
- + + diff --git a/code/lib/builder-vite/package.json b/code/lib/builder-vite/package.json index a128b27bbd8b..bc0e342368b4 100644 --- a/code/lib/builder-vite/package.json +++ b/code/lib/builder-vite/package.json @@ -41,10 +41,7 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@fal-works/esbuild-plugin-global-externals": "^2.1.2", "@joshwooding/vite-plugin-react-docgen-typescript": "0.0.5", - "@storybook/addons": "7.0.0-alpha.54", - "@storybook/client-api": "7.0.0-alpha.54", "@storybook/client-logger": "7.0.0-alpha.54", "@storybook/core-common": "7.0.0-alpha.54", "@storybook/mdx2-csf": "next", @@ -61,6 +58,7 @@ "glob": "^7.2.0", "glob-promise": "^4.2.0", "magic-string": "^0.26.1", + "rollup-plugin-external-globals": "^0.7.1", "slash": "^3.0.0", "vite": "^3.1.3" }, diff --git a/code/lib/builder-vite/src/build.ts b/code/lib/builder-vite/src/build.ts index ac95f105a7c0..a9ba1a37b01c 100644 --- a/code/lib/builder-vite/src/build.ts +++ b/code/lib/builder-vite/src/build.ts @@ -1,4 +1,4 @@ -import { build as viteBuild } from 'vite'; +import { build as viteBuild, mergeConfig } from 'vite'; import { commonConfig } from './vite-config'; import type { ExtendedOptions } from './types'; @@ -8,11 +8,17 @@ export async function build(options: ExtendedOptions) { const { presets } = options; const config = await commonConfig(options, 'build'); - config.build = { - outDir: options.outputDir, - emptyOutDir: false, // do not clean before running Vite build - Storybook has already added assets in there! - sourcemap: true, - }; + config.build = mergeConfig(config, { + build: { + outDir: options.outputDir, + emptyOutDir: false, // do not clean before running Vite build - Storybook has already added assets in there! + sourcemap: true, + rollupOptions: { + // Do not try to bundle the storybook runtime, it is copied into the output dir after the build. + external: ['/sb-preview/runtime.mjs'], + }, + }, + }).build; const finalConfig = await presets.apply('viteFinal', config, options); diff --git a/code/lib/builder-vite/src/codegen-modern-iframe-script.ts b/code/lib/builder-vite/src/codegen-modern-iframe-script.ts index c1c7aa6a4444..980ac874a9f7 100644 --- a/code/lib/builder-vite/src/codegen-modern-iframe-script.ts +++ b/code/lib/builder-vite/src/codegen-modern-iframe-script.ts @@ -53,11 +53,10 @@ export async function generateModernIframeScriptCode(options: ExtendedOptions) { * @todo Inline variable and remove `noinspection` */ const code = ` - import { ClientApi, composeConfigs, PreviewWeb } from '${frameworkName}'; - - import '${virtualAddonSetupFile}'; - import { importFn } from '${virtualStoriesFile}'; - + import { composeConfigs, PreviewWeb, ClientApi } from '@storybook/preview-api'; + import '${virtualAddonSetupFile}'; + import { importFn } from '${virtualStoriesFile}'; + const getProjectAnnotations = async () => { const configs = await Promise.all([${relativePreviewAnnotations .map((previewAnnotation) => `import('${previewAnnotation}')`) diff --git a/code/lib/builder-vite/src/codegen-set-addon-channel.ts b/code/lib/builder-vite/src/codegen-set-addon-channel.ts index d99e3f2e783b..6cb475c8893b 100644 --- a/code/lib/builder-vite/src/codegen-set-addon-channel.ts +++ b/code/lib/builder-vite/src/codegen-set-addon-channel.ts @@ -1,12 +1,8 @@ -import { getFrameworkName } from '@storybook/core-common'; - -import type { ExtendedOptions } from './types'; - -export async function generateAddonSetupCode(options: ExtendedOptions) { - const framework = await getFrameworkName(options); - +export async function generateAddonSetupCode() { return ` - import { createPostMessageChannel, createWebSocketChannel, addons } from '${framework}'; + import { createChannel as createPostMessageChannel } from '@storybook/channel-postmessage'; + import { createChannel as createWebSocketChannel } from '@storybook/channel-websocket'; + import { addons } from '@storybook/preview-api'; const channel = createPostMessageChannel({ page: 'preview' }); addons.setChannel(channel); diff --git a/code/lib/builder-vite/src/optimizeDeps.ts b/code/lib/builder-vite/src/optimizeDeps.ts index ac5daf80fc76..7cc35166433a 100644 --- a/code/lib/builder-vite/src/optimizeDeps.ts +++ b/code/lib/builder-vite/src/optimizeDeps.ts @@ -1,8 +1,6 @@ import * as path from 'path'; import { normalizePath, resolveConfig } from 'vite'; import type { InlineConfig as ViteInlineConfig, UserConfig } from 'vite'; -import { globalExternals } from '@fal-works/esbuild-plugin-global-externals'; -import { definitions } from '@storybook/preview/globals'; import { listStories } from './list-stories'; import type { ExtendedOptions } from './types'; @@ -15,20 +13,17 @@ const INCLUDE_CANDIDATES = [ '@mdx-js/react', '@storybook/addon-docs > acorn-jsx', '@storybook/addon-docs', - '@storybook/preview-api', '@storybook/channel-postmessage', '@storybook/channel-websocket', '@storybook/client-api', - '@storybook/preview-api', '@storybook/client-logger', '@storybook/core/client', - '@storybook/types', - '@storybook/preview-api', '@storybook/preview-api', '@storybook/preview-web', '@storybook/react > acorn-jsx', '@storybook/react', '@storybook/svelte', + '@storybook/types', '@storybook/vue3', 'acorn-jsx', 'acorn-walk', @@ -124,9 +119,6 @@ export async function getOptimizeDeps(config: ViteInlineConfig, options: Extende // We need Vite to precompile these dependencies, because they contain non-ESM code that would break // if we served it directly to the browser. include, - esbuildOptions: { - plugins: [globalExternals(definitions)], - }, }; return optimizeDeps; diff --git a/code/lib/builder-vite/src/plugins/code-generator-plugin.ts b/code/lib/builder-vite/src/plugins/code-generator-plugin.ts index 7c7f6956f797..718bc956b367 100644 --- a/code/lib/builder-vite/src/plugins/code-generator-plugin.ts +++ b/code/lib/builder-vite/src/plugins/code-generator-plugin.ts @@ -101,9 +101,6 @@ export function codeGeneratorPlugin(options: ExtendedOptions): Plugin { if (source === virtualAddonSetupFile) { return virtualAddonSetupFile; } - if (source === '/sb-preview/runtime.mjs') { - return '/sb-preview/runtime.mjs'; - } return undefined; }, @@ -117,7 +114,7 @@ export function codeGeneratorPlugin(options: ExtendedOptions): Plugin { } if (id === virtualAddonSetupFile) { - return generateAddonSetupCode(options); + return generateAddonSetupCode(); } if (id === virtualPreviewFile && !storyStoreV7) { @@ -131,11 +128,6 @@ export function codeGeneratorPlugin(options: ExtendedOptions): Plugin { return generateIframeScriptCode(options); } - // This is handled by the express router, not vite - if (id === '/sb-preview/runtime.mjs') { - return ''; - } - if (id === iframeId) { return fs.readFileSync( require.resolve('@storybook/builder-vite/input/iframe.html'), diff --git a/code/lib/builder-vite/src/typings.d.ts b/code/lib/builder-vite/src/typings.d.ts new file mode 100644 index 000000000000..c5339b9dbf6a --- /dev/null +++ b/code/lib/builder-vite/src/typings.d.ts @@ -0,0 +1 @@ +declare module 'rollup-plugin-external-globals'; diff --git a/code/lib/builder-vite/src/vite-config.ts b/code/lib/builder-vite/src/vite-config.ts index 567c74ae9c3a..464373b6f7cd 100644 --- a/code/lib/builder-vite/src/vite-config.ts +++ b/code/lib/builder-vite/src/vite-config.ts @@ -8,7 +8,9 @@ import type { InlineConfig, } from 'vite'; import viteReact from '@vitejs/plugin-react'; +import externalGlobals from 'rollup-plugin-external-globals'; import { isPreservingSymlinks, getFrameworkName } from '@storybook/core-common'; +import { globals } from '@storybook/preview/globals'; import { codeGeneratorPlugin, injectExportOrderPlugin, @@ -38,7 +40,11 @@ export async function commonConfig( ): Promise { const configEnv = _type === 'development' ? configEnvServe : configEnvBuild; - const { config: userConfig = {} } = (await loadConfigFromFile(configEnv)) ?? {}; + // I destructure away the `build` property from the user's config object + // I do this because I can contain config that breaks storybook, such as we had in a lit project. + // If the user needs to configure the `build` they need to do so in the viteFinal function in main.js. + const { config: { build: buildProperty = undefined, ...userConfig } = {} } = + (await loadConfigFromFile(configEnv)) ?? {}; const sbConfig: InlineConfig = { configFile: false, @@ -46,7 +52,6 @@ export async function commonConfig( root: path.resolve(options.configDir, '..'), // Allow storybook deployed as subfolder. See https://github.com/storybookjs/builder-vite/issues/238 base: './', - plugins: await pluginConfig(options), resolve: { preserveSymlinks: isPreservingSymlinks(), @@ -86,6 +91,7 @@ export async function pluginConfig(options: ExtendedOptions) { } }, }, + externalGlobals(globals), ] as PluginOption[]; // We need the react plugin here to support MDX in non-react projects. diff --git a/code/lib/builder-webpack5/src/preview/iframe-webpack.config.ts b/code/lib/builder-webpack5/src/preview/iframe-webpack.config.ts index c9e8555413ab..31dac54dfe5f 100644 --- a/code/lib/builder-webpack5/src/preview/iframe-webpack.config.ts +++ b/code/lib/builder-webpack5/src/preview/iframe-webpack.config.ts @@ -9,6 +9,7 @@ import VirtualModulePlugin from 'webpack-virtual-modules'; import ForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin'; import type { Options, CoreConfig, DocsOptions, PreviewAnnotation } from '@storybook/types'; +import { globals } from '@storybook/preview/globals'; import { getRendererName, stringifyProcessEnvs, @@ -207,27 +208,7 @@ export default async ( watchOptions: { ignored: /node_modules/, }, - externals: { - ...[ - // these packages are pre-bundled, so they are mapped to global shims - // at some point this should only be a single package: preview-api - 'addons', - 'channel-postmessage', - 'channel-websocket', - 'channels', - 'client-logger', - 'core-events', - 'preview-api', - ].reduce( - (acc, sbPackage) => ({ - ...acc, - [`@storybook/${sbPackage}`]: `__STORYBOOK_MODULE_${sbPackage - .toUpperCase() - .replaceAll('-', '_')}__`, - }), - {} - ), - }, + externals: globals, ignoreWarnings: [ { message: /export '\S+' was not found in 'global'/, diff --git a/code/lib/cli/src/link.ts b/code/lib/cli/src/link.ts index 8b48064f5abc..f52ad93bd757 100644 --- a/code/lib/cli/src/link.ts +++ b/code/lib/cli/src/link.ts @@ -13,8 +13,10 @@ interface LinkOptions { export const link = async ({ target, local, start }: LinkOptions) => { const storybookDir = process.cwd(); try { - const packageJson = JSON.parse(fse.readFileSync('package.json', 'utf8')); - if (packageJson.name !== '@storybook/root') throw new Error(); + const packageJson = await fse.readJSON('package.json'); + if (packageJson.name !== '@storybook/root') { + throw new Error(); + } } catch { throw new Error('Expected to run link from the root of the storybook monorepo'); } @@ -25,7 +27,7 @@ export const link = async ({ target, local, start }: LinkOptions) => { if (!local) { const reprosDir = path.join(storybookDir, '../storybook-repros'); logger.info(`Ensuring directory ${reprosDir}`); - fse.ensureDirSync(reprosDir); + await fse.ensureDir(reprosDir); logger.info(`Cloning ${target}`); await exec(`git clone ${target}`, { cwd: reprosDir }); @@ -34,6 +36,8 @@ export const link = async ({ target, local, start }: LinkOptions) => { reproDir = path.join(reprosDir, reproName); } + const reproPackageJson = await fse.readJSON(path.join(reproDir, 'package.json')); + const version = spawnSync('yarn', ['--version'], { cwd: reproDir, stdio: 'pipe', @@ -58,7 +62,10 @@ export const link = async ({ target, local, start }: LinkOptions) => { logger.info( `Magic stuff related to @storybook/preset-create-react-app, we need to fix peerDependencies` ); - await exec(`yarn add -D webpack-hot-middleware`, { cwd: reproDir }); + + if (!reproPackageJson.devDependencies.vite) { + await exec(`yarn add -D webpack-hot-middleware`, { cwd: reproDir }); + } // ensure that linking is possible await exec(`yarn add @types/node@16`, { cwd: reproDir }); diff --git a/code/lib/preview/package.json b/code/lib/preview/package.json index 2fef65241821..95288242b666 100644 --- a/code/lib/preview/package.json +++ b/code/lib/preview/package.json @@ -57,24 +57,23 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "devDependencies": { - "@fal-works/esbuild-plugin-global-externals": "^2.1.2", + "@storybook/addons": "7.0.0-alpha.54", "@storybook/channel-postmessage": "7.0.0-alpha.54", "@storybook/channel-websocket": "7.0.0-alpha.54", "@storybook/channels": "7.0.0-alpha.54", + "@storybook/client-api": "7.0.0-alpha.54", "@storybook/client-logger": "7.0.0-alpha.54", + "@storybook/core-client": "7.0.0-alpha.54", "@storybook/core-events": "7.0.0-alpha.54", "@storybook/preview-api": "7.0.0-alpha.54", - "@types/shelljs": "^0.8.7", - "fs-extra": "^9.0.1", - "shelljs": "^0.8.5", - "ts-dedent": "^2.0.0", + "@storybook/preview-web": "7.0.0-alpha.54", + "@storybook/store": "7.0.0-alpha.54", "typescript": "~4.6.3" }, "publishConfig": { "access": "public" }, "bundler": { - "pre": "./scripts/generate-exports-file.ts", "entries": [ "./src/runtime.ts", "./src/globals.ts" diff --git a/code/lib/preview/scripts/generate-exports-file.ts b/code/lib/preview/scripts/generate-exports-file.ts deleted file mode 100644 index 6a27d1707413..000000000000 --- a/code/lib/preview/scripts/generate-exports-file.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* eslint-disable import/no-extraneous-dependencies, no-console */ -import fs from 'fs-extra'; -import path from 'path'; -import shelljs from 'shelljs'; -import { dedent } from 'ts-dedent'; - -const removeDefault = (input: string) => input !== 'default'; - -const location = path.join(__dirname, '..', 'src', 'globals', 'exports.ts'); - -const run = async () => { - const { values } = await import('../src/globals/runtime'); - const data = Object.entries(values).reduce>((acc, [key, value]) => { - acc[key] = Object.keys(value).filter(removeDefault); - return acc; - }, {}); - - console.log('Generating...'); - await fs.ensureFile(location); - await fs.writeFile( - location, - dedent` - // this file is generated by generate-exports-file.ts - // this is done to prevent runtime dependencies from making it's way into the build/start script of the manager - // the manager builder needs to know which dependencies are 'globalized' in the ui - - export default ${JSON.stringify(data, null, 2)} as const;` - ); - - console.log('Linting...'); - shelljs.exec(`yarn lint:js:cmd --fix ${location}`, { - cwd: path.join(__dirname, '..', '..', '..'), - }); - console.log('Done!'); -}; - -run().catch((e) => { - console.error(e); - process.exitCode = 1; -}); diff --git a/code/lib/preview/src/globals.ts b/code/lib/preview/src/globals.ts index d516acc55516..fb7419cf52ed 100644 --- a/code/lib/preview/src/globals.ts +++ b/code/lib/preview/src/globals.ts @@ -1 +1 @@ -export * from './globals/definitions'; +export * from './globals/types'; diff --git a/code/lib/preview/src/globals/definitions.ts b/code/lib/preview/src/globals/definitions.ts deleted file mode 100644 index 7a614b42c3f7..000000000000 --- a/code/lib/preview/src/globals/definitions.ts +++ /dev/null @@ -1,35 +0,0 @@ -import type { ModuleInfo } from '@fal-works/esbuild-plugin-global-externals'; -import Exports from './exports'; -import { Keys } from './types'; -import type { Definitions } from './types'; - -/* - * We create a map of a module's name to a ModuleInfo. - * Which is a config object for a esbuild-plugin, to swap a import of a module to a reference of a global variable. - * To get this plugin to do the best job it can, it needs to know all the exports in the ModuleInfo config object. - * We generate this information via a script into `exports.ts`. - * - * It's really important that there are no actual to the runtime of the modules, hence the cumbersome generation. - * But we also want to ensure we don't miss any exports, or globals. - * - * So in order to add additional modules to be swapped for globals, you need to add them to: - * - `Keys` in `types.ts` - * - `values` in `runtime.ts`. - * - * If you forget to do either, TypeScript will complain. - * - * This `definitions.ts` file is consumed by the `builder-*` package, - * The `runtime.ts` file is used inside the preview's browser code runtime. - */ - -const createModuleInfo = (m: keyof typeof Keys): Required => ({ - type: 'esm', - varName: Keys[m], - namedExports: Exports[m], - defaultExport: true, -}); - -export const definitions = Object.keys(Keys).reduce((acc, key) => { - acc[key as keyof typeof Keys] = createModuleInfo(key as keyof typeof Keys); - return acc; -}, {} as Definitions); diff --git a/code/lib/preview/src/globals/exports.ts b/code/lib/preview/src/globals/exports.ts deleted file mode 100644 index 416c5cf169a1..000000000000 --- a/code/lib/preview/src/globals/exports.ts +++ /dev/null @@ -1,251 +0,0 @@ -// this file is generated by generate-exports-file.ts -// this is done to prevent runtime dependencies from making it's way into the build/start script of the manager -// the manager builder needs to know which dependencies are 'globalized' in the ui - -export default { - '@storybook/addons': [ - 'AddonStore', - 'HooksContext', - 'addons', - 'applyHooks', - 'makeDecorator', - 'mockChannel', - 'useArgs', - 'useCallback', - 'useChannel', - 'useEffect', - 'useGlobals', - 'useMemo', - 'useParameter', - 'useReducer', - 'useRef', - 'useState', - 'useStoryContext', - ], - '@storybook/channel-postmessage': ['KEY', 'PostmsgTransport', 'createChannel'], - '@storybook/channel-websocket': ['WebsocketTransport', 'createChannel'], - '@storybook/channels': ['Channel'], - '@storybook/client-api': [ - 'ClientApi', - 'DEEPLY_EQUAL', - 'HooksContext', - 'NO_TARGET_NAME', - 'StoryStore', - 'addArgTypes', - 'addArgTypesEnhancer', - 'addArgs', - 'addArgsEnhancer', - 'addDecorator', - 'addLoader', - 'addParameters', - 'addStepRunner', - 'applyHooks', - 'combineArgs', - 'combineParameters', - 'composeConfigs', - 'composeStepRunners', - 'composeStories', - 'composeStory', - 'decorateStory', - 'deepDiff', - 'defaultDecorateStory', - 'filterArgTypes', - 'getArrayField', - 'getField', - 'getObjectField', - 'getQueryParam', - 'getQueryParams', - 'getSingletonField', - 'getValuesFromArgTypes', - 'groupArgsByTarget', - 'inferControls', - 'mapArgsToTypes', - 'noTargetArgs', - 'normalizeComponentAnnotations', - 'normalizeInputType', - 'normalizeInputTypes', - 'normalizeProjectAnnotations', - 'normalizeStory', - 'prepareStory', - 'processCSFFile', - 'sanitizeStoryContextUpdate', - 'setGlobalRender', - 'setProjectAnnotations', - 'sortStoriesV6', - 'sortStoriesV7', - 'useAddonState', - 'useArgs', - 'useCallback', - 'useChannel', - 'useEffect', - 'useGlobals', - 'useMemo', - 'useParameter', - 'useReducer', - 'useRef', - 'useSharedState', - 'useState', - 'useStoryContext', - 'userOrAutoTitle', - 'userOrAutoTitleFromSpecifier', - 'validateOptions', - ], - '@storybook/client-logger': ['deprecate', 'logger', 'once', 'pretty'], - '@storybook/core-client': ['ClientApi', 'StoryStore', 'start'], - '@storybook/core-events': [ - 'CHANNEL_CREATED', - 'CONFIG_ERROR', - 'CURRENT_STORY_WAS_SET', - 'DOCS_RENDERED', - 'FORCE_REMOUNT', - 'FORCE_RE_RENDER', - 'GLOBALS_UPDATED', - 'IGNORED_EXCEPTION', - 'NAVIGATE_URL', - 'PLAY_FUNCTION_THREW_EXCEPTION', - 'PRELOAD_ENTRIES', - 'PREVIEW_BUILDER_PROGRESS', - 'PREVIEW_KEYDOWN', - 'REGISTER_SUBSCRIPTION', - 'RESET_STORY_ARGS', - 'SELECT_STORY', - 'SET_CONFIG', - 'SET_CURRENT_STORY', - 'SET_GLOBALS', - 'SET_INDEX', - 'SET_STORIES', - 'SHARED_STATE_CHANGED', - 'SHARED_STATE_SET', - 'STORIES_COLLAPSE_ALL', - 'STORIES_EXPAND_ALL', - 'STORY_ARGS_UPDATED', - 'STORY_CHANGED', - 'STORY_ERRORED', - 'STORY_INDEX_INVALIDATED', - 'STORY_MISSING', - 'STORY_PREPARED', - 'STORY_RENDERED', - 'STORY_RENDER_PHASE_CHANGED', - 'STORY_SPECIFIED', - 'STORY_THREW_EXCEPTION', - 'STORY_UNCHANGED', - 'UPDATE_GLOBALS', - 'UPDATE_QUERY_PARAMS', - 'UPDATE_STORY_ARGS', - ], - '@storybook/preview-api': [ - 'ClientApi', - 'DocsContext', - 'HooksContext', - 'Preview', - 'PreviewWeb', - 'StoryStore', - 'addArgTypes', - 'addArgTypesEnhancer', - 'addArgs', - 'addArgsEnhancer', - 'addDecorator', - 'addLoader', - 'addParameters', - 'addStepRunner', - 'addons', - 'applyHooks', - 'combineArgs', - 'combineParameters', - 'composeConfigs', - 'composeStepRunners', - 'composeStories', - 'composeStory', - 'decorateStory', - 'defaultDecorateStory', - 'filterArgTypes', - 'getQueryParam', - 'getQueryParams', - 'inferControls', - 'makeDecorator', - 'mockChannel', - 'normalizeStory', - 'prepareStory', - 'sanitizeStoryContextUpdate', - 'setGlobalRender', - 'setProjectAnnotations', - 'simulateDOMContentLoaded', - 'simulatePageLoad', - 'sortStoriesV7', - 'start', - 'useArgs', - 'useCallback', - 'useChannel', - 'useEffect', - 'useGlobals', - 'useMemo', - 'useParameter', - 'useReducer', - 'useRef', - 'useState', - 'useStoryContext', - 'userOrAutoTitleFromSpecifier', - ], - '@storybook/preview-web': [ - 'DocsContext', - 'Preview', - 'PreviewWeb', - 'PreviewWithSelection', - 'composeConfigs', - 'simulateDOMContentLoaded', - 'simulatePageLoad', - ], - '@storybook/store': [ - 'DEEPLY_EQUAL', - 'HooksContext', - 'NO_TARGET_NAME', - 'StoryStore', - 'applyHooks', - 'combineArgs', - 'combineParameters', - 'composeConfigs', - 'composeStepRunners', - 'composeStories', - 'composeStory', - 'decorateStory', - 'deepDiff', - 'defaultDecorateStory', - 'filterArgTypes', - 'getArrayField', - 'getField', - 'getObjectField', - 'getSingletonField', - 'getValuesFromArgTypes', - 'groupArgsByTarget', - 'inferControls', - 'mapArgsToTypes', - 'noTargetArgs', - 'normalizeComponentAnnotations', - 'normalizeInputType', - 'normalizeInputTypes', - 'normalizeProjectAnnotations', - 'normalizeStory', - 'prepareStory', - 'processCSFFile', - 'sanitizeStoryContextUpdate', - 'setProjectAnnotations', - 'sortStoriesV6', - 'sortStoriesV7', - 'useAddonState', - 'useArgs', - 'useCallback', - 'useChannel', - 'useEffect', - 'useGlobals', - 'useMemo', - 'useParameter', - 'useReducer', - 'useRef', - 'useSharedState', - 'useState', - 'useStoryContext', - 'userOrAutoTitle', - 'userOrAutoTitleFromSpecifier', - 'validateOptions', - ], -} as const; diff --git a/code/lib/preview/src/globals/runtime.ts b/code/lib/preview/src/globals/runtime.ts index c9c9f630f6e4..e76bb017290a 100644 --- a/code/lib/preview/src/globals/runtime.ts +++ b/code/lib/preview/src/globals/runtime.ts @@ -11,10 +11,10 @@ import * as PREVIEW_API from '../modules/preview-api'; import * as PREVIEW_WEB from '../modules/preview-web'; import * as STORE from '../modules/store'; -import type { Keys } from './types'; +import type { globals } from './types'; // Here we map the name of a module to their VALUE in the global scope. -export const values: Required> = { +export const values: Required> = { '@storybook/addons': ADDONS, '@storybook/channel-postmessage': CHANNEL_POSTMESSAGE, '@storybook/channel-websocket': CHANNEL_WEBSOCKET, diff --git a/code/lib/preview/src/globals/types.ts b/code/lib/preview/src/globals/types.ts index c38e9defff29..182e384604e1 100644 --- a/code/lib/preview/src/globals/types.ts +++ b/code/lib/preview/src/globals/types.ts @@ -1,18 +1,14 @@ -import type { ModuleInfo } from '@fal-works/esbuild-plugin-global-externals'; - // Here we map the name of a module to their NAME in the global scope. -export enum Keys { - '@storybook/addons' = '__STORYBOOK_MODULE_ADDONS__', - '@storybook/channel-postmessage' = '__STORYBOOK_MODULE_CHANNEL_POSTMESSAGE__', - '@storybook/channel-websocket' = '__STORYBOOK_MODULE_CHANNEL_WEBSOCKET__', - '@storybook/channels' = '__STORYBOOK_MODULE_CHANNELS__', - '@storybook/client-api' = '__STORYBOOK_MODULE_CLIENT_API__', - '@storybook/client-logger' = '__STORYBOOK_MODULE_CLIENT_LOGGER__', - '@storybook/core-client' = '__STORYBOOK_MODULE_CORE_CLIENT__', - '@storybook/core-events' = '__STORYBOOK_MODULE_CORE_EVENTS__', - '@storybook/preview-web' = '__STORYBOOK_MODULE_PREVIEW_WEB__', - '@storybook/preview-api' = '__STORYBOOK_MODULE_PREVIEW_API__', - '@storybook/store' = '__STORYBOOK_MODULE_STORE__', -} - -export type Definitions = Required>>; +export const globals = { + '@storybook/addons': '__STORYBOOK_MODULE_ADDONS__', + '@storybook/channel-postmessage': '__STORYBOOK_MODULE_CHANNEL_POSTMESSAGE__', + '@storybook/channel-websocket': '__STORYBOOK_MODULE_CHANNEL_WEBSOCKET__', + '@storybook/channels': '__STORYBOOK_MODULE_CHANNELS__', + '@storybook/client-api': '__STORYBOOK_MODULE_CLIENT_API__', + '@storybook/client-logger': '__STORYBOOK_MODULE_CLIENT_LOGGER__', + '@storybook/core-client': '__STORYBOOK_MODULE_CORE_CLIENT__', + '@storybook/core-events': '__STORYBOOK_MODULE_CORE_EVENTS__', + '@storybook/preview-web': '__STORYBOOK_MODULE_PREVIEW_WEB__', + '@storybook/preview-api': '__STORYBOOK_MODULE_PREVIEW_API__', + '@storybook/store': '__STORYBOOK_MODULE_STORE__', +}; diff --git a/code/lib/preview/src/runtime.ts b/code/lib/preview/src/runtime.ts index da695b49cf8f..5e890a133a55 100644 --- a/code/lib/preview/src/runtime.ts +++ b/code/lib/preview/src/runtime.ts @@ -1,9 +1,9 @@ import { values } from './globals/runtime'; -import { Keys } from './globals/types'; +import { globals } from './globals/types'; const getKeys = Object.keys as (obj: T) => Array; // Apply all the globals -getKeys(Keys).forEach((key) => { - (globalThis as any)[Keys[key]] = values[key]; +getKeys(globals).forEach((key) => { + (globalThis as any)[globals[key]] = values[key]; }); diff --git a/code/yarn.lock b/code/yarn.lock index e93075588373..5bd97713e45a 100644 --- a/code/yarn.lock +++ b/code/yarn.lock @@ -5028,6 +5028,22 @@ __metadata: languageName: node linkType: hard +"@rollup/pluginutils@npm:^5.0.2": + version: 5.0.2 + resolution: "@rollup/pluginutils@npm:5.0.2" + dependencies: + "@types/estree": ^1.0.0 + estree-walker: ^2.0.2 + picomatch: ^2.3.1 + peerDependencies: + rollup: ^1.20.0||^2.0.0||^3.0.0 + peerDependenciesMeta: + rollup: + optional: true + checksum: b06f73c15bb59418aa6fbfead5675bab2d6922e15663525ffc2eb8429530bc5add516600adb251cfbf9b60f3d12fb821cde155cb5103415154a476bd0f163432 + languageName: node + linkType: hard + "@schematics/angular@npm:13.3.10": version: 13.3.10 resolution: "@schematics/angular@npm:13.3.10" @@ -5857,10 +5873,7 @@ __metadata: version: 0.0.0-use.local resolution: "@storybook/builder-vite@workspace:lib/builder-vite" dependencies: - "@fal-works/esbuild-plugin-global-externals": ^2.1.2 "@joshwooding/vite-plugin-react-docgen-typescript": 0.0.5 - "@storybook/addons": 7.0.0-alpha.54 - "@storybook/client-api": 7.0.0-alpha.54 "@storybook/client-logger": 7.0.0-alpha.54 "@storybook/core-common": 7.0.0-alpha.54 "@storybook/mdx2-csf": next @@ -5879,6 +5892,7 @@ __metadata: glob: ^7.2.0 glob-promise: ^4.2.0 magic-string: ^0.26.1 + rollup-plugin-external-globals: ^0.7.1 slash: ^3.0.0 typescript: ^4.9.3 vite: ^3.1.3 @@ -6927,7 +6941,7 @@ __metadata: languageName: unknown linkType: soft -"@storybook/preview-web@workspace:*, @storybook/preview-web@workspace:lib/preview-web": +"@storybook/preview-web@7.0.0-alpha.54, @storybook/preview-web@workspace:*, @storybook/preview-web@workspace:lib/preview-web": version: 0.0.0-use.local resolution: "@storybook/preview-web@workspace:lib/preview-web" dependencies: @@ -6940,17 +6954,17 @@ __metadata: version: 0.0.0-use.local resolution: "@storybook/preview@workspace:lib/preview" dependencies: - "@fal-works/esbuild-plugin-global-externals": ^2.1.2 + "@storybook/addons": 7.0.0-alpha.54 "@storybook/channel-postmessage": 7.0.0-alpha.54 "@storybook/channel-websocket": 7.0.0-alpha.54 "@storybook/channels": 7.0.0-alpha.54 + "@storybook/client-api": 7.0.0-alpha.54 "@storybook/client-logger": 7.0.0-alpha.54 + "@storybook/core-client": 7.0.0-alpha.54 "@storybook/core-events": 7.0.0-alpha.54 "@storybook/preview-api": 7.0.0-alpha.54 - "@types/shelljs": ^0.8.7 - fs-extra: ^9.0.1 - shelljs: ^0.8.5 - ts-dedent: ^2.0.0 + "@storybook/preview-web": 7.0.0-alpha.54 + "@storybook/store": 7.0.0-alpha.54 typescript: ~4.6.3 languageName: unknown linkType: soft @@ -6980,9 +6994,6 @@ __metadata: "@joshwooding/vite-plugin-react-docgen-typescript": ^0.0.5 "@rollup/pluginutils": ^4.2.0 "@storybook/builder-vite": 7.0.0-alpha.54 - "@storybook/channel-postmessage": 7.0.0-alpha.54 - "@storybook/channel-websocket": 7.0.0-alpha.54 - "@storybook/preview-api": 7.0.0-alpha.54 "@storybook/react": 7.0.0-alpha.54 "@types/node": ^16.0.0 "@vitejs/plugin-react": ^2.0.0 @@ -7431,10 +7442,7 @@ __metadata: dependencies: "@storybook/addon-svelte-csf": ^2.0.0 "@storybook/builder-vite": 7.0.0-alpha.54 - "@storybook/channel-postmessage": 7.0.0-alpha.54 - "@storybook/channel-websocket": 7.0.0-alpha.54 "@storybook/node-logger": 7.0.0-alpha.54 - "@storybook/preview-api": 7.0.0-alpha.54 "@storybook/svelte": 7.0.0-alpha.54 "@sveltejs/vite-plugin-svelte": ^1.0.0 "@types/node": ^16.0.0 @@ -7587,11 +7595,8 @@ __metadata: resolution: "@storybook/vue-vite@workspace:frameworks/vue-vite" dependencies: "@storybook/builder-vite": 7.0.0-alpha.54 - "@storybook/channel-postmessage": 7.0.0-alpha.54 - "@storybook/channel-websocket": 7.0.0-alpha.54 "@storybook/core-common": 7.0.0-alpha.54 "@storybook/core-server": 7.0.0-alpha.54 - "@storybook/preview-api": 7.0.0-alpha.54 "@storybook/vue": 7.0.0-alpha.54 magic-string: ^0.26.1 typescript: ^4.9.3 @@ -7633,10 +7638,7 @@ __metadata: resolution: "@storybook/vue3-vite@workspace:frameworks/vue3-vite" dependencies: "@storybook/builder-vite": 7.0.0-alpha.54 - "@storybook/channel-postmessage": 7.0.0-alpha.54 - "@storybook/channel-websocket": 7.0.0-alpha.54 "@storybook/core-server": 7.0.0-alpha.54 - "@storybook/preview-api": 7.0.0-alpha.54 "@storybook/vue3": 7.0.0-alpha.54 "@types/node": ^16.0.0 "@vitejs/plugin-vue": ^3.0.0 @@ -7730,11 +7732,8 @@ __metadata: resolution: "@storybook/web-components-vite@workspace:frameworks/web-components-vite" dependencies: "@storybook/builder-vite": 7.0.0-alpha.54 - "@storybook/channel-postmessage": 7.0.0-alpha.54 - "@storybook/channel-websocket": 7.0.0-alpha.54 "@storybook/core-server": 7.0.0-alpha.54 "@storybook/node-logger": 7.0.0-alpha.54 - "@storybook/preview-api": 7.0.0-alpha.54 "@storybook/web-components": 7.0.0-alpha.54 "@types/node": ^16.0.0 magic-string: ^0.26.1 @@ -8151,7 +8150,7 @@ __metadata: languageName: node linkType: hard -"@types/estree@npm:*": +"@types/estree@npm:*, @types/estree@npm:^1.0.0": version: 1.0.0 resolution: "@types/estree@npm:1.0.0" checksum: 4e73ff606bf7c7ccdaa66092de650c410a4ad2ecc388fdbed8242cac9dbcad72407e1ceff041b7da691babb02ff74ab885d6231fb09368fdd1eabbf1b5253d49 @@ -9496,8 +9495,8 @@ __metadata: linkType: hard "@vue/vue3-jest@npm:29": - version: 29.2.0 - resolution: "@vue/vue3-jest@npm:29.2.0" + version: 29.2.1 + resolution: "@vue/vue3-jest@npm:29.2.1" dependencies: "@babel/plugin-transform-modules-commonjs": ^7.2.0 chalk: ^2.1.0 @@ -9514,7 +9513,7 @@ __metadata: peerDependenciesMeta: typescript: optional: true - checksum: c62c0b3bb56d8d062d9d3dd709c267cc2b1da42cc541d0c5bde3404bf200ee0cd4a2e517609fe4c6e19df80b2e4c5c3181dcf63f0aca6c11d4c5870edd69c3ab + checksum: 440df6efa65bc899458b38e538dbef26f8e3370160b749bde983eafa9c72a382f7b72abdac969fe1864b4e754cd6c85490fa1b7fa39e515a2e3da0092bdb1002 languageName: node linkType: hard @@ -15524,11 +15523,11 @@ __metadata: linkType: hard "esbuild-wasm@npm:>=0.13.8": - version: 0.15.15 - resolution: "esbuild-wasm@npm:0.15.15" + version: 0.15.16 + resolution: "esbuild-wasm@npm:0.15.16" bin: esbuild: bin/esbuild - checksum: 0a4f4aeae350269a404e8c015732a2fe7fda618b6adf742324e2d538891f563f6c2d7a901ae217dc62add1557916d7d5a6f1a1c333cc42686724ebe45aa330f5 + checksum: eeddd3f33e33f66d17f765383ad1de990bacf7eac44527b3674d2dd1720c6151fcb6aa4587f05934f80866f99e0ecea1d6ec26f86564c3871c2e0c6f516a968b languageName: node linkType: hard @@ -16255,6 +16254,13 @@ __metadata: languageName: node linkType: hard +"estree-walker@npm:^3.0.1": + version: 3.0.1 + resolution: "estree-walker@npm:3.0.1" + checksum: e5a1d45eb83df0e61b11450a1107d9604694b696ee5a54b26ad24449cce4f75614de9efdb9a4a16421c629c9bd241feaa79076ad273d7efa391fd91299f64a9e + languageName: node + linkType: hard + "esutils@npm:^2.0.2": version: 2.0.3 resolution: "esutils@npm:2.0.3" @@ -19240,9 +19246,9 @@ __metadata: linkType: hard "ignore@npm:^5.0.0, ignore@npm:^5.0.4, ignore@npm:^5.0.5, ignore@npm:^5.1.1, ignore@npm:^5.1.9, ignore@npm:^5.2.0": - version: 5.2.0 - resolution: "ignore@npm:5.2.0" - checksum: 7fb7b4c4c52c2555113ff968f8a83b8ac21b076282bfcb3f468c3fb429be69bd56222306c31de95dd452c647fc6ae24339b8047ebe3ef34c02591abfec58da01 + version: 5.2.1 + resolution: "ignore@npm:5.2.1" + checksum: 79dc9700d077feadee6f0c9d3b6f942e1255b5671e788de9900cbfb1cba8b2679f7b4fff27a5e63b6b8693b65e1890426729ed0847a313b929f1b62e17be00fa languageName: node linkType: hard @@ -20040,6 +20046,15 @@ __metadata: languageName: node linkType: hard +"is-reference@npm:^3.0.0": + version: 3.0.0 + resolution: "is-reference@npm:3.0.0" + dependencies: + "@types/estree": "*" + checksum: a61aa6e659d926af73afb0ba13438fc2ac92fdb8b89a6fae9069ddb3fc0da017fe082f492da6ac8790e17499f5fed2b996e6729cfdd6d8a55cdb23973fb5ebb5 + languageName: node + linkType: hard + "is-regex@npm:^1.0.3, is-regex@npm:^1.0.4, is-regex@npm:^1.0.5, is-regex@npm:^1.1.0, is-regex@npm:^1.1.2, is-regex@npm:^1.1.4": version: 1.1.4 resolution: "is-regex@npm:1.1.4" @@ -20964,8 +20979,8 @@ __metadata: linkType: hard "jest-preset-angular@npm:^12.0.0": - version: 12.2.2 - resolution: "jest-preset-angular@npm:12.2.2" + version: 12.2.3 + resolution: "jest-preset-angular@npm:12.2.3" dependencies: bs-logger: ^0.2.6 esbuild: ">=0.13.8" @@ -20974,16 +20989,16 @@ __metadata: pretty-format: ^28.0.0 ts-jest: ^28.0.0 peerDependencies: - "@angular-devkit/build-angular": ">=0.1102.19 <15.0.0" - "@angular/compiler-cli": ">=11.2.14 <15.0.0" - "@angular/core": ">=11.2.14 <15.0.0" - "@angular/platform-browser-dynamic": ">=11.2.14 <15.0.0" + "@angular-devkit/build-angular": ">=12.2.18 <16.0.0" + "@angular/compiler-cli": ">=12.2.16 <16.0.0" + "@angular/core": ">=12.2.16 <16.0.0" + "@angular/platform-browser-dynamic": ">=12.2.16 <16.0.0" jest: ^28.0.0 - typescript: ">=4.3" + typescript: ">=4.4" dependenciesMeta: esbuild: optional: true - checksum: 3ae0d3cd203e464eb18e46c060f74c789803edc6d88994ac89eab7b475470f5428077ebb0205a94ce60d71d053f5824e58cabf42da96d0a380059d23aa7fa122 + checksum: d950dab1dfb43a0c0ca434847cada9905d7195c88ae631ad56e36e2f84c2fb0bd426688ed4cb359fd374ae13fc3e638e25d997cfaf11c449d02587c32402aac4 languageName: node linkType: hard @@ -29124,6 +29139,20 @@ __metadata: languageName: node linkType: hard +"rollup-plugin-external-globals@npm:^0.7.1": + version: 0.7.1 + resolution: "rollup-plugin-external-globals@npm:0.7.1" + dependencies: + "@rollup/pluginutils": ^5.0.2 + estree-walker: ^3.0.1 + is-reference: ^3.0.0 + magic-string: ^0.26.7 + peerDependencies: + rollup: ^2.25.0 || ^3.3.0 + checksum: 15726ab0ca1f1b2f64ede90566b178531770d41f7fb31b9edd5bfb560773341d0fc39c39e37afbcc02fe567f8f7a94b8285986b19e36a89ab32cf59afb92dca6 + languageName: node + linkType: hard + "rollup@npm:^2.79.1": version: 2.79.1 resolution: "rollup@npm:2.79.1" @@ -29139,8 +29168,8 @@ __metadata: linkType: hard "rollup@npm:^3.2.5": - version: 3.4.0 - resolution: "rollup@npm:3.4.0" + version: 3.5.0 + resolution: "rollup@npm:3.5.0" dependencies: fsevents: ~2.3.2 dependenciesMeta: @@ -29148,7 +29177,7 @@ __metadata: optional: true bin: rollup: dist/bin/rollup - checksum: 4c670338adbecf8d20d8e1c2d4593689d52f9d3b55fb87d147d1168612dfabc95e278d9d2748b60cb8c48b1009ef7063447f76140a003d4ee652e0cd7f30238a + checksum: 15ac1b50c436c90d690f606dc0004eb80ff172ae38469a45494dd13e45723ebe9ec56f6122c0e834f2e51b092706b89e02ab5dc59dc42ff1f289bec558b68ab0 languageName: node linkType: hard