Skip to content

Commit

Permalink
chore: use prettier to sort import order (#1261)
Browse files Browse the repository at this point in the history
Because

- Import order should be retained in a fixed order to increase
readability

This commit

- use prettier to sort import order
  • Loading branch information
EiffelFly authored Jun 26, 2024
1 parent 508bacf commit 4640c24
Show file tree
Hide file tree
Showing 995 changed files with 3,216 additions and 1,687 deletions.
5 changes: 3 additions & 2 deletions apps/console/integration-test/helpers/actions/pipeline.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { Page } from "@playwright/test";

import { DataTestID } from "../../data-testid";
import { PipelineBuilderPage } from "../../pages/pipeline-builder.page";
import { PipelineListPage } from "../../pages/pipeline-list";
import { Page } from "@playwright/test";
import { PipelineOverviewPage } from "../../pages/pipeline-overview.page";
import { getDropdownContent } from "../component-helpers/dropdown";
import { DataTestID } from "../../data-testid";

export async function createPipeline(page: Page, pipelineID: string) {
const pipelineListPage = new PipelineListPage(page);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { test } from "@playwright/test";

import { LoginPage } from "../pages/login.page";
import { OnboardingPage } from "../pages/onboarding.page";
import { PipelineListPage } from "../pages/pipeline-list";
Expand Down
3 changes: 2 additions & 1 deletion apps/console/integration-test/main.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { test } from "@playwright/test";

import { shouldChangeComponentID } from "./tests/should-change-component-id.test";
import { shouldUnmarshalJSONInput } from "./tests/should-unmarshal.test";
import { shouldEditAndCreateStartAndEndOperatorField } from "./tests/should-edit-create-start-end-field.test";
import { shouldUnmarshalJSONInput } from "./tests/should-unmarshal.test";

test.describe(shouldChangeComponentID);
test.describe(shouldUnmarshalJSONInput);
Expand Down
2 changes: 1 addition & 1 deletion apps/console/integration-test/pages/onboarding.page.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Locator, Page, expect } from "@playwright/test";
import { expect, Locator, Page } from "@playwright/test";

export class OnboardingPage {
readonly page: Page;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Locator, Page } from "@playwright/test";

import { getSelectContent } from "../helpers/component-helpers/select";

export class PipelineBuilderPage {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { test, expect } from "@playwright/test";
import { PipelineBuilderPage } from "../pages/pipeline-builder.page";
import { getSelectContent } from "../helpers/component-helpers/select";
import { expect, test } from "@playwright/test";

import { DataTestID } from "../data-testid";
import { createPipeline, deletePipeline } from "../helpers/actions/pipeline";
import { getSelectContent } from "../helpers/component-helpers/select";
import { PipelineBuilderPage } from "../pages/pipeline-builder.page";

export function shouldChangeComponentID() {
const pipelineID = "change-component-node-id";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { test, expect } from "@playwright/test";
import { PipelineBuilderPage } from "../pages/pipeline-builder.page";
import { expect, test } from "@playwright/test";

import { createPipeline, deletePipeline } from "../helpers/actions/pipeline";
import { PipelineBuilderPage } from "../pages/pipeline-builder.page";

export function shouldEditAndCreateStartAndEndOperatorField() {
const pipelineID = "start-field-test";
Expand Down
5 changes: 3 additions & 2 deletions apps/console/integration-test/tests/should-unmarshal.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { test } from "@playwright/test";
import { PipelineOverviewPage } from "../pages/pipeline-overview.page";
import { PipelineBuilderPage } from "../pages/pipeline-builder.page";

import { createPipeline, deletePipeline } from "../helpers/actions/pipeline";
import { PipelineBuilderPage } from "../pages/pipeline-builder.page";
import { PipelineOverviewPage } from "../pages/pipeline-overview.page";

export function shouldUnmarshalJSONInput() {
const pipelineID = "unmarshal-test";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"use client";

import * as React from "react";

import { AmplitudeCtx } from "@instill-ai/toolkit";

export const AmplitudeProvider = ({
Expand Down
7 changes: 4 additions & 3 deletions apps/console/src/app/(providers)/root-provider.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
"use client";

import * as React from "react";
import { usePathname } from "next/navigation";

import { Toaster, useToast } from "@instill-ai/design-system";
import { AmplitudeProvider } from "./amplitude-client-provider";
import { ReactQueryProvider } from "./react-query-client-provider";
import { usePathname } from "next/navigation";
import {
InstillStore,
Nullable,
Expand All @@ -16,6 +14,9 @@ import {
useShallow,
} from "@instill-ai/toolkit";

import { AmplitudeProvider } from "./amplitude-client-provider";
import { ReactQueryProvider } from "./react-query-client-provider";

const selector = (store: InstillStore) => ({
initPipelineBuilder: store.initPipelineBuilder,
initIteratorRelatedState: store.initIteratorRelatedState,
Expand Down
1 change: 1 addition & 0 deletions apps/console/src/app/404/page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Metadata } from "next";

import { NotFoundPageRender } from "./render";

export async function generateMetadata() {
Expand Down
3 changes: 2 additions & 1 deletion apps/console/src/app/404/render.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
"use client";

import { NotFoundView } from "@instill-ai/toolkit";
import * as React from "react";

import { NotFoundView } from "@instill-ai/toolkit";

export const NotFoundPageRender = () => {
return <NotFoundView />;
};
3 changes: 2 additions & 1 deletion apps/console/src/app/[entity]/dashboard/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { DashboardPageRender } from "./render";
import { Metadata } from "next";

import { DashboardPageRender } from "./render";

export async function generateMetadata(): Promise<Metadata> {
const metadata: Metadata = {
title: `Instill Core | Dashboard`,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { PipelineDashboardPageRender } from "./render";
import { Metadata } from "next";

import { PipelineDashboardPageRender } from "./render";

type Props = {
params: { id: string; entity: string };
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
"use client";

import { useRouter } from "next/navigation";
import { useAppAccessToken } from "lib/use-app-access-token";
import { useAppTrackToken } from "lib/useAppTrackToken";

import {
AppTopbar,
DashboardPipelineDetailsPageMainView,
PageBase,
} from "@instill-ai/toolkit";
import { useAppAccessToken } from "lib/use-app-access-token";
import { useAppTrackToken } from "lib/useAppTrackToken";
import { useRouter } from "next/navigation";

export function PipelineDashboardPageRender() {
const accessToken = useAppAccessToken();
Expand Down
7 changes: 4 additions & 3 deletions apps/console/src/app/[entity]/dashboard/render.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
"use client";

import { useRouter } from "next/navigation";
import { useAppAccessToken } from "lib/use-app-access-token";
import { useAppTrackToken } from "lib/useAppTrackToken";

import {
AppTopbar,
DashboardPipelineListPageMainView,
PageBase,
} from "@instill-ai/toolkit";
import { useAppAccessToken } from "lib/use-app-access-token";
import { useAppTrackToken } from "lib/useAppTrackToken";
import { useRouter } from "next/navigation";

export function DashboardPageRender() {
const accessToken = useAppAccessToken();
Expand Down
10 changes: 5 additions & 5 deletions apps/console/src/app/[entity]/models/[id]/[tab]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { ModelViewPageRender } from "./render";
import { Metadata } from "next";
import {
type ModelTabNames,
getModelTabTitle,
} from "@instill-ai/toolkit/server";

import type { ModelTabNames } from "@instill-ai/toolkit/server";
import { getModelTabTitle } from "@instill-ai/toolkit/server";

import { ModelViewPageRender } from "./render";

type Props = {
params: { id: string; entity: string; tab: string };
Expand Down
7 changes: 4 additions & 3 deletions apps/console/src/app/[entity]/models/[id]/[tab]/render.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
"use client";

import { useRouter } from "next/navigation";
import { useAppAccessToken } from "lib/use-app-access-token";
import { useAppTrackToken } from "lib/useAppTrackToken";

import {
AppTopbar,
ModelHubSettingPageMainView,
PageBase,
} from "@instill-ai/toolkit";
import { useAppAccessToken } from "lib/use-app-access-token";
import { useAppTrackToken } from "lib/useAppTrackToken";
import { useRouter } from "next/navigation";

export function ModelViewPageRender() {
const accessToken = useAppAccessToken();
Expand Down
3 changes: 2 additions & 1 deletion apps/console/src/app/[entity]/models/create/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { CreateModelPageRender } from "./render";
import { Metadata } from "next";

import { CreateModelPageRender } from "./render";

export async function generateMetadata(): Promise<Metadata> {
const metadata: Metadata = {
title: `Instill Core | Create Model`,
Expand Down
3 changes: 2 additions & 1 deletion apps/console/src/app/[entity]/models/create/render.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
"use client";

import { useAppTrackToken } from "lib/useAppTrackToken";

import {
AppTopbar,
ModelHubCreatePageMainView,
PageBase,
} from "@instill-ai/toolkit";
import { useAppTrackToken } from "lib/useAppTrackToken";

export function CreateModelPageRender() {
useAppTrackToken({ enabled: true });
Expand Down
3 changes: 2 additions & 1 deletion apps/console/src/app/[entity]/models/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { ModelsPageRender } from "./render";
import { Metadata } from "next";

import { ModelsPageRender } from "./render";

export async function generateMetadata(): Promise<Metadata> {
const metadata: Metadata = {
title: `Instill Core | Models`,
Expand Down
7 changes: 4 additions & 3 deletions apps/console/src/app/[entity]/models/render.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
"use client";

import { useRouter } from "next/navigation";
import { useAppAccessToken } from "lib/use-app-access-token";
import { useAppTrackToken } from "lib/useAppTrackToken";

import {
AppTopbar,
ModelHubListPageMainView,
PageBase,
} from "@instill-ai/toolkit";
import { useAppAccessToken } from "lib/use-app-access-token";
import { useAppTrackToken } from "lib/useAppTrackToken";
import { useRouter } from "next/navigation";

export function ModelsPageRender() {
const accessToken = useAppAccessToken();
Expand Down
6 changes: 4 additions & 2 deletions apps/console/src/app/[entity]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { fetchUser } from "@instill-ai/toolkit/server";
import { ProfilePageRender } from "./render";
import { Metadata } from "next";

import { Nullable, User } from "@instill-ai/toolkit";
import { fetchUser } from "@instill-ai/toolkit/server";

import { ProfilePageRender } from "./render";

type Props = {
params: { id: string; entity: string };
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Metadata } from "next";

import { PipelineBuilderRender } from "./render";

type Props = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
"use client";

import { PipelineBuilderMainView } from "@instill-ai/toolkit";
import { useAppAccessToken } from "lib/use-app-access-token";
import { useAppTrackToken } from "lib/useAppTrackToken";

import { PipelineBuilderMainView } from "@instill-ai/toolkit";

export const PipelineBuilderRender = () => {
useAppAccessToken();
useAppTrackToken({ enabled: true });
Expand Down
6 changes: 4 additions & 2 deletions apps/console/src/app/[entity]/pipelines/[id]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import { Metadata } from "next";
import { cookies } from "next/headers";

import { Nullable, Pipeline } from "@instill-ai/toolkit";
import {
fetchNamespaceType,
fetchUserPipeline,
} from "@instill-ai/toolkit/server";

import { PipelineOverviewPageRender } from "./render";
import { Metadata } from "next";
import { cookies } from "next/headers";

type Props = {
params: { id: string; entity: string };
Expand Down
3 changes: 2 additions & 1 deletion apps/console/src/app/[entity]/pipelines/[id]/render.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
"use client";

import { AppTopbar, PageBase, ViewPipeline } from "@instill-ai/toolkit";
import { useAppAccessToken } from "lib/use-app-access-token";
import { useAppTrackToken } from "lib/useAppTrackToken";

import { AppTopbar, PageBase, ViewPipeline } from "@instill-ai/toolkit";

export function PipelineOverviewPageRender() {
useAppAccessToken({
disabledRedirectingVisitor: true,
Expand Down
1 change: 1 addition & 0 deletions apps/console/src/app/[entity]/pipelines/page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Metadata } from "next";

import { PipelinesViewPageRender } from "./render";

export async function generateMetadata() {
Expand Down
3 changes: 2 additions & 1 deletion apps/console/src/app/[entity]/pipelines/render.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
"use client";

import { AppTopbar, PageBase, ViewPipelines } from "@instill-ai/toolkit";
import { useAppAccessToken } from "lib/use-app-access-token";
import { useAppTrackToken } from "lib/useAppTrackToken";

import { AppTopbar, PageBase, ViewPipelines } from "@instill-ai/toolkit";

export const PipelinesViewPageRender = () => {
useAppAccessToken();
useAppTrackToken({ enabled: true });
Expand Down
3 changes: 2 additions & 1 deletion apps/console/src/app/[entity]/render.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
"use client";

import { AppTopbar, PageBase, UserProfileView } from "@instill-ai/toolkit";
import { useAppAccessToken } from "lib/use-app-access-token";
import { useAppTrackToken } from "lib/useAppTrackToken";

import { AppTopbar, PageBase, UserProfileView } from "@instill-ai/toolkit";

export function ProfilePageRender() {
useAppAccessToken({
disabledRedirectingVisitor: true,
Expand Down
3 changes: 2 additions & 1 deletion apps/console/src/app/api/access-token/route.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Nullable } from "@instill-ai/toolkit";
import { cookies } from "next/headers";

import { Nullable } from "@instill-ai/toolkit";

export const GET = () => {
const cookieStore = cookies();
const authSessionCookie = cookieStore.get("instill-auth-session")?.value;
Expand Down
3 changes: 2 additions & 1 deletion apps/console/src/app/api/auth/logout/route.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { authLogoutAction } from "@instill-ai/toolkit/server";
import { cookies } from "next/headers";
import { redirect } from "next/navigation";

import { authLogoutAction } from "@instill-ai/toolkit/server";

export async function GET() {
const cookieStore = cookies();
const accessTokenKey = "instill-auth-session";
Expand Down
3 changes: 3 additions & 0 deletions apps/console/src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import cn from "clsx";

import { env } from "@instill-ai/toolkit/server";

import "../styles/global.css";
Expand All @@ -9,7 +10,9 @@ import "@instill-ai/design-tokens/dist/theme/light.css";
import "@instill-ai/design-tokens/dist/theme/dark.css";
import "reactflow/dist/style.css";
import "../styles/tip-tap.css";

import { IBM_Plex_Mono, IBM_Plex_Sans } from "next/font/google";

import { RootProvider } from "./(providers)/root-provider";

const ibmPlexSans = IBM_Plex_Sans({
Expand Down
Loading

0 comments on commit 4640c24

Please sign in to comment.