From df6faf38e12dd41a51d6e2e96421dcfeb3cdeb6a Mon Sep 17 00:00:00 2001 From: morrison Date: Thu, 4 Jul 2024 19:56:19 +0900 Subject: [PATCH 1/4] Initial Commit --- .eslintignore | 3 + .eslintrc.js | 49 + .github/PULL_REQUEST_TEMPLATE.md | 22 + .github/workflows/ci.yaml | 44 + .github/workflows/setup-label.yaml | 56 + .gitignore | 104 + .husky/pre-commit | 14 + .husky/pre-push | 10 + .npmrc | 1 + .nvmrc | 1 + .prettierrc.js | 15 + .vscode/settings.json | 68 + README.md | 37 +- next-env.d.ts | 5 + next.config.mjs | 6 + package-lock.json | 6230 ++++++++++++++++++++++++++++ package.json | 54 + postcss.config.js | 6 + public/favicon.ico | Bin 0 -> 25931 bytes public/next.svg | 1 + public/vercel.svg | 1 + src/apis/index.ts | 10 + src/apis/queries.ts | 18 + src/apis/user.ts | 18 + src/pages/_app.tsx | 17 + src/pages/_document.tsx | 13 + src/pages/api/hello.ts | 10 + src/pages/hooks/userQueryHooks.ts | 13 + src/pages/index.tsx | 89 + src/schema/user.ts | 23 + src/styles/Home.module.css | 223 + src/styles/globals.css | 111 + src/types/query.ts | 4 + tailwind.config.js | 11 + tsconfig.json | 21 + user.json | 9 + 36 files changed, 7315 insertions(+), 2 deletions(-) create mode 100644 .eslintignore create mode 100644 .eslintrc.js create mode 100644 .github/PULL_REQUEST_TEMPLATE.md create mode 100644 .github/workflows/ci.yaml create mode 100644 .github/workflows/setup-label.yaml create mode 100644 .gitignore create mode 100644 .husky/pre-commit create mode 100644 .husky/pre-push create mode 100644 .npmrc create mode 100644 .nvmrc create mode 100644 .prettierrc.js create mode 100644 .vscode/settings.json create mode 100644 next-env.d.ts create mode 100644 next.config.mjs create mode 100644 package-lock.json create mode 100644 package.json create mode 100644 postcss.config.js create mode 100644 public/favicon.ico create mode 100644 public/next.svg create mode 100644 public/vercel.svg create mode 100644 src/apis/index.ts create mode 100644 src/apis/queries.ts create mode 100644 src/apis/user.ts create mode 100644 src/pages/_app.tsx create mode 100644 src/pages/_document.tsx create mode 100644 src/pages/api/hello.ts create mode 100644 src/pages/hooks/userQueryHooks.ts create mode 100644 src/pages/index.tsx create mode 100644 src/schema/user.ts create mode 100644 src/styles/Home.module.css create mode 100644 src/styles/globals.css create mode 100644 src/types/query.ts create mode 100644 tailwind.config.js create mode 100644 tsconfig.json create mode 100644 user.json diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 00000000..83e6a98d --- /dev/null +++ b/.eslintignore @@ -0,0 +1,3 @@ +*.js +*.cjs +*.mjs \ No newline at end of file diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 00000000..ee175ce7 --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,49 @@ + + +module.exports = { + parser: '@typescript-eslint/parser', + parserOptions: { + ecmaVersion: 2020, + sourceType: 'module', + ecmaFeatures: { + jsx: true, + }, + project: './tsconfig.json', + }, + extends: [ + 'eslint:recommended', + "plugin:@tanstack/eslint-plugin-query/recommended", + 'plugin:react/recommended', + 'plugin:react-hooks/recommended', + 'plugin:@typescript-eslint/recommended', + 'airbnb', + 'airbnb/hooks', + 'airbnb-typescript', + 'plugin:jsx-a11y/recommended', + 'next/core-web-vitals', + 'prettier', + ], + plugins: [ + 'react', + 'react-hooks', + '@typescript-eslint', + 'jsx-a11y', + 'import', + 'prettier', + ], + rules: { + 'prettier/prettier': 'error', + 'react/react-in-jsx-scope': 'off', // Next.js doesn't require React to be in scope + 'react/prop-types': 'off', + 'no-console':'error', + "react/jsx-props-no-spreading":'off' + }, + settings: { + react: { + version: 'detect', + }, + 'import/resolver': { + typescript: {}, + }, + }, +}; diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 00000000..7836b199 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,22 @@ +## :bookmark: Issue Ticket + +[Ticket](https://trello.com/) + +## :writing_hand: Description + + +## :white_check_mark: Checklist +### PR + +- [ ] Branch Convention 확인 +> `epic/` 에픽, `feat/` 피쳐, `fix/` 버그 수정, `refactor/` 개선 +- [ ] Base Branch 확인 +- [ ] 적절한 Label 지정 +- [ ] Assignee 및 Reviewer 지정 + +### Test +- [ ] 로컬 작동 확인 + +### Additional Notes + +- [ ] (없음) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 00000000..120e9703 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,44 @@ +name: Continuous Integration + +on: + workflow_dispatch: + pull_request: + types: [opened, synchronize] + branches: + - main + - master + - develop + - feat/* + - hotfix/* + - epic/* +jobs: + build: + name: Build + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: '20.14.0' + + - name: Cache dependencies + id: cache + uses: actions/cache@v3 + with: + path: '**/node_modules' + key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node- + + - name: Install Dependencies + if: steps.cache.outputs.cache-hit != 'true' + run: npm ci + + - name: Build test + run: npm run build + + + diff --git a/.github/workflows/setup-label.yaml b/.github/workflows/setup-label.yaml new file mode 100644 index 00000000..8f7a2f2c --- /dev/null +++ b/.github/workflows/setup-label.yaml @@ -0,0 +1,56 @@ +name: Setup Labels + +on: + workflow_dispatch: + +jobs: + setup-labels: + runs-on: ubuntu-latest + steps: + - name: Setup Default Labels + uses: actions/github-script@v5 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + const labels = [ + { name: "Priority: High 🔥", description: '우선순위 높음', color: "F9D0C4" }, + { name: "Priority: Low 🐢", description: '우선순위 낮음', color: "C2E0C6" }, + { name: "Priority: Medium :bookmark:", description: '우선순위 보통', color: "FEF2C0" }, + { name: "Type: Doc :memo:", description: '문서 추가 / 수정', color: "0075ca" }, + { name: "Type: Bug :bug:", description: '버그', color: "d73a4a" }, + { name: "Type: Epic :rocket:", description: '큰 단위의 브랜치', color: "051C35" }, + { name: "Type: Feature :sparkles:", description: '신규 기능', color: "AB5D19" }, + { name: "Type: Improve UX :arrow_up:", description: 'UX 개선', color: "2CE151" }, + { name: "Type: Merge :truck:", description: '머지', color: "4A7A8F" }, + { name: "Type: Refactor :recycle:", description: '리팩토링', color: "027B6B" }, + ]; + + // 존재하는 모든 레이블 나열 + const listResponse = await github.rest.issues.listLabelsForRepo({ + owner: context.repo.owner, + repo: context.repo.repo, + }); + + // 나열된 각 레이블에 대해 삭제 요청 + for (const label of listResponse.data) { + await github.rest.issues.deleteLabel({ + owner: context.repo.owner, + repo: context.repo.repo, + name: label.name, + }); + + console.log(`Label '${label.name}' deleted.`); + } + + // 새로운 레이블 생성 + for (const label of labels) { + const response = await github.rest.issues.createLabel({ + owner: context.repo.owner, + repo: context.repo.repo, + name: label.name, + color: label.color, + description: label.description, + }); + + console.log(`Label ${label.name} processed`, response.status); + } \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..88c9a321 --- /dev/null +++ b/.gitignore @@ -0,0 +1,104 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +lerna-debug.log* +.pnpm-debug.log* + +# Diagnostic reports (https://nodejs.org/api/report.html) +report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage +*.lcov + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# Snowpack dependency directory (https://snowpack.dev/) +web_modules/ + +# TypeScript cache +*.tsbuildinfo + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Optional stylelint cache +.stylelintcache + +# Microbundle cache +.rpt2_cache/ +.rts2_cache_cjs/ +.rts2_cache_es/ +.rts2_cache_umd/ + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variable files +.env +.env.development.local +.env.test.local +.env.production.local +.env.local + + +# Next.js build output +.next +out + + +# Gatsby files +.cache/ +# Comment in the public line in if your project uses Gatsby and not Next.js +# https://nextjs.org/blog/next-9-1#public-directory-support +# public + + + + +# yarn v2 +.yarn/cache +.yarn/unplugged +.yarn/build-state.yml +.yarn/install-state.gz +.pnp.* + +.DS_Store \ No newline at end of file diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100644 index 00000000..445de617 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,14 @@ +npm run lint + +echo ":truck: finished linting." + +current_branch=$(git branch --show-current) + +# restricted_branches="^(main|master|develop|epic/.+)$" +restricted_branches="^(epic/.+)$" + +if [[ $current_branch =~ $restricted_branches ]]; then + echo ":construction: You are on a restricted branch: $current_branch." + echo "Commits to this branch are not allowed via pre-commit hook." + exit 1 +fi diff --git a/.husky/pre-push b/.husky/pre-push new file mode 100644 index 00000000..5e997461 --- /dev/null +++ b/.husky/pre-push @@ -0,0 +1,10 @@ +current_branch=$(git branch --show-current) + +restricted_branches="^(main|master|develop|epic/.+)$" + + +if [[ $current_branch =~ $restricted_branches ]]; then + echo ":construction: You are on a restricted branch: $current_branch." + echo "Commits to this branch are not allowed via pre-commit hook." + exit 1 +fi diff --git a/.npmrc b/.npmrc new file mode 100644 index 00000000..4fd02195 --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +engine-strict=true \ No newline at end of file diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 00000000..93a75dd9 --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +v20.14.0 \ No newline at end of file diff --git a/.prettierrc.js b/.prettierrc.js new file mode 100644 index 00000000..29e9db26 --- /dev/null +++ b/.prettierrc.js @@ -0,0 +1,15 @@ +module.exports = { + printWidth: 200, + endOfLine: 'auto', + tabWidth: 2, + useTabs: false, + semi: true, + singleQuote: true, + quoteProps: 'as-needed', + trailingComma: 'all', + bracketSpacing: true, + jsxSingleQuote: true, + jsxBracketSameLine: false, + arrowParens: 'always', + parser: 'typescript', +} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 00000000..d5bfa7d4 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,68 @@ +{ + "editor.codeActionsOnSave": { + "source.fixAll": "always" + }, + "editor.formatOnSave": true, + "highlight.regexes": { + "((?:| *\\*/| *!}| *--}}| *}}|(?= *(?:[^:]//|/\\*+|| *\\*/| *!}| *--}}| *}}|(?= *(?:[^:]//|/\\*+|| *\\*/| *!}| *--}}| *}}|(?= *(?:[^:]//|/\\*+|| *\\*/| *!}| *--}}| *}}|(?= *(?:[^:]//|/\\*+|