Skip to content

Commit

Permalink
[#1] Init: 프로젝트 초기 세팅 (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
HoberMin authored Apr 19, 2024
1 parent 91be6cc commit 643b36e
Show file tree
Hide file tree
Showing 55 changed files with 12,520 additions and 7 deletions.
72 changes: 72 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
{
"root": true,
"env": { "browser": true, "es2021": true, "node": true },
"extends": [
"next/core-web-vitals",
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended"
],
"ignorePatterns": ["dist", "vite.config.ts", "*.cjs", "*.mjs", "*.js"],
"parser": "@typescript-eslint/parser",
"plugins": [
"react-refresh",
"react",
"prettier",
"@typescript-eslint",
"unused-imports"
],
"settings": {
"react": {
"version": "detect"
}
},
"overrides": [
{
"files": ["*.ts", "*.tsx"], // Your TypeScript files extension
"parserOptions": {
"project": ["./tsconfig.json"] // Specify it only for TypeScript files
}
}
],
"rules": {
"unused-imports/no-unused-imports": "error",
"@typescript-eslint/naming-convention": [
"error",
{
"selector": "interface",
"format": ["PascalCase"]
},
{
"selector": "typeAlias",
"format": ["PascalCase"]
},
{
"selector": "variable",
"format": ["PascalCase", "camelCase", "UPPER_CASE"]
},
{
"selector": "variable",
"types": ["function"],
"format": ["PascalCase", "camelCase"]
},
{
"selector": "variable",
"types": ["boolean"],
"format": ["PascalCase"],
"prefix": ["is", "has"]
}
],
"padding-line-between-statements": [
"error",
{ "blankLine": "always", "prev": "const", "next": "return" }
],
"react/function-component-definition": [
"error",
{
"namedComponents": "arrow-function",
"unnamedComponents": "arrow-function"
}
]
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
name: "[Feat] 작업내용"
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

name: "이슈 템플릿"
about: Issue Template
title: "[Feat] 작업내용"
labels: ""
assignees: ""
---

## 🤷‍♂️ 내용 요약
Expand Down
27 changes: 27 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
## 💬 Issue Number

> closes #1
## 🤷‍♂️ Description

> 작업 내용에 대한 설명
## 📷 Screenshots

> 작업 결과물
## 👻 Good Function

> 팀원에게 공유하고 싶은 함수나 코드 일부
## 📋 Check List

> PR 전 체크해주세요.
- [ ] Merge 하는 브랜치가 올바른가?
- [ ] 코딩컨벤션을 준수하는가?
- [ ] PR과 관련없는 변경사항이 없는가?

## 📒 Remarks

> 팀원이 코드리뷰 시 주의할 점 또는 말하고 싶은 점 특이사항
21 changes: 21 additions & 0 deletions .github/workflows/next-build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: 'Build Next'

on: push

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
# setup-node의 pnpm 지원을 위한 Action
- uses: pnpm/action-setup@v2
with:
version: 8.15.1
- uses: actions/setup-node@v4
with:
node-version: 18
cache: 'pnpm'
- run: pnpm install
- run: pnpm build
27 changes: 27 additions & 0 deletions .github/workflows/storybook.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: 'Publish Storybook to Chromatic'

on: push

jobs:
publish-storybook-to-chromatic:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
# setup-node의 pnpm 지원을 위한 Action
- uses: pnpm/action-setup@v2
with:
version: 8.15.1
- uses: actions/setup-node@v4
with:
node-version: 18
cache: 'pnpm'
- run: pnpm install
- uses: chromaui/action@v1
with:
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
token: ${{ secrets.GITHUB_TOKEN }}
exitZeroOnChanges: true
env:
STORYBOOK_API_BASE_URL: ${{ vars.STORYBOOK_API_BASE_URL }}
40 changes: 40 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js
.yarn/install-state.gz

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

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

# local env files
.env*.local

# vercel
.vercel

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

.env
*storybook.log
storybook-static
1 change: 1 addition & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pnpm commitlint --edit ${1}
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pnpm lint-staged
8 changes: 8 additions & 0 deletions .lintstagedrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
const path = require('path');

const buildEslintCommand = filenames =>
`next lint --fix --file ${filenames.map(f => path.relative(process.cwd(), f)).join(' --file ')}`;

module.exports = {
'*.{js,jsx,ts,tsx}': [buildEslintCommand],
};
25 changes: 25 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"singleQuote": true,
"semi": true,
"useTabs": false,
"tabWidth": 2,
"trailingComma": "all",
"printWidth": 80,
"arrowParens": "avoid",
"endOfLine": "auto",
"jsxSingleQuote": true,
"importOrderSeparation": true,
"importOrderSortSpecifiers": true,
"embeddedLanguageFormatting": "auto",
"importOrder": [
"^(react/(.*)$)|^(react$)",
"<THIRD_PARTY_MODULES>",
"^(@/(.*)$)",
"^[./]"
],
"tailwindFunctions": ["clsx", "cn", "twmerge", "cva"],
"plugins": [
"@trivago/prettier-plugin-sort-imports",
"prettier-plugin-tailwindcss"
]
}
21 changes: 21 additions & 0 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import type { StorybookConfig } from '@storybook/nextjs';

const config: StorybookConfig = {
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
addons: [
'@storybook/addon-onboarding',
'@storybook/addon-links',
'@storybook/addon-essentials',
'@chromatic-com/storybook',
'@storybook/addon-interactions',
],
framework: {
name: '@storybook/nextjs',
options: {},
},
docs: {
autodocs: 'tag',
},
staticDirs: ['../public'],
};
export default config;
14 changes: 14 additions & 0 deletions .storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import type { Preview } from '@storybook/react';

const preview: Preview = {
parameters: {
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/i,
},
},
},
};

export default preview;
7 changes: 7 additions & 0 deletions .vscode/setting.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"css.lint.unknownAtRules": "ignore",
"tailwindCSS.experimental.classRegex": [
["cva\\(([^)]*)\\)", "[\"'`]([^\"'`]*).*?[\"'`]"],
["cx\\(([^)]*)\\)", "(?:'|\"|`)([^']*)(?:'|\"|`)"]
]
}
37 changes: 36 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,36 @@
# Nodak-FE
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).

## Getting Started

First, run the development server:

```bash
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
```

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.

You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.

This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.

## Learn More

To learn more about Next.js, take a look at the following resources:

- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.

You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!

## Deploy on Vercel

The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.

Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
17 changes: 17 additions & 0 deletions commitlint.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
module.exports = {
extends: ['@commitlint/config-conventional'],

rules: {
'header-max-length': [0],
'subject-case': [0],
'subject-full-stop': [0],
'subject-empty': [2, 'never'],
'type-case': [2, 'never'],
'type-empty': [2, 'never'],
'type-enum': [
2,
'always',
['feat', 'fix', 'docs', 'refactor', 'chore', 'style'],
],
},
};
4 changes: 4 additions & 0 deletions next.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/** @type {import('next').NextConfig} */
const nextConfig = {};

export default nextConfig;
27 changes: 27 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 643b36e

Please sign in to comment.