Skip to content

Commit

Permalink
Merge pull request #23 from coldsurfers/feature/hotsurf
Browse files Browse the repository at this point in the history
feat: implemented nx
  • Loading branch information
yungblud authored Jan 30, 2024
2 parents ddde556 + c4c16c6 commit 8bdbf5e
Show file tree
Hide file tree
Showing 150 changed files with 13,142 additions and 3,586 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
node_modules/
node_modules/

.nx/cache
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx lint-staged -v
5 changes: 5 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules/
.next/
.vercel/
.gitignore
dist/
6 changes: 6 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"trailingComma": "es5",
"tabWidth": 2,
"semi": false,
"singleQuote": true
}
5 changes: 5 additions & 0 deletions lint-staged.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
'*.{ts,tsx}': (filenames) => [
// "bash -c 'yarn validate'"
],
}
5 changes: 5 additions & 0 deletions nx.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"affected": {
"defaultBase": "main"
}
}
21 changes: 18 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,29 @@
"**/billets-admin-server",
"**/billets-admin-server/**",
"**/billets-server",
"**/billets-server/**"
"**/billets-server/**",
"**/react-native",
"**/react-native/**"
]
},
"scripts": {
"super-install": "yarn install --immutable --force || yarn install --immutable --force",
"super-remove": "rm -rf ./packages/*/node_modules && rm -rf ./node_modules"
"super-remove": "rm -rf ./packages/*/node_modules && rm -rf ./node_modules",
"prettier": "prettier \"packages/**/*.{ts,tsx,js,json}\"",
"format:check": "yarn prettier --check",
"format:write": "yarn prettier --write",
"lint": "yarn nx run-many --target=lint",
"tsc": "yarn nx run-many --target=tsc",
"prepare": "husky install",
"prevalidate": "yarn format:write",
"validate": "run-p lint tsc format:check"
},
"devDependencies": {
"typescript": "^5.3.3"
"husky": "^8.0.0",
"lint-staged": "^15.2.0",
"npm-run-all": "^4.1.5",
"prettier": "^3.2.4",
"typescript": "^5.3.3",
"nx": "17.3.0"
}
}
10 changes: 5 additions & 5 deletions packages/accounts-kit/.prettierrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"trailingComma": "es5",
"tabWidth": 2,
"semi": false,
"singleQuote": true
}
"trailingComma": "es5",
"tabWidth": 2,
"semi": false,
"singleQuote": true
}
7 changes: 2 additions & 5 deletions packages/accounts-kit/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
{
"extends": [
"../../tsconfig.paths.json",
"../../tsconfig.utils.json"
]
}
"extends": ["../../tsconfig.paths.json", "../../tsconfig.utils.json"],
}
10 changes: 5 additions & 5 deletions packages/accounts-schema/.prettierrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"trailingComma": "es5",
"tabWidth": 2,
"semi": false,
"singleQuote": true
}
"trailingComma": "es5",
"tabWidth": 2,
"semi": false,
"singleQuote": true
}
198 changes: 99 additions & 99 deletions packages/accounts-schema/tsconfig.build.json

Large diffs are not rendered by default.

7 changes: 2 additions & 5 deletions packages/accounts-schema/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
{
"extends": [
"../../tsconfig.paths.json",
"../../tsconfig.utils.json"
]
}
"extends": ["../../tsconfig.paths.json", "../../tsconfig.utils.json"],
}
10 changes: 5 additions & 5 deletions packages/accounts-server/.prettierrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"trailingComma": "es5",
"tabWidth": 2,
"semi": false,
"singleQuote": true
}
"trailingComma": "es5",
"tabWidth": 2,
"semi": false,
"singleQuote": true
}
24 changes: 12 additions & 12 deletions packages/accounts-server/src/config/config.example.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"port": "",
"secrets": {
"jwt": "",
"AWS_S3_BUCKET": "",
"AWS_S3_REGION": "",
"AWS_S3_ACCESS_KEY_ID": "",
"AWS_S3_SECRET_ACCESS_KEY": "",
"MAILER_EMAIL_APP_PASSWORD": ""
},
"MAILER_EMAIL_ADDRESS": "",
"MAILER_SERVICE": ""
}
"port": "",
"secrets": {
"jwt": "",
"AWS_S3_BUCKET": "",
"AWS_S3_REGION": "",
"AWS_S3_ACCESS_KEY_ID": "",
"AWS_S3_SECRET_ACCESS_KEY": "",
"MAILER_EMAIL_APP_PASSWORD": ""
},
"MAILER_EMAIL_ADDRESS": "",
"MAILER_SERVICE": ""
}
200 changes: 100 additions & 100 deletions packages/accounts-server/tsconfig.build.json

Large diffs are not rendered by default.

