Skip to content

Commit

Permalink
feat: 프로젝트 아키텍처 기본 세팅
Browse files Browse the repository at this point in the history
  • Loading branch information
DingX2 committed May 6, 2024
1 parent 4f935f0 commit 694f304
Show file tree
Hide file tree
Showing 13 changed files with 114 additions and 197 deletions.
Binary file modified bun.lockb
Binary file not shown.
20 changes: 10 additions & 10 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + Solid + TS</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/index.tsx"></script>
</body>
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + Solid + TS</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/index.tsx"></script>
</body>
</html>
109 changes: 59 additions & 50 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,52 +1,61 @@
{
"name": "devxuan",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"preview": "vite preview",
"prepare": "husky",
"prettier": "prettier --write .",
"type-check": "tsc --noEmit",
"type-check:watch": "tsc --noEmit --watch"
},
"dependencies": {
"solid-js": "^1.8.15"
},
"devDependencies": {
"@eslint/js": "^9.1.1",
"eslint": "^8.56.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-airbnb-typescript": "^18.0.0",
"eslint-config-prettier": "^9.1.0",
"eslint-import-resolver-typescript": "^3.6.1",
"eslint-plugin-jsx-a11y": "^6.8.0",
"eslint-plugin-solid": "^0.14.0",
"globals": "^15.1.0",
"husky": "^9.0.11",
"lint-staged": "^15.2.2",
"prettier": "^3.2.5",
"typescript": "^5.2.2",
"typescript-eslint": "^7.8.0",
"vite": "^5.2.0",
"vite-plugin-eslint": "^1.8.1",
"vite-plugin-solid": "^2.10.2"
},
"lint-staged": {
"*.{js,jsx,ts,tsx}": [
"bash -c 'eslint --fix'",
"bash -c 'prettier --write'",
"bash -c 'bun lint'",
"bash -c 'bun type-check'"
],
"*.css": [
"bash -c 'bun prettier'"
],
"*.{json,md}": [
"bash -c 'bun prettier'"
]
}
"name": "devxuan",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"preview": "vite preview",
"prepare": "husky",
"lint": "eslint .",
"prettier": "prettier .",
"type-check": "tsc --noEmit",
"type-check:watch": "tsc --noEmit --watch"
},
"dependencies": {
"@tanstack/solid-query": "^5.35.1",
"@tanstack/solid-query-devtools": "^5.35.1",
"framer-motion": "^11.1.8",
"ky": "^1.2.4",
"solid-js": "^1.8.15",
"solid-styled-components": "^0.28.5"
},
"devDependencies": {
"@commitlint/config-conventional": "^19.2.2",
"@eslint/js": "^9.1.1",
"commitlint": "^19.3.0",
"eslint": "^8.56.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-airbnb-typescript": "^18.0.0",
"eslint-config-prettier": "^9.1.0",
"eslint-import-resolver-typescript": "^3.6.1",
"eslint-plugin-jsx-a11y": "^6.8.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-solid": "^0.14.0",
"globals": "^15.1.0",
"husky": "^9.0.11",
"lint-staged": "^15.2.2",
"prettier": "^3.2.5",
"typescript": "^5.2.2",
"typescript-eslint": "^7.8.0",
"vite": "^5.2.0",
"vite-plugin-babel": "^1.2.0",
"vite-plugin-eslint": "^1.8.1",
"vite-plugin-solid": "^2.10.2"
},
"lint-staged": {
"*.{js,jsx,ts,tsx}": [
"bash -c 'bun prettier'",
"bash -c 'bun lint'",
"bash -c 'bun type-check'"
],
"*.css": [
"bash -c 'bun prettier'"
],
"*.{json,md}": [
"bash -c 'bun prettier'"
]
}
}
27 changes: 0 additions & 27 deletions src/App.css

This file was deleted.

58 changes: 26 additions & 32 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,35 +1,29 @@
import { createSignal } from 'solid-js'
import solidLogo from './assets/solid.svg'
import viteLogo from '/vite.svg'
import './App.css'
import { type Component, createSignal } from 'solid-js';
import { styled } from 'solid-styled-components';
import { Button } from './components/atoms';
import solidLogo from './assets/solid.svg';

function App() {
const [count, setCount] = createSignal(0)
const Box = styled.div``;

return (
<>
<div>
<a href="https://vitejs.dev" target="_blank">
<img src={viteLogo} class="logo" alt="Vite logo" />
</a>
<a href="https://solidjs.com" target="_blank">
<img src={solidLogo} class="logo solid" alt="Solid logo" />
</a>
</div>
<h1>Vite + Solid</h1>
<div class="card">
<button onClick={() => setCount((count) => count + 1)}>
count is {count()}
</button>
<p>
Edit <code>src/App.tsx</code> and save to test HMR
</p>
</div>
<p class="read-the-docs">
Click on the Vite and Solid logos to learn more
</p>
</>
)
}
export const App: Component = () => {
const [count, setCount] = createSignal(0);

export default App
return (
<>
<div>
<a href="https://solidjs.com" target="_blank" rel="noreferrer">
<img src={solidLogo} class="logo solid" alt="Solid logo" />
</a>
</div>
<Box>Vite + Solid</Box>
<Button>버튼</Button>
<div class="card">
<button onClick={() => setCount((count) => count + 1)}>count is {count()}</button>
<p>
Edit <code>src/App.tsx</code> and save to test HMR
</p>
</div>
<p class="read-the-docs">Click on the Vite and Solid logos to learn more</p>
</>
);
};
3 changes: 3 additions & 0 deletions src/components/atoms/Button.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { styled } from 'solid-styled-components';

export const Button = styled.button``;
1 change: 1 addition & 0 deletions src/components/atoms/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './Button';
6 changes: 6 additions & 0 deletions src/constants/Query.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export const QUERY_OPTIONS = {
retry: 2,
refetchOnWindowFocus: false,
staleTime: 10 * 60 * 1000,
cacheTime: 30 * 60 * 1000,
};
4 changes: 2 additions & 2 deletions src/hooks/apis/post-query/respository.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import axios from 'axios';
import ky from 'ky';

export class PostRepository {
static getPost() {
return axios.get('');
return ky.get('');
}
}
Empty file.
68 changes: 0 additions & 68 deletions src/index.css

This file was deleted.

11 changes: 4 additions & 7 deletions src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
/* @refresh reload */
import { render } from 'solid-js/web'
import { render } from 'solid-js/web';
import { App } from './App';

import './index.css'
import App from './App'
const root = document.getElementById('root');

const root = document.getElementById('root')

render(() => <App />, root!)
render(() => <App />, root!);
4 changes: 3 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"module": "ESNext",
"lib": ["ES2020", "DOM", "DOM.Iterable"],
"skipLibCheck": true,
"allowJs": false,
"baseUrl": ".",
"paths": {
"@/*": ["./*"]
Expand All @@ -13,9 +14,10 @@
/* Bundler mode */
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"declaration": true,
"noEmit": true,
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "preserve",
"jsxImportSource": "solid-js",

Expand Down

0 comments on commit 694f304

Please sign in to comment.