From 51c2a65ad13f96389997bff8c4db937f42a3b9b3 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Fri, 13 Feb 2026 22:46:05 +0900 Subject: refactor(frontend): replace process.env with import.meta.env in API client MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit BFF前提のURL分岐をVite SPA向けに調整。本番URLのハードコードを VITE_API_BASE_URL環境変数に外出し。 Co-Authored-By: Claude Opus 4.6 --- frontend/app/api/client.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'frontend/app/api/client.ts') diff --git a/frontend/app/api/client.ts b/frontend/app/api/client.ts index 6b7ce80..c26f1c6 100644 --- a/frontend/app/api/client.ts +++ b/frontend/app/api/client.ts @@ -3,11 +3,11 @@ import { createContext } from "react"; import { API_BASE_PATH } from "../config"; import type { paths } from "./schema"; +const apiOrigin = import.meta.env.VITE_API_BASE_URL + ?? (import.meta.env.DEV ? "http://localhost:8004" : ""); + const client = createClient({ - baseUrl: - process.env.NODE_ENV === "development" - ? `http://localhost:8004${API_BASE_PATH}` - : `https://t.nil.ninja${API_BASE_PATH}`, + baseUrl: `${apiOrigin}${API_BASE_PATH}`, }); export async function apiLogin(username: string, password: string) { -- cgit v1.3.1 From 6c30f383a65cb000d66a85cadc96253ce7061942 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Fri, 13 Feb 2026 23:05:37 +0900 Subject: refactor(frontend): remove React Router remnants from config files Clean up old React Router references after migration to Vite + Wouter: - Replace build/ and .react-router/ with dist/ in ESLint globalIgnores - Replace ./build with ./dist in Biome ignore list - Remove formComponents and NavLink from ESLint settings Co-Authored-By: Claude Opus 4.6 --- frontend/.dockerignore | 1 - frontend/app/api/client.ts | 5 +++-- frontend/biome.json | 4 ++-- frontend/eslint.config.js | 8 ++------ 4 files changed, 7 insertions(+), 11 deletions(-) (limited to 'frontend/app/api/client.ts') diff --git a/frontend/.dockerignore b/frontend/.dockerignore index c0b2358..de4d1f0 100644 --- a/frontend/.dockerignore +++ b/frontend/.dockerignore @@ -1,3 +1,2 @@ -build dist node_modules diff --git a/frontend/app/api/client.ts b/frontend/app/api/client.ts index c26f1c6..86f2506 100644 --- a/frontend/app/api/client.ts +++ b/frontend/app/api/client.ts @@ -3,8 +3,9 @@ import { createContext } from "react"; import { API_BASE_PATH } from "../config"; import type { paths } from "./schema"; -const apiOrigin = import.meta.env.VITE_API_BASE_URL - ?? (import.meta.env.DEV ? "http://localhost:8004" : ""); +const apiOrigin = + import.meta.env.VITE_API_BASE_URL ?? + (import.meta.env.DEV ? "http://localhost:8004" : ""); const client = createClient({ baseUrl: `${apiOrigin}${API_BASE_PATH}`, diff --git a/frontend/biome.json b/frontend/biome.json index 54c8856..6da4a7a 100644 --- a/frontend/biome.json +++ b/frontend/biome.json @@ -9,9 +9,9 @@ "ignoreUnknown": false, "ignore": [ "./.cache", - "./build", "./app/api/schema.d.ts", - "./app/shiki.bundle.ts" + "./app/shiki.bundle.ts", + "./dist" ] }, "formatter": { diff --git a/frontend/eslint.config.js b/frontend/eslint.config.js index 538fb12..0fe10e9 100644 --- a/frontend/eslint.config.js +++ b/frontend/eslint.config.js @@ -7,7 +7,7 @@ import globals from "globals"; import ts from "typescript-eslint"; export default defineConfig( - globalIgnores(["node_modules/", ".react-router/", "build/"]), + globalIgnores(["node_modules/", "dist/"]), js.configs.recommended, ts.configs.recommended, react.configs.flat.recommended, @@ -27,11 +27,7 @@ export default defineConfig( react: { version: "detect", }, - formComponents: ["Form"], - linkComponents: [ - { name: "Link", linkAttribute: "to" }, - { name: "NavLink", linkAttribute: "to" }, - ], + linkComponents: [{ name: "Link", linkAttribute: "to" }], }, }, ); -- cgit v1.3.1