Merge branch 'next' into shilman/build-index

This commit is contained in:
Michael Shilman 2025-03-01 13:09:52 +08:00
commit 7a60f83374
811 changed files with 6471 additions and 8271 deletions

View File

@ -635,6 +635,7 @@ jobs:
command: |
cd code
yarn local-registry --open &
yarn wait-on tcp:127.0.0.1:6001
cd ../../
mkdir features-1
cd features-1
@ -855,15 +856,15 @@ workflows:
requires:
- unit-tests
- create-sandboxes:
parallelism: 14
parallelism: 13
requires:
- build
- chromatic-sandboxes:
parallelism: 11
parallelism: 10
requires:
- create-sandboxes
- e2e-production:
parallelism: 9
parallelism: 8
requires:
- create-sandboxes
- e2e-dev:
@ -875,7 +876,7 @@ workflows:
requires:
- create-sandboxes
- vitest-integration:
parallelism: 5
parallelism: 4
requires:
- create-sandboxes
- bench-sandboxes:
@ -930,15 +931,15 @@ workflows:
requires:
- unit-tests
- create-sandboxes:
parallelism: 20
parallelism: 19
requires:
- build
- chromatic-sandboxes:
parallelism: 17
parallelism: 16
requires:
- create-sandboxes
- e2e-production:
parallelism: 15
parallelism: 14
requires:
- create-sandboxes
- e2e-dev:
@ -950,7 +951,7 @@ workflows:
requires:
- create-sandboxes
- vitest-integration:
parallelism: 5
parallelism: 4
requires:
- create-sandboxes
- test-portable-stories:
@ -1003,18 +1004,18 @@ workflows:
requires:
- build
- create-sandboxes:
parallelism: 37
parallelism: 34
requires:
- build
# - smoke-test-sandboxes: # disabled for now
# requires:
# - create-sandboxes
- chromatic-sandboxes:
parallelism: 34
parallelism: 31
requires:
- create-sandboxes
- e2e-production:
parallelism: 32
parallelism: 29
requires:
- create-sandboxes
- e2e-dev:
@ -1022,11 +1023,11 @@ workflows:
requires:
- create-sandboxes
- test-runner-production:
parallelism: 30
parallelism: 29
requires:
- create-sandboxes
- vitest-integration:
parallelism: 11
parallelism: 9
requires:
- create-sandboxes
- test-portable-stories:

View File

@ -24,8 +24,16 @@ jobs:
with:
node-version-file: ".nvmrc"
- name: install and compile
run: yarn task --task compile --start-from=auto
- name: install scripts
run: |
cd scripts && yarn install
- name: install code
run: |
cd code && yarn install
- name: compile
run: yarn task --task compile --start-from=compile
- name: Install Playwright Dependencies
run: cd code && yarn exec playwright install chromium --with-deps

View File

@ -39,13 +39,13 @@ jobs:
get-parameters:
runs-on: ubuntu-latest
steps:
- if: github.event_name == 'pull_request_target' && ((github.event.action == 'labeled' && github.event.label.name == 'ci:normal') || (github.event.action != 'labeled' && contains(github.event.pull_request.labels.*.name, 'ci:normal')))
- if: github.event_name == 'pull_request_target' && (contains(github.event.pull_request.labels.*.name, 'ci:normal'))
run: echo "workflow=normal" >> $GITHUB_ENV
- if: github.event_name == 'pull_request_target' && ((github.event.action == 'labeled' && github.event.label.name == 'ci:docs') || (github.event.action != 'labeled' && contains(github.event.pull_request.labels.*.name, 'ci:docs')))
- if: github.event_name == 'pull_request_target' && (contains(github.event.pull_request.labels.*.name, 'ci:docs'))
run: echo "workflow=docs" >> $GITHUB_ENV
- if: github.event_name == 'push' || (github.event.action == 'labeled' && github.event.label.name == 'ci:merged') || (github.event.action != 'labeled' && contains(github.event.pull_request.labels.*.name, 'ci:merged'))
- if: github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'ci:merged')
run: echo "workflow=merged" >> $GITHUB_ENV
- if: github.event_name == 'pull_request_target' && ((github.event.action == 'labeled' && github.event.label.name == 'ci:daily') || (github.event.action != 'labeled' && contains(github.event.pull_request.labels.*.name, 'ci:daily')))
- if: github.event_name == 'pull_request_target' && (contains(github.event.pull_request.labels.*.name, 'ci:daily'))
run: echo "workflow=daily" >> $GITHUB_ENV
outputs:
workflow: ${{ env.workflow }}

