Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/KGU-C-Lab/clab.page into re…
Browse files Browse the repository at this point in the history
…factor/#183
  • Loading branch information
SWARVY committed Jul 29, 2024
2 parents f25a11b + c9d4cd3 commit 204d8bd
Show file tree
Hide file tree
Showing 36 changed files with 926 additions and 110 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* @gwansikk
* @Jeong-Ag
5 changes: 3 additions & 2 deletions apps/auth/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "auth",
"name": "@clab/auth",
"private": true,
"scripts": {
"dev": "next dev --port 6001",
Expand Down Expand Up @@ -33,5 +33,6 @@
"postcss": "^8",
"tailwindcss": "^3.3.0",
"typescript": "^5"
}
},
"packageManager": "[email protected]"
}
6 changes: 3 additions & 3 deletions apps/land/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"name": "land",
"packageManager": "[email protected]",
"name": "@clab/land",
"private": true,
"scripts": {
"dev": "next dev",
Expand All @@ -26,5 +25,6 @@
"postcss": "^8",
"tailwindcss": "^3.3.0",
"typescript": "^5"
}
},
"packageManager": "[email protected]"
}
16 changes: 8 additions & 8 deletions apps/member/package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
{
"name": "member",
"private": true,
"version": "0.0.0",
"name": "@clab/member",
"type": "module",
"private": true,
"scripts": {
"dev": "vite --port 6002 --mode development",
"build": "tsc && vite build --mode production",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"dev": "vite --port 6002",
"build": "tsc && vite build",
"lint": "eslint . --ext ts,tsx",
"type": "tsc --noEmit",
"preview": "vite preview"
},
Expand All @@ -18,7 +17,7 @@
"@gwansikk/server-chain": "^0.5.2",
"@sentry/react": "^8.9.2",
"@sentry/vite-plugin": "^2.18.0",
"@tanstack/react-query": "^5.18.1",
"@tanstack/react-query": "^5.45.1",
"@tanstack/react-query-devtools": "^5.40.1",
"dayjs": "^1.11.10",
"framer-motion": "^10.18.0",
Expand Down Expand Up @@ -48,5 +47,6 @@
"tailwindcss": "^3.4.1",
"typescript": "^5.2.2",
"vite": "^5.0.8"
}
},
"packageManager": "[email protected]"
}
1 change: 0 additions & 1 deletion apps/member/src/components/common/Modal/Modal.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable react/display-name */
import { PropsWithChildren } from 'react';

import { cn } from '@clab/utils';
Expand Down
1 change: 0 additions & 1 deletion apps/member/src/components/common/Panel/Panel.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable react/display-name */
import { cn } from '@clab/utils';

import DropdownButton from '../DropdownButton/DropdownButton';
Expand Down
1 change: 0 additions & 1 deletion apps/member/src/components/common/Post/Post.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable react/display-name */
import { cn, toDecodeHTMLEntities } from '@clab/utils';

import { SERVICE_NAME } from '@constants/environment';
Expand Down
1 change: 0 additions & 1 deletion apps/member/src/components/common/Section/Section.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable react/display-name */
import { type PropsWithChildren } from 'react';

