From 3f2f447d60819fbd9033e6d9fc8adfdf141d4ebb Mon Sep 17 00:00:00 2001 From: Alican Erdurmaz Date: Fri, 31 May 2024 12:34:56 +0300 Subject: [PATCH] chore: useImport type rule (#400) * chore: useImport type rule * fix: single type imports --- .../plugins/_base/src/components/layout/index.tsx | 2 +- .../plugins/antd-example/src/app/blog-posts/page.tsx | 2 +- .../plugins/antd-example/src/app/categories/page.tsx | 2 +- .../plugins/antd/src/contexts/color-mode/index.tsx | 2 +- .../auth-provider-auth0/src/app/_refine_context.tsx | 4 ++-- .../plugins/auth-provider-auth0/src/app/layout.tsx | 2 +- .../providers/auth-provider/auth-provider.server.ts | 4 ++-- .../src/providers/auth-provider/auth-provider.ts | 4 ++-- .../auth-provider-google/src/app/_refine_context.tsx | 4 ++-- .../plugins/auth-provider-google/src/app/layout.tsx | 2 +- .../auth-provider-keycloak/src/app/_refine_context.tsx | 4 ++-- .../plugins/auth-provider-keycloak/src/app/layout.tsx | 2 +- .../providers/auth-provider/auth-provider.client.ts | 2 +- .../providers/auth-provider/auth-provider.server.ts | 2 +- .../providers/auth-provider/auth-provider.server.ts | 2 +- .../src/providers/auth-provider/auth-provider.ts | 4 ++-- .../src/utils/supabase/middleware.ts | 4 ++-- .../plugins/mui-example/src/app/blog-posts/page.tsx | 2 +- .../plugins/mui-example/src/app/categories/page.tsx | 2 +- .../plugins/mui/src/contexts/color-mode/index.tsx | 2 +- .../plugins/_base/app/components/layout/index.tsx | 2 +- .../app/routes/_layout.blog-posts._index.tsx | 2 +- .../app/routes/_layout.categories._index.tsx | 2 +- .../plugins/auth-provider-auth0/app/routes/_auth.tsx | 2 +- .../plugins/auth-provider-custom/app/authProvider.ts | 4 ++-- .../plugins/auth-provider-google/app/routes/_auth.tsx | 2 +- .../auth-provider-keycloak/app/routes/_auth.tsx | 2 +- .../plugins/data-provider-appwrite/app/authProvider.ts | 4 ++-- .../data-provider-strapi-v4/app/authProvider.ts | 4 ++-- .../app/routes/_layout.blog-posts._index.tsx | 4 ++-- .../app/routes/_layout.categories._index.tsx | 2 +- .../app/routes/_layout.blog-posts._index.tsx | 2 +- .../app/routes/_layout.categories._index.tsx | 2 +- .../plugins/mui/app/components/header/index.tsx | 2 +- .../plugins/_base/src/components/layout/index.tsx | 2 +- .../plugins/antd-example/src/pages/blog-posts/list.tsx | 2 +- .../plugins/antd-example/src/pages/categories/list.tsx | 2 +- .../plugins/antd/src/contexts/color-mode/index.tsx | 2 +- .../plugins/auth-provider-custom/src/authProvider.ts | 10 +++++----- refine-vite/plugins/auth-provider-keycloak/extend.js | 4 ++-- .../plugins/data-provider-appwrite/src/authProvider.ts | 4 ++-- .../plugins/data-provider-custom-json-rest/extend.js | 6 +++--- .../data-provider-strapi-v4/src/authProvider.ts | 4 ++-- .../headless-example/src/pages/blog-posts/list.tsx | 4 ++-- .../headless-example/src/pages/categories/list.tsx | 2 +- .../plugins/mui-example/src/pages/blog-posts/list.tsx | 2 +- .../plugins/mui-example/src/pages/categories/list.tsx | 2 +- 47 files changed, 68 insertions(+), 68 deletions(-) diff --git a/refine-nextjs/plugins/_base/src/components/layout/index.tsx b/refine-nextjs/plugins/_base/src/components/layout/index.tsx index 05ad61243..8ee3d58dc 100644 --- a/refine-nextjs/plugins/_base/src/components/layout/index.tsx +++ b/refine-nextjs/plugins/_base/src/components/layout/index.tsx @@ -1,6 +1,6 @@ "use client"; -import { PropsWithChildren } from "react"; +import type { PropsWithChildren } from "react"; import { Breadcrumb } from "../breadcrumb"; import { Menu } from "../menu"; diff --git a/refine-nextjs/plugins/antd-example/src/app/blog-posts/page.tsx b/refine-nextjs/plugins/antd-example/src/app/blog-posts/page.tsx index 6dcec56e7..c0e1e35ef 100644 --- a/refine-nextjs/plugins/antd-example/src/app/blog-posts/page.tsx +++ b/refine-nextjs/plugins/antd-example/src/app/blog-posts/page.tsx @@ -9,7 +9,7 @@ import { ShowButton, useTable, } from "@refinedev/antd"; -import { BaseRecord, useMany } from "@refinedev/core"; +import { type BaseRecord, useMany } from "@refinedev/core"; import { Space, Table } from "antd"; import React from "react"; diff --git a/refine-nextjs/plugins/antd-example/src/app/categories/page.tsx b/refine-nextjs/plugins/antd-example/src/app/categories/page.tsx index 32cf14877..425a27678 100644 --- a/refine-nextjs/plugins/antd-example/src/app/categories/page.tsx +++ b/refine-nextjs/plugins/antd-example/src/app/categories/page.tsx @@ -7,7 +7,7 @@ import { ShowButton, useTable, } from "@refinedev/antd"; -import { BaseRecord } from "@refinedev/core"; +import type { BaseRecord } from "@refinedev/core"; import { Space, Table } from "antd"; import React from "react"; <%_ if (answers["data-provider"] === "data-provider-hasura") { _%> diff --git a/refine-nextjs/plugins/antd/src/contexts/color-mode/index.tsx b/refine-nextjs/plugins/antd/src/contexts/color-mode/index.tsx index f443703ad..a5e11eebd 100644 --- a/refine-nextjs/plugins/antd/src/contexts/color-mode/index.tsx +++ b/refine-nextjs/plugins/antd/src/contexts/color-mode/index.tsx @@ -1,7 +1,7 @@ 'use client' import React, { - PropsWithChildren, + type PropsWithChildren, createContext, useEffect, useState, diff --git a/refine-nextjs/plugins/auth-provider-auth0/src/app/_refine_context.tsx b/refine-nextjs/plugins/auth-provider-auth0/src/app/_refine_context.tsx index 39f8c4bc6..b002c009c 100644 --- a/refine-nextjs/plugins/auth-provider-auth0/src/app/_refine_context.tsx +++ b/refine-nextjs/plugins/auth-provider-auth0/src/app/_refine_context.tsx @@ -1,7 +1,7 @@ 'use client' import React from "react"; -import { Refine, GitHubBanner, AuthBindings, <%- (_app.refineImports || []).join("\n,") _%> } from '@refinedev/core'; +import { Refine, GitHubBanner, type AuthProvider, <%- (_app.refineImports || []).join("\n,") _%> } from '@refinedev/core'; import { RefineKbar, RefineKbarProvider } from "@refinedev/kbar"; import { SessionProvider, useSession, signOut, signIn } from "next-auth/react"; import { usePathname } from 'next/navigation' @@ -59,7 +59,7 @@ const App = (props: React.PropsWithChildren) => { return loading...; } - const authProvider: AuthBindings = { + const authProvider: AuthProvider = { login: async () => { signIn("auth0", { callbackUrl: to ? to.toString() : "/", diff --git a/refine-nextjs/plugins/auth-provider-auth0/src/app/layout.tsx b/refine-nextjs/plugins/auth-provider-auth0/src/app/layout.tsx index 2c0a62343..bd14dc591 100644 --- a/refine-nextjs/plugins/auth-provider-auth0/src/app/layout.tsx +++ b/refine-nextjs/plugins/auth-provider-auth0/src/app/layout.tsx @@ -1,4 +1,4 @@ -import { Metadata } from "next"; +import type { Metadata } from "next"; <%- (_app.nextjsImport || []).join("\n") _%> import React, { Suspense } from "react"; import { RefineContext } from "./_refine_context"; diff --git a/refine-nextjs/plugins/auth-provider-custom/src/providers/auth-provider/auth-provider.server.ts b/refine-nextjs/plugins/auth-provider-custom/src/providers/auth-provider/auth-provider.server.ts index b44a5b3a7..cec4515e0 100644 --- a/refine-nextjs/plugins/auth-provider-custom/src/providers/auth-provider/auth-provider.server.ts +++ b/refine-nextjs/plugins/auth-provider-custom/src/providers/auth-provider/auth-provider.server.ts @@ -1,7 +1,7 @@ -import { AuthBindings } from "@refinedev/core"; +import type { AuthProvider } from "@refinedev/core"; import { cookies } from "next/headers"; -export const authProviderServer: Pick = { +export const authProviderServer: Pick = { check: async () => { const cookieStore = cookies(); const auth = cookieStore.get("auth"); diff --git a/refine-nextjs/plugins/auth-provider-custom/src/providers/auth-provider/auth-provider.ts b/refine-nextjs/plugins/auth-provider-custom/src/providers/auth-provider/auth-provider.ts index 2a10c84bc..66a9603cd 100644 --- a/refine-nextjs/plugins/auth-provider-custom/src/providers/auth-provider/auth-provider.ts +++ b/refine-nextjs/plugins/auth-provider-custom/src/providers/auth-provider/auth-provider.ts @@ -1,6 +1,6 @@ "use client"; -import { AuthBindings } from "@refinedev/core"; +import type { AuthProvider } from "@refinedev/core"; import Cookies from "js-cookie"; const mockUsers = [ @@ -18,7 +18,7 @@ const mockUsers = [ }, ]; -export const authProvider: AuthBindings = { +export const authProvider: AuthProvider = { login: async ({ email, username, password, remember }) => { // Suppose we actually send a request to the back end here. const user = mockUsers[0]; diff --git a/refine-nextjs/plugins/auth-provider-google/src/app/_refine_context.tsx b/refine-nextjs/plugins/auth-provider-google/src/app/_refine_context.tsx index 42f584bb0..916c7dae1 100644 --- a/refine-nextjs/plugins/auth-provider-google/src/app/_refine_context.tsx +++ b/refine-nextjs/plugins/auth-provider-google/src/app/_refine_context.tsx @@ -1,7 +1,7 @@ 'use client' import React from "react"; -import { Refine, GitHubBanner, AuthBindings, <%- (_app.refineImports || []).join("\n,") _%> } from '@refinedev/core'; +import { Refine, GitHubBanner, type AuthProvider, <%- (_app.refineImports || []).join("\n,") _%> } from '@refinedev/core'; import { RefineKbar, RefineKbarProvider } from "@refinedev/kbar"; import { SessionProvider, useSession, signOut, signIn } from "next-auth/react"; import { usePathname } from 'next/navigation' @@ -59,7 +59,7 @@ const App = (props: React.PropsWithChildren) => { return loading...; } - const authProvider: AuthBindings = { + const authProvider: AuthProvider = { login: async () => { signIn("google", { callbackUrl: to ? to.toString() : "/", diff --git a/refine-nextjs/plugins/auth-provider-google/src/app/layout.tsx b/refine-nextjs/plugins/auth-provider-google/src/app/layout.tsx index 2c0a62343..bd14dc591 100644 --- a/refine-nextjs/plugins/auth-provider-google/src/app/layout.tsx +++ b/refine-nextjs/plugins/auth-provider-google/src/app/layout.tsx @@ -1,4 +1,4 @@ -import { Metadata } from "next"; +import type { Metadata } from "next"; <%- (_app.nextjsImport || []).join("\n") _%> import React, { Suspense } from "react"; import { RefineContext } from "./_refine_context"; diff --git a/refine-nextjs/plugins/auth-provider-keycloak/src/app/_refine_context.tsx b/refine-nextjs/plugins/auth-provider-keycloak/src/app/_refine_context.tsx index 0661a4d81..8224ce767 100644 --- a/refine-nextjs/plugins/auth-provider-keycloak/src/app/_refine_context.tsx +++ b/refine-nextjs/plugins/auth-provider-keycloak/src/app/_refine_context.tsx @@ -1,7 +1,7 @@ 'use client' import React from "react"; -import { Refine, GitHubBanner, AuthBindings, <%- (_app.refineImports || []).join("\n,") _%> } from '@refinedev/core'; +import { Refine, GitHubBanner, type AuthProvider, <%- (_app.refineImports || []).join("\n,") _%> } from '@refinedev/core'; import { RefineKbar, RefineKbarProvider } from "@refinedev/kbar"; import { SessionProvider, useSession, signOut, signIn } from "next-auth/react"; import { usePathname } from 'next/navigation' @@ -59,7 +59,7 @@ const App = (props: React.PropsWithChildren) => { return loading...; } - const authProvider: AuthBindings = { + const authProvider: AuthProvider = { login: async () => { signIn("keycloak", { callbackUrl: to ? to.toString() : "/", diff --git a/refine-nextjs/plugins/auth-provider-keycloak/src/app/layout.tsx b/refine-nextjs/plugins/auth-provider-keycloak/src/app/layout.tsx index 2c0a62343..bd14dc591 100644 --- a/refine-nextjs/plugins/auth-provider-keycloak/src/app/layout.tsx +++ b/refine-nextjs/plugins/auth-provider-keycloak/src/app/layout.tsx @@ -1,4 +1,4 @@ -import { Metadata } from "next"; +import type { Metadata } from "next"; <%- (_app.nextjsImport || []).join("\n") _%> import React, { Suspense } from "react"; import { RefineContext } from "./_refine_context"; diff --git a/refine-nextjs/plugins/data-provider-appwrite/src/providers/auth-provider/auth-provider.client.ts b/refine-nextjs/plugins/data-provider-appwrite/src/providers/auth-provider/auth-provider.client.ts index 375a65f72..2c77579ce 100644 --- a/refine-nextjs/plugins/data-provider-appwrite/src/providers/auth-provider/auth-provider.client.ts +++ b/refine-nextjs/plugins/data-provider-appwrite/src/providers/auth-provider/auth-provider.client.ts @@ -1,7 +1,7 @@ "use client"; import { AppwriteException } from "@refinedev/appwrite"; -import { AuthProvider } from "@refinedev/core"; +import type { AuthProvider } from "@refinedev/core"; import { appwriteAccount, appwriteClient } from "@utils/appwrite/client"; import { APPWRITE_JWT_KEY } from "@utils/constants"; import Cookies from "js-cookie"; diff --git a/refine-nextjs/plugins/data-provider-appwrite/src/providers/auth-provider/auth-provider.server.ts b/refine-nextjs/plugins/data-provider-appwrite/src/providers/auth-provider/auth-provider.server.ts index 16ef466b2..f52a6c317 100644 --- a/refine-nextjs/plugins/data-provider-appwrite/src/providers/auth-provider/auth-provider.server.ts +++ b/refine-nextjs/plugins/data-provider-appwrite/src/providers/auth-provider/auth-provider.server.ts @@ -1,4 +1,4 @@ -import { AuthProvider } from "@refinedev/core"; +import type { AuthProvider } from "@refinedev/core"; import { getSessionClient } from "@utils/appwrite/server"; export const authProviderServer: Pick = { diff --git a/refine-nextjs/plugins/data-provider-strapi-v4/src/providers/auth-provider/auth-provider.server.ts b/refine-nextjs/plugins/data-provider-strapi-v4/src/providers/auth-provider/auth-provider.server.ts index 5b35f0ac2..8fcaee252 100644 --- a/refine-nextjs/plugins/data-provider-strapi-v4/src/providers/auth-provider/auth-provider.server.ts +++ b/refine-nextjs/plugins/data-provider-strapi-v4/src/providers/auth-provider/auth-provider.server.ts @@ -1,4 +1,4 @@ -import { AuthProvider } from "@refinedev/core"; +import type { AuthProvider } from "@refinedev/core"; import { API_URL, TOKEN_KEY } from "@utility/constants"; import { cookies } from "next/headers"; diff --git a/refine-nextjs/plugins/data-provider-strapi-v4/src/providers/auth-provider/auth-provider.ts b/refine-nextjs/plugins/data-provider-strapi-v4/src/providers/auth-provider/auth-provider.ts index e62dde328..3c4115c9c 100644 --- a/refine-nextjs/plugins/data-provider-strapi-v4/src/providers/auth-provider/auth-provider.ts +++ b/refine-nextjs/plugins/data-provider-strapi-v4/src/providers/auth-provider/auth-provider.ts @@ -1,6 +1,6 @@ "use client"; -import { AuthBindings } from "@refinedev/core"; +import type { AuthProvider } from "@refinedev/core"; import { AuthHelper } from "@refinedev/strapi-v4"; import { axiosInstance } from "@utility/axios-instance"; import { API_URL, TOKEN_KEY } from "@utility/constants"; @@ -8,7 +8,7 @@ import Cookies from "js-cookie"; const strapiAuthHelper = AuthHelper(API_URL + "/api"); -export const authProvider: AuthBindings = { +export const authProvider: AuthProvider = { login: async ({ email, password }) => { const { data, status } = await strapiAuthHelper.login(email, password); if (status === 200) { diff --git a/refine-nextjs/plugins/data-provider-supabase/src/utils/supabase/middleware.ts b/refine-nextjs/plugins/data-provider-supabase/src/utils/supabase/middleware.ts index 0329db127..974688d81 100644 --- a/refine-nextjs/plugins/data-provider-supabase/src/utils/supabase/middleware.ts +++ b/refine-nextjs/plugins/data-provider-supabase/src/utils/supabase/middleware.ts @@ -1,5 +1,5 @@ -import { CookieOptions, createServerClient } from "@supabase/ssr"; -import { NextRequest, NextResponse } from "next/server"; +import { type CookieOptions, createServerClient } from "@supabase/ssr"; +import { type NextRequest, NextResponse } from "next/server"; import { SUPABASE_KEY, SUPABASE_URL } from "./constants"; export async function updateSession(request: NextRequest) { diff --git a/refine-nextjs/plugins/mui-example/src/app/blog-posts/page.tsx b/refine-nextjs/plugins/mui-example/src/app/blog-posts/page.tsx index c47506483..2e525c01e 100644 --- a/refine-nextjs/plugins/mui-example/src/app/blog-posts/page.tsx +++ b/refine-nextjs/plugins/mui-example/src/app/blog-posts/page.tsx @@ -1,6 +1,6 @@ "use client"; -import { DataGrid, GridColDef } from "@mui/x-data-grid"; +import { DataGrid, type GridColDef } from "@mui/x-data-grid"; import { useMany } from "@refinedev/core"; import { DateField, diff --git a/refine-nextjs/plugins/mui-example/src/app/categories/page.tsx b/refine-nextjs/plugins/mui-example/src/app/categories/page.tsx index 67502a571..d8e74b7d7 100644 --- a/refine-nextjs/plugins/mui-example/src/app/categories/page.tsx +++ b/refine-nextjs/plugins/mui-example/src/app/categories/page.tsx @@ -1,6 +1,6 @@ "use client"; -import { DataGrid, GridColDef } from "@mui/x-data-grid"; +import { DataGrid, type GridColDef } from "@mui/x-data-grid"; import { DeleteButton, EditButton, diff --git a/refine-nextjs/plugins/mui/src/contexts/color-mode/index.tsx b/refine-nextjs/plugins/mui/src/contexts/color-mode/index.tsx index 5af24aa0a..7cc61abac 100644 --- a/refine-nextjs/plugins/mui/src/contexts/color-mode/index.tsx +++ b/refine-nextjs/plugins/mui/src/contexts/color-mode/index.tsx @@ -1,7 +1,7 @@ 'use client' import React, { - PropsWithChildren, + type PropsWithChildren, createContext, useEffect, useState, diff --git a/refine-remix/plugins/_base/app/components/layout/index.tsx b/refine-remix/plugins/_base/app/components/layout/index.tsx index a0d73d763..bae0f7f2c 100644 --- a/refine-remix/plugins/_base/app/components/layout/index.tsx +++ b/refine-remix/plugins/_base/app/components/layout/index.tsx @@ -1,4 +1,4 @@ -import { PropsWithChildren } from "react"; +import type { PropsWithChildren } from "react"; import { Breadcrumb } from "../breadcrumb"; import { Menu } from "../menu"; diff --git a/refine-remix/plugins/antd-example/app/routes/_layout.blog-posts._index.tsx b/refine-remix/plugins/antd-example/app/routes/_layout.blog-posts._index.tsx index 11f11a31d..6d6592054 100644 --- a/refine-remix/plugins/antd-example/app/routes/_layout.blog-posts._index.tsx +++ b/refine-remix/plugins/antd-example/app/routes/_layout.blog-posts._index.tsx @@ -7,7 +7,7 @@ import { ShowButton, useTable, } from "@refinedev/antd"; -import { BaseRecord, useMany } from "@refinedev/core"; +import { type BaseRecord, useMany } from "@refinedev/core"; import { Space, Table } from "antd"; import React from "react"; <%_ if (answers["data-provider"] === "data-provider-hasura") { _%> diff --git a/refine-remix/plugins/antd-example/app/routes/_layout.categories._index.tsx b/refine-remix/plugins/antd-example/app/routes/_layout.categories._index.tsx index 3feb021bc..5308f64db 100644 --- a/refine-remix/plugins/antd-example/app/routes/_layout.categories._index.tsx +++ b/refine-remix/plugins/antd-example/app/routes/_layout.categories._index.tsx @@ -5,7 +5,7 @@ import { ShowButton, useTable, } from "@refinedev/antd"; -import { BaseRecord } from "@refinedev/core"; +import type { BaseRecord } from "@refinedev/core"; import { Space, Table } from "antd"; import React from "react"; <%_ if (answers["data-provider"] === "data-provider-hasura") { _%> diff --git a/refine-remix/plugins/auth-provider-auth0/app/routes/_auth.tsx b/refine-remix/plugins/auth-provider-auth0/app/routes/_auth.tsx index 2002e5a05..084ef6291 100644 --- a/refine-remix/plugins/auth-provider-auth0/app/routes/_auth.tsx +++ b/refine-remix/plugins/auth-provider-auth0/app/routes/_auth.tsx @@ -1,5 +1,5 @@ import { Outlet } from "@remix-run/react"; -import { LoaderFunctionArgs, redirect } from "@remix-run/node"; +import { type LoaderFunctionArgs, redirect } from "@remix-run/node"; import { authenticator } from "~/utils/auth.server"; export default function AuthLayout() { diff --git a/refine-remix/plugins/auth-provider-custom/app/authProvider.ts b/refine-remix/plugins/auth-provider-custom/app/authProvider.ts index d886a4400..9681b80a9 100644 --- a/refine-remix/plugins/auth-provider-custom/app/authProvider.ts +++ b/refine-remix/plugins/auth-provider-custom/app/authProvider.ts @@ -1,4 +1,4 @@ -import type { AuthBindings } from "@refinedev/core"; +import type { AuthProvider } from "@refinedev/core"; import * as cookie from "cookie"; import Cookies from "js-cookie"; @@ -25,7 +25,7 @@ const mockUsers = [ const COOKIE_NAME = "user"; -export const authProvider: AuthBindings = { +export const authProvider: AuthProvider = { login: async ({ email }) => { // Suppose we actually send a request to the back end here. const user = mockUsers.find((item) => item.email === email); diff --git a/refine-remix/plugins/auth-provider-google/app/routes/_auth.tsx b/refine-remix/plugins/auth-provider-google/app/routes/_auth.tsx index 2002e5a05..084ef6291 100644 --- a/refine-remix/plugins/auth-provider-google/app/routes/_auth.tsx +++ b/refine-remix/plugins/auth-provider-google/app/routes/_auth.tsx @@ -1,5 +1,5 @@ import { Outlet } from "@remix-run/react"; -import { LoaderFunctionArgs, redirect } from "@remix-run/node"; +import { type LoaderFunctionArgs, redirect } from "@remix-run/node"; import { authenticator } from "~/utils/auth.server"; export default function AuthLayout() { diff --git a/refine-remix/plugins/auth-provider-keycloak/app/routes/_auth.tsx b/refine-remix/plugins/auth-provider-keycloak/app/routes/_auth.tsx index 2002e5a05..084ef6291 100644 --- a/refine-remix/plugins/auth-provider-keycloak/app/routes/_auth.tsx +++ b/refine-remix/plugins/auth-provider-keycloak/app/routes/_auth.tsx @@ -1,5 +1,5 @@ import { Outlet } from "@remix-run/react"; -import { LoaderFunctionArgs, redirect } from "@remix-run/node"; +import { type LoaderFunctionArgs, redirect } from "@remix-run/node"; import { authenticator } from "~/utils/auth.server"; export default function AuthLayout() { diff --git a/refine-remix/plugins/data-provider-appwrite/app/authProvider.ts b/refine-remix/plugins/data-provider-appwrite/app/authProvider.ts index 5e3dcdafd..e674c7e32 100644 --- a/refine-remix/plugins/data-provider-appwrite/app/authProvider.ts +++ b/refine-remix/plugins/data-provider-appwrite/app/authProvider.ts @@ -1,11 +1,11 @@ import { AppwriteException } from "@refinedev/appwrite"; -import { AuthBindings } from "@refinedev/core"; +import type { AuthProvider } from "@refinedev/core"; import * as cookie from "cookie"; import Cookies from "js-cookie"; import { v4 as uuidv4 } from "uuid"; import { account, appwriteClient, TOKEN_KEY } from "./utility"; -export const authProvider: AuthBindings = { +export const authProvider: AuthProvider = { login: async ({ email, password }) => { try { await account.createEmailSession(email, password); diff --git a/refine-remix/plugins/data-provider-strapi-v4/app/authProvider.ts b/refine-remix/plugins/data-provider-strapi-v4/app/authProvider.ts index 0a1abb0f1..383d9f92a 100644 --- a/refine-remix/plugins/data-provider-strapi-v4/app/authProvider.ts +++ b/refine-remix/plugins/data-provider-strapi-v4/app/authProvider.ts @@ -1,4 +1,4 @@ -import type { AuthBindings } from "@refinedev/core"; +import type { AuthProvider } from "@refinedev/core"; import { AuthHelper } from "@refinedev/strapi-v4"; import axios from "axios"; import * as cookie from "cookie"; @@ -16,7 +16,7 @@ axiosInstance.interceptors.request.use((config) => { return config; }); -export const authProvider: AuthBindings = { +export const authProvider: AuthProvider = { login: async ({ email, password }) => { const { data, status } = await strapiAuthHelper.login(email, password); if (status === 200) { diff --git a/refine-remix/plugins/headless-example/app/routes/_layout.blog-posts._index.tsx b/refine-remix/plugins/headless-example/app/routes/_layout.blog-posts._index.tsx index f609d8b53..fb549b35b 100644 --- a/refine-remix/plugins/headless-example/app/routes/_layout.blog-posts._index.tsx +++ b/refine-remix/plugins/headless-example/app/routes/_layout.blog-posts._index.tsx @@ -1,10 +1,10 @@ import { - GetManyResponse, + type GetManyResponse, useMany, useNavigation, } from "@refinedev/core"; import { useTable } from "@refinedev/react-table"; -import { ColumnDef, flexRender } from "@tanstack/react-table"; +import { type ColumnDef, flexRender } from "@tanstack/react-table"; import React from "react"; <%_ if (answers["data-provider"] === "data-provider-hasura") { _%> import { BLOG_POSTS_QUERY } from "../queries/blog-posts"; diff --git a/refine-remix/plugins/headless-example/app/routes/_layout.categories._index.tsx b/refine-remix/plugins/headless-example/app/routes/_layout.categories._index.tsx index b110fd7cf..dd541e4e0 100644 --- a/refine-remix/plugins/headless-example/app/routes/_layout.categories._index.tsx +++ b/refine-remix/plugins/headless-example/app/routes/_layout.categories._index.tsx @@ -1,6 +1,6 @@ import { useNavigation } from "@refinedev/core"; import { useTable } from "@refinedev/react-table"; -import { ColumnDef, flexRender } from "@tanstack/react-table"; +import { type ColumnDef, flexRender } from "@tanstack/react-table"; import React from "react"; <%_ if (answers["data-provider"] === "data-provider-hasura") { _%> import { CATEGORIES_QUERY } from "../queries/categories"; diff --git a/refine-remix/plugins/mui-example/app/routes/_layout.blog-posts._index.tsx b/refine-remix/plugins/mui-example/app/routes/_layout.blog-posts._index.tsx index dc479e1c6..ecfff4e48 100644 --- a/refine-remix/plugins/mui-example/app/routes/_layout.blog-posts._index.tsx +++ b/refine-remix/plugins/mui-example/app/routes/_layout.blog-posts._index.tsx @@ -1,4 +1,4 @@ -import { DataGrid, GridColDef } from "@mui/x-data-grid"; +import { DataGrid, type GridColDef } from "@mui/x-data-grid"; import { useMany } from "@refinedev/core"; import { DateField, diff --git a/refine-remix/plugins/mui-example/app/routes/_layout.categories._index.tsx b/refine-remix/plugins/mui-example/app/routes/_layout.categories._index.tsx index f5ad80e33..d283ba4d9 100644 --- a/refine-remix/plugins/mui-example/app/routes/_layout.categories._index.tsx +++ b/refine-remix/plugins/mui-example/app/routes/_layout.categories._index.tsx @@ -1,4 +1,4 @@ -import { DataGrid, GridColDef } from "@mui/x-data-grid"; +import { DataGrid, type GridColDef } from "@mui/x-data-grid"; import { DeleteButton, EditButton, diff --git a/refine-remix/plugins/mui/app/components/header/index.tsx b/refine-remix/plugins/mui/app/components/header/index.tsx index 03b493c71..26fe55121 100644 --- a/refine-remix/plugins/mui/app/components/header/index.tsx +++ b/refine-remix/plugins/mui/app/components/header/index.tsx @@ -7,7 +7,7 @@ import Stack from "@mui/material/Stack"; import Toolbar from "@mui/material/Toolbar"; import Typography from "@mui/material/Typography"; import { useGetIdentity } from "@refinedev/core"; -import { HamburgerMenu, RefineThemedLayoutV2HeaderProps } from "@refinedev/mui"; +import { HamburgerMenu, type RefineThemedLayoutV2HeaderProps } from "@refinedev/mui"; import React, { useContext } from "react"; import { ColorModeContext } from "~/contexts/ColorModeContext"; diff --git a/refine-vite/plugins/_base/src/components/layout/index.tsx b/refine-vite/plugins/_base/src/components/layout/index.tsx index a0d73d763..bae0f7f2c 100644 --- a/refine-vite/plugins/_base/src/components/layout/index.tsx +++ b/refine-vite/plugins/_base/src/components/layout/index.tsx @@ -1,4 +1,4 @@ -import { PropsWithChildren } from "react"; +import type { PropsWithChildren } from "react"; import { Breadcrumb } from "../breadcrumb"; import { Menu } from "../menu"; diff --git a/refine-vite/plugins/antd-example/src/pages/blog-posts/list.tsx b/refine-vite/plugins/antd-example/src/pages/blog-posts/list.tsx index 9e1c72604..067d92889 100644 --- a/refine-vite/plugins/antd-example/src/pages/blog-posts/list.tsx +++ b/refine-vite/plugins/antd-example/src/pages/blog-posts/list.tsx @@ -7,7 +7,7 @@ import { ShowButton, useTable, } from "@refinedev/antd"; -import { BaseRecord, useMany } from "@refinedev/core"; +import { type BaseRecord, useMany } from "@refinedev/core"; import { Space, Table } from "antd"; import React from "react"; <%_ if (answers["data-provider"] === "data-provider-hasura") { _%> diff --git a/refine-vite/plugins/antd-example/src/pages/categories/list.tsx b/refine-vite/plugins/antd-example/src/pages/categories/list.tsx index 16b735c76..5de089818 100644 --- a/refine-vite/plugins/antd-example/src/pages/categories/list.tsx +++ b/refine-vite/plugins/antd-example/src/pages/categories/list.tsx @@ -5,7 +5,7 @@ import { ShowButton, useTable, } from "@refinedev/antd"; -import { BaseRecord } from "@refinedev/core"; +import type { BaseRecord } from "@refinedev/core"; import { Space, Table } from "antd"; import React from "react"; <%_ if (answers["data-provider"] === "data-provider-hasura") { _%> diff --git a/refine-vite/plugins/antd/src/contexts/color-mode/index.tsx b/refine-vite/plugins/antd/src/contexts/color-mode/index.tsx index a87c318b1..c34cdbd0f 100644 --- a/refine-vite/plugins/antd/src/contexts/color-mode/index.tsx +++ b/refine-vite/plugins/antd/src/contexts/color-mode/index.tsx @@ -1,4 +1,4 @@ -import { PropsWithChildren, createContext, useEffect, useState } from "react"; +import { type PropsWithChildren, createContext, useEffect, useState } from "react"; import { ConfigProvider, theme } from "antd"; import { RefineThemes } from "@refinedev/antd"; diff --git a/refine-vite/plugins/auth-provider-custom/src/authProvider.ts b/refine-vite/plugins/auth-provider-custom/src/authProvider.ts index f5581e2a8..08359f9f0 100644 --- a/refine-vite/plugins/auth-provider-custom/src/authProvider.ts +++ b/refine-vite/plugins/auth-provider-custom/src/authProvider.ts @@ -1,8 +1,8 @@ -import { AuthBindings } from "@refinedev/core"; +import type { AuthProvider } from "@refinedev/core"; export const TOKEN_KEY = "refine-auth"; -export const authProvider: AuthBindings = { +export const authProvider: AuthProvider = { login: async ({ username, email, password }) => { if ((username || email) && password) { localStorage.setItem(TOKEN_KEY, username); @@ -24,20 +24,20 @@ export const authProvider: AuthBindings = { localStorage.removeItem(TOKEN_KEY); return { success: true, - redirectTo: "/login" + redirectTo: "/login", }; }, check: async () => { const token = localStorage.getItem(TOKEN_KEY); if (token) { return { - authenticated: true + authenticated: true, }; } return { authenticated: false, - redirectTo: "/login" + redirectTo: "/login", }; }, getPermissions: async () => null, diff --git a/refine-vite/plugins/auth-provider-keycloak/extend.js b/refine-vite/plugins/auth-provider-keycloak/extend.js index 39a8d3cd6..353add698 100644 --- a/refine-vite/plugins/auth-provider-keycloak/extend.js +++ b/refine-vite/plugins/auth-provider-keycloak/extend.js @@ -1,6 +1,6 @@ const base = { _app: { - refineImports: [`Authenticated`, `AuthBindings`], + refineImports: [`Authenticated`, `AuthProvider`], import: [ `import axios from "axios";`, `import { useKeycloak } from "@react-keycloak/web";`, @@ -14,7 +14,7 @@ const base = { } `, ` - const authProvider: AuthBindings = { + const authProvider: AuthProvider = { login: async () => { const urlSearchParams = new URLSearchParams(window.location.search); const { to } = Object.fromEntries(urlSearchParams.entries()); diff --git a/refine-vite/plugins/data-provider-appwrite/src/authProvider.ts b/refine-vite/plugins/data-provider-appwrite/src/authProvider.ts index 01ffba185..2f616657e 100644 --- a/refine-vite/plugins/data-provider-appwrite/src/authProvider.ts +++ b/refine-vite/plugins/data-provider-appwrite/src/authProvider.ts @@ -1,9 +1,9 @@ import { AppwriteException } from "@refinedev/appwrite"; -import { AuthBindings } from "@refinedev/core"; +import type { AuthProvider } from "@refinedev/core"; import { v4 as uuidv4 } from "uuid"; import { account } from "./utility"; -export const authProvider: AuthBindings = { +export const authProvider: AuthProvider = { login: async ({ email, password }) => { try { await account.createEmailSession(email, password); diff --git a/refine-vite/plugins/data-provider-custom-json-rest/extend.js b/refine-vite/plugins/data-provider-custom-json-rest/extend.js index d381bed14..cc8722772 100644 --- a/refine-vite/plugins/data-provider-custom-json-rest/extend.js +++ b/refine-vite/plugins/data-provider-custom-json-rest/extend.js @@ -1,9 +1,9 @@ const base = { _app: { - import: [ - `import dataProvider from "@refinedev/simple-rest";`, + import: [`import dataProvider from "@refinedev/simple-rest";`], + refineProps: [ + `dataProvider={dataProvider("https://api.fake-rest.refine.dev")}`, ], - refineProps: [`dataProvider={dataProvider("https://api.fake-rest.refine.dev")}`], }, }; diff --git a/refine-vite/plugins/data-provider-strapi-v4/src/authProvider.ts b/refine-vite/plugins/data-provider-strapi-v4/src/authProvider.ts index 87109e6e1..10bb1a560 100644 --- a/refine-vite/plugins/data-provider-strapi-v4/src/authProvider.ts +++ b/refine-vite/plugins/data-provider-strapi-v4/src/authProvider.ts @@ -1,4 +1,4 @@ -import { AuthBindings } from "@refinedev/core"; +import type { AuthProvider } from "@refinedev/core"; import { AuthHelper } from "@refinedev/strapi-v4"; import axios from "axios"; import { API_URL, TOKEN_KEY } from "./constants"; @@ -6,7 +6,7 @@ import { API_URL, TOKEN_KEY } from "./constants"; export const axiosInstance = axios.create(); const strapiAuthHelper = AuthHelper(API_URL + "/api"); -export const authProvider: AuthBindings = { +export const authProvider: AuthProvider = { login: async ({ email, password }) => { const { data, status } = await strapiAuthHelper.login(email, password); if (status === 200) { diff --git a/refine-vite/plugins/headless-example/src/pages/blog-posts/list.tsx b/refine-vite/plugins/headless-example/src/pages/blog-posts/list.tsx index 01ff37f39..6f3c3ef32 100644 --- a/refine-vite/plugins/headless-example/src/pages/blog-posts/list.tsx +++ b/refine-vite/plugins/headless-example/src/pages/blog-posts/list.tsx @@ -1,10 +1,10 @@ import { - GetManyResponse, + type GetManyResponse, useMany, useNavigation, } from "@refinedev/core"; import { useTable } from "@refinedev/react-table"; -import { ColumnDef, flexRender } from "@tanstack/react-table"; +import { type ColumnDef, flexRender } from "@tanstack/react-table"; import React from "react"; <%_ if (answers["data-provider"] === "data-provider-hasura") { _%> import { BLOG_POSTS_QUERY } from './queries' diff --git a/refine-vite/plugins/headless-example/src/pages/categories/list.tsx b/refine-vite/plugins/headless-example/src/pages/categories/list.tsx index 3732180a2..50296be9d 100644 --- a/refine-vite/plugins/headless-example/src/pages/categories/list.tsx +++ b/refine-vite/plugins/headless-example/src/pages/categories/list.tsx @@ -1,6 +1,6 @@ import { useNavigation } from "@refinedev/core"; import { useTable } from "@refinedev/react-table"; -import { ColumnDef, flexRender } from "@tanstack/react-table"; +import { type ColumnDef, flexRender } from "@tanstack/react-table"; import React from "react"; <%_ if (answers["data-provider"] === "data-provider-hasura") { _%> import { CATEGORIES_QUERY } from './queries' diff --git a/refine-vite/plugins/mui-example/src/pages/blog-posts/list.tsx b/refine-vite/plugins/mui-example/src/pages/blog-posts/list.tsx index 1160a4575..226a5e2d2 100644 --- a/refine-vite/plugins/mui-example/src/pages/blog-posts/list.tsx +++ b/refine-vite/plugins/mui-example/src/pages/blog-posts/list.tsx @@ -1,4 +1,4 @@ -import { DataGrid, GridColDef } from "@mui/x-data-grid"; +import { DataGrid, type GridColDef } from "@mui/x-data-grid"; import { useMany } from "@refinedev/core"; import { DateField, diff --git a/refine-vite/plugins/mui-example/src/pages/categories/list.tsx b/refine-vite/plugins/mui-example/src/pages/categories/list.tsx index 829c60d79..845b7106d 100644 --- a/refine-vite/plugins/mui-example/src/pages/categories/list.tsx +++ b/refine-vite/plugins/mui-example/src/pages/categories/list.tsx @@ -1,4 +1,4 @@ -import { DataGrid, GridColDef } from "@mui/x-data-grid"; +import { DataGrid, type GridColDef } from "@mui/x-data-grid"; import { DeleteButton, EditButton,