mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
refactor: camel case files (#1081)
This commit is contained in:
@@ -20,7 +20,7 @@ coderd/database/generate: fmt/sql coderd/database/dump.sql $(wildcard coderd/dat
|
||||
.PHONY: coderd/database/generate
|
||||
|
||||
apitypings/generate: site/src/api/types.ts
|
||||
go run scripts/apitypings/main.go > site/src/api/types-generated.ts
|
||||
go run scripts/apitypings/main.go > site/src/api/typesGenerated.ts
|
||||
cd site && yarn run format:types
|
||||
.PHONY: apitypings/generate
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import { createMemoryHistory } from "history"
|
||||
import { addDecorator } from "node_modules/@storybook/react"
|
||||
import { unstable_HistoryRouter as HistoryRouter } from "react-router-dom"
|
||||
import { dark, light } from "../src/theme"
|
||||
import "../src/theme/global-fonts"
|
||||
import "../src/theme/globalFonts"
|
||||
|
||||
const providerFn = ({ children, theme }) => (
|
||||
<ThemeProvider theme={theme}>
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
import { server } from "./src/test_helpers/server"
|
||||
import { server } from "./src/testHelpers/server"
|
||||
|
||||
// Establish API mocking before all tests through MSW.
|
||||
beforeAll(() =>
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@
|
||||
"chromatic": "chromatic",
|
||||
"dev": "webpack-dev-server --config=webpack.dev.ts",
|
||||
"format:check": "prettier --check '**/*.{css,html,js,json,jsx,md,ts,tsx,yaml,yml}'",
|
||||
"format:types": "prettier --write 'src/api/types-generated.ts'",
|
||||
"format:types": "prettier --write 'src/api/typesGenerated.ts'",
|
||||
"format:write": "prettier --write '**/*.{css,html,js,json,jsx,md,ts,tsx,yaml,yml}'",
|
||||
"lint": "jest --selectProjects lint",
|
||||
"lint:fix": "FIX=true yarn lint",
|
||||
|
||||
@@ -10,9 +10,9 @@ import { HealthzPage } from "./pages/healthz"
|
||||
import { SignInPage } from "./pages/login"
|
||||
import { OrganizationsPage } from "./pages/orgs"
|
||||
import { PreferencesAccountPage } from "./pages/preferences/account"
|
||||
import { PreferencesLinkedAccountsPage } from "./pages/preferences/linked-accounts"
|
||||
import { PreferencesLinkedAccountsPage } from "./pages/preferences/linkedAccounts"
|
||||
import { PreferencesSecurityPage } from "./pages/preferences/security"
|
||||
import { PreferencesSSHKeysPage } from "./pages/preferences/ssh-keys"
|
||||
import { PreferencesSSHKeysPage } from "./pages/preferences/sshKeys"
|
||||
import { SettingsPage } from "./pages/settings"
|
||||
import { TemplatesPage } from "./pages/templates"
|
||||
import { TemplatePage } from "./pages/templates/[organization]/[template]"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import axios, { AxiosRequestHeaders } from "axios"
|
||||
import { mutate } from "swr"
|
||||
import { MockPager, MockUser, MockUser2 } from "../test_helpers/entities"
|
||||
import { MockPager, MockUser, MockUser2 } from "../testHelpers/entities"
|
||||
import * as Types from "./types"
|
||||
|
||||
const CONTENT_TYPE_JSON: AxiosRequestHeaders = {
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ import { SWRConfig } from "swr"
|
||||
import { AppRouter } from "./AppRouter"
|
||||
import { GlobalSnackbar } from "./components/Snackbar/GlobalSnackbar"
|
||||
import { light } from "./theme"
|
||||
import "./theme/global-fonts"
|
||||
import "./theme/globalFonts"
|
||||
import { XServiceProvider } from "./xServices/StateContext"
|
||||
|
||||
export const App: React.FC = () => {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { screen } from "@testing-library/react"
|
||||
import React from "react"
|
||||
import { history, render } from "../../test_helpers"
|
||||
import { history, render } from "../../testHelpers"
|
||||
import { AdminDropdown, Language } from "./AdminDropdown"
|
||||
|
||||
const renderAndClick = async () => {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { screen } from "@testing-library/react"
|
||||
import React from "react"
|
||||
import { render } from "../../test_helpers"
|
||||
import { render } from "../../testHelpers"
|
||||
import { CodeBlock } from "./index"
|
||||
|
||||
describe("CodeBlock", () => {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { screen } from "@testing-library/react"
|
||||
import React from "react"
|
||||
import { render } from "../../test_helpers"
|
||||
import { render } from "../../testHelpers"
|
||||
import { CodeExample } from "./CodeExample"
|
||||
|
||||
describe("CodeExample", () => {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { screen } from "@testing-library/react"
|
||||
import React from "react"
|
||||
import { render } from "../../test_helpers"
|
||||
import { render } from "../../testHelpers"
|
||||
import { EmptyState } from "./index"
|
||||
|
||||
describe("EmptyState", () => {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { screen } from "@testing-library/react"
|
||||
import React from "react"
|
||||
import { render } from "./../../test_helpers"
|
||||
import { render } from "../../testHelpers"
|
||||
import { Header } from "./index"
|
||||
|
||||
describe("Header", () => {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import SvgIcon from "@material-ui/core/SvgIcon"
|
||||
import React from "react"
|
||||
import { render } from "./../../test_helpers"
|
||||
import { render } from "../../testHelpers"
|
||||
import * as Icons from "./index"
|
||||
|
||||
const getAllIcons = (): [string, typeof SvgIcon][] => {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { screen } from "@testing-library/react"
|
||||
import React from "react"
|
||||
import { NavbarView } from "."
|
||||
import { render } from "../../../test_helpers"
|
||||
import { MockUser } from "../../../test_helpers/entities"
|
||||
import { render } from "../../../testHelpers"
|
||||
import { MockUser } from "../../../testHelpers/entities"
|
||||
|
||||
describe("NavbarView", () => {
|
||||
const noop = () => {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { screen } from "@testing-library/react"
|
||||
import React from "react"
|
||||
import { Language, UserDropdown, UserDropdownProps } from "."
|
||||
import { render } from "../../../test_helpers"
|
||||
import { MockUser } from "../../../test_helpers/entities"
|
||||
import { render } from "../../../testHelpers"
|
||||
import { MockUser } from "../../../testHelpers/entities"
|
||||
|
||||
const renderAndClick = async (props: Partial<UserDropdownProps> = {}) => {
|
||||
render(<UserDropdown user={props.user ?? MockUser} onSignOut={props.onSignOut ?? jest.fn()} />)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { screen } from "@testing-library/react"
|
||||
import React from "react"
|
||||
import { MockBuildInfo, render } from "../../test_helpers"
|
||||
import { MockBuildInfo, render } from "../../testHelpers"
|
||||
import { Footer, Language } from "./Footer"
|
||||
|
||||
describe("Footer", () => {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { screen } from "@testing-library/react"
|
||||
import React from "react"
|
||||
import { render } from "../../test_helpers"
|
||||
import { render } from "../../testHelpers"
|
||||
import { CliAuthToken } from "./CliAuthToken"
|
||||
|
||||
describe("CliAuthToken", () => {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { ComponentMeta, Story } from "@storybook/react"
|
||||
import React from "react"
|
||||
import { MockUser, MockUserAgent } from "../../../test_helpers"
|
||||
import { MockUser, MockUserAgent } from "../../../testHelpers"
|
||||
import { UserCell, UserCellProps } from "./UserCell"
|
||||
|
||||
export default {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { fireEvent, render, screen } from "@testing-library/react"
|
||||
import React from "react"
|
||||
import { MockUser, MockUserAgent, WrapperComponent } from "../../../test_helpers"
|
||||
import { MockUser, MockUserAgent, WrapperComponent } from "../../../testHelpers"
|
||||
import { UserCell, UserCellProps } from "./UserCell"
|
||||
|
||||
namespace Helpers {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { screen } from "@testing-library/react"
|
||||
import React from "react"
|
||||
import { render } from "./../../test_helpers"
|
||||
import { render } from "../../testHelpers"
|
||||
import { Column, Table } from "./Table"
|
||||
|
||||
interface TestData {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import Avatar from "@material-ui/core/Avatar"
|
||||
import React from "react"
|
||||
import { firstLetter } from "../../util/first-letter"
|
||||
import { firstLetter } from "../../util/firstLetter"
|
||||
|
||||
export interface UserAvatarProps {
|
||||
className?: string
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { ComponentMeta, Story } from "@storybook/react"
|
||||
import React from "react"
|
||||
import { MockUser, MockUser2 } from "../../test_helpers"
|
||||
import { MockUser, MockUser2 } from "../../testHelpers"
|
||||
import { UsersTable, UsersTableProps } from "./UsersTable"
|
||||
|
||||
export default {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Story } from "@storybook/react"
|
||||
import React from "react"
|
||||
import { MockOrganization, MockTemplate, MockWorkspace } from "../../test_helpers"
|
||||
import { MockOrganization, MockTemplate, MockWorkspace } from "../../testHelpers"
|
||||
import { Workspace, WorkspaceProps } from "./Workspace"
|
||||
|
||||
export default {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { screen } from "@testing-library/react"
|
||||
import React from "react"
|
||||
import { MockOrganization, MockTemplate, MockWorkspace, render } from "../../test_helpers"
|
||||
import { MockOrganization, MockTemplate, MockWorkspace, render } from "../../testHelpers"
|
||||
import { Workspace } from "./Workspace"
|
||||
|
||||
describe("Workspace", () => {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Story } from "@storybook/react"
|
||||
import React from "react"
|
||||
import { MockWorkspaceAutostartEnabled } from "../../test_helpers"
|
||||
import { MockWorkspaceAutostartEnabled } from "../../testHelpers"
|
||||
import { WorkspaceSchedule, WorkspaceScheduleProps } from "./WorkspaceSchedule"
|
||||
|
||||
export default {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { render, screen } from "@testing-library/react"
|
||||
import React from "react"
|
||||
import { MockOrganization, MockProvisioner, MockTemplate } from "./../test_helpers"
|
||||
import { MockOrganization, MockProvisioner, MockTemplate } from "../testHelpers"
|
||||
import { CreateTemplateForm } from "./CreateTemplateForm"
|
||||
|
||||
describe("CreateTemplateForm", () => {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { render, screen } from "@testing-library/react"
|
||||
import React from "react"
|
||||
import { MockTemplate, MockWorkspace } from "./../test_helpers"
|
||||
import { MockTemplate, MockWorkspace } from "../testHelpers"
|
||||
import { CreateWorkspaceForm } from "./CreateWorkspaceForm"
|
||||
|
||||
describe("CreateWorkspaceForm", () => {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { screen } from "@testing-library/react"
|
||||
import React from "react"
|
||||
import { MockPager, render } from "../../test_helpers"
|
||||
import { MockPager, render } from "../../testHelpers"
|
||||
import { UsersPage } from "./UsersPage"
|
||||
import { Language } from "./UsersPageView"
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { ComponentMeta, Story } from "@storybook/react"
|
||||
import React from "react"
|
||||
import { MockPager, MockUser, MockUser2 } from "../../test_helpers"
|
||||
import { MockPager, MockUser, MockUser2 } from "../../testHelpers"
|
||||
import { UsersPageView, UsersPageViewProps } from "./UsersPageView"
|
||||
|
||||
export default {
|
||||
|
||||
@@ -3,8 +3,8 @@ import userEvent from "@testing-library/user-event"
|
||||
import { rest } from "msw"
|
||||
import React from "react"
|
||||
import { Language } from "../components/SignIn/SignInForm"
|
||||
import { history, render } from "../test_helpers"
|
||||
import { server } from "../test_helpers/server"
|
||||
import { history, render } from "../testHelpers"
|
||||
import { server } from "../testHelpers/server"
|
||||
import { SignInPage } from "./login"
|
||||
|
||||
describe("SignInPage", () => {
|
||||
|
||||
@@ -3,7 +3,7 @@ import React from "react"
|
||||
import * as API from "../../api"
|
||||
import * as AccountForm from "../../components/Preferences/AccountForm"
|
||||
import { GlobalSnackbar } from "../../components/Snackbar/GlobalSnackbar"
|
||||
import { renderWithAuth } from "../../test_helpers"
|
||||
import { renderWithAuth } from "../../testHelpers"
|
||||
import * as AuthXService from "../../xServices/auth/authXService"
|
||||
import { Language, PreferencesAccountPage } from "./account"
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { firstLetter } from "./first-letter"
|
||||
import { firstLetter } from "./firstLetter"
|
||||
|
||||
describe("first-letter", () => {
|
||||
it.each<[string, string]>([
|
||||
@@ -25,7 +25,7 @@ const dashboardEntrypoint = path.join(__dirname, "src/Main.tsx")
|
||||
/**
|
||||
* templatePath is the path to HTML templates for injecting webpack bundles
|
||||
*/
|
||||
const templatePath = path.join(__dirname, "html_templates")
|
||||
const templatePath = path.join(__dirname, "htmlTemplates")
|
||||
|
||||
/**
|
||||
* dashboardHTMLPluginConfig is the HtmlWebpackPlugin configuration for the
|
||||
|
||||
Reference in New Issue
Block a user