Skip to content

Commit c0a9eac

Browse files
authored
chore(site): organize imports (#876)
1 parent 2f1fa15 commit c0a9eac

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+107
-122
lines changed

site/.storybook/preview.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import ThemeProvider from "@material-ui/styles/ThemeProvider"
22
import { withThemes } from "@react-theming/storybook-addon"
3-
import { light, dark } from "../src/theme"
4-
import { addDecorator } from "node_modules/@storybook/react"
53
import { createMemoryHistory } from "history"
4+
import { addDecorator } from "node_modules/@storybook/react"
65
import { unstable_HistoryRouter as HistoryRouter } from "react-router-dom"
6+
import { dark, light } from "../src/theme"
77
import "../src/theme/global-fonts"
88

99
addDecorator(withThemes(ThemeProvider, [light, dark]))

site/e2e/playwright.config.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import * as path from "path"
21
import { PlaywrightTestConfig } from "@playwright/test"
2+
import * as path from "path"
33

44
const config: PlaywrightTestConfig = {
55
testDir: "tests",

site/e2e/tests/login.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { test } from "@playwright/test"
2-
import { ProjectsPage, SignInPage } from "../pom"
32
import { email, password } from "../constants"
3+
import { ProjectsPage, SignInPage } from "../pom"
44
import { waitForClientSideNavigation } from "./../util"
55

66
test("Login takes user to /projects", async ({ baseURL, page }) => {

site/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@
8080
"mini-css-extract-plugin": "2.6.0",
8181
"msw": "0.39.2",
8282
"prettier": "2.6.2",
83+
"prettier-plugin-organize-imports": "2.3.4",
8384
"react-hot-loader": "4.13.0",
8485
"sql-formatter": "4.0.2",
8586
"style-loader": "3.3.1",

site/src/AppRouter.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from "react"
2-
import { Routes, Route } from "react-router-dom"
3-
import { RequireAuth, AuthAndNav } from "./components"
2+
import { Route, Routes } from "react-router-dom"
3+
import { AuthAndNav, RequireAuth } from "./components"
44
import { IndexPage } from "./pages"
55
import { NotFoundPage } from "./pages/404"
66
import { CliAuthenticationPage } from "./pages/cli-auth"

site/src/Main.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
import { inspect } from "@xstate/inspect"
12
import React from "react"
23
import ReactDOM from "react-dom"
3-
import { inspect } from "@xstate/inspect"
44
import { Interpreter } from "xstate"
55
import { App } from "./app"
66

site/src/api/index.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import axios from "axios"
22
import { getApiKey, login, logout } from "."
3-
import { LoginResponse, APIKeyResponse } from "./types"
3+
import { APIKeyResponse, LoginResponse } from "./types"
44

55
// Mock the axios module so that no real network requests are made, but rather
66
// we swap in a resolved or rejected value

site/src/app.tsx

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1-
import React from "react"
21
import CssBaseline from "@material-ui/core/CssBaseline"
32
import ThemeProvider from "@material-ui/styles/ThemeProvider"
4-
import { SWRConfig } from "swr"
5-
import { light } from "./theme"
3+
import React from "react"
64
import { BrowserRouter as Router } from "react-router-dom"
7-
8-
import { XServiceProvider } from "./xServices/StateContext"
5+
import { SWRConfig } from "swr"
96
import { AppRouter } from "./AppRouter"
7+
import { light } from "./theme"
108
import "./theme/global-fonts"
9+
import { XServiceProvider } from "./xServices/StateContext"
1110

1211
export const App: React.FC = () => {
1312
return (

site/src/components/Button/CopyButton.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { makeStyles } from "@material-ui/core/styles"
21
import Button from "@material-ui/core/Button"
2+
import { makeStyles } from "@material-ui/core/styles"
33
import Tooltip from "@material-ui/core/Tooltip"
44
import Check from "@material-ui/icons/Check"
55
import React, { useState } from "react"

site/src/components/Button/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
export * from "./SplitButton"
2-
export * from "./LoadingButton"
31
export * from "./CopyButton"
2+
export * from "./LoadingButton"
3+
export * from "./SplitButton"

site/src/components/CodeBlock/index.test.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { screen } from "@testing-library/react"
2-
import { render } from "../../test_helpers"
32
import React from "react"
3+
import { render } from "../../test_helpers"
44
import { CodeBlock } from "./index"
55

66
describe("CodeBlock", () => {

site/src/components/CodeExample/CodeExample.test.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { screen } from "@testing-library/react"
2-
import { render } from "../../test_helpers"
32
import React from "react"
3+
import { render } from "../../test_helpers"
44
import { CodeExample } from "./CodeExample"
55

66
describe("CodeExample", () => {

site/src/components/CodeExample/CodeExample.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { makeStyles } from "@material-ui/core/styles"
22
import React from "react"
33
import { MONOSPACE_FONT_FAMILY } from "../../theme/constants"
4-
54
import { CopyButton } from "../Button"
65

76
export interface CodeExampleProps {

site/src/components/EmptyState/index.test.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { screen } from "@testing-library/react"
2-
import { render } from "../../test_helpers"
32
import React from "react"
3+
import { render } from "../../test_helpers"
44
import { EmptyState } from "./index"
55

66
describe("EmptyState", () => {

site/src/components/EmptyState/index.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import React from "react"
2-
import { makeStyles } from "@material-ui/core/styles"
31
import Box from "@material-ui/core/Box"
42
import Button, { ButtonProps } from "@material-ui/core/Button"
3+
import { makeStyles } from "@material-ui/core/styles"
54
import Typography from "@material-ui/core/Typography"
5+
import React from "react"
66

77
export interface EmptyStateProps {
88
/** Text Message to display, placed inside Typography component */

site/src/components/Form/FormDropdownField.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import MenuItem from "@material-ui/core/MenuItem"
33
import { makeStyles } from "@material-ui/core/styles"
44
import Typography from "@material-ui/core/Typography"
55
import React from "react"
6-
76
import { FormTextField, FormTextFieldProps } from "./FormTextField"
87

98
export interface DropdownItem {

site/src/components/Form/FormTextField.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import TextField, { TextFieldProps } from "@material-ui/core/TextField"
2+
import { FormikContextType } from "formik"
23
import React from "react"
34
import { PasswordField } from "./PasswordField"
4-
import { FormikContextType } from "formik"
55

66
/**
77
* FormFieldProps are required props for creating form fields using a factory.

site/src/components/Form/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import { FormikContextType, getIn } from "formik"
22
import { ChangeEvent, ChangeEventHandler, FocusEventHandler } from "react"
33

44
export * from "./FormCloseButton"
5-
export * from "./FormSection"
65
export * from "./FormDropdownField"
6+
export * from "./FormSection"
77
export * from "./FormTextField"
88
export * from "./FormTitle"
99

site/src/components/Header/index.test.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { screen } from "@testing-library/react"
2-
import { render } from "./../../test_helpers"
32
import React from "react"
3+
import { render } from "./../../test_helpers"
44
import { Header } from "./index"
55

66
describe("Header", () => {

site/src/components/Header/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Box from "@material-ui/core/Box"
2-
import Typography from "@material-ui/core/Typography"
32
import { makeStyles } from "@material-ui/core/styles"
3+
import Typography from "@material-ui/core/Typography"
44
import React from "react"
55
import { HeaderButton } from "./HeaderButton"
66

site/src/components/Icons/index.test.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
import React from "react"
21
import SvgIcon from "@material-ui/core/SvgIcon"
2+
import React from "react"
33
import { render } from "./../../test_helpers"
4-
54
import * as Icons from "./index"
65

76
const getAllIcons = (): [string, typeof SvgIcon][] => {

site/src/components/Navbar/NavbarView.test.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import React from "react"
21
import { screen } from "@testing-library/react"
3-
2+
import React from "react"
43
import { render } from "../../test_helpers"
54
import { MockUser } from "../../test_helpers/entities"
65
import { NavbarView } from "./NavbarView"

site/src/components/Navbar/NavbarView.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import React from "react"
21
import Button from "@material-ui/core/Button"
32
import { makeStyles } from "@material-ui/core/styles"
3+
import React from "react"
44
import { Link } from "react-router-dom"
5+
import { UserResponse } from "../../api/types"
56
import { Logo } from "../Icons"
67
import { UserDropdown } from "./UserDropdown"
7-
import { UserResponse } from "../../api/types"
88

99
export interface NavbarViewProps {
1010
user?: UserResponse

site/src/components/Navbar/UserDropdown.tsx

+3-4
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,11 @@ import { fade, makeStyles } from "@material-ui/core/styles"
77
import KeyboardArrowDown from "@material-ui/icons/KeyboardArrowDown"
88
import KeyboardArrowUp from "@material-ui/icons/KeyboardArrowUp"
99
import React, { useState } from "react"
10+
import { UserResponse } from "../../api/types"
1011
import { LogoutIcon } from "../Icons"
11-
import { BorderedMenu } from "./BorderedMenu"
12-
import { UserProfileCard } from "../User/UserProfileCard"
13-
1412
import { UserAvatar } from "../User"
15-
import { UserResponse } from "../../api/types"
13+
import { UserProfileCard } from "../User/UserProfileCard"
14+
import { BorderedMenu } from "./BorderedMenu"
1615

1716
export interface UserDropdownProps {
1817
user: UserResponse

site/src/components/Navbar/index.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import React, { useContext } from "react"
21
import { useActor } from "@xstate/react"
3-
import { NavbarView } from "./NavbarView"
2+
import React, { useContext } from "react"
43
import { XServiceContext } from "../../xServices/StateContext"
4+
import { NavbarView } from "./NavbarView"
55

66
export const Navbar: React.FC = () => {
77
const xServices = useContext(XServiceContext)

site/src/components/Page/Footer.test.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import React from "react"
21
import { screen } from "@testing-library/react"
3-
2+
import React from "react"
43
import { render } from "../../test_helpers"
54
import { Footer } from "./Footer"
65

site/src/components/Page/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1+
export * from "./AuthAndNav"
12
export * from "./Footer"
23
export * from "./RequireAuth"
3-
export * from "./AuthAndNav"

site/src/components/SignIn/CliAuthToken.test.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
import React from "react"
21
import { screen } from "@testing-library/react"
2+
import React from "react"
33
import { render } from "../../test_helpers"
4-
54
import { CliAuthToken } from "./CliAuthToken"
65

76
describe("CliAuthToken", () => {

site/src/components/SignIn/CliAuthToken.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Paper from "@material-ui/core/Paper"
2-
import Typography from "@material-ui/core/Typography"
32
import { makeStyles } from "@material-ui/core/styles"
3+
import Typography from "@material-ui/core/Typography"
44
import React from "react"
55
import { CodeExample } from "../CodeExample"
66

site/src/components/SignIn/SignInForm.tsx

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1+
import FormHelperText from "@material-ui/core/FormHelperText"
12
import { makeStyles } from "@material-ui/core/styles"
3+
import TextField from "@material-ui/core/TextField"
24
import { FormikContextType, useFormik } from "formik"
35
import React from "react"
46
import * as Yup from "yup"
5-
6-
import { Welcome } from "./Welcome"
7-
import FormHelperText from "@material-ui/core/FormHelperText"
8-
import { LoadingButton } from "./../Button"
9-
import TextField from "@material-ui/core/TextField"
107
import { getFormHelpers, onChangeTrimmed } from "../Form"
8+
import { LoadingButton } from "./../Button"
9+
import { Welcome } from "./Welcome"
1110

1211
/**
1312
* BuiltInAuthFormValues describes a form using built-in (email/password)

site/src/components/SignIn/Welcome.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { makeStyles } from "@material-ui/core/styles"
2-
import { CoderIcon } from "../Icons"
3-
import React from "react"
42
import Typography from "@material-ui/core/Typography"
3+
import React from "react"
4+
import { CoderIcon } from "../Icons"
55

66
export const Welcome: React.FC = () => {
77
const styles = useStyles()

site/src/components/Table/Cells/UserCell.test.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1+
import { fireEvent, render, screen } from "@testing-library/react"
2+
import React from "react"
13
import { MockUser, MockUserAgent, WrapperComponent } from "../../../test_helpers"
24
import { UserCell, UserCellProps } from "./UserCell"
3-
import React from "react"
4-
import { fireEvent, render, screen } from "@testing-library/react"
55

66
namespace Helpers {
77
export const Props: UserCellProps = {

site/src/components/Table/Table.test.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { screen } from "@testing-library/react"
2-
import { render } from "./../../test_helpers"
32
import React from "react"
4-
import { Table, Column } from "./Table"
3+
import { render } from "./../../test_helpers"
4+
import { Column, Table } from "./Table"
55

66
interface TestData {
77
name: string

site/src/components/Table/Table.tsx

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1-
import React from "react"
21
import Box from "@material-ui/core/Box"
32
import MuiTable from "@material-ui/core/Table"
3+
import TableBody from "@material-ui/core/TableBody"
4+
import TableCell from "@material-ui/core/TableCell"
45
import TableHead from "@material-ui/core/TableHead"
56
import TableRow from "@material-ui/core/TableRow"
6-
import TableCell from "@material-ui/core/TableCell"
7-
8-
import { TableTitle } from "./TableTitle"
7+
import React from "react"
98
import { TableHeaders } from "./TableHeaders"
10-
import TableBody from "@material-ui/core/TableBody"
9+
import { TableTitle } from "./TableTitle"
1110

1211
export interface Column<T> {
1312
/**

site/src/components/Table/TableHeaders.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import React from "react"
1+
import { makeStyles } from "@material-ui/core/styles"
22
import TableCell from "@material-ui/core/TableCell"
33
import TableRow from "@material-ui/core/TableRow"
4-
import { makeStyles } from "@material-ui/core/styles"
4+
import React from "react"
55

66
export interface TableHeadersProps {
77
columns: string[]

site/src/components/User/UserProfileCard.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { makeStyles } from "@material-ui/core/styles"
22
import Typography from "@material-ui/core/Typography"
33
import React from "react"
44
import { UserResponse } from "../../api/types"
5-
65
import { UserAvatar } from "./UserAvatar"
76

87
interface UserProfileCardProps {

site/src/components/Workspace/Workspace.stories.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Story } from "@storybook/react"
22
import React from "react"
3-
import { Workspace, WorkspaceProps } from "./Workspace"
43
import { MockOrganization, MockProject, MockWorkspace } from "../../test_helpers"
4+
import { Workspace, WorkspaceProps } from "./Workspace"
55

66
export default {
77
title: "Workspaces/Workspace",

site/src/components/Workspace/Workspace.test.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { screen } from "@testing-library/react"
22
import React from "react"
3-
import { Workspace } from "./Workspace"
43
import { MockOrganization, MockProject, MockWorkspace, render } from "../../test_helpers"
4+
import { Workspace } from "./Workspace"
55

66
describe("Workspace", () => {
77
it("renders", async () => {

site/src/components/Workspace/Workspace.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import Box from "@material-ui/core/Box"
22
import Paper from "@material-ui/core/Paper"
3-
import Typography from "@material-ui/core/Typography"
43
import { makeStyles } from "@material-ui/core/styles"
4+
import Typography from "@material-ui/core/Typography"
55
import CloudCircleIcon from "@material-ui/icons/CloudCircle"
6-
import { Link } from "react-router-dom"
76
import React from "react"
8-
import * as Constants from "./constants"
7+
import { Link } from "react-router-dom"
98
import * as Types from "../../api/types"
9+
import * as Constants from "./constants"
1010
import { WorkspaceSection } from "./WorkspaceSection"
1111

1212
export interface WorkspaceProps {

site/src/forms/CreateProjectForm.test.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { render, screen } from "@testing-library/react"
22
import React from "react"
3+
import { MockOrganization, MockProject, MockProvisioner } from "./../test_helpers"
34
import { CreateProjectForm } from "./CreateProjectForm"
4-
import { MockProvisioner, MockOrganization, MockProject } from "./../test_helpers"
55

66
describe("CreateProjectForm", () => {
77
it("renders", async () => {

0 commit comments

Comments
 (0)