From b8da7ecf5e59b7c973f29d366cf674bcf8fab79a Mon Sep 17 00:00:00 2001 From: rkskekzzz Date: Sat, 30 Sep 2023 15:15:14 +0900 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20profile=20page=20storybook=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/web/.storybook/main.ts | 7 ++++++- apps/web/package.json | 3 ++- .../web/src/stories/pages/Profile.stories.tsx | 20 +++++++++++++++++++ package-lock.json | 3 ++- 4 files changed, 30 insertions(+), 3 deletions(-) create mode 100644 apps/web/src/stories/pages/Profile.stories.tsx diff --git a/apps/web/.storybook/main.ts b/apps/web/.storybook/main.ts index ce92a05..a94b5f5 100644 --- a/apps/web/.storybook/main.ts +++ b/apps/web/.storybook/main.ts @@ -1,4 +1,4 @@ -const path = require('path') +const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin') /** @type { import('@storybook/nextjs').StorybookConfig } */ const config = { @@ -18,6 +18,11 @@ const config = { }, }, ], + staticDirs: ['../public'], + webpackFinal: async (config, { configType }) => { + config.resolve.plugins = [new TsconfigPathsPlugin()] + return config + }, framework: { name: '@storybook/nextjs', options: {}, diff --git a/apps/web/package.json b/apps/web/package.json index 7b2e760..7c82a6b 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -57,6 +57,7 @@ "storybook-dark-mode": "^3.0.1", "storybook-tailwind-dark-mode": "^1.0.22", "tailwindcss": "3.3.2", - "tsconfig": "*" + "tsconfig": "*", + "tsconfig-paths-webpack-plugin": "^4.1.0" } } diff --git a/apps/web/src/stories/pages/Profile.stories.tsx b/apps/web/src/stories/pages/Profile.stories.tsx new file mode 100644 index 0000000..93a02a6 --- /dev/null +++ b/apps/web/src/stories/pages/Profile.stories.tsx @@ -0,0 +1,20 @@ +import type { Meta, StoryObj } from '@storybook/react' + +import { default as Profile$1 } from '../../app/profile/[id]/page' + +const meta = { + title: 'Pages/Profile', + component: Profile$1, + parameters: { + nextjs: { + appDirectory: true, + }, + }, +} satisfies Meta + +export default meta +type Story = StoryObj + +export const Profile: Story = { + args: {}, +} diff --git a/package-lock.json b/package-lock.json index 3f50ead..e2bcb3b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -97,7 +97,8 @@ "storybook-dark-mode": "^3.0.1", "storybook-tailwind-dark-mode": "^1.0.22", "tailwindcss": "3.3.2", - "tsconfig": "*" + "tsconfig": "*", + "tsconfig-paths-webpack-plugin": "^4.1.0" } }, "node_modules/@80000coding/ui": {