From 7b995c446860f8a98da316680f182e24d26768fc Mon Sep 17 00:00:00 2001 From: nakaterm <104970808+nakaterm@users.noreply.github.com> Date: Sat, 14 Jun 2025 19:00:49 +0900 Subject: [PATCH 1/7] =?UTF-8?q?chore:=20staging=20=E3=81=AE=20API=20?= =?UTF-8?q?=E3=82=A8=E3=83=B3=E3=83=89=E3=83=9D=E3=82=A4=E3=83=B3=E3=83=88?= =?UTF-8?q?=E8=A8=AD=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/wrangler.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/wrangler.toml b/client/wrangler.toml index f146abd..da06d66 100644 --- a/client/wrangler.toml +++ b/client/wrangler.toml @@ -7,7 +7,7 @@ pages_build_output_dir = "./dist" VITE_API_ENDPOINT = "https://api.itsuhima.utcode.net" [env.preview.vars] -VITE_API_ENDPOINT = "" +VITE_API_ENDPOINT = "https://api.itsuhima-staging.utcode.net" [vars] VITE_API_ENDPOINT = "http://localhost:3000" \ No newline at end of file From 53b6fb705a7dbe3afdfc4651b7ca5bd5f662368e Mon Sep 17 00:00:00 2001 From: nakaterm <104970808+nakaterm@users.noreply.github.com> Date: Sat, 14 Jun 2025 19:20:42 +0900 Subject: [PATCH 2/7] =?UTF-8?q?feat:=20OG=20=E3=81=AE=E6=99=82=E9=96=93?= =?UTF-8?q?=E5=B8=AF=E3=82=92=E5=89=8A=E9=99=A4=E3=80=81=E6=97=A5=E4=BB=98?= =?UTF-8?q?=E3=81=AE=20TZ=20=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/functions/[[path]].ts | 25 ++++++++----------------- package.json | 1 + 2 files changed, 9 insertions(+), 17 deletions(-) diff --git a/client/functions/[[path]].ts b/client/functions/[[path]].ts index 9c5691e..35b5756 100644 --- a/client/functions/[[path]].ts +++ b/client/functions/[[path]].ts @@ -47,16 +47,15 @@ class OGDescriptionRewriter { } } -// 日付を YYYY/MM/DD 形式にフォーマット +// 日付を YYYY/MM/DD 形式にフォーマット(日本時間) function formatDate(dateString: string): string { const date = new Date(dateString); - return `${date.getFullYear()}/${String(date.getMonth() + 1).padStart(2, "0")}/${String(date.getDate()).padStart(2, "0")}`; -} - -// 時刻を HH:MM 形式にフォーマット -function formatTime(dateString: string): string { - const date = new Date(dateString); - return `${String(date.getHours()).padStart(2, "0")}:${String(date.getMinutes()).padStart(2, "0")}`; + return new Intl.DateTimeFormat("ja-JP", { + year: "numeric", + month: "2-digit", + day: "2-digit", + timeZone: "Asia/Tokyo", + }).format(date).replace(/-/g, "/"); } // プロジェクト情報を取得 @@ -138,15 +137,7 @@ export async function onRequest(context: EventContext): Promise 0) { - const range = projectData.allowedRanges[0]; - const startTime = formatTime(range.startTime); - const endTime = formatTime(range.endTime); - timeRange = `${startTime} - ${endTime}`; - } - - const ogDescription = timeRange ? `日程: ${dateRange} | 時間: ${timeRange}` : `日程: ${dateRange}`; + const ogDescription = `日程範囲: ${dateRange}`; return new HTMLRewriter() .on('meta[property="og:title"]', new OGTitleRewriter(ogTitle)) diff --git a/package.json b/package.json index 75b563b..8264941 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,7 @@ "workspaces": ["client", "server", "common"], "scripts": { "dev": "concurrently --kill-others 'npm run dev:server' 'npm run dev:client'", + "dev:client-og": "cd client && npm run build && npx wrangler pages dev dist --compatibility-date=2024-12-01", "dev:server": "cd server && npm run dev", "dev:client": "cd client && npm run dev", "check": "npx biome check", From 170801b186cf5353870a74397953f011ea971c45 Mon Sep 17 00:00:00 2001 From: nakaterm <104970808+nakaterm@users.noreply.github.com> Date: Sat, 14 Jun 2025 19:23:49 +0900 Subject: [PATCH 3/7] chore: bump vite to 6.3.5 --- client/package.json | 2 +- package-lock.json | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/client/package.json b/client/package.json index 4d469ca..4ad88f1 100644 --- a/client/package.json +++ b/client/package.json @@ -42,6 +42,6 @@ "globals": "^15.15.0", "typescript": "~5.7.2", "typescript-eslint": "^8.24.1", - "vite": "^6.2.3" + "vite": "^6.3.5" } } diff --git a/package-lock.json b/package-lock.json index 1d665dd..42bb661 100644 --- a/package-lock.json +++ b/package-lock.json @@ -49,7 +49,7 @@ "globals": "^15.15.0", "typescript": "~5.7.2", "typescript-eslint": "^8.24.1", - "vite": "^6.2.3" + "vite": "^6.3.5" } }, "common": { @@ -6154,10 +6154,9 @@ } }, "node_modules/vite": { - "version": "6.3.3", - "resolved": "https://registry.npmjs.org/vite/-/vite-6.3.3.tgz", - "integrity": "sha512-5nXH+QsELbFKhsEfWLkHrvgRpTdGJzqOZ+utSdmPTvwHmvU6ITTm3xx+mRusihkcI8GeC7lCDyn3kDtiki9scw==", - "license": "MIT", + "version": "6.3.5", + "resolved": "https://registry.npmjs.org/vite/-/vite-6.3.5.tgz", + "integrity": "sha512-cZn6NDFE7wdTpINgs++ZJ4N49W2vRp8LCKrn3Ob1kYNtOo21vfDoaV5GzBfLU4MovSAB8uNRm4jgzVQZ+mBzPQ==", "dependencies": { "esbuild": "^0.25.0", "fdir": "^6.4.4", From a6a85ccde2da84b1c74dce97b23392edde2d7bf5 Mon Sep 17 00:00:00 2001 From: nakaterm <104970808+nakaterm@users.noreply.github.com> Date: Sat, 14 Jun 2025 20:12:00 +0900 Subject: [PATCH 4/7] chore: local DB --- compose.yml | 15 +++++++++++++++ package.json | 2 +- server/.env.sample | 4 ++-- 3 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 compose.yml diff --git a/compose.yml b/compose.yml new file mode 100644 index 0000000..20f8f4a --- /dev/null +++ b/compose.yml @@ -0,0 +1,15 @@ +services: + postgres: + image: postgres:16-alpine + container_name: itsuhima-postgres + environment: + POSTGRES_DB: itsuhima_dev + POSTGRES_USER: postgres + POSTGRES_PASSWORD: password + ports: + - "5432:5432" + volumes: + - postgres_data:/var/lib/postgresql/data + +volumes: + postgres_data: \ No newline at end of file diff --git a/package.json b/package.json index 8264941..cbe1dc2 100644 --- a/package.json +++ b/package.json @@ -3,10 +3,10 @@ "version": "1.0.0", "workspaces": ["client", "server", "common"], "scripts": { - "dev": "concurrently --kill-others 'npm run dev:server' 'npm run dev:client'", "dev:client-og": "cd client && npm run build && npx wrangler pages dev dist --compatibility-date=2024-12-01", "dev:server": "cd server && npm run dev", "dev:client": "cd client && npm run dev", + "dev:db": "docker compose up", "check": "npx biome check", "fix": "npx @biomejs/biome check --fix --unsafe", "fix:safe": "npx @biomejs/biome check --fix" diff --git a/server/.env.sample b/server/.env.sample index 12bd0ef..6e54204 100644 --- a/server/.env.sample +++ b/server/.env.sample @@ -1,5 +1,5 @@ -DATABASE_URL= +DATABASE_URL=postgresql://postgres:password@localhost:5432/itsuhima_dev CORS_ALLOW_ORIGINS=http://localhost:5173 DOMAIN=localhost NODE_ENV=dev # dev or prod -COOKIE_SECRET= +COOKIE_SECRET=your-random-secret-key-for-development From 65833897b5f23f2bc02f233e0f0f72888411a983 Mon Sep 17 00:00:00 2001 From: nakaterm <104970808+nakaterm@users.noreply.github.com> Date: Sat, 14 Jun 2025 21:41:18 +0900 Subject: [PATCH 5/7] =?UTF-8?q?fix:=20=E7=92=B0=E5=A2=83=E5=A4=89=E6=95=B0?= =?UTF-8?q?=E3=81=AE=E8=A8=AD=E5=AE=9A=E6=96=B9=E6=B3=95=E3=82=92=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/{.env.sample => .env.local.sample} | 0 client/.env.preview | 2 ++ client/.env.production | 2 ++ client/build.sh | 5 +++++ client/functions/[[path]].ts | 4 ++-- client/package.json | 3 +++ client/wrangler.toml | 6 +++--- package.json | 3 ++- 8 files changed, 19 insertions(+), 6 deletions(-) rename client/{.env.sample => .env.local.sample} (100%) create mode 100644 client/.env.preview create mode 100644 client/.env.production create mode 100644 client/build.sh diff --git a/client/.env.sample b/client/.env.local.sample similarity index 100% rename from client/.env.sample rename to client/.env.local.sample diff --git a/client/.env.preview b/client/.env.preview new file mode 100644 index 0000000..831fe4f --- /dev/null +++ b/client/.env.preview @@ -0,0 +1,2 @@ +VITE_API_ENDPOINT=https://api.itsuhima-staging.utcode.net +VITE_FRONTEND_ORIGIN=https://itsuhima-staging.utcode.net diff --git a/client/.env.production b/client/.env.production new file mode 100644 index 0000000..3fdbb58 --- /dev/null +++ b/client/.env.production @@ -0,0 +1,2 @@ +VITE_API_ENDPOINT=https://api.itsuhima.utcode.net +VITE_FRONTEND_ORIGIN=https://itsuhima.utcode.net diff --git a/client/build.sh b/client/build.sh new file mode 100644 index 0000000..ed6334f --- /dev/null +++ b/client/build.sh @@ -0,0 +1,5 @@ +if [[ "$CF_PAGES_BRANCH" == "main" ]]; then + npm run build +else + npm run build:preview +fi diff --git a/client/functions/[[path]].ts b/client/functions/[[path]].ts index 35b5756..45dad17 100644 --- a/client/functions/[[path]].ts +++ b/client/functions/[[path]].ts @@ -1,7 +1,7 @@ /// interface Env { - VITE_API_ENDPOINT: string; + API_ENDPOINT: string; } interface ProjectData { @@ -123,7 +123,7 @@ export async function onRequest(context: EventContext): Promise Date: Sat, 14 Jun 2025 21:52:24 +0900 Subject: [PATCH 6/7] fix: format --- client/functions/[[path]].ts | 4 +++- package.json | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/client/functions/[[path]].ts b/client/functions/[[path]].ts index 45dad17..a62c0f3 100644 --- a/client/functions/[[path]].ts +++ b/client/functions/[[path]].ts @@ -55,7 +55,9 @@ function formatDate(dateString: string): string { month: "2-digit", day: "2-digit", timeZone: "Asia/Tokyo", - }).format(date).replace(/-/g, "/"); + }) + .format(date) + .replace(/-/g, "/"); } // プロジェクト情報を取得 diff --git a/package.json b/package.json index 582d001..437529c 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "workspaces": ["client", "server", "common"], "scripts": { "watch:client": "cd client && npm run build:local:watch", - "dev:functions" : "cd client && npx wrangler pages dev dist --compatibility-date=2024-12-01", + "dev:functions": "cd client && npx wrangler pages dev dist --compatibility-date=2024-12-01", "dev:server": "cd server && npm run dev", "dev:client": "cd client && npm run dev", "dev:db": "docker compose up", From 4a92089133b351194f82af48d49e919316d98878 Mon Sep 17 00:00:00 2001 From: nakaterm <104970808+nakaterm@users.noreply.github.com> Date: Sat, 14 Jun 2025 21:53:21 +0900 Subject: [PATCH 7/7] fix: update bun.lock --- bun.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bun.lock b/bun.lock index fac1119..013eda6 100644 --- a/bun.lock +++ b/bun.lock @@ -41,7 +41,7 @@ "globals": "^15.15.0", "typescript": "~5.7.2", "typescript-eslint": "^8.24.1", - "vite": "^6.2.3", + "vite": "^6.3.5", }, }, "common": { @@ -944,7 +944,7 @@ "vary": ["vary@1.1.2", "", {}, "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg=="], - "vite": ["vite@6.3.3", "", { "dependencies": { "esbuild": "^0.25.0", "fdir": "^6.4.4", "picomatch": "^4.0.2", "postcss": "^8.5.3", "rollup": "^4.34.9", "tinyglobby": "^0.2.13" }, "optionalDependencies": { "fsevents": "~2.3.3" }, "peerDependencies": { "@types/node": "^18.0.0 || ^20.0.0 || >=22.0.0", "jiti": ">=1.21.0", "less": "*", "lightningcss": "^1.21.0", "sass": "*", "sass-embedded": "*", "stylus": "*", "sugarss": "*", "terser": "^5.16.0", "tsx": "^4.8.1", "yaml": "^2.4.2" }, "optionalPeers": ["@types/node", "jiti", "less", "lightningcss", "sass", "sass-embedded", "stylus", "sugarss", "terser", "tsx", "yaml"], "bin": { "vite": "bin/vite.js" } }, "sha512-5nXH+QsELbFKhsEfWLkHrvgRpTdGJzqOZ+utSdmPTvwHmvU6ITTm3xx+mRusihkcI8GeC7lCDyn3kDtiki9scw=="], + "vite": ["vite@6.3.5", "", { "dependencies": { "esbuild": "^0.25.0", "fdir": "^6.4.4", "picomatch": "^4.0.2", "postcss": "^8.5.3", "rollup": "^4.34.9", "tinyglobby": "^0.2.13" }, "optionalDependencies": { "fsevents": "~2.3.3" }, "peerDependencies": { "@types/node": "^18.0.0 || ^20.0.0 || >=22.0.0", "jiti": ">=1.21.0", "less": "*", "lightningcss": "^1.21.0", "sass": "*", "sass-embedded": "*", "stylus": "*", "sugarss": "*", "terser": "^5.16.0", "tsx": "^4.8.1", "yaml": "^2.4.2" }, "optionalPeers": ["@types/node", "jiti", "less", "lightningcss", "sass", "sass-embedded", "stylus", "sugarss", "terser", "tsx", "yaml"], "bin": { "vite": "bin/vite.js" } }, "sha512-cZn6NDFE7wdTpINgs++ZJ4N49W2vRp8LCKrn3Ob1kYNtOo21vfDoaV5GzBfLU4MovSAB8uNRm4jgzVQZ+mBzPQ=="], "which": ["which@2.0.2", "", { "dependencies": { "isexe": "^2.0.0" }, "bin": { "node-which": "./bin/node-which" } }, "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA=="],