Skip to content

Commit

Permalink
feat: storybook removed from ui package
Browse files Browse the repository at this point in the history
  • Loading branch information
henrynoowah committed Jan 5, 2025
1 parent c19e273 commit 1474b4f
Show file tree
Hide file tree
Showing 19 changed files with 5,108 additions and 1,213 deletions.
Binary file modified .DS_Store
Binary file not shown.
71 changes: 17 additions & 54 deletions apps/docs/.storybook/main.ts
Original file line number Diff line number Diff line change
@@ -1,60 +1,23 @@
import type { StorybookConfig } from "@storybook/react-webpack5";
import TsconfigPathsPlugin from "tsconfig-paths-webpack-plugin";
import viteTsconfig from "vite-tsconfig-paths";
import { resolve } from "path";
import type { StorybookConfig } from "@storybook/react-vite";

const config: StorybookConfig = {
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"],
addons: [
"@storybook/addon-webpack5-compiler-swc",
"@storybook/addon-onboarding",
"@storybook/addon-links",
"@storybook/addon-essentials",
"@chromatic-com/storybook",
"@storybook/addon-interactions",
"@storybook/addon-themes",
// {
// /**
// * Fix Storybook issue with PostCSS@8
// * @see https://github.com/storybookjs/storybook/issues/12668#issuecomment-773958085
// */
// //postcss를 활용할 수 있도록 이 부분 추가.
// name: "@storybook/addon-postcss",
// options: {
// postcssLoaderOptions: {
// implementation: require("postcss"),
// },
// },
// },
{
name: "@storybook/addon-styling-webpack",
options: {
rules: [
// Replaces existing CSS rules with given rule
{
test: /\.css$/,
use: ["style-loader", "css-loader"],
},
],
},
},
],
framework: {
name: "@storybook/react-webpack5",
options: {},
framework: "@storybook/react-vite",
stories: ["../stories/*.stories.tsx", "../stories/**/*.stories.tsx"],
core: {
builder: "@storybook/builder-vite",
},
swc: (config, options) => ({
jsc: {
transform: {
react: {
runtime: "automatic",
},
},
},
}),
webpackFinal: async (config, { configType }) => {
if (config && config.resolve) {
config.resolve.plugins = [new TsconfigPathsPlugin()];
}
return config;
async viteFinal(config) {
const { mergeConfig } = await import("vite");

return mergeConfig(config, {
plugins: [
viteTsconfig({
projects: [resolve(__dirname, "../../../packages/ui/")],
}),
],
});
},
};
export default config;
15 changes: 15 additions & 0 deletions apps/docs/.storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import type { Preview } from "@storybook/react";
import "@noowah/content-builder/styles.css";

const preview: Preview = {
parameters: {
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/i,
},
},
},
};

export default preview;
28 changes: 17 additions & 11 deletions apps/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,35 @@
"scripts": {
"dev": "storybook dev -p 6006",
"build": "storybook build --docs",
"preview-storybook": "serve storybook-static",
"preview-storybook": "serve storybook-static -p 6006",
"clean": "rm -rf .turbo && rm -rf node_modules",
"lint": "eslint ./stories/*.stories.tsx --max-warnings 0"
},
"dependencies": {
"@acme/ui": "workspace:*",
"@noowah/content-builder": "workspace:*",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"@repo/eslint-config": "workspace:*",
"@repo/config-eslint": "workspace:*",
"@repo/config-typescript": "workspace:*",
"@storybook/addon-actions": "^8.2.6",
"@storybook/addon-essentials": "^8.2.6",
"@storybook/addon-links": "^8.2.6",
"@storybook/react": "^8.2.6",
"@storybook/react-vite": "^8.2.6",
"@vitejs/plugin-react": "^4.2.1",
"@storybook/addon-actions": "^8.4.7",
"@storybook/addon-essentials": "^8.4.7",
"@storybook/addon-links": "^8.4.7",
"@storybook/react": "^8.4.7",
"@storybook/builder-vite": "^8.4.7",
"@storybook/react-vite": "^8.4.7",
"@vitejs/plugin-react": "^4.3.4",
"eslint": "^8.57.0",
"serve": "^14.2.1",
"storybook": "^8.2.6",
"@repo/typescript-config": "workspace:*",
"typescript": "5.5.4",
"vite": "^5.1.4"
"vite": "^5.1.4",
"vite-tsconfig-paths": "^5.1.4",
"@vitejs/plugin-react-swc": "^3.7.2",
"autoprefixer": "^10.4.20",
"postcss": "^8.4.40"
}
}


Loading

0 comments on commit 1474b4f

Please sign in to comment.