5 changes: 1 addition & 4 deletions packages/accounts-server/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
{
"extends": [
"../../tsconfig.paths.json",
"../../tsconfig.server.json"
]
"extends": ["../../tsconfig.paths.json", "../../tsconfig.server.json"],
}
3 changes: 2 additions & 1 deletion packages/accounts-ui/.eslintrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"extends": [
"coldsurfers", // for nodejs-typescript, or 'coldsurfers/nodejs-typescript'
"coldsurfers/react-typescript" // for react-typescript
"coldsurfers/react-typescript", // for react-typescript
"plugin:react-hooks/recommended"
],
"plugins": ["@tanstack/query"],
"rules": {
Expand Down
10 changes: 5 additions & 5 deletions packages/accounts-ui/.prettierrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"trailingComma": "es5",
"tabWidth": 2,
"semi": false,
"singleQuote": true
}
"trailingComma": "es5",
"tabWidth": 2,
"semi": false,
"singleQuote": true
}
13 changes: 9 additions & 4 deletions packages/accounts-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,21 @@
"scripts": {
"prebuild": "yarn workspace @coldsurfers/surfers-ui build",
"build": "rm -rf dist && tsc",
"lint": "eslint --cache \"src/**/*.{js,jsx,ts,tsx}\"",
"lint": "eslint --cache \"src/**/*.{js,jsx,ts,tsx}\" --fix",
"lint:fix": "yarn lint --fix"
},
"peerDependencies": {
"@coldsurfers/surfers-ui": "1.0.0",
"@coldsurfers/hotsurf": ">= 0.2.6",
"@emotion/styled": "^11.11.0",
"react": "^18.2.0",
"react-dom": "^18.2.0"
"react-dom": "^18.2.0",
"react-native": ">= 0.69.0",
"react-spinners": "^0.13.8"
},
"devDependencies": {
"@coldsurfers/surfers-ui": "1.0.0",
"@coldsurfers/hotsurf": "0.2.6",
"@emotion/styled": "^11.11.0",
"@typescript-eslint/eslint-plugin": "^5.62.0",
"@typescript-eslint/parser": "^5.62.0",
Expand All @@ -40,9 +44,10 @@
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
"prettier": "^2.8.1",
"prettier": "^3.2.4",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"typescript": "^5.3.3"
"typescript": "^5.3.3",
"react-spinners": "^0.13.8"
}
}
96 changes: 96 additions & 0 deletions packages/accounts-ui/src/LoginForm.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
import { Button, palette, Text, TextInput, Toast } from '@coldsurfers/hotsurf'
import { memo, useState } from 'react'
import styled from '@emotion/styled'
import Loader from './LoginFormLoader'

const Wrapper = styled.section`
position: absolute;
top: 50%; /* position the top edge of the element at the middle of the parent */
left: 50%; /* position the left edge of the element at the middle of the parent */
transform: translate(-50%, -50%);
padding: 1rem;
border-radius: 3px;
display: flex;
flex-direction: column;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
`

const ToastWrapper = styled.div`
position: absolute;
bottom: 20px;
left: 0;
right: 0;
`

interface Props {
onClickLoginButton: () => void
isLoading?: boolean
withRequestButtonUI?: boolean
onClickRequestButtonUI?: () => void
errorMessage?: string
}

const LoginForm = ({
onClickLoginButton,
isLoading,
withRequestButtonUI,
onClickRequestButtonUI,
errorMessage,
}: Props) => {
const [email, setEmail] = useState<string>('')
const [password, setPassword] = useState<string>('')

return (
<>
<Wrapper>
<Text
weight="bold"
style={{
fontSize: 18,
marginBottom: 14,
}}
>
Billets 어드민
</Text>
<TextInput
value={email}
onChangeText={(text) => setEmail(text)}
placeholder="이메일"
style={{ width: 300 }}
/>
<TextInput
value={password}
onChangeText={(text) => setPassword(text)}
placeholder="패스워드"
secureTextEntry
style={{ width: 300, marginTop: 14 }}
/>
<Button
text="로그인"
onPress={onClickLoginButton}
style={{ marginTop: 14 }}
/>
{withRequestButtonUI && (
<Button
text="가입 요청하기"
onPress={onClickRequestButtonUI}
style={{ marginTop: 14, backgroundColor: palette.black }}
/>
)}
</Wrapper>
{!!errorMessage && (
<ToastWrapper>
<Toast type="error" message={errorMessage} />
</ToastWrapper>
)}
{isLoading && <Loader />}
</>
)
}

export default memo(LoginForm)
30 changes: 30 additions & 0 deletions packages/accounts-ui/src/LoginFormLoader.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { palette } from '@coldsurfers/hotsurf'
import { PulseLoader } from 'react-spinners'
import styled from '@emotion/styled'

const Background = styled.div`
position: fixed;
top: 0;
left: 0;
bottom: 0;
right: 0;
z-index: 1;
background-color: rgba(0, 0, 0, 0.1);
`

const Pulse = styled(PulseLoader)`
z-index: 2;
position: absolute;
top: 50%; /* position the top edge of the element at the middle of the parent */
left: 50%; /* position the left edge of the element at the middle of the parent */
transform: translate(-50%, -50%);
`

const Loader = () => (
<Background>
<Pulse color={palette.pink} />
</Background>
)

export default Loader
1 change: 1 addition & 0 deletions packages/accounts-ui/src/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export { default as LoginModal } from './LoginModal'
export { default as LoginForm } from './LoginForm'
5 changes: 1 addition & 4 deletions packages/accounts-ui/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
{
"extends": [
"../../tsconfig.paths.json",
"../../tsconfig.ui.json"
]
"extends": ["../../tsconfig.paths.json", "../../tsconfig.ui.json"],
}
2 changes: 1 addition & 1 deletion packages/billets-admin-client/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"typescript.tsdk": "node_modules/typescript/lib",
"typescript.enablePromptUseWorkspaceTsdk": true
}
}
8 changes: 6 additions & 2 deletions packages/billets-admin-client/app/concert/[id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,9 @@ const Thumbnail = styled.img`
border-radius: 8px;
margin-top: 12px;
object-fit: contain;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
box-shadow:
0 1px 3px rgba(0, 0, 0, 0.12),
0 1px 2px rgba(0, 0, 0, 0.24);
transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
`

Expand Down Expand Up @@ -347,7 +349,9 @@ const SectionList = styled.div`
const SectionCard = styled.div`
margin-top: 6px;
margin-bottom: 12px;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
box-shadow:
0 1px 3px rgba(0, 0, 0, 0.12),
0 1px 2px rgba(0, 0, 0, 0.24);
transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
background-color: ${palette.white};
padding: 16px;
Expand Down
Loading

0 comments on commit 8bdbf5e

Please sign in to comment.