From 020f832eed315f8830796db4abc6f4072ccf6468 Mon Sep 17 00:00:00 2001 From: Alex Blank Date: Thu, 4 Jun 2026 12:33:10 +0200 Subject: [PATCH] refactor: rename frontend API files to kebab-case MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Renamed: - git_repositories.ts → git-repositories.ts - ssh_keys.ts → ssh-keys.ts - tool_types.ts → tool-types.ts - tool_types.test.ts → tool-types.test.ts Updated all imports across components, pages, and hooks. Quality gates: verified no remaining old imports. --- .../src/api/{git_repositories.ts => git-repositories.ts} | 0 apps/web/src/api/{ssh_keys.ts => ssh-keys.ts} | 0 apps/web/src/api/{tool_types.test.ts => tool-types.test.ts} | 2 +- apps/web/src/api/{tool_types.ts => tool-types.ts} | 0 apps/web/src/components/commit-panel.tsx | 2 +- apps/web/src/components/create-session-form.tsx | 6 +++--- apps/web/src/components/git-toolbar.tsx | 2 +- apps/web/src/components/instance-list.tsx | 4 ++-- apps/web/src/components/merge-dialog.tsx | 2 +- apps/web/src/components/repositories-settings-tab.test.tsx | 2 +- apps/web/src/components/repositories-settings-tab.tsx | 2 +- apps/web/src/components/repository-create-dialog.tsx | 4 ++-- apps/web/src/components/start-tool-modal.tsx | 2 +- apps/web/src/components/tool-starter.tsx | 4 ++-- apps/web/src/components/workspace-create-form.tsx | 4 ++-- apps/web/src/hooks/use-git-repo.ts | 2 +- apps/web/src/pages/config-profiles.tsx | 2 +- apps/web/src/pages/dashboard.test.tsx | 4 ++-- apps/web/src/pages/git-history.tsx | 2 +- apps/web/src/pages/git-repositories.tsx | 4 ++-- apps/web/src/pages/repo-workspace.tsx | 6 +++--- apps/web/src/pages/ssh-keys.tsx | 2 +- apps/web/src/pages/tool-workshop.tsx | 2 +- 23 files changed, 30 insertions(+), 30 deletions(-) rename apps/web/src/api/{git_repositories.ts => git-repositories.ts} (100%) rename apps/web/src/api/{ssh_keys.ts => ssh-keys.ts} (100%) rename apps/web/src/api/{tool_types.test.ts => tool-types.test.ts} (99%) rename apps/web/src/api/{tool_types.ts => tool-types.ts} (100%) diff --git a/apps/web/src/api/git_repositories.ts b/apps/web/src/api/git-repositories.ts similarity index 100% rename from apps/web/src/api/git_repositories.ts rename to apps/web/src/api/git-repositories.ts diff --git a/apps/web/src/api/ssh_keys.ts b/apps/web/src/api/ssh-keys.ts similarity index 100% rename from apps/web/src/api/ssh_keys.ts rename to apps/web/src/api/ssh-keys.ts diff --git a/apps/web/src/api/tool_types.test.ts b/apps/web/src/api/tool-types.test.ts similarity index 99% rename from apps/web/src/api/tool_types.test.ts rename to apps/web/src/api/tool-types.test.ts index 8609907..0acc59c 100644 --- a/apps/web/src/api/tool_types.test.ts +++ b/apps/web/src/api/tool-types.test.ts @@ -6,7 +6,7 @@ import { listToolTypes, updateToolType, validateToolType, -} from "../api/tool_types"; +} from "../api/tool-types"; const mockGet = vi.fn(); const mockPost = vi.fn(); diff --git a/apps/web/src/api/tool_types.ts b/apps/web/src/api/tool-types.ts similarity index 100% rename from apps/web/src/api/tool_types.ts rename to apps/web/src/api/tool-types.ts diff --git a/apps/web/src/components/commit-panel.tsx b/apps/web/src/components/commit-panel.tsx index 9c96cda..5f6c8af 100644 --- a/apps/web/src/components/commit-panel.tsx +++ b/apps/web/src/components/commit-panel.tsx @@ -1,6 +1,6 @@ import { useState } from "react"; -import { commitChanges } from "../api/git_repositories"; +import { commitChanges } from "../api/git-repositories"; interface CommitPanelProps { projectId: string; diff --git a/apps/web/src/components/create-session-form.tsx b/apps/web/src/components/create-session-form.tsx index 5b5b132..e3622ca 100644 --- a/apps/web/src/components/create-session-form.tsx +++ b/apps/web/src/components/create-session-form.tsx @@ -2,9 +2,9 @@ import { useState, useEffect } from "react"; import { Icon } from "./icon"; import { createInstance, startInstance, type ToolInstance } from "../api/sessions"; import type { Project } from "../types"; -import { listRepositoryBranches, type GitRepository, type Branch } from "../api/git_repositories"; -import type { ToolType } from "../api/tool_types"; -import { listSSHKeys, type SSHKey } from "../api/ssh_keys"; +import { listRepositoryBranches, type GitRepository, type Branch } from "../api/git-repositories"; +import type { ToolType } from "../api/tool-types"; +import { listSSHKeys, type SSHKey } from "../api/ssh-keys"; import { listConfigProfiles, type ConfigProfile } from "../api/config_profiles"; interface CreateSessionFormProps { diff --git a/apps/web/src/components/git-toolbar.tsx b/apps/web/src/components/git-toolbar.tsx index 04556c3..97ce337 100644 --- a/apps/web/src/components/git-toolbar.tsx +++ b/apps/web/src/components/git-toolbar.tsx @@ -8,7 +8,7 @@ import { pullRepository, pushRepository, type GitStatus, -} from "../api/git_repositories"; +} from "../api/git-repositories"; import { Icon } from "./icon"; import { MergeDialog } from "./merge-dialog"; diff --git a/apps/web/src/components/instance-list.tsx b/apps/web/src/components/instance-list.tsx index 672296a..f990254 100644 --- a/apps/web/src/components/instance-list.tsx +++ b/apps/web/src/components/instance-list.tsx @@ -9,10 +9,10 @@ import { startInstance, stopInstance, } from "../api/sessions"; -import type { ToolType } from "../api/tool_types"; +import type { ToolType } from "../api/tool-types"; import { CreateSessionForm } from "./create-session-form"; import { listConfigProfiles, type ConfigProfile } from "../api/config_profiles"; -import { listSSHKeys, type SSHKey } from "../api/ssh_keys"; +import { listSSHKeys, type SSHKey } from "../api/ssh-keys"; import { useEventContext } from "../state/events"; const API_BASE_URL = diff --git a/apps/web/src/components/merge-dialog.tsx b/apps/web/src/components/merge-dialog.tsx index 6542bb0..5dbab42 100644 --- a/apps/web/src/components/merge-dialog.tsx +++ b/apps/web/src/components/merge-dialog.tsx @@ -1,6 +1,6 @@ import { useState } from "react"; -import { mergeBranches } from "../api/git_repositories"; +import { mergeBranches } from "../api/git-repositories"; import { Icon } from "./icon"; interface MergeDialogProps { diff --git a/apps/web/src/components/repositories-settings-tab.test.tsx b/apps/web/src/components/repositories-settings-tab.test.tsx index 54bbf56..881fb80 100644 --- a/apps/web/src/components/repositories-settings-tab.test.tsx +++ b/apps/web/src/components/repositories-settings-tab.test.tsx @@ -2,7 +2,7 @@ import { cleanup, fireEvent, render, screen, waitFor } from "@testing-library/re import { afterEach, describe, expect, it, vi } from "vitest"; import { RepositoriesSettingsTab } from "./repositories-settings-tab"; -import * as gitRepositoriesApi from "../api/git_repositories"; +import * as gitRepositoriesApi from "../api/git-repositories"; const mockRepositories = [ { diff --git a/apps/web/src/components/repositories-settings-tab.tsx b/apps/web/src/components/repositories-settings-tab.tsx index af3b315..83f1634 100644 --- a/apps/web/src/components/repositories-settings-tab.tsx +++ b/apps/web/src/components/repositories-settings-tab.tsx @@ -1,7 +1,7 @@ import React, { useCallback, useEffect, useState } from "react"; import { useParams } from "react-router-dom"; -import { deleteRepository, listRepositories, type GitRepository } from "../api/git_repositories"; +import { deleteRepository, listRepositories, type GitRepository } from "../api/git-repositories"; import { RepositoryCreateDialog } from "./repository-create-dialog"; import { Icon } from "./icon"; diff --git a/apps/web/src/components/repository-create-dialog.tsx b/apps/web/src/components/repository-create-dialog.tsx index f9edf71..9b97a81 100644 --- a/apps/web/src/components/repository-create-dialog.tsx +++ b/apps/web/src/components/repository-create-dialog.tsx @@ -1,7 +1,7 @@ import { useEffect, useRef, useState } from "react"; -import { createRepository, parseGitUrl, type GitRepositoryCreate, type URLParseResult } from "../api/git_repositories"; -import { listSSHKeys, type SSHKey } from "../api/ssh_keys"; +import { createRepository, parseGitUrl, type GitRepositoryCreate, type URLParseResult } from "../api/git-repositories"; +import { listSSHKeys, type SSHKey } from "../api/ssh-keys"; import { Icon } from "./icon"; type CreateMode = "clone" | "blank"; diff --git a/apps/web/src/components/start-tool-modal.tsx b/apps/web/src/components/start-tool-modal.tsx index fdf0805..dc68c5e 100644 --- a/apps/web/src/components/start-tool-modal.tsx +++ b/apps/web/src/components/start-tool-modal.tsx @@ -2,7 +2,7 @@ import { useState } from "react"; import { Icon } from "./icon"; -import { listToolTypes, type ToolType } from "../api/tool_types"; +import { listToolTypes, type ToolType } from "../api/tool-types"; import { useAsyncData } from "../hooks/use-async-data"; import type { Workspace } from "../types/workspace"; diff --git a/apps/web/src/components/tool-starter.tsx b/apps/web/src/components/tool-starter.tsx index 99caf99..cec6188 100644 --- a/apps/web/src/components/tool-starter.tsx +++ b/apps/web/src/components/tool-starter.tsx @@ -2,9 +2,9 @@ import { useState, useEffect, useCallback } from "react"; import { Icon } from "./icon"; -import { listToolTypes, type ToolType } from "../api/tool_types"; +import { listToolTypes, type ToolType } from "../api/tool-types"; import { listConfigProfiles, type ConfigProfile } from "../api/config_profiles"; -import { listSSHKeys, type SSHKey } from "../api/ssh_keys"; +import { listSSHKeys, type SSHKey } from "../api/ssh-keys"; import type { Workspace } from "../types/workspace"; import type { ToolInstance } from "../api/sessions"; diff --git a/apps/web/src/components/workspace-create-form.tsx b/apps/web/src/components/workspace-create-form.tsx index 983f90b..53e3265 100644 --- a/apps/web/src/components/workspace-create-form.tsx +++ b/apps/web/src/components/workspace-create-form.tsx @@ -3,11 +3,11 @@ import { useState, useEffect, useCallback } from "react"; import { Icon } from "./icon"; import { listProjects } from "../api/projects"; -import { listRepositories } from "../api/git_repositories"; +import { listRepositories } from "../api/git-repositories"; import { createWorkspaceTopLevel } from "../api/workspaces"; import { useGitRepo } from "../hooks/use-git-repo"; import type { ProjectWithRepos } from "../types"; -import type { GitRepository } from "../api/git_repositories"; +import type { GitRepository } from "../api/git-repositories"; export interface WorkspaceCreateFormProps { /** Called after successful creation. */ diff --git a/apps/web/src/hooks/use-git-repo.ts b/apps/web/src/hooks/use-git-repo.ts index 2e5a64e..07c3417 100644 --- a/apps/web/src/hooks/use-git-repo.ts +++ b/apps/web/src/hooks/use-git-repo.ts @@ -21,7 +21,7 @@ import { type Branch, type CommitHistoryResponse, type CommitDetail, -} from "../api/git_repositories"; +} from "../api/git-repositories"; export interface GitStatus { branch: string; diff --git a/apps/web/src/pages/config-profiles.tsx b/apps/web/src/pages/config-profiles.tsx index 09e0ca6..5f6188f 100644 --- a/apps/web/src/pages/config-profiles.tsx +++ b/apps/web/src/pages/config-profiles.tsx @@ -20,7 +20,7 @@ import { } from "../api/config_profiles"; import { listProjects } from "../api/projects"; import type { ProjectWithRepos } from "../types"; -import { listToolTypes, type ToolType } from "../api/tool_types"; +import { listToolTypes, type ToolType } from "../api/tool-types"; import { GitMountEditor } from "../components/git-mount-editor"; type Status = "loading" | "ready" | "error"; diff --git a/apps/web/src/pages/dashboard.test.tsx b/apps/web/src/pages/dashboard.test.tsx index 04e4740..4bb5517 100644 --- a/apps/web/src/pages/dashboard.test.tsx +++ b/apps/web/src/pages/dashboard.test.tsx @@ -26,11 +26,11 @@ vi.mock("../api/projects", () => ({ listProjects: (...args: unknown[]) => mockProjects(...args) })); -vi.mock("../api/git_repositories", () => ({ +vi.mock("../api/git-repositories", () => ({ listRepositories: (...args: unknown[]) => mockRepos(...args) })); -vi.mock("../api/tool_types", () => ({ +vi.mock("../api/tool-types", () => ({ listToolTypes: vi.fn().mockResolvedValue([]) })); diff --git a/apps/web/src/pages/git-history.tsx b/apps/web/src/pages/git-history.tsx index 2c6819a..aa04096 100644 --- a/apps/web/src/pages/git-history.tsx +++ b/apps/web/src/pages/git-history.tsx @@ -1,7 +1,7 @@ import { useEffect, useState } from "react"; import { useNavigate, useParams } from "react-router-dom"; -import { getCommitDetail, getRepositoryHistory, type CommitDetail, type CommitHistoryResponse } from "../api/git_repositories"; +import { getCommitDetail, getRepositoryHistory, type CommitDetail, type CommitHistoryResponse } from "../api/git-repositories"; import { ErrorState, LoadingState } from "../components/data-states"; import { Icon } from "../components/icon"; import { useAsyncData } from "../hooks/use-async-data"; diff --git a/apps/web/src/pages/git-repositories.tsx b/apps/web/src/pages/git-repositories.tsx index 7be70d0..83b5176 100644 --- a/apps/web/src/pages/git-repositories.tsx +++ b/apps/web/src/pages/git-repositories.tsx @@ -4,8 +4,8 @@ import { useNavigate, useParams } from "react-router-dom"; import { deleteRepository, listRepositories, -} from "../api/git_repositories"; -import type { GitRepository } from "../api/git_repositories"; +} from "../api/git-repositories"; +import type { GitRepository } from "../api/git-repositories"; import { EmptyState, ErrorState, LoadingState } from "../components/data-states"; import { Icon } from "../components/icon"; import { RepositoryCreateDialog } from "../components/repository-create-dialog"; diff --git a/apps/web/src/pages/repo-workspace.tsx b/apps/web/src/pages/repo-workspace.tsx index a1027e4..aa545ae 100644 --- a/apps/web/src/pages/repo-workspace.tsx +++ b/apps/web/src/pages/repo-workspace.tsx @@ -11,14 +11,14 @@ import { listRepositories, type GitRepository, type GitStatus, -} from "../api/git_repositories"; +} from "../api/git-repositories"; import { CommitPanel } from "../components/commit-panel"; import { FileEditor } from "../components/file-editor"; import { GitToolbar } from "../components/git-toolbar"; import { InstanceList } from "../components/instance-list"; import { WorkspaceHeader } from "../components/workspace-header"; -import { listToolTypes } from "../api/tool_types"; -import type { ToolType } from "../api/tool_types"; +import { listToolTypes } from "../api/tool-types"; +import type { ToolType } from "../api/tool-types"; type MobileTab = "files" | "editor" | "git" | "terminal"; diff --git a/apps/web/src/pages/ssh-keys.tsx b/apps/web/src/pages/ssh-keys.tsx index 889333b..adc1e7a 100644 --- a/apps/web/src/pages/ssh-keys.tsx +++ b/apps/web/src/pages/ssh-keys.tsx @@ -1,6 +1,6 @@ import { useState } from "react"; import { useNavigate } from "react-router-dom"; -import { createSSHKey, deleteSSHKey, listSSHKeys, signPayload, verifySignature, type SSHKey } from "../api/ssh_keys"; +import { createSSHKey, deleteSSHKey, listSSHKeys, signPayload, verifySignature, type SSHKey } from "../api/ssh-keys"; import { EmptyState, ErrorState, LoadingState } from "../components/data-states"; import { Icon } from "../components/icon"; import { useAsyncData } from "../hooks/use-async-data"; diff --git a/apps/web/src/pages/tool-workshop.tsx b/apps/web/src/pages/tool-workshop.tsx index f80b218..28b8811 100644 --- a/apps/web/src/pages/tool-workshop.tsx +++ b/apps/web/src/pages/tool-workshop.tsx @@ -16,7 +16,7 @@ import { type ReadinessProbe, type ToolType, type UpdateToolTypeRequest, -} from "../api/tool_types"; +} from "../api/tool-types"; import { createToolDefinition, getToolDefinition,