Skip to content

Commit

Permalink
update to Storybook 8.5 beta
Browse files Browse the repository at this point in the history
  • Loading branch information
yannbf committed Dec 17, 2024
1 parent dacd3f9 commit 6e348c3
Show file tree
Hide file tree
Showing 8 changed files with 223 additions and 242 deletions.
File renamed without changes.
3 changes: 0 additions & 3 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npm run pre-commit
2 changes: 1 addition & 1 deletion .storybook/interaction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ async function mouseTo(

export const demoModeLoader: Loader = async (context) => {
// @ts-expect-error add module augmentation for types
const shouldUseDemoMode = import.meta.env.STORYBOOK && !globalThis.test && !isChromatic();
const shouldUseDemoMode = import.meta.env.STORYBOOK && !globalThis.test && !isChromatic() && !globalThis.__vitest_browser__;
if (shouldUseDemoMode && context.args.demoMode || context.parameters.test?.demoMode || context.globals.interactionsDemoMode) {
const user = userEvent.setup();

Expand Down
2 changes: 1 addition & 1 deletion .storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ const config: StorybookConfig = {
'../src/**/*.stories.@(js|jsx|ts|tsx)',
],
addons: [
'@storybook/addon-essentials',
'@storybook/experimental-addon-test',
'@chromatic-com/storybook',
'@storybook/addon-essentials',
'@storybook/addon-a11y',
'@storybook/addon-designs',
],
Expand Down
3 changes: 2 additions & 1 deletion .storybook/vitest.setup.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import * as a11yAddonAnnotations from "@storybook/addon-a11y/preview";
import { beforeAll } from 'vitest';
import { setProjectAnnotations } from '@storybook/react';
import * as projectAnnotations from './preview';

const project = setProjectAnnotations([projectAnnotations]);
const project = setProjectAnnotations([a11yAddonAnnotations, projectAnnotations]);

beforeAll(project.beforeAll);
6 changes: 4 additions & 2 deletions chromatic.config.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{
"projectId": "Project:5f84c5baa35bdd0022a7684f"
}
"projectId": "Project:5f84c5baa35bdd0022a7684f",
"onlyChanged": true,
"zip": true
}
27 changes: 12 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@
"test-storybook:ci": "concurrently --kill-others --success first --names \"SB,TEST\" --prefix-colors \"magenta,blue\" \"yarn build-storybook:test && npx serve build/storybook --listen 6006 --no-request-logging\" \"wait-on tcp:6006 && yarn test-storybook\"",
"test-storybook:json:ci": "concurrently --kill-others --success first --names \"SB,TEST\" --prefix-colors \"magenta,blue\" \"yarn build-storybook:test && npx serve build/storybook --listen 6006 --no-request-logging\" \"wait-on tcp:6006 && SKIP_SNAPSHOTS=true yarn test-storybook:json\""
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
">0.2%",
Expand All @@ -59,19 +56,19 @@
"@babel/core": "^7.14.6",
"@chromatic-com/storybook": "^3.2.1",
"@ladle/react": "^4.1.2",
"@storybook/addon-a11y": "^8.4.0",
"@storybook/addon-a11y": "^8.5.0-beta.1",
"@storybook/addon-coverage": "^1.0.4",
"@storybook/addon-designs": "^8.0.3",
"@storybook/addon-essentials": "^8.4.0",
"@storybook/addon-themes": "^8.4.0",
"@storybook/blocks": "^8.4.0",
"@storybook/experimental-addon-test": "^8.4.0",
"@storybook/manager-api": "^8.4.0",
"@storybook/react": "^8.4.0",
"@storybook/react-vite": "^8.4.0",
"@storybook/test": "^8.4.0",
"@storybook/addon-essentials": "^8.5.0-beta.1",
"@storybook/addon-themes": "^8.5.0-beta.1",
"@storybook/blocks": "^8.5.0-beta.1",
"@storybook/experimental-addon-test": "^8.5.0-beta.1",
"@storybook/manager-api": "^8.5.0-beta.1",
"@storybook/react": "^8.5.0-beta.1",
"@storybook/react-vite": "^8.5.0-beta.1",
"@storybook/test": "^8.5.0-beta.1",
"@storybook/test-runner": "^0.19.1",
"@storybook/theming": "^8.4.0",
"@storybook/theming": "^8.5.0-beta.1",
"@testing-library/jest-dom": "^6.4.6",
"@testing-library/react": "^16.0.0",
"@testing-library/react-hooks": "^8.0.1",
Expand Down Expand Up @@ -115,7 +112,7 @@
"prettier": "^3.2.5",
"react-is": "^18.3.1",
"react-test-renderer": "^18.3.1",
"storybook": "^8.4.0",
"storybook": "^8.5.0-beta.1",
"vite": "^4.0.0",
"vite-plugin-svgr": "^4.2.0",
"vite-tsconfig-paths": "^4.3.2",
Expand All @@ -135,4 +132,4 @@
"resolutions": {
"@use-it/event-listener@npm:^0.1.2": "patch:@use-it/event-listener@npm%3A0.1.7#~/.yarn/patches/@use-it-event-listener-npm-0.1.7-56ef42a654.patch"
}
}
}
Loading

0 comments on commit 6e348c3

Please sign in to comment.