diff --git a/code/.storybook/main.ts b/code/.storybook/main.ts index 9870741de29e..c75f60c86d22 100644 --- a/code/.storybook/main.ts +++ b/code/.storybook/main.ts @@ -2,9 +2,9 @@ import { join } from 'node:path'; import type { StorybookConfig } from '../frameworks/react-vite'; -const componentsPath = join(__dirname, '../core/src/components'); -const managerApiPath = join(__dirname, '../core/src/manager-api'); -const imageContextPath = join(__dirname, '..//frameworks/nextjs/src/image-context.ts'); +const componentsPath = join(__dirname, '../core/src/components/index.ts'); +const managerApiPath = join(__dirname, '../core/src/manager-api/index.ts'); +const imageContextPath = join(__dirname, '../frameworks/nextjs/src/image-context.ts'); const config: StorybookConfig = { stories: [ diff --git a/code/addons/a11y/src/postinstall.ts b/code/addons/a11y/src/postinstall.ts index 9a64796f5e1b..eec54fd84cfc 100644 --- a/code/addons/a11y/src/postinstall.ts +++ b/code/addons/a11y/src/postinstall.ts @@ -1,8 +1,8 @@ -import type { PostinstallOptions } from '@storybook/cli/src/add'; - // eslint-disable-next-line depend/ban-dependencies import { execa } from 'execa'; +import type { PostinstallOptions } from '../../../lib/cli-storybook/src/add'; + const $ = execa({ preferLocal: true, stdio: 'inherit', diff --git a/code/addons/docs/src/preset.ts b/code/addons/docs/src/preset.ts index 9cff707e8472..885a143f15c9 100644 --- a/code/addons/docs/src/preset.ts +++ b/code/addons/docs/src/preset.ts @@ -73,11 +73,11 @@ async function webpack( * In the future the `@storybook/theming` and `@storybook/components` can be removed, as they * should be singletons in the future due to the peerDependency on `storybook` package. */ - const cliPath = dirname(require.resolve('storybook/package.json')); - const themingPath = join(cliPath, 'core', 'theming', 'index.js'); - const themingCreatePath = join(cliPath, 'core', 'theming', 'create.js'); + const corePath = dirname(require.resolve('storybook/package.json')); + const themingPath = join(corePath, 'dist', 'theming', 'index.js'); + const themingCreatePath = join(corePath, 'dist', 'theming', 'create.js'); - const componentsPath = join(cliPath, 'core', 'components', 'index.js'); + const componentsPath = join(corePath, 'dist', 'components', 'index.js'); const blocksPath = dirname(require.resolve('@storybook/blocks/package.json')); if (Array.isArray(webpackConfig.resolve?.alias)) { alias = [...webpackConfig.resolve?.alias]; @@ -181,10 +181,10 @@ export const viteFinal = async (config: any, options: Options) => { // Use the resolvedReact preset to alias react and react-dom to either the users version or the version shipped with addon-docs const { react, reactDom, mdx } = await getResolvedReact(options); - const cliPath = dirname(require.resolve('storybook/package.json')); - const themingPath = join(cliPath, 'core', 'theming', 'index.js'); - const themingCreatePath = join(cliPath, 'core', 'theming', 'create.js'); - const componentsPath = join(cliPath, 'core', 'components', 'index.js'); + const corePath = dirname(require.resolve('storybook/package.json')); + const themingPath = join(corePath, 'dist', 'theming', 'index.js'); + const themingCreatePath = join(corePath, 'dist', 'theming', 'create.js'); + const componentsPath = join(corePath, 'dist', 'components', 'index.js'); const blocksPath = dirname(require.resolve('@storybook/blocks/package.json')); const packageDeduplicationPlugin = { diff --git a/code/addons/essentials/src/actions/manager.ts b/code/addons/essentials/src/actions/manager.ts index 9f43dc8f053c..88cfe89adb1f 100644 --- a/code/addons/essentials/src/actions/manager.ts +++ b/code/addons/essentials/src/actions/manager.ts @@ -1 +1,2 @@ +// @ts-expect-error (no types needed for this) export * from '@storybook/addon-actions/manager'; diff --git a/code/addons/essentials/src/backgrounds/preview.ts b/code/addons/essentials/src/backgrounds/preview.ts index cf24112788f3..2d01bf61bb6a 100644 --- a/code/addons/essentials/src/backgrounds/preview.ts +++ b/code/addons/essentials/src/backgrounds/preview.ts @@ -1,2 +1 @@ -// @ts-expect-error (no types needed for this) export * from '@storybook/addon-backgrounds/preview'; diff --git a/code/addons/essentials/src/docs/manager.ts b/code/addons/essentials/src/docs/manager.ts index 6101f7d79261..9f14a38904c4 100644 --- a/code/addons/essentials/src/docs/manager.ts +++ b/code/addons/essentials/src/docs/manager.ts @@ -1,2 +1 @@ -// @ts-expect-error (no types needed for this) export * from '@storybook/addon-docs/manager'; diff --git a/code/addons/essentials/src/highlight/preview.ts b/code/addons/essentials/src/highlight/preview.ts index e124e7a1374a..c57b34aafd63 100644 --- a/code/addons/essentials/src/highlight/preview.ts +++ b/code/addons/essentials/src/highlight/preview.ts @@ -1,2 +1 @@ -// @ts-expect-error (no types needed for this) export * from '@storybook/addon-highlight/preview'; diff --git a/code/addons/essentials/src/outline/preview.ts b/code/addons/essentials/src/outline/preview.ts index 3fe09381fe8f..16cc2faa0397 100644 --- a/code/addons/essentials/src/outline/preview.ts +++ b/code/addons/essentials/src/outline/preview.ts @@ -1,2 +1 @@ -// @ts-expect-error (no types needed for this) export * from '@storybook/addon-outline/preview'; diff --git a/code/addons/essentials/src/viewport/preview.ts b/code/addons/essentials/src/viewport/preview.ts index 34ee7de45614..b039b3bfa870 100644 --- a/code/addons/essentials/src/viewport/preview.ts +++ b/code/addons/essentials/src/viewport/preview.ts @@ -1,2 +1 @@ -// @ts-expect-error (no types needed for this) export * from '@storybook/addon-viewport/preview'; diff --git a/code/addons/test/src/node/boot-test-runner.test.ts b/code/addons/test/src/node/boot-test-runner.test.ts index f5d9fde5bf28..e7171cf95df0 100644 --- a/code/addons/test/src/node/boot-test-runner.test.ts +++ b/code/addons/test/src/node/boot-test-runner.test.ts @@ -1,13 +1,12 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; -import { Channel, type ChannelTransport } from '@storybook/core/channels'; - +import { Channel, type ChannelTransport } from 'storybook/internal/channels'; import { TESTING_MODULE_CANCEL_TEST_RUN_REQUEST, TESTING_MODULE_PROGRESS_REPORT, TESTING_MODULE_RUN_REQUEST, TESTING_MODULE_WATCH_MODE_REQUEST, -} from '@storybook/core/core-events'; +} from 'storybook/internal/core-events'; // eslint-disable-next-line depend/ban-dependencies import { execaNode } from 'execa'; diff --git a/code/addons/test/src/node/test-manager.test.ts b/code/addons/test/src/node/test-manager.test.ts index 985f74c97595..27fc8d931c78 100644 --- a/code/addons/test/src/node/test-manager.test.ts +++ b/code/addons/test/src/node/test-manager.test.ts @@ -1,8 +1,8 @@ import { describe, expect, it, vi } from 'vitest'; import { createVitest as actualCreateVitest } from 'vitest/node'; -import { Channel, type ChannelTransport } from '@storybook/core/channels'; -import type { StoryIndex } from '@storybook/types'; +import { Channel, type ChannelTransport } from 'storybook/internal/channels'; +import type { StoryIndex } from 'storybook/internal/types'; import path from 'pathe'; diff --git a/code/addons/test/src/postinstall.ts b/code/addons/test/src/postinstall.ts index b3c3dba95943..0f68424a5369 100644 --- a/code/addons/test/src/postinstall.ts +++ b/code/addons/test/src/postinstall.ts @@ -289,8 +289,7 @@ export default async function postInstall(options: PostinstallOptions) { args: ['playwright', 'install', 'chromium', '--with-deps'], }); - const fileExtension = - allDeps['typescript'] || (await findFile('tsconfig', ['.json'])) ? 'ts' : 'js'; + const fileExtension = allDeps.typescript || (await findFile('tsconfig', ['.json'])) ? 'ts' : 'js'; const vitestSetupFile = resolve(options.configDir, `vitest.setup.${fileExtension}`); if (existsSync(vitestSetupFile)) { @@ -542,7 +541,7 @@ async function getStorybookInfo({ configDir, packageManager: pkgMgr }: Postinsta const presets = await loadAllPresets({ corePresets: [join(frameworkName, 'preset')], overridePresets: [ - require.resolve('@storybook/core/core-server/presets/common-override-preset'), + require.resolve('storybook/internal/core-server/presets/common-override-preset'), ], configDir, packageJson, diff --git a/code/addons/test/tsconfig.json b/code/addons/test/tsconfig.json index e8a15eafa0bd..d2318b7bb29f 100644 --- a/code/addons/test/tsconfig.json +++ b/code/addons/test/tsconfig.json @@ -2,8 +2,6 @@ "extends": "../../tsconfig.json", "compilerOptions": { "rootDir": "../../../", - "module": "Preserve", - "moduleResolution": "Bundler", "types": ["vitest"], "strict": true }, diff --git a/code/builders/builder-webpack5/src/index.ts b/code/builders/builder-webpack5/src/index.ts index 71be9982973a..9919037e5abc 100644 --- a/code/builders/builder-webpack5/src/index.ts +++ b/code/builders/builder-webpack5/src/index.ts @@ -1,5 +1,5 @@ import { cp } from 'node:fs/promises'; -import { join, parse } from 'node:path'; +import { dirname, join, parse } from 'node:path'; import { PREVIEW_BUILDER_PROGRESS } from 'storybook/internal/core-events'; import { logger } from 'storybook/internal/node-logger'; @@ -14,7 +14,6 @@ import { checkWebpackVersion } from '@storybook/core-webpack'; import prettyTime from 'pretty-hrtime'; import sirv from 'sirv'; -import { corePath } from 'storybook/core-path'; import type { Configuration, Stats, StatsOptions } from 'webpack'; import webpackDep, { DefinePlugin, ProgressPlugin } from 'webpack'; import webpackDevMiddleware from 'webpack-dev-middleware'; @@ -31,6 +30,8 @@ export const printDuration = (startTime: [number, number]) => .replace(' s', ' seconds') .replace(' m', ' minutes'); +const corePath = dirname(require.resolve('storybook/package.json')); + let compilation: ReturnType | undefined; let reject: (reason?: any) => void; diff --git a/code/lib/cli/bin/index.cjs b/code/core/bin/index.cjs similarity index 96% rename from code/lib/cli/bin/index.cjs rename to code/core/bin/index.cjs index 0aecdd1e9b9b..ce13973e4eb9 100755 --- a/code/lib/cli/bin/index.cjs +++ b/code/core/bin/index.cjs @@ -23,4 +23,4 @@ process.once('uncaughtException', (error) => { throw error; }); -require('../dist/proxy.cjs'); +require('../dist/bin/index.cjs'); diff --git a/code/core/package.json b/code/core/package.json index db2394d2401b..a53babfe9dca 100644 --- a/code/core/package.json +++ b/code/core/package.json @@ -1,5 +1,5 @@ { - "name": "@storybook/core", + "name": "storybook", "version": "8.5.0-beta.7", "description": "Storybook framework-agnostic API", "keywords": [ @@ -27,150 +27,154 @@ "import": "./dist/index.js", "require": "./dist/index.cjs" }, - "./node-logger": { + "./internal/node-logger": { "types": "./dist/node-logger/index.d.ts", "import": "./dist/node-logger/index.js", "require": "./dist/node-logger/index.cjs" }, - "./client-logger": { + "./internal/client-logger": { "types": "./dist/client-logger/index.d.ts", "import": "./dist/client-logger/index.js", "require": "./dist/client-logger/index.cjs" }, - "./theming": { + "./internal/theming": { "types": "./dist/theming/index.d.ts", "import": "./dist/theming/index.js", "require": "./dist/theming/index.cjs" }, - "./theming/create": { + "./internal/theming/create": { "types": "./dist/theming/create.d.ts", "import": "./dist/theming/create.js", "require": "./dist/theming/create.cjs" }, - "./core-server": { + "./internal/core-server": { "types": "./dist/core-server/index.d.ts", "import": "./dist/core-server/index.js", "require": "./dist/core-server/index.cjs" }, - "./core-server/presets/common-preset": { + "./internal/core-server/presets/common-preset": { "import": "./dist/core-server/presets/common-preset.js", "require": "./dist/core-server/presets/common-preset.cjs" }, - "./core-server/presets/common-manager": { + "./internal/core-server/presets/common-manager": { "import": "./dist/core-server/presets/common-manager.js" }, - "./core-server/presets/common-override-preset": { + "./internal/core-server/presets/common-override-preset": { "import": "./dist/core-server/presets/common-override-preset.js", "require": "./dist/core-server/presets/common-override-preset.cjs" }, - "./core-events": { + "./internal/core-events": { "types": "./dist/core-events/index.d.ts", "import": "./dist/core-events/index.js", "require": "./dist/core-events/index.cjs" }, - "./manager-errors": { + "./internal/manager-errors": { "types": "./dist/manager-errors.d.ts", "import": "./dist/manager-errors.js" }, - "./preview-errors": { + "./internal/preview-errors": { "types": "./dist/preview-errors.d.ts", "import": "./dist/preview-errors.js", "require": "./dist/preview-errors.cjs" }, - "./server-errors": { + "./internal/server-errors": { "types": "./dist/server-errors.d.ts", "import": "./dist/server-errors.js", "require": "./dist/server-errors.cjs" }, - "./channels": { + "./internal/channels": { "types": "./dist/channels/index.d.ts", "import": "./dist/channels/index.js", "require": "./dist/channels/index.cjs" }, - "./types": { + "./internal/types": { "types": "./dist/types/index.d.ts", "import": "./dist/types/index.js", "require": "./dist/types/index.cjs" }, - "./csf-tools": { + "./internal/csf-tools": { "types": "./dist/csf-tools/index.d.ts", "import": "./dist/csf-tools/index.js", "require": "./dist/csf-tools/index.cjs" }, - "./common": { + "./internal/common": { "types": "./dist/common/index.d.ts", "import": "./dist/common/index.js", "require": "./dist/common/index.cjs" }, - "./builder-manager": { + "./internal/builder-manager": { "types": "./dist/builder-manager/index.d.ts", "import": "./dist/builder-manager/index.js", "require": "./dist/builder-manager/index.cjs" }, - "./telemetry": { + "./internal/telemetry": { "types": "./dist/telemetry/index.d.ts", "import": "./dist/telemetry/index.js", "require": "./dist/telemetry/index.cjs" }, - "./preview-api": { + "./internal/preview-api": { "types": "./dist/preview-api/index.d.ts", "import": "./dist/preview-api/index.js", "require": "./dist/preview-api/index.cjs" }, - "./manager-api": { + "./internal/manager-api": { "types": "./dist/manager-api/index.d.ts", "import": "./dist/manager-api/index.js", "require": "./dist/manager-api/index.cjs" }, - "./router": { + "./internal/router": { "types": "./dist/router/index.d.ts", "import": "./dist/router/index.js", "require": "./dist/router/index.cjs" }, - "./components": { + "./internal/components": { "types": "./dist/components/index.d.ts", "import": "./dist/components/index.js", "require": "./dist/components/index.cjs" }, - "./docs-tools": { + "./internal/docs-tools": { "types": "./dist/docs-tools/index.d.ts", "import": "./dist/docs-tools/index.js", "require": "./dist/docs-tools/index.cjs" }, - "./manager/globals-module-info": { + "./internal/manager/globals-module-info": { "types": "./dist/manager/globals-module-info.d.ts", "import": "./dist/manager/globals-module-info.js", "require": "./dist/manager/globals-module-info.cjs" }, - "./manager/globals": { + "./internal/manager/globals": { "types": "./dist/manager/globals.d.ts", "import": "./dist/manager/globals.js", "require": "./dist/manager/globals.cjs" }, - "./preview/globals": { + "./internal/preview/globals": { "types": "./dist/preview/globals.d.ts", "import": "./dist/preview/globals.js", "require": "./dist/preview/globals.cjs" }, - "./cli": { + "./internal/cli": { "types": "./dist/cli/index.d.ts", "import": "./dist/cli/index.js", "require": "./dist/cli/index.cjs" }, - "./babel": { + "./internal/babel": { "types": "./dist/babel/index.d.ts", "import": "./dist/babel/index.js", "require": "./dist/babel/index.cjs" }, - "./cli/bin": { + "./internal/cli/bin": { "types": "./dist/cli/bin/index.d.ts", "import": "./dist/cli/bin/index.js", "require": "./dist/cli/bin/index.cjs" }, - "./preview/runtime": { + "./internal/bin": { + "import": "./dist/bin/index.js", + "require": "./dist/bin/index.cjs" + }, + "./internal/preview/runtime": { "import": "./dist/preview/runtime.js" }, - "./manager/globals-runtime": { + "./internal/manager/globals-runtime": { "import": "./dist/manager/globals-runtime.js" }, "./package.json": "./package.json" @@ -183,86 +187,87 @@ "*": [ "./dist/index.d.ts" ], - "node-logger": [ + "internal/node-logger": [ "./dist/node-logger/index.d.ts" ], - "client-logger": [ + "internal/client-logger": [ "./dist/client-logger/index.d.ts" ], - "theming": [ + "internal/theming": [ "./dist/theming/index.d.ts" ], - "theming/create": [ + "internal/theming/create": [ "./dist/theming/create.d.ts" ], - "core-server": [ + "internal/core-server": [ "./dist/core-server/index.d.ts" ], - "core-events": [ + "internal/core-events": [ "./dist/core-events/index.d.ts" ], - "manager-errors": [ + "internal/manager-errors": [ "./dist/manager-errors.d.ts" ], - "preview-errors": [ + "internal/preview-errors": [ "./dist/preview-errors.d.ts" ], - "server-errors": [ + "internal/server-errors": [ "./dist/server-errors.d.ts" ], - "channels": [ + "internal/channels": [ "./dist/channels/index.d.ts" ], - "types": [ + "internal/types": [ "./dist/types/index.d.ts" ], - "csf-tools": [ + "internal/csf-tools": [ "./dist/csf-tools/index.d.ts" ], - "common": [ + "internal/common": [ "./dist/common/index.d.ts" ], - "builder-manager": [ + "internal/builder-manager": [ "./dist/builder-manager/index.d.ts" ], - "telemetry": [ + "internal/telemetry": [ "./dist/telemetry/index.d.ts" ], - "preview-api": [ + "internal/preview-api": [ "./dist/preview-api/index.d.ts" ], - "manager-api": [ + "internal/manager-api": [ "./dist/manager-api/index.d.ts" ], - "router": [ + "internal/router": [ "./dist/router/index.d.ts" ], - "components": [ + "internal/components": [ "./dist/components/index.d.ts" ], - "docs-tools": [ + "internal/docs-tools": [ "./dist/docs-tools/index.d.ts" ], - "manager/globals-module-info": [ + "internal/manager/globals-module-info": [ "./dist/manager/globals-module-info.d.ts" ], - "manager/globals": [ + "internal/manager/globals": [ "./dist/manager/globals.d.ts" ], - "preview/globals": [ + "internal/preview/globals": [ "./dist/preview/globals.d.ts" ], - "cli": [ + "internal/cli": [ "./dist/cli/index.d.ts" ], - "babel": [ + "internal/babel": [ "./dist/babel/index.d.ts" ], - "cli/bin": [ + "internal/cli/bin": [ "./dist/cli/bin/index.d.ts" ] } }, + "bin": "./bin/index.cjs", "files": [ "dist/**/*", "assets/**/*", diff --git a/code/core/scripts/dts.ts b/code/core/scripts/dts.ts index 93458c07dfac..31b7cee0a982 100644 --- a/code/core/scripts/dts.ts +++ b/code/core/scripts/dts.ts @@ -17,24 +17,24 @@ async function run() { ...Object.keys((pkg as any).peerDependencies || {}), ...nodeInternals, 'typescript', - '@storybook/core', - - '@storybook/core/builder-manager', - '@storybook/core/channels', - '@storybook/core/client-logger', - '@storybook/core/common', - '@storybook/core/components', - '@storybook/core/core-events', - '@storybook/core/core-server', - '@storybook/core/csf-tools', - '@storybook/core/docs-tools', - '@storybook/core/manager-api', - '@storybook/core/node-logger', - '@storybook/core/preview-api', - '@storybook/core/router', - '@storybook/core/telemetry', - '@storybook/core/theming', - '@storybook/core/types', + 'storybook', + + 'storybook/internal/builder-manager', + 'storybook/internal/channels', + 'storybook/internal/client-logger', + 'storybook/internal/common', + 'storybook/internal/components', + 'storybook/internal/core-events', + 'storybook/internal/core-server', + 'storybook/internal/csf-tools', + 'storybook/internal/docs-tools', + 'storybook/internal/manager-api', + 'storybook/internal/node-logger', + 'storybook/internal/preview-api', + 'storybook/internal/router', + 'storybook/internal/telemetry', + 'storybook/internal/theming', + 'storybook/internal/types', ]; const all = entries.filter((e) => e.dts); diff --git a/code/core/scripts/entries.ts b/code/core/scripts/entries.ts index bcd1d1b94572..6d38ef48d7ac 100644 --- a/code/core/scripts/entries.ts +++ b/code/core/scripts/entries.ts @@ -46,6 +46,7 @@ export const getEntries = (cwd: string) => { define('src/cli/index.ts', ['node'], true), define('src/babel/index.ts', ['node'], true), define('src/cli/bin/index.ts', ['node'], true), + define('src/bin/index.ts', ['node'], false), ]; }; diff --git a/code/core/scripts/helpers/generatePackageJsonFile.ts b/code/core/scripts/helpers/generatePackageJsonFile.ts index c805fe6294a2..020724b8113e 100644 --- a/code/core/scripts/helpers/generatePackageJsonFile.ts +++ b/code/core/scripts/helpers/generatePackageJsonFile.ts @@ -40,7 +40,7 @@ export async function generatePackageJsonFile(entries: ReturnType { diff --git a/code/core/scripts/prep.ts b/code/core/scripts/prep.ts index 895b8f049d32..6bf0edde8206 100644 --- a/code/core/scripts/prep.ts +++ b/code/core/scripts/prep.ts @@ -94,7 +94,7 @@ async function run() { assetNames: 'assets/[name]-[hash]', bundle: true, chunkNames: 'chunks/[name]-[hash]', - external: ['@storybook/core', ...external], + external: ['storybook', ...external], keepNames: true, legalComments: 'none', lineLimit: 140, @@ -192,7 +192,7 @@ async function run() { outExtension: { '.js': '.js' }, alias: { ...browserAliases, - '@storybook/core': join(cwd, 'src'), + 'storybook/internal': join(cwd, 'src'), react: dirname(require.resolve('react/package.json')), 'react-dom': dirname(require.resolve('react-dom/package.json')), 'react-dom/client': join( @@ -217,7 +217,7 @@ async function run() { esbuild.context( merge(browserEsbuildOptions, { alias: { - '@storybook/core': join(cwd, 'src'), + 'storybook/internal': join(cwd, 'src'), react: dirname(require.resolve('react/package.json')), 'react-dom': dirname(require.resolve('react-dom/package.json')), 'react-dom/client': join( diff --git a/code/lib/cli/src/proxy.ts b/code/core/src/bin/index.ts similarity index 85% rename from code/lib/cli/src/proxy.ts rename to code/core/src/bin/index.ts index 12cac7558ae5..08376c5fef5b 100644 --- a/code/lib/cli/src/proxy.ts +++ b/code/core/src/bin/index.ts @@ -1,11 +1,11 @@ -import { versions } from '@storybook/core/common'; +import { versions } from 'storybook/internal/common'; import { spawn } from 'child_process'; const args = process.argv.slice(2); if (['dev', 'build'].includes(args[0])) { - require('@storybook/core/cli/bin'); + require('storybook/internal/cli/bin'); } else { const proxiedArgs = args[0] === 'init' diff --git a/code/core/src/builder-manager/index.ts b/code/core/src/builder-manager/index.ts index faad0a288acf..4b7ef5b2c5d5 100644 --- a/code/core/src/builder-manager/index.ts +++ b/code/core/src/builder-manager/index.ts @@ -1,10 +1,9 @@ import { cp, rm, writeFile } from 'node:fs/promises'; import { dirname, join, parse } from 'node:path'; -import { stringifyProcessEnvs } from '@storybook/core/common'; - -import { globalsModuleInfoMap } from '@storybook/core/manager/globals-module-info'; -import { logger } from '@storybook/core/node-logger'; +import { stringifyProcessEnvs } from 'storybook/internal/common'; +import { globalsModuleInfoMap } from 'storybook/internal/manager/globals-module-info'; +import { logger } from 'storybook/internal/node-logger'; import { globalExternals } from '@fal-works/esbuild-plugin-global-externals'; import { pnpPlugin } from '@yarnpkg/esbuild-plugin-pnp'; @@ -160,11 +159,7 @@ const starter: StarterFunction = async function* starterGeneratorFn({ yield; - const coreDirOrigin = join( - dirname(require.resolve('@storybook/core/package.json')), - 'dist', - 'manager' - ); + const coreDirOrigin = join(dirname(require.resolve('storybook/package.json')), 'dist', 'manager'); router.use( '/sb-addons', @@ -259,11 +254,7 @@ const builder: BuilderFunction = async function* builderGeneratorFn({ startTime, yield; const addonsDir = config.outdir; - const coreDirOrigin = join( - dirname(require.resolve('@storybook/core/package.json')), - 'dist', - 'manager' - ); + const coreDirOrigin = join(dirname(require.resolve('storybook/package.json')), 'dist', 'manager'); const coreDirTarget = join(options.outputDir, `sb-manager`); // TODO: this doesn't watch, we should change this to use the esbuild watch API: https://esbuild.github.io/api/#watch diff --git a/code/core/src/builder-manager/types.ts b/code/core/src/builder-manager/types.ts index e7541dced4bc..276083b198b1 100644 --- a/code/core/src/builder-manager/types.ts +++ b/code/core/src/builder-manager/types.ts @@ -3,7 +3,7 @@ import type { BuilderStats, Builder_Unpromise, Builder_WithRequiredProperty, -} from '@storybook/core/types'; +} from 'storybook/internal/types'; import type { BuildOptions, BuildResult } from 'esbuild'; diff --git a/code/core/src/builder-manager/utils/data.ts b/code/core/src/builder-manager/utils/data.ts index 233d3186c38e..7defc2da7739 100644 --- a/code/core/src/builder-manager/utils/data.ts +++ b/code/core/src/builder-manager/utils/data.ts @@ -1,7 +1,7 @@ import { basename } from 'node:path'; -import { getRefs } from '@storybook/core/common'; -import type { Options } from '@storybook/core/types'; +import { getRefs } from 'storybook/internal/common'; +import type { Options } from 'storybook/internal/types'; import { executor, getConfig } from '../index'; import { readTemplate } from './template'; diff --git a/code/core/src/builder-manager/utils/framework.ts b/code/core/src/builder-manager/utils/framework.ts index d399494c049c..085fe63587dd 100644 --- a/code/core/src/builder-manager/utils/framework.ts +++ b/code/core/src/builder-manager/utils/framework.ts @@ -1,7 +1,10 @@ import { sep } from 'node:path'; -import { extractProperRendererNameFromFramework, getFrameworkName } from '@storybook/core/common'; -import type { Options } from '@storybook/core/types'; +import { + extractProperRendererNameFromFramework, + getFrameworkName, +} from 'storybook/internal/common'; +import type { Options } from 'storybook/internal/types'; interface PropertyObject { name: string; diff --git a/code/core/src/builder-manager/utils/managerEntries.ts b/code/core/src/builder-manager/utils/managerEntries.ts index 787116d05c0e..5edba8b6170e 100644 --- a/code/core/src/builder-manager/utils/managerEntries.ts +++ b/code/core/src/builder-manager/utils/managerEntries.ts @@ -2,7 +2,7 @@ import { existsSync } from 'node:fs'; import { mkdir, writeFile } from 'node:fs/promises'; import { dirname, join, parse, relative, sep } from 'node:path'; -import { resolvePathInStorybookCache } from '@storybook/core/common'; +import { resolvePathInStorybookCache } from 'storybook/internal/common'; import slash from 'slash'; diff --git a/code/core/src/builder-manager/utils/template.ts b/code/core/src/builder-manager/utils/template.ts index 1ca99e07e2e6..e9fc0eb93ce7 100644 --- a/code/core/src/builder-manager/utils/template.ts +++ b/code/core/src/builder-manager/utils/template.ts @@ -1,12 +1,12 @@ import { readFile } from 'node:fs/promises'; import { dirname, join } from 'node:path'; -import type { DocsOptions, Options, Ref, TagsOptions } from '@storybook/core/types'; +import type { DocsOptions, Options, Ref, TagsOptions } from 'storybook/internal/types'; import { render } from 'ejs'; export const getTemplatePath = async (template: string) => { - return join(dirname(require.resolve('@storybook/core/package.json')), 'assets/server', template); + return join(dirname(require.resolve('storybook/package.json')), 'assets/server', template); }; export const readTemplate = async (template: string) => { diff --git a/code/core/src/channels/postmessage/getEventSourceUrl.ts b/code/core/src/channels/postmessage/getEventSourceUrl.ts index 630002d38dfe..1be3c5742772 100644 --- a/code/core/src/channels/postmessage/getEventSourceUrl.ts +++ b/code/core/src/channels/postmessage/getEventSourceUrl.ts @@ -1,4 +1,4 @@ -import { logger } from '@storybook/core/client-logger'; +import { logger } from 'storybook/internal/client-logger'; export const getEventSourceUrl = (event: MessageEvent) => { const frames: HTMLIFrameElement[] = Array.from( diff --git a/code/core/src/channels/postmessage/index.ts b/code/core/src/channels/postmessage/index.ts index f7ae1d72b1a5..48506794229d 100644 --- a/code/core/src/channels/postmessage/index.ts +++ b/code/core/src/channels/postmessage/index.ts @@ -1,8 +1,8 @@ /// -import { global } from '@storybook/global'; +import { logger, pretty } from 'storybook/internal/client-logger'; +import * as EVENTS from 'storybook/internal/core-events'; -import { logger, pretty } from '@storybook/core/client-logger'; -import * as EVENTS from '@storybook/core/core-events'; +import { global } from '@storybook/global'; import { isJSON, parse, stringify } from 'telejson'; import invariant from 'tiny-invariant'; diff --git a/code/core/src/channels/websocket/index.ts b/code/core/src/channels/websocket/index.ts index 15033296512b..2867208938e2 100644 --- a/code/core/src/channels/websocket/index.ts +++ b/code/core/src/channels/websocket/index.ts @@ -1,7 +1,7 @@ /// -import { global } from '@storybook/global'; +import * as EVENTS from 'storybook/internal/core-events'; -import * as EVENTS from '@storybook/core/core-events'; +import { global } from '@storybook/global'; import { isJSON, parse, stringify } from 'telejson'; import invariant from 'tiny-invariant'; diff --git a/code/core/src/cli/angular/helpers.ts b/code/core/src/cli/angular/helpers.ts index 78ef8836996f..8c85756901e5 100644 --- a/code/core/src/cli/angular/helpers.ts +++ b/code/core/src/cli/angular/helpers.ts @@ -1,8 +1,8 @@ import { existsSync, readFileSync, writeFileSync } from 'node:fs'; import { join } from 'node:path'; -import { logger } from '@storybook/core/node-logger'; -import { MissingAngularJsonError } from '@storybook/core/server-errors'; +import { logger } from 'storybook/internal/node-logger'; +import { MissingAngularJsonError } from 'storybook/internal/server-errors'; import boxen from 'boxen'; import prompts from 'prompts'; diff --git a/code/core/src/cli/bin/index.ts b/code/core/src/cli/bin/index.ts index 060879635d61..d4a85724aef2 100644 --- a/code/core/src/cli/bin/index.ts +++ b/code/core/src/cli/bin/index.ts @@ -1,7 +1,6 @@ -import { getEnvConfig, parseList, versions } from '@storybook/core/common'; -import { addToGlobalContext } from '@storybook/core/telemetry'; - -import { logger } from '@storybook/core/node-logger'; +import { getEnvConfig, parseList, versions } from 'storybook/internal/common'; +import { logger } from 'storybook/internal/node-logger'; +import { addToGlobalContext } from 'storybook/internal/telemetry'; import { program } from 'commander'; import { findPackageSync } from 'fd-package-json'; diff --git a/code/core/src/cli/build.ts b/code/core/src/cli/build.ts index 2a8594cf76ed..a27fe6f27139 100644 --- a/code/core/src/cli/build.ts +++ b/code/core/src/cli/build.ts @@ -1,6 +1,5 @@ -import { cache } from '@storybook/core/common'; - -import { buildStaticStandalone, withTelemetry } from '@storybook/core/core-server'; +import { cache } from 'storybook/internal/common'; +import { buildStaticStandalone, withTelemetry } from 'storybook/internal/core-server'; import { findPackage } from 'fd-package-json'; import invariant from 'tiny-invariant'; diff --git a/code/core/src/cli/detect.test.ts b/code/core/src/cli/detect.test.ts index 409cf92effa7..f8ee8831ce67 100644 --- a/code/core/src/cli/detect.test.ts +++ b/code/core/src/cli/detect.test.ts @@ -2,9 +2,8 @@ import { existsSync } from 'node:fs'; import { afterEach, describe, expect, it, vi } from 'vitest'; -import type { JsPackageManager, PackageJsonWithMaybeDeps } from '@storybook/core/common'; - -import { logger } from '@storybook/core/node-logger'; +import type { JsPackageManager, PackageJsonWithMaybeDeps } from 'storybook/internal/common'; +import { logger } from 'storybook/internal/node-logger'; import { detect, detectFrameworkPreset, detectLanguage } from './detect'; import { ProjectType, SupportedLanguage } from './project_types'; @@ -27,7 +26,7 @@ vi.mock('fs', () => ({ mkdirSync: vi.fn(), })); -vi.mock('@storybook/core/node-logger'); +vi.mock('storybook/internal/node-logger'); const MOCK_FRAMEWORK_FILES: { name: string; diff --git a/code/core/src/cli/detect.ts b/code/core/src/cli/detect.ts index a771f6476f8c..b0ae0ffc7a41 100644 --- a/code/core/src/cli/detect.ts +++ b/code/core/src/cli/detect.ts @@ -1,10 +1,9 @@ import { existsSync } from 'node:fs'; import { resolve } from 'node:path'; -import type { JsPackageManager, PackageJsonWithMaybeDeps } from '@storybook/core/common'; -import { HandledError, commandLog } from '@storybook/core/common'; - -import { logger } from '@storybook/core/node-logger'; +import type { JsPackageManager, PackageJsonWithMaybeDeps } from 'storybook/internal/common'; +import { HandledError, commandLog } from 'storybook/internal/common'; +import { logger } from 'storybook/internal/node-logger'; import { findUpSync } from 'find-up'; import prompts from 'prompts'; diff --git a/code/core/src/cli/dev.ts b/code/core/src/cli/dev.ts index 26ff6250f3a8..7e96cc91b4ba 100644 --- a/code/core/src/cli/dev.ts +++ b/code/core/src/cli/dev.ts @@ -1,8 +1,7 @@ -import { cache } from '@storybook/core/common'; -import type { CLIOptions } from '@storybook/core/types'; - -import { buildDevStandalone, withTelemetry } from '@storybook/core/core-server'; -import { logger, instance as npmLog } from '@storybook/core/node-logger'; +import { cache } from 'storybook/internal/common'; +import { buildDevStandalone, withTelemetry } from 'storybook/internal/core-server'; +import { logger, instance as npmLog } from 'storybook/internal/node-logger'; +import type { CLIOptions } from 'storybook/internal/types'; import { findPackage } from 'fd-package-json'; import invariant from 'tiny-invariant'; diff --git a/code/core/src/cli/dirs.ts b/code/core/src/cli/dirs.ts index 6e6867e38d57..a75c1f90d9fd 100644 --- a/code/core/src/cli/dirs.ts +++ b/code/core/src/cli/dirs.ts @@ -1,8 +1,8 @@ import { dirname, join } from 'node:path'; -import type { JsPackageManager } from '@storybook/core/common'; -import { temporaryDirectory, versions } from '@storybook/core/common'; -import type { SupportedFrameworks } from '@storybook/core/types'; +import { temporaryDirectory, versions } from 'storybook/internal/common'; +import type { JsPackageManager } from 'storybook/internal/common'; +import type { SupportedFrameworks } from 'storybook/internal/types'; import downloadTarballDefault from '@ndelangen/get-tarball'; import getNpmTarballUrlDefault from 'get-npm-tarball-url'; diff --git a/code/core/src/cli/eslintPlugin.ts b/code/core/src/cli/eslintPlugin.ts index 24903afc35cd..3ed59cfbf02b 100644 --- a/code/core/src/cli/eslintPlugin.ts +++ b/code/core/src/cli/eslintPlugin.ts @@ -1,10 +1,9 @@ import { existsSync } from 'node:fs'; import { readFile, writeFile } from 'node:fs/promises'; -import type { JsPackageManager } from '@storybook/core/common'; -import { paddedLog } from '@storybook/core/common'; - -import { readConfig, writeConfig } from '@storybook/core/csf-tools'; +import type { JsPackageManager } from 'storybook/internal/common'; +import { paddedLog } from 'storybook/internal/common'; +import { readConfig, writeConfig } from 'storybook/internal/csf-tools'; import detectIndent from 'detect-indent'; import picocolors from 'picocolors'; diff --git a/code/core/src/cli/helpers.test.ts b/code/core/src/cli/helpers.test.ts index 03e85ccc941d..ed13b7905a2c 100644 --- a/code/core/src/cli/helpers.test.ts +++ b/code/core/src/cli/helpers.test.ts @@ -3,7 +3,7 @@ import fsp from 'node:fs/promises'; import { beforeEach, describe, expect, it, vi } from 'vitest'; -import type { JsPackageManager } from '@storybook/core/common'; +import type { JsPackageManager } from 'storybook/internal/common'; import { sep } from 'path'; diff --git a/code/core/src/cli/helpers.ts b/code/core/src/cli/helpers.ts index d5ebb9b65a2d..c7f08b181337 100644 --- a/code/core/src/cli/helpers.ts +++ b/code/core/src/cli/helpers.ts @@ -7,9 +7,9 @@ import { type JsPackageManager, type PackageJson, type PackageJsonWithDepsAndDevDeps, -} from '@storybook/core/common'; -import { versions as storybookMonorepoPackages } from '@storybook/core/common'; -import type { SupportedFrameworks, SupportedRenderers } from '@storybook/core/types'; +} from 'storybook/internal/common'; +import { versions as storybookMonorepoPackages } from 'storybook/internal/common'; +import type { SupportedFrameworks, SupportedRenderers } from 'storybook/internal/types'; import { findUpSync } from 'find-up'; import picocolors from 'picocolors'; diff --git a/code/core/src/cli/project_types.ts b/code/core/src/cli/project_types.ts index d9ca64e25345..588ac3d14880 100644 --- a/code/core/src/cli/project_types.ts +++ b/code/core/src/cli/project_types.ts @@ -1,7 +1,7 @@ import type { SupportedRenderers as CoreSupportedRenderers, SupportedFrameworks, -} from '@storybook/core/types'; +} from 'storybook/internal/types'; import { minVersion, validRange } from 'semver'; diff --git a/code/core/src/client-logger/README.md b/code/core/src/client-logger/README.md index 69ac1dbe5e23..5f04a63e34e5 100644 --- a/code/core/src/client-logger/README.md +++ b/code/core/src/client-logger/README.md @@ -5,7 +5,7 @@ Any client-side logging that is done through storybook should be done through th Examples: ```js -import { logger } from '@storybook/core/client-logger'; +import { logger } from 'storybook/internal/client-logger'; logger.info('Info message'); logger.warn('Warning message'); diff --git a/code/core/src/common/js-package-manager/BUNProxy.ts b/code/core/src/common/js-package-manager/BUNProxy.ts index 01ede64cfa5a..9cfbea194813 100644 --- a/code/core/src/common/js-package-manager/BUNProxy.ts +++ b/code/core/src/common/js-package-manager/BUNProxy.ts @@ -2,8 +2,8 @@ import { existsSync, readFileSync } from 'node:fs'; import { platform } from 'node:os'; import { join } from 'node:path'; -import { logger } from '@storybook/core/node-logger'; -import { FindPackageVersionsError } from '@storybook/core/server-errors'; +import { logger } from 'storybook/internal/node-logger'; +import { FindPackageVersionsError } from 'storybook/internal/server-errors'; import { findUp } from 'find-up'; import sort from 'semver/functions/sort.js'; diff --git a/code/core/src/common/js-package-manager/NPMProxy.test.ts b/code/core/src/common/js-package-manager/NPMProxy.test.ts index 11f34a986bf1..753b345f03c2 100644 --- a/code/core/src/common/js-package-manager/NPMProxy.test.ts +++ b/code/core/src/common/js-package-manager/NPMProxy.test.ts @@ -101,33 +101,33 @@ describe('NPM Proxy', () => { describe('addDependencies', () => { describe('npm6', () => { - it('with devDep it should run `npm install -D @storybook/core`', async () => { + it('with devDep it should run `npm install -D storybook`', async () => { const executeCommandSpy = vi .spyOn(npmProxy, 'executeCommand') .mockResolvedValueOnce('6.0.0'); - await npmProxy.addDependencies({ installAsDevDependencies: true }, ['@storybook/core']); + await npmProxy.addDependencies({ installAsDevDependencies: true }, ['storybook']); expect(executeCommandSpy).toHaveBeenLastCalledWith( expect.objectContaining({ command: 'npm', - args: ['install', '-D', '@storybook/core'], + args: ['install', '-D', 'storybook'], }) ); }); }); describe('npm7', () => { - it('with devDep it should run `npm install -D @storybook/core`', async () => { + it('with devDep it should run `npm install -D storybook`', async () => { const executeCommandSpy = vi .spyOn(npmProxy, 'executeCommand') .mockResolvedValueOnce('7.0.0'); - await npmProxy.addDependencies({ installAsDevDependencies: true }, ['@storybook/core']); + await npmProxy.addDependencies({ installAsDevDependencies: true }, ['storybook']); expect(executeCommandSpy).toHaveBeenLastCalledWith( expect.objectContaining({ command: 'npm', - args: ['install', '-D', '@storybook/core'], + args: ['install', '-D', 'storybook'], }) ); }); @@ -136,33 +136,33 @@ describe('NPM Proxy', () => { describe('removeDependencies', () => { describe('npm6', () => { - it('with devDep it should run `npm uninstall @storybook/core`', async () => { + it('with devDep it should run `npm uninstall storybook`', async () => { const executeCommandSpy = vi .spyOn(npmProxy, 'executeCommand') .mockResolvedValueOnce('6.0.0'); - npmProxy.removeDependencies({}, ['@storybook/core']); + npmProxy.removeDependencies({}, ['storybook']); expect(executeCommandSpy).toHaveBeenLastCalledWith( expect.objectContaining({ command: 'npm', - args: ['uninstall', '@storybook/core'], + args: ['uninstall', 'storybook'], }) ); }); }); describe('npm7', () => { - it('with devDep it should run `npm uninstall @storybook/core`', async () => { + it('with devDep it should run `npm uninstall storybook`', async () => { const executeCommandSpy = vi .spyOn(npmProxy, 'executeCommand') .mockResolvedValueOnce('7.0.0'); - await npmProxy.removeDependencies({}, ['@storybook/core']); + await npmProxy.removeDependencies({}, ['storybook']); expect(executeCommandSpy).toHaveBeenLastCalledWith( expect.objectContaining({ command: 'npm', - args: ['uninstall', '@storybook/core'], + args: ['uninstall', 'storybook'], }) ); }); @@ -205,12 +205,12 @@ describe('NPM Proxy', () => { .spyOn(npmProxy, 'executeCommand') .mockResolvedValueOnce('"5.3.19"'); - const version = await npmProxy.latestVersion('@storybook/core'); + const version = await npmProxy.latestVersion('storybook'); expect(executeCommandSpy).toHaveBeenCalledWith( expect.objectContaining({ command: 'npm', - args: ['info', '@storybook/core', 'version', '--json'], + args: ['info', 'storybook', 'version', '--json'], }) ); expect(version).toEqual('5.3.19'); @@ -221,12 +221,12 @@ describe('NPM Proxy', () => { .spyOn(npmProxy, 'executeCommand') .mockResolvedValueOnce('["4.25.3","5.3.19","6.0.0-beta.23"]'); - const version = await npmProxy.latestVersion('@storybook/core', '5.X'); + const version = await npmProxy.latestVersion('storybook', '5.X'); expect(executeCommandSpy).toHaveBeenCalledWith( expect.objectContaining({ command: 'npm', - args: ['info', '@storybook/core', 'versions', '--json'], + args: ['info', 'storybook', 'versions', '--json'], }) ); expect(version).toEqual('5.3.19'); @@ -235,7 +235,7 @@ describe('NPM Proxy', () => { it('throws an error if command output is not a valid JSON', async () => { vi.spyOn(npmProxy, 'executeCommand').mockResolvedValueOnce('NOT A JSON'); - await expect(npmProxy.latestVersion('@storybook/core')).rejects.toThrow(); + await expect(npmProxy.latestVersion('storybook')).rejects.toThrow(); }); }); diff --git a/code/core/src/common/js-package-manager/NPMProxy.ts b/code/core/src/common/js-package-manager/NPMProxy.ts index 5acc1a4dd18c..f8e0c6e928aa 100644 --- a/code/core/src/common/js-package-manager/NPMProxy.ts +++ b/code/core/src/common/js-package-manager/NPMProxy.ts @@ -2,8 +2,8 @@ import { existsSync, readFileSync } from 'node:fs'; import { platform } from 'node:os'; import { join } from 'node:path'; -import { logger } from '@storybook/core/node-logger'; -import { FindPackageVersionsError } from '@storybook/core/server-errors'; +import { logger } from 'storybook/internal/node-logger'; +import { FindPackageVersionsError } from 'storybook/internal/server-errors'; import { findUp } from 'find-up'; import sort from 'semver/functions/sort.js'; diff --git a/code/core/src/common/js-package-manager/PNPMProxy.test.ts b/code/core/src/common/js-package-manager/PNPMProxy.test.ts index f869dcb8181d..915fdc74415b 100644 --- a/code/core/src/common/js-package-manager/PNPMProxy.test.ts +++ b/code/core/src/common/js-package-manager/PNPMProxy.test.ts @@ -57,34 +57,34 @@ describe('PNPM Proxy', () => { }); describe('addDependencies', () => { - it('with devDep it should run `pnpm add -D @storybook/core`', async () => { + it('with devDep it should run `pnpm add -D storybook`', async () => { const executeCommandSpy = vi .spyOn(pnpmProxy, 'executeCommand') .mockResolvedValueOnce('6.0.0'); - await pnpmProxy.addDependencies({ installAsDevDependencies: true }, ['@storybook/core']); + await pnpmProxy.addDependencies({ installAsDevDependencies: true }, ['storybook']); expect(executeCommandSpy).toHaveBeenLastCalledWith( expect.objectContaining({ command: 'pnpm', - args: ['add', '-D', '@storybook/core'], + args: ['add', '-D', 'storybook'], }) ); }); }); describe('removeDependencies', () => { - it('with devDep it should run `npm uninstall @storybook/core`', async () => { + it('with devDep it should run `npm uninstall storybook`', async () => { const executeCommandSpy = vi .spyOn(pnpmProxy, 'executeCommand') .mockResolvedValueOnce('6.0.0'); - await pnpmProxy.removeDependencies({}, ['@storybook/core']); + await pnpmProxy.removeDependencies({}, ['storybook']); expect(executeCommandSpy).toHaveBeenLastCalledWith( expect.objectContaining({ command: 'pnpm', - args: ['remove', '@storybook/core'], + args: ['remove', 'storybook'], }) ); }); @@ -127,12 +127,12 @@ describe('PNPM Proxy', () => { .spyOn(pnpmProxy, 'executeCommand') .mockResolvedValueOnce('"5.3.19"'); - const version = await pnpmProxy.latestVersion('@storybook/core'); + const version = await pnpmProxy.latestVersion('storybook'); expect(executeCommandSpy).toHaveBeenCalledWith( expect.objectContaining({ command: 'pnpm', - args: ['info', '@storybook/core', 'version', '--json'], + args: ['info', 'storybook', 'version', '--json'], }) ); expect(version).toEqual('5.3.19'); @@ -143,12 +143,12 @@ describe('PNPM Proxy', () => { .spyOn(pnpmProxy, 'executeCommand') .mockResolvedValueOnce('["4.25.3","5.3.19","6.0.0-beta.23"]'); - const version = await pnpmProxy.latestVersion('@storybook/core', '5.X'); + const version = await pnpmProxy.latestVersion('storybook', '5.X'); expect(executeCommandSpy).toHaveBeenCalledWith( expect.objectContaining({ command: 'pnpm', - args: ['info', '@storybook/core', 'versions', '--json'], + args: ['info', 'storybook', 'versions', '--json'], }) ); expect(version).toEqual('5.3.19'); @@ -157,7 +157,7 @@ describe('PNPM Proxy', () => { it('throws an error if command output is not a valid JSON', async () => { vi.spyOn(pnpmProxy, 'executeCommand').mockResolvedValueOnce('NOT A JSON'); - await expect(pnpmProxy.latestVersion('@storybook/core')).rejects.toThrow(); + await expect(pnpmProxy.latestVersion('storybook')).rejects.toThrow(); }); }); diff --git a/code/core/src/common/js-package-manager/PNPMProxy.ts b/code/core/src/common/js-package-manager/PNPMProxy.ts index 4149682c490b..a20eb4d488b1 100644 --- a/code/core/src/common/js-package-manager/PNPMProxy.ts +++ b/code/core/src/common/js-package-manager/PNPMProxy.ts @@ -1,7 +1,7 @@ import { existsSync, readFileSync } from 'node:fs'; import { join } from 'node:path'; -import { FindPackageVersionsError } from '@storybook/core/server-errors'; +import { FindPackageVersionsError } from 'storybook/internal/server-errors'; import { findUpSync } from 'find-up'; import { dedent } from 'ts-dedent'; diff --git a/code/core/src/common/js-package-manager/PackageJson.ts b/code/core/src/common/js-package-manager/PackageJson.ts index 0247740c807f..ba26248eee8d 100644 --- a/code/core/src/common/js-package-manager/PackageJson.ts +++ b/code/core/src/common/js-package-manager/PackageJson.ts @@ -1,4 +1,4 @@ -import type { PackageJson } from '@storybook/core/types'; +import type { PackageJson } from 'storybook/internal/types'; export type PackageJsonWithDepsAndDevDeps = PackageJson & Required>; diff --git a/code/core/src/common/js-package-manager/Yarn1Proxy.test.ts b/code/core/src/common/js-package-manager/Yarn1Proxy.test.ts index 69bbc046aaf0..b7905e25a75a 100644 --- a/code/core/src/common/js-package-manager/Yarn1Proxy.test.ts +++ b/code/core/src/common/js-package-manager/Yarn1Proxy.test.ts @@ -57,30 +57,30 @@ describe('Yarn 1 Proxy', () => { }); describe('addDependencies', () => { - it('with devDep it should run `yarn install -D --ignore-workspace-root-check @storybook/core`', async () => { + it('with devDep it should run `yarn install -D --ignore-workspace-root-check storybook`', async () => { const executeCommandSpy = vi.spyOn(yarn1Proxy, 'executeCommand').mockResolvedValueOnce(''); - await yarn1Proxy.addDependencies({ installAsDevDependencies: true }, ['@storybook/core']); + await yarn1Proxy.addDependencies({ installAsDevDependencies: true }, ['storybook']); expect(executeCommandSpy).toHaveBeenCalledWith( expect.objectContaining({ command: 'yarn', - args: ['add', '--ignore-workspace-root-check', '-D', '@storybook/core'], + args: ['add', '--ignore-workspace-root-check', '-D', 'storybook'], }) ); }); }); describe('removeDependencies', () => { - it('should run `yarn remove --ignore-workspace-root-check @storybook/core`', async () => { + it('should run `yarn remove --ignore-workspace-root-check storybook`', async () => { const executeCommandSpy = vi.spyOn(yarn1Proxy, 'executeCommand').mockResolvedValueOnce(''); - yarn1Proxy.removeDependencies({}, ['@storybook/core']); + yarn1Proxy.removeDependencies({}, ['storybook']); expect(executeCommandSpy).toHaveBeenCalledWith( expect.objectContaining({ command: 'yarn', - args: ['remove', '--ignore-workspace-root-check', '@storybook/core'], + args: ['remove', '--ignore-workspace-root-check', 'storybook'], }) ); }); @@ -121,12 +121,12 @@ describe('Yarn 1 Proxy', () => { .spyOn(yarn1Proxy, 'executeCommand') .mockResolvedValueOnce('{"type":"inspect","data":"5.3.19"}'); - const version = await yarn1Proxy.latestVersion('@storybook/core'); + const version = await yarn1Proxy.latestVersion('storybook'); expect(executeCommandSpy).toHaveBeenCalledWith( expect.objectContaining({ command: 'yarn', - args: ['info', '@storybook/core', 'version', '--json'], + args: ['info', 'storybook', 'version', '--json'], }) ); expect(version).toEqual('5.3.19'); @@ -137,12 +137,12 @@ describe('Yarn 1 Proxy', () => { .spyOn(yarn1Proxy, 'executeCommand') .mockResolvedValueOnce('{"type":"inspect","data":["4.25.3","5.3.19","6.0.0-beta.23"]}'); - const version = await yarn1Proxy.latestVersion('@storybook/core', '5.X'); + const version = await yarn1Proxy.latestVersion('storybook', '5.X'); expect(executeCommandSpy).toHaveBeenCalledWith( expect.objectContaining({ command: 'yarn', - args: ['info', '@storybook/core', 'versions', '--json'], + args: ['info', 'storybook', 'versions', '--json'], }) ); expect(version).toEqual('5.3.19'); @@ -151,7 +151,7 @@ describe('Yarn 1 Proxy', () => { it('throws an error if command output is not a valid JSON', async () => { vi.spyOn(yarn1Proxy, 'executeCommand').mockResolvedValueOnce('NOT A JSON'); - await expect(yarn1Proxy.latestVersion('@storybook/core')).rejects.toThrow(); + await expect(yarn1Proxy.latestVersion('storybook')).rejects.toThrow(); }); }); diff --git a/code/core/src/common/js-package-manager/Yarn1Proxy.ts b/code/core/src/common/js-package-manager/Yarn1Proxy.ts index 72860a209a9a..699f817573f7 100644 --- a/code/core/src/common/js-package-manager/Yarn1Proxy.ts +++ b/code/core/src/common/js-package-manager/Yarn1Proxy.ts @@ -1,7 +1,7 @@ import { existsSync, readFileSync } from 'node:fs'; import { join } from 'node:path'; -import { FindPackageVersionsError } from '@storybook/core/server-errors'; +import { FindPackageVersionsError } from 'storybook/internal/server-errors'; import { findUp } from 'find-up'; import { dedent } from 'ts-dedent'; diff --git a/code/core/src/common/js-package-manager/Yarn2Proxy.test.ts b/code/core/src/common/js-package-manager/Yarn2Proxy.test.ts index fad7e829d180..d1bdf117313e 100644 --- a/code/core/src/common/js-package-manager/Yarn2Proxy.test.ts +++ b/code/core/src/common/js-package-manager/Yarn2Proxy.test.ts @@ -55,30 +55,30 @@ describe('Yarn 2 Proxy', () => { }); describe('addDependencies', () => { - it('with devDep it should run `yarn install -D @storybook/core`', async () => { + it('with devDep it should run `yarn install -D storybook`', async () => { const executeCommandSpy = vi.spyOn(yarn2Proxy, 'executeCommand').mockResolvedValueOnce(''); - await yarn2Proxy.addDependencies({ installAsDevDependencies: true }, ['@storybook/core']); + await yarn2Proxy.addDependencies({ installAsDevDependencies: true }, ['storybook']); expect(executeCommandSpy).toHaveBeenCalledWith( expect.objectContaining({ command: 'yarn', - args: ['add', '-D', '@storybook/core'], + args: ['add', '-D', 'storybook'], }) ); }); }); describe('removeDependencies', () => { - it('should run `yarn remove @storybook/core`', async () => { + it('should run `yarn remove storybook`', async () => { const executeCommandSpy = vi.spyOn(yarn2Proxy, 'executeCommand').mockResolvedValueOnce(''); - await yarn2Proxy.removeDependencies({}, ['@storybook/core']); + await yarn2Proxy.removeDependencies({}, ['storybook']); expect(executeCommandSpy).toHaveBeenCalledWith( expect.objectContaining({ command: 'yarn', - args: ['remove', '@storybook/core'], + args: ['remove', 'storybook'], }) ); }); @@ -117,14 +117,14 @@ describe('Yarn 2 Proxy', () => { it('without constraint it returns the latest version', async () => { const executeCommandSpy = vi .spyOn(yarn2Proxy, 'executeCommand') - .mockResolvedValueOnce('{"name":"@storybook/core","version":"5.3.19"}'); + .mockResolvedValueOnce('{"name":"storybook","version":"5.3.19"}'); - const version = await yarn2Proxy.latestVersion('@storybook/core'); + const version = await yarn2Proxy.latestVersion('storybook'); expect(executeCommandSpy).toHaveBeenCalledWith( expect.objectContaining({ command: 'yarn', - args: ['npm', 'info', '@storybook/core', '--fields', 'version', '--json'], + args: ['npm', 'info', 'storybook', '--fields', 'version', '--json'], }) ); expect(version).toEqual('5.3.19'); @@ -134,15 +134,15 @@ describe('Yarn 2 Proxy', () => { const executeCommandSpy = vi .spyOn(yarn2Proxy, 'executeCommand') .mockResolvedValueOnce( - '{"name":"@storybook/core","versions":["4.25.3","5.3.19","6.0.0-beta.23"]}' + '{"name":"storybook","versions":["4.25.3","5.3.19","6.0.0-beta.23"]}' ); - const version = await yarn2Proxy.latestVersion('@storybook/core', '5.X'); + const version = await yarn2Proxy.latestVersion('storybook', '5.X'); expect(executeCommandSpy).toHaveBeenCalledWith( expect.objectContaining({ command: 'yarn', - args: ['npm', 'info', '@storybook/core', '--fields', 'versions', '--json'], + args: ['npm', 'info', 'storybook', '--fields', 'versions', '--json'], }) ); expect(version).toEqual('5.3.19'); @@ -151,7 +151,7 @@ describe('Yarn 2 Proxy', () => { it('throws an error if command output is not a valid JSON', async () => { vi.spyOn(yarn2Proxy, 'executeCommand').mockResolvedValueOnce('NOT A JSON'); - await expect(yarn2Proxy.latestVersion('@storybook/core')).rejects.toThrow(); + await expect(yarn2Proxy.latestVersion('storybook')).rejects.toThrow(); }); }); diff --git a/code/core/src/common/js-package-manager/Yarn2Proxy.ts b/code/core/src/common/js-package-manager/Yarn2Proxy.ts index 75b5b5878ba6..1bd8a44f5457 100644 --- a/code/core/src/common/js-package-manager/Yarn2Proxy.ts +++ b/code/core/src/common/js-package-manager/Yarn2Proxy.ts @@ -1,7 +1,7 @@ import { existsSync, readFileSync } from 'node:fs'; import { join } from 'node:path'; -import { FindPackageVersionsError } from '@storybook/core/server-errors'; +import { FindPackageVersionsError } from 'storybook/internal/server-errors'; import { PosixFS, VirtualFS, ZipOpenFS } from '@yarnpkg/fslib'; import { getLibzipSync } from '@yarnpkg/libzip'; diff --git a/code/core/src/common/presets.test.ts b/code/core/src/common/presets.test.ts index 565abe4521f4..3a9a6c701a3f 100644 --- a/code/core/src/common/presets.test.ts +++ b/code/core/src/common/presets.test.ts @@ -2,7 +2,7 @@ import { normalize } from 'node:path'; import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; -import { logger } from '@storybook/core/node-logger'; +import { logger } from 'storybook/internal/node-logger'; import mockRequire from 'mock-require'; @@ -19,7 +19,7 @@ function mockPreset(name: string, mockPresetObject: any) { mockRequire(name, mockPresetObject); } -vi.mock('@storybook/core/node-logger', () => ({ +vi.mock('storybook/internal/node-logger', () => ({ logger: { info: vi.fn(), warn: vi.fn(), diff --git a/code/core/src/common/presets.ts b/code/core/src/common/presets.ts index b85b35d62b77..aa5f2c605aa0 100644 --- a/code/core/src/common/presets.ts +++ b/code/core/src/common/presets.ts @@ -1,5 +1,7 @@ import { join, parse } from 'node:path'; +import { logger } from 'storybook/internal/node-logger'; +import { CriticalPresetLoadError } from 'storybook/internal/server-errors'; import type { BuilderOptions, CLIOptions, @@ -10,10 +12,7 @@ import type { PresetConfig, Presets, StorybookConfigRaw, -} from '@storybook/core/types'; - -import { logger } from '@storybook/core/node-logger'; -import { CriticalPresetLoadError } from '@storybook/core/server-errors'; +} from 'storybook/internal/types'; import { dedent } from 'ts-dedent'; diff --git a/code/core/src/common/utils/__tests__/check-addon-order.test.ts b/code/core/src/common/utils/__tests__/check-addon-order.test.ts index 5e7c0a43a106..ed603d4609c2 100644 --- a/code/core/src/common/utils/__tests__/check-addon-order.test.ts +++ b/code/core/src/common/utils/__tests__/check-addon-order.test.ts @@ -1,12 +1,11 @@ import { afterEach, describe, expect, it, vi } from 'vitest'; +import { logger } from 'storybook/internal/node-logger'; import type { CoreCommon_AddonEntry, CoreCommon_AddonInfo, CoreCommon_OptionsEntry, -} from '@storybook/core/types'; - -import { logger } from '@storybook/core/node-logger'; +} from 'storybook/internal/types'; import { checkAddonOrder } from '../check-addon-order'; diff --git a/code/core/src/common/utils/__tests__/normalize-stories.test.ts b/code/core/src/common/utils/__tests__/normalize-stories.test.ts index 26e5f1bcc3c8..c104114f7e3f 100644 --- a/code/core/src/common/utils/__tests__/normalize-stories.test.ts +++ b/code/core/src/common/utils/__tests__/normalize-stories.test.ts @@ -3,7 +3,7 @@ import { sep } from 'node:path'; import { describe, expect, it, vi } from 'vitest'; -import { InvalidStoriesEntryError } from '@storybook/core/server-errors'; +import { InvalidStoriesEntryError } from 'storybook/internal/server-errors'; import { getDirectoryFromWorkingDir, diff --git a/code/core/src/common/utils/__tests__/template.test.ts b/code/core/src/common/utils/__tests__/template.test.ts index 93fdf7a8ed87..649db2c7b722 100644 --- a/code/core/src/common/utils/__tests__/template.test.ts +++ b/code/core/src/common/utils/__tests__/template.test.ts @@ -18,7 +18,7 @@ const BASE_HTML_CONTENTS = ''; const BASE_BODY_HTML_CONTENTS = '
story contents
'; const BODY_HTML_CONTENTS = '
custom body contents
'; -const base = dirname(require.resolve('@storybook/core/package.json')); +const base = dirname(require.resolve('storybook/package.json')); describe('server.getPreviewHeadHtml', () => { afterEach(() => { diff --git a/code/core/src/common/utils/check-addon-order.ts b/code/core/src/common/utils/check-addon-order.ts index 9d8f72669e0f..505376b5398f 100644 --- a/code/core/src/common/utils/check-addon-order.ts +++ b/code/core/src/common/utils/check-addon-order.ts @@ -1,10 +1,9 @@ +import { logger } from 'storybook/internal/node-logger'; import type { CoreCommon_AddonEntry, CoreCommon_AddonInfo, CoreCommon_OptionsEntry, -} from '@storybook/core/types'; - -import { logger } from '@storybook/core/node-logger'; +} from 'storybook/internal/types'; interface Options { before: CoreCommon_AddonInfo; diff --git a/code/core/src/common/utils/cli.test.ts b/code/core/src/common/utils/cli.test.ts index eecfcc648889..4c6d1e574e1d 100644 --- a/code/core/src/common/utils/cli.test.ts +++ b/code/core/src/common/utils/cli.test.ts @@ -6,7 +6,7 @@ describe('UTILS', () => { describe.each([ ['@storybook/react', true], ['@storybook/node-logger', true], - ['@storybook/core', true], + ['storybook', true], ['@storybook/linter-config', false], ['@storybook/design-system', false], ['@storybook/addon-styling', false], diff --git a/code/core/src/common/utils/framework-to-renderer.ts b/code/core/src/common/utils/framework-to-renderer.ts index 72cb4c1e2484..e77434a73898 100644 --- a/code/core/src/common/utils/framework-to-renderer.ts +++ b/code/core/src/common/utils/framework-to-renderer.ts @@ -1,5 +1,5 @@ -import type { SupportedFrameworks } from '@storybook/core/types'; -import type { SupportedRenderers } from '@storybook/core/types'; +import type { SupportedRenderers } from 'storybook/internal/types'; +import type { SupportedFrameworks } from 'storybook/internal/types'; export const frameworkToRenderer: Record< SupportedFrameworks | SupportedRenderers, diff --git a/code/core/src/common/utils/get-builder-options.ts b/code/core/src/common/utils/get-builder-options.ts index 99f39f766719..55ddc565ad63 100644 --- a/code/core/src/common/utils/get-builder-options.ts +++ b/code/core/src/common/utils/get-builder-options.ts @@ -1,4 +1,4 @@ -import type { Options } from '@storybook/core/types'; +import type { Options } from 'storybook/internal/types'; /** * Builder options can be specified in `core.builder.options` or `framework.options.builder`. diff --git a/code/core/src/common/utils/get-framework-name.ts b/code/core/src/common/utils/get-framework-name.ts index 25b45b772bd9..ba9d52c8d54e 100644 --- a/code/core/src/common/utils/get-framework-name.ts +++ b/code/core/src/common/utils/get-framework-name.ts @@ -1,4 +1,4 @@ -import type { Options } from '@storybook/core/types'; +import type { Options } from 'storybook/internal/types'; import { dedent } from 'ts-dedent'; diff --git a/code/core/src/common/utils/get-renderer-name.ts b/code/core/src/common/utils/get-renderer-name.ts index 75e95f76411f..8dab8e11e554 100644 --- a/code/core/src/common/utils/get-renderer-name.ts +++ b/code/core/src/common/utils/get-renderer-name.ts @@ -1,4 +1,4 @@ -import type { Options } from '@storybook/core/types'; +import type { Options } from 'storybook/internal/types'; import { frameworkToRenderer } from './framework-to-renderer'; import { extractProperFrameworkName, getFrameworkName } from './get-framework-name'; diff --git a/code/core/src/common/utils/get-story-id.ts b/code/core/src/common/utils/get-story-id.ts index 2275cdfcf8ce..1f5ab3827cfe 100644 --- a/code/core/src/common/utils/get-story-id.ts +++ b/code/core/src/common/utils/get-story-id.ts @@ -1,10 +1,10 @@ import { relative } from 'node:path'; -import { normalizeStories, normalizeStoryPath } from '@storybook/core/common'; -import type { Options, StoriesEntry } from '@storybook/core/types'; -import { sanitize, storyNameFromExport, toId } from '@storybook/csf'; +import { normalizeStories, normalizeStoryPath } from 'storybook/internal/common'; +import { userOrAutoTitleFromSpecifier } from 'storybook/internal/preview-api'; +import type { Options, StoriesEntry } from 'storybook/internal/types'; -import { userOrAutoTitleFromSpecifier } from '@storybook/core/preview-api'; +import { sanitize, storyNameFromExport, toId } from '@storybook/csf'; import { dedent } from 'ts-dedent'; diff --git a/code/core/src/common/utils/get-storybook-info.ts b/code/core/src/common/utils/get-storybook-info.ts index ce6d5670f7f1..e9160cef489b 100644 --- a/code/core/src/common/utils/get-storybook-info.ts +++ b/code/core/src/common/utils/get-storybook-info.ts @@ -1,8 +1,8 @@ import { existsSync } from 'node:fs'; import { join } from 'node:path'; -import type { SupportedFrameworks } from '@storybook/core/types'; -import type { CoreCommon_StorybookInfo, PackageJson } from '@storybook/core/types'; +import type { SupportedFrameworks } from 'storybook/internal/types'; +import type { CoreCommon_StorybookInfo, PackageJson } from 'storybook/internal/types'; import { getStorybookConfiguration } from './get-storybook-configuration'; diff --git a/code/core/src/common/utils/get-storybook-refs.ts b/code/core/src/common/utils/get-storybook-refs.ts index 4108ba969412..0b615b60a572 100644 --- a/code/core/src/common/utils/get-storybook-refs.ts +++ b/code/core/src/common/utils/get-storybook-refs.ts @@ -1,9 +1,8 @@ import { readFile } from 'node:fs/promises'; import { dirname, join } from 'node:path'; -import type { Options, Ref } from '@storybook/core/types'; - -import { logger } from '@storybook/core/node-logger'; +import { logger } from 'storybook/internal/node-logger'; +import type { Options, Ref } from 'storybook/internal/types'; import { findUp } from 'find-up'; import resolveFrom from 'resolve-from'; diff --git a/code/core/src/common/utils/load-custom-presets.ts b/code/core/src/common/utils/load-custom-presets.ts index dcb104351703..c5e2b272daef 100644 --- a/code/core/src/common/utils/load-custom-presets.ts +++ b/code/core/src/common/utils/load-custom-presets.ts @@ -1,6 +1,6 @@ import { resolve } from 'node:path'; -import type { PresetConfig } from '@storybook/core/types'; +import type { PresetConfig } from 'storybook/internal/types'; import { serverRequire, serverResolve } from './interpret-require'; import { validateConfigurationFiles } from './validate-configuration-files'; diff --git a/code/core/src/common/utils/load-main-config.ts b/code/core/src/common/utils/load-main-config.ts index e594a380d6f8..7403829e10ea 100644 --- a/code/core/src/common/utils/load-main-config.ts +++ b/code/core/src/common/utils/load-main-config.ts @@ -1,9 +1,11 @@ import { readFile } from 'node:fs/promises'; import { relative, resolve } from 'node:path'; -import type { StorybookConfig } from '@storybook/core/types'; - -import { MainFileESMOnlyImportError, MainFileEvaluationError } from '@storybook/core/server-errors'; +import { + MainFileESMOnlyImportError, + MainFileEvaluationError, +} from 'storybook/internal/server-errors'; +import type { StorybookConfig } from 'storybook/internal/types'; import { serverRequire, serverResolve } from './interpret-require'; import { validateConfigurationFiles } from './validate-configuration-files'; diff --git a/code/core/src/common/utils/load-manager-or-addons-file.ts b/code/core/src/common/utils/load-manager-or-addons-file.ts index a60fd6daf9ec..cb9d20261bd0 100644 --- a/code/core/src/common/utils/load-manager-or-addons-file.ts +++ b/code/core/src/common/utils/load-manager-or-addons-file.ts @@ -1,6 +1,6 @@ import { resolve } from 'node:path'; -import { logger } from '@storybook/core/node-logger'; +import { logger } from 'storybook/internal/node-logger'; import { dedent } from 'ts-dedent'; diff --git a/code/core/src/common/utils/normalize-stories.ts b/code/core/src/common/utils/normalize-stories.ts index a001209f401b..cfdf5a52a67a 100644 --- a/code/core/src/common/utils/normalize-stories.ts +++ b/code/core/src/common/utils/normalize-stories.ts @@ -1,9 +1,8 @@ import { lstatSync } from 'node:fs'; import { basename, dirname, relative, resolve } from 'node:path'; -import type { NormalizedStoriesSpecifier, StoriesEntry } from '@storybook/core/types'; - -import { InvalidStoriesEntryError } from '@storybook/core/server-errors'; +import { InvalidStoriesEntryError } from 'storybook/internal/server-errors'; +import type { NormalizedStoriesSpecifier, StoriesEntry } from 'storybook/internal/types'; import * as pico from 'picomatch'; import slash from 'slash'; diff --git a/code/core/src/common/utils/remove.ts b/code/core/src/common/utils/remove.ts index 24879cf36169..91dda44dc357 100644 --- a/code/core/src/common/utils/remove.ts +++ b/code/core/src/common/utils/remove.ts @@ -1,4 +1,4 @@ -import { readConfig, writeConfig } from '@storybook/core/csf-tools'; +import { readConfig, writeConfig } from 'storybook/internal/csf-tools'; import { dedent } from 'ts-dedent'; diff --git a/code/core/src/common/utils/template.ts b/code/core/src/common/utils/template.ts index eb32545b7ea2..a92120c671ab 100644 --- a/code/core/src/common/utils/template.ts +++ b/code/core/src/common/utils/template.ts @@ -8,7 +8,7 @@ export function getPreviewBodyTemplate( configDirPath: string, interpolations?: Record ) { - const packageDir = dirname(require.resolve('@storybook/core/package.json')); + const packageDir = dirname(require.resolve('storybook/package.json')); const base = readFileSync(`${packageDir}/assets/server/base-preview-body.html`, 'utf8'); const bodyHtmlPath = resolve(configDirPath, 'preview-body.html'); @@ -25,7 +25,7 @@ export function getPreviewHeadTemplate( configDirPath: string, interpolations?: Record ) { - const packageDir = dirname(require.resolve('@storybook/core/package.json')); + const packageDir = dirname(require.resolve('storybook/package.json')); const base = readFileSync(`${packageDir}/assets/server/base-preview-head.html`, 'utf8'); const headHtmlPath = resolve(configDirPath, 'preview-head.html'); diff --git a/code/core/src/common/utils/validate-config.ts b/code/core/src/common/utils/validate-config.ts index 221ea9235522..388d915de105 100644 --- a/code/core/src/common/utils/validate-config.ts +++ b/code/core/src/common/utils/validate-config.ts @@ -4,7 +4,7 @@ import { CouldNotEvaluateFrameworkError, InvalidFrameworkNameError, MissingFrameworkFieldError, -} from '@storybook/core/server-errors'; +} from 'storybook/internal/server-errors'; import { frameworkPackages } from './get-storybook-info'; diff --git a/code/core/src/common/utils/validate-configuration-files.ts b/code/core/src/common/utils/validate-configuration-files.ts index ccd0dba864ea..735342881b82 100644 --- a/code/core/src/common/utils/validate-configuration-files.ts +++ b/code/core/src/common/utils/validate-configuration-files.ts @@ -1,7 +1,7 @@ import { resolve } from 'node:path'; -import { once } from '@storybook/core/node-logger'; -import { MainFileMissingError } from '@storybook/core/server-errors'; +import { once } from 'storybook/internal/node-logger'; +import { MainFileMissingError } from 'storybook/internal/server-errors'; // eslint-disable-next-line depend/ban-dependencies import { glob } from 'glob'; diff --git a/code/core/src/common/versions.ts b/code/core/src/common/versions.ts index a422b03fabdd..205c3f375fcd 100644 --- a/code/core/src/common/versions.ts +++ b/code/core/src/common/versions.ts @@ -21,7 +21,7 @@ export default { '@storybook/addon-viewport': '8.5.0-beta.7', '@storybook/builder-vite': '8.5.0-beta.7', '@storybook/builder-webpack5': '8.5.0-beta.7', - '@storybook/core': '8.5.0-beta.7', + storybook: '8.5.0-beta.7', '@storybook/builder-manager': '8.5.0-beta.7', '@storybook/channels': '8.5.0-beta.7', '@storybook/client-logger': '8.5.0-beta.7', @@ -60,7 +60,6 @@ export default { '@storybook/web-components-vite': '8.5.0-beta.7', '@storybook/web-components-webpack5': '8.5.0-beta.7', '@storybook/blocks': '8.5.0-beta.7', - storybook: '8.5.0-beta.7', sb: '8.5.0-beta.7', '@storybook/cli': '8.5.0-beta.7', '@storybook/codemod': '8.5.0-beta.7', diff --git a/code/core/src/components/brand/SideBySide.tsx b/code/core/src/components/brand/SideBySide.tsx index a766c7c7d953..3ecc08dbc02e 100644 --- a/code/core/src/components/brand/SideBySide.tsx +++ b/code/core/src/components/brand/SideBySide.tsx @@ -1,4 +1,4 @@ -import { styled } from '@storybook/core/theming'; +import { styled } from 'storybook/internal/theming'; export const SideBySide = styled.div({ display: 'grid', diff --git a/code/core/src/components/brand/colorpalette.mdx b/code/core/src/components/brand/colorpalette.mdx index 582013002dac..6bdb70b69db6 100644 --- a/code/core/src/components/brand/colorpalette.mdx +++ b/code/core/src/components/brand/colorpalette.mdx @@ -1,6 +1,6 @@ import { Meta, ColorPalette, ColorItem } from '@storybook/blocks'; -import { themes, ThemeProvider, convert, ensure } from '@storybook/core/theming'; +import { themes, ThemeProvider, convert, ensure } from 'storybook/internal/theming'; import { SideBySide } from './SideBySide'; diff --git a/code/core/src/components/brand/typography.mdx b/code/core/src/components/brand/typography.mdx index 8e07423757c7..43b582aee66a 100644 --- a/code/core/src/components/brand/typography.mdx +++ b/code/core/src/components/brand/typography.mdx @@ -1,4 +1,4 @@ -import { typography } from '@storybook/core/theming'; +import { typography } from 'storybook/internal/theming'; import { Meta, Typeset } from '@storybook/blocks'; export const fontSizes = ['l3', 'l2', 'l1', 'm3', 'm2', 'm1', 's3', 's2', 's1'].map( diff --git a/code/core/src/components/components/ActionBar/ActionBar.tsx b/code/core/src/components/components/ActionBar/ActionBar.tsx index 6e3d15077e41..d509642a3ff5 100644 --- a/code/core/src/components/components/ActionBar/ActionBar.tsx +++ b/code/core/src/components/components/ActionBar/ActionBar.tsx @@ -1,7 +1,7 @@ import type { MouseEvent, ReactElement } from 'react'; import React from 'react'; -import { styled } from '@storybook/core/theming'; +import { styled } from 'storybook/internal/theming'; const Container = styled.div(({ theme }) => ({ position: 'absolute', diff --git a/code/core/src/components/components/Badge/Badge.tsx b/code/core/src/components/components/Badge/Badge.tsx index a76cbd1121cc..e29ad43738ea 100644 --- a/code/core/src/components/components/Badge/Badge.tsx +++ b/code/core/src/components/components/Badge/Badge.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import { styled } from '@storybook/core/theming'; +import { styled } from 'storybook/internal/theming'; import { transparentize } from 'polished'; diff --git a/code/core/src/components/components/Button/Button.tsx b/code/core/src/components/components/Button/Button.tsx index a1804ebac153..e6e6fb96ac08 100644 --- a/code/core/src/components/components/Button/Button.tsx +++ b/code/core/src/components/components/Button/Button.tsx @@ -1,9 +1,8 @@ import type { ButtonHTMLAttributes, SyntheticEvent } from 'react'; import React, { forwardRef, useEffect, useState } from 'react'; -import { isPropValid, styled } from '@storybook/core/theming'; - -import { deprecate } from '@storybook/core/client-logger'; +import { deprecate } from 'storybook/internal/client-logger'; +import { isPropValid, styled } from 'storybook/internal/theming'; import { Slot } from '@radix-ui/react-slot'; import { darken, lighten, rgba, transparentize } from 'polished'; diff --git a/code/core/src/components/components/ErrorFormatter/ErrorFormatter.tsx b/code/core/src/components/components/ErrorFormatter/ErrorFormatter.tsx index b33a4c2f4040..f04746aa9a5c 100644 --- a/code/core/src/components/components/ErrorFormatter/ErrorFormatter.tsx +++ b/code/core/src/components/components/ErrorFormatter/ErrorFormatter.tsx @@ -1,6 +1,7 @@ import React, { Fragment } from 'react'; -import { styled } from '@storybook/core/theming'; +import { styled } from 'storybook/internal/theming'; + import { global } from '@storybook/global'; const { document } = global; diff --git a/code/core/src/components/components/Loader/Loader.tsx b/code/core/src/components/components/Loader/Loader.tsx index dace42a9b351..a1f48f4ffbce 100644 --- a/code/core/src/components/components/Loader/Loader.tsx +++ b/code/core/src/components/components/Loader/Loader.tsx @@ -1,6 +1,7 @@ import React from 'react'; -import { keyframes, styled } from '@storybook/core/theming'; +import { keyframes, styled } from 'storybook/internal/theming'; + import { LightningOffIcon } from '@storybook/icons'; import { transparentize } from 'polished'; diff --git a/code/core/src/components/components/Modal/Modal.styled.tsx b/code/core/src/components/components/Modal/Modal.styled.tsx index 37bb8be84404..24ca5cc0a252 100644 --- a/code/core/src/components/components/Modal/Modal.styled.tsx +++ b/code/core/src/components/components/Modal/Modal.styled.tsx @@ -1,7 +1,8 @@ import type { ComponentProps } from 'react'; import React from 'react'; -import { keyframes, styled } from '@storybook/core/theming'; +import { keyframes, styled } from 'storybook/internal/theming'; + import { CrossIcon } from '@storybook/icons'; import * as Dialog from '@radix-ui/react-dialog'; diff --git a/code/core/src/components/components/ProgressSpinner/ProgressSpinner.tsx b/code/core/src/components/components/ProgressSpinner/ProgressSpinner.tsx index 02f81ab6d344..99cb591c3083 100644 --- a/code/core/src/components/components/ProgressSpinner/ProgressSpinner.tsx +++ b/code/core/src/components/components/ProgressSpinner/ProgressSpinner.tsx @@ -1,6 +1,6 @@ import React, { type ComponentProps } from 'react'; -import { keyframes, styled } from '@storybook/core/theming'; +import { keyframes, styled } from 'storybook/internal/theming'; const XMLNS = 'http://www.w3.org/2000/svg'; diff --git a/code/core/src/components/components/ScrollArea/ScrollArea.stories.tsx b/code/core/src/components/components/ScrollArea/ScrollArea.stories.tsx index 134088a66eda..0fd154f1349c 100644 --- a/code/core/src/components/components/ScrollArea/ScrollArea.stories.tsx +++ b/code/core/src/components/components/ScrollArea/ScrollArea.stories.tsx @@ -1,7 +1,7 @@ import type { ReactElement } from 'react'; import React, { Fragment } from 'react'; -import { styled } from '@storybook/core/theming'; +import { styled } from 'storybook/internal/theming'; import { ScrollArea } from './ScrollArea'; diff --git a/code/core/src/components/components/ScrollArea/ScrollArea.tsx b/code/core/src/components/components/ScrollArea/ScrollArea.tsx index 195f70d68b06..bffed73ab311 100644 --- a/code/core/src/components/components/ScrollArea/ScrollArea.tsx +++ b/code/core/src/components/components/ScrollArea/ScrollArea.tsx @@ -1,6 +1,6 @@ import React, { forwardRef } from 'react'; -import { styled } from '@storybook/core/theming'; +import { styled } from 'storybook/internal/theming'; import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area'; diff --git a/code/core/src/components/components/Zoom/ZoomElement.tsx b/code/core/src/components/components/Zoom/ZoomElement.tsx index 7fb8068a3d60..092ec91be700 100644 --- a/code/core/src/components/components/Zoom/ZoomElement.tsx +++ b/code/core/src/components/components/Zoom/ZoomElement.tsx @@ -1,7 +1,7 @@ import type { ReactElement } from 'react'; import React, { useCallback, useEffect, useRef, useState } from 'react'; -import { styled } from '@storybook/core/theming'; +import { styled } from 'storybook/internal/theming'; import type { ResizeHandler } from 'use-resize-observer'; import useResizeObserver from 'use-resize-observer'; diff --git a/code/core/src/components/components/bar/bar.tsx b/code/core/src/components/components/bar/bar.tsx index 571d84016620..96520daea99c 100644 --- a/code/core/src/components/components/bar/bar.tsx +++ b/code/core/src/components/components/bar/bar.tsx @@ -1,7 +1,7 @@ import type { ComponentProps } from 'react'; import React, { Children } from 'react'; -import { styled } from '@storybook/core/theming'; +import { styled } from 'storybook/internal/theming'; import type { ScrollAreaProps } from '../ScrollArea/ScrollArea'; import { ScrollArea } from '../ScrollArea/ScrollArea'; diff --git a/code/core/src/components/components/bar/button.tsx b/code/core/src/components/components/bar/button.tsx index dc1727d10b57..4a8a326e528e 100644 --- a/code/core/src/components/components/bar/button.tsx +++ b/code/core/src/components/components/bar/button.tsx @@ -9,7 +9,7 @@ import type { } from 'react'; import React, { forwardRef } from 'react'; -import { isPropValid, styled } from '@storybook/core/theming'; +import { isPropValid, styled } from 'storybook/internal/theming'; interface ButtonProps extends DetailedHTMLProps, HTMLButtonElement> { diff --git a/code/core/src/components/components/bar/separator.tsx b/code/core/src/components/components/bar/separator.tsx index dd06697e9af0..e72ed7e37f1d 100644 --- a/code/core/src/components/components/bar/separator.tsx +++ b/code/core/src/components/components/bar/separator.tsx @@ -1,6 +1,6 @@ import React, { Fragment } from 'react'; -import { styled } from '@storybook/core/theming'; +import { styled } from 'storybook/internal/theming'; export interface SeparatorProps { force?: boolean; diff --git a/code/core/src/components/components/clipboard/ClipboardCode.tsx b/code/core/src/components/components/clipboard/ClipboardCode.tsx index bb9ffd1bf736..1ca8264cc9d7 100644 --- a/code/core/src/components/components/clipboard/ClipboardCode.tsx +++ b/code/core/src/components/components/clipboard/ClipboardCode.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import { color, styled, typography } from '@storybook/core/theming'; +import { color, styled, typography } from 'storybook/internal/theming'; const Code = styled.pre` line-height: 18px; diff --git a/code/core/src/components/components/form/field/field.tsx b/code/core/src/components/components/form/field/field.tsx index ad43a1388781..388e8cb81c40 100644 --- a/code/core/src/components/components/form/field/field.tsx +++ b/code/core/src/components/components/form/field/field.tsx @@ -1,7 +1,7 @@ import type { ReactNode } from 'react'; import React from 'react'; -import { styled } from '@storybook/core/theming'; +import { styled } from 'storybook/internal/theming'; const Wrapper = styled.label(({ theme }) => ({ display: 'flex', diff --git a/code/core/src/components/components/form/form.stories.tsx b/code/core/src/components/components/form/form.stories.tsx index a081368f6db9..1a2ba432cb70 100644 --- a/code/core/src/components/components/form/form.stories.tsx +++ b/code/core/src/components/components/form/form.stories.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import { styled } from '@storybook/core/theming'; +import { styled } from 'storybook/internal/theming'; import { action } from '@storybook/addon-actions'; diff --git a/code/core/src/components/components/form/index.tsx b/code/core/src/components/components/form/index.tsx index 4eba4e779f11..ef6f9e9f5f93 100644 --- a/code/core/src/components/components/form/index.tsx +++ b/code/core/src/components/components/form/index.tsx @@ -1,4 +1,4 @@ -import { styled } from '@storybook/core/theming'; +import { styled } from 'storybook/internal/theming'; import { Button } from '../Button/Button'; import { Field } from './field/field'; diff --git a/code/core/src/components/components/form/input/input.tsx b/code/core/src/components/components/form/input/input.tsx index b32381ff107d..d684be0cd694 100644 --- a/code/core/src/components/components/form/input/input.tsx +++ b/code/core/src/components/components/form/input/input.tsx @@ -1,8 +1,8 @@ import type { HTMLProps, SelectHTMLAttributes } from 'react'; import React, { forwardRef } from 'react'; -import type { CSSObject, StorybookTheme } from '@storybook/core/theming'; -import { styled } from '@storybook/core/theming'; +import type { CSSObject, StorybookTheme } from 'storybook/internal/theming'; +import { styled } from 'storybook/internal/theming'; import TextareaAutoResize from 'react-textarea-autosize'; diff --git a/code/core/src/components/components/icon/icon.stories.tsx b/code/core/src/components/components/icon/icon.stories.tsx index acafe6af4425..522af78a6d60 100644 --- a/code/core/src/components/components/icon/icon.stories.tsx +++ b/code/core/src/components/components/icon/icon.stories.tsx @@ -1,7 +1,7 @@ import type { ComponentProps } from 'react'; import React from 'react'; -import { css, styled } from '@storybook/core/theming'; +import { css, styled } from 'storybook/internal/theming'; import type { IconType } from './icon'; import { Icons, icons } from './icon'; diff --git a/code/core/src/components/components/icon/icon.tsx b/code/core/src/components/components/icon/icon.tsx index bc9d447bec97..ea3b58ce4664 100644 --- a/code/core/src/components/components/icon/icon.tsx +++ b/code/core/src/components/components/icon/icon.tsx @@ -1,10 +1,10 @@ import type { ComponentProps } from 'react'; import React, { memo } from 'react'; -import { styled } from '@storybook/core/theming'; -import * as StorybookIcons from '@storybook/icons'; +import { deprecate, logger } from 'storybook/internal/client-logger'; +import { styled } from 'storybook/internal/theming'; -import { deprecate, logger } from '@storybook/core/client-logger'; +import * as StorybookIcons from '@storybook/icons'; export type IconType = keyof typeof icons; type NewIconTypes = (typeof icons)[IconType]; diff --git a/code/core/src/components/components/placeholder/placeholder.tsx b/code/core/src/components/components/placeholder/placeholder.tsx index faa7d1df78b7..b5bd178d9441 100644 --- a/code/core/src/components/components/placeholder/placeholder.tsx +++ b/code/core/src/components/components/placeholder/placeholder.tsx @@ -1,6 +1,6 @@ import React, { Children } from 'react'; -import { styled } from '@storybook/core/theming'; +import { styled } from 'storybook/internal/theming'; const Title = styled.div(({ theme }) => ({ fontWeight: theme.typography.weight.bold, diff --git a/code/core/src/components/components/shared/animation.ts b/code/core/src/components/components/shared/animation.ts index 7838d880b93d..bf3f53d0d0e6 100644 --- a/code/core/src/components/components/shared/animation.ts +++ b/code/core/src/components/components/shared/animation.ts @@ -1,4 +1,4 @@ -import { keyframes } from '@storybook/core/theming'; +import { keyframes } from 'storybook/internal/theming'; export const rotate360 = keyframes` from { diff --git a/code/core/src/components/components/spaced/Spaced.stories.tsx b/code/core/src/components/components/spaced/Spaced.stories.tsx index 3f342022e3b5..0c5f98bad331 100644 --- a/code/core/src/components/components/spaced/Spaced.stories.tsx +++ b/code/core/src/components/components/spaced/Spaced.stories.tsx @@ -1,7 +1,7 @@ import type { ComponentProps } from 'react'; import React from 'react'; -import { styled } from '@storybook/core/theming'; +import { styled } from 'storybook/internal/theming'; import { Spaced } from './Spaced'; diff --git a/code/core/src/components/components/spaced/Spaced.tsx b/code/core/src/components/components/spaced/Spaced.tsx index 4c0afcfb9bfd..1658eb123afc 100644 --- a/code/core/src/components/components/spaced/Spaced.tsx +++ b/code/core/src/components/components/spaced/Spaced.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import { ignoreSsrWarning, styled } from '@storybook/core/theming'; +import { ignoreSsrWarning, styled } from 'storybook/internal/theming'; const toNumber = (input: any) => (typeof input === 'number' ? input : Number(input)); diff --git a/code/core/src/components/components/syntaxhighlighter/syntaxhighlighter.stories.tsx b/code/core/src/components/components/syntaxhighlighter/syntaxhighlighter.stories.tsx index 712b329ce2f0..25367395b9c7 100644 --- a/code/core/src/components/components/syntaxhighlighter/syntaxhighlighter.stories.tsx +++ b/code/core/src/components/components/syntaxhighlighter/syntaxhighlighter.stories.tsx @@ -1,7 +1,7 @@ import type { ComponentProps } from 'react'; import React from 'react'; -import { ThemeProvider, ensure, themes } from '@storybook/core/theming'; +import { ThemeProvider, ensure, themes } from 'storybook/internal/theming'; import { SyntaxHighlighter } from './lazy-syntaxhighlighter'; diff --git a/code/core/src/components/components/syntaxhighlighter/syntaxhighlighter.tsx b/code/core/src/components/components/syntaxhighlighter/syntaxhighlighter.tsx index aecec066f27d..958979dce261 100644 --- a/code/core/src/components/components/syntaxhighlighter/syntaxhighlighter.tsx +++ b/code/core/src/components/components/syntaxhighlighter/syntaxhighlighter.tsx @@ -1,10 +1,10 @@ import type { MouseEvent } from 'react'; import React, { useCallback, useEffect, useState } from 'react'; -import { styled } from '@storybook/core/theming'; -import { global } from '@storybook/global'; +import { logger } from 'storybook/internal/client-logger'; +import { styled } from 'storybook/internal/theming'; -import { logger } from '@storybook/core/client-logger'; +import { global } from '@storybook/global'; import memoize from 'memoizerific'; // @ts-expect-error (Converted from ts-ignore) diff --git a/code/core/src/components/components/tabs/EmptyTabContent.stories.tsx b/code/core/src/components/components/tabs/EmptyTabContent.stories.tsx index 9c291b9e6299..fa4b90e709c4 100644 --- a/code/core/src/components/components/tabs/EmptyTabContent.stories.tsx +++ b/code/core/src/components/components/tabs/EmptyTabContent.stories.tsx @@ -1,6 +1,7 @@ import React from 'react'; -import { Link } from '@storybook/core/components'; +import { Link } from 'storybook/internal/components'; + import { DocumentIcon } from '@storybook/icons'; import type { Meta, StoryObj } from '@storybook/react'; diff --git a/code/core/src/components/components/tabs/EmptyTabContent.tsx b/code/core/src/components/components/tabs/EmptyTabContent.tsx index cdb191e59716..61673616f8d7 100644 --- a/code/core/src/components/components/tabs/EmptyTabContent.tsx +++ b/code/core/src/components/components/tabs/EmptyTabContent.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import { styled } from '@storybook/core/theming'; +import { styled } from 'storybook/internal/theming'; const Wrapper = styled.div(({ theme }) => ({ height: '100%', diff --git a/code/core/src/components/components/tabs/tabs.helpers.tsx b/code/core/src/components/components/tabs/tabs.helpers.tsx index 90ae4c2c10ab..da08e63a2ab1 100644 --- a/code/core/src/components/components/tabs/tabs.helpers.tsx +++ b/code/core/src/components/components/tabs/tabs.helpers.tsx @@ -1,8 +1,8 @@ import type { FC, PropsWithChildren, ReactChild, ReactElement, ReactNode } from 'react'; import React, { Children } from 'react'; -import { styled } from '@storybook/core/theming'; -import type { Addon_RenderOptions } from '@storybook/core/types'; +import { styled } from 'storybook/internal/theming'; +import type { Addon_RenderOptions } from 'storybook/internal/types'; import type { TabsProps } from './tabs'; diff --git a/code/core/src/components/components/tabs/tabs.hooks.tsx b/code/core/src/components/components/tabs/tabs.hooks.tsx index be3a8f2060a7..6725188c4172 100644 --- a/code/core/src/components/components/tabs/tabs.hooks.tsx +++ b/code/core/src/components/components/tabs/tabs.hooks.tsx @@ -1,6 +1,7 @@ import React, { useCallback, useLayoutEffect, useRef, useState } from 'react'; -import { styled } from '@storybook/core/theming'; +import { styled } from 'storybook/internal/theming'; + import { sanitize } from '@storybook/csf'; import useResizeObserver from 'use-resize-observer'; diff --git a/code/core/src/components/components/tabs/tabs.tsx b/code/core/src/components/components/tabs/tabs.tsx index 3c8c46c45c1b..ae681d43a900 100644 --- a/code/core/src/components/components/tabs/tabs.tsx +++ b/code/core/src/components/components/tabs/tabs.tsx @@ -1,8 +1,9 @@ import type { FC, PropsWithChildren, ReactElement, ReactNode, SyntheticEvent } from 'react'; import React, { Component, memo, useMemo } from 'react'; -import { styled } from '@storybook/core/theming'; -import type { Addon_RenderOptions } from '@storybook/core/types'; +import { styled } from 'storybook/internal/theming'; +import type { Addon_RenderOptions } from 'storybook/internal/types'; + import { sanitize } from '@storybook/csf'; import { FlexBar } from '../bar/bar'; diff --git a/code/core/src/components/components/tooltip/ListItem.tsx b/code/core/src/components/components/tooltip/ListItem.tsx index 10e513cc1b6b..d3596cc9f16c 100644 --- a/code/core/src/components/components/tooltip/ListItem.tsx +++ b/code/core/src/components/components/tooltip/ListItem.tsx @@ -1,7 +1,7 @@ import type { ComponentProps, ReactNode, SyntheticEvent } from 'react'; import React from 'react'; -import { styled } from '@storybook/core/theming'; +import { styled } from 'storybook/internal/theming'; import memoize from 'memoizerific'; import { transparentize } from 'polished'; diff --git a/code/core/src/components/components/tooltip/Tooltip.stories.tsx b/code/core/src/components/components/tooltip/Tooltip.stories.tsx index 35385c1b447f..b255bb815b33 100644 --- a/code/core/src/components/components/tooltip/Tooltip.stories.tsx +++ b/code/core/src/components/components/tooltip/Tooltip.stories.tsx @@ -1,7 +1,7 @@ import type { ComponentProps } from 'react'; import React from 'react'; -import { styled } from '@storybook/core/theming'; +import { styled } from 'storybook/internal/theming'; import { Tooltip } from './Tooltip'; diff --git a/code/core/src/components/components/tooltip/Tooltip.tsx b/code/core/src/components/components/tooltip/Tooltip.tsx index ef053f1baf5b..1d55dc303bad 100644 --- a/code/core/src/components/components/tooltip/Tooltip.tsx +++ b/code/core/src/components/components/tooltip/Tooltip.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import { type Color, lighten, styled } from '@storybook/core/theming'; +import { type Color, lighten, styled } from 'storybook/internal/theming'; import memoize from 'memoizerific'; diff --git a/code/core/src/components/components/tooltip/TooltipLinkList.tsx b/code/core/src/components/components/tooltip/TooltipLinkList.tsx index 91e86eae71af..c2ac48aa780e 100644 --- a/code/core/src/components/components/tooltip/TooltipLinkList.tsx +++ b/code/core/src/components/components/tooltip/TooltipLinkList.tsx @@ -1,7 +1,7 @@ import type { ComponentProps, ReactNode, SyntheticEvent } from 'react'; import React, { Fragment, useCallback } from 'react'; -import { styled } from '@storybook/core/theming'; +import { styled } from 'storybook/internal/theming'; import type { LinkWrapperType, ListItemProps } from './ListItem'; import ListItem from './ListItem'; diff --git a/code/core/src/components/components/tooltip/TooltipMessage.tsx b/code/core/src/components/components/tooltip/TooltipMessage.tsx index 3882e428fab7..da15b0421369 100644 --- a/code/core/src/components/components/tooltip/TooltipMessage.tsx +++ b/code/core/src/components/components/tooltip/TooltipMessage.tsx @@ -1,7 +1,7 @@ import type { ReactNode } from 'react'; import React from 'react'; -import { styled } from '@storybook/core/theming'; +import { styled } from 'storybook/internal/theming'; import { Link } from '../typography/link/link'; diff --git a/code/core/src/components/components/tooltip/TooltipNote.tsx b/code/core/src/components/components/tooltip/TooltipNote.tsx index 6bfde56693d6..a605040ba5bf 100644 --- a/code/core/src/components/components/tooltip/TooltipNote.tsx +++ b/code/core/src/components/components/tooltip/TooltipNote.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import { styled } from '@storybook/core/theming'; +import { styled } from 'storybook/internal/theming'; const Note = styled.div(({ theme }) => ({ padding: '2px 6px', diff --git a/code/core/src/components/components/tooltip/WithTooltip.stories.tsx b/code/core/src/components/components/tooltip/WithTooltip.stories.tsx index e5651c50bf7e..952dceeaf510 100644 --- a/code/core/src/components/components/tooltip/WithTooltip.stories.tsx +++ b/code/core/src/components/components/tooltip/WithTooltip.stories.tsx @@ -1,7 +1,8 @@ import type { ComponentProps, FunctionComponent } from 'react'; import React from 'react'; -import { styled } from '@storybook/core/theming'; +import { styled } from 'storybook/internal/theming'; + import type { StoryObj } from '@storybook/react'; import { expect, screen } from '@storybook/test'; diff --git a/code/core/src/components/components/tooltip/WithTooltip.tsx b/code/core/src/components/components/tooltip/WithTooltip.tsx index c6bddae93795..304603367c23 100644 --- a/code/core/src/components/components/tooltip/WithTooltip.tsx +++ b/code/core/src/components/components/tooltip/WithTooltip.tsx @@ -2,7 +2,8 @@ import type { ComponentProps, ReactNode } from 'react'; import React, { useCallback, useEffect, useState } from 'react'; import ReactDOM from 'react-dom'; -import { styled } from '@storybook/core/theming'; +import { styled } from 'storybook/internal/theming'; + import { global } from '@storybook/global'; import type { PopperOptions, Config as ReactPopperTooltipConfig } from 'react-popper-tooltip'; diff --git a/code/core/src/components/components/typography/DocumentWrapper.tsx b/code/core/src/components/components/typography/DocumentWrapper.tsx index 8a3a8329d78b..81e65ad95344 100644 --- a/code/core/src/components/components/typography/DocumentWrapper.tsx +++ b/code/core/src/components/components/typography/DocumentWrapper.tsx @@ -1,4 +1,4 @@ -import { styled } from '@storybook/core/theming'; +import { styled } from 'storybook/internal/theming'; export const DocumentWrapper = styled.div(({ theme }) => ({ fontSize: `${theme.typography.size.s2}px`, diff --git a/code/core/src/components/components/typography/ResetWrapper.tsx b/code/core/src/components/components/typography/ResetWrapper.tsx index 652cb41754f1..c83edaf56483 100644 --- a/code/core/src/components/components/typography/ResetWrapper.tsx +++ b/code/core/src/components/components/typography/ResetWrapper.tsx @@ -1,4 +1,4 @@ -import { styled } from '@storybook/core/theming'; +import { styled } from 'storybook/internal/theming'; import { withReset } from './lib/common'; diff --git a/code/core/src/components/components/typography/elements/A.tsx b/code/core/src/components/components/typography/elements/A.tsx index 2eb9cdb4d87a..914b6ecbdbca 100644 --- a/code/core/src/components/components/typography/elements/A.tsx +++ b/code/core/src/components/components/typography/elements/A.tsx @@ -1,4 +1,4 @@ -import { styled } from '@storybook/core/theming'; +import { styled } from 'storybook/internal/theming'; import { withReset } from '../lib/common'; import { Link } from './Link'; diff --git a/code/core/src/components/components/typography/elements/Blockquote.tsx b/code/core/src/components/components/typography/elements/Blockquote.tsx index b4e06b210ed0..b430027a03db 100644 --- a/code/core/src/components/components/typography/elements/Blockquote.tsx +++ b/code/core/src/components/components/typography/elements/Blockquote.tsx @@ -1,4 +1,4 @@ -import { styled } from '@storybook/core/theming'; +import { styled } from 'storybook/internal/theming'; import { withMargin, withReset } from '../lib/common'; diff --git a/code/core/src/components/components/typography/elements/Code.tsx b/code/core/src/components/components/typography/elements/Code.tsx index e22b3cca9134..e8360dc8184d 100644 --- a/code/core/src/components/components/typography/elements/Code.tsx +++ b/code/core/src/components/components/typography/elements/Code.tsx @@ -1,7 +1,7 @@ import type { ComponentProps } from 'react'; import React, { Children } from 'react'; -import { styled } from '@storybook/core/theming'; +import { styled } from 'storybook/internal/theming'; import { SyntaxHighlighter } from '../../syntaxhighlighter/syntaxhighlighter'; import type { SupportedLanguage } from '../../syntaxhighlighter/syntaxhighlighter-types'; diff --git a/code/core/src/components/components/typography/elements/DL.tsx b/code/core/src/components/components/typography/elements/DL.tsx index 840dbc0bbede..7957323031ce 100644 --- a/code/core/src/components/components/typography/elements/DL.tsx +++ b/code/core/src/components/components/typography/elements/DL.tsx @@ -1,4 +1,4 @@ -import { styled } from '@storybook/core/theming'; +import { styled } from 'storybook/internal/theming'; import { withMargin, withReset } from '../lib/common'; diff --git a/code/core/src/components/components/typography/elements/Div.tsx b/code/core/src/components/components/typography/elements/Div.tsx index 7e8b9b6765d4..69f87f323f2b 100644 --- a/code/core/src/components/components/typography/elements/Div.tsx +++ b/code/core/src/components/components/typography/elements/Div.tsx @@ -1,4 +1,4 @@ -import { styled } from '@storybook/core/theming'; +import { styled } from 'storybook/internal/theming'; import { withReset } from '../lib/common'; diff --git a/code/core/src/components/components/typography/elements/H1.tsx b/code/core/src/components/components/typography/elements/H1.tsx index 6ede5882351d..b9bcd975b499 100644 --- a/code/core/src/components/components/typography/elements/H1.tsx +++ b/code/core/src/components/components/typography/elements/H1.tsx @@ -1,4 +1,4 @@ -import { styled } from '@storybook/core/theming'; +import { styled } from 'storybook/internal/theming'; import { headerCommon, withReset } from '../lib/common'; diff --git a/code/core/src/components/components/typography/elements/H2.tsx b/code/core/src/components/components/typography/elements/H2.tsx index f2c070827ede..8aff4b6410fb 100644 --- a/code/core/src/components/components/typography/elements/H2.tsx +++ b/code/core/src/components/components/typography/elements/H2.tsx @@ -1,4 +1,4 @@ -import { styled } from '@storybook/core/theming'; +import { styled } from 'storybook/internal/theming'; import { headerCommon, withReset } from '../lib/common'; diff --git a/code/core/src/components/components/typography/elements/H3.tsx b/code/core/src/components/components/typography/elements/H3.tsx index 150474aa427e..45caf5b602d9 100644 --- a/code/core/src/components/components/typography/elements/H3.tsx +++ b/code/core/src/components/components/typography/elements/H3.tsx @@ -1,4 +1,4 @@ -import { styled } from '@storybook/core/theming'; +import { styled } from 'storybook/internal/theming'; import { headerCommon, withReset } from '../lib/common'; diff --git a/code/core/src/components/components/typography/elements/H4.tsx b/code/core/src/components/components/typography/elements/H4.tsx index f0933727d8ca..89b9b47641d8 100644 --- a/code/core/src/components/components/typography/elements/H4.tsx +++ b/code/core/src/components/components/typography/elements/H4.tsx @@ -1,4 +1,4 @@ -import { styled } from '@storybook/core/theming'; +import { styled } from 'storybook/internal/theming'; import { headerCommon, withReset } from '../lib/common'; diff --git a/code/core/src/components/components/typography/elements/H5.tsx b/code/core/src/components/components/typography/elements/H5.tsx index 637b64cad8f2..349189c31112 100644 --- a/code/core/src/components/components/typography/elements/H5.tsx +++ b/code/core/src/components/components/typography/elements/H5.tsx @@ -1,4 +1,4 @@ -import { styled } from '@storybook/core/theming'; +import { styled } from 'storybook/internal/theming'; import { headerCommon, withReset } from '../lib/common'; diff --git a/code/core/src/components/components/typography/elements/H6.tsx b/code/core/src/components/components/typography/elements/H6.tsx index b862026ede75..41df58909ae3 100644 --- a/code/core/src/components/components/typography/elements/H6.tsx +++ b/code/core/src/components/components/typography/elements/H6.tsx @@ -1,4 +1,4 @@ -import { styled } from '@storybook/core/theming'; +import { styled } from 'storybook/internal/theming'; import { headerCommon, withReset } from '../lib/common'; diff --git a/code/core/src/components/components/typography/elements/HR.tsx b/code/core/src/components/components/typography/elements/HR.tsx index c5f054a36ec7..ac80ed84c437 100644 --- a/code/core/src/components/components/typography/elements/HR.tsx +++ b/code/core/src/components/components/typography/elements/HR.tsx @@ -1,4 +1,4 @@ -import { styled } from '@storybook/core/theming'; +import { styled } from 'storybook/internal/theming'; export const HR = styled.hr(({ theme }) => ({ border: '0 none', diff --git a/code/core/src/components/components/typography/elements/Img.tsx b/code/core/src/components/components/typography/elements/Img.tsx index ccd1cf1eb8e6..6dcd8e7d622f 100644 --- a/code/core/src/components/components/typography/elements/Img.tsx +++ b/code/core/src/components/components/typography/elements/Img.tsx @@ -1,4 +1,4 @@ -import { styled } from '@storybook/core/theming'; +import { styled } from 'storybook/internal/theming'; export const Img = styled.img({ maxWidth: '100%', diff --git a/code/core/src/components/components/typography/elements/LI.tsx b/code/core/src/components/components/typography/elements/LI.tsx index 9361defda4e3..58fac5d874c6 100644 --- a/code/core/src/components/components/typography/elements/LI.tsx +++ b/code/core/src/components/components/typography/elements/LI.tsx @@ -1,5 +1,5 @@ -import type { CSSObject } from '@storybook/core/theming'; -import { styled } from '@storybook/core/theming'; +import type { CSSObject } from 'storybook/internal/theming'; +import { styled } from 'storybook/internal/theming'; import { codeCommon, withReset } from '../lib/common'; diff --git a/code/core/src/components/components/typography/elements/OL.tsx b/code/core/src/components/components/typography/elements/OL.tsx index dd6c328c72ba..251006eca977 100644 --- a/code/core/src/components/components/typography/elements/OL.tsx +++ b/code/core/src/components/components/typography/elements/OL.tsx @@ -1,5 +1,5 @@ -import { styled } from '@storybook/core/theming'; -import type { Interpolation } from '@storybook/core/theming'; +import type { Interpolation } from 'storybook/internal/theming'; +import { styled } from 'storybook/internal/theming'; import { withMargin, withReset } from '../lib/common'; diff --git a/code/core/src/components/components/typography/elements/P.tsx b/code/core/src/components/components/typography/elements/P.tsx index 3039d8592270..a390fcbc9228 100644 --- a/code/core/src/components/components/typography/elements/P.tsx +++ b/code/core/src/components/components/typography/elements/P.tsx @@ -1,5 +1,5 @@ -import type { CSSObject } from '@storybook/core/theming'; -import { styled } from '@storybook/core/theming'; +import type { CSSObject } from 'storybook/internal/theming'; +import { styled } from 'storybook/internal/theming'; import { codeCommon, withMargin, withReset } from '../lib/common'; diff --git a/code/core/src/components/components/typography/elements/Pre.tsx b/code/core/src/components/components/typography/elements/Pre.tsx index d2c3a1258cc4..cc10e8c8cd67 100644 --- a/code/core/src/components/components/typography/elements/Pre.tsx +++ b/code/core/src/components/components/typography/elements/Pre.tsx @@ -1,4 +1,4 @@ -import { styled } from '@storybook/core/theming'; +import { styled } from 'storybook/internal/theming'; import { withMargin, withReset } from '../lib/common'; diff --git a/code/core/src/components/components/typography/elements/Span.tsx b/code/core/src/components/components/typography/elements/Span.tsx index 35d9e45bd609..4e81d8a65c53 100644 --- a/code/core/src/components/components/typography/elements/Span.tsx +++ b/code/core/src/components/components/typography/elements/Span.tsx @@ -1,4 +1,4 @@ -import { styled } from '@storybook/core/theming'; +import { styled } from 'storybook/internal/theming'; import { withReset } from '../lib/common'; diff --git a/code/core/src/components/components/typography/elements/TT.tsx b/code/core/src/components/components/typography/elements/TT.tsx index 4544a0b6ded1..9ed77bbc157e 100644 --- a/code/core/src/components/components/typography/elements/TT.tsx +++ b/code/core/src/components/components/typography/elements/TT.tsx @@ -1,4 +1,4 @@ -import { styled } from '@storybook/core/theming'; +import { styled } from 'storybook/internal/theming'; import { codeCommon } from '../lib/common'; diff --git a/code/core/src/components/components/typography/elements/Table.tsx b/code/core/src/components/components/typography/elements/Table.tsx index 262adddd3f36..125890817cc3 100644 --- a/code/core/src/components/components/typography/elements/Table.tsx +++ b/code/core/src/components/components/typography/elements/Table.tsx @@ -1,4 +1,4 @@ -import { styled } from '@storybook/core/theming'; +import { styled } from 'storybook/internal/theming'; import { withMargin, withReset } from '../lib/common'; diff --git a/code/core/src/components/components/typography/elements/UL.tsx b/code/core/src/components/components/typography/elements/UL.tsx index 1aeb5b10bb66..1eeb32cfb25f 100644 --- a/code/core/src/components/components/typography/elements/UL.tsx +++ b/code/core/src/components/components/typography/elements/UL.tsx @@ -1,5 +1,5 @@ -import { styled } from '@storybook/core/theming'; -import type { Interpolation } from '@storybook/core/theming'; +import type { Interpolation } from 'storybook/internal/theming'; +import { styled } from 'storybook/internal/theming'; import { withMargin, withReset } from '../lib/common'; diff --git a/code/core/src/components/components/typography/lib/common.tsx b/code/core/src/components/components/typography/lib/common.tsx index fc0d32f128b1..d5ce3f625cb9 100644 --- a/code/core/src/components/components/typography/lib/common.tsx +++ b/code/core/src/components/components/typography/lib/common.tsx @@ -1,4 +1,4 @@ -import type { CSSObject, FunctionInterpolation } from '@storybook/core/theming'; +import type { CSSObject, FunctionInterpolation } from 'storybook/internal/theming'; import { transparentize } from 'polished'; diff --git a/code/core/src/components/components/typography/link/link.test.tsx b/code/core/src/components/components/typography/link/link.test.tsx index 5e0af1da2096..97e1317b111a 100644 --- a/code/core/src/components/components/typography/link/link.test.tsx +++ b/code/core/src/components/components/typography/link/link.test.tsx @@ -6,7 +6,7 @@ import { afterEach, describe, expect, it, vi } from 'vitest'; import type { AnchorHTMLAttributes } from 'react'; import React from 'react'; -import { ThemeProvider, convert, themes } from '@storybook/core/theming'; +import { ThemeProvider, convert, themes } from 'storybook/internal/theming'; import type { LinkProps } from './link'; import { Link } from './link'; diff --git a/code/core/src/components/components/typography/link/link.tsx b/code/core/src/components/components/typography/link/link.tsx index 2ce80ec9612e..02f94544dca9 100644 --- a/code/core/src/components/components/typography/link/link.tsx +++ b/code/core/src/components/components/typography/link/link.tsx @@ -1,7 +1,8 @@ import type { AnchorHTMLAttributes, MouseEvent } from 'react'; import React from 'react'; -import { styled } from '@storybook/core/theming'; +import { styled } from 'storybook/internal/theming'; + import { ChevronRightIcon } from '@storybook/icons'; import { darken } from 'polished'; diff --git a/code/core/src/core-events/data/testing-module.ts b/code/core/src/core-events/data/testing-module.ts index ad843450723b..52a14a0f032b 100644 --- a/code/core/src/core-events/data/testing-module.ts +++ b/code/core/src/core-events/data/testing-module.ts @@ -1,4 +1,4 @@ -import type { Addon_TestProviderState, Addon_TestProviderType } from '@storybook/core/types'; +import type { Addon_TestProviderState, Addon_TestProviderType } from 'storybook/internal/types'; type DateNow = number; diff --git a/code/core/src/core-server/build-dev.ts b/code/core/src/core-server/build-dev.ts index c8b336a22e09..ecedb1d62d80 100644 --- a/code/core/src/core-server/build-dev.ts +++ b/code/core/src/core-server/build-dev.ts @@ -11,13 +11,13 @@ import { serverResolve, validateFrameworkName, versions, -} from '@storybook/core/common'; -import { oneWayHash, telemetry } from '@storybook/core/telemetry'; -import type { BuilderOptions, CLIOptions, LoadOptions, Options } from '@storybook/core/types'; -import { global } from '@storybook/global'; +} from 'storybook/internal/common'; +import { deprecate } from 'storybook/internal/node-logger'; +import { MissingBuilderError, NoStatsForViteDevError } from 'storybook/internal/server-errors'; +import { oneWayHash, telemetry } from 'storybook/internal/telemetry'; +import type { BuilderOptions, CLIOptions, LoadOptions, Options } from 'storybook/internal/types'; -import { deprecate } from '@storybook/core/node-logger'; -import { MissingBuilderError, NoStatsForViteDevError } from '@storybook/core/server-errors'; +import { global } from '@storybook/global'; import prompts from 'prompts'; import invariant from 'tiny-invariant'; @@ -123,7 +123,7 @@ export async function buildDevStandalone( let presets = await loadAllPresets({ corePresets, overridePresets: [ - require.resolve('@storybook/core/core-server/presets/common-override-preset'), + require.resolve('storybook/internal/core-server/presets/common-override-preset'), ], ...options, isCritical: true, @@ -170,7 +170,7 @@ export async function buildDevStandalone( // Load second pass: all presets are applied in order presets = await loadAllPresets({ corePresets: [ - require.resolve('@storybook/core/core-server/presets/common-preset'), + require.resolve('storybook/internal/core-server/presets/common-preset'), ...(managerBuilder.corePresets || []), ...(previewBuilder.corePresets || []), ...(resolvedRenderer ? [resolvedRenderer] : []), @@ -178,7 +178,7 @@ export async function buildDevStandalone( ], overridePresets: [ ...(previewBuilder.overridePresets || []), - require.resolve('@storybook/core/core-server/presets/common-override-preset'), + require.resolve('storybook/internal/core-server/presets/common-override-preset'), ], ...options, }); diff --git a/code/core/src/core-server/build-static.ts b/code/core/src/core-server/build-static.ts index ab0d979acaf5..f8b90fa7fb55 100644 --- a/code/core/src/core-server/build-static.ts +++ b/code/core/src/core-server/build-static.ts @@ -9,12 +9,12 @@ import { logConfig, normalizeStories, resolveAddonName, -} from '@storybook/core/common'; -import { getPrecedingUpgrade, telemetry } from '@storybook/core/telemetry'; -import type { BuilderOptions, CLIOptions, LoadOptions, Options } from '@storybook/core/types'; -import { global } from '@storybook/global'; +} from 'storybook/internal/common'; +import { logger } from 'storybook/internal/node-logger'; +import { getPrecedingUpgrade, telemetry } from 'storybook/internal/telemetry'; +import type { BuilderOptions, CLIOptions, LoadOptions, Options } from 'storybook/internal/types'; -import { logger } from '@storybook/core/node-logger'; +import { global } from '@storybook/global'; import picocolors from 'picocolors'; @@ -64,11 +64,11 @@ export async function buildStaticStandalone(options: BuildStaticStandaloneOption logger.info('=> Loading presets'); let presets = await loadAllPresets({ corePresets: [ - require.resolve('@storybook/core/core-server/presets/common-preset'), + require.resolve('storybook/internal/core-server/presets/common-preset'), ...corePresets, ], overridePresets: [ - require.resolve('@storybook/core/core-server/presets/common-override-preset'), + require.resolve('storybook/internal/core-server/presets/common-override-preset'), ], isCritical: true, ...options, @@ -83,7 +83,7 @@ export async function buildStaticStandalone(options: BuildStaticStandaloneOption : undefined; presets = await loadAllPresets({ corePresets: [ - require.resolve('@storybook/core/core-server/presets/common-preset'), + require.resolve('storybook/internal/core-server/presets/common-preset'), ...(managerBuilder.corePresets || []), ...(previewBuilder.corePresets || []), ...(resolvedRenderer ? [resolvedRenderer] : []), @@ -91,7 +91,7 @@ export async function buildStaticStandalone(options: BuildStaticStandaloneOption ], overridePresets: [ ...(previewBuilder.overridePresets || []), - require.resolve('@storybook/core/core-server/presets/common-override-preset'), + require.resolve('storybook/internal/core-server/presets/common-override-preset'), ], ...options, build, @@ -128,7 +128,7 @@ export async function buildStaticStandalone(options: BuildStaticStandaloneOption } const coreServerPublicDir = join( - dirname(require.resolve('@storybook/core/package.json')), + dirname(require.resolve('storybook/package.json')), 'assets/browser' ); effects.push(cp(coreServerPublicDir, options.outputDir, { recursive: true })); diff --git a/code/core/src/core-server/dev-server.ts b/code/core/src/core-server/dev-server.ts index 325d33366514..ee6dfcaffe6a 100644 --- a/code/core/src/core-server/dev-server.ts +++ b/code/core/src/core-server/dev-server.ts @@ -1,8 +1,7 @@ -import { logConfig } from '@storybook/core/common'; -import type { Options } from '@storybook/core/types'; - -import { logger } from '@storybook/core/node-logger'; -import { MissingBuilderError } from '@storybook/core/server-errors'; +import { logConfig } from 'storybook/internal/common'; +import { logger } from 'storybook/internal/node-logger'; +import { MissingBuilderError } from 'storybook/internal/server-errors'; +import type { Options } from 'storybook/internal/types'; import compression from '@polka/compression'; import polka from 'polka'; diff --git a/code/core/src/core-server/index.ts b/code/core/src/core-server/index.ts index 5a74e0056c17..23c4a42ecc31 100644 --- a/code/core/src/core-server/index.ts +++ b/code/core/src/core-server/index.ts @@ -1,6 +1,6 @@ /// -export { getPreviewHeadTemplate, getPreviewBodyTemplate } from '@storybook/core/common'; +export { getPreviewHeadTemplate, getPreviewBodyTemplate } from 'storybook/internal/common'; export * from './build-static'; export * from './build-dev'; diff --git a/code/core/src/core-server/load.ts b/code/core/src/core-server/load.ts index cb03ceb5ca7a..a9c4321abe51 100644 --- a/code/core/src/core-server/load.ts +++ b/code/core/src/core-server/load.ts @@ -6,9 +6,10 @@ import { loadMainConfig, resolveAddonName, validateFrameworkName, -} from '@storybook/core/common'; -import { oneWayHash } from '@storybook/core/telemetry'; -import type { BuilderOptions, CLIOptions, LoadOptions, Options } from '@storybook/core/types'; +} from 'storybook/internal/common'; +import { oneWayHash } from 'storybook/internal/telemetry'; +import type { BuilderOptions, CLIOptions, LoadOptions, Options } from 'storybook/internal/types'; + import { global } from '@storybook/global'; export async function loadStorybook( @@ -49,7 +50,7 @@ export async function loadStorybook( let presets = await loadAllPresets({ corePresets, overridePresets: [ - require.resolve('@storybook/core/core-server/presets/common-override-preset'), + require.resolve('storybook/internal/core-server/presets/common-override-preset'), ], ...options, isCritical: true, @@ -62,12 +63,12 @@ export async function loadStorybook( presets = await loadAllPresets({ corePresets: [ - require.resolve('@storybook/core/core-server/presets/common-preset'), + require.resolve('storybook/internal/core-server/presets/common-preset'), ...(resolvedRenderer ? [resolvedRenderer] : []), ...corePresets, ], overridePresets: [ - require.resolve('@storybook/core/core-server/presets/common-override-preset'), + require.resolve('storybook/internal/core-server/presets/common-override-preset'), ], ...options, }); diff --git a/code/core/src/core-server/presets/common-manager.ts b/code/core/src/core-server/presets/common-manager.ts index 0bdf7cde0031..ef24236ebbbf 100644 --- a/code/core/src/core-server/presets/common-manager.ts +++ b/code/core/src/core-server/presets/common-manager.ts @@ -1,6 +1,6 @@ -import { global } from '@storybook/global'; +import { addons } from 'storybook/internal/manager-api'; -import { addons } from '@storybook/core/manager-api'; +import { global } from '@storybook/global'; const TAG_FILTERS = 'tag-filters'; const STATIC_FILTER = 'static-filter'; diff --git a/code/core/src/core-server/presets/common-override-preset.ts b/code/core/src/core-server/presets/common-override-preset.ts index 2566bee53593..4c2a1ec96ba7 100644 --- a/code/core/src/core-server/presets/common-override-preset.ts +++ b/code/core/src/core-server/presets/common-override-preset.ts @@ -1,4 +1,4 @@ -import type { PresetProperty, TestBuildFlags } from '@storybook/core/types'; +import type { PresetProperty, TestBuildFlags } from 'storybook/internal/types'; import { removeMDXEntries } from '../utils/remove-mdx-entries'; diff --git a/code/core/src/core-server/presets/common-preset.ts b/code/core/src/core-server/presets/common-preset.ts index 34b852cbb7bc..d1597a2e2a0b 100644 --- a/code/core/src/core-server/presets/common-preset.ts +++ b/code/core/src/core-server/presets/common-preset.ts @@ -2,15 +2,17 @@ import { existsSync } from 'node:fs'; import { readFile } from 'node:fs/promises'; import { dirname, isAbsolute, join } from 'node:path'; -import type { Channel } from '@storybook/core/channels'; +import type { Channel } from 'storybook/internal/channels'; import { getDirectoryFromWorkingDir, getPreviewBodyTemplate, getPreviewHeadTemplate, loadEnvs, removeAddon as removeAddonBase, -} from '@storybook/core/common'; -import { telemetry } from '@storybook/core/telemetry'; +} from 'storybook/internal/common'; +import { readCsf } from 'storybook/internal/csf-tools'; +import { logger } from 'storybook/internal/node-logger'; +import { telemetry } from 'storybook/internal/telemetry'; import type { CLIOptions, CoreConfig, @@ -18,10 +20,7 @@ import type { Options, PresetProperty, PresetPropertyFn, -} from '@storybook/core/types'; - -import { readCsf } from '@storybook/core/csf-tools'; -import { logger } from '@storybook/core/node-logger'; +} from 'storybook/internal/types'; import { dedent } from 'ts-dedent'; @@ -45,7 +44,7 @@ const interpolate = (string: string, data: Record = {}) => Object.entries(data).reduce((acc, [k, v]) => acc.replace(new RegExp(`%${k}%`, 'g'), v), string); const defaultFavicon = join( - dirname(require.resolve('@storybook/core/package.json')), + dirname(require.resolve('storybook/package.json')), '/assets/browser/favicon.svg' ); @@ -372,7 +371,7 @@ export const tags = async (existing: any) => { export const managerEntries = async (existing: any, options: Options) => { return [ join( - dirname(require.resolve('@storybook/core/package.json')), + dirname(require.resolve('storybook/package.json')), 'dist/core-server/presets/common-manager.js' ), ...(existing || []), diff --git a/code/core/src/core-server/presets/favicon.test.ts b/code/core/src/core-server/presets/favicon.test.ts index 4e6c72cc0618..d98fef009537 100644 --- a/code/core/src/core-server/presets/favicon.test.ts +++ b/code/core/src/core-server/presets/favicon.test.ts @@ -3,12 +3,12 @@ import { dirname, join } from 'node:path'; import { expect, it, vi } from 'vitest'; -import { logger } from '@storybook/core/node-logger'; +import { logger } from 'storybook/internal/node-logger'; import * as m from './common-preset'; const defaultFavicon = join( - dirname(require.resolve('@storybook/core/package.json')), + dirname(require.resolve('storybook/package.json')), '/assets/browser/favicon.svg' ); @@ -29,7 +29,7 @@ const createOptions = (locations: string[]): Parameters[1] => }, }); -vi.mock('@storybook/core/node-logger', () => { +vi.mock('storybook/internal/node-logger', () => { return { logger: { warn: vi.fn(() => {}), diff --git a/code/core/src/core-server/server-channel/create-new-story-channel.test.ts b/code/core/src/core-server/server-channel/create-new-story-channel.test.ts index 23fa28dbc870..ac94659f27a8 100644 --- a/code/core/src/core-server/server-channel/create-new-story-channel.test.ts +++ b/code/core/src/core-server/server-channel/create-new-story-channel.test.ts @@ -2,19 +2,18 @@ import { join } from 'node:path'; import { beforeEach, describe, expect, it, vi } from 'vitest'; -import type { ChannelTransport } from '@storybook/core/channels'; -import { Channel } from '@storybook/core/channels'; - -import type { CreateNewStoryRequestPayload, RequestData } from '@storybook/core/core-events'; +import type { ChannelTransport } from 'storybook/internal/channels'; +import { Channel } from 'storybook/internal/channels'; +import type { CreateNewStoryRequestPayload, RequestData } from 'storybook/internal/core-events'; import { CREATE_NEW_STORYFILE_REQUEST, CREATE_NEW_STORYFILE_RESPONSE, -} from '@storybook/core/core-events'; +} from 'storybook/internal/core-events'; import { initCreateNewStoryChannel } from './create-new-story-channel'; -vi.mock('@storybook/core/common', async (importOriginal) => { - const actual = await importOriginal(); +vi.mock('storybook/internal/common', async (importOriginal) => { + const actual = await importOriginal(); return { ...actual, getProjectRoot: vi.fn().mockReturnValue(process.cwd()), diff --git a/code/core/src/core-server/server-channel/create-new-story-channel.ts b/code/core/src/core-server/server-channel/create-new-story-channel.ts index a1e3b77239d0..92179ff92a90 100644 --- a/code/core/src/core-server/server-channel/create-new-story-channel.ts +++ b/code/core/src/core-server/server-channel/create-new-story-channel.ts @@ -2,22 +2,21 @@ import { existsSync } from 'node:fs'; import { writeFile } from 'node:fs/promises'; import { relative } from 'node:path'; -import type { Channel } from '@storybook/core/channels'; -import { getStoryId } from '@storybook/core/common'; -import { telemetry } from '@storybook/core/telemetry'; -import type { CoreConfig, Options } from '@storybook/core/types'; - +import type { Channel } from 'storybook/internal/channels'; +import { getStoryId } from 'storybook/internal/common'; import type { CreateNewStoryErrorPayload, CreateNewStoryRequestPayload, CreateNewStoryResponsePayload, RequestData, ResponseData, -} from '@storybook/core/core-events'; +} from 'storybook/internal/core-events'; import { CREATE_NEW_STORYFILE_REQUEST, CREATE_NEW_STORYFILE_RESPONSE, -} from '@storybook/core/core-events'; +} from 'storybook/internal/core-events'; +import { telemetry } from 'storybook/internal/telemetry'; +import type { CoreConfig, Options } from 'storybook/internal/types'; import { getNewStoryFile } from '../utils/get-new-story-file'; diff --git a/code/core/src/core-server/server-channel/file-search-channel.test.ts b/code/core/src/core-server/server-channel/file-search-channel.test.ts index 64728b142e88..1a8c24697bea 100644 --- a/code/core/src/core-server/server-channel/file-search-channel.test.ts +++ b/code/core/src/core-server/server-channel/file-search-channel.test.ts @@ -1,19 +1,21 @@ // @vitest-environment happy-dom import { beforeEach, describe, expect, it, vi } from 'vitest'; -import type { ChannelTransport } from '@storybook/core/channels'; -import { Channel } from '@storybook/core/channels'; +import { Channel } from 'storybook/internal/channels'; +import type { ChannelTransport } from 'storybook/internal/channels'; import { extractProperRendererNameFromFramework, getFrameworkName, getProjectRoot, -} from '@storybook/core/common'; - -import type { FileComponentSearchRequestPayload, RequestData } from '@storybook/core/core-events'; +} from 'storybook/internal/common'; +import type { + FileComponentSearchRequestPayload, + RequestData, +} from 'storybook/internal/core-events'; import { FILE_COMPONENT_SEARCH_REQUEST, FILE_COMPONENT_SEARCH_RESPONSE, -} from '@storybook/core/core-events'; +} from 'storybook/internal/core-events'; import { searchFiles } from '../utils/search-files'; import { initFileSearchChannel } from './file-search-channel'; @@ -22,7 +24,7 @@ vi.mock(import('../utils/search-files'), async (importOriginal) => ({ searchFiles: vi.fn((await importOriginal()).searchFiles), })); -vi.mock('@storybook/core/common'); +vi.mock('storybook/internal/common'); beforeEach(() => { vi.restoreAllMocks(); diff --git a/code/core/src/core-server/server-channel/file-search-channel.ts b/code/core/src/core-server/server-channel/file-search-channel.ts index d9e67ed1804e..5343dcb387e1 100644 --- a/code/core/src/core-server/server-channel/file-search-channel.ts +++ b/code/core/src/core-server/server-channel/file-search-channel.ts @@ -1,25 +1,24 @@ import { readFile } from 'node:fs/promises'; import { dirname, join } from 'node:path'; -import type { Channel } from '@storybook/core/channels'; +import type { Channel } from 'storybook/internal/channels'; import { extractProperRendererNameFromFramework, getFrameworkName, getProjectRoot, -} from '@storybook/core/common'; -import { telemetry } from '@storybook/core/telemetry'; -import type { CoreConfig, Options, SupportedRenderers } from '@storybook/core/types'; - +} from 'storybook/internal/common'; import type { FileComponentSearchRequestPayload, FileComponentSearchResponsePayload, RequestData, ResponseData, -} from '@storybook/core/core-events'; +} from 'storybook/internal/core-events'; import { FILE_COMPONENT_SEARCH_REQUEST, FILE_COMPONENT_SEARCH_RESPONSE, -} from '@storybook/core/core-events'; +} from 'storybook/internal/core-events'; +import { telemetry } from 'storybook/internal/telemetry'; +import type { CoreConfig, Options, SupportedRenderers } from 'storybook/internal/types'; import { doesStoryFileExist, getStoryMetadata } from '../utils/get-new-story-file'; import { getParser } from '../utils/parser'; diff --git a/code/core/src/core-server/standalone.ts b/code/core/src/core-server/standalone.ts index d79463578146..ad5b641d46fa 100644 --- a/code/core/src/core-server/standalone.ts +++ b/code/core/src/core-server/standalone.ts @@ -5,7 +5,7 @@ import { buildStaticStandalone } from './build-static'; async function build(options: any = {}, frameworkOptions: any = {}) { const { mode = 'dev' } = options; - const packageJsonDir = dirname(require.resolve('@storybook/core/package.json')); + const packageJsonDir = dirname(require.resolve('storybook/package.json')); const packageJson = JSON.parse(require('fs').readFileSync(`${packageJsonDir}/package.json`)); const commonOptions = { diff --git a/code/core/src/core-server/typings.d.ts b/code/core/src/core-server/typings.d.ts index 1dfb2f3e1917..3f3cb6881312 100644 --- a/code/core/src/core-server/typings.d.ts +++ b/code/core/src/core-server/typings.d.ts @@ -6,5 +6,5 @@ declare module '@aw-web-design/x-default-browser'; declare module '@discoveryjs/json-ext'; declare module 'watchpack'; -declare var FEATURES: import('@storybook/core/types').StorybookConfigRaw['features']; -declare var TAGS_OPTIONS: import('@storybook/core/types').TagsOptions; +declare var FEATURES: import('storybook/internal/types').StorybookConfigRaw['features']; +declare var TAGS_OPTIONS: import('storybook/internal/types').TagsOptions; diff --git a/code/core/src/core-server/utils/StoryIndexGenerator.test.ts b/code/core/src/core-server/utils/StoryIndexGenerator.test.ts index f199c05cfe7f..c1277bf794f2 100644 --- a/code/core/src/core-server/utils/StoryIndexGenerator.test.ts +++ b/code/core/src/core-server/utils/StoryIndexGenerator.test.ts @@ -3,12 +3,12 @@ import { join } from 'node:path'; import { beforeEach, describe, expect, it, vi } from 'vitest'; -import { normalizeStoriesEntry } from '@storybook/core/common'; -import type { NormalizedStoriesSpecifier, StoryIndexEntry } from '@storybook/core/types'; -import { toId } from '@storybook/csf'; +import { normalizeStoriesEntry } from 'storybook/internal/common'; +import { getStorySortParameter, readCsf } from 'storybook/internal/csf-tools'; +import { logger, once } from 'storybook/internal/node-logger'; +import type { NormalizedStoriesSpecifier, StoryIndexEntry } from 'storybook/internal/types'; -import { getStorySortParameter, readCsf } from '@storybook/core/csf-tools'; -import { logger, once } from '@storybook/core/node-logger'; +import { toId } from '@storybook/csf'; import { csfIndexer } from '../presets/common-preset'; import type { StoryIndexGeneratorOptions } from './StoryIndexGenerator'; @@ -22,11 +22,11 @@ vi.mock('@storybook/csf', async (importOriginal) => { }; }); -vi.mock('@storybook/core/node-logger'); +vi.mock('storybook/internal/node-logger'); const toIdMock = vi.mocked(toId); -vi.mock('@storybook/core/csf-tools', async (importOriginal) => { - const csfTools = await importOriginal(); +vi.mock('storybook/internal/csf-tools', async (importOriginal) => { + const csfTools = await importOriginal(); return { ...csfTools, readCsf: vi.fn(csfTools.readCsf), diff --git a/code/core/src/core-server/utils/StoryIndexGenerator.ts b/code/core/src/core-server/utils/StoryIndexGenerator.ts index 164613d7e4c2..4b0c69a05ae1 100644 --- a/code/core/src/core-server/utils/StoryIndexGenerator.ts +++ b/code/core/src/core-server/utils/StoryIndexGenerator.ts @@ -3,7 +3,10 @@ import { existsSync } from 'node:fs'; import { readFile } from 'node:fs/promises'; import { dirname, extname, join, normalize, relative, resolve, sep } from 'node:path'; -import { commonGlobOptions, normalizeStoryPath } from '@storybook/core/common'; +import { commonGlobOptions, normalizeStoryPath } from 'storybook/internal/common'; +import { getStorySortParameter, loadConfig } from 'storybook/internal/csf-tools'; +import { logger, once } from 'storybook/internal/node-logger'; +import { sortStoriesV7, userOrAutoTitleFromSpecifier } from 'storybook/internal/preview-api'; import type { DocsIndexEntry, DocsOptions, @@ -16,12 +19,9 @@ import type { StoryIndexEntry, StorybookConfigRaw, Tag, -} from '@storybook/core/types'; -import { combineTags, storyNameFromExport, toId } from '@storybook/csf'; +} from 'storybook/internal/types'; -import { getStorySortParameter, loadConfig } from '@storybook/core/csf-tools'; -import { logger, once } from '@storybook/core/node-logger'; -import { sortStoriesV7, userOrAutoTitleFromSpecifier } from '@storybook/core/preview-api'; +import { combineTags, storyNameFromExport, toId } from '@storybook/csf'; import { findUp } from 'find-up'; import picocolors from 'picocolors'; diff --git a/code/core/src/core-server/utils/__tests__/index-extraction.test.ts b/code/core/src/core-server/utils/__tests__/index-extraction.test.ts index 8377cdb18e2d..a6c9dd01ba47 100644 --- a/code/core/src/core-server/utils/__tests__/index-extraction.test.ts +++ b/code/core/src/core-server/utils/__tests__/index-extraction.test.ts @@ -2,13 +2,13 @@ import { join } from 'node:path'; import { describe, expect, it, vi } from 'vitest'; -import { normalizeStoriesEntry } from '@storybook/core/common'; -import type { NormalizedStoriesSpecifier } from '@storybook/core/types'; +import { normalizeStoriesEntry } from 'storybook/internal/common'; +import type { NormalizedStoriesSpecifier } from 'storybook/internal/types'; import type { StoryIndexGeneratorOptions } from '../StoryIndexGenerator'; import { AUTODOCS_TAG, StoryIndexGenerator } from '../StoryIndexGenerator'; -vi.mock('@storybook/core/node-logger'); +vi.mock('storybook/internal/node-logger'); const options: StoryIndexGeneratorOptions = { configDir: join(__dirname, '..', '__mockdata__'), diff --git a/code/core/src/core-server/utils/__tests__/remove-mdx-stories.test.ts b/code/core/src/core-server/utils/__tests__/remove-mdx-stories.test.ts index 7aa3621c2893..3f8258f012f3 100644 --- a/code/core/src/core-server/utils/__tests__/remove-mdx-stories.test.ts +++ b/code/core/src/core-server/utils/__tests__/remove-mdx-stories.test.ts @@ -2,8 +2,8 @@ import { join } from 'node:path'; import { describe, expect, it, vi } from 'vitest'; -import { normalizeStoriesEntry } from '@storybook/core/common'; -import { type StoriesEntry } from '@storybook/core/types'; +import { normalizeStoriesEntry } from 'storybook/internal/common'; +import { type StoriesEntry } from 'storybook/internal/types'; // eslint-disable-next-line depend/ban-dependencies import { glob as globOriginal } from 'glob'; diff --git a/code/core/src/core-server/utils/__tests__/server-channel.test.ts b/code/core/src/core-server/utils/__tests__/server-channel.test.ts index c43955bd5886..a25571593f20 100644 --- a/code/core/src/core-server/utils/__tests__/server-channel.test.ts +++ b/code/core/src/core-server/utils/__tests__/server-channel.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it, vi } from 'vitest'; -import { Channel } from '@storybook/core/channels'; +import { Channel } from 'storybook/internal/channels'; import { EventEmitter } from 'events'; import type { Server } from 'http'; diff --git a/code/core/src/core-server/utils/autoName.ts b/code/core/src/core-server/utils/autoName.ts index 6256a3a76f32..b4cd26bb68a7 100644 --- a/code/core/src/core-server/utils/autoName.ts +++ b/code/core/src/core-server/utils/autoName.ts @@ -1,6 +1,6 @@ import { basename } from 'node:path'; -import type { Path } from '@storybook/core/types'; +import type { Path } from 'storybook/internal/types'; /** * Calculate a name to use for a docs entry if not specified. The rule is: diff --git a/code/core/src/core-server/utils/build-or-throw.ts b/code/core/src/core-server/utils/build-or-throw.ts index a2dade3725c3..288f80571418 100644 --- a/code/core/src/core-server/utils/build-or-throw.ts +++ b/code/core/src/core-server/utils/build-or-throw.ts @@ -1,4 +1,4 @@ -import { NoMatchingExportError } from '@storybook/core/server-errors'; +import { NoMatchingExportError } from 'storybook/internal/server-errors'; export async function buildOrThrow(callback: () => Promise): Promise { try { diff --git a/code/core/src/core-server/utils/constants.ts b/code/core/src/core-server/utils/constants.ts index 5363b78cdcb9..636c7b66495a 100644 --- a/code/core/src/core-server/utils/constants.ts +++ b/code/core/src/core-server/utils/constants.ts @@ -4,7 +4,7 @@ export const DEBOUNCE = 100; export const defaultStaticDirs = [ { - from: join(dirname(require.resolve('@storybook/core/package.json')), 'assets', 'browser'), + from: join(dirname(require.resolve('storybook/package.json')), 'assets', 'browser'), to: '/sb-common-assets', }, ]; diff --git a/code/core/src/core-server/utils/copy-all-static-files.ts b/code/core/src/core-server/utils/copy-all-static-files.ts index 2518fa82338c..699e284e4e3e 100644 --- a/code/core/src/core-server/utils/copy-all-static-files.ts +++ b/code/core/src/core-server/utils/copy-all-static-files.ts @@ -1,9 +1,8 @@ import { cp } from 'node:fs/promises'; import { join, relative } from 'node:path'; -import { getDirectoryFromWorkingDir } from '@storybook/core/common'; - -import { logger } from '@storybook/core/node-logger'; +import { getDirectoryFromWorkingDir } from 'storybook/internal/common'; +import { logger } from 'storybook/internal/node-logger'; import picocolors from 'picocolors'; diff --git a/code/core/src/core-server/utils/doTelemetry.ts b/code/core/src/core-server/utils/doTelemetry.ts index 0e9b48b8c8f5..607ed645c358 100644 --- a/code/core/src/core-server/utils/doTelemetry.ts +++ b/code/core/src/core-server/utils/doTelemetry.ts @@ -1,7 +1,7 @@ -import { getPrecedingUpgrade, telemetry } from '@storybook/core/telemetry'; -import type { CoreConfig, Options } from '@storybook/core/types'; +import { getPrecedingUpgrade, telemetry } from 'storybook/internal/telemetry'; +import type { CoreConfig, Options } from 'storybook/internal/types'; -import type Polka from 'polka'; +import type { Polka } from 'polka'; import invariant from 'tiny-invariant'; import { sendTelemetryError } from '../withTelemetry'; @@ -11,7 +11,7 @@ import { summarizeIndex } from './summarizeIndex'; import { versionStatus } from './versionStatus'; export async function doTelemetry( - app: Polka.Polka, + app: Polka, core: CoreConfig, initializedStoryIndexGenerator: Promise, options: Options diff --git a/code/core/src/core-server/utils/get-builders.ts b/code/core/src/core-server/utils/get-builders.ts index 5b654a14c955..6ffe6250e72b 100644 --- a/code/core/src/core-server/utils/get-builders.ts +++ b/code/core/src/core-server/utils/get-builders.ts @@ -1,11 +1,10 @@ import { pathToFileURL } from 'node:url'; -import type { Builder, Options } from '@storybook/core/types'; - -import { MissingBuilderError } from '@storybook/core/server-errors'; +import { MissingBuilderError } from 'storybook/internal/server-errors'; +import type { Builder, Options } from 'storybook/internal/types'; export async function getManagerBuilder(): Promise> { - return import('@storybook/core/builder-manager'); + return import('storybook/internal/builder-manager'); } export async function getPreviewBuilder( diff --git a/code/core/src/core-server/utils/get-new-story-file.test.ts b/code/core/src/core-server/utils/get-new-story-file.test.ts index 6144927e478e..be2265f329da 100644 --- a/code/core/src/core-server/utils/get-new-story-file.test.ts +++ b/code/core/src/core-server/utils/get-new-story-file.test.ts @@ -4,8 +4,8 @@ import { describe, expect, it, vi } from 'vitest'; import { getNewStoryFile } from './get-new-story-file'; -vi.mock('@storybook/core/common', async (importOriginal) => { - const actual = await importOriginal(); +vi.mock('storybook/internal/common', async (importOriginal) => { + const actual = await importOriginal(); return { ...actual, getProjectRoot: vi.fn().mockReturnValue(require('path').join(__dirname)), diff --git a/code/core/src/core-server/utils/get-new-story-file.ts b/code/core/src/core-server/utils/get-new-story-file.ts index 570ab8aecf7e..593997a291f2 100644 --- a/code/core/src/core-server/utils/get-new-story-file.ts +++ b/code/core/src/core-server/utils/get-new-story-file.ts @@ -6,10 +6,9 @@ import { getFrameworkName, getProjectRoot, rendererPackages, -} from '@storybook/core/common'; -import type { Options } from '@storybook/core/types'; - -import type { CreateNewStoryRequestPayload } from '@storybook/core/core-events'; +} from 'storybook/internal/common'; +import type { CreateNewStoryRequestPayload } from 'storybook/internal/core-events'; +import type { Options } from 'storybook/internal/types'; import { getJavaScriptTemplateForNewStoryFile } from './new-story-templates/javascript'; import { getTypeScriptTemplateForNewStoryFile } from './new-story-templates/typescript'; diff --git a/code/core/src/core-server/utils/get-server-channel.ts b/code/core/src/core-server/utils/get-server-channel.ts index b7f86328292b..e1e4705000e2 100644 --- a/code/core/src/core-server/utils/get-server-channel.ts +++ b/code/core/src/core-server/utils/get-server-channel.ts @@ -1,5 +1,5 @@ -import type { ChannelHandler } from '@storybook/core/channels'; -import { Channel } from '@storybook/core/channels'; +import type { ChannelHandler } from 'storybook/internal/channels'; +import { Channel } from 'storybook/internal/channels'; import { isJSON, parse, stringify } from 'telejson'; import WebSocket, { WebSocketServer } from 'ws'; diff --git a/code/core/src/core-server/utils/getStoryIndexGenerator.ts b/code/core/src/core-server/utils/getStoryIndexGenerator.ts index d91373d825cf..9b8dcfbb49f7 100644 --- a/code/core/src/core-server/utils/getStoryIndexGenerator.ts +++ b/code/core/src/core-server/utils/getStoryIndexGenerator.ts @@ -1,14 +1,14 @@ -import { normalizeStories } from '@storybook/core/common'; -import type { DocsOptions, Options } from '@storybook/core/types'; +import { normalizeStories } from 'storybook/internal/common'; +import type { DocsOptions, Options } from 'storybook/internal/types'; -import type Polka from 'polka'; +import type { Polka } from 'polka'; import { StoryIndexGenerator } from './StoryIndexGenerator'; import type { ServerChannel } from './get-server-channel'; import { useStoriesJson } from './stories-json'; export async function getStoryIndexGenerator( - app: Polka.Polka, + app: Polka, options: Options, serverChannel: ServerChannel ): Promise { diff --git a/code/core/src/core-server/utils/metadata.ts b/code/core/src/core-server/utils/metadata.ts index a9a2ebb337ba..c050020220fa 100644 --- a/code/core/src/core-server/utils/metadata.ts +++ b/code/core/src/core-server/utils/metadata.ts @@ -1,8 +1,8 @@ import { writeFile } from 'node:fs/promises'; -import { getStorybookMetadata } from '@storybook/core/telemetry'; +import { getStorybookMetadata } from 'storybook/internal/telemetry'; -import type Polka from 'polka'; +import type { Polka } from 'polka'; export async function extractStorybookMetadata(outputFile: string, configDir: string) { const storybookMetadata = await getStorybookMetadata(configDir); @@ -10,7 +10,7 @@ export async function extractStorybookMetadata(outputFile: string, configDir: st await writeFile(outputFile, JSON.stringify(storybookMetadata)); } -export function useStorybookMetadata(app: Polka.Polka, configDir?: string) { +export function useStorybookMetadata(app: Polka, configDir?: string) { app.use('/project.json', async (req, res) => { const storybookMetadata = await getStorybookMetadata(configDir); res.setHeader('Content-Type', 'application/json'); diff --git a/code/core/src/core-server/utils/open-in-browser.ts b/code/core/src/core-server/utils/open-in-browser.ts index aa5f745b8ce6..2a8789171f49 100644 --- a/code/core/src/core-server/utils/open-in-browser.ts +++ b/code/core/src/core-server/utils/open-in-browser.ts @@ -1,4 +1,4 @@ -import { logger } from '@storybook/core/node-logger'; +import { logger } from 'storybook/internal/node-logger'; import getDefaultBrowser from '@aw-web-design/x-default-browser'; import betterOpn from 'better-opn'; diff --git a/code/core/src/core-server/utils/output-startup-information.ts b/code/core/src/core-server/utils/output-startup-information.ts index 411e3e80be46..8d8973a0d247 100644 --- a/code/core/src/core-server/utils/output-startup-information.ts +++ b/code/core/src/core-server/utils/output-startup-information.ts @@ -1,6 +1,5 @@ -import type { VersionCheck } from '@storybook/core/types'; - -import { colors } from '@storybook/core/node-logger'; +import { colors } from 'storybook/internal/node-logger'; +import type { VersionCheck } from 'storybook/internal/types'; import boxen from 'boxen'; import Table from 'cli-table3'; diff --git a/code/core/src/core-server/utils/output-stats.ts b/code/core/src/core-server/utils/output-stats.ts index 24c736147f1e..a852c2766e0c 100644 --- a/code/core/src/core-server/utils/output-stats.ts +++ b/code/core/src/core-server/utils/output-stats.ts @@ -1,9 +1,8 @@ import { createWriteStream } from 'node:fs'; import { join } from 'node:path'; -import type { Stats } from '@storybook/core/types'; - -import { logger } from '@storybook/core/node-logger'; +import { logger } from 'storybook/internal/node-logger'; +import type { Stats } from 'storybook/internal/types'; import { stringifyStream } from '@discoveryjs/json-ext'; import picocolors from 'picocolors'; diff --git a/code/core/src/core-server/utils/parser/generic-parser.ts b/code/core/src/core-server/utils/parser/generic-parser.ts index b4229b726636..4b28fdbbb56d 100644 --- a/code/core/src/core-server/utils/parser/generic-parser.ts +++ b/code/core/src/core-server/utils/parser/generic-parser.ts @@ -1,4 +1,4 @@ -import { parser, types as t } from '@storybook/core/babel'; +import { parser, types as t } from 'storybook/internal/babel'; import type { Parser, ParserResult } from './types'; diff --git a/code/core/src/core-server/utils/parser/index.ts b/code/core/src/core-server/utils/parser/index.ts index 384811650086..61feeb8790e3 100644 --- a/code/core/src/core-server/utils/parser/index.ts +++ b/code/core/src/core-server/utils/parser/index.ts @@ -1,4 +1,4 @@ -import type { SupportedRenderers } from '@storybook/core/types'; +import type { SupportedRenderers } from 'storybook/internal/types'; import { GenericParser } from './generic-parser'; import type { Parser } from './types'; diff --git a/code/core/src/core-server/utils/remove-mdx-entries.ts b/code/core/src/core-server/utils/remove-mdx-entries.ts index da431155016a..9d2237bf98ae 100644 --- a/code/core/src/core-server/utils/remove-mdx-entries.ts +++ b/code/core/src/core-server/utils/remove-mdx-entries.ts @@ -1,7 +1,7 @@ import { isAbsolute, join, relative } from 'node:path'; -import { commonGlobOptions, normalizeStories } from '@storybook/core/common'; -import type { Options, StoriesEntry } from '@storybook/core/types'; +import { commonGlobOptions, normalizeStories } from 'storybook/internal/common'; +import type { Options, StoriesEntry } from 'storybook/internal/types'; // eslint-disable-next-line depend/ban-dependencies import { glob } from 'glob'; diff --git a/code/core/src/core-server/utils/save-story/duplicate-story-with-new-name.test.ts b/code/core/src/core-server/utils/save-story/duplicate-story-with-new-name.test.ts index 549c74337ca9..e145c7638208 100644 --- a/code/core/src/core-server/utils/save-story/duplicate-story-with-new-name.test.ts +++ b/code/core/src/core-server/utils/save-story/duplicate-story-with-new-name.test.ts @@ -4,7 +4,7 @@ import { join } from 'node:path'; import { describe, expect, test } from 'vitest'; -import { printCsf, readCsf } from '@storybook/core/csf-tools'; +import { printCsf, readCsf } from 'storybook/internal/csf-tools'; import { format } from 'prettier'; diff --git a/code/core/src/core-server/utils/save-story/duplicate-story-with-new-name.ts b/code/core/src/core-server/utils/save-story/duplicate-story-with-new-name.ts index fe85e2cb6aa0..f6f415481d3a 100644 --- a/code/core/src/core-server/utils/save-story/duplicate-story-with-new-name.ts +++ b/code/core/src/core-server/utils/save-story/duplicate-story-with-new-name.ts @@ -1,7 +1,6 @@ /* eslint-disable no-underscore-dangle */ -import { types as t, traverse } from '@storybook/core/babel'; - -import type { CsfFile } from '@storybook/core/csf-tools'; +import { types as t, traverse } from 'storybook/internal/babel'; +import type { CsfFile } from 'storybook/internal/csf-tools'; import { SaveStoryError } from './utils'; diff --git a/code/core/src/core-server/utils/save-story/save-story.ts b/code/core/src/core-server/utils/save-story/save-story.ts index 9131107fdc0c..baefa376494d 100644 --- a/code/core/src/core-server/utils/save-story/save-story.ts +++ b/code/core/src/core-server/utils/save-story/save-story.ts @@ -2,25 +2,25 @@ import { writeFile } from 'node:fs/promises'; import { basename, join } from 'node:path'; -import type { Channel } from '@storybook/core/channels'; -import { formatFileContent } from '@storybook/core/common'; -import { isExampleStoryId, telemetry } from '@storybook/core/telemetry'; -import type { CoreConfig, Options } from '@storybook/core/types'; -import { storyNameFromExport, toId } from '@storybook/csf'; - +import type { Channel } from 'storybook/internal/channels'; +import { formatFileContent } from 'storybook/internal/common'; import type { RequestData, ResponseData, SaveStoryRequestPayload, SaveStoryResponsePayload, -} from '@storybook/core/core-events'; +} from 'storybook/internal/core-events'; import { SAVE_STORY_REQUEST, SAVE_STORY_RESPONSE, STORY_RENDERED, -} from '@storybook/core/core-events'; -import { printCsf, readCsf } from '@storybook/core/csf-tools'; -import { logger } from '@storybook/core/node-logger'; +} from 'storybook/internal/core-events'; +import { printCsf, readCsf } from 'storybook/internal/csf-tools'; +import { logger } from 'storybook/internal/node-logger'; +import { isExampleStoryId, telemetry } from 'storybook/internal/telemetry'; +import type { CoreConfig, Options } from 'storybook/internal/types'; + +import { storyNameFromExport, toId } from '@storybook/csf'; import { duplicateStoryWithNewName } from './duplicate-story-with-new-name'; import { updateArgsInCsfFile } from './update-args-in-csf-file'; diff --git a/code/core/src/core-server/utils/save-story/update-args-in-csf-file.test.ts b/code/core/src/core-server/utils/save-story/update-args-in-csf-file.test.ts index 43bc049fc58b..30426f2773ff 100644 --- a/code/core/src/core-server/utils/save-story/update-args-in-csf-file.test.ts +++ b/code/core/src/core-server/utils/save-story/update-args-in-csf-file.test.ts @@ -4,7 +4,7 @@ import { join } from 'node:path'; import { describe, expect, test } from 'vitest'; -import { printCsf, readCsf } from '@storybook/core/csf-tools'; +import { printCsf, readCsf } from 'storybook/internal/csf-tools'; import { format } from 'prettier'; diff --git a/code/core/src/core-server/utils/save-story/update-args-in-csf-file.ts b/code/core/src/core-server/utils/save-story/update-args-in-csf-file.ts index 7e1f30e7e961..f6ecaed1a38c 100644 --- a/code/core/src/core-server/utils/save-story/update-args-in-csf-file.ts +++ b/code/core/src/core-server/utils/save-story/update-args-in-csf-file.ts @@ -1,4 +1,4 @@ -import { types as t, traverse } from '@storybook/core/babel'; +import { types as t, traverse } from 'storybook/internal/babel'; import { SaveStoryError } from './utils'; import { valueToAST } from './valueToAST'; diff --git a/code/core/src/core-server/utils/save-story/valueToAST.ts b/code/core/src/core-server/utils/save-story/valueToAST.ts index 48aa0952cb25..72fe823aad31 100644 --- a/code/core/src/core-server/utils/save-story/valueToAST.ts +++ b/code/core/src/core-server/utils/save-story/valueToAST.ts @@ -1,4 +1,4 @@ -import { parser, types as t } from '@storybook/core/babel'; +import { parser, types as t } from 'storybook/internal/babel'; export function valueToAST(literal: T): any { if (literal === null) { diff --git a/code/core/src/core-server/utils/server-address.test.ts b/code/core/src/core-server/utils/server-address.test.ts index a2c5475dc2e6..fa714b9e7bbb 100644 --- a/code/core/src/core-server/utils/server-address.test.ts +++ b/code/core/src/core-server/utils/server-address.test.ts @@ -8,7 +8,7 @@ vi.mock('node:os', () => ({ default: { release: () => '' }, })); vi.mock('detect-port'); -vi.mock('@storybook/core/node-logger'); +vi.mock('storybook/internal/node-logger'); describe('getServerAddresses', () => { const port = 3000; diff --git a/code/core/src/core-server/utils/server-address.ts b/code/core/src/core-server/utils/server-address.ts index 7bbc6970a9c2..89e826aa4804 100644 --- a/code/core/src/core-server/utils/server-address.ts +++ b/code/core/src/core-server/utils/server-address.ts @@ -1,6 +1,6 @@ import os from 'node:os'; -import { logger } from '@storybook/core/node-logger'; +import { logger } from 'storybook/internal/node-logger'; import detectFreePort from 'detect-port'; diff --git a/code/core/src/core-server/utils/server-init.ts b/code/core/src/core-server/utils/server-init.ts index d06c3421e7bc..6dc78f1422ef 100644 --- a/code/core/src/core-server/utils/server-init.ts +++ b/code/core/src/core-server/utils/server-init.ts @@ -1,6 +1,6 @@ import { readFile } from 'node:fs/promises'; -import { logger } from '@storybook/core/node-logger'; +import { logger } from 'storybook/internal/node-logger'; import http from 'http'; import https from 'https'; diff --git a/code/core/src/core-server/utils/server-statics.ts b/code/core/src/core-server/utils/server-statics.ts index 470d14ceb153..f665a1f160d9 100644 --- a/code/core/src/core-server/utils/server-statics.ts +++ b/code/core/src/core-server/utils/server-statics.ts @@ -1,17 +1,16 @@ import { existsSync } from 'node:fs'; import { basename, isAbsolute, posix, resolve, sep, win32 } from 'node:path'; -import { getDirectoryFromWorkingDir } from '@storybook/core/common'; -import type { Options, StorybookConfigRaw } from '@storybook/core/types'; - -import { logger } from '@storybook/core/node-logger'; +import { getDirectoryFromWorkingDir } from 'storybook/internal/common'; +import { logger } from 'storybook/internal/node-logger'; +import type { Options, StorybookConfigRaw } from 'storybook/internal/types'; import picocolors from 'picocolors'; -import type Polka from 'polka'; +import type { Polka } from 'polka'; import sirv from 'sirv'; import { dedent } from 'ts-dedent'; -export async function useStatics(app: Polka.Polka, options: Options): Promise { +export async function useStatics(app: Polka, options: Options): Promise { const staticDirs = (await options.presets.apply('staticDirs')) ?? []; const faviconPath = await options.presets.apply('favicon'); diff --git a/code/core/src/core-server/utils/stories-json.test.ts b/code/core/src/core-server/utils/stories-json.test.ts index 4868c149b724..f6265f922238 100644 --- a/code/core/src/core-server/utils/stories-json.test.ts +++ b/code/core/src/core-server/utils/stories-json.test.ts @@ -2,12 +2,11 @@ import { join } from 'node:path'; import { beforeEach, describe, expect, it, vi } from 'vitest'; -import { normalizeStoriesEntry } from '@storybook/core/common'; - -import { STORY_INDEX_INVALIDATED } from '@storybook/core/core-events'; +import { normalizeStoriesEntry } from 'storybook/internal/common'; +import { STORY_INDEX_INVALIDATED } from 'storybook/internal/core-events'; import { debounce } from 'es-toolkit/compat'; -import type Polka from 'polka'; +import type { Polka, Request, Response } from 'polka'; import Watchpack from 'watchpack'; import { csfIndexer } from '../presets/common-preset'; @@ -18,7 +17,7 @@ import { DEBOUNCE, useStoriesJson } from './stories-json'; vi.mock('watchpack'); vi.mock('es-toolkit/compat'); -vi.mock('@storybook/core/node-logger'); +vi.mock('storybook/internal/node-logger'); const workingDir = join(__dirname, '__mockdata__'); const normalizedStories = [ @@ -58,10 +57,10 @@ const getInitializedStoryIndexGenerator = async ( describe('useStoriesJson', () => { const use = vi.fn(); - const app: Polka.Polka = { use } as any; + const app: Polka = { use } as any; const end = vi.fn(); const write = vi.fn(); - const response: Polka.Response = { + const response: Response = { header: vi.fn(), send: vi.fn(), status: vi.fn(), @@ -81,7 +80,7 @@ describe('useStoriesJson', () => { Watchpack.mockClear(); }); - const request: Polka.Request = { + const request: Request = { headers: { accept: 'application/json' }, } as any; diff --git a/code/core/src/core-server/utils/stories-json.ts b/code/core/src/core-server/utils/stories-json.ts index a33e12eb0393..029e935f77f7 100644 --- a/code/core/src/core-server/utils/stories-json.ts +++ b/code/core/src/core-server/utils/stories-json.ts @@ -1,12 +1,11 @@ import { writeFile } from 'node:fs/promises'; import { basename } from 'node:path'; -import type { NormalizedStoriesSpecifier, StoryIndex } from '@storybook/core/types'; - -import { STORY_INDEX_INVALIDATED } from '@storybook/core/core-events'; +import { STORY_INDEX_INVALIDATED } from 'storybook/internal/core-events'; +import type { NormalizedStoriesSpecifier, StoryIndex } from 'storybook/internal/types'; import { debounce } from 'es-toolkit/compat'; -import type Polka from 'polka'; +import type { Polka } from 'polka'; import type { StoryIndexGenerator } from './StoryIndexGenerator'; import type { ServerChannel } from './get-server-channel'; @@ -33,7 +32,7 @@ export function useStoriesJson({ serverChannel, normalizedStories, }: { - app: Polka.Polka; + app: Polka; initializedStoryIndexGenerator: Promise; serverChannel: ServerChannel; workingDir?: string; diff --git a/code/core/src/core-server/utils/summarizeIndex.ts b/code/core/src/core-server/utils/summarizeIndex.ts index 92932939d476..9d880825e949 100644 --- a/code/core/src/core-server/utils/summarizeIndex.ts +++ b/code/core/src/core-server/utils/summarizeIndex.ts @@ -1,5 +1,5 @@ -import { isExampleStoryId } from '@storybook/core/telemetry'; -import type { IndexEntry, StoryIndex } from '@storybook/core/types'; +import { isExampleStoryId } from 'storybook/internal/telemetry'; +import type { IndexEntry, StoryIndex } from 'storybook/internal/types'; import { AUTODOCS_TAG, PLAY_FN_TAG, isMdxEntry } from './StoryIndexGenerator'; diff --git a/code/core/src/core-server/utils/summarizeStats.ts b/code/core/src/core-server/utils/summarizeStats.ts index 0120e7eac32a..ccad35146615 100644 --- a/code/core/src/core-server/utils/summarizeStats.ts +++ b/code/core/src/core-server/utils/summarizeStats.ts @@ -1,4 +1,4 @@ -import type { IndexInputStats } from '@storybook/core/types'; +import type { IndexInputStats } from 'storybook/internal/types'; export type IndexStatsSummary = Record; diff --git a/code/core/src/core-server/utils/update-check.ts b/code/core/src/core-server/utils/update-check.ts index efdd6ba95510..d96bca528681 100644 --- a/code/core/src/core-server/utils/update-check.ts +++ b/code/core/src/core-server/utils/update-check.ts @@ -1,7 +1,6 @@ -import { cache } from '@storybook/core/common'; -import type { VersionCheck } from '@storybook/core/types'; - -import { colors } from '@storybook/core/node-logger'; +import { cache } from 'storybook/internal/common'; +import { colors } from 'storybook/internal/node-logger'; +import type { VersionCheck } from 'storybook/internal/types'; import picocolors from 'picocolors'; import semver from 'semver'; diff --git a/code/core/src/core-server/utils/versionStatus.ts b/code/core/src/core-server/utils/versionStatus.ts index e351d50094e7..93c924b731c4 100644 --- a/code/core/src/core-server/utils/versionStatus.ts +++ b/code/core/src/core-server/utils/versionStatus.ts @@ -1,4 +1,4 @@ -import type { VersionCheck } from '@storybook/core/types'; +import type { VersionCheck } from 'storybook/internal/types'; export const versionStatus = (versionCheck: VersionCheck) => { if (versionCheck.error) { diff --git a/code/core/src/core-server/utils/warnOnIncompatibleAddons.ts b/code/core/src/core-server/utils/warnOnIncompatibleAddons.ts index aaf64313fd61..30b4fd064837 100644 --- a/code/core/src/core-server/utils/warnOnIncompatibleAddons.ts +++ b/code/core/src/core-server/utils/warnOnIncompatibleAddons.ts @@ -1,4 +1,4 @@ -import { logger } from '@storybook/core/node-logger'; +import { logger } from 'storybook/internal/node-logger'; import { getIncompatiblePackagesSummary, diff --git a/code/core/src/core-server/utils/warnWhenUsingArgTypesRegex.ts b/code/core/src/core-server/utils/warnWhenUsingArgTypesRegex.ts index ea28dbfc9c00..87d5d601dcd8 100644 --- a/code/core/src/core-server/utils/warnWhenUsingArgTypesRegex.ts +++ b/code/core/src/core-server/utils/warnWhenUsingArgTypesRegex.ts @@ -1,9 +1,8 @@ import { readFile } from 'node:fs/promises'; -import { type BabelFile, core } from '@storybook/core/babel'; -import type { StorybookConfig } from '@storybook/core/types'; - -import { babelParse } from '@storybook/core/csf-tools'; +import { type BabelFile, core } from 'storybook/internal/babel'; +import { babelParse } from 'storybook/internal/csf-tools'; +import type { StorybookConfig } from 'storybook/internal/types'; import picocolors from 'picocolors'; import { dedent } from 'ts-dedent'; diff --git a/code/core/src/core-server/utils/watch-story-specifiers.test.ts b/code/core/src/core-server/utils/watch-story-specifiers.test.ts index 9142af5aeb22..476db312e4cd 100644 --- a/code/core/src/core-server/utils/watch-story-specifiers.test.ts +++ b/code/core/src/core-server/utils/watch-story-specifiers.test.ts @@ -2,7 +2,7 @@ import { join } from 'node:path'; import { afterEach, describe, expect, it, vi } from 'vitest'; -import { normalizeStoriesEntry } from '@storybook/core/common'; +import { normalizeStoriesEntry } from 'storybook/internal/common'; import Watchpack from 'watchpack'; diff --git a/code/core/src/core-server/utils/watch-story-specifiers.ts b/code/core/src/core-server/utils/watch-story-specifiers.ts index 6fa8d3e83a6f..33c678767134 100644 --- a/code/core/src/core-server/utils/watch-story-specifiers.ts +++ b/code/core/src/core-server/utils/watch-story-specifiers.ts @@ -1,8 +1,8 @@ import { type Dirent, lstatSync, readdirSync } from 'node:fs'; import { basename, join, relative, resolve } from 'node:path'; -import { commonGlobOptions } from '@storybook/core/common'; -import type { NormalizedStoriesSpecifier, Path } from '@storybook/core/types'; +import { commonGlobOptions } from 'storybook/internal/common'; +import type { NormalizedStoriesSpecifier, Path } from 'storybook/internal/types'; import slash from 'slash'; import Watchpack from 'watchpack'; diff --git a/code/core/src/core-server/utils/watchConfig.ts b/code/core/src/core-server/utils/watchConfig.ts index 073d3bc6c2df..c3b993d04b1d 100644 --- a/code/core/src/core-server/utils/watchConfig.ts +++ b/code/core/src/core-server/utils/watchConfig.ts @@ -1,4 +1,4 @@ -import type { Path } from '@storybook/core/types'; +import type { Path } from 'storybook/internal/types'; import Watchpack from 'watchpack'; diff --git a/code/core/src/core-server/utils/whats-new.ts b/code/core/src/core-server/utils/whats-new.ts index 71c71984cb12..07ba73af330d 100644 --- a/code/core/src/core-server/utils/whats-new.ts +++ b/code/core/src/core-server/utils/whats-new.ts @@ -1,21 +1,20 @@ /* eslint-disable no-underscore-dangle */ import { writeFile } from 'node:fs/promises'; -import type { Channel } from '@storybook/core/channels'; -import { findConfigFile, loadMainConfig } from '@storybook/core/common'; -import { telemetry } from '@storybook/core/telemetry'; -import type { CoreConfig, Options } from '@storybook/core/types'; - -import type { WhatsNewCache, WhatsNewData } from '@storybook/core/core-events'; +import type { Channel } from 'storybook/internal/channels'; +import { findConfigFile, loadMainConfig } from 'storybook/internal/common'; +import type { WhatsNewCache, WhatsNewData } from 'storybook/internal/core-events'; import { REQUEST_WHATS_NEW_DATA, RESULT_WHATS_NEW_DATA, SET_WHATS_NEW_CACHE, TELEMETRY_ERROR, TOGGLE_WHATS_NEW_NOTIFICATIONS, -} from '@storybook/core/core-events'; -import { printConfig, readConfig } from '@storybook/core/csf-tools'; -import { logger } from '@storybook/core/node-logger'; +} from 'storybook/internal/core-events'; +import { printConfig, readConfig } from 'storybook/internal/csf-tools'; +import { logger } from 'storybook/internal/node-logger'; +import { telemetry } from 'storybook/internal/telemetry'; +import type { CoreConfig, Options } from 'storybook/internal/types'; import invariant from 'tiny-invariant'; diff --git a/code/core/src/core-server/withTelemetry.test.ts b/code/core/src/core-server/withTelemetry.test.ts index 6c0628ec4e1e..27843b3f73fa 100644 --- a/code/core/src/core-server/withTelemetry.test.ts +++ b/code/core/src/core-server/withTelemetry.test.ts @@ -1,15 +1,15 @@ import { beforeEach, describe, expect, it, vi } from 'vitest'; -import { cache, loadAllPresets } from '@storybook/core/common'; -import { oneWayHash, telemetry } from '@storybook/core/telemetry'; +import { cache, loadAllPresets } from 'storybook/internal/common'; +import { oneWayHash, telemetry } from 'storybook/internal/telemetry'; import prompts from 'prompts'; import { getErrorLevel, sendTelemetryError, withTelemetry } from './withTelemetry'; vi.mock('prompts'); -vi.mock('@storybook/core/common'); -vi.mock('@storybook/core/telemetry'); +vi.mock('storybook/internal/common'); +vi.mock('storybook/internal/telemetry'); const cliOptions = {}; diff --git a/code/core/src/core-server/withTelemetry.ts b/code/core/src/core-server/withTelemetry.ts index 93475fd71e9b..94ff561b611e 100644 --- a/code/core/src/core-server/withTelemetry.ts +++ b/code/core/src/core-server/withTelemetry.ts @@ -1,9 +1,8 @@ -import { cache, loadAllPresets } from '@storybook/core/common'; -import { getPrecedingUpgrade, oneWayHash, telemetry } from '@storybook/core/telemetry'; -import type { EventType } from '@storybook/core/telemetry'; -import type { CLIOptions } from '@storybook/core/types'; - -import { logger } from '@storybook/core/node-logger'; +import { cache, loadAllPresets } from 'storybook/internal/common'; +import { logger } from 'storybook/internal/node-logger'; +import { getPrecedingUpgrade, oneWayHash, telemetry } from 'storybook/internal/telemetry'; +import type { EventType } from 'storybook/internal/telemetry'; +import type { CLIOptions } from 'storybook/internal/types'; import prompts from 'prompts'; diff --git a/code/core/src/csf-tools/ConfigFile.test.ts b/code/core/src/csf-tools/ConfigFile.test.ts index e3409d5eb681..299231718f79 100644 --- a/code/core/src/csf-tools/ConfigFile.test.ts +++ b/code/core/src/csf-tools/ConfigFile.test.ts @@ -1,7 +1,7 @@ /* eslint-disable no-underscore-dangle */ import { describe, expect, it } from 'vitest'; -import { babelPrint } from '@storybook/core/babel'; +import { babelPrint } from 'storybook/internal/babel'; import { dedent } from 'ts-dedent'; diff --git a/code/core/src/csf-tools/ConfigFile.ts b/code/core/src/csf-tools/ConfigFile.ts index dc9f973d5ad6..18e6af57f7b4 100644 --- a/code/core/src/csf-tools/ConfigFile.ts +++ b/code/core/src/csf-tools/ConfigFile.ts @@ -8,7 +8,7 @@ import { recast, types as t, traverse, -} from '@storybook/core/babel'; +} from 'storybook/internal/babel'; import { dedent } from 'ts-dedent'; diff --git a/code/core/src/csf-tools/CsfFile.ts b/code/core/src/csf-tools/CsfFile.ts index b953395c9abc..5cb47a6732ba 100644 --- a/code/core/src/csf-tools/CsfFile.ts +++ b/code/core/src/csf-tools/CsfFile.ts @@ -10,7 +10,7 @@ import { recast, types as t, traverse, -} from '@storybook/core/babel'; +} from 'storybook/internal/babel'; import type { ComponentAnnotations, IndexInput, @@ -18,7 +18,8 @@ import type { IndexedCSFFile, StoryAnnotations, Tag, -} from '@storybook/core/types'; +} from 'storybook/internal/types'; + import { isExportStory, storyNameFromExport, toId } from '@storybook/csf'; import { dedent } from 'ts-dedent'; diff --git a/code/core/src/csf-tools/enrichCsf.ts b/code/core/src/csf-tools/enrichCsf.ts index aa4a205e6bf3..2af4505f08af 100644 --- a/code/core/src/csf-tools/enrichCsf.ts +++ b/code/core/src/csf-tools/enrichCsf.ts @@ -1,5 +1,5 @@ /* eslint-disable no-underscore-dangle */ -import { generate, types as t } from '@storybook/core/babel'; +import { generate, types as t } from 'storybook/internal/babel'; import type { CsfFile } from './CsfFile'; diff --git a/code/core/src/csf-tools/findVarInitialization.ts b/code/core/src/csf-tools/findVarInitialization.ts index 78a3cfe9a9f9..b933ba1ab4e4 100644 --- a/code/core/src/csf-tools/findVarInitialization.ts +++ b/code/core/src/csf-tools/findVarInitialization.ts @@ -1,4 +1,4 @@ -import { types as t } from '@storybook/core/babel'; +import { types as t } from 'storybook/internal/babel'; export const findVarInitialization = (identifier: string, program: t.Program): t.Expression => { let init: t.Expression = null as any; diff --git a/code/core/src/csf-tools/getStorySortParameter.ts b/code/core/src/csf-tools/getStorySortParameter.ts index 4615ca64ce0e..c54ad1b99a09 100644 --- a/code/core/src/csf-tools/getStorySortParameter.ts +++ b/code/core/src/csf-tools/getStorySortParameter.ts @@ -1,4 +1,4 @@ -import { babelParse, generate, types as t, traverse } from '@storybook/core/babel'; +import { babelParse, generate, types as t, traverse } from 'storybook/internal/babel'; import { dedent } from 'ts-dedent'; diff --git a/code/core/src/csf-tools/index.ts b/code/core/src/csf-tools/index.ts index 57605310e9f1..a2dcddb3cc0e 100644 --- a/code/core/src/csf-tools/index.ts +++ b/code/core/src/csf-tools/index.ts @@ -2,5 +2,5 @@ export * from './CsfFile'; export * from './ConfigFile'; export * from './getStorySortParameter'; export * from './enrichCsf'; -export { babelParse } from '@storybook/core/babel'; +export { babelParse } from 'storybook/internal/babel'; export { vitestTransform } from './vitest-plugin/transformer'; diff --git a/code/core/src/csf-tools/vitest-plugin/transformer.test.ts b/code/core/src/csf-tools/vitest-plugin/transformer.test.ts index 5b030ac19c73..c9e149e30394 100644 --- a/code/core/src/csf-tools/vitest-plugin/transformer.test.ts +++ b/code/core/src/csf-tools/vitest-plugin/transformer.test.ts @@ -1,13 +1,13 @@ import { beforeEach, describe, expect, it, vi } from 'vitest'; -import { getStoryTitle } from '@storybook/core/common'; +import { getStoryTitle } from 'storybook/internal/common'; import { type RawSourceMap, SourceMapConsumer } from 'source-map'; import { vitestTransform as originalTransform } from './transformer'; -vi.mock('@storybook/core/common', async (importOriginal) => { - const actual = await importOriginal(); +vi.mock('storybook/internal/common', async (importOriginal) => { + const actual = await importOriginal(); return { ...actual, getStoryTitle: vi.fn(() => 'automatic/calculated/title'), diff --git a/code/core/src/csf-tools/vitest-plugin/transformer.ts b/code/core/src/csf-tools/vitest-plugin/transformer.ts index c318faa1d29e..59e7890c8de4 100644 --- a/code/core/src/csf-tools/vitest-plugin/transformer.ts +++ b/code/core/src/csf-tools/vitest-plugin/transformer.ts @@ -1,9 +1,10 @@ /* eslint-disable local-rules/no-uncategorized-errors */ /* eslint-disable no-underscore-dangle */ -import { types as t } from '@storybook/core/babel'; -import { getStoryTitle } from '@storybook/core/common'; -import type { StoriesEntry, Tag } from '@storybook/core/types'; +import { types as t } from 'storybook/internal/babel'; +import { getStoryTitle } from 'storybook/internal/common'; +import type { StoriesEntry, Tag } from 'storybook/internal/types'; + import { combineTags } from '@storybook/csf'; import { dedent } from 'ts-dedent'; diff --git a/code/core/src/docs-tools/argTypes/convert/convert.test.ts b/code/core/src/docs-tools/argTypes/convert/convert.test.ts index 11ca35291953..f04add2e7e04 100644 --- a/code/core/src/docs-tools/argTypes/convert/convert.test.ts +++ b/code/core/src/docs-tools/argTypes/convert/convert.test.ts @@ -2,7 +2,7 @@ import { readFileSync } from 'node:fs'; import { describe, expect, it } from 'vitest'; -import { transformSync } from '@storybook/core/babel'; +import { transformSync } from 'storybook/internal/babel'; import { mapValues } from 'es-toolkit'; import requireFromString from 'require-from-string'; diff --git a/code/core/src/docs-tools/argTypes/convert/flow/convert.ts b/code/core/src/docs-tools/argTypes/convert/flow/convert.ts index 573a8da025d4..20bff516e4cf 100644 --- a/code/core/src/docs-tools/argTypes/convert/flow/convert.ts +++ b/code/core/src/docs-tools/argTypes/convert/flow/convert.ts @@ -1,6 +1,5 @@ -import type { SBType } from '@storybook/core/types'; - -import { UnknownArgTypesError } from '@storybook/core/preview-errors'; +import { UnknownArgTypesError } from 'storybook/internal/preview-errors'; +import type { SBType } from 'storybook/internal/types'; import type { FlowLiteralType, FlowSigType, FlowType } from './types'; diff --git a/code/core/src/docs-tools/argTypes/convert/proptypes/convert.ts b/code/core/src/docs-tools/argTypes/convert/proptypes/convert.ts index c3426ecfd3e2..33df39b9cb48 100644 --- a/code/core/src/docs-tools/argTypes/convert/proptypes/convert.ts +++ b/code/core/src/docs-tools/argTypes/convert/proptypes/convert.ts @@ -1,4 +1,4 @@ -import type { SBType } from '@storybook/core/types'; +import type { SBType } from 'storybook/internal/types'; import { mapValues } from 'es-toolkit'; diff --git a/code/core/src/docs-tools/argTypes/convert/typescript/convert.ts b/code/core/src/docs-tools/argTypes/convert/typescript/convert.ts index 9065c68501f4..3beaae0a3542 100644 --- a/code/core/src/docs-tools/argTypes/convert/typescript/convert.ts +++ b/code/core/src/docs-tools/argTypes/convert/typescript/convert.ts @@ -1,6 +1,5 @@ -import type { SBType } from '@storybook/core/types'; - -import { UnknownArgTypesError } from '@storybook/core/preview-errors'; +import { UnknownArgTypesError } from 'storybook/internal/preview-errors'; +import type { SBType } from 'storybook/internal/types'; import { parseLiteral } from '../utils'; import type { TSSigType, TSType } from './types'; diff --git a/code/core/src/docs-tools/argTypes/docgen/types.ts b/code/core/src/docs-tools/argTypes/docgen/types.ts index 9639be964e00..787552a6126b 100644 --- a/code/core/src/docs-tools/argTypes/docgen/types.ts +++ b/code/core/src/docs-tools/argTypes/docgen/types.ts @@ -1,4 +1,4 @@ -import type { StrictArgTypes } from '@storybook/core/types'; +import type { StrictArgTypes } from 'storybook/internal/types'; import type { Component } from '../types'; import type { PropDef } from './PropDef'; diff --git a/code/core/src/docs-tools/argTypes/enhanceArgTypes.test.ts b/code/core/src/docs-tools/argTypes/enhanceArgTypes.test.ts index 55b70ef2ea52..f269987ab8d0 100644 --- a/code/core/src/docs-tools/argTypes/enhanceArgTypes.test.ts +++ b/code/core/src/docs-tools/argTypes/enhanceArgTypes.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from 'vitest'; -import type { ArgTypes, StrictInputType } from '@storybook/core/types'; +import type { ArgTypes, StrictInputType } from 'storybook/internal/types'; import { enhanceArgTypes } from './enhanceArgTypes'; diff --git a/code/core/src/docs-tools/argTypes/enhanceArgTypes.ts b/code/core/src/docs-tools/argTypes/enhanceArgTypes.ts index 96cc2ce44d67..6f7360f9b3cc 100644 --- a/code/core/src/docs-tools/argTypes/enhanceArgTypes.ts +++ b/code/core/src/docs-tools/argTypes/enhanceArgTypes.ts @@ -1,6 +1,5 @@ -import type { Renderer, StoryContextForEnhancers } from '@storybook/core/types'; - -import { combineParameters } from '@storybook/core/preview-api'; +import { combineParameters } from 'storybook/internal/preview-api'; +import type { Renderer, StoryContextForEnhancers } from 'storybook/internal/types'; export const enhanceArgTypes = ( context: StoryContextForEnhancers diff --git a/code/core/src/docs-tools/hasDocsOrControls.ts b/code/core/src/docs-tools/hasDocsOrControls.ts index 14e423dd3071..4fbb21335f69 100644 --- a/code/core/src/docs-tools/hasDocsOrControls.ts +++ b/code/core/src/docs-tools/hasDocsOrControls.ts @@ -1,4 +1,4 @@ -import type { Options } from '@storybook/core/types'; +import type { Options } from 'storybook/internal/types'; // `addons/x` is for the monorepo, `addon-x` is for normal usage const packageRe = /(addons\/|addon-|addon-essentials\/)(docs|controls)/; diff --git a/code/core/src/manager-api/lib/addons.ts b/code/core/src/manager-api/lib/addons.ts index e893dfa7b984..75486a0b25a5 100644 --- a/code/core/src/manager-api/lib/addons.ts +++ b/code/core/src/manager-api/lib/addons.ts @@ -1,4 +1,6 @@ -import type { Channel } from '@storybook/core/channels'; +import type { Channel } from 'storybook/internal/channels'; +import { logger } from 'storybook/internal/client-logger'; +import { SET_CONFIG } from 'storybook/internal/core-events'; import type { Addon_BaseType, Addon_Collection, @@ -13,12 +15,10 @@ import type { Addon_Types, Addon_TypesMapping, Addon_WrapperType, -} from '@storybook/core/types'; -import { Addon_TypesEnum } from '@storybook/core/types'; -import { global } from '@storybook/global'; +} from 'storybook/internal/types'; +import { Addon_TypesEnum } from 'storybook/internal/types'; -import { logger } from '@storybook/core/client-logger'; -import { SET_CONFIG } from '@storybook/core/core-events'; +import { global } from '@storybook/global'; import type { API } from '../root'; import { mockChannel } from './storybook-channel-mock'; diff --git a/code/core/src/manager-api/lib/events.ts b/code/core/src/manager-api/lib/events.ts index f964626ac8ef..2f3e4e92a028 100644 --- a/code/core/src/manager-api/lib/events.ts +++ b/code/core/src/manager-api/lib/events.ts @@ -1,6 +1,5 @@ -import type { API_ComposedRef } from '@storybook/core/types'; - -import { logger } from '@storybook/core/client-logger'; +import { logger } from 'storybook/internal/client-logger'; +import type { API_ComposedRef } from 'storybook/internal/types'; import { getSourceType } from '../modules/refs'; import type { API } from '../root'; diff --git a/code/core/src/manager-api/lib/merge.ts b/code/core/src/manager-api/lib/merge.ts index f00195c304b2..457331557da5 100644 --- a/code/core/src/manager-api/lib/merge.ts +++ b/code/core/src/manager-api/lib/merge.ts @@ -1,4 +1,4 @@ -import { logger } from '@storybook/core/client-logger'; +import { logger } from 'storybook/internal/client-logger'; import { isEqual, mergeWith, omitBy, pick } from 'es-toolkit'; diff --git a/code/core/src/manager-api/lib/request-response.ts b/code/core/src/manager-api/lib/request-response.ts index 6d4c07367093..00774fe086c8 100644 --- a/code/core/src/manager-api/lib/request-response.ts +++ b/code/core/src/manager-api/lib/request-response.ts @@ -1,6 +1,5 @@ -import type { Channel } from '@storybook/core/channels'; - -import type { RequestData, ResponseData } from '@storybook/core/core-events'; +import type { Channel } from 'storybook/internal/channels'; +import type { RequestData, ResponseData } from 'storybook/internal/core-events'; export class RequestResponseError | void> extends Error { payload: Payload | undefined = undefined; diff --git a/code/core/src/manager-api/lib/stories.test.ts b/code/core/src/manager-api/lib/stories.test.ts index 3f0cbe63b5be..4c1668573abe 100644 --- a/code/core/src/manager-api/lib/stories.test.ts +++ b/code/core/src/manager-api/lib/stories.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from 'vitest'; -import type { API_PreparedStoryIndex, StoryIndexV2, StoryIndexV3 } from '@storybook/core/types'; +import type { API_PreparedStoryIndex, StoryIndexV2, StoryIndexV3 } from 'storybook/internal/types'; import type { State } from '../root'; import { mockEntries } from '../tests/mockStoriesEntries'; diff --git a/code/core/src/manager-api/lib/stories.ts b/code/core/src/manager-api/lib/stories.ts index b38d30000531..45ae29cfcad9 100644 --- a/code/core/src/manager-api/lib/stories.ts +++ b/code/core/src/manager-api/lib/stories.ts @@ -18,7 +18,8 @@ import type { StoryIndexV2, StoryIndexV3, Tag, -} from '@storybook/core/types'; +} from 'storybook/internal/types'; + import { sanitize } from '@storybook/csf'; import { countBy, mapValues } from 'es-toolkit'; diff --git a/code/core/src/manager-api/lib/storybook-channel-mock.ts b/code/core/src/manager-api/lib/storybook-channel-mock.ts index 2f8abbf20b5f..23fce7c5ff8a 100644 --- a/code/core/src/manager-api/lib/storybook-channel-mock.ts +++ b/code/core/src/manager-api/lib/storybook-channel-mock.ts @@ -1,4 +1,4 @@ -import { Channel } from '@storybook/core/channels'; +import { Channel } from 'storybook/internal/channels'; export function mockChannel() { const transport = { diff --git a/code/core/src/manager-api/lib/types.tsx b/code/core/src/manager-api/lib/types.tsx index 1579954f7e17..b9fc9d9757b1 100644 --- a/code/core/src/manager-api/lib/types.tsx +++ b/code/core/src/manager-api/lib/types.tsx @@ -1,5 +1,5 @@ -import type { RouterData } from '@storybook/core/router'; -import type { API_ProviderData } from '@storybook/core/types'; +import type { RouterData } from 'storybook/internal/router'; +import type { API_ProviderData } from 'storybook/internal/types'; import type { API, State } from '../root'; import type Store from '../store'; diff --git a/code/core/src/manager-api/modules/addons.ts b/code/core/src/manager-api/modules/addons.ts index 16a35fcfc9ad..5382013b0b00 100644 --- a/code/core/src/manager-api/modules/addons.ts +++ b/code/core/src/manager-api/modules/addons.ts @@ -1,11 +1,11 @@ +import { Addon_TypesEnum } from 'storybook/internal/types'; import type { API_StateMerger, Addon_BaseType, Addon_Collection, Addon_Types, Addon_TypesMapping, -} from '@storybook/core/types'; -import { Addon_TypesEnum } from '@storybook/core/types'; +} from 'storybook/internal/types'; import type { ModuleFn } from '../lib/types'; import type { Options } from '../store'; diff --git a/code/core/src/manager-api/modules/channel.ts b/code/core/src/manager-api/modules/channel.ts index da401d78acaa..45bb76bc4af3 100644 --- a/code/core/src/manager-api/modules/channel.ts +++ b/code/core/src/manager-api/modules/channel.ts @@ -1,5 +1,5 @@ -import type { Listener } from '@storybook/core/channels'; -import type { API_Provider } from '@storybook/core/types'; +import type { Listener } from 'storybook/internal/channels'; +import type { API_Provider } from 'storybook/internal/types'; import type { ModuleFn } from '../lib/types'; import type { API } from '../root'; diff --git a/code/core/src/manager-api/modules/experimental_testmodule.ts b/code/core/src/manager-api/modules/experimental_testmodule.ts index 4058333a3b10..bfe769069a9d 100644 --- a/code/core/src/manager-api/modules/experimental_testmodule.ts +++ b/code/core/src/manager-api/modules/experimental_testmodule.ts @@ -1,5 +1,3 @@ -import { Addon_TypesEnum, type StoryId } from '@storybook/core/types'; - import { TESTING_MODULE_CANCEL_TEST_RUN_REQUEST, TESTING_MODULE_RUN_ALL_REQUEST, @@ -10,7 +8,8 @@ import { type TestProviders, type TestingModuleRunRequestPayload, type TestingModuleWatchModeRequestPayload, -} from '@storybook/core/core-events'; +} from 'storybook/internal/core-events'; +import { Addon_TypesEnum, type StoryId } from 'storybook/internal/types'; import invariant from 'tiny-invariant'; diff --git a/code/core/src/manager-api/modules/globals.ts b/code/core/src/manager-api/modules/globals.ts index a61f28f57c5d..bdf5c23ebe7c 100644 --- a/code/core/src/manager-api/modules/globals.ts +++ b/code/core/src/manager-api/modules/globals.ts @@ -1,12 +1,11 @@ +import { logger } from 'storybook/internal/client-logger'; +import { GLOBALS_UPDATED, SET_GLOBALS, UPDATE_GLOBALS } from 'storybook/internal/core-events'; import type { GlobalTypes, Globals, GlobalsUpdatedPayload, SetGlobalsPayload, -} from '@storybook/core/types'; - -import { logger } from '@storybook/core/client-logger'; -import { GLOBALS_UPDATED, SET_GLOBALS, UPDATE_GLOBALS } from '@storybook/core/core-events'; +} from 'storybook/internal/types'; import { dequal as deepEqual } from 'dequal'; diff --git a/code/core/src/manager-api/modules/layout.ts b/code/core/src/manager-api/modules/layout.ts index 6687c36b1137..0b8036450f9e 100644 --- a/code/core/src/manager-api/modules/layout.ts +++ b/code/core/src/manager-api/modules/layout.ts @@ -1,9 +1,9 @@ -import type { ThemeVars } from '@storybook/core/theming'; -import { create } from '@storybook/core/theming/create'; -import type { API_Layout, API_PanelPositions, API_UI } from '@storybook/core/types'; -import { global } from '@storybook/global'; +import { SET_CONFIG } from 'storybook/internal/core-events'; +import type { ThemeVars } from 'storybook/internal/theming'; +import { create } from 'storybook/internal/theming/create'; +import type { API_Layout, API_PanelPositions, API_UI } from 'storybook/internal/types'; -import { SET_CONFIG } from '@storybook/core/core-events'; +import { global } from '@storybook/global'; import { isEqual as deepEqual, pick, toMerged } from 'es-toolkit'; diff --git a/code/core/src/manager-api/modules/notifications.ts b/code/core/src/manager-api/modules/notifications.ts index c1410cfbeb78..31431b684dd2 100644 --- a/code/core/src/manager-api/modules/notifications.ts +++ b/code/core/src/manager-api/modules/notifications.ts @@ -1,4 +1,4 @@ -import type { API_Notification } from '@storybook/core/types'; +import type { API_Notification } from 'storybook/internal/types'; import { partition } from 'es-toolkit'; diff --git a/code/core/src/manager-api/modules/provider.ts b/code/core/src/manager-api/modules/provider.ts index 0e22115369e1..40b833584742 100644 --- a/code/core/src/manager-api/modules/provider.ts +++ b/code/core/src/manager-api/modules/provider.ts @@ -1,4 +1,4 @@ -import type { API_IframeRenderer } from '@storybook/core/types'; +import type { API_IframeRenderer } from 'storybook/internal/types'; import type { ModuleFn } from '../lib/types'; diff --git a/code/core/src/manager-api/modules/refs.ts b/code/core/src/manager-api/modules/refs.ts index cb9b8916ce29..1ec0b477f2ba 100644 --- a/code/core/src/manager-api/modules/refs.ts +++ b/code/core/src/manager-api/modules/refs.ts @@ -7,7 +7,8 @@ import type { API_StoryMapper, SetStoriesStoryData, StoryIndex, -} from '@storybook/core/types'; +} from 'storybook/internal/types'; + import { global } from '@storybook/global'; import { dedent } from 'ts-dedent'; diff --git a/code/core/src/manager-api/modules/settings.ts b/code/core/src/manager-api/modules/settings.ts index 1fe6672947e6..db83ad102a3d 100644 --- a/code/core/src/manager-api/modules/settings.ts +++ b/code/core/src/manager-api/modules/settings.ts @@ -1,4 +1,4 @@ -import type { API_Settings, StoryId } from '@storybook/core/types'; +import type { API_Settings, StoryId } from 'storybook/internal/types'; import type { ModuleFn } from '../lib/types'; diff --git a/code/core/src/manager-api/modules/shortcuts.ts b/code/core/src/manager-api/modules/shortcuts.ts index 09582c3fb1a4..39648883a69d 100644 --- a/code/core/src/manager-api/modules/shortcuts.ts +++ b/code/core/src/manager-api/modules/shortcuts.ts @@ -1,12 +1,12 @@ /* eslint-disable @typescript-eslint/naming-convention */ -import { global } from '@storybook/global'; - import { FORCE_REMOUNT, PREVIEW_KEYDOWN, STORIES_COLLAPSE_ALL, STORIES_EXPAND_ALL, -} from '@storybook/core/core-events'; +} from 'storybook/internal/core-events'; + +import { global } from '@storybook/global'; import type { KeyboardEventLike } from '../lib/shortcut'; import { eventToShortcut, shortcutMatchesShortcut } from '../lib/shortcut'; diff --git a/code/core/src/manager-api/modules/stories.ts b/code/core/src/manager-api/modules/stories.ts index fa295bc20567..204803e3bf33 100644 --- a/code/core/src/manager-api/modules/stories.ts +++ b/code/core/src/manager-api/modules/stories.ts @@ -1,3 +1,24 @@ +import { logger } from 'storybook/internal/client-logger'; +import { + CONFIG_ERROR, + CURRENT_STORY_WAS_SET, + DOCS_PREPARED, + PRELOAD_ENTRIES, + RESET_STORY_ARGS, + SELECT_STORY, + SET_CONFIG, + SET_CURRENT_STORY, + SET_FILTER, + SET_INDEX, + SET_STORIES, + STORY_ARGS_UPDATED, + STORY_CHANGED, + STORY_INDEX_INVALIDATED, + STORY_MISSING, + STORY_PREPARED, + STORY_SPECIFIED, + UPDATE_STORY_ARGS, +} from 'storybook/internal/core-events'; import type { API_ComposedRef, API_DocsEntry, @@ -21,32 +42,11 @@ import type { StoryKind, StoryName, StoryPreparedPayload, -} from '@storybook/core/types'; +} from 'storybook/internal/types'; + import { sanitize, toId } from '@storybook/csf'; import { global } from '@storybook/global'; -import { logger } from '@storybook/core/client-logger'; -import { - CONFIG_ERROR, - CURRENT_STORY_WAS_SET, - DOCS_PREPARED, - PRELOAD_ENTRIES, - RESET_STORY_ARGS, - SELECT_STORY, - SET_CONFIG, - SET_CURRENT_STORY, - SET_FILTER, - SET_INDEX, - SET_STORIES, - STORY_ARGS_UPDATED, - STORY_CHANGED, - STORY_INDEX_INVALIDATED, - STORY_MISSING, - STORY_PREPARED, - STORY_SPECIFIED, - UPDATE_STORY_ARGS, -} from '@storybook/core/core-events'; - import { getEventMetadata } from '../lib/events'; import { addPreparedStories, diff --git a/code/core/src/manager-api/modules/url.ts b/code/core/src/manager-api/modules/url.ts index 1b08ba7358d4..d8667cf4ed07 100644 --- a/code/core/src/manager-api/modules/url.ts +++ b/code/core/src/manager-api/modules/url.ts @@ -1,15 +1,15 @@ -import type { NavigateOptions } from '@storybook/core/router'; -import { buildArgsParam, queryFromLocation } from '@storybook/core/router'; -import type { API_Layout, API_UI, Args } from '@storybook/core/types'; -import { global } from '@storybook/global'; - import { GLOBALS_UPDATED, NAVIGATE_URL, SET_CURRENT_STORY, STORY_ARGS_UPDATED, UPDATE_QUERY_PARAMS, -} from '@storybook/core/core-events'; +} from 'storybook/internal/core-events'; +import { buildArgsParam, queryFromLocation } from 'storybook/internal/router'; +import type { NavigateOptions } from 'storybook/internal/router'; +import type { API_Layout, API_UI, Args } from 'storybook/internal/types'; + +import { global } from '@storybook/global'; import { dequal as deepEqual } from 'dequal'; diff --git a/code/core/src/manager-api/modules/versions.ts b/code/core/src/manager-api/modules/versions.ts index df0712e8c638..f9cc2a36cf7d 100644 --- a/code/core/src/manager-api/modules/versions.ts +++ b/code/core/src/manager-api/modules/versions.ts @@ -1,4 +1,5 @@ -import type { API_UnknownEntries, API_Version, API_Versions } from '@storybook/core/types'; +import type { API_UnknownEntries, API_Version, API_Versions } from 'storybook/internal/types'; + import { global } from '@storybook/global'; import memoize from 'memoizerific'; diff --git a/code/core/src/manager-api/modules/whatsnew.tsx b/code/core/src/manager-api/modules/whatsnew.tsx index 7878f5920066..6a03168e5fb4 100644 --- a/code/core/src/manager-api/modules/whatsnew.tsx +++ b/code/core/src/manager-api/modules/whatsnew.tsx @@ -1,15 +1,15 @@ import React from 'react'; -import { global } from '@storybook/global'; -import { StorybookIcon } from '@storybook/icons'; - -import type { WhatsNewCache, WhatsNewData } from '@storybook/core/core-events'; import { REQUEST_WHATS_NEW_DATA, RESULT_WHATS_NEW_DATA, SET_WHATS_NEW_CACHE, TOGGLE_WHATS_NEW_NOTIFICATIONS, -} from '@storybook/core/core-events'; +} from 'storybook/internal/core-events'; +import type { WhatsNewCache, WhatsNewData } from 'storybook/internal/core-events'; + +import { global } from '@storybook/global'; +import { StorybookIcon } from '@storybook/icons'; import type { ModuleFn } from '../lib/types'; diff --git a/code/core/src/manager-api/root.tsx b/code/core/src/manager-api/root.tsx index 0889a560c8a0..753b507f1c8d 100644 --- a/code/core/src/manager-api/root.tsx +++ b/code/core/src/manager-api/root.tsx @@ -10,8 +10,15 @@ import React, { useRef, } from 'react'; -import type { Listener } from '@storybook/core/channels'; -import type { RouterData } from '@storybook/core/router'; +import type { Listener } from 'storybook/internal/channels'; +import { deprecate } from 'storybook/internal/client-logger'; +import { + SET_STORIES, + SHARED_STATE_CHANGED, + SHARED_STATE_SET, + STORY_CHANGED, +} from 'storybook/internal/core-events'; +import type { RouterData } from 'storybook/internal/router'; import type { API_ComponentEntry, API_ComposedRef, @@ -31,15 +38,7 @@ import type { Globals, Parameters, StoryId, -} from '@storybook/core/types'; - -import { deprecate } from '@storybook/core/client-logger'; -import { - SET_STORIES, - SHARED_STATE_CHANGED, - SHARED_STATE_SET, - STORY_CHANGED, -} from '@storybook/core/core-events'; +} from 'storybook/internal/types'; import { isEqual } from 'es-toolkit'; diff --git a/code/core/src/manager-api/tests/addons.test.js b/code/core/src/manager-api/tests/addons.test.js index c4f5c46d41df..8f79b953e7c3 100644 --- a/code/core/src/manager-api/tests/addons.test.js +++ b/code/core/src/manager-api/tests/addons.test.js @@ -1,6 +1,6 @@ import { describe, expect, it, vi } from 'vitest'; -import { Addon_TypesEnum as types } from '@storybook/core/types'; +import { Addon_TypesEnum as types } from 'storybook/internal/types'; import { init as initAddons } from '../modules/addons'; diff --git a/code/core/src/manager-api/tests/globals.test.ts b/code/core/src/manager-api/tests/globals.test.ts index 96da32051f2b..8045ad2526c8 100644 --- a/code/core/src/manager-api/tests/globals.test.ts +++ b/code/core/src/manager-api/tests/globals.test.ts @@ -1,14 +1,13 @@ import { beforeEach, describe, expect, it, vi } from 'vitest'; -import type { GlobalsUpdatedPayload, SetGlobalsPayload } from '@storybook/core/types'; - -import { logger as _logger } from '@storybook/core/client-logger'; +import { logger as _logger } from 'storybook/internal/client-logger'; import { GLOBALS_UPDATED, SET_GLOBALS, SET_STORIES, UPDATE_GLOBALS, -} from '@storybook/core/core-events'; +} from 'storybook/internal/core-events'; +import type { GlobalsUpdatedPayload, SetGlobalsPayload } from 'storybook/internal/types'; import { EventEmitter } from 'events'; @@ -21,7 +20,7 @@ import type { API } from '../root'; const getEventMetadata = vi.mocked(_getEventData, true); const logger = vi.mocked(_logger, true); -vi.mock('@storybook/core/client-logger'); +vi.mock('storybook/internal/client-logger'); vi.mock('../lib/events'); beforeEach(() => { getEventMetadata.mockReset().mockReturnValue({ sourceType: 'local' } as any); diff --git a/code/core/src/manager-api/tests/layout.test.ts b/code/core/src/manager-api/tests/layout.test.ts index 7b1c7361f254..067083ad5e15 100644 --- a/code/core/src/manager-api/tests/layout.test.ts +++ b/code/core/src/manager-api/tests/layout.test.ts @@ -1,8 +1,8 @@ import type { Mock } from 'vitest'; import { beforeEach, describe, expect, it, vi } from 'vitest'; -import { themes } from '@storybook/core/theming'; -import type { API_Provider } from '@storybook/core/types'; +import { themes } from 'storybook/internal/theming'; +import type { API_Provider } from 'storybook/internal/types'; import EventEmitter from 'events'; @@ -25,7 +25,7 @@ describe('layout API', () => { beforeEach(() => { currentState = { ...defaultLayoutState, - selectedPanel: '@storybook/core/actions/panel', + selectedPanel: 'storybook/internal/action/panel', theme: themes.light, singleStory: false, }; diff --git a/code/core/src/manager-api/tests/mockStoriesEntries.ts b/code/core/src/manager-api/tests/mockStoriesEntries.ts index 2bccab057186..a66fd8184896 100644 --- a/code/core/src/manager-api/tests/mockStoriesEntries.ts +++ b/code/core/src/manager-api/tests/mockStoriesEntries.ts @@ -1,4 +1,4 @@ -import type { API_PreparedStoryIndex, StoryIndex } from '@storybook/core/types'; +import type { API_PreparedStoryIndex, StoryIndex } from 'storybook/internal/types'; export const mockEntries: StoryIndex['entries'] = { 'component-a--docs': { diff --git a/code/core/src/manager-api/tests/refs.test.ts b/code/core/src/manager-api/tests/refs.test.ts index b9d39ee6a88b..d743514fd3b0 100644 --- a/code/core/src/manager-api/tests/refs.test.ts +++ b/code/core/src/manager-api/tests/refs.test.ts @@ -1,6 +1,7 @@ import { describe, expect, it, vi } from 'vitest'; -import type { StoryIndex } from '@storybook/core/types'; +import type { StoryIndex } from 'storybook/internal/types'; + import { global } from '@storybook/global'; import { transformStoryIndexToStoriesHash } from '../lib/stories'; diff --git a/code/core/src/manager-api/tests/stories.test.ts b/code/core/src/manager-api/tests/stories.test.ts index 6f480061d9ec..61f95bae4486 100644 --- a/code/core/src/manager-api/tests/stories.test.ts +++ b/code/core/src/manager-api/tests/stories.test.ts @@ -1,9 +1,6 @@ import type { Mocked } from 'vitest'; import { describe, expect, it, vi } from 'vitest'; -import type { API_StoryEntry } from '@storybook/core/types'; -import { global } from '@storybook/global'; - import { CONFIG_ERROR, CURRENT_STORY_WAS_SET, @@ -17,7 +14,10 @@ import { STORY_PREPARED, STORY_SPECIFIED, UPDATE_STORY_ARGS, -} from '@storybook/core/core-events'; +} from 'storybook/internal/core-events'; +import type { API_StoryEntry } from 'storybook/internal/types'; + +import { global } from '@storybook/global'; import { EventEmitter } from 'events'; diff --git a/code/core/src/manager-api/tests/url.test.js b/code/core/src/manager-api/tests/url.test.js index 15e1c288863a..72523a24c25b 100644 --- a/code/core/src/manager-api/tests/url.test.js +++ b/code/core/src/manager-api/tests/url.test.js @@ -4,13 +4,13 @@ import { GLOBALS_UPDATED, SET_CURRENT_STORY, UPDATE_QUERY_PARAMS, -} from '@storybook/core/core-events'; +} from 'storybook/internal/core-events'; import EventEmitter from 'events'; import { init as initURL } from '../modules/url'; -vi.mock('@storybook/core/client-logger'); +vi.mock('storybook/internal/client-logger'); vi.useFakeTimers(); describe('initial state', () => { diff --git a/code/core/src/manager-api/tests/versions.test.js b/code/core/src/manager-api/tests/versions.test.js index 280deaeed2ae..875c45b11624 100644 --- a/code/core/src/manager-api/tests/versions.test.js +++ b/code/core/src/manager-api/tests/versions.test.js @@ -25,7 +25,7 @@ vi.mock('@storybook/global', () => ({ }, })); -vi.mock('@storybook/core/client-logger'); +vi.mock('storybook/internal/client-logger'); function createMockStore() { let state = { @@ -46,7 +46,7 @@ function createMockStore() { }; } -vi.mock('@storybook/core/client-logger'); +vi.mock('storybook/internal/client-logger'); describe('versions API', () => { it('sets initial state with current version', async () => { diff --git a/code/core/src/manager-api/typings.d.ts b/code/core/src/manager-api/typings.d.ts index 2aa4cc366704..824597424def 100644 --- a/code/core/src/manager-api/typings.d.ts +++ b/code/core/src/manager-api/typings.d.ts @@ -2,8 +2,8 @@ declare var __STORYBOOK_ADDONS_MANAGER: any; declare var CONFIG_TYPE: string; -declare var FEATURES: import('@storybook/core/types').StorybookConfigRaw['features']; -declare var TAGS_OPTIONS: import('@storybook/core/types').StorybookConfigRaw['tags']; +declare var FEATURES: import('storybook/internal/types').StorybookConfigRaw['features']; +declare var TAGS_OPTIONS: import('storybook/internal/types').StorybookConfigRaw['tags']; declare var REFS: any; declare var VERSIONCHECK: any; declare var LOGLEVEL: 'trace' | 'debug' | 'info' | 'warn' | 'error' | 'silent' | undefined; diff --git a/code/core/src/manager/App.tsx b/code/core/src/manager/App.tsx index 287f9736cc71..a4cda42bf8ac 100644 --- a/code/core/src/manager/App.tsx +++ b/code/core/src/manager/App.tsx @@ -1,8 +1,8 @@ import type { ComponentProps } from 'react'; import React from 'react'; -import { Global, createGlobal } from '@storybook/core/theming'; -import type { Addon_PageType } from '@storybook/core/types'; +import { Global, createGlobal } from 'storybook/internal/theming'; +import type { Addon_PageType } from 'storybook/internal/types'; import { Layout } from './components/layout/Layout'; import { useLayout } from './components/layout/LayoutProvider'; diff --git a/code/core/src/manager/FakeProvider.tsx b/code/core/src/manager/FakeProvider.tsx index dc66dedf0f6f..ef4d87f0aecb 100644 --- a/code/core/src/manager/FakeProvider.tsx +++ b/code/core/src/manager/FakeProvider.tsx @@ -1,8 +1,7 @@ import React from 'react'; -import { styled } from '@storybook/core/theming'; - -import { addons } from '@storybook/core/manager-api'; +import { addons } from 'storybook/internal/manager-api'; +import { styled } from 'storybook/internal/theming'; import Provider from './provider'; diff --git a/code/core/src/manager/components/layout/Layout.stories.tsx b/code/core/src/manager/components/layout/Layout.stories.tsx index 6a133d6c492f..e3f19df412db 100644 --- a/code/core/src/manager/components/layout/Layout.stories.tsx +++ b/code/core/src/manager/components/layout/Layout.stories.tsx @@ -1,8 +1,9 @@ import type { FC, PropsWithChildren } from 'react'; import React, { useState } from 'react'; -import { LocationProvider } from '@storybook/core/router'; -import { styled } from '@storybook/core/theming'; +import { LocationProvider } from 'storybook/internal/router'; +import { styled } from 'storybook/internal/theming'; + import type { Meta, StoryObj } from '@storybook/react'; import { fn } from '@storybook/test'; diff --git a/code/core/src/manager/components/layout/Layout.tsx b/code/core/src/manager/components/layout/Layout.tsx index df9d5b86d9cb..39e992c653eb 100644 --- a/code/core/src/manager/components/layout/Layout.tsx +++ b/code/core/src/manager/components/layout/Layout.tsx @@ -1,8 +1,8 @@ import React, { useEffect, useLayoutEffect, useState } from 'react'; -import { Match } from '@storybook/core/router'; -import { styled } from '@storybook/core/theming'; -import type { API_Layout, API_ViewMode } from '@storybook/core/types'; +import { Match } from 'storybook/internal/router'; +import { styled } from 'storybook/internal/theming'; +import type { API_Layout, API_ViewMode } from 'storybook/internal/types'; import { MEDIA_DESKTOP_BREAKPOINT } from '../../constants'; import { Notifications } from '../../container/Notifications'; diff --git a/code/core/src/manager/components/mobile/about/MobileAbout.stories.tsx b/code/core/src/manager/components/mobile/about/MobileAbout.stories.tsx index e72de1787c68..36759e03950e 100644 --- a/code/core/src/manager/components/mobile/about/MobileAbout.stories.tsx +++ b/code/core/src/manager/components/mobile/about/MobileAbout.stories.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; +import { ManagerContext } from 'storybook/internal/manager-api'; + import type { Meta, StoryObj } from '@storybook/react'; import { within } from '@storybook/test'; -import { ManagerContext } from '@storybook/core/manager-api'; - import { LayoutProvider, useLayout } from '../../layout/LayoutProvider'; import { MobileAbout } from './MobileAbout'; diff --git a/code/core/src/manager/components/mobile/about/MobileAbout.tsx b/code/core/src/manager/components/mobile/about/MobileAbout.tsx index a794ba00ea9f..09379c49087b 100644 --- a/code/core/src/manager/components/mobile/about/MobileAbout.tsx +++ b/code/core/src/manager/components/mobile/about/MobileAbout.tsx @@ -1,8 +1,9 @@ import type { FC } from 'react'; import React, { useRef } from 'react'; -import { Link } from '@storybook/core/components'; -import { styled } from '@storybook/core/theming'; +import { Link } from 'storybook/internal/components'; +import { styled } from 'storybook/internal/theming'; + import { ArrowLeftIcon, GithubIcon, ShareAltIcon, StorybookIcon } from '@storybook/icons'; import { Transition, type TransitionStatus } from 'react-transition-group'; diff --git a/code/core/src/manager/components/mobile/navigation/MobileAddonsDrawer.tsx b/code/core/src/manager/components/mobile/navigation/MobileAddonsDrawer.tsx index def0c9e2bdf8..41f3c02639dd 100644 --- a/code/core/src/manager/components/mobile/navigation/MobileAddonsDrawer.tsx +++ b/code/core/src/manager/components/mobile/navigation/MobileAddonsDrawer.tsx @@ -1,7 +1,7 @@ import type { FC, ReactNode } from 'react'; import React from 'react'; -import { styled } from '@storybook/core/theming'; +import { styled } from 'storybook/internal/theming'; interface MobileAddonsDrawerProps { children: ReactNode; diff --git a/code/core/src/manager/components/mobile/navigation/MobileMenuDrawer.tsx b/code/core/src/manager/components/mobile/navigation/MobileMenuDrawer.tsx index 7f95bb222521..01f5e7b1c2ad 100644 --- a/code/core/src/manager/components/mobile/navigation/MobileMenuDrawer.tsx +++ b/code/core/src/manager/components/mobile/navigation/MobileMenuDrawer.tsx @@ -1,7 +1,7 @@ import type { FC } from 'react'; import React, { useRef } from 'react'; -import { styled } from '@storybook/core/theming'; +import { styled } from 'storybook/internal/theming'; import { Transition } from 'react-transition-group'; import type { TransitionStatus } from 'react-transition-group/Transition'; diff --git a/code/core/src/manager/components/mobile/navigation/MobileNavigation.stories.tsx b/code/core/src/manager/components/mobile/navigation/MobileNavigation.stories.tsx index 37e18b66a1fe..3ee9be594fc7 100644 --- a/code/core/src/manager/components/mobile/navigation/MobileNavigation.stories.tsx +++ b/code/core/src/manager/components/mobile/navigation/MobileNavigation.stories.tsx @@ -1,10 +1,10 @@ import React from 'react'; +import { ManagerContext } from 'storybook/internal/manager-api'; + import type { Meta, StoryObj } from '@storybook/react'; import { within } from '@storybook/test'; -import { ManagerContext } from '@storybook/core/manager-api'; - import { startCase } from 'es-toolkit'; import { LayoutProvider, useLayout } from '../../layout/LayoutProvider'; diff --git a/code/core/src/manager/components/mobile/navigation/MobileNavigation.tsx b/code/core/src/manager/components/mobile/navigation/MobileNavigation.tsx index ddef2c0f2de4..f33ce43a783b 100644 --- a/code/core/src/manager/components/mobile/navigation/MobileNavigation.tsx +++ b/code/core/src/manager/components/mobile/navigation/MobileNavigation.tsx @@ -1,13 +1,13 @@ import type { FC } from 'react'; import React from 'react'; -import { IconButton } from '@storybook/core/components'; -import { styled } from '@storybook/core/theming'; +import { IconButton } from 'storybook/internal/components'; +import { useStorybookApi, useStorybookState } from 'storybook/internal/manager-api'; +import { styled } from 'storybook/internal/theming'; + import { BottomBarToggleIcon, MenuIcon } from '@storybook/icons'; import type { API_IndexHash, API_Refs } from '@storybook/types'; -import { useStorybookApi, useStorybookState } from '@storybook/core/manager-api'; - import { useLayout } from '../../layout/LayoutProvider'; import { MobileAddonsDrawer } from './MobileAddonsDrawer'; import { MobileMenuDrawer } from './MobileMenuDrawer'; diff --git a/code/core/src/manager/components/notifications/NotificationItem.stories.tsx b/code/core/src/manager/components/notifications/NotificationItem.stories.tsx index 71622e8c93a0..3af2381d945b 100644 --- a/code/core/src/manager/components/notifications/NotificationItem.stories.tsx +++ b/code/core/src/manager/components/notifications/NotificationItem.stories.tsx @@ -1,6 +1,7 @@ import React from 'react'; -import { LocationProvider } from '@storybook/core/router'; +import { LocationProvider } from 'storybook/internal/router'; + import { AccessibilityIcon as AccessibilityIconIcon, BookIcon as BookIconIcon, diff --git a/code/core/src/manager/components/notifications/NotificationItem.tsx b/code/core/src/manager/components/notifications/NotificationItem.tsx index 159fa0da137f..593a229059a8 100644 --- a/code/core/src/manager/components/notifications/NotificationItem.tsx +++ b/code/core/src/manager/components/notifications/NotificationItem.tsx @@ -1,13 +1,13 @@ import type { FC, SyntheticEvent } from 'react'; import React, { useCallback, useEffect, useRef } from 'react'; -import type { IconsProps } from '@storybook/core/components'; -import { IconButton, Icons } from '@storybook/core/components'; -import { Link } from '@storybook/core/router'; -import { keyframes, styled, useTheme } from '@storybook/core/theming'; -import { CloseAltIcon } from '@storybook/icons'; +import type { IconsProps } from 'storybook/internal/components'; +import { IconButton, Icons } from 'storybook/internal/components'; +import { type State } from 'storybook/internal/manager-api'; +import { Link } from 'storybook/internal/router'; +import { keyframes, styled, useTheme } from 'storybook/internal/theming'; -import { type State } from '@storybook/core/manager-api'; +import { CloseAltIcon } from '@storybook/icons'; import { transparentize } from 'polished'; diff --git a/code/core/src/manager/components/notifications/NotificationList.stories.tsx b/code/core/src/manager/components/notifications/NotificationList.stories.tsx index 60554232747c..d79faa6da1fa 100644 --- a/code/core/src/manager/components/notifications/NotificationList.stories.tsx +++ b/code/core/src/manager/components/notifications/NotificationList.stories.tsx @@ -1,6 +1,7 @@ import React from 'react'; -import { LocationProvider } from '@storybook/core/router'; +import { LocationProvider } from 'storybook/internal/router'; + import type { Meta, StoryObj } from '@storybook/react'; import * as itemStories from './NotificationItem.stories'; diff --git a/code/core/src/manager/components/notifications/NotificationList.tsx b/code/core/src/manager/components/notifications/NotificationList.tsx index 0e4789a28bf5..169542b48529 100644 --- a/code/core/src/manager/components/notifications/NotificationList.tsx +++ b/code/core/src/manager/components/notifications/NotificationList.tsx @@ -1,9 +1,8 @@ import type { FC } from 'react'; import React from 'react'; -import { styled } from '@storybook/core/theming'; - -import type { State } from '@storybook/core/manager-api'; +import type { State } from 'storybook/internal/manager-api'; +import { styled } from 'storybook/internal/theming'; import { useLayout } from '../layout/LayoutProvider'; import NotificationItem from './NotificationItem'; diff --git a/code/core/src/manager/components/panel/Panel.stories.tsx b/code/core/src/manager/components/panel/Panel.stories.tsx index 3caa6a3c0fb1..8a8e20ff5217 100644 --- a/code/core/src/manager/components/panel/Panel.stories.tsx +++ b/code/core/src/manager/components/panel/Panel.stories.tsx @@ -1,9 +1,10 @@ import type { EventHandler, FocusEvent, MouseEvent } from 'react'; import React, { useCallback, useRef, useState } from 'react'; -import { Badge, Spaced } from '@storybook/core/components'; -import type { Addon_BaseType, Addon_Collection } from '@storybook/core/types'; -import { Addon_TypesEnum } from '@storybook/core/types'; +import { Badge, Spaced } from 'storybook/internal/components'; +import type { Addon_BaseType, Addon_Collection } from 'storybook/internal/types'; +import { Addon_TypesEnum } from 'storybook/internal/types'; + import { BellIcon } from '@storybook/icons'; import { action } from '@storybook/addon-actions'; diff --git a/code/core/src/manager/components/panel/Panel.tsx b/code/core/src/manager/components/panel/Panel.tsx index dc80c20949d2..f0d1812324dc 100644 --- a/code/core/src/manager/components/panel/Panel.tsx +++ b/code/core/src/manager/components/panel/Panel.tsx @@ -1,12 +1,12 @@ import React, { Component } from 'react'; -import { EmptyTabContent, IconButton, Link, Tabs } from '@storybook/core/components'; -import { styled } from '@storybook/core/theming'; -import type { Addon_BaseType } from '@storybook/core/types'; -import { BottomBarIcon, CloseIcon, DocumentIcon, SidebarAltIcon } from '@storybook/icons'; +import { EmptyTabContent, IconButton, Link, Tabs } from 'storybook/internal/components'; +import type { State } from 'storybook/internal/manager-api'; +import { shortcutToHumanString } from 'storybook/internal/manager-api'; +import { styled } from 'storybook/internal/theming'; +import type { Addon_BaseType } from 'storybook/internal/types'; -import type { State } from '@storybook/core/manager-api'; -import { shortcutToHumanString } from '@storybook/core/manager-api'; +import { BottomBarIcon, CloseIcon, DocumentIcon, SidebarAltIcon } from '@storybook/icons'; import { useLayout } from '../layout/LayoutProvider'; diff --git a/code/core/src/manager/components/preview/FramesRenderer.tsx b/code/core/src/manager/components/preview/FramesRenderer.tsx index 40a42c3fbe98..748cbe6bb35f 100644 --- a/code/core/src/manager/components/preview/FramesRenderer.tsx +++ b/code/core/src/manager/components/preview/FramesRenderer.tsx @@ -1,12 +1,11 @@ import type { FC } from 'react'; import React, { Fragment, useRef } from 'react'; -import { Button, getStoryHref } from '@storybook/core/components'; -import { Global, styled } from '@storybook/core/theming'; -import type { CSSObject } from '@storybook/core/theming'; - -import type { Combo } from '@storybook/core/manager-api'; -import { Consumer } from '@storybook/core/manager-api'; +import { Button, getStoryHref } from 'storybook/internal/components'; +import type { Combo } from 'storybook/internal/manager-api'; +import { Consumer } from 'storybook/internal/manager-api'; +import { Global, styled } from 'storybook/internal/theming'; +import type { CSSObject } from 'storybook/internal/theming'; import { IFrame } from './Iframe'; import { stringifyQueryParams } from './utils/stringifyQueryParams'; diff --git a/code/core/src/manager/components/preview/Iframe.tsx b/code/core/src/manager/components/preview/Iframe.tsx index 13fd65261ec2..889986340f59 100644 --- a/code/core/src/manager/components/preview/Iframe.tsx +++ b/code/core/src/manager/components/preview/Iframe.tsx @@ -1,8 +1,8 @@ import type { IframeHTMLAttributes } from 'react'; import React from 'react'; -import { Zoom } from '@storybook/core/components'; -import { styled } from '@storybook/core/theming'; +import { Zoom } from 'storybook/internal/components'; +import { styled } from 'storybook/internal/theming'; const StyledIframe = styled.iframe(({ theme }) => ({ backgroundColor: theme.background.preview, diff --git a/code/core/src/manager/components/preview/Preview.tsx b/code/core/src/manager/components/preview/Preview.tsx index ed73a059951f..a7e30c379fef 100644 --- a/code/core/src/manager/components/preview/Preview.tsx +++ b/code/core/src/manager/components/preview/Preview.tsx @@ -1,12 +1,12 @@ import type { FC } from 'react'; import React, { Fragment, useEffect, useRef, useState } from 'react'; -import { Loader } from '@storybook/core/components'; -import type { Addon_BaseType, Addon_WrapperType } from '@storybook/core/types'; -import { global } from '@storybook/global'; +import { Loader } from 'storybook/internal/components'; +import { PREVIEW_BUILDER_PROGRESS, SET_CURRENT_STORY } from 'storybook/internal/core-events'; +import { type Combo, Consumer, addons, merge, types } from 'storybook/internal/manager-api'; +import type { Addon_BaseType, Addon_WrapperType } from 'storybook/internal/types'; -import { PREVIEW_BUILDER_PROGRESS, SET_CURRENT_STORY } from '@storybook/core/core-events'; -import { type Combo, Consumer, addons, merge, types } from '@storybook/core/manager-api'; +import { global } from '@storybook/global'; import { Helmet } from 'react-helmet-async'; diff --git a/code/core/src/manager/components/preview/Toolbar.tsx b/code/core/src/manager/components/preview/Toolbar.tsx index 05385487a804..36c3d4720f10 100644 --- a/code/core/src/manager/components/preview/Toolbar.tsx +++ b/code/core/src/manager/components/preview/Toolbar.tsx @@ -1,10 +1,6 @@ import React, { Fragment } from 'react'; -import { IconButton, Separator, TabBar, TabButton } from '@storybook/core/components'; -import { styled } from '@storybook/core/theming'; -import { type Addon_BaseType, Addon_TypesEnum } from '@storybook/core/types'; -import { CloseIcon, ExpandIcon } from '@storybook/icons'; - +import { IconButton, Separator, TabBar, TabButton } from 'storybook/internal/components'; import { type API, type Combo, @@ -15,7 +11,11 @@ import { merge, shortcutToHumanString, types, -} from '@storybook/core/manager-api'; +} from 'storybook/internal/manager-api'; +import { styled } from 'storybook/internal/theming'; +import { type Addon_BaseType, Addon_TypesEnum } from 'storybook/internal/types'; + +import { CloseIcon, ExpandIcon } from '@storybook/icons'; import { useLayout } from '../layout/LayoutProvider'; import { addonsTool } from './tools/addons'; diff --git a/code/core/src/manager/components/preview/Wrappers.tsx b/code/core/src/manager/components/preview/Wrappers.tsx index 299db428b1d9..c2bfa417441e 100644 --- a/code/core/src/manager/components/preview/Wrappers.tsx +++ b/code/core/src/manager/components/preview/Wrappers.tsx @@ -1,8 +1,8 @@ import type { FC, PropsWithChildren } from 'react'; import React, { Fragment } from 'react'; -import type { Addon_WrapperType } from '@storybook/core/types'; -import { Addon_TypesEnum } from '@storybook/core/types'; +import { Addon_TypesEnum } from 'storybook/internal/types'; +import type { Addon_WrapperType } from 'storybook/internal/types'; import { IframeWrapper } from './utils/components'; import type { ApplyWrappersProps } from './utils/types'; diff --git a/code/core/src/manager/components/preview/tools/addons.tsx b/code/core/src/manager/components/preview/tools/addons.tsx index 46d45f6eac07..50a08cbbf4ac 100644 --- a/code/core/src/manager/components/preview/tools/addons.tsx +++ b/code/core/src/manager/components/preview/tools/addons.tsx @@ -1,11 +1,11 @@ import React from 'react'; -import { IconButton } from '@storybook/core/components'; -import type { Addon_BaseType } from '@storybook/core/types'; -import { BottomBarIcon, SidebarAltIcon } from '@storybook/icons'; +import { IconButton } from 'storybook/internal/components'; +import { Consumer, types } from 'storybook/internal/manager-api'; +import type { Combo } from 'storybook/internal/manager-api'; +import type { Addon_BaseType } from 'storybook/internal/types'; -import { Consumer, types } from '@storybook/core/manager-api'; -import type { Combo } from '@storybook/core/manager-api'; +import { BottomBarIcon, SidebarAltIcon } from '@storybook/icons'; const menuMapper = ({ api, state }: Combo) => ({ isVisible: api.getIsPanelShown(), diff --git a/code/core/src/manager/components/preview/tools/copy.tsx b/code/core/src/manager/components/preview/tools/copy.tsx index adc36d1dac18..1b7683ee7c8f 100644 --- a/code/core/src/manager/components/preview/tools/copy.tsx +++ b/code/core/src/manager/components/preview/tools/copy.tsx @@ -1,13 +1,13 @@ import React from 'react'; -import { IconButton, getStoryHref } from '@storybook/core/components'; -import type { Addon_BaseType } from '@storybook/core/types'; +import { IconButton, getStoryHref } from 'storybook/internal/components'; +import { Consumer, types } from 'storybook/internal/manager-api'; +import type { Combo } from 'storybook/internal/manager-api'; +import type { Addon_BaseType } from 'storybook/internal/types'; + import { global } from '@storybook/global'; import { LinkIcon } from '@storybook/icons'; -import { Consumer, types } from '@storybook/core/manager-api'; -import type { Combo } from '@storybook/core/manager-api'; - import copy from 'copy-to-clipboard'; const { PREVIEW_URL, document } = global; diff --git a/code/core/src/manager/components/preview/tools/eject.tsx b/code/core/src/manager/components/preview/tools/eject.tsx index dda18c7db1f9..ddc2521d1bb8 100644 --- a/code/core/src/manager/components/preview/tools/eject.tsx +++ b/code/core/src/manager/components/preview/tools/eject.tsx @@ -1,13 +1,13 @@ import React from 'react'; -import { IconButton, getStoryHref } from '@storybook/core/components'; -import type { Addon_BaseType } from '@storybook/core/types'; +import { IconButton, getStoryHref } from 'storybook/internal/components'; +import { Consumer, types } from 'storybook/internal/manager-api'; +import type { Combo } from 'storybook/internal/manager-api'; +import type { Addon_BaseType } from 'storybook/internal/types'; + import { global } from '@storybook/global'; import { ShareAltIcon } from '@storybook/icons'; -import { Consumer, types } from '@storybook/core/manager-api'; -import type { Combo } from '@storybook/core/manager-api'; - const { PREVIEW_URL } = global; const ejectMapper = ({ state }: Combo) => { diff --git a/code/core/src/manager/components/preview/tools/menu.tsx b/code/core/src/manager/components/preview/tools/menu.tsx index f61f8955c541..b5dc0e9f2cbb 100644 --- a/code/core/src/manager/components/preview/tools/menu.tsx +++ b/code/core/src/manager/components/preview/tools/menu.tsx @@ -1,11 +1,11 @@ import React from 'react'; -import { IconButton, Separator } from '@storybook/core/components'; -import type { Addon_BaseType } from '@storybook/core/types'; -import { MenuIcon } from '@storybook/icons'; +import { IconButton, Separator } from 'storybook/internal/components'; +import { Consumer, types } from 'storybook/internal/manager-api'; +import type { Combo } from 'storybook/internal/manager-api'; +import type { Addon_BaseType } from 'storybook/internal/types'; -import { Consumer, types } from '@storybook/core/manager-api'; -import type { Combo } from '@storybook/core/manager-api'; +import { MenuIcon } from '@storybook/icons'; const menuMapper = ({ api, state }: Combo) => ({ isVisible: api.getIsNavShown(), diff --git a/code/core/src/manager/components/preview/tools/remount.tsx b/code/core/src/manager/components/preview/tools/remount.tsx index d6fcf7355ac2..c4595f7937b0 100644 --- a/code/core/src/manager/components/preview/tools/remount.tsx +++ b/code/core/src/manager/components/preview/tools/remount.tsx @@ -1,14 +1,14 @@ import type { ComponentProps } from 'react'; import React, { useState } from 'react'; -import { IconButton } from '@storybook/core/components'; -import { styled } from '@storybook/core/theming'; -import type { Addon_BaseType } from '@storybook/core/types'; -import { SyncIcon } from '@storybook/icons'; +import { IconButton } from 'storybook/internal/components'; +import { FORCE_REMOUNT } from 'storybook/internal/core-events'; +import { Consumer, types } from 'storybook/internal/manager-api'; +import type { Combo } from 'storybook/internal/manager-api'; +import { styled } from 'storybook/internal/theming'; +import type { Addon_BaseType } from 'storybook/internal/types'; -import { FORCE_REMOUNT } from '@storybook/core/core-events'; -import { Consumer, types } from '@storybook/core/manager-api'; -import type { Combo } from '@storybook/core/manager-api'; +import { SyncIcon } from '@storybook/icons'; interface AnimatedButtonProps { animating?: boolean; diff --git a/code/core/src/manager/components/preview/tools/zoom.tsx b/code/core/src/manager/components/preview/tools/zoom.tsx index aba59a2da272..c065675e3956 100644 --- a/code/core/src/manager/components/preview/tools/zoom.tsx +++ b/code/core/src/manager/components/preview/tools/zoom.tsx @@ -1,11 +1,11 @@ import type { MouseEventHandler, PropsWithChildren, SyntheticEvent } from 'react'; import React, { Component, createContext, memo, useCallback } from 'react'; -import { IconButton, Separator } from '@storybook/core/components'; -import type { Addon_BaseType } from '@storybook/core/types'; -import { ZoomIcon, ZoomOutIcon, ZoomResetIcon } from '@storybook/icons'; +import { IconButton, Separator } from 'storybook/internal/components'; +import { types } from 'storybook/internal/manager-api'; +import type { Addon_BaseType } from 'storybook/internal/types'; -import { types } from '@storybook/core/manager-api'; +import { ZoomIcon, ZoomOutIcon, ZoomResetIcon } from '@storybook/icons'; const initialZoom = 1 as const; diff --git a/code/core/src/manager/components/preview/utils/components.ts b/code/core/src/manager/components/preview/utils/components.ts index e38f44164e51..0c6c79a81879 100644 --- a/code/core/src/manager/components/preview/utils/components.ts +++ b/code/core/src/manager/components/preview/utils/components.ts @@ -1,5 +1,5 @@ -import { Link } from '@storybook/core/router'; -import { styled } from '@storybook/core/theming'; +import { Link } from 'storybook/internal/router'; +import { styled } from 'storybook/internal/theming'; export const PreviewContainer = styled.main({ display: 'flex', diff --git a/code/core/src/manager/components/preview/utils/types.tsx b/code/core/src/manager/components/preview/utils/types.tsx index 6c18cb6bdddc..831577be8f39 100644 --- a/code/core/src/manager/components/preview/utils/types.tsx +++ b/code/core/src/manager/components/preview/utils/types.tsx @@ -1,13 +1,12 @@ import type { ReactElement } from 'react'; +import type { API, LeafEntry, State } from 'storybook/internal/manager-api'; import type { API_ViewMode, Addon_BaseType, Addon_WrapperType, StoryId, -} from '@storybook/core/types'; - -import type { API, LeafEntry, State } from '@storybook/core/manager-api'; +} from 'storybook/internal/types'; export interface PreviewProps { api: API; diff --git a/code/core/src/manager/components/sidebar/Brand.tsx b/code/core/src/manager/components/sidebar/Brand.tsx index f4ca666e0579..31f685f1bbe8 100644 --- a/code/core/src/manager/components/sidebar/Brand.tsx +++ b/code/core/src/manager/components/sidebar/Brand.tsx @@ -1,7 +1,7 @@ import React from 'react'; -import { StorybookLogo } from '@storybook/core/components'; -import { styled, withTheme } from '@storybook/core/theming'; +import { StorybookLogo } from 'storybook/internal/components'; +import { styled, withTheme } from 'storybook/internal/theming'; export const StorybookLogoStyled = styled(StorybookLogo)(({ theme }) => ({ width: 'auto', diff --git a/code/core/src/manager/components/sidebar/ContextMenu.tsx b/code/core/src/manager/components/sidebar/ContextMenu.tsx index 3392c7674eed..399fe2fc81ec 100644 --- a/code/core/src/manager/components/sidebar/ContextMenu.tsx +++ b/code/core/src/manager/components/sidebar/ContextMenu.tsx @@ -1,14 +1,14 @@ import type { ComponentProps, FC, SyntheticEvent } from 'react'; import React, { useMemo, useState } from 'react'; -import { TooltipLinkList, WithTooltip } from '@storybook/core/components'; -import { styled } from '@storybook/core/theming'; -import { type API_HashEntry, Addon_TypesEnum } from '@storybook/core/types'; -import { EllipsisIcon } from '@storybook/icons'; +import { TooltipLinkList, WithTooltip } from 'storybook/internal/components'; +import { type TestProviders } from 'storybook/internal/core-events'; +import { useStorybookState } from 'storybook/internal/manager-api'; +import type { API } from 'storybook/internal/manager-api'; +import { styled } from 'storybook/internal/theming'; +import { type API_HashEntry, Addon_TypesEnum } from 'storybook/internal/types'; -import { type TestProviders } from '@storybook/core/core-events'; -import { useStorybookState } from '@storybook/core/manager-api'; -import type { API } from '@storybook/core/manager-api'; +import { EllipsisIcon } from '@storybook/icons'; import type { Link } from '../../../components/components/tooltip/TooltipLinkList'; import { StatusButton } from './StatusButton'; diff --git a/code/core/src/manager/components/sidebar/CreateNewStoryFileModal.tsx b/code/core/src/manager/components/sidebar/CreateNewStoryFileModal.tsx index 147727cfc0a3..930909efad82 100644 --- a/code/core/src/manager/components/sidebar/CreateNewStoryFileModal.tsx +++ b/code/core/src/manager/components/sidebar/CreateNewStoryFileModal.tsx @@ -1,7 +1,15 @@ import React, { useCallback, useDeferredValue, useEffect, useRef, useState } from 'react'; -import { CheckIcon } from '@storybook/icons'; - +import { + ARGTYPES_INFO_REQUEST, + ARGTYPES_INFO_RESPONSE, + CREATE_NEW_STORYFILE_REQUEST, + CREATE_NEW_STORYFILE_RESPONSE, + FILE_COMPONENT_SEARCH_REQUEST, + FILE_COMPONENT_SEARCH_RESPONSE, + SAVE_STORY_REQUEST, + SAVE_STORY_RESPONSE, +} from 'storybook/internal/core-events'; import type { ArgTypesRequestPayload, ArgTypesResponsePayload, @@ -14,19 +22,15 @@ import type { ResponseData, SaveStoryRequestPayload, SaveStoryResponsePayload, -} from '@storybook/core/core-events'; +} from 'storybook/internal/core-events'; +import type { RequestResponseError } from 'storybook/internal/manager-api'; import { - ARGTYPES_INFO_REQUEST, - ARGTYPES_INFO_RESPONSE, - CREATE_NEW_STORYFILE_REQUEST, - CREATE_NEW_STORYFILE_RESPONSE, - FILE_COMPONENT_SEARCH_REQUEST, - FILE_COMPONENT_SEARCH_RESPONSE, - SAVE_STORY_REQUEST, - SAVE_STORY_RESPONSE, -} from '@storybook/core/core-events'; -import type { RequestResponseError } from '@storybook/core/manager-api'; -import { addons, experimental_requestResponse, useStorybookApi } from '@storybook/core/manager-api'; + addons, + experimental_requestResponse, + useStorybookApi, +} from 'storybook/internal/manager-api'; + +import { CheckIcon } from '@storybook/icons'; import { useDebounce } from '../../hooks/useDebounce'; import type { NewStoryPayload, SearchResult } from './FileSearchList'; diff --git a/code/core/src/manager/components/sidebar/FileList.tsx b/code/core/src/manager/components/sidebar/FileList.tsx index bc2d46eee829..e07afd7f9aca 100644 --- a/code/core/src/manager/components/sidebar/FileList.tsx +++ b/code/core/src/manager/components/sidebar/FileList.tsx @@ -1,4 +1,4 @@ -import { styled } from '@storybook/core/theming'; +import { styled } from 'storybook/internal/theming'; import { rgba } from 'polished'; diff --git a/code/core/src/manager/components/sidebar/FileSearchList.tsx b/code/core/src/manager/components/sidebar/FileSearchList.tsx index 3a4eacbbf03c..bb3c80cb8039 100644 --- a/code/core/src/manager/components/sidebar/FileSearchList.tsx +++ b/code/core/src/manager/components/sidebar/FileSearchList.tsx @@ -1,13 +1,13 @@ import React, { memo, useCallback, useMemo, useState } from 'react'; -import { TooltipNote, WithTooltip } from '@storybook/core/components'; -import { styled } from '@storybook/core/theming'; -import { ChevronDownIcon, ChevronRightIcon, ComponentIcon } from '@storybook/icons'; - +import { TooltipNote, WithTooltip } from 'storybook/internal/components'; import type { CreateNewStoryRequestPayload, FileComponentSearchResponsePayload, -} from '@storybook/core/core-events'; +} from 'storybook/internal/core-events'; +import { styled } from 'storybook/internal/theming'; + +import { ChevronDownIcon, ChevronRightIcon, ComponentIcon } from '@storybook/icons'; import type { VirtualItem } from '@tanstack/react-virtual'; import { useVirtualizer } from '@tanstack/react-virtual'; diff --git a/code/core/src/manager/components/sidebar/FileSearchListSkeleton.tsx b/code/core/src/manager/components/sidebar/FileSearchListSkeleton.tsx index 33e6e0dd890b..cd789a158890 100644 --- a/code/core/src/manager/components/sidebar/FileSearchListSkeleton.tsx +++ b/code/core/src/manager/components/sidebar/FileSearchListSkeleton.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import { styled } from '@storybook/core/theming'; +import { styled } from 'storybook/internal/theming'; import { FileList, FileListItem } from './FileList'; diff --git a/code/core/src/manager/components/sidebar/FileSearchModal.tsx b/code/core/src/manager/components/sidebar/FileSearchModal.tsx index 043abffb5107..1a7cc6039633 100644 --- a/code/core/src/manager/components/sidebar/FileSearchModal.tsx +++ b/code/core/src/manager/components/sidebar/FileSearchModal.tsx @@ -1,7 +1,8 @@ import React, { useEffect, useState, useTransition } from 'react'; -import { Form, Modal } from '@storybook/core/components'; -import { styled } from '@storybook/core/theming'; +import { Form, Modal } from 'storybook/internal/components'; +import { styled } from 'storybook/internal/theming'; + import { CloseAltIcon, SearchIcon, SyncIcon } from '@storybook/icons'; import { useMeasure } from '../../hooks/useMeasure'; diff --git a/code/core/src/manager/components/sidebar/FilterToggle.tsx b/code/core/src/manager/components/sidebar/FilterToggle.tsx index a5d461fb1a21..5db4f3b6ff20 100644 --- a/code/core/src/manager/components/sidebar/FilterToggle.tsx +++ b/code/core/src/manager/components/sidebar/FilterToggle.tsx @@ -1,7 +1,7 @@ import React, { type ComponentProps } from 'react'; -import { Badge as BaseBadge, IconButton } from '@storybook/core/components'; -import { css, styled } from '@storybook/core/theming'; +import { Badge as BaseBadge, IconButton } from 'storybook/internal/components'; +import { css, styled } from 'storybook/internal/theming'; const Badge = styled(BaseBadge)(({ theme }) => ({ padding: '4px 8px', diff --git a/code/core/src/manager/components/sidebar/Heading.stories.tsx b/code/core/src/manager/components/sidebar/Heading.stories.tsx index 81436bfc0a1d..8e12d3eb7778 100644 --- a/code/core/src/manager/components/sidebar/Heading.stories.tsx +++ b/code/core/src/manager/components/sidebar/Heading.stories.tsx @@ -1,8 +1,9 @@ // @TODO: use addon-interactions and remove the rule disable above import React from 'react'; -import { ThemeProvider, useTheme } from '@storybook/core/theming'; -import type { Theme } from '@storybook/core/theming'; +import { ThemeProvider, useTheme } from 'storybook/internal/theming'; +import type { Theme } from 'storybook/internal/theming'; + import type { Meta, StoryFn, StoryObj } from '@storybook/react'; import { screen } from '@storybook/test'; diff --git a/code/core/src/manager/components/sidebar/Heading.tsx b/code/core/src/manager/components/sidebar/Heading.tsx index 905ae1f61081..567ad39c13a2 100644 --- a/code/core/src/manager/components/sidebar/Heading.tsx +++ b/code/core/src/manager/components/sidebar/Heading.tsx @@ -1,9 +1,9 @@ import type { ComponentProps, FC } from 'react'; import React from 'react'; -import { Button } from '@storybook/core/components'; -import { styled } from '@storybook/core/theming'; -import type { Addon_SidebarTopType } from '@storybook/core/types'; +import { Button } from 'storybook/internal/components'; +import { styled } from 'storybook/internal/theming'; +import type { Addon_SidebarTopType } from 'storybook/internal/types'; import { Brand } from './Brand'; import type { MenuList, SidebarMenuProps } from './Menu'; diff --git a/code/core/src/manager/components/sidebar/HighlightStyles.tsx b/code/core/src/manager/components/sidebar/HighlightStyles.tsx index 71f853666865..899aba271fdd 100644 --- a/code/core/src/manager/components/sidebar/HighlightStyles.tsx +++ b/code/core/src/manager/components/sidebar/HighlightStyles.tsx @@ -1,7 +1,7 @@ import type { FC } from 'react'; import React from 'react'; -import { Global } from '@storybook/core/theming'; +import { Global } from 'storybook/internal/theming'; import { transparentize } from 'polished'; diff --git a/code/core/src/manager/components/sidebar/IconSymbols.tsx b/code/core/src/manager/components/sidebar/IconSymbols.tsx index d33b357c18ac..ace76cd4a694 100644 --- a/code/core/src/manager/components/sidebar/IconSymbols.tsx +++ b/code/core/src/manager/components/sidebar/IconSymbols.tsx @@ -1,7 +1,7 @@ import type { FC } from 'react'; import React from 'react'; -import { styled } from '@storybook/core/theming'; +import { styled } from 'storybook/internal/theming'; const Svg = styled.svg` position: absolute; diff --git a/code/core/src/manager/components/sidebar/LegacyRender.tsx b/code/core/src/manager/components/sidebar/LegacyRender.tsx index 22b151c968ff..cbbf1f9b1d40 100644 --- a/code/core/src/manager/components/sidebar/LegacyRender.tsx +++ b/code/core/src/manager/components/sidebar/LegacyRender.tsx @@ -1,11 +1,11 @@ import React from 'react'; -import { Button, ProgressSpinner, TooltipNote, WithTooltip } from '@storybook/core/components'; -import { styled } from '@storybook/core/theming'; -import { EyeIcon, PlayHollowIcon, StopAltIcon } from '@storybook/icons'; +import { Button, ProgressSpinner, TooltipNote, WithTooltip } from 'storybook/internal/components'; +import type { TestProviders } from 'storybook/internal/core-events'; +import { useStorybookApi } from 'storybook/internal/manager-api'; +import { styled } from 'storybook/internal/theming'; -import type { TestProviders } from '@storybook/core/core-events'; -import { useStorybookApi } from '@storybook/core/manager-api'; +import { EyeIcon, PlayHollowIcon, StopAltIcon } from '@storybook/icons'; const Container = styled.div({ display: 'flex', diff --git a/code/core/src/manager/components/sidebar/Loader.tsx b/code/core/src/manager/components/sidebar/Loader.tsx index 66f3a3b0f70b..b38f26530dc3 100644 --- a/code/core/src/manager/components/sidebar/Loader.tsx +++ b/code/core/src/manager/components/sidebar/Loader.tsx @@ -1,7 +1,7 @@ import type { FC } from 'react'; import React, { Fragment } from 'react'; -import { styled } from '@storybook/core/theming'; +import { styled } from 'storybook/internal/theming'; const LOADER_SEQUENCE = [0, 0, 1, 1, 2, 3, 3, 3, 1, 1, 1, 2, 2, 2, 3]; diff --git a/code/core/src/manager/components/sidebar/Menu.stories.tsx b/code/core/src/manager/components/sidebar/Menu.stories.tsx index d5bf90dc2a60..858a04a2be98 100644 --- a/code/core/src/manager/components/sidebar/Menu.stories.tsx +++ b/code/core/src/manager/components/sidebar/Menu.stories.tsx @@ -1,13 +1,13 @@ import React from 'react'; -import { TooltipLinkList } from '@storybook/core/components'; -import { styled } from '@storybook/core/theming'; +import { TooltipLinkList } from 'storybook/internal/components'; +import type { State } from 'storybook/internal/manager-api'; +import { styled } from 'storybook/internal/theming'; + import { LinkIcon } from '@storybook/icons'; import type { Meta, StoryObj } from '@storybook/react'; import { expect, screen, userEvent, within } from '@storybook/test'; -import type { State } from '@storybook/core/manager-api'; - import { useMenu } from '../../container/Menu'; import { LayoutProvider } from '../layout/LayoutProvider'; import { type MenuList, SidebarMenu } from './Menu'; diff --git a/code/core/src/manager/components/sidebar/Menu.tsx b/code/core/src/manager/components/sidebar/Menu.tsx index aef385c2de1d..513d3a99e844 100644 --- a/code/core/src/manager/components/sidebar/Menu.tsx +++ b/code/core/src/manager/components/sidebar/Menu.tsx @@ -1,9 +1,10 @@ import type { ComponentProps, FC } from 'react'; import React, { useState } from 'react'; -import type { Button } from '@storybook/core/components'; -import { IconButton, TooltipLinkList, WithTooltip } from '@storybook/core/components'; -import { styled } from '@storybook/core/theming'; +import { IconButton, TooltipLinkList, WithTooltip } from 'storybook/internal/components'; +import type { Button } from 'storybook/internal/components'; +import { styled } from 'storybook/internal/theming'; + import { CloseIcon, CogIcon } from '@storybook/icons'; import { transparentize } from 'polished'; diff --git a/code/core/src/manager/components/sidebar/RefBlocks.tsx b/code/core/src/manager/components/sidebar/RefBlocks.tsx index 16af958a8a02..0df9c26c3ef4 100644 --- a/code/core/src/manager/components/sidebar/RefBlocks.tsx +++ b/code/core/src/manager/components/sidebar/RefBlocks.tsx @@ -1,13 +1,13 @@ import type { FC } from 'react'; import React, { Fragment, useCallback, useState } from 'react'; -import { Button, ErrorFormatter, Link, Spaced, WithTooltip } from '@storybook/core/components'; -import { styled } from '@storybook/core/theming'; +import { logger } from 'storybook/internal/client-logger'; +import { Button, ErrorFormatter, Link, Spaced, WithTooltip } from 'storybook/internal/components'; +import { styled } from 'storybook/internal/theming'; + import { global } from '@storybook/global'; import { ChevronDownIcon, LockIcon, SyncIcon } from '@storybook/icons'; -import { logger } from '@storybook/core/client-logger'; - import { Contained, Loader } from './Loader'; const { window: globalWindow } = global; diff --git a/code/core/src/manager/components/sidebar/RefIndicator.tsx b/code/core/src/manager/components/sidebar/RefIndicator.tsx index 2a2e54b37dfa..1bcf9f03ff48 100644 --- a/code/core/src/manager/components/sidebar/RefIndicator.tsx +++ b/code/core/src/manager/components/sidebar/RefIndicator.tsx @@ -1,9 +1,11 @@ import type { FC, MouseEventHandler } from 'react'; import React, { forwardRef, useCallback, useMemo } from 'react'; -import type { TooltipLinkListLink } from '@storybook/core/components'; -import { Spaced, TooltipLinkList, WithTooltip } from '@storybook/core/components'; -import { styled, useTheme } from '@storybook/core/theming'; +import type { TooltipLinkListLink } from 'storybook/internal/components'; +import { Spaced, TooltipLinkList, WithTooltip } from 'storybook/internal/components'; +import { useStorybookApi } from 'storybook/internal/manager-api'; +import { styled, useTheme } from 'storybook/internal/theming'; + import { global } from '@storybook/global'; import { AlertIcon, @@ -17,8 +19,6 @@ import { TimeIcon, } from '@storybook/icons'; -import { useStorybookApi } from '@storybook/core/manager-api'; - import { transparentize } from 'polished'; import type { NormalLink } from '../../../components/components/tooltip/TooltipLinkList'; diff --git a/code/core/src/manager/components/sidebar/Refs.stories.tsx b/code/core/src/manager/components/sidebar/Refs.stories.tsx index 3b6e37efce50..c137c252e116 100644 --- a/code/core/src/manager/components/sidebar/Refs.stories.tsx +++ b/code/core/src/manager/components/sidebar/Refs.stories.tsx @@ -1,8 +1,8 @@ import React from 'react'; -import { fn } from '@storybook/test'; +import { ManagerContext } from 'storybook/internal/manager-api'; -import { ManagerContext } from '@storybook/core/manager-api'; +import { fn } from '@storybook/test'; import { standardData as standardHeaderData } from './Heading.stories'; import { IconSymbols } from './IconSymbols'; diff --git a/code/core/src/manager/components/sidebar/Refs.tsx b/code/core/src/manager/components/sidebar/Refs.tsx index b4d2a79ca351..4aa26f53d382 100644 --- a/code/core/src/manager/components/sidebar/Refs.tsx +++ b/code/core/src/manager/components/sidebar/Refs.tsx @@ -1,10 +1,9 @@ import type { FC, MutableRefObject } from 'react'; import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'; -import { styled } from '@storybook/core/theming'; - -import type { State } from '@storybook/core/manager-api'; -import { useStorybookApi, useStorybookState } from '@storybook/core/manager-api'; +import type { State } from 'storybook/internal/manager-api'; +import { useStorybookApi, useStorybookState } from 'storybook/internal/manager-api'; +import { styled } from 'storybook/internal/theming'; import { transparentize } from 'polished'; diff --git a/code/core/src/manager/components/sidebar/Search.stories.tsx b/code/core/src/manager/components/sidebar/Search.stories.tsx index 1638f06b4dea..09a34d80dc8b 100644 --- a/code/core/src/manager/components/sidebar/Search.stories.tsx +++ b/code/core/src/manager/components/sidebar/Search.stories.tsx @@ -1,9 +1,9 @@ import React from 'react'; -import type { Meta, StoryFn } from '@storybook/react'; +import type { API } from 'storybook/internal/manager-api'; +import { ManagerContext } from 'storybook/internal/manager-api'; -import type { API } from '@storybook/core/manager-api'; -import { ManagerContext } from '@storybook/core/manager-api'; +import type { Meta, StoryFn } from '@storybook/react'; import { action } from '@storybook/addon-actions'; diff --git a/code/core/src/manager/components/sidebar/Search.tsx b/code/core/src/manager/components/sidebar/Search.tsx index 16a7ba0f151e..58868e56a0ba 100644 --- a/code/core/src/manager/components/sidebar/Search.tsx +++ b/code/core/src/manager/components/sidebar/Search.tsx @@ -1,12 +1,12 @@ import React, { type ReactNode, useCallback, useRef, useState } from 'react'; -import { IconButton } from '@storybook/core/components'; -import { styled } from '@storybook/core/theming'; +import { IconButton } from 'storybook/internal/components'; +import { shortcutToHumanString, useStorybookApi } from 'storybook/internal/manager-api'; +import { styled } from 'storybook/internal/theming'; + import { global } from '@storybook/global'; import { CloseIcon, SearchIcon } from '@storybook/icons'; -import { shortcutToHumanString, useStorybookApi } from '@storybook/core/manager-api'; - import type { DownshiftState, StateChangeOptions } from 'downshift'; import Downshift from 'downshift'; import type { FuseOptions } from 'fuse.js'; diff --git a/code/core/src/manager/components/sidebar/SearchResults.stories.tsx b/code/core/src/manager/components/sidebar/SearchResults.stories.tsx index 114f529bcd85..f243f7d3f897 100644 --- a/code/core/src/manager/components/sidebar/SearchResults.stories.tsx +++ b/code/core/src/manager/components/sidebar/SearchResults.stories.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import type { StoriesHash } from '@storybook/core/manager-api'; +import type { StoriesHash } from 'storybook/internal/manager-api'; import { searchItem } from '../../utils/tree'; import { IconSymbols } from './IconSymbols'; diff --git a/code/core/src/manager/components/sidebar/SearchResults.tsx b/code/core/src/manager/components/sidebar/SearchResults.tsx index b7689b7d64d0..432fad9445a1 100644 --- a/code/core/src/manager/components/sidebar/SearchResults.tsx +++ b/code/core/src/manager/components/sidebar/SearchResults.tsx @@ -1,14 +1,14 @@ import type { FC, MouseEventHandler, PropsWithChildren, ReactNode } from 'react'; import React, { useCallback, useEffect } from 'react'; -import { Button, IconButton } from '@storybook/core/components'; -import { styled } from '@storybook/core/theming'; +import { Button, IconButton } from 'storybook/internal/components'; +import { PRELOAD_ENTRIES } from 'storybook/internal/core-events'; +import { useStorybookApi } from 'storybook/internal/manager-api'; +import { styled } from 'storybook/internal/theming'; + import { global } from '@storybook/global'; import { TrashIcon } from '@storybook/icons'; -import { PRELOAD_ENTRIES } from '@storybook/core/core-events'; -import { useStorybookApi } from '@storybook/core/manager-api'; - import type { ControllerStateAndHelpers } from 'downshift'; import { transparentize } from 'polished'; diff --git a/code/core/src/manager/components/sidebar/Sidebar.stories.tsx b/code/core/src/manager/components/sidebar/Sidebar.stories.tsx index 0e2df01f6aed..973419fccc74 100644 --- a/code/core/src/manager/components/sidebar/Sidebar.stories.tsx +++ b/code/core/src/manager/components/sidebar/Sidebar.stories.tsx @@ -1,12 +1,12 @@ import React from 'react'; -import type { API_StatusState, Addon_SidebarTopType } from '@storybook/core/types'; +import type { IndexHash, State } from 'storybook/internal/manager-api'; +import { ManagerContext } from 'storybook/internal/manager-api'; +import type { API_StatusState, Addon_SidebarTopType } from 'storybook/internal/types'; + import type { Meta, StoryObj } from '@storybook/react'; import { expect, fn, userEvent, within } from '@storybook/test'; -import type { IndexHash, State } from '@storybook/core/manager-api'; -import { ManagerContext } from '@storybook/core/manager-api'; - import { LayoutProvider } from '../layout/LayoutProvider'; import { standardData as standardHeaderData } from './Heading.stories'; import { IconSymbols } from './IconSymbols'; diff --git a/code/core/src/manager/components/sidebar/Sidebar.tsx b/code/core/src/manager/components/sidebar/Sidebar.tsx index dfec7fba7826..3d94275baac1 100644 --- a/code/core/src/manager/components/sidebar/Sidebar.tsx +++ b/code/core/src/manager/components/sidebar/Sidebar.tsx @@ -6,14 +6,14 @@ import { Spaced, TooltipNote, WithTooltip, -} from '@storybook/core/components'; -import { styled } from '@storybook/core/theming'; -import type { API_LoadedRefData, Addon_SidebarTopType, StoryIndex } from '@storybook/core/types'; +} from 'storybook/internal/components'; +import { type State, useStorybookApi } from 'storybook/internal/manager-api'; +import { styled } from 'storybook/internal/theming'; +import type { API_LoadedRefData, Addon_SidebarTopType, StoryIndex } from 'storybook/internal/types'; + import { global } from '@storybook/global'; import { PlusIcon } from '@storybook/icons'; -import { type State, useStorybookApi } from '@storybook/core/manager-api'; - import { MEDIA_DESKTOP_BREAKPOINT } from '../../constants'; import { useLayout } from '../layout/LayoutProvider'; import { CreateNewStoryFileModal } from './CreateNewStoryFileModal'; diff --git a/code/core/src/manager/components/sidebar/SidebarBottom.stories.tsx b/code/core/src/manager/components/sidebar/SidebarBottom.stories.tsx index d8d0936d5f27..d7cc3e86e2e0 100644 --- a/code/core/src/manager/components/sidebar/SidebarBottom.stories.tsx +++ b/code/core/src/manager/components/sidebar/SidebarBottom.stories.tsx @@ -1,11 +1,11 @@ import React, { type FC, useEffect, useState } from 'react'; -import { Addon_TypesEnum } from '@storybook/core/types'; +import { type API, ManagerContext } from 'storybook/internal/manager-api'; +import { Addon_TypesEnum } from 'storybook/internal/types'; + import type { Meta, StoryObj } from '@storybook/react'; import { expect, fireEvent, fn, waitFor, within } from '@storybook/test'; -import { type API, ManagerContext } from '@storybook/core/manager-api'; - import { SidebarBottomBase } from './SidebarBottom'; const DynamicHeightDemo: FC = () => { diff --git a/code/core/src/manager/components/sidebar/SidebarBottom.tsx b/code/core/src/manager/components/sidebar/SidebarBottom.tsx index 00730fa36e5c..2016da4e055d 100644 --- a/code/core/src/manager/components/sidebar/SidebarBottom.tsx +++ b/code/core/src/manager/components/sidebar/SidebarBottom.tsx @@ -1,20 +1,19 @@ import React, { Fragment, useEffect, useLayoutEffect, useRef, useState } from 'react'; -import { styled } from '@storybook/core/theming'; -import { type API_FilterFunction } from '@storybook/core/types'; - import { TESTING_MODULE_CRASH_REPORT, TESTING_MODULE_PROGRESS_REPORT, type TestingModuleCrashReportPayload, type TestingModuleProgressReportPayload, -} from '@storybook/core/core-events'; +} from 'storybook/internal/core-events'; import { type API, type State, useStorybookApi, useStorybookState, -} from '@storybook/core/manager-api'; +} from 'storybook/internal/manager-api'; +import { styled } from 'storybook/internal/theming'; +import { type API_FilterFunction } from 'storybook/internal/types'; import { NotificationList } from '../notifications/NotificationList'; import { TestingModule } from './TestingModule'; diff --git a/code/core/src/manager/components/sidebar/StatusButton.tsx b/code/core/src/manager/components/sidebar/StatusButton.tsx index 8002cc87ba33..f490d5deecbe 100644 --- a/code/core/src/manager/components/sidebar/StatusButton.tsx +++ b/code/core/src/manager/components/sidebar/StatusButton.tsx @@ -1,5 +1,6 @@ -import { IconButton } from '@storybook/core/components'; -import { styled } from '@storybook/core/theming'; +import { IconButton } from 'storybook/internal/components'; +import { styled } from 'storybook/internal/theming'; + import type { API_StatusValue } from '@storybook/types'; import type { Theme } from '@emotion/react'; diff --git a/code/core/src/manager/components/sidebar/StatusContext.tsx b/code/core/src/manager/components/sidebar/StatusContext.tsx index 45d57611693c..a02e86325626 100644 --- a/code/core/src/manager/components/sidebar/StatusContext.tsx +++ b/code/core/src/manager/components/sidebar/StatusContext.tsx @@ -1,8 +1,8 @@ import { createContext, useContext } from 'react'; -import type { API_StatusObject, API_StatusState, API_StatusValue, StoryId } from '@storybook/types'; +import type { StoriesHash } from 'storybook/internal/manager-api'; -import type { StoriesHash } from '@storybook/core/manager-api'; +import type { API_StatusObject, API_StatusState, API_StatusValue, StoryId } from '@storybook/types'; import type { Item } from '../../container/Sidebar'; import { getDescendantIds } from '../../utils/tree'; diff --git a/code/core/src/manager/components/sidebar/TagsFilter.tsx b/code/core/src/manager/components/sidebar/TagsFilter.tsx index 02e71aa741e5..b077e331d4d1 100644 --- a/code/core/src/manager/components/sidebar/TagsFilter.tsx +++ b/code/core/src/manager/components/sidebar/TagsFilter.tsx @@ -1,12 +1,12 @@ import React, { useCallback, useEffect, useState } from 'react'; -import { Badge, IconButton, WithTooltip } from '@storybook/core/components'; -import { styled } from '@storybook/core/theming'; +import { Badge, IconButton, WithTooltip } from 'storybook/internal/components'; +import type { API } from 'storybook/internal/manager-api'; +import { styled } from 'storybook/internal/theming'; + import { FilterIcon } from '@storybook/icons'; import type { StoryIndex, Tag } from '@storybook/types'; -import type { API } from '@storybook/core/manager-api'; - import { TagsFilterPanel } from './TagsFilterPanel'; const TAGS_FILTER = 'tags-filter'; diff --git a/code/core/src/manager/components/sidebar/TagsFilterPanel.tsx b/code/core/src/manager/components/sidebar/TagsFilterPanel.tsx index d9fc85c360d0..c366f4c60394 100644 --- a/code/core/src/manager/components/sidebar/TagsFilterPanel.tsx +++ b/code/core/src/manager/components/sidebar/TagsFilterPanel.tsx @@ -1,12 +1,12 @@ import React from 'react'; -import { TooltipLinkList } from '@storybook/core/components'; -import { styled, useTheme } from '@storybook/core/theming'; +import { TooltipLinkList } from 'storybook/internal/components'; +import type { API } from 'storybook/internal/manager-api'; +import { styled, useTheme } from 'storybook/internal/theming'; + import { ShareAltIcon } from '@storybook/icons'; import type { Tag } from '@storybook/types'; -import type { API } from '@storybook/core/manager-api'; - import type { Link } from '../../../components/components/tooltip/TooltipLinkList'; const BUILT_IN_TAGS_SHOW = new Set(['play-fn']); diff --git a/code/core/src/manager/components/sidebar/TestingModule.stories.tsx b/code/core/src/manager/components/sidebar/TestingModule.stories.tsx index 66fd53c488a0..833d5eba92a9 100644 --- a/code/core/src/manager/components/sidebar/TestingModule.stories.tsx +++ b/code/core/src/manager/components/sidebar/TestingModule.stories.tsx @@ -1,14 +1,14 @@ import React from 'react'; -import type { Listener } from '@storybook/core/channels'; -import { styled } from '@storybook/core/theming'; -import { Addon_TypesEnum } from '@storybook/core/types'; +import type { Listener } from 'storybook/internal/channels'; +import { TESTING_MODULE_CONFIG_CHANGE, type TestProviders } from 'storybook/internal/core-events'; +import { ManagerContext, mockChannel } from 'storybook/internal/manager-api'; +import { styled } from 'storybook/internal/theming'; +import { Addon_TypesEnum } from 'storybook/internal/types'; + import type { Meta, StoryObj } from '@storybook/react'; import { fireEvent, fn } from '@storybook/test'; -import { TESTING_MODULE_CONFIG_CHANGE, type TestProviders } from '@storybook/core/core-events'; -import { ManagerContext, mockChannel } from '@storybook/core/manager-api'; - import { TestingModule } from './TestingModule'; const TestProvider = styled.div({ diff --git a/code/core/src/manager/components/sidebar/TestingModule.tsx b/code/core/src/manager/components/sidebar/TestingModule.tsx index 9fe95426e597..604251d903c4 100644 --- a/code/core/src/manager/components/sidebar/TestingModule.tsx +++ b/code/core/src/manager/components/sidebar/TestingModule.tsx @@ -1,12 +1,12 @@ import React, { type SyntheticEvent, useCallback, useEffect, useRef, useState } from 'react'; -import { Button, TooltipNote } from '@storybook/core/components'; -import { WithTooltip } from '@storybook/core/components'; -import { keyframes, styled } from '@storybook/core/theming'; -import { ChevronSmallUpIcon, PlayAllHollowIcon } from '@storybook/icons'; +import { Button, TooltipNote } from 'storybook/internal/components'; +import { WithTooltip } from 'storybook/internal/components'; +import { TESTING_MODULE_CONFIG_CHANGE, type TestProviders } from 'storybook/internal/core-events'; +import { useStorybookApi } from 'storybook/internal/manager-api'; +import { keyframes, styled } from 'storybook/internal/theming'; -import { TESTING_MODULE_CONFIG_CHANGE, type TestProviders } from '@storybook/core/core-events'; -import { useStorybookApi } from '@storybook/core/manager-api'; +import { ChevronSmallUpIcon, PlayAllHollowIcon } from '@storybook/icons'; import { LegacyRender } from './LegacyRender'; diff --git a/code/core/src/manager/components/sidebar/Tree.stories.tsx b/code/core/src/manager/components/sidebar/Tree.stories.tsx index baadd2e60fec..4b21d67bbe85 100644 --- a/code/core/src/manager/components/sidebar/Tree.stories.tsx +++ b/code/core/src/manager/components/sidebar/Tree.stories.tsx @@ -1,11 +1,15 @@ // @TODO: use addon-interactions and remove the rule disable above import React, { useState } from 'react'; +import { + type ComponentEntry, + type IndexHash, + ManagerContext, +} from 'storybook/internal/manager-api'; + import type { Meta, StoryObj } from '@storybook/react'; import { expect, fn, userEvent, within } from '@storybook/test'; -import { type ComponentEntry, type IndexHash, ManagerContext } from '@storybook/core/manager-api'; - import { action } from '@storybook/addon-actions'; import { DEFAULT_REF_ID } from './Sidebar'; diff --git a/code/core/src/manager/components/sidebar/Tree.tsx b/code/core/src/manager/components/sidebar/Tree.tsx index cbfc1e330be7..869e1161419c 100644 --- a/code/core/src/manager/components/sidebar/Tree.tsx +++ b/code/core/src/manager/components/sidebar/Tree.tsx @@ -1,9 +1,20 @@ import type { ComponentProps, FC, MutableRefObject } from 'react'; import React, { useCallback, useMemo, useRef } from 'react'; -import { Button, IconButton, ListItem } from '@storybook/core/components'; -import { styled, useTheme } from '@storybook/core/theming'; -import { type API_HashEntry, type API_StatusValue, type StoryId } from '@storybook/core/types'; +import { Button, IconButton, ListItem } from 'storybook/internal/components'; +import { PRELOAD_ENTRIES } from 'storybook/internal/core-events'; +import { useStorybookApi } from 'storybook/internal/manager-api'; +import type { + API, + ComponentEntry, + GroupEntry, + State, + StoriesHash, + StoryEntry, +} from 'storybook/internal/manager-api'; +import { styled, useTheme } from 'storybook/internal/theming'; +import { type API_HashEntry, type API_StatusValue, type StoryId } from 'storybook/internal/types'; + import { CollapseIcon as CollapseIconSvg, ExpandAltIcon, @@ -13,17 +24,6 @@ import { SyncIcon, } from '@storybook/icons'; -import { PRELOAD_ENTRIES } from '@storybook/core/core-events'; -import { useStorybookApi } from '@storybook/core/manager-api'; -import type { - API, - ComponentEntry, - GroupEntry, - State, - StoriesHash, - StoryEntry, -} from '@storybook/core/manager-api'; - import { darken, lighten } from 'polished'; import type { Link } from '../../../components/components/tooltip/TooltipLinkList'; diff --git a/code/core/src/manager/components/sidebar/TreeNode.tsx b/code/core/src/manager/components/sidebar/TreeNode.tsx index e0b23c2ef0a4..0335e9fdba32 100644 --- a/code/core/src/manager/components/sidebar/TreeNode.tsx +++ b/code/core/src/manager/components/sidebar/TreeNode.tsx @@ -1,7 +1,7 @@ import type { ComponentProps, FC } from 'react'; import React from 'react'; -import { styled } from '@storybook/core/theming'; +import { styled } from 'storybook/internal/theming'; import { transparentize } from 'polished'; diff --git a/code/core/src/manager/components/sidebar/__tests__/Sidebar.test.tsx b/code/core/src/manager/components/sidebar/__tests__/Sidebar.test.tsx index 0840be5fcd71..f6f8a1c3b9c1 100644 --- a/code/core/src/manager/components/sidebar/__tests__/Sidebar.test.tsx +++ b/code/core/src/manager/components/sidebar/__tests__/Sidebar.test.tsx @@ -5,11 +5,10 @@ import { afterEach, describe, expect, test } from 'vitest'; import React from 'react'; -import { ThemeProvider, ensure, themes } from '@storybook/core/theming'; -import type { Theme } from '@storybook/core/theming'; -import type { API_IndexHash } from '@storybook/core/types'; - -import type { HashEntry, Refs } from '@storybook/core/manager-api'; +import type { HashEntry, Refs } from 'storybook/internal/manager-api'; +import type { Theme } from 'storybook/internal/theming'; +import { ThemeProvider, ensure, themes } from 'storybook/internal/theming'; +import type { API_IndexHash } from 'storybook/internal/types'; import { Sidebar } from '../Sidebar'; import type { SidebarProps } from '../Sidebar'; diff --git a/code/core/src/manager/components/sidebar/components/CollapseIcon.tsx b/code/core/src/manager/components/sidebar/components/CollapseIcon.tsx index f4de9e9cd46b..42cb8e64cf44 100644 --- a/code/core/src/manager/components/sidebar/components/CollapseIcon.tsx +++ b/code/core/src/manager/components/sidebar/components/CollapseIcon.tsx @@ -1,7 +1,7 @@ import type { FC } from 'react'; import React from 'react'; -import { styled } from '@storybook/core/theming'; +import { styled } from 'storybook/internal/theming'; import { transparentize } from 'polished'; diff --git a/code/core/src/manager/components/sidebar/mockdata.ts b/code/core/src/manager/components/sidebar/mockdata.ts index e725ed7d451c..6d653c29ec99 100644 --- a/code/core/src/manager/components/sidebar/mockdata.ts +++ b/code/core/src/manager/components/sidebar/mockdata.ts @@ -1,4 +1,4 @@ -import type { API_HashEntry } from '@storybook/core/types'; +import type { API_HashEntry } from 'storybook/internal/types'; export type MockDataSet = Record>>; diff --git a/code/core/src/manager/components/sidebar/types.ts b/code/core/src/manager/components/sidebar/types.ts index abf0c686b374..0e50ac7661d6 100644 --- a/code/core/src/manager/components/sidebar/types.ts +++ b/code/core/src/manager/components/sidebar/types.ts @@ -1,6 +1,5 @@ -import type { API_StatusState, API_StatusValue } from '@storybook/core/types'; - -import type { State, StoriesHash } from '@storybook/core/manager-api'; +import type { State, StoriesHash } from 'storybook/internal/manager-api'; +import type { API_StatusState, API_StatusValue } from 'storybook/internal/types'; import type { ControllerStateAndHelpers } from 'downshift'; diff --git a/code/core/src/manager/components/sidebar/useExpanded.ts b/code/core/src/manager/components/sidebar/useExpanded.ts index e216c2b2e0cc..27e25a3d584e 100644 --- a/code/core/src/manager/components/sidebar/useExpanded.ts +++ b/code/core/src/manager/components/sidebar/useExpanded.ts @@ -1,11 +1,11 @@ import type { Dispatch, MutableRefObject, Reducer } from 'react'; import { useCallback, useEffect, useReducer } from 'react'; -import { global } from '@storybook/global'; +import { STORIES_COLLAPSE_ALL, STORIES_EXPAND_ALL } from 'storybook/internal/core-events'; +import type { StoriesHash } from 'storybook/internal/manager-api'; +import { useStorybookApi } from 'storybook/internal/manager-api'; -import { STORIES_COLLAPSE_ALL, STORIES_EXPAND_ALL } from '@storybook/core/core-events'; -import type { StoriesHash } from '@storybook/core/manager-api'; -import { useStorybookApi } from '@storybook/core/manager-api'; +import { global } from '@storybook/global'; import { throttle } from 'es-toolkit'; diff --git a/code/core/src/manager/components/sidebar/useHighlighted.ts b/code/core/src/manager/components/sidebar/useHighlighted.ts index 37701c7b1eec..a9b3e7876465 100644 --- a/code/core/src/manager/components/sidebar/useHighlighted.ts +++ b/code/core/src/manager/components/sidebar/useHighlighted.ts @@ -1,10 +1,10 @@ import type { Dispatch, MutableRefObject, RefObject, SetStateAction } from 'react'; import { useCallback, useEffect, useRef, useState } from 'react'; -import { global } from '@storybook/global'; +import { PRELOAD_ENTRIES } from 'storybook/internal/core-events'; +import { useStorybookApi } from 'storybook/internal/manager-api'; -import { PRELOAD_ENTRIES } from '@storybook/core/core-events'; -import { useStorybookApi } from '@storybook/core/manager-api'; +import { global } from '@storybook/global'; import { matchesKeyCode, matchesModifiers } from '../../keybinding'; import { cycle, isAncestor, scrollIntoView } from '../../utils/tree'; diff --git a/code/core/src/manager/components/upgrade/UpgradeBlock.stories.tsx b/code/core/src/manager/components/upgrade/UpgradeBlock.stories.tsx index 1ed8698aad0c..e882a41bf180 100644 --- a/code/core/src/manager/components/upgrade/UpgradeBlock.stories.tsx +++ b/code/core/src/manager/components/upgrade/UpgradeBlock.stories.tsx @@ -1,10 +1,10 @@ import React from 'react'; +import { ManagerContext } from 'storybook/internal/manager-api'; + import type { Meta, StoryObj } from '@storybook/react'; import { fn } from '@storybook/test'; -import { ManagerContext } from '@storybook/core/manager-api'; - import { UpgradeBlock } from './UpgradeBlock'; const meta = { diff --git a/code/core/src/manager/components/upgrade/UpgradeBlock.tsx b/code/core/src/manager/components/upgrade/UpgradeBlock.tsx index f7371abc2e63..77078b6cd031 100644 --- a/code/core/src/manager/components/upgrade/UpgradeBlock.tsx +++ b/code/core/src/manager/components/upgrade/UpgradeBlock.tsx @@ -1,10 +1,9 @@ import type { FC } from 'react'; import React, { useState } from 'react'; -import { Link } from '@storybook/core/components'; -import { styled } from '@storybook/core/theming'; - -import { useStorybookApi } from '@storybook/core/manager-api'; +import { Link } from 'storybook/internal/components'; +import { useStorybookApi } from 'storybook/internal/manager-api'; +import { styled } from 'storybook/internal/theming'; import { MEDIA_DESKTOP_BREAKPOINT } from '../../constants'; diff --git a/code/core/src/manager/container/Menu.stories.tsx b/code/core/src/manager/container/Menu.stories.tsx index 596042fb5a2f..c2633bb73df7 100644 --- a/code/core/src/manager/container/Menu.stories.tsx +++ b/code/core/src/manager/container/Menu.stories.tsx @@ -1,6 +1,7 @@ import React from 'react'; -import { TooltipLinkList, WithTooltip } from '@storybook/core/components'; +import { TooltipLinkList, WithTooltip } from 'storybook/internal/components'; + import type { Meta, StoryObj } from '@storybook/react'; import { action } from '@storybook/addon-actions'; diff --git a/code/core/src/manager/container/Menu.tsx b/code/core/src/manager/container/Menu.tsx index fdf21a2ab9a1..836461ab1144 100644 --- a/code/core/src/manager/container/Menu.tsx +++ b/code/core/src/manager/container/Menu.tsx @@ -1,13 +1,13 @@ import type { FC } from 'react'; import React, { useCallback, useMemo } from 'react'; -import { Badge } from '@storybook/core/components'; -import { styled, useTheme } from '@storybook/core/theming'; -import { CheckIcon, InfoIcon, ShareAltIcon, WandIcon } from '@storybook/icons'; +import { Badge } from 'storybook/internal/components'; +import { STORIES_COLLAPSE_ALL } from 'storybook/internal/core-events'; +import type { API, State } from 'storybook/internal/manager-api'; +import { shortcutToHumanString } from 'storybook/internal/manager-api'; +import { styled, useTheme } from 'storybook/internal/theming'; -import { STORIES_COLLAPSE_ALL } from '@storybook/core/core-events'; -import type { API, State } from '@storybook/core/manager-api'; -import { shortcutToHumanString } from '@storybook/core/manager-api'; +import { CheckIcon, InfoIcon, ShareAltIcon, WandIcon } from '@storybook/icons'; import type { Link } from '../../components/components/tooltip/TooltipLinkList'; diff --git a/code/core/src/manager/container/Notifications.tsx b/code/core/src/manager/container/Notifications.tsx index 3067bd8764b8..1e5a8217c74f 100644 --- a/code/core/src/manager/container/Notifications.tsx +++ b/code/core/src/manager/container/Notifications.tsx @@ -1,8 +1,8 @@ import type { FC } from 'react'; import React from 'react'; -import type { Combo } from '@storybook/core/manager-api'; -import { Consumer } from '@storybook/core/manager-api'; +import type { Combo } from 'storybook/internal/manager-api'; +import { Consumer } from 'storybook/internal/manager-api'; import { NotificationList } from '../components/notifications/NotificationList'; diff --git a/code/core/src/manager/container/Panel.tsx b/code/core/src/manager/container/Panel.tsx index f8cc2877cef0..e958919db71c 100644 --- a/code/core/src/manager/container/Panel.tsx +++ b/code/core/src/manager/container/Panel.tsx @@ -1,10 +1,9 @@ import type { FC } from 'react'; import React from 'react'; -import { Addon_TypesEnum } from '@storybook/core/types'; - -import { Consumer } from '@storybook/core/manager-api'; -import type { API, Combo } from '@storybook/core/manager-api'; +import { Consumer } from 'storybook/internal/manager-api'; +import type { API, Combo } from 'storybook/internal/manager-api'; +import { Addon_TypesEnum } from 'storybook/internal/types'; import memoize from 'memoizerific'; diff --git a/code/core/src/manager/container/Preview.tsx b/code/core/src/manager/container/Preview.tsx index fabda783bf64..3eb2a52a379a 100644 --- a/code/core/src/manager/container/Preview.tsx +++ b/code/core/src/manager/container/Preview.tsx @@ -1,12 +1,12 @@ import type { ComponentProps } from 'react'; import React from 'react'; -import type { Addon_BaseType, Addon_Collection, Addon_WrapperType } from '@storybook/core/types'; -import { Addon_TypesEnum } from '@storybook/core/types'; -import { global } from '@storybook/global'; +import type { State, StoriesHash } from 'storybook/internal/manager-api'; +import { Consumer } from 'storybook/internal/manager-api'; +import type { Addon_BaseType, Addon_Collection, Addon_WrapperType } from 'storybook/internal/types'; +import { Addon_TypesEnum } from 'storybook/internal/types'; -import type { State, StoriesHash } from '@storybook/core/manager-api'; -import { Consumer } from '@storybook/core/manager-api'; +import { global } from '@storybook/global'; import memoizerific from 'memoizerific'; diff --git a/code/core/src/manager/container/Sidebar.tsx b/code/core/src/manager/container/Sidebar.tsx index 723d9989ac10..f861aab60541 100755 --- a/code/core/src/manager/container/Sidebar.tsx +++ b/code/core/src/manager/container/Sidebar.tsx @@ -1,9 +1,8 @@ import React, { useMemo } from 'react'; -import { Addon_TypesEnum } from '@storybook/core/types'; - -import type { Combo, StoriesHash } from '@storybook/core/manager-api'; -import { Consumer } from '@storybook/core/manager-api'; +import type { Combo, StoriesHash } from 'storybook/internal/manager-api'; +import { Consumer } from 'storybook/internal/manager-api'; +import { Addon_TypesEnum } from 'storybook/internal/types'; import type { SidebarProps as SidebarComponentProps } from '../components/sidebar/Sidebar'; import { Sidebar as SidebarComponent } from '../components/sidebar/Sidebar'; diff --git a/code/core/src/manager/globals-runtime.ts b/code/core/src/manager/globals-runtime.ts index 7e4c07eccb28..b7e84377d22a 100644 --- a/code/core/src/manager/globals-runtime.ts +++ b/code/core/src/manager/globals-runtime.ts @@ -1,6 +1,6 @@ -import { global } from '@storybook/global'; +import { TELEMETRY_ERROR } from 'storybook/internal/core-events'; -import { TELEMETRY_ERROR } from '@storybook/core/core-events'; +import { global } from '@storybook/global'; import { globalPackages, globalsNameReferenceMap } from './globals/globals'; import { globalsNameValueMap } from './globals/runtime'; diff --git a/code/core/src/manager/globals/exports.ts b/code/core/src/manager/globals/exports.ts index e354ce120ffb..3d4bd8b826b3 100644 --- a/code/core/src/manager/globals/exports.ts +++ b/code/core/src/manager/globals/exports.ts @@ -439,77 +439,6 @@ export default { 'resetComponents', 'withReset', ], - '@storybook/core/components': [ - 'A', - 'ActionBar', - 'AddonPanel', - 'Badge', - 'Bar', - 'Blockquote', - 'Button', - 'ClipboardCode', - 'Code', - 'DL', - 'Div', - 'DocumentWrapper', - 'EmptyTabContent', - 'ErrorFormatter', - 'FlexBar', - 'Form', - 'H1', - 'H2', - 'H3', - 'H4', - 'H5', - 'H6', - 'HR', - 'IconButton', - 'IconButtonSkeleton', - 'Icons', - 'Img', - 'LI', - 'Link', - 'ListItem', - 'Loader', - 'Modal', - 'OL', - 'P', - 'Placeholder', - 'Pre', - 'ProgressSpinner', - 'ResetWrapper', - 'ScrollArea', - 'Separator', - 'Spaced', - 'Span', - 'StorybookIcon', - 'StorybookLogo', - 'Symbols', - 'SyntaxHighlighter', - 'TT', - 'TabBar', - 'TabButton', - 'TabWrapper', - 'Table', - 'Tabs', - 'TabsState', - 'TooltipLinkList', - 'TooltipMessage', - 'TooltipNote', - 'UL', - 'WithTooltip', - 'WithTooltipPure', - 'Zoom', - 'codeCommon', - 'components', - 'createCopyToClipboardFunction', - 'getStoryHref', - 'icons', - 'interleaveSeparators', - 'nameSpaceClassNames', - 'resetComponents', - 'withReset', - ], 'storybook/internal/manager-api': [ 'ActiveTabs', 'Consumer', @@ -578,40 +507,6 @@ export default { 'useStorybookApi', 'useStorybookState', ], - '@storybook/core/manager-api': [ - 'ActiveTabs', - 'Consumer', - 'ManagerContext', - 'Provider', - 'RequestResponseError', - 'addons', - 'combineParameters', - 'controlOrMetaKey', - 'controlOrMetaSymbol', - 'eventMatchesShortcut', - 'eventToShortcut', - 'experimental_requestResponse', - 'isMacLike', - 'isShortcutTaken', - 'keyToSymbol', - 'merge', - 'mockChannel', - 'optionOrAltSymbol', - 'shortcutMatchesShortcut', - 'shortcutToHumanString', - 'types', - 'useAddonState', - 'useArgTypes', - 'useArgs', - 'useChannel', - 'useGlobalTypes', - 'useGlobals', - 'useParameter', - 'useSharedState', - 'useStoryPrepared', - 'useStorybookApi', - 'useStorybookState', - ], 'storybook/internal/router': [ 'BaseLocationProvider', 'DEEPLY_EQUAL', @@ -644,22 +539,6 @@ export default { 'stringifyQuery', 'useNavigate', ], - '@storybook/core/router': [ - 'BaseLocationProvider', - 'DEEPLY_EQUAL', - 'Link', - 'Location', - 'LocationProvider', - 'Match', - 'Route', - 'buildArgsParam', - 'deepDiff', - 'getMatch', - 'parsePath', - 'queryFromLocation', - 'stringifyQuery', - 'useNavigate', - ], 'storybook/internal/theming': [ 'CacheProvider', 'ClassNames', @@ -712,35 +591,8 @@ export default { 'useTheme', 'withTheme', ], - '@storybook/core/theming': [ - 'CacheProvider', - 'ClassNames', - 'Global', - 'ThemeProvider', - 'background', - 'color', - 'convert', - 'create', - 'createCache', - 'createGlobal', - 'createReset', - 'css', - 'darken', - 'ensure', - 'ignoreSsrWarning', - 'isPropValid', - 'jsx', - 'keyframes', - 'lighten', - 'styled', - 'themes', - 'typography', - 'useTheme', - 'withTheme', - ], 'storybook/internal/theming/create': ['create', 'themes'], '@storybook/theming/create': ['create', 'themes'], - '@storybook/core/theming/create': ['create', 'themes'], 'storybook/internal/channels': [ 'Channel', 'PostMessageTransport', @@ -753,12 +605,6 @@ export default { 'WebsocketTransport', 'createBrowserChannel', ], - '@storybook/core/channels': [ - 'Channel', - 'PostMessageTransport', - 'WebsocketTransport', - 'createBrowserChannel', - ], 'storybook/internal/core-errors': [ 'ARGTYPES_INFO_REQUEST', 'ARGTYPES_INFO_RESPONSE', @@ -891,7 +737,7 @@ export default { 'UPDATE_QUERY_PARAMS', 'UPDATE_STORY_ARGS', ], - '@storybook/core/core-events': [ + 'storybook/internal/core-events': [ 'ARGTYPES_INFO_REQUEST', 'ARGTYPES_INFO_RESPONSE', 'CHANNEL_CREATED', @@ -959,7 +805,6 @@ export default { ], 'storybook/internal/types': ['Addon_TypesEnum'], '@storybook/types': ['Addon_TypesEnum'], - '@storybook/core/types': ['Addon_TypesEnum'], 'storybook/internal/manager-errors': [ 'Category', 'ProviderDoesNotExtendBaseProviderError', @@ -970,12 +815,6 @@ export default { 'ProviderDoesNotExtendBaseProviderError', 'UncaughtManagerError', ], - '@storybook/core/manager-errors': [ - 'Category', - 'ProviderDoesNotExtendBaseProviderError', - 'UncaughtManagerError', - ], 'storybook/internal/client-logger': ['deprecate', 'logger', 'once', 'pretty'], '@storybook/client-logger': ['deprecate', 'logger', 'once', 'pretty'], - '@storybook/core/client-logger': ['deprecate', 'logger', 'once', 'pretty'], } as const; diff --git a/code/core/src/manager/globals/globals.ts b/code/core/src/manager/globals/globals.ts index 3a7387c6e3bb..3279e57adab0 100644 --- a/code/core/src/manager/globals/globals.ts +++ b/code/core/src/manager/globals/globals.ts @@ -7,42 +7,33 @@ export const globalsNameReferenceMap = { 'storybook/internal/manager-api': '__STORYBOOK_API__', '@storybook/manager-api': '__STORYBOOK_API__', - '@storybook/core/manager-api': '__STORYBOOK_API__', 'storybook/internal/components': '__STORYBOOK_COMPONENTS__', '@storybook/components': '__STORYBOOK_COMPONENTS__', - '@storybook/core/components': '__STORYBOOK_COMPONENTS__', 'storybook/internal/channels': '__STORYBOOK_CHANNELS__', '@storybook/channels': '__STORYBOOK_CHANNELS__', - '@storybook/core/channels': '__STORYBOOK_CHANNELS__', 'storybook/internal/core-errors': '__STORYBOOK_CORE_EVENTS__', '@storybook/core-events': '__STORYBOOK_CORE_EVENTS__', - '@storybook/core/core-events': '__STORYBOOK_CORE_EVENTS__', + 'storybook/internal/core-events': '__STORYBOOK_CORE_EVENTS__', 'storybook/internal/manager-errors': '__STORYBOOK_CORE_EVENTS_MANAGER_ERRORS__', '@storybook/core-events/manager-errors': '__STORYBOOK_CORE_EVENTS_MANAGER_ERRORS__', - '@storybook/core/manager-errors': '__STORYBOOK_CORE_EVENTS_MANAGER_ERRORS__', 'storybook/internal/router': '__STORYBOOK_ROUTER__', '@storybook/router': '__STORYBOOK_ROUTER__', - '@storybook/core/router': '__STORYBOOK_ROUTER__', 'storybook/internal/theming': '__STORYBOOK_THEMING__', '@storybook/theming': '__STORYBOOK_THEMING__', - '@storybook/core/theming': '__STORYBOOK_THEMING__', 'storybook/internal/theming/create': '__STORYBOOK_THEMING_CREATE__', '@storybook/theming/create': '__STORYBOOK_THEMING_CREATE__', - '@storybook/core/theming/create': '__STORYBOOK_THEMING_CREATE__', 'storybook/internal/client-logger': '__STORYBOOK_CLIENT_LOGGER__', '@storybook/client-logger': '__STORYBOOK_CLIENT_LOGGER__', - '@storybook/core/client-logger': '__STORYBOOK_CLIENT_LOGGER__', 'storybook/internal/types': '__STORYBOOK_TYPES__', '@storybook/types': '__STORYBOOK_TYPES__', - '@storybook/core/types': '__STORYBOOK_TYPES__', } as const; export const globalPackages = Object.keys(globalsNameReferenceMap) as Array< diff --git a/code/core/src/manager/globals/runtime.ts b/code/core/src/manager/globals/runtime.ts index a52501db52cc..ce030147e6b5 100644 --- a/code/core/src/manager/globals/runtime.ts +++ b/code/core/src/manager/globals/runtime.ts @@ -2,18 +2,18 @@ import * as REACT from 'react'; import * as REACT_DOM from 'react-dom'; import * as REACT_DOM_CLIENT from 'react-dom/client'; -import * as CHANNELS from '@storybook/core/channels'; -import * as COMPONENTS from '@storybook/core/components'; -import * as ROUTER from '@storybook/core/router'; -import * as THEMING from '@storybook/core/theming'; -import * as THEMINGCREATE from '@storybook/core/theming/create'; -import * as TYPES from '@storybook/core/types'; -import * as ICONS from '@storybook/icons'; +import * as CHANNELS from 'storybook/internal/channels'; +import * as CLIENT_LOGGER from 'storybook/internal/client-logger'; +import * as COMPONENTS from 'storybook/internal/components'; +import * as EVENTS from 'storybook/internal/core-events'; +import * as MANAGER_API from 'storybook/internal/manager-api'; +import * as EVENTS_MANAGER_ERRORS from 'storybook/internal/manager-errors'; +import * as ROUTER from 'storybook/internal/router'; +import * as THEMING from 'storybook/internal/theming'; +import * as THEMINGCREATE from 'storybook/internal/theming/create'; +import * as TYPES from 'storybook/internal/types'; -import * as CLIENT_LOGGER from '@storybook/core/client-logger'; -import * as EVENTS from '@storybook/core/core-events'; -import * as MANAGER_API from '@storybook/core/manager-api'; -import * as EVENTS_MANAGER_ERRORS from '@storybook/core/manager-errors'; +import * as ICONS from '@storybook/icons'; import type { globalsNameReferenceMap } from './globals'; @@ -26,40 +26,31 @@ export const globalsNameValueMap: Required ({ display: 'flex', diff --git a/code/core/src/manager/settings/ShortcutsPage.tsx b/code/core/src/manager/settings/ShortcutsPage.tsx index ff7872d8df90..71f302dcba83 100644 --- a/code/core/src/manager/settings/ShortcutsPage.tsx +++ b/code/core/src/manager/settings/ShortcutsPage.tsx @@ -1,7 +1,7 @@ import type { FC } from 'react'; import React from 'react'; -import { Consumer } from '@storybook/core/manager-api'; +import { Consumer } from 'storybook/internal/manager-api'; import { ShortcutsScreen } from './shortcuts'; diff --git a/code/core/src/manager/settings/defaultShortcuts.tsx b/code/core/src/manager/settings/defaultShortcuts.tsx index ed8ad0fd9135..e17548756367 100644 --- a/code/core/src/manager/settings/defaultShortcuts.tsx +++ b/code/core/src/manager/settings/defaultShortcuts.tsx @@ -1,4 +1,4 @@ -import type { State } from '@storybook/core/manager-api'; +import type { State } from 'storybook/internal/manager-api'; export const defaultShortcuts: State['shortcuts'] = { fullScreen: ['F'], diff --git a/code/core/src/manager/settings/index.tsx b/code/core/src/manager/settings/index.tsx index d1cbb424ea4b..a16910e93927 100644 --- a/code/core/src/manager/settings/index.tsx +++ b/code/core/src/manager/settings/index.tsx @@ -1,15 +1,15 @@ import type { FC, SyntheticEvent } from 'react'; import React, { Fragment } from 'react'; -import { IconButton, ScrollArea, TabBar, TabButton } from '@storybook/core/components'; -import { Location, Route } from '@storybook/core/router'; -import { styled } from '@storybook/core/theming'; -import type { Addon_PageType } from '@storybook/core/types'; +import { IconButton, ScrollArea, TabBar, TabButton } from 'storybook/internal/components'; +import { types, useStorybookApi, useStorybookState } from 'storybook/internal/manager-api'; +import { Location, Route } from 'storybook/internal/router'; +import { styled } from 'storybook/internal/theming'; +import type { Addon_PageType } from 'storybook/internal/types'; + import { global } from '@storybook/global'; import { CloseIcon } from '@storybook/icons'; -import { types, useStorybookApi, useStorybookState } from '@storybook/core/manager-api'; - import { matchesKeyCode, matchesModifiers } from '../keybinding'; import { AboutPage } from './AboutPage'; import { ShortcutsPage } from './ShortcutsPage'; diff --git a/code/core/src/manager/settings/shortcuts.tsx b/code/core/src/manager/settings/shortcuts.tsx index 93a768774d18..c7c75e0a221d 100644 --- a/code/core/src/manager/settings/shortcuts.tsx +++ b/code/core/src/manager/settings/shortcuts.tsx @@ -1,15 +1,15 @@ import type { ComponentProps, FC } from 'react'; import React, { Component } from 'react'; -import { Button, Form } from '@storybook/core/components'; -import { keyframes, styled } from '@storybook/core/theming'; -import { CheckIcon } from '@storybook/icons'; - +import { Button, Form } from 'storybook/internal/components'; import { eventToShortcut, shortcutMatchesShortcut, shortcutToHumanString, -} from '@storybook/core/manager-api'; +} from 'storybook/internal/manager-api'; +import { keyframes, styled } from 'storybook/internal/theming'; + +import { CheckIcon } from '@storybook/icons'; import SettingsFooter from './SettingsFooter'; diff --git a/code/core/src/manager/settings/whats_new.tsx b/code/core/src/manager/settings/whats_new.tsx index 9132659e076e..b2510b0370d5 100644 --- a/code/core/src/manager/settings/whats_new.tsx +++ b/code/core/src/manager/settings/whats_new.tsx @@ -1,13 +1,13 @@ import type { ComponentProps, FC } from 'react'; import React, { Fragment, useEffect, useState } from 'react'; -import { Button, Loader } from '@storybook/core/components'; -import { styled, useTheme } from '@storybook/core/theming'; +import { Button, Loader } from 'storybook/internal/components'; +import { useStorybookApi, useStorybookState } from 'storybook/internal/manager-api'; +import { styled, useTheme } from 'storybook/internal/theming'; + import { global } from '@storybook/global'; import { AlertIcon as AlertIconSvg, EyeCloseIcon, EyeIcon, HeartIcon } from '@storybook/icons'; -import { useStorybookApi, useStorybookState } from '@storybook/core/manager-api'; - const Centered = styled.div({ top: '50%', position: 'absolute', diff --git a/code/core/src/manager/typings.d.ts b/code/core/src/manager/typings.d.ts index 3e6d261fb209..4394a90ece5e 100644 --- a/code/core/src/manager/typings.d.ts +++ b/code/core/src/manager/typings.d.ts @@ -7,7 +7,7 @@ declare var PREVIEW_URL: any; declare var __STORYBOOK_ADDONS_MANAGER: any; declare var RELEASE_NOTES_DATA: any; -declare var FEATURES: import('@storybook/core/types').StorybookConfigRaw['features']; +declare var FEATURES: import('storybook/internal/types').StorybookConfigRaw['features']; declare var REFS: any; declare var VERSIONCHECK: any; diff --git a/code/core/src/manager/utils/prepareForTelemetry.ts b/code/core/src/manager/utils/prepareForTelemetry.ts index ccbb8bf236ba..00cfdd35dd43 100644 --- a/code/core/src/manager/utils/prepareForTelemetry.ts +++ b/code/core/src/manager/utils/prepareForTelemetry.ts @@ -1,7 +1,7 @@ /* eslint-disable local-rules/no-uncategorized-errors */ -import { global } from '@storybook/global'; +import { UncaughtManagerError } from 'storybook/internal/manager-errors'; -import { UncaughtManagerError } from '@storybook/core/manager-errors'; +import { global } from '@storybook/global'; import type { BrowserInfo } from 'browser-dtector'; import BrowserDetector from 'browser-dtector'; diff --git a/code/core/src/manager/utils/status.tsx b/code/core/src/manager/utils/status.tsx index 14c2c6a613c5..674d9aef5578 100644 --- a/code/core/src/manager/utils/status.tsx +++ b/code/core/src/manager/utils/status.tsx @@ -1,8 +1,9 @@ import type { ReactElement } from 'react'; import React from 'react'; -import { styled } from '@storybook/core/theming'; -import type { API_HashEntry, API_StatusState, API_StatusValue } from '@storybook/core/types'; +import { styled } from 'storybook/internal/theming'; +import type { API_HashEntry, API_StatusState, API_StatusValue } from 'storybook/internal/types'; + import { CircleIcon } from '@storybook/icons'; import { UseSymbol } from '../components/sidebar/IconSymbols'; diff --git a/code/core/src/manager/utils/tree.ts b/code/core/src/manager/utils/tree.ts index dfe6dfb4cf24..671c616303e1 100644 --- a/code/core/src/manager/utils/tree.ts +++ b/code/core/src/manager/utils/tree.ts @@ -1,8 +1,8 @@ import type { SyntheticEvent } from 'react'; -import { global } from '@storybook/global'; +import type { HashEntry, IndexHash } from 'storybook/internal/manager-api'; -import type { HashEntry, IndexHash } from '@storybook/core/manager-api'; +import { global } from '@storybook/global'; import memoize from 'memoizerific'; diff --git a/code/core/src/node-logger/README.md b/code/core/src/node-logger/README.md index ffdc57aa50c5..008302c607e1 100644 --- a/code/core/src/node-logger/README.md +++ b/code/core/src/node-logger/README.md @@ -5,7 +5,7 @@ Any node logging that is done through storybook should be done through this pack Examples: ```js -import { logger } from '@storybook/core/node-logger'; +import { logger } from 'storybook/internal/node-logger'; logger.info('Info message'); logger.warn('Warning message'); diff --git a/code/core/src/preview-api/modules/addons/hooks.ts b/code/core/src/preview-api/modules/addons/hooks.ts index 1a6f3a7f9839..b0c2edaf2c9c 100644 --- a/code/core/src/preview-api/modules/addons/hooks.ts +++ b/code/core/src/preview-api/modules/addons/hooks.ts @@ -1,3 +1,11 @@ +import { logger } from 'storybook/internal/client-logger'; +import { + FORCE_RE_RENDER, + RESET_STORY_ARGS, + STORY_RENDERED, + UPDATE_GLOBALS, + UPDATE_STORY_ARGS, +} from 'storybook/internal/core-events'; import type { Args, DecoratorApplicator, @@ -6,17 +14,9 @@ import type { Renderer, StoryContext, StoryId, -} from '@storybook/core/types'; -import { global } from '@storybook/global'; +} from 'storybook/internal/types'; -import { logger } from '@storybook/core/client-logger'; -import { - FORCE_RE_RENDER, - RESET_STORY_ARGS, - STORY_RENDERED, - UPDATE_GLOBALS, - UPDATE_STORY_ARGS, -} from '@storybook/core/core-events'; +import { global } from '@storybook/global'; import { addons } from './main'; diff --git a/code/core/src/preview-api/modules/addons/main.ts b/code/core/src/preview-api/modules/addons/main.ts index f2012bab9f07..c1243e68aecd 100644 --- a/code/core/src/preview-api/modules/addons/main.ts +++ b/code/core/src/preview-api/modules/addons/main.ts @@ -1,4 +1,5 @@ -import type { Channel } from '@storybook/core/channels'; +import type { Channel } from 'storybook/internal/channels'; + import { global } from '@storybook/global'; import { mockChannel } from './storybook-channel-mock'; diff --git a/code/core/src/preview-api/modules/addons/make-decorator.test.ts b/code/core/src/preview-api/modules/addons/make-decorator.test.ts index d926c9f5da81..4519129c9e00 100644 --- a/code/core/src/preview-api/modules/addons/make-decorator.test.ts +++ b/code/core/src/preview-api/modules/addons/make-decorator.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it, vi } from 'vitest'; -import type { Addon_StoryContext } from '@storybook/core/types'; +import type { Addon_StoryContext } from 'storybook/internal/types'; import { makeDecorator } from './make-decorator'; diff --git a/code/core/src/preview-api/modules/addons/make-decorator.ts b/code/core/src/preview-api/modules/addons/make-decorator.ts index aa9bfb2a0c36..4cca6d63db66 100644 --- a/code/core/src/preview-api/modules/addons/make-decorator.ts +++ b/code/core/src/preview-api/modules/addons/make-decorator.ts @@ -2,7 +2,7 @@ import type { Addon_LegacyStoryFn, Addon_StoryContext, Addon_StoryWrapper, -} from '@storybook/core/types'; +} from 'storybook/internal/types'; export type MakeDecoratorResult = (...args: any) => any; diff --git a/code/core/src/preview-api/modules/addons/storybook-channel-mock.ts b/code/core/src/preview-api/modules/addons/storybook-channel-mock.ts index 2f8abbf20b5f..23fce7c5ff8a 100644 --- a/code/core/src/preview-api/modules/addons/storybook-channel-mock.ts +++ b/code/core/src/preview-api/modules/addons/storybook-channel-mock.ts @@ -1,4 +1,4 @@ -import { Channel } from '@storybook/core/channels'; +import { Channel } from 'storybook/internal/channels'; export function mockChannel() { const transport = { diff --git a/code/core/src/preview-api/modules/preview-web/Preview.tsx b/code/core/src/preview-api/modules/preview-web/Preview.tsx index e929d6749337..5500c6c863f9 100644 --- a/code/core/src/preview-api/modules/preview-web/Preview.tsx +++ b/code/core/src/preview-api/modules/preview-web/Preview.tsx @@ -1,29 +1,5 @@ -import type { Channel } from '@storybook/core/channels'; -import type { - Args, - Globals, - GlobalsUpdatedPayload, - ModuleImportFn, - PreparedStory, - ProjectAnnotations, - RenderContextCallbacks, - RenderToCanvas, - Renderer, - SetGlobalsPayload, - StoryId, - StoryIndex, - StoryRenderOptions, -} from '@storybook/core/types'; -import type { CleanupCallback } from '@storybook/csf'; -import { global } from '@storybook/global'; - -import { deprecate, logger } from '@storybook/core/client-logger'; -import type { - ArgTypesRequestPayload, - ArgTypesResponsePayload, - RequestData, - ResponseData, -} from '@storybook/core/core-events'; +import type { Channel } from 'storybook/internal/channels'; +import { deprecate, logger } from 'storybook/internal/client-logger'; import { ARGTYPES_INFO_REQUEST, ARGTYPES_INFO_RESPONSE, @@ -37,13 +13,37 @@ import { STORY_INDEX_INVALIDATED, UPDATE_GLOBALS, UPDATE_STORY_ARGS, -} from '@storybook/core/core-events'; +} from 'storybook/internal/core-events'; +import type { + ArgTypesRequestPayload, + ArgTypesResponsePayload, + RequestData, + ResponseData, +} from 'storybook/internal/core-events'; import { CalledPreviewMethodBeforeInitializationError, MissingRenderToCanvasError, StoryIndexFetchError, StoryStoreAccessedBeforeInitializationError, -} from '@storybook/core/preview-errors'; +} from 'storybook/internal/preview-errors'; +import type { + Args, + Globals, + GlobalsUpdatedPayload, + ModuleImportFn, + PreparedStory, + ProjectAnnotations, + RenderContextCallbacks, + RenderToCanvas, + Renderer, + SetGlobalsPayload, + StoryId, + StoryIndex, + StoryRenderOptions, +} from 'storybook/internal/types'; + +import type { CleanupCallback } from '@storybook/csf'; +import { global } from '@storybook/global'; import { StoryStore } from '../../store'; import { addons } from '../addons'; diff --git a/code/core/src/preview-api/modules/preview-web/PreviewWeb.integration.test.ts b/code/core/src/preview-api/modules/preview-web/PreviewWeb.integration.test.ts index 3a6c21dd7239..f5458e471d60 100644 --- a/code/core/src/preview-api/modules/preview-web/PreviewWeb.integration.test.ts +++ b/code/core/src/preview-api/modules/preview-web/PreviewWeb.integration.test.ts @@ -3,7 +3,8 @@ import { beforeEach, describe, expect, it, vi } from 'vitest'; import React from 'react'; -import type { RenderContext } from '@storybook/core/types'; +import type { RenderContext } from 'storybook/internal/types'; + import { global } from '@storybook/global'; import { addons } from '../addons'; @@ -24,9 +25,9 @@ import { WebView } from './WebView'; // - ie. from`renderToCanvas()` (stories) or`ReactDOM.render()` (docs) in. // This file lets them rip. -vi.mock('@storybook/core/channels', async (importOriginal) => { +vi.mock('storybook/internal/channels', async (importOriginal) => { return { - ...(await importOriginal()), + ...(await importOriginal()), createBrowserChannel: () => mockChannel, }; }); @@ -39,24 +40,24 @@ vi.mock('@storybook/blocks', async () => { HeadersMdx: vi.fn(() => 'HeadersMdx'), }; }); -vi.mock('@storybook/core/client-logger'); -vi.mock('@storybook/core/components'); +vi.mock('storybook/internal/client-logger'); +vi.mock('storybook/internal/components'); -vi.mock('@storybook/core/channels', async (importOriginal) => { +vi.mock('storybook/internal/channels', async (importOriginal) => { return { - ...(await importOriginal()), + ...(await importOriginal()), createBrowserChannel: () => mockChannel, }; }); -vi.mock('@storybook/core/client-logger', async (importOriginal) => { +vi.mock('storybook/internal/client-logger', async (importOriginal) => { return { - ...(await importOriginal()), + ...(await importOriginal()), createBrowserChannel: () => mockChannel, }; }); -vi.mock('@storybook/core/components', async (importOriginal) => { +vi.mock('storybook/internal/components', async (importOriginal) => { return { - ...(await importOriginal()), + ...(await importOriginal()), createBrowserChannel: () => mockChannel, }; }); diff --git a/code/core/src/preview-api/modules/preview-web/PreviewWeb.mockdata.ts b/code/core/src/preview-api/modules/preview-web/PreviewWeb.mockdata.ts index 2ed2352ae4e7..64ae00dfc9cd 100644 --- a/code/core/src/preview-api/modules/preview-web/PreviewWeb.mockdata.ts +++ b/code/core/src/preview-api/modules/preview-web/PreviewWeb.mockdata.ts @@ -1,14 +1,6 @@ import type { Mock, Mocked } from 'vitest'; import { vi } from 'vitest'; -import type { - ModuleImportFn, - ProjectAnnotations, - Renderer, - StoryIndex, - TeardownRenderToCanvas, -} from '@storybook/core/types'; - import { DOCS_RENDERED, STORY_ERRORED, @@ -16,7 +8,14 @@ import { STORY_MISSING, STORY_RENDER_PHASE_CHANGED, STORY_THREW_EXCEPTION, -} from '@storybook/core/core-events'; +} from 'storybook/internal/core-events'; +import type { + ModuleImportFn, + ProjectAnnotations, + Renderer, + StoryIndex, + TeardownRenderToCanvas, +} from 'storybook/internal/types'; import { EventEmitter } from 'events'; diff --git a/code/core/src/preview-api/modules/preview-web/PreviewWeb.test.ts b/code/core/src/preview-api/modules/preview-web/PreviewWeb.test.ts index 57e3b0357a44..511a54022281 100644 --- a/code/core/src/preview-api/modules/preview-web/PreviewWeb.test.ts +++ b/code/core/src/preview-api/modules/preview-web/PreviewWeb.test.ts @@ -1,10 +1,7 @@ // @vitest-environment happy-dom import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; -import type { ModuleImportFn, ProjectAnnotations, Renderer } from '@storybook/core/types'; -import { global } from '@storybook/global'; - -import { logger } from '@storybook/core/client-logger'; +import { logger } from 'storybook/internal/client-logger'; import { CONFIG_ERROR, CURRENT_STORY_WAS_SET, @@ -29,7 +26,10 @@ import { STORY_UNCHANGED, UPDATE_GLOBALS, UPDATE_STORY_ARGS, -} from '@storybook/core/core-events'; +} from 'storybook/internal/core-events'; +import type { ModuleImportFn, ProjectAnnotations, Renderer } from 'storybook/internal/types'; + +import { global } from '@storybook/global'; import { merge, toMerged } from 'es-toolkit'; @@ -74,7 +74,7 @@ vi.mock('@storybook/global', async (importOriginal) => ({ }, })); -vi.mock('@storybook/core/client-logger'); +vi.mock('storybook/internal/client-logger'); vi.mock('react-dom'); vi.mock('./WebView'); diff --git a/code/core/src/preview-api/modules/preview-web/PreviewWeb.tsx b/code/core/src/preview-api/modules/preview-web/PreviewWeb.tsx index cb2931350b91..04d6dc2156f3 100644 --- a/code/core/src/preview-api/modules/preview-web/PreviewWeb.tsx +++ b/code/core/src/preview-api/modules/preview-web/PreviewWeb.tsx @@ -1,6 +1,7 @@ /* eslint-disable no-underscore-dangle */ -import type { Renderer } from '@storybook/core/types'; -import type { ModuleImportFn, ProjectAnnotations } from '@storybook/core/types'; +import type { ModuleImportFn, ProjectAnnotations } from 'storybook/internal/types'; +import type { Renderer } from 'storybook/internal/types'; + import { global } from '@storybook/global'; import type { MaybePromise } from './Preview'; diff --git a/code/core/src/preview-api/modules/preview-web/PreviewWithSelection.tsx b/code/core/src/preview-api/modules/preview-web/PreviewWithSelection.tsx index 7534ddea6fb3..2650fb799e31 100644 --- a/code/core/src/preview-api/modules/preview-web/PreviewWithSelection.tsx +++ b/code/core/src/preview-api/modules/preview-web/PreviewWithSelection.tsx @@ -1,8 +1,4 @@ -import type { DocsIndexEntry, StoryIndex } from '@storybook/core/types'; -import type { Args, Globals, Renderer, StoryId, ViewMode } from '@storybook/core/types'; -import type { ModuleImportFn, ProjectAnnotations } from '@storybook/core/types'; - -import { logger } from '@storybook/core/client-logger'; +import { logger } from 'storybook/internal/client-logger'; import { CURRENT_STORY_WAS_SET, DOCS_PREPARED, @@ -19,13 +15,16 @@ import { STORY_THREW_EXCEPTION, STORY_UNCHANGED, UPDATE_QUERY_PARAMS, -} from '@storybook/core/core-events'; +} from 'storybook/internal/core-events'; import { CalledPreviewMethodBeforeInitializationError, EmptyIndexError, MdxFileWithNoCsfReferencesError, NoStoryMatchError, -} from '@storybook/core/preview-errors'; +} from 'storybook/internal/preview-errors'; +import type { DocsIndexEntry, StoryIndex } from 'storybook/internal/types'; +import type { Args, Globals, Renderer, StoryId, ViewMode } from 'storybook/internal/types'; +import type { ModuleImportFn, ProjectAnnotations } from 'storybook/internal/types'; import invariant from 'tiny-invariant'; diff --git a/code/core/src/preview-api/modules/preview-web/SelectionStore.ts b/code/core/src/preview-api/modules/preview-web/SelectionStore.ts index 7d56f5bf586c..34d61520f2d4 100644 --- a/code/core/src/preview-api/modules/preview-web/SelectionStore.ts +++ b/code/core/src/preview-api/modules/preview-web/SelectionStore.ts @@ -1,4 +1,4 @@ -import type { Args, StoryId, ViewMode } from '@storybook/core/types'; +import type { Args, StoryId, ViewMode } from 'storybook/internal/types'; import type { StorySpecifier } from '../store/StoryIndexStore'; diff --git a/code/core/src/preview-api/modules/preview-web/UrlStore.ts b/code/core/src/preview-api/modules/preview-web/UrlStore.ts index c4a68c17decb..aca027c9561e 100644 --- a/code/core/src/preview-api/modules/preview-web/UrlStore.ts +++ b/code/core/src/preview-api/modules/preview-web/UrlStore.ts @@ -1,4 +1,5 @@ -import type { ViewMode } from '@storybook/core/types'; +import type { ViewMode } from 'storybook/internal/types'; + import { global } from '@storybook/global'; import { parse, stringify } from 'picoquery'; diff --git a/code/core/src/preview-api/modules/preview-web/View.ts b/code/core/src/preview-api/modules/preview-web/View.ts index bc5e42c35de6..e2c6d473d544 100644 --- a/code/core/src/preview-api/modules/preview-web/View.ts +++ b/code/core/src/preview-api/modules/preview-web/View.ts @@ -1,4 +1,4 @@ -import type { PreparedStory } from '@storybook/core/types'; +import type { PreparedStory } from 'storybook/internal/types'; export interface View { // Get ready to render a story, returning the element to render to diff --git a/code/core/src/preview-api/modules/preview-web/WebView.ts b/code/core/src/preview-api/modules/preview-web/WebView.ts index 90b0d23dce7b..a4d864ce27b7 100644 --- a/code/core/src/preview-api/modules/preview-web/WebView.ts +++ b/code/core/src/preview-api/modules/preview-web/WebView.ts @@ -1,7 +1,7 @@ -import type { PreparedStory } from '@storybook/core/types'; -import { global } from '@storybook/global'; +import { logger } from 'storybook/internal/client-logger'; +import type { PreparedStory } from 'storybook/internal/types'; -import { logger } from '@storybook/core/client-logger'; +import { global } from '@storybook/global'; import AnsiToHtml from 'ansi-to-html'; import { parse } from 'picoquery'; diff --git a/code/core/src/preview-api/modules/preview-web/docs-context/DocsContext.test.ts b/code/core/src/preview-api/modules/preview-web/docs-context/DocsContext.test.ts index f79da3152f0e..736cc763ad2e 100644 --- a/code/core/src/preview-api/modules/preview-web/docs-context/DocsContext.test.ts +++ b/code/core/src/preview-api/modules/preview-web/docs-context/DocsContext.test.ts @@ -1,7 +1,7 @@ import { describe, expect, it, vi } from 'vitest'; -import { Channel } from '@storybook/core/channels'; -import type { CSFFile, Renderer } from '@storybook/core/types'; +import { Channel } from 'storybook/internal/channels'; +import type { CSFFile, Renderer } from 'storybook/internal/types'; import type { StoryStore } from '../../store'; import { DocsContext } from './DocsContext'; diff --git a/code/core/src/preview-api/modules/preview-web/docs-context/DocsContext.ts b/code/core/src/preview-api/modules/preview-web/docs-context/DocsContext.ts index 6e39643859db..67220db1beaa 100644 --- a/code/core/src/preview-api/modules/preview-web/docs-context/DocsContext.ts +++ b/code/core/src/preview-api/modules/preview-web/docs-context/DocsContext.ts @@ -1,4 +1,4 @@ -import type { Channel } from '@storybook/core/channels'; +import type { Channel } from 'storybook/internal/channels'; import type { CSFFile, ModuleExport, @@ -9,7 +9,7 @@ import type { ResolvedModuleExportType, StoryId, StoryName, -} from '@storybook/core/types'; +} from 'storybook/internal/types'; import { dedent } from 'ts-dedent'; diff --git a/code/core/src/preview-api/modules/preview-web/docs-context/DocsContextProps.ts b/code/core/src/preview-api/modules/preview-web/docs-context/DocsContextProps.ts index f5d8f5694f90..01d1d2560aea 100644 --- a/code/core/src/preview-api/modules/preview-web/docs-context/DocsContextProps.ts +++ b/code/core/src/preview-api/modules/preview-web/docs-context/DocsContextProps.ts @@ -1 +1 @@ -export type { DocsContextProps } from '@storybook/core/types'; +export type { DocsContextProps } from 'storybook/internal/types'; diff --git a/code/core/src/preview-api/modules/preview-web/docs-context/DocsRenderFunction.ts b/code/core/src/preview-api/modules/preview-web/docs-context/DocsRenderFunction.ts index ab7b3818de61..8619ec6c65d2 100644 --- a/code/core/src/preview-api/modules/preview-web/docs-context/DocsRenderFunction.ts +++ b/code/core/src/preview-api/modules/preview-web/docs-context/DocsRenderFunction.ts @@ -1 +1 @@ -export type { DocsRenderFunction } from '@storybook/core/types'; +export type { DocsRenderFunction } from 'storybook/internal/types'; diff --git a/code/core/src/preview-api/modules/preview-web/docs-context/test-utils.ts b/code/core/src/preview-api/modules/preview-web/docs-context/test-utils.ts index 24c7bd4aae95..af0a6836388e 100644 --- a/code/core/src/preview-api/modules/preview-web/docs-context/test-utils.ts +++ b/code/core/src/preview-api/modules/preview-web/docs-context/test-utils.ts @@ -1,4 +1,4 @@ -import type { CSFFile, PreparedStory } from '@storybook/core/types'; +import type { CSFFile, PreparedStory } from 'storybook/internal/types'; export function csfFileParts(storyId = 'meta--story', metaId = 'meta') { // These compose the raw exports of the CSF file diff --git a/code/core/src/preview-api/modules/preview-web/index.ts b/code/core/src/preview-api/modules/preview-web/index.ts index 3a490866bf74..ffc0e9ab5718 100644 --- a/code/core/src/preview-api/modules/preview-web/index.ts +++ b/code/core/src/preview-api/modules/preview-web/index.ts @@ -1,6 +1,6 @@ // FIXME: breaks builder-vite, remove this in 7.0 export { composeConfigs } from '../../store'; -export type { ProjectAnnotations as WebProjectAnnotations } from '@storybook/core/types'; +export type { ProjectAnnotations as WebProjectAnnotations } from 'storybook/internal/types'; export { Preview } from './Preview'; export { PreviewWeb } from './PreviewWeb'; diff --git a/code/core/src/preview-api/modules/preview-web/parseArgsParam.test.ts b/code/core/src/preview-api/modules/preview-web/parseArgsParam.test.ts index 7b8da7118702..252b9f7618ed 100644 --- a/code/core/src/preview-api/modules/preview-web/parseArgsParam.test.ts +++ b/code/core/src/preview-api/modules/preview-web/parseArgsParam.test.ts @@ -2,7 +2,7 @@ import { describe, expect, it, vi } from 'vitest'; import { parseArgsParam } from './parseArgsParam'; -vi.mock('@storybook/core/client-logger', () => ({ +vi.mock('storybook/internal/client-logger', () => ({ once: { warn: vi.fn() }, })); diff --git a/code/core/src/preview-api/modules/preview-web/parseArgsParam.ts b/code/core/src/preview-api/modules/preview-web/parseArgsParam.ts index 06d1cd5320be..380c272478d0 100644 --- a/code/core/src/preview-api/modules/preview-web/parseArgsParam.ts +++ b/code/core/src/preview-api/modules/preview-web/parseArgsParam.ts @@ -1,6 +1,5 @@ -import type { Args } from '@storybook/core/types'; - -import { once } from '@storybook/core/client-logger'; +import { once } from 'storybook/internal/client-logger'; +import type { Args } from 'storybook/internal/types'; import { isPlainObject } from 'es-toolkit'; import { type Options, parse } from 'picoquery'; diff --git a/code/core/src/preview-api/modules/preview-web/render/CsfDocsRender.test.ts b/code/core/src/preview-api/modules/preview-web/render/CsfDocsRender.test.ts index aa428572219c..f3a7bea795a4 100644 --- a/code/core/src/preview-api/modules/preview-web/render/CsfDocsRender.test.ts +++ b/code/core/src/preview-api/modules/preview-web/render/CsfDocsRender.test.ts @@ -1,7 +1,7 @@ import { expect, it, vi } from 'vitest'; -import { Channel } from '@storybook/core/channels'; -import type { DocsIndexEntry, RenderContextCallbacks, Renderer } from '@storybook/core/types'; +import { Channel } from 'storybook/internal/channels'; +import type { DocsIndexEntry, RenderContextCallbacks, Renderer } from 'storybook/internal/types'; import type { StoryStore } from '../../store'; import { csfFileParts } from '../docs-context/test-utils'; diff --git a/code/core/src/preview-api/modules/preview-web/render/CsfDocsRender.ts b/code/core/src/preview-api/modules/preview-web/render/CsfDocsRender.ts index 6c13338e501f..22e4fab67dbf 100644 --- a/code/core/src/preview-api/modules/preview-web/render/CsfDocsRender.ts +++ b/code/core/src/preview-api/modules/preview-web/render/CsfDocsRender.ts @@ -1,10 +1,9 @@ -import type { Channel } from '@storybook/core/channels'; -import type { Renderer, StoryId } from '@storybook/core/types'; -import type { CSFFile, PreparedStory } from '@storybook/core/types'; -import type { IndexEntry } from '@storybook/core/types'; -import type { RenderContextCallbacks } from '@storybook/core/types'; - -import { DOCS_RENDERED } from '@storybook/core/core-events'; +import type { Channel } from 'storybook/internal/channels'; +import { DOCS_RENDERED } from 'storybook/internal/core-events'; +import type { Renderer, StoryId } from 'storybook/internal/types'; +import type { CSFFile, PreparedStory } from 'storybook/internal/types'; +import type { IndexEntry } from 'storybook/internal/types'; +import type { RenderContextCallbacks } from 'storybook/internal/types'; import type { StoryStore } from '../../../store'; import { DocsContext } from '../docs-context/DocsContext'; diff --git a/code/core/src/preview-api/modules/preview-web/render/MdxDocsRender.test.ts b/code/core/src/preview-api/modules/preview-web/render/MdxDocsRender.test.ts index 86a172013e9d..6526af86ac08 100644 --- a/code/core/src/preview-api/modules/preview-web/render/MdxDocsRender.test.ts +++ b/code/core/src/preview-api/modules/preview-web/render/MdxDocsRender.test.ts @@ -1,7 +1,7 @@ import { describe, expect, it, vi } from 'vitest'; -import { Channel } from '@storybook/core/channels'; -import type { DocsIndexEntry, RenderContextCallbacks, Renderer } from '@storybook/core/types'; +import { Channel } from 'storybook/internal/channels'; +import type { DocsIndexEntry, RenderContextCallbacks, Renderer } from 'storybook/internal/types'; import type { StoryStore } from '../../store'; import { csfFileParts } from '../docs-context/test-utils'; diff --git a/code/core/src/preview-api/modules/preview-web/render/MdxDocsRender.ts b/code/core/src/preview-api/modules/preview-web/render/MdxDocsRender.ts index a2ef97411b79..f87c034cd621 100644 --- a/code/core/src/preview-api/modules/preview-web/render/MdxDocsRender.ts +++ b/code/core/src/preview-api/modules/preview-web/render/MdxDocsRender.ts @@ -1,10 +1,9 @@ -import type { Channel } from '@storybook/core/channels'; -import type { Renderer, StoryId } from '@storybook/core/types'; -import type { CSFFile, ModuleExports } from '@storybook/core/types'; -import type { IndexEntry } from '@storybook/core/types'; -import type { RenderContextCallbacks } from '@storybook/core/types'; - -import { DOCS_RENDERED } from '@storybook/core/core-events'; +import type { Channel } from 'storybook/internal/channels'; +import { DOCS_RENDERED } from 'storybook/internal/core-events'; +import type { Renderer, StoryId } from 'storybook/internal/types'; +import type { CSFFile, ModuleExports } from 'storybook/internal/types'; +import type { IndexEntry } from 'storybook/internal/types'; +import type { RenderContextCallbacks } from 'storybook/internal/types'; import type { StoryStore } from '../../store'; import { DocsContext } from '../docs-context/DocsContext'; diff --git a/code/core/src/preview-api/modules/preview-web/render/Render.ts b/code/core/src/preview-api/modules/preview-web/render/Render.ts index 71f91fc7b5be..3e23efdab165 100644 --- a/code/core/src/preview-api/modules/preview-web/render/Render.ts +++ b/code/core/src/preview-api/modules/preview-web/render/Render.ts @@ -1,5 +1,5 @@ -import type { Renderer, StoryId } from '@storybook/core/types'; -import type { StoryRenderOptions } from '@storybook/core/types'; +import type { Renderer, StoryId } from 'storybook/internal/types'; +import type { StoryRenderOptions } from 'storybook/internal/types'; export type RenderType = 'story' | 'docs'; diff --git a/code/core/src/preview-api/modules/preview-web/render/StoryRender.test.ts b/code/core/src/preview-api/modules/preview-web/render/StoryRender.test.ts index 41fdea4b6771..b7cab8141bf3 100644 --- a/code/core/src/preview-api/modules/preview-web/render/StoryRender.test.ts +++ b/code/core/src/preview-api/modules/preview-web/render/StoryRender.test.ts @@ -1,10 +1,14 @@ // @vitest-environment happy-dom import { beforeEach, describe, expect, it, vi } from 'vitest'; +import { Channel } from 'storybook/internal/channels'; import { STORY_FINISHED } from 'storybook/internal/core-events'; - -import { Channel } from '@storybook/core/channels'; -import type { PreparedStory, Renderer, StoryContext, StoryIndexEntry } from '@storybook/core/types'; +import type { + PreparedStory, + Renderer, + StoryContext, + StoryIndexEntry, +} from 'storybook/internal/types'; import { ReporterAPI, type StoryStore } from '../../store'; import { PREPARE_ABORTED } from './Render'; diff --git a/code/core/src/preview-api/modules/preview-web/render/StoryRender.ts b/code/core/src/preview-api/modules/preview-web/render/StoryRender.ts index 0eacdf7e7551..353e0774ecf3 100644 --- a/code/core/src/preview-api/modules/preview-web/render/StoryRender.ts +++ b/code/core/src/preview-api/modules/preview-web/render/StoryRender.ts @@ -1,4 +1,16 @@ -import type { Channel } from '@storybook/core/channels'; +import type { Channel } from 'storybook/internal/channels'; +import { + PLAY_FUNCTION_THREW_EXCEPTION, + STORY_FINISHED, + STORY_RENDERED, + STORY_RENDER_PHASE_CHANGED, + type StoryFinishedPayload, + UNHANDLED_ERRORS_WHILE_PLAYING, +} from 'storybook/internal/core-events'; +import { + MountMustBeDestructuredError, + NoStoryMountedError, +} from 'storybook/internal/preview-errors'; import type { Canvas, PreparedStory, @@ -10,17 +22,7 @@ import type { StoryId, StoryRenderOptions, TeardownRenderToCanvas, -} from '@storybook/core/types'; - -import { - PLAY_FUNCTION_THREW_EXCEPTION, - STORY_FINISHED, - STORY_RENDERED, - STORY_RENDER_PHASE_CHANGED, - type StoryFinishedPayload, - UNHANDLED_ERRORS_WHILE_PLAYING, -} from '@storybook/core/core-events'; -import { MountMustBeDestructuredError, NoStoryMountedError } from '@storybook/core/preview-errors'; +} from 'storybook/internal/types'; import type { StoryStore } from '../../store'; import type { Render, RenderType } from './Render'; diff --git a/code/core/src/preview-api/modules/preview-web/render/mount-utils.ts b/code/core/src/preview-api/modules/preview-web/render/mount-utils.ts index 00510d0f5edb..fbf4e353ce6f 100644 --- a/code/core/src/preview-api/modules/preview-web/render/mount-utils.ts +++ b/code/core/src/preview-api/modules/preview-web/render/mount-utils.ts @@ -1,6 +1,6 @@ // Inspired by Vitest fixture implementation: // https://github.com/vitest-dev/vitest/blob/200a4349a2f85686bc7005dce686d9d1b48b84d2/packages/runner/src/fixture.ts -import { type PreparedStory, type Renderer } from '@storybook/core/types'; +import { type PreparedStory, type Renderer } from 'storybook/internal/types'; export function mountDestructured( playFunction: PreparedStory['playFunction'] diff --git a/code/core/src/preview-api/modules/store/ArgsStore.test.ts b/code/core/src/preview-api/modules/store/ArgsStore.test.ts index ad3d20c7664d..03bc52f27a80 100644 --- a/code/core/src/preview-api/modules/store/ArgsStore.test.ts +++ b/code/core/src/preview-api/modules/store/ArgsStore.test.ts @@ -2,7 +2,7 @@ import { describe, expect, it, vi } from 'vitest'; import { ArgsStore } from './ArgsStore'; -vi.mock('@storybook/core/client-logger'); +vi.mock('storybook/internal/client-logger'); const stringType = { type: { name: 'string' } }; const booleanType = { type: { name: 'boolean' } }; diff --git a/code/core/src/preview-api/modules/store/ArgsStore.ts b/code/core/src/preview-api/modules/store/ArgsStore.ts index da613e76dc81..c4b353431e80 100644 --- a/code/core/src/preview-api/modules/store/ArgsStore.ts +++ b/code/core/src/preview-api/modules/store/ArgsStore.ts @@ -1,5 +1,5 @@ -import type { Args, StoryId } from '@storybook/core/types'; -import type { PreparedStory } from '@storybook/core/types'; +import type { PreparedStory } from 'storybook/internal/types'; +import type { Args, StoryId } from 'storybook/internal/types'; import { DEEPLY_EQUAL, combineArgs, deepDiff, mapArgsToTypes, validateOptions } from './args'; diff --git a/code/core/src/preview-api/modules/store/GlobalsStore.test.ts b/code/core/src/preview-api/modules/store/GlobalsStore.test.ts index eda822e40c64..8a5ed12aa697 100644 --- a/code/core/src/preview-api/modules/store/GlobalsStore.test.ts +++ b/code/core/src/preview-api/modules/store/GlobalsStore.test.ts @@ -2,7 +2,7 @@ import { describe, expect, it, vi } from 'vitest'; import { GlobalsStore } from './GlobalsStore'; -vi.mock('@storybook/core/client-logger', () => ({ +vi.mock('storybook/internal/client-logger', () => ({ logger: { warn: vi.fn(), }, diff --git a/code/core/src/preview-api/modules/store/GlobalsStore.ts b/code/core/src/preview-api/modules/store/GlobalsStore.ts index dd15417d9143..6e9a0e9bd381 100644 --- a/code/core/src/preview-api/modules/store/GlobalsStore.ts +++ b/code/core/src/preview-api/modules/store/GlobalsStore.ts @@ -1,6 +1,5 @@ -import type { GlobalTypes, Globals } from '@storybook/core/types'; - -import { logger } from '@storybook/core/client-logger'; +import { logger } from 'storybook/internal/client-logger'; +import type { GlobalTypes, Globals } from 'storybook/internal/types'; import { DEEPLY_EQUAL, deepDiff } from './args'; import { getValuesFromArgTypes } from './csf/getValuesFromArgTypes'; diff --git a/code/core/src/preview-api/modules/store/StoryIndexStore.test.ts b/code/core/src/preview-api/modules/store/StoryIndexStore.test.ts index 1cfdd553ea33..e28a63b8533d 100644 --- a/code/core/src/preview-api/modules/store/StoryIndexStore.test.ts +++ b/code/core/src/preview-api/modules/store/StoryIndexStore.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it, vi } from 'vitest'; -import type { StoryIndex } from '@storybook/core/types'; +import type { StoryIndex } from 'storybook/internal/types'; import { StoryIndexStore } from './StoryIndexStore'; diff --git a/code/core/src/preview-api/modules/store/StoryIndexStore.ts b/code/core/src/preview-api/modules/store/StoryIndexStore.ts index d6812e736f5f..d9dfa82c4716 100644 --- a/code/core/src/preview-api/modules/store/StoryIndexStore.ts +++ b/code/core/src/preview-api/modules/store/StoryIndexStore.ts @@ -1,7 +1,6 @@ -import type { ComponentTitle, Path, StoryId, StoryName } from '@storybook/core/types'; -import type { IndexEntry, StoryIndex } from '@storybook/core/types'; - -import { MissingStoryAfterHmrError } from '@storybook/core/preview-errors'; +import { MissingStoryAfterHmrError } from 'storybook/internal/preview-errors'; +import type { ComponentTitle, Path, StoryId, StoryName } from 'storybook/internal/types'; +import type { IndexEntry, StoryIndex } from 'storybook/internal/types'; import memoize from 'memoizerific'; diff --git a/code/core/src/preview-api/modules/store/StoryStore.test.ts b/code/core/src/preview-api/modules/store/StoryStore.test.ts index b28638960727..f2a5920db8d9 100644 --- a/code/core/src/preview-api/modules/store/StoryStore.test.ts +++ b/code/core/src/preview-api/modules/store/StoryStore.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it, vi } from 'vitest'; -import type { ProjectAnnotations, Renderer, StoryIndex } from '@storybook/core/types'; +import type { ProjectAnnotations, Renderer, StoryIndex } from 'storybook/internal/types'; import { StoryStore } from './StoryStore'; import { composeConfigs } from './csf/composeConfigs'; @@ -28,7 +28,7 @@ vi.mock('@storybook/global', async (importOriginal) => ({ }, })); -vi.mock('@storybook/core/client-logger'); +vi.mock('storybook/internal/client-logger'); const componentOneExports = { default: { title: 'Component One' }, diff --git a/code/core/src/preview-api/modules/store/StoryStore.ts b/code/core/src/preview-api/modules/store/StoryStore.ts index 01404a5f1bf5..efb0f9e393b8 100644 --- a/code/core/src/preview-api/modules/store/StoryStore.ts +++ b/code/core/src/preview-api/modules/store/StoryStore.ts @@ -1,3 +1,8 @@ +import { deprecate } from 'storybook/internal/client-logger'; +import { + CalledExtractOnStoreError, + MissingStoryFromCsfFileError, +} from 'storybook/internal/preview-errors'; import type { ComponentTitle, Parameters, @@ -6,7 +11,7 @@ import type { StoryContext, StoryContextForEnhancers, StoryId, -} from '@storybook/core/types'; +} from 'storybook/internal/types'; import type { BoundStory, CSFFile, @@ -16,20 +21,15 @@ import type { PreparedMeta, PreparedStory, ProjectAnnotations, -} from '@storybook/core/types'; +} from 'storybook/internal/types'; import type { IndexEntry, StoryIndex, StoryIndexV3, V3CompatIndexEntry, -} from '@storybook/core/types'; -import type { Canvas, CleanupCallback } from '@storybook/csf'; +} from 'storybook/internal/types'; -import { deprecate } from '@storybook/core/client-logger'; -import { - CalledExtractOnStoreError, - MissingStoryFromCsfFileError, -} from '@storybook/core/preview-errors'; +import type { Canvas, CleanupCallback } from '@storybook/csf'; import { mapValues, omitBy, pick, toMerged } from 'es-toolkit'; import memoize from 'memoizerific'; diff --git a/code/core/src/preview-api/modules/store/args.test.ts b/code/core/src/preview-api/modules/store/args.test.ts index d40d989cebc7..1180386429ed 100644 --- a/code/core/src/preview-api/modules/store/args.test.ts +++ b/code/core/src/preview-api/modules/store/args.test.ts @@ -1,8 +1,7 @@ import { describe, expect, it, vi } from 'vitest'; -import type { SBType } from '@storybook/core/types'; - -import { once } from '@storybook/core/client-logger'; +import { once } from 'storybook/internal/client-logger'; +import type { SBType } from 'storybook/internal/types'; import { UNTARGETED, @@ -20,7 +19,7 @@ const functionType: SBType = { name: 'function' }; const numArrayType: SBType = { name: 'array', value: numberType }; const boolObjectType: SBType = { name: 'object', value: { bool: booleanType } }; -vi.mock('@storybook/core/client-logger'); +vi.mock('storybook/internal/client-logger'); enum ArgsMapTestEnumWithoutInitializer { EnumValue, diff --git a/code/core/src/preview-api/modules/store/args.ts b/code/core/src/preview-api/modules/store/args.ts index 145ccdfbc620..9a8c7394ffb0 100644 --- a/code/core/src/preview-api/modules/store/args.ts +++ b/code/core/src/preview-api/modules/store/args.ts @@ -1,3 +1,4 @@ +import { once } from 'storybook/internal/client-logger'; import type { ArgTypes, Args, @@ -5,9 +6,7 @@ import type { Renderer, SBType, StoryContext, -} from '@storybook/core/types'; - -import { once } from '@storybook/core/client-logger'; +} from 'storybook/internal/types'; import { isEqual as deepEqual, isPlainObject } from 'es-toolkit'; import { dedent } from 'ts-dedent'; diff --git a/code/core/src/preview-api/modules/store/autoTitle.test.ts b/code/core/src/preview-api/modules/store/autoTitle.test.ts index 3289261dd8bc..1c5deac9b8c3 100644 --- a/code/core/src/preview-api/modules/store/autoTitle.test.ts +++ b/code/core/src/preview-api/modules/store/autoTitle.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from 'vitest'; -import { normalizeStoriesEntry } from '@storybook/core/common'; +import { normalizeStoriesEntry } from 'storybook/internal/common'; import { userOrAutoTitleFromSpecifier as userOrAuto } from './autoTitle'; diff --git a/code/core/src/preview-api/modules/store/autoTitle.ts b/code/core/src/preview-api/modules/store/autoTitle.ts index c8c23e2ca36a..c74e7c165757 100644 --- a/code/core/src/preview-api/modules/store/autoTitle.ts +++ b/code/core/src/preview-api/modules/store/autoTitle.ts @@ -1,6 +1,5 @@ -import type { NormalizedStoriesSpecifier } from '@storybook/core/types'; - -import { once } from '@storybook/core/client-logger'; +import { once } from 'storybook/internal/client-logger'; +import type { NormalizedStoriesSpecifier } from 'storybook/internal/types'; import slash from 'slash'; import { dedent } from 'ts-dedent'; diff --git a/code/core/src/preview-api/modules/store/csf/composeConfigs.ts b/code/core/src/preview-api/modules/store/csf/composeConfigs.ts index e5ba4f731b83..c36b2aab124c 100644 --- a/code/core/src/preview-api/modules/store/csf/composeConfigs.ts +++ b/code/core/src/preview-api/modules/store/csf/composeConfigs.ts @@ -1,5 +1,6 @@ -import type { ModuleExports, NormalizedProjectAnnotations } from '@storybook/core/types'; -import type { Renderer } from '@storybook/core/types'; +import type { ModuleExports, NormalizedProjectAnnotations } from 'storybook/internal/types'; +import type { Renderer } from 'storybook/internal/types'; + import { global } from '@storybook/global'; import { combineParameters } from '../parameters'; diff --git a/code/core/src/preview-api/modules/store/csf/getValuesFromArgTypes.ts b/code/core/src/preview-api/modules/store/csf/getValuesFromArgTypes.ts index ff3f124872b8..a69a7062b8c6 100644 --- a/code/core/src/preview-api/modules/store/csf/getValuesFromArgTypes.ts +++ b/code/core/src/preview-api/modules/store/csf/getValuesFromArgTypes.ts @@ -1,4 +1,4 @@ -import type { ArgTypes } from '@storybook/core/types'; +import type { ArgTypes } from 'storybook/internal/types'; export const getValuesFromArgTypes = (argTypes: ArgTypes = {}) => Object.entries(argTypes).reduce((acc, [arg, { defaultValue }]) => { diff --git a/code/core/src/preview-api/modules/store/csf/normalizeComponentAnnotations.ts b/code/core/src/preview-api/modules/store/csf/normalizeComponentAnnotations.ts index b314a89d31bf..b8287d820261 100644 --- a/code/core/src/preview-api/modules/store/csf/normalizeComponentAnnotations.ts +++ b/code/core/src/preview-api/modules/store/csf/normalizeComponentAnnotations.ts @@ -1,5 +1,6 @@ -import type { ModuleExports, NormalizedComponentAnnotations } from '@storybook/core/types'; -import type { Renderer } from '@storybook/core/types'; +import type { ModuleExports, NormalizedComponentAnnotations } from 'storybook/internal/types'; +import type { Renderer } from 'storybook/internal/types'; + import { sanitize } from '@storybook/csf'; import { normalizeInputTypes } from './normalizeInputTypes'; diff --git a/code/core/src/preview-api/modules/store/csf/normalizeInputTypes.ts b/code/core/src/preview-api/modules/store/csf/normalizeInputTypes.ts index f4685dc83090..54a6b3ddf297 100644 --- a/code/core/src/preview-api/modules/store/csf/normalizeInputTypes.ts +++ b/code/core/src/preview-api/modules/store/csf/normalizeInputTypes.ts @@ -5,7 +5,7 @@ import type { StrictArgTypes, StrictGlobalTypes, StrictInputType, -} from '@storybook/core/types'; +} from 'storybook/internal/types'; import { mapValues } from 'es-toolkit'; diff --git a/code/core/src/preview-api/modules/store/csf/normalizeProjectAnnotations.ts b/code/core/src/preview-api/modules/store/csf/normalizeProjectAnnotations.ts index 7c5ec15724fb..25d2fb78b197 100644 --- a/code/core/src/preview-api/modules/store/csf/normalizeProjectAnnotations.ts +++ b/code/core/src/preview-api/modules/store/csf/normalizeProjectAnnotations.ts @@ -1,11 +1,10 @@ +import { deprecate } from 'storybook/internal/client-logger'; import type { ArgTypes, NormalizedProjectAnnotations, ProjectAnnotations, Renderer, -} from '@storybook/core/types'; - -import { deprecate } from '@storybook/core/client-logger'; +} from 'storybook/internal/types'; import { dedent } from 'ts-dedent'; diff --git a/code/core/src/preview-api/modules/store/csf/normalizeStory.test.ts b/code/core/src/preview-api/modules/store/csf/normalizeStory.test.ts index e7cad9cb0558..69a740c579cb 100644 --- a/code/core/src/preview-api/modules/store/csf/normalizeStory.test.ts +++ b/code/core/src/preview-api/modules/store/csf/normalizeStory.test.ts @@ -1,10 +1,10 @@ import { describe, expect, it, vi } from 'vitest'; -import type { Renderer, StoryAnnotationsOrFn } from '@storybook/core/types'; +import type { Renderer, StoryAnnotationsOrFn } from 'storybook/internal/types'; import { normalizeStory } from './normalizeStory'; -vi.mock('@storybook/core/client-logger'); +vi.mock('storybook/internal/client-logger'); describe('normalizeStory', () => { describe('id generation', () => { diff --git a/code/core/src/preview-api/modules/store/csf/normalizeStory.ts b/code/core/src/preview-api/modules/store/csf/normalizeStory.ts index 7fb9f59d256b..525fb54a9956 100644 --- a/code/core/src/preview-api/modules/store/csf/normalizeStory.ts +++ b/code/core/src/preview-api/modules/store/csf/normalizeStory.ts @@ -1,3 +1,4 @@ +import { deprecate, logger } from 'storybook/internal/client-logger'; import type { ArgTypes, LegacyStoryAnnotationsOrFn, @@ -5,14 +6,13 @@ import type { StoryAnnotations, StoryFn, StoryId, -} from '@storybook/core/types'; +} from 'storybook/internal/types'; import type { NormalizedComponentAnnotations, NormalizedStoryAnnotations, -} from '@storybook/core/types'; -import { storyNameFromExport, toId } from '@storybook/csf'; +} from 'storybook/internal/types'; -import { deprecate, logger } from '@storybook/core/client-logger'; +import { storyNameFromExport, toId } from '@storybook/csf'; import { dedent } from 'ts-dedent'; diff --git a/code/core/src/preview-api/modules/store/csf/portable-stories.test.ts b/code/core/src/preview-api/modules/store/csf/portable-stories.test.ts index 24e286b3b909..70d07b47e7b8 100644 --- a/code/core/src/preview-api/modules/store/csf/portable-stories.test.ts +++ b/code/core/src/preview-api/modules/store/csf/portable-stories.test.ts @@ -5,7 +5,8 @@ import type { ComponentAnnotations as Meta, Store_CSFExports, StoryAnnotationsOrFn as Story, -} from '@storybook/core/types'; +} from 'storybook/internal/types'; + import type { ProjectAnnotations } from '@storybook/csf'; import * as defaultExportAnnotations from './__mocks__/defaultExportAnnotations.mockfile'; diff --git a/code/core/src/preview-api/modules/store/csf/portable-stories.ts b/code/core/src/preview-api/modules/store/csf/portable-stories.ts index 774137dcf85a..510b79c67abe 100644 --- a/code/core/src/preview-api/modules/store/csf/portable-stories.ts +++ b/code/core/src/preview-api/modules/store/csf/portable-stories.ts @@ -1,6 +1,7 @@ /* eslint-disable no-underscore-dangle */ /* eslint-disable @typescript-eslint/naming-convention */ +import { MountMustBeDestructuredError } from 'storybook/internal/preview-errors'; import type { Args, Canvas, @@ -18,10 +19,9 @@ import type { Store_CSFExports, StoryContext, StrictArgTypes, -} from '@storybook/core/types'; -import { type CleanupCallback, isExportStory } from '@storybook/csf'; +} from 'storybook/internal/types'; -import { MountMustBeDestructuredError } from '@storybook/core/preview-errors'; +import { type CleanupCallback, isExportStory } from '@storybook/csf'; import { dedent } from 'ts-dedent'; diff --git a/code/core/src/preview-api/modules/store/csf/prepareStory.test.ts b/code/core/src/preview-api/modules/store/csf/prepareStory.test.ts index 4f3c88bbd55e..1d05d136d7c2 100644 --- a/code/core/src/preview-api/modules/store/csf/prepareStory.test.ts +++ b/code/core/src/preview-api/modules/store/csf/prepareStory.test.ts @@ -9,7 +9,8 @@ import type { Renderer, SBScalarType, StoryContext, -} from '@storybook/core/types'; +} from 'storybook/internal/types'; + import { global } from '@storybook/global'; import { HooksContext, addons } from '../../addons'; diff --git a/code/core/src/preview-api/modules/store/csf/prepareStory.ts b/code/core/src/preview-api/modules/store/csf/prepareStory.ts index d2d7bba0c6df..3a8888d8f4b1 100644 --- a/code/core/src/preview-api/modules/store/csf/prepareStory.ts +++ b/code/core/src/preview-api/modules/store/csf/prepareStory.ts @@ -1,4 +1,5 @@ /* eslint-disable no-underscore-dangle */ +import { NoRenderFunctionError } from 'storybook/internal/preview-errors'; import type { Args, ArgsStoryFn, @@ -11,19 +12,18 @@ import type { StoryContextForEnhancers, StoryContextForLoaders, StrictArgTypes, -} from '@storybook/core/types'; +} from 'storybook/internal/types'; import type { ModuleExport, NormalizedComponentAnnotations, NormalizedProjectAnnotations, NormalizedStoryAnnotations, -} from '@storybook/core/types'; +} from 'storybook/internal/types'; + import { type CleanupCallback, combineTags, includeConditionalArg } from '@storybook/csf'; import { global } from '@storybook/global'; import { global as globalThis } from '@storybook/global'; -import { NoRenderFunctionError } from '@storybook/core/preview-errors'; - import { applyHooks } from '../../addons'; import { mountDestructured } from '../../preview-web/render/mount-utils'; import { UNTARGETED, groupArgsByTarget } from '../args'; diff --git a/code/core/src/preview-api/modules/store/csf/processCSFFile.ts b/code/core/src/preview-api/modules/store/csf/processCSFFile.ts index e0913f88992f..01d2b75f2e5c 100644 --- a/code/core/src/preview-api/modules/store/csf/processCSFFile.ts +++ b/code/core/src/preview-api/modules/store/csf/processCSFFile.ts @@ -1,8 +1,12 @@ -import type { ComponentTitle, Parameters, Path, Renderer } from '@storybook/core/types'; -import type { CSFFile, ModuleExports, NormalizedComponentAnnotations } from '@storybook/core/types'; -import { isExportStory } from '@storybook/csf'; +import { logger } from 'storybook/internal/client-logger'; +import type { + CSFFile, + ModuleExports, + NormalizedComponentAnnotations, +} from 'storybook/internal/types'; +import type { ComponentTitle, Parameters, Path, Renderer } from 'storybook/internal/types'; -import { logger } from '@storybook/core/client-logger'; +import { isExportStory } from '@storybook/csf'; import { normalizeComponentAnnotations } from './normalizeComponentAnnotations'; import { normalizeStory } from './normalizeStory'; diff --git a/code/core/src/preview-api/modules/store/csf/stepRunners.test.ts b/code/core/src/preview-api/modules/store/csf/stepRunners.test.ts index aacfa0d4dd5a..07bdbc2aae39 100644 --- a/code/core/src/preview-api/modules/store/csf/stepRunners.test.ts +++ b/code/core/src/preview-api/modules/store/csf/stepRunners.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it, vi } from 'vitest'; -import type { StepRunner, StoryContext } from '@storybook/core/types'; +import type { StepRunner, StoryContext } from 'storybook/internal/types'; import { composeStepRunners } from './stepRunners'; diff --git a/code/core/src/preview-api/modules/store/csf/stepRunners.ts b/code/core/src/preview-api/modules/store/csf/stepRunners.ts index c79adbfbc3d3..5f34b8848742 100644 --- a/code/core/src/preview-api/modules/store/csf/stepRunners.ts +++ b/code/core/src/preview-api/modules/store/csf/stepRunners.ts @@ -1,4 +1,4 @@ -import type { Renderer, StepRunner } from '@storybook/core/types'; +import type { Renderer, StepRunner } from 'storybook/internal/types'; /** * Compose step runners to create a single step runner that applies each step runner in order. diff --git a/code/core/src/preview-api/modules/store/decorators.test.ts b/code/core/src/preview-api/modules/store/decorators.test.ts index ae3cd2bb8c3c..2252d1972ba8 100644 --- a/code/core/src/preview-api/modules/store/decorators.test.ts +++ b/code/core/src/preview-api/modules/store/decorators.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from 'vitest'; -import type { Renderer, StoryContext } from '@storybook/core/types'; +import type { Renderer, StoryContext } from 'storybook/internal/types'; import { defaultDecorateStory } from './decorators'; diff --git a/code/core/src/preview-api/modules/store/decorators.ts b/code/core/src/preview-api/modules/store/decorators.ts index c5a540325bd4..861c358a9ac3 100644 --- a/code/core/src/preview-api/modules/store/decorators.ts +++ b/code/core/src/preview-api/modules/store/decorators.ts @@ -5,7 +5,7 @@ import type { Renderer, StoryContext, StoryContextUpdate, -} from '@storybook/core/types'; +} from 'storybook/internal/types'; export function decorateStory( storyFn: LegacyStoryFn, diff --git a/code/core/src/preview-api/modules/store/filterArgTypes.ts b/code/core/src/preview-api/modules/store/filterArgTypes.ts index 16c2dd3a6c51..b03a155970e0 100644 --- a/code/core/src/preview-api/modules/store/filterArgTypes.ts +++ b/code/core/src/preview-api/modules/store/filterArgTypes.ts @@ -1,4 +1,4 @@ -import type { StrictArgTypes } from '@storybook/core/types'; +import type { StrictArgTypes } from 'storybook/internal/types'; import { pickBy } from 'es-toolkit'; diff --git a/code/core/src/preview-api/modules/store/hooks.test.ts b/code/core/src/preview-api/modules/store/hooks.test.ts index a44dd495d260..4d20c585f088 100644 --- a/code/core/src/preview-api/modules/store/hooks.test.ts +++ b/code/core/src/preview-api/modules/store/hooks.test.ts @@ -1,14 +1,13 @@ import { beforeEach, describe, expect, it, vi } from 'vitest'; -import type { DecoratorFunction, StoryContext } from '@storybook/core/types'; - import { FORCE_RE_RENDER, RESET_STORY_ARGS, STORY_RENDERED, UPDATE_GLOBALS, UPDATE_STORY_ARGS, -} from '@storybook/core/core-events'; +} from 'storybook/internal/core-events'; +import type { DecoratorFunction, StoryContext } from 'storybook/internal/types'; import { HooksContext, @@ -28,7 +27,7 @@ import { } from '../addons'; import { defaultDecorateStory } from './decorators'; -vi.mock('@storybook/core/client-logger', () => ({ +vi.mock('storybook/internal/client-logger', () => ({ logger: { warn: vi.fn(), log: vi.fn() }, })); diff --git a/code/core/src/preview-api/modules/store/inferArgTypes.test.ts b/code/core/src/preview-api/modules/store/inferArgTypes.test.ts index fa374441a4ec..2541b8e56075 100644 --- a/code/core/src/preview-api/modules/store/inferArgTypes.test.ts +++ b/code/core/src/preview-api/modules/store/inferArgTypes.test.ts @@ -1,10 +1,10 @@ import { describe, expect, it, vi } from 'vitest'; -import { logger } from '@storybook/core/client-logger'; +import { logger } from 'storybook/internal/client-logger'; import { inferArgTypes } from './inferArgTypes'; -vi.mock('@storybook/core/client-logger'); +vi.mock('storybook/internal/client-logger'); describe('inferArgTypes', () => { it('infers scalar types', () => { diff --git a/code/core/src/preview-api/modules/store/inferArgTypes.ts b/code/core/src/preview-api/modules/store/inferArgTypes.ts index 35e840fedcd8..5def5c762b0b 100644 --- a/code/core/src/preview-api/modules/store/inferArgTypes.ts +++ b/code/core/src/preview-api/modules/store/inferArgTypes.ts @@ -1,6 +1,5 @@ -import type { ArgTypesEnhancer, Renderer, SBType } from '@storybook/core/types'; - -import { logger } from '@storybook/core/client-logger'; +import { logger } from 'storybook/internal/client-logger'; +import type { ArgTypesEnhancer, Renderer, SBType } from 'storybook/internal/types'; import { mapValues } from 'es-toolkit'; import { dedent } from 'ts-dedent'; diff --git a/code/core/src/preview-api/modules/store/inferControls.test.ts b/code/core/src/preview-api/modules/store/inferControls.test.ts index abe91702ec36..f16e0b9463ed 100644 --- a/code/core/src/preview-api/modules/store/inferControls.test.ts +++ b/code/core/src/preview-api/modules/store/inferControls.test.ts @@ -1,9 +1,8 @@ import type { MockInstance } from 'vitest'; import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; -import type { StoryContextForEnhancers } from '@storybook/core/types'; - -import { logger } from '@storybook/core/client-logger'; +import { logger } from 'storybook/internal/client-logger'; +import type { StoryContextForEnhancers } from 'storybook/internal/types'; import { argTypesEnhancers } from './inferControls'; diff --git a/code/core/src/preview-api/modules/store/inferControls.ts b/code/core/src/preview-api/modules/store/inferControls.ts index 92447845cc92..8a137de77771 100644 --- a/code/core/src/preview-api/modules/store/inferControls.ts +++ b/code/core/src/preview-api/modules/store/inferControls.ts @@ -1,11 +1,10 @@ +import { logger } from 'storybook/internal/client-logger'; import type { ArgTypesEnhancer, Renderer, SBEnumType, StrictInputType, -} from '@storybook/core/types'; - -import { logger } from '@storybook/core/client-logger'; +} from 'storybook/internal/types'; import { mapValues } from 'es-toolkit'; diff --git a/code/core/src/preview-api/modules/store/parameters.ts b/code/core/src/preview-api/modules/store/parameters.ts index 3b6077614801..39de894852b9 100644 --- a/code/core/src/preview-api/modules/store/parameters.ts +++ b/code/core/src/preview-api/modules/store/parameters.ts @@ -1,5 +1,5 @@ // Utilities for handling parameters -import type { Parameters } from '@storybook/core/types'; +import type { Parameters } from 'storybook/internal/types'; import { isPlainObject } from 'es-toolkit'; diff --git a/code/core/src/preview-api/modules/store/sortStories.ts b/code/core/src/preview-api/modules/store/sortStories.ts index 39cb86efcc21..3d4f41e9c4be 100644 --- a/code/core/src/preview-api/modules/store/sortStories.ts +++ b/code/core/src/preview-api/modules/store/sortStories.ts @@ -1,12 +1,13 @@ -import type { IndexEntry, StoryIndexEntry } from '@storybook/core/types'; import type { Addon_Comparator, Addon_StorySortParameter, Addon_StorySortParameterV7, + IndexEntry, IndexEntryLegacy, -} from '@storybook/core/types'; -import type { Parameters, Path, Renderer } from '@storybook/core/types'; -import type { PreparedStory } from '@storybook/core/types'; + StoryIndexEntry, +} from 'storybook/internal/types'; +import type { Parameters, Path, Renderer } from 'storybook/internal/types'; +import type { PreparedStory } from 'storybook/internal/types'; import { dedent } from 'ts-dedent'; diff --git a/code/core/src/preview-api/modules/store/storySort.test.ts b/code/core/src/preview-api/modules/store/storySort.test.ts index 104ad3bb1c8d..2c60aa0ddff6 100644 --- a/code/core/src/preview-api/modules/store/storySort.test.ts +++ b/code/core/src/preview-api/modules/store/storySort.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from 'vitest'; -import type { StoryId, StoryIndexEntry } from '@storybook/core/types'; +import type { StoryId, StoryIndexEntry } from 'storybook/internal/types'; import { storySort } from './storySort'; diff --git a/code/core/src/preview-api/modules/store/storySort.ts b/code/core/src/preview-api/modules/store/storySort.ts index eddc18004923..e5700124df12 100644 --- a/code/core/src/preview-api/modules/store/storySort.ts +++ b/code/core/src/preview-api/modules/store/storySort.ts @@ -1,8 +1,8 @@ import type { Addon_StorySortComparatorV7, Addon_StorySortObjectParameter, -} from '@storybook/core/types'; -import type { IndexEntry } from '@storybook/core/types'; +} from 'storybook/internal/types'; +import type { IndexEntry } from 'storybook/internal/types'; const STORY_KIND_PATH_SEPARATOR = /\s*\/\s*/; diff --git a/code/core/src/preview/globals/globals.ts b/code/core/src/preview/globals/globals.ts index c20d2630899e..7341ba7d1e38 100644 --- a/code/core/src/preview/globals/globals.ts +++ b/code/core/src/preview/globals/globals.ts @@ -5,27 +5,21 @@ export const globalsNameReferenceMap = { 'storybook/internal/channels': '__STORYBOOK_MODULE_CHANNELS__', '@storybook/channels': '__STORYBOOK_MODULE_CHANNELS__', - '@storybook/core/channels': '__STORYBOOK_MODULE_CHANNELS__', 'storybook/internal/client-logger': '__STORYBOOK_MODULE_CLIENT_LOGGER__', '@storybook/client-logger': '__STORYBOOK_MODULE_CLIENT_LOGGER__', - '@storybook/core/client-logger': '__STORYBOOK_MODULE_CLIENT_LOGGER__', 'storybook/internal/core-events': '__STORYBOOK_MODULE_CORE_EVENTS__', '@storybook/core-events': '__STORYBOOK_MODULE_CORE_EVENTS__', - '@storybook/core/core-events': '__STORYBOOK_MODULE_CORE_EVENTS__', 'storybook/internal/preview-errors': '__STORYBOOK_MODULE_CORE_EVENTS_PREVIEW_ERRORS__', '@storybook/core-events/preview-errors': '__STORYBOOK_MODULE_CORE_EVENTS_PREVIEW_ERRORS__', - '@storybook/core/preview-errors': '__STORYBOOK_MODULE_CORE_EVENTS_PREVIEW_ERRORS__', 'storybook/internal/preview-api': '__STORYBOOK_MODULE_PREVIEW_API__', '@storybook/preview-api': '__STORYBOOK_MODULE_PREVIEW_API__', - '@storybook/core/preview-api': '__STORYBOOK_MODULE_PREVIEW_API__', 'storybook/internal/types': '__STORYBOOK_MODULE_TYPES__', '@storybook/types': '__STORYBOOK_MODULE_TYPES__', - '@storybook/core/types': '__STORYBOOK_MODULE_TYPES__', } as const; export const globalPackages = Object.keys(globalsNameReferenceMap) as Array< diff --git a/code/core/src/preview/globals/runtime.ts b/code/core/src/preview/globals/runtime.ts index 48418bc6de7e..d90b93538754 100644 --- a/code/core/src/preview/globals/runtime.ts +++ b/code/core/src/preview/globals/runtime.ts @@ -1,11 +1,11 @@ -import * as CHANNELS from '@storybook/core/channels'; -import * as TYPES from '@storybook/core/types'; -import * as GLOBAL from '@storybook/global'; +import * as CHANNELS from 'storybook/internal/channels'; +import * as CLIENT_LOGGER from 'storybook/internal/client-logger'; +import * as CORE_EVENTS from 'storybook/internal/core-events'; +import * as PREVIEW_API from 'storybook/internal/preview-api'; +import * as CORE_EVENTS_PREVIEW_ERRORS from 'storybook/internal/preview-errors'; +import * as TYPES from 'storybook/internal/types'; -import * as CLIENT_LOGGER from '@storybook/core/client-logger'; -import * as CORE_EVENTS from '@storybook/core/core-events'; -import * as PREVIEW_API from '@storybook/core/preview-api'; -import * as CORE_EVENTS_PREVIEW_ERRORS from '@storybook/core/preview-errors'; +import * as GLOBAL from '@storybook/global'; import type { globalsNameReferenceMap } from './globals'; @@ -15,25 +15,19 @@ export const globalsNameValueMap: Required ({ +vi.mock('storybook/internal/client-logger', () => ({ once: { warn: vi.fn() }, })); diff --git a/code/core/src/router/utils.ts b/code/core/src/router/utils.ts index bd8e3edc7aa5..66efa79cb68b 100644 --- a/code/core/src/router/utils.ts +++ b/code/core/src/router/utils.ts @@ -1,4 +1,4 @@ -import { once } from '@storybook/core/client-logger'; +import { once } from 'storybook/internal/client-logger'; import { isEqual as deepEqual, isPlainObject } from 'es-toolkit'; import memoize from 'memoizerific'; diff --git a/code/core/src/telemetry/anonymous-id.ts b/code/core/src/telemetry/anonymous-id.ts index 1d23d0a493ae..acd807ffd95b 100644 --- a/code/core/src/telemetry/anonymous-id.ts +++ b/code/core/src/telemetry/anonymous-id.ts @@ -1,6 +1,6 @@ import { relative } from 'node:path'; -import { getProjectRoot } from '@storybook/core/common'; +import { getProjectRoot } from 'storybook/internal/common'; import { execSync } from 'child_process'; import slash from 'slash'; diff --git a/code/core/src/telemetry/event-cache.ts b/code/core/src/telemetry/event-cache.ts index 95fecef60c05..c40d7254aefc 100644 --- a/code/core/src/telemetry/event-cache.ts +++ b/code/core/src/telemetry/event-cache.ts @@ -1,4 +1,4 @@ -import { cache } from '@storybook/core/common'; +import { cache } from 'storybook/internal/common'; import type { EventType } from './types'; diff --git a/code/core/src/telemetry/get-chromatic-version.ts b/code/core/src/telemetry/get-chromatic-version.ts index eb1c38fbf3b7..a313b2a8936b 100644 --- a/code/core/src/telemetry/get-chromatic-version.ts +++ b/code/core/src/telemetry/get-chromatic-version.ts @@ -1,4 +1,4 @@ -import type { PackageJson } from '@storybook/core/types'; +import type { PackageJson } from 'storybook/internal/types'; export function getChromaticVersionSpecifier(packageJson: PackageJson) { const dependency = diff --git a/code/core/src/telemetry/get-framework-info.test.ts b/code/core/src/telemetry/get-framework-info.test.ts index e95e643dc8b1..8fc25c4b99ca 100644 --- a/code/core/src/telemetry/get-framework-info.test.ts +++ b/code/core/src/telemetry/get-framework-info.test.ts @@ -2,7 +2,7 @@ import { sep } from 'node:path'; import { describe, expect, it, vi } from 'vitest'; -import type { StorybookConfig } from '@storybook/core/types'; +import type { StorybookConfig } from 'storybook/internal/types'; import { getFrameworkInfo } from './get-framework-info'; import { getActualPackageJson } from './package-json'; diff --git a/code/core/src/telemetry/get-framework-info.ts b/code/core/src/telemetry/get-framework-info.ts index d5b3390128ea..0216e13bf4db 100644 --- a/code/core/src/telemetry/get-framework-info.ts +++ b/code/core/src/telemetry/get-framework-info.ts @@ -1,7 +1,7 @@ import { normalize } from 'node:path'; -import { frameworkPackages } from '@storybook/core/common'; -import type { PackageJson, StorybookConfig } from '@storybook/core/types'; +import { frameworkPackages } from 'storybook/internal/common'; +import type { PackageJson, StorybookConfig } from 'storybook/internal/types'; import { getActualPackageJson } from './package-json'; import { cleanPaths } from './sanitize'; diff --git a/code/core/src/telemetry/get-monorepo-type.test.ts b/code/core/src/telemetry/get-monorepo-type.test.ts index 3f8ecfca723a..f23369330d97 100644 --- a/code/core/src/telemetry/get-monorepo-type.test.ts +++ b/code/core/src/telemetry/get-monorepo-type.test.ts @@ -8,9 +8,9 @@ import { getMonorepoType, monorepoConfigs } from './get-monorepo-type'; vi.mock('node:fs', async () => import('../../../__mocks__/fs')); -vi.mock('@storybook/core/common', async (importOriginal) => { +vi.mock('storybook/internal/common', async (importOriginal) => { return { - ...(await importOriginal()), + ...(await importOriginal()), getProjectRoot: () => 'root', }; }); diff --git a/code/core/src/telemetry/get-monorepo-type.ts b/code/core/src/telemetry/get-monorepo-type.ts index 143241b0a214..d3825f0f8063 100644 --- a/code/core/src/telemetry/get-monorepo-type.ts +++ b/code/core/src/telemetry/get-monorepo-type.ts @@ -1,8 +1,8 @@ import { existsSync, readFileSync } from 'node:fs'; import { join } from 'node:path'; -import { getProjectRoot } from '@storybook/core/common'; -import type { PackageJson } from '@storybook/core/types'; +import { getProjectRoot } from 'storybook/internal/common'; +import type { PackageJson } from 'storybook/internal/types'; export const monorepoConfigs = { Nx: 'nx.json', diff --git a/code/core/src/telemetry/index.ts b/code/core/src/telemetry/index.ts index 0811901dc2aa..a53be966fd40 100644 --- a/code/core/src/telemetry/index.ts +++ b/code/core/src/telemetry/index.ts @@ -1,4 +1,4 @@ -import { logger } from '@storybook/core/node-logger'; +import { logger } from 'storybook/internal/node-logger'; import { notify } from './notify'; import { sanitizeError } from './sanitize'; diff --git a/code/core/src/telemetry/notify.ts b/code/core/src/telemetry/notify.ts index a6cf3e5b8b51..224b5e758ec8 100644 --- a/code/core/src/telemetry/notify.ts +++ b/code/core/src/telemetry/notify.ts @@ -1,4 +1,4 @@ -import { cache } from '@storybook/core/common'; +import { cache } from 'storybook/internal/common'; import picocolors from 'picocolors'; diff --git a/code/core/src/telemetry/session-id.test.ts b/code/core/src/telemetry/session-id.test.ts index cff48bfa6dda..c9d2646f9016 100644 --- a/code/core/src/telemetry/session-id.test.ts +++ b/code/core/src/telemetry/session-id.test.ts @@ -1,14 +1,14 @@ import type { MockInstance } from 'vitest'; import { beforeEach, describe, expect, it, vi } from 'vitest'; -import { cache } from '@storybook/core/common'; +import { cache } from 'storybook/internal/common'; import { nanoid } from 'nanoid'; import { SESSION_TIMEOUT, getSessionId, resetSessionIdForTest } from './session-id'; -vi.mock('@storybook/core/common', async (importOriginal) => ({ - ...(await importOriginal()), +vi.mock('storybook/internal/common', async (importOriginal) => ({ + ...(await importOriginal()), cache: { get: vi.fn(), set: vi.fn(), diff --git a/code/core/src/telemetry/session-id.ts b/code/core/src/telemetry/session-id.ts index 3029855c5cee..82d0d8947f1d 100644 --- a/code/core/src/telemetry/session-id.ts +++ b/code/core/src/telemetry/session-id.ts @@ -1,4 +1,4 @@ -import { cache } from '@storybook/core/common'; +import { cache } from 'storybook/internal/common'; import { nanoid } from 'nanoid'; diff --git a/code/core/src/telemetry/storybook-metadata.test.ts b/code/core/src/telemetry/storybook-metadata.test.ts index 8d73ff7b437d..05d69aef1783 100644 --- a/code/core/src/telemetry/storybook-metadata.test.ts +++ b/code/core/src/telemetry/storybook-metadata.test.ts @@ -3,7 +3,7 @@ import path from 'node:path'; import type { MockInstance } from 'vitest'; import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; -import type { PackageJson, StorybookConfig } from '@storybook/core/types'; +import type { PackageJson, StorybookConfig } from 'storybook/internal/types'; import { computeStorybookMetadata, metaFrameworks, sanitizeAddonName } from './storybook-metadata'; @@ -53,9 +53,9 @@ vi.mock('detect-package-manager', () => ({ getNpmVersion: () => '3.1.1', })); -vi.mock('@storybook/core/common', async (importOriginal) => { +vi.mock('storybook/internal/common', async (importOriginal) => { return { - ...(await importOriginal()), + ...(await importOriginal()), getProjectRoot: () => process.cwd(), }; }); diff --git a/code/core/src/telemetry/storybook-metadata.ts b/code/core/src/telemetry/storybook-metadata.ts index 5258eef0ffb7..d521f3a98eaf 100644 --- a/code/core/src/telemetry/storybook-metadata.ts +++ b/code/core/src/telemetry/storybook-metadata.ts @@ -5,10 +5,9 @@ import { getStorybookConfiguration, getStorybookInfo, loadMainConfig, -} from '@storybook/core/common'; -import type { PackageJson, StorybookConfig } from '@storybook/core/types'; - -import { readConfig } from '@storybook/core/csf-tools'; +} from 'storybook/internal/common'; +import { readConfig } from 'storybook/internal/csf-tools'; +import type { PackageJson, StorybookConfig } from 'storybook/internal/types'; import { detect, getNpmVersion } from 'detect-package-manager'; import { findPackage, findPackagePath } from 'fd-package-json'; diff --git a/code/core/src/telemetry/types.ts b/code/core/src/telemetry/types.ts index e43373e5e61b..aaca07362b1c 100644 --- a/code/core/src/telemetry/types.ts +++ b/code/core/src/telemetry/types.ts @@ -1,4 +1,4 @@ -import type { StorybookConfig, TypescriptOptions } from '@storybook/core/types'; +import type { StorybookConfig, TypescriptOptions } from 'storybook/internal/types'; import type { PM } from 'detect-package-manager'; diff --git a/code/core/src/theming/ensure.ts b/code/core/src/theming/ensure.ts index 39e3ee7e9d00..295defadc89e 100644 --- a/code/core/src/theming/ensure.ts +++ b/code/core/src/theming/ensure.ts @@ -1,4 +1,4 @@ -import { logger } from '@storybook/core/client-logger'; +import { logger } from 'storybook/internal/client-logger'; import { deletedDiff } from 'deep-object-diff'; import { dedent } from 'ts-dedent'; diff --git a/code/core/src/theming/utils.ts b/code/core/src/theming/utils.ts index e739146789fe..d73ff3255133 100644 --- a/code/core/src/theming/utils.ts +++ b/code/core/src/theming/utils.ts @@ -1,6 +1,6 @@ -import { global } from '@storybook/global'; +import { logger } from 'storybook/internal/client-logger'; -import { logger } from '@storybook/core/client-logger'; +import { global } from '@storybook/global'; import { darken, lighten, rgba } from 'polished'; diff --git a/code/core/src/types/modules/addons.ts b/code/core/src/types/modules/addons.ts index b2c7b4ac2f3c..66aaf8d23360 100644 --- a/code/core/src/types/modules/addons.ts +++ b/code/core/src/types/modules/addons.ts @@ -414,7 +414,7 @@ export interface Addon_PageType { * @example * * ```jsx - * import { Route } from '@storybook/core/router'; + * import { Route } from 'storybook/internal/router'; * * Render: () => { * return ( diff --git a/code/core/src/types/modules/docs.ts b/code/core/src/types/modules/docs.ts index b23d9b404328..9e90aad52d75 100644 --- a/code/core/src/types/modules/docs.ts +++ b/code/core/src/types/modules/docs.ts @@ -1,4 +1,4 @@ -import type { Channel } from '@storybook/core/channels'; +import type { Channel } from 'storybook/internal/channels'; import type { Parameters, Renderer, StoryContext, StoryId, StoryName } from './csf'; import type { diff --git a/code/core/template/stories/argMapping.stories.ts b/code/core/template/stories/argMapping.stories.ts index 41575e931239..f2813a95d26d 100644 --- a/code/core/template/stories/argMapping.stories.ts +++ b/code/core/template/stories/argMapping.stories.ts @@ -1,4 +1,5 @@ -import type { PartialStoryFn, PlayFunctionContext, StoryContext } from '@storybook/core/types'; +import type { PartialStoryFn, PlayFunctionContext, StoryContext } from 'storybook/internal/types'; + import { global as globalThis } from '@storybook/global'; import { expect, within } from '@storybook/test'; diff --git a/code/core/template/stories/argTypes.stories.ts b/code/core/template/stories/argTypes.stories.ts index 6ad691324495..d64316c63b8e 100644 --- a/code/core/template/stories/argTypes.stories.ts +++ b/code/core/template/stories/argTypes.stories.ts @@ -1,4 +1,5 @@ -import type { PartialStoryFn, PlayFunctionContext, StoryContext } from '@storybook/core/types'; +import type { PartialStoryFn, PlayFunctionContext, StoryContext } from 'storybook/internal/types'; + import { global as globalThis } from '@storybook/global'; import { expect, within } from '@storybook/test'; diff --git a/code/core/template/stories/args.stories.ts b/code/core/template/stories/args.stories.ts index 4c83a98ca0ae..e1499f1a175e 100644 --- a/code/core/template/stories/args.stories.ts +++ b/code/core/template/stories/args.stories.ts @@ -1,12 +1,12 @@ -import type { PartialStoryFn, PlayFunctionContext, StoryContext } from '@storybook/core/types'; -import { global as globalThis } from '@storybook/global'; -import { expect, within } from '@storybook/test'; - import { RESET_STORY_ARGS, STORY_ARGS_UPDATED, UPDATE_STORY_ARGS, -} from '@storybook/core/core-events'; +} from 'storybook/internal/core-events'; +import type { PartialStoryFn, PlayFunctionContext, StoryContext } from 'storybook/internal/types'; + +import { global as globalThis } from '@storybook/global'; +import { expect, within } from '@storybook/test'; function pick(obj, keys) { const result = {}; diff --git a/code/core/template/stories/autotitle.stories.ts b/code/core/template/stories/autotitle.stories.ts index 0a675faadec8..9399cf241216 100644 --- a/code/core/template/stories/autotitle.stories.ts +++ b/code/core/template/stories/autotitle.stories.ts @@ -1,4 +1,5 @@ -import type { PlayFunctionContext } from '@storybook/core/types'; +import type { PlayFunctionContext } from 'storybook/internal/types'; + import { global as globalThis } from '@storybook/global'; import { expect } from '@storybook/test'; diff --git a/code/core/template/stories/component-play.stories.ts b/code/core/template/stories/component-play.stories.ts index 0571cf37b324..db93783ed167 100644 --- a/code/core/template/stories/component-play.stories.ts +++ b/code/core/template/stories/component-play.stories.ts @@ -1,4 +1,5 @@ -import type { PartialStoryFn, PlayFunctionContext, StoryContext } from '@storybook/core/types'; +import type { PartialStoryFn, PlayFunctionContext, StoryContext } from 'storybook/internal/types'; + import { global as globalThis } from '@storybook/global'; import { expect, within } from '@storybook/test'; diff --git a/code/core/template/stories/decorators.stories.ts b/code/core/template/stories/decorators.stories.ts index aa5cb1b6d496..7e60034b0ae6 100644 --- a/code/core/template/stories/decorators.stories.ts +++ b/code/core/template/stories/decorators.stories.ts @@ -1,19 +1,19 @@ +import { + RESET_STORY_ARGS, + STORY_ARGS_UPDATED, + UPDATE_STORY_ARGS, +} from 'storybook/internal/core-events'; +import { useEffect } from 'storybook/internal/preview-api'; import type { ArgsStoryFn, PartialStoryFn, PlayFunctionContext, StoryContext, -} from '@storybook/core/types'; +} from 'storybook/internal/types'; + import { global as globalThis } from '@storybook/global'; import { expect, within } from '@storybook/test'; -import { - RESET_STORY_ARGS, - STORY_ARGS_UPDATED, - UPDATE_STORY_ARGS, -} from '@storybook/core/core-events'; -import { useEffect } from '@storybook/core/preview-api'; - export default { component: globalThis.Components.Pre, parameters: { useProjectDecorator: true }, diff --git a/code/core/template/stories/globals.stories.ts b/code/core/template/stories/globals.stories.ts index 0afd7d1fc44d..b4dd7960df9e 100644 --- a/code/core/template/stories/globals.stories.ts +++ b/code/core/template/stories/globals.stories.ts @@ -1,4 +1,5 @@ -import type { PartialStoryFn, PlayFunctionContext, StoryContext } from '@storybook/core/types'; +import type { PartialStoryFn, PlayFunctionContext, StoryContext } from 'storybook/internal/types'; + import { global as globalThis } from '@storybook/global'; import { expect, within } from '@storybook/test'; diff --git a/code/core/template/stories/hooks.stories.ts b/code/core/template/stories/hooks.stories.ts index 3593fcbd72ec..b2d2cc01e73a 100644 --- a/code/core/template/stories/hooks.stories.ts +++ b/code/core/template/stories/hooks.stories.ts @@ -1,9 +1,9 @@ -import type { PartialStoryFn, StoryContext } from '@storybook/core/types'; +import { useEffect, useState } from 'storybook/internal/preview-api'; +import type { PartialStoryFn, StoryContext } from 'storybook/internal/types'; + import { global as globalThis } from '@storybook/global'; import { userEvent, within } from '@storybook/test'; -import { useEffect, useState } from '@storybook/core/preview-api'; - export default { component: globalThis.Components.Button, tags: ['!vitest'], diff --git a/code/core/template/stories/indexer.stories.ts b/code/core/template/stories/indexer.stories.ts index 5468e698d3cb..684b195e5bfd 100644 --- a/code/core/template/stories/indexer.stories.ts +++ b/code/core/template/stories/indexer.stories.ts @@ -1,4 +1,5 @@ -import type { PlayFunctionContext } from '@storybook/core/types'; +import type { PlayFunctionContext } from 'storybook/internal/types'; + import { global as globalThis } from '@storybook/global'; import { expect } from '@storybook/test'; diff --git a/code/core/template/stories/loaders.stories.ts b/code/core/template/stories/loaders.stories.ts index 1c24f5214fa2..b9a5d31eaf18 100644 --- a/code/core/template/stories/loaders.stories.ts +++ b/code/core/template/stories/loaders.stories.ts @@ -1,4 +1,5 @@ -import type { PartialStoryFn, StoryContext } from '@storybook/core/types'; +import type { PartialStoryFn, StoryContext } from 'storybook/internal/types'; + import { global as globalThis } from '@storybook/global'; import { expect, within } from '@storybook/test'; diff --git a/code/core/template/stories/names.stories.ts b/code/core/template/stories/names.stories.ts index b89304a63f59..9ad9320b4e5b 100644 --- a/code/core/template/stories/names.stories.ts +++ b/code/core/template/stories/names.stories.ts @@ -1,4 +1,5 @@ -import type { PlayFunctionContext } from '@storybook/core/types'; +import type { PlayFunctionContext } from 'storybook/internal/types'; + import { global as globalThis } from '@storybook/global'; import { expect } from '@storybook/test'; diff --git a/code/core/template/stories/parameters.stories.ts b/code/core/template/stories/parameters.stories.ts index a4200444cd0e..5d7020197197 100644 --- a/code/core/template/stories/parameters.stories.ts +++ b/code/core/template/stories/parameters.stories.ts @@ -1,4 +1,5 @@ -import type { PartialStoryFn, PlayFunctionContext, StoryContext } from '@storybook/core/types'; +import type { PartialStoryFn, PlayFunctionContext, StoryContext } from 'storybook/internal/types'; + import { global as globalThis } from '@storybook/global'; import { expect, within } from '@storybook/test'; diff --git a/code/core/template/stories/preview.ts b/code/core/template/stories/preview.ts index bba2716864bc..706fd0854027 100644 --- a/code/core/template/stories/preview.ts +++ b/code/core/template/stories/preview.ts @@ -1,5 +1,5 @@ /* eslint-disable no-underscore-dangle */ -import type { PartialStoryFn, StoryContext } from '@storybook/core/types'; +import type { PartialStoryFn, StoryContext } from 'storybook/internal/types'; declare global { interface Window { diff --git a/code/core/template/stories/rendering.stories.ts b/code/core/template/stories/rendering.stories.ts index 77e9432ef512..6df7cb67aa91 100644 --- a/code/core/template/stories/rendering.stories.ts +++ b/code/core/template/stories/rendering.stories.ts @@ -1,13 +1,13 @@ -import type { PlayFunctionContext } from '@storybook/core/types'; -import { global as globalThis } from '@storybook/global'; -import { expect, waitFor, within } from '@storybook/test'; - import { FORCE_REMOUNT, RESET_STORY_ARGS, STORY_ARGS_UPDATED, UPDATE_STORY_ARGS, -} from '@storybook/core/core-events'; +} from 'storybook/internal/core-events'; +import type { PlayFunctionContext } from 'storybook/internal/types'; + +import { global as globalThis } from '@storybook/global'; +import { expect, waitFor, within } from '@storybook/test'; export default { component: globalThis.Components.Button, diff --git a/code/core/template/stories/shortcuts.stories.ts b/code/core/template/stories/shortcuts.stories.ts index 429d3a5f4147..c726c31457d6 100644 --- a/code/core/template/stories/shortcuts.stories.ts +++ b/code/core/template/stories/shortcuts.stories.ts @@ -1,9 +1,9 @@ +import { PREVIEW_KEYDOWN } from 'storybook/internal/core-events'; + import type { PlayFunctionContext } from '@storybook/csf'; import { global as globalThis } from '@storybook/global'; import { expect, fn, userEvent, within } from '@storybook/test'; -import { PREVIEW_KEYDOWN } from '@storybook/core/core-events'; - export default { component: globalThis.Components.Form, tags: ['autodocs'], diff --git a/code/core/template/stories/tags-add.stories.ts b/code/core/template/stories/tags-add.stories.ts index edb70171eba1..de5469bad877 100644 --- a/code/core/template/stories/tags-add.stories.ts +++ b/code/core/template/stories/tags-add.stories.ts @@ -1,4 +1,5 @@ -import type { PartialStoryFn, PlayFunctionContext, StoryContext } from '@storybook/core/types'; +import type { PartialStoryFn, PlayFunctionContext, StoryContext } from 'storybook/internal/types'; + import { global as globalThis } from '@storybook/global'; import { expect, within } from '@storybook/test'; diff --git a/code/core/template/stories/tags-config.stories.ts b/code/core/template/stories/tags-config.stories.ts index a57a70390ce1..3917a1a95199 100644 --- a/code/core/template/stories/tags-config.stories.ts +++ b/code/core/template/stories/tags-config.stories.ts @@ -1,4 +1,5 @@ -import type { PartialStoryFn, PlayFunctionContext, StoryContext } from '@storybook/core/types'; +import type { PartialStoryFn, PlayFunctionContext, StoryContext } from 'storybook/internal/types'; + import { global as globalThis } from '@storybook/global'; import { expect, within } from '@storybook/test'; diff --git a/code/core/template/stories/tags-remove.stories.ts b/code/core/template/stories/tags-remove.stories.ts index 468f99614aa0..ced6ace2cecb 100644 --- a/code/core/template/stories/tags-remove.stories.ts +++ b/code/core/template/stories/tags-remove.stories.ts @@ -1,4 +1,5 @@ -import type { PartialStoryFn, PlayFunctionContext, StoryContext } from '@storybook/core/types'; +import type { PartialStoryFn, PlayFunctionContext, StoryContext } from 'storybook/internal/types'; + import { global as globalThis } from '@storybook/global'; import { expect, within } from '@storybook/test'; diff --git a/code/core/template/stories/title.stories.ts b/code/core/template/stories/title.stories.ts index deabd76f7623..0c0246a096f8 100644 --- a/code/core/template/stories/title.stories.ts +++ b/code/core/template/stories/title.stories.ts @@ -1,4 +1,5 @@ -import type { PlayFunctionContext } from '@storybook/core/types'; +import type { PlayFunctionContext } from 'storybook/internal/types'; + import { global as globalThis } from '@storybook/global'; import { expect } from '@storybook/test'; diff --git a/code/core/tsconfig.json b/code/core/tsconfig.json index 2dcc611b29a4..a13eaab4f265 100644 --- a/code/core/tsconfig.json +++ b/code/core/tsconfig.json @@ -1,8 +1,7 @@ { "extends": "../tsconfig.json", "compilerOptions": { - "resolveJsonModule": true, - "module": "ES2022" + "resolveJsonModule": true }, "include": ["src/**/*", "scripts/**/*", "*.d.ts"] } diff --git a/code/frameworks/angular/src/builders/utils/run-compodoc.spec.ts b/code/frameworks/angular/src/builders/utils/run-compodoc.spec.ts index 4391c939fc40..7edb8424063b 100644 --- a/code/frameworks/angular/src/builders/utils/run-compodoc.spec.ts +++ b/code/frameworks/angular/src/builders/utils/run-compodoc.spec.ts @@ -1,4 +1,5 @@ import { BuilderContext } from '@angular-devkit/architect'; +// @ts-expect-error (TODO) import { LoggerApi } from '@angular-devkit/core/src/logger'; import { take } from 'rxjs/operators'; import { afterEach, describe, expect, it, vi } from 'vitest'; diff --git a/code/frameworks/angular/tsconfig.build.json b/code/frameworks/angular/tsconfig.build.json index e543e05b4803..6fe15d9d25ea 100644 --- a/code/frameworks/angular/tsconfig.build.json +++ b/code/frameworks/angular/tsconfig.build.json @@ -3,7 +3,6 @@ "compileOnSave": false, "compilerOptions": { "target": "ES2020", - "module": "CommonJS", "noEmit": false, "lib": ["es2020", "dom", "dom.iterable"], "experimentalDecorators": true, diff --git a/code/frameworks/sveltekit/src/plugins/mock-sveltekit-stores.ts b/code/frameworks/sveltekit/src/plugins/mock-sveltekit-stores.ts index 98ceb6cc7e5c..afa6c0142cb0 100644 --- a/code/frameworks/sveltekit/src/plugins/mock-sveltekit-stores.ts +++ b/code/frameworks/sveltekit/src/plugins/mock-sveltekit-stores.ts @@ -3,7 +3,6 @@ import { fileURLToPath } from 'node:url'; import type { Plugin } from 'vite'; -// @ts-expect-error We are building for CJS and ESM, so we have to use import.meta.url for the ESM output const filename = __filename ?? fileURLToPath(import.meta.url); const dir = dirname(filename); diff --git a/code/frameworks/sveltekit/src/preset.ts b/code/frameworks/sveltekit/src/preset.ts index 263a6b35429d..079a6422ff2e 100644 --- a/code/frameworks/sveltekit/src/preset.ts +++ b/code/frameworks/sveltekit/src/preset.ts @@ -3,7 +3,6 @@ import { dirname, join } from 'node:path'; import type { PresetProperty } from 'storybook/internal/types'; import { withoutVitePlugins } from '@storybook/builder-vite'; -// @ts-expect-error -- TS picks up the type from preset.js instead of dist/preset.d.ts import { viteFinal as svelteViteFinal } from '@storybook/svelte-vite/preset'; import { configOverrides } from './plugins/config-overrides'; diff --git a/code/lib/blocks/tsconfig.json b/code/lib/blocks/tsconfig.json index 9dad87f67d86..3416efe5e4e1 100644 --- a/code/lib/blocks/tsconfig.json +++ b/code/lib/blocks/tsconfig.json @@ -1,12 +1,8 @@ { + "extends": "../../tsconfig.json", "compilerOptions": { - "baseUrl": ".", - "module": "esnext", - "paths": { - "storybook/internal/*": ["../../lib/cli/core/*"] - }, + "rootDir": "../../../", "strict": false }, - "extends": "../../tsconfig.json", "include": ["src/**/*"] } diff --git a/code/lib/cli-storybook/src/automigrate/fixes/missing-storybook-dependencies.test.ts b/code/lib/cli-storybook/src/automigrate/fixes/missing-storybook-dependencies.test.ts index 2729cfb1da16..11a88344b60b 100644 --- a/code/lib/cli-storybook/src/automigrate/fixes/missing-storybook-dependencies.test.ts +++ b/code/lib/cli-storybook/src/automigrate/fixes/missing-storybook-dependencies.test.ts @@ -1,6 +1,6 @@ import { beforeEach, describe, expect, it, vi } from 'vitest'; -import type { JsPackageManager } from '@storybook/core/common'; +import type { JsPackageManager } from 'storybook/internal/common'; import stripAnsi from 'strip-ansi'; @@ -54,7 +54,7 @@ describe('missingStorybookDependencies', () => { }), retrievePackageJson: vi.fn().mockResolvedValue({ dependencies: { - '@storybook/core': '8.1.0', + storybook: '8.1.0', }, }), addDependencies: vi.fn().mockResolvedValue(undefined), diff --git a/code/lib/cli-storybook/src/automigrate/fixes/missing-storybook-dependencies.ts b/code/lib/cli-storybook/src/automigrate/fixes/missing-storybook-dependencies.ts index 8eda42d9b9ba..7e36f4750284 100644 --- a/code/lib/cli-storybook/src/automigrate/fixes/missing-storybook-dependencies.ts +++ b/code/lib/cli-storybook/src/automigrate/fixes/missing-storybook-dependencies.ts @@ -1,8 +1,7 @@ import { readFile } from 'node:fs/promises'; import { getStorybookVersionSpecifier } from 'storybook/internal/cli'; - -import type { InstallationMetadata, JsPackageManager } from '@storybook/core/common'; +import type { InstallationMetadata, JsPackageManager } from 'storybook/internal/common'; import picocolors from 'picocolors'; import { dedent } from 'ts-dedent'; @@ -129,6 +128,7 @@ export const missingStorybookDependencies: Fix { describe.each([ ['│ │ │ ├── @babel/code-frame@7.10.3 deduped', null], - [ - '│ ├── "@storybook/core/theming@6.0.0-beta.37 extraneous', - { package: '@storybook/core/theming', version: '6.0.0-beta.37' }, - ], [ '├─┬ @storybook/preset-create-react-app@3.1.2', { package: '@storybook/preset-create-react-app', version: '3.1.2' }, diff --git a/code/lib/cli-storybook/test/default/cli.test.cjs b/code/lib/cli-storybook/test/default/cli.test.cjs index f55fa0ef9a61..0de2e46e415b 100755 --- a/code/lib/cli-storybook/test/default/cli.test.cjs +++ b/code/lib/cli-storybook/test/default/cli.test.cjs @@ -17,87 +17,87 @@ describe('Help command', () => { it('should prints out "init" command', () => { const { status, stdout, stderr } = run(['help']); - expect(status).toBe(0); expect(stderr.toString()).toBe(''); expect(stdout.toString()).toContain('init'); expect(stdout.toString()).toContain('Initialize Storybook into your project'); + expect(status).toBe(0); }); it('should prints out "add" command', () => { const { status, stdout, stderr } = run(['help']); - expect(status).toBe(0); expect(stderr.toString()).toBe(''); expect(stdout.toString()).toContain('add'); expect(stdout.toString()).toContain('Add an addon to your Storybook'); + expect(status).toBe(0); }); it('should prints out "remove" command', () => { const { status, stdout, stderr } = run(['help']); - expect(status).toBe(0); expect(stderr.toString()).toBe(''); expect(stdout.toString()).toContain('remove'); expect(stdout.toString()).toContain('Remove an addon from your Storybook'); + expect(status).toBe(0); }); it('should prints out "upgrade" command', () => { const { status, stdout, stderr } = run(['help']); - expect(status).toBe(0); expect(stderr.toString()).toBe(''); expect(stdout.toString()).toContain('upgrade'); expect(stdout.toString()).toContain('Upgrade your Storybook packages to'); + expect(status).toBe(0); }); it('should prints out "migrate" command', () => { const { status, stdout, stderr } = run(['help']); - expect(status).toBe(0); expect(stderr.toString()).toBe(''); expect(stdout.toString()).toContain('migrate'); expect(stdout.toString()).toContain('Run a Storybook codemod migration on your source files'); + expect(status).toBe(0); }); it('should prints out "sandbox" command', () => { const { status, stdout, stderr } = run(['help']); - expect(status).toBe(0); expect(stderr.toString()).toBe(''); expect(stdout.toString()).toContain('sandbox'); expect(stdout.toString()).toContain('Create a sandbox from a set of possible templates'); + expect(status).toBe(0); }); it('should prints out "link" command', () => { const { status, stdout, stderr } = run(['help']); - expect(status).toBe(0); expect(stderr.toString()).toBe(''); expect(stdout.toString()).toContain('link'); expect(stdout.toString()).toContain( 'Pull down a repro from a URL (or a local directory), link it, and run storybook' ); + expect(status).toBe(0); }); it('should prints out "automigrate" command', () => { const { status, stdout, stderr } = run(['help']); - expect(status).toBe(0); expect(stderr.toString()).toBe(''); expect(stdout.toString()).toContain('automigrate'); expect(stdout.toString()).toContain( 'Check storybook for incompatibilities or migrations and apply fixes' ); + expect(status).toBe(0); }); it('should prints out "doctor" command', () => { const { status, stdout, stderr } = run(['help']); - expect(status).toBe(0); expect(stderr.toString()).toBe(''); expect(stdout.toString()).toContain('doctor'); expect(stdout.toString()).toContain( 'Check Storybook for known problems and provide suggestions or fixes' ); + expect(status).toBe(0); }); }); diff --git a/code/lib/cli-storybook/test/helpers.cjs b/code/lib/cli-storybook/test/helpers.cjs index 6b68939a4659..a8ddc097f5d6 100644 --- a/code/lib/cli-storybook/test/helpers.cjs +++ b/code/lib/cli-storybook/test/helpers.cjs @@ -1,7 +1,7 @@ const { sync: spawnSync } = require('cross-spawn'); const path = require('path'); -const CLI_PATH = path.join(__dirname, '..', 'bin', 'index.cjs'); +const CLI_PATH = path.join(__dirname, '..', '..', '..', 'core', 'bin', 'index.cjs'); /** * Execute command diff --git a/code/lib/cli/.eslintrc.cjs b/code/lib/cli/.eslintrc.cjs deleted file mode 100644 index 687842d5aaee..000000000000 --- a/code/lib/cli/.eslintrc.cjs +++ /dev/null @@ -1,31 +0,0 @@ - -module.exports = { - overrides: [ - { - files: 'templates/**/*', - env: { - browser: true, - }, - rules: { - 'react/no-this-in-sfc': "off", - 'react/react-in-jsx-scope': "off", - 'global-require': "off", - 'no-redeclare': "off", - 'react/prop-types': "off", - }, - }, - { - files: 'rendererAssets/**/*', - env: { - browser: true, - }, - rules: { - 'jsx-a11y/anchor-is-valid': "off", - 'react/prop-types': "off", - 'react/react-in-jsx-scope': "off", - 'import/extensions': "off", - 'import/named': "off", - }, - }, - ], -}; diff --git a/code/lib/cli/README.md b/code/lib/cli/README.md deleted file mode 100644 index ac92f2c8e096..000000000000 --- a/code/lib/cli/README.md +++ /dev/null @@ -1,49 +0,0 @@ -# Storybook - -## CLI - -Storybook CLI (_Command Line Interface_) is the easiest way to add [Storybook](https://github.com/storybookjs/storybook) to your project. - -![Screenshot](docs/getstorybook.png) - -Go to your project and run: - -```sh -cd my-app -npx sb@latest init -``` - -In addition to `init`, the CLI also has other commands: - -- `add` - add an addon and register it -- `info` - print out system information for bug reports -- `upgrade` - upgrade to the latest version of Storybook (or a specific version) -- `migrate` - run codemods to migrate your code - -See the command-line help with `-h` (including other useful commands) for details. - -## Core APIs - -This package has multiple sub-exports to can be used to gain access to storybook's APIs. - -### `storybook/components` - -This export contains a list of components very useful for building out addons. -We recommend addon-authors to use these components to ensure a consistent look and feel, and to reduce the amount of code they need to write. - -### `storybook/theming` - -This export exposes a few utility functions to help writing components that automatically adapt to the current theme. -Useful for addon authors who want to make their addons theme-aware. - -### `storybook/preview-api` - -This export contains the API that is available in the preview iframe. - -### `storybook/manager-api` - -This export contains the API that is available in the manager iframe. - -### `storybook/types` - -This export exposes a lot of TypeScript interfaces used throughout storybook, including for storybook configuration, addons etc. diff --git a/code/lib/cli/__mocks__/@aw-web-design/x-default-browser.js b/code/lib/cli/__mocks__/@aw-web-design/x-default-browser.js deleted file mode 100644 index ecd2ed7a2262..000000000000 --- a/code/lib/cli/__mocks__/@aw-web-design/x-default-browser.js +++ /dev/null @@ -1,2 +0,0 @@ -// TODO: Once we upgrade to Jest 28/29 we can probably remove this entire mock. -module.exports = {}; diff --git a/code/lib/cli/core.cjs b/code/lib/cli/core.cjs deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/code/lib/cli/core.d.ts b/code/lib/cli/core.d.ts deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/code/lib/cli/core.js b/code/lib/cli/core.js deleted file mode 100644 index cb0ff5c3b541..000000000000 --- a/code/lib/cli/core.js +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/code/lib/cli/core/babel/index.cjs b/code/lib/cli/core/babel/index.cjs deleted file mode 100644 index 08406d9e434c..000000000000 --- a/code/lib/cli/core/babel/index.cjs +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('@storybook/core/babel'); diff --git a/code/lib/cli/core/babel/index.d.ts b/code/lib/cli/core/babel/index.d.ts deleted file mode 100644 index 83441bd766c9..000000000000 --- a/code/lib/cli/core/babel/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from '@storybook/core/babel'; -export type * from '@storybook/core/babel'; diff --git a/code/lib/cli/core/babel/index.js b/code/lib/cli/core/babel/index.js deleted file mode 100644 index 670e11702916..000000000000 --- a/code/lib/cli/core/babel/index.js +++ /dev/null @@ -1 +0,0 @@ -export * from '@storybook/core/babel'; diff --git a/code/lib/cli/core/builder-manager/index.cjs b/code/lib/cli/core/builder-manager/index.cjs deleted file mode 100644 index 0582f86fac91..000000000000 --- a/code/lib/cli/core/builder-manager/index.cjs +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('@storybook/core/builder-manager'); diff --git a/code/lib/cli/core/builder-manager/index.d.ts b/code/lib/cli/core/builder-manager/index.d.ts deleted file mode 100644 index f4367f7678d7..000000000000 --- a/code/lib/cli/core/builder-manager/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from '@storybook/core/builder-manager'; -export type * from '@storybook/core/builder-manager'; diff --git a/code/lib/cli/core/builder-manager/index.js b/code/lib/cli/core/builder-manager/index.js deleted file mode 100644 index 77114582e295..000000000000 --- a/code/lib/cli/core/builder-manager/index.js +++ /dev/null @@ -1 +0,0 @@ -export * from '@storybook/core/builder-manager'; diff --git a/code/lib/cli/core/channels/index.cjs b/code/lib/cli/core/channels/index.cjs deleted file mode 100644 index 3a7134d94607..000000000000 --- a/code/lib/cli/core/channels/index.cjs +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('@storybook/core/channels'); diff --git a/code/lib/cli/core/channels/index.d.ts b/code/lib/cli/core/channels/index.d.ts deleted file mode 100644 index e016a9453232..000000000000 --- a/code/lib/cli/core/channels/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from '@storybook/core/channels'; -export type * from '@storybook/core/channels'; diff --git a/code/lib/cli/core/channels/index.js b/code/lib/cli/core/channels/index.js deleted file mode 100644 index decffc31a8f3..000000000000 --- a/code/lib/cli/core/channels/index.js +++ /dev/null @@ -1 +0,0 @@ -export * from '@storybook/core/channels'; diff --git a/code/lib/cli/core/cli/bin/index.cjs b/code/lib/cli/core/cli/bin/index.cjs deleted file mode 100644 index 28b8be5e01cc..000000000000 --- a/code/lib/cli/core/cli/bin/index.cjs +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('@storybook/core/cli/bin'); diff --git a/code/lib/cli/core/cli/bin/index.d.ts b/code/lib/cli/core/cli/bin/index.d.ts deleted file mode 100644 index c846fa780147..000000000000 --- a/code/lib/cli/core/cli/bin/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from '@storybook/core/cli/bin'; -export type * from '@storybook/core/cli/bin'; diff --git a/code/lib/cli/core/cli/bin/index.js b/code/lib/cli/core/cli/bin/index.js deleted file mode 100644 index 32a19f877c90..000000000000 --- a/code/lib/cli/core/cli/bin/index.js +++ /dev/null @@ -1 +0,0 @@ -export * from '@storybook/core/cli/bin'; diff --git a/code/lib/cli/core/cli/index.cjs b/code/lib/cli/core/cli/index.cjs deleted file mode 100644 index 023342dde38e..000000000000 --- a/code/lib/cli/core/cli/index.cjs +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('@storybook/core/cli'); diff --git a/code/lib/cli/core/cli/index.d.ts b/code/lib/cli/core/cli/index.d.ts deleted file mode 100644 index 2ce4e03dd15f..000000000000 --- a/code/lib/cli/core/cli/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from '@storybook/core/cli'; -export type * from '@storybook/core/cli'; diff --git a/code/lib/cli/core/cli/index.js b/code/lib/cli/core/cli/index.js deleted file mode 100644 index 59fef763e102..000000000000 --- a/code/lib/cli/core/cli/index.js +++ /dev/null @@ -1 +0,0 @@ -export * from '@storybook/core/cli'; diff --git a/code/lib/cli/core/client-logger/index.cjs b/code/lib/cli/core/client-logger/index.cjs deleted file mode 100644 index 59df24773ae3..000000000000 --- a/code/lib/cli/core/client-logger/index.cjs +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('@storybook/core/client-logger'); diff --git a/code/lib/cli/core/client-logger/index.d.ts b/code/lib/cli/core/client-logger/index.d.ts deleted file mode 100644 index 77a41557155b..000000000000 --- a/code/lib/cli/core/client-logger/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from '@storybook/core/client-logger'; -export type * from '@storybook/core/client-logger'; diff --git a/code/lib/cli/core/client-logger/index.js b/code/lib/cli/core/client-logger/index.js deleted file mode 100644 index d44c114b44f1..000000000000 --- a/code/lib/cli/core/client-logger/index.js +++ /dev/null @@ -1 +0,0 @@ -export * from '@storybook/core/client-logger'; diff --git a/code/lib/cli/core/common/index.cjs b/code/lib/cli/core/common/index.cjs deleted file mode 100644 index 915b490c3513..000000000000 --- a/code/lib/cli/core/common/index.cjs +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('@storybook/core/common'); diff --git a/code/lib/cli/core/common/index.d.ts b/code/lib/cli/core/common/index.d.ts deleted file mode 100644 index 7665530a7643..000000000000 --- a/code/lib/cli/core/common/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from '@storybook/core/common'; -export type * from '@storybook/core/common'; diff --git a/code/lib/cli/core/common/index.js b/code/lib/cli/core/common/index.js deleted file mode 100644 index 68e8304b9684..000000000000 --- a/code/lib/cli/core/common/index.js +++ /dev/null @@ -1 +0,0 @@ -export * from '@storybook/core/common'; diff --git a/code/lib/cli/core/components/index.cjs b/code/lib/cli/core/components/index.cjs deleted file mode 100644 index 948b1dceaa20..000000000000 --- a/code/lib/cli/core/components/index.cjs +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('@storybook/core/components'); diff --git a/code/lib/cli/core/components/index.d.ts b/code/lib/cli/core/components/index.d.ts deleted file mode 100644 index dcca580fcb76..000000000000 --- a/code/lib/cli/core/components/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from '@storybook/core/components'; -export type * from '@storybook/core/components'; diff --git a/code/lib/cli/core/components/index.js b/code/lib/cli/core/components/index.js deleted file mode 100644 index b9a21f01890e..000000000000 --- a/code/lib/cli/core/components/index.js +++ /dev/null @@ -1 +0,0 @@ -export * from '@storybook/core/components'; diff --git a/code/lib/cli/core/core-events/index.cjs b/code/lib/cli/core/core-events/index.cjs deleted file mode 100644 index 9db3090385a8..000000000000 --- a/code/lib/cli/core/core-events/index.cjs +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('@storybook/core/core-events'); diff --git a/code/lib/cli/core/core-events/index.d.ts b/code/lib/cli/core/core-events/index.d.ts deleted file mode 100644 index f4291440fc36..000000000000 --- a/code/lib/cli/core/core-events/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from '@storybook/core/core-events'; -export type * from '@storybook/core/core-events'; diff --git a/code/lib/cli/core/core-events/index.js b/code/lib/cli/core/core-events/index.js deleted file mode 100644 index cdad00789b18..000000000000 --- a/code/lib/cli/core/core-events/index.js +++ /dev/null @@ -1 +0,0 @@ -export * from '@storybook/core/core-events'; diff --git a/code/lib/cli/core/core-server/index.cjs b/code/lib/cli/core/core-server/index.cjs deleted file mode 100644 index c4a21d0d0f7d..000000000000 --- a/code/lib/cli/core/core-server/index.cjs +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('@storybook/core/core-server'); diff --git a/code/lib/cli/core/core-server/index.d.ts b/code/lib/cli/core/core-server/index.d.ts deleted file mode 100644 index 32b7fc4583e3..000000000000 --- a/code/lib/cli/core/core-server/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from '@storybook/core/core-server'; -export type * from '@storybook/core/core-server'; diff --git a/code/lib/cli/core/core-server/index.js b/code/lib/cli/core/core-server/index.js deleted file mode 100644 index fef6373082b0..000000000000 --- a/code/lib/cli/core/core-server/index.js +++ /dev/null @@ -1 +0,0 @@ -export * from '@storybook/core/core-server'; diff --git a/code/lib/cli/core/core-server/presets/common-manager.js b/code/lib/cli/core/core-server/presets/common-manager.js deleted file mode 100644 index dd6a9887fc63..000000000000 --- a/code/lib/cli/core/core-server/presets/common-manager.js +++ /dev/null @@ -1 +0,0 @@ -export * from '@storybook/core/core-server/presets/common-manager'; diff --git a/code/lib/cli/core/core-server/presets/common-override-preset.cjs b/code/lib/cli/core/core-server/presets/common-override-preset.cjs deleted file mode 100644 index 37b00327d4d8..000000000000 --- a/code/lib/cli/core/core-server/presets/common-override-preset.cjs +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('@storybook/core/core-server/presets/common-override-preset'); diff --git a/code/lib/cli/core/core-server/presets/common-override-preset.js b/code/lib/cli/core/core-server/presets/common-override-preset.js deleted file mode 100644 index 976bb94cd511..000000000000 --- a/code/lib/cli/core/core-server/presets/common-override-preset.js +++ /dev/null @@ -1 +0,0 @@ -export * from '@storybook/core/core-server/presets/common-override-preset'; diff --git a/code/lib/cli/core/core-server/presets/common-preset.cjs b/code/lib/cli/core/core-server/presets/common-preset.cjs deleted file mode 100644 index f89cd2ce7968..000000000000 --- a/code/lib/cli/core/core-server/presets/common-preset.cjs +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('@storybook/core/core-server/presets/common-preset'); diff --git a/code/lib/cli/core/core-server/presets/common-preset.js b/code/lib/cli/core/core-server/presets/common-preset.js deleted file mode 100644 index 11f72497e11d..000000000000 --- a/code/lib/cli/core/core-server/presets/common-preset.js +++ /dev/null @@ -1 +0,0 @@ -export * from '@storybook/core/core-server/presets/common-preset'; diff --git a/code/lib/cli/core/csf-tools/index.cjs b/code/lib/cli/core/csf-tools/index.cjs deleted file mode 100644 index 732eb73d92a5..000000000000 --- a/code/lib/cli/core/csf-tools/index.cjs +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('@storybook/core/csf-tools'); diff --git a/code/lib/cli/core/csf-tools/index.d.ts b/code/lib/cli/core/csf-tools/index.d.ts deleted file mode 100644 index 0005eff71fbe..000000000000 --- a/code/lib/cli/core/csf-tools/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from '@storybook/core/csf-tools'; -export type * from '@storybook/core/csf-tools'; diff --git a/code/lib/cli/core/csf-tools/index.js b/code/lib/cli/core/csf-tools/index.js deleted file mode 100644 index 847e92d45fef..000000000000 --- a/code/lib/cli/core/csf-tools/index.js +++ /dev/null @@ -1 +0,0 @@ -export * from '@storybook/core/csf-tools'; diff --git a/code/lib/cli/core/docs-tools/index.cjs b/code/lib/cli/core/docs-tools/index.cjs deleted file mode 100644 index 9af3433ed2d7..000000000000 --- a/code/lib/cli/core/docs-tools/index.cjs +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('@storybook/core/docs-tools'); diff --git a/code/lib/cli/core/docs-tools/index.d.ts b/code/lib/cli/core/docs-tools/index.d.ts deleted file mode 100644 index 57d0a6791b48..000000000000 --- a/code/lib/cli/core/docs-tools/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from '@storybook/core/docs-tools'; -export type * from '@storybook/core/docs-tools'; diff --git a/code/lib/cli/core/docs-tools/index.js b/code/lib/cli/core/docs-tools/index.js deleted file mode 100644 index 74811e14ac2e..000000000000 --- a/code/lib/cli/core/docs-tools/index.js +++ /dev/null @@ -1 +0,0 @@ -export * from '@storybook/core/docs-tools'; diff --git a/code/lib/cli/core/index.cjs b/code/lib/cli/core/index.cjs deleted file mode 100644 index 2bf20ff12ab3..000000000000 --- a/code/lib/cli/core/index.cjs +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('@storybook/core/index'); diff --git a/code/lib/cli/core/index.d.ts b/code/lib/cli/core/index.d.ts deleted file mode 100644 index ea19cac5b37c..000000000000 --- a/code/lib/cli/core/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from '@storybook/core/index'; -export type * from '@storybook/core/index'; diff --git a/code/lib/cli/core/index.js b/code/lib/cli/core/index.js deleted file mode 100644 index ef7916066daa..000000000000 --- a/code/lib/cli/core/index.js +++ /dev/null @@ -1 +0,0 @@ -export * from '@storybook/core/index'; diff --git a/code/lib/cli/core/manager-api/index.cjs b/code/lib/cli/core/manager-api/index.cjs deleted file mode 100644 index 663a30f0b2c5..000000000000 --- a/code/lib/cli/core/manager-api/index.cjs +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('@storybook/core/manager-api'); diff --git a/code/lib/cli/core/manager-api/index.d.ts b/code/lib/cli/core/manager-api/index.d.ts deleted file mode 100644 index 9efaf590ba81..000000000000 --- a/code/lib/cli/core/manager-api/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from '@storybook/core/manager-api'; -export type * from '@storybook/core/manager-api'; diff --git a/code/lib/cli/core/manager-api/index.js b/code/lib/cli/core/manager-api/index.js deleted file mode 100644 index 5eb93cb979a0..000000000000 --- a/code/lib/cli/core/manager-api/index.js +++ /dev/null @@ -1 +0,0 @@ -export * from '@storybook/core/manager-api'; diff --git a/code/lib/cli/core/manager-errors.d.ts b/code/lib/cli/core/manager-errors.d.ts deleted file mode 100644 index 131783ee6986..000000000000 --- a/code/lib/cli/core/manager-errors.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from '@storybook/core/manager-errors'; -export type * from '@storybook/core/manager-errors'; diff --git a/code/lib/cli/core/manager-errors.js b/code/lib/cli/core/manager-errors.js deleted file mode 100644 index 13910319d675..000000000000 --- a/code/lib/cli/core/manager-errors.js +++ /dev/null @@ -1 +0,0 @@ -export * from '@storybook/core/manager-errors'; diff --git a/code/lib/cli/core/manager/globals-module-info.cjs b/code/lib/cli/core/manager/globals-module-info.cjs deleted file mode 100644 index 3b115408b001..000000000000 --- a/code/lib/cli/core/manager/globals-module-info.cjs +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('@storybook/core/manager/globals-module-info'); diff --git a/code/lib/cli/core/manager/globals-module-info.d.ts b/code/lib/cli/core/manager/globals-module-info.d.ts deleted file mode 100644 index 111fa9c73720..000000000000 --- a/code/lib/cli/core/manager/globals-module-info.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from '@storybook/core/manager/globals-module-info'; -export type * from '@storybook/core/manager/globals-module-info'; diff --git a/code/lib/cli/core/manager/globals-module-info.js b/code/lib/cli/core/manager/globals-module-info.js deleted file mode 100644 index bb4a51c3c5ea..000000000000 --- a/code/lib/cli/core/manager/globals-module-info.js +++ /dev/null @@ -1 +0,0 @@ -export * from '@storybook/core/manager/globals-module-info'; diff --git a/code/lib/cli/core/manager/globals-runtime.js b/code/lib/cli/core/manager/globals-runtime.js deleted file mode 100644 index 5b5c33945b1a..000000000000 --- a/code/lib/cli/core/manager/globals-runtime.js +++ /dev/null @@ -1 +0,0 @@ -export * from '@storybook/core/manager/globals-runtime'; diff --git a/code/lib/cli/core/manager/globals.cjs b/code/lib/cli/core/manager/globals.cjs deleted file mode 100644 index 3dc797bf4cd7..000000000000 --- a/code/lib/cli/core/manager/globals.cjs +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('@storybook/core/manager/globals'); diff --git a/code/lib/cli/core/manager/globals.d.ts b/code/lib/cli/core/manager/globals.d.ts deleted file mode 100644 index 47746a38ada4..000000000000 --- a/code/lib/cli/core/manager/globals.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from '@storybook/core/manager/globals'; -export type * from '@storybook/core/manager/globals'; diff --git a/code/lib/cli/core/manager/globals.js b/code/lib/cli/core/manager/globals.js deleted file mode 100644 index 779828900cda..000000000000 --- a/code/lib/cli/core/manager/globals.js +++ /dev/null @@ -1 +0,0 @@ -export * from '@storybook/core/manager/globals'; diff --git a/code/lib/cli/core/node-logger/index.cjs b/code/lib/cli/core/node-logger/index.cjs deleted file mode 100644 index df7718d330bf..000000000000 --- a/code/lib/cli/core/node-logger/index.cjs +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('@storybook/core/node-logger'); diff --git a/code/lib/cli/core/node-logger/index.d.ts b/code/lib/cli/core/node-logger/index.d.ts deleted file mode 100644 index 7d65df337415..000000000000 --- a/code/lib/cli/core/node-logger/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from '@storybook/core/node-logger'; -export type * from '@storybook/core/node-logger'; diff --git a/code/lib/cli/core/node-logger/index.js b/code/lib/cli/core/node-logger/index.js deleted file mode 100644 index a0cd3b44e714..000000000000 --- a/code/lib/cli/core/node-logger/index.js +++ /dev/null @@ -1 +0,0 @@ -export * from '@storybook/core/node-logger'; diff --git a/code/lib/cli/core/preview-api/index.cjs b/code/lib/cli/core/preview-api/index.cjs deleted file mode 100644 index e966223abf1d..000000000000 --- a/code/lib/cli/core/preview-api/index.cjs +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('@storybook/core/preview-api'); diff --git a/code/lib/cli/core/preview-api/index.d.ts b/code/lib/cli/core/preview-api/index.d.ts deleted file mode 100644 index 8ae857586fbd..000000000000 --- a/code/lib/cli/core/preview-api/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from '@storybook/core/preview-api'; -export type * from '@storybook/core/preview-api'; diff --git a/code/lib/cli/core/preview-api/index.js b/code/lib/cli/core/preview-api/index.js deleted file mode 100644 index 4b5493c3e244..000000000000 --- a/code/lib/cli/core/preview-api/index.js +++ /dev/null @@ -1 +0,0 @@ -export * from '@storybook/core/preview-api'; diff --git a/code/lib/cli/core/preview-errors.cjs b/code/lib/cli/core/preview-errors.cjs deleted file mode 100644 index 4d8c191e15d2..000000000000 --- a/code/lib/cli/core/preview-errors.cjs +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('@storybook/core/preview-errors'); diff --git a/code/lib/cli/core/preview-errors.d.ts b/code/lib/cli/core/preview-errors.d.ts deleted file mode 100644 index 1f3ad509a404..000000000000 --- a/code/lib/cli/core/preview-errors.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from '@storybook/core/preview-errors'; -export type * from '@storybook/core/preview-errors'; diff --git a/code/lib/cli/core/preview-errors.js b/code/lib/cli/core/preview-errors.js deleted file mode 100644 index 57e9b5fcf2b4..000000000000 --- a/code/lib/cli/core/preview-errors.js +++ /dev/null @@ -1 +0,0 @@ -export * from '@storybook/core/preview-errors'; diff --git a/code/lib/cli/core/preview/globals.cjs b/code/lib/cli/core/preview/globals.cjs deleted file mode 100644 index af5d8fb28d6b..000000000000 --- a/code/lib/cli/core/preview/globals.cjs +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('@storybook/core/preview/globals'); diff --git a/code/lib/cli/core/preview/globals.d.ts b/code/lib/cli/core/preview/globals.d.ts deleted file mode 100644 index 419e1626eaad..000000000000 --- a/code/lib/cli/core/preview/globals.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from '@storybook/core/preview/globals'; -export type * from '@storybook/core/preview/globals'; diff --git a/code/lib/cli/core/preview/globals.js b/code/lib/cli/core/preview/globals.js deleted file mode 100644 index 354ef613559f..000000000000 --- a/code/lib/cli/core/preview/globals.js +++ /dev/null @@ -1 +0,0 @@ -export * from '@storybook/core/preview/globals'; diff --git a/code/lib/cli/core/preview/runtime.js b/code/lib/cli/core/preview/runtime.js deleted file mode 100644 index 612f0116dc32..000000000000 --- a/code/lib/cli/core/preview/runtime.js +++ /dev/null @@ -1 +0,0 @@ -export * from '@storybook/core/preview/runtime'; diff --git a/code/lib/cli/core/router/index.cjs b/code/lib/cli/core/router/index.cjs deleted file mode 100644 index 663cce17cc32..000000000000 --- a/code/lib/cli/core/router/index.cjs +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('@storybook/core/router'); diff --git a/code/lib/cli/core/router/index.d.ts b/code/lib/cli/core/router/index.d.ts deleted file mode 100644 index c32cafe337b8..000000000000 --- a/code/lib/cli/core/router/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from '@storybook/core/router'; -export type * from '@storybook/core/router'; diff --git a/code/lib/cli/core/router/index.js b/code/lib/cli/core/router/index.js deleted file mode 100644 index 9de4a0584100..000000000000 --- a/code/lib/cli/core/router/index.js +++ /dev/null @@ -1 +0,0 @@ -export * from '@storybook/core/router'; diff --git a/code/lib/cli/core/server-errors.cjs b/code/lib/cli/core/server-errors.cjs deleted file mode 100644 index 867fe400c201..000000000000 --- a/code/lib/cli/core/server-errors.cjs +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('@storybook/core/server-errors'); diff --git a/code/lib/cli/core/server-errors.d.ts b/code/lib/cli/core/server-errors.d.ts deleted file mode 100644 index 0462c9d7f2a8..000000000000 --- a/code/lib/cli/core/server-errors.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from '@storybook/core/server-errors'; -export type * from '@storybook/core/server-errors'; diff --git a/code/lib/cli/core/server-errors.js b/code/lib/cli/core/server-errors.js deleted file mode 100644 index 5b52be6ccc4c..000000000000 --- a/code/lib/cli/core/server-errors.js +++ /dev/null @@ -1 +0,0 @@ -export * from '@storybook/core/server-errors'; diff --git a/code/lib/cli/core/telemetry/index.cjs b/code/lib/cli/core/telemetry/index.cjs deleted file mode 100644 index 10d865bd088e..000000000000 --- a/code/lib/cli/core/telemetry/index.cjs +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('@storybook/core/telemetry'); diff --git a/code/lib/cli/core/telemetry/index.d.ts b/code/lib/cli/core/telemetry/index.d.ts deleted file mode 100644 index 4e61f1036ac8..000000000000 --- a/code/lib/cli/core/telemetry/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from '@storybook/core/telemetry'; -export type * from '@storybook/core/telemetry'; diff --git a/code/lib/cli/core/telemetry/index.js b/code/lib/cli/core/telemetry/index.js deleted file mode 100644 index e7f905e56f7d..000000000000 --- a/code/lib/cli/core/telemetry/index.js +++ /dev/null @@ -1 +0,0 @@ -export * from '@storybook/core/telemetry'; diff --git a/code/lib/cli/core/theming/create.cjs b/code/lib/cli/core/theming/create.cjs deleted file mode 100644 index 27f33e6b1cd7..000000000000 --- a/code/lib/cli/core/theming/create.cjs +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('@storybook/core/theming/create'); diff --git a/code/lib/cli/core/theming/create.d.ts b/code/lib/cli/core/theming/create.d.ts deleted file mode 100644 index 19813279e3db..000000000000 --- a/code/lib/cli/core/theming/create.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from '@storybook/core/theming/create'; -export type * from '@storybook/core/theming/create'; diff --git a/code/lib/cli/core/theming/create.js b/code/lib/cli/core/theming/create.js deleted file mode 100644 index dde5c77a4c9e..000000000000 --- a/code/lib/cli/core/theming/create.js +++ /dev/null @@ -1 +0,0 @@ -export * from '@storybook/core/theming/create'; diff --git a/code/lib/cli/core/theming/index.cjs b/code/lib/cli/core/theming/index.cjs deleted file mode 100644 index 9bbd86c495ec..000000000000 --- a/code/lib/cli/core/theming/index.cjs +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('@storybook/core/theming'); diff --git a/code/lib/cli/core/theming/index.d.ts b/code/lib/cli/core/theming/index.d.ts deleted file mode 100644 index 6b0ecfaabb13..000000000000 --- a/code/lib/cli/core/theming/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from '@storybook/core/theming'; -export type * from '@storybook/core/theming'; diff --git a/code/lib/cli/core/theming/index.js b/code/lib/cli/core/theming/index.js deleted file mode 100644 index dc54a4fc4b73..000000000000 --- a/code/lib/cli/core/theming/index.js +++ /dev/null @@ -1 +0,0 @@ -export * from '@storybook/core/theming'; diff --git a/code/lib/cli/core/types/index.cjs b/code/lib/cli/core/types/index.cjs deleted file mode 100644 index b694805927ff..000000000000 --- a/code/lib/cli/core/types/index.cjs +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('@storybook/core/types'); diff --git a/code/lib/cli/core/types/index.d.ts b/code/lib/cli/core/types/index.d.ts deleted file mode 100644 index 8a3c5408f17d..000000000000 --- a/code/lib/cli/core/types/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from '@storybook/core/types'; -export type * from '@storybook/core/types'; diff --git a/code/lib/cli/core/types/index.js b/code/lib/cli/core/types/index.js deleted file mode 100644 index f92be93e094e..000000000000 --- a/code/lib/cli/core/types/index.js +++ /dev/null @@ -1 +0,0 @@ -export * from '@storybook/core/types'; diff --git a/code/lib/cli/docs/getstorybook.png b/code/lib/cli/docs/getstorybook.png deleted file mode 100644 index 90dd790ee92d..000000000000 Binary files a/code/lib/cli/docs/getstorybook.png and /dev/null differ diff --git a/code/lib/cli/package.json b/code/lib/cli/package.json deleted file mode 100644 index 9aa43e3a444a..000000000000 --- a/code/lib/cli/package.json +++ /dev/null @@ -1,344 +0,0 @@ -{ - "name": "storybook", - "version": "8.5.0-beta.7", - "description": "Storybook's CLI - install, dev, build, upgrade, and more", - "keywords": [ - "cli", - "generator", - "dev", - "build", - "upgrade" - ], - "homepage": "https://github.com/storybookjs/storybook/tree/next/code/lib/cli", - "bugs": { - "url": "https://github.com/storybookjs/storybook/issues" - }, - "repository": { - "type": "git", - "url": "https://github.com/storybookjs/storybook.git", - "directory": "code/lib/cli" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/storybook" - }, - "license": "MIT", - "author": "Storybook Team", - "type": "module", - "exports": { - ".": { - "types": "./dist/index.d.ts", - "node": "./dist/index.cjs", - "import": "./dist/index.js", - "require": "./dist/index.cjs" - }, - "./bin/index.cjs": { - "node": "./bin/index.cjs", - "require": "./bin/index.cjs" - }, - "./core-path": { - "types": "./dist/core-path.d.ts", - "node": "./dist/core-path.cjs", - "import": "./dist/core-path.js", - "require": "./dist/core-path.cjs" - }, - "./package.json": "./package.json", - "./core": { - "types": "./core/index.d.ts", - "import": "./core/index.js", - "require": "./core/index.cjs" - }, - "./internal/node-logger": { - "types": "./core/node-logger/index.d.ts", - "import": "./core/node-logger/index.js", - "require": "./core/node-logger/index.cjs" - }, - "./internal/client-logger": { - "types": "./core/client-logger/index.d.ts", - "import": "./core/client-logger/index.js", - "require": "./core/client-logger/index.cjs" - }, - "./internal/core-server": { - "types": "./core/core-server/index.d.ts", - "import": "./core/core-server/index.js", - "require": "./core/core-server/index.cjs" - }, - "./internal/core-server/presets/common-preset": { - "import": "./core/core-server/presets/common-preset.js", - "require": "./core/core-server/presets/common-preset.cjs" - }, - "./internal/core-server/presets/common-manager": { - "import": "./core/core-server/presets/common-manager.js" - }, - "./internal/core-server/presets/common-override-preset": { - "import": "./core/core-server/presets/common-override-preset.js", - "require": "./core/core-server/presets/common-override-preset.cjs" - }, - "./internal/core-events": { - "types": "./core/core-events/index.d.ts", - "import": "./core/core-events/index.js", - "require": "./core/core-events/index.cjs" - }, - "./internal/manager-errors": { - "types": "./core/manager-errors.d.ts", - "import": "./core/manager-errors.js" - }, - "./internal/preview-errors": { - "types": "./core/preview-errors.d.ts", - "import": "./core/preview-errors.js", - "require": "./core/preview-errors.cjs" - }, - "./internal/server-errors": { - "types": "./core/server-errors.d.ts", - "import": "./core/server-errors.js", - "require": "./core/server-errors.cjs" - }, - "./internal/channels": { - "types": "./core/channels/index.d.ts", - "import": "./core/channels/index.js", - "require": "./core/channels/index.cjs" - }, - "./internal/types": { - "types": "./core/types/index.d.ts", - "import": "./core/types/index.js", - "require": "./core/types/index.cjs" - }, - "./internal/csf-tools": { - "types": "./core/csf-tools/index.d.ts", - "import": "./core/csf-tools/index.js", - "require": "./core/csf-tools/index.cjs" - }, - "./internal/common": { - "types": "./core/common/index.d.ts", - "import": "./core/common/index.js", - "require": "./core/common/index.cjs" - }, - "./internal/builder-manager": { - "types": "./core/builder-manager/index.d.ts", - "import": "./core/builder-manager/index.js", - "require": "./core/builder-manager/index.cjs" - }, - "./internal/telemetry": { - "types": "./core/telemetry/index.d.ts", - "import": "./core/telemetry/index.js", - "require": "./core/telemetry/index.cjs" - }, - "./internal/preview-api": { - "types": "./core/preview-api/index.d.ts", - "import": "./core/preview-api/index.js", - "require": "./core/preview-api/index.cjs" - }, - "./internal/manager-api": { - "types": "./core/manager-api/index.d.ts", - "import": "./core/manager-api/index.js", - "require": "./core/manager-api/index.cjs" - }, - "./internal/router": { - "types": "./core/router/index.d.ts", - "import": "./core/router/index.js", - "require": "./core/router/index.cjs" - }, - "./internal/components": { - "types": "./core/components/index.d.ts", - "import": "./core/components/index.js", - "require": "./core/components/index.cjs" - }, - "./internal/theming": { - "types": "./core/theming/index.d.ts", - "import": "./core/theming/index.js", - "require": "./core/theming/index.cjs" - }, - "./internal/theming/create": { - "types": "./core/theming/create.d.ts", - "import": "./core/theming/create.js", - "require": "./core/theming/create.cjs" - }, - "./internal/docs-tools": { - "types": "./core/docs-tools/index.d.ts", - "import": "./core/docs-tools/index.js", - "require": "./core/docs-tools/index.cjs" - }, - "./internal/manager/globals-module-info": { - "types": "./core/manager/globals-module-info.d.ts", - "import": "./core/manager/globals-module-info.js", - "require": "./core/manager/globals-module-info.cjs" - }, - "./internal/preview/globals": { - "types": "./core/preview/globals.d.ts", - "import": "./core/preview/globals.js", - "require": "./core/preview/globals.cjs" - }, - "./internal/cli": { - "types": "./core/cli/index.d.ts", - "import": "./core/cli/index.js", - "require": "./core/cli/index.cjs" - }, - "./internal/cli/bin": { - "types": "./core/cli/bin/index.d.ts", - "import": "./core/cli/bin/index.js", - "require": "./core/cli/bin/index.cjs" - }, - "./internal/manager/globals": { - "types": "./core/manager/globals.d.ts", - "import": "./core/manager/globals.js", - "require": "./core/manager/globals.cjs" - }, - "./internal/babel": { - "types": "./core/babel/index.d.ts", - "import": "./core/babel/index.js", - "require": "./core/babel/index.cjs" - }, - "./internal/manager/globals-runtime": { - "import": "./core/manager/globals-runtime.js" - }, - "./internal/preview/runtime": { - "import": "./core/preview/runtime.js" - } - }, - "main": "dist/index.cjs", - "module": "dist/index.js", - "types": "dist/index.d.ts", - "typesVersions": { - "*": { - "internal/*": [ - "./core/index.d.ts" - ], - "internal/babel": [ - "./core/babel/index.d.ts" - ], - "internal/builder-manager": [ - "./core/builder-manager/index.d.ts" - ], - "internal/channels": [ - "./core/channels/index.d.ts" - ], - "internal/cli": [ - "./core/cli/index.d.ts" - ], - "internal/cli/bin": [ - "./core/cli/bin/index.d.ts" - ], - "internal/client-logger": [ - "./core/client-logger/index.d.ts" - ], - "internal/common": [ - "./core/common/index.d.ts" - ], - "internal/components": [ - "./core/components/index.d.ts" - ], - "internal/core-events": [ - "./core/core-events/index.d.ts" - ], - "internal/core-server": [ - "./core/core-server/index.d.ts" - ], - "internal/csf-tools": [ - "./core/csf-tools/index.d.ts" - ], - "internal/docs-tools": [ - "./core/docs-tools/index.d.ts" - ], - "internal/manager-api": [ - "./core/manager-api/index.d.ts" - ], - "internal/manager-errors": [ - "./core/manager-errors.d.ts" - ], - "internal/manager/globals": [ - "./core/manager/globals.d.ts" - ], - "internal/manager/globals-module-info": [ - "./core/manager/globals-module-info.d.ts" - ], - "internal/node-logger": [ - "./core/node-logger/index.d.ts" - ], - "internal/preview-api": [ - "./core/preview-api/index.d.ts" - ], - "internal/preview-errors": [ - "./core/preview-errors.d.ts" - ], - "internal/preview/globals": [ - "./core/preview/globals.d.ts" - ], - "internal/router": [ - "./core/router/index.d.ts" - ], - "internal/server-errors": [ - "./core/server-errors.d.ts" - ], - "internal/telemetry": [ - "./core/telemetry/index.d.ts" - ], - "internal/theming": [ - "./core/theming/index.d.ts" - ], - "internal/theming/create": [ - "./core/theming/create.d.ts" - ], - "internal/types": [ - "./core/types/index.d.ts" - ], - "*": [ - "./dist/index.d.ts" - ], - "core-path": [ - "./dist/core-path.d.ts" - ], - "core": [ - "./core/index.d.ts" - ] - } - }, - "bin": { - "getstorybook": "./bin/index.cjs", - "sb": "./bin/index.cjs", - "storybook": "./bin/index.cjs" - }, - "files": [ - "bin/**/*", - "core/**/*", - "dist/**/*", - "rendererAssets/**/*", - "templates/**/*", - "README.md", - "*.cjs", - "*.js", - "*.d.ts", - "!src/**/*" - ], - "scripts": { - "check": "jiti ../../../scripts/prepare/check.ts", - "prep": "jiti ../../../scripts/prepare/bundle.ts", - "sb": "node ./bin/index.js" - }, - "dependencies": { - "@storybook/core": "workspace:*" - }, - "devDependencies": { - "typescript": "^5.3.2" - }, - "peerDependencies": { - "prettier": "^2 || ^3" - }, - "peerDependenciesMeta": { - "prettier": { - "optional": true - } - }, - "publishConfig": { - "access": "public" - }, - "bundler": { - "pre": "./scripts/update-core-portal.ts", - "entries": [ - "./src/proxy.ts", - "./src/core-path.ts", - "./src/index.ts" - ], - "platform": "node" - }, - "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae16" -} diff --git a/code/lib/cli/project.json b/code/lib/cli/project.json deleted file mode 100644 index 4f06674e2e03..000000000000 --- a/code/lib/cli/project.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "storybook", - "$schema": "../../node_modules/nx/schemas/project-schema.json", - "projectType": "library", - "targets": { - "build": {} - } -} diff --git a/code/lib/cli/scripts/update-core-portal.ts b/code/lib/cli/scripts/update-core-portal.ts deleted file mode 100644 index 520bc3587848..000000000000 --- a/code/lib/cli/scripts/update-core-portal.ts +++ /dev/null @@ -1,87 +0,0 @@ -import { readFile } from 'node:fs/promises'; -import { join } from 'node:path'; - -import { sortPackageJson } from '../../../../scripts/node_modules/sort-package-json'; -import { generateMapperContent, mapCoreExportToSelf, write } from './utils'; - -/** - * Update the `storybook` package's `exports` and `typesVersion` fields to expose all things exposed - * from `@storybook/core` We do this to ensure that users that import `storybook/theming` will get - * the code located at `@storybook/theming` (note the `@` symbol!) - * - * For every entry in `core/package.json`'s `exports` field, we: - * - * - Update the `exports` field in `package.json` to map the entry to the corresponding entry in - * `core` - * - Write a new file in `core/X` that re-exports the entry from `@storybook/core/X` - * - * By reading from `core/package.json`, we ensure that we always have the correct exports. - * - * Removal is not handled here, so if entries are ever removed from `@storybook/core` we'll have to - * remove those manually here. - */ -async function run() { - const selfPackageJson = JSON.parse( - await readFile(join(__dirname, '../package.json'), { encoding: 'utf8' }) - ); - const corePackageJson = await JSON.parse( - await readFile(join(__dirname, '../../../core/package.json'), { encoding: 'utf8' }) - ); - - await Promise.all( - Object.entries>(corePackageJson.exports) - .sort() - .map(async ([key, input]) => { - const value = mapCoreExportToSelf(input); - if (key === './package.json') { - return; - } - if (key.startsWith('./dist')) { - return; - } - if (key === '.') { - selfPackageJson.exports['./core'] = value; - - await Promise.all( - Object.values(value).map(async (v) => { - await write(join(__dirname, '..', v), generateMapperContent(v)); - }) - ); - } else { - selfPackageJson.exports[key.replace('./', './internal/')] = value; - await Promise.all( - Object.values(value).map(async (v) => { - await write(join(__dirname, '..', v), generateMapperContent(v)); - }) - ); - } - }) - ); - - type RecordOfStrings = Record; - - selfPackageJson.typesVersions = { - '*': { - ...Object.entries(corePackageJson.typesVersions['*'] as RecordOfStrings) - .sort() - .reduce((acc, [key, value]) => { - acc['internal/' + key] = value.map((v) => v.replace('./dist/', './core/')); - return acc; - }, {}), - '*': ['./dist/index.d.ts'], - 'core-path': ['./dist/core-path.d.ts'], - - core: ['./core/index.d.ts'], - }, - }; - - await write( - join(__dirname, '../package.json'), - JSON.stringify(sortPackageJson(selfPackageJson), null, 2) + '\n' - ); -} - -run().catch((error) => { - console.error(error); - process.exit(1); -}); diff --git a/code/lib/cli/scripts/utils.ts b/code/lib/cli/scripts/utils.ts deleted file mode 100644 index 1c27080075c5..000000000000 --- a/code/lib/cli/scripts/utils.ts +++ /dev/null @@ -1,46 +0,0 @@ -import { existsSync } from 'node:fs'; -import { mkdir, writeFile } from 'node:fs/promises'; -import { dirname } from 'node:path'; - -import { dedent } from 'ts-dedent'; - -export const write = async (location: string, data: string) => { - if (!existsSync(location)) { - const directory = dirname(location); - await mkdir(directory, { recursive: true }); - } - return writeFile(location, data); -}; - -export const mapCoreExportToSelf = (map: Record) => { - return Object.entries(map).reduce>((acc, [key, input]) => { - const value = input.replace('./dist/', './core/'); - acc[key] = value; - - return acc; - }, {}); -}; - -export const generateMapperContent = (input: string) => { - const value = input - .replace('./core/', '') - .replace('/index', '') - .replace('.cjs', '') - .replace('.d.ts', '') - .replace('.mjs', '') - .replace('.js', ''); - if (input.endsWith('.js')) { - return `export * from '@storybook/core/${value}';\n`; - } - if (input.endsWith('.cjs')) { - return `module.exports = require('@storybook/core/${value}');\n`; - } - if (input.endsWith('.d.ts')) { - return dedent` - export * from '@storybook/core/${value}'; - export type * from '@storybook/core/${value}';\n - `; - } - // eslint-disable-next-line local-rules/no-uncategorized-errors - throw new Error(`Unexpected input: ${input}`); -}; diff --git a/code/lib/cli/src/core-path.ts b/code/lib/cli/src/core-path.ts deleted file mode 100644 index 63785643aba8..000000000000 --- a/code/lib/cli/src/core-path.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { dirname } from 'node:path'; - -export const corePath = dirname(require.resolve('@storybook/core/package.json')); diff --git a/code/lib/cli/src/index.ts b/code/lib/cli/src/index.ts deleted file mode 100644 index 4dcb8c60afef..000000000000 --- a/code/lib/cli/src/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { deprecate } from '@storybook/core/node-logger'; - -deprecate( - 'Exports from @storybook/cli are removed. Please import from @storybook/core-common instead.' -); diff --git a/code/lib/cli/tsconfig.json b/code/lib/cli/tsconfig.json deleted file mode 100644 index 2831f7bb6d03..000000000000 --- a/code/lib/cli/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": {}, - "extends": "../../tsconfig.json", - "include": ["src/**/*"] -} diff --git a/code/lib/cli/vitest.config.ts b/code/lib/cli/vitest.config.ts deleted file mode 100644 index 7420176b2e46..000000000000 --- a/code/lib/cli/vitest.config.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { defineConfig, mergeConfig } from 'vitest/config'; - -import { vitestCommonConfig } from '../../vitest.workspace'; - -export default mergeConfig( - vitestCommonConfig, - defineConfig({ - // Add custom config here - }) -); diff --git a/code/lib/codemod/package.json b/code/lib/codemod/package.json index 99f6ebf2f4cf..e8c21af0230f 100644 --- a/code/lib/codemod/package.json +++ b/code/lib/codemod/package.json @@ -57,7 +57,6 @@ "@babel/core": "^7.24.4", "@babel/preset-env": "^7.24.4", "@babel/types": "^7.24.0", - "@storybook/core": "workspace:*", "@storybook/csf": "0.1.12", "@types/cross-spawn": "^6.0.2", "cross-spawn": "^7.0.3", @@ -66,6 +65,7 @@ "jscodeshift": "^0.15.1", "prettier": "^3.1.1", "recast": "^0.23.5", + "storybook": "workspace:*", "tiny-invariant": "^1.3.1" }, "devDependencies": { diff --git a/code/lib/codemod/src/transforms/__tests__/transforms.tests.js b/code/lib/codemod/src/transforms/__tests__/transforms.tests.js index 85aab5dc009f..c4c29cd68ab4 100644 --- a/code/lib/codemod/src/transforms/__tests__/transforms.tests.js +++ b/code/lib/codemod/src/transforms/__tests__/transforms.tests.js @@ -5,7 +5,7 @@ import { describe, expect, it, vi } from 'vitest'; import { applyTransform } from 'jscodeshift/dist/testUtils'; -vi.mock('@storybook/core/node-logger'); +vi.mock('storybook/internal/node-logger'); const inputRegExp = /\.input\.js$/; diff --git a/code/lib/codemod/src/transforms/csf-2-to-3.ts b/code/lib/codemod/src/transforms/csf-2-to-3.ts index 5383188978b5..becbac014625 100644 --- a/code/lib/codemod/src/transforms/csf-2-to-3.ts +++ b/code/lib/codemod/src/transforms/csf-2-to-3.ts @@ -1,9 +1,8 @@ /* eslint-disable no-underscore-dangle */ -import type { BabelFile, NodePath } from '@storybook/core/babel'; -import { core as babel, types as t } from '@storybook/core/babel'; - -import type { CsfFile } from '@storybook/core/csf-tools'; -import { loadCsf, printCsf } from '@storybook/core/csf-tools'; +import type { BabelFile, NodePath } from 'storybook/internal/babel'; +import { core as babel, types as t } from 'storybook/internal/babel'; +import type { CsfFile } from 'storybook/internal/csf-tools'; +import { loadCsf, printCsf } from 'storybook/internal/csf-tools'; import type { API, FileInfo } from 'jscodeshift'; import prettier from 'prettier'; diff --git a/code/lib/codemod/src/transforms/find-implicit-spies.ts b/code/lib/codemod/src/transforms/find-implicit-spies.ts index e3d6259a44b3..964eb54f9622 100644 --- a/code/lib/codemod/src/transforms/find-implicit-spies.ts +++ b/code/lib/codemod/src/transforms/find-implicit-spies.ts @@ -1,5 +1,5 @@ /* eslint-disable no-underscore-dangle */ -import { loadCsf } from '@storybook/core/csf-tools'; +import { loadCsf } from 'storybook/internal/csf-tools'; import type { BabelFile } from '@babel/core'; import * as babel from '@babel/core'; diff --git a/code/lib/codemod/src/transforms/mdx-to-csf.ts b/code/lib/codemod/src/transforms/mdx-to-csf.ts index c83f900d0d87..5e94c8f0b12f 100644 --- a/code/lib/codemod/src/transforms/mdx-to-csf.ts +++ b/code/lib/codemod/src/transforms/mdx-to-csf.ts @@ -9,7 +9,7 @@ import { babelParseExpression, recast, types as t, -} from '@storybook/core/babel'; +} from 'storybook/internal/babel'; import { camelCase } from 'es-toolkit'; import type { FileInfo } from 'jscodeshift'; diff --git a/code/lib/codemod/src/transforms/migrate-to-test-package.ts b/code/lib/codemod/src/transforms/migrate-to-test-package.ts index 1128be36d5d0..9fffa57f7ad6 100644 --- a/code/lib/codemod/src/transforms/migrate-to-test-package.ts +++ b/code/lib/codemod/src/transforms/migrate-to-test-package.ts @@ -1,7 +1,6 @@ /* eslint-disable no-underscore-dangle */ -import { type BabelFile, core as babel, types as t } from '@storybook/core/babel'; - -import { loadCsf, printCsf } from '@storybook/core/csf-tools'; +import { type BabelFile, core as babel, types as t } from 'storybook/internal/babel'; +import { loadCsf, printCsf } from 'storybook/internal/csf-tools'; import type { FileInfo } from 'jscodeshift'; import prettier from 'prettier'; diff --git a/code/lib/codemod/src/transforms/storiesof-to-csf.js b/code/lib/codemod/src/transforms/storiesof-to-csf.js index 824282467ac7..312deed9c387 100644 --- a/code/lib/codemod/src/transforms/storiesof-to-csf.js +++ b/code/lib/codemod/src/transforms/storiesof-to-csf.js @@ -1,6 +1,6 @@ -import { storyNameFromExport } from '@storybook/csf'; +import { logger } from 'storybook/internal/node-logger'; -import { logger } from '@storybook/core/node-logger'; +import { storyNameFromExport } from '@storybook/csf'; import prettier from 'prettier'; diff --git a/code/lib/codemod/src/transforms/upgrade-deprecated-types.ts b/code/lib/codemod/src/transforms/upgrade-deprecated-types.ts index a8fe8f951718..3e59eff1cd52 100644 --- a/code/lib/codemod/src/transforms/upgrade-deprecated-types.ts +++ b/code/lib/codemod/src/transforms/upgrade-deprecated-types.ts @@ -1,7 +1,6 @@ /* eslint-disable no-underscore-dangle */ -import { type BabelFile, type NodePath, core as babel, types as t } from '@storybook/core/babel'; - -import { loadCsf, printCsf } from '@storybook/core/csf-tools'; +import { type BabelFile, type NodePath, core as babel, types as t } from 'storybook/internal/babel'; +import { loadCsf, printCsf } from 'storybook/internal/csf-tools'; import type { API, FileInfo } from 'jscodeshift'; import prettier from 'prettier'; diff --git a/code/lib/create-storybook/src/generators/SVELTE/index.test.ts b/code/lib/create-storybook/src/generators/SVELTE/index.test.ts index 0fb124025879..94128ba71916 100644 --- a/code/lib/create-storybook/src/generators/SVELTE/index.test.ts +++ b/code/lib/create-storybook/src/generators/SVELTE/index.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from 'vitest'; -import type { JsPackageManager } from '@storybook/core/common'; +import type { JsPackageManager } from 'storybook/internal/common'; import { getAddonSvelteCsfVersion } from './index'; diff --git a/code/package.json b/code/package.json index 095188241d45..bd38269cd23a 100644 --- a/code/package.json +++ b/code/package.json @@ -46,8 +46,8 @@ "lint:package": "sort-package-json", "local-registry": "yarn --cwd ../scripts local-registry", "publish-sandboxes": "yarn --cwd ../scripts publish", - "storybook:ui": "NODE_OPTIONS=\"--preserve-symlinks --preserve-symlinks-main\" ./lib/cli/bin/index.cjs dev --port 6006 --config-dir ./.storybook", - "storybook:ui:build": "NODE_OPTIONS=\"--preserve-symlinks --preserve-symlinks-main\" ./lib/cli/bin/index.cjs build --config-dir ./.storybook --webpack-stats-json", + "storybook:ui": "NODE_OPTIONS=\"--preserve-symlinks --preserve-symlinks-main\" ./core/bin/index.cjs dev --port 6006 --config-dir ./.storybook", + "storybook:ui:build": "NODE_OPTIONS=\"--preserve-symlinks --preserve-symlinks-main\" ./core/bin/index.cjs build --config-dir ./.storybook --webpack-stats-json", "storybook:ui:chromatic": "../scripts/node_modules/.bin/chromatic --build-script-name storybook:ui:build --storybook-base-dir ./ --exit-zero-on-changes --exit-once-uploaded", "storybook:vitest": "yarn test:watch --project storybook-ui", "storybook:vitest:inspect": "INSPECT=true yarn test --project storybook-ui", @@ -121,7 +121,6 @@ "@storybook/builder-vite": "workspace:*", "@storybook/builder-webpack5": "workspace:*", "@storybook/codemod": "workspace:*", - "@storybook/core": "workspace:*", "@storybook/core-webpack": "workspace:*", "@storybook/csf": "0.1.12", "@storybook/csf-plugin": "workspace:*", diff --git a/code/renderers/svelte/tsconfig.json b/code/renderers/svelte/tsconfig.json index ba474f5a2f5c..956d3494268e 100644 --- a/code/renderers/svelte/tsconfig.json +++ b/code/renderers/svelte/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "../../tsconfig.json", "compilerOptions": { - "module": "ESNext" + "rootDir": "../../../" }, "include": ["src/**/*", "src/**/*.svelte", "template/**/*", "template/**/*.svelte"] } diff --git a/code/sandbox/angular-cli-15-ts/project.json b/code/sandbox/angular-cli-15-ts/project.json index d2d595560d2a..d6b1a5552270 100644 --- a/code/sandbox/angular-cli-15-ts/project.json +++ b/code/sandbox/angular-cli-15-ts/project.json @@ -3,7 +3,6 @@ "$schema": "../../node_modules/nx/schemas/project-schema.json", "projectType": "application", "implicitDependencies": [ - "storybook", "core", "addon-essentials", "addon-interactions", diff --git a/code/sandbox/angular-cli-default-ts/project.json b/code/sandbox/angular-cli-default-ts/project.json index cb48bbc83e0e..7632b5c48937 100644 --- a/code/sandbox/angular-cli-default-ts/project.json +++ b/code/sandbox/angular-cli-default-ts/project.json @@ -3,7 +3,6 @@ "$schema": "../../node_modules/nx/schemas/project-schema.json", "projectType": "application", "implicitDependencies": [ - "storybook", "core", "addon-essentials", "addon-interactions", diff --git a/code/sandbox/angular-cli-prerelease/project.json b/code/sandbox/angular-cli-prerelease/project.json index 4433e7dde157..1587a5387ea5 100644 --- a/code/sandbox/angular-cli-prerelease/project.json +++ b/code/sandbox/angular-cli-prerelease/project.json @@ -3,7 +3,6 @@ "$schema": "../../node_modules/nx/schemas/project-schema.json", "projectType": "application", "implicitDependencies": [ - "storybook", "core", "addon-essentials", "addon-interactions", diff --git a/code/sandbox/bench-react-vite-default-ts-nodocs/project.json b/code/sandbox/bench-react-vite-default-ts-nodocs/project.json index e0ed20e23930..021350213dd6 100644 --- a/code/sandbox/bench-react-vite-default-ts-nodocs/project.json +++ b/code/sandbox/bench-react-vite-default-ts-nodocs/project.json @@ -3,7 +3,6 @@ "$schema": "../../node_modules/nx/schemas/project-schema.json", "projectType": "application", "implicitDependencies": [ - "storybook", "core", "addon-essentials", "addon-interactions", diff --git a/code/sandbox/bench-react-vite-default-ts-test-build/project.json b/code/sandbox/bench-react-vite-default-ts-test-build/project.json index 5e44f6ba14ce..75fde83971b3 100644 --- a/code/sandbox/bench-react-vite-default-ts-test-build/project.json +++ b/code/sandbox/bench-react-vite-default-ts-test-build/project.json @@ -3,7 +3,6 @@ "$schema": "../../node_modules/nx/schemas/project-schema.json", "projectType": "application", "implicitDependencies": [ - "storybook", "core", "addon-essentials", "addon-interactions", diff --git a/code/sandbox/bench-react-vite-default-ts/project.json b/code/sandbox/bench-react-vite-default-ts/project.json index a59cb05cc369..c88a13c77ce5 100644 --- a/code/sandbox/bench-react-vite-default-ts/project.json +++ b/code/sandbox/bench-react-vite-default-ts/project.json @@ -3,7 +3,6 @@ "$schema": "../../node_modules/nx/schemas/project-schema.json", "projectType": "application", "implicitDependencies": [ - "storybook", "core", "addon-essentials", "addon-interactions", diff --git a/code/sandbox/bench-react-webpack-18-ts-test-build/project.json b/code/sandbox/bench-react-webpack-18-ts-test-build/project.json index 647d78878fd3..a7b95c434494 100644 --- a/code/sandbox/bench-react-webpack-18-ts-test-build/project.json +++ b/code/sandbox/bench-react-webpack-18-ts-test-build/project.json @@ -3,7 +3,6 @@ "$schema": "../../node_modules/nx/schemas/project-schema.json", "projectType": "application", "implicitDependencies": [ - "storybook", "core", "addon-essentials", "addon-interactions", diff --git a/code/sandbox/bench-react-webpack-18-ts/project.json b/code/sandbox/bench-react-webpack-18-ts/project.json index 2825bb2831d2..1296b417b395 100644 --- a/code/sandbox/bench-react-webpack-18-ts/project.json +++ b/code/sandbox/bench-react-webpack-18-ts/project.json @@ -3,7 +3,6 @@ "$schema": "../../node_modules/nx/schemas/project-schema.json", "projectType": "application", "implicitDependencies": [ - "storybook", "core", "addon-essentials", "addon-interactions", diff --git a/code/sandbox/cra-default-js/project.json b/code/sandbox/cra-default-js/project.json index a8febc5d3b00..d2e69c94e5fe 100644 --- a/code/sandbox/cra-default-js/project.json +++ b/code/sandbox/cra-default-js/project.json @@ -3,7 +3,6 @@ "$schema": "../../node_modules/nx/schemas/project-schema.json", "projectType": "application", "implicitDependencies": [ - "storybook", "core", "addon-essentials", "addon-interactions", diff --git a/code/sandbox/cra-default-ts/project.json b/code/sandbox/cra-default-ts/project.json index b51b71aa0940..9c41f11d0c05 100644 --- a/code/sandbox/cra-default-ts/project.json +++ b/code/sandbox/cra-default-ts/project.json @@ -3,7 +3,6 @@ "$schema": "../../node_modules/nx/schemas/project-schema.json", "projectType": "application", "implicitDependencies": [ - "storybook", "core", "addon-essentials", "addon-interactions", diff --git a/code/sandbox/ember-3-js/project.json b/code/sandbox/ember-3-js/project.json index 068515be75b2..1466ac8f83af 100644 --- a/code/sandbox/ember-3-js/project.json +++ b/code/sandbox/ember-3-js/project.json @@ -3,7 +3,6 @@ "$schema": "../../node_modules/nx/schemas/project-schema.json", "projectType": "application", "implicitDependencies": [ - "storybook", "core", "addon-essentials", "addon-interactions", diff --git a/code/sandbox/ember-default-js/project.json b/code/sandbox/ember-default-js/project.json index 81f91494ac2a..b70af44d8e8c 100644 --- a/code/sandbox/ember-default-js/project.json +++ b/code/sandbox/ember-default-js/project.json @@ -3,7 +3,6 @@ "$schema": "../../node_modules/nx/schemas/project-schema.json", "projectType": "application", "implicitDependencies": [ - "storybook", "core", "addon-essentials", "addon-interactions", diff --git a/code/sandbox/experimental-nextjs-vite-default-ts/project.json b/code/sandbox/experimental-nextjs-vite-default-ts/project.json index ae9d595865dd..19f7c07453aa 100644 --- a/code/sandbox/experimental-nextjs-vite-default-ts/project.json +++ b/code/sandbox/experimental-nextjs-vite-default-ts/project.json @@ -3,7 +3,6 @@ "$schema": "../../node_modules/nx/schemas/project-schema.json", "projectType": "application", "implicitDependencies": [ - "storybook", "core", "addon-essentials", "addon-interactions", diff --git a/code/sandbox/html-vite-default-js/project.json b/code/sandbox/html-vite-default-js/project.json index 9363e37e0b07..0e3cc85808a8 100644 --- a/code/sandbox/html-vite-default-js/project.json +++ b/code/sandbox/html-vite-default-js/project.json @@ -3,7 +3,6 @@ "$schema": "../../node_modules/nx/schemas/project-schema.json", "projectType": "application", "implicitDependencies": [ - "storybook", "core", "addon-essentials", "addon-interactions", diff --git a/code/sandbox/html-vite-default-ts/project.json b/code/sandbox/html-vite-default-ts/project.json index d816dd3fbd29..65f1231c5c1d 100644 --- a/code/sandbox/html-vite-default-ts/project.json +++ b/code/sandbox/html-vite-default-ts/project.json @@ -3,7 +3,6 @@ "$schema": "../../node_modules/nx/schemas/project-schema.json", "projectType": "application", "implicitDependencies": [ - "storybook", "core", "addon-essentials", "addon-interactions", diff --git a/code/sandbox/html-webpack-default/project.json b/code/sandbox/html-webpack-default/project.json index 466b55828a54..deba12107957 100644 --- a/code/sandbox/html-webpack-default/project.json +++ b/code/sandbox/html-webpack-default/project.json @@ -3,7 +3,6 @@ "$schema": "../../node_modules/nx/schemas/project-schema.json", "projectType": "application", "implicitDependencies": [ - "storybook", "core", "addon-essentials", "addon-interactions", diff --git a/code/sandbox/internal-react16-webpack/project.json b/code/sandbox/internal-react16-webpack/project.json index a2164412649b..09157d3a842e 100644 --- a/code/sandbox/internal-react16-webpack/project.json +++ b/code/sandbox/internal-react16-webpack/project.json @@ -3,7 +3,6 @@ "$schema": "../../node_modules/nx/schemas/project-schema.json", "projectType": "application", "implicitDependencies": [ - "storybook", "core", "addon-essentials", "addon-interactions", diff --git a/code/sandbox/internal-react18-webpack-babel/project.json b/code/sandbox/internal-react18-webpack-babel/project.json index e1585cc8ba0b..9ddf15267bbb 100644 --- a/code/sandbox/internal-react18-webpack-babel/project.json +++ b/code/sandbox/internal-react18-webpack-babel/project.json @@ -3,7 +3,6 @@ "$schema": "../../node_modules/nx/schemas/project-schema.json", "projectType": "application", "implicitDependencies": [ - "storybook", "core", "addon-essentials", "addon-interactions", diff --git a/code/sandbox/internal-server-webpack5/project.json b/code/sandbox/internal-server-webpack5/project.json index 51b572402699..5d143b47fcac 100644 --- a/code/sandbox/internal-server-webpack5/project.json +++ b/code/sandbox/internal-server-webpack5/project.json @@ -3,7 +3,6 @@ "$schema": "../../node_modules/nx/schemas/project-schema.json", "projectType": "application", "implicitDependencies": [ - "storybook", "core", "addon-essentials", "addon-interactions", diff --git a/code/sandbox/lit-vite-default-js/project.json b/code/sandbox/lit-vite-default-js/project.json index 22bf1065c982..07ce7905641d 100644 --- a/code/sandbox/lit-vite-default-js/project.json +++ b/code/sandbox/lit-vite-default-js/project.json @@ -3,7 +3,6 @@ "$schema": "../../node_modules/nx/schemas/project-schema.json", "projectType": "application", "implicitDependencies": [ - "storybook", "core", "addon-essentials", "addon-interactions", diff --git a/code/sandbox/lit-vite-default-ts/project.json b/code/sandbox/lit-vite-default-ts/project.json index 978833395968..375a9b862c47 100644 --- a/code/sandbox/lit-vite-default-ts/project.json +++ b/code/sandbox/lit-vite-default-ts/project.json @@ -3,7 +3,6 @@ "$schema": "../../node_modules/nx/schemas/project-schema.json", "projectType": "application", "implicitDependencies": [ - "storybook", "core", "addon-essentials", "addon-interactions", diff --git a/code/sandbox/nextjs-13-ts/project.json b/code/sandbox/nextjs-13-ts/project.json index d83ef788bf2c..efaf37bb0920 100644 --- a/code/sandbox/nextjs-13-ts/project.json +++ b/code/sandbox/nextjs-13-ts/project.json @@ -3,7 +3,6 @@ "$schema": "../../node_modules/nx/schemas/project-schema.json", "projectType": "application", "implicitDependencies": [ - "storybook", "core", "addon-essentials", "addon-interactions", diff --git a/code/sandbox/nextjs-default-js/project.json b/code/sandbox/nextjs-default-js/project.json index 540936cbd268..c2074e7978e9 100644 --- a/code/sandbox/nextjs-default-js/project.json +++ b/code/sandbox/nextjs-default-js/project.json @@ -3,7 +3,6 @@ "$schema": "../../node_modules/nx/schemas/project-schema.json", "projectType": "application", "implicitDependencies": [ - "storybook", "core", "addon-essentials", "addon-interactions", diff --git a/code/sandbox/nextjs-default-ts/project.json b/code/sandbox/nextjs-default-ts/project.json index 5144fc10b9d4..d25343ef2470 100644 --- a/code/sandbox/nextjs-default-ts/project.json +++ b/code/sandbox/nextjs-default-ts/project.json @@ -3,7 +3,6 @@ "$schema": "../../node_modules/nx/schemas/project-schema.json", "projectType": "application", "implicitDependencies": [ - "storybook", "core", "addon-essentials", "addon-interactions", diff --git a/code/sandbox/nextjs-prerelease/project.json b/code/sandbox/nextjs-prerelease/project.json index 9579c10b3928..5c7843a566ed 100644 --- a/code/sandbox/nextjs-prerelease/project.json +++ b/code/sandbox/nextjs-prerelease/project.json @@ -3,7 +3,6 @@ "$schema": "../../node_modules/nx/schemas/project-schema.json", "projectType": "application", "implicitDependencies": [ - "storybook", "core", "addon-essentials", "addon-interactions", diff --git a/code/sandbox/nuxt-vite-default-ts/project.json b/code/sandbox/nuxt-vite-default-ts/project.json index 71bb3820c382..9bdc5c68252a 100644 --- a/code/sandbox/nuxt-vite-default-ts/project.json +++ b/code/sandbox/nuxt-vite-default-ts/project.json @@ -3,7 +3,6 @@ "$schema": "../../node_modules/nx/schemas/project-schema.json", "projectType": "application", "implicitDependencies": [ - "storybook", "core", "addon-essentials", "addon-interactions", diff --git a/code/sandbox/preact-vite-default-js/project.json b/code/sandbox/preact-vite-default-js/project.json index 4eb038e5c735..16966e6079a8 100644 --- a/code/sandbox/preact-vite-default-js/project.json +++ b/code/sandbox/preact-vite-default-js/project.json @@ -3,7 +3,6 @@ "$schema": "../../node_modules/nx/schemas/project-schema.json", "projectType": "application", "implicitDependencies": [ - "storybook", "core", "addon-essentials", "addon-interactions", diff --git a/code/sandbox/preact-vite-default-ts/project.json b/code/sandbox/preact-vite-default-ts/project.json index 2c1cdf04e3a4..e756d1ef647a 100644 --- a/code/sandbox/preact-vite-default-ts/project.json +++ b/code/sandbox/preact-vite-default-ts/project.json @@ -3,7 +3,6 @@ "$schema": "../../node_modules/nx/schemas/project-schema.json", "projectType": "application", "implicitDependencies": [ - "storybook", "core", "addon-essentials", "addon-interactions", diff --git a/code/sandbox/qwik-vite-default-ts/project.json b/code/sandbox/qwik-vite-default-ts/project.json index 0a1c65c53499..0eb305e7700c 100644 --- a/code/sandbox/qwik-vite-default-ts/project.json +++ b/code/sandbox/qwik-vite-default-ts/project.json @@ -3,7 +3,6 @@ "$schema": "../../node_modules/nx/schemas/project-schema.json", "projectType": "application", "implicitDependencies": [ - "storybook", "core", "addon-essentials", "addon-interactions", diff --git a/code/sandbox/react-vite-default-js/project.json b/code/sandbox/react-vite-default-js/project.json index cc44d8e4a6fa..6b56944f01b9 100644 --- a/code/sandbox/react-vite-default-js/project.json +++ b/code/sandbox/react-vite-default-js/project.json @@ -3,7 +3,6 @@ "$schema": "../../node_modules/nx/schemas/project-schema.json", "projectType": "application", "implicitDependencies": [ - "storybook", "core", "addon-essentials", "addon-interactions", diff --git a/code/sandbox/react-vite-default-ts/project.json b/code/sandbox/react-vite-default-ts/project.json index 25c9b2442a1b..21fb82576608 100644 --- a/code/sandbox/react-vite-default-ts/project.json +++ b/code/sandbox/react-vite-default-ts/project.json @@ -3,7 +3,6 @@ "$schema": "../../node_modules/nx/schemas/project-schema.json", "projectType": "application", "implicitDependencies": [ - "storybook", "core", "addon-essentials", "addon-interactions", diff --git a/code/sandbox/react-webpack-17-ts/project.json b/code/sandbox/react-webpack-17-ts/project.json index 01209a70efa9..a7ffafd8aec5 100644 --- a/code/sandbox/react-webpack-17-ts/project.json +++ b/code/sandbox/react-webpack-17-ts/project.json @@ -3,7 +3,6 @@ "$schema": "../../node_modules/nx/schemas/project-schema.json", "projectType": "application", "implicitDependencies": [ - "storybook", "core", "addon-essentials", "addon-interactions", diff --git a/code/sandbox/react-webpack-18-ts/project.json b/code/sandbox/react-webpack-18-ts/project.json index 34cae14e059c..a48dbef996f0 100644 --- a/code/sandbox/react-webpack-18-ts/project.json +++ b/code/sandbox/react-webpack-18-ts/project.json @@ -3,7 +3,6 @@ "$schema": "../../node_modules/nx/schemas/project-schema.json", "projectType": "application", "implicitDependencies": [ - "storybook", "core", "addon-essentials", "addon-interactions", diff --git a/code/sandbox/solid-vite-default-js/project.json b/code/sandbox/solid-vite-default-js/project.json index 7bba5774a7a1..baffb8151c79 100644 --- a/code/sandbox/solid-vite-default-js/project.json +++ b/code/sandbox/solid-vite-default-js/project.json @@ -3,7 +3,6 @@ "$schema": "../../node_modules/nx/schemas/project-schema.json", "projectType": "application", "implicitDependencies": [ - "storybook", "core", "addon-essentials", "addon-interactions", diff --git a/code/sandbox/solid-vite-default-ts/project.json b/code/sandbox/solid-vite-default-ts/project.json index 50d504a77255..d02e98c312ae 100644 --- a/code/sandbox/solid-vite-default-ts/project.json +++ b/code/sandbox/solid-vite-default-ts/project.json @@ -3,7 +3,6 @@ "$schema": "../../node_modules/nx/schemas/project-schema.json", "projectType": "application", "implicitDependencies": [ - "storybook", "core", "addon-essentials", "addon-interactions", diff --git a/code/sandbox/svelte-kit-prerelease-ts/project.json b/code/sandbox/svelte-kit-prerelease-ts/project.json index e9ec53e855c8..9da6435e3570 100644 --- a/code/sandbox/svelte-kit-prerelease-ts/project.json +++ b/code/sandbox/svelte-kit-prerelease-ts/project.json @@ -3,7 +3,6 @@ "$schema": "../../node_modules/nx/schemas/project-schema.json", "projectType": "application", "implicitDependencies": [ - "storybook", "core", "addon-essentials", "addon-interactions", diff --git a/code/sandbox/svelte-kit-skeleton-js/project.json b/code/sandbox/svelte-kit-skeleton-js/project.json index c0ac8adf0ba2..a4d29a606246 100644 --- a/code/sandbox/svelte-kit-skeleton-js/project.json +++ b/code/sandbox/svelte-kit-skeleton-js/project.json @@ -3,7 +3,6 @@ "$schema": "../../node_modules/nx/schemas/project-schema.json", "projectType": "application", "implicitDependencies": [ - "storybook", "core", "addon-essentials", "addon-interactions", diff --git a/code/sandbox/svelte-kit-skeleton-ts/project.json b/code/sandbox/svelte-kit-skeleton-ts/project.json index 17f7e5cdee4e..c766fe459074 100644 --- a/code/sandbox/svelte-kit-skeleton-ts/project.json +++ b/code/sandbox/svelte-kit-skeleton-ts/project.json @@ -3,7 +3,6 @@ "$schema": "../../node_modules/nx/schemas/project-schema.json", "projectType": "application", "implicitDependencies": [ - "storybook", "core", "addon-essentials", "addon-interactions", diff --git a/code/sandbox/svelte-vite-default-js/project.json b/code/sandbox/svelte-vite-default-js/project.json index d93d4e9b6ab1..454bfbef47b6 100644 --- a/code/sandbox/svelte-vite-default-js/project.json +++ b/code/sandbox/svelte-vite-default-js/project.json @@ -3,7 +3,6 @@ "$schema": "../../node_modules/nx/schemas/project-schema.json", "projectType": "application", "implicitDependencies": [ - "storybook", "core", "addon-essentials", "addon-interactions", diff --git a/code/sandbox/svelte-vite-default-ts/project.json b/code/sandbox/svelte-vite-default-ts/project.json index 90dadf8177f4..0645439bd245 100644 --- a/code/sandbox/svelte-vite-default-ts/project.json +++ b/code/sandbox/svelte-vite-default-ts/project.json @@ -3,7 +3,6 @@ "$schema": "../../node_modules/nx/schemas/project-schema.json", "projectType": "application", "implicitDependencies": [ - "storybook", "core", "addon-essentials", "addon-interactions", diff --git a/code/sandbox/vue-cli-default-js/project.json b/code/sandbox/vue-cli-default-js/project.json index fa29b401d74a..c06a3b9ac872 100644 --- a/code/sandbox/vue-cli-default-js/project.json +++ b/code/sandbox/vue-cli-default-js/project.json @@ -3,7 +3,6 @@ "$schema": "../../node_modules/nx/schemas/project-schema.json", "projectType": "application", "implicitDependencies": [ - "storybook", "core", "addon-essentials", "addon-interactions", diff --git a/code/sandbox/vue3-vite-default-js/project.json b/code/sandbox/vue3-vite-default-js/project.json index 6bbb297d51cd..a3c6541a2b80 100644 --- a/code/sandbox/vue3-vite-default-js/project.json +++ b/code/sandbox/vue3-vite-default-js/project.json @@ -3,7 +3,6 @@ "$schema": "../../node_modules/nx/schemas/project-schema.json", "projectType": "application", "implicitDependencies": [ - "storybook", "core", "addon-essentials", "addon-interactions", diff --git a/code/sandbox/vue3-vite-default-ts/project.json b/code/sandbox/vue3-vite-default-ts/project.json index ad777a4b5ece..78c8fda72e9a 100644 --- a/code/sandbox/vue3-vite-default-ts/project.json +++ b/code/sandbox/vue3-vite-default-ts/project.json @@ -3,7 +3,6 @@ "$schema": "../../node_modules/nx/schemas/project-schema.json", "projectType": "application", "implicitDependencies": [ - "storybook", "core", "addon-essentials", "addon-interactions", diff --git a/code/tsconfig.json b/code/tsconfig.json index 0ee2306040e0..c663954f1b19 100644 --- a/code/tsconfig.json +++ b/code/tsconfig.json @@ -10,8 +10,8 @@ "isolatedModules": true, "jsx": "react", "lib": ["dom", "dom.iterable", "esnext"], - "module": "CommonJS", - "moduleResolution": "Node", + "module": "Preserve", + "moduleResolution": "bundler", "noImplicitAny": true, "noUnusedLocals": false, "skipLibCheck": true, diff --git a/code/yarn.lock b/code/yarn.lock index a36028c2bb19..021ac94e0214 100644 --- a/code/yarn.lock +++ b/code/yarn.lock @@ -5906,7 +5906,6 @@ __metadata: "@babel/core": "npm:^7.24.4" "@babel/preset-env": "npm:^7.24.4" "@babel/types": "npm:^7.24.0" - "@storybook/core": "workspace:*" "@storybook/csf": "npm:0.1.12" "@types/cross-spawn": "npm:^6.0.2" "@types/jscodeshift": "npm:^0.11.10" @@ -5922,6 +5921,7 @@ __metadata: recast: "npm:^0.23.5" remark: "npm:^15.0.1" remark-mdx: "npm:^3.0.0" + storybook: "workspace:*" tiny-invariant: "npm:^1.3.1" ts-dedent: "npm:^2.2.0" typescript: "npm:^5.3.2" @@ -5979,150 +5979,6 @@ __metadata: languageName: unknown linkType: soft -"@storybook/core@workspace:*, @storybook/core@workspace:core": - version: 0.0.0-use.local - resolution: "@storybook/core@workspace:core" - dependencies: - "@aw-web-design/x-default-browser": "npm:1.4.126" - "@babel/core": "npm:^7.24.4" - "@babel/generator": "npm:^7.24.4" - "@babel/parser": "npm:^7.24.4" - "@babel/preset-react": "npm:^7.24.1" - "@babel/traverse": "npm:^7.24.1" - "@babel/types": "npm:^7.24.0" - "@discoveryjs/json-ext": "npm:^0.5.3" - "@emotion/cache": "npm:^11.11.0" - "@emotion/is-prop-valid": "npm:^1.2.2" - "@emotion/react": "npm:^11.11.4" - "@emotion/styled": "npm:^11.11.0" - "@emotion/use-insertion-effect-with-fallbacks": "npm:^1.0.1" - "@fal-works/esbuild-plugin-global-externals": "npm:^2.1.2" - "@ndelangen/get-tarball": "npm:^3.0.7" - "@polka/compression": "npm:^1.0.0-next.28" - "@popperjs/core": "npm:^2.6.0" - "@radix-ui/react-dialog": "npm:^1.0.5" - "@radix-ui/react-scroll-area": "npm:1.2.0-rc.7" - "@radix-ui/react-slot": "npm:^1.0.2" - "@storybook/csf": "npm:0.1.12" - "@storybook/docs-mdx": "npm:4.0.0-next.1" - "@storybook/global": "npm:^5.0.0" - "@storybook/icons": "npm:^1.2.12" - "@tanstack/react-virtual": "npm:^3.3.0" - "@testing-library/react": "npm:^14.0.0" - "@types/cross-spawn": "npm:^6.0.2" - "@types/detect-port": "npm:^1.3.0" - "@types/diff": "npm:^5.0.9" - "@types/ejs": "npm:^3.1.1" - "@types/find-cache-dir": "npm:^5.0.0" - "@types/js-yaml": "npm:^4.0.5" - "@types/node": "npm:^22.0.0" - "@types/npmlog": "npm:^7.0.0" - "@types/picomatch": "npm:^2.3.0" - "@types/prettier": "npm:^3.0.0" - "@types/pretty-hrtime": "npm:^1.0.0" - "@types/prompts": "npm:^2.0.9" - "@types/react-syntax-highlighter": "npm:11.0.5" - "@types/react-transition-group": "npm:^4" - "@types/semver": "npm:^7.5.8" - "@types/ws": "npm:^8" - "@yarnpkg/esbuild-plugin-pnp": "npm:^3.0.0-rc.10" - "@yarnpkg/fslib": "npm:2.10.3" - "@yarnpkg/libzip": "npm:2.3.0" - ansi-to-html: "npm:^0.7.2" - assert: "npm:^2.1.0" - babel-plugin-react-docgen: "npm:4.2.1" - better-opn: "npm:^3.0.2" - boxen: "npm:^7.1.1" - browser-assert: "npm:^1.2.1" - browser-dtector: "npm:^3.4.0" - camelcase: "npm:^8.0.0" - cli-table3: "npm:^0.6.1" - commander: "npm:^12.1.0" - comment-parser: "npm:^1.4.1" - copy-to-clipboard: "npm:^3.3.1" - cross-spawn: "npm:^7.0.3" - css: "npm:^3.0.0" - deep-object-diff: "npm:^1.1.0" - dequal: "npm:^2.0.2" - detect-indent: "npm:^7.0.1" - detect-package-manager: "npm:^3.0.2" - detect-port: "npm:^1.3.0" - diff: "npm:^5.2.0" - downshift: "npm:^9.0.4" - ejs: "npm:^3.1.10" - es-toolkit: "npm:^1.22.0" - esbuild: "npm:^0.18.0 || ^0.19.0 || ^0.20.0 || ^0.21.0 || ^0.22.0 || ^0.23.0" - esbuild-plugin-alias: "npm:^0.2.1" - esbuild-register: "npm:^3.5.0" - execa: "npm:^8.0.1" - fd-package-json: "npm:^1.2.0" - fetch-retry: "npm:^6.0.0" - find-cache-dir: "npm:^5.0.0" - find-up: "npm:^7.0.0" - flush-promises: "npm:^1.0.2" - fuse.js: "npm:^3.6.1" - get-npm-tarball-url: "npm:^2.0.3" - glob: "npm:^10.0.0" - globby: "npm:^14.0.1" - jiti: "npm:^1.21.6" - js-yaml: "npm:^4.1.0" - jsdoc-type-pratt-parser: "npm:^4.0.0" - lazy-universal-dotenv: "npm:^4.0.0" - leven: "npm:^4.0.0" - markdown-to-jsx: "npm:^7.4.5" - memfs: "npm:^4.11.1" - memoizerific: "npm:^1.11.3" - nanoid: "npm:^4.0.2" - npmlog: "npm:^7.0.0" - open: "npm:^8.4.0" - picocolors: "npm:^1.1.0" - picomatch: "npm:^2.3.0" - picoquery: "npm:^1.4.0" - polished: "npm:^4.2.2" - polka: "npm:^1.0.0-next.28" - prettier: "npm:^3.2.5" - pretty-hrtime: "npm:^1.0.3" - process: "npm:^0.11.10" - prompts: "npm:^2.4.0" - react: "npm:^18.2.0" - react-dom: "npm:^18.2.0" - react-draggable: "npm:^4.4.5" - react-helmet-async: "npm:^1.3.0" - react-popper-tooltip: "npm:^4.4.2" - react-resize-detector: "npm:^7.1.2" - react-router-dom: "npm:6.0.2" - react-syntax-highlighter: "npm:^15.4.5" - react-textarea-autosize: "npm:^8.3.0" - react-transition-group: "npm:^4.4.5" - recast: "npm:^0.23.5" - require-from-string: "npm:^2.0.2" - resolve-from: "npm:^5.0.0" - semver: "npm:^7.6.2" - sirv: "npm:^2.0.4" - slash: "npm:^5.0.0" - source-map: "npm:^0.7.4" - store2: "npm:^2.14.2" - strip-json-comments: "npm:^5.0.1" - telejson: "npm:^7.2.0" - tiny-invariant: "npm:^1.3.1" - tinyspy: "npm:^2.2.0" - ts-dedent: "npm:^2.0.0" - tsconfig-paths: "npm:^4.2.0" - type-fest: "npm:^4.18.1" - typescript: "npm:^5.3.2" - unique-string: "npm:^3.0.0" - use-resize-observer: "npm:^9.1.0" - util: "npm:^0.12.5" - watchpack: "npm:^2.2.0" - ws: "npm:^8.2.3" - peerDependencies: - prettier: ^2 || ^3 - peerDependenciesMeta: - prettier: - optional: true - languageName: unknown - linkType: soft - "@storybook/csf-plugin@workspace:*, @storybook/csf-plugin@workspace:lib/csf-plugin": version: 0.0.0-use.local resolution: "@storybook/csf-plugin@workspace:lib/csf-plugin" @@ -6857,7 +6713,6 @@ __metadata: "@storybook/builder-vite": "workspace:*" "@storybook/builder-webpack5": "workspace:*" "@storybook/codemod": "workspace:*" - "@storybook/core": "workspace:*" "@storybook/core-webpack": "workspace:*" "@storybook/csf": "npm:0.1.12" "@storybook/csf-plugin": "workspace:*" @@ -26532,20 +26387,148 @@ __metadata: languageName: node linkType: hard -"storybook@workspace:*, storybook@workspace:^, storybook@workspace:lib/cli": +"storybook@workspace:*, storybook@workspace:^, storybook@workspace:core": version: 0.0.0-use.local - resolution: "storybook@workspace:lib/cli" + resolution: "storybook@workspace:core" dependencies: - "@storybook/core": "workspace:*" + "@aw-web-design/x-default-browser": "npm:1.4.126" + "@babel/core": "npm:^7.24.4" + "@babel/generator": "npm:^7.24.4" + "@babel/parser": "npm:^7.24.4" + "@babel/preset-react": "npm:^7.24.1" + "@babel/traverse": "npm:^7.24.1" + "@babel/types": "npm:^7.24.0" + "@discoveryjs/json-ext": "npm:^0.5.3" + "@emotion/cache": "npm:^11.11.0" + "@emotion/is-prop-valid": "npm:^1.2.2" + "@emotion/react": "npm:^11.11.4" + "@emotion/styled": "npm:^11.11.0" + "@emotion/use-insertion-effect-with-fallbacks": "npm:^1.0.1" + "@fal-works/esbuild-plugin-global-externals": "npm:^2.1.2" + "@ndelangen/get-tarball": "npm:^3.0.7" + "@polka/compression": "npm:^1.0.0-next.28" + "@popperjs/core": "npm:^2.6.0" + "@radix-ui/react-dialog": "npm:^1.0.5" + "@radix-ui/react-scroll-area": "npm:1.2.0-rc.7" + "@radix-ui/react-slot": "npm:^1.0.2" + "@storybook/csf": "npm:0.1.12" + "@storybook/docs-mdx": "npm:4.0.0-next.1" + "@storybook/global": "npm:^5.0.0" + "@storybook/icons": "npm:^1.2.12" + "@tanstack/react-virtual": "npm:^3.3.0" + "@testing-library/react": "npm:^14.0.0" + "@types/cross-spawn": "npm:^6.0.2" + "@types/detect-port": "npm:^1.3.0" + "@types/diff": "npm:^5.0.9" + "@types/ejs": "npm:^3.1.1" + "@types/find-cache-dir": "npm:^5.0.0" + "@types/js-yaml": "npm:^4.0.5" + "@types/node": "npm:^22.0.0" + "@types/npmlog": "npm:^7.0.0" + "@types/picomatch": "npm:^2.3.0" + "@types/prettier": "npm:^3.0.0" + "@types/pretty-hrtime": "npm:^1.0.0" + "@types/prompts": "npm:^2.0.9" + "@types/react-syntax-highlighter": "npm:11.0.5" + "@types/react-transition-group": "npm:^4" + "@types/semver": "npm:^7.5.8" + "@types/ws": "npm:^8" + "@yarnpkg/esbuild-plugin-pnp": "npm:^3.0.0-rc.10" + "@yarnpkg/fslib": "npm:2.10.3" + "@yarnpkg/libzip": "npm:2.3.0" + ansi-to-html: "npm:^0.7.2" + assert: "npm:^2.1.0" + babel-plugin-react-docgen: "npm:4.2.1" + better-opn: "npm:^3.0.2" + boxen: "npm:^7.1.1" + browser-assert: "npm:^1.2.1" + browser-dtector: "npm:^3.4.0" + camelcase: "npm:^8.0.0" + cli-table3: "npm:^0.6.1" + commander: "npm:^12.1.0" + comment-parser: "npm:^1.4.1" + copy-to-clipboard: "npm:^3.3.1" + cross-spawn: "npm:^7.0.3" + css: "npm:^3.0.0" + deep-object-diff: "npm:^1.1.0" + dequal: "npm:^2.0.2" + detect-indent: "npm:^7.0.1" + detect-package-manager: "npm:^3.0.2" + detect-port: "npm:^1.3.0" + diff: "npm:^5.2.0" + downshift: "npm:^9.0.4" + ejs: "npm:^3.1.10" + es-toolkit: "npm:^1.22.0" + esbuild: "npm:^0.18.0 || ^0.19.0 || ^0.20.0 || ^0.21.0 || ^0.22.0 || ^0.23.0" + esbuild-plugin-alias: "npm:^0.2.1" + esbuild-register: "npm:^3.5.0" + execa: "npm:^8.0.1" + fd-package-json: "npm:^1.2.0" + fetch-retry: "npm:^6.0.0" + find-cache-dir: "npm:^5.0.0" + find-up: "npm:^7.0.0" + flush-promises: "npm:^1.0.2" + fuse.js: "npm:^3.6.1" + get-npm-tarball-url: "npm:^2.0.3" + glob: "npm:^10.0.0" + globby: "npm:^14.0.1" + jiti: "npm:^1.21.6" + js-yaml: "npm:^4.1.0" + jsdoc-type-pratt-parser: "npm:^4.0.0" + lazy-universal-dotenv: "npm:^4.0.0" + leven: "npm:^4.0.0" + markdown-to-jsx: "npm:^7.4.5" + memfs: "npm:^4.11.1" + memoizerific: "npm:^1.11.3" + nanoid: "npm:^4.0.2" + npmlog: "npm:^7.0.0" + open: "npm:^8.4.0" + picocolors: "npm:^1.1.0" + picomatch: "npm:^2.3.0" + picoquery: "npm:^1.4.0" + polished: "npm:^4.2.2" + polka: "npm:^1.0.0-next.28" + prettier: "npm:^3.2.5" + pretty-hrtime: "npm:^1.0.3" + process: "npm:^0.11.10" + prompts: "npm:^2.4.0" + react: "npm:^18.2.0" + react-dom: "npm:^18.2.0" + react-draggable: "npm:^4.4.5" + react-helmet-async: "npm:^1.3.0" + react-popper-tooltip: "npm:^4.4.2" + react-resize-detector: "npm:^7.1.2" + react-router-dom: "npm:6.0.2" + react-syntax-highlighter: "npm:^15.4.5" + react-textarea-autosize: "npm:^8.3.0" + react-transition-group: "npm:^4.4.5" + recast: "npm:^0.23.5" + require-from-string: "npm:^2.0.2" + resolve-from: "npm:^5.0.0" + semver: "npm:^7.6.2" + sirv: "npm:^2.0.4" + slash: "npm:^5.0.0" + source-map: "npm:^0.7.4" + store2: "npm:^2.14.2" + strip-json-comments: "npm:^5.0.1" + telejson: "npm:^7.2.0" + tiny-invariant: "npm:^1.3.1" + tinyspy: "npm:^2.2.0" + ts-dedent: "npm:^2.0.0" + tsconfig-paths: "npm:^4.2.0" + type-fest: "npm:^4.18.1" typescript: "npm:^5.3.2" + unique-string: "npm:^3.0.0" + use-resize-observer: "npm:^9.1.0" + util: "npm:^0.12.5" + watchpack: "npm:^2.2.0" + ws: "npm:^8.2.3" peerDependencies: prettier: ^2 || ^3 peerDependenciesMeta: prettier: optional: true bin: - getstorybook: ./bin/index.cjs - sb: ./bin/index.cjs storybook: ./bin/index.cjs languageName: unknown linkType: soft diff --git a/scripts/eslint-plugin-local-rules/storybook-monorepo-imports.js b/scripts/eslint-plugin-local-rules/storybook-monorepo-imports.js index 8b9dba6de0f3..844c6d1802a1 100644 --- a/scripts/eslint-plugin-local-rules/storybook-monorepo-imports.js +++ b/scripts/eslint-plugin-local-rules/storybook-monorepo-imports.js @@ -38,18 +38,18 @@ module.exports = { }); } - if (node.source.value.startsWith('storybook/internal/') && isInCore) { - const newPath = node.source.value - .replace('storybook/internal', '@storybook/core') - .replace('/src', ''); - context.report({ - node: node, - message: `Cannot import from storybook/internal in this package. Use @storybook/core instead.`, - fix: (fixer) => { - return fixer.replaceText(node.source, `'${newPath}'`); - }, - }); - } + // if (node.source.value.startsWith('storybook/internal/') && isInCore) { + // const newPath = node.source.value + // .replace('storybook/internal', '@storybook/core') + // .replace('/src', ''); + // context.report({ + // node: node, + // message: `Cannot import from storybook/internal in this package. Use @storybook/core instead.`, + // fix: (fixer) => { + // return fixer.replaceText(node.source, `'${newPath}'`); + // }, + // }); + // } }, }; }, diff --git a/scripts/prepare/check.ts b/scripts/prepare/check.ts index 0462b6094464..bb67075d43db 100755 --- a/scripts/prepare/check.ts +++ b/scripts/prepare/check.ts @@ -40,7 +40,7 @@ run({ cwd: process.cwd() }).catch((err: unknown) => { function getTSDiagnostics(program: ts.Program, cwd: string, host: ts.CompilerHost): any { return ts.formatDiagnosticsWithColorAndContext( - ts.getPreEmitDiagnostics(program).filter((d) => d.file.fileName.startsWith(cwd)), + ts.getPreEmitDiagnostics(program).filter((d) => d.file && d.file.fileName.startsWith(cwd)), host ); } diff --git a/scripts/release/is-version-published.ts b/scripts/release/is-version-published.ts index a6a6891b2124..38e497616536 100644 --- a/scripts/release/is-version-published.ts +++ b/scripts/release/is-version-published.ts @@ -69,7 +69,7 @@ export const run = async (args: unknown[], options: unknown) => { const isAlreadyPublished = await isVersionPublished({ version, - packageName: '@storybook/core', + packageName: 'storybook', verbose, }); diff --git a/scripts/release/publish.ts b/scripts/release/publish.ts index f2054d93398e..3021496b8f73 100644 --- a/scripts/release/publish.ts +++ b/scripts/release/publish.ts @@ -177,7 +177,7 @@ export const run = async (options: unknown) => { const currentVersion = await getCurrentVersion(verbose); const isAlreadyPublished = await isCurrentVersionPublished({ currentVersion, - packageName: '@storybook/core', + packageName: 'storybook', verbose, }); if (isAlreadyPublished) { diff --git a/scripts/tasks/sandbox-parts.ts b/scripts/tasks/sandbox-parts.ts index 271fbba9dcd8..6988efa34a6d 100644 --- a/scripts/tasks/sandbox-parts.ts +++ b/scripts/tasks/sandbox-parts.ts @@ -672,7 +672,7 @@ export const addStories: Task['run'] = async ( if (isCoreRenderer) { // Add stories for lib/preview-api (and addons below). NOTE: these stories will be in the // template-stories folder and *not* processed by the framework build config (instead by esbuild-loader) - await linkPackageStories(await workspacePath('core package', '@storybook/core'), { + await linkPackageStories(await workspacePath('core package', 'storybook'), { mainConfig, cwd, disableDocs, diff --git a/scripts/tsconfig.json b/scripts/tsconfig.json index 77c8d8e2da1b..228bdb63dddd 100644 --- a/scripts/tsconfig.json +++ b/scripts/tsconfig.json @@ -7,7 +7,7 @@ "jsx": "react", "moduleResolution": "bundler", "target": "es2022", - "module": "ES2022", + "module": "Preserve", "skipLibCheck": true, "allowSyntheticDefaultImports": true, "esModuleInterop": true, diff --git a/scripts/utils/cli-step.ts b/scripts/utils/cli-step.ts index ce57896aeddf..1ff36db88ddc 100644 --- a/scripts/utils/cli-step.ts +++ b/scripts/utils/cli-step.ts @@ -5,7 +5,7 @@ import type { OptionSpecifier, OptionValues } from './options'; import { createOptions, getCommand } from './options'; const require = createRequire(import.meta.url); -const cliExecutable = require.resolve('../../code/lib/cli/bin/index.cjs'); +const cliExecutable = require.resolve('../../code/core/bin/index.cjs'); const toolboxExecutable = require.resolve('../../code/lib/cli-storybook/bin/index.cjs'); const createStorybookExecutable = require.resolve('../../code/lib/create-storybook/bin/index.cjs'); diff --git a/test-storybooks/ember-cli/package.json b/test-storybooks/ember-cli/package.json index 3ac8ca31acfb..5fbc07dbe387 100644 --- a/test-storybooks/ember-cli/package.json +++ b/test-storybooks/ember-cli/package.json @@ -36,7 +36,7 @@ "@storybook/client-logger": "file:../../code/lib/client-logger", "@storybook/codemod": "file:../../code/lib/codemod", "@storybook/components": "file:../../code/deprecated/components", - "@storybook/core": "file:../../code/core", + "storybook": "file:../../code/core", "@storybook/core-webpack": "file:../../code/lib/core-webpack", "@storybook/csf-plugin": "file:../../code/lib/csf-plugin", "@storybook/ember": "file:../../code/frameworks/ember", @@ -74,8 +74,7 @@ "@storybook/vue3-webpack5": "file:../../code/frameworks/vue3-webpack5", "@storybook/web-components": "file:../../code/renderers/web-components", "@storybook/web-components-vite": "file:../../code/frameworks/web-components-vite", - "@storybook/web-components-webpack5": "file:../../code/frameworks/web-components-webpack5", - "storybook": "file:../../code/lib/cli" + "@storybook/web-components-webpack5": "file:../../code/frameworks/web-components-webpack5" }, "dependencies": { "ember-named-blocks-polyfill": "^0.2.3", @@ -129,4 +128,4 @@ "projectToken": "19z23qxndju" } } -} +} \ No newline at end of file diff --git a/test-storybooks/external-docs/package.json b/test-storybooks/external-docs/package.json index adb509ce45c3..12b28bd34de7 100644 --- a/test-storybooks/external-docs/package.json +++ b/test-storybooks/external-docs/package.json @@ -36,7 +36,7 @@ "@storybook/client-logger": "file:../../code/lib/client-logger", "@storybook/codemod": "file:../../code/lib/codemod", "@storybook/components": "file:../../code/deprecated/components", - "@storybook/core": "file:../../code/core", + "storybook": "file:../../code/core", "@storybook/core-webpack": "file:../../code/lib/core-webpack", "@storybook/csf-plugin": "file:../../code/lib/csf-plugin", "@storybook/ember": "file:../../code/frameworks/ember", @@ -74,8 +74,7 @@ "@storybook/vue3-webpack5": "file:../../code/frameworks/vue3-webpack5", "@storybook/web-components": "file:../../code/renderers/web-components", "@storybook/web-components-vite": "file:../../code/frameworks/web-components-vite", - "@storybook/web-components-webpack5": "file:../../code/frameworks/web-components-webpack5", - "storybook": "file:../../code/lib/cli" + "@storybook/web-components-webpack5": "file:../../code/frameworks/web-components-webpack5" }, "dependencies": { "@storybook/addon-docs": "*", diff --git a/test-storybooks/portable-stories-kitchen-sink/nextjs/package.json b/test-storybooks/portable-stories-kitchen-sink/nextjs/package.json index 69722cabd5db..17f2a3b635d4 100644 --- a/test-storybooks/portable-stories-kitchen-sink/nextjs/package.json +++ b/test-storybooks/portable-stories-kitchen-sink/nextjs/package.json @@ -37,7 +37,7 @@ "@storybook/builder-webpack5": "file:../../../code/builders/builder-webpack5", "@storybook/codemod": "file:../../../code/lib/codemod", "@storybook/components": "file:../../../code/deprecated/components", - "@storybook/core": "file:../../../code/core", + "storybook": "file:../../../code/core", "@storybook/core-webpack": "file:../../../code/lib/core-webpack", "@storybook/csf-plugin": "file:../../../code/lib/csf-plugin", "@storybook/ember": "file:../../../code/frameworks/ember", @@ -75,8 +75,7 @@ "@storybook/vue3-webpack5": "file:../../../code/frameworks/vue3-webpack5", "@storybook/web-components": "file:../../../code/renderers/web-components", "@storybook/web-components-vite": "file:../../../code/frameworks/web-components-vite", - "@storybook/web-components-webpack5": "file:../../../code/frameworks/web-components-webpack5", - "storybook": "file:../../../code/lib/cli" + "@storybook/web-components-webpack5": "file:../../../code/frameworks/web-components-webpack5" }, "dependencies": { "next": "^14.2.0", @@ -108,4 +107,4 @@ "maintainer_please_read_this": { "_": "we use file protocol to make this setup close to real life scenarios as well as avoid issues with duplicated React instances. When you recompile the SB packages, you need to rerun install." } -} +} \ No newline at end of file diff --git a/test-storybooks/portable-stories-kitchen-sink/react/package.json b/test-storybooks/portable-stories-kitchen-sink/react/package.json index 383364e5909a..52e7ee0b260a 100644 --- a/test-storybooks/portable-stories-kitchen-sink/react/package.json +++ b/test-storybooks/portable-stories-kitchen-sink/react/package.json @@ -40,7 +40,7 @@ "@storybook/builder-webpack5": "portal:../../../code/builders/builder-webpack5", "@storybook/codemod": "portal:../../../code/lib/codemod", "@storybook/components": "file:../../../code/deprecated/components", - "@storybook/core": "portal:../../../code/core", + "storybook": "portal:../../../code/core", "@storybook/core-webpack": "portal:../../../code/lib/core-webpack", "@storybook/csf-plugin": "portal:../../../code/lib/csf-plugin", "@storybook/ember": "portal:../../../code/frameworks/ember", @@ -80,8 +80,7 @@ "@storybook/web-components": "portal:../../../code/renderers/web-components", "@storybook/web-components-vite": "portal:../../../code/frameworks/web-components-vite", "@storybook/web-components-webpack5": "portal:../../../code/frameworks/web-components-webpack5", - "playwright": "1.48.1", - "storybook": "portal:../../../code/lib/cli" + "playwright": "1.48.1" }, "dependencies": { "react": "^18.2.0", @@ -125,4 +124,4 @@ "vite": "^5.1.1", "vitest": "^2.1.3" } -} +} \ No newline at end of file diff --git a/test-storybooks/portable-stories-kitchen-sink/svelte/package.json b/test-storybooks/portable-stories-kitchen-sink/svelte/package.json index ad5699a549c7..62c7622f8500 100644 --- a/test-storybooks/portable-stories-kitchen-sink/svelte/package.json +++ b/test-storybooks/portable-stories-kitchen-sink/svelte/package.json @@ -38,7 +38,7 @@ "@storybook/builder-webpack5": "portal:../../../code/builders/builder-webpack5", "@storybook/codemod": "portal:../../../code/lib/codemod", "@storybook/components": "file:../../../code/deprecated/components", - "@storybook/core": "portal:../../../code/core", + "storybook": "portal:../../../code/core", "@storybook/core-webpack": "portal:../../../code/lib/core-webpack", "@storybook/csf-plugin": "portal:../../../code/lib/csf-plugin", "@storybook/ember": "portal:../../../code/frameworks/ember", @@ -77,8 +77,7 @@ "@storybook/web-components": "portal:../../../code/renderers/web-components", "@storybook/web-components-vite": "portal:../../../code/frameworks/web-components-vite", "@storybook/web-components-webpack5": "portal:../../../code/frameworks/web-components-webpack5", - "playwright": "1.48.1", - "storybook": "portal:../../../code/lib/cli" + "playwright": "1.48.1" }, "devDependencies": { "@playwright/experimental-ct-svelte": "1.48.1", @@ -101,4 +100,4 @@ "vite": "^5.1.4", "vitest": "^1.6.0" } -} +} \ No newline at end of file diff --git a/test-storybooks/portable-stories-kitchen-sink/vue3/package.json b/test-storybooks/portable-stories-kitchen-sink/vue3/package.json index f286a9ce6258..7ba1bfefa42a 100644 --- a/test-storybooks/portable-stories-kitchen-sink/vue3/package.json +++ b/test-storybooks/portable-stories-kitchen-sink/vue3/package.json @@ -39,7 +39,7 @@ "@storybook/builder-webpack5": "file:../../../code/builders/builder-webpack5", "@storybook/codemod": "file:../../../code/lib/codemod", "@storybook/components": "file:../../../code/deprecated/components", - "@storybook/core": "file:../../../code/core", + "storybook": "file:../../../code/core", "@storybook/core-webpack": "file:../../../code/lib/core-webpack", "@storybook/csf-plugin": "file:../../../code/lib/csf-plugin", "@storybook/ember": "file:../../../code/frameworks/ember", @@ -78,8 +78,7 @@ "@storybook/web-components": "file:../../../code/renderers/web-components", "@storybook/web-components-vite": "file:../../../code/frameworks/web-components-vite", "@storybook/web-components-webpack5": "file:../../../code/frameworks/web-components-webpack5", - "playwright": "1.48.1", - "storybook": "file:../../../code/lib/cli" + "playwright": "1.48.1" }, "dependencies": { "vue": "^3.4.19" diff --git a/test-storybooks/server-kitchen-sink/package.json b/test-storybooks/server-kitchen-sink/package.json index 144d15fcf03d..3fc0ec3ebd72 100644 --- a/test-storybooks/server-kitchen-sink/package.json +++ b/test-storybooks/server-kitchen-sink/package.json @@ -39,7 +39,7 @@ "@storybook/client-logger": "file:../../code/lib/client-logger", "@storybook/codemod": "file:../../code/lib/codemod", "@storybook/components": "file:../../code/deprecated/components", - "@storybook/core": "file:../../code/core", + "storybook": "file:../../code/core", "@storybook/core-webpack": "file:../../code/lib/core-webpack", "@storybook/csf-plugin": "file:../../code/lib/csf-plugin", "@storybook/ember": "file:../../code/frameworks/ember", @@ -77,8 +77,7 @@ "@storybook/vue3-webpack5": "file:../../code/frameworks/vue3-webpack5", "@storybook/web-components": "file:../../code/renderers/web-components", "@storybook/web-components-vite": "file:../../code/frameworks/web-components-vite", - "@storybook/web-components-webpack5": "file:../../code/frameworks/web-components-webpack5", - "storybook": "file:../../code/lib/cli" + "@storybook/web-components-webpack5": "file:../../code/frameworks/web-components-webpack5" }, "devDependencies": { "@storybook/addon-a11y": "*", diff --git a/test-storybooks/standalone-preview/package.json b/test-storybooks/standalone-preview/package.json index 1d32f7457a40..ebe7eb0db38a 100644 --- a/test-storybooks/standalone-preview/package.json +++ b/test-storybooks/standalone-preview/package.json @@ -32,7 +32,7 @@ "@storybook/client-logger": "file:../../code/lib/client-logger", "@storybook/codemod": "file:../../code/lib/codemod", "@storybook/components": "file:../../../code/deprecated/components", - "@storybook/core": "file:../../code/core", + "storybook": "file:../../../code/core", "@storybook/core-webpack": "file:../../code/lib/core-webpack", "@storybook/csf-plugin": "file:../../code/lib/csf-plugin", "@storybook/ember": "file:../../code/frameworks/ember", @@ -70,8 +70,7 @@ "@storybook/vue3-webpack5": "file:../../code/frameworks/vue3-webpack5", "@storybook/web-components": "file:../../code/renderers/web-components", "@storybook/web-components-vite": "file:../../code/frameworks/web-components-vite", - "@storybook/web-components-webpack5": "file:../../code/frameworks/web-components-webpack5", - "storybook": "file:../../code/lib/cli" + "@storybook/web-components-webpack5": "file:../../code/frameworks/web-components-webpack5" }, "devDependencies": { "@storybook/addon-docs": "*",