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

#685 Introduce Storybook and Vite #687

Merged
merged 30 commits into from
Nov 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
ae7d1f0
Add: storybook functionality
predict-woo Oct 26, 2023
8f39386
Remove: unneeded examples
predict-woo Oct 26, 2023
b7f8690
Remove: uneeded comments
predict-woo Oct 26, 2023
8192ce6
Merge branch 'dev' into #685-add-storybook-to-taxi-front
predict-woo Oct 26, 2023
1d123b3
Remove: auto generated config file
predict-woo Oct 26, 2023
76b861a
Add: restore deleted file
predict-woo Oct 26, 2023
3a121f6
Add : Storybook component of Room
jinhyeonkwon Oct 26, 2023
7812f8f
Fix: remove craco and install vite
predict-woo Oct 26, 2023
80a59d6
Fix: make vite render taxi-front normally
predict-woo Oct 27, 2023
20b9ef4
Fix: change build directory
predict-woo Oct 27, 2023
493d111
Fix: conflicting options
predict-woo Oct 27, 2023
e38bf87
Fix: broken locale in momentjs
predict-woo Oct 27, 2023
c5f1960
Remove: unecessary deps
predict-woo Oct 27, 2023
90bd2a4
Add: examples
predict-woo Oct 27, 2023
bc4dc9a
Remove: default stories
predict-woo Oct 31, 2023
890acfd
Fix: rename config file
predict-woo Oct 31, 2023
c147fbb
Fix: problems with emotion
predict-woo Oct 31, 2023
0729cbf
Merge pull request #689 from sparcs-kaist/#688-move-to-react-swc
14KGun Nov 2, 2023
b512c83
Add: default port
predict-woo Nov 2, 2023
1427cb1
Merge remote-tracking branch 'origin/#685-add-storybook-to-taxi-front…
predict-woo Nov 2, 2023
e279bc6
Fix: prettier settings
predict-woo Nov 2, 2023
3c0bd76
Fix: env problems
predict-woo Nov 2, 2023
80c6b3d
Revert: reverted changes to index.html
predict-woo Nov 2, 2023
152f7c7
Revert: reverted changes to index.html
predict-woo Nov 2, 2023
977f0f2
Fix: add prettier style
predict-woo Nov 2, 2023
2e1acaf
Update .prettierrc.json
predict-woo Nov 7, 2023
7d2cced
Remove: uneeded config file
predict-woo Nov 7, 2023
f4c6d19
Fix: prettier update:
predict-woo Nov 8, 2023
cc0513f
Fix: styling
predict-woo Nov 8, 2023
dda77c4
Fix: remove non-working story
predict-woo Nov 9, 2023
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
10 changes: 8 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"plugin:cypress/recommended",
"eslint:recommended",
"plugin:react/recommended",
"prettier"
"prettier",
"plugin:storybook/recommended"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
Expand All @@ -24,7 +25,12 @@
"rules": {
"no-unused-vars": 1,
"react/react-in-jsx-scope": "off",
"react/no-unknown-property": ["error", { "ignore": ["css"] }]
"react/no-unknown-property": [
"error",
{
"ignore": ["css"]
}
]
},
"overrides": [
{
Expand Down
12 changes: 6 additions & 6 deletions .prettierrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
"plugins": ["@trivago/prettier-plugin-sort-imports"],
"importOrder": [
"<THIRD_PARTY_MODULES>",
"^types/",
"^hooks/",
"^components/|^pages/",
"^@/types/",
"^@/hooks/",
"^@/components/|^@/pages/",
"^[./]",
"^atoms/|^recoil$",
"^tools/",
"^static/|^@mui|^@material-ui"
"^@/atoms/|^recoil$",
"^@/tools/",
"^@/static/|^@mui|^@material-ui"
],
"importOrderSeparation": true,
"importOrderSortSpecifiers": true,
Expand Down
19 changes: 19 additions & 0 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import type { StorybookConfig } from "@storybook/react-vite";

const config: StorybookConfig = {
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"],
addons: [
"@storybook/addon-links",
"@storybook/addon-essentials",
"@storybook/addon-onboarding",
"@storybook/addon-interactions",
],
framework: {
name: "@storybook/react-vite",
options: {},
},
docs: {
autodocs: "tag",
},
};
export default config;
30 changes: 30 additions & 0 deletions .storybook/preview.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import type { Preview } from "@storybook/react";
import React from "react";
import { BrowserRouter as Router } from "react-router-dom";

import "../src/index.css";

import { RecoilRoot } from "recoil";

const preview: Preview = {
parameters: {
actions: { argTypesRegex: "^on[A-Z].*" },
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/i,
},
},
},
decorators: [
(Story) => (
<RecoilRoot>
<Router>
<Story />
</Router>
</RecoilRoot>
),
],
};