import { cn } from '@clab/utils';
Expand Down
8 changes: 4 additions & 4 deletions apps/member/src/constants/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ export const END_POINT = {
// -- 블로그
BLOG: `/v1/blogs`,
BLOG_DETAIL: (id: number) => `/v1/blogs/${id}`,
ACCUSES: '/v1/accuses',
ACCUSES: '/v1/accusations',
MY_NEWS: `/v1/news`,
MY_HIRE: `/v1/job-postings`,
MY_BIRTHDAY: `/v1/members/birthday`,
MY_ACTIVITY: `/v1/schedule/activity`,
MAIN_SCHEDULE: `/v1/schedule`,
SCHEDULE_COLLECT: `/v1/schedule/collect`,
MY_ACTIVITY: `/v1/schedules/activity`,
MAIN_SCHEDULE: `/v1/schedules`,
SCHEDULE_COLLECT: `/v1/schedules/collect`,
MAIN_ACTIVITY_PHOTO: `/v1/activity-photos`,
// -- 회비
MEMBERSHIP_FEE: `/v1/membership-fees`,
Expand Down
10 changes: 6 additions & 4 deletions apps/status/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"name": "status",
"version": "0.1.0",
"name": "@clab/status",
"private": true,
"scripts": {
"dev": "next dev",
Expand All @@ -10,19 +9,22 @@
"type": "tsc --noEmit"
},
"dependencies": {
"@clab/utils": "workspace:^",
"next": "14.2.4",
"react": "^18",
"react-dom": "^18",
"react-lottie-player": "^2.0.0"
},
"devDependencies": {
"@clab/config": "workspace:^",
"@clab/utils": "workspace:^",
"@types/node": "^20",
"@types/react": "^18",
"@types/react-dom": "^18",
"eslint": "^8",
"eslint-config-next": "14.1.4",
"postcss": "^8",
"tailwindcss": "^3.4.1",
"typescript": "^5"
}
},
"packageManager": "[email protected]"
}
5 changes: 3 additions & 2 deletions apps/status/src/widgets/introduce/ui/IntroduceLottie.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
'use client';

import Lottie from 'react-lottie-player';

import check from '@/public/lottie/working.json';
import dynamic from 'next/dynamic';

const Lottie = dynamic(() => import('react-lottie-player'), { ssr: false });

