Skip to content
This repository was archived by the owner on Dec 15, 2024. It is now read-only.

Commit 4a0241a

Browse files
authored
Merge pull request #19 from Team-INSERT/feat/style,ui
feat : style, ui package 모듈로 분리
2 parents b05d27a + d211a7b commit 4a0241a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+471
-404
lines changed

apps/wiki/apis/index.ts

+9-8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import axios from "axios";
1+
import axios, { AxiosError } from "axios";
22
import { ERROR } from "@/constants";
33
import { refresh } from "@/services/auth/auth.api";
44

@@ -10,14 +10,15 @@ export const http = axios.create({
1010
http.interceptors.response.use(
1111
(response) => response,
1212
async (error) => {
13-
const request = error.config;
14-
const { code } = error.response.data;
15-
const isAccessTokenExpiredError = code === ERROR.TOKEN_403_2;
13+
if (error instanceof AxiosError) {
14+
const request = error.config;
15+
const { code } = error.response?.data || { code: null };
16+
const isAccessTokenExpiredError = code === ERROR.TOKEN_403_2;
1617

17-
if (isAccessTokenExpiredError && !request.sent) {
18-
request.sent = true;
19-
request.headers.Authorization = await refresh();
20-
return http(request);
18+
if (isAccessTokenExpiredError && request) {
19+
request.headers.Authorization = await refresh();
20+
return http(request);
21+
}
2122
}
2223
return Promise.reject(error);
2324
},

apps/wiki/app/(docs)/[classify]/style.css.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { flex, font, theme, screen } from "@/styles";
1+
import { flex, font, theme, screen } from "@buma/style";
22
import { style } from "@vanilla-extract/css";
33

44
export const container = style({

apps/wiki/app/(docs)/docs/[title]/style.css.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { flex, font, theme, screen } from "@/styles";
1+
import { flex, font, theme, screen } from "@buma/style";
22
import { style } from "@vanilla-extract/css";
33

44
export const container = style({

apps/wiki/app/(user)/style.css.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { flex, font, theme } from "@/styles";
1+
import { flex, font, theme } from "@buma/style";
22
import { style } from "@vanilla-extract/css";
33

44
export const contributeBox = style({

apps/wiki/app/coin/TradeHistory.css.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { flex, font, theme, screen } from "@/styles";
1+
import { flex, font, theme, screen } from "@buma/style";
22
import { StyleVariantsType } from "@/types";
33
import { style, styleVariants } from "@vanilla-extract/css";
44

apps/wiki/app/coin/rank/style.css.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { flex, font, theme } from "@/styles";
1+
import { flex, font, theme } from "@buma/style";
22
import { StyleVariantsType } from "@/types";
33
import { style, styleVariants } from "@vanilla-extract/css";
44

apps/wiki/app/coin/style.css.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { flex, font, theme, screen } from "@/styles";
1+
import { flex, font, theme, screen } from "@buma/style";
22
import { StyleVariantsType } from "@/types";
33
import { style, styleVariants } from "@vanilla-extract/css";
44

apps/wiki/app/history/[title]/detail/[id]/style.css.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { flex, font, theme } from "@/styles";
1+
import { flex, font, theme } from "@buma/style";
22
import { StyleVariantsType } from "@/types";
33
import { style, styleVariants } from "@vanilla-extract/css";
44

apps/wiki/app/history/[title]/style.css.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { flex, font, theme } from "@/styles";
1+
import { flex, font, theme } from "@buma/style";
22
import { style } from "@vanilla-extract/css";
33

44
export const historyBox = style({

apps/wiki/app/layout.css.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { theme, flex, screen } from "@/styles";
1+
import { theme, flex, screen } from "@buma/style";
22
import { style } from "@vanilla-extract/css";
33

44
export const container = style({

apps/wiki/app/oauth/OAuth.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import { useSearchParams } from "next/navigation";
44
import { useEffect } from "react";
55
import { MoonLoader } from "react-spinners";
6-
import { theme } from "@/styles";
6+
import { theme } from "@buma/style";
77
import { useLoginMutation } from "@/services/auth/auth.mutation";
88
import * as styles from "./style.css";
99

apps/wiki/app/oauth/style.css.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { flex, font, theme } from "@/styles";
1+
import { flex, font, theme } from "@buma/style";
22
import { style } from "@vanilla-extract/css";
33

44
export const container = style({

apps/wiki/app/page.css.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { theme, font, flex, screen } from "@/styles";
1+
import { theme, font, flex, screen } from "@buma/style";
22
import { style } from "@vanilla-extract/css";
33

44
export const container = style({

apps/wiki/app/search/[keyword]/SearchResult.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import Container from "@/components/Container";
88
import { useQuery } from "@tanstack/react-query";
99
import { docsQuery } from "@/services/docs/docs.query";
1010
import { useRouter } from "next/navigation";
11-
import { theme } from "@/styles";
11+
import { theme } from "@buma/style";
1212
import { useDate } from "@/hooks";
1313
import { MoonLoader } from "react-spinners";
1414
import * as styles from "./style.css";

apps/wiki/app/search/[keyword]/style.css.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { flex, font, theme, screen } from "@/styles";
1+
import { flex, font, theme, screen } from "@buma/style";
22
import { style } from "@vanilla-extract/css";
33

44
export const container = style({

apps/wiki/components/(modal)/style.css.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { flex, font, theme } from "@/styles";
1+
import { flex, font, theme } from "@buma/style";
22
import { StyleVariantsType } from "@/types";
33
import { style, styleVariants } from "@vanilla-extract/css";
44

apps/wiki/components/Accordion/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { PropsWithChildren } from "react";
2-
import * as styles from "@/styles/document.css";
2+
import * as styles from "@/utils/document.css";
33
import { content } from "./style.css";
44

55
interface Props extends PropsWithChildren {

apps/wiki/components/Accordion/style.css.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { flex } from "@/styles";
1+
import { flex } from "@buma/style";
22
import { style } from "@vanilla-extract/css";
33

44
export const content = style({

apps/wiki/components/Aside/Aside.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { DocsListItemType } from "@/types";
77
import Link from "next/link";
88
import { ArrowIcon } from "@buma/icon";
99
import { useDate } from "@/hooks";
10-
import { theme } from "@/styles";
10+
import { theme } from "@buma/style";
1111
import * as styles from "./style.css";
1212

1313
const Aside = () => {

apps/wiki/components/Aside/style.css.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { style } from "@vanilla-extract/css";
2-
import { flex, font, theme, screen } from "@/styles";
2+
import { flex, font, theme, screen } from "@buma/style";
33

44
export const container = style({
55
width: "300px",

apps/wiki/components/Board/style.css.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { theme, flex, font, screen } from "@/styles";
1+
import { theme, flex, font, screen } from "@buma/style";
22
import { style } from "@vanilla-extract/css";
33

44
export const container = style({

apps/wiki/components/Container/style.css.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { theme, font, flex, screen } from "@/styles";
1+
import { theme, font, flex, screen } from "@buma/style";
22
import { style } from "@vanilla-extract/css";
33

44
export const container = style({

apps/wiki/components/Editor/DocsExample.css.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { flex, font, theme, screen } from "@/styles";
1+
import { flex, font, theme, screen } from "@buma/style";
22
import { StyleVariantsType } from "@/types";
33
import { style, styleVariants } from "@vanilla-extract/css";
44

apps/wiki/components/Editor/DocsExample.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { useState } from "react";
22
import { toast } from "react-toastify";
33
import { ArrowIcon } from "@buma/icon";
4-
import { theme } from "@/styles";
4+
import { theme } from "@buma/style";
55
import { documentCompiler } from "@/utils";
66
import Toastify from "../Toastify";
77
import * as styles from "./DocsExample.css";

apps/wiki/components/Editor/style.css.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { flex, font, theme, screen } from "@/styles";
1+
import { flex, font, theme, screen } from "@buma/style";
22
import { StyleVariantsType } from "@/types";
33
import { style, styleVariants } from "@vanilla-extract/css";
44

apps/wiki/components/Footer/style.css.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { font, flex, theme, screen } from "@/styles";
1+
import { font, flex, theme, screen } from "@buma/style";
22
import { style } from "@vanilla-extract/css";
33

44
export const container = style({

apps/wiki/components/FrameEditor/style.css.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { flex, font, theme, screen } from "@/styles";
1+
import { flex, font, theme, screen } from "@buma/style";
22
import { style } from "@vanilla-extract/css";
33

44
export const container = style({

apps/wiki/components/Header/style.css.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { theme, flex, font, screen } from "@/styles";
1+
import { theme, flex, font, screen } from "@buma/style";
22
import { style } from "@vanilla-extract/css";
33

44
export const container = style({

apps/wiki/components/Popular/style.css.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { style, styleVariants } from "@vanilla-extract/css";
2-
import { flex, font, theme, screen } from "@/styles";
2+
import { flex, font, theme, screen } from "@buma/style";
33
import { StyleVariantsType } from "@/types";
44
import { popularAnimation } from "./keyframes.css";
55

apps/wiki/components/ScrollButton/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"use client";
22

33
import { ArrowIcon } from "@buma/icon";
4-
import { theme } from "@/styles";
4+
import { theme } from "@buma/style";
55
import * as styles from "./style.css";
66

77
const ScrollButton = () => {

apps/wiki/components/ScrollButton/style.css.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { style } from "@vanilla-extract/css";
2-
import { flex, theme } from "@/styles";
2+
import { flex, theme } from "@buma/style";
33

44
export const container = style({
55
position: "fixed",

apps/wiki/components/Toastify/style.css.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { flex, font, screen, theme } from "@/styles";
1+
import { flex, font, screen, theme } from "@buma/style";
22
import { style } from "@vanilla-extract/css";
33

44
export const container = style({

apps/wiki/next.config.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const withVanillaExtract = createVanillaExtractPlugin({
66

77
/** @type {import('next').NextConfig} */
88
const nextConfig = withVanillaExtract({
9-
transpilePackages: ["@buma/icon"],
9+
transpilePackages: ["@buma/icon", "@buma/ui", "@buma/style"],
1010
swcMinify: true,
1111
images: {
1212
domains: [

apps/wiki/package.json

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
"lint": "next lint"
1111
},
1212
"dependencies": {
13+
"@buma/ui": "workspace:*",
14+
"@buma/style": "workspace:*",
1315
"@buma/icon": "workspace:*",
1416
"@next/third-parties": "^14.1.4",
1517
"@tanstack/react-query": "^5.24.6",

apps/wiki/styles/index.ts

-4
This file was deleted.

apps/wiki/styles/document.css.ts apps/wiki/utils/document.css.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { keyframes, style } from "@vanilla-extract/css";
2-
import { theme, font, flex, screen } from ".";
2+
import { theme, font, flex, screen } from "@buma/style";
33

44
export const details = style({
55
width: "100%",

apps/wiki/utils/documentCompiler.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { theme } from "@/styles";
2-
import * as styles from "@/styles/document.css";
1+
import { theme } from "@buma/style";
2+
import * as styles from "./document.css";
33

44
const deleteNotAllowedTag = (contents: string) => {
55
return contents

packages/icon/package.json

+3
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,8 @@
1717
"eslint": "^8.57.0",
1818
"react": "^18.2.0",
1919
"typescript": "^5.3.3"
20+
},
21+
"dependencies": {
22+
"next": "14.1.4"
2023
}
2124
}

packages/style/.eslintrc.cjs

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/** @type {import('eslint').Linter.Config} */
2+
module.exports = {
3+
root: true,
4+
extends: ["@buma/eslint-config/react-ts"],
5+
};

packages/style/index.ts

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export { default as flex } from "./src/flex";
2+
export { default as font } from "./src/font";
3+
export { default as theme } from "./src/theme";
4+
export { default as screen } from "./src/screen";

packages/style/package.json

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"name": "@buma/style",
3+
"version": "0.0.0",
4+
"private": true,
5+
"scripts": {
6+
"lint": "eslint \"**/*.ts*\"",
7+
"generate:component": "turbo gen react-component"
8+
},
9+
"devDependencies": {
10+
"@buma/eslint-config": "workspace:*",
11+
"@buma/typescript-config": "workspace:*",
12+
"@turbo/gen": "^1.12.4",
13+
"@types/node": "^20.11.24",
14+
"@types/eslint": "^8.56.5",
15+
"@types/react": "^18.2.61",
16+
"@types/react-dom": "^18.2.19",
17+
"eslint": "^8.57.0",
18+
"react": "^18.2.0",
19+
"typescript": "^5.3.3"
20+
},
21+
"dependencies": {
22+
"@vanilla-extract/css": "^1.14.1",
23+
"@vanilla-extract/next-plugin": "^2.3.6"
24+
}
25+
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

packages/style/tsconfig.json

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"extends": "@buma/typescript-config/react-library.json",
3+
"include": ["."],
4+
"exclude": ["dist", "build", "node_modules"]
5+
}

packages/ui/.eslintrc.cjs

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/** @type {import('eslint').Linter.Config} */
2+
module.exports = {
3+
root: true,
4+
extends: ["@buma/eslint-config/react-ts"],
5+
};

packages/ui/index.ts

Whitespace-only changes.

packages/ui/package.json

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"name": "@buma/ui",
3+
"version": "0.0.0",
4+
"private": true,
5+
"scripts": {
6+
"lint": "eslint \"**/*.ts*\"",
7+
"generate:component": "turbo gen react-component"
8+
},
9+
"devDependencies": {
10+
"@buma/eslint-config": "workspace:*",
11+
"@buma/typescript-config": "workspace:*",
12+
"@turbo/gen": "^1.12.4",
13+
"@types/node": "^20.11.24",
14+
"@types/eslint": "^8.56.5",
15+
"@types/react": "^18.2.61",
16+
"@types/react-dom": "^18.2.19",
17+
"eslint": "^8.57.0",
18+
"react": "^18.2.0",
19+
"typescript": "^5.3.3"
20+
},
21+
"dependencies": {
22+
"@vanilla-extract/css": "^1.14.1",
23+
"@vanilla-extract/next-plugin": "^2.3.6"
24+
}
25+
}

packages/ui/src/Navigator/index.tsx

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// import * as styles from "./style.css";
2+
3+
const Navigator = () => {
4+
// return <header className={styles.container}>asd</header>;
5+
return <header>asd</header>;
6+
};
7+
8+
export default Navigator;
+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// import { style } from "@vanilla-extract/css";
2+
// import { flex, font } from "@buma/style";
3+
4+
// export const container = style({
5+
// width: "100%",
6+
// height: "32px",
7+
// padding: "0 4vw",
8+
// gap: "14px",
9+
// ...flex.VERTICAL,
10+
// });
11+
12+
// export const hgroup = style({
13+
// gap: "4px",
14+
// ...font.H6,
15+
// ...flex.VERTICAL,
16+
// });

packages/ui/tsconfig.json

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"extends": "@buma/typescript-config/react-library.json",
3+
"include": ["."],
4+
"exclude": ["dist", "build", "node_modules"]
5+
}

0 commit comments

Comments
 (0)