Skip to content

Commit

Permalink
fix storybook vite config
Browse files Browse the repository at this point in the history
  • Loading branch information
ajbura committed Jun 16, 2023
1 parent 76e2a10 commit c4ce544
Show file tree
Hide file tree
Showing 6 changed files with 175 additions and 13 deletions.
1 change: 1 addition & 0 deletions .storybook/base.jsx → .storybook/base.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import React from "react";
import "@fontsource/inter/variable.css";
import "@fontsource/noto-serif/latin.css";
import "../src/ui/App.css";
Expand Down
11 changes: 11 additions & 0 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,24 @@
import type { StorybookConfig } from "@storybook/react-vite";
import { mergeConfig } from "vite";

const config: StorybookConfig = {
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx)"],
addons: ["@storybook/addon-links", "@storybook/addon-essentials", "@storybook/addon-interactions"],
core: {
builder: "@storybook/builder-vite",
},
framework: {
name: "@storybook/react-vite",
options: {},
},
docs: {
autodocs: "tag",
},
async viteFinal(config) {
return mergeConfig(config, {
base: "/storybook",
test: undefined,
});
},
};
export default config;
13 changes: 0 additions & 13 deletions .storybook/preview.js

This file was deleted.

3 changes: 3 additions & 0 deletions .storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import type { Preview } from "@storybook/react";
import { baseDecorator } from "./base";

export const decorators = [baseDecorator];

