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

[ Feature/quiz 19 ] #27

Merged
merged 29 commits into from
Jun 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
cf62b24
feat : common 폴더에 λŒ€ν•œ path 경둜 μΆ”κ°€
Happhee Jun 5, 2024
895a110
docs : ν•„μš”μ—†λŠ” 파일 μ‚­μ œ
Happhee Jun 5, 2024
7301e42
init : jest μ‚­μ œ 이후 vitest ν™˜κ²½ ꡬ좕
Happhee Jun 6, 2024
95c1576
feat : vitest config , setup 파일 μž‘μ„±
Happhee Jun 6, 2024
71644d5
fix : vitest둜 μ½”λ“œ λ³€κ²½
Happhee Jun 6, 2024
80a72bd
fix : vitest둜 λ³€κ²½
Happhee Jun 6, 2024
b7e9886
docs : ν•„μš”μ—†λŠ” 파일 μ‚­μ œ
Happhee Jun 7, 2024
2e2c4c8
fix : vitest μ‚¬μš©μ‹œ component 경둜 찾을 수 μžˆλ„λ‘ 버그 μˆ˜μ •
Happhee Jun 7, 2024
fdd9d88
feat : vi λͺ¨ν‚Ήν•˜λŠ” λͺ¨λ“ˆ ν…ŒμŠ€νŠΈ μ•žλ’€λ‘œ clear, reset ν•˜λ„λ‘ μ„€μ •
Happhee Jun 7, 2024
2be1408
fix : ν•„μš”μ—†λŠ” story book 경둜 좔적 μ‚­μ œ
Happhee Jun 7, 2024
f642733
feat : ν€΄μ¦ˆ ν’€λ•Œ λ²„νŠΌμ˜ 타이틀λͺ…, class속성 μ œμ–΄ν•˜κ³ μž context νƒ€μž…λ° κ΅¬ν˜„
Happhee Jun 7, 2024
1c7c960
feat : ν€΄μ¦ˆ νŽ˜μ΄μ§€ λ‚΄μ˜ ν•˜λ‹¨ context λ²„νŠΌ κ΅¬ν˜„
Happhee Jun 7, 2024
63e0bd4
test : μ •λ‹΅ 선택에 λ”°λ₯Έ ν€΄μ¦ˆ ν•˜λ‹¨ λ²„νŠΌ ν…ŒμŠ€νŠΈ κ΅¬ν˜„
Happhee Jun 7, 2024
c1c805f
feat : 아티클 및 ν€΄μ¦ˆ νŽ˜μ΄μ§€ λ’€λ‘œκ°€κΈ° topbar 곡톡 μ»΄ν¬λ„ŒνŠΈ κ΅¬ν˜„
Happhee Jun 7, 2024
fce4b5a
test : topBar - κΈ°λ³Έ render story κ΅¬ν˜„
Happhee Jun 7, 2024
641da4b
feat : storybookμ—μ„œ svgμ‚¬μš©ν• μˆ˜ μžˆλ„λ‘ κ΅¬ν˜„
Happhee Jun 7, 2024
d366746
feat : ν€΄μ¦ˆ νŽ˜μ΄μ§€ λ ˆμ΄μ•„μ›ƒ κ΅¬ν˜„
Happhee Jun 7, 2024
89922e4
feat : ν€΄μ¦ˆ νŽ˜μ΄μ§€ λ ˆμ΄μ•„μ›ƒ λ‚΄λΆ€ νŽ˜μ΄μ§€ κ΅¬ν˜„
Happhee Jun 7, 2024
b86aba1
feat : storybookμ—μ„œ next/router import 와 react query μ‚¬μš©κ°€λŠ₯ν•˜λ„λ‘ κ΅¬ν˜„
Happhee Jun 7, 2024
4e0c45c
test : ν€΄μ¦ˆ 제좜 λ²„νŠΌ story κ΅¬ν˜„
Happhee Jun 7, 2024
6f307ed
fix : navigation으둜 λ³€κ²½
Happhee Jun 7, 2024
a7984c4
docs : ν€΄μ¦ˆ contextinfo둜 파일λͺ… λ³€κ²½
Happhee Jun 7, 2024
b52175a
feat : μ •λ‹΅ λ²„νŠΌ κ΄€λ ¨ νƒ€μž… κ΅¬ν˜„
Happhee Jun 7, 2024
40d3cea
feat : μ •λ‹΅ λ²„νŠΌ κ΄€λ ¨ μƒμˆ˜ κ΅¬ν˜„
Happhee Jun 7, 2024
d5669ac
refactor : μ •λ‹΅λ²„νŠΌ κ΄€λ ¨ μƒμˆ˜ μ‚¬μš©ν•΄μ„œ ν…ŒμŠ€νŠΈ μ½”λ“œ 및 component에 μ μš©ν•˜λ„λ‘ λ¦¬νŒ©ν† λ§
Happhee Jun 7, 2024
0ff60d8
feat : vitest config , setup 파일 μž‘μ„±
Happhee Jun 6, 2024
40852f8
fix : vitest둜 μ½”λ“œ λ³€κ²½
Happhee Jun 6, 2024
6da4f1d
fix : vitest둜 μ½”λ“œ λ³€κ²½
Happhee Jun 6, 2024
d2c19ce
fix : vitest둜 μ½”λ“œ λ³€κ²½
Happhee Jun 6, 2024
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
2 changes: 1 addition & 1 deletion .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@ jobs:
run: pnpm install
- name: Build storybook
run: pnpm run build-storybook
- name: Run Jest Test
- name: Run vitest
run: pnpm test
33 changes: 28 additions & 5 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
import type { StorybookConfig } from "@storybook/nextjs";

