Skip to content

Commit

Permalink
Merge pull request #2 from dnd-side-project/chore/#1
Browse files Browse the repository at this point in the history
chore: 프로젝트 초기세팅
  • Loading branch information
yoonncho authored Feb 9, 2023
2 parents 5c7872e + 9befffd commit 915e5b5
Show file tree
Hide file tree
Showing 33 changed files with 12,485 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"extends": ["next/core-web-vitals", "plugin:@typescript-eslint/recommended"],
"plugins": ["import", "@typescript-eslint", "prettier"],
"rules": {
"no-console": ["warn", { "allow": ["warn", "error"] }],
"@typescript-eslint/no-unused-vars": [
"warn",
{
"argsIgnorePattern": "^_",
"ignoreRestSiblings": true
}
],
"@next/next/no-img-element": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-empty-function": "off"
}
}
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@eun-seong @yoonncho
3 changes: 3 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## 🔖 작업 내용 (Summary)

## 기타 사항 (Etc)
30 changes: 30 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Build Test

on:
push:
branches: [main, dev]
pull_request:
branches: [main, dev]

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@v3

- name: Cache node modules
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.OS }}-build-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install Dependencies
run: yarn install

- name: Build Test
run: yarn build
39 changes: 39 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*

# local env files
.env*.local

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts

# eslint cache
.eslintcache
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

yarn commitlint --edit $1
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

yarn lint-staged
8 changes: 8 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"printWidth": 80,
"tabWidth": 2,
"useTabs": false,
"singleQuote": true,
"trailingComma": "all",
"semi": false
}
29 changes: 29 additions & 0 deletions .storybook/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
const path = require('path')

module.exports = {
stories: ['../src/**/*.stories.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'],
addons: [
'@storybook/addon-links',
'@storybook/addon-essentials',
'@storybook/addon-interactions',
{
name: '@storybook/addon-postcss',
options: {
postcssLoaderOptions: {
implementation: require('postcss'),
},
},
},
],
framework: '@storybook/react',
webpackFinal: async (config) => {
config.resolve.alias = {
...config.resolve.alias,
'@': path.resolve(__dirname, '../src'),
}
return config
},
core: {
builder: '@storybook/builder-webpack5',
},
}
11 changes: 11 additions & 0 deletions .storybook/preview.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import '../src/styles/globals.css'

export const parameters = {
actions: { argTypesRegex: '^on[A-Z].*' },
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/,
},
},
}
3 changes: 3 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"recommendations": ["dbaeumer.vscode-eslint", "esbenp.prettier-vscode"]
}
7 changes: 7 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
}
}
10 changes: 10 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module.exports = {
extends: ['@commitlint/config-conventional'],
rules: {
'type-enum': [
2,
'always',
['feat', 'fix', 'docs', 'style', 'refactor', 'test', 'chore'],
],
},
}
6 changes: 6 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
}

module.exports = nextConfig
59 changes: 59 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"name": "dnd-8th-7-frontend",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint",
"postinstall": "husky install",
"storybook": "start-storybook -p 6006",
"build-storybook": "build-storybook"
},
"dependencies": {
"@next/font": "13.1.6",
"axios": "^1.3.2",
"next": "13.1.6",
"react": "18.2.0",
"react-dom": "18.2.0",
"zustand": "^4.3.2"
},
"devDependencies": {
"@babel/core": "^7.20.12",
"@commitlint/cli": "^17.4.2",
"@commitlint/config-conventional": "^17.4.2",
"@storybook/addon-actions": "^6.5.16",
"@storybook/addon-essentials": "^6.5.16",
"@storybook/addon-interactions": "^6.5.16",
"@storybook/addon-links": "^6.5.16",
"@storybook/addon-postcss": "^2.0.0",
"@storybook/builder-webpack5": "^6.5.16",
"@storybook/manager-webpack5": "^6.5.16",
"@storybook/react": "^6.5.16",
"@storybook/testing-library": "^0.0.13",
"@types/node": "^18.11.19",
"@types/react": "^18.0.27",
"@types/react-dom": "^18.0.10",
"@typescript-eslint/eslint-plugin": "^5.50.0",
"autoprefixer": "^10.4.13",
"babel-loader": "^8.3.0",
"eslint": "^8.33.0",
"eslint-config-next": "^13.1.6",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-storybook": "^0.6.10",
"husky": "^8.0.3",
"lint-staged": "^13.1.0",
"postcss": "^8.4.21",
"prettier": "^2.8.3",
"tailwindcss": "^3.2.4",
"typescript": "^4.9.5"
},
"lint-staged": {
"**/*.(js|jsx|ts|tsx)": [
"eslint --fix",
"yarn run prettier --write",
"bash -c tsc --noEmit"
]
}
}
6 changes: 6 additions & 0 deletions postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
}
Empty file added public/assets/.gitkeep
Empty file.
Empty file added src/api/.gitkeep
Empty file.
11 changes: 11 additions & 0 deletions src/components/Button/index.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { ComponentMeta, ComponentStory } from '@storybook/react'
import Button from '@/components/Button'

