refactor: rename frontend API files to kebab-case

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.
This commit is contained in:
2026-06-04 12:33:10 +02:00
parent 7fe2790199
commit 020f832eed
23 changed files with 30 additions and 30 deletions
@@ -6,7 +6,7 @@ import {
listToolTypes, listToolTypes,
updateToolType, updateToolType,
validateToolType, validateToolType,
} from "../api/tool_types"; } from "../api/tool-types";
const mockGet = vi.fn(); const mockGet = vi.fn();
const mockPost = vi.fn(); const mockPost = vi.fn();
+1 -1
View File
@@ -1,6 +1,6 @@
import { useState } from "react"; import { useState } from "react";
import { commitChanges } from "../api/git_repositories"; import { commitChanges } from "../api/git-repositories";
interface CommitPanelProps { interface CommitPanelProps {
projectId: string; projectId: string;
@@ -2,9 +2,9 @@ import { useState, useEffect } from "react";
import { Icon } from "./icon"; import { Icon } from "./icon";
import { createInstance, startInstance, type ToolInstance } from "../api/sessions"; import { createInstance, startInstance, type ToolInstance } from "../api/sessions";
import type { Project } from "../types"; import type { Project } from "../types";
import { listRepositoryBranches, type GitRepository, type Branch } from "../api/git_repositories"; import { listRepositoryBranches, type GitRepository, type Branch } from "../api/git-repositories";
import type { ToolType } from "../api/tool_types"; import type { ToolType } from "../api/tool-types";
import { listSSHKeys, type SSHKey } from "../api/ssh_keys"; import { listSSHKeys, type SSHKey } from "../api/ssh-keys";
import { listConfigProfiles, type ConfigProfile } from "../api/config_profiles"; import { listConfigProfiles, type ConfigProfile } from "../api/config_profiles";
interface CreateSessionFormProps { interface CreateSessionFormProps {
+1 -1
View File
@@ -8,7 +8,7 @@ import {
pullRepository, pullRepository,
pushRepository, pushRepository,
type GitStatus, type GitStatus,
} from "../api/git_repositories"; } from "../api/git-repositories";
import { Icon } from "./icon"; import { Icon } from "./icon";
import { MergeDialog } from "./merge-dialog"; import { MergeDialog } from "./merge-dialog";
+2 -2
View File
@@ -9,10 +9,10 @@ import {
startInstance, startInstance,
stopInstance, stopInstance,
} from "../api/sessions"; } from "../api/sessions";
import type { ToolType } from "../api/tool_types"; import type { ToolType } from "../api/tool-types";
import { CreateSessionForm } from "./create-session-form"; import { CreateSessionForm } from "./create-session-form";
import { listConfigProfiles, type ConfigProfile } from "../api/config_profiles"; 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"; import { useEventContext } from "../state/events";
const API_BASE_URL = const API_BASE_URL =
+1 -1
View File
@@ -1,6 +1,6 @@
import { useState } from "react"; import { useState } from "react";
import { mergeBranches } from "../api/git_repositories"; import { mergeBranches } from "../api/git-repositories";
import { Icon } from "./icon"; import { Icon } from "./icon";
interface MergeDialogProps { interface MergeDialogProps {
@@ -2,7 +2,7 @@ import { cleanup, fireEvent, render, screen, waitFor } from "@testing-library/re
import { afterEach, describe, expect, it, vi } from "vitest"; import { afterEach, describe, expect, it, vi } from "vitest";
import { RepositoriesSettingsTab } from "./repositories-settings-tab"; import { RepositoriesSettingsTab } from "./repositories-settings-tab";
import * as gitRepositoriesApi from "../api/git_repositories"; import * as gitRepositoriesApi from "../api/git-repositories";
const mockRepositories = [ const mockRepositories = [
{ {
@@ -1,7 +1,7 @@
import React, { useCallback, useEffect, useState } from "react"; import React, { useCallback, useEffect, useState } from "react";
import { useParams } from "react-router-dom"; 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 { RepositoryCreateDialog } from "./repository-create-dialog";
import { Icon } from "./icon"; import { Icon } from "./icon";
@@ -1,7 +1,7 @@
import { useEffect, useRef, useState } from "react"; import { useEffect, useRef, useState } from "react";
import { createRepository, parseGitUrl, type GitRepositoryCreate, type URLParseResult } from "../api/git_repositories"; import { createRepository, parseGitUrl, type GitRepositoryCreate, type URLParseResult } from "../api/git-repositories";
import { listSSHKeys, type SSHKey } from "../api/ssh_keys"; import { listSSHKeys, type SSHKey } from "../api/ssh-keys";
import { Icon } from "./icon"; import { Icon } from "./icon";
type CreateMode = "clone" | "blank"; type CreateMode = "clone" | "blank";
+1 -1
View File
@@ -2,7 +2,7 @@
import { useState } from "react"; import { useState } from "react";
import { Icon } from "./icon"; 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 { useAsyncData } from "../hooks/use-async-data";
import type { Workspace } from "../types/workspace"; import type { Workspace } from "../types/workspace";
+2 -2
View File
@@ -2,9 +2,9 @@
import { useState, useEffect, useCallback } from "react"; import { useState, useEffect, useCallback } from "react";
import { Icon } from "./icon"; 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 { 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 { Workspace } from "../types/workspace";
import type { ToolInstance } from "../api/sessions"; import type { ToolInstance } from "../api/sessions";
@@ -3,11 +3,11 @@
import { useState, useEffect, useCallback } from "react"; import { useState, useEffect, useCallback } from "react";
import { Icon } from "./icon"; import { Icon } from "./icon";
import { listProjects } from "../api/projects"; import { listProjects } from "../api/projects";
import { listRepositories } from "../api/git_repositories"; import { listRepositories } from "../api/git-repositories";
import { createWorkspaceTopLevel } from "../api/workspaces"; import { createWorkspaceTopLevel } from "../api/workspaces";
import { useGitRepo } from "../hooks/use-git-repo"; import { useGitRepo } from "../hooks/use-git-repo";
import type { ProjectWithRepos } from "../types"; import type { ProjectWithRepos } from "../types";
import type { GitRepository } from "../api/git_repositories"; import type { GitRepository } from "../api/git-repositories";
export interface WorkspaceCreateFormProps { export interface WorkspaceCreateFormProps {
/** Called after successful creation. */ /** Called after successful creation. */
+1 -1
View File
@@ -21,7 +21,7 @@ import {
type Branch, type Branch,
type CommitHistoryResponse, type CommitHistoryResponse,
type CommitDetail, type CommitDetail,
} from "../api/git_repositories"; } from "../api/git-repositories";
export interface GitStatus { export interface GitStatus {
branch: string; branch: string;
+1 -1
View File
@@ -20,7 +20,7 @@ import {
} from "../api/config_profiles"; } from "../api/config_profiles";
import { listProjects } from "../api/projects"; import { listProjects } from "../api/projects";
import type { ProjectWithRepos } from "../types"; 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"; import { GitMountEditor } from "../components/git-mount-editor";
type Status = "loading" | "ready" | "error"; type Status = "loading" | "ready" | "error";
+2 -2
View File
@@ -26,11 +26,11 @@ vi.mock("../api/projects", () => ({
listProjects: (...args: unknown[]) => mockProjects(...args) listProjects: (...args: unknown[]) => mockProjects(...args)
})); }));
vi.mock("../api/git_repositories", () => ({ vi.mock("../api/git-repositories", () => ({
listRepositories: (...args: unknown[]) => mockRepos(...args) listRepositories: (...args: unknown[]) => mockRepos(...args)
})); }));
vi.mock("../api/tool_types", () => ({ vi.mock("../api/tool-types", () => ({
listToolTypes: vi.fn().mockResolvedValue([]) listToolTypes: vi.fn().mockResolvedValue([])
})); }));
+1 -1
View File
@@ -1,7 +1,7 @@
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import { useNavigate, useParams } from "react-router-dom"; 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 { ErrorState, LoadingState } from "../components/data-states";
import { Icon } from "../components/icon"; import { Icon } from "../components/icon";
import { useAsyncData } from "../hooks/use-async-data"; import { useAsyncData } from "../hooks/use-async-data";
+2 -2
View File
@@ -4,8 +4,8 @@ import { useNavigate, useParams } from "react-router-dom";
import { import {
deleteRepository, deleteRepository,
listRepositories, listRepositories,
} from "../api/git_repositories"; } from "../api/git-repositories";
import type { GitRepository } from "../api/git_repositories"; import type { GitRepository } from "../api/git-repositories";
import { EmptyState, ErrorState, LoadingState } from "../components/data-states"; import { EmptyState, ErrorState, LoadingState } from "../components/data-states";
import { Icon } from "../components/icon"; import { Icon } from "../components/icon";
import { RepositoryCreateDialog } from "../components/repository-create-dialog"; import { RepositoryCreateDialog } from "../components/repository-create-dialog";
+3 -3
View File
@@ -11,14 +11,14 @@ import {
listRepositories, listRepositories,
type GitRepository, type GitRepository,
type GitStatus, type GitStatus,
} from "../api/git_repositories"; } from "../api/git-repositories";
import { CommitPanel } from "../components/commit-panel"; import { CommitPanel } from "../components/commit-panel";
import { FileEditor } from "../components/file-editor"; import { FileEditor } from "../components/file-editor";
import { GitToolbar } from "../components/git-toolbar"; import { GitToolbar } from "../components/git-toolbar";
import { InstanceList } from "../components/instance-list"; import { InstanceList } from "../components/instance-list";
import { WorkspaceHeader } from "../components/workspace-header"; import { WorkspaceHeader } from "../components/workspace-header";
import { listToolTypes } from "../api/tool_types"; import { listToolTypes } from "../api/tool-types";
import type { ToolType } from "../api/tool_types"; import type { ToolType } from "../api/tool-types";
type MobileTab = "files" | "editor" | "git" | "terminal"; type MobileTab = "files" | "editor" | "git" | "terminal";
+1 -1
View File
@@ -1,6 +1,6 @@
import { useState } from "react"; import { useState } from "react";
import { useNavigate } from "react-router-dom"; 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 { EmptyState, ErrorState, LoadingState } from "../components/data-states";
import { Icon } from "../components/icon"; import { Icon } from "../components/icon";
import { useAsyncData } from "../hooks/use-async-data"; import { useAsyncData } from "../hooks/use-async-data";
+1 -1
View File
@@ -16,7 +16,7 @@ import {
type ReadinessProbe, type ReadinessProbe,
type ToolType, type ToolType,
type UpdateToolTypeRequest, type UpdateToolTypeRequest,
} from "../api/tool_types"; } from "../api/tool-types";
import { import {
createToolDefinition, createToolDefinition,
getToolDefinition, getToolDefinition,