const config: StorybookConfig = {
stories: [
"../src/stories/**/*.mdx",
"../src/stories/**/*.stories.@(js|jsx|mjs|ts|tsx)",
"../src/**/**/**/*.stories.@(js|jsx|mjs|ts|tsx)"
],
stories: ["../src/**/**/**/*.stories.@(js|jsx|mjs|ts|tsx)"],
addons: [
"@storybook/addon-onboarding",
"@storybook/addon-links",
Expand All @@ -18,5 +14,32 @@ const config: StorybookConfig = {
options: {},
},
staticDirs: ["../public"],
webpackFinal: async (config) => {
if (!config.resolve || !config.module || !config.module.rules) {
throw new Error("Webpack Error");
}

const imageRule = config.module?.rules?.find((rule) => {
const test = (rule as { test: RegExp }).test;

if (!test) {
return false;
}

return test.test(".svg");
}) as { [key: string]: any };

imageRule.exclude = /\.svg$/;

config.module?.rules?.push({
test: /\.svg$/,
use: ["@svgr/webpack"],
});

return config;
},
docs: {
autodocs: false,
},
};
export default config;
3 changes: 2 additions & 1 deletion .storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Preview } from "@storybook/react";
import "../src/app/globals.css";

import withAppRouterContext from "./withAppRouterContext";
const preview: Preview = {
parameters: {
controls: {
Expand All @@ -10,6 +10,7 @@ const preview: Preview = {
},
},
},
decorators: [withAppRouterContext],
};

export default preview;
27 changes: 27 additions & 0 deletions .storybook/withAppRouterContext.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import {
AppRouterContext,
type AppRouterInstance,
} from "next/dist/shared/lib/app-router-context.shared-runtime";
import React from "react";
import { FC } from "react";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";

const queryClient = new QueryClient({
defaultOptions: {
queries: {
gcTime: 300000,
refetchOnWindowFocus: false,
staleTime: 300000,
retry: 1,
},
},
});
const withAppRouterContext = (Story: FC) => (
<QueryClientProvider client={queryClient}>
<AppRouterContext.Provider value={{} as AppRouterInstance}>
<Story />
</AppRouterContext.Provider>
</QueryClientProvider>
);

export default withAppRouterContext;
8 changes: 8 additions & 0 deletions custom.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { SVGSVGElement } from "react";

declare global {
module "*.svg" {
const ReactComponent: React.FC<React.SVGProps<SVGSVGElement>>;
export default ReactComponent;
}
}
12 changes: 7 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
"build": "next build & next export",
"start": "next start",
"lint": "next lint",
"test": "jest",
"test:watch": "jest --watch",
"test": "vitest",
"create": "node ./create-component.js",
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build"
},
"dependencies": {
"@radix-ui/react-slot": "^1.0.2",
"@tanstack/react-query": "^5.40.0",
"@testing-library/user-event": "^14.5.2",
"axios": "^1.7.2",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.1",
Expand All @@ -41,26 +41,28 @@
"@svgr/webpack": "^8.1.0",
"@testing-library/jest-dom": "^6.4.5",
"@testing-library/react": "^15.0.7",
"@types/jest": "^29.5.12",
"@types/node": "^20",
"@types/react": "^18",
"@types/react-dom": "^18",
"@typescript-eslint/eslint-plugin": "^7.11.0",
"@typescript-eslint/parser": "^7.11.0",
"@vitejs/plugin-react": "^4.3.0",
"eslint": "^8",
"eslint-config-next": "14.2.3",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-simple-import-sort": "^12.1.0",
"eslint-plugin-unused-imports": "^3.1.0",
"eslint-plugin-storybook": "^0.8.0",
"eslint-plugin-unused-imports": "^3.1.0",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"jsdom": "^24.1.0",
"postcss": "^8",
"prettier": "^3.3.0",
"storybook": "^8.1.5",
"tailwindcss": "^3.4.1",
"ts-node": "^10.9.2",
"typescript": "^5"
"typescript": "^5",
"vitest": "^1.6.0"
}
}
Loading
Loading