Skip to content

Commit 873ffdc

Browse files
Merge pull request #249 from LeeTaegyung/Next-이태경-sprint10
[이태경] Sprint10
2 parents 81df29e + 53ba117 commit 873ffdc

44 files changed

Lines changed: 6362 additions & 531 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,6 @@ yarn-error.log*
3939
# typescript
4040
*.tsbuildinfo
4141
next-env.d.ts
42+
43+
*storybook.log
44+
storybook-static

.storybook/main.ts

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import type { StorybookConfig } from "@storybook/nextjs";
2+
3+
const config: StorybookConfig = {
4+
stories: ["../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"],
5+
addons: [],
6+
framework: {
7+
name: "@storybook/nextjs",
8+
options: {},
9+
},
10+
staticDirs: [
11+
"../public",
12+
{
13+
from: "../public/fonts",
14+
to: "public/fonts",
15+
},
16+
],
17+
webpackFinal: async (config) => {
18+
config.module = config.module || {};
19+
config.module.rules = config.module.rules || [];
20+
21+
const imageRule = config.module.rules.find((rule) =>
22+
rule?.["test"]?.test(".svg")
23+
);
24+
if (imageRule) {
25+
imageRule["exclude"] = /\.svg$/;
26+
}
27+
28+
config.module.rules.push({
29+
test: /\.svg$/,
30+
use: ["@svgr/webpack"],
31+
});
32+
33+
return config;
34+
},
35+
};
36+
export default config;

.storybook/preview.tsx

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import React from "react";
2+
import type { Preview } from "@storybook/nextjs";
3+
import "../src/app/globals.css";
4+
import { nanumsquare } from "../src/app/layout";
5+
6+
const preview: Preview = {
7+
parameters: {
8+
controls: {
9+
matchers: {
10+
color: /(background|color)$/i,
11+
date: /Date$/i,
12+
},
13+
},
14+
},
15+
decorators: [
16+
(Story) => (
17+
<div className={nanumsquare.className}>
18+
<Story />
19+
</div>
20+
),
21+
],
22+
};
23+
24+
export default preview;

eslint.config.mjs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// For more info, see https://github.com/storybookjs/eslint-plugin-storybook#configuration-flat-config-format
2+
import storybook from "eslint-plugin-storybook";
3+
14
import { dirname } from "path";
25
import { fileURLToPath } from "url";
36
import { FlatCompat } from "@eslint/eslintrc";
@@ -11,11 +14,8 @@ const compat = new FlatCompat({
1114

1215
const eslintConfig = [
1316
...compat.extends("next/core-web-vitals", "next/typescript"),
14-
1517
{
16-
plugins: {
17-
import: pluginImport,
18-
},
18+
plugins: ["import"],
1919
rules: {
2020
// 쓰이지 않는 변수 검사
2121
"no-unused-vars": "off",
@@ -61,6 +61,7 @@ const eslintConfig = [
6161
],
6262
},
6363
},
64+
...storybook.configs["flat/recommended"],
6465
];
6566

6667
export default eslintConfig;

next.config.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,15 @@ const nextConfig: NextConfig = {
1010

1111
return config;
1212
},
13+
images: {
14+
remotePatterns: [
15+
{
16+
protocol: "https",
17+
hostname: "sprint-fe-project.s3.ap-northeast-2.amazonaws.com",
18+
pathname: "/**", // 경로 패턴, 모든 이미지 허용
19+
},
20+
],
21+
},
1322
};
1423

1524
export default nextConfig;

0 commit comments

Comments
 (0)