export default function IntroduceLottie() {
return (
Expand Down
15 changes: 4 additions & 11 deletions apps/status/src/widgets/service-status/ui/CurrentServices.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Title from '@/src/shared/ui/Title';

import ServiceStatusItem from './ServiceStatusItem';

function StatusBanner({ status }: { status: boolean }) {
function StatusBanner({ status }: Readonly<{ status: boolean }>) {
return (
<div
className={cn(
Expand All @@ -21,17 +21,9 @@ function StatusBanner({ status }: { status: boolean }) {
}

export default async function CurrentStatus() {
const status = await fetch(
process.env.NODE_ENV !== 'production'
? process.env.DEVELOP_SERVER_URL ?? ''
: process.env.PRODUCTION_SERVER_URL ?? '',
)
.then((res) => res.status === 404)
.catch(() => false);

return (
<div className="flex w-full flex-col gap-y-10">
<StatusBanner status={status} />
<StatusBanner status={false} />
<div className="w-full">
<Title text="서비스 목록" />
<div className="mt-5 text-right text-sm text-gray-400">
Expand All @@ -41,9 +33,10 @@ export default async function CurrentStatus() {
<ul className="grid w-full grid-cols-1 gap-8 md:grid-cols-2">
{Object.entries(SERVICE_LIST).map(([serviceName, serviceURL]) => (
<ServiceStatusItem
key={serviceName}
serviceName={serviceName}
serviceURL={serviceURL}
status={status}
status={false}
/>
))}
</ul>
Expand Down
6 changes: 3 additions & 3 deletions apps/time/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"name": "time",
"version": "0.1.0",
"name": "@clab/time",
"private": true,
"scripts": {
"dev": "next dev --port 6004",
Expand Down Expand Up @@ -28,5 +27,6 @@
"postcss": "^8",
"tailwindcss": "^3.3.0",
"typescript": "^5"
}
},
"packageManager": "[email protected]"
}
2 changes: 2 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ module.exports = {
'hooks',
'icon',
'utils',
'ci',
'github',
],
],
},
Expand Down
21 changes: 9 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,16 @@
{
"name": "clab.page",
"private": true,
"packageManager": "[email protected]",
"workspaces": [
"apps/*",
"packages/*"
],
"scripts": {
"preinstall": "npx only-allow pnpm",
"postinstall": "husky install && pnpm build:design-system && pnpm build:icon",
"lint-staged": "lint-staged",
"dev": "pnpm -r run dev",
"build": "pnpm -r run build",
"type": "pnpm -r run type",
"test": "pnpm -r run test",
"coverage": "pnpm -r run coverage",
"lint": "eslint .",
"dev": "turbo run dev",
"build": "turbo run build",
"type": "turbo run type",
"test": "turbo run test",
"coverage": "turbo run coverage",
"lint": "turbo run lint",
"format": "prettier --write .",
"dev:auth": "pnpm --filter auth dev",
"dev:land": "pnpm --filter land dev",
Expand Down Expand Up @@ -55,6 +50,8 @@
"lint-staged": "^15.2.0",
"prettier": "^3.2.5",
"prettier-plugin-tailwindcss": "^0.5.13",
"turbo": "^2.0.9",
"typescript": "^5.3.3"
}
},
"packageManager": "[email protected]"
}
1 change: 0 additions & 1 deletion packages/config/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"name": "@clab/config",
"version": "0.0.0",
"private": true
}
11 changes: 6 additions & 5 deletions packages/design-system/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@clab/design-system",
"version": "0.1.0",
"version": "0.0.1",
"description": "Design system for Kyonggi University C-Lab",
"main": "dist/index.js",
"module": "dist/index.mjs",
Expand All @@ -11,7 +11,7 @@
"scripts": {
"clean": "rimraf dist",
"type": "tsc --noEmit",
"test": "vitest",
"test": "vitest run --coverage --typecheck",
"coverage": "vitest --coverage",
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build",
Expand All @@ -35,7 +35,7 @@
"@types/react": "^18.2.43",
"@types/react-dom": "^18.2.17",
"@vitejs/plugin-react": "^4.2.1",
"@vitest/coverage-v8": "^1.6.0",
"@vitest/coverage-istanbul": "^2.0.3",
"autoprefixer": "^10.4.17",
"cva": "1.0.0-beta.1",
"jsdom": "^24.0.0",
Expand All @@ -47,13 +47,14 @@
"tsup": "^8.1.0",
"typescript": "^5.3.3",
"vite": "^5.2.8",
"vitest": "^1.6.0"
"vitest": "^2.0.3"
},
"peerDependencies": {
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"dependencies": {
"@clab/icon": "workspace:^"
}
},
"packageManager": "[email protected]"
}
43 changes: 43 additions & 0 deletions packages/design-system/src/Badge/Badge.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import React from 'react';

import { render, screen } from '@testing-library/react';

import Badge from './Badge';
import { badgeVariants } from './Badge.styles';

describe('Badge', () => {
it('컴포넌트가 크래시 없이 렌더링되어야 합니다.', () => {
render(<Badge>Badge</Badge>);

expect(screen.getByText('Badge')).toBeInTheDocument();
});

it('컴포넌트에 색상 변형이 올바르게 적용되어야 합니다.', () => {
const { rerender } = render(<Badge color="primary">Primary Badge</Badge>);

let badge = screen.getByText('Primary Badge');
expect(badge).toHaveClass(badgeVariants({ color: 'primary' }));

rerender(<Badge color="red">Red Badge</Badge>);
badge = screen.getByText('Red Badge');
expect(badge).toHaveClass(badgeVariants({ color: 'red' }));

rerender(<Badge color="green">Green Badge</Badge>);
badge = screen.getByText('Green Badge');
expect(badge).toHaveClass(badgeVariants({ color: 'green' }));
});

it('추가적인 클래스명이 올바르게 적용되어야 합니다.', () => {
render(<Badge className="extra-class">Badge</Badge>);

expect(screen.getByText('Badge')).toHaveClass('extra-class');
});

it('ref가 스팬 엘리먼트로 올바르게 전달되어야 합니다.', () => {
const ref = React.createRef<HTMLSpanElement>();
render(<Badge ref={ref}>Badge</Badge>);

expect(ref.current).toBeInstanceOf(HTMLSpanElement);
expect(ref.current?.tagName).toBe('SPAN');
});
});
Loading

0 comments on commit 204d8bd

Please sign in to comment.