Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] next from storybookjs:next #106

Merged
merged 8 commits into from
Dec 23, 2024
8 changes: 8 additions & 0 deletions CHANGELOG.prerelease.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## 8.5.0-beta.5

- Addon Test: Only reset story count on file change when watch mode is enabled - [#30121](https://github.com/storybookjs/storybook/pull/30121), thanks @ghengeveld!
- Build: Revert Downgrade to esbuild 0.24.0 - [#30120](https://github.com/storybookjs/storybook/pull/30120), thanks @yannbf!
- Core: Fix `ERR_PACKAGE_PATH_NOT_EXPORTED` in `@storybook/node-logger` - [#30093](https://github.com/storybookjs/storybook/pull/30093), thanks @JReinhold!
- React: Use Act wrapper in Storybook for component rendering - [#30037](https://github.com/storybookjs/storybook/pull/30037), thanks @valentinpalkovic!
- Vite: Add extra entries to `optimizeDeps` - [#30117](https://github.com/storybookjs/storybook/pull/30117), thanks @ndelangen!

## 8.5.0-beta.4

- Addon Themes: Deprecate useThemeParameters - [#30111](https://github.com/storybookjs/storybook/pull/30111), thanks @yannbf!
Expand Down
2 changes: 1 addition & 1 deletion code/addons/a11y/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-a11y",
"version": "8.5.0-beta.4",
"version": "8.5.0-beta.5",
"description": "Test component compliance with web accessibility standards",
"keywords": [
"a11y",
Expand Down
2 changes: 1 addition & 1 deletion code/addons/actions/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-actions",
"version": "8.5.0-beta.4",
"version": "8.5.0-beta.5",
"description": "Get UI feedback when an action is performed on an interactive element",
"keywords": [
"storybook",
Expand Down
2 changes: 1 addition & 1 deletion code/addons/backgrounds/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-backgrounds",
"version": "8.5.0-beta.4",
"version": "8.5.0-beta.5",
"description": "Switch backgrounds to view components in different settings",
"keywords": [
"addon",
Expand Down
2 changes: 1 addition & 1 deletion code/addons/controls/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-controls",
"version": "8.5.0-beta.4",
"version": "8.5.0-beta.5",
"description": "Interact with component inputs dynamically in the Storybook UI",
"keywords": [
"addon",
Expand Down
2 changes: 1 addition & 1 deletion code/addons/docs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-docs",
"version": "8.5.0-beta.4",
"version": "8.5.0-beta.5",
"description": "Document component usage and properties in Markdown",
"keywords": [
"addon",
Expand Down
2 changes: 1 addition & 1 deletion code/addons/essentials/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-essentials",
"version": "8.5.0-beta.4",
"version": "8.5.0-beta.5",
"description": "Curated addons to bring out the best of Storybook",
"keywords": [
"addon",
Expand Down
2 changes: 1 addition & 1 deletion code/addons/gfm/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-mdx-gfm",
"version": "8.5.0-beta.4",
"version": "8.5.0-beta.5",
"description": "GitHub Flavored Markdown in Storybook",
"keywords": [
"addon",
Expand Down
2 changes: 1 addition & 1 deletion code/addons/highlight/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-highlight",
"version": "8.5.0-beta.4",
"version": "8.5.0-beta.5",
"description": "Highlight DOM nodes within your stories",
"keywords": [
"storybook-addons",
Expand Down
2 changes: 1 addition & 1 deletion code/addons/interactions/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-interactions",
"version": "8.5.0-beta.4",
"version": "8.5.0-beta.5",
"description": "Automate, test and debug user interactions",
"keywords": [
"storybook-addons",
Expand Down
2 changes: 1 addition & 1 deletion code/addons/jest/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-jest",
"version": "8.5.0-beta.4",
"version": "8.5.0-beta.5",
"description": "React storybook addon that show component jest report",
"keywords": [
"addon",
Expand Down
2 changes: 1 addition & 1 deletion code/addons/links/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-links",
"version": "8.5.0-beta.4",
"version": "8.5.0-beta.5",
"description": "Link stories together to build demos and prototypes with your UI components",
"keywords": [
"storybook-addons",
Expand Down
2 changes: 1 addition & 1 deletion code/addons/measure/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-measure",
"version": "8.5.0-beta.4",
"version": "8.5.0-beta.5",
"description": "Inspect layouts by visualizing the box model",
"keywords": [
"storybook-addons",
Expand Down
2 changes: 1 addition & 1 deletion code/addons/onboarding/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-onboarding",
"version": "8.5.0-beta.4",
"version": "8.5.0-beta.5",
"description": "Storybook Addon Onboarding - Introduces a new onboarding experience",
"keywords": [
"storybook-addons",
Expand Down
2 changes: 1 addition & 1 deletion code/addons/outline/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-outline",
"version": "8.5.0-beta.4",
"version": "8.5.0-beta.5",
"description": "Outline all elements with CSS to help with layout placement and alignment",
"keywords": [
"storybook-addons",
Expand Down
2 changes: 1 addition & 1 deletion code/addons/storysource/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-storysource",
"version": "8.5.0-beta.4",
"version": "8.5.0-beta.5",
"description": "View a story’s source code to see how it works and paste into your app",
"keywords": [
"addon",
Expand Down
2 changes: 1 addition & 1 deletion code/addons/test/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/experimental-addon-test",
"version": "8.5.0-beta.4",
"version": "8.5.0-beta.5",
"description": "Integrate Vitest with Storybook",
"keywords": [
"storybook-addons",
Expand Down
7 changes: 7 additions & 0 deletions code/addons/test/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ export const DOCUMENTATION_FATAL_ERROR_LINK = `${DOCUMENTATION_LINK}#what-happen

export const COVERAGE_DIRECTORY = 'coverage';

export const SUPPORTED_FRAMEWORKS = [
'@storybook/nextjs',
'@storybook/experimental-nextjs-vite',
'@storybook/sveltekit',
];

export const SUPPORTED_RENDERERS = ['@storybook/react', '@storybook/svelte', '@storybook/vue3'];
export interface Config {
coverage: boolean;
a11y: boolean;
Expand Down
32 changes: 13 additions & 19 deletions code/addons/test/src/postinstall.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import { coerce, satisfies } from 'semver';
import { dedent } from 'ts-dedent';

import { type PostinstallOptions } from '../../../lib/cli-storybook/src/add';
import { SUPPORTED_FRAMEWORKS, SUPPORTED_RENDERERS } from './constants';
import { printError, printInfo, printSuccess, step } from './postinstall-logger';
import { getAddonNames } from './utils';

Expand Down Expand Up @@ -106,18 +107,11 @@ export default async function postInstall(options: PostinstallOptions) {
}
}

const annotationsImport = [
'@storybook/nextjs',
'@storybook/experimental-nextjs-vite',
'@storybook/sveltekit',
].includes(info.frameworkPackageName)
const annotationsImport = SUPPORTED_FRAMEWORKS.includes(info.frameworkPackageName)
? info.frameworkPackageName === '@storybook/nextjs'
? '@storybook/experimental-nextjs-vite'
: info.frameworkPackageName
: info.rendererPackageName &&
['@storybook/react', '@storybook/svelte', '@storybook/vue3'].includes(
info.rendererPackageName
)
: info.rendererPackageName && SUPPORTED_RENDERERS.includes(info.rendererPackageName)
? info.rendererPackageName
: null;

Expand Down Expand Up @@ -177,14 +171,14 @@ export default async function postInstall(options: PostinstallOptions) {
reasons.push(
dedent`
Please check the documentation for more information about its requirements and installation:
${picocolors.cyan(`https://storybook.js.org/docs/writing-tests/vitest-plugin`)}
${picocolors.cyan(`https://storybook.js.org/docs/writing-tests/test-addon`)}
`
);
} else {
reasons.push(
dedent`
Fear not, however, you can follow the manual installation process instead at:
${picocolors.cyan(`https://storybook.js.org/docs/writing-tests/vitest-plugin#manual`)}
${picocolors.cyan(`https://storybook.js.org/docs/writing-tests/test-addon#manual-setup`)}
`
);
}
Expand Down Expand Up @@ -308,7 +302,7 @@ export default async function postInstall(options: PostinstallOptions) {
${colors.gray(vitestSetupFile)}

Please refer to the documentation to complete the setup manually:
${picocolors.cyan(`https://storybook.js.org/docs/writing-tests/vitest-plugin#manual`)}
${picocolors.cyan(`https://storybook.js.org/docs/writing-tests/test-addon#manual-setup`)}
`
);
logger.line(1);
Expand Down Expand Up @@ -368,7 +362,7 @@ export default async function postInstall(options: PostinstallOptions) {
your existing workspace file automatically, you must do it yourself. This was the last step.

Please refer to the documentation to complete the setup manually:
${picocolors.cyan(`https://storybook.js.org/docs/writing-tests/vitest-plugin#manual`)}
${picocolors.cyan(`https://storybook.js.org/docs/writing-tests/test-addon#manual-setup`)}
`
);
logger.line(1);
Expand All @@ -390,7 +384,7 @@ export default async function postInstall(options: PostinstallOptions) {
your existing workspace file automatically, you must do it yourself. This was the last step.

Please refer to the documentation to complete the setup manually:
${picocolors.cyan(`https://storybook.js.org/docs/writing-tests/vitest-plugin#manual`)}
${picocolors.cyan(`https://storybook.js.org/docs/writing-tests/test-addon#manual-setup`)}
`
);
logger.line(1);
Expand All @@ -416,14 +410,14 @@ export default async function postInstall(options: PostinstallOptions) {
import { defineWorkspace } from 'vitest/config';
import { storybookTest } from '@storybook/experimental-addon-test/vitest-plugin';${vitestInfo.frameworkPluginImport}

// More info at: https://storybook.js.org/docs/writing-tests/vitest-plugin
// More info at: https://storybook.js.org/docs/writing-tests/test-addon
export default defineWorkspace([
'${relative(dirname(browserWorkspaceFile), rootConfig)}',
{
extends: '${viteConfigFile ? relative(dirname(browserWorkspaceFile), viteConfigFile) : ''}',
plugins: [
// The plugin will run tests for the stories defined in your Storybook config
// See options at: https://storybook.js.org/docs/writing-tests/vitest-plugin#storybooktest
// See options at: https://storybook.js.org/docs/writing-tests/test-addon#storybooktest
storybookTest({ configDir: '${options.configDir}' }),${vitestInfo.frameworkPluginDocs + vitestInfo.frameworkPluginCall}
],
test: {
Expand Down Expand Up @@ -456,11 +450,11 @@ export default async function postInstall(options: PostinstallOptions) {
import { defineConfig } from 'vitest/config';
import { storybookTest } from '@storybook/experimental-addon-test/vitest-plugin';${vitestInfo.frameworkPluginImport}

// More info at: https://storybook.js.org/docs/writing-tests/vitest-plugin
// More info at: https://storybook.js.org/docs/writing-tests/test-addon
export default defineConfig({
plugins: [
// The plugin will run tests for the stories defined in your Storybook config
// See options at: https://storybook.js.org/docs/writing-tests/vitest-plugin#storybooktest
// See options at: https://storybook.js.org/docs/writing-tests/test-addon#storybooktest
storybookTest({ configDir: '${options.configDir}' }),${vitestInfo.frameworkPluginDocs + vitestInfo.frameworkPluginCall}
],
test: {
Expand Down Expand Up @@ -490,7 +484,7 @@ export default async function postInstall(options: PostinstallOptions) {
• When using the Vitest extension in your editor, all of your stories will be shown as tests!

Check the documentation for more information about its features and options at:
${picocolors.cyan(`https://storybook.js.org/docs/writing-tests/vitest-plugin`)}
${picocolors.cyan(`https://storybook.js.org/docs/writing-tests/test-addon`)}
`
);
logger.line(1);
Expand Down
2 changes: 1 addition & 1 deletion code/addons/themes/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-themes",
"version": "8.5.0-beta.4",
"version": "8.5.0-beta.5",
"description": "Switch between multiple themes for you components in Storybook",
"keywords": [
"css",
Expand Down
2 changes: 1 addition & 1 deletion code/addons/toolbars/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-toolbars",
"version": "8.5.0-beta.4",
"version": "8.5.0-beta.5",
"description": "Create your own toolbar items that control story rendering",
"keywords": [
"addon",
Expand Down
2 changes: 1 addition & 1 deletion code/addons/viewport/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-viewport",
"version": "8.5.0-beta.4",
"version": "8.5.0-beta.5",
"description": "Build responsive components by adjusting Storybook’s viewport size and orientation",
"keywords": [
"addon",
Expand Down
2 changes: 1 addition & 1 deletion code/builders/builder-vite/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/builder-vite",
"version": "8.5.0-beta.4",
"version": "8.5.0-beta.5",
"description": "A plugin to run and build Storybooks with Vite",
"homepage": "https://github.com/storybookjs/storybook/tree/next/code/builders/builder-vite/#readme",
"bugs": {
Expand Down
2 changes: 1 addition & 1 deletion code/builders/builder-webpack5/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/builder-webpack5",
"version": "8.5.0-beta.4",
"version": "8.5.0-beta.5",
"description": "Storybook framework-agnostic API",
"keywords": [
"storybook"
Expand Down
2 changes: 1 addition & 1 deletion code/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/core",
"version": "8.5.0-beta.4",
"version": "8.5.0-beta.5",
"description": "Storybook framework-agnostic API",
"keywords": [
"storybook"
Expand Down
Loading
Loading