View File

@ -1,3 +1,80 @@
## 8.6.2
- Core: Support TS3.8+ again - [#30700](https://github.com/storybookjs/storybook/pull/30700), thanks @kasperpeulen!
- Revert "CLI: Don't initially select Documentation and Testing features" - [#30694](https://github.com/storybookjs/storybook/pull/30694), thanks @shilman!
## 8.6.1
- CSF: Only export definePreview from the framework - [#30676](https://github.com/storybookjs/storybook/pull/30676), thanks @kasperpeulen!
- Codemod: Only remove types when they are unused - [#30644](https://github.com/storybookjs/storybook/pull/30644), thanks @yannbf!
## 8.6.0
The 8.6 release focuses on [Storybook Test](https://storybook.js.org/blog/storybook-test-sneak-peek/), which brings realtime component, accessibility, and visual UI tests to your favorite component workshop.
Heres whats new:
- 🎁 **Storybook Test installer** for out-of-the-box tests in new projects
- 🦾 **Accessibility “todo” workflow** to systematically fix a11y violations
- 🗜️ **80% smaller create-storybook** package for much faster installs
- 🧪 **Dozens of Test fixes** based on user feedback
- 📕 **Docs fixes** for table of contents, code snippets, and more
- 🚨 **Key security fixes** for Vite and ESbuild
- 💯 Hundreds more improvements
<details>
<summary>List of all updates</summary>
- Addon A11y: Introduce parameters.a11y.test - [#30516](https://github.com/storybookjs/storybook/pull/30516), thanks @valentinpalkovic!
- Addon-A11y: Fix preset loading when loaded via getAbsolutePath - [#30563](https://github.com/storybookjs/storybook/pull/30563), thanks @valentinpalkovic!
- Addon-Docs: Change URL hash when TOC item is clicked, and fix TOC loading bugs - [#30130](https://github.com/storybookjs/storybook/pull/30130), thanks @Sidnioulz!
- Addon-docs: Consider custom code snippet in story code panel and update styles - [#30179](https://github.com/storybookjs/storybook/pull/30179), thanks @larsrickert!
- Addon-Test: Add telemetry data for Focused Tests - [#30568](https://github.com/storybookjs/storybook/pull/30568), thanks @JReinhold!
- Addon-Test: Fix config and watch mode inconsistencies - [#30491](https://github.com/storybookjs/storybook/pull/30491), thanks @JReinhold!
- Addon-Test: Fix console error in build mode - [#30625](https://github.com/storybookjs/storybook/pull/30625), thanks @JReinhold!
- Addon-Test: Make sure that only one global portable story config is ever loaded - [#30582](https://github.com/storybookjs/storybook/pull/30582), thanks @kasperpeulen!
- Angular: Fix accent character issue - [#30276](https://github.com/storybookjs/storybook/pull/30276), thanks @valentinpalkovic!
- Angular: Support experimental zoneless mode - [#28657](https://github.com/storybookjs/storybook/pull/28657), thanks @anedomansky!
- Angular: Support v19.2 when @angular/animations is not installed - [#30611](https://github.com/storybookjs/storybook/pull/30611), thanks @valentinpalkovic!
- Builder-Vite: Fix resolve id warning - [#30511](https://github.com/storybookjs/storybook/pull/30511), thanks @valentinpalkovic!
- Builder-Vite: Fix runtime and iframe 404 on first load - [#30567](https://github.com/storybookjs/storybook/pull/30567), thanks @valentinpalkovic!
- Bun: Add support for text lock file - [#30160](https://github.com/storybookjs/storybook/pull/30160), thanks @Arctomachine!
- Cleanup: Remove unused constants in viewport addon - [#30479](https://github.com/storybookjs/storybook/pull/30479), thanks @Guria!
- CLI: Don't initially select Documentation and Testing features - [#30599](https://github.com/storybookjs/storybook/pull/30599), thanks @ghengeveld!
- CLI: Fix peer dep issues for npm users during upgrade - [#30616](https://github.com/storybookjs/storybook/pull/30616), thanks @valentinpalkovic!
- CLI: Fix printing of selected features - [#30605](https://github.com/storybookjs/storybook/pull/30605), thanks @ghengeveld!
- CLI: Make telemetry data an object - [#30581](https://github.com/storybookjs/storybook/pull/30581), thanks @ndelangen!
- CLI: Prompt users for RN vs RNW on init - [#30635](https://github.com/storybookjs/storybook/pull/30635), thanks @shilman!
- CLI: Reimplement features prompt logic to handle `--yes` and fix `--features` - [#30534](https://github.com/storybookjs/storybook/pull/30534), thanks @ghengeveld!
- CLI: Remove Storybook dependencies before adding re-adding them - [#30600](https://github.com/storybookjs/storybook/pull/30600), thanks @valentinpalkovic!
- CLI: Use correct storybook internals import in automigration - [#30290](https://github.com/storybookjs/storybook/pull/30290), thanks @yannbf!
- Codemod: Always get real path of files - [#30650](https://github.com/storybookjs/storybook/pull/30650), thanks @yannbf!
- Codemod: Handle addon essentials differently in csf factories - [#30649](https://github.com/storybookjs/storybook/pull/30649), thanks @yannbf!
- Codemod: Migrate meta.args to meta.input.args in csf factories - [#30641](https://github.com/storybookjs/storybook/pull/30641), thanks @yannbf!
- Codemod: Use real path from symbolic links - [#30642](https://github.com/storybookjs/storybook/pull/30642), thanks @yannbf!
- Core: Add `UniversalStore` API to sync state/events between multiple environments - [#30445](https://github.com/storybookjs/storybook/pull/30445), thanks @JReinhold!
- Core: Add connection timeout notification - [#30288](https://github.com/storybookjs/storybook/pull/30288), thanks @valentinpalkovic!
- Core: Allow empty render functions in CSF factories - [#30565](https://github.com/storybookjs/storybook/pull/30565), thanks @kasperpeulen!
- Core: Always place cache dir inside `node_modules` - [#30643](https://github.com/storybookjs/storybook/pull/30643), thanks @ndelangen!
- Core: Don't set process.env.NODE_ENV and process.env.DEV - [#30651](https://github.com/storybookjs/storybook/pull/30651), thanks @valentinpalkovic!
- Core: Fix addon essentials preview preset - [#30647](https://github.com/storybookjs/storybook/pull/30647), thanks @yannbf!
- Core: Fix extracting import path when it's not a core addon - [#30640](https://github.com/storybookjs/storybook/pull/30640), thanks @yannbf!
- Core: Fix invalid Websocket termination - [#30408](https://github.com/storybookjs/storybook/pull/30408), thanks @valentinpalkovic!
- Core: Fix statically serving single files and multiple dirs on the same endpoint - [#30467](https://github.com/storybookjs/storybook/pull/30467), thanks @JReinhold!
- Core: Fix undeclared internal dependencies - [#30566](https://github.com/storybookjs/storybook/pull/30566), thanks @kasperpeulen!
- Core: Improve type compatibility with React 19 - [#30031](https://github.com/storybookjs/storybook/pull/30031), thanks @mrginglymus!
- Core: Move CSF to monorepo - [#30488](https://github.com/storybookjs/storybook/pull/30488), thanks @kasperpeulen!
- Csf Tools: Allow ConfigFile to create more import syntaxes - [#30204](https://github.com/storybookjs/storybook/pull/30204), thanks @yannbf!
- CSF: Add support for CSF factories - [#30197](https://github.com/storybookjs/storybook/pull/30197), thanks @kasperpeulen!
- Essentials: Fix `addon-essentials` not working when used with `getAbsolutePath` - [#30557](https://github.com/storybookjs/storybook/pull/30557), thanks @JReinhold!
- Manager: Escape single quotes in dynamic import paths in wrapManagerEntries function - [#30278](https://github.com/storybookjs/storybook/pull/30278), thanks @valentinpalkovic!
- Manager: Fix escaping of single quotes in dynamic import paths - [#30278](https://github.com/storybookjs/storybook/pull/30278), thanks @valentinpalkovic!
- Manager: Fix panel reactivity - [#30638](https://github.com/storybookjs/storybook/pull/30638), thanks @valentinpalkovic!
- React: Fix incorrect import in preview.ts - [#30542](https://github.com/storybookjs/storybook/pull/30542), thanks @mrginglymus!
- Svelte: Fix conflicting variable names and support for `+page.svelte` files - [#30369](https://github.com/storybookjs/storybook/pull/30369), thanks @xeho91!
- Test addon: Only update `vitest.config.ts` with workspaces, otherwise create `vitest.workspace.ts` - [#30583](https://github.com/storybookjs/storybook/pull/30583), thanks @ghengeveld!
</details>
## 8.5.8
- Core: Support `esbuild@^0.25` - [#30574](https://github.com/storybookjs/storybook/pull/30574), thanks @JReinhold!

View File

@ -1,3 +1,25 @@
## 9.0.0-alpha.0
## 8.6.0-beta.10
- Codemod: Always get real path of files - [#30650](https://github.com/storybookjs/storybook/pull/30650), thanks @yannbf!
- Core: Don't set process.env.NODE_ENV and process.env.DEV - [#30651](https://github.com/storybookjs/storybook/pull/30651), thanks @valentinpalkovic!
## 8.6.0-beta.9
- CLI: Prompt users for RN vs RNW on init - [#30635](https://github.com/storybookjs/storybook/pull/30635), thanks @shilman!
- Codemod: Handle addon essentials differently in csf factories - [#30649](https://github.com/storybookjs/storybook/pull/30649), thanks @yannbf!
- Codemod: Migrate meta.args to meta.input.args in csf factories - [#30641](https://github.com/storybookjs/storybook/pull/30641), thanks @yannbf!
- Codemod: Use real path from symbolic links - [#30642](https://github.com/storybookjs/storybook/pull/30642), thanks @yannbf!
- Core: Always place cache dir inside `node_modules` - [#30643](https://github.com/storybookjs/storybook/pull/30643), thanks @ndelangen!
- Core: Fix addon essentials preview preset - [#30647](https://github.com/storybookjs/storybook/pull/30647), thanks @yannbf!
- Core: Fix extracting import path when it's not a core addon - [#30640](https://github.com/storybookjs/storybook/pull/30640), thanks @yannbf!
## 8.6.0-beta.8
- Addon-Test: Fix console error in build mode - [#30625](https://github.com/storybookjs/storybook/pull/30625), thanks @JReinhold!
- Manager: Fix panel reactivity - [#30638](https://github.com/storybookjs/storybook/pull/30638), thanks @valentinpalkovic!
## 8.6.0-beta.7
- Angular: Fix @angular/platform-browser/animations never available - [#30618](https://github.com/storybookjs/storybook/pull/30618), thanks @valentinpalkovic!

View File

@ -49,7 +49,7 @@ export default {
subEntry !== 'metafile' ? `${pkgName} - ${subEntry}` : pkgName,
];
})
.concat([['core - core', '@storybook/core - core - TOO BIG PLEASE UPLOAD MANUALLY']])
.concat([['core - core', 'core - TOO BIG PLEASE UPLOAD MANUALLY']])
),
},
},

View File

@ -2,8 +2,8 @@ import { join } from 'node:path';
import { defineMain } from '../frameworks/react-vite/src/node';
const componentsPath = join(__dirname, '../core/src/components');
const managerApiPath = join(__dirname, '../core/src/manager-api');
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 = defineMain({

View File

@ -25,7 +25,7 @@ import addonTest from '@storybook/experimental-addon-test';
import { definePreview } from '@storybook/react-vite';
import addonA11y from '@storybook/addon-a11y';
import addonEssentials from '@storybook/addon-essentials';
import * as addonEssentials from '@storybook/addon-essentials/entry-preview';
import addonThemes from '@storybook/addon-themes';
import * as addonsPreview from '../addons/toolbars/template/stories/preview';
@ -372,7 +372,7 @@ const parameters = {
export default definePreview({
addons: [
addonThemes(),
addonEssentials(),
addonEssentials,
addonA11y(),
addonTest(),
addonsPreview,

View File

@ -42,7 +42,7 @@ export default mergeConfig(
'**/Zoom.stories.tsx', // expected to fail in Vitest because of fetching /iframe.html to cause ECONNREFUSED
'**/lib/blocks/src/**', // won't work because of https://github.com/storybookjs/storybook/issues/29783
],
// TODO: bring this back once portable stories support @storybook/core/preview-api hooks
// TODO: bring this back once portable stories support storybook/internal/preview-api hooks
// @ts-expect-error this type does not exist but the property does!
testNamePattern: /^(?!.*(UseState)).*$/,
browser: {

View File

@ -5,6 +5,8 @@ enableGlobalCache: true
installStatePath: ../.yarn/code-install-state.gz
logFilters:
- code: YN0007
level: discard
- code: YN0005
level: discard
- code: YN0076

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-a11y",
"version": "8.6.0-beta.7",
"version": "9.0.0-alpha.0",
"description": "Test component compliance with web accessibility standards",
"keywords": [
"a11y",

View File

@ -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',

View File

@ -58,6 +58,7 @@ export const experimental_afterEach: AfterEach<any> = async ({
if (getIsVitestStandaloneRun()) {
if (hasViolations && getMode() === 'failed') {
if (!vitestMatchersExtended) {
// @ts-expect-error (unknown why vitest-axe is not typed correctly)
const { toHaveNoViolations } = await import('vitest-axe/matchers');
expect.extend({ toHaveNoViolations });
vitestMatchersExtended = true;

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-actions",
"version": "8.6.0-beta.7",
"version": "9.0.0-alpha.0",
"description": "Get UI feedback when an action is performed on an interactive element",
"keywords": [
"storybook",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-backgrounds",
"version": "8.6.0-beta.7",
"version": "9.0.0-alpha.0",
"description": "Switch backgrounds to view components in different settings",
"keywords": [
"addon",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-controls",
"version": "8.6.0-beta.7",
"version": "9.0.0-alpha.0",
"description": "Interact with component inputs dynamically in the Storybook UI",
"keywords": [
"addon",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-docs",
"version": "8.6.0-beta.7",
"version": "9.0.0-alpha.0",
"description": "Document component usage and properties in Markdown",
"keywords": [
"addon",

View File

@ -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 = {

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-essentials",
"version": "8.6.0-beta.7",
"version": "9.0.0-alpha.0",
"description": "Curated addons to bring out the best of Storybook",
"keywords": [
"addon",
@ -27,7 +27,7 @@
"import": "./dist/index.mjs",
"require": "./dist/index.js"
},
"./preview": {
"./entry-preview": {
"types": "./dist/preview.d.ts",
"import": "./dist/preview.mjs",
"require": "./dist/preview.js"
@ -88,7 +88,7 @@
"*": [
"dist/index.d.ts"
],
"preview": [
"entry-preview": [
"dist/preview.d.ts"
]
}

View File

@ -1 +1,2 @@
// @ts-expect-error (no types needed for this)
export * from '@storybook/addon-actions/manager';

View File

@ -1 +1,2 @@
// @ts-expect-error (no types)
export * from '@storybook/addon-backgrounds/manager';

View File

@ -1 +1,2 @@
// @ts-expect-error (no types)
export * from '@storybook/addon-outline/manager';

View File

@ -1 +1,2 @@
// @ts-expect-error (no types)
export * from '@storybook/addon-viewport/manager';

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-mdx-gfm",
"version": "8.6.0-beta.7",
"version": "9.0.0-alpha.0",
"description": "GitHub Flavored Markdown in Storybook",
"keywords": [
"addon",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-highlight",
"version": "8.6.0-beta.7",
"version": "9.0.0-alpha.0",
"description": "Highlight DOM nodes within your stories",
"keywords": [
"storybook-addons",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-interactions",
"version": "8.6.0-beta.7",
"version": "9.0.0-alpha.0",
"description": "Automate, test and debug user interactions",
"keywords": [
"storybook-addons",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-jest",
"version": "8.6.0-beta.7",
"version": "9.0.0-alpha.0",
"description": "React storybook addon that show component jest report",
"keywords": [
"addon",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-links",
"version": "8.6.0-beta.7",
"version": "9.0.0-alpha.0",
"description": "Link stories together to build demos and prototypes with your UI components",
"keywords": [
"storybook-addons",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-measure",
"version": "8.6.0-beta.7",
"version": "9.0.0-alpha.0",
"description": "Inspect layouts by visualizing the box model",
"keywords": [
"storybook-addons",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-onboarding",
"version": "8.6.0-beta.7",
"version": "9.0.0-alpha.0",
"description": "Storybook Addon Onboarding - Introduces a new onboarding experience",
"keywords": [
"storybook-addons",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-outline",
"version": "8.6.0-beta.7",
"version": "9.0.0-alpha.0",
"description": "Outline all elements with CSS to help with layout placement and alignment",
"keywords": [
"storybook-addons",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-storysource",
"version": "8.6.0-beta.7",
"version": "9.0.0-alpha.0",
"description": "View a storys source code to see how it works and paste into your app",
"keywords": [
"addon",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/experimental-addon-test",
"version": "8.6.0-beta.7",
"version": "9.0.0-alpha.0",
"description": "Integrate Vitest with Storybook",
"keywords": [
"storybook-addons",

View File

@ -1,12 +1,11 @@
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,
} from '@storybook/core/core-events';
} from 'storybook/internal/core-events';
// eslint-disable-next-line depend/ban-dependencies
import { execaNode } from 'execa';

View File

@ -1,10 +1,9 @@
import { beforeEach, describe, expect, it, vi } from 'vitest';
import { describe, expect, it, vi } from 'vitest';
import { createVitest as actualCreateVitest } from 'vitest/node';
import { Channel, type ChannelTransport } from 'storybook/internal/channels';
import { experimental_MockUniversalStore } from 'storybook/internal/core-server';
import { Channel, type ChannelTransport } from '@storybook/core/channels';
import type { StoryIndex } from '@storybook/types';
import type { StoryIndex } from 'storybook/internal/types';
import path from 'pathe';

View File

@ -557,7 +557,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,

View File

@ -295,7 +295,7 @@ export const storybookTest = async (options?: UserOptions): Promise<Plugin[]> =>
The values you passed to "test.include" will be ignored, please remove them from your Vitest configuration where the Storybook plugin is applied.
More info: https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#indexing-behavior-of-storybookexperimental-addon-test-is-changed
More info: https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#addon-test-indexing-behavior-of-storybookexperimental-addon-test-is-changed
`)
);
}

View File

@ -2,8 +2,6 @@
"extends": "../../tsconfig.json",
"compilerOptions": {
"rootDir": "../../../",
"module": "Preserve",
"moduleResolution": "Bundler",
"types": ["vitest"],
"strict": true
},

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-themes",
"version": "8.6.0-beta.7",
"version": "9.0.0-alpha.0",
"description": "Switch between multiple themes for you components in Storybook",
"keywords": [
"css",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-toolbars",
"version": "8.6.0-beta.7",
"version": "9.0.0-alpha.0",
"description": "Create your own toolbar items that control story rendering",
"keywords": [
"addon",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-viewport",
"version": "8.6.0-beta.7",
"version": "9.0.0-alpha.0",
"description": "Build responsive components by adjusting Storybooks viewport size and orientation",
"keywords": [
"addon",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/builder-vite",
"version": "8.6.0-beta.7",
"version": "9.0.0-alpha.0",
"description": "A plugin to run and build Storybooks with Vite",
"homepage": "https://github.com/storybookjs/storybook/tree/next/code/builders/builder-vite/#readme",
"bugs": {

View File

@ -17,7 +17,6 @@ const INCLUDE_CANDIDATES = [
'@storybook/addon-backgrounds/preview',
'@storybook/addon-designs/blocks',
'@storybook/addon-docs/preview',
'@storybook/addon-essentials/preview',
'@storybook/addon-essentials/actions/preview',
'@storybook/addon-essentials/actions/preview',
'@storybook/addon-essentials/backgrounds/preview',

View File

@ -32,10 +32,12 @@ export async function createViteServer(options: Options, devServer: Server) {
const ipRegex = /^(?:\d{1,3}\.){3}\d{1,3}$|^(?:[a-fA-F0-9]{1,4}:){7}[a-fA-F0-9]{1,4}$/;
if (
// @ts-expect-error (unknown)
!(config.server.allowedHosts as string[])?.length &&
options.host &&
!ipRegex.test(options.host)
) {
// @ts-expect-error (unknown)
config.server.allowedHosts = [options.host.toLowerCase()];
}

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/builder-webpack5",
"version": "8.6.0-beta.7",
"version": "9.0.0-alpha.0",
"description": "Storybook framework-agnostic API",
"keywords": [
"storybook"

View File

@ -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, IgnorePlugin, ProgressPlugin } from 'webpack';
import webpackDevMiddleware from 'webpack-dev-middleware';
@ -32,6 +31,8 @@ export const printDuration = (startTime: [number, number]) =>
.replace(' s', ' seconds')
.replace(' m', ' minutes');
const corePath = dirname(require.resolve('storybook/package.json'));
let compilation: ReturnType<typeof webpackDevMiddleware> | undefined;
let reject: (reason?: any) => void;

View File

@ -23,4 +23,4 @@ process.once('uncaughtException', (error) => {
throw error;
});
require('../dist/proxy.cjs');
require('../dist/bin/index.cjs');

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/core",
"version": "8.6.0-beta.7",
"name": "storybook",
"version": "9.0.0-alpha.0",
"description": "Storybook framework-agnostic API",
"keywords": [
"storybook"
@ -27,155 +27,159 @@
"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"
},
"./csf": {
"./internal/csf": {
"types": "./dist/csf/index.d.ts",
"import": "./dist/csf/index.js",
"require": "./dist/csf/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"
@ -188,89 +192,90 @@
"*": [
"./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"
],
"csf": [
"internal/csf": [
"./dist/csf/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/**/*",
@ -292,16 +297,16 @@
"recast": "^0.23.5",
"semver": "^7.6.2",
"util": "^0.12.5",
"ws": "^8.2.3"
"ws": "^8.18.0"
},
"devDependencies": {
"@aw-web-design/x-default-browser": "1.4.126",
"@babel/core": "^7.24.4",
"@babel/generator": "^7.24.4",
"@babel/parser": "^7.24.4",
"@babel/preset-react": "^7.24.1",
"@babel/traverse": "^7.24.1",
"@babel/types": "^7.24.0",
"@babel/core": "^7.26.9",
"@babel/generator": "^7.26.9",
"@babel/parser": "^7.26.9",
"@babel/preset-react": "^7.26.3",
"@babel/traverse": "^7.26.9",
"@babel/types": "^7.26.8",
"@discoveryjs/json-ext": "^0.5.3",
"@emotion/cache": "^11.14.0",
"@emotion/is-prop-valid": "^1.3.1",
@ -318,7 +323,7 @@
"@radix-ui/react-slot": "^1.0.2",
"@storybook/docs-mdx": "4.0.0-next.1",
"@storybook/global": "^5.0.0",
"@storybook/icons": "^1.2.12",
"@storybook/icons": "^1.3.2",
"@tanstack/react-virtual": "^3.3.0",
"@testing-library/react": "^14.0.0",
"@types/cross-spawn": "^6.0.2",

View File

@ -17,24 +17,24 @@ async function run() {
...Object.keys((pkg as any).peerDependencies || {}),
...nodeInternals,
'typescript',
'@storybook/core',
'storybook',
'@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/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);

View File

@ -47,6 +47,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),
];
};

View File

@ -40,7 +40,7 @@ export async function generatePackageJsonFile(entries: ReturnType<typeof getEntr
main
.replace(/\/index\.tsx?/, '')
.replace(/\.tsx?/, '')
.replace('dist/', '')
.replace('dist/', 'internal/')
] = content;
return acc;
}, {});
@ -73,7 +73,7 @@ export async function generatePackageJsonFile(entries: ReturnType<typeof getEntr
}
const content = ['./' + main.replace(/\.tsx?/, '.d.ts')];
acc[key.replace('dist/', '')] = content;
acc[key.replace('dist/', 'internal/')] = content;
return acc;
}, {}),
},

View File

@ -82,6 +82,7 @@ async function generateFrameworksFile(prettierConfig: prettier.Options | null):
const localAlias = {
'@storybook/core': join(__dirname, '..', '..', 'src'),
'storybook/internal': join(__dirname, '..', '..', 'src'),
storybook: join(__dirname, '..', '..', 'src'),
};
async function generateExportsFile(prettierConfig: prettier.Options | null): Promise<void> {

View File

@ -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,
@ -124,10 +124,6 @@ async function run() {
platform: 'neutral',
mainFields: ['main', 'module', 'node'],
conditions: ['node', 'module', 'import', 'require'],
define: {
'process.env.NODE_ENV': '"production"',
'process.env.DEV': '"false"',
},
} satisfies EsbuildContextOptions;
const browserAliases = {
@ -196,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(
@ -221,7 +217,7 @@ async function run() {
esbuild.context(
merge<EsbuildContextOptions>(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(

View File

@ -0,0 +1,62 @@
import { spawn } from 'node:child_process';
import { readFileSync } from 'node:fs';
import { dirname, join } from 'node:path';
import versions from '../common/versions';
const args = process.argv.slice(2);
if (['dev', 'build', 'index'].includes(args[0])) {
require('storybook/internal/cli/bin');
} else {
let command;
if (args[0] === 'init') {
let foundCreateStorybook;
try {
foundCreateStorybook = require.resolve('create-storybook/package.json');
} catch (e) {
// ignore
}
if (foundCreateStorybook) {
const json = JSON.parse(readFileSync(foundCreateStorybook, 'utf-8'));
if (json.version === versions['create-storybook']) {
command = [
'node',
join(dirname(foundCreateStorybook), 'bin', 'index.cjs'),
...args.slice(1),
];
}
} else {
command = ['npx', '--yes', `create-storybook@${versions.storybook}`, ...args.slice(1)];
}
} else {
let foundStorybookCLI;
try {
foundStorybookCLI = require.resolve('@storybook/cli/package.json');
} catch (e) {
// ignore
}
if (foundStorybookCLI) {
const json = JSON.parse(readFileSync(foundStorybookCLI, 'utf-8'));
if (json.version === versions['@storybook/cli']) {
command = ['node', join(dirname(foundStorybookCLI), 'bin', 'index.cjs'), ...args];
}
} else {
command = ['npx', '--yes', `@storybook/cli@${versions.storybook}`, ...args];
}
}
if (!command) {
console.error('Could not run storybook cli, please report this as a bug');
process.exit(1);
}
const child = spawn(command[0], command.slice(1), { stdio: 'inherit', shell: true });
child.on('exit', (code) => {
if (code != null) {
process.exit(code);
}
process.exit(1);
});
}

View File

@ -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

View File

@ -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';

View File

@ -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';

View File

@ -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;

View File

@ -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';

View File

@ -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) => {

View File

@ -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(

View File

@ -1,8 +1,8 @@
/// <reference path="../../typings.d.ts" />
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';

View File

@ -1,7 +1,7 @@
/// <reference path="../../typings.d.ts" />
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';

View File

@ -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';

View File

@ -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 { findPackage } from 'fd-package-json';

View File

@ -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';

View File

@ -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;

View File

@ -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';

View File

@ -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';

View File

@ -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';

View File

@ -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';

View File

@ -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';

View File

@ -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';

View File

@ -1,7 +1,7 @@
import type {
SupportedRenderers as CoreSupportedRenderers,
SupportedFrameworks,
} from '@storybook/core/types';
} from 'storybook/internal/types';
import { minVersion, validRange } from 'semver';

View File

@ -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');

View File

@ -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';

View File

@ -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();
});
});

View File

@ -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';

View File

@ -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();
});
});

View File

@ -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';

View File

@ -1,4 +1,4 @@
import type { PackageJson } from '@storybook/core/types';
import type { PackageJson } from 'storybook/internal/types';
export type PackageJsonWithDepsAndDevDeps = PackageJson &
Required<Pick<PackageJson, 'dependencies' | 'devDependencies'>>;

View File

@ -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();
});
});

View File

@ -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';

View File

@ -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();
});
});

View File

@ -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';

View File

@ -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(),

View File

@ -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';

View File

@ -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';

View File

@ -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,

View File

@ -18,7 +18,7 @@ const BASE_HTML_CONTENTS = '<script>console.log("base script!");</script>';
const BASE_BODY_HTML_CONTENTS = '<div>story contents</div>';
const BODY_HTML_CONTENTS = '<div>custom body contents</div>';
const base = dirname(require.resolve('@storybook/core/package.json'));
const base = dirname(require.resolve('storybook/package.json'));
describe('server.getPreviewHeadHtml', () => {
afterEach(() => {

View File

@ -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;

View File

@ -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],

View File

@ -82,7 +82,7 @@ export async function getCoercedStorybookVersion(packageManager: JsPackageManage
)
).filter(({ version }) => !!version);
return packages[0]?.version;
return packages[0]?.version || versions.storybook;
}
export function getEnvConfig(program: Record<string, any>, configEnv: Record<string, any>): void {

View File

@ -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,

View File

@ -32,9 +32,12 @@ export async function getAddonAnnotations(addon: string) {
isCoreAddon: isCorePackage(addon),
};
// for backwards compatibility, if it's not a core addon we use /preview entrypoint
if (!data.isCoreAddon) {
data.importPath = `@storybook/${addon}/preview`;
if (addon === '@storybook/addon-essentials') {
data.importPath = '@storybook/addon-essentials/entry-preview';
return data;
} else if (!data.isCoreAddon) {
// for backwards compatibility, if it's not a core addon we use /preview entrypoint
data.importPath = `${addon}/preview`;
}
require.resolve(path.join(addon, 'preview'));

View File

@ -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`.

View File

@ -1,4 +1,4 @@
import type { Options } from '@storybook/core/types';
import type { Options } from 'storybook/internal/types';
import { dedent } from 'ts-dedent';

View File

@ -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';

View File

@ -1,10 +1,9 @@
import { relative } from 'node:path';
import { normalizeStories, normalizeStoryPath } from '@storybook/core/common';
import { sanitize, storyNameFromExport, toId } from '@storybook/core/csf';
import type { Options, StoriesEntry } from '@storybook/core/types';
import { userOrAutoTitleFromSpecifier } from '@storybook/core/preview-api';
import { normalizeStories, normalizeStoryPath } from 'storybook/internal/common';
import { sanitize, storyNameFromExport, toId } from 'storybook/internal/csf';
import { userOrAutoTitleFromSpecifier } from 'storybook/internal/preview-api';
import type { Options, StoriesEntry } from 'storybook/internal/types';
import { dedent } from 'ts-dedent';

View File

@ -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';

Some files were not shown because too many files have changed in this diff Show More