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

chore(nodejs): Upgrade Chromatic to 7.0. #857

Merged
merged 4 commits into from
Apr 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 7 additions & 21 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -1,29 +1,15 @@
import type { StorybookViteConfig } from "@storybook/builder-vite";
import type { StorybookConfig } from "@storybook/react-vite";

// Workaround for 'TypeError: (0 , vite_plugin_svgr_1.default) is not
// a function' error. I hate Storybook.
const svgr = require("vite-plugin-svgr");
//import svgr from "vite-plugin-svgr";

import tsconfigPaths from "vite-tsconfig-paths";
import { mergeConfig } from "vite";

const config: StorybookViteConfig = {
stories: ["../src/**/*.stories.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx)"],
const config: StorybookConfig = {
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx)"],
addons: ["@storybook/addon-links", "@storybook/addon-essentials"],
framework: "@storybook/react-vite",
core: {
builder: "@storybook/builder-vite",
disableTelemetry: true,
},

// storybook-builder-vite doesn't read the project's vite.config.js,
// so we have to recreate the important bits here, mainly the
// resolvers and the relevant plugins.
async viteFinal(config, _) {
return mergeConfig(config, {
plugins: [svgr(), tsconfigPaths()],
});
docs: {
autodocs: true,
},
};

module.exports = config;
export default config;
18 changes: 10 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
"lint": "eslint .",
"lint:fix": "eslint --fix .",
"generate": "orval --config ./orval.config.ts",
"storybook": "start-storybook -p 6006",
"build-storybook": "build-storybook",
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build",
"chromatic": "chromatic --exit-zero-on-changes",
"format": "prettier --write ."
},
Expand Down Expand Up @@ -47,11 +47,11 @@
"@headlessui/react": "^1.7.13",
"@headlessui/tailwindcss": "^0.1.2",
"@heroicons/react": "^2.0.17",
"@storybook/addon-actions": "^6.5.16",
"@storybook/addon-essentials": "^6.5.16",
"@storybook/addon-links": "^6.5.16",
"@storybook/builder-vite": "^0.4.2",
"@storybook/react": "^6.5.16",
"@storybook/addon-actions": "^7.0.2",
"@storybook/addon-essentials": "^7.0.2",
"@storybook/addon-links": "^7.0.2",
"@storybook/react": "^7.0.2",
"@storybook/react-vite": "^7.0.2",
"@tailwindcss/aspect-ratio": "^0.4.2",
"@tailwindcss/forms": "^0.5.3",
"@types/react": "^18.0.34",
Expand All @@ -78,6 +78,7 @@
"postcss": "^8.4.21",
"postcss-import": "^15.1.0",
"prettier": "^2.8.7",
"storybook": "^7.0.2",
"tailwindcss": "3.3.1",
"ts-node": "^10.9.1",
"typescript": "^4.9.5",
Expand All @@ -100,7 +101,8 @@
"trim@<0.0.3": ">=0.0.3",
"trim-newlines@<3.0.1": ">=3.0.1",
"glob-parent@<5.1.2": ">=5.1.2",
"d3-color@<3.1.0": ">=3.1.0"
"d3-color@<3.1.0": ">=3.1.0",
"@joshwooding/vite-plugin-react-docgen-typescript": "0.2.1"
}
}
}
Loading