-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #420 from woowacourse-teams/develop-frontend
프론트엔드 브랜치 병합
- Loading branch information
Showing
472 changed files
with
26,566 additions
and
5,927 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: frontend-deploy | ||
|
||
on: | ||
push: | ||
branches: | ||
- develop-frontend | ||
|
||
jobs: | ||
deploy: | ||
runs-on: self-hosted | ||
|
||
steps: | ||
- name: deploy | ||
run: | | ||
cd ~/deploy && ./deploy-fe.sh | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: frontend-integration | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- develop-frontend | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
working-directory: ./frontend | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Check Caching | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.npm | ||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '20.15.0' | ||
|
||
- name: Install Dependencies | ||
run: npm install --frozen-lockfile | ||
|
||
- name: Create .env file | ||
run: | | ||
echo "BASE_URL=${{ secrets.BASE_URL }}" > .env | ||
echo "REACT_APP_GOOGLE_ANALYTICS=${{ secrets.REACT_APP_GOOGLE_ANALYTICS }}" >> .env | ||
echo "SENTRY_AUTH_TOKEN=${{ secrets.SENTRY_AUTH_TOKEN }}" >> .env | ||
echo "SENTRY_DSN=${{ secrets.SENTRY_DSN }}" >> .env | ||
- name: Run tests | ||
run: npm run test | ||
|
||
- name: Run linter | ||
run: npm run lint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
node_modules | ||
dist | ||
*storybook.log | ||
*storybook.log | ||
.env | ||
.env* | ||
coverage | ||
|
||
public/firebaseConfig.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"stylelint.configFile": ".stylelintrc.json", | ||
"editor.codeActionsOnSave": { | ||
"source.fixAll.stylelint": "always" | ||
}, | ||
"stylelint.validate": ["typescript", "typescriptreact"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { defineConfig } from "cypress"; | ||
|
||
export default defineConfig({ | ||
e2e: { | ||
setupNodeEvents(on, config) { | ||
// implement node event listeners here | ||
}, | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/// <reference types="cypress" /> | ||
// *********************************************** | ||
// This example commands.ts shows you how to | ||
// create various custom commands and overwrite | ||
// existing commands. | ||
// | ||
// For more comprehensive examples of custom | ||
// commands please read more here: | ||
// https://on.cypress.io/custom-commands | ||
// *********************************************** | ||
// | ||
// | ||
// -- This is a parent command -- | ||
// Cypress.Commands.add('login', (email, password) => { ... }) | ||
// | ||
// | ||
// -- This is a child command -- | ||
// Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... }) | ||
// | ||
// | ||
// -- This is a dual command -- | ||
// Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... }) | ||
// | ||
// | ||
// -- This will overwrite an existing command -- | ||
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... }) | ||
// | ||
// declare global { | ||
// namespace Cypress { | ||
// interface Chainable { | ||
// login(email: string, password: string): Chainable<void> | ||
// drag(subject: string, options?: Partial<TypeOptions>): Chainable<Element> | ||
// dismiss(subject: string, options?: Partial<TypeOptions>): Chainable<Element> | ||
// visit(originalFn: CommandOriginalFn, url: string, options: Partial<VisitOptions>): Chainable<Element> | ||
// } | ||
// } | ||
// } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// *********************************************************** | ||
// This example support/e2e.ts is processed and | ||
// loaded automatically before your test files. | ||
// | ||
// This is a great place to put global configuration and | ||
// behavior that modifies Cypress. | ||
// | ||
// You can change the location of this file or turn off | ||
// automatically serving support files with the | ||
// 'supportFile' configuration option. | ||
// | ||
// You can read more here: | ||
// https://on.cypress.io/configuration | ||
// *********************************************************** | ||
|
||
// Import commands.js using ES2015 syntax: | ||
import './commands' | ||
|
||
// Alternatively you can use CommonJS syntax: | ||
// require('./commands') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"preset": "ts-jest", | ||
"testEnvironment": "jest-environment-jsdom", | ||
|
||
|
||
|
||
"moduleNameMapper": { | ||
"^@_apis/(.*)$": "<rootDir>/src/apis/$1", | ||
"^@_constants/(.*)$": "<rootDir>/src/constants/$1", | ||
"^@_common/(.*)$": "<rootDir>/src/common/$1", | ||
"^@_components/(.*)$": "<rootDir>/src/components/$1", | ||
"^@_hooks/(.*)$": "<rootDir>/src/hooks/$1", | ||
"^@_layouts/(.*)$": "<rootDir>/src/layouts/$1", | ||
"^@_pages/(.*)$": "<rootDir>/src/pages/$1", | ||
"^@_types/(.*)$": "<rootDir>/src/types/$1", | ||
"^@_utils/(.*)$": "<rootDir>/src/utils/$1", | ||
"^@_routes/(.*)$": "<rootDir>/src/routes/$1", | ||
"^@_mocks/(.*)$": "<rootDir>/src/mocks/$1" | ||
}, | ||
"testEnvironmentOptions": { | ||
"customExportConditions": [""] | ||
}, | ||
"setupFiles": ["dotenv/config", "./jest.polyfills.js"], | ||
"setupFilesAfterEnv": ["<rootDir>/jest.setup.ts"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/** | ||
* @note The block below contains polyfills for Node.js globals | ||
* required for Jest to function when running JSDOM tests. | ||
* These HAVE to be require's and HAVE to be in this exact | ||
* order, since "undici" depends on the "TextEncoder" global API. | ||
* | ||
* Consider migrating to a more modern test runner if | ||
* you don't want to deal with this. | ||
*/ | ||
|
||
const { TextDecoder, TextEncoder } = require('node:util'); | ||
const { ReadableStream, TransformStream } = require('node:stream/web'); | ||
|
||
Object.defineProperties(globalThis, { | ||
TextDecoder: { value: TextDecoder }, | ||
TextEncoder: { value: TextEncoder }, | ||
ReadableStream: { value: ReadableStream }, | ||
TransformStream: { value: TransformStream }, | ||
}); | ||
|
||
const { Blob, File } = require('node:buffer'); | ||
const { fetch, Headers, FormData, Request, Response } = require('undici'); | ||
|
||
Object.defineProperties(globalThis, { | ||
fetch: { value: fetch, writable: true }, | ||
Blob: { value: Blob }, | ||
File: { value: File }, | ||
Headers: { value: Headers }, | ||
FormData: { value: FormData }, | ||
Request: { value: Request }, | ||
Response: { value: Response }, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import '@testing-library/jest-dom'; | ||
|
||
import dotenv from 'dotenv'; | ||
import { server } from './src/mocks/server'; | ||
|
||
dotenv.config({ path: './.env' }); | ||
|
||
beforeAll(() => { | ||
server.listen({ | ||
onUnhandledRequest: 'error', // 이 옵션을 통해 핸들되지 않은 요청을 경고로 표시 | ||
}); | ||
}); | ||
|
||
afterEach(() => { | ||
server.resetHandlers(); | ||
}); | ||
// Clean up after the tests are finished. | ||
afterAll(() => { | ||
server.close(); | ||
}); |
Oops, something went wrong.