From 776432eaaa25acebb87a1724f370dd5a1b3634b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ti=E1=BA=BFn=20Nguy=E1=BB=85n=20Kh=E1=BA=AFc?= Date: Fri, 8 Dec 2023 15:14:13 +1300 Subject: [PATCH] build: use type import for types only library This was causing build failure on the latest version of Vite --- .changeset/pink-turkeys-cough.md | 5 +++++ packages/chaindata-provider-extension/src/codegen.ts | 1 + .../chaindata-provider-extension/src/graphql-codegen/gql.ts | 2 +- .../src/graphql-codegen/graphql.ts | 2 +- 4 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 .changeset/pink-turkeys-cough.md diff --git a/.changeset/pink-turkeys-cough.md b/.changeset/pink-turkeys-cough.md new file mode 100644 index 0000000000..ab15da5d64 --- /dev/null +++ b/.changeset/pink-turkeys-cough.md @@ -0,0 +1,5 @@ +--- +"@talismn/chaindata-provider-extension": patch +--- + +build: use type import for types only library diff --git a/packages/chaindata-provider-extension/src/codegen.ts b/packages/chaindata-provider-extension/src/codegen.ts index 7186336314..1821853a3f 100644 --- a/packages/chaindata-provider-extension/src/codegen.ts +++ b/packages/chaindata-provider-extension/src/codegen.ts @@ -30,6 +30,7 @@ const config: CodegenConfig = { // defaults to `any` - let's go with `unknown` instead :) JSON: "unknown", }, + useTypeImports: true, }, hooks: { afterAllFileWrite: ["prettier --write"] }, }, diff --git a/packages/chaindata-provider-extension/src/graphql-codegen/gql.ts b/packages/chaindata-provider-extension/src/graphql-codegen/gql.ts index 65526d566a..844dd07a6b 100644 --- a/packages/chaindata-provider-extension/src/graphql-codegen/gql.ts +++ b/packages/chaindata-provider-extension/src/graphql-codegen/gql.ts @@ -1,4 +1,4 @@ -import { TypedDocumentNode as DocumentNode } from "@graphql-typed-document-node/core" +import type { TypedDocumentNode as DocumentNode } from "@graphql-typed-document-node/core" /* eslint-disable */ import * as types from "./graphql" diff --git a/packages/chaindata-provider-extension/src/graphql-codegen/graphql.ts b/packages/chaindata-provider-extension/src/graphql-codegen/graphql.ts index b8c7441f85..1d542e3f73 100644 --- a/packages/chaindata-provider-extension/src/graphql-codegen/graphql.ts +++ b/packages/chaindata-provider-extension/src/graphql-codegen/graphql.ts @@ -1,5 +1,5 @@ /* eslint-disable */ -import { TypedDocumentNode as DocumentNode } from "@graphql-typed-document-node/core" +import type { TypedDocumentNode as DocumentNode } from "@graphql-typed-document-node/core" export type Maybe = T | null export type InputMaybe = Maybe export type Exact = { [K in keyof T]: T[K] }