export default preview;
11 changes: 0 additions & 11 deletions craco.config.js

This file was deleted.

3 changes: 0 additions & 3 deletions cypress.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import { defineConfig } from "cypress";
import dotenv from "dotenv";

dotenv.config();

export default defineConfig({
env: {
Expand Down
3 changes: 2 additions & 1 deletion public/index.html → index.html
14KGun marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@
async
src="https://t1.kakaocdn.net/kakao_js_sdk/2.1.0/kakao.min.js"
></script>
<script src="/env.js"></script>
<script>
document.documentElement.addEventListener(
"touchstart",
Expand All @@ -85,6 +84,8 @@
false
);
</script>
<script src="/env.js"></script>
<script type="module" src="/src/index.tsx"></script>
</head>
<body>
<div id="root"></div>
Expand Down
31 changes: 19 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,15 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"@babel/preset-react": "7.12.5",
"@craco/craco": "^6.4.3",
"@emotion/babel-plugin": "^11.10.6",
"@emotion/css": "^11.10.6",
"@emotion/react": "^11.10.6",
"@emotion/styled": "^11.10.6",
"@material-ui/icons": "^4.11.2",
"@mui/icons-material": "^5.14.1",
"@mui/material": "^5.4.1",
"@svgr/webpack": "5.5.0",
"antd": "^5.4.6",
"axios": "^0.21.1",
"browser-image-compression": "^2.0.0",
"cross-env": "^7.0.3",
"dayjs": "^1.11.7",
"dotenv": "^16.0.0",
"firebase": "^9.15.0",
"heic2any": "^0.0.4",
"i18next": "^22.0.2",
Expand All @@ -39,10 +32,12 @@
"use-state-with-callback": "^3.0.2"
},
"scripts": {
"start": "vite",
"build": "tsc && vite build",
"preinstall": "npx only-allow pnpm",
"start": "craco start",
"build": "cross-env GENERATE_SOURCEMAP=false craco build",
"test": "cypress open"
"test": "cypress open",
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build"
},
"eslintConfig": {
"extends": [
Expand All @@ -63,8 +58,15 @@
]
},
"devDependencies": {
"@storybook/addon-essentials": "^7.5.2",
"@storybook/addon-interactions": "^7.5.2",
"@storybook/addon-links": "^7.5.2",
"@storybook/addon-onboarding": "^1.0.8",
"@storybook/blocks": "^7.5.2",
"@storybook/react": "^7.5.2",
"@storybook/react-vite": "^7.5.2",
"@storybook/testing-library": "^0.2.2",
"@trivago/prettier-plugin-sort-imports": "^4.1.1",
"@types/craco__craco": "^6.4.0",
"@types/eslint": "^8.44.0",
"@types/eslint-config-prettier": "^6.11.0",
"@types/prop-types": "^15.7.5",
Expand All @@ -74,6 +76,7 @@
"@types/react-router-dom": "^5.3.3",
"@typescript-eslint/eslint-plugin": "^5.37.0",
"@typescript-eslint/parser": "^5.37.0",
"@vitejs/plugin-react-swc": "^3.4.1",
"cypress": "^10.3.1",
"cypress-react-selector": "^3.0.0",
"eslint": "^7.32.0",
Expand All @@ -84,7 +87,11 @@
"eslint-plugin-jsx-a11y": "^6.4.1",
"eslint-plugin-react": "^7.26.1",
"eslint-plugin-react-hooks": "^4.2.0",
"typescript": "^5.1.6"
"eslint-plugin-storybook": "^0.6.15",
"storybook": "^7.5.2",
"typescript": "^5.1.6",
"vite": "^4.5.0",
"vite-plugin-svgr": "^3.2.0"
},
"resolutions": {
"@types/react": "^17.0.2",
Expand Down
Loading
Loading