create-sonamu 0.0.2 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/template/src/packages/api/package.json +28 -28
- package/template/src/packages/api/package.json.bak +55 -0
- package/template/src/packages/web/package.json +33 -33
- package/template/src/packages/web/package.json.bak +49 -0
- package/template/src/packages/web/src/entry-client.tsx +30 -24
- package/template/src/packages/web/src/styles/tailwind.css +6 -0
package/package.json
CHANGED
|
@@ -21,35 +21,35 @@
|
|
|
21
21
|
"docker:down": "docker compose --env-file .env -f database/docker-compose.yml down"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@ai-sdk/anthropic": "
|
|
25
|
-
"@ai-sdk/openai": "
|
|
26
|
-
"@ai-sdk/provider": "
|
|
27
|
-
"@ai-sdk/provider-utils": "
|
|
28
|
-
"@logtape/logtape": "
|
|
29
|
-
"@logtape/pretty": "
|
|
30
|
-
"@logtape/redaction": "
|
|
31
|
-
"@swc/core": "
|
|
32
|
-
"ai": "
|
|
33
|
-
"bcrypt": "
|
|
34
|
-
"chalk": "
|
|
35
|
-
"date-fns": "
|
|
36
|
-
"dotenv": "
|
|
37
|
-
"knex": "
|
|
38
|
-
"pg": "
|
|
39
|
-
"radashi": "
|
|
40
|
-
"sonamu": "
|
|
41
|
-
"zod": "
|
|
24
|
+
"@ai-sdk/anthropic": "^3.0.0",
|
|
25
|
+
"@ai-sdk/openai": "^3.0.0",
|
|
26
|
+
"@ai-sdk/provider": "^3.0.0",
|
|
27
|
+
"@ai-sdk/provider-utils": "^4.0.0",
|
|
28
|
+
"@logtape/logtape": "2.0.0",
|
|
29
|
+
"@logtape/pretty": "2.0.0",
|
|
30
|
+
"@logtape/redaction": "2.0.0",
|
|
31
|
+
"@swc/core": "^1.13.5",
|
|
32
|
+
"ai": "^6.0.1",
|
|
33
|
+
"bcrypt": "^6.0.0",
|
|
34
|
+
"chalk": "^4.1.2",
|
|
35
|
+
"date-fns": "^4.1.0",
|
|
36
|
+
"dotenv": "^16",
|
|
37
|
+
"knex": "^3.1.0",
|
|
38
|
+
"pg": "^8.16.3",
|
|
39
|
+
"radashi": "^12.2.0",
|
|
40
|
+
"sonamu": "^0.7.45",
|
|
41
|
+
"zod": "^4.1.12"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@fastify/compress": "
|
|
45
|
-
"@swc/cli": "
|
|
46
|
-
"@types/bcrypt": "
|
|
47
|
-
"@types/node": "
|
|
48
|
-
"@vitest/coverage-v8": "
|
|
49
|
-
"fastify": "
|
|
50
|
-
"ioredis": "
|
|
51
|
-
"typescript": "
|
|
52
|
-
"vite": "
|
|
53
|
-
"vitest": "
|
|
44
|
+
"@fastify/compress": "^7.0.3",
|
|
45
|
+
"@swc/cli": "^0.7.8",
|
|
46
|
+
"@types/bcrypt": "^6",
|
|
47
|
+
"@types/node": "25.0.7",
|
|
48
|
+
"@vitest/coverage-v8": "^4.0.12",
|
|
49
|
+
"fastify": "^4",
|
|
50
|
+
"ioredis": "^5.8.2",
|
|
51
|
+
"typescript": "^5.9.3",
|
|
52
|
+
"vite": "7.3.0",
|
|
53
|
+
"vitest": "^4.0.10"
|
|
54
54
|
}
|
|
55
55
|
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "create-sonamu-api",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"description": "Sonamu API server",
|
|
8
|
+
"scripts": {
|
|
9
|
+
"dev": "sonamu dev",
|
|
10
|
+
"build": "sonamu build",
|
|
11
|
+
"start": "sonamu start",
|
|
12
|
+
"test": "vitest run",
|
|
13
|
+
"test:watch": "vitest watch --standalone",
|
|
14
|
+
"test:coverage": "vitest run --coverage",
|
|
15
|
+
"sonamu": "sonamu",
|
|
16
|
+
"dump": "bash database/scripts/dump.sh",
|
|
17
|
+
"seedOnly": "bash database/scripts/seed.sh",
|
|
18
|
+
"seed": "pnpm seedOnly && sonamu fixture sync",
|
|
19
|
+
"sync:dump": "pnpm seed && pnpm sonamu migrate run && pnpm dump",
|
|
20
|
+
"docker:up": "docker compose --env-file .env -f database/docker-compose.yml up -d",
|
|
21
|
+
"docker:down": "docker compose --env-file .env -f database/docker-compose.yml down"
|
|
22
|
+
},
|
|
23
|
+
"dependencies": {
|
|
24
|
+
"@ai-sdk/anthropic": "catalog:",
|
|
25
|
+
"@ai-sdk/openai": "catalog:",
|
|
26
|
+
"@ai-sdk/provider": "catalog:",
|
|
27
|
+
"@ai-sdk/provider-utils": "catalog:",
|
|
28
|
+
"@logtape/logtape": "catalog:",
|
|
29
|
+
"@logtape/pretty": "catalog:",
|
|
30
|
+
"@logtape/redaction": "catalog:",
|
|
31
|
+
"@swc/core": "catalog:",
|
|
32
|
+
"ai": "catalog:",
|
|
33
|
+
"bcrypt": "catalog:",
|
|
34
|
+
"chalk": "catalog:",
|
|
35
|
+
"date-fns": "catalog:",
|
|
36
|
+
"dotenv": "catalog:",
|
|
37
|
+
"knex": "catalog:",
|
|
38
|
+
"pg": "catalog:",
|
|
39
|
+
"radashi": "catalog:",
|
|
40
|
+
"sonamu": "workspace:^",
|
|
41
|
+
"zod": "catalog:"
|
|
42
|
+
},
|
|
43
|
+
"devDependencies": {
|
|
44
|
+
"@fastify/compress": "catalog:",
|
|
45
|
+
"@swc/cli": "catalog:",
|
|
46
|
+
"@types/bcrypt": "catalog:",
|
|
47
|
+
"@types/node": "catalog:",
|
|
48
|
+
"@vitest/coverage-v8": "catalog:",
|
|
49
|
+
"fastify": "catalog:",
|
|
50
|
+
"ioredis": "catalog:",
|
|
51
|
+
"typescript": "catalog:",
|
|
52
|
+
"vite": "catalog:",
|
|
53
|
+
"vitest": "catalog:"
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -10,40 +10,40 @@
|
|
|
10
10
|
"preview": "vite preview"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@sonamu-kit/react-components": "
|
|
14
|
-
"@tanstack/react-query": "
|
|
15
|
-
"@tanstack/react-router": "
|
|
16
|
-
"axios": "
|
|
17
|
-
"clsx": "
|
|
18
|
-
"dotenv": "
|
|
19
|
-
"eventsource": "
|
|
20
|
-
"jotai": "
|
|
21
|
-
"qs": "
|
|
22
|
-
"radashi": "
|
|
23
|
-
"react": "
|
|
24
|
-
"react-day-picker": "
|
|
25
|
-
"react-dom": "
|
|
26
|
-
"tailwind-merge": "
|
|
27
|
-
"zod": "
|
|
13
|
+
"@sonamu-kit/react-components": "^0.1.6",
|
|
14
|
+
"@tanstack/react-query": "^5.90.12",
|
|
15
|
+
"@tanstack/react-router": "1.143.11",
|
|
16
|
+
"axios": "^1.13.2",
|
|
17
|
+
"clsx": "^2.1.1",
|
|
18
|
+
"dotenv": "^16",
|
|
19
|
+
"eventsource": "^4.1.0",
|
|
20
|
+
"jotai": "^2.14.0",
|
|
21
|
+
"qs": "^6.14.1",
|
|
22
|
+
"radashi": "^12.2.0",
|
|
23
|
+
"react": "^19.2.3",
|
|
24
|
+
"react-day-picker": "^8.10.1",
|
|
25
|
+
"react-dom": "^19.2.3",
|
|
26
|
+
"tailwind-merge": "^3.4.0",
|
|
27
|
+
"zod": "^4.1.12"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@iconify/json": "
|
|
31
|
-
"@svgr/core": "
|
|
32
|
-
"@svgr/plugin-jsx": "
|
|
33
|
-
"@svgr/plugin-svgo": "
|
|
34
|
-
"@tailwindcss/postcss": "
|
|
35
|
-
"@tailwindcss/vite": "
|
|
36
|
-
"@tanstack/react-router-devtools": "
|
|
37
|
-
"@tanstack/router-plugin": "
|
|
38
|
-
"@types/node": "
|
|
39
|
-
"@types/qs": "
|
|
40
|
-
"@types/react": "
|
|
41
|
-
"@types/react-dom": "
|
|
42
|
-
"@vitejs/plugin-react-swc": "
|
|
43
|
-
"sass": "
|
|
44
|
-
"tailwindcss": "
|
|
45
|
-
"typescript": "
|
|
46
|
-
"unplugin-icons": "
|
|
47
|
-
"vite": "
|
|
30
|
+
"@iconify/json": "^2.2.421",
|
|
31
|
+
"@svgr/core": "^8.1.0",
|
|
32
|
+
"@svgr/plugin-jsx": "^8.1.0",
|
|
33
|
+
"@svgr/plugin-svgo": "^8.1.0",
|
|
34
|
+
"@tailwindcss/postcss": "^4.0.0",
|
|
35
|
+
"@tailwindcss/vite": "^4.1.17",
|
|
36
|
+
"@tanstack/react-router-devtools": "1.143.11",
|
|
37
|
+
"@tanstack/router-plugin": "1.143.11",
|
|
38
|
+
"@types/node": "25.0.7",
|
|
39
|
+
"@types/qs": "^6.14.0",
|
|
40
|
+
"@types/react": "^19.2.7",
|
|
41
|
+
"@types/react-dom": "^19.2.3",
|
|
42
|
+
"@vitejs/plugin-react-swc": "^4.1.3",
|
|
43
|
+
"sass": "^1.92.1",
|
|
44
|
+
"tailwindcss": "^4.0.0",
|
|
45
|
+
"typescript": "^5.9.3",
|
|
46
|
+
"unplugin-icons": "0.20.2",
|
|
47
|
+
"vite": "7.3.0"
|
|
48
48
|
}
|
|
49
49
|
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "create-sonamu-web",
|
|
3
|
+
"private": true,
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"description": "Sonamu web client",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"dev": "vite",
|
|
9
|
+
"build": "tsc && vite build",
|
|
10
|
+
"preview": "vite preview"
|
|
11
|
+
},
|
|
12
|
+
"dependencies": {
|
|
13
|
+
"@sonamu-kit/react-components": "workspace:^",
|
|
14
|
+
"@tanstack/react-query": "catalog:",
|
|
15
|
+
"@tanstack/react-router": "catalog:",
|
|
16
|
+
"axios": "catalog:",
|
|
17
|
+
"clsx": "catalog:",
|
|
18
|
+
"dotenv": "catalog:",
|
|
19
|
+
"eventsource": "catalog:",
|
|
20
|
+
"jotai": "catalog:",
|
|
21
|
+
"qs": "catalog:",
|
|
22
|
+
"radashi": "catalog:",
|
|
23
|
+
"react": "catalog:",
|
|
24
|
+
"react-day-picker": "catalog:",
|
|
25
|
+
"react-dom": "catalog:",
|
|
26
|
+
"tailwind-merge": "catalog:",
|
|
27
|
+
"zod": "catalog:"
|
|
28
|
+
},
|
|
29
|
+
"devDependencies": {
|
|
30
|
+
"@iconify/json": "catalog:",
|
|
31
|
+
"@svgr/core": "catalog:",
|
|
32
|
+
"@svgr/plugin-jsx": "catalog:",
|
|
33
|
+
"@svgr/plugin-svgo": "catalog:",
|
|
34
|
+
"@tailwindcss/postcss": "catalog:",
|
|
35
|
+
"@tailwindcss/vite": "catalog:",
|
|
36
|
+
"@tanstack/react-router-devtools": "catalog:",
|
|
37
|
+
"@tanstack/router-plugin": "catalog:",
|
|
38
|
+
"@types/node": "catalog:",
|
|
39
|
+
"@types/qs": "catalog:",
|
|
40
|
+
"@types/react": "catalog:",
|
|
41
|
+
"@types/react-dom": "catalog:",
|
|
42
|
+
"@vitejs/plugin-react-swc": "catalog:",
|
|
43
|
+
"sass": "catalog:",
|
|
44
|
+
"tailwindcss": "catalog:",
|
|
45
|
+
"typescript": "catalog:",
|
|
46
|
+
"unplugin-icons": "catalog:",
|
|
47
|
+
"vite": "catalog:"
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -3,11 +3,12 @@ import { createRouter, RouterProvider } from "@tanstack/react-router";
|
|
|
3
3
|
import ReactDOM from "react-dom/client";
|
|
4
4
|
import { routeTree } from "./routeTree.gen";
|
|
5
5
|
import "./styles/tailwind.css";
|
|
6
|
+
import { dateReviver } from "./services/sonamu.shared";
|
|
6
7
|
|
|
7
|
-
// SSR
|
|
8
|
+
// SSR 데이터 타입
|
|
8
9
|
declare global {
|
|
9
10
|
interface Window {
|
|
10
|
-
// biome-ignore lint/suspicious/noExplicitAny: SSR
|
|
11
|
+
// biome-ignore lint/suspicious/noExplicitAny: SSR 데이터를 any 타입으로 받아야 함
|
|
11
12
|
__SONAMU_SSR__?: any;
|
|
12
13
|
__SONAMU_SSR_CONFIG__?: {
|
|
13
14
|
disableHydrate?: boolean;
|
|
@@ -15,19 +16,7 @@ declare global {
|
|
|
15
16
|
}
|
|
16
17
|
}
|
|
17
18
|
|
|
18
|
-
//
|
|
19
|
-
// biome-ignore lint/suspicious/noExplicitAny: reviver needs to handle any type
|
|
20
|
-
function dateReviver(_key: string, value: any) {
|
|
21
|
-
if (typeof value === "string") {
|
|
22
|
-
const datePattern = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/;
|
|
23
|
-
if (datePattern.test(value)) {
|
|
24
|
-
return new Date(value);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
return value;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
// Create QueryClient
|
|
19
|
+
// QueryClient 생성
|
|
31
20
|
const queryClient = new QueryClient({
|
|
32
21
|
defaultOptions: {
|
|
33
22
|
queries: {
|
|
@@ -38,7 +27,7 @@ const queryClient = new QueryClient({
|
|
|
38
27
|
},
|
|
39
28
|
});
|
|
40
29
|
|
|
41
|
-
//
|
|
30
|
+
// SSR 데이터 복원
|
|
42
31
|
const dehydratedState = window.__SONAMU_SSR__
|
|
43
32
|
? JSON.parse(JSON.stringify(window.__SONAMU_SSR__), dateReviver)
|
|
44
33
|
: undefined;
|
|
@@ -46,10 +35,10 @@ if (dehydratedState) {
|
|
|
46
35
|
hydrate(queryClient, dehydratedState);
|
|
47
36
|
}
|
|
48
37
|
|
|
49
|
-
//
|
|
38
|
+
// SSR Config 확인
|
|
50
39
|
const ssrConfig = window.__SONAMU_SSR_CONFIG__;
|
|
51
40
|
|
|
52
|
-
//
|
|
41
|
+
// Router 생성
|
|
53
42
|
const router = createRouter({
|
|
54
43
|
routeTree,
|
|
55
44
|
context: { queryClient },
|
|
@@ -62,11 +51,28 @@ declare module "@tanstack/react-router" {
|
|
|
62
51
|
}
|
|
63
52
|
}
|
|
64
53
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
54
|
+
await router.load();
|
|
55
|
+
|
|
56
|
+
// SSR/CSR 모두 document 전체에 렌더링
|
|
57
|
+
if (document.documentElement.innerHTML && dehydratedState) {
|
|
58
|
+
// SSR 페이지
|
|
59
|
+
if (ssrConfig?.disableHydrate) {
|
|
60
|
+
// disableHydrate: document 전체 새로 렌더링
|
|
61
|
+
console.log("[Sonamu] Hydration disabled, rendering as CSR");
|
|
62
|
+
ReactDOM.createRoot(document).render(<RouterProvider router={router} />);
|
|
63
|
+
} else {
|
|
64
|
+
// 정상 hydration: document 전체 hydrate
|
|
65
|
+
ReactDOM.hydrateRoot(document, <RouterProvider router={router} />);
|
|
66
|
+
}
|
|
70
67
|
} else {
|
|
71
|
-
|
|
68
|
+
// Pure CSR 페이지: document 전체 렌더링
|
|
69
|
+
ReactDOM.createRoot(document).render(<RouterProvider router={router} />);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// Chrome Extension용 Devtools
|
|
73
|
+
declare global {
|
|
74
|
+
interface Window {
|
|
75
|
+
__TANSTACK_QUERY_CLIENT__: typeof queryClient;
|
|
76
|
+
}
|
|
72
77
|
}
|
|
78
|
+
window.__TANSTACK_QUERY_CLIENT__ = queryClient;
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
/* Tailwind CSS Configuration */
|
|
2
2
|
|
|
3
|
+
/* react-components 스타일 import */
|
|
4
|
+
@import "@sonamu-kit/react-components/styles";
|
|
5
|
+
|
|
3
6
|
/* Tailwind v4: Source paths */
|
|
4
7
|
@source "../../src/**/*.tsx";
|
|
5
8
|
@source "../../src/**/*.ts";
|
|
9
|
+
|
|
10
|
+
/* node_modules 내의 react-components 패키지 */
|
|
11
|
+
@source "../../node_modules/@sonamu-kit/react-components/dist/**/*.js";
|