Skip to content

Commit

Permalink
chore: 관리자 프로젝트 셋팅 (#786)
Browse files Browse the repository at this point in the history
  • Loading branch information
LJW25 authored and hgo641 committed Apr 23, 2024
1 parent 8ce942e commit 75f7fef
Show file tree
Hide file tree
Showing 84 changed files with 5,125 additions and 153 deletions.
3,349 changes: 3,231 additions & 118 deletions frontend-monorepo/.pnp.cjs

Large diffs are not rendered by default.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
3 changes: 3 additions & 0 deletions frontend-monorepo/frontend-monorepo.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
},
{
"path": "packages/hanglog-service"
},
{
"path": "packages/hanglog-admin"
}
],
"settings": {
Expand Down
17 changes: 17 additions & 0 deletions frontend-monorepo/packages/hanglog-admin/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"sourceType": "unambiguous",
"presets": [
[
"@babel/preset-env",
{
"targets": {
"chrome": 100
}
}
],
"@babel/preset-typescript",
"@babel/preset-react",
"@emotion/babel-preset-css-prop"
],
"plugins": ["@emotion", "react-require"]
}
50 changes: 50 additions & 0 deletions frontend-monorepo/packages/hanglog-admin/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint"],
"extends": [
"eslint:recommended",
"airbnb",
"airbnb/hooks",
"plugin:react/jsx-runtime",
"plugin:@typescript-eslint/recommended",
"plugin:storybook/recommended",
"plugin:prettier/recommended",
"prettier"
],
"rules": {
"class-methods-use-this": "off",
"no-useless-constructor": "off",
"no-use-before-define": "off",
"no-shadow": "off",
"@typescript-eslint/consistent-type-imports": "error",
"import/prefer-default-export": "off",
"import/no-unresolved": "off",
"import/extensions": "off",
"import/no-extraneous-dependencies": "off",
"react/jsx-filename-extension": [
1,
{
"extensions": [".js", ".jsx", ".ts", ".tsx"]
}
],
"react/display-name": "off",
"react/prop-types": "off",
"react/require-default-props": "off",
"react/jsx-props-no-spreading": "off",
"react/function-component-definition": [
"error",
{
"namedComponents": "arrow-function"
}
]
},
"overrides": [
{
"files": ["**/*.stories.*"],
"rules": {
"import/no-anonymous-default-export": "off",
"react-hooks/rules-of-hooks": "off"
}
}
]
}
24 changes: 24 additions & 0 deletions frontend-monorepo/packages/hanglog-admin/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
18 changes: 18 additions & 0 deletions frontend-monorepo/packages/hanglog-admin/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"endOfLine": "auto",
"singleQuote": true,
"tabWidth": 2,
"printWidth": 100,
"semi": true,
"importOrder": [
"^@utils/(.*)$",
"^@api/(.*)$",
"^@hooks/(.*)$",
"^@pages/(.*)$",
"^@components/(.*)$",
"^@styles/(.*)$",
"^[./]"
],
"importOrderSeparation": true,
"importOrderSortSpecifiers": true
}
28 changes: 28 additions & 0 deletions frontend-monorepo/packages/hanglog-admin/.storybook/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import type { StorybookConfig } from '@storybook/react-vite';

import { join, dirname } from 'path';

/**
* This function is used to resolve the absolute path of a package.
* It is needed in projects that use Yarn PnP or are set up within a monorepo.
*/
function getAbsolutePath(value: string): any {
return dirname(require.resolve(join(value, 'package.json')));
}
const config: StorybookConfig = {
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
addons: [
getAbsolutePath('@storybook/addon-links'),
getAbsolutePath('@storybook/addon-essentials'),
getAbsolutePath('@storybook/addon-onboarding'),
getAbsolutePath('@storybook/addon-interactions'),
],
framework: {
name: getAbsolutePath('@storybook/react-vite'),
options: {},
},
docs: {
autodocs: 'tag',
},
};
export default config;
15 changes: 15 additions & 0 deletions frontend-monorepo/packages/hanglog-admin/.storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import type { Preview } from '@storybook/react';

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

export default preview;
30 changes: 30 additions & 0 deletions frontend-monorepo/packages/hanglog-admin/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# React + TypeScript + Vite

This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.

Currently, two official plugins are available:

- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh

## Expanding the ESLint configuration

If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:

- Configure the top-level `parserOptions` property like this:

```js
export default {
// other rules...
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
project: ['./tsconfig.json', './tsconfig.node.json'],
tsconfigRootDir: __dirname,
},
};
```

- Replace `plugin:@typescript-eslint/recommended` to `plugin:@typescript-eslint/recommended-type-checked` or `plugin:@typescript-eslint/strict-type-checked`
- Optionally add `plugin:@typescript-eslint/stylistic-type-checked`
- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and add `plugin:react/recommended` & `plugin:react/jsx-runtime` to the `extends` list
13 changes: 13 additions & 0 deletions frontend-monorepo/packages/hanglog-admin/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/logo.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>행록 관리자</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/index.tsx"></script>
</body>
</html>
62 changes: 62 additions & 0 deletions frontend-monorepo/packages/hanglog-admin/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
"name": "hanglog-admin",
"private": true,
"version": "0.0.0",
"description": "행록 관리자",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview",
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build"
},
"dependencies": {
"@emotion/css": "^11.11.2",
"@emotion/react": "^11.11.3",
"@tanstack/react-query": "^5.17.19",
"hang-log-design-system": "workspace:^",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "^6.21.3",
"recoil": "^0.7.7",
"storybook": "^7.6.10",
"vite-tsconfig-paths": "^4.3.1"
},
"devDependencies": {
"@babel/preset-env": "^7.23.8",
"@babel/preset-react": "^7.23.3",
"@babel/preset-typescript": "^7.23.3",
"@storybook/addon-essentials": "^7.6.10",
"@storybook/addon-interactions": "^7.6.10",
"@storybook/addon-links": "^7.6.10",
"@storybook/addon-onboarding": "^1.0.11",
"@storybook/blocks": "^7.6.10",
"@storybook/react": "^7.6.10",
"@storybook/react-vite": "^7.6.10",
"@storybook/test": "^7.6.10",
"@types/babel__preset-env": "^7",
"@types/react": "^18.2.43",
"@types/react-dom": "^18.2.17",
"@typescript-eslint/eslint-plugin": "^6.4.0",
"@typescript-eslint/parser": "^6.14.0",
"@vitejs/plugin-react": "^4.2.1",
"eslint": "^8.0.1",
"eslint-config-standard-with-typescript": "^43.0.1",
"eslint-plugin-import": "^2.25.2",
"eslint-plugin-n": "^15.0.0 || ^16.0.0 ",
"eslint-plugin-promise": "^6.0.0",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.5",
"eslint-plugin-storybook": "^0.6.15",
"msw": "1.2.3",
"prettier": "3.2.4",
"typescript": "*",
"vite": "^5.0.8"
},
"msw": {
"workerDirectory": "public"
}
}
8 changes: 8 additions & 0 deletions frontend-monorepo/packages/hanglog-admin/public/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 75f7fef

Please sign in to comment.