From 63ee33b685010133ab22e30e28c0763c854581f7 Mon Sep 17 00:00:00 2001 From: Matthias Frey Date: Sat, 11 Sep 2021 09:27:22 +0200 Subject: [PATCH] Use 'import type' to import types, eliminate webpack warnings (#358) --- apps/api/src/app/access/access.controller.ts | 2 +- apps/api/src/app/account/account.controller.ts | 2 +- apps/api/src/app/admin/admin.controller.ts | 2 +- .../src/app/auth-device/auth-device.controller.ts | 2 +- apps/api/src/app/auth/web-auth.service.ts | 2 +- apps/api/src/app/cache/cache.controller.ts | 2 +- .../src/app/experimental/experimental.controller.ts | 2 +- apps/api/src/app/export/export.controller.ts | 2 +- apps/api/src/app/import/import.controller.ts | 2 +- apps/api/src/app/order/order.controller.ts | 2 +- apps/api/src/app/portfolio/portfolio.controller.ts | 2 +- apps/api/src/app/portfolio/portfolio.service.ts | 2 +- .../src/app/subscription/subscription.controller.ts | 2 +- apps/api/src/app/symbol/symbol.controller.ts | 2 +- apps/api/src/app/user/user.controller.ts | 2 +- libs/common/src/lib/types/index.ts | 12 ++++++------ 16 files changed, 21 insertions(+), 21 deletions(-) diff --git a/apps/api/src/app/access/access.controller.ts b/apps/api/src/app/access/access.controller.ts index 7dded5328..a738c70d7 100644 --- a/apps/api/src/app/access/access.controller.ts +++ b/apps/api/src/app/access/access.controller.ts @@ -1,5 +1,5 @@ import { Access } from '@ghostfolio/common/interfaces'; -import { RequestWithUser } from '@ghostfolio/common/types'; +import type { RequestWithUser } from '@ghostfolio/common/types'; import { Controller, Get, Inject, UseGuards } from '@nestjs/common'; import { REQUEST } from '@nestjs/core'; import { AuthGuard } from '@nestjs/passport'; diff --git a/apps/api/src/app/account/account.controller.ts b/apps/api/src/app/account/account.controller.ts index 4c25dfa5b..caae33645 100644 --- a/apps/api/src/app/account/account.controller.ts +++ b/apps/api/src/app/account/account.controller.ts @@ -6,7 +6,7 @@ import { hasPermission, permissions } from '@ghostfolio/common/permissions'; -import { RequestWithUser } from '@ghostfolio/common/types'; +import type { RequestWithUser } from '@ghostfolio/common/types'; import { Body, Controller, diff --git a/apps/api/src/app/admin/admin.controller.ts b/apps/api/src/app/admin/admin.controller.ts index fdece8df7..2a2f94988 100644 --- a/apps/api/src/app/admin/admin.controller.ts +++ b/apps/api/src/app/admin/admin.controller.ts @@ -5,7 +5,7 @@ import { hasPermission, permissions } from '@ghostfolio/common/permissions'; -import { RequestWithUser } from '@ghostfolio/common/types'; +import type { RequestWithUser } from '@ghostfolio/common/types'; import { Controller, Get, diff --git a/apps/api/src/app/auth-device/auth-device.controller.ts b/apps/api/src/app/auth-device/auth-device.controller.ts index 4c932bc5a..89a44dd2f 100644 --- a/apps/api/src/app/auth-device/auth-device.controller.ts +++ b/apps/api/src/app/auth-device/auth-device.controller.ts @@ -4,7 +4,7 @@ import { hasPermission, permissions } from '@ghostfolio/common/permissions'; -import { RequestWithUser } from '@ghostfolio/common/types'; +import type { RequestWithUser } from '@ghostfolio/common/types'; import { Controller, Delete, diff --git a/apps/api/src/app/auth/web-auth.service.ts b/apps/api/src/app/auth/web-auth.service.ts index b0368748a..3d8c69b9a 100644 --- a/apps/api/src/app/auth/web-auth.service.ts +++ b/apps/api/src/app/auth/web-auth.service.ts @@ -2,7 +2,7 @@ import { AuthDeviceDto } from '@ghostfolio/api/app/auth-device/auth-device.dto'; import { AuthDeviceService } from '@ghostfolio/api/app/auth-device/auth-device.service'; import { UserService } from '@ghostfolio/api/app/user/user.service'; import { ConfigurationService } from '@ghostfolio/api/services/configuration.service'; -import { RequestWithUser } from '@ghostfolio/common/types'; +import type { RequestWithUser } from '@ghostfolio/common/types'; import { Inject, Injectable, diff --git a/apps/api/src/app/cache/cache.controller.ts b/apps/api/src/app/cache/cache.controller.ts index 21aa5a8b6..df5358240 100644 --- a/apps/api/src/app/cache/cache.controller.ts +++ b/apps/api/src/app/cache/cache.controller.ts @@ -1,6 +1,6 @@ import { CacheService } from '@ghostfolio/api/app/cache/cache.service'; import { RedisCacheService } from '@ghostfolio/api/app/redis-cache/redis-cache.service'; -import { RequestWithUser } from '@ghostfolio/common/types'; +import type { RequestWithUser } from '@ghostfolio/common/types'; import { Controller, Inject, Post, UseGuards } from '@nestjs/common'; import { REQUEST } from '@nestjs/core'; import { AuthGuard } from '@nestjs/passport'; diff --git a/apps/api/src/app/experimental/experimental.controller.ts b/apps/api/src/app/experimental/experimental.controller.ts index 0851e4be4..b2e8e236c 100644 --- a/apps/api/src/app/experimental/experimental.controller.ts +++ b/apps/api/src/app/experimental/experimental.controller.ts @@ -1,7 +1,7 @@ import { baseCurrency, benchmarks } from '@ghostfolio/common/config'; import { DATE_FORMAT } from '@ghostfolio/common/helper'; import { isApiTokenAuthorized } from '@ghostfolio/common/permissions'; -import { RequestWithUser } from '@ghostfolio/common/types'; +import type { RequestWithUser } from '@ghostfolio/common/types'; import { Body, Controller, diff --git a/apps/api/src/app/export/export.controller.ts b/apps/api/src/app/export/export.controller.ts index 692502015..ca318ce81 100644 --- a/apps/api/src/app/export/export.controller.ts +++ b/apps/api/src/app/export/export.controller.ts @@ -1,5 +1,5 @@ import { Export } from '@ghostfolio/common/interfaces'; -import { RequestWithUser } from '@ghostfolio/common/types'; +import type { RequestWithUser } from '@ghostfolio/common/types'; import { Controller, Get, Inject, UseGuards } from '@nestjs/common'; import { REQUEST } from '@nestjs/core'; import { AuthGuard } from '@nestjs/passport'; diff --git a/apps/api/src/app/import/import.controller.ts b/apps/api/src/app/import/import.controller.ts index c5d7f4a6d..c453f7837 100644 --- a/apps/api/src/app/import/import.controller.ts +++ b/apps/api/src/app/import/import.controller.ts @@ -1,5 +1,5 @@ import { ConfigurationService } from '@ghostfolio/api/services/configuration.service'; -import { RequestWithUser } from '@ghostfolio/common/types'; +import type { RequestWithUser } from '@ghostfolio/common/types'; import { Body, Controller, diff --git a/apps/api/src/app/order/order.controller.ts b/apps/api/src/app/order/order.controller.ts index fd5165537..d2c5d02e6 100644 --- a/apps/api/src/app/order/order.controller.ts +++ b/apps/api/src/app/order/order.controller.ts @@ -6,7 +6,7 @@ import { hasPermission, permissions } from '@ghostfolio/common/permissions'; -import { RequestWithUser } from '@ghostfolio/common/types'; +import type { RequestWithUser } from '@ghostfolio/common/types'; import { Body, Controller, diff --git a/apps/api/src/app/portfolio/portfolio.controller.ts b/apps/api/src/app/portfolio/portfolio.controller.ts index e2cf73614..6bacd25d5 100644 --- a/apps/api/src/app/portfolio/portfolio.controller.ts +++ b/apps/api/src/app/portfolio/portfolio.controller.ts @@ -11,7 +11,7 @@ import { PortfolioSummary } from '@ghostfolio/common/interfaces'; import { InvestmentItem } from '@ghostfolio/common/interfaces/investment-item.interface'; -import { RequestWithUser } from '@ghostfolio/common/types'; +import type { RequestWithUser } from '@ghostfolio/common/types'; import { Controller, Get, diff --git a/apps/api/src/app/portfolio/portfolio.service.ts b/apps/api/src/app/portfolio/portfolio.service.ts index 754e0b0e3..29eadfbbe 100644 --- a/apps/api/src/app/portfolio/portfolio.service.ts +++ b/apps/api/src/app/portfolio/portfolio.service.ts @@ -32,7 +32,7 @@ import { TimelinePosition } from '@ghostfolio/common/interfaces'; import { InvestmentItem } from '@ghostfolio/common/interfaces/investment-item.interface'; -import { +import type { DateRange, OrderWithAccount, RequestWithUser diff --git a/apps/api/src/app/subscription/subscription.controller.ts b/apps/api/src/app/subscription/subscription.controller.ts index ecd326ead..96d5a9ecd 100644 --- a/apps/api/src/app/subscription/subscription.controller.ts +++ b/apps/api/src/app/subscription/subscription.controller.ts @@ -1,5 +1,5 @@ import { ConfigurationService } from '@ghostfolio/api/services/configuration.service'; -import { RequestWithUser } from '@ghostfolio/common/types'; +import type { RequestWithUser } from '@ghostfolio/common/types'; import { Body, Controller, diff --git a/apps/api/src/app/symbol/symbol.controller.ts b/apps/api/src/app/symbol/symbol.controller.ts index 61dcba19a..4cb52c6a9 100644 --- a/apps/api/src/app/symbol/symbol.controller.ts +++ b/apps/api/src/app/symbol/symbol.controller.ts @@ -1,4 +1,4 @@ -import { RequestWithUser } from '@ghostfolio/common/types'; +import type { RequestWithUser } from '@ghostfolio/common/types'; import { Controller, Get, diff --git a/apps/api/src/app/user/user.controller.ts b/apps/api/src/app/user/user.controller.ts index 1aa5e7d18..f62599dfd 100644 --- a/apps/api/src/app/user/user.controller.ts +++ b/apps/api/src/app/user/user.controller.ts @@ -4,7 +4,7 @@ import { hasPermission, permissions } from '@ghostfolio/common/permissions'; -import { RequestWithUser } from '@ghostfolio/common/types'; +import type { RequestWithUser } from '@ghostfolio/common/types'; import { Body, Controller, diff --git a/libs/common/src/lib/types/index.ts b/libs/common/src/lib/types/index.ts index 9d6d78b01..f2728ebcc 100644 --- a/libs/common/src/lib/types/index.ts +++ b/libs/common/src/lib/types/index.ts @@ -1,10 +1,10 @@ -import { AccessWithGranteeUser } from './access-with-grantee-user.type'; -import { DateRange } from './date-range.type'; -import { Granularity } from './granularity.type'; -import { OrderWithAccount } from './order-with-account.type'; -import { RequestWithUser } from './request-with-user.type'; +import type { AccessWithGranteeUser } from './access-with-grantee-user.type'; +import type { DateRange } from './date-range.type'; +import type { Granularity } from './granularity.type'; +import type { OrderWithAccount } from './order-with-account.type'; +import type { RequestWithUser } from './request-with-user.type'; -export { +export type { AccessWithGranteeUser, DateRange, Granularity,