export default {
title: 'components/Button',
components: Button,
} as ComponentMeta<typeof Button>

const Template: ComponentStory<typeof Button> = () => <Button />

export const Basic = Template.bind({})
5 changes: 5 additions & 0 deletions src/components/Button/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const Button = () => {
return <button className="bg-red">버튼</button>
}

export default Button
Empty file added src/constants/.gitkeep
Empty file.
12 changes: 12 additions & 0 deletions src/containers/Main/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import Button from '@/components/Button'

const Main = () => {
return (
<>
<p>메인</p>
<Button />
</>
)
}

export default Main
Empty file added src/hooks/.gitkeep
Empty file.
6 changes: 6 additions & 0 deletions src/pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import '@/styles/globals.css'
import type { AppProps } from 'next/app'

export default function App({ Component, pageProps }: AppProps) {
return <Component {...pageProps} />
}
13 changes: 13 additions & 0 deletions src/pages/_document.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { Html, Head, Main, NextScript } from 'next/document'

export default function Document() {
return (
<Html lang="en">
<Head />
<body>
<Main />
<NextScript />
</body>
</Html>
)
}
5 changes: 5 additions & 0 deletions src/pages/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import Main from '@/containers/Main'

export default function Home() {
return <Main />
}
Empty file added src/store/.gitkeep
Empty file.
30 changes: 30 additions & 0 deletions src/styles/globals.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/variable/pretendardvariable.css');
@tailwind base;
@tailwind components;
@tailwind utilities;

* {
box-sizing: border-box;
}

html,
body {
margin: 0;
padding: 0;
font-family: 'Pretendard Variable', Pretendard, -apple-system,
BlinkMacSystemFont, system-ui, Roboto, 'Helvetica Neue', 'Segoe UI',
'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic', 'Apple Color Emoji',
'Segoe UI Emoji', 'Segoe UI Symbol', sans-serif;
color: #000000;
letter-spacing: -0.004em;
}

a {
color: inherit;
text-decoration: none;
}

ol,
ul {
list-style: none;
}
Empty file added src/types/.gitkeep
Empty file.
Empty file added src/utils/.gitkeep
Empty file.
24 changes: 24 additions & 0 deletions tailwind.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: ['./src/**/*.{js,ts,jsx,tsx}'],
theme: {
colors: {
black: '#333333',
red: '#FF7154',
orange: '#FFB673',
skyblue: '#7CCAE2',
blue: '#5B9DFF',
purple: '#7E85FF',
},
extend: {
fontSize: {
sm: ['12px', '130%'],
base: ['14px', '130%'],
lg: ['16px', '140%'],
xl: ['18px', '140%'],
'2xl': ['20px', '140%'],
},
},
},
plugins: [],
}
24 changes: 24 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"compilerOptions": {
"target": "es5",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"incremental": true,
"baseUrl": ".",
"paths": {
"@/*": ["./src/*"]
}
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
"exclude": ["node_modules"]
}
Loading

0 comments on commit 915e5b5

Please sign in to comment.