diff --git a/docs/docs/platform-api.md b/docs/docs/platform-api.md index f755f10412f..d9e455370ad 100644 --- a/docs/docs/platform-api.md +++ b/docs/docs/platform-api.md @@ -203,7 +203,7 @@ Or use the `app.statics()` method: ```typescript [Decorators] import {Injectable} from "@tsed/di"; import {PlatformApplication} from "@tsed/platform-http"; -import {join} from "path"; +import {join} from "node:path"; @Injectable() export class MyService { @@ -218,7 +218,7 @@ export class MyService { ```typescript [Functional API] import {injectable} from "@tsed/di"; import {application} from "@tsed/platform-http"; -import {join} from "path"; +import {join} from "node:path"; export class MyService { protected app = application(); diff --git a/docs/docs/snippets/controllers/inject-next.ts b/docs/docs/snippets/controllers/inject-next.ts index 99cb6d28df2..3194f905552 100644 --- a/docs/docs/snippets/controllers/inject-next.ts +++ b/docs/docs/snippets/controllers/inject-next.ts @@ -2,7 +2,7 @@ import {Next, Req, Res} from "@tsed/platform-http"; import {Get} from "@tsed/schema"; import {Controller} from "@tsed/di"; import * as Express from "express"; -import {promisify} from "util"; +import {promisify} from "node:util"; @Controller("/calendars") export class CalendarCtrl { diff --git a/docs/docs/snippets/controllers/inject-req-res-node.ts b/docs/docs/snippets/controllers/inject-req-res-node.ts index b569245aa2d..86d09eef5cd 100644 --- a/docs/docs/snippets/controllers/inject-req-res-node.ts +++ b/docs/docs/snippets/controllers/inject-req-res-node.ts @@ -1,7 +1,7 @@ import {Req, Res} from "@tsed/platform-http"; import {Get} from "@tsed/schema"; import {Controller} from "@tsed/di"; -import {IncomingMessage, ServerResponse} from "http"; +import {IncomingMessage, ServerResponse} from "node:http"; @Controller("/calendars") export class CalendarCtrl { diff --git a/docs/docs/snippets/model/pagination-spec.ts b/docs/docs/snippets/model/pagination-spec.ts index 798286074cd..c8249a18092 100644 --- a/docs/docs/snippets/model/pagination-spec.ts +++ b/docs/docs/snippets/model/pagination-spec.ts @@ -1,6 +1,6 @@ import {PlatformTest} from "@tsed/platform-http/testing"; import {getSpec, SpecTypes} from "@tsed/schema"; -import * as qs from "querystring"; +import * as qs from "node:querystring"; import * as SuperTest from "supertest"; import {PaginationFilter} from "../filters/PaginationFilter"; import {ProductsCtrl} from "./ProductsCtrl"; diff --git a/docs/tutorials/graphql-apollo.md b/docs/tutorials/graphql-apollo.md index 614e754ab3f..120249a7e20 100644 --- a/docs/tutorials/graphql-apollo.md +++ b/docs/tutorials/graphql-apollo.md @@ -47,7 +47,7 @@ npm install --save-dev apollo-server-testing import {Configuration} from "@tsed/di"; import "@tsed/platform-express"; import "@tsed/apollo"; -import {join} from "path"; +import {join} from "node:path"; @Configuration({ apollo: { @@ -76,7 +76,7 @@ You can register plugins with the `plugins` property. The plugins are executed i import {Configuration} from "@tsed/di"; import "@tsed/platform-express"; import "@tsed/apollo"; -import {join} from "path"; +import {join} from "node:path"; @Configuration({ apollo: { @@ -94,8 +94,8 @@ you can register the `graphql-ws` necessary to support the `subscription` featur ```typescript import {Constant, Inject, InjectorService, Module} from "@tsed/di"; import {useServer} from "graphql-ws/lib/use/ws"; -import Http from "http"; -import Https from "https"; +import Http from "node:http"; +import Https from "node:https"; import {WebSocketServer} from "ws"; import {GraphQLWSOptions} from "./GraphQLWSOptions"; diff --git a/docs/tutorials/graphql-nexus.md b/docs/tutorials/graphql-nexus.md index 73f0cdfb0ce..da2e305caec 100644 --- a/docs/tutorials/graphql-nexus.md +++ b/docs/tutorials/graphql-nexus.md @@ -40,7 +40,7 @@ import {Configuration} from "@tsed/di"; import "@tsed/platform-express"; import "@tsed/apollo"; import {schema} from "./schema"; -import {join} from "path"; +import {join} from "node:path"; @Configuration({ apollo: { @@ -67,7 +67,7 @@ Then create `schema/index.ts`: ```typescript import {makeSchema} from "nexus"; -import {join} from "path"; +import {join} from "node:path"; export const schema = makeSchema({ types: [], // 1 diff --git a/docs/tutorials/graphql-ws.md b/docs/tutorials/graphql-ws.md index 87fa302c989..bb5e8b134df 100644 --- a/docs/tutorials/graphql-ws.md +++ b/docs/tutorials/graphql-ws.md @@ -41,7 +41,7 @@ import {Configuration} from "@tsed/di"; import "@tsed/platform-express"; import "@tsed/apollo"; import "@tsed/graphql-ws"; // auto import plugin for @tsed/apollo -import {join} from "path"; +import {join} from "node:path"; @Configuration({ apollo: { @@ -120,7 +120,7 @@ import "@tsed/platform-express"; import "@tsed/apollo"; import "@tsed/typegraphql"; import "@tsed/graphql-ws"; // auto import plugin for @tsed/apollo -import {join} from "path"; +import {join} from "node:path"; import {pubsub} from "./pubsub/pubsub"; @Configuration({ diff --git a/docs/tutorials/snippets/graphql/graphql-ws.md b/docs/tutorials/snippets/graphql/graphql-ws.md index a4f1e98a7c1..8852c446472 100644 --- a/docs/tutorials/snippets/graphql/graphql-ws.md +++ b/docs/tutorials/snippets/graphql/graphql-ws.md @@ -44,7 +44,7 @@ import {Configuration} from "@tsed/common"; import "@tsed/platform-express"; import "@tsed/apollo"; import "@tsed/graphql-ws"; -import {join} from "path"; +import {join} from "node:path"; @Configuration({ apollo: { @@ -90,7 +90,7 @@ You can register plugins with the `plugins` property. The plugins are executed i import {Configuration} from "@tsed/common"; import "@tsed/platform-express"; import "@tsed/apollo"; -import {join} from "path"; +import {join} from "node:path"; @Configuration({ apollo: { @@ -108,8 +108,8 @@ you can register the `graphql-ws` necessary to support the `subscription` featur ```typescript import {Constant, Inject, InjectorService, Module} from "@tsed/di"; import {useServer} from "graphql-ws/lib/use/ws"; -import Http from "http"; -import Https from "https"; +import Http from "node:http"; +import Https from "node:https"; import {WebSocketServer} from "ws"; import {GraphQLWSOptions} from "./GraphQLWSOptions"; @@ -199,7 +199,7 @@ import {Configuration} from "@tsed/common"; import "@tsed/platform-express"; import "@tsed/apollo"; import {schema} from "./schema"; -import {join} from "path"; +import {join} from "node:path"; @Configuration({ apollo: { @@ -226,7 +226,7 @@ Then create `schema/index.ts`: ```typescript import {makeSchema} from "nexus"; -import {join} from "path"; +import {join} from "node:path"; export const schema = makeSchema({ types: [], // 1 diff --git a/docs/tutorials/terminus.md b/docs/tutorials/terminus.md index f47a66d0160..022c03db391 100644 --- a/docs/tutorials/terminus.md +++ b/docs/tutorials/terminus.md @@ -43,7 +43,7 @@ Then import `@tsed/terminus` and add the following configuration in your `Server ```typescript import {Configuration} from "@tsed/di"; import "@tsed/terminus"; // import terminus Ts.ED module -import {resolve} from "path"; +import {resolve} from "node:path"; @Configuration({ terminus: { diff --git a/docs/tutorials/vike.md b/docs/tutorials/vike.md index 7a431764b86..7a99f0d3c03 100644 --- a/docs/tutorials/vike.md +++ b/docs/tutorials/vike.md @@ -56,7 +56,7 @@ npm install vike @tsed/vike vite@4 --save Then edit your `Server.ts`: ```ts -import {join} from "path"; +import {join} from "node:path"; import {Configuration, Inject} from "@tsed/di"; import {PlatformApplication} from "@tsed/common"; import "@tsed/platform-express"; // /!\ keep this import diff --git a/packages/core/src/domain/AnyToPromise.spec.ts b/packages/core/src/domain/AnyToPromise.spec.ts index 959986d35a4..ff53705ac3b 100644 --- a/packages/core/src/domain/AnyToPromise.spec.ts +++ b/packages/core/src/domain/AnyToPromise.spec.ts @@ -1,4 +1,5 @@ -import {createReadStream} from "fs"; +import {createReadStream} from "node:fs"; + import {of} from "rxjs"; import {catchAsyncError} from "../utils/catchError.js"; diff --git a/packages/di/src/node/utils/asyncHookContext.ts b/packages/di/src/node/utils/asyncHookContext.ts index 8d69bada202..91243395975 100644 --- a/packages/di/src/node/utils/asyncHookContext.ts +++ b/packages/di/src/node/utils/asyncHookContext.ts @@ -1,4 +1,4 @@ -import {AsyncLocalStorage, AsyncResource} from "async_hooks"; +import {AsyncLocalStorage, AsyncResource} from "node:async_hooks"; import {InjectorService} from "../../common/index.js"; import type {DIContext} from "../domain/DIContext.js"; diff --git a/packages/engines/src/components/DustEngine.ts b/packages/engines/src/components/DustEngine.ts index 8a878cfcc58..d190cf876b4 100644 --- a/packages/engines/src/components/DustEngine.ts +++ b/packages/engines/src/components/DustEngine.ts @@ -1,5 +1,5 @@ -import {extname} from "path"; -import {promisify} from "util"; +import {extname} from "node:path"; +import {promisify} from "node:util"; import {ViewEngine} from "../decorators/viewEngine.js"; import {read} from "../utils/cache.js"; diff --git a/packages/engines/src/components/EctEngine.ts b/packages/engines/src/components/EctEngine.ts index c7284cd811b..11253369d53 100644 --- a/packages/engines/src/components/EctEngine.ts +++ b/packages/engines/src/components/EctEngine.ts @@ -1,4 +1,4 @@ -import {promisify} from "util"; +import {promisify} from "node:util"; import {ViewEngine} from "../decorators/viewEngine.js"; import {Engine} from "./Engine.js"; diff --git a/packages/engines/src/components/HoganEngine.spec.ts b/packages/engines/src/components/HoganEngine.spec.ts index 98349d1be0a..173b6f47d84 100644 --- a/packages/engines/src/components/HoganEngine.spec.ts +++ b/packages/engines/src/components/HoganEngine.spec.ts @@ -1,4 +1,4 @@ -import {join} from "path"; +import {join} from "node:path"; import {getEngineFixture} from "../../test/getEngineFixture.js"; import {HoganEngine} from "./HoganEngine.js"; diff --git a/packages/engines/src/components/JustEngine.ts b/packages/engines/src/components/JustEngine.ts index 4fd060f0838..61e413a1f43 100644 --- a/packages/engines/src/components/JustEngine.ts +++ b/packages/engines/src/components/JustEngine.ts @@ -1,4 +1,4 @@ -import {promisify} from "util"; +import {promisify} from "node:util"; import {ViewEngine} from "../decorators/viewEngine.js"; import {Engine} from "./Engine.js"; diff --git a/packages/engines/src/components/NunjucksEngine.ts b/packages/engines/src/components/NunjucksEngine.ts index 18f87ab9b89..0c4f3f50716 100644 --- a/packages/engines/src/components/NunjucksEngine.ts +++ b/packages/engines/src/components/NunjucksEngine.ts @@ -1,4 +1,4 @@ -import {promisify} from "util"; +import {promisify} from "node:util"; import {ViewEngine} from "../decorators/viewEngine.js"; import {Engine} from "./Engine.js"; diff --git a/packages/engines/src/components/ReactEngine.ts b/packages/engines/src/components/ReactEngine.ts index 32a554b928c..c4db016f64e 100644 --- a/packages/engines/src/components/ReactEngine.ts +++ b/packages/engines/src/components/ReactEngine.ts @@ -1,5 +1,5 @@ -import {readFileSync} from "fs"; -import {resolve} from "path"; +import {readFileSync} from "node:fs"; +import {resolve} from "node:path"; import {ViewEngine} from "../decorators/viewEngine.js"; import {getCachedEngine, getFromCache, importEngine, setToCache} from "../utils/cache.js"; diff --git a/packages/engines/src/components/SquirrellyEngine.spec.ts b/packages/engines/src/components/SquirrellyEngine.spec.ts index 7cc48da5f2a..c733ca253bf 100644 --- a/packages/engines/src/components/SquirrellyEngine.spec.ts +++ b/packages/engines/src/components/SquirrellyEngine.spec.ts @@ -1,4 +1,4 @@ -import {join} from "path"; +import {join} from "node:path"; import {getEngineFixture} from "../../test/getEngineFixture.js"; import {requires} from "../utils/cache.js"; diff --git a/packages/engines/src/components/TwingEngine.ts b/packages/engines/src/components/TwingEngine.ts index be96cf5d7fa..9e103c11277 100644 --- a/packages/engines/src/components/TwingEngine.ts +++ b/packages/engines/src/components/TwingEngine.ts @@ -1,4 +1,4 @@ -import {existsSync} from "fs"; +import {existsSync} from "node:fs"; import {ViewEngine} from "../decorators/viewEngine.js"; import {Engine} from "./Engine.js"; diff --git a/packages/engines/src/components/VashEngine.ts b/packages/engines/src/components/VashEngine.ts index 1b65cac677c..9005e5bba32 100644 --- a/packages/engines/src/components/VashEngine.ts +++ b/packages/engines/src/components/VashEngine.ts @@ -1,4 +1,4 @@ -import {promisify} from "util"; +import {promisify} from "node:util"; import {ViewEngine} from "../decorators/viewEngine.js"; import {Engine} from "./Engine.js"; diff --git a/packages/engines/src/utils/cache.ts b/packages/engines/src/utils/cache.ts index 8689fa8e819..d33d159449c 100644 --- a/packages/engines/src/utils/cache.ts +++ b/packages/engines/src/utils/cache.ts @@ -1,8 +1,7 @@ +import fs from "node:fs"; import {readFile} from "node:fs/promises"; import {dirname, extname, isAbsolute, join} from "node:path"; -import fs from "fs"; - const readCache: Map = new Map(); const cacheStore: Map = new Map(); diff --git a/packages/engines/src/utils/getEngines.spec.ts b/packages/engines/src/utils/getEngines.spec.ts index baaa756b942..a8e7105d2f3 100644 --- a/packages/engines/src/utils/getEngines.spec.ts +++ b/packages/engines/src/utils/getEngines.spec.ts @@ -1,6 +1,6 @@ import "../index.js"; -import {join} from "path"; +import {join} from "node:path"; import {getEngine, getEngines} from "./getEngines.js"; diff --git a/packages/engines/test/getEngineFixture.ts b/packages/engines/test/getEngineFixture.ts index 381d99443f4..f198bb88053 100644 --- a/packages/engines/test/getEngineFixture.ts +++ b/packages/engines/test/getEngineFixture.ts @@ -1,4 +1,4 @@ -import fs from "fs"; +import fs from "node:fs"; import {Engine} from "../src/components/Engine.js"; import {engines} from "../src/index.js"; diff --git a/packages/engines/test/shared/dust.ts b/packages/engines/test/shared/dust.ts index 3b750056b74..9ccbcba3e7b 100644 --- a/packages/engines/test/shared/dust.ts +++ b/packages/engines/test/shared/dust.ts @@ -1,5 +1,5 @@ -import fs from "fs"; -import {join} from "path"; +import fs from "node:fs"; +import {join} from "node:path"; import {engines, requires} from "../../src/index.js"; diff --git a/packages/engines/test/shared/filters.ts b/packages/engines/test/shared/filters.ts index 09dbb21c01c..90b3a488952 100644 --- a/packages/engines/test/shared/filters.ts +++ b/packages/engines/test/shared/filters.ts @@ -1,5 +1,5 @@ -import fs from "fs"; -import {join} from "path"; +import fs from "node:fs"; +import {join} from "node:path"; import {engines} from "../../src/index.js"; diff --git a/packages/engines/test/shared/helpers.ts b/packages/engines/test/shared/helpers.ts index cf1adacef25..efb29ba996e 100644 --- a/packages/engines/test/shared/helpers.ts +++ b/packages/engines/test/shared/helpers.ts @@ -1,6 +1,7 @@ -import fs from "fs"; +import fs from "node:fs"; +import {join} from "node:path"; + import handlebars from "handlebars"; -import {join} from "path"; import {engines} from "../../src/index.js"; diff --git a/packages/engines/test/shared/includes.ts b/packages/engines/test/shared/includes.ts index 44c38f9669e..9410f349b27 100644 --- a/packages/engines/test/shared/includes.ts +++ b/packages/engines/test/shared/includes.ts @@ -1,5 +1,5 @@ -import fs from "fs"; -import {join} from "path"; +import fs from "node:fs"; +import {join} from "node:path"; import {engines} from "../../src/index.js"; diff --git a/packages/engines/test/shared/index.ts b/packages/engines/test/shared/index.ts index 2a8999171ce..a156f559818 100644 --- a/packages/engines/test/shared/index.ts +++ b/packages/engines/test/shared/index.ts @@ -1,5 +1,5 @@ -import fs from "fs"; -import {join} from "path"; +import fs from "node:fs"; +import {join} from "node:path"; import {engines, requires} from "../../src/index.js"; diff --git a/packages/engines/test/shared/partials.ts b/packages/engines/test/shared/partials.ts index 4faf7708a1b..3683c232dd8 100644 --- a/packages/engines/test/shared/partials.ts +++ b/packages/engines/test/shared/partials.ts @@ -1,5 +1,5 @@ -import fs from "fs"; -import {join} from "path"; +import fs from "node:fs"; +import {join} from "node:path"; import {engines} from "../../src/index.js"; diff --git a/packages/engines/test/shared/react.ts b/packages/engines/test/shared/react.ts index 4a30583e4c6..42721850544 100644 --- a/packages/engines/test/shared/react.ts +++ b/packages/engines/test/shared/react.ts @@ -1,5 +1,5 @@ -import fs from "fs"; -import {join} from "path"; +import fs from "node:fs"; +import {join} from "node:path"; import {engines} from "../../src/index.js"; diff --git a/packages/graphql/apollo/src/services/ApolloService.ts b/packages/graphql/apollo/src/services/ApolloService.ts index d3411218d99..9604569a00e 100644 --- a/packages/graphql/apollo/src/services/ApolloService.ts +++ b/packages/graphql/apollo/src/services/ApolloService.ts @@ -1,3 +1,6 @@ +import Http from "node:http"; +import Https from "node:https"; + import {ApolloServer, ApolloServerOptions, ApolloServerPlugin} from "@apollo/server"; import {ApolloServerPluginLandingPageDisabled} from "@apollo/server/plugin/disabled"; import {ApolloServerPluginDrainHttpServer} from "@apollo/server/plugin/drainHttpServer"; @@ -7,8 +10,6 @@ import {Constant, context, Inject, InjectorService, LocalsContainer, Provider, S import {Logger} from "@tsed/logger"; import {PlatformApplication, PlatformContext} from "@tsed/platform-http"; import type {GraphQLSchema} from "graphql"; -import Http from "http"; -import Https from "https"; import {APOLLO_CONTEXT, DATASOURCES_PROVIDERS} from "../constants/constants.js"; import {ApolloContext} from "../interfaces/ApolloContext.js"; diff --git a/packages/graphql/graphql-ws/src/GraphQLWSModule.ts b/packages/graphql/graphql-ws/src/GraphQLWSModule.ts index a36593e133d..90cbc41fecc 100644 --- a/packages/graphql/graphql-ws/src/GraphQLWSModule.ts +++ b/packages/graphql/graphql-ws/src/GraphQLWSModule.ts @@ -1,8 +1,9 @@ +import Http from "node:http"; +import Https from "node:https"; + import {Constant, Inject, InjectorService, Module} from "@tsed/di"; import type {Disposable} from "graphql-ws"; import {useServer} from "graphql-ws/lib/use/ws"; -import Http from "http"; -import Https from "https"; import {GraphQLWSOptions} from "./GraphQLWSOptions.js"; diff --git a/packages/graphql/typegraphql/test/app/Server.ts b/packages/graphql/typegraphql/test/app/Server.ts index c1e34772f6d..eed2ff9b992 100644 --- a/packages/graphql/typegraphql/test/app/Server.ts +++ b/packages/graphql/typegraphql/test/app/Server.ts @@ -10,12 +10,12 @@ import "@tsed/platform-log-request"; import * as fs from "node:fs"; import {join} from "node:path"; +import {resolve} from "node:path"; import {ApolloContext} from "@tsed/apollo"; import {Configuration, Constant, Inject} from "@tsed/di"; import {PlatformApplication, PlatformContext} from "@tsed/platform-http"; import {buildContext} from "graphql-passport"; -import {resolve} from "path"; import {HelloController} from "./controllers/HelloController.js"; import {User} from "./graphql/auth/User.js"; diff --git a/packages/orm/adapters/src/adapters/FileSyncAdapter.ts b/packages/orm/adapters/src/adapters/FileSyncAdapter.ts index 8764e1c6cbc..82a4d4f0e58 100644 --- a/packages/orm/adapters/src/adapters/FileSyncAdapter.ts +++ b/packages/orm/adapters/src/adapters/FileSyncAdapter.ts @@ -1,9 +1,10 @@ +import {dirname} from "node:path"; + import {nameOf} from "@tsed/core"; import {Configuration, Injectable, Opts, ProviderScope, Scope} from "@tsed/di"; import fs from "fs-extra"; import {LowSync} from "lowdb"; import {JSONFileSync} from "lowdb/node"; -import {dirname} from "path"; import {AdapterConstructorOptions} from "../domain/Adapter.js"; import {AdapterModel, LowDbAdapter, type LowModel} from "./LowDbAdapter.js"; diff --git a/packages/orm/objection/src/components/createIdColumn.ts b/packages/orm/objection/src/components/createIdColumn.ts index 58a14c0956d..08503adb602 100644 --- a/packages/orm/objection/src/components/createIdColumn.ts +++ b/packages/orm/objection/src/components/createIdColumn.ts @@ -1,4 +1,5 @@ -import {randomUUID} from "crypto"; +import {randomUUID} from "node:crypto"; + import type {Knex} from "knex"; import {ColumnTypesContainer} from "../services/ColumnTypesContainer.js"; diff --git a/packages/orm/prisma/src/__mock__/createProjectFixture.ts b/packages/orm/prisma/src/__mock__/createProjectFixture.ts index 41940dcd9b8..74dbaf28699 100644 --- a/packages/orm/prisma/src/__mock__/createProjectFixture.ts +++ b/packages/orm/prisma/src/__mock__/createProjectFixture.ts @@ -1,4 +1,5 @@ -import {join} from "path"; +import {join} from "node:path"; + import {ModuleKind, Project, ScriptTarget} from "ts-morph"; const rootDir = import.meta.dirname; // automatically replaced by import.meta.dirname on build diff --git a/packages/orm/prisma/src/cli/prismaGenerator.ts b/packages/orm/prisma/src/cli/prismaGenerator.ts index 0bb8f6903bc..6d03e615a6f 100644 --- a/packages/orm/prisma/src/cli/prismaGenerator.ts +++ b/packages/orm/prisma/src/cli/prismaGenerator.ts @@ -1,7 +1,8 @@ +import path, {join} from "node:path"; + import {GeneratorOptions} from "@prisma/generator-helper"; import internals from "@prisma/internals"; import fs from "fs-extra"; -import path, {join} from "path"; import {generateCode} from "../generator/generateCode.js"; import removeDir from "../generator/utils/removeDir.js"; diff --git a/packages/orm/prisma/src/generator.ts b/packages/orm/prisma/src/generator.ts index 32e1a9ff715..3486b4f97fe 100644 --- a/packages/orm/prisma/src/generator.ts +++ b/packages/orm/prisma/src/generator.ts @@ -1,6 +1,7 @@ #!/usr/bin/env node +import {join} from "node:path"; + import helpers from "@prisma/generator-helper"; -import {join} from "path"; import {generate} from "./cli/prismaGenerator.js"; diff --git a/packages/orm/prisma/src/generator/utils/generateClientIndex.ts b/packages/orm/prisma/src/generator/utils/generateClientIndex.ts index da32a21ca93..dc9fb2b2f0b 100644 --- a/packages/orm/prisma/src/generator/utils/generateClientIndex.ts +++ b/packages/orm/prisma/src/generator/utils/generateClientIndex.ts @@ -1,4 +1,5 @@ -import path from "path"; +import path from "node:path"; + import {Project} from "ts-morph"; import {GenerateCodeOptions} from "../generateCode.js"; diff --git a/packages/orm/prisma/src/generator/utils/generateEnums.ts b/packages/orm/prisma/src/generator/utils/generateEnums.ts index 79f54af17b0..30379083a36 100644 --- a/packages/orm/prisma/src/generator/utils/generateEnums.ts +++ b/packages/orm/prisma/src/generator/utils/generateEnums.ts @@ -1,6 +1,7 @@ +import path from "node:path"; + import {DMMF} from "@prisma/generator-helper"; import {toMap} from "@tsed/core"; -import path from "path"; import {Project} from "ts-morph"; import {DmmfEnum} from "../domain/DmmfEnum.js"; diff --git a/packages/orm/prisma/src/generator/utils/generateIndex.ts b/packages/orm/prisma/src/generator/utils/generateIndex.ts index 8e360e849df..fe9804824b1 100644 --- a/packages/orm/prisma/src/generator/utils/generateIndex.ts +++ b/packages/orm/prisma/src/generator/utils/generateIndex.ts @@ -1,4 +1,5 @@ -import path from "path"; +import path from "node:path"; + import {Project} from "ts-morph"; import {resolveExtension} from "./resolveExtension.js"; diff --git a/packages/orm/prisma/src/generator/utils/generateInterfaces.ts b/packages/orm/prisma/src/generator/utils/generateInterfaces.ts index 59eed0413bf..2a1bd6ff32a 100644 --- a/packages/orm/prisma/src/generator/utils/generateInterfaces.ts +++ b/packages/orm/prisma/src/generator/utils/generateInterfaces.ts @@ -1,4 +1,5 @@ -import path from "path"; +import path from "node:path"; + import {ModuleDeclarationKind, Project, StructureKind} from "ts-morph"; import {resolveExtension} from "./resolveExtension.js"; diff --git a/packages/orm/prisma/src/generator/utils/generateModels.ts b/packages/orm/prisma/src/generator/utils/generateModels.ts index a9fae05c00e..631eec57f72 100644 --- a/packages/orm/prisma/src/generator/utils/generateModels.ts +++ b/packages/orm/prisma/src/generator/utils/generateModels.ts @@ -1,6 +1,7 @@ +import path from "node:path"; + import {DMMF} from "@prisma/generator-helper"; import {getValue, toMap} from "@tsed/core"; -import path from "path"; import {Project} from "ts-morph"; import {DmmfModel} from "../domain/DmmfModel.js"; diff --git a/packages/orm/prisma/src/generator/utils/generatePrismaService.ts b/packages/orm/prisma/src/generator/utils/generatePrismaService.ts index 90897a164b4..40d92d911d6 100644 --- a/packages/orm/prisma/src/generator/utils/generatePrismaService.ts +++ b/packages/orm/prisma/src/generator/utils/generatePrismaService.ts @@ -1,4 +1,5 @@ -import path from "path"; +import path from "node:path"; + import {Project, Scope} from "ts-morph"; import {resolveExtension} from "./resolveExtension.js"; diff --git a/packages/orm/prisma/src/generator/utils/generateRepositories.ts b/packages/orm/prisma/src/generator/utils/generateRepositories.ts index 3d41cc4c113..078adaddc12 100644 --- a/packages/orm/prisma/src/generator/utils/generateRepositories.ts +++ b/packages/orm/prisma/src/generator/utils/generateRepositories.ts @@ -1,7 +1,8 @@ +import path from "node:path"; + import {DMMF} from "@prisma/generator-helper"; import {toMap} from "@tsed/core"; import {camelCase, pascalCase} from "change-case"; -import path from "path"; import pluralize from "pluralize"; import {ClassDeclaration, Project, Scope} from "ts-morph"; diff --git a/packages/orm/prisma/src/generator/utils/removeDir.ts b/packages/orm/prisma/src/generator/utils/removeDir.ts index bc390fb495a..2e032843915 100644 --- a/packages/orm/prisma/src/generator/utils/removeDir.ts +++ b/packages/orm/prisma/src/generator/utils/removeDir.ts @@ -1,5 +1,5 @@ -import {promises as fs} from "fs"; -import path from "path"; +import {promises as fs} from "node:fs"; +import path from "node:path"; export default async function removeDir(dirPath: string, onlyContent: boolean) { const dirEntries = await fs.readdir(dirPath, {withFileTypes: true}); diff --git a/packages/platform/common/readme.md b/packages/platform/common/readme.md index c4ae92e8570..f0469024801 100644 --- a/packages/platform/common/readme.md +++ b/packages/platform/common/readme.md @@ -77,7 +77,7 @@ Here an example to create a Server with Ts.ED: import {Configuration, Inject} from "@tsed/di"; import {PlatformApplication} from "@tsed/platform-http"; import "@tsed/platform-express"; -import Path from "path"; +import Path from "node:path"; import cookieParser from "cookie-parser"; import compress from "compression"; import methodOverride from "method-override"; diff --git a/packages/platform/platform-cache/src/interceptors/PlatformCacheInterceptor.ts b/packages/platform/platform-cache/src/interceptors/PlatformCacheInterceptor.ts index b3d50fcce07..42d9a63533c 100644 --- a/packages/platform/platform-cache/src/interceptors/PlatformCacheInterceptor.ts +++ b/packages/platform/platform-cache/src/interceptors/PlatformCacheInterceptor.ts @@ -1,8 +1,9 @@ +import {IncomingMessage, ServerResponse} from "node:http"; + import {isClass, isString, nameOf} from "@tsed/core"; import {BaseContext, Constant, DIContext, Inject, Interceptor, InterceptorContext, InterceptorMethods, InterceptorNext} from "@tsed/di"; import {deserialize, serialize} from "@tsed/json-mapper"; import {Logger} from "@tsed/logger"; -import {IncomingMessage, ServerResponse} from "http"; import {PlatformCachedObject} from "../interfaces/PlatformCachedObject.js"; import {PlatformCacheOptions} from "../interfaces/PlatformCacheOptions.js"; diff --git a/packages/platform/platform-cache/src/services/PlatformCache.ts b/packages/platform/platform-cache/src/services/PlatformCache.ts index 7ce62faafd6..6d7e23c96c1 100644 --- a/packages/platform/platform-cache/src/services/PlatformCache.ts +++ b/packages/platform/platform-cache/src/services/PlatformCache.ts @@ -1,8 +1,9 @@ +import {AsyncLocalStorage} from "node:async_hooks"; + import {isClass, isFunction, isString, Type} from "@tsed/core"; import {Configuration, Inject, InjectorService, Module} from "@tsed/di"; import {deserialize, JsonDeserializerOptions, serialize} from "@tsed/json-mapper"; import {Logger} from "@tsed/logger"; -import {AsyncLocalStorage} from "async_hooks"; import type {Cache, CachingConfig, MultiCache} from "cache-manager"; import {PlatformCacheSettings} from "../interfaces/interfaces.js"; diff --git a/packages/platform/platform-express/src/components/PlatformExpress.ts b/packages/platform/platform-express/src/components/PlatformExpress.ts index 75f1b38f5a6..96e09c9f4ea 100644 --- a/packages/platform/platform-express/src/components/PlatformExpress.ts +++ b/packages/platform/platform-express/src/components/PlatformExpress.ts @@ -1,3 +1,6 @@ +import {IncomingMessage, ServerResponse} from "node:http"; +import {promisify} from "node:util"; + import {catchAsyncError, Env, isFunction, Type} from "@tsed/core"; import {constant, inject, logger, runInContext} from "@tsed/di"; import {PlatformExceptions} from "@tsed/platform-exceptions"; @@ -20,9 +23,7 @@ import { import {PlatformHandlerMetadata, PlatformHandlerType, PlatformLayer} from "@tsed/platform-router"; import {OptionsJson, OptionsText, OptionsUrlencoded} from "body-parser"; import Express from "express"; -import {IncomingMessage, ServerResponse} from "http"; import type multer from "multer"; -import {promisify} from "util"; import {PlatformExpressStaticsOptions} from "../interfaces/PlatformExpressStaticsOptions.js"; import {staticsMiddleware} from "../middlewares/staticsMiddleware.js"; diff --git a/packages/platform/platform-express/src/services/PlatformExpressHandler.ts b/packages/platform/platform-express/src/services/PlatformExpressHandler.ts index 237012345b3..b37ba2d5717 100644 --- a/packages/platform/platform-express/src/services/PlatformExpressHandler.ts +++ b/packages/platform/platform-express/src/services/PlatformExpressHandler.ts @@ -1,6 +1,7 @@ +import {promisify} from "node:util"; + import {AnyPromiseResult, isFunction, isStream} from "@tsed/core"; import {PlatformContext, PlatformHandler} from "@tsed/platform-http"; -import {promisify} from "util"; export class PlatformExpressHandler extends PlatformHandler { onResponse(response: AnyPromiseResult, $ctx: PlatformContext): any { diff --git a/packages/platform/platform-express/test/app/emulate.ts b/packages/platform/platform-express/test/app/emulate.ts index dd389cafbaf..f01d16cadc7 100644 --- a/packages/platform/platform-express/test/app/emulate.ts +++ b/packages/platform/platform-express/test/app/emulate.ts @@ -1,7 +1,8 @@ +import http from "node:http"; + import {Controller} from "@tsed/di"; import {QueryParams} from "@tsed/platform-params"; import {Get} from "@tsed/schema"; -import http from "http"; import {PlatformExpress} from "../../src/index.js.js"; import {Server} from "./Server.js"; diff --git a/packages/platform/platform-express/test/app/index.ts b/packages/platform/platform-express/test/app/index.ts index 3118a832d83..87268fb8297 100644 --- a/packages/platform/platform-express/test/app/index.ts +++ b/packages/platform/platform-express/test/app/index.ts @@ -1,7 +1,8 @@ +import {promisify} from "node:util"; + import {$log, BodyParams, Controller, PlatformResponse, QueryParams, Res} from "@tsed/platform-http"; import {Get, Post, Returns} from "@tsed/schema"; import {agent, SuperAgentStatic} from "superagent"; -import {promisify} from "util"; import {PlatformExpress} from "../../src/index.js"; import {Server} from "./Server.js"; diff --git a/packages/platform/platform-express/test/pageable.spec.ts b/packages/platform/platform-express/test/pageable.spec.ts index c457183a82d..62400b1e6cf 100644 --- a/packages/platform/platform-express/test/pageable.spec.ts +++ b/packages/platform/platform-express/test/pageable.spec.ts @@ -1,3 +1,5 @@ +import qs from "node:querystring"; + import {isString} from "@tsed/core"; import {Controller} from "@tsed/di"; import {OnDeserialize} from "@tsed/json-mapper"; @@ -24,7 +26,6 @@ import { SpecTypes, string } from "@tsed/schema"; -import qs from "querystring"; import SuperTest from "supertest"; import {PlatformExpress} from "../src/index.js"; diff --git a/packages/platform/platform-express/test/query-parser.spec.ts b/packages/platform/platform-express/test/query-parser.spec.ts index 9a8ddb73dda..77fcafd4ef5 100644 --- a/packages/platform/platform-express/test/query-parser.spec.ts +++ b/packages/platform/platform-express/test/query-parser.spec.ts @@ -1,10 +1,11 @@ +import {parse} from "node:querystring"; + import {Configuration, Controller, Inject} from "@tsed/di"; import {PlatformApplication} from "@tsed/platform-http"; import {PlatformTest} from "@tsed/platform-http/testing"; import {QueryParams} from "@tsed/platform-params"; import {PlatformTestSdk} from "@tsed/platform-test-sdk"; import {Get} from "@tsed/schema"; -import {parse} from "querystring"; import SuperTest from "supertest"; import {PlatformExpress} from "../src/index.js"; diff --git a/packages/platform/platform-express/test/response-filter.spec.ts b/packages/platform/platform-express/test/response-filter.spec.ts index eb5e24aee01..75a811ec544 100644 --- a/packages/platform/platform-express/test/response-filter.spec.ts +++ b/packages/platform/platform-express/test/response-filter.spec.ts @@ -1,3 +1,5 @@ +import {ServerResponse} from "node:http"; + import {Controller} from "@tsed/di"; import {Res} from "@tsed/platform-http"; import {PlatformTest} from "@tsed/platform-http/testing"; @@ -5,7 +7,6 @@ import {Context} from "@tsed/platform-params"; import {ResponseFilter} from "@tsed/platform-response-filter"; import {PlatformTestSdk} from "@tsed/platform-test-sdk"; import {Get, Returns} from "@tsed/schema"; -import {ServerResponse} from "http"; import SuperTest from "supertest"; import {PlatformExpress} from "../src/index.js"; diff --git a/packages/platform/platform-http/readme.md b/packages/platform/platform-http/readme.md index 49548be0501..1507f3a8d05 100644 --- a/packages/platform/platform-http/readme.md +++ b/packages/platform/platform-http/readme.md @@ -77,7 +77,7 @@ Here an example to create a Server with Ts.ED: import {Configuration, Inject} from "@tsed/di"; import {PlatformApplication} from "@tsed/platform-http"; import "@tsed/platform-express"; -import Path from "path"; +import Path from "node:path"; import cookieParser from "cookie-parser"; import compress from "compression"; import methodOverride from "method-override"; diff --git a/packages/platform/platform-http/src/common/builder/PlatformBuilder.ts b/packages/platform/platform-http/src/common/builder/PlatformBuilder.ts index 563b0ec6844..58924b661ec 100644 --- a/packages/platform/platform-http/src/common/builder/PlatformBuilder.ts +++ b/packages/platform/platform-http/src/common/builder/PlatformBuilder.ts @@ -1,3 +1,7 @@ +import type {IncomingMessage, ServerResponse} from "node:http"; +import Http from "node:http"; +import type Https from "node:https"; + import {type Env, isClass, isFunction, isString, nameOf, Type} from "@tsed/core"; import { colors, @@ -16,10 +20,7 @@ import { import {$asyncAlter, $asyncEmit} from "@tsed/hooks"; import {getMiddlewaresForHook, PlatformMiddlewareLoadingOptions} from "@tsed/platform-middlewares"; import {PlatformLayer} from "@tsed/platform-router"; -import type {IncomingMessage, ServerResponse} from "http"; -import Http from "http"; import Http2 from "http2"; -import type Https from "https"; import {PlatformStaticsSettings} from "../config/interfaces/PlatformStaticsSettings.js"; import {PlatformRouteDetails} from "../domain/PlatformRouteDetails.js"; diff --git a/packages/platform/platform-http/src/common/config/services/PlatformConfiguration.ts b/packages/platform/platform-http/src/common/config/services/PlatformConfiguration.ts index 8d8d7ca95b7..3f5406e6e3a 100644 --- a/packages/platform/platform-http/src/common/config/services/PlatformConfiguration.ts +++ b/packages/platform/platform-http/src/common/config/services/PlatformConfiguration.ts @@ -1,7 +1,8 @@ +import Https from "node:https"; + import {getHostInfoFromPort, isBoolean} from "@tsed/core"; import {DIConfiguration, Injectable, ProviderScope, TokenProvider} from "@tsed/di"; import {JsonMapperSettings} from "@tsed/json-mapper"; -import Https from "https"; import {PlatformJsonMapperSettings} from "../interfaces/PlatformJsonMapperSettings.js"; diff --git a/packages/platform/platform-http/src/common/decorators/params/request.spec.ts b/packages/platform/platform-http/src/common/decorators/params/request.spec.ts index 622199f0e94..1426c518de6 100644 --- a/packages/platform/platform-http/src/common/decorators/params/request.spec.ts +++ b/packages/platform/platform-http/src/common/decorators/params/request.spec.ts @@ -1,6 +1,7 @@ +import {IncomingMessage} from "node:http"; + import {ParamTypes} from "@tsed/platform-params"; import {JsonParameterStore} from "@tsed/schema"; -import {IncomingMessage} from "http"; import {PlatformRequest} from "../../services/PlatformRequest.js"; import {Req, Request} from "./request.js"; diff --git a/packages/platform/platform-http/src/common/decorators/params/request.ts b/packages/platform/platform-http/src/common/decorators/params/request.ts index 037b5410f44..65e7aab8be9 100644 --- a/packages/platform/platform-http/src/common/decorators/params/request.ts +++ b/packages/platform/platform-http/src/common/decorators/params/request.ts @@ -1,6 +1,7 @@ +import {IncomingMessage} from "node:http"; + import {isClass, Metadata, nameOf, Type} from "@tsed/core"; import {mapParamsOptions, ParamOptions, ParamTypes, UseParam} from "@tsed/platform-params"; -import {IncomingMessage} from "http"; function getParamType(target: Object, propertyKey: string | symbol | undefined, parameterIndex: number) { const type = Metadata.getOwnParamTypes(target, propertyKey)[parameterIndex]; diff --git a/packages/platform/platform-http/src/common/decorators/params/response.spec.ts b/packages/platform/platform-http/src/common/decorators/params/response.spec.ts index fc73986918b..2ec961d03b6 100644 --- a/packages/platform/platform-http/src/common/decorators/params/response.spec.ts +++ b/packages/platform/platform-http/src/common/decorators/params/response.spec.ts @@ -1,6 +1,7 @@ +import {ServerResponse} from "node:http"; + import {ParamTypes} from "@tsed/platform-params"; import {JsonParameterStore} from "@tsed/schema"; -import {ServerResponse} from "http"; import {PlatformResponse} from "../../services/PlatformResponse.js"; import {Res, Response} from "./response.js"; diff --git a/packages/platform/platform-http/src/common/decorators/params/response.ts b/packages/platform/platform-http/src/common/decorators/params/response.ts index 16e54b43ce4..931d44c51f6 100644 --- a/packages/platform/platform-http/src/common/decorators/params/response.ts +++ b/packages/platform/platform-http/src/common/decorators/params/response.ts @@ -1,6 +1,7 @@ +import {ServerResponse} from "node:http"; + import {isClass, Metadata, nameOf} from "@tsed/core"; import {ParamTypes, UseParam} from "@tsed/platform-params"; -import {ServerResponse} from "http"; function getParamType(target: Object, propertyKey: string | symbol | undefined, parameterIndex: number) { const type = Metadata.getOwnParamTypes(target, propertyKey)[parameterIndex]; diff --git a/packages/platform/platform-http/src/common/domain/PlatformContext.ts b/packages/platform/platform-http/src/common/domain/PlatformContext.ts index 23a34fd62a4..d39137efb11 100644 --- a/packages/platform/platform-http/src/common/domain/PlatformContext.ts +++ b/packages/platform/platform-http/src/common/domain/PlatformContext.ts @@ -1,8 +1,9 @@ +import {IncomingMessage, ServerResponse} from "node:http"; + import {DIContext, DIContextOptions, injector} from "@tsed/di"; import {$asyncEmit} from "@tsed/hooks"; import {PlatformHandlerMetadata} from "@tsed/platform-router"; import {EndpointMetadata} from "@tsed/schema"; -import {IncomingMessage, ServerResponse} from "http"; import {IncomingEvent} from "../interfaces/IncomingEvent.js"; import {PlatformApplication} from "../services/PlatformApplication.js"; diff --git a/packages/platform/platform-http/src/common/interfaces/IncomingEvent.ts b/packages/platform/platform-http/src/common/interfaces/IncomingEvent.ts index 315a0567548..c5cbbe58055 100644 --- a/packages/platform/platform-http/src/common/interfaces/IncomingEvent.ts +++ b/packages/platform/platform-http/src/common/interfaces/IncomingEvent.ts @@ -1,4 +1,4 @@ -import {IncomingMessage, ServerResponse} from "http"; +import {IncomingMessage, ServerResponse} from "node:http"; export interface IncomingEvent extends Record { response: Res; diff --git a/packages/platform/platform-http/src/common/services/PlatformAdapter.ts b/packages/platform/platform-http/src/common/services/PlatformAdapter.ts index 9c6aab68514..4a0ec324a90 100644 --- a/packages/platform/platform-http/src/common/services/PlatformAdapter.ts +++ b/packages/platform/platform-http/src/common/services/PlatformAdapter.ts @@ -1,7 +1,8 @@ +import {IncomingMessage, ServerResponse} from "node:http"; + import {Type} from "@tsed/core"; import {injectable, ProviderOpts} from "@tsed/di"; import {PlatformHandlerMetadata, PlatformLayer} from "@tsed/platform-router"; -import {IncomingMessage, ServerResponse} from "http"; import {PlatformMulter, PlatformMulterSettings} from "../config/interfaces/PlatformMulterSettings.js"; import {PlatformStaticsOptions} from "../config/interfaces/PlatformStaticsSettings.js"; diff --git a/packages/platform/platform-http/src/common/services/PlatformApplication.ts b/packages/platform/platform-http/src/common/services/PlatformApplication.ts index 106d2967ee6..756d76ac1d7 100644 --- a/packages/platform/platform-http/src/common/services/PlatformApplication.ts +++ b/packages/platform/platform-http/src/common/services/PlatformApplication.ts @@ -1,6 +1,7 @@ +import {IncomingMessage, ServerResponse} from "node:http"; + import {inject, injectable, ProviderScope} from "@tsed/di"; import {PlatformRouter} from "@tsed/platform-router"; -import {IncomingMessage, ServerResponse} from "http"; import {PlatformMulterSettings} from "../config/interfaces/PlatformMulterSettings.js"; import {PlatformAdapter} from "./PlatformAdapter.js"; diff --git a/packages/platform/platform-http/src/common/services/PlatformRequest.ts b/packages/platform/platform-http/src/common/services/PlatformRequest.ts index bd50ebb5434..869ac2ba686 100644 --- a/packages/platform/platform-http/src/common/services/PlatformRequest.ts +++ b/packages/platform/platform-http/src/common/services/PlatformRequest.ts @@ -1,5 +1,6 @@ +import {IncomingHttpHeaders, IncomingMessage} from "node:http"; + import {Injectable, injectable, ProviderScope, Scope} from "@tsed/di"; -import {IncomingHttpHeaders, IncomingMessage} from "http"; import type {PlatformContext} from "../domain/PlatformContext.js"; import type {PlatformResponse} from "./PlatformResponse.js"; diff --git a/packages/platform/platform-http/src/common/services/PlatformResponse.spec.ts b/packages/platform/platform-http/src/common/services/PlatformResponse.spec.ts index 52db33c7f66..578d317df37 100644 --- a/packages/platform/platform-http/src/common/services/PlatformResponse.spec.ts +++ b/packages/platform/platform-http/src/common/services/PlatformResponse.spec.ts @@ -1,5 +1,6 @@ +import {createReadStream} from "node:fs"; + import {PlatformViews} from "@tsed/platform-views"; -import {createReadStream} from "fs"; import {PlatformTest} from "../../testing/PlatformTest.js"; import {PlatformResponse} from "./PlatformResponse.js"; diff --git a/packages/platform/platform-http/src/common/services/PlatformResponse.ts b/packages/platform/platform-http/src/common/services/PlatformResponse.ts index 316063596d7..2df9612aa33 100644 --- a/packages/platform/platform-http/src/common/services/PlatformResponse.ts +++ b/packages/platform/platform-http/src/common/services/PlatformResponse.ts @@ -1,8 +1,9 @@ +import {OutgoingHttpHeaders, ServerResponse} from "node:http"; + import {isArray, isBoolean, isNumber, isStream, isString} from "@tsed/core"; import {injectable, lazyInject, ProviderScope} from "@tsed/di"; import {getStatusMessage} from "@tsed/schema"; import encodeUrl from "encodeurl"; -import {OutgoingHttpHeaders, ServerResponse} from "http"; import type {PlatformContext} from "../domain/PlatformContext.js"; import type {PlatformRequest} from "./PlatformRequest.js"; diff --git a/packages/platform/platform-http/src/common/utils/closeServer.ts b/packages/platform/platform-http/src/common/utils/closeServer.ts index 1a29e38cdef..7ff7dc19215 100644 --- a/packages/platform/platform-http/src/common/utils/closeServer.ts +++ b/packages/platform/platform-http/src/common/utils/closeServer.ts @@ -1,6 +1,7 @@ -import type Http from "http"; +import type Http from "node:http"; +import type Https from "node:https"; + import type Http2 from "http2"; -import type Https from "https"; export function closeServer(server: Http.Server | Https.Server | Http2.Http2Server) { return new Promise((resolve) => server.close(() => resolve(undefined))); diff --git a/packages/platform/platform-http/src/common/utils/createHttpServer.spec.ts b/packages/platform/platform-http/src/common/utils/createHttpServer.spec.ts index 139524ecff9..1fc4d7efbcd 100644 --- a/packages/platform/platform-http/src/common/utils/createHttpServer.spec.ts +++ b/packages/platform/platform-http/src/common/utils/createHttpServer.spec.ts @@ -1,5 +1,6 @@ +import Http from "node:http"; + import {configuration, destroyInjector, injector, InjectorService, logger} from "@tsed/di"; -import Http from "http"; import {createHttpServer} from "./createHttpServer.js"; diff --git a/packages/platform/platform-http/src/common/utils/createHttpServer.ts b/packages/platform/platform-http/src/common/utils/createHttpServer.ts index b044ec03cf9..f7f99ee563a 100644 --- a/packages/platform/platform-http/src/common/utils/createHttpServer.ts +++ b/packages/platform/platform-http/src/common/utils/createHttpServer.ts @@ -1,5 +1,6 @@ +import Http from "node:http"; + import {configuration, constant} from "@tsed/di"; -import Http from "http"; import {createServer} from "./createServer.js"; diff --git a/packages/platform/platform-http/src/common/utils/createHttpsServer.spec.ts b/packages/platform/platform-http/src/common/utils/createHttpsServer.spec.ts index 922b9ff99ef..87695c7ff5f 100644 --- a/packages/platform/platform-http/src/common/utils/createHttpsServer.spec.ts +++ b/packages/platform/platform-http/src/common/utils/createHttpsServer.spec.ts @@ -1,5 +1,6 @@ +import Https from "node:https"; + import {configuration, destroyInjector, injector, InjectorService} from "@tsed/di"; -import Https from "https"; import {createHttpsServer} from "./createHttpsServer.js"; diff --git a/packages/platform/platform-http/src/common/utils/createHttpsServer.ts b/packages/platform/platform-http/src/common/utils/createHttpsServer.ts index a2d500a3ee7..e1c9f6bef3a 100644 --- a/packages/platform/platform-http/src/common/utils/createHttpsServer.ts +++ b/packages/platform/platform-http/src/common/utils/createHttpsServer.ts @@ -1,6 +1,7 @@ +import Http from "node:http"; +import Https from "node:https"; + import {configuration, constant, InjectorService} from "@tsed/di"; -import Http from "http"; -import Https from "https"; import {createServer} from "./createServer.js"; diff --git a/packages/platform/platform-http/src/common/utils/createServer.ts b/packages/platform/platform-http/src/common/utils/createServer.ts index 984de44cd1e..2c35002994f 100644 --- a/packages/platform/platform-http/src/common/utils/createServer.ts +++ b/packages/platform/platform-http/src/common/utils/createServer.ts @@ -1,8 +1,9 @@ +import Http from "node:http"; +import Https from "node:https"; + import {getHostInfoFromPort, ReturnHostInfoFromPort} from "@tsed/core"; import {configuration, injector, logger, ProviderScope, TokenProvider} from "@tsed/di"; -import Http from "http"; import Http2 from "http2"; -import Https from "https"; import {listenServer} from "./listenServer.js"; diff --git a/packages/platform/platform-http/src/common/utils/listenServer.ts b/packages/platform/platform-http/src/common/utils/listenServer.ts index 41603e43710..50603ac842d 100644 --- a/packages/platform/platform-http/src/common/utils/listenServer.ts +++ b/packages/platform/platform-http/src/common/utils/listenServer.ts @@ -1,7 +1,8 @@ +import type Http from "node:http"; +import type Https from "node:https"; + import {getHostInfoFromPort} from "@tsed/core"; -import type Http from "http"; import type Http2 from "http2"; -import type Https from "https"; export function listenServer(server: Http.Server | Https.Server | Http2.Http2Server, hostInfo: ReturnType) { const {address, port} = hostInfo; diff --git a/packages/platform/platform-http/src/testing/PlatformTest.ts b/packages/platform/platform-http/src/testing/PlatformTest.ts index 810d17e1318..370819df97f 100644 --- a/packages/platform/platform-http/src/testing/PlatformTest.ts +++ b/packages/platform/platform-http/src/testing/PlatformTest.ts @@ -1,6 +1,7 @@ +import type {IncomingMessage, RequestListener, ServerResponse} from "node:http"; + import {DITest, injector, InjectorService} from "@tsed/di"; import accepts from "accepts"; -import type {IncomingMessage, RequestListener, ServerResponse} from "http"; import {PlatformBuilder} from "../common/builder/PlatformBuilder.js"; import {PlatformContext, PlatformContextOptions} from "../common/domain/PlatformContext.js"; diff --git a/packages/platform/platform-koa/src/services/PlatformKoaResponse.ts b/packages/platform/platform-koa/src/services/PlatformKoaResponse.ts index 0fbb4c046fd..3867c9db45c 100644 --- a/packages/platform/platform-koa/src/services/PlatformKoaResponse.ts +++ b/packages/platform/platform-koa/src/services/PlatformKoaResponse.ts @@ -1,5 +1,6 @@ +import {ServerResponse} from "node:http"; + import {PlatformResponse} from "@tsed/platform-http"; -import {ServerResponse} from "http"; import Koa from "koa"; declare global { diff --git a/packages/platform/platform-koa/src/utils/multer.ts b/packages/platform/platform-koa/src/utils/multer.ts index 89ae7709f9c..b851cba50a5 100644 --- a/packages/platform/platform-koa/src/utils/multer.ts +++ b/packages/platform/platform-koa/src/utils/multer.ts @@ -1,5 +1,6 @@ +import {promisify} from "node:util"; + import Koa from "koa"; -import {promisify} from "util"; let multer: any; import("multer").then(({default: m}) => (multer = m)); diff --git a/packages/platform/platform-test-sdk/src/tests/testMulter.ts b/packages/platform/platform-test-sdk/src/tests/testMulter.ts index a4d85591ffb..4e7f562b024 100644 --- a/packages/platform/platform-test-sdk/src/tests/testMulter.ts +++ b/packages/platform/platform-test-sdk/src/tests/testMulter.ts @@ -1,10 +1,11 @@ +import {dirname, join} from "node:path"; + import {Controller} from "@tsed/di"; import {MulterOptions, MultipartFile, PlatformMulterFile} from "@tsed/platform-http"; import {PlatformTest} from "@tsed/platform-http/testing"; import {BodyParams} from "@tsed/platform-params"; import {CollectionOf, Post, Property, Required, Status} from "@tsed/schema"; import multer, {FileFilterCallback} from "multer"; -import {dirname, join} from "path"; import readPkgUp from "read-pkg-up"; import SuperTest from "supertest"; import {afterAll, beforeAll, describe, expect, it, vi} from "vitest"; diff --git a/packages/platform/platform-test-sdk/src/tests/testSession.ts b/packages/platform/platform-test-sdk/src/tests/testSession.ts index c6ab1127c28..d31f4f9b84a 100644 --- a/packages/platform/platform-test-sdk/src/tests/testSession.ts +++ b/packages/platform/platform-test-sdk/src/tests/testSession.ts @@ -1,3 +1,5 @@ +import {promisify} from "node:util"; + import {Constant, Controller} from "@tsed/di"; import {NotFound} from "@tsed/exceptions"; import {Req} from "@tsed/platform-http"; @@ -5,7 +7,6 @@ import {PlatformTest} from "@tsed/platform-http/testing"; import {BodyParams, Session} from "@tsed/platform-params"; import {Allow, Email, Get, Ignore, MinLength, Post, Property, Required, Returns} from "@tsed/schema"; import SuperTest from "supertest"; -import {promisify} from "util"; import {afterAll, beforeAll, describe, expect, it} from "vitest"; import {PlatformTestingSdkOpts} from "../interfaces/index.js"; diff --git a/packages/platform/platform-test-sdk/src/tests/testStatics.ts b/packages/platform/platform-test-sdk/src/tests/testStatics.ts index eed4d059adf..41f27799423 100644 --- a/packages/platform/platform-test-sdk/src/tests/testStatics.ts +++ b/packages/platform/platform-test-sdk/src/tests/testStatics.ts @@ -1,8 +1,9 @@ +import {readFileSync} from "node:fs"; + import {getValue} from "@tsed/core"; import {Configuration, Controller} from "@tsed/di"; import {PlatformTest} from "@tsed/platform-http/testing"; import {PlatformRouter} from "@tsed/platform-router"; -import {readFileSync} from "fs"; import SuperTest from "supertest"; import {afterEach, beforeEach, expect, it} from "vitest"; diff --git a/packages/platform/platform-test-sdk/src/tests/testStream.ts b/packages/platform/platform-test-sdk/src/tests/testStream.ts index 8a519c0e3c1..118653bf745 100644 --- a/packages/platform/platform-test-sdk/src/tests/testStream.ts +++ b/packages/platform/platform-test-sdk/src/tests/testStream.ts @@ -1,8 +1,9 @@ +import {createReadStream} from "node:fs"; +import {join} from "node:path"; + import {Controller} from "@tsed/di"; import {PlatformTest} from "@tsed/platform-http/testing"; import {ContentType, Get} from "@tsed/schema"; -import {createReadStream} from "fs"; -import {join} from "path"; import SuperTest from "supertest"; import {afterAll, beforeAll, describe, expect, it} from "vitest"; diff --git a/packages/platform/platform-test-sdk/src/tests/testView.ts b/packages/platform/platform-test-sdk/src/tests/testView.ts index 6e2e1b7c3ad..e0c3f7b3905 100644 --- a/packages/platform/platform-test-sdk/src/tests/testView.ts +++ b/packages/platform/platform-test-sdk/src/tests/testView.ts @@ -1,10 +1,11 @@ +import {EOL} from "node:os"; + import {Controller} from "@tsed/di"; import {PlatformTest} from "@tsed/platform-http/testing"; import {Middleware, UseBefore} from "@tsed/platform-middlewares"; import {Locals} from "@tsed/platform-params"; import {View} from "@tsed/platform-views"; import {Get} from "@tsed/schema"; -import {EOL} from "os"; import SuperTest from "supertest"; import {afterAll, beforeAll, describe, expect, it} from "vitest"; diff --git a/packages/platform/platform-views/src/domain/PlatformViewsSettings.ts b/packages/platform/platform-views/src/domain/PlatformViewsSettings.ts index e938850ac98..24119c1c683 100644 --- a/packages/platform/platform-views/src/domain/PlatformViewsSettings.ts +++ b/packages/platform/platform-views/src/domain/PlatformViewsSettings.ts @@ -1,5 +1,6 @@ +import {Writable} from "node:stream"; + import {BaseContext} from "@tsed/di"; -import {Writable} from "stream"; export const PLATFORM_VIEWS_EXTENSIONS = { atpl: "atpl", diff --git a/packages/platform/platform-views/src/services/PlatformViews.ts b/packages/platform/platform-views/src/services/PlatformViews.ts index 9cd6f6a43b9..f6941b588fa 100644 --- a/packages/platform/platform-views/src/services/PlatformViews.ts +++ b/packages/platform/platform-views/src/services/PlatformViews.ts @@ -1,11 +1,12 @@ import "../domain/PlatformViewsSettings.js"; +import Fs from "node:fs"; +import {extname, join, resolve} from "node:path"; + import {Env, getValue} from "@tsed/core"; import {constant, injectable, ProviderType} from "@tsed/di"; import {engines, getEngine, requires} from "@tsed/engines"; import {$asyncAlter} from "@tsed/hooks"; -import Fs from "fs"; -import {extname, join, resolve} from "path"; import { PLATFORM_VIEWS_EXTENSIONS, diff --git a/packages/security/jwks/src/getJwks.spec.ts b/packages/security/jwks/src/getJwks.spec.ts index 748457e4456..f55d3624904 100644 --- a/packages/security/jwks/src/getJwks.spec.ts +++ b/packages/security/jwks/src/getJwks.spec.ts @@ -1,5 +1,6 @@ +import {join} from "node:path"; + import fs from "fs-extra"; -import {join} from "path"; import {generateJwks, getJwks} from "./getJwks.js"; diff --git a/packages/security/oidc-provider/src/middlewares/OidcSecureMiddleware.ts b/packages/security/oidc-provider/src/middlewares/OidcSecureMiddleware.ts index 935f798fbc6..58fb0af3306 100644 --- a/packages/security/oidc-provider/src/middlewares/OidcSecureMiddleware.ts +++ b/packages/security/oidc-provider/src/middlewares/OidcSecureMiddleware.ts @@ -1,7 +1,8 @@ +import url from "node:url"; + import {BadRequest} from "@tsed/exceptions"; import {Middleware, MiddlewareMethods} from "@tsed/platform-middlewares"; import {Context} from "@tsed/platform-params"; -import url from "url"; @Middleware() export class OidcSecureMiddleware implements MiddlewareMethods { diff --git a/packages/security/oidc-provider/src/services/OidcJwks.ts b/packages/security/oidc-provider/src/services/OidcJwks.ts index 5f9f9f0c648..d428a622dbd 100644 --- a/packages/security/oidc-provider/src/services/OidcJwks.ts +++ b/packages/security/oidc-provider/src/services/OidcJwks.ts @@ -1,6 +1,7 @@ +import {join} from "node:path"; + import {constant, Injectable} from "@tsed/di"; import {getJwks, JwksKeyParameters} from "@tsed/jwks"; -import {join} from "path"; @Injectable() export class OidcJwks { diff --git a/packages/security/oidc-provider/src/utils/debug.ts b/packages/security/oidc-provider/src/utils/debug.ts index db6ea717dbd..c5f11e78f5a 100644 --- a/packages/security/oidc-provider/src/utils/debug.ts +++ b/packages/security/oidc-provider/src/utils/debug.ts @@ -1,6 +1,7 @@ +import qs from "node:querystring"; +import {inspect} from "node:util"; + import {isEmpty} from "@tsed/core"; -import qs from "querystring"; -import {inspect} from "util"; const keys = new Set(); diff --git a/packages/security/oidc-provider/test/app/Server.ts b/packages/security/oidc-provider/test/app/Server.ts index 121142d5aaa..3767563e9b8 100644 --- a/packages/security/oidc-provider/test/app/Server.ts +++ b/packages/security/oidc-provider/test/app/Server.ts @@ -2,6 +2,8 @@ import "@tsed/ajv"; import "../../src/index.js"; import "@tsed/swagger"; +import {join} from "node:path"; + import {FileSyncAdapter} from "@tsed/adapters"; import {Configuration, Constant, Inject} from "@tsed/di"; import {PlatformApplication} from "@tsed/platform-http"; @@ -10,7 +12,6 @@ import compress from "compression"; import cookieParser from "cookie-parser"; import session from "express-session"; import methodOverride from "method-override"; -import {join} from "path"; import {Accounts} from "./services/Accounts.js"; diff --git a/packages/security/oidc-provider/test/oidc.integration.spec.ts b/packages/security/oidc-provider/test/oidc.integration.spec.ts index 14a56353bf7..ce424912b28 100644 --- a/packages/security/oidc-provider/test/oidc.integration.spec.ts +++ b/packages/security/oidc-provider/test/oidc.integration.spec.ts @@ -1,8 +1,9 @@ +import {join} from "node:path"; + import {MemoryAdapter} from "@tsed/adapters"; import {PlatformExpress} from "@tsed/platform-express"; import {PlatformTest} from "@tsed/platform-http/testing"; import {PlatformTestSdk} from "@tsed/platform-test-sdk"; -import {join} from "path"; import SuperTest from "supertest"; import {rootDir} from "../../../platform/platform-express/test/app/Server.js"; diff --git a/packages/security/passport/src/services/ProtocolsService.ts b/packages/security/passport/src/services/ProtocolsService.ts index 657f82ec49b..2eb23d8d98a 100644 --- a/packages/security/passport/src/services/ProtocolsService.ts +++ b/packages/security/passport/src/services/ProtocolsService.ts @@ -1,9 +1,10 @@ +import {promisify} from "node:util"; + import {ancestorsOf} from "@tsed/core"; import {Inject, Injectable, InjectorService, Provider} from "@tsed/di"; import {Unauthorized} from "@tsed/exceptions"; import {PlatformContext, PlatformHandler} from "@tsed/platform-http"; import Passport, {Strategy} from "passport"; -import {promisify} from "util"; import {PROVIDER_TYPE_PROTOCOL} from "../contants/constants.js"; import {PassportException} from "../errors/PassportException.js"; diff --git a/packages/specs/json-mapper/src/domain/JsonSerializer.spec.ts b/packages/specs/json-mapper/src/domain/JsonSerializer.spec.ts index 37a0f4bd063..138a3b09daa 100644 --- a/packages/specs/json-mapper/src/domain/JsonSerializer.spec.ts +++ b/packages/specs/json-mapper/src/domain/JsonSerializer.spec.ts @@ -2,6 +2,8 @@ import "../components/DateMapper.js"; import "../components/PrimitiveMapper.js"; import "../components/SymbolMapper.js"; +import {parse} from "node:querystring"; + import {cleanObject, isBoolean, isNumber, isObjectID, useDecorators} from "@tsed/core"; import { AdditionalProperties, @@ -22,7 +24,6 @@ import { Uri } from "@tsed/schema"; import {snakeCase} from "change-case"; -import {parse} from "querystring"; import {Post} from "../../test/helpers/Post.js"; import {User} from "../../test/helpers/User.js"; diff --git a/packages/specs/openapi-utils/readme.md b/packages/specs/openapi-utils/readme.md index dd9575155be..a2c0fd54bd2 100644 --- a/packages/specs/openapi-utils/readme.md +++ b/packages/specs/openapi-utils/readme.md @@ -42,7 +42,7 @@ Then add the following configuration in your Server: ```typescript import {Configuration} from "@tsed/di"; import "@tsed/swagger"; // import swagger Ts.ED module -import {resolve} from "path"; +import {resolve} from "node:path"; @Configuration({ swagger: [ diff --git a/packages/specs/openapi-utils/src/middlewares/cssMiddleware.spec.ts b/packages/specs/openapi-utils/src/middlewares/cssMiddleware.spec.ts index dbdcd1433d3..f7ee60c9242 100644 --- a/packages/specs/openapi-utils/src/middlewares/cssMiddleware.spec.ts +++ b/packages/specs/openapi-utils/src/middlewares/cssMiddleware.spec.ts @@ -1,6 +1,7 @@ +import Fs from "node:fs"; + import {runInContext} from "@tsed/di"; import {PlatformTest} from "@tsed/platform-http/testing"; -import Fs from "fs"; import {cssMiddleware} from "./cssMiddleware.js"; diff --git a/packages/specs/openapi-utils/src/middlewares/cssMiddleware.ts b/packages/specs/openapi-utils/src/middlewares/cssMiddleware.ts index 4964e6b6ce6..75f532b1243 100644 --- a/packages/specs/openapi-utils/src/middlewares/cssMiddleware.ts +++ b/packages/specs/openapi-utils/src/middlewares/cssMiddleware.ts @@ -1,6 +1,7 @@ +import Fs from "node:fs"; +import {resolve} from "node:path"; + import {context} from "@tsed/di"; -import Fs from "fs"; -import {resolve} from "path"; /** * Expose a css file. diff --git a/packages/specs/openapi-utils/src/middlewares/jsMiddleware.spec.ts b/packages/specs/openapi-utils/src/middlewares/jsMiddleware.spec.ts index 371dca4b63e..05cb125bb7e 100644 --- a/packages/specs/openapi-utils/src/middlewares/jsMiddleware.spec.ts +++ b/packages/specs/openapi-utils/src/middlewares/jsMiddleware.spec.ts @@ -1,6 +1,7 @@ +import Fs from "node:fs"; + import {runInContext} from "@tsed/di"; import {PlatformTest} from "@tsed/platform-http/testing"; -import Fs from "fs"; import {jsMiddleware} from "./jsMiddleware.js"; diff --git a/packages/specs/openapi-utils/src/middlewares/jsMiddleware.ts b/packages/specs/openapi-utils/src/middlewares/jsMiddleware.ts index 913d70d0841..941007bfd05 100644 --- a/packages/specs/openapi-utils/src/middlewares/jsMiddleware.ts +++ b/packages/specs/openapi-utils/src/middlewares/jsMiddleware.ts @@ -1,6 +1,7 @@ +import Fs from "node:fs"; +import {resolve} from "node:path"; + import {context} from "@tsed/di"; -import Fs from "fs"; -import {resolve} from "path"; /** * Expose a js file. diff --git a/packages/specs/openapi-utils/src/middlewares/openApiMiddleware.spec.ts b/packages/specs/openapi-utils/src/middlewares/openApiMiddleware.spec.ts index a7c5d092d19..e080f2eb3c1 100644 --- a/packages/specs/openapi-utils/src/middlewares/openApiMiddleware.spec.ts +++ b/packages/specs/openapi-utils/src/middlewares/openApiMiddleware.spec.ts @@ -1,6 +1,7 @@ +import Fs from "node:fs"; + import {runInContext} from "@tsed/di"; import {PlatformTest} from "@tsed/platform-http/testing"; -import Fs from "fs"; import {openApiMiddleware} from "./openApiMiddleware.js"; diff --git a/packages/specs/scalar/readme.md b/packages/specs/scalar/readme.md index a2cbf9ee4cd..60f3d120a58 100644 --- a/packages/specs/scalar/readme.md +++ b/packages/specs/scalar/readme.md @@ -40,7 +40,7 @@ Then add the following configuration in your Server: ```typescript import {Configuration} from "@tsed/di"; import "@tsed/scalar"; // import scalar Ts.ED module -import {resolve} from "path"; +import {resolve} from "node:path"; @Configuration({ scalar: [ diff --git a/packages/specs/scalar/src/constants.ts b/packages/specs/scalar/src/constants.ts index e10e6d782c4..1611b960934 100644 --- a/packages/specs/scalar/src/constants.ts +++ b/packages/specs/scalar/src/constants.ts @@ -1,3 +1,3 @@ -import {join} from "path"; +import {join} from "node:path"; export const ROOT_DIR = join(import.meta.dirname, ".."); diff --git a/packages/specs/scalar/src/middlewares/indexMiddleware.ts b/packages/specs/scalar/src/middlewares/indexMiddleware.ts index 5cb465a1f50..9ff8f1554d3 100644 --- a/packages/specs/scalar/src/middlewares/indexMiddleware.ts +++ b/packages/specs/scalar/src/middlewares/indexMiddleware.ts @@ -1,7 +1,7 @@ import {basename} from "node:path"; +import {join} from "node:path"; import {context} from "@tsed/di"; -import {join} from "path"; import {ScalarSettings} from "../interfaces/ScalarSettings.js"; diff --git a/packages/specs/schema/src/utils/generateSpec.spec.ts b/packages/specs/schema/src/utils/generateSpec.spec.ts index 985611483aa..bafb81209aa 100644 --- a/packages/specs/schema/src/utils/generateSpec.spec.ts +++ b/packages/specs/schema/src/utils/generateSpec.spec.ts @@ -1,6 +1,7 @@ +import {join} from "node:path"; + import {BodyParams} from "@tsed/platform-params"; import fs from "fs-extra"; -import {join} from "path"; import {validateSpec} from "../../test/helpers/validateSpec.js"; import {CollectionOf} from "../decorators/collections/collectionOf.js"; diff --git a/packages/specs/swagger/readme.md b/packages/specs/swagger/readme.md index dd9575155be..a2c0fd54bd2 100644 --- a/packages/specs/swagger/readme.md +++ b/packages/specs/swagger/readme.md @@ -42,7 +42,7 @@ Then add the following configuration in your Server: ```typescript import {Configuration} from "@tsed/di"; import "@tsed/swagger"; // import swagger Ts.ED module -import {resolve} from "path"; +import {resolve} from "node:path"; @Configuration({ swagger: [ diff --git a/packages/specs/swagger/src/constants.ts b/packages/specs/swagger/src/constants.ts index 5eb54554b23..8430a76b12a 100644 --- a/packages/specs/swagger/src/constants.ts +++ b/packages/specs/swagger/src/constants.ts @@ -1,4 +1,5 @@ -import {join} from "path"; +import {join} from "node:path"; + import getAbsoluteFSPath from "swagger-ui-dist/absolute-path.js"; export const SWAGGER_UI_DIST = getAbsoluteFSPath(); diff --git a/packages/specs/swagger/src/middlewares/indexMiddleware.ts b/packages/specs/swagger/src/middlewares/indexMiddleware.ts index 69b502d8a82..25fb6072a52 100644 --- a/packages/specs/swagger/src/middlewares/indexMiddleware.ts +++ b/packages/specs/swagger/src/middlewares/indexMiddleware.ts @@ -1,8 +1,8 @@ import {basename} from "node:path"; +import {join} from "node:path"; import {context} from "@tsed/di"; import {PlatformContext} from "@tsed/platform-http"; -import {join} from "path"; import {SwaggerSettings} from "../interfaces/SwaggerSettings.js"; diff --git a/packages/third-parties/components-scan/src/cleanGlobPatterns.ts b/packages/third-parties/components-scan/src/cleanGlobPatterns.ts index 2243b2d4d53..9e502ee5395 100644 --- a/packages/third-parties/components-scan/src/cleanGlobPatterns.ts +++ b/packages/third-parties/components-scan/src/cleanGlobPatterns.ts @@ -1,6 +1,7 @@ // @ts-ignore +import {resolve} from "node:path"; + import {normalizePath} from "@tsed/normalize-path"; -import {resolve} from "path"; import {isTsEnv} from "./isTsEnv.js"; diff --git a/packages/third-parties/components-scan/src/importFiles.spec.ts b/packages/third-parties/components-scan/src/importFiles.spec.ts index d31038dc017..8f6ed7e8bda 100644 --- a/packages/third-parties/components-scan/src/importFiles.spec.ts +++ b/packages/third-parties/components-scan/src/importFiles.spec.ts @@ -1,4 +1,4 @@ -import {join} from "path"; +import {join} from "node:path"; import {Test1} from "./__mock__/Test1.js"; import {Test2} from "./__mock__/Test2.js"; diff --git a/packages/third-parties/formio/src/middlewares/FormioAuthMiddleware.ts b/packages/third-parties/formio/src/middlewares/FormioAuthMiddleware.ts index 6f426b6a3b5..1dca640ea45 100644 --- a/packages/third-parties/formio/src/middlewares/FormioAuthMiddleware.ts +++ b/packages/third-parties/formio/src/middlewares/FormioAuthMiddleware.ts @@ -1,9 +1,10 @@ +import {promisify} from "node:util"; + import {getValue} from "@tsed/core"; import {Inject} from "@tsed/di"; import {Unauthorized} from "@tsed/exceptions"; import {Middleware} from "@tsed/platform-middlewares"; import {Context} from "@tsed/platform-params"; -import {promisify} from "util"; import {FormioService} from "../services/FormioService.js"; diff --git a/packages/third-parties/formio/src/services/FormioAuthService.ts b/packages/third-parties/formio/src/services/FormioAuthService.ts index d8ead99142e..20bd349285c 100644 --- a/packages/third-parties/formio/src/services/FormioAuthService.ts +++ b/packages/third-parties/formio/src/services/FormioAuthService.ts @@ -1,8 +1,9 @@ +import {promisify} from "node:util"; + import {isFunction} from "@tsed/core"; import {Inject, Injectable} from "@tsed/di"; import {BadRequest, NotFound, Unauthorized} from "@tsed/exceptions"; import {PlatformContext, Req} from "@tsed/platform-http"; -import {promisify} from "util"; import {FormioPayloadToken} from "../domain/FormioDecodedToken.js"; import {FormioForm, FormioSubmission, WithID} from "../domain/FormioModels.js"; diff --git a/packages/third-parties/formio/src/services/FormioHooksService.ts b/packages/third-parties/formio/src/services/FormioHooksService.ts index e70e42c51ce..768ddd8f547 100644 --- a/packages/third-parties/formio/src/services/FormioHooksService.ts +++ b/packages/third-parties/formio/src/services/FormioHooksService.ts @@ -1,6 +1,7 @@ +import {promisify} from "node:util"; + import {Inject, Injectable, InjectorService} from "@tsed/di"; import {Request} from "express"; -import {promisify} from "util"; import {FormioHooks} from "../domain/FormioHooks.js"; import {FormioService} from "./FormioService.js"; diff --git a/packages/third-parties/formio/src/services/FormioService.ts b/packages/third-parties/formio/src/services/FormioService.ts index 895ea5371da..0ce085ee4af 100644 --- a/packages/third-parties/formio/src/services/FormioService.ts +++ b/packages/third-parties/formio/src/services/FormioService.ts @@ -1,3 +1,5 @@ +import {promisify} from "node:util"; + import {Inject, Injectable, InjectorService} from "@tsed/di"; import {MongooseConnectionOptions} from "@tsed/mongoose"; // @ts-ignore @@ -8,7 +10,6 @@ import swagger from "formio/src/util/swagger.js"; import util from "formio/src/util/util.js"; import {Db} from "mongodb"; import {Mongoose} from "mongoose"; -import {promisify} from "util"; import {Formio} from "../domain/Formio.js"; import {FormioConfig} from "../domain/FormioConfig.js"; diff --git a/packages/third-parties/normalize-path/src/normalizePath.ts b/packages/third-parties/normalize-path/src/normalizePath.ts index b79a59f8774..ec1635e77a5 100644 --- a/packages/third-parties/normalize-path/src/normalizePath.ts +++ b/packages/third-parties/normalize-path/src/normalizePath.ts @@ -1,5 +1,6 @@ +import {join} from "node:path"; + import fixPath from "normalize-path"; -import {join} from "path"; export function normalizePath(item: string, ...paths: string[]): string; export function normalizePath(item: (string | any)[]): (string | any)[]; diff --git a/packages/third-parties/socketio-testing/readme.md b/packages/third-parties/socketio-testing/readme.md index 4008f6ef8b4..8831ffe2848 100644 --- a/packages/third-parties/socketio-testing/readme.md +++ b/packages/third-parties/socketio-testing/readme.md @@ -43,7 +43,7 @@ Then add the following configuration in your Server: ```typescript import {Configuration} from "@tsed/di"; import "@tsed/socketio"; // import socketio Ts.ED module -import {resolve} from "path"; +import {resolve} from "node:path"; @Configuration({ socketIO: { diff --git a/packages/third-parties/socketio/readme.md b/packages/third-parties/socketio/readme.md index f42f174c35f..dd1e9e6b8e4 100644 --- a/packages/third-parties/socketio/readme.md +++ b/packages/third-parties/socketio/readme.md @@ -44,7 +44,7 @@ Then add the following configuration in your Server: ```typescript import {Configuration} from "@tsed/di"; import "@tsed/socketio"; // import socketio Ts.ED module -import {resolve} from "path"; +import {resolve} from "node:path"; @Configuration({ socketIO: { diff --git a/packages/third-parties/socketio/src/SocketIOModule.spec.ts b/packages/third-parties/socketio/src/SocketIOModule.spec.ts index bbb0e3b474d..536e43f9d3a 100644 --- a/packages/third-parties/socketio/src/SocketIOModule.spec.ts +++ b/packages/third-parties/socketio/src/SocketIOModule.spec.ts @@ -1,7 +1,8 @@ +import Http from "node:http"; +import Https from "node:https"; + import {PlatformConfiguration} from "@tsed/platform-http"; import {PlatformTest} from "@tsed/platform-http/testing"; -import Http from "http"; -import Https from "https"; import {SocketIOModule, SocketIOServer, SocketIOService} from "./index.js"; diff --git a/packages/third-parties/socketio/src/SocketIOModule.ts b/packages/third-parties/socketio/src/SocketIOModule.ts index 84ca11ea340..f2e04498761 100644 --- a/packages/third-parties/socketio/src/SocketIOModule.ts +++ b/packages/third-parties/socketio/src/SocketIOModule.ts @@ -1,9 +1,10 @@ +import Http from "node:http"; +import Https from "node:https"; + import {nameOf} from "@tsed/core"; import {Constant, Inject, InjectorService, Module, OnDestroy, Provider} from "@tsed/di"; import {$log} from "@tsed/logger"; import type {AfterListen} from "@tsed/platform-http"; -import Http from "http"; -import Https from "https"; import {Server, ServerOptions} from "socket.io"; import {SocketProviderMetadata} from "./class/SocketProviderMetadata.js"; // tslint:disable-line: no-unused-variable diff --git a/packages/third-parties/socketio/test/app/controllers/pages/SocketPageCtrl.ts b/packages/third-parties/socketio/test/app/controllers/pages/SocketPageCtrl.ts index 745db6fa43a..86c251a0dfe 100644 --- a/packages/third-parties/socketio/test/app/controllers/pages/SocketPageCtrl.ts +++ b/packages/third-parties/socketio/test/app/controllers/pages/SocketPageCtrl.ts @@ -1,6 +1,7 @@ +import fs from "node:fs"; + import {Controller} from "@tsed/di"; import {Get, Hidden, Returns, View} from "@tsed/schema"; -import fs from "fs"; @Controller("/") @Hidden() diff --git a/packages/third-parties/terminus/readme.md b/packages/third-parties/terminus/readme.md index 32ed53f3f58..3ddc349fb22 100644 --- a/packages/third-parties/terminus/readme.md +++ b/packages/third-parties/terminus/readme.md @@ -42,7 +42,7 @@ Then import `@tsed/terminus` and add the following configuration in your `Server ```typescript import {Configuration} from "@tsed/di"; import "@tsed/terminus"; // import terminus Ts.ED module -import {resolve} from "path"; +import {resolve} from "node:path"; @Configuration({ terminus: { diff --git a/packages/third-parties/terminus/src/TerminusModule.ts b/packages/third-parties/terminus/src/TerminusModule.ts index 6c87c5da90f..983bc9e4230 100644 --- a/packages/third-parties/terminus/src/TerminusModule.ts +++ b/packages/third-parties/terminus/src/TerminusModule.ts @@ -1,9 +1,10 @@ +import Http from "node:http"; +import Https from "node:https"; + import {createTerminus} from "@godaddy/terminus"; import {Constant, Inject, InjectorService, Module, OnInit, Provider} from "@tsed/di"; import type {PlatformRouteDetails} from "@tsed/platform-http"; import {concatPath} from "@tsed/schema"; -import Http from "http"; -import Https from "https"; import {TerminusSettings} from "./interfaces/TerminusSettings.js"; diff --git a/packages/third-parties/vike/src/interfaces/ViteRenderContext.ts b/packages/third-parties/vike/src/interfaces/ViteRenderContext.ts index 0281790fdd3..665ea0b7e2f 100644 --- a/packages/third-parties/vike/src/interfaces/ViteRenderContext.ts +++ b/packages/third-parties/vike/src/interfaces/ViteRenderContext.ts @@ -1,4 +1,4 @@ -import type {IncomingHttpHeaders} from "http"; +import type {IncomingHttpHeaders} from "node:http"; export type VitePageProps> = Data & {view: string}; diff --git a/packages/third-parties/vike/src/services/ViteService.ts b/packages/third-parties/vike/src/services/ViteService.ts index ccc37fa5799..8cbe3eea70b 100644 --- a/packages/third-parties/vike/src/services/ViteService.ts +++ b/packages/third-parties/vike/src/services/ViteService.ts @@ -1,6 +1,7 @@ +import {Writable} from "node:stream"; + import {Constant, Injectable} from "@tsed/di"; import {PlatformContext} from "@tsed/platform-http"; -import {Writable} from "stream"; import {ViteConfig} from "../interfaces/ViteConfig.js"; import {ViteRenderContext} from "../interfaces/ViteRenderContext.js"; diff --git a/tools/integration/src/Server.ts b/tools/integration/src/Server.ts index f319d54117d..ebeed2d205a 100644 --- a/tools/integration/src/Server.ts +++ b/tools/integration/src/Server.ts @@ -2,6 +2,8 @@ import "@tsed/platform-express"; // /!\ keep this import import "@tsed/ajv"; import "@tsed/swagger"; +import {join} from "node:path"; + import {Configuration, Inject} from "@tsed/di"; import {PlatformApplication} from "@tsed/platform-http"; import bodyParser from "body-parser"; @@ -9,7 +11,6 @@ import compress from "compression"; import cookieParser from "cookie-parser"; import cors from "cors"; import methodOverride from "method-override"; -import {join} from "path"; import {config} from "./config/index.js"; import * as pages from "./controllers/pages/index.js";