const preview: Preview = {
parameters: {
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
"@storybook/addon-interactions": "^7.0.20",
"@storybook/addon-links": "^7.0.20",
"@storybook/blocks": "^7.0.20",
"@storybook/builder-vite": "^7.0.21",
"@storybook/react": "^7.0.20",
"@storybook/react-vite": "^7.0.20",
"@storybook/testing-library": "^0.0.14-next.2",
Expand Down
159 changes: 159 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3594,6 +3594,32 @@
remark-slug "^6.0.0"
rollup "^2.25.0 || ^3.3.0"

"@storybook/builder-vite@^7.0.21":
version "7.0.21"
resolved "https://registry.yarnpkg.com/@storybook/builder-vite/-/builder-vite-7.0.21.tgz#17a7214200e938257f41246bce642d61c640f797"
integrity sha512-Zves9giQs6oxsQeGKdmwlaywQaz9ZZqArgOzgYb8WytoDSlVrK81BzZN+gsm6cdxPOzdjOma2KhWi5YTz/d/Zg==
dependencies:
"@storybook/channel-postmessage" "7.0.21"
"@storybook/channel-websocket" "7.0.21"
"@storybook/client-logger" "7.0.21"
"@storybook/core-common" "7.0.21"
"@storybook/csf-plugin" "7.0.21"
"@storybook/mdx2-csf" "^1.0.0"
"@storybook/node-logger" "7.0.21"
"@storybook/preview" "7.0.21"
"@storybook/preview-api" "7.0.21"
"@storybook/types" "7.0.21"
browser-assert "^1.2.1"
es-module-lexer "^0.9.3"
express "^4.17.3"
fs-extra "^11.1.0"
glob "^8.1.0"
glob-promise "^6.0.2"
magic-string "^0.27.0"
remark-external-links "^8.0.0"
remark-slug "^6.0.0"
rollup "^2.25.0 || ^3.3.0"

"@storybook/[email protected]":
version "7.0.20"
resolved "https://registry.yarnpkg.com/@storybook/channel-postmessage/-/channel-postmessage-7.0.20.tgz#a7a70579a026c4c7fd74fc71fd6ff1f243612a68"
Expand All @@ -3606,6 +3632,18 @@
qs "^6.10.0"
telejson "^7.0.3"

"@storybook/[email protected]":
version "7.0.21"
resolved "https://registry.yarnpkg.com/@storybook/channel-postmessage/-/channel-postmessage-7.0.21.tgz#6e046b6d017302496845113ae557ea47721cf652"
integrity sha512-zlm40ZMhi76gVPMJsOLyorcKQy4RpAoVQfdXne83x+xP/A2ppOyXEAhC9pQ5oaKM+ag3EQuIS+yK4zGIeriaYg==
dependencies:
"@storybook/channels" "7.0.21"
"@storybook/client-logger" "7.0.21"
"@storybook/core-events" "7.0.21"
"@storybook/global" "^5.0.0"
qs "^6.10.0"
telejson "^7.0.3"

"@storybook/[email protected]":
version "7.0.20"
resolved "https://registry.yarnpkg.com/@storybook/channel-websocket/-/channel-websocket-7.0.20.tgz#7b0922fbffa33cf7b3be3faef11bac1f6a77f5e5"
Expand All @@ -3616,11 +3654,26 @@
"@storybook/global" "^5.0.0"
telejson "^7.0.3"

"@storybook/[email protected]":
version "7.0.21"
resolved "https://registry.yarnpkg.com/@storybook/channel-websocket/-/channel-websocket-7.0.21.tgz#6d678b460859a628d36c42d6438646f2ac6a1447"
integrity sha512-YX0h1CAHFNh4i0CsbIwEAMQsHxHhZXgN5SD5I0QGgqttErN4an90k4aah9MNnkyLO8Af9nFp2wL8Nj/yPmJ5bA==
dependencies:
"@storybook/channels" "7.0.21"
"@storybook/client-logger" "7.0.21"
"@storybook/global" "^5.0.0"
telejson "^7.0.3"

"@storybook/[email protected]":
version "7.0.20"
resolved "https://registry.yarnpkg.com/@storybook/channels/-/channels-7.0.20.tgz#a681c3d463b4099b001dae9edeb3a607a8f4854a"
integrity sha512-AL5GGSQ8WTDUoh3gitKEzo3fu7Vq5okXq2pAknAZlQA2Oio+HHO5nMeXvOfGdvo/tzbpNE3n5utmCJz006xrCA==

"@storybook/[email protected]":
version "7.0.21"
resolved "https://registry.yarnpkg.com/@storybook/channels/-/channels-7.0.21.tgz#5a399e13b0bc4eefe52c5499ace2ca02e39d0b23"
integrity sha512-8h4lvGQsdWrn/eLW9D9ZGB8FGTzRuC1almykVThb9SkATKZjUyUvtRT+BklsDIinptham83+0QiSdTrv52kAfA==

"@storybook/[email protected]":
version "7.0.20"
resolved "https://registry.yarnpkg.com/@storybook/cli/-/cli-7.0.20.tgz#a099893bc664318e98a1deb6ef0aa328751967d3"
Expand Down Expand Up @@ -3673,6 +3726,13 @@
dependencies:
"@storybook/global" "^5.0.0"

"@storybook/[email protected]":
version "7.0.21"
resolved "https://registry.yarnpkg.com/@storybook/client-logger/-/client-logger-7.0.21.tgz#7bce1acb100d8ea8b8fe02f3f89d8f34d108ee53"
integrity sha512-ENoBDuVr3RPepm6cBp61GGtGGUuogBzqMUaN4Rti+wYx9sKJlmDA8SR/fMk+GxeiJ5NOnYoa1Q1kCaF8/VFD9A==
dependencies:
"@storybook/global" "^5.0.0"

"@storybook/[email protected]":
version "7.0.20"
resolved "https://registry.yarnpkg.com/@storybook/codemod/-/codemod-7.0.20.tgz#04cff68207d49dca427a16f73912d494eb56103b"
Expand Down Expand Up @@ -3739,11 +3799,41 @@
resolve-from "^5.0.0"
ts-dedent "^2.0.0"

"@storybook/[email protected]":
version "7.0.21"
resolved "https://registry.yarnpkg.com/@storybook/core-common/-/core-common-7.0.21.tgz#fb7fafe0cab1a911f7b1f39a4a759a3053a999e6"
integrity sha512-hxQXufZxbrDqASTfrJ/C4PlIvRwwmdElOrnzeWA4e4pRGK2YUInAsKxN7WKRDL42fBLfrHo3XmdshkvPej4M4A==
dependencies:
"@storybook/node-logger" "7.0.21"
"@storybook/types" "7.0.21"
"@types/node" "^16.0.0"
"@types/pretty-hrtime" "^1.0.0"
chalk "^4.1.0"
esbuild "^0.17.0"
esbuild-register "^3.4.0"
file-system-cache "^2.0.0"
find-up "^5.0.0"
fs-extra "^11.1.0"
glob "^8.1.0"
glob-promise "^6.0.2"
handlebars "^4.7.7"
lazy-universal-dotenv "^4.0.0"
picomatch "^2.3.0"
pkg-dir "^5.0.0"
pretty-hrtime "^1.0.3"
resolve-from "^5.0.0"
ts-dedent "^2.0.0"

"@storybook/[email protected]":
version "7.0.20"
resolved "https://registry.yarnpkg.com/@storybook/core-events/-/core-events-7.0.20.tgz#53878b736463c30141115ccdfba401bcf2645cba"
integrity sha512-gUBQsbcDmRufmg8LdH7D57c/9BQ+cPi2vBcXdudmxeJFafGwDmLRu1mlv9rxlW4kicn/LZWJjKXtq4XXzF4OGg==

"@storybook/[email protected]":
version "7.0.21"
resolved "https://registry.yarnpkg.com/@storybook/core-events/-/core-events-7.0.21.tgz#7935b6d3ec3d77d30ffa1f970bb06bca5295a368"
integrity sha512-Qjtjrj+hFaC3b00p6q2aAxyLaRQWBf5eEPw5r0djcm5esXIs/q2xvu2xby7PR6KnKg/jT1bU9TOBxWbtKycijQ==

"@storybook/[email protected]":
version "7.0.20"
resolved "https://registry.yarnpkg.com/@storybook/core-server/-/core-server-7.0.20.tgz#b8c5f100ced5fd227c19e30127706eb0d28e3cd4"
Expand Down Expand Up @@ -3800,6 +3890,14 @@
"@storybook/csf-tools" "7.0.20"
unplugin "^0.10.2"

"@storybook/[email protected]":
version "7.0.21"
resolved "https://registry.yarnpkg.com/@storybook/csf-plugin/-/csf-plugin-7.0.21.tgz#5d40fa7f18a997e9dbb0dd4c587c244cc37c1a95"
integrity sha512-oaCgizetktTzxgJlJURA3RLQSDYAECw80XGbcUdruCMVgU1WrMrMJIdiYLqDDPUWSAZuFp4RsmfRjWTK6WxRUA==
dependencies:
"@storybook/csf-tools" "7.0.21"
unplugin "^0.10.2"

"@storybook/[email protected]":
version "7.0.20"
resolved "https://registry.yarnpkg.com/@storybook/csf-tools/-/csf-tools-7.0.20.tgz#33947eaaf4fead1aa634d0674bdd43e55115aa49"
Expand All @@ -3815,6 +3913,21 @@
recast "^0.23.1"
ts-dedent "^2.0.0"

"@storybook/[email protected]":
version "7.0.21"
resolved "https://registry.yarnpkg.com/@storybook/csf-tools/-/csf-tools-7.0.21.tgz#9d08138b47f173d8d5e6af3e256db21740d0b8cd"
integrity sha512-a3oN29dgf+5pLOTtXyZhfzPhTEPvw44GAoQmi5giUMB486j6PSEq9IPj/birJk9+lX/ho6M9ZzI9QiBMXVeXlQ==
dependencies:
"@babel/generator" "~7.21.1"
"@babel/parser" "~7.21.2"
"@babel/traverse" "~7.21.2"
"@babel/types" "~7.21.2"
"@storybook/csf" "^0.1.0"
"@storybook/types" "7.0.21"
fs-extra "^11.1.0"
recast "^0.23.1"
ts-dedent "^2.0.0"

"@storybook/csf@^0.0.1":
version "0.0.1"
resolved "https://registry.yarnpkg.com/@storybook/csf/-/csf-0.0.1.tgz#95901507dc02f0bc6f9ac8ee1983e2fc5bb98ce6"
Expand Down Expand Up @@ -3904,6 +4017,16 @@
npmlog "^5.0.1"
pretty-hrtime "^1.0.3"

"@storybook/[email protected]":
version "7.0.21"
resolved "https://registry.yarnpkg.com/@storybook/node-logger/-/node-logger-7.0.21.tgz#3a2df6879ffacc76a82d7336ec445e221ebe213f"
integrity sha512-km7MfQ7Hk04UsH/ZgwW5iqSxlGi/Z/lw8Mb0Zdv7ms+FllPBPf5BhgjuC7LA6y+3WUghl6ESpDoig2771TNy4w==
dependencies:
"@types/npmlog" "^4.1.2"
chalk "^4.1.0"
npmlog "^5.0.1"
pretty-hrtime "^1.0.3"

"@storybook/[email protected]":
version "7.0.20"
resolved "https://registry.yarnpkg.com/@storybook/postinstall/-/postinstall-7.0.20.tgz#aec03de5a31974f6410a8ee1c4e24af7ac81a4c7"
Expand All @@ -3930,11 +4053,37 @@
ts-dedent "^2.0.0"
util-deprecate "^1.0.2"

"@storybook/[email protected]":
version "7.0.21"
resolved "https://registry.yarnpkg.com/@storybook/preview-api/-/preview-api-7.0.21.tgz#0c8331be5e19bba2e6e4cb288c4c32d3a53e1f6b"
integrity sha512-IvOxQdSLV3B+82zS8MDHSO/pMEQdKIXJaz3knizhRuuB+cCdfv2Sro3IL3l8m2+90ySSwkfCqVEI4tdIC1ODXg==
dependencies:
"@storybook/channel-postmessage" "7.0.21"
"@storybook/channels" "7.0.21"
"@storybook/client-logger" "7.0.21"
"@storybook/core-events" "7.0.21"
"@storybook/csf" "^0.1.0"
"@storybook/global" "^5.0.0"
"@storybook/types" "7.0.21"
"@types/qs" "^6.9.5"
dequal "^2.0.2"
lodash "^4.17.21"
memoizerific "^1.11.3"
qs "^6.10.0"
synchronous-promise "^2.0.15"
ts-dedent "^2.0.0"
util-deprecate "^1.0.2"

"@storybook/[email protected]":
version "7.0.20"
resolved "https://registry.yarnpkg.com/@storybook/preview/-/preview-7.0.20.tgz#13340503a7997977417bc65d339d30e02fb5dbfa"
integrity sha512-ayC7Aud0WM91ki+UM/CInd3GbGPmkUaeT6fqs9zvH8H4QQGznr9E8sI9IUQN0dbpGWayZn0m7Ma89EHwpWOwiw==

"@storybook/[email protected]":
version "7.0.21"
resolved "https://registry.yarnpkg.com/@storybook/preview/-/preview-7.0.21.tgz#aa85c09b0374fde5293c10a6ab127de29c1fa99d"
integrity sha512-WHAD0dlwlJGGTEJ2Lv2rbO9KGBbs4P9uy0oofCuVT+W/eKy26Y6cglnBZpT/lSvK3lNJWONtGRWwBqgdb2E9OQ==

"@storybook/[email protected]":
version "7.0.20"
resolved "https://registry.yarnpkg.com/@storybook/react-dom-shim/-/react-dom-shim-7.0.20.tgz#d35d3ed21bbe7a67287a95ac08614be41d4e069d"
Expand Down Expand Up @@ -4036,6 +4185,16 @@
"@types/express" "^4.7.0"
file-system-cache "^2.0.0"

"@storybook/[email protected]":
version "7.0.21"
resolved "https://registry.yarnpkg.com/@storybook/types/-/types-7.0.21.tgz#68b3e7bf667480dab546cfb3167197a1ab8f7d2a"
integrity sha512-gZ8XEsg0upyiisbe2Qv+G+XN2+nZCxj6vJKvgWxuBPCjqN3Uw34cgDrIJuSa8YjE/yl/nsaV5s0xYdFXAl7JVQ==
dependencies:
"@storybook/channels" "7.0.21"
"@types/babel__core" "^7.0.0"
"@types/express" "^4.7.0"
file-system-cache "^2.0.0"

"@testing-library/dom@^8.3.0":
version "8.20.0"
resolved "https://registry.yarnpkg.com/@testing-library/dom/-/dom-8.20.0.tgz#914aa862cef0f5e89b98cc48e3445c4c921010f6"
Expand Down

0 comments on commit c4ce544

Please sign in to comment.