Skip to content

Commit

Permalink
Merge branch 'next' into pocka/fix-404-mdx-links
Browse files Browse the repository at this point in the history
  • Loading branch information
jonniebigodes authored Sep 9, 2024
2 parents 7a32c16 + cce24a0 commit 6717970
Show file tree
Hide file tree
Showing 106 changed files with 801 additions and 337 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.prerelease.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
## 8.3.0-beta.4

- Test: Rename vitest plugin entrypoint - [#29067](https://github.com/storybookjs/storybook/pull/29067), thanks @yannbf!
- UI: Fix sidebar not wrapping - [#29055](https://github.com/storybookjs/storybook/pull/29055), thanks @JReinhold!

## 8.3.0-beta.3

- Addon Test: Improve messages and post install script handling - [#29036](https://github.com/storybookjs/storybook/pull/29036), thanks @yannbf!
- Next.js-Vite: Fix vite plugin exports - [#29046](https://github.com/storybookjs/storybook/pull/29046), thanks @valentinpalkovic!
- Next.js: Update dependencies - [#29052](https://github.com/storybookjs/storybook/pull/29052), thanks @valentinpalkovic!
- UI: Fix conditional hooks usage in sidebar - [#28979](https://github.com/storybookjs/storybook/pull/28979), thanks @JReinhold!

## 8.3.0-beta.2

- Addon Vitest: Fix indentation of 'vitePluginNext' in generated Vitest config file - [#29011](https://github.com/storybookjs/storybook/pull/29011), thanks @ghengeveld!
Expand Down
2 changes: 1 addition & 1 deletion code/.storybook/vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default mergeConfig(
vitestCommonConfig,
defineProject({
plugins: [
import('@storybook/experimental-addon-test/vite-plugin').then(({ storybookTest }) =>
import('@storybook/experimental-addon-test/vitest-plugin').then(({ storybookTest }) =>
storybookTest({
configDir: process.cwd(),
})
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.3.0-beta.2",
"version": "8.3.0-beta.4",
"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.3.0-beta.2",
"version": "8.3.0-beta.4",
"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.3.0-beta.2",
"version": "8.3.0-beta.4",
"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.3.0-beta.2",
"version": "8.3.0-beta.4",
"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.3.0-beta.2",
"version": "8.3.0-beta.4",
"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.3.0-beta.2",
"version": "8.3.0-beta.4",
"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.3.0-beta.2",
"version": "8.3.0-beta.4",
"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.3.0-beta.2",
"version": "8.3.0-beta.4",
"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.3.0-beta.2",
"version": "8.3.0-beta.4",
"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.3.0-beta.2",
"version": "8.3.0-beta.4",
"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.3.0-beta.2",
"version": "8.3.0-beta.4",
"description": "Link stories together to build demos and prototypes with your UI components",
"keywords": [
"addon",
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.3.0-beta.2",
"version": "8.3.0-beta.4",
"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.3.0-beta.2",
"version": "8.3.0-beta.4",
"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.3.0-beta.2",
"version": "8.3.0-beta.4",
"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.3.0-beta.2",
"version": "8.3.0-beta.4",
"description": "View a story’s source code to see how it works and paste into your app",
"keywords": [
"addon",
Expand Down
37 changes: 20 additions & 17 deletions 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.3.0-beta.2",
"version": "8.3.0-beta.4",
"description": "Integrate Vitest with Storybook",
"keywords": [
"storybook-addons",
Expand Down Expand Up @@ -29,24 +29,24 @@
"import": "./dist/index.js",
"require": "./dist/index.cjs"
},
"./vite-plugin": {
"types": "./dist/plugin/index.d.ts",
"import": "./dist/plugin/index.js",
"require": "./dist/plugin/index.cjs"
"./vitest-plugin": {
"types": "./dist/vitest-plugin/index.d.ts",
"import": "./dist/vitest-plugin/index.js",
"require": "./dist/vitest-plugin/index.cjs"
},
"./internal/global-setup": {
"types": "./dist/plugin/global-setup.d.ts",
"import": "./dist/plugin/global-setup.js",
"require": "./dist/plugin/global-setup.cjs"
"types": "./dist/vitest-plugin/global-setup.d.ts",
"import": "./dist/vitest-plugin/global-setup.js",
"require": "./dist/vitest-plugin/global-setup.cjs"
},
"./internal/setup-file": {
"types": "./dist/plugin/setup-file.d.ts",
"import": "./dist/plugin/setup-file.js"
"types": "./dist/vitest-plugin/setup-file.d.ts",
"import": "./dist/vitest-plugin/setup-file.js"
},
"./internal/test-utils": {
"types": "./dist/plugin/test-utils.d.ts",
"import": "./dist/plugin/test-utils.js",
"require": "./dist/plugin/test-utils.cjs"
"types": "./dist/vitest-plugin/test-utils.d.ts",
"import": "./dist/vitest-plugin/test-utils.js",
"require": "./dist/vitest-plugin/test-utils.cjs"
},
"./manager": "./dist/manager.js",
"./preset": "./dist/preset.cjs",
Expand All @@ -73,8 +73,11 @@
"@storybook/csf": "^0.1.11"
},
"devDependencies": {
"@types/semver": "^7",
"@vitest/browser": "^2.0.0",
"boxen": "^8.0.1",
"find-up": "^7.0.0",
"semver": "^7.6.3",
"tinyrainbow": "^1.2.0",
"ts-dedent": "^2.2.0",
"vitest": "^2.0.0"
Expand All @@ -90,16 +93,16 @@
"bundler": {
"exportEntries": [
"./src/index.ts",
"./src/plugin/test-utils.ts",
"./src/plugin/setup-file.ts"
"./src/vitest-plugin/test-utils.ts",
"./src/vitest-plugin/setup-file.ts"
],
"managerEntries": [
"./src/manager.tsx"
],
"nodeEntries": [
"./src/preset.ts",
"./src/plugin/index.ts",
"./src/plugin/global-setup.ts",
"./src/vitest-plugin/index.ts",
"./src/vitest-plugin/global-setup.ts",
"./src/postinstall.ts"
]
}
Expand Down
2 changes: 1 addition & 1 deletion code/addons/test/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
"targets": {
"build": {}
}
}
}
4 changes: 2 additions & 2 deletions code/addons/test/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { storybookTest as storybookTestImport } from './plugin';
import type { storybookTest as storybookTestImport } from './vitest-plugin';

// make it work with --isolatedModules
export default {};

// @ts-expect-error - this is a hack to make the module's sub-path augmentable
declare module '@storybook/experimental-addon-test/vite-plugin' {
declare module '@storybook/experimental-addon-test/vitest-plugin' {
export const storybookTest: typeof storybookTestImport;
}
34 changes: 34 additions & 0 deletions code/addons/test/src/postinstall-logger.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { colors, logger } from 'storybook/internal/node-logger';

import boxen, { type Options } from 'boxen';

const fancy =
process.platform !== 'win32' || process.env.CI || process.env.TERM === 'xterm-256color';

export const step = colors.gray('›');
export const info = colors.blue(fancy ? 'ℹ' : 'i');
export const success = colors.green(fancy ? '✔' : '√');
export const warning = colors.orange(fancy ? '⚠' : '‼');
export const error = colors.red(fancy ? '✖' : '×');

const baseOptions: Options = {
borderStyle: 'round',
padding: 1,
};

export const print = (message: string, options: Options) => {
logger.line(1);
logger.plain(boxen(message, { ...baseOptions, ...options }));
};

export const printInfo = (title: string, message: string, options?: Options) =>
print(message, { borderColor: 'blue', title, ...options });

export const printWarning = (title: string, message: string, options?: Options) =>
print(message, { borderColor: 'yellow', title, ...options });

export const printError = (title: string, message: string, options?: Options) =>
print(message, { borderColor: 'red', title, ...options });

export const printSuccess = (title: string, message: string, options?: Options) =>
print(message, { borderColor: 'green', title, ...options });
Loading

0 comments on commit 6717970

Please sign in to comment.