From ab781b65290a1e04237cbd92bcd4c401eab7b88c Mon Sep 17 00:00:00 2001 From: Romain Lenzotti Date: Thu, 19 Sep 2024 07:38:26 +0200 Subject: [PATCH 1/6] fix: replace __dirname by his esm equivalent syntax --- .../bootstrap-with-node-config.ts | 2 +- .../observable-stream-buffer-controller.ts | 2 +- packages/core/src/domain/AnyToPromise.spec.ts | 2 +- packages/engines/src/utils/getEngines.spec.ts | 2 +- packages/engines/test/getEngineFixture.ts | 2 +- packages/engines/test/shared/dust.ts | 2 +- packages/engines/test/shared/filters.ts | 2 +- packages/engines/test/shared/helpers.ts | 2 +- packages/engines/test/shared/includes.ts | 2 +- packages/engines/test/shared/index.ts | 2 +- packages/engines/test/shared/partials.ts | 4 +- packages/engines/test/shared/react.ts | 2 +- .../graphql/typegraphql/test/app/Server.ts | 2 +- packages/orm/mikro-orm/test/helpers/Server.ts | 2 +- packages/orm/mongoose/test/helpers/Server.ts | 2 +- packages/orm/objection/test/helpers/Server.ts | 2 +- .../orm/objection/test/integration.spec.ts | 2 +- .../src/__mock__/createProjectFixture.ts | 2 +- packages/orm/prisma/src/generator.ts | 2 +- .../src/services/PlatformResponse.spec.ts | 2 +- .../common/test/integration/groups.spec.ts | 2 +- .../common/test/integration/platform.spec.ts | 2 +- .../src/domain/ExceptionSchema.spec.ts | 2 +- .../platform-express/test/app/Server.ts | 2 +- .../platform-express/test/fullpayload.spec.ts | 2 +- .../platform/platform-koa/test/app/Server.ts | 2 +- .../platform-test-sdk/src/tests/testMulter.ts | 4 +- .../platform-test-sdk/src/tests/testStream.ts | 2 +- packages/security/jwks/src/getJwks.spec.ts | 2 +- .../security/oidc-provider/test/app/Server.ts | 2 +- .../test/oidc.integration.spec.ts | 2 +- packages/security/passport/test/app/Server.ts | 2 +- .../schema/src/utils/generateSpec.spec.ts | 42 ++++++++----------- .../specs/schema/test/helpers/validateSpec.ts | 2 +- packages/specs/swagger/src/constants.ts | 2 +- packages/specs/swagger/test/app/Server.ts | 2 +- .../agenda/test/helpers/Server.ts | 2 +- .../components-scan/src/importFiles.spec.ts | 2 +- .../src/importProviders.spec.ts | 2 +- .../event-emitter/test/helpers/Server.ts | 2 +- .../third-parties/formio/test/app/Server.ts | 2 +- .../pulse/test/helpers/Server.ts | 2 +- .../third-parties/socketio/test/app/Server.ts | 2 +- .../third-parties/stripe/test/app/Server.ts | 2 +- .../temporal/test/helpers/Server.ts | 2 +- .../temporal/test/worker.integration.spec.ts | 2 +- .../third-parties/terminus/test/app/Server.ts | 2 +- .../ViteRendererMiddleware.spec.ts | 2 +- 48 files changed, 67 insertions(+), 73 deletions(-) diff --git a/docs/docs/snippets/configuration/bootstrap-with-node-config.ts b/docs/docs/snippets/configuration/bootstrap-with-node-config.ts index 25913bd8d05..b79539c2571 100644 --- a/docs/docs/snippets/configuration/bootstrap-with-node-config.ts +++ b/docs/docs/snippets/configuration/bootstrap-with-node-config.ts @@ -2,7 +2,7 @@ import {$log} from "@tsed/common"; import {PlatformExpress} from "@tsed/platform-express"; import {Server} from "./server"; -const rootDir = __dirname; // automatically replaced by import.meta.dirname on build +const rootDir = import.meta.dirname; // automatically replaced by import.meta.dirname on build // /!\ configuration file must be outside of your src directory process.env["NODE_CONFIG_DIR"] = `${rootDir}/../config`; diff --git a/docs/docs/snippets/controllers/observable-stream-buffer-controller.ts b/docs/docs/snippets/controllers/observable-stream-buffer-controller.ts index e7de777f06d..b6cb752ec41 100644 --- a/docs/docs/snippets/controllers/observable-stream-buffer-controller.ts +++ b/docs/docs/snippets/controllers/observable-stream-buffer-controller.ts @@ -4,7 +4,7 @@ import {Get} from "@tsed/schema"; import {createReadStream, ReadStream} from "fs"; import {Observable, of} from "rxjs"; -const rootDir = __dirname; // automatically replaced by import.meta.dirname on build +const rootDir = import.meta.dirname; // automatically replaced by import.meta.dirname on build @Controller("/") export class KindOfResponseCtrl { diff --git a/packages/core/src/domain/AnyToPromise.spec.ts b/packages/core/src/domain/AnyToPromise.spec.ts index 9ac93ccacb5..509f7f1d93b 100644 --- a/packages/core/src/domain/AnyToPromise.spec.ts +++ b/packages/core/src/domain/AnyToPromise.spec.ts @@ -4,7 +4,7 @@ import {catchAsyncError} from "../utils/catchError.js"; import {isStream} from "../utils/objects/isStream.js"; import {AnyToPromise, AnyToPromiseStatus} from "./AnyToPromise.js"; -const rootDir = __dirname; // automatically replaced by import.meta.dirname on build +const rootDir = import.meta.dirname; describe("AnyToPromise", () => { it("should handle sync value", async () => { diff --git a/packages/engines/src/utils/getEngines.spec.ts b/packages/engines/src/utils/getEngines.spec.ts index 327d7df0c11..07b8c87d40b 100644 --- a/packages/engines/src/utils/getEngines.spec.ts +++ b/packages/engines/src/utils/getEngines.spec.ts @@ -2,7 +2,7 @@ import {join} from "path"; import {getEngine, getEngines} from "./getEngines.js"; import "../index.js"; -const rootDir = __dirname; // automatically replaced by import.meta.dirname on build +const rootDir = import.meta.dirname; describe("getEngines", () => { describe("getEngine()", () => { diff --git a/packages/engines/test/getEngineFixture.ts b/packages/engines/test/getEngineFixture.ts index c81fe76528d..85b2d9ecbcc 100644 --- a/packages/engines/test/getEngineFixture.ts +++ b/packages/engines/test/getEngineFixture.ts @@ -2,7 +2,7 @@ import fs from "fs"; import {Engine} from "../src/components/Engine.js"; import {engines} from "../src/index.js"; -const rootDir = __dirname; // automatically replaced by import.meta.dirname on build +const rootDir = import.meta.dirname; // automatically replaced by import.meta.dirname on build interface EngineFixtureOptions { token: string | typeof Engine; diff --git a/packages/engines/test/shared/dust.ts b/packages/engines/test/shared/dust.ts index 9a89f0cfe7a..386230a8dcc 100644 --- a/packages/engines/test/shared/dust.ts +++ b/packages/engines/test/shared/dust.ts @@ -2,7 +2,7 @@ import {engines, requires} from "../../src/index.js"; import fs from "fs"; import {join} from "path"; -const rootDir = join(__dirname, ".."); +const rootDir = join(import.meta.dirname, ".."); export function test(name: string) { const user = {name: "Tobi"}; diff --git a/packages/engines/test/shared/filters.ts b/packages/engines/test/shared/filters.ts index 678049ac587..734b9d7e96a 100644 --- a/packages/engines/test/shared/filters.ts +++ b/packages/engines/test/shared/filters.ts @@ -2,7 +2,7 @@ import {engines} from "../../src/index.js"; import fs from "fs"; import {join} from "path"; -const rootDir = join(__dirname, ".."); +const rootDir = join(import.meta.dirname, ".."); export function test(name: string) { const engine = engines.get(name)!; diff --git a/packages/engines/test/shared/helpers.ts b/packages/engines/test/shared/helpers.ts index b91e02aa4a8..3255db15195 100644 --- a/packages/engines/test/shared/helpers.ts +++ b/packages/engines/test/shared/helpers.ts @@ -5,7 +5,7 @@ import {join} from "path"; const Sqrl = require("squirrelly"); -const rootDir = join(__dirname, ".."); +const rootDir = join(import.meta.dirname, ".."); const readFile = fs.readFile; const readFileSync = fs.readFileSync; diff --git a/packages/engines/test/shared/includes.ts b/packages/engines/test/shared/includes.ts index 1510976c1b7..431de4cfb25 100644 --- a/packages/engines/test/shared/includes.ts +++ b/packages/engines/test/shared/includes.ts @@ -2,7 +2,7 @@ import fs from "fs"; import {join} from "path"; import {engines} from "../../src/index.js"; -const rootDir = join(__dirname, ".."); +const rootDir = join(import.meta.dirname, ".."); export function test(name: string) { const engine = engines.get(name)!; diff --git a/packages/engines/test/shared/index.ts b/packages/engines/test/shared/index.ts index 722cb7857f0..46123676a9f 100644 --- a/packages/engines/test/shared/index.ts +++ b/packages/engines/test/shared/index.ts @@ -2,7 +2,7 @@ import fs from "fs"; import {join} from "path"; import {engines, requires} from "../../src/index.js"; -const rootDir = join(__dirname, ".."); +const rootDir = join(import.meta.dirname, ".."); const readFile = fs.readFile; const readFileSync = fs.readFileSync; diff --git a/packages/engines/test/shared/partials.ts b/packages/engines/test/shared/partials.ts index 83709e0101f..5c3d860557b 100644 --- a/packages/engines/test/shared/partials.ts +++ b/packages/engines/test/shared/partials.ts @@ -2,7 +2,7 @@ import {engines} from "../../src/index.js"; import {join} from "path"; import fs from "fs"; -const rootDir = join(__dirname, ".."); +const rootDir = join(import.meta.dirname, ".."); const readFile = fs.readFile; const readFileSync = fs.readFileSync; @@ -37,7 +37,7 @@ export function test(name: string) { }); it("should support absolute path partial", async () => { const path = `${rootDir}/fixtures/${name}/partials.${name}`; - const locals = {user: user, partials: {partial: join(__dirname, "/../../test/fixtures/", name, "/user")}}; + const locals = {user: user, partials: {partial: join(import.meta.dirname, "/../../test/fixtures/", name, "/user")}}; const html = await engine.renderFile(path, locals); expect(html).toEqual("

Tobi

"); }); diff --git a/packages/engines/test/shared/react.ts b/packages/engines/test/shared/react.ts index eb943e00e0e..474d0b2b3fe 100644 --- a/packages/engines/test/shared/react.ts +++ b/packages/engines/test/shared/react.ts @@ -2,7 +2,7 @@ import fs from "fs"; import {join} from "path"; import {engines} from "../../src/index.js"; -const rootDir = join(__dirname, ".."); +const rootDir = join(import.meta.dirname, ".."); const readFile = fs.readFile; const readFileSync = fs.readFileSync; diff --git a/packages/graphql/typegraphql/test/app/Server.ts b/packages/graphql/typegraphql/test/app/Server.ts index 3b8a6f203a3..0757e43126b 100644 --- a/packages/graphql/typegraphql/test/app/Server.ts +++ b/packages/graphql/typegraphql/test/app/Server.ts @@ -17,7 +17,7 @@ import "./services/RecipeService.js"; import "./services/UsersRepository.js"; import {pubSub} from "./graphql/pubsub/pubsub.js"; -const rootDir = __dirname; // automatically replaced by import.meta.dirname on build +const rootDir = import.meta.dirname; // automatically replaced by import.meta.dirname on build const rootCert = join(rootDir, "../.."); @Configuration({ rootDir, diff --git a/packages/orm/mikro-orm/test/helpers/Server.ts b/packages/orm/mikro-orm/test/helpers/Server.ts index b709d2b9ae1..2e5b133be16 100644 --- a/packages/orm/mikro-orm/test/helpers/Server.ts +++ b/packages/orm/mikro-orm/test/helpers/Server.ts @@ -7,7 +7,7 @@ import cookieParser from "cookie-parser"; import methodOverride from "method-override"; import "./services/ManagedEventSubscriber.js"; -const rootDir = __dirname; // automatically replaced by import.meta.dirname on build +const rootDir = import.meta.dirname; @Configuration({ rootDir, diff --git a/packages/orm/mongoose/test/helpers/Server.ts b/packages/orm/mongoose/test/helpers/Server.ts index 666a4dbcefc..a8df7d356e0 100644 --- a/packages/orm/mongoose/test/helpers/Server.ts +++ b/packages/orm/mongoose/test/helpers/Server.ts @@ -6,7 +6,7 @@ import compress from "compression"; import cookieParser from "cookie-parser"; import methodOverride from "method-override"; -const rootDir = __dirname; // automatically replaced by import.meta.dirname on build +const rootDir = import.meta.dirname; @Configuration({ rootDir, diff --git a/packages/orm/objection/test/helpers/Server.ts b/packages/orm/objection/test/helpers/Server.ts index 1234c5b544f..3cb8c0749e1 100644 --- a/packages/orm/objection/test/helpers/Server.ts +++ b/packages/orm/objection/test/helpers/Server.ts @@ -7,7 +7,7 @@ import compress from "compression"; import cookieParser from "cookie-parser"; import methodOverride from "method-override"; -const rootDir = __dirname; // automatically replaced by import.meta.dirname on build +const rootDir = import.meta.dirname; @Configuration({ rootDir, diff --git a/packages/orm/objection/test/integration.spec.ts b/packages/orm/objection/test/integration.spec.ts index eec149a2948..be94c10fde2 100644 --- a/packages/orm/objection/test/integration.spec.ts +++ b/packages/orm/objection/test/integration.spec.ts @@ -5,7 +5,7 @@ import {Knex} from "knex"; import {User} from "./helpers/models/User.js"; import {describe, beforeAll, beforeEach, it, afterAll, expect} from "vitest"; -const rootDir = __dirname; // automatically replaced by import.meta.dirname on build +const rootDir = import.meta.dirname; describe.skip("Objection integrations", () => { beforeAll(() => { diff --git a/packages/orm/prisma/src/__mock__/createProjectFixture.ts b/packages/orm/prisma/src/__mock__/createProjectFixture.ts index e08da15e68f..0d8f545d678 100644 --- a/packages/orm/prisma/src/__mock__/createProjectFixture.ts +++ b/packages/orm/prisma/src/__mock__/createProjectFixture.ts @@ -1,7 +1,7 @@ import {join} from "path"; import {ModuleKind, Project, ScriptTarget} from "ts-morph"; -const rootDir = __dirname; // automatically replaced by import.meta.dirname on build +const rootDir = import.meta.dirname; const SNAPSHOT_DIR = `${rootDir}/../../test/snapshots`; diff --git a/packages/orm/prisma/src/generator.ts b/packages/orm/prisma/src/generator.ts index cabb3597c05..a9ee8628c77 100644 --- a/packages/orm/prisma/src/generator.ts +++ b/packages/orm/prisma/src/generator.ts @@ -3,7 +3,7 @@ import {generatorHandler} from "@prisma/generator-helper"; import {join} from "path"; import {generate} from "./cli/prismaGenerator.js"; -const rootDir = __dirname; // automatically replaced by tsed tools on build +const rootDir = import.meta.dirname; export const defaultOutput = join(rootDir, "..", ".schema"); export const packageDir = join(rootDir, "..", ".."); diff --git a/packages/platform/common/src/services/PlatformResponse.spec.ts b/packages/platform/common/src/services/PlatformResponse.spec.ts index 8e000cba331..9b24ccd119d 100644 --- a/packages/platform/common/src/services/PlatformResponse.spec.ts +++ b/packages/platform/common/src/services/PlatformResponse.spec.ts @@ -3,7 +3,7 @@ import {createReadStream} from "fs"; import {PlatformResponse} from "./PlatformResponse.js"; import {PlatformTest} from "./PlatformTest.js"; -const rootDir = __dirname; // automatically replaced by import.meta.dirname on build +const rootDir = import.meta.dirname; vi.mock("on-finished"); diff --git a/packages/platform/common/test/integration/groups.spec.ts b/packages/platform/common/test/integration/groups.spec.ts index 973ffc90f43..5746cf02b2e 100644 --- a/packages/platform/common/test/integration/groups.spec.ts +++ b/packages/platform/common/test/integration/groups.spec.ts @@ -10,7 +10,7 @@ import cookieParser from "cookie-parser"; import methodOverride from "method-override"; import SuperTest from "supertest"; -const rootDir = __dirname; // automatically replaced by import.meta.dirname on build +const rootDir = import.meta.dirname; class MyModel { @Groups("!creation") diff --git a/packages/platform/common/test/integration/platform.spec.ts b/packages/platform/common/test/integration/platform.spec.ts index 8ec5c5a9dd7..104dafe55fd 100644 --- a/packages/platform/common/test/integration/platform.spec.ts +++ b/packages/platform/common/test/integration/platform.spec.ts @@ -8,7 +8,7 @@ import cookieParser from "cookie-parser"; import methodOverride from "method-override"; import SuperTest from "supertest"; -const rootDir = __dirname; // automatically replaced by import.meta.dirname on build +const rootDir = import.meta.dirname; @Controller("/hello") class TestHelloWorld { diff --git a/packages/platform/platform-exceptions/src/domain/ExceptionSchema.spec.ts b/packages/platform/platform-exceptions/src/domain/ExceptionSchema.spec.ts index 56237734748..9a57588bba4 100644 --- a/packages/platform/platform-exceptions/src/domain/ExceptionSchema.spec.ts +++ b/packages/platform/platform-exceptions/src/domain/ExceptionSchema.spec.ts @@ -5,7 +5,7 @@ import Ajv from "ajv"; import fs from "fs-extra"; import "./ExceptionSchema"; -const rootDir = __dirname; // automatically replaced by import.meta.dirname on build +const rootDir = import.meta.dirname; function getAjv() { return new Ajv({ diff --git a/packages/platform/platform-express/test/app/Server.ts b/packages/platform/platform-express/test/app/Server.ts index 93aa1b6ca74..bb72e584d0c 100644 --- a/packages/platform/platform-express/test/app/Server.ts +++ b/packages/platform/platform-express/test/app/Server.ts @@ -7,7 +7,7 @@ import session from "express-session"; import "../../src/index.js"; -const rootDir = __dirname; // automatically replaced by import.meta.dirname on build +const rootDir = import.meta.dirname; export {rootDir}; @Configuration({ diff --git a/packages/platform/platform-express/test/fullpayload.spec.ts b/packages/platform/platform-express/test/fullpayload.spec.ts index 8cbb3fde98e..905e807a38c 100644 --- a/packages/platform/platform-express/test/fullpayload.spec.ts +++ b/packages/platform/platform-express/test/fullpayload.spec.ts @@ -6,7 +6,7 @@ import SuperTest from "supertest"; import {PlatformExpress} from "../src/index.js"; import {rootDir, Server} from "./app/Server.js"; -const root = __dirname; +const root = import.meta.dirname; const utils = PlatformTestSdk.create({ rootDir, diff --git a/packages/platform/platform-koa/test/app/Server.ts b/packages/platform/platform-koa/test/app/Server.ts index ad2de3191ae..686e0e20cb3 100644 --- a/packages/platform/platform-koa/test/app/Server.ts +++ b/packages/platform/platform-koa/test/app/Server.ts @@ -4,7 +4,7 @@ import {Configuration, Inject} from "@tsed/di"; import Application from "koa"; import session from "koa-session"; -const rootDir = __dirname; // automatically replaced by import.meta.dirname on build +const rootDir = import.meta.dirname; export {rootDir}; @Configuration({ diff --git a/packages/platform/platform-test-sdk/src/tests/testMulter.ts b/packages/platform/platform-test-sdk/src/tests/testMulter.ts index 9709fa28380..6a289331e19 100644 --- a/packages/platform/platform-test-sdk/src/tests/testMulter.ts +++ b/packages/platform/platform-test-sdk/src/tests/testMulter.ts @@ -7,7 +7,7 @@ import readPkgUp from "read-pkg-up"; import SuperTest from "supertest"; import {PlatformTestingSdkOpts} from "../interfaces/index.js"; -const rootDir = __dirname; // automatically replaced by import.meta.dirname on build +const rootDir = import.meta.dirname; export class Task { @Property() @@ -79,7 +79,7 @@ export function testMulter(options: PlatformTestingSdkOpts) { const buffer = Buffer.from("test content"); const pkg = readPkgUp.sync({ - cwd: __dirname + cwd: import.meta.dirname }); const rootDir = join(dirname(pkg?.path || ""), "src"); diff --git a/packages/platform/platform-test-sdk/src/tests/testStream.ts b/packages/platform/platform-test-sdk/src/tests/testStream.ts index 3adbcbaf38b..3a9f09e5bff 100644 --- a/packages/platform/platform-test-sdk/src/tests/testStream.ts +++ b/packages/platform/platform-test-sdk/src/tests/testStream.ts @@ -6,7 +6,7 @@ import {join} from "path"; import SuperTest from "supertest"; import {PlatformTestingSdkOpts} from "../interfaces/index.js"; -const rootDir = __dirname; // automatically replaced by import.meta.dirname on build +const rootDir = import.meta.dirname; @Controller("/stream") class TestStreamCtrl { diff --git a/packages/security/jwks/src/getJwks.spec.ts b/packages/security/jwks/src/getJwks.spec.ts index e6ff5fcdfd2..08166dac525 100644 --- a/packages/security/jwks/src/getJwks.spec.ts +++ b/packages/security/jwks/src/getJwks.spec.ts @@ -2,7 +2,7 @@ import fs from "fs-extra"; import {join} from "path"; import {generateJwks, getJwks} from "./getJwks.js"; -const rootDir = join(__dirname, "__mocks__"); +const rootDir = join(import.meta.dirname, "__mocks__"); describe("GetJwks", () => { beforeEach(() => { diff --git a/packages/security/oidc-provider/test/app/Server.ts b/packages/security/oidc-provider/test/app/Server.ts index f7da9fbb390..c478742ede4 100644 --- a/packages/security/oidc-provider/test/app/Server.ts +++ b/packages/security/oidc-provider/test/app/Server.ts @@ -13,7 +13,7 @@ import methodOverride from "method-override"; import {join} from "path"; import {Accounts} from "./services/Accounts.js"; -const rootDir = __dirname; // automatically replaced by import.meta.dirname on build +const rootDir = import.meta.dirname; export {rootDir}; @Configuration({ diff --git a/packages/security/oidc-provider/test/oidc.integration.spec.ts b/packages/security/oidc-provider/test/oidc.integration.spec.ts index 57a773779f8..fec93e0f8a9 100644 --- a/packages/security/oidc-provider/test/oidc.integration.spec.ts +++ b/packages/security/oidc-provider/test/oidc.integration.spec.ts @@ -10,7 +10,7 @@ import {Server} from "./app/Server.js"; import {join} from "path"; import {Accounts} from "./app/services/Accounts.js"; -const testDir = __dirname; +const testDir = import.meta.dirname; const utils = PlatformTestSdk.create({ rootDir, diff --git a/packages/security/passport/test/app/Server.ts b/packages/security/passport/test/app/Server.ts index 609ca39fbf0..a3199efa399 100644 --- a/packages/security/passport/test/app/Server.ts +++ b/packages/security/passport/test/app/Server.ts @@ -12,7 +12,7 @@ import {Account} from "./models/Account.js"; import "./protocols/LoginLocalProtocol.js"; import session from "express-session"; -const rootDir = __dirname; // automatically replaced by import.meta.dirname on build +const rootDir = import.meta.dirname; export {rootDir}; @Configuration({ diff --git a/packages/specs/schema/src/utils/generateSpec.spec.ts b/packages/specs/schema/src/utils/generateSpec.spec.ts index 20cb6b64583..3c75550ce8f 100644 --- a/packages/specs/schema/src/utils/generateSpec.spec.ts +++ b/packages/specs/schema/src/utils/generateSpec.spec.ts @@ -17,7 +17,7 @@ import {AnyOf} from "../decorators/common/anyOf"; import {Post} from "../decorators/operations/route"; import {BodyParams} from "@tsed/platform-params"; -const rootDir = __dirname; // automatically replaced by import.meta.dirname on build +const rootDir = import.meta.dirname; describe("generateSpec()", () => { describe("OS 3.0.1", () => { @@ -141,13 +141,7 @@ describe("generateSpec()", () => { it("should generate spec and correctly merge shared model with custom schema", async () => { class Model { - @AnyOf( - Number, - Boolean, - String, - { type: 'array', items: { type: 'number' } }, - { type: 'array', items: { type: 'string' } }, - ) + @AnyOf(Number, Boolean, String, {type: "array", items: {type: "number"}}, {type: "array", items: {type: "string"}}) test: number | boolean | string | number[] | string[]; } @@ -166,7 +160,7 @@ describe("generateSpec()", () => { const result = await generateSpec({ tokens: [ {token: Controller1, rootPath: "/rest"}, - {token: Controller2, rootPath: "/rest"}, + {token: Controller2, rootPath: "/rest"} ], specVersion: "3.0.1", specPath: join(rootDir, "__mock__", "spec.json") @@ -195,13 +189,13 @@ describe("generateSpec()", () => { parameters: [], requestBody: { content: { - 'application/json': { + "application/json": { schema: { - $ref: '#/components/schemas/Model' + $ref: "#/components/schemas/Model" } } }, - required: false, + required: false }, responses: { "200": { @@ -209,7 +203,7 @@ describe("generateSpec()", () => { } }, tags: ["Controller1"] - }, + } }, "/rest/controller2/post": { post: { @@ -217,13 +211,13 @@ describe("generateSpec()", () => { parameters: [], requestBody: { content: { - 'application/json': { + "application/json": { schema: { - $ref: '#/components/schemas/Model' + $ref: "#/components/schemas/Model" } } }, - required: false, + required: false }, responses: { "200": { @@ -231,7 +225,7 @@ describe("generateSpec()", () => { } }, tags: ["Controller2"] - }, + } } }, tags: [ @@ -240,20 +234,20 @@ describe("generateSpec()", () => { }, { name: "Controller2" - }, + } ], components: { schemas: { Model: { - type: 'object', + type: "object", properties: { test: { anyOf: [ - { type: 'number' }, - { type: 'boolean' }, - { type: 'string' }, - { type: 'array', items: { type: 'number' } }, - { type: 'array', items: { type: 'string' } }, + {type: "number"}, + {type: "boolean"}, + {type: "string"}, + {type: "array", items: {type: "number"}}, + {type: "array", items: {type: "string"}} ] } } diff --git a/packages/specs/schema/test/helpers/validateSpec.ts b/packages/specs/schema/test/helpers/validateSpec.ts index 3500da5c7d1..00705d6f0b6 100644 --- a/packages/specs/schema/test/helpers/validateSpec.ts +++ b/packages/specs/schema/test/helpers/validateSpec.ts @@ -3,7 +3,7 @@ import {SpecTypes} from "../../src/index.js"; import fs from "fs-extra"; import {v4} from "uuid"; -const rootDir = __dirname; // automatically replaced by import.meta.dirname on build +const rootDir = import.meta.dirname; export const validateSpec = async (spec: any, version = SpecTypes.SWAGGER) => { const file = `${rootDir}/spec-${v4()}.json`; diff --git a/packages/specs/swagger/src/constants.ts b/packages/specs/swagger/src/constants.ts index aacda450fe5..16c3342939c 100644 --- a/packages/specs/swagger/src/constants.ts +++ b/packages/specs/swagger/src/constants.ts @@ -1,4 +1,4 @@ import getAbsoluteFSPath from "swagger-ui-dist/absolute-path.js"; export const SWAGGER_UI_DIST = getAbsoluteFSPath(); -export const ROOT_DIR = __dirname; +export const ROOT_DIR = import.meta.dirname; diff --git a/packages/specs/swagger/test/app/Server.ts b/packages/specs/swagger/test/app/Server.ts index a21841b23df..8d6ed6376e6 100644 --- a/packages/specs/swagger/test/app/Server.ts +++ b/packages/specs/swagger/test/app/Server.ts @@ -6,7 +6,7 @@ import compress from "compression"; import cookieParser from "cookie-parser"; import methodOverride from "method-override"; -const rootDir = __dirname; // automatically replaced by import.meta.dirname on build +const rootDir = import.meta.dirname; @Configuration({ rootDir, diff --git a/packages/third-parties/agenda/test/helpers/Server.ts b/packages/third-parties/agenda/test/helpers/Server.ts index 417b27bd231..53b939ffa8a 100644 --- a/packages/third-parties/agenda/test/helpers/Server.ts +++ b/packages/third-parties/agenda/test/helpers/Server.ts @@ -6,7 +6,7 @@ import bodyParser from "body-parser"; import compress from "compression"; import methodOverride from "method-override"; -const rootDir = __dirname; // automatically replaced by import.meta.dirname on build +const rootDir = import.meta.dirname; @Configuration({ rootDir, diff --git a/packages/third-parties/components-scan/src/importFiles.spec.ts b/packages/third-parties/components-scan/src/importFiles.spec.ts index 5a050d54b0f..7c524edb685 100644 --- a/packages/third-parties/components-scan/src/importFiles.spec.ts +++ b/packages/third-parties/components-scan/src/importFiles.spec.ts @@ -3,7 +3,7 @@ import {Test1} from "./__mock__/Test1.js"; import {Test2} from "./__mock__/Test2.js"; import {importFiles} from "./importFiles.js"; -const rootDir = __dirname; // automatically replaced by import.meta.dirname on build +const rootDir = import.meta.dirname; describe("importFiles", () => { it("should import symbols", async () => { diff --git a/packages/third-parties/components-scan/src/importProviders.spec.ts b/packages/third-parties/components-scan/src/importProviders.spec.ts index 6297014aca4..2d5cd8a2955 100644 --- a/packages/third-parties/components-scan/src/importProviders.spec.ts +++ b/packages/third-parties/components-scan/src/importProviders.spec.ts @@ -2,7 +2,7 @@ import {nameOf} from "@tsed/core"; import {resolveControllers} from "@tsed/di"; import {importProviders} from "./importProviders.js"; -const rootDir = __dirname; // automatically replaced by import.meta.dirname on build +const rootDir = import.meta.dirname; describe("importProviders", () => { it("should load providers and merge configuration", async () => { diff --git a/packages/third-parties/event-emitter/test/helpers/Server.ts b/packages/third-parties/event-emitter/test/helpers/Server.ts index 8c62033fca8..69128c69680 100644 --- a/packages/third-parties/event-emitter/test/helpers/Server.ts +++ b/packages/third-parties/event-emitter/test/helpers/Server.ts @@ -7,7 +7,7 @@ import methodOverride from "method-override"; import "@tsed/platform-express"; import "../../src/EventEmitterModule.js"; -const rootDir = __dirname; // automatically replaced by import.meta.dirname on build +const rootDir = import.meta.dirname; @Configuration({ rootDir, diff --git a/packages/third-parties/formio/test/app/Server.ts b/packages/third-parties/formio/test/app/Server.ts index 45d262ff21b..39b73d2c90e 100644 --- a/packages/third-parties/formio/test/app/Server.ts +++ b/packages/third-parties/formio/test/app/Server.ts @@ -12,7 +12,7 @@ import methodOverride from "method-override"; import "../../src/index.js"; import template from "../template/project.json"; -const rootDir = __dirname; // automatically replaced by import.meta.dirname on build +const rootDir = import.meta.dirname; export {rootDir}; @Configuration({ diff --git a/packages/third-parties/pulse/test/helpers/Server.ts b/packages/third-parties/pulse/test/helpers/Server.ts index b2847947913..5d1db0bf2d8 100644 --- a/packages/third-parties/pulse/test/helpers/Server.ts +++ b/packages/third-parties/pulse/test/helpers/Server.ts @@ -6,7 +6,7 @@ import bodyParser from "body-parser"; import compress from "compression"; import methodOverride from "method-override"; -const rootDir = __dirname; // automatically replaced by import.meta.dirname on build +const rootDir = import.meta.dirname; @Configuration({ rootDir, diff --git a/packages/third-parties/socketio/test/app/Server.ts b/packages/third-parties/socketio/test/app/Server.ts index 1d4418bb000..0ec0c7ebb2f 100644 --- a/packages/third-parties/socketio/test/app/Server.ts +++ b/packages/third-parties/socketio/test/app/Server.ts @@ -8,7 +8,7 @@ import cookieParser from "cookie-parser"; import methodOverride from "method-override"; import {SocketPageCtrl} from "./controllers/pages/SocketPageCtrl.js"; -const rootDir = __dirname; // automatically replaced by import.meta.dirname on build +const rootDir = import.meta.dirname; export {rootDir}; diff --git a/packages/third-parties/stripe/test/app/Server.ts b/packages/third-parties/stripe/test/app/Server.ts index aaeed23dd47..19dbf91ba7c 100644 --- a/packages/third-parties/stripe/test/app/Server.ts +++ b/packages/third-parties/stripe/test/app/Server.ts @@ -4,7 +4,7 @@ import {Configuration} from "@tsed/di"; import "@tsed/stripe"; import "@tsed/swagger"; -const rootDir = __dirname; // automatically replaced by import.meta.dirname on build +const rootDir = import.meta.dirname; export {rootDir}; @Configuration({ diff --git a/packages/third-parties/temporal/test/helpers/Server.ts b/packages/third-parties/temporal/test/helpers/Server.ts index de6a24b16fc..4ec6d1aa9ba 100644 --- a/packages/third-parties/temporal/test/helpers/Server.ts +++ b/packages/third-parties/temporal/test/helpers/Server.ts @@ -6,7 +6,7 @@ import bodyParser from "body-parser"; import compress from "compression"; import methodOverride from "method-override"; -const rootDir = __dirname; // automatically replaced by import.meta.dirname on build +const rootDir = import.meta.dirname; @Configuration({ rootDir, diff --git a/packages/third-parties/temporal/test/worker.integration.spec.ts b/packages/third-parties/temporal/test/worker.integration.spec.ts index df733a39b58..bc86df4b317 100644 --- a/packages/third-parties/temporal/test/worker.integration.spec.ts +++ b/packages/third-parties/temporal/test/worker.integration.spec.ts @@ -25,7 +25,7 @@ describe("Temporal Worker", () => { it("should start a worker and execute decorated activities", async () => { const worker = await bootstrapWorker(Server, { worker: { - workflowsPath: join(__dirname, "workflows"), + workflowsPath: join(import.meta.dirname, "workflows"), taskQueue: "test" }, connection: testEnv.nativeConnection diff --git a/packages/third-parties/terminus/test/app/Server.ts b/packages/third-parties/terminus/test/app/Server.ts index 3e3e2852df9..042d2dd2229 100644 --- a/packages/third-parties/terminus/test/app/Server.ts +++ b/packages/third-parties/terminus/test/app/Server.ts @@ -8,7 +8,7 @@ import {Application} from "express"; import "./services/MongoClient.js"; import "./services/RedisClient.js"; -const rootDir = __dirname; // automatically replaced by import.meta.dirname on build +const rootDir = import.meta.dirname; export {rootDir}; @Configuration({ diff --git a/packages/third-parties/vike/src/middlewares/ViteRendererMiddleware.spec.ts b/packages/third-parties/vike/src/middlewares/ViteRendererMiddleware.spec.ts index 9819ee29f69..aa6f3da230f 100644 --- a/packages/third-parties/vike/src/middlewares/ViteRendererMiddleware.spec.ts +++ b/packages/third-parties/vike/src/middlewares/ViteRendererMiddleware.spec.ts @@ -2,7 +2,7 @@ import {PlatformTest} from "@tsed/common"; import {ViteService} from "../services/ViteService.js"; import {ViteRendererMiddleware} from "./ViteRendererMiddleware.js"; -const rootDir = __dirname; // automatically replaced by import.meta.dirname on build +const rootDir = import.meta.dirname; describe("ViteRenderMiddleware", () => { describe("use()", () => { From ff16ab1d70262be14664482acbe4f5fe69c21cc4 Mon Sep 17 00:00:00 2001 From: Romain Lenzotti Date: Tue, 24 Sep 2024 10:20:38 +0200 Subject: [PATCH 2/6] chore: bump dependencies to TS 5 and eslint 9 --- .eslintignore | 14 - .eslintrc.js | 37 - benchmarks/bin/benchmark-bench.js | 3 +- benchmarks/bin/benchmark-compare.js | 11 +- .../frameworks/express-injector-async-hook.js | 4 +- .../frameworks/express-injector-http-hook.js | 6 +- .../express-injector-without-events.js | 6 +- benchmarks/frameworks/express-injector.js | 4 +- benchmarks/frameworks/fastify-injector.js | 4 +- benchmarks/frameworks/hapi.js | 1 + .../frameworks/koa-isomorphic-router.js | 2 +- benchmarks/frameworks/koa-router.js | 2 +- benchmarks/frameworks/nest-fastify.js | 1 + .../frameworks/nest/app/app.controller.js | 2 +- benchmarks/frameworks/nest/app/app.module.js | 3 +- benchmarks/frameworks/nest/index.js | 1 + benchmarks/frameworks/tsed-express.js | 4 +- benchmarks/frameworks/tsed-koa.js | 4 +- benchmarks/frameworks/tsed-no-context.js | 4 +- benchmarks/frameworks/tsed-no-events.js | 4 +- benchmarks/src/autocannon.js | 2 +- benchmarks/src/bench.js | 3 +- benchmarks/src/packages.js | 2 +- docs/.vuepress/enhanceApp.js | 3 +- .../auth-custom-auth-example.ts | 3 +- .../auth-decorator-example-2.ts | 5 +- .../authentication/auth-decorator-example.ts | 5 +- .../snippets/authentication/auth-example.ts | 3 +- .../authentication/auth-middleware.ts | 4 +- .../authentication/auth-swagger-example.ts | 9 +- .../configuration/bootstrap-with-dotenv.ts | 1 + .../bootstrap-with-node-config.ts | 1 + docs/docs/snippets/configuration/bootstrap.ts | 1 + .../configuration/module-options-imports.ts | 1 + .../configuration/module-resolvers.ts | 1 + .../modulev0-endpoint-versionning.ts | 1 + .../modulev1-endpoint-versionning.ts | 1 + ...server-endpoint-versionning-with-module.ts | 1 + .../server-endpoint-versionning.ts | 7 +- .../configuration/server-options-imports.ts | 1 + .../configuration/server-resolvers.ts | 1 + docs/docs/snippets/configuration/server.ts | 1 + .../snippets/controllers/async-controller.ts | 2 +- .../snippets/controllers/axios-controller.ts | 2 +- .../snippets/controllers/basic-controller.ts | 2 +- .../controllers/child-controllers-calendar.ts | 3 +- .../controllers/child-controllers-event.ts | 2 +- .../controllers/child-controllers-rest.ts | 1 + .../controllers/child-controllers-server.ts | 1 + .../snippets/controllers/getting-started.ts | 4 +- .../inheritance-base-controller.ts | 3 +- .../inheritance-child-controller.ts | 3 +- docs/docs/snippets/controllers/inject-next.ts | 2 +- .../controllers/inject-req-res-node.ts | 2 +- .../controllers/inject-req-res-platform.ts | 2 +- .../controllers/inject-req-res-target.ts | 2 +- .../snippets/controllers/inject-router.ts | 2 +- .../snippets/controllers/locals-example.ts | 4 +- .../snippets/controllers/merge-params-1.ts | 2 +- .../snippets/controllers/merge-params-2.ts | 2 +- docs/docs/snippets/controllers/middlewares.ts | 3 +- .../multiple-endpoint-single-method.ts | 2 +- .../controllers/params-advanced-usage.ts | 2 +- .../snippets/controllers/params-decorator.ts | 3 +- .../snippets/controllers/params-post-any.ts | 2 +- .../params-post-array-with-model.ts | 2 +- .../snippets/controllers/params-post-array.ts | 2 +- .../snippets/controllers/params-post-enum.ts | 2 +- .../params-post-inline-validation.ts | 2 +- .../controllers/params-post-string.ts | 2 +- .../snippets/controllers/request-headers.ts | 2 +- .../controllers/request-input-validation.ts | 2 +- .../snippets/controllers/request-raw-body.ts | 2 +- .../controllers/response-content-type.ts | 12 +- .../response-generics-controller.ts | 9 +- .../controllers/response-generics-document.ts | 1 + .../controllers/response-generics-product.ts | 1 + .../snippets/controllers/response-headers.ts | 6 +- .../snippets/controllers/response-status.ts | 4 +- .../controllers/response-throw-exceptions.ts | 4 +- .../docs/snippets/controllers/routes-order.ts | 2 +- docs/docs/snippets/controllers/routing.ts | 1 + .../controller-usage-with-return-type.ts | 5 +- .../snippets/converters/controller-usage.ts | 5 +- .../converters/model-additional-props.jest.ts | 1 + .../model-additional-props.mocha.ts | 1 + .../converters/model-ignore-props.jest.ts | 1 + .../converters/model-ignore-props.mocha.ts | 1 + .../model-missing-properties.jest.ts | 1 + .../model-missing-properties.mocha.ts | 1 + .../snippets/converters/model-usage.jest.ts | 1 + .../snippets/converters/model-usage.mocha.ts | 1 + docs/docs/snippets/converters/model-usage.ts | 2 +- .../converters/server-moment-mapper-import.ts | 3 +- .../exceptions/custom-exception-usage.ts | 5 +- docs/docs/snippets/exceptions/error-filter.ts | 2 +- .../exceptions/http-exception-filter.ts | 2 +- .../snippets/exceptions/usage-controller.ts | 5 +- .../exceptions/usage-express-route.ts | 1 + .../interceptors/interceptor-example.ts | 2 +- .../interceptors/interceptor-usage.ts | 3 +- .../snippets/middlewares/accept-mime-usage.ts | 4 +- .../snippets/middlewares/call-sequences.ts | 2 +- .../custom-endpoint-decorator-accept-mime.ts | 2 +- .../custom-endpoint-decorator-status.ts | 2 +- .../endpoint-middleware-decorator.ts | 3 +- .../middlewares/endpoint-middleware-usage.ts | 3 +- .../middlewares/endpoint-middleware.ts | 4 +- .../endpoint-use-decorator-usage.ts | 3 +- .../global-middleware-configuration.ts | 1 + .../middlewares/global-middleware-error.ts | 2 +- .../snippets/middlewares/global-middleware.ts | 4 +- .../middlewares/middleware-example.ts | 2 +- .../middlewares/override-middleware.ts | 2 +- .../middlewares/server-configuration.ts | 1 + docs/docs/snippets/model/collections.ts | 1 + docs/docs/snippets/model/controller.ts | 3 +- .../model/functional-schema-controller.ts | 4 +- .../snippets/model/generics-controller1.ts | 5 +- .../model/get-spec-generics-controller1.ts | 5 +- .../model/group-users-ctrl-on-class.ts | 7 +- docs/docs/snippets/model/group-users-ctrl.ts | 7 +- docs/docs/snippets/model/name.ts | 2 +- .../snippets/model/nullable-properties.ts | 1 + docs/docs/snippets/model/pagination-ctrl.ts | 7 +- docs/docs/snippets/model/pagination-filter.ts | 1 + docs/docs/snippets/model/pagination-model.ts | 1 + docs/docs/snippets/model/pagination-spec.ts | 3 +- .../snippets/model/raw-schema-controller.ts | 4 +- .../pipes/async-transformer-pipe-usage.ts | 3 +- .../async-transformer-pipe-with-options.ts | 1 + .../snippets/pipes/async-transformer-pipe.ts | 3 +- .../pipes/controller-model-validation.ts | 5 +- .../pipes/pipes-decorator-with-options.ts | 3 +- docs/docs/snippets/pipes/pipes-decorator.ts | 3 +- .../snippets/pipes/transformer-pipe-usage.ts | 3 +- docs/docs/snippets/pipes/transformer-pipe.ts | 2 +- docs/docs/snippets/pipes/use-params.ts | 2 +- .../pipes/validation-pipe-identity.ts | 2 +- .../pipes/validation-pipe-with-ajv.ts | 2 +- .../providers/binding-configuration.ts | 2 +- .../custom-provider-use-class-usage.ts | 1 + .../custom-provider-use-value-usage.ts | 1 + .../providers/getting-started-controller.ts | 3 +- .../providers/getting-started-injectable.ts | 1 + .../providers/getting-started-serverloader.ts | 1 + .../providers/getting-started-service.ts | 1 + .../snippets/providers/scope-chain-fail.ts | 2 +- docs/docs/snippets/providers/scope-chain.ts | 2 +- .../docs/snippets/providers/scope-instance.ts | 2 +- docs/docs/snippets/providers/scope-request.ts | 2 +- .../snippets/providers/scope-singleton.ts | 2 +- .../request-context/context-example.ts | 7 +- .../templating/response-templating.ts | 2 +- .../snippets/templating/template-cache.ts | 2 +- .../templating/template-platform-api.ts | 2 +- .../testing/db-service-async-await.jest.ts | 1 + .../testing/db-service-async-await.legacy.ts | 1 + .../testing/db-service-async-await.mocha.ts | 1 + .../testing/db-service-async-await.vitest.ts | 1 + .../db-service-mock-dependencies.jest.ts | 1 + .../db-service-mock-dependencies.legacy.ts | 1 + .../db-service-mock-dependencies.mocha.ts | 1 + .../db-service-mock-dependencies.vitest.ts | 3 +- .../testing/parse-service-legacy.spec.ts | 3 +- .../testing/parse-service.jest.spec.ts | 3 +- .../testing/parse-service.mocha.spec.ts | 1 + .../testing/parse-service.vitest.spec.ts | 3 +- .../docs/snippets/testing/supertest.legacy.ts | 1 + .../validation/class-transformer-pipe.ts | 2 +- .../validation/class-validator-pipe.ts | 2 +- .../snippets/validation/joi-pipe-decorator.ts | 3 +- .../snippets/validation/joi-pipe-usage.ts | 3 +- docs/docs/snippets/validation/joi-pipe.ts | 4 +- .../snippets/validation/validator-pipe.ts | 3 +- .../migrate-from-express/bootstrap.ts | 3 +- .../snippets/migrate-from-express/server.ts | 2 +- docs/snippets/getting-started/server.ts | 2 +- .../snippets/aws/server-configuration.ts | 3 +- .../snippets/graphql/datasource-service.ts | 1 + .../snippets/graphql/get-server-instance.ts | 2 +- .../snippets/graphql/resolver-data-source.ts | 1 + .../snippets/graphql/resolver-service.ts | 1 + .../snippets/graphql/server-configuration.ts | 3 +- .../snippets/graphql/testing.jest.ts | 6 +- .../snippets/graphql/testing.mocha.ts | 6 +- .../snippets/mongoose/collections.ts | 2 +- .../snippets/mongoose/configuration.ts | 3 +- .../snippets/mongoose/decimal-numbers.ts | 2 +- .../mongoose/declaring-model-connection.ts | 2 +- .../snippets/mongoose/declaring-model.ts | 2 +- .../snippets/mongoose/declaring-schema.ts | 2 +- .../snippets/mongoose/discriminator.ts | 2 +- .../mongoose/example-model-mongoose.ts | 2 +- .../mongoose/extended-circular-reference.ts | 2 +- .../snippets/mongoose/inject-model.ts | 1 + docs/tutorials/snippets/mongoose/plugin.ts | 1 + docs/tutorials/snippets/mongoose/post-hook.ts | 2 +- docs/tutorials/snippets/mongoose/pre-hook.ts | 2 +- .../snippets/mongoose/references-circular.ts | 2 +- .../snippets/mongoose/subdocuments.ts | 2 +- .../snippets/mongoose/testing-api.jest.ts | 1 + .../snippets/mongoose/testing-api.mocha.ts | 1 + .../snippets/mongoose/testing-api.vitest.ts | 1 + .../snippets/mongoose/testing-model.jest.ts | 2 +- .../snippets/mongoose/testing-model.vitest.ts | 2 +- .../snippets/mongoose/version-key.ts | 2 +- .../snippets/mongoose/virtual-references.ts | 2 +- .../snippets/multer/configuration.ts | 3 +- docs/tutorials/snippets/multer/controller.ts | 2 +- docs/tutorials/snippets/multer/file-array.ts | 2 +- docs/tutorials/snippets/multer/middleware.ts | 8 +- .../passport/AcceptRolesMiddleware.ts | 2 +- .../snippets/passport/AzureBearerProtocol.ts | 3 +- .../snippets/passport/BasicProtocol.spec.ts | 3 +- .../snippets/passport/BasicProtocol.ts | 1 + .../snippets/passport/DiscordProtocol.ts | 1 + .../snippets/passport/FacebookProtocol.ts | 1 + .../snippets/passport/JwtProtocol.ts | 1 + .../passport/LoginLocalProtocol.spec.ts | 3 +- .../snippets/passport/LoginLocalProtocol.ts | 3 +- .../snippets/passport/PassportCtrl.ts | 2 +- .../snippets/passport/PassportFacebookCtrl.ts | 2 +- .../snippets/passport/SignupLocalProtocol.ts | 5 +- .../snippets/passport/acceptRoles.ts | 3 +- .../snippets/passport/guard-basic-auth.ts | 5 +- .../tutorials/snippets/passport/guard-ctrl.ts | 5 +- .../snippets/passport/roles-usage.ts | 3 +- docs/tutorials/snippets/passport/server.ts | 10 +- .../session/configuration-middleware.ts | 4 +- .../snippets/session/configuration.ts | 3 +- .../snippets/session/example-cookies.ts | 3 +- .../snippets/session/example-session.ts | 4 +- .../snippets/session/example-test.jest.ts | 1 + .../snippets/session/example-test.legacy.ts | 1 + .../snippets/session/example-test.mocha.ts | 1 + .../snippets/session/example-test.vitest.ts | 3 +- .../snippets/socketio/configuration.ts | 3 +- ...connection-state-recovery-configuration.ts | 3 +- .../snippets/socketio/socket-service-di.ts | 3 +- .../socketio/socket-service-dynamic-nsp.ts | 2 +- .../snippets/socketio/socket-service.ts | 2 +- .../socketio/socket-use-middleware.ts | 3 +- .../socketio/socket-use-middleware2.ts | 5 +- .../snippets/swagger/configuration-with-js.ts | 3 +- .../snippets/swagger/configuration.ts | 3 +- .../swagger/endpoint-documentation.ts | 5 +- .../swagger/endpoint-extra-in-params.ts | 5 +- docs/tutorials/snippets/swagger/multi-spec.ts | 3 +- .../snippets/typeorm/typeorm-configuration.ts | 3 +- .../typeorm/typeorm-custom-configuration.ts | 3 +- .../typeorm/typeorm-entity-controller.ts | 3 +- .../typeorm/typeorm-entity-repository.ts | 3 +- .../typeorm-injection-async-provider.ts | 1 + .../typeorm-injection-entity-repository.ts | 6 +- .../snippets/typeorm/typeorm-usage.ts | 1 + eslint.config.mjs | 73 + lint-staged.config.js | 4 - package.json | 65 +- packages/core/package.json | 2 +- packages/core/src/domain/AnyToPromise.spec.ts | 1 + packages/core/src/domain/Metadata.spec.ts | 12 - packages/core/src/domain/Metadata.ts | 1 + .../utils/decorators/useDecorators.spec.ts | 4 +- .../src/utils/decorators/useDecorators.ts | 2 +- .../src/utils/objects/ObjectUtils.spec.ts | 30 +- .../core/src/utils/objects/ancestorsOf.ts | 2 +- packages/core/src/utils/objects/deepClone.ts | 4 +- .../core/src/utils/objects/deepMerge.spec.ts | 6 +- .../core/src/utils/objects/getValue.spec.ts | 2 +- .../core/src/utils/objects/isInheritedFrom.ts | 2 +- .../core/src/utils/objects/isSerializable.ts | 4 +- packages/core/src/utils/objects/methodsOf.ts | 4 +- .../core/src/utils/objects/setValue.spec.ts | 2 +- packages/core/tsconfig.esm.json | 4 +- packages/core/tsconfig.spec.json | 1 - packages/di/package.json | 2 +- .../common/decorators/autoInjectable.spec.ts | 1 + .../src/common/decorators/autoInjectable.ts | 1 + .../common/decorators/configuration.spec.ts | 1 + .../di/src/common/decorators/configuration.ts | 3 +- .../di/src/common/decorators/constant.spec.ts | 2 +- packages/di/src/common/decorators/constant.ts | 1 + .../di/src/common/decorators/controller.ts | 1 + .../di/src/common/decorators/inject.spec.ts | 3 +- packages/di/src/common/decorators/inject.ts | 3 +- .../src/common/decorators/injectable.spec.ts | 2 +- .../src/common/decorators/intercept.spec.ts | 1 + .../di/src/common/decorators/intercept.ts | 1 + .../src/common/decorators/lazyInject.spec.ts | 5 +- .../di/src/common/decorators/lazyInject.ts | 1 + packages/di/src/common/decorators/module.ts | 5 +- packages/di/src/common/decorators/opts.ts | 1 + .../src/common/decorators/overrideProvider.ts | 1 + .../di/src/common/decorators/scope.spec.ts | 1 + packages/di/src/common/decorators/scope.ts | 1 + .../di/src/common/decorators/useOpts.spec.ts | 1 + packages/di/src/common/decorators/useOpts.ts | 3 +- packages/di/src/common/decorators/value.ts | 1 + packages/di/src/common/domain/Container.ts | 2 +- .../src/common/domain/LocalsContainer.spec.ts | 2 +- .../di/src/common/domain/LocalsContainer.ts | 1 + .../di/src/common/domain/Provider.spec.ts | 2 +- packages/di/src/common/domain/Provider.ts | 1 + .../di/src/common/errors/InjectionError.ts | 1 + .../common/integration/async-factory.spec.ts | 3 +- .../di/src/common/integration/imports.spec.ts | 2 +- .../di/src/common/integration/request.spec.ts | 2 +- .../interfaces/ImportTokenProviderOpts.ts | 1 + .../di/src/common/interfaces/ProviderOpts.ts | 3 +- .../src/common/interfaces/RegistrySettings.ts | 1 + .../di/src/common/interfaces/TokenProvider.ts | 2 +- .../common/registries/GlobalProviders.spec.ts | 2 - .../src/common/registries/GlobalProviders.ts | 1 + .../registries/ProviderRegistry.spec.ts | 10 +- .../common/services/DIConfiguration.spec.ts | 1 + .../di/src/common/services/DIConfiguration.ts | 1 + .../common/services/InjectorService.spec.ts | 83 +- .../di/src/common/services/InjectorService.ts | 1 + .../common/utils/__mock__/module1/Module1.ts | 2 +- .../di/src/common/utils/createContainer.ts | 1 + .../common/utils/resolveControllers.spec.ts | 5 +- .../di/src/common/utils/resolveControllers.ts | 7 +- .../src/node/decorators/injectContext.spec.ts | 1 + .../di/src/node/decorators/injectContext.ts | 1 + .../di/src/node/domain/ContextLogger.spec.ts | 32 +- packages/di/src/node/domain/ContextLogger.ts | 3 +- .../integration/async-factory-invoke.spec.ts | 2 +- .../node/integration/invoke-oninit.spec.ts | 2 +- .../di/src/node/services/DILogger.spec.ts | 1 + packages/di/src/node/services/DILogger.ts | 1 + packages/di/src/node/services/DITest.spec.ts | 1 + packages/di/src/node/services/DITest.ts | 1 + .../node/utils/__mock__/module1/Module1.ts | 2 +- .../di/src/node/utils/asyncHookContext.ts | 1 + .../di/src/node/utils/attachLogger.spec.ts | 1 + .../node/utils/setLoggerConfiguration.spec.ts | 5 +- packages/di/tsconfig.esm.json | 7 +- packages/di/tsconfig.spec.json | 1 - packages/engines/package.json | 2 +- packages/engines/src/components/DustEngine.ts | 5 +- packages/engines/src/components/EctEngine.ts | 1 + .../src/components/HoganEngine.spec.ts | 1 + packages/engines/src/components/JustEngine.ts | 1 + .../engines/src/components/NunjucksEngine.ts | 2 +- .../engines/src/components/ReactEngine.ts | 5 +- .../src/components/SquirrellyEngine.spec.ts | 1 + .../engines/src/components/TwingEngine.ts | 3 +- packages/engines/src/components/VashEngine.ts | 1 + packages/engines/src/utils/cache.ts | 5 +- packages/engines/src/utils/getEngines.spec.ts | 4 +- packages/engines/test/getEngineFixture.ts | 1 + packages/engines/test/integration.spec.ts | 5 +- packages/engines/test/shared/dust.ts | 3 +- packages/engines/test/shared/filters.ts | 3 +- packages/engines/test/shared/helpers.ts | 5 +- packages/engines/test/shared/includes.ts | 1 + packages/engines/test/shared/index.ts | 1 + packages/engines/test/shared/partials.ts | 5 +- packages/engines/test/shared/react.ts | 1 + packages/engines/tsconfig.esm.json | 5 +- packages/engines/tsconfig.spec.json | 1 - packages/graphql/apollo/package.json | 2 +- packages/graphql/apollo/src/ApolloModule.ts | 3 +- .../apollo/src/decorators/dataSource.ts | 1 + .../src/decorators/injectApolloContext.ts | 1 + .../src/interfaces/AlterApolloContext.ts | 1 + .../interfaces/AlterApolloServerPlugins.ts | 1 + .../apollo/src/interfaces/ApolloSettings.ts | 1 + .../apollo/src/services/ApolloService.spec.ts | 1 + .../apollo/src/services/ApolloService.ts | 3 +- packages/graphql/apollo/tsconfig.esm.json | 5 +- packages/graphql/apollo/tsconfig.spec.json | 1 - packages/graphql/graphql-ws/package.json | 2 +- packages/graphql/graphql-ws/tsconfig.esm.json | 5 +- packages/graphql/typegraphql/package.json | 2 +- .../typegraphql/src/TypeGraphQLModule.ts | 4 +- .../typegraphql/src/decorators/resolver.ts | 1 + .../typegraphql/src/interfaces/interfaces.ts | 2 +- .../graphql/typegraphql/test/app/Server.ts | 17 +- .../test/app/graphql/auth/AuthResolver.ts | 1 + .../app/graphql/datasources/MyDataSource.ts | 7 +- .../typegraphql/test/app/graphql/index.ts | 2 +- .../test/app/graphql/pubsub/pubsub.ts | 1 + .../app/graphql/recipes/RecipeResolver.ts | 3 +- .../typegraphql/test/app/index.express.ts | 1 + .../graphql/typegraphql/test/app/index.koa.ts | 1 + .../test/app/protocols/GraphQLProtocol.ts | 1 + .../test/app/services/RecipeService.ts | 1 + .../test/app/services/UsersRepository.ts | 1 + packages/graphql/typegraphql/test/poc/koa.js | 6 +- .../test/typegraphql-passport.spec.ts | 4 +- .../typegraphql/test/typegraphql.spec.ts | 8 +- .../graphql/typegraphql/tsconfig.esm.json | 5 +- .../graphql/typegraphql/tsconfig.spec.json | 1 - packages/orm/adapters-redis/package.json | 2 +- .../src/adapters/OIDCRedisAdapter.spec.ts | 4 +- .../src/adapters/OIDCRedisAdapter.ts | 3 +- .../src/adapters/RedisAdapter.spec.ts | 1 + packages/orm/adapters-redis/tsconfig.esm.json | 5 +- .../orm/adapters-redis/tsconfig.spec.json | 1 - packages/orm/adapters/package.json | 2 +- .../src/adapters/FileSyncAdapter.spec.ts | 3 +- .../adapters/src/adapters/FileSyncAdapter.ts | 1 + .../orm/adapters/src/adapters/LowDbAdapter.ts | 1 + .../src/adapters/MemoryAdapter.spec.ts | 5 +- .../adapters/src/adapters/MemoryAdapter.ts | 1 + .../adapters/src/decorators/indexed.spec.ts | 1 + .../src/decorators/injectAdapter.spec.ts | 1 + .../adapters/src/decorators/injectAdapter.ts | 3 +- packages/orm/adapters/src/domain/Adapter.ts | 5 +- .../adapters/src/domain/AdaptersSettings.ts | 1 + .../orm/adapters/src/services/Adapters.ts | 1 + .../test/discrinimator.integration.spec.ts | 1 + packages/orm/adapters/tsconfig.esm.json | 5 +- packages/orm/adapters/tsconfig.spec.json | 1 - packages/orm/ioredis/package.json | 2 +- .../src/domain/IORedisConfiguration.ts | 3 +- .../ioredis/src/domain/IORedisStore.spec.ts | 5 - .../orm/ioredis/src/domain/IORedisStore.ts | 2 +- .../ioredis/src/domain/IORedisTest.spec.ts | 5 +- .../orm/ioredis/src/domain/IORedisTest.ts | 1 + .../utils/registerConnectionProvider.spec.ts | 3 +- .../src/utils/registerConnectionProvider.ts | 3 +- packages/orm/ioredis/tsconfig.esm.json | 5 +- packages/orm/ioredis/tsconfig.spec.json | 1 - packages/orm/mikro-orm/package.json | 2 +- .../orm/mikro-orm/src/MikroOrmModule.spec.ts | 3 +- packages/orm/mikro-orm/src/MikroOrmModule.ts | 13 +- .../src/decorators/entityManager.spec.ts | 3 +- .../mikro-orm/src/decorators/entityManager.ts | 1 + .../orm/mikro-orm/src/decorators/orm.spec.ts | 3 +- packages/orm/mikro-orm/src/decorators/orm.ts | 3 +- .../src/decorators/subscriber.spec.ts | 5 +- .../mikro-orm/src/decorators/subscriber.ts | 1 + .../src/decorators/transactional.spec.ts | 1 + .../mikro-orm/src/decorators/transactional.ts | 1 + .../filters/OptimisticLockErrorFilter.spec.ts | 5 +- .../src/filters/OptimisticLockErrorFilter.ts | 2 +- .../TransactionalInterceptor.spec.ts | 11 +- .../interceptors/TransactionalInterceptor.ts | 5 +- .../src/services/MikroOrmContext.spec.ts | 1 + .../mikro-orm/src/services/MikroOrmContext.ts | 2 +- .../mikro-orm/src/services/MikroOrmFactory.ts | 1 + .../src/services/MikroOrmRegistry.spec.ts | 5 +- .../src/services/MikroOrmRegistry.ts | 5 +- packages/orm/mikro-orm/test/helpers/Server.ts | 5 +- .../orm/mikro-orm/test/helpers/entity/User.ts | 2 +- .../mikro-orm/test/helpers/services/Hooks.ts | 3 +- .../services/ManagedEventSubscriber.ts | 1 + .../services/UnmanagedEventSubscriber1.ts | 2 +- .../services/UnmanagedEventSubscriber2.ts | 2 +- .../test/helpers/services/UserService.ts | 1 + .../orm/mikro-orm/test/integration.spec.ts | 3 +- packages/orm/mikro-orm/tsconfig.esm.json | 5 +- packages/orm/mikro-orm/tsconfig.spec.json | 1 - packages/orm/mongoose/package.json | 2 +- packages/orm/mongoose/src/MongooseModule.ts | 1 + .../orm/mongoose/src/decorators/auto.spec.ts | 1 + .../src/decorators/dynamicRef.spec.ts | 3 +- .../orm/mongoose/src/decorators/dynamicRef.ts | 3 +- .../src/decorators/excludeIndexes.spec.ts | 1 + .../mongoose/src/decorators/expires.spec.ts | 1 + .../mongoose/src/decorators/immutable.spec.ts | 1 + .../mongoose/src/decorators/indexed.spec.ts | 1 + .../orm/mongoose/src/decorators/indexed.ts | 1 + .../mongoose/src/decorators/lowercase.spec.ts | 1 + packages/orm/mongoose/src/decorators/model.ts | 1 + .../src/decorators/mongooseIndexes.spec.ts | 2 +- .../mongoose/src/decorators/mongoosePlugin.ts | 1 + .../src/decorators/numberDecimal.spec.ts | 5 +- .../mongoose/src/decorators/numberDecimal.ts | 3 +- .../mongoose/src/decorators/objectID.spec.ts | 1 + .../orm/mongoose/src/decorators/objectID.ts | 1 + .../orm/mongoose/src/decorators/postHook.ts | 1 + .../orm/mongoose/src/decorators/preHook.ts | 1 + .../orm/mongoose/src/decorators/ref.spec.ts | 8 +- packages/orm/mongoose/src/decorators/ref.ts | 1 + .../orm/mongoose/src/decorators/schema.ts | 1 + .../src/decorators/schemaIgnore.spec.ts | 1 + .../mongoose/src/decorators/select.spec.ts | 3 +- .../mongoose/src/decorators/sparse.spec.ts | 1 + .../orm/mongoose/src/decorators/text.spec.ts | 1 + .../orm/mongoose/src/decorators/trim.spec.ts | 1 + .../mongoose/src/decorators/unique.spec.ts | 3 +- .../mongoose/src/decorators/uppercase.spec.ts | 1 + .../src/decorators/versionKey.spec.ts | 1 + .../orm/mongoose/src/decorators/versionKey.ts | 1 + .../src/decorators/virtualRef.spec.ts | 1 + .../orm/mongoose/src/decorators/virtualRef.ts | 1 + .../src/interfaces/MongooseSchemaOptions.ts | 1 + .../src/services/MongooseConnection.spec.ts | 1 + .../src/services/MongooseConnections.ts | 3 +- .../src/services/MongooseService.spec.ts | 1 + .../src/utils/buildMongooseSchema.spec.ts | 1 + .../mongoose/src/utils/createModel.spec.ts | 1 + .../orm/mongoose/src/utils/createModel.ts | 1 + .../mongoose/src/utils/createSchema.spec.ts | 3 +- .../orm/mongoose/src/utils/createSchema.ts | 1 + .../mongoose/src/utils/resolveRefType.spec.ts | 9 +- .../orm/mongoose/src/utils/resolveRefType.ts | 1 + .../orm/mongoose/src/utils/schemaOptions.ts | 1 + .../mongoose/test/array.integration.spec.ts | 5 +- .../mongoose/test/buffer.integration.spec.ts | 7 +- .../test/circularRef.integration.spec.ts | 5 +- .../test/discriminators.integration.spec.ts | 5 +- .../test/dynamicRef.integration.spec.ts | 3 +- .../mongoose/test/enums.integration.spec.ts | 3 +- packages/orm/mongoose/test/helpers/Server.ts | 5 +- .../mongoose/test/helpers/models/Avatar.ts | 1 + .../mongoose/test/helpers/models/Client.ts | 1 + .../mongoose/test/helpers/models/Customer.ts | 3 +- .../orm/mongoose/test/helpers/models/User.ts | 5 +- .../test/helpers/models/UserWorkspace.ts | 3 +- .../multipleConnection.integration.spec.ts | 3 +- .../test/readonly.integration.spec.ts | 3 +- .../test/ref-array.integration.spec.ts | 5 +- .../orm/mongoose/test/ref.integration.spec.ts | 5 +- .../test/resources.integration.spec.ts | 13 +- .../test/subdocument.integration.spec.ts | 3 +- .../mongoose/test/user.integration.spec.ts | 5 +- .../test/versioning.integration.spec.ts | 7 +- .../test/virtualRef.integration.spec.ts | 3 +- packages/orm/mongoose/tsconfig.esm.json | 5 +- packages/orm/mongoose/tsconfig.spec.json | 1 - packages/orm/objection/package.json | 2 +- .../components/createBooleanColumn.spec.ts | 1 + .../src/components/createBooleanColumn.ts | 1 + .../src/components/createIdColumn.spec.ts | 2 +- .../src/components/createIdColumn.ts | 7 +- .../src/components/createNumberColumn.spec.ts | 1 + .../src/components/createNumberColumn.ts | 1 + .../src/components/createStringColumn.spec.ts | 1 + .../src/components/createStringColumn.ts | 1 + .../src/decorators/belongsToOne.spec.ts | 1 + .../objection/src/decorators/belongsToOne.ts | 3 +- .../objection/src/decorators/columnOptions.ts | 1 + .../objection/src/decorators/decimal.spec.ts | 1 + .../orm/objection/src/decorators/decimal.ts | 1 + .../orm/objection/src/decorators/entity.ts | 3 +- .../objection/src/decorators/hasMany.spec.ts | 1 + .../orm/objection/src/decorators/hasMany.ts | 2 +- .../objection/src/decorators/hasOne.spec.ts | 1 + .../orm/objection/src/decorators/hasOne.ts | 3 +- .../decorators/hasOneThroughRelation.spec.ts | 1 + .../src/decorators/hasOneThroughRelation.ts | 4 +- .../objection/src/decorators/idColumn.spec.ts | 1 + .../orm/objection/src/decorators/idColumn.ts | 5 +- .../src/decorators/manyToMany.spec.ts | 1 + .../objection/src/decorators/manyToMany.ts | 2 +- .../src/decorators/relatesTo.spec.ts | 1 + .../orm/objection/src/decorators/relatesTo.ts | 8 +- .../src/services/ColumnTypesContainer.ts | 1 + .../src/services/ObjectionConnection.ts | 1 + .../objection/src/utils/createColumns.spec.ts | 1 + .../orm/objection/src/utils/createColumns.ts | 6 +- .../orm/objection/src/utils/createJoinKeys.ts | 4 +- .../src/utils/createRelationshipMapping.ts | 4 +- .../orm/objection/src/utils/getColumnCtx.ts | 1 + packages/orm/objection/test/helpers/Server.ts | 6 +- .../test/helpers/migrations/01_users.ts | 1 + .../orm/objection/test/helpers/models/User.ts | 3 +- .../orm/objection/test/integration.spec.ts | 5 +- packages/orm/objection/tsconfig.esm.json | 5 +- packages/orm/objection/tsconfig.spec.json | 1 - packages/orm/prisma/package.json | 2 +- .../orm/prisma/src/cli/prismaGenerator.ts | 1 + packages/orm/prisma/src/generator.ts | 1 + .../prisma/src/generator/domain/DmmfField.ts | 1 + .../prisma/src/generator/domain/DmmfModel.ts | 1 + .../prisma/src/generator/generateCode.spec.ts | 4 +- .../orm/prisma/src/generator/generateCode.ts | 1 + .../transform/transformEnumsToEnums.spec.ts | 2 +- .../transform/transformEnumsToEnums.ts | 1 + .../transformFieldToDecorators.spec.ts | 2 +- .../transform/transformFieldToDecorators.ts | 1 + .../transform/transformFieldToProperty.ts | 1 + .../transform/transformModelToClass.spec.ts | 4 +- .../transform/transformModelToClass.ts | 1 + .../transform/transformScalarToType.spec.ts | 2 +- .../transform/transformScalarToType.ts | 2 +- .../generator/utils/generateClientIndex.ts | 1 + .../src/generator/utils/generateEnums.spec.ts | 4 +- .../src/generator/utils/generateEnums.ts | 7 +- .../src/generator/utils/generateIndex.ts | 3 +- .../src/generator/utils/generateInterfaces.ts | 3 +- .../generator/utils/generateModels.spec.ts | 2 +- .../src/generator/utils/generateModels.ts | 1 + .../utils/generateOutputsBarrelFile.ts | 1 + .../utils/generatePrismaService.spec.ts | 2 +- .../generator/utils/generatePrismaService.ts | 3 +- .../generator/utils/generateRepositories.ts | 1 + .../utils/generateRespositories.spec.ts | 2 +- .../src/generator/utils/isCircularRef.spec.ts | 2 +- .../src/generator/utils/isCircularRef.ts | 3 +- .../snapshots/generate_code/enums/Role.ts | 1 - .../test/snapshots/generate_code/index.ts | 4 +- .../generate_code/models/PostModel.ts | 3 +- .../generate_code/models/UserModel.ts | 3 +- .../repositories/PostsRepository.ts | 7 +- .../repositories/UsersRepository.ts | 5 +- .../generate_code/services/PrismaService.ts | 3 +- packages/orm/prisma/tsconfig.esm.json | 5 +- packages/orm/prisma/tsconfig.spec.json | 1 - .../orm/testcontainers-mongo/package.json | 2 +- .../src/services/ContainerUtils.ts | 7 +- .../src/services/TestContainersMongo.ts | 1 + .../testcontainers-mongo/tsconfig.esm.json | 5 +- packages/perf/package.json | 2 +- packages/perf/src/domain/Perf.ts | 1 + packages/perf/src/domain/PerfLogger.ts | 1 + packages/perf/src/index.ts | 2 +- packages/perf/tsconfig.esm.json | 5 +- packages/platform/common/package.json | 2 +- .../src/builder/PlatformBuilder.spec.ts | 23 +- .../common/src/builder/PlatformBuilder.ts | 1 + .../services/PlatformConfiguration.spec.ts | 12 +- .../config/services/PlatformConfiguration.ts | 1 + .../common/src/decorators/PlatformProvider.ts | 1 + .../decorators/multer/multerFileSize.spec.ts | 1 + .../decorators/multer/multerOptions.spec.ts | 1 + .../src/decorators/multer/multerOptions.ts | 1 + .../decorators/multer/multipartFile.spec.ts | 4 +- .../src/decorators/multer/multipartFile.ts | 1 + .../src/decorators/params/error.spec.ts | 3 +- .../common/src/decorators/params/next.spec.ts | 1 + .../src/decorators/params/request.spec.ts | 3 +- .../common/src/decorators/params/request.ts | 2 +- .../src/decorators/params/response.spec.ts | 3 +- .../common/src/domain/AnyToPromiseWithCtx.ts | 1 + .../common/src/domain/PlatformContext.spec.ts | 3 +- .../common/src/domain/PlatformContext.ts | 1 + packages/platform/common/src/exports.ts | 12 +- .../PlatformAcceptMimesMiddleware.spec.ts | 13 +- .../PlatformMulterMiddleware.spec.ts | 15 +- .../middlewares/PlatformMulterMiddleware.ts | 1 + .../common/src/services/Platform.spec.ts | 1 + .../platform/common/src/services/Platform.ts | 1 + .../common/src/services/PlatformAdapter.ts | 1 + .../src/services/PlatformApplication.ts | 1 + .../src/services/PlatformHandler.spec.ts | 1 + .../common/src/services/PlatformHandler.ts | 1 + .../services/PlatformMiddlewaresChain.spec.ts | 1 + .../src/services/PlatformMiddlewaresChain.ts | 1 + .../src/services/PlatformRequest.spec.ts | 3 +- .../common/src/services/PlatformRequest.ts | 1 + .../src/services/PlatformResponse.spec.ts | 9 +- .../common/src/services/PlatformResponse.ts | 1 + .../common/src/services/PlatformTest.spec.ts | 1 + .../common/src/services/PlatformTest.ts | 1 + .../src/utils/__mock__/module1/Module1.ts | 3 +- .../__mock__/module1/controllers/M1Ctrl1.ts | 1 + .../__mock__/module1/services/M1Service.ts | 1 + .../__mock__/module1/submodule/SubModule.ts | 1 + .../src/utils/__mock__/module2/Module2.ts | 1 + .../common/src/utils/createContext.spec.ts | 8 +- .../common/src/utils/createContext.ts | 1 + .../common/src/utils/createHttpServer.spec.ts | 5 +- .../common/src/utils/createHttpServer.ts | 1 + .../src/utils/createHttpsServer.spec.ts | 5 +- .../common/src/utils/createHttpsServer.ts | 1 + .../common/src/utils/createInjector.spec.ts | 3 +- .../common/src/utils/createInjector.ts | 1 + .../platform/common/src/utils/createServer.ts | 1 + .../common/src/utils/ensureContext.ts | 1 + .../common/src/utils/getConfiguration.spec.ts | 3 +- .../common/src/utils/getStaticsOptions.ts | 1 + .../platform/common/src/utils/printRoutes.ts | 1 + .../src/utils/registerPlatformAdapter.ts | 1 + .../src/utils/setResponseHeaders.spec.ts | 11 +- .../common/test/integration/groups.spec.ts | 8 +- .../common/test/integration/platform.spec.ts | 4 +- .../returns.spec.integration.spec.ts | 3 +- .../common/test/integration/route.spec.ts | 3 +- packages/platform/common/tsconfig.esm.json | 5 +- packages/platform/common/tsconfig.spec.json | 1 - packages/platform/platform-cache/package.json | 2 +- .../platform-cache/src/decorators/useCache.ts | 1 + .../PlatformCacheInterceptor.spec.ts | 3 +- .../interceptors/PlatformCacheInterceptor.ts | 1 + .../src/interfaces/PlatformCacheOptions.ts | 1 + .../src/interfaces/interfaces.ts | 2 +- .../src/services/PlatformCache.spec.ts | 1 + .../src/services/PlatformCache.ts | 3 +- .../platform-cache/src/utils/getPrefix.ts | 1 + .../test/cache.integration.spec.ts | 1 + .../platform/platform-cache/tsconfig.esm.json | 5 +- .../platform-cache/tsconfig.spec.json | 1 - .../platform/platform-exceptions/package.json | 2 +- .../src/components/ErrorFilter.ts | 1 + .../src/components/ExceptionFilter.ts | 1 + .../src/components/MongooseErrorFilter.ts | 1 + .../src/components/StringErrorFilter.spec.ts | 1 + .../src/components/StringErrorFilter.ts | 1 + .../src/decorators/catch.ts | 1 + .../src/domain/ExceptionFiltersContainer.ts | 1 + .../src/domain/ExceptionSchema.spec.ts | 5 +- .../src/services/PlatformExceptions.spec.ts | 25 +- .../src/services/PlatformExceptions.ts | 1 + .../platform-exceptions/tsconfig.esm.json | 5 +- .../platform-exceptions/tsconfig.spec.json | 1 - .../platform/platform-express/package.json | 2 +- .../src/components/PlatformExpress.spec.ts | 8 +- .../src/components/PlatformExpress.ts | 1 + .../src/interfaces/PlatformExpressSettings.ts | 4 +- .../src/interfaces/interfaces.ts | 1 + .../src/middlewares/staticsMiddleware.spec.ts | 5 +- .../platform-express/test/ajv-errors.spec.ts | 4 +- .../platform-express/test/app/Server.ts | 4 +- .../platform-express/test/app/emulate.ts | 7 +- .../platform-express/test/app/index.ts | 5 +- .../platform-express/test/array-body.spec.ts | 4 +- .../test/discriminator.spec.ts | 10 +- .../platform-express/test/enums.spec.ts | 2 + .../platform-express/test/fullpayload.spec.ts | 6 +- .../platform-express/test/groups.spec.ts | 6 +- .../test/merge-params.spec.ts | 3 +- .../platform-express/test/middleware.spec.ts | 3 +- .../platform-express/test/pageable.spec.ts | 5 +- .../platform-express/test/plain-text.spec.ts | 3 +- .../test/platform-express.spec.ts | 1 + .../test/query-parser.spec.ts | 9 +- .../test/response-filter.spec.ts | 7 +- .../test/validation-error.spec.ts | 3 +- .../platform-express/tsconfig.esm.json | 5 +- .../platform-express/tsconfig.spec.json | 1 - packages/platform/platform-koa/package.json | 2 +- .../src/components/PlatformKoa.spec.ts | 12 +- .../src/components/PlatformKoa.ts | 1 + .../platform-koa/src/decorators/ctx.spec.ts | 3 +- .../platform-koa/src/decorators/state.spec.ts | 3 +- .../platform-koa/src/interfaces/interfaces.ts | 1 + .../src/services/PlatformKoaHandler.ts | 3 +- .../src/services/PlatformKoaRequest.spec.ts | 1 + .../src/services/PlatformKoaRequest.ts | 1 + .../src/services/PlatformKoaResponse.spec.ts | 1 + .../platform/platform-koa/test/app/Server.ts | 1 + .../platform/platform-koa/test/app/index.ts | 3 +- .../platform-koa/test/platform-koa.spec.ts | 3 +- .../platform/platform-koa/tsconfig.esm.json | 5 +- .../platform/platform-koa/tsconfig.spec.json | 1 - .../platform-log-middleware/package.json | 2 +- .../middlewares/PlatformLogMiddleware.spec.ts | 6 +- .../src/middlewares/PlatformLogMiddleware.ts | 1 + .../platform-log-middleware/tsconfig.esm.json | 5 +- .../tsconfig.spec.json | 1 - .../platform-middlewares/package.json | 2 +- .../src/decorators/authOptions.spec.ts | 1 + .../src/decorators/use.spec.ts | 1 + .../src/decorators/useAfter.spec.ts | 3 +- .../src/decorators/useAuth.spec.ts | 1 + .../src/decorators/useAuth.ts | 1 + .../src/decorators/useBefore.spec.ts | 1 + .../src/decorators/useBeforeEach.spec.ts | 1 + .../src/decorators/useBeforeEach.ts | 1 + .../src/utils/getMiddlewaresForHook.ts | 1 + .../src/utils/getMiddlewaresForHooks.spec.ts | 1 + .../platform-middlewares/tsconfig.esm.json | 5 +- .../platform-middlewares/tsconfig.spec.json | 1 - .../platform/platform-params/package.json | 2 +- .../src/builder/PlatformParams.spec.ts | 1 + .../src/builder/PlatformParams.ts | 1 + .../src/decorators/bodyParams.spec.ts | 1 + .../src/decorators/bodyParams.ts | 3 +- .../src/decorators/context.spec.ts | 5 +- .../platform-params/src/decorators/context.ts | 1 + .../src/decorators/cookies.spec.ts | 3 +- .../platform-params/src/decorators/cookies.ts | 1 + .../src/decorators/headerParams.spec.ts | 3 +- .../src/decorators/headerParams.ts | 5 +- .../src/decorators/locals.spec.ts | 3 +- .../src/decorators/pathParams.spec.ts | 1 + .../src/decorators/pathParams.ts | 1 + .../src/decorators/queryParams.spec.ts | 1 + .../src/decorators/queryParams.ts | 1 + .../src/decorators/session.spec.ts | 5 +- .../src/decorators/useParam.spec.ts | 1 + .../src/decorators/useParam.ts | 1 + .../src/decorators/useParamType.ts | 5 +- .../platform-params/src/decorators/usePipe.ts | 1 + .../platform-params/src/decorators/useType.ts | 1 + .../src/errors/ParamValidationError.spec.ts | 1 + .../src/errors/ParamValidationError.ts | 1 + .../src/errors/RequiredValidationError.ts | 3 +- .../src/pipes/DeserializerPipe.spec.ts | 3 +- .../src/pipes/ParseExpressionPipe.spec.ts | 5 +- .../src/pipes/ParseExpressionPipe.ts | 1 + .../src/pipes/ValidationPipe.spec.ts | 1 + .../src/pipes/ValidationPipe.ts | 1 + .../src/utils/mapParamsOptions.ts | 1 + .../test/helpers/buildPlatformParams.ts | 3 +- .../platform-params/tsconfig.esm.json | 5 +- .../platform-params/tsconfig.spec.json | 1 - .../platform-response-filter/package.json | 2 +- .../src/decorators/responseFilter.ts | 1 + .../src/domain/ResponseFiltersContainer.ts | 1 + .../services/PlatformResponseFilter.spec.ts | 5 +- .../src/services/PlatformResponseFilter.ts | 1 + .../src/utils/getContentType.spec.ts | 7 +- .../src/utils/renderView.spec.ts | 5 +- .../src/utils/renderView.ts | 1 + .../tsconfig.esm.json | 5 +- .../tsconfig.spec.json | 1 - .../platform/platform-router/package.json | 2 +- .../domain/PlatformHandlerMetadata.spec.ts | 1 + .../src/domain/PlatformHandlerMetadata.ts | 1 + .../src/domain/PlatformRouter.ts | 1 + .../src/domain/PlatformRouters.ts | 1 + .../src/utils/useContextHandler.ts | 1 + ...lter-endpoint-handlers.integration.spec.ts | 1 + .../routers-injection.integration.spec.ts | 1 + .../routers-middlewares.integration.spec.ts | 1 + .../test/routers-nested.integration.spec.ts | 1 + .../test/routers.integration.spec.ts | 1 + .../platform-router/tsconfig.esm.json | 5 +- .../platform-router/tsconfig.spec.json | 1 - .../platform-serverless-http/package.json | 2 +- .../builder/PlatformServerlessHttp.spec.ts | 3 +- .../test/body.integration.spec.ts | 10 +- .../test/integration/aws-basic/src/Server.ts | 7 +- .../aws-basic/src/TimeslotsController.ts | 2 +- .../test/integration/aws-basic/src/index.ts | 3 +- .../serverlessContext.integration.spec.ts | 6 +- .../tsconfig.esm.json | 5 +- .../tsconfig.spec.json | 1 - .../platform-serverless-testing/package.json | 2 +- .../src/PlatformServerlessTest.ts | 7 +- .../platform-serverless-testing/src/index.ts | 2 +- .../tsconfig.esm.json | 5 +- .../platform/platform-serverless/package.json | 2 +- .../src/builder/PlatformServerless.spec.ts | 5 +- .../src/builder/PlatformServerless.ts | 1 + .../builder/PlatformServerlessHandler.spec.ts | 1 + .../src/builder/PlatformServerlessHandler.ts | 4 +- .../src/domain/ServerlessContext.spec.ts | 1 + .../src/domain/ServerlessContext.ts | 1 + .../src/domain/ServerlessRequest.spec.ts | 1 + .../src/domain/ServerlessRequest.ts | 1 + .../src/domain/ServerlessResponse.spec.ts | 1 + .../src/domain/ServerlessResponse.ts | 1 + .../domain/ServerlessResponseStream.spec.ts | 6 +- .../src/domain/ServerlessResponseStream.ts | 4 +- .../platform-serverless/src/exports.ts | 2 +- .../src/utils/getRequestId.ts | 1 + .../src/utils/setResponseHeaders.spec.ts | 7 +- .../src/utils/setResponseHeaders.ts | 1 + .../test/body.integration.spec.ts | 10 +- .../aws-basic/src/TimeslotsLambda.ts | 3 +- .../test/integration/aws-basic/src/index.ts | 2 +- .../test/params.integration.spec.ts | 5 +- .../test/query.integration.spec.ts | 3 +- .../test/response.integration.spec.ts | 5 +- .../test/response.stream.integration.spec.ts | 8 +- .../test/utils/createServerlessContext.ts | 5 +- .../platform-serverless/tsconfig.esm.json | 5 +- .../platform-serverless/tsconfig.spec.json | 1 - .../platform/platform-test-sdk/package.json | 2 +- .../src/components/PlatformTestSdk.ts | 1 + .../src/modules/feature/FeatureModule.ts | 1 + .../platform-test-sdk/src/tests/exports.ts | 2 +- .../src/tests/testAcceptMime.ts | 1 + .../platform-test-sdk/src/tests/testAuth.ts | 3 +- .../src/tests/testBodyParams.ts | 10 +- .../platform-test-sdk/src/tests/testCache.ts | 3 +- .../src/tests/testChildrenControllers.ts | 3 +- .../src/tests/testCookies.ts | 3 +- .../src/tests/testCustom404.ts | 3 +- .../src/tests/testDeepQueryParams.ts | 4 +- .../platform-test-sdk/src/tests/testErrors.ts | 16 +- .../src/tests/testHandlers.ts | 3 +- .../src/tests/testHeaderParams.ts | 3 +- .../src/tests/testHeaders.ts | 11 +- .../src/tests/testInheritanceController.ts | 5 +- .../platform-test-sdk/src/tests/testLocals.ts | 3 +- .../src/tests/testLocation.ts | 5 +- .../src/tests/testMiddlewares.ts | 4 +- .../platform-test-sdk/src/tests/testModule.ts | 3 +- .../platform-test-sdk/src/tests/testMulter.ts | 3 +- .../src/tests/testPathParams.ts | 3 +- .../src/tests/testQueryParams.ts | 4 +- .../src/tests/testRedirect.ts | 5 +- .../src/tests/testResponse.ts | 11 +- .../src/tests/testResponseFilter.ts | 7 +- .../src/tests/testRouting.ts | 3 +- .../src/tests/testScopeRequest.ts | 3 +- .../src/tests/testSession.ts | 3 +- .../src/tests/testStatics.ts | 3 +- .../platform-test-sdk/src/tests/testStream.ts | 3 +- .../platform-test-sdk/src/tests/testView.ts | 5 +- .../platform-test-sdk/tsconfig.esm.json | 5 +- packages/platform/platform-views/package.json | 2 +- .../src/services/PlatformViews.spec.ts | 7 +- .../src/services/PlatformViews.ts | 1 + .../platform/platform-views/tsconfig.esm.json | 5 +- .../platform-views/tsconfig.spec.json | 1 - packages/security/jwks/package.json | 2 +- packages/security/jwks/src/getJwks.spec.ts | 3 +- packages/security/jwks/src/getJwks.ts | 3 +- packages/security/jwks/src/index.ts | 2 +- packages/security/jwks/tsconfig.esm.json | 5 +- packages/security/jwks/tsconfig.spec.json | 1 - .../package.json | 2 +- .../src/OidcWildcardRedirectUriModule.spec.ts | 5 +- .../src/OidcWildcardRedirectUriModule.ts | 1 + .../src/utils/wildcardRedirectUriAllowed.ts | 6 +- .../tsconfig.esm.json | 5 +- .../tsconfig.spec.json | 1 - packages/security/oidc-provider/package.json | 2 +- .../oidc-provider/src/OidcModule.spec.ts | 15 +- .../security/oidc-provider/src/OidcModule.ts | 1 + .../src/decorators/grantId.spec.ts | 3 +- .../oidc-provider/src/decorators/grantId.ts | 1 + .../src/decorators/interaction.spec.ts | 1 + .../src/decorators/interaction.ts | 1 + .../src/decorators/interactions.spec.ts | 3 +- .../src/decorators/interactions.ts | 1 + .../oidc-provider/src/decorators/noCache.ts | 1 + .../src/decorators/oidcCtx.spec.ts | 3 +- .../oidc-provider/src/decorators/oidcCtx.ts | 1 + .../src/decorators/oidcSession.spec.ts | 3 +- .../src/decorators/oidcSession.ts | 1 + .../src/decorators/params.spec.ts | 3 +- .../oidc-provider/src/decorators/params.ts | 1 + .../src/decorators/prompt.spec.ts | 3 +- .../oidc-provider/src/decorators/prompt.ts | 1 + .../oidc-provider/src/decorators/uid.spec.ts | 3 +- .../oidc-provider/src/decorators/uid.ts | 1 + .../src/domain/OidcAccountsMethods.ts | 3 +- .../src/domain/OidcInteractionPromptProps.ts | 1 + .../oidc-provider/src/domain/OidcSettings.ts | 3 +- .../oidc-provider/src/domain/interfaces.ts | 2 +- .../OidcInteractionMiddleware.spec.ts | 7 +- .../middlewares/OidcInteractionMiddleware.ts | 1 + .../middlewares/OidcNoCacheMiddleware.spec.ts | 5 +- .../middlewares/OidcSecureMiddleware.spec.ts | 7 +- .../src/services/OidcAdapters.spec.ts | 11 +- .../services/OidcInteractionContext.spec.ts | 21 +- .../src/services/OidcInteractionContext.ts | 5 +- .../src/services/OidcInteractions.ts | 1 + .../oidc-provider/src/services/OidcJwks.ts | 2 +- .../src/services/OidcPolicy.spec.ts | 1 + .../oidc-provider/src/services/OidcPolicy.ts | 1 + .../src/services/OidcProvider.spec.ts | 4 +- .../src/services/OidcProvider.ts | 2 +- .../security/oidc-provider/test/app/Server.ts | 8 +- .../app/controllers/oidc/InteractionsCtrl.ts | 3 +- .../test/app/controllers/pages/IndexCtrl.ts | 2 +- .../test/app/controllers/rest/VersionCtrl.ts | 4 +- .../security/oidc-provider/test/app/index.ts | 1 + .../test/app/interactions/AbortInteraction.ts | 3 +- .../app/interactions/ConsentInteraction.ts | 6 +- .../app/interactions/CustomInteraction.ts | 3 +- .../test/app/interactions/LoginInteraction.ts | 3 +- .../test/app/services/Accounts.ts | 1 + .../test/oidc.integration.spec.ts | 4 +- .../security/oidc-provider/tsconfig.esm.json | 5 +- .../security/oidc-provider/tsconfig.spec.json | 1 - packages/security/passport/package.json | 2 +- .../passport/src/PassportModule.spec.ts | 6 +- .../security/passport/src/PassportModule.ts | 3 +- .../passport/src/decorators/args.spec.ts | 3 +- .../src/decorators/authenticate.spec.ts | 3 +- .../passport/src/decorators/authenticate.ts | 3 +- .../passport/src/decorators/authorize.spec.ts | 1 + .../passport/src/decorators/authorize.ts | 3 +- .../passport/src/decorators/protocol.ts | 3 +- .../passport/src/errors/PassportMessage.ts | 5 +- .../src/interfaces/ProtocolMethods.ts | 2 +- .../passport/src/interfaces/interfaces.ts | 1 + .../middlewares/PassportMiddleware.spec.ts | 3 +- .../src/middlewares/PassportMiddleware.ts | 3 +- .../PassportSerializerService.spec.ts | 1 + .../src/services/PassportSerializerService.ts | 1 + .../src/services/ProtocolsService.spec.ts | 1 + .../passport/src/services/ProtocolsService.ts | 1 + packages/security/passport/test/app/Server.ts | 10 +- .../app/controllers/rest/auth/AuthCtrl.ts | 5 +- .../passport/test/app/models/Account.ts | 1 + .../test/app/protocols/LoginLocalProtocol.ts | 3 +- .../test/app/services/UsersRepository.ts | 1 + .../test/passport.integration.spec.ts | 1 + packages/security/passport/tsconfig.esm.json | 5 +- packages/security/passport/tsconfig.spec.json | 1 - packages/specs/ajv/package.json | 2 +- packages/specs/ajv/src/services/Ajv.spec.ts | 2 +- packages/specs/ajv/src/services/Ajv.ts | 2 +- .../specs/ajv/src/services/AjvService.spec.ts | 1 + packages/specs/ajv/src/services/AjvService.ts | 6 +- .../integration/formats.integration.spec.ts | 3 +- .../integration/keywords.integration.spec.ts | 4 +- .../integration/nullable.integration.spec.ts | 1 + .../validation.integration.spec.ts | 1 + packages/specs/ajv/tsconfig.esm.json | 4 +- packages/specs/ajv/tsconfig.spec.json | 1 - packages/specs/exceptions/package.json | 2 +- .../exceptions/src/core/Exception.spec.ts | 4 +- .../specs/exceptions/src/core/Exception.ts | 1 + .../exceptions/test/clientErrors.spec.ts | 9 +- .../exceptions/test/redirections.spec.ts | 5 +- .../exceptions/test/serverErrors.spec.ts | 1 + packages/specs/exceptions/tsconfig.esm.json | 5 +- packages/specs/exceptions/tsconfig.spec.json | 1 - packages/specs/json-mapper/package.json | 2 +- .../json-mapper/src/components/DateMapper.ts | 1 + .../src/components/PrimitiveMapper.spec.ts | 1 + .../src/components/PrimitiveMapper.ts | 1 + .../json-mapper/src/decorators/jsonMapper.ts | 1 + .../src/decorators/onDeserialize.ts | 2 +- .../src/domain/JsonDeserializer.spec.ts | 10 +- .../src/domain/JsonDeserializer.ts | 1 + .../src/domain/JsonDeserializerOptions.ts | 1 + .../src/domain/JsonMapperTypesContainer.ts | 1 + .../src/domain/JsonSerializer.spec.ts | 8 +- .../json-mapper/src/domain/JsonSerializer.ts | 1 + .../src/domain/JsonSerializerOptions.ts | 1 + .../specs/json-mapper/src/domain/Writer.ts | 5 +- .../json-mapper/src/utils/serialize.spec.ts | 4 +- .../specs/json-mapper/test/helpers/Post.ts | 1 + .../specs/json-mapper/test/helpers/User.ts | 1 + .../additional-properties.integration.spec.ts | 1 + .../after.deserialize.integration.spec.ts | 3 +- .../allowed-groups.integration.spec.ts | 5 +- .../before.deserialize.integration.spec.ts | 3 +- .../collection-of-map.integration.spec.ts | 5 +- .../integration/custom.validation.spec.ts | 3 +- .../test/integration/date.integration.spec.ts | 1 + .../discriminator.integration.spec.ts | 7 +- .../enum.serialiazation.integration.spec.ts | 1 + .../integration/generics.integration.spec.ts | 7 +- .../integration/groups.integration.spec.ts | 1 + .../integration/ignore.integration.spec.ts | 1 + .../models.date.intregration.spec.ts | 1 + .../integration/models.integration.spec.ts | 1 + .../integration/moment.integration.spec.ts | 1 + .../nested-list.integration.spec.ts | 1 + .../integration/nullable.integration.spec.ts | 3 +- .../integration/pageable.integration.spec.ts | 1 + .../integration/partial.integration.spec.ts | 1 + .../integration/readonly.integration.spec.ts | 5 +- .../integration/writeonly.integration.spec.ts | 5 +- packages/specs/json-mapper/tsconfig.esm.json | 5 +- packages/specs/json-mapper/tsconfig.spec.json | 1 - packages/specs/openspec/package.json | 2 +- .../specs/openspec/src/openspec2/OpenSpec2.ts | 2 +- .../openspec/src/openspec3/OS3MediaType.ts | 2 +- .../openspec/src/openspec3/OS3RequestBody.ts | 6 +- .../openspec/src/openspec3/OS3Response.ts | 2 +- .../specs/openspec/src/openspec3/OpenSpec3.ts | 2 +- packages/specs/openspec/tsconfig.esm.json | 5 +- packages/specs/schema/package.json | 2 +- .../components/async-api/channelsMapper.ts | 1 + .../src/components/async-api/generate.ts | 1 + .../src/components/async-api/messageMapper.ts | 1 + .../src/components/async-api/payloadMapper.ts | 1 + .../components/async-api/responseMapper.ts | 1 + .../src/components/default/classMapper.ts | 1 + .../src/components/default/genericsMapper.ts | 1 + .../default/inheritedClassMapper.ts | 1 + .../default/inlineEnumsMapper.spec.ts | 2 +- .../src/components/default/mapMapper.ts | 2 +- .../src/components/default/nullableMapper.ts | 1 + .../src/components/default/objectMapper.ts | 1 + .../schema/src/components/default/ofMapper.ts | 2 +- .../components/default/propertiesMapper.ts | 2 +- .../src/components/default/requiredMapper.ts | 1 + .../src/components/default/schemaMapper.ts | 1 + .../src/components/open-spec/generate.ts | 1 + .../components/open-spec/nullableMapper.ts | 1 + .../open-spec/operationInFilesMapper.ts | 1 + .../open-spec/operationInParameterMapper.ts | 1 + .../open-spec/operationInQueryMapper.ts | 1 + .../src/components/open-spec/pathsMapper.ts | 1 + .../src/constants/httpStatusMessages.ts | 2 +- .../schema/src/decorators/class/children.ts | 1 + .../decorators/class/discriminatorValue.ts | 1 + .../collections/collectionOf.spec.ts | 15 +- .../src/decorators/common/allow.spec.ts | 5 + .../schema/src/decorators/common/allow.ts | 3 +- .../specs/schema/src/decorators/common/any.ts | 1 + .../src/decorators/common/anyOf.spec.ts | 2 +- .../schema/src/decorators/common/const.ts | 1 + .../src/decorators/common/defaultMsg.ts | 1 + .../src/decorators/common/description.ts | 3 +- .../src/decorators/common/discriminatorKey.ts | 1 + .../schema/src/decorators/common/enum.ts | 1 + .../src/decorators/common/example.spec.ts | 1 + .../schema/src/decorators/common/examples.ts | 1 + .../common/exclusiveMaximum.spec.ts | 3 +- .../common/exclusiveMinimum.spec.ts | 3 +- .../schema/src/decorators/common/format.ts | 1 + .../decorators/common/forwardGroups.spec.ts | 2 +- .../src/decorators/common/groups.spec.ts | 13 +- .../schema/src/decorators/common/groups.ts | 1 + .../src/decorators/common/hidden.spec.ts | 4 +- .../src/decorators/common/integer.spec.ts | 3 +- .../schema/src/decorators/common/integer.ts | 1 + .../src/decorators/common/jsonEntityFn.ts | 1 + .../src/decorators/common/maximum.spec.ts | 3 +- .../src/decorators/common/minLength.spec.ts | 9 +- .../src/decorators/common/minimum.spec.ts | 3 +- .../schema/src/decorators/common/name.ts | 1 + .../src/decorators/common/nullable.spec.ts | 11 +- .../schema/src/decorators/common/nullable.ts | 1 + .../schema/src/decorators/common/optional.ts | 3 +- .../src/decorators/common/pattern.spec.ts | 3 +- .../schema/src/decorators/common/property.ts | 1 + .../src/decorators/common/required.spec.ts | 10 +- .../schema/src/decorators/common/typeError.ts | 1 + .../decorators/config/jsonEntityComponent.ts | 3 +- .../src/decorators/generics/genericOf.spec.ts | 2 +- .../src/decorators/generics/genericOf.ts | 1 + .../src/decorators/operations/acceptMime.ts | 1 + .../src/decorators/operations/consumes.ts | 1 + .../decorators/operations/deprecated.spec.ts | 5 +- .../src/decorators/operations/deprecated.ts | 5 +- .../src/decorators/operations/header.ts | 1 + .../src/decorators/operations/in.spec.ts | 10 +- .../schema/src/decorators/operations/in.ts | 1 + .../src/decorators/operations/inFile.ts | 5 +- .../decorators/operations/location.spec.ts | 2 +- .../src/decorators/operations/operationId.ts | 1 + .../operations/operationPath.spec.ts | 2 +- .../decorators/operations/operationPath.ts | 3 +- .../src/decorators/operations/partial.spec.ts | 5 +- .../schema/src/decorators/operations/path.ts | 1 + .../src/decorators/operations/produces.ts | 1 + .../src/decorators/operations/publish.spec.ts | 3 +- .../src/decorators/operations/redirect.ts | 1 + .../src/decorators/operations/returns.spec.ts | 86 +- .../src/decorators/operations/returns.ts | 1 + .../src/decorators/operations/route.spec.ts | 4 +- .../decorators/operations/security.spec.ts | 4 +- .../src/decorators/operations/security.ts | 3 +- .../src/decorators/operations/status.spec.ts | 25 +- .../src/decorators/operations/status.ts | 1 + .../decorators/operations/subscribe.spec.ts | 3 +- .../src/decorators/operations/summary.ts | 1 + .../schema/src/decorators/operations/tags.ts | 1 + .../src/decorators/operations/view.spec.ts | 12 - .../schema/src/domain/DecoratorContext.ts | 1 + .../specs/schema/src/domain/JsonClassStore.ts | 5 +- .../schema/src/domain/JsonEntityStore.spec.ts | 4 +- .../schema/src/domain/JsonEntityStore.ts | 1 + .../specs/schema/src/domain/JsonLazyRef.ts | 1 + .../specs/schema/src/domain/JsonMap.spec.ts | 3 +- packages/specs/schema/src/domain/JsonMap.ts | 1 + packages/specs/schema/src/domain/JsonMedia.ts | 1 + .../schema/src/domain/JsonMethodStore.spec.ts | 7 +- .../schema/src/domain/JsonMethodStore.ts | 1 + .../schema/src/domain/JsonOperation.spec.ts | 7 +- .../specs/schema/src/domain/JsonOperation.ts | 1 + .../src/domain/JsonOperationRoute.spec.ts | 1 + .../schema/src/domain/JsonOperationRoute.ts | 3 +- .../specs/schema/src/domain/JsonParameter.ts | 1 + .../src/domain/JsonParameterStore.spec.ts | 9 +- .../schema/src/domain/JsonParameterStore.ts | 3 +- .../src/domain/JsonPropertyStore.spec.ts | 1 + .../schema/src/domain/JsonPropertyStore.ts | 5 +- .../schema/src/domain/JsonRequestBody.ts | 1 + .../schema/src/domain/JsonResponse.spec.ts | 2 +- .../specs/schema/src/domain/JsonResponse.ts | 1 + .../schema/src/domain/JsonSchema.spec.ts | 53 +- .../specs/schema/src/domain/JsonSchema.ts | 1 + packages/specs/schema/src/hooks/alterOneOf.ts | 1 + packages/specs/schema/src/utils/from.spec.ts | 3 +- packages/specs/schema/src/utils/from.ts | 1 + .../schema/src/utils/generateSpec.spec.ts | 15 +- .../specs/schema/src/utils/generateSpec.ts | 1 + packages/specs/schema/src/utils/generics.ts | 1 + .../src/utils/getInheritedStores.spec.ts | 1 + .../schema/src/utils/getInheritedStores.ts | 1 + .../schema/src/utils/getJsonEntityStore.ts | 7 +- .../schema/src/utils/getJsonSchema.spec.ts | 1 + .../specs/schema/src/utils/getJsonSchema.ts | 4 +- .../src/utils/getOperationsRoutes.spec.ts | 1 + .../schema/src/utils/getOperationsRoutes.ts | 1 + .../src/utils/getOperationsStore.spec.ts | 1 + .../schema/src/utils/getOperationsStores.ts | 3 +- .../src/utils/getPropertiesStores.spec.ts | 2 +- .../schema/src/utils/getPropertiesStores.ts | 1 + .../specs/schema/src/utils/getSpec.spec.ts | 4 +- packages/specs/schema/src/utils/getSpec.ts | 1 + .../specs/schema/src/utils/getSpecType.ts | 1 + .../schema/src/utils/isSuccessStatus.spec.ts | 2 +- packages/specs/schema/src/utils/mapHeaders.ts | 1 + .../specs/schema/src/utils/mapOpenSpec.ts | 3 +- .../specs/schema/src/utils/mapOpenSpec2.ts | 1 + .../specs/schema/src/utils/mapOpenSpec3.ts | 1 + .../specs/schema/src/utils/mergeSpec.spec.ts | 1 + packages/specs/schema/src/utils/mergeSpec.ts | 14 +- .../schema/src/utils/operationIdFormatter.ts | 1 + packages/specs/schema/src/utils/ref.ts | 1 + .../schema/src/utils/transformToOS2.spec.ts | 28 +- .../specs/schema/src/utils/transformToOS2.ts | 2 +- .../specs/schema/src/utils/withErrorMsg.ts | 1 + .../schema/test/helpers/validateModel.ts | 10 +- .../specs/schema/test/helpers/validateSpec.ts | 3 +- .../allowed-groups.integration.spec.ts | 3 +- .../body-params-any.integration.spec.ts | 1 + .../integrations/body.integration.spec.ts | 3 +- .../deep-object-query-params.spec.ts | 3 +- .../discriminator.integration.spec.ts | 17 +- .../dynamicurl.integration.spec.ts | 2 +- .../integrations/generics.integration.spec.ts | 6 +- .../inheritance.integration.spec.ts | 3 +- .../integrations/lazyref.integration.spec.ts | 1 + .../multipart.integration.spec.ts | 1 + .../integrations/pageable.integration.spec.ts | 6 +- .../integrations/partial.integration.spec.ts | 3 +- .../integrations/petstore.integration.spec.ts | 12 +- .../integrations/query-model-examples.spec.ts | 3 +- .../response.binary.integration.spec.ts | 3 +- .../integrations/response.integration.spec.ts | 3 +- .../union-types.integration.spec.ts | 4 + packages/specs/schema/tsconfig.esm.json | 5 +- packages/specs/schema/tsconfig.spec.json | 1 - packages/specs/swagger/package.json | 2 +- .../specs/swagger/src/SwaggerModule.spec.ts | 3 +- packages/specs/swagger/src/SwaggerModule.ts | 1 + .../src/middlewares/cssMiddleware.spec.ts | 1 + .../src/middlewares/indexMiddleware.spec.ts | 1 + .../src/middlewares/indexMiddleware.ts | 1 + .../src/middlewares/jsMiddleware.spec.ts | 1 + .../middlewares/redirectMiddleware.spec.ts | 1 + .../src/services/SwaggerService.spec.ts | 1 + .../swagger/src/services/SwaggerService.ts | 1 + .../swagger/src/utils/includeRoute.spec.ts | 1 + .../specs/swagger/src/utils/includeRoute.ts | 1 + packages/specs/swagger/test/app/Server.ts | 5 +- .../specs/swagger/test/app/class/classes.ts | 2 +- packages/specs/swagger/test/app/index.ts | 9 +- .../specs/swagger/test/swagger.anyof.spec.ts | 1 + .../swagger/test/swagger.bodyparams.spec.ts | 1 + .../swagger/test/swagger.children.spec.ts | 1 + .../specs/swagger/test/swagger.errors.spec.ts | 1 + .../swagger/test/swagger.integration.spec.ts | 7 +- .../test/swagger.nested-controllers.spec.ts | 1 + .../swagger/test/swagger.operationId.spec.ts | 7 +- .../test/swagger.path-patterns.spec.ts | 5 +- .../specs/swagger/test/swagger.query.spec.ts | 1 + packages/specs/swagger/tsconfig.esm.json | 5 +- packages/specs/swagger/tsconfig.spec.json | 1 - packages/third-parties/agenda/package.json | 2 +- .../agenda/src/AgendaModule.spec.ts | 1 + .../third-parties/agenda/src/AgendaModule.ts | 1 + .../agenda/src/decorators/agenda.spec.ts | 1 + .../agenda/src/decorators/agenda.ts | 1 + .../agenda/src/decorators/define.spec.ts | 1 + .../agenda/src/decorators/define.ts | 1 + .../agenda/src/decorators/every.spec.ts | 1 + .../agenda/src/decorators/every.ts | 3 +- ...agenda-define-manually.integration.spec.ts | 4 +- .../test/agenda-define.integration.spec.ts | 1 + .../test/agenda-every.integration.spec.ts | 1 + .../agenda/test/helpers/Server.ts | 7 +- .../third-parties/agenda/tsconfig.esm.json | 5 +- .../third-parties/agenda/tsconfig.spec.json | 1 - packages/third-parties/bullmq/package.json | 2 +- .../bullmq/src/BullMQModule.spec.ts | 3 +- .../third-parties/bullmq/src/BullMQModule.ts | 1 + .../bullmq/src/decorators/InjectQueue.ts | 1 + .../bullmq/src/decorators/InjectWorker.ts | 1 + .../src/decorators/JobController.spec.ts | 5 +- .../bullmq/src/decorators/JobController.ts | 1 + .../src/dispatchers/JobDispatcher.spec.ts | 7 +- .../bullmq/src/dispatchers/JobDispatcher.ts | 2 +- .../bullmq/src/utils/createQueueProvider.ts | 1 + .../bullmq/src/utils/createWorkerProvider.ts | 1 + .../bullmq/src/utils/mapQueueOptions.ts | 1 + .../bullmq/src/utils/mapWorkerOptions.ts | 1 + .../third-parties/bullmq/tsconfig.esm.json | 5 +- .../third-parties/bullmq/tsconfig.spec.json | 1 - .../components-scan/package.json | 2 +- .../src/__mock__/module1/Module1.ts | 3 +- .../__mock__/module1/controllers/M1Ctrl1.ts | 1 + .../__mock__/module1/services/M1Service.ts | 1 + .../__mock__/module1/submodule/SubModule.ts | 1 + .../src/__mock__/module2/Module2.ts | 1 + .../src/cleanGlobPatterns.spec.ts | 2 +- .../components-scan/src/cleanGlobPatterns.ts | 5 +- .../components-scan/src/importFiles.spec.ts | 1 + .../components-scan/src/importFiles.ts | 1 + .../src/importProviders.spec.ts | 1 + .../components-scan/src/importProviders.ts | 3 +- .../components-scan/tsconfig.esm.json | 5 +- .../components-scan/tsconfig.spec.json | 1 - .../third-parties/event-emitter/package.json | 2 +- .../event-emitter/src/EventEmitterModule.ts | 1 + .../src/decorators/onAny.spec.ts | 1 + .../event-emitter/src/decorators/onAny.ts | 1 + .../src/decorators/onEvent.spec.ts | 1 + .../event-emitter/src/decorators/onEvent.ts | 1 + .../event-emitter/test/helpers/Server.ts | 6 +- .../event-emitter/test/integration.spec.ts | 1 + .../event-emitter/tsconfig.esm.json | 5 +- .../event-emitter/tsconfig.spec.json | 1 - .../third-parties/formio-types/package.json | 2 +- .../src/domain/FormioComponent.ts | 3 +- .../formio-types/tsconfig.esm.json | 5 +- packages/third-parties/formio/package.json | 2 +- .../formio/src/FormioModule.spec.ts | 3 +- .../third-parties/formio/src/FormioModule.ts | 1 + .../formio/src/builder/FormioMapper.spec.ts | 1 + .../src/components/AlterActions.spec.ts | 1 + .../formio/src/components/AlterActions.ts | 1 + .../formio/src/components/AlterAudit.spec.ts | 1 + .../formio/src/components/AlterAudit.ts | 1 + .../formio/src/components/AlterHost.spec.ts | 1 + .../formio/src/components/AlterHost.ts | 1 + .../formio/src/components/AlterLog.spec.ts | 1 + .../formio/src/components/AlterLog.ts | 1 + .../formio/src/components/AlterSkip.spec.ts | 1 + .../formio/src/components/AlterSkip.ts | 1 + .../AlterTemplateExportSteps.spec.ts | 1 + .../components/AlterTemplateExportSteps.ts | 3 +- .../AlterTemplateImportSteps.spec.ts | 1 + .../components/AlterTemplateImportSteps.ts | 3 +- .../formio/src/decorators/action.ts | 15 +- .../formio/src/decorators/actionCtx.spec.ts | 3 +- .../formio/src/decorators/actionCtx.ts | 3 +- .../formio/src/decorators/alter.spec.ts | 1 + .../formio/src/decorators/alter.ts | 15 +- .../formio/src/decorators/on.spec.ts | 1 + .../third-parties/formio/src/decorators/on.ts | 15 +- .../src/decorators/useFormioAuth.spec.ts | 1 + .../formio/src/decorators/useFormioAuth.ts | 1 + .../third-parties/formio/src/domain/Formio.ts | 1 + .../formio/src/domain/FormioAction.ts | 3 +- .../formio/src/domain/FormioActionsIndex.ts | 1 + .../formio/src/domain/FormioAuth.ts | 1 + .../formio/src/domain/FormioBaseModel.ts | 2 +- .../formio/src/domain/FormioCtxMapper.ts | 2 +- .../formio/src/domain/FormioHooks.ts | 1 + .../formio/src/domain/FormioModels.ts | 3 +- .../formio/src/domain/FormioRouter.ts | 1 + .../formio/src/domain/FormioUpdate.ts | 1 + .../formio/src/domain/FormioUtils.ts | 5 +- .../formio/src/domain/Resource.ts | 2 +- .../middlewares/FormioAuthMiddleware.spec.ts | 1 + .../src/middlewares/FormioAuthMiddleware.ts | 1 + .../src/services/FormioAuthService.spec.ts | 1 + .../formio/src/services/FormioAuthService.ts | 1 + .../src/services/FormioDatabase.spec.ts | 1 + .../formio/src/services/FormioDatabase.ts | 5 +- .../src/services/FormioHooksService.spec.ts | 1 + .../formio/src/services/FormioHooksService.ts | 3 +- .../src/services/FormioInstaller.spec.ts | 21 +- .../formio/src/services/FormioInstaller.ts | 1 + .../src/services/FormioRepository.spec.ts | 1 + .../formio/src/services/FormioRepository.ts | 3 +- .../formio/src/services/FormioService.spec.ts | 6 +- .../formio/src/services/FormioService.ts | 13 +- .../third-parties/formio/test/app/Server.ts | 10 +- .../test/app/controllers/pages/IndexCtrl.ts | 2 +- .../test/app/controllers/rest/VersionCtrl.ts | 4 +- .../third-parties/formio/test/app/index.ts | 1 + .../third-parties/formio/tsconfig.esm.json | 5 +- .../third-parties/formio/tsconfig.spec.json | 1 - packages/third-parties/pulse/package.json | 2 +- .../pulse/src/PulseModule.spec.ts | 7 +- .../third-parties/pulse/src/PulseModule.ts | 3 +- .../pulse/src/decorators/define.spec.ts | 7 +- .../pulse/src/decorators/define.ts | 3 +- .../pulse/src/decorators/every.spec.ts | 3 +- .../pulse/src/decorators/every.ts | 3 +- .../pulse/src/decorators/pulse.spec.ts | 3 +- .../pulse/src/decorators/pulse.ts | 1 + .../pulse/src/services/PulseFactory.ts | 2 +- .../pulse/test/helpers/Server.ts | 7 +- .../pulse-define-manually.integration.spec.ts | 4 +- .../test/pulse-define.integration.spec.ts | 3 +- .../test/pulse-every.integration.spec.ts | 3 +- .../third-parties/pulse/tsconfig.esm.json | 5 +- .../third-parties/pulse/tsconfig.spec.json | 1 - .../third-parties/schema-formio/package.json | 2 +- .../src/components/arrayToComponent.ts | 1 + .../src/components/booleanToComponent.ts | 1 + .../src/components/dateToComponent.ts | 1 + .../src/components/defaultToComponent.ts | 1 + .../src/components/enumToComponent.ts | 1 + .../src/components/nestedToComponent.ts | 1 + .../src/components/numberToComponent.ts | 1 + .../src/components/propertiesToComponents.ts | 1 + .../src/components/stringToComponent.ts | 1 + .../src/decorators/customConditional.ts | 7 +- .../src/decorators/dataSourceJson.ts | 5 +- .../src/decorators/dataSourceUrl.ts | 2 +- .../schema-formio/src/decorators/form.ts | 1 + .../schema-formio/src/decorators/inputTags.ts | 1 + .../schema-formio/src/decorators/label.ts | 1 + .../src/decorators/select.spec.ts | 1 + .../src/utils/getFormioSchema.spec.ts | 1 + .../src/utils/getFormioSchema.ts | 14 +- .../test/array.integration.spec.ts | 1 + .../test/basic.integration.spec.ts | 1 + .../test/datamap.integration.spec.ts | 1 + .../test/date.integration.spec.ts | 1 + .../test/deep-nested-form.integration.spec.ts | 1 + .../test/editgrid.integration.spec.ts | 3 +- .../test/email.integration.spec.ts | 1 + .../test/enums.integration.spec.ts | 1 + .../test/nested-form.integration.spec.ts | 1 + .../test/number.integration.spec.ts | 1 + .../test/object.integration.spec.ts | 1 + .../test/required.integration.spec.ts | 1 + .../test/string.integration.spec.ts | 1 + .../test/tabs.integration.spec.ts | 3 +- .../schema-formio/tsconfig.esm.json | 5 +- .../schema-formio/tsconfig.spec.json | 1 - .../socketio-testing/package.json | 2 +- .../socketio-testing/tsconfig.esm.json | 5 +- packages/third-parties/socketio/package.json | 2 +- .../socketio/src/SocketIOModule.spec.ts | 13 +- .../socketio/src/SocketIOModule.ts | 7 +- .../src/class/SocketHandlersBuilder.spec.ts | 51 +- .../src/class/SocketHandlersBuilder.ts | 3 +- .../socketio/src/class/SocketSessionData.ts | 8 +- .../socketio/src/decorators/args.spec.ts | 1 + .../socketio/src/decorators/args.ts | 1 + .../socketio/src/decorators/broadcast.spec.ts | 1 + .../src/decorators/broadcastOthers.spec.ts | 1 + .../socketio/src/decorators/emit.spec.ts | 1 + .../socketio/src/decorators/input.spec.ts | 1 + .../src/decorators/inputAndBroadcast.spec.ts | 1 + .../inputAndBroadcastOthers.spec.ts | 1 + .../src/decorators/inputAndEmit.spec.ts | 1 + .../socketio/src/decorators/io.ts | 3 +- .../socketio/src/decorators/nsp.spec.ts | 1 + .../socketio/src/decorators/nsp.ts | 3 +- .../socketio/src/decorators/reason.spec.ts | 1 + .../socketio/src/decorators/reason.ts | 2 +- .../socketio/src/decorators/socket.spec.ts | 1 + .../socketio/src/decorators/socket.ts | 1 + .../socketio/src/decorators/socketErr.spec.ts | 1 + .../src/decorators/socketEventName.spec.ts | 1 + .../socketio/src/decorators/socketFilter.ts | 1 + .../src/decorators/socketMiddleware.spec.ts | 1 + .../src/decorators/socketMiddleware.ts | 3 +- .../decorators/socketMiddlewareError.spec.ts | 1 + .../src/decorators/socketMiddlewareError.ts | 3 +- .../socketio/src/decorators/socketNsp.spec.ts | 1 + .../socketio/src/decorators/socketNsp.ts | 2 +- .../socketio/src/decorators/socketReturns.ts | 1 + .../src/decorators/socketService.spec.ts | 1 + .../socketio/src/decorators/socketService.ts | 3 +- .../src/decorators/socketSession.spec.ts | 1 + .../src/decorators/socketUseAfter.spec.ts | 1 + .../src/decorators/socketUseBefore.spec.ts | 1 + .../src/interfaces/SocketParamMetadata.ts | 1 + .../src/services/SocketIOServer.spec.ts | 3 +- .../src/services/SocketIOService.spec.ts | 11 +- .../socketio/src/services/SocketIOService.ts | 1 + .../third-parties/socketio/test/app/Server.ts | 6 +- .../app/controllers/pages/SocketPageCtrl.ts | 4 +- .../third-parties/socketio/test/app/index.ts | 1 + .../app/middlewares/AuthSocketMiddleware.ts | 2 +- .../ConverterUserSocketMiddleware.ts | 5 +- .../ErrorHandlerSocketMiddleware.ts | 2 +- .../app/middlewares/InitSessionMiddleware.ts | 1 + .../middlewares/ThrowErrorSocketMiddleware.ts | 4 +- .../socketio/test/app/models/User.ts | 2 +- .../socketio/test/app/services/RoomWS.ts | 3 +- .../socketio/test/socket.integration.spec.ts | 3 +- .../socketio/test/socketio.spec.ts | 3 +- .../third-parties/socketio/tsconfig.esm.json | 5 +- .../third-parties/socketio/tsconfig.spec.json | 1 - packages/third-parties/sse/package.json | 2 +- .../sse/src/decorators/eventStream.ts | 3 +- .../sse/src/decorators/eventStreamCtx.ts | 1 + .../sse/src/domain/EventStreamContext.ts | 1 + .../interceptors/EventStreamInterceptor.ts | 3 +- .../src/middlewares/EventStreamMiddleware.ts | 1 + .../sse/src/sse.integration.spec.ts | 9 +- packages/third-parties/sse/tsconfig.esm.json | 5 +- packages/third-parties/sse/tsconfig.spec.json | 1 - packages/third-parties/stripe/package.json | 2 +- .../stripe/src/decorators/webhookEvent.ts | 3 +- .../WebhookEventMiddleware.spec.ts | 4 +- .../src/middlewares/WebhookEventMiddleware.ts | 8 +- .../stripe/src/services/StripeFactory.spec.ts | 3 +- .../stripe/src/services/StripeFactory.ts | 1 + .../third-parties/stripe/test/app/Server.ts | 7 +- .../test/app/controllers/pages/IndexCtrl.ts | 2 +- .../controllers/rest/StripeWebhooksCtrl.ts | 3 +- .../test/app/controllers/rest/VersionCtrl.ts | 4 +- .../third-parties/stripe/test/app/index.ts | 1 + .../stripe/test/stripe.integration.spec.ts | 1 + .../third-parties/stripe/tsconfig.esm.json | 5 +- .../third-parties/stripe/tsconfig.spec.json | 1 - packages/third-parties/temporal/package.json | 2 +- .../temporal/src/TemporalModule.ts | 5 +- .../temporal/src/decorators/activity.spec.ts | 1 + .../temporal/src/decorators/activity.ts | 3 +- .../temporal/src/decorators/temporal.spec.ts | 1 + .../temporal/src/decorators/temporal.ts | 1 + .../temporal/src/interfaces/interfaces.ts | 1 - .../temporal/src/services/TemporalFactory.ts | 2 +- .../temporal/src/utils/worker.ts | 2 +- .../temporal/test/client.integration.spec.ts | 1 + .../temporal/test/helpers/Server.ts | 7 +- .../temporal/test/worker.integration.spec.ts | 4 +- .../third-parties/temporal/tsconfig.esm.json | 5 +- .../third-parties/temporal/tsconfig.spec.json | 1 - packages/third-parties/terminus/package.json | 2 +- .../terminus/src/TerminusModule.spec.ts | 1 + .../terminus/src/TerminusModule.ts | 1 + .../third-parties/terminus/test/app/Server.ts | 7 +- .../third-parties/terminus/test/app/index.ts | 1 + .../terminus/test/app/services/MongoClient.ts | 3 +- .../terminus/test/app/services/RedisClient.ts | 3 +- .../third-parties/terminus/tsconfig.esm.json | 5 +- .../third-parties/terminus/tsconfig.spec.json | 1 - packages/third-parties/vike/package.json | 2 +- .../vike/src/interfaces/ViteConfig.ts | 1 - .../ViteRendererMiddleware.spec.ts | 1 + .../vike/src/services/ViteServer.spec.ts | 1 + .../vike/src/services/ViteServer.ts | 2 +- .../vike/src/services/ViteService.spec.ts | 1 + .../vike/src/services/ViteService.ts | 1 + packages/third-parties/vike/tsconfig.esm.json | 5 +- .../third-parties/vike/tsconfig.spec.json | 1 - packages/utils/normalize-path/package.json | 2 +- .../utils/normalize-path/tsconfig.esm.json | 5 +- .../utils/normalize-path/tsconfig.spec.json | 1 - tools/github-sponsors/src/index.js | 2 - tools/github-sponsors/src/utils/print.js | 3 - tools/integration/package.json | 2 +- tools/integration/src/Server.ts | 16 +- tools/integration/src/config/logger/index.ts | 1 + .../src/controllers/pages/IndexController.ts | 4 +- tools/integration/src/index.ts | 1 + tools/integration/tsconfig.esm.json | 5 +- tools/typescript/index.js | 9 +- tools/typescript/tsconfig.node.json | 7 +- tools/typescript/tsconfig.template.esm.json | 5 +- tools/typescript/tsconfig.template.spec.json | 1 - tools/vitest/index.js | 3 +- tools/vitest/presets/alias.js | 3 +- tools/vitest/presets/index.js | 1 + tsdoc.config.js => tsdoc.config.cjs | 0 yarn.lock | 2978 ++++++++++------- 1541 files changed, 4801 insertions(+), 3002 deletions(-) delete mode 100644 .eslintignore delete mode 100644 .eslintrc.js create mode 100644 eslint.config.mjs delete mode 100644 lint-staged.config.js rename tsdoc.config.js => tsdoc.config.cjs (100%) diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index 1bfcab790dd..00000000000 --- a/.eslintignore +++ /dev/null @@ -1,14 +0,0 @@ -node_modules -docs -docs-references -**/lib -**/dist -**/coverage -**/.nyc_output -**/node_modules -*-lock.json -*.lock -benchmarks.* -**/generated - -*/**/*.js diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index 18cb6a55ef1..00000000000 --- a/.eslintrc.js +++ /dev/null @@ -1,37 +0,0 @@ -module.exports = { - extends: ["prettier", "plugin:@typescript-eslint/recommended"], - plugins: ["@typescript-eslint", "workspaces"], - env: { - node: true, - es6: true - }, - rules: { - "@typescript-eslint/no-empty-function": "off", - "@typescript-eslint/ban-ts-comment": "off", - "@typescript-eslint/ban-types": "off", - "@typescript-eslint/no-inferrable-types": "off", - "@typescript-eslint/no-empty-interface": "off", - "@typescript-eslint/no-namespace": "off", - "@typescript-eslint/no-var-requires": "off", - "@typescript-eslint/no-this-alias": "off", - "@typescript-eslint/no-explicit-any": "off", - "@typescript-eslint/explicit-module-boundary-types": "off", - "@typescript-eslint/no-unused-vars": "off", - "@typescript-eslint/no-non-null-assertion": "off", - "require-await": "error", - "no-return-await": "error", - "no-case-declarations": "off", - "no-empty": "off", - "prefer-const": "off", - "no-fallthrough": "off", - "workspaces/no-absolute-imports": "error" - }, - overrides: [ - { - files: ["**/*.benchmark.ts", "**/test/**", "**/__mock__/**"], - rules: { - "workspaces/no-absolute-imports": "off" - } - } - ] -}; diff --git a/benchmarks/bin/benchmark-bench.js b/benchmarks/bin/benchmark-bench.js index a5b7c5cda5d..5aad3618406 100644 --- a/benchmarks/bin/benchmark-bench.js +++ b/benchmarks/bin/benchmark-bench.js @@ -1,8 +1,9 @@ "use strict"; +import {Command} from "commander"; import inquirer from "inquirer"; + import bench from "../src/bench.js"; import {choices, list} from "../src/packages.js"; -import {Command} from "commander"; const program = new Command(); diff --git a/benchmarks/bin/benchmark-compare.js b/benchmarks/bin/benchmark-compare.js index a35b05cf167..853ac55f450 100644 --- a/benchmarks/bin/benchmark-compare.js +++ b/benchmarks/bin/benchmark-compare.js @@ -1,13 +1,14 @@ #!/usr/bin/env node -import os from "os"; +import chalk from "chalk"; +import Table from "cli-table"; import {Command} from "commander"; +import {readdirSync, readFileSync, writeFileSync} from "fs"; import inquirer from "inquirer"; -import Table from "cli-table"; -import chalk from "chalk"; +import os from "os"; import {join} from "path"; -import {readdirSync, readFileSync, writeFileSync} from "fs"; -import {info} from "../src/packages.js"; + import {compare} from "../src/autocannon.js"; +import {info} from "../src/packages.js"; const commander = new Command(); diff --git a/benchmarks/frameworks/express-injector-async-hook.js b/benchmarks/frameworks/express-injector-async-hook.js index 0a7ff7ff6f2..ea0da803462 100644 --- a/benchmarks/frameworks/express-injector-async-hook.js +++ b/benchmarks/frameworks/express-injector-async-hook.js @@ -1,6 +1,6 @@ -import express from "express"; -import {InjectorService} from "@tsed/di"; import {PlatformContext, PlatformRequest, PlatformResponse} from "@tsed/common"; +import {InjectorService} from "@tsed/di"; +import express from "express"; import {v4} from "uuid"; const app = express(); diff --git a/benchmarks/frameworks/express-injector-http-hook.js b/benchmarks/frameworks/express-injector-http-hook.js index 7f26c1d6ddc..c595b82cbe2 100644 --- a/benchmarks/frameworks/express-injector-http-hook.js +++ b/benchmarks/frameworks/express-injector-http-hook.js @@ -1,8 +1,8 @@ -import express from "express"; -import {InjectorService, runInContext, setContext} from "@tsed/di"; import {PlatformContext, PlatformRequest, PlatformResponse} from "@tsed/common"; -import {v4} from "uuid"; +import {InjectorService, runInContext, setContext} from "@tsed/di"; +import express from "express"; import http from "http"; +import {v4} from "uuid"; const injector = new InjectorService(); const app = express(); diff --git a/benchmarks/frameworks/express-injector-without-events.js b/benchmarks/frameworks/express-injector-without-events.js index b59b58c57fe..5478d9bf8ef 100644 --- a/benchmarks/frameworks/express-injector-without-events.js +++ b/benchmarks/frameworks/express-injector-without-events.js @@ -1,8 +1,8 @@ -import express from "express"; -import {InjectorService, runInContext, setContext} from "@tsed/di"; import {PlatformContext, PlatformRequest, PlatformResponse} from "@tsed/common"; -import {v4} from "uuid"; +import {InjectorService, runInContext, setContext} from "@tsed/di"; +import express from "express"; import http from "http"; +import {v4} from "uuid"; const injector = new InjectorService(); const app = express(); diff --git a/benchmarks/frameworks/express-injector.js b/benchmarks/frameworks/express-injector.js index 1dccdb5681c..ab948821674 100644 --- a/benchmarks/frameworks/express-injector.js +++ b/benchmarks/frameworks/express-injector.js @@ -1,6 +1,6 @@ -import express from "express"; -import {InjectorService} from "@tsed/di"; import {PlatformContext, PlatformRequest, PlatformResponse} from "@tsed/common"; +import {InjectorService} from "@tsed/di"; +import express from "express"; import {v4} from "uuid"; const app = express(); diff --git a/benchmarks/frameworks/fastify-injector.js b/benchmarks/frameworks/fastify-injector.js index 84c3228c717..be050ef1a32 100644 --- a/benchmarks/frameworks/fastify-injector.js +++ b/benchmarks/frameworks/fastify-injector.js @@ -1,6 +1,6 @@ -import Fastify from "fastify"; -import {InjectorService, runInContext, getContext} from "@tsed/di"; import {PlatformContext} from "@tsed/common"; +import {getContext, InjectorService, runInContext} from "@tsed/di"; +import Fastify from "fastify"; import {v4} from "uuid"; const fastify = Fastify(); diff --git a/benchmarks/frameworks/hapi.js b/benchmarks/frameworks/hapi.js index 19281b5e8ca..63fdf01890c 100755 --- a/benchmarks/frameworks/hapi.js +++ b/benchmarks/frameworks/hapi.js @@ -1,4 +1,5 @@ import "make-promises-safe"; + import Hapi from "@hapi/hapi"; async function start() { diff --git a/benchmarks/frameworks/koa-isomorphic-router.js b/benchmarks/frameworks/koa-isomorphic-router.js index 6aa9db09561..7756ae80924 100644 --- a/benchmarks/frameworks/koa-isomorphic-router.js +++ b/benchmarks/frameworks/koa-isomorphic-router.js @@ -1,5 +1,5 @@ -import Koa from "koa"; import Router from "benchmarks/frameworks/koa-isomorphic-router.js"; +import Koa from "koa"; const app = new Koa(); const router = new Router(); diff --git a/benchmarks/frameworks/koa-router.js b/benchmarks/frameworks/koa-router.js index 67228559670..fbd9f3b1e6e 100644 --- a/benchmarks/frameworks/koa-router.js +++ b/benchmarks/frameworks/koa-router.js @@ -1,5 +1,5 @@ -import Koa from "koa"; import KoaRouter from "benchmarks/frameworks/koa-router.js"; +import Koa from "koa"; const router = KoaRouter(); diff --git a/benchmarks/frameworks/nest-fastify.js b/benchmarks/frameworks/nest-fastify.js index 7a4af148cc7..04ba896464c 100644 --- a/benchmarks/frameworks/nest-fastify.js +++ b/benchmarks/frameworks/nest-fastify.js @@ -1,5 +1,6 @@ import core from "@nestjs/core"; import fastifyPlatform from "@nestjs/platform-fastify"; + import {AppModule} from "./nest/app/app.module.js"; core.NestFactory.create(AppModule, new fastifyPlatform.FastifyAdapter(), { diff --git a/benchmarks/frameworks/nest/app/app.controller.js b/benchmarks/frameworks/nest/app/app.controller.js index 3b2a2dbeca5..9b0bae29de1 100644 --- a/benchmarks/frameworks/nest/app/app.controller.js +++ b/benchmarks/frameworks/nest/app/app.controller.js @@ -1,5 +1,5 @@ -import {__decorate, __metadata} from "tslib"; import common from "@nestjs/common"; +import {__decorate, __metadata} from "tslib"; class AppController { root() { diff --git a/benchmarks/frameworks/nest/app/app.module.js b/benchmarks/frameworks/nest/app/app.module.js index 1b9958187cd..64bed42a778 100644 --- a/benchmarks/frameworks/nest/app/app.module.js +++ b/benchmarks/frameworks/nest/app/app.module.js @@ -1,5 +1,6 @@ -import {__decorate} from "tslib"; import common_1 from "@nestjs/common"; +import {__decorate} from "tslib"; + import {AppController} from "./app.controller.js"; class AppModule {} diff --git a/benchmarks/frameworks/nest/index.js b/benchmarks/frameworks/nest/index.js index dee2ecfd6b8..40e14507ab7 100644 --- a/benchmarks/frameworks/nest/index.js +++ b/benchmarks/frameworks/nest/index.js @@ -1,5 +1,6 @@ "use strict"; import core from "@nestjs/core"; + import {AppModule} from "./app/app.module.js"; core.NestFactory.create(AppModule, { diff --git a/benchmarks/frameworks/tsed-express.js b/benchmarks/frameworks/tsed-express.js index 834d38f12ab..58cc73eb77e 100644 --- a/benchmarks/frameworks/tsed-express.js +++ b/benchmarks/frameworks/tsed-express.js @@ -1,8 +1,8 @@ "use strict"; +import {PlatformApplication} from "@tsed/common"; +import {Inject} from "@tsed/di"; import {PlatformExpress} from "@tsed/platform-express"; import {__decorate} from "tslib"; -import {Inject} from "@tsed/di"; -import {PlatformApplication} from "@tsed/common"; class Server { $onInit() { diff --git a/benchmarks/frameworks/tsed-koa.js b/benchmarks/frameworks/tsed-koa.js index a0b257b7af3..8c417686a48 100644 --- a/benchmarks/frameworks/tsed-koa.js +++ b/benchmarks/frameworks/tsed-koa.js @@ -1,8 +1,8 @@ "use strict"; +import {PlatformApplication} from "@tsed/common"; +import {Inject} from "@tsed/di"; import {PlatformKoa} from "@tsed/platform-koa"; import {__decorate} from "tslib"; -import {Inject} from "@tsed/di"; -import {PlatformApplication} from "@tsed/common"; class Server { $beforeRoutesInit() { diff --git a/benchmarks/frameworks/tsed-no-context.js b/benchmarks/frameworks/tsed-no-context.js index 3b2d1b59e61..82ca85e4708 100644 --- a/benchmarks/frameworks/tsed-no-context.js +++ b/benchmarks/frameworks/tsed-no-context.js @@ -1,8 +1,8 @@ "use strict"; +import {PlatformApplication} from "@tsed/common"; +import {Inject} from "@tsed/di"; import {PlatformExpress} from "@tsed/platform-express"; import {__decorate} from "tslib"; -import {Inject} from "@tsed/di"; -import {PlatformApplication} from "@tsed/common"; class Server { $onInit() { diff --git a/benchmarks/frameworks/tsed-no-events.js b/benchmarks/frameworks/tsed-no-events.js index 5b6d48939d6..28226a24e46 100644 --- a/benchmarks/frameworks/tsed-no-events.js +++ b/benchmarks/frameworks/tsed-no-events.js @@ -1,8 +1,8 @@ "use strict"; +import {PlatformApplication} from "@tsed/common"; +import {Inject} from "@tsed/di"; import {PlatformExpress} from "@tsed/platform-express"; import {__decorate} from "tslib"; -import {Inject} from "@tsed/di"; -import {PlatformApplication} from "@tsed/common"; class Server { $onInit() { diff --git a/benchmarks/src/autocannon.js b/benchmarks/src/autocannon.js index e50f0d2914b..f2f0905eaf6 100644 --- a/benchmarks/src/autocannon.js +++ b/benchmarks/src/autocannon.js @@ -1,6 +1,6 @@ import autocannon from "autocannon"; -import fs from "fs"; import autoCompare from "autocannon-compare"; +import fs from "fs"; import path from "path"; import {promisify} from "util"; diff --git a/benchmarks/src/bench.js b/benchmarks/src/bench.js index f814816dc36..96887bee306 100644 --- a/benchmarks/src/bench.js +++ b/benchmarks/src/bench.js @@ -2,9 +2,10 @@ import {execa} from "execa"; import ora from "ora"; import path from "path"; -import {fire} from "./autocannon.js"; import {fileURLToPath} from "url"; +import {fire} from "./autocannon.js"; + const __dirname = path.dirname(fileURLToPath(import.meta.url)); const doBench = async (opts, handler) => { diff --git a/benchmarks/src/packages.js b/benchmarks/src/packages.js index f55b68f50c3..8d0b2944def 100755 --- a/benchmarks/src/packages.js +++ b/benchmarks/src/packages.js @@ -1,6 +1,6 @@ import fs from "fs"; -import {dirname, join} from "path"; import {createRequire} from "module"; +import {dirname, join} from "path"; const require = createRequire(import.meta.url); diff --git a/docs/.vuepress/enhanceApp.js b/docs/.vuepress/enhanceApp.js index c0e40a6a78d..5fcf11cd17b 100644 --- a/docs/.vuepress/enhanceApp.js +++ b/docs/.vuepress/enhanceApp.js @@ -1,8 +1,9 @@ import "./window-boot.js"; -import VueTsED from "vuepress-theme-tsed/src/install"; import "./styles/style.css"; import "prismjs/components/prism-groovy"; +import VueTsED from "vuepress-theme-tsed/src/install"; + export default ({ Vue, // the version of Vue being used in the VuePress app options, // the options for the root Vue instance diff --git a/docs/docs/snippets/authentication/auth-custom-auth-example.ts b/docs/docs/snippets/authentication/auth-custom-auth-example.ts index ee716c21425..a7a7510c7ce 100644 --- a/docs/docs/snippets/authentication/auth-custom-auth-example.ts +++ b/docs/docs/snippets/authentication/auth-custom-auth-example.ts @@ -1,5 +1,6 @@ -import {Get} from "@tsed/schema"; import {Controller} from "@tsed/di"; +import {Get} from "@tsed/schema"; + import {CustomAuth} from "../decorators/CustomAuth"; @Controller("/dashboard") diff --git a/docs/docs/snippets/authentication/auth-decorator-example-2.ts b/docs/docs/snippets/authentication/auth-decorator-example-2.ts index bee3f76ef43..9f1a68b26b6 100644 --- a/docs/docs/snippets/authentication/auth-decorator-example-2.ts +++ b/docs/docs/snippets/authentication/auth-decorator-example-2.ts @@ -1,6 +1,7 @@ -import {In, Returns, Security} from "@tsed/schema"; -import {UseAuth} from "@tsed/platform-middlewares"; import {useDecorators} from "@tsed/core"; +import {UseAuth} from "@tsed/platform-middlewares"; +import {In, Returns, Security} from "@tsed/schema"; + import {CustomAuthMiddleware} from "../guards/CustomAuthMiddleware"; export interface CustomAuthOptions extends Record { diff --git a/docs/docs/snippets/authentication/auth-decorator-example.ts b/docs/docs/snippets/authentication/auth-decorator-example.ts index d7cf4c9ed06..8e5db2b56a8 100644 --- a/docs/docs/snippets/authentication/auth-decorator-example.ts +++ b/docs/docs/snippets/authentication/auth-decorator-example.ts @@ -1,6 +1,7 @@ -import {UseAuth} from "@tsed/platform-middlewares"; import {useDecorators} from "@tsed/core"; -import {Security, Returns} from "@tsed/schema"; +import {UseAuth} from "@tsed/platform-middlewares"; +import {Returns, Security} from "@tsed/schema"; + import {CustomAuthMiddleware} from "../guards/CustomAuthMiddleware"; export interface AuthOpts extends Record { diff --git a/docs/docs/snippets/authentication/auth-example.ts b/docs/docs/snippets/authentication/auth-example.ts index 3f91f986f2e..1bc959b74e5 100644 --- a/docs/docs/snippets/authentication/auth-example.ts +++ b/docs/docs/snippets/authentication/auth-example.ts @@ -1,6 +1,7 @@ import {Controller} from "@tsed/di"; -import {Get} from "@tsed/schema"; import {UseAuth} from "@tsed/platform-middlewares"; +import {Get} from "@tsed/schema"; + import {CustomAuthMiddleware} from "../guards/CustomAuthMiddleware"; @Controller("/dashboard") diff --git a/docs/docs/snippets/authentication/auth-middleware.ts b/docs/docs/snippets/authentication/auth-middleware.ts index dc846647e08..393ea049d85 100644 --- a/docs/docs/snippets/authentication/auth-middleware.ts +++ b/docs/docs/snippets/authentication/auth-middleware.ts @@ -1,7 +1,7 @@ import {Req} from "@tsed/common"; -import {Context} from "@tsed/platform-params"; -import {Middleware, MiddlewareMethods} from "@tsed/platform-middlewares"; import {Forbidden, Unauthorized} from "@tsed/exceptions"; +import {Middleware, MiddlewareMethods} from "@tsed/platform-middlewares"; +import {Context} from "@tsed/platform-params"; @Middleware() export class CustomAuthMiddleware implements MiddlewareMethods { diff --git a/docs/docs/snippets/authentication/auth-swagger-example.ts b/docs/docs/snippets/authentication/auth-swagger-example.ts index 3d61e611289..54e0b7bf75e 100644 --- a/docs/docs/snippets/authentication/auth-swagger-example.ts +++ b/docs/docs/snippets/authentication/auth-swagger-example.ts @@ -1,7 +1,8 @@ import {Controller} from "@tsed/di"; -import {Get, Returns, Security} from "@tsed/schema"; -import {UseAuth} from "@tsed/platform-middlewares"; import {Forbidden, Unauthorized} from "@tsed/exceptions"; +import {UseAuth} from "@tsed/platform-middlewares"; +import {Get, Returns, Security} from "@tsed/schema"; + import {CustomAuthMiddleware} from "../guards/CustomAuthMiddleware"; @Controller("/dashboard") @@ -11,7 +12,7 @@ class DashboardCtrl { @Get("/") @UseAuth(CustomAuthMiddleware, {role: "admin"}) // or for specific endpoints @Security("oauth2", "email", "firstname") - @Returns(401, Unauthorized).Description("Unauthorized") - @Returns(403, Forbidden).Description("Forbidden") + @(Returns(401, Unauthorized).Description("Unauthorized")) + @(Returns(403, Forbidden).Description("Forbidden")) public getResource() {} } diff --git a/docs/docs/snippets/configuration/bootstrap-with-dotenv.ts b/docs/docs/snippets/configuration/bootstrap-with-dotenv.ts index fd631bc787d..58d2adb0606 100644 --- a/docs/docs/snippets/configuration/bootstrap-with-dotenv.ts +++ b/docs/docs/snippets/configuration/bootstrap-with-dotenv.ts @@ -1,5 +1,6 @@ import {$log} from "@tsed/common"; import {PlatformExpress} from "@tsed/platform-express"; + import {Server} from "./server"; const config = require("dotenv").config({path: "/full/custom/path/to/your/env/vars"}); diff --git a/docs/docs/snippets/configuration/bootstrap-with-node-config.ts b/docs/docs/snippets/configuration/bootstrap-with-node-config.ts index b79539c2571..4c5a89de5f3 100644 --- a/docs/docs/snippets/configuration/bootstrap-with-node-config.ts +++ b/docs/docs/snippets/configuration/bootstrap-with-node-config.ts @@ -1,5 +1,6 @@ import {$log} from "@tsed/common"; import {PlatformExpress} from "@tsed/platform-express"; + import {Server} from "./server"; const rootDir = import.meta.dirname; // automatically replaced by import.meta.dirname on build diff --git a/docs/docs/snippets/configuration/bootstrap.ts b/docs/docs/snippets/configuration/bootstrap.ts index 78d18535bc2..44fb2124bb7 100644 --- a/docs/docs/snippets/configuration/bootstrap.ts +++ b/docs/docs/snippets/configuration/bootstrap.ts @@ -1,5 +1,6 @@ import {$log} from "@tsed/common"; import {PlatformExpress} from "@tsed/platform-express"; + import {Server} from "./server"; async function bootstrap() { diff --git a/docs/docs/snippets/configuration/module-options-imports.ts b/docs/docs/snippets/configuration/module-options-imports.ts index 30f7e8b030a..8b99e4251e0 100644 --- a/docs/docs/snippets/configuration/module-options-imports.ts +++ b/docs/docs/snippets/configuration/module-options-imports.ts @@ -1,4 +1,5 @@ import {Module} from "@tsed/di"; + import {MyController} from "./controllers/MyController"; import {MyService} from "./services/MyService"; diff --git a/docs/docs/snippets/configuration/module-resolvers.ts b/docs/docs/snippets/configuration/module-resolvers.ts index 9ee6ef87be6..30d83a5fffe 100644 --- a/docs/docs/snippets/configuration/module-resolvers.ts +++ b/docs/docs/snippets/configuration/module-resolvers.ts @@ -1,4 +1,5 @@ import {Module} from "@tsed/di"; + import {myContainer} from "./inversify.config"; @Module({ diff --git a/docs/docs/snippets/configuration/modulev0-endpoint-versionning.ts b/docs/docs/snippets/configuration/modulev0-endpoint-versionning.ts index ce66343d54c..dfad233898f 100644 --- a/docs/docs/snippets/configuration/modulev0-endpoint-versionning.ts +++ b/docs/docs/snippets/configuration/modulev0-endpoint-versionning.ts @@ -1,4 +1,5 @@ import {Module} from "@tsed/di"; + import {UserController} from "./users/UserController"; @Module({ diff --git a/docs/docs/snippets/configuration/modulev1-endpoint-versionning.ts b/docs/docs/snippets/configuration/modulev1-endpoint-versionning.ts index 162955574a5..91e2e8f8743 100644 --- a/docs/docs/snippets/configuration/modulev1-endpoint-versionning.ts +++ b/docs/docs/snippets/configuration/modulev1-endpoint-versionning.ts @@ -1,4 +1,5 @@ import {Module} from "@tsed/di"; + import {UserController} from "./users/UserController"; @Module({ diff --git a/docs/docs/snippets/configuration/server-endpoint-versionning-with-module.ts b/docs/docs/snippets/configuration/server-endpoint-versionning-with-module.ts index c921953d54f..a2cb02d461d 100644 --- a/docs/docs/snippets/configuration/server-endpoint-versionning-with-module.ts +++ b/docs/docs/snippets/configuration/server-endpoint-versionning-with-module.ts @@ -1,4 +1,5 @@ import {Configuration} from "@tsed/di"; + import {ModuleV0} from "./v0/ModuleV0"; import {ModuleV1} from "./v1/ModuleV1"; diff --git a/docs/docs/snippets/configuration/server-endpoint-versionning.ts b/docs/docs/snippets/configuration/server-endpoint-versionning.ts index c68b4047021..b91332e899a 100644 --- a/docs/docs/snippets/configuration/server-endpoint-versionning.ts +++ b/docs/docs/snippets/configuration/server-endpoint-versionning.ts @@ -1,6 +1,7 @@ import {Configuration} from "@tsed/di"; -import * as v1Controllers from "./controllers/v1/index"; + import * as v0Controllers from "./controllers/v0/index"; +import * as v1Controllers from "./controllers/v1/index"; @Configuration({ mount: { @@ -11,9 +12,9 @@ import * as v0Controllers from "./controllers/v0/index"; export class Server {} // v1/index.ts -export * from "./users/UserControllers"; export * from "./groups/GroupsControllers"; +export * from "./users/UserControllers"; // v0/index.ts -export * from "./users/UserControllers"; export * from "./groups/GroupsControllers"; +export * from "./users/UserControllers"; diff --git a/docs/docs/snippets/configuration/server-options-imports.ts b/docs/docs/snippets/configuration/server-options-imports.ts index 715701b6e9b..f46aac0c41a 100644 --- a/docs/docs/snippets/configuration/server-options-imports.ts +++ b/docs/docs/snippets/configuration/server-options-imports.ts @@ -1,4 +1,5 @@ import {Configuration} from "@tsed/di"; + import {MyModule} from "./module/MyModule"; @Configuration({ diff --git a/docs/docs/snippets/configuration/server-resolvers.ts b/docs/docs/snippets/configuration/server-resolvers.ts index aeded388ec8..63375657a4d 100644 --- a/docs/docs/snippets/configuration/server-resolvers.ts +++ b/docs/docs/snippets/configuration/server-resolvers.ts @@ -1,4 +1,5 @@ import {Configuration} from "@tsed/di"; + import {myContainer} from "./inversify.config"; @Configuration({ diff --git a/docs/docs/snippets/configuration/server.ts b/docs/docs/snippets/configuration/server.ts index 712ea9b7297..be0fe79f0be 100644 --- a/docs/docs/snippets/configuration/server.ts +++ b/docs/docs/snippets/configuration/server.ts @@ -1,4 +1,5 @@ import {Configuration} from "@tsed/di"; + import {MyController} from "./controllers/manual/MyController"; @Configuration({ diff --git a/docs/docs/snippets/controllers/async-controller.ts b/docs/docs/snippets/controllers/async-controller.ts index 692a2c6e732..84bc20e9867 100644 --- a/docs/docs/snippets/controllers/async-controller.ts +++ b/docs/docs/snippets/controllers/async-controller.ts @@ -1,6 +1,6 @@ -import {Get} from "@tsed/schema"; import {Controller} from "@tsed/di"; import {PathParams} from "@tsed/platform-params"; +import {Get} from "@tsed/schema"; interface Calendar { id: string; diff --git a/docs/docs/snippets/controllers/axios-controller.ts b/docs/docs/snippets/controllers/axios-controller.ts index d33e23e4564..a4fc84f939e 100644 --- a/docs/docs/snippets/controllers/axios-controller.ts +++ b/docs/docs/snippets/controllers/axios-controller.ts @@ -1,7 +1,7 @@ import {Res} from "@tsed/common"; +import {Controller} from "@tsed/di"; import {QueryParams} from "@tsed/platform-params"; import {Get} from "@tsed/schema"; -import {Controller} from "@tsed/di"; import Axios from "axios"; import {IncomingMessage} from "http"; diff --git a/docs/docs/snippets/controllers/basic-controller.ts b/docs/docs/snippets/controllers/basic-controller.ts index fc545d374a6..cb8157640ca 100644 --- a/docs/docs/snippets/controllers/basic-controller.ts +++ b/docs/docs/snippets/controllers/basic-controller.ts @@ -1,5 +1,5 @@ -import {Get} from "@tsed/schema"; import {Controller} from "@tsed/di"; +import {Get} from "@tsed/schema"; @Controller("/calendars") export class CalendarCtrl { diff --git a/docs/docs/snippets/controllers/child-controllers-calendar.ts b/docs/docs/snippets/controllers/child-controllers-calendar.ts index 9c7b08e0edc..a101611720d 100644 --- a/docs/docs/snippets/controllers/child-controllers-calendar.ts +++ b/docs/docs/snippets/controllers/child-controllers-calendar.ts @@ -1,5 +1,6 @@ -import {Get} from "@tsed/schema"; import {Controller} from "@tsed/di"; +import {Get} from "@tsed/schema"; + import {EventCtrl} from "./EventCtrl"; @Controller({ diff --git a/docs/docs/snippets/controllers/child-controllers-event.ts b/docs/docs/snippets/controllers/child-controllers-event.ts index 22e37e6356d..082d03cf1ae 100644 --- a/docs/docs/snippets/controllers/child-controllers-event.ts +++ b/docs/docs/snippets/controllers/child-controllers-event.ts @@ -1,5 +1,5 @@ -import {Get} from "@tsed/schema"; import {Controller} from "@tsed/di"; +import {Get} from "@tsed/schema"; @Controller("/events") export class EventCtrl { diff --git a/docs/docs/snippets/controllers/child-controllers-rest.ts b/docs/docs/snippets/controllers/child-controllers-rest.ts index a8d7af6ae2c..2d03605ccb0 100644 --- a/docs/docs/snippets/controllers/child-controllers-rest.ts +++ b/docs/docs/snippets/controllers/child-controllers-rest.ts @@ -1,4 +1,5 @@ import {Controller} from "@tsed/di"; + import {CalendarCtrl} from "./CalendarCtrl"; import {EventCtrl} from "./EventCtrl"; diff --git a/docs/docs/snippets/controllers/child-controllers-server.ts b/docs/docs/snippets/controllers/child-controllers-server.ts index 3d089f5a0a5..2c8309573bc 100644 --- a/docs/docs/snippets/controllers/child-controllers-server.ts +++ b/docs/docs/snippets/controllers/child-controllers-server.ts @@ -1,4 +1,5 @@ import {Configuration} from "@tsed/di"; + import {RestCtrl} from "./controllers/RestCtrl"; @Configuration({ diff --git a/docs/docs/snippets/controllers/getting-started.ts b/docs/docs/snippets/controllers/getting-started.ts index c468641c3f2..9c2c36e0ae5 100644 --- a/docs/docs/snippets/controllers/getting-started.ts +++ b/docs/docs/snippets/controllers/getting-started.ts @@ -1,7 +1,7 @@ -import {Get, Post, Required, Delete} from "@tsed/schema"; import {Controller} from "@tsed/di"; -import {View} from "@tsed/platform-views"; import {BodyParams} from "@tsed/platform-params"; +import {View} from "@tsed/platform-views"; +import {Delete, Get, Post, Required} from "@tsed/schema"; export interface Calendar { id: string; diff --git a/docs/docs/snippets/controllers/inheritance-base-controller.ts b/docs/docs/snippets/controllers/inheritance-base-controller.ts index b4870b897be..b13ef60a427 100644 --- a/docs/docs/snippets/controllers/inheritance-base-controller.ts +++ b/docs/docs/snippets/controllers/inheritance-base-controller.ts @@ -1,5 +1,6 @@ -import {Get} from "@tsed/schema"; import {QueryParams} from "@tsed/platform-params"; +import {Get} from "@tsed/schema"; + import {SomeService} from "./SomeService"; export abstract class BaseCtrl { diff --git a/docs/docs/snippets/controllers/inheritance-child-controller.ts b/docs/docs/snippets/controllers/inheritance-child-controller.ts index 3eb552a2c9b..d4fbaa5f4b1 100644 --- a/docs/docs/snippets/controllers/inheritance-child-controller.ts +++ b/docs/docs/snippets/controllers/inheritance-child-controller.ts @@ -1,6 +1,7 @@ +import {Controller} from "@tsed/di"; import {PathParams} from "@tsed/platform-params"; import {Get} from "@tsed/schema"; -import {Controller} from "@tsed/di"; + import {BaseCtrl} from "./BaseCtrl"; @Controller("/child") diff --git a/docs/docs/snippets/controllers/inject-next.ts b/docs/docs/snippets/controllers/inject-next.ts index 3fe8b227207..f0b94446121 100644 --- a/docs/docs/snippets/controllers/inject-next.ts +++ b/docs/docs/snippets/controllers/inject-next.ts @@ -1,6 +1,6 @@ import {Next, Req, Res} from "@tsed/common"; -import {Get} from "@tsed/schema"; import {Controller} from "@tsed/di"; +import {Get} from "@tsed/schema"; import * as Express from "express"; import {promisify} from "util"; diff --git a/docs/docs/snippets/controllers/inject-req-res-node.ts b/docs/docs/snippets/controllers/inject-req-res-node.ts index 121a1c1acdd..272707e6dde 100644 --- a/docs/docs/snippets/controllers/inject-req-res-node.ts +++ b/docs/docs/snippets/controllers/inject-req-res-node.ts @@ -1,6 +1,6 @@ import {Req, Res} from "@tsed/common"; -import {Get} from "@tsed/schema"; import {Controller} from "@tsed/di"; +import {Get} from "@tsed/schema"; import {IncomingMessage, ServerResponse} from "http"; @Controller("/calendars") diff --git a/docs/docs/snippets/controllers/inject-req-res-platform.ts b/docs/docs/snippets/controllers/inject-req-res-platform.ts index 1cda0164ca4..5daa7e5002f 100644 --- a/docs/docs/snippets/controllers/inject-req-res-platform.ts +++ b/docs/docs/snippets/controllers/inject-req-res-platform.ts @@ -1,6 +1,6 @@ import {PlatformRequest, PlatformResponse, Req, Res} from "@tsed/common"; -import {Get} from "@tsed/schema"; import {Controller} from "@tsed/di"; +import {Get} from "@tsed/schema"; @Controller("/calendars") export class CalendarCtrl { diff --git a/docs/docs/snippets/controllers/inject-req-res-target.ts b/docs/docs/snippets/controllers/inject-req-res-target.ts index 888fc0e2d4d..17796ec3777 100644 --- a/docs/docs/snippets/controllers/inject-req-res-target.ts +++ b/docs/docs/snippets/controllers/inject-req-res-target.ts @@ -1,6 +1,6 @@ import {Req, Res} from "@tsed/common"; -import {Get} from "@tsed/schema"; import {Controller} from "@tsed/di"; +import {Get} from "@tsed/schema"; @Controller("/calendars") export class CalendarCtrl { diff --git a/docs/docs/snippets/controllers/inject-router.ts b/docs/docs/snippets/controllers/inject-router.ts index cd559c349ef..d40206acffb 100644 --- a/docs/docs/snippets/controllers/inject-router.ts +++ b/docs/docs/snippets/controllers/inject-router.ts @@ -1,5 +1,5 @@ -import {PlatformRouter} from "@tsed/platform-router"; import {Controller} from "@tsed/di"; +import {PlatformRouter} from "@tsed/platform-router"; @Controller("/calendars") export class CalendarCtrl { diff --git a/docs/docs/snippets/controllers/locals-example.ts b/docs/docs/snippets/controllers/locals-example.ts index 44c275f8968..45b0f3676f0 100644 --- a/docs/docs/snippets/controllers/locals-example.ts +++ b/docs/docs/snippets/controllers/locals-example.ts @@ -1,8 +1,8 @@ -import {Locals} from "@tsed/platform-params"; +import {Controller} from "@tsed/di"; 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 {Controller} from "@tsed/di"; @Middleware() class LocalsMiddleware { diff --git a/docs/docs/snippets/controllers/merge-params-1.ts b/docs/docs/snippets/controllers/merge-params-1.ts index 434c8324f9c..7466af9ec81 100644 --- a/docs/docs/snippets/controllers/merge-params-1.ts +++ b/docs/docs/snippets/controllers/merge-params-1.ts @@ -1,6 +1,6 @@ +import {Controller} from "@tsed/di"; import {PathParams} from "@tsed/platform-params"; import {Get} from "@tsed/schema"; -import {Controller} from "@tsed/di"; @Controller("/:calendarId/events") class EventCtrl { diff --git a/docs/docs/snippets/controllers/merge-params-2.ts b/docs/docs/snippets/controllers/merge-params-2.ts index 434c8324f9c..7466af9ec81 100644 --- a/docs/docs/snippets/controllers/merge-params-2.ts +++ b/docs/docs/snippets/controllers/merge-params-2.ts @@ -1,6 +1,6 @@ +import {Controller} from "@tsed/di"; import {PathParams} from "@tsed/platform-params"; import {Get} from "@tsed/schema"; -import {Controller} from "@tsed/di"; @Controller("/:calendarId/events") class EventCtrl { diff --git a/docs/docs/snippets/controllers/middlewares.ts b/docs/docs/snippets/controllers/middlewares.ts index 9008deab411..809b72d715f 100644 --- a/docs/docs/snippets/controllers/middlewares.ts +++ b/docs/docs/snippets/controllers/middlewares.ts @@ -1,7 +1,8 @@ +import {Controller} from "@tsed/di"; import {Use, UseAfter, UseBefore} from "@tsed/platform-middlewares"; import {PathParams} from "@tsed/platform-params"; import {Get} from "@tsed/schema"; -import {Controller} from "@tsed/di"; + import {CustomBeforeMdlw, CustomMiddleware} from "../middlewares/middlewares"; @Controller("/calendars") diff --git a/docs/docs/snippets/controllers/multiple-endpoint-single-method.ts b/docs/docs/snippets/controllers/multiple-endpoint-single-method.ts index 0701955a878..ad0630b7e11 100644 --- a/docs/docs/snippets/controllers/multiple-endpoint-single-method.ts +++ b/docs/docs/snippets/controllers/multiple-endpoint-single-method.ts @@ -1,5 +1,5 @@ -import {Get, Post} from "@tsed/schema"; import {Controller} from "@tsed/di"; +import {Get, Post} from "@tsed/schema"; @Controller("/calendars") export class CalendarCtrl { diff --git a/docs/docs/snippets/controllers/params-advanced-usage.ts b/docs/docs/snippets/controllers/params-advanced-usage.ts index c2f9e067571..536aacd31b1 100644 --- a/docs/docs/snippets/controllers/params-advanced-usage.ts +++ b/docs/docs/snippets/controllers/params-advanced-usage.ts @@ -1,5 +1,5 @@ -import {Post} from "@tsed/schema"; import {BodyParams} from "@tsed/platform-params"; +import {Post} from "@tsed/schema"; class MyController { @Post() diff --git a/docs/docs/snippets/controllers/params-decorator.ts b/docs/docs/snippets/controllers/params-decorator.ts index fe01f7a89ca..1c25fca6c14 100644 --- a/docs/docs/snippets/controllers/params-decorator.ts +++ b/docs/docs/snippets/controllers/params-decorator.ts @@ -1,6 +1,7 @@ +import {Controller} from "@tsed/di"; import {BodyParams} from "@tsed/platform-params"; import {Post} from "@tsed/schema"; -import {Controller} from "@tsed/di"; + import {CalendarModel} from "../models/CalendarModel"; import {PayloadModel} from "../models/PayloadModel"; diff --git a/docs/docs/snippets/controllers/params-post-any.ts b/docs/docs/snippets/controllers/params-post-any.ts index fbd15f8f3f5..4336f1d249a 100644 --- a/docs/docs/snippets/controllers/params-post-any.ts +++ b/docs/docs/snippets/controllers/params-post-any.ts @@ -1,6 +1,6 @@ +import {Controller} from "@tsed/di"; import {BodyParams} from "@tsed/platform-params"; import {Post} from "@tsed/schema"; -import {Controller} from "@tsed/di"; import {Any} from "@tsed/schema"; @Controller("/any") diff --git a/docs/docs/snippets/controllers/params-post-array-with-model.ts b/docs/docs/snippets/controllers/params-post-array-with-model.ts index 026792ba315..1be7c9c1496 100644 --- a/docs/docs/snippets/controllers/params-post-array-with-model.ts +++ b/docs/docs/snippets/controllers/params-post-array-with-model.ts @@ -1,6 +1,6 @@ +import {Controller} from "@tsed/di"; import {BodyParams} from "@tsed/platform-params"; import {Post} from "@tsed/schema"; -import {Controller} from "@tsed/di"; import {Property} from "@tsed/schema"; class Product { diff --git a/docs/docs/snippets/controllers/params-post-array.ts b/docs/docs/snippets/controllers/params-post-array.ts index a2b3aaa2ff1..922280cb489 100644 --- a/docs/docs/snippets/controllers/params-post-array.ts +++ b/docs/docs/snippets/controllers/params-post-array.ts @@ -1,6 +1,6 @@ +import {Controller} from "@tsed/di"; import {BodyParams} from "@tsed/platform-params"; import {Post} from "@tsed/schema"; -import {Controller} from "@tsed/di"; @Controller("/calendars") export class CalendarCtrl { diff --git a/docs/docs/snippets/controllers/params-post-enum.ts b/docs/docs/snippets/controllers/params-post-enum.ts index f678cb2545b..4ec4c27c4f5 100644 --- a/docs/docs/snippets/controllers/params-post-enum.ts +++ b/docs/docs/snippets/controllers/params-post-enum.ts @@ -1,6 +1,6 @@ +import {Controller} from "@tsed/di"; import {QueryParams} from "@tsed/platform-params"; import {Post} from "@tsed/schema"; -import {Controller} from "@tsed/di"; import {Enum} from "@tsed/schema"; export enum SearchType { diff --git a/docs/docs/snippets/controllers/params-post-inline-validation.ts b/docs/docs/snippets/controllers/params-post-inline-validation.ts index 34717ea7077..49698a30272 100644 --- a/docs/docs/snippets/controllers/params-post-inline-validation.ts +++ b/docs/docs/snippets/controllers/params-post-inline-validation.ts @@ -1,6 +1,6 @@ +import {Controller} from "@tsed/di"; import {BodyParams} from "@tsed/platform-params"; import {Post} from "@tsed/schema"; -import {Controller} from "@tsed/di"; import {MinLength, Required} from "@tsed/schema"; @Controller("/calendars") diff --git a/docs/docs/snippets/controllers/params-post-string.ts b/docs/docs/snippets/controllers/params-post-string.ts index b3109a8a829..8d62d1f9656 100644 --- a/docs/docs/snippets/controllers/params-post-string.ts +++ b/docs/docs/snippets/controllers/params-post-string.ts @@ -1,6 +1,6 @@ +import {Controller} from "@tsed/di"; import {BodyParams} from "@tsed/platform-params"; import {Post} from "@tsed/schema"; -import {Controller} from "@tsed/di"; @Controller("/calendars") export class CalendarCtrl { diff --git a/docs/docs/snippets/controllers/request-headers.ts b/docs/docs/snippets/controllers/request-headers.ts index 00758bf1262..59514f6cb00 100644 --- a/docs/docs/snippets/controllers/request-headers.ts +++ b/docs/docs/snippets/controllers/request-headers.ts @@ -1,6 +1,6 @@ +import {Controller} from "@tsed/di"; import {HeaderParams} from "@tsed/platform-params"; import {Get} from "@tsed/schema"; -import {Controller} from "@tsed/di"; @Controller("/calendars") export class CalendarCtrl { diff --git a/docs/docs/snippets/controllers/request-input-validation.ts b/docs/docs/snippets/controllers/request-input-validation.ts index 7f84f5ab849..8a67c6db6f4 100644 --- a/docs/docs/snippets/controllers/request-input-validation.ts +++ b/docs/docs/snippets/controllers/request-input-validation.ts @@ -1,6 +1,6 @@ +import {Controller} from "@tsed/di"; import {PathParams} from "@tsed/platform-params"; import {Get} from "@tsed/schema"; -import {Controller} from "@tsed/di"; import {MinLength} from "@tsed/schema"; @Controller("/calendars") diff --git a/docs/docs/snippets/controllers/request-raw-body.ts b/docs/docs/snippets/controllers/request-raw-body.ts index 0cafdf3c8e1..cbb4e64c1c9 100644 --- a/docs/docs/snippets/controllers/request-raw-body.ts +++ b/docs/docs/snippets/controllers/request-raw-body.ts @@ -1,6 +1,6 @@ +import {Controller} from "@tsed/di"; import {RawBodyParams} from "@tsed/platform-params"; import {Post} from "@tsed/schema"; -import {Controller} from "@tsed/di"; @Controller("/calendars") export class CalendarCtrl { diff --git a/docs/docs/snippets/controllers/response-content-type.ts b/docs/docs/snippets/controllers/response-content-type.ts index bcaad7b29c3..6cddb4b0c3e 100644 --- a/docs/docs/snippets/controllers/response-content-type.ts +++ b/docs/docs/snippets/controllers/response-content-type.ts @@ -1,6 +1,6 @@ +import {Controller} from "@tsed/di"; import {BodyParams} from "@tsed/platform-params"; import {ContentType, Returns} from "@tsed/schema"; -import {Controller} from "@tsed/di"; @Controller("/calendars") export class CalendarCtrl { @@ -13,11 +13,11 @@ export class CalendarCtrl { return "something"; } - @Returns(200, String).ContentType(".html") // => 'text/html' - @Returns(200, String).ContentType("html") // => 'text/html' - @Returns(200, Object).ContentType("json") // => 'application/json' - @Returns(200, Object).ContentType("application/json") // => 'application/json' - @Returns(200, String).ContentType("png") + @(Returns(200, String).ContentType(".html")) // => 'text/html' + @(Returns(200, String).ContentType("html")) // => 'text/html' + @(Returns(200, Object).ContentType("json")) // => 'application/json' + @(Returns(200, Object).ContentType("application/json")) // => 'application/json' + @(Returns(200, String).ContentType("png")) getContent2(@BodyParams("name") name: string): any { return "something"; } diff --git a/docs/docs/snippets/controllers/response-generics-controller.ts b/docs/docs/snippets/controllers/response-generics-controller.ts index 59ef88b5506..ce87af495af 100644 --- a/docs/docs/snippets/controllers/response-generics-controller.ts +++ b/docs/docs/snippets/controllers/response-generics-controller.ts @@ -1,7 +1,8 @@ -import {PathParams} from "@tsed/platform-params"; -import {Get, Name, Returns, Summary} from "@tsed/schema"; import {Controller} from "@tsed/di"; import {NotFound} from "@tsed/exceptions"; +import {PathParams} from "@tsed/platform-params"; +import {Get, Name, Returns, Summary} from "@tsed/schema"; + import {Document} from "../../domain/document/Documents"; import {Product} from "../../domain/product/Product"; import {ProductTypes} from "../../domain/product/ProductTypes"; @@ -10,8 +11,8 @@ import {ProductTypes} from "../../domain/product/ProductTypes"; @Name("Products") export class ProductsCtrl { @Get("/:id") - @Returns(200, Document).Of(Product).Description("A product") - @Returns(404, NotFound).Description("Product not found") + @(Returns(200, Document).Of(Product).Description("A product")) + @(Returns(404, NotFound).Description("Product not found")) @Summary("Return a product from the given Id") async geProduct(@PathParams("id") id: string): Promise> { if (id === "AGAC") { diff --git a/docs/docs/snippets/controllers/response-generics-document.ts b/docs/docs/snippets/controllers/response-generics-document.ts index 8eea19db621..94f0561b3d0 100644 --- a/docs/docs/snippets/controllers/response-generics-document.ts +++ b/docs/docs/snippets/controllers/response-generics-document.ts @@ -1,4 +1,5 @@ import {CollectionOf, Generics} from "@tsed/schema"; + import {DocumentLink} from "./DocumentLink"; @Generics("T") diff --git a/docs/docs/snippets/controllers/response-generics-product.ts b/docs/docs/snippets/controllers/response-generics-product.ts index 8eea19db621..94f0561b3d0 100644 --- a/docs/docs/snippets/controllers/response-generics-product.ts +++ b/docs/docs/snippets/controllers/response-generics-product.ts @@ -1,4 +1,5 @@ import {CollectionOf, Generics} from "@tsed/schema"; + import {DocumentLink} from "./DocumentLink"; @Generics("T") diff --git a/docs/docs/snippets/controllers/response-headers.ts b/docs/docs/snippets/controllers/response-headers.ts index 29e2582d92e..755ba8c9e46 100644 --- a/docs/docs/snippets/controllers/response-headers.ts +++ b/docs/docs/snippets/controllers/response-headers.ts @@ -1,6 +1,6 @@ +import {Controller} from "@tsed/di"; import {BodyParams} from "@tsed/platform-params"; import {Header, Returns} from "@tsed/schema"; -import {Controller} from "@tsed/di"; @Controller("/calendars") export class CalendarCtrl { @@ -16,14 +16,14 @@ export class CalendarCtrl { return `Text plain ${name}`; } - @Returns().Headers({ + @(Returns().Headers({ "Content-Type": "text/plain", "Content-Length": 123, ETag: { value: "12345", description: "header description" } - }) + })) create2(@BodyParams("name") name: string): string { return `Text plain ${name}`; } diff --git a/docs/docs/snippets/controllers/response-status.ts b/docs/docs/snippets/controllers/response-status.ts index 60b08b96bcd..3d2936a1b2f 100644 --- a/docs/docs/snippets/controllers/response-status.ts +++ b/docs/docs/snippets/controllers/response-status.ts @@ -1,6 +1,6 @@ -import {BodyParams} from "@tsed/platform-params"; -import {Returns, Put} from "@tsed/schema"; import {Controller} from "@tsed/di"; +import {BodyParams} from "@tsed/platform-params"; +import {Put, Returns} from "@tsed/schema"; interface Calendar { id: string; diff --git a/docs/docs/snippets/controllers/response-throw-exceptions.ts b/docs/docs/snippets/controllers/response-throw-exceptions.ts index 71ca221e62f..c307c2d0442 100644 --- a/docs/docs/snippets/controllers/response-throw-exceptions.ts +++ b/docs/docs/snippets/controllers/response-throw-exceptions.ts @@ -1,7 +1,7 @@ -import {PathParams} from "@tsed/platform-params"; -import {Get} from "@tsed/schema"; import {Controller} from "@tsed/di"; import {BadRequest} from "@tsed/exceptions"; +import {PathParams} from "@tsed/platform-params"; +import {Get} from "@tsed/schema"; @Controller("/calendars") export class CalendarCtrl { diff --git a/docs/docs/snippets/controllers/routes-order.ts b/docs/docs/snippets/controllers/routes-order.ts index 9fb7fdf4662..066c69da1f3 100644 --- a/docs/docs/snippets/controllers/routes-order.ts +++ b/docs/docs/snippets/controllers/routes-order.ts @@ -1,6 +1,6 @@ +import {Controller} from "@tsed/di"; import {PathParams} from "@tsed/platform-params"; import {Get} from "@tsed/schema"; -import {Controller} from "@tsed/di"; @Controller("/calendars") export class CalendarsController { diff --git a/docs/docs/snippets/controllers/routing.ts b/docs/docs/snippets/controllers/routing.ts index 6afe364c99f..4726b228e64 100644 --- a/docs/docs/snippets/controllers/routing.ts +++ b/docs/docs/snippets/controllers/routing.ts @@ -1,4 +1,5 @@ import {Configuration} from "@tsed/common"; + import {CalendarCtrl} from "./controllers/CalendarCtrl"; @Configuration({ diff --git a/docs/docs/snippets/converters/controller-usage-with-return-type.ts b/docs/docs/snippets/converters/controller-usage-with-return-type.ts index 2ecd2d12454..6dce828dde7 100644 --- a/docs/docs/snippets/converters/controller-usage-with-return-type.ts +++ b/docs/docs/snippets/converters/controller-usage-with-return-type.ts @@ -1,6 +1,7 @@ +import {Controller} from "@tsed/di"; import {BodyParams} from "@tsed/platform-params"; import {Get, Post, Returns} from "@tsed/schema"; -import {Controller} from "@tsed/di"; + import {Person} from "../models/Person"; @Controller("/") @@ -14,7 +15,7 @@ export class PersonsCtrl { } @Get("/") - @Returns(200, Array).Of(Person) + @(Returns(200, Array).Of(Person)) async getPersons(): Promise { return [new Person()]; } diff --git a/docs/docs/snippets/converters/controller-usage.ts b/docs/docs/snippets/converters/controller-usage.ts index 26ab6b61192..b2778744534 100644 --- a/docs/docs/snippets/converters/controller-usage.ts +++ b/docs/docs/snippets/converters/controller-usage.ts @@ -1,6 +1,7 @@ +import {Controller} from "@tsed/di"; import {BodyParams} from "@tsed/platform-params"; import {Get, Post, Returns} from "@tsed/schema"; -import {Controller} from "@tsed/di"; + import {Person} from "../models/Person"; @Controller("/") @@ -23,7 +24,7 @@ export class PersonsCtrl { } @Get("/") - @Returns(200, Array).Of(Person) // Add the correct json schema for swagger essentially. + @(Returns(200, Array).Of(Person)) // Add the correct json schema for swagger essentially. async getPersons(): Promise { return [new Person()]; } diff --git a/docs/docs/snippets/converters/model-additional-props.jest.ts b/docs/docs/snippets/converters/model-additional-props.jest.ts index b71b22744bb..2ff7531284d 100644 --- a/docs/docs/snippets/converters/model-additional-props.jest.ts +++ b/docs/docs/snippets/converters/model-additional-props.jest.ts @@ -1,4 +1,5 @@ import {deserialize} from "@tsed/json-mapper"; + import {Person} from "./Person"; describe("Person", () => { diff --git a/docs/docs/snippets/converters/model-additional-props.mocha.ts b/docs/docs/snippets/converters/model-additional-props.mocha.ts index 4464829a705..88e65b43662 100644 --- a/docs/docs/snippets/converters/model-additional-props.mocha.ts +++ b/docs/docs/snippets/converters/model-additional-props.mocha.ts @@ -1,5 +1,6 @@ import {deserialize, serialize} from "@tsed/json-mapper"; import {expect} from "chai"; + import {Person} from "./Person"; describe("Person", () => { diff --git a/docs/docs/snippets/converters/model-ignore-props.jest.ts b/docs/docs/snippets/converters/model-ignore-props.jest.ts index 3b901b3ca2c..23c90e91332 100644 --- a/docs/docs/snippets/converters/model-ignore-props.jest.ts +++ b/docs/docs/snippets/converters/model-ignore-props.jest.ts @@ -1,4 +1,5 @@ import {serialize} from "@tsed/json-mapper"; + import {User} from "./User"; describe("User", () => { diff --git a/docs/docs/snippets/converters/model-ignore-props.mocha.ts b/docs/docs/snippets/converters/model-ignore-props.mocha.ts index c97f7fe8ac4..2cbf5cf67c0 100644 --- a/docs/docs/snippets/converters/model-ignore-props.mocha.ts +++ b/docs/docs/snippets/converters/model-ignore-props.mocha.ts @@ -1,5 +1,6 @@ import {serialize} from "@tsed/json-mapper"; import {expect} from "chai"; + import {User} from "./User"; describe("User", () => { diff --git a/docs/docs/snippets/converters/model-missing-properties.jest.ts b/docs/docs/snippets/converters/model-missing-properties.jest.ts index 3b901b3ca2c..23c90e91332 100644 --- a/docs/docs/snippets/converters/model-missing-properties.jest.ts +++ b/docs/docs/snippets/converters/model-missing-properties.jest.ts @@ -1,4 +1,5 @@ import {serialize} from "@tsed/json-mapper"; + import {User} from "./User"; describe("User", () => { diff --git a/docs/docs/snippets/converters/model-missing-properties.mocha.ts b/docs/docs/snippets/converters/model-missing-properties.mocha.ts index c97f7fe8ac4..2cbf5cf67c0 100644 --- a/docs/docs/snippets/converters/model-missing-properties.mocha.ts +++ b/docs/docs/snippets/converters/model-missing-properties.mocha.ts @@ -1,5 +1,6 @@ import {serialize} from "@tsed/json-mapper"; import {expect} from "chai"; + import {User} from "./User"; describe("User", () => { diff --git a/docs/docs/snippets/converters/model-usage.jest.ts b/docs/docs/snippets/converters/model-usage.jest.ts index 10157b4ef82..b91622f6c5d 100644 --- a/docs/docs/snippets/converters/model-usage.jest.ts +++ b/docs/docs/snippets/converters/model-usage.jest.ts @@ -1,4 +1,5 @@ import {deserialize, serialize} from "@tsed/json-mapper"; + import {Person} from "./Person"; describe("Person", () => { diff --git a/docs/docs/snippets/converters/model-usage.mocha.ts b/docs/docs/snippets/converters/model-usage.mocha.ts index ad000d42db2..6380ace0a25 100644 --- a/docs/docs/snippets/converters/model-usage.mocha.ts +++ b/docs/docs/snippets/converters/model-usage.mocha.ts @@ -1,5 +1,6 @@ import {deserialize, serialize} from "@tsed/json-mapper"; import {expect} from "chai"; + import {Person} from "./Person"; describe("Person", () => { diff --git a/docs/docs/snippets/converters/model-usage.ts b/docs/docs/snippets/converters/model-usage.ts index 664cf028ff9..0c7c4c02003 100644 --- a/docs/docs/snippets/converters/model-usage.ts +++ b/docs/docs/snippets/converters/model-usage.ts @@ -1,4 +1,4 @@ -import {CollectionOf, Minimum, Property, Description} from "@tsed/schema"; +import {CollectionOf, Description, Minimum, Property} from "@tsed/schema"; export class Person { @Property() diff --git a/docs/docs/snippets/converters/server-moment-mapper-import.ts b/docs/docs/snippets/converters/server-moment-mapper-import.ts index 8e2f159165c..d7e4f5420ab 100644 --- a/docs/docs/snippets/converters/server-moment-mapper-import.ts +++ b/docs/docs/snippets/converters/server-moment-mapper-import.ts @@ -1,5 +1,6 @@ -import {Configuration} from "@tsed/di"; import "./mappers/MomentMapper.js"; // just import mapper to be available +import {Configuration} from "@tsed/di"; + @Configuration({}) export class Server {} diff --git a/docs/docs/snippets/exceptions/custom-exception-usage.ts b/docs/docs/snippets/exceptions/custom-exception-usage.ts index 1544d0c1309..364a65775d9 100644 --- a/docs/docs/snippets/exceptions/custom-exception-usage.ts +++ b/docs/docs/snippets/exceptions/custom-exception-usage.ts @@ -1,8 +1,9 @@ +import {Controller, Inject} from "@tsed/di"; import {PathParams} from "@tsed/platform-params"; import {Get} from "@tsed/schema"; -import {Controller, Inject} from "@tsed/di"; -import {CalendarsService} from "../services/CalendarsService"; + import {IDFormatException} from "../errors/IDFormatException"; +import {CalendarsService} from "../services/CalendarsService"; @Controller("/calendars") export class CalendarCtrl { diff --git a/docs/docs/snippets/exceptions/error-filter.ts b/docs/docs/snippets/exceptions/error-filter.ts index 16d189bf473..30c4a3f0209 100644 --- a/docs/docs/snippets/exceptions/error-filter.ts +++ b/docs/docs/snippets/exceptions/error-filter.ts @@ -1,6 +1,6 @@ import {PlatformContext, ResponseErrorObject} from "@tsed/common"; -import {Catch, ExceptionFilterMethods} from "@tsed/platform-exceptions"; import {Exception} from "@tsed/exceptions"; +import {Catch, ExceptionFilterMethods} from "@tsed/platform-exceptions"; @Catch(Error, Exception) export class ErrorFilter implements ExceptionFilterMethods { diff --git a/docs/docs/snippets/exceptions/http-exception-filter.ts b/docs/docs/snippets/exceptions/http-exception-filter.ts index 96fc7cb95c1..7a3f70a9254 100644 --- a/docs/docs/snippets/exceptions/http-exception-filter.ts +++ b/docs/docs/snippets/exceptions/http-exception-filter.ts @@ -1,6 +1,6 @@ import {PlatformContext, ResponseErrorObject} from "@tsed/common"; -import {Catch, ExceptionFilterMethods} from "@tsed/platform-exceptions"; import {Exception} from "@tsed/exceptions"; +import {Catch, ExceptionFilterMethods} from "@tsed/platform-exceptions"; @Catch(Exception) export class HttpExceptionFilter implements ExceptionFilterMethods { diff --git a/docs/docs/snippets/exceptions/usage-controller.ts b/docs/docs/snippets/exceptions/usage-controller.ts index f60e183751b..6711274facb 100644 --- a/docs/docs/snippets/exceptions/usage-controller.ts +++ b/docs/docs/snippets/exceptions/usage-controller.ts @@ -1,7 +1,8 @@ -import {PathParams} from "@tsed/platform-params"; -import {Get} from "@tsed/schema"; import {Controller, Inject} from "@tsed/di"; import {BadRequest, NotFound} from "@tsed/exceptions"; +import {PathParams} from "@tsed/platform-params"; +import {Get} from "@tsed/schema"; + import {CalendarsService} from "../services/CalendarsService"; @Controller("/calendars") diff --git a/docs/docs/snippets/exceptions/usage-express-route.ts b/docs/docs/snippets/exceptions/usage-express-route.ts index bf3be8df0b7..68a5cb6e758 100644 --- a/docs/docs/snippets/exceptions/usage-express-route.ts +++ b/docs/docs/snippets/exceptions/usage-express-route.ts @@ -1,5 +1,6 @@ import {BadRequest, Exception, InternalServerError, NotFound} from "@tsed/exceptions"; import * as Express from "express"; + import {getCalendar} from "../services/CalendarService"; const app = Express(); diff --git a/docs/docs/snippets/interceptors/interceptor-example.ts b/docs/docs/snippets/interceptors/interceptor-example.ts index 779ef7cabd8..482e5c694a7 100644 --- a/docs/docs/snippets/interceptors/interceptor-example.ts +++ b/docs/docs/snippets/interceptors/interceptor-example.ts @@ -1,4 +1,4 @@ -import {InterceptorMethods, InterceptorContext, InterceptorNext, Interceptor} from "@tsed/di"; +import {Interceptor, InterceptorContext, InterceptorMethods, InterceptorNext} from "@tsed/di"; @Interceptor() export class MyInterceptor implements InterceptorMethods { diff --git a/docs/docs/snippets/interceptors/interceptor-usage.ts b/docs/docs/snippets/interceptors/interceptor-usage.ts index a27f3d26330..438afe23ed2 100644 --- a/docs/docs/snippets/interceptors/interceptor-usage.ts +++ b/docs/docs/snippets/interceptors/interceptor-usage.ts @@ -1,4 +1,5 @@ -import {Intercept, Injectable} from "@tsed/di"; +import {Injectable, Intercept} from "@tsed/di"; + import {MyInterceptor} from "../interceptors/MyInterceptor"; @Injectable() diff --git a/docs/docs/snippets/middlewares/accept-mime-usage.ts b/docs/docs/snippets/middlewares/accept-mime-usage.ts index 4f2ec46cc18..8fbd8e2abc3 100644 --- a/docs/docs/snippets/middlewares/accept-mime-usage.ts +++ b/docs/docs/snippets/middlewares/accept-mime-usage.ts @@ -1,6 +1,6 @@ -import {Get} from "@tsed/schema"; -import {Controller} from "@tsed/di"; import {AcceptMime} from "@tsed/common"; +import {Controller} from "@tsed/di"; +import {Get} from "@tsed/schema"; @Controller("/mypath") export class MyCtrl { diff --git a/docs/docs/snippets/middlewares/call-sequences.ts b/docs/docs/snippets/middlewares/call-sequences.ts index 9c0f37dfb6b..2b28b7752bd 100644 --- a/docs/docs/snippets/middlewares/call-sequences.ts +++ b/docs/docs/snippets/middlewares/call-sequences.ts @@ -1,7 +1,7 @@ import {Next} from "@tsed/common"; +import {Controller} from "@tsed/di"; import {Use, UseAfter, UseBefore, UseBeforeEach} from "@tsed/platform-middlewares"; import {Get} from "@tsed/schema"; -import {Controller} from "@tsed/di"; @Controller("/") @UseAfter(MdlwCtrlAfter) diff --git a/docs/docs/snippets/middlewares/custom-endpoint-decorator-accept-mime.ts b/docs/docs/snippets/middlewares/custom-endpoint-decorator-accept-mime.ts index ea614ae3212..79b3d1502e9 100644 --- a/docs/docs/snippets/middlewares/custom-endpoint-decorator-accept-mime.ts +++ b/docs/docs/snippets/middlewares/custom-endpoint-decorator-accept-mime.ts @@ -1,6 +1,6 @@ import {PlatformAcceptMimesMiddleware} from "@tsed/common"; +import {StoreSet, useDecorators} from "@tsed/core"; import {UseBefore} from "@tsed/platform-middlewares"; -import {useDecorators, StoreSet} from "@tsed/core"; export function AcceptMime(...mimes: string[]): Function { return useDecorators(StoreSet(PlatformAcceptMimesMiddleware, mimes), UseBefore(PlatformAcceptMimesMiddleware)); diff --git a/docs/docs/snippets/middlewares/custom-endpoint-decorator-status.ts b/docs/docs/snippets/middlewares/custom-endpoint-decorator-status.ts index d5ce626c1ba..1d28c54df08 100644 --- a/docs/docs/snippets/middlewares/custom-endpoint-decorator-status.ts +++ b/docs/docs/snippets/middlewares/custom-endpoint-decorator-status.ts @@ -1,5 +1,5 @@ -import {UseAfter} from "@tsed/platform-middlewares"; import {useDecorators} from "@tsed/core"; +import {UseAfter} from "@tsed/platform-middlewares"; export function CustomStatus(code: number) { return useDecorators( diff --git a/docs/docs/snippets/middlewares/endpoint-middleware-decorator.ts b/docs/docs/snippets/middlewares/endpoint-middleware-decorator.ts index 72ad4266f66..1dfd3e40765 100644 --- a/docs/docs/snippets/middlewares/endpoint-middleware-decorator.ts +++ b/docs/docs/snippets/middlewares/endpoint-middleware-decorator.ts @@ -1,5 +1,6 @@ -import {UseBefore} from "@tsed/platform-middlewares"; import {StoreSet, useDecorators} from "@tsed/core"; +import {UseBefore} from "@tsed/platform-middlewares"; + import {AcceptMimesMiddleware} from "../middlewares/AcceptMimesMiddleware"; export function Accept(...mimes: string[]) { diff --git a/docs/docs/snippets/middlewares/endpoint-middleware-usage.ts b/docs/docs/snippets/middlewares/endpoint-middleware-usage.ts index e213a67e41a..a14ef3d660a 100644 --- a/docs/docs/snippets/middlewares/endpoint-middleware-usage.ts +++ b/docs/docs/snippets/middlewares/endpoint-middleware-usage.ts @@ -1,5 +1,6 @@ -import {Get} from "@tsed/schema"; import {Controller} from "@tsed/di"; +import {Get} from "@tsed/schema"; + import {Accept} from "../decorators/Accept"; @Controller("/test") diff --git a/docs/docs/snippets/middlewares/endpoint-middleware.ts b/docs/docs/snippets/middlewares/endpoint-middleware.ts index dfa9964ce86..eff16b40aec 100644 --- a/docs/docs/snippets/middlewares/endpoint-middleware.ts +++ b/docs/docs/snippets/middlewares/endpoint-middleware.ts @@ -1,6 +1,6 @@ -import {Context} from "@tsed/platform-params"; -import {MiddlewareMethods, Middleware} from "@tsed/platform-middlewares"; import {NotAcceptable} from "@tsed/exceptions"; +import {Middleware, MiddlewareMethods} from "@tsed/platform-middlewares"; +import {Context} from "@tsed/platform-params"; @Middleware() export class AcceptMimesMiddleware implements MiddlewareMethods { diff --git a/docs/docs/snippets/middlewares/endpoint-use-decorator-usage.ts b/docs/docs/snippets/middlewares/endpoint-use-decorator-usage.ts index 78d0319bd3b..eaa0f1c917b 100644 --- a/docs/docs/snippets/middlewares/endpoint-use-decorator-usage.ts +++ b/docs/docs/snippets/middlewares/endpoint-use-decorator-usage.ts @@ -1,6 +1,7 @@ +import {Controller} from "@tsed/di"; import {UseBefore} from "@tsed/platform-middlewares"; import {Get} from "@tsed/schema"; -import {Controller} from "@tsed/di"; + import {CustomMiddleware} from "./middlewares/CustomMiddleware"; @Controller("/test") diff --git a/docs/docs/snippets/middlewares/global-middleware-configuration.ts b/docs/docs/snippets/middlewares/global-middleware-configuration.ts index a5ece319d99..391cc2a9973 100644 --- a/docs/docs/snippets/middlewares/global-middleware-configuration.ts +++ b/docs/docs/snippets/middlewares/global-middleware-configuration.ts @@ -1,5 +1,6 @@ import {PlatformApplication} from "@tsed/common"; import {Configuration, Inject} from "@tsed/di"; + import {GlobalAcceptMimeMiddleware} from "./GlobalAcceptMimeMiddleware"; @Configuration({ diff --git a/docs/docs/snippets/middlewares/global-middleware-error.ts b/docs/docs/snippets/middlewares/global-middleware-error.ts index 12d1a082a2e..4f53be136a3 100644 --- a/docs/docs/snippets/middlewares/global-middleware-error.ts +++ b/docs/docs/snippets/middlewares/global-middleware-error.ts @@ -1,7 +1,7 @@ import {Err, Req, Res} from "@tsed/common"; -import {Middleware} from "@tsed/platform-middlewares"; import {Exception} from "@tsed/exceptions"; import {$log} from "@tsed/logger"; +import {Middleware} from "@tsed/platform-middlewares"; @Middleware() export class GlobalErrorHandlerMiddleware { diff --git a/docs/docs/snippets/middlewares/global-middleware.ts b/docs/docs/snippets/middlewares/global-middleware.ts index 1e902fb8ff4..c74fc92d5d1 100644 --- a/docs/docs/snippets/middlewares/global-middleware.ts +++ b/docs/docs/snippets/middlewares/global-middleware.ts @@ -1,7 +1,7 @@ -import {Context} from "@tsed/platform-params"; import {Constant} from "@tsed/di"; -import {MiddlewareMethods, Middleware} from "@tsed/platform-middlewares"; import {NotAcceptable} from "@tsed/exceptions"; +import {Middleware, MiddlewareMethods} from "@tsed/platform-middlewares"; +import {Context} from "@tsed/platform-params"; @Middleware() export default class AcceptMimesMiddleware implements MiddlewareMethods { diff --git a/docs/docs/snippets/middlewares/middleware-example.ts b/docs/docs/snippets/middlewares/middleware-example.ts index 4e2b622a028..d142c4d6a9c 100644 --- a/docs/docs/snippets/middlewares/middleware-example.ts +++ b/docs/docs/snippets/middlewares/middleware-example.ts @@ -1,5 +1,5 @@ -import {Context} from "@tsed/platform-params"; import {Middleware} from "@tsed/platform-middlewares"; +import {Context} from "@tsed/platform-params"; @Middleware() export class CustomMiddleware { diff --git a/docs/docs/snippets/middlewares/override-middleware.ts b/docs/docs/snippets/middlewares/override-middleware.ts index aa3293393af..fb97c412aac 100644 --- a/docs/docs/snippets/middlewares/override-middleware.ts +++ b/docs/docs/snippets/middlewares/override-middleware.ts @@ -1,6 +1,6 @@ import {OriginalMiddleware} from "@tsed/common"; -import {Context} from "@tsed/platform-params"; import {OverrideProvider} from "@tsed/di"; +import {Context} from "@tsed/platform-params"; @OverrideProvider(OriginalMiddleware) export class CustomMiddleware extends OriginalMiddleware { diff --git a/docs/docs/snippets/middlewares/server-configuration.ts b/docs/docs/snippets/middlewares/server-configuration.ts index 73af7e8e794..869593bb123 100644 --- a/docs/docs/snippets/middlewares/server-configuration.ts +++ b/docs/docs/snippets/middlewares/server-configuration.ts @@ -1,4 +1,5 @@ import {Configuration} from "@tsed/di"; + import {MyController} from "./controllers/rest/MyController"; @Configuration({ diff --git a/docs/docs/snippets/model/collections.ts b/docs/docs/snippets/model/collections.ts index 7536c64d108..e6e571ef40a 100644 --- a/docs/docs/snippets/model/collections.ts +++ b/docs/docs/snippets/model/collections.ts @@ -1,4 +1,5 @@ import {CollectionOf, getJsonSchema} from "@tsed/schema"; + import {Model} from "./primitives"; import {Role} from "./Role"; import {Security} from "./Security"; diff --git a/docs/docs/snippets/model/controller.ts b/docs/docs/snippets/model/controller.ts index 1ca4e7a9804..4171b4b686c 100644 --- a/docs/docs/snippets/model/controller.ts +++ b/docs/docs/snippets/model/controller.ts @@ -1,6 +1,7 @@ +import {Controller} from "@tsed/di"; import {BodyParams} from "@tsed/platform-params"; import {Post} from "@tsed/schema"; -import {Controller} from "@tsed/di"; + import {PersonModel} from "../models/PersonModel"; @Controller("/") diff --git a/docs/docs/snippets/model/functional-schema-controller.ts b/docs/docs/snippets/model/functional-schema-controller.ts index 46bc2980418..04292de5023 100644 --- a/docs/docs/snippets/model/functional-schema-controller.ts +++ b/docs/docs/snippets/model/functional-schema-controller.ts @@ -1,6 +1,6 @@ +import {Controller} from "@tsed/di"; import {BodyParams} from "@tsed/platform-params"; import {Post} from "@tsed/schema"; -import {Controller} from "@tsed/di"; import {array, number, object, Returns, Schema, string} from "@tsed/schema"; const ProductSchema = object({ @@ -14,7 +14,7 @@ const ProductSchema = object({ @Controller("/") class MyController { @Post("/") - @Returns(200).Description("description").Schema(ProductSchema) + @(Returns(200).Description("description").Schema(ProductSchema)) async method(@BodyParams() @Schema(ProductSchema) product: any): Promise { return null; } diff --git a/docs/docs/snippets/model/generics-controller1.ts b/docs/docs/snippets/model/generics-controller1.ts index 02e8edf6ff4..6280fa17741 100644 --- a/docs/docs/snippets/model/generics-controller1.ts +++ b/docs/docs/snippets/model/generics-controller1.ts @@ -1,12 +1,13 @@ -import {Post, Returns} from "@tsed/schema"; import {Controller} from "@tsed/di"; +import {Post, Returns} from "@tsed/schema"; + import {Pagination} from "../models/Pagination"; import {Product} from "../models/Product"; @Controller("/") class MyController { @Post("/") - @Returns(200, Pagination).Of(Product).Description("description") + @(Returns(200, Pagination).Of(Product).Description("description")) async method(): Promise | null> { return null; } diff --git a/docs/docs/snippets/model/get-spec-generics-controller1.ts b/docs/docs/snippets/model/get-spec-generics-controller1.ts index 91ba8725bab..491b5418b2c 100644 --- a/docs/docs/snippets/model/get-spec-generics-controller1.ts +++ b/docs/docs/snippets/model/get-spec-generics-controller1.ts @@ -1,12 +1,13 @@ -import {getSpec, Post, Returns, SpecTypes} from "@tsed/schema"; import {Controller} from "@tsed/di"; +import {getSpec, Post, Returns, SpecTypes} from "@tsed/schema"; + import {Pagination} from "../models/Pagination"; import {Product} from "../models/Product"; @Controller("/") class MyController { @Post("/") - @Returns(200, Pagination).Of(Product).Description("description") + @(Returns(200, Pagination).Of(Product).Description("description")) async method(): Promise | null> { return null; } diff --git a/docs/docs/snippets/model/group-users-ctrl-on-class.ts b/docs/docs/snippets/model/group-users-ctrl-on-class.ts index 2e1cb5f653b..f450af1f754 100644 --- a/docs/docs/snippets/model/group-users-ctrl-on-class.ts +++ b/docs/docs/snippets/model/group-users-ctrl-on-class.ts @@ -1,16 +1,17 @@ +import {Controller} from "@tsed/di"; import {BodyParams, PathParams} from "@tsed/platform-params"; import {Get, Groups, Post, Returns} from "@tsed/schema"; -import {Controller} from "@tsed/di"; + import {User} from "../models/User"; @Controller("/") export class UsersCtrl { @Get("/:id") - @Returns(200, User).Groups("update") + @(Returns(200, User).Groups("update")) async get(@PathParams("id") id: string) {} @Post("/") - @Returns(201, User).Groups("update") + @(Returns(201, User).Groups("update")) async post(@BodyParams() @Groups("creation") user: User) { console.log(user); user.id = uuid(); diff --git a/docs/docs/snippets/model/group-users-ctrl.ts b/docs/docs/snippets/model/group-users-ctrl.ts index 2d7ff2fb70d..1b2ccd1e19a 100644 --- a/docs/docs/snippets/model/group-users-ctrl.ts +++ b/docs/docs/snippets/model/group-users-ctrl.ts @@ -1,16 +1,17 @@ +import {Controller} from "@tsed/di"; import {BodyParams, PathParams} from "@tsed/platform-params"; import {Get, Groups, Post, Returns} from "@tsed/schema"; -import {Controller} from "@tsed/di"; + import {User} from "../models/User"; @Controller("/") export class UsersCtrl { @Get("/:id") - @Returns(200, User).Groups("group.*") + @(Returns(200, User).Groups("group.*")) async get(@PathParams("id") id: string) {} @Post("/") - @Returns(201, User).Groups("group.*") + @(Returns(201, User).Groups("group.*")) async post(@BodyParams() @Groups("creation") user: User) { console.log(user); // User {firstName, lastName, email, password} user.id = uuid(); diff --git a/docs/docs/snippets/model/name.ts b/docs/docs/snippets/model/name.ts index 689d339748b..270545e0710 100644 --- a/docs/docs/snippets/model/name.ts +++ b/docs/docs/snippets/model/name.ts @@ -1,5 +1,5 @@ -import {Description, Example, Name} from "@tsed/schema"; import {ObjectID} from "@tsed/mongoose"; +import {Description, Example, Name} from "@tsed/schema"; export class Model { @Name("id") diff --git a/docs/docs/snippets/model/nullable-properties.ts b/docs/docs/snippets/model/nullable-properties.ts index 6fec0766cb5..dedc4e6a417 100644 --- a/docs/docs/snippets/model/nullable-properties.ts +++ b/docs/docs/snippets/model/nullable-properties.ts @@ -1,4 +1,5 @@ import {Nullable, Required} from "@tsed/schema"; + import {MyModel, MyModel2} from "./MyModel"; export class Model { diff --git a/docs/docs/snippets/model/pagination-ctrl.ts b/docs/docs/snippets/model/pagination-ctrl.ts index 308d6166b41..ab9ad5fa040 100644 --- a/docs/docs/snippets/model/pagination-ctrl.ts +++ b/docs/docs/snippets/model/pagination-ctrl.ts @@ -1,6 +1,7 @@ +import {Controller} from "@tsed/di"; import {QueryParams} from "@tsed/platform-params"; import {Get, Returns} from "@tsed/schema"; -import {Controller} from "@tsed/di"; + import {Pageable} from "../models/Pageable"; import {Pagination} from "../models/Pagination"; import {Product} from "../models/Product"; @@ -8,8 +9,8 @@ import {Product} from "../models/Product"; @Controller("/pageable") class ProductsCtrl { @Get("/") - @Returns(206, Pagination).Of(Product).Title("PaginatedProduct") - @Returns(200, Pagination).Of(Product).Title("PaginatedProduct") + @(Returns(206, Pagination).Of(Product).Title("PaginatedProduct")) + @(Returns(200, Pagination).Of(Product).Title("PaginatedProduct")) async get(@QueryParams() pageableOptions: Pageable, @QueryParams("all") all: boolean) { return new Pagination({ data: [ diff --git a/docs/docs/snippets/model/pagination-filter.ts b/docs/docs/snippets/model/pagination-filter.ts index 5626afb9530..c6eaf50bb36 100644 --- a/docs/docs/snippets/model/pagination-filter.ts +++ b/docs/docs/snippets/model/pagination-filter.ts @@ -1,5 +1,6 @@ import {PlatformContext} from "@tsed/common"; import {ResponseFilter, ResponseFilterMethods} from "@tsed/platform-response-filter"; + import {Pagination} from "../models/Pagination"; @ResponseFilter("application/json") diff --git a/docs/docs/snippets/model/pagination-model.ts b/docs/docs/snippets/model/pagination-model.ts index fa9c0bd5877..abf06671821 100644 --- a/docs/docs/snippets/model/pagination-model.ts +++ b/docs/docs/snippets/model/pagination-model.ts @@ -1,4 +1,5 @@ import {CollectionOf, Default, Generics, Integer, MinLength} from "@tsed/schema"; + import {Pageable} from "./Pageable"; export class PaginationLink { diff --git a/docs/docs/snippets/model/pagination-spec.ts b/docs/docs/snippets/model/pagination-spec.ts index 0e4ab2c7d78..e0155322066 100644 --- a/docs/docs/snippets/model/pagination-spec.ts +++ b/docs/docs/snippets/model/pagination-spec.ts @@ -2,9 +2,10 @@ import {PlatformTest} from "@tsed/common"; import {getSpec, SpecTypes} from "@tsed/schema"; import * as qs from "querystring"; import * as SuperTest from "supertest"; + import {PaginationFilter} from "../filters/PaginationFilter"; -import {ProductsCtrl} from "./ProductsCtrl"; import {Server} from "./app/Server"; +import {ProductsCtrl} from "./ProductsCtrl"; describe("ProductsCtrl", () => { let request: SuperTest.Agent; diff --git a/docs/docs/snippets/model/raw-schema-controller.ts b/docs/docs/snippets/model/raw-schema-controller.ts index 5c1a6b3ed8e..3cbb09a6a2f 100644 --- a/docs/docs/snippets/model/raw-schema-controller.ts +++ b/docs/docs/snippets/model/raw-schema-controller.ts @@ -1,6 +1,6 @@ +import {Controller} from "@tsed/di"; import {BodyParams} from "@tsed/platform-params"; import {JsonSchemaObject, Post, Returns, Schema} from "@tsed/schema"; -import {Controller} from "@tsed/di"; const ProductSchema: JsonSchemaObject = { type: "object", @@ -19,7 +19,7 @@ export class MyModel { @Controller("/") class MyController { @Post("/") - @Returns(200).Description("description").Schema(ProductSchema) + @(Returns(200).Description("description").Schema(ProductSchema)) async method(@BodyParams() @Schema(ProductSchema) product: any): Promise { return null; } diff --git a/docs/docs/snippets/pipes/async-transformer-pipe-usage.ts b/docs/docs/snippets/pipes/async-transformer-pipe-usage.ts index 729ba8718b1..93b0ee48efc 100644 --- a/docs/docs/snippets/pipes/async-transformer-pipe-usage.ts +++ b/docs/docs/snippets/pipes/async-transformer-pipe-usage.ts @@ -1,6 +1,7 @@ +import {Controller} from "@tsed/di"; import {RawPathParams, UsePipe} from "@tsed/platform-params"; import {Put} from "@tsed/schema"; -import {Controller} from "@tsed/di"; + import {PersonModel} from "../models/PersonModel"; import {PersonPipe} from "../services/PersonPipe"; diff --git a/docs/docs/snippets/pipes/async-transformer-pipe-with-options.ts b/docs/docs/snippets/pipes/async-transformer-pipe-with-options.ts index a4174698151..3724e373cee 100644 --- a/docs/docs/snippets/pipes/async-transformer-pipe-with-options.ts +++ b/docs/docs/snippets/pipes/async-transformer-pipe-with-options.ts @@ -1,6 +1,7 @@ import {Inject, Injectable} from "@tsed/di"; import {NotFound} from "@tsed/exceptions"; import {JsonParameterStore, PipeMethods} from "@tsed/schema"; + import {IUsePersonParamOptions} from "../decorators/UsePersonParam"; import {PersonModel} from "../models/PersonModel"; import {PersonsService} from "../models/PersonsService"; diff --git a/docs/docs/snippets/pipes/async-transformer-pipe.ts b/docs/docs/snippets/pipes/async-transformer-pipe.ts index ab27f28c3b6..37221c3794d 100644 --- a/docs/docs/snippets/pipes/async-transformer-pipe.ts +++ b/docs/docs/snippets/pipes/async-transformer-pipe.ts @@ -1,6 +1,7 @@ -import {JsonParameterStore, PipeMethods} from "@tsed/schema"; import {Inject, Injectable} from "@tsed/di"; import {NotFound} from "@tsed/exceptions"; +import {JsonParameterStore, PipeMethods} from "@tsed/schema"; + import {PersonModel} from "../models/PersonModel"; import {PersonsService} from "../models/PersonsService"; diff --git a/docs/docs/snippets/pipes/controller-model-validation.ts b/docs/docs/snippets/pipes/controller-model-validation.ts index fcb64eb71f5..22b8641a3a8 100644 --- a/docs/docs/snippets/pipes/controller-model-validation.ts +++ b/docs/docs/snippets/pipes/controller-model-validation.ts @@ -1,7 +1,8 @@ -import {Post} from "@tsed/schema"; import {Controller} from "@tsed/di"; -import {BodyParams} from "./body-params"; +import {Post} from "@tsed/schema"; + import {PersonModel} from "../models/PersonModel"; +import {BodyParams} from "./body-params"; @Controller("/persons") export class PersonsController { diff --git a/docs/docs/snippets/pipes/pipes-decorator-with-options.ts b/docs/docs/snippets/pipes/pipes-decorator-with-options.ts index f47e2390c72..65c0cf6e733 100644 --- a/docs/docs/snippets/pipes/pipes-decorator-with-options.ts +++ b/docs/docs/snippets/pipes/pipes-decorator-with-options.ts @@ -1,5 +1,6 @@ -import {RawPathParams, UsePipe} from "@tsed/platform-params"; import {useDecorators} from "@tsed/core"; +import {RawPathParams, UsePipe} from "@tsed/platform-params"; + import {PersonPipe} from "../services/PersonPipe"; export interface IUsePersonParamOptions { diff --git a/docs/docs/snippets/pipes/pipes-decorator.ts b/docs/docs/snippets/pipes/pipes-decorator.ts index f886bc3874c..5b620ff9f25 100644 --- a/docs/docs/snippets/pipes/pipes-decorator.ts +++ b/docs/docs/snippets/pipes/pipes-decorator.ts @@ -1,5 +1,6 @@ -import {RawPathParams, UsePipe} from "@tsed/platform-params"; import {useDecorators} from "@tsed/core"; +import {RawPathParams, UsePipe} from "@tsed/platform-params"; + import {PersonPipe} from "../services/PersonPipe"; export function UsePersonParam(expression: string): ParameterDecorator { diff --git a/docs/docs/snippets/pipes/transformer-pipe-usage.ts b/docs/docs/snippets/pipes/transformer-pipe-usage.ts index ed942a29759..76f4aed6fff 100644 --- a/docs/docs/snippets/pipes/transformer-pipe-usage.ts +++ b/docs/docs/snippets/pipes/transformer-pipe-usage.ts @@ -1,6 +1,7 @@ +import {Controller, Inject} from "@tsed/di"; import {RawPathParams, UsePipe} from "@tsed/platform-params"; import {Get} from "@tsed/schema"; -import {Controller, Inject} from "@tsed/di"; + import {ParseIntPipe} from "../pipes/ParseIntPipe"; import {PersonsService} from "../services/PersonsService"; diff --git a/docs/docs/snippets/pipes/transformer-pipe.ts b/docs/docs/snippets/pipes/transformer-pipe.ts index 9712831f611..d58ae81e8db 100644 --- a/docs/docs/snippets/pipes/transformer-pipe.ts +++ b/docs/docs/snippets/pipes/transformer-pipe.ts @@ -1,6 +1,6 @@ +import {Injectable} from "@tsed/di"; import {ValidationError} from "@tsed/platform-params"; import {JsonParameterStore, PipeMethods} from "@tsed/schema"; -import {Injectable} from "@tsed/di"; @Injectable() export class ParseIntPipe implements PipeMethods { diff --git a/docs/docs/snippets/pipes/use-params.ts b/docs/docs/snippets/pipes/use-params.ts index 885baf0d6bf..04c35579c56 100644 --- a/docs/docs/snippets/pipes/use-params.ts +++ b/docs/docs/snippets/pipes/use-params.ts @@ -1,5 +1,5 @@ -import {ParamOptions, UseDeserialization, UseParamType, UseType, UseValidation} from "@tsed/platform-params"; import {useDecorators} from "@tsed/core"; +import {ParamOptions, UseDeserialization, UseParamType, UseType, UseValidation} from "@tsed/platform-params"; export function UseParam(options: ParamOptions): ParameterDecorator { return useDecorators( diff --git a/docs/docs/snippets/pipes/validation-pipe-identity.ts b/docs/docs/snippets/pipes/validation-pipe-identity.ts index aaf5cfc33b3..ecdfc3d7ca4 100644 --- a/docs/docs/snippets/pipes/validation-pipe-identity.ts +++ b/docs/docs/snippets/pipes/validation-pipe-identity.ts @@ -1,5 +1,5 @@ -import {JsonParameterStore, PipeMethods} from "@tsed/schema"; import {Injectable} from "@tsed/di"; +import {JsonParameterStore, PipeMethods} from "@tsed/schema"; @Injectable() export class ValidationPipe implements PipeMethods { diff --git a/docs/docs/snippets/pipes/validation-pipe-with-ajv.ts b/docs/docs/snippets/pipes/validation-pipe-with-ajv.ts index 9404fb1227e..c318a97b4d2 100644 --- a/docs/docs/snippets/pipes/validation-pipe-with-ajv.ts +++ b/docs/docs/snippets/pipes/validation-pipe-with-ajv.ts @@ -1,6 +1,6 @@ +import {Injectable} from "@tsed/di"; import {ValidationError} from "@tsed/platform-params"; import {getJsonSchema, JsonParameterStore, PipeMethods} from "@tsed/schema"; -import {Injectable} from "@tsed/di"; import * as Ajv from "ajv"; @Injectable() diff --git a/docs/docs/snippets/providers/binding-configuration.ts b/docs/docs/snippets/providers/binding-configuration.ts index 317afd51e80..e4d4c9e7d1b 100644 --- a/docs/docs/snippets/providers/binding-configuration.ts +++ b/docs/docs/snippets/providers/binding-configuration.ts @@ -1,5 +1,5 @@ -import {Constant, Value} from "@tsed/di"; import {Env} from "@tsed/core"; +import {Constant, Value} from "@tsed/di"; export class MyClass { @Constant("env") diff --git a/docs/docs/snippets/providers/custom-provider-use-class-usage.ts b/docs/docs/snippets/providers/custom-provider-use-class-usage.ts index d97560a7f3d..0257ee311a4 100644 --- a/docs/docs/snippets/providers/custom-provider-use-class-usage.ts +++ b/docs/docs/snippets/providers/custom-provider-use-class-usage.ts @@ -1,4 +1,5 @@ import {Injectable} from "@tsed/di"; + import {ConfigService} from "./ConfigService"; @Injectable() diff --git a/docs/docs/snippets/providers/custom-provider-use-value-usage.ts b/docs/docs/snippets/providers/custom-provider-use-value-usage.ts index befc2e28203..6a4f7609804 100644 --- a/docs/docs/snippets/providers/custom-provider-use-value-usage.ts +++ b/docs/docs/snippets/providers/custom-provider-use-value-usage.ts @@ -1,4 +1,5 @@ import {Inject, Injectable} from "@tsed/di"; + import {CONNECTION} from "./connection"; @Injectable() diff --git a/docs/docs/snippets/providers/getting-started-controller.ts b/docs/docs/snippets/providers/getting-started-controller.ts index dc2207d1db4..98e2da52538 100644 --- a/docs/docs/snippets/providers/getting-started-controller.ts +++ b/docs/docs/snippets/providers/getting-started-controller.ts @@ -1,6 +1,7 @@ +import {Controller} from "@tsed/di"; import {BodyParams} from "@tsed/platform-params"; import {Get, Post} from "@tsed/schema"; -import {Controller} from "@tsed/di"; + import {Calendar} from "../models/Calendar"; import {CalendarsService} from "../services/CalendarsService"; diff --git a/docs/docs/snippets/providers/getting-started-injectable.ts b/docs/docs/snippets/providers/getting-started-injectable.ts index de64c72a83f..79502c309de 100644 --- a/docs/docs/snippets/providers/getting-started-injectable.ts +++ b/docs/docs/snippets/providers/getting-started-injectable.ts @@ -1,4 +1,5 @@ import {Injectable, ProviderScope, ProviderType} from "@tsed/di"; + import {Calendar} from "../models/Calendar"; @Injectable({ diff --git a/docs/docs/snippets/providers/getting-started-serverloader.ts b/docs/docs/snippets/providers/getting-started-serverloader.ts index a70e7eb9728..705fe76cd79 100644 --- a/docs/docs/snippets/providers/getting-started-serverloader.ts +++ b/docs/docs/snippets/providers/getting-started-serverloader.ts @@ -1,4 +1,5 @@ import {Configuration} from "@tsed/di"; + import {CalendarsController} from "./controllers/CalendarsController"; @Configuration({ diff --git a/docs/docs/snippets/providers/getting-started-service.ts b/docs/docs/snippets/providers/getting-started-service.ts index 54a76db0054..96432d9034f 100644 --- a/docs/docs/snippets/providers/getting-started-service.ts +++ b/docs/docs/snippets/providers/getting-started-service.ts @@ -1,4 +1,5 @@ import {Injectable} from "@tsed/di"; + import {Calendar} from "../models/Calendar"; @Injectable() diff --git a/docs/docs/snippets/providers/scope-chain-fail.ts b/docs/docs/snippets/providers/scope-chain-fail.ts index e4a24706723..e2b885aac28 100644 --- a/docs/docs/snippets/providers/scope-chain-fail.ts +++ b/docs/docs/snippets/providers/scope-chain-fail.ts @@ -1,5 +1,5 @@ -import {Get} from "@tsed/schema"; import {Controller, Injectable, ProviderScope, Scope} from "@tsed/di"; +import {Get} from "@tsed/schema"; @Injectable() @Scope(ProviderScope.REQUEST) diff --git a/docs/docs/snippets/providers/scope-chain.ts b/docs/docs/snippets/providers/scope-chain.ts index ae926acfe30..30dcc471fd8 100644 --- a/docs/docs/snippets/providers/scope-chain.ts +++ b/docs/docs/snippets/providers/scope-chain.ts @@ -1,5 +1,5 @@ -import {Get} from "@tsed/schema"; import {Controller, Injectable, ProviderScope, Scope} from "@tsed/di"; +import {Get} from "@tsed/schema"; @Injectable() @Scope(ProviderScope.REQUEST) diff --git a/docs/docs/snippets/providers/scope-instance.ts b/docs/docs/snippets/providers/scope-instance.ts index 5d54ede7a6e..7650c8bdf87 100644 --- a/docs/docs/snippets/providers/scope-instance.ts +++ b/docs/docs/snippets/providers/scope-instance.ts @@ -1,5 +1,5 @@ -import {Get} from "@tsed/schema"; import {Controller, Injectable, ProviderScope, Scope} from "@tsed/di"; +import {Get} from "@tsed/schema"; @Injectable() @Scope(ProviderScope.INSTANCE) diff --git a/docs/docs/snippets/providers/scope-request.ts b/docs/docs/snippets/providers/scope-request.ts index acf44e9a44a..9c5f9766cec 100644 --- a/docs/docs/snippets/providers/scope-request.ts +++ b/docs/docs/snippets/providers/scope-request.ts @@ -1,5 +1,5 @@ -import {Get} from "@tsed/schema"; import {Controller, ProviderScope, Scope} from "@tsed/di"; +import {Get} from "@tsed/schema"; @Controller("/") @Scope(ProviderScope.REQUEST) diff --git a/docs/docs/snippets/providers/scope-singleton.ts b/docs/docs/snippets/providers/scope-singleton.ts index 5a2ae010fae..007db4c86ec 100644 --- a/docs/docs/snippets/providers/scope-singleton.ts +++ b/docs/docs/snippets/providers/scope-singleton.ts @@ -1,5 +1,5 @@ -import {Get} from "@tsed/schema"; import {Controller, ProviderScope, Scope} from "@tsed/di"; +import {Get} from "@tsed/schema"; @Controller("/") @Scope(ProviderScope.SINGLETON) // OPTIONAL, leaving this annotation a the same behavior diff --git a/docs/docs/snippets/request-context/context-example.ts b/docs/docs/snippets/request-context/context-example.ts index ef8a3b173ad..16c1f395fc6 100644 --- a/docs/docs/snippets/request-context/context-example.ts +++ b/docs/docs/snippets/request-context/context-example.ts @@ -1,8 +1,9 @@ -import {Context} from "@tsed/platform-params"; -import {Middleware, UseBefore} from "@tsed/platform-middlewares"; -import {Get} from "@tsed/schema"; import {Controller} from "@tsed/di"; import {Forbidden} from "@tsed/exceptions"; +import {Middleware, UseBefore} from "@tsed/platform-middlewares"; +import {Context} from "@tsed/platform-params"; +import {Get} from "@tsed/schema"; + import {AuthToken} from "../domain/auth/AuthToken"; @Middleware() diff --git a/docs/docs/snippets/templating/response-templating.ts b/docs/docs/snippets/templating/response-templating.ts index c8a61a3ade9..521968c3b6f 100644 --- a/docs/docs/snippets/templating/response-templating.ts +++ b/docs/docs/snippets/templating/response-templating.ts @@ -1,6 +1,6 @@ +import {Controller} from "@tsed/di"; import {View} from "@tsed/platform-views"; import {Get} from "@tsed/schema"; -import {Controller} from "@tsed/di"; @Controller("/events") export class EventsCtrl { diff --git a/docs/docs/snippets/templating/template-cache.ts b/docs/docs/snippets/templating/template-cache.ts index a3d13eba69f..a90a1b7eeca 100644 --- a/docs/docs/snippets/templating/template-cache.ts +++ b/docs/docs/snippets/templating/template-cache.ts @@ -1,6 +1,6 @@ +import {Controller} from "@tsed/di"; import {View} from "@tsed/platform-views"; import {Get} from "@tsed/schema"; -import {Controller} from "@tsed/di"; @Controller("/events") export class EventCtrl { diff --git a/docs/docs/snippets/templating/template-platform-api.ts b/docs/docs/snippets/templating/template-platform-api.ts index 9d6e4bdd2d4..c1897c89221 100644 --- a/docs/docs/snippets/templating/template-platform-api.ts +++ b/docs/docs/snippets/templating/template-platform-api.ts @@ -1,6 +1,6 @@ import {PlatformResponse, Res} from "@tsed/common"; -import {Get} from "@tsed/schema"; import {Controller} from "@tsed/di"; +import {Get} from "@tsed/schema"; @Controller("/events") export class EventsCtrl { diff --git a/docs/docs/snippets/testing/db-service-async-await.jest.ts b/docs/docs/snippets/testing/db-service-async-await.jest.ts index eb4f734c708..591cc69c57d 100644 --- a/docs/docs/snippets/testing/db-service-async-await.jest.ts +++ b/docs/docs/snippets/testing/db-service-async-await.jest.ts @@ -1,4 +1,5 @@ import {PlatformTest} from "@tsed/common"; + import {DbService} from "../services/db"; describe("DbService", () => { diff --git a/docs/docs/snippets/testing/db-service-async-await.legacy.ts b/docs/docs/snippets/testing/db-service-async-await.legacy.ts index 478314b0a85..8767b3db9ab 100644 --- a/docs/docs/snippets/testing/db-service-async-await.legacy.ts +++ b/docs/docs/snippets/testing/db-service-async-await.legacy.ts @@ -1,5 +1,6 @@ import {TestContext} from "@tsed/testing"; import {expect} from "chai"; + import {DbService} from "../services/db"; describe("DbService", () => { diff --git a/docs/docs/snippets/testing/db-service-async-await.mocha.ts b/docs/docs/snippets/testing/db-service-async-await.mocha.ts index 86d5cecf87e..97a2b3cb62c 100644 --- a/docs/docs/snippets/testing/db-service-async-await.mocha.ts +++ b/docs/docs/snippets/testing/db-service-async-await.mocha.ts @@ -1,5 +1,6 @@ import {PlatformTest} from "@tsed/common"; import {expect} from "chai"; + import {DbService} from "../services/db"; describe("DbService", () => { diff --git a/docs/docs/snippets/testing/db-service-async-await.vitest.ts b/docs/docs/snippets/testing/db-service-async-await.vitest.ts index eb4f734c708..591cc69c57d 100644 --- a/docs/docs/snippets/testing/db-service-async-await.vitest.ts +++ b/docs/docs/snippets/testing/db-service-async-await.vitest.ts @@ -1,4 +1,5 @@ import {PlatformTest} from "@tsed/common"; + import {DbService} from "../services/db"; describe("DbService", () => { diff --git a/docs/docs/snippets/testing/db-service-mock-dependencies.jest.ts b/docs/docs/snippets/testing/db-service-mock-dependencies.jest.ts index 7a23b8a2418..87ab074d161 100644 --- a/docs/docs/snippets/testing/db-service-mock-dependencies.jest.ts +++ b/docs/docs/snippets/testing/db-service-mock-dependencies.jest.ts @@ -1,4 +1,5 @@ import {PlatformTest} from "@tsed/common"; + import {MyCtrl} from "../controllers/MyCtrl"; import {DbService} from "../services/DbService"; diff --git a/docs/docs/snippets/testing/db-service-mock-dependencies.legacy.ts b/docs/docs/snippets/testing/db-service-mock-dependencies.legacy.ts index 32ec80fbbe8..9db088d9a78 100644 --- a/docs/docs/snippets/testing/db-service-mock-dependencies.legacy.ts +++ b/docs/docs/snippets/testing/db-service-mock-dependencies.legacy.ts @@ -1,5 +1,6 @@ import {TestContext} from "@tsed/testing"; import {expect} from "chai"; + import {MyCtrl} from "../controllers/MyCtrl"; import {DbService} from "../services/DbService"; diff --git a/docs/docs/snippets/testing/db-service-mock-dependencies.mocha.ts b/docs/docs/snippets/testing/db-service-mock-dependencies.mocha.ts index 2a0f023f8c4..82526b8f0ae 100644 --- a/docs/docs/snippets/testing/db-service-mock-dependencies.mocha.ts +++ b/docs/docs/snippets/testing/db-service-mock-dependencies.mocha.ts @@ -1,5 +1,6 @@ import {PlatformTest} from "@tsed/common"; import {expect} from "chai"; + import {MyCtrl} from "../controllers/MyCtrl"; import {DbService} from "../services/DbService"; diff --git a/docs/docs/snippets/testing/db-service-mock-dependencies.vitest.ts b/docs/docs/snippets/testing/db-service-mock-dependencies.vitest.ts index bbfb7cc9075..68d136b9832 100644 --- a/docs/docs/snippets/testing/db-service-mock-dependencies.vitest.ts +++ b/docs/docs/snippets/testing/db-service-mock-dependencies.vitest.ts @@ -1,5 +1,6 @@ -import {it, expect, describe, beforeEach, afterEach} from "vitest"; import {PlatformTest} from "@tsed/common"; +import {afterEach, beforeEach, describe, expect, it} from "vitest"; + import {MyCtrl} from "../controllers/MyCtrl"; import {DbService} from "../services/DbService"; diff --git a/docs/docs/snippets/testing/parse-service-legacy.spec.ts b/docs/docs/snippets/testing/parse-service-legacy.spec.ts index 0460e46b186..134fff768d4 100644 --- a/docs/docs/snippets/testing/parse-service-legacy.spec.ts +++ b/docs/docs/snippets/testing/parse-service-legacy.spec.ts @@ -1,5 +1,6 @@ -import {expect} from "chai"; import {inject, TestContext} from "@tsed/testing"; +import {expect} from "chai"; + import {ParseService} from "./ParseService"; describe("ParseService", () => { diff --git a/docs/docs/snippets/testing/parse-service.jest.spec.ts b/docs/docs/snippets/testing/parse-service.jest.spec.ts index d459723e859..a3f981de6bd 100644 --- a/docs/docs/snippets/testing/parse-service.jest.spec.ts +++ b/docs/docs/snippets/testing/parse-service.jest.spec.ts @@ -1,5 +1,6 @@ -import {it, expect, describe, beforeEach, afterEach} from "vitest"; import {PlatformTest} from "@tsed/common"; +import {afterEach, beforeEach, describe, expect, it} from "vitest"; + import {ParseService} from "./ParseService"; describe("ParseService", () => { diff --git a/docs/docs/snippets/testing/parse-service.mocha.spec.ts b/docs/docs/snippets/testing/parse-service.mocha.spec.ts index 306a45d7285..316933bb99b 100644 --- a/docs/docs/snippets/testing/parse-service.mocha.spec.ts +++ b/docs/docs/snippets/testing/parse-service.mocha.spec.ts @@ -1,5 +1,6 @@ import {PlatformTest} from "@tsed/common"; import {expect} from "chai"; + import {ParseService} from "./ParseService"; describe("ParseService", () => { diff --git a/docs/docs/snippets/testing/parse-service.vitest.spec.ts b/docs/docs/snippets/testing/parse-service.vitest.spec.ts index d459723e859..a3f981de6bd 100644 --- a/docs/docs/snippets/testing/parse-service.vitest.spec.ts +++ b/docs/docs/snippets/testing/parse-service.vitest.spec.ts @@ -1,5 +1,6 @@ -import {it, expect, describe, beforeEach, afterEach} from "vitest"; import {PlatformTest} from "@tsed/common"; +import {afterEach, beforeEach, describe, expect, it} from "vitest"; + import {ParseService} from "./ParseService"; describe("ParseService", () => { diff --git a/docs/docs/snippets/testing/supertest.legacy.ts b/docs/docs/snippets/testing/supertest.legacy.ts index f97c4caa861..db6aa589567 100644 --- a/docs/docs/snippets/testing/supertest.legacy.ts +++ b/docs/docs/snippets/testing/supertest.legacy.ts @@ -2,6 +2,7 @@ import {ExpressApplication} from "@tsed/common"; import {TestContext} from "@tsed/testing"; import {expect} from "chai"; import * as SuperTest from "supertest"; + import {Server} from "../Server"; describe("Rest", () => { diff --git a/docs/docs/snippets/validation/class-transformer-pipe.ts b/docs/docs/snippets/validation/class-transformer-pipe.ts index 297b86aebb6..3d9f34bfa15 100644 --- a/docs/docs/snippets/validation/class-transformer-pipe.ts +++ b/docs/docs/snippets/validation/class-transformer-pipe.ts @@ -1,6 +1,6 @@ +import {OverrideProvider} from "@tsed/di"; import {DeserializerPipe} from "@tsed/platform-params"; import {JsonParameterStore, PipeMethods} from "@tsed/schema"; -import {OverrideProvider} from "@tsed/di"; import {plainToClass} from "class-transformer"; @OverrideProvider(DeserializerPipe) diff --git a/docs/docs/snippets/validation/class-validator-pipe.ts b/docs/docs/snippets/validation/class-validator-pipe.ts index 8c6a2e8766f..0b1d64eb6b8 100644 --- a/docs/docs/snippets/validation/class-validator-pipe.ts +++ b/docs/docs/snippets/validation/class-validator-pipe.ts @@ -1,6 +1,6 @@ +import {OverrideProvider} from "@tsed/di"; import {ValidationError, ValidationPipe} from "@tsed/platform-params"; import {JsonParameterStore, PipeMethods} from "@tsed/schema"; -import {OverrideProvider} from "@tsed/di"; import {plainToClass} from "class-transformer"; import {validate} from "class-validator"; diff --git a/docs/docs/snippets/validation/joi-pipe-decorator.ts b/docs/docs/snippets/validation/joi-pipe-decorator.ts index 55cbdf2fbad..2b108545718 100644 --- a/docs/docs/snippets/validation/joi-pipe-decorator.ts +++ b/docs/docs/snippets/validation/joi-pipe-decorator.ts @@ -1,5 +1,6 @@ -import {ObjectSchema} from "joi"; import {StoreSet} from "@tsed/core"; +import {ObjectSchema} from "joi"; + import {JoiValidationPipe} from "../pipes/JoiValidationPipe"; export function UseJoiSchema(schema: ObjectSchema) { diff --git a/docs/docs/snippets/validation/joi-pipe-usage.ts b/docs/docs/snippets/validation/joi-pipe-usage.ts index 03020c87c7b..ea069debea6 100644 --- a/docs/docs/snippets/validation/joi-pipe-usage.ts +++ b/docs/docs/snippets/validation/joi-pipe-usage.ts @@ -1,6 +1,7 @@ +import {Controller} from "@tsed/di"; import {BodyParams} from "@tsed/platform-params"; import {Get} from "@tsed/schema"; -import {Controller} from "@tsed/di"; + import {UseJoiSchema} from "../decorators/UseJoiSchema"; import {joiPersonModel, PersonModel} from "../models/PersonModel"; diff --git a/docs/docs/snippets/validation/joi-pipe.ts b/docs/docs/snippets/validation/joi-pipe.ts index b366c85f479..0c457840ec4 100644 --- a/docs/docs/snippets/validation/joi-pipe.ts +++ b/docs/docs/snippets/validation/joi-pipe.ts @@ -1,7 +1,7 @@ -import {ObjectSchema} from "joi"; import {Injectable} from "@tsed/di"; -import {JsonParameterStore, PipeMethods} from "@tsed/schema"; import {ValidationError, ValidationPipe} from "@tsed/platform-params"; +import {JsonParameterStore, PipeMethods} from "@tsed/schema"; +import {ObjectSchema} from "joi"; @OverrideProvider(ValidationPipe) export class JoiValidationPipe implements PipeMethods { diff --git a/docs/docs/snippets/validation/validator-pipe.ts b/docs/docs/snippets/validation/validator-pipe.ts index 90dfad8772f..717acadcad0 100644 --- a/docs/docs/snippets/validation/validator-pipe.ts +++ b/docs/docs/snippets/validation/validator-pipe.ts @@ -1,7 +1,8 @@ +import {OverrideProvider} from "@tsed/di"; import {ValidationError, ValidationPipe} from "@tsed/platform-params"; import {JsonParameterStore, PipeMethods} from "@tsed/schema"; -import {OverrideProvider} from "@tsed/di"; import {getJsonSchema} from "@tsed/schema"; + import {validate} from "./validate"; @OverrideProvider(ValidationPipe) diff --git a/docs/getting-started/snippets/migrate-from-express/bootstrap.ts b/docs/getting-started/snippets/migrate-from-express/bootstrap.ts index cb87ad6d576..200e446c31e 100644 --- a/docs/getting-started/snippets/migrate-from-express/bootstrap.ts +++ b/docs/getting-started/snippets/migrate-from-express/bootstrap.ts @@ -1,7 +1,8 @@ import {$log} from "@tsed/common"; import {PlatformExpress} from "@tsed/platform-express"; -import {Server} from "./server"; + import {expressApp} from "./legacy/server.js"; +import {Server} from "./server"; async function bootstrap() { try { diff --git a/docs/getting-started/snippets/migrate-from-express/server.ts b/docs/getting-started/snippets/migrate-from-express/server.ts index 0f6d5147df8..f4d95d96715 100644 --- a/docs/getting-started/snippets/migrate-from-express/server.ts +++ b/docs/getting-started/snippets/migrate-from-express/server.ts @@ -1,5 +1,5 @@ -import {Configuration, Inject} from "@tsed/di"; import {PlatformApplication} from "@tsed/common"; +import {Configuration, Inject} from "@tsed/di"; // import compress from "compression"; // import cookieParser from "cookie-parser"; // import methodOverride from "method-override"; diff --git a/docs/snippets/getting-started/server.ts b/docs/snippets/getting-started/server.ts index 4177af83513..cc91b2ae6bd 100644 --- a/docs/snippets/getting-started/server.ts +++ b/docs/snippets/getting-started/server.ts @@ -1,5 +1,5 @@ -import {Configuration, Inject} from "@tsed/di"; import {PlatformApplication} from "@tsed/common"; +import {Configuration, Inject} from "@tsed/di"; import compress from "compression"; import cookieParser from "cookie-parser"; import methodOverride from "method-override"; diff --git a/docs/tutorials/snippets/aws/server-configuration.ts b/docs/tutorials/snippets/aws/server-configuration.ts index f2ae9339efd..3dbb6d78c72 100644 --- a/docs/tutorials/snippets/aws/server-configuration.ts +++ b/docs/tutorials/snippets/aws/server-configuration.ts @@ -1,6 +1,7 @@ +import "@tsed/platform-express"; + import {PlatformApplication} from "@tsed/common"; import {Configuration, Inject} from "@tsed/di"; -import "@tsed/platform-express"; import bodyParser from "body-parser"; import compress from "compression"; import cookieParser from "cookie-parser"; diff --git a/docs/tutorials/snippets/graphql/datasource-service.ts b/docs/tutorials/snippets/graphql/datasource-service.ts index 1a9c7dbfd64..078c8746f27 100644 --- a/docs/tutorials/snippets/graphql/datasource-service.ts +++ b/docs/tutorials/snippets/graphql/datasource-service.ts @@ -1,5 +1,6 @@ import {RESTDataSource} from "@apollo/datasource-rest"; import {DataSource} from "@tsed/typegraphql"; + import {User} from "../models/User"; @DataSource() diff --git a/docs/tutorials/snippets/graphql/get-server-instance.ts b/docs/tutorials/snippets/graphql/get-server-instance.ts index d11146ca5fe..8a4619d159d 100644 --- a/docs/tutorials/snippets/graphql/get-server-instance.ts +++ b/docs/tutorials/snippets/graphql/get-server-instance.ts @@ -1,6 +1,6 @@ +import {ApolloService} from "@tsed/apollo"; import {AfterRoutesInit} from "@tsed/common"; import {Inject, Injectable} from "@tsed/di"; -import {ApolloService} from "@tsed/apollo"; import {ApolloServer} from "apollo-server-express"; @Injectable() diff --git a/docs/tutorials/snippets/graphql/resolver-data-source.ts b/docs/tutorials/snippets/graphql/resolver-data-source.ts index c6146dc0d21..7a7afe52fd8 100644 --- a/docs/tutorials/snippets/graphql/resolver-data-source.ts +++ b/docs/tutorials/snippets/graphql/resolver-data-source.ts @@ -1,5 +1,6 @@ import {ResolverController} from "@tsed/typegraphql"; import {Arg, Authorized, Ctx, Query} from "type-graphql"; + import {UserDataSource} from "../datasources/UserDataSource"; import {User} from "../models/User"; diff --git a/docs/tutorials/snippets/graphql/resolver-service.ts b/docs/tutorials/snippets/graphql/resolver-service.ts index 87ef1733e7a..809e9048846 100644 --- a/docs/tutorials/snippets/graphql/resolver-service.ts +++ b/docs/tutorials/snippets/graphql/resolver-service.ts @@ -1,6 +1,7 @@ import {Inject} from "@tsed/di"; import {ResolverController} from "@tsed/typegraphql"; import {Arg, Args, Query} from "type-graphql"; + import {RecipeNotFoundError} from "../errors/RecipeNotFoundError"; import {RecipesService} from "../services/RecipesService"; import {Recipe} from "../types/Recipe"; diff --git a/docs/tutorials/snippets/graphql/server-configuration.ts b/docs/tutorials/snippets/graphql/server-configuration.ts index 7b099e59855..0835945d038 100644 --- a/docs/tutorials/snippets/graphql/server-configuration.ts +++ b/docs/tutorials/snippets/graphql/server-configuration.ts @@ -1,8 +1,9 @@ -import {Configuration} from "@tsed/di"; import "@tsed/platform-express"; import "@tsed/typegraphql"; import "./resolvers/index.js"; // barrel file with all resolvers +import {Configuration} from "@tsed/di"; + @Configuration({ typegraphql: { server1: { diff --git a/docs/tutorials/snippets/graphql/testing.jest.ts b/docs/tutorials/snippets/graphql/testing.jest.ts index 351bfd5e06b..04b77ec832d 100644 --- a/docs/tutorials/snippets/graphql/testing.jest.ts +++ b/docs/tutorials/snippets/graphql/testing.jest.ts @@ -1,9 +1,11 @@ -import {PlatformTest} from "@tsed/common"; -import {ApolloService} from "@tsed/apollo"; import "@tsed/platform-express"; + +import {ApolloService} from "@tsed/apollo"; +import {PlatformTest} from "@tsed/common"; import {ApolloServerTestClient, createTestClient} from "apollo-server-testing"; import {expect} from "chai"; import gql from "graphql-tag"; + import {Server} from "./app/Server"; const GET_RECIPES = gql` diff --git a/docs/tutorials/snippets/graphql/testing.mocha.ts b/docs/tutorials/snippets/graphql/testing.mocha.ts index 549bc668d37..2b2191de281 100644 --- a/docs/tutorials/snippets/graphql/testing.mocha.ts +++ b/docs/tutorials/snippets/graphql/testing.mocha.ts @@ -1,9 +1,11 @@ -import {PlatformTest} from "@tsed/common"; import "@tsed/platform-express"; + +import {ApolloService} from "@tsed/apollo"; +import {PlatformTest} from "@tsed/common"; import {ApolloServerTestClient, createTestClient} from "apollo-server-testing"; import {expect} from "chai"; import gql from "graphql-tag"; -import {ApolloService} from "@tsed/apollo"; + import {Server} from "./app/Server"; const GET_RECIPES = gql` diff --git a/docs/tutorials/snippets/mongoose/collections.ts b/docs/tutorials/snippets/mongoose/collections.ts index d9fdaaa2bab..94145709c5b 100644 --- a/docs/tutorials/snippets/mongoose/collections.ts +++ b/docs/tutorials/snippets/mongoose/collections.ts @@ -1,5 +1,5 @@ -import {CollectionOf} from "@tsed/schema"; import {Model} from "@tsed/mongoose"; +import {CollectionOf} from "@tsed/schema"; @Model() export class MyModel { diff --git a/docs/tutorials/snippets/mongoose/configuration.ts b/docs/tutorials/snippets/mongoose/configuration.ts index 37404a12d46..1b0f6d1b5e2 100644 --- a/docs/tutorials/snippets/mongoose/configuration.ts +++ b/docs/tutorials/snippets/mongoose/configuration.ts @@ -1,7 +1,8 @@ -import {Configuration} from "@tsed/di"; import "@tsed/mongoose"; // import mongoose ts.ed module import "@tsed/platform-express"; +import {Configuration} from "@tsed/di"; + @Configuration({ mongoose: [ { diff --git a/docs/tutorials/snippets/mongoose/decimal-numbers.ts b/docs/tutorials/snippets/mongoose/decimal-numbers.ts index 488d9f23416..bb3f8f093d7 100644 --- a/docs/tutorials/snippets/mongoose/decimal-numbers.ts +++ b/docs/tutorials/snippets/mongoose/decimal-numbers.ts @@ -1,5 +1,5 @@ +import {Decimal128, Model, NumberDecimal} from "@tsed/mongoose"; import {Property} from "@tsed/schema"; -import {Model, NumberDecimal, Decimal128} from "@tsed/mongoose"; @Model() export class ProductModel { diff --git a/docs/tutorials/snippets/mongoose/declaring-model-connection.ts b/docs/tutorials/snippets/mongoose/declaring-model-connection.ts index 7dbba511922..21bfa47f7bb 100644 --- a/docs/tutorials/snippets/mongoose/declaring-model-connection.ts +++ b/docs/tutorials/snippets/mongoose/declaring-model-connection.ts @@ -1,5 +1,5 @@ -import {Property} from "@tsed/schema"; import {Model, ObjectID} from "@tsed/mongoose"; +import {Property} from "@tsed/schema"; @Model({ connection: "db2" diff --git a/docs/tutorials/snippets/mongoose/declaring-model.ts b/docs/tutorials/snippets/mongoose/declaring-model.ts index 54073030a8e..b7223252d93 100644 --- a/docs/tutorials/snippets/mongoose/declaring-model.ts +++ b/docs/tutorials/snippets/mongoose/declaring-model.ts @@ -1,5 +1,5 @@ -import {Property} from "@tsed/schema"; import {Model, ObjectID} from "@tsed/mongoose"; +import {Property} from "@tsed/schema"; @Model() export class MyModel { diff --git a/docs/tutorials/snippets/mongoose/declaring-schema.ts b/docs/tutorials/snippets/mongoose/declaring-schema.ts index 996f34a83f6..1eb50bbbff5 100644 --- a/docs/tutorials/snippets/mongoose/declaring-schema.ts +++ b/docs/tutorials/snippets/mongoose/declaring-schema.ts @@ -1,5 +1,5 @@ -import {Property} from "@tsed/schema"; import {Schema} from "@tsed/mongoose"; +import {Property} from "@tsed/schema"; @Schema() export class MyModel { diff --git a/docs/tutorials/snippets/mongoose/discriminator.ts b/docs/tutorials/snippets/mongoose/discriminator.ts index d97ecdd83aa..83aeff7b0b0 100644 --- a/docs/tutorials/snippets/mongoose/discriminator.ts +++ b/docs/tutorials/snippets/mongoose/discriminator.ts @@ -1,5 +1,5 @@ -import {DiscriminatorValue, DiscriminatorKey, Required} from "@tsed/schema"; import {Model, ObjectID} from "@tsed/mongoose"; +import {DiscriminatorKey, DiscriminatorValue, Required} from "@tsed/schema"; @Model() class EventModel { diff --git a/docs/tutorials/snippets/mongoose/example-model-mongoose.ts b/docs/tutorials/snippets/mongoose/example-model-mongoose.ts index 29eb8de806b..ed83efc8fbc 100644 --- a/docs/tutorials/snippets/mongoose/example-model-mongoose.ts +++ b/docs/tutorials/snippets/mongoose/example-model-mongoose.ts @@ -1,5 +1,5 @@ -import {Default, Enum, Format, Ignore, Maximum, MaxLength, Minimum, MinLength, Pattern, Required} from "@tsed/schema"; import {Indexed, Model, ObjectID, Unique} from "@tsed/mongoose"; +import {Default, Enum, Format, Ignore, Maximum, MaxLength, Minimum, MinLength, Pattern, Required} from "@tsed/schema"; enum Categories { CAT1 = "cat1", diff --git a/docs/tutorials/snippets/mongoose/extended-circular-reference.ts b/docs/tutorials/snippets/mongoose/extended-circular-reference.ts index 2a84e7103ec..c63b22bf64d 100644 --- a/docs/tutorials/snippets/mongoose/extended-circular-reference.ts +++ b/docs/tutorials/snippets/mongoose/extended-circular-reference.ts @@ -1,5 +1,5 @@ -import {Required, CollectionOf} from "@tsed/schema"; import {Model, ObjectID} from "@tsed/mongoose"; +import {CollectionOf, Required} from "@tsed/schema"; @Model() export class Customer { diff --git a/docs/tutorials/snippets/mongoose/inject-model.ts b/docs/tutorials/snippets/mongoose/inject-model.ts index 1531d4c5a57..7120a5485e6 100644 --- a/docs/tutorials/snippets/mongoose/inject-model.ts +++ b/docs/tutorials/snippets/mongoose/inject-model.ts @@ -1,5 +1,6 @@ import {Inject, Injectable} from "@tsed/di"; import {MongooseModel} from "@tsed/mongoose"; + import {MyModel} from "./models/MyModel"; @Injectable() diff --git a/docs/tutorials/snippets/mongoose/plugin.ts b/docs/tutorials/snippets/mongoose/plugin.ts index db11c4aaeb5..08ec940e3ce 100644 --- a/docs/tutorials/snippets/mongoose/plugin.ts +++ b/docs/tutorials/snippets/mongoose/plugin.ts @@ -2,6 +2,7 @@ import {Inject, Injectable} from "@tsed/di"; import {Model, MongooseModel, MongoosePlugin} from "@tsed/mongoose"; import * as findOrCreate from "mongoose-findorcreate"; + import {User} from "./User"; @Model() diff --git a/docs/tutorials/snippets/mongoose/post-hook.ts b/docs/tutorials/snippets/mongoose/post-hook.ts index e527c2477f3..b21df6ac3b1 100644 --- a/docs/tutorials/snippets/mongoose/post-hook.ts +++ b/docs/tutorials/snippets/mongoose/post-hook.ts @@ -1,5 +1,5 @@ -import {Required} from "@tsed/schema"; import {Model, ObjectID, PostHook} from "@tsed/mongoose"; +import {Required} from "@tsed/schema"; @Model() @PostHook("save", (car: CarModel) => { diff --git a/docs/tutorials/snippets/mongoose/pre-hook.ts b/docs/tutorials/snippets/mongoose/pre-hook.ts index 076b8583e32..077f956b50b 100644 --- a/docs/tutorials/snippets/mongoose/pre-hook.ts +++ b/docs/tutorials/snippets/mongoose/pre-hook.ts @@ -1,5 +1,5 @@ -import {Required} from "@tsed/schema"; import {Model, ObjectID, PreHook} from "@tsed/mongoose"; +import {Required} from "@tsed/schema"; @Model() @PreHook("save", (car: CarModel, next: any) => { diff --git a/docs/tutorials/snippets/mongoose/references-circular.ts b/docs/tutorials/snippets/mongoose/references-circular.ts index cc6a08e934e..df13b78a576 100644 --- a/docs/tutorials/snippets/mongoose/references-circular.ts +++ b/docs/tutorials/snippets/mongoose/references-circular.ts @@ -1,5 +1,5 @@ -import {Required} from "@tsed/schema"; import {Model, ObjectID, Ref} from "@tsed/mongoose"; +import {Required} from "@tsed/schema"; @Model() export class User { diff --git a/docs/tutorials/snippets/mongoose/subdocuments.ts b/docs/tutorials/snippets/mongoose/subdocuments.ts index a67bb7b02ad..8ed55579371 100644 --- a/docs/tutorials/snippets/mongoose/subdocuments.ts +++ b/docs/tutorials/snippets/mongoose/subdocuments.ts @@ -1,5 +1,5 @@ -import {CollectionOf, Property} from "@tsed/schema"; import {Model, ObjectID, Schema} from "@tsed/mongoose"; +import {CollectionOf, Property} from "@tsed/schema"; @Schema() export class MySchema { diff --git a/docs/tutorials/snippets/mongoose/testing-api.jest.ts b/docs/tutorials/snippets/mongoose/testing-api.jest.ts index 237becab2ed..70f51eb9827 100644 --- a/docs/tutorials/snippets/mongoose/testing-api.jest.ts +++ b/docs/tutorials/snippets/mongoose/testing-api.jest.ts @@ -1,6 +1,7 @@ import {PlatformTest} from "@tsed/common"; import {TestContainersMongo} from "@tsed/testcontainers-mongo"; import * as SuperTest from "supertest"; + import {Server} from "../Server"; describe("Rest", () => { diff --git a/docs/tutorials/snippets/mongoose/testing-api.mocha.ts b/docs/tutorials/snippets/mongoose/testing-api.mocha.ts index f986b0ce469..e40e9b4bcf5 100644 --- a/docs/tutorials/snippets/mongoose/testing-api.mocha.ts +++ b/docs/tutorials/snippets/mongoose/testing-api.mocha.ts @@ -3,6 +3,7 @@ import {PlatformExpress} from "@tsed/platform-express"; import {TestMongooseContext} from "@tsed/testing-mongoose"; import {expect} from "chai"; import * as SuperTest from "supertest"; + import {Server} from "../Server"; describe("Rest", () => { diff --git a/docs/tutorials/snippets/mongoose/testing-api.vitest.ts b/docs/tutorials/snippets/mongoose/testing-api.vitest.ts index 237becab2ed..70f51eb9827 100644 --- a/docs/tutorials/snippets/mongoose/testing-api.vitest.ts +++ b/docs/tutorials/snippets/mongoose/testing-api.vitest.ts @@ -1,6 +1,7 @@ import {PlatformTest} from "@tsed/common"; import {TestContainersMongo} from "@tsed/testcontainers-mongo"; import * as SuperTest from "supertest"; + import {Server} from "../Server"; describe("Rest", () => { diff --git a/docs/tutorials/snippets/mongoose/testing-model.jest.ts b/docs/tutorials/snippets/mongoose/testing-model.jest.ts index 307c90bda86..b9291cea151 100644 --- a/docs/tutorials/snippets/mongoose/testing-model.jest.ts +++ b/docs/tutorials/snippets/mongoose/testing-model.jest.ts @@ -1,6 +1,6 @@ import {PlatformTest} from "@tsed/common"; -import {Property, Required} from "@tsed/schema"; import {Model, MongooseModel, ObjectID, PostHook, PreHook, Unique} from "@tsed/mongoose"; +import {Property, Required} from "@tsed/schema"; import {TestContainersMongo} from "@tsed/testcontainers-mongo"; @Model({schemaOptions: {timestamps: true}}) diff --git a/docs/tutorials/snippets/mongoose/testing-model.vitest.ts b/docs/tutorials/snippets/mongoose/testing-model.vitest.ts index 307c90bda86..b9291cea151 100644 --- a/docs/tutorials/snippets/mongoose/testing-model.vitest.ts +++ b/docs/tutorials/snippets/mongoose/testing-model.vitest.ts @@ -1,6 +1,6 @@ import {PlatformTest} from "@tsed/common"; -import {Property, Required} from "@tsed/schema"; import {Model, MongooseModel, ObjectID, PostHook, PreHook, Unique} from "@tsed/mongoose"; +import {Property, Required} from "@tsed/schema"; import {TestContainersMongo} from "@tsed/testcontainers-mongo"; @Model({schemaOptions: {timestamps: true}}) diff --git a/docs/tutorials/snippets/mongoose/version-key.ts b/docs/tutorials/snippets/mongoose/version-key.ts index dba410d29fa..4148b14664d 100644 --- a/docs/tutorials/snippets/mongoose/version-key.ts +++ b/docs/tutorials/snippets/mongoose/version-key.ts @@ -1,5 +1,5 @@ -import {Required} from "@tsed/schema"; import {Model, ObjectID, VersionKey} from "@tsed/mongoose"; +import {Required} from "@tsed/schema"; @Model() class PostModel { diff --git a/docs/tutorials/snippets/mongoose/virtual-references.ts b/docs/tutorials/snippets/mongoose/virtual-references.ts index 51b934ccbcc..edeaf008c85 100644 --- a/docs/tutorials/snippets/mongoose/virtual-references.ts +++ b/docs/tutorials/snippets/mongoose/virtual-references.ts @@ -1,5 +1,5 @@ -import {Property} from "@tsed/schema"; import {Model, Ref, VirtualRef, VirtualRefs} from "@tsed/mongoose"; +import {Property} from "@tsed/schema"; @Model() class Person { diff --git a/docs/tutorials/snippets/multer/configuration.ts b/docs/tutorials/snippets/multer/configuration.ts index 224e1b151ac..4d3c47fea31 100644 --- a/docs/tutorials/snippets/multer/configuration.ts +++ b/docs/tutorials/snippets/multer/configuration.ts @@ -1,6 +1,7 @@ -import {Configuration} from "@tsed/di"; import "@tsed/platform-express"; +import {Configuration} from "@tsed/di"; + @Configuration({ multer: { dest: `./../uploads` diff --git a/docs/tutorials/snippets/multer/controller.ts b/docs/tutorials/snippets/multer/controller.ts index 69759de4e57..82419d9b86b 100644 --- a/docs/tutorials/snippets/multer/controller.ts +++ b/docs/tutorials/snippets/multer/controller.ts @@ -1,6 +1,6 @@ import {MulterOptions, MultipartFile, PlatformMulterFile} from "@tsed/common"; -import {Post} from "@tsed/schema"; import {Controller} from "@tsed/di"; +import {Post} from "@tsed/schema"; @Controller("/") class MyCtrl { diff --git a/docs/tutorials/snippets/multer/file-array.ts b/docs/tutorials/snippets/multer/file-array.ts index 82218d4bffa..2c65963e76f 100644 --- a/docs/tutorials/snippets/multer/file-array.ts +++ b/docs/tutorials/snippets/multer/file-array.ts @@ -1,6 +1,6 @@ import {MultipartFile, PlatformMulterFile} from "@tsed/common"; -import {Post} from "@tsed/schema"; import {Controller} from "@tsed/di"; +import {Post} from "@tsed/schema"; @Controller("/") class MyCtrl { diff --git a/docs/tutorials/snippets/multer/middleware.ts b/docs/tutorials/snippets/multer/middleware.ts index 6cd107fef70..0f4c33416b3 100644 --- a/docs/tutorials/snippets/multer/middleware.ts +++ b/docs/tutorials/snippets/multer/middleware.ts @@ -1,8 +1,8 @@ -import { BodyParams, Middleware, MiddlewareMethods } from '@tsed/common'; +import {BodyParams, Middleware, MiddlewareMethods} from "@tsed/common"; -@Middleware({ priority: 11 }) +@Middleware({priority: 11}) export class CustomMiddleware implements MiddlewareMethods { - public use(@BodyParams('data') data: any) { + public use(@BodyParams("data") data: any) { // data will now be available } -} \ No newline at end of file +} diff --git a/docs/tutorials/snippets/passport/AcceptRolesMiddleware.ts b/docs/tutorials/snippets/passport/AcceptRolesMiddleware.ts index 420082088e3..74a03622b90 100644 --- a/docs/tutorials/snippets/passport/AcceptRolesMiddleware.ts +++ b/docs/tutorials/snippets/passport/AcceptRolesMiddleware.ts @@ -1,6 +1,6 @@ +import {Unauthorized} from "@tsed/exceptions"; import {Middleware} from "@tsed/platform-middlewares"; import {Context} from "@tsed/platform-params"; -import {Unauthorized} from "@tsed/exceptions"; @Middleware() export class AcceptRolesMiddleware { diff --git a/docs/tutorials/snippets/passport/AzureBearerProtocol.ts b/docs/tutorials/snippets/passport/AzureBearerProtocol.ts index 1ae8af5a46a..7be44caeb2c 100644 --- a/docs/tutorials/snippets/passport/AzureBearerProtocol.ts +++ b/docs/tutorials/snippets/passport/AzureBearerProtocol.ts @@ -1,6 +1,7 @@ -import {Context} from "@tsed/platform-params"; import {Arg, OnVerify, PassportMiddleware, Protocol} from "@tsed/passport"; +import {Context} from "@tsed/platform-params"; import {BearerStrategy, ITokenPayload} from "passport-azure-ad"; + import {AuthService} from "../services/auth/AuthService"; @Protocol({ diff --git a/docs/tutorials/snippets/passport/BasicProtocol.spec.ts b/docs/tutorials/snippets/passport/BasicProtocol.spec.ts index 8b03cf46fb0..48571dccea0 100644 --- a/docs/tutorials/snippets/passport/BasicProtocol.spec.ts +++ b/docs/tutorials/snippets/passport/BasicProtocol.spec.ts @@ -1,8 +1,9 @@ +import {PlatformTest} from "@tsed/common"; import * as Sinon from "sinon"; + import {User} from "../models/User"; import {UsersService} from "../services/users/UsersService"; import {BasicProtocol} from "./BasicProtocol"; -import {PlatformTest} from "@tsed/common"; describe("BasicProtocol", () => { beforeEach(() => PlatformTest.create()); diff --git a/docs/tutorials/snippets/passport/BasicProtocol.ts b/docs/tutorials/snippets/passport/BasicProtocol.ts index 80aa02c0cdd..3513de5d4f5 100644 --- a/docs/tutorials/snippets/passport/BasicProtocol.ts +++ b/docs/tutorials/snippets/passport/BasicProtocol.ts @@ -2,6 +2,7 @@ import {Req} from "@tsed/common"; import {Arg, OnInstall, OnVerify, Protocol} from "@tsed/passport"; import {Strategy} from "passport"; import {BasicStrategy} from "passport-http"; + import {UsersService} from "../services/users/UsersService"; import {checkEmail} from "../utils/checkEmail"; diff --git a/docs/tutorials/snippets/passport/DiscordProtocol.ts b/docs/tutorials/snippets/passport/DiscordProtocol.ts index 87b76029196..ee8dda0b04c 100644 --- a/docs/tutorials/snippets/passport/DiscordProtocol.ts +++ b/docs/tutorials/snippets/passport/DiscordProtocol.ts @@ -2,6 +2,7 @@ import {Req} from "@tsed/common"; import {Args, OnInstall, OnVerify, Protocol} from "@tsed/passport"; import {Strategy, StrategyOptions} from "passport-discord"; import * as refresh from "passport-oauth2-refresh"; + import {AuthService} from "../services/auth/AuthService"; @Protocol({ diff --git a/docs/tutorials/snippets/passport/FacebookProtocol.ts b/docs/tutorials/snippets/passport/FacebookProtocol.ts index b1bfd93c964..a22b62edc1a 100644 --- a/docs/tutorials/snippets/passport/FacebookProtocol.ts +++ b/docs/tutorials/snippets/passport/FacebookProtocol.ts @@ -2,6 +2,7 @@ import {Req} from "@tsed/common"; import {Inject} from "@tsed/di"; import {Args, OnInstall, OnVerify, Protocol} from "@tsed/passport"; import {Strategy, StrategyOptions} from "passport-facebook"; + import {AuthService} from "../services/auth/AuthService"; @Protocol({ diff --git a/docs/tutorials/snippets/passport/JwtProtocol.ts b/docs/tutorials/snippets/passport/JwtProtocol.ts index 32e9788e069..17ce7003990 100644 --- a/docs/tutorials/snippets/passport/JwtProtocol.ts +++ b/docs/tutorials/snippets/passport/JwtProtocol.ts @@ -1,6 +1,7 @@ import {Req} from "@tsed/common"; import {Arg, OnVerify, Protocol} from "@tsed/passport"; import {ExtractJwt, Strategy, StrategyOptions} from "passport-jwt"; + import {AuthService} from "../services/auth/AuthService"; @Protocol({ diff --git a/docs/tutorials/snippets/passport/LoginLocalProtocol.spec.ts b/docs/tutorials/snippets/passport/LoginLocalProtocol.spec.ts index f68c2ce91d3..18552179c9c 100644 --- a/docs/tutorials/snippets/passport/LoginLocalProtocol.spec.ts +++ b/docs/tutorials/snippets/passport/LoginLocalProtocol.spec.ts @@ -1,5 +1,6 @@ -import * as Sinon from "sinon"; import {PlatformTest} from "@tsed/common"; +import * as Sinon from "sinon"; + import {User} from "../models/User"; import {UsersService} from "../services/users/UsersService"; import {LoginLocalProtocol} from "./LoginLocalProtocol"; diff --git a/docs/tutorials/snippets/passport/LoginLocalProtocol.ts b/docs/tutorials/snippets/passport/LoginLocalProtocol.ts index 8ad958d7a99..1695cd502c2 100644 --- a/docs/tutorials/snippets/passport/LoginLocalProtocol.ts +++ b/docs/tutorials/snippets/passport/LoginLocalProtocol.ts @@ -1,8 +1,9 @@ import {Req} from "@tsed/common"; import {Inject} from "@tsed/di"; -import {BodyParams} from "@tsed/platform-params"; import {BeforeInstall, OnInstall, OnVerify, Protocol} from "@tsed/passport"; +import {BodyParams} from "@tsed/platform-params"; import {IStrategyOptions, Strategy} from "passport-local"; + import {Credentials} from "../models/Credentials"; import {UsersService} from "../services/users/UsersService"; diff --git a/docs/tutorials/snippets/passport/PassportCtrl.ts b/docs/tutorials/snippets/passport/PassportCtrl.ts index 0bcbe9d4717..d0655519f85 100644 --- a/docs/tutorials/snippets/passport/PassportCtrl.ts +++ b/docs/tutorials/snippets/passport/PassportCtrl.ts @@ -1,8 +1,8 @@ import {Req} from "@tsed/common"; +import {Controller, ProviderScope, Scope} from "@tsed/di"; import {Authenticate} from "@tsed/passport"; import {BodyParams} from "@tsed/platform-params"; import {Post} from "@tsed/schema"; -import {Controller, ProviderScope, Scope} from "@tsed/di"; @Controller("/auth") @Scope(ProviderScope.SINGLETON) diff --git a/docs/tutorials/snippets/passport/PassportFacebookCtrl.ts b/docs/tutorials/snippets/passport/PassportFacebookCtrl.ts index ca2c6868a1c..6b608c82bff 100644 --- a/docs/tutorials/snippets/passport/PassportFacebookCtrl.ts +++ b/docs/tutorials/snippets/passport/PassportFacebookCtrl.ts @@ -1,7 +1,7 @@ import {Req} from "@tsed/common"; -import {Get} from "@tsed/schema"; import {Controller} from "@tsed/di"; import {Authenticate} from "@tsed/passport"; +import {Get} from "@tsed/schema"; @Controller("/auth") export class AuthCtrl { diff --git a/docs/tutorials/snippets/passport/SignupLocalProtocol.ts b/docs/tutorials/snippets/passport/SignupLocalProtocol.ts index 4418b07be47..5cfff90c04d 100644 --- a/docs/tutorials/snippets/passport/SignupLocalProtocol.ts +++ b/docs/tutorials/snippets/passport/SignupLocalProtocol.ts @@ -1,8 +1,9 @@ import {Req} from "@tsed/common"; -import {BodyParams} from "@tsed/platform-params"; +import {Forbidden} from "@tsed/exceptions"; import {OnInstall, OnVerify, Protocol} from "@tsed/passport"; +import {BodyParams} from "@tsed/platform-params"; import {Strategy} from "passport-local"; -import {Forbidden} from "@tsed/exceptions"; + import {UserCreation} from "../models/UserCreation"; import {UsersService} from "../services/users/UsersService"; diff --git a/docs/tutorials/snippets/passport/acceptRoles.ts b/docs/tutorials/snippets/passport/acceptRoles.ts index 6052e8dd005..53f2b4a5bbd 100644 --- a/docs/tutorials/snippets/passport/acceptRoles.ts +++ b/docs/tutorials/snippets/passport/acceptRoles.ts @@ -1,5 +1,6 @@ +import {StoreSet, useDecorators} from "@tsed/core"; import {UseBefore} from "@tsed/platform-middlewares"; -import {useDecorators, StoreSet} from "@tsed/core"; + import {AcceptRolesMiddleware} from "./AcceptRolesMiddleware"; export function AcceptRoles(...roles: string[]) { diff --git a/docs/tutorials/snippets/passport/guard-basic-auth.ts b/docs/tutorials/snippets/passport/guard-basic-auth.ts index b7fbdf6352f..b4ff0175f71 100644 --- a/docs/tutorials/snippets/passport/guard-basic-auth.ts +++ b/docs/tutorials/snippets/passport/guard-basic-auth.ts @@ -1,7 +1,8 @@ -import {QueryParams} from "@tsed/platform-params"; -import {Get} from "@tsed/schema"; import {Controller, Inject} from "@tsed/di"; import {Authorize} from "@tsed/passport"; +import {QueryParams} from "@tsed/platform-params"; +import {Get} from "@tsed/schema"; + import {Calendar} from "../models/Calendar"; import {CalendarsService} from "../service/CalendarsService"; diff --git a/docs/tutorials/snippets/passport/guard-ctrl.ts b/docs/tutorials/snippets/passport/guard-ctrl.ts index 0e4673e998e..625bbbc97a1 100644 --- a/docs/tutorials/snippets/passport/guard-ctrl.ts +++ b/docs/tutorials/snippets/passport/guard-ctrl.ts @@ -1,7 +1,8 @@ -import {QueryParams} from "@tsed/platform-params"; -import {Get} from "@tsed/schema"; import {Controller, Inject} from "@tsed/di"; import {Authorize} from "@tsed/passport"; +import {QueryParams} from "@tsed/platform-params"; +import {Get} from "@tsed/schema"; + import {Calendar} from "../models/Calendar"; import {CalendarsService} from "../service/CalendarsService"; diff --git a/docs/tutorials/snippets/passport/roles-usage.ts b/docs/tutorials/snippets/passport/roles-usage.ts index a97cf45616c..3ac0d7995ac 100644 --- a/docs/tutorials/snippets/passport/roles-usage.ts +++ b/docs/tutorials/snippets/passport/roles-usage.ts @@ -1,6 +1,7 @@ -import {Post} from "@tsed/schema"; import {Controller} from "@tsed/di"; import {Authorize} from "@tsed/passport"; +import {Post} from "@tsed/schema"; + import {AcceptRoles} from "../decorators/acceptRoles"; @Controller("/calendars") diff --git a/docs/tutorials/snippets/passport/server.ts b/docs/tutorials/snippets/passport/server.ts index 17b286d542c..0cf4b581e74 100644 --- a/docs/tutorials/snippets/passport/server.ts +++ b/docs/tutorials/snippets/passport/server.ts @@ -1,15 +1,15 @@ -import {Configuration, Inject} from "@tsed/di"; -import {PlatformApplication} from "@tsed/common"; import "@tsed/passport"; import "@tsed/platform-express"; +// import your protocol. Ts.ED will discover it automatically +import "./protocols/LoginLocalProtocol.js"; + +import {PlatformApplication} from "@tsed/common"; +import {Configuration, Inject} from "@tsed/di"; import bodyParser from "body-parser"; import cookieParser from "cookie-parser"; import session from "express-session"; import methodOverride from "method-override"; -// import your protocol. Ts.ED will discover it automatically -import "./protocols/LoginLocalProtocol.js"; - @Configuration({ passport: { /** diff --git a/docs/tutorials/snippets/session/configuration-middleware.ts b/docs/tutorials/snippets/session/configuration-middleware.ts index cb016683889..75c685a2727 100644 --- a/docs/tutorials/snippets/session/configuration-middleware.ts +++ b/docs/tutorials/snippets/session/configuration-middleware.ts @@ -1,10 +1,12 @@ +import "@tsed/platform-express"; + import {PlatformApplication} from "@tsed/common"; import {Configuration, Inject} from "@tsed/di"; -import "@tsed/platform-express"; import compress from "compression"; import cookieParser from "cookie-parser"; import session from "express-session"; import methodOverride from "method-override"; + import {CreateRequestSessionMiddleware} from "./middlewares/CreateRequestSessionMiddleware"; @Configuration({ diff --git a/docs/tutorials/snippets/session/configuration.ts b/docs/tutorials/snippets/session/configuration.ts index 1808900163c..89f10ea929c 100644 --- a/docs/tutorials/snippets/session/configuration.ts +++ b/docs/tutorials/snippets/session/configuration.ts @@ -1,6 +1,7 @@ +import "@tsed/platform-express"; + import {PlatformApplication} from "@tsed/common"; import {Configuration, Inject} from "@tsed/di"; -import "@tsed/platform-express"; import compress from "compression"; import cookieParser from "cookie-parser"; import session from "express-session"; diff --git a/docs/tutorials/snippets/session/example-cookies.ts b/docs/tutorials/snippets/session/example-cookies.ts index dff70fb0c22..cc095b2c563 100644 --- a/docs/tutorials/snippets/session/example-cookies.ts +++ b/docs/tutorials/snippets/session/example-cookies.ts @@ -1,6 +1,7 @@ +import {Controller} from "@tsed/di"; import {Cookies} from "@tsed/platform-params"; import {Post} from "@tsed/schema"; -import {Controller} from "@tsed/di"; + import {IUser} from "./interfaces/IUser"; @Controller("/") diff --git a/docs/tutorials/snippets/session/example-session.ts b/docs/tutorials/snippets/session/example-session.ts index 3e49e615f35..b800c629f95 100644 --- a/docs/tutorials/snippets/session/example-session.ts +++ b/docs/tutorials/snippets/session/example-session.ts @@ -1,6 +1,6 @@ -import {Session, BodyParams} from "@tsed/platform-params"; -import {Get, Post} from "@tsed/schema"; import {Controller} from "@tsed/di"; +import {BodyParams, Session} from "@tsed/platform-params"; +import {Get, Post} from "@tsed/schema"; import {Returns} from "@tsed/schema"; @Controller("/") diff --git a/docs/tutorials/snippets/session/example-test.jest.ts b/docs/tutorials/snippets/session/example-test.jest.ts index ce4508ee000..4d01cd27ed8 100644 --- a/docs/tutorials/snippets/session/example-test.jest.ts +++ b/docs/tutorials/snippets/session/example-test.jest.ts @@ -1,5 +1,6 @@ import {PlatformTest} from "@tsed/common"; import * as SuperTest from "supertest"; + import {Server} from "../../../src/Server"; describe("Session", () => { diff --git a/docs/tutorials/snippets/session/example-test.legacy.ts b/docs/tutorials/snippets/session/example-test.legacy.ts index 625fd08dc8a..80ee25383e5 100644 --- a/docs/tutorials/snippets/session/example-test.legacy.ts +++ b/docs/tutorials/snippets/session/example-test.legacy.ts @@ -2,6 +2,7 @@ import {ExpressApplication} from "@tsed/common"; import {TestContext} from "@tsed/testing"; import {expect} from "chai"; import * as SuperTest from "supertest"; + import {Server} from "../../../src/Server"; describe("Session", () => { diff --git a/docs/tutorials/snippets/session/example-test.mocha.ts b/docs/tutorials/snippets/session/example-test.mocha.ts index fed7b3cae24..c56dba4ca12 100644 --- a/docs/tutorials/snippets/session/example-test.mocha.ts +++ b/docs/tutorials/snippets/session/example-test.mocha.ts @@ -1,6 +1,7 @@ import {PlatformTest} from "@tsed/common"; import {expect} from "chai"; import * as SuperTest from "supertest"; + import {Server} from "../../../src/Server"; describe("Session", () => { diff --git a/docs/tutorials/snippets/session/example-test.vitest.ts b/docs/tutorials/snippets/session/example-test.vitest.ts index 2cc8b50e170..79f1f725591 100644 --- a/docs/tutorials/snippets/session/example-test.vitest.ts +++ b/docs/tutorials/snippets/session/example-test.vitest.ts @@ -1,6 +1,7 @@ -import {it, expect, describe, beforeAll, afterAll} from "vitest"; import {PlatformTest} from "@tsed/common"; import * as SuperTest from "supertest"; +import {afterAll, beforeAll, describe, expect, it} from "vitest"; + import {Server} from "../../../src/Server"; describe("Session", () => { diff --git a/docs/tutorials/snippets/socketio/configuration.ts b/docs/tutorials/snippets/socketio/configuration.ts index 930a7af215d..f78365885d5 100644 --- a/docs/tutorials/snippets/socketio/configuration.ts +++ b/docs/tutorials/snippets/socketio/configuration.ts @@ -1,7 +1,8 @@ -import {Configuration} from "@tsed/di"; import "@tsed/platform-express"; import "@tsed/socketio"; // import socket.io Ts.ED module +import {Configuration} from "@tsed/di"; + @Configuration({ socketIO: { // ... see configuration diff --git a/docs/tutorials/snippets/socketio/connection-state-recovery-configuration.ts b/docs/tutorials/snippets/socketio/connection-state-recovery-configuration.ts index d9a901f398b..57d54be38ec 100644 --- a/docs/tutorials/snippets/socketio/connection-state-recovery-configuration.ts +++ b/docs/tutorials/snippets/socketio/connection-state-recovery-configuration.ts @@ -1,7 +1,8 @@ -import {Configuration} from "@tsed/di"; import "@tsed/platform-express"; import "@tsed/socketio"; +import {Configuration} from "@tsed/di"; + @Configuration({ socketIO: { // ... see configuration diff --git a/docs/tutorials/snippets/socketio/socket-service-di.ts b/docs/tutorials/snippets/socketio/socket-service-di.ts index ecdcf27ca2f..d6f54dfd742 100644 --- a/docs/tutorials/snippets/socketio/socket-service-di.ts +++ b/docs/tutorials/snippets/socketio/socket-service-di.ts @@ -1,5 +1,6 @@ -import {Get} from "@tsed/schema"; import {Controller} from "@tsed/di"; +import {Get} from "@tsed/schema"; + import {MySocketService} from "../services/MySocketService"; @Controller("/") diff --git a/docs/tutorials/snippets/socketio/socket-service-dynamic-nsp.ts b/docs/tutorials/snippets/socketio/socket-service-dynamic-nsp.ts index 04592a3fb45..7921ff34c2c 100644 --- a/docs/tutorials/snippets/socketio/socket-service-dynamic-nsp.ts +++ b/docs/tutorials/snippets/socketio/socket-service-dynamic-nsp.ts @@ -1,4 +1,4 @@ -import {Nsp, SocketNsp, Input, SocketService} from "@tsed/socketio"; +import {Input, Nsp, SocketNsp, SocketService} from "@tsed/socketio"; import * as SocketIO from "socket.io"; @SocketService(/my-namespace-.+/) diff --git a/docs/tutorials/snippets/socketio/socket-service.ts b/docs/tutorials/snippets/socketio/socket-service.ts index 9650cb69c4c..1e033b6e550 100644 --- a/docs/tutorials/snippets/socketio/socket-service.ts +++ b/docs/tutorials/snippets/socketio/socket-service.ts @@ -1,4 +1,4 @@ -import {IO, Nsp, Socket, SocketService, SocketSession, Reason} from "@tsed/socketio"; +import {IO, Nsp, Reason, Socket, SocketService, SocketSession} from "@tsed/socketio"; import * as SocketIO from "socket.io"; @SocketService("/my-namespace") diff --git a/docs/tutorials/snippets/socketio/socket-use-middleware.ts b/docs/tutorials/snippets/socketio/socket-use-middleware.ts index 7902a7a05bd..ddaa4e2f16a 100644 --- a/docs/tutorials/snippets/socketio/socket-use-middleware.ts +++ b/docs/tutorials/snippets/socketio/socket-use-middleware.ts @@ -1,5 +1,6 @@ -import {Args, SocketMiddleware} from "@tsed/socketio"; import {deserialize} from "@tsed/json-mapper"; +import {Args, SocketMiddleware} from "@tsed/socketio"; + import {User} from "../models/User"; @SocketMiddleware() diff --git a/docs/tutorials/snippets/socketio/socket-use-middleware2.ts b/docs/tutorials/snippets/socketio/socket-use-middleware2.ts index c1aa8ea5879..21ecba1fe05 100644 --- a/docs/tutorials/snippets/socketio/socket-use-middleware2.ts +++ b/docs/tutorials/snippets/socketio/socket-use-middleware2.ts @@ -1,5 +1,6 @@ -import {SocketService, SocketUseAfter, SocketUseBefore, Emit, Input, Args} from "@tsed/socketio"; -import {UserConverterSocketMiddleware, ErrorHandlerSocketMiddleware} from "../middlewares"; +import {Args, Emit, Input, SocketService, SocketUseAfter, SocketUseBefore} from "@tsed/socketio"; + +import {ErrorHandlerSocketMiddleware, UserConverterSocketMiddleware} from "../middlewares"; import {User} from "../models/User"; @SocketService("/my-namespace") diff --git a/docs/tutorials/snippets/swagger/configuration-with-js.ts b/docs/tutorials/snippets/swagger/configuration-with-js.ts index 1ce41ee4614..db77d723b1a 100644 --- a/docs/tutorials/snippets/swagger/configuration-with-js.ts +++ b/docs/tutorials/snippets/swagger/configuration-with-js.ts @@ -1,7 +1,8 @@ -import {Configuration} from "@tsed/di"; import "@tsed/platform-express"; import "@tsed/swagger"; // import swagger Ts.ED module +import {Configuration} from "@tsed/di"; + @Configuration({ swagger: [ { diff --git a/docs/tutorials/snippets/swagger/configuration.ts b/docs/tutorials/snippets/swagger/configuration.ts index c7619288e8c..baf632349cb 100644 --- a/docs/tutorials/snippets/swagger/configuration.ts +++ b/docs/tutorials/snippets/swagger/configuration.ts @@ -1,7 +1,8 @@ -import {Configuration} from "@tsed/di"; import "@tsed/platform-express"; import "@tsed/swagger"; // import swagger Ts.ED module +import {Configuration} from "@tsed/di"; + @Configuration({ swagger: [ { diff --git a/docs/tutorials/snippets/swagger/endpoint-documentation.ts b/docs/tutorials/snippets/swagger/endpoint-documentation.ts index 2b245ac201c..f30dfdf3197 100644 --- a/docs/tutorials/snippets/swagger/endpoint-documentation.ts +++ b/docs/tutorials/snippets/swagger/endpoint-documentation.ts @@ -1,6 +1,7 @@ +import {Controller} from "@tsed/di"; import {BodyParams, QueryParams} from "@tsed/platform-params"; import {Deprecated, Description, Get, Post, Returns, Security, Summary} from "@tsed/schema"; -import {Controller} from "@tsed/di"; + import {CalendarModel} from "./models/Calendar"; @Controller("/calendars") @@ -9,7 +10,7 @@ export class CalendarCtrl { @Summary("Summary of this route") @Description("Return a calendar from the given id") @Returns(200, CalendarModel) - @Returns(404).Description("Not found") + @(Returns(404).Description("Not found")) async getCalendar( @Description("A calendar Id") @QueryParams() diff --git a/docs/tutorials/snippets/swagger/endpoint-extra-in-params.ts b/docs/tutorials/snippets/swagger/endpoint-extra-in-params.ts index 25765851315..fe081648e00 100644 --- a/docs/tutorials/snippets/swagger/endpoint-extra-in-params.ts +++ b/docs/tutorials/snippets/swagger/endpoint-extra-in-params.ts @@ -1,12 +1,13 @@ +import {Controller} from "@tsed/di"; import {BodyParams} from "@tsed/platform-params"; import {In, Post, Security} from "@tsed/schema"; -import {Controller} from "@tsed/di"; + import {CalendarModel} from "./models/Calendar"; @Controller("/calendars") export class CalendarCtrl { @Post("/") - @In("header").Name("authorization").Type(String).Description("Bearer authorization") + @(In("header").Name("authorization").Type(String).Description("Bearer authorization")) @Security("oidc") async createCalendar(@BodyParams() body: any): Promise { return {}; diff --git a/docs/tutorials/snippets/swagger/multi-spec.ts b/docs/tutorials/snippets/swagger/multi-spec.ts index e454d82077d..3d3ae256a3b 100644 --- a/docs/tutorials/snippets/swagger/multi-spec.ts +++ b/docs/tutorials/snippets/swagger/multi-spec.ts @@ -1,7 +1,8 @@ -import {Configuration} from "@tsed/di"; import "@tsed/platform-express"; import "@tsed/swagger"; // import swagger Ts.ED module +import {Configuration} from "@tsed/di"; + @Configuration({ swagger: [ { diff --git a/docs/tutorials/snippets/typeorm/typeorm-configuration.ts b/docs/tutorials/snippets/typeorm/typeorm-configuration.ts index 768d5089c69..f774248b8b7 100644 --- a/docs/tutorials/snippets/typeorm/typeorm-configuration.ts +++ b/docs/tutorials/snippets/typeorm/typeorm-configuration.ts @@ -1,7 +1,8 @@ -import {Configuration} from "@tsed/di"; import "@tsed/platform-express"; import "@tsed/typeorm"; // !!! IMPORTANT TO ADD THIS !!! +import {Configuration} from "@tsed/di"; + @Configuration({ typeorm: [ { diff --git a/docs/tutorials/snippets/typeorm/typeorm-custom-configuration.ts b/docs/tutorials/snippets/typeorm/typeorm-custom-configuration.ts index c63a87a5ae0..9bc3a5299e2 100644 --- a/docs/tutorials/snippets/typeorm/typeorm-custom-configuration.ts +++ b/docs/tutorials/snippets/typeorm/typeorm-custom-configuration.ts @@ -1,7 +1,8 @@ -import {Configuration} from "@tsed/di"; import "@tsed/platform-express"; import "./connections/CONNECTION"; +import {Configuration} from "@tsed/di"; + @Configuration({ customConnection: { name: "default", diff --git a/docs/tutorials/snippets/typeorm/typeorm-entity-controller.ts b/docs/tutorials/snippets/typeorm/typeorm-entity-controller.ts index c39131854f1..9d0a6d313fc 100644 --- a/docs/tutorials/snippets/typeorm/typeorm-entity-controller.ts +++ b/docs/tutorials/snippets/typeorm/typeorm-entity-controller.ts @@ -1,6 +1,7 @@ +import {Controller} from "@tsed/di"; import {BodyParams} from "@tsed/platform-params"; import {Get, Post} from "@tsed/schema"; -import {Controller} from "@tsed/di"; + import {User} from "../entities/User"; import {UsersService} from "../services/UsersService"; diff --git a/docs/tutorials/snippets/typeorm/typeorm-entity-repository.ts b/docs/tutorials/snippets/typeorm/typeorm-entity-repository.ts index 9c6688bb5f0..930c703915a 100644 --- a/docs/tutorials/snippets/typeorm/typeorm-entity-repository.ts +++ b/docs/tutorials/snippets/typeorm/typeorm-entity-repository.ts @@ -1,4 +1,5 @@ -import {Repository, EntityRepository} from "typeorm"; +import {EntityRepository, Repository} from "typeorm"; + import {User} from "../entity/User"; @EntityRepository(User) diff --git a/docs/tutorials/snippets/typeorm/typeorm-injection-async-provider.ts b/docs/tutorials/snippets/typeorm/typeorm-injection-async-provider.ts index 0307180d53a..ae8571a470a 100644 --- a/docs/tutorials/snippets/typeorm/typeorm-injection-async-provider.ts +++ b/docs/tutorials/snippets/typeorm/typeorm-injection-async-provider.ts @@ -1,4 +1,5 @@ import {Inject, Injectable} from "@tsed/di"; + import {CONNECTION} from "./typeorm-async-provider"; @Injectable() diff --git a/docs/tutorials/snippets/typeorm/typeorm-injection-entity-repository.ts b/docs/tutorials/snippets/typeorm/typeorm-injection-entity-repository.ts index c0b7518547f..722d990acb8 100644 --- a/docs/tutorials/snippets/typeorm/typeorm-injection-entity-repository.ts +++ b/docs/tutorials/snippets/typeorm/typeorm-injection-entity-repository.ts @@ -1,5 +1,6 @@ import {Inject, Injectable} from "@tsed/di"; import {UseConnection} from "@tsed/typeorm"; + import {UserRepository} from "./repository/UserRepository"; @Injectable() @@ -8,5 +9,8 @@ export class OtherService { @UseConnection("db2") userRepository2: UserRepository; - constructor(public userRepository: UserRepository, @UseConnection("db3") public userRepository3: UserRepository) {} + constructor( + public userRepository: UserRepository, + @UseConnection("db3") public userRepository3: UserRepository + ) {} } diff --git a/docs/tutorials/snippets/typeorm/typeorm-usage.ts b/docs/tutorials/snippets/typeorm/typeorm-usage.ts index 5a4ce239a57..d4d5ae2c78f 100644 --- a/docs/tutorials/snippets/typeorm/typeorm-usage.ts +++ b/docs/tutorials/snippets/typeorm/typeorm-usage.ts @@ -2,6 +2,7 @@ import {AfterRoutesInit} from "@tsed/common"; import {Injectable} from "@tsed/di"; import {TypeORMService} from "@tsed/typeorm"; import {Connection} from "typeorm"; + import {User} from "../models/User"; @Injectable() diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 00000000000..ffce1c23d37 --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,73 @@ +import typescriptEslint from "@typescript-eslint/eslint-plugin"; +import typescriptParser from "@typescript-eslint/parser"; +import pluginPrettierRecommended from "eslint-plugin-prettier/recommended"; +import pluginSimpleImportSort from "eslint-plugin-simple-import-sort"; +import vitest from "eslint-plugin-vitest"; +import pluginWorkspaces from "eslint-plugin-workspaces"; +import globals from "globals"; +import {join} from "node:path"; + +export default [ + { + ignores: ["coverage", "dist", "processes.config.js", "**/templates"] + }, + { + files: ["**/*.{js,mjs,cjs,jsx,mjsx,ts,tsx,mtsx}"], + languageOptions: { + ecmaVersion: "latest", + sourceType: "module", + parser: typescriptParser, + parserOptions: { + ecmaVersion: "latest", + sourceType: "module", + tsconfigRootDir: join(import.meta.dirname, "tsconfig.json") + }, + globals: { + ...globals.node + } + + }, + plugins: { + "@typescript-eslint": typescriptEslint + }, + rules: { + "@typescript-eslint/ban-ts-comment": 0, + "@typescript-eslint/camelcase": 0, + "@typescript-eslint/no-inferrable-types": 0, + "@typescript-eslint/explicit-function-return-type": 0, + "@typescript-eslint/explicit-module-boundary-types": 0, + "@typescript-eslint/no-unused-vars": 0, + "@typescript-eslint/no-explicit-any": 0, + "@typescript-eslint/no-non-null-assertion": 0 + } + }, + { + files: ["**/*.spec.{js,mjs,cjs,jsx,mjsx,ts,tsx,mtsx}"], // or any other pattern + ignores: ["docs/**", "docs-references/**"], + plugins: { + vitest + }, + rules: { + ...vitest.configs.recommended.rules, // you can also use vitest.configs.all.rules to enable all rules + "vitest/consistent-test-it": ["error", {fn: "it", withinDescribe: "it"}], + "vitest/no-alias-methods": "error", + "vitest/expect-expect": "off" + } + }, + { + files: ["**/*.{js,mjs,cjs,jsx,mjsx,ts,tsx,mtsx}"], + languageOptions: { + parserOptions: {} + }, + plugins: { + "simple-import-sort": pluginSimpleImportSort, + workspaces: pluginWorkspaces + }, + rules: { + "simple-import-sort/imports": "error", + "simple-import-sort/exports": "error", + "workspaces/no-absolute-imports": "error" + } + }, + pluginPrettierRecommended +]; diff --git a/lint-staged.config.js b/lint-staged.config.js deleted file mode 100644 index f63bf136417..00000000000 --- a/lint-staged.config.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - "**/*.{ts,js}": ["eslint --fix"], - "**/*.{ts,js,json,md,yml,yaml}": ["prettier --write"] -}; diff --git a/package.json b/package.json index 69388fa35e1..1004dc1a999 100644 --- a/package.json +++ b/package.json @@ -110,46 +110,47 @@ "uuid": "9.0.1" }, "devDependencies": { - "@commitlint/cli": "^19.2.1", - "@commitlint/config-conventional": "^19.1.0", - "@faker-js/faker": "6.3.1", - "@swc-node/register": "1.6.8", - "@swc/core": "1.3.41", - "@swc/helpers": "0.4.14", + "@commitlint/cli": "19.5.0", + "@commitlint/config-conventional": "19.5.0", + "@faker-js/faker": "9.0.1", + "@swc-node/register": "1.10.9", + "@swc/core": "1.7.26", + "@swc/helpers": "0.5.13", "@tsed/monorepo-utils": "2.3.5", "@tsed/ts-doc": "4.1.0", "@types/axios": "0.14.0", "@types/globby": "9.1.0", - "@types/node": "20.11.30", - "@types/superagent": "4.1.24", + "@types/node": "22.6.1", + "@types/superagent": "8.1.4", "@types/supertest": "6.0.2", - "@typescript-eslint/eslint-plugin": "^5.62.0", - "@typescript-eslint/parser": "^5.62.0", + "@typescript-eslint/eslint-plugin": "8.7.0", + "@typescript-eslint/parser": "8.7.0", "concurrently": "8.2.2", "cross-env": "7.0.3", - "eslint": "^8.57.0", - "eslint-config-prettier": "8.10.0", - "eslint-plugin-prettier": "5.1.3", - "eslint-plugin-workspaces": "0.8.0", + "eslint": "9.11.1", + "eslint-config-prettier": "9.1.0", + "eslint-plugin-prettier": "5.2.1", + "eslint-plugin-simple-import-sort": "12.1.1", + "eslint-plugin-vitest": "0.5.4", + "eslint-plugin-workspaces": "0.10.1", "fs-extra": "^11.2.0", "html-webpack-plugin": "5.6.0", - "husky": "8.0.3", - "is-ci": "^3.0.1", - "lint-staged": "^12.5.0", + "husky": "9.1.6", + "is-ci": "3.0.1", + "lint-staged": "15.2.10", "merge-istanbul": "1.1.4", "micromatch": "4.0.8", "moment": "2.30.1", - "prettier": "3.2.5", - "semantic-release": "23.0.5", + "prettier": "3.3.3", + "semantic-release": "24.1.1", "semantic-release-slack-bot": "4.0.2", - "supertest": "6.2.2", - "ts-loader": "^9.4.2", - "tslib": "2.6.1", - "typescript": "4.9.5", - "unplugin-swc": "^1.5.1", - "vite": "5.4.1", - "vite-plugin-dts": "^4.0.3", - "vitest": "2.0.4", + "supertest": "7.0.0", + "ts-loader": "9.5.1", + "tslib": "2.7.0", + "typescript": "5.6.2", + "unplugin-swc": "1.5.1", + "vite": "5.4.7", + "vitest": "2.1.1", "webpack": "^5.75.0", "webpack-cli": "^5.0.1", "webpack-dev-server": "^4.11.1", @@ -207,5 +208,13 @@ } ] }, - "packageManager": "yarn@4.1.0" + "packageManager": "yarn@4.1.0", + "lint-staged": { + "**/*.{ts,js}": [ + "eslint --fix" + ], + "**/*.{json,md,yml,yaml}": [ + "prettier --write" + ] + } } diff --git a/packages/core/package.json b/packages/core/package.json index f2bfd40d957..1df0d43e23e 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -35,7 +35,7 @@ "@tsed/vitest": "workspace:*", "@vitest/coverage-v8": "^2.0.5", "eslint": "^8.57.0", - "typescript": "4.9.5", + "typescript": "5.6.2", "vite": "^5.4.1", "vitest": "2.0.4", "webpack": "^5.75.0" diff --git a/packages/core/src/domain/AnyToPromise.spec.ts b/packages/core/src/domain/AnyToPromise.spec.ts index 509f7f1d93b..01b660d7658 100644 --- a/packages/core/src/domain/AnyToPromise.spec.ts +++ b/packages/core/src/domain/AnyToPromise.spec.ts @@ -1,5 +1,6 @@ import {createReadStream} from "fs"; import {of} from "rxjs"; + import {catchAsyncError} from "../utils/catchError.js"; import {isStream} from "../utils/objects/isStream.js"; import {AnyToPromise, AnyToPromiseStatus} from "./AnyToPromise.js"; diff --git a/packages/core/src/domain/Metadata.spec.ts b/packages/core/src/domain/Metadata.spec.ts index 226df3c00e0..414634dc820 100644 --- a/packages/core/src/domain/Metadata.spec.ts +++ b/packages/core/src/domain/Metadata.spec.ts @@ -120,18 +120,6 @@ describe("Metadata", () => { }); }); - // describe("getReturnType", () => { - // it("should return types on method", () => { - // expect(Metadata.getReturnType(Test.prototype, "method")).toBe(Boolean); - // }); - // }); - // - // describe("getOwnReturnType", () => { - // it("should return types on method", () => { - // expect(Metadata.getOwnReturnType(Test.prototype, "method")).toBe(Boolean); - // }); - // }); - describe("list", () => { it("should return unique provide from property key", () => { Metadata.set("controller", "test", Test); diff --git a/packages/core/src/domain/Metadata.ts b/packages/core/src/domain/Metadata.ts index ccef19868a2..e2d49df1497 100644 --- a/packages/core/src/domain/Metadata.ts +++ b/packages/core/src/domain/Metadata.ts @@ -1,4 +1,5 @@ import "reflect-metadata"; + import {classOf} from "../utils/objects/classOf.js"; /** diff --git a/packages/core/src/utils/decorators/useDecorators.spec.ts b/packages/core/src/utils/decorators/useDecorators.spec.ts index 22dd9ac2d6a..fd97adc9554 100644 --- a/packages/core/src/utils/decorators/useDecorators.spec.ts +++ b/packages/core/src/utils/decorators/useDecorators.spec.ts @@ -1,7 +1,7 @@ import {StoreFn} from "../../decorators/storeFn.js"; -import {useDecorators} from "./useDecorators.js"; -import {AnyDecorator} from "../../interfaces/AnyDecorator.js"; import {Store} from "../../domain/Store.js"; +import {AnyDecorator} from "../../interfaces/AnyDecorator.js"; +import {useDecorators} from "./useDecorators.js"; describe("useDecorators", () => { function decorator1(value: any) { diff --git a/packages/core/src/utils/decorators/useDecorators.ts b/packages/core/src/utils/decorators/useDecorators.ts index 8dec50bcab7..1b72739f2b8 100644 --- a/packages/core/src/utils/decorators/useDecorators.ts +++ b/packages/core/src/utils/decorators/useDecorators.ts @@ -1,5 +1,5 @@ -import {DecoratorParameters} from "../../interfaces/DecoratorParameters.js"; import {AnyDecorator} from "../../interfaces/AnyDecorator.js"; +import {DecoratorParameters} from "../../interfaces/DecoratorParameters.js"; export function useDecorators(...decorators: AnyDecorator[]): any { return (...args: DecoratorParameters) => { diff --git a/packages/core/src/utils/objects/ObjectUtils.spec.ts b/packages/core/src/utils/objects/ObjectUtils.spec.ts index c5728624eb7..457ca54e5f4 100644 --- a/packages/core/src/utils/objects/ObjectUtils.spec.ts +++ b/packages/core/src/utils/objects/ObjectUtils.spec.ts @@ -83,10 +83,6 @@ describe("ObjectUtils", () => { expect(isArrayOrArrayClass(Array)).toBe(true); }); - it("should return true when Array is given", () => { - expect(isArrayOrArrayClass([])).toBe(true); - }); - it("should return true when [] is given", () => { expect(isArrayOrArrayClass([])).toBe(true); }); @@ -101,10 +97,6 @@ describe("ObjectUtils", () => { expect(isCollection(Array)).toBe(true); }); - it("should return true when Array is given", () => { - expect(isCollection([])).toBe(true); - }); - it("should return true when [] is given", () => { expect(isCollection([])).toBe(true); }); @@ -138,7 +130,7 @@ describe("ObjectUtils", () => { expect(isEmpty(null)).toBe(true); }); - it("should return true when empty string is given", () => { + it("should return true when undefined is given", () => { expect(isEmpty(undefined)).toBe(true); }); it("should return false when {} is given", () => { @@ -154,11 +146,11 @@ describe("ObjectUtils", () => { }); describe("isClass()", () => { - it("should return true", () => { + it("should return true when is a class", () => { expect(isClass(class {})).toBe(true); }); - it("should return true", () => { + it("should return true when is a function", () => { expect(isClass(function t() {})).toBe(true); }); @@ -188,31 +180,31 @@ describe("ObjectUtils", () => { expect(isPromise(Promise)).toBe(true); }); - it("should return true", () => { + it("should return true when its promise resolved", () => { expect(isPromise(Promise.resolve())).toBe(true); }); }); describe("nameOf", () => { - it("should return name when class is given", () => { + it("should return 'Test' when class is given", () => { expect(nameOf(Test)).toBe("Test"); }); - it("should return name when symbol is given", () => { + it("should return 'test2' when symbol is given", () => { expect(nameOf(sym)).toBe("test2"); }); - it("should return name when string is given", () => { + it("should return 'test' when string is given", () => { expect(nameOf("test")).toBe("test"); }); - it("should return name when string is given", () => { + it("should return '1' when string is given", () => { expect(nameOf(1)).toBe("1"); }); - it("should return name when string is given", () => { + it("should return 'true' when boolean is given", () => { expect(nameOf(true)).toBe("true"); }); - it("should return name when null is given", () => { + it("should return 'null' when null is given", () => { expect(nameOf(null)).toBe("null"); }); - it("should return name when undefined is given", () => { + it("should return 'undefined' when undefined is given", () => { expect(nameOf(undefined)).toBe("undefined"); }); }); diff --git a/packages/core/src/utils/objects/ancestorsOf.ts b/packages/core/src/utils/objects/ancestorsOf.ts index a8187d8c78a..355954160f7 100644 --- a/packages/core/src/utils/objects/ancestorsOf.ts +++ b/packages/core/src/utils/objects/ancestorsOf.ts @@ -1,5 +1,5 @@ -import {classOf} from "./classOf.js"; import {getInheritedClass} from "./ancestorOf.js"; +import {classOf} from "./classOf.js"; import {nameOf} from "./nameOf.js"; /** diff --git a/packages/core/src/utils/objects/deepClone.ts b/packages/core/src/utils/objects/deepClone.ts index 0d0bba5007a..25f40864ebe 100644 --- a/packages/core/src/utils/objects/deepClone.ts +++ b/packages/core/src/utils/objects/deepClone.ts @@ -1,10 +1,10 @@ +import {classOf} from "./classOf.js"; import {isDate} from "./isDate.js"; import {isFunction} from "./isFunction.js"; import {isNil} from "./isNil.js"; import {isPrimitive} from "./isPrimitive.js"; -import {isSymbol} from "./isSymbol.js"; import {isRegExp} from "./isRegExp.js"; -import {classOf} from "./classOf.js"; +import {isSymbol} from "./isSymbol.js"; const isBasicType = (source: any) => isNil(source) || isPrimitive(source) || isSymbol(source) || isFunction(source); diff --git a/packages/core/src/utils/objects/deepMerge.spec.ts b/packages/core/src/utils/objects/deepMerge.spec.ts index d98dd4d97e9..945c9af83b6 100644 --- a/packages/core/src/utils/objects/deepMerge.spec.ts +++ b/packages/core/src/utils/objects/deepMerge.spec.ts @@ -128,8 +128,7 @@ describe("deepMerge", () => { security: ["o", "o1"] }); }); - - it("should merge data", () => { + it("should merge data (2)", () => { expect( deepMerge( { @@ -182,8 +181,7 @@ describe("deepMerge", () => { it("should merge data", () => { expect(deepMerge(["1", "2", "4"], ["1", "2", "3"])).toEqual(["1", "2", "4", "3"]); }); - - it("should merge data", () => { + it("should merge data (2)", () => { expect(deepMerge([{"1": "1"}, {"2": "2"}, {"4": "4"}], [{"1": "1"}, {"2": "2"}, {"3": "3"}])).toEqual([ {"1": "1"}, {"2": "2"}, diff --git a/packages/core/src/utils/objects/getValue.spec.ts b/packages/core/src/utils/objects/getValue.spec.ts index 4854aea4a12..e26ee92f803 100644 --- a/packages/core/src/utils/objects/getValue.spec.ts +++ b/packages/core/src/utils/objects/getValue.spec.ts @@ -24,7 +24,7 @@ describe("getValue()", () => { expect(getValue("users.0", {users: [{user: {name: "name"}}]})).toEqual({user: {name: "name"}}); expect(getValue({users: [{user: {name: "name"}}]}, "users.0")).toEqual({user: {name: "name"}}); }); - it("should return given value when expression is given but scope have value (3)", () => { + it("should return given value when expression is given but scope have value (4)", () => { const map = new Map([["user", "name"]]); expect(getValue("user", map)).toEqual("name"); expect(getValue(map, "user")).toEqual("name"); diff --git a/packages/core/src/utils/objects/isInheritedFrom.ts b/packages/core/src/utils/objects/isInheritedFrom.ts index a9afad8d8c5..b0f5208bfd5 100644 --- a/packages/core/src/utils/objects/isInheritedFrom.ts +++ b/packages/core/src/utils/objects/isInheritedFrom.ts @@ -1,5 +1,5 @@ -import {classOf} from "./classOf.js"; import {ancestorOf} from "./ancestorOf.js"; +import {classOf} from "./classOf.js"; import {nameOf} from "./nameOf.js"; export function isInheritedFrom(target: any, from: any, deep = 5): boolean { diff --git a/packages/core/src/utils/objects/isSerializable.ts b/packages/core/src/utils/objects/isSerializable.ts index 75217c84494..5be6fd461ae 100644 --- a/packages/core/src/utils/objects/isSerializable.ts +++ b/packages/core/src/utils/objects/isSerializable.ts @@ -1,8 +1,8 @@ -import {isStream} from "./isStream.js"; import {isBoolean} from "./isBoolean.js"; +import {isNil} from "./isNil.js"; import {isNumber} from "./isNumber.js"; +import {isStream} from "./isStream.js"; import {isString} from "./isString.js"; -import {isNil} from "./isNil.js"; export function isSerializable(data: any) { return !(Buffer.isBuffer(data) || isStream(data) || isBoolean(data) || isNumber(data) || isString(data) || isNil(data)); diff --git a/packages/core/src/utils/objects/methodsOf.ts b/packages/core/src/utils/objects/methodsOf.ts index 351bf5a35c7..04b24d0a953 100644 --- a/packages/core/src/utils/objects/methodsOf.ts +++ b/packages/core/src/utils/objects/methodsOf.ts @@ -1,7 +1,7 @@ -import {classOf} from "./classOf.js"; +import {Type} from "../../domain/Type.js"; import {ancestorsOf} from "./ancestorsOf.js"; +import {classOf} from "./classOf.js"; import {prototypeOf} from "./prototypeOf.js"; -import {Type} from "../../domain/Type.js"; /** * Return all methods for a given class. diff --git a/packages/core/src/utils/objects/setValue.spec.ts b/packages/core/src/utils/objects/setValue.spec.ts index 1063fec3443..3a6858dfa49 100644 --- a/packages/core/src/utils/objects/setValue.spec.ts +++ b/packages/core/src/utils/objects/setValue.spec.ts @@ -39,7 +39,7 @@ describe("setValue()", () => { }); }); - describe("when object with dep (without defined value)", () => { + describe("when object with dep (with object defined value)", () => { it("should set value", () => { const obj = {}; setValue(obj, "__proto__", "vulnerable"); diff --git a/packages/core/tsconfig.esm.json b/packages/core/tsconfig.esm.json index e3b07081667..8954049da4a 100644 --- a/packages/core/tsconfig.esm.json +++ b/packages/core/tsconfig.esm.json @@ -2,8 +2,6 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "module": "ESNext", - "moduleResolution": "nodenext", "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", @@ -11,7 +9,7 @@ "composite": true, "noEmit": false }, - "include": ["src", "src/**/*.json"], + "include": ["src/**/*.ts", "src/**/*.json"], "exclude": [ "node_modules", "test", diff --git a/packages/core/tsconfig.spec.json b/packages/core/tsconfig.spec.json index 36d8cd76b16..d0d6ee5dec0 100644 --- a/packages/core/tsconfig.spec.json +++ b/packages/core/tsconfig.spec.json @@ -3,7 +3,6 @@ "compilerOptions": { "baseUrl": ".", "rootDir": "..", - "module": "commonjs", "outDir": "./lib/cjs", "declaration": false, "composite": false, diff --git a/packages/di/package.json b/packages/di/package.json index 736ddaf0d7f..18290f92aa5 100644 --- a/packages/di/package.json +++ b/packages/di/package.json @@ -36,7 +36,7 @@ "@tsed/typescript": "workspace:*", "cross-env": "7.0.3", "eslint": "^8.57.0", - "typescript": "4.9.5", + "typescript": "5.6.2", "vitest": "2.0.4", "webpack": "^5.75.0" }, diff --git a/packages/di/src/common/decorators/autoInjectable.spec.ts b/packages/di/src/common/decorators/autoInjectable.spec.ts index 21cb69697bd..8b7e827e911 100644 --- a/packages/di/src/common/decorators/autoInjectable.spec.ts +++ b/packages/di/src/common/decorators/autoInjectable.spec.ts @@ -1,6 +1,7 @@ import {catchError} from "@tsed/core"; import {Logger} from "@tsed/logger"; import {beforeEach} from "vitest"; + import {DITest} from "../../node/index.js"; import {registerProvider} from "../registries/ProviderRegistry.js"; import {InjectorService} from "../services/InjectorService.js"; diff --git a/packages/di/src/common/decorators/autoInjectable.ts b/packages/di/src/common/decorators/autoInjectable.ts index 5363f2f6955..5473ff23eb2 100644 --- a/packages/di/src/common/decorators/autoInjectable.ts +++ b/packages/di/src/common/decorators/autoInjectable.ts @@ -1,4 +1,5 @@ import {isArray, type Type} from "@tsed/core"; + import {LocalsContainer} from "../domain/LocalsContainer.js"; import type {TokenProvider} from "../interfaces/TokenProvider.js"; import {InjectorService} from "../services/InjectorService.js"; diff --git a/packages/di/src/common/decorators/configuration.spec.ts b/packages/di/src/common/decorators/configuration.spec.ts index 618f58b6bfe..e44cc14ad79 100644 --- a/packages/di/src/common/decorators/configuration.spec.ts +++ b/packages/di/src/common/decorators/configuration.spec.ts @@ -1,4 +1,5 @@ import {Store} from "@tsed/core"; + import {Container} from "../domain/Container.js"; import {Provider} from "../domain/Provider.js"; import {GlobalProviders} from "../registries/GlobalProviders.js"; diff --git a/packages/di/src/common/decorators/configuration.ts b/packages/di/src/common/decorators/configuration.ts index 18f49fcfd86..d43bace5b8b 100644 --- a/packages/di/src/common/decorators/configuration.ts +++ b/packages/di/src/common/decorators/configuration.ts @@ -1,6 +1,7 @@ import {DecoratorParameters, decoratorTypeOf, DecoratorTypes, StoreSet} from "@tsed/core"; -import {Inject} from "./inject.js"; + import {DIConfiguration} from "../services/DIConfiguration.js"; +import {Inject} from "./inject.js"; /** * Get or set Configuration on a class. diff --git a/packages/di/src/common/decorators/constant.spec.ts b/packages/di/src/common/decorators/constant.spec.ts index 7a9b435040e..ab8df90c51c 100644 --- a/packages/di/src/common/decorators/constant.spec.ts +++ b/packages/di/src/common/decorators/constant.spec.ts @@ -1,5 +1,5 @@ import {DITest} from "../../node/index.js"; -import {constant, Constant} from "./constant.js"; +import {Constant, constant} from "./constant.js"; describe("@Constant()", () => { beforeEach(() => diff --git a/packages/di/src/common/decorators/constant.ts b/packages/di/src/common/decorators/constant.ts index 0e1022d5aa3..28f151f95c3 100644 --- a/packages/di/src/common/decorators/constant.ts +++ b/packages/di/src/common/decorators/constant.ts @@ -1,4 +1,5 @@ import {catchError, deepClone} from "@tsed/core"; + import {InjectorService} from "../services/InjectorService.js"; export function constant(expression: string): Type | undefined; diff --git a/packages/di/src/common/decorators/controller.ts b/packages/di/src/common/decorators/controller.ts index 4a1745e86ef..04e47d01f1c 100644 --- a/packages/di/src/common/decorators/controller.ts +++ b/packages/di/src/common/decorators/controller.ts @@ -1,5 +1,6 @@ import {isArrayOrArrayClass, Type, useDecorators} from "@tsed/core"; import {Children, Path} from "@tsed/schema"; + import {ProviderOpts} from "../interfaces/ProviderOpts.js"; import {registerController} from "../registries/ProviderRegistry.js"; diff --git a/packages/di/src/common/decorators/inject.spec.ts b/packages/di/src/common/decorators/inject.spec.ts index ab1779c1769..75d202e02bc 100644 --- a/packages/di/src/common/decorators/inject.spec.ts +++ b/packages/di/src/common/decorators/inject.spec.ts @@ -1,8 +1,9 @@ import {catchAsyncError, catchError} from "@tsed/core"; + import {DITest} from "../../node/index.js"; import {registerProvider} from "../registries/ProviderRegistry.js"; import {InjectorService} from "../services/InjectorService.js"; -import {inject, Inject} from "./inject.js"; +import {Inject, inject} from "./inject.js"; import {Injectable} from "./injectable.js"; describe("inject", () => { diff --git a/packages/di/src/common/decorators/inject.ts b/packages/di/src/common/decorators/inject.ts index 2516ec86082..5bb8c1c7c17 100644 --- a/packages/di/src/common/decorators/inject.ts +++ b/packages/di/src/common/decorators/inject.ts @@ -1,5 +1,6 @@ import {catchError, decoratorTypeOf, DecoratorTypes, isPromise, Metadata, Store, type Type} from "@tsed/core"; -import {DI_USE_OPTIONS, DI_INJECTABLE_PROPS, DI_INVOKE_OPTIONS} from "../constants/constants.js"; + +import {DI_INJECTABLE_PROPS, DI_INVOKE_OPTIONS, DI_USE_OPTIONS} from "../constants/constants.js"; import {InvalidPropertyTokenError} from "../errors/InvalidPropertyTokenError.js"; import type {InvokeOptions} from "../interfaces/InvokeOptions.js"; import {TokenProvider} from "../interfaces/TokenProvider.js"; diff --git a/packages/di/src/common/decorators/injectable.spec.ts b/packages/di/src/common/decorators/injectable.spec.ts index 9ac8bf445d7..da73fd43be2 100644 --- a/packages/di/src/common/decorators/injectable.spec.ts +++ b/packages/di/src/common/decorators/injectable.spec.ts @@ -1,5 +1,5 @@ -import {Injectable} from "./injectable.js"; import {GlobalProviders} from "../registries/GlobalProviders.js"; +import {Injectable} from "./injectable.js"; describe("@Injectable()", () => { afterEach(() => { diff --git a/packages/di/src/common/decorators/intercept.spec.ts b/packages/di/src/common/decorators/intercept.spec.ts index 111a0cd4376..278364432e2 100644 --- a/packages/di/src/common/decorators/intercept.spec.ts +++ b/packages/di/src/common/decorators/intercept.spec.ts @@ -1,4 +1,5 @@ import {catchError} from "@tsed/core"; + import {DITest} from "../../node/index.js"; import {InterceptorContext} from "../interfaces/InterceptorContext.js"; import {InterceptorMethods} from "../interfaces/InterceptorMethods.js"; diff --git a/packages/di/src/common/decorators/intercept.ts b/packages/di/src/common/decorators/intercept.ts index f32b1dc36cd..76a7a7dc010 100644 --- a/packages/di/src/common/decorators/intercept.ts +++ b/packages/di/src/common/decorators/intercept.ts @@ -1,4 +1,5 @@ import {classOf, decorateMethodsOf, DecoratorParameters, decoratorTypeOf, DecoratorTypes, Store, Type} from "@tsed/core"; + import {DI_INTERCEPTOR_OPTIONS, DI_INVOKE_OPTIONS} from "../constants/constants.js"; import type {InterceptorContext} from "../interfaces/InterceptorContext.js"; import type {InterceptorMethods} from "../interfaces/InterceptorMethods.js"; diff --git a/packages/di/src/common/decorators/lazyInject.spec.ts b/packages/di/src/common/decorators/lazyInject.spec.ts index 63efc7cb1e2..63083219812 100644 --- a/packages/di/src/common/decorators/lazyInject.spec.ts +++ b/packages/di/src/common/decorators/lazyInject.spec.ts @@ -1,4 +1,5 @@ import {catchAsyncError, classOf, nameOf} from "@tsed/core"; + import {InjectorService} from "../services/InjectorService.js"; import type {MyLazyModule} from "./__mock__/lazy.module.js"; import {Injectable} from "./injectable.js"; @@ -8,7 +9,7 @@ describe("LazyInject", () => { it("should lazy load module (import)", async () => { @Injectable() class MyInjectable { - @LazyInject("MyLazyModule", () => import("./__mock__/lazy.import.module")) + @LazyInject("MyLazyModule", () => import("./__mock__/lazy.import.module.js")) lazy: Promise; } @@ -25,7 +26,7 @@ describe("LazyInject", () => { it("should throw an error when token isn't a valid provider", async () => { @Injectable() class MyInjectable { - @LazyInject("TKO", () => import("./__mock__/lazy.nodefault.module")) + @LazyInject("TKO", () => import("./__mock__/lazy.nodefault.module.js")) lazy?: Promise; } diff --git a/packages/di/src/common/decorators/lazyInject.ts b/packages/di/src/common/decorators/lazyInject.ts index ec58efc5081..08c7177e065 100644 --- a/packages/di/src/common/decorators/lazyInject.ts +++ b/packages/di/src/common/decorators/lazyInject.ts @@ -1,4 +1,5 @@ import {catchError, importPackage} from "@tsed/core"; + import {InjectorService} from "../services/InjectorService.js"; /** diff --git a/packages/di/src/common/decorators/module.ts b/packages/di/src/common/decorators/module.ts index 43ab1ce1d01..e10464551a4 100644 --- a/packages/di/src/common/decorators/module.ts +++ b/packages/di/src/common/decorators/module.ts @@ -1,10 +1,11 @@ import {useDecorators} from "@tsed/core"; + import {ProviderScope} from "../domain/ProviderScope.js"; +import {ProviderType} from "../domain/ProviderType.js"; +import {DIResolver} from "../interfaces/DIResolver.js"; import {TokenProvider} from "../interfaces/TokenProvider.js"; import {Configuration} from "./configuration.js"; import {Injectable} from "./injectable.js"; -import {ProviderType} from "../domain/ProviderType.js"; -import {DIResolver} from "../interfaces/DIResolver.js"; export interface ModuleOptions extends Omit { /** diff --git a/packages/di/src/common/decorators/opts.ts b/packages/di/src/common/decorators/opts.ts index 93ed44f197d..ee8e5d09307 100644 --- a/packages/di/src/common/decorators/opts.ts +++ b/packages/di/src/common/decorators/opts.ts @@ -1,4 +1,5 @@ import {classOf} from "@tsed/core"; + import {DI_USE_PARAM_OPTIONS} from "../constants/constants.js"; import {ProviderScope} from "../domain/ProviderScope.js"; import {Inject} from "./inject.js"; diff --git a/packages/di/src/common/decorators/overrideProvider.ts b/packages/di/src/common/decorators/overrideProvider.ts index 620eae20d0b..46382f6cd8f 100644 --- a/packages/di/src/common/decorators/overrideProvider.ts +++ b/packages/di/src/common/decorators/overrideProvider.ts @@ -1,4 +1,5 @@ import {Type} from "@tsed/core"; + import {GlobalProviders} from "../registries/GlobalProviders.js"; /** diff --git a/packages/di/src/common/decorators/scope.spec.ts b/packages/di/src/common/decorators/scope.spec.ts index c2b218c6e99..36e5ae0a5c6 100644 --- a/packages/di/src/common/decorators/scope.spec.ts +++ b/packages/di/src/common/decorators/scope.spec.ts @@ -1,4 +1,5 @@ import {Store} from "@tsed/core"; + import {Scope} from "./scope.js"; class Test {} diff --git a/packages/di/src/common/decorators/scope.ts b/packages/di/src/common/decorators/scope.ts index ad076874446..aa0fa2c6679 100644 --- a/packages/di/src/common/decorators/scope.ts +++ b/packages/di/src/common/decorators/scope.ts @@ -1,4 +1,5 @@ import {StoreSet} from "@tsed/core"; + import {ProviderScope} from "../domain/ProviderScope.js"; /** diff --git a/packages/di/src/common/decorators/useOpts.spec.ts b/packages/di/src/common/decorators/useOpts.spec.ts index 4e0004f7dac..16d0ba2bd27 100644 --- a/packages/di/src/common/decorators/useOpts.spec.ts +++ b/packages/di/src/common/decorators/useOpts.spec.ts @@ -1,4 +1,5 @@ import {descriptorOf} from "@tsed/core"; + import {DITest} from "../../node/index.js"; import {ProviderScope} from "../domain/ProviderScope.js"; import {Inject} from "./inject.js"; diff --git a/packages/di/src/common/decorators/useOpts.ts b/packages/di/src/common/decorators/useOpts.ts index 9545300b476..4d45ab85b14 100644 --- a/packages/di/src/common/decorators/useOpts.ts +++ b/packages/di/src/common/decorators/useOpts.ts @@ -1,5 +1,6 @@ import {decoratorTypeOf, DecoratorTypes, Store, UnsupportedDecoratorType} from "@tsed/core"; -import {DI_USE_PARAM_OPTIONS, DI_USE_OPTIONS} from "../constants/constants.js"; + +import {DI_USE_OPTIONS, DI_USE_PARAM_OPTIONS} from "../constants/constants.js"; /** * Add options to invoke the Service. diff --git a/packages/di/src/common/decorators/value.ts b/packages/di/src/common/decorators/value.ts index 40b56e27744..2654cbb856b 100644 --- a/packages/di/src/common/decorators/value.ts +++ b/packages/di/src/common/decorators/value.ts @@ -1,4 +1,5 @@ import {catchError} from "@tsed/core"; + import {InjectorService} from "../services/InjectorService.js"; export function bindValue(target: any, propertyKey: string | symbol, expression: string, defaultValue?: any) { diff --git a/packages/di/src/common/domain/Container.ts b/packages/di/src/common/domain/Container.ts index ffbb7e7e89d..7b3fa67c54b 100644 --- a/packages/di/src/common/domain/Container.ts +++ b/packages/di/src/common/domain/Container.ts @@ -1,8 +1,8 @@ import type {ProviderOpts} from "../interfaces/ProviderOpts.js"; -import type {ProviderType} from "./ProviderType.js"; import type {TokenProvider} from "../interfaces/TokenProvider.js"; import {GlobalProviders} from "../registries/GlobalProviders.js"; import {Provider} from "./Provider.js"; +import type {ProviderType} from "./ProviderType.js"; export class Container extends Map { /** diff --git a/packages/di/src/common/domain/LocalsContainer.spec.ts b/packages/di/src/common/domain/LocalsContainer.spec.ts index 12cc42579f6..c9578bef7aa 100644 --- a/packages/di/src/common/domain/LocalsContainer.spec.ts +++ b/packages/di/src/common/domain/LocalsContainer.spec.ts @@ -14,7 +14,7 @@ describe("LocalsContainer", () => { await container.destroy(); - expect(instance.$onDestroy).toBeCalledWith(); + expect(instance.$onDestroy).toHaveBeenCalledWith(); }); }); }); diff --git a/packages/di/src/common/domain/LocalsContainer.ts b/packages/di/src/common/domain/LocalsContainer.ts index de440cbe32c..06a1d38233a 100644 --- a/packages/di/src/common/domain/LocalsContainer.ts +++ b/packages/di/src/common/domain/LocalsContainer.ts @@ -1,4 +1,5 @@ import {Hooks} from "@tsed/core"; + import type {TokenProvider} from "../interfaces/TokenProvider.js"; export class LocalsContainer extends Map { diff --git a/packages/di/src/common/domain/Provider.spec.ts b/packages/di/src/common/domain/Provider.spec.ts index ef06c934a00..fe2132492ff 100644 --- a/packages/di/src/common/domain/Provider.spec.ts +++ b/packages/di/src/common/domain/Provider.spec.ts @@ -1,5 +1,5 @@ -import {ProviderScope} from "./ProviderScope.js"; import {Provider} from "./Provider.js"; +import {ProviderScope} from "./ProviderScope.js"; class T1 {} diff --git a/packages/di/src/common/domain/Provider.ts b/packages/di/src/common/domain/Provider.ts index 035adbd03be..8534c01e264 100644 --- a/packages/di/src/common/domain/Provider.ts +++ b/packages/di/src/common/domain/Provider.ts @@ -1,4 +1,5 @@ import {type AbstractType, classOf, getClassOrSymbol, isClass, methodsOf, nameOf, Store, Type} from "@tsed/core"; + import type {ProviderOpts} from "../interfaces/ProviderOpts.js"; import type {TokenProvider} from "../interfaces/TokenProvider.js"; import {ProviderScope} from "./ProviderScope.js"; diff --git a/packages/di/src/common/errors/InjectionError.ts b/packages/di/src/common/errors/InjectionError.ts index c15d5a742fc..de7ab2054ff 100644 --- a/packages/di/src/common/errors/InjectionError.ts +++ b/packages/di/src/common/errors/InjectionError.ts @@ -1,4 +1,5 @@ import {getConstructorArgNames, isClass, isString, nameOf} from "@tsed/core"; + import {TokenProvider} from "../interfaces/TokenProvider.js"; import {colors} from "../utils/colors.js"; diff --git a/packages/di/src/common/integration/async-factory.spec.ts b/packages/di/src/common/integration/async-factory.spec.ts index 2dca755ece5..05af3a1fc74 100644 --- a/packages/di/src/common/integration/async-factory.spec.ts +++ b/packages/di/src/common/integration/async-factory.spec.ts @@ -1,4 +1,5 @@ import {isPromise} from "@tsed/core"; + import {Inject} from "../decorators/inject.js"; import {Injectable} from "../decorators/injectable.js"; import {Container} from "../domain/Container.js"; @@ -12,7 +13,7 @@ describe("DI", () => { registerProvider({ provide: ASYNC_FACTORY, - // eslint-disable-next-line require-await + useAsyncFactory() { return { connection: true, diff --git a/packages/di/src/common/integration/imports.spec.ts b/packages/di/src/common/integration/imports.spec.ts index 31ea384eb0b..9c5716c1692 100644 --- a/packages/di/src/common/integration/imports.spec.ts +++ b/packages/di/src/common/integration/imports.spec.ts @@ -34,6 +34,6 @@ describe("DITest", () => { it("should create container with stubbed service", () => { const service = DITest.get(MyService); - expect(service.createConnection).toBeCalledWith(); + expect(service.createConnection).toHaveBeenCalledWith(); }); }); diff --git a/packages/di/src/common/integration/request.spec.ts b/packages/di/src/common/integration/request.spec.ts index 295ea1a0cc7..dda0418b2d1 100644 --- a/packages/di/src/common/integration/request.spec.ts +++ b/packages/di/src/common/integration/request.spec.ts @@ -69,7 +69,7 @@ describe("DI Request", () => { expect(serviceSingleton1).toEqual(serviceSingleton2); - return expect(result1.$onDestroy).toBeCalledWith(); + return expect(result1.$onDestroy).toHaveBeenCalledWith(); }); }); }); diff --git a/packages/di/src/common/interfaces/ImportTokenProviderOpts.ts b/packages/di/src/common/interfaces/ImportTokenProviderOpts.ts index 2374a7c1e68..dbaba3c47cf 100644 --- a/packages/di/src/common/interfaces/ImportTokenProviderOpts.ts +++ b/packages/di/src/common/interfaces/ImportTokenProviderOpts.ts @@ -1,4 +1,5 @@ import type {AbstractType, Type} from "@tsed/core"; + import type {TokenProvider} from "./TokenProvider.js"; export type UseImportTokenProviderOpts = { diff --git a/packages/di/src/common/interfaces/ProviderOpts.ts b/packages/di/src/common/interfaces/ProviderOpts.ts index 9ea743878d3..9f191a5657f 100644 --- a/packages/di/src/common/interfaces/ProviderOpts.ts +++ b/packages/di/src/common/interfaces/ProviderOpts.ts @@ -1,7 +1,8 @@ import type {Type} from "@tsed/core"; + +import type {ProviderScope} from "../domain/ProviderScope.js"; import type {ProviderType} from "../domain/ProviderType.js"; import type {DIResolver} from "./DIResolver.js"; -import type {ProviderScope} from "../domain/ProviderScope.js"; import type {TokenProvider} from "./TokenProvider.js"; export interface ProviderOpts { diff --git a/packages/di/src/common/interfaces/RegistrySettings.ts b/packages/di/src/common/interfaces/RegistrySettings.ts index 975e064432b..91444bc3fe9 100644 --- a/packages/di/src/common/interfaces/RegistrySettings.ts +++ b/packages/di/src/common/interfaces/RegistrySettings.ts @@ -1,4 +1,5 @@ import {Type} from "@tsed/core"; + import type {LocalsContainer} from "../domain/LocalsContainer.js"; import type {Provider} from "../domain/Provider.js"; import type {InjectorService} from "../services/InjectorService.js"; diff --git a/packages/di/src/common/interfaces/TokenProvider.ts b/packages/di/src/common/interfaces/TokenProvider.ts index 7e651fd5b6c..825fc67833b 100644 --- a/packages/di/src/common/interfaces/TokenProvider.ts +++ b/packages/di/src/common/interfaces/TokenProvider.ts @@ -1,3 +1,3 @@ -import type {Type, AbstractType} from "@tsed/core"; +import type {AbstractType, Type} from "@tsed/core"; export type TokenProvider = string | symbol | Type | AbstractType | Function; diff --git a/packages/di/src/common/registries/GlobalProviders.spec.ts b/packages/di/src/common/registries/GlobalProviders.spec.ts index b83e79e3952..25cd6d877fd 100644 --- a/packages/di/src/common/registries/GlobalProviders.spec.ts +++ b/packages/di/src/common/registries/GlobalProviders.spec.ts @@ -1,5 +1,3 @@ -import {s} from "vite/dist/node/types.d-aGj9QkWt.js"; -import {a} from "vitest/dist/suite-CRLAhsm0.js"; import {LocalsContainer} from "../domain/LocalsContainer.js"; import {Provider} from "../domain/Provider.js"; import {ProviderType} from "../domain/ProviderType.js"; diff --git a/packages/di/src/common/registries/GlobalProviders.ts b/packages/di/src/common/registries/GlobalProviders.ts index b6096d03b31..9b3ca327f76 100644 --- a/packages/di/src/common/registries/GlobalProviders.ts +++ b/packages/di/src/common/registries/GlobalProviders.ts @@ -1,4 +1,5 @@ import {getClassOrSymbol, Type} from "@tsed/core"; + import type {LocalsContainer} from "../domain/LocalsContainer.js"; import {Provider} from "../domain/Provider.js"; import {ProviderType} from "../domain/ProviderType.js"; diff --git a/packages/di/src/common/registries/ProviderRegistry.spec.ts b/packages/di/src/common/registries/ProviderRegistry.spec.ts index dca1ff5c87d..a3efc8c6a13 100644 --- a/packages/di/src/common/registries/ProviderRegistry.spec.ts +++ b/packages/di/src/common/registries/ProviderRegistry.spec.ts @@ -13,7 +13,7 @@ describe("ProviderRegistry", () => { vi.resetAllMocks(); }); - it("should throw an error when provide field is not given ", () => { + it("should throw an error when provide field is not given", () => { // GIVEN let actualError; try { @@ -30,7 +30,7 @@ describe("ProviderRegistry", () => { registerProvider({provide: Test}); - expect(GlobalProviders.merge).toBeCalledWith(Test, { + expect(GlobalProviders.merge).toHaveBeenCalledWith(Test, { provide: Test }); }); @@ -49,7 +49,7 @@ describe("ProviderRegistry", () => { registerValue(token, "myValue"); - expect(GlobalProviders.merge).toBeCalledWith(token, { + expect(GlobalProviders.merge).toHaveBeenCalledWith(token, { provide: token, useValue: "myValue", scope: ProviderScope.SINGLETON, @@ -62,7 +62,7 @@ describe("ProviderRegistry", () => { registerValue({provide: token, useValue: "myValue", scope: ProviderScope.REQUEST}); - expect(GlobalProviders.merge).toBeCalledWith(token, { + expect(GlobalProviders.merge).toHaveBeenCalledWith(token, { provide: token, useValue: "myValue", scope: ProviderScope.REQUEST, @@ -75,7 +75,7 @@ describe("ProviderRegistry", () => { registerValue(token, "myValue"); - expect(GlobalProviders.merge).toBeCalledWith(token, { + expect(GlobalProviders.merge).toHaveBeenCalledWith(token, { provide: token, useValue: "myValue", scope: ProviderScope.SINGLETON, diff --git a/packages/di/src/common/services/DIConfiguration.spec.ts b/packages/di/src/common/services/DIConfiguration.spec.ts index 295bc789b55..2579c54c63c 100644 --- a/packages/di/src/common/services/DIConfiguration.spec.ts +++ b/packages/di/src/common/services/DIConfiguration.spec.ts @@ -1,4 +1,5 @@ import {Env} from "@tsed/core"; + import {DIConfiguration} from "./DIConfiguration.js"; describe("DIConfiguration", () => { diff --git a/packages/di/src/common/services/DIConfiguration.ts b/packages/di/src/common/services/DIConfiguration.ts index c0921c89d84..26c5f5f734b 100644 --- a/packages/di/src/common/services/DIConfiguration.ts +++ b/packages/di/src/common/services/DIConfiguration.ts @@ -1,4 +1,5 @@ import {Env, getValue, proxyDelegation, setValue} from "@tsed/core"; + import type {ProviderScope} from "../domain/ProviderScope.js"; import type {DILoggerOptions} from "../interfaces/DILoggerOptions.js"; import type {DIResolver} from "../interfaces/DIResolver.js"; diff --git a/packages/di/src/common/services/InjectorService.spec.ts b/packages/di/src/common/services/InjectorService.spec.ts index f4740bd1fc2..2e5c43bd97d 100644 --- a/packages/di/src/common/services/InjectorService.spec.ts +++ b/packages/di/src/common/services/InjectorService.spec.ts @@ -1,4 +1,5 @@ import {Store} from "@tsed/core"; + import {DI_USE_OPTIONS} from "../constants/constants.js"; import {Configuration} from "../decorators/configuration.js"; import {Inject} from "../decorators/inject.js"; @@ -95,45 +96,15 @@ describe("InjectorService", () => { // THEN expect(result1 !== result2).toEqual(true); - expect(injector.getProvider).toBeCalledWith(token); + expect(injector.getProvider).toHaveBeenCalledWith(token); expect(injector.get("alias")).toBeInstanceOf(token); - expect((injector as any).resolve).toBeCalledWith(token, locals, {rebuild: true}); - expect((injector as any).invoke).toBeCalledWith(InjectorService, locals, { + expect((injector as any).resolve).toHaveBeenCalledWith(token, locals, {rebuild: true}); + expect((injector as any).invoke).toHaveBeenCalledWith(InjectorService, locals, { parent: token }); }); }); - describe("when provider is a SINGLETON", () => { - it("should invoke the provider from container", async () => { - // GIVEN - const token = class Test {}; - - const provider = new Provider(token); - provider.scope = ProviderScope.SINGLETON; - - const injector = new InjectorService(); - const container = new Container(); - container.set(token, provider); - - await injector.load(container); - - vi.spyOn(injector as any, "resolve"); - vi.spyOn(injector, "getProvider"); - - const locals = new LocalsContainer(); - - // WHEN - - const result1: any = injector.invoke(token, locals); - const result2: any = injector.invoke(token, locals); - - // THEN - expect(result1).toEqual(result2); - - return expect((injector as any).resolve).not.toBeCalled(); - }); - }); describe("when provider is a REQUEST", () => { it("should invoke a request from local container", async () => { // GIVEN @@ -166,12 +137,12 @@ describe("InjectorService", () => { expect(result1).toEqual(result2); expect(result2 !== result3).toEqual(true); - expect(injector.getProvider).toBeCalledWith(token); - expect((injector as any).resolve).toBeCalledWith(token, locals, {}); + expect(injector.getProvider).toHaveBeenCalledWith(token); + expect((injector as any).resolve).toHaveBeenCalledWith(token, locals, {}); expect(locals.get(token)).toEqual(result1); expect(locals2.get(token)).toEqual(result3); - return expect(injector.get).not.toBeCalled(); + return expect(injector.get).not.toHaveBeenCalled(); }); }); describe("when provider is a INSTANCE", () => { @@ -201,11 +172,11 @@ describe("InjectorService", () => { // THEN expect(result1 !== result2).toEqual(true); - expect(injector.getProvider).toBeCalledWith(token); - expect((injector as any).resolve).toBeCalledWith(token, locals, {}); + expect(injector.getProvider).toHaveBeenCalledWith(token); + expect((injector as any).resolve).toHaveBeenCalledWith(token, locals, {}); expect(locals.has(token)).toEqual(false); - return expect(injector.get).not.toBeCalled(); + return expect(injector.get).not.toHaveBeenCalled(); }); }); describe("when provider is a SINGLETON", () => { @@ -229,7 +200,35 @@ describe("InjectorService", () => { // THEN expect(result).toBeInstanceOf(token); - expect(GlobalProviders.onInvoke).toBeCalledWith(provider, expect.any(LocalsContainer), expect.anything()); + expect(GlobalProviders.onInvoke).toHaveBeenCalledWith(provider, expect.any(LocalsContainer), expect.anything()); + }); + it("should invoke the provider from container (2)", async () => { + // GIVEN + const token = class Test {}; + + const provider = new Provider(token); + provider.scope = ProviderScope.SINGLETON; + + const injector = new InjectorService(); + const container = new Container(); + container.set(token, provider); + + await injector.load(container); + + vi.spyOn(injector as any, "resolve"); + vi.spyOn(injector, "getProvider"); + + const locals = new LocalsContainer(); + + // WHEN + + const result1: any = injector.invoke(token, locals); + const result2: any = injector.invoke(token, locals); + + // THEN + expect(result1).toEqual(result2); + + return expect((injector as any).resolve).not.toHaveBeenCalled(); }); }); describe("when provider is a Value (useValue)", () => { @@ -736,7 +735,7 @@ describe("InjectorService", () => { const value = injector.alter("$alterValue", "value"); - expect(service.$alterValue).toBeCalledWith("value"); + expect(service.$alterValue).toHaveBeenCalledWith("value"); expect(value).toEqual("alteredValue"); }); it("should alter value (factory)", () => { @@ -781,7 +780,7 @@ describe("InjectorService", () => { const value = await injector.alterAsync("$alterValue", "value"); - expect(service.$alterValue).toBeCalledWith("value"); + expect(service.$alterValue).toHaveBeenCalledWith("value"); expect(value).toEqual("alteredValue"); }); }); diff --git a/packages/di/src/common/services/InjectorService.ts b/packages/di/src/common/services/InjectorService.ts index e962fd5de29..9a17809c93f 100644 --- a/packages/di/src/common/services/InjectorService.ts +++ b/packages/di/src/common/services/InjectorService.ts @@ -12,6 +12,7 @@ import { nameOf, Store } from "@tsed/core"; + import {DI_INVOKE_OPTIONS, DI_USE_PARAM_OPTIONS} from "../constants/constants.js"; import {Configuration} from "../decorators/configuration.js"; import {Injectable} from "../decorators/injectable.js"; diff --git a/packages/di/src/common/utils/__mock__/module1/Module1.ts b/packages/di/src/common/utils/__mock__/module1/Module1.ts index 48ec976f4dc..a260f426fd3 100644 --- a/packages/di/src/common/utils/__mock__/module1/Module1.ts +++ b/packages/di/src/common/utils/__mock__/module1/Module1.ts @@ -1,6 +1,6 @@ -import {SubModule} from "./submodule/SubModule.js"; import {Module} from "../../../decorators/module.js"; import {M1Ctrl1} from "./controllers/M1Ctrl1.js"; +import {SubModule} from "./submodule/SubModule.js"; @Module({ mount: { diff --git a/packages/di/src/common/utils/createContainer.ts b/packages/di/src/common/utils/createContainer.ts index 1a6d809e8a5..7c26b1d06e5 100644 --- a/packages/di/src/common/utils/createContainer.ts +++ b/packages/di/src/common/utils/createContainer.ts @@ -1,4 +1,5 @@ import {Type} from "@tsed/core"; + import {Container} from "../domain/Container.js"; import {GlobalProviders} from "../registries/GlobalProviders.js"; diff --git a/packages/di/src/common/utils/resolveControllers.spec.ts b/packages/di/src/common/utils/resolveControllers.spec.ts index 1f58270f225..b17ad472a6b 100644 --- a/packages/di/src/common/utils/resolveControllers.spec.ts +++ b/packages/di/src/common/utils/resolveControllers.spec.ts @@ -1,9 +1,10 @@ import {nameOf} from "@tsed/core"; + import {Controller} from "../decorators/controller.js"; -import {Module1} from "./__mock__/module1/Module1.js"; -import {Module2} from "./__mock__/module2/Module2.js"; import {M1Ctrl1} from "./__mock__/module1/controllers/M1Ctrl1.js"; +import {Module1} from "./__mock__/module1/Module1.js"; import {M2Ctrl} from "./__mock__/module2/controllers/M2Ctrl.js"; +import {Module2} from "./__mock__/module2/Module2.js"; import {resolveControllers} from "./resolveControllers.js"; @Controller("/root") diff --git a/packages/di/src/common/utils/resolveControllers.ts b/packages/di/src/common/utils/resolveControllers.ts index 002e1a99ed0..31824b9b43f 100644 --- a/packages/di/src/common/utils/resolveControllers.ts +++ b/packages/di/src/common/utils/resolveControllers.ts @@ -1,9 +1,10 @@ import {isArray, isClass} from "@tsed/core"; -import {TokenProvider} from "../interfaces/TokenProvider.js"; -import {GlobalProviders} from "../registries/GlobalProviders.js"; -import {ProviderType} from "../domain/ProviderType.js"; + import {Provider} from "../domain/Provider.js"; +import {ProviderType} from "../domain/ProviderType.js"; +import {TokenProvider} from "../interfaces/TokenProvider.js"; import {TokenRoute} from "../interfaces/TokenRoute.js"; +import {GlobalProviders} from "../registries/GlobalProviders.js"; const lookupProperties = ["mount", "imports"]; diff --git a/packages/di/src/node/decorators/injectContext.spec.ts b/packages/di/src/node/decorators/injectContext.spec.ts index 72d72186a1b..c8f7e2a87f6 100644 --- a/packages/di/src/node/decorators/injectContext.spec.ts +++ b/packages/di/src/node/decorators/injectContext.spec.ts @@ -1,4 +1,5 @@ import {afterEach, beforeEach, expect} from "vitest"; + import {Injectable} from "../../common/index.js"; import {DIContext} from "../domain/DIContext.js"; import {DITest} from "../services/DITest.js"; diff --git a/packages/di/src/node/decorators/injectContext.ts b/packages/di/src/node/decorators/injectContext.ts index bab4ad24412..d483ef0b2c8 100644 --- a/packages/di/src/node/decorators/injectContext.ts +++ b/packages/di/src/node/decorators/injectContext.ts @@ -1,4 +1,5 @@ import {catchError} from "@tsed/core"; + import {InjectorService} from "../../common/index.js"; import {DIContext} from "../domain/DIContext.js"; import {getContext} from "../utils/asyncHookContext.js"; diff --git a/packages/di/src/node/domain/ContextLogger.spec.ts b/packages/di/src/node/domain/ContextLogger.spec.ts index 0eef4c29dd5..7e33d8f2baf 100644 --- a/packages/di/src/node/domain/ContextLogger.spec.ts +++ b/packages/di/src/node/domain/ContextLogger.spec.ts @@ -54,49 +54,49 @@ describe("ContextLogger", () => { contextLogger.flush(); // THEN - expect(logger.info).toBeCalledWith({ + expect(logger.info).toHaveBeenCalledWith({ minimal: "minimal", duration: 1, reqId: "id", test: "test", time: expect.any(Date) }); - expect(logger.info).toBeCalledWith({ + expect(logger.info).toHaveBeenCalledWith({ minimal: "minimal", duration: 1, reqId: "id", message: "message", time: expect.any(Date) }); - expect(logger.debug).toBeCalledWith({ + expect(logger.debug).toHaveBeenCalledWith({ complete: "complete", duration: 1, reqId: "id", test: "test", time: expect.any(Date) }); - expect(logger.warn).toBeCalledWith({ + expect(logger.warn).toHaveBeenCalledWith({ complete: "complete", duration: 1, reqId: "id", test: "test", time: expect.any(Date) }); - expect(logger.error).toBeCalledWith({ + expect(logger.error).toHaveBeenCalledWith({ complete: "complete", duration: 1, reqId: "id", test: "test", time: expect.any(Date) }); - expect(logger.fatal).toBeCalledWith({ + expect(logger.fatal).toHaveBeenCalledWith({ complete: "complete", duration: 1, reqId: "id", test: "test", time: expect.any(Date) }); - expect(logger.trace).toBeCalledWith({ + expect(logger.trace).toHaveBeenCalledWith({ complete: "complete", duration: 1, reqId: "id", @@ -139,37 +139,37 @@ describe("ContextLogger", () => { contextLogger.flush(); // THEN - expect(logger.info).toBeCalledWith({ + expect(logger.info).toHaveBeenCalledWith({ duration: 1, reqId: "id", test: "test", time: expect.any(Date) }); - expect(logger.info).toBeCalledWith({ + expect(logger.info).toHaveBeenCalledWith({ duration: 1, reqId: "id", message: "message", time: expect.any(Date) }); - expect(logger.debug).toBeCalledWith({ + expect(logger.debug).toHaveBeenCalledWith({ duration: 1, reqId: "id", test: "test", time: expect.any(Date) }); - expect(logger.warn).toBeCalledWith({ + expect(logger.warn).toHaveBeenCalledWith({ duration: 1, reqId: "id", test: "test", time: expect.any(Date) }); - expect(logger.error).toBeCalledWith({ + expect(logger.error).toHaveBeenCalledWith({ duration: 1, reqId: "id", test: "test", time: expect.any(Date) }); - expect(logger.trace).toBeCalledWith({ + expect(logger.trace).toHaveBeenCalledWith({ duration: 1, reqId: "id", test: "test", @@ -208,7 +208,7 @@ describe("ContextLogger", () => { contextLogger.flush(); // THEN - return expect(logger.info).not.toBeCalled(); + return expect(logger.info).not.toHaveBeenCalled(); }); it("should create a new Context and flush log when maxStackSize is reached", () => { const logger = { @@ -242,7 +242,7 @@ describe("ContextLogger", () => { contextLogger.info({test: "test"}); // THEN - return expect(logger.info).toBeCalledTimes(3); + return expect(logger.info).toHaveBeenCalledTimes(3); }); it("should do nothing when the log level is off", () => { const logger = { @@ -278,6 +278,6 @@ describe("ContextLogger", () => { contextLogger.flush(); // THEN - expect(logger.info).not.toBeCalled(); + expect(logger.info).not.toHaveBeenCalled(); }); }); diff --git a/packages/di/src/node/domain/ContextLogger.ts b/packages/di/src/node/domain/ContextLogger.ts index b60925dddad..ee2f306c5a0 100644 --- a/packages/di/src/node/domain/ContextLogger.ts +++ b/packages/di/src/node/domain/ContextLogger.ts @@ -1,7 +1,8 @@ -import {DILogger} from "../../common/index.js"; import {Hooks} from "@tsed/core"; import {levels, LogLevel} from "@tsed/logger"; +import {DILogger} from "../../common/index.js"; + export interface ContextLoggerOptions extends Record { id: string; logger?: DILogger; diff --git a/packages/di/src/node/integration/async-factory-invoke.spec.ts b/packages/di/src/node/integration/async-factory-invoke.spec.ts index ea84efe46c2..dcd3eaa48ea 100644 --- a/packages/di/src/node/integration/async-factory-invoke.spec.ts +++ b/packages/di/src/node/integration/async-factory-invoke.spec.ts @@ -1,4 +1,4 @@ -import {Inject, Injectable, registerProvider, DITest} from "../../index.js"; +import {DITest, Inject, Injectable, registerProvider} from "../../index.js"; const PrimaryPostgresDb = Symbol.for("PrimaryPostgresDb"); type PrimaryPostgresDb = {id: string}; diff --git a/packages/di/src/node/integration/invoke-oninit.spec.ts b/packages/di/src/node/integration/invoke-oninit.spec.ts index d9686639aa6..49784b6ba24 100644 --- a/packages/di/src/node/integration/invoke-oninit.spec.ts +++ b/packages/di/src/node/integration/invoke-oninit.spec.ts @@ -1,4 +1,4 @@ -import {Inject, Injectable, registerProvider, DITest} from "../../index.js"; +import {DITest, Inject, Injectable, registerProvider} from "../../index.js"; @Injectable() export class MyService { diff --git a/packages/di/src/node/services/DILogger.spec.ts b/packages/di/src/node/services/DILogger.spec.ts index a847cbe7eb7..06f522ccbf1 100644 --- a/packages/di/src/node/services/DILogger.spec.ts +++ b/packages/di/src/node/services/DILogger.spec.ts @@ -1,4 +1,5 @@ import {Logger} from "@tsed/logger"; + import {Container, Inject, Injectable, InjectorService} from "../../common/index.js"; describe("DILogger", () => { diff --git a/packages/di/src/node/services/DILogger.ts b/packages/di/src/node/services/DILogger.ts index 6eb7e2f6a04..8ca72f3c3fa 100644 --- a/packages/di/src/node/services/DILogger.ts +++ b/packages/di/src/node/services/DILogger.ts @@ -1,4 +1,5 @@ import {Logger} from "@tsed/logger"; + import {InjectorService, registerProvider} from "../../common/index.js"; registerProvider({ diff --git a/packages/di/src/node/services/DITest.spec.ts b/packages/di/src/node/services/DITest.spec.ts index 6eb42684805..b3d75ac9ea3 100644 --- a/packages/di/src/node/services/DITest.spec.ts +++ b/packages/di/src/node/services/DITest.spec.ts @@ -1,4 +1,5 @@ import {Logger} from "@tsed/logger"; + import {Inject, Injectable, InjectorService, registerProvider, Service} from "../../index.js"; import {DITest} from "../services/DITest.js"; diff --git a/packages/di/src/node/services/DITest.ts b/packages/di/src/node/services/DITest.ts index 144ed1fc9e2..d34674b0841 100644 --- a/packages/di/src/node/services/DITest.ts +++ b/packages/di/src/node/services/DITest.ts @@ -1,5 +1,6 @@ import {Env, getValue, isClass, isObject, isPromise, setValue} from "@tsed/core"; import {$log} from "@tsed/logger"; + import { createContainer, DI_INJECTABLE_PROPS, diff --git a/packages/di/src/node/utils/__mock__/module1/Module1.ts b/packages/di/src/node/utils/__mock__/module1/Module1.ts index 48ec976f4dc..a260f426fd3 100644 --- a/packages/di/src/node/utils/__mock__/module1/Module1.ts +++ b/packages/di/src/node/utils/__mock__/module1/Module1.ts @@ -1,6 +1,6 @@ -import {SubModule} from "./submodule/SubModule.js"; import {Module} from "../../../decorators/module.js"; import {M1Ctrl1} from "./controllers/M1Ctrl1.js"; +import {SubModule} from "./submodule/SubModule.js"; @Module({ mount: { diff --git a/packages/di/src/node/utils/asyncHookContext.ts b/packages/di/src/node/utils/asyncHookContext.ts index 1c67639523b..104087a335d 100644 --- a/packages/di/src/node/utils/asyncHookContext.ts +++ b/packages/di/src/node/utils/asyncHookContext.ts @@ -1,4 +1,5 @@ import {AsyncLocalStorage, AsyncResource} from "async_hooks"; + import {InjectorService} from "../../common/index.js"; import type {DIContext} from "../domain/DIContext.js"; diff --git a/packages/di/src/node/utils/attachLogger.spec.ts b/packages/di/src/node/utils/attachLogger.spec.ts index 0e608ae11ce..14782a42c55 100644 --- a/packages/di/src/node/utils/attachLogger.spec.ts +++ b/packages/di/src/node/utils/attachLogger.spec.ts @@ -1,4 +1,5 @@ import {Logger} from "@tsed/logger"; + import {InjectorService} from "../../common/index.js"; import {attachLogger} from "./attachLogger.js"; diff --git a/packages/di/src/node/utils/setLoggerConfiguration.spec.ts b/packages/di/src/node/utils/setLoggerConfiguration.spec.ts index 54ec4f94ce7..685ba2bd584 100644 --- a/packages/di/src/node/utils/setLoggerConfiguration.spec.ts +++ b/packages/di/src/node/utils/setLoggerConfiguration.spec.ts @@ -1,4 +1,5 @@ import {Logger} from "@tsed/logger"; + import {InjectorService} from "../../common/index.js"; import {setLoggerConfiguration} from "./setLoggerConfiguration.js"; @@ -22,7 +23,7 @@ describe("setLoggerConfiguration", () => { setLoggerConfiguration(injector); - expect(injector.logger.appenders.set).toBeCalledWith("stdout", { + expect(injector.logger.appenders.set).toHaveBeenCalledWith("stdout", { type: "stdout", levels: ["info", "debug"], layout: { @@ -31,7 +32,7 @@ describe("setLoggerConfiguration", () => { } }); - expect(injector.logger.appenders.set).toBeCalledWith("stderr", { + expect(injector.logger.appenders.set).toHaveBeenCalledWith("stderr", { levels: ["trace", "fatal", "error", "warn"], type: "stderr", layout: { diff --git a/packages/di/tsconfig.esm.json b/packages/di/tsconfig.esm.json index e3b07081667..4c2a1ac34b9 100644 --- a/packages/di/tsconfig.esm.json +++ b/packages/di/tsconfig.esm.json @@ -2,8 +2,6 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "module": "ESNext", - "moduleResolution": "nodenext", "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", @@ -11,7 +9,10 @@ "composite": true, "noEmit": false }, - "include": ["src", "src/**/*.json"], + "include": [ + "src", + "src/**/*.json" + ], "exclude": [ "node_modules", "test", diff --git a/packages/di/tsconfig.spec.json b/packages/di/tsconfig.spec.json index 079424388b4..c0db232c547 100644 --- a/packages/di/tsconfig.spec.json +++ b/packages/di/tsconfig.spec.json @@ -3,7 +3,6 @@ "compilerOptions": { "baseUrl": ".", "rootDir": "..", - "module": "commonjs", "outDir": "./lib/cjs", "declaration": false, "composite": false, diff --git a/packages/engines/package.json b/packages/engines/package.json index 9bebce78452..41be88180f5 100644 --- a/packages/engines/package.json +++ b/packages/engines/package.json @@ -77,7 +77,7 @@ "ts-node": "10.9.2", "twig": "^1.15.2", "twing": "^5.0.2", - "typescript": "4.9.5", + "typescript": "5.6.2", "underscore": "^1.11.0", "vash": "^0.13.0", "velocityjs": "^2.0.1", diff --git a/packages/engines/src/components/DustEngine.ts b/packages/engines/src/components/DustEngine.ts index fa53416caa5..8a878cfcc58 100644 --- a/packages/engines/src/components/DustEngine.ts +++ b/packages/engines/src/components/DustEngine.ts @@ -1,8 +1,9 @@ -import {read} from "../utils/cache.js"; import {extname} from "path"; +import {promisify} from "util"; + import {ViewEngine} from "../decorators/viewEngine.js"; +import {read} from "../utils/cache.js"; import {Engine} from "./Engine.js"; -import {promisify} from "util"; @ViewEngine("dust", { requires: ["dustjs-helpers", "dustjs-linkedin"] diff --git a/packages/engines/src/components/EctEngine.ts b/packages/engines/src/components/EctEngine.ts index 025a5b74a45..c7284cd811b 100644 --- a/packages/engines/src/components/EctEngine.ts +++ b/packages/engines/src/components/EctEngine.ts @@ -1,4 +1,5 @@ import {promisify} from "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 5dc4537b15a..98349d1be0a 100644 --- a/packages/engines/src/components/HoganEngine.spec.ts +++ b/packages/engines/src/components/HoganEngine.spec.ts @@ -1,4 +1,5 @@ import {join} from "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 6fd9193d882..4fd060f0838 100644 --- a/packages/engines/src/components/JustEngine.ts +++ b/packages/engines/src/components/JustEngine.ts @@ -1,4 +1,5 @@ import {promisify} from "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 834ca7c0b0b..18f87ab9b89 100644 --- a/packages/engines/src/components/NunjucksEngine.ts +++ b/packages/engines/src/components/NunjucksEngine.ts @@ -1,4 +1,5 @@ import {promisify} from "util"; + import {ViewEngine} from "../decorators/viewEngine.js"; import {Engine} from "./Engine.js"; @@ -14,7 +15,6 @@ export class NunjucksEngine extends Engine { if (options.settings && options.settings.views) { env = engine.configure(options.settings.views); } else if (options.nunjucks && options.nunjucks.configure) { - // eslint-disable-next-line prefer-spread env = engine.configure.apply(engine, options.nunjucks.configure); } diff --git a/packages/engines/src/components/ReactEngine.ts b/packages/engines/src/components/ReactEngine.ts index 955dee912b8..32a554b928c 100644 --- a/packages/engines/src/components/ReactEngine.ts +++ b/packages/engines/src/components/ReactEngine.ts @@ -1,8 +1,9 @@ -import {resolve} from "path"; import {readFileSync} from "fs"; +import {resolve} from "path"; + import {ViewEngine} from "../decorators/viewEngine.js"; -import {Engine, EngineOptions, ViewEngineOptions} from "./Engine.js"; import {getCachedEngine, getFromCache, importEngine, setToCache} from "../utils/cache.js"; +import {Engine, EngineOptions, ViewEngineOptions} from "./Engine.js"; @ViewEngine("react", { requires: ["react"] diff --git a/packages/engines/src/components/SquirrellyEngine.spec.ts b/packages/engines/src/components/SquirrellyEngine.spec.ts index e4a8714f262..7cc48da5f2a 100644 --- a/packages/engines/src/components/SquirrellyEngine.spec.ts +++ b/packages/engines/src/components/SquirrellyEngine.spec.ts @@ -1,4 +1,5 @@ import {join} from "path"; + import {getEngineFixture} from "../../test/getEngineFixture.js"; import {requires} from "../utils/cache.js"; import {SquirrellyEngine} from "./SquirrellyEngine.js"; diff --git a/packages/engines/src/components/TwingEngine.ts b/packages/engines/src/components/TwingEngine.ts index 71baa43c367..be96cf5d7fa 100644 --- a/packages/engines/src/components/TwingEngine.ts +++ b/packages/engines/src/components/TwingEngine.ts @@ -1,6 +1,7 @@ +import {existsSync} from "fs"; + import {ViewEngine} from "../decorators/viewEngine.js"; import {Engine} from "./Engine.js"; -import {existsSync} from "fs"; @ViewEngine("twing") export class TwingEngine extends Engine { diff --git a/packages/engines/src/components/VashEngine.ts b/packages/engines/src/components/VashEngine.ts index eb017e93051..1b65cac677c 100644 --- a/packages/engines/src/components/VashEngine.ts +++ b/packages/engines/src/components/VashEngine.ts @@ -1,4 +1,5 @@ import {promisify} from "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 5e85fea61e0..8689fa8e819 100644 --- a/packages/engines/src/utils/cache.ts +++ b/packages/engines/src/utils/cache.ts @@ -1,6 +1,7 @@ -import fs from "fs"; -import {dirname, extname, isAbsolute, join} from "node:path"; 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 07b8c87d40b..e5c70700944 100644 --- a/packages/engines/src/utils/getEngines.spec.ts +++ b/packages/engines/src/utils/getEngines.spec.ts @@ -1,6 +1,8 @@ +import "../index.js"; + import {join} from "path"; + import {getEngine, getEngines} from "./getEngines.js"; -import "../index.js"; const rootDir = import.meta.dirname; diff --git a/packages/engines/test/getEngineFixture.ts b/packages/engines/test/getEngineFixture.ts index 85b2d9ecbcc..381d99443f4 100644 --- a/packages/engines/test/getEngineFixture.ts +++ b/packages/engines/test/getEngineFixture.ts @@ -1,4 +1,5 @@ import fs from "fs"; + import {Engine} from "../src/components/Engine.js"; import {engines} from "../src/index.js"; diff --git a/packages/engines/test/integration.spec.ts b/packages/engines/test/integration.spec.ts index f23b2f552b7..33cf52f4531 100644 --- a/packages/engines/test/integration.spec.ts +++ b/packages/engines/test/integration.spec.ts @@ -1,9 +1,10 @@ import "../src/index.js"; -import * as sharedTest from "./shared/index.js"; + import * as sharedFiltersTest from "./shared/filters.js"; +import * as sharedHelpersTest from "./shared/helpers.js"; import * as sharedIncludesTest from "./shared/includes.js"; +import * as sharedTest from "./shared/index.js"; import * as sharedPartialsTest from "./shared/partials.js"; -import * as sharedHelpersTest from "./shared/helpers.js"; describe("integration", () => { sharedTest.test("pug"); diff --git a/packages/engines/test/shared/dust.ts b/packages/engines/test/shared/dust.ts index 386230a8dcc..3b750056b74 100644 --- a/packages/engines/test/shared/dust.ts +++ b/packages/engines/test/shared/dust.ts @@ -1,7 +1,8 @@ -import {engines, requires} from "../../src/index.js"; import fs from "fs"; import {join} from "path"; +import {engines, requires} from "../../src/index.js"; + const rootDir = join(import.meta.dirname, ".."); export function test(name: string) { diff --git a/packages/engines/test/shared/filters.ts b/packages/engines/test/shared/filters.ts index 734b9d7e96a..09dbb21c01c 100644 --- a/packages/engines/test/shared/filters.ts +++ b/packages/engines/test/shared/filters.ts @@ -1,7 +1,8 @@ -import {engines} from "../../src/index.js"; import fs from "fs"; import {join} from "path"; +import {engines} from "../../src/index.js"; + const rootDir = join(import.meta.dirname, ".."); export function test(name: string) { diff --git a/packages/engines/test/shared/helpers.ts b/packages/engines/test/shared/helpers.ts index 3255db15195..cf1adacef25 100644 --- a/packages/engines/test/shared/helpers.ts +++ b/packages/engines/test/shared/helpers.ts @@ -1,8 +1,9 @@ -import {engines} from "../../src/index.js"; -import handlebars from "handlebars"; import fs from "fs"; +import handlebars from "handlebars"; import {join} from "path"; +import {engines} from "../../src/index.js"; + const Sqrl = require("squirrelly"); const rootDir = join(import.meta.dirname, ".."); diff --git a/packages/engines/test/shared/includes.ts b/packages/engines/test/shared/includes.ts index 431de4cfb25..44c38f9669e 100644 --- a/packages/engines/test/shared/includes.ts +++ b/packages/engines/test/shared/includes.ts @@ -1,5 +1,6 @@ import fs from "fs"; import {join} from "path"; + import {engines} from "../../src/index.js"; const rootDir = join(import.meta.dirname, ".."); diff --git a/packages/engines/test/shared/index.ts b/packages/engines/test/shared/index.ts index 46123676a9f..2a8999171ce 100644 --- a/packages/engines/test/shared/index.ts +++ b/packages/engines/test/shared/index.ts @@ -1,5 +1,6 @@ import fs from "fs"; import {join} from "path"; + import {engines, requires} from "../../src/index.js"; const rootDir = join(import.meta.dirname, ".."); diff --git a/packages/engines/test/shared/partials.ts b/packages/engines/test/shared/partials.ts index 5c3d860557b..4faf7708a1b 100644 --- a/packages/engines/test/shared/partials.ts +++ b/packages/engines/test/shared/partials.ts @@ -1,6 +1,7 @@ -import {engines} from "../../src/index.js"; -import {join} from "path"; import fs from "fs"; +import {join} from "path"; + +import {engines} from "../../src/index.js"; const rootDir = join(import.meta.dirname, ".."); diff --git a/packages/engines/test/shared/react.ts b/packages/engines/test/shared/react.ts index 474d0b2b3fe..4a30583e4c6 100644 --- a/packages/engines/test/shared/react.ts +++ b/packages/engines/test/shared/react.ts @@ -1,5 +1,6 @@ import fs from "fs"; import {join} from "path"; + import {engines} from "../../src/index.js"; const rootDir = join(import.meta.dirname, ".."); diff --git a/packages/engines/tsconfig.esm.json b/packages/engines/tsconfig.esm.json index e3b07081667..82292550ddb 100644 --- a/packages/engines/tsconfig.esm.json +++ b/packages/engines/tsconfig.esm.json @@ -2,8 +2,7 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "module": "ESNext", - "moduleResolution": "nodenext", + "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", @@ -11,7 +10,7 @@ "composite": true, "noEmit": false }, - "include": ["src", "src/**/*.json"], + "include": ["src/**/*.ts", "src/**/*.json"], "exclude": [ "node_modules", "test", diff --git a/packages/engines/tsconfig.spec.json b/packages/engines/tsconfig.spec.json index 36d8cd76b16..d0d6ee5dec0 100644 --- a/packages/engines/tsconfig.spec.json +++ b/packages/engines/tsconfig.spec.json @@ -3,7 +3,6 @@ "compilerOptions": { "baseUrl": ".", "rootDir": "..", - "module": "commonjs", "outDir": "./lib/cjs", "declaration": false, "composite": false, diff --git a/packages/graphql/apollo/package.json b/packages/graphql/apollo/package.json index 41fbc656d6b..50fb4c7d18b 100644 --- a/packages/graphql/apollo/package.json +++ b/packages/graphql/apollo/package.json @@ -38,7 +38,7 @@ "apollo-server-testing": "2.25.3", "eslint": "^8.57.0", "graphql": "16.8.2", - "typescript": "4.9.5", + "typescript": "5.6.2", "vitest": "2.0.4" }, "peerDependencies": { diff --git a/packages/graphql/apollo/src/ApolloModule.ts b/packages/graphql/apollo/src/ApolloModule.ts index 1436f7a9d5e..e913a797e26 100644 --- a/packages/graphql/apollo/src/ApolloModule.ts +++ b/packages/graphql/apollo/src/ApolloModule.ts @@ -1,5 +1,6 @@ import {AfterListen, Logger, OnRoutesInit} from "@tsed/common"; -import {Configuration, Inject, Module, InjectorService} from "@tsed/di"; +import {Configuration, Inject, InjectorService, Module} from "@tsed/di"; + import {ApolloSettings} from "./interfaces/ApolloSettings.js"; import {ApolloService} from "./services/ApolloService.js"; diff --git a/packages/graphql/apollo/src/decorators/dataSource.ts b/packages/graphql/apollo/src/decorators/dataSource.ts index 332c10f5049..db2a7ee04d8 100644 --- a/packages/graphql/apollo/src/decorators/dataSource.ts +++ b/packages/graphql/apollo/src/decorators/dataSource.ts @@ -1,5 +1,6 @@ import {StoreSet, useDecorators} from "@tsed/core"; import {Injectable, ProviderScope} from "@tsed/di"; + import {DATASOURCES_PROVIDERS} from "../constants/constants.js"; /** diff --git a/packages/graphql/apollo/src/decorators/injectApolloContext.ts b/packages/graphql/apollo/src/decorators/injectApolloContext.ts index 530bd56e82c..002bef98275 100644 --- a/packages/graphql/apollo/src/decorators/injectApolloContext.ts +++ b/packages/graphql/apollo/src/decorators/injectApolloContext.ts @@ -1,5 +1,6 @@ import {DecoratorParameters, decoratorTypeOf, DecoratorTypes} from "@tsed/core"; import {Inject, InjectContext} from "@tsed/di"; + import {APOLLO_CONTEXT} from "../constants/constants.js"; /** diff --git a/packages/graphql/apollo/src/interfaces/AlterApolloContext.ts b/packages/graphql/apollo/src/interfaces/AlterApolloContext.ts index 6a0301d4e9d..a448a868484 100644 --- a/packages/graphql/apollo/src/interfaces/AlterApolloContext.ts +++ b/packages/graphql/apollo/src/interfaces/AlterApolloContext.ts @@ -1,4 +1,5 @@ import type {PlatformContext} from "@tsed/common"; + import type {ApolloContext} from "./ApolloContext.js"; export interface AlterApolloContext { diff --git a/packages/graphql/apollo/src/interfaces/AlterApolloServerPlugins.ts b/packages/graphql/apollo/src/interfaces/AlterApolloServerPlugins.ts index 5fde4d129d1..8245e90288d 100644 --- a/packages/graphql/apollo/src/interfaces/AlterApolloServerPlugins.ts +++ b/packages/graphql/apollo/src/interfaces/AlterApolloServerPlugins.ts @@ -1,4 +1,5 @@ import type {ApolloServerPlugin} from "@apollo/server"; + import type {ApolloSettings} from "./ApolloSettings.js"; export interface AlterApolloServerPlugins { diff --git a/packages/graphql/apollo/src/interfaces/ApolloSettings.ts b/packages/graphql/apollo/src/interfaces/ApolloSettings.ts index 9793f283519..c5fd8576a42 100644 --- a/packages/graphql/apollo/src/interfaces/ApolloSettings.ts +++ b/packages/graphql/apollo/src/interfaces/ApolloSettings.ts @@ -2,6 +2,7 @@ import type {ApolloServer, ApolloServerOptions, ApolloServerOptionsWithSchema} f import type {GatewayInterface} from "@apollo/server-gateway-interface"; import type {IExecutableSchemaDefinition} from "@graphql-tools/schema"; import type {GraphQLSchema} from "graphql/index.js"; + import type {ApolloContext} from "./ApolloContext.js"; export type ApolloMiddlewareOptions = Record; diff --git a/packages/graphql/apollo/src/services/ApolloService.spec.ts b/packages/graphql/apollo/src/services/ApolloService.spec.ts index 0ea75b00a0a..e1b81386257 100644 --- a/packages/graphql/apollo/src/services/ApolloService.spec.ts +++ b/packages/graphql/apollo/src/services/ApolloService.spec.ts @@ -4,6 +4,7 @@ import {InjectContext, Logger, Opts, PlatformApplication, PlatformContext, Platf import {catchAsyncError} from "@tsed/core"; import {Configuration, Constant, Module, runInContext} from "@tsed/di"; import {HTTPDataSource} from "apollo-datasource-http"; + import {APOLLO_CONTEXT} from "../constants/constants.js"; import {DataSource} from "../decorators/dataSource.js"; import {InjectApolloContext} from "../decorators/injectApolloContext.js"; diff --git a/packages/graphql/apollo/src/services/ApolloService.ts b/packages/graphql/apollo/src/services/ApolloService.ts index 24ab54bf4af..6787f9026e7 100644 --- a/packages/graphql/apollo/src/services/ApolloService.ts +++ b/packages/graphql/apollo/src/services/ApolloService.ts @@ -3,12 +3,13 @@ import {ApolloServerPluginLandingPageDisabled} from "@apollo/server/plugin/disab import {ApolloServerPluginDrainHttpServer} from "@apollo/server/plugin/drainHttpServer"; import {ApolloServerPluginLandingPageLocalDefault} from "@apollo/server/plugin/landingPage/default"; import type {IExecutableSchemaDefinition} from "@graphql-tools/schema"; -import {useContext, InjectorService, LocalsContainer, PlatformApplication, PlatformContext, Provider} from "@tsed/common"; +import {InjectorService, LocalsContainer, PlatformApplication, PlatformContext, Provider, useContext} from "@tsed/common"; import {Constant, Inject, Service} from "@tsed/di"; import {Logger} from "@tsed/logger"; 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"; import type {ApolloCustomServerCB, ApolloSettings} from "../interfaces/ApolloSettings.js"; diff --git a/packages/graphql/apollo/tsconfig.esm.json b/packages/graphql/apollo/tsconfig.esm.json index e3b07081667..82292550ddb 100644 --- a/packages/graphql/apollo/tsconfig.esm.json +++ b/packages/graphql/apollo/tsconfig.esm.json @@ -2,8 +2,7 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "module": "ESNext", - "moduleResolution": "nodenext", + "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", @@ -11,7 +10,7 @@ "composite": true, "noEmit": false }, - "include": ["src", "src/**/*.json"], + "include": ["src/**/*.ts", "src/**/*.json"], "exclude": [ "node_modules", "test", diff --git a/packages/graphql/apollo/tsconfig.spec.json b/packages/graphql/apollo/tsconfig.spec.json index 21485bab96d..2e917f4b39d 100644 --- a/packages/graphql/apollo/tsconfig.spec.json +++ b/packages/graphql/apollo/tsconfig.spec.json @@ -3,7 +3,6 @@ "compilerOptions": { "baseUrl": ".", "rootDir": "../..", - "module": "commonjs", "outDir": "./lib/cjs", "declaration": false, "composite": false, diff --git a/packages/graphql/graphql-ws/package.json b/packages/graphql/graphql-ws/package.json index f2b8b10e10e..ce18db40d90 100644 --- a/packages/graphql/graphql-ws/package.json +++ b/packages/graphql/graphql-ws/package.json @@ -31,7 +31,7 @@ "@tsed/typescript": "workspace:*", "eslint": "^8.57.0", "graphql-ws": "5.16.0", - "typescript": "4.9.5" + "typescript": "5.6.2" }, "peerDependencies": { "@tsed/common": "8.0.0-alpha.5", diff --git a/packages/graphql/graphql-ws/tsconfig.esm.json b/packages/graphql/graphql-ws/tsconfig.esm.json index e3b07081667..82292550ddb 100644 --- a/packages/graphql/graphql-ws/tsconfig.esm.json +++ b/packages/graphql/graphql-ws/tsconfig.esm.json @@ -2,8 +2,7 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "module": "ESNext", - "moduleResolution": "nodenext", + "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", @@ -11,7 +10,7 @@ "composite": true, "noEmit": false }, - "include": ["src", "src/**/*.json"], + "include": ["src/**/*.ts", "src/**/*.json"], "exclude": [ "node_modules", "test", diff --git a/packages/graphql/typegraphql/package.json b/packages/graphql/typegraphql/package.json index 10feeacc97a..5e4eca7daff 100644 --- a/packages/graphql/typegraphql/package.json +++ b/packages/graphql/typegraphql/package.json @@ -43,7 +43,7 @@ "graphql-scalars": "1.23.0", "ts-node": "10.9.2", "type-graphql": ">=2.0.0-rc.2", - "typescript": "4.9.5", + "typescript": "5.6.2", "vitest": "2.0.4" }, "peerDependencies": { diff --git a/packages/graphql/typegraphql/src/TypeGraphQLModule.ts b/packages/graphql/typegraphql/src/TypeGraphQLModule.ts index 60dce48c417..8b82dbbaae2 100644 --- a/packages/graphql/typegraphql/src/TypeGraphQLModule.ts +++ b/packages/graphql/typegraphql/src/TypeGraphQLModule.ts @@ -1,9 +1,11 @@ +import "./interfaces/interfaces.js"; + import {AlterApolloSettings, ApolloSettingsWithID} from "@tsed/apollo"; import {isClass, Type} from "@tsed/core"; import {Configuration, Inject, InjectorService, Module} from "@tsed/di"; import {buildSchema} from "type-graphql"; + import {RESOLVERS_PROVIDERS} from "./constants/constants.js"; -import "./interfaces/interfaces.js"; import {ContextMiddleware} from "./middlewares/ContextMiddleware.js"; /** diff --git a/packages/graphql/typegraphql/src/decorators/resolver.ts b/packages/graphql/typegraphql/src/decorators/resolver.ts index 8ef885f2815..2a0cef36da8 100644 --- a/packages/graphql/typegraphql/src/decorators/resolver.ts +++ b/packages/graphql/typegraphql/src/decorators/resolver.ts @@ -1,6 +1,7 @@ import {StoreSet, useDecorators} from "@tsed/core"; import {Injectable} from "@tsed/di"; import {ClassType, Resolver} from "type-graphql"; + import {RESOLVERS_PROVIDERS} from "../constants/constants.js"; export interface ResolverControllerOptions { diff --git a/packages/graphql/typegraphql/src/interfaces/interfaces.ts b/packages/graphql/typegraphql/src/interfaces/interfaces.ts index 3336da19f85..9e44c071abb 100644 --- a/packages/graphql/typegraphql/src/interfaces/interfaces.ts +++ b/packages/graphql/typegraphql/src/interfaces/interfaces.ts @@ -1,5 +1,5 @@ -import {BuildSchemaOptions} from "type-graphql"; import type {ApolloSettings as AS} from "@tsed/apollo"; +import {BuildSchemaOptions} from "type-graphql"; declare global { namespace TsED { diff --git a/packages/graphql/typegraphql/test/app/Server.ts b/packages/graphql/typegraphql/test/app/Server.ts index 0757e43126b..a6d0ba3fe54 100644 --- a/packages/graphql/typegraphql/test/app/Server.ts +++ b/packages/graphql/typegraphql/test/app/Server.ts @@ -1,20 +1,23 @@ import "@tsed/ajv"; -import {ApolloContext} from "@tsed/apollo"; -import {Configuration, Constant, Inject, PlatformApplication, PlatformContext} from "@tsed/common"; import "@tsed/graphql-ws"; import "@tsed/passport"; -import "@tsed/typegraphql"; +import "../.."; +import "./graphql/index.js"; +import "./protocols/GraphQLProtocol.js"; +import "./services/RecipeService.js"; +import "./services/UsersRepository.js"; + import * as fs from "node:fs"; import {join} from "node:path"; + +import {ApolloContext} from "@tsed/apollo"; +import {Configuration, Constant, Inject, PlatformApplication, PlatformContext} from "@tsed/common"; import {buildContext} from "graphql-passport"; import {resolve} from "path"; + import {HelloController} from "./controllers/HelloController"; import {User} from "./graphql/auth/User.js"; -import "./graphql/index.js"; import {AuthResolver} from "./graphql/index.js"; -import "./protocols/GraphQLProtocol.js"; -import "./services/RecipeService.js"; -import "./services/UsersRepository.js"; import {pubSub} from "./graphql/pubsub/pubsub.js"; const rootDir = import.meta.dirname; // automatically replaced by import.meta.dirname on build diff --git a/packages/graphql/typegraphql/test/app/graphql/auth/AuthResolver.ts b/packages/graphql/typegraphql/test/app/graphql/auth/AuthResolver.ts index 368c6e443b4..6109697d3fc 100644 --- a/packages/graphql/typegraphql/test/app/graphql/auth/AuthResolver.ts +++ b/packages/graphql/typegraphql/test/app/graphql/auth/AuthResolver.ts @@ -1,5 +1,6 @@ import {PassportContext} from "graphql-passport"; import {Arg, Ctx, Mutation, Query, Resolver} from "type-graphql"; + import {User} from "./User"; export interface GQLContext extends PassportContext {} diff --git a/packages/graphql/typegraphql/test/app/graphql/datasources/MyDataSource.ts b/packages/graphql/typegraphql/test/app/graphql/datasources/MyDataSource.ts index 99e4bff382c..28cecc8a540 100644 --- a/packages/graphql/typegraphql/test/app/graphql/datasources/MyDataSource.ts +++ b/packages/graphql/typegraphql/test/app/graphql/datasources/MyDataSource.ts @@ -1,7 +1,8 @@ -import {InjectContext} from "@tsed/common"; -import {DataSource} from "@tsed/typegraphql"; -import {ApolloContext} from "@tsed/apollo"; import {RESTDataSource} from "@apollo/datasource-rest"; +import {ApolloContext} from "@tsed/apollo"; +import {InjectContext} from "@tsed/common"; + +import {DataSource} from "../../../.."; @DataSource() export class MyDataSource extends RESTDataSource { diff --git a/packages/graphql/typegraphql/test/app/graphql/index.ts b/packages/graphql/typegraphql/test/app/graphql/index.ts index 718b4af4fd0..23fcac0fb4f 100644 --- a/packages/graphql/typegraphql/test/app/graphql/index.ts +++ b/packages/graphql/typegraphql/test/app/graphql/index.ts @@ -2,5 +2,5 @@ export * from "./auth/AuthResolver"; export * from "./auth/User"; export * from "./datasources/MyDataSource"; export * from "./recipes/Recipe"; -export * from "./recipes/RecipeResolver"; export * from "./recipes/RecipeNotFoundError"; +export * from "./recipes/RecipeResolver"; diff --git a/packages/graphql/typegraphql/test/app/graphql/pubsub/pubsub.ts b/packages/graphql/typegraphql/test/app/graphql/pubsub/pubsub.ts index f431692e421..832f9ba0cd5 100644 --- a/packages/graphql/typegraphql/test/app/graphql/pubsub/pubsub.ts +++ b/packages/graphql/typegraphql/test/app/graphql/pubsub/pubsub.ts @@ -1,5 +1,6 @@ import {createPubSub} from "@graphql-yoga/subscription"; import {registerProvider} from "@tsed/common"; + import {RecipeNotification} from "../recipes/Recipe"; export const pubSub = createPubSub<{ diff --git a/packages/graphql/typegraphql/test/app/graphql/recipes/RecipeResolver.ts b/packages/graphql/typegraphql/test/app/graphql/recipes/RecipeResolver.ts index 2cc5b3d00e1..9f4cd30a387 100644 --- a/packages/graphql/typegraphql/test/app/graphql/recipes/RecipeResolver.ts +++ b/packages/graphql/typegraphql/test/app/graphql/recipes/RecipeResolver.ts @@ -1,7 +1,8 @@ import {InjectContext, PlatformContext} from "@tsed/common"; import {Inject} from "@tsed/di"; -import {ResolverController} from "@tsed/typegraphql"; import {Arg, Mutation, Query, Root, Subscription} from "type-graphql"; + +import {ResolverController} from "../../../.."; import {RecipeService} from "../../services/RecipeService"; import {PubSubProvider} from "../pubsub/pubsub.js"; import {Recipe, RecipeNotification} from "./Recipe"; diff --git a/packages/graphql/typegraphql/test/app/index.express.ts b/packages/graphql/typegraphql/test/app/index.express.ts index 829493459a1..040d81629be 100644 --- a/packages/graphql/typegraphql/test/app/index.express.ts +++ b/packages/graphql/typegraphql/test/app/index.express.ts @@ -1,5 +1,6 @@ import {$log} from "@tsed/common"; import {PlatformExpress} from "@tsed/platform-express"; + import {Server} from "./Server"; if (process.env.NODE_ENV !== "test") { diff --git a/packages/graphql/typegraphql/test/app/index.koa.ts b/packages/graphql/typegraphql/test/app/index.koa.ts index 28c1b0226a3..d852a9230a3 100644 --- a/packages/graphql/typegraphql/test/app/index.koa.ts +++ b/packages/graphql/typegraphql/test/app/index.koa.ts @@ -1,5 +1,6 @@ import {$log} from "@tsed/common"; import {PlatformKoa} from "@tsed/platform-koa"; + import {Server} from "./Server.js"; if (process.env.NODE_ENV !== "test") { diff --git a/packages/graphql/typegraphql/test/app/protocols/GraphQLProtocol.ts b/packages/graphql/typegraphql/test/app/protocols/GraphQLProtocol.ts index bb75289e863..206c2e43cf4 100644 --- a/packages/graphql/typegraphql/test/app/protocols/GraphQLProtocol.ts +++ b/packages/graphql/typegraphql/test/app/protocols/GraphQLProtocol.ts @@ -2,6 +2,7 @@ import {Inject, Req} from "@tsed/common"; import {Unauthorized} from "@tsed/exceptions"; import {Arg, OnVerify, Protocol} from "@tsed/passport"; import {GraphQLLocalStrategy} from "graphql-passport"; + import {UsersRepository} from "../services/UsersRepository"; @Protocol({ diff --git a/packages/graphql/typegraphql/test/app/services/RecipeService.ts b/packages/graphql/typegraphql/test/app/services/RecipeService.ts index 692576e3474..85f2d373006 100644 --- a/packages/graphql/typegraphql/test/app/services/RecipeService.ts +++ b/packages/graphql/typegraphql/test/app/services/RecipeService.ts @@ -1,4 +1,5 @@ import {Service} from "@tsed/common"; + import {Recipe} from "../graphql/recipes/Recipe"; @Service() diff --git a/packages/graphql/typegraphql/test/app/services/UsersRepository.ts b/packages/graphql/typegraphql/test/app/services/UsersRepository.ts index d9c3c93fcc2..c175d610afe 100644 --- a/packages/graphql/typegraphql/test/app/services/UsersRepository.ts +++ b/packages/graphql/typegraphql/test/app/services/UsersRepository.ts @@ -1,6 +1,7 @@ import {Adapter, InjectAdapter} from "@tsed/adapters"; import {Injectable} from "@tsed/di"; import {deserialize} from "@tsed/json-mapper"; + import {User} from "../graphql/auth/User"; @Injectable() diff --git a/packages/graphql/typegraphql/test/poc/koa.js b/packages/graphql/typegraphql/test/poc/koa.js index 65940a538c7..167e404ccd9 100644 --- a/packages/graphql/typegraphql/test/poc/koa.js +++ b/packages/graphql/typegraphql/test/poc/koa.js @@ -1,8 +1,8 @@ -import {ApolloServer, gql} from "apollo-server-koa"; -import {ApolloServerPluginDrainHttpServer} from "apollo-server-core"; -import Koa from "koa"; import KoaRouter from "@koa/router"; +import {ApolloServerPluginDrainHttpServer} from "apollo-server-core"; +import {ApolloServer, gql} from "apollo-server-koa"; import http from "http"; +import Koa from "koa"; const app = new Koa(); const mainRouter = new KoaRouter(); diff --git a/packages/graphql/typegraphql/test/typegraphql-passport.spec.ts b/packages/graphql/typegraphql/test/typegraphql-passport.spec.ts index 9aa40b142a0..14cea133821 100644 --- a/packages/graphql/typegraphql/test/typegraphql-passport.spec.ts +++ b/packages/graphql/typegraphql/test/typegraphql-passport.spec.ts @@ -1,7 +1,9 @@ +import "@tsed/platform-express"; + import {PlatformTest} from "@tsed/common"; import {PlatformExpress} from "@tsed/platform-express"; -import "@tsed/platform-express"; import SuperTest from "supertest"; + import {Server} from "./app/Server.js"; describe("TypeGraphQL", () => { diff --git a/packages/graphql/typegraphql/test/typegraphql.spec.ts b/packages/graphql/typegraphql/test/typegraphql.spec.ts index 5b9c0bb6863..4cca7aea966 100644 --- a/packages/graphql/typegraphql/test/typegraphql.spec.ts +++ b/packages/graphql/typegraphql/test/typegraphql.spec.ts @@ -1,9 +1,11 @@ -import {PlatformTest, runInContext} from "@tsed/common"; -import {ApolloService} from "@tsed/apollo"; import "@tsed/platform-express"; +import "@tsed/graphql-ws"; + +import {ApolloService} from "@tsed/apollo"; +import {PlatformTest, runInContext} from "@tsed/common"; import {PlatformExpress} from "@tsed/platform-express"; import gql from "graphql-tag"; -import "@tsed/graphql-ws"; + import {Server} from "./app/Server.js"; const GET_RECIPES = gql` diff --git a/packages/graphql/typegraphql/tsconfig.esm.json b/packages/graphql/typegraphql/tsconfig.esm.json index e3b07081667..82292550ddb 100644 --- a/packages/graphql/typegraphql/tsconfig.esm.json +++ b/packages/graphql/typegraphql/tsconfig.esm.json @@ -2,8 +2,7 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "module": "ESNext", - "moduleResolution": "nodenext", + "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", @@ -11,7 +10,7 @@ "composite": true, "noEmit": false }, - "include": ["src", "src/**/*.json"], + "include": ["src/**/*.ts", "src/**/*.json"], "exclude": [ "node_modules", "test", diff --git a/packages/graphql/typegraphql/tsconfig.spec.json b/packages/graphql/typegraphql/tsconfig.spec.json index 21485bab96d..2e917f4b39d 100644 --- a/packages/graphql/typegraphql/tsconfig.spec.json +++ b/packages/graphql/typegraphql/tsconfig.spec.json @@ -3,7 +3,6 @@ "compilerOptions": { "baseUrl": ".", "rootDir": "../..", - "module": "commonjs", "outDir": "./lib/cjs", "declaration": false, "composite": false, diff --git a/packages/orm/adapters-redis/package.json b/packages/orm/adapters-redis/package.json index 0a6eaadb7ec..4ba3464f11b 100644 --- a/packages/orm/adapters-redis/package.json +++ b/packages/orm/adapters-redis/package.json @@ -31,7 +31,7 @@ "@tsed/core": "workspace:*", "@tsed/typescript": "workspace:*", "eslint": "^8.57.0", - "typescript": "4.9.5", + "typescript": "5.6.2", "vitest": "2.0.4" }, "peerDependencies": { diff --git a/packages/orm/adapters-redis/src/adapters/OIDCRedisAdapter.spec.ts b/packages/orm/adapters-redis/src/adapters/OIDCRedisAdapter.spec.ts index 661e0821051..811f510d241 100644 --- a/packages/orm/adapters-redis/src/adapters/OIDCRedisAdapter.spec.ts +++ b/packages/orm/adapters-redis/src/adapters/OIDCRedisAdapter.spec.ts @@ -1,8 +1,6 @@ import {Adapters} from "@tsed/adapters"; import {IORedisTest, registerConnectionProvider} from "@tsed/ioredis"; -import Redis from "ioredis"; -// @ts-ignore -import IORedisMock from "ioredis-mock"; +import {Redis} from "ioredis"; import moment from "moment"; import {OIDCRedisAdapter} from "./OIDCRedisAdapter.js"; diff --git a/packages/orm/adapters-redis/src/adapters/OIDCRedisAdapter.ts b/packages/orm/adapters-redis/src/adapters/OIDCRedisAdapter.ts index 1912a4acea7..73436c20eed 100644 --- a/packages/orm/adapters-redis/src/adapters/OIDCRedisAdapter.ts +++ b/packages/orm/adapters-redis/src/adapters/OIDCRedisAdapter.ts @@ -1,7 +1,7 @@ import {AdapterModel} from "@tsed/adapters"; import {Configuration, Inject, Opts} from "@tsed/di"; +import {IORedis, IOREDIS_CONNECTIONS} from "@tsed/ioredis"; import {ChainableCommander} from "ioredis"; -import {IOREDIS_CONNECTIONS, IORedis} from "@tsed/ioredis"; import {RedisAdapter, RedisAdapterConstructorOptions} from "./RedisAdapter.js"; @@ -87,7 +87,6 @@ export class OIDCRedisAdapter extends RedisAdapter { } async revokeByGrantId(grantId: string) { - // eslint-disable-line class-methods-use-this const multi = this.db.multi(); const key = grantKeyFor(grantId); const tokens = await this.db.lrange(key, 0, -1); diff --git a/packages/orm/adapters-redis/src/adapters/RedisAdapter.spec.ts b/packages/orm/adapters-redis/src/adapters/RedisAdapter.spec.ts index e2413fbe914..d7ecf2b550f 100644 --- a/packages/orm/adapters-redis/src/adapters/RedisAdapter.spec.ts +++ b/packages/orm/adapters-redis/src/adapters/RedisAdapter.spec.ts @@ -2,6 +2,7 @@ import {AdapterModel, Adapters, Indexed} from "@tsed/adapters"; import {IORedisTest, registerConnectionProvider} from "@tsed/ioredis"; import {deserialize} from "@tsed/json-mapper"; import {Property, Required} from "@tsed/schema"; + import {RedisAdapter} from "./RedisAdapter.js"; const REDIS_CONNECTION = Symbol.for("redis_connection"); diff --git a/packages/orm/adapters-redis/tsconfig.esm.json b/packages/orm/adapters-redis/tsconfig.esm.json index e3b07081667..82292550ddb 100644 --- a/packages/orm/adapters-redis/tsconfig.esm.json +++ b/packages/orm/adapters-redis/tsconfig.esm.json @@ -2,8 +2,7 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "module": "ESNext", - "moduleResolution": "nodenext", + "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", @@ -11,7 +10,7 @@ "composite": true, "noEmit": false }, - "include": ["src", "src/**/*.json"], + "include": ["src/**/*.ts", "src/**/*.json"], "exclude": [ "node_modules", "test", diff --git a/packages/orm/adapters-redis/tsconfig.spec.json b/packages/orm/adapters-redis/tsconfig.spec.json index 21485bab96d..2e917f4b39d 100644 --- a/packages/orm/adapters-redis/tsconfig.spec.json +++ b/packages/orm/adapters-redis/tsconfig.spec.json @@ -3,7 +3,6 @@ "compilerOptions": { "baseUrl": ".", "rootDir": "../..", - "module": "commonjs", "outDir": "./lib/cjs", "declaration": false, "composite": false, diff --git a/packages/orm/adapters/package.json b/packages/orm/adapters/package.json index cfb5a6e6020..ce6366faff0 100644 --- a/packages/orm/adapters/package.json +++ b/packages/orm/adapters/package.json @@ -42,7 +42,7 @@ "@tsed/typescript": "workspace:*", "@types/fs-extra": "11.0.4", "eslint": "^8.57.0", - "typescript": "4.9.5", + "typescript": "5.6.2", "vitest": "2.0.4" }, "peerDependencies": { diff --git a/packages/orm/adapters/src/adapters/FileSyncAdapter.spec.ts b/packages/orm/adapters/src/adapters/FileSyncAdapter.spec.ts index de3908468b0..055e267d1f9 100644 --- a/packages/orm/adapters/src/adapters/FileSyncAdapter.spec.ts +++ b/packages/orm/adapters/src/adapters/FileSyncAdapter.spec.ts @@ -1,6 +1,7 @@ +import {faker} from "@faker-js/faker"; import {PlatformTest} from "@tsed/common"; import {Property} from "@tsed/schema"; -import faker from "@faker-js/faker"; + import {Adapter} from "../domain/Adapter.js"; import {Adapters} from "../services/Adapters.js"; import {FileSyncAdapter} from "./FileSyncAdapter.js"; diff --git a/packages/orm/adapters/src/adapters/FileSyncAdapter.ts b/packages/orm/adapters/src/adapters/FileSyncAdapter.ts index 6bab65c03ff..473cb12814e 100644 --- a/packages/orm/adapters/src/adapters/FileSyncAdapter.ts +++ b/packages/orm/adapters/src/adapters/FileSyncAdapter.ts @@ -4,6 +4,7 @@ import fs from "fs-extra"; import low from "lowdb"; import FileSync from "lowdb/adapters/FileSync.js"; import {dirname} from "path"; + import {AdapterConstructorOptions} from "../domain/Adapter.js"; import {AdapterModel, LowDbAdapter} from "./LowDbAdapter.js"; diff --git a/packages/orm/adapters/src/adapters/LowDbAdapter.ts b/packages/orm/adapters/src/adapters/LowDbAdapter.ts index f3037b3119e..f3d05d4e644 100644 --- a/packages/orm/adapters/src/adapters/LowDbAdapter.ts +++ b/packages/orm/adapters/src/adapters/LowDbAdapter.ts @@ -2,6 +2,7 @@ import {cleanObject} from "@tsed/core"; import isMatch from "lodash/isMatch.js"; import low from "lowdb"; import {v4 as uuid} from "uuid"; + import {Adapter} from "../domain/Adapter.js"; export interface AdapterModel { diff --git a/packages/orm/adapters/src/adapters/MemoryAdapter.spec.ts b/packages/orm/adapters/src/adapters/MemoryAdapter.spec.ts index 9b6f97faff7..b939f5cb750 100644 --- a/packages/orm/adapters/src/adapters/MemoryAdapter.spec.ts +++ b/packages/orm/adapters/src/adapters/MemoryAdapter.spec.ts @@ -1,7 +1,8 @@ -import faker from "@faker-js/faker"; +import {faker} from "@faker-js/faker"; import {PlatformTest} from "@tsed/common"; import {deserialize} from "@tsed/json-mapper"; import {Format, getJsonSchema, Name, Property} from "@tsed/schema"; + import {Adapter} from "../domain/Adapter.js"; import {Adapters} from "../services/Adapters.js"; import {MemoryAdapter} from "./MemoryAdapter.js"; @@ -133,7 +134,7 @@ describe("MemoryAdapter", () => { name: faker.name.jobTitle() }; - const client = await adapter.updateOne({_id: faker.datatype.uuid()}, base); + const client = await adapter.updateOne({_id: faker.string.uuid()}, base); expect(client).toBeUndefined(); }); diff --git a/packages/orm/adapters/src/adapters/MemoryAdapter.ts b/packages/orm/adapters/src/adapters/MemoryAdapter.ts index edcf795bacc..8415645e41d 100644 --- a/packages/orm/adapters/src/adapters/MemoryAdapter.ts +++ b/packages/orm/adapters/src/adapters/MemoryAdapter.ts @@ -1,6 +1,7 @@ import {Configuration, Injectable, Opts, ProviderScope, Scope} from "@tsed/di"; import low from "lowdb"; import Memory from "lowdb/adapters/Memory.js"; + import {AdapterModel, LowDbAdapter} from "./LowDbAdapter.js"; @Injectable() diff --git a/packages/orm/adapters/src/decorators/indexed.spec.ts b/packages/orm/adapters/src/decorators/indexed.spec.ts index 0e35b7ec527..4877721f822 100644 --- a/packages/orm/adapters/src/decorators/indexed.spec.ts +++ b/packages/orm/adapters/src/decorators/indexed.spec.ts @@ -1,6 +1,7 @@ import {PlatformTest} from "@tsed/common"; import {Injectable} from "@tsed/di"; import {Property} from "@tsed/schema"; + import {MemoryAdapter} from "../adapters/MemoryAdapter.js"; import {Adapter} from "../domain/Adapter.js"; import {Indexed} from "./indexed.js"; diff --git a/packages/orm/adapters/src/decorators/injectAdapter.spec.ts b/packages/orm/adapters/src/decorators/injectAdapter.spec.ts index 798ae2a8e61..83d1ed212b0 100644 --- a/packages/orm/adapters/src/decorators/injectAdapter.spec.ts +++ b/packages/orm/adapters/src/decorators/injectAdapter.spec.ts @@ -1,6 +1,7 @@ import {PlatformTest} from "@tsed/common"; import {Injectable} from "@tsed/di"; import {Name, Property} from "@tsed/schema"; + import {MemoryAdapter} from "../adapters/MemoryAdapter.js"; import {Adapter} from "../domain/Adapter.js"; import {adapter, InjectAdapter} from "./injectAdapter.js"; diff --git a/packages/orm/adapters/src/decorators/injectAdapter.ts b/packages/orm/adapters/src/decorators/injectAdapter.ts index 550b459d671..d9d18593055 100644 --- a/packages/orm/adapters/src/decorators/injectAdapter.ts +++ b/packages/orm/adapters/src/decorators/injectAdapter.ts @@ -1,5 +1,6 @@ import {classOf, isClass, isString, Type} from "@tsed/core"; -import {inject, Inject} from "@tsed/di"; +import {Inject, inject} from "@tsed/di"; + import type {Adapter} from "../domain/Adapter.js"; import {AdapterInvokeOptions, Adapters} from "../services/Adapters.js"; diff --git a/packages/orm/adapters/src/domain/Adapter.ts b/packages/orm/adapters/src/domain/Adapter.ts index ebaeaa392c8..7ad5e5e8b96 100644 --- a/packages/orm/adapters/src/domain/Adapter.ts +++ b/packages/orm/adapters/src/domain/Adapter.ts @@ -46,7 +46,10 @@ export abstract class Adapter { @Inject() protected ajvService: AjvService; - constructor(@Opts options: AdapterConstructorOptions, @Configuration() protected configuration: Configuration) { + constructor( + @Opts options: AdapterConstructorOptions, + @Configuration() protected configuration: Configuration + ) { this.model = options.model; this.collectionName = options.collectionName || pluralize(nameOf(options.model)); diff --git a/packages/orm/adapters/src/domain/AdaptersSettings.ts b/packages/orm/adapters/src/domain/AdaptersSettings.ts index 87b4786a30e..0310e93771f 100644 --- a/packages/orm/adapters/src/domain/AdaptersSettings.ts +++ b/packages/orm/adapters/src/domain/AdaptersSettings.ts @@ -1,4 +1,5 @@ import {Type} from "@tsed/core"; + import {Adapter} from "./Adapter.js"; export interface AdaptersSettings { diff --git a/packages/orm/adapters/src/services/Adapters.ts b/packages/orm/adapters/src/services/Adapters.ts index ceebf6ef0ae..1daf605ac65 100644 --- a/packages/orm/adapters/src/services/Adapters.ts +++ b/packages/orm/adapters/src/services/Adapters.ts @@ -1,5 +1,6 @@ import {Type} from "@tsed/core"; import {Inject, Injectable, InjectorService} from "@tsed/di"; + import {MemoryAdapter} from "../adapters/MemoryAdapter.js"; import {Adapter, AdapterConstructorOptions} from "../domain/Adapter.js"; diff --git a/packages/orm/adapters/test/discrinimator.integration.spec.ts b/packages/orm/adapters/test/discrinimator.integration.spec.ts index f1587d5383d..4dc7c9ebd2d 100644 --- a/packages/orm/adapters/test/discrinimator.integration.spec.ts +++ b/packages/orm/adapters/test/discrinimator.integration.spec.ts @@ -1,5 +1,6 @@ import {PlatformTest} from "@tsed/common"; import {DiscriminatorKey, DiscriminatorValue, Property, Required} from "@tsed/schema"; + import {Adapter, Adapters, FileSyncAdapter} from "../src/index.js"; class Event { diff --git a/packages/orm/adapters/tsconfig.esm.json b/packages/orm/adapters/tsconfig.esm.json index e3b07081667..82292550ddb 100644 --- a/packages/orm/adapters/tsconfig.esm.json +++ b/packages/orm/adapters/tsconfig.esm.json @@ -2,8 +2,7 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "module": "ESNext", - "moduleResolution": "nodenext", + "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", @@ -11,7 +10,7 @@ "composite": true, "noEmit": false }, - "include": ["src", "src/**/*.json"], + "include": ["src/**/*.ts", "src/**/*.json"], "exclude": [ "node_modules", "test", diff --git a/packages/orm/adapters/tsconfig.spec.json b/packages/orm/adapters/tsconfig.spec.json index 21485bab96d..2e917f4b39d 100644 --- a/packages/orm/adapters/tsconfig.spec.json +++ b/packages/orm/adapters/tsconfig.spec.json @@ -3,7 +3,6 @@ "compilerOptions": { "baseUrl": ".", "rootDir": "../..", - "module": "commonjs", "outDir": "./lib/cjs", "declaration": false, "composite": false, diff --git a/packages/orm/ioredis/package.json b/packages/orm/ioredis/package.json index b8c76fd3e29..9d1e47f9e32 100644 --- a/packages/orm/ioredis/package.json +++ b/packages/orm/ioredis/package.json @@ -33,7 +33,7 @@ "eslint": "^8.57.0", "ioredis": "5.3.2", "ioredis-mock": "8.9.0", - "typescript": "4.9.5", + "typescript": "5.6.2", "vitest": "2.0.4" }, "peerDependencies": { diff --git a/packages/orm/ioredis/src/domain/IORedisConfiguration.ts b/packages/orm/ioredis/src/domain/IORedisConfiguration.ts index 9ca3c6f3869..5b9ecc49451 100644 --- a/packages/orm/ioredis/src/domain/IORedisConfiguration.ts +++ b/packages/orm/ioredis/src/domain/IORedisConfiguration.ts @@ -1,5 +1,5 @@ import {TokenProvider} from "@tsed/di"; -import {Redis, Cluster, ClusterOptions, RedisOptions} from "ioredis"; +import {Cluster, ClusterOptions, Redis, RedisOptions} from "ioredis"; export type ClusterConfiguration = {nodes: string[]} & ClusterOptions; @@ -12,7 +12,6 @@ export type IORedisConfiguration = BaseIORedisConfiguration & (RedisOptions | ClusterConfiguration) & {redisInstance?: Redis | Cluster; sentinelName?: string}; declare global { - // eslint-disable-next-line @typescript-eslint/no-namespace namespace TsED { interface Configuration { ioredis?: IORedisConfiguration[]; diff --git a/packages/orm/ioredis/src/domain/IORedisStore.spec.ts b/packages/orm/ioredis/src/domain/IORedisStore.spec.ts index 65d7b37494c..5d3b6c3c518 100644 --- a/packages/orm/ioredis/src/domain/IORedisStore.spec.ts +++ b/packages/orm/ioredis/src/domain/IORedisStore.spec.ts @@ -234,11 +234,6 @@ describe("RedisStore", () => { const result = await redisCache.store.mset([["foo", "bar"]], 300); expect(result).toEqual(undefined); }); - - it("should set multiple value with ttl", async () => { - const result = await redisCache.store.mset([["foo", "bar"]], 300); - expect(result).toEqual(undefined); - }); }); describe("set", () => { diff --git a/packages/orm/ioredis/src/domain/IORedisStore.ts b/packages/orm/ioredis/src/domain/IORedisStore.ts index 984976014c6..0929255e504 100644 --- a/packages/orm/ioredis/src/domain/IORedisStore.ts +++ b/packages/orm/ioredis/src/domain/IORedisStore.ts @@ -1,5 +1,5 @@ import type {Config, FactoryConfig, Store} from "cache-manager"; -import {Redis, Cluster, ClusterNode, ClusterOptions, RedisOptions} from "ioredis"; +import {Cluster, ClusterNode, ClusterOptions, Redis, RedisOptions} from "ioredis"; export interface RedisClusterConfig { nodes: ClusterNode[]; diff --git a/packages/orm/ioredis/src/domain/IORedisTest.spec.ts b/packages/orm/ioredis/src/domain/IORedisTest.spec.ts index f49f43608bd..b242fcbe7eb 100644 --- a/packages/orm/ioredis/src/domain/IORedisTest.spec.ts +++ b/packages/orm/ioredis/src/domain/IORedisTest.spec.ts @@ -1,9 +1,10 @@ import {Inject, Injectable} from "@tsed/di"; -import {registerConnectionProvider} from "../utils/registerConnectionProvider.js"; -import {IORedisTest} from "./IORedisTest.js"; import type {Redis} from "ioredis"; import RedisMock from "ioredis-mock"; +import {registerConnectionProvider} from "../utils/registerConnectionProvider.js"; +import {IORedisTest} from "./IORedisTest.js"; + const MY_CONNECTION = Symbol("MY_CONNECTION"); type MY_CONNECTION = Redis; diff --git a/packages/orm/ioredis/src/domain/IORedisTest.ts b/packages/orm/ioredis/src/domain/IORedisTest.ts index e6c7ffa7ba2..e0998aa15f9 100644 --- a/packages/orm/ioredis/src/domain/IORedisTest.ts +++ b/packages/orm/ioredis/src/domain/IORedisTest.ts @@ -1,4 +1,5 @@ import {DITest} from "@tsed/di"; + import {mockConnections} from "../utils/mockConnections.js"; export class IORedisTest extends DITest { diff --git a/packages/orm/ioredis/src/utils/registerConnectionProvider.spec.ts b/packages/orm/ioredis/src/utils/registerConnectionProvider.spec.ts index e5e14a3a273..3de09121bcb 100644 --- a/packages/orm/ioredis/src/utils/registerConnectionProvider.spec.ts +++ b/packages/orm/ioredis/src/utils/registerConnectionProvider.spec.ts @@ -1,5 +1,6 @@ import {DITest} from "@tsed/di"; -import Redis from "ioredis"; +import {Redis} from "ioredis"; + import {registerConnectionProvider} from "./registerConnectionProvider.js"; vi.mock("ioredis", () => { diff --git a/packages/orm/ioredis/src/utils/registerConnectionProvider.ts b/packages/orm/ioredis/src/utils/registerConnectionProvider.ts index aea07c91991..01a6c6c5700 100644 --- a/packages/orm/ioredis/src/utils/registerConnectionProvider.ts +++ b/packages/orm/ioredis/src/utils/registerConnectionProvider.ts @@ -1,7 +1,8 @@ import {setValue} from "@tsed/core"; import {Configuration, registerProvider, TokenProvider} from "@tsed/di"; import {Logger} from "@tsed/logger"; -import {Redis, Cluster, RedisOptions} from "ioredis"; +import {Cluster, Redis, RedisOptions} from "ioredis"; + import {IORedisConfiguration} from "../domain/IORedisConfiguration.js"; import {ioRedisStore} from "../domain/IORedisStore.js"; diff --git a/packages/orm/ioredis/tsconfig.esm.json b/packages/orm/ioredis/tsconfig.esm.json index e3b07081667..82292550ddb 100644 --- a/packages/orm/ioredis/tsconfig.esm.json +++ b/packages/orm/ioredis/tsconfig.esm.json @@ -2,8 +2,7 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "module": "ESNext", - "moduleResolution": "nodenext", + "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", @@ -11,7 +10,7 @@ "composite": true, "noEmit": false }, - "include": ["src", "src/**/*.json"], + "include": ["src/**/*.ts", "src/**/*.json"], "exclude": [ "node_modules", "test", diff --git a/packages/orm/ioredis/tsconfig.spec.json b/packages/orm/ioredis/tsconfig.spec.json index 21485bab96d..2e917f4b39d 100644 --- a/packages/orm/ioredis/tsconfig.spec.json +++ b/packages/orm/ioredis/tsconfig.spec.json @@ -3,7 +3,6 @@ "compilerOptions": { "baseUrl": ".", "rootDir": "../..", - "module": "commonjs", "outDir": "./lib/cjs", "declaration": false, "composite": false, diff --git a/packages/orm/mikro-orm/package.json b/packages/orm/mikro-orm/package.json index da3d14b3ef5..df15bf183fd 100644 --- a/packages/orm/mikro-orm/package.json +++ b/packages/orm/mikro-orm/package.json @@ -39,7 +39,7 @@ "cross-env": "7.0.3", "eslint": "^8.57.0", "ts-mockito": "^2.6.1", - "typescript": "4.9.5", + "typescript": "5.6.2", "vitest": "2.0.4" }, "peerDependencies": { diff --git a/packages/orm/mikro-orm/src/MikroOrmModule.spec.ts b/packages/orm/mikro-orm/src/MikroOrmModule.spec.ts index 573164be925..2b5a4eb1bcd 100644 --- a/packages/orm/mikro-orm/src/MikroOrmModule.spec.ts +++ b/packages/orm/mikro-orm/src/MikroOrmModule.spec.ts @@ -1,10 +1,11 @@ import {EntityManager, EventSubscriber, MikroORM, Options} from "@mikro-orm/core"; import {PlatformTest} from "@tsed/common"; import {anyOfClass, anything, deepEqual, instance, mock, reset, verify, when} from "ts-mockito"; + +import {Subscriber} from "./decorators/subscriber.js"; import {MikroOrmModule} from "./MikroOrmModule.js"; import {MikroOrmContext} from "./services/MikroOrmContext.js"; import {MikroOrmRegistry} from "./services/MikroOrmRegistry.js"; -import {Subscriber} from "./decorators/subscriber.js"; class Subscriber1 implements EventSubscriber {} diff --git a/packages/orm/mikro-orm/src/MikroOrmModule.ts b/packages/orm/mikro-orm/src/MikroOrmModule.ts index 3e6494c88cb..4e4b62c64af 100644 --- a/packages/orm/mikro-orm/src/MikroOrmModule.ts +++ b/packages/orm/mikro-orm/src/MikroOrmModule.ts @@ -1,4 +1,7 @@ import "./services/MikroOrmFactory"; + +import {EventSubscriber, Options} from "@mikro-orm/core"; +import {classOf, isFunction, Store} from "@tsed/core"; import { AlterRunInContext, Constant, @@ -11,16 +14,14 @@ import { ProviderScope, registerProvider } from "@tsed/di"; -import {EventSubscriber, Options} from "@mikro-orm/core"; -import {MikroOrmRegistry} from "./services/MikroOrmRegistry.js"; -import {RetryStrategy} from "./interfaces/RetryStrategy.js"; + +import {DEFAULT_CONTEXT_NAME, SUBSCRIBER_INJECTION_TYPE} from "./constants.js"; import {OptimisticLockErrorFilter} from "./filters/OptimisticLockErrorFilter.js"; +import {RetryStrategy} from "./interfaces/RetryStrategy.js"; import {MikroOrmContext} from "./services/MikroOrmContext.js"; -import {classOf, isFunction, Store} from "@tsed/core"; -import {DEFAULT_CONTEXT_NAME, SUBSCRIBER_INJECTION_TYPE} from "./constants.js"; +import {MikroOrmRegistry} from "./services/MikroOrmRegistry.js"; declare global { - // eslint-disable-next-line @typescript-eslint/no-namespace namespace TsED { interface Configuration { /** diff --git a/packages/orm/mikro-orm/src/decorators/entityManager.spec.ts b/packages/orm/mikro-orm/src/decorators/entityManager.spec.ts index f6c8d28fc05..ad70ee7fdf5 100644 --- a/packages/orm/mikro-orm/src/decorators/entityManager.spec.ts +++ b/packages/orm/mikro-orm/src/decorators/entityManager.spec.ts @@ -2,8 +2,9 @@ import {MikroORM} from "@mikro-orm/core"; import {MongoEntityManager} from "@mikro-orm/mongodb"; import {DITest, Injectable} from "@tsed/di"; import {afterEach, beforeEach} from "vitest"; + import {MikroOrmRegistry} from "../services/MikroOrmRegistry.js"; -import {Em, entityManager, EntityManager} from "./entityManager.js"; +import {Em, EntityManager, entityManager} from "./entityManager.js"; describe("@EntityManager()", () => { beforeEach(() => DITest.create()); diff --git a/packages/orm/mikro-orm/src/decorators/entityManager.ts b/packages/orm/mikro-orm/src/decorators/entityManager.ts index e29cf64d703..7a62d9189bd 100644 --- a/packages/orm/mikro-orm/src/decorators/entityManager.ts +++ b/packages/orm/mikro-orm/src/decorators/entityManager.ts @@ -1,4 +1,5 @@ import {Inject} from "@tsed/di"; + import {MikroOrmRegistry} from "../services/MikroOrmRegistry.js"; import {orm} from "./orm.js"; diff --git a/packages/orm/mikro-orm/src/decorators/orm.spec.ts b/packages/orm/mikro-orm/src/decorators/orm.spec.ts index 2e0a753b9bc..30186a6b182 100644 --- a/packages/orm/mikro-orm/src/decorators/orm.spec.ts +++ b/packages/orm/mikro-orm/src/decorators/orm.spec.ts @@ -1,8 +1,9 @@ import {MikroORM} from "@mikro-orm/core"; import {DITest, Injectable} from "@tsed/di"; import {afterEach, beforeEach} from "vitest"; + import {MikroOrmRegistry} from "../services/MikroOrmRegistry.js"; -import {orm, Orm} from "./orm.js"; +import {Orm, orm} from "./orm.js"; describe("@Orm()", () => { beforeEach(() => DITest.create()); diff --git a/packages/orm/mikro-orm/src/decorators/orm.ts b/packages/orm/mikro-orm/src/decorators/orm.ts index 9b7ae8104aa..b1a0c7dae7e 100644 --- a/packages/orm/mikro-orm/src/decorators/orm.ts +++ b/packages/orm/mikro-orm/src/decorators/orm.ts @@ -1,5 +1,6 @@ import {MikroORM} from "@mikro-orm/core"; -import {inject, Inject} from "@tsed/di"; +import {Inject, inject} from "@tsed/di"; + import {MikroOrmRegistry} from "../services/MikroOrmRegistry.js"; /** diff --git a/packages/orm/mikro-orm/src/decorators/subscriber.spec.ts b/packages/orm/mikro-orm/src/decorators/subscriber.spec.ts index 495a0eddaf1..52c82a88c00 100644 --- a/packages/orm/mikro-orm/src/decorators/subscriber.spec.ts +++ b/packages/orm/mikro-orm/src/decorators/subscriber.spec.ts @@ -1,7 +1,8 @@ -import {Store} from "@tsed/core"; import {EventSubscriber} from "@mikro-orm/core"; -import {Subscriber} from "./subscriber.js"; +import {Store} from "@tsed/core"; + import {DEFAULT_CONTEXT_NAME, SUBSCRIBER_INJECTION_TYPE} from "../constants.js"; +import {Subscriber} from "./subscriber.js"; @Subscriber() export class Subscriber1 implements EventSubscriber {} diff --git a/packages/orm/mikro-orm/src/decorators/subscriber.ts b/packages/orm/mikro-orm/src/decorators/subscriber.ts index c6536db357f..df2f0191a61 100644 --- a/packages/orm/mikro-orm/src/decorators/subscriber.ts +++ b/packages/orm/mikro-orm/src/decorators/subscriber.ts @@ -1,5 +1,6 @@ import {StoreSet, useDecorators} from "@tsed/core"; import {Injectable} from "@tsed/di"; + import {DEFAULT_CONTEXT_NAME, SUBSCRIBER_INJECTION_TYPE} from "../constants.js"; /** diff --git a/packages/orm/mikro-orm/src/decorators/transactional.spec.ts b/packages/orm/mikro-orm/src/decorators/transactional.spec.ts index 275e6e74474..cd6bfa5c6cd 100644 --- a/packages/orm/mikro-orm/src/decorators/transactional.spec.ts +++ b/packages/orm/mikro-orm/src/decorators/transactional.spec.ts @@ -1,6 +1,7 @@ import {Post} from "@tsed/common"; import {Controller, DITest} from "@tsed/di"; import {afterEach, beforeEach} from "vitest"; + import {TransactionalInterceptor} from "../interceptors/TransactionalInterceptor.js"; import {Transactional} from "./transactional.js"; diff --git a/packages/orm/mikro-orm/src/decorators/transactional.ts b/packages/orm/mikro-orm/src/decorators/transactional.ts index 3320601bcd8..18caea7f49d 100644 --- a/packages/orm/mikro-orm/src/decorators/transactional.ts +++ b/packages/orm/mikro-orm/src/decorators/transactional.ts @@ -1,4 +1,5 @@ import {Intercept} from "@tsed/di"; + import {TransactionalInterceptor, TransactionOptions} from "../interceptors/TransactionalInterceptor.js"; /** diff --git a/packages/orm/mikro-orm/src/filters/OptimisticLockErrorFilter.spec.ts b/packages/orm/mikro-orm/src/filters/OptimisticLockErrorFilter.spec.ts index c5111da5e93..6bfd33598b6 100644 --- a/packages/orm/mikro-orm/src/filters/OptimisticLockErrorFilter.spec.ts +++ b/packages/orm/mikro-orm/src/filters/OptimisticLockErrorFilter.spec.ts @@ -1,7 +1,8 @@ -import {instance, mock, objectContaining, reset, spy, verify} from "ts-mockito"; -import {OptimisticLockErrorFilter} from "./OptimisticLockErrorFilter.js"; import {OptimisticLockError} from "@mikro-orm/core"; import {Logger, PlatformContext, PlatformTest} from "@tsed/common"; +import {instance, mock, objectContaining, reset, spy, verify} from "ts-mockito"; + +import {OptimisticLockErrorFilter} from "./OptimisticLockErrorFilter.js"; describe("OptimisticLockErrorFilter", () => { const mockedLogger: Logger = mock(); diff --git a/packages/orm/mikro-orm/src/filters/OptimisticLockErrorFilter.ts b/packages/orm/mikro-orm/src/filters/OptimisticLockErrorFilter.ts index 11e0c87454a..3e16f4c0663 100644 --- a/packages/orm/mikro-orm/src/filters/OptimisticLockErrorFilter.ts +++ b/packages/orm/mikro-orm/src/filters/OptimisticLockErrorFilter.ts @@ -1,5 +1,5 @@ -import {Catch, ExceptionFilterMethods, PlatformContext} from "@tsed/common"; import {OptimisticLockError} from "@mikro-orm/core"; +import {Catch, ExceptionFilterMethods, PlatformContext} from "@tsed/common"; @Catch(OptimisticLockError) export class OptimisticLockErrorFilter implements ExceptionFilterMethods { diff --git a/packages/orm/mikro-orm/src/interceptors/TransactionalInterceptor.spec.ts b/packages/orm/mikro-orm/src/interceptors/TransactionalInterceptor.spec.ts index 6c49d2516ac..678f3987705 100644 --- a/packages/orm/mikro-orm/src/interceptors/TransactionalInterceptor.spec.ts +++ b/packages/orm/mikro-orm/src/interceptors/TransactionalInterceptor.spec.ts @@ -1,11 +1,12 @@ -import {TransactionalInterceptor} from "./TransactionalInterceptor.js"; -import {anyFunction, anything, deepEqual, instance, mock, objectContaining, reset, verify, when} from "ts-mockito"; +import {EntityManager, IsolationLevel, MikroORM, OptimisticLockError} from "@mikro-orm/core"; import {InjectorService, InterceptorContext} from "@tsed/di"; import {Logger} from "@tsed/logger"; -import {EntityManager, IsolationLevel, MikroORM, OptimisticLockError} from "@mikro-orm/core"; -import {MikroOrmRegistry} from "../services/MikroOrmRegistry.js"; +import {anyFunction, anything, deepEqual, instance, mock, objectContaining, reset, verify, when} from "ts-mockito"; + import {RetryStrategy} from "../interfaces/RetryStrategy.js"; import {MikroOrmContext} from "../services/MikroOrmContext.js"; +import {MikroOrmRegistry} from "../services/MikroOrmRegistry.js"; +import {TransactionalInterceptor} from "./TransactionalInterceptor.js"; // AHDOC: https://github.com/NagRock/ts-mockito/issues/191 // TODO: avoid using ts-mockito @@ -203,7 +204,7 @@ describe("TransactionalInterceptor", () => { const result = transactionalInterceptor.intercept(context, next); // assert - await expect(result).rejects.toThrowError("Lock"); + await expect(result).rejects.toThrow("Lock"); verify(mockedEntityManager.transactional(anyFunction(), objectContaining({}))).times(1); }); diff --git a/packages/orm/mikro-orm/src/interceptors/TransactionalInterceptor.ts b/packages/orm/mikro-orm/src/interceptors/TransactionalInterceptor.ts index 8a545491407..eafb87d1db3 100644 --- a/packages/orm/mikro-orm/src/interceptors/TransactionalInterceptor.ts +++ b/packages/orm/mikro-orm/src/interceptors/TransactionalInterceptor.ts @@ -1,10 +1,11 @@ +import {EntityManager, FlushMode, IsolationLevel} from "@mikro-orm/core"; import {Inject, InjectorService, Interceptor, InterceptorContext, InterceptorMethods, InterceptorNext} from "@tsed/di"; import {Logger} from "@tsed/logger"; + +import {DEFAULT_CONTEXT_NAME} from "../constants.js"; import {RetryStrategy} from "../interfaces/RetryStrategy.js"; import {MikroOrmContext} from "../services/MikroOrmContext.js"; import {MikroOrmRegistry} from "../services/MikroOrmRegistry.js"; -import {EntityManager, FlushMode, IsolationLevel} from "@mikro-orm/core"; -import {DEFAULT_CONTEXT_NAME} from "../constants.js"; export interface TransactionOptions { retry?: boolean; diff --git a/packages/orm/mikro-orm/src/services/MikroOrmContext.spec.ts b/packages/orm/mikro-orm/src/services/MikroOrmContext.spec.ts index daebf9866aa..4f37ec2b274 100644 --- a/packages/orm/mikro-orm/src/services/MikroOrmContext.spec.ts +++ b/packages/orm/mikro-orm/src/services/MikroOrmContext.spec.ts @@ -1,5 +1,6 @@ import {EntityManager, RequestContext} from "@mikro-orm/core"; import {deepEqual, instance as originalInstance, mock, reset, spy, verify, when} from "ts-mockito"; + import {MikroOrmContext} from "./MikroOrmContext.js"; const instance = (m: T): T => diff --git a/packages/orm/mikro-orm/src/services/MikroOrmContext.ts b/packages/orm/mikro-orm/src/services/MikroOrmContext.ts index 43fa8faf847..44f90bff278 100644 --- a/packages/orm/mikro-orm/src/services/MikroOrmContext.ts +++ b/packages/orm/mikro-orm/src/services/MikroOrmContext.ts @@ -1,6 +1,6 @@ -import {Injectable} from "@tsed/di"; import {EntityManager, RequestContext} from "@mikro-orm/core"; import {isFunction} from "@tsed/core"; +import {Injectable} from "@tsed/di"; /** * @internal Since 2022-06-20. diff --git a/packages/orm/mikro-orm/src/services/MikroOrmFactory.ts b/packages/orm/mikro-orm/src/services/MikroOrmFactory.ts index 974ab23f0e7..cbe1e7c2910 100644 --- a/packages/orm/mikro-orm/src/services/MikroOrmFactory.ts +++ b/packages/orm/mikro-orm/src/services/MikroOrmFactory.ts @@ -1,5 +1,6 @@ import {MikroORM, Options} from "@mikro-orm/core"; import {Inject, Injectable} from "@tsed/di"; + import {MikroOrmContext} from "./MikroOrmContext.js"; @Injectable() diff --git a/packages/orm/mikro-orm/src/services/MikroOrmRegistry.spec.ts b/packages/orm/mikro-orm/src/services/MikroOrmRegistry.spec.ts index 465a8483c9b..f11e3015da1 100644 --- a/packages/orm/mikro-orm/src/services/MikroOrmRegistry.spec.ts +++ b/packages/orm/mikro-orm/src/services/MikroOrmRegistry.spec.ts @@ -1,6 +1,7 @@ -import {anything, instance, mock, reset, verify, when} from "ts-mockito"; -import {Logger} from "@tsed/logger"; import {MikroORM, Options} from "@mikro-orm/core"; +import {Logger} from "@tsed/logger"; +import {anything, instance, mock, reset, verify, when} from "ts-mockito"; + import {MikroOrmFactory} from "./MikroOrmFactory.js"; import {MikroOrmRegistry} from "./MikroOrmRegistry.js"; diff --git a/packages/orm/mikro-orm/src/services/MikroOrmRegistry.ts b/packages/orm/mikro-orm/src/services/MikroOrmRegistry.ts index 2d836e438fb..404dd299ab5 100644 --- a/packages/orm/mikro-orm/src/services/MikroOrmRegistry.ts +++ b/packages/orm/mikro-orm/src/services/MikroOrmRegistry.ts @@ -1,9 +1,10 @@ -import {MikroOrmFactory} from "./MikroOrmFactory.js"; -import {Inject, Injectable} from "@tsed/di"; import {IDatabaseDriver as DatabaseDriver, MikroORM, Options} from "@mikro-orm/core"; import {catchAsyncError, getValue} from "@tsed/core"; +import {Inject, Injectable} from "@tsed/di"; import {Logger} from "@tsed/logger"; +import {MikroOrmFactory} from "./MikroOrmFactory.js"; + @Injectable() export class MikroOrmRegistry { private readonly DEFAULT_CONTEXT_NAME = "default"; diff --git a/packages/orm/mikro-orm/test/helpers/Server.ts b/packages/orm/mikro-orm/test/helpers/Server.ts index 2e5b133be16..dc688ce256f 100644 --- a/packages/orm/mikro-orm/test/helpers/Server.ts +++ b/packages/orm/mikro-orm/test/helpers/Server.ts @@ -1,11 +1,12 @@ +import "@tsed/platform-express"; +import "./services/ManagedEventSubscriber.js"; + import {PlatformApplication} from "@tsed/common"; import {Configuration, Inject} from "@tsed/di"; -import "@tsed/platform-express"; import bodyParser from "body-parser"; import compress from "compression"; import cookieParser from "cookie-parser"; import methodOverride from "method-override"; -import "./services/ManagedEventSubscriber.js"; const rootDir = import.meta.dirname; diff --git a/packages/orm/mikro-orm/test/helpers/entity/User.ts b/packages/orm/mikro-orm/test/helpers/entity/User.ts index aaccf7a74a1..df62604ce0a 100644 --- a/packages/orm/mikro-orm/test/helpers/entity/User.ts +++ b/packages/orm/mikro-orm/test/helpers/entity/User.ts @@ -1,6 +1,6 @@ -import {Property} from "@tsed/schema"; import {Entity, PrimaryKey} from "@mikro-orm/core"; import {ObjectId} from "@mikro-orm/mongodb"; +import {Property} from "@tsed/schema"; @Entity() export class User { diff --git a/packages/orm/mikro-orm/test/helpers/services/Hooks.ts b/packages/orm/mikro-orm/test/helpers/services/Hooks.ts index d03f0e2c523..6c09084303b 100644 --- a/packages/orm/mikro-orm/test/helpers/services/Hooks.ts +++ b/packages/orm/mikro-orm/test/helpers/services/Hooks.ts @@ -1,7 +1,8 @@ -import {AfterTransactionCommit, BeforeTransactionCommit} from "../../../src/index.js"; import {EntityManager} from "@mikro-orm/core"; import {Injectable} from "@tsed/di"; +import {AfterTransactionCommit, BeforeTransactionCommit} from "../../../src/index.js"; + @Injectable() export class Hooks implements AfterTransactionCommit, BeforeTransactionCommit { $afterTransactionCommit(em: EntityManager): Promise | unknown { diff --git a/packages/orm/mikro-orm/test/helpers/services/ManagedEventSubscriber.ts b/packages/orm/mikro-orm/test/helpers/services/ManagedEventSubscriber.ts index 9139a80e538..412437e16f3 100644 --- a/packages/orm/mikro-orm/test/helpers/services/ManagedEventSubscriber.ts +++ b/packages/orm/mikro-orm/test/helpers/services/ManagedEventSubscriber.ts @@ -1,6 +1,7 @@ import {EventSubscriber, TransactionEventArgs} from "@mikro-orm/core"; import {Inject} from "@tsed/di"; import {Logger} from "@tsed/logger"; + import {Subscriber} from "../../../src/index.js"; @Subscriber() diff --git a/packages/orm/mikro-orm/test/helpers/services/UnmanagedEventSubscriber1.ts b/packages/orm/mikro-orm/test/helpers/services/UnmanagedEventSubscriber1.ts index 9ccaa5bd8c5..526d540c900 100644 --- a/packages/orm/mikro-orm/test/helpers/services/UnmanagedEventSubscriber1.ts +++ b/packages/orm/mikro-orm/test/helpers/services/UnmanagedEventSubscriber1.ts @@ -1,6 +1,6 @@ import {EventSubscriber, TransactionEventArgs} from "@mikro-orm/core"; -import {$log, Logger} from "@tsed/logger"; import {Inject} from "@tsed/di"; +import {$log, Logger} from "@tsed/logger"; export class UnmanagedEventSubscriber1 implements EventSubscriber { constructor(@Inject() private readonly logger: Logger) {} diff --git a/packages/orm/mikro-orm/test/helpers/services/UnmanagedEventSubscriber2.ts b/packages/orm/mikro-orm/test/helpers/services/UnmanagedEventSubscriber2.ts index 690b0085181..e5a5cb44223 100644 --- a/packages/orm/mikro-orm/test/helpers/services/UnmanagedEventSubscriber2.ts +++ b/packages/orm/mikro-orm/test/helpers/services/UnmanagedEventSubscriber2.ts @@ -1,6 +1,6 @@ import {EventSubscriber, TransactionEventArgs} from "@mikro-orm/core"; -import {$log, Logger} from "@tsed/logger"; import {Inject} from "@tsed/di"; +import {$log, Logger} from "@tsed/logger"; export class UnmanagedEventSubscriber2 implements EventSubscriber { @Inject() diff --git a/packages/orm/mikro-orm/test/helpers/services/UserService.ts b/packages/orm/mikro-orm/test/helpers/services/UserService.ts index 49ccf81b5d8..525f11674d4 100644 --- a/packages/orm/mikro-orm/test/helpers/services/UserService.ts +++ b/packages/orm/mikro-orm/test/helpers/services/UserService.ts @@ -1,5 +1,6 @@ import {EntityManager, MikroORM} from "@mikro-orm/core"; import {Injectable} from "@tsed/di"; + import {Em, Orm, Transactional} from "../../../src/index.js"; import {User} from "../entity/User.js"; diff --git a/packages/orm/mikro-orm/test/integration.spec.ts b/packages/orm/mikro-orm/test/integration.spec.ts index 0945cbf5d80..004e208bb0e 100644 --- a/packages/orm/mikro-orm/test/integration.spec.ts +++ b/packages/orm/mikro-orm/test/integration.spec.ts @@ -2,7 +2,9 @@ import {EntityManager, MikroORM} from "@mikro-orm/core"; import {defineConfig} from "@mikro-orm/mongodb"; import {PlatformTest} from "@tsed/common"; import {Logger} from "@tsed/logger"; +import {TestContainersMongo} from "@tsed/testcontainers-mongo"; import {anyOfClass, anything, reset, spy, verify} from "ts-mockito"; + import {MikroOrmModule, TransactionalInterceptor} from "../src/index.js"; import {User} from "./helpers/entity/User.js"; import {Server} from "./helpers/Server.js"; @@ -10,7 +12,6 @@ import {Hooks} from "./helpers/services/Hooks.js"; import {UnmanagedEventSubscriber1} from "./helpers/services/UnmanagedEventSubscriber1.js"; import {UnmanagedEventSubscriber2} from "./helpers/services/UnmanagedEventSubscriber2.js"; import {UserService} from "./helpers/services/UserService.js"; -import {TestContainersMongo} from "@tsed/testcontainers-mongo"; describe("MikroOrm integration", () => { let spiedLogger!: Logger; diff --git a/packages/orm/mikro-orm/tsconfig.esm.json b/packages/orm/mikro-orm/tsconfig.esm.json index e3b07081667..82292550ddb 100644 --- a/packages/orm/mikro-orm/tsconfig.esm.json +++ b/packages/orm/mikro-orm/tsconfig.esm.json @@ -2,8 +2,7 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "module": "ESNext", - "moduleResolution": "nodenext", + "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", @@ -11,7 +10,7 @@ "composite": true, "noEmit": false }, - "include": ["src", "src/**/*.json"], + "include": ["src/**/*.ts", "src/**/*.json"], "exclude": [ "node_modules", "test", diff --git a/packages/orm/mikro-orm/tsconfig.spec.json b/packages/orm/mikro-orm/tsconfig.spec.json index 21485bab96d..2e917f4b39d 100644 --- a/packages/orm/mikro-orm/tsconfig.spec.json +++ b/packages/orm/mikro-orm/tsconfig.spec.json @@ -3,7 +3,6 @@ "compilerOptions": { "baseUrl": ".", "rootDir": "../..", - "module": "commonjs", "outDir": "./lib/cjs", "declaration": false, "composite": false, diff --git a/packages/orm/mongoose/package.json b/packages/orm/mongoose/package.json index 74c13220819..18722a0a8cf 100644 --- a/packages/orm/mongoose/package.json +++ b/packages/orm/mongoose/package.json @@ -44,7 +44,7 @@ "@tsed/typescript": "workspace:*", "eslint": "^8.57.0", "mongoose": "6.12.7", - "typescript": "4.9.5", + "typescript": "5.6.2", "vitest": "2.0.4" }, "peerDependencies": { diff --git a/packages/orm/mongoose/src/MongooseModule.ts b/packages/orm/mongoose/src/MongooseModule.ts index 5694ca5e26e..1b24e648c8a 100644 --- a/packages/orm/mongoose/src/MongooseModule.ts +++ b/packages/orm/mongoose/src/MongooseModule.ts @@ -1,5 +1,6 @@ import {Configuration, OnInit} from "@tsed/di"; import {Module, OnDestroy} from "@tsed/di"; + import {MONGOOSE_CONNECTIONS} from "./services/MongooseConnections.js"; import {MongooseService} from "./services/MongooseService.js"; diff --git a/packages/orm/mongoose/src/decorators/auto.spec.ts b/packages/orm/mongoose/src/decorators/auto.spec.ts index c18e555e696..0ee527dd454 100644 --- a/packages/orm/mongoose/src/decorators/auto.spec.ts +++ b/packages/orm/mongoose/src/decorators/auto.spec.ts @@ -1,4 +1,5 @@ import {descriptorOf, Store} from "@tsed/core"; + import {MONGOOSE_SCHEMA} from "../constants/constants.js"; import {Auto} from "./auto.js"; diff --git a/packages/orm/mongoose/src/decorators/dynamicRef.spec.ts b/packages/orm/mongoose/src/decorators/dynamicRef.spec.ts index b2f1abc41b7..948acd1ab9b 100644 --- a/packages/orm/mongoose/src/decorators/dynamicRef.spec.ts +++ b/packages/orm/mongoose/src/decorators/dynamicRef.spec.ts @@ -1,8 +1,9 @@ import {descriptorOf, Store} from "@tsed/core"; import {getJsonSchema} from "@tsed/schema"; import {Schema} from "mongoose"; -import {MONGOOSE_MODEL_NAME, MONGOOSE_SCHEMA} from "../constants/constants.js"; + import {DynamicRef} from "../../src/index.js"; +import {MONGOOSE_MODEL_NAME, MONGOOSE_SCHEMA} from "../constants/constants.js"; describe("@DynamicRef()", () => { it("should set metadata", () => { diff --git a/packages/orm/mongoose/src/decorators/dynamicRef.ts b/packages/orm/mongoose/src/decorators/dynamicRef.ts index f76e01bb382..d17ef72da45 100644 --- a/packages/orm/mongoose/src/decorators/dynamicRef.ts +++ b/packages/orm/mongoose/src/decorators/dynamicRef.ts @@ -1,8 +1,9 @@ import {classOf, isArrowFn, isString, StoreMerge, Type, useDecorators} from "@tsed/core"; +import {deserialize, OnDeserialize, OnSerialize, serialize} from "@tsed/json-mapper"; import {Description, Example, JsonHookContext, OneOf, Property, string} from "@tsed/schema"; import {Schema as MongooseSchema} from "mongoose"; + import {MONGOOSE_SCHEMA} from "../constants/constants.js"; -import {deserialize, OnDeserialize, OnSerialize, serialize} from "@tsed/json-mapper"; import {MongooseModels} from "../registries/MongooseModels.js"; function isRef(value: undefined | string | any) { diff --git a/packages/orm/mongoose/src/decorators/excludeIndexes.spec.ts b/packages/orm/mongoose/src/decorators/excludeIndexes.spec.ts index f5c0ed10c71..9ded6e2da00 100644 --- a/packages/orm/mongoose/src/decorators/excludeIndexes.spec.ts +++ b/packages/orm/mongoose/src/decorators/excludeIndexes.spec.ts @@ -1,4 +1,5 @@ import {descriptorOf, Store} from "@tsed/core"; + import {MONGOOSE_SCHEMA} from "../constants/constants.js"; import {ExcludeIndexes} from "./excludeIndexes.js"; diff --git a/packages/orm/mongoose/src/decorators/expires.spec.ts b/packages/orm/mongoose/src/decorators/expires.spec.ts index 37215905cf3..848060f108a 100644 --- a/packages/orm/mongoose/src/decorators/expires.spec.ts +++ b/packages/orm/mongoose/src/decorators/expires.spec.ts @@ -1,4 +1,5 @@ import {descriptorOf, Store} from "@tsed/core"; + import {MONGOOSE_SCHEMA} from "../constants/constants.js"; import {Expires} from "./expires.js"; diff --git a/packages/orm/mongoose/src/decorators/immutable.spec.ts b/packages/orm/mongoose/src/decorators/immutable.spec.ts index 89b65293c3f..866c795fc37 100644 --- a/packages/orm/mongoose/src/decorators/immutable.spec.ts +++ b/packages/orm/mongoose/src/decorators/immutable.spec.ts @@ -1,4 +1,5 @@ import {descriptorOf, Store} from "@tsed/core"; + import {MONGOOSE_SCHEMA} from "../constants/constants.js"; import {Immutable} from "./immutable.js"; diff --git a/packages/orm/mongoose/src/decorators/indexed.spec.ts b/packages/orm/mongoose/src/decorators/indexed.spec.ts index c8d59679478..913cea07bce 100644 --- a/packages/orm/mongoose/src/decorators/indexed.spec.ts +++ b/packages/orm/mongoose/src/decorators/indexed.spec.ts @@ -1,4 +1,5 @@ import {Store} from "@tsed/core"; + import {MONGOOSE_SCHEMA} from "../constants/constants.js"; import {Indexed} from "./indexed.js"; diff --git a/packages/orm/mongoose/src/decorators/indexed.ts b/packages/orm/mongoose/src/decorators/indexed.ts index dcc12b6f531..997d0d38e97 100644 --- a/packages/orm/mongoose/src/decorators/indexed.ts +++ b/packages/orm/mongoose/src/decorators/indexed.ts @@ -1,4 +1,5 @@ import {IndexOptions} from "mongoose"; + import {MongooseSchema} from "./schema.js"; /** diff --git a/packages/orm/mongoose/src/decorators/lowercase.spec.ts b/packages/orm/mongoose/src/decorators/lowercase.spec.ts index 5345c491c09..553b66f76b0 100644 --- a/packages/orm/mongoose/src/decorators/lowercase.spec.ts +++ b/packages/orm/mongoose/src/decorators/lowercase.spec.ts @@ -1,4 +1,5 @@ import {descriptorOf, Store} from "@tsed/core"; + import {MONGOOSE_SCHEMA} from "../constants/constants.js"; import {Lowercase} from "./lowercase.js"; diff --git a/packages/orm/mongoose/src/decorators/model.ts b/packages/orm/mongoose/src/decorators/model.ts index 307d33b16df..b000d76e40a 100644 --- a/packages/orm/mongoose/src/decorators/model.ts +++ b/packages/orm/mongoose/src/decorators/model.ts @@ -2,6 +2,7 @@ import {nameOf, useDecorators} from "@tsed/core"; import {registerProvider} from "@tsed/di"; import {DiscriminatorValue} from "@tsed/schema"; import {Schema} from "mongoose"; + import {MongooseModelOptions} from "../interfaces/MongooseModelOptions.js"; import {MONGOOSE_CONNECTIONS} from "../services/MongooseConnections.js"; import {createModel, getModelToken} from "../utils/createModel.js"; diff --git a/packages/orm/mongoose/src/decorators/mongooseIndexes.spec.ts b/packages/orm/mongoose/src/decorators/mongooseIndexes.spec.ts index a9bed12d26a..2301712ec9d 100644 --- a/packages/orm/mongoose/src/decorators/mongooseIndexes.spec.ts +++ b/packages/orm/mongoose/src/decorators/mongooseIndexes.spec.ts @@ -1,5 +1,5 @@ -import {MongooseIndexes} from "./mongooseIndexes.js"; import {schemaOptions} from "../utils/schemaOptions.js"; +import {MongooseIndexes} from "./mongooseIndexes.js"; describe("@MongooseIndexes()", () => { class Test {} diff --git a/packages/orm/mongoose/src/decorators/mongoosePlugin.ts b/packages/orm/mongoose/src/decorators/mongoosePlugin.ts index d8b74b903fa..849d69a6cc1 100644 --- a/packages/orm/mongoose/src/decorators/mongoosePlugin.ts +++ b/packages/orm/mongoose/src/decorators/mongoosePlugin.ts @@ -1,4 +1,5 @@ import mongoose from "mongoose"; + import {schemaOptions} from "../utils/schemaOptions.js"; /** diff --git a/packages/orm/mongoose/src/decorators/numberDecimal.spec.ts b/packages/orm/mongoose/src/decorators/numberDecimal.spec.ts index 2e1ef3a8af8..dd558e8755f 100644 --- a/packages/orm/mongoose/src/decorators/numberDecimal.spec.ts +++ b/packages/orm/mongoose/src/decorators/numberDecimal.spec.ts @@ -1,9 +1,10 @@ import {Store} from "@tsed/core"; import {deserialize, serialize} from "@tsed/json-mapper"; import {getJsonSchema} from "@tsed/schema"; -import {Types, Schema} from "mongoose"; +import {Schema, Types} from "mongoose"; + import {MONGOOSE_SCHEMA} from "../constants/constants.js"; -import {NumberDecimal, Decimal128, DecimalFormat} from "./numberDecimal.js"; +import {Decimal128, DecimalFormat, NumberDecimal} from "./numberDecimal.js"; describe("@NumberDecimal()", () => { it("should declare a Decimal128 field", () => { diff --git a/packages/orm/mongoose/src/decorators/numberDecimal.ts b/packages/orm/mongoose/src/decorators/numberDecimal.ts index a4b049f30a2..908d21daa7a 100644 --- a/packages/orm/mongoose/src/decorators/numberDecimal.ts +++ b/packages/orm/mongoose/src/decorators/numberDecimal.ts @@ -2,7 +2,8 @@ import {Formats, FormatsMethods} from "@tsed/ajv"; import {isNumber, isString, StoreMerge, useDecorators} from "@tsed/core"; import {OnDeserialize, OnSerialize} from "@tsed/json-mapper"; import {Example, Format, Property} from "@tsed/schema"; -import {Types, Schema as MongooseSchema, SchemaTypeOptions} from "mongoose"; +import {Schema as MongooseSchema, SchemaTypeOptions, Types} from "mongoose"; + import {MONGOOSE_SCHEMA} from "../constants/constants.js"; @Formats("decimal", {type: "number"}) diff --git a/packages/orm/mongoose/src/decorators/objectID.spec.ts b/packages/orm/mongoose/src/decorators/objectID.spec.ts index 368782707cb..68af397e446 100644 --- a/packages/orm/mongoose/src/decorators/objectID.spec.ts +++ b/packages/orm/mongoose/src/decorators/objectID.spec.ts @@ -1,4 +1,5 @@ import {getJsonSchema} from "@tsed/schema"; + import {ObjectID} from "./objectID.js"; describe("ObjectID", () => { diff --git a/packages/orm/mongoose/src/decorators/objectID.ts b/packages/orm/mongoose/src/decorators/objectID.ts index 1585e3174e3..15e6d0bf488 100644 --- a/packages/orm/mongoose/src/decorators/objectID.ts +++ b/packages/orm/mongoose/src/decorators/objectID.ts @@ -2,6 +2,7 @@ import {useDecorators} from "@tsed/core"; import {OnDeserialize} from "@tsed/json-mapper"; import {Description, Example, Name, Pattern} from "@tsed/schema"; import {Types} from "mongoose"; + import {Auto} from "./auto.js"; import {Schema} from "./schema.js"; diff --git a/packages/orm/mongoose/src/decorators/postHook.ts b/packages/orm/mongoose/src/decorators/postHook.ts index 3c9d1d905c2..1e496b97e31 100644 --- a/packages/orm/mongoose/src/decorators/postHook.ts +++ b/packages/orm/mongoose/src/decorators/postHook.ts @@ -1,4 +1,5 @@ import {decoratorTypeOf, DecoratorTypes, StaticMethodDecorator} from "@tsed/core"; + import {MongooseHookOptions, MongoosePostHookCB} from "../interfaces/MongooseSchemaOptions.js"; import {schemaOptions} from "../utils/schemaOptions.js"; diff --git a/packages/orm/mongoose/src/decorators/preHook.ts b/packages/orm/mongoose/src/decorators/preHook.ts index ae3970368d4..f27323c2648 100644 --- a/packages/orm/mongoose/src/decorators/preHook.ts +++ b/packages/orm/mongoose/src/decorators/preHook.ts @@ -1,4 +1,5 @@ import {decoratorTypeOf, DecoratorTypes} from "@tsed/core"; + import {MongooseHookOptions, MongoosePreHookCB} from "../interfaces/MongooseSchemaOptions.js"; import {schemaOptions} from "../utils/schemaOptions.js"; diff --git a/packages/orm/mongoose/src/decorators/ref.spec.ts b/packages/orm/mongoose/src/decorators/ref.spec.ts index 3a4014b320d..335dbb34403 100644 --- a/packages/orm/mongoose/src/decorators/ref.spec.ts +++ b/packages/orm/mongoose/src/decorators/ref.spec.ts @@ -1,13 +1,14 @@ import {catchError, Store} from "@tsed/core"; import {getJsonSchema, Property} from "@tsed/schema"; import {Schema} from "mongoose"; + import {MONGOOSE_MODEL_NAME, MONGOOSE_SCHEMA} from "../constants/constants.js"; import {MongooseModels} from "../registries/MongooseModels.js"; import {Ref} from "./ref.js"; describe("@Ref()", () => { - describe("type is a class", () => { - it("should set metadata", () => { + describe("type is a class an", () => { + it("should set metadata and catch error", () => { const error = catchError(() => { class Model { @Ref(undefined) @@ -19,8 +20,7 @@ describe("@Ref()", () => { "A model is required on `@Ref(model)` decorator. Please give a model or wrap it inside an arrow function if you have a circular reference." ); }); - }); - describe("type is a class", () => { + it("should set metadata", () => { class RefTest { @Property() diff --git a/packages/orm/mongoose/src/decorators/ref.ts b/packages/orm/mongoose/src/decorators/ref.ts index a2fe112e9ad..c47a4395de7 100644 --- a/packages/orm/mongoose/src/decorators/ref.ts +++ b/packages/orm/mongoose/src/decorators/ref.ts @@ -2,6 +2,7 @@ import {isArrowFn, isCollection, isObject, isObjectID, isString, StoreMerge, Typ import {deserialize, OnDeserialize, OnSerialize, serialize} from "@tsed/json-mapper"; import {ForwardGroups, JsonEntityFn, lazyRef, matchGroups, OneOf, Property, string} from "@tsed/schema"; import {Schema as MongooseSchema} from "mongoose"; + import {MONGOOSE_SCHEMA} from "../constants/constants.js"; import {MongooseSchemaTypes} from "../interfaces/MongooseSchemaTypes.js"; import {MongooseModels} from "../registries/MongooseModels.js"; diff --git a/packages/orm/mongoose/src/decorators/schema.ts b/packages/orm/mongoose/src/decorators/schema.ts index 7a144ecc591..a405c1c596a 100644 --- a/packages/orm/mongoose/src/decorators/schema.ts +++ b/packages/orm/mongoose/src/decorators/schema.ts @@ -2,6 +2,7 @@ import {decoratorTypeOf, StoreMerge, useDecorators} from "@tsed/core"; import {registerProvider} from "@tsed/di"; import {Property} from "@tsed/schema"; import {SchemaTypeOptions} from "mongoose"; + import {MONGOOSE_SCHEMA} from "../constants/constants.js"; import {MongooseSchemaOptions} from "../interfaces/MongooseSchemaOptions.js"; import {getSchema, getSchemaToken} from "../utils/createSchema.js"; diff --git a/packages/orm/mongoose/src/decorators/schemaIgnore.spec.ts b/packages/orm/mongoose/src/decorators/schemaIgnore.spec.ts index 283c490293a..c8056fe0b7d 100644 --- a/packages/orm/mongoose/src/decorators/schemaIgnore.spec.ts +++ b/packages/orm/mongoose/src/decorators/schemaIgnore.spec.ts @@ -1,4 +1,5 @@ import {Store} from "@tsed/core"; + import {MONGOOSE_SCHEMA} from "../constants/constants.js"; import {SchemaIgnore} from "./schemaIgnore.js"; diff --git a/packages/orm/mongoose/src/decorators/select.spec.ts b/packages/orm/mongoose/src/decorators/select.spec.ts index fb2ba04a8da..f1c79652044 100644 --- a/packages/orm/mongoose/src/decorators/select.spec.ts +++ b/packages/orm/mongoose/src/decorators/select.spec.ts @@ -1,6 +1,7 @@ import {descriptorOf, Store} from "@tsed/core"; -import {MONGOOSE_SCHEMA} from "../constants/constants.js"; + import {Select} from "../../src/index.js"; +import {MONGOOSE_SCHEMA} from "../constants/constants.js"; describe("@Select()", () => { it("should set metadata", () => { diff --git a/packages/orm/mongoose/src/decorators/sparse.spec.ts b/packages/orm/mongoose/src/decorators/sparse.spec.ts index 0c3ba0c7f35..c0912058a98 100644 --- a/packages/orm/mongoose/src/decorators/sparse.spec.ts +++ b/packages/orm/mongoose/src/decorators/sparse.spec.ts @@ -1,4 +1,5 @@ import {descriptorOf, Store} from "@tsed/core"; + import {MONGOOSE_SCHEMA} from "../constants/constants.js"; import {Sparse} from "./sparse.js"; diff --git a/packages/orm/mongoose/src/decorators/text.spec.ts b/packages/orm/mongoose/src/decorators/text.spec.ts index 5b0334b3492..7cb557f3aab 100644 --- a/packages/orm/mongoose/src/decorators/text.spec.ts +++ b/packages/orm/mongoose/src/decorators/text.spec.ts @@ -1,4 +1,5 @@ import {descriptorOf, Store} from "@tsed/core"; + import {MONGOOSE_SCHEMA} from "../constants/constants.js"; import {Text} from "./text.js"; diff --git a/packages/orm/mongoose/src/decorators/trim.spec.ts b/packages/orm/mongoose/src/decorators/trim.spec.ts index d8d39ff5adf..20464566a57 100644 --- a/packages/orm/mongoose/src/decorators/trim.spec.ts +++ b/packages/orm/mongoose/src/decorators/trim.spec.ts @@ -1,4 +1,5 @@ import {descriptorOf, Store} from "@tsed/core"; + import {MONGOOSE_SCHEMA} from "../constants/constants.js"; import {Trim} from "./trim.js"; diff --git a/packages/orm/mongoose/src/decorators/unique.spec.ts b/packages/orm/mongoose/src/decorators/unique.spec.ts index 250bdd9ab84..e5fe6e550b9 100644 --- a/packages/orm/mongoose/src/decorators/unique.spec.ts +++ b/packages/orm/mongoose/src/decorators/unique.spec.ts @@ -1,6 +1,7 @@ import {Store} from "@tsed/core"; -import {MONGOOSE_SCHEMA} from "../constants/constants.js"; + import {Unique} from "../../src/index.js"; +import {MONGOOSE_SCHEMA} from "../constants/constants.js"; describe("@Unique()", () => { it("should set metadata", () => { diff --git a/packages/orm/mongoose/src/decorators/uppercase.spec.ts b/packages/orm/mongoose/src/decorators/uppercase.spec.ts index 1e81649822d..6c4dac4199f 100644 --- a/packages/orm/mongoose/src/decorators/uppercase.spec.ts +++ b/packages/orm/mongoose/src/decorators/uppercase.spec.ts @@ -1,4 +1,5 @@ import {descriptorOf, Store} from "@tsed/core"; + import {MONGOOSE_SCHEMA} from "../constants/constants.js"; import {Uppercase} from "./uppercase.js"; diff --git a/packages/orm/mongoose/src/decorators/versionKey.spec.ts b/packages/orm/mongoose/src/decorators/versionKey.spec.ts index 00d5090e919..65a6401b83e 100644 --- a/packages/orm/mongoose/src/decorators/versionKey.spec.ts +++ b/packages/orm/mongoose/src/decorators/versionKey.spec.ts @@ -1,4 +1,5 @@ import {Store} from "@tsed/core"; + import {MONGOOSE_SCHEMA_OPTIONS} from "../constants/constants.js"; import {Model} from "./model.js"; import {VersionKey} from "./versionKey.js"; diff --git a/packages/orm/mongoose/src/decorators/versionKey.ts b/packages/orm/mongoose/src/decorators/versionKey.ts index c6b17002a3c..216e2b18a2e 100644 --- a/packages/orm/mongoose/src/decorators/versionKey.ts +++ b/packages/orm/mongoose/src/decorators/versionKey.ts @@ -1,4 +1,5 @@ import {Store} from "@tsed/core"; + import {MONGOOSE_SCHEMA_OPTIONS} from "../constants/constants.js"; export function VersionKey(): PropertyDecorator { diff --git a/packages/orm/mongoose/src/decorators/virtualRef.spec.ts b/packages/orm/mongoose/src/decorators/virtualRef.spec.ts index ebe167ac8fa..14d9f7118d1 100644 --- a/packages/orm/mongoose/src/decorators/virtualRef.spec.ts +++ b/packages/orm/mongoose/src/decorators/virtualRef.spec.ts @@ -2,6 +2,7 @@ import {Store} from "@tsed/core"; import {Controller} from "@tsed/di"; import {BodyParams} from "@tsed/platform-params"; import {Format, getJsonSchema, getSpec, Post, Property, ReadOnly, Returns, SpecTypes} from "@tsed/schema"; + import {MONGOOSE_SCHEMA} from "../constants/constants.js"; import {Model} from "./model.js"; import {VirtualRef, VirtualRefs} from "./virtualRef.js"; diff --git a/packages/orm/mongoose/src/decorators/virtualRef.ts b/packages/orm/mongoose/src/decorators/virtualRef.ts index 924c0527fe2..f41246b7c51 100644 --- a/packages/orm/mongoose/src/decorators/virtualRef.ts +++ b/packages/orm/mongoose/src/decorators/virtualRef.ts @@ -1,5 +1,6 @@ import {isPlainObject, isString, Store, StoreMerge, useDecorators} from "@tsed/core"; import {CollectionOf, Property} from "@tsed/schema"; + import {MONGOOSE_MODEL_NAME, MONGOOSE_SCHEMA} from "../constants/constants.js"; import {MongooseVirtualRefOptions} from "../interfaces/MongooseVirtualRefOptions.js"; import {MongooseModels} from "../registries/MongooseModels.js"; diff --git a/packages/orm/mongoose/src/interfaces/MongooseSchemaOptions.ts b/packages/orm/mongoose/src/interfaces/MongooseSchemaOptions.ts index 2ccf5b53257..4da84387e44 100644 --- a/packages/orm/mongoose/src/interfaces/MongooseSchemaOptions.ts +++ b/packages/orm/mongoose/src/interfaces/MongooseSchemaOptions.ts @@ -1,4 +1,5 @@ import {type IndexOptions, Schema, SchemaOptions} from "mongoose"; + import {MongooseDocument} from "./MongooseDocument.js"; export type MongooseNextCB = (err?: Error) => void; diff --git a/packages/orm/mongoose/src/services/MongooseConnection.spec.ts b/packages/orm/mongoose/src/services/MongooseConnection.spec.ts index a3dd696f418..096df1f033c 100644 --- a/packages/orm/mongoose/src/services/MongooseConnection.spec.ts +++ b/packages/orm/mongoose/src/services/MongooseConnection.spec.ts @@ -1,5 +1,6 @@ import {PlatformTest} from "@tsed/common"; import {Configuration} from "@tsed/di"; + import {MongooseService} from "../../src/index.js"; import {MONGOOSE_CONNECTIONS} from "../../src/services/MongooseConnections.js"; diff --git a/packages/orm/mongoose/src/services/MongooseConnections.ts b/packages/orm/mongoose/src/services/MongooseConnections.ts index c9befe4804f..6db32f9e5e2 100644 --- a/packages/orm/mongoose/src/services/MongooseConnections.ts +++ b/packages/orm/mongoose/src/services/MongooseConnections.ts @@ -1,5 +1,6 @@ -import {Configuration, registerProvider} from "@tsed/di"; import {isArray} from "@tsed/core"; +import {Configuration, registerProvider} from "@tsed/di"; + import {MongooseConnectionOptions} from "../interfaces/MongooseConnectionOptions.js"; import {MongooseService} from "../services/MongooseService.js"; diff --git a/packages/orm/mongoose/src/services/MongooseService.spec.ts b/packages/orm/mongoose/src/services/MongooseService.spec.ts index 0f93b32b505..e8cbd45b576 100644 --- a/packages/orm/mongoose/src/services/MongooseService.spec.ts +++ b/packages/orm/mongoose/src/services/MongooseService.spec.ts @@ -1,5 +1,6 @@ import {PlatformTest} from "@tsed/common"; import Mongoose from "mongoose"; + import {MongooseService} from "../../src/index.js"; describe("Mongoose", () => { diff --git a/packages/orm/mongoose/src/utils/buildMongooseSchema.spec.ts b/packages/orm/mongoose/src/utils/buildMongooseSchema.spec.ts index 6b1bca4b537..0bc185f1f79 100644 --- a/packages/orm/mongoose/src/utils/buildMongooseSchema.spec.ts +++ b/packages/orm/mongoose/src/utils/buildMongooseSchema.spec.ts @@ -1,5 +1,6 @@ import {JsonEntityStore, Property} from "@tsed/schema"; import {Types} from "mongoose"; + import {buildMongooseSchema} from "../../src/utils/createSchema.js"; import {MONGOOSE_SCHEMA} from "../constants/constants.js"; diff --git a/packages/orm/mongoose/src/utils/createModel.spec.ts b/packages/orm/mongoose/src/utils/createModel.spec.ts index c16cb59e23d..e13ec1ab3ee 100644 --- a/packages/orm/mongoose/src/utils/createModel.spec.ts +++ b/packages/orm/mongoose/src/utils/createModel.spec.ts @@ -1,4 +1,5 @@ import mongoose from "mongoose"; + import {createModel} from "../../src/index.js"; describe("createModel()", () => { diff --git a/packages/orm/mongoose/src/utils/createModel.ts b/packages/orm/mongoose/src/utils/createModel.ts index ee812cb6594..4efc428365f 100644 --- a/packages/orm/mongoose/src/utils/createModel.ts +++ b/packages/orm/mongoose/src/utils/createModel.ts @@ -1,6 +1,7 @@ import {nameOf, Store, Type} from "@tsed/core"; import {JsonEntityStore} from "@tsed/schema"; import mongoose, {Connection} from "mongoose"; + import {MONGOOSE_MODEL, MONGOOSE_MODEL_NAME} from "../constants/constants.js"; import {MongooseModels} from "../registries/MongooseModels.js"; import {getSchemaToken} from "./createSchema.js"; diff --git a/packages/orm/mongoose/src/utils/createSchema.spec.ts b/packages/orm/mongoose/src/utils/createSchema.spec.ts index 047cbd88eb7..4d6cb0ccd4b 100644 --- a/packages/orm/mongoose/src/utils/createSchema.spec.ts +++ b/packages/orm/mongoose/src/utils/createSchema.spec.ts @@ -13,6 +13,8 @@ import { Required } from "@tsed/schema"; import {Schema as SchemaMongoose, Types} from "mongoose"; + +import {DiscriminatorKey} from "../decorators/discriminatorKey.js"; import {Model} from "../decorators/model.js"; import {ObjectID} from "../decorators/objectID.js"; import {Ref} from "../decorators/ref.js"; @@ -21,7 +23,6 @@ import {SchemaIgnore} from "../decorators/schemaIgnore.js"; import {VersionKey} from "../decorators/versionKey.js"; import {VirtualRef, VirtualRefs} from "../decorators/virtualRef.js"; import {getSchema} from "./createSchema.js"; -import {DiscriminatorKey} from "../decorators/discriminatorKey.js"; describe("createSchema", () => { it("should create schema", () => { diff --git a/packages/orm/mongoose/src/utils/createSchema.ts b/packages/orm/mongoose/src/utils/createSchema.ts index 869d8c864ab..790561e34eb 100644 --- a/packages/orm/mongoose/src/utils/createSchema.ts +++ b/packages/orm/mongoose/src/utils/createSchema.ts @@ -3,6 +3,7 @@ import {deserialize, serialize} from "@tsed/json-mapper"; import {getProperties, JsonEntityStore, JsonSchema} from "@tsed/schema"; import {pascalCase} from "change-case"; import mongoose, {Schema, SchemaDefinition, SchemaOptions, SchemaTypeOptions} from "mongoose"; + import {MONGOOSE_SCHEMA, MONGOOSE_SCHEMA_OPTIONS} from "../constants/constants.js"; import {MongooseSchemaOptions} from "../interfaces/MongooseSchemaOptions.js"; import {MongooseVirtualRefOptions} from "../interfaces/MongooseVirtualRefOptions.js"; diff --git a/packages/orm/mongoose/src/utils/resolveRefType.spec.ts b/packages/orm/mongoose/src/utils/resolveRefType.spec.ts index 0d3ea1ae980..59df5669338 100644 --- a/packages/orm/mongoose/src/utils/resolveRefType.spec.ts +++ b/packages/orm/mongoose/src/utils/resolveRefType.spec.ts @@ -1,4 +1,5 @@ import {Store} from "@tsed/core"; + import {MONGOOSE_MODEL_NAME} from "../constants/constants.js"; import {resolveRefType} from "./resolveRefType.js"; @@ -14,14 +15,6 @@ describe("resolveRefType", () => { expect(resolveRefType(Test)).toBe("Test"); }); - it("should return type as string (from class)", () => { - class Test {} - - Store.from(Test).set(MONGOOSE_MODEL_NAME, "Test"); - - expect(resolveRefType(Test)).toBe("Test"); - }); - it("should return type as string (from class without store)", () => { class Test {} diff --git a/packages/orm/mongoose/src/utils/resolveRefType.ts b/packages/orm/mongoose/src/utils/resolveRefType.ts index d71537c74cb..4a789599949 100644 --- a/packages/orm/mongoose/src/utils/resolveRefType.ts +++ b/packages/orm/mongoose/src/utils/resolveRefType.ts @@ -1,4 +1,5 @@ import {isClass, isString, nameOf, Store, Type} from "@tsed/core"; + import {MONGOOSE_MODEL_NAME} from "../constants/constants.js"; /** diff --git a/packages/orm/mongoose/src/utils/schemaOptions.ts b/packages/orm/mongoose/src/utils/schemaOptions.ts index 91f97a508ca..ddf3c61b34c 100644 --- a/packages/orm/mongoose/src/utils/schemaOptions.ts +++ b/packages/orm/mongoose/src/utils/schemaOptions.ts @@ -1,5 +1,6 @@ import {deepMerge, Store} from "@tsed/core"; import {Schema} from "mongoose"; + import {MONGOOSE_SCHEMA_OPTIONS} from "../constants/constants.js"; import { MongooseHookPromised, diff --git a/packages/orm/mongoose/test/array.integration.spec.ts b/packages/orm/mongoose/test/array.integration.spec.ts index 578c7c3bb7e..5f4e3692a95 100644 --- a/packages/orm/mongoose/test/array.integration.spec.ts +++ b/packages/orm/mongoose/test/array.integration.spec.ts @@ -1,7 +1,8 @@ +import {DITest} from "@tsed/di"; import {serialize} from "@tsed/json-mapper"; -import {MyWorkspace, UserModel, UserWorkspace, Workspace, WorkspaceModel} from "./helpers/models/UserWorkspace.js"; import {TestContainersMongo} from "@tsed/testcontainers-mongo"; -import {DITest} from "@tsed/di"; + +import {MyWorkspace, UserModel, UserWorkspace, Workspace, WorkspaceModel} from "./helpers/models/UserWorkspace.js"; describe("Mongoose", () => { describe("Array models", () => { diff --git a/packages/orm/mongoose/test/buffer.integration.spec.ts b/packages/orm/mongoose/test/buffer.integration.spec.ts index 9d7ffe2c5bf..ccb737f6782 100644 --- a/packages/orm/mongoose/test/buffer.integration.spec.ts +++ b/packages/orm/mongoose/test/buffer.integration.spec.ts @@ -1,9 +1,10 @@ +import {faker} from "@faker-js/faker"; +import {PlatformTest} from "@tsed/common"; +import {TestContainersMongo} from "@tsed/testcontainers-mongo"; import axios from "axios"; -import faker from "@faker-js/faker"; + import {MongooseModel} from "../src/interfaces/MongooseModel.js"; import {TestAvatar} from "./helpers/models/Avatar.js"; -import {TestContainersMongo} from "@tsed/testcontainers-mongo"; -import {PlatformTest} from "@tsed/common"; describe("Mongoose", () => { describe("Models with Buffer", () => { diff --git a/packages/orm/mongoose/test/circularRef.integration.spec.ts b/packages/orm/mongoose/test/circularRef.integration.spec.ts index aa633f6411e..4dbcba432f9 100644 --- a/packages/orm/mongoose/test/circularRef.integration.spec.ts +++ b/packages/orm/mongoose/test/circularRef.integration.spec.ts @@ -1,11 +1,12 @@ import {Injectable, PlatformTest} from "@tsed/common"; import {Inject} from "@tsed/di"; -import {MongooseModel} from "@tsed/mongoose"; import {getJsonSchema} from "@tsed/schema"; +import {TestContainersMongo} from "@tsed/testcontainers-mongo"; + +import {MongooseModel} from ".."; import {TestContract} from "./helpers/models/Contract.js"; import {TestCustomer} from "./helpers/models/Customer.js"; import {SelfUser} from "./helpers/models/User.js"; -import {TestContainersMongo} from "@tsed/testcontainers-mongo"; @Injectable() class MyService { diff --git a/packages/orm/mongoose/test/discriminators.integration.spec.ts b/packages/orm/mongoose/test/discriminators.integration.spec.ts index eab0bf0ab31..de7bd2c7120 100644 --- a/packages/orm/mongoose/test/discriminators.integration.spec.ts +++ b/packages/orm/mongoose/test/discriminators.integration.spec.ts @@ -1,7 +1,8 @@ -import {Required, DiscriminatorValue} from "@tsed/schema"; import {PlatformTest} from "@tsed/common"; +import {DiscriminatorValue, Required} from "@tsed/schema"; import {TestContainersMongo} from "@tsed/testcontainers-mongo"; -import {DiscriminatorKey, Model, ObjectID, MongooseModel} from "../src/index.js"; + +import {DiscriminatorKey, Model, MongooseModel, ObjectID} from "../src/index.js"; describe("Mongoose", () => { describe("Discriminators", () => { diff --git a/packages/orm/mongoose/test/dynamicRef.integration.spec.ts b/packages/orm/mongoose/test/dynamicRef.integration.spec.ts index 8de6602a705..32cf193bf59 100644 --- a/packages/orm/mongoose/test/dynamicRef.integration.spec.ts +++ b/packages/orm/mongoose/test/dynamicRef.integration.spec.ts @@ -1,9 +1,10 @@ import {PlatformTest} from "@tsed/common"; import {deserialize, serialize} from "@tsed/json-mapper"; import {Enum, getJsonSchema, Required} from "@tsed/schema"; +import {TestContainersMongo} from "@tsed/testcontainers-mongo"; + import {Model} from "../src/decorators/model.js"; import {DynamicRef, MongooseModel, ObjectID} from "../src/index.js"; -import {TestContainersMongo} from "@tsed/testcontainers-mongo"; describe("DynamicRef Integration", () => { @Model() diff --git a/packages/orm/mongoose/test/enums.integration.spec.ts b/packages/orm/mongoose/test/enums.integration.spec.ts index b48ae1668ff..a85a674bff4 100644 --- a/packages/orm/mongoose/test/enums.integration.spec.ts +++ b/packages/orm/mongoose/test/enums.integration.spec.ts @@ -1,7 +1,8 @@ -import {Model} from "@tsed/mongoose"; import {CollectionOf, Default, Description, Enum, enums, getJsonSchema, MaxLength, MinLength, Required} from "@tsed/schema"; import {TestContainersMongo} from "@tsed/testcontainers-mongo"; +import {Model} from ".."; + export enum ComponentStatuses { UNDER_MAINTENANCE = "UNDER_MAINTENANCE", DEGRADED_PERFORMANCE = "DEGRADED_PERFORMANCE", diff --git a/packages/orm/mongoose/test/helpers/Server.ts b/packages/orm/mongoose/test/helpers/Server.ts index a8df7d356e0..4b42258a53c 100644 --- a/packages/orm/mongoose/test/helpers/Server.ts +++ b/packages/orm/mongoose/test/helpers/Server.ts @@ -1,6 +1,7 @@ -import {Configuration, Inject, PlatformApplication} from "@tsed/common"; -import "@tsed/mongoose"; +import "../.."; import "@tsed/platform-express"; + +import {Configuration, Inject, PlatformApplication} from "@tsed/common"; import bodyParser from "body-parser"; import compress from "compression"; import cookieParser from "cookie-parser"; diff --git a/packages/orm/mongoose/test/helpers/models/Avatar.ts b/packages/orm/mongoose/test/helpers/models/Avatar.ts index 6bfbe03fae9..f8b4d1e162f 100644 --- a/packages/orm/mongoose/test/helpers/models/Avatar.ts +++ b/packages/orm/mongoose/test/helpers/models/Avatar.ts @@ -1,4 +1,5 @@ import {Property} from "@tsed/schema"; + import {Model, ObjectID} from "../../../src/index.js"; @Model({schemaOptions: {timestamps: true}}) diff --git a/packages/orm/mongoose/test/helpers/models/Client.ts b/packages/orm/mongoose/test/helpers/models/Client.ts index c0938ab0484..6c652f2fa7f 100644 --- a/packages/orm/mongoose/test/helpers/models/Client.ts +++ b/packages/orm/mongoose/test/helpers/models/Client.ts @@ -1,4 +1,5 @@ import {CollectionOf} from "@tsed/schema"; + import {Model, ObjectID, Ref} from "../../../src/index.js"; import {SelfUser} from "./User.js"; diff --git a/packages/orm/mongoose/test/helpers/models/Customer.ts b/packages/orm/mongoose/test/helpers/models/Customer.ts index 8cf9f0e66c3..0e705643d61 100644 --- a/packages/orm/mongoose/test/helpers/models/Customer.ts +++ b/packages/orm/mongoose/test/helpers/models/Customer.ts @@ -1,5 +1,6 @@ -import {Model, ObjectID, Ref} from "@tsed/mongoose"; import {CollectionOf} from "@tsed/schema"; + +import {Model, ObjectID, Ref} from "../../.."; import {TestClient} from "./Client.js"; import {TestContract} from "./Contract.js"; diff --git a/packages/orm/mongoose/test/helpers/models/User.ts b/packages/orm/mongoose/test/helpers/models/User.ts index 02f859928d2..5f9794209d4 100644 --- a/packages/orm/mongoose/test/helpers/models/User.ts +++ b/packages/orm/mongoose/test/helpers/models/User.ts @@ -1,6 +1,7 @@ -import {Model, MongooseNextCB, ObjectID, PostHook, PreHook, Ref, Schema, Unique} from "@tsed/mongoose"; import {CollectionOf, Groups, Ignore, MinLength, Property, Required} from "@tsed/schema"; +import {Model, MongooseNextCB, ObjectID, PostHook, PreHook, Ref, Schema, Unique} from "../../.."; + export class BaseModel { @ObjectID("id") @Groups("!creation") @@ -17,7 +18,7 @@ export class BaseModel { schemaOptions: {_id: false} }) export class UserModuleData { - @CollectionOf(Number).MinItems(1) + @(CollectionOf(Number).MinItems(1)) roles: number[]; } diff --git a/packages/orm/mongoose/test/helpers/models/UserWorkspace.ts b/packages/orm/mongoose/test/helpers/models/UserWorkspace.ts index de48923fb3b..2b6b8aefdf7 100644 --- a/packages/orm/mongoose/test/helpers/models/UserWorkspace.ts +++ b/packages/orm/mongoose/test/helpers/models/UserWorkspace.ts @@ -1,7 +1,8 @@ import {CollectionOf, Property} from "@tsed/schema"; -import {Model, MongooseModel, ObjectID, Ref, Schema} from "@tsed/mongoose"; import {Types} from "mongoose"; +import {Model, MongooseModel, ObjectID, Ref, Schema} from "../../.."; + @Model() export class Workspace { @ObjectID("id") diff --git a/packages/orm/mongoose/test/multipleConnection.integration.spec.ts b/packages/orm/mongoose/test/multipleConnection.integration.spec.ts index b1eee133573..4c6740fd868 100644 --- a/packages/orm/mongoose/test/multipleConnection.integration.spec.ts +++ b/packages/orm/mongoose/test/multipleConnection.integration.spec.ts @@ -1,7 +1,8 @@ import {PlatformTest} from "@tsed/common"; import {Property} from "@tsed/schema"; -import {Model, MongooseModel, MongooseService, ObjectID} from "@tsed/mongoose"; import {TestContainersMongo} from "@tsed/testcontainers-mongo"; + +import {Model, MongooseModel, MongooseService, ObjectID} from ".."; import {Server} from "./helpers/Server.js"; @Model({ diff --git a/packages/orm/mongoose/test/readonly.integration.spec.ts b/packages/orm/mongoose/test/readonly.integration.spec.ts index 3c096116e21..cbfa7a27152 100644 --- a/packages/orm/mongoose/test/readonly.integration.spec.ts +++ b/packages/orm/mongoose/test/readonly.integration.spec.ts @@ -1,8 +1,9 @@ import {Inject, Injectable, PlatformTest} from "@tsed/common"; import {getJsonSchema, Groups, Name, Property, ReadOnly, Required} from "@tsed/schema"; -import {Immutable, Model, MongooseModel, ObjectID, SchemaIgnore} from "../src/index.js"; import {TestContainersMongo} from "@tsed/testcontainers-mongo"; +import {Immutable, Model, MongooseModel, ObjectID, SchemaIgnore} from "../src/index.js"; + class BaseModel { @ObjectID("id") @Required() diff --git a/packages/orm/mongoose/test/ref-array.integration.spec.ts b/packages/orm/mongoose/test/ref-array.integration.spec.ts index d76967adaea..ee0d67efeca 100644 --- a/packages/orm/mongoose/test/ref-array.integration.spec.ts +++ b/packages/orm/mongoose/test/ref-array.integration.spec.ts @@ -1,10 +1,11 @@ -import faker from "@faker-js/faker"; +import {faker} from "@faker-js/faker"; import {BodyParams, Controller, Get, Inject, PlatformTest, Post, QueryParams} from "@tsed/common"; import {deserialize, serialize} from "@tsed/json-mapper"; -import {MongooseModel} from "@tsed/mongoose"; import {PlatformExpress} from "@tsed/platform-express"; import {TestContainersMongo} from "@tsed/testcontainers-mongo"; import SuperTest from "supertest"; + +import {MongooseModel} from ".."; import {TestProfile2, TestUser} from "./helpers/models/User.js"; import {Server} from "./helpers/Server.js"; diff --git a/packages/orm/mongoose/test/ref.integration.spec.ts b/packages/orm/mongoose/test/ref.integration.spec.ts index d5844c31007..f5529cbe7bd 100644 --- a/packages/orm/mongoose/test/ref.integration.spec.ts +++ b/packages/orm/mongoose/test/ref.integration.spec.ts @@ -1,10 +1,11 @@ -import faker from "@faker-js/faker"; +import {faker} from "@faker-js/faker"; import {BodyParams, Controller, Get, Inject, PlatformTest, Post, QueryParams} from "@tsed/common"; import {deserialize, serialize} from "@tsed/json-mapper"; -import {MongooseModel} from "@tsed/mongoose"; import {PlatformExpress} from "@tsed/platform-express"; import {TestContainersMongo} from "@tsed/testcontainers-mongo"; import SuperTest from "supertest"; + +import {MongooseModel} from ".."; import {TestProfile, TestUser} from "./helpers/models/User.js"; import {Server} from "./helpers/Server.js"; diff --git a/packages/orm/mongoose/test/resources.integration.spec.ts b/packages/orm/mongoose/test/resources.integration.spec.ts index 83e05c71b97..aa7f87b7892 100644 --- a/packages/orm/mongoose/test/resources.integration.spec.ts +++ b/packages/orm/mongoose/test/resources.integration.spec.ts @@ -1,12 +1,13 @@ -import faker from "@faker-js/faker"; +import {faker} from "@faker-js/faker"; import {BodyParams, Controller, Get, Inject, Injectable, PathParams, PlatformTest, Post} from "@tsed/common"; import {isArray} from "@tsed/core"; import {deserialize} from "@tsed/json-mapper"; -import {MongooseModel} from "@tsed/mongoose"; import {PlatformExpress} from "@tsed/platform-express"; import {Groups, Returns} from "@tsed/schema"; import {TestContainersMongo} from "@tsed/testcontainers-mongo"; import SuperTest from "supertest"; + +import {MongooseModel} from ".."; import {TestRole, TestUser, TestUserNew} from "./helpers/models/User.js"; import {Server} from "./helpers/Server.js"; @@ -42,25 +43,25 @@ class ResourcesCtrl { TestRole: MongooseModel; @Get("/without/:id") - @Returns(200, TestUser).Groups("!creation") + @(Returns(200, TestUser).Groups("!creation")) getWithoutType(@PathParams("id") id: string) { return this.repository.findById(id); } @Get("/:id") - @Returns(200, TestUser).Groups("!creation") + @(Returns(200, TestUser).Groups("!creation")) get(@PathParams("id") id: string) { return this.repository.findById(id); } @Get("/") - @Returns(200, Array).Of(TestUser).Groups("!creation") + @(Returns(200, Array).Of(TestUser).Groups("!creation")) getAll() { return this.repository.findAll(); } @Post("/") - @Returns(201, TestUser).Groups("!creation") + @(Returns(201, TestUser).Groups("!creation")) create(@BodyParams() @Groups("creation") user: TestUser) { return this.repository.create(user); } diff --git a/packages/orm/mongoose/test/subdocument.integration.spec.ts b/packages/orm/mongoose/test/subdocument.integration.spec.ts index 5a61a712142..0f3264eaade 100644 --- a/packages/orm/mongoose/test/subdocument.integration.spec.ts +++ b/packages/orm/mongoose/test/subdocument.integration.spec.ts @@ -1,7 +1,8 @@ import {Property} from "@tsed/schema"; -import {getSchema, Model, MongooseSchema, ObjectID} from "../src/index.js"; import {TestContainersMongo} from "@tsed/testcontainers-mongo"; +import {getSchema, Model, MongooseSchema, ObjectID} from "../src/index.js"; + @MongooseSchema() export class TestSubDocument { @Property() diff --git a/packages/orm/mongoose/test/user.integration.spec.ts b/packages/orm/mongoose/test/user.integration.spec.ts index 51c5182e3a1..d94cede2d95 100644 --- a/packages/orm/mongoose/test/user.integration.spec.ts +++ b/packages/orm/mongoose/test/user.integration.spec.ts @@ -1,8 +1,9 @@ -import faker from "@faker-js/faker"; +import {faker} from "@faker-js/faker"; import {PlatformTest} from "@tsed/common"; +import {TestContainersMongo} from "@tsed/testcontainers-mongo"; + import {MongooseModel} from "../src/interfaces/MongooseModel.js"; import {TestUser} from "./helpers/models/User.js"; -import {TestContainersMongo} from "@tsed/testcontainers-mongo"; describe("Mongoose", () => { describe("UserModel (di)", () => { diff --git a/packages/orm/mongoose/test/versioning.integration.spec.ts b/packages/orm/mongoose/test/versioning.integration.spec.ts index 86c7cba6d09..d5c0d02a939 100644 --- a/packages/orm/mongoose/test/versioning.integration.spec.ts +++ b/packages/orm/mongoose/test/versioning.integration.spec.ts @@ -1,9 +1,10 @@ +import {PlatformTest} from "@tsed/common"; import {serialize} from "@tsed/json-mapper"; -import {MongooseModel} from "../src/interfaces/MongooseModel.js"; import {Integer, Required} from "@tsed/schema"; -import {Model, ObjectID, VersionKey} from "../src/index.js"; import {TestContainersMongo} from "@tsed/testcontainers-mongo"; -import {PlatformTest} from "@tsed/common"; + +import {Model, ObjectID, VersionKey} from "../src/index.js"; +import {MongooseModel} from "../src/interfaces/MongooseModel.js"; describe("Mongoose", () => { describe("Versioning", () => { diff --git a/packages/orm/mongoose/test/virtualRef.integration.spec.ts b/packages/orm/mongoose/test/virtualRef.integration.spec.ts index eef4b7bcd08..beff8f17931 100644 --- a/packages/orm/mongoose/test/virtualRef.integration.spec.ts +++ b/packages/orm/mongoose/test/virtualRef.integration.spec.ts @@ -1,11 +1,12 @@ import {Controller, Get, Inject, PlatformTest} from "@tsed/common"; import {getValue} from "@tsed/core"; import {serialize} from "@tsed/json-mapper"; -import {Model, MongooseModel, ObjectID, VirtualRef} from "@tsed/mongoose"; import {PlatformExpress} from "@tsed/platform-express"; import {CollectionOf, getJsonSchema, Groups, Integer, Required} from "@tsed/schema"; import {TestContainersMongo} from "@tsed/testcontainers-mongo"; import SuperTest from "supertest"; + +import {Model, MongooseModel, ObjectID, VirtualRef} from ".."; import {Server} from "./helpers/Server.js"; @Model() diff --git a/packages/orm/mongoose/tsconfig.esm.json b/packages/orm/mongoose/tsconfig.esm.json index e3b07081667..82292550ddb 100644 --- a/packages/orm/mongoose/tsconfig.esm.json +++ b/packages/orm/mongoose/tsconfig.esm.json @@ -2,8 +2,7 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "module": "ESNext", - "moduleResolution": "nodenext", + "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", @@ -11,7 +10,7 @@ "composite": true, "noEmit": false }, - "include": ["src", "src/**/*.json"], + "include": ["src/**/*.ts", "src/**/*.json"], "exclude": [ "node_modules", "test", diff --git a/packages/orm/mongoose/tsconfig.spec.json b/packages/orm/mongoose/tsconfig.spec.json index 21485bab96d..2e917f4b39d 100644 --- a/packages/orm/mongoose/tsconfig.spec.json +++ b/packages/orm/mongoose/tsconfig.spec.json @@ -3,7 +3,6 @@ "compilerOptions": { "baseUrl": ".", "rootDir": "../..", - "module": "commonjs", "outDir": "./lib/cjs", "declaration": false, "composite": false, diff --git a/packages/orm/objection/package.json b/packages/orm/objection/package.json index e6656f8b01d..754188e3edb 100644 --- a/packages/orm/objection/package.json +++ b/packages/orm/objection/package.json @@ -36,7 +36,7 @@ "knex": "^3.1.0", "objection": "^2.2.18", "sqlite3": "^5.1.7", - "typescript": "4.9.5", + "typescript": "5.6.2", "vitest": "2.0.4" }, "peerDependencies": { diff --git a/packages/orm/objection/src/components/createBooleanColumn.spec.ts b/packages/orm/objection/src/components/createBooleanColumn.spec.ts index 7ba1dd79d5b..677daefac59 100644 --- a/packages/orm/objection/src/components/createBooleanColumn.spec.ts +++ b/packages/orm/objection/src/components/createBooleanColumn.spec.ts @@ -1,4 +1,5 @@ import {Property} from "@tsed/schema"; + import {createTableStub} from "../../test/helpers/knex/table.js"; import {Entity} from "../decorators/entity.js"; import {createColumns} from "../utils/createColumns.js"; diff --git a/packages/orm/objection/src/components/createBooleanColumn.ts b/packages/orm/objection/src/components/createBooleanColumn.ts index a24ceafb784..c0c413fb61d 100644 --- a/packages/orm/objection/src/components/createBooleanColumn.ts +++ b/packages/orm/objection/src/components/createBooleanColumn.ts @@ -1,4 +1,5 @@ import type {Knex} from "knex"; + import {ColumnTypesContainer} from "../services/ColumnTypesContainer.js"; import {ColumnCtx} from "../utils/getColumnCtx.js"; /** diff --git a/packages/orm/objection/src/components/createIdColumn.spec.ts b/packages/orm/objection/src/components/createIdColumn.spec.ts index 1c2d62100f0..d058cb2a08d 100644 --- a/packages/orm/objection/src/components/createIdColumn.spec.ts +++ b/packages/orm/objection/src/components/createIdColumn.spec.ts @@ -1,7 +1,7 @@ +import {createTableStub} from "../../test/helpers/knex/table.js"; import {Entity} from "../decorators/entity.js"; import {IdColumn} from "../decorators/idColumn.js"; import {createColumns} from "../utils/createColumns.js"; -import {createTableStub} from "../../test/helpers/knex/table.js"; describe("createIdColumn", () => { it("should create table from a given class (bigIncrements)", () => { diff --git a/packages/orm/objection/src/components/createIdColumn.ts b/packages/orm/objection/src/components/createIdColumn.ts index b6d91f37b4f..58a14c0956d 100644 --- a/packages/orm/objection/src/components/createIdColumn.ts +++ b/packages/orm/objection/src/components/createIdColumn.ts @@ -1,7 +1,8 @@ -import {ColumnCtx} from "../utils/getColumnCtx.js"; -import {ColumnTypesContainer} from "../services/ColumnTypesContainer.js"; -import type {Knex} from "knex"; import {randomUUID} from "crypto"; +import type {Knex} from "knex"; + +import {ColumnTypesContainer} from "../services/ColumnTypesContainer.js"; +import {ColumnCtx} from "../utils/getColumnCtx.js"; /** * @ignore diff --git a/packages/orm/objection/src/components/createNumberColumn.spec.ts b/packages/orm/objection/src/components/createNumberColumn.spec.ts index 9d555a0b614..991a6735de8 100644 --- a/packages/orm/objection/src/components/createNumberColumn.spec.ts +++ b/packages/orm/objection/src/components/createNumberColumn.spec.ts @@ -1,4 +1,5 @@ import {Property} from "@tsed/schema"; + import {createTableStub} from "../../test/helpers/knex/table.js"; import {Decimal} from "../decorators/decimal.js"; import {Entity} from "../decorators/entity.js"; diff --git a/packages/orm/objection/src/components/createNumberColumn.ts b/packages/orm/objection/src/components/createNumberColumn.ts index 2e61294dda0..1d6b535b046 100644 --- a/packages/orm/objection/src/components/createNumberColumn.ts +++ b/packages/orm/objection/src/components/createNumberColumn.ts @@ -1,4 +1,5 @@ import type {Knex} from "knex"; + import {ColumnTypesContainer} from "../services/ColumnTypesContainer.js"; import {ColumnCtx} from "../utils/getColumnCtx.js"; diff --git a/packages/orm/objection/src/components/createStringColumn.spec.ts b/packages/orm/objection/src/components/createStringColumn.spec.ts index a3e9d974c7a..90b0540ee9b 100644 --- a/packages/orm/objection/src/components/createStringColumn.spec.ts +++ b/packages/orm/objection/src/components/createStringColumn.spec.ts @@ -1,4 +1,5 @@ import {MaxLength, Property} from "@tsed/schema"; + import {createTableStub} from "../../test/helpers/knex/table.js"; import {Entity} from "../decorators/entity.js"; import {createColumns} from "../utils/createColumns.js"; diff --git a/packages/orm/objection/src/components/createStringColumn.ts b/packages/orm/objection/src/components/createStringColumn.ts index a160b1a8738..19726bc4135 100644 --- a/packages/orm/objection/src/components/createStringColumn.ts +++ b/packages/orm/objection/src/components/createStringColumn.ts @@ -1,4 +1,5 @@ import type {Knex} from "knex"; + import {ColumnTypesContainer} from "../services/ColumnTypesContainer.js"; import {ColumnCtx} from "../utils/getColumnCtx.js"; diff --git a/packages/orm/objection/src/decorators/belongsToOne.spec.ts b/packages/orm/objection/src/decorators/belongsToOne.spec.ts index 93cf4f47be0..95f539a7561 100644 --- a/packages/orm/objection/src/decorators/belongsToOne.spec.ts +++ b/packages/orm/objection/src/decorators/belongsToOne.spec.ts @@ -1,4 +1,5 @@ import {Model} from "objection"; + import {BelongsToOne} from "./belongsToOne.js"; import {Entity} from "./entity.js"; import {IdColumn} from "./idColumn.js"; diff --git a/packages/orm/objection/src/decorators/belongsToOne.ts b/packages/orm/objection/src/decorators/belongsToOne.ts index c7ebe822aa9..6bad782bc87 100644 --- a/packages/orm/objection/src/decorators/belongsToOne.ts +++ b/packages/orm/objection/src/decorators/belongsToOne.ts @@ -1,6 +1,7 @@ import {Model} from "objection"; -import {RelatesTo} from "./relatesTo.js"; + import {RelationshipOptsWithoutThrough} from "../domain/RelationshipOpts.js"; +import {RelatesTo} from "./relatesTo.js"; /** * diff --git a/packages/orm/objection/src/decorators/columnOptions.ts b/packages/orm/objection/src/decorators/columnOptions.ts index 0f8c67bab2b..1105e77fbda 100644 --- a/packages/orm/objection/src/decorators/columnOptions.ts +++ b/packages/orm/objection/src/decorators/columnOptions.ts @@ -1,4 +1,5 @@ import {StoreSet} from "@tsed/core"; + import type {ColumnOpts} from "../domain/ColumnOpts.js"; /** diff --git a/packages/orm/objection/src/decorators/decimal.spec.ts b/packages/orm/objection/src/decorators/decimal.spec.ts index 5b05828b35c..7559385be47 100644 --- a/packages/orm/objection/src/decorators/decimal.spec.ts +++ b/packages/orm/objection/src/decorators/decimal.spec.ts @@ -1,5 +1,6 @@ import {Store} from "@tsed/core"; import {getJsonSchema} from "@tsed/schema"; + import {Decimal} from "./decimal.js"; describe("@Decimal", () => { diff --git a/packages/orm/objection/src/decorators/decimal.ts b/packages/orm/objection/src/decorators/decimal.ts index c9c35f29519..ef56635d591 100644 --- a/packages/orm/objection/src/decorators/decimal.ts +++ b/packages/orm/objection/src/decorators/decimal.ts @@ -1,5 +1,6 @@ import {StoreSet, useDecorators} from "@tsed/core"; import {Property} from "@tsed/schema"; + import {ColumnOptions} from "./columnOptions.js"; export interface DecimalOptions { diff --git a/packages/orm/objection/src/decorators/entity.ts b/packages/orm/objection/src/decorators/entity.ts index de0a0515e51..42627bdf358 100644 --- a/packages/orm/objection/src/decorators/entity.ts +++ b/packages/orm/objection/src/decorators/entity.ts @@ -1,7 +1,8 @@ import {Type} from "@tsed/core"; +import {getJsonSchema} from "@tsed/schema"; + import {defineStaticGetter} from "../utils/defineStaticGetter.js"; import {getJsonEntityRelationships} from "../utils/getJsonEntityRelationships.js"; -import {getJsonSchema} from "@tsed/schema"; /** * diff --git a/packages/orm/objection/src/decorators/hasMany.spec.ts b/packages/orm/objection/src/decorators/hasMany.spec.ts index 4ef0129cb03..640d44f3871 100644 --- a/packages/orm/objection/src/decorators/hasMany.spec.ts +++ b/packages/orm/objection/src/decorators/hasMany.spec.ts @@ -1,4 +1,5 @@ import {Model} from "objection"; + import {Entity} from "./entity.js"; import {HasMany} from "./hasMany.js"; import {IdColumn} from "./idColumn.js"; diff --git a/packages/orm/objection/src/decorators/hasMany.ts b/packages/orm/objection/src/decorators/hasMany.ts index 4f6e6dd1a7e..6425b56eabf 100644 --- a/packages/orm/objection/src/decorators/hasMany.ts +++ b/packages/orm/objection/src/decorators/hasMany.ts @@ -1,7 +1,7 @@ import {Model, ModelClassSpecifier} from "objection"; -import {RelatesTo} from "./relatesTo.js"; import {RelationshipOptsWithThrough} from "../domain/RelationshipOpts.js"; +import {RelatesTo} from "./relatesTo.js"; /** * diff --git a/packages/orm/objection/src/decorators/hasOne.spec.ts b/packages/orm/objection/src/decorators/hasOne.spec.ts index 3200eeb0e3c..be1f25899cf 100644 --- a/packages/orm/objection/src/decorators/hasOne.spec.ts +++ b/packages/orm/objection/src/decorators/hasOne.spec.ts @@ -1,4 +1,5 @@ import {Model} from "objection"; + import {Entity} from "./entity.js"; import {HasOne} from "./hasOne.js"; import {IdColumn} from "./idColumn.js"; diff --git a/packages/orm/objection/src/decorators/hasOne.ts b/packages/orm/objection/src/decorators/hasOne.ts index 0a47c768ef0..1c7283f720c 100644 --- a/packages/orm/objection/src/decorators/hasOne.ts +++ b/packages/orm/objection/src/decorators/hasOne.ts @@ -1,6 +1,7 @@ import {Model} from "objection"; -import {RelatesTo} from "./relatesTo.js"; + import {RelationshipOptsWithoutThrough} from "../domain/RelationshipOpts.js"; +import {RelatesTo} from "./relatesTo.js"; /** * diff --git a/packages/orm/objection/src/decorators/hasOneThroughRelation.spec.ts b/packages/orm/objection/src/decorators/hasOneThroughRelation.spec.ts index 5d741114a64..60d1136e37f 100644 --- a/packages/orm/objection/src/decorators/hasOneThroughRelation.spec.ts +++ b/packages/orm/objection/src/decorators/hasOneThroughRelation.spec.ts @@ -1,4 +1,5 @@ import {Model} from "objection"; + import {Entity} from "./entity.js"; import {HasOneThroughRelation} from "./hasOneThroughRelation.js"; import {IdColumn} from "./idColumn.js"; diff --git a/packages/orm/objection/src/decorators/hasOneThroughRelation.ts b/packages/orm/objection/src/decorators/hasOneThroughRelation.ts index 6f111e9ff26..399464f987b 100644 --- a/packages/orm/objection/src/decorators/hasOneThroughRelation.ts +++ b/packages/orm/objection/src/decorators/hasOneThroughRelation.ts @@ -1,6 +1,6 @@ -import {RelationshipOptsWithThrough, RelationshipOptsWithoutThrough} from "../domain/RelationshipOpts.js"; - import {Model} from "objection"; + +import {RelationshipOptsWithoutThrough, RelationshipOptsWithThrough} from "../domain/RelationshipOpts.js"; import {RelatesTo} from "./relatesTo.js"; /** diff --git a/packages/orm/objection/src/decorators/idColumn.spec.ts b/packages/orm/objection/src/decorators/idColumn.spec.ts index 84991a45daf..cb2ead9de32 100644 --- a/packages/orm/objection/src/decorators/idColumn.spec.ts +++ b/packages/orm/objection/src/decorators/idColumn.spec.ts @@ -1,6 +1,7 @@ import {Store} from "@tsed/core"; import {getJsonSchema} from "@tsed/schema"; import {Model} from "objection"; + import {IdColumn} from "./idColumn.js"; describe("@IdColumn", () => { diff --git a/packages/orm/objection/src/decorators/idColumn.ts b/packages/orm/objection/src/decorators/idColumn.ts index 045dca0ceac..6d4663bf9e0 100644 --- a/packages/orm/objection/src/decorators/idColumn.ts +++ b/packages/orm/objection/src/decorators/idColumn.ts @@ -1,7 +1,8 @@ -import {ColumnOptions} from "./columnOptions.js"; +import {useDecorators} from "@tsed/core"; import {Property} from "@tsed/schema"; + import {defineStaticGetter} from "../utils/defineStaticGetter.js"; -import {useDecorators} from "@tsed/core"; +import {ColumnOptions} from "./columnOptions.js"; /** * diff --git a/packages/orm/objection/src/decorators/manyToMany.spec.ts b/packages/orm/objection/src/decorators/manyToMany.spec.ts index 3cc6ed4ad6e..bc448759882 100644 --- a/packages/orm/objection/src/decorators/manyToMany.spec.ts +++ b/packages/orm/objection/src/decorators/manyToMany.spec.ts @@ -1,4 +1,5 @@ import {Model} from "objection"; + import {Entity} from "./entity.js"; import {IdColumn} from "./idColumn.js"; import {ManyToMany} from "./manyToMany.js"; diff --git a/packages/orm/objection/src/decorators/manyToMany.ts b/packages/orm/objection/src/decorators/manyToMany.ts index 964bffb0432..ad8dc62011f 100644 --- a/packages/orm/objection/src/decorators/manyToMany.ts +++ b/packages/orm/objection/src/decorators/manyToMany.ts @@ -1,7 +1,7 @@ import {Model, ModelClassSpecifier} from "objection"; -import {RelatesTo} from "./relatesTo.js"; import {RelationshipOptsWithThrough} from "../domain/RelationshipOpts.js"; +import {RelatesTo} from "./relatesTo.js"; /** * diff --git a/packages/orm/objection/src/decorators/relatesTo.spec.ts b/packages/orm/objection/src/decorators/relatesTo.spec.ts index 33d65caa6e0..9c9d8646769 100644 --- a/packages/orm/objection/src/decorators/relatesTo.spec.ts +++ b/packages/orm/objection/src/decorators/relatesTo.spec.ts @@ -1,4 +1,5 @@ import {Model} from "objection"; + import {Entity} from "./entity.js"; import {IdColumn} from "./idColumn.js"; import {RelatesTo} from "./relatesTo.js"; diff --git a/packages/orm/objection/src/decorators/relatesTo.ts b/packages/orm/objection/src/decorators/relatesTo.ts index 20237c0ae23..677beebd83b 100644 --- a/packages/orm/objection/src/decorators/relatesTo.ts +++ b/packages/orm/objection/src/decorators/relatesTo.ts @@ -1,10 +1,10 @@ -import {CollectionOf, Property} from "@tsed/schema"; -import {RelationshipOpts, isModelClassFactory} from "../domain/RelationshipOpts.js"; import {StoreFn, useDecorators} from "@tsed/core"; - -import {OBJECTION_RELATIONSHIP_KEY} from "../utils/getJsonEntityRelationships.js"; +import {CollectionOf, Property} from "@tsed/schema"; import {RelationType} from "objection"; + +import {isModelClassFactory, RelationshipOpts} from "../domain/RelationshipOpts.js"; import {createRelationshipMapping} from "../utils/createRelationshipMapping.js"; +import {OBJECTION_RELATIONSHIP_KEY} from "../utils/getJsonEntityRelationships.js"; /** * diff --git a/packages/orm/objection/src/services/ColumnTypesContainer.ts b/packages/orm/objection/src/services/ColumnTypesContainer.ts index 971fe987803..93c05d44a98 100644 --- a/packages/orm/objection/src/services/ColumnTypesContainer.ts +++ b/packages/orm/objection/src/services/ColumnTypesContainer.ts @@ -1,4 +1,5 @@ import type {Knex} from "knex"; + import {ColumnCtx} from "../utils/getColumnCtx.js"; /** diff --git a/packages/orm/objection/src/services/ObjectionConnection.ts b/packages/orm/objection/src/services/ObjectionConnection.ts index 1f69b7946b4..53328d005cc 100644 --- a/packages/orm/objection/src/services/ObjectionConnection.ts +++ b/packages/orm/objection/src/services/ObjectionConnection.ts @@ -1,5 +1,6 @@ import {Configuration, registerProvider} from "@tsed/di"; import type {Knex} from "knex"; + import {createConnection} from "../utils/connect.js"; export const OBJECTION_CONNECTION = Symbol.for("DEFAULT_CONNECTION"); diff --git a/packages/orm/objection/src/utils/createColumns.spec.ts b/packages/orm/objection/src/utils/createColumns.spec.ts index df2078aef78..449b7eb83a0 100644 --- a/packages/orm/objection/src/utils/createColumns.spec.ts +++ b/packages/orm/objection/src/utils/createColumns.spec.ts @@ -1,5 +1,6 @@ import {catchError} from "@tsed/core"; import {MaxLength, Property} from "@tsed/schema"; + import {createTableStub} from "../../test/helpers/knex/table.js"; import {Decimal} from "../decorators/decimal.js"; import {Entity} from "../decorators/entity.js"; diff --git a/packages/orm/objection/src/utils/createColumns.ts b/packages/orm/objection/src/utils/createColumns.ts index f3a5477da9d..1a51990f5ca 100644 --- a/packages/orm/objection/src/utils/createColumns.ts +++ b/packages/orm/objection/src/utils/createColumns.ts @@ -1,9 +1,11 @@ -import {getProperties, JsonEntityStore} from "@tsed/schema"; -import {Knex} from "knex"; import "../components/createBooleanColumn.js"; import "../components/createIdColumn.js"; import "../components/createNumberColumn.js"; import "../components/createStringColumn.js"; + +import {getProperties, JsonEntityStore} from "@tsed/schema"; +import {Knex} from "knex"; + import {ColumnTypesContainer} from "../services/ColumnTypesContainer.js"; import {getColumnCtx} from "./getColumnCtx.js"; diff --git a/packages/orm/objection/src/utils/createJoinKeys.ts b/packages/orm/objection/src/utils/createJoinKeys.ts index 204c150a5ba..04a4c2b0d97 100644 --- a/packages/orm/objection/src/utils/createJoinKeys.ts +++ b/packages/orm/objection/src/utils/createJoinKeys.ts @@ -1,7 +1,7 @@ +import {Metadata} from "@tsed/core"; import {Model, RelationType} from "objection"; -import {RelationshipOpts, isRelationshipOptsWithThrough} from "../domain/RelationshipOpts.js"; -import {Metadata} from "@tsed/core"; +import {isRelationshipOptsWithThrough, RelationshipOpts} from "../domain/RelationshipOpts.js"; /** * @ignore diff --git a/packages/orm/objection/src/utils/createRelationshipMapping.ts b/packages/orm/objection/src/utils/createRelationshipMapping.ts index 74fe1c395ee..09e0d9da3c5 100644 --- a/packages/orm/objection/src/utils/createRelationshipMapping.ts +++ b/packages/orm/objection/src/utils/createRelationshipMapping.ts @@ -1,6 +1,6 @@ -import {DecoratorParameters, Metadata, getClass} from "@tsed/core"; - +import {DecoratorParameters, getClass, Metadata} from "@tsed/core"; import {RelationType} from "objection"; + import {RelationshipOpts} from "../domain/RelationshipOpts.js"; import {createJoinKeys} from "./createJoinKeys.js"; diff --git a/packages/orm/objection/src/utils/getColumnCtx.ts b/packages/orm/objection/src/utils/getColumnCtx.ts index a3cdadc604c..186fa266eac 100644 --- a/packages/orm/objection/src/utils/getColumnCtx.ts +++ b/packages/orm/objection/src/utils/getColumnCtx.ts @@ -1,4 +1,5 @@ import {JsonEntityStore} from "@tsed/schema"; + import {ColumnOpts} from "../domain/ColumnOpts.js"; /** diff --git a/packages/orm/objection/test/helpers/Server.ts b/packages/orm/objection/test/helpers/Server.ts index 3cb8c0749e1..bcb391b9741 100644 --- a/packages/orm/objection/test/helpers/Server.ts +++ b/packages/orm/objection/test/helpers/Server.ts @@ -1,9 +1,9 @@ -import {Configuration, Inject, PlatformApplication} from "@tsed/common"; -import "@tsed/objection"; +import "../.."; import "@tsed/platform-express"; + +import {Configuration, Inject, PlatformApplication} from "@tsed/common"; import bodyParser from "body-parser"; import compress from "compression"; - import cookieParser from "cookie-parser"; import methodOverride from "method-override"; diff --git a/packages/orm/objection/test/helpers/migrations/01_users.ts b/packages/orm/objection/test/helpers/migrations/01_users.ts index 5640a426885..ea0538c6d52 100644 --- a/packages/orm/objection/test/helpers/migrations/01_users.ts +++ b/packages/orm/objection/test/helpers/migrations/01_users.ts @@ -1,4 +1,5 @@ import type {Knex} from "knex"; + import {createColumns} from "../../../src/index.js"; import {User} from "../models/User.js"; diff --git a/packages/orm/objection/test/helpers/models/User.ts b/packages/orm/objection/test/helpers/models/User.ts index 496f542c9e1..eb7f6745a89 100644 --- a/packages/orm/objection/test/helpers/models/User.ts +++ b/packages/orm/objection/test/helpers/models/User.ts @@ -1,6 +1,7 @@ -import {Entity} from "@tsed/objection"; import {Groups, MaxLength, MinLength, Required} from "@tsed/schema"; import {Model} from "objection"; + +import {Entity} from "../../.."; import {IdColumn} from "../../../src/index.js"; @Entity("users") diff --git a/packages/orm/objection/test/integration.spec.ts b/packages/orm/objection/test/integration.spec.ts index be94c10fde2..839cda61130 100644 --- a/packages/orm/objection/test/integration.spec.ts +++ b/packages/orm/objection/test/integration.spec.ts @@ -1,9 +1,10 @@ import {PlatformTest} from "@tsed/common"; import {serialize} from "@tsed/json-mapper"; -import {OBJECTION_CONNECTION} from "@tsed/objection"; import {Knex} from "knex"; +import {afterAll, beforeAll, beforeEach, describe, expect, it} from "vitest"; + +import {OBJECTION_CONNECTION} from ".."; import {User} from "./helpers/models/User.js"; -import {describe, beforeAll, beforeEach, it, afterAll, expect} from "vitest"; const rootDir = import.meta.dirname; diff --git a/packages/orm/objection/tsconfig.esm.json b/packages/orm/objection/tsconfig.esm.json index e3b07081667..82292550ddb 100644 --- a/packages/orm/objection/tsconfig.esm.json +++ b/packages/orm/objection/tsconfig.esm.json @@ -2,8 +2,7 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "module": "ESNext", - "moduleResolution": "nodenext", + "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", @@ -11,7 +10,7 @@ "composite": true, "noEmit": false }, - "include": ["src", "src/**/*.json"], + "include": ["src/**/*.ts", "src/**/*.json"], "exclude": [ "node_modules", "test", diff --git a/packages/orm/objection/tsconfig.spec.json b/packages/orm/objection/tsconfig.spec.json index 21485bab96d..2e917f4b39d 100644 --- a/packages/orm/objection/tsconfig.spec.json +++ b/packages/orm/objection/tsconfig.spec.json @@ -3,7 +3,6 @@ "compilerOptions": { "baseUrl": ".", "rootDir": "../..", - "module": "commonjs", "outDir": "./lib/cjs", "declaration": false, "composite": false, diff --git a/packages/orm/prisma/package.json b/packages/orm/prisma/package.json index 4b89849c86f..208887769a8 100644 --- a/packages/orm/prisma/package.json +++ b/packages/orm/prisma/package.json @@ -51,7 +51,7 @@ "@types/pluralize": "0.0.33", "eslint": "^8.57.0", "prisma": "^4.16.2", - "typescript": "4.9.5", + "typescript": "5.6.2", "vitest": "2.0.4" }, "peerDependencies": { diff --git a/packages/orm/prisma/src/cli/prismaGenerator.ts b/packages/orm/prisma/src/cli/prismaGenerator.ts index a7d3f8381be..adc0bbc79df 100644 --- a/packages/orm/prisma/src/cli/prismaGenerator.ts +++ b/packages/orm/prisma/src/cli/prismaGenerator.ts @@ -2,6 +2,7 @@ import {GeneratorOptions} from "@prisma/generator-helper"; import {parseEnvValue} 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 a9ee8628c77..18c83ab5bd7 100644 --- a/packages/orm/prisma/src/generator.ts +++ b/packages/orm/prisma/src/generator.ts @@ -1,6 +1,7 @@ #!/usr/bin/env ts-node import {generatorHandler} from "@prisma/generator-helper"; import {join} from "path"; + import {generate} from "./cli/prismaGenerator.js"; const rootDir = import.meta.dirname; diff --git a/packages/orm/prisma/src/generator/domain/DmmfField.ts b/packages/orm/prisma/src/generator/domain/DmmfField.ts index 9f4084ae9e1..570064c87f9 100644 --- a/packages/orm/prisma/src/generator/domain/DmmfField.ts +++ b/packages/orm/prisma/src/generator/domain/DmmfField.ts @@ -1,4 +1,5 @@ import {DMMF} from "@prisma/generator-helper"; + import {parseDocumentationAttributes} from "../utils/parseDocumentationAttributes.js"; import type {DmmfModel} from "./DmmfModel.js"; diff --git a/packages/orm/prisma/src/generator/domain/DmmfModel.ts b/packages/orm/prisma/src/generator/domain/DmmfModel.ts index caac7e2ca75..7c133789336 100644 --- a/packages/orm/prisma/src/generator/domain/DmmfModel.ts +++ b/packages/orm/prisma/src/generator/domain/DmmfModel.ts @@ -2,6 +2,7 @@ import {DMMF} from "@prisma/generator-helper"; import {toMap} from "@tsed/core"; import {pascalCase} from "change-case"; import {ImportDeclarationStructure, StructureKind} from "ts-morph"; + import {resolveExtension} from "../utils/resolveExtension.js"; import {DmmfField} from "./DmmfField.js"; diff --git a/packages/orm/prisma/src/generator/generateCode.spec.ts b/packages/orm/prisma/src/generator/generateCode.spec.ts index 526195dc19b..ed2f1f74541 100644 --- a/packages/orm/prisma/src/generator/generateCode.spec.ts +++ b/packages/orm/prisma/src/generator/generateCode.spec.ts @@ -1,6 +1,6 @@ -import {generateCode} from "./generateCode.js"; -import {createProjectFixture} from "../__mock__/createProjectFixture.js"; import {createDmmfFixture} from "../__mock__/createDmmfFixture.js"; +import {createProjectFixture} from "../__mock__/createProjectFixture.js"; +import {generateCode} from "./generateCode.js"; describe("generateCode", () => { it("should generate all codes", async () => { diff --git a/packages/orm/prisma/src/generator/generateCode.ts b/packages/orm/prisma/src/generator/generateCode.ts index c5e51122795..b6d68571afe 100644 --- a/packages/orm/prisma/src/generator/generateCode.ts +++ b/packages/orm/prisma/src/generator/generateCode.ts @@ -1,5 +1,6 @@ import {DMMF} from "@prisma/generator-helper"; import {CompilerOptions, ModuleKind, Project, ScriptTarget} from "ts-morph"; + import {generateClientIndex} from "./utils/generateClientIndex.js"; import {generateEnums} from "./utils/generateEnums.js"; import {generateIndex} from "./utils/generateIndex.js"; diff --git a/packages/orm/prisma/src/generator/transform/transformEnumsToEnums.spec.ts b/packages/orm/prisma/src/generator/transform/transformEnumsToEnums.spec.ts index b012e2cb99b..70e936e780d 100644 --- a/packages/orm/prisma/src/generator/transform/transformEnumsToEnums.spec.ts +++ b/packages/orm/prisma/src/generator/transform/transformEnumsToEnums.spec.ts @@ -1,5 +1,5 @@ -import {transformEnumsToEnums} from "./transformEnumsToEnums.js"; import {DmmfEnum} from "../domain/DmmfEnum.js"; +import {transformEnumsToEnums} from "./transformEnumsToEnums.js"; describe("transformEnumsToEnums()", () => { it("should transform Prisma Enum to a TS Enum", () => { diff --git a/packages/orm/prisma/src/generator/transform/transformEnumsToEnums.ts b/packages/orm/prisma/src/generator/transform/transformEnumsToEnums.ts index e23eae40bb4..4ff82ff2130 100644 --- a/packages/orm/prisma/src/generator/transform/transformEnumsToEnums.ts +++ b/packages/orm/prisma/src/generator/transform/transformEnumsToEnums.ts @@ -1,4 +1,5 @@ import {EnumMemberStructure, OptionalKind, StatementStructures, StructureKind} from "ts-morph"; + import {DmmfEnum} from "../domain/DmmfEnum.js"; export function transformEnumsToEnums(enumModel: DmmfEnum): StatementStructures { diff --git a/packages/orm/prisma/src/generator/transform/transformFieldToDecorators.spec.ts b/packages/orm/prisma/src/generator/transform/transformFieldToDecorators.spec.ts index ee59a4ad720..377d9909946 100644 --- a/packages/orm/prisma/src/generator/transform/transformFieldToDecorators.spec.ts +++ b/packages/orm/prisma/src/generator/transform/transformFieldToDecorators.spec.ts @@ -1,6 +1,6 @@ +import {createContextFixture} from "../../__mock__/createContextFixture.js"; import {createDmmfFieldFixture} from "../../__mock__/createDmmfFieldFixture.js"; import {PrismaScalars} from "../domain/ScalarTsTypes.js"; -import {createContextFixture} from "../../__mock__/createContextFixture.js"; import {transformFieldToDecorators} from "./transformFieldToDecorators.js"; describe("transformFieldToDecorators()", () => { diff --git a/packages/orm/prisma/src/generator/transform/transformFieldToDecorators.ts b/packages/orm/prisma/src/generator/transform/transformFieldToDecorators.ts index 34c0315b415..77007a9c4c7 100644 --- a/packages/orm/prisma/src/generator/transform/transformFieldToDecorators.ts +++ b/packages/orm/prisma/src/generator/transform/transformFieldToDecorators.ts @@ -1,4 +1,5 @@ import {DecoratorStructure, StructureKind} from "ts-morph"; + import {DmmfField} from "../domain/DmmfField.js"; import {DmmfModel} from "../domain/DmmfModel.js"; import {ScalarDecorators, ScalarJsClasses} from "../domain/ScalarTsTypes.js"; diff --git a/packages/orm/prisma/src/generator/transform/transformFieldToProperty.ts b/packages/orm/prisma/src/generator/transform/transformFieldToProperty.ts index c8716638082..4de75faac9f 100644 --- a/packages/orm/prisma/src/generator/transform/transformFieldToProperty.ts +++ b/packages/orm/prisma/src/generator/transform/transformFieldToProperty.ts @@ -1,4 +1,5 @@ import {PropertyDeclarationStructure, StructureKind} from "ts-morph"; + import {DmmfField} from "../domain/DmmfField.js"; import {TransformContext} from "../domain/TransformContext.js"; import {transformFieldToDecorators} from "./transformFieldToDecorators.js"; diff --git a/packages/orm/prisma/src/generator/transform/transformModelToClass.spec.ts b/packages/orm/prisma/src/generator/transform/transformModelToClass.spec.ts index 92f1f0f270d..e3955283119 100644 --- a/packages/orm/prisma/src/generator/transform/transformModelToClass.spec.ts +++ b/packages/orm/prisma/src/generator/transform/transformModelToClass.spec.ts @@ -1,7 +1,7 @@ -import {transformModelToClass} from "./transformModelToClass.js"; -import {DmmfModel} from "../domain/DmmfModel.js"; import {createContextFixture} from "../../__mock__/createContextFixture.js"; import {createDmmfModelFixture} from "../../__mock__/createDmmfModelFixture.js"; +import {DmmfModel} from "../domain/DmmfModel.js"; +import {transformModelToClass} from "./transformModelToClass.js"; describe("transformModelToClass()", () => { it("should transform Prisma model to a TS Model (InputType)", () => { diff --git a/packages/orm/prisma/src/generator/transform/transformModelToClass.ts b/packages/orm/prisma/src/generator/transform/transformModelToClass.ts index dc74f00eab1..d17ba2f008d 100644 --- a/packages/orm/prisma/src/generator/transform/transformModelToClass.ts +++ b/packages/orm/prisma/src/generator/transform/transformModelToClass.ts @@ -1,4 +1,5 @@ import {StatementStructures, StructureKind} from "ts-morph"; + import {DmmfModel} from "../domain/DmmfModel.js"; import {TransformContext} from "../domain/TransformContext.js"; import {transformFieldToProperty} from "./transformFieldToProperty.js"; diff --git a/packages/orm/prisma/src/generator/transform/transformScalarToType.spec.ts b/packages/orm/prisma/src/generator/transform/transformScalarToType.spec.ts index 46339b8b77c..860e5533743 100644 --- a/packages/orm/prisma/src/generator/transform/transformScalarToType.spec.ts +++ b/packages/orm/prisma/src/generator/transform/transformScalarToType.spec.ts @@ -1,7 +1,7 @@ import {createContextFixture} from "../../__mock__/createContextFixture.js"; -import {transformScalarToType} from "./transformScalarToType.js"; import {createDmmfFieldFixture} from "../../__mock__/createDmmfFieldFixture.js"; import {PrismaScalars} from "../domain/ScalarTsTypes.js"; +import {transformScalarToType} from "./transformScalarToType.js"; describe("transformScalarToType()", () => { it("should transform User to User (not null + circular ref)", () => { diff --git a/packages/orm/prisma/src/generator/transform/transformScalarToType.ts b/packages/orm/prisma/src/generator/transform/transformScalarToType.ts index 5bbfbf1a4d1..72ff6568cdd 100644 --- a/packages/orm/prisma/src/generator/transform/transformScalarToType.ts +++ b/packages/orm/prisma/src/generator/transform/transformScalarToType.ts @@ -1,7 +1,7 @@ +import {DmmfEnum} from "../domain/DmmfEnum.js"; import {DmmfField} from "../domain/DmmfField.js"; import {DmmfModel} from "../domain/DmmfModel.js"; import {ScalarTsTypes} from "../domain/ScalarTsTypes.js"; -import {DmmfEnum} from "../domain/DmmfEnum.js"; import type {TransformContext} from "../domain/TransformContext.js"; import {isCircularRef} from "../utils/isCircularRef.js"; diff --git a/packages/orm/prisma/src/generator/utils/generateClientIndex.ts b/packages/orm/prisma/src/generator/utils/generateClientIndex.ts index 6c4a9bb0a48..da32a21ca93 100644 --- a/packages/orm/prisma/src/generator/utils/generateClientIndex.ts +++ b/packages/orm/prisma/src/generator/utils/generateClientIndex.ts @@ -1,5 +1,6 @@ import path from "path"; import {Project} from "ts-morph"; + import {GenerateCodeOptions} from "../generateCode.js"; import {resolveExtension} from "./resolveExtension.js"; diff --git a/packages/orm/prisma/src/generator/utils/generateEnums.spec.ts b/packages/orm/prisma/src/generator/utils/generateEnums.spec.ts index 3445789fa0a..9b54c956d19 100644 --- a/packages/orm/prisma/src/generator/utils/generateEnums.spec.ts +++ b/packages/orm/prisma/src/generator/utils/generateEnums.spec.ts @@ -1,7 +1,7 @@ -import {createProjectFixture} from "../../__mock__/createProjectFixture.js"; -import {generateModels} from "./generateModels.js"; import {createDmmfFixture} from "../../__mock__/createDmmfFixture.js"; +import {createProjectFixture} from "../../__mock__/createProjectFixture.js"; import {generateEnums} from "./generateEnums.js"; +import {generateModels} from "./generateModels.js"; describe("generateEnums", () => { it("should generate filese", () => { diff --git a/packages/orm/prisma/src/generator/utils/generateEnums.ts b/packages/orm/prisma/src/generator/utils/generateEnums.ts index 85fb70e0790..47291d1127c 100644 --- a/packages/orm/prisma/src/generator/utils/generateEnums.ts +++ b/packages/orm/prisma/src/generator/utils/generateEnums.ts @@ -1,10 +1,11 @@ import {DMMF} from "@prisma/generator-helper"; -import {Project} from "ts-morph"; import {toMap} from "@tsed/core"; -import {DmmfEnum} from "../domain/DmmfEnum.js"; import path from "path"; -import {generateDocuments} from "./generateDocuments.js"; +import {Project} from "ts-morph"; + +import {DmmfEnum} from "../domain/DmmfEnum.js"; import {transformEnumsToEnums} from "../transform/transformEnumsToEnums.js"; +import {generateDocuments} from "./generateDocuments.js"; import {generateOutputsBarrelFile} from "./generateOutputsBarrelFile.js"; export function generateEnums(dmmf: DMMF.Document, project: Project, baseDirPath: string): boolean { diff --git a/packages/orm/prisma/src/generator/utils/generateIndex.ts b/packages/orm/prisma/src/generator/utils/generateIndex.ts index 0408c82f939..8e360e849df 100644 --- a/packages/orm/prisma/src/generator/utils/generateIndex.ts +++ b/packages/orm/prisma/src/generator/utils/generateIndex.ts @@ -1,5 +1,6 @@ -import {Project} from "ts-morph"; import path from "path"; +import {Project} from "ts-morph"; + import {resolveExtension} from "./resolveExtension.js"; export function generateIndex(project: Project, baseDirPath: string, hasEnum: boolean) { diff --git a/packages/orm/prisma/src/generator/utils/generateInterfaces.ts b/packages/orm/prisma/src/generator/utils/generateInterfaces.ts index 0e7bc94c3ff..59eed0413bf 100644 --- a/packages/orm/prisma/src/generator/utils/generateInterfaces.ts +++ b/packages/orm/prisma/src/generator/utils/generateInterfaces.ts @@ -1,5 +1,6 @@ -import {ModuleDeclarationKind, Project, StructureKind} from "ts-morph"; import path from "path"; +import {ModuleDeclarationKind, Project, StructureKind} from "ts-morph"; + import {resolveExtension} from "./resolveExtension.js"; export function generateInterfaces(project: Project, baseDirPath: string) { diff --git a/packages/orm/prisma/src/generator/utils/generateModels.spec.ts b/packages/orm/prisma/src/generator/utils/generateModels.spec.ts index eab820d75be..f250eadfbad 100644 --- a/packages/orm/prisma/src/generator/utils/generateModels.spec.ts +++ b/packages/orm/prisma/src/generator/utils/generateModels.spec.ts @@ -1,6 +1,6 @@ +import {createDmmfFixture, createDmmfWithTypesFixture} from "../../__mock__/createDmmfFixture.js"; import {createProjectFixture} from "../../__mock__/createProjectFixture.js"; import {generateModels} from "./generateModels.js"; -import {createDmmfFixture, createDmmfWithTypesFixture} from "../../__mock__/createDmmfFixture.js"; describe("generateModels", () => { it("should generate models (post)", () => { diff --git a/packages/orm/prisma/src/generator/utils/generateModels.ts b/packages/orm/prisma/src/generator/utils/generateModels.ts index 6154cb50d2e..a9fae05c00e 100644 --- a/packages/orm/prisma/src/generator/utils/generateModels.ts +++ b/packages/orm/prisma/src/generator/utils/generateModels.ts @@ -2,6 +2,7 @@ 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"; import {transformModelToClass} from "../transform/transformModelToClass.js"; import {generateDocuments} from "./generateDocuments.js"; diff --git a/packages/orm/prisma/src/generator/utils/generateOutputsBarrelFile.ts b/packages/orm/prisma/src/generator/utils/generateOutputsBarrelFile.ts index 8fba33c1b2c..31ae5c0fe4e 100644 --- a/packages/orm/prisma/src/generator/utils/generateOutputsBarrelFile.ts +++ b/packages/orm/prisma/src/generator/utils/generateOutputsBarrelFile.ts @@ -1,4 +1,5 @@ import {ExportDeclarationStructure, OptionalKind, SourceFile} from "ts-morph"; + import {resolveExtension} from "./resolveExtension.js"; export function generateOutputsBarrelFile(sourceFile: SourceFile, outputTypeNames: string[]) { diff --git a/packages/orm/prisma/src/generator/utils/generatePrismaService.spec.ts b/packages/orm/prisma/src/generator/utils/generatePrismaService.spec.ts index f565944a5b9..de7e24b8a1d 100644 --- a/packages/orm/prisma/src/generator/utils/generatePrismaService.spec.ts +++ b/packages/orm/prisma/src/generator/utils/generatePrismaService.spec.ts @@ -1,5 +1,5 @@ -import {generatePrismaService} from "./generatePrismaService.js"; import {createProjectFixture} from "../../__mock__/createProjectFixture.js"; +import {generatePrismaService} from "./generatePrismaService.js"; describe("generatePrismaService", () => { it("should generate prisma service", () => { diff --git a/packages/orm/prisma/src/generator/utils/generatePrismaService.ts b/packages/orm/prisma/src/generator/utils/generatePrismaService.ts index 90a70fdee2e..90897a164b4 100644 --- a/packages/orm/prisma/src/generator/utils/generatePrismaService.ts +++ b/packages/orm/prisma/src/generator/utils/generatePrismaService.ts @@ -1,5 +1,6 @@ -import {Project, Scope} from "ts-morph"; import path from "path"; +import {Project, Scope} from "ts-morph"; + import {resolveExtension} from "./resolveExtension.js"; export function generatePrismaService(project: Project, baseDirPath: string) { diff --git a/packages/orm/prisma/src/generator/utils/generateRepositories.ts b/packages/orm/prisma/src/generator/utils/generateRepositories.ts index 9489be35c90..6bd6808d825 100644 --- a/packages/orm/prisma/src/generator/utils/generateRepositories.ts +++ b/packages/orm/prisma/src/generator/utils/generateRepositories.ts @@ -4,6 +4,7 @@ import {camelCase, pascalCase} from "change-case"; import path from "path"; import pluralize from "pluralize"; import {ClassDeclaration, Project, Scope} from "ts-morph"; + import {DmmfModel} from "../domain/DmmfModel.js"; import {generateOutputsBarrelFile} from "./generateOutputsBarrelFile.js"; import {resolveExtension} from "./resolveExtension.js"; diff --git a/packages/orm/prisma/src/generator/utils/generateRespositories.spec.ts b/packages/orm/prisma/src/generator/utils/generateRespositories.spec.ts index 7a8262f35c1..08bcc0fd83a 100644 --- a/packages/orm/prisma/src/generator/utils/generateRespositories.spec.ts +++ b/packages/orm/prisma/src/generator/utils/generateRespositories.spec.ts @@ -1,5 +1,5 @@ -import {createProjectFixture} from "../../__mock__/createProjectFixture.js"; import {createDmmfFixture} from "../../__mock__/createDmmfFixture.js"; +import {createProjectFixture} from "../../__mock__/createProjectFixture.js"; import {generateRepositories} from "./generateRepositories.js"; describe("generateRepositories", () => { diff --git a/packages/orm/prisma/src/generator/utils/isCircularRef.spec.ts b/packages/orm/prisma/src/generator/utils/isCircularRef.spec.ts index 7b3b32136e5..7ccd0b4b8cf 100644 --- a/packages/orm/prisma/src/generator/utils/isCircularRef.spec.ts +++ b/packages/orm/prisma/src/generator/utils/isCircularRef.spec.ts @@ -1,5 +1,5 @@ -import {isCircularRef} from "./isCircularRef.js"; import {createContextFixture} from "../../__mock__/createContextFixture.js"; +import {isCircularRef} from "./isCircularRef.js"; const ctx = createContextFixture(); diff --git a/packages/orm/prisma/src/generator/utils/isCircularRef.ts b/packages/orm/prisma/src/generator/utils/isCircularRef.ts index 4723fcc4afa..46ed7096596 100644 --- a/packages/orm/prisma/src/generator/utils/isCircularRef.ts +++ b/packages/orm/prisma/src/generator/utils/isCircularRef.ts @@ -1,6 +1,7 @@ -import {TransformContext} from "../domain/TransformContext.js"; import {DMMF} from "@prisma/generator-helper"; +import {TransformContext} from "../domain/TransformContext.js"; + export function isCircularRef(modelName: string, fieldType: string, ctx: TransformContext): boolean { if (modelName === fieldType) { return true; diff --git a/packages/orm/prisma/test/snapshots/generate_code/enums/Role.ts b/packages/orm/prisma/test/snapshots/generate_code/enums/Role.ts index f1909355ca9..c2d99b87048 100644 --- a/packages/orm/prisma/test/snapshots/generate_code/enums/Role.ts +++ b/packages/orm/prisma/test/snapshots/generate_code/enums/Role.ts @@ -1,4 +1,3 @@ - export enum Role { USER = "USER", ADMIN = "ADMIN" diff --git a/packages/orm/prisma/test/snapshots/generate_code/index.ts b/packages/orm/prisma/test/snapshots/generate_code/index.ts index f695efffdbe..0fffaf3460c 100644 --- a/packages/orm/prisma/test/snapshots/generate_code/index.ts +++ b/packages/orm/prisma/test/snapshots/generate_code/index.ts @@ -1,5 +1,5 @@ -export * from "./interfaces/index.js"; export * from "./enums/index.js"; +export * from "./interfaces/index.js"; export * from "./models/index.js"; -export * from "./services/PrismaService.js"; export * from "./repositories/index.js"; +export * from "./services/PrismaService.js"; diff --git a/packages/orm/prisma/test/snapshots/generate_code/models/PostModel.ts b/packages/orm/prisma/test/snapshots/generate_code/models/PostModel.ts index 341cf20a5b7..415c06d8980 100644 --- a/packages/orm/prisma/test/snapshots/generate_code/models/PostModel.ts +++ b/packages/orm/prisma/test/snapshots/generate_code/models/PostModel.ts @@ -1,5 +1,6 @@ +import {Allow, Integer, Property, Required} from "@tsed/schema"; + import {Post} from "../client/index.js"; -import {Integer, Required, Property, Allow} from "@tsed/schema"; import {UserModel} from "./UserModel.js"; export class PostModel implements Post { diff --git a/packages/orm/prisma/test/snapshots/generate_code/models/UserModel.ts b/packages/orm/prisma/test/snapshots/generate_code/models/UserModel.ts index ed3cf760eca..2592fbdfb6b 100644 --- a/packages/orm/prisma/test/snapshots/generate_code/models/UserModel.ts +++ b/packages/orm/prisma/test/snapshots/generate_code/models/UserModel.ts @@ -1,5 +1,6 @@ +import {Allow, CollectionOf, Description, Email, Enum, Format, Groups, Integer, Property, Required} from "@tsed/schema"; + import {User} from "../client/index.js"; -import {Integer, Required, Property, Groups, Format, Email, Description, Allow, Enum, CollectionOf} from "@tsed/schema"; import {Role} from "../enums/index.js"; import {PostModel} from "./PostModel.js"; diff --git a/packages/orm/prisma/test/snapshots/generate_code/repositories/PostsRepository.ts b/packages/orm/prisma/test/snapshots/generate_code/repositories/PostsRepository.ts index 5a34f82341d..208942552d0 100644 --- a/packages/orm/prisma/test/snapshots/generate_code/repositories/PostsRepository.ts +++ b/packages/orm/prisma/test/snapshots/generate_code/repositories/PostsRepository.ts @@ -1,9 +1,10 @@ import {isArray} from "@tsed/core"; +import {Inject, Injectable} from "@tsed/di"; import {deserialize} from "@tsed/json-mapper"; -import {Injectable, Inject} from "@tsed/di"; -import {PrismaService} from "../services/PrismaService.js"; -import {Prisma, Post} from "../client/index.js"; + +import {Post, Prisma} from "../client/index.js"; import {PostModel} from "../models/index.js"; +import {PrismaService} from "../services/PrismaService.js"; @Injectable() export class PostsRepository { diff --git a/packages/orm/prisma/test/snapshots/generate_code/repositories/UsersRepository.ts b/packages/orm/prisma/test/snapshots/generate_code/repositories/UsersRepository.ts index beeac1a433e..9b062292267 100644 --- a/packages/orm/prisma/test/snapshots/generate_code/repositories/UsersRepository.ts +++ b/packages/orm/prisma/test/snapshots/generate_code/repositories/UsersRepository.ts @@ -1,9 +1,10 @@ import {isArray} from "@tsed/core"; +import {Inject, Injectable} from "@tsed/di"; import {deserialize} from "@tsed/json-mapper"; -import {Injectable, Inject} from "@tsed/di"; -import {PrismaService} from "../services/PrismaService.js"; + import {Prisma, User} from "../client/index.js"; import {UserModel} from "../models/index.js"; +import {PrismaService} from "../services/PrismaService.js"; @Injectable() export class UsersRepository { diff --git a/packages/orm/prisma/test/snapshots/generate_code/services/PrismaService.ts b/packages/orm/prisma/test/snapshots/generate_code/services/PrismaService.ts index 9bd9278ff11..a04cc4d0d58 100644 --- a/packages/orm/prisma/test/snapshots/generate_code/services/PrismaService.ts +++ b/packages/orm/prisma/test/snapshots/generate_code/services/PrismaService.ts @@ -1,5 +1,6 @@ -import {Inject, Injectable, Configuration, OnInit, OnDestroy} from "@tsed/di"; +import {Configuration, Inject, Injectable, OnDestroy, OnInit} from "@tsed/di"; import {Logger} from "@tsed/logger"; + import {PrismaClient} from "../client/index.js"; @Injectable() diff --git a/packages/orm/prisma/tsconfig.esm.json b/packages/orm/prisma/tsconfig.esm.json index e3b07081667..82292550ddb 100644 --- a/packages/orm/prisma/tsconfig.esm.json +++ b/packages/orm/prisma/tsconfig.esm.json @@ -2,8 +2,7 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "module": "ESNext", - "moduleResolution": "nodenext", + "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", @@ -11,7 +10,7 @@ "composite": true, "noEmit": false }, - "include": ["src", "src/**/*.json"], + "include": ["src/**/*.ts", "src/**/*.json"], "exclude": [ "node_modules", "test", diff --git a/packages/orm/prisma/tsconfig.spec.json b/packages/orm/prisma/tsconfig.spec.json index 21485bab96d..2e917f4b39d 100644 --- a/packages/orm/prisma/tsconfig.spec.json +++ b/packages/orm/prisma/tsconfig.spec.json @@ -3,7 +3,6 @@ "compilerOptions": { "baseUrl": ".", "rootDir": "../..", - "module": "commonjs", "outDir": "./lib/cjs", "declaration": false, "composite": false, diff --git a/packages/orm/testcontainers-mongo/package.json b/packages/orm/testcontainers-mongo/package.json index e8d166cefde..b3175bf83e1 100644 --- a/packages/orm/testcontainers-mongo/package.json +++ b/packages/orm/testcontainers-mongo/package.json @@ -37,7 +37,7 @@ "eslint": "^8.57.0", "mongodb": "6.8.0", "testcontainers": ">=10.11.0", - "typescript": "4.9.5" + "typescript": "5.6.2" }, "peerDependencies": { "@testcontainers/mongodb": ">=10.11.0", diff --git a/packages/orm/testcontainers-mongo/src/services/ContainerUtils.ts b/packages/orm/testcontainers-mongo/src/services/ContainerUtils.ts index d9e8572240f..9b959cdce65 100644 --- a/packages/orm/testcontainers-mongo/src/services/ContainerUtils.ts +++ b/packages/orm/testcontainers-mongo/src/services/ContainerUtils.ts @@ -1,9 +1,9 @@ +import type {ConnectionOptions} from "node:tls"; + import {MongoDBContainer, StartedMongoDBContainer} from "@testcontainers/mongodb"; import type {ConnectOptions} from "mongoose"; -import type {ConnectionOptions} from "node:tls"; declare global { - // eslint-disable-next-line @typescript-eslint/no-namespace namespace NodeJS { interface Global { TEST_CONTAINER_MONGO: StartedMongoDBContainer | null; @@ -13,18 +13,15 @@ declare global { const KEY = "TEST_CONTAINER_MONGO"; -// eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore global[KEY] = null; function getEnvironment(key: string): T | null { - // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore return global[key]; } function setEnvironment(key: string, environment: unknown) { - // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore global[key] = environment; } diff --git a/packages/orm/testcontainers-mongo/src/services/TestContainersMongo.ts b/packages/orm/testcontainers-mongo/src/services/TestContainersMongo.ts index e7ea503225d..bfab3f39907 100644 --- a/packages/orm/testcontainers-mongo/src/services/TestContainersMongo.ts +++ b/packages/orm/testcontainers-mongo/src/services/TestContainersMongo.ts @@ -1,5 +1,6 @@ import {PlatformTest} from "@tsed/common"; import {MongoClient} from "mongodb"; + import {getMongoConnectionOptions, getMongoConnectionsOptions, startMongoServer, stopMongoServer} from "./ContainerUtils.js"; export class TestContainersMongo { diff --git a/packages/orm/testcontainers-mongo/tsconfig.esm.json b/packages/orm/testcontainers-mongo/tsconfig.esm.json index e3b07081667..82292550ddb 100644 --- a/packages/orm/testcontainers-mongo/tsconfig.esm.json +++ b/packages/orm/testcontainers-mongo/tsconfig.esm.json @@ -2,8 +2,7 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "module": "ESNext", - "moduleResolution": "nodenext", + "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", @@ -11,7 +10,7 @@ "composite": true, "noEmit": false }, - "include": ["src", "src/**/*.json"], + "include": ["src/**/*.ts", "src/**/*.json"], "exclude": [ "node_modules", "test", diff --git a/packages/perf/package.json b/packages/perf/package.json index 3fd70dc1bac..7c79621ebc0 100644 --- a/packages/perf/package.json +++ b/packages/perf/package.json @@ -27,6 +27,6 @@ "devDependencies": { "@tsed/typescript": "workspace:*", "eslint": "^8.57.0", - "typescript": "4.9.5" + "typescript": "5.6.2" } } diff --git a/packages/perf/src/domain/Perf.ts b/packages/perf/src/domain/Perf.ts index 3d291162ab0..5f0f6a1c07e 100644 --- a/packages/perf/src/domain/Perf.ts +++ b/packages/perf/src/domain/Perf.ts @@ -1,4 +1,5 @@ import {isPromise} from "@tsed/core"; + import {fromNow, now} from "../utils/utils.js"; export type CallbackWrapper = (...args: any[]) => T; diff --git a/packages/perf/src/domain/PerfLogger.ts b/packages/perf/src/domain/PerfLogger.ts index 932ae6bd357..dd81b9444f1 100644 --- a/packages/perf/src/domain/PerfLogger.ts +++ b/packages/perf/src/domain/PerfLogger.ts @@ -1,5 +1,6 @@ import {classOf, descriptorOf, methodsOf, nameOf} from "@tsed/core"; import chalk from "chalk"; + import {CallbackWrapper, Perf} from "./Perf.js"; const loggers = new Map(); diff --git a/packages/perf/src/index.ts b/packages/perf/src/index.ts index 57961f2fca0..e16bc95c196 100644 --- a/packages/perf/src/index.ts +++ b/packages/perf/src/index.ts @@ -1,2 +1,2 @@ -export * from "./domain/PerfLogger.js"; export * from "./domain/Perf.js"; +export * from "./domain/PerfLogger.js"; diff --git a/packages/perf/tsconfig.esm.json b/packages/perf/tsconfig.esm.json index e3b07081667..82292550ddb 100644 --- a/packages/perf/tsconfig.esm.json +++ b/packages/perf/tsconfig.esm.json @@ -2,8 +2,7 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "module": "ESNext", - "moduleResolution": "nodenext", + "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", @@ -11,7 +10,7 @@ "composite": true, "noEmit": false }, - "include": ["src", "src/**/*.json"], + "include": ["src/**/*.ts", "src/**/*.json"], "exclude": [ "node_modules", "test", diff --git a/packages/platform/common/package.json b/packages/platform/common/package.json index 63761edb345..00c9de59645 100644 --- a/packages/platform/common/package.json +++ b/packages/platform/common/package.json @@ -94,7 +94,7 @@ "@tsed/typescript": "workspace:*", "cross-env": "7.0.3", "eslint": "^8.57.0", - "typescript": "4.9.5", + "typescript": "5.6.2", "vitest": "2.0.4" }, "peerDependencies": { diff --git a/packages/platform/common/src/builder/PlatformBuilder.spec.ts b/packages/platform/common/src/builder/PlatformBuilder.spec.ts index 7cba598afe4..cfa80f0489e 100644 --- a/packages/platform/common/src/builder/PlatformBuilder.spec.ts +++ b/packages/platform/common/src/builder/PlatformBuilder.spec.ts @@ -1,5 +1,6 @@ import {catchAsyncError, Type} from "@tsed/core"; import {Configuration, Controller, Injectable, InjectorService, Module} from "@tsed/di"; + import {AfterInit} from "../interfaces/AfterInit.js"; import {AfterListen} from "../interfaces/AfterListen.js"; import {AfterRoutesInit} from "../interfaces/AfterRoutesInit.js"; @@ -279,16 +280,16 @@ describe("PlatformBuilder", () => { // THEN // @ts-ignore - expect(server.listenServers).toBeCalledWith(); - expect(server.loadStatics).toBeCalledWith("$beforeRoutesInit"); - expect(server.loadStatics).toBeCalledWith("$afterRoutesInit"); - expect(server.injector.emit).toBeCalledWith("$afterInit"); - expect(server.injector.emit).toBeCalledWith("$beforeRoutesInit"); - expect(server.injector.emit).toBeCalledWith("$afterRoutesInit"); - expect(server.injector.emit).toBeCalledWith("$afterListen"); - expect(server.injector.emit).toBeCalledWith("$beforeListen"); - expect(server.injector.emit).toBeCalledWith("$onServerReady"); - expect(server.injector.emit).toBeCalledWith("$onReady"); + expect(server.listenServers).toHaveBeenCalledWith(); + expect(server.loadStatics).toHaveBeenCalledWith("$beforeRoutesInit"); + expect(server.loadStatics).toHaveBeenCalledWith("$afterRoutesInit"); + expect(server.injector.emit).toHaveBeenCalledWith("$afterInit"); + expect(server.injector.emit).toHaveBeenCalledWith("$beforeRoutesInit"); + expect(server.injector.emit).toHaveBeenCalledWith("$afterRoutesInit"); + expect(server.injector.emit).toHaveBeenCalledWith("$afterListen"); + expect(server.injector.emit).toHaveBeenCalledWith("$beforeListen"); + expect(server.injector.emit).toHaveBeenCalledWith("$onServerReady"); + expect(server.injector.emit).toHaveBeenCalledWith("$onReady"); // THEN expect(server.rootModule).toBeInstanceOf(ServerModule); @@ -296,7 +297,7 @@ describe("PlatformBuilder", () => { expect(server.name).toEqual("custom"); await server.stop(); - expect(server.injector.emit).toBeCalledWith("$onDestroy"); + expect(server.injector.emit).toHaveBeenCalledWith("$onDestroy"); }); }); describe("adapter()", () => { diff --git a/packages/platform/common/src/builder/PlatformBuilder.ts b/packages/platform/common/src/builder/PlatformBuilder.ts index ec2acaaa215..377140b94d5 100644 --- a/packages/platform/common/src/builder/PlatformBuilder.ts +++ b/packages/platform/common/src/builder/PlatformBuilder.ts @@ -6,6 +6,7 @@ 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"; import {Route} from "../interfaces/Route.js"; diff --git a/packages/platform/common/src/config/services/PlatformConfiguration.spec.ts b/packages/platform/common/src/config/services/PlatformConfiguration.spec.ts index c2c7d2beccd..625c06fde25 100644 --- a/packages/platform/common/src/config/services/PlatformConfiguration.spec.ts +++ b/packages/platform/common/src/config/services/PlatformConfiguration.spec.ts @@ -1,5 +1,6 @@ import {Env} from "@tsed/core"; import {ProviderScope, ProviderType} from "@tsed/di"; + import {PlatformConfiguration} from "./PlatformConfiguration.js"; describe("PlatformConfiguration", () => { @@ -51,9 +52,6 @@ describe("PlatformConfiguration", () => { settings.setHttpsPort({address: "address", port: 8080}); }); - it("should return rootDir", () => { - expect(settings.rootDir).toEqual(process.cwd()); - }); it("should return rootDir", () => { expect(settings.rootDir).toEqual(process.cwd()); }); @@ -78,7 +76,7 @@ describe("PlatformConfiguration", () => { expect(settings.httpPort).toEqual("address:8081"); }); - it("should return httpsPort", () => { + it("should return the best host", () => { const info = settings.getHttpsPort(); expect(info).toEqual({ protocol: "https", @@ -89,7 +87,7 @@ describe("PlatformConfiguration", () => { expect(settings.getBestHost().toString()).toEqual("https://address:8080"); }); - it("should return httpPort", () => { + it("should return httpPort multiple usecase", () => { const info = settings.getHttpPort(); expect(info).toEqual({ protocol: "http", @@ -129,10 +127,6 @@ describe("PlatformConfiguration", () => { }); }); - it("should return env", () => { - expect(settings.env).toEqual("test"); - }); - it("should return additionalProperties", () => { expect(settings.additionalProperties).toEqual(false); }); diff --git a/packages/platform/common/src/config/services/PlatformConfiguration.ts b/packages/platform/common/src/config/services/PlatformConfiguration.ts index da995b917fc..cdf0001d1cc 100644 --- a/packages/platform/common/src/config/services/PlatformConfiguration.ts +++ b/packages/platform/common/src/config/services/PlatformConfiguration.ts @@ -2,6 +2,7 @@ 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"; const rootDir = process.cwd(); diff --git a/packages/platform/common/src/decorators/PlatformProvider.ts b/packages/platform/common/src/decorators/PlatformProvider.ts index bc7c6d40b85..5e1e53cf5c5 100644 --- a/packages/platform/common/src/decorators/PlatformProvider.ts +++ b/packages/platform/common/src/decorators/PlatformProvider.ts @@ -1,4 +1,5 @@ import {Type} from "@tsed/core"; + import {PlatformAdapter} from "../services/PlatformAdapter.js"; import {registerPlatformAdapter} from "../utils/registerPlatformAdapter.js"; diff --git a/packages/platform/common/src/decorators/multer/multerFileSize.spec.ts b/packages/platform/common/src/decorators/multer/multerFileSize.spec.ts index 605f7533078..f0a5017c96a 100644 --- a/packages/platform/common/src/decorators/multer/multerFileSize.spec.ts +++ b/packages/platform/common/src/decorators/multer/multerFileSize.spec.ts @@ -1,4 +1,5 @@ import {Store} from "@tsed/core"; + import {PlatformMulterMiddleware} from "../../middlewares/PlatformMulterMiddleware.js"; import {MulterFileSize} from "./multerFileSize.js"; diff --git a/packages/platform/common/src/decorators/multer/multerOptions.spec.ts b/packages/platform/common/src/decorators/multer/multerOptions.spec.ts index 736889089fb..cd4e85fefe4 100644 --- a/packages/platform/common/src/decorators/multer/multerOptions.spec.ts +++ b/packages/platform/common/src/decorators/multer/multerOptions.spec.ts @@ -1,4 +1,5 @@ import {Store} from "@tsed/core"; + import {PlatformMulterMiddleware} from "../../middlewares/PlatformMulterMiddleware.js"; import {MulterOptions} from "./multerOptions.js"; diff --git a/packages/platform/common/src/decorators/multer/multerOptions.ts b/packages/platform/common/src/decorators/multer/multerOptions.ts index 2f24196e31a..b3f2c2a4871 100644 --- a/packages/platform/common/src/decorators/multer/multerOptions.ts +++ b/packages/platform/common/src/decorators/multer/multerOptions.ts @@ -1,4 +1,5 @@ import {StoreMerge} from "@tsed/core"; + import {PlatformMulterSettings} from "../../config/interfaces/PlatformMulterSettings.js"; import {PlatformMulterMiddleware} from "../../middlewares/PlatformMulterMiddleware.js"; diff --git a/packages/platform/common/src/decorators/multer/multipartFile.spec.ts b/packages/platform/common/src/decorators/multer/multipartFile.spec.ts index 18a2a43c0b9..1a126479941 100644 --- a/packages/platform/common/src/decorators/multer/multipartFile.spec.ts +++ b/packages/platform/common/src/decorators/multer/multipartFile.spec.ts @@ -1,7 +1,9 @@ +import "../../index.js"; + import {descriptorOf, Metadata, Store} from "@tsed/core"; import {ParamTypes} from "@tsed/platform-params"; import {getSpec, JsonParameterStore, Post, SpecTypes} from "@tsed/schema"; -import "../../index.js"; + import {PlatformMulterMiddleware} from "../../middlewares/PlatformMulterMiddleware.js"; import {MultipartFile} from "./multipartFile.js"; diff --git a/packages/platform/common/src/decorators/multer/multipartFile.ts b/packages/platform/common/src/decorators/multer/multipartFile.ts index 7721d51bcbc..eb9ed751ea6 100644 --- a/packages/platform/common/src/decorators/multer/multipartFile.ts +++ b/packages/platform/common/src/decorators/multer/multipartFile.ts @@ -1,6 +1,7 @@ import {DecoratorParameters, Metadata, StoreMerge, useDecorators, useMethodDecorators} from "@tsed/core"; import {ParamTypes, UseParam} from "@tsed/platform-params"; import {InFile} from "@tsed/schema"; + import {PlatformMulterFile} from "../../config/interfaces/PlatformMulterSettings.js"; import {MulterInputOptions, PlatformMulterMiddleware} from "../../middlewares/PlatformMulterMiddleware.js"; diff --git a/packages/platform/common/src/decorators/params/error.spec.ts b/packages/platform/common/src/decorators/params/error.spec.ts index 1d137accee6..95a212f512c 100644 --- a/packages/platform/common/src/decorators/params/error.spec.ts +++ b/packages/platform/common/src/decorators/params/error.spec.ts @@ -1,7 +1,8 @@ import {ParamTypes} from "@tsed/platform-params"; -import {Err} from "./error.js"; import {JsonParameterStore} from "@tsed/schema"; +import {Err} from "./error.js"; + describe("@Err", () => { it("should register a new parameter instance with the correct property", () => { class Ctrl { diff --git a/packages/platform/common/src/decorators/params/next.spec.ts b/packages/platform/common/src/decorators/params/next.spec.ts index af659627ef8..cc8a7403449 100644 --- a/packages/platform/common/src/decorators/params/next.spec.ts +++ b/packages/platform/common/src/decorators/params/next.spec.ts @@ -1,5 +1,6 @@ import {ParamTypes} from "@tsed/platform-params"; import {JsonParameterStore} from "@tsed/schema"; + import {Next} from "./next.js"; describe("@Next", () => { diff --git a/packages/platform/common/src/decorators/params/request.spec.ts b/packages/platform/common/src/decorators/params/request.spec.ts index 5fd742c828c..622199f0e94 100644 --- a/packages/platform/common/src/decorators/params/request.spec.ts +++ b/packages/platform/common/src/decorators/params/request.spec.ts @@ -1,8 +1,9 @@ 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"; -import {JsonParameterStore} from "@tsed/schema"; describe("@Req", () => { it("should register a new parameter instance with the correct property (RawRequest)", () => { diff --git a/packages/platform/common/src/decorators/params/request.ts b/packages/platform/common/src/decorators/params/request.ts index 68a1ed6e618..037b5410f44 100644 --- a/packages/platform/common/src/decorators/params/request.ts +++ b/packages/platform/common/src/decorators/params/request.ts @@ -1,6 +1,6 @@ import {isClass, Metadata, nameOf, Type} from "@tsed/core"; -import {IncomingMessage} from "http"; 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/common/src/decorators/params/response.spec.ts b/packages/platform/common/src/decorators/params/response.spec.ts index ceede257417..fc73986918b 100644 --- a/packages/platform/common/src/decorators/params/response.spec.ts +++ b/packages/platform/common/src/decorators/params/response.spec.ts @@ -1,8 +1,9 @@ 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"; -import {JsonParameterStore} from "@tsed/schema"; describe("@Res", () => { it("should register a new parameter instance with the correct property (RawRes)", () => { diff --git a/packages/platform/common/src/domain/AnyToPromiseWithCtx.ts b/packages/platform/common/src/domain/AnyToPromiseWithCtx.ts index e4e1e010b66..c750e55ddee 100644 --- a/packages/platform/common/src/domain/AnyToPromiseWithCtx.ts +++ b/packages/platform/common/src/domain/AnyToPromiseWithCtx.ts @@ -1,4 +1,5 @@ import {AnyPromiseResult, AnyToPromise} from "@tsed/core"; + import {PlatformContext} from "./PlatformContext.js"; export class AnyToPromiseWithCtx extends AnyToPromise { diff --git a/packages/platform/common/src/domain/PlatformContext.spec.ts b/packages/platform/common/src/domain/PlatformContext.spec.ts index 5e4a36cb440..02e58d13c49 100644 --- a/packages/platform/common/src/domain/PlatformContext.spec.ts +++ b/packages/platform/common/src/domain/PlatformContext.spec.ts @@ -1,4 +1,5 @@ import {nameOf} from "@tsed/core"; + import {PlatformApplication} from "../services/PlatformApplication.js"; import {PlatformTest} from "../services/PlatformTest.js"; import {PlatformContext} from "./PlatformContext.js"; @@ -94,7 +95,7 @@ describe("PlatformContext", () => { expect(context.isDone()).toEqual(true); }); - it("should return done when the response is empty", async () => { + it("should return done when the response is empty (start context before)", async () => { // @ts-ignore const context = new PlatformContext({ id: "id", diff --git a/packages/platform/common/src/domain/PlatformContext.ts b/packages/platform/common/src/domain/PlatformContext.ts index d48aa114d29..f5c5161bb65 100644 --- a/packages/platform/common/src/domain/PlatformContext.ts +++ b/packages/platform/common/src/domain/PlatformContext.ts @@ -2,6 +2,7 @@ import {DIContext, DIContextOptions} from "@tsed/di"; 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"; import {PlatformRequest} from "../services/PlatformRequest.js"; diff --git a/packages/platform/common/src/exports.ts b/packages/platform/common/src/exports.ts index 5916bab87eb..24c9b6e9500 100644 --- a/packages/platform/common/src/exports.ts +++ b/packages/platform/common/src/exports.ts @@ -2,13 +2,11 @@ import "@tsed/logger"; import "@tsed/logger-file"; export * from "@tsed/di"; -export * from "@tsed/platform-params"; +export {$log, Logger} from "@tsed/logger"; export * from "@tsed/platform-exceptions"; -export * from "@tsed/platform-response-filter"; -export * from "@tsed/platform-middlewares"; export * from "@tsed/platform-log-middleware"; +export * from "@tsed/platform-middlewares"; +export * from "@tsed/platform-params"; +export * from "@tsed/platform-response-filter"; export * from "@tsed/platform-router"; - -export {$log, Logger} from "@tsed/logger"; - -export {AcceptMime, Location, Redirect, View, Get, Post, Put, Patch, Delete, Head, Options, All} from "@tsed/schema"; +export {AcceptMime, All, Delete, Get, Head, Location, Options, Patch, Post, Put, Redirect, View} from "@tsed/schema"; diff --git a/packages/platform/common/src/middlewares/PlatformAcceptMimesMiddleware.spec.ts b/packages/platform/common/src/middlewares/PlatformAcceptMimesMiddleware.spec.ts index 740f9bb91b6..c4d678d428c 100644 --- a/packages/platform/common/src/middlewares/PlatformAcceptMimesMiddleware.spec.ts +++ b/packages/platform/common/src/middlewares/PlatformAcceptMimesMiddleware.spec.ts @@ -1,5 +1,6 @@ import {catchError} from "@tsed/core"; import {EndpointMetadata, Get} from "@tsed/schema"; + import {AcceptMime} from "../exports.js"; import {PlatformTest} from "../services/PlatformTest.js"; import {PlatformAcceptMimesMiddleware} from "./PlatformAcceptMimesMiddleware.js"; @@ -36,7 +37,7 @@ describe("PlatformMimesMiddleware", () => { middleware.use(ctx); - expect(request.accepts).toBeCalledWith(["application/json", "text"]); + expect(request.accepts).toHaveBeenCalledWith(["application/json", "text"]); }); it("should accept type (text)", async () => { class Test { @@ -61,7 +62,7 @@ describe("PlatformMimesMiddleware", () => { const middleware = await PlatformTest.invoke(PlatformAcceptMimesMiddleware); middleware.use(ctx); - expect(request.accepts).toBeCalledWith(["text", "application/json"]); + expect(request.accepts).toHaveBeenCalledWith(["text", "application/json"]); }); it("should accept type (text) without endpoint", async () => { class Test { @@ -83,7 +84,7 @@ describe("PlatformMimesMiddleware", () => { const middleware = await PlatformTest.invoke(PlatformAcceptMimesMiddleware); middleware.use(ctx); - expect(request.accepts).toBeCalledWith(["application/json", "text"]); + expect(request.accepts).toHaveBeenCalledWith(["application/json", "text"]); }); it("should refuse type", async () => { class Test { @@ -133,7 +134,7 @@ describe("PlatformMimesMiddleware", () => { const middleware = await PlatformTest.invoke(PlatformAcceptMimesMiddleware); middleware.use(ctx); - return expect(request.accepts).not.toBeCalled(); + return expect(request.accepts).not.toHaveBeenCalled(); }); it("should accept type (application/json)", async () => { class Test { @@ -157,7 +158,7 @@ describe("PlatformMimesMiddleware", () => { const middleware = await PlatformTest.invoke(PlatformAcceptMimesMiddleware); middleware.use(ctx); - expect(request.accepts).toBeCalledWith(["application/json"]); + expect(request.accepts).toHaveBeenCalledWith(["application/json"]); }); it("should accept type (text)", async () => { class Test { @@ -183,7 +184,7 @@ describe("PlatformMimesMiddleware", () => { const middleware = await PlatformTest.invoke(PlatformAcceptMimesMiddleware); middleware.use(ctx); - expect(request.accepts).toBeCalledWith(["text"]); + expect(request.accepts).toHaveBeenCalledWith(["text"]); }); it("should refuse type", async () => { class Test { diff --git a/packages/platform/common/src/middlewares/PlatformMulterMiddleware.spec.ts b/packages/platform/common/src/middlewares/PlatformMulterMiddleware.spec.ts index 96a9390a1c2..9f1af7706e6 100644 --- a/packages/platform/common/src/middlewares/PlatformMulterMiddleware.spec.ts +++ b/packages/platform/common/src/middlewares/PlatformMulterMiddleware.spec.ts @@ -1,6 +1,7 @@ +import {catchAsyncError} from "@tsed/core"; import {Exception} from "@tsed/exceptions"; import {MulterError} from "multer"; -import {catchAsyncError} from "@tsed/core"; + import {MulterOptions} from "../decorators/multer/multerOptions.js"; import {MultipartFile} from "../decorators/multer/multipartFile.js"; import {EndpointMetadata} from "../domain/EndpointMetadata.js"; @@ -48,11 +49,11 @@ describe("PlatformMulterMiddleware", () => { await middleware.use(ctx); - expect(app.multer).toBeCalledWith({ + expect(app.multer).toHaveBeenCalledWith({ dest: "/dest" }); - expect(multer.fields).toBeCalledWith([{maxCount: undefined, name: "file1"}]); - expect(multerMiddleware).toBeCalledWith(ctx.request.raw, ctx.response.raw); + expect(multer.fields).toHaveBeenCalledWith([{maxCount: undefined, name: "file1"}]); + expect(multerMiddleware).toHaveBeenCalledWith(ctx.request.raw, ctx.response.raw); }); it("should create middleware with storage", async () => { const {middleware, ctx, multer, app, multerMiddleware} = await build({ @@ -61,11 +62,11 @@ describe("PlatformMulterMiddleware", () => { await middleware.use(ctx); - expect(app.multer).toBeCalledWith({ + expect(app.multer).toHaveBeenCalledWith({ storage: "storage" }); - expect(multer.fields).toBeCalledWith([{maxCount: undefined, name: "file1"}]); - expect(multerMiddleware).toBeCalledWith(ctx.request.raw, ctx.response.raw); + expect(multer.fields).toHaveBeenCalledWith([{maxCount: undefined, name: "file1"}]); + expect(multerMiddleware).toHaveBeenCalledWith(ctx.request.raw, ctx.response.raw); }); it("should catch error with code", async () => { const {middleware, ctx, multerMiddleware} = await build(); diff --git a/packages/platform/common/src/middlewares/PlatformMulterMiddleware.ts b/packages/platform/common/src/middlewares/PlatformMulterMiddleware.ts index 338c6dd2971..cdd4f0055b0 100644 --- a/packages/platform/common/src/middlewares/PlatformMulterMiddleware.ts +++ b/packages/platform/common/src/middlewares/PlatformMulterMiddleware.ts @@ -3,6 +3,7 @@ import {BadRequest} from "@tsed/exceptions"; import {Middleware, MiddlewareMethods} from "@tsed/platform-middlewares"; import {Context} from "@tsed/platform-params"; import type {MulterError} from "multer"; + import {PlatformMulterField, PlatformMulterSettings} from "../config/interfaces/PlatformMulterSettings.js"; import {PlatformContext} from "../domain/PlatformContext.js"; import {PlatformApplication} from "../services/PlatformApplication.js"; diff --git a/packages/platform/common/src/services/Platform.spec.ts b/packages/platform/common/src/services/Platform.spec.ts index 134ad67cd96..b039fbc30f4 100644 --- a/packages/platform/common/src/services/Platform.spec.ts +++ b/packages/platform/common/src/services/Platform.spec.ts @@ -1,6 +1,7 @@ import {nameOf} from "@tsed/core"; import {Controller} from "@tsed/di"; import {Get, Post} from "@tsed/schema"; + import {Platform} from "./Platform.js"; import {PlatformTest} from "./PlatformTest.js"; diff --git a/packages/platform/common/src/services/Platform.ts b/packages/platform/common/src/services/Platform.ts index ab36e1df417..589ecd8175e 100644 --- a/packages/platform/common/src/services/Platform.ts +++ b/packages/platform/common/src/services/Platform.ts @@ -1,5 +1,6 @@ import {ControllerProvider, Injectable, InjectorService, ProviderScope, TokenProvider} from "@tsed/di"; import {PlatformLayer, PlatformRouters} from "@tsed/platform-router"; + import {Route, RouteController} from "../interfaces/Route.js"; import {PlatformApplication} from "./PlatformApplication.js"; import {PlatformHandler} from "./PlatformHandler.js"; diff --git a/packages/platform/common/src/services/PlatformAdapter.ts b/packages/platform/common/src/services/PlatformAdapter.ts index 6a9333afb4d..4eee9174019 100644 --- a/packages/platform/common/src/services/PlatformAdapter.ts +++ b/packages/platform/common/src/services/PlatformAdapter.ts @@ -2,6 +2,7 @@ import {Type} from "@tsed/core"; import {InjectorService, ProviderOpts, registerProvider} from "@tsed/di"; import {PlatformContextHandler, 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"; import {PlatformContext} from "../domain/PlatformContext.js"; diff --git a/packages/platform/common/src/services/PlatformApplication.ts b/packages/platform/common/src/services/PlatformApplication.ts index b5a0f5d3f5c..b7eefcdd279 100644 --- a/packages/platform/common/src/services/PlatformApplication.ts +++ b/packages/platform/common/src/services/PlatformApplication.ts @@ -1,6 +1,7 @@ import {Injectable, InjectorService, 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/common/src/services/PlatformHandler.spec.ts b/packages/platform/common/src/services/PlatformHandler.spec.ts index c777948bed2..03569404afb 100644 --- a/packages/platform/common/src/services/PlatformHandler.spec.ts +++ b/packages/platform/common/src/services/PlatformHandler.spec.ts @@ -1,6 +1,7 @@ import {Injectable} from "@tsed/di"; import {PlatformHandlerMetadata, PlatformHandlerType} from "@tsed/platform-router"; import {EndpointMetadata, Get, View} from "@tsed/schema"; + import {PlatformHandler} from "./PlatformHandler.js"; import {PlatformTest} from "./PlatformTest.js"; diff --git a/packages/platform/common/src/services/PlatformHandler.ts b/packages/platform/common/src/services/PlatformHandler.ts index cb1b76223b8..7c74392f992 100644 --- a/packages/platform/common/src/services/PlatformHandler.ts +++ b/packages/platform/common/src/services/PlatformHandler.ts @@ -11,6 +11,7 @@ import { useResponseHandler } from "@tsed/platform-router"; import {JsonOperationRoute} from "@tsed/schema"; + import {AnyToPromiseWithCtx} from "../domain/AnyToPromiseWithCtx.js"; import {PlatformContext} from "../domain/PlatformContext.js"; import {setResponseHeaders} from "../utils/setResponseHeaders.js"; diff --git a/packages/platform/common/src/services/PlatformMiddlewaresChain.spec.ts b/packages/platform/common/src/services/PlatformMiddlewaresChain.spec.ts index 2f2d13d8e1d..da1bbbce0f2 100644 --- a/packages/platform/common/src/services/PlatformMiddlewaresChain.spec.ts +++ b/packages/platform/common/src/services/PlatformMiddlewaresChain.spec.ts @@ -1,6 +1,7 @@ import {Controller, ControllerProvider} from "@tsed/di"; import {Middleware, Use, UseAuth} from "@tsed/platform-middlewares"; import {AcceptMime, All, EndpointMetadata, Get, getOperationsRoutes, Post} from "@tsed/schema"; + import {MultipartFile} from "../decorators/multer/multipartFile.js"; import {PlatformAcceptMimesMiddleware} from "../middlewares/PlatformAcceptMimesMiddleware.js"; import {PlatformMulterMiddleware} from "../middlewares/PlatformMulterMiddleware.js"; diff --git a/packages/platform/common/src/services/PlatformMiddlewaresChain.ts b/packages/platform/common/src/services/PlatformMiddlewaresChain.ts index 0300d176a6f..27c7512bb15 100644 --- a/packages/platform/common/src/services/PlatformMiddlewaresChain.ts +++ b/packages/platform/common/src/services/PlatformMiddlewaresChain.ts @@ -3,6 +3,7 @@ import {Constant, Inject, Injectable, InjectorService, TokenProvider} from "@tse import {ParamTypes} from "@tsed/platform-params"; import {AlterEndpointHandlersArg} from "@tsed/platform-router"; import {JsonEntityStore, JsonOperationRoute} from "@tsed/schema"; + import {PlatformAcceptMimesMiddleware} from "../middlewares/PlatformAcceptMimesMiddleware.js"; import {PlatformMulterMiddleware} from "../middlewares/PlatformMulterMiddleware.js"; import {PlatformAdapter} from "../services/PlatformAdapter.js"; diff --git a/packages/platform/common/src/services/PlatformRequest.spec.ts b/packages/platform/common/src/services/PlatformRequest.spec.ts index 1a6a81f1b7b..fcca5aabfd1 100644 --- a/packages/platform/common/src/services/PlatformRequest.spec.ts +++ b/packages/platform/common/src/services/PlatformRequest.spec.ts @@ -1,4 +1,5 @@ import {PlatformHandlerMetadata} from "@tsed/platform-router"; + import {PlatformRequest} from "./PlatformRequest.js"; import {PlatformTest} from "./PlatformTest.js"; @@ -92,7 +93,7 @@ describe("PlatformRequest", () => { request.accepts("application/json"); - expect(req.accepts).toBeCalledWith("application/json"); + expect(req.accepts).toHaveBeenCalledWith("application/json"); }); }); diff --git a/packages/platform/common/src/services/PlatformRequest.ts b/packages/platform/common/src/services/PlatformRequest.ts index 3b770db3417..f14fe2be878 100644 --- a/packages/platform/common/src/services/PlatformRequest.ts +++ b/packages/platform/common/src/services/PlatformRequest.ts @@ -1,5 +1,6 @@ import {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/common/src/services/PlatformResponse.spec.ts b/packages/platform/common/src/services/PlatformResponse.spec.ts index 9b24ccd119d..4f46341cbff 100644 --- a/packages/platform/common/src/services/PlatformResponse.spec.ts +++ b/packages/platform/common/src/services/PlatformResponse.spec.ts @@ -1,5 +1,6 @@ import {PlatformViews} from "@tsed/platform-views"; import {createReadStream} from "fs"; + import {PlatformResponse} from "./PlatformResponse.js"; import {PlatformTest} from "./PlatformTest.js"; @@ -38,7 +39,7 @@ describe("PlatformResponse", () => { vi.spyOn(res, "status").mockReturnValue(undefined); response.status(204); - expect(res.status).toBeCalledWith(204); + expect(res.status).toHaveBeenCalledWith(204); }); }); describe("setHeaders()", () => { @@ -92,7 +93,7 @@ describe("PlatformResponse", () => { expect(response.getContentLength()).toEqual(5); }); - it("should set content Type", () => { + it("should set content Type (size 0)", () => { const {res, response} = createResponse(); response.contentLength(" " as any); @@ -170,7 +171,7 @@ describe("PlatformResponse", () => { test: "test" }); - expect(platformViews.render).toBeCalledWith("view", { + expect(platformViews.render).toHaveBeenCalledWith("view", { locale: "fr-FR", test: "test" }); @@ -212,7 +213,7 @@ describe("PlatformResponse", () => { response.body(stream); - expect(stream.pipe).toBeCalledWith(res); + expect(stream.pipe).toHaveBeenCalledWith(res); }); it("should call body with buffer", () => { const {res, response} = createResponse(); diff --git a/packages/platform/common/src/services/PlatformResponse.ts b/packages/platform/common/src/services/PlatformResponse.ts index 2784a2877c1..6b7d65e7056 100644 --- a/packages/platform/common/src/services/PlatformResponse.ts +++ b/packages/platform/common/src/services/PlatformResponse.ts @@ -3,6 +3,7 @@ import {Injectable, ProviderScope, Scope} 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/common/src/services/PlatformTest.spec.ts b/packages/platform/common/src/services/PlatformTest.spec.ts index 94f2c87a893..6b80dd5d364 100644 --- a/packages/platform/common/src/services/PlatformTest.spec.ts +++ b/packages/platform/common/src/services/PlatformTest.spec.ts @@ -1,5 +1,6 @@ import {Configuration, Controller, InjectorService} from "@tsed/di"; import {Get} from "@tsed/schema"; + import {PlatformContext} from "../domain/PlatformContext.js"; import {PlatformTest} from "./PlatformTest.js"; diff --git a/packages/platform/common/src/services/PlatformTest.ts b/packages/platform/common/src/services/PlatformTest.ts index 9d2d61b7fbd..b127e3ed173 100644 --- a/packages/platform/common/src/services/PlatformTest.ts +++ b/packages/platform/common/src/services/PlatformTest.ts @@ -2,6 +2,7 @@ import {Type} from "@tsed/core"; import {DITest, InjectorService} from "@tsed/di"; import accepts from "accepts"; import type {IncomingMessage, RequestListener, ServerResponse} from "http"; + import {PlatformBuilder} from "../builder/PlatformBuilder.js"; import {PlatformContext, PlatformContextOptions} from "../domain/PlatformContext.js"; import {createInjector} from "../utils/createInjector.js"; diff --git a/packages/platform/common/src/utils/__mock__/module1/Module1.ts b/packages/platform/common/src/utils/__mock__/module1/Module1.ts index b11f274fed0..7ef951e3dc1 100644 --- a/packages/platform/common/src/utils/__mock__/module1/Module1.ts +++ b/packages/platform/common/src/utils/__mock__/module1/Module1.ts @@ -1,6 +1,7 @@ -import {SubModule} from "./submodule/SubModule.js"; import {Module} from "@tsed/di"; + import {M1Ctrl1} from "./controllers/M1Ctrl1.js"; +import {SubModule} from "./submodule/SubModule.js"; @Module({ mount: { diff --git a/packages/platform/common/src/utils/__mock__/module1/controllers/M1Ctrl1.ts b/packages/platform/common/src/utils/__mock__/module1/controllers/M1Ctrl1.ts index 9df9d6d10ee..7c387877f6a 100644 --- a/packages/platform/common/src/utils/__mock__/module1/controllers/M1Ctrl1.ts +++ b/packages/platform/common/src/utils/__mock__/module1/controllers/M1Ctrl1.ts @@ -1,4 +1,5 @@ import {Controller} from "@tsed/di"; + import {M1Service} from "../services/M1Service.js"; @Controller("/m1") diff --git a/packages/platform/common/src/utils/__mock__/module1/services/M1Service.ts b/packages/platform/common/src/utils/__mock__/module1/services/M1Service.ts index 492b676997a..0da88b4618d 100644 --- a/packages/platform/common/src/utils/__mock__/module1/services/M1Service.ts +++ b/packages/platform/common/src/utils/__mock__/module1/services/M1Service.ts @@ -1,4 +1,5 @@ import {Injectable} from "@tsed/di"; + import {SubService} from "../submodule/SubService.js"; @Injectable() diff --git a/packages/platform/common/src/utils/__mock__/module1/submodule/SubModule.ts b/packages/platform/common/src/utils/__mock__/module1/submodule/SubModule.ts index ef297540849..980c2d10095 100644 --- a/packages/platform/common/src/utils/__mock__/module1/submodule/SubModule.ts +++ b/packages/platform/common/src/utils/__mock__/module1/submodule/SubModule.ts @@ -1,4 +1,5 @@ import {Module} from "@tsed/di"; + import {SubService} from "./SubService.js"; @Module({ diff --git a/packages/platform/common/src/utils/__mock__/module2/Module2.ts b/packages/platform/common/src/utils/__mock__/module2/Module2.ts index 2b6c78c8253..15b97098d00 100644 --- a/packages/platform/common/src/utils/__mock__/module2/Module2.ts +++ b/packages/platform/common/src/utils/__mock__/module2/Module2.ts @@ -1,4 +1,5 @@ import {Module} from "@tsed/di"; + import {M2Ctrl} from "./controllers/M2Ctrl.js"; @Module({ diff --git a/packages/platform/common/src/utils/createContext.spec.ts b/packages/platform/common/src/utils/createContext.spec.ts index 125c7f48b73..63f22c0dfc8 100644 --- a/packages/platform/common/src/utils/createContext.spec.ts +++ b/packages/platform/common/src/utils/createContext.spec.ts @@ -43,11 +43,11 @@ describe("createContext", () => { await call(); // THEN - expect(injector.emit).toBeCalledWith("$onRequest", ctx); + expect(injector.emit).toHaveBeenCalledWith("$onRequest", ctx); await vi.mocked(ctx.response.getRes().on).mock.calls[0][1](ctx); - expect(injector.emit).toBeCalledWith("$onResponse", ctx); + expect(injector.emit).toHaveBeenCalledWith("$onResponse", ctx); }); it("should ignore logs", async () => { @@ -78,7 +78,7 @@ describe("createContext", () => { await call(); // THEN - expect(ctx.response.setHeader).toBeCalledWith("x-request-id", expect.any(String)); + expect(ctx.response.setHeader).toHaveBeenCalledWith("x-request-id", expect.any(String)); }); it("should use an existing x-request-id request header for the response x-request-id header", async () => { @@ -96,6 +96,6 @@ describe("createContext", () => { await call(); // THEN - expect(ctx.response.setHeader).toBeCalledWith("x-request-id", "test-id"); + expect(ctx.response.setHeader).toHaveBeenCalledWith("x-request-id", "test-id"); }); }); diff --git a/packages/platform/common/src/utils/createContext.ts b/packages/platform/common/src/utils/createContext.ts index 35cb9fd212b..507bf110aed 100644 --- a/packages/platform/common/src/utils/createContext.ts +++ b/packages/platform/common/src/utils/createContext.ts @@ -1,5 +1,6 @@ import {InjectorService} from "@tsed/di"; import {v4} from "uuid"; + import {PlatformContext} from "../domain/PlatformContext.js"; import {IncomingEvent} from "../interfaces/IncomingEvent.js"; import {PlatformRequest} from "../services/PlatformRequest.js"; diff --git a/packages/platform/common/src/utils/createHttpServer.spec.ts b/packages/platform/common/src/utils/createHttpServer.spec.ts index 474178155fb..87421349204 100644 --- a/packages/platform/common/src/utils/createHttpServer.spec.ts +++ b/packages/platform/common/src/utils/createHttpServer.spec.ts @@ -1,5 +1,6 @@ import {InjectorService} from "@tsed/di"; import Http from "http"; + import {createHttpServer} from "./createHttpServer.js"; describe("createHttpServer", () => { @@ -32,8 +33,8 @@ describe("createHttpServer", () => { await listener(); - expect(server.listen).toBeCalledWith(true, "0.0.0.0"); - expect(injector.logger.info).toBeCalledWith("Listen server on http://0.0.0.0:8089"); + expect(server.listen).toHaveBeenCalledWith(true, "0.0.0.0"); + expect(injector.logger.info).toHaveBeenCalledWith("Listen server on http://0.0.0.0:8089"); }); it("should create a raw object (http port false)", () => { diff --git a/packages/platform/common/src/utils/createHttpServer.ts b/packages/platform/common/src/utils/createHttpServer.ts index 49597613d46..d1b67c5d8b6 100644 --- a/packages/platform/common/src/utils/createHttpServer.ts +++ b/packages/platform/common/src/utils/createHttpServer.ts @@ -1,5 +1,6 @@ import {InjectorService} from "@tsed/di"; import Http from "http"; + import {createServer} from "./createServer.js"; export function createHttpServer(injector: InjectorService, requestListener: Http.RequestListener) { diff --git a/packages/platform/common/src/utils/createHttpsServer.spec.ts b/packages/platform/common/src/utils/createHttpsServer.spec.ts index acdc6c37e35..be4458710b4 100644 --- a/packages/platform/common/src/utils/createHttpsServer.spec.ts +++ b/packages/platform/common/src/utils/createHttpsServer.spec.ts @@ -1,5 +1,6 @@ import {InjectorService} from "@tsed/di"; import Https from "https"; + import {createHttpsServer} from "./createHttpsServer.js"; describe("createHttpsServer", () => { @@ -31,8 +32,8 @@ describe("createHttpsServer", () => { await listener(); - expect(server.listen).toBeCalledWith(true, "0.0.0.0"); - expect(injector.logger.info).toBeCalledWith("Listen server on https://0.0.0.0:8089"); + expect(server.listen).toHaveBeenCalledWith(true, "0.0.0.0"); + expect(injector.logger.info).toHaveBeenCalledWith("Listen server on https://0.0.0.0:8089"); }); it("should create a raw object (Https port false)", () => { diff --git a/packages/platform/common/src/utils/createHttpsServer.ts b/packages/platform/common/src/utils/createHttpsServer.ts index 73f5c7d193e..93c1ebbe7c4 100644 --- a/packages/platform/common/src/utils/createHttpsServer.ts +++ b/packages/platform/common/src/utils/createHttpsServer.ts @@ -1,6 +1,7 @@ import {InjectorService} from "@tsed/di"; import Http from "http"; import Https from "https"; + import {createServer} from "./createServer.js"; export function createHttpsServer(injector: InjectorService, requestListener?: Http.RequestListener) { diff --git a/packages/platform/common/src/utils/createInjector.spec.ts b/packages/platform/common/src/utils/createInjector.spec.ts index f0b4acde2c3..ff95b520edf 100644 --- a/packages/platform/common/src/utils/createInjector.spec.ts +++ b/packages/platform/common/src/utils/createInjector.spec.ts @@ -1,5 +1,6 @@ import {Env} from "@tsed/core"; import {$log} from "@tsed/logger"; + import {PlatformConfiguration} from "../config/services/PlatformConfiguration.js"; import {FakeAdapter} from "../services/FakeAdapter.js"; import {PlatformAdapter} from "../services/PlatformAdapter.js"; @@ -34,6 +35,6 @@ describe("createInjector", () => { const injector = createInjector({settings, adapter: FakeAdapter}); - expect(injector.logger.stop).not.toBeCalled(); + expect(injector.logger.stop).not.toHaveBeenCalled(); }); }); diff --git a/packages/platform/common/src/utils/createInjector.ts b/packages/platform/common/src/utils/createInjector.ts index 1e0de563a6f..6ad851187c4 100644 --- a/packages/platform/common/src/utils/createInjector.ts +++ b/packages/platform/common/src/utils/createInjector.ts @@ -1,6 +1,7 @@ import {toMap, Type} from "@tsed/core"; import {InjectorService, ProviderOpts, setLoggerConfiguration} from "@tsed/di"; import {$log} from "@tsed/logger"; + import {PlatformConfiguration} from "../config/services/PlatformConfiguration.js"; import {Platform} from "../services/Platform.js"; import {PlatformAdapter} from "../services/PlatformAdapter.js"; diff --git a/packages/platform/common/src/utils/createServer.ts b/packages/platform/common/src/utils/createServer.ts index ac5ad946808..6495b3272ad 100644 --- a/packages/platform/common/src/utils/createServer.ts +++ b/packages/platform/common/src/utils/createServer.ts @@ -3,6 +3,7 @@ import {InjectorService, ProviderScope, TokenProvider} from "@tsed/di"; import Http from "http"; import Http2 from "http2"; import Https from "https"; + import {listenServer} from "./listenServer.js"; export interface CreateServerOptions { diff --git a/packages/platform/common/src/utils/ensureContext.ts b/packages/platform/common/src/utils/ensureContext.ts index 0cb003af993..9f20053c600 100644 --- a/packages/platform/common/src/utils/ensureContext.ts +++ b/packages/platform/common/src/utils/ensureContext.ts @@ -1,4 +1,5 @@ import {getContext} from "@tsed/di"; + import {PlatformContext} from "../domain/PlatformContext.js"; export function ensureContext(request: any, cb: ($ctx: PlatformContext) => any, fallback?: () => void) { diff --git a/packages/platform/common/src/utils/getConfiguration.spec.ts b/packages/platform/common/src/utils/getConfiguration.spec.ts index 44eae11c0a8..d8d7880a6a5 100644 --- a/packages/platform/common/src/utils/getConfiguration.spec.ts +++ b/packages/platform/common/src/utils/getConfiguration.spec.ts @@ -1,6 +1,7 @@ +import {Env} from "@tsed/core"; import {Configuration} from "@tsed/di"; + import {getConfiguration} from "./getConfiguration.js"; -import {Env} from "@tsed/core"; class MyCtrl {} diff --git a/packages/platform/common/src/utils/getStaticsOptions.ts b/packages/platform/common/src/utils/getStaticsOptions.ts index b5a12f37e4d..640ea6e8b5e 100644 --- a/packages/platform/common/src/utils/getStaticsOptions.ts +++ b/packages/platform/common/src/utils/getStaticsOptions.ts @@ -1,4 +1,5 @@ import {getValue} from "@tsed/core"; + import {PlatformStaticsOptions, PlatformStaticsSettings} from "../config/interfaces/PlatformStaticsSettings.js"; function mapOptions(options: any): any { diff --git a/packages/platform/common/src/utils/printRoutes.ts b/packages/platform/common/src/utils/printRoutes.ts index 9bb5100457d..83e6b026d67 100644 --- a/packages/platform/common/src/utils/printRoutes.ts +++ b/packages/platform/common/src/utils/printRoutes.ts @@ -1,4 +1,5 @@ import {$log, colorize} from "@tsed/logger"; + import {PlatformRouteDetails} from "../domain/PlatformRouteDetails.js"; export function printRoutes(routes: PlatformRouteDetails[]) { diff --git a/packages/platform/common/src/utils/registerPlatformAdapter.ts b/packages/platform/common/src/utils/registerPlatformAdapter.ts index 7dbbfc84950..ef394741807 100644 --- a/packages/platform/common/src/utils/registerPlatformAdapter.ts +++ b/packages/platform/common/src/utils/registerPlatformAdapter.ts @@ -1,4 +1,5 @@ import {Type} from "@tsed/core"; + import {PlatformBuilder} from "../builder/PlatformBuilder.js"; import {PlatformAdapter} from "../services/PlatformAdapter.js"; import {PlatformTest} from "../services/PlatformTest.js"; diff --git a/packages/platform/common/src/utils/setResponseHeaders.spec.ts b/packages/platform/common/src/utils/setResponseHeaders.spec.ts index c7d1188cbcd..ddcbb5c5cbe 100644 --- a/packages/platform/common/src/utils/setResponseHeaders.spec.ts +++ b/packages/platform/common/src/utils/setResponseHeaders.spec.ts @@ -1,4 +1,5 @@ import {EndpointMetadata, Get, Redirect, Returns} from "@tsed/schema"; + import {PlatformTest} from "../services/PlatformTest.js"; import {setResponseHeaders} from "./setResponseHeaders.js"; @@ -9,7 +10,7 @@ describe("setResponseHeaders", () => { it("should set headers, status and contentType", async () => { class Test { @Get("/") - @Returns(200).Header("x-header", "test") + @(Returns(200).Header("x-header", "test")) test() {} } @@ -26,7 +27,7 @@ describe("setResponseHeaders", () => { it("should not set headers automatically if the value isn't declared", async () => { class Test { @Get("/") - @Returns(200).Header("x-header") + @(Returns(200).Header("x-header")) test() {} } @@ -57,13 +58,13 @@ describe("setResponseHeaders", () => { await setResponseHeaders(ctx); // THEN - expect(ctx.response.redirect).toBeCalledWith(301, "/path"); + expect(ctx.response.redirect).toHaveBeenCalledWith(301, "/path"); }); it("should do nothing when headers is already sent", async () => { class Test { @Get("/") - @Returns(200).Header("x-header", "test") + @(Returns(200).Header("x-header", "test")) test() {} } @@ -78,6 +79,6 @@ describe("setResponseHeaders", () => { await setResponseHeaders(ctx); // THEN - return expect(ctx.response.raw.set).not.toBeCalled(); + return expect(ctx.response.raw.set).not.toHaveBeenCalled(); }); }); diff --git a/packages/platform/common/test/integration/groups.spec.ts b/packages/platform/common/test/integration/groups.spec.ts index 5746cf02b2e..5dfb586f797 100644 --- a/packages/platform/common/test/integration/groups.spec.ts +++ b/packages/platform/common/test/integration/groups.spec.ts @@ -1,5 +1,5 @@ import "@tsed/ajv"; -import {BodyParams, Configuration, Controller, Get, PlatformTest} from "@tsed/common"; + import {JsonMapperSettings} from "@tsed/json-mapper"; import {PlatformExpress} from "@tsed/platform-express"; import {PlatformTestSdk} from "@tsed/platform-test-sdk"; @@ -10,6 +10,8 @@ import cookieParser from "cookie-parser"; import methodOverride from "method-override"; import SuperTest from "supertest"; +import {BodyParams, Configuration, Controller, Get, PlatformTest} from "../.."; + const rootDir = import.meta.dirname; class MyModel { @@ -47,7 +49,7 @@ class GroupsIntegrationController { } @Get("/scenario-2") - @Returns(200, MyModel).Groups("summary") + @(Returns(200, MyModel).Groups("summary")) scenario2() { return new MyModel({ id: "id", @@ -58,7 +60,7 @@ class GroupsIntegrationController { } @Get("/scenario-3") - @Returns(200, MyModel).Groups("creation") + @(Returns(200, MyModel).Groups("creation")) scenario3() { return new MyModel({ id: "id", diff --git a/packages/platform/common/test/integration/platform.spec.ts b/packages/platform/common/test/integration/platform.spec.ts index 104dafe55fd..c5ff5a9f1d2 100644 --- a/packages/platform/common/test/integration/platform.spec.ts +++ b/packages/platform/common/test/integration/platform.spec.ts @@ -1,5 +1,5 @@ import "@tsed/ajv"; -import {Configuration, Controller, Get, PlatformTest} from "@tsed/common"; + import {PlatformExpress} from "@tsed/platform-express"; import {PlatformTestSdk} from "@tsed/platform-test-sdk"; import bodyParser from "body-parser"; @@ -8,6 +8,8 @@ import cookieParser from "cookie-parser"; import methodOverride from "method-override"; import SuperTest from "supertest"; +import {Configuration, Controller, Get, PlatformTest} from "../.."; + const rootDir = import.meta.dirname; @Controller("/hello") diff --git a/packages/platform/common/test/integration/returns.spec.integration.spec.ts b/packages/platform/common/test/integration/returns.spec.integration.spec.ts index f7d23f54169..058cd9cb02b 100644 --- a/packages/platform/common/test/integration/returns.spec.integration.spec.ts +++ b/packages/platform/common/test/integration/returns.spec.integration.spec.ts @@ -1,4 +1,5 @@ import {getSpec, Returns, SpecTypes} from "@tsed/schema"; + import {Get} from "../../src/index.js"; describe("@Returns", () => { @@ -6,7 +7,7 @@ describe("@Returns", () => { // WHEN class Controller { @Get("/") - @Returns(200, String).ContentType("text/plain") + @(Returns(200, String).ContentType("text/plain")) method() {} } diff --git a/packages/platform/common/test/integration/route.spec.ts b/packages/platform/common/test/integration/route.spec.ts index b86daf2bcc7..37521c2ff5c 100644 --- a/packages/platform/common/test/integration/route.spec.ts +++ b/packages/platform/common/test/integration/route.spec.ts @@ -1,6 +1,7 @@ -import {All, Delete, EndpointMetadata, Get, Head, Options, Patch, Post, Put} from "@tsed/common"; import {OperationVerbs} from "@tsed/schema"; +import {All, Delete, EndpointMetadata, Get, Head, Options, Patch, Post, Put} from "../.."; + const middleware: any = vi.fn(); const useStub: any = vi.fn().mockReturnValue(middleware); diff --git a/packages/platform/common/tsconfig.esm.json b/packages/platform/common/tsconfig.esm.json index e3b07081667..82292550ddb 100644 --- a/packages/platform/common/tsconfig.esm.json +++ b/packages/platform/common/tsconfig.esm.json @@ -2,8 +2,7 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "module": "ESNext", - "moduleResolution": "nodenext", + "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", @@ -11,7 +10,7 @@ "composite": true, "noEmit": false }, - "include": ["src", "src/**/*.json"], + "include": ["src/**/*.ts", "src/**/*.json"], "exclude": [ "node_modules", "test", diff --git a/packages/platform/common/tsconfig.spec.json b/packages/platform/common/tsconfig.spec.json index 5b0a6167ef0..974b8893abe 100644 --- a/packages/platform/common/tsconfig.spec.json +++ b/packages/platform/common/tsconfig.spec.json @@ -3,7 +3,6 @@ "compilerOptions": { "baseUrl": ".", "rootDir": "../..", - "module": "commonjs", "outDir": "./lib/cjs", "declaration": false, "composite": false, diff --git a/packages/platform/platform-cache/package.json b/packages/platform/platform-cache/package.json index 66a64ddc866..03d2e635251 100644 --- a/packages/platform/platform-cache/package.json +++ b/packages/platform/platform-cache/package.json @@ -35,7 +35,7 @@ "@tsed/typescript": "workspace:*", "@types/micromatch": "^4.0.6", "eslint": "^8.57.0", - "typescript": "4.9.5", + "typescript": "5.6.2", "vitest": "2.0.4" }, "peerDependencies": { diff --git a/packages/platform/platform-cache/src/decorators/useCache.ts b/packages/platform/platform-cache/src/decorators/useCache.ts index d44d3e3f45b..e9e192dc6f8 100644 --- a/packages/platform/platform-cache/src/decorators/useCache.ts +++ b/packages/platform/platform-cache/src/decorators/useCache.ts @@ -1,4 +1,5 @@ import {Intercept} from "@tsed/di"; + import {PlatformCacheInterceptor} from "../interceptors/PlatformCacheInterceptor.js"; import {PlatformCacheOptions} from "../interfaces/PlatformCacheOptions.js"; diff --git a/packages/platform/platform-cache/src/interceptors/PlatformCacheInterceptor.spec.ts b/packages/platform/platform-cache/src/interceptors/PlatformCacheInterceptor.spec.ts index a7c57638439..001e772fa6e 100644 --- a/packages/platform/platform-cache/src/interceptors/PlatformCacheInterceptor.spec.ts +++ b/packages/platform/platform-cache/src/interceptors/PlatformCacheInterceptor.spec.ts @@ -1,6 +1,7 @@ import {PlatformTest} from "@tsed/common"; import {isClass} from "@tsed/core"; import {serialize} from "@tsed/json-mapper"; + import {UseCache} from "../decorators/useCache.js"; import {PlatformCache} from "../services/PlatformCache.js"; import {isEndpoint} from "../utils/isEndpoint.js"; @@ -275,7 +276,7 @@ describe("PlatformCacheInterceptor", () => { expect(result).toEqual({ data: "refreshed" }); - expect(interceptor.canRefreshInBackground).not.toBeCalled(); + expect(interceptor.canRefreshInBackground).not.toHaveBeenCalled(); expect(cache.setCachedObject).toHaveBeenCalledWith( "Test:test:value", {data: "refreshed"}, diff --git a/packages/platform/platform-cache/src/interceptors/PlatformCacheInterceptor.ts b/packages/platform/platform-cache/src/interceptors/PlatformCacheInterceptor.ts index 7d81ebc8895..b3d50fcce07 100644 --- a/packages/platform/platform-cache/src/interceptors/PlatformCacheInterceptor.ts +++ b/packages/platform/platform-cache/src/interceptors/PlatformCacheInterceptor.ts @@ -3,6 +3,7 @@ import {BaseContext, Constant, DIContext, Inject, Interceptor, InterceptorContex 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"; import {PlatformCache} from "../services/PlatformCache.js"; diff --git a/packages/platform/platform-cache/src/interfaces/PlatformCacheOptions.ts b/packages/platform/platform-cache/src/interfaces/PlatformCacheOptions.ts index e5f560ea4aa..94a6cc53f91 100644 --- a/packages/platform/platform-cache/src/interfaces/PlatformCacheOptions.ts +++ b/packages/platform/platform-cache/src/interfaces/PlatformCacheOptions.ts @@ -1,5 +1,6 @@ import {MetadataTypes} from "@tsed/core"; import {BaseContext} from "@tsed/di"; + import type {Ttl} from "../services/PlatformCache.js"; export interface PlatformCacheOptions extends MetadataTypes { diff --git a/packages/platform/platform-cache/src/interfaces/interfaces.ts b/packages/platform/platform-cache/src/interfaces/interfaces.ts index f57d088bebd..31b74ed9a37 100644 --- a/packages/platform/platform-cache/src/interfaces/interfaces.ts +++ b/packages/platform/platform-cache/src/interfaces/interfaces.ts @@ -1,6 +1,7 @@ import type {BaseContext} from "@tsed/di"; import type {Cache, CachingConfig, Store} from "cache-manager"; import type {FactoryStore} from "cache-manager/dist/caching.js"; + import type {CacheManager} from "../services/PlatformCache.js"; export type PlatformCacheSettings = any, S extends Store = any> = CachingConfig & { @@ -21,7 +22,6 @@ export type PlatformCacheSettings = any, S ex }; declare global { - // eslint-disable-next-line @typescript-eslint/no-namespace namespace TsED { interface Configuration { cache?: PlatformCacheSettings | false; diff --git a/packages/platform/platform-cache/src/services/PlatformCache.spec.ts b/packages/platform/platform-cache/src/services/PlatformCache.spec.ts index 1b0174e3988..e9b0c7d997b 100644 --- a/packages/platform/platform-cache/src/services/PlatformCache.spec.ts +++ b/packages/platform/platform-cache/src/services/PlatformCache.spec.ts @@ -1,5 +1,6 @@ import {PlatformTest} from "@tsed/common"; import {caching as cacheManager, multiCaching} from "cache-manager"; + import {UseCache} from "../decorators/useCache.js"; import {getPrefix} from "../utils/getPrefix.js"; import {PlatformCache} from "./PlatformCache.js"; diff --git a/packages/platform/platform-cache/src/services/PlatformCache.ts b/packages/platform/platform-cache/src/services/PlatformCache.ts index e784be88987..7ce62faafd6 100644 --- a/packages/platform/platform-cache/src/services/PlatformCache.ts +++ b/packages/platform/platform-cache/src/services/PlatformCache.ts @@ -4,6 +4,7 @@ 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"; import {PlatformCachedObject} from "../interfaces/PlatformCachedObject.js"; import {getPrefix} from "../utils/getPrefix.js"; @@ -182,7 +183,7 @@ export class PlatformCache { protected async createCacheManager(settings: PlatformCacheSettings) { const {caches, store = "memory", ttl, ...props} = settings; - // eslint-disable-next-line @typescript-eslint/no-unused-vars + const {multiCaching, caching} = await import("cache-manager"); return caches?.length diff --git a/packages/platform/platform-cache/src/utils/getPrefix.ts b/packages/platform/platform-cache/src/utils/getPrefix.ts index f1170388c77..189f1ff53b2 100644 --- a/packages/platform/platform-cache/src/utils/getPrefix.ts +++ b/packages/platform/platform-cache/src/utils/getPrefix.ts @@ -1,5 +1,6 @@ import {nameOf, Type} from "@tsed/core"; import {getInterceptorOptions} from "@tsed/di"; + import type {PlatformCacheOptions} from "../interfaces/PlatformCacheOptions.js"; export function getPrefix(target: Type, propertyKey: string | symbol) { diff --git a/packages/platform/platform-cache/test/cache.integration.spec.ts b/packages/platform/platform-cache/test/cache.integration.spec.ts index 21a73d118c7..a1694fa8bf1 100644 --- a/packages/platform/platform-cache/test/cache.integration.spec.ts +++ b/packages/platform/platform-cache/test/cache.integration.spec.ts @@ -1,6 +1,7 @@ import {Controller, Get, Head, Inject, PathParams, PlatformTest, Post, QueryParams} from "@tsed/common"; import {Property} from "@tsed/schema"; import SuperTest from "supertest"; + import {Server} from "../../platform-express/test/app/Server.js"; import {PlatformCache, UseCache} from "../src/index.js"; diff --git a/packages/platform/platform-cache/tsconfig.esm.json b/packages/platform/platform-cache/tsconfig.esm.json index e3b07081667..82292550ddb 100644 --- a/packages/platform/platform-cache/tsconfig.esm.json +++ b/packages/platform/platform-cache/tsconfig.esm.json @@ -2,8 +2,7 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "module": "ESNext", - "moduleResolution": "nodenext", + "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", @@ -11,7 +10,7 @@ "composite": true, "noEmit": false }, - "include": ["src", "src/**/*.json"], + "include": ["src/**/*.ts", "src/**/*.json"], "exclude": [ "node_modules", "test", diff --git a/packages/platform/platform-cache/tsconfig.spec.json b/packages/platform/platform-cache/tsconfig.spec.json index a317d7f0cf2..4d23ed17f17 100644 --- a/packages/platform/platform-cache/tsconfig.spec.json +++ b/packages/platform/platform-cache/tsconfig.spec.json @@ -3,7 +3,6 @@ "compilerOptions": { "baseUrl": ".", "rootDir": "../..", - "module": "commonjs", "outDir": "./lib/cjs", "declaration": false, "composite": false, diff --git a/packages/platform/platform-exceptions/package.json b/packages/platform/platform-exceptions/package.json index 2a3ea4aee2d..361b113fd5f 100644 --- a/packages/platform/platform-exceptions/package.json +++ b/packages/platform/platform-exceptions/package.json @@ -32,7 +32,7 @@ "@tsed/schema": "workspace:*", "@tsed/typescript": "workspace:*", "eslint": "^8.57.0", - "typescript": "4.9.5", + "typescript": "5.6.2", "vitest": "2.0.4" }, "peerDependencies": { diff --git a/packages/platform/platform-exceptions/src/components/ErrorFilter.ts b/packages/platform/platform-exceptions/src/components/ErrorFilter.ts index d9ef87881e1..085a3f7f97e 100644 --- a/packages/platform/platform-exceptions/src/components/ErrorFilter.ts +++ b/packages/platform/platform-exceptions/src/components/ErrorFilter.ts @@ -1,5 +1,6 @@ import {Env} from "@tsed/core"; import {BaseContext} from "@tsed/di"; + import {Catch} from "../decorators/catch.js"; import type {ExceptionFilterMethods} from "../interfaces/ExceptionFilterMethods.js"; diff --git a/packages/platform/platform-exceptions/src/components/ExceptionFilter.ts b/packages/platform/platform-exceptions/src/components/ExceptionFilter.ts index 55c2bcb80d9..09d7dba8800 100644 --- a/packages/platform/platform-exceptions/src/components/ExceptionFilter.ts +++ b/packages/platform/platform-exceptions/src/components/ExceptionFilter.ts @@ -1,5 +1,6 @@ import {BaseContext} from "@tsed/di"; import {Exception} from "@tsed/exceptions"; + import {Catch} from "../decorators/catch.js"; import {ErrorFilter} from "./ErrorFilter.js"; diff --git a/packages/platform/platform-exceptions/src/components/MongooseErrorFilter.ts b/packages/platform/platform-exceptions/src/components/MongooseErrorFilter.ts index f8df23a13b1..e170cb9777c 100644 --- a/packages/platform/platform-exceptions/src/components/MongooseErrorFilter.ts +++ b/packages/platform/platform-exceptions/src/components/MongooseErrorFilter.ts @@ -1,5 +1,6 @@ import {BaseContext} from "@tsed/di"; import {BadRequest} from "@tsed/exceptions"; + import {Catch} from "../decorators/catch.js"; import {ErrorFilter} from "./ErrorFilter.js"; diff --git a/packages/platform/platform-exceptions/src/components/StringErrorFilter.spec.ts b/packages/platform/platform-exceptions/src/components/StringErrorFilter.spec.ts index e7ed6be6350..e88319bb46a 100644 --- a/packages/platform/platform-exceptions/src/components/StringErrorFilter.spec.ts +++ b/packages/platform/platform-exceptions/src/components/StringErrorFilter.spec.ts @@ -1,4 +1,5 @@ import {PlatformTest} from "@tsed/common"; + import {StringErrorFilter} from "./StringErrorFilter.js"; describe("StringErrorFilter", () => { diff --git a/packages/platform/platform-exceptions/src/components/StringErrorFilter.ts b/packages/platform/platform-exceptions/src/components/StringErrorFilter.ts index 15f9de3628e..bf202616966 100644 --- a/packages/platform/platform-exceptions/src/components/StringErrorFilter.ts +++ b/packages/platform/platform-exceptions/src/components/StringErrorFilter.ts @@ -1,4 +1,5 @@ import {BaseContext} from "@tsed/di"; + import {Catch} from "../decorators/catch.js"; import type {ExceptionFilterMethods} from "../interfaces/ExceptionFilterMethods.js"; diff --git a/packages/platform/platform-exceptions/src/decorators/catch.ts b/packages/platform/platform-exceptions/src/decorators/catch.ts index 3e899cbc64b..b31ef8443ea 100644 --- a/packages/platform/platform-exceptions/src/decorators/catch.ts +++ b/packages/platform/platform-exceptions/src/decorators/catch.ts @@ -1,5 +1,6 @@ import {Type} from "@tsed/core"; import {registerProvider} from "@tsed/di"; + import {registerExceptionType} from "../domain/ExceptionFiltersContainer.js"; /** diff --git a/packages/platform/platform-exceptions/src/domain/ExceptionFiltersContainer.ts b/packages/platform/platform-exceptions/src/domain/ExceptionFiltersContainer.ts index 511e8041999..e8a5ca1bb9d 100644 --- a/packages/platform/platform-exceptions/src/domain/ExceptionFiltersContainer.ts +++ b/packages/platform/platform-exceptions/src/domain/ExceptionFiltersContainer.ts @@ -1,4 +1,5 @@ import {Type} from "@tsed/core"; + import type {ExceptionFilterMethods} from "../interfaces/ExceptionFilterMethods.js"; /** * @ignore diff --git a/packages/platform/platform-exceptions/src/domain/ExceptionSchema.spec.ts b/packages/platform/platform-exceptions/src/domain/ExceptionSchema.spec.ts index 9a57588bba4..70ef786b364 100644 --- a/packages/platform/platform-exceptions/src/domain/ExceptionSchema.spec.ts +++ b/packages/platform/platform-exceptions/src/domain/ExceptionSchema.spec.ts @@ -1,9 +1,10 @@ +import "./ExceptionSchema"; + import SwaggerParser from "@apidevtools/swagger-parser"; import {BadRequest, Exception} from "@tsed/exceptions"; import {getJsonSchema, getSpec, OperationPath, Path, Returns, SpecTypes} from "@tsed/schema"; import Ajv from "ajv"; import fs from "fs-extra"; -import "./ExceptionSchema"; const rootDir = import.meta.dirname; @@ -122,7 +123,7 @@ describe("ExceptionSchema", () => { @Path("/") class MyController { @OperationPath("GET", "/") - @Returns(400, BadRequest).Description("BadRequest") + @(Returns(400, BadRequest).Description("BadRequest")) get() {} } diff --git a/packages/platform/platform-exceptions/src/services/PlatformExceptions.spec.ts b/packages/platform/platform-exceptions/src/services/PlatformExceptions.spec.ts index 63d1e918461..03cd081973f 100644 --- a/packages/platform/platform-exceptions/src/services/PlatformExceptions.spec.ts +++ b/packages/platform/platform-exceptions/src/services/PlatformExceptions.spec.ts @@ -1,6 +1,7 @@ import {PlatformTest, ValidationError} from "@tsed/common"; import {Env} from "@tsed/core"; import {BadRequest} from "@tsed/exceptions"; + import {PlatformExceptions} from "./PlatformExceptions.js"; describe("PlatformExceptions", () => { @@ -24,7 +25,7 @@ describe("PlatformExceptions", () => { platformExceptions.catch(error, ctx); - expect(ctx.response.body).toBeCalledWith("MyError"); + expect(ctx.response.body).toHaveBeenCalledWith("MyError"); }); it("should map exception", () => { const middleware = PlatformTest.get(PlatformExceptions); @@ -49,8 +50,8 @@ describe("PlatformExceptions", () => { middleware.catch(error, ctx); - expect(ctx.response.setHeaders).toBeCalledWith({"x-path": "id"}); - expect(ctx.response.body).toBeCalledWith({ + expect(ctx.response.setHeaders).toHaveBeenCalledWith({"x-path": "id"}); + expect(ctx.response.body).toHaveBeenCalledWith({ errors: [ { error: "format", @@ -78,8 +79,8 @@ describe("PlatformExceptions", () => { middleware.catch(error, ctx); - expect(ctx.response.setHeaders).toBeCalledWith({}); - expect(ctx.response.body).toBeCalledWith({ + expect(ctx.response.setHeaders).toHaveBeenCalledWith({}); + expect(ctx.response.body).toHaveBeenCalledWith({ errors: [], message: "My message", name: "Error", @@ -102,8 +103,8 @@ describe("PlatformExceptions", () => { middleware.catch(error, ctx); - expect(ctx.response.setHeaders).toBeCalledWith({}); - expect(ctx.response.body).toBeCalledWith({ + expect(ctx.response.setHeaders).toHaveBeenCalledWith({}); + expect(ctx.response.body).toHaveBeenCalledWith({ errors: [], message: "My message, innerException: My message", name: "Error", @@ -128,7 +129,7 @@ describe("PlatformExceptions", () => { platformExceptions.catch(error, ctx); - expect(ctx.response.body).toBeCalledWith({ + expect(ctx.response.body).toHaveBeenCalledWith({ errors: [], message: "request entity too large", name: "PayloadTooLargeError", @@ -158,8 +159,8 @@ describe("PlatformExceptions", () => { middleware.catch(error, ctx); - expect(ctx.response.setHeaders).toBeCalledWith({}); - expect(ctx.response.body).toBeCalledWith("InternalServerError"); + expect(ctx.response.setHeaders).toHaveBeenCalledWith({}); + expect(ctx.response.body).toHaveBeenCalledWith("InternalServerError"); }); }); describe("resourceNotFound()", () => { @@ -182,8 +183,8 @@ describe("PlatformExceptions", () => { middleware.resourceNotFound(ctx); - expect(ctx.response.setHeaders).toBeCalledWith({}); - expect(ctx.response.body).toBeCalledWith({ + expect(ctx.response.setHeaders).toHaveBeenCalledWith({}); + expect(ctx.response.body).toHaveBeenCalledWith({ errors: [], message: 'Resource "url" not found', name: "NOT_FOUND", diff --git a/packages/platform/platform-exceptions/src/services/PlatformExceptions.ts b/packages/platform/platform-exceptions/src/services/PlatformExceptions.ts index bb129423263..242256ed2cf 100644 --- a/packages/platform/platform-exceptions/src/services/PlatformExceptions.ts +++ b/packages/platform/platform-exceptions/src/services/PlatformExceptions.ts @@ -1,5 +1,6 @@ import {ancestorsOf, classOf, nameOf} from "@tsed/core"; import {BaseContext, DIContext, Inject, Injectable, InjectorService} from "@tsed/di"; + import {ErrorFilter} from "../components/ErrorFilter.js"; import {ExceptionFilter} from "../components/ExceptionFilter.js"; import {MongooseErrorFilter} from "../components/MongooseErrorFilter.js"; diff --git a/packages/platform/platform-exceptions/tsconfig.esm.json b/packages/platform/platform-exceptions/tsconfig.esm.json index e3b07081667..82292550ddb 100644 --- a/packages/platform/platform-exceptions/tsconfig.esm.json +++ b/packages/platform/platform-exceptions/tsconfig.esm.json @@ -2,8 +2,7 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "module": "ESNext", - "moduleResolution": "nodenext", + "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", @@ -11,7 +10,7 @@ "composite": true, "noEmit": false }, - "include": ["src", "src/**/*.json"], + "include": ["src/**/*.ts", "src/**/*.json"], "exclude": [ "node_modules", "test", diff --git a/packages/platform/platform-exceptions/tsconfig.spec.json b/packages/platform/platform-exceptions/tsconfig.spec.json index a78b965aabb..78f0e04e468 100644 --- a/packages/platform/platform-exceptions/tsconfig.spec.json +++ b/packages/platform/platform-exceptions/tsconfig.spec.json @@ -3,7 +3,6 @@ "compilerOptions": { "baseUrl": ".", "rootDir": "../..", - "module": "commonjs", "outDir": "./lib/cjs", "declaration": false, "composite": false, diff --git a/packages/platform/platform-express/package.json b/packages/platform/platform-express/package.json index c58d34a6897..e2526ddca13 100644 --- a/packages/platform/platform-express/package.json +++ b/packages/platform/platform-express/package.json @@ -85,7 +85,7 @@ "eslint": "^8.57.0", "express-session": "1.18.0", "method-override": "3.0.0", - "typescript": "4.9.5", + "typescript": "5.6.2", "vitest": "2.0.4" }, "peerDependencies": { diff --git a/packages/platform/platform-express/src/components/PlatformExpress.spec.ts b/packages/platform/platform-express/src/components/PlatformExpress.spec.ts index e8fe0ee8b32..a7cd5fb6d5a 100644 --- a/packages/platform/platform-express/src/components/PlatformExpress.spec.ts +++ b/packages/platform/platform-express/src/components/PlatformExpress.spec.ts @@ -22,7 +22,7 @@ describe("PlatformExpress", () => { beforeEach(() => { vi.resetAllMocks(); }); - it("should return the body parser (json) ", () => { + it("should return the body parser (json)", () => { const stub = vi.fn().mockReturnValue("body"); const platform = PlatformExpress.create(Server, { @@ -36,9 +36,9 @@ describe("PlatformExpress", () => { const result = platform.adapter.bodyParser("json", {strict: true}); expect(result).toEqual("body"); - expect(stub).toBeCalledWith({strict: true, verify: expect.any(Function)}); + expect(stub).toHaveBeenCalledWith({strict: true, verify: expect.any(Function)}); }); - it("should return the body parser (urlencoded) ", () => { + it("should return the body parser (urlencoded)", () => { const stub = vi.fn().mockReturnValue("body"); const platform = PlatformExpress.create(Server, { @@ -52,7 +52,7 @@ describe("PlatformExpress", () => { const result = platform.adapter.bodyParser("urlencoded", {strict: true}); expect(result).toEqual("body"); - expect(stub).toBeCalledWith({extended: true, strict: true, verify: expect.any(Function)}); + expect(stub).toHaveBeenCalledWith({extended: true, strict: true, verify: expect.any(Function)}); }); }); }); diff --git a/packages/platform/platform-express/src/components/PlatformExpress.ts b/packages/platform/platform-express/src/components/PlatformExpress.ts index a58db436ac6..40f4c101095 100644 --- a/packages/platform/platform-express/src/components/PlatformExpress.ts +++ b/packages/platform/platform-express/src/components/PlatformExpress.ts @@ -21,6 +21,7 @@ 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"; import {PlatformExpressHandler} from "../services/PlatformExpressHandler.js"; diff --git a/packages/platform/platform-express/src/interfaces/PlatformExpressSettings.ts b/packages/platform/platform-express/src/interfaces/PlatformExpressSettings.ts index f179f95edb5..3aea1892075 100644 --- a/packages/platform/platform-express/src/interfaces/PlatformExpressSettings.ts +++ b/packages/platform/platform-express/src/interfaces/PlatformExpressSettings.ts @@ -1,6 +1,6 @@ -import type {RouterOptions} from "express"; -import type {OptionsJson, OptionsText, Options, OptionsUrlencoded} from "body-parser"; +import type {Options, OptionsJson, OptionsText, OptionsUrlencoded} from "body-parser"; import type {NextHandleFunction} from "connect"; +import type {RouterOptions} from "express"; export interface PlatformExpressSettings { /** diff --git a/packages/platform/platform-express/src/interfaces/interfaces.ts b/packages/platform/platform-express/src/interfaces/interfaces.ts index 0cc55f49317..48fe40c793d 100644 --- a/packages/platform/platform-express/src/interfaces/interfaces.ts +++ b/packages/platform/platform-express/src/interfaces/interfaces.ts @@ -1,4 +1,5 @@ import {NextFunction as ENext, Request as EReq, Response as ERes} from "express"; + import {PlatformExpressSettings} from "./PlatformExpressSettings.js"; declare global { diff --git a/packages/platform/platform-express/src/middlewares/staticsMiddleware.spec.ts b/packages/platform/platform-express/src/middlewares/staticsMiddleware.spec.ts index 19cbc93a0f3..cdff6fe5523 100644 --- a/packages/platform/platform-express/src/middlewares/staticsMiddleware.spec.ts +++ b/packages/platform/platform-express/src/middlewares/staticsMiddleware.spec.ts @@ -1,4 +1,5 @@ import Express from "express"; + import {staticsMiddleware} from "./staticsMiddleware.js"; describe("staticsMiddleware", () => { @@ -15,7 +16,7 @@ describe("staticsMiddleware", () => { const middleware = staticsMiddleware("/path", {root: "/publics", test: "test"}); middleware(req, res, next); - expect(middlewareServeStatic).toBeCalledWith(req, res, next); + expect(middlewareServeStatic).toHaveBeenCalledWith(req, res, next); }); it("should call next when headers is sent", () => { const middlewareServeStatic = vi.fn(); @@ -29,6 +30,6 @@ describe("staticsMiddleware", () => { const middleware = staticsMiddleware("/path", {root: "/publics", test: "test"}); middleware(req, res, next); - expect(next).toBeCalled(); + expect(next).toHaveBeenCalled(); }); }); diff --git a/packages/platform/platform-express/test/ajv-errors.spec.ts b/packages/platform/platform-express/test/ajv-errors.spec.ts index b621de04fb6..7a1c348d574 100644 --- a/packages/platform/platform-express/test/ajv-errors.spec.ts +++ b/packages/platform/platform-express/test/ajv-errors.spec.ts @@ -1,8 +1,10 @@ import "@tsed/ajv"; + import {BodyParams, Controller, PlatformTest, Post} from "@tsed/common"; import {PlatformTestSdk} from "@tsed/platform-test-sdk"; import {DefaultMsg, ErrorMsg, Integer, Property, Required, TypeError} from "@tsed/schema"; import SuperTest from "supertest"; + import {PlatformExpress} from "../src/index.js"; import {rootDir, Server} from "./app/Server.js"; @@ -14,7 +16,7 @@ const utils = PlatformTestSdk.create({ @DefaultMsg("this is a default message") class MyModel { - @Required().Error("this is a required variable") + @(Required().Error("this is a required variable")) test: string; @Integer() diff --git a/packages/platform/platform-express/test/app/Server.ts b/packages/platform/platform-express/test/app/Server.ts index bb72e584d0c..777d414170d 100644 --- a/packages/platform/platform-express/test/app/Server.ts +++ b/packages/platform/platform-express/test/app/Server.ts @@ -1,12 +1,12 @@ import "@tsed/ajv"; +import "../../src/index.js"; + import {Constant, PlatformApplication} from "@tsed/common"; import {Configuration, Inject} from "@tsed/di"; import compress from "compression"; import {Application} from "express"; import session from "express-session"; -import "../../src/index.js"; - const rootDir = import.meta.dirname; export {rootDir}; diff --git a/packages/platform/platform-express/test/app/emulate.ts b/packages/platform/platform-express/test/app/emulate.ts index faa38468ef1..dd389cafbaf 100644 --- a/packages/platform/platform-express/test/app/emulate.ts +++ b/packages/platform/platform-express/test/app/emulate.ts @@ -1,9 +1,10 @@ +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"; -import {Controller} from "@tsed/di"; -import {Get} from "@tsed/schema"; -import {QueryParams} from "@tsed/platform-params"; @Controller("/hello") class HelloWorld { diff --git a/packages/platform/platform-express/test/app/index.ts b/packages/platform/platform-express/test/app/index.ts index 7cbd0220fbf..464d80698e2 100644 --- a/packages/platform/platform-express/test/app/index.ts +++ b/packages/platform/platform-express/test/app/index.ts @@ -1,7 +1,8 @@ import {$log, BodyParams, Controller, Get, PlatformResponse, Post, QueryParams, Res} from "@tsed/common"; import {Returns} from "@tsed/schema"; -import {promisify} from "util"; import {agent, SuperAgentStatic} from "superagent"; +import {promisify} from "util"; + import {PlatformExpress} from "../../src/index.js"; import {Server} from "./Server.js"; @@ -20,7 +21,7 @@ if (process.env.NODE_ENV !== "test") { } @Get("/image") - @Returns(200).Header("X-Content-Type-Options", "nosniff") + @(Returns(200).Header("X-Content-Type-Options", "nosniff")) async getGoogle(@Res() res: PlatformResponse) { const http: SuperAgentStatic = agent(); diff --git a/packages/platform/platform-express/test/array-body.spec.ts b/packages/platform/platform-express/test/array-body.spec.ts index db7b769f238..4815e39e646 100644 --- a/packages/platform/platform-express/test/array-body.spec.ts +++ b/packages/platform/platform-express/test/array-body.spec.ts @@ -1,8 +1,10 @@ import "@tsed/ajv"; + import {BodyParams, Controller, PlatformTest, Post} from "@tsed/common"; import {PlatformTestSdk} from "@tsed/platform-test-sdk"; -import {CollectionOf, Property, Any} from "@tsed/schema"; +import {Any, CollectionOf, Property} from "@tsed/schema"; import SuperTest from "supertest"; + import {PlatformExpress} from "../src/index.js"; import {rootDir, Server} from "./app/Server.js"; diff --git a/packages/platform/platform-express/test/discriminator.spec.ts b/packages/platform/platform-express/test/discriminator.spec.ts index 25c94f517d8..c67081f76c2 100644 --- a/packages/platform/platform-express/test/discriminator.spec.ts +++ b/packages/platform/platform-express/test/discriminator.spec.ts @@ -1,9 +1,11 @@ import "@tsed/ajv"; +import "@tsed/swagger"; + import {BodyParams, Controller, Patch, PlatformTest, Post} from "@tsed/common"; import {PlatformTestSdk} from "@tsed/platform-test-sdk"; import {DiscriminatorKey, DiscriminatorValue, OneOf, Partial, Property, Required, Returns} from "@tsed/schema"; -import "@tsed/swagger"; import SuperTest from "supertest"; + import {PlatformExpress} from "../src/index.js"; import {rootDir, Server} from "./app/Server.js"; @@ -41,14 +43,14 @@ type EventTypes = PageView | Action | CustomAction; @Controller("/discriminator") class TestDiscriminator { @Post("/scenario-1") - @Returns(200).OneOf(Event) + @(Returns(200).OneOf(Event)) scenario1(@BodyParams() @OneOf(Event) event: EventTypes) { expect(event).toBeInstanceOf(PageView); return event; } @Post("/scenario-2") - @Returns(200, Array).OneOf(Event) + @(Returns(200, Array).OneOf(Event)) scenario2(@BodyParams() @OneOf(Event) events: EventTypes[]) { expect(events[0]).toBeInstanceOf(PageView); expect(events[1]).toBeInstanceOf(Action); @@ -58,7 +60,7 @@ class TestDiscriminator { } @Patch("/scenario-3") - @Returns(200).OneOf(Event) + @(Returns(200).OneOf(Event)) scenario3(@BodyParams() @OneOf(Event) @Partial() event: EventTypes) { expect(event).toBeInstanceOf(PageView); return event; diff --git a/packages/platform/platform-express/test/enums.spec.ts b/packages/platform/platform-express/test/enums.spec.ts index 9e86d37b9d4..1315fe8671b 100644 --- a/packages/platform/platform-express/test/enums.spec.ts +++ b/packages/platform/platform-express/test/enums.spec.ts @@ -1,9 +1,11 @@ import "@tsed/ajv"; + import {Controller, Get, PlatformTest, QueryParams} from "@tsed/common"; import {Env} from "@tsed/core"; import {PlatformTestSdk} from "@tsed/platform-test-sdk"; import {Default, Enum, enums, getSpec, SpecTypes} from "@tsed/schema"; import SuperTest from "supertest"; + import {PlatformExpress} from "../src/index.js"; import {rootDir, Server} from "./app/Server.js"; diff --git a/packages/platform/platform-express/test/fullpayload.spec.ts b/packages/platform/platform-express/test/fullpayload.spec.ts index 905e807a38c..41a786678a6 100644 --- a/packages/platform/platform-express/test/fullpayload.spec.ts +++ b/packages/platform/platform-express/test/fullpayload.spec.ts @@ -1,8 +1,10 @@ -import {BodyParams, Controller, PlatformTest, Post} from "@tsed/common"; -import {PlatformTestSdk} from "@tsed/platform-test-sdk"; import fs from "node:fs/promises"; import {join} from "node:path"; + +import {BodyParams, Controller, PlatformTest, Post} from "@tsed/common"; +import {PlatformTestSdk} from "@tsed/platform-test-sdk"; import SuperTest from "supertest"; + import {PlatformExpress} from "../src/index.js"; import {rootDir, Server} from "./app/Server.js"; diff --git a/packages/platform/platform-express/test/groups.spec.ts b/packages/platform/platform-express/test/groups.spec.ts index 6a031d49aa3..845bec81ec8 100644 --- a/packages/platform/platform-express/test/groups.spec.ts +++ b/packages/platform/platform-express/test/groups.spec.ts @@ -1,9 +1,11 @@ import "@tsed/ajv"; + import {BodyParams, Controller, Get, PathParams, PlatformTest, Post, Put} from "@tsed/common"; import {deserialize} from "@tsed/json-mapper"; import {PlatformTestSdk} from "@tsed/platform-test-sdk"; import {getSpec, Groups, Property, Returns, SpecTypes} from "@tsed/schema"; import SuperTest from "supertest"; + import {PlatformExpress} from "../src/index.js"; import {rootDir, Server} from "./app/Server.js"; @@ -30,7 +32,7 @@ const utils = PlatformTestSdk.create({ @Controller("/groups") class TestGroupsCtrl { @Post("/") - @Returns(201, Product).Groups("group.*") + @(Returns(201, Product).Groups("group.*")) create(@BodyParams() @Groups("creation") payload: Product) { return deserialize( { @@ -50,7 +52,7 @@ class TestGroupsCtrl { } @Get("/:id") - @Returns(200, Product).Groups("group.summary") + @(Returns(200, Product).Groups("group.summary")) get(@PathParams("id") id: string) { return deserialize( { diff --git a/packages/platform/platform-express/test/merge-params.spec.ts b/packages/platform/platform-express/test/merge-params.spec.ts index 7e70ea84cfd..e4ab9635bf8 100644 --- a/packages/platform/platform-express/test/merge-params.spec.ts +++ b/packages/platform/platform-express/test/merge-params.spec.ts @@ -1,7 +1,8 @@ import {Controller, Get, PathParams, PlatformTest} from "@tsed/common"; -import {PlatformExpress} from "../src/index.js"; import {PlatformTestSdk} from "@tsed/platform-test-sdk"; import SuperTest from "supertest"; + +import {PlatformExpress} from "../src/index.js"; import {rootDir, Server} from "./app/Server.js"; const utils = PlatformTestSdk.create({ diff --git a/packages/platform/platform-express/test/middleware.spec.ts b/packages/platform/platform-express/test/middleware.spec.ts index 59357ff01c0..bd0ed192dbd 100644 --- a/packages/platform/platform-express/test/middleware.spec.ts +++ b/packages/platform/platform-express/test/middleware.spec.ts @@ -2,13 +2,14 @@ import {Controller, Get, PlatformTest} from "@tsed/common"; import {PlatformTestSdk} from "@tsed/platform-test-sdk"; import {Returns} from "@tsed/schema"; import SuperTest from "supertest"; + import {PlatformExpress} from "../src/components/PlatformExpress.js"; import {rootDir, Server} from "./app/Server.js"; @Controller("/middlewares") class TestMiddleware { @Get("/scenario-1") - @Returns(200).OneOf(Event) + @(Returns(200).OneOf(Event)) scenario1() { return (req: any, res: any, next: any) => { res.send("Hello"); diff --git a/packages/platform/platform-express/test/pageable.spec.ts b/packages/platform/platform-express/test/pageable.spec.ts index a396c2551ce..cdcd7259dad 100644 --- a/packages/platform/platform-express/test/pageable.spec.ts +++ b/packages/platform/platform-express/test/pageable.spec.ts @@ -21,6 +21,7 @@ import { } from "@tsed/schema"; import qs from "querystring"; import SuperTest from "supertest"; + import {PlatformExpress} from "../src/index.js"; import {rootDir, Server} from "./app/Server.js"; @@ -100,8 +101,8 @@ const utils = PlatformTestSdk.create({ @Controller("/pageable") class TestPageableCtrl { @Get("/") - @Returns(206, Pagination).Of(Product).Title("PaginatedProduct") - @Returns(200, Pagination).Of(Product).Title("PaginatedProduct") + @(Returns(206, Pagination).Of(Product).Title("PaginatedProduct")) + @(Returns(200, Pagination).Of(Product).Title("PaginatedProduct")) get(@QueryParams() pageableOptions: Pageable, @QueryParams("all") all: boolean) { return new Pagination({ data: [ diff --git a/packages/platform/platform-express/test/plain-text.spec.ts b/packages/platform/platform-express/test/plain-text.spec.ts index aa0ce99f2f5..775325a98be 100644 --- a/packages/platform/platform-express/test/plain-text.spec.ts +++ b/packages/platform/platform-express/test/plain-text.spec.ts @@ -2,6 +2,7 @@ import {Controller, Get, PlatformTest} from "@tsed/common"; import {PlatformTestSdk} from "@tsed/platform-test-sdk"; import {Returns} from "@tsed/schema"; import SuperTest from "supertest"; + import {PlatformExpress} from "../src/index.js"; import {rootDir, Server} from "./app/Server.js"; @@ -17,7 +18,7 @@ const utils = PlatformTestSdk.create({ @Controller("/plain-text") class TestResponseParamsCtrl { @Get("/scenario-1") - @Returns(200, String).ContentType("text/plain") + @(Returns(200, String).ContentType("text/plain")) test() { return { id: "id" diff --git a/packages/platform/platform-express/test/platform-express.spec.ts b/packages/platform/platform-express/test/platform-express.spec.ts index aa675f24352..2fdc390903c 100644 --- a/packages/platform/platform-express/test/platform-express.spec.ts +++ b/packages/platform/platform-express/test/platform-express.spec.ts @@ -1,4 +1,5 @@ import {PlatformTestSdk} from "@tsed/platform-test-sdk"; + import {PlatformExpress} from "../src/components/PlatformExpress.js"; import {rootDir, Server} from "./app/Server.js"; diff --git a/packages/platform/platform-express/test/query-parser.spec.ts b/packages/platform/platform-express/test/query-parser.spec.ts index 69e4dc73178..67e534de06a 100644 --- a/packages/platform/platform-express/test/query-parser.spec.ts +++ b/packages/platform/platform-express/test/query-parser.spec.ts @@ -1,9 +1,10 @@ -import {rootDir} from "./app/Server.js"; -import {PlatformTestSdk} from "@tsed/platform-test-sdk"; -import {PlatformExpress} from "../src/index.js"; -import SuperTest from "supertest"; import {Configuration, Controller, Get, Inject, PlatformApplication, PlatformTest, QueryParams} from "@tsed/common"; +import {PlatformTestSdk} from "@tsed/platform-test-sdk"; import {parse} from "querystring"; +import SuperTest from "supertest"; + +import {PlatformExpress} from "../src/index.js"; +import {rootDir} from "./app/Server.js"; @Configuration({ port: 8081 diff --git a/packages/platform/platform-express/test/response-filter.spec.ts b/packages/platform/platform-express/test/response-filter.spec.ts index f9b32ad5fc6..94626bceca5 100644 --- a/packages/platform/platform-express/test/response-filter.spec.ts +++ b/packages/platform/platform-express/test/response-filter.spec.ts @@ -3,6 +3,7 @@ import {PlatformTestSdk} from "@tsed/platform-test-sdk"; import {Returns} from "@tsed/schema"; import {ServerResponse} from "http"; import SuperTest from "supertest"; + import {PlatformExpress} from "../src/index.js"; import {rootDir, Server} from "./app/Server.js"; @@ -26,7 +27,7 @@ const utils = PlatformTestSdk.create({ @Controller("/response-filter") class TestPageableCtrl { @Get("/scenario-1") - @Returns(200).ContentType("image/png") + @(Returns(200).ContentType("image/png")) scenario1() { const raw = "..."; // response.setHeader('Content-Type', 'image/png'); @@ -68,13 +69,13 @@ describe("ResponseFilter", () => { const {headers} = await request.get("/rest/response-filter/scenario-1").expect(200); expect(headers["content-type"]).toEqual("image/png"); - expect(PlainTextFilter.prototype.transform).not.toBeCalled(); + expect(PlainTextFilter.prototype.transform).not.toHaveBeenCalled(); }); it("should return png (scenario-2)", async () => { const {headers} = await request.get("/rest/response-filter/scenario-2").expect(200); expect(headers["content-type"]).toEqual("image/png"); - expect(PlainTextFilter.prototype.transform).not.toBeCalled(); + expect(PlainTextFilter.prototype.transform).not.toHaveBeenCalled(); }); }); diff --git a/packages/platform/platform-express/test/validation-error.spec.ts b/packages/platform/platform-express/test/validation-error.spec.ts index 3586686e488..f11682db7ec 100644 --- a/packages/platform/platform-express/test/validation-error.spec.ts +++ b/packages/platform/platform-express/test/validation-error.spec.ts @@ -1,7 +1,8 @@ import {BodyParams, Controller, PlatformTest, Post, QueryParams} from "@tsed/common"; import {PlatformTestSdk} from "@tsed/platform-test-sdk"; -import {email, Email, Required} from "@tsed/schema"; +import {Email, email, Required} from "@tsed/schema"; import SuperTest from "supertest"; + import {PlatformExpress} from "../src/index.js"; import {rootDir, Server} from "./app/Server.js"; diff --git a/packages/platform/platform-express/tsconfig.esm.json b/packages/platform/platform-express/tsconfig.esm.json index e3b07081667..82292550ddb 100644 --- a/packages/platform/platform-express/tsconfig.esm.json +++ b/packages/platform/platform-express/tsconfig.esm.json @@ -2,8 +2,7 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "module": "ESNext", - "moduleResolution": "nodenext", + "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", @@ -11,7 +10,7 @@ "composite": true, "noEmit": false }, - "include": ["src", "src/**/*.json"], + "include": ["src/**/*.ts", "src/**/*.json"], "exclude": [ "node_modules", "test", diff --git a/packages/platform/platform-express/tsconfig.spec.json b/packages/platform/platform-express/tsconfig.spec.json index 3ee344bd2b9..33a5d9b533f 100644 --- a/packages/platform/platform-express/tsconfig.spec.json +++ b/packages/platform/platform-express/tsconfig.spec.json @@ -3,7 +3,6 @@ "compilerOptions": { "baseUrl": ".", "rootDir": "../..", - "module": "commonjs", "outDir": "./lib/cjs", "declaration": false, "composite": false, diff --git a/packages/platform/platform-koa/package.json b/packages/platform/platform-koa/package.json index b700be85ab3..dfec44b754e 100644 --- a/packages/platform/platform-koa/package.json +++ b/packages/platform/platform-koa/package.json @@ -80,7 +80,7 @@ "koa-override": "3.0.0", "koa-qs": "^3.0.0", "koa-session": "6.4.0", - "typescript": "4.9.5", + "typescript": "5.6.2", "vitest": "2.0.4" }, "dependencies": { diff --git a/packages/platform/platform-koa/src/components/PlatformKoa.spec.ts b/packages/platform/platform-koa/src/components/PlatformKoa.spec.ts index e315737259d..35df603b82e 100644 --- a/packages/platform/platform-koa/src/components/PlatformKoa.spec.ts +++ b/packages/platform/platform-koa/src/components/PlatformKoa.spec.ts @@ -18,7 +18,7 @@ describe("PlatformKoa", () => { }); }); describe("bodyParser()", () => { - it("should return the body parser (json) ", () => { + it("should return the body parser (json)", () => { const stub = vi.fn().mockReturnValue("body"); const platform = PlatformKoa.create(Server, { @@ -30,9 +30,9 @@ describe("PlatformKoa", () => { const result = platform.adapter.bodyParser("json", {strict: true}); expect(result).toEqual("body"); - expect(stub).toBeCalledWith({strict: true}); + expect(stub).toHaveBeenCalledWith({strict: true}); }); - it("should return the body parser (raw) ", () => { + it("should return the body parser (raw)", () => { const stub = vi.fn().mockReturnValue("body"); const platform = PlatformKoa.create(Server, { @@ -44,9 +44,9 @@ describe("PlatformKoa", () => { const result = platform.adapter.bodyParser("raw", {strict: true}); expect(result).toEqual("body"); - expect(stub).toBeCalledWith({strict: true}); + expect(stub).toHaveBeenCalledWith({strict: true}); }); - it("should return the body parser (urlencoded) ", () => { + it("should return the body parser (urlencoded)", () => { const stub = vi.fn().mockReturnValue("body"); const platform = PlatformKoa.create(Server, { @@ -58,7 +58,7 @@ describe("PlatformKoa", () => { const result = platform.adapter.bodyParser("urlencoded", {strict: true}); expect(result).toEqual("body"); - expect(stub).toBeCalledWith({strict: true}); + expect(stub).toHaveBeenCalledWith({strict: true}); }); }); }); diff --git a/packages/platform/platform-koa/src/components/PlatformKoa.ts b/packages/platform/platform-koa/src/components/PlatformKoa.ts index e01a2cb9a7f..860a4eca7d2 100644 --- a/packages/platform/platform-koa/src/components/PlatformKoa.ts +++ b/packages/platform/platform-koa/src/components/PlatformKoa.ts @@ -20,6 +20,7 @@ import koaBodyParser, {Options} from "koa-bodyparser"; // @ts-ignore import koaQs from "koa-qs"; import send from "koa-send"; + import {staticsMiddleware} from "../middlewares/staticsMiddleware.js"; import {PlatformKoaHandler} from "../services/PlatformKoaHandler.js"; import {PlatformKoaRequest} from "../services/PlatformKoaRequest.js"; diff --git a/packages/platform/platform-koa/src/decorators/ctx.spec.ts b/packages/platform/platform-koa/src/decorators/ctx.spec.ts index 3703ae05772..489c1253135 100644 --- a/packages/platform/platform-koa/src/decorators/ctx.spec.ts +++ b/packages/platform/platform-koa/src/decorators/ctx.spec.ts @@ -1,6 +1,7 @@ -import {Ctx} from "./ctx.js"; import {JsonParameterStore} from "@tsed/schema"; +import {Ctx} from "./ctx.js"; + describe("@Ctx", () => { it("should call store the right configuration", () => { class Ctrl { diff --git a/packages/platform/platform-koa/src/decorators/state.spec.ts b/packages/platform/platform-koa/src/decorators/state.spec.ts index cf12ff388c7..c9d15812767 100644 --- a/packages/platform/platform-koa/src/decorators/state.spec.ts +++ b/packages/platform/platform-koa/src/decorators/state.spec.ts @@ -1,7 +1,8 @@ import {ParamTypes} from "@tsed/common"; -import {State} from "./state.js"; import {JsonParameterStore} from "@tsed/schema"; +import {State} from "./state.js"; + describe("@State", () => { it("should call ParamFilter.useParam method with the correct parameters", () => { class Ctrl { diff --git a/packages/platform/platform-koa/src/interfaces/interfaces.ts b/packages/platform/platform-koa/src/interfaces/interfaces.ts index 70ef476b62b..7ac39312fc4 100644 --- a/packages/platform/platform-koa/src/interfaces/interfaces.ts +++ b/packages/platform/platform-koa/src/interfaces/interfaces.ts @@ -1,4 +1,5 @@ import Koa from "koa"; + import {PlatformKoaSettings} from "./PlatformKoaSettings.js"; export * from "./PlatformKoaSettings.js"; diff --git a/packages/platform/platform-koa/src/services/PlatformKoaHandler.ts b/packages/platform/platform-koa/src/services/PlatformKoaHandler.ts index e749f8b6d0e..3d556a6df25 100644 --- a/packages/platform/platform-koa/src/services/PlatformKoaHandler.ts +++ b/packages/platform/platform-koa/src/services/PlatformKoaHandler.ts @@ -1,6 +1,7 @@ -import {PlatformContext, PlatformHandler, PlatformParamsCallback} from "@tsed/common"; import "./PlatformKoaRequest.js"; +import {PlatformContext, PlatformHandler, PlatformParamsCallback} from "@tsed/common"; + export class PlatformKoaHandler extends PlatformHandler { onRequest(handler: PlatformParamsCallback, $ctx: PlatformContext) { if (!(($ctx.error instanceof Error && !$ctx.handlerMetadata.hasErrorParam) || ($ctx.handlerMetadata.hasErrorParam && !$ctx.error))) { diff --git a/packages/platform/platform-koa/src/services/PlatformKoaRequest.spec.ts b/packages/platform/platform-koa/src/services/PlatformKoaRequest.spec.ts index fcdea47f557..1bf5e742d40 100644 --- a/packages/platform/platform-koa/src/services/PlatformKoaRequest.spec.ts +++ b/packages/platform/platform-koa/src/services/PlatformKoaRequest.spec.ts @@ -1,4 +1,5 @@ import {PlatformTest} from "@tsed/common"; + import {PlatformKoaRequest} from "./PlatformKoaRequest.js"; function createRequest() { diff --git a/packages/platform/platform-koa/src/services/PlatformKoaRequest.ts b/packages/platform/platform-koa/src/services/PlatformKoaRequest.ts index 40cb8a79b10..480094af204 100644 --- a/packages/platform/platform-koa/src/services/PlatformKoaRequest.ts +++ b/packages/platform/platform-koa/src/services/PlatformKoaRequest.ts @@ -1,4 +1,5 @@ import "@koa/router"; + import {PlatformContext, PlatformRequest} from "@tsed/common"; import Koa from "koa"; diff --git a/packages/platform/platform-koa/src/services/PlatformKoaResponse.spec.ts b/packages/platform/platform-koa/src/services/PlatformKoaResponse.spec.ts index 22a6fe8fe58..797dee40bab 100644 --- a/packages/platform/platform-koa/src/services/PlatformKoaResponse.spec.ts +++ b/packages/platform/platform-koa/src/services/PlatformKoaResponse.spec.ts @@ -1,4 +1,5 @@ import {PlatformTest} from "@tsed/common"; + import {PlatformKoaRequest} from "./PlatformKoaRequest.js"; import {PlatformKoaResponse} from "./PlatformKoaResponse.js"; diff --git a/packages/platform/platform-koa/test/app/Server.ts b/packages/platform/platform-koa/test/app/Server.ts index 686e0e20cb3..bb6d8ba5beb 100644 --- a/packages/platform/platform-koa/test/app/Server.ts +++ b/packages/platform/platform-koa/test/app/Server.ts @@ -1,4 +1,5 @@ import "@tsed/ajv"; + import {PlatformApplication} from "@tsed/common"; import {Configuration, Inject} from "@tsed/di"; import Application from "koa"; diff --git a/packages/platform/platform-koa/test/app/index.ts b/packages/platform/platform-koa/test/app/index.ts index e7965a8291e..bcfc0bd4ca2 100644 --- a/packages/platform/platform-koa/test/app/index.ts +++ b/packages/platform/platform-koa/test/app/index.ts @@ -1,5 +1,6 @@ import {$log, Controller, Get} from "@tsed/common"; -import {PlatformKoa} from "@tsed/platform-koa"; + +import {PlatformKoa} from "../.."; import {Server} from "./Server.js"; if (process.env.NODE_ENV !== "test") { diff --git a/packages/platform/platform-koa/test/platform-koa.spec.ts b/packages/platform/platform-koa/test/platform-koa.spec.ts index 58d01b792c7..d22e3d95e3d 100644 --- a/packages/platform/platform-koa/test/platform-koa.spec.ts +++ b/packages/platform/platform-koa/test/platform-koa.spec.ts @@ -1,5 +1,6 @@ import {PlatformTestSdk} from "@tsed/platform-test-sdk"; -import {PlatformKoa} from "@tsed/platform-koa"; + +import {PlatformKoa} from ".."; import {rootDir, Server} from "./app/Server.js"; const utils = PlatformTestSdk.create({ diff --git a/packages/platform/platform-koa/tsconfig.esm.json b/packages/platform/platform-koa/tsconfig.esm.json index e3b07081667..82292550ddb 100644 --- a/packages/platform/platform-koa/tsconfig.esm.json +++ b/packages/platform/platform-koa/tsconfig.esm.json @@ -2,8 +2,7 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "module": "ESNext", - "moduleResolution": "nodenext", + "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", @@ -11,7 +10,7 @@ "composite": true, "noEmit": false }, - "include": ["src", "src/**/*.json"], + "include": ["src/**/*.ts", "src/**/*.json"], "exclude": [ "node_modules", "test", diff --git a/packages/platform/platform-koa/tsconfig.spec.json b/packages/platform/platform-koa/tsconfig.spec.json index 12d125b6440..162ff64a86a 100644 --- a/packages/platform/platform-koa/tsconfig.spec.json +++ b/packages/platform/platform-koa/tsconfig.spec.json @@ -3,7 +3,6 @@ "compilerOptions": { "baseUrl": ".", "rootDir": "../..", - "module": "commonjs", "outDir": "./lib/cjs", "declaration": false, "composite": false, diff --git a/packages/platform/platform-log-middleware/package.json b/packages/platform/platform-log-middleware/package.json index 5d7db462919..aabd8dd3097 100644 --- a/packages/platform/platform-log-middleware/package.json +++ b/packages/platform/platform-log-middleware/package.json @@ -31,7 +31,7 @@ "@tsed/platform-params": "workspace:*", "@tsed/typescript": "workspace:*", "eslint": "^8.57.0", - "typescript": "4.9.5", + "typescript": "5.6.2", "vitest": "2.0.4" }, "peerDependencies": { diff --git a/packages/platform/platform-log-middleware/src/middlewares/PlatformLogMiddleware.spec.ts b/packages/platform/platform-log-middleware/src/middlewares/PlatformLogMiddleware.spec.ts index 185cd424ea9..841a791d618 100644 --- a/packages/platform/platform-log-middleware/src/middlewares/PlatformLogMiddleware.spec.ts +++ b/packages/platform/platform-log-middleware/src/middlewares/PlatformLogMiddleware.spec.ts @@ -1,6 +1,8 @@ +import "../domain/PlatformLogMiddlewareSettings.js"; + import {PlatformHandlerMetadata, PlatformTest} from "@tsed/common"; + import {PlatformLogMiddleware} from "./PlatformLogMiddleware.js"; -import "../domain/PlatformLogMiddlewareSettings.js"; async function createMiddlewareFixture({statusCode = 200, error}: {statusCode?: number; error?: any} = {}) { const middleware = await PlatformTest.invoke(PlatformLogMiddleware); @@ -163,7 +165,7 @@ describe("PlatformLogMiddleware", () => { ); }); }); - describe("when no debug, logRequest, logEnd", () => { + describe("when no debug, logRequest, logStart", () => { beforeEach(() => PlatformTest.create({ logger: { diff --git a/packages/platform/platform-log-middleware/src/middlewares/PlatformLogMiddleware.ts b/packages/platform/platform-log-middleware/src/middlewares/PlatformLogMiddleware.ts index c4dbdc4f5c3..9b80d1017b0 100644 --- a/packages/platform/platform-log-middleware/src/middlewares/PlatformLogMiddleware.ts +++ b/packages/platform/platform-log-middleware/src/middlewares/PlatformLogMiddleware.ts @@ -2,6 +2,7 @@ import {cleanObject} from "@tsed/core"; import {Constant} from "@tsed/di"; import {Middleware, MiddlewareMethods} from "@tsed/platform-middlewares"; import {Context} from "@tsed/platform-params"; + import type {LoggerRequestFields} from "../domain/PlatformLogMiddlewareSettings.js"; /** diff --git a/packages/platform/platform-log-middleware/tsconfig.esm.json b/packages/platform/platform-log-middleware/tsconfig.esm.json index e3b07081667..82292550ddb 100644 --- a/packages/platform/platform-log-middleware/tsconfig.esm.json +++ b/packages/platform/platform-log-middleware/tsconfig.esm.json @@ -2,8 +2,7 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "module": "ESNext", - "moduleResolution": "nodenext", + "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", @@ -11,7 +10,7 @@ "composite": true, "noEmit": false }, - "include": ["src", "src/**/*.json"], + "include": ["src/**/*.ts", "src/**/*.json"], "exclude": [ "node_modules", "test", diff --git a/packages/platform/platform-log-middleware/tsconfig.spec.json b/packages/platform/platform-log-middleware/tsconfig.spec.json index c515685d43b..8a60e5b2d0e 100644 --- a/packages/platform/platform-log-middleware/tsconfig.spec.json +++ b/packages/platform/platform-log-middleware/tsconfig.spec.json @@ -3,7 +3,6 @@ "compilerOptions": { "baseUrl": ".", "rootDir": "../..", - "module": "commonjs", "outDir": "./lib/cjs", "declaration": false, "composite": false, diff --git a/packages/platform/platform-middlewares/package.json b/packages/platform/platform-middlewares/package.json index 3151131693c..cbd86e40441 100644 --- a/packages/platform/platform-middlewares/package.json +++ b/packages/platform/platform-middlewares/package.json @@ -31,7 +31,7 @@ "@tsed/schema": "workspace:*", "@tsed/typescript": "workspace:*", "eslint": "^8.57.0", - "typescript": "4.9.5", + "typescript": "5.6.2", "vitest": "2.0.4" }, "peerDependencies": { diff --git a/packages/platform/platform-middlewares/src/decorators/authOptions.spec.ts b/packages/platform/platform-middlewares/src/decorators/authOptions.spec.ts index cee09ad48ca..4c4ac7c62f7 100644 --- a/packages/platform/platform-middlewares/src/decorators/authOptions.spec.ts +++ b/packages/platform/platform-middlewares/src/decorators/authOptions.spec.ts @@ -1,4 +1,5 @@ import {decoratorArgs, prototypeOf, Store, UnsupportedDecoratorType} from "@tsed/core"; + import {AuthOptions} from "./authOptions.js"; class Guard { diff --git a/packages/platform/platform-middlewares/src/decorators/use.spec.ts b/packages/platform/platform-middlewares/src/decorators/use.spec.ts index 0c920a73edf..fd5e619a032 100644 --- a/packages/platform/platform-middlewares/src/decorators/use.spec.ts +++ b/packages/platform/platform-middlewares/src/decorators/use.spec.ts @@ -1,5 +1,6 @@ import {EndpointMetadata} from "@tsed/common"; import {Store} from "@tsed/core"; + import {Use} from "./use.js"; describe("Use()", () => { diff --git a/packages/platform/platform-middlewares/src/decorators/useAfter.spec.ts b/packages/platform/platform-middlewares/src/decorators/useAfter.spec.ts index 33fae8f78b2..50802b36237 100644 --- a/packages/platform/platform-middlewares/src/decorators/useAfter.spec.ts +++ b/packages/platform/platform-middlewares/src/decorators/useAfter.spec.ts @@ -1,5 +1,6 @@ -import {Store, UnsupportedDecoratorType} from "@tsed/core"; import {EndpointMetadata} from "@tsed/common"; +import {Store, UnsupportedDecoratorType} from "@tsed/core"; + import {UseAfter} from "./useAfter.js"; class CustomMiddleware { diff --git a/packages/platform/platform-middlewares/src/decorators/useAuth.spec.ts b/packages/platform/platform-middlewares/src/decorators/useAuth.spec.ts index b34ef562393..2501e13d881 100644 --- a/packages/platform/platform-middlewares/src/decorators/useAuth.spec.ts +++ b/packages/platform/platform-middlewares/src/decorators/useAuth.spec.ts @@ -1,5 +1,6 @@ import {EndpointMetadata} from "@tsed/common"; import {decoratorArgs, prototypeOf, Store, UnsupportedDecoratorType} from "@tsed/core"; + import {UseAuth} from "./useAuth.js"; class Guard { diff --git a/packages/platform/platform-middlewares/src/decorators/useAuth.ts b/packages/platform/platform-middlewares/src/decorators/useAuth.ts index 79b6171a772..bffa444aeb4 100644 --- a/packages/platform/platform-middlewares/src/decorators/useAuth.ts +++ b/packages/platform/platform-middlewares/src/decorators/useAuth.ts @@ -9,6 +9,7 @@ import { UnsupportedDecoratorType, useDecorators } from "@tsed/core"; + import {AuthOptions} from "./authOptions.js"; import {UseBefore} from "./useBefore.js"; diff --git a/packages/platform/platform-middlewares/src/decorators/useBefore.spec.ts b/packages/platform/platform-middlewares/src/decorators/useBefore.spec.ts index 4429955739a..310cfd5cfba 100644 --- a/packages/platform/platform-middlewares/src/decorators/useBefore.spec.ts +++ b/packages/platform/platform-middlewares/src/decorators/useBefore.spec.ts @@ -1,5 +1,6 @@ import {EndpointMetadata} from "@tsed/common"; import {Store, UnsupportedDecoratorType} from "@tsed/core"; + import {UseBefore} from "./useBefore.js"; class CustomMiddleware { diff --git a/packages/platform/platform-middlewares/src/decorators/useBeforeEach.spec.ts b/packages/platform/platform-middlewares/src/decorators/useBeforeEach.spec.ts index feb683180a9..7ebf42f29a0 100644 --- a/packages/platform/platform-middlewares/src/decorators/useBeforeEach.spec.ts +++ b/packages/platform/platform-middlewares/src/decorators/useBeforeEach.spec.ts @@ -1,5 +1,6 @@ import {EndpointMetadata} from "@tsed/common"; import {UnsupportedDecoratorType} from "@tsed/core"; + import {UseBeforeEach} from "./useBeforeEach.js"; class CustomMiddleware { diff --git a/packages/platform/platform-middlewares/src/decorators/useBeforeEach.ts b/packages/platform/platform-middlewares/src/decorators/useBeforeEach.ts index 9367e04d087..146a8bd38fb 100644 --- a/packages/platform/platform-middlewares/src/decorators/useBeforeEach.ts +++ b/packages/platform/platform-middlewares/src/decorators/useBeforeEach.ts @@ -1,4 +1,5 @@ import {decorateMethodsOf, DecoratorParameters, decoratorTypeOf, DecoratorTypes, UnsupportedDecoratorType} from "@tsed/core"; + import {UseBefore} from "./useBefore.js"; /** diff --git a/packages/platform/platform-middlewares/src/utils/getMiddlewaresForHook.ts b/packages/platform/platform-middlewares/src/utils/getMiddlewaresForHook.ts index 354ee5db86f..ff3f7a3da31 100644 --- a/packages/platform/platform-middlewares/src/utils/getMiddlewaresForHook.ts +++ b/packages/platform/platform-middlewares/src/utils/getMiddlewaresForHook.ts @@ -1,4 +1,5 @@ import {DIConfiguration} from "@tsed/di"; + import {PlatformMiddlewareLoadingOptions} from "../domain/PlatformMiddlewareSettings.js"; export function getMiddlewaresForHook(hook: string, settings: DIConfiguration, defaultHook = "") { diff --git a/packages/platform/platform-middlewares/src/utils/getMiddlewaresForHooks.spec.ts b/packages/platform/platform-middlewares/src/utils/getMiddlewaresForHooks.spec.ts index 312a0623315..dd840d008ba 100644 --- a/packages/platform/platform-middlewares/src/utils/getMiddlewaresForHooks.spec.ts +++ b/packages/platform/platform-middlewares/src/utils/getMiddlewaresForHooks.spec.ts @@ -1,4 +1,5 @@ import {DIConfiguration} from "@tsed/di"; + import {getMiddlewaresForHook} from "./getMiddlewaresForHook.js"; describe("getMiddlewaresForHooks", () => { diff --git a/packages/platform/platform-middlewares/tsconfig.esm.json b/packages/platform/platform-middlewares/tsconfig.esm.json index e3b07081667..82292550ddb 100644 --- a/packages/platform/platform-middlewares/tsconfig.esm.json +++ b/packages/platform/platform-middlewares/tsconfig.esm.json @@ -2,8 +2,7 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "module": "ESNext", - "moduleResolution": "nodenext", + "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", @@ -11,7 +10,7 @@ "composite": true, "noEmit": false }, - "include": ["src", "src/**/*.json"], + "include": ["src/**/*.ts", "src/**/*.json"], "exclude": [ "node_modules", "test", diff --git a/packages/platform/platform-middlewares/tsconfig.spec.json b/packages/platform/platform-middlewares/tsconfig.spec.json index e69b80b2b2d..2cbf49b76d8 100644 --- a/packages/platform/platform-middlewares/tsconfig.spec.json +++ b/packages/platform/platform-middlewares/tsconfig.spec.json @@ -3,7 +3,6 @@ "compilerOptions": { "baseUrl": ".", "rootDir": "../..", - "module": "commonjs", "outDir": "./lib/cjs", "declaration": false, "composite": false, diff --git a/packages/platform/platform-params/package.json b/packages/platform/platform-params/package.json index 49ce8bf17b0..5d089d4919e 100644 --- a/packages/platform/platform-params/package.json +++ b/packages/platform/platform-params/package.json @@ -33,7 +33,7 @@ "@tsed/schema": "workspace:*", "@tsed/typescript": "workspace:*", "eslint": "^8.57.0", - "typescript": "4.9.5", + "typescript": "5.6.2", "vitest": "2.0.4" }, "peerDependencies": { diff --git a/packages/platform/platform-params/src/builder/PlatformParams.spec.ts b/packages/platform/platform-params/src/builder/PlatformParams.spec.ts index d5a10b18e8d..d571bec690d 100644 --- a/packages/platform/platform-params/src/builder/PlatformParams.spec.ts +++ b/packages/platform/platform-params/src/builder/PlatformParams.spec.ts @@ -1,5 +1,6 @@ import {PlatformTest, ProviderScope} from "@tsed/common"; import {Injectable} from "@tsed/di"; + import {buildPlatformParams, invokePlatformParams} from "../../test/helpers/buildPlatformParams.js"; import {PathParams} from "../decorators/pathParams.js"; import {QueryParams} from "../decorators/queryParams.js"; diff --git a/packages/platform/platform-params/src/builder/PlatformParams.ts b/packages/platform/platform-params/src/builder/PlatformParams.ts index 2c8d6d6846c..5ee51105471 100644 --- a/packages/platform/platform-params/src/builder/PlatformParams.ts +++ b/packages/platform/platform-params/src/builder/PlatformParams.ts @@ -1,5 +1,6 @@ import {DIContext, Inject, Injectable, InjectorService, ProviderScope, TokenProvider} from "@tsed/di"; import {JsonMethodStore, JsonParameterStore, PipeMethods} from "@tsed/schema"; + import {ParamValidationError} from "../errors/ParamValidationError.js"; import {ParseExpressionPipe} from "../pipes/ParseExpressionPipe.js"; diff --git a/packages/platform/platform-params/src/decorators/bodyParams.spec.ts b/packages/platform/platform-params/src/decorators/bodyParams.spec.ts index 6525f07da72..ad6078a215b 100644 --- a/packages/platform/platform-params/src/decorators/bodyParams.spec.ts +++ b/packages/platform/platform-params/src/decorators/bodyParams.spec.ts @@ -1,5 +1,6 @@ import {Controller} from "@tsed/di"; import {getSpec, JsonParameterStore, Post, SpecTypes} from "@tsed/schema"; + import {ParamTypes} from "../domain/ParamTypes.js"; import {BodyParams, RawBodyParams} from "./bodyParams.js"; diff --git a/packages/platform/platform-params/src/decorators/bodyParams.ts b/packages/platform/platform-params/src/decorators/bodyParams.ts index 46a7b8669d4..be46c250b22 100644 --- a/packages/platform/platform-params/src/decorators/bodyParams.ts +++ b/packages/platform/platform-params/src/decorators/bodyParams.ts @@ -1,8 +1,9 @@ import {Type} from "@tsed/core"; + import {ParamOptions} from "../domain/ParamOptions.js"; import {ParamTypes} from "../domain/ParamTypes.js"; -import {UseParam} from "./useParam.js"; import {mapParamsOptions} from "../utils/mapParamsOptions.js"; +import {UseParam} from "./useParam.js"; /** * BodyParams return the value from [request.body](http://expressjs.com/en/4x/api.html#req.body) object. diff --git a/packages/platform/platform-params/src/decorators/context.spec.ts b/packages/platform/platform-params/src/decorators/context.spec.ts index 48f5951aaaa..c1f34c86ad7 100644 --- a/packages/platform/platform-params/src/decorators/context.spec.ts +++ b/packages/platform/platform-params/src/decorators/context.spec.ts @@ -1,8 +1,9 @@ +import {JsonParameterStore} from "@tsed/schema"; + import {ParamTypes} from "../domain/ParamTypes.js"; import {Context} from "./context.js"; -import {JsonParameterStore} from "@tsed/schema"; -describe("@Context ", () => { +describe("@Context", () => { it("should call ParamFilter.useParam method with the correct parameters", () => { class Ctrl { test(@Context("expression") test: any) {} diff --git a/packages/platform/platform-params/src/decorators/context.ts b/packages/platform/platform-params/src/decorators/context.ts index 9dcab61a6a2..7b1e0251675 100644 --- a/packages/platform/platform-params/src/decorators/context.ts +++ b/packages/platform/platform-params/src/decorators/context.ts @@ -1,4 +1,5 @@ import {BaseContext} from "@tsed/di"; + import {ParamTypes} from "../domain/ParamTypes.js"; import {mapParamsOptions} from "../utils/mapParamsOptions.js"; import {UseParam} from "./useParam.js"; diff --git a/packages/platform/platform-params/src/decorators/cookies.spec.ts b/packages/platform/platform-params/src/decorators/cookies.spec.ts index 0a07fcd1990..fc75b906a05 100644 --- a/packages/platform/platform-params/src/decorators/cookies.spec.ts +++ b/packages/platform/platform-params/src/decorators/cookies.spec.ts @@ -1,6 +1,7 @@ +import {JsonParameterStore} from "@tsed/schema"; + import {ParamTypes} from "../domain/ParamTypes.js"; import {Cookies} from "./cookies.js"; -import {JsonParameterStore} from "@tsed/schema"; describe("@Cookies", () => { it("should call ParamFilter.useParam method with the correct parameters", () => { diff --git a/packages/platform/platform-params/src/decorators/cookies.ts b/packages/platform/platform-params/src/decorators/cookies.ts index cc334148181..a08b949daf8 100644 --- a/packages/platform/platform-params/src/decorators/cookies.ts +++ b/packages/platform/platform-params/src/decorators/cookies.ts @@ -1,4 +1,5 @@ import {Type} from "@tsed/core"; + import {ParamOptions} from "../domain/ParamOptions.js"; import {ParamTypes} from "../domain/ParamTypes.js"; import {mapParamsOptions} from "../utils/mapParamsOptions.js"; diff --git a/packages/platform/platform-params/src/decorators/headerParams.spec.ts b/packages/platform/platform-params/src/decorators/headerParams.spec.ts index e79d2382bf0..b9ef25d5b06 100644 --- a/packages/platform/platform-params/src/decorators/headerParams.spec.ts +++ b/packages/platform/platform-params/src/decorators/headerParams.spec.ts @@ -1,6 +1,7 @@ +import {JsonParameterStore} from "@tsed/schema"; + import {ParamTypes} from "../domain/ParamTypes.js"; import {HeaderParams} from "./headerParams.js"; -import {JsonParameterStore} from "@tsed/schema"; describe("@HeaderParams", () => { it("should call ParamFilter.useParam method with the correct parameters", () => { diff --git a/packages/platform/platform-params/src/decorators/headerParams.ts b/packages/platform/platform-params/src/decorators/headerParams.ts index 7cb5c2bda35..c7e5ace7695 100644 --- a/packages/platform/platform-params/src/decorators/headerParams.ts +++ b/packages/platform/platform-params/src/decorators/headerParams.ts @@ -1,8 +1,9 @@ import {Type} from "@tsed/core"; + +import {ParamOptions} from "../domain/ParamOptions.js"; import {ParamTypes} from "../domain/ParamTypes.js"; -import {UseParam} from "./useParam.js"; import {mapParamsOptions} from "../utils/mapParamsOptions.js"; -import {ParamOptions} from "../domain/ParamOptions.js"; +import {UseParam} from "./useParam.js"; /** * HeaderParams return the value from [`request.get()`](http://expressjs.com/en/4x/api.html#req.get) method. diff --git a/packages/platform/platform-params/src/decorators/locals.spec.ts b/packages/platform/platform-params/src/decorators/locals.spec.ts index 26dac9829f5..e6573120df7 100644 --- a/packages/platform/platform-params/src/decorators/locals.spec.ts +++ b/packages/platform/platform-params/src/decorators/locals.spec.ts @@ -1,6 +1,7 @@ +import {JsonParameterStore} from "@tsed/schema"; + import {ParamTypes} from "../domain/ParamTypes.js"; import {Locals} from "./locals.js"; -import {JsonParameterStore} from "@tsed/schema"; describe("@Locals", () => { it("should call ParamFilter.useParam method with the correct parameters", () => { diff --git a/packages/platform/platform-params/src/decorators/pathParams.spec.ts b/packages/platform/platform-params/src/decorators/pathParams.spec.ts index 124590dc736..7b454460439 100644 --- a/packages/platform/platform-params/src/decorators/pathParams.spec.ts +++ b/packages/platform/platform-params/src/decorators/pathParams.spec.ts @@ -1,4 +1,5 @@ import {JsonParameterStore} from "@tsed/schema"; + import {ParamTypes} from "../domain/ParamTypes.js"; import {PathParams, RawPathParams} from "./pathParams.js"; diff --git a/packages/platform/platform-params/src/decorators/pathParams.ts b/packages/platform/platform-params/src/decorators/pathParams.ts index 19bf466856a..aef9e000ec1 100644 --- a/packages/platform/platform-params/src/decorators/pathParams.ts +++ b/packages/platform/platform-params/src/decorators/pathParams.ts @@ -1,4 +1,5 @@ import {Type} from "@tsed/core"; + import {ParamOptions} from "../domain/ParamOptions.js"; import {ParamTypes} from "../domain/ParamTypes.js"; import {mapParamsOptions} from "../utils/mapParamsOptions.js"; diff --git a/packages/platform/platform-params/src/decorators/queryParams.spec.ts b/packages/platform/platform-params/src/decorators/queryParams.spec.ts index 654adb9dedc..0c6da382e53 100644 --- a/packages/platform/platform-params/src/decorators/queryParams.spec.ts +++ b/packages/platform/platform-params/src/decorators/queryParams.spec.ts @@ -1,4 +1,5 @@ import {JsonParameterStore} from "@tsed/schema"; + import {ParamTypes} from "../domain/ParamTypes.js"; import {QueryParams, RawQueryParams} from "./queryParams.js"; diff --git a/packages/platform/platform-params/src/decorators/queryParams.ts b/packages/platform/platform-params/src/decorators/queryParams.ts index ef213f3ec9b..c79e0fc6acc 100644 --- a/packages/platform/platform-params/src/decorators/queryParams.ts +++ b/packages/platform/platform-params/src/decorators/queryParams.ts @@ -1,4 +1,5 @@ import {Type} from "@tsed/core"; + import {ParamOptions} from "../domain/ParamOptions.js"; import {ParamTypes} from "../domain/ParamTypes.js"; import {mapParamsOptions} from "../utils/mapParamsOptions.js"; diff --git a/packages/platform/platform-params/src/decorators/session.spec.ts b/packages/platform/platform-params/src/decorators/session.spec.ts index 58f0904e91c..ca6f62d20b1 100644 --- a/packages/platform/platform-params/src/decorators/session.spec.ts +++ b/packages/platform/platform-params/src/decorators/session.spec.ts @@ -1,7 +1,8 @@ -import {Session} from "./session.js"; -import {ParamTypes} from "../domain/ParamTypes.js"; import {JsonParameterStore} from "@tsed/schema"; +import {ParamTypes} from "../domain/ParamTypes.js"; +import {Session} from "./session.js"; + describe("@Session", () => { it("should declare a session params", () => { class Test {} diff --git a/packages/platform/platform-params/src/decorators/useParam.spec.ts b/packages/platform/platform-params/src/decorators/useParam.spec.ts index 75edf184d01..01329cdd54d 100644 --- a/packages/platform/platform-params/src/decorators/useParam.spec.ts +++ b/packages/platform/platform-params/src/decorators/useParam.spec.ts @@ -1,5 +1,6 @@ import {Get} from "@tsed/common"; import {Description, Example, getSpec, JsonParameterStore, Property, Required, SpecTypes, Title} from "@tsed/schema"; + import {ParamTypes} from "../domain/ParamTypes.js"; import {QueryParams} from "./queryParams.js"; import {UseParam} from "./useParam.js"; diff --git a/packages/platform/platform-params/src/decorators/useParam.ts b/packages/platform/platform-params/src/decorators/useParam.ts index 817570dc4d3..b276b56a8b1 100644 --- a/packages/platform/platform-params/src/decorators/useParam.ts +++ b/packages/platform/platform-params/src/decorators/useParam.ts @@ -1,4 +1,5 @@ import {useDecorators} from "@tsed/core"; + import {ParamOptions} from "../domain/ParamOptions.js"; import {ParamTypes} from "../domain/ParamTypes.js"; import {UseDeserialization} from "./useDeserialization.js"; diff --git a/packages/platform/platform-params/src/decorators/useParamType.ts b/packages/platform/platform-params/src/decorators/useParamType.ts index 681a2167985..3cd9dde2a9f 100644 --- a/packages/platform/platform-params/src/decorators/useParamType.ts +++ b/packages/platform/platform-params/src/decorators/useParamType.ts @@ -1,9 +1,10 @@ import {isBuffer, useDecorators} from "@tsed/core"; import {isParameterType, Name} from "@tsed/schema"; -import {ParamFn} from "./paramFn.js"; + import {ParamOptions} from "../domain/ParamOptions.js"; -import {UseParamExpression} from "./useParamExpression.js"; import {PARAM_TYPES_DATA_PATH, ParamTypes} from "../domain/ParamTypes.js"; +import {ParamFn} from "./paramFn.js"; +import {UseParamExpression} from "./useParamExpression.js"; /** * Get the object from request (like body, params, query, etc...). diff --git a/packages/platform/platform-params/src/decorators/usePipe.ts b/packages/platform/platform-params/src/decorators/usePipe.ts index ceab0410417..5a1587a874f 100644 --- a/packages/platform/platform-params/src/decorators/usePipe.ts +++ b/packages/platform/platform-params/src/decorators/usePipe.ts @@ -1,5 +1,6 @@ import {Type} from "@tsed/core"; import {PipeMethods} from "@tsed/schema"; + import {ParamFn} from "./paramFn.js"; /** diff --git a/packages/platform/platform-params/src/decorators/useType.ts b/packages/platform/platform-params/src/decorators/useType.ts index 7b2b8c6fe55..709dc06a771 100644 --- a/packages/platform/platform-params/src/decorators/useType.ts +++ b/packages/platform/platform-params/src/decorators/useType.ts @@ -1,5 +1,6 @@ import {Type} from "@tsed/core"; import {Any, CollectionOf, type JsonParameterStore} from "@tsed/schema"; + import {ParamFn} from "./paramFn.js"; function shouldFallBackToAny(entity: JsonParameterStore) { diff --git a/packages/platform/platform-params/src/errors/ParamValidationError.spec.ts b/packages/platform/platform-params/src/errors/ParamValidationError.spec.ts index 51db1c9d6f5..8e21c11e748 100644 --- a/packages/platform/platform-params/src/errors/ParamValidationError.spec.ts +++ b/packages/platform/platform-params/src/errors/ParamValidationError.spec.ts @@ -1,4 +1,5 @@ import {RequiredValidationError, ValidationError} from "@tsed/common"; + import {ParamValidationError} from "./ParamValidationError.js"; describe("ParseExpressionError", () => { diff --git a/packages/platform/platform-params/src/errors/ParamValidationError.ts b/packages/platform/platform-params/src/errors/ParamValidationError.ts index 2d5efcacde3..062559eb87e 100644 --- a/packages/platform/platform-params/src/errors/ParamValidationError.ts +++ b/packages/platform/platform-params/src/errors/ParamValidationError.ts @@ -1,6 +1,7 @@ import {nameOf} from "@tsed/core"; import {BadRequest} from "@tsed/exceptions"; import {JsonParameterStore} from "@tsed/schema"; + import {ValidationError} from "./ValidationError.js"; export class ParamValidationError extends BadRequest { diff --git a/packages/platform/platform-params/src/errors/RequiredValidationError.ts b/packages/platform/platform-params/src/errors/RequiredValidationError.ts index 723b0b4d5a2..4a3b2c97795 100644 --- a/packages/platform/platform-params/src/errors/RequiredValidationError.ts +++ b/packages/platform/platform-params/src/errors/RequiredValidationError.ts @@ -1,7 +1,8 @@ import {nameOf} from "@tsed/core"; -import {ValidationError} from "./ValidationError.js"; import {JsonParameterStore} from "@tsed/schema"; +import {ValidationError} from "./ValidationError.js"; + export class RequiredValidationError extends ValidationError { public name: string = "REQUIRED_VALIDATION_ERROR"; diff --git a/packages/platform/platform-params/src/pipes/DeserializerPipe.spec.ts b/packages/platform/platform-params/src/pipes/DeserializerPipe.spec.ts index e1f146781bf..288c80312f1 100644 --- a/packages/platform/platform-params/src/pipes/DeserializerPipe.spec.ts +++ b/packages/platform/platform-params/src/pipes/DeserializerPipe.spec.ts @@ -1,8 +1,9 @@ import {PlatformTest} from "@tsed/common"; +import {JsonParameterStore} from "@tsed/schema"; + import {BodyParams} from "../decorators/bodyParams.js"; import {QueryParams} from "../decorators/queryParams.js"; import {DeserializerPipe} from "./DeserializerPipe.js"; -import {JsonParameterStore} from "@tsed/schema"; describe("DeserializerPipe", () => { beforeEach(PlatformTest.create); diff --git a/packages/platform/platform-params/src/pipes/ParseExpressionPipe.spec.ts b/packages/platform/platform-params/src/pipes/ParseExpressionPipe.spec.ts index 5a10b439d2d..c794ba6802a 100644 --- a/packages/platform/platform-params/src/pipes/ParseExpressionPipe.spec.ts +++ b/packages/platform/platform-params/src/pipes/ParseExpressionPipe.spec.ts @@ -1,7 +1,8 @@ import {ParamTypes, PlatformTest} from "@tsed/common"; -import {ParseExpressionPipe} from "./ParseExpressionPipe.js"; -import {JsonParameterStore} from "@tsed/schema"; import {DecoratorTypes} from "@tsed/core"; +import {JsonParameterStore} from "@tsed/schema"; + +import {ParseExpressionPipe} from "./ParseExpressionPipe.js"; describe("ParseExpressionPipe", () => { beforeEach(PlatformTest.create); diff --git a/packages/platform/platform-params/src/pipes/ParseExpressionPipe.ts b/packages/platform/platform-params/src/pipes/ParseExpressionPipe.ts index f5d2f60328b..2a780993138 100644 --- a/packages/platform/platform-params/src/pipes/ParseExpressionPipe.ts +++ b/packages/platform/platform-params/src/pipes/ParseExpressionPipe.ts @@ -1,6 +1,7 @@ import {getValue} from "@tsed/core"; import {Injectable} from "@tsed/di"; import {JsonParameterStore, PipeMethods} from "@tsed/schema"; + import {PlatformParamsScope} from "../builder/PlatformParams.js"; import {ParamTypes} from "../domain/ParamTypes.js"; diff --git a/packages/platform/platform-params/src/pipes/ValidationPipe.spec.ts b/packages/platform/platform-params/src/pipes/ValidationPipe.spec.ts index 427ab5f3b00..ec139e799a3 100644 --- a/packages/platform/platform-params/src/pipes/ValidationPipe.spec.ts +++ b/packages/platform/platform-params/src/pipes/ValidationPipe.spec.ts @@ -1,6 +1,7 @@ import {PlatformTest, Post} from "@tsed/common"; import {catchAsyncError} from "@tsed/core"; import {AllOf, AnyOf, CollectionOf, getSpec, JsonParameterStore, OneOf, Property, Required, SpecTypes} from "@tsed/schema"; + import {BodyParams} from "../decorators/bodyParams.js"; import {PathParams} from "../decorators/pathParams.js"; import {QueryParams} from "../decorators/queryParams.js"; diff --git a/packages/platform/platform-params/src/pipes/ValidationPipe.ts b/packages/platform/platform-params/src/pipes/ValidationPipe.ts index 4f97d21cb5c..5d6da2aa777 100644 --- a/packages/platform/platform-params/src/pipes/ValidationPipe.ts +++ b/packages/platform/platform-params/src/pipes/ValidationPipe.ts @@ -1,6 +1,7 @@ import {Inject, Injectable} from "@tsed/di"; import {deserialize} from "@tsed/json-mapper"; import {getJsonSchema, JsonParameterStore, PipeMethods} from "@tsed/schema"; + import {ParamTypes} from "../domain/ParamTypes.js"; import {RequiredValidationError} from "../errors/RequiredValidationError.js"; diff --git a/packages/platform/platform-params/src/utils/mapParamsOptions.ts b/packages/platform/platform-params/src/utils/mapParamsOptions.ts index b35c93efbdf..ee4375f84ea 100644 --- a/packages/platform/platform-params/src/utils/mapParamsOptions.ts +++ b/packages/platform/platform-params/src/utils/mapParamsOptions.ts @@ -1,4 +1,5 @@ import {isObject} from "@tsed/core"; + import {ParamOptions} from "../domain/ParamOptions.js"; /** diff --git a/packages/platform/platform-params/test/helpers/buildPlatformParams.ts b/packages/platform/platform-params/test/helpers/buildPlatformParams.ts index 31f3b6e8832..697ec23f647 100644 --- a/packages/platform/platform-params/test/helpers/buildPlatformParams.ts +++ b/packages/platform/platform-params/test/helpers/buildPlatformParams.ts @@ -1,7 +1,8 @@ import {ParamOptions, PlatformParams, PlatformTest} from "@tsed/common"; +import {DecoratorTypes} from "@tsed/core"; import {JsonParameterStore} from "@tsed/schema"; + import {createFakeHandlerContext} from "./createFakeHandlerContext.js"; -import {DecoratorTypes} from "@tsed/core"; export interface TestPlatformParamsOptions extends ParamOptions { required?: boolean; diff --git a/packages/platform/platform-params/tsconfig.esm.json b/packages/platform/platform-params/tsconfig.esm.json index e3b07081667..82292550ddb 100644 --- a/packages/platform/platform-params/tsconfig.esm.json +++ b/packages/platform/platform-params/tsconfig.esm.json @@ -2,8 +2,7 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "module": "ESNext", - "moduleResolution": "nodenext", + "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", @@ -11,7 +10,7 @@ "composite": true, "noEmit": false }, - "include": ["src", "src/**/*.json"], + "include": ["src/**/*.ts", "src/**/*.json"], "exclude": [ "node_modules", "test", diff --git a/packages/platform/platform-params/tsconfig.spec.json b/packages/platform/platform-params/tsconfig.spec.json index a926761dcee..4f386c836b6 100644 --- a/packages/platform/platform-params/tsconfig.spec.json +++ b/packages/platform/platform-params/tsconfig.spec.json @@ -3,7 +3,6 @@ "compilerOptions": { "baseUrl": ".", "rootDir": "../..", - "module": "commonjs", "outDir": "./lib/cjs", "declaration": false, "composite": false, diff --git a/packages/platform/platform-response-filter/package.json b/packages/platform/platform-response-filter/package.json index 1b86d74f526..36757ddfbee 100644 --- a/packages/platform/platform-response-filter/package.json +++ b/packages/platform/platform-response-filter/package.json @@ -33,7 +33,7 @@ "@tsed/schema": "workspace:*", "@tsed/typescript": "workspace:*", "eslint": "^8.57.0", - "typescript": "4.9.5", + "typescript": "5.6.2", "vitest": "2.0.4" }, "peerDependencies": { diff --git a/packages/platform/platform-response-filter/src/decorators/responseFilter.ts b/packages/platform/platform-response-filter/src/decorators/responseFilter.ts index f5aa9f46777..d47f4d7d71f 100644 --- a/packages/platform/platform-response-filter/src/decorators/responseFilter.ts +++ b/packages/platform/platform-response-filter/src/decorators/responseFilter.ts @@ -1,5 +1,6 @@ import {Type} from "@tsed/core"; import {registerProvider} from "@tsed/di"; + import {registerResponseFilter, ResponseFilterKey} from "../domain/ResponseFiltersContainer.js"; /** diff --git a/packages/platform/platform-response-filter/src/domain/ResponseFiltersContainer.ts b/packages/platform/platform-response-filter/src/domain/ResponseFiltersContainer.ts index 3bfd7cbb6bf..dec531642e1 100644 --- a/packages/platform/platform-response-filter/src/domain/ResponseFiltersContainer.ts +++ b/packages/platform/platform-response-filter/src/domain/ResponseFiltersContainer.ts @@ -1,4 +1,5 @@ import {Type} from "@tsed/core"; + import {ResponseFilterMethods} from "../interfaces/ResponseFilterMethods.js"; /** * @ignore diff --git a/packages/platform/platform-response-filter/src/services/PlatformResponseFilter.spec.ts b/packages/platform/platform-response-filter/src/services/PlatformResponseFilter.spec.ts index 5a4b659bd7d..752ad92bccc 100644 --- a/packages/platform/platform-response-filter/src/services/PlatformResponseFilter.spec.ts +++ b/packages/platform/platform-response-filter/src/services/PlatformResponseFilter.spec.ts @@ -1,6 +1,7 @@ import {Context, EndpointMetadata, Get, PlatformContext, PlatformTest, View} from "@tsed/common"; import {catchAsyncError} from "@tsed/core"; import {Returns} from "@tsed/schema"; + import {ResponseFilter} from "../decorators/responseFilter.js"; import {ResponseFilterMethods} from "../interfaces/ResponseFilterMethods.js"; import {PlatformResponseFilter} from "./PlatformResponseFilter.js"; @@ -127,7 +128,7 @@ describe("PlatformResponseFilter", () => { it("should transform data for default content-type from metadata", async () => { class Test { @Get("/") - @Returns(200).ContentType("application/json") + @(Returns(200).ContentType("application/json")) test() {} } @@ -151,7 +152,7 @@ describe("PlatformResponseFilter", () => { it("should transform data for default content-type from metadata with any response filter", async () => { class Test { @Get("/") - @Returns(200).ContentType("application/json") + @(Returns(200).ContentType("application/json")) test() {} } diff --git a/packages/platform/platform-response-filter/src/services/PlatformResponseFilter.ts b/packages/platform/platform-response-filter/src/services/PlatformResponseFilter.ts index 0d1d2943386..26cb64c1756 100644 --- a/packages/platform/platform-response-filter/src/services/PlatformResponseFilter.ts +++ b/packages/platform/platform-response-filter/src/services/PlatformResponseFilter.ts @@ -1,6 +1,7 @@ import {isSerializable, Type} from "@tsed/core"; import {BaseContext, Constant, Inject, Injectable, InjectorService} from "@tsed/di"; import {serialize} from "@tsed/json-mapper"; + import {ResponseFilterKey, ResponseFiltersContainer} from "../domain/ResponseFiltersContainer.js"; import {ResponseFilterMethods} from "../interfaces/ResponseFilterMethods.js"; import {ANY_CONTENT_TYPE, getContentType} from "../utils/getContentType.js"; diff --git a/packages/platform/platform-response-filter/src/utils/getContentType.spec.ts b/packages/platform/platform-response-filter/src/utils/getContentType.spec.ts index 8ad7b71497c..e7ec6f9ff3d 100644 --- a/packages/platform/platform-response-filter/src/utils/getContentType.spec.ts +++ b/packages/platform/platform-response-filter/src/utils/getContentType.spec.ts @@ -1,5 +1,6 @@ import {PlatformTest, View} from "@tsed/common"; import {EndpointMetadata, Get, Returns} from "@tsed/schema"; + import {getContentType} from "./getContentType.js"; describe("getContentType", () => { @@ -27,7 +28,7 @@ describe("getContentType", () => { it("should return the content type (object - application/json)", () => { class TestController { @Get("/") - @Returns(200).ContentType("application/json") + @(Returns(200).ContentType("application/json")) get() {} } @@ -48,7 +49,7 @@ describe("getContentType", () => { it("should return the content type (string - application/json)", () => { class TestController { @Get("/") - @Returns(200).ContentType("application/json") + @(Returns(200).ContentType("application/json")) get() {} } @@ -69,7 +70,7 @@ describe("getContentType", () => { it("should return the content type (string - text/html)", () => { class TestController { @Get("/") - @Returns(200).ContentType("text/html") + @(Returns(200).ContentType("text/html")) get() {} } diff --git a/packages/platform/platform-response-filter/src/utils/renderView.spec.ts b/packages/platform/platform-response-filter/src/utils/renderView.spec.ts index 1bb82f78ebf..26cdd449a1e 100644 --- a/packages/platform/platform-response-filter/src/utils/renderView.spec.ts +++ b/packages/platform/platform-response-filter/src/utils/renderView.spec.ts @@ -1,6 +1,7 @@ import {EndpointMetadata, Get, PlatformTest} from "@tsed/common"; -import {Ignore, Property, Returns} from "@tsed/schema"; import {View} from "@tsed/platform-views"; +import {Ignore, Property, Returns} from "@tsed/schema"; + import {renderView} from "./renderView.js"; describe("renderView", () => { @@ -32,7 +33,7 @@ describe("renderView", () => { await renderView(ctx.data, ctx); - expect(ctx.response.render).toBeCalledWith("view", { + expect(ctx.response.render).toHaveBeenCalledWith("view", { $ctx: ctx, data: "data", options: "options" diff --git a/packages/platform/platform-response-filter/src/utils/renderView.ts b/packages/platform/platform-response-filter/src/utils/renderView.ts index 7b6d72b348f..280d463c326 100644 --- a/packages/platform/platform-response-filter/src/utils/renderView.ts +++ b/packages/platform/platform-response-filter/src/utils/renderView.ts @@ -1,4 +1,5 @@ import {BaseContext} from "@tsed/di"; + import {TemplateRenderError} from "../errors/TemplateRenderError.js"; export async function renderView(data: any, $ctx: BaseContext) { diff --git a/packages/platform/platform-response-filter/tsconfig.esm.json b/packages/platform/platform-response-filter/tsconfig.esm.json index e3b07081667..82292550ddb 100644 --- a/packages/platform/platform-response-filter/tsconfig.esm.json +++ b/packages/platform/platform-response-filter/tsconfig.esm.json @@ -2,8 +2,7 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "module": "ESNext", - "moduleResolution": "nodenext", + "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", @@ -11,7 +10,7 @@ "composite": true, "noEmit": false }, - "include": ["src", "src/**/*.json"], + "include": ["src/**/*.ts", "src/**/*.json"], "exclude": [ "node_modules", "test", diff --git a/packages/platform/platform-response-filter/tsconfig.spec.json b/packages/platform/platform-response-filter/tsconfig.spec.json index 5d62065da7e..cf76421f464 100644 --- a/packages/platform/platform-response-filter/tsconfig.spec.json +++ b/packages/platform/platform-response-filter/tsconfig.spec.json @@ -3,7 +3,6 @@ "compilerOptions": { "baseUrl": ".", "rootDir": "../..", - "module": "commonjs", "outDir": "./lib/cjs", "declaration": false, "composite": false, diff --git a/packages/platform/platform-router/package.json b/packages/platform/platform-router/package.json index 12e30ee5c8c..6559ab3a5ed 100644 --- a/packages/platform/platform-router/package.json +++ b/packages/platform/platform-router/package.json @@ -34,7 +34,7 @@ "@tsed/schema": "workspace:*", "@tsed/typescript": "workspace:*", "eslint": "^8.57.0", - "typescript": "4.9.5", + "typescript": "5.6.2", "vitest": "2.0.4" }, "peerDependencies": { diff --git a/packages/platform/platform-router/src/domain/PlatformHandlerMetadata.spec.ts b/packages/platform/platform-router/src/domain/PlatformHandlerMetadata.spec.ts index b7e625d0b63..d47bd7a9b6d 100644 --- a/packages/platform/platform-router/src/domain/PlatformHandlerMetadata.spec.ts +++ b/packages/platform/platform-router/src/domain/PlatformHandlerMetadata.spec.ts @@ -2,6 +2,7 @@ import {Err, Next, Req} from "@tsed/common"; import {Controller, InjectorService} from "@tsed/di"; import {Middleware} from "@tsed/platform-middlewares"; import {Get, JsonMethodStore} from "@tsed/schema"; + import {useContextHandler} from "../utils/useContextHandler.js"; import {PlatformHandlerMetadata} from "./PlatformHandlerMetadata.js"; import {PlatformHandlerType} from "./PlatformHandlerType.js"; diff --git a/packages/platform/platform-router/src/domain/PlatformHandlerMetadata.ts b/packages/platform/platform-router/src/domain/PlatformHandlerMetadata.ts index f87c1ba27a8..c6803a167c3 100644 --- a/packages/platform/platform-router/src/domain/PlatformHandlerMetadata.ts +++ b/packages/platform/platform-router/src/domain/PlatformHandlerMetadata.ts @@ -2,6 +2,7 @@ import {nameOf} from "@tsed/core"; import {DIContext, InjectorService, Provider, ProviderScope, TokenProvider} from "@tsed/di"; import {ParamTypes} from "@tsed/platform-params"; import {EndpointMetadata, JsonEntityStore, JsonParameterStore} from "@tsed/schema"; + import {PlatformHandlerType} from "./PlatformHandlerType.js"; import {SinglePathType} from "./SinglePathType.js"; diff --git a/packages/platform/platform-router/src/domain/PlatformRouter.ts b/packages/platform/platform-router/src/domain/PlatformRouter.ts index 31aa4f1b2b7..c8011fc0247 100644 --- a/packages/platform/platform-router/src/domain/PlatformRouter.ts +++ b/packages/platform/platform-router/src/domain/PlatformRouter.ts @@ -1,6 +1,7 @@ import {isString} from "@tsed/core"; import {Injectable, InjectorService, Provider, ProviderScope, Scope} from "@tsed/di"; import {concatPath} from "@tsed/schema"; + import {formatMethod} from "../utils/formatMethod.js"; import {PlatformHandlerMetadata} from "./PlatformHandlerMetadata.js"; import {PlatformLayer, PlatformLayerOptions} from "./PlatformLayer.js"; diff --git a/packages/platform/platform-router/src/domain/PlatformRouters.ts b/packages/platform/platform-router/src/domain/PlatformRouters.ts index d82475ab810..2c019ea4fd4 100644 --- a/packages/platform/platform-router/src/domain/PlatformRouters.ts +++ b/packages/platform/platform-router/src/domain/PlatformRouters.ts @@ -2,6 +2,7 @@ import {getValue, Hooks, Type} from "@tsed/core"; import {ControllerProvider, GlobalProviders, Injectable, InjectorService, Provider, ProviderType, TokenProvider} from "@tsed/di"; import {PlatformParamsCallback} from "@tsed/platform-params"; import {concatPath, getOperationsRoutes, JsonMethodStore, OPERATION_HTTP_VERBS} from "@tsed/schema"; + import {useContextHandler} from "../utils/useContextHandler.js"; import {PlatformHandlerMetadata} from "./PlatformHandlerMetadata.js"; import {PlatformLayer} from "./PlatformLayer.js"; diff --git a/packages/platform/platform-router/src/utils/useContextHandler.ts b/packages/platform/platform-router/src/utils/useContextHandler.ts index a9e965ba7b7..f361183fcd8 100644 --- a/packages/platform/platform-router/src/utils/useContextHandler.ts +++ b/packages/platform/platform-router/src/utils/useContextHandler.ts @@ -1,4 +1,5 @@ import {DIContext} from "@tsed/di"; + import {PlatformHandlerType} from "../domain/PlatformHandlerType.js"; export type PlatformContextHandler = ($ctx: Context) => any | Promise; diff --git a/packages/platform/platform-router/test/routers-alter-endpoint-handlers.integration.spec.ts b/packages/platform/platform-router/test/routers-alter-endpoint-handlers.integration.spec.ts index c44409d49cd..b404382768a 100644 --- a/packages/platform/platform-router/test/routers-alter-endpoint-handlers.integration.spec.ts +++ b/packages/platform/platform-router/test/routers-alter-endpoint-handlers.integration.spec.ts @@ -3,6 +3,7 @@ import {Controller, DIContext, InjectorService} from "@tsed/di"; import {UseBefore} from "@tsed/platform-middlewares"; import {Context, PlatformParams} from "@tsed/platform-params"; import {EndpointMetadata, Get, JsonOperationRoute} from "@tsed/schema"; + import {PlatformRouter} from "../src/domain/PlatformRouter.js"; import {AlterEndpointHandlersArg, PlatformRouters} from "../src/domain/PlatformRouters.js"; import {useContextHandler} from "../src/index.js"; diff --git a/packages/platform/platform-router/test/routers-injection.integration.spec.ts b/packages/platform/platform-router/test/routers-injection.integration.spec.ts index 825dbc95472..07282438774 100644 --- a/packages/platform/platform-router/test/routers-injection.integration.spec.ts +++ b/packages/platform/platform-router/test/routers-injection.integration.spec.ts @@ -1,5 +1,6 @@ import {Controller, ControllerProvider, InjectorService} from "@tsed/di"; import {PlatformParams} from "@tsed/platform-params"; + import {PlatformRouter} from "../src/domain/PlatformRouter.js"; import {PlatformRouters} from "../src/domain/PlatformRouters.js"; diff --git a/packages/platform/platform-router/test/routers-middlewares.integration.spec.ts b/packages/platform/platform-router/test/routers-middlewares.integration.spec.ts index 8ace0731e70..db2f2151319 100644 --- a/packages/platform/platform-router/test/routers-middlewares.integration.spec.ts +++ b/packages/platform/platform-router/test/routers-middlewares.integration.spec.ts @@ -3,6 +3,7 @@ import {Controller, InjectorService} from "@tsed/di"; import {Middleware} from "@tsed/platform-middlewares"; import {Context, PlatformParams} from "@tsed/platform-params"; import {Get} from "@tsed/schema"; + import {PlatformRouter} from "../src/domain/PlatformRouter.js"; import {PlatformRouters} from "../src/domain/PlatformRouters.js"; diff --git a/packages/platform/platform-router/test/routers-nested.integration.spec.ts b/packages/platform/platform-router/test/routers-nested.integration.spec.ts index 2eaee566173..b47a89e2e81 100644 --- a/packages/platform/platform-router/test/routers-nested.integration.spec.ts +++ b/packages/platform/platform-router/test/routers-nested.integration.spec.ts @@ -2,6 +2,7 @@ import {PlatformTest} from "@tsed/common"; import {Controller, InjectorService} from "@tsed/di"; import {PlatformParams} from "@tsed/platform-params"; import {Get, Post} from "@tsed/schema"; + import {PlatformRouter} from "../src/domain/PlatformRouter.js"; import {PlatformRouters} from "../src/domain/PlatformRouters.js"; diff --git a/packages/platform/platform-router/test/routers.integration.spec.ts b/packages/platform/platform-router/test/routers.integration.spec.ts index e048589c72e..1041aff9d67 100644 --- a/packages/platform/platform-router/test/routers.integration.spec.ts +++ b/packages/platform/platform-router/test/routers.integration.spec.ts @@ -4,6 +4,7 @@ import {Controller, InjectorService} from "@tsed/di"; import {UseBefore} from "@tsed/platform-middlewares"; import {Context, PlatformParams} from "@tsed/platform-params"; import {Delete, Get, Head, Options, Patch, Post, Publish, Put, Subscribe} from "@tsed/schema"; + import {PlatformRouter} from "../src/domain/PlatformRouter.js"; import {AlterEndpointHandlersArg, PlatformRouters} from "../src/domain/PlatformRouters.js"; diff --git a/packages/platform/platform-router/tsconfig.esm.json b/packages/platform/platform-router/tsconfig.esm.json index e3b07081667..82292550ddb 100644 --- a/packages/platform/platform-router/tsconfig.esm.json +++ b/packages/platform/platform-router/tsconfig.esm.json @@ -2,8 +2,7 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "module": "ESNext", - "moduleResolution": "nodenext", + "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", @@ -11,7 +10,7 @@ "composite": true, "noEmit": false }, - "include": ["src", "src/**/*.json"], + "include": ["src/**/*.ts", "src/**/*.json"], "exclude": [ "node_modules", "test", diff --git a/packages/platform/platform-router/tsconfig.spec.json b/packages/platform/platform-router/tsconfig.spec.json index fdc94c342bf..5715f3d0d5c 100644 --- a/packages/platform/platform-router/tsconfig.spec.json +++ b/packages/platform/platform-router/tsconfig.spec.json @@ -3,7 +3,6 @@ "compilerOptions": { "baseUrl": ".", "rootDir": "../..", - "module": "commonjs", "outDir": "./lib/cjs", "declaration": false, "composite": false, diff --git a/packages/platform/platform-serverless-http/package.json b/packages/platform/platform-serverless-http/package.json index 1727037f4f8..0400be7db00 100644 --- a/packages/platform/platform-serverless-http/package.json +++ b/packages/platform/platform-serverless-http/package.json @@ -71,7 +71,7 @@ "@types/aws-lambda": "^8.10.136", "eslint": "^8.57.0", "serverless-http": "^3.2.0", - "typescript": "4.9.5", + "typescript": "5.6.2", "vitest": "2.0.4" }, "peerDependencies": { diff --git a/packages/platform/platform-serverless-http/src/builder/PlatformServerlessHttp.spec.ts b/packages/platform/platform-serverless-http/src/builder/PlatformServerlessHttp.spec.ts index 20fcb19ebea..7d2fa90cd4d 100644 --- a/packages/platform/platform-serverless-http/src/builder/PlatformServerlessHttp.spec.ts +++ b/packages/platform/platform-serverless-http/src/builder/PlatformServerlessHttp.spec.ts @@ -1,6 +1,7 @@ -import {PlatformExpress} from "@tsed/platform-express"; import {PlatformBuilder} from "@tsed/common"; +import {PlatformExpress} from "@tsed/platform-express"; import serverless from "serverless-http"; + import {PlatformServerlessHttp} from "./PlatformServerlessHttp.js"; vi.mock("serverless-http"); diff --git a/packages/platform/platform-serverless-http/test/body.integration.spec.ts b/packages/platform/platform-serverless-http/test/body.integration.spec.ts index 6eb195adb4f..2aa81d779a8 100644 --- a/packages/platform/platform-serverless-http/test/body.integration.spec.ts +++ b/packages/platform/platform-serverless-http/test/body.integration.spec.ts @@ -1,9 +1,11 @@ import "@tsed/ajv"; + import {Controller} from "@tsed/di"; -import {MinLength, Patch, Post, Property, Put, Returns} from "@tsed/schema"; -import {PlatformServerlessTest} from "@tsed/platform-serverless-testing"; import {PlatformExpress} from "@tsed/platform-express"; import {BodyParams} from "@tsed/platform-params"; +import {PlatformServerlessTest} from "@tsed/platform-serverless-testing"; +import {MinLength, Patch, Post, Property, Put, Returns} from "@tsed/schema"; + import {PlatformServerlessHttp} from "../src/index.js"; import {Server} from "./integration/aws-basic/src/Server.js"; @@ -24,8 +26,8 @@ class BodyLambda { }; } - @Put("/scenario-2").Name("scenario2") - @Returns(201, Model).Header("x-test", "test") + @(Put("/scenario-2").Name("scenario2")) + @(Returns(201, Model).Header("x-test", "test")) scenario2(@BodyParams() model: Model) { return model; } diff --git a/packages/platform/platform-serverless-http/test/integration/aws-basic/src/Server.ts b/packages/platform/platform-serverless-http/test/integration/aws-basic/src/Server.ts index 45e6322ffae..d21396888c7 100644 --- a/packages/platform/platform-serverless-http/test/integration/aws-basic/src/Server.ts +++ b/packages/platform/platform-serverless-http/test/integration/aws-basic/src/Server.ts @@ -1,11 +1,12 @@ -import {Configuration, Inject} from "@tsed/di"; -import {TimeslotsController} from "./TimeslotsController.js"; import {PlatformApplication} from "@tsed/common"; +import {Configuration, Inject} from "@tsed/di"; import bodyParser from "body-parser"; -import cookieParser from "cookie-parser"; import compress from "compression"; +import cookieParser from "cookie-parser"; import methodOverride from "method-override"; +import {TimeslotsController} from "./TimeslotsController.js"; + @Configuration({ logger: { disableRoutesSummary: true diff --git a/packages/platform/platform-serverless-http/test/integration/aws-basic/src/TimeslotsController.ts b/packages/platform/platform-serverless-http/test/integration/aws-basic/src/TimeslotsController.ts index 645a397ccaf..d2bbc6b40e9 100644 --- a/packages/platform/platform-serverless-http/test/integration/aws-basic/src/TimeslotsController.ts +++ b/packages/platform/platform-serverless-http/test/integration/aws-basic/src/TimeslotsController.ts @@ -1,6 +1,6 @@ import {Controller} from "@tsed/di"; +import {BodyParams, PathParams, QueryParams} from "@tsed/platform-params"; import {Delete, Get, Post, Put} from "@tsed/schema"; -import {PathParams, QueryParams, BodyParams} from "@tsed/platform-params"; import {Description, Groups, Returns, Summary} from "@tsed/schema"; @Controller("/timeslots") diff --git a/packages/platform/platform-serverless-http/test/integration/aws-basic/src/index.ts b/packages/platform/platform-serverless-http/test/integration/aws-basic/src/index.ts index df9368bdc48..afe3a1d919b 100644 --- a/packages/platform/platform-serverless-http/test/integration/aws-basic/src/index.ts +++ b/packages/platform/platform-serverless-http/test/integration/aws-basic/src/index.ts @@ -1,5 +1,6 @@ -import {PlatformServerlessHttp} from "@tsed/platform-serverless-http"; import {PlatformExpress} from "@tsed/platform-express"; + +import {PlatformServerlessHttp} from "../../../.."; import {Server} from "./Server.js"; const platform = PlatformServerlessHttp.bootstrap(Server, { diff --git a/packages/platform/platform-serverless-http/test/serverlessContext.integration.spec.ts b/packages/platform/platform-serverless-http/test/serverlessContext.integration.spec.ts index 020d9eb0b3c..9b61ac4b2c6 100644 --- a/packages/platform/platform-serverless-http/test/serverlessContext.integration.spec.ts +++ b/packages/platform/platform-serverless-http/test/serverlessContext.integration.spec.ts @@ -1,8 +1,10 @@ import "@tsed/ajv"; + import {Controller} from "@tsed/di"; -import {Get, Returns} from "@tsed/schema"; -import {PlatformServerlessTest} from "@tsed/platform-serverless-testing"; import {PlatformExpress} from "@tsed/platform-express"; +import {PlatformServerlessTest} from "@tsed/platform-serverless-testing"; +import {Get, Returns} from "@tsed/schema"; + import {PlatformServerlessHttp, ServerlessContext, ServerlessEvent} from "../src/index.js"; import {Server} from "./integration/aws-basic/src/Server.js"; diff --git a/packages/platform/platform-serverless-http/tsconfig.esm.json b/packages/platform/platform-serverless-http/tsconfig.esm.json index e3b07081667..82292550ddb 100644 --- a/packages/platform/platform-serverless-http/tsconfig.esm.json +++ b/packages/platform/platform-serverless-http/tsconfig.esm.json @@ -2,8 +2,7 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "module": "ESNext", - "moduleResolution": "nodenext", + "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", @@ -11,7 +10,7 @@ "composite": true, "noEmit": false }, - "include": ["src", "src/**/*.json"], + "include": ["src/**/*.ts", "src/**/*.json"], "exclude": [ "node_modules", "test", diff --git a/packages/platform/platform-serverless-http/tsconfig.spec.json b/packages/platform/platform-serverless-http/tsconfig.spec.json index 558e0364fd6..e4a7187922c 100644 --- a/packages/platform/platform-serverless-http/tsconfig.spec.json +++ b/packages/platform/platform-serverless-http/tsconfig.spec.json @@ -3,7 +3,6 @@ "compilerOptions": { "baseUrl": ".", "rootDir": "../..", - "module": "commonjs", "outDir": "./lib/cjs", "declaration": false, "composite": false, diff --git a/packages/platform/platform-serverless-testing/package.json b/packages/platform/platform-serverless-testing/package.json index 5a828691690..33eac3f6056 100644 --- a/packages/platform/platform-serverless-testing/package.json +++ b/packages/platform/platform-serverless-testing/package.json @@ -64,7 +64,7 @@ "@tsed/typescript": "workspace:*", "@types/aws-lambda": "^8.10.136", "eslint": "^8.57.0", - "typescript": "4.9.5" + "typescript": "5.6.2" }, "dependencies": { "tslib": "2.6.1" diff --git a/packages/platform/platform-serverless-testing/src/PlatformServerlessTest.ts b/packages/platform/platform-serverless-testing/src/PlatformServerlessTest.ts index 7ef46be931b..d33203121ea 100644 --- a/packages/platform/platform-serverless-testing/src/PlatformServerlessTest.ts +++ b/packages/platform/platform-serverless-testing/src/PlatformServerlessTest.ts @@ -1,10 +1,11 @@ +import {PlatformBuilder, PlatformBuilderSettings} from "@tsed/common"; +import {nameOf, Type} from "@tsed/core"; import {DITest} from "@tsed/di"; import {APIGatewayEventDefaultAuthorizerContext, APIGatewayProxyEventBase, APIGatewayProxyHandler} from "aws-lambda"; import {APIGatewayProxyResult} from "aws-lambda/trigger/api-gateway-proxy.js"; -import {createFakeEvent} from "./createFakeEvent.js"; + import {createFakeContext} from "./createFakeContext.js"; -import {nameOf, Type} from "@tsed/core"; -import {PlatformBuilder, PlatformBuilderSettings} from "@tsed/common"; +import {createFakeEvent} from "./createFakeEvent.js"; export interface LambdaPromiseResult extends Promise {} diff --git a/packages/platform/platform-serverless-testing/src/index.ts b/packages/platform/platform-serverless-testing/src/index.ts index 9a010cbb53d..f6a531392ee 100644 --- a/packages/platform/platform-serverless-testing/src/index.ts +++ b/packages/platform/platform-serverless-testing/src/index.ts @@ -1,3 +1,3 @@ -export * from "./createFakeEvent.js"; export * from "./createFakeContext.js"; +export * from "./createFakeEvent.js"; export * from "./PlatformServerlessTest.js"; diff --git a/packages/platform/platform-serverless-testing/tsconfig.esm.json b/packages/platform/platform-serverless-testing/tsconfig.esm.json index e3b07081667..82292550ddb 100644 --- a/packages/platform/platform-serverless-testing/tsconfig.esm.json +++ b/packages/platform/platform-serverless-testing/tsconfig.esm.json @@ -2,8 +2,7 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "module": "ESNext", - "moduleResolution": "nodenext", + "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", @@ -11,7 +10,7 @@ "composite": true, "noEmit": false }, - "include": ["src", "src/**/*.json"], + "include": ["src/**/*.ts", "src/**/*.json"], "exclude": [ "node_modules", "test", diff --git a/packages/platform/platform-serverless/package.json b/packages/platform/platform-serverless/package.json index d2beb503b53..de0e6a84459 100644 --- a/packages/platform/platform-serverless/package.json +++ b/packages/platform/platform-serverless/package.json @@ -42,7 +42,7 @@ "@types/mime": "^3.0.4", "eslint": "^8.57.0", "find-my-way": "^8.2.0", - "typescript": "4.9.5", + "typescript": "5.6.2", "vitest": "2.0.4" }, "peerDependencies": { diff --git a/packages/platform/platform-serverless/src/builder/PlatformServerless.spec.ts b/packages/platform/platform-serverless/src/builder/PlatformServerless.spec.ts index c6c2842a456..7b504d9e420 100644 --- a/packages/platform/platform-serverless/src/builder/PlatformServerless.spec.ts +++ b/packages/platform/platform-serverless/src/builder/PlatformServerless.spec.ts @@ -1,7 +1,8 @@ import {Controller, Inject, Injectable} from "@tsed/di"; import {BodyParams, PathParams, QueryParams} from "@tsed/platform-params"; -import {PlatformServerlessTest, createFakeEvent, createFakeContext} from "@tsed/platform-serverless-testing"; +import {createFakeContext, createFakeEvent, PlatformServerlessTest} from "@tsed/platform-serverless-testing"; import {Delete, Get, Patch, Post, Put} from "@tsed/schema"; + import {PlatformServerless} from "./PlatformServerless.js"; @Injectable() @@ -16,7 +17,7 @@ class TimeslotsLambdaController { @Inject() protected timeslotsService: TimeslotsService; - @Get("/:id").Name("byID") + @(Get("/:id").Name("byID")) getByID(@PathParams("id") id: string) { return { id diff --git a/packages/platform/platform-serverless/src/builder/PlatformServerless.ts b/packages/platform/platform-serverless/src/builder/PlatformServerless.ts index 63242eb607d..e9f8fb6a4d9 100644 --- a/packages/platform/platform-serverless/src/builder/PlatformServerless.ts +++ b/packages/platform/platform-serverless/src/builder/PlatformServerless.ts @@ -5,6 +5,7 @@ import {getOperationsRoutes, JsonEntityStore} from "@tsed/schema"; import type {Handler} from "aws-lambda"; import type {Context} from "aws-lambda/handler.js"; import type {HTTPMethod, Instance} from "find-my-way"; + import {ServerlessContext} from "../domain/ServerlessContext.js"; import type {ServerlessEvent} from "../domain/ServerlessEvent.js"; import {type RequestHandler, ServerlessResponseStream} from "../domain/ServerlessResponseStream.js"; diff --git a/packages/platform/platform-serverless/src/builder/PlatformServerlessHandler.spec.ts b/packages/platform/platform-serverless/src/builder/PlatformServerlessHandler.spec.ts index 6c9cd5b0167..ccf2c8638bd 100644 --- a/packages/platform/platform-serverless/src/builder/PlatformServerlessHandler.spec.ts +++ b/packages/platform/platform-serverless/src/builder/PlatformServerlessHandler.spec.ts @@ -4,6 +4,7 @@ import {Unauthorized} from "@tsed/exceptions"; import {QueryParams} from "@tsed/platform-params"; import {JsonEntityStore} from "@tsed/schema"; import type {APIGatewayTokenAuthorizerEvent} from "aws-lambda"; + import {ServerlessContext} from "../domain/ServerlessContext.js"; import {PlatformServerlessHandler} from "./PlatformServerlessHandler.js"; diff --git a/packages/platform/platform-serverless/src/builder/PlatformServerlessHandler.ts b/packages/platform/platform-serverless/src/builder/PlatformServerlessHandler.ts index 87290a3c1cc..c39b79e0cba 100644 --- a/packages/platform/platform-serverless/src/builder/PlatformServerlessHandler.ts +++ b/packages/platform/platform-serverless/src/builder/PlatformServerlessHandler.ts @@ -1,9 +1,11 @@ +import {pipeline} from "node:stream/promises"; + import {AnyPromiseResult, AnyToPromise, isSerializable, isStream} from "@tsed/core"; import {BaseContext, Inject, Injectable, InjectorService, LazyInject, ProviderScope, TokenProvider} from "@tsed/di"; import {serialize} from "@tsed/json-mapper"; import type {PlatformExceptions} from "@tsed/platform-exceptions"; import {DeserializerPipe, PlatformParams, ValidationPipe} from "@tsed/platform-params"; -import {pipeline} from "node:stream/promises"; + import {ServerlessContext} from "../domain/ServerlessContext.js"; import type {ServerlessEvent} from "../domain/ServerlessEvent.js"; import {ServerlessResponseStream} from "../domain/ServerlessResponseStream.js"; diff --git a/packages/platform/platform-serverless/src/domain/ServerlessContext.spec.ts b/packages/platform/platform-serverless/src/domain/ServerlessContext.spec.ts index e646490b669..f4116c06c6b 100644 --- a/packages/platform/platform-serverless/src/domain/ServerlessContext.spec.ts +++ b/packages/platform/platform-serverless/src/domain/ServerlessContext.spec.ts @@ -1,4 +1,5 @@ import {PlatformServerlessTest} from "@tsed/platform-serverless-testing"; + import {createServerlessContext} from "../../test/utils/createServerlessContext.js"; describe("ServerlessContext", () => { diff --git a/packages/platform/platform-serverless/src/domain/ServerlessContext.ts b/packages/platform/platform-serverless/src/domain/ServerlessContext.ts index e8024463043..598b6ce6a03 100644 --- a/packages/platform/platform-serverless/src/domain/ServerlessContext.ts +++ b/packages/platform/platform-serverless/src/domain/ServerlessContext.ts @@ -1,6 +1,7 @@ import {DIContext, DIContextOptions} from "@tsed/di"; import {JsonEntityStore} from "@tsed/schema"; import {type APIGatewayProxyEvent, Context} from "aws-lambda"; + import {ServerlessRequest} from "./ServerlessRequest.js"; import {ServerlessResponse} from "./ServerlessResponse.js"; import type {ServerlessResponseStream} from "./ServerlessResponseStream.js"; diff --git a/packages/platform/platform-serverless/src/domain/ServerlessRequest.spec.ts b/packages/platform/platform-serverless/src/domain/ServerlessRequest.spec.ts index 613fd503584..6e79a3a4870 100644 --- a/packages/platform/platform-serverless/src/domain/ServerlessRequest.spec.ts +++ b/packages/platform/platform-serverless/src/domain/ServerlessRequest.spec.ts @@ -1,4 +1,5 @@ import {PlatformServerlessTest} from "@tsed/platform-serverless-testing"; + import {createServerlessContext} from "../../test/utils/createServerlessContext.js"; describe("ServerlessRequest", () => { diff --git a/packages/platform/platform-serverless/src/domain/ServerlessRequest.ts b/packages/platform/platform-serverless/src/domain/ServerlessRequest.ts index a874f5ca0ee..eeaf3a4ac4f 100644 --- a/packages/platform/platform-serverless/src/domain/ServerlessRequest.ts +++ b/packages/platform/platform-serverless/src/domain/ServerlessRequest.ts @@ -1,5 +1,6 @@ import {getValue} from "@tsed/core"; import type {APIGatewayProxyEvent} from "aws-lambda"; + import {ServerlessContext} from "./ServerlessContext.js"; /** diff --git a/packages/platform/platform-serverless/src/domain/ServerlessResponse.spec.ts b/packages/platform/platform-serverless/src/domain/ServerlessResponse.spec.ts index 2923366394e..17e6d20c919 100644 --- a/packages/platform/platform-serverless/src/domain/ServerlessResponse.spec.ts +++ b/packages/platform/platform-serverless/src/domain/ServerlessResponse.spec.ts @@ -1,4 +1,5 @@ import {PlatformServerlessTest} from "@tsed/platform-serverless-testing"; + import {createServerlessContext} from "../../test/utils/createServerlessContext.js"; describe("ServerlessResponse", () => { diff --git a/packages/platform/platform-serverless/src/domain/ServerlessResponse.ts b/packages/platform/platform-serverless/src/domain/ServerlessResponse.ts index f86b60de65d..a53d9d23dcb 100644 --- a/packages/platform/platform-serverless/src/domain/ServerlessResponse.ts +++ b/packages/platform/platform-serverless/src/domain/ServerlessResponse.ts @@ -3,6 +3,7 @@ import {getStatusMessage} from "@tsed/schema"; import type {APIGatewayProxyEvent} from "aws-lambda"; import encodeUrl from "encodeurl"; import mime from "mime"; + import {ServerlessContext} from "./ServerlessContext.js"; export type HeaderValue = boolean | number | string; diff --git a/packages/platform/platform-serverless/src/domain/ServerlessResponseStream.spec.ts b/packages/platform/platform-serverless/src/domain/ServerlessResponseStream.spec.ts index 220536a6edc..e00dd32f036 100644 --- a/packages/platform/platform-serverless/src/domain/ServerlessResponseStream.spec.ts +++ b/packages/platform/platform-serverless/src/domain/ServerlessResponseStream.spec.ts @@ -1,4 +1,4 @@ -import {ServerlessResponseStream} from "./ServerlessResponseStream"; +import {ServerlessResponseStream} from "./ServerlessResponseStream.js"; describe("ServerlessResponseStream", () => { describe("streamifyResponse", () => { @@ -28,7 +28,7 @@ describe("ServerlessResponseStream", () => { expect(result).toEqual(undefined); expect(handler).toHaveBeenCalledWith(event, responseStream, context); - // @ts-expect-error + // @ts-ignore expect(ServerlessResponseStream.buildResponse).not.toHaveBeenCalled(); }); it("should wrap then handler with fallback responseStream", async () => { @@ -50,7 +50,7 @@ describe("ServerlessResponseStream", () => { expect(result).toEqual({ statusCode: 200 }); - // @ts-expect-error + // @ts-ignore expect(ServerlessResponseStream.buildResponse).toHaveBeenCalledWith(expect.any(ServerlessResponseStream)); expect(console.warn).toHaveBeenCalledWith({ event: "WRONG_AWS_STREAM_CONFIGURATION", diff --git a/packages/platform/platform-serverless/src/domain/ServerlessResponseStream.ts b/packages/platform/platform-serverless/src/domain/ServerlessResponseStream.ts index d7ddbf2b881..2d5607b4806 100644 --- a/packages/platform/platform-serverless/src/domain/ServerlessResponseStream.ts +++ b/packages/platform/platform-serverless/src/domain/ServerlessResponseStream.ts @@ -1,5 +1,7 @@ -import type {APIGatewayProxyEventV2, Callback, Context, Handler} from "aws-lambda"; import {Stream} from "node:stream"; + +import type {APIGatewayProxyEventV2, Callback, Context, Handler} from "aws-lambda"; + import {isInAWS} from "../utils/isInAWS.js"; export type ServerlessResponseMeta = {statusCode: number; headers: Record}; diff --git a/packages/platform/platform-serverless/src/exports.ts b/packages/platform/platform-serverless/src/exports.ts index 138c09d23db..65eae706eae 100644 --- a/packages/platform/platform-serverless/src/exports.ts +++ b/packages/platform/platform-serverless/src/exports.ts @@ -1,3 +1,3 @@ export * from "@tsed/di"; -export {Get, Post, Put, Delete, Head, Patch, Options, Operation, Operation as Lambda} from "@tsed/schema"; export * from "@tsed/platform-params"; +export {Delete, Get, Head, Operation as Lambda, Operation, Options, Patch, Post, Put} from "@tsed/schema"; diff --git a/packages/platform/platform-serverless/src/utils/getRequestId.ts b/packages/platform/platform-serverless/src/utils/getRequestId.ts index d5836c3f0bd..c62c261ade5 100644 --- a/packages/platform/platform-serverless/src/utils/getRequestId.ts +++ b/packages/platform/platform-serverless/src/utils/getRequestId.ts @@ -1,5 +1,6 @@ import {Context} from "aws-lambda"; import {v4} from "uuid"; + import type {ServerlessEvent} from "../domain/ServerlessEvent.js"; export function getRequestId(event: ServerlessEvent, context: Context) { diff --git a/packages/platform/platform-serverless/src/utils/setResponseHeaders.spec.ts b/packages/platform/platform-serverless/src/utils/setResponseHeaders.spec.ts index a5817697983..550f7abe733 100644 --- a/packages/platform/platform-serverless/src/utils/setResponseHeaders.spec.ts +++ b/packages/platform/platform-serverless/src/utils/setResponseHeaders.spec.ts @@ -1,5 +1,6 @@ import {PlatformTest} from "@tsed/common"; import {Get, JsonEntityStore, Redirect, Returns} from "@tsed/schema"; + import {createServerlessContext} from "../../test/utils/createServerlessContext.js"; import {setResponseHeaders} from "./setResponseHeaders.js"; @@ -10,7 +11,7 @@ describe("setResponseHeaders", () => { it("should set headers, status and contentType", async () => { class Test { @Get("/") - @Returns(200).Header("x-header", "test") + @(Returns(200).Header("x-header", "test")) test() {} } @@ -30,7 +31,7 @@ describe("setResponseHeaders", () => { it("should not set headers automatically", async () => { class Test { @Get("/") - @Returns(200).Header("x-header") + @(Returns(200).Header("x-header")) test() {} } @@ -107,7 +108,7 @@ describe("setResponseHeaders", () => { it("should do nothing when headers is already sent", async () => { class Test { @Get("/") - @Returns(200).Header("x-header", "test") + @(Returns(200).Header("x-header", "test")) test() {} } diff --git a/packages/platform/platform-serverless/src/utils/setResponseHeaders.ts b/packages/platform/platform-serverless/src/utils/setResponseHeaders.ts index 6e439b29f7e..aaf76d2ba51 100644 --- a/packages/platform/platform-serverless/src/utils/setResponseHeaders.ts +++ b/packages/platform/platform-serverless/src/utils/setResponseHeaders.ts @@ -1,4 +1,5 @@ import {JsonHeader, JsonOperation} from "@tsed/schema"; + import {ServerlessContext} from "../domain/ServerlessContext.js"; import type {ServerlessEvent} from "../domain/ServerlessEvent.js"; import {HeaderValue} from "../domain/ServerlessResponse.js"; diff --git a/packages/platform/platform-serverless/test/body.integration.spec.ts b/packages/platform/platform-serverless/test/body.integration.spec.ts index 6d01558ff03..43c9d8ec966 100644 --- a/packages/platform/platform-serverless/test/body.integration.spec.ts +++ b/packages/platform/platform-serverless/test/body.integration.spec.ts @@ -1,8 +1,10 @@ import "@tsed/ajv"; + import {Injectable} from "@tsed/di"; -import {BodyParams, PlatformServerless} from "@tsed/platform-serverless"; -import {MinLength, Patch, Post, Property, Put, Returns} from "@tsed/schema"; import {PlatformServerlessTest} from "@tsed/platform-serverless-testing"; +import {MinLength, Patch, Post, Property, Put, Returns} from "@tsed/schema"; + +import {BodyParams, PlatformServerless} from ".."; class Model { @Property() @@ -21,8 +23,8 @@ class BodyLambda { }; } - @Put("/scenario-2/:id").Name("scenario2") - @Returns(201, Model).Header("x-test", "test") + @(Put("/scenario-2/:id").Name("scenario2")) + @(Returns(201, Model).Header("x-test", "test")) scenario2(@BodyParams() model: Model) { return model; } diff --git a/packages/platform/platform-serverless/test/integration/aws-basic/src/TimeslotsLambda.ts b/packages/platform/platform-serverless/test/integration/aws-basic/src/TimeslotsLambda.ts index 5198dd6f7b3..f6cba030faa 100644 --- a/packages/platform/platform-serverless/test/integration/aws-basic/src/TimeslotsLambda.ts +++ b/packages/platform/platform-serverless/test/integration/aws-basic/src/TimeslotsLambda.ts @@ -1,7 +1,8 @@ import {Controller} from "@tsed/di"; -import {BodyParams, Delete, Get, Post, Put, PathParams, QueryParams} from "@tsed/platform-serverless"; import {Description, Groups, Returns, Summary} from "@tsed/schema"; +import {BodyParams, Delete, Get, PathParams, Post, Put, QueryParams} from "../../../.."; + @Controller("/timeslots") export class TimeslotsLambda { @Get("/:id") diff --git a/packages/platform/platform-serverless/test/integration/aws-basic/src/index.ts b/packages/platform/platform-serverless/test/integration/aws-basic/src/index.ts index 0eeac4554bc..0dacd790ad9 100644 --- a/packages/platform/platform-serverless/test/integration/aws-basic/src/index.ts +++ b/packages/platform/platform-serverless/test/integration/aws-basic/src/index.ts @@ -1,4 +1,4 @@ -import {PlatformServerless} from "@tsed/platform-serverless"; +import {PlatformServerless} from "../../../.."; import {TimeslotsLambda} from "./TimeslotsLambda.js"; const platform = PlatformServerless.bootstrap({ diff --git a/packages/platform/platform-serverless/test/params.integration.spec.ts b/packages/platform/platform-serverless/test/params.integration.spec.ts index 086d0efb4b3..e7400ea472b 100644 --- a/packages/platform/platform-serverless/test/params.integration.spec.ts +++ b/packages/platform/platform-serverless/test/params.integration.spec.ts @@ -1,7 +1,8 @@ import {Injectable} from "@tsed/di"; -import {PathParams, PlatformServerless} from "@tsed/platform-serverless"; -import {Delete, Get, Returns} from "@tsed/schema"; import {PlatformServerlessTest} from "@tsed/platform-serverless-testing"; +import {Delete, Get, Returns} from "@tsed/schema"; + +import {PathParams, PlatformServerless} from ".."; @Injectable() class PathParamLambda { diff --git a/packages/platform/platform-serverless/test/query.integration.spec.ts b/packages/platform/platform-serverless/test/query.integration.spec.ts index 38f63ebb8cd..58158596704 100644 --- a/packages/platform/platform-serverless/test/query.integration.spec.ts +++ b/packages/platform/platform-serverless/test/query.integration.spec.ts @@ -1,6 +1,7 @@ import {Injectable} from "@tsed/di"; -import {Get} from "@tsed/schema"; import {PlatformServerlessTest} from "@tsed/platform-serverless-testing"; +import {Get} from "@tsed/schema"; + import {PlatformServerless, QueryParams} from "../src/index.js"; @Injectable() diff --git a/packages/platform/platform-serverless/test/response.integration.spec.ts b/packages/platform/platform-serverless/test/response.integration.spec.ts index 783393cde1b..e1d9bc62c24 100644 --- a/packages/platform/platform-serverless/test/response.integration.spec.ts +++ b/packages/platform/platform-serverless/test/response.integration.spec.ts @@ -1,7 +1,8 @@ import {Injectable} from "@tsed/di"; -import {BodyParams, PlatformServerless} from "@tsed/platform-serverless"; -import {MinLength, Post, Property} from "@tsed/schema"; import {PlatformServerlessTest} from "@tsed/platform-serverless-testing"; +import {MinLength, Post, Property} from "@tsed/schema"; + +import {BodyParams, PlatformServerless} from ".."; class Model { @Property() diff --git a/packages/platform/platform-serverless/test/response.stream.integration.spec.ts b/packages/platform/platform-serverless/test/response.stream.integration.spec.ts index a27347f4bbf..d232e93ad59 100644 --- a/packages/platform/platform-serverless/test/response.stream.integration.spec.ts +++ b/packages/platform/platform-serverless/test/response.stream.integration.spec.ts @@ -1,13 +1,15 @@ +import {Readable} from "node:stream"; + import {Injectable} from "@tsed/di"; -import {BodyParams, PlatformServerless} from "@tsed/platform-serverless"; import {PlatformServerlessTest} from "@tsed/platform-serverless-testing"; import {Post, Returns} from "@tsed/schema"; -import {Readable} from "node:stream"; + +import {BodyParams, PlatformServerless} from ".."; @Injectable() class StreamLambda { @Post("/scenario-1/:id") - @Returns(200, String).Binary() + @(Returns(200, String).Binary()) scenario1(@BodyParams("id") id: string) { return Readable.from( Buffer.from( diff --git a/packages/platform/platform-serverless/test/utils/createServerlessContext.ts b/packages/platform/platform-serverless/test/utils/createServerlessContext.ts index efb4dfc1fb1..b163ac8a8e7 100644 --- a/packages/platform/platform-serverless/test/utils/createServerlessContext.ts +++ b/packages/platform/platform-serverless/test/utils/createServerlessContext.ts @@ -1,6 +1,7 @@ -import {JsonEntityStore} from "@tsed/schema"; -import {createFakeEvent, createFakeContext, PlatformServerlessTest} from "@tsed/platform-serverless-testing"; import {Logger} from "@tsed/logger"; +import {createFakeContext, createFakeEvent, PlatformServerlessTest} from "@tsed/platform-serverless-testing"; +import {JsonEntityStore} from "@tsed/schema"; + import {ServerlessContext} from "../../src/domain/ServerlessContext.js"; export function createServerlessContext({ diff --git a/packages/platform/platform-serverless/tsconfig.esm.json b/packages/platform/platform-serverless/tsconfig.esm.json index e3b07081667..82292550ddb 100644 --- a/packages/platform/platform-serverless/tsconfig.esm.json +++ b/packages/platform/platform-serverless/tsconfig.esm.json @@ -2,8 +2,7 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "module": "ESNext", - "moduleResolution": "nodenext", + "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", @@ -11,7 +10,7 @@ "composite": true, "noEmit": false }, - "include": ["src", "src/**/*.json"], + "include": ["src/**/*.ts", "src/**/*.json"], "exclude": [ "node_modules", "test", diff --git a/packages/platform/platform-serverless/tsconfig.spec.json b/packages/platform/platform-serverless/tsconfig.spec.json index 558e0364fd6..e4a7187922c 100644 --- a/packages/platform/platform-serverless/tsconfig.spec.json +++ b/packages/platform/platform-serverless/tsconfig.spec.json @@ -3,7 +3,6 @@ "compilerOptions": { "baseUrl": ".", "rootDir": "../..", - "module": "commonjs", "outDir": "./lib/cjs", "declaration": false, "composite": false, diff --git a/packages/platform/platform-test-sdk/package.json b/packages/platform/platform-test-sdk/package.json index 27e7ce1810f..660c1e31fb9 100644 --- a/packages/platform/platform-test-sdk/package.json +++ b/packages/platform/platform-test-sdk/package.json @@ -47,6 +47,6 @@ "@tsed/barrels": "workspace:*", "@tsed/typescript": "workspace:*", "eslint": "^8.57.0", - "typescript": "4.9.5" + "typescript": "5.6.2" } } diff --git a/packages/platform/platform-test-sdk/src/components/PlatformTestSdk.ts b/packages/platform/platform-test-sdk/src/components/PlatformTestSdk.ts index 2c6d6c8ca5a..d1571d394cf 100644 --- a/packages/platform/platform-test-sdk/src/components/PlatformTestSdk.ts +++ b/packages/platform/platform-test-sdk/src/components/PlatformTestSdk.ts @@ -1,4 +1,5 @@ import {PlatformTest} from "@tsed/common"; + import {PlatformTestingSdkOpts} from "../interfaces/index.js"; import {specsContainer} from "../tests/exports.js"; diff --git a/packages/platform/platform-test-sdk/src/modules/feature/FeatureModule.ts b/packages/platform/platform-test-sdk/src/modules/feature/FeatureModule.ts index 4f17045e03f..494e123b2df 100644 --- a/packages/platform/platform-test-sdk/src/modules/feature/FeatureModule.ts +++ b/packages/platform/platform-test-sdk/src/modules/feature/FeatureModule.ts @@ -1,4 +1,5 @@ import {Module} from "@tsed/di"; + import {FeatureController} from "./controllers/FeatureController.js"; @Module({ diff --git a/packages/platform/platform-test-sdk/src/tests/exports.ts b/packages/platform/platform-test-sdk/src/tests/exports.ts index 8f4b724df03..bbcf38f05b0 100644 --- a/packages/platform/platform-test-sdk/src/tests/exports.ts +++ b/packages/platform/platform-test-sdk/src/tests/exports.ts @@ -2,6 +2,7 @@ import {PlatformTestingSdkOpts} from "../interfaces/index.js"; import {testAcceptMime} from "./testAcceptMime.js"; import {testAuth} from "./testAuth.js"; import {testBodyParams} from "./testBodyParams.js"; +import {testCache} from "./testCache.js"; import {testChildrenControllers} from "./testChildrenControllers.js"; import {testCookies} from "./testCookies.js"; import {testCustom404} from "./testCustom404.js"; @@ -27,7 +28,6 @@ import {testSession} from "./testSession.js"; import {testStatics} from "./testStatics.js"; import {testStream} from "./testStream.js"; import {testView} from "./testView.js"; -import {testCache} from "./testCache.js"; export const specsContainer = new Map void>(); diff --git a/packages/platform/platform-test-sdk/src/tests/testAcceptMime.ts b/packages/platform/platform-test-sdk/src/tests/testAcceptMime.ts index 9cd198c6ea9..a8168cf5b24 100644 --- a/packages/platform/platform-test-sdk/src/tests/testAcceptMime.ts +++ b/packages/platform/platform-test-sdk/src/tests/testAcceptMime.ts @@ -2,6 +2,7 @@ import {AcceptMime, Controller, Get, HeaderParams, PlatformTest, Post} from "@ts import {ContentType} from "@tsed/schema"; import SuperTest from "supertest"; import {afterAll, beforeAll, describe, expect, it} from "vitest"; + import {PlatformTestingSdkOpts} from "../interfaces/index.js"; @Controller("/accept-mime") diff --git a/packages/platform/platform-test-sdk/src/tests/testAuth.ts b/packages/platform/platform-test-sdk/src/tests/testAuth.ts index 292cac8a795..2896c7a2c62 100644 --- a/packages/platform/platform-test-sdk/src/tests/testAuth.ts +++ b/packages/platform/platform-test-sdk/src/tests/testAuth.ts @@ -1,9 +1,10 @@ -import {expect, beforeAll, afterAll, describe, it} from "vitest"; import {Context, Controller, Get, Inject, Injectable, Middleware, PlatformTest, Post, Req, UseAuth} from "@tsed/common"; import {useDecorators} from "@tsed/core"; import {BadRequest, Forbidden, Unauthorized} from "@tsed/exceptions"; import {In, Returns, Security} from "@tsed/schema"; import SuperTest from "supertest"; +import {afterAll, beforeAll, describe, expect, it} from "vitest"; + import baseSpec from "../data/swagger.json"; import {PlatformTestingSdkOpts} from "../interfaces/index.js"; diff --git a/packages/platform/platform-test-sdk/src/tests/testBodyParams.ts b/packages/platform/platform-test-sdk/src/tests/testBodyParams.ts index efc94ef8a33..f170b0017fd 100644 --- a/packages/platform/platform-test-sdk/src/tests/testBodyParams.ts +++ b/packages/platform/platform-test-sdk/src/tests/testBodyParams.ts @@ -1,8 +1,8 @@ import "@tsed/ajv"; -import {expect, beforeAll, afterAll, describe, it} from "vitest"; + import {BodyParams, Context, Controller, HeaderParams, PlatformTest, RawBodyParams} from "@tsed/common"; import { - Post, + Consumes, Default, Description, GenericOf, @@ -10,12 +10,14 @@ import { Maximum, Minimum, Nullable, + Post, Property, Required, - Status, - Consumes + Status } from "@tsed/schema"; import SuperTest from "supertest"; +import {afterAll, beforeAll, describe, expect, it} from "vitest"; + import {PlatformTestingSdkOpts} from "../interfaces/index.js"; enum MyEnum { diff --git a/packages/platform/platform-test-sdk/src/tests/testCache.ts b/packages/platform/platform-test-sdk/src/tests/testCache.ts index 50df8f3ec97..06a5f063628 100644 --- a/packages/platform/platform-test-sdk/src/tests/testCache.ts +++ b/packages/platform/platform-test-sdk/src/tests/testCache.ts @@ -2,7 +2,8 @@ import {Controller, Get, Head, Inject, PathParams, PlatformTest, Post, QueryPara import {PlatformCache, UseCache} from "@tsed/platform-cache"; import {Property} from "@tsed/schema"; import SuperTest from "supertest"; -import {describe, expect, it, beforeEach, afterEach} from "vitest"; +import {afterEach, beforeEach, describe, expect, it} from "vitest"; + import {PlatformTestingSdkOpts} from "../interfaces/index.js"; let increment = 0; diff --git a/packages/platform/platform-test-sdk/src/tests/testChildrenControllers.ts b/packages/platform/platform-test-sdk/src/tests/testChildrenControllers.ts index f215d851680..847659a6a2c 100644 --- a/packages/platform/platform-test-sdk/src/tests/testChildrenControllers.ts +++ b/packages/platform/platform-test-sdk/src/tests/testChildrenControllers.ts @@ -1,6 +1,7 @@ -import {expect, beforeEach, afterEach, describe, it} from "vitest"; import {Controller, Get, PlatformTest} from "@tsed/common"; import SuperTest from "supertest"; +import {afterEach, beforeEach, describe, expect, it} from "vitest"; + import {PlatformTestingSdkOpts} from "../interfaces/index.js"; export function testChildrenControllers(options: PlatformTestingSdkOpts) { diff --git a/packages/platform/platform-test-sdk/src/tests/testCookies.ts b/packages/platform/platform-test-sdk/src/tests/testCookies.ts index c5db89aea2c..4a0550246a3 100644 --- a/packages/platform/platform-test-sdk/src/tests/testCookies.ts +++ b/packages/platform/platform-test-sdk/src/tests/testCookies.ts @@ -1,6 +1,7 @@ -import {expect, beforeAll, afterAll, it} from "vitest"; import {Controller, CookiesParams, Get, PlatformTest} from "@tsed/common"; import SuperTest from "supertest"; +import {afterAll, beforeAll, expect, it} from "vitest"; + import {PlatformTestingSdkOpts} from "../interfaces/index.js"; @Controller("/cookies") diff --git a/packages/platform/platform-test-sdk/src/tests/testCustom404.ts b/packages/platform/platform-test-sdk/src/tests/testCustom404.ts index c2ace90f802..2a419f8b990 100644 --- a/packages/platform/platform-test-sdk/src/tests/testCustom404.ts +++ b/packages/platform/platform-test-sdk/src/tests/testCustom404.ts @@ -1,6 +1,7 @@ -import {expect, beforeAll, afterAll, it} from "vitest"; import {PlatformTest} from "@tsed/common"; import SuperTest from "supertest"; +import {afterAll, beforeAll, expect, it} from "vitest"; + import {PlatformTestingSdkOpts} from "../interfaces/index.js"; export function testCustom404(options: PlatformTestingSdkOpts) { diff --git a/packages/platform/platform-test-sdk/src/tests/testDeepQueryParams.ts b/packages/platform/platform-test-sdk/src/tests/testDeepQueryParams.ts index 39db7ed3d88..146f714ae94 100644 --- a/packages/platform/platform-test-sdk/src/tests/testDeepQueryParams.ts +++ b/packages/platform/platform-test-sdk/src/tests/testDeepQueryParams.ts @@ -1,9 +1,11 @@ import "@tsed/ajv"; + import {Controller, Get, PlatformTest, QueryParams} from "@tsed/common"; import {Default, GenericOf, Generics, Maximum, Minimum, Property} from "@tsed/schema"; import SuperTest from "supertest"; +import {afterAll, beforeAll, describe, expect, it} from "vitest"; + import {PlatformTestingSdkOpts} from "../interfaces/index.js"; -import {expect, beforeAll, afterAll, describe, it} from "vitest"; class FindQuery { @Property() diff --git a/packages/platform/platform-test-sdk/src/tests/testErrors.ts b/packages/platform/platform-test-sdk/src/tests/testErrors.ts index e0727ce7d85..a1a59c3bfde 100644 --- a/packages/platform/platform-test-sdk/src/tests/testErrors.ts +++ b/packages/platform/platform-test-sdk/src/tests/testErrors.ts @@ -1,10 +1,12 @@ import "@tsed/ajv"; -import {expect, beforeAll, afterAll, it} from "vitest"; + import {BodyParams, Controller, Err, Get, Middleware, PlatformTest, Post, UseAfter} from "@tsed/common"; import {Env} from "@tsed/core"; import {BadRequest, InternalServerError} from "@tsed/exceptions"; import {Description, Name, Required, Returns, Summary} from "@tsed/schema"; import SuperTest from "supertest"; +import {afterAll, beforeAll, expect, it} from "vitest"; + import {CustomBadRequest} from "../errors/CustomBadRequest.js"; import {CustomInternalError} from "../errors/CustomInternalError.js"; import {PlatformTestingSdkOpts} from "../interfaces/index.js"; @@ -40,19 +42,19 @@ class FakeMiddleware { @Controller("/errors") export class ErrorsCtrl { @Get("/scenario-1") - @Returns(500, InternalServerError).Description("Custom Bad Request") + @(Returns(500, InternalServerError).Description("Custom Bad Request")) public scenario1() { throw new CustomBadRequest("Custom Bad Request"); } @Get("/scenario-2") - @Returns(500).Description("Internal Server Error") + @(Returns(500).Description("Internal Server Error")) public scenario2() { throw new Error("My error"); } @Get("/scenario-3") - @Returns(400, CustomInternalError).Description("Bad request") + @(Returns(400, CustomInternalError).Description("Bad request")) public scenario3() { throw new CustomInternalError("My custom error"); } @@ -64,7 +66,7 @@ export class ErrorsCtrl { } @Post("/scenario-5") - @Returns(400, BadRequest).Description("Bad request") + @(Returns(400, BadRequest).Description("Bad request")) public scenario5( @Required() @BodyParams() @@ -76,7 +78,7 @@ export class ErrorsCtrl { @Post("/scenario-6") @Summary("Throw a Required prop if prop name is required") @Description(`Return a required error`) - @Returns(400).Description("Bad request") + @(Returns(400).Description("Bad request")) public scenario6( @Required() @BodyParams() @@ -86,7 +88,7 @@ export class ErrorsCtrl { } @Get("/scenario-7") - @Returns(400).Description("Bad request") + @(Returns(400).Description("Bad request")) @UseAfter(FakeMiddleware) @UseAfter(ErrorMiddleware) public scenario7() { diff --git a/packages/platform/platform-test-sdk/src/tests/testHandlers.ts b/packages/platform/platform-test-sdk/src/tests/testHandlers.ts index f4030dae7d2..6f44f3d5f33 100644 --- a/packages/platform/platform-test-sdk/src/tests/testHandlers.ts +++ b/packages/platform/platform-test-sdk/src/tests/testHandlers.ts @@ -1,7 +1,8 @@ -import {expect, beforeAll, afterAll, it} from "vitest"; import {Context, Controller, Get, PathParams, PlatformTest} from "@tsed/common"; import {Property, Required, Title} from "@tsed/schema"; import SuperTest from "supertest"; +import {afterAll, beforeAll, expect, it} from "vitest"; + import {PlatformTestingSdkOpts} from "../interfaces/index.js"; export class MyModel { diff --git a/packages/platform/platform-test-sdk/src/tests/testHeaderParams.ts b/packages/platform/platform-test-sdk/src/tests/testHeaderParams.ts index e57aa905032..6ad991a1d83 100644 --- a/packages/platform/platform-test-sdk/src/tests/testHeaderParams.ts +++ b/packages/platform/platform-test-sdk/src/tests/testHeaderParams.ts @@ -1,7 +1,8 @@ -import {expect, beforeAll, afterAll, describe, it} from "vitest"; import {Context, Controller, Get, HeaderParams, Locals, Middleware, PlatformTest, Post, Req, Use} from "@tsed/common"; import {Enum, Required} from "@tsed/schema"; import SuperTest from "supertest"; +import {afterAll, beforeAll, describe, expect, it} from "vitest"; + import {PlatformTestingSdkOpts} from "../interfaces/index.js"; @Middleware() diff --git a/packages/platform/platform-test-sdk/src/tests/testHeaders.ts b/packages/platform/platform-test-sdk/src/tests/testHeaders.ts index b6baf9049d3..3155e180dd4 100644 --- a/packages/platform/platform-test-sdk/src/tests/testHeaders.ts +++ b/packages/platform/platform-test-sdk/src/tests/testHeaders.ts @@ -1,31 +1,32 @@ -import {expect, beforeAll, afterAll, it} from "vitest"; import {BodyParams, Controller, Get, PlatformResponse, PlatformTest, Res} from "@tsed/common"; import {Returns} from "@tsed/schema"; import SuperTest from "supertest"; +import {afterAll, beforeAll, expect, it} from "vitest"; + import {PlatformTestingSdkOpts} from "../interfaces/index.js"; @Controller("/headers") export class HeadersCtrl { @Get("/scenario-1") - @Returns(200, String).Header("test", "x-token") + @(Returns(200, String).Header("test", "x-token")) testScenario1(@BodyParams("test") value: string[]): any { return "hello"; } @Get("/scenario-2") - @Returns(200, String).Header("x-token-test", "test").Header("x-token-test-2", "test2").ContentType("application/xml") + @(Returns(200, String).Header("x-token-test", "test").Header("x-token-test-2", "test2").ContentType("application/xml")) testScenario2() { return ""; } @Get("/scenario-3") - @Returns(200, String).Headers({ + @(Returns(200, String).Headers({ Location: { description: "URL to the new xxx", type: "string", value: "/v1/location/header" } - }) + })) testScenario3(@Res() response: PlatformResponse) { response.setHeader("Location", `/v1/location`); return "Hello"; diff --git a/packages/platform/platform-test-sdk/src/tests/testInheritanceController.ts b/packages/platform/platform-test-sdk/src/tests/testInheritanceController.ts index 269fbfcf40c..1fa99e32658 100644 --- a/packages/platform/platform-test-sdk/src/tests/testInheritanceController.ts +++ b/packages/platform/platform-test-sdk/src/tests/testInheritanceController.ts @@ -1,9 +1,10 @@ -import {expect, beforeAll, afterAll, describe, it} from "vitest"; import {BodyParams, Controller, Get, Middleware, PathParams, PlatformTest, Post, QueryParams, UseAuth} from "@tsed/common"; import {NotFound} from "@tsed/exceptions"; import {Description, MaxLength, MinLength, Property, Returns, Summary} from "@tsed/schema"; import SuperTest from "supertest"; import {v4} from "uuid"; +import {afterAll, beforeAll, describe, expect, it} from "vitest"; + import {PlatformTestingSdkOpts} from "../interfaces/index.js"; export class Resource { @@ -61,7 +62,7 @@ export class ResourcesCtrl extends BaseController { } @Post("/") - @Returns(201).Type(Resource) + @(Returns(201).Type(Resource)) post(@BodyParams() resource: Resource) { resource.id = v4(); this.resources.push(resource); diff --git a/packages/platform/platform-test-sdk/src/tests/testLocals.ts b/packages/platform/platform-test-sdk/src/tests/testLocals.ts index 9e3fb523bb9..16450e341f9 100644 --- a/packages/platform/platform-test-sdk/src/tests/testLocals.ts +++ b/packages/platform/platform-test-sdk/src/tests/testLocals.ts @@ -1,6 +1,7 @@ -import {expect, beforeAll, afterAll, describe, it} from "vitest"; import {Context, Controller, Get, Locals, Middleware, PlatformContext, PlatformTest, Req, Use} from "@tsed/common"; import SuperTest from "supertest"; +import {afterAll, beforeAll, describe, expect, it} from "vitest"; + import {PlatformTestingSdkOpts} from "../interfaces/index.js"; @Middleware() diff --git a/packages/platform/platform-test-sdk/src/tests/testLocation.ts b/packages/platform/platform-test-sdk/src/tests/testLocation.ts index ac8086a78c6..1105bd56e94 100644 --- a/packages/platform/platform-test-sdk/src/tests/testLocation.ts +++ b/packages/platform/platform-test-sdk/src/tests/testLocation.ts @@ -1,7 +1,8 @@ -import {expect, beforeAll, afterAll, it} from "vitest"; import {Controller, Get, PlatformTest} from "@tsed/common"; -import SuperTest from "supertest"; import {Location} from "@tsed/schema"; +import SuperTest from "supertest"; +import {afterAll, beforeAll, expect, it} from "vitest"; + import {PlatformTestingSdkOpts} from "../interfaces/index.js"; @Controller("/location") diff --git a/packages/platform/platform-test-sdk/src/tests/testMiddlewares.ts b/packages/platform/platform-test-sdk/src/tests/testMiddlewares.ts index 32b6b8fb90a..f7dd74a9725 100644 --- a/packages/platform/platform-test-sdk/src/tests/testMiddlewares.ts +++ b/packages/platform/platform-test-sdk/src/tests/testMiddlewares.ts @@ -1,5 +1,5 @@ -import {expect, beforeAll, afterAll, describe, it} from "vitest"; import "@tsed/ajv"; + import { Context, Controller, @@ -15,6 +15,8 @@ import { } from "@tsed/common"; import {BadRequest, Exception, Unauthorized} from "@tsed/exceptions"; import SuperTest from "supertest"; +import {afterAll, beforeAll, describe, expect, it} from "vitest"; + import {PlatformTestingSdkOpts} from "../interfaces/index.js"; @Middleware() diff --git a/packages/platform/platform-test-sdk/src/tests/testModule.ts b/packages/platform/platform-test-sdk/src/tests/testModule.ts index 2751cbc1e9d..706a280b5ae 100644 --- a/packages/platform/platform-test-sdk/src/tests/testModule.ts +++ b/packages/platform/platform-test-sdk/src/tests/testModule.ts @@ -1,6 +1,7 @@ -import {expect, beforeAll, afterAll, describe, it} from "vitest"; import {Controller, Get, PlatformTest} from "@tsed/common"; import SuperTest from "supertest"; +import {afterAll, beforeAll, describe, expect, it} from "vitest"; + import {PlatformTestingSdkOpts} from "../interfaces/index.js"; import {FeatureModule} from "../modules/feature/FeatureModule.js"; diff --git a/packages/platform/platform-test-sdk/src/tests/testMulter.ts b/packages/platform/platform-test-sdk/src/tests/testMulter.ts index 6a289331e19..1428fd4d6ca 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 {expect, beforeAll, afterAll, describe, it, vi} from "vitest"; import {BodyParams, Controller, MulterOptions, MultipartFile, PlatformMulterFile, PlatformTest} from "@tsed/common"; 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"; + import {PlatformTestingSdkOpts} from "../interfaces/index.js"; const rootDir = import.meta.dirname; diff --git a/packages/platform/platform-test-sdk/src/tests/testPathParams.ts b/packages/platform/platform-test-sdk/src/tests/testPathParams.ts index cfa4c55cbfa..7f6a4f4ea6c 100644 --- a/packages/platform/platform-test-sdk/src/tests/testPathParams.ts +++ b/packages/platform/platform-test-sdk/src/tests/testPathParams.ts @@ -1,7 +1,8 @@ -import {expect, beforeAll, afterAll, it} from "vitest"; import {Context, Controller, Get, PathParams, PlatformTest, Post} from "@tsed/common"; import {Pattern} from "@tsed/schema"; import SuperTest from "supertest"; +import {afterAll, beforeAll, expect, it} from "vitest"; + import {PlatformTestingSdkOpts} from "../interfaces/index.js"; @Controller("/path-params") diff --git a/packages/platform/platform-test-sdk/src/tests/testQueryParams.ts b/packages/platform/platform-test-sdk/src/tests/testQueryParams.ts index 84e4a7a4c3b..1177b0cb705 100644 --- a/packages/platform/platform-test-sdk/src/tests/testQueryParams.ts +++ b/packages/platform/platform-test-sdk/src/tests/testQueryParams.ts @@ -1,8 +1,10 @@ -import {expect, beforeAll, afterAll, describe, it} from "vitest"; import "@tsed/ajv"; + import {Controller, Get, PlatformTest, QueryParams} from "@tsed/common"; import {Maximum, Minimum, Required} from "@tsed/schema"; import SuperTest from "supertest"; +import {afterAll, beforeAll, describe, expect, it} from "vitest"; + import {PlatformTestingSdkOpts} from "../interfaces/index.js"; export class RandomStringModel { diff --git a/packages/platform/platform-test-sdk/src/tests/testRedirect.ts b/packages/platform/platform-test-sdk/src/tests/testRedirect.ts index e2341ed1ea7..c31cc4fd111 100644 --- a/packages/platform/platform-test-sdk/src/tests/testRedirect.ts +++ b/packages/platform/platform-test-sdk/src/tests/testRedirect.ts @@ -1,6 +1,7 @@ -import {expect, beforeAll, afterAll, it} from "vitest"; import {Context, Controller, Get, Location, PlatformTest, Redirect} from "@tsed/common"; import SuperTest from "supertest"; +import {afterAll, beforeAll, expect, it} from "vitest"; + import {PlatformTestingSdkOpts} from "../interfaces/index.js"; @Controller("/redirect") @@ -38,7 +39,7 @@ class RedirectCtrl { } @Get("/scenario-6") - @Location("/path/to").Status(301) + @(Location("/path/to").Status(301)) testScenario6(@Context() ctx: Context) { return "Hello"; } diff --git a/packages/platform/platform-test-sdk/src/tests/testResponse.ts b/packages/platform/platform-test-sdk/src/tests/testResponse.ts index fb7ce73c800..cfa9f288da5 100644 --- a/packages/platform/platform-test-sdk/src/tests/testResponse.ts +++ b/packages/platform/platform-test-sdk/src/tests/testResponse.ts @@ -1,10 +1,11 @@ -import {expect, beforeAll, afterAll, describe, it} from "vitest"; import {Context, Controller, Get, getContext, PathParams, PlatformResponse, PlatformTest, Post, Res} from "@tsed/common"; import {CollectionOf, Enum, ForwardGroups, Groups, Ignore, Name, Property, Required, Returns, Status} from "@tsed/schema"; import axios from "axios"; import {of} from "rxjs"; import {agent, SuperAgentStatic} from "superagent"; import SuperTest from "supertest"; +import {afterAll, beforeAll, describe, expect, it} from "vitest"; + import {PlatformTestingSdkOpts} from "../interfaces/index.js"; class Base { @@ -168,9 +169,9 @@ class TestResponseParamsCtrl { @Get("/scenario13") async testScenario13(@Res() res: PlatformResponse) { - const http: SuperAgentStatic = agent(); + const client = agent(); - const image_res = await http.get("https://www.google.com/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png"); + const image_res = await client.get("https://www.google.com/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png"); res.setHeader("Content-Disposition", "inline;filename=googlelogo_color_272x92dp.png;"); res.setHeader("X-Content-Type-Options", "nosniff"); @@ -211,7 +212,7 @@ class TestResponseParamsCtrl { } @Get("/scenario17") - @Returns(201, ModelGroup).Groups("creation") + @(Returns(201, ModelGroup).Groups("creation")) testScenario17(): Promise { const model = new ModelGroup(); model.id = "id"; @@ -232,7 +233,7 @@ class TestResponseParamsCtrl { } @Get("/scenario19") - @Returns(200, AllowedModel).Groups("!admin").AllowedGroups("summary", "details") + @(Returns(200, AllowedModel).Groups("!admin").AllowedGroups("summary", "details")) testScenario19(): Promise { const model = new AllowedModel(); model.id = "id"; diff --git a/packages/platform/platform-test-sdk/src/tests/testResponseFilter.ts b/packages/platform/platform-test-sdk/src/tests/testResponseFilter.ts index a00a55b9d66..a419929050a 100644 --- a/packages/platform/platform-test-sdk/src/tests/testResponseFilter.ts +++ b/packages/platform/platform-test-sdk/src/tests/testResponseFilter.ts @@ -1,7 +1,8 @@ -import {expect, beforeAll, afterAll, describe, it} from "vitest"; import {Controller, Get, PlatformContext, PlatformTest, ResponseFilter, ResponseFilterMethods} from "@tsed/common"; import {Property, Returns} from "@tsed/schema"; import SuperTest from "supertest"; +import {afterAll, beforeAll, describe, expect, it} from "vitest"; + import {PlatformTestingSdkOpts} from "../interfaces/index.js"; class ResponseFilterModel { @@ -12,8 +13,8 @@ class ResponseFilterModel { @Controller("/response-filter") class TestResponseFilterCtrl { @Get("/scenario1/:id") - @Returns(200, ResponseFilterModel).Description("description") - @Returns(200, String).ContentType("text/xml") + @(Returns(200, ResponseFilterModel).Description("description")) + @(Returns(200, String).ContentType("text/xml")) public testScenario1() { return {id: "id"}; } diff --git a/packages/platform/platform-test-sdk/src/tests/testRouting.ts b/packages/platform/platform-test-sdk/src/tests/testRouting.ts index 119ac07681a..c743889fd4a 100644 --- a/packages/platform/platform-test-sdk/src/tests/testRouting.ts +++ b/packages/platform/platform-test-sdk/src/tests/testRouting.ts @@ -1,6 +1,7 @@ -import {expect, beforeAll, afterAll, afterEach, it, vi} from "vitest"; import {Controller, Get, PlatformTest, Put} from "@tsed/common"; import SuperTest from "supertest"; +import {afterAll, afterEach, beforeAll, expect, it, vi} from "vitest"; + import {PlatformTestingSdkOpts} from "../interfaces/index.js"; const stub = vi.fn(); diff --git a/packages/platform/platform-test-sdk/src/tests/testScopeRequest.ts b/packages/platform/platform-test-sdk/src/tests/testScopeRequest.ts index 97eab03ffdd..68132c1aced 100644 --- a/packages/platform/platform-test-sdk/src/tests/testScopeRequest.ts +++ b/packages/platform/platform-test-sdk/src/tests/testScopeRequest.ts @@ -1,6 +1,7 @@ -import {expect, beforeAll, afterAll, describe, it} from "vitest"; import {Controller, Get, PathParams, PlatformTest, ProviderScope, Scope, Service} from "@tsed/common"; import SuperTest from "supertest"; +import {afterAll, beforeAll, describe, expect, it} from "vitest"; + import {PlatformTestingSdkOpts} from "../interfaces/index.js"; @Service() diff --git a/packages/platform/platform-test-sdk/src/tests/testSession.ts b/packages/platform/platform-test-sdk/src/tests/testSession.ts index d18edaa354b..be38bbf313a 100644 --- a/packages/platform/platform-test-sdk/src/tests/testSession.ts +++ b/packages/platform/platform-test-sdk/src/tests/testSession.ts @@ -1,9 +1,10 @@ -import {expect, beforeAll, afterAll, describe, it} from "vitest"; import {BodyParams, Constant, Controller, Get, PlatformTest, Post, Req, Session} from "@tsed/common"; import {NotFound} from "@tsed/exceptions"; import {Allow, Email, Ignore, MinLength, 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"; export class UserCreation { diff --git a/packages/platform/platform-test-sdk/src/tests/testStatics.ts b/packages/platform/platform-test-sdk/src/tests/testStatics.ts index 49a98934054..eeb223c4b6c 100644 --- a/packages/platform/platform-test-sdk/src/tests/testStatics.ts +++ b/packages/platform/platform-test-sdk/src/tests/testStatics.ts @@ -1,10 +1,11 @@ -import {expect, beforeEach, afterEach, it} from "vitest"; import {Controller, PlatformTest} from "@tsed/common"; import {getValue} from "@tsed/core"; import {Configuration} from "@tsed/di"; import {PlatformRouter} from "@tsed/platform-router"; import {readFileSync} from "fs"; import SuperTest from "supertest"; +import {afterEach, beforeEach, expect, it} from "vitest"; + import {PlatformTestingSdkOpts} from "../interfaces/index.js"; @Controller("/statics") diff --git a/packages/platform/platform-test-sdk/src/tests/testStream.ts b/packages/platform/platform-test-sdk/src/tests/testStream.ts index 3a9f09e5bff..dab58eca59e 100644 --- a/packages/platform/platform-test-sdk/src/tests/testStream.ts +++ b/packages/platform/platform-test-sdk/src/tests/testStream.ts @@ -1,9 +1,10 @@ -import {expect, beforeAll, afterAll, describe, it} from "vitest"; import {Controller, Get, PlatformTest} from "@tsed/common"; import {ContentType} from "@tsed/schema"; import {createReadStream} from "fs"; import {join} from "path"; import SuperTest from "supertest"; +import {afterAll, beforeAll, describe, expect, it} from "vitest"; + import {PlatformTestingSdkOpts} from "../interfaces/index.js"; const rootDir = import.meta.dirname; diff --git a/packages/platform/platform-test-sdk/src/tests/testView.ts b/packages/platform/platform-test-sdk/src/tests/testView.ts index aa8c3a2c5f8..6e304e14531 100644 --- a/packages/platform/platform-test-sdk/src/tests/testView.ts +++ b/packages/platform/platform-test-sdk/src/tests/testView.ts @@ -1,8 +1,9 @@ -import {expect, beforeAll, afterAll, describe, it} from "vitest"; import {Controller, Get, Locals, Middleware, PlatformTest, UseBefore} from "@tsed/common"; +import {View} from "@tsed/platform-views"; import {EOL} from "os"; import SuperTest from "supertest"; -import {View} from "@tsed/platform-views"; +import {afterAll, beforeAll, describe, expect, it} from "vitest"; + import {PlatformTestingSdkOpts} from "../interfaces/index.js"; @Middleware() diff --git a/packages/platform/platform-test-sdk/tsconfig.esm.json b/packages/platform/platform-test-sdk/tsconfig.esm.json index e3b07081667..82292550ddb 100644 --- a/packages/platform/platform-test-sdk/tsconfig.esm.json +++ b/packages/platform/platform-test-sdk/tsconfig.esm.json @@ -2,8 +2,7 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "module": "ESNext", - "moduleResolution": "nodenext", + "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", @@ -11,7 +10,7 @@ "composite": true, "noEmit": false }, - "include": ["src", "src/**/*.json"], + "include": ["src/**/*.ts", "src/**/*.json"], "exclude": [ "node_modules", "test", diff --git a/packages/platform/platform-views/package.json b/packages/platform/platform-views/package.json index 880b423c2e1..155286f43ab 100644 --- a/packages/platform/platform-views/package.json +++ b/packages/platform/platform-views/package.json @@ -36,7 +36,7 @@ "@tsed/typescript": "workspace:*", "@types/ejs": "3.1.5", "eslint": "^8.57.0", - "typescript": "4.9.5", + "typescript": "5.6.2", "vitest": "2.0.4" }, "peerDependencies": { diff --git a/packages/platform/platform-views/src/services/PlatformViews.spec.ts b/packages/platform/platform-views/src/services/PlatformViews.spec.ts index 2b65a927abf..2db63552686 100644 --- a/packages/platform/platform-views/src/services/PlatformViews.spec.ts +++ b/packages/platform/platform-views/src/services/PlatformViews.spec.ts @@ -1,5 +1,6 @@ import {Injectable, PlatformTest} from "@tsed/common"; import {requires} from "@tsed/engines"; + import {PlatformViews} from "./PlatformViews.js"; @Injectable() @@ -42,7 +43,7 @@ describe("PlatformViews", () => { const result = await platformViews.render("views.ejs"); expect(result).toEqual("HTML"); - expect(engine.render).toBeCalledWith("views.ejs", { + expect(engine.render).toHaveBeenCalledWith("views.ejs", { cache: false, alter: "alter", global: "global", @@ -58,7 +59,7 @@ describe("PlatformViews", () => { const result = await platformViews.render("views", {test: "test"}); expect(result).toEqual("HTML"); - expect(engine.render).toBeCalledWith("views.ejs", { + expect(engine.render).toHaveBeenCalledWith("views.ejs", { cache: false, global: "global", test: "test", @@ -66,7 +67,7 @@ describe("PlatformViews", () => { requires: "requires" }); }); - it("should render a template without extension", async () => { + it("should render a template without extension and catch error", async () => { const platformViews = PlatformTest.get(PlatformViews); const engine = platformViews.getEngine("ejs")!; diff --git a/packages/platform/platform-views/src/services/PlatformViews.ts b/packages/platform/platform-views/src/services/PlatformViews.ts index b4d0fe76f16..a08a1655a76 100644 --- a/packages/platform/platform-views/src/services/PlatformViews.ts +++ b/packages/platform/platform-views/src/services/PlatformViews.ts @@ -3,6 +3,7 @@ import {Constant, Inject, InjectorService, Module} from "@tsed/di"; import {engines, getEngine, requires} from "@tsed/engines"; import Fs from "fs"; import {extname, join, resolve} from "path"; + import { PLATFORM_VIEWS_EXTENSIONS, PlatformViewEngine, diff --git a/packages/platform/platform-views/tsconfig.esm.json b/packages/platform/platform-views/tsconfig.esm.json index e3b07081667..82292550ddb 100644 --- a/packages/platform/platform-views/tsconfig.esm.json +++ b/packages/platform/platform-views/tsconfig.esm.json @@ -2,8 +2,7 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "module": "ESNext", - "moduleResolution": "nodenext", + "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", @@ -11,7 +10,7 @@ "composite": true, "noEmit": false }, - "include": ["src", "src/**/*.json"], + "include": ["src/**/*.ts", "src/**/*.json"], "exclude": [ "node_modules", "test", diff --git a/packages/platform/platform-views/tsconfig.spec.json b/packages/platform/platform-views/tsconfig.spec.json index a8174c232a8..c6e9f98ef8f 100644 --- a/packages/platform/platform-views/tsconfig.spec.json +++ b/packages/platform/platform-views/tsconfig.spec.json @@ -3,7 +3,6 @@ "compilerOptions": { "baseUrl": ".", "rootDir": "../..", - "module": "commonjs", "outDir": "./lib/cjs", "declaration": false, "composite": false, diff --git a/packages/security/jwks/package.json b/packages/security/jwks/package.json index 47eb81aaf26..3198c400361 100644 --- a/packages/security/jwks/package.json +++ b/packages/security/jwks/package.json @@ -30,7 +30,7 @@ "@tsed/barrels": "workspace:*", "@tsed/typescript": "workspace:*", "eslint": "^8.57.0", - "typescript": "4.9.5", + "typescript": "5.6.2", "vitest": "2.0.4" } } diff --git a/packages/security/jwks/src/getJwks.spec.ts b/packages/security/jwks/src/getJwks.spec.ts index 08166dac525..de38c103c36 100644 --- a/packages/security/jwks/src/getJwks.spec.ts +++ b/packages/security/jwks/src/getJwks.spec.ts @@ -1,5 +1,6 @@ import fs from "fs-extra"; import {join} from "path"; + import {generateJwks, getJwks} from "./getJwks.js"; const rootDir = join(import.meta.dirname, "__mocks__"); @@ -21,7 +22,7 @@ describe("GetJwks", () => { {path: join(rootDir, "keys", "sig.rsa.prv.pem"), alg: "RS256", use: "sig"}, {path: join(rootDir, "keys", "enc.rsa.pub.pem"), alg: "RS256", use: "enc", kid: "key-1"}, {path: join(rootDir, "keys", "enc.rsa.prv.pem"), alg: "RS256", use: "enc"} - ] + ] as never }); expect(output).toEqual({ diff --git a/packages/security/jwks/src/getJwks.ts b/packages/security/jwks/src/getJwks.ts index 50fd63eff07..f26b520123b 100644 --- a/packages/security/jwks/src/getJwks.ts +++ b/packages/security/jwks/src/getJwks.ts @@ -1,7 +1,8 @@ +import {dirname} from "node:path"; + import fs from "fs-extra"; // @ts-ignore import {JWK, JWKS, KeyParameters} from "jose2"; -import {dirname} from "node:path"; export interface JwksKeyParameters extends KeyParameters { path: string; diff --git a/packages/security/jwks/src/index.ts b/packages/security/jwks/src/index.ts index 0f0843f6b49..485f1020f92 100644 --- a/packages/security/jwks/src/index.ts +++ b/packages/security/jwks/src/index.ts @@ -1,3 +1,3 @@ +export * from "./getJwks.js"; // @ts-ignore export * from "jose2"; -export * from "./getJwks.js"; diff --git a/packages/security/jwks/tsconfig.esm.json b/packages/security/jwks/tsconfig.esm.json index e3b07081667..82292550ddb 100644 --- a/packages/security/jwks/tsconfig.esm.json +++ b/packages/security/jwks/tsconfig.esm.json @@ -2,8 +2,7 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "module": "ESNext", - "moduleResolution": "nodenext", + "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", @@ -11,7 +10,7 @@ "composite": true, "noEmit": false }, - "include": ["src", "src/**/*.json"], + "include": ["src/**/*.ts", "src/**/*.json"], "exclude": [ "node_modules", "test", diff --git a/packages/security/jwks/tsconfig.spec.json b/packages/security/jwks/tsconfig.spec.json index 21485bab96d..2e917f4b39d 100644 --- a/packages/security/jwks/tsconfig.spec.json +++ b/packages/security/jwks/tsconfig.spec.json @@ -3,7 +3,6 @@ "compilerOptions": { "baseUrl": ".", "rootDir": "../..", - "module": "commonjs", "outDir": "./lib/cjs", "declaration": false, "composite": false, diff --git a/packages/security/oidc-provider-plugin-wildcard-redirect-uri/package.json b/packages/security/oidc-provider-plugin-wildcard-redirect-uri/package.json index 95ca864ac4c..301bd79d66c 100644 --- a/packages/security/oidc-provider-plugin-wildcard-redirect-uri/package.json +++ b/packages/security/oidc-provider-plugin-wildcard-redirect-uri/package.json @@ -40,7 +40,7 @@ "@types/psl": "^1.1.3", "@types/uuid": "9.0.8", "eslint": "^8.57.0", - "typescript": "4.9.5", + "typescript": "5.6.2", "vitest": "2.0.4" }, "peerDependencies": { diff --git a/packages/security/oidc-provider-plugin-wildcard-redirect-uri/src/OidcWildcardRedirectUriModule.spec.ts b/packages/security/oidc-provider-plugin-wildcard-redirect-uri/src/OidcWildcardRedirectUriModule.spec.ts index 2b46c312405..d5980d01781 100644 --- a/packages/security/oidc-provider-plugin-wildcard-redirect-uri/src/OidcWildcardRedirectUriModule.spec.ts +++ b/packages/security/oidc-provider-plugin-wildcard-redirect-uri/src/OidcWildcardRedirectUriModule.spec.ts @@ -1,6 +1,7 @@ import {PlatformTest} from "@tsed/common"; import {catchError} from "@tsed/core"; import {errors, KoaContextWithOIDC} from "oidc-provider"; + import {OidcWildcardRedirectUriModule} from "./OidcWildcardRedirectUriModule.js"; import InvalidClientMetadata = errors.InvalidClientMetadata; @@ -55,7 +56,7 @@ describe("WildcardRedirectUriAllowed", () => { const service = PlatformTest.get(OidcWildcardRedirectUriModule); service.validator({} as KoaContextWithOIDC, "key", "value"); }); - it("should throw an error if one of client redirect_uri contains more than one '*' ", () => { + it("should throw an error if one of client redirect_uri contains more than one '*'", () => { const service = PlatformTest.get(OidcWildcardRedirectUriModule); const error = catchError(() => @@ -92,7 +93,7 @@ describe("WildcardRedirectUriAllowed", () => { const service = PlatformTest.get(OidcWildcardRedirectUriModule); service.validator({} as KoaContextWithOIDC, "key", "value"); }); - it("should throw an error if one of client post_logout_redirect_uris contains more than one '*' ", () => { + it("should throw an error if one of client post_logout_redirect_uris contains more than one '*'", () => { const service = PlatformTest.get(OidcWildcardRedirectUriModule); const error = catchError(() => diff --git a/packages/security/oidc-provider-plugin-wildcard-redirect-uri/src/OidcWildcardRedirectUriModule.ts b/packages/security/oidc-provider-plugin-wildcard-redirect-uri/src/OidcWildcardRedirectUriModule.ts index 2dce0f5f59a..6d05fb8d5c7 100644 --- a/packages/security/oidc-provider-plugin-wildcard-redirect-uri/src/OidcWildcardRedirectUriModule.ts +++ b/packages/security/oidc-provider-plugin-wildcard-redirect-uri/src/OidcWildcardRedirectUriModule.ts @@ -5,6 +5,7 @@ import {OIDC_PROVIDER_NODE_MODULE, OidcSettings} from "@tsed/oidc-provider"; import type {default as Provider, KoaContextWithOIDC} from "oidc-provider"; // @ts-ignore import psl from "psl"; + import {wildcardRedirectUriAllowed} from "./utils/wildcardRedirectUriAllowed.js"; declare global { diff --git a/packages/security/oidc-provider-plugin-wildcard-redirect-uri/src/utils/wildcardRedirectUriAllowed.ts b/packages/security/oidc-provider-plugin-wildcard-redirect-uri/src/utils/wildcardRedirectUriAllowed.ts index a3e1c1be163..670219d4839 100644 --- a/packages/security/oidc-provider-plugin-wildcard-redirect-uri/src/utils/wildcardRedirectUriAllowed.ts +++ b/packages/security/oidc-provider-plugin-wildcard-redirect-uri/src/utils/wildcardRedirectUriAllowed.ts @@ -8,7 +8,10 @@ const hasWildcardHost = (redirectUri: string) => { const wildcardMatches = (redirectUri: string, wildcardUri: string) => !!wildcard(wildcardUri, redirectUri); -export function wildcardRedirectUriAllowed(originalRedirectUriAllowed: any, redirectUriOrPostLogoutRedirectUri: "redirectUris" | "postLogoutRedirectUris") { +export function wildcardRedirectUriAllowed( + originalRedirectUriAllowed: any, + redirectUriOrPostLogoutRedirectUri: "redirectUris" | "postLogoutRedirectUris" +) { return function (redirectUri: string) { if (this[redirectUriOrPostLogoutRedirectUri].some(hasWildcardHost)) { const wildcardUris = this[redirectUriOrPostLogoutRedirectUri].filter(hasWildcardHost); @@ -17,4 +20,3 @@ export function wildcardRedirectUriAllowed(originalRedirectUriAllowed: any, redi return originalRedirectUriAllowed.call(this, redirectUri); }; } - diff --git a/packages/security/oidc-provider-plugin-wildcard-redirect-uri/tsconfig.esm.json b/packages/security/oidc-provider-plugin-wildcard-redirect-uri/tsconfig.esm.json index e3b07081667..82292550ddb 100644 --- a/packages/security/oidc-provider-plugin-wildcard-redirect-uri/tsconfig.esm.json +++ b/packages/security/oidc-provider-plugin-wildcard-redirect-uri/tsconfig.esm.json @@ -2,8 +2,7 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "module": "ESNext", - "moduleResolution": "nodenext", + "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", @@ -11,7 +10,7 @@ "composite": true, "noEmit": false }, - "include": ["src", "src/**/*.json"], + "include": ["src/**/*.ts", "src/**/*.json"], "exclude": [ "node_modules", "test", diff --git a/packages/security/oidc-provider-plugin-wildcard-redirect-uri/tsconfig.spec.json b/packages/security/oidc-provider-plugin-wildcard-redirect-uri/tsconfig.spec.json index 21485bab96d..2e917f4b39d 100644 --- a/packages/security/oidc-provider-plugin-wildcard-redirect-uri/tsconfig.spec.json +++ b/packages/security/oidc-provider-plugin-wildcard-redirect-uri/tsconfig.spec.json @@ -3,7 +3,6 @@ "compilerOptions": { "baseUrl": ".", "rootDir": "../..", - "module": "commonjs", "outDir": "./lib/cjs", "declaration": false, "composite": false, diff --git a/packages/security/oidc-provider/package.json b/packages/security/oidc-provider/package.json index c48f319d8de..e25e3c34191 100644 --- a/packages/security/oidc-provider/package.json +++ b/packages/security/oidc-provider/package.json @@ -58,7 +58,7 @@ "eslint": "^8.57.0", "lowdb": "3.0.0", "oidc-provider": "8.4.5", - "typescript": "4.9.5", + "typescript": "5.6.2", "vitest": "2.0.4" }, "peerDependencies": { diff --git a/packages/security/oidc-provider/src/OidcModule.spec.ts b/packages/security/oidc-provider/src/OidcModule.spec.ts index 9b5f4b8a3d3..2964f1a5178 100644 --- a/packages/security/oidc-provider/src/OidcModule.spec.ts +++ b/packages/security/oidc-provider/src/OidcModule.spec.ts @@ -3,6 +3,7 @@ import expressRewrite from "express-urlrewrite"; import koaMount from "koa-mount"; // @ts-ignore import koaRewrite from "koa-rewrite"; + import {OidcModule} from "./OidcModule.js"; import {OidcProvider} from "./services/OidcProvider.js"; @@ -36,8 +37,8 @@ describe("OidcModule", () => { await mdl.$onRoutesInit(); - expect(expressRewrite).toBeCalledWith("/.well-known/*", "/oidc/.well-known/$1"); - expect(mdl.app.use).toBeCalledWith(expect.any(Function)); + expect(expressRewrite).toHaveBeenCalledWith("/.well-known/*", "/oidc/.well-known/$1"); + expect(mdl.app.use).toHaveBeenCalledWith(expect.any(Function)); }); it("should mount the oidc provider server to application", async () => { const provider = { @@ -60,7 +61,7 @@ describe("OidcModule", () => { await mdl.$afterRoutesInit(); - expect(mdl.app.use).toBeCalledWith("/oidc", "callback"); + expect(mdl.app.use).toHaveBeenCalledWith("/oidc", "callback"); }); }); }); @@ -83,8 +84,8 @@ describe("OidcModule", () => { await mdl.$onRoutesInit(); - expect(koaRewrite).toBeCalledWith("/.well-known/(.*)", "/oidc/.well-known/$1"); - expect(mdl.app.use).toBeCalledWith(expect.any(Function)); + expect(koaRewrite).toHaveBeenCalledWith("/.well-known/(.*)", "/oidc/.well-known/$1"); + expect(mdl.app.use).toHaveBeenCalledWith(expect.any(Function)); }); it("should mount the oidc provider server to application", async () => { const provider = { @@ -107,8 +108,8 @@ describe("OidcModule", () => { await mdl.$afterRoutesInit(); - expect(koaMount).toBeCalledWith("/oidc", "app"); - expect(mdl.app.use).toBeCalledWith(expect.any(Function)); + expect(koaMount).toHaveBeenCalledWith("/oidc", "app"); + expect(mdl.app.use).toHaveBeenCalledWith(expect.any(Function)); }); }); }); diff --git a/packages/security/oidc-provider/src/OidcModule.ts b/packages/security/oidc-provider/src/OidcModule.ts index 95777fbe6da..a6510617980 100644 --- a/packages/security/oidc-provider/src/OidcModule.ts +++ b/packages/security/oidc-provider/src/OidcModule.ts @@ -1,6 +1,7 @@ import {Inject, InjectorService, PlatformApplication} from "@tsed/common"; import {Constant, Module} from "@tsed/di"; import koaMount from "koa-mount"; + import {OidcAdapters} from "./services/OidcAdapters.js"; import {OidcJwks} from "./services/OidcJwks.js"; import {OidcProvider} from "./services/OidcProvider.js"; diff --git a/packages/security/oidc-provider/src/decorators/grantId.spec.ts b/packages/security/oidc-provider/src/decorators/grantId.spec.ts index b10fe75b306..34b922c5470 100644 --- a/packages/security/oidc-provider/src/decorators/grantId.spec.ts +++ b/packages/security/oidc-provider/src/decorators/grantId.spec.ts @@ -1,5 +1,6 @@ -import {INTERACTION_GRANT_ID} from "../constants/constants.js"; import {JsonParameterStore} from "@tsed/schema"; + +import {INTERACTION_GRANT_ID} from "../constants/constants.js"; import {GrantId} from "./grantId.js"; describe("@GrandId", () => { diff --git a/packages/security/oidc-provider/src/decorators/grantId.ts b/packages/security/oidc-provider/src/decorators/grantId.ts index ecbdcab75e8..68336921ff4 100644 --- a/packages/security/oidc-provider/src/decorators/grantId.ts +++ b/packages/security/oidc-provider/src/decorators/grantId.ts @@ -1,5 +1,6 @@ import {Context} from "@tsed/common"; import {useDecorators} from "@tsed/core"; + import {INTERACTION_GRANT_ID, INTERACTION_PARAMS} from "../constants/constants.js"; export function GrantId(): ParameterDecorator { diff --git a/packages/security/oidc-provider/src/decorators/interaction.spec.ts b/packages/security/oidc-provider/src/decorators/interaction.spec.ts index 39c0800b012..d1823d44ffd 100644 --- a/packages/security/oidc-provider/src/decorators/interaction.spec.ts +++ b/packages/security/oidc-provider/src/decorators/interaction.spec.ts @@ -1,5 +1,6 @@ import {Store} from "@tsed/core"; import {GlobalProviders} from "@tsed/di"; + import {INTERACTION_OPTIONS} from "../constants/constants.js"; import {OidcInteractionMethods} from "../domain/OidcInteractionMethods.js"; import {Interaction} from "./interaction.js"; diff --git a/packages/security/oidc-provider/src/decorators/interaction.ts b/packages/security/oidc-provider/src/decorators/interaction.ts index e467d03dacb..360daf5959c 100644 --- a/packages/security/oidc-provider/src/decorators/interaction.ts +++ b/packages/security/oidc-provider/src/decorators/interaction.ts @@ -1,5 +1,6 @@ import {Controller} from "@tsed/common"; import {StoreMerge, useDecorators} from "@tsed/core"; + import {INTERACTION, INTERACTION_OPTIONS} from "../constants/constants.js"; import {OidcInteractionOptions} from "../domain/OidcInteractionOptions.js"; diff --git a/packages/security/oidc-provider/src/decorators/interactions.spec.ts b/packages/security/oidc-provider/src/decorators/interactions.spec.ts index 32b61e26771..799ff3340f3 100644 --- a/packages/security/oidc-provider/src/decorators/interactions.spec.ts +++ b/packages/security/oidc-provider/src/decorators/interactions.spec.ts @@ -1,6 +1,7 @@ -import {PlatformTest} from "@tsed/common"; import "../../test/app/controllers/oidc/InteractionsCtrl.js"; +import {PlatformTest} from "@tsed/common"; + describe("@Interactions", () => { beforeEach(() => PlatformTest.create({ diff --git a/packages/security/oidc-provider/src/decorators/interactions.ts b/packages/security/oidc-provider/src/decorators/interactions.ts index ca68ca8c0c8..02ba1abb8af 100644 --- a/packages/security/oidc-provider/src/decorators/interactions.ts +++ b/packages/security/oidc-provider/src/decorators/interactions.ts @@ -1,5 +1,6 @@ import {Controller, UseBefore} from "@tsed/common"; import {Type, useDecorators} from "@tsed/core"; + import {INTERACTIONS} from "../constants/constants.js"; import {OidcInteractionMiddleware} from "../middlewares/OidcInteractionMiddleware.js"; import {NoCache} from "./noCache.js"; diff --git a/packages/security/oidc-provider/src/decorators/noCache.ts b/packages/security/oidc-provider/src/decorators/noCache.ts index 02a216818f4..ff100ab3f29 100644 --- a/packages/security/oidc-provider/src/decorators/noCache.ts +++ b/packages/security/oidc-provider/src/decorators/noCache.ts @@ -1,4 +1,5 @@ import {UseBefore} from "@tsed/common"; + import {OidcNoCacheMiddleware} from "../middlewares/OidcNoCacheMiddleware.js"; export function NoCache(): ClassDecorator { diff --git a/packages/security/oidc-provider/src/decorators/oidcCtx.spec.ts b/packages/security/oidc-provider/src/decorators/oidcCtx.spec.ts index ae5bae5ac75..01e0115688b 100644 --- a/packages/security/oidc-provider/src/decorators/oidcCtx.spec.ts +++ b/packages/security/oidc-provider/src/decorators/oidcCtx.spec.ts @@ -1,6 +1,7 @@ +import {JsonParameterStore} from "@tsed/schema"; + import {INTERACTION_CONTEXT} from "../constants/constants.js"; import {OidcCtx} from "./oidcCtx.js"; -import {JsonParameterStore} from "@tsed/schema"; describe("@OidcCtx", () => { it("should inject uid", () => { diff --git a/packages/security/oidc-provider/src/decorators/oidcCtx.ts b/packages/security/oidc-provider/src/decorators/oidcCtx.ts index c635c1d1ca1..3ded3f94ea6 100644 --- a/packages/security/oidc-provider/src/decorators/oidcCtx.ts +++ b/packages/security/oidc-provider/src/decorators/oidcCtx.ts @@ -1,5 +1,6 @@ import {Context} from "@tsed/common"; import {useDecorators} from "@tsed/core"; + import {INTERACTION_CONTEXT} from "../constants/constants.js"; import {OidcInteractionContext} from "../services/OidcInteractionContext.js"; diff --git a/packages/security/oidc-provider/src/decorators/oidcSession.spec.ts b/packages/security/oidc-provider/src/decorators/oidcSession.spec.ts index fe33988ec58..85963a22c16 100644 --- a/packages/security/oidc-provider/src/decorators/oidcSession.spec.ts +++ b/packages/security/oidc-provider/src/decorators/oidcSession.spec.ts @@ -1,6 +1,7 @@ +import {JsonParameterStore} from "@tsed/schema"; + import {INTERACTION_SESSION} from "../constants/constants.js"; import {OidcSession} from "./oidcSession.js"; -import {JsonParameterStore} from "@tsed/schema"; describe("@OidcSession", () => { it("should inject uid", () => { diff --git a/packages/security/oidc-provider/src/decorators/oidcSession.ts b/packages/security/oidc-provider/src/decorators/oidcSession.ts index f0ce5cf4ff8..a2bc7f2dec2 100644 --- a/packages/security/oidc-provider/src/decorators/oidcSession.ts +++ b/packages/security/oidc-provider/src/decorators/oidcSession.ts @@ -2,6 +2,7 @@ import {Context} from "@tsed/common"; import {useDecorators} from "@tsed/core"; // @ts-ignore import type {default as Provider} from "oidc-provider"; + import {INTERACTION_SESSION} from "../constants/constants.js"; /** diff --git a/packages/security/oidc-provider/src/decorators/params.spec.ts b/packages/security/oidc-provider/src/decorators/params.spec.ts index b035e9e510e..36debde4f3e 100644 --- a/packages/security/oidc-provider/src/decorators/params.spec.ts +++ b/packages/security/oidc-provider/src/decorators/params.spec.ts @@ -1,6 +1,7 @@ +import {JsonParameterStore} from "@tsed/schema"; + import {INTERACTION_PARAMS} from "../constants/constants.js"; import {Params} from "./params.js"; -import {JsonParameterStore} from "@tsed/schema"; describe("@Params", () => { it("should inject uid", () => { diff --git a/packages/security/oidc-provider/src/decorators/params.ts b/packages/security/oidc-provider/src/decorators/params.ts index bd4349d6763..f5c34de203b 100644 --- a/packages/security/oidc-provider/src/decorators/params.ts +++ b/packages/security/oidc-provider/src/decorators/params.ts @@ -1,5 +1,6 @@ import {Context} from "@tsed/common"; import {useDecorators} from "@tsed/core"; + import {INTERACTION_PARAMS} from "../constants/constants.js"; export function Params(expression?: string): ParameterDecorator { diff --git a/packages/security/oidc-provider/src/decorators/prompt.spec.ts b/packages/security/oidc-provider/src/decorators/prompt.spec.ts index a4fd9be923a..9d5825ae724 100644 --- a/packages/security/oidc-provider/src/decorators/prompt.spec.ts +++ b/packages/security/oidc-provider/src/decorators/prompt.spec.ts @@ -1,6 +1,7 @@ +import {JsonParameterStore} from "@tsed/schema"; + import {INTERACTION_PROMPT} from "../constants/constants.js"; import {Prompt} from "./prompt.js"; -import {JsonParameterStore} from "@tsed/schema"; describe("@Prompt", () => { it("should inject uid", () => { diff --git a/packages/security/oidc-provider/src/decorators/prompt.ts b/packages/security/oidc-provider/src/decorators/prompt.ts index 8050e38aedb..a0fc98698d8 100644 --- a/packages/security/oidc-provider/src/decorators/prompt.ts +++ b/packages/security/oidc-provider/src/decorators/prompt.ts @@ -2,6 +2,7 @@ import {Context} from "@tsed/common"; import {useDecorators} from "@tsed/core"; // @ts-ignore import type {PromptDetail as P} from "oidc-provider"; + import {INTERACTION_PROMPT} from "../constants/constants.js"; export function Prompt(): ParameterDecorator { diff --git a/packages/security/oidc-provider/src/decorators/uid.spec.ts b/packages/security/oidc-provider/src/decorators/uid.spec.ts index d0ef22a7bef..c4abcf1cee8 100644 --- a/packages/security/oidc-provider/src/decorators/uid.spec.ts +++ b/packages/security/oidc-provider/src/decorators/uid.spec.ts @@ -1,6 +1,7 @@ +import {JsonParameterStore} from "@tsed/schema"; + import {INTERACTION_UID} from "../constants/constants.js"; import {Uid} from "./uid.js"; -import {JsonParameterStore} from "@tsed/schema"; describe("@Uid", () => { it("should inject uid", () => { diff --git a/packages/security/oidc-provider/src/decorators/uid.ts b/packages/security/oidc-provider/src/decorators/uid.ts index a828cbcf50b..b2e42dfd813 100644 --- a/packages/security/oidc-provider/src/decorators/uid.ts +++ b/packages/security/oidc-provider/src/decorators/uid.ts @@ -1,5 +1,6 @@ import {Context} from "@tsed/common"; import {useDecorators} from "@tsed/core"; + import {INTERACTION_UID} from "../constants/constants.js"; export function Uid(): ParameterDecorator { diff --git a/packages/security/oidc-provider/src/domain/OidcAccountsMethods.ts b/packages/security/oidc-provider/src/domain/OidcAccountsMethods.ts index 88447ec1e0a..f1dc6b4b1e8 100644 --- a/packages/security/oidc-provider/src/domain/OidcAccountsMethods.ts +++ b/packages/security/oidc-provider/src/domain/OidcAccountsMethods.ts @@ -1,5 +1,6 @@ // @ts-ignore -import type {default as Provider, Account} from "oidc-provider"; +import type {Account, default as Provider} from "oidc-provider"; + import {AccessToken, AuthorizationCode, BackchannelAuthenticationRequest, DeviceCode} from "./interfaces.js"; export interface OidcAccountsMethods { diff --git a/packages/security/oidc-provider/src/domain/OidcInteractionPromptProps.ts b/packages/security/oidc-provider/src/domain/OidcInteractionPromptProps.ts index 5830bcdd656..da847986482 100644 --- a/packages/security/oidc-provider/src/domain/OidcInteractionPromptProps.ts +++ b/packages/security/oidc-provider/src/domain/OidcInteractionPromptProps.ts @@ -1,5 +1,6 @@ // @ts-ignore import type {UnknownObject} from "oidc-provider"; + import {OidcClient} from "./interfaces.js"; export type OidcInteractionPromptProps> = { diff --git a/packages/security/oidc-provider/src/domain/OidcSettings.ts b/packages/security/oidc-provider/src/domain/OidcSettings.ts index 88a553809ed..c0024eb263f 100644 --- a/packages/security/oidc-provider/src/domain/OidcSettings.ts +++ b/packages/security/oidc-provider/src/domain/OidcSettings.ts @@ -1,8 +1,9 @@ +import type {Adapter} from "@tsed/adapters"; import type {Type} from "@tsed/core"; import type {JwksKeyParameters} from "@tsed/jwks"; // @ts-ignore import type {Configuration} from "oidc-provider"; -import type {Adapter} from "@tsed/adapters"; + import type {OidcAccountsMethods} from "./OidcAccountsMethods.js"; export interface OidcSettings extends Configuration { diff --git a/packages/security/oidc-provider/src/domain/interfaces.ts b/packages/security/oidc-provider/src/domain/interfaces.ts index 116733d5bad..38fca57cb73 100644 --- a/packages/security/oidc-provider/src/domain/interfaces.ts +++ b/packages/security/oidc-provider/src/domain/interfaces.ts @@ -1,5 +1,5 @@ // @ts-ignore -import type {interactionPolicy, default as Provider} from "oidc-provider"; +import type {default as Provider, interactionPolicy} from "oidc-provider"; export type OIDCContext = InstanceType; export type OidcClient = InstanceType; diff --git a/packages/security/oidc-provider/src/middlewares/OidcInteractionMiddleware.spec.ts b/packages/security/oidc-provider/src/middlewares/OidcInteractionMiddleware.spec.ts index 88b0cf658f7..9f64a336926 100644 --- a/packages/security/oidc-provider/src/middlewares/OidcInteractionMiddleware.spec.ts +++ b/packages/security/oidc-provider/src/middlewares/OidcInteractionMiddleware.spec.ts @@ -1,5 +1,6 @@ -import faker from "@faker-js/faker"; +import {faker} from "@faker-js/faker"; import {PlatformTest} from "@tsed/common"; + import { INTERACTION_CONTEXT, INTERACTION_DETAILS, @@ -16,7 +17,7 @@ describe("OidcInteractionMiddleware", () => { afterEach(() => PlatformTest.reset()); it("should create interaction details and store it to the context", async () => { const interactionDetails = { - uid: faker.datatype.uuid(), + uid: faker.string.uuid(), prompt: {}, params: {}, session: {} @@ -34,6 +35,6 @@ describe("OidcInteractionMiddleware", () => { await middleware.use(); - expect(oidcInteractionContext.interactionDetails).toBeCalledWith(); + expect(oidcInteractionContext.interactionDetails).toHaveBeenCalledWith(); }); }); diff --git a/packages/security/oidc-provider/src/middlewares/OidcInteractionMiddleware.ts b/packages/security/oidc-provider/src/middlewares/OidcInteractionMiddleware.ts index 6ca2cbbde0e..d13423c24ad 100644 --- a/packages/security/oidc-provider/src/middlewares/OidcInteractionMiddleware.ts +++ b/packages/security/oidc-provider/src/middlewares/OidcInteractionMiddleware.ts @@ -1,4 +1,5 @@ import {Inject, Middleware} from "@tsed/common"; + import {OidcInteractionContext} from "../services/OidcInteractionContext.js"; @Middleware() diff --git a/packages/security/oidc-provider/src/middlewares/OidcNoCacheMiddleware.spec.ts b/packages/security/oidc-provider/src/middlewares/OidcNoCacheMiddleware.spec.ts index 930e90faa9e..137952c8cc8 100644 --- a/packages/security/oidc-provider/src/middlewares/OidcNoCacheMiddleware.spec.ts +++ b/packages/security/oidc-provider/src/middlewares/OidcNoCacheMiddleware.spec.ts @@ -1,4 +1,5 @@ import {PlatformTest} from "@tsed/common"; + import {OidcNoCacheMiddleware} from "./OidcNoCacheMiddleware.js"; describe("OidcNoCacheMiddleware", () => { @@ -11,7 +12,7 @@ describe("OidcNoCacheMiddleware", () => { middleware.use(ctx); - expect(ctx.response.setHeader).toBeCalledWith("Pragma", "no-cache"); - expect(ctx.response.setHeader).toBeCalledWith("Cache-Control", "no-cache, no-store"); + expect(ctx.response.setHeader).toHaveBeenCalledWith("Pragma", "no-cache"); + expect(ctx.response.setHeader).toHaveBeenCalledWith("Cache-Control", "no-cache, no-store"); }); }); diff --git a/packages/security/oidc-provider/src/middlewares/OidcSecureMiddleware.spec.ts b/packages/security/oidc-provider/src/middlewares/OidcSecureMiddleware.spec.ts index 246e146d86b..d0cd42fb6da 100644 --- a/packages/security/oidc-provider/src/middlewares/OidcSecureMiddleware.spec.ts +++ b/packages/security/oidc-provider/src/middlewares/OidcSecureMiddleware.spec.ts @@ -1,4 +1,5 @@ import {PlatformTest} from "@tsed/common"; + import {OidcSecureMiddleware} from "./OidcSecureMiddleware.js"; describe("OidcSecureMiddleware", () => { @@ -25,7 +26,7 @@ describe("OidcSecureMiddleware", () => { middleware.use(ctx); - expect(ctx.response.redirect).toBeCalledWith(302, "https://host/path"); + expect(ctx.response.redirect).toHaveBeenCalledWith(302, "https://host/path"); }); it("should check if the request is not secure on HEAD verb", async () => { @@ -47,7 +48,7 @@ describe("OidcSecureMiddleware", () => { middleware.use(ctx); - expect(ctx.response.redirect).toBeCalledWith(302, "https://host/path"); + expect(ctx.response.redirect).toHaveBeenCalledWith(302, "https://host/path"); }); it("should check if the request is not secure on POST verb", async () => { @@ -100,6 +101,6 @@ describe("OidcSecureMiddleware", () => { middleware.use(ctx); - expect(ctx.response.redirect).not.toBeCalled(); + expect(ctx.response.redirect).not.toHaveBeenCalled(); }); }); diff --git a/packages/security/oidc-provider/src/services/OidcAdapters.spec.ts b/packages/security/oidc-provider/src/services/OidcAdapters.spec.ts index 95b04081e08..9368123051a 100644 --- a/packages/security/oidc-provider/src/services/OidcAdapters.spec.ts +++ b/packages/security/oidc-provider/src/services/OidcAdapters.spec.ts @@ -1,6 +1,7 @@ +import {faker} from "@faker-js/faker"; import {PlatformTest} from "@tsed/common"; -import faker from "@faker-js/faker"; import type {Adapter} from "oidc-provider"; + import {OidcAdapters} from "./OidcAdapters.js"; describe("OidcAdapters", () => { @@ -17,7 +18,7 @@ describe("OidcAdapters", () => { describe("adapter.upsert()", () => { it("should call upsert", async () => { - const id = faker.datatype.uuid(); + const id = faker.string.uuid(); await adapter.upsert( id, @@ -39,7 +40,7 @@ describe("OidcAdapters", () => { describe("adapter.findByUserCode()", () => { it("should find data by userCode", async () => { - const id = faker.datatype.uuid(); + const id = faker.string.uuid(); await adapter.upsert( id, @@ -58,7 +59,7 @@ describe("OidcAdapters", () => { }); describe("adapter.findByUid()", () => { it("should find data by uid", async () => { - const id = faker.datatype.uuid(); + const id = faker.string.uuid(); await adapter.upsert( id, @@ -77,7 +78,7 @@ describe("OidcAdapters", () => { }); describe("adapter.deleteMany()", () => { it("should delete items", async () => { - const id = faker.datatype.uuid(); + const id = faker.string.uuid(); await adapter.upsert( id, diff --git a/packages/security/oidc-provider/src/services/OidcInteractionContext.spec.ts b/packages/security/oidc-provider/src/services/OidcInteractionContext.spec.ts index 5093815ab91..5ac8f9a8556 100644 --- a/packages/security/oidc-provider/src/services/OidcInteractionContext.spec.ts +++ b/packages/security/oidc-provider/src/services/OidcInteractionContext.spec.ts @@ -1,5 +1,6 @@ import {PlatformTest} from "@tsed/common"; import {catchAsyncError, catchError} from "@tsed/core"; + import {OidcInteractionContext} from "./OidcInteractionContext.js"; import {OidcProvider} from "./OidcProvider.js"; @@ -145,7 +146,7 @@ describe("OidcInteractionContext", () => { await $ctx.runInContext(async () => { await oidcCtx.interactionFinished({login: {accountId: "string"}}, {mergeWithLastSubmission: false}); - expect(oidcProvider.interactionFinished).toBeCalledWith( + expect(oidcProvider.interactionFinished).toHaveBeenCalledWith( $ctx.getReq(), $ctx.getRes(), {login: {accountId: "string"}}, @@ -161,7 +162,7 @@ describe("OidcInteractionContext", () => { await $ctx.runInContext(async () => { await oidcCtx.interactionResult({login: {accountId: "string"}}, {mergeWithLastSubmission: false}); - expect(oidcProvider.interactionResult).toBeCalledWith( + expect(oidcProvider.interactionResult).toHaveBeenCalledWith( $ctx.getReq(), $ctx.getRes(), {login: {accountId: "string"}}, @@ -174,7 +175,7 @@ describe("OidcInteractionContext", () => { await $ctx.runInContext(async () => { await oidcCtx.interactionResult({login: {accountId: "string"}}); - expect(oidcProvider.interactionResult).toBeCalledWith( + expect(oidcProvider.interactionResult).toHaveBeenCalledWith( $ctx.getReq(), $ctx.getRes(), {login: {accountId: "string"}}, @@ -192,7 +193,7 @@ describe("OidcInteractionContext", () => { await oidcCtx.render("login", {}); - expect($ctx.response.render).toBeCalledWith("login", {}); + expect($ctx.response.render).toHaveBeenCalledWith("login", {}); }); }); }); @@ -203,7 +204,7 @@ describe("OidcInteractionContext", () => { await $ctx.runInContext(async () => { await oidcCtx.save(2000); - expect(interactionDetails.save).toBeCalledWith(2000); + expect(interactionDetails.save).toHaveBeenCalledWith(2000); }); }); @@ -212,7 +213,7 @@ describe("OidcInteractionContext", () => { await $ctx.runInContext(async () => { await oidcCtx.save(100); - expect(interactionDetails.save).toBeCalledWith(100); + expect(interactionDetails.save).toHaveBeenCalledWith(100); }); }); }); @@ -226,7 +227,7 @@ describe("OidcInteractionContext", () => { expect(result).toEqual({ client_id: "client_id" }); - expect(oidcProvider.Client.find).toBeCalledWith("client_id"); + expect(oidcProvider.Client.find).toHaveBeenCalledWith("client_id"); }); }); @@ -239,7 +240,7 @@ describe("OidcInteractionContext", () => { expect(result).toEqual({ client_id: "client_id" }); - expect(oidcProvider.Client.find).toBeCalledWith("client_id"); + expect(oidcProvider.Client.find).toHaveBeenCalledWith("client_id"); }); }); }); @@ -250,7 +251,7 @@ describe("OidcInteractionContext", () => { await $ctx.runInContext(async () => { const result = await oidcCtx.findAccount(undefined, "token"); - expect(oidcProvider.Account.findAccount).toBeCalledWith(undefined, "accountId", "token"); + expect(oidcProvider.Account.findAccount).toHaveBeenCalledWith(undefined, "accountId", "token"); expect(result).toEqual({ accountId: "accountId" }); @@ -262,7 +263,7 @@ describe("OidcInteractionContext", () => { await $ctx.runInContext(async () => { const result = await oidcCtx.findAccount("accountId", "token"); - expect(oidcProvider.Account.findAccount).toBeCalledWith(undefined, "accountId", "token"); + expect(oidcProvider.Account.findAccount).toHaveBeenCalledWith(undefined, "accountId", "token"); expect(result).toEqual({ accountId: "accountId" }); diff --git a/packages/security/oidc-provider/src/services/OidcInteractionContext.ts b/packages/security/oidc-provider/src/services/OidcInteractionContext.ts index bb5e8420002..2261f1e6716 100644 --- a/packages/security/oidc-provider/src/services/OidcInteractionContext.ts +++ b/packages/security/oidc-provider/src/services/OidcInteractionContext.ts @@ -3,8 +3,10 @@ import {Env} from "@tsed/core"; import {Inject, Injectable} from "@tsed/di"; import {Unauthorized} from "@tsed/exceptions"; import {serialize} from "@tsed/json-mapper"; +import omit from "lodash/omit.js"; // @ts-ignore -import type {Account, InteractionResults, PromptDetail, default as Provider} from "oidc-provider"; +import type {Account, default as Provider, InteractionResults, PromptDetail} from "oidc-provider"; + import { INTERACTION_CONTEXT, INTERACTION_DETAILS, @@ -21,7 +23,6 @@ import {OidcInteractionPromptProps} from "../domain/OidcInteractionPromptProps.j import {debug} from "../utils/debug.js"; import {OidcInteractions} from "./OidcInteractions.js"; import {OidcProvider} from "./OidcProvider.js"; -import omit from "lodash/omit.js"; @Injectable() export class OidcInteractionContext { diff --git a/packages/security/oidc-provider/src/services/OidcInteractions.ts b/packages/security/oidc-provider/src/services/OidcInteractions.ts index 25500c7cb82..47cd2ca8084 100644 --- a/packages/security/oidc-provider/src/services/OidcInteractions.ts +++ b/packages/security/oidc-provider/src/services/OidcInteractions.ts @@ -1,6 +1,7 @@ import {Constant, EndpointMetadata, PlatformContext, PlatformHandler, Provider, TokenProvider} from "@tsed/common"; import {Env} from "@tsed/core"; import {Inject, Injectable, InjectorService} from "@tsed/di"; + import {INTERACTION, INTERACTION_OPTIONS, INTERACTIONS} from "../constants/constants.js"; import {OidcInteractionOptions} from "../domain/OidcInteractionOptions.js"; import {OidcSettings} from "../domain/OidcSettings.js"; diff --git a/packages/security/oidc-provider/src/services/OidcJwks.ts b/packages/security/oidc-provider/src/services/OidcJwks.ts index 1cdb57ff67d..270b5d37037 100644 --- a/packages/security/oidc-provider/src/services/OidcJwks.ts +++ b/packages/security/oidc-provider/src/services/OidcJwks.ts @@ -1,6 +1,6 @@ import {Constant, Injectable} from "@tsed/di"; -import {join} from "path"; import {getJwks, JwksKeyParameters} from "@tsed/jwks"; +import {join} from "path"; @Injectable() export class OidcJwks { diff --git a/packages/security/oidc-provider/src/services/OidcPolicy.spec.ts b/packages/security/oidc-provider/src/services/OidcPolicy.spec.ts index 9359c0e926f..c6664b3f160 100644 --- a/packages/security/oidc-provider/src/services/OidcPolicy.spec.ts +++ b/packages/security/oidc-provider/src/services/OidcPolicy.spec.ts @@ -1,5 +1,6 @@ import {PlatformTest} from "@tsed/common"; import {Env} from "@tsed/core"; + import {ConsentInteraction} from "../../test/app/interactions/ConsentInteraction.js"; import {Interaction} from "../decorators/interaction.js"; import {OidcInteractions} from "./OidcInteractions.js"; diff --git a/packages/security/oidc-provider/src/services/OidcPolicy.ts b/packages/security/oidc-provider/src/services/OidcPolicy.ts index fe954bd901b..33c870c54cb 100644 --- a/packages/security/oidc-provider/src/services/OidcPolicy.ts +++ b/packages/security/oidc-provider/src/services/OidcPolicy.ts @@ -1,6 +1,7 @@ import {Inject, Injectable, InjectorService, Provider} from "@tsed/di"; // @ts-ignore import {interactionPolicy} from "oidc-provider"; + import {InteractionMethods} from "../domain/InteractionMethods.js"; import {OidcInteractionOptions} from "../domain/OidcInteractionOptions.js"; import {OidcInteractions} from "./OidcInteractions.js"; diff --git a/packages/security/oidc-provider/src/services/OidcProvider.spec.ts b/packages/security/oidc-provider/src/services/OidcProvider.spec.ts index d812ad22dc3..5857c267bff 100644 --- a/packages/security/oidc-provider/src/services/OidcProvider.spec.ts +++ b/packages/security/oidc-provider/src/services/OidcProvider.spec.ts @@ -1,6 +1,8 @@ +import "../../test/app/controllers/oidc/InteractionsCtrl.js"; + import {PlatformTest, runInContext} from "@tsed/common"; import {Env} from "@tsed/core"; -import "../../test/app/controllers/oidc/InteractionsCtrl.js"; + import {OidcProvider} from "./OidcProvider.js"; describe("OidcProvider", () => { diff --git a/packages/security/oidc-provider/src/services/OidcProvider.ts b/packages/security/oidc-provider/src/services/OidcProvider.ts index 378fcb901a2..57deaf8ef5f 100644 --- a/packages/security/oidc-provider/src/services/OidcProvider.ts +++ b/packages/security/oidc-provider/src/services/OidcProvider.ts @@ -3,6 +3,7 @@ import {Env, setValue} from "@tsed/core"; import {Constant, Inject, Injectable, InjectorService} from "@tsed/di"; // @ts-ignore import type {Configuration, default as OIDCProvider, KoaContextWithOIDC} from "oidc-provider"; + import {INTERACTIONS} from "../constants/constants.js"; import {OidcAccountsMethods} from "../domain/OidcAccountsMethods.js"; import {OidcSettings} from "../domain/OidcSettings.js"; @@ -205,7 +206,6 @@ export class OidcProvider { if (provider) { return (ctx: any, interaction: any) => { - // eslint-disable-line no-unused-vars return provider.path.replace(/:uid/, interaction.uid); }; } diff --git a/packages/security/oidc-provider/test/app/Server.ts b/packages/security/oidc-provider/test/app/Server.ts index c478742ede4..162ec14197e 100644 --- a/packages/security/oidc-provider/test/app/Server.ts +++ b/packages/security/oidc-provider/test/app/Server.ts @@ -1,16 +1,18 @@ -import {FileSyncAdapter} from "@tsed/adapters"; import "@tsed/ajv"; import "../../src/index.js"; +import "../.."; +import "@tsed/swagger"; + +import {FileSyncAdapter} from "@tsed/adapters"; import {Constant, PlatformApplication} from "@tsed/common"; import {Configuration, Inject} from "@tsed/di"; -import "@tsed/oidc-provider"; -import "@tsed/swagger"; import bodyParser from "body-parser"; 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"; const rootDir = import.meta.dirname; diff --git a/packages/security/oidc-provider/test/app/controllers/oidc/InteractionsCtrl.ts b/packages/security/oidc-provider/test/app/controllers/oidc/InteractionsCtrl.ts index a8f705d82ba..bd7463465bd 100644 --- a/packages/security/oidc-provider/test/app/controllers/oidc/InteractionsCtrl.ts +++ b/packages/security/oidc-provider/test/app/controllers/oidc/InteractionsCtrl.ts @@ -1,6 +1,7 @@ import {Get, PathParams} from "@tsed/common"; -import {Interactions, OidcCtx} from "../../../../src/index.js"; import {Name} from "@tsed/schema"; + +import {Interactions, OidcCtx} from "../../../../src/index.js"; import {AbortInteraction} from "../../interactions/AbortInteraction.js"; import {ConsentInteraction} from "../../interactions/ConsentInteraction.js"; import {CustomInteraction} from "../../interactions/CustomInteraction.js"; diff --git a/packages/security/oidc-provider/test/app/controllers/pages/IndexCtrl.ts b/packages/security/oidc-provider/test/app/controllers/pages/IndexCtrl.ts index a5350540644..acbbb0ab9db 100644 --- a/packages/security/oidc-provider/test/app/controllers/pages/IndexCtrl.ts +++ b/packages/security/oidc-provider/test/app/controllers/pages/IndexCtrl.ts @@ -11,7 +11,7 @@ export class IndexCtrl { @Get("/") @View("index.ejs") - @Returns(200, String).ContentType("text/html") + @(Returns(200, String).ContentType("text/html")) get(@HeaderParams("x-forwarded-proto") protocol: string, @HeaderParams("host") host: string) { const hostUrl = `${protocol || "http"}://${host}`; diff --git a/packages/security/oidc-provider/test/app/controllers/rest/VersionCtrl.ts b/packages/security/oidc-provider/test/app/controllers/rest/VersionCtrl.ts index 5ab85f7ef4a..49dd20855db 100644 --- a/packages/security/oidc-provider/test/app/controllers/rest/VersionCtrl.ts +++ b/packages/security/oidc-provider/test/app/controllers/rest/VersionCtrl.ts @@ -4,9 +4,9 @@ import {object, Returns, string} from "@tsed/schema"; @Controller("/version") export class VersionCtrl { @Get("/") - @Returns(200) + @(Returns(200) .ContentType("application/json") - .Schema(object().properties({name: string(), version: string()})) + .Schema(object().properties({name: string(), version: string()}))) async get() { const {name, version} = await import("../../../../package.json"); return { diff --git a/packages/security/oidc-provider/test/app/index.ts b/packages/security/oidc-provider/test/app/index.ts index 66e13bef429..32bcd2496ca 100644 --- a/packages/security/oidc-provider/test/app/index.ts +++ b/packages/security/oidc-provider/test/app/index.ts @@ -1,5 +1,6 @@ import {$log} from "@tsed/common"; import {PlatformExpress} from "@tsed/platform-express"; + import {InteractionsCtrl} from "./controllers/oidc/InteractionsCtrl.js"; import {IndexCtrl} from "./controllers/pages/IndexCtrl.js"; import {VersionCtrl} from "./controllers/rest/VersionCtrl.js"; diff --git a/packages/security/oidc-provider/test/app/interactions/AbortInteraction.ts b/packages/security/oidc-provider/test/app/interactions/AbortInteraction.ts index c8b1da9fbcc..846e085b89c 100644 --- a/packages/security/oidc-provider/test/app/interactions/AbortInteraction.ts +++ b/packages/security/oidc-provider/test/app/interactions/AbortInteraction.ts @@ -1,8 +1,9 @@ import {Inject} from "@tsed/common"; -import {Interaction, OidcCtx, OidcProvider, InteractionMethods} from "../../../src/index.js"; import {View} from "@tsed/platform-views"; import {Name} from "@tsed/schema"; +import {Interaction, InteractionMethods, OidcCtx, OidcProvider} from "../../../src/index.js"; + @Interaction({ name: "abort" }) diff --git a/packages/security/oidc-provider/test/app/interactions/ConsentInteraction.ts b/packages/security/oidc-provider/test/app/interactions/ConsentInteraction.ts index 4765c6ec4f9..99b1165bf6c 100644 --- a/packages/security/oidc-provider/test/app/interactions/ConsentInteraction.ts +++ b/packages/security/oidc-provider/test/app/interactions/ConsentInteraction.ts @@ -1,7 +1,8 @@ import {Inject, Post} from "@tsed/common"; -import {Interaction, InteractionMethods, OidcCtx, OidcProvider, Prompt} from "../../../src/index.js"; -import {Name} from "@tsed/schema"; import {View} from "@tsed/platform-views"; +import {Name} from "@tsed/schema"; + +import {Interaction, InteractionMethods, OidcCtx, OidcProvider, Prompt} from "../../../src/index.js"; @Interaction({ name: "consent", @@ -45,7 +46,6 @@ export class ConsentInteraction implements InteractionMethods { } if (missingResourceScopes) { - // eslint-disable-next-line no-restricted-syntax for (const [indicator, scopes] of Object.entries(missingResourceScopes)) { grant.addResourceScope(indicator, scopes.join(" ")); // use grant.rejectResourceScope to reject a subset or the whole thing diff --git a/packages/security/oidc-provider/test/app/interactions/CustomInteraction.ts b/packages/security/oidc-provider/test/app/interactions/CustomInteraction.ts index 3608816e8e5..223a888f33b 100644 --- a/packages/security/oidc-provider/test/app/interactions/CustomInteraction.ts +++ b/packages/security/oidc-provider/test/app/interactions/CustomInteraction.ts @@ -1,9 +1,10 @@ import {View} from "@tsed/common"; import {Env} from "@tsed/core"; import {Constant} from "@tsed/di"; -import {Interaction, InteractionMethods, OidcCtx, OidcSession, Params, Prompt, Uid} from "@tsed/oidc-provider"; import {Name} from "@tsed/schema"; import {interactionPolicy, KoaContextWithOIDC} from "oidc-provider"; + +import {Interaction, InteractionMethods, OidcCtx, OidcSession, Params, Prompt, Uid} from "../../../src/index.js"; import Check = interactionPolicy.Check; @Interaction({ diff --git a/packages/security/oidc-provider/test/app/interactions/LoginInteraction.ts b/packages/security/oidc-provider/test/app/interactions/LoginInteraction.ts index bd684b7e005..5ae9739e9ac 100644 --- a/packages/security/oidc-provider/test/app/interactions/LoginInteraction.ts +++ b/packages/security/oidc-provider/test/app/interactions/LoginInteraction.ts @@ -1,9 +1,10 @@ import {BodyParams, Inject, Post} from "@tsed/common"; import {Env} from "@tsed/core"; import {Constant} from "@tsed/di"; -import {Interaction, InteractionMethods, OidcCtx, OidcSession, Params, Prompt, Uid} from "../../../src/index.js"; import {View} from "@tsed/platform-views"; import {Name} from "@tsed/schema"; + +import {Interaction, InteractionMethods, OidcCtx, OidcSession, Params, Prompt, Uid} from "../../../src/index.js"; import {Accounts} from "../services/Accounts.js"; @Interaction({ diff --git a/packages/security/oidc-provider/test/app/services/Accounts.ts b/packages/security/oidc-provider/test/app/services/Accounts.ts index 9d5c534df62..744fce44c11 100644 --- a/packages/security/oidc-provider/test/app/services/Accounts.ts +++ b/packages/security/oidc-provider/test/app/services/Accounts.ts @@ -1,6 +1,7 @@ import {Adapter, InjectAdapter} from "@tsed/adapters"; import {Injectable} from "@tsed/di"; import {deserialize} from "@tsed/json-mapper"; + import {AccessToken, AuthorizationCode, DeviceCode, OidcAccountsMethods} from "../../../src/index.js"; import {Account} from "../models/Account.js"; diff --git a/packages/security/oidc-provider/test/oidc.integration.spec.ts b/packages/security/oidc-provider/test/oidc.integration.spec.ts index fec93e0f8a9..08acf3fdd21 100644 --- a/packages/security/oidc-provider/test/oidc.integration.spec.ts +++ b/packages/security/oidc-provider/test/oidc.integration.spec.ts @@ -2,12 +2,12 @@ import {MemoryAdapter} from "@tsed/adapters"; import {PlatformTest} from "@tsed/common"; import {PlatformExpress} from "@tsed/platform-express"; 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"; import {InteractionsCtrl} from "./app/controllers/oidc/InteractionsCtrl.js"; import {Server} from "./app/Server.js"; - -import {join} from "path"; import {Accounts} from "./app/services/Accounts.js"; const testDir = import.meta.dirname; diff --git a/packages/security/oidc-provider/tsconfig.esm.json b/packages/security/oidc-provider/tsconfig.esm.json index e3b07081667..82292550ddb 100644 --- a/packages/security/oidc-provider/tsconfig.esm.json +++ b/packages/security/oidc-provider/tsconfig.esm.json @@ -2,8 +2,7 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "module": "ESNext", - "moduleResolution": "nodenext", + "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", @@ -11,7 +10,7 @@ "composite": true, "noEmit": false }, - "include": ["src", "src/**/*.json"], + "include": ["src/**/*.ts", "src/**/*.json"], "exclude": [ "node_modules", "test", diff --git a/packages/security/oidc-provider/tsconfig.spec.json b/packages/security/oidc-provider/tsconfig.spec.json index 21485bab96d..2e917f4b39d 100644 --- a/packages/security/oidc-provider/tsconfig.spec.json +++ b/packages/security/oidc-provider/tsconfig.spec.json @@ -3,7 +3,6 @@ "compilerOptions": { "baseUrl": ".", "rootDir": "../..", - "module": "commonjs", "outDir": "./lib/cjs", "declaration": false, "composite": false, diff --git a/packages/security/passport/package.json b/packages/security/passport/package.json index b0e3a87a970..93a7429224c 100644 --- a/packages/security/passport/package.json +++ b/packages/security/passport/package.json @@ -42,7 +42,7 @@ "passport-http": "0.3.0", "passport-local": "1.0.0", "passport-strategy": "1.0.0", - "typescript": "4.9.5", + "typescript": "5.6.2", "vitest": "2.0.4" }, "peerDependencies": { diff --git a/packages/security/passport/src/PassportModule.spec.ts b/packages/security/passport/src/PassportModule.spec.ts index 906b6b52ceb..f0024e85047 100644 --- a/packages/security/passport/src/PassportModule.spec.ts +++ b/packages/security/passport/src/PassportModule.spec.ts @@ -1,8 +1,10 @@ -import {PlatformApplication, PlatformTest} from "@tsed/common"; import "../src/index.js"; -import {PassportModule} from "./PassportModule.js"; + +import {PlatformApplication, PlatformTest} from "@tsed/common"; import Passport from "passport"; +import {PassportModule} from "./PassportModule.js"; + vi.mock("passport"); beforeEach(() => { diff --git a/packages/security/passport/src/PassportModule.ts b/packages/security/passport/src/PassportModule.ts index db3343da4a2..62c69131ad1 100644 --- a/packages/security/passport/src/PassportModule.ts +++ b/packages/security/passport/src/PassportModule.ts @@ -1,5 +1,6 @@ -import {BeforeRoutesInit, Constant, Inject, Module, OnInit, PlatformApplication, Provider, ProviderScope, Logger} from "@tsed/common"; +import {BeforeRoutesInit, Constant, Inject, Logger, Module, OnInit, PlatformApplication, Provider, ProviderScope} from "@tsed/common"; import Passport from "passport"; + import {PassportSerializerService} from "./services/PassportSerializerService.js"; import {ProtocolsService} from "./services/ProtocolsService.js"; diff --git a/packages/security/passport/src/decorators/args.spec.ts b/packages/security/passport/src/decorators/args.spec.ts index 0934e828a74..6603b00d9df 100644 --- a/packages/security/passport/src/decorators/args.spec.ts +++ b/packages/security/passport/src/decorators/args.spec.ts @@ -1,7 +1,8 @@ import {ParamTypes} from "@tsed/common"; -import {Arg, Args} from "./args.js"; import {JsonParameterStore} from "@tsed/schema"; +import {Arg, Args} from "./args.js"; + describe("@Args", () => { it("should register a new parameter instance with the correct property", () => { class Ctrl { diff --git a/packages/security/passport/src/decorators/authenticate.spec.ts b/packages/security/passport/src/decorators/authenticate.spec.ts index 092ff9a8f6f..053aff39ec4 100644 --- a/packages/security/passport/src/decorators/authenticate.spec.ts +++ b/packages/security/passport/src/decorators/authenticate.spec.ts @@ -1,7 +1,8 @@ import {Store} from "@tsed/core"; -import {Authenticate, PassportMiddleware} from "../index.js"; import {Security} from "@tsed/schema"; +import {Authenticate, PassportMiddleware} from "../index.js"; + describe("@Authenticate", () => { it("should store data", () => { class Test { diff --git a/packages/security/passport/src/decorators/authenticate.ts b/packages/security/passport/src/decorators/authenticate.ts index dc2692260e5..0a7e050fb3c 100644 --- a/packages/security/passport/src/decorators/authenticate.ts +++ b/packages/security/passport/src/decorators/authenticate.ts @@ -1,7 +1,8 @@ -import {UseAuth} from "@tsed/platform-middlewares"; import {useDecorators} from "@tsed/core"; +import {UseAuth} from "@tsed/platform-middlewares"; import {Security} from "@tsed/schema"; import {AuthenticateOptions as PassportAuthenticateOptions} from "passport"; + import {PassportMiddleware} from "../middlewares/PassportMiddleware.js"; export interface AuthenticateOptions extends PassportAuthenticateOptions { diff --git a/packages/security/passport/src/decorators/authorize.spec.ts b/packages/security/passport/src/decorators/authorize.spec.ts index dc7cfda22c6..cbab06ef12d 100644 --- a/packages/security/passport/src/decorators/authorize.spec.ts +++ b/packages/security/passport/src/decorators/authorize.spec.ts @@ -1,4 +1,5 @@ import {Store} from "@tsed/core"; + import {Authorize, PassportMiddleware} from "../index.js"; describe("@Authorize", () => { diff --git a/packages/security/passport/src/decorators/authorize.ts b/packages/security/passport/src/decorators/authorize.ts index fae4e0b7b69..d241b46955e 100644 --- a/packages/security/passport/src/decorators/authorize.ts +++ b/packages/security/passport/src/decorators/authorize.ts @@ -1,7 +1,8 @@ -import {UseAuth} from "@tsed/platform-middlewares"; import {useDecorators} from "@tsed/core"; +import {UseAuth} from "@tsed/platform-middlewares"; import {Security} from "@tsed/schema"; import {AuthenticateOptions} from "passport"; + import {PassportMiddleware} from "../middlewares/PassportMiddleware.js"; export interface AuthorizeOptions extends AuthenticateOptions { diff --git a/packages/security/passport/src/decorators/protocol.ts b/packages/security/passport/src/decorators/protocol.ts index a5474a2a76b..78d597dbb26 100644 --- a/packages/security/passport/src/decorators/protocol.ts +++ b/packages/security/passport/src/decorators/protocol.ts @@ -1,7 +1,8 @@ import {StoreSet, useDecorators} from "@tsed/core"; import {Configuration, Injectable} from "@tsed/di"; -import {ProtocolOptions} from "../interfaces/ProtocolOptions.js"; + import {PROVIDER_TYPE_PROTOCOL} from "../contants/constants.js"; +import {ProtocolOptions} from "../interfaces/ProtocolOptions.js"; /** * Declare a new Protocol base on a Passport Strategy diff --git a/packages/security/passport/src/errors/PassportMessage.ts b/packages/security/passport/src/errors/PassportMessage.ts index b4080bc91cd..6b0ad79f0de 100644 --- a/packages/security/passport/src/errors/PassportMessage.ts +++ b/packages/security/passport/src/errors/PassportMessage.ts @@ -1,7 +1,10 @@ import {Unauthorized} from "@tsed/exceptions"; export class PassportMessage extends Unauthorized { - constructor(message: string, public opts: Record = {}) { + constructor( + message: string, + public opts: Record = {} + ) { super(message); } } diff --git a/packages/security/passport/src/interfaces/ProtocolMethods.ts b/packages/security/passport/src/interfaces/ProtocolMethods.ts index ebaef3acc4b..45f39988e82 100644 --- a/packages/security/passport/src/interfaces/ProtocolMethods.ts +++ b/packages/security/passport/src/interfaces/ProtocolMethods.ts @@ -1,5 +1,5 @@ +import {BeforeInstall} from "./BeforeInstall.js"; import {OnInstall} from "./OnInstall.js"; import {OnVerify} from "./OnVerify.js"; -import {BeforeInstall} from "./BeforeInstall.js"; export interface ProtocolMethods extends OnVerify, OnInstall, BeforeInstall {} diff --git a/packages/security/passport/src/interfaces/interfaces.ts b/packages/security/passport/src/interfaces/interfaces.ts index 5996913d149..e5f1da412db 100644 --- a/packages/security/passport/src/interfaces/interfaces.ts +++ b/packages/security/passport/src/interfaces/interfaces.ts @@ -1,5 +1,6 @@ import {Type} from "@tsed/core"; import {PassportStatic} from "passport"; + import {ProtocolOptions} from "./ProtocolOptions.js"; declare global { diff --git a/packages/security/passport/src/middlewares/PassportMiddleware.spec.ts b/packages/security/passport/src/middlewares/PassportMiddleware.spec.ts index aac4dc9af48..82748650c9e 100644 --- a/packages/security/passport/src/middlewares/PassportMiddleware.spec.ts +++ b/packages/security/passport/src/middlewares/PassportMiddleware.spec.ts @@ -1,7 +1,8 @@ import {PlatformTest} from "@tsed/common"; import {Unauthorized} from "@tsed/exceptions"; -import {PassportException} from "../errors/PassportException.js"; import Passport from "passport"; + +import {PassportException} from "../errors/PassportException.js"; import {PassportMiddleware} from "./PassportMiddleware.js"; function createContextFixture(options = {}) { diff --git a/packages/security/passport/src/middlewares/PassportMiddleware.ts b/packages/security/passport/src/middlewares/PassportMiddleware.ts index 9515412b4ee..c6ca1a47fac 100644 --- a/packages/security/passport/src/middlewares/PassportMiddleware.ts +++ b/packages/security/passport/src/middlewares/PassportMiddleware.ts @@ -1,6 +1,7 @@ +import {Context} from "@tsed/common"; import {Inject} from "@tsed/di"; import {Middleware} from "@tsed/platform-middlewares"; -import {Context} from "@tsed/common"; + import {ProtocolsService} from "../services/ProtocolsService.js"; import {getProtocolsFromRequest} from "../utils/getProtocolsFromRequest.js"; diff --git a/packages/security/passport/src/services/PassportSerializerService.spec.ts b/packages/security/passport/src/services/PassportSerializerService.spec.ts index b8223c74997..c459c6af8e7 100644 --- a/packages/security/passport/src/services/PassportSerializerService.spec.ts +++ b/packages/security/passport/src/services/PassportSerializerService.spec.ts @@ -1,4 +1,5 @@ import {PlatformTest} from "@tsed/common"; + import {PassportSerializerService, UserInfo} from "../index.js"; describe("PassportSerializerService", () => { diff --git a/packages/security/passport/src/services/PassportSerializerService.ts b/packages/security/passport/src/services/PassportSerializerService.ts index a2f6ea708c4..ad80889e704 100644 --- a/packages/security/passport/src/services/PassportSerializerService.ts +++ b/packages/security/passport/src/services/PassportSerializerService.ts @@ -1,6 +1,7 @@ import {Type} from "@tsed/core"; import {Constant, Service} from "@tsed/di"; import {deserialize, serialize} from "@tsed/json-mapper"; + import {UserInfo} from "../domain/UserInfo.js"; /** diff --git a/packages/security/passport/src/services/ProtocolsService.spec.ts b/packages/security/passport/src/services/ProtocolsService.spec.ts index 52b0650bc37..9cb10e00369 100644 --- a/packages/security/passport/src/services/ProtocolsService.spec.ts +++ b/packages/security/passport/src/services/ProtocolsService.spec.ts @@ -1,5 +1,6 @@ import {PlatformTest, Req} from "@tsed/common"; import Passport from "passport"; + import {PassportMessage} from "../errors/PassportMessage.js"; import {Protocol, ProtocolsService} from "../index.js"; diff --git a/packages/security/passport/src/services/ProtocolsService.ts b/packages/security/passport/src/services/ProtocolsService.ts index 3d67f14a606..31b8dd4fe3c 100644 --- a/packages/security/passport/src/services/ProtocolsService.ts +++ b/packages/security/passport/src/services/ProtocolsService.ts @@ -4,6 +4,7 @@ import {Inject, Injectable, InjectorService, Provider} from "@tsed/di"; import {Unauthorized} from "@tsed/exceptions"; import Passport, {Strategy} from "passport"; import {promisify} from "util"; + import {PROVIDER_TYPE_PROTOCOL} from "../contants/constants.js"; import {PassportException} from "../errors/PassportException.js"; import {PassportMessage} from "../errors/PassportMessage.js"; diff --git a/packages/security/passport/test/app/Server.ts b/packages/security/passport/test/app/Server.ts index a3199efa399..68932ea7187 100644 --- a/packages/security/passport/test/app/Server.ts +++ b/packages/security/passport/test/app/Server.ts @@ -1,16 +1,18 @@ -import {MemoryAdapter} from "@tsed/adapters"; import "@tsed/ajv"; -import {Configuration, Inject, PlatformApplication} from "@tsed/common"; import "@tsed/platform-express"; import "@tsed/swagger"; +import "./protocols/LoginLocalProtocol.js"; + +import {MemoryAdapter} from "@tsed/adapters"; +import {Configuration, Inject, PlatformApplication} from "@tsed/common"; import bodyParser from "body-parser"; import compress from "compression"; import cookieParser from "cookie-parser"; +import session from "express-session"; import methodOverride from "method-override"; + import {AuthCtrl} from "./controllers/rest/auth/AuthCtrl.js"; import {Account} from "./models/Account.js"; -import "./protocols/LoginLocalProtocol.js"; -import session from "express-session"; const rootDir = import.meta.dirname; export {rootDir}; diff --git a/packages/security/passport/test/app/controllers/rest/auth/AuthCtrl.ts b/packages/security/passport/test/app/controllers/rest/auth/AuthCtrl.ts index 1f93dcb8a49..222a2d867ae 100644 --- a/packages/security/passport/test/app/controllers/rest/auth/AuthCtrl.ts +++ b/packages/security/passport/test/app/controllers/rest/auth/AuthCtrl.ts @@ -1,6 +1,7 @@ import {BodyParams, Controller, Post, ProviderScope, Req, Scope} from "@tsed/common"; -import {Authenticate} from "@tsed/passport"; import {Returns} from "@tsed/schema"; + +import {Authenticate} from "../../../../.."; import {Account} from "../../../models/Account.js"; import {Credentials} from "../../../models/Credentials.js"; @@ -9,7 +10,7 @@ import {Credentials} from "../../../models/Credentials.js"; export class AuthCtrl { @Post("/login") @Authenticate("login") - @Returns(200, Account).ContentType("application/json") + @(Returns(200, Account).ContentType("application/json")) login(@Req("user") user: Account, @BodyParams() credentials: Credentials) { // FACADE return user; diff --git a/packages/security/passport/test/app/models/Account.ts b/packages/security/passport/test/app/models/Account.ts index 12468ea5e5b..5b8ca2d691f 100644 --- a/packages/security/passport/test/app/models/Account.ts +++ b/packages/security/passport/test/app/models/Account.ts @@ -1,4 +1,5 @@ import {Groups, Name} from "@tsed/schema"; + import {Credentials} from "./Credentials.js"; export class Account extends Credentials { diff --git a/packages/security/passport/test/app/protocols/LoginLocalProtocol.ts b/packages/security/passport/test/app/protocols/LoginLocalProtocol.ts index 9986edbaca6..8d9132b2b9e 100644 --- a/packages/security/passport/test/app/protocols/LoginLocalProtocol.ts +++ b/packages/security/passport/test/app/protocols/LoginLocalProtocol.ts @@ -1,7 +1,8 @@ import {BodyParams, Inject, Req} from "@tsed/common"; import {Unauthorized} from "@tsed/exceptions"; -import {OnInstall, OnVerify, Protocol} from "@tsed/passport"; import {IStrategyOptions, Strategy} from "passport-local"; + +import {OnInstall, OnVerify, Protocol} from "../../.."; import {Credentials} from "../models/Credentials.js"; import {UsersRepository} from "../services/UsersRepository.js"; diff --git a/packages/security/passport/test/app/services/UsersRepository.ts b/packages/security/passport/test/app/services/UsersRepository.ts index 483d455314c..e09d68b56ae 100644 --- a/packages/security/passport/test/app/services/UsersRepository.ts +++ b/packages/security/passport/test/app/services/UsersRepository.ts @@ -1,6 +1,7 @@ import {Adapter, InjectAdapter} from "@tsed/adapters"; import {Injectable} from "@tsed/di"; import {deserialize} from "@tsed/json-mapper"; + import {Account} from "../models/Account.js"; @Injectable() diff --git a/packages/security/passport/test/passport.integration.spec.ts b/packages/security/passport/test/passport.integration.spec.ts index c3d60db0d66..9fd5e2a5b5c 100644 --- a/packages/security/passport/test/passport.integration.spec.ts +++ b/packages/security/passport/test/passport.integration.spec.ts @@ -2,6 +2,7 @@ import {PlatformTest} from "@tsed/common"; import {PlatformExpress} from "@tsed/platform-express"; import {PlatformTestSdk} from "@tsed/platform-test-sdk"; import SuperTest from "supertest"; + import {rootDir, Server} from "./app/Server.js"; const utils = PlatformTestSdk.create({ diff --git a/packages/security/passport/tsconfig.esm.json b/packages/security/passport/tsconfig.esm.json index e3b07081667..82292550ddb 100644 --- a/packages/security/passport/tsconfig.esm.json +++ b/packages/security/passport/tsconfig.esm.json @@ -2,8 +2,7 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "module": "ESNext", - "moduleResolution": "nodenext", + "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", @@ -11,7 +10,7 @@ "composite": true, "noEmit": false }, - "include": ["src", "src/**/*.json"], + "include": ["src/**/*.ts", "src/**/*.json"], "exclude": [ "node_modules", "test", diff --git a/packages/security/passport/tsconfig.spec.json b/packages/security/passport/tsconfig.spec.json index 21485bab96d..2e917f4b39d 100644 --- a/packages/security/passport/tsconfig.spec.json +++ b/packages/security/passport/tsconfig.spec.json @@ -3,7 +3,6 @@ "compilerOptions": { "baseUrl": ".", "rootDir": "../..", - "module": "commonjs", "outDir": "./lib/cjs", "declaration": false, "composite": false, diff --git a/packages/specs/ajv/package.json b/packages/specs/ajv/package.json index 98c192980db..59a3540f713 100644 --- a/packages/specs/ajv/package.json +++ b/packages/specs/ajv/package.json @@ -35,7 +35,7 @@ "@tsed/typescript": "workspace:*", "ajv": "^8.17.1", "eslint": "^8.57.0", - "typescript": "4.9.5", + "typescript": "5.6.2", "vitest": "2.0.4" }, "peerDependencies": { diff --git a/packages/specs/ajv/src/services/Ajv.spec.ts b/packages/specs/ajv/src/services/Ajv.spec.ts index 97aa02af843..e8985914c2e 100644 --- a/packages/specs/ajv/src/services/Ajv.spec.ts +++ b/packages/specs/ajv/src/services/Ajv.spec.ts @@ -1,5 +1,5 @@ import {PlatformTest} from "@tsed/common"; -import Ajv from "ajv"; +import {Ajv} from "ajv"; describe("Ajv", () => { beforeEach(() => PlatformTest.create()); diff --git a/packages/specs/ajv/src/services/Ajv.ts b/packages/specs/ajv/src/services/Ajv.ts index 67cef24c810..306327d5f17 100644 --- a/packages/specs/ajv/src/services/Ajv.ts +++ b/packages/specs/ajv/src/services/Ajv.ts @@ -3,6 +3,7 @@ import {Configuration, InjectorService, ProviderScope, registerProvider} from "@ import {Ajv, Format, KeywordDefinition, Options, Vocabulary} from "ajv"; import AjvErrors from "ajv-errors"; import AjvFormats from "ajv-formats"; + import {FormatsMethods} from "../interfaces/FormatsMethods.js"; import {IAjvSettings} from "../interfaces/IAjvSettings.js"; @@ -53,7 +54,6 @@ function getFormats(injector: InjectorService): {name: string; options: Format}[ } registerProvider({ - // @ts-ignore provide: Ajv, deps: [Configuration, InjectorService], scope: ProviderScope.SINGLETON, diff --git a/packages/specs/ajv/src/services/AjvService.spec.ts b/packages/specs/ajv/src/services/AjvService.spec.ts index a03d7d261ce..cd7de9e5477 100644 --- a/packages/specs/ajv/src/services/AjvService.spec.ts +++ b/packages/specs/ajv/src/services/AjvService.spec.ts @@ -1,6 +1,7 @@ import {PlatformTest} from "@tsed/common"; import {catchAsyncError} from "@tsed/core"; import {object, string} from "@tsed/schema"; + import {AjvService} from "./AjvService.js"; describe("AjvService", () => { diff --git a/packages/specs/ajv/src/services/AjvService.ts b/packages/specs/ajv/src/services/AjvService.ts index 977f62d092f..b7d0531d61f 100644 --- a/packages/specs/ajv/src/services/AjvService.ts +++ b/packages/specs/ajv/src/services/AjvService.ts @@ -1,12 +1,14 @@ +import "./Ajv.js"; + import {deepClone, getValue, nameOf, prototypeOf, setValue, Type} from "@tsed/core"; import {Constant, Inject, Injectable} from "@tsed/di"; import {getJsonSchema, JsonEntityStore, JsonSchema, JsonSchemaObject} from "@tsed/schema"; -import {Ajv, ErrorObject} from "ajv"; +import {Ajv, type ErrorObject} from "ajv"; + import {AjvValidationError} from "../errors/AjvValidationError.js"; import {AjvErrorObject, ErrorFormatter} from "../interfaces/IAjvSettings.js"; import {defaultErrorFormatter} from "../utils/defaultErrorFormatter.js"; import {getPath} from "../utils/getPath.js"; -import "./Ajv.js"; export interface AjvValidateOptions extends Record { schema?: JsonSchema | Partial; diff --git a/packages/specs/ajv/test/integration/formats.integration.spec.ts b/packages/specs/ajv/test/integration/formats.integration.spec.ts index 4596c80fb6b..64b46115815 100644 --- a/packages/specs/ajv/test/integration/formats.integration.spec.ts +++ b/packages/specs/ajv/test/integration/formats.integration.spec.ts @@ -1,8 +1,9 @@ import {PlatformTest} from "@tsed/common"; import {Format, getJsonSchema} from "@tsed/schema"; -import {AjvService} from "../../src/services/AjvService.js"; + import {Formats} from "../../src/decorators/formats.js"; import {FormatsMethods} from "../../src/interfaces/FormatsMethods.js"; +import {AjvService} from "../../src/services/AjvService.js"; const NOT_URI_FRAGMENT = /\/|:/; const URI = diff --git a/packages/specs/ajv/test/integration/keywords.integration.spec.ts b/packages/specs/ajv/test/integration/keywords.integration.spec.ts index 74246cc3622..fabdb605f34 100644 --- a/packages/specs/ajv/test/integration/keywords.integration.spec.ts +++ b/packages/specs/ajv/test/integration/keywords.integration.spec.ts @@ -1,7 +1,9 @@ -import "@tsed/ajv"; +import "../.."; + import {PlatformTest} from "@tsed/common"; import {array, CustomKey, getJsonSchema, number} from "@tsed/schema"; import Ajv, {_, KeywordCxt} from "ajv"; + import {Keyword} from "../../src/decorators/keyword.js"; import {KeywordMethods} from "../../src/interfaces/KeywordMethods.js"; diff --git a/packages/specs/ajv/test/integration/nullable.integration.spec.ts b/packages/specs/ajv/test/integration/nullable.integration.spec.ts index dccca25e7cb..6f8f75c1ceb 100644 --- a/packages/specs/ajv/test/integration/nullable.integration.spec.ts +++ b/packages/specs/ajv/test/integration/nullable.integration.spec.ts @@ -1,4 +1,5 @@ import "../../src/index.js"; + import {BodyParams, ParamValidationError, PlatformTest, ValidationPipe} from "@tsed/common"; import {BadRequest} from "@tsed/exceptions"; import {CollectionOf, JsonParameterStore, Nullable, Property} from "@tsed/schema"; diff --git a/packages/specs/ajv/test/integration/validation.integration.spec.ts b/packages/specs/ajv/test/integration/validation.integration.spec.ts index 7067e10616d..643233f64e8 100644 --- a/packages/specs/ajv/test/integration/validation.integration.spec.ts +++ b/packages/specs/ajv/test/integration/validation.integration.spec.ts @@ -1,4 +1,5 @@ import "../../src/index.js"; + import {BodyParams, ParamTypes, ParamValidationError, PlatformTest, Post, QueryParams, UseParam, ValidationPipe} from "@tsed/common"; import {BadRequest} from "@tsed/exceptions"; import {getJsonSchema, JsonParameterStore, MinLength, Property, Required, Schema} from "@tsed/schema"; diff --git a/packages/specs/ajv/tsconfig.esm.json b/packages/specs/ajv/tsconfig.esm.json index e3b07081667..8954049da4a 100644 --- a/packages/specs/ajv/tsconfig.esm.json +++ b/packages/specs/ajv/tsconfig.esm.json @@ -2,8 +2,6 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "module": "ESNext", - "moduleResolution": "nodenext", "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", @@ -11,7 +9,7 @@ "composite": true, "noEmit": false }, - "include": ["src", "src/**/*.json"], + "include": ["src/**/*.ts", "src/**/*.json"], "exclude": [ "node_modules", "test", diff --git a/packages/specs/ajv/tsconfig.spec.json b/packages/specs/ajv/tsconfig.spec.json index 0396022d74f..10b1f26d4bb 100644 --- a/packages/specs/ajv/tsconfig.spec.json +++ b/packages/specs/ajv/tsconfig.spec.json @@ -3,7 +3,6 @@ "compilerOptions": { "baseUrl": ".", "rootDir": "../..", - "module": "commonjs", "outDir": "./lib/cjs", "declaration": false, "composite": false, diff --git a/packages/specs/exceptions/package.json b/packages/specs/exceptions/package.json index e81af7b9a59..b655912fb7a 100644 --- a/packages/specs/exceptions/package.json +++ b/packages/specs/exceptions/package.json @@ -31,7 +31,7 @@ "@tsed/typescript": "workspace:*", "@types/statuses": "2.0.5", "eslint": "^8.57.0", - "typescript": "4.9.5", + "typescript": "5.6.2", "vitest": "2.0.4" }, "peerDependencies": { diff --git a/packages/specs/exceptions/src/core/Exception.spec.ts b/packages/specs/exceptions/src/core/Exception.spec.ts index 4017998b90c..32bbd44ad6e 100644 --- a/packages/specs/exceptions/src/core/Exception.spec.ts +++ b/packages/specs/exceptions/src/core/Exception.spec.ts @@ -14,7 +14,7 @@ describe("Exception", () => { expect(exception.toString()).toEqual("INTERNAL_SERVER_ERROR(500): test, innerException: test"); }); - it("should use origin", () => { + it("should use origin (inner)", () => { const exception = new Exception(203, "test", new Error("test")); exception.setHeaders({key: "value"}); @@ -25,7 +25,7 @@ describe("Exception", () => { expect(exception.toString()).toEqual("NON_AUTHORITATIVE_INFORMATION(203): test, innerException: test"); }); - it("should use origin as string", () => { + it("should use origin as string (inner)", () => { const exception = new Exception(203, "test", "test"); expect(exception.status).toEqual(203); diff --git a/packages/specs/exceptions/src/core/Exception.ts b/packages/specs/exceptions/src/core/Exception.ts index c946e02607f..d1f8ae6a341 100644 --- a/packages/specs/exceptions/src/core/Exception.ts +++ b/packages/specs/exceptions/src/core/Exception.ts @@ -1,6 +1,7 @@ import {classOf, nameOf} from "@tsed/core"; import {constantCase} from "change-case"; import statuses from "statuses"; + import {StatusFamily} from "./StatusFamily.js"; export class Exception extends Error { diff --git a/packages/specs/exceptions/test/clientErrors.spec.ts b/packages/specs/exceptions/test/clientErrors.spec.ts index c468f8324ef..45abf076ee7 100644 --- a/packages/specs/exceptions/test/clientErrors.spec.ts +++ b/packages/specs/exceptions/test/clientErrors.spec.ts @@ -1,8 +1,10 @@ import {catchError} from "@tsed/core"; + import { BadMapping, BadRequest, Conflict, + ExpectationFailed, Forbidden, Gone, ImATeapot, @@ -15,9 +17,9 @@ import { PreconditionFailed, PreconditionRequired, ProxyAuthentificationRequired, - RequestRangeUnsatisfiable, RequestEntityTooLarge, RequestHeaderFieldsTooLarge, + RequestRangeUnsatisfiable, RequestTimeout, RequestURITooLong, TooManyRequests, @@ -25,8 +27,7 @@ import { UnavailableForLegalReasons, UnprocessableEntity, UnsupportedMediaType, - UpgradeRequired, - ExpectationFailed + UpgradeRequired } from "../src/index.js"; describe("ClientErrors", () => { @@ -173,7 +174,7 @@ describe("ClientErrors", () => { }); }); - describe("LengthRequired", () => { + describe("NotFound", () => { it("should emit an exception", () => { const err = new NotFound("message"); diff --git a/packages/specs/exceptions/test/redirections.spec.ts b/packages/specs/exceptions/test/redirections.spec.ts index 71b4433b430..a40ca4aea2b 100644 --- a/packages/specs/exceptions/test/redirections.spec.ts +++ b/packages/specs/exceptions/test/redirections.spec.ts @@ -1,13 +1,14 @@ import {catchError} from "@tsed/core"; + import { MovedPermanently, MovedTemporarily, MultipleChoices, + NotModified, PermanentRedirect, SeeOther, TemporaryRedirect, - UseProxy, - NotModified + UseProxy } from "../src/index.js"; describe("Redirections", () => { diff --git a/packages/specs/exceptions/test/serverErrors.spec.ts b/packages/specs/exceptions/test/serverErrors.spec.ts index f0a84ba4ae5..facaa0777fd 100644 --- a/packages/specs/exceptions/test/serverErrors.spec.ts +++ b/packages/specs/exceptions/test/serverErrors.spec.ts @@ -1,4 +1,5 @@ import {catchError} from "@tsed/core"; + import { BadGateway, BandwidthLimitExceeded, diff --git a/packages/specs/exceptions/tsconfig.esm.json b/packages/specs/exceptions/tsconfig.esm.json index e3b07081667..82292550ddb 100644 --- a/packages/specs/exceptions/tsconfig.esm.json +++ b/packages/specs/exceptions/tsconfig.esm.json @@ -2,8 +2,7 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "module": "ESNext", - "moduleResolution": "nodenext", + "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", @@ -11,7 +10,7 @@ "composite": true, "noEmit": false }, - "include": ["src", "src/**/*.json"], + "include": ["src/**/*.ts", "src/**/*.json"], "exclude": [ "node_modules", "test", diff --git a/packages/specs/exceptions/tsconfig.spec.json b/packages/specs/exceptions/tsconfig.spec.json index d727d0f2fa3..641bcc59bbc 100644 --- a/packages/specs/exceptions/tsconfig.spec.json +++ b/packages/specs/exceptions/tsconfig.spec.json @@ -3,7 +3,6 @@ "compilerOptions": { "baseUrl": ".", "rootDir": "../..", - "module": "commonjs", "outDir": "./lib/cjs", "declaration": false, "composite": false, diff --git a/packages/specs/json-mapper/package.json b/packages/specs/json-mapper/package.json index 20e84e05259..df19bb22ddd 100644 --- a/packages/specs/json-mapper/package.json +++ b/packages/specs/json-mapper/package.json @@ -46,7 +46,7 @@ "@tsed/schema": "workspace:*", "@tsed/typescript": "workspace:*", "eslint": "^8.57.0", - "typescript": "4.9.5", + "typescript": "5.6.2", "vitest": "2.0.4", "webpack": "^5.75.0" }, diff --git a/packages/specs/json-mapper/src/components/DateMapper.ts b/packages/specs/json-mapper/src/components/DateMapper.ts index 284d6381976..39a622c8396 100644 --- a/packages/specs/json-mapper/src/components/DateMapper.ts +++ b/packages/specs/json-mapper/src/components/DateMapper.ts @@ -1,4 +1,5 @@ import {isBoolean} from "@tsed/core"; + import {JsonMapper} from "../decorators/jsonMapper.js"; import {JsonMapperMethods} from "../interfaces/JsonMapperMethods.js"; diff --git a/packages/specs/json-mapper/src/components/PrimitiveMapper.spec.ts b/packages/specs/json-mapper/src/components/PrimitiveMapper.spec.ts index 4bc433fa280..88d240ed877 100644 --- a/packages/specs/json-mapper/src/components/PrimitiveMapper.spec.ts +++ b/packages/specs/json-mapper/src/components/PrimitiveMapper.spec.ts @@ -1,4 +1,5 @@ import {catchError} from "@tsed/core"; + import {PrimitiveMapper} from "./PrimitiveMapper.js"; describe("PrimitiveMapper", () => { diff --git a/packages/specs/json-mapper/src/components/PrimitiveMapper.ts b/packages/specs/json-mapper/src/components/PrimitiveMapper.ts index f82b179d02c..c9ff007d6aa 100644 --- a/packages/specs/json-mapper/src/components/PrimitiveMapper.ts +++ b/packages/specs/json-mapper/src/components/PrimitiveMapper.ts @@ -1,4 +1,5 @@ import {nameOf} from "@tsed/core"; + import {JsonMapper} from "../decorators/jsonMapper.js"; import {JsonMapperCtx, JsonMapperMethods} from "../interfaces/JsonMapperMethods.js"; diff --git a/packages/specs/json-mapper/src/decorators/jsonMapper.ts b/packages/specs/json-mapper/src/decorators/jsonMapper.ts index 4fbca4b3b86..b5bcbc99028 100644 --- a/packages/specs/json-mapper/src/decorators/jsonMapper.ts +++ b/packages/specs/json-mapper/src/decorators/jsonMapper.ts @@ -1,4 +1,5 @@ import {Type} from "@tsed/core"; + import {registerJsonTypeMapper} from "../domain/JsonMapperTypesContainer.js"; /** diff --git a/packages/specs/json-mapper/src/decorators/onDeserialize.ts b/packages/specs/json-mapper/src/decorators/onDeserialize.ts index 1f25ab1e3fb..a4ae53e8c13 100644 --- a/packages/specs/json-mapper/src/decorators/onDeserialize.ts +++ b/packages/specs/json-mapper/src/decorators/onDeserialize.ts @@ -1,4 +1,4 @@ -import {JsonHookContext, JsonEntityFn} from "@tsed/schema"; +import {JsonEntityFn, JsonHookContext} from "@tsed/schema"; export interface OnDeserializeCallback { (value: any, ctx: JsonHookContext): any; diff --git a/packages/specs/json-mapper/src/domain/JsonDeserializer.spec.ts b/packages/specs/json-mapper/src/domain/JsonDeserializer.spec.ts index d023b538729..ec49cd06dc8 100644 --- a/packages/specs/json-mapper/src/domain/JsonDeserializer.spec.ts +++ b/packages/specs/json-mapper/src/domain/JsonDeserializer.spec.ts @@ -1,4 +1,8 @@ -import faker from "@faker-js/faker"; +import "../components/DateMapper.js"; +import "../components/PrimitiveMapper.js"; +import "../components/SymbolMapper.js"; + +import {faker} from "@faker-js/faker"; import {QueryParams} from "@tsed/platform-params"; import { AdditionalProperties, @@ -23,11 +27,9 @@ import { Property, Required } from "@tsed/schema"; + import {Post} from "../../test/helpers/Post.js"; import {User} from "../../test/helpers/User.js"; -import "../components/DateMapper.js"; -import "../components/PrimitiveMapper.js"; -import "../components/SymbolMapper.js"; import {OnDeserialize} from "../decorators/onDeserialize.js"; import {JsonDeserializer} from "./JsonDeserializer.js"; import {JsonMapperSettings} from "./JsonMapperSettings.js"; diff --git a/packages/specs/json-mapper/src/domain/JsonDeserializer.ts b/packages/specs/json-mapper/src/domain/JsonDeserializer.ts index 312948b0253..cb1a3b76772 100644 --- a/packages/specs/json-mapper/src/domain/JsonDeserializer.ts +++ b/packages/specs/json-mapper/src/domain/JsonDeserializer.ts @@ -1,5 +1,6 @@ import {classOf, isArray, isBoolean, isClass, isEmpty, isNil, nameOf, objectKeys, Type} from "@tsed/core"; import {getPropertiesStores, JsonClassStore, JsonEntityStore, JsonParameterStore, JsonPropertyStore} from "@tsed/schema"; + import {alterAfterDeserialize} from "../hooks/alterAfterDeserialize.js"; import {alterBeforeDeserialize} from "../hooks/alterBeforeDeserialize.js"; import {alterOnDeserialize} from "../hooks/alterOnDeserialize.js"; diff --git a/packages/specs/json-mapper/src/domain/JsonDeserializerOptions.ts b/packages/specs/json-mapper/src/domain/JsonDeserializerOptions.ts index 7907ba2e4fd..21e8d88d7b7 100644 --- a/packages/specs/json-mapper/src/domain/JsonDeserializerOptions.ts +++ b/packages/specs/json-mapper/src/domain/JsonDeserializerOptions.ts @@ -1,5 +1,6 @@ import {MetadataTypes, Type} from "@tsed/core"; import {JsonEntityStore} from "@tsed/schema"; + import {JsonMapperMethods} from "../interfaces/JsonMapperMethods.js"; import {JsonMapperGlobalOptions} from "./JsonMapperGlobalOptions.js"; diff --git a/packages/specs/json-mapper/src/domain/JsonMapperTypesContainer.ts b/packages/specs/json-mapper/src/domain/JsonMapperTypesContainer.ts index 938a0932991..99df8193935 100644 --- a/packages/specs/json-mapper/src/domain/JsonMapperTypesContainer.ts +++ b/packages/specs/json-mapper/src/domain/JsonMapperTypesContainer.ts @@ -1,4 +1,5 @@ import {Type} from "@tsed/core"; + import {JsonMapperMethods} from "../interfaces/JsonMapperMethods.js"; /** * @ignore diff --git a/packages/specs/json-mapper/src/domain/JsonSerializer.spec.ts b/packages/specs/json-mapper/src/domain/JsonSerializer.spec.ts index 8e158c372f2..37a0f4bd063 100644 --- a/packages/specs/json-mapper/src/domain/JsonSerializer.spec.ts +++ b/packages/specs/json-mapper/src/domain/JsonSerializer.spec.ts @@ -1,3 +1,7 @@ +import "../components/DateMapper.js"; +import "../components/PrimitiveMapper.js"; +import "../components/SymbolMapper.js"; + import {cleanObject, isBoolean, isNumber, isObjectID, useDecorators} from "@tsed/core"; import { AdditionalProperties, @@ -19,11 +23,9 @@ import { } 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"; -import "../components/DateMapper.js"; -import "../components/PrimitiveMapper.js"; -import "../components/SymbolMapper.js"; import {OnDeserialize} from "../decorators/onDeserialize.js"; import {OnSerialize} from "../decorators/onSerialize.js"; import {deserialize} from "../utils/deserialize.js"; diff --git a/packages/specs/json-mapper/src/domain/JsonSerializer.ts b/packages/specs/json-mapper/src/domain/JsonSerializer.ts index cb42758f8ec..091b8b172e1 100644 --- a/packages/specs/json-mapper/src/domain/JsonSerializer.ts +++ b/packages/specs/json-mapper/src/domain/JsonSerializer.ts @@ -15,6 +15,7 @@ import { Type } from "@tsed/core"; import {getPropertiesStores, JsonClassStore, JsonEntityStore, JsonPropertyStore} from "@tsed/schema"; + import {alterOnSerialize} from "../hooks/alterOnSerialize.js"; import {getObjectProperties} from "../utils/getObjectProperties.js"; import {JsonMapperCompiler} from "./JsonMapperCompiler.js"; diff --git a/packages/specs/json-mapper/src/domain/JsonSerializerOptions.ts b/packages/specs/json-mapper/src/domain/JsonSerializerOptions.ts index e6eb60fc8b1..009773e7c6c 100644 --- a/packages/specs/json-mapper/src/domain/JsonSerializerOptions.ts +++ b/packages/specs/json-mapper/src/domain/JsonSerializerOptions.ts @@ -1,4 +1,5 @@ import {MetadataTypes, Type} from "@tsed/core"; + import {JsonMapperMethods} from "../interfaces/JsonMapperMethods.js"; import {JsonMapperGlobalOptions} from "./JsonMapperGlobalOptions.js"; diff --git a/packages/specs/json-mapper/src/domain/Writer.ts b/packages/specs/json-mapper/src/domain/Writer.ts index 7c7129dab1a..4d0559c6cba 100644 --- a/packages/specs/json-mapper/src/domain/Writer.ts +++ b/packages/specs/json-mapper/src/domain/Writer.ts @@ -128,7 +128,10 @@ export class Writer { class IfWriter extends Writer { protected elseWriter?: Writer; - constructor(protected condition: string, root: Writer) { + constructor( + protected condition: string, + root: Writer + ) { super(); this._root = root; } diff --git a/packages/specs/json-mapper/src/utils/serialize.spec.ts b/packages/specs/json-mapper/src/utils/serialize.spec.ts index a60df3eb6a4..e407d4f8d10 100644 --- a/packages/specs/json-mapper/src/utils/serialize.spec.ts +++ b/packages/specs/json-mapper/src/utils/serialize.spec.ts @@ -1,5 +1,7 @@ -import {Property} from "@tsed/schema"; import "../components/PrimitiveMapper.js"; + +import {Property} from "@tsed/schema"; + import {serialize} from "./serialize.js"; describe("serialize()", () => { diff --git a/packages/specs/json-mapper/test/helpers/Post.ts b/packages/specs/json-mapper/test/helpers/Post.ts index bda2dbdb5a5..c0d38fc5686 100644 --- a/packages/specs/json-mapper/test/helpers/Post.ts +++ b/packages/specs/json-mapper/test/helpers/Post.ts @@ -1,4 +1,5 @@ import {Property} from "@tsed/schema"; + import {User} from "./User.js"; export class Post { @Property() diff --git a/packages/specs/json-mapper/test/helpers/User.ts b/packages/specs/json-mapper/test/helpers/User.ts index 5f9a03a25eb..d8613bfddcd 100644 --- a/packages/specs/json-mapper/test/helpers/User.ts +++ b/packages/specs/json-mapper/test/helpers/User.ts @@ -1,4 +1,5 @@ import {CollectionOf, Property} from "@tsed/schema"; + import {Post} from "./Post.js"; export class User { diff --git a/packages/specs/json-mapper/test/integration/additional-properties.integration.spec.ts b/packages/specs/json-mapper/test/integration/additional-properties.integration.spec.ts index 34799ce1a90..f6eef160d07 100644 --- a/packages/specs/json-mapper/test/integration/additional-properties.integration.spec.ts +++ b/packages/specs/json-mapper/test/integration/additional-properties.integration.spec.ts @@ -1,6 +1,7 @@ import {useDecorators} from "@tsed/core"; import {AdditionalProperties, Groups, Hidden, JsonEntityStore, Name, ReadOnly, Title} from "@tsed/schema"; import {sentenceCase, snakeCase} from "change-case"; + import {deserialize, serialize} from "../../src/index.js"; describe("AdditionalProperties", () => { diff --git a/packages/specs/json-mapper/test/integration/after.deserialize.integration.spec.ts b/packages/specs/json-mapper/test/integration/after.deserialize.integration.spec.ts index bbee6e9eaa8..c17c68f4e00 100644 --- a/packages/specs/json-mapper/test/integration/after.deserialize.integration.spec.ts +++ b/packages/specs/json-mapper/test/integration/after.deserialize.integration.spec.ts @@ -1,8 +1,9 @@ import {catchAsyncError} from "@tsed/core"; import {BadRequest} from "@tsed/exceptions"; import {Enum, Property} from "@tsed/schema"; -import {deserialize} from "../../src/utils/deserialize.js"; + import {AfterDeserialize} from "../../src/decorators/afterDeserialize.js"; +import {deserialize} from "../../src/utils/deserialize.js"; import {FoodStatus} from "../helpers/FoodStatus.js"; @AfterDeserialize((data: Food) => { diff --git a/packages/specs/json-mapper/test/integration/allowed-groups.integration.spec.ts b/packages/specs/json-mapper/test/integration/allowed-groups.integration.spec.ts index 36d9fa9b5a2..8da73560486 100644 --- a/packages/specs/json-mapper/test/integration/allowed-groups.integration.spec.ts +++ b/packages/specs/json-mapper/test/integration/allowed-groups.integration.spec.ts @@ -1,5 +1,6 @@ import {Controller} from "@tsed/di"; import {EndpointMetadata, Get, Groups, Property, Returns} from "@tsed/schema"; + import {serialize} from "../../src/utils/serialize.js"; class MyModel { @@ -22,7 +23,7 @@ class MyModel { @Controller("/controllers") class MyController { @Get("/:id") - @Returns(200, MyModel).AllowedGroups("summary", "details") + @(Returns(200, MyModel).AllowedGroups("summary", "details")) get() { return { id: "id", @@ -34,7 +35,7 @@ class MyController { } @Get("/:id") - @Returns(200, MyModel).Groups("!admin").AllowedGroups("summary", "details") + @(Returns(200, MyModel).Groups("!admin").AllowedGroups("summary", "details")) get2() { return { id: "id", diff --git a/packages/specs/json-mapper/test/integration/before.deserialize.integration.spec.ts b/packages/specs/json-mapper/test/integration/before.deserialize.integration.spec.ts index 31c68f4d580..37d648332b5 100644 --- a/packages/specs/json-mapper/test/integration/before.deserialize.integration.spec.ts +++ b/packages/specs/json-mapper/test/integration/before.deserialize.integration.spec.ts @@ -1,8 +1,9 @@ import {catchAsyncError} from "@tsed/core"; import {BadRequest} from "@tsed/exceptions"; import {Enum, Property} from "@tsed/schema"; -import {deserialize} from "../../src/utils/deserialize.js"; + import {BeforeDeserialize} from "../../src/decorators/beforeDeserialize.js"; +import {deserialize} from "../../src/utils/deserialize.js"; import {FoodStatus} from "../helpers/FoodStatus.js"; @BeforeDeserialize((data: Record) => { diff --git a/packages/specs/json-mapper/test/integration/collection-of-map.integration.spec.ts b/packages/specs/json-mapper/test/integration/collection-of-map.integration.spec.ts index aa05585f38e..0f5ec15b148 100644 --- a/packages/specs/json-mapper/test/integration/collection-of-map.integration.spec.ts +++ b/packages/specs/json-mapper/test/integration/collection-of-map.integration.spec.ts @@ -1,5 +1,6 @@ -import {CollectionOf, Schema, array, map, string} from "@tsed/schema"; -import {deserialize} from "@tsed/json-mapper"; +import {array, CollectionOf, map, Schema, string} from "@tsed/schema"; + +import {deserialize} from "../.."; describe("Collection of Map", () => { it("should declare an array of map of string", () => { diff --git a/packages/specs/json-mapper/test/integration/custom.validation.spec.ts b/packages/specs/json-mapper/test/integration/custom.validation.spec.ts index aaa524a00d4..507f9c0a805 100644 --- a/packages/specs/json-mapper/test/integration/custom.validation.spec.ts +++ b/packages/specs/json-mapper/test/integration/custom.validation.spec.ts @@ -1,8 +1,9 @@ import {catchAsyncError} from "@tsed/core"; import {BadRequest} from "@tsed/exceptions"; import {JsonEntityFn, Property} from "@tsed/schema"; -import {deserialize} from "../../src/utils/deserialize.js"; + import {BeforeDeserialize} from "../../src/decorators/beforeDeserialize.js"; +import {deserialize} from "../../src/utils/deserialize.js"; class Company { @Property() diff --git a/packages/specs/json-mapper/test/integration/date.integration.spec.ts b/packages/specs/json-mapper/test/integration/date.integration.spec.ts index e9f0682581f..add7fccae25 100644 --- a/packages/specs/json-mapper/test/integration/date.integration.spec.ts +++ b/packages/specs/json-mapper/test/integration/date.integration.spec.ts @@ -1,5 +1,6 @@ import {isBoolean} from "@tsed/core"; import {DateFormat} from "@tsed/schema"; + import {JsonMapper, JsonMapperCtx, JsonMapperMethods, serialize} from "../../src/index.js"; @JsonMapper(Date) diff --git a/packages/specs/json-mapper/test/integration/discriminator.integration.spec.ts b/packages/specs/json-mapper/test/integration/discriminator.integration.spec.ts index fb7abc6babe..048b1b4f863 100644 --- a/packages/specs/json-mapper/test/integration/discriminator.integration.spec.ts +++ b/packages/specs/json-mapper/test/integration/discriminator.integration.spec.ts @@ -1,6 +1,7 @@ import {Controller} from "@tsed/di"; import {BodyParams, PathParams} from "@tsed/platform-params"; import {DiscriminatorKey, DiscriminatorValue, JsonParameterStore, OneOf, Property, Put, Required, Returns} from "@tsed/schema"; + import {deserialize, serialize} from "../../src/index.js"; class Event { @@ -216,7 +217,7 @@ describe("Discriminator", () => { @Controller("/") class Test { @Put("/:id") - @Returns(200).OneOf(Event) + @(Returns(200).OneOf(Event)) put(@PathParams(":id") id: string, @BodyParams() @OneOf(Event) event: OneOfEvents) { return []; } @@ -274,7 +275,7 @@ describe("Discriminator", () => { @Controller("/") class Test { @Put("/:id") - @Returns(200).OneOf(Event) + @(Returns(200).OneOf(Event)) put(@PathParams(":id") id: string, @BodyParams() @OneOf(Base) Base: any) { return []; } @@ -299,7 +300,7 @@ describe("Discriminator", () => { @Controller("/") class Test { @Put("/:id") - @Returns(200).OneOf(Event) + @(Returns(200).OneOf(Event)) put(@PathParams(":id") id: string, @BodyParams() @OneOf(Event) event: OneOfEvents[]) { return []; } diff --git a/packages/specs/json-mapper/test/integration/enum.serialiazation.integration.spec.ts b/packages/specs/json-mapper/test/integration/enum.serialiazation.integration.spec.ts index 8580b2f7fff..fe04735ede7 100644 --- a/packages/specs/json-mapper/test/integration/enum.serialiazation.integration.spec.ts +++ b/packages/specs/json-mapper/test/integration/enum.serialiazation.integration.spec.ts @@ -1,4 +1,5 @@ import {Enum, Property, Required} from "@tsed/schema"; + import {serialize} from "../../src/utils/serialize.js"; export enum EnumValue { diff --git a/packages/specs/json-mapper/test/integration/generics.integration.spec.ts b/packages/specs/json-mapper/test/integration/generics.integration.spec.ts index 90a30ea0b12..243ccb17bbf 100644 --- a/packages/specs/json-mapper/test/integration/generics.integration.spec.ts +++ b/packages/specs/json-mapper/test/integration/generics.integration.spec.ts @@ -1,5 +1,4 @@ import {Controller} from "@tsed/di"; -import {expect, describe, it} from "vitest"; import { boolean, CollectionOf, @@ -17,6 +16,8 @@ import { Returns, string } from "@tsed/schema"; +import {describe, expect, it} from "vitest"; + import {deserialize} from "../../src/utils/deserialize.js"; import {serialize} from "../../src/utils/serialize.js"; @@ -353,7 +354,7 @@ describe("Generics", () => { constructor() {} @Get("/") - @Returns(200, Pagination).Of(TestEntity) + @(Returns(200, Pagination).Of(TestEntity)) get() {} } @@ -417,7 +418,7 @@ describe("Generics", () => { constructor() {} @Get("/") - @Returns(200, Pagination).Of(TestEntity) + @(Returns(200, Pagination).Of(TestEntity)) get() {} } diff --git a/packages/specs/json-mapper/test/integration/groups.integration.spec.ts b/packages/specs/json-mapper/test/integration/groups.integration.spec.ts index fcb11820f7e..6a63b6bf60b 100644 --- a/packages/specs/json-mapper/test/integration/groups.integration.spec.ts +++ b/packages/specs/json-mapper/test/integration/groups.integration.spec.ts @@ -1,4 +1,5 @@ import {CollectionOf, Groups, Property} from "@tsed/schema"; + import {deserialize} from "../../src/utils/deserialize.js"; import {serialize} from "../../src/utils/serialize.js"; diff --git a/packages/specs/json-mapper/test/integration/ignore.integration.spec.ts b/packages/specs/json-mapper/test/integration/ignore.integration.spec.ts index 637b9495f88..9b00a648bd6 100644 --- a/packages/specs/json-mapper/test/integration/ignore.integration.spec.ts +++ b/packages/specs/json-mapper/test/integration/ignore.integration.spec.ts @@ -1,4 +1,5 @@ import {Ignore, Property} from "@tsed/schema"; + import {serialize} from "../../src/utils/serialize.js"; describe("Mapping @Ignore", () => { diff --git a/packages/specs/json-mapper/test/integration/models.date.intregration.spec.ts b/packages/specs/json-mapper/test/integration/models.date.intregration.spec.ts index 368ff36fb33..4a13e945665 100644 --- a/packages/specs/json-mapper/test/integration/models.date.intregration.spec.ts +++ b/packages/specs/json-mapper/test/integration/models.date.intregration.spec.ts @@ -1,5 +1,6 @@ import {Minimum, Name, Required} from "@tsed/schema"; import moment from "moment"; + import {OnSerialize} from "../../src/decorators/onSerialize.js"; import {deserialize} from "../../src/utils/deserialize.js"; import {serialize} from "../../src/utils/serialize.js"; diff --git a/packages/specs/json-mapper/test/integration/models.integration.spec.ts b/packages/specs/json-mapper/test/integration/models.integration.spec.ts index 8c9ec64b976..158ce8b46e6 100644 --- a/packages/specs/json-mapper/test/integration/models.integration.spec.ts +++ b/packages/specs/json-mapper/test/integration/models.integration.spec.ts @@ -1,4 +1,5 @@ import {Property, Required} from "@tsed/schema"; + import {serialize} from "../../src/utils/serialize.js"; export class Menu { diff --git a/packages/specs/json-mapper/test/integration/moment.integration.spec.ts b/packages/specs/json-mapper/test/integration/moment.integration.spec.ts index 72bd3c20a65..58ecb2c7ed6 100644 --- a/packages/specs/json-mapper/test/integration/moment.integration.spec.ts +++ b/packages/specs/json-mapper/test/integration/moment.integration.spec.ts @@ -1,5 +1,6 @@ import {DateFormat} from "@tsed/schema"; import moment, {Moment} from "moment"; + import {JsonMapper} from "../../src/decorators/jsonMapper.js"; import {getJsonMapperTypes} from "../../src/domain/JsonMapperTypesContainer.js"; import {JsonSerializer} from "../../src/index.js"; diff --git a/packages/specs/json-mapper/test/integration/nested-list.integration.spec.ts b/packages/specs/json-mapper/test/integration/nested-list.integration.spec.ts index 0dcf26f711e..f70bc8a9914 100644 --- a/packages/specs/json-mapper/test/integration/nested-list.integration.spec.ts +++ b/packages/specs/json-mapper/test/integration/nested-list.integration.spec.ts @@ -1,4 +1,5 @@ import {CollectionOf, ForwardGroups, Name, Required} from "@tsed/schema"; + import {serialize} from "../../src/utils/serialize.js"; class TeamModel { diff --git a/packages/specs/json-mapper/test/integration/nullable.integration.spec.ts b/packages/specs/json-mapper/test/integration/nullable.integration.spec.ts index 3c3cd52fcdd..757c74ba437 100644 --- a/packages/specs/json-mapper/test/integration/nullable.integration.spec.ts +++ b/packages/specs/json-mapper/test/integration/nullable.integration.spec.ts @@ -1,6 +1,7 @@ -import {serialize} from "../../src/utils/serialize.js"; import {Name, Nullable, Required} from "@tsed/schema"; +import {serialize} from "../../src/utils/serialize.js"; + export class ExtensionModel { @Required() id: string; diff --git a/packages/specs/json-mapper/test/integration/pageable.integration.spec.ts b/packages/specs/json-mapper/test/integration/pageable.integration.spec.ts index d1054608d62..340e79aa276 100644 --- a/packages/specs/json-mapper/test/integration/pageable.integration.spec.ts +++ b/packages/specs/json-mapper/test/integration/pageable.integration.spec.ts @@ -14,6 +14,7 @@ import { SpecTypes, string } from "@tsed/schema"; + import {OnDeserialize, serialize} from "../../src/index.js"; class Pageable { diff --git a/packages/specs/json-mapper/test/integration/partial.integration.spec.ts b/packages/specs/json-mapper/test/integration/partial.integration.spec.ts index b87bf892a18..3c869ec0196 100644 --- a/packages/specs/json-mapper/test/integration/partial.integration.spec.ts +++ b/packages/specs/json-mapper/test/integration/partial.integration.spec.ts @@ -1,4 +1,5 @@ import {CollectionOf, Groups, Property} from "@tsed/schema"; + import {deserialize} from "../../src/utils/deserialize.js"; class Product { diff --git a/packages/specs/json-mapper/test/integration/readonly.integration.spec.ts b/packages/specs/json-mapper/test/integration/readonly.integration.spec.ts index ebf7cac6e07..053e90a5048 100644 --- a/packages/specs/json-mapper/test/integration/readonly.integration.spec.ts +++ b/packages/specs/json-mapper/test/integration/readonly.integration.spec.ts @@ -1,7 +1,8 @@ -import {serialize} from "../../src/utils/serialize.js"; -import {deserialize} from "../../src/utils/deserialize.js"; import {Groups, Property, ReadOnly, Required} from "@tsed/schema"; +import {deserialize} from "../../src/utils/deserialize.js"; +import {serialize} from "../../src/utils/serialize.js"; + class DataSourceModel { @Required() @Groups("!create") diff --git a/packages/specs/json-mapper/test/integration/writeonly.integration.spec.ts b/packages/specs/json-mapper/test/integration/writeonly.integration.spec.ts index 46ef333e1e8..f83a6faebd3 100644 --- a/packages/specs/json-mapper/test/integration/writeonly.integration.spec.ts +++ b/packages/specs/json-mapper/test/integration/writeonly.integration.spec.ts @@ -1,7 +1,8 @@ -import {serialize} from "../../src/utils/serialize.js"; -import {deserialize} from "../../src/utils/deserialize.js"; import {Groups, Property, Required, WriteOnly} from "@tsed/schema"; +import {deserialize} from "../../src/utils/deserialize.js"; +import {serialize} from "../../src/utils/serialize.js"; + class DataSourceModel { @Required() @Groups("!create") diff --git a/packages/specs/json-mapper/tsconfig.esm.json b/packages/specs/json-mapper/tsconfig.esm.json index e3b07081667..82292550ddb 100644 --- a/packages/specs/json-mapper/tsconfig.esm.json +++ b/packages/specs/json-mapper/tsconfig.esm.json @@ -2,8 +2,7 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "module": "ESNext", - "moduleResolution": "nodenext", + "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", @@ -11,7 +10,7 @@ "composite": true, "noEmit": false }, - "include": ["src", "src/**/*.json"], + "include": ["src/**/*.ts", "src/**/*.json"], "exclude": [ "node_modules", "test", diff --git a/packages/specs/json-mapper/tsconfig.spec.json b/packages/specs/json-mapper/tsconfig.spec.json index 46eb06bd008..08e82f1997c 100644 --- a/packages/specs/json-mapper/tsconfig.spec.json +++ b/packages/specs/json-mapper/tsconfig.spec.json @@ -3,7 +3,6 @@ "compilerOptions": { "baseUrl": ".", "rootDir": "../..", - "module": "commonjs", "outDir": "./lib/cjs", "declaration": false, "composite": false, diff --git a/packages/specs/openspec/package.json b/packages/specs/openspec/package.json index 4436b4300eb..123e786f997 100644 --- a/packages/specs/openspec/package.json +++ b/packages/specs/openspec/package.json @@ -33,6 +33,6 @@ "@tsed/barrels": "workspace:*", "@tsed/typescript": "workspace:*", "eslint": "^8.57.0", - "typescript": "4.9.5" + "typescript": "5.6.2" } } diff --git a/packages/specs/openspec/src/openspec2/OpenSpec2.ts b/packages/specs/openspec/src/openspec2/OpenSpec2.ts index 026153f2551..3cc9d900f00 100644 --- a/packages/specs/openspec/src/openspec2/OpenSpec2.ts +++ b/packages/specs/openspec/src/openspec2/OpenSpec2.ts @@ -1,4 +1,3 @@ -import {OS2Response} from "./OS2Response.js"; import {OpenSpecExternalDocs} from "../common/OpenSpecExternalDocs.js"; import {OpenSpecHash} from "../common/OpenSpecHash.js"; import {OpenSpecInfo} from "../common/OpenSpecInfo.js"; @@ -6,6 +5,7 @@ import {OpenSpecSecurity} from "../common/OpenSpecSecurity.js"; import {OpenSpecTag} from "../common/OpenSpecTag.js"; import {OS2BodyParameter, OS2QueryParameter} from "./OS2Parameter.js"; import {OS2Paths} from "./OS2Paths.js"; +import {OS2Response} from "./OS2Response.js"; import {OS2Schema} from "./OS2Schema.js"; import {OS2Security} from "./OS2Security.js"; diff --git a/packages/specs/openspec/src/openspec3/OS3MediaType.ts b/packages/specs/openspec/src/openspec3/OS3MediaType.ts index 37993a624e1..3b97c3408c7 100644 --- a/packages/specs/openspec/src/openspec3/OS3MediaType.ts +++ b/packages/specs/openspec/src/openspec3/OS3MediaType.ts @@ -1,8 +1,8 @@ -import {OS3Schema} from "./OS3Schema.js"; import {OpenSpecHash} from "../common/OpenSpecHash.js"; import {OpenSpecRef} from "../common/OpenSpecRef.js"; import {OS3Encoding} from "./OS3Encoding.js"; import {OS3Example} from "./OS3Example.js"; +import {OS3Schema} from "./OS3Schema.js"; export interface OS3MediaType { /** diff --git a/packages/specs/openspec/src/openspec3/OS3RequestBody.ts b/packages/specs/openspec/src/openspec3/OS3RequestBody.ts index 88562423025..38e3ebd60be 100644 --- a/packages/specs/openspec/src/openspec3/OS3RequestBody.ts +++ b/packages/specs/openspec/src/openspec3/OS3RequestBody.ts @@ -1,8 +1,8 @@ -import {OS3Schema} from "./OS3Schema.js"; import {OpenSpecHash} from "../common/OpenSpecHash.js"; -import {OS3MediaType} from "./OS3MediaType.js"; -import {OS3Example} from "./OS3Example.js"; import {OpenSpecRef} from "../common/OpenSpecRef.js"; +import {OS3Example} from "./OS3Example.js"; +import {OS3MediaType} from "./OS3MediaType.js"; +import {OS3Schema} from "./OS3Schema.js"; export interface OS3RequestBody { /** diff --git a/packages/specs/openspec/src/openspec3/OS3Response.ts b/packages/specs/openspec/src/openspec3/OS3Response.ts index ea2207405f1..7d963c9c894 100644 --- a/packages/specs/openspec/src/openspec3/OS3Response.ts +++ b/packages/specs/openspec/src/openspec3/OS3Response.ts @@ -1,9 +1,9 @@ -import {OS3Schema} from "./OS3Schema.js"; import {OpenSpecHash} from "../common/OpenSpecHash.js"; import {OpenSpecRef} from "../common/OpenSpecRef.js"; import {OS3Header} from "./OS3Header.js"; import {OS3Link} from "./OS3Link.js"; import {OS3MediaType} from "./OS3MediaType.js"; +import {OS3Schema} from "./OS3Schema.js"; export interface OS3Response> { /** diff --git a/packages/specs/openspec/src/openspec3/OpenSpec3.ts b/packages/specs/openspec/src/openspec3/OpenSpec3.ts index c53841dd52f..4fa3336e47c 100644 --- a/packages/specs/openspec/src/openspec3/OpenSpec3.ts +++ b/packages/specs/openspec/src/openspec3/OpenSpec3.ts @@ -1,4 +1,3 @@ -import {OS3Schema} from "./OS3Schema.js"; import {OpenSpecExternalDocs} from "../common/OpenSpecExternalDocs.js"; import {OpenSpecHash} from "../common/OpenSpecHash.js"; import {OpenSpecInfo} from "../common/OpenSpecInfo.js"; @@ -6,6 +5,7 @@ import {OpenSpecSecurity} from "../common/OpenSpecSecurity.js"; import {OpenSpecTag} from "../common/OpenSpecTag.js"; import {OS3Components} from "./OS3Components.js"; import {OS3Paths} from "./OS3Paths.js"; +import {OS3Schema} from "./OS3Schema.js"; import {OS3Server} from "./OS3Server.js"; export interface OpenSpec3 { diff --git a/packages/specs/openspec/tsconfig.esm.json b/packages/specs/openspec/tsconfig.esm.json index e3b07081667..82292550ddb 100644 --- a/packages/specs/openspec/tsconfig.esm.json +++ b/packages/specs/openspec/tsconfig.esm.json @@ -2,8 +2,7 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "module": "ESNext", - "moduleResolution": "nodenext", + "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", @@ -11,7 +10,7 @@ "composite": true, "noEmit": false }, - "include": ["src", "src/**/*.json"], + "include": ["src/**/*.ts", "src/**/*.json"], "exclude": [ "node_modules", "test", diff --git a/packages/specs/schema/package.json b/packages/specs/schema/package.json index 918544ce54b..428d26130d5 100644 --- a/packages/specs/schema/package.json +++ b/packages/specs/schema/package.json @@ -56,7 +56,7 @@ "@types/statuses": "2.0.5", "eslint": "^8.57.0", "picomatch-browser": "^2.2.6", - "typescript": "4.9.5", + "typescript": "5.6.2", "vitest": "2.0.4", "webpack": "^5.75.0" }, diff --git a/packages/specs/schema/src/components/async-api/channelsMapper.ts b/packages/specs/schema/src/components/async-api/channelsMapper.ts index 0f8a630c9f1..007ffec8cd3 100644 --- a/packages/specs/schema/src/components/async-api/channelsMapper.ts +++ b/packages/specs/schema/src/components/async-api/channelsMapper.ts @@ -1,4 +1,5 @@ import {camelCase} from "change-case"; + import {OperationVerbs} from "../../constants/OperationVerbs.js"; import {JsonMethodStore} from "../../domain/JsonMethodStore.js"; import {JsonMethodPath} from "../../domain/JsonOperation.js"; diff --git a/packages/specs/schema/src/components/async-api/generate.ts b/packages/specs/schema/src/components/async-api/generate.ts index 2e8892020ca..002cff06f1d 100644 --- a/packages/specs/schema/src/components/async-api/generate.ts +++ b/packages/specs/schema/src/components/async-api/generate.ts @@ -1,4 +1,5 @@ import {getValue, Type, uniqBy} from "@tsed/core"; + import {SpecTypes} from "../../domain/SpecTypes.js"; import {execMapper, registerJsonSchemaMapper} from "../../registries/JsonSchemaMapperContainer.js"; import {SpecSerializerOptions} from "../../utils/getSpec.js"; diff --git a/packages/specs/schema/src/components/async-api/messageMapper.ts b/packages/specs/schema/src/components/async-api/messageMapper.ts index eded276fc7d..2d9b742a124 100644 --- a/packages/specs/schema/src/components/async-api/messageMapper.ts +++ b/packages/specs/schema/src/components/async-api/messageMapper.ts @@ -1,4 +1,5 @@ import {cleanObject, getValue} from "@tsed/core"; + import {OperationVerbs} from "../../constants/OperationVerbs.js"; import {JsonMethodStore} from "../../domain/JsonMethodStore.js"; import {JsonMethodPath} from "../../domain/JsonOperation.js"; diff --git a/packages/specs/schema/src/components/async-api/payloadMapper.ts b/packages/specs/schema/src/components/async-api/payloadMapper.ts index bff6075cab9..61a6bba8d3c 100644 --- a/packages/specs/schema/src/components/async-api/payloadMapper.ts +++ b/packages/specs/schema/src/components/async-api/payloadMapper.ts @@ -1,5 +1,6 @@ import {setValue} from "@tsed/core"; import {pascalCase} from "change-case"; + import {JsonMethodStore} from "../../domain/JsonMethodStore.js"; import {JsonMethodPath, JsonOperation} from "../../domain/JsonOperation.js"; import {JsonParameter} from "../../domain/JsonParameter.js"; diff --git a/packages/specs/schema/src/components/async-api/responseMapper.ts b/packages/specs/schema/src/components/async-api/responseMapper.ts index f903f639d7f..d4073ec3369 100644 --- a/packages/specs/schema/src/components/async-api/responseMapper.ts +++ b/packages/specs/schema/src/components/async-api/responseMapper.ts @@ -1,5 +1,6 @@ import {setValue} from "@tsed/core"; import {pascalCase} from "change-case"; + import {JsonMethodStore} from "../../domain/JsonMethodStore.js"; import {JsonMethodPath} from "../../domain/JsonOperation.js"; import {SpecTypes} from "../../domain/SpecTypes.js"; diff --git a/packages/specs/schema/src/components/default/classMapper.ts b/packages/specs/schema/src/components/default/classMapper.ts index 4b2ff69ed80..e8c93892b6a 100644 --- a/packages/specs/schema/src/components/default/classMapper.ts +++ b/packages/specs/schema/src/components/default/classMapper.ts @@ -1,4 +1,5 @@ import {getValue, setValue} from "@tsed/core"; + import {JsonEntityStore} from "../../domain/JsonEntityStore.js"; import {JsonSchema} from "../../domain/JsonSchema.js"; import {JsonSchemaOptions} from "../../interfaces/JsonSchemaOptions.js"; diff --git a/packages/specs/schema/src/components/default/genericsMapper.ts b/packages/specs/schema/src/components/default/genericsMapper.ts index 8a66877b401..14c38511b90 100644 --- a/packages/specs/schema/src/components/default/genericsMapper.ts +++ b/packages/specs/schema/src/components/default/genericsMapper.ts @@ -1,4 +1,5 @@ import {isClass, isPrimitiveClass} from "@tsed/core"; + import {JsonEntityStore} from "../../domain/JsonEntityStore.js"; import {execMapper, registerJsonSchemaMapper} from "../../registries/JsonSchemaMapperContainer.js"; import {GenericsContext, popGenerics} from "../../utils/generics.js"; diff --git a/packages/specs/schema/src/components/default/inheritedClassMapper.ts b/packages/specs/schema/src/components/default/inheritedClassMapper.ts index f0796709995..2d82b72ed63 100644 --- a/packages/specs/schema/src/components/default/inheritedClassMapper.ts +++ b/packages/specs/schema/src/components/default/inheritedClassMapper.ts @@ -1,4 +1,5 @@ import {classOf, deepMerge} from "@tsed/core"; + import {JsonSchemaOptions} from "../../interfaces/JsonSchemaOptions.js"; import {execMapper, registerJsonSchemaMapper} from "../../registries/JsonSchemaMapperContainer.js"; import {getInheritedStores} from "../../utils/getInheritedStores.js"; diff --git a/packages/specs/schema/src/components/default/inlineEnumsMapper.spec.ts b/packages/specs/schema/src/components/default/inlineEnumsMapper.spec.ts index 3ae114a75d9..014bedec1ac 100644 --- a/packages/specs/schema/src/components/default/inlineEnumsMapper.spec.ts +++ b/packages/specs/schema/src/components/default/inlineEnumsMapper.spec.ts @@ -1,4 +1,4 @@ -import {inlineEnumsMapper} from "./inlineEnumsMapper"; +import {inlineEnumsMapper} from "./inlineEnumsMapper.js"; describe("inlineEnumsMapper()", () => { it("should inline enums", () => { diff --git a/packages/specs/schema/src/components/default/mapMapper.ts b/packages/specs/schema/src/components/default/mapMapper.ts index 684cc3f1781..72ef2b0656d 100644 --- a/packages/specs/schema/src/components/default/mapMapper.ts +++ b/packages/specs/schema/src/components/default/mapMapper.ts @@ -1,6 +1,6 @@ -import {mapGenericsOptions} from "../../utils/generics.js"; import {JsonSchemaOptions} from "../../interfaces/JsonSchemaOptions.js"; import {execMapper, registerJsonSchemaMapper} from "../../registries/JsonSchemaMapperContainer.js"; +import {mapGenericsOptions} from "../../utils/generics.js"; /** * Serialize class which inherit from Map like JsonMap, JsonOperation, JsonParameter. diff --git a/packages/specs/schema/src/components/default/nullableMapper.ts b/packages/specs/schema/src/components/default/nullableMapper.ts index 0189ad227c4..ab0596819b4 100644 --- a/packages/specs/schema/src/components/default/nullableMapper.ts +++ b/packages/specs/schema/src/components/default/nullableMapper.ts @@ -1,4 +1,5 @@ import {cleanObject} from "@tsed/core"; + import {MANY_OF_PROPERTIES} from "../../constants/jsonSchemaProperties.js"; import type {JsonSchema} from "../../domain/JsonSchema.js"; import {registerJsonSchemaMapper} from "../../registries/JsonSchemaMapperContainer.js"; diff --git a/packages/specs/schema/src/components/default/objectMapper.ts b/packages/specs/schema/src/components/default/objectMapper.ts index 8651b33b3f9..e4c8e4c5cc7 100644 --- a/packages/specs/schema/src/components/default/objectMapper.ts +++ b/packages/specs/schema/src/components/default/objectMapper.ts @@ -1,4 +1,5 @@ import {isArray} from "@tsed/core"; + import {JsonSchema} from "../../domain/JsonSchema.js"; import {alterIgnore} from "../../hooks/alterIgnore.js"; import {JsonSchemaOptions} from "../../interfaces/JsonSchemaOptions.js"; diff --git a/packages/specs/schema/src/components/default/ofMapper.ts b/packages/specs/schema/src/components/default/ofMapper.ts index 161b422da94..629a30c4e31 100644 --- a/packages/specs/schema/src/components/default/ofMapper.ts +++ b/packages/specs/schema/src/components/default/ofMapper.ts @@ -1,6 +1,6 @@ -import {execMapper, registerJsonSchemaMapper} from "../../registries/JsonSchemaMapperContainer.js"; import type {JsonSchema} from "../../domain/JsonSchema.js"; import type {JsonSchemaOptions} from "../../interfaces/JsonSchemaOptions.js"; +import {execMapper, registerJsonSchemaMapper} from "../../registries/JsonSchemaMapperContainer.js"; export function ofMapper(input: (any | JsonSchema)[], options: JsonSchemaOptions, parent: JsonSchema) { return input.map((value: any | JsonSchema) => { diff --git a/packages/specs/schema/src/components/default/propertiesMapper.ts b/packages/specs/schema/src/components/default/propertiesMapper.ts index d55391dc374..6c3512f29cd 100644 --- a/packages/specs/schema/src/components/default/propertiesMapper.ts +++ b/packages/specs/schema/src/components/default/propertiesMapper.ts @@ -1,6 +1,6 @@ -import {execMapper, registerJsonSchemaMapper} from "../../registries/JsonSchemaMapperContainer.js"; import type {JsonSchema} from "../../domain/JsonSchema.js"; import type {JsonSchemaOptions} from "../../interfaces/JsonSchemaOptions.js"; +import {execMapper, registerJsonSchemaMapper} from "../../registries/JsonSchemaMapperContainer.js"; export function propertiesMapper(input: any | JsonSchema, options: JsonSchemaOptions, parent: JsonSchema) { if (input.isClass) { diff --git a/packages/specs/schema/src/components/default/requiredMapper.ts b/packages/specs/schema/src/components/default/requiredMapper.ts index 26d6b892f8e..cd70f16bd21 100644 --- a/packages/specs/schema/src/components/default/requiredMapper.ts +++ b/packages/specs/schema/src/components/default/requiredMapper.ts @@ -1,4 +1,5 @@ import {uniq} from "@tsed/core"; + import type {JsonSchema} from "../../domain/JsonSchema.js"; import {alterRequiredGroups} from "../../hooks/alterRequiredGroups.js"; import type {JsonSchemaOptions} from "../../interfaces/JsonSchemaOptions.js"; diff --git a/packages/specs/schema/src/components/default/schemaMapper.ts b/packages/specs/schema/src/components/default/schemaMapper.ts index c4b9116e6e1..3a6939c917b 100644 --- a/packages/specs/schema/src/components/default/schemaMapper.ts +++ b/packages/specs/schema/src/components/default/schemaMapper.ts @@ -1,4 +1,5 @@ import {getValue, isObject} from "@tsed/core"; + import {mapAliasedProperties} from "../../domain/JsonAliasMap.js"; import {JsonSchema} from "../../domain/JsonSchema.js"; import {SpecTypes} from "../../domain/SpecTypes.js"; diff --git a/packages/specs/schema/src/components/open-spec/generate.ts b/packages/specs/schema/src/components/open-spec/generate.ts index 3edfba378d3..1626bae7803 100644 --- a/packages/specs/schema/src/components/open-spec/generate.ts +++ b/packages/specs/schema/src/components/open-spec/generate.ts @@ -1,4 +1,5 @@ import {getValue, Type, uniqBy} from "@tsed/core"; + import {SpecTypes} from "../../domain/SpecTypes.js"; import {execMapper, registerJsonSchemaMapper} from "../../registries/JsonSchemaMapperContainer.js"; import {SpecSerializerOptions} from "../../utils/getSpec.js"; diff --git a/packages/specs/schema/src/components/open-spec/nullableMapper.ts b/packages/specs/schema/src/components/open-spec/nullableMapper.ts index f0e7cd24e30..e224da25308 100644 --- a/packages/specs/schema/src/components/open-spec/nullableMapper.ts +++ b/packages/specs/schema/src/components/open-spec/nullableMapper.ts @@ -1,4 +1,5 @@ import {cleanObject} from "@tsed/core"; + import type {JsonSchema} from "../../domain/JsonSchema.js"; import {SpecTypes} from "../../domain/SpecTypes.js"; import {registerJsonSchemaMapper} from "../../registries/JsonSchemaMapperContainer.js"; diff --git a/packages/specs/schema/src/components/open-spec/operationInFilesMapper.ts b/packages/specs/schema/src/components/open-spec/operationInFilesMapper.ts index ae5aa70197a..520ab86bdd3 100644 --- a/packages/specs/schema/src/components/open-spec/operationInFilesMapper.ts +++ b/packages/specs/schema/src/components/open-spec/operationInFilesMapper.ts @@ -1,4 +1,5 @@ import {cleanObject} from "@tsed/core"; + import {registerJsonSchemaMapper} from "../../registries/JsonSchemaMapperContainer.js"; import type {JsonParameterOptions} from "./operationInParameterMapper.js"; diff --git a/packages/specs/schema/src/components/open-spec/operationInParameterMapper.ts b/packages/specs/schema/src/components/open-spec/operationInParameterMapper.ts index 03935705b0e..e0e79915f38 100644 --- a/packages/specs/schema/src/components/open-spec/operationInParameterMapper.ts +++ b/packages/specs/schema/src/components/open-spec/operationInParameterMapper.ts @@ -1,6 +1,7 @@ import {OS3Schema} from "@tsed/openspec"; import {camelCase} from "change-case"; import type {JSONSchema6} from "json-schema"; + import {JsonParameter} from "../../domain/JsonParameter.js"; import {JsonParameterTypes} from "../../domain/JsonParameterTypes.js"; import {JsonSchemaOptions} from "../../interfaces/JsonSchemaOptions.js"; diff --git a/packages/specs/schema/src/components/open-spec/operationInQueryMapper.ts b/packages/specs/schema/src/components/open-spec/operationInQueryMapper.ts index 3b8293fcee8..d5e41d81858 100644 --- a/packages/specs/schema/src/components/open-spec/operationInQueryMapper.ts +++ b/packages/specs/schema/src/components/open-spec/operationInQueryMapper.ts @@ -1,5 +1,6 @@ import {cleanObject} from "@tsed/core"; import {OS3Example} from "@tsed/openspec"; + import {JsonSchemaOptions} from "../../interfaces/JsonSchemaOptions.js"; import {registerJsonSchemaMapper} from "../../registries/JsonSchemaMapperContainer.js"; import {createRefName} from "../../utils/ref.js"; diff --git a/packages/specs/schema/src/components/open-spec/pathsMapper.ts b/packages/specs/schema/src/components/open-spec/pathsMapper.ts index 083988a3eaf..5e3e51cea67 100644 --- a/packages/specs/schema/src/components/open-spec/pathsMapper.ts +++ b/packages/specs/schema/src/components/open-spec/pathsMapper.ts @@ -1,4 +1,5 @@ import {OS3Operation, OS3Paths} from "@tsed/openspec"; + import {OperationVerbs} from "../../constants/OperationVerbs.js"; import {JsonMethodStore} from "../../domain/JsonMethodStore.js"; import {JsonMethodPath} from "../../domain/JsonOperation.js"; diff --git a/packages/specs/schema/src/constants/httpStatusMessages.ts b/packages/specs/schema/src/constants/httpStatusMessages.ts index d62ce695b48..86283aa275a 100644 --- a/packages/specs/schema/src/constants/httpStatusMessages.ts +++ b/packages/specs/schema/src/constants/httpStatusMessages.ts @@ -1,5 +1,5 @@ -import statuses from "statuses"; import {constantCase} from "change-case"; +import statuses from "statuses"; export const HTTP_STATUS_MESSAGES = statuses.codes.reduce((map: Record, code: number) => { const message: string = String(statuses(code)); diff --git a/packages/specs/schema/src/decorators/class/children.ts b/packages/specs/schema/src/decorators/class/children.ts index e222e8d1540..227db78d644 100644 --- a/packages/specs/schema/src/decorators/class/children.ts +++ b/packages/specs/schema/src/decorators/class/children.ts @@ -1,4 +1,5 @@ import {Store, Type} from "@tsed/core"; + import {JsonEntityFn} from "../common/jsonEntityFn.js"; /** diff --git a/packages/specs/schema/src/decorators/class/discriminatorValue.ts b/packages/specs/schema/src/decorators/class/discriminatorValue.ts index 284fd4d5e76..318ecdd5812 100644 --- a/packages/specs/schema/src/decorators/class/discriminatorValue.ts +++ b/packages/specs/schema/src/decorators/class/discriminatorValue.ts @@ -1,4 +1,5 @@ import {snakeCase} from "change-case"; + import {JsonEntityFn} from "../common/jsonEntityFn.js"; /** diff --git a/packages/specs/schema/src/decorators/collections/collectionOf.spec.ts b/packages/specs/schema/src/decorators/collections/collectionOf.spec.ts index e852a861add..e178495fb0c 100644 --- a/packages/specs/schema/src/decorators/collections/collectionOf.spec.ts +++ b/packages/specs/schema/src/decorators/collections/collectionOf.spec.ts @@ -1,18 +1,19 @@ import {catchError} from "@tsed/core"; + import {JsonEntityStore} from "../../domain/JsonEntityStore.js"; +import {array, map, string} from "../../utils/from.js"; import {getJsonSchema} from "../../utils/getJsonSchema.js"; import {Property} from "../common/property.js"; +import {Schema} from "../common/schema.js"; import {In} from "../operations/in.js"; import {OperationPath} from "../operations/operationPath.js"; import {CollectionContains} from "./collectionContains.js"; import {ArrayOf, CollectionOf, MapOf} from "./collectionOf.js"; import {MaxItems} from "./maxItems.js"; import {MinItems} from "./minItems.js"; -import {Schema} from "../common/schema.js"; -import {map, array, string} from "../../utils/from.js"; describe("@CollectionOf", () => { - it("should declare a collection (Array of)", () => { + it("should declare a collection and catch error (Array of)", () => { // WHEN const error = catchError(() => { class Model { @@ -170,7 +171,7 @@ describe("@CollectionOf", () => { it("should declare a collection (Map of)", () => { // WHEN class Model { - @CollectionOf(Number).MinProperties(2).MaxProperties(5) + @(CollectionOf(Number).MinProperties(2).MaxProperties(5)) num: Map; } @@ -217,7 +218,7 @@ describe("@CollectionOf", () => { it("should declare collection with additional props", () => { // WHEN class Model { - @CollectionOf(String).MinItems(0).MaxItems(10).UniqueItems() + @(CollectionOf(String).MinItems(0).MaxItems(10).UniqueItems()) words: string[]; } @@ -242,7 +243,7 @@ describe("@CollectionOf", () => { it("should declare collection with additional props and contains", () => { // WHEN class Model { - @CollectionContains(String).MinItems(0).MaxItems(10) + @(CollectionContains(String).MinItems(0).MaxItems(10)) words: string[]; } @@ -302,7 +303,7 @@ describe("@MapOf", () => { it("should declare a collection (Map of)", () => { // WHEN class Model { - @MapOf(Number).MinProperties(2).MaxProperties(5) + @(MapOf(Number).MinProperties(2).MaxProperties(5)) num: MapCollection; } diff --git a/packages/specs/schema/src/decorators/common/allow.spec.ts b/packages/specs/schema/src/decorators/common/allow.spec.ts index ab6442f9e7e..36557e22969 100644 --- a/packages/specs/schema/src/decorators/common/allow.spec.ts +++ b/packages/specs/schema/src/decorators/common/allow.spec.ts @@ -1,4 +1,5 @@ import Ajv from "ajv"; + import {getJsonSchema} from "../../index.js"; import {Allow} from "./allow.js"; import {Property} from "./property.js"; @@ -26,6 +27,7 @@ describe("@Allow", () => { type: "object" }); + // @ts-ignore const validate = new Ajv().compile(classSchema); expect(validate({allow: ""})).toBe(false); expect(validate({allow: 0})).toBe(false); @@ -51,6 +53,7 @@ describe("@Allow", () => { type: "object" }); + // @ts-ignore const validate = new Ajv().compile(classSchema); expect(validate({allow: ""})).toBe(true); expect(validate({})).toBe(false); @@ -76,6 +79,7 @@ describe("@Allow", () => { type: "object" }); + // @ts-ignore const validate = new Ajv().compile(classSchema); expect(validate({allow: null})).toBe(true); expect(validate({})).toBe(false); @@ -122,6 +126,7 @@ describe("@Allow", () => { type: "object" }); + // @ts-ignore const validate = new Ajv().compile(spec); expect(validate({allow: null})).toBe(true); expect(validate({})).toBe(false); diff --git a/packages/specs/schema/src/decorators/common/allow.ts b/packages/specs/schema/src/decorators/common/allow.ts index 8d4ef95319e..75628ea6c42 100644 --- a/packages/specs/schema/src/decorators/common/allow.ts +++ b/packages/specs/schema/src/decorators/common/allow.ts @@ -1,7 +1,8 @@ import {DecoratorTypes, isClass, useDecorators} from "@tsed/core"; + +import type {JsonParameterStore} from "../../domain/JsonParameterStore.js"; import {JsonEntityFn} from "./jsonEntityFn.js"; import {Property} from "./property.js"; -import type {JsonParameterStore} from "../../domain/JsonParameterStore.js"; /** * Add allowed values when the property or parameters is required. diff --git a/packages/specs/schema/src/decorators/common/any.ts b/packages/specs/schema/src/decorators/common/any.ts index 6360fd2aeaf..41521de87d7 100644 --- a/packages/specs/schema/src/decorators/common/any.ts +++ b/packages/specs/schema/src/decorators/common/any.ts @@ -1,5 +1,6 @@ import {Type} from "@tsed/core"; import type {JSONSchema6TypeName} from "json-schema"; + import {JsonEntityFn} from "./jsonEntityFn.js"; /** diff --git a/packages/specs/schema/src/decorators/common/anyOf.spec.ts b/packages/specs/schema/src/decorators/common/anyOf.spec.ts index 32efc6c9ea5..dd5a8a8c05f 100644 --- a/packages/specs/schema/src/decorators/common/anyOf.spec.ts +++ b/packages/specs/schema/src/decorators/common/anyOf.spec.ts @@ -1,5 +1,5 @@ -import {AllOf, getJsonSchema, getSpec, In, OneOf, OperationPath, Path, Property, SpecTypes} from "../../index.js"; import {JsonEntityStore} from "../../domain/JsonEntityStore.js"; +import {AllOf, getJsonSchema, getSpec, In, OneOf, OperationPath, Path, Property, SpecTypes} from "../../index.js"; import {number, string} from "../../utils/from.js"; import {AnyOf} from "./anyOf.js"; diff --git a/packages/specs/schema/src/decorators/common/const.ts b/packages/specs/schema/src/decorators/common/const.ts index 5a6d8348b3a..a94ca6e933f 100644 --- a/packages/specs/schema/src/decorators/common/const.ts +++ b/packages/specs/schema/src/decorators/common/const.ts @@ -1,4 +1,5 @@ import type {JSONSchema6Type} from "json-schema"; + import {JsonEntityFn} from "./jsonEntityFn.js"; /** diff --git a/packages/specs/schema/src/decorators/common/defaultMsg.ts b/packages/specs/schema/src/decorators/common/defaultMsg.ts index 1bf3549fb3d..befb6f6abfc 100644 --- a/packages/specs/schema/src/decorators/common/defaultMsg.ts +++ b/packages/specs/schema/src/decorators/common/defaultMsg.ts @@ -1,4 +1,5 @@ import {useDecorators} from "@tsed/core"; + import {ErrorMsg} from "./errorMsg.js"; /** diff --git a/packages/specs/schema/src/decorators/common/description.ts b/packages/specs/schema/src/decorators/common/description.ts index 2120cedbce7..4c95f9de061 100644 --- a/packages/specs/schema/src/decorators/common/description.ts +++ b/packages/specs/schema/src/decorators/common/description.ts @@ -1,8 +1,9 @@ import {DecoratorParameters, decoratorTypeOf, DecoratorTypes} from "@tsed/core"; + import {JsonEntityStore} from "../../domain/JsonEntityStore.js"; -import {JsonEntityFn} from "./jsonEntityFn.js"; import type {JsonMethodStore} from "../../domain/JsonMethodStore.js"; import type {JsonParameterStore} from "../../domain/JsonParameterStore.js"; +import {JsonEntityFn} from "./jsonEntityFn.js"; /** * Add a description to the class, method or property diff --git a/packages/specs/schema/src/decorators/common/discriminatorKey.ts b/packages/specs/schema/src/decorators/common/discriminatorKey.ts index 7ad00bfde33..b5274cc7d3b 100644 --- a/packages/specs/schema/src/decorators/common/discriminatorKey.ts +++ b/packages/specs/schema/src/decorators/common/discriminatorKey.ts @@ -1,4 +1,5 @@ import {useDecorators} from "@tsed/core"; + import {JsonPropertyStore} from "../../domain/JsonPropertyStore.js"; import {JsonEntityFn} from "./jsonEntityFn.js"; import {Property} from "./property.js"; diff --git a/packages/specs/schema/src/decorators/common/enum.ts b/packages/specs/schema/src/decorators/common/enum.ts index d13a2b9537b..2e728201935 100644 --- a/packages/specs/schema/src/decorators/common/enum.ts +++ b/packages/specs/schema/src/decorators/common/enum.ts @@ -1,4 +1,5 @@ import type {JSONSchema6Type} from "json-schema"; + import {withErrorMsg} from "../../utils/withErrorMsg.js"; import {JsonEntityFn} from "./jsonEntityFn.js"; diff --git a/packages/specs/schema/src/decorators/common/example.spec.ts b/packages/specs/schema/src/decorators/common/example.spec.ts index 1a92f0f377d..4125431fd80 100644 --- a/packages/specs/schema/src/decorators/common/example.spec.ts +++ b/packages/specs/schema/src/decorators/common/example.spec.ts @@ -1,4 +1,5 @@ import {descriptorOf, useDecorators} from "@tsed/core"; + import {Description, getSpec, In, Name, OperationPath, Path, Pattern, SpecTypes} from "../../index.js"; import {getJsonSchema} from "../../utils/getJsonSchema.js"; import {Example} from "./example.js"; diff --git a/packages/specs/schema/src/decorators/common/examples.ts b/packages/specs/schema/src/decorators/common/examples.ts index a7d3e181625..3752e6e45da 100644 --- a/packages/specs/schema/src/decorators/common/examples.ts +++ b/packages/specs/schema/src/decorators/common/examples.ts @@ -1,4 +1,5 @@ import {OpenSpecHash, OpenSpecRef, OS3Example} from "@tsed/openspec"; + import {JsonParameterStore} from "../../domain/JsonParameterStore.js"; import {JsonEntityFn} from "./jsonEntityFn.js"; diff --git a/packages/specs/schema/src/decorators/common/exclusiveMaximum.spec.ts b/packages/specs/schema/src/decorators/common/exclusiveMaximum.spec.ts index d375572eca0..69a303b69d6 100644 --- a/packages/specs/schema/src/decorators/common/exclusiveMaximum.spec.ts +++ b/packages/specs/schema/src/decorators/common/exclusiveMaximum.spec.ts @@ -1,6 +1,7 @@ +import "../../index.js"; + import {JsonEntityStore} from "../../domain/JsonEntityStore.js"; import {ExclusiveMaximum} from "./exclusiveMaximum.js"; -import "../../index.js"; describe("@ExclusiveMaximum", () => { it("should declare exclusiveMaximum value", () => { diff --git a/packages/specs/schema/src/decorators/common/exclusiveMinimum.spec.ts b/packages/specs/schema/src/decorators/common/exclusiveMinimum.spec.ts index dd18793bb7b..02187085d95 100644 --- a/packages/specs/schema/src/decorators/common/exclusiveMinimum.spec.ts +++ b/packages/specs/schema/src/decorators/common/exclusiveMinimum.spec.ts @@ -1,6 +1,7 @@ +import "../../index.js"; + import {JsonEntityStore} from "../../domain/JsonEntityStore.js"; import {ExclusiveMinimum} from "./exclusiveMinimum.js"; -import "../../index.js"; describe("@ExclusiveMinimum", () => { it("should declare exclusiveMinimum value", () => { diff --git a/packages/specs/schema/src/decorators/common/format.ts b/packages/specs/schema/src/decorators/common/format.ts index 3e269b054e9..a55dba31a49 100644 --- a/packages/specs/schema/src/decorators/common/format.ts +++ b/packages/specs/schema/src/decorators/common/format.ts @@ -1,4 +1,5 @@ import {ValueOf} from "@tsed/core"; + import {JsonFormatTypes} from "../../domain/JsonFormatTypes.js"; import {withErrorMsg} from "../../utils/withErrorMsg.js"; import {JsonEntityFn} from "./jsonEntityFn.js"; diff --git a/packages/specs/schema/src/decorators/common/forwardGroups.spec.ts b/packages/specs/schema/src/decorators/common/forwardGroups.spec.ts index 25df1aa1aca..48f77ed9f55 100644 --- a/packages/specs/schema/src/decorators/common/forwardGroups.spec.ts +++ b/packages/specs/schema/src/decorators/common/forwardGroups.spec.ts @@ -73,7 +73,7 @@ describe("@ForwardGroups", () => { @Path("/") class MyController { @OperationPath("POST", "/") - @Returns(201, MyModel).Groups("group.*") + @(Returns(201, MyModel).Groups("group.*")) create(@In("body") @Groups("creation") payload: MyModel) { return Promise.resolve(new MyModel()); } diff --git a/packages/specs/schema/src/decorators/common/groups.spec.ts b/packages/specs/schema/src/decorators/common/groups.spec.ts index 503dba7dcd7..85152b81981 100644 --- a/packages/specs/schema/src/decorators/common/groups.spec.ts +++ b/packages/specs/schema/src/decorators/common/groups.spec.ts @@ -1,4 +1,3 @@ -import {QueryParams} from "@tsed/platform-params/src/index"; import {SpecTypes} from "../../domain/SpecTypes.js"; import {getJsonSchema} from "../../utils/getJsonSchema.js"; import {getSpec} from "../../utils/getSpec.js"; @@ -468,7 +467,7 @@ describe("@Groups", () => { @Path("/") class MyController { @OperationPath("POST", "/") - @Returns(201, MyModel).Groups("group.*") + @(Returns(201, MyModel).Groups("group.*")) create(@In("body") @Groups("creation") payload: MyModel) { return new MyModel(); } @@ -642,7 +641,7 @@ describe("@Groups", () => { @Path("/") class MyController { @OperationPath("POST", "/") - @Returns(201, MyModel).Groups("group.*") + @(Returns(201, MyModel).Groups("group.*")) create(@In("body") @Groups("CreatePayload", ["creation"]) payload: MyModel) { return new MyModel(); } @@ -662,13 +661,13 @@ describe("@Groups", () => { @Path("/") class MyController { @OperationPath("GET", "/") - @Returns(201, MyModel).Groups("group.*") + @(Returns(201, MyModel).Groups("group.*")) get(@In("query") @Groups("creation") payload: MyModel) { return new MyModel(); } @OperationPath("GET", "/all") - @Returns(201, MyModel).Groups("group.*") + @(Returns(201, MyModel).Groups("group.*")) getWithout(@In("query") payload: MyModel) { return new MyModel(); } @@ -838,7 +837,7 @@ describe("@Groups", () => { @Path("/") class MyController { @OperationPath("POST", "/") - @Returns(201, Array).Of(MyModel).Groups("group.*") + @(Returns(201, Array).Of(MyModel).Groups("group.*")) createWithArray(@In("body") @Groups("creation") @CollectionOf(MyModel) payload: MyModel[]) { return [new MyModel()]; } @@ -955,7 +954,7 @@ describe("@Groups", () => { @Path("/") class MyController { @OperationPath("POST", "/") - @Returns(201, Array).Of(MyModel).Groups("Details", ["group.*"]) + @(Returns(201, Array).Of(MyModel).Groups("Details", ["group.*"])) createWithArray(@In("body") @Groups("Create", ["creation"]) @CollectionOf(MyModel) payload: MyModel[]) { return [new MyModel()]; } diff --git a/packages/specs/schema/src/decorators/common/groups.ts b/packages/specs/schema/src/decorators/common/groups.ts index e72326fa86d..bc1eaacceed 100644 --- a/packages/specs/schema/src/decorators/common/groups.ts +++ b/packages/specs/schema/src/decorators/common/groups.ts @@ -1,4 +1,5 @@ import {DecoratorTypes, isArray} from "@tsed/core"; + import type {JsonClassStore} from "../../domain/JsonClassStore.js"; import type {JsonParameterStore} from "../../domain/JsonParameterStore.js"; import {matchGroups} from "../../utils/matchGroups.js"; diff --git a/packages/specs/schema/src/decorators/common/hidden.spec.ts b/packages/specs/schema/src/decorators/common/hidden.spec.ts index b145f30703c..4495e7b62f5 100644 --- a/packages/specs/schema/src/decorators/common/hidden.spec.ts +++ b/packages/specs/schema/src/decorators/common/hidden.spec.ts @@ -1,6 +1,6 @@ +import {Get, getSpec, Path, SpecTypes} from "../../index.js"; import {getJsonSchema} from "../../utils/getJsonSchema.js"; import {Hidden} from "./hidden.js"; -import {Get, getSpec, Path, SpecTypes} from "../../index.js"; describe("@Hidden", () => { it("should generate the right json schema", () => { @@ -15,7 +15,7 @@ describe("@Hidden", () => { }); }); - it("should generate the right json schema", () => { + it("should generate the right spec schema", () => { // WHEN @Path("/") class Model { diff --git a/packages/specs/schema/src/decorators/common/integer.spec.ts b/packages/specs/schema/src/decorators/common/integer.spec.ts index fe194848ebf..f3b72fd6531 100644 --- a/packages/specs/schema/src/decorators/common/integer.spec.ts +++ b/packages/specs/schema/src/decorators/common/integer.spec.ts @@ -1,4 +1,5 @@ import {BodyParams} from "@tsed/platform-params"; + import {validateSpec} from "../../../test/helpers/validateSpec.js"; import {SpecTypes} from "../../domain/SpecTypes.js"; import {getJsonSchema} from "../../utils/getJsonSchema.js"; @@ -52,7 +53,7 @@ describe("@Integer", () => { @Path("/") class TestIntegerCtrl { @OperationPath("GET", "/") - @Returns(200, Array).OfInteger() + @(Returns(200, Array).OfInteger()) async get(@BodyParams() @Integer() number: number[]) {} } diff --git a/packages/specs/schema/src/decorators/common/integer.ts b/packages/specs/schema/src/decorators/common/integer.ts index 32939aa86d7..4f2b683c766 100644 --- a/packages/specs/schema/src/decorators/common/integer.ts +++ b/packages/specs/schema/src/decorators/common/integer.ts @@ -1,4 +1,5 @@ import type {JSONSchema6} from "json-schema"; + import {JsonEntityFn} from "./jsonEntityFn.js"; /** diff --git a/packages/specs/schema/src/decorators/common/jsonEntityFn.ts b/packages/specs/schema/src/decorators/common/jsonEntityFn.ts index f81c38bacd8..8a7a709e2a1 100644 --- a/packages/specs/schema/src/decorators/common/jsonEntityFn.ts +++ b/packages/specs/schema/src/decorators/common/jsonEntityFn.ts @@ -1,4 +1,5 @@ import {DecoratorParameters} from "@tsed/core"; + import type {JsonEntityStore} from "../../domain/JsonEntityStore.js"; import {getJsonEntityStore} from "../../utils/getJsonEntityStore.js"; diff --git a/packages/specs/schema/src/decorators/common/maximum.spec.ts b/packages/specs/schema/src/decorators/common/maximum.spec.ts index d276be32dce..fff84acd4ee 100644 --- a/packages/specs/schema/src/decorators/common/maximum.spec.ts +++ b/packages/specs/schema/src/decorators/common/maximum.spec.ts @@ -1,6 +1,7 @@ +import "../../index.js"; + import {JsonEntityStore} from "../../domain/JsonEntityStore.js"; import {CollectionOf} from "../collections/collectionOf.js"; -import "../../index.js"; import {Max} from "./maximum.js"; describe("@Maximum", () => { diff --git a/packages/specs/schema/src/decorators/common/minLength.spec.ts b/packages/specs/schema/src/decorators/common/minLength.spec.ts index 3fb6336fb4d..6b5ad4882e3 100644 --- a/packages/specs/schema/src/decorators/common/minLength.spec.ts +++ b/packages/specs/schema/src/decorators/common/minLength.spec.ts @@ -1,4 +1,5 @@ import "../../index.js"; + import {validateModel} from "../../../test/helpers/validateModel.js"; import {JsonEntityStore} from "../../domain/JsonEntityStore.js"; import {getJsonSchema} from "../../utils/getJsonSchema.js"; @@ -66,7 +67,7 @@ describe("@MinLength", () => { // WHEN class Model { @MinLength(0) - @CollectionOf(String).MinItems(0).MaxItems(10) + @(CollectionOf(String).MinItems(0).MaxItems(10)) words: string[]; } @@ -91,8 +92,8 @@ describe("@MinLength", () => { it("should declare minLength field with custom error message", () => { // WHEN class Model { - @MinLength(2).Error("Require at least 2 characters") - @CollectionOf(String).MinItems(0).MaxItems(10) + @(MinLength(2).Error("Require at least 2 characters")) + @(CollectionOf(String).MinItems(0).MaxItems(10)) words: string[]; } @@ -151,7 +152,7 @@ describe("@MinLength", () => { it("should throw error with custom error message", () => { // WHEN class Model { - @MinLength(10).Error("Title must be at least 10 characters long") + @(MinLength(10).Error("Title must be at least 10 characters long")) word: string; } diff --git a/packages/specs/schema/src/decorators/common/minimum.spec.ts b/packages/specs/schema/src/decorators/common/minimum.spec.ts index 767eee429f8..bc655fa5a87 100644 --- a/packages/specs/schema/src/decorators/common/minimum.spec.ts +++ b/packages/specs/schema/src/decorators/common/minimum.spec.ts @@ -1,7 +1,8 @@ +import "../../index.js"; + import {JsonEntityStore} from "../../domain/JsonEntityStore.js"; import {CollectionOf} from "../collections/collectionOf.js"; import {Min} from "./minimum.js"; -import "../../index.js"; describe("@Minimum", () => { it("should declare minimum value", () => { diff --git a/packages/specs/schema/src/decorators/common/name.ts b/packages/specs/schema/src/decorators/common/name.ts index 0a9d35b9802..b33f8f910ae 100644 --- a/packages/specs/schema/src/decorators/common/name.ts +++ b/packages/specs/schema/src/decorators/common/name.ts @@ -1,4 +1,5 @@ import {DecoratorParameters, decoratorTypeOf, DecoratorTypes} from "@tsed/core"; + import {JsonEntityStore} from "../../domain/JsonEntityStore.js"; import {JsonEntityFn} from "../common/jsonEntityFn.js"; diff --git a/packages/specs/schema/src/decorators/common/nullable.spec.ts b/packages/specs/schema/src/decorators/common/nullable.spec.ts index 1729c31e6ac..ad5b7ddc1f9 100644 --- a/packages/specs/schema/src/decorators/common/nullable.spec.ts +++ b/packages/specs/schema/src/decorators/common/nullable.spec.ts @@ -1,5 +1,6 @@ import {BodyParams} from "@tsed/platform-params"; import Ajv from "ajv"; + import {SpecTypes} from "../../domain/SpecTypes.js"; import {getJsonSchema} from "../../utils/getJsonSchema.js"; import {getSpec} from "../../utils/getSpec.js"; @@ -7,7 +8,7 @@ import {In} from "../operations/in.js"; import {Path} from "../operations/path.js"; import {Post} from "../operations/route.js"; import {Format} from "./format.js"; -import {Integer} from "./integer"; +import {Integer} from "./integer.js"; import {MaxLength} from "./maxLength.js"; import {Minimum} from "./minimum.js"; import {Nullable} from "./nullable.js"; @@ -37,6 +38,7 @@ describe("@Nullable", () => { type: "object" }); + // @ts-ignore const ajv = new Ajv({strict: true}); expect(ajv.validate(schema, {prop2: null})).toBeTruthy(); @@ -107,6 +109,7 @@ describe("@Nullable", () => { // THEN const schema = getJsonSchema(Model); + // @ts-ignore const ajv = new Ajv(); ajv.compile(schema); @@ -315,7 +318,7 @@ describe("@Nullable", () => { }, type: "object" }); - + // @ts-ignore const ajv = new Ajv({strict: true}); expect(ajv.validate(schema, {prop2: null})).toBeTruthy(); @@ -476,7 +479,7 @@ describe("@Nullable", () => { }, type: "object" }); - + // @ts-ignore const ajv = new Ajv({strict: true}); expect(ajv.validate(schema, {prop2: null})).toBeTruthy(); @@ -550,6 +553,7 @@ describe("@Nullable", () => { type: "object" }); + // @ts-ignore const ajv = new Ajv({strict: true}); ajv.validate(schema, {prop2: null}); @@ -705,6 +709,7 @@ describe("@Nullable", () => { type: "object" }); + // @ts-ignore const ajv = new Ajv({strict: true}); expect(ajv.validate(schema, {prop2: null})).toBeTruthy(); diff --git a/packages/specs/schema/src/decorators/common/nullable.ts b/packages/specs/schema/src/decorators/common/nullable.ts index 8f77fbb9f30..9c3a64837a7 100644 --- a/packages/specs/schema/src/decorators/common/nullable.ts +++ b/packages/specs/schema/src/decorators/common/nullable.ts @@ -1,5 +1,6 @@ import {Type, useDecorators} from "@tsed/core"; import type {JSONSchema6TypeName} from "json-schema"; + import {Any} from "./any.js"; import {Property} from "./property.js"; diff --git a/packages/specs/schema/src/decorators/common/optional.ts b/packages/specs/schema/src/decorators/common/optional.ts index 0927c5682ab..5b8556e7ad2 100644 --- a/packages/specs/schema/src/decorators/common/optional.ts +++ b/packages/specs/schema/src/decorators/common/optional.ts @@ -1,6 +1,7 @@ import {DecoratorTypes, UnsupportedDecoratorType} from "@tsed/core"; -import {JsonEntityFn} from "./jsonEntityFn.js"; + import type {JsonParameterStore} from "../../domain/JsonParameterStore.js"; +import {JsonEntityFn} from "./jsonEntityFn.js"; /** * Add optional annotation on Property or Parameter. diff --git a/packages/specs/schema/src/decorators/common/pattern.spec.ts b/packages/specs/schema/src/decorators/common/pattern.spec.ts index 168b90303d0..098165c4d15 100644 --- a/packages/specs/schema/src/decorators/common/pattern.spec.ts +++ b/packages/specs/schema/src/decorators/common/pattern.spec.ts @@ -1,6 +1,7 @@ +import "../../index.js"; + import {JsonEntityStore} from "../../domain/JsonEntityStore.js"; import {Pattern} from "./pattern.js"; -import "../../index.js"; describe("@Pattern", () => { it("should declare pattern value", () => { diff --git a/packages/specs/schema/src/decorators/common/property.ts b/packages/specs/schema/src/decorators/common/property.ts index bb61c04a446..033578645cf 100644 --- a/packages/specs/schema/src/decorators/common/property.ts +++ b/packages/specs/schema/src/decorators/common/property.ts @@ -1,4 +1,5 @@ import {isArrowFn, isClass} from "@tsed/core"; + import {JsonEntityFn} from "./jsonEntityFn.js"; /** diff --git a/packages/specs/schema/src/decorators/common/required.spec.ts b/packages/specs/schema/src/decorators/common/required.spec.ts index 000bef52465..9b925d04ebb 100644 --- a/packages/specs/schema/src/decorators/common/required.spec.ts +++ b/packages/specs/schema/src/decorators/common/required.spec.ts @@ -1,9 +1,10 @@ -import {validateModel} from "../../../test/helpers/validateModel.js"; -import {getJsonSchema, MinLength} from "../../index.js"; import Ajv from "ajv"; + +import {validateModel} from "../../../test/helpers/validateModel.js"; import {JsonEntityStore} from "../../domain/JsonEntityStore.js"; -import {Required} from "./required.js"; +import {getJsonSchema, MinLength} from "../../index.js"; import {Property} from "../common/property.js"; +import {Required} from "./required.js"; describe("@Required", () => { it("should declare required field", () => { @@ -130,6 +131,7 @@ describe("@Required", () => { type: "object" }); + // @ts-ignore const validate = new Ajv().compile(spec); expect(validate({allow: null})).toBe(true); expect(validate({})).toBe(false); @@ -137,7 +139,7 @@ describe("@Required", () => { it("should declare required field with custom error message", () => { // WHEN class Model { - @Required().Error("custom message") + @(Required().Error("custom message")) num: number; } diff --git a/packages/specs/schema/src/decorators/common/typeError.ts b/packages/specs/schema/src/decorators/common/typeError.ts index 9754951eaf4..1f1a1202935 100644 --- a/packages/specs/schema/src/decorators/common/typeError.ts +++ b/packages/specs/schema/src/decorators/common/typeError.ts @@ -1,4 +1,5 @@ import {useDecorators} from "@tsed/core"; + import {ErrorMsg} from "./errorMsg.js"; import {JsonEntityFn} from "./jsonEntityFn.js"; diff --git a/packages/specs/schema/src/decorators/config/jsonEntityComponent.ts b/packages/specs/schema/src/decorators/config/jsonEntityComponent.ts index 43df06ef231..30603480843 100644 --- a/packages/specs/schema/src/decorators/config/jsonEntityComponent.ts +++ b/packages/specs/schema/src/decorators/config/jsonEntityComponent.ts @@ -1,5 +1,6 @@ import {DecoratorTypes, Type} from "@tsed/core"; -import {JsonEntityStore, JsonEntitiesContainer} from "../../domain/JsonEntityStore.js"; + +import {JsonEntitiesContainer, JsonEntityStore} from "../../domain/JsonEntityStore.js"; /** * Declare a new JsonEntityStore class for a specific decorator type. diff --git a/packages/specs/schema/src/decorators/generics/genericOf.spec.ts b/packages/specs/schema/src/decorators/generics/genericOf.spec.ts index 013519cfb3a..1e386469ce5 100644 --- a/packages/specs/schema/src/decorators/generics/genericOf.spec.ts +++ b/packages/specs/schema/src/decorators/generics/genericOf.spec.ts @@ -125,7 +125,7 @@ describe("@GenericOf", () => { } class Content { - @GenericOf(Submission).Nested(Product) + @(GenericOf(Submission).Nested(Product)) submissions: Paginated>; } diff --git a/packages/specs/schema/src/decorators/generics/genericOf.ts b/packages/specs/schema/src/decorators/generics/genericOf.ts index cd149345986..98028de783b 100644 --- a/packages/specs/schema/src/decorators/generics/genericOf.ts +++ b/packages/specs/schema/src/decorators/generics/genericOf.ts @@ -1,4 +1,5 @@ import {isObject, Type} from "@tsed/core"; + import {JsonEntityStore} from "../../domain/JsonEntityStore.js"; import {string} from "../../utils/from.js"; import {GenericValue} from "../../utils/generics.js"; diff --git a/packages/specs/schema/src/decorators/operations/acceptMime.ts b/packages/specs/schema/src/decorators/operations/acceptMime.ts index 5e84f270784..6db4aae089b 100644 --- a/packages/specs/schema/src/decorators/operations/acceptMime.ts +++ b/packages/specs/schema/src/decorators/operations/acceptMime.ts @@ -1,4 +1,5 @@ import {StoreSet, useDecorators} from "@tsed/core"; + import {Produces} from "./produces.js"; /** diff --git a/packages/specs/schema/src/decorators/operations/consumes.ts b/packages/specs/schema/src/decorators/operations/consumes.ts index 61353efdfd8..2d4682c37cd 100644 --- a/packages/specs/schema/src/decorators/operations/consumes.ts +++ b/packages/specs/schema/src/decorators/operations/consumes.ts @@ -1,4 +1,5 @@ import {decorateMethodsOf, DecoratorTypes, UnsupportedDecoratorType} from "@tsed/core"; + import {JsonEntityFn} from "../common/jsonEntityFn.js"; /** diff --git a/packages/specs/schema/src/decorators/operations/deprecated.spec.ts b/packages/specs/schema/src/decorators/operations/deprecated.spec.ts index 0ffc07bdef2..b9efd08279e 100644 --- a/packages/specs/schema/src/decorators/operations/deprecated.spec.ts +++ b/packages/specs/schema/src/decorators/operations/deprecated.spec.ts @@ -1,6 +1,7 @@ -import {Deprecated, getSpec, OperationPath, Returns, SpecTypes} from "../../index.js"; -import {QueryParams} from "@tsed/platform-params"; import {catchError} from "@tsed/core"; +import {QueryParams} from "@tsed/platform-params"; + +import {Deprecated, getSpec, OperationPath, Returns, SpecTypes} from "../../index.js"; describe("Deprecated", () => { it("should store metadata (swagger)", () => { diff --git a/packages/specs/schema/src/decorators/operations/deprecated.ts b/packages/specs/schema/src/decorators/operations/deprecated.ts index 5a9ce55838c..c44c4d00c5d 100644 --- a/packages/specs/schema/src/decorators/operations/deprecated.ts +++ b/packages/specs/schema/src/decorators/operations/deprecated.ts @@ -1,7 +1,8 @@ import {decorateMethodsOf, decoratorTypeOf, DecoratorTypes, UnsupportedDecoratorType} from "@tsed/core"; -import {JsonEntityFn} from "../common/jsonEntityFn.js"; -import {JsonPropertyStore} from "../../domain/JsonPropertyStore.js"; + import {JsonParameterStore} from "../../domain/JsonParameterStore.js"; +import {JsonPropertyStore} from "../../domain/JsonPropertyStore.js"; +import {JsonEntityFn} from "../common/jsonEntityFn.js"; /** * Add deprecated metadata on the decorated element. diff --git a/packages/specs/schema/src/decorators/operations/header.ts b/packages/specs/schema/src/decorators/operations/header.ts index 1b03f867403..c92d91720a0 100644 --- a/packages/specs/schema/src/decorators/operations/header.ts +++ b/packages/specs/schema/src/decorators/operations/header.ts @@ -1,4 +1,5 @@ import {isString} from "@tsed/core"; + import {JsonHeader, JsonHeaders} from "../../interfaces/JsonOpenSpec.js"; import {Returns} from "./returns.js"; diff --git a/packages/specs/schema/src/decorators/operations/in.spec.ts b/packages/specs/schema/src/decorators/operations/in.spec.ts index d2a16f2fb9a..da7dd3c616c 100644 --- a/packages/specs/schema/src/decorators/operations/in.spec.ts +++ b/packages/specs/schema/src/decorators/operations/in.spec.ts @@ -37,7 +37,7 @@ describe("In", () => { it("should declare all schema correctly (method)", () => { // WHEN class Controller { - @In("header").Type(String).Name("Authorization").Required().Description("description") + @(In("header").Type(String).Name("Authorization").Required().Description("description")) method(@In("path") @Name("basic") basic: string) {} } @@ -80,7 +80,7 @@ describe("In", () => { it("should declare all schema correctly (class)", () => { // WHEN class Controller { - @In("header").Type(String).Name("Authorization").Required().Description("description") + @(In("header").Type(String).Name("Authorization").Required().Description("description")) method(@In("path") @Name("basic") basic: string) {} } @@ -123,12 +123,12 @@ describe("In", () => { it("should declare a pattern", () => { // WHEN @Path("/:parentId") - @In("path") + @(In("path") .Type(String) .Name("parentId") .Required() .Description("description") - .Pattern(/^[0-9a-fA-F]{24}$/) + .Pattern(/^[0-9a-fA-F]{24}$/)) class Controller { @OperationPath("GET", "/:path") method(@In("path") @Name("basic") basic: string) {} @@ -216,7 +216,7 @@ describe("In", () => { it("should declare schema", () => { // WHEN @Path("/:parentId") - @In("path").Name("parentId").Required().Description("description").Schema(number().integer().minimum(2)) + @(In("path").Name("parentId").Required().Description("description").Schema(number().integer().minimum(2))) class Controller { @OperationPath("GET", "/:path") method(@In("path") @Name("basic") basic: string) {} diff --git a/packages/specs/schema/src/decorators/operations/in.ts b/packages/specs/schema/src/decorators/operations/in.ts index 8784b769dbf..cc95da9fe96 100644 --- a/packages/specs/schema/src/decorators/operations/in.ts +++ b/packages/specs/schema/src/decorators/operations/in.ts @@ -1,4 +1,5 @@ import {decorateMethodsOf, DecoratorTypes, Type, UnsupportedDecoratorType} from "@tsed/core"; + import {JsonEntityStore} from "../../domain/JsonEntityStore.js"; import {JsonMethodStore} from "../../domain/JsonMethodStore.js"; import {JsonParameter} from "../../domain/JsonParameter.js"; diff --git a/packages/specs/schema/src/decorators/operations/inFile.ts b/packages/specs/schema/src/decorators/operations/inFile.ts index 035597649ac..4b3e2918eea 100644 --- a/packages/specs/schema/src/decorators/operations/inFile.ts +++ b/packages/specs/schema/src/decorators/operations/inFile.ts @@ -1,9 +1,10 @@ import {DecoratorParameters, Metadata, useDecorators, useMethodDecorators} from "@tsed/core"; -import {In} from "./in.js"; + import {JsonParameterTypes} from "../../domain/JsonParameterTypes.js"; -import {Returns} from "./returns.js"; import {Name} from "../common/name.js"; import {Consumes} from "./consumes.js"; +import {In} from "./in.js"; +import {Returns} from "./returns.js"; /** * Add a input file parameter. diff --git a/packages/specs/schema/src/decorators/operations/location.spec.ts b/packages/specs/schema/src/decorators/operations/location.spec.ts index 29ef07dd585..3fc6da0e7e9 100644 --- a/packages/specs/schema/src/decorators/operations/location.spec.ts +++ b/packages/specs/schema/src/decorators/operations/location.spec.ts @@ -3,7 +3,7 @@ import {getSpec, Location, OperationPath, SpecTypes} from "../../index.js"; describe("Location", () => { it("should set Header", () => { class MyController { - @Location("/path/to/test", {description: "Path to next step"}).Status(301) + @(Location("/path/to/test", {description: "Path to next step"}).Status(301)) @OperationPath("GET", "/") test() {} } diff --git a/packages/specs/schema/src/decorators/operations/operationId.ts b/packages/specs/schema/src/decorators/operations/operationId.ts index cb090c35d4e..6de22791b73 100644 --- a/packages/specs/schema/src/decorators/operations/operationId.ts +++ b/packages/specs/schema/src/decorators/operations/operationId.ts @@ -1,4 +1,5 @@ import {DecoratorTypes, UnsupportedDecoratorType} from "@tsed/core"; + import {JsonEntityFn} from "../common/jsonEntityFn.js"; /** diff --git a/packages/specs/schema/src/decorators/operations/operationPath.spec.ts b/packages/specs/schema/src/decorators/operations/operationPath.spec.ts index 0c7c77d357d..59bb1982f74 100644 --- a/packages/specs/schema/src/decorators/operations/operationPath.spec.ts +++ b/packages/specs/schema/src/decorators/operations/operationPath.spec.ts @@ -1,4 +1,4 @@ -import {getSpec, OperationVerbs, OperationPath} from "../../index.js"; +import {getSpec, OperationPath, OperationVerbs} from "../../index.js"; describe("OperationPath", () => { it("should store metadata", () => { diff --git a/packages/specs/schema/src/decorators/operations/operationPath.ts b/packages/specs/schema/src/decorators/operations/operationPath.ts index c423ebc59a5..bfe3b03fa1e 100644 --- a/packages/specs/schema/src/decorators/operations/operationPath.ts +++ b/packages/specs/schema/src/decorators/operations/operationPath.ts @@ -1,6 +1,7 @@ import {DecoratorTypes, UnsupportedDecoratorType} from "@tsed/core"; -import {JsonEntityFn} from "../common/jsonEntityFn.js"; + import {OperationVerbs} from "../../constants/OperationVerbs.js"; +import {JsonEntityFn} from "../common/jsonEntityFn.js"; /** * Declare new Operation with his path and http method. diff --git a/packages/specs/schema/src/decorators/operations/partial.spec.ts b/packages/specs/schema/src/decorators/operations/partial.spec.ts index b92cc0eff3e..2d0bf9e8055 100644 --- a/packages/specs/schema/src/decorators/operations/partial.spec.ts +++ b/packages/specs/schema/src/decorators/operations/partial.spec.ts @@ -1,4 +1,5 @@ import Ajv from "ajv"; + import { CollectionOf, getJsonSchema, @@ -48,7 +49,7 @@ describe("@Partial", () => { @Path("/") class MyController { @OperationPath("PATCH", "/") - @Returns(200, MyModel).Groups("group.*") + @(Returns(200, MyModel).Groups("group.*")) patch(@In("body") @Partial() payload: MyModel) { return new MyModel(); } @@ -195,6 +196,7 @@ describe("@Partial", () => { type: "object" }); + // @ts-ignore const ajv = new Ajv({strict: true}); expect(ajv.validate(schema, {})).toBe(false); @@ -239,6 +241,7 @@ describe("@Partial", () => { type: "object" }); + // @ts-ignore const ajv = new Ajv({strict: true}); expect(ajv.validate(schema, {})).toBe(true); diff --git a/packages/specs/schema/src/decorators/operations/path.ts b/packages/specs/schema/src/decorators/operations/path.ts index c366cc92ecb..1237ff5d6b5 100644 --- a/packages/specs/schema/src/decorators/operations/path.ts +++ b/packages/specs/schema/src/decorators/operations/path.ts @@ -1,4 +1,5 @@ import {DecoratorTypes, UnsupportedDecoratorType} from "@tsed/core"; + import {JsonEntityFn} from "../common/jsonEntityFn.js"; /** diff --git a/packages/specs/schema/src/decorators/operations/produces.ts b/packages/specs/schema/src/decorators/operations/produces.ts index ad6e245ed4a..6122c80b787 100644 --- a/packages/specs/schema/src/decorators/operations/produces.ts +++ b/packages/specs/schema/src/decorators/operations/produces.ts @@ -1,4 +1,5 @@ import {decorateMethodsOf, DecoratorTypes, UnsupportedDecoratorType} from "@tsed/core"; + import {JsonEntityFn} from "../common/jsonEntityFn.js"; /** diff --git a/packages/specs/schema/src/decorators/operations/publish.spec.ts b/packages/specs/schema/src/decorators/operations/publish.spec.ts index b87a8dfd5fe..4cf0333277e 100644 --- a/packages/specs/schema/src/decorators/operations/publish.spec.ts +++ b/packages/specs/schema/src/decorators/operations/publish.spec.ts @@ -1,7 +1,8 @@ +import "../../index.js"; + import {OperationVerbs} from "../../constants/OperationVerbs.js"; import {JsonEntityStore} from "../../domain/JsonEntityStore.js"; import {Publish} from "./publish.js"; -import "../../index.js"; describe("Publish", () => { it("should register operation with Publish verb", () => { diff --git a/packages/specs/schema/src/decorators/operations/redirect.ts b/packages/specs/schema/src/decorators/operations/redirect.ts index 2b655654eca..2db2caefc57 100644 --- a/packages/specs/schema/src/decorators/operations/redirect.ts +++ b/packages/specs/schema/src/decorators/operations/redirect.ts @@ -1,4 +1,5 @@ import {isNumber, isString, useDecorators} from "@tsed/core"; + import {JsonHeader} from "../../interfaces/JsonOpenSpec.js"; import {JsonEntityFn} from "../common/jsonEntityFn.js"; import {Returns} from "./returns.js"; diff --git a/packages/specs/schema/src/decorators/operations/returns.spec.ts b/packages/specs/schema/src/decorators/operations/returns.spec.ts index 0652b4623c0..e61b709d7c3 100644 --- a/packages/specs/schema/src/decorators/operations/returns.spec.ts +++ b/packages/specs/schema/src/decorators/operations/returns.spec.ts @@ -1,5 +1,7 @@ -import {OpenSpec3} from "@tsed/openspec"; import "@tsed/platform-exceptions"; + +import {OpenSpec3} from "@tsed/openspec"; + import {SpecTypes} from "../../domain/SpecTypes.js"; import {getSpec} from "../../utils/getSpec.js"; import {CollectionOf} from "../collections/collectionOf.js"; @@ -14,7 +16,7 @@ describe("@Returns", () => { // WHEN class Controller { @OperationPath("POST", "/") - @Returns(200, String).Description("description") + @(Returns(200, String).Description("description")) method() {} } @@ -54,7 +56,7 @@ describe("@Returns", () => { // WHEN class Controller { @OperationPath("POST", "/") - @Returns(200, String).Description("description") + @(Returns(200, String).Description("description")) method() {} } @@ -94,7 +96,7 @@ describe("@Returns", () => { // WHEN class Controller { @OperationPath("POST", "/") - @Returns().Status(200).Type(String).Description("description") + @(Returns().Status(200).Type(String).Description("description")) method() {} } @@ -134,7 +136,7 @@ describe("@Returns", () => { // WHEN class Controller { @OperationPath("POST", "/") - @Returns(200, String) + @(Returns(200, String) .Description("description") .Header("x-token", "token") .Header("x-header", { @@ -143,7 +145,7 @@ describe("@Returns", () => { .Examples({test: "Examples"}) .Schema({ minLength: 3 - }) + })) method() {} } @@ -201,9 +203,9 @@ describe("@Returns", () => { // WHEN class Controller { @OperationPath("POST", "/") - @Returns(200, String).Description("description").Header("x-token").Examples({test: "Examples"}).Schema({ + @(Returns(200, String).Description("description").Header("x-token").Examples({test: "Examples"}).Schema({ minLength: 3 - }) + })) method() {} } @@ -254,7 +256,7 @@ describe("@Returns", () => { // WHEN class Controller { @OperationPath("POST", "/") - @Returns(200, String).Description("description").ContentType("text/html").Examples("Examples") + @(Returns(200, String).Description("description").ContentType("text/html").Examples("Examples")) method() {} } @@ -295,9 +297,9 @@ describe("@Returns", () => { // WHEN class Controller { @OperationPath("POST", "/") - @Returns(400).Description("Bad request") + @(Returns(400).Description("Bad request")) @Returns(401) - @Returns(200).Description("Success") + @(Returns(200).Description("Success")) method() {} } @@ -446,12 +448,12 @@ describe("@Returns", () => { }); it("should declare error response on class", () => { // WHEN - @Returns(400).Description("Bad request").Header("x-token", "token") + @(Returns(400).Description("Bad request").Header("x-token", "token")) @Returns(401) class Controller { @OperationPath("POST", "/") - @Returns(200).Description("Success") - @Returns(400).Description("Bad request2").Header("x-token", "token2") + @(Returns(200).Description("Success")) + @(Returns(400).Description("Bad request2").Header("x-token", "token2")) method() {} } @@ -612,7 +614,7 @@ describe("@Returns", () => { try { class Controller { @OperationPath("POST", "/") - @Returns(200, String).Of(Array).Description("description") + @(Returns(200, String).Of(Array).Description("description")) method() {} } } catch (er) { @@ -627,7 +629,7 @@ describe("@Returns", () => { try { class Controller { @OperationPath("POST", "/") - @Returns(200, Array).Nested(Set).Description("description") + @(Returns(200, Array).Nested(Set).Description("description")) method() {} } } catch (er) { @@ -642,7 +644,7 @@ describe("@Returns", () => { // WHEN class Controller { @OperationPath("POST", "/") - @Returns(200, Array).Of(String).Description("description") + @(Returns(200, Array).Of(String).Description("description")) method() {} } @@ -690,7 +692,7 @@ describe("@Returns", () => { class Controller { @OperationPath("POST", "/") - @Returns(200, Array).Of(Model).Description("description") + @(Returns(200, Array).Of(Model).Description("description")) method() {} } @@ -768,7 +770,7 @@ describe("@Returns", () => { class Controller { @OperationPath("POST", "/") - @Returns(200, Pagination) + @(Returns(200, Pagination) .Of(Submission) .Nested(Product) .Description("description") @@ -786,7 +788,7 @@ describe("@Returns", () => { } ] } - }) + })) method(): Promise> | null> { return null as never; } @@ -888,7 +890,7 @@ describe("@Returns", () => { class Controller { @OperationPath("POST", "/") - @Returns(200, Submission).Of(MyEnum).Description("description") + @(Returns(200, Submission).Of(MyEnum).Description("description")) method(): Promise | null> { return Promise.resolve(null); } @@ -962,7 +964,7 @@ describe("@Returns", () => { class Controller { @OperationPath("POST", "/") - @Returns(200, Pagination) + @(Returns(200, Pagination) .Of(Submission) .Nested(MyEnum) .Description("description") @@ -980,7 +982,7 @@ describe("@Returns", () => { } ] } - }) + })) method(): Promise> | null> { return null as never; } @@ -1066,7 +1068,7 @@ describe("@Returns", () => { class Controller { @OperationPath("POST", "/") - @Returns(200).OneOf(Model, Model2).Description("description") + @(Returns(200).OneOf(Model, Model2).Description("description")) method() { return {}; } @@ -1141,9 +1143,9 @@ describe("@Returns", () => { class Controller { @OperationPath("POST", "/") - @Returns(200, Model).Description("description") - @Returns(200, String).ContentType("text/html") - @Returns(200, String).ContentType("text/xml") + @(Returns(200, Model).Description("description")) + @(Returns(200, String).ContentType("text/html")) + @(Returns(200, String).ContentType("text/xml")) method() {} } @@ -1229,7 +1231,7 @@ describe("@Returns", () => { class Controller { @OperationPath("POST", "/") - @Returns(200, Pagination).Of(Submission).Nested(Product).Title("PaginatedSubmissionProduct").Description("description") + @(Returns(200, Pagination).Of(Submission).Nested(Product).Title("PaginatedSubmissionProduct").Description("description")) method(): Promise> | null> { return null as never; } @@ -1342,7 +1344,7 @@ describe("@Returns", () => { it("should return oneOf array schema", () => { class Controller { - @Returns(200, Array).OneOf(ClassA, ClassB) + @(Returns(200, Array).OneOf(ClassA, ClassB)) @OperationPath("GET", "/") method() {} } @@ -1366,7 +1368,7 @@ describe("@Returns", () => { it("should return allOf array schema", () => { class Controller { - @Returns(200, Array).AllOf(ClassA, ClassB) + @(Returns(200, Array).AllOf(ClassA, ClassB)) @OperationPath("GET", "/") method() {} } @@ -1387,29 +1389,5 @@ describe("@Returns", () => { } }); }); - - it("should return allOf array schema", () => { - class Controller { - @Returns(200, Array).AnyOf(ClassA, ClassB) - @OperationPath("GET", "/") - method() {} - } - - const spec = getSpec(Controller, {specType: SpecTypes.OPENAPI}) as Partial; - - expect(spec.paths!["/"].get!.responses["200"].content!["application/json"].schema).toEqual({ - type: "array", - items: { - anyOf: [ - { - $ref: "#/components/schemas/ClassA" - }, - { - $ref: "#/components/schemas/ClassB" - } - ] - } - }); - }); }); }); diff --git a/packages/specs/schema/src/decorators/operations/returns.ts b/packages/specs/schema/src/decorators/operations/returns.ts index 3d3af9da560..a446378f22c 100644 --- a/packages/specs/schema/src/decorators/operations/returns.ts +++ b/packages/specs/schema/src/decorators/operations/returns.ts @@ -11,6 +11,7 @@ import { Type } from "@tsed/core"; import {OS3Example} from "@tsed/openspec"; + import {getStatusMessage} from "../../constants/httpStatusMessages.js"; import {DecoratorContext} from "../../domain/DecoratorContext.js"; import {JsonEntityStore} from "../../domain/JsonEntityStore.js"; diff --git a/packages/specs/schema/src/decorators/operations/route.spec.ts b/packages/specs/schema/src/decorators/operations/route.spec.ts index 4bce05076cf..c86a385e72b 100644 --- a/packages/specs/schema/src/decorators/operations/route.spec.ts +++ b/packages/specs/schema/src/decorators/operations/route.spec.ts @@ -69,7 +69,7 @@ describe("Route decorators", () => { // WHEN class Test { - @Get("/").UseBefore(beforeMiddleware).Use(middleware).UseAfter(afterMiddleware) + @(Get("/").UseBefore(beforeMiddleware).Use(middleware).UseAfter(afterMiddleware)) test() {} } @@ -105,7 +105,7 @@ describe("Route decorators", () => { it("should register route and middleware", () => { // WHEN class Test { - @Put("/").Id("operationId").Summary("Summary").Description("Description") + @(Put("/").Id("operationId").Summary("Summary").Description("Description")) test() {} } diff --git a/packages/specs/schema/src/decorators/operations/security.spec.ts b/packages/specs/schema/src/decorators/operations/security.spec.ts index cdf90e51172..a2201e9aba0 100644 --- a/packages/specs/schema/src/decorators/operations/security.spec.ts +++ b/packages/specs/schema/src/decorators/operations/security.spec.ts @@ -57,7 +57,7 @@ describe("Security", () => { it("should store multiple security schemes (method)", () => { class MyController { @OperationPath("POST", "/") - @Security([{ "A": ["scope-1"] }, { "B": [], "C": ["scope-2", "scope-3"]}]) + @Security([{A: ["scope-1"]}, {B: [], C: ["scope-2", "scope-3"]}]) post() {} } @@ -90,7 +90,7 @@ describe("Security", () => { } } } - }) + }); }); it("should store metadata (class)", () => { @Security("oauth", "user") diff --git a/packages/specs/schema/src/decorators/operations/security.ts b/packages/specs/schema/src/decorators/operations/security.ts index 1a2e1f3d7fc..7d8aed9fd30 100644 --- a/packages/specs/schema/src/decorators/operations/security.ts +++ b/packages/specs/schema/src/decorators/operations/security.ts @@ -1,7 +1,8 @@ import {decorateMethodsOf, DecoratorTypes, UnsupportedDecoratorType} from "@tsed/core"; -import {JsonEntityFn} from "../common/jsonEntityFn.js"; import {OpenSpecSecurity} from "@tsed/openspec"; +import {JsonEntityFn} from "../common/jsonEntityFn.js"; + /** * Add security metadata on the decorated method. * diff --git a/packages/specs/schema/src/decorators/operations/status.spec.ts b/packages/specs/schema/src/decorators/operations/status.spec.ts index ae7b32609b5..9754e589b5d 100644 --- a/packages/specs/schema/src/decorators/operations/status.spec.ts +++ b/packages/specs/schema/src/decorators/operations/status.spec.ts @@ -1,4 +1,5 @@ import "@tsed/platform-exceptions"; + import {SpecTypes} from "../../domain/SpecTypes.js"; import {getSpec} from "../../utils/getSpec.js"; import {CollectionOf} from "../collections/collectionOf.js"; @@ -12,7 +13,7 @@ describe("@Status", () => { // WHEN class Controller { @OperationPath("POST", "/") - @Status(200, String).Description("description") + @(Status(200, String).Description("description")) method() {} } @@ -52,7 +53,7 @@ describe("@Status", () => { // WHEN class Controller { @OperationPath("POST", "/") - @Status(200).Type(String).Description("description") + @(Status(200).Type(String).Description("description")) method() {} } @@ -92,7 +93,7 @@ describe("@Status", () => { // WHEN class Controller { @OperationPath("POST", "/") - @Status(200, String) + @(Status(200, String) .Description("description") .Header("x-token", "token") .Header("x-header", { @@ -101,7 +102,7 @@ describe("@Status", () => { .Examples({test: "Examples"}) .Schema({ minLength: 3 - }) + })) method() {} } @@ -159,7 +160,7 @@ describe("@Status", () => { // WHEN class Controller { @OperationPath("POST", "/") - @Status(200, String).Description("description").ContentType("text/html").Examples("Examples") + @(Status(200, String).Description("description").ContentType("text/html").Examples("Examples")) method() {} } @@ -200,9 +201,9 @@ describe("@Status", () => { // WHEN class Controller { @OperationPath("POST", "/") - @Status(400).Description("Bad request") + @(Status(400).Description("Bad request")) @Status(401) - @Status(200).Description("Success") + @(Status(200).Description("Success")) method() {} } @@ -355,7 +356,7 @@ describe("@Status", () => { try { class Controller { @OperationPath("POST", "/") - @Status(200, String).Of(Array).Description("description") + @(Status(200, String).Of(Array).Description("description")) method() {} } } catch (er) { @@ -370,7 +371,7 @@ describe("@Status", () => { try { class Controller { @OperationPath("POST", "/") - @Status(200, Array).Nested(Set).Description("description") + @(Status(200, Array).Nested(Set).Description("description")) method() {} } } catch (er) { @@ -383,7 +384,7 @@ describe("@Status", () => { // WHEN class Controller { @OperationPath("POST", "/") - @Status(200, Array).Of(String).Description("description") + @(Status(200, Array).Of(String).Description("description")) method() {} } @@ -431,7 +432,7 @@ describe("@Status", () => { class Controller { @OperationPath("POST", "/") - @Status(200, Array).Of(Model).Description("description") + @(Status(200, Array).Of(Model).Description("description")) method() {} } @@ -509,7 +510,7 @@ describe("@Status", () => { class Controller { @OperationPath("POST", "/") - @Status(200, Pagination).Of(Submission).Nested(Product).Description("description") + @(Status(200, Pagination).Of(Submission).Nested(Product).Description("description")) method(): Promise> | null> { return null as never; } diff --git a/packages/specs/schema/src/decorators/operations/status.ts b/packages/specs/schema/src/decorators/operations/status.ts index 96fd6ecf117..21a8de69148 100644 --- a/packages/specs/schema/src/decorators/operations/status.ts +++ b/packages/specs/schema/src/decorators/operations/status.ts @@ -1,4 +1,5 @@ import {Type} from "@tsed/core"; + import {Returns, ReturnsChainedDecorators} from "./returns.js"; /** diff --git a/packages/specs/schema/src/decorators/operations/subscribe.spec.ts b/packages/specs/schema/src/decorators/operations/subscribe.spec.ts index 8faf4ab3f86..4c42b019598 100644 --- a/packages/specs/schema/src/decorators/operations/subscribe.spec.ts +++ b/packages/specs/schema/src/decorators/operations/subscribe.spec.ts @@ -1,8 +1,9 @@ +import "../../index.js"; + import {OperationVerbs} from "../../constants/OperationVerbs.js"; import {JsonEntityStore} from "../../domain/JsonEntityStore.js"; import {Publish} from "./publish.js"; import {Subscribe} from "./subscribe.js"; -import "../../index.js"; describe("Subscribe", () => { it("should register operation with Subscribe verb", () => { diff --git a/packages/specs/schema/src/decorators/operations/summary.ts b/packages/specs/schema/src/decorators/operations/summary.ts index 8d3695efba3..c318e3c79ab 100644 --- a/packages/specs/schema/src/decorators/operations/summary.ts +++ b/packages/specs/schema/src/decorators/operations/summary.ts @@ -1,4 +1,5 @@ import {DecoratorTypes, UnsupportedDecoratorType} from "@tsed/core"; + import {JsonEntityFn} from "../common/jsonEntityFn.js"; /** diff --git a/packages/specs/schema/src/decorators/operations/tags.ts b/packages/specs/schema/src/decorators/operations/tags.ts index 8972d16fb5e..11e934ed99f 100644 --- a/packages/specs/schema/src/decorators/operations/tags.ts +++ b/packages/specs/schema/src/decorators/operations/tags.ts @@ -1,5 +1,6 @@ import {decorateMethodsOf, DecoratorTypes, UnsupportedDecoratorType} from "@tsed/core"; import {OpenSpecTag} from "@tsed/openspec"; + import {JsonEntityFn} from "../common/jsonEntityFn.js"; function mapTags(tags: (string | OpenSpecTag)[]) { diff --git a/packages/specs/schema/src/decorators/operations/view.spec.ts b/packages/specs/schema/src/decorators/operations/view.spec.ts index 6aaf6e4ddbf..2e0549b5797 100644 --- a/packages/specs/schema/src/decorators/operations/view.spec.ts +++ b/packages/specs/schema/src/decorators/operations/view.spec.ts @@ -13,16 +13,4 @@ describe("@View", () => { options: {test: "test"} }); }); - it("should set metadata", () => { - class Test { - @View("page", {test: "test"}) - test() {} - } - - const endpoint = JsonMethodStore.get(Test, "test"); - expect(endpoint.view).toEqual({ - path: "page", - options: {test: "test"} - }); - }); }); diff --git a/packages/specs/schema/src/domain/DecoratorContext.ts b/packages/specs/schema/src/domain/DecoratorContext.ts index 7a7cf19505f..f112770ce14 100644 --- a/packages/specs/schema/src/domain/DecoratorContext.ts +++ b/packages/specs/schema/src/domain/DecoratorContext.ts @@ -1,5 +1,6 @@ import {DecoratorParameters, DecoratorTypes} from "@tsed/core"; import {pascalCase} from "change-case"; + import {JsonEntityStore} from "./JsonEntityStore.js"; /** diff --git a/packages/specs/schema/src/domain/JsonClassStore.ts b/packages/specs/schema/src/domain/JsonClassStore.ts index 84a3f4fd37f..152769d4b7c 100644 --- a/packages/specs/schema/src/domain/JsonClassStore.ts +++ b/packages/specs/schema/src/domain/JsonClassStore.ts @@ -1,9 +1,10 @@ import {DecoratorTypes} from "@tsed/core"; + +import {JsonEntityComponent} from "../decorators/config/jsonEntityComponent.js"; +import {JsonEntityStore, JsonEntityStoreOptions} from "./JsonEntityStore.js"; import type {JsonMethodStore} from "./JsonMethodStore.js"; import type {JsonPropertyStore} from "./JsonPropertyStore.js"; -import {JsonEntityStore, JsonEntityStoreOptions} from "./JsonEntityStore.js"; import {JsonSchema} from "./JsonSchema.js"; -import {JsonEntityComponent} from "../decorators/config/jsonEntityComponent.js"; @JsonEntityComponent(DecoratorTypes.CLASS) export class JsonClassStore extends JsonEntityStore { diff --git a/packages/specs/schema/src/domain/JsonEntityStore.spec.ts b/packages/specs/schema/src/domain/JsonEntityStore.spec.ts index 62d0f2cf62f..65b0dc495b0 100644 --- a/packages/specs/schema/src/domain/JsonEntityStore.spec.ts +++ b/packages/specs/schema/src/domain/JsonEntityStore.spec.ts @@ -1,4 +1,5 @@ import { + Allow, In, JsonEntityStore, JsonMethodStore, @@ -7,8 +8,7 @@ import { JsonParameterStore, JsonPropertyStore, Property, - Required, - Allow + Required } from "../index.js"; describe("JsonEntityStore", () => { diff --git a/packages/specs/schema/src/domain/JsonEntityStore.ts b/packages/specs/schema/src/domain/JsonEntityStore.ts index 61ed2453fa9..6743a578720 100644 --- a/packages/specs/schema/src/domain/JsonEntityStore.ts +++ b/packages/specs/schema/src/domain/JsonEntityStore.ts @@ -18,6 +18,7 @@ import { Store, Type } from "@tsed/core"; + import type {JsonClassStore} from "./JsonClassStore.js"; import type {JsonMethodStore} from "./JsonMethodStore.js"; import type {JsonParameterStore} from "./JsonParameterStore.js"; diff --git a/packages/specs/schema/src/domain/JsonLazyRef.ts b/packages/specs/schema/src/domain/JsonLazyRef.ts index 8f42665d7a8..e93cba3fa59 100644 --- a/packages/specs/schema/src/domain/JsonLazyRef.ts +++ b/packages/specs/schema/src/domain/JsonLazyRef.ts @@ -1,4 +1,5 @@ import {nameOf, Type} from "@tsed/core"; + import {getJsonEntityStore} from "../utils/getJsonEntityStore.js"; export class JsonLazyRef { diff --git a/packages/specs/schema/src/domain/JsonMap.spec.ts b/packages/specs/schema/src/domain/JsonMap.spec.ts index f7505491b7b..5b30182e134 100644 --- a/packages/specs/schema/src/domain/JsonMap.spec.ts +++ b/packages/specs/schema/src/domain/JsonMap.spec.ts @@ -1,6 +1,7 @@ -import {JsonMap} from "./JsonMap.js"; import "../index.js"; +import {JsonMap} from "./JsonMap.js"; + describe("JsonMap", () => { it("should serialize a JsonMap", () => { const map = new JsonMap({ diff --git a/packages/specs/schema/src/domain/JsonMap.ts b/packages/specs/schema/src/domain/JsonMap.ts index 257f21d3922..21711746bd5 100644 --- a/packages/specs/schema/src/domain/JsonMap.ts +++ b/packages/specs/schema/src/domain/JsonMap.ts @@ -1,4 +1,5 @@ import {isFunction} from "@tsed/core"; + import {JsonSchemaOptions} from "../interfaces/JsonSchemaOptions.js"; import {execMapper} from "../registries/JsonSchemaMapperContainer.js"; diff --git a/packages/specs/schema/src/domain/JsonMedia.ts b/packages/specs/schema/src/domain/JsonMedia.ts index b59967b27e8..80884adbf89 100644 --- a/packages/specs/schema/src/domain/JsonMedia.ts +++ b/packages/specs/schema/src/domain/JsonMedia.ts @@ -1,4 +1,5 @@ import {OS3MediaType} from "@tsed/openspec"; + import {JsonMap} from "./JsonMap.js"; import {JsonSchema} from "./JsonSchema.js"; diff --git a/packages/specs/schema/src/domain/JsonMethodStore.spec.ts b/packages/specs/schema/src/domain/JsonMethodStore.spec.ts index 14f8bdfa63e..99cb6b0821f 100644 --- a/packages/specs/schema/src/domain/JsonMethodStore.spec.ts +++ b/packages/specs/schema/src/domain/JsonMethodStore.spec.ts @@ -1,5 +1,6 @@ import {StoreSet} from "@tsed/core"; import {Use, UseAfter, UseBefore} from "@tsed/platform-middlewares"; + import {OperationVerbs} from "../constants/OperationVerbs.js"; import {Property} from "../decorators/common/property.js"; import {In} from "../decorators/operations/in.js"; @@ -20,7 +21,7 @@ describe("JsonMethodStore", () => { class Test { @StoreSet("test", "value") - @Get("/").Use(middleware3).UseAfter(middleware1).UseBefore(middleware2) + @(Get("/").Use(middleware3).UseAfter(middleware1).UseBefore(middleware2)) method(): any {} } @@ -70,7 +71,7 @@ describe("JsonMethodStore", () => { expect(endpoint.acceptMimes).toEqual([]); }); }); - describe("endpoint declaration", () => { + describe("endpoint declaration (2)", () => { it("should return an endpoint metadata", () => { // GIVEN const middleware1 = () => {}; @@ -197,7 +198,7 @@ describe("JsonMethodStore", () => { it("should return the response options (200 + includes)", () => { class MyController { @Get("/") - @Returns(200, Object).AllowedGroups("summary") + @(Returns(200, Object).AllowedGroups("summary")) method(@In("path") param: string) {} } diff --git a/packages/specs/schema/src/domain/JsonMethodStore.ts b/packages/specs/schema/src/domain/JsonMethodStore.ts index d6ab2bc0612..e3f5d6ed1b9 100644 --- a/packages/specs/schema/src/domain/JsonMethodStore.ts +++ b/packages/specs/schema/src/domain/JsonMethodStore.ts @@ -1,4 +1,5 @@ import {DecoratorTypes, deepMerge, descriptorOf, isCollection, isFunction, isPromise, Metadata, prototypeOf, Store, Type} from "@tsed/core"; + import {JsonEntityComponent} from "../decorators/config/jsonEntityComponent.js"; import type {JsonClassStore} from "./JsonClassStore.js"; import {JsonEntityStore, JsonEntityStoreOptions} from "./JsonEntityStore.js"; diff --git a/packages/specs/schema/src/domain/JsonOperation.spec.ts b/packages/specs/schema/src/domain/JsonOperation.spec.ts index 8fc6ce649c4..df6b2f0bec6 100644 --- a/packages/specs/schema/src/domain/JsonOperation.spec.ts +++ b/packages/specs/schema/src/domain/JsonOperation.spec.ts @@ -1,4 +1,5 @@ import {descriptorOf} from "@tsed/core"; + import {execMapper, Get, getSpec, In, JsonEntityStore, OperationPath, Path, Redirect, Returns, SpecTypes} from "../index.js"; describe("JsonOperation", () => { @@ -6,8 +7,8 @@ describe("JsonOperation", () => { it("should return the status", () => { class MyController { @OperationPath("GET", "/") - @Returns(200).Header("x-token", "token") - @Returns(200).Header("x-token2", "token2") + @(Returns(200).Header("x-token", "token")) + @(Returns(200).Header("x-token2", "token2")) method() {} } @@ -72,7 +73,7 @@ describe("JsonOperation", () => { @Path("/") class MyController { @Get("/") - @Returns(200, String).ContentType("text/html") + @(Returns(200, String).ContentType("text/html")) test() {} } diff --git a/packages/specs/schema/src/domain/JsonOperation.ts b/packages/specs/schema/src/domain/JsonOperation.ts index 46a92e1a445..d671e60b45d 100644 --- a/packages/specs/schema/src/domain/JsonOperation.ts +++ b/packages/specs/schema/src/domain/JsonOperation.ts @@ -1,5 +1,6 @@ import {deepMerge, uniq, uniqBy} from "@tsed/core"; import {OpenSpecSecurity, OpenSpecTag, OS3Operation} from "@tsed/openspec"; + import {JsonHeader} from "../interfaces/JsonOpenSpec.js"; import {isRedirectionStatus, isSuccessStatus} from "../utils/isSuccessStatus.js"; import {JsonMap} from "./JsonMap.js"; diff --git a/packages/specs/schema/src/domain/JsonOperationRoute.spec.ts b/packages/specs/schema/src/domain/JsonOperationRoute.spec.ts index 4ed83535b06..603a89f1fd1 100644 --- a/packages/specs/schema/src/domain/JsonOperationRoute.spec.ts +++ b/packages/specs/schema/src/domain/JsonOperationRoute.spec.ts @@ -1,4 +1,5 @@ import {BodyParams} from "@tsed/platform-params"; + import {Name} from "../decorators/common/name.js"; import {Get} from "../decorators/operations/route.js"; import {JsonEntityStore} from "./JsonEntityStore.js"; diff --git a/packages/specs/schema/src/domain/JsonOperationRoute.ts b/packages/specs/schema/src/domain/JsonOperationRoute.ts index 134d48662c0..e1c4db9b1bc 100644 --- a/packages/specs/schema/src/domain/JsonOperationRoute.ts +++ b/packages/specs/schema/src/domain/JsonOperationRoute.ts @@ -1,7 +1,8 @@ import {Type} from "@tsed/core"; + +import {concatPath} from "../utils/concatPath.js"; import {JsonMethodStore} from "./JsonMethodStore.js"; import {JsonMethodPath, JsonOperation} from "./JsonOperation.js"; -import {concatPath} from "../utils/concatPath.js"; export class JsonOperationRoute { readonly token: Type; diff --git a/packages/specs/schema/src/domain/JsonParameter.ts b/packages/specs/schema/src/domain/JsonParameter.ts index 09103ee0083..4fb0dfe6f8b 100644 --- a/packages/specs/schema/src/domain/JsonParameter.ts +++ b/packages/specs/schema/src/domain/JsonParameter.ts @@ -1,5 +1,6 @@ import {Type} from "@tsed/core"; import {OpenSpecHash, OpenSpecRef, OS3Example, OS3Parameter} from "@tsed/openspec"; + import {JsonSchemaOptions} from "../interfaces/JsonSchemaOptions.js"; import {execMapper} from "../registries/JsonSchemaMapperContainer.js"; import {NestedGenerics} from "../utils/generics.js"; diff --git a/packages/specs/schema/src/domain/JsonParameterStore.spec.ts b/packages/specs/schema/src/domain/JsonParameterStore.spec.ts index a95796e5f38..710328320d3 100644 --- a/packages/specs/schema/src/domain/JsonParameterStore.spec.ts +++ b/packages/specs/schema/src/domain/JsonParameterStore.spec.ts @@ -1,4 +1,5 @@ import {prototypeOf, Store} from "@tsed/core"; + import {Allow} from "../decorators/common/allow.js"; import {Required} from "../decorators/common/required.js"; import {In} from "../decorators/operations/in.js"; @@ -61,18 +62,18 @@ describe("JsonParameterStore", () => { // GIVEN class BaseTest { @Get("/") - list(@In("query").Name("search") search: string) {} + list(@(In("query").Name("search")) search: string) {} @Get("/") - base(@In("query").Name("base") test: string) {} + base(@(In("query").Name("base")) test: string) {} } class Test extends BaseTest { @Get("/") - test(@In("query").Name("search") search: string) {} + test(@(In("query").Name("search")) search: string) {} @Get("/") - base(@In("query").Name("test") search: string) {} + base(@(In("query").Name("test")) search: string) {} } // WHEN diff --git a/packages/specs/schema/src/domain/JsonParameterStore.ts b/packages/specs/schema/src/domain/JsonParameterStore.ts index 7fa943356ff..9721bea1f52 100644 --- a/packages/specs/schema/src/domain/JsonParameterStore.ts +++ b/packages/specs/schema/src/domain/JsonParameterStore.ts @@ -1,9 +1,10 @@ import {ancestorsOf, DecoratorTypes, isClass, isCollection, isMethodDescriptor, Metadata, prototypeOf, Type} from "@tsed/core"; + +import {JsonEntityComponent} from "../decorators/config/jsonEntityComponent.js"; import {JsonEntityStore, JsonEntityStoreOptions} from "./JsonEntityStore.js"; import type {JsonMethodStore} from "./JsonMethodStore.js"; import {JsonParameter} from "./JsonParameter.js"; import {JsonSchema} from "./JsonSchema.js"; -import {JsonEntityComponent} from "../decorators/config/jsonEntityComponent.js"; export interface JsonParameterStoreOptions extends JsonEntityStoreOptions { dataPath?: string; diff --git a/packages/specs/schema/src/domain/JsonPropertyStore.spec.ts b/packages/specs/schema/src/domain/JsonPropertyStore.spec.ts index 17ea7006540..b2cf01be9b1 100644 --- a/packages/specs/schema/src/domain/JsonPropertyStore.spec.ts +++ b/packages/specs/schema/src/domain/JsonPropertyStore.spec.ts @@ -1,4 +1,5 @@ import {prototypeOf} from "@tsed/core"; + import {Allow, JsonClassStore, JsonPropertyStore, Required} from "../index.js"; import {getJsonEntityStore} from "../utils/getJsonEntityStore.js"; diff --git a/packages/specs/schema/src/domain/JsonPropertyStore.ts b/packages/specs/schema/src/domain/JsonPropertyStore.ts index 25486c19890..6439521539f 100644 --- a/packages/specs/schema/src/domain/JsonPropertyStore.ts +++ b/packages/specs/schema/src/domain/JsonPropertyStore.ts @@ -1,8 +1,9 @@ import {DecoratorTypes, Metadata, prototypeOf, Type} from "@tsed/core"; -import {JsonEntityStore} from "./JsonEntityStore.js"; -import {JsonSchema} from "./JsonSchema.js"; + import {JsonEntityComponent} from "../decorators/config/jsonEntityComponent.js"; import type {JsonClassStore} from "./JsonClassStore.js"; +import {JsonEntityStore} from "./JsonEntityStore.js"; +import {JsonSchema} from "./JsonSchema.js"; @JsonEntityComponent(DecoratorTypes.PROP) export class JsonPropertyStore extends JsonEntityStore { diff --git a/packages/specs/schema/src/domain/JsonRequestBody.ts b/packages/specs/schema/src/domain/JsonRequestBody.ts index 2bdb96d16be..411456d54fa 100644 --- a/packages/specs/schema/src/domain/JsonRequestBody.ts +++ b/packages/specs/schema/src/domain/JsonRequestBody.ts @@ -1,4 +1,5 @@ import {OpenSpecHash, OS3MediaType, OS3RequestBody} from "@tsed/openspec"; + import {toJsonMapCollection} from "../utils/toJsonMapCollection.js"; import {JsonMap} from "./JsonMap.js"; import {JsonSchema} from "./JsonSchema.js"; diff --git a/packages/specs/schema/src/domain/JsonResponse.spec.ts b/packages/specs/schema/src/domain/JsonResponse.spec.ts index d407e5bc580..e8d552a2a05 100644 --- a/packages/specs/schema/src/domain/JsonResponse.spec.ts +++ b/packages/specs/schema/src/domain/JsonResponse.spec.ts @@ -1,4 +1,4 @@ -import {JsonResponse} from "./JsonResponse"; +import {JsonResponse} from "./JsonResponse.js"; describe("JsonResponse", () => { describe("isBinary()", () => { diff --git a/packages/specs/schema/src/domain/JsonResponse.ts b/packages/specs/schema/src/domain/JsonResponse.ts index f13f0fed2a7..fbf24f113ad 100644 --- a/packages/specs/schema/src/domain/JsonResponse.ts +++ b/packages/specs/schema/src/domain/JsonResponse.ts @@ -1,4 +1,5 @@ import {OS3MediaType, OS3Response} from "@tsed/openspec"; + import {JsonHeader} from "../interfaces/JsonOpenSpec.js"; import {mapHeaders} from "../utils/mapHeaders.js"; import {toJsonMapCollection} from "../utils/toJsonMapCollection.js"; diff --git a/packages/specs/schema/src/domain/JsonSchema.spec.ts b/packages/specs/schema/src/domain/JsonSchema.spec.ts index 28af3a95bbe..9633bebcdff 100644 --- a/packages/specs/schema/src/domain/JsonSchema.spec.ts +++ b/packages/specs/schema/src/domain/JsonSchema.spec.ts @@ -1,6 +1,8 @@ +import "../index.js"; + import Ajv from "ajv"; + import {JsonSchema} from "./JsonSchema.js"; -import "../index.js"; describe("JsonSchema", () => { describe("extra Props", () => { @@ -20,6 +22,7 @@ describe("JsonSchema", () => { // https://json-schema.org/understanding-json-schema/basics.html it("should validate {}", () => { const schema = JsonSchema.from({}).toObject(); + // @ts-ignore const validate = new Ajv({strict: true}).compile(schema); expect(schema).toEqual({}); @@ -33,6 +36,7 @@ describe("JsonSchema", () => { // https://json-schema.org/understanding-json-schema/reference/string.html#string it("should create a new jsonSchema", () => { const schema = JsonSchema.from({type: String}).toObject(); + // @ts-ignore const validate = new Ajv({strict: true}).compile(schema); expect(schema).toEqual({ @@ -52,6 +56,7 @@ describe("JsonSchema", () => { it("should create a new jsonSchema", () => { const schema = JsonSchema.from({type: String}).minLength(2).maxLength(3).toObject(); + // @ts-ignore const validate = new Ajv({strict: true}).compile(schema); expect(schema).toEqual({ @@ -72,6 +77,7 @@ describe("JsonSchema", () => { it("should build json schema", () => { const schema = JsonSchema.from({type: String}).pattern(new RegExp("^(\\([0-9]{3}\\))?[0-9]{3}-[0-9]{4}$")).toObject(); + // @ts-ignore const validate = new Ajv({strict: true}).compile(schema); expect(schema).toEqual({ @@ -111,6 +117,8 @@ describe("JsonSchema", () => { // https://json-schema.org/understanding-json-schema/reference/numeric.html#number it("should create a jsonschema for number", () => { const schema = JsonSchema.from({type: Number}).toObject(); + + // @ts-ignore const validate = new Ajv({strict: true}).compile(schema); expect(schema).toEqual({ @@ -128,6 +136,8 @@ describe("JsonSchema", () => { // https://json-schema.org/understanding-json-schema/reference/numeric.html#integer it("should create a jsonschema", () => { const schema = JsonSchema.from({type: "integer"}).toObject(); + + // @ts-ignore const validate = new Ajv({strict: true}).compile(schema); expect(schema).toEqual({ @@ -144,6 +154,8 @@ describe("JsonSchema", () => { // https://json-schema.org/understanding-json-schema/reference/numeric.html#multiples it("should create a jsonschema", () => { const schema = JsonSchema.from({type: Number, multipleOf: 10}).toObject(); + + // @ts-ignore const validate = new Ajv({strict: true}).compile(schema); expect(schema).toEqual({ @@ -161,6 +173,7 @@ describe("JsonSchema", () => { // https://json-schema.org/understanding-json-schema/reference/numeric.html#range it("should create a jsonschema minimum & exclusiveMaximum", () => { const schema = JsonSchema.from({type: Number, minimum: 0, exclusiveMaximum: 100}).toObject(); + // @ts-ignore const validate = new Ajv({strict: true}).compile(schema); expect(schema).toEqual({ @@ -176,6 +189,7 @@ describe("JsonSchema", () => { }); it("should create a jsonschema exclusiveMinimum & maximum", () => { const schema = JsonSchema.from({type: Number, exclusiveMinimum: 0, maximum: 100}).toObject(); + // @ts-ignore const validate = new Ajv({strict: true}).compile(schema); expect(schema).toEqual({ @@ -198,6 +212,7 @@ describe("JsonSchema", () => { // https://json-schema.org/understanding-json-schema/reference/object.html#object it("should create a new jsonSchema", () => { const schema = JsonSchema.from({type: Object}).toObject(); + // @ts-ignore const validate = new Ajv({strict: true}).compile(schema); expect(schema).toEqual({ @@ -251,6 +266,7 @@ describe("JsonSchema", () => { } }).toObject(); + // @ts-ignore const validate = new Ajv({strict: true}).compile(schema); expect(validate({number: 1600, street_name: "Pennsylvania", street_type: "Avenue"})).toBe(true); expect(validate({number: "1600", street_name: "Pennsylvania", street_type: "Avenue"})).toBe(false); @@ -292,6 +308,7 @@ describe("JsonSchema", () => { additionalProperties: false // Unauthorized unknown properties }); + // @ts-ignore const validate = new Ajv({strict: true}).compile(schema); expect(validate({number: 1600, street_name: "Pennsylvania", street_type: "Avenue"})).toBe(true); @@ -318,6 +335,7 @@ describe("JsonSchema", () => { additionalProperties: JsonSchema.from({type: "string"}) }).toObject(); + // @ts-ignore const validate = new Ajv({strict: true}).compile(schema); expect(validate({number: 1600, street_name: "Pennsylvania", street_type: "Avenue"})).toBe(true); @@ -367,6 +385,7 @@ describe("JsonSchema", () => { required: ["name", "email"] }); + // @ts-ignore const validate = new Ajv({strict: true}).compile(schema); expect( validate({ @@ -406,6 +425,7 @@ describe("JsonSchema", () => { required: ["name"] }); + // @ts-ignore const validate = new Ajv({strict: true}).compile(schema); expect(validate({name: "William Shakespeare"})).toBe(true); expect(validate({name: ""})).toBe(false); @@ -431,6 +451,7 @@ describe("JsonSchema", () => { required: ["name"] }); + // @ts-ignore const validate = new Ajv({strict: true}).compile(schema); expect(validate({name: "William Shakespeare"})).toBe(false); expect(validate({name: ""})).toBe(false); @@ -462,6 +483,7 @@ describe("JsonSchema", () => { required: ["name"] }); + // @ts-ignore const validate = new Ajv({strict: true}).compile(schema); expect(validate({name: "William Shakespeare"})).toBe(true); expect(validate({name: ""})).toBe(false); @@ -487,6 +509,7 @@ describe("JsonSchema", () => { required: ["name"] }); + // @ts-ignore const validate = new Ajv({strict: true}).compile(schema); expect(validate({name: "William Shakespeare"})).toBe(false); expect(validate({name: ""})).toBe(false); @@ -505,6 +528,7 @@ describe("JsonSchema", () => { }) }).toObject(); + // @ts-ignore const validate = new Ajv({strict: true}).compile(schema); expect( validate({ @@ -527,6 +551,7 @@ describe("JsonSchema", () => { maxProperties: 3 }).toObject(); + // @ts-ignore const validate = new Ajv({strict: true}).compile(schema); expect(validate({})).toBe(false); expect(validate({a: 0})).toBe(false); @@ -568,6 +593,7 @@ describe("JsonSchema", () => { } }); + // @ts-ignore const validate = new Ajv({strict: true}).compile(schema); expect( validate({ @@ -612,6 +638,7 @@ describe("JsonSchema", () => { } }).toObject(); + // @ts-ignore const validate = new Ajv({strict: true}).compile(schema); expect( validate({ @@ -649,6 +676,7 @@ describe("JsonSchema", () => { } }).toObject(); + // @ts-ignore const validate = new Ajv({strict: true}).compile(schema); expect( validate({ @@ -701,6 +729,7 @@ describe("JsonSchema", () => { additionalProperties: false }); + // @ts-ignore const validate = new Ajv({strict: true}).compile(schema); expect(validate({S_25: "This is a string"})).toBe(true); expect(validate({I_0: 42})).toBe(true); @@ -733,6 +762,7 @@ describe("JsonSchema", () => { additionalProperties: {type: "string"} }); + // @ts-ignore const validate = new Ajv({strict: true}).compile(schema); expect(validate({S_25: "This is a string"})).toBe(true); expect(validate({keyword: "value"})).toBe(true); @@ -745,6 +775,7 @@ describe("JsonSchema", () => { // https://json-schema.org/understanding-json-schema/reference/array.html#array it("should create a new jsonSchema", () => { const schema = JsonSchema.from({type: Array}).toObject(); + // @ts-ignore const validate = new Ajv({strict: true}).compile(schema); expect(schema).toEqual({ @@ -768,6 +799,7 @@ describe("JsonSchema", () => { }) }).toObject(); + // @ts-ignore const validate = new Ajv({strict: true}).compile(schema); expect(schema).toEqual({ @@ -790,6 +822,7 @@ describe("JsonSchema", () => { } }).toObject(); + // @ts-ignore const validate = new Ajv({strict: true}).compile(schema); expect(schema).toEqual({ @@ -827,6 +860,7 @@ describe("JsonSchema", () => { ] }).toObject(); + // @ts-ignore const validate = new Ajv().compile(schema); expect(schema).toEqual({ @@ -877,6 +911,7 @@ describe("JsonSchema", () => { additionalItems: false }).toObject(); + // @ts-ignore const validate = new Ajv().compile(schema); expect(schema).toEqual({ @@ -926,6 +961,7 @@ describe("JsonSchema", () => { additionalItems: {type: "string"} }).toObject(); + // @ts-ignore const validate = new Ajv().compile(schema); expect(schema).toEqual({ @@ -962,6 +998,7 @@ describe("JsonSchema", () => { maxItems: 3 }).toObject(); + // @ts-ignore const validate = new Ajv({strict: true}).compile(schema); expect(validate([])).toBe(false); @@ -979,6 +1016,7 @@ describe("JsonSchema", () => { uniqueItems: true }).toObject(); + // @ts-ignore const validate = new Ajv({strict: true}).compile(schema); expect(validate([1, 2, 3, 4, 5])).toBe(true); @@ -992,6 +1030,8 @@ describe("JsonSchema", () => { // https://json-schema.org/understanding-json-schema/reference/boolean.html it("should create a new jsonSchema", () => { const schema = JsonSchema.from({type: Boolean}).toObject(); + + // @ts-ignore const validate = new Ajv({strict: true}).compile(schema); expect(schema).toEqual({ @@ -1012,6 +1052,7 @@ describe("JsonSchema", () => { type: "null" }); + // @ts-ignore const validate = new Ajv({strict: true}).compile(schema); expect(validate(null)).toBe(true); @@ -1055,6 +1096,7 @@ describe("JsonSchema", () => { enum: ["red", "amber", "green"] }); + // @ts-ignore const validate = new Ajv({strict: true}).compile(schema); expect(validate("red")).toBe(true); @@ -1081,6 +1123,7 @@ describe("JsonSchema", () => { ] }); + // @ts-ignore const validate = new Ajv({allowUnionTypes: true}).compile(schema); expect(validate("red")).toBe(true); @@ -1111,6 +1154,7 @@ describe("JsonSchema", () => { } }); + // @ts-ignore const validate = new Ajv({strict: true}).compile(schema); expect(validate({country: "United States of America"})).toBe(true); @@ -1184,6 +1228,7 @@ describe("JsonSchema", () => { ] }); + // @ts-ignore const validate = new Ajv({strict: true}).compile(schema); expect(validate("short")).toBe(true); @@ -1209,6 +1254,7 @@ describe("JsonSchema", () => { ] }); + // @ts-ignore const validate = new Ajv({strict: true}).compile(schema); expect(validate("short")).toBe(false); @@ -1225,6 +1271,7 @@ describe("JsonSchema", () => { ] }).toObject(); + // @ts-ignore const validate = new Ajv({strict: true}).compile(schema); expect(validate(10)).toBe(true); @@ -1238,6 +1285,7 @@ describe("JsonSchema", () => { it("should create a new jsonSchema", () => { const schema = JsonSchema.from({not: {type: "string"}}).toObject(); + // @ts-ignore const validate = new Ajv({strict: true}).compile(schema); expect(validate(42)).toBe(true); @@ -1316,6 +1364,7 @@ describe("JsonSchema", () => { } }).toObject(); + // @ts-ignore const validate = new Ajv({strict: true}).compile(schema); expect(schema).toEqual({ @@ -1361,7 +1410,7 @@ describe("JsonSchema", () => { ] } }) - ); + ).toBeDefined(); }); }); describe("Alias", () => { diff --git a/packages/specs/schema/src/domain/JsonSchema.ts b/packages/specs/schema/src/domain/JsonSchema.ts index 63a6f5e0cae..2c9670f4f1c 100644 --- a/packages/specs/schema/src/domain/JsonSchema.ts +++ b/packages/specs/schema/src/domain/JsonSchema.ts @@ -13,6 +13,7 @@ import { ValueOf } from "@tsed/core"; import type {JSONSchema6, JSONSchema6Definition, JSONSchema6Type, JSONSchema6TypeName, JSONSchema6Version} from "json-schema"; + import {IgnoreCallback} from "../interfaces/IgnoreCallback.js"; import {JsonSchemaOptions} from "../interfaces/JsonSchemaOptions.js"; import {enumsRegistry} from "../registries/enumRegistries.js"; diff --git a/packages/specs/schema/src/hooks/alterOneOf.ts b/packages/specs/schema/src/hooks/alterOneOf.ts index 91c8293de80..deb3ea2359a 100644 --- a/packages/specs/schema/src/hooks/alterOneOf.ts +++ b/packages/specs/schema/src/hooks/alterOneOf.ts @@ -1,6 +1,7 @@ import {isArray, isBoolean, isNumber, isObject, isString} from "@tsed/core"; import type {JSONSchema6} from "json-schema"; import {filter} from "rxjs"; + import { ARRAY_PROPERTIES, BOOLEAN_PROPERTIES, diff --git a/packages/specs/schema/src/utils/from.spec.ts b/packages/specs/schema/src/utils/from.spec.ts index 001a568a4d7..bf7ef3eb6ac 100644 --- a/packages/specs/schema/src/utils/from.spec.ts +++ b/packages/specs/schema/src/utils/from.spec.ts @@ -1,3 +1,5 @@ +import "../index.js"; + import {CollectionOf} from "../decorators/collections/collectionOf.js"; import {Property} from "../decorators/common/property.js"; import { @@ -21,7 +23,6 @@ import { uri, url } from "./from.js"; -import "../index.js"; describe("from", () => { it("should declare a model", () => { diff --git a/packages/specs/schema/src/utils/from.ts b/packages/specs/schema/src/utils/from.ts index 3d46697456b..fa62f3de4a7 100644 --- a/packages/specs/schema/src/utils/from.ts +++ b/packages/specs/schema/src/utils/from.ts @@ -1,4 +1,5 @@ import {isClass, Type} from "@tsed/core"; + import {JsonEntityStore} from "../domain/JsonEntityStore.js"; import {JsonFormatTypes} from "../domain/JsonFormatTypes.js"; import {JsonLazyRef} from "../domain/JsonLazyRef.js"; diff --git a/packages/specs/schema/src/utils/generateSpec.spec.ts b/packages/specs/schema/src/utils/generateSpec.spec.ts index 3c75550ce8f..03298ef088c 100644 --- a/packages/specs/schema/src/utils/generateSpec.spec.ts +++ b/packages/specs/schema/src/utils/generateSpec.spec.ts @@ -1,6 +1,9 @@ +import {BodyParams} from "@tsed/platform-params"; import {join} from "path"; + import {validateSpec} from "../../test/helpers/validateSpec.js"; import {CollectionOf} from "../decorators/collections/collectionOf.js"; +import {AnyOf} from "../decorators/common/anyOf.js"; import {Description} from "../decorators/common/description.js"; import {Min} from "../decorators/common/minimum.js"; import {Name} from "../decorators/common/name.js"; @@ -11,11 +14,9 @@ import {In} from "../decorators/operations/in.js"; import {OperationPath} from "../decorators/operations/operationPath.js"; import {Path} from "../decorators/operations/path.js"; import {Returns} from "../decorators/operations/returns.js"; +import {Post} from "../decorators/operations/route.js"; import {SpecTypes} from "../domain/SpecTypes.js"; import {generateSpec} from "./generateSpec.js"; -import {AnyOf} from "../decorators/common/anyOf"; -import {Post} from "../decorators/operations/route"; -import {BodyParams} from "@tsed/platform-params"; const rootDir = import.meta.dirname; @@ -1072,7 +1073,7 @@ describe("generateSpec()", () => { @Description("Class description") class Controller { @OperationPath("POST", "/") - @Returns(200, String).Description("description") + @(Returns(200, String).Description("description")) method() {} } @@ -1117,7 +1118,7 @@ describe("generateSpec()", () => { // WHEN class Controller { @OperationPath("POST", "/") - @Returns(200, Array).Of(String).Description("description") + @(Returns(200, Array).Of(String).Description("description")) method() {} } @@ -1165,7 +1166,7 @@ describe("generateSpec()", () => { // WHEN class Controller { @OperationPath("POST", "/") - @Returns(200, String) + @(Returns(200, String) .Description("description") .Header("x-token", "token") .Header("x-header", { @@ -1174,7 +1175,7 @@ describe("generateSpec()", () => { .Examples({test: "Examples"}) .Schema({ minLength: 3 - }) + })) method() {} } diff --git a/packages/specs/schema/src/utils/generateSpec.ts b/packages/specs/schema/src/utils/generateSpec.ts index 48c30e33f9d..4863bf79870 100644 --- a/packages/specs/schema/src/utils/generateSpec.ts +++ b/packages/specs/schema/src/utils/generateSpec.ts @@ -1,5 +1,6 @@ import {getValue} from "@tsed/core"; import {OpenSpec2, OpenSpec3} from "@tsed/openspec"; + import {SpecTypes} from "../domain/SpecTypes.js"; import {getSpec, JsonTokenOptions, SpecSerializerOptions} from "./getSpec.js"; import {getSpecTypeFromSpec} from "./getSpecType.js"; diff --git a/packages/specs/schema/src/utils/generics.ts b/packages/specs/schema/src/utils/generics.ts index 4e61939c08f..031e1741d77 100644 --- a/packages/specs/schema/src/utils/generics.ts +++ b/packages/specs/schema/src/utils/generics.ts @@ -1,4 +1,5 @@ import {Type} from "@tsed/core"; + import {JsonSchema} from "../domain/JsonSchema.js"; export type GenericValue = Type | JsonSchema | any; diff --git a/packages/specs/schema/src/utils/getInheritedStores.spec.ts b/packages/specs/schema/src/utils/getInheritedStores.spec.ts index d7c042a95bb..35130e7a178 100644 --- a/packages/specs/schema/src/utils/getInheritedStores.spec.ts +++ b/packages/specs/schema/src/utils/getInheritedStores.spec.ts @@ -1,4 +1,5 @@ import {StoreSet} from "@tsed/core"; + import {OperationPath} from "../decorators/operations/operationPath.js"; import {getInheritedStores} from "./getInheritedStores.js"; diff --git a/packages/specs/schema/src/utils/getInheritedStores.ts b/packages/specs/schema/src/utils/getInheritedStores.ts index 6708ea69922..50f7842dece 100644 --- a/packages/specs/schema/src/utils/getInheritedStores.ts +++ b/packages/specs/schema/src/utils/getInheritedStores.ts @@ -1,4 +1,5 @@ import {ancestorsOf, Type} from "@tsed/core"; + import type {JsonClassStore} from "../domain/JsonClassStore.js"; import {getJsonEntityStore} from "./getJsonEntityStore.js"; diff --git a/packages/specs/schema/src/utils/getJsonEntityStore.ts b/packages/specs/schema/src/utils/getJsonEntityStore.ts index fd4d1c1d332..e348ec1aea8 100644 --- a/packages/specs/schema/src/utils/getJsonEntityStore.ts +++ b/packages/specs/schema/src/utils/getJsonEntityStore.ts @@ -1,9 +1,10 @@ import {DecoratorTypes, Type} from "@tsed/core"; -import {JsonEntitiesContainer, JsonEntityStore} from "../domain/JsonEntityStore.js"; + import {JsonClassStore} from "../domain/JsonClassStore.js"; -import {JsonPropertyStore} from "../domain/JsonPropertyStore.js"; -import {JsonParameterStore} from "../domain/JsonParameterStore.js"; +import {JsonEntitiesContainer, JsonEntityStore} from "../domain/JsonEntityStore.js"; import {JsonMethodStore} from "../domain/JsonMethodStore.js"; +import {JsonParameterStore} from "../domain/JsonParameterStore.js"; +import {JsonPropertyStore} from "../domain/JsonPropertyStore.js"; JsonEntitiesContainer.set(DecoratorTypes.CLASS, JsonClassStore); JsonEntitiesContainer.set(DecoratorTypes.PROP, JsonPropertyStore); diff --git a/packages/specs/schema/src/utils/getJsonSchema.spec.ts b/packages/specs/schema/src/utils/getJsonSchema.spec.ts index 1db0bd8f70b..25945521119 100644 --- a/packages/specs/schema/src/utils/getJsonSchema.spec.ts +++ b/packages/specs/schema/src/utils/getJsonSchema.spec.ts @@ -1,4 +1,5 @@ import {ancestorsOf, nameOf, Type} from "@tsed/core"; + import {Post} from "../../test/helpers/Post.js"; import {CollectionOf, Email, Format, getJsonSchema, JsonEntityStore, MinLength, Name, Property, Required} from "../index.js"; diff --git a/packages/specs/schema/src/utils/getJsonSchema.ts b/packages/specs/schema/src/utils/getJsonSchema.ts index a9475f2f8ba..6e3f525546a 100644 --- a/packages/specs/schema/src/utils/getJsonSchema.ts +++ b/packages/specs/schema/src/utils/getJsonSchema.ts @@ -1,5 +1,7 @@ -import {getValue, Type} from "@tsed/core"; import "../components/index.js"; + +import {getValue, Type} from "@tsed/core"; + import type {JsonEntityStore} from "../domain/JsonEntityStore.js"; import {SpecTypes} from "../domain/SpecTypes.js"; import {JsonSchemaOptions} from "../interfaces/JsonSchemaOptions.js"; diff --git a/packages/specs/schema/src/utils/getOperationsRoutes.spec.ts b/packages/specs/schema/src/utils/getOperationsRoutes.spec.ts index 3aa9cd765d0..ad8725c9056 100644 --- a/packages/specs/schema/src/utils/getOperationsRoutes.spec.ts +++ b/packages/specs/schema/src/utils/getOperationsRoutes.spec.ts @@ -1,4 +1,5 @@ import {StoreSet} from "@tsed/core"; + import {Children} from "../decorators/class/children.js"; import {In} from "../decorators/operations/in.js"; import {Path} from "../decorators/operations/path.js"; diff --git a/packages/specs/schema/src/utils/getOperationsRoutes.ts b/packages/specs/schema/src/utils/getOperationsRoutes.ts index 6cfbb187a0b..45d7d5f2b4f 100644 --- a/packages/specs/schema/src/utils/getOperationsRoutes.ts +++ b/packages/specs/schema/src/utils/getOperationsRoutes.ts @@ -1,4 +1,5 @@ import {Type} from "@tsed/core"; + import {OperationVerbs} from "../constants/OperationVerbs.js"; import {JsonEntityStore} from "../domain/JsonEntityStore.js"; import {JsonMethodStore} from "../domain/JsonMethodStore.js"; diff --git a/packages/specs/schema/src/utils/getOperationsStore.spec.ts b/packages/specs/schema/src/utils/getOperationsStore.spec.ts index ddb92802e73..263de02e0f5 100644 --- a/packages/specs/schema/src/utils/getOperationsStore.spec.ts +++ b/packages/specs/schema/src/utils/getOperationsStore.spec.ts @@ -1,4 +1,5 @@ import {StoreSet} from "@tsed/core"; + import {getOperationsStores, OperationPath} from "../index.js"; describe("getOperationsStore", () => { diff --git a/packages/specs/schema/src/utils/getOperationsStores.ts b/packages/specs/schema/src/utils/getOperationsStores.ts index ce04652ee5e..80f3f722102 100644 --- a/packages/specs/schema/src/utils/getOperationsStores.ts +++ b/packages/specs/schema/src/utils/getOperationsStores.ts @@ -1,6 +1,7 @@ import {Type} from "@tsed/core"; -import {JsonMethodStore} from "../domain/JsonMethodStore.js"; + import type {JsonClassStore} from "../domain/JsonClassStore.js"; +import {JsonMethodStore} from "../domain/JsonMethodStore.js"; import {JsonOperationPathsMap} from "../domain/JsonOperationPathsMap.js"; import {getInheritedStores} from "./getInheritedStores.js"; import {getJsonEntityStore} from "./getJsonEntityStore.js"; diff --git a/packages/specs/schema/src/utils/getPropertiesStores.spec.ts b/packages/specs/schema/src/utils/getPropertiesStores.spec.ts index 1d781527571..38f418f0b2e 100644 --- a/packages/specs/schema/src/utils/getPropertiesStores.spec.ts +++ b/packages/specs/schema/src/utils/getPropertiesStores.spec.ts @@ -120,7 +120,7 @@ describe("getProperties()", () => { expect(result.get("id")!.targetName).toBe("Parent"); }); - it("should have a property name metadata from Parent class", () => { + it("should have a property name metadata from Parent class (2)", () => { const result = getProperties(Parent); expect(result.get("name")!.targetName).toBe("Parent"); }); diff --git a/packages/specs/schema/src/utils/getPropertiesStores.ts b/packages/specs/schema/src/utils/getPropertiesStores.ts index 377da5483e5..b82a00aaff0 100644 --- a/packages/specs/schema/src/utils/getPropertiesStores.ts +++ b/packages/specs/schema/src/utils/getPropertiesStores.ts @@ -1,4 +1,5 @@ import {isBoolean, Type} from "@tsed/core"; + import type {JsonClassStore} from "../domain/JsonClassStore.js"; import type {JsonPropertyStore} from "../domain/JsonPropertyStore.js"; import {alterIgnore} from "../hooks/alterIgnore.js"; diff --git a/packages/specs/schema/src/utils/getSpec.spec.ts b/packages/specs/schema/src/utils/getSpec.spec.ts index b73dc772d7c..6e9a863c979 100644 --- a/packages/specs/schema/src/utils/getSpec.spec.ts +++ b/packages/specs/schema/src/utils/getSpec.spec.ts @@ -526,7 +526,7 @@ describe("getSpec()", () => { // WHEN class Controller { @OperationPath("POST", "/") - @Returns(200, String).Description("description") + @(Returns(200, String).Description("description")) method() {} } @@ -566,7 +566,7 @@ describe("getSpec()", () => { // WHEN class Controller { @OperationPath("POST", "/") - @Returns(200, Array).Of(String).Description("description") + @(Returns(200, Array).Of(String).Description("description")) method() {} } diff --git a/packages/specs/schema/src/utils/getSpec.ts b/packages/specs/schema/src/utils/getSpec.ts index 83dbe90f429..a02f240635d 100644 --- a/packages/specs/schema/src/utils/getSpec.ts +++ b/packages/specs/schema/src/utils/getSpec.ts @@ -1,5 +1,6 @@ import {cleanObject, isArray, Type, uniqBy} from "@tsed/core"; import {OpenSpec3} from "@tsed/openspec"; + import {SpecTypes} from "../domain/SpecTypes.js"; import {JsonSchemaOptions} from "../interfaces/JsonSchemaOptions.js"; import {execMapper} from "../registries/JsonSchemaMapperContainer.js"; diff --git a/packages/specs/schema/src/utils/getSpecType.ts b/packages/specs/schema/src/utils/getSpecType.ts index 4e3cd232432..be191b28229 100644 --- a/packages/specs/schema/src/utils/getSpecType.ts +++ b/packages/specs/schema/src/utils/getSpecType.ts @@ -1,4 +1,5 @@ import {OpenSpec2, OpenSpec3} from "@tsed/openspec"; + import {SpecTypes} from "../domain/SpecTypes.js"; /** diff --git a/packages/specs/schema/src/utils/isSuccessStatus.spec.ts b/packages/specs/schema/src/utils/isSuccessStatus.spec.ts index ef1066b0e4d..58b26a90d8c 100644 --- a/packages/specs/schema/src/utils/isSuccessStatus.spec.ts +++ b/packages/specs/schema/src/utils/isSuccessStatus.spec.ts @@ -13,7 +13,7 @@ describe("isSuccessStatus", () => { }); describe("isRedirectionStatus", () => { - it("should return the expected value for ", () => { + it("should return the expected value for", () => { expect(isRedirectionStatus("300")).toBe(true); expect(isRedirectionStatus(301)).toBe(true); expect(isRedirectionStatus(200)).toBe(false); diff --git a/packages/specs/schema/src/utils/mapHeaders.ts b/packages/specs/schema/src/utils/mapHeaders.ts index e0c7742714f..f809a958c45 100644 --- a/packages/specs/schema/src/utils/mapHeaders.ts +++ b/packages/specs/schema/src/utils/mapHeaders.ts @@ -1,4 +1,5 @@ import {cleanObject} from "@tsed/core"; + import {JsonHeader, JsonHeaders} from "../interfaces/JsonOpenSpec.js"; /** diff --git a/packages/specs/schema/src/utils/mapOpenSpec.ts b/packages/specs/schema/src/utils/mapOpenSpec.ts index 0b392d5ee2e..b0977a2c13f 100644 --- a/packages/specs/schema/src/utils/mapOpenSpec.ts +++ b/packages/specs/schema/src/utils/mapOpenSpec.ts @@ -1,8 +1,9 @@ import {getValue, setValue} from "@tsed/core"; import {OpenSpec2, OpenSpec3, OpenSpecVersions} from "@tsed/openspec"; + +import {SpecTypes} from "../domain/SpecTypes.js"; import {getSpecType} from "./getSpecType.js"; import {mapOpenSpec2} from "./mapOpenSpec2.js"; -import {SpecTypes} from "../domain/SpecTypes.js"; import {mapOpenSpec3} from "./mapOpenSpec3.js"; import {mergeSpec} from "./mergeSpec.js"; diff --git a/packages/specs/schema/src/utils/mapOpenSpec2.ts b/packages/specs/schema/src/utils/mapOpenSpec2.ts index 469adaaed70..49490b8ab61 100644 --- a/packages/specs/schema/src/utils/mapOpenSpec2.ts +++ b/packages/specs/schema/src/utils/mapOpenSpec2.ts @@ -1,5 +1,6 @@ import {getValue, uniq} from "@tsed/core"; import {OpenSpec2} from "@tsed/openspec"; + import {mapOpenSpecInfo} from "./mapOpenSpecInfo.js"; /** diff --git a/packages/specs/schema/src/utils/mapOpenSpec3.ts b/packages/specs/schema/src/utils/mapOpenSpec3.ts index 1557bbf0e75..6b5831f32dc 100644 --- a/packages/specs/schema/src/utils/mapOpenSpec3.ts +++ b/packages/specs/schema/src/utils/mapOpenSpec3.ts @@ -1,5 +1,6 @@ import {getValue} from "@tsed/core"; import {OpenSpec3} from "@tsed/openspec"; + import {mapOpenSpecInfo} from "./mapOpenSpecInfo.js"; /** diff --git a/packages/specs/schema/src/utils/mergeSpec.spec.ts b/packages/specs/schema/src/utils/mergeSpec.spec.ts index 8d1525db225..b75724ccee1 100644 --- a/packages/specs/schema/src/utils/mergeSpec.spec.ts +++ b/packages/specs/schema/src/utils/mergeSpec.spec.ts @@ -1,4 +1,5 @@ import {OpenSpec2, OpenSpec3} from "@tsed/openspec"; + import {mergeSpec} from "./mergeSpec.js"; describe("mergeSpec", () => { diff --git a/packages/specs/schema/src/utils/mergeSpec.ts b/packages/specs/schema/src/utils/mergeSpec.ts index c9ef6fa1a9a..a103bba71e6 100644 --- a/packages/specs/schema/src/utils/mergeSpec.ts +++ b/packages/specs/schema/src/utils/mergeSpec.ts @@ -4,15 +4,13 @@ import {OpenSpec2, OpenSpec3} from "@tsed/openspec"; /** * @ignore */ -export const schemesReducer = mergeReducerBuilder( - (current, value) => { - if (current.type && current.type && current.type === value.type && value.type === 'array') { - return JSON.stringify(current.items) === JSON.stringify(value.items); - } - - return (current.type && current.type === value.type) || (current.$ref && current.$ref === value.$ref) +export const schemesReducer = mergeReducerBuilder((current, value) => { + if (current.type && current.type && current.type === value.type && value.type === "array") { + return JSON.stringify(current.items) === JSON.stringify(value.items); } -); + + return (current.type && current.type === value.type) || (current.$ref && current.$ref === value.$ref); +}); /** * @ignore diff --git a/packages/specs/schema/src/utils/operationIdFormatter.ts b/packages/specs/schema/src/utils/operationIdFormatter.ts index 75c9d7a7c6a..ae1529ca252 100644 --- a/packages/specs/schema/src/utils/operationIdFormatter.ts +++ b/packages/specs/schema/src/utils/operationIdFormatter.ts @@ -1,4 +1,5 @@ import {camelCase} from "change-case"; + import {JsonSchemaOptions} from "../interfaces/JsonSchemaOptions.js"; const DEFAULT_PATTERN = "%c.%m"; diff --git a/packages/specs/schema/src/utils/ref.ts b/packages/specs/schema/src/utils/ref.ts index b994e444fbe..5c67089844d 100644 --- a/packages/specs/schema/src/utils/ref.ts +++ b/packages/specs/schema/src/utils/ref.ts @@ -1,5 +1,6 @@ import {cleanObject, setValue} from "@tsed/core"; import {pascalCase} from "change-case"; + import type {JsonSchema} from "../domain/JsonSchema.js"; import {SpecTypes} from "../domain/SpecTypes.js"; import {JsonSchemaOptions} from "../interfaces/JsonSchemaOptions.js"; diff --git a/packages/specs/schema/src/utils/transformToOS2.spec.ts b/packages/specs/schema/src/utils/transformToOS2.spec.ts index 8b925ce38a1..837003e0f67 100644 --- a/packages/specs/schema/src/utils/transformToOS2.spec.ts +++ b/packages/specs/schema/src/utils/transformToOS2.spec.ts @@ -1,30 +1,30 @@ -import {transformSecurity, transformToOS2} from "./transformToOS2.js"; -import commonParamsOS3 from "./__mock__/common_params/os3.spec.json"; import commonParamsOS2 from "./__mock__/common_params/os2.spec.json"; -import deprecatedOS3 from "./__mock__/deprecated/os3.spec.json"; +import commonParamsOS3 from "./__mock__/common_params/os3.spec.json"; import deprecatedOS2 from "./__mock__/deprecated/os2.spec.json"; -import formParamOS3 from "./__mock__/form_param/os3.spec.json"; +import deprecatedOS3 from "./__mock__/deprecated/os3.spec.json"; import formParamOS2 from "./__mock__/form_param/os2.spec.json"; -import minimalOS3 from "./__mock__/minimal/os3.spec.json"; +import formParamOS3 from "./__mock__/form_param/os3.spec.json"; import minimalOS2 from "./__mock__/minimal/os2.spec.json"; -import multipleRefOS3 from "./__mock__/multiple_ref/os3.spec.json"; +import minimalOS3 from "./__mock__/minimal/os3.spec.json"; import multipleRefOS2 from "./__mock__/multiple_ref/os2.spec.json"; -import nestedOneOfOS3 from "./__mock__/nested_oneof/os3.spec.json"; +import multipleRefOS3 from "./__mock__/multiple_ref/os3.spec.json"; import nestedOneOfOS2 from "./__mock__/nested_oneof/os2.spec.json"; -import nullableOS3 from "./__mock__/nullable/os3.spec.json"; +import nestedOneOfOS3 from "./__mock__/nested_oneof/os3.spec.json"; import nullableOS2 from "./__mock__/nullable/os2.spec.json"; -import paramSchemaRefOS3 from "./__mock__/param_schema_ref/os3.spec.json"; +import nullableOS3 from "./__mock__/nullable/os3.spec.json"; import paramSchemaRefOS2 from "./__mock__/param_schema_ref/os2.spec.json"; -import petstoreOS3 from "./__mock__/petstore/os3.spec.json"; +import paramSchemaRefOS3 from "./__mock__/param_schema_ref/os3.spec.json"; import petstoreOS2 from "./__mock__/petstore/os2.spec.json"; -import producesOS3 from "./__mock__/produces/os3.spec.json"; +import petstoreOS3 from "./__mock__/petstore/os3.spec.json"; import producesOS2 from "./__mock__/produces/os2.spec.json"; -import requestResponseRefOS3 from "./__mock__/request_response_ref/os3.spec.json"; +import producesOS3 from "./__mock__/produces/os3.spec.json"; import requestResponseRefOS2 from "./__mock__/request_response_ref/os2.spec.json"; -import serversOS3 from "./__mock__/servers/os3.spec.json"; +import requestResponseRefOS3 from "./__mock__/request_response_ref/os3.spec.json"; import serversOS2 from "./__mock__/servers/os2.spec.json"; -import slashRefOS3 from "./__mock__/slash_ref/os3.spec.json"; +import serversOS3 from "./__mock__/servers/os3.spec.json"; import slashRefOS2 from "./__mock__/slash_ref/os2.spec.json"; +import slashRefOS3 from "./__mock__/slash_ref/os3.spec.json"; +import {transformSecurity, transformToOS2} from "./transformToOS2.js"; describe("transform", () => { describe("transformSecurity()", () => { diff --git a/packages/specs/schema/src/utils/transformToOS2.ts b/packages/specs/schema/src/utils/transformToOS2.ts index 8706929167a..cc1dea7b17c 100644 --- a/packages/specs/schema/src/utils/transformToOS2.ts +++ b/packages/specs/schema/src/utils/transformToOS2.ts @@ -1,6 +1,6 @@ "use strict"; -import {OpenSpec2, OpenSpec3, OS3Operation} from "@tsed/openspec"; import {cleanObject} from "@tsed/core"; +import {OpenSpec2, OpenSpec3, OS3Operation} from "@tsed/openspec"; const HTTP_METHODS = ["get", "put", "post", "delete", "options", "head", "patch", "trace"]; const SCHEMA_PROPERTIES = [ diff --git a/packages/specs/schema/src/utils/withErrorMsg.ts b/packages/specs/schema/src/utils/withErrorMsg.ts index e16aae5b4ba..774f32c2fbe 100644 --- a/packages/specs/schema/src/utils/withErrorMsg.ts +++ b/packages/specs/schema/src/utils/withErrorMsg.ts @@ -1,4 +1,5 @@ import {deepMerge, useDecorators} from "@tsed/core"; + import {JsonEntityFn} from "../decorators/common/jsonEntityFn.js"; export interface ErrorChainedMethods { diff --git a/packages/specs/schema/test/helpers/validateModel.ts b/packages/specs/schema/test/helpers/validateModel.ts index 02606982087..facb32f1f90 100644 --- a/packages/specs/schema/test/helpers/validateModel.ts +++ b/packages/specs/schema/test/helpers/validateModel.ts @@ -1,12 +1,13 @@ -import {getJsonSchema} from "../../src/index.js"; import Ajv, {Options} from "ajv"; -import AjvFormats from "ajv-formats"; import AjvErrors from "ajv-errors"; +import AjvFormats from "ajv-formats"; + import type {JsonSchemaOptions} from "../../src/index.js"; +import {getJsonSchema} from "../../src/index.js"; export function validateModel(data: any, model: any, options: JsonSchemaOptions & Options = {}) { const {errorFormatter, keywords = [], ...props} = options; - const opts: Options = { + const opts: any = { verbose: false, coerceTypes: true, strict: false, @@ -16,11 +17,14 @@ export function validateModel(data: any, model: any, options: JsonSchemaOptions ...props }; + // @ts-ignore const ajv = new Ajv(opts); // add support for custom error messages + // @ts-ignore AjvErrors(ajv); + // @ts-ignore AjvFormats(ajv as any); const schema = getJsonSchema(model, { diff --git a/packages/specs/schema/test/helpers/validateSpec.ts b/packages/specs/schema/test/helpers/validateSpec.ts index 00705d6f0b6..338c6703c5d 100644 --- a/packages/specs/schema/test/helpers/validateSpec.ts +++ b/packages/specs/schema/test/helpers/validateSpec.ts @@ -1,8 +1,9 @@ import SwaggerParser from "@apidevtools/swagger-parser"; -import {SpecTypes} from "../../src/index.js"; import fs from "fs-extra"; import {v4} from "uuid"; +import {SpecTypes} from "../../src/index.js"; + const rootDir = import.meta.dirname; export const validateSpec = async (spec: any, version = SpecTypes.SWAGGER) => { diff --git a/packages/specs/schema/test/integrations/allowed-groups.integration.spec.ts b/packages/specs/schema/test/integrations/allowed-groups.integration.spec.ts index c9cf331bdd4..c76be59621e 100644 --- a/packages/specs/schema/test/integrations/allowed-groups.integration.spec.ts +++ b/packages/specs/schema/test/integrations/allowed-groups.integration.spec.ts @@ -1,4 +1,5 @@ import {Controller} from "@tsed/di"; + import {Get, getSpec, Groups, Property, Returns} from "../../src/index.js"; class MyModel { @@ -21,7 +22,7 @@ class MyModel { @Controller("/controllers") class MyController { @Get("/:id") - @Returns(200, MyModel).AllowedGroups("summary", "details") + @(Returns(200, MyModel).AllowedGroups("summary", "details")) get() { return { id: "id", diff --git a/packages/specs/schema/test/integrations/body-params-any.integration.spec.ts b/packages/specs/schema/test/integrations/body-params-any.integration.spec.ts index d01e519c0d1..60d5109e9a2 100644 --- a/packages/specs/schema/test/integrations/body-params-any.integration.spec.ts +++ b/packages/specs/schema/test/integrations/body-params-any.integration.spec.ts @@ -1,6 +1,7 @@ import {MultipartFile, PlatformMulterFile} from "@tsed/common"; import {Controller} from "@tsed/di"; import {BodyParams} from "@tsed/platform-params"; + import {Any, CollectionOf, getSpec, Integer, Post, Property} from "../../src/index.js"; class MyModel { diff --git a/packages/specs/schema/test/integrations/body.integration.spec.ts b/packages/specs/schema/test/integrations/body.integration.spec.ts index 944963694c7..5eb02f161d0 100644 --- a/packages/specs/schema/test/integrations/body.integration.spec.ts +++ b/packages/specs/schema/test/integrations/body.integration.spec.ts @@ -1,5 +1,6 @@ -import {OperationPath, Path, getSpec, SpecTypes} from "../../src/index.js"; import {BodyParams, RawBodyParams} from "@tsed/platform-params"; + +import {getSpec, OperationPath, Path, SpecTypes} from "../../src/index.js"; import {validateSpec} from "../helpers/validateSpec.js"; @Path("/body") diff --git a/packages/specs/schema/test/integrations/deep-object-query-params.spec.ts b/packages/specs/schema/test/integrations/deep-object-query-params.spec.ts index 680225c4d87..b4d4358bfbb 100644 --- a/packages/specs/schema/test/integrations/deep-object-query-params.spec.ts +++ b/packages/specs/schema/test/integrations/deep-object-query-params.spec.ts @@ -1,6 +1,7 @@ -import {Default, GenericOf, Generics, getSpec, In, Maximum, Minimum, OperationPath, Path, Property, SpecTypes} from "../../src/index.js"; import {QueryParams} from "@tsed/platform-params"; +import {Default, GenericOf, Generics, getSpec, In, Maximum, Minimum, OperationPath, Path, Property, SpecTypes} from "../../src/index.js"; + describe("Deep Object QueryParams", () => { it("should generate the spec for deep object", () => { class DeepQueryObject { diff --git a/packages/specs/schema/test/integrations/discriminator.integration.spec.ts b/packages/specs/schema/test/integrations/discriminator.integration.spec.ts index 90702a01a8d..285d403e0d6 100644 --- a/packages/specs/schema/test/integrations/discriminator.integration.spec.ts +++ b/packages/specs/schema/test/integrations/discriminator.integration.spec.ts @@ -1,5 +1,6 @@ import {Controller} from "@tsed/di"; import {BodyParams, PathParams} from "@tsed/platform-params"; + import { DiscriminatorKey, DiscriminatorValue, @@ -336,7 +337,7 @@ describe("Discriminator", () => { @Controller("/") class MyTest { @Post("/") - @Returns(200, Array).OneOf(Event) + @(Returns(200, Array).OneOf(Event)) post(@BodyParams() @OneOf(Event) events: OneOfEvents[]) { return []; } @@ -434,7 +435,7 @@ describe("Discriminator", () => { @Controller("/") class MyTest { @Patch("/") - @Returns(200, Array).OneOf(Event) + @(Returns(200, Array).OneOf(Event)) patch(@BodyParams() @OneOf(Event) @Partial() event: OneOfEvents) { return []; } @@ -528,7 +529,7 @@ describe("Discriminator", () => { @Controller("/") class MyTest { @Post("/") - @Returns(200, Array).OneOf(Event) + @(Returns(200, Array).OneOf(Event)) post(@BodyParams() @OneOf(Event) @Partial() events: OneOfEvents[]) { return []; } @@ -734,7 +735,7 @@ describe("Discriminator", () => { @Controller("/") class MyTest { @Put("/:id") - @Returns(200).OneOf(Event) + @(Returns(200).OneOf(Event)) put(@PathParams(":id") id: string, @BodyParams() @OneOf(Event) event: OneOfEvents) { return []; } @@ -885,7 +886,7 @@ describe("Discriminator", () => { @Controller("/") class MyTest { @Put("/:id") - @Returns(200).OneOf(Event) + @(Returns(200).OneOf(Event)) put(@PathParams(":id") id: string, @BodyParams() @Partial() @OneOf(Event) event: OneOfEvents) { return []; } @@ -1094,7 +1095,7 @@ describe("Discriminator", () => { @Controller("/") class MyTest { @Get("/:id") - @Returns(200).OneOf(Event) + @(Returns(200).OneOf(Event)) get(@PathParams(":id") id: string) { return []; } @@ -1229,7 +1230,7 @@ describe("Discriminator", () => { @Controller("/") class MyTest { @Get("/:id") - @Returns(200).OneOf(Base) + @(Returns(200).OneOf(Base)) get(@PathParams(":id") id: string) { return []; } @@ -1335,7 +1336,7 @@ describe("Discriminator", () => { @Name("Test") class TestController { @Get() - @Returns(200, Array).Of(ParentModel) + @(Returns(200, Array).Of(ParentModel)) public get(): Promise { return null as any; } diff --git a/packages/specs/schema/test/integrations/dynamicurl.integration.spec.ts b/packages/specs/schema/test/integrations/dynamicurl.integration.spec.ts index cb80210056d..5da8043d149 100644 --- a/packages/specs/schema/test/integrations/dynamicurl.integration.spec.ts +++ b/packages/specs/schema/test/integrations/dynamicurl.integration.spec.ts @@ -4,7 +4,7 @@ import {validateSpec} from "../helpers/validateSpec.js"; @Path("/dynamic") class TestDynamicUrlCtrl { @OperationPath("GET", "/JQ=:id") - async get(@In("path").Name("id") id: string) {} + async get(@(In("path").Name("id")) id: string) {} } describe("Spec: DynamicUrl", () => { diff --git a/packages/specs/schema/test/integrations/generics.integration.spec.ts b/packages/specs/schema/test/integrations/generics.integration.spec.ts index 217dd35afb2..e55721a4ca8 100644 --- a/packages/specs/schema/test/integrations/generics.integration.spec.ts +++ b/packages/specs/schema/test/integrations/generics.integration.spec.ts @@ -638,7 +638,7 @@ describe("Generics", () => { class Controller { @OperationPath("POST", "/") - @Returns(200, Pagination).Of(Submission).Nested(Product).Description("description") + @(Returns(200, Pagination).Of(Submission).Nested(Product).Description("description")) method(): Promise> | null> { return null as never; } @@ -735,7 +735,7 @@ describe("Generics", () => { class MyController { @OperationPath("POST", "/") - @Returns(200, Pagination).Of(Submission).Nested(Product).Description("description") + @(Returns(200, Pagination).Of(Submission).Nested(Product).Description("description")) method(): Promise> | null> { return null as never; } @@ -834,7 +834,7 @@ describe("Generics", () => { class Controller { @OperationPath("POST", "/") - @Returns(200, Pagination).Of(Submission).Nested(Product).Description("description") + @(Returns(200, Pagination).Of(Submission).Nested(Product).Description("description")) method(): Promise> | null> { return null as never; } diff --git a/packages/specs/schema/test/integrations/inheritance.integration.spec.ts b/packages/specs/schema/test/integrations/inheritance.integration.spec.ts index d07be2bc34b..21bddd5c11d 100644 --- a/packages/specs/schema/test/integrations/inheritance.integration.spec.ts +++ b/packages/specs/schema/test/integrations/inheritance.integration.spec.ts @@ -1,6 +1,7 @@ -import {getSpec, In, Name, OperationPath, Path, SpecTypes} from "../../src/index.js"; import {decorateMethodsOf, DecoratorParameters, decoratorTypeOf, DecoratorTypes, StoreMerge, UnsupportedDecoratorType} from "@tsed/core"; +import {getSpec, In, Name, OperationPath, Path, SpecTypes} from "../../src/index.js"; + function UseAuth(): Function { return (...args: DecoratorParameters): TypedPropertyDescriptor | void => { switch (decoratorTypeOf(args)) { diff --git a/packages/specs/schema/test/integrations/lazyref.integration.spec.ts b/packages/specs/schema/test/integrations/lazyref.integration.spec.ts index f2aa53d14fe..1582b74f1e1 100644 --- a/packages/specs/schema/test/integrations/lazyref.integration.spec.ts +++ b/packages/specs/schema/test/integrations/lazyref.integration.spec.ts @@ -1,4 +1,5 @@ import {isArrowFn, Type, useDecorators} from "@tsed/core"; + import {getJsonSchema, JsonEntityFn, lazyRef, Property, string} from "../../src/index.js"; function Ref(model: string | (() => Type) | any): PropertyDecorator { diff --git a/packages/specs/schema/test/integrations/multipart.integration.spec.ts b/packages/specs/schema/test/integrations/multipart.integration.spec.ts index 14163ebe4a4..bc04ade5e69 100644 --- a/packages/specs/schema/test/integrations/multipart.integration.spec.ts +++ b/packages/specs/schema/test/integrations/multipart.integration.spec.ts @@ -1,6 +1,7 @@ import {MultipartFile, PlatformMulterFile} from "@tsed/common"; import {Controller} from "@tsed/di"; import {BodyParams} from "@tsed/platform-params"; + import {SpecTypes} from "../../src/index.js"; import {Description, getSpec, Post} from "../../src/index.js"; import {validateSpec} from "../helpers/validateSpec.js"; diff --git a/packages/specs/schema/test/integrations/pageable.integration.spec.ts b/packages/specs/schema/test/integrations/pageable.integration.spec.ts index 4f19f2080d8..fa478d6762a 100644 --- a/packages/specs/schema/test/integrations/pageable.integration.spec.ts +++ b/packages/specs/schema/test/integrations/pageable.integration.spec.ts @@ -9,9 +9,9 @@ import { getSpec, In, Integer, - Name, Min, MinLength, + Name, oneOf, OperationPath, Path, @@ -92,8 +92,8 @@ class Product { @Path("/pageable") class TestPageableCtrl { @OperationPath("GET", "/") - @Returns(206, Pagination).Of(Product).Title("PaginatedProduct") - @Returns(200, Pagination).Of(Product).Title("PaginatedProduct") + @(Returns(206, Pagination).Of(Product).Title("PaginatedProduct")) + @(Returns(200, Pagination).Of(Product).Title("PaginatedProduct")) get(@In("query") pageableOptions: Pageable, @In("query") @Name("all") all: boolean) { return new Pagination({ data: [ diff --git a/packages/specs/schema/test/integrations/partial.integration.spec.ts b/packages/specs/schema/test/integrations/partial.integration.spec.ts index c0a67cb1ca0..4b75db764e2 100644 --- a/packages/specs/schema/test/integrations/partial.integration.spec.ts +++ b/packages/specs/schema/test/integrations/partial.integration.spec.ts @@ -1,6 +1,7 @@ import {Controller} from "@tsed/di"; import {BodyParams} from "@tsed/platform-params"; -import {CollectionOf, Groups, Partial, Patch, Required, Post, getSpec} from "../../src/index.js"; + +import {CollectionOf, getSpec, Groups, Partial, Patch, Post, Required} from "../../src/index.js"; class Product { @Required() diff --git a/packages/specs/schema/test/integrations/petstore.integration.spec.ts b/packages/specs/schema/test/integrations/petstore.integration.spec.ts index 9c4b98f3116..ca599dc8efb 100644 --- a/packages/specs/schema/test/integrations/petstore.integration.spec.ts +++ b/packages/specs/schema/test/integrations/petstore.integration.spec.ts @@ -1,6 +1,9 @@ +import "../.."; + import {Controller} from "@tsed/di"; import {Use} from "@tsed/platform-middlewares"; import {BodyParams, PathParams} from "@tsed/platform-params"; + import { CollectionOf, Delete, @@ -22,7 +25,6 @@ import { SpecTypes, Subscribe } from "../../src/index.js"; -import "@tsed/schema"; class PetCategory { @Required() @@ -68,7 +70,7 @@ class PetController { @Get("/:id") @Publish("pet.get") @Subscribe("pet.get") - @Returns(200, Pet).Description("Returns a pet") + @(Returns(200, Pet).Description("Returns a pet")) @Returns(404) get(@PathParams("id") id: string) { return null; @@ -77,7 +79,7 @@ class PetController { @Get("/") @Publish("pet.getAll") @Subscribe("pet.getAll") - @Returns(200, Array).Of(Pet).Description("Returns all pets") + @(Returns(200, Array).Of(Pet).Description("Returns all pets")) getAll() { return []; } @@ -85,7 +87,7 @@ class PetController { @Patch("/:id") @Publish("pet.patch") @Subscribe("pet.updated") - @Returns(200, Pet).Description("Returns a pet") + @(Returns(200, Pet).Description("Returns a pet")) @Returns(404) @Description("Patch a pet") patch(@PathParams("id") id: string, @BodyParams() @Partial() partial: Pet) { @@ -95,7 +97,7 @@ class PetController { @Post("/:id") @Publish("pet.update") @Subscribe("pet.created") - @Returns(200, Pet).Description("Returns a pet") + @(Returns(200, Pet).Description("Returns a pet")) @Returns(404) @Description("Update a pet") post(@BodyParams() @Groups("update") pet: Pet) { diff --git a/packages/specs/schema/test/integrations/query-model-examples.spec.ts b/packages/specs/schema/test/integrations/query-model-examples.spec.ts index 552a2456b5c..cdbe03842bd 100644 --- a/packages/specs/schema/test/integrations/query-model-examples.spec.ts +++ b/packages/specs/schema/test/integrations/query-model-examples.spec.ts @@ -1,3 +1,5 @@ +import {QueryParams} from "@tsed/platform-params"; + import { Default, Examples, @@ -12,7 +14,6 @@ import { Property, SpecTypes } from "../../src/index.js"; -import {QueryParams} from "@tsed/platform-params"; class QueryParamModel { @Property() diff --git a/packages/specs/schema/test/integrations/response.binary.integration.spec.ts b/packages/specs/schema/test/integrations/response.binary.integration.spec.ts index 1fd11cc2714..af7c561753e 100644 --- a/packages/specs/schema/test/integrations/response.binary.integration.spec.ts +++ b/packages/specs/schema/test/integrations/response.binary.integration.spec.ts @@ -1,11 +1,12 @@ import {QueryParams} from "@tsed/platform-params"; + import {getSpec, OperationPath, Path, Property, Returns, SpecTypes} from "../../src/index.js"; import {validateSpec} from "../helpers/validateSpec.js"; @Path("/responses") class TestResponseCtrl { @OperationPath("GET", "/:id") - @Returns(200).Binary() + @(Returns(200).Binary()) async scenario1(@QueryParams("id") id: string) {} } diff --git a/packages/specs/schema/test/integrations/response.integration.spec.ts b/packages/specs/schema/test/integrations/response.integration.spec.ts index 48aeab0edb3..b2efa7af716 100644 --- a/packages/specs/schema/test/integrations/response.integration.spec.ts +++ b/packages/specs/schema/test/integrations/response.integration.spec.ts @@ -1,4 +1,5 @@ import {QueryParams} from "@tsed/platform-params"; + import {getSpec, OperationPath, Path, Property, Returns, SpecTypes} from "../../src/index.js"; import {validateSpec} from "../helpers/validateSpec.js"; @@ -18,7 +19,7 @@ class Product { @Path("/responses") class TestResponseCtrl { @OperationPath("GET", "/:id") - @Returns(200, Product).Description("Product") + @(Returns(200, Product).Description("Product")) async scenario1(@QueryParams("id") id: string) {} @OperationPath("POST", "/") diff --git a/packages/specs/schema/test/integrations/union-types.integration.spec.ts b/packages/specs/schema/test/integrations/union-types.integration.spec.ts index bae444b9ece..ad22cd2798d 100644 --- a/packages/specs/schema/test/integrations/union-types.integration.spec.ts +++ b/packages/specs/schema/test/integrations/union-types.integration.spec.ts @@ -1,4 +1,6 @@ import Ajv from "ajv"; +import {describe, expect, it} from "vitest"; + import {AdditionalProperties, AnyOf, array, Enum, getJsonSchema, string} from "../../src/index.js"; describe("Union on model", () => { @@ -39,6 +41,7 @@ describe("Union on model", () => { type: "object" }); + // @ts-ignore const ajv = new Ajv({}); expect( @@ -81,6 +84,7 @@ describe("Union on model", () => { type: "object" }); + // @ts-ignore const ajv = new Ajv({ coerceTypes: "array" }); diff --git a/packages/specs/schema/tsconfig.esm.json b/packages/specs/schema/tsconfig.esm.json index e3b07081667..82292550ddb 100644 --- a/packages/specs/schema/tsconfig.esm.json +++ b/packages/specs/schema/tsconfig.esm.json @@ -2,8 +2,7 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "module": "ESNext", - "moduleResolution": "nodenext", + "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", @@ -11,7 +10,7 @@ "composite": true, "noEmit": false }, - "include": ["src", "src/**/*.json"], + "include": ["src/**/*.ts", "src/**/*.json"], "exclude": [ "node_modules", "test", diff --git a/packages/specs/schema/tsconfig.spec.json b/packages/specs/schema/tsconfig.spec.json index b268f367ea3..9ef235f9036 100644 --- a/packages/specs/schema/tsconfig.spec.json +++ b/packages/specs/schema/tsconfig.spec.json @@ -3,7 +3,6 @@ "compilerOptions": { "baseUrl": ".", "rootDir": "../..", - "module": "commonjs", "outDir": "./lib/cjs", "declaration": false, "composite": false, diff --git a/packages/specs/swagger/package.json b/packages/specs/swagger/package.json index 790477e8387..d6a1ab0d489 100644 --- a/packages/specs/swagger/package.json +++ b/packages/specs/swagger/package.json @@ -45,7 +45,7 @@ "@types/swagger-ui-dist": "3.30.4", "eslint": "^8.57.0", "ts-node": "10.9.2", - "typescript": "4.9.5", + "typescript": "5.6.2", "vitest": "2.0.4" }, "peerDependencies": { diff --git a/packages/specs/swagger/src/SwaggerModule.spec.ts b/packages/specs/swagger/src/SwaggerModule.spec.ts index 11ec0a7b489..988104c48a2 100644 --- a/packages/specs/swagger/src/SwaggerModule.spec.ts +++ b/packages/specs/swagger/src/SwaggerModule.spec.ts @@ -1,8 +1,9 @@ import {PlatformRouter, PlatformTest} from "@tsed/common"; import Fs from "fs"; -import {SwaggerModule} from "./SwaggerModule.js"; import {absolutePath} from "swagger-ui-dist"; +import {SwaggerModule} from "./SwaggerModule.js"; + describe("SwaggerModule", () => { beforeEach(() => PlatformTest.create({ diff --git a/packages/specs/swagger/src/SwaggerModule.ts b/packages/specs/swagger/src/SwaggerModule.ts index 816fa36c83d..a4531895422 100644 --- a/packages/specs/swagger/src/SwaggerModule.ts +++ b/packages/specs/swagger/src/SwaggerModule.ts @@ -14,6 +14,7 @@ import {normalizePath} from "@tsed/normalize-path"; import {PlatformRouter, useContextHandler} from "@tsed/platform-router"; import Fs from "fs"; import {join} from "path"; + import {ROOT_DIR, SWAGGER_UI_DIST} from "./constants.js"; import {SwaggerSettings} from "./interfaces/SwaggerSettings.js"; import {cssMiddleware} from "./middlewares/cssMiddleware.js"; diff --git a/packages/specs/swagger/src/middlewares/cssMiddleware.spec.ts b/packages/specs/swagger/src/middlewares/cssMiddleware.spec.ts index 26f9079943c..b8d53fcdbe8 100644 --- a/packages/specs/swagger/src/middlewares/cssMiddleware.spec.ts +++ b/packages/specs/swagger/src/middlewares/cssMiddleware.spec.ts @@ -1,5 +1,6 @@ import {PlatformTest} from "@tsed/common"; import Fs from "fs"; + import {cssMiddleware} from "./cssMiddleware.js"; describe("cssMiddleware", () => { diff --git a/packages/specs/swagger/src/middlewares/indexMiddleware.spec.ts b/packages/specs/swagger/src/middlewares/indexMiddleware.spec.ts index 8fa1f008282..900e231ec21 100644 --- a/packages/specs/swagger/src/middlewares/indexMiddleware.spec.ts +++ b/packages/specs/swagger/src/middlewares/indexMiddleware.spec.ts @@ -1,4 +1,5 @@ import {PlatformTest} from "@tsed/common"; + import {indexMiddleware} from "./indexMiddleware.js"; describe("indexMiddleware and redirect", () => { diff --git a/packages/specs/swagger/src/middlewares/indexMiddleware.ts b/packages/specs/swagger/src/middlewares/indexMiddleware.ts index c76a457d55e..a965db2d495 100644 --- a/packages/specs/swagger/src/middlewares/indexMiddleware.ts +++ b/packages/specs/swagger/src/middlewares/indexMiddleware.ts @@ -1,4 +1,5 @@ import {PlatformContext} from "@tsed/common"; + import {SwaggerSettings} from "../interfaces/SwaggerSettings.js"; /** diff --git a/packages/specs/swagger/src/middlewares/jsMiddleware.spec.ts b/packages/specs/swagger/src/middlewares/jsMiddleware.spec.ts index 3f2fdcdef93..c2c7a924437 100644 --- a/packages/specs/swagger/src/middlewares/jsMiddleware.spec.ts +++ b/packages/specs/swagger/src/middlewares/jsMiddleware.spec.ts @@ -1,5 +1,6 @@ import {PlatformTest} from "@tsed/common"; import Fs from "fs"; + import {jsMiddleware} from "./jsMiddleware.js"; describe("jsMiddleware", () => { diff --git a/packages/specs/swagger/src/middlewares/redirectMiddleware.spec.ts b/packages/specs/swagger/src/middlewares/redirectMiddleware.spec.ts index 614c4d51a52..5e54361617a 100644 --- a/packages/specs/swagger/src/middlewares/redirectMiddleware.spec.ts +++ b/packages/specs/swagger/src/middlewares/redirectMiddleware.spec.ts @@ -1,4 +1,5 @@ import {PlatformTest} from "@tsed/common"; + import {redirectMiddleware} from "./redirectMiddleware.js"; describe("redirectMiddleware and redirect", () => { diff --git a/packages/specs/swagger/src/services/SwaggerService.spec.ts b/packages/specs/swagger/src/services/SwaggerService.spec.ts index 00f79e5e2aa..0bdd185ea51 100644 --- a/packages/specs/swagger/src/services/SwaggerService.spec.ts +++ b/packages/specs/swagger/src/services/SwaggerService.spec.ts @@ -1,4 +1,5 @@ import {PlatformTest} from "@tsed/common"; + import {SwaggerService} from "../index.js"; describe("SwaggerService", () => { diff --git a/packages/specs/swagger/src/services/SwaggerService.ts b/packages/specs/swagger/src/services/SwaggerService.ts index 72f04fecb19..518b669f748 100644 --- a/packages/specs/swagger/src/services/SwaggerService.ts +++ b/packages/specs/swagger/src/services/SwaggerService.ts @@ -2,6 +2,7 @@ import {Configuration, Injectable, InjectorService, Platform} from "@tsed/common import type {Type} from "@tsed/core"; import {OpenSpec2, OpenSpec3} from "@tsed/openspec"; import {generateSpec} from "@tsed/schema"; + import {SwaggerOS2Settings, SwaggerOS3Settings, SwaggerSettings} from "../interfaces/SwaggerSettings.js"; import {includeRoute} from "../utils/includeRoute.js"; diff --git a/packages/specs/swagger/src/utils/includeRoute.spec.ts b/packages/specs/swagger/src/utils/includeRoute.spec.ts index 49abd3f4a85..ca3eeb6af4c 100644 --- a/packages/specs/swagger/src/utils/includeRoute.spec.ts +++ b/packages/specs/swagger/src/utils/includeRoute.spec.ts @@ -1,5 +1,6 @@ import {ControllerProvider} from "@tsed/common"; import {Hidden} from "@tsed/schema"; + import {Docs} from "../decorators/docs.js"; import {includeRoute} from "./includeRoute.js"; diff --git a/packages/specs/swagger/src/utils/includeRoute.ts b/packages/specs/swagger/src/utils/includeRoute.ts index 028068da236..3fe2d922d59 100644 --- a/packages/specs/swagger/src/utils/includeRoute.ts +++ b/packages/specs/swagger/src/utils/includeRoute.ts @@ -1,4 +1,5 @@ import {Provider} from "@tsed/di"; + import {SwaggerSettings} from "../interfaces/SwaggerSettings.js"; import {matchPath} from "./matchPath.js"; diff --git a/packages/specs/swagger/test/app/Server.ts b/packages/specs/swagger/test/app/Server.ts index 8d6ed6376e6..b72db5f93f5 100644 --- a/packages/specs/swagger/test/app/Server.ts +++ b/packages/specs/swagger/test/app/Server.ts @@ -1,6 +1,7 @@ -import {Configuration, Inject, PlatformApplication} from "@tsed/common"; import "@tsed/platform-express"; -import "@tsed/swagger"; +import "../.."; + +import {Configuration, Inject, PlatformApplication} from "@tsed/common"; import bodyParser from "body-parser"; import compress from "compression"; import cookieParser from "cookie-parser"; diff --git a/packages/specs/swagger/test/app/class/classes.ts b/packages/specs/swagger/test/app/class/classes.ts index 5ae893fda8d..4dd25227c20 100644 --- a/packages/specs/swagger/test/app/class/classes.ts +++ b/packages/specs/swagger/test/app/class/classes.ts @@ -1,4 +1,4 @@ -import {Example, Any, CollectionOf, Description, Name, Property, Required, Title} from "@tsed/schema"; +import {Any, CollectionOf, Description, Example, Name, Property, Required, Title} from "@tsed/schema"; export class SwaNoDecoModel { public prop: string; diff --git a/packages/specs/swagger/test/app/index.ts b/packages/specs/swagger/test/app/index.ts index 502949ccd6d..5454739880b 100644 --- a/packages/specs/swagger/test/app/index.ts +++ b/packages/specs/swagger/test/app/index.ts @@ -1,7 +1,8 @@ import {$log, BodyParams, Controller, Get, PathParams, Post, Put, QueryParams} from "@tsed/common"; import {PlatformExpress} from "@tsed/platform-express"; import {DiscriminatorKey, DiscriminatorValue, OneOf, Property, Required, Returns} from "@tsed/schema"; -import {Hidden} from "@tsed/swagger"; + +import {Hidden} from "../.."; import {Server} from "./Server.js"; if (process.env.NODE_ENV !== "test") { @@ -86,19 +87,19 @@ if (process.env.NODE_ENV !== "test") { @Controller("/one-of") class HelloOneOf { @Post("/") - @Returns(200, Array).OneOf(Event) + @(Returns(200, Array).OneOf(Event)) post(@BodyParams() @OneOf(Event) events: OneOfEvents[]) { return []; } @Put("/:id") - @Returns(200).OneOf(Event) + @(Returns(200).OneOf(Event)) put(@PathParams(":id") id: string, @BodyParams() @OneOf(Event) event: OneOfEvents) { return []; } @Get("/:id") - @Returns(200).OneOf(Event) + @(Returns(200).OneOf(Event)) get(@PathParams(":id") id: string) { return []; } diff --git a/packages/specs/swagger/test/swagger.anyof.spec.ts b/packages/specs/swagger/test/swagger.anyof.spec.ts index d3d156823c5..0bf8cd1fe09 100644 --- a/packages/specs/swagger/test/swagger.anyof.spec.ts +++ b/packages/specs/swagger/test/swagger.anyof.spec.ts @@ -3,6 +3,7 @@ import {ObjectID} from "@tsed/mongoose"; import {PlatformExpress} from "@tsed/platform-express"; import {AnyOf, Required, Returns} from "@tsed/schema"; import SuperTest from "supertest"; + import {Server} from "./app/Server.js"; export class ListAbandonTask { diff --git a/packages/specs/swagger/test/swagger.bodyparams.spec.ts b/packages/specs/swagger/test/swagger.bodyparams.spec.ts index 132bbd6ad55..5cedd7be77a 100644 --- a/packages/specs/swagger/test/swagger.bodyparams.spec.ts +++ b/packages/specs/swagger/test/swagger.bodyparams.spec.ts @@ -2,6 +2,7 @@ import {BodyParams, Controller, PlatformTest, Post} from "@tsed/common"; import {PlatformExpress} from "@tsed/platform-express"; import {MaxLength, MinLength} from "@tsed/schema"; import SuperTest from "supertest"; + import {Server} from "./app/Server.js"; @Controller({ diff --git a/packages/specs/swagger/test/swagger.children.spec.ts b/packages/specs/swagger/test/swagger.children.spec.ts index 70dd668ec38..29f3f6897f5 100644 --- a/packages/specs/swagger/test/swagger.children.spec.ts +++ b/packages/specs/swagger/test/swagger.children.spec.ts @@ -1,6 +1,7 @@ import {Controller, Get, PlatformTest} from "@tsed/common"; import {PlatformExpress} from "@tsed/platform-express"; import SuperTest from "supertest"; + import {Server} from "./app/Server.js"; @Controller("/:campaignID/polls") diff --git a/packages/specs/swagger/test/swagger.errors.spec.ts b/packages/specs/swagger/test/swagger.errors.spec.ts index 1db1243af5a..7e7f0899eac 100644 --- a/packages/specs/swagger/test/swagger.errors.spec.ts +++ b/packages/specs/swagger/test/swagger.errors.spec.ts @@ -2,6 +2,7 @@ import {Controller, Get, PlatformTest} from "@tsed/common"; import {PlatformExpress} from "@tsed/platform-express"; import {Required, Returns} from "@tsed/schema"; import SuperTest from "supertest"; + import {Server} from "./app/Server.js"; export class TestModel200 { diff --git a/packages/specs/swagger/test/swagger.integration.spec.ts b/packages/specs/swagger/test/swagger.integration.spec.ts index 46e97f94b55..2b7bc9a8d31 100644 --- a/packages/specs/swagger/test/swagger.integration.spec.ts +++ b/packages/specs/swagger/test/swagger.integration.spec.ts @@ -2,8 +2,9 @@ import {BodyParams, Controller, Get, PathParams, PlatformTest, Post} from "@tsed import {ObjectID} from "@tsed/mongoose"; import {PlatformExpress} from "@tsed/platform-express"; import {Consumes, Description, Returns} from "@tsed/schema"; -import {Docs, Hidden} from "@tsed/swagger"; import SuperTest from "supertest"; + +import {Docs, Hidden} from ".."; import {Calendar} from "./app/models/Calendar.js"; import {Server} from "./app/Server.js"; @@ -41,14 +42,14 @@ class CalendarsController { } @Get("/") - @Returns(200, Array).Of(Calendar) + @(Returns(200, Array).Of(Calendar)) getAll(): Promise { return Promise.resolve([new Calendar({id: 1, name: "name"}), new Calendar({id: 2, name: "name"})]); } @Post("/csv") @Consumes("text/plain") - @Returns(200, String).ContentType("text/plain") + @(Returns(200, String).ContentType("text/plain")) csv(@BodyParams() csvLines: string): Promise { return Promise.resolve(""); } diff --git a/packages/specs/swagger/test/swagger.nested-controllers.spec.ts b/packages/specs/swagger/test/swagger.nested-controllers.spec.ts index 5da58e0213b..50dbb40a0cc 100644 --- a/packages/specs/swagger/test/swagger.nested-controllers.spec.ts +++ b/packages/specs/swagger/test/swagger.nested-controllers.spec.ts @@ -1,6 +1,7 @@ import {Controller, Get, PlatformTest, Post} from "@tsed/common"; import {PlatformExpress} from "@tsed/platform-express"; import SuperTest from "supertest"; + import {Server} from "./app/Server.js"; @Controller("/") diff --git a/packages/specs/swagger/test/swagger.operationId.spec.ts b/packages/specs/swagger/test/swagger.operationId.spec.ts index c5aec784181..2f28ff05fe1 100644 --- a/packages/specs/swagger/test/swagger.operationId.spec.ts +++ b/packages/specs/swagger/test/swagger.operationId.spec.ts @@ -2,8 +2,9 @@ import {BodyParams, Controller, Get, PathParams, PlatformTest, Post} from "@tsed import {ObjectID} from "@tsed/mongoose"; import {PlatformExpress} from "@tsed/platform-express"; import {Consumes, Description, Returns} from "@tsed/schema"; -import {Docs, Hidden} from "@tsed/swagger"; import SuperTest from "supertest"; + +import {Docs, Hidden} from ".."; import {Calendar} from "./app/models/Calendar.js"; import {Server} from "./app/Server.js"; @@ -41,14 +42,14 @@ class CalendarsController { } @Get("/") - @Returns(200, Array).Of(Calendar) + @(Returns(200, Array).Of(Calendar)) getAll(): Promise { return Promise.resolve([new Calendar({id: 1, name: "name"}), new Calendar({id: 2, name: "name"})]); } @Post("/csv") @Consumes("text/plain") - @Returns(200, String).ContentType("text/plain") + @(Returns(200, String).ContentType("text/plain")) csv(@BodyParams() csvLines: string): Promise { return Promise.resolve(""); } diff --git a/packages/specs/swagger/test/swagger.path-patterns.spec.ts b/packages/specs/swagger/test/swagger.path-patterns.spec.ts index 087be7b9171..ee47168b6ab 100644 --- a/packages/specs/swagger/test/swagger.path-patterns.spec.ts +++ b/packages/specs/swagger/test/swagger.path-patterns.spec.ts @@ -3,6 +3,7 @@ import {ObjectID} from "@tsed/mongoose"; import {PlatformExpress} from "@tsed/platform-express"; import {Consumes, Returns} from "@tsed/schema"; import SuperTest from "supertest"; + import {Calendar} from "./app/models/Calendar.js"; import {Server} from "./app/Server.js"; @@ -26,14 +27,14 @@ class CalendarsController { } @Get("/") - @Returns(200, Array).Of(Calendar) + @(Returns(200, Array).Of(Calendar)) getAll(): Promise { return Promise.resolve([new Calendar({id: 1, name: "name"}), new Calendar({id: 2, name: "name"})]); } @Post("/csv") @Consumes("text/plain") - @Returns(200, String).ContentType("text/plain") + @(Returns(200, String).ContentType("text/plain")) csv(@BodyParams() csvLines: string): Promise { return Promise.resolve(""); } diff --git a/packages/specs/swagger/test/swagger.query.spec.ts b/packages/specs/swagger/test/swagger.query.spec.ts index a88d24f8f65..29206dcd00e 100644 --- a/packages/specs/swagger/test/swagger.query.spec.ts +++ b/packages/specs/swagger/test/swagger.query.spec.ts @@ -2,6 +2,7 @@ import {Controller, Get, PlatformTest, QueryParams} from "@tsed/common"; import {PlatformExpress} from "@tsed/platform-express"; import {MinLength, Property, Required} from "@tsed/schema"; import SuperTest from "supertest"; + import {Server} from "./app/Server.js"; class QueryParamModel { diff --git a/packages/specs/swagger/tsconfig.esm.json b/packages/specs/swagger/tsconfig.esm.json index e3b07081667..82292550ddb 100644 --- a/packages/specs/swagger/tsconfig.esm.json +++ b/packages/specs/swagger/tsconfig.esm.json @@ -2,8 +2,7 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "module": "ESNext", - "moduleResolution": "nodenext", + "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", @@ -11,7 +10,7 @@ "composite": true, "noEmit": false }, - "include": ["src", "src/**/*.json"], + "include": ["src/**/*.ts", "src/**/*.json"], "exclude": [ "node_modules", "test", diff --git a/packages/specs/swagger/tsconfig.spec.json b/packages/specs/swagger/tsconfig.spec.json index a63ff22c0c0..8d9c26b5d5a 100644 --- a/packages/specs/swagger/tsconfig.spec.json +++ b/packages/specs/swagger/tsconfig.spec.json @@ -3,7 +3,6 @@ "compilerOptions": { "baseUrl": ".", "rootDir": "../..", - "module": "commonjs", "outDir": "./lib/cjs", "declaration": false, "composite": false, diff --git a/packages/third-parties/agenda/package.json b/packages/third-parties/agenda/package.json index 27499e9ee5d..b162a513972 100644 --- a/packages/third-parties/agenda/package.json +++ b/packages/third-parties/agenda/package.json @@ -37,7 +37,7 @@ "@tsed/typescript": "workspace:*", "agenda": "^5.0.0", "eslint": "^8.57.0", - "typescript": "4.9.5", + "typescript": "5.6.2", "vitest": "2.0.4" }, "peerDependencies": { diff --git a/packages/third-parties/agenda/src/AgendaModule.spec.ts b/packages/third-parties/agenda/src/AgendaModule.spec.ts index c6adffd0cf9..fc14d24f878 100644 --- a/packages/third-parties/agenda/src/AgendaModule.spec.ts +++ b/packages/third-parties/agenda/src/AgendaModule.spec.ts @@ -1,6 +1,7 @@ import {PlatformTest} from "@tsed/common"; import {Inject} from "@tsed/di"; import type {Job} from "agenda"; + import {AgendaModule} from "./AgendaModule.js"; import {Agenda} from "./decorators/agenda.js"; import {Define} from "./decorators/define.js"; diff --git a/packages/third-parties/agenda/src/AgendaModule.ts b/packages/third-parties/agenda/src/AgendaModule.ts index f6a8a51ad21..18439c96a92 100644 --- a/packages/third-parties/agenda/src/AgendaModule.ts +++ b/packages/third-parties/agenda/src/AgendaModule.ts @@ -2,6 +2,7 @@ import {AfterListen, DIContext, Logger, OnDestroy, runInContext} from "@tsed/com import {Constant, Inject, InjectorService, Module, Provider} from "@tsed/di"; import {Job, Processor} from "agenda"; import {v4 as uuid} from "uuid"; + import {PROVIDER_TYPE_AGENDA} from "./constants/constants.js"; import {AgendaStore} from "./interfaces/AgendaStore.js"; import {AgendaService} from "./services/AgendaFactory.js"; diff --git a/packages/third-parties/agenda/src/decorators/agenda.spec.ts b/packages/third-parties/agenda/src/decorators/agenda.spec.ts index 3cd47074358..7ef86d67c14 100644 --- a/packages/third-parties/agenda/src/decorators/agenda.spec.ts +++ b/packages/third-parties/agenda/src/decorators/agenda.spec.ts @@ -1,4 +1,5 @@ import {Store} from "@tsed/core"; + import {Agenda} from "./agenda.js"; describe("@Agenda()", () => { diff --git a/packages/third-parties/agenda/src/decorators/agenda.ts b/packages/third-parties/agenda/src/decorators/agenda.ts index 0a624183862..752a9dd27ce 100644 --- a/packages/third-parties/agenda/src/decorators/agenda.ts +++ b/packages/third-parties/agenda/src/decorators/agenda.ts @@ -1,5 +1,6 @@ import {StoreMerge, useDecorators} from "@tsed/core"; import {Injectable} from "@tsed/di"; + import {PROVIDER_TYPE_AGENDA} from "../constants/constants.js"; interface AgendaOptions { diff --git a/packages/third-parties/agenda/src/decorators/define.spec.ts b/packages/third-parties/agenda/src/decorators/define.spec.ts index 516ec82ce6d..1243bc7689a 100644 --- a/packages/third-parties/agenda/src/decorators/define.spec.ts +++ b/packages/third-parties/agenda/src/decorators/define.spec.ts @@ -1,4 +1,5 @@ import {Store} from "@tsed/core"; + import {Agenda} from "./agenda.js"; import {Define} from "./define.js"; diff --git a/packages/third-parties/agenda/src/decorators/define.ts b/packages/third-parties/agenda/src/decorators/define.ts index 11fb8b648ff..84658741e6a 100644 --- a/packages/third-parties/agenda/src/decorators/define.ts +++ b/packages/third-parties/agenda/src/decorators/define.ts @@ -1,4 +1,5 @@ import {Store} from "@tsed/core"; + import {AgendaStore, DefineOptions} from "../interfaces/AgendaStore.js"; export function Define(options: DefineOptions = {}): MethodDecorator { diff --git a/packages/third-parties/agenda/src/decorators/every.spec.ts b/packages/third-parties/agenda/src/decorators/every.spec.ts index b60981b1b9b..aeb261ff15a 100644 --- a/packages/third-parties/agenda/src/decorators/every.spec.ts +++ b/packages/third-parties/agenda/src/decorators/every.spec.ts @@ -1,4 +1,5 @@ import {descriptorOf, Store} from "@tsed/core"; + import {Agenda} from "./agenda.js"; import {Every} from "./every.js"; diff --git a/packages/third-parties/agenda/src/decorators/every.ts b/packages/third-parties/agenda/src/decorators/every.ts index 644d5c74bb0..44b03def70f 100644 --- a/packages/third-parties/agenda/src/decorators/every.ts +++ b/packages/third-parties/agenda/src/decorators/every.ts @@ -1,6 +1,7 @@ import {Store, useDecorators} from "@tsed/core"; -import {Define} from "./define.js"; + import {AgendaStore, EveryOptions} from "../interfaces/AgendaStore.js"; +import {Define} from "./define.js"; export function Every(interval: string, options: EveryOptions = {}): MethodDecorator { return useDecorators(Define(options), (target: any, propertyKey: string) => { diff --git a/packages/third-parties/agenda/test/agenda-define-manually.integration.spec.ts b/packages/third-parties/agenda/test/agenda-define-manually.integration.spec.ts index 4b7d0d9e19d..3b61c57c716 100644 --- a/packages/third-parties/agenda/test/agenda-define-manually.integration.spec.ts +++ b/packages/third-parties/agenda/test/agenda-define-manually.integration.spec.ts @@ -1,9 +1,9 @@ import {PlatformTest} from "@tsed/common"; import {Inject} from "@tsed/di"; import {TestContainersMongo} from "@tsed/testcontainers-mongo"; - import type {Job} from "agenda"; -import {AgendaModule, Agenda, AgendaService, Define} from "@tsed/agenda"; + +import {Agenda, AgendaModule, AgendaService, Define} from ".."; import {Server} from "./helpers/Server.js"; @Agenda({namespace: "test-nsp"}) diff --git a/packages/third-parties/agenda/test/agenda-define.integration.spec.ts b/packages/third-parties/agenda/test/agenda-define.integration.spec.ts index 8f5d9e25e19..1f464768719 100644 --- a/packages/third-parties/agenda/test/agenda-define.integration.spec.ts +++ b/packages/third-parties/agenda/test/agenda-define.integration.spec.ts @@ -1,5 +1,6 @@ import {PlatformTest} from "@tsed/common"; import {TestContainersMongo} from "@tsed/testcontainers-mongo"; + import {Agenda, AgendaService, Define, Every} from "../src/index.js"; import {Server} from "./helpers/Server.js"; diff --git a/packages/third-parties/agenda/test/agenda-every.integration.spec.ts b/packages/third-parties/agenda/test/agenda-every.integration.spec.ts index 00996276dc7..505a3b1b471 100644 --- a/packages/third-parties/agenda/test/agenda-every.integration.spec.ts +++ b/packages/third-parties/agenda/test/agenda-every.integration.spec.ts @@ -1,5 +1,6 @@ import {PlatformTest} from "@tsed/common"; import {TestContainersMongo} from "@tsed/testcontainers-mongo"; + import {Agenda, AgendaService, Every} from "../src/index.js"; import {Server} from "./helpers/Server.js"; diff --git a/packages/third-parties/agenda/test/helpers/Server.ts b/packages/third-parties/agenda/test/helpers/Server.ts index 53b939ffa8a..8540e323d19 100644 --- a/packages/third-parties/agenda/test/helpers/Server.ts +++ b/packages/third-parties/agenda/test/helpers/Server.ts @@ -1,9 +1,10 @@ -import {Configuration, Inject, PlatformApplication} from "@tsed/common"; import "@tsed/platform-express"; -import "@tsed/agenda"; -import cookieParser from "cookie-parser"; +import "../.."; + +import {Configuration, Inject, PlatformApplication} from "@tsed/common"; import bodyParser from "body-parser"; import compress from "compression"; +import cookieParser from "cookie-parser"; import methodOverride from "method-override"; const rootDir = import.meta.dirname; diff --git a/packages/third-parties/agenda/tsconfig.esm.json b/packages/third-parties/agenda/tsconfig.esm.json index e3b07081667..82292550ddb 100644 --- a/packages/third-parties/agenda/tsconfig.esm.json +++ b/packages/third-parties/agenda/tsconfig.esm.json @@ -2,8 +2,7 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "module": "ESNext", - "moduleResolution": "nodenext", + "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", @@ -11,7 +10,7 @@ "composite": true, "noEmit": false }, - "include": ["src", "src/**/*.json"], + "include": ["src/**/*.ts", "src/**/*.json"], "exclude": [ "node_modules", "test", diff --git a/packages/third-parties/agenda/tsconfig.spec.json b/packages/third-parties/agenda/tsconfig.spec.json index b2e248f2c69..9835f975711 100644 --- a/packages/third-parties/agenda/tsconfig.spec.json +++ b/packages/third-parties/agenda/tsconfig.spec.json @@ -3,7 +3,6 @@ "compilerOptions": { "baseUrl": ".", "rootDir": "../..", - "module": "commonjs", "outDir": "./lib/cjs", "declaration": false, "composite": false, diff --git a/packages/third-parties/bullmq/package.json b/packages/third-parties/bullmq/package.json index f89ce6c1684..4e90d602c0c 100644 --- a/packages/third-parties/bullmq/package.json +++ b/packages/third-parties/bullmq/package.json @@ -38,7 +38,7 @@ "bullmq": "^4.12.3 || ^5.1.1", "eslint": "^8.57.0", "ts-mockito": "^2.6.1", - "typescript": "4.9.5", + "typescript": "5.6.2", "vitest": "2.0.4" }, "peerDependencies": { diff --git a/packages/third-parties/bullmq/src/BullMQModule.spec.ts b/packages/third-parties/bullmq/src/BullMQModule.spec.ts index 759f3ae65d5..db652544f17 100644 --- a/packages/third-parties/bullmq/src/BullMQModule.spec.ts +++ b/packages/third-parties/bullmq/src/BullMQModule.spec.ts @@ -1,9 +1,10 @@ +import "./BullMQModule.js"; + import {Inject, PlatformTest} from "@tsed/common"; import {catchAsyncError} from "@tsed/core"; import {Queue, Worker} from "bullmq"; import {anything, instance, mock, verify, when} from "ts-mockito"; -import "./BullMQModule.js"; import {BullMQModule} from "./BullMQModule.js"; import {type BullMQConfig} from "./config/config.js"; import {JobMethods} from "./contracts/index.js"; diff --git a/packages/third-parties/bullmq/src/BullMQModule.ts b/packages/third-parties/bullmq/src/BullMQModule.ts index 7b83a18c639..3a91b3c714e 100644 --- a/packages/third-parties/bullmq/src/BullMQModule.ts +++ b/packages/third-parties/bullmq/src/BullMQModule.ts @@ -3,6 +3,7 @@ import {InjectorService, Module} from "@tsed/di"; import {getComputedType} from "@tsed/schema"; import {Job, Queue, Worker} from "bullmq"; import {v4} from "uuid"; + import {BullMQConfig} from "./config/config.js"; import {BullMQTypes} from "./constants/BullMQTypes.js"; import {BULLMQ} from "./constants/constants.js"; diff --git a/packages/third-parties/bullmq/src/decorators/InjectQueue.ts b/packages/third-parties/bullmq/src/decorators/InjectQueue.ts index e94bf5fd215..a150a21da05 100644 --- a/packages/third-parties/bullmq/src/decorators/InjectQueue.ts +++ b/packages/third-parties/bullmq/src/decorators/InjectQueue.ts @@ -1,4 +1,5 @@ import {Inject} from "@tsed/common"; + import {getQueueToken} from "../utils/getQueueToken.js"; export function InjectQueue(name: string) { diff --git a/packages/third-parties/bullmq/src/decorators/InjectWorker.ts b/packages/third-parties/bullmq/src/decorators/InjectWorker.ts index a528e64eed2..258f568280b 100644 --- a/packages/third-parties/bullmq/src/decorators/InjectWorker.ts +++ b/packages/third-parties/bullmq/src/decorators/InjectWorker.ts @@ -1,4 +1,5 @@ import {Inject} from "@tsed/common"; + import {getWorkerToken} from "../utils/getWorkerToken.js"; export function InjectWorker(name: string) { diff --git a/packages/third-parties/bullmq/src/decorators/JobController.spec.ts b/packages/third-parties/bullmq/src/decorators/JobController.spec.ts index ad5e00eb479..f5618407738 100644 --- a/packages/third-parties/bullmq/src/decorators/JobController.spec.ts +++ b/packages/third-parties/bullmq/src/decorators/JobController.spec.ts @@ -1,7 +1,8 @@ -import {FallbackJobController, JobController} from "./JobController.js"; import {Store} from "@tsed/core"; import {GlobalProviders} from "@tsed/di"; +import {FallbackJobController, JobController} from "./JobController.js"; + describe("JobController", () => { afterEach(() => GlobalProviders.clear()); @@ -48,7 +49,7 @@ describe("JobController", () => { const store = Store.from(CustomCronJob).get("bullmq"); - expect(store); + expect(store).toBeDefined(); }); }); diff --git a/packages/third-parties/bullmq/src/decorators/JobController.ts b/packages/third-parties/bullmq/src/decorators/JobController.ts index b93e2cd7ca6..6ea87966c7c 100644 --- a/packages/third-parties/bullmq/src/decorators/JobController.ts +++ b/packages/third-parties/bullmq/src/decorators/JobController.ts @@ -1,6 +1,7 @@ import {StoreMerge, useDecorators} from "@tsed/core"; import {Injectable} from "@tsed/di"; import {JobsOptions} from "bullmq"; + import {BullMQTypes} from "../constants/BullMQTypes.js"; import {BULLMQ} from "../constants/constants.js"; import {getFallbackJobToken, getJobToken} from "../utils/getJobToken.js"; diff --git a/packages/third-parties/bullmq/src/dispatchers/JobDispatcher.spec.ts b/packages/third-parties/bullmq/src/dispatchers/JobDispatcher.spec.ts index 6079e097f7f..679f69d273b 100644 --- a/packages/third-parties/bullmq/src/dispatchers/JobDispatcher.spec.ts +++ b/packages/third-parties/bullmq/src/dispatchers/JobDispatcher.spec.ts @@ -1,9 +1,10 @@ import {InjectorService} from "@tsed/di"; -import {JobDispatcher} from "./JobDispatcher.js"; +import {Queue} from "bullmq"; +import {anything, capture, instance, mock, objectContaining, spy, verify, when} from "ts-mockito"; + import {JobMethods} from "../contracts/index.js"; import {JobController} from "../decorators/index.js"; -import {Queue} from "bullmq"; -import {instance, mock, verify, when, objectContaining, capture, anything, spy} from "ts-mockito"; +import {JobDispatcher} from "./JobDispatcher.js"; @JobController("example-job-with-custom-id-from-job-methods") class ExampleJobWithCustomJobIdFromJobMethods implements JobMethods { diff --git a/packages/third-parties/bullmq/src/dispatchers/JobDispatcher.ts b/packages/third-parties/bullmq/src/dispatchers/JobDispatcher.ts index c6b409f3fd9..355158ccf76 100644 --- a/packages/third-parties/bullmq/src/dispatchers/JobDispatcher.ts +++ b/packages/third-parties/bullmq/src/dispatchers/JobDispatcher.ts @@ -1,7 +1,7 @@ -/* eslint-disable require-await */ import {Store, Type} from "@tsed/core"; import {Injectable, InjectorService} from "@tsed/di"; import {Job as BullMQJob, JobsOptions, Queue} from "bullmq"; + import {BULLMQ} from "../constants/constants.js"; import {JobMethods, type JobStore} from "../contracts/index.js"; import {getJobToken} from "../utils/getJobToken.js"; diff --git a/packages/third-parties/bullmq/src/utils/createQueueProvider.ts b/packages/third-parties/bullmq/src/utils/createQueueProvider.ts index a0e36ad3a93..29aa7ae655c 100644 --- a/packages/third-parties/bullmq/src/utils/createQueueProvider.ts +++ b/packages/third-parties/bullmq/src/utils/createQueueProvider.ts @@ -1,5 +1,6 @@ import {InjectorService} from "@tsed/di"; import {Queue, QueueOptions} from "bullmq"; + import {BullMQTypes} from "../constants/BullMQTypes.js"; import {getQueueToken} from "./getQueueToken.js"; diff --git a/packages/third-parties/bullmq/src/utils/createWorkerProvider.ts b/packages/third-parties/bullmq/src/utils/createWorkerProvider.ts index bad468ebc5b..4b9fa3aac51 100644 --- a/packages/third-parties/bullmq/src/utils/createWorkerProvider.ts +++ b/packages/third-parties/bullmq/src/utils/createWorkerProvider.ts @@ -1,5 +1,6 @@ import {InjectorService} from "@tsed/di"; import {Job, Worker, WorkerOptions} from "bullmq"; + import {BullMQTypes} from "../constants/BullMQTypes.js"; import {getWorkerToken} from "./getWorkerToken.js"; diff --git a/packages/third-parties/bullmq/src/utils/mapQueueOptions.ts b/packages/third-parties/bullmq/src/utils/mapQueueOptions.ts index cab7b5b7b6e..a8bf5dd757f 100644 --- a/packages/third-parties/bullmq/src/utils/mapQueueOptions.ts +++ b/packages/third-parties/bullmq/src/utils/mapQueueOptions.ts @@ -1,5 +1,6 @@ import {deepMerge} from "@tsed/core"; import type {QueueOptions} from "bullmq"; + import {BullMQConfig} from "../config/config.js"; export function mapQueueOptions(queue: string, bullMQConfig: BullMQConfig): QueueOptions { diff --git a/packages/third-parties/bullmq/src/utils/mapWorkerOptions.ts b/packages/third-parties/bullmq/src/utils/mapWorkerOptions.ts index 3c5cc82f8be..ca8440c371c 100644 --- a/packages/third-parties/bullmq/src/utils/mapWorkerOptions.ts +++ b/packages/third-parties/bullmq/src/utils/mapWorkerOptions.ts @@ -1,5 +1,6 @@ import {deepMerge} from "@tsed/core"; import type {WorkerOptions} from "bullmq"; + import {BullMQConfig} from "../config/config.js"; export function mapWorkerOptions(queue: string, bullMQConfig: BullMQConfig): WorkerOptions { diff --git a/packages/third-parties/bullmq/tsconfig.esm.json b/packages/third-parties/bullmq/tsconfig.esm.json index e3b07081667..82292550ddb 100644 --- a/packages/third-parties/bullmq/tsconfig.esm.json +++ b/packages/third-parties/bullmq/tsconfig.esm.json @@ -2,8 +2,7 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "module": "ESNext", - "moduleResolution": "nodenext", + "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", @@ -11,7 +10,7 @@ "composite": true, "noEmit": false }, - "include": ["src", "src/**/*.json"], + "include": ["src/**/*.ts", "src/**/*.json"], "exclude": [ "node_modules", "test", diff --git a/packages/third-parties/bullmq/tsconfig.spec.json b/packages/third-parties/bullmq/tsconfig.spec.json index b2e248f2c69..9835f975711 100644 --- a/packages/third-parties/bullmq/tsconfig.spec.json +++ b/packages/third-parties/bullmq/tsconfig.spec.json @@ -3,7 +3,6 @@ "compilerOptions": { "baseUrl": ".", "rootDir": "../..", - "module": "commonjs", "outDir": "./lib/cjs", "declaration": false, "composite": false, diff --git a/packages/third-parties/components-scan/package.json b/packages/third-parties/components-scan/package.json index 0910d361cda..cfb45245765 100644 --- a/packages/third-parties/components-scan/package.json +++ b/packages/third-parties/components-scan/package.json @@ -32,7 +32,7 @@ "@tsed/di": "workspace:*", "@tsed/typescript": "workspace:*", "eslint": "^8.57.0", - "typescript": "4.9.5", + "typescript": "5.6.2", "vitest": "2.0.4" }, "peerDependencies": { diff --git a/packages/third-parties/components-scan/src/__mock__/module1/Module1.ts b/packages/third-parties/components-scan/src/__mock__/module1/Module1.ts index b11f274fed0..7ef951e3dc1 100644 --- a/packages/third-parties/components-scan/src/__mock__/module1/Module1.ts +++ b/packages/third-parties/components-scan/src/__mock__/module1/Module1.ts @@ -1,6 +1,7 @@ -import {SubModule} from "./submodule/SubModule.js"; import {Module} from "@tsed/di"; + import {M1Ctrl1} from "./controllers/M1Ctrl1.js"; +import {SubModule} from "./submodule/SubModule.js"; @Module({ mount: { diff --git a/packages/third-parties/components-scan/src/__mock__/module1/controllers/M1Ctrl1.ts b/packages/third-parties/components-scan/src/__mock__/module1/controllers/M1Ctrl1.ts index 9df9d6d10ee..7c387877f6a 100644 --- a/packages/third-parties/components-scan/src/__mock__/module1/controllers/M1Ctrl1.ts +++ b/packages/third-parties/components-scan/src/__mock__/module1/controllers/M1Ctrl1.ts @@ -1,4 +1,5 @@ import {Controller} from "@tsed/di"; + import {M1Service} from "../services/M1Service.js"; @Controller("/m1") diff --git a/packages/third-parties/components-scan/src/__mock__/module1/services/M1Service.ts b/packages/third-parties/components-scan/src/__mock__/module1/services/M1Service.ts index 492b676997a..0da88b4618d 100644 --- a/packages/third-parties/components-scan/src/__mock__/module1/services/M1Service.ts +++ b/packages/third-parties/components-scan/src/__mock__/module1/services/M1Service.ts @@ -1,4 +1,5 @@ import {Injectable} from "@tsed/di"; + import {SubService} from "../submodule/SubService.js"; @Injectable() diff --git a/packages/third-parties/components-scan/src/__mock__/module1/submodule/SubModule.ts b/packages/third-parties/components-scan/src/__mock__/module1/submodule/SubModule.ts index ef297540849..980c2d10095 100644 --- a/packages/third-parties/components-scan/src/__mock__/module1/submodule/SubModule.ts +++ b/packages/third-parties/components-scan/src/__mock__/module1/submodule/SubModule.ts @@ -1,4 +1,5 @@ import {Module} from "@tsed/di"; + import {SubService} from "./SubService.js"; @Module({ diff --git a/packages/third-parties/components-scan/src/__mock__/module2/Module2.ts b/packages/third-parties/components-scan/src/__mock__/module2/Module2.ts index 2b6c78c8253..15b97098d00 100644 --- a/packages/third-parties/components-scan/src/__mock__/module2/Module2.ts +++ b/packages/third-parties/components-scan/src/__mock__/module2/Module2.ts @@ -1,4 +1,5 @@ import {Module} from "@tsed/di"; + import {M2Ctrl} from "./controllers/M2Ctrl.js"; @Module({ diff --git a/packages/third-parties/components-scan/src/cleanGlobPatterns.spec.ts b/packages/third-parties/components-scan/src/cleanGlobPatterns.spec.ts index ad5fa1e47b6..bd8c17dad0c 100644 --- a/packages/third-parties/components-scan/src/cleanGlobPatterns.spec.ts +++ b/packages/third-parties/components-scan/src/cleanGlobPatterns.spec.ts @@ -13,7 +13,7 @@ describe("cleanGlobPatterns()", () => { expect(cleanGlobPatterns("file.ts", ["!**.spec.ts"])[0]).toContain("file.js"); }); - it("should return file.js", () => { + it("should return file.js (2)", () => { expect(cleanGlobPatterns("file{.ts,.js}", ["!**.spec.ts"])[0]).toContain("file.js"); }); diff --git a/packages/third-parties/components-scan/src/cleanGlobPatterns.ts b/packages/third-parties/components-scan/src/cleanGlobPatterns.ts index e98aecf8355..2243b2d4d53 100644 --- a/packages/third-parties/components-scan/src/cleanGlobPatterns.ts +++ b/packages/third-parties/components-scan/src/cleanGlobPatterns.ts @@ -1,7 +1,8 @@ -import {resolve} from "path"; -import {isTsEnv} from "./isTsEnv.js"; // @ts-ignore import {normalizePath} from "@tsed/normalize-path"; +import {resolve} from "path"; + +import {isTsEnv} from "./isTsEnv.js"; function mapExcludes(excludes: string[]) { return excludes.map((s: string) => `!${s.replace(/!/gi, "")}`); diff --git a/packages/third-parties/components-scan/src/importFiles.spec.ts b/packages/third-parties/components-scan/src/importFiles.spec.ts index 7c524edb685..e06768020d5 100644 --- a/packages/third-parties/components-scan/src/importFiles.spec.ts +++ b/packages/third-parties/components-scan/src/importFiles.spec.ts @@ -1,4 +1,5 @@ import {join} from "path"; + import {Test1} from "./__mock__/Test1.js"; import {Test2} from "./__mock__/Test2.js"; import {importFiles} from "./importFiles.js"; diff --git a/packages/third-parties/components-scan/src/importFiles.ts b/packages/third-parties/components-scan/src/importFiles.ts index bcd3c0ec0c6..9ae0cc1c25d 100644 --- a/packages/third-parties/components-scan/src/importFiles.ts +++ b/packages/third-parties/components-scan/src/importFiles.ts @@ -1,4 +1,5 @@ import {importPackage} from "@tsed/core"; + import {cleanGlobPatterns} from "./cleanGlobPatterns.js"; export async function importFiles(patterns: string | string[], exclude: string[]): Promise { diff --git a/packages/third-parties/components-scan/src/importProviders.spec.ts b/packages/third-parties/components-scan/src/importProviders.spec.ts index 2d5cd8a2955..c0950730099 100644 --- a/packages/third-parties/components-scan/src/importProviders.spec.ts +++ b/packages/third-parties/components-scan/src/importProviders.spec.ts @@ -1,5 +1,6 @@ import {nameOf} from "@tsed/core"; import {resolveControllers} from "@tsed/di"; + import {importProviders} from "./importProviders.js"; const rootDir = import.meta.dirname; diff --git a/packages/third-parties/components-scan/src/importProviders.ts b/packages/third-parties/components-scan/src/importProviders.ts index c9bf626c224..b95cc360546 100644 --- a/packages/third-parties/components-scan/src/importProviders.ts +++ b/packages/third-parties/components-scan/src/importProviders.ts @@ -1,5 +1,6 @@ -import {GlobalProviders, ProviderType} from "@tsed/di"; import {isArray, isClass, isString} from "@tsed/core"; +import {GlobalProviders, ProviderType} from "@tsed/di"; + import {importFiles} from "./importFiles.js"; const lookup = ["imports", "componentsScan", "mount"]; diff --git a/packages/third-parties/components-scan/tsconfig.esm.json b/packages/third-parties/components-scan/tsconfig.esm.json index e3b07081667..82292550ddb 100644 --- a/packages/third-parties/components-scan/tsconfig.esm.json +++ b/packages/third-parties/components-scan/tsconfig.esm.json @@ -2,8 +2,7 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "module": "ESNext", - "moduleResolution": "nodenext", + "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", @@ -11,7 +10,7 @@ "composite": true, "noEmit": false }, - "include": ["src", "src/**/*.json"], + "include": ["src/**/*.ts", "src/**/*.json"], "exclude": [ "node_modules", "test", diff --git a/packages/third-parties/components-scan/tsconfig.spec.json b/packages/third-parties/components-scan/tsconfig.spec.json index 866be5b0238..e98b907f173 100644 --- a/packages/third-parties/components-scan/tsconfig.spec.json +++ b/packages/third-parties/components-scan/tsconfig.spec.json @@ -3,7 +3,6 @@ "compilerOptions": { "baseUrl": ".", "rootDir": "../..", - "module": "commonjs", "outDir": "./lib/cjs", "declaration": false, "composite": false, diff --git a/packages/third-parties/event-emitter/package.json b/packages/third-parties/event-emitter/package.json index cad95e8868c..8bbfa5d3336 100644 --- a/packages/third-parties/event-emitter/package.json +++ b/packages/third-parties/event-emitter/package.json @@ -40,7 +40,7 @@ "@tsed/typescript": "workspace:*", "eslint": "^8.57.0", "eventemitter2": "^6.4.9", - "typescript": "4.9.5", + "typescript": "5.6.2", "vitest": "2.0.4", "webpack": "^5.75.0" }, diff --git a/packages/third-parties/event-emitter/src/EventEmitterModule.ts b/packages/third-parties/event-emitter/src/EventEmitterModule.ts index e1abc06428a..fe0aefddf7a 100644 --- a/packages/third-parties/event-emitter/src/EventEmitterModule.ts +++ b/packages/third-parties/event-emitter/src/EventEmitterModule.ts @@ -1,5 +1,6 @@ import {Constant, Inject, InjectorService, LOGGER, Module, Provider} from "@tsed/di"; import {ListenerFn} from "eventemitter2"; + import {EventEmitterStore} from "./interfaces/EventEmitterStore.js"; import {EventEmitterService} from "./services/EventEmitterFactory.js"; diff --git a/packages/third-parties/event-emitter/src/decorators/onAny.spec.ts b/packages/third-parties/event-emitter/src/decorators/onAny.spec.ts index fefc704aa64..5cadcbdefb0 100644 --- a/packages/third-parties/event-emitter/src/decorators/onAny.spec.ts +++ b/packages/third-parties/event-emitter/src/decorators/onAny.spec.ts @@ -1,4 +1,5 @@ import {Store} from "@tsed/core"; + import {OnAny} from "./onAny.js"; describe("@OnAny()", () => { diff --git a/packages/third-parties/event-emitter/src/decorators/onAny.ts b/packages/third-parties/event-emitter/src/decorators/onAny.ts index dceecb7ff53..877bfc23e90 100644 --- a/packages/third-parties/event-emitter/src/decorators/onAny.ts +++ b/packages/third-parties/event-emitter/src/decorators/onAny.ts @@ -1,4 +1,5 @@ import {Store} from "@tsed/core"; + import {EventEmitterStore} from "../interfaces/EventEmitterStore.js"; export function OnAny(): MethodDecorator { diff --git a/packages/third-parties/event-emitter/src/decorators/onEvent.spec.ts b/packages/third-parties/event-emitter/src/decorators/onEvent.spec.ts index 4a50aedb23a..e4e2576d8c2 100644 --- a/packages/third-parties/event-emitter/src/decorators/onEvent.spec.ts +++ b/packages/third-parties/event-emitter/src/decorators/onEvent.spec.ts @@ -1,4 +1,5 @@ import {Store} from "@tsed/core"; + import {OnEvent} from "../decorators/onEvent.js"; describe("@OnEvent()", () => { diff --git a/packages/third-parties/event-emitter/src/decorators/onEvent.ts b/packages/third-parties/event-emitter/src/decorators/onEvent.ts index 2409e71d17d..1d58809a3ad 100644 --- a/packages/third-parties/event-emitter/src/decorators/onEvent.ts +++ b/packages/third-parties/event-emitter/src/decorators/onEvent.ts @@ -1,5 +1,6 @@ import {Store} from "@tsed/core"; import {event, eventNS, OnOptions} from "eventemitter2"; + import {EventEmitterStore} from "../interfaces/EventEmitterStore.js"; export function OnEvent(event: event | eventNS, options?: boolean | OnOptions): MethodDecorator { diff --git a/packages/third-parties/event-emitter/test/helpers/Server.ts b/packages/third-parties/event-emitter/test/helpers/Server.ts index 69128c69680..a9f408cc517 100644 --- a/packages/third-parties/event-emitter/test/helpers/Server.ts +++ b/packages/third-parties/event-emitter/test/helpers/Server.ts @@ -1,11 +1,11 @@ +import "@tsed/platform-express"; +import "../../src/EventEmitterModule.js"; + import {Configuration, Inject, PlatformApplication} from "@tsed/common"; import bodyParser from "body-parser"; import compress from "compression"; - import cookieParser from "cookie-parser"; import methodOverride from "method-override"; -import "@tsed/platform-express"; -import "../../src/EventEmitterModule.js"; const rootDir = import.meta.dirname; diff --git a/packages/third-parties/event-emitter/test/integration.spec.ts b/packages/third-parties/event-emitter/test/integration.spec.ts index 1d870020f69..e091916f88b 100644 --- a/packages/third-parties/event-emitter/test/integration.spec.ts +++ b/packages/third-parties/event-emitter/test/integration.spec.ts @@ -1,4 +1,5 @@ import {Injectable, PlatformTest} from "@tsed/common"; + import {OnAny} from "../src/decorators/onAny.js"; import {OnEvent} from "../src/decorators/onEvent.js"; import {EventEmitterModule} from "../src/EventEmitterModule.js"; diff --git a/packages/third-parties/event-emitter/tsconfig.esm.json b/packages/third-parties/event-emitter/tsconfig.esm.json index e3b07081667..82292550ddb 100644 --- a/packages/third-parties/event-emitter/tsconfig.esm.json +++ b/packages/third-parties/event-emitter/tsconfig.esm.json @@ -2,8 +2,7 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "module": "ESNext", - "moduleResolution": "nodenext", + "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", @@ -11,7 +10,7 @@ "composite": true, "noEmit": false }, - "include": ["src", "src/**/*.json"], + "include": ["src/**/*.ts", "src/**/*.json"], "exclude": [ "node_modules", "test", diff --git a/packages/third-parties/event-emitter/tsconfig.spec.json b/packages/third-parties/event-emitter/tsconfig.spec.json index b2e248f2c69..9835f975711 100644 --- a/packages/third-parties/event-emitter/tsconfig.spec.json +++ b/packages/third-parties/event-emitter/tsconfig.spec.json @@ -3,7 +3,6 @@ "compilerOptions": { "baseUrl": ".", "rootDir": "../..", - "module": "commonjs", "outDir": "./lib/cjs", "declaration": false, "composite": false, diff --git a/packages/third-parties/formio-types/package.json b/packages/third-parties/formio-types/package.json index 887fac22ffb..ca8920ac303 100644 --- a/packages/third-parties/formio-types/package.json +++ b/packages/third-parties/formio-types/package.json @@ -38,6 +38,6 @@ "@tsed/barrels": "workspace:*", "@tsed/typescript": "workspace:*", "eslint": "^8.57.0", - "typescript": "4.9.5" + "typescript": "5.6.2" } } diff --git a/packages/third-parties/formio-types/src/domain/FormioComponent.ts b/packages/third-parties/formio-types/src/domain/FormioComponent.ts index 678381d599f..721e8495a40 100644 --- a/packages/third-parties/formio-types/src/domain/FormioComponent.ts +++ b/packages/third-parties/formio-types/src/domain/FormioComponent.ts @@ -1,6 +1,7 @@ -import {FormioForm} from "./FormioForm.js"; import type {ExtendedComponentSchema} from "formiojs"; +import {FormioForm} from "./FormioForm.js"; + export interface FormioComponent extends ExtendedComponentSchema { type: string; key: string; diff --git a/packages/third-parties/formio-types/tsconfig.esm.json b/packages/third-parties/formio-types/tsconfig.esm.json index e3b07081667..82292550ddb 100644 --- a/packages/third-parties/formio-types/tsconfig.esm.json +++ b/packages/third-parties/formio-types/tsconfig.esm.json @@ -2,8 +2,7 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "module": "ESNext", - "moduleResolution": "nodenext", + "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", @@ -11,7 +10,7 @@ "composite": true, "noEmit": false }, - "include": ["src", "src/**/*.json"], + "include": ["src/**/*.ts", "src/**/*.json"], "exclude": [ "node_modules", "test", diff --git a/packages/third-parties/formio/package.json b/packages/third-parties/formio/package.json index bebaeb4e7b1..a1fd5a7fb38 100644 --- a/packages/third-parties/formio/package.json +++ b/packages/third-parties/formio/package.json @@ -48,7 +48,7 @@ "formio": "3.5.0", "mongodb": "*", "mongoose": "^6.12.7", - "typescript": "4.9.5", + "typescript": "5.6.2", "vitest": "2.0.4" }, "peerDependencies": { diff --git a/packages/third-parties/formio/src/FormioModule.spec.ts b/packages/third-parties/formio/src/FormioModule.spec.ts index 5476eaa6ead..cfbd16c09ca 100644 --- a/packages/third-parties/formio/src/FormioModule.spec.ts +++ b/packages/third-parties/formio/src/FormioModule.spec.ts @@ -1,5 +1,6 @@ -import faker from "@faker-js/faker"; +import {faker} from "@faker-js/faker"; import {PlatformApplication, PlatformRouteDetails, PlatformTest} from "@tsed/common"; + import {FormioModule} from "./FormioModule.js"; import {FormioInstaller} from "./services/FormioInstaller.js"; import {FormioService} from "./services/FormioService.js"; diff --git a/packages/third-parties/formio/src/FormioModule.ts b/packages/third-parties/formio/src/FormioModule.ts index 0b4dc57f7ad..4da3b0e8a89 100644 --- a/packages/third-parties/formio/src/FormioModule.ts +++ b/packages/third-parties/formio/src/FormioModule.ts @@ -2,6 +2,7 @@ import {Constant, Inject, InjectorService, OnReady, OnRoutesInit, PlatformApplic import {deepClone} from "@tsed/core"; import {Module} from "@tsed/di"; import {normalizePath} from "@tsed/normalize-path"; + import {AlterActions} from "./components/AlterActions.js"; import {AlterAudit} from "./components/AlterAudit.js"; import {AlterHost} from "./components/AlterHost.js"; diff --git a/packages/third-parties/formio/src/builder/FormioMapper.spec.ts b/packages/third-parties/formio/src/builder/FormioMapper.spec.ts index a44553fdf7b..555efd39736 100644 --- a/packages/third-parties/formio/src/builder/FormioMapper.spec.ts +++ b/packages/third-parties/formio/src/builder/FormioMapper.spec.ts @@ -1,5 +1,6 @@ import {toMap as tMap} from "@tsed/core"; import {MongooseDocument} from "@tsed/mongoose"; + import {FormioMapper} from "./FormioMapper.js"; function toMap(list: any[]) { diff --git a/packages/third-parties/formio/src/components/AlterActions.spec.ts b/packages/third-parties/formio/src/components/AlterActions.spec.ts index 8c324c21a04..c389612cbae 100644 --- a/packages/third-parties/formio/src/components/AlterActions.spec.ts +++ b/packages/third-parties/formio/src/components/AlterActions.spec.ts @@ -1,6 +1,7 @@ import {Context, PlatformContext, PlatformTest} from "@tsed/common"; import {BadRequest} from "@tsed/exceptions"; import {FormioActionInfo, FormioComponent} from "@tsed/formio-types"; + import {Action} from "../decorators/action.js"; import {ActionCtx} from "../decorators/actionCtx.js"; import {ActionMethods} from "../domain/FormioAction.js"; diff --git a/packages/third-parties/formio/src/components/AlterActions.ts b/packages/third-parties/formio/src/components/AlterActions.ts index a7390a81cb6..6d4f5110327 100644 --- a/packages/third-parties/formio/src/components/AlterActions.ts +++ b/packages/third-parties/formio/src/components/AlterActions.ts @@ -5,6 +5,7 @@ import {FormioActionInfo} from "@tsed/formio-types"; import {PlatformParams} from "@tsed/platform-params"; import {PlatformResponseFilter} from "@tsed/platform-response-filter"; import {EndpointMetadata} from "@tsed/schema"; + import {Alter} from "../decorators/alter.js"; import {AlterHook} from "../domain/AlterHook.js"; import {SetActionItemMessage} from "../domain/FormioAction.js"; diff --git a/packages/third-parties/formio/src/components/AlterAudit.spec.ts b/packages/third-parties/formio/src/components/AlterAudit.spec.ts index 56b5f525b60..2c3b2ecef44 100644 --- a/packages/third-parties/formio/src/components/AlterAudit.spec.ts +++ b/packages/third-parties/formio/src/components/AlterAudit.spec.ts @@ -1,4 +1,5 @@ import {PlatformTest} from "@tsed/common"; + import {AlterAudit} from "./AlterAudit.js"; describe("AlterAudit", () => { diff --git a/packages/third-parties/formio/src/components/AlterAudit.ts b/packages/third-parties/formio/src/components/AlterAudit.ts index e0fbe260f8c..157de179f5f 100644 --- a/packages/third-parties/formio/src/components/AlterAudit.ts +++ b/packages/third-parties/formio/src/components/AlterAudit.ts @@ -1,4 +1,5 @@ import {DIContext} from "@tsed/di"; + import {Alter} from "../decorators/alter.js"; import {AlterHook} from "../domain/AlterHook.js"; diff --git a/packages/third-parties/formio/src/components/AlterHost.spec.ts b/packages/third-parties/formio/src/components/AlterHost.spec.ts index 76722bd6f6d..ea6a3d7e999 100644 --- a/packages/third-parties/formio/src/components/AlterHost.spec.ts +++ b/packages/third-parties/formio/src/components/AlterHost.spec.ts @@ -1,4 +1,5 @@ import {PlatformTest} from "@tsed/common"; + import {AlterHost} from "./AlterHost.js"; describe("AlterHost", () => { diff --git a/packages/third-parties/formio/src/components/AlterHost.ts b/packages/third-parties/formio/src/components/AlterHost.ts index 6a811ef7ca4..47360232fed 100644 --- a/packages/third-parties/formio/src/components/AlterHost.ts +++ b/packages/third-parties/formio/src/components/AlterHost.ts @@ -1,4 +1,5 @@ import {PlatformContext} from "@tsed/common"; + import {Alter} from "../decorators/alter.js"; import {AlterHook} from "../domain/AlterHook.js"; diff --git a/packages/third-parties/formio/src/components/AlterLog.spec.ts b/packages/third-parties/formio/src/components/AlterLog.spec.ts index de98a484c76..20b64a55a4d 100644 --- a/packages/third-parties/formio/src/components/AlterLog.spec.ts +++ b/packages/third-parties/formio/src/components/AlterLog.spec.ts @@ -1,4 +1,5 @@ import {PlatformTest} from "@tsed/common"; + import {AlterLog} from "./AlterLog.js"; describe("AlterLog", () => { diff --git a/packages/third-parties/formio/src/components/AlterLog.ts b/packages/third-parties/formio/src/components/AlterLog.ts index 20f722592ae..f1e56e12399 100644 --- a/packages/third-parties/formio/src/components/AlterLog.ts +++ b/packages/third-parties/formio/src/components/AlterLog.ts @@ -1,4 +1,5 @@ import {PlatformContext} from "@tsed/common"; + import {Alter} from "../decorators/alter.js"; import {AlterHook} from "../domain/AlterHook.js"; diff --git a/packages/third-parties/formio/src/components/AlterSkip.spec.ts b/packages/third-parties/formio/src/components/AlterSkip.spec.ts index ece2d282e3e..88a4c48f7ab 100644 --- a/packages/third-parties/formio/src/components/AlterSkip.spec.ts +++ b/packages/third-parties/formio/src/components/AlterSkip.spec.ts @@ -1,4 +1,5 @@ import {PlatformTest} from "@tsed/common"; + import {AlterSkip} from "./AlterSkip.js"; describe("AlterSkip", () => { diff --git a/packages/third-parties/formio/src/components/AlterSkip.ts b/packages/third-parties/formio/src/components/AlterSkip.ts index b09cd9687fe..7ee91a15f7d 100644 --- a/packages/third-parties/formio/src/components/AlterSkip.ts +++ b/packages/third-parties/formio/src/components/AlterSkip.ts @@ -1,5 +1,6 @@ import {Constant, PlatformContext} from "@tsed/common"; import {normalizePath} from "@tsed/normalize-path"; + import {Alter} from "../decorators/alter.js"; import {AlterHook} from "../domain/AlterHook.js"; diff --git a/packages/third-parties/formio/src/components/AlterTemplateExportSteps.spec.ts b/packages/third-parties/formio/src/components/AlterTemplateExportSteps.spec.ts index e74fb6857f7..8d5060950b5 100644 --- a/packages/third-parties/formio/src/components/AlterTemplateExportSteps.spec.ts +++ b/packages/third-parties/formio/src/components/AlterTemplateExportSteps.spec.ts @@ -1,4 +1,5 @@ import {PlatformTest} from "@tsed/common"; + import {FormioDatabase} from "../services/FormioDatabase.js"; import {AlterTemplateExportSteps} from "./AlterTemplateExportSteps.js"; diff --git a/packages/third-parties/formio/src/components/AlterTemplateExportSteps.ts b/packages/third-parties/formio/src/components/AlterTemplateExportSteps.ts index c6be01fc53d..d55d84e8eec 100644 --- a/packages/third-parties/formio/src/components/AlterTemplateExportSteps.ts +++ b/packages/third-parties/formio/src/components/AlterTemplateExportSteps.ts @@ -1,13 +1,14 @@ import {getValue} from "@tsed/core"; import {Inject} from "@tsed/di"; import {MongooseDocument} from "@tsed/mongoose"; +import async from "async"; + import {FormioMapper} from "../builder/FormioMapper.js"; import {Alter} from "../decorators/alter.js"; import {AlterHook} from "../domain/AlterHook.js"; import {FormioSubmission} from "../domain/FormioModels.js"; import {FormioTemplate} from "../domain/FormioTemplate.js"; import {FormioDatabase} from "../services/FormioDatabase.js"; -import async from "async"; @Alter("templateExportSteps") export class AlterTemplateExportSteps implements AlterHook { diff --git a/packages/third-parties/formio/src/components/AlterTemplateImportSteps.spec.ts b/packages/third-parties/formio/src/components/AlterTemplateImportSteps.spec.ts index ee447fb5b58..b3d38c36b4d 100644 --- a/packages/third-parties/formio/src/components/AlterTemplateImportSteps.spec.ts +++ b/packages/third-parties/formio/src/components/AlterTemplateImportSteps.spec.ts @@ -1,4 +1,5 @@ import {PlatformTest} from "@tsed/common"; + import {FormioDatabase} from "../services/FormioDatabase.js"; import {AlterTemplateImportSteps} from "./AlterTemplateImportSteps.js"; diff --git a/packages/third-parties/formio/src/components/AlterTemplateImportSteps.ts b/packages/third-parties/formio/src/components/AlterTemplateImportSteps.ts index 02074a2dcac..4cbd5627b24 100644 --- a/packages/third-parties/formio/src/components/AlterTemplateImportSteps.ts +++ b/packages/third-parties/formio/src/components/AlterTemplateImportSteps.ts @@ -1,11 +1,12 @@ import {Inject} from "@tsed/di"; +import async from "async"; + import {FormioMapper} from "../builder/FormioMapper.js"; import {Alter} from "../decorators/alter.js"; import {AlterHook} from "../domain/AlterHook.js"; import {FormioSubmission} from "../domain/FormioModels.js"; import {FormioTemplate} from "../domain/FormioTemplate.js"; import {FormioDatabase} from "../services/FormioDatabase.js"; -import async from "async"; @Alter("templateImportSteps") export class AlterTemplateImportSteps implements AlterHook { diff --git a/packages/third-parties/formio/src/decorators/action.ts b/packages/third-parties/formio/src/decorators/action.ts index 3cbe6831642..407b0cf1b28 100644 --- a/packages/third-parties/formio/src/decorators/action.ts +++ b/packages/third-parties/formio/src/decorators/action.ts @@ -8,10 +8,13 @@ import {FormioActionInfo} from "@tsed/formio-types"; * @decorator */ export function Action(options: FormioActionInfo): ClassDecorator { - return useDecorators((target: any) => { - registerProvider({ - provide: target, - type: "formio:action" - }); - }, StoreSet("formio:action", options)); + return useDecorators( + (target: any) => { + registerProvider({ + provide: target, + type: "formio:action" + }); + }, + StoreSet("formio:action", options) + ); } diff --git a/packages/third-parties/formio/src/decorators/actionCtx.spec.ts b/packages/third-parties/formio/src/decorators/actionCtx.spec.ts index c5e0202939b..3118ecc2c1d 100644 --- a/packages/third-parties/formio/src/decorators/actionCtx.spec.ts +++ b/packages/third-parties/formio/src/decorators/actionCtx.spec.ts @@ -1,6 +1,7 @@ -import {ActionCtx} from "./actionCtx.js"; import {JsonParameterStore} from "@tsed/schema"; +import {ActionCtx} from "./actionCtx.js"; + describe("@ActionCtx", () => { it("should inject ActionCtx", () => { class CustomAction { diff --git a/packages/third-parties/formio/src/decorators/actionCtx.ts b/packages/third-parties/formio/src/decorators/actionCtx.ts index f30cbbbe62c..e026b237dc5 100644 --- a/packages/third-parties/formio/src/decorators/actionCtx.ts +++ b/packages/third-parties/formio/src/decorators/actionCtx.ts @@ -1,7 +1,8 @@ import {Context} from "@tsed/common"; -import {SetActionItemMessage} from "../domain/FormioAction.js"; import {FormioAction} from "@tsed/formio-types"; +import {SetActionItemMessage} from "../domain/FormioAction.js"; + /** * Return the current action context with the following data: * diff --git a/packages/third-parties/formio/src/decorators/alter.spec.ts b/packages/third-parties/formio/src/decorators/alter.spec.ts index 1939d4d5112..a18a810974a 100644 --- a/packages/third-parties/formio/src/decorators/alter.spec.ts +++ b/packages/third-parties/formio/src/decorators/alter.spec.ts @@ -1,4 +1,5 @@ import {Store} from "@tsed/core"; + import {AlterHook} from "../domain/AlterHook.js"; import {Alter} from "./alter.js"; diff --git a/packages/third-parties/formio/src/decorators/alter.ts b/packages/third-parties/formio/src/decorators/alter.ts index cdb9b823f3c..6ba707e38d6 100644 --- a/packages/third-parties/formio/src/decorators/alter.ts +++ b/packages/third-parties/formio/src/decorators/alter.ts @@ -7,10 +7,13 @@ import {registerProvider} from "@tsed/di"; * @constructor */ export function Alter(name: string): ClassDecorator { - return useDecorators((target: any) => { - registerProvider({ - provide: target, - type: "formio:alter" - }); - }, StoreSet("formio:alter:name", name)); + return useDecorators( + (target: any) => { + registerProvider({ + provide: target, + type: "formio:alter" + }); + }, + StoreSet("formio:alter:name", name) + ); } diff --git a/packages/third-parties/formio/src/decorators/on.spec.ts b/packages/third-parties/formio/src/decorators/on.spec.ts index 36955b1e94f..076972dbf02 100644 --- a/packages/third-parties/formio/src/decorators/on.spec.ts +++ b/packages/third-parties/formio/src/decorators/on.spec.ts @@ -1,4 +1,5 @@ import {Store} from "@tsed/core"; + import {OnHook} from "../domain/OnHook.js"; import {On} from "./on.js"; diff --git a/packages/third-parties/formio/src/decorators/on.ts b/packages/third-parties/formio/src/decorators/on.ts index d26907217fe..2b91e6808b8 100644 --- a/packages/third-parties/formio/src/decorators/on.ts +++ b/packages/third-parties/formio/src/decorators/on.ts @@ -7,10 +7,13 @@ import {registerProvider} from "@tsed/di"; * @constructor */ export function On(name: string): ClassDecorator { - return useDecorators((target: any) => { - registerProvider({ - provide: target, - type: "formio:on" - }); - }, StoreSet("formio:on:name", name)); + return useDecorators( + (target: any) => { + registerProvider({ + provide: target, + type: "formio:on" + }); + }, + StoreSet("formio:on:name", name) + ); } diff --git a/packages/third-parties/formio/src/decorators/useFormioAuth.spec.ts b/packages/third-parties/formio/src/decorators/useFormioAuth.spec.ts index 2a38064e5c4..d02e4e69e7b 100644 --- a/packages/third-parties/formio/src/decorators/useFormioAuth.spec.ts +++ b/packages/third-parties/formio/src/decorators/useFormioAuth.spec.ts @@ -1,4 +1,5 @@ import {EndpointMetadata} from "@tsed/common"; + import {FormioAuthMiddleware} from "../middlewares/FormioAuthMiddleware.js"; import {UseFormioAuth} from "./useFormioAuth.js"; diff --git a/packages/third-parties/formio/src/decorators/useFormioAuth.ts b/packages/third-parties/formio/src/decorators/useFormioAuth.ts index 9314fe6377e..c8ef5375e3d 100644 --- a/packages/third-parties/formio/src/decorators/useFormioAuth.ts +++ b/packages/third-parties/formio/src/decorators/useFormioAuth.ts @@ -1,4 +1,5 @@ import {UseAuth} from "@tsed/common"; + import {FormioAuthMiddleware} from "../middlewares/FormioAuthMiddleware.js"; /** diff --git a/packages/third-parties/formio/src/domain/Formio.ts b/packages/third-parties/formio/src/domain/Formio.ts index 234a5be3535..a3f3531926e 100644 --- a/packages/third-parties/formio/src/domain/Formio.ts +++ b/packages/third-parties/formio/src/domain/Formio.ts @@ -2,6 +2,7 @@ import {EventEmitter} from "events"; import {NextFunction, Request, Response} from "express"; import {Db} from "mongodb"; import {Mongoose, Schema} from "mongoose"; + import {FormioActionModelCtor} from "./FormioAction.js"; import {FormioActionsIndex} from "./FormioActionsIndex.js"; import {FormioAuth} from "./FormioAuth.js"; diff --git a/packages/third-parties/formio/src/domain/FormioAction.ts b/packages/third-parties/formio/src/domain/FormioAction.ts index 680c701c9c5..dfe49716d52 100644 --- a/packages/third-parties/formio/src/domain/FormioAction.ts +++ b/packages/third-parties/formio/src/domain/FormioAction.ts @@ -1,7 +1,8 @@ +import {FormioAction, FormioActionInfo} from "@tsed/formio-types"; import {Request, Response} from "express"; + import {FormioMongooseSchema} from "./FormioBaseModel.js"; import {FormioComponent} from "./FormioModels.js"; -import {FormioAction, FormioActionInfo} from "@tsed/formio-types"; export interface FormioActionModel extends FormioAction { resolve(handler: string, method: string, req: Request, res: Response, next: Function, setActionItemMessage: SetActionItemMessage): void; diff --git a/packages/third-parties/formio/src/domain/FormioActionsIndex.ts b/packages/third-parties/formio/src/domain/FormioActionsIndex.ts index cc1750d4e3a..11e872ca0fd 100644 --- a/packages/third-parties/formio/src/domain/FormioActionsIndex.ts +++ b/packages/third-parties/formio/src/domain/FormioActionsIndex.ts @@ -1,4 +1,5 @@ import {Type} from "@tsed/core"; + import {FormioActionModelCtor} from "./FormioAction.js"; export interface FormioActions { diff --git a/packages/third-parties/formio/src/domain/FormioAuth.ts b/packages/third-parties/formio/src/domain/FormioAuth.ts index 1f60ebb5491..a577c5c374f 100644 --- a/packages/third-parties/formio/src/domain/FormioAuth.ts +++ b/packages/third-parties/formio/src/domain/FormioAuth.ts @@ -1,4 +1,5 @@ import {Next, Req, Res} from "@tsed/common"; + import {FormioDecodedToken, FormioPayloadToken} from "./FormioDecodedToken.js"; import {FormioForm} from "./FormioModels.js"; diff --git a/packages/third-parties/formio/src/domain/FormioBaseModel.ts b/packages/third-parties/formio/src/domain/FormioBaseModel.ts index 48b8f32a524..b11d52c053e 100644 --- a/packages/third-parties/formio/src/domain/FormioBaseModel.ts +++ b/packages/third-parties/formio/src/domain/FormioBaseModel.ts @@ -1,5 +1,5 @@ import {MongooseDocument} from "@tsed/mongoose"; -import {Schema, Document} from "mongoose"; +import {Document, Schema} from "mongoose"; export type FormioMongooseSchema = Schema> & { machineName(document: MongooseDocument, done: Function): void; diff --git a/packages/third-parties/formio/src/domain/FormioCtxMapper.ts b/packages/third-parties/formio/src/domain/FormioCtxMapper.ts index e7d338c4a65..7d1e1e22909 100644 --- a/packages/third-parties/formio/src/domain/FormioCtxMapper.ts +++ b/packages/third-parties/formio/src/domain/FormioCtxMapper.ts @@ -1,5 +1,5 @@ -import {MongooseDocument} from "@tsed/mongoose"; import {FormioAction, FormioForm, FormioRole} from "@tsed/formio-types"; +import {MongooseDocument} from "@tsed/mongoose"; export interface FormioCtxMapper { forms: Map>; diff --git a/packages/third-parties/formio/src/domain/FormioHooks.ts b/packages/third-parties/formio/src/domain/FormioHooks.ts index ac9990b969f..a213490db94 100644 --- a/packages/third-parties/formio/src/domain/FormioHooks.ts +++ b/packages/third-parties/formio/src/domain/FormioHooks.ts @@ -1,6 +1,7 @@ import {MongooseDocument} from "@tsed/mongoose"; import {Request, Response} from "express"; import {FilterQuery, Schema, SchemaDefinition} from "mongoose"; + import {Formio} from "./Formio.js"; import {FormioActions} from "./FormioActionsIndex.js"; import {FormioConfig} from "./FormioConfig.js"; diff --git a/packages/third-parties/formio/src/domain/FormioModels.ts b/packages/third-parties/formio/src/domain/FormioModels.ts index 2d8c5c59a31..cafa948e474 100644 --- a/packages/third-parties/formio/src/domain/FormioModels.ts +++ b/packages/third-parties/formio/src/domain/FormioModels.ts @@ -1,8 +1,9 @@ +import {FormioActionItem, FormioForm, FormioRole, FormioSchema, FormioSubmission, FormioToken} from "@tsed/formio-types"; import {MongooseDocument} from "@tsed/mongoose"; import {Schema} from "mongoose"; + import {FormioActionModelCtor, FormioActionMongooseSchema} from "./FormioAction.js"; import {FormioBaseModel, FormioModel, FormioMongooseSchema} from "./FormioBaseModel.js"; -import {FormioActionItem, FormioForm, FormioRole, FormioSchema, FormioSubmission, FormioToken} from "@tsed/formio-types"; export * from "@tsed/formio-types"; diff --git a/packages/third-parties/formio/src/domain/FormioRouter.ts b/packages/third-parties/formio/src/domain/FormioRouter.ts index 9006276f676..60f03ee444a 100644 --- a/packages/third-parties/formio/src/domain/FormioRouter.ts +++ b/packages/third-parties/formio/src/domain/FormioRouter.ts @@ -1,4 +1,5 @@ import {Router} from "express"; + import {Formio, FormioBase} from "./Formio.js"; import {FormioHooks} from "./FormioHooks.js"; diff --git a/packages/third-parties/formio/src/domain/FormioUpdate.ts b/packages/third-parties/formio/src/domain/FormioUpdate.ts index d438045133b..c14fdb69e05 100644 --- a/packages/third-parties/formio/src/domain/FormioUpdate.ts +++ b/packages/third-parties/formio/src/domain/FormioUpdate.ts @@ -1,5 +1,6 @@ import {NextFunction, Request, Response} from "express"; import {Db} from "mongodb"; + import {Formio} from "./Formio.js"; export interface FormioUpdate { diff --git a/packages/third-parties/formio/src/domain/FormioUtils.ts b/packages/third-parties/formio/src/domain/FormioUtils.ts index 4dccd6ba4c5..b52fefc833a 100644 --- a/packages/third-parties/formio/src/domain/FormioUtils.ts +++ b/packages/third-parties/formio/src/domain/FormioUtils.ts @@ -1,4 +1,5 @@ import {Request, Response} from "express"; + import {FormioErrors} from "./FormioErrors.js"; import {FormioJs} from "./FormioJs.js"; @@ -97,7 +98,7 @@ export interface FormioUtil { * @returns {Promise} The promise with the node-fetch response object. */ fetch: any; - /* eslint-disable new-cap */ + base64: { /** * Base64 encode the given data. @@ -303,8 +304,6 @@ export interface FormioUtil { */ idToString(_id: string | any): string; - /* eslint-enable new-cap */ - /** * Ensures that a submission data has MongoDB ObjectID's for all "id" fields. * @param data diff --git a/packages/third-parties/formio/src/domain/Resource.ts b/packages/third-parties/formio/src/domain/Resource.ts index 27c911b6636..b1ef06b0e1f 100644 --- a/packages/third-parties/formio/src/domain/Resource.ts +++ b/packages/third-parties/formio/src/domain/Resource.ts @@ -1,4 +1,4 @@ -import {Request, Response, NextFunction} from "express"; +import {NextFunction, Request, Response} from "express"; export type ResourceHttpHandler = (req: Request, res: Response, next: NextFunction) => void; diff --git a/packages/third-parties/formio/src/middlewares/FormioAuthMiddleware.spec.ts b/packages/third-parties/formio/src/middlewares/FormioAuthMiddleware.spec.ts index 236445d84e3..2303a61cc70 100644 --- a/packages/third-parties/formio/src/middlewares/FormioAuthMiddleware.spec.ts +++ b/packages/third-parties/formio/src/middlewares/FormioAuthMiddleware.spec.ts @@ -1,6 +1,7 @@ import {PlatformTest} from "@tsed/common"; import {catchAsyncError} from "@tsed/core"; import {Unauthorized} from "@tsed/exceptions"; + import {FormioService} from "../services/FormioService.js"; import {FormioAuthMiddleware} from "./FormioAuthMiddleware.js"; diff --git a/packages/third-parties/formio/src/middlewares/FormioAuthMiddleware.ts b/packages/third-parties/formio/src/middlewares/FormioAuthMiddleware.ts index 4fc3cacd6c7..539dbbd4788 100644 --- a/packages/third-parties/formio/src/middlewares/FormioAuthMiddleware.ts +++ b/packages/third-parties/formio/src/middlewares/FormioAuthMiddleware.ts @@ -2,6 +2,7 @@ import {Context, Inject, Middleware} from "@tsed/common"; import {getValue} from "@tsed/core"; import {Unauthorized} from "@tsed/exceptions"; import {promisify} from "util"; + import {FormioService} from "../services/FormioService.js"; /** diff --git a/packages/third-parties/formio/src/services/FormioAuthService.spec.ts b/packages/third-parties/formio/src/services/FormioAuthService.spec.ts index 6c6e2155aab..b9d93e23deb 100644 --- a/packages/third-parties/formio/src/services/FormioAuthService.spec.ts +++ b/packages/third-parties/formio/src/services/FormioAuthService.spec.ts @@ -1,6 +1,7 @@ import {PlatformTest} from "@tsed/common"; import {catchAsyncError} from "@tsed/core"; import {BadRequest} from "@tsed/exceptions"; + import {FormioAuthService} from "./FormioAuthService.js"; import {FormioHooksService} from "./FormioHooksService.js"; import {FormioService} from "./FormioService.js"; diff --git a/packages/third-parties/formio/src/services/FormioAuthService.ts b/packages/third-parties/formio/src/services/FormioAuthService.ts index 866c2f21211..0a5838c2e11 100644 --- a/packages/third-parties/formio/src/services/FormioAuthService.ts +++ b/packages/third-parties/formio/src/services/FormioAuthService.ts @@ -3,6 +3,7 @@ import {isFunction} from "@tsed/core"; import {Inject, Injectable} from "@tsed/di"; import {BadRequest, NotFound, Unauthorized} from "@tsed/exceptions"; import {promisify} from "util"; + import {FormioPayloadToken} from "../domain/FormioDecodedToken.js"; import {FormioForm, FormioSubmission, WithID} from "../domain/FormioModels.js"; import {FormioDatabase} from "./FormioDatabase.js"; diff --git a/packages/third-parties/formio/src/services/FormioDatabase.spec.ts b/packages/third-parties/formio/src/services/FormioDatabase.spec.ts index 1036b41ddd4..7acd12e5550 100644 --- a/packages/third-parties/formio/src/services/FormioDatabase.spec.ts +++ b/packages/third-parties/formio/src/services/FormioDatabase.spec.ts @@ -1,4 +1,5 @@ import {PlatformTest} from "@tsed/common"; + import {FormioDatabase} from "./FormioDatabase.js"; import {FormioService} from "./FormioService.js"; diff --git a/packages/third-parties/formio/src/services/FormioDatabase.ts b/packages/third-parties/formio/src/services/FormioDatabase.ts index 6a1356be703..482a8b8361a 100644 --- a/packages/third-parties/formio/src/services/FormioDatabase.ts +++ b/packages/third-parties/formio/src/services/FormioDatabase.ts @@ -1,9 +1,10 @@ import {isArray, isObject, isString, toMap as tMap} from "@tsed/core"; import {Inject, Injectable} from "@tsed/di"; +import {FormioAction, FormioActionItem, FormioForm, FormioRole, FormioSubmission, FormioToken} from "@tsed/formio-types"; import {MongooseDocument, MongooseModel} from "@tsed/mongoose"; -import type {FilterQuery} from "mongoose"; import omit from "lodash/omit.js"; -import {FormioAction, FormioActionItem, FormioForm, FormioRole, FormioSubmission, FormioToken} from "@tsed/formio-types"; +import type {FilterQuery} from "mongoose"; + import {FormioMapper} from "../builder/FormioMapper.js"; import {isMongoId} from "../utils/isMongoId.js"; import {FormioService} from "./FormioService.js"; diff --git a/packages/third-parties/formio/src/services/FormioHooksService.spec.ts b/packages/third-parties/formio/src/services/FormioHooksService.spec.ts index 7b5ab429327..18f3fa94c2c 100644 --- a/packages/third-parties/formio/src/services/FormioHooksService.spec.ts +++ b/packages/third-parties/formio/src/services/FormioHooksService.spec.ts @@ -1,5 +1,6 @@ import {PlatformTest, Provider} from "@tsed/common"; import {Store} from "@tsed/core"; + import {FormioHooksService} from "./FormioHooksService.js"; import {FormioService} from "./FormioService.js"; diff --git a/packages/third-parties/formio/src/services/FormioHooksService.ts b/packages/third-parties/formio/src/services/FormioHooksService.ts index 64e3568d80d..9ecafa5a74e 100644 --- a/packages/third-parties/formio/src/services/FormioHooksService.ts +++ b/packages/third-parties/formio/src/services/FormioHooksService.ts @@ -1,8 +1,9 @@ import {Inject, Injectable, InjectorService} from "@tsed/common"; +import {Request} from "express"; import {promisify} from "util"; + import {FormioHooks} from "../domain/FormioHooks.js"; import {FormioService} from "./FormioService.js"; -import {Request} from "express"; @Injectable() export class FormioHooksService { diff --git a/packages/third-parties/formio/src/services/FormioInstaller.spec.ts b/packages/third-parties/formio/src/services/FormioInstaller.spec.ts index 67bd47b063a..142a1562229 100644 --- a/packages/third-parties/formio/src/services/FormioInstaller.spec.ts +++ b/packages/third-parties/formio/src/services/FormioInstaller.spec.ts @@ -1,5 +1,6 @@ -import faker from "@faker-js/faker"; +import {faker} from "@faker-js/faker"; import {PlatformTest} from "@tsed/common"; + import {FormioInstaller} from "./FormioInstaller.js"; import {FormioService} from "./FormioService.js"; @@ -56,19 +57,19 @@ describe("FormioImporter", () => { const template = { resources: { admin: { - _id: faker.datatype.uuid() + _id: faker.string.uuid() } }, roles: { administrator: { - _id: faker.datatype.uuid() + _id: faker.string.uuid() } } }; const user = { email: faker.internet.email(), - password: faker.internet.password(12) + password: faker.internet.password({length: 12}) }; expect(await service.createRootUser(user, template as any)).toEqual({ @@ -89,19 +90,19 @@ describe("FormioImporter", () => { const template = { resources: { admin: { - _id: faker.datatype.uuid() + _id: faker.string.uuid() } }, roles: { administrator: { - _id: faker.datatype.uuid() + _id: faker.string.uuid() } } }; const user = { email: faker.internet.email(), - password: faker.internet.password(12) + password: faker.internet.password({length: 12}) }; let actualError: any; @@ -119,19 +120,19 @@ describe("FormioImporter", () => { const template = { resources: { admin: { - _id: faker.datatype.uuid() + _id: faker.string.uuid() } }, roles: { administrator: { - _id: faker.datatype.uuid() + _id: faker.string.uuid() } } }; const user = { email: faker.internet.email(), - password: faker.internet.password(12) + password: faker.internet.password({length: 12}) }; vi.spyOn(service, "createRootUser"); diff --git a/packages/third-parties/formio/src/services/FormioInstaller.ts b/packages/third-parties/formio/src/services/FormioInstaller.ts index b12fe86d5e7..bd7a2fccb20 100644 --- a/packages/third-parties/formio/src/services/FormioInstaller.ts +++ b/packages/third-parties/formio/src/services/FormioInstaller.ts @@ -1,5 +1,6 @@ import {Inject, Injectable} from "@tsed/di"; import {Logger} from "@tsed/logger"; + import {FormioSubmission} from "../domain/FormioModels.js"; import {FormioTemplate} from "../domain/FormioTemplate.js"; import {FormioDatabase} from "./FormioDatabase.js"; diff --git a/packages/third-parties/formio/src/services/FormioRepository.spec.ts b/packages/third-parties/formio/src/services/FormioRepository.spec.ts index 90c2ef97c76..1be53f3db28 100644 --- a/packages/third-parties/formio/src/services/FormioRepository.spec.ts +++ b/packages/third-parties/formio/src/services/FormioRepository.spec.ts @@ -1,4 +1,5 @@ import {Injectable, PlatformTest} from "@tsed/common"; + import {FormioDatabase} from "./FormioDatabase.js"; import {FormioRepository} from "./FormioRepository.js"; diff --git a/packages/third-parties/formio/src/services/FormioRepository.ts b/packages/third-parties/formio/src/services/FormioRepository.ts index 36b26520f5b..6e8044c7e06 100644 --- a/packages/third-parties/formio/src/services/FormioRepository.ts +++ b/packages/third-parties/formio/src/services/FormioRepository.ts @@ -1,6 +1,7 @@ -import type {FilterQuery} from "mongoose"; import {Inject} from "@tsed/di"; import {MongooseDocument, MongooseModel} from "@tsed/mongoose"; +import type {FilterQuery} from "mongoose"; + import {FormioSubmission} from "../domain/FormioModels.js"; import {FormioDatabase} from "./FormioDatabase.js"; diff --git a/packages/third-parties/formio/src/services/FormioService.spec.ts b/packages/third-parties/formio/src/services/FormioService.spec.ts index 230663eb602..cf8e220b4ce 100644 --- a/packages/third-parties/formio/src/services/FormioService.spec.ts +++ b/packages/third-parties/formio/src/services/FormioService.spec.ts @@ -1,5 +1,7 @@ -import {PlatformTest} from "@tsed/common"; import "../components/AlterAudit.js"; + +import {PlatformTest} from "@tsed/common"; + import {AlterAudit} from "../components/AlterAudit.js"; import {FormioHooksService} from "./FormioHooksService.js"; import {FormioService} from "./FormioService.js"; @@ -81,7 +83,7 @@ describe("FormioService", () => { expect(service.isInit()).toEqual(true); }); - it("should return true", async () => { + it("should return false", async () => { const {service} = await createFormioFixture(); await service.init({} as any); diff --git a/packages/third-parties/formio/src/services/FormioService.ts b/packages/third-parties/formio/src/services/FormioService.ts index f00e447aeef..a74449a3cbe 100644 --- a/packages/third-parties/formio/src/services/FormioService.ts +++ b/packages/third-parties/formio/src/services/FormioService.ts @@ -1,8 +1,15 @@ import {Inject, Injectable, InjectorService} from "@tsed/common"; import {MongooseConnectionOptions} from "@tsed/mongoose"; +// @ts-ignore +import createRouter from "formio"; +// @ts-ignore +import swagger from "formio/src/util/swagger.js"; +// @ts-ignore +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"; import {FormioHook, FormioHooks} from "../domain/FormioHooks.js"; @@ -10,12 +17,6 @@ import {FormioSchemas} from "../domain/FormioModels.js"; import {FormioRouter} from "../domain/FormioRouter.js"; import {FormioTemplate} from "../domain/FormioTemplate.js"; import {FormioExportOptions} from "../domain/FormioTemplateUtil.js"; -// @ts-ignore -import createRouter from "formio"; -// @ts-ignore -import swagger from "formio/src/util/swagger.js"; -// @ts-ignore -import util from "formio/src/util/util.js"; @Injectable() export class FormioService { diff --git a/packages/third-parties/formio/test/app/Server.ts b/packages/third-parties/formio/test/app/Server.ts index 39b73d2c90e..1d1b27d6c4b 100644 --- a/packages/third-parties/formio/test/app/Server.ts +++ b/packages/third-parties/formio/test/app/Server.ts @@ -1,15 +1,17 @@ -import {FileSyncAdapter} from "@tsed/adapters"; import "@tsed/ajv"; -import {Constant, PlatformApplication} from "@tsed/common"; -import {Configuration, Inject} from "@tsed/di"; import "@tsed/mongoose"; import "@tsed/swagger"; +import "../../src/index.js"; + +import {FileSyncAdapter} from "@tsed/adapters"; +import {Constant, PlatformApplication} from "@tsed/common"; +import {Configuration, Inject} from "@tsed/di"; import bodyParser from "body-parser"; import compress from "compression"; import cookieParser from "cookie-parser"; import session from "express-session"; import methodOverride from "method-override"; -import "../../src/index.js"; + import template from "../template/project.json"; const rootDir = import.meta.dirname; diff --git a/packages/third-parties/formio/test/app/controllers/pages/IndexCtrl.ts b/packages/third-parties/formio/test/app/controllers/pages/IndexCtrl.ts index a16b9b928f8..a814b305d48 100644 --- a/packages/third-parties/formio/test/app/controllers/pages/IndexCtrl.ts +++ b/packages/third-parties/formio/test/app/controllers/pages/IndexCtrl.ts @@ -10,7 +10,7 @@ export class IndexCtrl { @Get("/") @View("index.ejs") - @Returns(200, String).ContentType("text/html") + @(Returns(200, String).ContentType("text/html")) get(@HeaderParams("x-forwarded-proto") protocol: string, @HeaderParams("host") host: string) { const hostUrl = `${protocol || "http"}://${host}`; diff --git a/packages/third-parties/formio/test/app/controllers/rest/VersionCtrl.ts b/packages/third-parties/formio/test/app/controllers/rest/VersionCtrl.ts index 5ab85f7ef4a..49dd20855db 100644 --- a/packages/third-parties/formio/test/app/controllers/rest/VersionCtrl.ts +++ b/packages/third-parties/formio/test/app/controllers/rest/VersionCtrl.ts @@ -4,9 +4,9 @@ import {object, Returns, string} from "@tsed/schema"; @Controller("/version") export class VersionCtrl { @Get("/") - @Returns(200) + @(Returns(200) .ContentType("application/json") - .Schema(object().properties({name: string(), version: string()})) + .Schema(object().properties({name: string(), version: string()}))) async get() { const {name, version} = await import("../../../../package.json"); return { diff --git a/packages/third-parties/formio/test/app/index.ts b/packages/third-parties/formio/test/app/index.ts index 9b9b475a3b8..ea9bbc2bca7 100644 --- a/packages/third-parties/formio/test/app/index.ts +++ b/packages/third-parties/formio/test/app/index.ts @@ -1,5 +1,6 @@ import {$log} from "@tsed/common"; import {PlatformExpress} from "@tsed/platform-express"; + import {IndexCtrl} from "./controllers/pages/IndexCtrl.js"; import {VersionCtrl} from "./controllers/rest/VersionCtrl.js"; import {Server} from "./Server.js"; diff --git a/packages/third-parties/formio/tsconfig.esm.json b/packages/third-parties/formio/tsconfig.esm.json index e3b07081667..82292550ddb 100644 --- a/packages/third-parties/formio/tsconfig.esm.json +++ b/packages/third-parties/formio/tsconfig.esm.json @@ -2,8 +2,7 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "module": "ESNext", - "moduleResolution": "nodenext", + "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", @@ -11,7 +10,7 @@ "composite": true, "noEmit": false }, - "include": ["src", "src/**/*.json"], + "include": ["src/**/*.ts", "src/**/*.json"], "exclude": [ "node_modules", "test", diff --git a/packages/third-parties/formio/tsconfig.spec.json b/packages/third-parties/formio/tsconfig.spec.json index b2e248f2c69..9835f975711 100644 --- a/packages/third-parties/formio/tsconfig.spec.json +++ b/packages/third-parties/formio/tsconfig.spec.json @@ -3,7 +3,6 @@ "compilerOptions": { "baseUrl": ".", "rootDir": "../..", - "module": "commonjs", "outDir": "./lib/cjs", "declaration": false, "composite": false, diff --git a/packages/third-parties/pulse/package.json b/packages/third-parties/pulse/package.json index 5891f00ed29..c0702f5fdb9 100644 --- a/packages/third-parties/pulse/package.json +++ b/packages/third-parties/pulse/package.json @@ -37,7 +37,7 @@ "@tsed/di": "workspace:*", "@tsed/typescript": "workspace:*", "eslint": "^8.57.0", - "typescript": "4.9.5", + "typescript": "5.6.2", "vitest": "2.0.4" }, "peerDependencies": { diff --git a/packages/third-parties/pulse/src/PulseModule.spec.ts b/packages/third-parties/pulse/src/PulseModule.spec.ts index 4458b9e8f79..0cab30c42a6 100644 --- a/packages/third-parties/pulse/src/PulseModule.spec.ts +++ b/packages/third-parties/pulse/src/PulseModule.spec.ts @@ -1,10 +1,11 @@ +import type {Job} from "@pulsecron/pulse"; import {PlatformTest} from "@tsed/common"; import {Inject} from "@tsed/di"; -import type {Job} from "@pulsecron/pulse"; -import {PulseModule} from "./PulseModule"; -import {Pulse} from "./decorators/pulse"; + import {Define} from "./decorators/define.js"; import {Every} from "./decorators/every.js"; +import {Pulse} from "./decorators/pulse.js"; +import {PulseModule} from "./PulseModule.js"; vi.mock("@pulsecron/pulse", () => { return { diff --git a/packages/third-parties/pulse/src/PulseModule.ts b/packages/third-parties/pulse/src/PulseModule.ts index de8403eb90a..b1c12fc7930 100644 --- a/packages/third-parties/pulse/src/PulseModule.ts +++ b/packages/third-parties/pulse/src/PulseModule.ts @@ -1,7 +1,8 @@ +import {DefineOptions, Job, JobAttributesData, Processor} from "@pulsecron/pulse"; import {AfterListen, DIContext, Logger, OnDestroy, runInContext} from "@tsed/common"; import {Constant, Inject, InjectorService, Module, Provider} from "@tsed/di"; -import {Job, Processor, DefineOptions, JobAttributesData} from "@pulsecron/pulse"; import {v4 as uuid} from "uuid"; + import {PROVIDER_TYPE_PULSE} from "./constants/constants.js"; import {PulseStore} from "./interfaces/PulseStore.js"; import {PulseService} from "./services/PulseFactory.js"; diff --git a/packages/third-parties/pulse/src/decorators/define.spec.ts b/packages/third-parties/pulse/src/decorators/define.spec.ts index 8c1c5d5b36a..7aa4bea495b 100644 --- a/packages/third-parties/pulse/src/decorators/define.spec.ts +++ b/packages/third-parties/pulse/src/decorators/define.spec.ts @@ -1,6 +1,7 @@ import {Store} from "@tsed/core"; -import {Pulse} from "./pulse"; + import {Define} from "./define.js"; +import {Pulse} from "./pulse.js"; describe("@Define()", () => { it("should set empty metadata", () => { @@ -30,7 +31,7 @@ describe("@Define()", () => { class Test { @Define({ name: "testDefineDecoratorCustomName", - priority: 'highest' + priority: "highest" }) test() { // test @@ -41,7 +42,7 @@ describe("@Define()", () => { expect(store.get("pulse").define).toEqual({ test: { name: "testDefineDecoratorCustomName", - priority: 'highest' + priority: "highest" } }); }); diff --git a/packages/third-parties/pulse/src/decorators/define.ts b/packages/third-parties/pulse/src/decorators/define.ts index 3bdf74e077a..154fc6eca1f 100644 --- a/packages/third-parties/pulse/src/decorators/define.ts +++ b/packages/third-parties/pulse/src/decorators/define.ts @@ -1,5 +1,6 @@ import {Store} from "@tsed/core"; -import {PulseStore, DefineOptions} from "../interfaces/PulseStore.js"; + +import {DefineOptions, PulseStore} from "../interfaces/PulseStore.js"; export function Define(options: DefineOptions = {}): MethodDecorator { return (target: any, propertyKey: string) => { diff --git a/packages/third-parties/pulse/src/decorators/every.spec.ts b/packages/third-parties/pulse/src/decorators/every.spec.ts index a6c9e203473..0198fd56d92 100644 --- a/packages/third-parties/pulse/src/decorators/every.spec.ts +++ b/packages/third-parties/pulse/src/decorators/every.spec.ts @@ -1,6 +1,7 @@ import {descriptorOf, Store} from "@tsed/core"; -import {Pulse} from "./pulse"; + import {Every} from "./every.js"; +import {Pulse} from "./pulse.js"; describe("@Every()", () => { it("should set metadata", () => { diff --git a/packages/third-parties/pulse/src/decorators/every.ts b/packages/third-parties/pulse/src/decorators/every.ts index 290bdd09e98..f2438d07b90 100644 --- a/packages/third-parties/pulse/src/decorators/every.ts +++ b/packages/third-parties/pulse/src/decorators/every.ts @@ -1,6 +1,7 @@ import {Store, useDecorators} from "@tsed/core"; + +import {EveryOptions, PulseStore} from "../interfaces/PulseStore.js"; import {Define} from "./define.js"; -import {PulseStore, EveryOptions} from "../interfaces/PulseStore.js"; export function Every(interval: string, options: EveryOptions = {}): MethodDecorator { return useDecorators(Define(options), (target: any, propertyKey: string) => { diff --git a/packages/third-parties/pulse/src/decorators/pulse.spec.ts b/packages/third-parties/pulse/src/decorators/pulse.spec.ts index 0cbee919b0b..b7ec38d5aa6 100644 --- a/packages/third-parties/pulse/src/decorators/pulse.spec.ts +++ b/packages/third-parties/pulse/src/decorators/pulse.spec.ts @@ -1,5 +1,6 @@ import {Store} from "@tsed/core"; -import {Pulse} from "./pulse"; + +import {Pulse} from "./pulse.js"; describe("@Pulse()", () => { it("should set empty metadata", () => { diff --git a/packages/third-parties/pulse/src/decorators/pulse.ts b/packages/third-parties/pulse/src/decorators/pulse.ts index 3e6c40ab192..6bf8699f133 100644 --- a/packages/third-parties/pulse/src/decorators/pulse.ts +++ b/packages/third-parties/pulse/src/decorators/pulse.ts @@ -1,5 +1,6 @@ import {StoreMerge, useDecorators} from "@tsed/core"; import {Injectable} from "@tsed/di"; + import {PROVIDER_TYPE_PULSE} from "../constants/constants.js"; interface PulseOptions { diff --git a/packages/third-parties/pulse/src/services/PulseFactory.ts b/packages/third-parties/pulse/src/services/PulseFactory.ts index c7d0477f2dd..2a481b2c7c9 100644 --- a/packages/third-parties/pulse/src/services/PulseFactory.ts +++ b/packages/third-parties/pulse/src/services/PulseFactory.ts @@ -1,5 +1,5 @@ -import {Configuration, registerProvider} from "@tsed/di"; import {Pulse, PulseConfig} from "@pulsecron/pulse"; +import {Configuration, registerProvider} from "@tsed/di"; // create Alias to avoid confusing import between Pulse from "@pulsecron/pulse" and Pulse decorator export const PulseService = Pulse; diff --git a/packages/third-parties/pulse/test/helpers/Server.ts b/packages/third-parties/pulse/test/helpers/Server.ts index 5d1db0bf2d8..8540e323d19 100644 --- a/packages/third-parties/pulse/test/helpers/Server.ts +++ b/packages/third-parties/pulse/test/helpers/Server.ts @@ -1,9 +1,10 @@ -import {Configuration, Inject, PlatformApplication} from "@tsed/common"; import "@tsed/platform-express"; -import "@tsed/pulse"; -import cookieParser from "cookie-parser"; +import "../.."; + +import {Configuration, Inject, PlatformApplication} from "@tsed/common"; import bodyParser from "body-parser"; import compress from "compression"; +import cookieParser from "cookie-parser"; import methodOverride from "method-override"; const rootDir = import.meta.dirname; diff --git a/packages/third-parties/pulse/test/pulse-define-manually.integration.spec.ts b/packages/third-parties/pulse/test/pulse-define-manually.integration.spec.ts index c909e414a92..30134add76c 100644 --- a/packages/third-parties/pulse/test/pulse-define-manually.integration.spec.ts +++ b/packages/third-parties/pulse/test/pulse-define-manually.integration.spec.ts @@ -1,9 +1,9 @@ +import {Job} from "@pulsecron/pulse"; import {PlatformTest} from "@tsed/common"; import {Inject} from "@tsed/di"; import {TestContainersMongo} from "@tsed/testcontainers-mongo"; -import {Job} from "@pulsecron/pulse"; -import {PulseModule, Pulse, PulseService, Define} from "../src/index.js"; +import {Define, Pulse, PulseModule, PulseService} from "../src/index.js"; import {Server} from "./helpers/Server.js"; @Pulse({namespace: "test-nsp"}) diff --git a/packages/third-parties/pulse/test/pulse-define.integration.spec.ts b/packages/third-parties/pulse/test/pulse-define.integration.spec.ts index 97194cf49cd..ab1ec7d27a3 100644 --- a/packages/third-parties/pulse/test/pulse-define.integration.spec.ts +++ b/packages/third-parties/pulse/test/pulse-define.integration.spec.ts @@ -1,6 +1,7 @@ import {PlatformTest} from "@tsed/common"; import {TestContainersMongo} from "@tsed/testcontainers-mongo"; -import {Pulse, PulseService, Define, Every} from "../src/index.js"; + +import {Define, Every, Pulse, PulseService} from "../src/index.js"; import {Server} from "./helpers/Server.js"; @Pulse({namespace: "test-nsp"}) diff --git a/packages/third-parties/pulse/test/pulse-every.integration.spec.ts b/packages/third-parties/pulse/test/pulse-every.integration.spec.ts index 6c988ca11b3..5a36d4ea302 100644 --- a/packages/third-parties/pulse/test/pulse-every.integration.spec.ts +++ b/packages/third-parties/pulse/test/pulse-every.integration.spec.ts @@ -1,6 +1,7 @@ import {PlatformTest} from "@tsed/common"; import {TestContainersMongo} from "@tsed/testcontainers-mongo"; -import {Pulse, PulseService, Every} from "../src/index.js"; + +import {Every, Pulse, PulseService} from "../src/index.js"; import {Server} from "./helpers/Server.js"; @Pulse() diff --git a/packages/third-parties/pulse/tsconfig.esm.json b/packages/third-parties/pulse/tsconfig.esm.json index e3b07081667..82292550ddb 100644 --- a/packages/third-parties/pulse/tsconfig.esm.json +++ b/packages/third-parties/pulse/tsconfig.esm.json @@ -2,8 +2,7 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "module": "ESNext", - "moduleResolution": "nodenext", + "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", @@ -11,7 +10,7 @@ "composite": true, "noEmit": false }, - "include": ["src", "src/**/*.json"], + "include": ["src/**/*.ts", "src/**/*.json"], "exclude": [ "node_modules", "test", diff --git a/packages/third-parties/pulse/tsconfig.spec.json b/packages/third-parties/pulse/tsconfig.spec.json index b2e248f2c69..9835f975711 100644 --- a/packages/third-parties/pulse/tsconfig.spec.json +++ b/packages/third-parties/pulse/tsconfig.spec.json @@ -3,7 +3,6 @@ "compilerOptions": { "baseUrl": ".", "rootDir": "../..", - "module": "commonjs", "outDir": "./lib/cjs", "declaration": false, "composite": false, diff --git a/packages/third-parties/schema-formio/package.json b/packages/third-parties/schema-formio/package.json index 4ec1aef7855..aaf28130747 100644 --- a/packages/third-parties/schema-formio/package.json +++ b/packages/third-parties/schema-formio/package.json @@ -49,7 +49,7 @@ "@tsed/schema": "workspace:*", "@tsed/typescript": "workspace:*", "eslint": "^8.57.0", - "typescript": "4.9.5", + "typescript": "5.6.2", "vitest": "2.0.4" }, "peerDependencies": { diff --git a/packages/third-parties/schema-formio/src/components/arrayToComponent.ts b/packages/third-parties/schema-formio/src/components/arrayToComponent.ts index c72baca4434..73de188793c 100644 --- a/packages/third-parties/schema-formio/src/components/arrayToComponent.ts +++ b/packages/third-parties/schema-formio/src/components/arrayToComponent.ts @@ -1,4 +1,5 @@ import {cleanObject} from "@tsed/core"; + import {execMapper, registerFormioMapper} from "../registries/FormioMappersContainer.js"; import {getRef} from "../utils/getRef.js"; diff --git a/packages/third-parties/schema-formio/src/components/booleanToComponent.ts b/packages/third-parties/schema-formio/src/components/booleanToComponent.ts index f86eac58b79..e0df9ac8b5d 100644 --- a/packages/third-parties/schema-formio/src/components/booleanToComponent.ts +++ b/packages/third-parties/schema-formio/src/components/booleanToComponent.ts @@ -1,4 +1,5 @@ import {cleanObject} from "@tsed/core"; + import {execMapper, registerFormioMapper} from "../registries/FormioMappersContainer.js"; function booleanToComponent(schema: any, options: any) { diff --git a/packages/third-parties/schema-formio/src/components/dateToComponent.ts b/packages/third-parties/schema-formio/src/components/dateToComponent.ts index 147b39996f8..d71cd362c0e 100644 --- a/packages/third-parties/schema-formio/src/components/dateToComponent.ts +++ b/packages/third-parties/schema-formio/src/components/dateToComponent.ts @@ -1,4 +1,5 @@ import {getValue} from "@tsed/core"; + import {execMapper, registerFormioMapper} from "../registries/FormioMappersContainer.js"; function dateToComponent(schema: any, options: any) { diff --git a/packages/third-parties/schema-formio/src/components/defaultToComponent.ts b/packages/third-parties/schema-formio/src/components/defaultToComponent.ts index b25890ad493..eba83a2b82d 100644 --- a/packages/third-parties/schema-formio/src/components/defaultToComponent.ts +++ b/packages/third-parties/schema-formio/src/components/defaultToComponent.ts @@ -1,4 +1,5 @@ import {cleanObject} from "@tsed/core"; + import {registerFormioMapper} from "../registries/FormioMappersContainer.js"; import {getFormioProps} from "../utils/getFormioProps.js"; diff --git a/packages/third-parties/schema-formio/src/components/enumToComponent.ts b/packages/third-parties/schema-formio/src/components/enumToComponent.ts index e9a08e59e62..fe7eeea77b2 100644 --- a/packages/third-parties/schema-formio/src/components/enumToComponent.ts +++ b/packages/third-parties/schema-formio/src/components/enumToComponent.ts @@ -1,4 +1,5 @@ import {cleanObject} from "@tsed/core"; + import {execMapper, registerFormioMapper} from "../registries/FormioMappersContainer.js"; export function enumToComponent(schema: any, options: any) { diff --git a/packages/third-parties/schema-formio/src/components/nestedToComponent.ts b/packages/third-parties/schema-formio/src/components/nestedToComponent.ts index c66025fa7aa..8e8d734758f 100644 --- a/packages/third-parties/schema-formio/src/components/nestedToComponent.ts +++ b/packages/third-parties/schema-formio/src/components/nestedToComponent.ts @@ -1,4 +1,5 @@ import {sentenceCase} from "change-case"; + import {execMapper, registerFormioMapper} from "../registries/FormioMappersContainer.js"; export function nestedToComponent(schema: any, options: any) { diff --git a/packages/third-parties/schema-formio/src/components/numberToComponent.ts b/packages/third-parties/schema-formio/src/components/numberToComponent.ts index 51e4142ade9..b475d9f7da2 100644 --- a/packages/third-parties/schema-formio/src/components/numberToComponent.ts +++ b/packages/third-parties/schema-formio/src/components/numberToComponent.ts @@ -1,4 +1,5 @@ import {cleanObject, getValue} from "@tsed/core"; + import {execMapper, registerFormioMapper} from "../registries/FormioMappersContainer.js"; export function numberToComponent(schema: any, options: any) { diff --git a/packages/third-parties/schema-formio/src/components/propertiesToComponents.ts b/packages/third-parties/schema-formio/src/components/propertiesToComponents.ts index 3a2e9ba0ea4..dd1cb3aee81 100644 --- a/packages/third-parties/schema-formio/src/components/propertiesToComponents.ts +++ b/packages/third-parties/schema-formio/src/components/propertiesToComponents.ts @@ -1,6 +1,7 @@ import {cleanObject, isFunction} from "@tsed/core"; import {FormioComponent, FormioForm} from "@tsed/formio-types"; import {sentenceCase} from "change-case"; + import {execMapper, registerFormioMapper} from "../registries/FormioMappersContainer.js"; function bindResolvers(component: FormioComponent, options: any) { diff --git a/packages/third-parties/schema-formio/src/components/stringToComponent.ts b/packages/third-parties/schema-formio/src/components/stringToComponent.ts index dd80947e272..60f6fe8a573 100644 --- a/packages/third-parties/schema-formio/src/components/stringToComponent.ts +++ b/packages/third-parties/schema-formio/src/components/stringToComponent.ts @@ -1,4 +1,5 @@ import {cleanObject} from "@tsed/core"; + import {execMapper, registerFormioMapper} from "../registries/FormioMappersContainer.js"; export function stringToComponent(schema: any, options: any) { diff --git a/packages/third-parties/schema-formio/src/decorators/customConditional.ts b/packages/third-parties/schema-formio/src/decorators/customConditional.ts index 24e43d595bc..d18a6d9d190 100644 --- a/packages/third-parties/schema-formio/src/decorators/customConditional.ts +++ b/packages/third-parties/schema-formio/src/decorators/customConditional.ts @@ -1,9 +1,10 @@ +import {isArrowFn} from "@tsed/core"; import {FormioComponent, FormioForm, FormioSubmission} from "@tsed/formio-types"; -import type {Moment} from "moment"; -import type {LoDashStatic} from "lodash"; import type {Utils} from "formiojs"; +import type {LoDashStatic} from "lodash"; +import type {Moment} from "moment"; + import {Component} from "./component.js"; -import {isArrowFn} from "@tsed/core"; export interface CustomConditionalCtx { /** diff --git a/packages/third-parties/schema-formio/src/decorators/dataSourceJson.ts b/packages/third-parties/schema-formio/src/decorators/dataSourceJson.ts index 8b9df25ea95..64b9bc161b9 100644 --- a/packages/third-parties/schema-formio/src/decorators/dataSourceJson.ts +++ b/packages/third-parties/schema-formio/src/decorators/dataSourceJson.ts @@ -1,7 +1,8 @@ -import {Component} from "./component.js"; -import {FormioDataResolver, FormioDataResolverCtx} from "../domain/FormioDataResolver.js"; import {isFunction} from "@tsed/core"; +import {FormioDataResolver, FormioDataResolverCtx} from "../domain/FormioDataResolver.js"; +import {Component} from "./component.js"; + const wrap = (resolver: FormioDataResolver) => async (opts: FormioDataResolverCtx) => { const result = await resolver(opts); return JSON.stringify(result); diff --git a/packages/third-parties/schema-formio/src/decorators/dataSourceUrl.ts b/packages/third-parties/schema-formio/src/decorators/dataSourceUrl.ts index fc55e105211..50a534f4155 100644 --- a/packages/third-parties/schema-formio/src/decorators/dataSourceUrl.ts +++ b/packages/third-parties/schema-formio/src/decorators/dataSourceUrl.ts @@ -1,5 +1,5 @@ -import {Component} from "./component.js"; import {FormioDataResolver} from "../domain/FormioDataResolver.js"; +import {Component} from "./component.js"; /** * Set URL data on the current component. diff --git a/packages/third-parties/schema-formio/src/decorators/form.ts b/packages/third-parties/schema-formio/src/decorators/form.ts index c19b2bd95ee..ffb6bb4e6e5 100644 --- a/packages/third-parties/schema-formio/src/decorators/form.ts +++ b/packages/third-parties/schema-formio/src/decorators/form.ts @@ -2,6 +2,7 @@ import {nameOf, StoreSet, useDecorators} from "@tsed/core"; import {FormioForm} from "@tsed/formio-types"; import {Name} from "@tsed/schema"; import {paramCase} from "change-case"; + import {FormsContainer} from "../registries/FormsContainer.js"; import {Label} from "./label.js"; diff --git a/packages/third-parties/schema-formio/src/decorators/inputTags.ts b/packages/third-parties/schema-formio/src/decorators/inputTags.ts index 0f466e05d8d..1c5ac8c549d 100644 --- a/packages/third-parties/schema-formio/src/decorators/inputTags.ts +++ b/packages/third-parties/schema-formio/src/decorators/inputTags.ts @@ -1,5 +1,6 @@ import {useDecorators} from "@tsed/core"; import {CollectionOf} from "@tsed/schema"; + import {Component} from "./component.js"; /** * Configure the property as Tags component. diff --git a/packages/third-parties/schema-formio/src/decorators/label.ts b/packages/third-parties/schema-formio/src/decorators/label.ts index e5e1a54a6c0..9479b19c953 100644 --- a/packages/third-parties/schema-formio/src/decorators/label.ts +++ b/packages/third-parties/schema-formio/src/decorators/label.ts @@ -1,4 +1,5 @@ import {CustomKey, JsonEntityFn} from "@tsed/schema"; + import {Component} from "./component.js"; /** diff --git a/packages/third-parties/schema-formio/src/decorators/select.spec.ts b/packages/third-parties/schema-formio/src/decorators/select.spec.ts index 5ad7c26901e..7066e313cee 100644 --- a/packages/third-parties/schema-formio/src/decorators/select.spec.ts +++ b/packages/third-parties/schema-formio/src/decorators/select.spec.ts @@ -1,4 +1,5 @@ import {Enum} from "@tsed/schema"; + import {getFormioSchema} from "../utils/getFormioSchema.js"; import {Select} from "./select.js"; diff --git a/packages/third-parties/schema-formio/src/utils/getFormioSchema.spec.ts b/packages/third-parties/schema-formio/src/utils/getFormioSchema.spec.ts index 40bbef133a2..26edf4d686e 100644 --- a/packages/third-parties/schema-formio/src/utils/getFormioSchema.spec.ts +++ b/packages/third-parties/schema-formio/src/utils/getFormioSchema.spec.ts @@ -1,4 +1,5 @@ import {JsonEntityStore, Property} from "@tsed/schema"; + import {Form} from "../decorators/form.js"; import {getFormioSchema} from "../utils/getFormioSchema.js"; diff --git a/packages/third-parties/schema-formio/src/utils/getFormioSchema.ts b/packages/third-parties/schema-formio/src/utils/getFormioSchema.ts index ddb6d09e34b..0b688f708a2 100644 --- a/packages/third-parties/schema-formio/src/utils/getFormioSchema.ts +++ b/packages/third-parties/schema-formio/src/utils/getFormioSchema.ts @@ -1,9 +1,3 @@ -import {isString, Type} from "@tsed/core"; -import {getJsonSchema, JsonEntityStore, JsonSchemaOptions} from "@tsed/schema"; -import {FormioForm} from "@tsed/formio-types"; -import {execMapper} from "../registries/FormioMappersContainer.js"; -import {FormsContainer} from "../registries/FormsContainer.js"; -import {paramCase} from "change-case"; import "../components/anyToComponent.js"; import "../components/arrayToComponent.js"; import "../components/booleanToComponent.js"; @@ -18,6 +12,14 @@ import "../components/panelToComponent.js"; import "../components/propertiesToComponents.js"; import "../components/stringToComponent.js"; +import {isString, Type} from "@tsed/core"; +import {FormioForm} from "@tsed/formio-types"; +import {getJsonSchema, JsonEntityStore, JsonSchemaOptions} from "@tsed/schema"; +import {paramCase} from "change-case"; + +import {execMapper} from "../registries/FormioMappersContainer.js"; +import {FormsContainer} from "../registries/FormsContainer.js"; + export async function getFormioSchema( model: string | any | undefined, options: JsonSchemaOptions = {} diff --git a/packages/third-parties/schema-formio/test/array.integration.spec.ts b/packages/third-parties/schema-formio/test/array.integration.spec.ts index 142a757916a..912ce2414ba 100644 --- a/packages/third-parties/schema-formio/test/array.integration.spec.ts +++ b/packages/third-parties/schema-formio/test/array.integration.spec.ts @@ -1,4 +1,5 @@ import {CollectionOf} from "@tsed/schema"; + import {getFormioSchema} from "../src/index.js"; describe("Array", () => { diff --git a/packages/third-parties/schema-formio/test/basic.integration.spec.ts b/packages/third-parties/schema-formio/test/basic.integration.spec.ts index 0b42660e24f..2d6a0efd037 100644 --- a/packages/third-parties/schema-formio/test/basic.integration.spec.ts +++ b/packages/third-parties/schema-formio/test/basic.integration.spec.ts @@ -12,6 +12,7 @@ import { Title, Uri } from "@tsed/schema"; + import {getFormioSchema, InputTags, TableView} from "../src/index.js"; export enum OIDCResponseTypes { diff --git a/packages/third-parties/schema-formio/test/datamap.integration.spec.ts b/packages/third-parties/schema-formio/test/datamap.integration.spec.ts index e5ec5f8fa68..8622b1f2489 100644 --- a/packages/third-parties/schema-formio/test/datamap.integration.spec.ts +++ b/packages/third-parties/schema-formio/test/datamap.integration.spec.ts @@ -1,4 +1,5 @@ import {CollectionOf} from "@tsed/schema"; + import {getFormioSchema} from "../src/index.js"; describe("DataMap integration", () => { diff --git a/packages/third-parties/schema-formio/test/date.integration.spec.ts b/packages/third-parties/schema-formio/test/date.integration.spec.ts index 5fdf441b362..b6ecb314ae1 100644 --- a/packages/third-parties/schema-formio/test/date.integration.spec.ts +++ b/packages/third-parties/schema-formio/test/date.integration.spec.ts @@ -1,4 +1,5 @@ import {DateFormat, DateTime} from "@tsed/schema"; + import {Component, getFormioSchema} from "../src/index.js"; describe("Date integration", () => { diff --git a/packages/third-parties/schema-formio/test/deep-nested-form.integration.spec.ts b/packages/third-parties/schema-formio/test/deep-nested-form.integration.spec.ts index 88e05cb7664..898b7497eb7 100644 --- a/packages/third-parties/schema-formio/test/deep-nested-form.integration.spec.ts +++ b/packages/third-parties/schema-formio/test/deep-nested-form.integration.spec.ts @@ -1,4 +1,5 @@ import {Default, Property} from "@tsed/schema"; + import {Form, getFormioSchema, Label} from "../src/index.js"; @Form({label: "One hour before this maintenance"}) diff --git a/packages/third-parties/schema-formio/test/editgrid.integration.spec.ts b/packages/third-parties/schema-formio/test/editgrid.integration.spec.ts index a740eec34ba..ec1a94b32de 100644 --- a/packages/third-parties/schema-formio/test/editgrid.integration.spec.ts +++ b/packages/third-parties/schema-formio/test/editgrid.integration.spec.ts @@ -1,6 +1,7 @@ import {CollectionOf, MaxItems, MinItems, Property} from "@tsed/schema"; -import {getFormioSchema} from "../src/index.js"; + import {OpenWhenEmpty} from "../src/decorators/openWhenEmpty.js"; +import {getFormioSchema} from "../src/index.js"; describe("EditGrid integration", () => { it("should generate form", async () => { diff --git a/packages/third-parties/schema-formio/test/email.integration.spec.ts b/packages/third-parties/schema-formio/test/email.integration.spec.ts index f8bcf6ff3ab..1562c38e518 100644 --- a/packages/third-parties/schema-formio/test/email.integration.spec.ts +++ b/packages/third-parties/schema-formio/test/email.integration.spec.ts @@ -1,4 +1,5 @@ import {Email} from "@tsed/schema"; + import {getFormioSchema} from "../src/index.js"; describe("Email integration", () => { diff --git a/packages/third-parties/schema-formio/test/enums.integration.spec.ts b/packages/third-parties/schema-formio/test/enums.integration.spec.ts index 470418943e5..7814c07619a 100644 --- a/packages/third-parties/schema-formio/test/enums.integration.spec.ts +++ b/packages/third-parties/schema-formio/test/enums.integration.spec.ts @@ -1,4 +1,5 @@ import {Enum} from "@tsed/schema"; + import {DataSourceJson, getFormioSchema, Select} from "../src/index.js"; enum TestEnum { diff --git a/packages/third-parties/schema-formio/test/nested-form.integration.spec.ts b/packages/third-parties/schema-formio/test/nested-form.integration.spec.ts index e2a9138e1f2..9d66d4c8dee 100644 --- a/packages/third-parties/schema-formio/test/nested-form.integration.spec.ts +++ b/packages/third-parties/schema-formio/test/nested-form.integration.spec.ts @@ -1,4 +1,5 @@ import {Property, ReadOnly, Required} from "@tsed/schema"; + import {Currency, getFormioSchema, Hidden, TableView, Textarea} from "../src/index.js"; describe("Nested form integration", () => { diff --git a/packages/third-parties/schema-formio/test/number.integration.spec.ts b/packages/third-parties/schema-formio/test/number.integration.spec.ts index 58c3f48f7d6..2bdb168c2a3 100644 --- a/packages/third-parties/schema-formio/test/number.integration.spec.ts +++ b/packages/third-parties/schema-formio/test/number.integration.spec.ts @@ -1,4 +1,5 @@ import {Maximum, Minimum, Property} from "@tsed/schema"; + import {getFormioSchema} from "../src/index.js"; describe("Number", () => { diff --git a/packages/third-parties/schema-formio/test/object.integration.spec.ts b/packages/third-parties/schema-formio/test/object.integration.spec.ts index 07a4d9cb864..9d497b4e188 100644 --- a/packages/third-parties/schema-formio/test/object.integration.spec.ts +++ b/packages/third-parties/schema-formio/test/object.integration.spec.ts @@ -1,4 +1,5 @@ import {Property} from "@tsed/schema"; + import {getFormioSchema} from "../src/index.js"; describe("Object", () => { diff --git a/packages/third-parties/schema-formio/test/required.integration.spec.ts b/packages/third-parties/schema-formio/test/required.integration.spec.ts index c9a6a120f4a..ff8e88dc75e 100644 --- a/packages/third-parties/schema-formio/test/required.integration.spec.ts +++ b/packages/third-parties/schema-formio/test/required.integration.spec.ts @@ -1,4 +1,5 @@ import {MinLength, Required} from "@tsed/schema"; + import {getFormioSchema} from "../src/index.js"; describe("Required", () => { diff --git a/packages/third-parties/schema-formio/test/string.integration.spec.ts b/packages/third-parties/schema-formio/test/string.integration.spec.ts index 3d38657ec68..63b98b99607 100644 --- a/packages/third-parties/schema-formio/test/string.integration.spec.ts +++ b/packages/third-parties/schema-formio/test/string.integration.spec.ts @@ -1,4 +1,5 @@ import {MaxLength, MinLength, Pattern, Property} from "@tsed/schema"; + import {getFormioSchema} from "../src/index.js"; describe("String", () => { diff --git a/packages/third-parties/schema-formio/test/tabs.integration.spec.ts b/packages/third-parties/schema-formio/test/tabs.integration.spec.ts index 2132342aa08..d87cd4af9fb 100644 --- a/packages/third-parties/schema-formio/test/tabs.integration.spec.ts +++ b/packages/third-parties/schema-formio/test/tabs.integration.spec.ts @@ -13,8 +13,9 @@ import { Title, Uri } from "@tsed/schema"; -import {getFormioSchema, InputTags, TableView} from "../src/index.js"; + import {Tabs} from "../src/decorators/tabs.js"; +import {getFormioSchema, InputTags, TableView} from "../src/index.js"; export enum OIDCResponseTypes { CODE = "code", diff --git a/packages/third-parties/schema-formio/tsconfig.esm.json b/packages/third-parties/schema-formio/tsconfig.esm.json index e3b07081667..82292550ddb 100644 --- a/packages/third-parties/schema-formio/tsconfig.esm.json +++ b/packages/third-parties/schema-formio/tsconfig.esm.json @@ -2,8 +2,7 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "module": "ESNext", - "moduleResolution": "nodenext", + "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", @@ -11,7 +10,7 @@ "composite": true, "noEmit": false }, - "include": ["src", "src/**/*.json"], + "include": ["src/**/*.ts", "src/**/*.json"], "exclude": [ "node_modules", "test", diff --git a/packages/third-parties/schema-formio/tsconfig.spec.json b/packages/third-parties/schema-formio/tsconfig.spec.json index b2e248f2c69..9835f975711 100644 --- a/packages/third-parties/schema-formio/tsconfig.spec.json +++ b/packages/third-parties/schema-formio/tsconfig.spec.json @@ -3,7 +3,6 @@ "compilerOptions": { "baseUrl": ".", "rootDir": "../..", - "module": "commonjs", "outDir": "./lib/cjs", "declaration": false, "composite": false, diff --git a/packages/third-parties/socketio-testing/package.json b/packages/third-parties/socketio-testing/package.json index f740ddf49b0..d0d1546816b 100644 --- a/packages/third-parties/socketio-testing/package.json +++ b/packages/third-parties/socketio-testing/package.json @@ -29,7 +29,7 @@ "@tsed/typescript": "workspace:*", "eslint": "^8.57.0", "socket.io-client": "^4.7.5", - "typescript": "4.9.5" + "typescript": "5.6.2" }, "peerDependencies": { "@tsed/common": "8.0.0-alpha.5", diff --git a/packages/third-parties/socketio-testing/tsconfig.esm.json b/packages/third-parties/socketio-testing/tsconfig.esm.json index e3b07081667..82292550ddb 100644 --- a/packages/third-parties/socketio-testing/tsconfig.esm.json +++ b/packages/third-parties/socketio-testing/tsconfig.esm.json @@ -2,8 +2,7 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "module": "ESNext", - "moduleResolution": "nodenext", + "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", @@ -11,7 +10,7 @@ "composite": true, "noEmit": false }, - "include": ["src", "src/**/*.json"], + "include": ["src/**/*.ts", "src/**/*.json"], "exclude": [ "node_modules", "test", diff --git a/packages/third-parties/socketio/package.json b/packages/third-parties/socketio/package.json index e98e587e5a1..1fc08631382 100644 --- a/packages/third-parties/socketio/package.json +++ b/packages/third-parties/socketio/package.json @@ -47,7 +47,7 @@ "express": "^4.19.1", "socket.io": "4.7.5", "socket.io-client": "^4.7.5", - "typescript": "4.9.5", + "typescript": "5.6.2", "vitest": "2.0.4" }, "peerDependencies": { diff --git a/packages/third-parties/socketio/src/SocketIOModule.spec.ts b/packages/third-parties/socketio/src/SocketIOModule.spec.ts index da47a39a10d..54812899f72 100644 --- a/packages/third-parties/socketio/src/SocketIOModule.spec.ts +++ b/packages/third-parties/socketio/src/SocketIOModule.spec.ts @@ -1,6 +1,7 @@ import {PlatformConfiguration, PlatformTest} from "@tsed/common"; import Http from "http"; import Https from "https"; + import {SocketIOModule, SocketIOServer, SocketIOService} from "./index.js"; async function createModuleFixture() { @@ -51,9 +52,9 @@ describe("SocketIOModule", () => { expect(socketIOServer.attach).toHaveBeenCalledTimes(2); - expect((socketIOModule as any).getWebsocketServices).toBeCalledWith(); - expect(socketIOServer.adapter).toBeCalled(); - expect(socketIOService.addSocketProvider).toBeCalledWith({provider: "provider"}); + expect((socketIOModule as any).getWebsocketServices).toHaveBeenCalledWith(); + expect(socketIOServer.adapter).toHaveBeenCalled(); + expect(socketIOService.addSocketProvider).toHaveBeenCalledWith({provider: "provider"}); }); }); describe("with https server", () => { @@ -75,10 +76,10 @@ describe("SocketIOModule", () => { // WHEN await socketIOModule.$afterListen(); - expect(socketIOServer.attach).toBeCalled(); + expect(socketIOServer.attach).toHaveBeenCalled(); - expect((socketIOModule as any).getWebsocketServices).toBeCalledWith(); - expect(socketIOService.addSocketProvider).toBeCalledWith({provider: "provider"}); + expect((socketIOModule as any).getWebsocketServices).toHaveBeenCalledWith(); + expect(socketIOService.addSocketProvider).toHaveBeenCalledWith({provider: "provider"}); }); }); }); diff --git a/packages/third-parties/socketio/src/SocketIOModule.ts b/packages/third-parties/socketio/src/SocketIOModule.ts index aba61874179..8db51d0e6ab 100644 --- a/packages/third-parties/socketio/src/SocketIOModule.ts +++ b/packages/third-parties/socketio/src/SocketIOModule.ts @@ -1,13 +1,14 @@ import {$log, AfterListen, Constant, InjectorService, Module, OnDestroy, Provider} from "@tsed/common"; import {nameOf} from "@tsed/core"; +import {Inject} from "@tsed/di"; +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 import {PROVIDER_TYPE_SOCKET_SERVICE} from "./constants/constants.js"; import {IO} from "./decorators/io.js"; import {SocketIOService} from "./services/SocketIOService.js"; -import Http from "http"; -import Https from "https"; -import {Inject} from "@tsed/di"; /** * @ignore diff --git a/packages/third-parties/socketio/src/class/SocketHandlersBuilder.spec.ts b/packages/third-parties/socketio/src/class/SocketHandlersBuilder.spec.ts index 2839e01c12a..dff9e1d0293 100644 --- a/packages/third-parties/socketio/src/class/SocketHandlersBuilder.spec.ts +++ b/packages/third-parties/socketio/src/class/SocketHandlersBuilder.spec.ts @@ -1,6 +1,7 @@ import {DIContext, getContext, PlatformTest} from "@tsed/common"; import {Store} from "@tsed/core"; import {InjectorService, ProviderType} from "@tsed/di"; + import {SocketFilters} from "../interfaces/SocketFilters.js"; import {SocketReturnsTypes} from "../interfaces/SocketReturnsTypes.js"; import {SocketHandlersBuilder} from "./SocketHandlersBuilder.js"; @@ -91,7 +92,7 @@ describe("SocketHandlersBuilder", () => { }); it("should call $onNamespaceInit hook", () => { const {instance} = createServiceFixture(); - expect(instance.$onNamespaceInit).toBeCalledWith("namespace1"); + expect(instance.$onNamespaceInit).toHaveBeenCalledWith("namespace1"); }); it("should add namespace1", () => { const {instance} = createServiceFixture(); @@ -144,8 +145,8 @@ describe("SocketHandlersBuilder", () => { await builder.onConnection(socketStub, nspStub); - expect(buildHandlersStub).toBeCalledWith(socketStub, nspStub); - expect(invokeStub).toBeCalledWith( + expect(buildHandlersStub).toHaveBeenCalledWith(socketStub, nspStub); + expect(invokeStub).toHaveBeenCalledWith( instance, {eventName: "connection", methodClassName: "$onConnection"}, { @@ -235,7 +236,7 @@ describe("SocketHandlersBuilder", () => { await builder.onDisconnect(socketStub, nspStub); - expect(invokeStub).toBeCalledWith( + expect(invokeStub).toHaveBeenCalledWith( instance, {eventName: "disconnect", methodClassName: "$onDisconnect"}, { @@ -281,7 +282,7 @@ describe("SocketHandlersBuilder", () => { await builder.onDisconnect(socketStub, nspStub, reason); - expect(invokeStub).toBeCalledWith( + expect(invokeStub).toHaveBeenCalledWith( instance, {eventName: "disconnect", methodClassName: "$onDisconnect"}, { @@ -363,8 +364,8 @@ describe("SocketHandlersBuilder", () => { await builder.buildHandlers(socketStub, "ws"); - expect(socketStub.on).toBeCalledWith("eventName", expect.any(Function)); - expect(builder.runQueue).toBeCalledWith(metadata.handlers.testHandler, ["arg1"], socketStub, "ws"); + expect(socketStub.on).toHaveBeenCalledWith("eventName", expect.any(Function)); + expect(builder.runQueue).toHaveBeenCalledWith(metadata.handlers.testHandler, ["arg1"], socketStub, "ws"); }); it("should call the method instance in the context", async () => { @@ -431,11 +432,11 @@ describe("SocketHandlersBuilder", () => { builder.invoke(instance, metadata.handlers.testHandler, {scope: "scope"}); - expect(buildParametersStub).toBeCalledWith(["param"], { + expect(buildParametersStub).toHaveBeenCalledWith(["param"], { scope: "scope" }); - expect(instance.testHandler).toBeCalledWith("argMapped"); + expect(instance.testHandler).toHaveBeenCalledWith("argMapped"); }); }); describe("buildParameters()", () => { @@ -656,7 +657,7 @@ describe("SocketHandlersBuilder", () => { {nsp: nspStub} )({response: "response"}); - expect(nspStub.emit).toBeCalledWith("eventName", {response: "response"}); + expect(nspStub.emit).toHaveBeenCalledWith("eventName", {response: "response"}); }); }); describe("when BROADCAST_OTHERS", () => { @@ -677,7 +678,7 @@ describe("SocketHandlersBuilder", () => { {socket: socketStub} )({response: "response"}); - expect(socketStub.broadcast.emit).toBeCalledWith("eventName", {response: "response"}); + expect(socketStub.broadcast.emit).toHaveBeenCalledWith("eventName", {response: "response"}); }); }); @@ -697,7 +698,7 @@ describe("SocketHandlersBuilder", () => { {socket: socketStub} )({response: "response"}); - expect(socketStub.emit).toBeCalledWith("eventName", {response: "response"}); + expect(socketStub.emit).toHaveBeenCalledWith("eventName", {response: "response"}); }); }); }); @@ -742,7 +743,7 @@ describe("SocketHandlersBuilder", () => { await builder.runQueue(handlerMetadata, ["arg1"], "socket", "nsp"); - expect((builder as any).bindMiddleware).nthCalledWith( + expect((builder as any).bindMiddleware).toHaveBeenNthCalledWith( 1, {target: "target before global"}, { @@ -754,7 +755,7 @@ describe("SocketHandlersBuilder", () => { expect.any(Object) ); - expect((builder as any).bindMiddleware).nthCalledWith( + expect((builder as any).bindMiddleware).toHaveBeenNthCalledWith( 2, {target: "target before"}, { @@ -766,21 +767,21 @@ describe("SocketHandlersBuilder", () => { expect.any(Object) ); - expect(builder.invoke).toBeCalledWith(instance, handlerMetadata, { + expect(builder.invoke).toHaveBeenCalledWith(instance, handlerMetadata, { eventName: "eventName", args: ["arg1"], socket: "socket", nsp: "nsp" }); - expect((SocketHandlersBuilder as any).bindResponseMiddleware).toBeCalledWith(handlerMetadata, { + expect((SocketHandlersBuilder as any).bindResponseMiddleware).toHaveBeenCalledWith(handlerMetadata, { eventName: "eventName", args: ["arg1"], socket: "socket", nsp: "nsp" }); - expect((builder as any).bindMiddleware).nthCalledWith( + expect((builder as any).bindMiddleware).toHaveBeenNthCalledWith( 3, {target: "target after"}, { @@ -792,7 +793,7 @@ describe("SocketHandlersBuilder", () => { expect.any(Object) ); - expect((builder as any).bindMiddleware).nthCalledWith( + expect((builder as any).bindMiddleware).toHaveBeenNthCalledWith( 4, {target: "target after global"}, { @@ -804,7 +805,7 @@ describe("SocketHandlersBuilder", () => { expect.any(Object) ); - expect(builder.deserialize).toBeCalledWith(handlerMetadata, { + expect(builder.deserialize).toHaveBeenCalledWith(handlerMetadata, { eventName: "eventName", args: ["arg1"], socket: "socket", @@ -841,8 +842,8 @@ describe("SocketHandlersBuilder", () => { builder.bindMiddleware({target: "target"}, scope, Promise.resolve()); - expect(injector.get).toBeCalledWith({target: "target"}); - expect(builder.invoke).not.toBeCalled(); + expect(injector.get).toHaveBeenCalledWith({target: "target"}); + expect(builder.invoke).not.toHaveBeenCalled(); }); }); @@ -877,8 +878,8 @@ describe("SocketHandlersBuilder", () => { await builder.bindMiddleware({target: "target"}, scope, Promise.resolve()); // THEN - expect(injector.get).toBeCalledWith({target: "target"}); - expect(builder.invoke).toBeCalledWith(instance, "use", scope); + expect(injector.get).toHaveBeenCalledWith({target: "target"}); + expect(builder.invoke).toHaveBeenCalledWith(instance, "use", scope); expect(scope.args).toEqual([{result: "result"}]); }); }); @@ -920,8 +921,8 @@ describe("SocketHandlersBuilder", () => { await builder.bindMiddleware({target: "target"}, scope, Promise.reject(error)); // THEN - expect(injector.get).toBeCalledWith({target: "target"}); - expect(builder.invoke).toBeCalledWith(instance, "use", {error, ...scope}); + expect(injector.get).toHaveBeenCalledWith({target: "target"}); + expect(builder.invoke).toHaveBeenCalledWith(instance, "use", {error, ...scope}); }); }); }); diff --git a/packages/third-parties/socketio/src/class/SocketHandlersBuilder.ts b/packages/third-parties/socketio/src/class/SocketHandlersBuilder.ts index ca92186a8ca..5053f62f88c 100644 --- a/packages/third-parties/socketio/src/class/SocketHandlersBuilder.ts +++ b/packages/third-parties/socketio/src/class/SocketHandlersBuilder.ts @@ -3,6 +3,8 @@ import {DIContext, InjectorService, Provider, runInContext} from "@tsed/di"; import {deserialize} from "@tsed/json-mapper"; import {$log} from "@tsed/logger"; import {Namespace, Socket} from "socket.io"; +import {v4} from "uuid"; + import {SocketFilters} from "../interfaces/SocketFilters.js"; import {SocketHandlerMetadata} from "../interfaces/SocketHandlerMetadata.js"; import {SocketInjectableNsp} from "../interfaces/SocketInjectableNsp.js"; @@ -11,7 +13,6 @@ import {SocketProviderTypes} from "../interfaces/SocketProviderTypes.js"; import {SocketReturnsTypes} from "../interfaces/SocketReturnsTypes.js"; import {SocketProviderMetadata} from "./SocketProviderMetadata.js"; import {SocketSessionData} from "./SocketSessionData.js"; -import {v4} from "uuid"; /** * @ignore diff --git a/packages/third-parties/socketio/src/class/SocketSessionData.ts b/packages/third-parties/socketio/src/class/SocketSessionData.ts index 603625d2bef..852477a4125 100644 --- a/packages/third-parties/socketio/src/class/SocketSessionData.ts +++ b/packages/third-parties/socketio/src/class/SocketSessionData.ts @@ -21,7 +21,7 @@ export class SocketSessionData extends Map { this.#data = data; } - public *[Symbol.iterator](): IterableIterator<[string, unknown]> { + public *[Symbol.iterator](): MapIterator<[string, unknown]> { for (const key in this.#data) { yield [key, this.#data[key]]; } @@ -42,7 +42,7 @@ export class SocketSessionData extends Map { return false; } - public *entries(): IterableIterator<[string, unknown]> { + public *entries(): MapIterator<[string, unknown]> { for (const key in this.#data) { yield [key, this.#data[key]]; } @@ -62,7 +62,7 @@ export class SocketSessionData extends Map { return key in this.#data; } - public *keys(): IterableIterator { + public *keys(): MapIterator { for (const key in this.#data) { yield key; } @@ -73,7 +73,7 @@ export class SocketSessionData extends Map { return this; } - public *values(): IterableIterator { + public *values(): MapIterator { for (const key in this.#data) { yield this.#data[key]; } diff --git a/packages/third-parties/socketio/src/decorators/args.spec.ts b/packages/third-parties/socketio/src/decorators/args.spec.ts index ae153e43472..5db26d63887 100644 --- a/packages/third-parties/socketio/src/decorators/args.spec.ts +++ b/packages/third-parties/socketio/src/decorators/args.spec.ts @@ -1,4 +1,5 @@ import {Store} from "@tsed/core"; + import {Args} from "../index.js"; describe("Args", () => { diff --git a/packages/third-parties/socketio/src/decorators/args.ts b/packages/third-parties/socketio/src/decorators/args.ts index b2b2993c087..1b8b1f386a7 100644 --- a/packages/third-parties/socketio/src/decorators/args.ts +++ b/packages/third-parties/socketio/src/decorators/args.ts @@ -1,4 +1,5 @@ import {isCollection, Metadata, Store} from "@tsed/core"; + import {SocketFilters} from "../interfaces/SocketFilters.js"; /** diff --git a/packages/third-parties/socketio/src/decorators/broadcast.spec.ts b/packages/third-parties/socketio/src/decorators/broadcast.spec.ts index de82f9661fd..2b248b7c95b 100644 --- a/packages/third-parties/socketio/src/decorators/broadcast.spec.ts +++ b/packages/third-parties/socketio/src/decorators/broadcast.spec.ts @@ -1,4 +1,5 @@ import {Store} from "@tsed/core"; + import {Broadcast} from "../index.js"; describe("Broadcast", () => { diff --git a/packages/third-parties/socketio/src/decorators/broadcastOthers.spec.ts b/packages/third-parties/socketio/src/decorators/broadcastOthers.spec.ts index 9fa1839ff31..d81ba9a1915 100644 --- a/packages/third-parties/socketio/src/decorators/broadcastOthers.spec.ts +++ b/packages/third-parties/socketio/src/decorators/broadcastOthers.spec.ts @@ -1,4 +1,5 @@ import {Store} from "@tsed/core"; + import {BroadcastOthers} from "../index.js"; describe("BroadcastOthers", () => { diff --git a/packages/third-parties/socketio/src/decorators/emit.spec.ts b/packages/third-parties/socketio/src/decorators/emit.spec.ts index a088531344b..f0d0f43e3d4 100644 --- a/packages/third-parties/socketio/src/decorators/emit.spec.ts +++ b/packages/third-parties/socketio/src/decorators/emit.spec.ts @@ -1,4 +1,5 @@ import {Store} from "@tsed/core"; + import {Emit} from "../index.js"; describe("Emit", () => { diff --git a/packages/third-parties/socketio/src/decorators/input.spec.ts b/packages/third-parties/socketio/src/decorators/input.spec.ts index 74d24524187..b1ccc2eeb13 100644 --- a/packages/third-parties/socketio/src/decorators/input.spec.ts +++ b/packages/third-parties/socketio/src/decorators/input.spec.ts @@ -1,4 +1,5 @@ import {Store} from "@tsed/core"; + import {Input} from "../index.js"; describe("Input", () => { diff --git a/packages/third-parties/socketio/src/decorators/inputAndBroadcast.spec.ts b/packages/third-parties/socketio/src/decorators/inputAndBroadcast.spec.ts index c417103a226..6e7771c5476 100644 --- a/packages/third-parties/socketio/src/decorators/inputAndBroadcast.spec.ts +++ b/packages/third-parties/socketio/src/decorators/inputAndBroadcast.spec.ts @@ -1,4 +1,5 @@ import {Store} from "@tsed/core"; + import {InputAndBroadcast} from "../index.js"; describe("InputAndBroadcast", () => { diff --git a/packages/third-parties/socketio/src/decorators/inputAndBroadcastOthers.spec.ts b/packages/third-parties/socketio/src/decorators/inputAndBroadcastOthers.spec.ts index ca63f92f95b..4b3f9dd3e68 100644 --- a/packages/third-parties/socketio/src/decorators/inputAndBroadcastOthers.spec.ts +++ b/packages/third-parties/socketio/src/decorators/inputAndBroadcastOthers.spec.ts @@ -1,4 +1,5 @@ import {Store} from "@tsed/core"; + import {InputAndBroadcastOthers} from "../index.js"; describe("InputAndBroadcastOthers", () => { diff --git a/packages/third-parties/socketio/src/decorators/inputAndEmit.spec.ts b/packages/third-parties/socketio/src/decorators/inputAndEmit.spec.ts index 03ce5faf09e..086fa958a7f 100644 --- a/packages/third-parties/socketio/src/decorators/inputAndEmit.spec.ts +++ b/packages/third-parties/socketio/src/decorators/inputAndEmit.spec.ts @@ -1,4 +1,5 @@ import {Store} from "@tsed/core"; + import {InputAndEmit} from "../index.js"; describe("InputAndEmit", () => { diff --git a/packages/third-parties/socketio/src/decorators/io.ts b/packages/third-parties/socketio/src/decorators/io.ts index cc5ca73b649..add57f8c1b5 100644 --- a/packages/third-parties/socketio/src/decorators/io.ts +++ b/packages/third-parties/socketio/src/decorators/io.ts @@ -1,5 +1,6 @@ -import {Inject} from "@tsed/di"; import {Type} from "@tsed/core"; +import {Inject} from "@tsed/di"; + import {Server} from "../services/SocketIOServer.js"; /** diff --git a/packages/third-parties/socketio/src/decorators/nsp.spec.ts b/packages/third-parties/socketio/src/decorators/nsp.spec.ts index 535279d3daa..fce00f18293 100644 --- a/packages/third-parties/socketio/src/decorators/nsp.spec.ts +++ b/packages/third-parties/socketio/src/decorators/nsp.spec.ts @@ -1,4 +1,5 @@ import {Store} from "@tsed/core"; + import {Nsp} from "../index.js"; describe("Nsp", () => { diff --git a/packages/third-parties/socketio/src/decorators/nsp.ts b/packages/third-parties/socketio/src/decorators/nsp.ts index 3be79c5d1bb..7ef5fa89635 100644 --- a/packages/third-parties/socketio/src/decorators/nsp.ts +++ b/packages/third-parties/socketio/src/decorators/nsp.ts @@ -1,5 +1,6 @@ -import {decoratorTypeOf, DecoratorTypes, Store, isRegExp} from "@tsed/core"; +import {decoratorTypeOf, DecoratorTypes, isRegExp, Store} from "@tsed/core"; import {Namespace as NamespaceType} from "socket.io"; + import {SocketFilters} from "../interfaces/SocketFilters.js"; import {SocketFilter} from "./socketFilter.js"; diff --git a/packages/third-parties/socketio/src/decorators/reason.spec.ts b/packages/third-parties/socketio/src/decorators/reason.spec.ts index 7794cc7307b..814bc07396a 100644 --- a/packages/third-parties/socketio/src/decorators/reason.spec.ts +++ b/packages/third-parties/socketio/src/decorators/reason.spec.ts @@ -1,4 +1,5 @@ import {Store} from "@tsed/core"; + import {Nsp, SocketErr} from "../index.js"; import {Reason} from "./reason.js"; diff --git a/packages/third-parties/socketio/src/decorators/reason.ts b/packages/third-parties/socketio/src/decorators/reason.ts index ef79148e2af..df4e1de7053 100644 --- a/packages/third-parties/socketio/src/decorators/reason.ts +++ b/packages/third-parties/socketio/src/decorators/reason.ts @@ -1,5 +1,5 @@ -import {SocketFilter} from "./socketFilter.js"; import {SocketFilters} from "../interfaces/SocketFilters.js"; +import {SocketFilter} from "./socketFilter.js"; /** * Inject the disconnection reason into the decorated parameter. diff --git a/packages/third-parties/socketio/src/decorators/socket.spec.ts b/packages/third-parties/socketio/src/decorators/socket.spec.ts index 2a8079f4d00..f5c79d72a01 100644 --- a/packages/third-parties/socketio/src/decorators/socket.spec.ts +++ b/packages/third-parties/socketio/src/decorators/socket.spec.ts @@ -1,4 +1,5 @@ import {Store} from "@tsed/core"; + import {Socket} from "../index.js"; describe("Socket", () => { diff --git a/packages/third-parties/socketio/src/decorators/socket.ts b/packages/third-parties/socketio/src/decorators/socket.ts index 35677c1727a..bcf81e67976 100644 --- a/packages/third-parties/socketio/src/decorators/socket.ts +++ b/packages/third-parties/socketio/src/decorators/socket.ts @@ -1,4 +1,5 @@ import {Socket as SocketType} from "socket.io"; + import {SocketFilters} from "../interfaces/SocketFilters.js"; import {SocketFilter} from "./socketFilter.js"; diff --git a/packages/third-parties/socketio/src/decorators/socketErr.spec.ts b/packages/third-parties/socketio/src/decorators/socketErr.spec.ts index 6119d66470c..12ebe689011 100644 --- a/packages/third-parties/socketio/src/decorators/socketErr.spec.ts +++ b/packages/third-parties/socketio/src/decorators/socketErr.spec.ts @@ -1,4 +1,5 @@ import {Store} from "@tsed/core"; + import {SocketErr} from "../index.js"; describe("@SocketErr", () => { diff --git a/packages/third-parties/socketio/src/decorators/socketEventName.spec.ts b/packages/third-parties/socketio/src/decorators/socketEventName.spec.ts index 69cf1d9b7e3..4bf5d0dfbfb 100644 --- a/packages/third-parties/socketio/src/decorators/socketEventName.spec.ts +++ b/packages/third-parties/socketio/src/decorators/socketEventName.spec.ts @@ -1,4 +1,5 @@ import {Store} from "@tsed/core"; + import {SocketEventName} from "../index.js"; describe("@SocketEventName", () => { diff --git a/packages/third-parties/socketio/src/decorators/socketFilter.ts b/packages/third-parties/socketio/src/decorators/socketFilter.ts index a670959619d..385fd4047ee 100644 --- a/packages/third-parties/socketio/src/decorators/socketFilter.ts +++ b/packages/third-parties/socketio/src/decorators/socketFilter.ts @@ -1,4 +1,5 @@ import {Store} from "@tsed/core"; + import {SocketFilters} from "../interfaces/SocketFilters.js"; /** diff --git a/packages/third-parties/socketio/src/decorators/socketMiddleware.spec.ts b/packages/third-parties/socketio/src/decorators/socketMiddleware.spec.ts index 5d07bc465af..5949cecc653 100644 --- a/packages/third-parties/socketio/src/decorators/socketMiddleware.spec.ts +++ b/packages/third-parties/socketio/src/decorators/socketMiddleware.spec.ts @@ -1,4 +1,5 @@ import {Store} from "@tsed/core"; + import {SocketMiddleware, SocketProviderTypes} from "../index.js"; describe("@SocketMiddleware", () => { diff --git a/packages/third-parties/socketio/src/decorators/socketMiddleware.ts b/packages/third-parties/socketio/src/decorators/socketMiddleware.ts index 627b3bde0fa..f070661a02b 100644 --- a/packages/third-parties/socketio/src/decorators/socketMiddleware.ts +++ b/packages/third-parties/socketio/src/decorators/socketMiddleware.ts @@ -1,5 +1,6 @@ -import {Middleware} from "@tsed/platform-middlewares"; import {Store, Type} from "@tsed/core"; +import {Middleware} from "@tsed/platform-middlewares"; + import {SocketProviderTypes} from "../interfaces/SocketProviderTypes.js"; /** diff --git a/packages/third-parties/socketio/src/decorators/socketMiddlewareError.spec.ts b/packages/third-parties/socketio/src/decorators/socketMiddlewareError.spec.ts index ca37db89a6a..aad422dd765 100644 --- a/packages/third-parties/socketio/src/decorators/socketMiddlewareError.spec.ts +++ b/packages/third-parties/socketio/src/decorators/socketMiddlewareError.spec.ts @@ -1,4 +1,5 @@ import {Store} from "@tsed/core"; + import {SocketMiddlewareError, SocketProviderTypes} from "../index.js"; describe("@SocketMiddlewareError", () => { diff --git a/packages/third-parties/socketio/src/decorators/socketMiddlewareError.ts b/packages/third-parties/socketio/src/decorators/socketMiddlewareError.ts index 518dd48983b..9cb0c178be0 100644 --- a/packages/third-parties/socketio/src/decorators/socketMiddlewareError.ts +++ b/packages/third-parties/socketio/src/decorators/socketMiddlewareError.ts @@ -1,5 +1,6 @@ -import {Middleware} from "@tsed/platform-middlewares"; import {Store, Type} from "@tsed/core"; +import {Middleware} from "@tsed/platform-middlewares"; + import {SocketProviderTypes} from "../interfaces/SocketProviderTypes.js"; /** diff --git a/packages/third-parties/socketio/src/decorators/socketNsp.spec.ts b/packages/third-parties/socketio/src/decorators/socketNsp.spec.ts index 279c290b236..be4e01c9c74 100644 --- a/packages/third-parties/socketio/src/decorators/socketNsp.spec.ts +++ b/packages/third-parties/socketio/src/decorators/socketNsp.spec.ts @@ -1,4 +1,5 @@ import {Store} from "@tsed/core"; + import {SocketNsp} from "../index.js"; describe("SocketNsp", () => { diff --git a/packages/third-parties/socketio/src/decorators/socketNsp.ts b/packages/third-parties/socketio/src/decorators/socketNsp.ts index d86aa666dd2..639779a46f3 100644 --- a/packages/third-parties/socketio/src/decorators/socketNsp.ts +++ b/packages/third-parties/socketio/src/decorators/socketNsp.ts @@ -1,5 +1,5 @@ -import {Namespace} from "./nsp.js"; import {SocketFilters} from "../interfaces/SocketFilters.js"; +import {Namespace} from "./nsp.js"; import {SocketFilter} from "./socketFilter.js"; export type SocketNsp = Namespace; diff --git a/packages/third-parties/socketio/src/decorators/socketReturns.ts b/packages/third-parties/socketio/src/decorators/socketReturns.ts index 73efa839f0d..fba726c5670 100644 --- a/packages/third-parties/socketio/src/decorators/socketReturns.ts +++ b/packages/third-parties/socketio/src/decorators/socketReturns.ts @@ -1,4 +1,5 @@ import {Store} from "@tsed/core"; + import {SocketReturnsTypes} from "../interfaces/SocketReturnsTypes.js"; /** diff --git a/packages/third-parties/socketio/src/decorators/socketService.spec.ts b/packages/third-parties/socketio/src/decorators/socketService.spec.ts index af179c1b709..5bac83f696a 100644 --- a/packages/third-parties/socketio/src/decorators/socketService.spec.ts +++ b/packages/third-parties/socketio/src/decorators/socketService.spec.ts @@ -1,4 +1,5 @@ import {Store} from "@tsed/core"; + import {SocketService} from "./socketService.js"; describe("SocketService", () => { diff --git a/packages/third-parties/socketio/src/decorators/socketService.ts b/packages/third-parties/socketio/src/decorators/socketService.ts index 94d8408d048..524c9b582ba 100644 --- a/packages/third-parties/socketio/src/decorators/socketService.ts +++ b/packages/third-parties/socketio/src/decorators/socketService.ts @@ -1,7 +1,8 @@ import {StoreMerge, useDecorators} from "@tsed/core"; import {Injectable} from "@tsed/di"; -import {SocketProviderTypes} from "../interfaces/SocketProviderTypes.js"; + import {PROVIDER_TYPE_SOCKET_SERVICE} from "../constants/constants.js"; +import {SocketProviderTypes} from "../interfaces/SocketProviderTypes.js"; /** * The decorators `@SocketService()` declare a new socket service (and service) can be injected in other service or controller on there `constructor`. diff --git a/packages/third-parties/socketio/src/decorators/socketSession.spec.ts b/packages/third-parties/socketio/src/decorators/socketSession.spec.ts index 68008063e64..02c5235d62a 100644 --- a/packages/third-parties/socketio/src/decorators/socketSession.spec.ts +++ b/packages/third-parties/socketio/src/decorators/socketSession.spec.ts @@ -1,4 +1,5 @@ import {Store} from "@tsed/core"; + import {RawSocketSession, SocketFilters, SocketSession} from "../index.js"; describe("SocketSession", () => { diff --git a/packages/third-parties/socketio/src/decorators/socketUseAfter.spec.ts b/packages/third-parties/socketio/src/decorators/socketUseAfter.spec.ts index 480079c33c5..cfb8b27decb 100644 --- a/packages/third-parties/socketio/src/decorators/socketUseAfter.spec.ts +++ b/packages/third-parties/socketio/src/decorators/socketUseAfter.spec.ts @@ -1,4 +1,5 @@ import {Store} from "@tsed/core"; + import {SocketUseAfter} from "../index.js"; describe("@SocketUseAfter", () => { diff --git a/packages/third-parties/socketio/src/decorators/socketUseBefore.spec.ts b/packages/third-parties/socketio/src/decorators/socketUseBefore.spec.ts index 015b51d0eea..b63d9aa4589 100644 --- a/packages/third-parties/socketio/src/decorators/socketUseBefore.spec.ts +++ b/packages/third-parties/socketio/src/decorators/socketUseBefore.spec.ts @@ -1,4 +1,5 @@ import {Store} from "@tsed/core"; + import {SocketUseBefore} from "../index.js"; describe("@SocketUseBefore", () => { diff --git a/packages/third-parties/socketio/src/interfaces/SocketParamMetadata.ts b/packages/third-parties/socketio/src/interfaces/SocketParamMetadata.ts index b02c00aaaaf..d88d575ada9 100644 --- a/packages/third-parties/socketio/src/interfaces/SocketParamMetadata.ts +++ b/packages/third-parties/socketio/src/interfaces/SocketParamMetadata.ts @@ -1,4 +1,5 @@ import {MetadataTypes} from "@tsed/core"; + import {SocketFilters} from "./SocketFilters.js"; export interface SocketParamMetadata extends Partial { diff --git a/packages/third-parties/socketio/src/services/SocketIOServer.spec.ts b/packages/third-parties/socketio/src/services/SocketIOServer.spec.ts index a102d16163a..8a94d193c5f 100644 --- a/packages/third-parties/socketio/src/services/SocketIOServer.spec.ts +++ b/packages/third-parties/socketio/src/services/SocketIOServer.spec.ts @@ -1,5 +1,6 @@ import {PlatformTest} from "@tsed/common"; -import {SocketIOServer, Server} from "./SocketIOServer.js"; + +import {Server, SocketIOServer} from "./SocketIOServer.js"; describe("SocketIOServer", () => { describe("when there is configuration", () => { diff --git a/packages/third-parties/socketio/src/services/SocketIOService.spec.ts b/packages/third-parties/socketio/src/services/SocketIOService.spec.ts index e167e36516b..29034a7a179 100644 --- a/packages/third-parties/socketio/src/services/SocketIOService.spec.ts +++ b/packages/third-parties/socketio/src/services/SocketIOService.spec.ts @@ -1,4 +1,5 @@ import {PlatformTest} from "@tsed/common"; + import {SocketIOService} from "../index.js"; import {Server} from "./SocketIOServer.js"; @@ -43,11 +44,11 @@ describe("SocketIOService", () => { namespace.on.mock.calls[0][1](socket); socket.on.mock.calls[0][1](reason); - expect(ioStub.of).toBeCalledWith(input); - expect(namespace.on).toBeCalledWith("connection", expect.any(Function)); - expect(instance.onConnection).toBeCalledWith(socket, namespace); - expect(socket.on).toBeCalledWith("disconnect", expect.any(Function)); - expect(instance.onDisconnect).toBeCalledWith(socket, namespace, reason); + expect(ioStub.of).toHaveBeenCalledWith(input); + expect(namespace.on).toHaveBeenCalledWith("connection", expect.any(Function)); + expect(instance.onConnection).toHaveBeenCalledWith(socket, namespace); + expect(socket.on).toHaveBeenCalledWith("disconnect", expect.any(Function)); + expect(instance.onDisconnect).toHaveBeenCalledWith(socket, namespace, reason); }); }); }); diff --git a/packages/third-parties/socketio/src/services/SocketIOService.ts b/packages/third-parties/socketio/src/services/SocketIOService.ts index 4c6c87ce29b..a8930c423bc 100644 --- a/packages/third-parties/socketio/src/services/SocketIOService.ts +++ b/packages/third-parties/socketio/src/services/SocketIOService.ts @@ -1,5 +1,6 @@ import {InjectorService, Provider, Service} from "@tsed/common"; import * as SocketIO from "socket.io"; // tslint:disable-line: no-unused-variable + import {SocketHandlersBuilder} from "../class/SocketHandlersBuilder.js"; import {SocketProviderMetadata} from "../class/SocketProviderMetadata.js"; import {IO} from "../decorators/io.js"; diff --git a/packages/third-parties/socketio/test/app/Server.ts b/packages/third-parties/socketio/test/app/Server.ts index 0ec0c7ebb2f..4df1e682861 100644 --- a/packages/third-parties/socketio/test/app/Server.ts +++ b/packages/third-parties/socketio/test/app/Server.ts @@ -1,11 +1,13 @@ import "@tsed/ajv"; -import {Configuration, Inject, PlatformApplication} from "@tsed/common"; import "@tsed/platform-express"; -import "@tsed/socketio"; +import "../.."; + +import {Configuration, Inject, PlatformApplication} from "@tsed/common"; import bodyParser from "body-parser"; import compress from "compression"; import cookieParser from "cookie-parser"; import methodOverride from "method-override"; + import {SocketPageCtrl} from "./controllers/pages/SocketPageCtrl.js"; const rootDir = import.meta.dirname; 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 10a8dd88e4e..f078ec9d0c2 100644 --- a/packages/third-parties/socketio/test/app/controllers/pages/SocketPageCtrl.ts +++ b/packages/third-parties/socketio/test/app/controllers/pages/SocketPageCtrl.ts @@ -1,7 +1,7 @@ import {Controller, Get} from "@tsed/common"; +import {View} from "@tsed/platform-views"; import {Returns} from "@tsed/schema"; import {Hidden} from "@tsed/swagger"; -import {View} from "@tsed/platform-views"; import fs from "fs"; @Controller("/") @@ -14,7 +14,7 @@ export class SocketPageCtrl { } @Get("/socket/socket.io.js") - @Returns(200).ContentType("application/javascript") + @(Returns(200).ContentType("application/javascript")) public getScript() { return fs.readFileSync(require.resolve("socket.io-client/dist/socket.io.js"), {encoding: "utf8"}); } diff --git a/packages/third-parties/socketio/test/app/index.ts b/packages/third-parties/socketio/test/app/index.ts index b10c5bdd06d..fdd368deaf2 100644 --- a/packages/third-parties/socketio/test/app/index.ts +++ b/packages/third-parties/socketio/test/app/index.ts @@ -1,5 +1,6 @@ import {$log} from "@tsed/common"; import {PlatformExpress} from "@tsed/platform-express"; + import {Server} from "./Server.js"; if (process.env.NODE_ENV !== "test") { diff --git a/packages/third-parties/socketio/test/app/middlewares/AuthSocketMiddleware.ts b/packages/third-parties/socketio/test/app/middlewares/AuthSocketMiddleware.ts index beed559bd2c..0434ef7e977 100644 --- a/packages/third-parties/socketio/test/app/middlewares/AuthSocketMiddleware.ts +++ b/packages/third-parties/socketio/test/app/middlewares/AuthSocketMiddleware.ts @@ -1,4 +1,4 @@ -import {Args, SocketMiddleware, SocketSession} from "@tsed/socketio"; +import {Args, SocketMiddleware, SocketSession} from "../../.."; @SocketMiddleware() export class AuthSocketMiddleware { diff --git a/packages/third-parties/socketio/test/app/middlewares/ConverterUserSocketMiddleware.ts b/packages/third-parties/socketio/test/app/middlewares/ConverterUserSocketMiddleware.ts index fcf1bc0c0bf..44258e81d3c 100644 --- a/packages/third-parties/socketio/test/app/middlewares/ConverterUserSocketMiddleware.ts +++ b/packages/third-parties/socketio/test/app/middlewares/ConverterUserSocketMiddleware.ts @@ -1,7 +1,8 @@ -import {Args, SocketMiddleware, SocketSession} from "@tsed/socketio"; -import {User} from "../models/User.js"; import {deserialize} from "@tsed/json-mapper"; +import {Args, SocketMiddleware, SocketSession} from "../../.."; +import {User} from "../models/User.js"; + @SocketMiddleware() export class ConverterUserSocketMiddleware { use(@Args(0) user: any[], @SocketSession session: SocketSession) { diff --git a/packages/third-parties/socketio/test/app/middlewares/ErrorHandlerSocketMiddleware.ts b/packages/third-parties/socketio/test/app/middlewares/ErrorHandlerSocketMiddleware.ts index 6fcb7620d13..ba23bbfd528 100644 --- a/packages/third-parties/socketio/test/app/middlewares/ErrorHandlerSocketMiddleware.ts +++ b/packages/third-parties/socketio/test/app/middlewares/ErrorHandlerSocketMiddleware.ts @@ -1,4 +1,4 @@ -import {Socket, SocketErr, SocketMiddlewareError} from "@tsed/socketio"; +import {Socket, SocketErr, SocketMiddlewareError} from "../../.."; @SocketMiddlewareError() export class ErrorHandlerSocketMiddleware { diff --git a/packages/third-parties/socketio/test/app/middlewares/InitSessionMiddleware.ts b/packages/third-parties/socketio/test/app/middlewares/InitSessionMiddleware.ts index 59f39f3b6f4..98717badd3f 100644 --- a/packages/third-parties/socketio/test/app/middlewares/InitSessionMiddleware.ts +++ b/packages/third-parties/socketio/test/app/middlewares/InitSessionMiddleware.ts @@ -1,4 +1,5 @@ import {Middleware, Request} from "@tsed/common"; + import {IUser} from "../models/User.js"; declare global { diff --git a/packages/third-parties/socketio/test/app/middlewares/ThrowErrorSocketMiddleware.ts b/packages/third-parties/socketio/test/app/middlewares/ThrowErrorSocketMiddleware.ts index ecba7a3fa67..345b666593c 100644 --- a/packages/third-parties/socketio/test/app/middlewares/ThrowErrorSocketMiddleware.ts +++ b/packages/third-parties/socketio/test/app/middlewares/ThrowErrorSocketMiddleware.ts @@ -1,5 +1,5 @@ -import {Args} from "@tsed/socketio"; -import {SocketMiddleware} from "@tsed/socketio"; +import {Args} from "../../.."; +import {SocketMiddleware} from "../../.."; @SocketMiddleware() export class ThrowErrorSocketMiddleware { diff --git a/packages/third-parties/socketio/test/app/models/User.ts b/packages/third-parties/socketio/test/app/models/User.ts index 69ae10f45d1..2cf189a243b 100644 --- a/packages/third-parties/socketio/test/app/models/User.ts +++ b/packages/third-parties/socketio/test/app/models/User.ts @@ -1,6 +1,6 @@ +import {Indexed, Model, ObjectID, Unique} from "@tsed/mongoose"; import {Allow, Email, Ignore, MinLength, Property, Required} from "@tsed/schema"; import {Hidden} from "@tsed/swagger"; -import {Indexed, Model, ObjectID, Unique} from "@tsed/mongoose"; export interface IUser { name: string; diff --git a/packages/third-parties/socketio/test/app/services/RoomWS.ts b/packages/third-parties/socketio/test/app/services/RoomWS.ts index d5f7eda3341..c550f1b2e16 100644 --- a/packages/third-parties/socketio/test/app/services/RoomWS.ts +++ b/packages/third-parties/socketio/test/app/services/RoomWS.ts @@ -1,6 +1,7 @@ import {getClass, nameOf} from "@tsed/core"; -import {Args, Emit, Input, IO, Nsp, Socket, SocketService, SocketSession, SocketUseAfter, SocketUseBefore} from "@tsed/socketio"; import {Namespace, Server, Socket as IOSocket} from "socket.io"; + +import {Args, Emit, Input, IO, Nsp, Socket, SocketService, SocketSession, SocketUseAfter, SocketUseBefore} from "../../.."; import {AuthSocketMiddleware} from "../middlewares/AuthSocketMiddleware.js"; import {ConverterUserSocketMiddleware} from "../middlewares/ConverterUserSocketMiddleware.js"; import {ErrorHandlerSocketMiddleware} from "../middlewares/ErrorHandlerSocketMiddleware.js"; diff --git a/packages/third-parties/socketio/test/socket.integration.spec.ts b/packages/third-parties/socketio/test/socket.integration.spec.ts index 08590495501..85c56f3df03 100644 --- a/packages/third-parties/socketio/test/socket.integration.spec.ts +++ b/packages/third-parties/socketio/test/socket.integration.spec.ts @@ -1,8 +1,9 @@ import {Inject, PlatformTest} from "@tsed/common"; import {PlatformExpress} from "@tsed/platform-express"; -import {Emit, Input, Nsp, SocketNsp, SocketIOServer, SocketService, SocketSession, SocketUseBefore} from "../src/index.js"; import {SocketClientService} from "@tsed/socketio-testing"; import {Namespace, Socket as IOSocket} from "socket.io"; + +import {Emit, Input, Nsp, SocketIOServer, SocketNsp, SocketService, SocketSession, SocketUseBefore} from "../src/index.js"; import {ConverterUserSocketMiddleware} from "./app/middlewares/ConverterUserSocketMiddleware.js"; import {Server} from "./app/Server.js"; diff --git a/packages/third-parties/socketio/test/socketio.spec.ts b/packages/third-parties/socketio/test/socketio.spec.ts index 44fd2be6562..730fee24fa5 100644 --- a/packages/third-parties/socketio/test/socketio.spec.ts +++ b/packages/third-parties/socketio/test/socketio.spec.ts @@ -1,7 +1,8 @@ import {Controller, Get, PlatformTest} from "@tsed/common"; import {PlatformExpress} from "@tsed/platform-express"; -import {Nsp, SocketService} from "@tsed/socketio"; import SuperTest from "supertest"; + +import {Nsp, SocketService} from ".."; import {Server} from "./app/Server.js"; @SocketService("/my-namespace") diff --git a/packages/third-parties/socketio/tsconfig.esm.json b/packages/third-parties/socketio/tsconfig.esm.json index e3b07081667..82292550ddb 100644 --- a/packages/third-parties/socketio/tsconfig.esm.json +++ b/packages/third-parties/socketio/tsconfig.esm.json @@ -2,8 +2,7 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "module": "ESNext", - "moduleResolution": "nodenext", + "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", @@ -11,7 +10,7 @@ "composite": true, "noEmit": false }, - "include": ["src", "src/**/*.json"], + "include": ["src/**/*.ts", "src/**/*.json"], "exclude": [ "node_modules", "test", diff --git a/packages/third-parties/socketio/tsconfig.spec.json b/packages/third-parties/socketio/tsconfig.spec.json index b2e248f2c69..9835f975711 100644 --- a/packages/third-parties/socketio/tsconfig.spec.json +++ b/packages/third-parties/socketio/tsconfig.spec.json @@ -3,7 +3,6 @@ "compilerOptions": { "baseUrl": ".", "rootDir": "../..", - "module": "commonjs", "outDir": "./lib/cjs", "declaration": false, "composite": false, diff --git a/packages/third-parties/sse/package.json b/packages/third-parties/sse/package.json index f470b0fc7c3..98989e5556f 100644 --- a/packages/third-parties/sse/package.json +++ b/packages/third-parties/sse/package.json @@ -45,7 +45,7 @@ "@tsed/typescript": "workspace:*", "eslint": "^8.57.0", "express": "^4.19.1", - "typescript": "4.9.5", + "typescript": "5.6.2", "vitest": "2.0.4" }, "peerDependencies": { diff --git a/packages/third-parties/sse/src/decorators/eventStream.ts b/packages/third-parties/sse/src/decorators/eventStream.ts index 67f6fd1805f..8a55d8c3bd4 100644 --- a/packages/third-parties/sse/src/decorators/eventStream.ts +++ b/packages/third-parties/sse/src/decorators/eventStream.ts @@ -1,6 +1,7 @@ import {StoreSet, useDecorators} from "@tsed/core"; import {Use} from "@tsed/platform-middlewares"; -import {Header, AcceptMime} from "@tsed/schema"; +import {AcceptMime, Header} from "@tsed/schema"; + import {EventStreamMiddleware} from "../middlewares/EventStreamMiddleware.js"; export interface EventStreamOpts { diff --git a/packages/third-parties/sse/src/decorators/eventStreamCtx.ts b/packages/third-parties/sse/src/decorators/eventStreamCtx.ts index 74a8cf9bd8d..453f0a07c4a 100644 --- a/packages/third-parties/sse/src/decorators/eventStreamCtx.ts +++ b/packages/third-parties/sse/src/decorators/eventStreamCtx.ts @@ -1,4 +1,5 @@ import {Context} from "@tsed/platform-params"; + import type {EventStreamContext} from "../domain/EventStreamContext.js"; export type EventStreamCtx = EventStreamContext; diff --git a/packages/third-parties/sse/src/domain/EventStreamContext.ts b/packages/third-parties/sse/src/domain/EventStreamContext.ts index bd00ecc7c14..52845ff05ee 100644 --- a/packages/third-parties/sse/src/domain/EventStreamContext.ts +++ b/packages/third-parties/sse/src/domain/EventStreamContext.ts @@ -3,6 +3,7 @@ import {isBoolean, isDate, isNumber, isString} from "@tsed/core"; import {PlatformResponseFilter} from "@tsed/platform-response-filter"; import type {EventEmitter} from "events"; import type {Observable} from "rxjs"; + import type {EventStreamOpts} from "../decorators/eventStream.js"; export type EventStreamContextOptions = { diff --git a/packages/third-parties/sse/src/interceptors/EventStreamInterceptor.ts b/packages/third-parties/sse/src/interceptors/EventStreamInterceptor.ts index ebabc40f211..a071a5efb2e 100644 --- a/packages/third-parties/sse/src/interceptors/EventStreamInterceptor.ts +++ b/packages/third-parties/sse/src/interceptors/EventStreamInterceptor.ts @@ -1,9 +1,10 @@ import type {PlatformContext} from "@tsed/common"; import {InjectContext} from "@tsed/common"; -import {isStream, isObservable} from "@tsed/core"; +import {isObservable, isStream} from "@tsed/core"; import type {InterceptorContext, InterceptorMethods} from "@tsed/di"; import {Injectable} from "@tsed/di"; import type {Observable} from "rxjs"; + import {EventStreamContext} from "../domain/EventStreamContext.js"; @Injectable() diff --git a/packages/third-parties/sse/src/middlewares/EventStreamMiddleware.ts b/packages/third-parties/sse/src/middlewares/EventStreamMiddleware.ts index f18c46f9073..326df27cc9a 100644 --- a/packages/third-parties/sse/src/middlewares/EventStreamMiddleware.ts +++ b/packages/third-parties/sse/src/middlewares/EventStreamMiddleware.ts @@ -1,5 +1,6 @@ import {Context, PlatformContext} from "@tsed/common"; import {Middleware} from "@tsed/platform-middlewares"; + import {EventStreamContext} from "../domain/EventStreamContext.js"; @Middleware() diff --git a/packages/third-parties/sse/src/sse.integration.spec.ts b/packages/third-parties/sse/src/sse.integration.spec.ts index d91224e4997..1e3a273f944 100644 --- a/packages/third-parties/sse/src/sse.integration.spec.ts +++ b/packages/third-parties/sse/src/sse.integration.spec.ts @@ -1,9 +1,10 @@ import {Context, PlatformContext, PlatformTest} from "@tsed/common"; import {Controller} from "@tsed/di"; import {Get, getSpec, JsonEntityStore, Name, Returns} from "@tsed/schema"; -import {EventStream} from "./decorators/eventStream"; -import {EventStreamCtx} from "./decorators/eventStreamCtx"; -import {EventStreamContext} from "./domain/EventStreamContext"; + +import {EventStream} from "./decorators/eventStream.js"; +import {EventStreamCtx} from "./decorators/eventStreamCtx.js"; +import {EventStreamContext} from "./domain/EventStreamContext.js"; function make(eventStream: EventStreamCtx, cb: () => any) { let intervalId: ReturnType; @@ -58,7 +59,7 @@ export class MyCtrl { @Get("/scenario5") @EventStream() - @Returns(200).Type(Model) + @(Returns(200).Type(Model)) scenario5(@EventStreamCtx() eventStream: EventStreamCtx, @Context() $ctx: PlatformContext) { make(eventStream, () => { const model = new Model(); diff --git a/packages/third-parties/sse/tsconfig.esm.json b/packages/third-parties/sse/tsconfig.esm.json index e3b07081667..82292550ddb 100644 --- a/packages/third-parties/sse/tsconfig.esm.json +++ b/packages/third-parties/sse/tsconfig.esm.json @@ -2,8 +2,7 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "module": "ESNext", - "moduleResolution": "nodenext", + "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", @@ -11,7 +10,7 @@ "composite": true, "noEmit": false }, - "include": ["src", "src/**/*.json"], + "include": ["src/**/*.ts", "src/**/*.json"], "exclude": [ "node_modules", "test", diff --git a/packages/third-parties/sse/tsconfig.spec.json b/packages/third-parties/sse/tsconfig.spec.json index b2e248f2c69..9835f975711 100644 --- a/packages/third-parties/sse/tsconfig.spec.json +++ b/packages/third-parties/sse/tsconfig.spec.json @@ -3,7 +3,6 @@ "compilerOptions": { "baseUrl": ".", "rootDir": "../..", - "module": "commonjs", "outDir": "./lib/cjs", "declaration": false, "composite": false, diff --git a/packages/third-parties/stripe/package.json b/packages/third-parties/stripe/package.json index 50771ea516d..182cb25eed3 100644 --- a/packages/third-parties/stripe/package.json +++ b/packages/third-parties/stripe/package.json @@ -44,7 +44,7 @@ "@tsed/typescript": "workspace:*", "eslint": "^8.57.0", "stripe": "^8.129.0", - "typescript": "4.9.5", + "typescript": "5.6.2", "vitest": "2.0.4" }, "peerDependencies": { diff --git a/packages/third-parties/stripe/src/decorators/webhookEvent.ts b/packages/third-parties/stripe/src/decorators/webhookEvent.ts index f597b7a3026..6c5a6fee78a 100644 --- a/packages/third-parties/stripe/src/decorators/webhookEvent.ts +++ b/packages/third-parties/stripe/src/decorators/webhookEvent.ts @@ -1,7 +1,8 @@ +import {StoreSet, useDecorators, useMethodDecorators} from "@tsed/core"; import {UseBefore} from "@tsed/platform-middlewares"; import {Context} from "@tsed/platform-params"; -import {StoreSet, useDecorators, useMethodDecorators} from "@tsed/core"; import {In} from "@tsed/schema"; + import {STRIPE_WEBHOOK_EVENT} from "../constants/constants.js"; import {WebhookEventMiddleware, WebhookEventOptions} from "../middlewares/WebhookEventMiddleware.js"; diff --git a/packages/third-parties/stripe/src/middlewares/WebhookEventMiddleware.spec.ts b/packages/third-parties/stripe/src/middlewares/WebhookEventMiddleware.spec.ts index 8b8582e37d7..fcb966f573e 100644 --- a/packages/third-parties/stripe/src/middlewares/WebhookEventMiddleware.spec.ts +++ b/packages/third-parties/stripe/src/middlewares/WebhookEventMiddleware.spec.ts @@ -1,7 +1,9 @@ +import "../index.js"; + import {EndpointMetadata, PlatformTest} from "@tsed/common"; import {catchError} from "@tsed/core"; -import "../index.js"; import {Stripe} from "stripe"; + import {STRIPE_WEBHOOK_EVENT, STRIPE_WEBHOOK_SIGNATURE} from "../constants/constants.js"; import {WebhookEventMiddleware} from "./WebhookEventMiddleware.js"; diff --git a/packages/third-parties/stripe/src/middlewares/WebhookEventMiddleware.ts b/packages/third-parties/stripe/src/middlewares/WebhookEventMiddleware.ts index a9afb8bdda9..b9b297f30f6 100644 --- a/packages/third-parties/stripe/src/middlewares/WebhookEventMiddleware.ts +++ b/packages/third-parties/stripe/src/middlewares/WebhookEventMiddleware.ts @@ -1,10 +1,12 @@ -import {Context, HeaderParams, RawBodyParams} from "@tsed/platform-params"; -import {Middleware, MiddlewareMethods} from "@tsed/platform-middlewares"; +import "../services/StripeFactory.js"; + import {Constant, Inject} from "@tsed/di"; import {BadRequest, InternalServerError} from "@tsed/exceptions"; +import {Middleware, MiddlewareMethods} from "@tsed/platform-middlewares"; +import {Context, HeaderParams, RawBodyParams} from "@tsed/platform-params"; import {Stripe} from "stripe"; + import {STRIPE_WEBHOOK_EVENT, STRIPE_WEBHOOK_SIGNATURE} from "../constants/constants.js"; -import "../services/StripeFactory.js"; export interface WebhookEventOptions { secret: string; diff --git a/packages/third-parties/stripe/src/services/StripeFactory.spec.ts b/packages/third-parties/stripe/src/services/StripeFactory.spec.ts index 230d34d0265..4d48757df62 100644 --- a/packages/third-parties/stripe/src/services/StripeFactory.spec.ts +++ b/packages/third-parties/stripe/src/services/StripeFactory.spec.ts @@ -1,5 +1,6 @@ -import {PlatformTest} from "@tsed/common"; import "../index.js"; + +import {PlatformTest} from "@tsed/common"; import {Stripe} from "stripe"; describe("StripeFactory", () => { diff --git a/packages/third-parties/stripe/src/services/StripeFactory.ts b/packages/third-parties/stripe/src/services/StripeFactory.ts index 203a10ca34b..43afcc6f141 100644 --- a/packages/third-parties/stripe/src/services/StripeFactory.ts +++ b/packages/third-parties/stripe/src/services/StripeFactory.ts @@ -1,5 +1,6 @@ import {Configuration, registerProvider} from "@tsed/di"; import {Stripe} from "stripe"; + import {StripeSettings} from "../domain/StripeSettings.js"; export const StripeFactory = Stripe; diff --git a/packages/third-parties/stripe/test/app/Server.ts b/packages/third-parties/stripe/test/app/Server.ts index 19dbf91ba7c..54c80763764 100644 --- a/packages/third-parties/stripe/test/app/Server.ts +++ b/packages/third-parties/stripe/test/app/Server.ts @@ -1,9 +1,10 @@ -import {FileSyncAdapter} from "@tsed/adapters"; import "@tsed/ajv"; -import {Configuration} from "@tsed/di"; -import "@tsed/stripe"; +import "../.."; import "@tsed/swagger"; +import {FileSyncAdapter} from "@tsed/adapters"; +import {Configuration} from "@tsed/di"; + const rootDir = import.meta.dirname; export {rootDir}; diff --git a/packages/third-parties/stripe/test/app/controllers/pages/IndexCtrl.ts b/packages/third-parties/stripe/test/app/controllers/pages/IndexCtrl.ts index a16b9b928f8..a814b305d48 100644 --- a/packages/third-parties/stripe/test/app/controllers/pages/IndexCtrl.ts +++ b/packages/third-parties/stripe/test/app/controllers/pages/IndexCtrl.ts @@ -10,7 +10,7 @@ export class IndexCtrl { @Get("/") @View("index.ejs") - @Returns(200, String).ContentType("text/html") + @(Returns(200, String).ContentType("text/html")) get(@HeaderParams("x-forwarded-proto") protocol: string, @HeaderParams("host") host: string) { const hostUrl = `${protocol || "http"}://${host}`; diff --git a/packages/third-parties/stripe/test/app/controllers/rest/StripeWebhooksCtrl.ts b/packages/third-parties/stripe/test/app/controllers/rest/StripeWebhooksCtrl.ts index 6067100d67f..7a75cbfcfae 100644 --- a/packages/third-parties/stripe/test/app/controllers/rest/StripeWebhooksCtrl.ts +++ b/packages/third-parties/stripe/test/app/controllers/rest/StripeWebhooksCtrl.ts @@ -1,7 +1,8 @@ import {Controller, Post} from "@tsed/common"; -import {WebhookEvent} from "@tsed/stripe"; import Stripe from "stripe"; +import {WebhookEvent} from "../../../.."; + @Controller("/webhooks") export class StripeWebhooksCtrl { @Post("/callback") diff --git a/packages/third-parties/stripe/test/app/controllers/rest/VersionCtrl.ts b/packages/third-parties/stripe/test/app/controllers/rest/VersionCtrl.ts index 5ab85f7ef4a..49dd20855db 100644 --- a/packages/third-parties/stripe/test/app/controllers/rest/VersionCtrl.ts +++ b/packages/third-parties/stripe/test/app/controllers/rest/VersionCtrl.ts @@ -4,9 +4,9 @@ import {object, Returns, string} from "@tsed/schema"; @Controller("/version") export class VersionCtrl { @Get("/") - @Returns(200) + @(Returns(200) .ContentType("application/json") - .Schema(object().properties({name: string(), version: string()})) + .Schema(object().properties({name: string(), version: string()}))) async get() { const {name, version} = await import("../../../../package.json"); return { diff --git a/packages/third-parties/stripe/test/app/index.ts b/packages/third-parties/stripe/test/app/index.ts index 66e13bef429..32bcd2496ca 100644 --- a/packages/third-parties/stripe/test/app/index.ts +++ b/packages/third-parties/stripe/test/app/index.ts @@ -1,5 +1,6 @@ import {$log} from "@tsed/common"; import {PlatformExpress} from "@tsed/platform-express"; + import {InteractionsCtrl} from "./controllers/oidc/InteractionsCtrl.js"; import {IndexCtrl} from "./controllers/pages/IndexCtrl.js"; import {VersionCtrl} from "./controllers/rest/VersionCtrl.js"; diff --git a/packages/third-parties/stripe/test/stripe.integration.spec.ts b/packages/third-parties/stripe/test/stripe.integration.spec.ts index 5968b232603..47e2b56568b 100644 --- a/packages/third-parties/stripe/test/stripe.integration.spec.ts +++ b/packages/third-parties/stripe/test/stripe.integration.spec.ts @@ -3,6 +3,7 @@ import {PlatformExpress} from "@tsed/platform-express"; import {PlatformTestSdk} from "@tsed/platform-test-sdk"; import {Stripe} from "stripe"; import SuperTest from "supertest"; + import {StripeWebhooksCtrl} from "./app/controllers/rest/StripeWebhooksCtrl.js"; import {rootDir, Server} from "./app/Server.js"; diff --git a/packages/third-parties/stripe/tsconfig.esm.json b/packages/third-parties/stripe/tsconfig.esm.json index e3b07081667..82292550ddb 100644 --- a/packages/third-parties/stripe/tsconfig.esm.json +++ b/packages/third-parties/stripe/tsconfig.esm.json @@ -2,8 +2,7 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "module": "ESNext", - "moduleResolution": "nodenext", + "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", @@ -11,7 +10,7 @@ "composite": true, "noEmit": false }, - "include": ["src", "src/**/*.json"], + "include": ["src/**/*.ts", "src/**/*.json"], "exclude": [ "node_modules", "test", diff --git a/packages/third-parties/stripe/tsconfig.spec.json b/packages/third-parties/stripe/tsconfig.spec.json index b2e248f2c69..9835f975711 100644 --- a/packages/third-parties/stripe/tsconfig.spec.json +++ b/packages/third-parties/stripe/tsconfig.spec.json @@ -3,7 +3,6 @@ "compilerOptions": { "baseUrl": ".", "rootDir": "../..", - "module": "commonjs", "outDir": "./lib/cjs", "declaration": false, "composite": false, diff --git a/packages/third-parties/temporal/package.json b/packages/third-parties/temporal/package.json index 1a0af992a30..19742e8e781 100644 --- a/packages/third-parties/temporal/package.json +++ b/packages/third-parties/temporal/package.json @@ -40,7 +40,7 @@ "@tsed/typescript": "workspace:*", "cross-env": "7.0.3", "eslint": "^8.57.0", - "typescript": "4.9.5", + "typescript": "5.6.2", "vitest": "2.0.4" }, "peerDependencies": { diff --git a/packages/third-parties/temporal/src/TemporalModule.ts b/packages/third-parties/temporal/src/TemporalModule.ts index b95f423ff0d..5925720f1ae 100644 --- a/packages/third-parties/temporal/src/TemporalModule.ts +++ b/packages/third-parties/temporal/src/TemporalModule.ts @@ -1,8 +1,9 @@ -import {classOf} from "@tsed/core"; import {Logger} from "@tsed/common"; +import {classOf} from "@tsed/core"; import {Inject, InjectorService, Module, Provider} from "@tsed/di"; + import {PROVIDER_TYPE_TEMPORAL} from "./constants.js"; -import {TemporalStore, TEMPORAL_STORE_KEY} from "./interfaces/TemporalStore.js"; +import {TEMPORAL_STORE_KEY, TemporalStore} from "./interfaces/TemporalStore.js"; import {TemporalClient} from "./services/TemporalFactory.js"; @Module() diff --git a/packages/third-parties/temporal/src/decorators/activity.spec.ts b/packages/third-parties/temporal/src/decorators/activity.spec.ts index 1f01d768c32..cce00e3fd45 100644 --- a/packages/third-parties/temporal/src/decorators/activity.spec.ts +++ b/packages/third-parties/temporal/src/decorators/activity.spec.ts @@ -1,4 +1,5 @@ import {Store} from "@tsed/core"; + import {Activity} from "./activity.js"; import {Temporal} from "./temporal.js"; diff --git a/packages/third-parties/temporal/src/decorators/activity.ts b/packages/third-parties/temporal/src/decorators/activity.ts index 1873e7abb1e..b5fc3ca94d5 100644 --- a/packages/third-parties/temporal/src/decorators/activity.ts +++ b/packages/third-parties/temporal/src/decorators/activity.ts @@ -1,5 +1,6 @@ import {Store} from "@tsed/core"; -import {TemporalStore, ActivityOptions, TEMPORAL_STORE_KEY} from "../interfaces/TemporalStore.js"; + +import {ActivityOptions, TEMPORAL_STORE_KEY, TemporalStore} from "../interfaces/TemporalStore.js"; export function Activity(options: ActivityOptions = {}): MethodDecorator { return (target: any, propertyKey: string | symbol) => { diff --git a/packages/third-parties/temporal/src/decorators/temporal.spec.ts b/packages/third-parties/temporal/src/decorators/temporal.spec.ts index e3e1b6a49c4..9096a36f3cc 100644 --- a/packages/third-parties/temporal/src/decorators/temporal.spec.ts +++ b/packages/third-parties/temporal/src/decorators/temporal.spec.ts @@ -1,4 +1,5 @@ import {GlobalProviders} from "@tsed/di"; + import {Temporal} from "./temporal.js"; describe("@Activity()", () => { diff --git a/packages/third-parties/temporal/src/decorators/temporal.ts b/packages/third-parties/temporal/src/decorators/temporal.ts index 204b85ab262..d27c343af92 100644 --- a/packages/third-parties/temporal/src/decorators/temporal.ts +++ b/packages/third-parties/temporal/src/decorators/temporal.ts @@ -1,5 +1,6 @@ import {useDecorators} from "@tsed/core"; import {Injectable} from "@tsed/di"; + import {PROVIDER_TYPE_TEMPORAL} from "../constants.js"; export function Temporal(): ClassDecorator { diff --git a/packages/third-parties/temporal/src/interfaces/interfaces.ts b/packages/third-parties/temporal/src/interfaces/interfaces.ts index 51fe40dbcf9..e81a3d46c28 100644 --- a/packages/third-parties/temporal/src/interfaces/interfaces.ts +++ b/packages/third-parties/temporal/src/interfaces/interfaces.ts @@ -1,7 +1,6 @@ import {ClientOptions, ConnectionOptions} from "@temporalio/client"; declare global { - // eslint-disable-next-line @typescript-eslint/no-namespace namespace TsED { interface Configuration { temporal?: { diff --git a/packages/third-parties/temporal/src/services/TemporalFactory.ts b/packages/third-parties/temporal/src/services/TemporalFactory.ts index c74c815bb67..00b16502416 100644 --- a/packages/third-parties/temporal/src/services/TemporalFactory.ts +++ b/packages/third-parties/temporal/src/services/TemporalFactory.ts @@ -1,6 +1,6 @@ -import {Configuration, registerProvider} from "@tsed/di"; import {Client, Connection} from "@temporalio/client"; import {Logger} from "@tsed/common"; +import {Configuration, registerProvider} from "@tsed/di"; export const TemporalConnection = Connection; export type TemporalConnection = Connection; diff --git a/packages/third-parties/temporal/src/utils/worker.ts b/packages/third-parties/temporal/src/utils/worker.ts index 0771dd1884f..b3b9fdc4304 100644 --- a/packages/third-parties/temporal/src/utils/worker.ts +++ b/packages/third-parties/temporal/src/utils/worker.ts @@ -1,7 +1,7 @@ +import {NativeConnection, NativeConnectionOptions, Worker, WorkerOptions} from "@temporalio/worker"; import {PlatformBuilderSettings, PlatformTest} from "@tsed/common"; import {$log} from "@tsed/logger"; -import {NativeConnection, NativeConnectionOptions, Worker, WorkerOptions} from "@temporalio/worker"; import {TemporalModule} from "../TemporalModule.js"; type BootstrapWorkerOptions = { diff --git a/packages/third-parties/temporal/test/client.integration.spec.ts b/packages/third-parties/temporal/test/client.integration.spec.ts index 9bf0d186323..64417c8f63b 100644 --- a/packages/third-parties/temporal/test/client.integration.spec.ts +++ b/packages/third-parties/temporal/test/client.integration.spec.ts @@ -1,6 +1,7 @@ import {getEphemeralServerTarget} from "@temporalio/core-bridge"; import {Runtime} from "@temporalio/worker"; import {PlatformTest} from "@tsed/common"; + import {TemporalClient} from "../src/index.js"; import {Server} from "./helpers/Server.js"; diff --git a/packages/third-parties/temporal/test/helpers/Server.ts b/packages/third-parties/temporal/test/helpers/Server.ts index 4ec6d1aa9ba..8540e323d19 100644 --- a/packages/third-parties/temporal/test/helpers/Server.ts +++ b/packages/third-parties/temporal/test/helpers/Server.ts @@ -1,9 +1,10 @@ -import {Configuration, Inject, PlatformApplication} from "@tsed/common"; import "@tsed/platform-express"; -import "@tsed/temporal"; -import cookieParser from "cookie-parser"; +import "../.."; + +import {Configuration, Inject, PlatformApplication} from "@tsed/common"; import bodyParser from "body-parser"; import compress from "compression"; +import cookieParser from "cookie-parser"; import methodOverride from "method-override"; const rootDir = import.meta.dirname; diff --git a/packages/third-parties/temporal/test/worker.integration.spec.ts b/packages/third-parties/temporal/test/worker.integration.spec.ts index bc86df4b317..4b32eaaacc6 100644 --- a/packages/third-parties/temporal/test/worker.integration.spec.ts +++ b/packages/third-parties/temporal/test/worker.integration.spec.ts @@ -1,5 +1,7 @@ -import {TestWorkflowEnvironment} from "@temporalio/testing"; import {join} from "node:path"; + +import {TestWorkflowEnvironment} from "@temporalio/testing"; + import {Activity, bootstrapWorker, Temporal} from "../src/index.js"; import {Server} from "./helpers/Server.js"; diff --git a/packages/third-parties/temporal/tsconfig.esm.json b/packages/third-parties/temporal/tsconfig.esm.json index e3b07081667..82292550ddb 100644 --- a/packages/third-parties/temporal/tsconfig.esm.json +++ b/packages/third-parties/temporal/tsconfig.esm.json @@ -2,8 +2,7 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "module": "ESNext", - "moduleResolution": "nodenext", + "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", @@ -11,7 +10,7 @@ "composite": true, "noEmit": false }, - "include": ["src", "src/**/*.json"], + "include": ["src/**/*.ts", "src/**/*.json"], "exclude": [ "node_modules", "test", diff --git a/packages/third-parties/temporal/tsconfig.spec.json b/packages/third-parties/temporal/tsconfig.spec.json index b2e248f2c69..9835f975711 100644 --- a/packages/third-parties/temporal/tsconfig.spec.json +++ b/packages/third-parties/temporal/tsconfig.spec.json @@ -3,7 +3,6 @@ "compilerOptions": { "baseUrl": ".", "rootDir": "../..", - "module": "commonjs", "outDir": "./lib/cjs", "declaration": false, "composite": false, diff --git a/packages/third-parties/terminus/package.json b/packages/third-parties/terminus/package.json index bf092b89ac9..d02b7a268d1 100644 --- a/packages/third-parties/terminus/package.json +++ b/packages/third-parties/terminus/package.json @@ -35,7 +35,7 @@ "@tsed/schema": "workspace:*", "@tsed/typescript": "workspace:*", "eslint": "^8.57.0", - "typescript": "4.9.5", + "typescript": "5.6.2", "vitest": "2.0.4" }, "peerDependencies": { diff --git a/packages/third-parties/terminus/src/TerminusModule.spec.ts b/packages/third-parties/terminus/src/TerminusModule.spec.ts index 04b50653ffc..54199d35ee1 100644 --- a/packages/third-parties/terminus/src/TerminusModule.spec.ts +++ b/packages/third-parties/terminus/src/TerminusModule.spec.ts @@ -1,4 +1,5 @@ import {Injectable, PlatformTest} from "@tsed/common"; + import {Health} from "./decorators/health.js"; import {TerminusModule} from "./TerminusModule.js"; diff --git a/packages/third-parties/terminus/src/TerminusModule.ts b/packages/third-parties/terminus/src/TerminusModule.ts index d76496c7063..e6a40e208cd 100644 --- a/packages/third-parties/terminus/src/TerminusModule.ts +++ b/packages/third-parties/terminus/src/TerminusModule.ts @@ -4,6 +4,7 @@ import {Constant, Inject, InjectorService, Module, OnInit, Provider} from "@tsed import {concatPath} from "@tsed/schema"; import Http from "http"; import Https from "https"; + import {TerminusSettings} from "./interfaces/TerminusSettings.js"; @Module() diff --git a/packages/third-parties/terminus/test/app/Server.ts b/packages/third-parties/terminus/test/app/Server.ts index 042d2dd2229..4a408c76bc9 100644 --- a/packages/third-parties/terminus/test/app/Server.ts +++ b/packages/third-parties/terminus/test/app/Server.ts @@ -1,12 +1,13 @@ import "@tsed/ajv"; +import "../.."; +import "./services/MongoClient.js"; +import "./services/RedisClient.js"; + import {PlatformApplication} from "@tsed/common"; import {Configuration, Inject} from "@tsed/di"; -import "@tsed/terminus"; import bodyParser from "body-parser"; import cookieParser from "cookie-parser"; import {Application} from "express"; -import "./services/MongoClient.js"; -import "./services/RedisClient.js"; const rootDir = import.meta.dirname; export {rootDir}; diff --git a/packages/third-parties/terminus/test/app/index.ts b/packages/third-parties/terminus/test/app/index.ts index db0368e02b0..afecbbec913 100644 --- a/packages/third-parties/terminus/test/app/index.ts +++ b/packages/third-parties/terminus/test/app/index.ts @@ -1,5 +1,6 @@ import {$log} from "@tsed/common"; import {PlatformExpress} from "@tsed/platform-express"; + import {Server} from "./Server.js"; if (process.env.NODE_ENV !== "test") { diff --git a/packages/third-parties/terminus/test/app/services/MongoClient.ts b/packages/third-parties/terminus/test/app/services/MongoClient.ts index c1370b2b08d..4f97621aaf8 100644 --- a/packages/third-parties/terminus/test/app/services/MongoClient.ts +++ b/packages/third-parties/terminus/test/app/services/MongoClient.ts @@ -1,5 +1,6 @@ import {Injectable} from "@tsed/di"; -import {Health} from "@tsed/terminus"; + +import {Health} from "../../.."; @Injectable() class MongoClient { diff --git a/packages/third-parties/terminus/test/app/services/RedisClient.ts b/packages/third-parties/terminus/test/app/services/RedisClient.ts index d07e422304b..ad4fc31ad78 100644 --- a/packages/third-parties/terminus/test/app/services/RedisClient.ts +++ b/packages/third-parties/terminus/test/app/services/RedisClient.ts @@ -1,5 +1,6 @@ import {Injectable} from "@tsed/di"; -import {Health} from "@tsed/terminus"; + +import {Health} from "../../.."; @Injectable() class RedisClient { diff --git a/packages/third-parties/terminus/tsconfig.esm.json b/packages/third-parties/terminus/tsconfig.esm.json index e3b07081667..82292550ddb 100644 --- a/packages/third-parties/terminus/tsconfig.esm.json +++ b/packages/third-parties/terminus/tsconfig.esm.json @@ -2,8 +2,7 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "module": "ESNext", - "moduleResolution": "nodenext", + "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", @@ -11,7 +10,7 @@ "composite": true, "noEmit": false }, - "include": ["src", "src/**/*.json"], + "include": ["src/**/*.ts", "src/**/*.json"], "exclude": [ "node_modules", "test", diff --git a/packages/third-parties/terminus/tsconfig.spec.json b/packages/third-parties/terminus/tsconfig.spec.json index b2e248f2c69..9835f975711 100644 --- a/packages/third-parties/terminus/tsconfig.spec.json +++ b/packages/third-parties/terminus/tsconfig.spec.json @@ -3,7 +3,6 @@ "compilerOptions": { "baseUrl": ".", "rootDir": "../..", - "module": "commonjs", "outDir": "./lib/cjs", "declaration": false, "composite": false, diff --git a/packages/third-parties/vike/package.json b/packages/third-parties/vike/package.json index 43521173b4a..ef3f37340b0 100644 --- a/packages/third-parties/vike/package.json +++ b/packages/third-parties/vike/package.json @@ -37,7 +37,7 @@ "@tsed/exceptions": "workspace:*", "@tsed/typescript": "workspace:*", "eslint": "^8.57.0", - "typescript": "4.9.5", + "typescript": "5.6.2", "vike": "0.4.160", "vite": "5.4.1", "vitest": "2.0.4" diff --git a/packages/third-parties/vike/src/interfaces/ViteConfig.ts b/packages/third-parties/vike/src/interfaces/ViteConfig.ts index 8e952e1a8bf..dc11d36d9a6 100644 --- a/packages/third-parties/vike/src/interfaces/ViteConfig.ts +++ b/packages/third-parties/vike/src/interfaces/ViteConfig.ts @@ -1,5 +1,4 @@ import {Options} from "sirv"; - // @ts-ignore import type {InlineConfig} from "vite"; diff --git a/packages/third-parties/vike/src/middlewares/ViteRendererMiddleware.spec.ts b/packages/third-parties/vike/src/middlewares/ViteRendererMiddleware.spec.ts index aa6f3da230f..57a8e859086 100644 --- a/packages/third-parties/vike/src/middlewares/ViteRendererMiddleware.spec.ts +++ b/packages/third-parties/vike/src/middlewares/ViteRendererMiddleware.spec.ts @@ -1,4 +1,5 @@ import {PlatformTest} from "@tsed/common"; + import {ViteService} from "../services/ViteService.js"; import {ViteRendererMiddleware} from "./ViteRendererMiddleware.js"; diff --git a/packages/third-parties/vike/src/services/ViteServer.spec.ts b/packages/third-parties/vike/src/services/ViteServer.spec.ts index add7dd07b74..397cc2f21a8 100644 --- a/packages/third-parties/vike/src/services/ViteServer.spec.ts +++ b/packages/third-parties/vike/src/services/ViteServer.spec.ts @@ -1,6 +1,7 @@ import {PlatformTest} from "@tsed/common"; import {Env} from "@tsed/core"; import sirv from "sirv"; + import {VITE_SERVER} from "./ViteServer.js"; vi.mock("sirv", () => { diff --git a/packages/third-parties/vike/src/services/ViteServer.ts b/packages/third-parties/vike/src/services/ViteServer.ts index 41e4e149451..e4dba55276f 100644 --- a/packages/third-parties/vike/src/services/ViteServer.ts +++ b/packages/third-parties/vike/src/services/ViteServer.ts @@ -1,9 +1,9 @@ import {Logger} from "@tsed/common"; import {Env} from "@tsed/core"; import {Configuration, registerProvider} from "@tsed/di"; - // @ts-ignore import type {InlineConfig, ViteDevServer} from "vite"; + import {ViteConfig} from "../interfaces/ViteConfig.js"; export const VITE_SERVER = Symbol.for("VITE_DEV_SERVER"); diff --git a/packages/third-parties/vike/src/services/ViteService.spec.ts b/packages/third-parties/vike/src/services/ViteService.spec.ts index efd902101ee..2669ea88539 100644 --- a/packages/third-parties/vike/src/services/ViteService.spec.ts +++ b/packages/third-parties/vike/src/services/ViteService.spec.ts @@ -1,4 +1,5 @@ import {PlatformTest} from "@tsed/common"; + import {ViteService} from "./ViteService.js"; vi.mock("vike/server", () => { diff --git a/packages/third-parties/vike/src/services/ViteService.ts b/packages/third-parties/vike/src/services/ViteService.ts index 11fa2e67b92..31932bf843f 100644 --- a/packages/third-parties/vike/src/services/ViteService.ts +++ b/packages/third-parties/vike/src/services/ViteService.ts @@ -1,6 +1,7 @@ import {Constant, PlatformContext} from "@tsed/common"; import {Injectable} from "@tsed/di"; import {Writable} from "stream"; + import {ViteConfig} from "../interfaces/ViteConfig.js"; import {ViteRenderContext} from "../interfaces/ViteRenderContext.js"; diff --git a/packages/third-parties/vike/tsconfig.esm.json b/packages/third-parties/vike/tsconfig.esm.json index e3b07081667..82292550ddb 100644 --- a/packages/third-parties/vike/tsconfig.esm.json +++ b/packages/third-parties/vike/tsconfig.esm.json @@ -2,8 +2,7 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "module": "ESNext", - "moduleResolution": "nodenext", + "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", @@ -11,7 +10,7 @@ "composite": true, "noEmit": false }, - "include": ["src", "src/**/*.json"], + "include": ["src/**/*.ts", "src/**/*.json"], "exclude": [ "node_modules", "test", diff --git a/packages/third-parties/vike/tsconfig.spec.json b/packages/third-parties/vike/tsconfig.spec.json index b2e248f2c69..9835f975711 100644 --- a/packages/third-parties/vike/tsconfig.spec.json +++ b/packages/third-parties/vike/tsconfig.spec.json @@ -3,7 +3,6 @@ "compilerOptions": { "baseUrl": ".", "rootDir": "../..", - "module": "commonjs", "outDir": "./lib/cjs", "declaration": false, "composite": false, diff --git a/packages/utils/normalize-path/package.json b/packages/utils/normalize-path/package.json index 715b1585697..0ac7a1d5421 100644 --- a/packages/utils/normalize-path/package.json +++ b/packages/utils/normalize-path/package.json @@ -30,7 +30,7 @@ "@tsed/typescript": "workspace:*", "@types/normalize-path": "^3.0.2", "eslint": "^8.57.0", - "typescript": "4.9.5", + "typescript": "5.6.2", "vitest": "2.0.4" } } diff --git a/packages/utils/normalize-path/tsconfig.esm.json b/packages/utils/normalize-path/tsconfig.esm.json index e3b07081667..82292550ddb 100644 --- a/packages/utils/normalize-path/tsconfig.esm.json +++ b/packages/utils/normalize-path/tsconfig.esm.json @@ -2,8 +2,7 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "module": "ESNext", - "moduleResolution": "nodenext", + "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", @@ -11,7 +10,7 @@ "composite": true, "noEmit": false }, - "include": ["src", "src/**/*.json"], + "include": ["src/**/*.ts", "src/**/*.json"], "exclude": [ "node_modules", "test", diff --git a/packages/utils/normalize-path/tsconfig.spec.json b/packages/utils/normalize-path/tsconfig.spec.json index 21485bab96d..2e917f4b39d 100644 --- a/packages/utils/normalize-path/tsconfig.spec.json +++ b/packages/utils/normalize-path/tsconfig.spec.json @@ -3,7 +3,6 @@ "compilerOptions": { "baseUrl": ".", "rootDir": "../..", - "module": "commonjs", "outDir": "./lib/cjs", "declaration": false, "composite": false, diff --git a/tools/github-sponsors/src/index.js b/tools/github-sponsors/src/index.js index bff9438d1ad..8794238e4f4 100644 --- a/tools/github-sponsors/src/index.js +++ b/tools/github-sponsors/src/index.js @@ -1,5 +1,3 @@ -/* eslint-disable no-console */ - const {parseFundingFile} = require("./utils/parse"); const {printDonationMessage} = require("./utils/print"); const {shouldHideMessage} = require("./utils/misc"); diff --git a/tools/github-sponsors/src/utils/print.js b/tools/github-sponsors/src/utils/print.js index b91d3896d7b..fc399731f98 100644 --- a/tools/github-sponsors/src/utils/print.js +++ b/tools/github-sponsors/src/utils/print.js @@ -1,6 +1,3 @@ -/* eslint-disable no-console */ -/* eslint-disable no-control-regex */ - const {execSync} = require("child_process"); const chalk = require("chalk"); const path = require("path"); diff --git a/tools/integration/package.json b/tools/integration/package.json index 9a22b8dd861..0c15cde034d 100644 --- a/tools/integration/package.json +++ b/tools/integration/package.json @@ -20,7 +20,7 @@ "@tsed/schema": "workspace:*", "@tsed/swagger": "workspace:*", "@tsed/typescript": "workspace:*", - "typescript": "4.9.5" + "typescript": "5.6.2" }, "module": "./lib/esm/index.js", "typings": "./lib/types/index.d.ts", diff --git a/tools/integration/src/Server.ts b/tools/integration/src/Server.ts index 23acff6149f..a38385c9a9b 100644 --- a/tools/integration/src/Server.ts +++ b/tools/integration/src/Server.ts @@ -1,17 +1,19 @@ -import {join} from "path"; -import {Configuration, Inject} from "@tsed/di"; -import {PlatformApplication} from "@tsed/common"; import "@tsed/platform-express"; // /!\ keep this import +import "@tsed/ajv"; +import "@tsed/swagger"; + +import {PlatformApplication} from "@tsed/common"; +import {Configuration, Inject} from "@tsed/di"; import bodyParser from "body-parser"; import compress from "compression"; import cookieParser from "cookie-parser"; -import methodOverride from "method-override"; import cors from "cors"; -import "@tsed/ajv"; -import "@tsed/swagger"; +import methodOverride from "method-override"; +import {join} from "path"; + import {config} from "./config/index.js"; -import * as rest from "./controllers/rest/index.js"; import * as pages from "./controllers/pages/index.js"; +import * as rest from "./controllers/rest/index.js"; @Configuration({ ...config, diff --git a/tools/integration/src/config/logger/index.ts b/tools/integration/src/config/logger/index.ts index 79aa4b3cab6..b0d6c7f2c6c 100644 --- a/tools/integration/src/config/logger/index.ts +++ b/tools/integration/src/config/logger/index.ts @@ -1,5 +1,6 @@ import {$log} from "@tsed/common"; import type {DILoggerOptions} from "@tsed/di"; + import {isProduction} from "../envs/index.js"; if (isProduction) { diff --git a/tools/integration/src/controllers/pages/IndexController.ts b/tools/integration/src/controllers/pages/IndexController.ts index 48ebbcb91a4..6e7d2b66983 100644 --- a/tools/integration/src/controllers/pages/IndexController.ts +++ b/tools/integration/src/controllers/pages/IndexController.ts @@ -1,8 +1,8 @@ import {Constant, Controller} from "@tsed/di"; import {HeaderParams} from "@tsed/platform-params"; import {View} from "@tsed/platform-views"; +import {Get, Hidden, Returns} from "@tsed/schema"; import {SwaggerSettings} from "@tsed/swagger"; -import {Hidden, Get, Returns} from "@tsed/schema"; @Hidden() @Controller("/") @@ -12,7 +12,7 @@ export class IndexController { @Get("/") @View("swagger.ejs") - @Returns(200, String).ContentType("text/html") + @(Returns(200, String).ContentType("text/html")) get(@HeaderParams("x-forwarded-proto") protocol: string, @HeaderParams("host") host: string) { const hostUrl = `${protocol || "http"}://${host}`; diff --git a/tools/integration/src/index.ts b/tools/integration/src/index.ts index e145ec24a61..2549e74a2c3 100644 --- a/tools/integration/src/index.ts +++ b/tools/integration/src/index.ts @@ -1,5 +1,6 @@ import {$log} from "@tsed/common"; import {PlatformExpress} from "@tsed/platform-express"; + import {Server} from "./Server.js"; async function bootstrap() { diff --git a/tools/integration/tsconfig.esm.json b/tools/integration/tsconfig.esm.json index e3b07081667..82292550ddb 100644 --- a/tools/integration/tsconfig.esm.json +++ b/tools/integration/tsconfig.esm.json @@ -2,8 +2,7 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "module": "ESNext", - "moduleResolution": "nodenext", + "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", @@ -11,7 +10,7 @@ "composite": true, "noEmit": false }, - "include": ["src", "src/**/*.json"], + "include": ["src/**/*.ts", "src/**/*.json"], "exclude": [ "node_modules", "test", diff --git a/tools/typescript/index.js b/tools/typescript/index.js index ebc50864fc8..78734015678 100644 --- a/tools/typescript/index.js +++ b/tools/typescript/index.js @@ -1,10 +1,11 @@ -import {findPackages, MonoRepo} from "@tsed/monorepo-utils"; import {dirname, join, relative} from "node:path"; -import cloneDeep from "lodash/cloneDeep.js"; -import omit from "lodash/omit.js"; -import get from "lodash/get.js"; + +import {findPackages, MonoRepo} from "@tsed/monorepo-utils"; import fs from "fs-extra"; import globby from "globby"; +import cloneDeep from "lodash/cloneDeep.js"; +import get from "lodash/get.js"; +import omit from "lodash/omit.js"; const scriptDir = import.meta.dirname; diff --git a/tools/typescript/tsconfig.node.json b/tools/typescript/tsconfig.node.json index 672ed6224aa..d33c15321b4 100644 --- a/tools/typescript/tsconfig.node.json +++ b/tools/typescript/tsconfig.node.json @@ -1,10 +1,10 @@ { "compilerOptions": { - "module": "commonjs", - "target": "esnext", + "module": "NodeNext", + "target": "ESNext", + "moduleResolution": "NodeNext", "experimentalDecorators": true, "emitDecoratorMetadata": true, - "moduleResolution": "node", "downlevelIteration": false, "isolatedModules": false, "suppressImplicitAnyIndexErrors": false, @@ -19,7 +19,6 @@ "resolveJsonModule": true, "newLine": "LF", "skipLibCheck": true, - "lib": ["ESNext", "esnext.asynciterable"], "declaration": false, "noResolve": false, "preserveConstEnums": true, diff --git a/tools/typescript/tsconfig.template.esm.json b/tools/typescript/tsconfig.template.esm.json index e3b07081667..82292550ddb 100644 --- a/tools/typescript/tsconfig.template.esm.json +++ b/tools/typescript/tsconfig.template.esm.json @@ -2,8 +2,7 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "module": "ESNext", - "moduleResolution": "nodenext", + "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", @@ -11,7 +10,7 @@ "composite": true, "noEmit": false }, - "include": ["src", "src/**/*.json"], + "include": ["src/**/*.ts", "src/**/*.json"], "exclude": [ "node_modules", "test", diff --git a/tools/typescript/tsconfig.template.spec.json b/tools/typescript/tsconfig.template.spec.json index 50ffc4b3368..1a39a6f0aa9 100644 --- a/tools/typescript/tsconfig.template.spec.json +++ b/tools/typescript/tsconfig.template.spec.json @@ -3,7 +3,6 @@ "compilerOptions": { "baseUrl": ".", "rootDir": ".", - "module": "commonjs", "outDir": "./lib/cjs", "declaration": false, "composite": false, diff --git a/tools/vitest/index.js b/tools/vitest/index.js index 2d68e545aff..f4b8507e121 100644 --- a/tools/vitest/index.js +++ b/tools/vitest/index.js @@ -1,6 +1,7 @@ +import {dirname, join} from "node:path"; + import {findPackages, MonoRepo} from "@tsed/monorepo-utils"; import fs from "fs-extra"; -import {dirname, join} from "node:path"; const rootDir = import.meta.dirname; const workspaceDir = join(rootDir, "../.."); diff --git a/tools/vitest/presets/alias.js b/tools/vitest/presets/alias.js index d9485ca8f3b..8823ddee544 100644 --- a/tools/vitest/presets/alias.js +++ b/tools/vitest/presets/alias.js @@ -1,7 +1,8 @@ -import {sync} from "globby"; import {readFileSync} from "node:fs"; import {basename, dirname, join} from "node:path"; +import {sync} from "globby"; + const root = join(import.meta.dirname, "../../.."); function deps(pkg, pkgs, set = new Set()) { diff --git a/tools/vitest/presets/index.js b/tools/vitest/presets/index.js index ac948ae8540..5cc1c4dd635 100644 --- a/tools/vitest/presets/index.js +++ b/tools/vitest/presets/index.js @@ -1,5 +1,6 @@ import swc from "unplugin-swc"; import {defineConfig} from "vitest/config"; + import {resolveWorkspaceFiles} from "../plugins/resolveWorkspaceFiles.js"; import {alias} from "./alias.js"; diff --git a/tsdoc.config.js b/tsdoc.config.cjs similarity index 100% rename from tsdoc.config.js rename to tsdoc.config.cjs diff --git a/yarn.lock b/yarn.lock index 4a3af42a507..20d2cf005f2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1555,7 +1555,7 @@ __metadata: languageName: node linkType: hard -"@babel/parser@npm:^7.24.4, @babel/parser@npm:^7.24.7": +"@babel/parser@npm:^7.24.4": version: 7.25.3 resolution: "@babel/parser@npm:7.25.3" dependencies: @@ -2825,195 +2825,194 @@ __metadata: languageName: node linkType: hard -"@commitlint/cli@npm:^19.2.1": - version: 19.3.0 - resolution: "@commitlint/cli@npm:19.3.0" +"@commitlint/cli@npm:19.5.0": + version: 19.5.0 + resolution: "@commitlint/cli@npm:19.5.0" dependencies: - "@commitlint/format": "npm:^19.3.0" - "@commitlint/lint": "npm:^19.2.2" - "@commitlint/load": "npm:^19.2.0" - "@commitlint/read": "npm:^19.2.1" - "@commitlint/types": "npm:^19.0.3" - execa: "npm:^8.0.1" + "@commitlint/format": "npm:^19.5.0" + "@commitlint/lint": "npm:^19.5.0" + "@commitlint/load": "npm:^19.5.0" + "@commitlint/read": "npm:^19.5.0" + "@commitlint/types": "npm:^19.5.0" + tinyexec: "npm:^0.3.0" yargs: "npm:^17.0.0" bin: commitlint: cli.js - checksum: 10/b1565c0529b8a27ebb3313230f5ddf2f72c5dd819073b2ec141ea1547dfc4de3400a7208ae4f93b071cf8a6a2736aaeb1348c722f6e4627dc964dd0976a37810 + checksum: 10/1d3384cc9823462da3a35308a145dc4fcf92025f7af976e1ceb9cbe9cbd7b7b83703fe0e9ca12fc7f4903ea2fe68c8c1492c18409ba301894c01cb2264a00795 languageName: node linkType: hard -"@commitlint/config-conventional@npm:^19.1.0": - version: 19.1.0 - resolution: "@commitlint/config-conventional@npm:19.1.0" +"@commitlint/config-conventional@npm:19.5.0": + version: 19.5.0 + resolution: "@commitlint/config-conventional@npm:19.5.0" dependencies: - "@commitlint/types": "npm:^19.0.3" + "@commitlint/types": "npm:^19.5.0" conventional-changelog-conventionalcommits: "npm:^7.0.2" - checksum: 10/e3a6ccb521d8849600b7db1d777eed4861ab85c83f26bba56057f05a3cd3481bcce2bbfa29cada03929d3560c4b5509c3d0089ee1d3f530fdbc658e8e6311f26 + checksum: 10/5844fb51347677dd28f970a50528fbc44b9b415a8a5fd6fea6c7f6a2a11357956748eda9d1d6ae499430659b0aa78bfa7dcf8abf599951e7f34a581e60bf57da languageName: node linkType: hard -"@commitlint/config-validator@npm:^19.0.3": - version: 19.0.3 - resolution: "@commitlint/config-validator@npm:19.0.3" +"@commitlint/config-validator@npm:^19.5.0": + version: 19.5.0 + resolution: "@commitlint/config-validator@npm:19.5.0" dependencies: - "@commitlint/types": "npm:^19.0.3" + "@commitlint/types": "npm:^19.5.0" ajv: "npm:^8.11.0" - checksum: 10/a1a9678e0994d87fa98f0aee1a877dfaf60640b657589260ec958898d51affabba73d6684edafa1cc979e4e94b51f14fbd9b605eae77c2838ee52bcbcc110bef + checksum: 10/681bfdcabcb0ff794ea65d95128083869c97039c3a352219d6d88a2d4f3d0412b8ec515db77433fc6b0fce072051beb103d16889d42e76ea97873191ec191b23 languageName: node linkType: hard -"@commitlint/ensure@npm:^19.0.3": - version: 19.0.3 - resolution: "@commitlint/ensure@npm:19.0.3" +"@commitlint/ensure@npm:^19.5.0": + version: 19.5.0 + resolution: "@commitlint/ensure@npm:19.5.0" dependencies: - "@commitlint/types": "npm:^19.0.3" + "@commitlint/types": "npm:^19.5.0" lodash.camelcase: "npm:^4.3.0" lodash.kebabcase: "npm:^4.1.1" lodash.snakecase: "npm:^4.1.1" lodash.startcase: "npm:^4.4.0" lodash.upperfirst: "npm:^4.3.1" - checksum: 10/d8fdc4712985f9ccdbd871c9eabb9d2bdde22296b882b42bd32ab52b6679c5d799ff557d20a99cebb0008831fd31a540d771331e6e5e26bbafbb6b88f47148b6 + checksum: 10/a9d575637121221cb63232ee96024a63614052ccc205ec8fdab53feed70104b85608e31b4632f280d2876f10a2243474191d96e448b222abfc8d8ab48f9f8e7e languageName: node linkType: hard -"@commitlint/execute-rule@npm:^19.0.0": - version: 19.0.0 - resolution: "@commitlint/execute-rule@npm:19.0.0" - checksum: 10/4c5cbf9ab0e2b85b00ceea84e5598b1b3cceaa20a655ee954c45259cca9efc80cf5cf7d9eec04715a100c2da282cbcf6aba960ad53a47178090c0513426ac236 +"@commitlint/execute-rule@npm:^19.5.0": + version: 19.5.0 + resolution: "@commitlint/execute-rule@npm:19.5.0" + checksum: 10/ff05568c3a287ef8564171d5bc5d4510b2e00b552e4703f79db3d62f3cba9d669710717695d199e04c2117d41f9e72d7e43a342d5c1b62d456bc8e8bb7dda1e9 languageName: node linkType: hard -"@commitlint/format@npm:^19.3.0": - version: 19.3.0 - resolution: "@commitlint/format@npm:19.3.0" +"@commitlint/format@npm:^19.5.0": + version: 19.5.0 + resolution: "@commitlint/format@npm:19.5.0" dependencies: - "@commitlint/types": "npm:^19.0.3" + "@commitlint/types": "npm:^19.5.0" chalk: "npm:^5.3.0" - checksum: 10/cc0e1e0e6d5eea76b856ad1be879de166c3d1385e1ae0e1bb78c575f9b78b53d92a56cd4719427cdba9cbb9a10235768da29144da9892596525c923d126951dd + checksum: 10/685b64ebee936d71bbbf66276b11d50b0227f2ad0df3c00317d5b7e25bce8b1b8dbc65cc7c5c7fafc76cad11a83ad4378a666bf8f12a3eb1c7d6a2a6c6cb25aa languageName: node linkType: hard -"@commitlint/is-ignored@npm:^19.2.2": - version: 19.2.2 - resolution: "@commitlint/is-ignored@npm:19.2.2" +"@commitlint/is-ignored@npm:^19.5.0": + version: 19.5.0 + resolution: "@commitlint/is-ignored@npm:19.5.0" dependencies: - "@commitlint/types": "npm:^19.0.3" + "@commitlint/types": "npm:^19.5.0" semver: "npm:^7.6.0" - checksum: 10/f412734496aba808c8bcbddd59c615600d62447ad2b62049805a044b1f299ff6628e2c9ce5022e55848099edc2591f62a7780842d9dffcd60ab3889bc93fea62 + checksum: 10/1c7ee34686fd098587f9717763473477d49e847f470a317903f922d13091271d013a046f61b43b31b34eba4e4b0f76369b7427588269bbdc4c5f622d3ace2c95 languageName: node linkType: hard -"@commitlint/lint@npm:^19.2.2": - version: 19.2.2 - resolution: "@commitlint/lint@npm:19.2.2" +"@commitlint/lint@npm:^19.5.0": + version: 19.5.0 + resolution: "@commitlint/lint@npm:19.5.0" dependencies: - "@commitlint/is-ignored": "npm:^19.2.2" - "@commitlint/parse": "npm:^19.0.3" - "@commitlint/rules": "npm:^19.0.3" - "@commitlint/types": "npm:^19.0.3" - checksum: 10/9bf2ffa0f6cdde3d53d755b95ca717afd193f4560ae5bb0f5ffd7f1bbd571ddc99b27417733c70e1adbd74a5197e4525493b2dfc116680a939db7728fefa805c + "@commitlint/is-ignored": "npm:^19.5.0" + "@commitlint/parse": "npm:^19.5.0" + "@commitlint/rules": "npm:^19.5.0" + "@commitlint/types": "npm:^19.5.0" + checksum: 10/bba8cd17a90876b6b2cd2f869ee4d08cd3e5ad8a10f2c273d379d3b6602da30c46c2d9d0925710d7b9ebf180b3d1f02409adfc0f1a888cc566d88c9ee5862bdd languageName: node linkType: hard -"@commitlint/load@npm:^19.2.0": - version: 19.2.0 - resolution: "@commitlint/load@npm:19.2.0" +"@commitlint/load@npm:^19.5.0": + version: 19.5.0 + resolution: "@commitlint/load@npm:19.5.0" dependencies: - "@commitlint/config-validator": "npm:^19.0.3" - "@commitlint/execute-rule": "npm:^19.0.0" - "@commitlint/resolve-extends": "npm:^19.1.0" - "@commitlint/types": "npm:^19.0.3" + "@commitlint/config-validator": "npm:^19.5.0" + "@commitlint/execute-rule": "npm:^19.5.0" + "@commitlint/resolve-extends": "npm:^19.5.0" + "@commitlint/types": "npm:^19.5.0" chalk: "npm:^5.3.0" cosmiconfig: "npm:^9.0.0" cosmiconfig-typescript-loader: "npm:^5.0.0" lodash.isplainobject: "npm:^4.0.6" lodash.merge: "npm:^4.6.2" lodash.uniq: "npm:^4.5.0" - checksum: 10/5cd35a0a60064c70c06ab6bd8b1ae02cf6ecc1d0520b76c68cdc7c12094338f04c19e2df5d7ae30d681e858871c4f1963ae39e4969ed61139959cf4b300030fc + checksum: 10/87a9450c768632c09e9d98993752a5622aee698642eee5a9b31c3c48625455e043406b7ea6e02a8f41d86c524c9ecbdb9b823caf67da3048f0d96531177fda28 languageName: node linkType: hard -"@commitlint/message@npm:^19.0.0": - version: 19.0.0 - resolution: "@commitlint/message@npm:19.0.0" - checksum: 10/446ee97c12a4175a8b7a4cbf3754c01d54cd911973c7af9a2eac69277fb891e638ddc3db132f57588883b68eadf59074d388ec1808a205957042f71027244167 +"@commitlint/message@npm:^19.5.0": + version: 19.5.0 + resolution: "@commitlint/message@npm:19.5.0" + checksum: 10/ad6993476ce3e6ed6ed7ae5327ac8d5116ca70168d9de6dff656a7e6f2b9f01a1c3ac7a13418831b5cdc3148ea9bcd78c32bdb7aa863280108e176ff803f7a51 languageName: node linkType: hard -"@commitlint/parse@npm:^19.0.3": - version: 19.0.3 - resolution: "@commitlint/parse@npm:19.0.3" +"@commitlint/parse@npm:^19.5.0": + version: 19.5.0 + resolution: "@commitlint/parse@npm:19.5.0" dependencies: - "@commitlint/types": "npm:^19.0.3" + "@commitlint/types": "npm:^19.5.0" conventional-changelog-angular: "npm:^7.0.0" conventional-commits-parser: "npm:^5.0.0" - checksum: 10/ddd7a6007d37d7154f6b18bfa06dc26beb109cd4bcabe7e9ca2ff24088325ab2c7b09cc01cceb9d62e6e60affffe3d19e9685fab06d3506d047166d888d25487 + checksum: 10/2a6f8bbbd79aa36a7e1128c60cecb322557110aa4aa8757c741c2f79071c540ba56957cef81fb64f4a304535e462d0c48b5c1ef1b2766fea7971d38ec5ad6384 languageName: node linkType: hard -"@commitlint/read@npm:^19.2.1": - version: 19.2.1 - resolution: "@commitlint/read@npm:19.2.1" +"@commitlint/read@npm:^19.5.0": + version: 19.5.0 + resolution: "@commitlint/read@npm:19.5.0" dependencies: - "@commitlint/top-level": "npm:^19.0.0" - "@commitlint/types": "npm:^19.0.3" - execa: "npm:^8.0.1" + "@commitlint/top-level": "npm:^19.5.0" + "@commitlint/types": "npm:^19.5.0" git-raw-commits: "npm:^4.0.0" minimist: "npm:^1.2.8" - checksum: 10/840ebd183b2fe36dea03701552d825a9a1770d300b9416ab2a731fdeed66cf8c9dd8be133d92ac017cb9bf29e2ef5aee91a641f2b643bb5b33005f7b392ec953 + tinyexec: "npm:^0.3.0" + checksum: 10/0ea2da48ae1bab9add9e831a1659306567755c20ec74cf04e6e50ef1e520970decd259af652995f55eef422a3f1382f0e64e5fbc23606176f766f71076ad872b languageName: node linkType: hard -"@commitlint/resolve-extends@npm:^19.1.0": - version: 19.1.0 - resolution: "@commitlint/resolve-extends@npm:19.1.0" +"@commitlint/resolve-extends@npm:^19.5.0": + version: 19.5.0 + resolution: "@commitlint/resolve-extends@npm:19.5.0" dependencies: - "@commitlint/config-validator": "npm:^19.0.3" - "@commitlint/types": "npm:^19.0.3" + "@commitlint/config-validator": "npm:^19.5.0" + "@commitlint/types": "npm:^19.5.0" global-directory: "npm:^4.0.1" import-meta-resolve: "npm:^4.0.0" lodash.mergewith: "npm:^4.6.2" resolve-from: "npm:^5.0.0" - checksum: 10/453f8828b091886dc7cb4b13285bf3300be94266c3fc13453ab62fddc524a3969434dcebea3e4c4775621576fa25b41efbc62d773e3c44c1e87d12d7211166de + checksum: 10/71a1c9423570dedb55809f4ad7c35962607cb06921364116e8f2d8c3d37a7ff2a43747ad5a9cd924b58614e6880a42a3fa1510244748bb6997469b52b0fecd78 languageName: node linkType: hard -"@commitlint/rules@npm:^19.0.3": - version: 19.0.3 - resolution: "@commitlint/rules@npm:19.0.3" +"@commitlint/rules@npm:^19.5.0": + version: 19.5.0 + resolution: "@commitlint/rules@npm:19.5.0" dependencies: - "@commitlint/ensure": "npm:^19.0.3" - "@commitlint/message": "npm:^19.0.0" - "@commitlint/to-lines": "npm:^19.0.0" - "@commitlint/types": "npm:^19.0.3" - execa: "npm:^8.0.1" - checksum: 10/218033d96b0bae7dbea0e46483f8af823c17b492e4b0c4dca93a6312876d051cc88f4272d009e7eb06ff05585ec511aedd703132be17c7248698a4eac909986b + "@commitlint/ensure": "npm:^19.5.0" + "@commitlint/message": "npm:^19.5.0" + "@commitlint/to-lines": "npm:^19.5.0" + "@commitlint/types": "npm:^19.5.0" + checksum: 10/2c879d2cd50a3b4572cea41f044cc3091f0a11ef5ead0bb54bfa564ea637e0d93e08ae322ec4c99bb5b379b82835ace595d1c8dab6e35c1b68b63292160a61b3 languageName: node linkType: hard -"@commitlint/to-lines@npm:^19.0.0": - version: 19.0.0 - resolution: "@commitlint/to-lines@npm:19.0.0" - checksum: 10/5e7d5679aa242cd21be2076a8c8715aa3c9f4c3133f588df08c6b02f56a8a5b1a5d9e402076bd926dd2b61883e4b2c53fd6c9aa3554e3f54cd2296b2566eb1c2 +"@commitlint/to-lines@npm:^19.5.0": + version: 19.5.0 + resolution: "@commitlint/to-lines@npm:19.5.0" + checksum: 10/68aaca7bf1331b5f2f604e814d57f483ead81a8296f8cff5667249510a5601825dfbbaccade3d02e0aca580b973c01419276d693cc9aa888cbe11022daa9dce6 languageName: node linkType: hard -"@commitlint/top-level@npm:^19.0.0": - version: 19.0.0 - resolution: "@commitlint/top-level@npm:19.0.0" +"@commitlint/top-level@npm:^19.5.0": + version: 19.5.0 + resolution: "@commitlint/top-level@npm:19.5.0" dependencies: find-up: "npm:^7.0.0" - checksum: 10/47b0994d03f26caf2812110ead535bd10157beed6b3dff9cbb4eea165de9245673ba7d31829cd54af5855f7b075ebbf812b1f79586248be3932797888efeadf5 + checksum: 10/f6b5a3746c458e12c7a9e93f7c856ba90fba6e61db614ea1201e6b6e92cb8161dd13e88d8c9b408709ea0c19bc949cffcd1dd356cb6f51fc2ede8df48c1fd410 languageName: node linkType: hard -"@commitlint/types@npm:^19.0.3": - version: 19.0.3 - resolution: "@commitlint/types@npm:19.0.3" +"@commitlint/types@npm:^19.5.0": + version: 19.5.0 + resolution: "@commitlint/types@npm:19.5.0" dependencies: "@types/conventional-commits-parser": "npm:^5.0.0" chalk: "npm:^5.3.0" - checksum: 10/44e67f4861f9b137f43a441f8ab255676b7a276c82ca46ba7846ca1057d170af92a87d3e2a1378713dc4e33a68c8af513683cb96dcd29544e48e2c825109ea6f + checksum: 10/a26f33ec6987d7d93bdbd7e1b177cfac30ca056ea383faf343c6a09c0441aa057a24be1459c3d4e7e91edd2ecf8d6c4dd670948c9d22646d64767137c6db098a languageName: node linkType: hard @@ -3033,6 +3032,34 @@ __metadata: languageName: node linkType: hard +"@emnapi/core@npm:^1.1.0": + version: 1.2.0 + resolution: "@emnapi/core@npm:1.2.0" + dependencies: + "@emnapi/wasi-threads": "npm:1.0.1" + tslib: "npm:^2.4.0" + checksum: 10/b0b32b7702ae501be76c72ee77778e0356696b49a72f56c3c04774db23baa3a6054acf839a3d8a49fee415386946685edb904eaa3ac95b5c73cedd2f2766853c + languageName: node + linkType: hard + +"@emnapi/runtime@npm:^1.1.0": + version: 1.2.0 + resolution: "@emnapi/runtime@npm:1.2.0" + dependencies: + tslib: "npm:^2.4.0" + checksum: 10/c954b36493b713e451c74e9f1a48124b5491196700ec458c5d4a94eac3351e14803b4fd48ae6f72c77956d75792093d377f96412a6f59766099cb142e5c5b8f4 + languageName: node + linkType: hard + +"@emnapi/wasi-threads@npm:1.0.1": + version: 1.0.1 + resolution: "@emnapi/wasi-threads@npm:1.0.1" + dependencies: + tslib: "npm:^2.4.0" + checksum: 10/949f8bdcb11153d530652516b11d4b11d8c6ed48a692b4a59cbaa4305327aed59a61f0d87c366085c20ad0b0336c3b50eaddbddeeb3e8c55e7e82b583b9d98fb + languageName: node + linkType: hard + "@esbuild/aix-ppc64@npm:0.19.12": version: 0.19.12 resolution: "@esbuild/aix-ppc64@npm:0.19.12" @@ -3355,7 +3382,7 @@ __metadata: languageName: node linkType: hard -"@eslint-community/eslint-utils@npm:^4.2.0": +"@eslint-community/eslint-utils@npm:^4.2.0, @eslint-community/eslint-utils@npm:^4.4.0": version: 4.4.0 resolution: "@eslint-community/eslint-utils@npm:4.4.0" dependencies: @@ -3366,13 +3393,38 @@ __metadata: languageName: node linkType: hard -"@eslint-community/regexpp@npm:^4.4.0, @eslint-community/regexpp@npm:^4.6.1": +"@eslint-community/regexpp@npm:^4.10.0, @eslint-community/regexpp@npm:^4.11.0": + version: 4.11.1 + resolution: "@eslint-community/regexpp@npm:4.11.1" + checksum: 10/934b6d3588c7f16b18d41efec4fdb89616c440b7e3256b8cb92cfd31ae12908600f2b986d6c1e61a84cbc10256b1dd3448cd1eec79904bd67ac365d0f1aba2e2 + languageName: node + linkType: hard + +"@eslint-community/regexpp@npm:^4.6.1": version: 4.10.0 resolution: "@eslint-community/regexpp@npm:4.10.0" checksum: 10/8c36169c815fc5d726078e8c71a5b592957ee60d08c6470f9ce0187c8046af1a00afbda0a065cc40ff18d5d83f82aed9793c6818f7304a74a7488dc9f3ecbd42 languageName: node linkType: hard +"@eslint/config-array@npm:^0.18.0": + version: 0.18.0 + resolution: "@eslint/config-array@npm:0.18.0" + dependencies: + "@eslint/object-schema": "npm:^2.1.4" + debug: "npm:^4.3.1" + minimatch: "npm:^3.1.2" + checksum: 10/60ccad1eb4806710b085cd739568ec7afd289ee5af6ca0383f0876f9fe375559ef525f7b3f86bdb3f961493de952f2cf3ab4aa4a6ccaef0ae3cd688267cabcb3 + languageName: node + linkType: hard + +"@eslint/core@npm:^0.6.0": + version: 0.6.0 + resolution: "@eslint/core@npm:0.6.0" + checksum: 10/ec5cce168c8773fbd60c5a505563c6cf24398b3e1fa352929878d63129e0dd5b134d3232be2f2c49e8124a965d03359b38962aa0dcf7dfaf50746059d2a2f798 + languageName: node + linkType: hard + "@eslint/eslintrc@npm:^2.1.4": version: 2.1.4 resolution: "@eslint/eslintrc@npm:2.1.4" @@ -3390,6 +3442,23 @@ __metadata: languageName: node linkType: hard +"@eslint/eslintrc@npm:^3.1.0": + version: 3.1.0 + resolution: "@eslint/eslintrc@npm:3.1.0" + dependencies: + ajv: "npm:^6.12.4" + debug: "npm:^4.3.2" + espree: "npm:^10.0.1" + globals: "npm:^14.0.0" + ignore: "npm:^5.2.0" + import-fresh: "npm:^3.2.1" + js-yaml: "npm:^4.1.0" + minimatch: "npm:^3.1.2" + strip-json-comments: "npm:^3.1.1" + checksum: 10/02bf892d1397e1029209dea685e9f4f87baf643315df2a632b5f121ec7e8548a3b34f428a007234fa82772218fa8a3ac2d10328637b9ce63b7f8344035b74db3 + languageName: node + linkType: hard + "@eslint/js@npm:8.57.0": version: 8.57.0 resolution: "@eslint/js@npm:8.57.0" @@ -3397,10 +3466,33 @@ __metadata: languageName: node linkType: hard -"@faker-js/faker@npm:6.3.1": - version: 6.3.1 - resolution: "@faker-js/faker@npm:6.3.1" - checksum: 10/d6731c48f8fbe657c69ec8a1329f5dbb9e5a79f0b0e16fdf026a4cf0dbe14948ee9ed94fe801e6c845ed9bed214cab36901a7d52868f991b4efab8be64bbbbca +"@eslint/js@npm:9.11.1": + version: 9.11.1 + resolution: "@eslint/js@npm:9.11.1" + checksum: 10/77b9c744bdf24e2ca1f99f671139767d6c31cb10d732cf22a85ef28f1f95f2a621cf204f572fd9fee67da6193ff2597a5d236cef3b557b07624230b622612339 + languageName: node + linkType: hard + +"@eslint/object-schema@npm:^2.1.4": + version: 2.1.4 + resolution: "@eslint/object-schema@npm:2.1.4" + checksum: 10/221e8d9f281c605948cd6e030874aacce83fe097f8f9c1964787037bccf08e82b7aa9eff1850a30fffac43f1d76555727ec22a2af479d91e268e89d1e035131e + languageName: node + linkType: hard + +"@eslint/plugin-kit@npm:^0.2.0": + version: 0.2.0 + resolution: "@eslint/plugin-kit@npm:0.2.0" + dependencies: + levn: "npm:^0.4.1" + checksum: 10/ebb363174397341dea47dc35fc206e24328083e4f0fa1c539687dbb7f94bef77e43faa12867d032e6eea5ac980ea8fbb6b1d844186e422d327c04088041b99f3 + languageName: node + linkType: hard + +"@faker-js/faker@npm:9.0.1": + version: 9.0.1 + resolution: "@faker-js/faker@npm:9.0.1" + checksum: 10/708629605392fdbe06887ca9b083d73801c64b47917f790870b240858ab65cada14b52dddf2cb7e471ad0f6ddf66ea30e7ffda741c5ba9bd5c27318b47262279 languageName: node linkType: hard @@ -3610,6 +3702,13 @@ __metadata: languageName: node linkType: hard +"@humanwhocodes/retry@npm:^0.3.0": + version: 0.3.0 + resolution: "@humanwhocodes/retry@npm:0.3.0" + checksum: 10/e574bab58680867414e225c9002e9a97eb396f85871c180fbb1a9bcdf9ded4b4de0b327f7d0c43b775873362b7c92956d4b322e8bc4b90be56077524341f04b2 + languageName: node + linkType: hard + "@hutson/parse-repository-url@npm:^3.0.0": version: 3.0.2 resolution: "@hutson/parse-repository-url@npm:3.0.2" @@ -3980,59 +4079,6 @@ __metadata: languageName: node linkType: hard -"@microsoft/api-extractor-model@npm:7.29.4": - version: 7.29.4 - resolution: "@microsoft/api-extractor-model@npm:7.29.4" - dependencies: - "@microsoft/tsdoc": "npm:~0.15.0" - "@microsoft/tsdoc-config": "npm:~0.17.0" - "@rushstack/node-core-library": "npm:5.5.1" - checksum: 10/50bd4e58bfe9d43e0ca4a72324601ce17c015e517b0803bb787d1067bef9372a23bbbf2551f47d1c5a7fef742826ffa18aea43b96c823b82c07f745e3ea25657 - languageName: node - linkType: hard - -"@microsoft/api-extractor@npm:7.47.4": - version: 7.47.4 - resolution: "@microsoft/api-extractor@npm:7.47.4" - dependencies: - "@microsoft/api-extractor-model": "npm:7.29.4" - "@microsoft/tsdoc": "npm:~0.15.0" - "@microsoft/tsdoc-config": "npm:~0.17.0" - "@rushstack/node-core-library": "npm:5.5.1" - "@rushstack/rig-package": "npm:0.5.3" - "@rushstack/terminal": "npm:0.13.3" - "@rushstack/ts-command-line": "npm:4.22.3" - lodash: "npm:~4.17.15" - minimatch: "npm:~3.0.3" - resolve: "npm:~1.22.1" - semver: "npm:~7.5.4" - source-map: "npm:~0.6.1" - typescript: "npm:5.4.2" - bin: - api-extractor: bin/api-extractor - checksum: 10/e7be27981cc4ba34d3fcc694d044bb952835d77ab908ce1d528cd76d7100cee33137c0d13257332dd12e07dae1d0937f0f5218348f3c9f7b2258dda89dce47cc - languageName: node - linkType: hard - -"@microsoft/tsdoc-config@npm:~0.17.0": - version: 0.17.0 - resolution: "@microsoft/tsdoc-config@npm:0.17.0" - dependencies: - "@microsoft/tsdoc": "npm:0.15.0" - ajv: "npm:~8.12.0" - jju: "npm:~1.4.0" - resolve: "npm:~1.22.2" - checksum: 10/6e20f9b917d20e517b6752cbb46c84ccc4c8be7ce82d7424e413bd7111a2f1497714a72e61ac1a96df97d0050cb98b3a53006316eeb0cfea9bb6d7131432c7a8 - languageName: node - linkType: hard - -"@microsoft/tsdoc@npm:0.15.0, @microsoft/tsdoc@npm:~0.15.0": - version: 0.15.0 - resolution: "@microsoft/tsdoc@npm:0.15.0" - checksum: 10/fd025e5e3966248cd5477b9ddad4e9aa0dd69291f372a207f18a686b3097dcf5ecf38325caf0f4ad2697f1f39fd45b536e4ada6756008b8bcc5eccbc3201313d - languageName: node - linkType: hard - "@mikro-orm/core@npm:6.2.2": version: 6.2.2 resolution: "@mikro-orm/core@npm:6.2.2" @@ -4130,6 +4176,17 @@ __metadata: languageName: node linkType: hard +"@napi-rs/wasm-runtime@npm:^0.2.4": + version: 0.2.4 + resolution: "@napi-rs/wasm-runtime@npm:0.2.4" + dependencies: + "@emnapi/core": "npm:^1.1.0" + "@emnapi/runtime": "npm:^1.1.0" + "@tybys/wasm-util": "npm:^0.9.0" + checksum: 10/af335867eca9696b0dbb1b8439878e0408a853c42419cd71d2c5dcf9f7c9f6a8549ea88b3a31b9544bb3a9376e5742f3268e58ee066925d3726bd76a121eb8a6 + languageName: node + linkType: hard + "@nodelib/fs.scandir@npm:2.1.5": version: 2.1.5 resolution: "@nodelib/fs.scandir@npm:2.1.5" @@ -4850,6 +4907,85 @@ __metadata: languageName: node linkType: hard +"@oxc-resolver/binding-darwin-arm64@npm:1.11.0": + version: 1.11.0 + resolution: "@oxc-resolver/binding-darwin-arm64@npm:1.11.0" + conditions: os=darwin & cpu=arm64 + languageName: node + linkType: hard + +"@oxc-resolver/binding-darwin-x64@npm:1.11.0": + version: 1.11.0 + resolution: "@oxc-resolver/binding-darwin-x64@npm:1.11.0" + conditions: os=darwin & cpu=x64 + languageName: node + linkType: hard + +"@oxc-resolver/binding-freebsd-x64@npm:1.11.0": + version: 1.11.0 + resolution: "@oxc-resolver/binding-freebsd-x64@npm:1.11.0" + conditions: os=freebsd & cpu=x64 + languageName: node + linkType: hard + +"@oxc-resolver/binding-linux-arm-gnueabihf@npm:1.11.0": + version: 1.11.0 + resolution: "@oxc-resolver/binding-linux-arm-gnueabihf@npm:1.11.0" + conditions: os=linux & cpu=arm + languageName: node + linkType: hard + +"@oxc-resolver/binding-linux-arm64-gnu@npm:1.11.0": + version: 1.11.0 + resolution: "@oxc-resolver/binding-linux-arm64-gnu@npm:1.11.0" + conditions: os=linux & cpu=arm64 & libc=glibc + languageName: node + linkType: hard + +"@oxc-resolver/binding-linux-arm64-musl@npm:1.11.0": + version: 1.11.0 + resolution: "@oxc-resolver/binding-linux-arm64-musl@npm:1.11.0" + conditions: os=linux & cpu=arm64 & libc=musl + languageName: node + linkType: hard + +"@oxc-resolver/binding-linux-x64-gnu@npm:1.11.0": + version: 1.11.0 + resolution: "@oxc-resolver/binding-linux-x64-gnu@npm:1.11.0" + conditions: os=linux & cpu=x64 & libc=glibc + languageName: node + linkType: hard + +"@oxc-resolver/binding-linux-x64-musl@npm:1.11.0": + version: 1.11.0 + resolution: "@oxc-resolver/binding-linux-x64-musl@npm:1.11.0" + conditions: os=linux & cpu=x64 & libc=musl + languageName: node + linkType: hard + +"@oxc-resolver/binding-wasm32-wasi@npm:1.11.0": + version: 1.11.0 + resolution: "@oxc-resolver/binding-wasm32-wasi@npm:1.11.0" + dependencies: + "@napi-rs/wasm-runtime": "npm:^0.2.4" + conditions: cpu=wasm32 + languageName: node + linkType: hard + +"@oxc-resolver/binding-win32-arm64-msvc@npm:1.11.0": + version: 1.11.0 + resolution: "@oxc-resolver/binding-win32-arm64-msvc@npm:1.11.0" + conditions: os=win32 & cpu=arm64 + languageName: node + linkType: hard + +"@oxc-resolver/binding-win32-x64-msvc@npm:1.11.0": + version: 1.11.0 + resolution: "@oxc-resolver/binding-win32-x64-msvc@npm:1.11.0" + conditions: os=win32 & cpu=x64 + languageName: node + linkType: hard + "@panva/asn1.js@npm:^1.0.0": version: 1.0.0 resolution: "@panva/asn1.js@npm:1.0.0" @@ -5192,6 +5328,13 @@ __metadata: languageName: node linkType: hard +"@rollup/rollup-android-arm-eabi@npm:4.22.4": + version: 4.22.4 + resolution: "@rollup/rollup-android-arm-eabi@npm:4.22.4" + conditions: os=android & cpu=arm + languageName: node + linkType: hard + "@rollup/rollup-android-arm64@npm:4.20.0": version: 4.20.0 resolution: "@rollup/rollup-android-arm64@npm:4.20.0" @@ -5199,6 +5342,13 @@ __metadata: languageName: node linkType: hard +"@rollup/rollup-android-arm64@npm:4.22.4": + version: 4.22.4 + resolution: "@rollup/rollup-android-arm64@npm:4.22.4" + conditions: os=android & cpu=arm64 + languageName: node + linkType: hard + "@rollup/rollup-darwin-arm64@npm:4.20.0": version: 4.20.0 resolution: "@rollup/rollup-darwin-arm64@npm:4.20.0" @@ -5206,6 +5356,13 @@ __metadata: languageName: node linkType: hard +"@rollup/rollup-darwin-arm64@npm:4.22.4": + version: 4.22.4 + resolution: "@rollup/rollup-darwin-arm64@npm:4.22.4" + conditions: os=darwin & cpu=arm64 + languageName: node + linkType: hard + "@rollup/rollup-darwin-x64@npm:4.20.0": version: 4.20.0 resolution: "@rollup/rollup-darwin-x64@npm:4.20.0" @@ -5213,6 +5370,13 @@ __metadata: languageName: node linkType: hard +"@rollup/rollup-darwin-x64@npm:4.22.4": + version: 4.22.4 + resolution: "@rollup/rollup-darwin-x64@npm:4.22.4" + conditions: os=darwin & cpu=x64 + languageName: node + linkType: hard + "@rollup/rollup-linux-arm-gnueabihf@npm:4.20.0": version: 4.20.0 resolution: "@rollup/rollup-linux-arm-gnueabihf@npm:4.20.0" @@ -5220,6 +5384,13 @@ __metadata: languageName: node linkType: hard +"@rollup/rollup-linux-arm-gnueabihf@npm:4.22.4": + version: 4.22.4 + resolution: "@rollup/rollup-linux-arm-gnueabihf@npm:4.22.4" + conditions: os=linux & cpu=arm & libc=glibc + languageName: node + linkType: hard + "@rollup/rollup-linux-arm-musleabihf@npm:4.20.0": version: 4.20.0 resolution: "@rollup/rollup-linux-arm-musleabihf@npm:4.20.0" @@ -5227,6 +5398,13 @@ __metadata: languageName: node linkType: hard +"@rollup/rollup-linux-arm-musleabihf@npm:4.22.4": + version: 4.22.4 + resolution: "@rollup/rollup-linux-arm-musleabihf@npm:4.22.4" + conditions: os=linux & cpu=arm & libc=musl + languageName: node + linkType: hard + "@rollup/rollup-linux-arm64-gnu@npm:4.20.0": version: 4.20.0 resolution: "@rollup/rollup-linux-arm64-gnu@npm:4.20.0" @@ -5234,6 +5412,13 @@ __metadata: languageName: node linkType: hard +"@rollup/rollup-linux-arm64-gnu@npm:4.22.4": + version: 4.22.4 + resolution: "@rollup/rollup-linux-arm64-gnu@npm:4.22.4" + conditions: os=linux & cpu=arm64 & libc=glibc + languageName: node + linkType: hard + "@rollup/rollup-linux-arm64-musl@npm:4.20.0": version: 4.20.0 resolution: "@rollup/rollup-linux-arm64-musl@npm:4.20.0" @@ -5241,6 +5426,13 @@ __metadata: languageName: node linkType: hard +"@rollup/rollup-linux-arm64-musl@npm:4.22.4": + version: 4.22.4 + resolution: "@rollup/rollup-linux-arm64-musl@npm:4.22.4" + conditions: os=linux & cpu=arm64 & libc=musl + languageName: node + linkType: hard + "@rollup/rollup-linux-powerpc64le-gnu@npm:4.20.0": version: 4.20.0 resolution: "@rollup/rollup-linux-powerpc64le-gnu@npm:4.20.0" @@ -5248,6 +5440,13 @@ __metadata: languageName: node linkType: hard +"@rollup/rollup-linux-powerpc64le-gnu@npm:4.22.4": + version: 4.22.4 + resolution: "@rollup/rollup-linux-powerpc64le-gnu@npm:4.22.4" + conditions: os=linux & cpu=ppc64 & libc=glibc + languageName: node + linkType: hard + "@rollup/rollup-linux-riscv64-gnu@npm:4.20.0": version: 4.20.0 resolution: "@rollup/rollup-linux-riscv64-gnu@npm:4.20.0" @@ -5255,6 +5454,13 @@ __metadata: languageName: node linkType: hard +"@rollup/rollup-linux-riscv64-gnu@npm:4.22.4": + version: 4.22.4 + resolution: "@rollup/rollup-linux-riscv64-gnu@npm:4.22.4" + conditions: os=linux & cpu=riscv64 & libc=glibc + languageName: node + linkType: hard + "@rollup/rollup-linux-s390x-gnu@npm:4.20.0": version: 4.20.0 resolution: "@rollup/rollup-linux-s390x-gnu@npm:4.20.0" @@ -5262,6 +5468,13 @@ __metadata: languageName: node linkType: hard +"@rollup/rollup-linux-s390x-gnu@npm:4.22.4": + version: 4.22.4 + resolution: "@rollup/rollup-linux-s390x-gnu@npm:4.22.4" + conditions: os=linux & cpu=s390x & libc=glibc + languageName: node + linkType: hard + "@rollup/rollup-linux-x64-gnu@npm:4.20.0": version: 4.20.0 resolution: "@rollup/rollup-linux-x64-gnu@npm:4.20.0" @@ -5269,6 +5482,13 @@ __metadata: languageName: node linkType: hard +"@rollup/rollup-linux-x64-gnu@npm:4.22.4": + version: 4.22.4 + resolution: "@rollup/rollup-linux-x64-gnu@npm:4.22.4" + conditions: os=linux & cpu=x64 & libc=glibc + languageName: node + linkType: hard + "@rollup/rollup-linux-x64-musl@npm:4.20.0": version: 4.20.0 resolution: "@rollup/rollup-linux-x64-musl@npm:4.20.0" @@ -5276,6 +5496,13 @@ __metadata: languageName: node linkType: hard +"@rollup/rollup-linux-x64-musl@npm:4.22.4": + version: 4.22.4 + resolution: "@rollup/rollup-linux-x64-musl@npm:4.22.4" + conditions: os=linux & cpu=x64 & libc=musl + languageName: node + linkType: hard + "@rollup/rollup-win32-arm64-msvc@npm:4.20.0": version: 4.20.0 resolution: "@rollup/rollup-win32-arm64-msvc@npm:4.20.0" @@ -5283,6 +5510,13 @@ __metadata: languageName: node linkType: hard +"@rollup/rollup-win32-arm64-msvc@npm:4.22.4": + version: 4.22.4 + resolution: "@rollup/rollup-win32-arm64-msvc@npm:4.22.4" + conditions: os=win32 & cpu=arm64 + languageName: node + linkType: hard + "@rollup/rollup-win32-ia32-msvc@npm:4.20.0": version: 4.20.0 resolution: "@rollup/rollup-win32-ia32-msvc@npm:4.20.0" @@ -5290,6 +5524,13 @@ __metadata: languageName: node linkType: hard +"@rollup/rollup-win32-ia32-msvc@npm:4.22.4": + version: 4.22.4 + resolution: "@rollup/rollup-win32-ia32-msvc@npm:4.22.4" + conditions: os=win32 & cpu=ia32 + languageName: node + linkType: hard + "@rollup/rollup-win32-x64-msvc@npm:4.20.0": version: 4.20.0 resolution: "@rollup/rollup-win32-x64-msvc@npm:4.20.0" @@ -5297,61 +5538,10 @@ __metadata: languageName: node linkType: hard -"@rushstack/node-core-library@npm:5.5.1": - version: 5.5.1 - resolution: "@rushstack/node-core-library@npm:5.5.1" - dependencies: - ajv: "npm:~8.13.0" - ajv-draft-04: "npm:~1.0.0" - ajv-formats: "npm:~3.0.1" - fs-extra: "npm:~7.0.1" - import-lazy: "npm:~4.0.0" - jju: "npm:~1.4.0" - resolve: "npm:~1.22.1" - semver: "npm:~7.5.4" - peerDependencies: - "@types/node": "*" - peerDependenciesMeta: - "@types/node": - optional: true - checksum: 10/e2d44c9bd00ecff3a108ae4aeff707a724e50cd3c6cb229f42fcee5be0aeafb1f3a420dd4e3eeaad4968c47b280d5d1a4017adf557479fe9314271b8efd44468 - languageName: node - linkType: hard - -"@rushstack/rig-package@npm:0.5.3": - version: 0.5.3 - resolution: "@rushstack/rig-package@npm:0.5.3" - dependencies: - resolve: "npm:~1.22.1" - strip-json-comments: "npm:~3.1.1" - checksum: 10/b58a3925a41d7a0e79f4fde7c400a379683cc7b0073c447aba6d36231529a37e7d2f4559f459be785ad862ecb01b618b2d0ff60661046e5223437356155ccb14 - languageName: node - linkType: hard - -"@rushstack/terminal@npm:0.13.3": - version: 0.13.3 - resolution: "@rushstack/terminal@npm:0.13.3" - dependencies: - "@rushstack/node-core-library": "npm:5.5.1" - supports-color: "npm:~8.1.1" - peerDependencies: - "@types/node": "*" - peerDependenciesMeta: - "@types/node": - optional: true - checksum: 10/2cc2fc62d811e539f7f6cd7902cf0fcc78a5061732c444e05c3e9466cf45f8129e605da763e1b94e78420699fab8ede4421c6b97ca8733bc87e660f6d0e39acb - languageName: node - linkType: hard - -"@rushstack/ts-command-line@npm:4.22.3": - version: 4.22.3 - resolution: "@rushstack/ts-command-line@npm:4.22.3" - dependencies: - "@rushstack/terminal": "npm:0.13.3" - "@types/argparse": "npm:1.0.38" - argparse: "npm:~1.0.9" - string-argv: "npm:~0.3.1" - checksum: 10/64509a787022944ee8bbb5e860f6791d004bc5c8a0c8a74f35b4e30622ea3ef5b1912acf1c7af3eb183407d62059eb4982c9ad2d69eea7e3b53c4d1c76736b43 +"@rollup/rollup-win32-x64-msvc@npm:4.22.4": + version: 4.22.4 + resolution: "@rollup/rollup-win32-x64-msvc@npm:4.22.4" + conditions: os=win32 & cpu=x64 languageName: node linkType: hard @@ -5369,20 +5559,28 @@ __metadata: languageName: node linkType: hard -"@semantic-release/commit-analyzer@npm:^12.0.0": - version: 12.0.0 - resolution: "@semantic-release/commit-analyzer@npm:12.0.0" +"@sec-ant/readable-stream@npm:^0.4.1": + version: 0.4.1 + resolution: "@sec-ant/readable-stream@npm:0.4.1" + checksum: 10/aac89581652ac85debe7c5303451c2ebf8bf25ca25db680e4b9b73168f6940616d9a4bbe3348981827b1159b14e2f2e6af4b7bd5735cac898c12d5c51909c102 + languageName: node + linkType: hard + +"@semantic-release/commit-analyzer@npm:^13.0.0-beta.1": + version: 13.0.0 + resolution: "@semantic-release/commit-analyzer@npm:13.0.0" dependencies: - conventional-changelog-angular: "npm:^7.0.0" - conventional-commits-filter: "npm:^4.0.0" - conventional-commits-parser: "npm:^5.0.0" + conventional-changelog-angular: "npm:^8.0.0" + conventional-changelog-writer: "npm:^8.0.0" + conventional-commits-filter: "npm:^5.0.0" + conventional-commits-parser: "npm:^6.0.0" debug: "npm:^4.0.0" import-from-esm: "npm:^1.0.3" lodash-es: "npm:^4.17.21" micromatch: "npm:^4.0.2" peerDependencies: semantic-release: ">=20.1.0" - checksum: 10/a095ab4a873d65f497cfebd55966ad441280df34da6d591939e1dffeaa43dd7db10ef5418ae4052f3a9a11492cbe79c35453133d06bc36009600b1d56b39b9c9 + checksum: 10/d76463143aed73ec75cf66fb2b6b0649ed6f6d0864823f47ba907a25f3617190354b6abe05c44b19a8a5165181e35fc704c788becb958c64e5218a353a1fa189 languageName: node linkType: hard @@ -5449,23 +5647,23 @@ __metadata: languageName: node linkType: hard -"@semantic-release/release-notes-generator@npm:^12.0.0": - version: 12.1.0 - resolution: "@semantic-release/release-notes-generator@npm:12.1.0" +"@semantic-release/release-notes-generator@npm:^14.0.0-beta.1": + version: 14.0.1 + resolution: "@semantic-release/release-notes-generator@npm:14.0.1" dependencies: - conventional-changelog-angular: "npm:^7.0.0" - conventional-changelog-writer: "npm:^7.0.0" - conventional-commits-filter: "npm:^4.0.0" - conventional-commits-parser: "npm:^5.0.0" + conventional-changelog-angular: "npm:^8.0.0" + conventional-changelog-writer: "npm:^8.0.0" + conventional-commits-filter: "npm:^5.0.0" + conventional-commits-parser: "npm:^6.0.0" debug: "npm:^4.0.0" get-stream: "npm:^7.0.0" import-from-esm: "npm:^1.0.3" into-stream: "npm:^7.0.0" lodash-es: "npm:^4.17.21" - read-pkg-up: "npm:^11.0.0" + read-package-up: "npm:^11.0.0" peerDependencies: semantic-release: ">=20.1.0" - checksum: 10/ff8c5e3b5889f370f73c0da345f7ffe9f5c85a2804dd2a362040b438fdf20be12f5244d118d67991ff17e1b62f505718a7446a9cc8318e79395b9dbaf9d31bbe + checksum: 10/3312392cdd47deccc3cff812f42fc6b3f3bfffbe3e5af256f9e37b276a88f5878ce77556faf85f90669d82850a42ca3f1f996bf282952becfe2f0b23d947683b languageName: node linkType: hard @@ -5597,6 +5795,13 @@ __metadata: languageName: node linkType: hard +"@sindresorhus/merge-streams@npm:^4.0.0": + version: 4.0.0 + resolution: "@sindresorhus/merge-streams@npm:4.0.0" + checksum: 10/16551c787f5328c8ef05fd9831ade64369ccc992df78deb635ec6c44af217d2f1b43f8728c348cdc4e00585ff2fad6e00d8155199cbf6b154acc45fe65cbf0aa + languageName: node + linkType: hard + "@smithy/abort-controller@npm:^1.0.2": version: 1.0.2 resolution: "@smithy/abort-controller@npm:1.0.2" @@ -6027,47 +6232,41 @@ __metadata: languageName: node linkType: hard -"@swc-node/core@npm:^1.10.6": - version: 1.13.0 - resolution: "@swc-node/core@npm:1.13.0" +"@swc-node/core@npm:^1.13.3": + version: 1.13.3 + resolution: "@swc-node/core@npm:1.13.3" peerDependencies: - "@swc/core": ">= 1.3" + "@swc/core": ">= 1.4.13" "@swc/types": ">= 0.1" - checksum: 10/06f5634038346fbceeb18ef44c2d6e28c499da44fe775f84199afd7db358a548127573af92ff84f6b4913cdd69047a492e0dc2cbe0830444023743cd33fe1970 + checksum: 10/4fcc180f047e5d60bad49f793a477740262c9833fc7cd9d34ff4286ea7026f9d77aad122f9c728b73c9addc494b27f8405db32c1b5c446dc9eb94b7bc3cdee1f languageName: node linkType: hard -"@swc-node/register@npm:1.6.8": - version: 1.6.8 - resolution: "@swc-node/register@npm:1.6.8" +"@swc-node/register@npm:1.10.9": + version: 1.10.9 + resolution: "@swc-node/register@npm:1.10.9" dependencies: - "@swc-node/core": "npm:^1.10.6" - "@swc-node/sourcemap-support": "npm:^0.3.0" - colorette: "npm:^2.0.19" - debug: "npm:^4.3.4" - pirates: "npm:^4.0.5" - tslib: "npm:^2.5.0" + "@swc-node/core": "npm:^1.13.3" + "@swc-node/sourcemap-support": "npm:^0.5.1" + colorette: "npm:^2.0.20" + debug: "npm:^4.3.5" + oxc-resolver: "npm:^1.10.2" + pirates: "npm:^4.0.6" + tslib: "npm:^2.6.3" peerDependencies: - "@swc/core": ">= 1.3" + "@swc/core": ">= 1.4.13" typescript: ">= 4.3" - checksum: 10/028b28c324011e859172b14c07e8fb32e9d8b107c1ee3216e0c1838c7d5b16aadbb7e186fdf8da4b48d4b8d958df00154de56580e502bd27be695f50f30b964f + checksum: 10/e6b7e2623ddb8e53aa3c941bdc6ca7aaf67336447c3fdb211b218e6db747eb2df5aff88b7da8edcb74fd3fb11c018b92e4b60eba5da3654524504ec36454e1c2 languageName: node linkType: hard -"@swc-node/sourcemap-support@npm:^0.3.0": - version: 0.3.0 - resolution: "@swc-node/sourcemap-support@npm:0.3.0" +"@swc-node/sourcemap-support@npm:^0.5.1": + version: 0.5.1 + resolution: "@swc-node/sourcemap-support@npm:0.5.1" dependencies: source-map-support: "npm:^0.5.21" - tslib: "npm:^2.5.0" - checksum: 10/c172f420f0c6e072859dd3a5a0c3f49045c9d4b9546f222c8bfcbf2e1a60b81318b33790b7d111e4e90d1e1f68285354f99692503d7ac4eae07d65ac3ff8aa0a - languageName: node - linkType: hard - -"@swc/core-darwin-arm64@npm:1.3.41": - version: 1.3.41 - resolution: "@swc/core-darwin-arm64@npm:1.3.41" - conditions: os=darwin & cpu=arm64 + tslib: "npm:^2.6.3" + checksum: 10/d347be3a3fb1507aa2de4d07cc70d845722b4af64762b193f8407b0010fd28592b0dcaba0046fa7ab71276f72d6bc70d1742bc6ec6589e75784445b7b116accc languageName: node linkType: hard @@ -6078,10 +6277,10 @@ __metadata: languageName: node linkType: hard -"@swc/core-darwin-x64@npm:1.3.41": - version: 1.3.41 - resolution: "@swc/core-darwin-x64@npm:1.3.41" - conditions: os=darwin & cpu=x64 +"@swc/core-darwin-arm64@npm:1.7.26": + version: 1.7.26 + resolution: "@swc/core-darwin-arm64@npm:1.7.26" + conditions: os=darwin & cpu=arm64 languageName: node linkType: hard @@ -6092,10 +6291,10 @@ __metadata: languageName: node linkType: hard -"@swc/core-linux-arm-gnueabihf@npm:1.3.41": - version: 1.3.41 - resolution: "@swc/core-linux-arm-gnueabihf@npm:1.3.41" - conditions: os=linux & cpu=arm +"@swc/core-darwin-x64@npm:1.7.26": + version: 1.7.26 + resolution: "@swc/core-darwin-x64@npm:1.7.26" + conditions: os=darwin & cpu=x64 languageName: node linkType: hard @@ -6106,10 +6305,10 @@ __metadata: languageName: node linkType: hard -"@swc/core-linux-arm64-gnu@npm:1.3.41": - version: 1.3.41 - resolution: "@swc/core-linux-arm64-gnu@npm:1.3.41" - conditions: os=linux & cpu=arm64 & libc=glibc +"@swc/core-linux-arm-gnueabihf@npm:1.7.26": + version: 1.7.26 + resolution: "@swc/core-linux-arm-gnueabihf@npm:1.7.26" + conditions: os=linux & cpu=arm languageName: node linkType: hard @@ -6120,10 +6319,10 @@ __metadata: languageName: node linkType: hard -"@swc/core-linux-arm64-musl@npm:1.3.41": - version: 1.3.41 - resolution: "@swc/core-linux-arm64-musl@npm:1.3.41" - conditions: os=linux & cpu=arm64 & libc=musl +"@swc/core-linux-arm64-gnu@npm:1.7.26": + version: 1.7.26 + resolution: "@swc/core-linux-arm64-gnu@npm:1.7.26" + conditions: os=linux & cpu=arm64 & libc=glibc languageName: node linkType: hard @@ -6134,10 +6333,10 @@ __metadata: languageName: node linkType: hard -"@swc/core-linux-x64-gnu@npm:1.3.41": - version: 1.3.41 - resolution: "@swc/core-linux-x64-gnu@npm:1.3.41" - conditions: os=linux & cpu=x64 & libc=glibc +"@swc/core-linux-arm64-musl@npm:1.7.26": + version: 1.7.26 + resolution: "@swc/core-linux-arm64-musl@npm:1.7.26" + conditions: os=linux & cpu=arm64 & libc=musl languageName: node linkType: hard @@ -6148,10 +6347,10 @@ __metadata: languageName: node linkType: hard -"@swc/core-linux-x64-musl@npm:1.3.41": - version: 1.3.41 - resolution: "@swc/core-linux-x64-musl@npm:1.3.41" - conditions: os=linux & cpu=x64 & libc=musl +"@swc/core-linux-x64-gnu@npm:1.7.26": + version: 1.7.26 + resolution: "@swc/core-linux-x64-gnu@npm:1.7.26" + conditions: os=linux & cpu=x64 & libc=glibc languageName: node linkType: hard @@ -6162,10 +6361,10 @@ __metadata: languageName: node linkType: hard -"@swc/core-win32-arm64-msvc@npm:1.3.41": - version: 1.3.41 - resolution: "@swc/core-win32-arm64-msvc@npm:1.3.41" - conditions: os=win32 & cpu=arm64 +"@swc/core-linux-x64-musl@npm:1.7.26": + version: 1.7.26 + resolution: "@swc/core-linux-x64-musl@npm:1.7.26" + conditions: os=linux & cpu=x64 & libc=musl languageName: node linkType: hard @@ -6176,10 +6375,10 @@ __metadata: languageName: node linkType: hard -"@swc/core-win32-ia32-msvc@npm:1.3.41": - version: 1.3.41 - resolution: "@swc/core-win32-ia32-msvc@npm:1.3.41" - conditions: os=win32 & cpu=ia32 +"@swc/core-win32-arm64-msvc@npm:1.7.26": + version: 1.7.26 + resolution: "@swc/core-win32-arm64-msvc@npm:1.7.26" + conditions: os=win32 & cpu=arm64 languageName: node linkType: hard @@ -6190,10 +6389,10 @@ __metadata: languageName: node linkType: hard -"@swc/core-win32-x64-msvc@npm:1.3.41": - version: 1.3.41 - resolution: "@swc/core-win32-x64-msvc@npm:1.3.41" - conditions: os=win32 & cpu=x64 +"@swc/core-win32-ia32-msvc@npm:1.7.26": + version: 1.7.26 + resolution: "@swc/core-win32-ia32-msvc@npm:1.7.26" + conditions: os=win32 & cpu=ia32 languageName: node linkType: hard @@ -6204,20 +6403,31 @@ __metadata: languageName: node linkType: hard -"@swc/core@npm:1.3.41": - version: 1.3.41 - resolution: "@swc/core@npm:1.3.41" +"@swc/core-win32-x64-msvc@npm:1.7.26": + version: 1.7.26 + resolution: "@swc/core-win32-x64-msvc@npm:1.7.26" + conditions: os=win32 & cpu=x64 + languageName: node + linkType: hard + +"@swc/core@npm:1.7.26": + version: 1.7.26 + resolution: "@swc/core@npm:1.7.26" dependencies: - "@swc/core-darwin-arm64": "npm:1.3.41" - "@swc/core-darwin-x64": "npm:1.3.41" - "@swc/core-linux-arm-gnueabihf": "npm:1.3.41" - "@swc/core-linux-arm64-gnu": "npm:1.3.41" - "@swc/core-linux-arm64-musl": "npm:1.3.41" - "@swc/core-linux-x64-gnu": "npm:1.3.41" - "@swc/core-linux-x64-musl": "npm:1.3.41" - "@swc/core-win32-arm64-msvc": "npm:1.3.41" - "@swc/core-win32-ia32-msvc": "npm:1.3.41" - "@swc/core-win32-x64-msvc": "npm:1.3.41" + "@swc/core-darwin-arm64": "npm:1.7.26" + "@swc/core-darwin-x64": "npm:1.7.26" + "@swc/core-linux-arm-gnueabihf": "npm:1.7.26" + "@swc/core-linux-arm64-gnu": "npm:1.7.26" + "@swc/core-linux-arm64-musl": "npm:1.7.26" + "@swc/core-linux-x64-gnu": "npm:1.7.26" + "@swc/core-linux-x64-musl": "npm:1.7.26" + "@swc/core-win32-arm64-msvc": "npm:1.7.26" + "@swc/core-win32-ia32-msvc": "npm:1.7.26" + "@swc/core-win32-x64-msvc": "npm:1.7.26" + "@swc/counter": "npm:^0.1.3" + "@swc/types": "npm:^0.1.12" + peerDependencies: + "@swc/helpers": "*" dependenciesMeta: "@swc/core-darwin-arm64": optional: true @@ -6239,7 +6449,10 @@ __metadata: optional: true "@swc/core-win32-x64-msvc": optional: true - checksum: 10/c8913130b9b3d78cdfd13509671b61e435de06c62e7b1f4c865948947901b90013c390afd95a93aceac5d3de5b820e9129f506de44448ae87c02c171ed0c2eae + peerDependenciesMeta: + "@swc/helpers": + optional: true + checksum: 10/8fb43420bdd1b774dc054c6629f87f733e76860b97130609c7374f3a48406bc0ae1a2dd0b3e3c10317c692b2eaa64747f1a690b309727a8d1411112e2d2a884e languageName: node linkType: hard @@ -6296,12 +6509,28 @@ __metadata: languageName: node linkType: hard -"@swc/helpers@npm:0.4.14": - version: 0.4.14 - resolution: "@swc/helpers@npm:0.4.14" +"@swc/counter@npm:^0.1.3": + version: 0.1.3 + resolution: "@swc/counter@npm:0.1.3" + checksum: 10/df8f9cfba9904d3d60f511664c70d23bb323b3a0803ec9890f60133954173047ba9bdeabce28cd70ba89ccd3fd6c71c7b0bd58be85f611e1ffbe5d5c18616598 + languageName: node + linkType: hard + +"@swc/helpers@npm:0.5.13": + version: 0.5.13 + resolution: "@swc/helpers@npm:0.5.13" dependencies: tslib: "npm:^2.4.0" - checksum: 10/236afd445fb22e3df7aa84336d5c45d29e021ad01917aa7c24267330df8b39ed89c3d8d9836ac2ac7569b46923591d0e49174f72df7fb997aea841d08f374dbd + checksum: 10/6ba2f7e215d32d71fce139e2cfc426b3ed7eaa709febdeb07b97260a4c9eea4784cf047cc1271be273990b08220b576b94a42b5780947c0b3be84973a847a24d + languageName: node + linkType: hard + +"@swc/types@npm:^0.1.12": + version: 0.1.12 + resolution: "@swc/types@npm:0.1.12" + dependencies: + "@swc/counter": "npm:^0.1.3" + checksum: 10/92dbbc70cd068ea30fb6fbdc1ae8599d6c058a5d09b2923d6e4e24fab5ad7c86a19dd01f349a8e03e300a9321e06911a24df18303b40e307fbd4109372cef2ef languageName: node linkType: hard @@ -6509,7 +6738,7 @@ __metadata: "@tsed/typescript": "workspace:*" eslint: "npm:^8.57.0" tslib: "npm:2.6.1" - typescript: "npm:4.9.5" + typescript: "npm:5.6.2" vitest: "npm:2.0.4" peerDependencies: "@tsed/adapters": 8.0.0-alpha.5 @@ -6543,7 +6772,7 @@ __metadata: lodash: "npm:^4.17.21" lowdb: "npm:1.0.0" tslib: "npm:2.6.1" - typescript: "npm:4.9.5" + typescript: "npm:5.6.2" uuid: "npm:9.0.1" vitest: "npm:2.0.4" peerDependencies: @@ -6581,7 +6810,7 @@ __metadata: agenda: "npm:^5.0.0" eslint: "npm:^8.57.0" tslib: "npm:2.6.1" - typescript: "npm:4.9.5" + typescript: "npm:5.6.2" vitest: "npm:2.0.4" peerDependencies: agenda: ">=4" @@ -6603,7 +6832,7 @@ __metadata: ajv-formats: "npm:2.1.1" eslint: "npm:^8.57.0" tslib: "npm:2.6.1" - typescript: "npm:4.9.5" + typescript: "npm:5.6.2" vitest: "npm:2.0.4" peerDependencies: "@tsed/core": 8.0.0-alpha.5 @@ -6642,7 +6871,7 @@ __metadata: eslint: "npm:^8.57.0" graphql: "npm:16.8.2" tslib: "npm:2.6.1" - typescript: "npm:4.9.5" + typescript: "npm:5.6.2" vitest: "npm:2.0.4" peerDependencies: "@apollo/server": ">=4.10.4" @@ -6678,7 +6907,7 @@ __metadata: eslint: "npm:^8.57.0" ts-mockito: "npm:^2.6.1" tslib: "npm:2.6.1" - typescript: "npm:4.9.5" + typescript: "npm:5.6.2" vitest: "npm:2.0.4" peerDependencies: bullmq: ^4.12.3 || ^5.1.1 @@ -6712,7 +6941,7 @@ __metadata: cross-env: "npm:7.0.3" eslint: "npm:^8.57.0" tslib: "npm:2.6.1" - typescript: "npm:4.9.5" + typescript: "npm:5.6.2" uuid: "npm:9.0.1" vitest: "npm:2.0.4" peerDependencies: @@ -6738,7 +6967,7 @@ __metadata: eslint: "npm:^8.57.0" globby: "npm:11.1.0" tslib: "npm:2.6.1" - typescript: "npm:4.9.5" + typescript: "npm:5.6.2" vitest: "npm:2.0.4" peerDependencies: "@tsed/core": 8.0.0-alpha.5 @@ -6760,7 +6989,7 @@ __metadata: eslint: "npm:^8.57.0" reflect-metadata: "npm:^0.2.1" tslib: "npm:2.6.1" - typescript: "npm:4.9.5" + typescript: "npm:5.6.2" vite: "npm:^5.4.1" vitest: "npm:2.0.4" webpack: "npm:^5.75.0" @@ -6779,7 +7008,7 @@ __metadata: cross-env: "npm:7.0.3" eslint: "npm:^8.57.0" tslib: "npm:2.6.2" - typescript: "npm:4.9.5" + typescript: "npm:5.6.2" uuid: "npm:9.0.1" vitest: "npm:2.0.4" webpack: "npm:^5.75.0" @@ -6854,7 +7083,7 @@ __metadata: tslib: "npm:2.6.1" twig: "npm:^1.15.2" twing: "npm:^5.0.2" - typescript: "npm:4.9.5" + typescript: "npm:5.6.2" underscore: "npm:^1.11.0" vash: "npm:^0.13.0" velocityjs: "npm:^2.0.1" @@ -6876,7 +7105,7 @@ __metadata: eslint: "npm:^8.57.0" eventemitter2: "npm:^6.4.9" tslib: "npm:2.6.1" - typescript: "npm:4.9.5" + typescript: "npm:5.6.2" vitest: "npm:2.0.4" webpack: "npm:^5.75.0" peerDependencies: @@ -6895,7 +7124,7 @@ __metadata: eslint: "npm:^8.57.0" statuses: "npm:>=2.0.1" tslib: "npm:2.6.1" - typescript: "npm:4.9.5" + typescript: "npm:5.6.2" vitest: "npm:2.0.4" peerDependencies: "@tsed/core": 8.0.0-alpha.5 @@ -6910,7 +7139,7 @@ __metadata: "@tsed/typescript": "workspace:*" eslint: "npm:^8.57.0" tslib: "npm:2.6.1" - typescript: "npm:4.9.5" + typescript: "npm:5.6.2" peerDependencies: formiojs: ">=4.0.0" languageName: unknown @@ -6935,7 +7164,7 @@ __metadata: mongodb: "npm:*" mongoose: "npm:^6.12.7" tslib: "npm:2.6.1" - typescript: "npm:4.9.5" + typescript: "npm:5.6.2" vitest: "npm:2.0.4" peerDependencies: "@tsed/common": 8.0.0-alpha.5 @@ -6971,7 +7200,7 @@ __metadata: eslint: "npm:^8.57.0" graphql-ws: "npm:5.16.0" tslib: "npm:2.6.1" - typescript: "npm:4.9.5" + typescript: "npm:5.6.2" peerDependencies: "@tsed/common": 8.0.0-alpha.5 "@tsed/core": 8.0.0-alpha.5 @@ -6995,7 +7224,7 @@ __metadata: "@tsed/schema": "workspace:*" "@tsed/swagger": "workspace:*" "@tsed/typescript": "workspace:*" - typescript: "npm:4.9.5" + typescript: "npm:5.6.2" languageName: unknown linkType: soft @@ -7012,7 +7241,7 @@ __metadata: ioredis: "npm:5.3.2" ioredis-mock: "npm:8.9.0" tslib: "npm:2.6.1" - typescript: "npm:4.9.5" + typescript: "npm:5.6.2" vitest: "npm:2.0.4" peerDependencies: "@tsed/core": 8.0.0-alpha.5 @@ -7032,7 +7261,7 @@ __metadata: "@tsed/typescript": "workspace:*" eslint: "npm:^8.57.0" tslib: "npm:2.6.1" - typescript: "npm:4.9.5" + typescript: "npm:5.6.2" vitest: "npm:2.0.4" webpack: "npm:^5.75.0" peerDependencies: @@ -7056,7 +7285,7 @@ __metadata: fs-extra: "npm:^11.2.0" jose2: "npm:jose@^2.0.4" tslib: "npm:2.6.1" - typescript: "npm:4.9.5" + typescript: "npm:5.6.2" vitest: "npm:2.0.4" languageName: unknown linkType: soft @@ -7116,7 +7345,7 @@ __metadata: eslint: "npm:^8.57.0" ts-mockito: "npm:^2.6.1" tslib: "npm:2.6.1" - typescript: "npm:4.9.5" + typescript: "npm:5.6.2" vitest: "npm:2.0.4" peerDependencies: "@mikro-orm/core": ">=4.5.9" @@ -7144,7 +7373,7 @@ __metadata: eslint: "npm:^8.57.0" mongoose: "npm:6.12.7" tslib: "npm:2.6.1" - typescript: "npm:4.9.5" + typescript: "npm:5.6.2" vitest: "npm:2.0.4" peerDependencies: "@tsed/ajv": 8.0.0-alpha.5 @@ -7200,7 +7429,7 @@ __metadata: eslint: "npm:^8.57.0" normalize-path: "npm:3.0.0" tslib: "npm:2.6.1" - typescript: "npm:4.9.5" + typescript: "npm:5.6.2" vitest: "npm:2.0.4" languageName: unknown linkType: soft @@ -7221,7 +7450,7 @@ __metadata: objection: "npm:^2.2.18" sqlite3: "npm:^5.1.7" tslib: "npm:2.6.1" - typescript: "npm:4.9.5" + typescript: "npm:5.6.2" vitest: "npm:2.0.4" peerDependencies: "@tsed/ajv": 8.0.0-alpha.5 @@ -7262,7 +7491,7 @@ __metadata: "@types/uuid": "npm:9.0.8" eslint: "npm:^8.57.0" psl: "npm:1.9.0" - typescript: "npm:4.9.5" + typescript: "npm:5.6.2" vitest: "npm:2.0.4" wildcard: "npm:2.0.0" peerDependencies: @@ -7306,7 +7535,7 @@ __metadata: lowdb: "npm:3.0.0" oidc-provider: "npm:8.4.5" tslib: "npm:2.6.1" - typescript: "npm:4.9.5" + typescript: "npm:5.6.2" uuid: "npm:9.0.1" vitest: "npm:2.0.4" peerDependencies: @@ -7340,7 +7569,7 @@ __metadata: "@tsed/barrels": "workspace:*" "@tsed/typescript": "workspace:*" eslint: "npm:^8.57.0" - typescript: "npm:4.9.5" + typescript: "npm:5.6.2" languageName: unknown linkType: soft @@ -7364,7 +7593,7 @@ __metadata: passport-local: "npm:1.0.0" passport-strategy: "npm:1.0.0" tslib: "npm:2.6.1" - typescript: "npm:4.9.5" + typescript: "npm:5.6.2" vitest: "npm:2.0.4" peerDependencies: "@tsed/common": 8.0.0-alpha.5 @@ -7384,7 +7613,7 @@ __metadata: chalk: "npm:^4.1.2" eslint: "npm:^8.57.0" tslib: "npm:2.6.1" - typescript: "npm:4.9.5" + typescript: "npm:5.6.2" languageName: unknown linkType: soft @@ -7403,7 +7632,7 @@ __metadata: eslint: "npm:^8.57.0" micromatch: "npm:4.0.8" tslib: "npm:2.6.1" - typescript: "npm:4.9.5" + typescript: "npm:5.6.2" vitest: "npm:2.0.4" peerDependencies: "@tsed/core": 8.0.0-alpha.5 @@ -7434,7 +7663,7 @@ __metadata: "@tsed/typescript": "workspace:*" eslint: "npm:^8.57.0" tslib: "npm:2.6.1" - typescript: "npm:4.9.5" + typescript: "npm:5.6.2" vitest: "npm:2.0.4" peerDependencies: "@tsed/core": 8.0.0-alpha.5 @@ -7482,7 +7711,7 @@ __metadata: method-override: "npm:3.0.0" multer: "npm:^1.4.5-lts.1" tslib: "npm:2.6.1" - typescript: "npm:4.9.5" + typescript: "npm:5.6.2" vitest: "npm:2.0.4" peerDependencies: "@tsed/common": 8.0.0-alpha.5 @@ -7550,7 +7779,7 @@ __metadata: koa-session: "npm:6.4.0" multer: "npm:^1.4.5-lts.1" tslib: "npm:2.6.1" - typescript: "npm:4.9.5" + typescript: "npm:5.6.2" vitest: "npm:2.0.4" peerDependencies: "@tsed/common": 8.0.0-alpha.5 @@ -7598,7 +7827,7 @@ __metadata: "@tsed/typescript": "workspace:*" eslint: "npm:^8.57.0" tslib: "npm:2.6.1" - typescript: "npm:4.9.5" + typescript: "npm:5.6.2" vitest: "npm:2.0.4" peerDependencies: "@tsed/di": 8.0.0-alpha.5 @@ -7625,7 +7854,7 @@ __metadata: "@tsed/typescript": "workspace:*" eslint: "npm:^8.57.0" tslib: "npm:2.6.1" - typescript: "npm:4.9.5" + typescript: "npm:5.6.2" vitest: "npm:2.0.4" peerDependencies: "@tsed/core": 8.0.0-alpha.5 @@ -7654,7 +7883,7 @@ __metadata: "@tsed/typescript": "workspace:*" eslint: "npm:^8.57.0" tslib: "npm:2.6.1" - typescript: "npm:4.9.5" + typescript: "npm:5.6.2" vitest: "npm:2.0.4" peerDependencies: "@tsed/core": 8.0.0-alpha.5 @@ -7689,7 +7918,7 @@ __metadata: "@tsed/typescript": "workspace:*" eslint: "npm:^8.57.0" tslib: "npm:2.6.1" - typescript: "npm:4.9.5" + typescript: "npm:5.6.2" vitest: "npm:2.0.4" peerDependencies: "@tsed/core": 8.0.0-alpha.5 @@ -7725,7 +7954,7 @@ __metadata: "@tsed/typescript": "workspace:*" eslint: "npm:^8.57.0" tslib: "npm:2.6.1" - typescript: "npm:4.9.5" + typescript: "npm:5.6.2" vitest: "npm:2.0.4" peerDependencies: "@tsed/core": 8.0.0-alpha.5 @@ -7764,7 +7993,7 @@ __metadata: eslint: "npm:^8.57.0" serverless-http: "npm:^3.2.0" tslib: "npm:2.6.1" - typescript: "npm:4.9.5" + typescript: "npm:5.6.2" vitest: "npm:2.0.4" peerDependencies: "@tsed/common": 8.0.0-alpha.5 @@ -7806,7 +8035,7 @@ __metadata: "@types/aws-lambda": "npm:^8.10.136" eslint: "npm:^8.57.0" tslib: "npm:2.6.1" - typescript: "npm:4.9.5" + typescript: "npm:5.6.2" peerDependencies: "@tsed/common": 8.0.0-alpha.5 "@tsed/core": 8.0.0-alpha.5 @@ -7839,7 +8068,7 @@ __metadata: find-my-way: "npm:^8.2.0" mime: "npm:^3.0.0" tslib: "npm:2.6.1" - typescript: "npm:4.9.5" + typescript: "npm:5.6.2" uuid: "npm:^9.0.1" vitest: "npm:2.0.4" peerDependencies: @@ -7878,7 +8107,7 @@ __metadata: axios: "npm:1.7.4" eslint: "npm:^8.57.0" read-pkg-up: "npm:7.0.1" - typescript: "npm:4.9.5" + typescript: "npm:5.6.2" languageName: unknown linkType: soft @@ -7897,7 +8126,7 @@ __metadata: ejs: "npm:^3.1.9" eslint: "npm:^8.57.0" tslib: "npm:2.6.1" - typescript: "npm:4.9.5" + typescript: "npm:5.6.2" vitest: "npm:2.0.4" peerDependencies: "@tsed/core": 8.0.0-alpha.5 @@ -7940,7 +8169,7 @@ __metadata: prisma: "npm:^4.16.2" ts-morph: "npm:^12.0.0" tslib: "npm:2.6.1" - typescript: "npm:4.9.5" + typescript: "npm:5.6.2" vitest: "npm:2.0.4" peerDependencies: "@prisma/client": ">=4.0.0" @@ -7966,7 +8195,7 @@ __metadata: "@tsed/typescript": "workspace:*" eslint: "npm:^8.57.0" tslib: "npm:2.6.1" - typescript: "npm:4.9.5" + typescript: "npm:5.6.2" vitest: "npm:2.0.4" peerDependencies: "@pulsecron/pulse": ">=1" @@ -7977,55 +8206,56 @@ __metadata: version: 0.0.0-use.local resolution: "@tsed/root@workspace:." dependencies: - "@commitlint/cli": "npm:^19.2.1" - "@commitlint/config-conventional": "npm:^19.1.0" - "@faker-js/faker": "npm:6.3.1" - "@swc-node/register": "npm:1.6.8" - "@swc/core": "npm:1.3.41" - "@swc/helpers": "npm:0.4.14" + "@commitlint/cli": "npm:19.5.0" + "@commitlint/config-conventional": "npm:19.5.0" + "@faker-js/faker": "npm:9.0.1" + "@swc-node/register": "npm:1.10.9" + "@swc/core": "npm:1.7.26" + "@swc/helpers": "npm:0.5.13" "@tsed/logger": "npm:>=6.7.5" "@tsed/monorepo-utils": "npm:2.3.5" "@tsed/ts-doc": "npm:4.1.0" "@types/axios": "npm:0.14.0" "@types/globby": "npm:9.1.0" - "@types/node": "npm:20.11.30" - "@types/superagent": "npm:4.1.24" + "@types/node": "npm:22.6.1" + "@types/superagent": "npm:8.1.4" "@types/supertest": "npm:6.0.2" - "@typescript-eslint/eslint-plugin": "npm:^5.62.0" - "@typescript-eslint/parser": "npm:^5.62.0" + "@typescript-eslint/eslint-plugin": "npm:8.7.0" + "@typescript-eslint/parser": "npm:8.7.0" ajv: "npm:8.17.1" axios: "npm:1.7.4" change-case: "npm:4.1.2" concurrently: "npm:8.2.2" cross-env: "npm:7.0.3" - eslint: "npm:^8.57.0" - eslint-config-prettier: "npm:8.10.0" - eslint-plugin-prettier: "npm:5.1.3" - eslint-plugin-workspaces: "npm:0.8.0" + eslint: "npm:9.11.1" + eslint-config-prettier: "npm:9.1.0" + eslint-plugin-prettier: "npm:5.2.1" + eslint-plugin-simple-import-sort: "npm:12.1.1" + eslint-plugin-vitest: "npm:0.5.4" + eslint-plugin-workspaces: "npm:0.10.1" fs-extra: "npm:^11.2.0" globby: "npm:11.1.0" html-webpack-plugin: "npm:5.6.0" - husky: "npm:8.0.3" - is-ci: "npm:^3.0.1" + husky: "npm:9.1.6" + is-ci: "npm:3.0.1" lerna: "npm:7.4.2" - lint-staged: "npm:^12.5.0" + lint-staged: "npm:15.2.10" merge-istanbul: "npm:1.1.4" micromatch: "npm:4.0.8" moment: "npm:2.30.1" - prettier: "npm:3.2.5" + prettier: "npm:3.3.3" rimraf: "npm:5.0.5" rxjs: "npm:^7.8.1" - semantic-release: "npm:23.0.5" + semantic-release: "npm:24.1.1" semantic-release-slack-bot: "npm:4.0.2" - supertest: "npm:6.2.2" - ts-loader: "npm:^9.4.2" - tslib: "npm:2.6.1" - typescript: "npm:4.9.5" - unplugin-swc: "npm:^1.5.1" + supertest: "npm:7.0.0" + ts-loader: "npm:9.5.1" + tslib: "npm:2.7.0" + typescript: "npm:5.6.2" + unplugin-swc: "npm:1.5.1" uuid: "npm:9.0.1" - vite: "npm:5.4.1" - vite-plugin-dts: "npm:^4.0.3" - vitest: "npm:2.0.4" + vite: "npm:5.4.7" + vitest: "npm:2.1.1" webpack: "npm:^5.75.0" webpack-cli: "npm:^5.0.1" webpack-dev-server: "npm:^4.11.1" @@ -8046,7 +8276,7 @@ __metadata: change-case: "npm:4.1.2" eslint: "npm:^8.57.0" tslib: "npm:2.6.1" - typescript: "npm:4.9.5" + typescript: "npm:5.6.2" vitest: "npm:2.0.4" peerDependencies: "@tsed/core": 8.0.0-alpha.5 @@ -8092,7 +8322,7 @@ __metadata: picomatch-browser: "npm:^2.2.6" statuses: "npm:>=2.0.1" tslib: "npm:2.6.1" - typescript: "npm:4.9.5" + typescript: "npm:5.6.2" vitest: "npm:2.0.4" webpack: "npm:^5.75.0" peerDependencies: @@ -8117,7 +8347,7 @@ __metadata: eslint: "npm:^8.57.0" socket.io-client: "npm:^4.7.5" tslib: "npm:2.6.1" - typescript: "npm:4.9.5" + typescript: "npm:5.6.2" peerDependencies: "@tsed/common": 8.0.0-alpha.5 "@tsed/core": 8.0.0-alpha.5 @@ -8145,7 +8375,7 @@ __metadata: socket.io: "npm:4.7.5" socket.io-client: "npm:^4.7.5" tslib: "npm:2.6.1" - typescript: "npm:4.9.5" + typescript: "npm:5.6.2" vitest: "npm:2.0.4" peerDependencies: "@tsed/di": 8.0.0-alpha.5 @@ -8183,7 +8413,7 @@ __metadata: eslint: "npm:^8.57.0" express: "npm:^4.19.1" tslib: "npm:2.6.1" - typescript: "npm:4.9.5" + typescript: "npm:5.6.2" vitest: "npm:2.0.4" peerDependencies: "@tsed/di": 8.0.0-alpha.5 @@ -8218,7 +8448,7 @@ __metadata: eslint: "npm:^8.57.0" stripe: "npm:^8.129.0" tslib: "npm:2.6.1" - typescript: "npm:4.9.5" + typescript: "npm:5.6.2" vitest: "npm:2.0.4" peerDependencies: "@tsed/exceptions": 8.0.0-alpha.5 @@ -8263,7 +8493,7 @@ __metadata: swagger-ui-dist: "npm:>=5.17.1" ts-node: "npm:10.9.2" tslib: "npm:2.6.1" - typescript: "npm:4.9.5" + typescript: "npm:5.6.2" vitest: "npm:2.0.4" peerDependencies: "@tsed/common": 8.0.0-alpha.5 @@ -8288,7 +8518,7 @@ __metadata: cross-env: "npm:7.0.3" eslint: "npm:^8.57.0" tslib: "npm:2.6.1" - typescript: "npm:4.9.5" + typescript: "npm:5.6.2" vitest: "npm:2.0.4" peerDependencies: "@temporalio/client": ^1.8.4 @@ -8309,7 +8539,7 @@ __metadata: "@tsed/typescript": "workspace:*" eslint: "npm:^8.57.0" tslib: "npm:2.6.1" - typescript: "npm:4.9.5" + typescript: "npm:5.6.2" vitest: "npm:2.0.4" peerDependencies: "@godaddy/terminus": ^4.7.1 @@ -8344,7 +8574,7 @@ __metadata: semver: "npm:^7.6.0" testcontainers: "npm:>=10.11.0" tslib: "npm:2.6.1" - typescript: "npm:4.9.5" + typescript: "npm:5.6.2" peerDependencies: "@testcontainers/mongodb": ">=10.11.0" "@tsed/common": 8.0.0-alpha.5 @@ -8395,7 +8625,7 @@ __metadata: ts-node: "npm:10.9.2" tslib: "npm:2.6.1" type-graphql: "npm:>=2.0.0-rc.2" - typescript: "npm:4.9.5" + typescript: "npm:5.6.2" vitest: "npm:2.0.4" peerDependencies: "@apollo/datasource-rest": ">=6.2.2" @@ -8424,7 +8654,7 @@ __metadata: "@tsed/typescript": "workspace:*" eslint: "npm:^8.57.0" sirv: "npm:^2.0.4" - typescript: "npm:4.9.5" + typescript: "npm:5.6.2" vike: "npm:0.4.160" vite: "npm:5.4.1" vitest: "npm:2.0.4" @@ -8488,6 +8718,15 @@ __metadata: languageName: node linkType: hard +"@tybys/wasm-util@npm:^0.9.0": + version: 0.9.0 + resolution: "@tybys/wasm-util@npm:0.9.0" + dependencies: + tslib: "npm:^2.4.0" + checksum: 10/aa58e64753a420ad1eefaf7bacef3dda61d74f9336925943d9244132d5b48d9242f734f1e707fd5ccfa6dd1d8ec8e6debc234b4dedb3a5b0d8486d1f373350b2 + languageName: node + linkType: hard + "@types/accepts@npm:*": version: 1.3.5 resolution: "@types/accepts@npm:1.3.5" @@ -8497,13 +8736,6 @@ __metadata: languageName: node linkType: hard -"@types/argparse@npm:1.0.38": - version: 1.0.38 - resolution: "@types/argparse@npm:1.0.38" - checksum: 10/26ed7e3f1e3595efdb883a852f5205f971b798e4c28b7e30a32c5298eee596e8b45834ce831f014d250b9730819ab05acff5b31229666d3af4ba465b4697d0eb - languageName: node - linkType: hard - "@types/async@npm:3.2.24": version: 3.2.24 resolution: "@types/async@npm:3.2.24" @@ -8632,13 +8864,6 @@ __metadata: languageName: node linkType: hard -"@types/cookiejar@npm:*": - version: 2.1.2 - resolution: "@types/cookiejar@npm:2.1.2" - checksum: 10/f6e1903454007f86edd6c3520cbb4d553e1d4e17eaf1f77f6f75e3270f48cc828d74397a113a36942f5fe52f9fa71067bcfa738f53ad468fcca0bc52cb1cbd28 - languageName: node - linkType: hard - "@types/cookiejar@npm:^2.1.5": version: 2.1.5 resolution: "@types/cookiejar@npm:2.1.5" @@ -8752,6 +8977,13 @@ __metadata: languageName: node linkType: hard +"@types/estree@npm:^1.0.6": + version: 1.0.6 + resolution: "@types/estree@npm:1.0.6" + checksum: 10/9d35d475095199c23e05b431bcdd1f6fec7380612aed068b14b2a08aa70494de8a9026765a5a91b1073f636fb0368f6d8973f518a31391d519e20c59388ed88d + languageName: node + linkType: hard + "@types/express-serve-static-core@npm:*, @types/express-serve-static-core@npm:^4.17.31": version: 4.17.31 resolution: "@types/express-serve-static-core@npm:4.17.31" @@ -8919,7 +9151,7 @@ __metadata: languageName: node linkType: hard -"@types/json-schema@npm:7.0.15": +"@types/json-schema@npm:7.0.15, @types/json-schema@npm:^7.0.15": version: 7.0.15 resolution: "@types/json-schema@npm:7.0.15" checksum: 10/1a3c3e06236e4c4aab89499c428d585527ce50c24fe8259e8b3926d3df4cfbbbcf306cfc73ddfb66cbafc973116efd15967020b0f738f63e09e64c7d260519e7 @@ -9191,12 +9423,12 @@ __metadata: languageName: node linkType: hard -"@types/node@npm:20.11.30": - version: 20.11.30 - resolution: "@types/node@npm:20.11.30" +"@types/node@npm:22.6.1": + version: 22.6.1 + resolution: "@types/node@npm:22.6.1" dependencies: - undici-types: "npm:~5.26.4" - checksum: 10/78515bc768d2b878e2e06a1c20eb4f5840072b79b8d28ff3dd0a7feaaf48fd3a2ac03cfa5bc7564da82db5906b43e9ba0e5df9f43d870b7aae2942306e208815 + undici-types: "npm:~6.19.2" + checksum: 10/98852ff9d4b1e9180d82010d5a639ddb3676741b1dee361ec52f59f3526634127f76d6a030db0ff7c5f2ac88b330f745cacce898d309b9262972860e9dba2c1b languageName: node linkType: hard @@ -9362,7 +9594,7 @@ __metadata: languageName: node linkType: hard -"@types/semver@npm:^7.3.12, @types/semver@npm:^7.5.6, @types/semver@npm:^7.5.8": +"@types/semver@npm:^7.5.5, @types/semver@npm:^7.5.6, @types/semver@npm:^7.5.8": version: 7.5.8 resolution: "@types/semver@npm:7.5.8" checksum: 10/3496808818ddb36deabfe4974fd343a78101fa242c4690044ccdc3b95dcf8785b494f5d628f2f47f38a702f8db9c53c67f47d7818f2be1b79f2efb09692e1178 @@ -9452,13 +9684,14 @@ __metadata: languageName: node linkType: hard -"@types/superagent@npm:4.1.24": - version: 4.1.24 - resolution: "@types/superagent@npm:4.1.24" +"@types/superagent@npm:8.1.4": + version: 8.1.4 + resolution: "@types/superagent@npm:8.1.4" dependencies: - "@types/cookiejar": "npm:*" + "@types/cookiejar": "npm:^2.1.5" + "@types/methods": "npm:^1.1.4" "@types/node": "npm:*" - checksum: 10/358d4ba534b8e26ad8547b984be48e38cf31d3c53f356803e6e67e7d29b35a8a045142b25b16a7c05750c47103969b1e68c88431659ef7d43c75a5906a9cf2a9 + checksum: 10/06ec4510ca396b73f8271a14c62bbbe8aef80991531bcc4eb1ef7de3e6ac88e677050fbf7da16d8838f9e57d55a20d9a308824adf99b4382849eaae47f0e7035 languageName: node linkType: hard @@ -9555,78 +9788,79 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/eslint-plugin@npm:^5.62.0": - version: 5.62.0 - resolution: "@typescript-eslint/eslint-plugin@npm:5.62.0" +"@typescript-eslint/eslint-plugin@npm:8.7.0": + version: 8.7.0 + resolution: "@typescript-eslint/eslint-plugin@npm:8.7.0" dependencies: - "@eslint-community/regexpp": "npm:^4.4.0" - "@typescript-eslint/scope-manager": "npm:5.62.0" - "@typescript-eslint/type-utils": "npm:5.62.0" - "@typescript-eslint/utils": "npm:5.62.0" - debug: "npm:^4.3.4" + "@eslint-community/regexpp": "npm:^4.10.0" + "@typescript-eslint/scope-manager": "npm:8.7.0" + "@typescript-eslint/type-utils": "npm:8.7.0" + "@typescript-eslint/utils": "npm:8.7.0" + "@typescript-eslint/visitor-keys": "npm:8.7.0" graphemer: "npm:^1.4.0" - ignore: "npm:^5.2.0" - natural-compare-lite: "npm:^1.4.0" - semver: "npm:^7.3.7" - tsutils: "npm:^3.21.0" + ignore: "npm:^5.3.1" + natural-compare: "npm:^1.4.0" + ts-api-utils: "npm:^1.3.0" peerDependencies: - "@typescript-eslint/parser": ^5.0.0 - eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 + "@typescript-eslint/parser": ^8.0.0 || ^8.0.0-alpha.0 + eslint: ^8.57.0 || ^9.0.0 peerDependenciesMeta: typescript: optional: true - checksum: 10/9cc8319c6fd8a21938f5b69476974a7e778c283a55ef9fad183c850995b9adcb0087d57cea7b2ac6b9449570eee983aad39491d14cdd2e52d6b4b0485e7b2482 + checksum: 10/5bc774b1da4e1cd19c5ffd731c655c53035fd81ff06a95c2f2c54ab62c401879f886da3e1a1235505341e8172b2841c6edc78b4565a261105ab32d83bf5b8ab1 languageName: node linkType: hard -"@typescript-eslint/parser@npm:^5.62.0": - version: 5.62.0 - resolution: "@typescript-eslint/parser@npm:5.62.0" +"@typescript-eslint/parser@npm:8.7.0": + version: 8.7.0 + resolution: "@typescript-eslint/parser@npm:8.7.0" dependencies: - "@typescript-eslint/scope-manager": "npm:5.62.0" - "@typescript-eslint/types": "npm:5.62.0" - "@typescript-eslint/typescript-estree": "npm:5.62.0" + "@typescript-eslint/scope-manager": "npm:8.7.0" + "@typescript-eslint/types": "npm:8.7.0" + "@typescript-eslint/typescript-estree": "npm:8.7.0" + "@typescript-eslint/visitor-keys": "npm:8.7.0" debug: "npm:^4.3.4" peerDependencies: - eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 + eslint: ^8.57.0 || ^9.0.0 peerDependenciesMeta: typescript: optional: true - checksum: 10/b6ca629d8f4e6283ff124501731cc886703eb4ce2c7d38b3e4110322ea21452b9d9392faf25be6bd72f54b89de7ffc72a40d9b159083ac54345a3d04b4fa5394 + checksum: 10/896ac60f8426f9e5c23198c89555f6f88f7957c5b16bb7b966dac45c5f5e7076c1a050bcee2e0eddff88055b9c0d7bdfaef9c64889e3bdf3356d20356b0daa04 languageName: node linkType: hard -"@typescript-eslint/scope-manager@npm:5.62.0": - version: 5.62.0 - resolution: "@typescript-eslint/scope-manager@npm:5.62.0" +"@typescript-eslint/scope-manager@npm:7.18.0": + version: 7.18.0 + resolution: "@typescript-eslint/scope-manager@npm:7.18.0" dependencies: - "@typescript-eslint/types": "npm:5.62.0" - "@typescript-eslint/visitor-keys": "npm:5.62.0" - checksum: 10/e827770baa202223bc0387e2fd24f630690809e460435b7dc9af336c77322290a770d62bd5284260fa881c86074d6a9fd6c97b07382520b115f6786b8ed499da + "@typescript-eslint/types": "npm:7.18.0" + "@typescript-eslint/visitor-keys": "npm:7.18.0" + checksum: 10/9eb2ae5d69d9f723e706c16b2b97744fc016996a5473bed596035ac4d12429b3d24e7340a8235d704efa57f8f52e1b3b37925ff7c2e3384859d28b23a99b8bcc languageName: node linkType: hard -"@typescript-eslint/type-utils@npm:5.62.0": - version: 5.62.0 - resolution: "@typescript-eslint/type-utils@npm:5.62.0" +"@typescript-eslint/scope-manager@npm:8.7.0": + version: 8.7.0 + resolution: "@typescript-eslint/scope-manager@npm:8.7.0" dependencies: - "@typescript-eslint/typescript-estree": "npm:5.62.0" - "@typescript-eslint/utils": "npm:5.62.0" + "@typescript-eslint/types": "npm:8.7.0" + "@typescript-eslint/visitor-keys": "npm:8.7.0" + checksum: 10/6a6aae28437f6cd78f82dd1359658593fcc8f6d0da966b4d128b14db3a307b6094d22515a79c222055a31bf9b73b73799acf18fbf48c0da16e8f408fcc10464c + languageName: node + linkType: hard + +"@typescript-eslint/type-utils@npm:8.7.0": + version: 8.7.0 + resolution: "@typescript-eslint/type-utils@npm:8.7.0" + dependencies: + "@typescript-eslint/typescript-estree": "npm:8.7.0" + "@typescript-eslint/utils": "npm:8.7.0" debug: "npm:^4.3.4" - tsutils: "npm:^3.21.0" - peerDependencies: - eslint: "*" + ts-api-utils: "npm:^1.3.0" peerDependenciesMeta: typescript: optional: true - checksum: 10/f9a4398d6d2aae09e3e765eff04cf4ab364376a87868031ac5c6a64c9bbb555cb1a7f99b07b3d1017e7422725b5f0bbee537f13b82ab2d930f161c987b3dece0 - languageName: node - linkType: hard - -"@typescript-eslint/types@npm:5.62.0": - version: 5.62.0 - resolution: "@typescript-eslint/types@npm:5.62.0" - checksum: 10/24e8443177be84823242d6729d56af2c4b47bfc664dd411a1d730506abf2150d6c31bdefbbc6d97c8f91043e3a50e0c698239dcb145b79bb6b0c34469aaf6c45 + checksum: 10/dba4520dd3dce35b765640f9633100bd29d2092478cb467e89bde51dc23fb19f7395e87f4486b898315aab081263003cbc78f03f0f40079602713aafc2f2a6a5 languageName: node linkType: hard @@ -9637,21 +9871,55 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/typescript-estree@npm:5.62.0": - version: 5.62.0 - resolution: "@typescript-eslint/typescript-estree@npm:5.62.0" +"@typescript-eslint/types@npm:7.18.0": + version: 7.18.0 + resolution: "@typescript-eslint/types@npm:7.18.0" + checksum: 10/0e30c73a3cc3c67dd06360a5a12fd12cee831e4092750eec3d6c031bdc4feafcb0ab1d882910a73e66b451a4f6e1dd015e9e2c4d45bf6bf716a474e5d123ddf0 + languageName: node + linkType: hard + +"@typescript-eslint/types@npm:8.7.0": + version: 8.7.0 + resolution: "@typescript-eslint/types@npm:8.7.0" + checksum: 10/9adbe4efdcb00735af5144a161d6bb2f79a952a9701820920ad33adba02032d65d5b601087e953c2918f7efa548abbcd9289f83ec6299f66941d7c585886792e + languageName: node + linkType: hard + +"@typescript-eslint/typescript-estree@npm:7.18.0": + version: 7.18.0 + resolution: "@typescript-eslint/typescript-estree@npm:7.18.0" dependencies: - "@typescript-eslint/types": "npm:5.62.0" - "@typescript-eslint/visitor-keys": "npm:5.62.0" + "@typescript-eslint/types": "npm:7.18.0" + "@typescript-eslint/visitor-keys": "npm:7.18.0" debug: "npm:^4.3.4" globby: "npm:^11.1.0" is-glob: "npm:^4.0.3" - semver: "npm:^7.3.7" - tsutils: "npm:^3.21.0" + minimatch: "npm:^9.0.4" + semver: "npm:^7.6.0" + ts-api-utils: "npm:^1.3.0" + peerDependenciesMeta: + typescript: + optional: true + checksum: 10/b01e66235a91aa4439d02081d4a5f8b4a7cf9cb24f26b334812f657e3c603493e5f41e5c1e89cf4efae7d64509fa1f73affc16afc5e15cb7f83f724577c82036 + languageName: node + linkType: hard + +"@typescript-eslint/typescript-estree@npm:8.7.0": + version: 8.7.0 + resolution: "@typescript-eslint/typescript-estree@npm:8.7.0" + dependencies: + "@typescript-eslint/types": "npm:8.7.0" + "@typescript-eslint/visitor-keys": "npm:8.7.0" + debug: "npm:^4.3.4" + fast-glob: "npm:^3.3.2" + is-glob: "npm:^4.0.3" + minimatch: "npm:^9.0.4" + semver: "npm:^7.6.0" + ts-api-utils: "npm:^1.3.0" peerDependenciesMeta: typescript: optional: true - checksum: 10/06c975eb5f44b43bd19fadc2e1023c50cf87038fe4c0dd989d4331c67b3ff509b17fa60a3251896668ab4d7322bdc56162a9926971218d2e1a1874d2bef9a52e + checksum: 10/c4f7e3c18c8382b72800681c37c87726b02a96cf6831be37d2d2f9c26267016a9dd7af4e08184b96376a9aebdc5c344c6c378c86821c374fe10a9e45aca1b33d languageName: node linkType: hard @@ -9674,31 +9942,31 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/utils@npm:5.62.0": - version: 5.62.0 - resolution: "@typescript-eslint/utils@npm:5.62.0" +"@typescript-eslint/utils@npm:8.7.0": + version: 8.7.0 + resolution: "@typescript-eslint/utils@npm:8.7.0" dependencies: - "@eslint-community/eslint-utils": "npm:^4.2.0" - "@types/json-schema": "npm:^7.0.9" - "@types/semver": "npm:^7.3.12" - "@typescript-eslint/scope-manager": "npm:5.62.0" - "@typescript-eslint/types": "npm:5.62.0" - "@typescript-eslint/typescript-estree": "npm:5.62.0" - eslint-scope: "npm:^5.1.1" - semver: "npm:^7.3.7" + "@eslint-community/eslint-utils": "npm:^4.4.0" + "@typescript-eslint/scope-manager": "npm:8.7.0" + "@typescript-eslint/types": "npm:8.7.0" + "@typescript-eslint/typescript-estree": "npm:8.7.0" peerDependencies: - eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 - checksum: 10/15ef13e43998a082b15f85db979f8d3ceb1f9ce4467b8016c267b1738d5e7cdb12aa90faf4b4e6dd6486c236cf9d33c463200465cf25ff997dbc0f12358550a1 + eslint: ^8.57.0 || ^9.0.0 + checksum: 10/81674503fb5ea32ff5de8f1a29fecbcfa947025e7609e861ac8e32cd13326fc050c4fa5044e1a877f05e7e1264c42b9c72a7fd09c4a41d0ac2cf1c49259abf03 languageName: node linkType: hard -"@typescript-eslint/visitor-keys@npm:5.62.0": - version: 5.62.0 - resolution: "@typescript-eslint/visitor-keys@npm:5.62.0" +"@typescript-eslint/utils@npm:^7.7.1": + version: 7.18.0 + resolution: "@typescript-eslint/utils@npm:7.18.0" dependencies: - "@typescript-eslint/types": "npm:5.62.0" - eslint-visitor-keys: "npm:^3.3.0" - checksum: 10/dc613ab7569df9bbe0b2ca677635eb91839dfb2ca2c6fa47870a5da4f160db0b436f7ec0764362e756d4164e9445d49d5eb1ff0b87f4c058946ae9d8c92eb388 + "@eslint-community/eslint-utils": "npm:^4.4.0" + "@typescript-eslint/scope-manager": "npm:7.18.0" + "@typescript-eslint/types": "npm:7.18.0" + "@typescript-eslint/typescript-estree": "npm:7.18.0" + peerDependencies: + eslint: ^8.56.0 + checksum: 10/f43fedb4f4d2e3836bdf137889449063a55c0ece74fdb283929cd376197b992313be8ef4df920c1c801b5c3076b92964c84c6c3b9b749d263b648d0011f5926e languageName: node linkType: hard @@ -9712,6 +9980,26 @@ __metadata: languageName: node linkType: hard +"@typescript-eslint/visitor-keys@npm:7.18.0": + version: 7.18.0 + resolution: "@typescript-eslint/visitor-keys@npm:7.18.0" + dependencies: + "@typescript-eslint/types": "npm:7.18.0" + eslint-visitor-keys: "npm:^3.4.3" + checksum: 10/b7cfe6fdeae86c507357ac6b2357813c64fb2fbf1aaf844393ba82f73a16e2599b41981b34200d9fc7765d70bc3a8181d76b503051e53f04bcb7c9afef637eab + languageName: node + linkType: hard + +"@typescript-eslint/visitor-keys@npm:8.7.0": + version: 8.7.0 + resolution: "@typescript-eslint/visitor-keys@npm:8.7.0" + dependencies: + "@typescript-eslint/types": "npm:8.7.0" + eslint-visitor-keys: "npm:^3.4.3" + checksum: 10/189ea297ff4da53aea92f31de57aed164550c51ac7cf663007c997c4f0f75a82097e35568e3a0fbcced290cb4c12ab7d3afd99e93eb37c930d7f6d6bbfd6ed98 + languageName: node + linkType: hard + "@ungap/structured-clone@npm:^1.2.0": version: 1.2.0 resolution: "@ungap/structured-clone@npm:1.2.0" @@ -9775,6 +10063,38 @@ __metadata: languageName: node linkType: hard +"@vitest/expect@npm:2.1.1": + version: 2.1.1 + resolution: "@vitest/expect@npm:2.1.1" + dependencies: + "@vitest/spy": "npm:2.1.1" + "@vitest/utils": "npm:2.1.1" + chai: "npm:^5.1.1" + tinyrainbow: "npm:^1.2.0" + checksum: 10/ece8d7f9e0c083c5cf30c0df9e052bba4402649736293a18e56a8db4be46a847b18dc7b33cdd1c08bea51bf6f2cb021e40e7227d9cfc24fdba4a955bffe371a2 + languageName: node + linkType: hard + +"@vitest/mocker@npm:2.1.1": + version: 2.1.1 + resolution: "@vitest/mocker@npm:2.1.1" + dependencies: + "@vitest/spy": "npm:^2.1.0-beta.1" + estree-walker: "npm:^3.0.3" + magic-string: "npm:^0.30.11" + peerDependencies: + "@vitest/spy": 2.1.1 + msw: ^2.3.5 + vite: ^5.0.0 + peerDependenciesMeta: + msw: + optional: true + vite: + optional: true + checksum: 10/4fbdaac36e3f603235b131e25d9e561381bd989a34e49522e16652077021532ae6653907b47bbca93c14ae4629e3e6a8f61438e3812620dc5654b61595b45208 + languageName: node + linkType: hard + "@vitest/pretty-format@npm:2.0.4": version: 2.0.4 resolution: "@vitest/pretty-format@npm:2.0.4" @@ -9793,6 +10113,15 @@ __metadata: languageName: node linkType: hard +"@vitest/pretty-format@npm:2.1.1, @vitest/pretty-format@npm:^2.1.1": + version: 2.1.1 + resolution: "@vitest/pretty-format@npm:2.1.1" + dependencies: + tinyrainbow: "npm:^1.2.0" + checksum: 10/744278a3a91d080e51a94b03eaf7cf43779978d6391060cbfdda6d03194eef744ce8f12a2fe2fa90a9bf9b9f038d4c4c4d88f6192f042c88c5ee4125f38bf892 + languageName: node + linkType: hard + "@vitest/runner@npm:2.0.4": version: 2.0.4 resolution: "@vitest/runner@npm:2.0.4" @@ -9813,6 +10142,16 @@ __metadata: languageName: node linkType: hard +"@vitest/runner@npm:2.1.1": + version: 2.1.1 + resolution: "@vitest/runner@npm:2.1.1" + dependencies: + "@vitest/utils": "npm:2.1.1" + pathe: "npm:^1.1.2" + checksum: 10/cf13a2f0bebb494484e60614ff0e7cab06f4310b36c96fe311035ab2eec9cbc057fa5702e904d43e8976fb2214fe550286ceb0b3dc1c72081e23eb1b1f8fa193 + languageName: node + linkType: hard + "@vitest/snapshot@npm:2.0.4": version: 2.0.4 resolution: "@vitest/snapshot@npm:2.0.4" @@ -9835,133 +10174,76 @@ __metadata: languageName: node linkType: hard -"@vitest/spy@npm:2.0.4": - version: 2.0.4 - resolution: "@vitest/spy@npm:2.0.4" - dependencies: - tinyspy: "npm:^3.0.0" - checksum: 10/c18d0fc28e40a40f701a116a117d98916ec90f18e1643a37379b18f5fbee841e7c35fcb65202503506b471df761e0907053912d475e159399b887c1be6f91ef1 - languageName: node - linkType: hard - -"@vitest/spy@npm:2.0.5": - version: 2.0.5 - resolution: "@vitest/spy@npm:2.0.5" +"@vitest/snapshot@npm:2.1.1": + version: 2.1.1 + resolution: "@vitest/snapshot@npm:2.1.1" dependencies: - tinyspy: "npm:^3.0.0" - checksum: 10/ed19f4c3bb4d3853241e8070979615138e24403ce4c137fa48c903b3af2c8b3ada2cc26aca9c1aa323bb314a457a8130a29acbb18dafd4e42737deefb2abf1ca + "@vitest/pretty-format": "npm:2.1.1" + magic-string: "npm:^0.30.11" + pathe: "npm:^1.1.2" + checksum: 10/820f429d950cf63316464e7f2bc1f0ba4b7d2691c51f6ad03ba1c6edc7dbdc6a86b017c082f2a519b743ae53880b41366bbb596c8b43cf8cd68032f9433ec844 languageName: node linkType: hard -"@vitest/utils@npm:2.0.4": +"@vitest/spy@npm:2.0.4": version: 2.0.4 - resolution: "@vitest/utils@npm:2.0.4" - dependencies: - "@vitest/pretty-format": "npm:2.0.4" - estree-walker: "npm:^3.0.3" - loupe: "npm:^3.1.1" - tinyrainbow: "npm:^1.2.0" - checksum: 10/a17497cd3c12b72b315bda6a6a4addcbc206367f6bcdedb83d5d708ac40cf52fcc48403539d10528e1893348b2f107416e9065b6b5c39329f2512eea8f104578 - languageName: node - linkType: hard - -"@vitest/utils@npm:2.0.5": - version: 2.0.5 - resolution: "@vitest/utils@npm:2.0.5" - dependencies: - "@vitest/pretty-format": "npm:2.0.5" - estree-walker: "npm:^3.0.3" - loupe: "npm:^3.1.1" - tinyrainbow: "npm:^1.2.0" - checksum: 10/d631d56d29c33bc8de631166b2b6691c470187a345469dfef7048befe6027e1c6ff9552f2ee11c8a247522c325c4a64bfcc73f8f0f0c525da39cb9f190f119f8 - languageName: node - linkType: hard - -"@volar/language-core@npm:2.4.0, @volar/language-core@npm:~2.4.0-alpha.18": - version: 2.4.0 - resolution: "@volar/language-core@npm:2.4.0" - dependencies: - "@volar/source-map": "npm:2.4.0" - checksum: 10/7ee8f7c611e84870536b2a7e0f2fcb5b1667f862abfe91158bb70fe3c5c9600db23f25df0b68239ff5cd9ff33eae87fa30abe000d1a56aaafb8b74da826b2b83 - languageName: node - linkType: hard - -"@volar/source-map@npm:2.4.0": - version: 2.4.0 - resolution: "@volar/source-map@npm:2.4.0" - checksum: 10/a95bed355b193c4db7420d305c4a9e86c83a0feb46486d00e3b0c7ae92b3ea8800ea997dfa05c9df32cfeca81c104ca2383bd63efcd5990ecf811fa796208fed - languageName: node - linkType: hard - -"@volar/typescript@npm:^2.3.4, @volar/typescript@npm:~2.4.0-alpha.18": - version: 2.4.0 - resolution: "@volar/typescript@npm:2.4.0" + resolution: "@vitest/spy@npm:2.0.4" dependencies: - "@volar/language-core": "npm:2.4.0" - path-browserify: "npm:^1.0.1" - vscode-uri: "npm:^3.0.8" - checksum: 10/836f143391343f5dad34cc000c6538b2af622ca5f53e41f3d3dfb86919926c6fa7d6e562ca89d331e13ebe066c118cb4ec953756b4e3a822cc095fd15c22ddba + tinyspy: "npm:^3.0.0" + checksum: 10/c18d0fc28e40a40f701a116a117d98916ec90f18e1643a37379b18f5fbee841e7c35fcb65202503506b471df761e0907053912d475e159399b887c1be6f91ef1 languageName: node linkType: hard -"@vue/compiler-core@npm:3.4.38": - version: 3.4.38 - resolution: "@vue/compiler-core@npm:3.4.38" +"@vitest/spy@npm:2.0.5": + version: 2.0.5 + resolution: "@vitest/spy@npm:2.0.5" dependencies: - "@babel/parser": "npm:^7.24.7" - "@vue/shared": "npm:3.4.38" - entities: "npm:^4.5.0" - estree-walker: "npm:^2.0.2" - source-map-js: "npm:^1.2.0" - checksum: 10/16449e9083c290e6c13e1cc0cb0a0a457817a52533d10902388c872fb1337ba0fa29fb7b8394df5a10f5ed3bad264d6c386f9eaf47c07982a543f277dbee9b8a + tinyspy: "npm:^3.0.0" + checksum: 10/ed19f4c3bb4d3853241e8070979615138e24403ce4c137fa48c903b3af2c8b3ada2cc26aca9c1aa323bb314a457a8130a29acbb18dafd4e42737deefb2abf1ca languageName: node linkType: hard -"@vue/compiler-dom@npm:^3.4.0": - version: 3.4.38 - resolution: "@vue/compiler-dom@npm:3.4.38" +"@vitest/spy@npm:2.1.1, @vitest/spy@npm:^2.1.0-beta.1": + version: 2.1.1 + resolution: "@vitest/spy@npm:2.1.1" dependencies: - "@vue/compiler-core": "npm:3.4.38" - "@vue/shared": "npm:3.4.38" - checksum: 10/4012fab212dc0628ef72f5ae13aa2dd551efb8be7f2aa8abe2a1db15058ddda29912a1e3aa1fc6712e2d8efe84724f16a907ad2cda987631bfc79330afc8d451 + tinyspy: "npm:^3.0.0" + checksum: 10/47e83b4a3d091c4fdc2fbf861ccf2df697d3446a6c69d384b168f9c3e0fa1cabec03e52cc8bec1909735969176ac6272cc4dee8dda945ff059183a5c4568a488 languageName: node linkType: hard -"@vue/compiler-vue2@npm:^2.7.16": - version: 2.7.16 - resolution: "@vue/compiler-vue2@npm:2.7.16" +"@vitest/utils@npm:2.0.4": + version: 2.0.4 + resolution: "@vitest/utils@npm:2.0.4" dependencies: - de-indent: "npm:^1.0.2" - he: "npm:^1.2.0" - checksum: 10/739ad06be19206b2715707c226a070509bcf28c31b539a6fc932d220eb7b0c09109d71fded573ed0c4073429793a3513ca4a4e69ad4f7afc0c5bc3c28639e871 + "@vitest/pretty-format": "npm:2.0.4" + estree-walker: "npm:^3.0.3" + loupe: "npm:^3.1.1" + tinyrainbow: "npm:^1.2.0" + checksum: 10/a17497cd3c12b72b315bda6a6a4addcbc206367f6bcdedb83d5d708ac40cf52fcc48403539d10528e1893348b2f107416e9065b6b5c39329f2512eea8f104578 languageName: node linkType: hard -"@vue/language-core@npm:2.0.29": - version: 2.0.29 - resolution: "@vue/language-core@npm:2.0.29" +"@vitest/utils@npm:2.0.5": + version: 2.0.5 + resolution: "@vitest/utils@npm:2.0.5" dependencies: - "@volar/language-core": "npm:~2.4.0-alpha.18" - "@vue/compiler-dom": "npm:^3.4.0" - "@vue/compiler-vue2": "npm:^2.7.16" - "@vue/shared": "npm:^3.4.0" - computeds: "npm:^0.0.1" - minimatch: "npm:^9.0.3" - muggle-string: "npm:^0.4.1" - path-browserify: "npm:^1.0.1" - peerDependencies: - typescript: "*" - peerDependenciesMeta: - typescript: - optional: true - checksum: 10/60859b53f8df2f8da336c126750c4f96ffa1c3da050181dc1e8bb80b40d482fa43194e7f2d255e31f2ebd842e11b57f89789b57a8bd9cc79f3b584eb2e0fe251 + "@vitest/pretty-format": "npm:2.0.5" + estree-walker: "npm:^3.0.3" + loupe: "npm:^3.1.1" + tinyrainbow: "npm:^1.2.0" + checksum: 10/d631d56d29c33bc8de631166b2b6691c470187a345469dfef7048befe6027e1c6ff9552f2ee11c8a247522c325c4a64bfcc73f8f0f0c525da39cb9f190f119f8 languageName: node linkType: hard -"@vue/shared@npm:3.4.38, @vue/shared@npm:^3.4.0": - version: 3.4.38 - resolution: "@vue/shared@npm:3.4.38" - checksum: 10/46bfc1f3932fd154ff84dcd267cae4db730c98db433c848d40c9c0dc23dcabdb5efe96a3a378c9ed3b7e8281ca17e2753f0ce98ae43b54b315550dfaccb56868 +"@vitest/utils@npm:2.1.1": + version: 2.1.1 + resolution: "@vitest/utils@npm:2.1.1" + dependencies: + "@vitest/pretty-format": "npm:2.1.1" + loupe: "npm:^3.1.1" + tinyrainbow: "npm:^1.2.0" + checksum: 10/605f1807c343ac01cde053b062bda8f0cc51b321a3cd9c751424a1e24549a35120896bd58612a14f068460242013f69e08fc0a69355387e981a5a50bce9ae04e languageName: node linkType: hard @@ -10318,7 +10600,7 @@ __metadata: languageName: node linkType: hard -"acorn@npm:^8.11.3, acorn@npm:^8.12.1": +"acorn@npm:^8.11.3, acorn@npm:^8.12.0, acorn@npm:^8.12.1": version: 8.12.1 resolution: "acorn@npm:8.12.1" bin: @@ -10413,7 +10695,7 @@ __metadata: languageName: node linkType: hard -"ajv-draft-04@npm:^1.0.0, ajv-draft-04@npm:~1.0.0": +"ajv-draft-04@npm:^1.0.0": version: 1.0.0 resolution: "ajv-draft-04@npm:1.0.0" peerDependencies: @@ -10448,20 +10730,6 @@ __metadata: languageName: node linkType: hard -"ajv-formats@npm:~3.0.1": - version: 3.0.1 - resolution: "ajv-formats@npm:3.0.1" - dependencies: - ajv: "npm:^8.0.0" - peerDependencies: - ajv: ^8.0.0 - peerDependenciesMeta: - ajv: - optional: true - checksum: 10/5679b9f9ced9d0213a202a37f3aa91efcffe59a6de1a6e3da5c873344d3c161820a1f11cc29899661fee36271fd2895dd3851b6461c902a752ad661d1c1e8722 - languageName: node - linkType: hard - "ajv-keywords@npm:^3.5.2": version: 3.5.2 resolution: "ajv-keywords@npm:3.5.2" @@ -10482,7 +10750,7 @@ __metadata: languageName: node linkType: hard -"ajv@npm:8.17.1, ajv@npm:^8.17.1": +"ajv@npm:8.17.1, ajv@npm:^8.0.0, ajv@npm:^8.11.0, ajv@npm:^8.17.1, ajv@npm:^8.6.3, ajv@npm:^8.8.0": version: 8.17.1 resolution: "ajv@npm:8.17.1" dependencies: @@ -10506,30 +10774,6 @@ __metadata: languageName: node linkType: hard -"ajv@npm:^8.0.0, ajv@npm:^8.11.0, ajv@npm:^8.6.3, ajv@npm:^8.8.0, ajv@npm:~8.12.0": - version: 8.12.0 - resolution: "ajv@npm:8.12.0" - dependencies: - fast-deep-equal: "npm:^3.1.1" - json-schema-traverse: "npm:^1.0.0" - require-from-string: "npm:^2.0.2" - uri-js: "npm:^4.2.2" - checksum: 10/b406f3b79b5756ac53bfe2c20852471b08e122bc1ee4cde08ae4d6a800574d9cd78d60c81c69c63ff81e4da7cd0b638fafbb2303ae580d49cf1600b9059efb85 - languageName: node - linkType: hard - -"ajv@npm:~8.13.0": - version: 8.13.0 - resolution: "ajv@npm:8.13.0" - dependencies: - fast-deep-equal: "npm:^3.1.3" - json-schema-traverse: "npm:^1.0.0" - require-from-string: "npm:^2.0.2" - uri-js: "npm:^4.4.1" - checksum: 10/4ada268c9a6e44be87fd295df0f0a91267a7bae8dbc8a67a2d5799c3cb459232839c99d18b035597bb6e3ffe88af6979f7daece854f590a81ebbbc2dfa80002c - languageName: node - linkType: hard - "align-text@npm:^0.1.1, align-text@npm:^0.1.3": version: 0.1.4 resolution: "align-text@npm:0.1.4" @@ -10569,7 +10813,7 @@ __metadata: languageName: node linkType: hard -"ansi-escapes@npm:^4.2.1, ansi-escapes@npm:^4.3.0, ansi-escapes@npm:^4.3.2": +"ansi-escapes@npm:^4.2.1, ansi-escapes@npm:^4.3.2": version: 4.3.2 resolution: "ansi-escapes@npm:4.3.2" dependencies: @@ -10587,6 +10831,15 @@ __metadata: languageName: node linkType: hard +"ansi-escapes@npm:^7.0.0": + version: 7.0.0 + resolution: "ansi-escapes@npm:7.0.0" + dependencies: + environment: "npm:^1.0.0" + checksum: 10/2d0e2345087bd7ae6bf122b9cc05ee35560d40dcc061146edcdc02bc2d7c7c50143cd12a22e69a0b5c0f62b948b7bc9a4539ee888b80f5bd33cdfd82d01a70ab + languageName: node + linkType: hard + "ansi-gray@npm:^0.1.1": version: 0.1.1 resolution: "ansi-gray@npm:0.1.1" @@ -11105,7 +11358,7 @@ __metadata: languageName: node linkType: hard -"argparse@npm:^1.0.7, argparse@npm:~1.0.9": +"argparse@npm:^1.0.7": version: 1.0.10 resolution: "argparse@npm:1.0.10" dependencies: @@ -12193,6 +12446,19 @@ __metadata: languageName: node linkType: hard +"call-bind@npm:^1.0.7": + version: 1.0.7 + resolution: "call-bind@npm:1.0.7" + dependencies: + es-define-property: "npm:^1.0.0" + es-errors: "npm:^1.3.0" + function-bind: "npm:^1.1.2" + get-intrinsic: "npm:^1.2.4" + set-function-length: "npm:^1.2.1" + checksum: 10/cd6fe658e007af80985da5185bff7b55e12ef4c2b6f41829a26ed1eef254b1f1c12e3dfd5b2b068c6ba8b86aba62390842d81752e67dcbaec4f6f76e7113b6b7 + languageName: node + linkType: hard + "call-me-maybe@npm:^1.0.1": version: 1.0.1 resolution: "call-me-maybe@npm:1.0.1" @@ -12357,7 +12623,7 @@ __metadata: languageName: node linkType: hard -"chalk@npm:>=5.3.0, chalk@npm:^5.3.0": +"chalk@npm:>=5.3.0, chalk@npm:^5.3.0, chalk@npm:~5.3.0": version: 5.3.0 resolution: "chalk@npm:5.3.0" checksum: 10/6373caaab21bd64c405bfc4bd9672b145647fc9482657b5ea1d549b3b2765054e9d3d928870cdf764fb4aad67555f5061538ff247b8310f110c5c888d92397ea @@ -12715,6 +12981,15 @@ __metadata: languageName: node linkType: hard +"cli-cursor@npm:^5.0.0": + version: 5.0.0 + resolution: "cli-cursor@npm:5.0.0" + dependencies: + restore-cursor: "npm:^5.0.0" + checksum: 10/1eb9a3f878b31addfe8d82c6d915ec2330cec8447ab1f117f4aa34f0137fbb3137ec3466e1c9a65bcb7557f6e486d343f2da57f253a2f668d691372dfa15c090 + languageName: node + linkType: hard + "cli-highlight@npm:^2.1.11": version: 2.1.11 resolution: "cli-highlight@npm:2.1.11" @@ -12758,7 +13033,7 @@ __metadata: languageName: node linkType: hard -"cli-truncate@npm:2.1.0, cli-truncate@npm:^2.1.0": +"cli-truncate@npm:2.1.0": version: 2.1.0 resolution: "cli-truncate@npm:2.1.0" dependencies: @@ -12778,16 +13053,6 @@ __metadata: languageName: node linkType: hard -"cli-truncate@npm:^3.1.0": - version: 3.1.0 - resolution: "cli-truncate@npm:3.1.0" - dependencies: - slice-ansi: "npm:^5.0.0" - string-width: "npm:^5.0.0" - checksum: 10/c3243e41974445691c63f8b405df1d5a24049dc33d324fe448dc572e561a7b772ae982692900b1a5960901cc4fc7def25a629b9c69a4208ee89d12ab3332617a - languageName: node - linkType: hard - "cli-truncate@npm:^4.0.0": version: 4.0.0 resolution: "cli-truncate@npm:4.0.0" @@ -13016,14 +13281,14 @@ __metadata: languageName: node linkType: hard -"colorette@npm:2.0.19, colorette@npm:^2.0.10, colorette@npm:^2.0.14, colorette@npm:^2.0.16": +"colorette@npm:2.0.19, colorette@npm:^2.0.10, colorette@npm:^2.0.14": version: 2.0.19 resolution: "colorette@npm:2.0.19" checksum: 10/6e2606435cd30e1cae8fc6601b024fdd809e20515c57ce1e588d0518403cff0c98abf807912ba543645a9188af36763b69b67e353d47397f24a1c961aba300bd languageName: node linkType: hard -"colorette@npm:^2.0.19, colorette@npm:^2.0.20": +"colorette@npm:^2.0.20": version: 2.0.20 resolution: "colorette@npm:2.0.20" checksum: 10/0b8de48bfa5d10afc160b8eaa2b9938f34a892530b2f7d7897e0458d9535a066e3998b49da9d21161c78225b272df19ae3a64d6df28b4c9734c0e55bbd02406f @@ -13063,7 +13328,7 @@ __metadata: languageName: node linkType: hard -"commander@npm:12.1.0": +"commander@npm:12.1.0, commander@npm:~12.1.0": version: 12.1.0 resolution: "commander@npm:12.1.0" checksum: 10/cdaeb672d979816853a4eed7f1310a9319e8b976172485c2a6b437ed0db0a389a44cfb222bfbde772781efa9f215bdd1b936f80d6b249485b465c6cb906e1f93 @@ -13114,7 +13379,7 @@ __metadata: languageName: node linkType: hard -"commander@npm:^9.3.0, commander@npm:^9.4.1": +"commander@npm:^9.4.1": version: 9.5.0 resolution: "commander@npm:9.5.0" checksum: 10/41c49b3d0f94a1fbeb0463c85b13f15aa15a9e0b4d5e10a49c0a1d58d4489b549d62262b052ae0aa6cfda53299bee487bfe337825df15e342114dde543f82906 @@ -13152,13 +13417,6 @@ __metadata: languageName: node linkType: hard -"compare-versions@npm:^6.1.1": - version: 6.1.1 - resolution: "compare-versions@npm:6.1.1" - checksum: 10/9325c0fadfba81afa0ec17e6fc2ef823ba785c693089698b8d9374e5460509f1916a88591644d4cb4045c9a58e47fafbcc0724fe8bf446d2a875a3d6eeddf165 - languageName: node - linkType: hard - "component-emitter@npm:^1.2.1, component-emitter@npm:^1.3.0": version: 1.3.0 resolution: "component-emitter@npm:1.3.0" @@ -13215,13 +13473,6 @@ __metadata: languageName: node linkType: hard -"computeds@npm:^0.0.1": - version: 0.0.1 - resolution: "computeds@npm:0.0.1" - checksum: 10/738625ccec6e483124d0ac79ec5474ab5c9df103ea05afc1fd840eed7d9004e3d6009b7bc806df564d66ad915c1ee1fb017bd91b2b32606a252ea9870b6a4026 - languageName: node - linkType: hard - "concat-map@npm:0.0.1": version: 0.0.1 resolution: "concat-map@npm:0.0.1" @@ -13397,6 +13648,15 @@ __metadata: languageName: node linkType: hard +"conventional-changelog-angular@npm:^8.0.0": + version: 8.0.0 + resolution: "conventional-changelog-angular@npm:8.0.0" + dependencies: + compare-func: "npm:^2.0.0" + checksum: 10/856e4652015d6ff5a192e2051efe4eb0d57534da304a3bfa6eb1e1ed06c995fe6d7c91d46e7a6de95baea52f7ccaad3ffe18260c972d40bad862f85d00c7b437 + languageName: node + linkType: hard + "conventional-changelog-conventionalcommits@npm:^7.0.2": version: 7.0.2 resolution: "conventional-changelog-conventionalcommits@npm:7.0.2" @@ -13449,19 +13709,18 @@ __metadata: languageName: node linkType: hard -"conventional-changelog-writer@npm:^7.0.0": - version: 7.0.1 - resolution: "conventional-changelog-writer@npm:7.0.1" +"conventional-changelog-writer@npm:^8.0.0": + version: 8.0.0 + resolution: "conventional-changelog-writer@npm:8.0.0" dependencies: - conventional-commits-filter: "npm:^4.0.0" + "@types/semver": "npm:^7.5.5" + conventional-commits-filter: "npm:^5.0.0" handlebars: "npm:^4.7.7" - json-stringify-safe: "npm:^5.0.1" - meow: "npm:^12.0.1" + meow: "npm:^13.0.0" semver: "npm:^7.5.2" - split2: "npm:^4.0.0" bin: - conventional-changelog-writer: cli.mjs - checksum: 10/fdb13864104eb0df33bb21397091837177da2e24afe1380b4c48921db01d59b3016254d6d6f2de663a86fc7eac8537fcd1fa924354d478d9f2d5eec026b5f554 + conventional-changelog-writer: dist/cli/index.js + checksum: 10/42daf5e8bf12474a8cffb0b2244ada5939d70a0158b23eeea13250f1710f269cd99f60652eb5a6f86b852a7d93a0368da20ea42163ec3b6041d3b76ce16c497a languageName: node linkType: hard @@ -13475,10 +13734,10 @@ __metadata: languageName: node linkType: hard -"conventional-commits-filter@npm:^4.0.0": - version: 4.0.0 - resolution: "conventional-commits-filter@npm:4.0.0" - checksum: 10/46d2d90531f024d596f61d353876276e5357adb5c4684e042467bb7d159feb0a2831b74656bd3038ac9ec38d99b0b24ac39f319ad511861e1299c4cdfb5a119a +"conventional-commits-filter@npm:^5.0.0": + version: 5.0.0 + resolution: "conventional-commits-filter@npm:5.0.0" + checksum: 10/2345546ea9e40412558d508311d7729b38f8d4c0fd554837c10721a432e8598ec1152320f6b601a9c11c023a31bccbb5a12067736b2227de8591f4de707e11a7 languageName: node linkType: hard @@ -13510,6 +13769,17 @@ __metadata: languageName: node linkType: hard +"conventional-commits-parser@npm:^6.0.0": + version: 6.0.0 + resolution: "conventional-commits-parser@npm:6.0.0" + dependencies: + meow: "npm:^13.0.0" + bin: + conventional-commits-parser: dist/cli/index.js + checksum: 10/ba754fb5784afff7f265bac1c0e408755174f1a04103e23a9d8f246102f7a7d043da9f67b19e7df93851901446a80c678a40cf5f9b49af153f60a528bdb507ce + languageName: node + linkType: hard + "conventional-recommended-bump@npm:7.0.1": version: 7.0.1 resolution: "conventional-recommended-bump@npm:7.0.1" @@ -13527,6 +13797,13 @@ __metadata: languageName: node linkType: hard +"convert-hrtime@npm:^5.0.0": + version: 5.0.0 + resolution: "convert-hrtime@npm:5.0.0" + checksum: 10/5245ad1ac6dd57b2d87624ae0eeac1d2a74812a6631208c09368bef787a28e7dbfa736cddaa9c8a0c425cb240437ea506afec7b9684ff617004d06a551f26c87 + languageName: node + linkType: hard + "convert-source-map@npm:^1.7.0": version: 1.8.0 resolution: "convert-source-map@npm:1.8.0" @@ -13588,7 +13865,7 @@ __metadata: languageName: node linkType: hard -"cookiejar@npm:^2.1.3": +"cookiejar@npm:^2.1.4": version: 2.1.4 resolution: "cookiejar@npm:2.1.4" checksum: 10/4a184f5a0591df8b07d22a43ea5d020eacb4572c383e853a33361a99710437eaa0971716c688684075bbf695b484f5872e9e3f562382e46858716cb7fc8ce3f4 @@ -14025,13 +14302,6 @@ __metadata: languageName: node linkType: hard -"de-indent@npm:^1.0.2": - version: 1.0.2 - resolution: "de-indent@npm:1.0.2" - checksum: 10/30bf43744dca005f9252dbb34ed95dcb3c30dfe52bfed84973b89c29eccff04e27769f222a34c61a93354acf47457785e9032e6184be390ed1d324fb9ab3f427 - languageName: node - linkType: hard - "debug@npm:*, debug@npm:4, debug@npm:4.3.4, debug@npm:4.x, debug@npm:^4.0.0, debug@npm:^4.0.1, debug@npm:^4.1.0, debug@npm:^4.1.1, debug@npm:^4.3.1, debug@npm:^4.3.2, debug@npm:^4.3.3, debug@npm:^4.3.4, debug@npm:~4.3.1, debug@npm:~4.3.2, debug@npm:~4.3.4": version: 4.3.4 resolution: "debug@npm:4.3.4" @@ -14083,6 +14353,18 @@ __metadata: languageName: node linkType: hard +"debug@npm:~4.3.6": + version: 4.3.7 + resolution: "debug@npm:4.3.7" + dependencies: + ms: "npm:^2.1.3" + peerDependenciesMeta: + supports-color: + optional: true + checksum: 10/71168908b9a78227ab29d5d25fe03c5867750e31ce24bf2c44a86efc5af041758bb56569b0a3d48a9b5344c00a24a777e6f4100ed6dfd9534a42c1dde285125a + languageName: node + linkType: hard + "decamelize-keys@npm:^1.1.0": version: 1.1.0 resolution: "decamelize-keys@npm:1.1.0" @@ -14240,6 +14522,17 @@ __metadata: languageName: node linkType: hard +"define-data-property@npm:^1.1.4": + version: 1.1.4 + resolution: "define-data-property@npm:1.1.4" + dependencies: + es-define-property: "npm:^1.0.0" + es-errors: "npm:^1.3.0" + gopd: "npm:^1.0.1" + checksum: 10/abdcb2505d80a53524ba871273e5da75e77e52af9e15b3aa65d8aad82b8a3a424dad7aee2cc0b71470ac7acf501e08defac362e8b6a73cdb4309f028061df4ae + languageName: node + linkType: hard + "define-lazy-prop@npm:^2.0.0": version: 2.0.0 resolution: "define-lazy-prop@npm:2.0.0" @@ -14393,13 +14686,13 @@ __metadata: languageName: node linkType: hard -"dezalgo@npm:1.0.3": - version: 1.0.3 - resolution: "dezalgo@npm:1.0.3" +"dezalgo@npm:^1.0.4": + version: 1.0.4 + resolution: "dezalgo@npm:1.0.4" dependencies: asap: "npm:^2.0.0" wrappy: "npm:1" - checksum: 10/960f4b6230866cb61f23d113170ca3bf84210a2801f8b8e24ee2b5d40402400358c75459293cab94dae6fdfb41004aebe1c847a65fb0b2ef091bf5a35c80faad + checksum: 10/895389c6aead740d2ab5da4d3466d20fa30f738010a4d3f4dcccc9fc645ca31c9d10b7e1804ae489b1eb02c7986f9f1f34ba132d409b043082a86d9a4e745624 languageName: node linkType: hard @@ -14975,13 +15268,6 @@ __metadata: languageName: node linkType: hard -"entities@npm:^4.5.0": - version: 4.5.0 - resolution: "entities@npm:4.5.0" - checksum: 10/ede2a35c9bce1aeccd055a1b445d41c75a14a2bb1cd22e242f20cf04d236cdcd7f9c859eb83f76885327bfae0c25bf03303665ee1ce3d47c5927b98b0e3e3d48 - languageName: node - linkType: hard - "env-ci@npm:^11.0.0": version: 11.0.0 resolution: "env-ci@npm:11.0.0" @@ -15008,6 +15294,13 @@ __metadata: languageName: node linkType: hard +"environment@npm:^1.0.0": + version: 1.1.0 + resolution: "environment@npm:1.1.0" + checksum: 10/dd3c1b9825e7f71f1e72b03c2344799ac73f2e9ef81b78ea8b373e55db021786c6b9f3858ea43a436a2c4611052670ec0afe85bc029c384cc71165feee2f4ba6 + languageName: node + linkType: hard + "err-code@npm:^2.0.2": version: 2.0.3 resolution: "err-code@npm:2.0.3" @@ -15052,6 +15345,22 @@ __metadata: languageName: node linkType: hard +"es-define-property@npm:^1.0.0": + version: 1.0.0 + resolution: "es-define-property@npm:1.0.0" + dependencies: + get-intrinsic: "npm:^1.2.4" + checksum: 10/f66ece0a887b6dca71848fa71f70461357c0e4e7249696f81bad0a1f347eed7b31262af4a29f5d726dc026426f085483b6b90301855e647aa8e21936f07293c6 + languageName: node + linkType: hard + +"es-errors@npm:^1.3.0": + version: 1.3.0 + resolution: "es-errors@npm:1.3.0" + checksum: 10/96e65d640156f91b707517e8cdc454dd7d47c32833aa3e85d79f24f9eb7ea85f39b63e36216ef0114996581969b59fe609a94e30316b08f5f4df1d44134cf8d5 + languageName: node + linkType: hard + "es-get-iterator@npm:^1.1.1": version: 1.1.2 resolution: "es-get-iterator@npm:1.1.2" @@ -15320,23 +15629,23 @@ __metadata: languageName: node linkType: hard -"eslint-config-prettier@npm:8.10.0": - version: 8.10.0 - resolution: "eslint-config-prettier@npm:8.10.0" +"eslint-config-prettier@npm:9.1.0": + version: 9.1.0 + resolution: "eslint-config-prettier@npm:9.1.0" peerDependencies: eslint: ">=7.0.0" bin: eslint-config-prettier: bin/cli.js - checksum: 10/0a51ab1417cbf80fabcf7a406960a142663539c8140fdb0a187b78f3d708b9d137a62a4bc4e689150e290b667750ddabd1740a516623b0cb4adb6cc1962cfe2c + checksum: 10/411e3b3b1c7aa04e3e0f20d561271b3b909014956c4dba51c878bf1a23dbb8c800a3be235c46c4732c70827276e540b6eed4636d9b09b444fd0a8e07f0fcd830 languageName: node linkType: hard -"eslint-plugin-prettier@npm:5.1.3": - version: 5.1.3 - resolution: "eslint-plugin-prettier@npm:5.1.3" +"eslint-plugin-prettier@npm:5.2.1": + version: 5.2.1 + resolution: "eslint-plugin-prettier@npm:5.2.1" dependencies: prettier-linter-helpers: "npm:^1.0.0" - synckit: "npm:^0.8.6" + synckit: "npm:^0.9.1" peerDependencies: "@types/eslint": ">=8.0.0" eslint: ">=8.0.0" @@ -15347,20 +15656,46 @@ __metadata: optional: true eslint-config-prettier: optional: true - checksum: 10/4f26a30444adc61ed692cdb5a9f7e8d9f5794f0917151051e66755ce032a08c3cc72c8b5d56101412e90f6d77035bd8194ea8731e9c16aacdd5ae345a8dae188 + checksum: 10/10ddf68215237e327af09a47adab4c63f3885fda4fb28c4c42d1fc5f47d8a0cc45df6484799360ff1417a0aa3c77c3aaac49d7e9dfd145557b17e2d7ecc2a27c languageName: node linkType: hard -"eslint-plugin-workspaces@npm:0.8.0": - version: 0.8.0 - resolution: "eslint-plugin-workspaces@npm:0.8.0" +"eslint-plugin-simple-import-sort@npm:12.1.1": + version: 12.1.1 + resolution: "eslint-plugin-simple-import-sort@npm:12.1.1" + peerDependencies: + eslint: ">=5.0.0" + checksum: 10/2a690cea9243fbefa70345687bca8952f5e185fa459b7a8db687a908cc31082435cfee236c619d5245548fa5f89a2f2c4f8499f80512e048d2bedc60e3662d5a + languageName: node + linkType: hard + +"eslint-plugin-vitest@npm:0.5.4": + version: 0.5.4 + resolution: "eslint-plugin-vitest@npm:0.5.4" + dependencies: + "@typescript-eslint/utils": "npm:^7.7.1" + peerDependencies: + eslint: ^8.57.0 || ^9.0.0 + vitest: "*" + peerDependenciesMeta: + "@typescript-eslint/eslint-plugin": + optional: true + vitest: + optional: true + checksum: 10/a81eda0b6fff5f05afa9e4e2deb114562e8a53e224293a0dd3f524c01a240a1f8b6c7284d15862c5b740adc6816a2f23e5b96fc65d95c0abd24a5ef171215589 + languageName: node + linkType: hard + +"eslint-plugin-workspaces@npm:0.10.1": + version: 0.10.1 + resolution: "eslint-plugin-workspaces@npm:0.10.1" dependencies: - find-workspaces: "npm:^0.1.0" - checksum: 10/d574f2627b3e6a5f9848b68b72eba56060fd3f0886975725198d3db083a9bcd8680a799969c5ee9cdc961dfb8e964010ad61863ccd778251d137768f7ca91ee2 + find-workspaces: "npm:^0.3.0" + checksum: 10/22942be27b269a4f85b8d967c1bdec0eb766c8f8e95d3164f87b1579d50e9fc4653a614063173c18097c5bca073d1f9badb40adec1a1173740d62285790a0a0e languageName: node linkType: hard -"eslint-scope@npm:5.1.1, eslint-scope@npm:^5.1.1": +"eslint-scope@npm:5.1.1": version: 5.1.1 resolution: "eslint-scope@npm:5.1.1" dependencies: @@ -15380,6 +15715,16 @@ __metadata: languageName: node linkType: hard +"eslint-scope@npm:^8.0.2": + version: 8.0.2 + resolution: "eslint-scope@npm:8.0.2" + dependencies: + esrecurse: "npm:^4.3.0" + estraverse: "npm:^5.2.0" + checksum: 10/d17c2e1ff4d3a98911414a954531078db912e2747d6da8ea4cafd16d0526e32086c676ce9aeaffb3ca0ff695fc951ac3169d7f08a0b42962db683dff126cc95b + languageName: node + linkType: hard + "eslint-visitor-keys@npm:^3.3.0": version: 3.3.0 resolution: "eslint-visitor-keys@npm:3.3.0" @@ -15394,6 +15739,65 @@ __metadata: languageName: node linkType: hard +"eslint-visitor-keys@npm:^4.0.0": + version: 4.0.0 + resolution: "eslint-visitor-keys@npm:4.0.0" + checksum: 10/c7617166e6291a15ce2982b5c4b9cdfb6409f5c14562712d12e2584480cdf18609694b21d7dad35b02df0fa2cd037505048ded54d2f405c64f600949564eb334 + languageName: node + linkType: hard + +"eslint@npm:9.11.1": + version: 9.11.1 + resolution: "eslint@npm:9.11.1" + dependencies: + "@eslint-community/eslint-utils": "npm:^4.2.0" + "@eslint-community/regexpp": "npm:^4.11.0" + "@eslint/config-array": "npm:^0.18.0" + "@eslint/core": "npm:^0.6.0" + "@eslint/eslintrc": "npm:^3.1.0" + "@eslint/js": "npm:9.11.1" + "@eslint/plugin-kit": "npm:^0.2.0" + "@humanwhocodes/module-importer": "npm:^1.0.1" + "@humanwhocodes/retry": "npm:^0.3.0" + "@nodelib/fs.walk": "npm:^1.2.8" + "@types/estree": "npm:^1.0.6" + "@types/json-schema": "npm:^7.0.15" + ajv: "npm:^6.12.4" + chalk: "npm:^4.0.0" + cross-spawn: "npm:^7.0.2" + debug: "npm:^4.3.2" + escape-string-regexp: "npm:^4.0.0" + eslint-scope: "npm:^8.0.2" + eslint-visitor-keys: "npm:^4.0.0" + espree: "npm:^10.1.0" + esquery: "npm:^1.5.0" + esutils: "npm:^2.0.2" + fast-deep-equal: "npm:^3.1.3" + file-entry-cache: "npm:^8.0.0" + find-up: "npm:^5.0.0" + glob-parent: "npm:^6.0.2" + ignore: "npm:^5.2.0" + imurmurhash: "npm:^0.1.4" + is-glob: "npm:^4.0.0" + is-path-inside: "npm:^3.0.3" + json-stable-stringify-without-jsonify: "npm:^1.0.1" + lodash.merge: "npm:^4.6.2" + minimatch: "npm:^3.1.2" + natural-compare: "npm:^1.4.0" + optionator: "npm:^0.9.3" + strip-ansi: "npm:^6.0.1" + text-table: "npm:^0.2.0" + peerDependencies: + jiti: "*" + peerDependenciesMeta: + jiti: + optional: true + bin: + eslint: bin/eslint.js + checksum: 10/38de03a51044a5f708c93302cff5e860355447d424f1a21fa67f5b2f0541d092d3f3807c0242820d9795553a3f1165db51769e9a042816334d05c86f015fdfef + languageName: node + linkType: hard + "eslint@npm:^8.57.0": version: 8.57.0 resolution: "eslint@npm:8.57.0" @@ -15449,6 +15853,17 @@ __metadata: languageName: node linkType: hard +"espree@npm:^10.0.1, espree@npm:^10.1.0": + version: 10.1.0 + resolution: "espree@npm:10.1.0" + dependencies: + acorn: "npm:^8.12.0" + acorn-jsx: "npm:^5.3.2" + eslint-visitor-keys: "npm:^4.0.0" + checksum: 10/a673aa39a19a51763d92272f8f3772ae3d4b10624740bb72d5f273b631b43f1a5a32b385c1da6ae6bc10be05a5913bc4679ebd22a09c7b336a745204834806ea + languageName: node + linkType: hard + "espree@npm:^9.6.0, espree@npm:^9.6.1": version: 9.6.1 resolution: "espree@npm:9.6.1" @@ -15499,6 +15914,15 @@ __metadata: languageName: node linkType: hard +"esquery@npm:^1.5.0": + version: 1.6.0 + resolution: "esquery@npm:1.6.0" + dependencies: + estraverse: "npm:^5.1.0" + checksum: 10/c587fb8ec9ed83f2b1bc97cf2f6854cc30bf784a79d62ba08c6e358bf22280d69aee12827521cf38e69ae9761d23fb7fde593ce315610f85655c139d99b05e5a + languageName: node + linkType: hard + "esrecurse@npm:^4.3.0": version: 4.3.0 resolution: "esrecurse@npm:4.3.0" @@ -15651,7 +16075,7 @@ __metadata: languageName: node linkType: hard -"execa@npm:5.1.1, execa@npm:^5.0.0, execa@npm:^5.1.1": +"execa@npm:5.1.1, execa@npm:^5.0.0": version: 5.1.1 resolution: "execa@npm:5.1.1" dependencies: @@ -15668,7 +16092,7 @@ __metadata: languageName: node linkType: hard -"execa@npm:>=8.0.1, execa@npm:^8.0.0, execa@npm:^8.0.1": +"execa@npm:>=8.0.1, execa@npm:^8.0.0, execa@npm:^8.0.1, execa@npm:~8.0.1": version: 8.0.1 resolution: "execa@npm:8.0.1" dependencies: @@ -15685,6 +16109,26 @@ __metadata: languageName: node linkType: hard +"execa@npm:^9.0.0": + version: 9.4.0 + resolution: "execa@npm:9.4.0" + dependencies: + "@sindresorhus/merge-streams": "npm:^4.0.0" + cross-spawn: "npm:^7.0.3" + figures: "npm:^6.1.0" + get-stream: "npm:^9.0.0" + human-signals: "npm:^8.0.0" + is-plain-obj: "npm:^4.1.0" + is-stream: "npm:^4.0.1" + npm-run-path: "npm:^6.0.0" + pretty-ms: "npm:^9.0.0" + signal-exit: "npm:^4.1.0" + strip-final-newline: "npm:^4.0.0" + yoctocolors: "npm:^2.0.0" + checksum: 10/a92be5d2b5baa84e6ef32fc38c620e1f4b5990399e88661563933ffbcd7be1ea28cc96bef059f14d45fee289061980c9452d2abb4786f4c6f492f04767387a67 + languageName: node + linkType: hard + "exit@npm:0.1.2": version: 0.1.2 resolution: "exit@npm:0.1.2" @@ -15916,7 +16360,7 @@ __metadata: languageName: node linkType: hard -"fast-glob@npm:^3.0.0, fast-glob@npm:^3.2.12, fast-glob@npm:^3.3.2": +"fast-glob@npm:^3.0.0, fast-glob@npm:^3.3.2": version: 3.3.2 resolution: "fast-glob@npm:3.3.2" dependencies: @@ -16109,6 +16553,15 @@ __metadata: languageName: node linkType: hard +"figures@npm:^6.1.0": + version: 6.1.0 + resolution: "figures@npm:6.1.0" + dependencies: + is-unicode-supported: "npm:^2.0.0" + checksum: 10/9822d13630bee8e6a9f2da866713adf13854b07e0bfde042defa8bba32d47a1c0b2afa627ce73837c674cf9a5e3edce7e879ea72cb9ea7960b2390432d8e1167 + languageName: node + linkType: hard + "file-entry-cache@npm:^6.0.1": version: 6.0.1 resolution: "file-entry-cache@npm:6.0.1" @@ -16118,6 +16571,15 @@ __metadata: languageName: node linkType: hard +"file-entry-cache@npm:^8.0.0": + version: 8.0.0 + resolution: "file-entry-cache@npm:8.0.0" + dependencies: + flat-cache: "npm:^4.0.0" + checksum: 10/afe55c4de4e0d226a23c1eae62a7219aafb390859122608a89fa4df6addf55c7fd3f1a2da6f5b41e7cdff496e4cf28bbd215d53eab5c817afa96d2b40c81bfb0 + languageName: node + linkType: hard + "file-uri-to-path@npm:1.0.0": version: 1.0.0 resolution: "file-uri-to-path@npm:1.0.0" @@ -16248,23 +16710,24 @@ __metadata: languageName: node linkType: hard -"find-versions@npm:^5.1.0": - version: 5.1.0 - resolution: "find-versions@npm:5.1.0" +"find-versions@npm:^6.0.0": + version: 6.0.0 + resolution: "find-versions@npm:6.0.0" dependencies: semver-regex: "npm:^4.0.5" - checksum: 10/680bdb0081f631f7bfb6f0f8edcfa0b74ab8cabc82097a4527a37b0d042aabc56685bf459ff27991eab0baddc04eb8e3bba8a2869f5004ecf7cdd2779b6e51de + super-regex: "npm:^1.0.0" + checksum: 10/d622e711bd17099015506bafd18b13e51fcc54f80ad073cf819ce4598d6b485774f55708ca356235770bed0148ae55a7daf3ef6deb72730c5b1e2f32b432fed5 languageName: node linkType: hard -"find-workspaces@npm:^0.1.0": - version: 0.1.0 - resolution: "find-workspaces@npm:0.1.0" +"find-workspaces@npm:^0.3.0": + version: 0.3.1 + resolution: "find-workspaces@npm:0.3.1" dependencies: - fast-glob: "npm:^3.2.12" - type-fest: "npm:^3.2.0" - yaml: "npm:^2.1.3" - checksum: 10/0d4cca9d9623f55c4b45306e617b3c78d08e867580e1c2c08a1b280a4fe143547deb482e7d02988a2e49821800a047f7ffd898ff7e5d64b4276fa377b3dc622e + fast-glob: "npm:^3.3.2" + pkg-types: "npm:^1.0.3" + yaml: "npm:^2.3.4" + checksum: 10/8803ca7431768d04cfefb7e838db3c54207bebf875eb25fa73d318c486b5694fa59e43d63808263a4cadaa66b78915b8f970ffe5151a050843234ef84a071a19 languageName: node linkType: hard @@ -16278,6 +16741,16 @@ __metadata: languageName: node linkType: hard +"flat-cache@npm:^4.0.0": + version: 4.0.1 + resolution: "flat-cache@npm:4.0.1" + dependencies: + flatted: "npm:^3.2.9" + keyv: "npm:^4.5.4" + checksum: 10/58ce851d9045fffc7871ce2bd718bc485ad7e777bf748c054904b87c351ff1080c2c11da00788d78738bfb51b71e4d5ea12d13b98eb36e3358851ffe495b62dc + languageName: node + linkType: hard + "flat@npm:^5.0.2": version: 5.0.2 resolution: "flat@npm:5.0.2" @@ -16294,6 +16767,13 @@ __metadata: languageName: node linkType: hard +"flatted@npm:^3.2.9": + version: 3.3.1 + resolution: "flatted@npm:3.3.1" + checksum: 10/7b8376061d5be6e0d3658bbab8bde587647f68797cf6bfeae9dea0e5137d9f27547ab92aaff3512dd9d1299086a6d61be98e9d48a56d17531b634f77faadbc49 + languageName: node + linkType: hard + "follow-redirects@npm:^1.0.0, follow-redirects@npm:^1.14.9, follow-redirects@npm:^1.15.4, follow-redirects@npm:^1.15.6": version: 1.15.6 resolution: "follow-redirects@npm:1.15.6" @@ -16372,15 +16852,14 @@ __metadata: languageName: node linkType: hard -"formidable@npm:^2.0.1": - version: 2.0.1 - resolution: "formidable@npm:2.0.1" +"formidable@npm:^3.5.1": + version: 3.5.1 + resolution: "formidable@npm:3.5.1" dependencies: - dezalgo: "npm:1.0.3" - hexoid: "npm:1.0.0" - once: "npm:1.4.0" - qs: "npm:6.9.3" - checksum: 10/f0ad9266e61b0a3ebd301fa6efbc9ea5cbdcf7ef2fbd7f9f1122c9172e41d00323615597f0f5ac6b821cda3f32a6bdf4dc8e77ca61a3124ce5dcf17d69d5954a + dezalgo: "npm:^1.0.4" + hexoid: "npm:^1.0.0" + once: "npm:^1.4.0" + checksum: 10/c9a7bbbd4ca8142893da88b51cf7797adee022344ea180cf157a108bf999bed5ad8bc07a10a28d8a39fcbfaa02e8cba07f4ba336fbeb330deb23907336ba1fc2 languageName: node linkType: hard @@ -16614,17 +17093,6 @@ __metadata: languageName: node linkType: hard -"fs-extra@npm:~7.0.1": - version: 7.0.1 - resolution: "fs-extra@npm:7.0.1" - dependencies: - graceful-fs: "npm:^4.1.2" - jsonfile: "npm:^4.0.0" - universalify: "npm:^0.1.0" - checksum: 10/3fc6e56ba2f07c00d452163f27f21a7076b72ef7da8a50fef004336d59ef4c34deda11d10ecd73fd8fbcf20e4f575f52857293090b3c9f8741d4e0598be30fea - languageName: node - linkType: hard - "fs-jetpack@npm:5.1.0": version: 5.1.0 resolution: "fs-jetpack@npm:5.1.0" @@ -16725,6 +17193,13 @@ __metadata: languageName: node linkType: hard +"function-timeout@npm:^1.0.1": + version: 1.0.2 + resolution: "function-timeout@npm:1.0.2" + checksum: 10/3afedebacaaf237ba9aaef925886fcf5abd434ca12a18c1c7cecb001e57bf9b30434278edcc977a127baeb5b6361f7c278243c1dbf8bf349aa8b30500c57a699 + languageName: node + linkType: hard + "fuse.js@npm:^6.6.2": version: 6.6.2 resolution: "fuse.js@npm:6.6.2" @@ -16826,6 +17301,19 @@ __metadata: languageName: node linkType: hard +"get-intrinsic@npm:^1.2.4": + version: 1.2.4 + resolution: "get-intrinsic@npm:1.2.4" + dependencies: + es-errors: "npm:^1.3.0" + function-bind: "npm:^1.1.2" + has-proto: "npm:^1.0.1" + has-symbols: "npm:^1.0.3" + hasown: "npm:^2.0.0" + checksum: 10/85bbf4b234c3940edf8a41f4ecbd4e25ce78e5e6ad4e24ca2f77037d983b9ef943fd72f00f3ee97a49ec622a506b67db49c36246150377efcda1c9eb03e5f06d + languageName: node + linkType: hard + "get-package-type@npm:^0.1.0": version: 0.1.0 resolution: "get-package-type@npm:0.1.0" @@ -16882,6 +17370,16 @@ __metadata: languageName: node linkType: hard +"get-stream@npm:^9.0.0": + version: 9.0.1 + resolution: "get-stream@npm:9.0.1" + dependencies: + "@sec-ant/readable-stream": "npm:^0.4.1" + is-stream: "npm:^4.0.1" + checksum: 10/ce56e6db6bcd29ca9027b0546af035c3e93dcd154ca456b54c298901eb0e5b2ce799c5d727341a100c99e14c523f267f1205f46f153f7b75b1f4da6d98a21c5e + languageName: node + linkType: hard + "get-symbol-description@npm:^1.0.0": version: 1.0.0 resolution: "get-symbol-description@npm:1.0.0" @@ -17190,6 +17688,13 @@ __metadata: languageName: node linkType: hard +"globals@npm:^14.0.0": + version: 14.0.0 + resolution: "globals@npm:14.0.0" + checksum: 10/03939c8af95c6df5014b137cac83aa909090c3a3985caef06ee9a5a669790877af8698ab38007e4c0186873adc14c0b13764acc754b16a754c216cc56aa5f021 + languageName: node + linkType: hard + "globby@npm:*": version: 13.1.1 resolution: "globby@npm:13.1.1" @@ -17571,6 +18076,15 @@ __metadata: languageName: node linkType: hard +"has-property-descriptors@npm:^1.0.2": + version: 1.0.2 + resolution: "has-property-descriptors@npm:1.0.2" + dependencies: + es-define-property: "npm:^1.0.0" + checksum: 10/2d8c9ab8cebb572e3362f7d06139a4592105983d4317e68f7adba320fe6ddfc8874581e0971e899e633fd5f72e262830edce36d5a0bc863dad17ad20572484b2 + languageName: node + linkType: hard + "has-proto@npm:^1.0.1": version: 1.0.1 resolution: "has-proto@npm:1.0.1" @@ -17675,15 +18189,6 @@ __metadata: languageName: node linkType: hard -"hasown@npm:^2.0.2": - version: 2.0.2 - resolution: "hasown@npm:2.0.2" - dependencies: - function-bind: "npm:^1.1.2" - checksum: 10/7898a9c1788b2862cf0f9c345a6bec77ba4a0c0983c7f19d610c382343d4f98fa260686b225dfb1f88393a66679d2ec58ee310c1d6868c081eda7918f32cc70a - languageName: node - linkType: hard - "he@npm:^1.2.0": version: 1.2.0 resolution: "he@npm:1.2.0" @@ -17710,7 +18215,7 @@ __metadata: languageName: node linkType: hard -"hexoid@npm:1.0.0": +"hexoid@npm:^1.0.0": version: 1.0.0 resolution: "hexoid@npm:1.0.0" checksum: 10/f2271b8b6b0e13fb5a1eccf740f53ce8bae689c80b9498b854c447f9dc94f75f44e0de064c0e4660ecdbfa8942bb2b69973fdcb080187b45bbb409a3c71f19d4 @@ -17786,6 +18291,15 @@ __metadata: languageName: node linkType: hard +"hosted-git-info@npm:^8.0.0": + version: 8.0.0 + resolution: "hosted-git-info@npm:8.0.0" + dependencies: + lru-cache: "npm:^10.0.1" + checksum: 10/fb1e5600a57dbebfc4d708ccd6256facabb1cdfb182ac20ab7c900c311bda91f71b2129d3e15b4d1faaef82d1acb5f7c3558e50c4249402020f866a4f9958b8b + languageName: node + linkType: hard + "hpack.js@npm:^2.1.6": version: 2.1.6 resolution: "hpack.js@npm:2.1.6" @@ -18114,6 +18628,13 @@ __metadata: languageName: node linkType: hard +"human-signals@npm:^8.0.0": + version: 8.0.0 + resolution: "human-signals@npm:8.0.0" + checksum: 10/89acdc7081ac2a065e41cca7351c4b0fe2382e213b7372f90df6a554e340f31b49388a307adc1d6f4c60b2b4fe81eeff0bc1f44be6f5d844311cd92ccc7831c6 + languageName: node + linkType: hard + "humanize-ms@npm:^1.2.1": version: 1.2.1 resolution: "humanize-ms@npm:1.2.1" @@ -18123,12 +18644,12 @@ __metadata: languageName: node linkType: hard -"husky@npm:8.0.3": - version: 8.0.3 - resolution: "husky@npm:8.0.3" +"husky@npm:9.1.6": + version: 9.1.6 + resolution: "husky@npm:9.1.6" bin: - husky: lib/bin.js - checksum: 10/b754cf70fdc97c3b60fec5b80056b9c11436464953b1691bf2b5dcf0081fb6685d2c5f47abb8b2b1c49f504aabea5321fdd6496f8b755d9f6e7525a493406abb + husky: bin.js + checksum: 10/421ccd8850378231aaefd70dbe9e4f1549b84ffe3a6897f93a202242bbc04e48bd498169aef43849411105d9fcf7c192b757d42661e28d06b934a609a4eb8771 languageName: node linkType: hard @@ -18219,6 +18740,13 @@ __metadata: languageName: node linkType: hard +"ignore@npm:^5.3.1": + version: 5.3.2 + resolution: "ignore@npm:5.3.2" + checksum: 10/cceb6a457000f8f6a50e1196429750d782afce5680dd878aa4221bd79972d68b3a55b4b1458fc682be978f4d3c6a249046aa0880637367216444ab7b014cfc98 + languageName: node + linkType: hard + "import-fresh@npm:^3.2.1, import-fresh@npm:^3.3.0": version: 3.3.0 resolution: "import-fresh@npm:3.3.0" @@ -18239,13 +18767,6 @@ __metadata: languageName: node linkType: hard -"import-lazy@npm:~4.0.0": - version: 4.0.0 - resolution: "import-lazy@npm:4.0.0" - checksum: 10/943309cc8eb01ada12700448c288b0384f77a1bc33c7e00fa4cb223c665f467a13ce9aaceb8d2e4cf586b07c1d2828040263dcc069873ce63cfc2ac6fd087971 - languageName: node - linkType: hard - "import-local@npm:3.1.0, import-local@npm:^3.0.2": version: 3.1.0 resolution: "import-local@npm:3.1.0" @@ -18639,7 +19160,7 @@ __metadata: languageName: node linkType: hard -"is-ci@npm:3.0.1, is-ci@npm:^3.0.1": +"is-ci@npm:3.0.1": version: 3.0.1 resolution: "is-ci@npm:3.0.1" dependencies: @@ -18675,15 +19196,6 @@ __metadata: languageName: node linkType: hard -"is-core-module@npm:^2.13.0": - version: 2.15.0 - resolution: "is-core-module@npm:2.15.0" - dependencies: - hasown: "npm:^2.0.2" - checksum: 10/70e962543e5d3a97c07cb29144a86792d545a21f28e67da5401d85878a0193d46fbab8d97bc3ca680e2778705dca66e7b6ca840c493497a27ca0e8c5f3ac3d1d - languageName: node - linkType: hard - "is-core-module@npm:^2.5.0": version: 2.8.1 resolution: "is-core-module@npm:2.8.1" @@ -19019,6 +19531,13 @@ __metadata: languageName: node linkType: hard +"is-plain-obj@npm:^4.1.0": + version: 4.1.0 + resolution: "is-plain-obj@npm:4.1.0" + checksum: 10/6dc45da70d04a81f35c9310971e78a6a3c7a63547ef782e3a07ee3674695081b6ca4e977fbb8efc48dae3375e0b34558d2bcd722aec9bddfa2d7db5b041be8ce + languageName: node + linkType: hard + "is-plain-object@npm:^2.0.3, is-plain-object@npm:^2.0.4": version: 2.0.4 resolution: "is-plain-object@npm:2.0.4" @@ -19103,6 +19622,13 @@ __metadata: languageName: node linkType: hard +"is-stream@npm:^4.0.1": + version: 4.0.1 + resolution: "is-stream@npm:4.0.1" + checksum: 10/cbea3f1fc271b21ceb228819d0c12a0965a02b57f39423925f99530b4eb86935235f258f06310b67cd02b2d10b49e9a0998f5ececf110ab7d3760bae4055ad23 + languageName: node + linkType: hard + "is-string@npm:^1.0.5, is-string@npm:^1.0.7": version: 1.0.7 resolution: "is-string@npm:1.0.7" @@ -19534,13 +20060,6 @@ __metadata: languageName: node linkType: hard -"jju@npm:~1.4.0": - version: 1.4.0 - resolution: "jju@npm:1.4.0" - checksum: 10/1067ff8ce02221faac5a842116ed0ec79a53312a111d0bf8342a80bd02c0a3fdf0b8449694a65947db0a3e8420e8b326dffb489c7dd5866efc380c0d1708a707 - languageName: node - linkType: hard - "jose2@npm:jose@^2.0.4": version: 2.0.5 resolution: "jose@npm:2.0.5" @@ -19880,6 +20399,15 @@ __metadata: languageName: node linkType: hard +"keyv@npm:^4.5.4": + version: 4.5.4 + resolution: "keyv@npm:4.5.4" + dependencies: + json-buffer: "npm:3.0.1" + checksum: 10/167eb6ef64cc84b6fa0780ee50c9de456b422a1e18802209234f7c2cf7eae648c7741f32e50d7e24ccb22b24c13154070b01563d642755b156c357431a191e75 + languageName: node + linkType: hard + "kind-of@npm:^3.0.2, kind-of@npm:^3.0.3, kind-of@npm:^3.2.0": version: 3.2.2 resolution: "kind-of@npm:3.2.2" @@ -20136,13 +20664,6 @@ __metadata: languageName: node linkType: hard -"kolorist@npm:^1.8.0": - version: 1.8.0 - resolution: "kolorist@npm:1.8.0" - checksum: 10/71d5d122951cc65f2f14c3e1d7f8fd91694b374647d4f6deec3816d018cd04a44edd9578d93e00c82c2053b925e5d30a0565746c4171f4ca9fce1a13bd5f3315 - languageName: node - linkType: hard - "lazy-cache@npm:^1.0.3": version: 1.0.4 resolution: "lazy-cache@npm:1.0.4" @@ -20429,10 +20950,10 @@ __metadata: languageName: node linkType: hard -"lilconfig@npm:2.0.5": - version: 2.0.5 - resolution: "lilconfig@npm:2.0.5" - checksum: 10/a6e201bcb5b2f876cdd8b1cb7d20b126156aff976e29a184b62e6408e1c7da127603390543441fda8656a34d710113d74bb1551317e0cdc9dcb6e96dfbf6c525 +"lilconfig@npm:~3.1.2": + version: 3.1.2 + resolution: "lilconfig@npm:3.1.2" + checksum: 10/8058403850cfad76d6041b23db23f730e52b6c17a8c28d87b90766639ca0ee40c748a3e85c2d7bd133d572efabff166c4b015e5d25e01fd666cb4b13cfada7f0 languageName: node linkType: hard @@ -20450,27 +20971,23 @@ __metadata: languageName: node linkType: hard -"lint-staged@npm:^12.5.0": - version: 12.5.0 - resolution: "lint-staged@npm:12.5.0" +"lint-staged@npm:15.2.10": + version: 15.2.10 + resolution: "lint-staged@npm:15.2.10" dependencies: - cli-truncate: "npm:^3.1.0" - colorette: "npm:^2.0.16" - commander: "npm:^9.3.0" - debug: "npm:^4.3.4" - execa: "npm:^5.1.1" - lilconfig: "npm:2.0.5" - listr2: "npm:^4.0.5" - micromatch: "npm:^4.0.5" - normalize-path: "npm:^3.0.0" - object-inspect: "npm:^1.12.2" - pidtree: "npm:^0.5.0" - string-argv: "npm:^0.3.1" - supports-color: "npm:^9.2.2" - yaml: "npm:^1.10.2" + chalk: "npm:~5.3.0" + commander: "npm:~12.1.0" + debug: "npm:~4.3.6" + execa: "npm:~8.0.1" + lilconfig: "npm:~3.1.2" + listr2: "npm:~8.2.4" + micromatch: "npm:~4.0.8" + pidtree: "npm:~0.6.0" + string-argv: "npm:~0.3.2" + yaml: "npm:~2.5.0" bin: lint-staged: bin/lint-staged.js - checksum: 10/1bae4edc8e1529c361acf7b1162c715299411add2ad2c588fc9af1c97d1cb5ca29a0693aa0be5ad81fb0f49f8ba28e0f10b56322b1b1cc34f2b7a47299ebb5ac + checksum: 10/ab6930cd633dbb5b6ec7c81fc06c65df41e9f80d93dd22e0d79c6e272cdfd8110a0fbdec60303d46a06b30bcd92261153630e2c937531b77ec5ae41e7e9d90d3 languageName: node linkType: hard @@ -20541,24 +21058,17 @@ __metadata: languageName: node linkType: hard -"listr2@npm:^4.0.5": - version: 4.0.5 - resolution: "listr2@npm:4.0.5" +"listr2@npm:~8.2.4": + version: 8.2.4 + resolution: "listr2@npm:8.2.4" dependencies: - cli-truncate: "npm:^2.1.0" - colorette: "npm:^2.0.16" - log-update: "npm:^4.0.0" - p-map: "npm:^4.0.0" - rfdc: "npm:^1.3.0" - rxjs: "npm:^7.5.5" - through: "npm:^2.3.8" - wrap-ansi: "npm:^7.0.0" - peerDependencies: - enquirer: ">= 2.3.0 < 3" - peerDependenciesMeta: - enquirer: - optional: true - checksum: 10/9c591fdd4fd6b7e8b4feca60380be01d74c65a98857f6caff2418c609fb9f0016c2e1b65c0ef5b1f4ff015967be87e8642e7ac3ad7ce0aa3c1a0329b60128b3b + cli-truncate: "npm:^4.0.0" + colorette: "npm:^2.0.20" + eventemitter3: "npm:^5.0.1" + log-update: "npm:^6.1.0" + rfdc: "npm:^1.4.1" + wrap-ansi: "npm:^9.0.0" + checksum: 10/344d2397e127bf802935925e95b54468eef745fbbaf9326eb33a1634ae2d6e86cdb527ef48cb83a19a50671955d39b3e2608c74db85530df07b5674f5de115e1 languageName: node linkType: hard @@ -20628,16 +21138,6 @@ __metadata: languageName: node linkType: hard -"local-pkg@npm:^0.5.0": - version: 0.5.0 - resolution: "local-pkg@npm:0.5.0" - dependencies: - mlly: "npm:^1.4.2" - pkg-types: "npm:^1.0.3" - checksum: 10/20f4caba50dc6fb00ffcc1a78bc94b5acb33995e0aadf4d4edcdeab257e891aa08f50afddf02f3240b2c3d02432bc2078f2a916a280ed716b64753a3d250db70 - languageName: node - linkType: hard - "locate-path@npm:^2.0.0": version: 2.0.0 resolution: "locate-path@npm:2.0.0" @@ -21024,7 +21524,7 @@ __metadata: languageName: node linkType: hard -"lodash@npm:4, lodash@npm:4.17.21, lodash@npm:>=4.17.21, lodash@npm:^4.17.10, lodash@npm:^4.17.15, lodash@npm:^4.17.20, lodash@npm:^4.17.21, lodash@npm:^4.17.5, lodash@npm:~4.17.15": +"lodash@npm:4, lodash@npm:4.17.21, lodash@npm:>=4.17.21, lodash@npm:^4.17.10, lodash@npm:^4.17.15, lodash@npm:^4.17.20, lodash@npm:^4.17.21, lodash@npm:^4.17.5": version: 4.17.21 resolution: "lodash@npm:4.17.21" checksum: 10/c08619c038846ea6ac754abd6dd29d2568aa705feb69339e836dfa8d8b09abbb2f859371e86863eda41848221f9af43714491467b5b0299122431e202bb0c532 @@ -21061,18 +21561,6 @@ __metadata: languageName: node linkType: hard -"log-update@npm:^4.0.0": - version: 4.0.0 - resolution: "log-update@npm:4.0.0" - dependencies: - ansi-escapes: "npm:^4.3.0" - cli-cursor: "npm:^3.1.0" - slice-ansi: "npm:^4.0.0" - wrap-ansi: "npm:^6.2.0" - checksum: 10/ae2f85bbabc1906034154fb7d4c4477c79b3e703d22d78adee8b3862fa913942772e7fa11713e3d96fb46de4e3cabefbf5d0a544344f03b58d3c4bff52aa9eb2 - languageName: node - linkType: hard - "log-update@npm:^6.0.0": version: 6.0.0 resolution: "log-update@npm:6.0.0" @@ -21086,6 +21574,19 @@ __metadata: languageName: node linkType: hard +"log-update@npm:^6.1.0": + version: 6.1.0 + resolution: "log-update@npm:6.1.0" + dependencies: + ansi-escapes: "npm:^7.0.0" + cli-cursor: "npm:^5.0.0" + slice-ansi: "npm:^7.1.0" + strip-ansi: "npm:^7.1.0" + wrap-ansi: "npm:^9.0.0" + checksum: 10/5abb4131e33b1e7f8416bb194fe17a3603d83e4657c5bf5bb81ce4187f3b00ea481643b85c3d5cefe6037a452cdcf7f1391ab8ea0d9c23e75d19589830ec4f11 + languageName: node + linkType: hard + "loglevel@npm:^1.6.7, loglevel@npm:^1.6.8": version: 1.8.0 resolution: "loglevel@npm:1.8.0" @@ -21623,6 +22124,13 @@ __metadata: languageName: node linkType: hard +"meow@npm:^13.0.0": + version: 13.2.0 + resolution: "meow@npm:13.2.0" + checksum: 10/4eff5bc921fed0b8a471ad79069d741a0210036d717547d0c7f36fdaf84ef7a3036225f38b6a53830d84dc9cbf8b944b097fde62381b8b5b215119e735ce1063 + languageName: node + linkType: hard + "meow@npm:^8.1.2": version: 8.1.2 resolution: "meow@npm:8.1.2" @@ -21779,7 +22287,7 @@ __metadata: languageName: node linkType: hard -"micromatch@npm:4.0.8": +"micromatch@npm:4.0.8, micromatch@npm:~4.0.8": version: 4.0.8 resolution: "micromatch@npm:4.0.8" dependencies: @@ -21810,7 +22318,7 @@ __metadata: languageName: node linkType: hard -"micromatch@npm:^4.0.0, micromatch@npm:^4.0.2, micromatch@npm:^4.0.4, micromatch@npm:^4.0.5": +"micromatch@npm:^4.0.0, micromatch@npm:^4.0.2, micromatch@npm:^4.0.4": version: 4.0.5 resolution: "micromatch@npm:4.0.5" dependencies: @@ -21852,7 +22360,7 @@ __metadata: languageName: node linkType: hard -"mime@npm:^2.5.0": +"mime@npm:2.6.0": version: 2.6.0 resolution: "mime@npm:2.6.0" bin: @@ -21900,6 +22408,13 @@ __metadata: languageName: node linkType: hard +"mimic-function@npm:^5.0.0": + version: 5.0.1 + resolution: "mimic-function@npm:5.0.1" + checksum: 10/eb5893c99e902ccebbc267c6c6b83092966af84682957f79313311edb95e8bb5f39fb048d77132b700474d1c86d90ccc211e99bae0935447a4834eb4c882982c + languageName: node + linkType: hard + "mimic-response@npm:^3.1.0": version: 3.1.0 resolution: "mimic-response@npm:3.1.0" @@ -21937,7 +22452,7 @@ __metadata: languageName: node linkType: hard -"minimatch@npm:3.0.x, minimatch@npm:~3.0.3": +"minimatch@npm:3.0.x": version: 3.0.8 resolution: "minimatch@npm:3.0.8" dependencies: @@ -22221,7 +22736,7 @@ __metadata: languageName: node linkType: hard -"mlly@npm:^1.4.2, mlly@npm:^1.7.1": +"mlly@npm:^1.7.1": version: 1.7.1 resolution: "mlly@npm:1.7.1" dependencies: @@ -22462,7 +22977,7 @@ __metadata: languageName: node linkType: hard -"ms@npm:2.1.3, ms@npm:^2.0.0, ms@npm:^2.1.1, ms@npm:^2.1.2": +"ms@npm:2.1.3, ms@npm:^2.0.0, ms@npm:^2.1.1, ms@npm:^2.1.2, ms@npm:^2.1.3": version: 2.1.3 resolution: "ms@npm:2.1.3" checksum: 10/aa92de608021b242401676e35cfa5aa42dd70cbdc082b916da7fb925c542173e36bce97ea3e804923fe92c0ad991434e4a38327e15a1b5b5f945d66df615ae6d @@ -22519,13 +23034,6 @@ __metadata: languageName: node linkType: hard -"muggle-string@npm:^0.4.1": - version: 0.4.1 - resolution: "muggle-string@npm:0.4.1" - checksum: 10/8fa2ea08f497c04069718bd3fd1909b382114dacbad832d10967ca72690de43f5f8492d8ccfbf827d6be63868ed5fc10395e7b7c082aa95997eea498586c6620 - languageName: node - linkType: hard - "multer@npm:^1.4.5-lts.1": version: 1.4.5-lts.1 resolution: "multer@npm:1.4.5-lts.1" @@ -22660,13 +23168,6 @@ __metadata: languageName: node linkType: hard -"natural-compare-lite@npm:^1.4.0": - version: 1.4.0 - resolution: "natural-compare-lite@npm:1.4.0" - checksum: 10/5222ac3986a2b78dd6069ac62cbb52a7bf8ffc90d972ab76dfe7b01892485d229530ed20d0c62e79a6b363a663b273db3bde195a1358ce9e5f779d4453887225 - languageName: node - linkType: hard - "natural-compare@npm:^1.4.0": version: 1.4.0 resolution: "natural-compare@npm:1.4.0" @@ -23278,6 +23779,16 @@ __metadata: languageName: node linkType: hard +"npm-run-path@npm:^6.0.0": + version: 6.0.0 + resolution: "npm-run-path@npm:6.0.0" + dependencies: + path-key: "npm:^4.0.0" + unicorn-magic: "npm:^0.3.0" + checksum: 10/1a1b50aba6e6af7fd34a860ba2e252e245c4a59b316571a990356417c0cdf0414cabf735f7f52d9c330899cb56f0ab804a8e21fb12a66d53d7843e39ada4a3b6 + languageName: node + linkType: hard + "npm-user-validate@npm:^2.0.0": version: 2.0.0 resolution: "npm-user-validate@npm:2.0.0" @@ -23601,10 +24112,10 @@ __metadata: languageName: node linkType: hard -"object-inspect@npm:^1.12.2": - version: 1.13.1 - resolution: "object-inspect@npm:1.13.1" - checksum: 10/92f4989ed83422d56431bc39656d4c780348eb15d397ce352ade6b7fec08f973b53744bd41b94af021901e61acaf78fcc19e65bf464ecc0df958586a672700f0 +"object-inspect@npm:^1.13.1": + version: 1.13.2 + resolution: "object-inspect@npm:1.13.2" + checksum: 10/7ef65583b6397570a17c56f0c1841e0920e83900f2c94638927abb7b81ac08a19c7aae135bd9dcca96208cac0c7332b4650fb927f027b0cf92d71df2990d0561 languageName: node linkType: hard @@ -23743,7 +24254,7 @@ __metadata: languageName: node linkType: hard -"once@npm:1.4.0, once@npm:^1.3.0, once@npm:^1.3.1, once@npm:^1.4.0": +"once@npm:^1.3.0, once@npm:^1.3.1, once@npm:^1.4.0": version: 1.4.0 resolution: "once@npm:1.4.0" dependencies: @@ -23779,6 +24290,15 @@ __metadata: languageName: node linkType: hard +"onetime@npm:^7.0.0": + version: 7.0.0 + resolution: "onetime@npm:7.0.0" + dependencies: + mimic-function: "npm:^5.0.0" + checksum: 10/eb08d2da9339819e2f9d52cab9caf2557d80e9af8c7d1ae86e1a0fef027d00a88e9f5bd67494d350df360f7c559fbb44e800b32f310fb989c860214eacbb561c + languageName: node + linkType: hard + "only@npm:~0.0.2": version: 0.0.2 resolution: "only@npm:0.0.2" @@ -23875,6 +24395,48 @@ __metadata: languageName: node linkType: hard +"oxc-resolver@npm:^1.10.2": + version: 1.11.0 + resolution: "oxc-resolver@npm:1.11.0" + dependencies: + "@oxc-resolver/binding-darwin-arm64": "npm:1.11.0" + "@oxc-resolver/binding-darwin-x64": "npm:1.11.0" + "@oxc-resolver/binding-freebsd-x64": "npm:1.11.0" + "@oxc-resolver/binding-linux-arm-gnueabihf": "npm:1.11.0" + "@oxc-resolver/binding-linux-arm64-gnu": "npm:1.11.0" + "@oxc-resolver/binding-linux-arm64-musl": "npm:1.11.0" + "@oxc-resolver/binding-linux-x64-gnu": "npm:1.11.0" + "@oxc-resolver/binding-linux-x64-musl": "npm:1.11.0" + "@oxc-resolver/binding-wasm32-wasi": "npm:1.11.0" + "@oxc-resolver/binding-win32-arm64-msvc": "npm:1.11.0" + "@oxc-resolver/binding-win32-x64-msvc": "npm:1.11.0" + dependenciesMeta: + "@oxc-resolver/binding-darwin-arm64": + optional: true + "@oxc-resolver/binding-darwin-x64": + optional: true + "@oxc-resolver/binding-freebsd-x64": + optional: true + "@oxc-resolver/binding-linux-arm-gnueabihf": + optional: true + "@oxc-resolver/binding-linux-arm64-gnu": + optional: true + "@oxc-resolver/binding-linux-arm64-musl": + optional: true + "@oxc-resolver/binding-linux-x64-gnu": + optional: true + "@oxc-resolver/binding-linux-x64-musl": + optional: true + "@oxc-resolver/binding-wasm32-wasi": + optional: true + "@oxc-resolver/binding-win32-arm64-msvc": + optional: true + "@oxc-resolver/binding-win32-x64-msvc": + optional: true + checksum: 10/b6096c176a8aec362bb39a0942aa3a6d05f9dc57fc12d5439b4e10e275ed0bc3e3522988256c9333e4f4d9edd228f7c79f1bd661903ee8b191802c9501db7c86 + languageName: node + linkType: hard + "p-cancelable@npm:^3.0.0": version: 3.0.0 resolution: "p-cancelable@npm:3.0.0" @@ -24282,6 +24844,13 @@ __metadata: languageName: node linkType: hard +"parse-ms@npm:^4.0.0": + version: 4.0.0 + resolution: "parse-ms@npm:4.0.0" + checksum: 10/673c801d9f957ff79962d71ed5a24850163f4181a90dd30c4e3666b3a804f53b77f1f0556792e8b2adbb5d58757907d1aa51d7d7dc75997c2a56d72937cbc8b7 + languageName: node + linkType: hard + "parse-node-version@npm:^1.0.0": version: 1.0.1 resolution: "parse-node-version@npm:1.0.1" @@ -24597,6 +25166,13 @@ __metadata: languageName: node linkType: hard +"picocolors@npm:^1.1.0": + version: 1.1.0 + resolution: "picocolors@npm:1.1.0" + checksum: 10/a2ad60d94d185c30f2a140b19c512547713fb89b920d32cc6cf658fa786d63a37ba7b8451872c3d9fc34883971fb6e5878e07a20b60506e0bb2554dce9169ccb + languageName: node + linkType: hard + "picomatch-browser@npm:^2.2.6": version: 2.2.6 resolution: "picomatch-browser@npm:2.2.6" @@ -24611,12 +25187,12 @@ __metadata: languageName: node linkType: hard -"pidtree@npm:^0.5.0": - version: 0.5.0 - resolution: "pidtree@npm:0.5.0" +"pidtree@npm:~0.6.0": + version: 0.6.0 + resolution: "pidtree@npm:0.6.0" bin: pidtree: bin/pidtree.js - checksum: 10/72a5d75c345d7b1ed1f30ff50342d601040334be50f9cad1d6d7457f1ad7bbaacccb037667f4088ca2c257a574eeb00f03664bbd05c5e7d02e3feb1bc77ddbd3 + checksum: 10/ea67fb3159e170fd069020e0108ba7712df9f0fd13c8db9b2286762856ddce414fb33932e08df4bfe36e91fe860b51852aee49a6f56eb4714b69634343add5df languageName: node linkType: hard @@ -24648,7 +25224,7 @@ __metadata: languageName: node linkType: hard -"pirates@npm:^4.0.5": +"pirates@npm:^4.0.6": version: 4.0.6 resolution: "pirates@npm:4.0.6" checksum: 10/d02dda76f4fec1cbdf395c36c11cf26f76a644f9f9a1bfa84d3167d0d3154d5289aacc72677aa20d599bb4a6937a471de1b65c995e2aea2d8687cbcd7e43ea5f @@ -24727,6 +25303,17 @@ __metadata: languageName: node linkType: hard +"postcss@npm:^8.4.43": + version: 8.4.47 + resolution: "postcss@npm:8.4.47" + dependencies: + nanoid: "npm:^3.3.7" + picocolors: "npm:^1.1.0" + source-map-js: "npm:^1.2.1" + checksum: 10/f2b50ba9b6fcb795232b6bb20de7cdc538c0025989a8ed9c4438d1960196ba3b7eaff41fdb1a5c701b3504651ea87aeb685577707f0ae4d6ce6f3eae5df79a81 + languageName: node + linkType: hard + "prebuild-install@npm:^7.1.1": version: 7.1.2 resolution: "prebuild-install@npm:7.1.2" @@ -24765,12 +25352,12 @@ __metadata: languageName: node linkType: hard -"prettier@npm:3.2.5": - version: 3.2.5 - resolution: "prettier@npm:3.2.5" +"prettier@npm:3.3.3": + version: 3.3.3 + resolution: "prettier@npm:3.3.3" bin: prettier: bin/prettier.cjs - checksum: 10/d509f9da0b70e8cacc561a1911c0d99ec75117faed27b95cc8534cb2349667dee6351b0ca83fa9d5703f14127faa52b798de40f5705f02d843da133fc3aa416a + checksum: 10/5beac1f30b5b40162532b8e2f7c3a4eb650910a2695e9c8512a62ffdc09dae93190c29db9107fa7f26d1b6c71aad3628ecb9b5de1ecb0911191099be109434d7 languageName: node linkType: hard @@ -24795,6 +25382,15 @@ __metadata: languageName: node linkType: hard +"pretty-ms@npm:^9.0.0": + version: 9.1.0 + resolution: "pretty-ms@npm:9.1.0" + dependencies: + parse-ms: "npm:^4.0.0" + checksum: 10/3622a8999e4b2aa05ff64bf48c7e58143b3ede6e3434f8ce5588def90ebcf6af98edf79532344c4c9e14d5ad25deb3f0f5ca9f9b91e5d2d1ac26dad9cf428fc0 + languageName: node + linkType: hard + "prisma@npm:^4.16.2": version: 4.16.2 resolution: "prisma@npm:4.16.2" @@ -25161,20 +25757,20 @@ __metadata: languageName: node linkType: hard -"punycode@npm:^2.1.0, punycode@npm:^2.1.1": - version: 2.1.1 - resolution: "punycode@npm:2.1.1" - checksum: 10/939daa010c2cacebdb060c40ecb52fef0a739324a66f7fffe0f94353a1ee83e3b455e9032054c4a0c4977b0a28e27086f2171c392832b59a01bd948fd8e20914 - languageName: node - linkType: hard - -"punycode@npm:^2.3.0": +"punycode@npm:^2.1.0, punycode@npm:^2.3.0": version: 2.3.1 resolution: "punycode@npm:2.3.1" checksum: 10/febdc4362bead22f9e2608ff0171713230b57aff9dddc1c273aa2a651fbd366f94b7d6a71d78342a7c0819906750351ca7f2edd26ea41b626d87d6a13d1bd059 languageName: node linkType: hard +"punycode@npm:^2.1.1": + version: 2.1.1 + resolution: "punycode@npm:2.1.1" + checksum: 10/939daa010c2cacebdb060c40ecb52fef0a739324a66f7fffe0f94353a1ee83e3b455e9032054c4a0c4977b0a28e27086f2171c392832b59a01bd948fd8e20914 + languageName: node + linkType: hard + "q@npm:^1.5.0": version: 1.5.1 resolution: "q@npm:1.5.1" @@ -25191,7 +25787,7 @@ __metadata: languageName: node linkType: hard -"qs@npm:6.11.0, qs@npm:^6.10.1, qs@npm:^6.9.4": +"qs@npm:6.11.0, qs@npm:^6.9.4": version: 6.11.0 resolution: "qs@npm:6.11.0" dependencies: @@ -25200,13 +25796,6 @@ __metadata: languageName: node linkType: hard -"qs@npm:6.9.3": - version: 6.9.3 - resolution: "qs@npm:6.9.3" - checksum: 10/259d06d089c3c677c40533f60b6434d168712c18d304319a7aa6d371a7bc0b029e98fe8fb2e768f0fd371f92891e4314ddedfe3f14a9b9ff5d98ef460dd8d309 - languageName: node - linkType: hard - "qs@npm:^6.10.3, qs@npm:^6.5.2": version: 6.10.3 resolution: "qs@npm:6.10.3" @@ -25216,6 +25805,15 @@ __metadata: languageName: node linkType: hard +"qs@npm:^6.11.0": + version: 6.13.0 + resolution: "qs@npm:6.13.0" + dependencies: + side-channel: "npm:^1.0.6" + checksum: 10/f548b376e685553d12e461409f0d6e5c59ec7c7d76f308e2a888fd9db3e0c5e89902bedd0754db3a9038eda5f27da2331a6f019c8517dc5e0a16b3c9a6e9cef8 + languageName: node + linkType: hard + "queue-microtask@npm:^1.2.2": version: 1.2.3 resolution: "queue-microtask@npm:1.2.3" @@ -25424,6 +26022,17 @@ __metadata: languageName: node linkType: hard +"read-package-up@npm:^11.0.0": + version: 11.0.0 + resolution: "read-package-up@npm:11.0.0" + dependencies: + find-up-simple: "npm:^1.0.0" + read-pkg: "npm:^9.0.0" + type-fest: "npm:^4.6.0" + checksum: 10/535b7554d47fae5fb5c2e7aceebd48b5de4142cdfe7b21f942fa9a0f56db03d3b53cce298e19438e1149292279c285e6ba6722eca741d590fd242519c4bdbc17 + languageName: node + linkType: hard + "read-pkg-up@npm:7.0.0": version: 7.0.0 resolution: "read-pkg-up@npm:7.0.0" @@ -25446,17 +26055,6 @@ __metadata: languageName: node linkType: hard -"read-pkg-up@npm:^11.0.0": - version: 11.0.0 - resolution: "read-pkg-up@npm:11.0.0" - dependencies: - find-up-simple: "npm:^1.0.0" - read-pkg: "npm:^9.0.0" - type-fest: "npm:^4.6.0" - checksum: 10/c08fe324a6d8cb3f1f4533074db8a4ef222c85af74bc30e7a98117c578e5d6b2dd8868fded660386167c95ffaf5d566f95743a621581df332573bc989c19cf45 - languageName: node - linkType: hard - "read-pkg-up@npm:^3.0.0": version: 3.0.0 resolution: "read-pkg-up@npm:3.0.0" @@ -25963,19 +26561,6 @@ __metadata: languageName: node linkType: hard -"resolve@npm:~1.22.1, resolve@npm:~1.22.2": - version: 1.22.8 - resolution: "resolve@npm:1.22.8" - dependencies: - is-core-module: "npm:^2.13.0" - path-parse: "npm:^1.0.7" - supports-preserve-symlinks-flag: "npm:^1.0.0" - bin: - resolve: bin/resolve - checksum: 10/c473506ee01eb45cbcfefb68652ae5759e092e6b0fb64547feadf9736a6394f258fbc6f88e00c5ca36d5477fbb65388b272432a3600fa223062e54333c156753 - languageName: node - linkType: hard - "resolve@patch:resolve@npm%3A1.22.2#optional!builtin": version: 1.22.2 resolution: "resolve@patch:resolve@npm%3A1.22.2#optional!builtin::version=1.22.2&hash=c3c19d" @@ -26002,19 +26587,6 @@ __metadata: languageName: node linkType: hard -"resolve@patch:resolve@npm%3A~1.22.1#optional!builtin, resolve@patch:resolve@npm%3A~1.22.2#optional!builtin": - version: 1.22.8 - resolution: "resolve@patch:resolve@npm%3A1.22.8#optional!builtin::version=1.22.8&hash=c3c19d" - dependencies: - is-core-module: "npm:^2.13.0" - path-parse: "npm:^1.0.7" - supports-preserve-symlinks-flag: "npm:^1.0.0" - bin: - resolve: bin/resolve - checksum: 10/f345cd37f56a2c0275e3fe062517c650bb673815d885e7507566df589375d165bbbf4bdb6aa95600a9bc55f4744b81f452b5a63f95b9f10a72787dba3c90890a - languageName: node - linkType: hard - "resourcejs@npm:^2.5.0": version: 2.6.0 resolution: "resourcejs@npm:2.6.0" @@ -26071,6 +26643,16 @@ __metadata: languageName: node linkType: hard +"restore-cursor@npm:^5.0.0": + version: 5.1.0 + resolution: "restore-cursor@npm:5.1.0" + dependencies: + onetime: "npm:^7.0.0" + signal-exit: "npm:^4.1.0" + checksum: 10/838dd54e458d89cfbc1a923b343c1b0f170a04100b4ce1733e97531842d7b440463967e521216e8ab6c6f8e89df877acc7b7f4c18ec76e99fb9bf5a60d358d2c + languageName: node + linkType: hard + "ret@npm:~0.1.10": version: 0.1.15 resolution: "ret@npm:0.1.15" @@ -26113,13 +26695,6 @@ __metadata: languageName: node linkType: hard -"rfdc@npm:^1.3.0": - version: 1.3.0 - resolution: "rfdc@npm:1.3.0" - checksum: 10/76dedd9700cdf132947fde7ce1a8838c9cbb7f3e8f9188af0aaf97194cce745f42094dd2cf547426934cc83252ee2c0e432b2e0222a4415ab0db32de82665c69 - languageName: node - linkType: hard - "rfdc@npm:^1.3.1": version: 1.3.1 resolution: "rfdc@npm:1.3.1" @@ -26127,6 +26702,13 @@ __metadata: languageName: node linkType: hard +"rfdc@npm:^1.4.1": + version: 1.4.1 + resolution: "rfdc@npm:1.4.1" + checksum: 10/2f3d11d3d8929b4bfeefc9acb03aae90f971401de0add5ae6c5e38fec14f0405e6a4aad8fdb76344bfdd20c5193110e3750cbbd28ba86d73729d222b6cf4a729 + languageName: node + linkType: hard + "right-align@npm:^0.1.1": version: 0.1.3 resolution: "right-align@npm:0.1.3" @@ -26232,6 +26814,69 @@ __metadata: languageName: node linkType: hard +"rollup@npm:^4.20.0": + version: 4.22.4 + resolution: "rollup@npm:4.22.4" + dependencies: + "@rollup/rollup-android-arm-eabi": "npm:4.22.4" + "@rollup/rollup-android-arm64": "npm:4.22.4" + "@rollup/rollup-darwin-arm64": "npm:4.22.4" + "@rollup/rollup-darwin-x64": "npm:4.22.4" + "@rollup/rollup-linux-arm-gnueabihf": "npm:4.22.4" + "@rollup/rollup-linux-arm-musleabihf": "npm:4.22.4" + "@rollup/rollup-linux-arm64-gnu": "npm:4.22.4" + "@rollup/rollup-linux-arm64-musl": "npm:4.22.4" + "@rollup/rollup-linux-powerpc64le-gnu": "npm:4.22.4" + "@rollup/rollup-linux-riscv64-gnu": "npm:4.22.4" + "@rollup/rollup-linux-s390x-gnu": "npm:4.22.4" + "@rollup/rollup-linux-x64-gnu": "npm:4.22.4" + "@rollup/rollup-linux-x64-musl": "npm:4.22.4" + "@rollup/rollup-win32-arm64-msvc": "npm:4.22.4" + "@rollup/rollup-win32-ia32-msvc": "npm:4.22.4" + "@rollup/rollup-win32-x64-msvc": "npm:4.22.4" + "@types/estree": "npm:1.0.5" + fsevents: "npm:~2.3.2" + dependenciesMeta: + "@rollup/rollup-android-arm-eabi": + optional: true + "@rollup/rollup-android-arm64": + optional: true + "@rollup/rollup-darwin-arm64": + optional: true + "@rollup/rollup-darwin-x64": + optional: true + "@rollup/rollup-linux-arm-gnueabihf": + optional: true + "@rollup/rollup-linux-arm-musleabihf": + optional: true + "@rollup/rollup-linux-arm64-gnu": + optional: true + "@rollup/rollup-linux-arm64-musl": + optional: true + "@rollup/rollup-linux-powerpc64le-gnu": + optional: true + "@rollup/rollup-linux-riscv64-gnu": + optional: true + "@rollup/rollup-linux-s390x-gnu": + optional: true + "@rollup/rollup-linux-x64-gnu": + optional: true + "@rollup/rollup-linux-x64-musl": + optional: true + "@rollup/rollup-win32-arm64-msvc": + optional: true + "@rollup/rollup-win32-ia32-msvc": + optional: true + "@rollup/rollup-win32-x64-msvc": + optional: true + fsevents: + optional: true + bin: + rollup: dist/bin/rollup + checksum: 10/0fbee8c14d9052624c76a09fe79ed4d46024832be3ceea86c69f1521ae84b581a64c6e6596fdd796030c206835987e1a0a3be85f4c0d35b71400be5dce799d12 + languageName: node + linkType: hard + "run-async@npm:^2.4.0": version: 2.4.1 resolution: "run-async@npm:2.4.1" @@ -26399,26 +27044,26 @@ __metadata: languageName: node linkType: hard -"semantic-release@npm:23.0.5": - version: 23.0.5 - resolution: "semantic-release@npm:23.0.5" +"semantic-release@npm:24.1.1": + version: 24.1.1 + resolution: "semantic-release@npm:24.1.1" dependencies: - "@semantic-release/commit-analyzer": "npm:^12.0.0" + "@semantic-release/commit-analyzer": "npm:^13.0.0-beta.1" "@semantic-release/error": "npm:^4.0.0" "@semantic-release/github": "npm:^10.0.0" "@semantic-release/npm": "npm:^12.0.0" - "@semantic-release/release-notes-generator": "npm:^12.0.0" + "@semantic-release/release-notes-generator": "npm:^14.0.0-beta.1" aggregate-error: "npm:^5.0.0" cosmiconfig: "npm:^9.0.0" debug: "npm:^4.0.0" env-ci: "npm:^11.0.0" - execa: "npm:^8.0.0" + execa: "npm:^9.0.0" figures: "npm:^6.0.0" - find-versions: "npm:^5.1.0" + find-versions: "npm:^6.0.0" get-stream: "npm:^6.0.0" git-log-parser: "npm:^1.2.0" hook-std: "npm:^3.0.0" - hosted-git-info: "npm:^7.0.0" + hosted-git-info: "npm:^8.0.0" import-from-esm: "npm:^1.3.1" lodash-es: "npm:^4.17.21" marked: "npm:^12.0.0" @@ -26426,7 +27071,7 @@ __metadata: micromatch: "npm:^4.0.2" p-each-series: "npm:^3.0.0" p-reduce: "npm:^3.0.0" - read-pkg-up: "npm:^11.0.0" + read-package-up: "npm:^11.0.0" resolve-from: "npm:^5.0.0" semver: "npm:^7.3.2" semver-diff: "npm:^4.0.0" @@ -26434,7 +27079,7 @@ __metadata: yargs: "npm:^17.5.1" bin: semantic-release: bin/semantic-release.js - checksum: 10/ced735ef120852db3708044b2356dfb884fe227573625a405920a646cfede0f5e758f987aefc125ea81f9b927372847c0f36ccc7bf67af4e1186bf729d6ede53 + checksum: 10/194a560c152755b95c50eb786ff98949e04fba1222c5c9312b0e847bd0c0bade291fda99469d4a36f1e790bfbc597f2fd5e4b32b7b1c3c82c6ba54297bec56a2 languageName: node linkType: hard @@ -26474,7 +27119,7 @@ __metadata: languageName: node linkType: hard -"semver@npm:>=7.5.4, semver@npm:^7.0.0, semver@npm:^7.1.1, semver@npm:^7.1.2, semver@npm:^7.3.2, semver@npm:^7.3.4, semver@npm:^7.3.5, semver@npm:^7.3.7, semver@npm:^7.3.8, semver@npm:^7.5.3, semver@npm:^7.5.4, semver@npm:~7.5.4": +"semver@npm:>=7.5.4, semver@npm:^7.0.0, semver@npm:^7.1.1, semver@npm:^7.1.2, semver@npm:^7.3.2, semver@npm:^7.3.4, semver@npm:^7.3.5, semver@npm:^7.3.7, semver@npm:^7.3.8, semver@npm:^7.5.3, semver@npm:^7.5.4": version: 7.5.4 resolution: "semver@npm:7.5.4" dependencies: @@ -26609,6 +27254,20 @@ __metadata: languageName: node linkType: hard +"set-function-length@npm:^1.2.1": + version: 1.2.2 + resolution: "set-function-length@npm:1.2.2" + dependencies: + define-data-property: "npm:^1.1.4" + es-errors: "npm:^1.3.0" + function-bind: "npm:^1.1.2" + get-intrinsic: "npm:^1.2.4" + gopd: "npm:^1.0.1" + has-property-descriptors: "npm:^1.0.2" + checksum: 10/505d62b8e088468917ca4e3f8f39d0e29f9a563b97dbebf92f4bd2c3172ccfb3c5b8e4566d5fcd00784a00433900e7cb8fbc404e2dbd8c3818ba05bb9d4a8a6d + languageName: node + linkType: hard + "set-value@npm:^2.0.0, set-value@npm:^2.0.1": version: 2.0.1 resolution: "set-value@npm:2.0.1" @@ -26690,6 +27349,18 @@ __metadata: languageName: node linkType: hard +"side-channel@npm:^1.0.6": + version: 1.0.6 + resolution: "side-channel@npm:1.0.6" + dependencies: + call-bind: "npm:^1.0.7" + es-errors: "npm:^1.3.0" + get-intrinsic: "npm:^1.2.4" + object-inspect: "npm:^1.13.1" + checksum: 10/eb10944f38cebad8ad643dd02657592fa41273ce15b8bfa928d3291aff2d30c20ff777cfe908f76ccc4551ace2d1245822fdc576657cce40e9066c638ca8fa4d + languageName: node + linkType: hard + "sift@npm:16.0.0": version: 16.0.0 resolution: "sift@npm:16.0.0" @@ -26871,17 +27542,6 @@ __metadata: languageName: node linkType: hard -"slice-ansi@npm:^4.0.0": - version: 4.0.0 - resolution: "slice-ansi@npm:4.0.0" - dependencies: - ansi-styles: "npm:^4.0.0" - astral-regex: "npm:^2.0.0" - is-fullwidth-code-point: "npm:^3.0.0" - checksum: 10/4a82d7f085b0e1b070e004941ada3c40d3818563ac44766cca4ceadd2080427d337554f9f99a13aaeb3b4a94d9964d9466c807b3d7b7541d1ec37ee32d308756 - languageName: node - linkType: hard - "slice-ansi@npm:^5.0.0": version: 5.0.0 resolution: "slice-ansi@npm:5.0.0" @@ -26892,7 +27552,7 @@ __metadata: languageName: node linkType: hard -"slice-ansi@npm:^7.0.0": +"slice-ansi@npm:^7.0.0, slice-ansi@npm:^7.1.0": version: 7.1.0 resolution: "slice-ansi@npm:7.1.0" dependencies: @@ -27103,6 +27763,13 @@ __metadata: languageName: node linkType: hard +"source-map-js@npm:^1.2.1": + version: 1.2.1 + resolution: "source-map-js@npm:1.2.1" + checksum: 10/ff9d8c8bf096d534a5b7707e0382ef827b4dd360a577d3f34d2b9f48e12c9d230b5747974ee7c607f0df65113732711bb701fe9ece3c7edbd43cb2294d707df3 + languageName: node + linkType: hard + "source-map-loader@npm:^4.0.0": version: 4.0.1 resolution: "source-map-loader@npm:4.0.1" @@ -27162,7 +27829,7 @@ __metadata: languageName: node linkType: hard -"source-map@npm:^0.6.0, source-map@npm:^0.6.1, source-map@npm:~0.6.0, source-map@npm:~0.6.1": +"source-map@npm:^0.6.0, source-map@npm:^0.6.1, source-map@npm:~0.6.0": version: 0.6.1 resolution: "source-map@npm:0.6.1" checksum: 10/59ef7462f1c29d502b3057e822cdbdae0b0e565302c4dd1a95e11e793d8d9d62006cdc10e0fd99163ca33ff2071360cf50ee13f90440806e7ed57d81cba2f7ff @@ -27597,14 +28264,7 @@ __metadata: languageName: node linkType: hard -"string-argv@npm:^0.3.1": - version: 0.3.1 - resolution: "string-argv@npm:0.3.1" - checksum: 10/47c637e3f47b3f5a6430036315e65564483fcf7745341d474943f0c2046f188681275fc1f2948db75c7a7e68134b1446e0dcceda60a7be1ee0c3fb026c0d90c4 - languageName: node - linkType: hard - -"string-argv@npm:~0.3.1": +"string-argv@npm:~0.3.2": version: 0.3.2 resolution: "string-argv@npm:0.3.2" checksum: 10/f9d3addf887026b4b5f997a271149e93bf71efc8692e7dc0816e8807f960b18bcb9787b45beedf0f97ff459575ee389af3f189d8b649834cac602f2e857e75af @@ -27650,7 +28310,7 @@ __metadata: languageName: node linkType: hard -"string-width@npm:^5.0.0, string-width@npm:^5.0.1, string-width@npm:^5.1.2": +"string-width@npm:^5.0.1, string-width@npm:^5.1.2": version: 5.1.2 resolution: "string-width@npm:5.1.2" dependencies: @@ -27790,6 +28450,13 @@ __metadata: languageName: node linkType: hard +"strip-final-newline@npm:^4.0.0": + version: 4.0.0 + resolution: "strip-final-newline@npm:4.0.0" + checksum: 10/b5fe48f695d74863153a3b3155220e6e9bf51f4447832998c8edec38e6559b3af87a9fe5ac0df95570a78a26f5fa91701358842eab3c15480e27980b154a145f + languageName: node + linkType: hard + "strip-indent@npm:3.0.0, strip-indent@npm:^3.0.0": version: 3.0.0 resolution: "strip-indent@npm:3.0.0" @@ -27799,7 +28466,7 @@ __metadata: languageName: node linkType: hard -"strip-json-comments@npm:^3.1.1, strip-json-comments@npm:~3.1.1": +"strip-json-comments@npm:^3.1.1": version: 3.1.1 resolution: "strip-json-comments@npm:3.1.1" checksum: 10/492f73e27268f9b1c122733f28ecb0e7e8d8a531a6662efbd08e22cccb3f9475e90a1b82cab06a392f6afae6d2de636f977e231296400d0ec5304ba70f166443 @@ -27880,6 +28547,16 @@ __metadata: languageName: node linkType: hard +"super-regex@npm:^1.0.0": + version: 1.0.0 + resolution: "super-regex@npm:1.0.0" + dependencies: + function-timeout: "npm:^1.0.1" + time-span: "npm:^5.1.0" + checksum: 10/d99e90ee0950356b86b01ad327605080e72ee0712c7e5c66335e7e4e3bd2919206caea929fa2d5ca97c2afc1d1ab91466d09eadcf1101196edcfb94bebfea388 + languageName: node + linkType: hard + "superagent-retry@npm:^0.6.0": version: 0.6.0 resolution: "superagent-retry@npm:0.6.0" @@ -27889,32 +28566,30 @@ __metadata: languageName: node linkType: hard -"superagent@npm:^7.1.0": - version: 7.1.2 - resolution: "superagent@npm:7.1.2" +"superagent@npm:^9.0.1": + version: 9.0.2 + resolution: "superagent@npm:9.0.2" dependencies: component-emitter: "npm:^1.3.0" - cookiejar: "npm:^2.1.3" - debug: "npm:^4.3.3" + cookiejar: "npm:^2.1.4" + debug: "npm:^4.3.4" fast-safe-stringify: "npm:^2.1.1" form-data: "npm:^4.0.0" - formidable: "npm:^2.0.1" + formidable: "npm:^3.5.1" methods: "npm:^1.1.2" - mime: "npm:^2.5.0" - qs: "npm:^6.10.1" - readable-stream: "npm:^3.6.0" - semver: "npm:^7.3.5" - checksum: 10/f4adb4439c63a2ca0571c3ec414a89411d3baa26ef3243b3e489df97fe8aa0b0e1927d149da29d467e799dc0fcb131c4dd44f35cf98e50ef7d487fc447217ddc + mime: "npm:2.6.0" + qs: "npm:^6.11.0" + checksum: 10/d3c0c9051ceec84d5b431eaa410ad81bcd53255cea57af1fc66d683a24c34f3ba4761b411072a9bf489a70e3d5b586a78a0e6f2eac6a561067e7d196ddab0907 languageName: node linkType: hard -"supertest@npm:6.2.2": - version: 6.2.2 - resolution: "supertest@npm:6.2.2" +"supertest@npm:7.0.0": + version: 7.0.0 + resolution: "supertest@npm:7.0.0" dependencies: methods: "npm:^1.1.2" - superagent: "npm:^7.1.0" - checksum: 10/5715b1fb684af65f54f8e0571026f851c9a2425b571ec2407fe693cd8b7a0bdeb4b0d3998ab8564048261a903441ac43c18566a9f17ebb0f4178e2225b3337db + superagent: "npm:^9.0.1" + checksum: 10/73bf2a37e13856a1b3e6a37b9df5cec8e506aa0360a5f5ecd989d1f4b0edf168883e306012e81e371d5252c17d4c7bef4ba30633dbf3877cbf52fc7af51cca9b languageName: node linkType: hard @@ -27943,7 +28618,7 @@ __metadata: languageName: node linkType: hard -"supports-color@npm:^8.0.0, supports-color@npm:^8.1.1, supports-color@npm:~8.1.1": +"supports-color@npm:^8.0.0, supports-color@npm:^8.1.1": version: 8.1.1 resolution: "supports-color@npm:8.1.1" dependencies: @@ -27952,7 +28627,7 @@ __metadata: languageName: node linkType: hard -"supports-color@npm:^9.2.2, supports-color@npm:^9.4.0": +"supports-color@npm:^9.4.0": version: 9.4.0 resolution: "supports-color@npm:9.4.0" checksum: 10/cb8ff8daeaf1db642156f69a9aa545b6c01dd9c4def4f90a49f46cbf24be0c245d392fcf37acd119cd1819b99dad2cc9b7e3260813f64bcfd7f5b18b5a1eefb8 @@ -28032,13 +28707,13 @@ __metadata: languageName: node linkType: hard -"synckit@npm:^0.8.6": - version: 0.8.8 - resolution: "synckit@npm:0.8.8" +"synckit@npm:^0.9.1": + version: 0.9.1 + resolution: "synckit@npm:0.9.1" dependencies: "@pkgr/core": "npm:^0.1.0" tslib: "npm:^2.6.2" - checksum: 10/2864a5c3e689ad5b991bebbd8a583c5682c4fa08a4f39986b510b6b5d160c08fc3672444069f8f96ed6a9d12772879c674c1f61e728573eadfa90af40a765b74 + checksum: 10/bff3903976baf8b699b5483228116d70223781a93b17c70e685c277ee960cdfd1a09cb5a741e6a9ec35e2428f14f4664baec41ccc99a598f267608b2a54f529b languageName: node linkType: hard @@ -28399,6 +29074,15 @@ __metadata: languageName: node linkType: hard +"time-span@npm:^5.1.0": + version: 5.1.0 + resolution: "time-span@npm:5.1.0" + dependencies: + convert-hrtime: "npm:^5.0.0" + checksum: 10/949c45fcb873f2d26fda3db1b7f7161ce65206f6e94a7c6c9bf3a5a07a373570dba57ca5c1f816efa6326adbc3f9e93bb6ef19a7a220f4259a917e1192d49418 + languageName: node + linkType: hard + "time-stamp@npm:^1.0.0": version: 1.1.0 resolution: "time-stamp@npm:1.1.0" @@ -28413,13 +29097,20 @@ __metadata: languageName: node linkType: hard -"tinybench@npm:^2.8.0": +"tinybench@npm:^2.8.0, tinybench@npm:^2.9.0": version: 2.9.0 resolution: "tinybench@npm:2.9.0" checksum: 10/cfa1e1418e91289219501703c4693c70708c91ffb7f040fd318d24aef419fb5a43e0c0160df9471499191968b2451d8da7f8087b08c3133c251c40d24aced06c languageName: node linkType: hard +"tinyexec@npm:^0.3.0": + version: 0.3.0 + resolution: "tinyexec@npm:0.3.0" + checksum: 10/317cc536d091ce7e50271287798d91ef53c4dc80088844d890752a2c7387d213004cba83e5e1d9129390ced617625e34f4a8f0ba5779e31c9b6939f9be0d3543 + languageName: node + linkType: hard + "tinyliquid@npm:^0.2.34": version: 0.2.34 resolution: "tinyliquid@npm:0.2.34" @@ -28631,6 +29322,15 @@ __metadata: languageName: node linkType: hard +"ts-api-utils@npm:^1.3.0": + version: 1.3.0 + resolution: "ts-api-utils@npm:1.3.0" + peerDependencies: + typescript: ">=4.2.0" + checksum: 10/3ee44faa24410cd649b5c864e068d438aa437ef64e9e4a66a41646a6d3024d3097a695eeb3fb26ee364705d3cb9653a65756d009e6a53badb6066a5f447bf7ed + languageName: node + linkType: hard + "ts-invariant@npm:^0.4.0": version: 0.4.4 resolution: "ts-invariant@npm:0.4.4" @@ -28640,18 +29340,19 @@ __metadata: languageName: node linkType: hard -"ts-loader@npm:^9.4.2": - version: 9.4.2 - resolution: "ts-loader@npm:9.4.2" +"ts-loader@npm:9.5.1": + version: 9.5.1 + resolution: "ts-loader@npm:9.5.1" dependencies: chalk: "npm:^4.1.0" enhanced-resolve: "npm:^5.0.0" micromatch: "npm:^4.0.0" semver: "npm:^7.3.4" + source-map: "npm:^0.7.4" peerDependencies: typescript: "*" webpack: ^5.0.0 - checksum: 10/6779ca2627f36c2ffbaf62c20eba8aa420e39b33dfbb7ea03ee84e97010b3139fe63bda7d37117dcd08b2be2235684d8e4971750e5c92441af18dac8b18907c3 + checksum: 10/a85d43bb6f72858d613290ac02d1d24e81c38ba2dcb98b90465dc97eb6c2036bf9a389542c1a7865548643e7ed39f063fdff2dbb3e5aafbc511de6a3eb275adf languageName: node linkType: hard @@ -28751,20 +29452,20 @@ __metadata: languageName: node linkType: hard -"tslib@npm:^1.10.0, tslib@npm:^1.11.1, tslib@npm:^1.8.1, tslib@npm:^1.9.0, tslib@npm:^1.9.3": - version: 1.14.1 - resolution: "tslib@npm:1.14.1" - checksum: 10/7dbf34e6f55c6492637adb81b555af5e3b4f9cc6b998fb440dac82d3b42bdc91560a35a5fb75e20e24a076c651438234da6743d139e4feabf0783f3cdfe1dddb - languageName: node - linkType: hard - -"tslib@npm:^2.5.2, tslib@npm:^2.6.3": +"tslib@npm:2.7.0, tslib@npm:^2.5.2, tslib@npm:^2.6.3": version: 2.7.0 resolution: "tslib@npm:2.7.0" checksum: 10/9a5b47ddac65874fa011c20ff76db69f97cf90c78cff5934799ab8894a5342db2d17b4e7613a087046bc1d133d21547ddff87ac558abeec31ffa929c88b7fce6 languageName: node linkType: hard +"tslib@npm:^1.10.0, tslib@npm:^1.11.1, tslib@npm:^1.9.0, tslib@npm:^1.9.3": + version: 1.14.1 + resolution: "tslib@npm:1.14.1" + checksum: 10/7dbf34e6f55c6492637adb81b555af5e3b4f9cc6b998fb440dac82d3b42bdc91560a35a5fb75e20e24a076c651438234da6743d139e4feabf0783f3cdfe1dddb + languageName: node + linkType: hard + "tsscmp@npm:1.0.6": version: 1.0.6 resolution: "tsscmp@npm:1.0.6" @@ -28772,17 +29473,6 @@ __metadata: languageName: node linkType: hard -"tsutils@npm:^3.21.0": - version: 3.21.0 - resolution: "tsutils@npm:3.21.0" - dependencies: - tslib: "npm:^1.8.1" - peerDependencies: - typescript: ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" - checksum: 10/ea036bec1dd024e309939ffd49fda7a351c0e87a1b8eb049570dd119d447250e2c56e0e6c00554e8205760e7417793fdebff752a46e573fbe07d4f375502a5b2 - languageName: node - linkType: hard - "tuf-js@npm:^1.1.7": version: 1.1.7 resolution: "tuf-js@npm:1.1.7" @@ -28949,7 +29639,7 @@ __metadata: languageName: node linkType: hard -"type-fest@npm:^3.0.0, type-fest@npm:^3.2.0": +"type-fest@npm:^3.0.0": version: 3.13.1 resolution: "type-fest@npm:3.13.1" checksum: 10/9a8a2359ada34c9b3affcaf3a8f73ee14c52779e89950db337ce66fb74c3399776c697c99f2532e9b16e10e61cfdba3b1c19daffb93b338b742f0acd0117ce12 @@ -29017,23 +29707,13 @@ __metadata: languageName: node linkType: hard -"typescript@npm:4.9.5": - version: 4.9.5 - resolution: "typescript@npm:4.9.5" - bin: - tsc: bin/tsc - tsserver: bin/tsserver - checksum: 10/458f7220ab11e0fc191514cc41be1707645ec9a8c2d609448a448e18c522cef9646f58728f6811185a4c35613dacdf6c98cf8965c88b3541d0288c47291e4300 - languageName: node - linkType: hard - -"typescript@npm:5.4.2": - version: 5.4.2 - resolution: "typescript@npm:5.4.2" +"typescript@npm:5.6.2": + version: 5.6.2 + resolution: "typescript@npm:5.6.2" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: 10/f8cfdc630ab1672f004e9561eb2916935b2d267792d07ce93e97fc601c7a65191af32033d5e9c0169b7dc37da7db9bf320f7432bc84527cb7697effaa4e4559d + checksum: 10/f95365d4898f357823e93d334ecda9fcade54f009b397c7d05b7621cd9e865981033cf89ccde0f3e3a7b73b1fdbae18e92bc77db237b43e912f053fef0f9a53b languageName: node linkType: hard @@ -29057,23 +29737,13 @@ __metadata: languageName: node linkType: hard -"typescript@patch:typescript@npm%3A4.9.5#optional!builtin": - version: 4.9.5 - resolution: "typescript@patch:typescript@npm%3A4.9.5#optional!builtin::version=4.9.5&hash=289587" - bin: - tsc: bin/tsc - tsserver: bin/tsserver - checksum: 10/5659316360b5cc2d6f5931b346401fa534107b68b60179cf14970e27978f0936c1d5c46f4b5b8175f8cba0430f522b3ce355b4b724c0ea36ce6c0347fab25afd - languageName: node - linkType: hard - -"typescript@patch:typescript@npm%3A5.4.2#optional!builtin": - version: 5.4.2 - resolution: "typescript@patch:typescript@npm%3A5.4.2#optional!builtin::version=5.4.2&hash=d69c25" +"typescript@patch:typescript@npm%3A5.6.2#optional!builtin": + version: 5.6.2 + resolution: "typescript@patch:typescript@npm%3A5.6.2#optional!builtin::version=5.6.2&hash=d69c25" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: 10/ef4fc2994cc0219dc9ada94c92106ba8d44cbfd7a0328ed6f8d730311caf66e114cdfa07fbc6f369bfc0fc182d9493851b3bf1644c06fc5818690b19ee960d72 + checksum: 10/060a7349adf698477b411be4ace470aee6c2c1bd99917fdf5d33697c17ec55c64fe724eb10399387530b50e9913b41528dd8bfcca0a5fc8f8bac63fbb4580a2e languageName: node linkType: hard @@ -29183,6 +29853,13 @@ __metadata: languageName: node linkType: hard +"undici-types@npm:~6.19.2": + version: 6.19.8 + resolution: "undici-types@npm:6.19.8" + checksum: 10/cf0b48ed4fc99baf56584afa91aaffa5010c268b8842f62e02f752df209e3dea138b372a60a963b3b2576ed932f32329ce7ddb9cb5f27a6c83040d8cd74b7a70 + languageName: node + linkType: hard + "undici@npm:^4.13.0": version: 4.16.0 resolution: "undici@npm:4.16.0" @@ -29244,6 +29921,13 @@ __metadata: languageName: node linkType: hard +"unicorn-magic@npm:^0.3.0": + version: 0.3.0 + resolution: "unicorn-magic@npm:0.3.0" + checksum: 10/bdd7d7c522f9456f32a0b77af23f8854f9a7db846088c3868ec213f9550683ab6a2bdf3803577eacbafddb4e06900974385841ccb75338d17346ccef45f9cb01 + languageName: node + linkType: hard + "unified@npm:^9.0.0": version: 9.2.2 resolution: "unified@npm:9.2.2" @@ -29414,7 +30098,7 @@ __metadata: languageName: node linkType: hard -"unplugin-swc@npm:^1.5.1": +"unplugin-swc@npm:1.5.1": version: 1.5.1 resolution: "unplugin-swc@npm:1.5.1" dependencies: @@ -29518,7 +30202,7 @@ __metadata: languageName: node linkType: hard -"uri-js@npm:^4.2.2, uri-js@npm:^4.4.1": +"uri-js@npm:^4.2.2": version: 4.4.1 resolution: "uri-js@npm:4.4.1" dependencies: @@ -29810,27 +30494,17 @@ __metadata: languageName: node linkType: hard -"vite-plugin-dts@npm:^4.0.3": - version: 4.0.3 - resolution: "vite-plugin-dts@npm:4.0.3" +"vite-node@npm:2.1.1": + version: 2.1.1 + resolution: "vite-node@npm:2.1.1" dependencies: - "@microsoft/api-extractor": "npm:7.47.4" - "@rollup/pluginutils": "npm:^5.1.0" - "@volar/typescript": "npm:^2.3.4" - "@vue/language-core": "npm:2.0.29" - compare-versions: "npm:^6.1.1" + cac: "npm:^6.7.14" debug: "npm:^4.3.6" - kolorist: "npm:^1.8.0" - local-pkg: "npm:^0.5.0" - magic-string: "npm:^0.30.11" - vue-tsc: "npm:2.0.29" - peerDependencies: - typescript: "*" - vite: "*" - peerDependenciesMeta: - vite: - optional: true - checksum: 10/996603ffe81d5264da862ebcc85e05e09e1251fc456841e3f7233c4ae243c699d29889f3206be72b01873527d85beeaa4fcbacc61e31a71a5cab02fdb1d03e0d + pathe: "npm:^1.1.2" + vite: "npm:^5.0.0" + bin: + vite-node: vite-node.mjs + checksum: 10/c21892b560cad87414ef774d7e53b207e8d66b511b7ef085940fd2f2160d8f6c42dfa9af2ef5465e775b767fc3312ec5b3418b898041f592b8e0b093b4b7110a languageName: node linkType: hard @@ -29877,6 +30551,49 @@ __metadata: languageName: node linkType: hard +"vite@npm:5.4.7": + version: 5.4.7 + resolution: "vite@npm:5.4.7" + dependencies: + esbuild: "npm:^0.21.3" + fsevents: "npm:~2.3.3" + postcss: "npm:^8.4.43" + rollup: "npm:^4.20.0" + peerDependencies: + "@types/node": ^18.0.0 || >=20.0.0 + less: "*" + lightningcss: ^1.21.0 + sass: "*" + sass-embedded: "*" + stylus: "*" + sugarss: "*" + terser: ^5.4.0 + dependenciesMeta: + fsevents: + optional: true + peerDependenciesMeta: + "@types/node": + optional: true + less: + optional: true + lightningcss: + optional: true + sass: + optional: true + sass-embedded: + optional: true + stylus: + optional: true + sugarss: + optional: true + terser: + optional: true + bin: + vite: bin/vite.js + checksum: 10/3f27e870930ad83b51e009604c6b69ab090e69bb5bfe85007c7e4ec3326efae4e33ac799645926363f258595b3be3055cc1ebc5ee158cff4bacdf41adf4ef8ed + languageName: node + linkType: hard + "vitest@npm:2.0.4": version: 2.0.4 resolution: "vitest@npm:2.0.4" @@ -29975,6 +30692,55 @@ __metadata: languageName: node linkType: hard +"vitest@npm:2.1.1": + version: 2.1.1 + resolution: "vitest@npm:2.1.1" + dependencies: + "@vitest/expect": "npm:2.1.1" + "@vitest/mocker": "npm:2.1.1" + "@vitest/pretty-format": "npm:^2.1.1" + "@vitest/runner": "npm:2.1.1" + "@vitest/snapshot": "npm:2.1.1" + "@vitest/spy": "npm:2.1.1" + "@vitest/utils": "npm:2.1.1" + chai: "npm:^5.1.1" + debug: "npm:^4.3.6" + magic-string: "npm:^0.30.11" + pathe: "npm:^1.1.2" + std-env: "npm:^3.7.0" + tinybench: "npm:^2.9.0" + tinyexec: "npm:^0.3.0" + tinypool: "npm:^1.0.0" + tinyrainbow: "npm:^1.2.0" + vite: "npm:^5.0.0" + vite-node: "npm:2.1.1" + why-is-node-running: "npm:^2.3.0" + peerDependencies: + "@edge-runtime/vm": "*" + "@types/node": ^18.0.0 || >=20.0.0 + "@vitest/browser": 2.1.1 + "@vitest/ui": 2.1.1 + happy-dom: "*" + jsdom: "*" + peerDependenciesMeta: + "@edge-runtime/vm": + optional: true + "@types/node": + optional: true + "@vitest/browser": + optional: true + "@vitest/ui": + optional: true + happy-dom: + optional: true + jsdom: + optional: true + bin: + vitest: vitest.mjs + checksum: 10/5bbbc7298a043c7ca0914817a2c30e18af5a1619f4a750d36056f64f4d907a1fad50b8bab93aaf39f8174eb475108c9287f6e226e24d3a3ccd6f0b71d3f56438 + languageName: node + linkType: hard + "vm2@npm:^3.9.5, vm2@npm:^3.9.9": version: 3.9.19 resolution: "vm2@npm:3.9.19" @@ -29994,28 +30760,6 @@ __metadata: languageName: node linkType: hard -"vscode-uri@npm:^3.0.8": - version: 3.0.8 - resolution: "vscode-uri@npm:3.0.8" - checksum: 10/e882d6b679e0d053cbc042893c0951a135d899a192b62cd07f0a8924f11ae722067a8d6b1b5b147034becf57faf9fff9fb543b17b749fd0f17db1f54f783f07c - languageName: node - linkType: hard - -"vue-tsc@npm:2.0.29": - version: 2.0.29 - resolution: "vue-tsc@npm:2.0.29" - dependencies: - "@volar/typescript": "npm:~2.4.0-alpha.18" - "@vue/language-core": "npm:2.0.29" - semver: "npm:^7.5.4" - peerDependencies: - typescript: ">=5.0.0" - bin: - vue-tsc: ./bin/vue-tsc.js - checksum: 10/deabe919d3d3a9c9974791d91c32244c7e831a7d613a281e1e9a9f65bfaa917723883afda79d1d06b67f886dbd23cfdf3ec902a40674f907f0bb792e8eeab088 - languageName: node - linkType: hard - "walk-up-path@npm:^3.0.1": version: 3.0.1 resolution: "walk-up-path@npm:3.0.1" @@ -30692,13 +31436,6 @@ __metadata: languageName: node linkType: hard -"yaml@npm:^1.10.2": - version: 1.10.2 - resolution: "yaml@npm:1.10.2" - checksum: 10/e088b37b4d4885b70b50c9fa1b7e54bd2e27f5c87205f9deaffd1fb293ab263d9c964feadb9817a7b129a5bf30a06582cb08750f810568ecc14f3cdbabb79cb3 - languageName: node - linkType: hard - "yaml@npm:^2.0.1": version: 2.3.2 resolution: "yaml@npm:2.3.2" @@ -30706,21 +31443,21 @@ __metadata: languageName: node linkType: hard -"yaml@npm:^2.1.3": - version: 2.4.2 - resolution: "yaml@npm:2.4.2" +"yaml@npm:^2.2.2": + version: 2.5.0 + resolution: "yaml@npm:2.5.0" bin: yaml: bin.mjs - checksum: 10/6eafbcd68dead734035f6f72af21bd820c29214caf7d8e40c595671a3c908535cef8092b9660a1c055c5833aa148aa640e0c5fa4adb5af2dacd6d28296ccd81c + checksum: 10/72e903fdbe3742058885205db4a6c9ff38e5f497f4e05e631264f7756083c05e7d10dfb5e4ce9d7a95de95338f9b20d19dd0b91c60c65f7d7608b6b3929820ad languageName: node linkType: hard -"yaml@npm:^2.2.2": - version: 2.5.0 - resolution: "yaml@npm:2.5.0" +"yaml@npm:^2.3.4, yaml@npm:~2.5.0": + version: 2.5.1 + resolution: "yaml@npm:2.5.1" bin: yaml: bin.mjs - checksum: 10/72e903fdbe3742058885205db4a6c9ff38e5f497f4e05e631264f7756083c05e7d10dfb5e4ce9d7a95de95338f9b20d19dd0b91c60c65f7d7608b6b3929820ad + checksum: 10/0eecb679db75ea6a989ad97715a9fa5d946972945aa6aa7d2175bca66c213b5564502ccb1cdd04b1bf816ee38b5c43e4e2fda3ff6f5e09da24dabb51ae92c57d languageName: node linkType: hard @@ -30875,6 +31612,13 @@ __metadata: languageName: node linkType: hard +"yoctocolors@npm:^2.0.0": + version: 2.1.1 + resolution: "yoctocolors@npm:2.1.1" + checksum: 10/563fbec88bce9716d1044bc98c96c329e1d7a7c503e6f1af68f1ff914adc3ba55ce953c871395e2efecad329f85f1632f51a99c362032940321ff80c42a6f74d + languageName: node + linkType: hard + "zen-observable-ts@npm:^0.8.21": version: 0.8.21 resolution: "zen-observable-ts@npm:0.8.21" From 7b648d7ea77019de2ea240784c02d365993b42da Mon Sep 17 00:00:00 2001 From: Romain Lenzotti Date: Wed, 25 Sep 2024 23:12:52 +0200 Subject: [PATCH 3/6] chore: fix typings issue --- package.json | 1 + packages/core/package.json | 2 +- packages/engines/package.json | 2 +- packages/graphql/apollo/package.json | 2 +- packages/graphql/typegraphql/package.json | 2 +- packages/orm/adapters-redis/package.json | 2 +- packages/orm/adapters/package.json | 2 +- .../src/adapters/FileSyncAdapter.spec.ts | 14 +- .../src/adapters/MemoryAdapter.spec.ts | 28 +- packages/orm/ioredis/package.json | 2 +- .../ioredis/src/domain/IORedisStore.spec.ts | 4 +- .../utils/registerConnectionProvider.spec.ts | 2 +- packages/orm/mikro-orm/package.json | 2 +- packages/orm/mongoose/package.json | 2 +- .../mongoose/test/buffer.integration.spec.ts | 2 +- .../test/ref-array.integration.spec.ts | 6 +- .../test/resources.integration.spec.ts | 7 +- packages/orm/objection/package.json | 2 +- packages/orm/prisma/package.json | 2 +- packages/platform/common/package.json | 2 +- .../common/test/integration/groups.spec.ts | 3 +- .../common/test/integration/platform.spec.ts | 2 +- .../common/test/integration/route.spec.ts | 2 +- packages/platform/platform-cache/package.json | 2 +- .../platform/platform-exceptions/package.json | 2 +- .../platform/platform-express/package.json | 2 +- packages/platform/platform-koa/package.json | 2 +- .../platform-log-middleware/package.json | 2 +- .../platform-middlewares/package.json | 2 +- .../platform/platform-params/package.json | 2 +- .../platform-response-filter/package.json | 2 +- .../platform/platform-router/package.json | 2 +- .../platform-serverless-http/package.json | 2 +- .../platform/platform-serverless/package.json | 2 +- .../src/tests/testResponse.ts | 2 +- packages/platform/platform-views/package.json | 2 +- packages/security/jwks/package.json | 2 +- .../package.json | 2 +- packages/security/oidc-provider/package.json | 2 +- packages/security/passport/package.json | 2 +- packages/specs/ajv/package.json | 2 +- packages/specs/exceptions/package.json | 2 +- packages/specs/json-mapper/package.json | 2 +- .../src/domain/JsonDeserializer.spec.ts | 1 + packages/specs/schema/package.json | 3 +- .../src/decorators/common/integer.spec.ts | 1 + .../src/decorators/common/nullable.spec.ts | 1 + .../decorators/operations/deprecated.spec.ts | 1 + .../schema/src/domain/JsonMethodStore.spec.ts | 1 + .../src/domain/JsonOperationRoute.spec.ts | 1 + .../schema/src/utils/generateSpec.spec.ts | 1 + .../body-params-any.integration.spec.ts | 1 + .../integrations/body.integration.spec.ts | 1 + .../deep-object-query-params.spec.ts | 1 + .../discriminator.integration.spec.ts | 1 + .../multipart.integration.spec.ts | 1 + .../integrations/partial.integration.spec.ts | 1 + .../integrations/petstore.integration.spec.ts | 3 +- .../integrations/query-model-examples.spec.ts | 1 + .../response.binary.integration.spec.ts | 1 + .../integrations/response.integration.spec.ts | 1 + packages/specs/swagger/package.json | 2 +- packages/third-parties/agenda/package.json | 2 +- packages/third-parties/bullmq/package.json | 2 +- .../components-scan/package.json | 2 +- .../third-parties/event-emitter/package.json | 2 +- packages/third-parties/formio/package.json | 2 +- packages/third-parties/pulse/package.json | 2 +- packages/third-parties/socketio/package.json | 2 +- packages/third-parties/sse/package.json | 2 +- packages/third-parties/stripe/package.json | 2 +- packages/third-parties/temporal/package.json | 2 +- packages/third-parties/terminus/package.json | 2 +- packages/third-parties/vike/package.json | 2 +- packages/utils/normalize-path/package.json | 2 +- yarn.lock | 243 ++++++------------ 76 files changed, 175 insertions(+), 253 deletions(-) diff --git a/package.json b/package.json index 1004dc1a999..7a4e5620d12 100644 --- a/package.json +++ b/package.json @@ -125,6 +125,7 @@ "@types/supertest": "6.0.2", "@typescript-eslint/eslint-plugin": "8.7.0", "@typescript-eslint/parser": "8.7.0", + "@vitest/coverage-v8": "^2.1.1", "concurrently": "8.2.2", "cross-env": "7.0.3", "eslint": "9.11.1", diff --git a/packages/core/package.json b/packages/core/package.json index 1df0d43e23e..7c9deac6166 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -37,7 +37,7 @@ "eslint": "^8.57.0", "typescript": "5.6.2", "vite": "^5.4.1", - "vitest": "2.0.4", + "vitest": "2.1.1", "webpack": "^5.75.0" } } diff --git a/packages/engines/package.json b/packages/engines/package.json index 41be88180f5..dcbf991a2a9 100644 --- a/packages/engines/package.json +++ b/packages/engines/package.json @@ -81,7 +81,7 @@ "underscore": "^1.11.0", "vash": "^0.13.0", "velocityjs": "^2.0.1", - "vitest": "2.0.4", + "vitest": "2.1.1", "walrus": "^0.10.1", "whiskers": "^0.4.0" }, diff --git a/packages/graphql/apollo/package.json b/packages/graphql/apollo/package.json index 50fb4c7d18b..0774b493721 100644 --- a/packages/graphql/apollo/package.json +++ b/packages/graphql/apollo/package.json @@ -39,7 +39,7 @@ "eslint": "^8.57.0", "graphql": "16.8.2", "typescript": "5.6.2", - "vitest": "2.0.4" + "vitest": "2.1.1" }, "peerDependencies": { "@apollo/server": ">=4.10.4", diff --git a/packages/graphql/typegraphql/package.json b/packages/graphql/typegraphql/package.json index 5e4eca7daff..3e027d14b67 100644 --- a/packages/graphql/typegraphql/package.json +++ b/packages/graphql/typegraphql/package.json @@ -44,7 +44,7 @@ "ts-node": "10.9.2", "type-graphql": ">=2.0.0-rc.2", "typescript": "5.6.2", - "vitest": "2.0.4" + "vitest": "2.1.1" }, "peerDependencies": { "@apollo/datasource-rest": ">=6.2.2", diff --git a/packages/orm/adapters-redis/package.json b/packages/orm/adapters-redis/package.json index 4ba3464f11b..3fac6657e92 100644 --- a/packages/orm/adapters-redis/package.json +++ b/packages/orm/adapters-redis/package.json @@ -32,7 +32,7 @@ "@tsed/typescript": "workspace:*", "eslint": "^8.57.0", "typescript": "5.6.2", - "vitest": "2.0.4" + "vitest": "2.1.1" }, "peerDependencies": { "@tsed/adapters": "8.0.0-alpha.5", diff --git a/packages/orm/adapters/package.json b/packages/orm/adapters/package.json index ce6366faff0..83b9eb9ee82 100644 --- a/packages/orm/adapters/package.json +++ b/packages/orm/adapters/package.json @@ -43,7 +43,7 @@ "@types/fs-extra": "11.0.4", "eslint": "^8.57.0", "typescript": "5.6.2", - "vitest": "2.0.4" + "vitest": "2.1.1" }, "peerDependencies": { "@tsed/ajv": "8.0.0-alpha.5", diff --git a/packages/orm/adapters/src/adapters/FileSyncAdapter.spec.ts b/packages/orm/adapters/src/adapters/FileSyncAdapter.spec.ts index 055e267d1f9..09d692e9266 100644 --- a/packages/orm/adapters/src/adapters/FileSyncAdapter.spec.ts +++ b/packages/orm/adapters/src/adapters/FileSyncAdapter.spec.ts @@ -34,7 +34,7 @@ describe("FileSyncAdapter", () => { describe("create()", () => { it("should create a new instance", async () => { const base = { - name: faker.name.jobTitle() + name: faker.person.jobTitle() }; const client = await adapter.create(base); @@ -48,7 +48,7 @@ describe("FileSyncAdapter", () => { describe("findById()", () => { it("should create a new instance", async () => { const base = { - name: faker.name.jobTitle() + name: faker.person.jobTitle() }; const client = await adapter.create(base); @@ -63,7 +63,7 @@ describe("FileSyncAdapter", () => { describe("findOne()", () => { it("should create a new instance", async () => { const base = { - name: faker.name.jobTitle() + name: faker.person.jobTitle() }; const client = await adapter.create(base); @@ -80,7 +80,7 @@ describe("FileSyncAdapter", () => { describe("deleteOne()", () => { it("should delete instance", async () => { const base = { - name: faker.name.jobTitle() + name: faker.person.jobTitle() }; const client = await adapter.create(base); @@ -120,7 +120,7 @@ describe("FileSyncAdapter", () => { describe("create()", () => { it("should create a new instance", async () => { const base = { - name: faker.name.jobTitle() + name: faker.person.jobTitle() }; const client = await adapter.create(base); @@ -134,7 +134,7 @@ describe("FileSyncAdapter", () => { describe("findById()", () => { it("should create a new instance", async () => { const base = { - name: faker.name.jobTitle() + name: faker.person.jobTitle() }; const client = await adapter.create(base); @@ -149,7 +149,7 @@ describe("FileSyncAdapter", () => { describe("findOne()", () => { it("should create a new instance", async () => { const base = { - name: faker.name.jobTitle() + name: faker.person.jobTitle() }; const client = await adapter.create(base); diff --git a/packages/orm/adapters/src/adapters/MemoryAdapter.spec.ts b/packages/orm/adapters/src/adapters/MemoryAdapter.spec.ts index b939f5cb750..a2a592f0a80 100644 --- a/packages/orm/adapters/src/adapters/MemoryAdapter.spec.ts +++ b/packages/orm/adapters/src/adapters/MemoryAdapter.spec.ts @@ -55,7 +55,7 @@ describe("MemoryAdapter", () => { it("should create a new instance", async () => { const base = deserialize( { - name: faker.name.jobTitle(), + name: faker.person.jobTitle(), createdAt: faker.date.past() }, {type: Client} @@ -71,7 +71,7 @@ describe("MemoryAdapter", () => { it("should create a new instance with expireAt", async () => { const base = { - name: faker.name.jobTitle() + name: faker.person.jobTitle() }; const client = await adapter.create(base, new Date()); @@ -85,7 +85,7 @@ describe("MemoryAdapter", () => { describe("upsert()", () => { it("should create a new instance if not exists", async () => { const base: any = { - name: faker.name.jobTitle() + name: faker.person.jobTitle() }; const client = await adapter.upsert(base._id, base); @@ -97,7 +97,7 @@ describe("MemoryAdapter", () => { it("should update instance if exists", async () => { const base: any = { - name: faker.name.jobTitle() + name: faker.person.jobTitle() }; const client = await adapter.upsert(base._id, base); @@ -112,14 +112,14 @@ describe("MemoryAdapter", () => { describe("updateOne()", () => { it("should update an instance", async () => { const base = { - name: faker.name.jobTitle() + name: faker.person.jobTitle() }; const client = await adapter.create(base); const update = { _id: client._id, - name: faker.name.jobTitle() + name: faker.person.jobTitle() }; const client2 = await adapter.updateOne({_id: client._id}, update); @@ -131,7 +131,7 @@ describe("MemoryAdapter", () => { }); it("should return undefined", async () => { const base = { - name: faker.name.jobTitle() + name: faker.person.jobTitle() }; const client = await adapter.updateOne({_id: faker.string.uuid()}, base); @@ -143,7 +143,7 @@ describe("MemoryAdapter", () => { describe("findById()", () => { it("should find by ID", async () => { const base = { - name: faker.name.jobTitle() + name: faker.person.jobTitle() }; const client = await adapter.create(base); @@ -158,7 +158,7 @@ describe("MemoryAdapter", () => { describe("findOne()", () => { it("should find one item", async () => { const base = { - name: faker.name.jobTitle() + name: faker.person.jobTitle() }; const client = await adapter.create(base); @@ -175,7 +175,7 @@ describe("MemoryAdapter", () => { describe("findAll()", () => { it("should find all items", async () => { const base = { - name: faker.name.jobTitle() + name: faker.person.jobTitle() }; await adapter.create(base); @@ -191,7 +191,7 @@ describe("MemoryAdapter", () => { describe("deleteById()", () => { it("should delete an item by id", async () => { const base = { - name: faker.name.jobTitle() + name: faker.person.jobTitle() }; const client = await adapter.create(base); @@ -205,16 +205,16 @@ describe("MemoryAdapter", () => { describe("deleteMany()", () => { it("should delete many", async () => { const base = { - name: faker.name.jobTitle() + name: faker.person.jobTitle() }; const client = await adapter.create(base); await adapter.create({ - name: faker.name.jobTitle() + name: faker.person.jobTitle() }); await adapter.create({ - name: faker.name.jobTitle() + name: faker.person.jobTitle() }); const result = await adapter.deleteMany(client); diff --git a/packages/orm/ioredis/package.json b/packages/orm/ioredis/package.json index 9d1e47f9e32..811f68c2031 100644 --- a/packages/orm/ioredis/package.json +++ b/packages/orm/ioredis/package.json @@ -34,7 +34,7 @@ "ioredis": "5.3.2", "ioredis-mock": "8.9.0", "typescript": "5.6.2", - "vitest": "2.0.4" + "vitest": "2.1.1" }, "peerDependencies": { "@tsed/core": "8.0.0-alpha.5", diff --git a/packages/orm/ioredis/src/domain/IORedisStore.spec.ts b/packages/orm/ioredis/src/domain/IORedisStore.spec.ts index 5d3b6c3c518..b2831ab7982 100644 --- a/packages/orm/ioredis/src/domain/IORedisStore.spec.ts +++ b/packages/orm/ioredis/src/domain/IORedisStore.spec.ts @@ -1,6 +1,6 @@ import {catchAsyncError, Hooks} from "@tsed/core"; import {Cache, caching} from "cache-manager"; -import Redis from "ioredis"; +import {Redis} from "ioredis"; import {IORedisStore, ioRedisStore} from "./IORedisStore.js"; @@ -117,7 +117,7 @@ vi.mock("ioredis", () => { } return { - default: Redis + Redis }; }); diff --git a/packages/orm/ioredis/src/utils/registerConnectionProvider.spec.ts b/packages/orm/ioredis/src/utils/registerConnectionProvider.spec.ts index 3de09121bcb..2d3f471129b 100644 --- a/packages/orm/ioredis/src/utils/registerConnectionProvider.spec.ts +++ b/packages/orm/ioredis/src/utils/registerConnectionProvider.spec.ts @@ -38,7 +38,7 @@ vi.mock("ioredis", () => { } } - return {default: MockRedis}; + return {Redis: MockRedis}; }); const REDIS_CONNECTION = Symbol.for("REDIS_CONNECTION"); diff --git a/packages/orm/mikro-orm/package.json b/packages/orm/mikro-orm/package.json index df15bf183fd..53fba68541c 100644 --- a/packages/orm/mikro-orm/package.json +++ b/packages/orm/mikro-orm/package.json @@ -40,7 +40,7 @@ "eslint": "^8.57.0", "ts-mockito": "^2.6.1", "typescript": "5.6.2", - "vitest": "2.0.4" + "vitest": "2.1.1" }, "peerDependencies": { "@mikro-orm/core": ">=4.5.9", diff --git a/packages/orm/mongoose/package.json b/packages/orm/mongoose/package.json index 18722a0a8cf..cedbd29c566 100644 --- a/packages/orm/mongoose/package.json +++ b/packages/orm/mongoose/package.json @@ -45,7 +45,7 @@ "eslint": "^8.57.0", "mongoose": "6.12.7", "typescript": "5.6.2", - "vitest": "2.0.4" + "vitest": "2.1.1" }, "peerDependencies": { "@tsed/ajv": "8.0.0-alpha.5", diff --git a/packages/orm/mongoose/test/buffer.integration.spec.ts b/packages/orm/mongoose/test/buffer.integration.spec.ts index ccb737f6782..b27b9704876 100644 --- a/packages/orm/mongoose/test/buffer.integration.spec.ts +++ b/packages/orm/mongoose/test/buffer.integration.spec.ts @@ -15,7 +15,7 @@ describe("Mongoose", () => { "Should save and load buffer", PlatformTest.inject([TestAvatar], async (avatarModel: MongooseModel) => { const imageBuffer = await axios - .get(faker.image.people(256, 256), { + .get(faker.image.avatar(256, 256), { responseType: "arraybuffer" }) .then((response) => Buffer.from(response.data, "binary")); diff --git a/packages/orm/mongoose/test/ref-array.integration.spec.ts b/packages/orm/mongoose/test/ref-array.integration.spec.ts index ee0d67efeca..494eab5f801 100644 --- a/packages/orm/mongoose/test/ref-array.integration.spec.ts +++ b/packages/orm/mongoose/test/ref-array.integration.spec.ts @@ -5,7 +5,7 @@ import {PlatformExpress} from "@tsed/platform-express"; import {TestContainersMongo} from "@tsed/testcontainers-mongo"; import SuperTest from "supertest"; -import {MongooseModel} from ".."; +import {MongooseModel} from "../src/index.js"; import {TestProfile2, TestUser} from "./helpers/models/User.js"; import {Server} from "./helpers/Server.js"; @@ -36,12 +36,12 @@ class ProfilesCtrl { async function getServiceFixture() { const baseUser = { email: faker.internet.email(), - password: faker.internet.password(12) + password: faker.internet.password({length: 12}) }; const baseProfile = { image: faker.image.avatar(), - age: faker.datatype.number(2) + age: faker.number.int(2) }; const repository = PlatformTest.get(ProfilesCtrl)!; diff --git a/packages/orm/mongoose/test/resources.integration.spec.ts b/packages/orm/mongoose/test/resources.integration.spec.ts index aa7f87b7892..ccb912d95ac 100644 --- a/packages/orm/mongoose/test/resources.integration.spec.ts +++ b/packages/orm/mongoose/test/resources.integration.spec.ts @@ -6,6 +6,7 @@ import {PlatformExpress} from "@tsed/platform-express"; import {Groups, Returns} from "@tsed/schema"; import {TestContainersMongo} from "@tsed/testcontainers-mongo"; import SuperTest from "supertest"; +import {describe, expect, it} from "vitest"; import {MongooseModel} from ".."; import {TestRole, TestUser, TestUserNew} from "./helpers/models/User.js"; @@ -75,7 +76,7 @@ class ResourcesCtrl { await role.save(); - user.name = faker.name.firstName(); + user.name = faker.person.firstName(); user.roles = [role._id]; @@ -93,12 +94,12 @@ async function getServiceFixture() { const baseUser = { email: faker.internet.email(), - password: faker.internet.password(12) + password: faker.internet.password({length: 12}) }; const baseUser2 = { email: faker.internet.email(), - password: faker.internet.password(12) + password: faker.internet.password({length: 12}) }; const currentUser2 = await repository.create(baseUser2); diff --git a/packages/orm/objection/package.json b/packages/orm/objection/package.json index 754188e3edb..70744008790 100644 --- a/packages/orm/objection/package.json +++ b/packages/orm/objection/package.json @@ -37,7 +37,7 @@ "objection": "^2.2.18", "sqlite3": "^5.1.7", "typescript": "5.6.2", - "vitest": "2.0.4" + "vitest": "2.1.1" }, "peerDependencies": { "@tsed/ajv": "8.0.0-alpha.5", diff --git a/packages/orm/prisma/package.json b/packages/orm/prisma/package.json index 208887769a8..9cff8063921 100644 --- a/packages/orm/prisma/package.json +++ b/packages/orm/prisma/package.json @@ -52,7 +52,7 @@ "eslint": "^8.57.0", "prisma": "^4.16.2", "typescript": "5.6.2", - "vitest": "2.0.4" + "vitest": "2.1.1" }, "peerDependencies": { "@prisma/client": ">=4.0.0", diff --git a/packages/platform/common/package.json b/packages/platform/common/package.json index 00c9de59645..9e5e4d6d59f 100644 --- a/packages/platform/common/package.json +++ b/packages/platform/common/package.json @@ -95,7 +95,7 @@ "cross-env": "7.0.3", "eslint": "^8.57.0", "typescript": "5.6.2", - "vitest": "2.0.4" + "vitest": "2.1.1" }, "peerDependencies": { "@tsed/logger": ">=6.7.5", diff --git a/packages/platform/common/test/integration/groups.spec.ts b/packages/platform/common/test/integration/groups.spec.ts index 5dfb586f797..5e802952c10 100644 --- a/packages/platform/common/test/integration/groups.spec.ts +++ b/packages/platform/common/test/integration/groups.spec.ts @@ -9,8 +9,9 @@ import compress from "compression"; import cookieParser from "cookie-parser"; import methodOverride from "method-override"; import SuperTest from "supertest"; +import {afterEach, beforeEach, describe, expect, it} from "vitest"; -import {BodyParams, Configuration, Controller, Get, PlatformTest} from "../.."; +import {BodyParams, Configuration, Controller, Get, PlatformTest} from "../../src/index.js"; const rootDir = import.meta.dirname; diff --git a/packages/platform/common/test/integration/platform.spec.ts b/packages/platform/common/test/integration/platform.spec.ts index c5ff5a9f1d2..915170df82e 100644 --- a/packages/platform/common/test/integration/platform.spec.ts +++ b/packages/platform/common/test/integration/platform.spec.ts @@ -8,7 +8,7 @@ import cookieParser from "cookie-parser"; import methodOverride from "method-override"; import SuperTest from "supertest"; -import {Configuration, Controller, Get, PlatformTest} from "../.."; +import {Configuration, Controller, Get, PlatformTest} from "../../src/index.js"; const rootDir = import.meta.dirname; diff --git a/packages/platform/common/test/integration/route.spec.ts b/packages/platform/common/test/integration/route.spec.ts index 37521c2ff5c..aa67821a40e 100644 --- a/packages/platform/common/test/integration/route.spec.ts +++ b/packages/platform/common/test/integration/route.spec.ts @@ -1,6 +1,6 @@ import {OperationVerbs} from "@tsed/schema"; -import {All, Delete, EndpointMetadata, Get, Head, Options, Patch, Post, Put} from "../.."; +import {All, Delete, EndpointMetadata, Get, Head, Options, Patch, Post, Put} from "../../src/index.js"; const middleware: any = vi.fn(); const useStub: any = vi.fn().mockReturnValue(middleware); diff --git a/packages/platform/platform-cache/package.json b/packages/platform/platform-cache/package.json index 03d2e635251..7cc9de03b57 100644 --- a/packages/platform/platform-cache/package.json +++ b/packages/platform/platform-cache/package.json @@ -36,7 +36,7 @@ "@types/micromatch": "^4.0.6", "eslint": "^8.57.0", "typescript": "5.6.2", - "vitest": "2.0.4" + "vitest": "2.1.1" }, "peerDependencies": { "@tsed/core": "8.0.0-alpha.5", diff --git a/packages/platform/platform-exceptions/package.json b/packages/platform/platform-exceptions/package.json index 361b113fd5f..a7ef3cdee23 100644 --- a/packages/platform/platform-exceptions/package.json +++ b/packages/platform/platform-exceptions/package.json @@ -33,7 +33,7 @@ "@tsed/typescript": "workspace:*", "eslint": "^8.57.0", "typescript": "5.6.2", - "vitest": "2.0.4" + "vitest": "2.1.1" }, "peerDependencies": { "@tsed/core": "8.0.0-alpha.5", diff --git a/packages/platform/platform-express/package.json b/packages/platform/platform-express/package.json index e2526ddca13..4767039226e 100644 --- a/packages/platform/platform-express/package.json +++ b/packages/platform/platform-express/package.json @@ -86,7 +86,7 @@ "express-session": "1.18.0", "method-override": "3.0.0", "typescript": "5.6.2", - "vitest": "2.0.4" + "vitest": "2.1.1" }, "peerDependencies": { "@tsed/common": "8.0.0-alpha.5", diff --git a/packages/platform/platform-koa/package.json b/packages/platform/platform-koa/package.json index dfec44b754e..8d51d53fbad 100644 --- a/packages/platform/platform-koa/package.json +++ b/packages/platform/platform-koa/package.json @@ -81,7 +81,7 @@ "koa-qs": "^3.0.0", "koa-session": "6.4.0", "typescript": "5.6.2", - "vitest": "2.0.4" + "vitest": "2.1.1" }, "dependencies": { "@koa/router": "^12.0.1", diff --git a/packages/platform/platform-log-middleware/package.json b/packages/platform/platform-log-middleware/package.json index aabd8dd3097..c41aaf980e8 100644 --- a/packages/platform/platform-log-middleware/package.json +++ b/packages/platform/platform-log-middleware/package.json @@ -32,7 +32,7 @@ "@tsed/typescript": "workspace:*", "eslint": "^8.57.0", "typescript": "5.6.2", - "vitest": "2.0.4" + "vitest": "2.1.1" }, "peerDependencies": { "@tsed/di": "8.0.0-alpha.5", diff --git a/packages/platform/platform-middlewares/package.json b/packages/platform/platform-middlewares/package.json index cbd86e40441..1f02c6d180f 100644 --- a/packages/platform/platform-middlewares/package.json +++ b/packages/platform/platform-middlewares/package.json @@ -32,7 +32,7 @@ "@tsed/typescript": "workspace:*", "eslint": "^8.57.0", "typescript": "5.6.2", - "vitest": "2.0.4" + "vitest": "2.1.1" }, "peerDependencies": { "@tsed/core": "8.0.0-alpha.5", diff --git a/packages/platform/platform-params/package.json b/packages/platform/platform-params/package.json index 5d089d4919e..8917083aa20 100644 --- a/packages/platform/platform-params/package.json +++ b/packages/platform/platform-params/package.json @@ -34,7 +34,7 @@ "@tsed/typescript": "workspace:*", "eslint": "^8.57.0", "typescript": "5.6.2", - "vitest": "2.0.4" + "vitest": "2.1.1" }, "peerDependencies": { "@tsed/core": "8.0.0-alpha.5", diff --git a/packages/platform/platform-response-filter/package.json b/packages/platform/platform-response-filter/package.json index 36757ddfbee..4718ec43c39 100644 --- a/packages/platform/platform-response-filter/package.json +++ b/packages/platform/platform-response-filter/package.json @@ -34,7 +34,7 @@ "@tsed/typescript": "workspace:*", "eslint": "^8.57.0", "typescript": "5.6.2", - "vitest": "2.0.4" + "vitest": "2.1.1" }, "peerDependencies": { "@tsed/core": "8.0.0-alpha.5", diff --git a/packages/platform/platform-router/package.json b/packages/platform/platform-router/package.json index 6559ab3a5ed..a7e0e24fdd0 100644 --- a/packages/platform/platform-router/package.json +++ b/packages/platform/platform-router/package.json @@ -35,7 +35,7 @@ "@tsed/typescript": "workspace:*", "eslint": "^8.57.0", "typescript": "5.6.2", - "vitest": "2.0.4" + "vitest": "2.1.1" }, "peerDependencies": { "@tsed/core": "8.0.0-alpha.5", diff --git a/packages/platform/platform-serverless-http/package.json b/packages/platform/platform-serverless-http/package.json index 0400be7db00..8b479a8c6ed 100644 --- a/packages/platform/platform-serverless-http/package.json +++ b/packages/platform/platform-serverless-http/package.json @@ -72,7 +72,7 @@ "eslint": "^8.57.0", "serverless-http": "^3.2.0", "typescript": "5.6.2", - "vitest": "2.0.4" + "vitest": "2.1.1" }, "peerDependencies": { "@tsed/common": "8.0.0-alpha.5", diff --git a/packages/platform/platform-serverless/package.json b/packages/platform/platform-serverless/package.json index de0e6a84459..f505c2c0989 100644 --- a/packages/platform/platform-serverless/package.json +++ b/packages/platform/platform-serverless/package.json @@ -43,7 +43,7 @@ "eslint": "^8.57.0", "find-my-way": "^8.2.0", "typescript": "5.6.2", - "vitest": "2.0.4" + "vitest": "2.1.1" }, "peerDependencies": { "@tsed/di": "8.0.0-alpha.5", diff --git a/packages/platform/platform-test-sdk/src/tests/testResponse.ts b/packages/platform/platform-test-sdk/src/tests/testResponse.ts index cfa9f288da5..6d2fda9b072 100644 --- a/packages/platform/platform-test-sdk/src/tests/testResponse.ts +++ b/packages/platform/platform-test-sdk/src/tests/testResponse.ts @@ -2,7 +2,7 @@ import {Context, Controller, Get, getContext, PathParams, PlatformResponse, Plat import {CollectionOf, Enum, ForwardGroups, Groups, Ignore, Name, Property, Required, Returns, Status} from "@tsed/schema"; import axios from "axios"; import {of} from "rxjs"; -import {agent, SuperAgentStatic} from "superagent"; +import {agent} from "superagent"; import SuperTest from "supertest"; import {afterAll, beforeAll, describe, expect, it} from "vitest"; diff --git a/packages/platform/platform-views/package.json b/packages/platform/platform-views/package.json index 155286f43ab..10742d46af1 100644 --- a/packages/platform/platform-views/package.json +++ b/packages/platform/platform-views/package.json @@ -37,7 +37,7 @@ "@types/ejs": "3.1.5", "eslint": "^8.57.0", "typescript": "5.6.2", - "vitest": "2.0.4" + "vitest": "2.1.1" }, "peerDependencies": { "@tsed/core": "8.0.0-alpha.5", diff --git a/packages/security/jwks/package.json b/packages/security/jwks/package.json index 3198c400361..a2856db7337 100644 --- a/packages/security/jwks/package.json +++ b/packages/security/jwks/package.json @@ -31,6 +31,6 @@ "@tsed/typescript": "workspace:*", "eslint": "^8.57.0", "typescript": "5.6.2", - "vitest": "2.0.4" + "vitest": "2.1.1" } } diff --git a/packages/security/oidc-provider-plugin-wildcard-redirect-uri/package.json b/packages/security/oidc-provider-plugin-wildcard-redirect-uri/package.json index 301bd79d66c..cb1fda6cd9a 100644 --- a/packages/security/oidc-provider-plugin-wildcard-redirect-uri/package.json +++ b/packages/security/oidc-provider-plugin-wildcard-redirect-uri/package.json @@ -41,7 +41,7 @@ "@types/uuid": "9.0.8", "eslint": "^8.57.0", "typescript": "5.6.2", - "vitest": "2.0.4" + "vitest": "2.1.1" }, "peerDependencies": { "@tsed/core": "8.0.0-alpha.5", diff --git a/packages/security/oidc-provider/package.json b/packages/security/oidc-provider/package.json index e25e3c34191..17cb5015fd5 100644 --- a/packages/security/oidc-provider/package.json +++ b/packages/security/oidc-provider/package.json @@ -59,7 +59,7 @@ "lowdb": "3.0.0", "oidc-provider": "8.4.5", "typescript": "5.6.2", - "vitest": "2.0.4" + "vitest": "2.1.1" }, "peerDependencies": { "@tsed/ajv": "8.0.0-alpha.5", diff --git a/packages/security/passport/package.json b/packages/security/passport/package.json index 93a7429224c..0f4b865fc00 100644 --- a/packages/security/passport/package.json +++ b/packages/security/passport/package.json @@ -43,7 +43,7 @@ "passport-local": "1.0.0", "passport-strategy": "1.0.0", "typescript": "5.6.2", - "vitest": "2.0.4" + "vitest": "2.1.1" }, "peerDependencies": { "@tsed/common": "8.0.0-alpha.5", diff --git a/packages/specs/ajv/package.json b/packages/specs/ajv/package.json index 59a3540f713..30a961b39bc 100644 --- a/packages/specs/ajv/package.json +++ b/packages/specs/ajv/package.json @@ -36,7 +36,7 @@ "ajv": "^8.17.1", "eslint": "^8.57.0", "typescript": "5.6.2", - "vitest": "2.0.4" + "vitest": "2.1.1" }, "peerDependencies": { "@tsed/core": "8.0.0-alpha.5", diff --git a/packages/specs/exceptions/package.json b/packages/specs/exceptions/package.json index b655912fb7a..ff36180b398 100644 --- a/packages/specs/exceptions/package.json +++ b/packages/specs/exceptions/package.json @@ -32,7 +32,7 @@ "@types/statuses": "2.0.5", "eslint": "^8.57.0", "typescript": "5.6.2", - "vitest": "2.0.4" + "vitest": "2.1.1" }, "peerDependencies": { "@tsed/core": "8.0.0-alpha.5" diff --git a/packages/specs/json-mapper/package.json b/packages/specs/json-mapper/package.json index df19bb22ddd..20d809dc435 100644 --- a/packages/specs/json-mapper/package.json +++ b/packages/specs/json-mapper/package.json @@ -47,7 +47,7 @@ "@tsed/typescript": "workspace:*", "eslint": "^8.57.0", "typescript": "5.6.2", - "vitest": "2.0.4", + "vitest": "2.1.1", "webpack": "^5.75.0" }, "peerDependencies": { diff --git a/packages/specs/json-mapper/src/domain/JsonDeserializer.spec.ts b/packages/specs/json-mapper/src/domain/JsonDeserializer.spec.ts index ec49cd06dc8..c25bcaa817c 100644 --- a/packages/specs/json-mapper/src/domain/JsonDeserializer.spec.ts +++ b/packages/specs/json-mapper/src/domain/JsonDeserializer.spec.ts @@ -3,6 +3,7 @@ import "../components/PrimitiveMapper.js"; import "../components/SymbolMapper.js"; import {faker} from "@faker-js/faker"; +// @ts-ignore import {QueryParams} from "@tsed/platform-params"; import { AdditionalProperties, diff --git a/packages/specs/schema/package.json b/packages/specs/schema/package.json index 428d26130d5..512c362a763 100644 --- a/packages/specs/schema/package.json +++ b/packages/specs/schema/package.json @@ -54,10 +54,11 @@ "@types/json-schema": "7.0.15", "@types/picomatch": "2.3.3", "@types/statuses": "2.0.5", + "ajv": "8.17.1", "eslint": "^8.57.0", "picomatch-browser": "^2.2.6", "typescript": "5.6.2", - "vitest": "2.0.4", + "vitest": "2.1.1", "webpack": "^5.75.0" }, "peerDependencies": { diff --git a/packages/specs/schema/src/decorators/common/integer.spec.ts b/packages/specs/schema/src/decorators/common/integer.spec.ts index f3b72fd6531..7fb86add421 100644 --- a/packages/specs/schema/src/decorators/common/integer.spec.ts +++ b/packages/specs/schema/src/decorators/common/integer.spec.ts @@ -1,3 +1,4 @@ +// @ts-ignore import {BodyParams} from "@tsed/platform-params"; import {validateSpec} from "../../../test/helpers/validateSpec.js"; diff --git a/packages/specs/schema/src/decorators/common/nullable.spec.ts b/packages/specs/schema/src/decorators/common/nullable.spec.ts index ad5b7ddc1f9..bdca05abf27 100644 --- a/packages/specs/schema/src/decorators/common/nullable.spec.ts +++ b/packages/specs/schema/src/decorators/common/nullable.spec.ts @@ -1,3 +1,4 @@ +// @ts-ignore import {BodyParams} from "@tsed/platform-params"; import Ajv from "ajv"; diff --git a/packages/specs/schema/src/decorators/operations/deprecated.spec.ts b/packages/specs/schema/src/decorators/operations/deprecated.spec.ts index b9efd08279e..313613562f2 100644 --- a/packages/specs/schema/src/decorators/operations/deprecated.spec.ts +++ b/packages/specs/schema/src/decorators/operations/deprecated.spec.ts @@ -1,4 +1,5 @@ import {catchError} from "@tsed/core"; +// @ts-ignore import {QueryParams} from "@tsed/platform-params"; import {Deprecated, getSpec, OperationPath, Returns, SpecTypes} from "../../index.js"; diff --git a/packages/specs/schema/src/domain/JsonMethodStore.spec.ts b/packages/specs/schema/src/domain/JsonMethodStore.spec.ts index 99cb6b0821f..21ebec245ee 100644 --- a/packages/specs/schema/src/domain/JsonMethodStore.spec.ts +++ b/packages/specs/schema/src/domain/JsonMethodStore.spec.ts @@ -1,4 +1,5 @@ import {StoreSet} from "@tsed/core"; +// @ts-ignore import {Use, UseAfter, UseBefore} from "@tsed/platform-middlewares"; import {OperationVerbs} from "../constants/OperationVerbs.js"; diff --git a/packages/specs/schema/src/domain/JsonOperationRoute.spec.ts b/packages/specs/schema/src/domain/JsonOperationRoute.spec.ts index 603a89f1fd1..5b90871916f 100644 --- a/packages/specs/schema/src/domain/JsonOperationRoute.spec.ts +++ b/packages/specs/schema/src/domain/JsonOperationRoute.spec.ts @@ -1,3 +1,4 @@ +// @ts-ignore import {BodyParams} from "@tsed/platform-params"; import {Name} from "../decorators/common/name.js"; diff --git a/packages/specs/schema/src/utils/generateSpec.spec.ts b/packages/specs/schema/src/utils/generateSpec.spec.ts index 03298ef088c..069ba7dda4b 100644 --- a/packages/specs/schema/src/utils/generateSpec.spec.ts +++ b/packages/specs/schema/src/utils/generateSpec.spec.ts @@ -1,3 +1,4 @@ +// @ts-ignore import {BodyParams} from "@tsed/platform-params"; import {join} from "path"; diff --git a/packages/specs/schema/test/integrations/body-params-any.integration.spec.ts b/packages/specs/schema/test/integrations/body-params-any.integration.spec.ts index 60d5109e9a2..9737b219160 100644 --- a/packages/specs/schema/test/integrations/body-params-any.integration.spec.ts +++ b/packages/specs/schema/test/integrations/body-params-any.integration.spec.ts @@ -1,5 +1,6 @@ import {MultipartFile, PlatformMulterFile} from "@tsed/common"; import {Controller} from "@tsed/di"; +// @ts-ignore import {BodyParams} from "@tsed/platform-params"; import {Any, CollectionOf, getSpec, Integer, Post, Property} from "../../src/index.js"; diff --git a/packages/specs/schema/test/integrations/body.integration.spec.ts b/packages/specs/schema/test/integrations/body.integration.spec.ts index 5eb02f161d0..a318a6640c8 100644 --- a/packages/specs/schema/test/integrations/body.integration.spec.ts +++ b/packages/specs/schema/test/integrations/body.integration.spec.ts @@ -1,3 +1,4 @@ +// @ts-ignore import {BodyParams, RawBodyParams} from "@tsed/platform-params"; import {getSpec, OperationPath, Path, SpecTypes} from "../../src/index.js"; diff --git a/packages/specs/schema/test/integrations/deep-object-query-params.spec.ts b/packages/specs/schema/test/integrations/deep-object-query-params.spec.ts index b4d4358bfbb..be6f72a5244 100644 --- a/packages/specs/schema/test/integrations/deep-object-query-params.spec.ts +++ b/packages/specs/schema/test/integrations/deep-object-query-params.spec.ts @@ -1,3 +1,4 @@ +// @ts-ignore import {QueryParams} from "@tsed/platform-params"; import {Default, GenericOf, Generics, getSpec, In, Maximum, Minimum, OperationPath, Path, Property, SpecTypes} from "../../src/index.js"; diff --git a/packages/specs/schema/test/integrations/discriminator.integration.spec.ts b/packages/specs/schema/test/integrations/discriminator.integration.spec.ts index 285d403e0d6..aa3a52b710a 100644 --- a/packages/specs/schema/test/integrations/discriminator.integration.spec.ts +++ b/packages/specs/schema/test/integrations/discriminator.integration.spec.ts @@ -1,4 +1,5 @@ import {Controller} from "@tsed/di"; +// @ts-ignore import {BodyParams, PathParams} from "@tsed/platform-params"; import { diff --git a/packages/specs/schema/test/integrations/multipart.integration.spec.ts b/packages/specs/schema/test/integrations/multipart.integration.spec.ts index bc04ade5e69..ffa27747fd2 100644 --- a/packages/specs/schema/test/integrations/multipart.integration.spec.ts +++ b/packages/specs/schema/test/integrations/multipart.integration.spec.ts @@ -1,5 +1,6 @@ import {MultipartFile, PlatformMulterFile} from "@tsed/common"; import {Controller} from "@tsed/di"; +// @ts-ignore import {BodyParams} from "@tsed/platform-params"; import {SpecTypes} from "../../src/index.js"; diff --git a/packages/specs/schema/test/integrations/partial.integration.spec.ts b/packages/specs/schema/test/integrations/partial.integration.spec.ts index 4b75db764e2..82676c9b135 100644 --- a/packages/specs/schema/test/integrations/partial.integration.spec.ts +++ b/packages/specs/schema/test/integrations/partial.integration.spec.ts @@ -1,4 +1,5 @@ import {Controller} from "@tsed/di"; +// @ts-ignore import {BodyParams} from "@tsed/platform-params"; import {CollectionOf, getSpec, Groups, Partial, Patch, Post, Required} from "../../src/index.js"; diff --git a/packages/specs/schema/test/integrations/petstore.integration.spec.ts b/packages/specs/schema/test/integrations/petstore.integration.spec.ts index ca599dc8efb..9ac038021ae 100644 --- a/packages/specs/schema/test/integrations/petstore.integration.spec.ts +++ b/packages/specs/schema/test/integrations/petstore.integration.spec.ts @@ -1,7 +1,8 @@ -import "../.."; +import "../../src/index.js"; import {Controller} from "@tsed/di"; import {Use} from "@tsed/platform-middlewares"; +// @ts-ignore import {BodyParams, PathParams} from "@tsed/platform-params"; import { diff --git a/packages/specs/schema/test/integrations/query-model-examples.spec.ts b/packages/specs/schema/test/integrations/query-model-examples.spec.ts index cdbe03842bd..84396daa554 100644 --- a/packages/specs/schema/test/integrations/query-model-examples.spec.ts +++ b/packages/specs/schema/test/integrations/query-model-examples.spec.ts @@ -1,3 +1,4 @@ +// @ts-ignore import {QueryParams} from "@tsed/platform-params"; import { diff --git a/packages/specs/schema/test/integrations/response.binary.integration.spec.ts b/packages/specs/schema/test/integrations/response.binary.integration.spec.ts index af7c561753e..1f67844caf1 100644 --- a/packages/specs/schema/test/integrations/response.binary.integration.spec.ts +++ b/packages/specs/schema/test/integrations/response.binary.integration.spec.ts @@ -1,3 +1,4 @@ +// @ts-ignore import {QueryParams} from "@tsed/platform-params"; import {getSpec, OperationPath, Path, Property, Returns, SpecTypes} from "../../src/index.js"; diff --git a/packages/specs/schema/test/integrations/response.integration.spec.ts b/packages/specs/schema/test/integrations/response.integration.spec.ts index b2efa7af716..5c13201147f 100644 --- a/packages/specs/schema/test/integrations/response.integration.spec.ts +++ b/packages/specs/schema/test/integrations/response.integration.spec.ts @@ -1,3 +1,4 @@ +// @ts-ignore import {QueryParams} from "@tsed/platform-params"; import {getSpec, OperationPath, Path, Property, Returns, SpecTypes} from "../../src/index.js"; diff --git a/packages/specs/swagger/package.json b/packages/specs/swagger/package.json index d6a1ab0d489..4fe9cfc3c62 100644 --- a/packages/specs/swagger/package.json +++ b/packages/specs/swagger/package.json @@ -46,7 +46,7 @@ "eslint": "^8.57.0", "ts-node": "10.9.2", "typescript": "5.6.2", - "vitest": "2.0.4" + "vitest": "2.1.1" }, "peerDependencies": { "@tsed/common": "8.0.0-alpha.5" diff --git a/packages/third-parties/agenda/package.json b/packages/third-parties/agenda/package.json index b162a513972..f88dc71ca7a 100644 --- a/packages/third-parties/agenda/package.json +++ b/packages/third-parties/agenda/package.json @@ -38,7 +38,7 @@ "agenda": "^5.0.0", "eslint": "^8.57.0", "typescript": "5.6.2", - "vitest": "2.0.4" + "vitest": "2.1.1" }, "peerDependencies": { "agenda": ">=4" diff --git a/packages/third-parties/bullmq/package.json b/packages/third-parties/bullmq/package.json index 4e90d602c0c..53d4eb4894a 100644 --- a/packages/third-parties/bullmq/package.json +++ b/packages/third-parties/bullmq/package.json @@ -39,7 +39,7 @@ "eslint": "^8.57.0", "ts-mockito": "^2.6.1", "typescript": "5.6.2", - "vitest": "2.0.4" + "vitest": "2.1.1" }, "peerDependencies": { "bullmq": "^4.12.3 || ^5.1.1" diff --git a/packages/third-parties/components-scan/package.json b/packages/third-parties/components-scan/package.json index cfb45245765..10a41594783 100644 --- a/packages/third-parties/components-scan/package.json +++ b/packages/third-parties/components-scan/package.json @@ -33,7 +33,7 @@ "@tsed/typescript": "workspace:*", "eslint": "^8.57.0", "typescript": "5.6.2", - "vitest": "2.0.4" + "vitest": "2.1.1" }, "peerDependencies": { "@tsed/core": "8.0.0-alpha.5" diff --git a/packages/third-parties/event-emitter/package.json b/packages/third-parties/event-emitter/package.json index 8bbfa5d3336..398af29fac5 100644 --- a/packages/third-parties/event-emitter/package.json +++ b/packages/third-parties/event-emitter/package.json @@ -41,7 +41,7 @@ "eslint": "^8.57.0", "eventemitter2": "^6.4.9", "typescript": "5.6.2", - "vitest": "2.0.4", + "vitest": "2.1.1", "webpack": "^5.75.0" }, "peerDependencies": { diff --git a/packages/third-parties/formio/package.json b/packages/third-parties/formio/package.json index a1fd5a7fb38..4d1c24a8b57 100644 --- a/packages/third-parties/formio/package.json +++ b/packages/third-parties/formio/package.json @@ -49,7 +49,7 @@ "mongodb": "*", "mongoose": "^6.12.7", "typescript": "5.6.2", - "vitest": "2.0.4" + "vitest": "2.1.1" }, "peerDependencies": { "@tsed/common": "8.0.0-alpha.5", diff --git a/packages/third-parties/pulse/package.json b/packages/third-parties/pulse/package.json index c0702f5fdb9..1c94efecdb1 100644 --- a/packages/third-parties/pulse/package.json +++ b/packages/third-parties/pulse/package.json @@ -38,7 +38,7 @@ "@tsed/typescript": "workspace:*", "eslint": "^8.57.0", "typescript": "5.6.2", - "vitest": "2.0.4" + "vitest": "2.1.1" }, "peerDependencies": { "@pulsecron/pulse": ">=1" diff --git a/packages/third-parties/socketio/package.json b/packages/third-parties/socketio/package.json index 1fc08631382..4ce6ea8dded 100644 --- a/packages/third-parties/socketio/package.json +++ b/packages/third-parties/socketio/package.json @@ -48,7 +48,7 @@ "socket.io": "4.7.5", "socket.io-client": "^4.7.5", "typescript": "5.6.2", - "vitest": "2.0.4" + "vitest": "2.1.1" }, "peerDependencies": { "@tsed/di": "8.0.0-alpha.5", diff --git a/packages/third-parties/sse/package.json b/packages/third-parties/sse/package.json index 98989e5556f..74097585c10 100644 --- a/packages/third-parties/sse/package.json +++ b/packages/third-parties/sse/package.json @@ -46,7 +46,7 @@ "eslint": "^8.57.0", "express": "^4.19.1", "typescript": "5.6.2", - "vitest": "2.0.4" + "vitest": "2.1.1" }, "peerDependencies": { "@tsed/di": "8.0.0-alpha.5", diff --git a/packages/third-parties/stripe/package.json b/packages/third-parties/stripe/package.json index 182cb25eed3..baddbc309b6 100644 --- a/packages/third-parties/stripe/package.json +++ b/packages/third-parties/stripe/package.json @@ -45,7 +45,7 @@ "eslint": "^8.57.0", "stripe": "^8.129.0", "typescript": "5.6.2", - "vitest": "2.0.4" + "vitest": "2.1.1" }, "peerDependencies": { "@tsed/exceptions": "8.0.0-alpha.5", diff --git a/packages/third-parties/temporal/package.json b/packages/third-parties/temporal/package.json index 19742e8e781..e9de3973178 100644 --- a/packages/third-parties/temporal/package.json +++ b/packages/third-parties/temporal/package.json @@ -41,7 +41,7 @@ "cross-env": "7.0.3", "eslint": "^8.57.0", "typescript": "5.6.2", - "vitest": "2.0.4" + "vitest": "2.1.1" }, "peerDependencies": { "@temporalio/client": "^1.8.4", diff --git a/packages/third-parties/terminus/package.json b/packages/third-parties/terminus/package.json index d02b7a268d1..d5593a7ac05 100644 --- a/packages/third-parties/terminus/package.json +++ b/packages/third-parties/terminus/package.json @@ -36,7 +36,7 @@ "@tsed/typescript": "workspace:*", "eslint": "^8.57.0", "typescript": "5.6.2", - "vitest": "2.0.4" + "vitest": "2.1.1" }, "peerDependencies": { "@godaddy/terminus": "^4.7.1", diff --git a/packages/third-parties/vike/package.json b/packages/third-parties/vike/package.json index ef3f37340b0..2132e1704c5 100644 --- a/packages/third-parties/vike/package.json +++ b/packages/third-parties/vike/package.json @@ -40,7 +40,7 @@ "typescript": "5.6.2", "vike": "0.4.160", "vite": "5.4.1", - "vitest": "2.0.4" + "vitest": "2.1.1" }, "peerDependencies": { "@tsed/common": "8.0.0-alpha.5", diff --git a/packages/utils/normalize-path/package.json b/packages/utils/normalize-path/package.json index 0ac7a1d5421..f46283d9ce6 100644 --- a/packages/utils/normalize-path/package.json +++ b/packages/utils/normalize-path/package.json @@ -31,6 +31,6 @@ "@types/normalize-path": "^3.0.2", "eslint": "^8.57.0", "typescript": "5.6.2", - "vitest": "2.0.4" + "vitest": "2.1.1" } } diff --git a/yarn.lock b/yarn.lock index 20d2cf005f2..775b871748c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6739,7 +6739,7 @@ __metadata: eslint: "npm:^8.57.0" tslib: "npm:2.6.1" typescript: "npm:5.6.2" - vitest: "npm:2.0.4" + vitest: "npm:2.1.1" peerDependencies: "@tsed/adapters": 8.0.0-alpha.5 "@tsed/common": 8.0.0-alpha.5 @@ -6774,7 +6774,7 @@ __metadata: tslib: "npm:2.6.1" typescript: "npm:5.6.2" uuid: "npm:9.0.1" - vitest: "npm:2.0.4" + vitest: "npm:2.1.1" peerDependencies: "@tsed/ajv": 8.0.0-alpha.5 "@tsed/common": 8.0.0-alpha.5 @@ -6811,7 +6811,7 @@ __metadata: eslint: "npm:^8.57.0" tslib: "npm:2.6.1" typescript: "npm:5.6.2" - vitest: "npm:2.0.4" + vitest: "npm:2.1.1" peerDependencies: agenda: ">=4" languageName: unknown @@ -6833,7 +6833,7 @@ __metadata: eslint: "npm:^8.57.0" tslib: "npm:2.6.1" typescript: "npm:5.6.2" - vitest: "npm:2.0.4" + vitest: "npm:2.1.1" peerDependencies: "@tsed/core": 8.0.0-alpha.5 "@tsed/di": 8.0.0-alpha.5 @@ -6872,7 +6872,7 @@ __metadata: graphql: "npm:16.8.2" tslib: "npm:2.6.1" typescript: "npm:5.6.2" - vitest: "npm:2.0.4" + vitest: "npm:2.1.1" peerDependencies: "@apollo/server": ">=4.10.4" "@tsed/common": 8.0.0-alpha.5 @@ -6908,7 +6908,7 @@ __metadata: ts-mockito: "npm:^2.6.1" tslib: "npm:2.6.1" typescript: "npm:5.6.2" - vitest: "npm:2.0.4" + vitest: "npm:2.1.1" peerDependencies: bullmq: ^4.12.3 || ^5.1.1 languageName: unknown @@ -6943,7 +6943,7 @@ __metadata: tslib: "npm:2.6.1" typescript: "npm:5.6.2" uuid: "npm:9.0.1" - vitest: "npm:2.0.4" + vitest: "npm:2.1.1" peerDependencies: "@tsed/logger": ">=6.7.5" "@tsed/logger-file": ">=6.7.5" @@ -6968,7 +6968,7 @@ __metadata: globby: "npm:11.1.0" tslib: "npm:2.6.1" typescript: "npm:5.6.2" - vitest: "npm:2.0.4" + vitest: "npm:2.1.1" peerDependencies: "@tsed/core": 8.0.0-alpha.5 peerDependenciesMeta: @@ -6991,7 +6991,7 @@ __metadata: tslib: "npm:2.6.1" typescript: "npm:5.6.2" vite: "npm:^5.4.1" - vitest: "npm:2.0.4" + vitest: "npm:2.1.1" webpack: "npm:^5.75.0" languageName: unknown linkType: soft @@ -7010,7 +7010,7 @@ __metadata: tslib: "npm:2.6.2" typescript: "npm:5.6.2" uuid: "npm:9.0.1" - vitest: "npm:2.0.4" + vitest: "npm:2.1.1" webpack: "npm:^5.75.0" peerDependencies: "@tsed/core": 8.0.0-alpha.5 @@ -7087,7 +7087,7 @@ __metadata: underscore: "npm:^1.11.0" vash: "npm:^0.13.0" velocityjs: "npm:^2.0.1" - vitest: "npm:2.0.4" + vitest: "npm:2.1.1" walrus: "npm:^0.10.1" whiskers: "npm:^0.4.0" languageName: unknown @@ -7106,7 +7106,7 @@ __metadata: eventemitter2: "npm:^6.4.9" tslib: "npm:2.6.1" typescript: "npm:5.6.2" - vitest: "npm:2.0.4" + vitest: "npm:2.1.1" webpack: "npm:^5.75.0" peerDependencies: eventemitter2: ^6.4.4 @@ -7125,7 +7125,7 @@ __metadata: statuses: "npm:>=2.0.1" tslib: "npm:2.6.1" typescript: "npm:5.6.2" - vitest: "npm:2.0.4" + vitest: "npm:2.1.1" peerDependencies: "@tsed/core": 8.0.0-alpha.5 languageName: unknown @@ -7165,7 +7165,7 @@ __metadata: mongoose: "npm:^6.12.7" tslib: "npm:2.6.1" typescript: "npm:5.6.2" - vitest: "npm:2.0.4" + vitest: "npm:2.1.1" peerDependencies: "@tsed/common": 8.0.0-alpha.5 express: ^4.17.1 @@ -7242,7 +7242,7 @@ __metadata: ioredis-mock: "npm:8.9.0" tslib: "npm:2.6.1" typescript: "npm:5.6.2" - vitest: "npm:2.0.4" + vitest: "npm:2.1.1" peerDependencies: "@tsed/core": 8.0.0-alpha.5 "@tsed/di": 8.0.0-alpha.5 @@ -7262,7 +7262,7 @@ __metadata: eslint: "npm:^8.57.0" tslib: "npm:2.6.1" typescript: "npm:5.6.2" - vitest: "npm:2.0.4" + vitest: "npm:2.1.1" webpack: "npm:^5.75.0" peerDependencies: "@tsed/core": 8.0.0-alpha.5 @@ -7286,7 +7286,7 @@ __metadata: jose2: "npm:jose@^2.0.4" tslib: "npm:2.6.1" typescript: "npm:5.6.2" - vitest: "npm:2.0.4" + vitest: "npm:2.1.1" languageName: unknown linkType: soft @@ -7346,7 +7346,7 @@ __metadata: ts-mockito: "npm:^2.6.1" tslib: "npm:2.6.1" typescript: "npm:5.6.2" - vitest: "npm:2.0.4" + vitest: "npm:2.1.1" peerDependencies: "@mikro-orm/core": ">=4.5.9" "@tsed/common": 8.0.0-alpha.5 @@ -7374,7 +7374,7 @@ __metadata: mongoose: "npm:6.12.7" tslib: "npm:2.6.1" typescript: "npm:5.6.2" - vitest: "npm:2.0.4" + vitest: "npm:2.1.1" peerDependencies: "@tsed/ajv": 8.0.0-alpha.5 "@tsed/core": 8.0.0-alpha.5 @@ -7430,7 +7430,7 @@ __metadata: normalize-path: "npm:3.0.0" tslib: "npm:2.6.1" typescript: "npm:5.6.2" - vitest: "npm:2.0.4" + vitest: "npm:2.1.1" languageName: unknown linkType: soft @@ -7451,7 +7451,7 @@ __metadata: sqlite3: "npm:^5.1.7" tslib: "npm:2.6.1" typescript: "npm:5.6.2" - vitest: "npm:2.0.4" + vitest: "npm:2.1.1" peerDependencies: "@tsed/ajv": 8.0.0-alpha.5 "@tsed/core": 8.0.0-alpha.5 @@ -7492,7 +7492,7 @@ __metadata: eslint: "npm:^8.57.0" psl: "npm:1.9.0" typescript: "npm:5.6.2" - vitest: "npm:2.0.4" + vitest: "npm:2.1.1" wildcard: "npm:2.0.0" peerDependencies: "@tsed/core": 8.0.0-alpha.5 @@ -7537,7 +7537,7 @@ __metadata: tslib: "npm:2.6.1" typescript: "npm:5.6.2" uuid: "npm:9.0.1" - vitest: "npm:2.0.4" + vitest: "npm:2.1.1" peerDependencies: "@tsed/ajv": 8.0.0-alpha.5 "@tsed/common": 8.0.0-alpha.5 @@ -7594,7 +7594,7 @@ __metadata: passport-strategy: "npm:1.0.0" tslib: "npm:2.6.1" typescript: "npm:5.6.2" - vitest: "npm:2.0.4" + vitest: "npm:2.1.1" peerDependencies: "@tsed/common": 8.0.0-alpha.5 passport: ">=0.4.1" @@ -7633,7 +7633,7 @@ __metadata: micromatch: "npm:4.0.8" tslib: "npm:2.6.1" typescript: "npm:5.6.2" - vitest: "npm:2.0.4" + vitest: "npm:2.1.1" peerDependencies: "@tsed/core": 8.0.0-alpha.5 "@tsed/di": 8.0.0-alpha.5 @@ -7664,7 +7664,7 @@ __metadata: eslint: "npm:^8.57.0" tslib: "npm:2.6.1" typescript: "npm:5.6.2" - vitest: "npm:2.0.4" + vitest: "npm:2.1.1" peerDependencies: "@tsed/core": 8.0.0-alpha.5 "@tsed/di": 8.0.0-alpha.5 @@ -7712,7 +7712,7 @@ __metadata: multer: "npm:^1.4.5-lts.1" tslib: "npm:2.6.1" typescript: "npm:5.6.2" - vitest: "npm:2.0.4" + vitest: "npm:2.1.1" peerDependencies: "@tsed/common": 8.0.0-alpha.5 "@tsed/core": 8.0.0-alpha.5 @@ -7780,7 +7780,7 @@ __metadata: multer: "npm:^1.4.5-lts.1" tslib: "npm:2.6.1" typescript: "npm:5.6.2" - vitest: "npm:2.0.4" + vitest: "npm:2.1.1" peerDependencies: "@tsed/common": 8.0.0-alpha.5 "@tsed/core": 8.0.0-alpha.5 @@ -7828,7 +7828,7 @@ __metadata: eslint: "npm:^8.57.0" tslib: "npm:2.6.1" typescript: "npm:5.6.2" - vitest: "npm:2.0.4" + vitest: "npm:2.1.1" peerDependencies: "@tsed/di": 8.0.0-alpha.5 "@tsed/platform-middlewares": 8.0.0-alpha.5 @@ -7855,7 +7855,7 @@ __metadata: eslint: "npm:^8.57.0" tslib: "npm:2.6.1" typescript: "npm:5.6.2" - vitest: "npm:2.0.4" + vitest: "npm:2.1.1" peerDependencies: "@tsed/core": 8.0.0-alpha.5 "@tsed/di": 8.0.0-alpha.5 @@ -7884,7 +7884,7 @@ __metadata: eslint: "npm:^8.57.0" tslib: "npm:2.6.1" typescript: "npm:5.6.2" - vitest: "npm:2.0.4" + vitest: "npm:2.1.1" peerDependencies: "@tsed/core": 8.0.0-alpha.5 "@tsed/di": 8.0.0-alpha.5 @@ -7919,7 +7919,7 @@ __metadata: eslint: "npm:^8.57.0" tslib: "npm:2.6.1" typescript: "npm:5.6.2" - vitest: "npm:2.0.4" + vitest: "npm:2.1.1" peerDependencies: "@tsed/core": 8.0.0-alpha.5 "@tsed/di": 8.0.0-alpha.5 @@ -7955,7 +7955,7 @@ __metadata: eslint: "npm:^8.57.0" tslib: "npm:2.6.1" typescript: "npm:5.6.2" - vitest: "npm:2.0.4" + vitest: "npm:2.1.1" peerDependencies: "@tsed/core": 8.0.0-alpha.5 "@tsed/di": 8.0.0-alpha.5 @@ -7994,7 +7994,7 @@ __metadata: serverless-http: "npm:^3.2.0" tslib: "npm:2.6.1" typescript: "npm:5.6.2" - vitest: "npm:2.0.4" + vitest: "npm:2.1.1" peerDependencies: "@tsed/common": 8.0.0-alpha.5 "@tsed/core": 8.0.0-alpha.5 @@ -8070,7 +8070,7 @@ __metadata: tslib: "npm:2.6.1" typescript: "npm:5.6.2" uuid: "npm:^9.0.1" - vitest: "npm:2.0.4" + vitest: "npm:2.1.1" peerDependencies: "@tsed/di": 8.0.0-alpha.5 "@tsed/logger": ">=6.7.5" @@ -8127,7 +8127,7 @@ __metadata: eslint: "npm:^8.57.0" tslib: "npm:2.6.1" typescript: "npm:5.6.2" - vitest: "npm:2.0.4" + vitest: "npm:2.1.1" peerDependencies: "@tsed/core": 8.0.0-alpha.5 "@tsed/di": 8.0.0-alpha.5 @@ -8170,7 +8170,7 @@ __metadata: ts-morph: "npm:^12.0.0" tslib: "npm:2.6.1" typescript: "npm:5.6.2" - vitest: "npm:2.0.4" + vitest: "npm:2.1.1" peerDependencies: "@prisma/client": ">=4.0.0" "@tsed/core": 8.0.0-alpha.5 @@ -8196,7 +8196,7 @@ __metadata: eslint: "npm:^8.57.0" tslib: "npm:2.6.1" typescript: "npm:5.6.2" - vitest: "npm:2.0.4" + vitest: "npm:2.1.1" peerDependencies: "@pulsecron/pulse": ">=1" languageName: unknown @@ -8222,6 +8222,7 @@ __metadata: "@types/supertest": "npm:6.0.2" "@typescript-eslint/eslint-plugin": "npm:8.7.0" "@typescript-eslint/parser": "npm:8.7.0" + "@vitest/coverage-v8": "npm:^2.1.1" ajv: "npm:8.17.1" axios: "npm:1.7.4" change-case: "npm:4.1.2" @@ -8277,7 +8278,7 @@ __metadata: eslint: "npm:^8.57.0" tslib: "npm:2.6.1" typescript: "npm:5.6.2" - vitest: "npm:2.0.4" + vitest: "npm:2.1.1" peerDependencies: "@tsed/core": 8.0.0-alpha.5 "@tsed/openspec": 8.0.0-alpha.5 @@ -8314,6 +8315,7 @@ __metadata: "@types/json-schema": "npm:7.0.15" "@types/picomatch": "npm:2.3.3" "@types/statuses": "npm:2.0.5" + ajv: "npm:8.17.1" change-case: "npm:^4.1.2" eslint: "npm:^8.57.0" fs-extra: "npm:^11.2.0" @@ -8323,7 +8325,7 @@ __metadata: statuses: "npm:>=2.0.1" tslib: "npm:2.6.1" typescript: "npm:5.6.2" - vitest: "npm:2.0.4" + vitest: "npm:2.1.1" webpack: "npm:^5.75.0" peerDependencies: "@tsed/core": 8.0.0-alpha.5 @@ -8376,7 +8378,7 @@ __metadata: socket.io-client: "npm:^4.7.5" tslib: "npm:2.6.1" typescript: "npm:5.6.2" - vitest: "npm:2.0.4" + vitest: "npm:2.1.1" peerDependencies: "@tsed/di": 8.0.0-alpha.5 "@tsed/json-mapper": 8.0.0-alpha.5 @@ -8414,7 +8416,7 @@ __metadata: express: "npm:^4.19.1" tslib: "npm:2.6.1" typescript: "npm:5.6.2" - vitest: "npm:2.0.4" + vitest: "npm:2.1.1" peerDependencies: "@tsed/di": 8.0.0-alpha.5 "@tsed/json-mapper": 8.0.0-alpha.5 @@ -8449,7 +8451,7 @@ __metadata: stripe: "npm:^8.129.0" tslib: "npm:2.6.1" typescript: "npm:5.6.2" - vitest: "npm:2.0.4" + vitest: "npm:2.1.1" peerDependencies: "@tsed/exceptions": 8.0.0-alpha.5 "@tsed/platform-middlewares": 8.0.0-alpha.5 @@ -8494,7 +8496,7 @@ __metadata: ts-node: "npm:10.9.2" tslib: "npm:2.6.1" typescript: "npm:5.6.2" - vitest: "npm:2.0.4" + vitest: "npm:2.1.1" peerDependencies: "@tsed/common": 8.0.0-alpha.5 peerDependenciesMeta: @@ -8519,7 +8521,7 @@ __metadata: eslint: "npm:^8.57.0" tslib: "npm:2.6.1" typescript: "npm:5.6.2" - vitest: "npm:2.0.4" + vitest: "npm:2.1.1" peerDependencies: "@temporalio/client": ^1.8.4 "@temporalio/worker": ^1.8.4 @@ -8540,7 +8542,7 @@ __metadata: eslint: "npm:^8.57.0" tslib: "npm:2.6.1" typescript: "npm:5.6.2" - vitest: "npm:2.0.4" + vitest: "npm:2.1.1" peerDependencies: "@godaddy/terminus": ^4.7.1 "@tsed/common": 8.0.0-alpha.5 @@ -8626,7 +8628,7 @@ __metadata: tslib: "npm:2.6.1" type-graphql: "npm:>=2.0.0-rc.2" typescript: "npm:5.6.2" - vitest: "npm:2.0.4" + vitest: "npm:2.1.1" peerDependencies: "@apollo/datasource-rest": ">=6.2.2" class-validator: ">=0.13.1" @@ -8657,7 +8659,7 @@ __metadata: typescript: "npm:5.6.2" vike: "npm:0.4.160" vite: "npm:5.4.1" - vitest: "npm:2.0.4" + vitest: "npm:2.1.1" peerDependencies: "@tsed/common": 8.0.0-alpha.5 vike: ">=0.4.160" @@ -10039,15 +10041,29 @@ __metadata: languageName: node linkType: hard -"@vitest/expect@npm:2.0.4": - version: 2.0.4 - resolution: "@vitest/expect@npm:2.0.4" +"@vitest/coverage-v8@npm:^2.1.1": + version: 2.1.1 + resolution: "@vitest/coverage-v8@npm:2.1.1" dependencies: - "@vitest/spy": "npm:2.0.4" - "@vitest/utils": "npm:2.0.4" - chai: "npm:^5.1.1" + "@ampproject/remapping": "npm:^2.3.0" + "@bcoe/v8-coverage": "npm:^0.2.3" + debug: "npm:^4.3.6" + istanbul-lib-coverage: "npm:^3.2.2" + istanbul-lib-report: "npm:^3.0.1" + istanbul-lib-source-maps: "npm:^5.0.6" + istanbul-reports: "npm:^3.1.7" + magic-string: "npm:^0.30.11" + magicast: "npm:^0.3.4" + std-env: "npm:^3.7.0" + test-exclude: "npm:^7.0.1" tinyrainbow: "npm:^1.2.0" - checksum: 10/9e77266306a9ee6c982956e79e5086edeaec9f387fb9f8840d749ba9e026b27c01f68987a732b53746cd7fb0fce4a2620dbd0359ca3efe891a8ba89300568111 + peerDependencies: + "@vitest/browser": 2.1.1 + vitest: 2.1.1 + peerDependenciesMeta: + "@vitest/browser": + optional: true + checksum: 10/f53e4ce5174b88007428faa0d253c62ed7cab6186172691f43e8a2fd2b7b569e8b06f92fd783f34c52f1251e7b5943be58515588b0634155be9c6a234b412b5b languageName: node linkType: hard @@ -10095,16 +10111,7 @@ __metadata: languageName: node linkType: hard -"@vitest/pretty-format@npm:2.0.4": - version: 2.0.4 - resolution: "@vitest/pretty-format@npm:2.0.4" - dependencies: - tinyrainbow: "npm:^1.2.0" - checksum: 10/16223d1c9f8c86cea7a064cf625380e90b20a5c2f95fda6ab3643c16cce1925afa337109ee12dcbf54834a161fd2b68be16179da9fd9fb948de986c33942203b - languageName: node - linkType: hard - -"@vitest/pretty-format@npm:2.0.5, @vitest/pretty-format@npm:^2.0.4, @vitest/pretty-format@npm:^2.0.5": +"@vitest/pretty-format@npm:2.0.5, @vitest/pretty-format@npm:^2.0.5": version: 2.0.5 resolution: "@vitest/pretty-format@npm:2.0.5" dependencies: @@ -10122,16 +10129,6 @@ __metadata: languageName: node linkType: hard -"@vitest/runner@npm:2.0.4": - version: 2.0.4 - resolution: "@vitest/runner@npm:2.0.4" - dependencies: - "@vitest/utils": "npm:2.0.4" - pathe: "npm:^1.1.2" - checksum: 10/a94872a08296b72316d1259fa8f12e314a47614b614cba03f1d0ba7f00e82f5d724b740ab17b8f6ddbe281acea278dec212f5050ac557b108df8f50b7aab6cbd - languageName: node - linkType: hard - "@vitest/runner@npm:2.0.5": version: 2.0.5 resolution: "@vitest/runner@npm:2.0.5" @@ -10152,17 +10149,6 @@ __metadata: languageName: node linkType: hard -"@vitest/snapshot@npm:2.0.4": - version: 2.0.4 - resolution: "@vitest/snapshot@npm:2.0.4" - dependencies: - "@vitest/pretty-format": "npm:2.0.4" - magic-string: "npm:^0.30.10" - pathe: "npm:^1.1.2" - checksum: 10/bbdc491d42a95945589a7006ef40beb199332b28b5832f111bd25e26b24bd78134efdb05b670e65dc82f83c654e1aedc445c26be20bdaa758a6c3cf844bd05b5 - languageName: node - linkType: hard - "@vitest/snapshot@npm:2.0.5": version: 2.0.5 resolution: "@vitest/snapshot@npm:2.0.5" @@ -10185,15 +10171,6 @@ __metadata: languageName: node linkType: hard -"@vitest/spy@npm:2.0.4": - version: 2.0.4 - resolution: "@vitest/spy@npm:2.0.4" - dependencies: - tinyspy: "npm:^3.0.0" - checksum: 10/c18d0fc28e40a40f701a116a117d98916ec90f18e1643a37379b18f5fbee841e7c35fcb65202503506b471df761e0907053912d475e159399b887c1be6f91ef1 - languageName: node - linkType: hard - "@vitest/spy@npm:2.0.5": version: 2.0.5 resolution: "@vitest/spy@npm:2.0.5" @@ -10212,18 +10189,6 @@ __metadata: languageName: node linkType: hard -"@vitest/utils@npm:2.0.4": - version: 2.0.4 - resolution: "@vitest/utils@npm:2.0.4" - dependencies: - "@vitest/pretty-format": "npm:2.0.4" - estree-walker: "npm:^3.0.3" - loupe: "npm:^3.1.1" - tinyrainbow: "npm:^1.2.0" - checksum: 10/a17497cd3c12b72b315bda6a6a4addcbc206367f6bcdedb83d5d708ac40cf52fcc48403539d10528e1893348b2f107416e9065b6b5c39329f2512eea8f104578 - languageName: node - linkType: hard - "@vitest/utils@npm:2.0.5": version: 2.0.5 resolution: "@vitest/utils@npm:2.0.5" @@ -30464,21 +30429,6 @@ __metadata: languageName: node linkType: hard -"vite-node@npm:2.0.4": - version: 2.0.4 - resolution: "vite-node@npm:2.0.4" - dependencies: - cac: "npm:^6.7.14" - debug: "npm:^4.3.5" - pathe: "npm:^1.1.2" - tinyrainbow: "npm:^1.2.0" - vite: "npm:^5.0.0" - bin: - vite-node: vite-node.mjs - checksum: 10/27040a5d614fa315cc735867d7e6778640b2dcfb164e1a18d6a275b991a21e99ac6d720448b1b8de6e6d10b8169e79d0cb022807d537246b816f0260eb5f8b15 - languageName: node - linkType: hard - "vite-node@npm:2.0.5": version: 2.0.5 resolution: "vite-node@npm:2.0.5" @@ -30594,55 +30544,6 @@ __metadata: languageName: node linkType: hard -"vitest@npm:2.0.4": - version: 2.0.4 - resolution: "vitest@npm:2.0.4" - dependencies: - "@ampproject/remapping": "npm:^2.3.0" - "@vitest/expect": "npm:2.0.4" - "@vitest/pretty-format": "npm:^2.0.4" - "@vitest/runner": "npm:2.0.4" - "@vitest/snapshot": "npm:2.0.4" - "@vitest/spy": "npm:2.0.4" - "@vitest/utils": "npm:2.0.4" - chai: "npm:^5.1.1" - debug: "npm:^4.3.5" - execa: "npm:^8.0.1" - magic-string: "npm:^0.30.10" - pathe: "npm:^1.1.2" - std-env: "npm:^3.7.0" - tinybench: "npm:^2.8.0" - tinypool: "npm:^1.0.0" - tinyrainbow: "npm:^1.2.0" - vite: "npm:^5.0.0" - vite-node: "npm:2.0.4" - why-is-node-running: "npm:^2.3.0" - peerDependencies: - "@edge-runtime/vm": "*" - "@types/node": ^18.0.0 || >=20.0.0 - "@vitest/browser": 2.0.4 - "@vitest/ui": 2.0.4 - happy-dom: "*" - jsdom: "*" - peerDependenciesMeta: - "@edge-runtime/vm": - optional: true - "@types/node": - optional: true - "@vitest/browser": - optional: true - "@vitest/ui": - optional: true - happy-dom: - optional: true - jsdom: - optional: true - bin: - vitest: vitest.mjs - checksum: 10/01a173adbf40273adce5ff0ffd7b538fcc98286b15441651be4a3b9cc48748acf6cedb1f4966b4eff07ed91695847b9352591fd419c2da62181440bc6edf79ee - languageName: node - linkType: hard - "vitest@npm:2.0.5": version: 2.0.5 resolution: "vitest@npm:2.0.5" From 2fcee8519d2c59ac174416e78b9a4170a11c8b51 Mon Sep 17 00:00:00 2001 From: Romain Lenzotti Date: Thu, 26 Sep 2024 07:43:11 +0200 Subject: [PATCH 4/6] chore: update tsconfig --- .gitignore | 1 + .../snippets/base/package.json | 2 +- .../snippets/migrate-from-express/server.js | 190 +++++++++++++--- eslint.config.mjs | 1 + package.json | 2 +- packages/core/package.json | 2 +- packages/core/src/decorators/deprecated.ts | 2 +- packages/core/src/decorators/storeFn.ts | 2 +- packages/core/src/decorators/storeMerge.ts | 2 +- packages/core/src/decorators/storeSet.ts | 2 +- .../src/utils/decorators/decoratorArgs.ts | 2 +- .../utils/decorators/useDecorators.spec.ts | 2 +- .../src/utils/decorators/useDecorators.ts | 4 +- .../utils/decorators/useMethodDecorators.ts | 2 +- packages/core/src/utils/objects/methodsOf.ts | 2 +- packages/core/tsconfig.spec.json | 42 ++-- packages/di/package.json | 4 +- .../di/src/common/decorators/configuration.ts | 5 +- .../di/src/common/decorators/controller.ts | 5 +- packages/di/src/common/decorators/inject.ts | 2 +- .../src/common/decorators/intercept.spec.ts | 7 +- .../di/src/common/decorators/intercept.ts | 3 +- packages/di/src/common/decorators/module.ts | 4 +- .../src/common/decorators/overrideProvider.ts | 2 +- .../src/common/domain/ControllerProvider.ts | 4 +- packages/di/src/common/domain/Provider.ts | 3 +- .../di/src/common/errors/InjectionError.ts | 2 +- packages/di/src/common/integration/di.spec.ts | 2 +- .../di/src/common/integration/request.spec.ts | 2 +- .../di/src/common/interfaces/InvokeOptions.ts | 4 +- .../src/common/interfaces/RegistrySettings.ts | 2 +- .../di/src/common/interfaces/TokenRoute.ts | 2 +- .../src/common/registries/GlobalProviders.ts | 11 +- .../di/src/common/services/DIConfiguration.ts | 3 +- packages/di/src/common/services/DILogger.ts | 2 +- .../__mock__/module1/controllers/M1Ctrl1.ts | 2 +- .../__mock__/module1/services/M1Service.ts | 2 +- .../di/src/common/utils/createContainer.ts | 2 +- .../di/src/common/utils/getConfiguration.ts | 3 +- .../di/src/common/utils/resolveControllers.ts | 6 +- packages/di/src/node/domain/ContextLogger.ts | 5 +- packages/di/src/node/domain/DIContext.ts | 6 +- .../node/integration/inject-context.spec.ts | 2 +- packages/di/src/node/services/DITest.ts | 10 +- .../__mock__/module1/controllers/M1Ctrl1.ts | 2 +- .../__mock__/module1/services/M1Service.ts | 2 +- .../di/src/node/utils/asyncHookContext.ts | 2 +- packages/di/src/node/utils/attachLogger.ts | 2 +- packages/di/tsconfig.esm.json | 5 +- packages/di/tsconfig.spec.json | 40 ++-- packages/di/vitest.config.mts | 2 +- packages/engines/package.json | 2 +- .../engines/src/components/HoganEngine.ts | 3 +- .../engines/src/components/RactiveEngine.ts | 3 +- .../engines/src/components/ReactEngine.ts | 3 +- .../src/components/SquirrellyEngine.ts | 3 +- packages/engines/src/components/TwigEngine.ts | 3 +- .../engines/src/components/VelocityEngine.ts | 3 +- packages/engines/src/decorators/viewEngine.ts | 2 +- .../src/registries/EnginesContainer.ts | 2 +- packages/engines/src/utils/getEngines.ts | 2 +- packages/engines/test/getEngineFixture.ts | 2 +- packages/engines/tsconfig.esm.json | 1 - packages/engines/tsconfig.spec.json | 42 ++-- packages/graphql/apollo/package.json | 2 +- packages/graphql/apollo/src/ApolloModule.ts | 6 +- .../src/decorators/injectApolloContext.ts | 3 +- .../apollo/src/services/ApolloService.spec.ts | 5 +- .../apollo/src/services/ApolloService.ts | 14 +- packages/graphql/apollo/tsconfig.esm.json | 1 - packages/graphql/apollo/tsconfig.spec.json | 42 ++-- packages/graphql/graphql-ws/package.json | 2 +- .../graphql/graphql-ws/src/GraphQLWSModule.ts | 7 +- .../graphql-ws/src/GraphQLWSOptions.ts | 4 +- packages/graphql/graphql-ws/tsconfig.esm.json | 1 - packages/graphql/typegraphql/package.json | 2 +- .../typegraphql/src/TypeGraphQLModule.ts | 7 +- .../typegraphql/src/decorators/resolver.ts | 3 +- packages/graphql/typegraphql/src/index.ts | 1 - .../src/interfaces/TypeGraphQLSettings.ts | 1 - .../typegraphql/src/interfaces/interfaces.ts | 2 +- .../src/middlewares/ContextMiddleware.ts | 2 +- .../graphql/typegraphql/test/app/Server.ts | 7 +- .../test/app/graphql/auth/AuthResolver.ts | 2 +- .../app/graphql/datasources/MyDataSource.ts | 4 +- .../test/app/graphql/pubsub/pubsub.ts | 2 +- .../app/graphql/recipes/RecipeResolver.ts | 13 +- .../test/app/protocols/GraphQLProtocol.ts | 5 +- .../test/app/services/UsersRepository.ts | 5 +- .../graphql/typegraphql/tsconfig.esm.json | 1 - .../graphql/typegraphql/tsconfig.spec.json | 42 ++-- packages/orm/adapters-redis/package.json | 2 +- .../src/adapters/OIDCRedisAdapter.spec.ts | 2 +- .../src/adapters/OIDCRedisAdapter.ts | 10 +- .../src/adapters/RedisAdapter.spec.ts | 3 +- .../src/adapters/RedisAdapter.ts | 6 +- .../src/domain/RedisAdaptersSettings.ts | 4 +- packages/orm/adapters-redis/tsconfig.esm.json | 1 - .../orm/adapters-redis/tsconfig.spec.json | 42 ++-- packages/orm/adapters/package.json | 2 +- .../src/adapters/FileSyncAdapter.spec.ts | 2 +- .../adapters/src/adapters/FileSyncAdapter.ts | 5 +- .../orm/adapters/src/adapters/LowDbAdapter.ts | 2 +- .../src/adapters/MemoryAdapter.spec.ts | 2 +- .../adapters/src/adapters/MemoryAdapter.ts | 3 +- .../adapters/src/decorators/indexed.spec.ts | 2 +- .../src/decorators/injectAdapter.spec.ts | 2 +- .../adapters/src/decorators/injectAdapter.ts | 6 +- packages/orm/adapters/src/domain/Adapter.ts | 8 +- .../adapters/src/domain/AdaptersSettings.ts | 4 +- .../orm/adapters/src/services/Adapters.ts | 6 +- .../test/discrinimator.integration.spec.ts | 3 +- packages/orm/adapters/tsconfig.esm.json | 1 - packages/orm/adapters/tsconfig.spec.json | 42 ++-- packages/orm/ioredis/package.json | 2 +- .../src/domain/IORedisConfiguration.ts | 4 +- .../ioredis/src/domain/IORedisStore.spec.ts | 3 +- .../orm/ioredis/src/domain/IORedisStore.ts | 3 +- .../orm/ioredis/src/utils/mockConnections.ts | 3 +- .../utils/registerConnectionProvider.spec.ts | 2 +- .../src/utils/registerConnectionProvider.ts | 8 +- packages/orm/ioredis/tsconfig.esm.json | 1 - packages/orm/ioredis/tsconfig.spec.json | 42 ++-- packages/orm/mikro-orm/package.json | 2 +- .../orm/mikro-orm/src/MikroOrmModule.spec.ts | 2 +- packages/orm/mikro-orm/src/MikroOrmModule.ts | 22 +- .../src/decorators/entityManager.spec.ts | 4 +- .../orm/mikro-orm/src/decorators/orm.spec.ts | 2 +- packages/orm/mikro-orm/src/decorators/orm.ts | 2 +- .../src/decorators/subscriber.spec.ts | 2 +- .../mikro-orm/src/decorators/transactional.ts | 3 +- .../filters/OptimisticLockErrorFilter.spec.ts | 3 +- .../src/filters/OptimisticLockErrorFilter.ts | 3 +- .../TransactionalInterceptor.spec.ts | 11 +- .../interceptors/TransactionalInterceptor.ts | 13 +- .../src/interfaces/AfterTransactionCommit.ts | 2 +- .../src/interfaces/BeforeTransactionCommit.ts | 2 +- .../src/services/MikroOrmContext.spec.ts | 3 +- .../mikro-orm/src/services/MikroOrmContext.ts | 3 +- .../mikro-orm/src/services/MikroOrmFactory.ts | 5 +- .../src/services/MikroOrmRegistry.spec.ts | 7 +- .../src/services/MikroOrmRegistry.ts | 6 +- packages/orm/mikro-orm/test/helpers/Server.ts | 2 +- .../orm/mikro-orm/test/helpers/entity/User.ts | 2 +- .../mikro-orm/test/helpers/services/Hooks.ts | 4 +- .../services/ManagedEventSubscriber.ts | 4 +- .../services/UnmanagedEventSubscriber1.ts | 4 +- .../services/UnmanagedEventSubscriber2.ts | 4 +- .../test/helpers/services/UserService.ts | 2 +- packages/orm/mikro-orm/tsconfig.esm.json | 1 - packages/orm/mikro-orm/tsconfig.spec.json | 42 ++-- packages/orm/mongoose/package.json | 2 +- packages/orm/mongoose/src/MongooseModule.ts | 5 +- .../orm/mongoose/src/decorators/dynamicRef.ts | 6 +- .../orm/mongoose/src/decorators/indexed.ts | 2 +- packages/orm/mongoose/src/decorators/model.ts | 4 +- .../mongoose/src/decorators/mongoosePlugin.ts | 2 +- .../src/decorators/numberDecimal.spec.ts | 3 +- .../mongoose/src/decorators/numberDecimal.ts | 6 +- .../orm/mongoose/src/decorators/postHook.ts | 5 +- .../mongoose/src/decorators/preHook.spec.ts | 3 +- .../orm/mongoose/src/decorators/preHook.ts | 2 +- packages/orm/mongoose/src/decorators/ref.ts | 3 +- .../orm/mongoose/src/decorators/schema.ts | 4 +- .../src/decorators/virtualRef.spec.ts | 2 +- .../orm/mongoose/src/decorators/virtualRef.ts | 2 +- .../interfaces/MongooseConnectionOptions.ts | 2 +- .../src/interfaces/MongooseDocument.ts | 2 +- .../mongoose/src/interfaces/MongooseModel.ts | 2 +- .../src/interfaces/MongooseModelOptions.ts | 2 +- .../src/interfaces/MongooseSchemaOptions.ts | 5 +- .../interfaces/MongooseVirtualRefOptions.ts | 2 +- .../orm/mongoose/src/interfaces/interfaces.ts | 2 +- .../mongoose/src/registries/MongooseModels.ts | 2 +- .../src/services/MongooseConnections.ts | 2 +- .../mongoose/src/services/MongooseService.ts | 4 +- .../orm/mongoose/src/utils/createModel.ts | 6 +- .../mongoose/src/utils/createSchema.spec.ts | 3 +- .../orm/mongoose/src/utils/createSchema.ts | 12 +- .../orm/mongoose/src/utils/resolveRefType.ts | 3 +- .../orm/mongoose/src/utils/schemaOptions.ts | 4 +- .../mongoose/test/array.integration.spec.ts | 3 +- .../mongoose/test/buffer.integration.spec.ts | 2 +- .../test/circularRef.integration.spec.ts | 2 +- .../test/discriminators.integration.spec.ts | 3 +- .../test/dynamicRef.integration.spec.ts | 3 +- packages/orm/mongoose/test/helpers/Server.ts | 7 +- .../orm/mongoose/test/helpers/models/User.ts | 3 +- .../test/helpers/models/UserWorkspace.ts | 5 +- .../multipleConnection.integration.spec.ts | 3 +- .../test/readonly.integration.spec.ts | 3 +- .../test/ref-array.integration.spec.ts | 2 +- .../orm/mongoose/test/ref.integration.spec.ts | 6 +- .../test/resources.integration.spec.ts | 2 +- .../mongoose/test/user.integration.spec.ts | 2 +- .../test/versioning.integration.spec.ts | 2 +- .../test/virtualRef.integration.spec.ts | 3 +- packages/orm/mongoose/tsconfig.esm.json | 1 - packages/orm/mongoose/tsconfig.spec.json | 42 ++-- packages/orm/mongoose/vitest.config.mts | 6 +- packages/orm/objection/package.json | 2 +- .../src/components/createBooleanColumn.ts | 2 +- .../src/components/createIdColumn.ts | 2 +- .../src/components/createNumberColumn.ts | 2 +- .../src/components/createStringColumn.ts | 2 +- .../objection/src/decorators/belongsToOne.ts | 2 +- .../orm/objection/src/decorators/entity.ts | 2 +- .../orm/objection/src/decorators/hasMany.ts | 5 +- .../orm/objection/src/decorators/hasOne.ts | 2 +- .../src/decorators/hasOneThroughRelation.ts | 2 +- .../objection/src/decorators/manyToMany.ts | 5 +- .../orm/objection/src/decorators/relatesTo.ts | 5 +- .../objection/src/domain/RelationshipOpts.ts | 2 +- .../orm/objection/src/domain/interfaces.ts | 2 +- .../src/services/ColumnTypesContainer.ts | 2 +- packages/orm/objection/src/utils/connect.ts | 3 +- .../orm/objection/src/utils/createColumns.ts | 5 +- .../orm/objection/src/utils/createJoinKeys.ts | 6 +- .../src/utils/createRelationshipMapping.ts | 7 +- .../orm/objection/src/utils/getColumnCtx.ts | 4 +- packages/orm/objection/test/helpers/Server.ts | 3 +- .../orm/objection/test/helpers/knex/table.ts | 2 +- .../objection/test/helpers/seeds/01_users.ts | 2 +- .../orm/objection/test/integration.spec.ts | 2 +- packages/orm/objection/tsconfig.esm.json | 1 - packages/orm/objection/tsconfig.spec.json | 42 ++-- packages/orm/prisma/package.json | 4 +- .../src/__mock__/createContextFixture.ts | 2 +- .../orm/prisma/src/cli/prismaGenerator.ts | 2 +- .../prisma/src/generator/domain/DmmfEnum.ts | 5 +- .../prisma/src/generator/domain/DmmfField.ts | 2 +- .../prisma/src/generator/domain/DmmfModel.ts | 5 +- .../src/generator/domain/ScalarTsTypes.ts | 3 +- .../src/generator/domain/TransformContext.ts | 2 +- .../orm/prisma/src/generator/generateCode.ts | 5 +- .../transform/transformEnumsToEnums.ts | 5 +- .../transform/transformFieldToDecorators.ts | 7 +- .../transform/transformFieldToProperty.ts | 7 +- .../transform/transformModelToClass.ts | 7 +- .../transform/transformScalarToType.ts | 2 +- .../generator/utils/generateClientIndex.ts | 4 +- .../src/generator/utils/generateDocuments.ts | 2 +- .../src/generator/utils/generateEnums.ts | 4 +- .../src/generator/utils/generateIndex.ts | 2 +- .../src/generator/utils/generateInterfaces.ts | 3 +- .../src/generator/utils/generateModels.ts | 4 +- .../utils/generateOutputsBarrelFile.ts | 2 +- .../generator/utils/generatePrismaService.ts | 3 +- .../generator/utils/generateRepositories.ts | 5 +- .../src/generator/utils/isCircularRef.ts | 4 +- .../prisma/src/generator/utils/saveProject.ts | 2 +- packages/orm/prisma/tsconfig.esm.json | 1 - packages/orm/prisma/tsconfig.spec.json | 42 ++-- .../orm/testcontainers-mongo/package.json | 5 +- .../src/services/ContainerUtils.ts | 3 +- .../testcontainers-mongo/tsconfig.esm.json | 1 - packages/perf/package.json | 2 +- packages/perf/src/domain/PerfLogger.ts | 3 +- packages/perf/tsconfig.esm.json | 1 - packages/platform/common/package.json | 2 +- .../src/builder/PlatformBuilder.spec.ts | 17 +- .../common/src/builder/PlatformBuilder.ts | 26 ++- .../interfaces/PlatformJsonMapperSettings.ts | 2 +- .../config/services/PlatformConfiguration.ts | 7 +- .../common/src/decorators/PlatformProvider.ts | 4 +- .../src/decorators/multer/multerOptions.ts | 2 +- .../src/decorators/multer/multipartFile.ts | 8 +- .../common/src/decorators/params/request.ts | 6 +- .../common/src/domain/AnyToPromiseWithCtx.ts | 5 +- .../common/src/domain/PlatformContext.ts | 11 +- .../common/src/interfaces/IncomingEvent.ts | 2 +- .../common/src/interfaces/OnRequest.ts | 2 +- .../common/src/interfaces/OnResponse.ts | 2 +- .../src/interfaces/PlatformRouteOptions.ts | 4 +- .../platform/common/src/interfaces/Route.ts | 2 +- .../PlatformAcceptMimesMiddleware.ts | 3 +- .../middlewares/PlatformMulterMiddleware.ts | 9 +- .../platform/common/src/services/Platform.ts | 12 +- .../common/src/services/PlatformAdapter.ts | 21 +- .../src/services/PlatformApplication.ts | 10 +- .../common/src/services/PlatformHandler.ts | 26 ++- .../services/PlatformMiddlewaresChain.spec.ts | 6 +- .../src/services/PlatformMiddlewaresChain.ts | 7 +- .../common/src/services/PlatformRequest.ts | 2 +- .../common/src/services/PlatformResponse.ts | 2 +- .../common/src/services/PlatformTest.ts | 20 +- .../__mock__/module1/controllers/M1Ctrl1.ts | 2 +- .../__mock__/module1/services/M1Service.ts | 2 +- .../common/src/utils/createContext.ts | 4 +- .../common/src/utils/createHttpServer.ts | 2 +- .../common/src/utils/createHttpsServer.ts | 4 +- .../common/src/utils/createInjector.ts | 6 +- .../platform/common/src/utils/createServer.ts | 12 +- .../common/src/utils/ensureContext.ts | 2 +- .../common/src/utils/getConfiguration.ts | 3 +- .../common/src/utils/getStaticsOptions.ts | 2 +- .../platform/common/src/utils/listenServer.ts | 2 +- .../platform/common/src/utils/printRoutes.ts | 2 +- .../src/utils/registerPlatformAdapter.ts | 4 +- .../common/src/utils/setResponseHeaders.ts | 2 +- packages/platform/common/tsconfig.esm.json | 1 - packages/platform/common/tsconfig.spec.json | 40 ++-- packages/platform/common/vitest.config.mts | 4 +- packages/platform/platform-cache/package.json | 2 +- .../platform-cache/src/decorators/useCache.ts | 2 +- .../interceptors/PlatformCacheInterceptor.ts | 11 +- .../src/interfaces/PlatformCacheOptions.ts | 4 +- .../src/services/PlatformCache.ts | 17 +- .../platform-cache/src/utils/getPrefix.ts | 3 +- .../platform-cache/src/utils/isEndpoint.ts | 3 +- .../platform/platform-cache/tsconfig.esm.json | 1 - .../platform-cache/tsconfig.spec.json | 40 ++-- .../platform/platform-exceptions/package.json | 2 +- .../src/components/ErrorFilter.ts | 2 +- .../src/components/ExceptionFilter.ts | 2 +- .../src/components/MongooseErrorFilter.ts | 2 +- .../src/components/StringErrorFilter.ts | 2 +- .../src/decorators/catch.ts | 2 +- .../src/domain/ExceptionFiltersContainer.ts | 2 +- .../src/interfaces/ExceptionFilterMethods.ts | 2 +- .../src/services/PlatformExceptions.ts | 9 +- .../platform-exceptions/tsconfig.esm.json | 1 - .../platform-exceptions/tsconfig.spec.json | 40 ++-- .../platform/platform-express/package.json | 2 +- .../src/components/PlatformExpress.ts | 17 +- .../PlatformExpressStaticsOptions.ts | 2 +- .../src/interfaces/interfaces.ts | 4 +- .../src/services/PlatformExpressHandler.ts | 6 +- .../platform-express/test/app/Server.ts | 7 +- .../platform-express/test/app/index.ts | 6 +- .../platform-express/test/pageable.spec.ts | 3 +- .../test/query-parser.spec.ts | 6 +- .../test/response-filter.spec.ts | 5 +- .../platform-express/tsconfig.esm.json | 1 - .../platform-express/tsconfig.spec.json | 40 ++-- packages/platform/platform-koa/package.json | 2 +- .../src/components/PlatformKoa.ts | 18 +- .../platform-koa/src/interfaces/interfaces.ts | 4 +- .../src/middlewares/staticsMiddleware.ts | 2 +- .../src/services/PlatformKoaHandler.ts | 3 +- .../src/services/PlatformKoaRequest.ts | 5 +- .../src/services/PlatformKoaResponse.ts | 4 +- .../platform/platform-koa/src/utils/multer.ts | 2 +- .../platform/platform-koa/test/app/Server.ts | 4 +- .../platform-koa/test/platform-koa.spec.ts | 2 +- .../platform/platform-koa/tsconfig.esm.json | 1 - .../platform/platform-koa/tsconfig.spec.json | 40 ++-- .../platform-log-middleware/package.json | 2 +- .../src/middlewares/PlatformLogMiddleware.ts | 3 +- .../platform-log-middleware/tsconfig.esm.json | 1 - .../tsconfig.spec.json | 40 ++-- .../platform-middlewares/package.json | 2 +- .../src/decorators/authOptions.ts | 11 +- .../src/decorators/middleware.ts | 3 +- .../src/decorators/useAuth.ts | 13 +- .../src/decorators/useBeforeEach.ts | 3 +- .../src/domain/PlatformMiddlewareSettings.ts | 2 +- .../src/utils/getMiddlewaresForHook.ts | 4 +- .../platform-middlewares/tsconfig.esm.json | 1 - .../platform-middlewares/tsconfig.spec.json | 40 ++-- .../platform/platform-params/package.json | 2 +- .../src/builder/PlatformParams.ts | 7 +- .../src/decorators/bodyParams.ts | 4 +- .../platform-params/src/decorators/context.ts | 2 +- .../platform-params/src/decorators/cookies.ts | 4 +- .../src/decorators/headerParams.ts | 4 +- .../platform-params/src/decorators/paramFn.ts | 5 +- .../src/decorators/pathParams.ts | 4 +- .../src/decorators/queryParams.ts | 4 +- .../platform-params/src/decorators/session.ts | 2 +- .../src/decorators/useParam.ts | 2 +- .../src/decorators/useParamType.ts | 2 +- .../platform-params/src/decorators/usePipe.ts | 4 +- .../platform-params/src/decorators/useType.ts | 2 +- .../src/domain/ParamOptions.ts | 2 +- .../src/errors/ParamValidationError.ts | 2 +- .../src/errors/RequiredValidationError.ts | 2 +- .../platform/platform-params/src/exports.ts | 2 +- .../src/pipes/DeserializerPipe.ts | 2 +- .../src/pipes/ParseExpressionPipe.ts | 4 +- .../src/pipes/ValidationPipe.ts | 3 +- .../src/utils/mapParamsOptions.ts | 2 +- .../test/helpers/buildPlatformParams.ts | 3 +- .../platform-params/tsconfig.esm.json | 1 - .../platform-params/tsconfig.spec.json | 40 ++-- .../platform-response-filter/package.json | 2 +- .../src/decorators/responseFilter.ts | 5 +- .../src/domain/ResponseFiltersContainer.ts | 4 +- .../src/errors/TemplateRenderError.ts | 3 +- .../src/interfaces/ResponseFilterMethods.ts | 2 +- .../services/PlatformResponseFilter.spec.ts | 5 +- .../src/services/PlatformResponseFilter.ts | 12 +- .../src/utils/renderView.ts | 2 +- .../tsconfig.esm.json | 1 - .../tsconfig.spec.json | 40 ++-- .../platform/platform-router/package.json | 2 +- .../src/domain/PlatformHandlerMetadata.ts | 5 +- .../src/domain/PlatformLayer.ts | 9 +- .../src/domain/PlatformRouter.ts | 9 +- .../src/domain/PlatformRouters.ts | 23 +- .../src/utils/useContextHandler.ts | 2 +- ...lter-endpoint-handlers.integration.spec.ts | 12 +- .../routers-injection.integration.spec.ts | 3 +- .../test/routers.integration.spec.ts | 6 +- .../platform-router/tsconfig.esm.json | 1 - .../platform-router/tsconfig.spec.json | 40 ++-- .../platform-serverless-http/package.json | 2 +- .../src/builder/PlatformServerlessHttp.ts | 5 +- .../src/decorators/serverlessContext.ts | 2 +- .../test/integration/aws-basic/package.json | 2 +- .../test/integration/aws-basic/src/Server.ts | 2 +- .../tsconfig.esm.json | 1 - .../tsconfig.spec.json | 42 ++-- .../platform-serverless-testing/package.json | 2 +- .../src/PlatformServerlessTest.ts | 9 +- .../src/createFakeContext.ts | 2 +- .../src/createFakeEvent.ts | 2 +- .../tsconfig.esm.json | 1 - .../platform/platform-serverless/package.json | 3 +- .../src/builder/PlatformServerless.ts | 6 +- .../src/builder/PlatformServerlessHandler.ts | 11 +- .../src/domain/ServerlessContext.ts | 7 +- .../src/domain/ServerlessRequest.ts | 2 +- .../src/domain/ServerlessResponse.ts | 2 +- .../src/utils/getRequestId.ts | 2 +- .../src/utils/setResponseHeaders.ts | 6 +- .../test/response.integration.spec.ts | 2 +- .../test/utils/createServerlessContext.ts | 4 +- .../platform-serverless/tsconfig.esm.json | 1 - .../platform-serverless/tsconfig.spec.json | 42 ++-- .../platform/platform-test-sdk/package.json | 2 +- .../src/components/PlatformTestSdk.ts | 2 +- .../src/errors/CustomBadRequest.ts | 2 +- .../src/errors/CustomInternalError.ts | 2 +- .../src/interfaces/PlatformTestingSdkOpts.ts | 4 +- .../platform-test-sdk/src/tests/exports.ts | 2 +- .../src/tests/testAcceptMime.ts | 2 +- .../platform-test-sdk/src/tests/testAuth.ts | 2 +- .../src/tests/testBodyParams.ts | 2 +- .../platform-test-sdk/src/tests/testCache.ts | 2 +- .../src/tests/testChildrenControllers.ts | 2 +- .../src/tests/testCookies.ts | 2 +- .../src/tests/testCustom404.ts | 2 +- .../src/tests/testDeepQueryParams.ts | 2 +- .../platform-test-sdk/src/tests/testErrors.ts | 2 +- .../src/tests/testHandlers.ts | 2 +- .../src/tests/testHeaderParams.ts | 2 +- .../src/tests/testHeaders.ts | 2 +- .../src/tests/testInheritanceController.ts | 2 +- .../platform-test-sdk/src/tests/testLocals.ts | 5 +- .../src/tests/testLocation.ts | 2 +- .../src/tests/testMiddlewares.ts | 20 +- .../platform-test-sdk/src/tests/testModule.ts | 2 +- .../platform-test-sdk/src/tests/testMulter.ts | 8 +- .../src/tests/testPathParams.ts | 2 +- .../src/tests/testQueryParams.ts | 2 +- .../src/tests/testRedirect.ts | 2 +- .../src/tests/testResponse.ts | 5 +- .../src/tests/testResponseFilter.ts | 5 +- .../src/tests/testRouting.ts | 2 +- .../src/tests/testScopeRequest.ts | 2 +- .../src/tests/testSession.ts | 2 +- .../src/tests/testStatics.ts | 6 +- .../platform-test-sdk/src/tests/testStream.ts | 2 +- .../platform-test-sdk/src/tests/testView.ts | 2 +- .../platform-test-sdk/tsconfig.esm.json | 1 - packages/platform/platform-views/package.json | 2 +- .../src/domain/PlatformViewsSettings.ts | 4 +- .../src/services/PlatformViews.ts | 9 +- .../platform/platform-views/tsconfig.esm.json | 1 - .../platform-views/tsconfig.spec.json | 40 ++-- packages/security/jwks/package.json | 2 +- packages/security/jwks/src/getJwks.ts | 2 +- packages/security/jwks/tsconfig.esm.json | 1 - packages/security/jwks/tsconfig.spec.json | 42 ++-- .../package.json | 2 +- .../src/OidcWildcardRedirectUriModule.spec.ts | 3 +- .../src/OidcWildcardRedirectUriModule.ts | 3 +- .../tsconfig.esm.json | 1 - .../tsconfig.spec.json | 42 ++-- packages/security/oidc-provider/package.json | 2 +- .../security/oidc-provider/src/OidcModule.ts | 14 +- .../src/decorators/interaction.spec.ts | 2 +- .../src/decorators/interaction.ts | 2 +- .../src/decorators/interactions.ts | 3 +- .../oidc-provider/src/decorators/oidcCtx.ts | 2 +- .../src/domain/OidcAccountsMethods.ts | 2 +- .../src/domain/OidcInteractionPromptProps.ts | 2 +- .../middlewares/OidcInteractionMiddleware.ts | 2 +- .../src/middlewares/OidcNoCacheMiddleware.ts | 3 +- .../src/middlewares/OidcSecureMiddleware.ts | 3 +- .../src/services/OidcAdapters.ts | 2 +- .../src/services/OidcInteractionContext.ts | 14 +- .../src/services/OidcInteractions.ts | 11 +- .../oidc-provider/src/services/OidcJwks.ts | 3 +- .../oidc-provider/src/services/OidcPolicy.ts | 10 +- .../src/services/OidcProvider.ts | 26 +-- .../src/services/OidcProviderNodeModule.ts | 4 +- .../security/oidc-provider/test/app/Server.ts | 2 +- .../test/app/controllers/pages/IndexCtrl.ts | 3 +- .../test/app/interactions/AbortInteraction.ts | 4 +- .../app/interactions/ConsentInteraction.ts | 4 +- .../app/interactions/CustomInteraction.ts | 8 +- .../test/app/interactions/LoginInteraction.ts | 7 +- .../test/app/services/Accounts.ts | 5 +- .../security/oidc-provider/tsconfig.esm.json | 1 - .../security/oidc-provider/tsconfig.spec.json | 42 ++-- packages/security/passport/package.json | 4 +- .../security/passport/src/PassportModule.ts | 27 ++- .../passport/src/decorators/authenticate.ts | 2 +- .../passport/src/decorators/authorize.ts | 2 +- .../passport/src/decorators/protocol.ts | 2 +- .../passport/src/interfaces/OnInstall.ts | 2 +- .../src/interfaces/ProtocolMethods.ts | 6 +- .../src/interfaces/ProtocolOptions.ts | 4 +- .../passport/src/interfaces/interfaces.ts | 6 +- .../src/services/PassportSerializerService.ts | 2 +- .../passport/src/services/ProtocolsService.ts | 8 +- packages/security/passport/test/app/Server.ts | 5 +- .../app/controllers/rest/auth/AuthCtrl.ts | 2 +- .../test/app/protocols/LoginLocalProtocol.ts | 10 +- .../test/app/services/UsersRepository.ts | 3 +- packages/security/passport/tsconfig.esm.json | 1 - packages/security/passport/tsconfig.spec.json | 42 ++-- packages/specs/ajv/package.json | 2 +- packages/specs/ajv/src/decorators/formats.ts | 2 +- packages/specs/ajv/src/decorators/keyword.ts | 4 +- .../specs/ajv/src/interfaces/IAjvSettings.ts | 2 +- .../ajv/src/interfaces/KeywordMethods.ts | 2 +- .../specs/ajv/src/interfaces/interfaces.ts | 2 +- packages/specs/ajv/src/services/Ajv.ts | 7 +- packages/specs/ajv/src/services/AjvService.ts | 8 +- .../ajv/src/utils/defaultErrorFormatter.ts | 2 +- .../integration/formats.integration.spec.ts | 2 +- .../integration/keywords.integration.spec.ts | 5 +- packages/specs/ajv/tsconfig.spec.json | 40 ++-- packages/specs/exceptions/package.json | 2 +- .../specs/exceptions/src/core/Exception.ts | 2 +- packages/specs/exceptions/tsconfig.esm.json | 1 - packages/specs/exceptions/tsconfig.spec.json | 40 ++-- packages/specs/json-mapper/package.json | 4 +- .../json-mapper/src/components/DateMapper.ts | 2 +- .../src/components/PrimitiveMapper.ts | 2 +- .../src/components/SymbolMapper.ts | 2 +- .../src/decorators/afterDeserialize.ts | 3 +- .../src/decorators/beforeDeserialize.ts | 3 +- .../json-mapper/src/decorators/jsonMapper.ts | 2 +- .../src/decorators/onDeserialize.ts | 3 +- .../json-mapper/src/decorators/onSerialize.ts | 3 +- .../src/domain/JsonDeserializer.spec.ts | 2 +- .../src/domain/JsonDeserializer.ts | 11 +- .../src/domain/JsonDeserializerOptions.ts | 8 +- .../src/domain/JsonMapperCompiler.ts | 6 +- .../src/domain/JsonMapperTypesContainer.ts | 4 +- .../src/domain/JsonSerializer.spec.ts | 2 +- .../json-mapper/src/domain/JsonSerializer.ts | 9 +- .../src/domain/JsonSerializerOptions.ts | 6 +- .../src/hooks/alterAfterDeserialize.ts | 2 +- .../src/hooks/alterBeforeDeserialize.ts | 2 +- .../src/hooks/alterOnDeserialize.ts | 2 +- .../json-mapper/src/hooks/alterOnSerialize.ts | 2 +- .../src/interfaces/JsonMapperMethods.ts | 2 +- .../json-mapper/src/utils/deserialize.ts | 2 +- .../specs/json-mapper/src/utils/serialize.ts | 2 +- .../specs/json-mapper/test/helpers/Post.ts | 2 +- .../test/integration/date.integration.spec.ts | 3 +- .../integration/moment.integration.spec.ts | 5 +- packages/specs/json-mapper/tsconfig.esm.json | 1 - packages/specs/json-mapper/tsconfig.spec.json | 40 ++-- packages/specs/openspec/package.json | 2 +- .../openspec/src/common/OpenSpecJsonSchema.ts | 6 +- .../openspec/src/common/OpenSpecSecurity.ts | 2 +- .../specs/openspec/src/common/OpenSpecTag.ts | 2 +- .../specs/openspec/src/openspec2/OS2Header.ts | 2 +- .../openspec/src/openspec2/OS2Operation.ts | 12 +- .../openspec/src/openspec2/OS2Parameter.ts | 4 +- .../specs/openspec/src/openspec2/OS2Paths.ts | 8 +- .../openspec/src/openspec2/OS2Response.ts | 6 +- .../specs/openspec/src/openspec2/OS2Schema.ts | 8 +- .../openspec/src/openspec2/OS2Security.ts | 2 +- .../specs/openspec/src/openspec2/OpenSpec2.ts | 20 +- .../openspec/src/openspec3/OS3Callbacks.ts | 6 +- .../openspec/src/openspec3/OS3Components.ts | 20 +- .../openspec/src/openspec3/OS3Encoding.ts | 4 +- .../specs/openspec/src/openspec3/OS3Header.ts | 6 +- .../specs/openspec/src/openspec3/OS3Link.ts | 4 +- .../openspec/src/openspec3/OS3MediaType.ts | 10 +- .../openspec/src/openspec3/OS3Operation.ts | 18 +- .../openspec/src/openspec3/OS3Parameter.ts | 10 +- .../specs/openspec/src/openspec3/OS3Paths.ts | 12 +- .../openspec/src/openspec3/OS3RequestBody.ts | 10 +- .../openspec/src/openspec3/OS3Response.ts | 12 +- .../specs/openspec/src/openspec3/OS3Schema.ts | 8 +- .../openspec/src/openspec3/OS3Security.ts | 2 +- .../specs/openspec/src/openspec3/OS3Server.ts | 2 +- .../specs/openspec/src/openspec3/OpenSpec3.ts | 18 +- packages/specs/openspec/tsconfig.esm.json | 1 - packages/specs/schema/package.json | 4 +- .../components/async-api/channelsMapper.ts | 6 +- .../src/components/async-api/generate.ts | 5 +- .../src/components/async-api/messageMapper.ts | 6 +- .../src/components/async-api/payloadMapper.ts | 8 +- .../components/async-api/responseMapper.ts | 6 +- .../src/components/default/anyMapper.ts | 2 +- .../src/components/default/classMapper.ts | 4 +- .../src/components/default/genericsMapper.ts | 3 +- .../default/inheritedClassMapper.ts | 2 +- .../components/default/inlineEnumsMapper.ts | 4 +- .../src/components/default/itemMapper.ts | 2 +- .../src/components/default/lazyRefMapper.ts | 4 +- .../src/components/default/mapMapper.ts | 2 +- .../src/components/default/objectMapper.ts | 4 +- .../src/components/default/schemaMapper.ts | 4 +- .../src/components/open-spec/generate.ts | 5 +- .../open-spec/operationInParameterMapper.ts | 6 +- .../open-spec/operationInParametersMapper.ts | 4 +- .../open-spec/operationInQueryMapper.ts | 4 +- .../components/open-spec/operationMapper.ts | 6 +- .../open-spec/operationMediaMapper.ts | 4 +- .../open-spec/operationRequestBodyMapper.ts | 4 +- .../open-spec/operationResponseMapper.ts | 4 +- .../src/components/open-spec/pathsMapper.ts | 8 +- .../schema/src/decorators/class/children.ts | 3 +- .../src/decorators/collections/uniqueItems.ts | 2 +- .../decorators/common/additionalProperties.ts | 2 +- .../schema/src/decorators/common/allOf.ts | 2 +- .../specs/schema/src/decorators/common/any.ts | 2 +- .../schema/src/decorators/common/anyOf.ts | 2 +- .../schema/src/decorators/common/customKey.ts | 2 +- .../src/decorators/common/description.ts | 5 +- .../src/decorators/common/discriminatorKey.ts | 2 +- .../schema/src/decorators/common/example.ts | 2 +- .../schema/src/decorators/common/examples.ts | 4 +- .../schema/src/decorators/common/format.ts | 2 +- .../schema/src/decorators/common/ignore.ts | 2 +- .../src/decorators/common/jsonEntityFn.ts | 2 +- .../schema/src/decorators/common/name.ts | 5 +- .../schema/src/decorators/common/nullable.ts | 3 +- .../schema/src/decorators/common/oneOf.ts | 2 +- .../schema/src/decorators/common/pattern.ts | 2 +- .../schema/src/decorators/common/readOnly.ts | 2 +- .../schema/src/decorators/common/schema.ts | 4 +- .../schema/src/decorators/common/writeOnly.ts | 2 +- .../decorators/config/jsonEntityComponent.ts | 5 +- .../src/decorators/generics/genericOf.ts | 2 +- .../src/decorators/operations/deprecated.ts | 4 +- .../src/decorators/operations/header.ts | 2 +- .../schema/src/decorators/operations/in.ts | 12 +- .../src/decorators/operations/inFile.ts | 3 +- .../src/decorators/operations/location.ts | 2 +- .../src/decorators/operations/operation.ts | 2 +- .../decorators/operations/operationPath.ts | 2 +- .../src/decorators/operations/redirect.ts | 2 +- .../src/decorators/operations/returns.spec.ts | 2 +- .../src/decorators/operations/returns.ts | 15 +- .../src/decorators/operations/security.ts | 2 +- .../src/decorators/operations/status.ts | 5 +- .../schema/src/decorators/operations/tags.ts | 2 +- .../schema/src/domain/DecoratorContext.ts | 3 +- .../specs/schema/src/domain/JsonClassStore.ts | 2 +- .../schema/src/domain/JsonDiscriminator.ts | 3 +- .../schema/src/domain/JsonEntityStore.spec.ts | 14 +- .../schema/src/domain/JsonEntityStore.ts | 5 +- .../specs/schema/src/domain/JsonLazyRef.ts | 3 +- packages/specs/schema/src/domain/JsonMap.ts | 2 +- packages/specs/schema/src/domain/JsonMedia.ts | 4 +- .../schema/src/domain/JsonMethodStore.ts | 6 +- .../specs/schema/src/domain/JsonOperation.ts | 8 +- .../src/domain/JsonOperationPathsMap.ts | 2 +- .../schema/src/domain/JsonOperationRoute.ts | 6 +- .../specs/schema/src/domain/JsonParameter.ts | 10 +- .../schema/src/domain/JsonParameterStore.ts | 6 +- .../schema/src/domain/JsonPropertyStore.ts | 3 +- .../schema/src/domain/JsonRequestBody.ts | 4 +- .../specs/schema/src/domain/JsonResponse.ts | 6 +- .../specs/schema/src/domain/JsonSchema.ts | 28 +-- .../specs/schema/src/hooks/alterIgnore.ts | 3 +- .../schema/src/interfaces/IgnoreCallback.ts | 2 +- .../schema/src/interfaces/JsonOpenSpec.ts | 2 +- .../src/interfaces/JsonSchemaOptions.ts | 2 +- .../registries/JsonSchemaMapperContainer.ts | 2 +- .../schema/src/registries/enumRegistries.ts | 2 +- .../schema/src/utils/defineStatusModel.ts | 2 +- packages/specs/schema/src/utils/from.ts | 3 +- .../specs/schema/src/utils/generateSpec.ts | 5 +- packages/specs/schema/src/utils/generics.ts | 4 +- .../specs/schema/src/utils/getComputedType.ts | 4 +- .../schema/src/utils/getInheritedStores.ts | 3 +- .../schema/src/utils/getJsonEntityStore.ts | 3 +- .../schema/src/utils/getJsonSchema.spec.ts | 3 +- .../specs/schema/src/utils/getJsonSchema.ts | 5 +- .../src/utils/getOperationsRoutes.spec.ts | 2 +- .../schema/src/utils/getOperationsRoutes.ts | 8 +- .../schema/src/utils/getOperationsStores.ts | 2 +- .../schema/src/utils/getPropertiesStores.ts | 3 +- packages/specs/schema/src/utils/getSpec.ts | 7 +- .../specs/schema/src/utils/getSpecType.ts | 2 +- packages/specs/schema/src/utils/mapHeaders.ts | 2 +- .../specs/schema/src/utils/mapOpenSpec.ts | 2 +- .../specs/schema/src/utils/mapOpenSpec2.ts | 2 +- .../specs/schema/src/utils/mapOpenSpec3.ts | 2 +- .../specs/schema/src/utils/mapOpenSpecInfo.ts | 2 +- .../specs/schema/src/utils/mergeSpec.spec.ts | 2 +- packages/specs/schema/src/utils/mergeSpec.ts | 2 +- .../schema/src/utils/operationIdFormatter.ts | 2 +- packages/specs/schema/src/utils/ref.ts | 2 +- .../schema/src/utils/removeHiddenOperation.ts | 2 +- .../specs/schema/src/utils/transformToOS2.ts | 2 +- packages/specs/schema/test/helpers/Post.ts | 2 +- .../schema/test/helpers/validateModel.ts | 3 +- .../body-params-any.integration.spec.ts | 3 +- .../inheritance.integration.spec.ts | 3 +- .../integrations/lazyref.integration.spec.ts | 3 +- .../multipart.integration.spec.ts | 3 +- packages/specs/schema/tsconfig.esm.json | 1 - packages/specs/schema/tsconfig.spec.json | 40 ++-- packages/specs/swagger/package.json | 4 +- packages/specs/swagger/src/SwaggerModule.ts | 21 +- .../swagger/src/interfaces/SwaggerSettings.ts | 2 +- .../swagger/src/interfaces/interfaces.ts | 2 +- .../swagger/src/middlewares/cssMiddleware.ts | 2 +- .../src/middlewares/indexMiddleware.ts | 4 +- .../swagger/src/middlewares/jsMiddleware.ts | 2 +- .../src/middlewares/redirectMiddleware.ts | 2 +- .../swagger/src/services/SwaggerService.ts | 11 +- .../specs/swagger/src/utils/includeRoute.ts | 4 +- packages/specs/swagger/test/app/Server.ts | 4 +- packages/specs/swagger/tsconfig.esm.json | 1 - packages/specs/swagger/tsconfig.spec.json | 40 ++-- packages/third-parties/agenda/package.json | 2 +- .../third-parties/agenda/src/AgendaModule.ts | 15 +- .../agenda/src/decorators/define.ts | 2 +- .../agenda/src/decorators/every.ts | 2 +- .../agenda/src/interfaces/AgendaStore.ts | 2 +- .../agenda/src/interfaces/interfaces.ts | 2 +- .../agenda/src/services/AgendaFactory.ts | 3 +- ...agenda-define-manually.integration.spec.ts | 4 +- .../agenda/test/helpers/Server.ts | 4 +- .../third-parties/agenda/tsconfig.esm.json | 1 - .../third-parties/agenda/tsconfig.spec.json | 42 ++-- packages/third-parties/bullmq/package.json | 2 +- .../bullmq/src/BullMQModule.spec.ts | 2 +- .../third-parties/bullmq/src/BullMQModule.ts | 21 +- .../bullmq/src/contracts/JobMethods.ts | 2 +- .../bullmq/src/contracts/JobStore.ts | 2 +- .../bullmq/src/decorators/JobController.ts | 2 +- .../src/dispatchers/JobDispatcher.spec.ts | 5 +- .../bullmq/src/dispatchers/JobDispatcher.ts | 15 +- .../bullmq/src/utils/createQueueProvider.ts | 5 +- .../bullmq/src/utils/createWorkerProvider.ts | 5 +- .../bullmq/src/utils/mapQueueOptions.ts | 2 +- .../bullmq/src/utils/mapWorkerOptions.ts | 2 +- .../third-parties/bullmq/tsconfig.esm.json | 1 - .../third-parties/bullmq/tsconfig.spec.json | 42 ++-- .../components-scan/package.json | 2 +- .../components-scan/tsconfig.esm.json | 1 - .../components-scan/tsconfig.spec.json | 40 ++-- .../third-parties/event-emitter/package.json | 2 +- .../event-emitter/src/EventEmitterModule.ts | 10 +- .../event-emitter/src/decorators/onAny.ts | 2 +- .../event-emitter/src/decorators/onEvent.ts | 4 +- .../src/interfaces/EventEmitterStore.ts | 2 +- .../src/interfaces/interfaces.ts | 2 +- .../event-emitter/test/helpers/Server.ts | 5 +- .../event-emitter/tsconfig.esm.json | 1 - .../event-emitter/tsconfig.spec.json | 42 ++-- .../third-parties/formio-types/package.json | 2 +- .../src/domain/FormioComponent.ts | 2 +- .../formio-types/src/domain/FormioForm.ts | 4 +- .../src/domain/FormioSubmission.ts | 2 +- .../formio-types/tsconfig.esm.json | 1 - packages/third-parties/formio/package.json | 2 +- .../formio/src/FormioModule.spec.ts | 3 +- .../third-parties/formio/src/FormioModule.ts | 18 +- .../formio/src/builder/FormioMapper.spec.ts | 2 +- .../formio/src/builder/FormioMapper.ts | 2 +- .../src/components/AlterActions.spec.ts | 9 +- .../formio/src/components/AlterActions.ts | 21 +- .../formio/src/components/AlterAudit.ts | 4 +- .../formio/src/components/AlterHost.ts | 4 +- .../formio/src/components/AlterLog.ts | 4 +- .../formio/src/components/AlterSkip.ts | 5 +- .../components/AlterTemplateExportSteps.ts | 12 +- .../components/AlterTemplateImportSteps.ts | 10 +- .../formio/src/decorators/action.ts | 2 +- .../formio/src/decorators/actionCtx.ts | 4 +- .../formio/src/decorators/alter.spec.ts | 2 +- .../formio/src/decorators/on.spec.ts | 2 +- .../third-parties/formio/src/domain/Formio.ts | 28 +-- .../formio/src/domain/FormioAction.ts | 8 +- .../formio/src/domain/FormioActionsIndex.ts | 4 +- .../formio/src/domain/FormioAuth.ts | 6 +- .../formio/src/domain/FormioBaseModel.ts | 4 +- .../formio/src/domain/FormioConfig.ts | 4 +- .../formio/src/domain/FormioCtxMapper.ts | 4 +- .../formio/src/domain/FormioHooks.ts | 24 +- .../formio/src/domain/FormioModels.ts | 10 +- .../formio/src/domain/FormioRouter.ts | 6 +- .../formio/src/domain/FormioTemplate.ts | 2 +- .../formio/src/domain/FormioTemplateUtil.ts | 2 +- .../formio/src/domain/FormioUpdate.ts | 6 +- .../formio/src/domain/FormioUtils.ts | 6 +- .../formio/src/domain/Resource.ts | 2 +- .../src/middlewares/FormioAuthMiddleware.ts | 2 +- .../formio/src/services/FormioAuthService.ts | 12 +- .../formio/src/services/FormioDatabase.ts | 6 +- .../formio/src/services/FormioHooksService.ts | 8 +- .../formio/src/services/FormioInstaller.ts | 6 +- .../formio/src/services/FormioRepository.ts | 6 +- .../formio/src/services/FormioService.ts | 24 +- .../third-parties/formio/test/app/Server.ts | 5 +- .../test/app/controllers/pages/IndexCtrl.ts | 3 +- .../third-parties/formio/tsconfig.esm.json | 1 - .../third-parties/formio/tsconfig.spec.json | 42 ++-- packages/third-parties/pulse/package.json | 2 +- .../third-parties/pulse/src/PulseModule.ts | 15 +- .../pulse/src/decorators/define.ts | 2 +- .../pulse/src/decorators/every.ts | 2 +- .../pulse/src/interfaces/PulseStore.ts | 2 +- .../pulse/src/interfaces/interfaces.ts | 2 +- .../pulse/src/services/PulseFactory.ts | 3 +- .../pulse/test/helpers/Server.ts | 7 +- .../pulse-define-manually.integration.spec.ts | 7 +- .../third-parties/pulse/tsconfig.esm.json | 1 - .../third-parties/pulse/tsconfig.spec.json | 42 ++-- .../third-parties/schema-formio/package.json | 6 +- .../src/components/propertiesToComponents.ts | 2 +- .../schema-formio/src/decorators/component.ts | 3 +- .../src/decorators/customConditional.ts | 2 +- .../src/decorators/dataSourceJson.ts | 2 +- .../src/decorators/dataSourceUrl.ts | 2 +- .../schema-formio/src/decorators/form.ts | 2 +- .../schema-formio/src/decorators/tabs.ts | 3 +- .../src/domain/FormioDataResolver.ts | 4 +- .../src/registries/FormsContainer.ts | 2 +- .../src/utils/getFormioSchema.ts | 8 +- .../schema-formio/tsconfig.esm.json | 1 - .../schema-formio/tsconfig.spec.json | 42 ++-- .../socketio-testing/package.json | 2 +- .../src/services/SocketClientService.ts | 10 +- .../socketio-testing/tsconfig.esm.json | 1 - packages/third-parties/socketio/package.json | 2 +- .../socketio/src/SocketIOModule.ts | 11 +- .../src/class/SocketHandlersBuilder.spec.ts | 3 +- .../src/class/SocketHandlersBuilder.ts | 11 +- .../src/class/SocketProviderMetadata.ts | 6 +- .../socketio/src/decorators/io.ts | 2 +- .../socketio/src/decorators/nsp.ts | 2 +- .../socketio/src/decorators/socket.ts | 2 +- .../socketio/src/decorators/socketFilter.ts | 2 +- .../src/decorators/socketMiddleware.ts | 3 +- .../src/decorators/socketMiddlewareError.ts | 3 +- .../socketio/src/decorators/socketNsp.ts | 2 +- .../socketio/src/decorators/socketReturns.ts | 2 +- .../socketio/src/decorators/socketUseAfter.ts | 3 +- .../src/decorators/socketUseBefore.ts | 3 +- .../src/interfaces/OnNamespaceInit.ts | 2 +- .../src/interfaces/SocketHandlerMetadata.ts | 4 +- .../src/interfaces/SocketParamMetadata.ts | 4 +- .../socketio/src/interfaces/interfaces.ts | 2 +- .../socketio/src/services/SocketIOService.ts | 7 +- .../third-parties/socketio/test/app/Server.ts | 7 +- .../app/middlewares/InitSessionMiddleware.ts | 2 +- .../socketio/test/app/services/RoomWS.ts | 4 +- .../socketio/test/socket.integration.spec.ts | 8 +- .../third-parties/socketio/tsconfig.esm.json | 1 - .../third-parties/socketio/tsconfig.spec.json | 42 ++-- packages/third-parties/sse/package.json | 2 +- .../sse/src/domain/EventStreamContext.ts | 2 +- .../interceptors/EventStreamInterceptor.ts | 2 +- .../src/middlewares/EventStreamMiddleware.ts | 3 +- .../sse/src/sse.integration.spec.ts | 3 +- packages/third-parties/sse/tsconfig.esm.json | 1 - packages/third-parties/sse/tsconfig.spec.json | 42 ++-- packages/third-parties/stripe/package.json | 2 +- .../stripe/src/decorators/webhookEvent.ts | 3 +- .../stripe/src/domain/StripeSettings.ts | 2 +- .../src/middlewares/WebhookEventMiddleware.ts | 5 +- .../stripe/src/services/StripeFactory.ts | 2 +- .../test/app/controllers/pages/IndexCtrl.ts | 3 +- .../controllers/rest/StripeWebhooksCtrl.ts | 4 +- .../third-parties/stripe/tsconfig.esm.json | 1 - .../third-parties/stripe/tsconfig.spec.json | 42 ++-- packages/third-parties/temporal/package.json | 2 +- .../temporal/src/TemporalModule.ts | 13 +- .../temporal/src/decorators/activity.ts | 3 +- .../temporal/src/interfaces/interfaces.ts | 2 +- .../temporal/src/utils/worker.ts | 6 +- .../temporal/test/helpers/Server.ts | 7 +- .../third-parties/temporal/tsconfig.esm.json | 1 - .../third-parties/temporal/tsconfig.spec.json | 42 ++-- packages/third-parties/terminus/package.json | 2 +- .../terminus/src/TerminusModule.ts | 6 +- .../src/interfaces/TerminusSettings.ts | 2 +- .../terminus/src/interfaces/interfaces.ts | 2 +- .../third-parties/terminus/test/app/Server.ts | 4 +- .../third-parties/terminus/tsconfig.esm.json | 1 - .../third-parties/terminus/tsconfig.spec.json | 42 ++-- packages/third-parties/vike/package.json | 2 +- packages/third-parties/vike/src/ViteModule.ts | 8 +- .../vike/src/interfaces/ViteConfig.ts | 2 +- .../vike/src/interfaces/interfaces.ts | 2 +- .../src/middlewares/ViteRendererMiddleware.ts | 2 +- .../vike/src/services/ViteServer.ts | 2 +- .../vike/src/services/ViteService.ts | 9 +- packages/third-parties/vike/tsconfig.esm.json | 1 - .../third-parties/vike/tsconfig.spec.json | 42 ++-- packages/utils/normalize-path/package.json | 2 +- .../utils/normalize-path/tsconfig.esm.json | 1 - .../utils/normalize-path/tsconfig.spec.json | 41 ++-- tools/integration/src/Server.ts | 2 +- .../src/controllers/pages/IndexController.ts | 2 +- tools/integration/tsconfig.esm.json | 1 - tools/typescript/index.js | 3 +- tools/typescript/tsconfig.node.json | 1 + tools/typescript/tsconfig.template.esm.json | 1 - tools/typescript/tsconfig.template.spec.json | 1 - tsconfig.json | 38 ++-- yarn.lock | 214 +++++++++++++++++- 919 files changed, 3268 insertions(+), 2743 deletions(-) delete mode 100644 packages/graphql/typegraphql/src/interfaces/TypeGraphQLSettings.ts diff --git a/.gitignore b/.gitignore index 7e0d3289899..abeeee9ef08 100644 --- a/.gitignore +++ b/.gitignore @@ -65,6 +65,7 @@ tools/**/dist .db **/keys/jwks.json /packages/prisma/test/prisma/generated +tsconfig.*.tsbuildinfo # Website /docs/api diff --git a/docs/getting-started/snippets/base/package.json b/docs/getting-started/snippets/base/package.json index 9d1d033f4ee..5e99e3852c7 100644 --- a/docs/getting-started/snippets/base/package.json +++ b/docs/getting-started/snippets/base/package.json @@ -65,6 +65,6 @@ "supertest": "6.0.0", "ts-node": "9.0.0", "tslint": "6.1.3", - "typescript": "4.9.5" + "typescript": "5.6.2" } } diff --git a/docs/getting-started/snippets/migrate-from-express/server.js b/docs/getting-started/snippets/migrate-from-express/server.js index c2d76ff4c81..bc4cd725939 100644 --- a/docs/getting-started/snippets/migrate-from-express/server.js +++ b/docs/getting-started/snippets/migrate-from-express/server.js @@ -1,29 +1,163 @@ -const express = require("express"); -const bodyParser = require("body-parser"); -const compress = require("compression"); -const cookieParser = require("cookie-parser"); -const methodOverride = require("method-override"); -const {router: productRouter} = require("./routes/products"); - -const app = express(); -const restRouter = express.Router({mergeParams: true}); - -// middlewares - -app - .use(cookieParser()) - .use(compress({})) - .use(methodOverride()) - .use(bodyParser.json()) - .use( - bodyParser.urlencoded({ - extended: true +"use strict"; +var __esDecorate = + (this && this.__esDecorate) || + function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { + function accept(f) { + if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); + return f; + } + var kind = contextIn.kind, + key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; + var target = !descriptorIn && ctor ? (contextIn["static"] ? ctor : ctor.prototype) : null; + var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); + var _, + done = false; + for (var i = decorators.length - 1; i >= 0; i--) { + var context = {}; + for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; + for (var p in contextIn.access) context.access[p] = contextIn.access[p]; + context.addInitializer = function (f) { + if (done) throw new TypeError("Cannot add initializers after decoration has completed"); + extraInitializers.push(accept(f || null)); + }; + var result = (0, decorators[i])(kind === "accessor" ? {get: descriptor.get, set: descriptor.set} : descriptor[key], context); + if (kind === "accessor") { + if (result === void 0) continue; + if (result === null || typeof result !== "object") throw new TypeError("Object expected"); + if ((_ = accept(result.get))) descriptor.get = _; + if ((_ = accept(result.set))) descriptor.set = _; + if ((_ = accept(result.init))) initializers.unshift(_); + } else if ((_ = accept(result))) { + if (kind === "field") initializers.unshift(_); + else descriptor[key] = _; + } + } + if (target) Object.defineProperty(target, contextIn.name, descriptor); + done = true; + }; +var __runInitializers = + (this && this.__runInitializers) || + function (thisArg, initializers, value) { + var useValue = arguments.length > 2; + for (var i = 0; i < initializers.length; i++) { + value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); + } + return useValue ? value : void 0; + }; +var __setFunctionName = + (this && this.__setFunctionName) || + function (f, name, prefix) { + if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; + return Object.defineProperty(f, "name", {configurable: true, value: prefix ? "".concat(prefix, " ", name) : name}); + }; +Object.defineProperty(exports, "__esModule", {value: true}); +exports.Server = void 0; +var di_1 = require("@tsed/di"); +// import compress from "compression"; +// import cookieParser from "cookie-parser"; +// import methodOverride from "method-override"; +var Server = (function () { + var _classDecorators = [ + (0, di_1.Configuration)({ + acceptMimes: ["application/json"] }) - ); - -// routes -restRouter.use("/products", productRouter); - -app.use("/rest", restRouter); - -exports.expressApp = app; + ]; + var _classDescriptor; + var _classExtraInitializers = []; + var _classThis; + var _app_decorators; + var _app_initializers = []; + var _app_extraInitializers = []; + var _settings_decorators; + var _settings_initializers = []; + var _settings_extraInitializers = []; + var Server = (_classThis = /** @class */ (function () { + function Server_1() { + this.app = __runInitializers(this, _app_initializers, void 0); + this.settings = (__runInitializers(this, _app_extraInitializers), __runInitializers(this, _settings_initializers, void 0)); + __runInitializers(this, _settings_extraInitializers); + } + /** + * This method let you configure the express middleware required by your application to works. + * @returns {Server} + */ + Server_1.prototype.$beforeRoutesInit = function () { + // Add middlewares here only when all of your legacy routes are migrated to Ts.ED + // this.app + // .use(cookieParser()) + // .use(compress({})) + // .use(methodOverride()) + }; + return Server_1; + })()); + __setFunctionName(_classThis, "Server"); + (function () { + var _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0; + _app_decorators = [(0, di_1.Inject)()]; + _settings_decorators = [(0, di_1.Configuration)()]; + __esDecorate( + null, + null, + _app_decorators, + { + kind: "field", + name: "app", + static: false, + private: false, + access: { + has: function (obj) { + return "app" in obj; + }, + get: function (obj) { + return obj.app; + }, + set: function (obj, value) { + obj.app = value; + } + }, + metadata: _metadata + }, + _app_initializers, + _app_extraInitializers + ); + __esDecorate( + null, + null, + _settings_decorators, + { + kind: "field", + name: "settings", + static: false, + private: false, + access: { + has: function (obj) { + return "settings" in obj; + }, + get: function (obj) { + return obj.settings; + }, + set: function (obj, value) { + obj.settings = value; + } + }, + metadata: _metadata + }, + _settings_initializers, + _settings_extraInitializers + ); + __esDecorate( + null, + (_classDescriptor = {value: _classThis}), + _classDecorators, + {kind: "class", name: _classThis.name, metadata: _metadata}, + null, + _classExtraInitializers + ); + Server = _classThis = _classDescriptor.value; + if (_metadata) + Object.defineProperty(_classThis, Symbol.metadata, {enumerable: true, configurable: true, writable: true, value: _metadata}); + __runInitializers(_classThis, _classExtraInitializers); + })(); + return (Server = _classThis); +})(); +exports.Server = Server; diff --git a/eslint.config.mjs b/eslint.config.mjs index ffce1c23d37..bce1e64c6d8 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -13,6 +13,7 @@ export default [ }, { files: ["**/*.{js,mjs,cjs,jsx,mjsx,ts,tsx,mtsx}"], + ignores: ["**/lib/**", "**/dist/**", "**/coverage/**", "**/docs/**", "**/docs-references/**"], languageOptions: { ecmaVersion: "latest", sourceType: "module", diff --git a/package.json b/package.json index 7a4e5620d12..2780ee47c08 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "scripts": { "postinstall": "cd docs && yarn install && cd .. && node ./tools/github-sponsors/bin/github-sponsors.js", "configure": "monorepo ci configure", - "clean": "monorepo clean workspace", + "clean": "monorepo clean workspace && rimraf **/tsconfig.spec.tsbuildinfo", "test": "vitest run", "test:ci": "yarn test:lint && yarn test:core && yarn test:specs && yarn test:platform && yarn test:integration && yarn test:graphql && yarn test:orm && yarn test:security && yarn test:third-parties", "test:lint": "eslint '**/*.{ts,js}'", diff --git a/packages/core/package.json b/packages/core/package.json index 7c9deac6166..1efea1c6cbb 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -13,7 +13,7 @@ "types": "./lib/types/index.d.ts", "browser": "./lib/browser/core.umd.min.js", "import": "./lib/esm/index.js", - "default": "./lib/cjs/index.js" + "default": "./lib/esm/index.js" } }, "scripts": { diff --git a/packages/core/src/decorators/deprecated.ts b/packages/core/src/decorators/deprecated.ts index 975cdbd222a..9cad251c998 100644 --- a/packages/core/src/decorators/deprecated.ts +++ b/packages/core/src/decorators/deprecated.ts @@ -1,4 +1,4 @@ -import {Type} from "../domain/Type.js"; +import type {Type} from "../domain/Type.js"; function deprecate(fn: any, msg: string) { if (typeof process !== "undefined" && (process as any).noDeprecation === true) { diff --git a/packages/core/src/decorators/storeFn.ts b/packages/core/src/decorators/storeFn.ts index 4f14cec3b76..e0b7955b832 100644 --- a/packages/core/src/decorators/storeFn.ts +++ b/packages/core/src/decorators/storeFn.ts @@ -1,5 +1,5 @@ import {Store} from "../domain/Store.js"; -import {DecoratorParameters} from "../interfaces/DecoratorParameters.js"; +import type {DecoratorParameters} from "../interfaces/DecoratorParameters.js"; /** * Create a store correctly configured from the parameters given by the decorator. diff --git a/packages/core/src/decorators/storeMerge.ts b/packages/core/src/decorators/storeMerge.ts index 8366dd36a47..b074f4967e2 100644 --- a/packages/core/src/decorators/storeMerge.ts +++ b/packages/core/src/decorators/storeMerge.ts @@ -1,4 +1,4 @@ -import {Store} from "../domain/Store.js"; +import type {Store} from "../domain/Store.js"; import {StoreFn} from "./storeFn.js"; export function StoreMerge(key: any, value: any): Function { diff --git a/packages/core/src/decorators/storeSet.ts b/packages/core/src/decorators/storeSet.ts index 9f548337065..cd9551582db 100644 --- a/packages/core/src/decorators/storeSet.ts +++ b/packages/core/src/decorators/storeSet.ts @@ -1,4 +1,4 @@ -import {Store} from "../domain/Store.js"; +import type {Store} from "../domain/Store.js"; import {StoreFn} from "./storeFn.js"; export function StoreSet(key: any, value: any): Function { diff --git a/packages/core/src/utils/decorators/decoratorArgs.ts b/packages/core/src/utils/decorators/decoratorArgs.ts index 566bac24605..b5916cc6b33 100644 --- a/packages/core/src/utils/decorators/decoratorArgs.ts +++ b/packages/core/src/utils/decorators/decoratorArgs.ts @@ -1,4 +1,4 @@ -import {DecoratorParameters} from "../../interfaces/DecoratorParameters.js"; +import type {DecoratorParameters} from "../../interfaces/DecoratorParameters.js"; import {descriptorOf} from "../objects/descriptorOf.js"; export function decoratorArgs(target: any, propertyKey: string): DecoratorParameters { diff --git a/packages/core/src/utils/decorators/useDecorators.spec.ts b/packages/core/src/utils/decorators/useDecorators.spec.ts index fd97adc9554..ce3abe787d6 100644 --- a/packages/core/src/utils/decorators/useDecorators.spec.ts +++ b/packages/core/src/utils/decorators/useDecorators.spec.ts @@ -1,6 +1,6 @@ import {StoreFn} from "../../decorators/storeFn.js"; import {Store} from "../../domain/Store.js"; -import {AnyDecorator} from "../../interfaces/AnyDecorator.js"; +import type {AnyDecorator} from "../../interfaces/AnyDecorator.js"; import {useDecorators} from "./useDecorators.js"; describe("useDecorators", () => { diff --git a/packages/core/src/utils/decorators/useDecorators.ts b/packages/core/src/utils/decorators/useDecorators.ts index 1b72739f2b8..2c85b65e6d1 100644 --- a/packages/core/src/utils/decorators/useDecorators.ts +++ b/packages/core/src/utils/decorators/useDecorators.ts @@ -1,5 +1,5 @@ -import {AnyDecorator} from "../../interfaces/AnyDecorator.js"; -import {DecoratorParameters} from "../../interfaces/DecoratorParameters.js"; +import type {AnyDecorator} from "../../interfaces/AnyDecorator.js"; +import type {DecoratorParameters} from "../../interfaces/DecoratorParameters.js"; export function useDecorators(...decorators: AnyDecorator[]): any { return (...args: DecoratorParameters) => { diff --git a/packages/core/src/utils/decorators/useMethodDecorators.ts b/packages/core/src/utils/decorators/useMethodDecorators.ts index 5178b57df2f..081fa981209 100644 --- a/packages/core/src/utils/decorators/useMethodDecorators.ts +++ b/packages/core/src/utils/decorators/useMethodDecorators.ts @@ -1,4 +1,4 @@ -import {AnyDecorator} from "../../interfaces/AnyDecorator.js"; +import type {AnyDecorator} from "../../interfaces/AnyDecorator.js"; import {descriptorOf} from "../objects/descriptorOf.js"; export function useMethodDecorator(decorator: AnyDecorator) { diff --git a/packages/core/src/utils/objects/methodsOf.ts b/packages/core/src/utils/objects/methodsOf.ts index 04b24d0a953..c92d510e493 100644 --- a/packages/core/src/utils/objects/methodsOf.ts +++ b/packages/core/src/utils/objects/methodsOf.ts @@ -1,4 +1,4 @@ -import {Type} from "../../domain/Type.js"; +import type {Type} from "../../domain/Type.js"; import {ancestorsOf} from "./ancestorsOf.js"; import {classOf} from "./classOf.js"; import {prototypeOf} from "./prototypeOf.js"; diff --git a/packages/core/tsconfig.spec.json b/packages/core/tsconfig.spec.json index d0d6ee5dec0..eb497e5af61 100644 --- a/packages/core/tsconfig.spec.json +++ b/packages/core/tsconfig.spec.json @@ -3,31 +3,31 @@ "compilerOptions": { "baseUrl": ".", "rootDir": "..", - "outDir": "./lib/cjs", "declaration": false, "composite": false, "noEmit": true, "paths": { - "@tsed/openspec": ["../specs/openspec/src"], - "@tsed/schema": ["../specs/schema/src"], - "@tsed/di": ["../di/src"], - "@tsed/exceptions": ["../specs/exceptions/src"], - "@tsed/json-mapper": ["../specs/json-mapper/src"], - "@tsed/platform-exceptions": ["../platform/platform-exceptions/src"], - "@tsed/platform-middlewares": ["../platform/platform-middlewares/src"], - "@tsed/platform-params": ["../platform/platform-params/src"], - "@tsed/platform-log-middleware": ["../platform/platform-log-middleware/src"], - "@tsed/platform-response-filter": ["../platform/platform-response-filter/src"], - "@tsed/platform-router": ["../platform/platform-router/src"], - "@tsed/platform-views": ["../platform/platform-views/src"], - "@tsed/components-scan": ["../third-parties/components-scan/src"], - "@tsed/common": ["../platform/common/src"], - "@tsed/ajv": ["../specs/ajv/src"], - "@tsed/platform-cache": ["../platform/platform-cache/src"], - "@tsed/swagger": ["../specs/swagger/src"], - "@tsed/platform-test-sdk": ["../platform/platform-test-sdk/src"], - "@tsed/platform-express": ["../platform/platform-express/src"], - "@tsed/platform-koa": ["../platform/platform-koa/src"] + "@tsed/openspec": ["../specs/openspec/src/index.ts"], + "@tsed/schema": ["../specs/schema/src/index.ts"], + "@tsed/di": ["../di/src/index.ts"], + "@tsed/exceptions": ["../specs/exceptions/src/index.ts"], + "@tsed/json-mapper": ["../specs/json-mapper/src/index.ts"], + "@tsed/platform-exceptions": ["../platform/platform-exceptions/src/index.ts"], + "@tsed/platform-middlewares": ["../platform/platform-middlewares/src/index.ts"], + "@tsed/platform-params": ["../platform/platform-params/src/index.ts"], + "@tsed/platform-log-middleware": ["../platform/platform-log-middleware/src/index.ts"], + "@tsed/platform-response-filter": ["../platform/platform-response-filter/src/index.ts"], + "@tsed/platform-router": ["../platform/platform-router/src/index.ts"], + "@tsed/platform-views": ["../platform/platform-views/src/index.ts"], + "@tsed/normalize-path": ["../utils/normalize-path/src/index.ts"], + "@tsed/components-scan": ["../third-parties/components-scan/src/index.ts"], + "@tsed/common": ["../platform/common/src/index.ts"], + "@tsed/ajv": ["../specs/ajv/src/index.ts"], + "@tsed/platform-cache": ["../platform/platform-cache/src/index.ts"], + "@tsed/swagger": ["../specs/swagger/src/index.ts"], + "@tsed/platform-test-sdk": ["../platform/platform-test-sdk/src/index.ts"], + "@tsed/platform-express": ["../platform/platform-express/src/index.ts"], + "@tsed/platform-koa": ["../platform/platform-koa/src/index.ts"] }, "types": ["vite/client", "vitest/globals"] }, diff --git a/packages/di/package.json b/packages/di/package.json index 18290f92aa5..acc335315ff 100644 --- a/packages/di/package.json +++ b/packages/di/package.json @@ -13,7 +13,7 @@ "types": "./lib/types/index.d.ts", "browser": "./lib/browser/di.umd.min.js", "import": "./lib/esm/index.js", - "default": "./lib/cjs/index.js" + "default": "./lib/esm/index.js" } }, "scripts": { @@ -37,7 +37,7 @@ "cross-env": "7.0.3", "eslint": "^8.57.0", "typescript": "5.6.2", - "vitest": "2.0.4", + "vitest": "2.1.1", "webpack": "^5.75.0" }, "peerDependencies": { diff --git a/packages/di/src/common/decorators/configuration.ts b/packages/di/src/common/decorators/configuration.ts index d43bace5b8b..93661ff3ed3 100644 --- a/packages/di/src/common/decorators/configuration.ts +++ b/packages/di/src/common/decorators/configuration.ts @@ -1,6 +1,7 @@ -import {DecoratorParameters, decoratorTypeOf, DecoratorTypes, StoreSet} from "@tsed/core"; +import type {DecoratorParameters} from "@tsed/core"; +import {decoratorTypeOf, DecoratorTypes, StoreSet} from "@tsed/core"; -import {DIConfiguration} from "../services/DIConfiguration.js"; +import type {DIConfiguration} from "../services/DIConfiguration.js"; import {Inject} from "./inject.js"; /** diff --git a/packages/di/src/common/decorators/controller.ts b/packages/di/src/common/decorators/controller.ts index 04e47d01f1c..cb1cfd544bb 100644 --- a/packages/di/src/common/decorators/controller.ts +++ b/packages/di/src/common/decorators/controller.ts @@ -1,7 +1,8 @@ -import {isArrayOrArrayClass, Type, useDecorators} from "@tsed/core"; +import type {Type} from "@tsed/core"; +import {isArrayOrArrayClass, useDecorators} from "@tsed/core"; import {Children, Path} from "@tsed/schema"; -import {ProviderOpts} from "../interfaces/ProviderOpts.js"; +import type {ProviderOpts} from "../interfaces/ProviderOpts.js"; import {registerController} from "../registries/ProviderRegistry.js"; export type PathType = string | RegExp | (string | RegExp)[]; diff --git a/packages/di/src/common/decorators/inject.ts b/packages/di/src/common/decorators/inject.ts index 5bb8c1c7c17..a2cfe5cb97d 100644 --- a/packages/di/src/common/decorators/inject.ts +++ b/packages/di/src/common/decorators/inject.ts @@ -3,7 +3,7 @@ import {catchError, decoratorTypeOf, DecoratorTypes, isPromise, Metadata, Store, import {DI_INJECTABLE_PROPS, DI_INVOKE_OPTIONS, DI_USE_OPTIONS} from "../constants/constants.js"; import {InvalidPropertyTokenError} from "../errors/InvalidPropertyTokenError.js"; import type {InvokeOptions} from "../interfaces/InvokeOptions.js"; -import {TokenProvider} from "../interfaces/TokenProvider.js"; +import type {TokenProvider} from "../interfaces/TokenProvider.js"; import {InjectorService} from "../services/InjectorService.js"; import {getConstructorDependencies, setConstructorDependencies} from "../utils/getConstructorDependencies.js"; diff --git a/packages/di/src/common/decorators/intercept.spec.ts b/packages/di/src/common/decorators/intercept.spec.ts index 278364432e2..aa78b8934fb 100644 --- a/packages/di/src/common/decorators/intercept.spec.ts +++ b/packages/di/src/common/decorators/intercept.spec.ts @@ -1,16 +1,17 @@ import {catchError} from "@tsed/core"; import {DITest} from "../../node/index.js"; -import {InterceptorContext} from "../interfaces/InterceptorContext.js"; -import {InterceptorMethods} from "../interfaces/InterceptorMethods.js"; +import type {InterceptorContext} from "../interfaces/InterceptorContext.js"; +import type {InterceptorMethods} from "../interfaces/InterceptorMethods.js"; import {InjectorService} from "../services/InjectorService.js"; +import {Inject} from "./inject.js"; import {getInterceptorOptions, Intercept} from "./intercept.js"; import {Interceptor} from "./interceptor.js"; import {Service} from "./service.js"; @Interceptor() class MyInterceptor implements InterceptorMethods { - constructor(injSrv: InjectorService) { + constructor(@Inject(InjectorService) injSrv: InjectorService) { // do some logic } diff --git a/packages/di/src/common/decorators/intercept.ts b/packages/di/src/common/decorators/intercept.ts index 76a7a7dc010..9ba43286c2c 100644 --- a/packages/di/src/common/decorators/intercept.ts +++ b/packages/di/src/common/decorators/intercept.ts @@ -1,4 +1,5 @@ -import {classOf, decorateMethodsOf, DecoratorParameters, decoratorTypeOf, DecoratorTypes, Store, Type} from "@tsed/core"; +import type {DecoratorParameters, Type} from "@tsed/core"; +import {classOf, decorateMethodsOf, decoratorTypeOf, DecoratorTypes, Store} from "@tsed/core"; import {DI_INTERCEPTOR_OPTIONS, DI_INVOKE_OPTIONS} from "../constants/constants.js"; import type {InterceptorContext} from "../interfaces/InterceptorContext.js"; diff --git a/packages/di/src/common/decorators/module.ts b/packages/di/src/common/decorators/module.ts index e10464551a4..16e7eca143e 100644 --- a/packages/di/src/common/decorators/module.ts +++ b/packages/di/src/common/decorators/module.ts @@ -2,8 +2,8 @@ import {useDecorators} from "@tsed/core"; import {ProviderScope} from "../domain/ProviderScope.js"; import {ProviderType} from "../domain/ProviderType.js"; -import {DIResolver} from "../interfaces/DIResolver.js"; -import {TokenProvider} from "../interfaces/TokenProvider.js"; +import type {DIResolver} from "../interfaces/DIResolver.js"; +import type {TokenProvider} from "../interfaces/TokenProvider.js"; import {Configuration} from "./configuration.js"; import {Injectable} from "./injectable.js"; diff --git a/packages/di/src/common/decorators/overrideProvider.ts b/packages/di/src/common/decorators/overrideProvider.ts index 46382f6cd8f..2b3b6eba20b 100644 --- a/packages/di/src/common/decorators/overrideProvider.ts +++ b/packages/di/src/common/decorators/overrideProvider.ts @@ -1,4 +1,4 @@ -import {Type} from "@tsed/core"; +import type {Type} from "@tsed/core"; import {GlobalProviders} from "../registries/GlobalProviders.js"; diff --git a/packages/di/src/common/domain/ControllerProvider.ts b/packages/di/src/common/domain/ControllerProvider.ts index f0811545765..7ae5826af90 100644 --- a/packages/di/src/common/domain/ControllerProvider.ts +++ b/packages/di/src/common/domain/ControllerProvider.ts @@ -1,5 +1,5 @@ -import {ControllerMiddlewares} from "../decorators/controller.js"; -import {TokenProvider} from "../interfaces/TokenProvider.js"; +import type {ControllerMiddlewares} from "../decorators/controller.js"; +import type {TokenProvider} from "../interfaces/TokenProvider.js"; import {Provider} from "./Provider.js"; import {ProviderType} from "./ProviderType.js"; diff --git a/packages/di/src/common/domain/Provider.ts b/packages/di/src/common/domain/Provider.ts index 8534c01e264..15063b883e9 100644 --- a/packages/di/src/common/domain/Provider.ts +++ b/packages/di/src/common/domain/Provider.ts @@ -1,4 +1,5 @@ -import {type AbstractType, classOf, getClassOrSymbol, isClass, methodsOf, nameOf, Store, Type} from "@tsed/core"; +import type {Type} from "@tsed/core"; +import {type AbstractType, classOf, getClassOrSymbol, isClass, methodsOf, nameOf, Store} from "@tsed/core"; import type {ProviderOpts} from "../interfaces/ProviderOpts.js"; import type {TokenProvider} from "../interfaces/TokenProvider.js"; diff --git a/packages/di/src/common/errors/InjectionError.ts b/packages/di/src/common/errors/InjectionError.ts index de7ab2054ff..6204600053e 100644 --- a/packages/di/src/common/errors/InjectionError.ts +++ b/packages/di/src/common/errors/InjectionError.ts @@ -1,6 +1,6 @@ import {getConstructorArgNames, isClass, isString, nameOf} from "@tsed/core"; -import {TokenProvider} from "../interfaces/TokenProvider.js"; +import type {TokenProvider} from "../interfaces/TokenProvider.js"; import {colors} from "../utils/colors.js"; export class InjectionError extends Error { diff --git a/packages/di/src/common/integration/di.spec.ts b/packages/di/src/common/integration/di.spec.ts index 81ea8e251b4..68f5773758b 100644 --- a/packages/di/src/common/integration/di.spec.ts +++ b/packages/di/src/common/integration/di.spec.ts @@ -5,7 +5,7 @@ import {Service} from "../decorators/service.js"; import {Container} from "../domain/Container.js"; import {LocalsContainer} from "../domain/LocalsContainer.js"; import {ProviderScope} from "../domain/ProviderScope.js"; -import {OnDestroy} from "../interfaces/OnDestroy.js"; +import type {OnDestroy} from "../interfaces/OnDestroy.js"; import {GlobalProviders} from "../registries/GlobalProviders.js"; import {InjectorService} from "../services/InjectorService.js"; diff --git a/packages/di/src/common/integration/request.spec.ts b/packages/di/src/common/integration/request.spec.ts index dda0418b2d1..c3c0412170a 100644 --- a/packages/di/src/common/integration/request.spec.ts +++ b/packages/di/src/common/integration/request.spec.ts @@ -3,7 +3,7 @@ import {Service} from "../decorators/service.js"; import {Container} from "../domain/Container.js"; import {LocalsContainer} from "../domain/LocalsContainer.js"; import {ProviderScope} from "../domain/ProviderScope.js"; -import {OnDestroy} from "../interfaces/OnDestroy.js"; +import type {OnDestroy} from "../interfaces/OnDestroy.js"; import {GlobalProviders} from "../registries/GlobalProviders.js"; import {InjectorService} from "../services/InjectorService.js"; diff --git a/packages/di/src/common/interfaces/InvokeOptions.ts b/packages/di/src/common/interfaces/InvokeOptions.ts index f292e5644fd..a2d3f9d0cd9 100644 --- a/packages/di/src/common/interfaces/InvokeOptions.ts +++ b/packages/di/src/common/interfaces/InvokeOptions.ts @@ -1,6 +1,6 @@ import type {LocalsContainer} from "../domain/LocalsContainer.js"; -import {ProviderScope} from "../domain/ProviderScope.js"; -import {TokenProvider} from "./TokenProvider.js"; +import type {ProviderScope} from "../domain/ProviderScope.js"; +import type {TokenProvider} from "./TokenProvider.js"; export interface InvokeOptions { /** diff --git a/packages/di/src/common/interfaces/RegistrySettings.ts b/packages/di/src/common/interfaces/RegistrySettings.ts index 91444bc3fe9..1c8c78ffce3 100644 --- a/packages/di/src/common/interfaces/RegistrySettings.ts +++ b/packages/di/src/common/interfaces/RegistrySettings.ts @@ -1,4 +1,4 @@ -import {Type} from "@tsed/core"; +import type {Type} from "@tsed/core"; import type {LocalsContainer} from "../domain/LocalsContainer.js"; import type {Provider} from "../domain/Provider.js"; diff --git a/packages/di/src/common/interfaces/TokenRoute.ts b/packages/di/src/common/interfaces/TokenRoute.ts index d20d3ced44f..d3449387eae 100644 --- a/packages/di/src/common/interfaces/TokenRoute.ts +++ b/packages/di/src/common/interfaces/TokenRoute.ts @@ -1,4 +1,4 @@ -import {TokenProvider} from "./TokenProvider.js"; +import type {TokenProvider} from "./TokenProvider.js"; export interface TokenRoute { token: TokenProvider; diff --git a/packages/di/src/common/registries/GlobalProviders.ts b/packages/di/src/common/registries/GlobalProviders.ts index 9b3ca327f76..73f5fd45d72 100644 --- a/packages/di/src/common/registries/GlobalProviders.ts +++ b/packages/di/src/common/registries/GlobalProviders.ts @@ -1,12 +1,13 @@ -import {getClassOrSymbol, Type} from "@tsed/core"; +import type {Type} from "@tsed/core"; +import {getClassOrSymbol} from "@tsed/core"; import type {LocalsContainer} from "../domain/LocalsContainer.js"; import {Provider} from "../domain/Provider.js"; import {ProviderType} from "../domain/ProviderType.js"; -import {ProviderOpts} from "../interfaces/ProviderOpts.js"; -import {RegistrySettings} from "../interfaces/RegistrySettings.js"; -import {ResolvedInvokeOptions} from "../interfaces/ResolvedInvokeOptions.js"; -import {TokenProvider} from "../interfaces/TokenProvider.js"; +import type {ProviderOpts} from "../interfaces/ProviderOpts.js"; +import type {RegistrySettings} from "../interfaces/RegistrySettings.js"; +import type {ResolvedInvokeOptions} from "../interfaces/ResolvedInvokeOptions.js"; +import type {TokenProvider} from "../interfaces/TokenProvider.js"; import type {InjectorService} from "../services/InjectorService.js"; export class GlobalProviderRegistry extends Map { diff --git a/packages/di/src/common/services/DIConfiguration.ts b/packages/di/src/common/services/DIConfiguration.ts index 26c5f5f734b..f77a9dd4b67 100644 --- a/packages/di/src/common/services/DIConfiguration.ts +++ b/packages/di/src/common/services/DIConfiguration.ts @@ -1,4 +1,5 @@ -import {Env, getValue, proxyDelegation, setValue} from "@tsed/core"; +import type {Env} from "@tsed/core"; +import {getValue, proxyDelegation, setValue} from "@tsed/core"; import type {ProviderScope} from "../domain/ProviderScope.js"; import type {DILoggerOptions} from "../interfaces/DILoggerOptions.js"; diff --git a/packages/di/src/common/services/DILogger.ts b/packages/di/src/common/services/DILogger.ts index 455ac2a91c0..de2226bf03b 100644 --- a/packages/di/src/common/services/DILogger.ts +++ b/packages/di/src/common/services/DILogger.ts @@ -1,4 +1,4 @@ -import {DILogger} from "../interfaces/DILogger.js"; +import type {DILogger} from "../interfaces/DILogger.js"; import {registerProvider} from "../registries/ProviderRegistry.js"; import {InjectorService} from "./InjectorService.js"; diff --git a/packages/di/src/common/utils/__mock__/module1/controllers/M1Ctrl1.ts b/packages/di/src/common/utils/__mock__/module1/controllers/M1Ctrl1.ts index 3baf608a273..e58656ccca5 100644 --- a/packages/di/src/common/utils/__mock__/module1/controllers/M1Ctrl1.ts +++ b/packages/di/src/common/utils/__mock__/module1/controllers/M1Ctrl1.ts @@ -1,5 +1,5 @@ import {Controller} from "../../../../decorators/controller.js"; -import {M1Service} from "../services/M1Service.js"; +import type {M1Service} from "../services/M1Service.js"; @Controller("/m1") export class M1Ctrl1 { diff --git a/packages/di/src/common/utils/__mock__/module1/services/M1Service.ts b/packages/di/src/common/utils/__mock__/module1/services/M1Service.ts index 0afcacd8b5c..ab3c2041064 100644 --- a/packages/di/src/common/utils/__mock__/module1/services/M1Service.ts +++ b/packages/di/src/common/utils/__mock__/module1/services/M1Service.ts @@ -1,5 +1,5 @@ import {Injectable} from "../../../../decorators/injectable.js"; -import {SubService} from "../submodule/SubService.js"; +import type {SubService} from "../submodule/SubService.js"; @Injectable() export class M1Service { diff --git a/packages/di/src/common/utils/createContainer.ts b/packages/di/src/common/utils/createContainer.ts index 7c26b1d06e5..84a038b48ab 100644 --- a/packages/di/src/common/utils/createContainer.ts +++ b/packages/di/src/common/utils/createContainer.ts @@ -1,4 +1,4 @@ -import {Type} from "@tsed/core"; +import type {Type} from "@tsed/core"; import {Container} from "../domain/Container.js"; import {GlobalProviders} from "../registries/GlobalProviders.js"; diff --git a/packages/di/src/common/utils/getConfiguration.ts b/packages/di/src/common/utils/getConfiguration.ts index 64a0a9fc7ca..b702d90cf17 100644 --- a/packages/di/src/common/utils/getConfiguration.ts +++ b/packages/di/src/common/utils/getConfiguration.ts @@ -1,4 +1,5 @@ -import {Store, Type} from "@tsed/core"; +import type {Type} from "@tsed/core"; +import {Store} from "@tsed/core"; export function mergeMount(m1: any = {}, m2: any = {}) { return Object.entries(m2).reduce((mount, [key, controllers]) => { diff --git a/packages/di/src/common/utils/resolveControllers.ts b/packages/di/src/common/utils/resolveControllers.ts index 31824b9b43f..f3683bb19c5 100644 --- a/packages/di/src/common/utils/resolveControllers.ts +++ b/packages/di/src/common/utils/resolveControllers.ts @@ -1,9 +1,9 @@ import {isArray, isClass} from "@tsed/core"; -import {Provider} from "../domain/Provider.js"; +import type {Provider} from "../domain/Provider.js"; import {ProviderType} from "../domain/ProviderType.js"; -import {TokenProvider} from "../interfaces/TokenProvider.js"; -import {TokenRoute} from "../interfaces/TokenRoute.js"; +import type {TokenProvider} from "../interfaces/TokenProvider.js"; +import type {TokenRoute} from "../interfaces/TokenRoute.js"; import {GlobalProviders} from "../registries/GlobalProviders.js"; const lookupProperties = ["mount", "imports"]; diff --git a/packages/di/src/node/domain/ContextLogger.ts b/packages/di/src/node/domain/ContextLogger.ts index ee2f306c5a0..fa9243f9c1e 100644 --- a/packages/di/src/node/domain/ContextLogger.ts +++ b/packages/di/src/node/domain/ContextLogger.ts @@ -1,7 +1,8 @@ import {Hooks} from "@tsed/core"; -import {levels, LogLevel} from "@tsed/logger"; +import type {LogLevel} from "@tsed/logger"; +import {levels} from "@tsed/logger"; -import {DILogger} from "../../common/index.js"; +import type {DILogger} from "../../common/index.js"; export interface ContextLoggerOptions extends Record { id: string; diff --git a/packages/di/src/node/domain/DIContext.ts b/packages/di/src/node/domain/DIContext.ts index 0b2ecc8326a..1befafef55f 100644 --- a/packages/di/src/node/domain/DIContext.ts +++ b/packages/di/src/node/domain/DIContext.ts @@ -1,6 +1,8 @@ -import {InjectorService, LocalsContainer} from "../../common/index.js"; +import type {InjectorService} from "../../common/index.js"; +import {LocalsContainer} from "../../common/index.js"; import {runInContext} from "../utils/asyncHookContext.js"; -import {ContextLogger, ContextLoggerOptions} from "./ContextLogger.js"; +import type {ContextLoggerOptions} from "./ContextLogger.js"; +import {ContextLogger} from "./ContextLogger.js"; export interface DIContextOptions extends Omit { id: string; diff --git a/packages/di/src/node/integration/inject-context.spec.ts b/packages/di/src/node/integration/inject-context.spec.ts index 2088df52db5..81ae23b93ef 100644 --- a/packages/di/src/node/integration/inject-context.spec.ts +++ b/packages/di/src/node/integration/inject-context.spec.ts @@ -1,6 +1,6 @@ import {Injectable} from "../../common/index.js"; import {InjectContext} from "../decorators/injectContext.js"; -import {DIContext} from "../domain/DIContext.js"; +import type {DIContext} from "../domain/DIContext.js"; import {DITest} from "../services/DITest.js"; import {runInContext} from "../utils/asyncHookContext.js"; diff --git a/packages/di/src/node/services/DITest.ts b/packages/di/src/node/services/DITest.ts index d34674b0841..1db0c190492 100644 --- a/packages/di/src/node/services/DITest.ts +++ b/packages/di/src/node/services/DITest.ts @@ -1,14 +1,8 @@ import {Env, getValue, isClass, isObject, isPromise, setValue} from "@tsed/core"; import {$log} from "@tsed/logger"; -import { - createContainer, - DI_INJECTABLE_PROPS, - InjectorService, - type OnInit, - TokenProvider, - type UseImportTokenProviderOpts -} from "../../common/index.js"; +import type {TokenProvider} from "../../common/index.js"; +import {createContainer, DI_INJECTABLE_PROPS, InjectorService, type OnInit, type UseImportTokenProviderOpts} from "../../common/index.js"; import {DIContext} from "../domain/DIContext.js"; import {setLoggerConfiguration} from "../utils/setLoggerConfiguration.js"; diff --git a/packages/di/src/node/utils/__mock__/module1/controllers/M1Ctrl1.ts b/packages/di/src/node/utils/__mock__/module1/controllers/M1Ctrl1.ts index 3baf608a273..e58656ccca5 100644 --- a/packages/di/src/node/utils/__mock__/module1/controllers/M1Ctrl1.ts +++ b/packages/di/src/node/utils/__mock__/module1/controllers/M1Ctrl1.ts @@ -1,5 +1,5 @@ import {Controller} from "../../../../decorators/controller.js"; -import {M1Service} from "../services/M1Service.js"; +import type {M1Service} from "../services/M1Service.js"; @Controller("/m1") export class M1Ctrl1 { diff --git a/packages/di/src/node/utils/__mock__/module1/services/M1Service.ts b/packages/di/src/node/utils/__mock__/module1/services/M1Service.ts index 0afcacd8b5c..ab3c2041064 100644 --- a/packages/di/src/node/utils/__mock__/module1/services/M1Service.ts +++ b/packages/di/src/node/utils/__mock__/module1/services/M1Service.ts @@ -1,5 +1,5 @@ import {Injectable} from "../../../../decorators/injectable.js"; -import {SubService} from "../submodule/SubService.js"; +import type {SubService} from "../submodule/SubService.js"; @Injectable() export class M1Service { diff --git a/packages/di/src/node/utils/asyncHookContext.ts b/packages/di/src/node/utils/asyncHookContext.ts index 104087a335d..752788067f9 100644 --- a/packages/di/src/node/utils/asyncHookContext.ts +++ b/packages/di/src/node/utils/asyncHookContext.ts @@ -1,6 +1,6 @@ import {AsyncLocalStorage, AsyncResource} from "async_hooks"; -import {InjectorService} from "../../common/index.js"; +import type {InjectorService} from "../../common/index.js"; import type {DIContext} from "../domain/DIContext.js"; const storage: AsyncLocalStorage<{current: DIContext | undefined}> = new AsyncLocalStorage(); diff --git a/packages/di/src/node/utils/attachLogger.ts b/packages/di/src/node/utils/attachLogger.ts index 4ed6a035fba..54d7f02bb38 100644 --- a/packages/di/src/node/utils/attachLogger.ts +++ b/packages/di/src/node/utils/attachLogger.ts @@ -1,4 +1,4 @@ -import {DILogger, InjectorService} from "../../common/index.js"; +import type {DILogger, InjectorService} from "../../common/index.js"; import {setLoggerConfiguration} from "./setLoggerConfiguration.js"; export function attachLogger(injector: InjectorService, $log: DILogger) { diff --git a/packages/di/tsconfig.esm.json b/packages/di/tsconfig.esm.json index 4c2a1ac34b9..8954049da4a 100644 --- a/packages/di/tsconfig.esm.json +++ b/packages/di/tsconfig.esm.json @@ -9,10 +9,7 @@ "composite": true, "noEmit": false }, - "include": [ - "src", - "src/**/*.json" - ], + "include": ["src/**/*.ts", "src/**/*.json"], "exclude": [ "node_modules", "test", diff --git a/packages/di/tsconfig.spec.json b/packages/di/tsconfig.spec.json index c0db232c547..cea22b282a7 100644 --- a/packages/di/tsconfig.spec.json +++ b/packages/di/tsconfig.spec.json @@ -3,30 +3,30 @@ "compilerOptions": { "baseUrl": ".", "rootDir": "..", - "outDir": "./lib/cjs", "declaration": false, "composite": false, "noEmit": true, "paths": { - "@tsed/openspec": ["../specs/openspec/src"], - "@tsed/schema": ["../specs/schema/src"], - "@tsed/exceptions": ["../specs/exceptions/src"], - "@tsed/json-mapper": ["../specs/json-mapper/src"], - "@tsed/platform-exceptions": ["../platform/platform-exceptions/src"], - "@tsed/platform-middlewares": ["../platform/platform-middlewares/src"], - "@tsed/platform-params": ["../platform/platform-params/src"], - "@tsed/platform-log-middleware": ["../platform/platform-log-middleware/src"], - "@tsed/platform-response-filter": ["../platform/platform-response-filter/src"], - "@tsed/platform-router": ["../platform/platform-router/src"], - "@tsed/platform-views": ["../platform/platform-views/src"], - "@tsed/components-scan": ["../third-parties/components-scan/src"], - "@tsed/common": ["../platform/common/src"], - "@tsed/ajv": ["../specs/ajv/src"], - "@tsed/platform-cache": ["../platform/platform-cache/src"], - "@tsed/swagger": ["../specs/swagger/src"], - "@tsed/platform-test-sdk": ["../platform/platform-test-sdk/src"], - "@tsed/platform-express": ["../platform/platform-express/src"], - "@tsed/platform-koa": ["../platform/platform-koa/src"] + "@tsed/openspec": ["../specs/openspec/src/index.ts"], + "@tsed/schema": ["../specs/schema/src/index.ts"], + "@tsed/exceptions": ["../specs/exceptions/src/index.ts"], + "@tsed/json-mapper": ["../specs/json-mapper/src/index.ts"], + "@tsed/platform-exceptions": ["../platform/platform-exceptions/src/index.ts"], + "@tsed/platform-middlewares": ["../platform/platform-middlewares/src/index.ts"], + "@tsed/platform-params": ["../platform/platform-params/src/index.ts"], + "@tsed/platform-log-middleware": ["../platform/platform-log-middleware/src/index.ts"], + "@tsed/platform-response-filter": ["../platform/platform-response-filter/src/index.ts"], + "@tsed/platform-router": ["../platform/platform-router/src/index.ts"], + "@tsed/platform-views": ["../platform/platform-views/src/index.ts"], + "@tsed/normalize-path": ["../utils/normalize-path/src/index.ts"], + "@tsed/components-scan": ["../third-parties/components-scan/src/index.ts"], + "@tsed/common": ["../platform/common/src/index.ts"], + "@tsed/ajv": ["../specs/ajv/src/index.ts"], + "@tsed/platform-cache": ["../platform/platform-cache/src/index.ts"], + "@tsed/swagger": ["../specs/swagger/src/index.ts"], + "@tsed/platform-test-sdk": ["../platform/platform-test-sdk/src/index.ts"], + "@tsed/platform-express": ["../platform/platform-express/src/index.ts"], + "@tsed/platform-koa": ["../platform/platform-koa/src/index.ts"] }, "types": ["vite/client", "vitest/globals"] }, diff --git a/packages/di/vitest.config.mts b/packages/di/vitest.config.mts index c5a894a9cb6..862be1ef730 100644 --- a/packages/di/vitest.config.mts +++ b/packages/di/vitest.config.mts @@ -11,7 +11,7 @@ export default defineConfig( ...presets.test.coverage, thresholds: { statements: 98.75, - branches: 97.2, + branches: 97.05, functions: 98.67, lines: 98.75 } diff --git a/packages/engines/package.json b/packages/engines/package.json index dcbf991a2a9..7460de93bac 100644 --- a/packages/engines/package.json +++ b/packages/engines/package.json @@ -11,7 +11,7 @@ ".": { "types": "./lib/types/index.d.ts", "import": "./lib/esm/index.js", - "default": "./lib/cjs/index.js" + "default": "./lib/esm/index.js" } }, "scripts": { diff --git a/packages/engines/src/components/HoganEngine.ts b/packages/engines/src/components/HoganEngine.ts index 1d3c0d2d844..89c0425c7db 100644 --- a/packages/engines/src/components/HoganEngine.ts +++ b/packages/engines/src/components/HoganEngine.ts @@ -1,5 +1,6 @@ import {ViewEngine} from "../decorators/viewEngine.js"; -import {Engine, EngineOptions} from "./Engine.js"; +import type {EngineOptions} from "./Engine.js"; +import {Engine} from "./Engine.js"; @ViewEngine("hogan", { requires: "hogan.js" diff --git a/packages/engines/src/components/RactiveEngine.ts b/packages/engines/src/components/RactiveEngine.ts index c8106c595ee..00afcfc2979 100644 --- a/packages/engines/src/components/RactiveEngine.ts +++ b/packages/engines/src/components/RactiveEngine.ts @@ -1,5 +1,6 @@ import {ViewEngine} from "../decorators/viewEngine.js"; -import {Engine, EngineOptions} from "./Engine.js"; +import type {EngineOptions} from "./Engine.js"; +import {Engine} from "./Engine.js"; @ViewEngine("ractive") export class RactiveEngine extends Engine { diff --git a/packages/engines/src/components/ReactEngine.ts b/packages/engines/src/components/ReactEngine.ts index 32a554b928c..d28c4228a73 100644 --- a/packages/engines/src/components/ReactEngine.ts +++ b/packages/engines/src/components/ReactEngine.ts @@ -3,7 +3,8 @@ import {resolve} from "path"; import {ViewEngine} from "../decorators/viewEngine.js"; import {getCachedEngine, getFromCache, importEngine, setToCache} from "../utils/cache.js"; -import {Engine, EngineOptions, ViewEngineOptions} from "./Engine.js"; +import type {EngineOptions, ViewEngineOptions} from "./Engine.js"; +import {Engine} from "./Engine.js"; @ViewEngine("react", { requires: ["react"] diff --git a/packages/engines/src/components/SquirrellyEngine.ts b/packages/engines/src/components/SquirrellyEngine.ts index 7afe5914bc5..01fa03f2767 100644 --- a/packages/engines/src/components/SquirrellyEngine.ts +++ b/packages/engines/src/components/SquirrellyEngine.ts @@ -1,5 +1,6 @@ import {ViewEngine} from "../decorators/viewEngine.js"; -import {Engine, EngineOptions} from "./Engine.js"; +import type {EngineOptions} from "./Engine.js"; +import {Engine} from "./Engine.js"; @ViewEngine("squirrelly") export class SquirrellyEngine extends Engine { diff --git a/packages/engines/src/components/TwigEngine.ts b/packages/engines/src/components/TwigEngine.ts index 8e481664fe9..32253c6a23d 100644 --- a/packages/engines/src/components/TwigEngine.ts +++ b/packages/engines/src/components/TwigEngine.ts @@ -1,5 +1,6 @@ import {ViewEngine} from "../decorators/viewEngine.js"; -import {Engine, EngineOptions} from "./Engine.js"; +import type {EngineOptions} from "./Engine.js"; +import {Engine} from "./Engine.js"; @ViewEngine("twig") export class TwigEngine extends Engine { diff --git a/packages/engines/src/components/VelocityEngine.ts b/packages/engines/src/components/VelocityEngine.ts index f5c6f0c7836..02265ebff48 100644 --- a/packages/engines/src/components/VelocityEngine.ts +++ b/packages/engines/src/components/VelocityEngine.ts @@ -1,5 +1,6 @@ import {ViewEngine} from "../decorators/viewEngine.js"; -import {Engine, EngineOptions} from "./Engine.js"; +import type {EngineOptions} from "./Engine.js"; +import {Engine} from "./Engine.js"; @ViewEngine("velocityjs") export class VelocityEngine extends Engine { diff --git a/packages/engines/src/decorators/viewEngine.ts b/packages/engines/src/decorators/viewEngine.ts index bf6071b87c4..d5b05ca12ce 100644 --- a/packages/engines/src/decorators/viewEngine.ts +++ b/packages/engines/src/decorators/viewEngine.ts @@ -1,4 +1,4 @@ -import {ViewEngineOptions} from "../components/Engine.js"; +import type {ViewEngineOptions} from "../components/Engine.js"; import {engines} from "../registries/EnginesContainer.js"; export function ViewEngine(name: string, options: ViewEngineOptions = {}): ClassDecorator { diff --git a/packages/engines/src/registries/EnginesContainer.ts b/packages/engines/src/registries/EnginesContainer.ts index 784c00aeb34..45a7ed59346 100644 --- a/packages/engines/src/registries/EnginesContainer.ts +++ b/packages/engines/src/registries/EnginesContainer.ts @@ -1,4 +1,4 @@ -import {Engine, ViewEngineOptions} from "../components/Engine.js"; +import type {Engine, ViewEngineOptions} from "../components/Engine.js"; export interface EngineProvider { name: string; diff --git a/packages/engines/src/utils/getEngines.ts b/packages/engines/src/utils/getEngines.ts index d9be88a51c2..5fd8d8e5ee5 100644 --- a/packages/engines/src/utils/getEngines.ts +++ b/packages/engines/src/utils/getEngines.ts @@ -1,4 +1,4 @@ -import {EngineOptions} from "../components/Engine.js"; +import type {EngineOptions} from "../components/Engine.js"; import {engines} from "../registries/EnginesContainer.js"; export type RenderCallback = (err: Error | null, str?: string | any) => any; diff --git a/packages/engines/test/getEngineFixture.ts b/packages/engines/test/getEngineFixture.ts index 381d99443f4..51bc74c5d0a 100644 --- a/packages/engines/test/getEngineFixture.ts +++ b/packages/engines/test/getEngineFixture.ts @@ -1,6 +1,6 @@ import fs from "fs"; -import {Engine} from "../src/components/Engine.js"; +import type {Engine} from "../src/components/Engine.js"; import {engines} from "../src/index.js"; const rootDir = import.meta.dirname; // automatically replaced by import.meta.dirname on build diff --git a/packages/engines/tsconfig.esm.json b/packages/engines/tsconfig.esm.json index 82292550ddb..8954049da4a 100644 --- a/packages/engines/tsconfig.esm.json +++ b/packages/engines/tsconfig.esm.json @@ -2,7 +2,6 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", diff --git a/packages/engines/tsconfig.spec.json b/packages/engines/tsconfig.spec.json index d0d6ee5dec0..eb497e5af61 100644 --- a/packages/engines/tsconfig.spec.json +++ b/packages/engines/tsconfig.spec.json @@ -3,31 +3,31 @@ "compilerOptions": { "baseUrl": ".", "rootDir": "..", - "outDir": "./lib/cjs", "declaration": false, "composite": false, "noEmit": true, "paths": { - "@tsed/openspec": ["../specs/openspec/src"], - "@tsed/schema": ["../specs/schema/src"], - "@tsed/di": ["../di/src"], - "@tsed/exceptions": ["../specs/exceptions/src"], - "@tsed/json-mapper": ["../specs/json-mapper/src"], - "@tsed/platform-exceptions": ["../platform/platform-exceptions/src"], - "@tsed/platform-middlewares": ["../platform/platform-middlewares/src"], - "@tsed/platform-params": ["../platform/platform-params/src"], - "@tsed/platform-log-middleware": ["../platform/platform-log-middleware/src"], - "@tsed/platform-response-filter": ["../platform/platform-response-filter/src"], - "@tsed/platform-router": ["../platform/platform-router/src"], - "@tsed/platform-views": ["../platform/platform-views/src"], - "@tsed/components-scan": ["../third-parties/components-scan/src"], - "@tsed/common": ["../platform/common/src"], - "@tsed/ajv": ["../specs/ajv/src"], - "@tsed/platform-cache": ["../platform/platform-cache/src"], - "@tsed/swagger": ["../specs/swagger/src"], - "@tsed/platform-test-sdk": ["../platform/platform-test-sdk/src"], - "@tsed/platform-express": ["../platform/platform-express/src"], - "@tsed/platform-koa": ["../platform/platform-koa/src"] + "@tsed/openspec": ["../specs/openspec/src/index.ts"], + "@tsed/schema": ["../specs/schema/src/index.ts"], + "@tsed/di": ["../di/src/index.ts"], + "@tsed/exceptions": ["../specs/exceptions/src/index.ts"], + "@tsed/json-mapper": ["../specs/json-mapper/src/index.ts"], + "@tsed/platform-exceptions": ["../platform/platform-exceptions/src/index.ts"], + "@tsed/platform-middlewares": ["../platform/platform-middlewares/src/index.ts"], + "@tsed/platform-params": ["../platform/platform-params/src/index.ts"], + "@tsed/platform-log-middleware": ["../platform/platform-log-middleware/src/index.ts"], + "@tsed/platform-response-filter": ["../platform/platform-response-filter/src/index.ts"], + "@tsed/platform-router": ["../platform/platform-router/src/index.ts"], + "@tsed/platform-views": ["../platform/platform-views/src/index.ts"], + "@tsed/normalize-path": ["../utils/normalize-path/src/index.ts"], + "@tsed/components-scan": ["../third-parties/components-scan/src/index.ts"], + "@tsed/common": ["../platform/common/src/index.ts"], + "@tsed/ajv": ["../specs/ajv/src/index.ts"], + "@tsed/platform-cache": ["../platform/platform-cache/src/index.ts"], + "@tsed/swagger": ["../specs/swagger/src/index.ts"], + "@tsed/platform-test-sdk": ["../platform/platform-test-sdk/src/index.ts"], + "@tsed/platform-express": ["../platform/platform-express/src/index.ts"], + "@tsed/platform-koa": ["../platform/platform-koa/src/index.ts"] }, "types": ["vite/client", "vitest/globals"] }, diff --git a/packages/graphql/apollo/package.json b/packages/graphql/apollo/package.json index 0774b493721..6705468d30c 100644 --- a/packages/graphql/apollo/package.json +++ b/packages/graphql/apollo/package.json @@ -11,7 +11,7 @@ ".": { "types": "./lib/types/index.d.ts", "import": "./lib/esm/index.js", - "default": "./lib/cjs/index.js" + "default": "./lib/esm/index.js" } }, "scripts": { diff --git a/packages/graphql/apollo/src/ApolloModule.ts b/packages/graphql/apollo/src/ApolloModule.ts index e913a797e26..96f21b90b6a 100644 --- a/packages/graphql/apollo/src/ApolloModule.ts +++ b/packages/graphql/apollo/src/ApolloModule.ts @@ -1,8 +1,8 @@ -import {AfterListen, Logger, OnRoutesInit} from "@tsed/common"; +import type {AfterListen, Logger, OnRoutesInit} from "@tsed/common"; import {Configuration, Inject, InjectorService, Module} from "@tsed/di"; -import {ApolloSettings} from "./interfaces/ApolloSettings.js"; -import {ApolloService} from "./services/ApolloService.js"; +import type {ApolloSettings} from "./interfaces/ApolloSettings.js"; +import type {ApolloService} from "./services/ApolloService.js"; @Module() export class ApolloModule implements OnRoutesInit, AfterListen { diff --git a/packages/graphql/apollo/src/decorators/injectApolloContext.ts b/packages/graphql/apollo/src/decorators/injectApolloContext.ts index 002bef98275..b6567e5fd54 100644 --- a/packages/graphql/apollo/src/decorators/injectApolloContext.ts +++ b/packages/graphql/apollo/src/decorators/injectApolloContext.ts @@ -1,4 +1,5 @@ -import {DecoratorParameters, decoratorTypeOf, DecoratorTypes} from "@tsed/core"; +import type {DecoratorParameters} from "@tsed/core"; +import {decoratorTypeOf, DecoratorTypes} from "@tsed/core"; import {Inject, InjectContext} from "@tsed/di"; import {APOLLO_CONTEXT} from "../constants/constants.js"; diff --git a/packages/graphql/apollo/src/services/ApolloService.spec.ts b/packages/graphql/apollo/src/services/ApolloService.spec.ts index e1b81386257..ce77ba646bb 100644 --- a/packages/graphql/apollo/src/services/ApolloService.spec.ts +++ b/packages/graphql/apollo/src/services/ApolloService.spec.ts @@ -1,6 +1,7 @@ import {RESTDataSource} from "@apollo/datasource-rest"; -import {ApolloServer, ApolloServerPlugin} from "@apollo/server"; -import {InjectContext, Logger, Opts, PlatformApplication, PlatformContext, PlatformTest} from "@tsed/common"; +import type {ApolloServer, ApolloServerPlugin} from "@apollo/server"; +import type {PlatformContext} from "@tsed/common"; +import {InjectContext, Logger, Opts, PlatformApplication, PlatformTest} from "@tsed/common"; import {catchAsyncError} from "@tsed/core"; import {Configuration, Constant, Module, runInContext} from "@tsed/di"; import {HTTPDataSource} from "apollo-datasource-http"; diff --git a/packages/graphql/apollo/src/services/ApolloService.ts b/packages/graphql/apollo/src/services/ApolloService.ts index 6787f9026e7..e73d20e2b1b 100644 --- a/packages/graphql/apollo/src/services/ApolloService.ts +++ b/packages/graphql/apollo/src/services/ApolloService.ts @@ -1,17 +1,19 @@ -import {ApolloServer, ApolloServerOptions, ApolloServerPlugin} from "@apollo/server"; +import type {ApolloServerOptions, ApolloServerPlugin} from "@apollo/server"; +import {ApolloServer} from "@apollo/server"; import {ApolloServerPluginLandingPageDisabled} from "@apollo/server/plugin/disabled"; import {ApolloServerPluginDrainHttpServer} from "@apollo/server/plugin/drainHttpServer"; import {ApolloServerPluginLandingPageLocalDefault} from "@apollo/server/plugin/landingPage/default"; import type {IExecutableSchemaDefinition} from "@graphql-tools/schema"; -import {InjectorService, LocalsContainer, PlatformApplication, PlatformContext, Provider, useContext} from "@tsed/common"; +import {InjectorService, PlatformApplication, type PlatformContext, type Provider} from "@tsed/common"; +import {LocalsContainer, useContext} from "@tsed/common"; import {Constant, Inject, Service} from "@tsed/di"; -import {Logger} from "@tsed/logger"; +import type {Logger} from "@tsed/logger"; 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"; +import type {ApolloContext} from "../interfaces/ApolloContext.js"; import type {ApolloCustomServerCB, ApolloSettings} from "../interfaces/ApolloSettings.js"; @Service() @@ -37,7 +39,7 @@ export class ApolloService { } > = new Map(); - @Inject() + @Inject(PlatformApplication) private app: PlatformApplication; @Inject(Http.Server) @@ -46,7 +48,7 @@ export class ApolloService { @Inject(Https.Server) private httpsServer: Https.Server | null; - @Inject() + @Inject(InjectorService) private injector: InjectorService; async createServer(id: string, settings: ApolloSettings) { diff --git a/packages/graphql/apollo/tsconfig.esm.json b/packages/graphql/apollo/tsconfig.esm.json index 82292550ddb..8954049da4a 100644 --- a/packages/graphql/apollo/tsconfig.esm.json +++ b/packages/graphql/apollo/tsconfig.esm.json @@ -2,7 +2,6 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", diff --git a/packages/graphql/apollo/tsconfig.spec.json b/packages/graphql/apollo/tsconfig.spec.json index 2e917f4b39d..fdb41369c3a 100644 --- a/packages/graphql/apollo/tsconfig.spec.json +++ b/packages/graphql/apollo/tsconfig.spec.json @@ -3,31 +3,31 @@ "compilerOptions": { "baseUrl": ".", "rootDir": "../..", - "outDir": "./lib/cjs", "declaration": false, "composite": false, "noEmit": true, "paths": { - "@tsed/openspec": ["../../specs/openspec/src"], - "@tsed/schema": ["../../specs/schema/src"], - "@tsed/di": ["../../di/src"], - "@tsed/exceptions": ["../../specs/exceptions/src"], - "@tsed/json-mapper": ["../../specs/json-mapper/src"], - "@tsed/platform-exceptions": ["../../platform/platform-exceptions/src"], - "@tsed/platform-middlewares": ["../../platform/platform-middlewares/src"], - "@tsed/platform-params": ["../../platform/platform-params/src"], - "@tsed/platform-log-middleware": ["../../platform/platform-log-middleware/src"], - "@tsed/platform-response-filter": ["../../platform/platform-response-filter/src"], - "@tsed/platform-router": ["../../platform/platform-router/src"], - "@tsed/platform-views": ["../../platform/platform-views/src"], - "@tsed/components-scan": ["../../third-parties/components-scan/src"], - "@tsed/common": ["../../platform/common/src"], - "@tsed/ajv": ["../../specs/ajv/src"], - "@tsed/platform-cache": ["../../platform/platform-cache/src"], - "@tsed/swagger": ["../../specs/swagger/src"], - "@tsed/platform-test-sdk": ["../../platform/platform-test-sdk/src"], - "@tsed/platform-express": ["../../platform/platform-express/src"], - "@tsed/platform-koa": ["../../platform/platform-koa/src"] + "@tsed/openspec": ["../../specs/openspec/src/index.ts"], + "@tsed/schema": ["../../specs/schema/src/index.ts"], + "@tsed/di": ["../../di/src/index.ts"], + "@tsed/exceptions": ["../../specs/exceptions/src/index.ts"], + "@tsed/json-mapper": ["../../specs/json-mapper/src/index.ts"], + "@tsed/platform-exceptions": ["../../platform/platform-exceptions/src/index.ts"], + "@tsed/platform-middlewares": ["../../platform/platform-middlewares/src/index.ts"], + "@tsed/platform-params": ["../../platform/platform-params/src/index.ts"], + "@tsed/platform-log-middleware": ["../../platform/platform-log-middleware/src/index.ts"], + "@tsed/platform-response-filter": ["../../platform/platform-response-filter/src/index.ts"], + "@tsed/platform-router": ["../../platform/platform-router/src/index.ts"], + "@tsed/platform-views": ["../../platform/platform-views/src/index.ts"], + "@tsed/normalize-path": ["../../utils/normalize-path/src/index.ts"], + "@tsed/components-scan": ["../../third-parties/components-scan/src/index.ts"], + "@tsed/common": ["../../platform/common/src/index.ts"], + "@tsed/ajv": ["../../specs/ajv/src/index.ts"], + "@tsed/platform-cache": ["../../platform/platform-cache/src/index.ts"], + "@tsed/swagger": ["../../specs/swagger/src/index.ts"], + "@tsed/platform-test-sdk": ["../../platform/platform-test-sdk/src/index.ts"], + "@tsed/platform-express": ["../../platform/platform-express/src/index.ts"], + "@tsed/platform-koa": ["../../platform/platform-koa/src/index.ts"] }, "types": ["vite/client", "vitest/globals"] }, diff --git a/packages/graphql/graphql-ws/package.json b/packages/graphql/graphql-ws/package.json index ce18db40d90..ad1011a4de0 100644 --- a/packages/graphql/graphql-ws/package.json +++ b/packages/graphql/graphql-ws/package.json @@ -11,7 +11,7 @@ ".": { "types": "./lib/types/index.d.ts", "import": "./lib/esm/index.js", - "default": "./lib/cjs/index.js" + "default": "./lib/esm/index.js" } }, "scripts": { diff --git a/packages/graphql/graphql-ws/src/GraphQLWSModule.ts b/packages/graphql/graphql-ws/src/GraphQLWSModule.ts index a36593e133d..b9fa0472590 100644 --- a/packages/graphql/graphql-ws/src/GraphQLWSModule.ts +++ b/packages/graphql/graphql-ws/src/GraphQLWSModule.ts @@ -1,10 +1,9 @@ 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"; +import type {GraphQLWSOptions} from "./GraphQLWSOptions.js"; @Module() export class GraphQLWSModule { @@ -17,10 +16,10 @@ export class GraphQLWSModule { @Inject(Https.Server) private httpsServer: Https.Server | null; - @Inject() + @Inject(InjectorService) private injector: InjectorService; - async createWSServer(settings: GraphQLWSOptions) { + async createWSServer(settings: GraphQLWSOptions): Promise> { // @ts-ignore const {WebSocketServer} = await import("ws"); diff --git a/packages/graphql/graphql-ws/src/GraphQLWSOptions.ts b/packages/graphql/graphql-ws/src/GraphQLWSOptions.ts index 97aeaad9773..3a227da0af2 100644 --- a/packages/graphql/graphql-ws/src/GraphQLWSOptions.ts +++ b/packages/graphql/graphql-ws/src/GraphQLWSOptions.ts @@ -1,6 +1,6 @@ // @ts-ignore -import {ServerOptions} from "graphql-ws/lib/server"; -import {ServerOptions as WSServerOptions} from "ws"; +import type {ServerOptions} from "graphql-ws/lib/server"; +import type {ServerOptions as WSServerOptions} from "ws"; export interface GraphQLWSOptions { path: string; diff --git a/packages/graphql/graphql-ws/tsconfig.esm.json b/packages/graphql/graphql-ws/tsconfig.esm.json index 82292550ddb..8954049da4a 100644 --- a/packages/graphql/graphql-ws/tsconfig.esm.json +++ b/packages/graphql/graphql-ws/tsconfig.esm.json @@ -2,7 +2,6 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", diff --git a/packages/graphql/typegraphql/package.json b/packages/graphql/typegraphql/package.json index 3e027d14b67..c172aa4bc14 100644 --- a/packages/graphql/typegraphql/package.json +++ b/packages/graphql/typegraphql/package.json @@ -11,7 +11,7 @@ ".": { "types": "./lib/types/index.d.ts", "import": "./lib/esm/index.js", - "default": "./lib/cjs/index.js" + "default": "./lib/esm/index.js" } }, "scripts": { diff --git a/packages/graphql/typegraphql/src/TypeGraphQLModule.ts b/packages/graphql/typegraphql/src/TypeGraphQLModule.ts index 8b82dbbaae2..f7015143c44 100644 --- a/packages/graphql/typegraphql/src/TypeGraphQLModule.ts +++ b/packages/graphql/typegraphql/src/TypeGraphQLModule.ts @@ -1,7 +1,8 @@ import "./interfaces/interfaces.js"; -import {AlterApolloSettings, ApolloSettingsWithID} from "@tsed/apollo"; -import {isClass, Type} from "@tsed/core"; +import type {AlterApolloSettings, ApolloSettingsWithID} from "@tsed/apollo"; +import type {Type} from "@tsed/core"; +import {isClass} from "@tsed/core"; import {Configuration, Inject, InjectorService, Module} from "@tsed/di"; import {buildSchema} from "type-graphql"; @@ -13,7 +14,7 @@ import {ContextMiddleware} from "./middlewares/ContextMiddleware.js"; */ @Module() export class TypeGraphQLModule implements AlterApolloSettings { - @Inject() + @Inject(InjectorService) protected injector: InjectorService; @Configuration() diff --git a/packages/graphql/typegraphql/src/decorators/resolver.ts b/packages/graphql/typegraphql/src/decorators/resolver.ts index 2a0cef36da8..c7edd2724b9 100644 --- a/packages/graphql/typegraphql/src/decorators/resolver.ts +++ b/packages/graphql/typegraphql/src/decorators/resolver.ts @@ -1,6 +1,7 @@ import {StoreSet, useDecorators} from "@tsed/core"; import {Injectable} from "@tsed/di"; -import {ClassType, Resolver} from "type-graphql"; +import type {ClassType} from "type-graphql"; +import {Resolver} from "type-graphql"; import {RESOLVERS_PROVIDERS} from "../constants/constants.js"; diff --git a/packages/graphql/typegraphql/src/index.ts b/packages/graphql/typegraphql/src/index.ts index 2ae96f9615a..33a59a39972 100644 --- a/packages/graphql/typegraphql/src/index.ts +++ b/packages/graphql/typegraphql/src/index.ts @@ -5,6 +5,5 @@ export * from "./constants/constants.js"; export * from "./decorators/resolver.js"; export * from "./exports.js"; export * from "./interfaces/interfaces.js"; -export * from "./interfaces/TypeGraphQLSettings.js"; export * from "./middlewares/ContextMiddleware.js"; export * from "./TypeGraphQLModule.js"; diff --git a/packages/graphql/typegraphql/src/interfaces/TypeGraphQLSettings.ts b/packages/graphql/typegraphql/src/interfaces/TypeGraphQLSettings.ts deleted file mode 100644 index 7a3ebc55707..00000000000 --- a/packages/graphql/typegraphql/src/interfaces/TypeGraphQLSettings.ts +++ /dev/null @@ -1 +0,0 @@ -import {BuildSchemaOptions} from "type-graphql"; diff --git a/packages/graphql/typegraphql/src/interfaces/interfaces.ts b/packages/graphql/typegraphql/src/interfaces/interfaces.ts index 9e44c071abb..be8aedce7df 100644 --- a/packages/graphql/typegraphql/src/interfaces/interfaces.ts +++ b/packages/graphql/typegraphql/src/interfaces/interfaces.ts @@ -1,5 +1,5 @@ import type {ApolloSettings as AS} from "@tsed/apollo"; -import {BuildSchemaOptions} from "type-graphql"; +import type {BuildSchemaOptions} from "type-graphql"; declare global { namespace TsED { diff --git a/packages/graphql/typegraphql/src/middlewares/ContextMiddleware.ts b/packages/graphql/typegraphql/src/middlewares/ContextMiddleware.ts index 2de5635e25b..504da7643f6 100644 --- a/packages/graphql/typegraphql/src/middlewares/ContextMiddleware.ts +++ b/packages/graphql/typegraphql/src/middlewares/ContextMiddleware.ts @@ -1,5 +1,5 @@ import {type DIContext, runInContext, useContext} from "@tsed/di"; -import {MiddlewareFn} from "type-graphql"; +import type {MiddlewareFn} from "type-graphql"; export const ContextMiddleware: MiddlewareFn<{req: {$ctx: DIContext}}> = (action, next) => { const $ctx = useContext(action.context?.req?.$ctx); diff --git a/packages/graphql/typegraphql/test/app/Server.ts b/packages/graphql/typegraphql/test/app/Server.ts index a6d0ba3fe54..f812a3f85e4 100644 --- a/packages/graphql/typegraphql/test/app/Server.ts +++ b/packages/graphql/typegraphql/test/app/Server.ts @@ -10,8 +10,9 @@ import "./services/UsersRepository.js"; import * as fs from "node:fs"; import {join} from "node:path"; -import {ApolloContext} from "@tsed/apollo"; -import {Configuration, Constant, Inject, PlatformApplication, PlatformContext} from "@tsed/common"; +import type {ApolloContext} from "@tsed/apollo"; +import {PlatformApplication, type PlatformContext} from "@tsed/common"; +import {Configuration, Constant, Inject} from "@tsed/common"; import {buildContext} from "graphql-passport"; import {resolve} from "path"; @@ -52,7 +53,7 @@ const rootCert = join(rootDir, "../.."); } }) export class Server { - @Inject() + @Inject(PlatformApplication) app: PlatformApplication; @Constant("PLATFORM_NAME") diff --git a/packages/graphql/typegraphql/test/app/graphql/auth/AuthResolver.ts b/packages/graphql/typegraphql/test/app/graphql/auth/AuthResolver.ts index 6109697d3fc..ca9d1312e7d 100644 --- a/packages/graphql/typegraphql/test/app/graphql/auth/AuthResolver.ts +++ b/packages/graphql/typegraphql/test/app/graphql/auth/AuthResolver.ts @@ -1,4 +1,4 @@ -import {PassportContext} from "graphql-passport"; +import type {PassportContext} from "graphql-passport"; import {Arg, Ctx, Mutation, Query, Resolver} from "type-graphql"; import {User} from "./User"; diff --git a/packages/graphql/typegraphql/test/app/graphql/datasources/MyDataSource.ts b/packages/graphql/typegraphql/test/app/graphql/datasources/MyDataSource.ts index 28cecc8a540..e612998d428 100644 --- a/packages/graphql/typegraphql/test/app/graphql/datasources/MyDataSource.ts +++ b/packages/graphql/typegraphql/test/app/graphql/datasources/MyDataSource.ts @@ -1,8 +1,8 @@ import {RESTDataSource} from "@apollo/datasource-rest"; -import {ApolloContext} from "@tsed/apollo"; +import type {ApolloContext} from "@tsed/apollo"; import {InjectContext} from "@tsed/common"; -import {DataSource} from "../../../.."; +import {DataSource} from "../../../../src/index.js"; @DataSource() export class MyDataSource extends RESTDataSource { diff --git a/packages/graphql/typegraphql/test/app/graphql/pubsub/pubsub.ts b/packages/graphql/typegraphql/test/app/graphql/pubsub/pubsub.ts index 832f9ba0cd5..d590f30bd11 100644 --- a/packages/graphql/typegraphql/test/app/graphql/pubsub/pubsub.ts +++ b/packages/graphql/typegraphql/test/app/graphql/pubsub/pubsub.ts @@ -1,7 +1,7 @@ import {createPubSub} from "@graphql-yoga/subscription"; import {registerProvider} from "@tsed/common"; -import {RecipeNotification} from "../recipes/Recipe"; +import type {RecipeNotification} from "../recipes/Recipe"; export const pubSub = createPubSub<{ NOTIFICATIONS: [RecipeNotification]; diff --git a/packages/graphql/typegraphql/test/app/graphql/recipes/RecipeResolver.ts b/packages/graphql/typegraphql/test/app/graphql/recipes/RecipeResolver.ts index 9f4cd30a387..7ad1af4a06b 100644 --- a/packages/graphql/typegraphql/test/app/graphql/recipes/RecipeResolver.ts +++ b/packages/graphql/typegraphql/test/app/graphql/recipes/RecipeResolver.ts @@ -1,19 +1,20 @@ -import {InjectContext, PlatformContext} from "@tsed/common"; +import type {PlatformContext} from "@tsed/common"; +import {InjectContext} from "@tsed/common"; import {Inject} from "@tsed/di"; import {Arg, Mutation, Query, Root, Subscription} from "type-graphql"; -import {ResolverController} from "../../../.."; -import {RecipeService} from "../../services/RecipeService"; +import {ResolverController} from "../../../../src/index.js"; +import {RecipeService} from "../../services/RecipeService.js"; import {PubSubProvider} from "../pubsub/pubsub.js"; -import {Recipe, RecipeNotification} from "./Recipe"; -import {RecipeNotFoundError} from "./RecipeNotFoundError"; +import {Recipe, RecipeNotification} from "./Recipe.js"; +import {RecipeNotFoundError} from "./RecipeNotFoundError.js"; @ResolverController((_of) => Recipe) export class RecipeResolver { @InjectContext() private $ctx: PlatformContext; - @Inject() + @Inject(RecipeService) private recipeService: RecipeService; @Inject(PubSubProvider) diff --git a/packages/graphql/typegraphql/test/app/protocols/GraphQLProtocol.ts b/packages/graphql/typegraphql/test/app/protocols/GraphQLProtocol.ts index 206c2e43cf4..a4642a0f292 100644 --- a/packages/graphql/typegraphql/test/app/protocols/GraphQLProtocol.ts +++ b/packages/graphql/typegraphql/test/app/protocols/GraphQLProtocol.ts @@ -1,6 +1,7 @@ import {Inject, Req} from "@tsed/common"; import {Unauthorized} from "@tsed/exceptions"; -import {Arg, OnVerify, Protocol} from "@tsed/passport"; +import type {OnVerify} from "@tsed/passport"; +import {Arg, Protocol} from "@tsed/passport"; import {GraphQLLocalStrategy} from "graphql-passport"; import {UsersRepository} from "../services/UsersRepository"; @@ -11,7 +12,7 @@ import {UsersRepository} from "../services/UsersRepository"; settings: {} }) export class GraphQLProtocol implements OnVerify { - @Inject() + @Inject(UsersRepository) protected repository: UsersRepository; async $onVerify(@Req() request: Req, @Arg(0) email: string, @Arg(1) password: string) { diff --git a/packages/graphql/typegraphql/test/app/services/UsersRepository.ts b/packages/graphql/typegraphql/test/app/services/UsersRepository.ts index c175d610afe..0292d3c3a80 100644 --- a/packages/graphql/typegraphql/test/app/services/UsersRepository.ts +++ b/packages/graphql/typegraphql/test/app/services/UsersRepository.ts @@ -1,8 +1,9 @@ -import {Adapter, InjectAdapter} from "@tsed/adapters"; +import type {Adapter} from "@tsed/adapters"; +import {InjectAdapter} from "@tsed/adapters"; import {Injectable} from "@tsed/di"; import {deserialize} from "@tsed/json-mapper"; -import {User} from "../graphql/auth/User"; +import {User} from "../graphql/auth/User.js"; @Injectable() export class UsersRepository { diff --git a/packages/graphql/typegraphql/tsconfig.esm.json b/packages/graphql/typegraphql/tsconfig.esm.json index 82292550ddb..8954049da4a 100644 --- a/packages/graphql/typegraphql/tsconfig.esm.json +++ b/packages/graphql/typegraphql/tsconfig.esm.json @@ -2,7 +2,6 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", diff --git a/packages/graphql/typegraphql/tsconfig.spec.json b/packages/graphql/typegraphql/tsconfig.spec.json index 2e917f4b39d..fdb41369c3a 100644 --- a/packages/graphql/typegraphql/tsconfig.spec.json +++ b/packages/graphql/typegraphql/tsconfig.spec.json @@ -3,31 +3,31 @@ "compilerOptions": { "baseUrl": ".", "rootDir": "../..", - "outDir": "./lib/cjs", "declaration": false, "composite": false, "noEmit": true, "paths": { - "@tsed/openspec": ["../../specs/openspec/src"], - "@tsed/schema": ["../../specs/schema/src"], - "@tsed/di": ["../../di/src"], - "@tsed/exceptions": ["../../specs/exceptions/src"], - "@tsed/json-mapper": ["../../specs/json-mapper/src"], - "@tsed/platform-exceptions": ["../../platform/platform-exceptions/src"], - "@tsed/platform-middlewares": ["../../platform/platform-middlewares/src"], - "@tsed/platform-params": ["../../platform/platform-params/src"], - "@tsed/platform-log-middleware": ["../../platform/platform-log-middleware/src"], - "@tsed/platform-response-filter": ["../../platform/platform-response-filter/src"], - "@tsed/platform-router": ["../../platform/platform-router/src"], - "@tsed/platform-views": ["../../platform/platform-views/src"], - "@tsed/components-scan": ["../../third-parties/components-scan/src"], - "@tsed/common": ["../../platform/common/src"], - "@tsed/ajv": ["../../specs/ajv/src"], - "@tsed/platform-cache": ["../../platform/platform-cache/src"], - "@tsed/swagger": ["../../specs/swagger/src"], - "@tsed/platform-test-sdk": ["../../platform/platform-test-sdk/src"], - "@tsed/platform-express": ["../../platform/platform-express/src"], - "@tsed/platform-koa": ["../../platform/platform-koa/src"] + "@tsed/openspec": ["../../specs/openspec/src/index.ts"], + "@tsed/schema": ["../../specs/schema/src/index.ts"], + "@tsed/di": ["../../di/src/index.ts"], + "@tsed/exceptions": ["../../specs/exceptions/src/index.ts"], + "@tsed/json-mapper": ["../../specs/json-mapper/src/index.ts"], + "@tsed/platform-exceptions": ["../../platform/platform-exceptions/src/index.ts"], + "@tsed/platform-middlewares": ["../../platform/platform-middlewares/src/index.ts"], + "@tsed/platform-params": ["../../platform/platform-params/src/index.ts"], + "@tsed/platform-log-middleware": ["../../platform/platform-log-middleware/src/index.ts"], + "@tsed/platform-response-filter": ["../../platform/platform-response-filter/src/index.ts"], + "@tsed/platform-router": ["../../platform/platform-router/src/index.ts"], + "@tsed/platform-views": ["../../platform/platform-views/src/index.ts"], + "@tsed/normalize-path": ["../../utils/normalize-path/src/index.ts"], + "@tsed/components-scan": ["../../third-parties/components-scan/src/index.ts"], + "@tsed/common": ["../../platform/common/src/index.ts"], + "@tsed/ajv": ["../../specs/ajv/src/index.ts"], + "@tsed/platform-cache": ["../../platform/platform-cache/src/index.ts"], + "@tsed/swagger": ["../../specs/swagger/src/index.ts"], + "@tsed/platform-test-sdk": ["../../platform/platform-test-sdk/src/index.ts"], + "@tsed/platform-express": ["../../platform/platform-express/src/index.ts"], + "@tsed/platform-koa": ["../../platform/platform-koa/src/index.ts"] }, "types": ["vite/client", "vitest/globals"] }, diff --git a/packages/orm/adapters-redis/package.json b/packages/orm/adapters-redis/package.json index 3fac6657e92..98b2318bdaa 100644 --- a/packages/orm/adapters-redis/package.json +++ b/packages/orm/adapters-redis/package.json @@ -11,7 +11,7 @@ ".": { "types": "./lib/types/index.d.ts", "import": "./lib/esm/index.js", - "default": "./lib/cjs/index.js" + "default": "./lib/esm/index.js" } }, "scripts": { diff --git a/packages/orm/adapters-redis/src/adapters/OIDCRedisAdapter.spec.ts b/packages/orm/adapters-redis/src/adapters/OIDCRedisAdapter.spec.ts index 811f510d241..83cfc03d250 100644 --- a/packages/orm/adapters-redis/src/adapters/OIDCRedisAdapter.spec.ts +++ b/packages/orm/adapters-redis/src/adapters/OIDCRedisAdapter.spec.ts @@ -1,6 +1,6 @@ import {Adapters} from "@tsed/adapters"; import {IORedisTest, registerConnectionProvider} from "@tsed/ioredis"; -import {Redis} from "ioredis"; +import type {Redis} from "ioredis"; import moment from "moment"; import {OIDCRedisAdapter} from "./OIDCRedisAdapter.js"; diff --git a/packages/orm/adapters-redis/src/adapters/OIDCRedisAdapter.ts b/packages/orm/adapters-redis/src/adapters/OIDCRedisAdapter.ts index 73436c20eed..29fe05958f7 100644 --- a/packages/orm/adapters-redis/src/adapters/OIDCRedisAdapter.ts +++ b/packages/orm/adapters-redis/src/adapters/OIDCRedisAdapter.ts @@ -1,9 +1,11 @@ -import {AdapterModel} from "@tsed/adapters"; +import type {AdapterModel} from "@tsed/adapters"; import {Configuration, Inject, Opts} from "@tsed/di"; -import {IORedis, IOREDIS_CONNECTIONS} from "@tsed/ioredis"; -import {ChainableCommander} from "ioredis"; +import type {IORedis} from "@tsed/ioredis"; +import {IOREDIS_CONNECTIONS} from "@tsed/ioredis"; +import type {ChainableCommander} from "ioredis"; -import {RedisAdapter, RedisAdapterConstructorOptions} from "./RedisAdapter.js"; +import type {RedisAdapterConstructorOptions} from "./RedisAdapter.js"; +import {RedisAdapter} from "./RedisAdapter.js"; const GRANTABLE = new Set(["AccessToken", "AuthorizationCode", "RefreshToken", "DeviceCode", "BackchannelAuthenticationRequest"]); const CONSUMABLE = new Set(["AuthorizationCode", "RefreshToken", "DeviceCode", "BackchannelAuthenticationRequest"]); diff --git a/packages/orm/adapters-redis/src/adapters/RedisAdapter.spec.ts b/packages/orm/adapters-redis/src/adapters/RedisAdapter.spec.ts index d7ecf2b550f..c357b10cd2c 100644 --- a/packages/orm/adapters-redis/src/adapters/RedisAdapter.spec.ts +++ b/packages/orm/adapters-redis/src/adapters/RedisAdapter.spec.ts @@ -1,4 +1,5 @@ -import {AdapterModel, Adapters, Indexed} from "@tsed/adapters"; +import type {AdapterModel} from "@tsed/adapters"; +import {Adapters, Indexed} from "@tsed/adapters"; import {IORedisTest, registerConnectionProvider} from "@tsed/ioredis"; import {deserialize} from "@tsed/json-mapper"; import {Property, Required} from "@tsed/schema"; diff --git a/packages/orm/adapters-redis/src/adapters/RedisAdapter.ts b/packages/orm/adapters-redis/src/adapters/RedisAdapter.ts index f26dc0671be..36c37d2ce8a 100644 --- a/packages/orm/adapters-redis/src/adapters/RedisAdapter.ts +++ b/packages/orm/adapters-redis/src/adapters/RedisAdapter.ts @@ -1,7 +1,9 @@ -import {Adapter, AdapterConstructorOptions, AdapterModel} from "@tsed/adapters"; +import type {AdapterConstructorOptions, AdapterModel} from "@tsed/adapters"; +import {Adapter} from "@tsed/adapters"; import {cleanObject, Hooks, isObject, isString} from "@tsed/core"; import {Configuration, Inject, Opts} from "@tsed/di"; -import {IORedis, IOREDIS_CONNECTIONS} from "@tsed/ioredis"; +import type {IORedis} from "@tsed/ioredis"; +import {IOREDIS_CONNECTIONS} from "@tsed/ioredis"; import type {ChainableCommander, Redis} from "ioredis"; import {v4 as uuid} from "uuid"; diff --git a/packages/orm/adapters-redis/src/domain/RedisAdaptersSettings.ts b/packages/orm/adapters-redis/src/domain/RedisAdaptersSettings.ts index 050c34d29b6..1c1ebef5560 100644 --- a/packages/orm/adapters-redis/src/domain/RedisAdaptersSettings.ts +++ b/packages/orm/adapters-redis/src/domain/RedisAdaptersSettings.ts @@ -1,5 +1,5 @@ -import {AdaptersSettings} from "@tsed/adapters"; -import {RedisOptions} from "ioredis"; +import type {AdaptersSettings} from "@tsed/adapters"; +import type {RedisOptions} from "ioredis"; declare global { namespace TsED { diff --git a/packages/orm/adapters-redis/tsconfig.esm.json b/packages/orm/adapters-redis/tsconfig.esm.json index 82292550ddb..8954049da4a 100644 --- a/packages/orm/adapters-redis/tsconfig.esm.json +++ b/packages/orm/adapters-redis/tsconfig.esm.json @@ -2,7 +2,6 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", diff --git a/packages/orm/adapters-redis/tsconfig.spec.json b/packages/orm/adapters-redis/tsconfig.spec.json index 2e917f4b39d..fdb41369c3a 100644 --- a/packages/orm/adapters-redis/tsconfig.spec.json +++ b/packages/orm/adapters-redis/tsconfig.spec.json @@ -3,31 +3,31 @@ "compilerOptions": { "baseUrl": ".", "rootDir": "../..", - "outDir": "./lib/cjs", "declaration": false, "composite": false, "noEmit": true, "paths": { - "@tsed/openspec": ["../../specs/openspec/src"], - "@tsed/schema": ["../../specs/schema/src"], - "@tsed/di": ["../../di/src"], - "@tsed/exceptions": ["../../specs/exceptions/src"], - "@tsed/json-mapper": ["../../specs/json-mapper/src"], - "@tsed/platform-exceptions": ["../../platform/platform-exceptions/src"], - "@tsed/platform-middlewares": ["../../platform/platform-middlewares/src"], - "@tsed/platform-params": ["../../platform/platform-params/src"], - "@tsed/platform-log-middleware": ["../../platform/platform-log-middleware/src"], - "@tsed/platform-response-filter": ["../../platform/platform-response-filter/src"], - "@tsed/platform-router": ["../../platform/platform-router/src"], - "@tsed/platform-views": ["../../platform/platform-views/src"], - "@tsed/components-scan": ["../../third-parties/components-scan/src"], - "@tsed/common": ["../../platform/common/src"], - "@tsed/ajv": ["../../specs/ajv/src"], - "@tsed/platform-cache": ["../../platform/platform-cache/src"], - "@tsed/swagger": ["../../specs/swagger/src"], - "@tsed/platform-test-sdk": ["../../platform/platform-test-sdk/src"], - "@tsed/platform-express": ["../../platform/platform-express/src"], - "@tsed/platform-koa": ["../../platform/platform-koa/src"] + "@tsed/openspec": ["../../specs/openspec/src/index.ts"], + "@tsed/schema": ["../../specs/schema/src/index.ts"], + "@tsed/di": ["../../di/src/index.ts"], + "@tsed/exceptions": ["../../specs/exceptions/src/index.ts"], + "@tsed/json-mapper": ["../../specs/json-mapper/src/index.ts"], + "@tsed/platform-exceptions": ["../../platform/platform-exceptions/src/index.ts"], + "@tsed/platform-middlewares": ["../../platform/platform-middlewares/src/index.ts"], + "@tsed/platform-params": ["../../platform/platform-params/src/index.ts"], + "@tsed/platform-log-middleware": ["../../platform/platform-log-middleware/src/index.ts"], + "@tsed/platform-response-filter": ["../../platform/platform-response-filter/src/index.ts"], + "@tsed/platform-router": ["../../platform/platform-router/src/index.ts"], + "@tsed/platform-views": ["../../platform/platform-views/src/index.ts"], + "@tsed/normalize-path": ["../../utils/normalize-path/src/index.ts"], + "@tsed/components-scan": ["../../third-parties/components-scan/src/index.ts"], + "@tsed/common": ["../../platform/common/src/index.ts"], + "@tsed/ajv": ["../../specs/ajv/src/index.ts"], + "@tsed/platform-cache": ["../../platform/platform-cache/src/index.ts"], + "@tsed/swagger": ["../../specs/swagger/src/index.ts"], + "@tsed/platform-test-sdk": ["../../platform/platform-test-sdk/src/index.ts"], + "@tsed/platform-express": ["../../platform/platform-express/src/index.ts"], + "@tsed/platform-koa": ["../../platform/platform-koa/src/index.ts"] }, "types": ["vite/client", "vitest/globals"] }, diff --git a/packages/orm/adapters/package.json b/packages/orm/adapters/package.json index 83b9eb9ee82..c9478b5c744 100644 --- a/packages/orm/adapters/package.json +++ b/packages/orm/adapters/package.json @@ -11,7 +11,7 @@ ".": { "types": "./lib/types/index.d.ts", "import": "./lib/esm/index.js", - "default": "./lib/cjs/index.js" + "default": "./lib/esm/index.js" } }, "scripts": { diff --git a/packages/orm/adapters/src/adapters/FileSyncAdapter.spec.ts b/packages/orm/adapters/src/adapters/FileSyncAdapter.spec.ts index 09d692e9266..6323d43ca3e 100644 --- a/packages/orm/adapters/src/adapters/FileSyncAdapter.spec.ts +++ b/packages/orm/adapters/src/adapters/FileSyncAdapter.spec.ts @@ -2,7 +2,7 @@ import {faker} from "@faker-js/faker"; import {PlatformTest} from "@tsed/common"; import {Property} from "@tsed/schema"; -import {Adapter} from "../domain/Adapter.js"; +import type {Adapter} from "../domain/Adapter.js"; import {Adapters} from "../services/Adapters.js"; import {FileSyncAdapter} from "./FileSyncAdapter.js"; diff --git a/packages/orm/adapters/src/adapters/FileSyncAdapter.ts b/packages/orm/adapters/src/adapters/FileSyncAdapter.ts index 473cb12814e..363a5a39151 100644 --- a/packages/orm/adapters/src/adapters/FileSyncAdapter.ts +++ b/packages/orm/adapters/src/adapters/FileSyncAdapter.ts @@ -5,8 +5,9 @@ import low from "lowdb"; import FileSync from "lowdb/adapters/FileSync.js"; import {dirname} from "path"; -import {AdapterConstructorOptions} from "../domain/Adapter.js"; -import {AdapterModel, LowDbAdapter} from "./LowDbAdapter.js"; +import type {AdapterConstructorOptions} from "../domain/Adapter.js"; +import type {AdapterModel} from "./LowDbAdapter.js"; +import {LowDbAdapter} from "./LowDbAdapter.js"; export interface FileSyncAdapterConstructorOptions extends AdapterConstructorOptions { readOnly: true; diff --git a/packages/orm/adapters/src/adapters/LowDbAdapter.ts b/packages/orm/adapters/src/adapters/LowDbAdapter.ts index f3d05d4e644..335a1ac7f77 100644 --- a/packages/orm/adapters/src/adapters/LowDbAdapter.ts +++ b/packages/orm/adapters/src/adapters/LowDbAdapter.ts @@ -1,6 +1,6 @@ import {cleanObject} from "@tsed/core"; import isMatch from "lodash/isMatch.js"; -import low from "lowdb"; +import type low from "lowdb"; import {v4 as uuid} from "uuid"; import {Adapter} from "../domain/Adapter.js"; diff --git a/packages/orm/adapters/src/adapters/MemoryAdapter.spec.ts b/packages/orm/adapters/src/adapters/MemoryAdapter.spec.ts index a2a592f0a80..f3264e624b1 100644 --- a/packages/orm/adapters/src/adapters/MemoryAdapter.spec.ts +++ b/packages/orm/adapters/src/adapters/MemoryAdapter.spec.ts @@ -3,7 +3,7 @@ import {PlatformTest} from "@tsed/common"; import {deserialize} from "@tsed/json-mapper"; import {Format, getJsonSchema, Name, Property} from "@tsed/schema"; -import {Adapter} from "../domain/Adapter.js"; +import type {Adapter} from "../domain/Adapter.js"; import {Adapters} from "../services/Adapters.js"; import {MemoryAdapter} from "./MemoryAdapter.js"; diff --git a/packages/orm/adapters/src/adapters/MemoryAdapter.ts b/packages/orm/adapters/src/adapters/MemoryAdapter.ts index 8415645e41d..5bf07697039 100644 --- a/packages/orm/adapters/src/adapters/MemoryAdapter.ts +++ b/packages/orm/adapters/src/adapters/MemoryAdapter.ts @@ -2,7 +2,8 @@ import {Configuration, Injectable, Opts, ProviderScope, Scope} from "@tsed/di"; import low from "lowdb"; import Memory from "lowdb/adapters/Memory.js"; -import {AdapterModel, LowDbAdapter} from "./LowDbAdapter.js"; +import type {AdapterModel} from "./LowDbAdapter.js"; +import {LowDbAdapter} from "./LowDbAdapter.js"; @Injectable() @Scope(ProviderScope.INSTANCE) diff --git a/packages/orm/adapters/src/decorators/indexed.spec.ts b/packages/orm/adapters/src/decorators/indexed.spec.ts index 4877721f822..fe6d81b2de3 100644 --- a/packages/orm/adapters/src/decorators/indexed.spec.ts +++ b/packages/orm/adapters/src/decorators/indexed.spec.ts @@ -3,7 +3,7 @@ import {Injectable} from "@tsed/di"; import {Property} from "@tsed/schema"; import {MemoryAdapter} from "../adapters/MemoryAdapter.js"; -import {Adapter} from "../domain/Adapter.js"; +import type {Adapter} from "../domain/Adapter.js"; import {Indexed} from "./indexed.js"; import {InjectAdapter} from "./injectAdapter.js"; diff --git a/packages/orm/adapters/src/decorators/injectAdapter.spec.ts b/packages/orm/adapters/src/decorators/injectAdapter.spec.ts index 83d1ed212b0..f26b81d2ee5 100644 --- a/packages/orm/adapters/src/decorators/injectAdapter.spec.ts +++ b/packages/orm/adapters/src/decorators/injectAdapter.spec.ts @@ -3,7 +3,7 @@ import {Injectable} from "@tsed/di"; import {Name, Property} from "@tsed/schema"; import {MemoryAdapter} from "../adapters/MemoryAdapter.js"; -import {Adapter} from "../domain/Adapter.js"; +import type {Adapter} from "../domain/Adapter.js"; import {adapter, InjectAdapter} from "./injectAdapter.js"; describe("InjectAdapter", () => { diff --git a/packages/orm/adapters/src/decorators/injectAdapter.ts b/packages/orm/adapters/src/decorators/injectAdapter.ts index d9d18593055..37ecd6fd09a 100644 --- a/packages/orm/adapters/src/decorators/injectAdapter.ts +++ b/packages/orm/adapters/src/decorators/injectAdapter.ts @@ -1,8 +1,10 @@ -import {classOf, isClass, isString, Type} from "@tsed/core"; +import type {Type} from "@tsed/core"; +import {classOf, isClass, isString} from "@tsed/core"; import {Inject, inject} from "@tsed/di"; import type {Adapter} from "../domain/Adapter.js"; -import {AdapterInvokeOptions, Adapters} from "../services/Adapters.js"; +import type {AdapterInvokeOptions} from "../services/Adapters.js"; +import {Adapters} from "../services/Adapters.js"; function mapOptions(args: any[]): AdapterInvokeOptions { return args.reduce((options: AdapterInvokeOptions, item, index) => { diff --git a/packages/orm/adapters/src/domain/Adapter.ts b/packages/orm/adapters/src/domain/Adapter.ts index 7ad5e5e8b96..3de9264fa38 100644 --- a/packages/orm/adapters/src/domain/Adapter.ts +++ b/packages/orm/adapters/src/domain/Adapter.ts @@ -1,7 +1,9 @@ -import {AjvService} from "@tsed/ajv"; -import {classOf, isArray, isPlainObject, nameOf, Type} from "@tsed/core"; +import type {AjvService} from "@tsed/ajv"; +import type {Type} from "@tsed/core"; +import {classOf, isArray, isPlainObject, nameOf} from "@tsed/core"; import {Configuration, Inject, Opts} from "@tsed/di"; -import {deserialize, JsonDeserializerOptions, JsonSerializerOptions, serialize} from "@tsed/json-mapper"; +import type {JsonDeserializerOptions, JsonSerializerOptions} from "@tsed/json-mapper"; +import {deserialize, serialize} from "@tsed/json-mapper"; import {getPropertiesStores, JsonEntityStore} from "@tsed/schema"; export interface AdapterConstructorOptions extends Record { diff --git a/packages/orm/adapters/src/domain/AdaptersSettings.ts b/packages/orm/adapters/src/domain/AdaptersSettings.ts index 0310e93771f..9c03f877594 100644 --- a/packages/orm/adapters/src/domain/AdaptersSettings.ts +++ b/packages/orm/adapters/src/domain/AdaptersSettings.ts @@ -1,6 +1,6 @@ -import {Type} from "@tsed/core"; +import type {Type} from "@tsed/core"; -import {Adapter} from "./Adapter.js"; +import type {Adapter} from "./Adapter.js"; export interface AdaptersSettings { /** diff --git a/packages/orm/adapters/src/services/Adapters.ts b/packages/orm/adapters/src/services/Adapters.ts index 1daf605ac65..46c89a710ff 100644 --- a/packages/orm/adapters/src/services/Adapters.ts +++ b/packages/orm/adapters/src/services/Adapters.ts @@ -1,8 +1,8 @@ -import {Type} from "@tsed/core"; +import type {Type} from "@tsed/core"; import {Inject, Injectable, InjectorService} from "@tsed/di"; import {MemoryAdapter} from "../adapters/MemoryAdapter.js"; -import {Adapter, AdapterConstructorOptions} from "../domain/Adapter.js"; +import type {Adapter, AdapterConstructorOptions} from "../domain/Adapter.js"; export interface AdapterInvokeOptions extends AdapterConstructorOptions { adapter?: Type>; @@ -10,7 +10,7 @@ export interface AdapterInvokeOptions extends AdapterConstructorOpt @Injectable() export class Adapters { - @Inject() + @Inject(InjectorService) injector: InjectorService; invokeAdapter(options: AdapterInvokeOptions): Adapter { diff --git a/packages/orm/adapters/test/discrinimator.integration.spec.ts b/packages/orm/adapters/test/discrinimator.integration.spec.ts index 4dc7c9ebd2d..5d2f6c798d0 100644 --- a/packages/orm/adapters/test/discrinimator.integration.spec.ts +++ b/packages/orm/adapters/test/discrinimator.integration.spec.ts @@ -1,7 +1,8 @@ import {PlatformTest} from "@tsed/common"; import {DiscriminatorKey, DiscriminatorValue, Property, Required} from "@tsed/schema"; -import {Adapter, Adapters, FileSyncAdapter} from "../src/index.js"; +import type {Adapter} from "../src/index.js"; +import {Adapters, FileSyncAdapter} from "../src/index.js"; class Event { @DiscriminatorKey() // declare this property a discriminator key diff --git a/packages/orm/adapters/tsconfig.esm.json b/packages/orm/adapters/tsconfig.esm.json index 82292550ddb..8954049da4a 100644 --- a/packages/orm/adapters/tsconfig.esm.json +++ b/packages/orm/adapters/tsconfig.esm.json @@ -2,7 +2,6 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", diff --git a/packages/orm/adapters/tsconfig.spec.json b/packages/orm/adapters/tsconfig.spec.json index 2e917f4b39d..fdb41369c3a 100644 --- a/packages/orm/adapters/tsconfig.spec.json +++ b/packages/orm/adapters/tsconfig.spec.json @@ -3,31 +3,31 @@ "compilerOptions": { "baseUrl": ".", "rootDir": "../..", - "outDir": "./lib/cjs", "declaration": false, "composite": false, "noEmit": true, "paths": { - "@tsed/openspec": ["../../specs/openspec/src"], - "@tsed/schema": ["../../specs/schema/src"], - "@tsed/di": ["../../di/src"], - "@tsed/exceptions": ["../../specs/exceptions/src"], - "@tsed/json-mapper": ["../../specs/json-mapper/src"], - "@tsed/platform-exceptions": ["../../platform/platform-exceptions/src"], - "@tsed/platform-middlewares": ["../../platform/platform-middlewares/src"], - "@tsed/platform-params": ["../../platform/platform-params/src"], - "@tsed/platform-log-middleware": ["../../platform/platform-log-middleware/src"], - "@tsed/platform-response-filter": ["../../platform/platform-response-filter/src"], - "@tsed/platform-router": ["../../platform/platform-router/src"], - "@tsed/platform-views": ["../../platform/platform-views/src"], - "@tsed/components-scan": ["../../third-parties/components-scan/src"], - "@tsed/common": ["../../platform/common/src"], - "@tsed/ajv": ["../../specs/ajv/src"], - "@tsed/platform-cache": ["../../platform/platform-cache/src"], - "@tsed/swagger": ["../../specs/swagger/src"], - "@tsed/platform-test-sdk": ["../../platform/platform-test-sdk/src"], - "@tsed/platform-express": ["../../platform/platform-express/src"], - "@tsed/platform-koa": ["../../platform/platform-koa/src"] + "@tsed/openspec": ["../../specs/openspec/src/index.ts"], + "@tsed/schema": ["../../specs/schema/src/index.ts"], + "@tsed/di": ["../../di/src/index.ts"], + "@tsed/exceptions": ["../../specs/exceptions/src/index.ts"], + "@tsed/json-mapper": ["../../specs/json-mapper/src/index.ts"], + "@tsed/platform-exceptions": ["../../platform/platform-exceptions/src/index.ts"], + "@tsed/platform-middlewares": ["../../platform/platform-middlewares/src/index.ts"], + "@tsed/platform-params": ["../../platform/platform-params/src/index.ts"], + "@tsed/platform-log-middleware": ["../../platform/platform-log-middleware/src/index.ts"], + "@tsed/platform-response-filter": ["../../platform/platform-response-filter/src/index.ts"], + "@tsed/platform-router": ["../../platform/platform-router/src/index.ts"], + "@tsed/platform-views": ["../../platform/platform-views/src/index.ts"], + "@tsed/normalize-path": ["../../utils/normalize-path/src/index.ts"], + "@tsed/components-scan": ["../../third-parties/components-scan/src/index.ts"], + "@tsed/common": ["../../platform/common/src/index.ts"], + "@tsed/ajv": ["../../specs/ajv/src/index.ts"], + "@tsed/platform-cache": ["../../platform/platform-cache/src/index.ts"], + "@tsed/swagger": ["../../specs/swagger/src/index.ts"], + "@tsed/platform-test-sdk": ["../../platform/platform-test-sdk/src/index.ts"], + "@tsed/platform-express": ["../../platform/platform-express/src/index.ts"], + "@tsed/platform-koa": ["../../platform/platform-koa/src/index.ts"] }, "types": ["vite/client", "vitest/globals"] }, diff --git a/packages/orm/ioredis/package.json b/packages/orm/ioredis/package.json index 811f68c2031..6ce253e792b 100644 --- a/packages/orm/ioredis/package.json +++ b/packages/orm/ioredis/package.json @@ -11,7 +11,7 @@ ".": { "types": "./lib/types/index.d.ts", "import": "./lib/esm/index.js", - "default": "./lib/cjs/index.js" + "default": "./lib/esm/index.js" } }, "scripts": { diff --git a/packages/orm/ioredis/src/domain/IORedisConfiguration.ts b/packages/orm/ioredis/src/domain/IORedisConfiguration.ts index 5b9ecc49451..32e4e347ff8 100644 --- a/packages/orm/ioredis/src/domain/IORedisConfiguration.ts +++ b/packages/orm/ioredis/src/domain/IORedisConfiguration.ts @@ -1,5 +1,5 @@ -import {TokenProvider} from "@tsed/di"; -import {Cluster, ClusterOptions, Redis, RedisOptions} from "ioredis"; +import type {TokenProvider} from "@tsed/di"; +import type {Cluster, ClusterOptions, Redis, RedisOptions} from "ioredis"; export type ClusterConfiguration = {nodes: string[]} & ClusterOptions; diff --git a/packages/orm/ioredis/src/domain/IORedisStore.spec.ts b/packages/orm/ioredis/src/domain/IORedisStore.spec.ts index b2831ab7982..9b940b3bdaa 100644 --- a/packages/orm/ioredis/src/domain/IORedisStore.spec.ts +++ b/packages/orm/ioredis/src/domain/IORedisStore.spec.ts @@ -1,5 +1,6 @@ import {catchAsyncError, Hooks} from "@tsed/core"; -import {Cache, caching} from "cache-manager"; +import type {Cache} from "cache-manager"; +import {caching} from "cache-manager"; import {Redis} from "ioredis"; import {IORedisStore, ioRedisStore} from "./IORedisStore.js"; diff --git a/packages/orm/ioredis/src/domain/IORedisStore.ts b/packages/orm/ioredis/src/domain/IORedisStore.ts index 0929255e504..65a2c90d5f6 100644 --- a/packages/orm/ioredis/src/domain/IORedisStore.ts +++ b/packages/orm/ioredis/src/domain/IORedisStore.ts @@ -1,5 +1,6 @@ import type {Config, FactoryConfig, Store} from "cache-manager"; -import {Cluster, ClusterNode, ClusterOptions, Redis, RedisOptions} from "ioredis"; +import type {Cluster, ClusterNode, ClusterOptions, RedisOptions} from "ioredis"; +import {Redis} from "ioredis"; export interface RedisClusterConfig { nodes: ClusterNode[]; diff --git a/packages/orm/ioredis/src/utils/mockConnections.ts b/packages/orm/ioredis/src/utils/mockConnections.ts index a4bb768a62b..246ceaedc48 100644 --- a/packages/orm/ioredis/src/utils/mockConnections.ts +++ b/packages/orm/ioredis/src/utils/mockConnections.ts @@ -1,4 +1,5 @@ -import {GlobalProviders, TokenProvider} from "@tsed/di"; +import type {TokenProvider} from "@tsed/di"; +import {GlobalProviders} from "@tsed/di"; import type {Redis} from "ioredis"; import {IOREDIS_CONNECTIONS} from "./registerConnectionProvider.js"; diff --git a/packages/orm/ioredis/src/utils/registerConnectionProvider.spec.ts b/packages/orm/ioredis/src/utils/registerConnectionProvider.spec.ts index 2d3f471129b..6d566737e44 100644 --- a/packages/orm/ioredis/src/utils/registerConnectionProvider.spec.ts +++ b/packages/orm/ioredis/src/utils/registerConnectionProvider.spec.ts @@ -1,5 +1,5 @@ import {DITest} from "@tsed/di"; -import {Redis} from "ioredis"; +import type {Redis} from "ioredis"; import {registerConnectionProvider} from "./registerConnectionProvider.js"; diff --git a/packages/orm/ioredis/src/utils/registerConnectionProvider.ts b/packages/orm/ioredis/src/utils/registerConnectionProvider.ts index 01a6c6c5700..c5fc99b0cfe 100644 --- a/packages/orm/ioredis/src/utils/registerConnectionProvider.ts +++ b/packages/orm/ioredis/src/utils/registerConnectionProvider.ts @@ -1,9 +1,11 @@ import {setValue} from "@tsed/core"; -import {Configuration, registerProvider, TokenProvider} from "@tsed/di"; +import type {TokenProvider} from "@tsed/di"; +import {Configuration, registerProvider} from "@tsed/di"; import {Logger} from "@tsed/logger"; -import {Cluster, Redis, RedisOptions} from "ioredis"; +import type {Cluster, RedisOptions} from "ioredis"; +import {Redis} from "ioredis"; -import {IORedisConfiguration} from "../domain/IORedisConfiguration.js"; +import type {IORedisConfiguration} from "../domain/IORedisConfiguration.js"; import {ioRedisStore} from "../domain/IORedisStore.js"; export interface CreateConnectionProviderProps { diff --git a/packages/orm/ioredis/tsconfig.esm.json b/packages/orm/ioredis/tsconfig.esm.json index 82292550ddb..8954049da4a 100644 --- a/packages/orm/ioredis/tsconfig.esm.json +++ b/packages/orm/ioredis/tsconfig.esm.json @@ -2,7 +2,6 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", diff --git a/packages/orm/ioredis/tsconfig.spec.json b/packages/orm/ioredis/tsconfig.spec.json index 2e917f4b39d..fdb41369c3a 100644 --- a/packages/orm/ioredis/tsconfig.spec.json +++ b/packages/orm/ioredis/tsconfig.spec.json @@ -3,31 +3,31 @@ "compilerOptions": { "baseUrl": ".", "rootDir": "../..", - "outDir": "./lib/cjs", "declaration": false, "composite": false, "noEmit": true, "paths": { - "@tsed/openspec": ["../../specs/openspec/src"], - "@tsed/schema": ["../../specs/schema/src"], - "@tsed/di": ["../../di/src"], - "@tsed/exceptions": ["../../specs/exceptions/src"], - "@tsed/json-mapper": ["../../specs/json-mapper/src"], - "@tsed/platform-exceptions": ["../../platform/platform-exceptions/src"], - "@tsed/platform-middlewares": ["../../platform/platform-middlewares/src"], - "@tsed/platform-params": ["../../platform/platform-params/src"], - "@tsed/platform-log-middleware": ["../../platform/platform-log-middleware/src"], - "@tsed/platform-response-filter": ["../../platform/platform-response-filter/src"], - "@tsed/platform-router": ["../../platform/platform-router/src"], - "@tsed/platform-views": ["../../platform/platform-views/src"], - "@tsed/components-scan": ["../../third-parties/components-scan/src"], - "@tsed/common": ["../../platform/common/src"], - "@tsed/ajv": ["../../specs/ajv/src"], - "@tsed/platform-cache": ["../../platform/platform-cache/src"], - "@tsed/swagger": ["../../specs/swagger/src"], - "@tsed/platform-test-sdk": ["../../platform/platform-test-sdk/src"], - "@tsed/platform-express": ["../../platform/platform-express/src"], - "@tsed/platform-koa": ["../../platform/platform-koa/src"] + "@tsed/openspec": ["../../specs/openspec/src/index.ts"], + "@tsed/schema": ["../../specs/schema/src/index.ts"], + "@tsed/di": ["../../di/src/index.ts"], + "@tsed/exceptions": ["../../specs/exceptions/src/index.ts"], + "@tsed/json-mapper": ["../../specs/json-mapper/src/index.ts"], + "@tsed/platform-exceptions": ["../../platform/platform-exceptions/src/index.ts"], + "@tsed/platform-middlewares": ["../../platform/platform-middlewares/src/index.ts"], + "@tsed/platform-params": ["../../platform/platform-params/src/index.ts"], + "@tsed/platform-log-middleware": ["../../platform/platform-log-middleware/src/index.ts"], + "@tsed/platform-response-filter": ["../../platform/platform-response-filter/src/index.ts"], + "@tsed/platform-router": ["../../platform/platform-router/src/index.ts"], + "@tsed/platform-views": ["../../platform/platform-views/src/index.ts"], + "@tsed/normalize-path": ["../../utils/normalize-path/src/index.ts"], + "@tsed/components-scan": ["../../third-parties/components-scan/src/index.ts"], + "@tsed/common": ["../../platform/common/src/index.ts"], + "@tsed/ajv": ["../../specs/ajv/src/index.ts"], + "@tsed/platform-cache": ["../../platform/platform-cache/src/index.ts"], + "@tsed/swagger": ["../../specs/swagger/src/index.ts"], + "@tsed/platform-test-sdk": ["../../platform/platform-test-sdk/src/index.ts"], + "@tsed/platform-express": ["../../platform/platform-express/src/index.ts"], + "@tsed/platform-koa": ["../../platform/platform-koa/src/index.ts"] }, "types": ["vite/client", "vitest/globals"] }, diff --git a/packages/orm/mikro-orm/package.json b/packages/orm/mikro-orm/package.json index 53fba68541c..45cbf94693b 100644 --- a/packages/orm/mikro-orm/package.json +++ b/packages/orm/mikro-orm/package.json @@ -11,7 +11,7 @@ ".": { "types": "./lib/types/index.d.ts", "import": "./lib/esm/index.js", - "default": "./lib/cjs/index.js" + "default": "./lib/esm/index.js" } }, "scripts": { diff --git a/packages/orm/mikro-orm/src/MikroOrmModule.spec.ts b/packages/orm/mikro-orm/src/MikroOrmModule.spec.ts index 2b5a4eb1bcd..9f5bf3c1a72 100644 --- a/packages/orm/mikro-orm/src/MikroOrmModule.spec.ts +++ b/packages/orm/mikro-orm/src/MikroOrmModule.spec.ts @@ -1,4 +1,4 @@ -import {EntityManager, EventSubscriber, MikroORM, Options} from "@mikro-orm/core"; +import type {EntityManager, EventSubscriber, MikroORM, Options} from "@mikro-orm/core"; import {PlatformTest} from "@tsed/common"; import {anyOfClass, anything, deepEqual, instance, mock, reset, verify, when} from "ts-mockito"; diff --git a/packages/orm/mikro-orm/src/MikroOrmModule.ts b/packages/orm/mikro-orm/src/MikroOrmModule.ts index 4e4b62c64af..c9357e2004c 100644 --- a/packages/orm/mikro-orm/src/MikroOrmModule.ts +++ b/packages/orm/mikro-orm/src/MikroOrmModule.ts @@ -1,19 +1,9 @@ import "./services/MikroOrmFactory"; -import {EventSubscriber, Options} from "@mikro-orm/core"; +import type {EventSubscriber, Options} from "@mikro-orm/core"; import {classOf, isFunction, Store} from "@tsed/core"; -import { - AlterRunInContext, - Constant, - Inject, - InjectorService, - LocalsContainer, - Module, - OnDestroy, - OnInit, - ProviderScope, - registerProvider -} from "@tsed/di"; +import type {AlterRunInContext, OnDestroy, OnInit} from "@tsed/di"; +import {Constant, Inject, InjectorService, LocalsContainer, Module, ProviderScope, registerProvider} from "@tsed/di"; import {DEFAULT_CONTEXT_NAME, SUBSCRIBER_INJECTION_TYPE} from "./constants.js"; import {OptimisticLockErrorFilter} from "./filters/OptimisticLockErrorFilter.js"; @@ -40,13 +30,13 @@ export class MikroOrmModule implements OnDestroy, OnInit, AlterRunInContext { @Constant("mikroOrm", []) private readonly settings!: Options[]; - @Inject() + @Inject(MikroOrmRegistry) private readonly registry!: MikroOrmRegistry; - @Inject() + @Inject(MikroOrmContext) private readonly context!: MikroOrmContext; - @Inject() + @Inject(InjectorService) private readonly injector!: InjectorService; constructor(@Inject(SUBSCRIBER_INJECTION_TYPE) private subscribers: EventSubscriber[]) {} diff --git a/packages/orm/mikro-orm/src/decorators/entityManager.spec.ts b/packages/orm/mikro-orm/src/decorators/entityManager.spec.ts index ad70ee7fdf5..d1d7af6ed70 100644 --- a/packages/orm/mikro-orm/src/decorators/entityManager.spec.ts +++ b/packages/orm/mikro-orm/src/decorators/entityManager.spec.ts @@ -1,5 +1,5 @@ -import {MikroORM} from "@mikro-orm/core"; -import {MongoEntityManager} from "@mikro-orm/mongodb"; +import type {MikroORM} from "@mikro-orm/core"; +import type {MongoEntityManager} from "@mikro-orm/mongodb"; import {DITest, Injectable} from "@tsed/di"; import {afterEach, beforeEach} from "vitest"; diff --git a/packages/orm/mikro-orm/src/decorators/orm.spec.ts b/packages/orm/mikro-orm/src/decorators/orm.spec.ts index 30186a6b182..390e046ddc6 100644 --- a/packages/orm/mikro-orm/src/decorators/orm.spec.ts +++ b/packages/orm/mikro-orm/src/decorators/orm.spec.ts @@ -1,4 +1,4 @@ -import {MikroORM} from "@mikro-orm/core"; +import type {MikroORM} from "@mikro-orm/core"; import {DITest, Injectable} from "@tsed/di"; import {afterEach, beforeEach} from "vitest"; diff --git a/packages/orm/mikro-orm/src/decorators/orm.ts b/packages/orm/mikro-orm/src/decorators/orm.ts index b1a0c7dae7e..fd6bfd4a35b 100644 --- a/packages/orm/mikro-orm/src/decorators/orm.ts +++ b/packages/orm/mikro-orm/src/decorators/orm.ts @@ -1,4 +1,4 @@ -import {MikroORM} from "@mikro-orm/core"; +import type {MikroORM} from "@mikro-orm/core"; import {Inject, inject} from "@tsed/di"; import {MikroOrmRegistry} from "../services/MikroOrmRegistry.js"; diff --git a/packages/orm/mikro-orm/src/decorators/subscriber.spec.ts b/packages/orm/mikro-orm/src/decorators/subscriber.spec.ts index 52c82a88c00..4a1c1b36d17 100644 --- a/packages/orm/mikro-orm/src/decorators/subscriber.spec.ts +++ b/packages/orm/mikro-orm/src/decorators/subscriber.spec.ts @@ -1,4 +1,4 @@ -import {EventSubscriber} from "@mikro-orm/core"; +import type {EventSubscriber} from "@mikro-orm/core"; import {Store} from "@tsed/core"; import {DEFAULT_CONTEXT_NAME, SUBSCRIBER_INJECTION_TYPE} from "../constants.js"; diff --git a/packages/orm/mikro-orm/src/decorators/transactional.ts b/packages/orm/mikro-orm/src/decorators/transactional.ts index 18caea7f49d..0f18374d578 100644 --- a/packages/orm/mikro-orm/src/decorators/transactional.ts +++ b/packages/orm/mikro-orm/src/decorators/transactional.ts @@ -1,6 +1,7 @@ import {Intercept} from "@tsed/di"; -import {TransactionalInterceptor, TransactionOptions} from "../interceptors/TransactionalInterceptor.js"; +import type {TransactionOptions} from "../interceptors/TransactionalInterceptor.js"; +import {TransactionalInterceptor} from "../interceptors/TransactionalInterceptor.js"; /** * Register a new request context for your method and execute it inside the context. diff --git a/packages/orm/mikro-orm/src/filters/OptimisticLockErrorFilter.spec.ts b/packages/orm/mikro-orm/src/filters/OptimisticLockErrorFilter.spec.ts index 6bfd33598b6..57acc68e07f 100644 --- a/packages/orm/mikro-orm/src/filters/OptimisticLockErrorFilter.spec.ts +++ b/packages/orm/mikro-orm/src/filters/OptimisticLockErrorFilter.spec.ts @@ -1,5 +1,6 @@ import {OptimisticLockError} from "@mikro-orm/core"; -import {Logger, PlatformContext, PlatformTest} from "@tsed/common"; +import type {Logger} from "@tsed/common"; +import {PlatformContext, PlatformTest} from "@tsed/common"; import {instance, mock, objectContaining, reset, spy, verify} from "ts-mockito"; import {OptimisticLockErrorFilter} from "./OptimisticLockErrorFilter.js"; diff --git a/packages/orm/mikro-orm/src/filters/OptimisticLockErrorFilter.ts b/packages/orm/mikro-orm/src/filters/OptimisticLockErrorFilter.ts index 3e16f4c0663..60591c7aa04 100644 --- a/packages/orm/mikro-orm/src/filters/OptimisticLockErrorFilter.ts +++ b/packages/orm/mikro-orm/src/filters/OptimisticLockErrorFilter.ts @@ -1,5 +1,6 @@ import {OptimisticLockError} from "@mikro-orm/core"; -import {Catch, ExceptionFilterMethods, PlatformContext} from "@tsed/common"; +import type {ExceptionFilterMethods, PlatformContext} from "@tsed/common"; +import {Catch} from "@tsed/common"; @Catch(OptimisticLockError) export class OptimisticLockErrorFilter implements ExceptionFilterMethods { diff --git a/packages/orm/mikro-orm/src/interceptors/TransactionalInterceptor.spec.ts b/packages/orm/mikro-orm/src/interceptors/TransactionalInterceptor.spec.ts index 678f3987705..c804008fae9 100644 --- a/packages/orm/mikro-orm/src/interceptors/TransactionalInterceptor.spec.ts +++ b/packages/orm/mikro-orm/src/interceptors/TransactionalInterceptor.spec.ts @@ -1,11 +1,12 @@ -import {EntityManager, IsolationLevel, MikroORM, OptimisticLockError} from "@mikro-orm/core"; -import {InjectorService, InterceptorContext} from "@tsed/di"; -import {Logger} from "@tsed/logger"; +import type {EntityManager, MikroORM} from "@mikro-orm/core"; +import {IsolationLevel, OptimisticLockError} from "@mikro-orm/core"; +import type {InjectorService, InterceptorContext} from "@tsed/di"; +import type {Logger} from "@tsed/logger"; import {anyFunction, anything, deepEqual, instance, mock, objectContaining, reset, verify, when} from "ts-mockito"; import {RetryStrategy} from "../interfaces/RetryStrategy.js"; -import {MikroOrmContext} from "../services/MikroOrmContext.js"; -import {MikroOrmRegistry} from "../services/MikroOrmRegistry.js"; +import type {MikroOrmContext} from "../services/MikroOrmContext.js"; +import type {MikroOrmRegistry} from "../services/MikroOrmRegistry.js"; import {TransactionalInterceptor} from "./TransactionalInterceptor.js"; // AHDOC: https://github.com/NagRock/ts-mockito/issues/191 diff --git a/packages/orm/mikro-orm/src/interceptors/TransactionalInterceptor.ts b/packages/orm/mikro-orm/src/interceptors/TransactionalInterceptor.ts index eafb87d1db3..d19370d81ef 100644 --- a/packages/orm/mikro-orm/src/interceptors/TransactionalInterceptor.ts +++ b/packages/orm/mikro-orm/src/interceptors/TransactionalInterceptor.ts @@ -1,5 +1,6 @@ -import {EntityManager, FlushMode, IsolationLevel} from "@mikro-orm/core"; -import {Inject, InjectorService, Interceptor, InterceptorContext, InterceptorMethods, InterceptorNext} from "@tsed/di"; +import type {EntityManager, FlushMode, IsolationLevel} from "@mikro-orm/core"; +import type {InterceptorContext, InterceptorMethods, InterceptorNext} from "@tsed/di"; +import {Inject, InjectorService, Interceptor} from "@tsed/di"; import {Logger} from "@tsed/logger"; import {DEFAULT_CONTEXT_NAME} from "../constants.js"; @@ -20,10 +21,10 @@ type TransactionSettings = Omit & Required | unknown; diff --git a/packages/orm/mikro-orm/src/interfaces/BeforeTransactionCommit.ts b/packages/orm/mikro-orm/src/interfaces/BeforeTransactionCommit.ts index 69d7b5aaad6..048116df19c 100644 --- a/packages/orm/mikro-orm/src/interfaces/BeforeTransactionCommit.ts +++ b/packages/orm/mikro-orm/src/interfaces/BeforeTransactionCommit.ts @@ -1,4 +1,4 @@ -import {EntityManager} from "@mikro-orm/core"; +import type {EntityManager} from "@mikro-orm/core"; export interface BeforeTransactionCommit { $beforeTransactionCommit(em: EntityManager): Promise | unknown; diff --git a/packages/orm/mikro-orm/src/services/MikroOrmContext.spec.ts b/packages/orm/mikro-orm/src/services/MikroOrmContext.spec.ts index 4f37ec2b274..e4fa5e1c29b 100644 --- a/packages/orm/mikro-orm/src/services/MikroOrmContext.spec.ts +++ b/packages/orm/mikro-orm/src/services/MikroOrmContext.spec.ts @@ -1,4 +1,5 @@ -import {EntityManager, RequestContext} from "@mikro-orm/core"; +import type {EntityManager} from "@mikro-orm/core"; +import {RequestContext} from "@mikro-orm/core"; import {deepEqual, instance as originalInstance, mock, reset, spy, verify, when} from "ts-mockito"; import {MikroOrmContext} from "./MikroOrmContext.js"; diff --git a/packages/orm/mikro-orm/src/services/MikroOrmContext.ts b/packages/orm/mikro-orm/src/services/MikroOrmContext.ts index 44f90bff278..a5a22d440b8 100644 --- a/packages/orm/mikro-orm/src/services/MikroOrmContext.ts +++ b/packages/orm/mikro-orm/src/services/MikroOrmContext.ts @@ -1,4 +1,5 @@ -import {EntityManager, RequestContext} from "@mikro-orm/core"; +import type {EntityManager} from "@mikro-orm/core"; +import {RequestContext} from "@mikro-orm/core"; import {isFunction} from "@tsed/core"; import {Injectable} from "@tsed/di"; diff --git a/packages/orm/mikro-orm/src/services/MikroOrmFactory.ts b/packages/orm/mikro-orm/src/services/MikroOrmFactory.ts index cbe1e7c2910..3a41f36d601 100644 --- a/packages/orm/mikro-orm/src/services/MikroOrmFactory.ts +++ b/packages/orm/mikro-orm/src/services/MikroOrmFactory.ts @@ -1,11 +1,12 @@ -import {MikroORM, Options} from "@mikro-orm/core"; +import type {Options} from "@mikro-orm/core"; +import {MikroORM} from "@mikro-orm/core"; import {Inject, Injectable} from "@tsed/di"; import {MikroOrmContext} from "./MikroOrmContext.js"; @Injectable() export class MikroOrmFactory { - constructor(@Inject() private readonly context: MikroOrmContext) {} + constructor(@Inject(MikroOrmContext) private readonly context: MikroOrmContext) {} public create(options: Options): Promise { return MikroORM.init({ diff --git a/packages/orm/mikro-orm/src/services/MikroOrmRegistry.spec.ts b/packages/orm/mikro-orm/src/services/MikroOrmRegistry.spec.ts index f11e3015da1..43a9df2c6f7 100644 --- a/packages/orm/mikro-orm/src/services/MikroOrmRegistry.spec.ts +++ b/packages/orm/mikro-orm/src/services/MikroOrmRegistry.spec.ts @@ -1,8 +1,9 @@ -import {MikroORM, Options} from "@mikro-orm/core"; -import {Logger} from "@tsed/logger"; +import type {Options} from "@mikro-orm/core"; +import {MikroORM} from "@mikro-orm/core"; +import type {Logger} from "@tsed/logger"; import {anything, instance, mock, reset, verify, when} from "ts-mockito"; -import {MikroOrmFactory} from "./MikroOrmFactory.js"; +import type {MikroOrmFactory} from "./MikroOrmFactory.js"; import {MikroOrmRegistry} from "./MikroOrmRegistry.js"; const fixtures: {mydb2: Options; none: Options; mydb: Options} = { diff --git a/packages/orm/mikro-orm/src/services/MikroOrmRegistry.ts b/packages/orm/mikro-orm/src/services/MikroOrmRegistry.ts index 404dd299ab5..9cdaaca7b57 100644 --- a/packages/orm/mikro-orm/src/services/MikroOrmRegistry.ts +++ b/packages/orm/mikro-orm/src/services/MikroOrmRegistry.ts @@ -1,4 +1,4 @@ -import {IDatabaseDriver as DatabaseDriver, MikroORM, Options} from "@mikro-orm/core"; +import type {IDatabaseDriver as DatabaseDriver, MikroORM, Options} from "@mikro-orm/core"; import {catchAsyncError, getValue} from "@tsed/core"; import {Inject, Injectable} from "@tsed/di"; import {Logger} from "@tsed/logger"; @@ -11,8 +11,8 @@ export class MikroOrmRegistry { private readonly instances = new Map(); constructor( - @Inject() private readonly logger: Logger, - @Inject() private readonly mikroOrmFactory: MikroOrmFactory + @Inject(Logger) private readonly logger: Logger, + @Inject(MikroOrmFactory) private readonly mikroOrmFactory: MikroOrmFactory ) {} public async register(options: Options): Promise { diff --git a/packages/orm/mikro-orm/test/helpers/Server.ts b/packages/orm/mikro-orm/test/helpers/Server.ts index dc688ce256f..563e4a78b33 100644 --- a/packages/orm/mikro-orm/test/helpers/Server.ts +++ b/packages/orm/mikro-orm/test/helpers/Server.ts @@ -21,7 +21,7 @@ const rootDir = import.meta.dirname; } }) export class Server { - @Inject() + @Inject(PlatformApplication) app!: PlatformApplication; public $beforeRoutesInit(): void { diff --git a/packages/orm/mikro-orm/test/helpers/entity/User.ts b/packages/orm/mikro-orm/test/helpers/entity/User.ts index df62604ce0a..ea1d42eb884 100644 --- a/packages/orm/mikro-orm/test/helpers/entity/User.ts +++ b/packages/orm/mikro-orm/test/helpers/entity/User.ts @@ -1,5 +1,5 @@ import {Entity, PrimaryKey} from "@mikro-orm/core"; -import {ObjectId} from "@mikro-orm/mongodb"; +import type {ObjectId} from "@mikro-orm/mongodb"; import {Property} from "@tsed/schema"; @Entity() diff --git a/packages/orm/mikro-orm/test/helpers/services/Hooks.ts b/packages/orm/mikro-orm/test/helpers/services/Hooks.ts index 6c09084303b..9094d91eb6a 100644 --- a/packages/orm/mikro-orm/test/helpers/services/Hooks.ts +++ b/packages/orm/mikro-orm/test/helpers/services/Hooks.ts @@ -1,7 +1,7 @@ -import {EntityManager} from "@mikro-orm/core"; +import type {EntityManager} from "@mikro-orm/core"; import {Injectable} from "@tsed/di"; -import {AfterTransactionCommit, BeforeTransactionCommit} from "../../../src/index.js"; +import type {AfterTransactionCommit, BeforeTransactionCommit} from "../../../src/index.js"; @Injectable() export class Hooks implements AfterTransactionCommit, BeforeTransactionCommit { diff --git a/packages/orm/mikro-orm/test/helpers/services/ManagedEventSubscriber.ts b/packages/orm/mikro-orm/test/helpers/services/ManagedEventSubscriber.ts index 412437e16f3..a9a913df466 100644 --- a/packages/orm/mikro-orm/test/helpers/services/ManagedEventSubscriber.ts +++ b/packages/orm/mikro-orm/test/helpers/services/ManagedEventSubscriber.ts @@ -1,4 +1,4 @@ -import {EventSubscriber, TransactionEventArgs} from "@mikro-orm/core"; +import type {EventSubscriber, TransactionEventArgs} from "@mikro-orm/core"; import {Inject} from "@tsed/di"; import {Logger} from "@tsed/logger"; @@ -6,7 +6,7 @@ import {Subscriber} from "../../../src/index.js"; @Subscriber() export class ManagedEventSubscriber implements EventSubscriber { - constructor(@Inject() private readonly logger: Logger) {} + constructor(@Inject(Logger) private readonly logger: Logger) {} public afterFlush(_: TransactionEventArgs): Promise { this.logger.info("Changes has been flushed."); diff --git a/packages/orm/mikro-orm/test/helpers/services/UnmanagedEventSubscriber1.ts b/packages/orm/mikro-orm/test/helpers/services/UnmanagedEventSubscriber1.ts index 526d540c900..7b1e4b5dca8 100644 --- a/packages/orm/mikro-orm/test/helpers/services/UnmanagedEventSubscriber1.ts +++ b/packages/orm/mikro-orm/test/helpers/services/UnmanagedEventSubscriber1.ts @@ -1,9 +1,9 @@ -import {EventSubscriber, TransactionEventArgs} from "@mikro-orm/core"; +import type {EventSubscriber, TransactionEventArgs} from "@mikro-orm/core"; import {Inject} from "@tsed/di"; import {$log, Logger} from "@tsed/logger"; export class UnmanagedEventSubscriber1 implements EventSubscriber { - constructor(@Inject() private readonly logger: Logger) {} + constructor(@Inject(Logger) private readonly logger: Logger) {} public afterFlush(_: TransactionEventArgs): Promise { $log.info("Changes has been flushed."); diff --git a/packages/orm/mikro-orm/test/helpers/services/UnmanagedEventSubscriber2.ts b/packages/orm/mikro-orm/test/helpers/services/UnmanagedEventSubscriber2.ts index e5a5cb44223..588355fde5b 100644 --- a/packages/orm/mikro-orm/test/helpers/services/UnmanagedEventSubscriber2.ts +++ b/packages/orm/mikro-orm/test/helpers/services/UnmanagedEventSubscriber2.ts @@ -1,9 +1,9 @@ -import {EventSubscriber, TransactionEventArgs} from "@mikro-orm/core"; +import type {EventSubscriber, TransactionEventArgs} from "@mikro-orm/core"; import {Inject} from "@tsed/di"; import {$log, Logger} from "@tsed/logger"; export class UnmanagedEventSubscriber2 implements EventSubscriber { - @Inject() + @Inject(Logger) private readonly logger: Logger; public afterFlush(_: TransactionEventArgs): Promise { diff --git a/packages/orm/mikro-orm/test/helpers/services/UserService.ts b/packages/orm/mikro-orm/test/helpers/services/UserService.ts index 525f11674d4..daf1d4a1a02 100644 --- a/packages/orm/mikro-orm/test/helpers/services/UserService.ts +++ b/packages/orm/mikro-orm/test/helpers/services/UserService.ts @@ -1,4 +1,4 @@ -import {EntityManager, MikroORM} from "@mikro-orm/core"; +import type {EntityManager, MikroORM} from "@mikro-orm/core"; import {Injectable} from "@tsed/di"; import {Em, Orm, Transactional} from "../../../src/index.js"; diff --git a/packages/orm/mikro-orm/tsconfig.esm.json b/packages/orm/mikro-orm/tsconfig.esm.json index 82292550ddb..8954049da4a 100644 --- a/packages/orm/mikro-orm/tsconfig.esm.json +++ b/packages/orm/mikro-orm/tsconfig.esm.json @@ -2,7 +2,6 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", diff --git a/packages/orm/mikro-orm/tsconfig.spec.json b/packages/orm/mikro-orm/tsconfig.spec.json index 2e917f4b39d..fdb41369c3a 100644 --- a/packages/orm/mikro-orm/tsconfig.spec.json +++ b/packages/orm/mikro-orm/tsconfig.spec.json @@ -3,31 +3,31 @@ "compilerOptions": { "baseUrl": ".", "rootDir": "../..", - "outDir": "./lib/cjs", "declaration": false, "composite": false, "noEmit": true, "paths": { - "@tsed/openspec": ["../../specs/openspec/src"], - "@tsed/schema": ["../../specs/schema/src"], - "@tsed/di": ["../../di/src"], - "@tsed/exceptions": ["../../specs/exceptions/src"], - "@tsed/json-mapper": ["../../specs/json-mapper/src"], - "@tsed/platform-exceptions": ["../../platform/platform-exceptions/src"], - "@tsed/platform-middlewares": ["../../platform/platform-middlewares/src"], - "@tsed/platform-params": ["../../platform/platform-params/src"], - "@tsed/platform-log-middleware": ["../../platform/platform-log-middleware/src"], - "@tsed/platform-response-filter": ["../../platform/platform-response-filter/src"], - "@tsed/platform-router": ["../../platform/platform-router/src"], - "@tsed/platform-views": ["../../platform/platform-views/src"], - "@tsed/components-scan": ["../../third-parties/components-scan/src"], - "@tsed/common": ["../../platform/common/src"], - "@tsed/ajv": ["../../specs/ajv/src"], - "@tsed/platform-cache": ["../../platform/platform-cache/src"], - "@tsed/swagger": ["../../specs/swagger/src"], - "@tsed/platform-test-sdk": ["../../platform/platform-test-sdk/src"], - "@tsed/platform-express": ["../../platform/platform-express/src"], - "@tsed/platform-koa": ["../../platform/platform-koa/src"] + "@tsed/openspec": ["../../specs/openspec/src/index.ts"], + "@tsed/schema": ["../../specs/schema/src/index.ts"], + "@tsed/di": ["../../di/src/index.ts"], + "@tsed/exceptions": ["../../specs/exceptions/src/index.ts"], + "@tsed/json-mapper": ["../../specs/json-mapper/src/index.ts"], + "@tsed/platform-exceptions": ["../../platform/platform-exceptions/src/index.ts"], + "@tsed/platform-middlewares": ["../../platform/platform-middlewares/src/index.ts"], + "@tsed/platform-params": ["../../platform/platform-params/src/index.ts"], + "@tsed/platform-log-middleware": ["../../platform/platform-log-middleware/src/index.ts"], + "@tsed/platform-response-filter": ["../../platform/platform-response-filter/src/index.ts"], + "@tsed/platform-router": ["../../platform/platform-router/src/index.ts"], + "@tsed/platform-views": ["../../platform/platform-views/src/index.ts"], + "@tsed/normalize-path": ["../../utils/normalize-path/src/index.ts"], + "@tsed/components-scan": ["../../third-parties/components-scan/src/index.ts"], + "@tsed/common": ["../../platform/common/src/index.ts"], + "@tsed/ajv": ["../../specs/ajv/src/index.ts"], + "@tsed/platform-cache": ["../../platform/platform-cache/src/index.ts"], + "@tsed/swagger": ["../../specs/swagger/src/index.ts"], + "@tsed/platform-test-sdk": ["../../platform/platform-test-sdk/src/index.ts"], + "@tsed/platform-express": ["../../platform/platform-express/src/index.ts"], + "@tsed/platform-koa": ["../../platform/platform-koa/src/index.ts"] }, "types": ["vite/client", "vitest/globals"] }, diff --git a/packages/orm/mongoose/package.json b/packages/orm/mongoose/package.json index cedbd29c566..f9103c26217 100644 --- a/packages/orm/mongoose/package.json +++ b/packages/orm/mongoose/package.json @@ -18,7 +18,7 @@ ".": { "types": "./lib/types/index.d.ts", "import": "./lib/esm/index.js", - "default": "./lib/cjs/index.js" + "default": "./lib/esm/index.js" } }, "scripts": { diff --git a/packages/orm/mongoose/src/MongooseModule.ts b/packages/orm/mongoose/src/MongooseModule.ts index 1b24e648c8a..225ff7c066b 100644 --- a/packages/orm/mongoose/src/MongooseModule.ts +++ b/packages/orm/mongoose/src/MongooseModule.ts @@ -1,5 +1,4 @@ -import {Configuration, OnInit} from "@tsed/di"; -import {Module, OnDestroy} from "@tsed/di"; +import {Configuration, Inject, Module, type OnDestroy, type OnInit} from "@tsed/di"; import {MONGOOSE_CONNECTIONS} from "./services/MongooseConnections.js"; import {MongooseService} from "./services/MongooseService.js"; @@ -12,7 +11,7 @@ import {MongooseService} from "./services/MongooseService.js"; }) export class MongooseModule implements OnDestroy, OnInit { constructor( - private mongooseService: MongooseService, + @Inject(MongooseService) private mongooseService: MongooseService, @Configuration() private settings: Configuration ) { // auto configure the cache manager when mongoose is used with @tsed/mongoose diff --git a/packages/orm/mongoose/src/decorators/dynamicRef.ts b/packages/orm/mongoose/src/decorators/dynamicRef.ts index d17ef72da45..695a7dd76b2 100644 --- a/packages/orm/mongoose/src/decorators/dynamicRef.ts +++ b/packages/orm/mongoose/src/decorators/dynamicRef.ts @@ -1,6 +1,8 @@ -import {classOf, isArrowFn, isString, StoreMerge, Type, useDecorators} from "@tsed/core"; +import type {Type} from "@tsed/core"; +import {classOf, isArrowFn, isString, StoreMerge, useDecorators} from "@tsed/core"; import {deserialize, OnDeserialize, OnSerialize, serialize} from "@tsed/json-mapper"; -import {Description, Example, JsonHookContext, OneOf, Property, string} from "@tsed/schema"; +import type {JsonHookContext} from "@tsed/schema"; +import {Description, Example, OneOf, Property, string} from "@tsed/schema"; import {Schema as MongooseSchema} from "mongoose"; import {MONGOOSE_SCHEMA} from "../constants/constants.js"; diff --git a/packages/orm/mongoose/src/decorators/indexed.ts b/packages/orm/mongoose/src/decorators/indexed.ts index 997d0d38e97..0188107b9ef 100644 --- a/packages/orm/mongoose/src/decorators/indexed.ts +++ b/packages/orm/mongoose/src/decorators/indexed.ts @@ -1,4 +1,4 @@ -import {IndexOptions} from "mongoose"; +import type {IndexOptions} from "mongoose"; import {MongooseSchema} from "./schema.js"; diff --git a/packages/orm/mongoose/src/decorators/model.ts b/packages/orm/mongoose/src/decorators/model.ts index b000d76e40a..443612ea03c 100644 --- a/packages/orm/mongoose/src/decorators/model.ts +++ b/packages/orm/mongoose/src/decorators/model.ts @@ -1,9 +1,9 @@ import {nameOf, useDecorators} from "@tsed/core"; import {registerProvider} from "@tsed/di"; import {DiscriminatorValue} from "@tsed/schema"; -import {Schema} from "mongoose"; +import type {Schema} from "mongoose"; -import {MongooseModelOptions} from "../interfaces/MongooseModelOptions.js"; +import type {MongooseModelOptions} from "../interfaces/MongooseModelOptions.js"; import {MONGOOSE_CONNECTIONS} from "../services/MongooseConnections.js"; import {createModel, getModelToken} from "../utils/createModel.js"; import {getSchema} from "../utils/createSchema.js"; diff --git a/packages/orm/mongoose/src/decorators/mongoosePlugin.ts b/packages/orm/mongoose/src/decorators/mongoosePlugin.ts index 849d69a6cc1..1751e98d511 100644 --- a/packages/orm/mongoose/src/decorators/mongoosePlugin.ts +++ b/packages/orm/mongoose/src/decorators/mongoosePlugin.ts @@ -1,4 +1,4 @@ -import mongoose from "mongoose"; +import type mongoose from "mongoose"; import {schemaOptions} from "../utils/schemaOptions.js"; diff --git a/packages/orm/mongoose/src/decorators/numberDecimal.spec.ts b/packages/orm/mongoose/src/decorators/numberDecimal.spec.ts index dd558e8755f..cbf1cf61f5f 100644 --- a/packages/orm/mongoose/src/decorators/numberDecimal.spec.ts +++ b/packages/orm/mongoose/src/decorators/numberDecimal.spec.ts @@ -4,7 +4,8 @@ import {getJsonSchema} from "@tsed/schema"; import {Schema, Types} from "mongoose"; import {MONGOOSE_SCHEMA} from "../constants/constants.js"; -import {Decimal128, DecimalFormat, NumberDecimal} from "./numberDecimal.js"; +import type {Decimal128} from "./numberDecimal.js"; +import {DecimalFormat, NumberDecimal} from "./numberDecimal.js"; describe("@NumberDecimal()", () => { it("should declare a Decimal128 field", () => { diff --git a/packages/orm/mongoose/src/decorators/numberDecimal.ts b/packages/orm/mongoose/src/decorators/numberDecimal.ts index 908d21daa7a..92262365048 100644 --- a/packages/orm/mongoose/src/decorators/numberDecimal.ts +++ b/packages/orm/mongoose/src/decorators/numberDecimal.ts @@ -1,8 +1,10 @@ -import {Formats, FormatsMethods} from "@tsed/ajv"; +import type {FormatsMethods} from "@tsed/ajv"; +import {Formats} from "@tsed/ajv"; import {isNumber, isString, StoreMerge, useDecorators} from "@tsed/core"; import {OnDeserialize, OnSerialize} from "@tsed/json-mapper"; import {Example, Format, Property} from "@tsed/schema"; -import {Schema as MongooseSchema, SchemaTypeOptions, Types} from "mongoose"; +import type {SchemaTypeOptions} from "mongoose"; +import {Schema as MongooseSchema, Types} from "mongoose"; import {MONGOOSE_SCHEMA} from "../constants/constants.js"; diff --git a/packages/orm/mongoose/src/decorators/postHook.ts b/packages/orm/mongoose/src/decorators/postHook.ts index 1e496b97e31..a32bcf441df 100644 --- a/packages/orm/mongoose/src/decorators/postHook.ts +++ b/packages/orm/mongoose/src/decorators/postHook.ts @@ -1,6 +1,7 @@ -import {decoratorTypeOf, DecoratorTypes, StaticMethodDecorator} from "@tsed/core"; +import type {StaticMethodDecorator} from "@tsed/core"; +import {decoratorTypeOf, DecoratorTypes} from "@tsed/core"; -import {MongooseHookOptions, MongoosePostHookCB} from "../interfaces/MongooseSchemaOptions.js"; +import type {MongooseHookOptions, MongoosePostHookCB} from "../interfaces/MongooseSchemaOptions.js"; import {schemaOptions} from "../utils/schemaOptions.js"; /** diff --git a/packages/orm/mongoose/src/decorators/preHook.spec.ts b/packages/orm/mongoose/src/decorators/preHook.spec.ts index 2e1399b2d33..91d8b632667 100644 --- a/packages/orm/mongoose/src/decorators/preHook.spec.ts +++ b/packages/orm/mongoose/src/decorators/preHook.spec.ts @@ -1,4 +1,5 @@ -import {MongooseNextCB, PreHook, schemaOptions} from "../../src/index.js"; +import type {MongooseNextCB} from "../../src/index.js"; +import {PreHook, schemaOptions} from "../../src/index.js"; describe("@PreHook()", () => { describe("when decorator is used as class decorator", () => { diff --git a/packages/orm/mongoose/src/decorators/preHook.ts b/packages/orm/mongoose/src/decorators/preHook.ts index f27323c2648..92956c0564e 100644 --- a/packages/orm/mongoose/src/decorators/preHook.ts +++ b/packages/orm/mongoose/src/decorators/preHook.ts @@ -1,6 +1,6 @@ import {decoratorTypeOf, DecoratorTypes} from "@tsed/core"; -import {MongooseHookOptions, MongoosePreHookCB} from "../interfaces/MongooseSchemaOptions.js"; +import type {MongooseHookOptions, MongoosePreHookCB} from "../interfaces/MongooseSchemaOptions.js"; import {schemaOptions} from "../utils/schemaOptions.js"; /** diff --git a/packages/orm/mongoose/src/decorators/ref.ts b/packages/orm/mongoose/src/decorators/ref.ts index c47a4395de7..eb1ca7d8c9c 100644 --- a/packages/orm/mongoose/src/decorators/ref.ts +++ b/packages/orm/mongoose/src/decorators/ref.ts @@ -1,4 +1,5 @@ -import {isArrowFn, isCollection, isObject, isObjectID, isString, StoreMerge, Type, useDecorators} from "@tsed/core"; +import type {Type} from "@tsed/core"; +import {isArrowFn, isCollection, isObject, isObjectID, isString, StoreMerge, useDecorators} from "@tsed/core"; import {deserialize, OnDeserialize, OnSerialize, serialize} from "@tsed/json-mapper"; import {ForwardGroups, JsonEntityFn, lazyRef, matchGroups, OneOf, Property, string} from "@tsed/schema"; import {Schema as MongooseSchema} from "mongoose"; diff --git a/packages/orm/mongoose/src/decorators/schema.ts b/packages/orm/mongoose/src/decorators/schema.ts index a405c1c596a..40015331a22 100644 --- a/packages/orm/mongoose/src/decorators/schema.ts +++ b/packages/orm/mongoose/src/decorators/schema.ts @@ -1,10 +1,10 @@ import {decoratorTypeOf, StoreMerge, useDecorators} from "@tsed/core"; import {registerProvider} from "@tsed/di"; import {Property} from "@tsed/schema"; -import {SchemaTypeOptions} from "mongoose"; +import type {SchemaTypeOptions} from "mongoose"; import {MONGOOSE_SCHEMA} from "../constants/constants.js"; -import {MongooseSchemaOptions} from "../interfaces/MongooseSchemaOptions.js"; +import type {MongooseSchemaOptions} from "../interfaces/MongooseSchemaOptions.js"; import {getSchema, getSchemaToken} from "../utils/createSchema.js"; /** diff --git a/packages/orm/mongoose/src/decorators/virtualRef.spec.ts b/packages/orm/mongoose/src/decorators/virtualRef.spec.ts index 14d9f7118d1..77daf5ba018 100644 --- a/packages/orm/mongoose/src/decorators/virtualRef.spec.ts +++ b/packages/orm/mongoose/src/decorators/virtualRef.spec.ts @@ -5,7 +5,7 @@ import {Format, getJsonSchema, getSpec, Post, Property, ReadOnly, Returns, SpecT import {MONGOOSE_SCHEMA} from "../constants/constants.js"; import {Model} from "./model.js"; -import {VirtualRef, VirtualRefs} from "./virtualRef.js"; +import {VirtualRef} from "./virtualRef.js"; describe("@VirtualRef()", () => { describe("when type and foreign value are given", () => { diff --git a/packages/orm/mongoose/src/decorators/virtualRef.ts b/packages/orm/mongoose/src/decorators/virtualRef.ts index f41246b7c51..54cd0d165ea 100644 --- a/packages/orm/mongoose/src/decorators/virtualRef.ts +++ b/packages/orm/mongoose/src/decorators/virtualRef.ts @@ -2,7 +2,7 @@ import {isPlainObject, isString, Store, StoreMerge, useDecorators} from "@tsed/c import {CollectionOf, Property} from "@tsed/schema"; import {MONGOOSE_MODEL_NAME, MONGOOSE_SCHEMA} from "../constants/constants.js"; -import {MongooseVirtualRefOptions} from "../interfaces/MongooseVirtualRefOptions.js"; +import type {MongooseVirtualRefOptions} from "../interfaces/MongooseVirtualRefOptions.js"; import {MongooseModels} from "../registries/MongooseModels.js"; function getRef(opts: any) { diff --git a/packages/orm/mongoose/src/interfaces/MongooseConnectionOptions.ts b/packages/orm/mongoose/src/interfaces/MongooseConnectionOptions.ts index 908c880c219..5c457bb3c71 100644 --- a/packages/orm/mongoose/src/interfaces/MongooseConnectionOptions.ts +++ b/packages/orm/mongoose/src/interfaces/MongooseConnectionOptions.ts @@ -1,4 +1,4 @@ -import {ConnectOptions} from "mongoose"; +import type {ConnectOptions} from "mongoose"; export interface MongooseConnectionOptions { url: string; diff --git a/packages/orm/mongoose/src/interfaces/MongooseDocument.ts b/packages/orm/mongoose/src/interfaces/MongooseDocument.ts index 3fbebcf1ed3..287640c75ef 100644 --- a/packages/orm/mongoose/src/interfaces/MongooseDocument.ts +++ b/packages/orm/mongoose/src/interfaces/MongooseDocument.ts @@ -1,3 +1,3 @@ -import {Document} from "mongoose"; +import type {Document} from "mongoose"; export type MongooseDocument = T & Document; diff --git a/packages/orm/mongoose/src/interfaces/MongooseModel.ts b/packages/orm/mongoose/src/interfaces/MongooseModel.ts index 984636afc0f..398e733608c 100644 --- a/packages/orm/mongoose/src/interfaces/MongooseModel.ts +++ b/packages/orm/mongoose/src/interfaces/MongooseModel.ts @@ -1,4 +1,4 @@ -import {Document, Model} from "mongoose"; +import type {Document, Model} from "mongoose"; // TODO since v5.11.5 Model require Document with id, See issue https://github.com/Automattic/mongoose/issues/9684 export type MongooseMergedDocument = {[K in keyof T]: T[K]}; diff --git a/packages/orm/mongoose/src/interfaces/MongooseModelOptions.ts b/packages/orm/mongoose/src/interfaces/MongooseModelOptions.ts index c5a6e1cb59f..9affba49fae 100644 --- a/packages/orm/mongoose/src/interfaces/MongooseModelOptions.ts +++ b/packages/orm/mongoose/src/interfaces/MongooseModelOptions.ts @@ -1,4 +1,4 @@ -import {MongooseSchemaOptions} from "./MongooseSchemaOptions.js"; +import type {MongooseSchemaOptions} from "./MongooseSchemaOptions.js"; export interface MongooseModelOptions extends MongooseSchemaOptions { name?: string; diff --git a/packages/orm/mongoose/src/interfaces/MongooseSchemaOptions.ts b/packages/orm/mongoose/src/interfaces/MongooseSchemaOptions.ts index 4da84387e44..aefd157f6da 100644 --- a/packages/orm/mongoose/src/interfaces/MongooseSchemaOptions.ts +++ b/packages/orm/mongoose/src/interfaces/MongooseSchemaOptions.ts @@ -1,6 +1,7 @@ -import {type IndexOptions, Schema, SchemaOptions} from "mongoose"; +import type {Schema, SchemaOptions} from "mongoose"; +import {type IndexOptions} from "mongoose"; -import {MongooseDocument} from "./MongooseDocument.js"; +import type {MongooseDocument} from "./MongooseDocument.js"; export type MongooseNextCB = (err?: Error) => void; diff --git a/packages/orm/mongoose/src/interfaces/MongooseVirtualRefOptions.ts b/packages/orm/mongoose/src/interfaces/MongooseVirtualRefOptions.ts index 5b488a18e0d..cd8d90f41df 100644 --- a/packages/orm/mongoose/src/interfaces/MongooseVirtualRefOptions.ts +++ b/packages/orm/mongoose/src/interfaces/MongooseVirtualRefOptions.ts @@ -1,4 +1,4 @@ -import {Type} from "@tsed/core"; +import type {Type} from "@tsed/core"; export interface MongooseVirtualRefOptions { ref?: string | Type | (() => Type); diff --git a/packages/orm/mongoose/src/interfaces/interfaces.ts b/packages/orm/mongoose/src/interfaces/interfaces.ts index 6bf93b516d0..d5de5ec5896 100644 --- a/packages/orm/mongoose/src/interfaces/interfaces.ts +++ b/packages/orm/mongoose/src/interfaces/interfaces.ts @@ -1,4 +1,4 @@ -import {MongooseConnectionOptions} from "./MongooseConnectionOptions.js"; +import type {MongooseConnectionOptions} from "./MongooseConnectionOptions.js"; declare global { namespace TsED { diff --git a/packages/orm/mongoose/src/registries/MongooseModels.ts b/packages/orm/mongoose/src/registries/MongooseModels.ts index fc72ed34d10..a27f9e89ac8 100644 --- a/packages/orm/mongoose/src/registries/MongooseModels.ts +++ b/packages/orm/mongoose/src/registries/MongooseModels.ts @@ -1,3 +1,3 @@ -import {Type} from "@tsed/core"; +import type {Type} from "@tsed/core"; export const MongooseModels: Map = new Map(); diff --git a/packages/orm/mongoose/src/services/MongooseConnections.ts b/packages/orm/mongoose/src/services/MongooseConnections.ts index 6db32f9e5e2..d0fd0539d33 100644 --- a/packages/orm/mongoose/src/services/MongooseConnections.ts +++ b/packages/orm/mongoose/src/services/MongooseConnections.ts @@ -1,7 +1,7 @@ import {isArray} from "@tsed/core"; import {Configuration, registerProvider} from "@tsed/di"; -import {MongooseConnectionOptions} from "../interfaces/MongooseConnectionOptions.js"; +import type {MongooseConnectionOptions} from "../interfaces/MongooseConnectionOptions.js"; import {MongooseService} from "../services/MongooseService.js"; /** diff --git a/packages/orm/mongoose/src/services/MongooseService.ts b/packages/orm/mongoose/src/services/MongooseService.ts index 1a0a24f68aa..c3d790d3a3b 100644 --- a/packages/orm/mongoose/src/services/MongooseService.ts +++ b/packages/orm/mongoose/src/services/MongooseService.ts @@ -1,7 +1,7 @@ import {Inject, Injectable} from "@tsed/di"; import {Logger} from "@tsed/logger"; +import type {ConnectOptions} from "mongoose"; import Mongoose from "mongoose"; -import {ConnectOptions} from "mongoose"; // istanbul ignore next function asPromise(c: any) { @@ -13,7 +13,7 @@ export class MongooseService { readonly connections: Map = new Map(); private defaultConnection: string = "default"; - @Inject() + @Inject(Logger) logger: Logger; /** diff --git a/packages/orm/mongoose/src/utils/createModel.ts b/packages/orm/mongoose/src/utils/createModel.ts index 4efc428365f..6f0391f6b4b 100644 --- a/packages/orm/mongoose/src/utils/createModel.ts +++ b/packages/orm/mongoose/src/utils/createModel.ts @@ -1,6 +1,8 @@ -import {nameOf, Store, Type} from "@tsed/core"; +import type {Type} from "@tsed/core"; +import {nameOf, Store} from "@tsed/core"; import {JsonEntityStore} from "@tsed/schema"; -import mongoose, {Connection} from "mongoose"; +import type {Connection} from "mongoose"; +import mongoose from "mongoose"; import {MONGOOSE_MODEL, MONGOOSE_MODEL_NAME} from "../constants/constants.js"; import {MongooseModels} from "../registries/MongooseModels.js"; diff --git a/packages/orm/mongoose/src/utils/createSchema.spec.ts b/packages/orm/mongoose/src/utils/createSchema.spec.ts index 4d6cb0ccd4b..c445287fb20 100644 --- a/packages/orm/mongoose/src/utils/createSchema.spec.ts +++ b/packages/orm/mongoose/src/utils/createSchema.spec.ts @@ -21,7 +21,8 @@ import {Ref} from "../decorators/ref.js"; import {Schema} from "../decorators/schema.js"; import {SchemaIgnore} from "../decorators/schemaIgnore.js"; import {VersionKey} from "../decorators/versionKey.js"; -import {VirtualRef, VirtualRefs} from "../decorators/virtualRef.js"; +import type {VirtualRefs} from "../decorators/virtualRef.js"; +import {VirtualRef} from "../decorators/virtualRef.js"; import {getSchema} from "./createSchema.js"; describe("createSchema", () => { diff --git a/packages/orm/mongoose/src/utils/createSchema.ts b/packages/orm/mongoose/src/utils/createSchema.ts index 790561e34eb..5050aa4dd20 100644 --- a/packages/orm/mongoose/src/utils/createSchema.ts +++ b/packages/orm/mongoose/src/utils/createSchema.ts @@ -1,12 +1,14 @@ -import {cleanObject, nameOf, Store, Type} from "@tsed/core"; +import type {Type} from "@tsed/core"; +import {cleanObject, nameOf, Store} from "@tsed/core"; import {deserialize, serialize} from "@tsed/json-mapper"; -import {getProperties, JsonEntityStore, JsonSchema} from "@tsed/schema"; +import {getProperties, JsonEntityStore} from "@tsed/schema"; import {pascalCase} from "change-case"; -import mongoose, {Schema, SchemaDefinition, SchemaOptions, SchemaTypeOptions} from "mongoose"; +import type {Schema, SchemaDefinition, SchemaOptions, SchemaTypeOptions} from "mongoose"; +import mongoose from "mongoose"; import {MONGOOSE_SCHEMA, MONGOOSE_SCHEMA_OPTIONS} from "../constants/constants.js"; -import {MongooseSchemaOptions} from "../interfaces/MongooseSchemaOptions.js"; -import {MongooseVirtualRefOptions} from "../interfaces/MongooseVirtualRefOptions.js"; +import type {MongooseSchemaOptions} from "../interfaces/MongooseSchemaOptions.js"; +import type {MongooseVirtualRefOptions} from "../interfaces/MongooseVirtualRefOptions.js"; import {resolveRefType} from "./resolveRefType.js"; import {schemaOptions} from "./schemaOptions.js"; diff --git a/packages/orm/mongoose/src/utils/resolveRefType.ts b/packages/orm/mongoose/src/utils/resolveRefType.ts index 4a789599949..a98c7332619 100644 --- a/packages/orm/mongoose/src/utils/resolveRefType.ts +++ b/packages/orm/mongoose/src/utils/resolveRefType.ts @@ -1,4 +1,5 @@ -import {isClass, isString, nameOf, Store, Type} from "@tsed/core"; +import type {Type} from "@tsed/core"; +import {isClass, isString, nameOf, Store} from "@tsed/core"; import {MONGOOSE_MODEL_NAME} from "../constants/constants.js"; diff --git a/packages/orm/mongoose/src/utils/schemaOptions.ts b/packages/orm/mongoose/src/utils/schemaOptions.ts index ddf3c61b34c..a9ba0895149 100644 --- a/packages/orm/mongoose/src/utils/schemaOptions.ts +++ b/packages/orm/mongoose/src/utils/schemaOptions.ts @@ -1,8 +1,8 @@ import {deepMerge, Store} from "@tsed/core"; -import {Schema} from "mongoose"; +import type {Schema} from "mongoose"; import {MONGOOSE_SCHEMA_OPTIONS} from "../constants/constants.js"; -import { +import type { MongooseHookPromised, MongooseNextCB, MongoosePostHook, diff --git a/packages/orm/mongoose/test/array.integration.spec.ts b/packages/orm/mongoose/test/array.integration.spec.ts index 5f4e3692a95..93758795e00 100644 --- a/packages/orm/mongoose/test/array.integration.spec.ts +++ b/packages/orm/mongoose/test/array.integration.spec.ts @@ -2,7 +2,8 @@ import {DITest} from "@tsed/di"; import {serialize} from "@tsed/json-mapper"; import {TestContainersMongo} from "@tsed/testcontainers-mongo"; -import {MyWorkspace, UserModel, UserWorkspace, Workspace, WorkspaceModel} from "./helpers/models/UserWorkspace.js"; +import type {UserModel, WorkspaceModel} from "./helpers/models/UserWorkspace.js"; +import {MyWorkspace, UserWorkspace, Workspace} from "./helpers/models/UserWorkspace.js"; describe("Mongoose", () => { describe("Array models", () => { diff --git a/packages/orm/mongoose/test/buffer.integration.spec.ts b/packages/orm/mongoose/test/buffer.integration.spec.ts index b27b9704876..f9835e7fa6a 100644 --- a/packages/orm/mongoose/test/buffer.integration.spec.ts +++ b/packages/orm/mongoose/test/buffer.integration.spec.ts @@ -3,7 +3,7 @@ import {PlatformTest} from "@tsed/common"; import {TestContainersMongo} from "@tsed/testcontainers-mongo"; import axios from "axios"; -import {MongooseModel} from "../src/interfaces/MongooseModel.js"; +import type {MongooseModel} from "../src/interfaces/MongooseModel.js"; import {TestAvatar} from "./helpers/models/Avatar.js"; describe("Mongoose", () => { diff --git a/packages/orm/mongoose/test/circularRef.integration.spec.ts b/packages/orm/mongoose/test/circularRef.integration.spec.ts index 4dbcba432f9..3ac2798ef34 100644 --- a/packages/orm/mongoose/test/circularRef.integration.spec.ts +++ b/packages/orm/mongoose/test/circularRef.integration.spec.ts @@ -3,7 +3,7 @@ import {Inject} from "@tsed/di"; import {getJsonSchema} from "@tsed/schema"; import {TestContainersMongo} from "@tsed/testcontainers-mongo"; -import {MongooseModel} from ".."; +import type {MongooseModel} from "../src/index.js"; import {TestContract} from "./helpers/models/Contract.js"; import {TestCustomer} from "./helpers/models/Customer.js"; import {SelfUser} from "./helpers/models/User.js"; diff --git a/packages/orm/mongoose/test/discriminators.integration.spec.ts b/packages/orm/mongoose/test/discriminators.integration.spec.ts index de7bd2c7120..4de2cfd483a 100644 --- a/packages/orm/mongoose/test/discriminators.integration.spec.ts +++ b/packages/orm/mongoose/test/discriminators.integration.spec.ts @@ -2,7 +2,8 @@ import {PlatformTest} from "@tsed/common"; import {DiscriminatorValue, Required} from "@tsed/schema"; import {TestContainersMongo} from "@tsed/testcontainers-mongo"; -import {DiscriminatorKey, Model, MongooseModel, ObjectID} from "../src/index.js"; +import type {MongooseModel} from "../src/index.js"; +import {DiscriminatorKey, Model, ObjectID} from "../src/index.js"; describe("Mongoose", () => { describe("Discriminators", () => { diff --git a/packages/orm/mongoose/test/dynamicRef.integration.spec.ts b/packages/orm/mongoose/test/dynamicRef.integration.spec.ts index 32cf193bf59..5c3659190a4 100644 --- a/packages/orm/mongoose/test/dynamicRef.integration.spec.ts +++ b/packages/orm/mongoose/test/dynamicRef.integration.spec.ts @@ -4,7 +4,8 @@ import {Enum, getJsonSchema, Required} from "@tsed/schema"; import {TestContainersMongo} from "@tsed/testcontainers-mongo"; import {Model} from "../src/decorators/model.js"; -import {DynamicRef, MongooseModel, ObjectID} from "../src/index.js"; +import type {MongooseModel} from "../src/index.js"; +import {DynamicRef, ObjectID} from "../src/index.js"; describe("DynamicRef Integration", () => { @Model() diff --git a/packages/orm/mongoose/test/helpers/Server.ts b/packages/orm/mongoose/test/helpers/Server.ts index 4b42258a53c..1aa96639602 100644 --- a/packages/orm/mongoose/test/helpers/Server.ts +++ b/packages/orm/mongoose/test/helpers/Server.ts @@ -1,7 +1,8 @@ -import "../.."; +import "../../src/index.js"; import "@tsed/platform-express"; -import {Configuration, Inject, PlatformApplication} from "@tsed/common"; +import {PlatformApplication} from "@tsed/common"; +import {Configuration, Inject} from "@tsed/di"; import bodyParser from "body-parser"; import compress from "compression"; import cookieParser from "cookie-parser"; @@ -20,7 +21,7 @@ const rootDir = import.meta.dirname; } }) export class Server { - @Inject() + @Inject(PlatformApplication) app: PlatformApplication; public $beforeRoutesInit(): void { diff --git a/packages/orm/mongoose/test/helpers/models/User.ts b/packages/orm/mongoose/test/helpers/models/User.ts index 5f9794209d4..2869ad90d6a 100644 --- a/packages/orm/mongoose/test/helpers/models/User.ts +++ b/packages/orm/mongoose/test/helpers/models/User.ts @@ -1,6 +1,7 @@ import {CollectionOf, Groups, Ignore, MinLength, Property, Required} from "@tsed/schema"; -import {Model, MongooseNextCB, ObjectID, PostHook, PreHook, Ref, Schema, Unique} from "../../.."; +import type {MongooseNextCB} from "../../.."; +import {Model, ObjectID, PostHook, PreHook, Ref, Schema, Unique} from "../../.."; export class BaseModel { @ObjectID("id") diff --git a/packages/orm/mongoose/test/helpers/models/UserWorkspace.ts b/packages/orm/mongoose/test/helpers/models/UserWorkspace.ts index 2b6b8aefdf7..84b57fe9ceb 100644 --- a/packages/orm/mongoose/test/helpers/models/UserWorkspace.ts +++ b/packages/orm/mongoose/test/helpers/models/UserWorkspace.ts @@ -1,7 +1,8 @@ import {CollectionOf, Property} from "@tsed/schema"; -import {Types} from "mongoose"; +import type {Types} from "mongoose"; -import {Model, MongooseModel, ObjectID, Ref, Schema} from "../../.."; +import type {MongooseModel} from "../../../src/index.js"; +import {Model, ObjectID, Ref, Schema} from "../../../src/index.js"; @Model() export class Workspace { diff --git a/packages/orm/mongoose/test/multipleConnection.integration.spec.ts b/packages/orm/mongoose/test/multipleConnection.integration.spec.ts index 4c6740fd868..070294539b4 100644 --- a/packages/orm/mongoose/test/multipleConnection.integration.spec.ts +++ b/packages/orm/mongoose/test/multipleConnection.integration.spec.ts @@ -1,8 +1,9 @@ import {PlatformTest} from "@tsed/common"; import {Property} from "@tsed/schema"; import {TestContainersMongo} from "@tsed/testcontainers-mongo"; +import {afterEach, beforeEach, describe, expect, it} from "vitest"; -import {Model, MongooseModel, MongooseService, ObjectID} from ".."; +import {Model, type MongooseModel, MongooseService, ObjectID} from "../src/index.js"; import {Server} from "./helpers/Server.js"; @Model({ diff --git a/packages/orm/mongoose/test/readonly.integration.spec.ts b/packages/orm/mongoose/test/readonly.integration.spec.ts index cbfa7a27152..6bf628c1d46 100644 --- a/packages/orm/mongoose/test/readonly.integration.spec.ts +++ b/packages/orm/mongoose/test/readonly.integration.spec.ts @@ -2,7 +2,8 @@ import {Inject, Injectable, PlatformTest} from "@tsed/common"; import {getJsonSchema, Groups, Name, Property, ReadOnly, Required} from "@tsed/schema"; import {TestContainersMongo} from "@tsed/testcontainers-mongo"; -import {Immutable, Model, MongooseModel, ObjectID, SchemaIgnore} from "../src/index.js"; +import type {MongooseModel} from "../src/index.js"; +import {Immutable, Model, ObjectID, SchemaIgnore} from "../src/index.js"; class BaseModel { @ObjectID("id") diff --git a/packages/orm/mongoose/test/ref-array.integration.spec.ts b/packages/orm/mongoose/test/ref-array.integration.spec.ts index 494eab5f801..64a0b111fbe 100644 --- a/packages/orm/mongoose/test/ref-array.integration.spec.ts +++ b/packages/orm/mongoose/test/ref-array.integration.spec.ts @@ -5,7 +5,7 @@ import {PlatformExpress} from "@tsed/platform-express"; import {TestContainersMongo} from "@tsed/testcontainers-mongo"; import SuperTest from "supertest"; -import {MongooseModel} from "../src/index.js"; +import type {MongooseModel} from "../src/index.js"; import {TestProfile2, TestUser} from "./helpers/models/User.js"; import {Server} from "./helpers/Server.js"; diff --git a/packages/orm/mongoose/test/ref.integration.spec.ts b/packages/orm/mongoose/test/ref.integration.spec.ts index f5529cbe7bd..b00dda59bde 100644 --- a/packages/orm/mongoose/test/ref.integration.spec.ts +++ b/packages/orm/mongoose/test/ref.integration.spec.ts @@ -5,7 +5,7 @@ import {PlatformExpress} from "@tsed/platform-express"; import {TestContainersMongo} from "@tsed/testcontainers-mongo"; import SuperTest from "supertest"; -import {MongooseModel} from ".."; +import type {MongooseModel} from ".."; import {TestProfile, TestUser} from "./helpers/models/User.js"; import {Server} from "./helpers/Server.js"; @@ -35,12 +35,12 @@ class ProfilesCtrl { const baseUser = { email: faker.internet.email(), - password: faker.internet.password(12) + password: faker.internet.password({length: 12}) }; const baseProfile = { image: faker.image.avatar(), - age: faker.datatype.number(2) + age: faker.number.int(2) }; async function getServiceFixture() { diff --git a/packages/orm/mongoose/test/resources.integration.spec.ts b/packages/orm/mongoose/test/resources.integration.spec.ts index ccb912d95ac..1c0ca73a781 100644 --- a/packages/orm/mongoose/test/resources.integration.spec.ts +++ b/packages/orm/mongoose/test/resources.integration.spec.ts @@ -8,7 +8,7 @@ import {TestContainersMongo} from "@tsed/testcontainers-mongo"; import SuperTest from "supertest"; import {describe, expect, it} from "vitest"; -import {MongooseModel} from ".."; +import type {MongooseModel} from ".."; import {TestRole, TestUser, TestUserNew} from "./helpers/models/User.js"; import {Server} from "./helpers/Server.js"; diff --git a/packages/orm/mongoose/test/user.integration.spec.ts b/packages/orm/mongoose/test/user.integration.spec.ts index d94cede2d95..7da5f406334 100644 --- a/packages/orm/mongoose/test/user.integration.spec.ts +++ b/packages/orm/mongoose/test/user.integration.spec.ts @@ -2,7 +2,7 @@ import {faker} from "@faker-js/faker"; import {PlatformTest} from "@tsed/common"; import {TestContainersMongo} from "@tsed/testcontainers-mongo"; -import {MongooseModel} from "../src/interfaces/MongooseModel.js"; +import type {MongooseModel} from "../src/interfaces/MongooseModel.js"; import {TestUser} from "./helpers/models/User.js"; describe("Mongoose", () => { diff --git a/packages/orm/mongoose/test/versioning.integration.spec.ts b/packages/orm/mongoose/test/versioning.integration.spec.ts index d5c0d02a939..3d232de8c88 100644 --- a/packages/orm/mongoose/test/versioning.integration.spec.ts +++ b/packages/orm/mongoose/test/versioning.integration.spec.ts @@ -4,7 +4,7 @@ import {Integer, Required} from "@tsed/schema"; import {TestContainersMongo} from "@tsed/testcontainers-mongo"; import {Model, ObjectID, VersionKey} from "../src/index.js"; -import {MongooseModel} from "../src/interfaces/MongooseModel.js"; +import type {MongooseModel} from "../src/interfaces/MongooseModel.js"; describe("Mongoose", () => { describe("Versioning", () => { diff --git a/packages/orm/mongoose/test/virtualRef.integration.spec.ts b/packages/orm/mongoose/test/virtualRef.integration.spec.ts index beff8f17931..0cc17bbcf4b 100644 --- a/packages/orm/mongoose/test/virtualRef.integration.spec.ts +++ b/packages/orm/mongoose/test/virtualRef.integration.spec.ts @@ -6,7 +6,8 @@ import {CollectionOf, getJsonSchema, Groups, Integer, Required} from "@tsed/sche import {TestContainersMongo} from "@tsed/testcontainers-mongo"; import SuperTest from "supertest"; -import {Model, MongooseModel, ObjectID, VirtualRef} from ".."; +import type {MongooseModel} from "../src/index.js"; +import {Model, ObjectID, VirtualRef} from "../src/index.js"; import {Server} from "./helpers/Server.js"; @Model() diff --git a/packages/orm/mongoose/tsconfig.esm.json b/packages/orm/mongoose/tsconfig.esm.json index 82292550ddb..8954049da4a 100644 --- a/packages/orm/mongoose/tsconfig.esm.json +++ b/packages/orm/mongoose/tsconfig.esm.json @@ -2,7 +2,6 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", diff --git a/packages/orm/mongoose/tsconfig.spec.json b/packages/orm/mongoose/tsconfig.spec.json index 2e917f4b39d..fdb41369c3a 100644 --- a/packages/orm/mongoose/tsconfig.spec.json +++ b/packages/orm/mongoose/tsconfig.spec.json @@ -3,31 +3,31 @@ "compilerOptions": { "baseUrl": ".", "rootDir": "../..", - "outDir": "./lib/cjs", "declaration": false, "composite": false, "noEmit": true, "paths": { - "@tsed/openspec": ["../../specs/openspec/src"], - "@tsed/schema": ["../../specs/schema/src"], - "@tsed/di": ["../../di/src"], - "@tsed/exceptions": ["../../specs/exceptions/src"], - "@tsed/json-mapper": ["../../specs/json-mapper/src"], - "@tsed/platform-exceptions": ["../../platform/platform-exceptions/src"], - "@tsed/platform-middlewares": ["../../platform/platform-middlewares/src"], - "@tsed/platform-params": ["../../platform/platform-params/src"], - "@tsed/platform-log-middleware": ["../../platform/platform-log-middleware/src"], - "@tsed/platform-response-filter": ["../../platform/platform-response-filter/src"], - "@tsed/platform-router": ["../../platform/platform-router/src"], - "@tsed/platform-views": ["../../platform/platform-views/src"], - "@tsed/components-scan": ["../../third-parties/components-scan/src"], - "@tsed/common": ["../../platform/common/src"], - "@tsed/ajv": ["../../specs/ajv/src"], - "@tsed/platform-cache": ["../../platform/platform-cache/src"], - "@tsed/swagger": ["../../specs/swagger/src"], - "@tsed/platform-test-sdk": ["../../platform/platform-test-sdk/src"], - "@tsed/platform-express": ["../../platform/platform-express/src"], - "@tsed/platform-koa": ["../../platform/platform-koa/src"] + "@tsed/openspec": ["../../specs/openspec/src/index.ts"], + "@tsed/schema": ["../../specs/schema/src/index.ts"], + "@tsed/di": ["../../di/src/index.ts"], + "@tsed/exceptions": ["../../specs/exceptions/src/index.ts"], + "@tsed/json-mapper": ["../../specs/json-mapper/src/index.ts"], + "@tsed/platform-exceptions": ["../../platform/platform-exceptions/src/index.ts"], + "@tsed/platform-middlewares": ["../../platform/platform-middlewares/src/index.ts"], + "@tsed/platform-params": ["../../platform/platform-params/src/index.ts"], + "@tsed/platform-log-middleware": ["../../platform/platform-log-middleware/src/index.ts"], + "@tsed/platform-response-filter": ["../../platform/platform-response-filter/src/index.ts"], + "@tsed/platform-router": ["../../platform/platform-router/src/index.ts"], + "@tsed/platform-views": ["../../platform/platform-views/src/index.ts"], + "@tsed/normalize-path": ["../../utils/normalize-path/src/index.ts"], + "@tsed/components-scan": ["../../third-parties/components-scan/src/index.ts"], + "@tsed/common": ["../../platform/common/src/index.ts"], + "@tsed/ajv": ["../../specs/ajv/src/index.ts"], + "@tsed/platform-cache": ["../../platform/platform-cache/src/index.ts"], + "@tsed/swagger": ["../../specs/swagger/src/index.ts"], + "@tsed/platform-test-sdk": ["../../platform/platform-test-sdk/src/index.ts"], + "@tsed/platform-express": ["../../platform/platform-express/src/index.ts"], + "@tsed/platform-koa": ["../../platform/platform-koa/src/index.ts"] }, "types": ["vite/client", "vitest/globals"] }, diff --git a/packages/orm/mongoose/vitest.config.mts b/packages/orm/mongoose/vitest.config.mts index 0998ae90609..7043b1b2b30 100644 --- a/packages/orm/mongoose/vitest.config.mts +++ b/packages/orm/mongoose/vitest.config.mts @@ -12,10 +12,10 @@ export default defineConfig( coverage: { ...presets.test.coverage, thresholds: { - statements: 98.03, - branches: 95, + statements: 96.29, + branches: 93.72, functions: 100, - lines: 98.03 + lines: 96.29 } } } diff --git a/packages/orm/objection/package.json b/packages/orm/objection/package.json index 70744008790..407bc1d1447 100644 --- a/packages/orm/objection/package.json +++ b/packages/orm/objection/package.json @@ -11,7 +11,7 @@ ".": { "types": "./lib/types/index.d.ts", "import": "./lib/esm/index.js", - "default": "./lib/cjs/index.js" + "default": "./lib/esm/index.js" } }, "scripts": { diff --git a/packages/orm/objection/src/components/createBooleanColumn.ts b/packages/orm/objection/src/components/createBooleanColumn.ts index c0c413fb61d..8823b65c62d 100644 --- a/packages/orm/objection/src/components/createBooleanColumn.ts +++ b/packages/orm/objection/src/components/createBooleanColumn.ts @@ -1,7 +1,7 @@ import type {Knex} from "knex"; import {ColumnTypesContainer} from "../services/ColumnTypesContainer.js"; -import {ColumnCtx} from "../utils/getColumnCtx.js"; +import type {ColumnCtx} from "../utils/getColumnCtx.js"; /** * @ignore */ diff --git a/packages/orm/objection/src/components/createIdColumn.ts b/packages/orm/objection/src/components/createIdColumn.ts index 58a14c0956d..c9174605cd2 100644 --- a/packages/orm/objection/src/components/createIdColumn.ts +++ b/packages/orm/objection/src/components/createIdColumn.ts @@ -2,7 +2,7 @@ import {randomUUID} from "crypto"; import type {Knex} from "knex"; import {ColumnTypesContainer} from "../services/ColumnTypesContainer.js"; -import {ColumnCtx} from "../utils/getColumnCtx.js"; +import type {ColumnCtx} from "../utils/getColumnCtx.js"; /** * @ignore diff --git a/packages/orm/objection/src/components/createNumberColumn.ts b/packages/orm/objection/src/components/createNumberColumn.ts index 1d6b535b046..68a43e84c61 100644 --- a/packages/orm/objection/src/components/createNumberColumn.ts +++ b/packages/orm/objection/src/components/createNumberColumn.ts @@ -1,7 +1,7 @@ import type {Knex} from "knex"; import {ColumnTypesContainer} from "../services/ColumnTypesContainer.js"; -import {ColumnCtx} from "../utils/getColumnCtx.js"; +import type {ColumnCtx} from "../utils/getColumnCtx.js"; /** * @ignore diff --git a/packages/orm/objection/src/components/createStringColumn.ts b/packages/orm/objection/src/components/createStringColumn.ts index 19726bc4135..c90ab8af164 100644 --- a/packages/orm/objection/src/components/createStringColumn.ts +++ b/packages/orm/objection/src/components/createStringColumn.ts @@ -1,7 +1,7 @@ import type {Knex} from "knex"; import {ColumnTypesContainer} from "../services/ColumnTypesContainer.js"; -import {ColumnCtx} from "../utils/getColumnCtx.js"; +import type {ColumnCtx} from "../utils/getColumnCtx.js"; /** * @ignore diff --git a/packages/orm/objection/src/decorators/belongsToOne.ts b/packages/orm/objection/src/decorators/belongsToOne.ts index 6bad782bc87..b8d4f54f624 100644 --- a/packages/orm/objection/src/decorators/belongsToOne.ts +++ b/packages/orm/objection/src/decorators/belongsToOne.ts @@ -1,6 +1,6 @@ import {Model} from "objection"; -import {RelationshipOptsWithoutThrough} from "../domain/RelationshipOpts.js"; +import type {RelationshipOptsWithoutThrough} from "../domain/RelationshipOpts.js"; import {RelatesTo} from "./relatesTo.js"; /** diff --git a/packages/orm/objection/src/decorators/entity.ts b/packages/orm/objection/src/decorators/entity.ts index 42627bdf358..afde953fb5e 100644 --- a/packages/orm/objection/src/decorators/entity.ts +++ b/packages/orm/objection/src/decorators/entity.ts @@ -1,4 +1,4 @@ -import {Type} from "@tsed/core"; +import type {Type} from "@tsed/core"; import {getJsonSchema} from "@tsed/schema"; import {defineStaticGetter} from "../utils/defineStaticGetter.js"; diff --git a/packages/orm/objection/src/decorators/hasMany.ts b/packages/orm/objection/src/decorators/hasMany.ts index 6425b56eabf..dacd2c63aad 100644 --- a/packages/orm/objection/src/decorators/hasMany.ts +++ b/packages/orm/objection/src/decorators/hasMany.ts @@ -1,6 +1,7 @@ -import {Model, ModelClassSpecifier} from "objection"; +import type {ModelClassSpecifier} from "objection"; +import {Model} from "objection"; -import {RelationshipOptsWithThrough} from "../domain/RelationshipOpts.js"; +import type {RelationshipOptsWithThrough} from "../domain/RelationshipOpts.js"; import {RelatesTo} from "./relatesTo.js"; /** diff --git a/packages/orm/objection/src/decorators/hasOne.ts b/packages/orm/objection/src/decorators/hasOne.ts index 1c7283f720c..2f415919f68 100644 --- a/packages/orm/objection/src/decorators/hasOne.ts +++ b/packages/orm/objection/src/decorators/hasOne.ts @@ -1,6 +1,6 @@ import {Model} from "objection"; -import {RelationshipOptsWithoutThrough} from "../domain/RelationshipOpts.js"; +import type {RelationshipOptsWithoutThrough} from "../domain/RelationshipOpts.js"; import {RelatesTo} from "./relatesTo.js"; /** diff --git a/packages/orm/objection/src/decorators/hasOneThroughRelation.ts b/packages/orm/objection/src/decorators/hasOneThroughRelation.ts index 399464f987b..2853bf4a4be 100644 --- a/packages/orm/objection/src/decorators/hasOneThroughRelation.ts +++ b/packages/orm/objection/src/decorators/hasOneThroughRelation.ts @@ -1,6 +1,6 @@ import {Model} from "objection"; -import {RelationshipOptsWithoutThrough, RelationshipOptsWithThrough} from "../domain/RelationshipOpts.js"; +import type {RelationshipOptsWithThrough} from "../domain/RelationshipOpts.js"; import {RelatesTo} from "./relatesTo.js"; /** diff --git a/packages/orm/objection/src/decorators/manyToMany.ts b/packages/orm/objection/src/decorators/manyToMany.ts index ad8dc62011f..0b0bbe95a21 100644 --- a/packages/orm/objection/src/decorators/manyToMany.ts +++ b/packages/orm/objection/src/decorators/manyToMany.ts @@ -1,6 +1,7 @@ -import {Model, ModelClassSpecifier} from "objection"; +import type {ModelClassSpecifier} from "objection"; +import {Model} from "objection"; -import {RelationshipOptsWithThrough} from "../domain/RelationshipOpts.js"; +import type {RelationshipOptsWithThrough} from "../domain/RelationshipOpts.js"; import {RelatesTo} from "./relatesTo.js"; /** diff --git a/packages/orm/objection/src/decorators/relatesTo.ts b/packages/orm/objection/src/decorators/relatesTo.ts index 677beebd83b..2d03cfeac4f 100644 --- a/packages/orm/objection/src/decorators/relatesTo.ts +++ b/packages/orm/objection/src/decorators/relatesTo.ts @@ -1,8 +1,9 @@ import {StoreFn, useDecorators} from "@tsed/core"; import {CollectionOf, Property} from "@tsed/schema"; -import {RelationType} from "objection"; +import type {RelationType} from "objection"; -import {isModelClassFactory, RelationshipOpts} from "../domain/RelationshipOpts.js"; +import type {RelationshipOpts} from "../domain/RelationshipOpts.js"; +import {isModelClassFactory} from "../domain/RelationshipOpts.js"; import {createRelationshipMapping} from "../utils/createRelationshipMapping.js"; import {OBJECTION_RELATIONSHIP_KEY} from "../utils/getJsonEntityRelationships.js"; diff --git a/packages/orm/objection/src/domain/RelationshipOpts.ts b/packages/orm/objection/src/domain/RelationshipOpts.ts index 9a24cb85954..c34ea3941a6 100644 --- a/packages/orm/objection/src/domain/RelationshipOpts.ts +++ b/packages/orm/objection/src/domain/RelationshipOpts.ts @@ -1,5 +1,5 @@ import {isFunction, isString} from "@tsed/core"; -import {ModelClassFactory, ModelClassSpecifier, RelationJoin, RelationMapping} from "objection"; +import type {ModelClassFactory, ModelClassSpecifier, RelationJoin, RelationMapping} from "objection"; export type RelationshipOptsWithThrough = Partial & Omit, "relation" | "join" | "modelClass">; diff --git a/packages/orm/objection/src/domain/interfaces.ts b/packages/orm/objection/src/domain/interfaces.ts index ac5a17157f4..6f9e57ed4b7 100644 --- a/packages/orm/objection/src/domain/interfaces.ts +++ b/packages/orm/objection/src/domain/interfaces.ts @@ -1,4 +1,4 @@ -import {Knex} from "knex"; +import type {Knex} from "knex"; declare global { namespace TsED { diff --git a/packages/orm/objection/src/services/ColumnTypesContainer.ts b/packages/orm/objection/src/services/ColumnTypesContainer.ts index 93c05d44a98..de8f8b26dfb 100644 --- a/packages/orm/objection/src/services/ColumnTypesContainer.ts +++ b/packages/orm/objection/src/services/ColumnTypesContainer.ts @@ -1,6 +1,6 @@ import type {Knex} from "knex"; -import {ColumnCtx} from "../utils/getColumnCtx.js"; +import type {ColumnCtx} from "../utils/getColumnCtx.js"; /** * @ignore diff --git a/packages/orm/objection/src/utils/connect.ts b/packages/orm/objection/src/utils/connect.ts index 578026d18a7..8f85b5a21ef 100644 --- a/packages/orm/objection/src/utils/connect.ts +++ b/packages/orm/objection/src/utils/connect.ts @@ -1,4 +1,5 @@ -import knex, {Knex} from "knex"; +import type {Knex} from "knex"; +import knex from "knex"; import {Model} from "objection"; export function createConnection(connectionOptions: Knex.Config): Knex { diff --git a/packages/orm/objection/src/utils/createColumns.ts b/packages/orm/objection/src/utils/createColumns.ts index 1a51990f5ca..7f6c8fe6fd1 100644 --- a/packages/orm/objection/src/utils/createColumns.ts +++ b/packages/orm/objection/src/utils/createColumns.ts @@ -3,8 +3,9 @@ import "../components/createIdColumn.js"; import "../components/createNumberColumn.js"; import "../components/createStringColumn.js"; -import {getProperties, JsonEntityStore} from "@tsed/schema"; -import {Knex} from "knex"; +import type {JsonEntityStore} from "@tsed/schema"; +import {getProperties} from "@tsed/schema"; +import type {Knex} from "knex"; import {ColumnTypesContainer} from "../services/ColumnTypesContainer.js"; import {getColumnCtx} from "./getColumnCtx.js"; diff --git a/packages/orm/objection/src/utils/createJoinKeys.ts b/packages/orm/objection/src/utils/createJoinKeys.ts index 04a4c2b0d97..45d45ef291e 100644 --- a/packages/orm/objection/src/utils/createJoinKeys.ts +++ b/packages/orm/objection/src/utils/createJoinKeys.ts @@ -1,7 +1,9 @@ import {Metadata} from "@tsed/core"; -import {Model, RelationType} from "objection"; +import type {RelationType} from "objection"; +import {Model} from "objection"; -import {isRelationshipOptsWithThrough, RelationshipOpts} from "../domain/RelationshipOpts.js"; +import type {RelationshipOpts} from "../domain/RelationshipOpts.js"; +import {isRelationshipOptsWithThrough} from "../domain/RelationshipOpts.js"; /** * @ignore diff --git a/packages/orm/objection/src/utils/createRelationshipMapping.ts b/packages/orm/objection/src/utils/createRelationshipMapping.ts index 09e0d9da3c5..363b4b8119c 100644 --- a/packages/orm/objection/src/utils/createRelationshipMapping.ts +++ b/packages/orm/objection/src/utils/createRelationshipMapping.ts @@ -1,7 +1,8 @@ -import {DecoratorParameters, getClass, Metadata} from "@tsed/core"; -import {RelationType} from "objection"; +import type {DecoratorParameters} from "@tsed/core"; +import {getClass, Metadata} from "@tsed/core"; +import type {RelationType} from "objection"; -import {RelationshipOpts} from "../domain/RelationshipOpts.js"; +import type {RelationshipOpts} from "../domain/RelationshipOpts.js"; import {createJoinKeys} from "./createJoinKeys.js"; /** diff --git a/packages/orm/objection/src/utils/getColumnCtx.ts b/packages/orm/objection/src/utils/getColumnCtx.ts index 186fa266eac..e4044fb68c0 100644 --- a/packages/orm/objection/src/utils/getColumnCtx.ts +++ b/packages/orm/objection/src/utils/getColumnCtx.ts @@ -1,6 +1,6 @@ -import {JsonEntityStore} from "@tsed/schema"; +import type {JsonEntityStore} from "@tsed/schema"; -import {ColumnOpts} from "../domain/ColumnOpts.js"; +import type {ColumnOpts} from "../domain/ColumnOpts.js"; /** * @ignore diff --git a/packages/orm/objection/test/helpers/Server.ts b/packages/orm/objection/test/helpers/Server.ts index bcb391b9741..09518c71a94 100644 --- a/packages/orm/objection/test/helpers/Server.ts +++ b/packages/orm/objection/test/helpers/Server.ts @@ -1,7 +1,8 @@ import "../.."; import "@tsed/platform-express"; -import {Configuration, Inject, PlatformApplication} from "@tsed/common"; +import type {PlatformApplication} from "@tsed/common"; +import {Configuration, Inject} from "@tsed/common"; import bodyParser from "body-parser"; import compress from "compression"; import cookieParser from "cookie-parser"; diff --git a/packages/orm/objection/test/helpers/knex/table.ts b/packages/orm/objection/test/helpers/knex/table.ts index 94a35683411..73f2ed862f8 100644 --- a/packages/orm/objection/test/helpers/knex/table.ts +++ b/packages/orm/objection/test/helpers/knex/table.ts @@ -1,4 +1,4 @@ -import {Knex} from "knex"; +import type {Knex} from "knex"; export function createTableStub() { return { diff --git a/packages/orm/objection/test/helpers/seeds/01_users.ts b/packages/orm/objection/test/helpers/seeds/01_users.ts index 0f710bb2500..de66f996123 100644 --- a/packages/orm/objection/test/helpers/seeds/01_users.ts +++ b/packages/orm/objection/test/helpers/seeds/01_users.ts @@ -1,4 +1,4 @@ -import {Knex} from "knex"; +import type {Knex} from "knex"; export function seed(knex: Knex): Promise { const userData = [ diff --git a/packages/orm/objection/test/integration.spec.ts b/packages/orm/objection/test/integration.spec.ts index 839cda61130..7cfffa82a77 100644 --- a/packages/orm/objection/test/integration.spec.ts +++ b/packages/orm/objection/test/integration.spec.ts @@ -1,6 +1,6 @@ import {PlatformTest} from "@tsed/common"; import {serialize} from "@tsed/json-mapper"; -import {Knex} from "knex"; +import type {Knex} from "knex"; import {afterAll, beforeAll, beforeEach, describe, expect, it} from "vitest"; import {OBJECTION_CONNECTION} from ".."; diff --git a/packages/orm/objection/tsconfig.esm.json b/packages/orm/objection/tsconfig.esm.json index 82292550ddb..8954049da4a 100644 --- a/packages/orm/objection/tsconfig.esm.json +++ b/packages/orm/objection/tsconfig.esm.json @@ -2,7 +2,6 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", diff --git a/packages/orm/objection/tsconfig.spec.json b/packages/orm/objection/tsconfig.spec.json index 2e917f4b39d..fdb41369c3a 100644 --- a/packages/orm/objection/tsconfig.spec.json +++ b/packages/orm/objection/tsconfig.spec.json @@ -3,31 +3,31 @@ "compilerOptions": { "baseUrl": ".", "rootDir": "../..", - "outDir": "./lib/cjs", "declaration": false, "composite": false, "noEmit": true, "paths": { - "@tsed/openspec": ["../../specs/openspec/src"], - "@tsed/schema": ["../../specs/schema/src"], - "@tsed/di": ["../../di/src"], - "@tsed/exceptions": ["../../specs/exceptions/src"], - "@tsed/json-mapper": ["../../specs/json-mapper/src"], - "@tsed/platform-exceptions": ["../../platform/platform-exceptions/src"], - "@tsed/platform-middlewares": ["../../platform/platform-middlewares/src"], - "@tsed/platform-params": ["../../platform/platform-params/src"], - "@tsed/platform-log-middleware": ["../../platform/platform-log-middleware/src"], - "@tsed/platform-response-filter": ["../../platform/platform-response-filter/src"], - "@tsed/platform-router": ["../../platform/platform-router/src"], - "@tsed/platform-views": ["../../platform/platform-views/src"], - "@tsed/components-scan": ["../../third-parties/components-scan/src"], - "@tsed/common": ["../../platform/common/src"], - "@tsed/ajv": ["../../specs/ajv/src"], - "@tsed/platform-cache": ["../../platform/platform-cache/src"], - "@tsed/swagger": ["../../specs/swagger/src"], - "@tsed/platform-test-sdk": ["../../platform/platform-test-sdk/src"], - "@tsed/platform-express": ["../../platform/platform-express/src"], - "@tsed/platform-koa": ["../../platform/platform-koa/src"] + "@tsed/openspec": ["../../specs/openspec/src/index.ts"], + "@tsed/schema": ["../../specs/schema/src/index.ts"], + "@tsed/di": ["../../di/src/index.ts"], + "@tsed/exceptions": ["../../specs/exceptions/src/index.ts"], + "@tsed/json-mapper": ["../../specs/json-mapper/src/index.ts"], + "@tsed/platform-exceptions": ["../../platform/platform-exceptions/src/index.ts"], + "@tsed/platform-middlewares": ["../../platform/platform-middlewares/src/index.ts"], + "@tsed/platform-params": ["../../platform/platform-params/src/index.ts"], + "@tsed/platform-log-middleware": ["../../platform/platform-log-middleware/src/index.ts"], + "@tsed/platform-response-filter": ["../../platform/platform-response-filter/src/index.ts"], + "@tsed/platform-router": ["../../platform/platform-router/src/index.ts"], + "@tsed/platform-views": ["../../platform/platform-views/src/index.ts"], + "@tsed/normalize-path": ["../../utils/normalize-path/src/index.ts"], + "@tsed/components-scan": ["../../third-parties/components-scan/src/index.ts"], + "@tsed/common": ["../../platform/common/src/index.ts"], + "@tsed/ajv": ["../../specs/ajv/src/index.ts"], + "@tsed/platform-cache": ["../../platform/platform-cache/src/index.ts"], + "@tsed/swagger": ["../../specs/swagger/src/index.ts"], + "@tsed/platform-test-sdk": ["../../platform/platform-test-sdk/src/index.ts"], + "@tsed/platform-express": ["../../platform/platform-express/src/index.ts"], + "@tsed/platform-koa": ["../../platform/platform-koa/src/index.ts"] }, "types": ["vite/client", "vitest/globals"] }, diff --git a/packages/orm/prisma/package.json b/packages/orm/prisma/package.json index 9cff8063921..42ced8d8840 100644 --- a/packages/orm/prisma/package.json +++ b/packages/orm/prisma/package.json @@ -11,7 +11,7 @@ ".": { "types": "./lib/types/index.d.ts", "import": "./lib/esm/index.js", - "default": "./lib/cjs/index.js" + "default": "./lib/esm/index.js" } }, "bin": { @@ -20,7 +20,7 @@ }, "scripts": { "prebuild": "cd ../../core && yarn build", - "build": "rm -rf lib && yarn build:ts && monorepo build-hybrid", + "build": "rm -rf lib tsconfig.spec.buildinfo && yarn build:ts && monorepo build-hybrid", "build:ts": "tsc --build tsconfig.json", "test": "vitest run", "generate:postgres": "yarn build && cd test/postgres && prisma -v && prisma generate", diff --git a/packages/orm/prisma/src/__mock__/createContextFixture.ts b/packages/orm/prisma/src/__mock__/createContextFixture.ts index 23c3413387c..72d54710bbb 100644 --- a/packages/orm/prisma/src/__mock__/createContextFixture.ts +++ b/packages/orm/prisma/src/__mock__/createContextFixture.ts @@ -1,4 +1,4 @@ -import {TransformContext} from "../generator/domain/TransformContext.js"; +import type {TransformContext} from "../generator/domain/TransformContext.js"; export function createContextFixture(): TransformContext { return { diff --git a/packages/orm/prisma/src/cli/prismaGenerator.ts b/packages/orm/prisma/src/cli/prismaGenerator.ts index adc0bbc79df..d072c30b21f 100644 --- a/packages/orm/prisma/src/cli/prismaGenerator.ts +++ b/packages/orm/prisma/src/cli/prismaGenerator.ts @@ -1,4 +1,4 @@ -import {GeneratorOptions} from "@prisma/generator-helper"; +import type {GeneratorOptions} from "@prisma/generator-helper"; import {parseEnvValue} from "@prisma/internals"; import fs from "fs-extra"; import path, {join} from "path"; diff --git a/packages/orm/prisma/src/generator/domain/DmmfEnum.ts b/packages/orm/prisma/src/generator/domain/DmmfEnum.ts index ede80fe79c1..4846ec1154f 100644 --- a/packages/orm/prisma/src/generator/domain/DmmfEnum.ts +++ b/packages/orm/prisma/src/generator/domain/DmmfEnum.ts @@ -1,5 +1,6 @@ -import {DMMF} from "@prisma/generator-helper"; -import {ImportDeclarationStructure, StructureKind} from "ts-morph"; +import type {DMMF} from "@prisma/generator-helper"; +import type {ImportDeclarationStructure} from "ts-morph"; +import {StructureKind} from "ts-morph"; export class DmmfEnum { readonly model: DMMF.DatamodelEnum; diff --git a/packages/orm/prisma/src/generator/domain/DmmfField.ts b/packages/orm/prisma/src/generator/domain/DmmfField.ts index 570064c87f9..a51aece2375 100644 --- a/packages/orm/prisma/src/generator/domain/DmmfField.ts +++ b/packages/orm/prisma/src/generator/domain/DmmfField.ts @@ -1,4 +1,4 @@ -import {DMMF} from "@prisma/generator-helper"; +import type {DMMF} from "@prisma/generator-helper"; import {parseDocumentationAttributes} from "../utils/parseDocumentationAttributes.js"; import type {DmmfModel} from "./DmmfModel.js"; diff --git a/packages/orm/prisma/src/generator/domain/DmmfModel.ts b/packages/orm/prisma/src/generator/domain/DmmfModel.ts index 7c133789336..147e23d05eb 100644 --- a/packages/orm/prisma/src/generator/domain/DmmfModel.ts +++ b/packages/orm/prisma/src/generator/domain/DmmfModel.ts @@ -1,7 +1,8 @@ -import {DMMF} from "@prisma/generator-helper"; +import type {DMMF} from "@prisma/generator-helper"; import {toMap} from "@tsed/core"; import {pascalCase} from "change-case"; -import {ImportDeclarationStructure, StructureKind} from "ts-morph"; +import type {ImportDeclarationStructure} from "ts-morph"; +import {StructureKind} from "ts-morph"; import {resolveExtension} from "../utils/resolveExtension.js"; import {DmmfField} from "./DmmfField.js"; diff --git a/packages/orm/prisma/src/generator/domain/ScalarTsTypes.ts b/packages/orm/prisma/src/generator/domain/ScalarTsTypes.ts index ebb8d68ba02..d623f05b76c 100644 --- a/packages/orm/prisma/src/generator/domain/ScalarTsTypes.ts +++ b/packages/orm/prisma/src/generator/domain/ScalarTsTypes.ts @@ -1,4 +1,5 @@ -import {DecoratorStructure, StructureKind} from "ts-morph"; +import type {DecoratorStructure} from "ts-morph"; +import {StructureKind} from "ts-morph"; export enum PrismaScalars { String = "String", diff --git a/packages/orm/prisma/src/generator/domain/TransformContext.ts b/packages/orm/prisma/src/generator/domain/TransformContext.ts index c4625ddfe06..78889cc826f 100644 --- a/packages/orm/prisma/src/generator/domain/TransformContext.ts +++ b/packages/orm/prisma/src/generator/domain/TransformContext.ts @@ -1,4 +1,4 @@ -import {DMMF} from "@prisma/generator-helper"; +import type {DMMF} from "@prisma/generator-helper"; import {SourceFile} from "ts-morph"; export interface TransformContext { diff --git a/packages/orm/prisma/src/generator/generateCode.ts b/packages/orm/prisma/src/generator/generateCode.ts index b6d68571afe..2dd83d45e29 100644 --- a/packages/orm/prisma/src/generator/generateCode.ts +++ b/packages/orm/prisma/src/generator/generateCode.ts @@ -1,5 +1,6 @@ -import {DMMF} from "@prisma/generator-helper"; -import {CompilerOptions, ModuleKind, Project, ScriptTarget} from "ts-morph"; +import type {DMMF} from "@prisma/generator-helper"; +import type {CompilerOptions} from "ts-morph"; +import {ModuleKind, Project, ScriptTarget} from "ts-morph"; import {generateClientIndex} from "./utils/generateClientIndex.js"; import {generateEnums} from "./utils/generateEnums.js"; diff --git a/packages/orm/prisma/src/generator/transform/transformEnumsToEnums.ts b/packages/orm/prisma/src/generator/transform/transformEnumsToEnums.ts index 4ff82ff2130..1a2ec4f3e6e 100644 --- a/packages/orm/prisma/src/generator/transform/transformEnumsToEnums.ts +++ b/packages/orm/prisma/src/generator/transform/transformEnumsToEnums.ts @@ -1,6 +1,7 @@ -import {EnumMemberStructure, OptionalKind, StatementStructures, StructureKind} from "ts-morph"; +import type {EnumMemberStructure, OptionalKind, StatementStructures} from "ts-morph"; +import {StructureKind} from "ts-morph"; -import {DmmfEnum} from "../domain/DmmfEnum.js"; +import type {DmmfEnum} from "../domain/DmmfEnum.js"; export function transformEnumsToEnums(enumModel: DmmfEnum): StatementStructures { const members: OptionalKind[] = enumModel.values.map((value) => { diff --git a/packages/orm/prisma/src/generator/transform/transformFieldToDecorators.ts b/packages/orm/prisma/src/generator/transform/transformFieldToDecorators.ts index 77007a9c4c7..d238164f68a 100644 --- a/packages/orm/prisma/src/generator/transform/transformFieldToDecorators.ts +++ b/packages/orm/prisma/src/generator/transform/transformFieldToDecorators.ts @@ -1,9 +1,10 @@ -import {DecoratorStructure, StructureKind} from "ts-morph"; +import type {DecoratorStructure} from "ts-morph"; +import {StructureKind} from "ts-morph"; -import {DmmfField} from "../domain/DmmfField.js"; +import type {DmmfField} from "../domain/DmmfField.js"; import {DmmfModel} from "../domain/DmmfModel.js"; import {ScalarDecorators, ScalarJsClasses} from "../domain/ScalarTsTypes.js"; -import {TransformContext} from "../domain/TransformContext.js"; +import type {TransformContext} from "../domain/TransformContext.js"; import {isCircularRef} from "../utils/isCircularRef.js"; function createDecorator(name: string, args: string[]): DecoratorStructure { diff --git a/packages/orm/prisma/src/generator/transform/transformFieldToProperty.ts b/packages/orm/prisma/src/generator/transform/transformFieldToProperty.ts index 4de75faac9f..a814b4858d4 100644 --- a/packages/orm/prisma/src/generator/transform/transformFieldToProperty.ts +++ b/packages/orm/prisma/src/generator/transform/transformFieldToProperty.ts @@ -1,7 +1,8 @@ -import {PropertyDeclarationStructure, StructureKind} from "ts-morph"; +import type {PropertyDeclarationStructure} from "ts-morph"; +import {StructureKind} from "ts-morph"; -import {DmmfField} from "../domain/DmmfField.js"; -import {TransformContext} from "../domain/TransformContext.js"; +import type {DmmfField} from "../domain/DmmfField.js"; +import type {TransformContext} from "../domain/TransformContext.js"; import {transformFieldToDecorators} from "./transformFieldToDecorators.js"; import {transformScalarToType} from "./transformScalarToType.js"; diff --git a/packages/orm/prisma/src/generator/transform/transformModelToClass.ts b/packages/orm/prisma/src/generator/transform/transformModelToClass.ts index d17ba2f008d..928ce93e175 100644 --- a/packages/orm/prisma/src/generator/transform/transformModelToClass.ts +++ b/packages/orm/prisma/src/generator/transform/transformModelToClass.ts @@ -1,7 +1,8 @@ -import {StatementStructures, StructureKind} from "ts-morph"; +import type {StatementStructures} from "ts-morph"; +import {StructureKind} from "ts-morph"; -import {DmmfModel} from "../domain/DmmfModel.js"; -import {TransformContext} from "../domain/TransformContext.js"; +import type {DmmfModel} from "../domain/DmmfModel.js"; +import type {TransformContext} from "../domain/TransformContext.js"; import {transformFieldToProperty} from "./transformFieldToProperty.js"; export function transformModelToClass(model: DmmfModel, ctx: TransformContext): StatementStructures { diff --git a/packages/orm/prisma/src/generator/transform/transformScalarToType.ts b/packages/orm/prisma/src/generator/transform/transformScalarToType.ts index 72ff6568cdd..2d72321c757 100644 --- a/packages/orm/prisma/src/generator/transform/transformScalarToType.ts +++ b/packages/orm/prisma/src/generator/transform/transformScalarToType.ts @@ -1,5 +1,5 @@ import {DmmfEnum} from "../domain/DmmfEnum.js"; -import {DmmfField} from "../domain/DmmfField.js"; +import type {DmmfField} from "../domain/DmmfField.js"; import {DmmfModel} from "../domain/DmmfModel.js"; import {ScalarTsTypes} from "../domain/ScalarTsTypes.js"; import type {TransformContext} from "../domain/TransformContext.js"; diff --git a/packages/orm/prisma/src/generator/utils/generateClientIndex.ts b/packages/orm/prisma/src/generator/utils/generateClientIndex.ts index da32a21ca93..5a78eecde0e 100644 --- a/packages/orm/prisma/src/generator/utils/generateClientIndex.ts +++ b/packages/orm/prisma/src/generator/utils/generateClientIndex.ts @@ -1,7 +1,7 @@ import path from "path"; -import {Project} from "ts-morph"; +import type {Project} from "ts-morph"; -import {GenerateCodeOptions} from "../generateCode.js"; +import type {GenerateCodeOptions} from "../generateCode.js"; import {resolveExtension} from "./resolveExtension.js"; export function generateClientIndex(project: Project, baseDirPath: string, options: GenerateCodeOptions) { diff --git a/packages/orm/prisma/src/generator/utils/generateDocuments.ts b/packages/orm/prisma/src/generator/utils/generateDocuments.ts index 6c58bfb1001..2677817d339 100644 --- a/packages/orm/prisma/src/generator/utils/generateDocuments.ts +++ b/packages/orm/prisma/src/generator/utils/generateDocuments.ts @@ -1,4 +1,4 @@ -import {Directory, SourceFile, StatementStructures} from "ts-morph"; +import type {Directory, SourceFile, StatementStructures} from "ts-morph"; export function generateDocuments( documents: any[], diff --git a/packages/orm/prisma/src/generator/utils/generateEnums.ts b/packages/orm/prisma/src/generator/utils/generateEnums.ts index 47291d1127c..231689ce07d 100644 --- a/packages/orm/prisma/src/generator/utils/generateEnums.ts +++ b/packages/orm/prisma/src/generator/utils/generateEnums.ts @@ -1,7 +1,7 @@ -import {DMMF} from "@prisma/generator-helper"; +import type {DMMF} from "@prisma/generator-helper"; import {toMap} from "@tsed/core"; import path from "path"; -import {Project} from "ts-morph"; +import type {Project} from "ts-morph"; import {DmmfEnum} from "../domain/DmmfEnum.js"; import {transformEnumsToEnums} from "../transform/transformEnumsToEnums.js"; diff --git a/packages/orm/prisma/src/generator/utils/generateIndex.ts b/packages/orm/prisma/src/generator/utils/generateIndex.ts index 8e360e849df..f8f6c798e6a 100644 --- a/packages/orm/prisma/src/generator/utils/generateIndex.ts +++ b/packages/orm/prisma/src/generator/utils/generateIndex.ts @@ -1,5 +1,5 @@ import path from "path"; -import {Project} from "ts-morph"; +import type {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..d8701dce82e 100644 --- a/packages/orm/prisma/src/generator/utils/generateInterfaces.ts +++ b/packages/orm/prisma/src/generator/utils/generateInterfaces.ts @@ -1,5 +1,6 @@ import path from "path"; -import {ModuleDeclarationKind, Project, StructureKind} from "ts-morph"; +import type {Project} from "ts-morph"; +import {ModuleDeclarationKind, 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..403b16763cb 100644 --- a/packages/orm/prisma/src/generator/utils/generateModels.ts +++ b/packages/orm/prisma/src/generator/utils/generateModels.ts @@ -1,7 +1,7 @@ -import {DMMF} from "@prisma/generator-helper"; +import type {DMMF} from "@prisma/generator-helper"; import {getValue, toMap} from "@tsed/core"; import path from "path"; -import {Project} from "ts-morph"; +import type {Project} from "ts-morph"; import {DmmfModel} from "../domain/DmmfModel.js"; import {transformModelToClass} from "../transform/transformModelToClass.js"; diff --git a/packages/orm/prisma/src/generator/utils/generateOutputsBarrelFile.ts b/packages/orm/prisma/src/generator/utils/generateOutputsBarrelFile.ts index 31ae5c0fe4e..0f5c251c956 100644 --- a/packages/orm/prisma/src/generator/utils/generateOutputsBarrelFile.ts +++ b/packages/orm/prisma/src/generator/utils/generateOutputsBarrelFile.ts @@ -1,4 +1,4 @@ -import {ExportDeclarationStructure, OptionalKind, SourceFile} from "ts-morph"; +import type {ExportDeclarationStructure, OptionalKind, SourceFile} from "ts-morph"; import {resolveExtension} from "./resolveExtension.js"; diff --git a/packages/orm/prisma/src/generator/utils/generatePrismaService.ts b/packages/orm/prisma/src/generator/utils/generatePrismaService.ts index 90897a164b4..f79ef1e0639 100644 --- a/packages/orm/prisma/src/generator/utils/generatePrismaService.ts +++ b/packages/orm/prisma/src/generator/utils/generatePrismaService.ts @@ -1,5 +1,6 @@ import path from "path"; -import {Project, Scope} from "ts-morph"; +import type {Project} from "ts-morph"; +import {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 6bd6808d825..d86f727528c 100644 --- a/packages/orm/prisma/src/generator/utils/generateRepositories.ts +++ b/packages/orm/prisma/src/generator/utils/generateRepositories.ts @@ -1,9 +1,10 @@ -import {DMMF} from "@prisma/generator-helper"; +import type {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"; +import type {ClassDeclaration, Project} from "ts-morph"; +import {Scope} from "ts-morph"; import {DmmfModel} from "../domain/DmmfModel.js"; import {generateOutputsBarrelFile} from "./generateOutputsBarrelFile.js"; diff --git a/packages/orm/prisma/src/generator/utils/isCircularRef.ts b/packages/orm/prisma/src/generator/utils/isCircularRef.ts index 46ed7096596..a8359a92492 100644 --- a/packages/orm/prisma/src/generator/utils/isCircularRef.ts +++ b/packages/orm/prisma/src/generator/utils/isCircularRef.ts @@ -1,6 +1,6 @@ -import {DMMF} from "@prisma/generator-helper"; +import type {DMMF} from "@prisma/generator-helper"; -import {TransformContext} from "../domain/TransformContext.js"; +import type {TransformContext} from "../domain/TransformContext.js"; export function isCircularRef(modelName: string, fieldType: string, ctx: TransformContext): boolean { if (modelName === fieldType) { diff --git a/packages/orm/prisma/src/generator/utils/saveProject.ts b/packages/orm/prisma/src/generator/utils/saveProject.ts index 3b5ebdff910..170c5771856 100644 --- a/packages/orm/prisma/src/generator/utils/saveProject.ts +++ b/packages/orm/prisma/src/generator/utils/saveProject.ts @@ -1,4 +1,4 @@ -import {Project} from "ts-morph"; +import type {Project} from "ts-morph"; export async function saveProject(project: Project) { for (const file of project.getSourceFiles()) { diff --git a/packages/orm/prisma/tsconfig.esm.json b/packages/orm/prisma/tsconfig.esm.json index 82292550ddb..8954049da4a 100644 --- a/packages/orm/prisma/tsconfig.esm.json +++ b/packages/orm/prisma/tsconfig.esm.json @@ -2,7 +2,6 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", diff --git a/packages/orm/prisma/tsconfig.spec.json b/packages/orm/prisma/tsconfig.spec.json index 2e917f4b39d..fdb41369c3a 100644 --- a/packages/orm/prisma/tsconfig.spec.json +++ b/packages/orm/prisma/tsconfig.spec.json @@ -3,31 +3,31 @@ "compilerOptions": { "baseUrl": ".", "rootDir": "../..", - "outDir": "./lib/cjs", "declaration": false, "composite": false, "noEmit": true, "paths": { - "@tsed/openspec": ["../../specs/openspec/src"], - "@tsed/schema": ["../../specs/schema/src"], - "@tsed/di": ["../../di/src"], - "@tsed/exceptions": ["../../specs/exceptions/src"], - "@tsed/json-mapper": ["../../specs/json-mapper/src"], - "@tsed/platform-exceptions": ["../../platform/platform-exceptions/src"], - "@tsed/platform-middlewares": ["../../platform/platform-middlewares/src"], - "@tsed/platform-params": ["../../platform/platform-params/src"], - "@tsed/platform-log-middleware": ["../../platform/platform-log-middleware/src"], - "@tsed/platform-response-filter": ["../../platform/platform-response-filter/src"], - "@tsed/platform-router": ["../../platform/platform-router/src"], - "@tsed/platform-views": ["../../platform/platform-views/src"], - "@tsed/components-scan": ["../../third-parties/components-scan/src"], - "@tsed/common": ["../../platform/common/src"], - "@tsed/ajv": ["../../specs/ajv/src"], - "@tsed/platform-cache": ["../../platform/platform-cache/src"], - "@tsed/swagger": ["../../specs/swagger/src"], - "@tsed/platform-test-sdk": ["../../platform/platform-test-sdk/src"], - "@tsed/platform-express": ["../../platform/platform-express/src"], - "@tsed/platform-koa": ["../../platform/platform-koa/src"] + "@tsed/openspec": ["../../specs/openspec/src/index.ts"], + "@tsed/schema": ["../../specs/schema/src/index.ts"], + "@tsed/di": ["../../di/src/index.ts"], + "@tsed/exceptions": ["../../specs/exceptions/src/index.ts"], + "@tsed/json-mapper": ["../../specs/json-mapper/src/index.ts"], + "@tsed/platform-exceptions": ["../../platform/platform-exceptions/src/index.ts"], + "@tsed/platform-middlewares": ["../../platform/platform-middlewares/src/index.ts"], + "@tsed/platform-params": ["../../platform/platform-params/src/index.ts"], + "@tsed/platform-log-middleware": ["../../platform/platform-log-middleware/src/index.ts"], + "@tsed/platform-response-filter": ["../../platform/platform-response-filter/src/index.ts"], + "@tsed/platform-router": ["../../platform/platform-router/src/index.ts"], + "@tsed/platform-views": ["../../platform/platform-views/src/index.ts"], + "@tsed/normalize-path": ["../../utils/normalize-path/src/index.ts"], + "@tsed/components-scan": ["../../third-parties/components-scan/src/index.ts"], + "@tsed/common": ["../../platform/common/src/index.ts"], + "@tsed/ajv": ["../../specs/ajv/src/index.ts"], + "@tsed/platform-cache": ["../../platform/platform-cache/src/index.ts"], + "@tsed/swagger": ["../../specs/swagger/src/index.ts"], + "@tsed/platform-test-sdk": ["../../platform/platform-test-sdk/src/index.ts"], + "@tsed/platform-express": ["../../platform/platform-express/src/index.ts"], + "@tsed/platform-koa": ["../../platform/platform-koa/src/index.ts"] }, "types": ["vite/client", "vitest/globals"] }, diff --git a/packages/orm/testcontainers-mongo/package.json b/packages/orm/testcontainers-mongo/package.json index b3175bf83e1..9959d89f2ac 100644 --- a/packages/orm/testcontainers-mongo/package.json +++ b/packages/orm/testcontainers-mongo/package.json @@ -11,12 +11,11 @@ ".": { "types": "./lib/types/index.d.ts", "import": "./lib/esm/index.js", - "default": "./lib/cjs/index.js" + "default": "./lib/esm/index.js" }, "./vitest/setup": { "types": "./lib/types/setup/vi.setup.d.ts", - "import": "./lib/esm/setup/vi.setup.js", - "default": "./lib/esm/setup/vi.setup.js" + "import": "./lib/esm/setup/vi.setup.js" } }, "scripts": { diff --git a/packages/orm/testcontainers-mongo/src/services/ContainerUtils.ts b/packages/orm/testcontainers-mongo/src/services/ContainerUtils.ts index 9b959cdce65..527db3c2c1b 100644 --- a/packages/orm/testcontainers-mongo/src/services/ContainerUtils.ts +++ b/packages/orm/testcontainers-mongo/src/services/ContainerUtils.ts @@ -1,6 +1,7 @@ import type {ConnectionOptions} from "node:tls"; -import {MongoDBContainer, StartedMongoDBContainer} from "@testcontainers/mongodb"; +import type {StartedMongoDBContainer} from "@testcontainers/mongodb"; +import {MongoDBContainer} from "@testcontainers/mongodb"; import type {ConnectOptions} from "mongoose"; declare global { diff --git a/packages/orm/testcontainers-mongo/tsconfig.esm.json b/packages/orm/testcontainers-mongo/tsconfig.esm.json index 82292550ddb..8954049da4a 100644 --- a/packages/orm/testcontainers-mongo/tsconfig.esm.json +++ b/packages/orm/testcontainers-mongo/tsconfig.esm.json @@ -2,7 +2,6 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", diff --git a/packages/perf/package.json b/packages/perf/package.json index 7c79621ebc0..17479e4cf26 100644 --- a/packages/perf/package.json +++ b/packages/perf/package.json @@ -12,7 +12,7 @@ ".": { "types": "./lib/types/index.d.ts", "import": "./lib/esm/index.js", - "default": "./lib/cjs/index.js" + "default": "./lib/esm/index.js" } }, "scripts": { diff --git a/packages/perf/src/domain/PerfLogger.ts b/packages/perf/src/domain/PerfLogger.ts index dd81b9444f1..6029d58e2a5 100644 --- a/packages/perf/src/domain/PerfLogger.ts +++ b/packages/perf/src/domain/PerfLogger.ts @@ -1,7 +1,8 @@ import {classOf, descriptorOf, methodsOf, nameOf} from "@tsed/core"; import chalk from "chalk"; -import {CallbackWrapper, Perf} from "./Perf.js"; +import type {CallbackWrapper} from "./Perf.js"; +import {Perf} from "./Perf.js"; const loggers = new Map(); diff --git a/packages/perf/tsconfig.esm.json b/packages/perf/tsconfig.esm.json index 82292550ddb..8954049da4a 100644 --- a/packages/perf/tsconfig.esm.json +++ b/packages/perf/tsconfig.esm.json @@ -2,7 +2,6 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", diff --git a/packages/platform/common/package.json b/packages/platform/common/package.json index 9e5e4d6d59f..0ec96d3f7d5 100644 --- a/packages/platform/common/package.json +++ b/packages/platform/common/package.json @@ -11,7 +11,7 @@ ".": { "types": "./lib/types/index.d.ts", "import": "./lib/esm/index.js", - "default": "./lib/cjs/index.js" + "default": "./lib/esm/index.js" } }, "scripts": { diff --git a/packages/platform/common/src/builder/PlatformBuilder.spec.ts b/packages/platform/common/src/builder/PlatformBuilder.spec.ts index cfa80f0489e..e20639215a0 100644 --- a/packages/platform/common/src/builder/PlatformBuilder.spec.ts +++ b/packages/platform/common/src/builder/PlatformBuilder.spec.ts @@ -1,13 +1,14 @@ -import {catchAsyncError, Type} from "@tsed/core"; +import type {Type} from "@tsed/core"; +import {catchAsyncError} from "@tsed/core"; import {Configuration, Controller, Injectable, InjectorService, Module} from "@tsed/di"; -import {AfterInit} from "../interfaces/AfterInit.js"; -import {AfterListen} from "../interfaces/AfterListen.js"; -import {AfterRoutesInit} from "../interfaces/AfterRoutesInit.js"; -import {BeforeInit} from "../interfaces/BeforeInit.js"; -import {BeforeListen} from "../interfaces/BeforeListen.js"; -import {BeforeRoutesInit} from "../interfaces/BeforeRoutesInit.js"; -import {OnReady} from "../interfaces/OnReady.js"; +import type {AfterInit} from "../interfaces/AfterInit.js"; +import type {AfterListen} from "../interfaces/AfterListen.js"; +import type {AfterRoutesInit} from "../interfaces/AfterRoutesInit.js"; +import type {BeforeInit} from "../interfaces/BeforeInit.js"; +import type {BeforeListen} from "../interfaces/BeforeListen.js"; +import type {BeforeRoutesInit} from "../interfaces/BeforeRoutesInit.js"; +import type {OnReady} from "../interfaces/OnReady.js"; import {FakeAdapter} from "../services/FakeAdapter.js"; import {Platform} from "../services/Platform.js"; import {PlatformBuilder} from "./PlatformBuilder.js"; diff --git a/packages/platform/common/src/builder/PlatformBuilder.ts b/packages/platform/common/src/builder/PlatformBuilder.ts index 377140b94d5..57dd09534b5 100644 --- a/packages/platform/common/src/builder/PlatformBuilder.ts +++ b/packages/platform/common/src/builder/PlatformBuilder.ts @@ -1,21 +1,25 @@ -import {isClass, isFunction, isString, nameOf, Type} from "@tsed/core"; -import {colors, InjectorService, ProviderOpts, setLoggerConfiguration, TokenProvider} from "@tsed/di"; -import {getMiddlewaresForHook, PlatformMiddlewareLoadingOptions} from "@tsed/platform-middlewares"; -import {PlatformLayer} from "@tsed/platform-router"; +import type {Type} from "@tsed/core"; +import {isClass, isFunction, isString, nameOf} from "@tsed/core"; +import type {InjectorService, ProviderOpts, TokenProvider} from "@tsed/di"; +import {colors, setLoggerConfiguration} from "@tsed/di"; +import type {PlatformMiddlewareLoadingOptions} from "@tsed/platform-middlewares"; +import {getMiddlewaresForHook} from "@tsed/platform-middlewares"; +import type {PlatformLayer} from "@tsed/platform-router"; import type {IncomingMessage, ServerResponse} from "http"; -import Http from "http"; -import Http2 from "http2"; +import type Http from "http"; +import type Http2 from "http2"; import type Https from "https"; -import {PlatformStaticsSettings} from "../config/interfaces/PlatformStaticsSettings.js"; -import {PlatformRouteDetails} from "../domain/PlatformRouteDetails.js"; -import {Route} from "../interfaces/Route.js"; +import type {PlatformStaticsSettings} from "../config/interfaces/PlatformStaticsSettings.js"; +import type {PlatformRouteDetails} from "../domain/PlatformRouteDetails.js"; +import type {Route} from "../interfaces/Route.js"; import {Platform} from "../services/Platform.js"; -import {PlatformAdapter, PlatformBuilderSettings} from "../services/PlatformAdapter.js"; +import type {PlatformBuilderSettings} from "../services/PlatformAdapter.js"; +import {PlatformAdapter} from "../services/PlatformAdapter.js"; import {PlatformApplication} from "../services/PlatformApplication.js"; import {closeServer} from "../utils/closeServer.js"; import {createInjector} from "../utils/createInjector.js"; -import {CreateServerReturn} from "../utils/createServer.js"; +import type {CreateServerReturn} from "../utils/createServer.js"; import {getConfiguration} from "../utils/getConfiguration.js"; import {getStaticsOptions} from "../utils/getStaticsOptions.js"; import {printRoutes} from "../utils/printRoutes.js"; diff --git a/packages/platform/common/src/config/interfaces/PlatformJsonMapperSettings.ts b/packages/platform/common/src/config/interfaces/PlatformJsonMapperSettings.ts index 1be78bd3a3c..ad2cb52c6b2 100644 --- a/packages/platform/common/src/config/interfaces/PlatformJsonMapperSettings.ts +++ b/packages/platform/common/src/config/interfaces/PlatformJsonMapperSettings.ts @@ -1,4 +1,4 @@ -import {JsonMapperGlobalOptions} from "@tsed/json-mapper"; +import type {JsonMapperGlobalOptions} from "@tsed/json-mapper"; export interface PlatformJsonMapperSettings extends JsonMapperGlobalOptions {} diff --git a/packages/platform/common/src/config/services/PlatformConfiguration.ts b/packages/platform/common/src/config/services/PlatformConfiguration.ts index cdf0001d1cc..47015713028 100644 --- a/packages/platform/common/src/config/services/PlatformConfiguration.ts +++ b/packages/platform/common/src/config/services/PlatformConfiguration.ts @@ -1,9 +1,10 @@ import {getHostInfoFromPort, isBoolean} from "@tsed/core"; -import {DIConfiguration, Injectable, ProviderScope, TokenProvider} from "@tsed/di"; +import type {TokenProvider} from "@tsed/di"; +import {DIConfiguration, Injectable, ProviderScope} from "@tsed/di"; import {JsonMapperSettings} from "@tsed/json-mapper"; -import Https from "https"; +import type Https from "https"; -import {PlatformJsonMapperSettings} from "../interfaces/PlatformJsonMapperSettings.js"; +import type {PlatformJsonMapperSettings} from "../interfaces/PlatformJsonMapperSettings.js"; const rootDir = process.cwd(); diff --git a/packages/platform/common/src/decorators/PlatformProvider.ts b/packages/platform/common/src/decorators/PlatformProvider.ts index 5e1e53cf5c5..70089459fa8 100644 --- a/packages/platform/common/src/decorators/PlatformProvider.ts +++ b/packages/platform/common/src/decorators/PlatformProvider.ts @@ -1,6 +1,6 @@ -import {Type} from "@tsed/core"; +import type {Type} from "@tsed/core"; -import {PlatformAdapter} from "../services/PlatformAdapter.js"; +import type {PlatformAdapter} from "../services/PlatformAdapter.js"; import {registerPlatformAdapter} from "../utils/registerPlatformAdapter.js"; export function PlatformProvider() { diff --git a/packages/platform/common/src/decorators/multer/multerOptions.ts b/packages/platform/common/src/decorators/multer/multerOptions.ts index b3f2c2a4871..f83a8a1fba9 100644 --- a/packages/platform/common/src/decorators/multer/multerOptions.ts +++ b/packages/platform/common/src/decorators/multer/multerOptions.ts @@ -1,6 +1,6 @@ import {StoreMerge} from "@tsed/core"; -import {PlatformMulterSettings} from "../../config/interfaces/PlatformMulterSettings.js"; +import type {PlatformMulterSettings} from "../../config/interfaces/PlatformMulterSettings.js"; import {PlatformMulterMiddleware} from "../../middlewares/PlatformMulterMiddleware.js"; /** diff --git a/packages/platform/common/src/decorators/multer/multipartFile.ts b/packages/platform/common/src/decorators/multer/multipartFile.ts index eb9ed751ea6..cdf20b4e739 100644 --- a/packages/platform/common/src/decorators/multer/multipartFile.ts +++ b/packages/platform/common/src/decorators/multer/multipartFile.ts @@ -1,9 +1,11 @@ -import {DecoratorParameters, Metadata, StoreMerge, useDecorators, useMethodDecorators} from "@tsed/core"; +import type {DecoratorParameters} from "@tsed/core"; +import {Metadata, StoreMerge, useDecorators, useMethodDecorators} from "@tsed/core"; import {ParamTypes, UseParam} from "@tsed/platform-params"; import {InFile} from "@tsed/schema"; -import {PlatformMulterFile} from "../../config/interfaces/PlatformMulterSettings.js"; -import {MulterInputOptions, PlatformMulterMiddleware} from "../../middlewares/PlatformMulterMiddleware.js"; +import type {PlatformMulterFile} from "../../config/interfaces/PlatformMulterSettings.js"; +import type {MulterInputOptions} from "../../middlewares/PlatformMulterMiddleware.js"; +import {PlatformMulterMiddleware} from "../../middlewares/PlatformMulterMiddleware.js"; function mapOptions(name: string, maxCount: number | undefined): MulterInputOptions { return { diff --git a/packages/platform/common/src/decorators/params/request.ts b/packages/platform/common/src/decorators/params/request.ts index 037b5410f44..6d8dbe7f1a9 100644 --- a/packages/platform/common/src/decorators/params/request.ts +++ b/packages/platform/common/src/decorators/params/request.ts @@ -1,5 +1,7 @@ -import {isClass, Metadata, nameOf, Type} from "@tsed/core"; -import {mapParamsOptions, ParamOptions, ParamTypes, UseParam} from "@tsed/platform-params"; +import type {Type} from "@tsed/core"; +import {isClass, Metadata, nameOf} from "@tsed/core"; +import type {ParamOptions} from "@tsed/platform-params"; +import {mapParamsOptions, ParamTypes, UseParam} from "@tsed/platform-params"; import {IncomingMessage} from "http"; function getParamType(target: Object, propertyKey: string | symbol | undefined, parameterIndex: number) { diff --git a/packages/platform/common/src/domain/AnyToPromiseWithCtx.ts b/packages/platform/common/src/domain/AnyToPromiseWithCtx.ts index c750e55ddee..a40e892a00e 100644 --- a/packages/platform/common/src/domain/AnyToPromiseWithCtx.ts +++ b/packages/platform/common/src/domain/AnyToPromiseWithCtx.ts @@ -1,6 +1,7 @@ -import {AnyPromiseResult, AnyToPromise} from "@tsed/core"; +import type {AnyPromiseResult} from "@tsed/core"; +import {AnyToPromise} from "@tsed/core"; -import {PlatformContext} from "./PlatformContext.js"; +import type {PlatformContext} from "./PlatformContext.js"; export class AnyToPromiseWithCtx extends AnyToPromise { public $ctx: PlatformContext; diff --git a/packages/platform/common/src/domain/PlatformContext.ts b/packages/platform/common/src/domain/PlatformContext.ts index f5c5161bb65..82002881a44 100644 --- a/packages/platform/common/src/domain/PlatformContext.ts +++ b/packages/platform/common/src/domain/PlatformContext.ts @@ -1,9 +1,10 @@ -import {DIContext, DIContextOptions} from "@tsed/di"; -import {PlatformHandlerMetadata} from "@tsed/platform-router"; -import {EndpointMetadata} from "@tsed/schema"; -import {IncomingMessage, ServerResponse} from "http"; +import type {DIContextOptions} from "@tsed/di"; +import {DIContext} from "@tsed/di"; +import type {PlatformHandlerMetadata} from "@tsed/platform-router"; +import type {EndpointMetadata} from "@tsed/schema"; +import type {IncomingMessage, ServerResponse} from "http"; -import {IncomingEvent} from "../interfaces/IncomingEvent.js"; +import type {IncomingEvent} from "../interfaces/IncomingEvent.js"; import {PlatformApplication} from "../services/PlatformApplication.js"; import {PlatformRequest} from "../services/PlatformRequest.js"; import {PlatformResponse} from "../services/PlatformResponse.js"; diff --git a/packages/platform/common/src/interfaces/IncomingEvent.ts b/packages/platform/common/src/interfaces/IncomingEvent.ts index 315a0567548..3541a43eb73 100644 --- a/packages/platform/common/src/interfaces/IncomingEvent.ts +++ b/packages/platform/common/src/interfaces/IncomingEvent.ts @@ -1,4 +1,4 @@ -import {IncomingMessage, ServerResponse} from "http"; +import type {IncomingMessage, ServerResponse} from "http"; export interface IncomingEvent extends Record { response: Res; diff --git a/packages/platform/common/src/interfaces/OnRequest.ts b/packages/platform/common/src/interfaces/OnRequest.ts index 65fc15633a6..56cc4f948b0 100644 --- a/packages/platform/common/src/interfaces/OnRequest.ts +++ b/packages/platform/common/src/interfaces/OnRequest.ts @@ -1,4 +1,4 @@ -import {PlatformContext} from "../domain/PlatformContext.js"; +import type {PlatformContext} from "../domain/PlatformContext.js"; export interface OnRequest { $onRequest(ctx: PlatformContext): void; diff --git a/packages/platform/common/src/interfaces/OnResponse.ts b/packages/platform/common/src/interfaces/OnResponse.ts index f069bedfd20..e6d1048c65e 100644 --- a/packages/platform/common/src/interfaces/OnResponse.ts +++ b/packages/platform/common/src/interfaces/OnResponse.ts @@ -1,4 +1,4 @@ -import {PlatformResponse} from "../services/PlatformResponse.js"; +import type {PlatformResponse} from "../services/PlatformResponse.js"; export interface OnResponse { $onResponse(ctx: PlatformResponse): void; diff --git a/packages/platform/common/src/interfaces/PlatformRouteOptions.ts b/packages/platform/common/src/interfaces/PlatformRouteOptions.ts index 5bf8cf22a07..f24a06557eb 100644 --- a/packages/platform/common/src/interfaces/PlatformRouteOptions.ts +++ b/packages/platform/common/src/interfaces/PlatformRouteOptions.ts @@ -1,5 +1,5 @@ -import {Type} from "@tsed/core"; -import {PathType} from "@tsed/di"; +import type {Type} from "@tsed/core"; +import type {PathType} from "@tsed/di"; /** * @ignore diff --git a/packages/platform/common/src/interfaces/Route.ts b/packages/platform/common/src/interfaces/Route.ts index 901b1abfacf..0c63c2fa69a 100644 --- a/packages/platform/common/src/interfaces/Route.ts +++ b/packages/platform/common/src/interfaces/Route.ts @@ -1,4 +1,4 @@ -import {Provider, TokenProvider} from "@tsed/di"; +import type {Provider, TokenProvider} from "@tsed/di"; export interface Route extends Record { route: string; diff --git a/packages/platform/common/src/middlewares/PlatformAcceptMimesMiddleware.ts b/packages/platform/common/src/middlewares/PlatformAcceptMimesMiddleware.ts index f016da0ba3d..f0dbfd4a4cd 100644 --- a/packages/platform/common/src/middlewares/PlatformAcceptMimesMiddleware.ts +++ b/packages/platform/common/src/middlewares/PlatformAcceptMimesMiddleware.ts @@ -1,7 +1,8 @@ import {uniq} from "@tsed/core"; import {Constant} from "@tsed/di"; import {NotAcceptable} from "@tsed/exceptions"; -import {Middleware, MiddlewareMethods} from "@tsed/platform-middlewares"; +import type {MiddlewareMethods} from "@tsed/platform-middlewares"; +import {Middleware} from "@tsed/platform-middlewares"; import {Context} from "@tsed/platform-params"; /** diff --git a/packages/platform/common/src/middlewares/PlatformMulterMiddleware.ts b/packages/platform/common/src/middlewares/PlatformMulterMiddleware.ts index cdd4f0055b0..2aa70d702cd 100644 --- a/packages/platform/common/src/middlewares/PlatformMulterMiddleware.ts +++ b/packages/platform/common/src/middlewares/PlatformMulterMiddleware.ts @@ -1,11 +1,12 @@ import {Inject, Value} from "@tsed/di"; import {BadRequest} from "@tsed/exceptions"; -import {Middleware, MiddlewareMethods} from "@tsed/platform-middlewares"; +import type {MiddlewareMethods} from "@tsed/platform-middlewares"; +import {Middleware} from "@tsed/platform-middlewares"; import {Context} from "@tsed/platform-params"; import type {MulterError} from "multer"; -import {PlatformMulterField, PlatformMulterSettings} from "../config/interfaces/PlatformMulterSettings.js"; -import {PlatformContext} from "../domain/PlatformContext.js"; +import type {PlatformMulterField, PlatformMulterSettings} from "../config/interfaces/PlatformMulterSettings.js"; +import type {PlatformContext} from "../domain/PlatformContext.js"; import {PlatformApplication} from "../services/PlatformApplication.js"; export interface MulterInputOptions { @@ -30,7 +31,7 @@ export class PlatformMulterMiddleware implements MiddlewareMethods { @Value("multer", {}) // NOTE: don't use constant to getting multer configuration. See issue #1840 protected settings: PlatformMulterSettings; - @Inject() + @Inject(PlatformApplication) protected app: PlatformApplication; async use(@Context() ctx: PlatformContext) { diff --git a/packages/platform/common/src/services/Platform.ts b/packages/platform/common/src/services/Platform.ts index 589ecd8175e..4af3a23632a 100644 --- a/packages/platform/common/src/services/Platform.ts +++ b/packages/platform/common/src/services/Platform.ts @@ -1,7 +1,7 @@ -import {ControllerProvider, Injectable, InjectorService, ProviderScope, TokenProvider} from "@tsed/di"; -import {PlatformLayer, PlatformRouters} from "@tsed/platform-router"; +import {type ControllerProvider, Inject, Injectable, InjectorService, ProviderScope, type TokenProvider} from "@tsed/di"; +import {type PlatformLayer, PlatformRouters} from "@tsed/platform-router"; -import {Route, RouteController} from "../interfaces/Route.js"; +import type {Route, RouteController} from "../interfaces/Route.js"; import {PlatformApplication} from "./PlatformApplication.js"; import {PlatformHandler} from "./PlatformHandler.js"; @@ -18,9 +18,9 @@ export class Platform { #layers: PlatformLayer[]; constructor( - readonly injector: InjectorService, - readonly platformApplication: PlatformApplication, - readonly platformRouters: PlatformRouters + @Inject(InjectorService) readonly injector: InjectorService, + @Inject(PlatformApplication) readonly platformApplication: PlatformApplication, + @Inject(PlatformRouters) readonly platformRouters: PlatformRouters ) { platformRouters.prebuild(); } diff --git a/packages/platform/common/src/services/PlatformAdapter.ts b/packages/platform/common/src/services/PlatformAdapter.ts index 4eee9174019..0874c031462 100644 --- a/packages/platform/common/src/services/PlatformAdapter.ts +++ b/packages/platform/common/src/services/PlatformAdapter.ts @@ -1,14 +1,15 @@ -import {Type} from "@tsed/core"; -import {InjectorService, ProviderOpts, registerProvider} from "@tsed/di"; -import {PlatformContextHandler, 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"; -import {PlatformContext} from "../domain/PlatformContext.js"; +import type {Type} from "@tsed/core"; +import type {ProviderOpts} from "@tsed/di"; +import {Inject, InjectorService, registerProvider} from "@tsed/di"; +import type {PlatformContextHandler, PlatformHandlerMetadata, PlatformLayer} from "@tsed/platform-router"; +import type {IncomingMessage, ServerResponse} from "http"; + +import type {PlatformMulter, PlatformMulterSettings} from "../config/interfaces/PlatformMulterSettings.js"; +import type {PlatformStaticsOptions} from "../config/interfaces/PlatformStaticsSettings.js"; +import type {PlatformContext} from "../domain/PlatformContext.js"; import {createHttpServer} from "../utils/createHttpServer.js"; import {createHttpsServer} from "../utils/createHttpsServer.js"; -import {CreateServerReturn} from "../utils/createServer.js"; +import type {CreateServerReturn} from "../utils/createServer.js"; import type {PlatformApplication} from "./PlatformApplication.js"; export abstract class PlatformAdapter { @@ -18,7 +19,7 @@ export abstract class PlatformAdapter { */ providers: ProviderOpts[]; - constructor(protected injector: InjectorService) {} + constructor(@Inject(InjectorService) protected injector: InjectorService) {} get app(): PlatformApplication { return this.injector.get>("PlatformApplication")!; diff --git a/packages/platform/common/src/services/PlatformApplication.ts b/packages/platform/common/src/services/PlatformApplication.ts index b7eefcdd279..f9b8316ea16 100644 --- a/packages/platform/common/src/services/PlatformApplication.ts +++ b/packages/platform/common/src/services/PlatformApplication.ts @@ -1,8 +1,8 @@ -import {Injectable, InjectorService, ProviderScope} from "@tsed/di"; +import {Inject, Injectable, InjectorService, ProviderScope} from "@tsed/di"; import {PlatformRouter} from "@tsed/platform-router"; -import {IncomingMessage, ServerResponse} from "http"; +import type {IncomingMessage, ServerResponse} from "http"; -import {PlatformMulterSettings} from "../config/interfaces/PlatformMulterSettings.js"; +import type {PlatformMulterSettings} from "../config/interfaces/PlatformMulterSettings.js"; import {PlatformAdapter} from "./PlatformAdapter.js"; declare global { @@ -26,8 +26,8 @@ export class PlatformApplication extends PlatformRouter rawCallback: () => any; constructor( - public adapter: PlatformAdapter, - public injector: InjectorService + @Inject(PlatformAdapter) public adapter: PlatformAdapter, + @Inject(InjectorService) public injector: InjectorService ) { super(injector); const {app, callback} = adapter.createApp(); diff --git a/packages/platform/common/src/services/PlatformHandler.ts b/packages/platform/common/src/services/PlatformHandler.ts index 7c74392f992..ae86953496c 100644 --- a/packages/platform/common/src/services/PlatformHandler.ts +++ b/packages/platform/common/src/services/PlatformHandler.ts @@ -1,19 +1,21 @@ -import {AnyPromiseResult, AnyToPromiseStatus, catchAsyncError} from "@tsed/core"; -import {Inject, Injectable, Provider, ProviderScope} from "@tsed/di"; +import type {AnyPromiseResult} from "@tsed/core"; +import {AnyToPromiseStatus, catchAsyncError} from "@tsed/core"; +import type {Provider} from "@tsed/di"; +import {Inject, Injectable, ProviderScope} from "@tsed/di"; import {PlatformExceptions} from "@tsed/platform-exceptions"; -import {PlatformParams, PlatformParamsCallback} from "@tsed/platform-params"; +import {PlatformParams, type PlatformParamsCallback} from "@tsed/platform-params"; import {PlatformResponseFilter} from "@tsed/platform-response-filter"; import { - AlterEndpointHandlersArg, + type AlterEndpointHandlersArg, PlatformHandlerMetadata, PlatformHandlerType, PlatformRouters, useResponseHandler } from "@tsed/platform-router"; -import {JsonOperationRoute} from "@tsed/schema"; +import type {JsonOperationRoute} from "@tsed/schema"; import {AnyToPromiseWithCtx} from "../domain/AnyToPromiseWithCtx.js"; -import {PlatformContext} from "../domain/PlatformContext.js"; +import type {PlatformContext} from "../domain/PlatformContext.js"; import {setResponseHeaders} from "../utils/setResponseHeaders.js"; import {PlatformApplication} from "./PlatformApplication.js"; import {PlatformMiddlewaresChain} from "./PlatformMiddlewaresChain.js"; @@ -26,22 +28,22 @@ import {PlatformMiddlewaresChain} from "./PlatformMiddlewaresChain.js"; scope: ProviderScope.SINGLETON }) export class PlatformHandler { - @Inject() + @Inject(PlatformResponseFilter) protected responseFilter: PlatformResponseFilter; - @Inject() + @Inject(PlatformParams) protected platformParams: PlatformParams; - @Inject() + @Inject(PlatformExceptions) protected platformExceptions: PlatformExceptions; - @Inject() + @Inject(PlatformApplication) protected platformApplication: PlatformApplication; - @Inject() + @Inject(PlatformMiddlewaresChain) protected platformMiddlewaresChain: PlatformMiddlewaresChain; - constructor(protected platformRouters: PlatformRouters) { + constructor(@Inject(PlatformRouters) protected platformRouters: PlatformRouters) { // configure the router module platformRouters.hooks .on("alterEndpointHandlers", (handlers: AlterEndpointHandlersArg, operationRoute: JsonOperationRoute) => { diff --git a/packages/platform/common/src/services/PlatformMiddlewaresChain.spec.ts b/packages/platform/common/src/services/PlatformMiddlewaresChain.spec.ts index da1bbbce0f2..57337994f41 100644 --- a/packages/platform/common/src/services/PlatformMiddlewaresChain.spec.ts +++ b/packages/platform/common/src/services/PlatformMiddlewaresChain.spec.ts @@ -1,6 +1,8 @@ -import {Controller, ControllerProvider} from "@tsed/di"; +import type {ControllerProvider} from "@tsed/di"; +import {Controller} from "@tsed/di"; import {Middleware, Use, UseAuth} from "@tsed/platform-middlewares"; -import {AcceptMime, All, EndpointMetadata, Get, getOperationsRoutes, Post} from "@tsed/schema"; +import type {EndpointMetadata} from "@tsed/schema"; +import {AcceptMime, All, Get, getOperationsRoutes, Post} from "@tsed/schema"; import {MultipartFile} from "../decorators/multer/multipartFile.js"; import {PlatformAcceptMimesMiddleware} from "../middlewares/PlatformAcceptMimesMiddleware.js"; diff --git a/packages/platform/common/src/services/PlatformMiddlewaresChain.ts b/packages/platform/common/src/services/PlatformMiddlewaresChain.ts index 27c7512bb15..4c5f0d89991 100644 --- a/packages/platform/common/src/services/PlatformMiddlewaresChain.ts +++ b/packages/platform/common/src/services/PlatformMiddlewaresChain.ts @@ -1,8 +1,9 @@ import {isClass} from "@tsed/core"; -import {Constant, Inject, Injectable, InjectorService, TokenProvider} from "@tsed/di"; +import {Constant, Inject, Injectable, InjectorService} from "@tsed/di"; import {ParamTypes} from "@tsed/platform-params"; -import {AlterEndpointHandlersArg} from "@tsed/platform-router"; -import {JsonEntityStore, JsonOperationRoute} from "@tsed/schema"; +import type {AlterEndpointHandlersArg} from "@tsed/platform-router"; +import type {JsonOperationRoute} from "@tsed/schema"; +import {JsonEntityStore} from "@tsed/schema"; import {PlatformAcceptMimesMiddleware} from "../middlewares/PlatformAcceptMimesMiddleware.js"; import {PlatformMulterMiddleware} from "../middlewares/PlatformMulterMiddleware.js"; diff --git a/packages/platform/common/src/services/PlatformRequest.ts b/packages/platform/common/src/services/PlatformRequest.ts index f14fe2be878..987e1bae42d 100644 --- a/packages/platform/common/src/services/PlatformRequest.ts +++ b/packages/platform/common/src/services/PlatformRequest.ts @@ -1,5 +1,5 @@ import {Injectable, ProviderScope, Scope} from "@tsed/di"; -import {IncomingHttpHeaders, IncomingMessage} from "http"; +import type {IncomingHttpHeaders, IncomingMessage} from "http"; import type {PlatformContext} from "../domain/PlatformContext.js"; import type {PlatformResponse} from "./PlatformResponse.js"; diff --git a/packages/platform/common/src/services/PlatformResponse.ts b/packages/platform/common/src/services/PlatformResponse.ts index 6b7d65e7056..66eb3b5401a 100644 --- a/packages/platform/common/src/services/PlatformResponse.ts +++ b/packages/platform/common/src/services/PlatformResponse.ts @@ -2,7 +2,7 @@ import {isArray, isBoolean, isNumber, isStream, isString} from "@tsed/core"; import {Injectable, ProviderScope, Scope} from "@tsed/di"; import {getStatusMessage} from "@tsed/schema"; import encodeUrl from "encodeurl"; -import {OutgoingHttpHeaders, ServerResponse} from "http"; +import type {OutgoingHttpHeaders, ServerResponse} from "http"; import type {PlatformContext} from "../domain/PlatformContext.js"; import type {PlatformRequest} from "./PlatformRequest.js"; diff --git a/packages/platform/common/src/services/PlatformTest.ts b/packages/platform/common/src/services/PlatformTest.ts index b127e3ed173..1358e357583 100644 --- a/packages/platform/common/src/services/PlatformTest.ts +++ b/packages/platform/common/src/services/PlatformTest.ts @@ -1,14 +1,16 @@ -import {Type} from "@tsed/core"; -import {DITest, InjectorService} from "@tsed/di"; +import type {Type} from "@tsed/core"; +import type {InjectorService} from "@tsed/di"; +import {DITest} from "@tsed/di"; import accepts from "accepts"; import type {IncomingMessage, RequestListener, ServerResponse} from "http"; import {PlatformBuilder} from "../builder/PlatformBuilder.js"; -import {PlatformContext, PlatformContextOptions} from "../domain/PlatformContext.js"; +import type {PlatformContextOptions} from "../domain/PlatformContext.js"; +import {PlatformContext} from "../domain/PlatformContext.js"; import {createInjector} from "../utils/createInjector.js"; import {getConfiguration} from "../utils/getConfiguration.js"; import {FakeResponse} from "./FakeResponse.js"; -import {PlatformAdapter, PlatformBuilderSettings} from "./PlatformAdapter.js"; +import type {PlatformAdapter, PlatformBuilderSettings} from "./PlatformAdapter.js"; import {PlatformApplication} from "./PlatformApplication.js"; /** @@ -56,12 +58,12 @@ export class PlatformTest extends DITest { settings.adapter = adapter as any; const configuration = getConfiguration(settings, mod); - const disableComponentsScan = configuration.disableComponentsScan || !!process.env.WEBPACK; + // const disableComponentsScan = configuration.disableComponentsScan || !!process.env.WEBPACK; - if (!disableComponentsScan) { - const {importProviders} = await import("@tsed/components-scan"); - await importProviders(configuration); - } + // if (!disableComponentsScan) { + // const {importProviders} = await import("@tsed/components-scan"); + // await importProviders(configuration); + // } instance = await PlatformBuilder.build(mod, configuration).bootstrap(); await instance.listen(!!listen); diff --git a/packages/platform/common/src/utils/__mock__/module1/controllers/M1Ctrl1.ts b/packages/platform/common/src/utils/__mock__/module1/controllers/M1Ctrl1.ts index 7c387877f6a..d6d682073fc 100644 --- a/packages/platform/common/src/utils/__mock__/module1/controllers/M1Ctrl1.ts +++ b/packages/platform/common/src/utils/__mock__/module1/controllers/M1Ctrl1.ts @@ -1,6 +1,6 @@ import {Controller} from "@tsed/di"; -import {M1Service} from "../services/M1Service.js"; +import type {M1Service} from "../services/M1Service.js"; @Controller("/m1") export class M1Ctrl1 { diff --git a/packages/platform/common/src/utils/__mock__/module1/services/M1Service.ts b/packages/platform/common/src/utils/__mock__/module1/services/M1Service.ts index 0da88b4618d..8b1623aee2c 100644 --- a/packages/platform/common/src/utils/__mock__/module1/services/M1Service.ts +++ b/packages/platform/common/src/utils/__mock__/module1/services/M1Service.ts @@ -1,6 +1,6 @@ import {Injectable} from "@tsed/di"; -import {SubService} from "../submodule/SubService.js"; +import type {SubService} from "../submodule/SubService.js"; @Injectable() export class M1Service { diff --git a/packages/platform/common/src/utils/createContext.ts b/packages/platform/common/src/utils/createContext.ts index 507bf110aed..5f9f7095aac 100644 --- a/packages/platform/common/src/utils/createContext.ts +++ b/packages/platform/common/src/utils/createContext.ts @@ -1,8 +1,8 @@ -import {InjectorService} from "@tsed/di"; +import type {InjectorService} from "@tsed/di"; import {v4} from "uuid"; import {PlatformContext} from "../domain/PlatformContext.js"; -import {IncomingEvent} from "../interfaces/IncomingEvent.js"; +import type {IncomingEvent} from "../interfaces/IncomingEvent.js"; import {PlatformRequest} from "../services/PlatformRequest.js"; import {PlatformResponse} from "../services/PlatformResponse.js"; diff --git a/packages/platform/common/src/utils/createHttpServer.ts b/packages/platform/common/src/utils/createHttpServer.ts index d1b67c5d8b6..17de03aac02 100644 --- a/packages/platform/common/src/utils/createHttpServer.ts +++ b/packages/platform/common/src/utils/createHttpServer.ts @@ -1,4 +1,4 @@ -import {InjectorService} from "@tsed/di"; +import type {InjectorService} from "@tsed/di"; import Http from "http"; import {createServer} from "./createServer.js"; diff --git a/packages/platform/common/src/utils/createHttpsServer.ts b/packages/platform/common/src/utils/createHttpsServer.ts index 93c1ebbe7c4..748084721ae 100644 --- a/packages/platform/common/src/utils/createHttpsServer.ts +++ b/packages/platform/common/src/utils/createHttpsServer.ts @@ -1,5 +1,5 @@ -import {InjectorService} from "@tsed/di"; -import Http from "http"; +import type {InjectorService} from "@tsed/di"; +import type Http from "http"; import Https from "https"; import {createServer} from "./createServer.js"; diff --git a/packages/platform/common/src/utils/createInjector.ts b/packages/platform/common/src/utils/createInjector.ts index 6ad851187c4..1ee79762520 100644 --- a/packages/platform/common/src/utils/createInjector.ts +++ b/packages/platform/common/src/utils/createInjector.ts @@ -1,5 +1,7 @@ -import {toMap, Type} from "@tsed/core"; -import {InjectorService, ProviderOpts, setLoggerConfiguration} from "@tsed/di"; +import type {Type} from "@tsed/core"; +import {toMap} from "@tsed/core"; +import type {ProviderOpts} from "@tsed/di"; +import {InjectorService, setLoggerConfiguration} from "@tsed/di"; import {$log} from "@tsed/logger"; import {PlatformConfiguration} from "../config/services/PlatformConfiguration.js"; diff --git a/packages/platform/common/src/utils/createServer.ts b/packages/platform/common/src/utils/createServer.ts index 6495b3272ad..57d90179686 100644 --- a/packages/platform/common/src/utils/createServer.ts +++ b/packages/platform/common/src/utils/createServer.ts @@ -1,8 +1,10 @@ -import {getHostInfoFromPort, ReturnHostInfoFromPort} from "@tsed/core"; -import {InjectorService, ProviderScope, TokenProvider} from "@tsed/di"; -import Http from "http"; -import Http2 from "http2"; -import Https from "https"; +import type {ReturnHostInfoFromPort} from "@tsed/core"; +import {getHostInfoFromPort} from "@tsed/core"; +import type {InjectorService, TokenProvider} from "@tsed/di"; +import {ProviderScope} from "@tsed/di"; +import type Http from "http"; +import type Http2 from "http2"; +import type Https from "https"; import {listenServer} from "./listenServer.js"; diff --git a/packages/platform/common/src/utils/ensureContext.ts b/packages/platform/common/src/utils/ensureContext.ts index 9f20053c600..1bf03c1d84a 100644 --- a/packages/platform/common/src/utils/ensureContext.ts +++ b/packages/platform/common/src/utils/ensureContext.ts @@ -1,6 +1,6 @@ import {getContext} from "@tsed/di"; -import {PlatformContext} from "../domain/PlatformContext.js"; +import type {PlatformContext} from "../domain/PlatformContext.js"; export function ensureContext(request: any, cb: ($ctx: PlatformContext) => any, fallback?: () => void) { const $ctx = getContext(); diff --git a/packages/platform/common/src/utils/getConfiguration.ts b/packages/platform/common/src/utils/getConfiguration.ts index ee76b42871f..d0cc065fffc 100644 --- a/packages/platform/common/src/utils/getConfiguration.ts +++ b/packages/platform/common/src/utils/getConfiguration.ts @@ -1,4 +1,5 @@ -import {Env, Store, Type} from "@tsed/core"; +import type {Type} from "@tsed/core"; +import {Env, Store} from "@tsed/core"; import {mergeMount, ProviderScope, ProviderType} from "@tsed/di"; export function getConfiguration(configuration: any = {}, module: Type | null = null) { diff --git a/packages/platform/common/src/utils/getStaticsOptions.ts b/packages/platform/common/src/utils/getStaticsOptions.ts index 640ea6e8b5e..3eefb47fb21 100644 --- a/packages/platform/common/src/utils/getStaticsOptions.ts +++ b/packages/platform/common/src/utils/getStaticsOptions.ts @@ -1,6 +1,6 @@ import {getValue} from "@tsed/core"; -import {PlatformStaticsOptions, PlatformStaticsSettings} from "../config/interfaces/PlatformStaticsSettings.js"; +import type {PlatformStaticsOptions, PlatformStaticsSettings} from "../config/interfaces/PlatformStaticsSettings.js"; function mapOptions(options: any): any { const opts: PlatformStaticsOptions = typeof options === "string" ? {root: options} : options; diff --git a/packages/platform/common/src/utils/listenServer.ts b/packages/platform/common/src/utils/listenServer.ts index 41603e43710..1031f99c648 100644 --- a/packages/platform/common/src/utils/listenServer.ts +++ b/packages/platform/common/src/utils/listenServer.ts @@ -1,4 +1,4 @@ -import {getHostInfoFromPort} from "@tsed/core"; +import type {getHostInfoFromPort} from "@tsed/core"; import type Http from "http"; import type Http2 from "http2"; import type Https from "https"; diff --git a/packages/platform/common/src/utils/printRoutes.ts b/packages/platform/common/src/utils/printRoutes.ts index 83e6b026d67..688b15a405c 100644 --- a/packages/platform/common/src/utils/printRoutes.ts +++ b/packages/platform/common/src/utils/printRoutes.ts @@ -1,6 +1,6 @@ import {$log, colorize} from "@tsed/logger"; -import {PlatformRouteDetails} from "../domain/PlatformRouteDetails.js"; +import type {PlatformRouteDetails} from "../domain/PlatformRouteDetails.js"; export function printRoutes(routes: PlatformRouteDetails[]) { const mapColor: {[key: string]: string} = { diff --git a/packages/platform/common/src/utils/registerPlatformAdapter.ts b/packages/platform/common/src/utils/registerPlatformAdapter.ts index ef394741807..69371bdf506 100644 --- a/packages/platform/common/src/utils/registerPlatformAdapter.ts +++ b/packages/platform/common/src/utils/registerPlatformAdapter.ts @@ -1,7 +1,7 @@ -import {Type} from "@tsed/core"; +import type {Type} from "@tsed/core"; import {PlatformBuilder} from "../builder/PlatformBuilder.js"; -import {PlatformAdapter} from "../services/PlatformAdapter.js"; +import type {PlatformAdapter} from "../services/PlatformAdapter.js"; import {PlatformTest} from "../services/PlatformTest.js"; export function registerPlatformAdapter(adapter: Type>) { diff --git a/packages/platform/common/src/utils/setResponseHeaders.ts b/packages/platform/common/src/utils/setResponseHeaders.ts index e45aeec7a98..041e45b8f99 100644 --- a/packages/platform/common/src/utils/setResponseHeaders.ts +++ b/packages/platform/common/src/utils/setResponseHeaders.ts @@ -1,4 +1,4 @@ -import {PlatformContext} from "../domain/PlatformContext.js"; +import type {PlatformContext} from "../domain/PlatformContext.js"; /** * @ignore diff --git a/packages/platform/common/tsconfig.esm.json b/packages/platform/common/tsconfig.esm.json index 82292550ddb..8954049da4a 100644 --- a/packages/platform/common/tsconfig.esm.json +++ b/packages/platform/common/tsconfig.esm.json @@ -2,7 +2,6 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", diff --git a/packages/platform/common/tsconfig.spec.json b/packages/platform/common/tsconfig.spec.json index 974b8893abe..c08be4fe255 100644 --- a/packages/platform/common/tsconfig.spec.json +++ b/packages/platform/common/tsconfig.spec.json @@ -3,30 +3,30 @@ "compilerOptions": { "baseUrl": ".", "rootDir": "../..", - "outDir": "./lib/cjs", "declaration": false, "composite": false, "noEmit": true, "paths": { - "@tsed/openspec": ["../../specs/openspec/src"], - "@tsed/schema": ["../../specs/schema/src"], - "@tsed/di": ["../../di/src"], - "@tsed/exceptions": ["../../specs/exceptions/src"], - "@tsed/json-mapper": ["../../specs/json-mapper/src"], - "@tsed/platform-exceptions": ["../platform-exceptions/src"], - "@tsed/platform-middlewares": ["../platform-middlewares/src"], - "@tsed/platform-params": ["../platform-params/src"], - "@tsed/platform-log-middleware": ["../platform-log-middleware/src"], - "@tsed/platform-response-filter": ["../platform-response-filter/src"], - "@tsed/platform-router": ["../platform-router/src"], - "@tsed/platform-views": ["../platform-views/src"], - "@tsed/components-scan": ["../../third-parties/components-scan/src"], - "@tsed/ajv": ["../../specs/ajv/src"], - "@tsed/platform-cache": ["../platform-cache/src"], - "@tsed/swagger": ["../../specs/swagger/src"], - "@tsed/platform-test-sdk": ["../platform-test-sdk/src"], - "@tsed/platform-express": ["../platform-express/src"], - "@tsed/platform-koa": ["../platform-koa/src"] + "@tsed/openspec": ["../../specs/openspec/src/index.ts"], + "@tsed/schema": ["../../specs/schema/src/index.ts"], + "@tsed/di": ["../../di/src/index.ts"], + "@tsed/exceptions": ["../../specs/exceptions/src/index.ts"], + "@tsed/json-mapper": ["../../specs/json-mapper/src/index.ts"], + "@tsed/platform-exceptions": ["../platform-exceptions/src/index.ts"], + "@tsed/platform-middlewares": ["../platform-middlewares/src/index.ts"], + "@tsed/platform-params": ["../platform-params/src/index.ts"], + "@tsed/platform-log-middleware": ["../platform-log-middleware/src/index.ts"], + "@tsed/platform-response-filter": ["../platform-response-filter/src/index.ts"], + "@tsed/platform-router": ["../platform-router/src/index.ts"], + "@tsed/platform-views": ["../platform-views/src/index.ts"], + "@tsed/normalize-path": ["../../utils/normalize-path/src/index.ts"], + "@tsed/components-scan": ["../../third-parties/components-scan/src/index.ts"], + "@tsed/ajv": ["../../specs/ajv/src/index.ts"], + "@tsed/platform-cache": ["../platform-cache/src/index.ts"], + "@tsed/swagger": ["../../specs/swagger/src/index.ts"], + "@tsed/platform-test-sdk": ["../platform-test-sdk/src/index.ts"], + "@tsed/platform-express": ["../platform-express/src/index.ts"], + "@tsed/platform-koa": ["../platform-koa/src/index.ts"] }, "types": ["vite/client", "vitest/globals"] }, diff --git a/packages/platform/common/vitest.config.mts b/packages/platform/common/vitest.config.mts index 7181b38bd55..efdda8d63a7 100644 --- a/packages/platform/common/vitest.config.mts +++ b/packages/platform/common/vitest.config.mts @@ -10,10 +10,10 @@ export default defineConfig( coverage: { ...presets.test.coverage, thresholds: { - statements: 97.02, + statements: 97.01, branches: 90.74, functions: 94.89, - lines: 97.02 + lines: 97.01 } } } diff --git a/packages/platform/platform-cache/package.json b/packages/platform/platform-cache/package.json index 7cc9de03b57..919a71f8e03 100644 --- a/packages/platform/platform-cache/package.json +++ b/packages/platform/platform-cache/package.json @@ -11,7 +11,7 @@ ".": { "types": "./lib/types/index.d.ts", "import": "./lib/esm/index.js", - "default": "./lib/cjs/index.js" + "default": "./lib/esm/index.js" } }, "scripts": { diff --git a/packages/platform/platform-cache/src/decorators/useCache.ts b/packages/platform/platform-cache/src/decorators/useCache.ts index e9e192dc6f8..d541a088932 100644 --- a/packages/platform/platform-cache/src/decorators/useCache.ts +++ b/packages/platform/platform-cache/src/decorators/useCache.ts @@ -1,7 +1,7 @@ import {Intercept} from "@tsed/di"; import {PlatformCacheInterceptor} from "../interceptors/PlatformCacheInterceptor.js"; -import {PlatformCacheOptions} from "../interfaces/PlatformCacheOptions.js"; +import type {PlatformCacheOptions} from "../interfaces/PlatformCacheOptions.js"; export function UseCache(options: PlatformCacheOptions = {}) { return Intercept(PlatformCacheInterceptor, options); diff --git a/packages/platform/platform-cache/src/interceptors/PlatformCacheInterceptor.ts b/packages/platform/platform-cache/src/interceptors/PlatformCacheInterceptor.ts index b3d50fcce07..6815f7f61fd 100644 --- a/packages/platform/platform-cache/src/interceptors/PlatformCacheInterceptor.ts +++ b/packages/platform/platform-cache/src/interceptors/PlatformCacheInterceptor.ts @@ -1,11 +1,12 @@ import {isClass, isString, nameOf} from "@tsed/core"; -import {BaseContext, Constant, DIContext, Inject, Interceptor, InterceptorContext, InterceptorMethods, InterceptorNext} from "@tsed/di"; +import type {BaseContext, InterceptorContext, InterceptorMethods, InterceptorNext} from "@tsed/di"; +import {Constant, DIContext, Inject, Interceptor} 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"; +import type {PlatformCachedObject} from "../interfaces/PlatformCachedObject.js"; +import type {PlatformCacheOptions} from "../interfaces/PlatformCacheOptions.js"; import {PlatformCache} from "../services/PlatformCache.js"; import {getPrefix} from "../utils/getPrefix.js"; import {isEndpoint} from "../utils/isEndpoint.js"; @@ -25,10 +26,10 @@ const cleanHeaders = (headers: Record, blacklist: string[]) => */ @Interceptor() export class PlatformCacheInterceptor implements InterceptorMethods { - @Inject() + @Inject(PlatformCache) protected cache: PlatformCache; - @Inject() + @Inject(Logger) protected logger: Logger; @Constant("cache.prefix", "") diff --git a/packages/platform/platform-cache/src/interfaces/PlatformCacheOptions.ts b/packages/platform/platform-cache/src/interfaces/PlatformCacheOptions.ts index 94a6cc53f91..70eb72f2838 100644 --- a/packages/platform/platform-cache/src/interfaces/PlatformCacheOptions.ts +++ b/packages/platform/platform-cache/src/interfaces/PlatformCacheOptions.ts @@ -1,5 +1,5 @@ -import {MetadataTypes} from "@tsed/core"; -import {BaseContext} from "@tsed/di"; +import type {MetadataTypes} from "@tsed/core"; +import type {BaseContext} from "@tsed/di"; import type {Ttl} from "../services/PlatformCache.js"; diff --git a/packages/platform/platform-cache/src/services/PlatformCache.ts b/packages/platform/platform-cache/src/services/PlatformCache.ts index 7ce62faafd6..57c915e24c9 100644 --- a/packages/platform/platform-cache/src/services/PlatformCache.ts +++ b/packages/platform/platform-cache/src/services/PlatformCache.ts @@ -1,12 +1,15 @@ -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 type {Type} from "@tsed/core"; +import {isClass, isFunction, isString} from "@tsed/core"; +import {InjectorService} from "@tsed/di"; +import {Configuration, Inject, Module} from "@tsed/di"; +import type {JsonDeserializerOptions} from "@tsed/json-mapper"; +import {deserialize, 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"; -import {PlatformCachedObject} from "../interfaces/PlatformCachedObject.js"; +import type {PlatformCacheSettings} from "../interfaces/interfaces.js"; +import type {PlatformCachedObject} from "../interfaces/PlatformCachedObject.js"; import {getPrefix} from "../utils/getPrefix.js"; const defaultKeyResolver = (args: any[]) => { @@ -26,10 +29,10 @@ export class PlatformCache { @Configuration() protected settings: Configuration; - @Inject() + @Inject(InjectorService) protected injector: InjectorService; - @Inject() + @Inject(Logger) protected logger: Logger; #cache: CacheManager | undefined; diff --git a/packages/platform/platform-cache/src/utils/getPrefix.ts b/packages/platform/platform-cache/src/utils/getPrefix.ts index 189f1ff53b2..67e55a165f8 100644 --- a/packages/platform/platform-cache/src/utils/getPrefix.ts +++ b/packages/platform/platform-cache/src/utils/getPrefix.ts @@ -1,4 +1,5 @@ -import {nameOf, Type} from "@tsed/core"; +import type {Type} from "@tsed/core"; +import {nameOf} from "@tsed/core"; import {getInterceptorOptions} from "@tsed/di"; import type {PlatformCacheOptions} from "../interfaces/PlatformCacheOptions.js"; diff --git a/packages/platform/platform-cache/src/utils/isEndpoint.ts b/packages/platform/platform-cache/src/utils/isEndpoint.ts index a0e1537bded..3c901055f5a 100644 --- a/packages/platform/platform-cache/src/utils/isEndpoint.ts +++ b/packages/platform/platform-cache/src/utils/isEndpoint.ts @@ -1,4 +1,5 @@ -import {Store, Type} from "@tsed/core"; +import type {Type} from "@tsed/core"; +import {Store} from "@tsed/core"; import {JsonEntityStore} from "@tsed/schema"; export function isEndpoint(target: Type, propertyKey: string | symbol) { diff --git a/packages/platform/platform-cache/tsconfig.esm.json b/packages/platform/platform-cache/tsconfig.esm.json index 82292550ddb..8954049da4a 100644 --- a/packages/platform/platform-cache/tsconfig.esm.json +++ b/packages/platform/platform-cache/tsconfig.esm.json @@ -2,7 +2,6 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", diff --git a/packages/platform/platform-cache/tsconfig.spec.json b/packages/platform/platform-cache/tsconfig.spec.json index 4d23ed17f17..36e8e062ce1 100644 --- a/packages/platform/platform-cache/tsconfig.spec.json +++ b/packages/platform/platform-cache/tsconfig.spec.json @@ -3,30 +3,30 @@ "compilerOptions": { "baseUrl": ".", "rootDir": "../..", - "outDir": "./lib/cjs", "declaration": false, "composite": false, "noEmit": true, "paths": { - "@tsed/openspec": ["../../specs/openspec/src"], - "@tsed/schema": ["../../specs/schema/src"], - "@tsed/di": ["../../di/src"], - "@tsed/exceptions": ["../../specs/exceptions/src"], - "@tsed/json-mapper": ["../../specs/json-mapper/src"], - "@tsed/platform-exceptions": ["../platform-exceptions/src"], - "@tsed/platform-middlewares": ["../platform-middlewares/src"], - "@tsed/platform-params": ["../platform-params/src"], - "@tsed/platform-log-middleware": ["../platform-log-middleware/src"], - "@tsed/platform-response-filter": ["../platform-response-filter/src"], - "@tsed/platform-router": ["../platform-router/src"], - "@tsed/platform-views": ["../platform-views/src"], - "@tsed/components-scan": ["../../third-parties/components-scan/src"], - "@tsed/common": ["../common/src"], - "@tsed/ajv": ["../../specs/ajv/src"], - "@tsed/swagger": ["../../specs/swagger/src"], - "@tsed/platform-test-sdk": ["../platform-test-sdk/src"], - "@tsed/platform-express": ["../platform-express/src"], - "@tsed/platform-koa": ["../platform-koa/src"] + "@tsed/openspec": ["../../specs/openspec/src/index.ts"], + "@tsed/schema": ["../../specs/schema/src/index.ts"], + "@tsed/di": ["../../di/src/index.ts"], + "@tsed/exceptions": ["../../specs/exceptions/src/index.ts"], + "@tsed/json-mapper": ["../../specs/json-mapper/src/index.ts"], + "@tsed/platform-exceptions": ["../platform-exceptions/src/index.ts"], + "@tsed/platform-middlewares": ["../platform-middlewares/src/index.ts"], + "@tsed/platform-params": ["../platform-params/src/index.ts"], + "@tsed/platform-log-middleware": ["../platform-log-middleware/src/index.ts"], + "@tsed/platform-response-filter": ["../platform-response-filter/src/index.ts"], + "@tsed/platform-router": ["../platform-router/src/index.ts"], + "@tsed/platform-views": ["../platform-views/src/index.ts"], + "@tsed/normalize-path": ["../../utils/normalize-path/src/index.ts"], + "@tsed/components-scan": ["../../third-parties/components-scan/src/index.ts"], + "@tsed/common": ["../common/src/index.ts"], + "@tsed/ajv": ["../../specs/ajv/src/index.ts"], + "@tsed/swagger": ["../../specs/swagger/src/index.ts"], + "@tsed/platform-test-sdk": ["../platform-test-sdk/src/index.ts"], + "@tsed/platform-express": ["../platform-express/src/index.ts"], + "@tsed/platform-koa": ["../platform-koa/src/index.ts"] }, "types": ["vite/client", "vitest/globals"] }, diff --git a/packages/platform/platform-exceptions/package.json b/packages/platform/platform-exceptions/package.json index a7ef3cdee23..2cede5e0f37 100644 --- a/packages/platform/platform-exceptions/package.json +++ b/packages/platform/platform-exceptions/package.json @@ -11,7 +11,7 @@ ".": { "types": "./lib/types/index.d.ts", "import": "./lib/esm/index.js", - "default": "./lib/cjs/index.js" + "default": "./lib/esm/index.js" } }, "scripts": { diff --git a/packages/platform/platform-exceptions/src/components/ErrorFilter.ts b/packages/platform/platform-exceptions/src/components/ErrorFilter.ts index 085a3f7f97e..705de3c490f 100644 --- a/packages/platform/platform-exceptions/src/components/ErrorFilter.ts +++ b/packages/platform/platform-exceptions/src/components/ErrorFilter.ts @@ -1,5 +1,5 @@ import {Env} from "@tsed/core"; -import {BaseContext} from "@tsed/di"; +import type {BaseContext} from "@tsed/di"; import {Catch} from "../decorators/catch.js"; import type {ExceptionFilterMethods} from "../interfaces/ExceptionFilterMethods.js"; diff --git a/packages/platform/platform-exceptions/src/components/ExceptionFilter.ts b/packages/platform/platform-exceptions/src/components/ExceptionFilter.ts index 09d7dba8800..7a566ae95a0 100644 --- a/packages/platform/platform-exceptions/src/components/ExceptionFilter.ts +++ b/packages/platform/platform-exceptions/src/components/ExceptionFilter.ts @@ -1,4 +1,4 @@ -import {BaseContext} from "@tsed/di"; +import type {BaseContext} from "@tsed/di"; import {Exception} from "@tsed/exceptions"; import {Catch} from "../decorators/catch.js"; diff --git a/packages/platform/platform-exceptions/src/components/MongooseErrorFilter.ts b/packages/platform/platform-exceptions/src/components/MongooseErrorFilter.ts index e170cb9777c..dc155b5468e 100644 --- a/packages/platform/platform-exceptions/src/components/MongooseErrorFilter.ts +++ b/packages/platform/platform-exceptions/src/components/MongooseErrorFilter.ts @@ -1,4 +1,4 @@ -import {BaseContext} from "@tsed/di"; +import type {BaseContext} from "@tsed/di"; import {BadRequest} from "@tsed/exceptions"; import {Catch} from "../decorators/catch.js"; diff --git a/packages/platform/platform-exceptions/src/components/StringErrorFilter.ts b/packages/platform/platform-exceptions/src/components/StringErrorFilter.ts index bf202616966..aaa770c0b71 100644 --- a/packages/platform/platform-exceptions/src/components/StringErrorFilter.ts +++ b/packages/platform/platform-exceptions/src/components/StringErrorFilter.ts @@ -1,4 +1,4 @@ -import {BaseContext} from "@tsed/di"; +import type {BaseContext} from "@tsed/di"; import {Catch} from "../decorators/catch.js"; import type {ExceptionFilterMethods} from "../interfaces/ExceptionFilterMethods.js"; diff --git a/packages/platform/platform-exceptions/src/decorators/catch.ts b/packages/platform/platform-exceptions/src/decorators/catch.ts index b31ef8443ea..113a729a850 100644 --- a/packages/platform/platform-exceptions/src/decorators/catch.ts +++ b/packages/platform/platform-exceptions/src/decorators/catch.ts @@ -1,4 +1,4 @@ -import {Type} from "@tsed/core"; +import type {Type} from "@tsed/core"; import {registerProvider} from "@tsed/di"; import {registerExceptionType} from "../domain/ExceptionFiltersContainer.js"; diff --git a/packages/platform/platform-exceptions/src/domain/ExceptionFiltersContainer.ts b/packages/platform/platform-exceptions/src/domain/ExceptionFiltersContainer.ts index e8a5ca1bb9d..9de2be753be 100644 --- a/packages/platform/platform-exceptions/src/domain/ExceptionFiltersContainer.ts +++ b/packages/platform/platform-exceptions/src/domain/ExceptionFiltersContainer.ts @@ -1,4 +1,4 @@ -import {Type} from "@tsed/core"; +import type {Type} from "@tsed/core"; import type {ExceptionFilterMethods} from "../interfaces/ExceptionFilterMethods.js"; /** diff --git a/packages/platform/platform-exceptions/src/interfaces/ExceptionFilterMethods.ts b/packages/platform/platform-exceptions/src/interfaces/ExceptionFilterMethods.ts index 1cc77b68a27..adffae36b0a 100644 --- a/packages/platform/platform-exceptions/src/interfaces/ExceptionFilterMethods.ts +++ b/packages/platform/platform-exceptions/src/interfaces/ExceptionFilterMethods.ts @@ -1,4 +1,4 @@ -import {DIContext} from "@tsed/di"; +import type {DIContext} from "@tsed/di"; export interface ExceptionFilterMethods { catch(error: T, ctx: DIContext): void; diff --git a/packages/platform/platform-exceptions/src/services/PlatformExceptions.ts b/packages/platform/platform-exceptions/src/services/PlatformExceptions.ts index 242256ed2cf..6bcc6ae4137 100644 --- a/packages/platform/platform-exceptions/src/services/PlatformExceptions.ts +++ b/packages/platform/platform-exceptions/src/services/PlatformExceptions.ts @@ -1,13 +1,14 @@ import {ancestorsOf, classOf, nameOf} from "@tsed/core"; -import {BaseContext, DIContext, Inject, Injectable, InjectorService} from "@tsed/di"; +import {type DIContext, Inject, Injectable, InjectorService} from "@tsed/di"; import {ErrorFilter} from "../components/ErrorFilter.js"; import {ExceptionFilter} from "../components/ExceptionFilter.js"; import {MongooseErrorFilter} from "../components/MongooseErrorFilter.js"; import {StringErrorFilter} from "../components/StringErrorFilter.js"; -import {ExceptionFilterKey, ExceptionFiltersContainer} from "../domain/ExceptionFiltersContainer.js"; +import type {ExceptionFilterKey} from "../domain/ExceptionFiltersContainer.js"; +import {ExceptionFiltersContainer} from "../domain/ExceptionFiltersContainer.js"; import {ResourceNotFound} from "../errors/ResourceNotFound.js"; -import {ExceptionFilterMethods} from "../interfaces/ExceptionFilterMethods.js"; +import type {ExceptionFilterMethods} from "../interfaces/ExceptionFilterMethods.js"; /** * Catch all errors and return the json error with the right status code when it's possible. @@ -20,7 +21,7 @@ import {ExceptionFilterMethods} from "../interfaces/ExceptionFilterMethods.js"; export class PlatformExceptions { types: Map = new Map(); - @Inject() + @Inject(InjectorService) injector: InjectorService; $onInit() { diff --git a/packages/platform/platform-exceptions/tsconfig.esm.json b/packages/platform/platform-exceptions/tsconfig.esm.json index 82292550ddb..8954049da4a 100644 --- a/packages/platform/platform-exceptions/tsconfig.esm.json +++ b/packages/platform/platform-exceptions/tsconfig.esm.json @@ -2,7 +2,6 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", diff --git a/packages/platform/platform-exceptions/tsconfig.spec.json b/packages/platform/platform-exceptions/tsconfig.spec.json index 78f0e04e468..50922d72d2c 100644 --- a/packages/platform/platform-exceptions/tsconfig.spec.json +++ b/packages/platform/platform-exceptions/tsconfig.spec.json @@ -3,30 +3,30 @@ "compilerOptions": { "baseUrl": ".", "rootDir": "../..", - "outDir": "./lib/cjs", "declaration": false, "composite": false, "noEmit": true, "paths": { - "@tsed/openspec": ["../../specs/openspec/src"], - "@tsed/schema": ["../../specs/schema/src"], - "@tsed/di": ["../../di/src"], - "@tsed/exceptions": ["../../specs/exceptions/src"], - "@tsed/json-mapper": ["../../specs/json-mapper/src"], - "@tsed/platform-middlewares": ["../platform-middlewares/src"], - "@tsed/platform-params": ["../platform-params/src"], - "@tsed/platform-log-middleware": ["../platform-log-middleware/src"], - "@tsed/platform-response-filter": ["../platform-response-filter/src"], - "@tsed/platform-router": ["../platform-router/src"], - "@tsed/platform-views": ["../platform-views/src"], - "@tsed/components-scan": ["../../third-parties/components-scan/src"], - "@tsed/common": ["../common/src"], - "@tsed/ajv": ["../../specs/ajv/src"], - "@tsed/platform-cache": ["../platform-cache/src"], - "@tsed/swagger": ["../../specs/swagger/src"], - "@tsed/platform-test-sdk": ["../platform-test-sdk/src"], - "@tsed/platform-express": ["../platform-express/src"], - "@tsed/platform-koa": ["../platform-koa/src"] + "@tsed/openspec": ["../../specs/openspec/src/index.ts"], + "@tsed/schema": ["../../specs/schema/src/index.ts"], + "@tsed/di": ["../../di/src/index.ts"], + "@tsed/exceptions": ["../../specs/exceptions/src/index.ts"], + "@tsed/json-mapper": ["../../specs/json-mapper/src/index.ts"], + "@tsed/platform-middlewares": ["../platform-middlewares/src/index.ts"], + "@tsed/platform-params": ["../platform-params/src/index.ts"], + "@tsed/platform-log-middleware": ["../platform-log-middleware/src/index.ts"], + "@tsed/platform-response-filter": ["../platform-response-filter/src/index.ts"], + "@tsed/platform-router": ["../platform-router/src/index.ts"], + "@tsed/platform-views": ["../platform-views/src/index.ts"], + "@tsed/normalize-path": ["../../utils/normalize-path/src/index.ts"], + "@tsed/components-scan": ["../../third-parties/components-scan/src/index.ts"], + "@tsed/common": ["../common/src/index.ts"], + "@tsed/ajv": ["../../specs/ajv/src/index.ts"], + "@tsed/platform-cache": ["../platform-cache/src/index.ts"], + "@tsed/swagger": ["../../specs/swagger/src/index.ts"], + "@tsed/platform-test-sdk": ["../platform-test-sdk/src/index.ts"], + "@tsed/platform-express": ["../platform-express/src/index.ts"], + "@tsed/platform-koa": ["../platform-koa/src/index.ts"] }, "types": ["vite/client", "vitest/globals"] }, diff --git a/packages/platform/platform-express/package.json b/packages/platform/platform-express/package.json index 4767039226e..a11895cfae3 100644 --- a/packages/platform/platform-express/package.json +++ b/packages/platform/platform-express/package.json @@ -11,7 +11,7 @@ ".": { "types": "./lib/types/index.d.ts", "import": "./lib/esm/index.js", - "default": "./lib/cjs/index.js" + "default": "./lib/esm/index.js" } }, "scripts": { diff --git a/packages/platform/platform-express/src/components/PlatformExpress.ts b/packages/platform/platform-express/src/components/PlatformExpress.ts index 40f4c101095..b1d45690b67 100644 --- a/packages/platform/platform-express/src/components/PlatformExpress.ts +++ b/packages/platform/platform-express/src/components/PlatformExpress.ts @@ -1,28 +1,25 @@ +import type {InjectorService, PlatformContext, PlatformMulter, PlatformMulterSettings, PlatformStaticsOptions} from "@tsed/common"; import { createContext, - InjectorService, PlatformAdapter, PlatformBuilder, - PlatformContext, PlatformExceptions, PlatformHandler, PlatformHandlerType, - PlatformMulter, - PlatformMulterSettings, PlatformProvider, - PlatformStaticsOptions, runInContext } from "@tsed/common"; -import {catchAsyncError, Env, isFunction, Type} from "@tsed/core"; -import {PlatformHandlerMetadata, PlatformLayer} from "@tsed/platform-router"; +import type {Type} from "@tsed/core"; +import {catchAsyncError, Env, isFunction} from "@tsed/core"; +import type {PlatformHandlerMetadata, PlatformLayer} from "@tsed/platform-router"; import type {PlatformViews} from "@tsed/platform-views"; -import {OptionsJson, OptionsText, OptionsUrlencoded} from "body-parser"; +import type {OptionsJson, OptionsText, OptionsUrlencoded} from "body-parser"; import Express from "express"; -import {IncomingMessage, ServerResponse} from "http"; +import type {IncomingMessage, ServerResponse} from "http"; import type multer from "multer"; import {promisify} from "util"; -import {PlatformExpressStaticsOptions} from "../interfaces/PlatformExpressStaticsOptions.js"; +import type {PlatformExpressStaticsOptions} from "../interfaces/PlatformExpressStaticsOptions.js"; import {staticsMiddleware} from "../middlewares/staticsMiddleware.js"; import {PlatformExpressHandler} from "../services/PlatformExpressHandler.js"; diff --git a/packages/platform/platform-express/src/interfaces/PlatformExpressStaticsOptions.ts b/packages/platform/platform-express/src/interfaces/PlatformExpressStaticsOptions.ts index 0cfa217702b..0e2170108c2 100644 --- a/packages/platform/platform-express/src/interfaces/PlatformExpressStaticsOptions.ts +++ b/packages/platform/platform-express/src/interfaces/PlatformExpressStaticsOptions.ts @@ -1,4 +1,4 @@ -import Express from "express"; +import type Express from "express"; export interface PlatformExpressStaticsOptions { /** diff --git a/packages/platform/platform-express/src/interfaces/interfaces.ts b/packages/platform/platform-express/src/interfaces/interfaces.ts index 48fe40c793d..d223ab3cd41 100644 --- a/packages/platform/platform-express/src/interfaces/interfaces.ts +++ b/packages/platform/platform-express/src/interfaces/interfaces.ts @@ -1,6 +1,6 @@ -import {NextFunction as ENext, Request as EReq, Response as ERes} from "express"; +import type {NextFunction as ENext, Request as EReq, Response as ERes} from "express"; -import {PlatformExpressSettings} from "./PlatformExpressSettings.js"; +import type {PlatformExpressSettings} from "./PlatformExpressSettings.js"; declare global { namespace TsED { diff --git a/packages/platform/platform-express/src/services/PlatformExpressHandler.ts b/packages/platform/platform-express/src/services/PlatformExpressHandler.ts index 4bbdc64569a..756ccff9f8b 100644 --- a/packages/platform/platform-express/src/services/PlatformExpressHandler.ts +++ b/packages/platform/platform-express/src/services/PlatformExpressHandler.ts @@ -1,5 +1,7 @@ -import {PlatformContext, PlatformHandler} from "@tsed/common"; -import {AnyPromiseResult, isFunction, isStream} from "@tsed/core"; +import type {PlatformContext} from "@tsed/common"; +import {PlatformHandler} from "@tsed/common"; +import type {AnyPromiseResult} from "@tsed/core"; +import {isFunction, isStream} from "@tsed/core"; import {promisify} from "util"; export class PlatformExpressHandler extends PlatformHandler { diff --git a/packages/platform/platform-express/test/app/Server.ts b/packages/platform/platform-express/test/app/Server.ts index 777d414170d..9b36a9760b8 100644 --- a/packages/platform/platform-express/test/app/Server.ts +++ b/packages/platform/platform-express/test/app/Server.ts @@ -1,10 +1,11 @@ import "@tsed/ajv"; import "../../src/index.js"; -import {Constant, PlatformApplication} from "@tsed/common"; +import {PlatformApplication} from "@tsed/common"; +import {Constant} from "@tsed/common"; import {Configuration, Inject} from "@tsed/di"; import compress from "compression"; -import {Application} from "express"; +import type {Application} from "express"; import session from "express-session"; const rootDir = import.meta.dirname; @@ -50,7 +51,7 @@ export {rootDir}; ] }) export class Server { - @Inject() + @Inject(PlatformApplication) app: PlatformApplication; @Constant("viewsDir") diff --git a/packages/platform/platform-express/test/app/index.ts b/packages/platform/platform-express/test/app/index.ts index 464d80698e2..8cea9b6f0f6 100644 --- a/packages/platform/platform-express/test/app/index.ts +++ b/packages/platform/platform-express/test/app/index.ts @@ -1,6 +1,8 @@ -import {$log, BodyParams, Controller, Get, PlatformResponse, Post, QueryParams, Res} from "@tsed/common"; +import type {PlatformResponse} from "@tsed/common"; +import {$log, BodyParams, Controller, Get, Post, QueryParams, Res} from "@tsed/common"; import {Returns} from "@tsed/schema"; -import {agent, SuperAgentStatic} from "superagent"; +import type {SuperAgentStatic} from "superagent"; +import {agent} from "superagent"; import {promisify} from "util"; import {PlatformExpress} from "../../src/index.js"; diff --git a/packages/platform/platform-express/test/pageable.spec.ts b/packages/platform/platform-express/test/pageable.spec.ts index cdcd7259dad..1107536646f 100644 --- a/packages/platform/platform-express/test/pageable.spec.ts +++ b/packages/platform/platform-express/test/pageable.spec.ts @@ -1,4 +1,5 @@ -import {Controller, Get, PlatformContext, PlatformTest, QueryParams, ResponseFilter, ResponseFilterMethods} from "@tsed/common"; +import type {PlatformContext, ResponseFilterMethods} from "@tsed/common"; +import {Controller, Get, PlatformTest, QueryParams, ResponseFilter} from "@tsed/common"; import {isString} from "@tsed/core"; import {OnDeserialize} from "@tsed/json-mapper"; import {PlatformTestSdk} from "@tsed/platform-test-sdk"; diff --git a/packages/platform/platform-express/test/query-parser.spec.ts b/packages/platform/platform-express/test/query-parser.spec.ts index 67e534de06a..b97e7d7317a 100644 --- a/packages/platform/platform-express/test/query-parser.spec.ts +++ b/packages/platform/platform-express/test/query-parser.spec.ts @@ -1,5 +1,7 @@ -import {Configuration, Controller, Get, Inject, PlatformApplication, PlatformTest, QueryParams} from "@tsed/common"; +import {Controller, PlatformApplication, PlatformTest, QueryParams} from "@tsed/common"; +import {Configuration, Inject} from "@tsed/di"; import {PlatformTestSdk} from "@tsed/platform-test-sdk"; +import {Get} from "@tsed/schema"; import {parse} from "querystring"; import SuperTest from "supertest"; @@ -10,7 +12,7 @@ import {rootDir} from "./app/Server.js"; port: 8081 }) class CustomServer { - @Inject() + @Inject(PlatformApplication) app: PlatformApplication; $onInit() { diff --git a/packages/platform/platform-express/test/response-filter.spec.ts b/packages/platform/platform-express/test/response-filter.spec.ts index 94626bceca5..9c781898ac8 100644 --- a/packages/platform/platform-express/test/response-filter.spec.ts +++ b/packages/platform/platform-express/test/response-filter.spec.ts @@ -1,7 +1,8 @@ -import {Context, Controller, Get, PlatformTest, Res, ResponseFilter} from "@tsed/common"; +import type {Context} from "@tsed/common"; +import {Controller, Get, PlatformTest, Res, ResponseFilter} from "@tsed/common"; import {PlatformTestSdk} from "@tsed/platform-test-sdk"; import {Returns} from "@tsed/schema"; -import {ServerResponse} from "http"; +import type {ServerResponse} from "http"; import SuperTest from "supertest"; import {PlatformExpress} from "../src/index.js"; diff --git a/packages/platform/platform-express/tsconfig.esm.json b/packages/platform/platform-express/tsconfig.esm.json index 82292550ddb..8954049da4a 100644 --- a/packages/platform/platform-express/tsconfig.esm.json +++ b/packages/platform/platform-express/tsconfig.esm.json @@ -2,7 +2,6 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", diff --git a/packages/platform/platform-express/tsconfig.spec.json b/packages/platform/platform-express/tsconfig.spec.json index 33a5d9b533f..fa9c4e135e6 100644 --- a/packages/platform/platform-express/tsconfig.spec.json +++ b/packages/platform/platform-express/tsconfig.spec.json @@ -3,30 +3,30 @@ "compilerOptions": { "baseUrl": ".", "rootDir": "../..", - "outDir": "./lib/cjs", "declaration": false, "composite": false, "noEmit": true, "paths": { - "@tsed/openspec": ["../../specs/openspec/src"], - "@tsed/schema": ["../../specs/schema/src"], - "@tsed/di": ["../../di/src"], - "@tsed/exceptions": ["../../specs/exceptions/src"], - "@tsed/json-mapper": ["../../specs/json-mapper/src"], - "@tsed/platform-exceptions": ["../platform-exceptions/src"], - "@tsed/platform-middlewares": ["../platform-middlewares/src"], - "@tsed/platform-params": ["../platform-params/src"], - "@tsed/platform-log-middleware": ["../platform-log-middleware/src"], - "@tsed/platform-response-filter": ["../platform-response-filter/src"], - "@tsed/platform-router": ["../platform-router/src"], - "@tsed/platform-views": ["../platform-views/src"], - "@tsed/components-scan": ["../../third-parties/components-scan/src"], - "@tsed/common": ["../common/src"], - "@tsed/ajv": ["../../specs/ajv/src"], - "@tsed/platform-cache": ["../platform-cache/src"], - "@tsed/swagger": ["../../specs/swagger/src"], - "@tsed/platform-test-sdk": ["../platform-test-sdk/src"], - "@tsed/platform-koa": ["../platform-koa/src"] + "@tsed/openspec": ["../../specs/openspec/src/index.ts"], + "@tsed/schema": ["../../specs/schema/src/index.ts"], + "@tsed/di": ["../../di/src/index.ts"], + "@tsed/exceptions": ["../../specs/exceptions/src/index.ts"], + "@tsed/json-mapper": ["../../specs/json-mapper/src/index.ts"], + "@tsed/platform-exceptions": ["../platform-exceptions/src/index.ts"], + "@tsed/platform-middlewares": ["../platform-middlewares/src/index.ts"], + "@tsed/platform-params": ["../platform-params/src/index.ts"], + "@tsed/platform-log-middleware": ["../platform-log-middleware/src/index.ts"], + "@tsed/platform-response-filter": ["../platform-response-filter/src/index.ts"], + "@tsed/platform-router": ["../platform-router/src/index.ts"], + "@tsed/platform-views": ["../platform-views/src/index.ts"], + "@tsed/normalize-path": ["../../utils/normalize-path/src/index.ts"], + "@tsed/components-scan": ["../../third-parties/components-scan/src/index.ts"], + "@tsed/common": ["../common/src/index.ts"], + "@tsed/ajv": ["../../specs/ajv/src/index.ts"], + "@tsed/platform-cache": ["../platform-cache/src/index.ts"], + "@tsed/swagger": ["../../specs/swagger/src/index.ts"], + "@tsed/platform-test-sdk": ["../platform-test-sdk/src/index.ts"], + "@tsed/platform-koa": ["../platform-koa/src/index.ts"] }, "types": ["vite/client", "vitest/globals"] }, diff --git a/packages/platform/platform-koa/package.json b/packages/platform/platform-koa/package.json index 8d51d53fbad..9452b37296b 100644 --- a/packages/platform/platform-koa/package.json +++ b/packages/platform/platform-koa/package.json @@ -11,7 +11,7 @@ ".": { "types": "./lib/types/index.d.ts", "import": "./lib/esm/index.js", - "default": "./lib/cjs/index.js" + "default": "./lib/esm/index.js" } }, "scripts": { diff --git a/packages/platform/platform-koa/src/components/PlatformKoa.ts b/packages/platform/platform-koa/src/components/PlatformKoa.ts index 860a4eca7d2..aa253b18cad 100644 --- a/packages/platform/platform-koa/src/components/PlatformKoa.ts +++ b/packages/platform/platform-koa/src/components/PlatformKoa.ts @@ -1,25 +1,27 @@ import KoaRouter from "@koa/router"; +import type {PlatformMulter, PlatformMulterSettings, PlatformStaticsOptions} from "@tsed/common"; import { createContext, PlatformAdapter, PlatformBuilder, PlatformHandler, - PlatformMulter, - PlatformMulterSettings, PlatformProvider, PlatformRequest, PlatformResponse, - PlatformStaticsOptions, runInContext } from "@tsed/common"; -import {catchAsyncError, isFunction, Type} from "@tsed/core"; +import type {Type} from "@tsed/core"; +import {catchAsyncError, isFunction} from "@tsed/core"; import {PlatformExceptions} from "@tsed/platform-exceptions"; -import {PlatformHandlerMetadata, PlatformHandlerType, PlatformLayer} from "@tsed/platform-router"; -import Koa, {Context, Next} from "koa"; -import koaBodyParser, {Options} from "koa-bodyparser"; +import type {PlatformHandlerMetadata, PlatformLayer} from "@tsed/platform-router"; +import {PlatformHandlerType} from "@tsed/platform-router"; +import type {Context, Next} from "koa"; +import Koa from "koa"; +import type {Options} from "koa-bodyparser"; +import koaBodyParser from "koa-bodyparser"; // @ts-ignore import koaQs from "koa-qs"; -import send from "koa-send"; +import type send from "koa-send"; import {staticsMiddleware} from "../middlewares/staticsMiddleware.js"; import {PlatformKoaHandler} from "../services/PlatformKoaHandler.js"; diff --git a/packages/platform/platform-koa/src/interfaces/interfaces.ts b/packages/platform/platform-koa/src/interfaces/interfaces.ts index 7ac39312fc4..3f1273057e9 100644 --- a/packages/platform/platform-koa/src/interfaces/interfaces.ts +++ b/packages/platform/platform-koa/src/interfaces/interfaces.ts @@ -1,6 +1,6 @@ -import Koa from "koa"; +import type Koa from "koa"; -import {PlatformKoaSettings} from "./PlatformKoaSettings.js"; +import type {PlatformKoaSettings} from "./PlatformKoaSettings.js"; export * from "./PlatformKoaSettings.js"; diff --git a/packages/platform/platform-koa/src/middlewares/staticsMiddleware.ts b/packages/platform/platform-koa/src/middlewares/staticsMiddleware.ts index c111bf03ac9..62fa3ba9350 100644 --- a/packages/platform/platform-koa/src/middlewares/staticsMiddleware.ts +++ b/packages/platform/platform-koa/src/middlewares/staticsMiddleware.ts @@ -1,4 +1,4 @@ -import {PlatformStaticsOptions} from "@tsed/common"; +import type {PlatformStaticsOptions} from "@tsed/common"; import type {Context} from "koa"; import send from "koa-send"; diff --git a/packages/platform/platform-koa/src/services/PlatformKoaHandler.ts b/packages/platform/platform-koa/src/services/PlatformKoaHandler.ts index 3d556a6df25..fedfbd9a909 100644 --- a/packages/platform/platform-koa/src/services/PlatformKoaHandler.ts +++ b/packages/platform/platform-koa/src/services/PlatformKoaHandler.ts @@ -1,6 +1,7 @@ import "./PlatformKoaRequest.js"; -import {PlatformContext, PlatformHandler, PlatformParamsCallback} from "@tsed/common"; +import type {PlatformContext, PlatformParamsCallback} from "@tsed/common"; +import {PlatformHandler} from "@tsed/common"; export class PlatformKoaHandler extends PlatformHandler { onRequest(handler: PlatformParamsCallback, $ctx: PlatformContext) { diff --git a/packages/platform/platform-koa/src/services/PlatformKoaRequest.ts b/packages/platform/platform-koa/src/services/PlatformKoaRequest.ts index 480094af204..6a4119a3314 100644 --- a/packages/platform/platform-koa/src/services/PlatformKoaRequest.ts +++ b/packages/platform/platform-koa/src/services/PlatformKoaRequest.ts @@ -1,7 +1,8 @@ import "@koa/router"; -import {PlatformContext, PlatformRequest} from "@tsed/common"; -import Koa from "koa"; +import type {PlatformContext} from "@tsed/common"; +import {PlatformRequest} from "@tsed/common"; +import type Koa from "koa"; declare module "koa" { export interface Request { diff --git a/packages/platform/platform-koa/src/services/PlatformKoaResponse.ts b/packages/platform/platform-koa/src/services/PlatformKoaResponse.ts index 0712fba47e6..4b8c941538a 100644 --- a/packages/platform/platform-koa/src/services/PlatformKoaResponse.ts +++ b/packages/platform/platform-koa/src/services/PlatformKoaResponse.ts @@ -1,6 +1,6 @@ import {PlatformResponse} from "@tsed/common"; -import {ServerResponse} from "http"; -import Koa from "koa"; +import type {ServerResponse} from "http"; +import type Koa from "koa"; declare global { namespace TsED { diff --git a/packages/platform/platform-koa/src/utils/multer.ts b/packages/platform/platform-koa/src/utils/multer.ts index 89ae7709f9c..f55565e373d 100644 --- a/packages/platform/platform-koa/src/utils/multer.ts +++ b/packages/platform/platform-koa/src/utils/multer.ts @@ -1,4 +1,4 @@ -import Koa from "koa"; +import type Koa from "koa"; import {promisify} from "util"; let multer: any; diff --git a/packages/platform/platform-koa/test/app/Server.ts b/packages/platform/platform-koa/test/app/Server.ts index bb6d8ba5beb..39d6fa12245 100644 --- a/packages/platform/platform-koa/test/app/Server.ts +++ b/packages/platform/platform-koa/test/app/Server.ts @@ -2,7 +2,7 @@ import "@tsed/ajv"; import {PlatformApplication} from "@tsed/common"; import {Configuration, Inject} from "@tsed/di"; -import Application from "koa"; +import type Application from "koa"; import session from "koa-session"; const rootDir = import.meta.dirname; @@ -22,7 +22,7 @@ export {rootDir}; middlewares: ["koa-compress", "koa-override", "koa-bodyparser"] }) export class Server { - @Inject() + @Inject(PlatformApplication) app: PlatformApplication; $beforeRoutesInit() { diff --git a/packages/platform/platform-koa/test/platform-koa.spec.ts b/packages/platform/platform-koa/test/platform-koa.spec.ts index d22e3d95e3d..a19f5474b27 100644 --- a/packages/platform/platform-koa/test/platform-koa.spec.ts +++ b/packages/platform/platform-koa/test/platform-koa.spec.ts @@ -1,6 +1,6 @@ import {PlatformTestSdk} from "@tsed/platform-test-sdk"; -import {PlatformKoa} from ".."; +import {PlatformKoa} from "../src/index.js"; import {rootDir, Server} from "./app/Server.js"; const utils = PlatformTestSdk.create({ diff --git a/packages/platform/platform-koa/tsconfig.esm.json b/packages/platform/platform-koa/tsconfig.esm.json index 82292550ddb..8954049da4a 100644 --- a/packages/platform/platform-koa/tsconfig.esm.json +++ b/packages/platform/platform-koa/tsconfig.esm.json @@ -2,7 +2,6 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", diff --git a/packages/platform/platform-koa/tsconfig.spec.json b/packages/platform/platform-koa/tsconfig.spec.json index 162ff64a86a..350765efef4 100644 --- a/packages/platform/platform-koa/tsconfig.spec.json +++ b/packages/platform/platform-koa/tsconfig.spec.json @@ -3,30 +3,30 @@ "compilerOptions": { "baseUrl": ".", "rootDir": "../..", - "outDir": "./lib/cjs", "declaration": false, "composite": false, "noEmit": true, "paths": { - "@tsed/openspec": ["../../specs/openspec/src"], - "@tsed/schema": ["../../specs/schema/src"], - "@tsed/di": ["../../di/src"], - "@tsed/exceptions": ["../../specs/exceptions/src"], - "@tsed/json-mapper": ["../../specs/json-mapper/src"], - "@tsed/platform-exceptions": ["../platform-exceptions/src"], - "@tsed/platform-middlewares": ["../platform-middlewares/src"], - "@tsed/platform-params": ["../platform-params/src"], - "@tsed/platform-log-middleware": ["../platform-log-middleware/src"], - "@tsed/platform-response-filter": ["../platform-response-filter/src"], - "@tsed/platform-router": ["../platform-router/src"], - "@tsed/platform-views": ["../platform-views/src"], - "@tsed/components-scan": ["../../third-parties/components-scan/src"], - "@tsed/common": ["../common/src"], - "@tsed/ajv": ["../../specs/ajv/src"], - "@tsed/platform-cache": ["../platform-cache/src"], - "@tsed/swagger": ["../../specs/swagger/src"], - "@tsed/platform-test-sdk": ["../platform-test-sdk/src"], - "@tsed/platform-express": ["../platform-express/src"] + "@tsed/openspec": ["../../specs/openspec/src/index.ts"], + "@tsed/schema": ["../../specs/schema/src/index.ts"], + "@tsed/di": ["../../di/src/index.ts"], + "@tsed/exceptions": ["../../specs/exceptions/src/index.ts"], + "@tsed/json-mapper": ["../../specs/json-mapper/src/index.ts"], + "@tsed/platform-exceptions": ["../platform-exceptions/src/index.ts"], + "@tsed/platform-middlewares": ["../platform-middlewares/src/index.ts"], + "@tsed/platform-params": ["../platform-params/src/index.ts"], + "@tsed/platform-log-middleware": ["../platform-log-middleware/src/index.ts"], + "@tsed/platform-response-filter": ["../platform-response-filter/src/index.ts"], + "@tsed/platform-router": ["../platform-router/src/index.ts"], + "@tsed/platform-views": ["../platform-views/src/index.ts"], + "@tsed/normalize-path": ["../../utils/normalize-path/src/index.ts"], + "@tsed/components-scan": ["../../third-parties/components-scan/src/index.ts"], + "@tsed/common": ["../common/src/index.ts"], + "@tsed/ajv": ["../../specs/ajv/src/index.ts"], + "@tsed/platform-cache": ["../platform-cache/src/index.ts"], + "@tsed/swagger": ["../../specs/swagger/src/index.ts"], + "@tsed/platform-test-sdk": ["../platform-test-sdk/src/index.ts"], + "@tsed/platform-express": ["../platform-express/src/index.ts"] }, "types": ["vite/client", "vitest/globals"] }, diff --git a/packages/platform/platform-log-middleware/package.json b/packages/platform/platform-log-middleware/package.json index c41aaf980e8..2c532d87711 100644 --- a/packages/platform/platform-log-middleware/package.json +++ b/packages/platform/platform-log-middleware/package.json @@ -11,7 +11,7 @@ ".": { "types": "./lib/types/index.d.ts", "import": "./lib/esm/index.js", - "default": "./lib/cjs/index.js" + "default": "./lib/esm/index.js" } }, "scripts": { diff --git a/packages/platform/platform-log-middleware/src/middlewares/PlatformLogMiddleware.ts b/packages/platform/platform-log-middleware/src/middlewares/PlatformLogMiddleware.ts index 9b80d1017b0..b1a3392595e 100644 --- a/packages/platform/platform-log-middleware/src/middlewares/PlatformLogMiddleware.ts +++ b/packages/platform/platform-log-middleware/src/middlewares/PlatformLogMiddleware.ts @@ -1,6 +1,7 @@ import {cleanObject} from "@tsed/core"; import {Constant} from "@tsed/di"; -import {Middleware, MiddlewareMethods} from "@tsed/platform-middlewares"; +import type {MiddlewareMethods} from "@tsed/platform-middlewares"; +import {Middleware} from "@tsed/platform-middlewares"; import {Context} from "@tsed/platform-params"; import type {LoggerRequestFields} from "../domain/PlatformLogMiddlewareSettings.js"; diff --git a/packages/platform/platform-log-middleware/tsconfig.esm.json b/packages/platform/platform-log-middleware/tsconfig.esm.json index 82292550ddb..8954049da4a 100644 --- a/packages/platform/platform-log-middleware/tsconfig.esm.json +++ b/packages/platform/platform-log-middleware/tsconfig.esm.json @@ -2,7 +2,6 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", diff --git a/packages/platform/platform-log-middleware/tsconfig.spec.json b/packages/platform/platform-log-middleware/tsconfig.spec.json index 8a60e5b2d0e..4093230fb5d 100644 --- a/packages/platform/platform-log-middleware/tsconfig.spec.json +++ b/packages/platform/platform-log-middleware/tsconfig.spec.json @@ -3,30 +3,30 @@ "compilerOptions": { "baseUrl": ".", "rootDir": "../..", - "outDir": "./lib/cjs", "declaration": false, "composite": false, "noEmit": true, "paths": { - "@tsed/openspec": ["../../specs/openspec/src"], - "@tsed/schema": ["../../specs/schema/src"], - "@tsed/di": ["../../di/src"], - "@tsed/exceptions": ["../../specs/exceptions/src"], - "@tsed/json-mapper": ["../../specs/json-mapper/src"], - "@tsed/platform-exceptions": ["../platform-exceptions/src"], - "@tsed/platform-middlewares": ["../platform-middlewares/src"], - "@tsed/platform-params": ["../platform-params/src"], - "@tsed/platform-response-filter": ["../platform-response-filter/src"], - "@tsed/platform-router": ["../platform-router/src"], - "@tsed/platform-views": ["../platform-views/src"], - "@tsed/components-scan": ["../../third-parties/components-scan/src"], - "@tsed/common": ["../common/src"], - "@tsed/ajv": ["../../specs/ajv/src"], - "@tsed/platform-cache": ["../platform-cache/src"], - "@tsed/swagger": ["../../specs/swagger/src"], - "@tsed/platform-test-sdk": ["../platform-test-sdk/src"], - "@tsed/platform-express": ["../platform-express/src"], - "@tsed/platform-koa": ["../platform-koa/src"] + "@tsed/openspec": ["../../specs/openspec/src/index.ts"], + "@tsed/schema": ["../../specs/schema/src/index.ts"], + "@tsed/di": ["../../di/src/index.ts"], + "@tsed/exceptions": ["../../specs/exceptions/src/index.ts"], + "@tsed/json-mapper": ["../../specs/json-mapper/src/index.ts"], + "@tsed/platform-exceptions": ["../platform-exceptions/src/index.ts"], + "@tsed/platform-middlewares": ["../platform-middlewares/src/index.ts"], + "@tsed/platform-params": ["../platform-params/src/index.ts"], + "@tsed/platform-response-filter": ["../platform-response-filter/src/index.ts"], + "@tsed/platform-router": ["../platform-router/src/index.ts"], + "@tsed/platform-views": ["../platform-views/src/index.ts"], + "@tsed/normalize-path": ["../../utils/normalize-path/src/index.ts"], + "@tsed/components-scan": ["../../third-parties/components-scan/src/index.ts"], + "@tsed/common": ["../common/src/index.ts"], + "@tsed/ajv": ["../../specs/ajv/src/index.ts"], + "@tsed/platform-cache": ["../platform-cache/src/index.ts"], + "@tsed/swagger": ["../../specs/swagger/src/index.ts"], + "@tsed/platform-test-sdk": ["../platform-test-sdk/src/index.ts"], + "@tsed/platform-express": ["../platform-express/src/index.ts"], + "@tsed/platform-koa": ["../platform-koa/src/index.ts"] }, "types": ["vite/client", "vitest/globals"] }, diff --git a/packages/platform/platform-middlewares/package.json b/packages/platform/platform-middlewares/package.json index 1f02c6d180f..5ab32c080d8 100644 --- a/packages/platform/platform-middlewares/package.json +++ b/packages/platform/platform-middlewares/package.json @@ -11,7 +11,7 @@ ".": { "types": "./lib/types/index.d.ts", "import": "./lib/esm/index.js", - "default": "./lib/cjs/index.js" + "default": "./lib/esm/index.js" } }, "scripts": { diff --git a/packages/platform/platform-middlewares/src/decorators/authOptions.ts b/packages/platform/platform-middlewares/src/decorators/authOptions.ts index 6c61ffcddd7..4d4b6c655b0 100644 --- a/packages/platform/platform-middlewares/src/decorators/authOptions.ts +++ b/packages/platform/platform-middlewares/src/decorators/authOptions.ts @@ -1,12 +1,5 @@ -import { - decorateMethodsOf, - DecoratorMethodParameters, - DecoratorParameters, - decoratorTypeOf, - DecoratorTypes, - Type, - UnsupportedDecoratorType -} from "@tsed/core"; +import type {DecoratorMethodParameters, DecoratorParameters, Type} from "@tsed/core"; +import {decorateMethodsOf, decoratorTypeOf, DecoratorTypes, UnsupportedDecoratorType} from "@tsed/core"; import {JsonEntityFn} from "@tsed/schema"; /** diff --git a/packages/platform/platform-middlewares/src/decorators/middleware.ts b/packages/platform/platform-middlewares/src/decorators/middleware.ts index cdc12eba101..e95bb26fbea 100644 --- a/packages/platform/platform-middlewares/src/decorators/middleware.ts +++ b/packages/platform/platform-middlewares/src/decorators/middleware.ts @@ -1,4 +1,5 @@ -import {Injectable, ProviderOpts, ProviderType} from "@tsed/di"; +import type {ProviderOpts} from "@tsed/di"; +import {Injectable, ProviderType} from "@tsed/di"; /** * Register a new Middleware class. diff --git a/packages/platform/platform-middlewares/src/decorators/useAuth.ts b/packages/platform/platform-middlewares/src/decorators/useAuth.ts index bffa444aeb4..80c498074f6 100644 --- a/packages/platform/platform-middlewares/src/decorators/useAuth.ts +++ b/packages/platform/platform-middlewares/src/decorators/useAuth.ts @@ -1,14 +1,5 @@ -import { - decorateMethodsOf, - DecoratorParameters, - decoratorTypeOf, - DecoratorTypes, - Store, - StoreFn, - Type, - UnsupportedDecoratorType, - useDecorators -} from "@tsed/core"; +import type {DecoratorParameters, Store, Type} from "@tsed/core"; +import {decorateMethodsOf, decoratorTypeOf, DecoratorTypes, StoreFn, UnsupportedDecoratorType, useDecorators} from "@tsed/core"; import {AuthOptions} from "./authOptions.js"; import {UseBefore} from "./useBefore.js"; diff --git a/packages/platform/platform-middlewares/src/decorators/useBeforeEach.ts b/packages/platform/platform-middlewares/src/decorators/useBeforeEach.ts index 146a8bd38fb..1ed5dbcb4ad 100644 --- a/packages/platform/platform-middlewares/src/decorators/useBeforeEach.ts +++ b/packages/platform/platform-middlewares/src/decorators/useBeforeEach.ts @@ -1,4 +1,5 @@ -import {decorateMethodsOf, DecoratorParameters, decoratorTypeOf, DecoratorTypes, UnsupportedDecoratorType} from "@tsed/core"; +import type {DecoratorParameters} from "@tsed/core"; +import {decorateMethodsOf, decoratorTypeOf, DecoratorTypes, UnsupportedDecoratorType} from "@tsed/core"; import {UseBefore} from "./useBefore.js"; diff --git a/packages/platform/platform-middlewares/src/domain/PlatformMiddlewareSettings.ts b/packages/platform/platform-middlewares/src/domain/PlatformMiddlewareSettings.ts index 7eaddc92489..d3cca0d90d0 100644 --- a/packages/platform/platform-middlewares/src/domain/PlatformMiddlewareSettings.ts +++ b/packages/platform/platform-middlewares/src/domain/PlatformMiddlewareSettings.ts @@ -1,4 +1,4 @@ -import {Env, Type} from "@tsed/core"; +import type {Env, Type} from "@tsed/core"; export type PlatformMiddlewareLoadingOptions = {env?: Env; use: Function | Type | string; hook?: string; options?: any}; export type PlatformMiddlewareSettings = Function | Type | PlatformMiddlewareLoadingOptions | string | any; diff --git a/packages/platform/platform-middlewares/src/utils/getMiddlewaresForHook.ts b/packages/platform/platform-middlewares/src/utils/getMiddlewaresForHook.ts index ff3f7a3da31..5a191147729 100644 --- a/packages/platform/platform-middlewares/src/utils/getMiddlewaresForHook.ts +++ b/packages/platform/platform-middlewares/src/utils/getMiddlewaresForHook.ts @@ -1,6 +1,6 @@ -import {DIConfiguration} from "@tsed/di"; +import type {DIConfiguration} from "@tsed/di"; -import {PlatformMiddlewareLoadingOptions} from "../domain/PlatformMiddlewareSettings.js"; +import type {PlatformMiddlewareLoadingOptions} from "../domain/PlatformMiddlewareSettings.js"; export function getMiddlewaresForHook(hook: string, settings: DIConfiguration, defaultHook = "") { const env = settings.env; diff --git a/packages/platform/platform-middlewares/tsconfig.esm.json b/packages/platform/platform-middlewares/tsconfig.esm.json index 82292550ddb..8954049da4a 100644 --- a/packages/platform/platform-middlewares/tsconfig.esm.json +++ b/packages/platform/platform-middlewares/tsconfig.esm.json @@ -2,7 +2,6 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", diff --git a/packages/platform/platform-middlewares/tsconfig.spec.json b/packages/platform/platform-middlewares/tsconfig.spec.json index 2cbf49b76d8..9478be3ead5 100644 --- a/packages/platform/platform-middlewares/tsconfig.spec.json +++ b/packages/platform/platform-middlewares/tsconfig.spec.json @@ -3,30 +3,30 @@ "compilerOptions": { "baseUrl": ".", "rootDir": "../..", - "outDir": "./lib/cjs", "declaration": false, "composite": false, "noEmit": true, "paths": { - "@tsed/openspec": ["../../specs/openspec/src"], - "@tsed/schema": ["../../specs/schema/src"], - "@tsed/di": ["../../di/src"], - "@tsed/exceptions": ["../../specs/exceptions/src"], - "@tsed/json-mapper": ["../../specs/json-mapper/src"], - "@tsed/platform-exceptions": ["../platform-exceptions/src"], - "@tsed/platform-params": ["../platform-params/src"], - "@tsed/platform-log-middleware": ["../platform-log-middleware/src"], - "@tsed/platform-response-filter": ["../platform-response-filter/src"], - "@tsed/platform-router": ["../platform-router/src"], - "@tsed/platform-views": ["../platform-views/src"], - "@tsed/components-scan": ["../../third-parties/components-scan/src"], - "@tsed/common": ["../common/src"], - "@tsed/ajv": ["../../specs/ajv/src"], - "@tsed/platform-cache": ["../platform-cache/src"], - "@tsed/swagger": ["../../specs/swagger/src"], - "@tsed/platform-test-sdk": ["../platform-test-sdk/src"], - "@tsed/platform-express": ["../platform-express/src"], - "@tsed/platform-koa": ["../platform-koa/src"] + "@tsed/openspec": ["../../specs/openspec/src/index.ts"], + "@tsed/schema": ["../../specs/schema/src/index.ts"], + "@tsed/di": ["../../di/src/index.ts"], + "@tsed/exceptions": ["../../specs/exceptions/src/index.ts"], + "@tsed/json-mapper": ["../../specs/json-mapper/src/index.ts"], + "@tsed/platform-exceptions": ["../platform-exceptions/src/index.ts"], + "@tsed/platform-params": ["../platform-params/src/index.ts"], + "@tsed/platform-log-middleware": ["../platform-log-middleware/src/index.ts"], + "@tsed/platform-response-filter": ["../platform-response-filter/src/index.ts"], + "@tsed/platform-router": ["../platform-router/src/index.ts"], + "@tsed/platform-views": ["../platform-views/src/index.ts"], + "@tsed/normalize-path": ["../../utils/normalize-path/src/index.ts"], + "@tsed/components-scan": ["../../third-parties/components-scan/src/index.ts"], + "@tsed/common": ["../common/src/index.ts"], + "@tsed/ajv": ["../../specs/ajv/src/index.ts"], + "@tsed/platform-cache": ["../platform-cache/src/index.ts"], + "@tsed/swagger": ["../../specs/swagger/src/index.ts"], + "@tsed/platform-test-sdk": ["../platform-test-sdk/src/index.ts"], + "@tsed/platform-express": ["../platform-express/src/index.ts"], + "@tsed/platform-koa": ["../platform-koa/src/index.ts"] }, "types": ["vite/client", "vitest/globals"] }, diff --git a/packages/platform/platform-params/package.json b/packages/platform/platform-params/package.json index 8917083aa20..43bd74f81fb 100644 --- a/packages/platform/platform-params/package.json +++ b/packages/platform/platform-params/package.json @@ -11,7 +11,7 @@ ".": { "types": "./lib/types/index.d.ts", "import": "./lib/esm/index.js", - "default": "./lib/cjs/index.js" + "default": "./lib/esm/index.js" } }, "scripts": { diff --git a/packages/platform/platform-params/src/builder/PlatformParams.ts b/packages/platform/platform-params/src/builder/PlatformParams.ts index 5ee51105471..51a5387de85 100644 --- a/packages/platform/platform-params/src/builder/PlatformParams.ts +++ b/packages/platform/platform-params/src/builder/PlatformParams.ts @@ -1,5 +1,6 @@ -import {DIContext, Inject, Injectable, InjectorService, ProviderScope, TokenProvider} from "@tsed/di"; -import {JsonMethodStore, JsonParameterStore, PipeMethods} from "@tsed/schema"; +import {type DIContext, Inject, Injectable, InjectorService, ProviderScope, type TokenProvider} from "@tsed/di"; +import type {PipeMethods} from "@tsed/schema"; +import {JsonMethodStore, JsonParameterStore} from "@tsed/schema"; import {ParamValidationError} from "../errors/ParamValidationError.js"; import {ParseExpressionPipe} from "../pipes/ParseExpressionPipe.js"; @@ -16,7 +17,7 @@ export type PlatformParamsCallback = (sco imports: [ParseExpressionPipe] }) export class PlatformParams { - @Inject() + @Inject(InjectorService) protected injector: InjectorService; getPipes(param: JsonParameterStore) { diff --git a/packages/platform/platform-params/src/decorators/bodyParams.ts b/packages/platform/platform-params/src/decorators/bodyParams.ts index be46c250b22..e77bd40e25a 100644 --- a/packages/platform/platform-params/src/decorators/bodyParams.ts +++ b/packages/platform/platform-params/src/decorators/bodyParams.ts @@ -1,6 +1,6 @@ -import {Type} from "@tsed/core"; +import type {Type} from "@tsed/core"; -import {ParamOptions} from "../domain/ParamOptions.js"; +import type {ParamOptions} from "../domain/ParamOptions.js"; import {ParamTypes} from "../domain/ParamTypes.js"; import {mapParamsOptions} from "../utils/mapParamsOptions.js"; import {UseParam} from "./useParam.js"; diff --git a/packages/platform/platform-params/src/decorators/context.ts b/packages/platform/platform-params/src/decorators/context.ts index 7b1e0251675..2b4d0cfcdab 100644 --- a/packages/platform/platform-params/src/decorators/context.ts +++ b/packages/platform/platform-params/src/decorators/context.ts @@ -1,4 +1,4 @@ -import {BaseContext} from "@tsed/di"; +import type {BaseContext} from "@tsed/di"; import {ParamTypes} from "../domain/ParamTypes.js"; import {mapParamsOptions} from "../utils/mapParamsOptions.js"; diff --git a/packages/platform/platform-params/src/decorators/cookies.ts b/packages/platform/platform-params/src/decorators/cookies.ts index a08b949daf8..14888b103c9 100644 --- a/packages/platform/platform-params/src/decorators/cookies.ts +++ b/packages/platform/platform-params/src/decorators/cookies.ts @@ -1,6 +1,6 @@ -import {Type} from "@tsed/core"; +import type {Type} from "@tsed/core"; -import {ParamOptions} from "../domain/ParamOptions.js"; +import type {ParamOptions} from "../domain/ParamOptions.js"; import {ParamTypes} from "../domain/ParamTypes.js"; import {mapParamsOptions} from "../utils/mapParamsOptions.js"; import {UseParam} from "./useParam.js"; diff --git a/packages/platform/platform-params/src/decorators/headerParams.ts b/packages/platform/platform-params/src/decorators/headerParams.ts index c7e5ace7695..5a29e6ccddf 100644 --- a/packages/platform/platform-params/src/decorators/headerParams.ts +++ b/packages/platform/platform-params/src/decorators/headerParams.ts @@ -1,6 +1,6 @@ -import {Type} from "@tsed/core"; +import type {Type} from "@tsed/core"; -import {ParamOptions} from "../domain/ParamOptions.js"; +import type {ParamOptions} from "../domain/ParamOptions.js"; import {ParamTypes} from "../domain/ParamTypes.js"; import {mapParamsOptions} from "../utils/mapParamsOptions.js"; import {UseParam} from "./useParam.js"; diff --git a/packages/platform/platform-params/src/decorators/paramFn.ts b/packages/platform/platform-params/src/decorators/paramFn.ts index 26febefe9c1..ce515cfa45b 100644 --- a/packages/platform/platform-params/src/decorators/paramFn.ts +++ b/packages/platform/platform-params/src/decorators/paramFn.ts @@ -1,5 +1,6 @@ -import {DecoratorParameters} from "@tsed/core"; -import {JsonEntityFn, JsonParameterStore} from "@tsed/schema"; +import type {DecoratorParameters} from "@tsed/core"; +import type {JsonParameterStore} from "@tsed/schema"; +import {JsonEntityFn} from "@tsed/schema"; /** * Get the Param metadata. Use this decorator to compose your own decorator. diff --git a/packages/platform/platform-params/src/decorators/pathParams.ts b/packages/platform/platform-params/src/decorators/pathParams.ts index aef9e000ec1..33ec2f5a5df 100644 --- a/packages/platform/platform-params/src/decorators/pathParams.ts +++ b/packages/platform/platform-params/src/decorators/pathParams.ts @@ -1,6 +1,6 @@ -import {Type} from "@tsed/core"; +import type {Type} from "@tsed/core"; -import {ParamOptions} from "../domain/ParamOptions.js"; +import type {ParamOptions} from "../domain/ParamOptions.js"; import {ParamTypes} from "../domain/ParamTypes.js"; import {mapParamsOptions} from "../utils/mapParamsOptions.js"; import {UseParam} from "./useParam.js"; diff --git a/packages/platform/platform-params/src/decorators/queryParams.ts b/packages/platform/platform-params/src/decorators/queryParams.ts index c79e0fc6acc..d220528d7d3 100644 --- a/packages/platform/platform-params/src/decorators/queryParams.ts +++ b/packages/platform/platform-params/src/decorators/queryParams.ts @@ -1,6 +1,6 @@ -import {Type} from "@tsed/core"; +import type {Type} from "@tsed/core"; -import {ParamOptions} from "../domain/ParamOptions.js"; +import type {ParamOptions} from "../domain/ParamOptions.js"; import {ParamTypes} from "../domain/ParamTypes.js"; import {mapParamsOptions} from "../utils/mapParamsOptions.js"; import {UseParam} from "./useParam.js"; diff --git a/packages/platform/platform-params/src/decorators/session.ts b/packages/platform/platform-params/src/decorators/session.ts index 96c72438ebd..98d399f48fd 100644 --- a/packages/platform/platform-params/src/decorators/session.ts +++ b/packages/platform/platform-params/src/decorators/session.ts @@ -1,4 +1,4 @@ -import {ParamOptions} from "../domain/ParamOptions.js"; +import type {ParamOptions} from "../domain/ParamOptions.js"; import {ParamTypes} from "../domain/ParamTypes.js"; import {mapParamsOptions} from "../utils/mapParamsOptions.js"; import {UseParam} from "./useParam.js"; diff --git a/packages/platform/platform-params/src/decorators/useParam.ts b/packages/platform/platform-params/src/decorators/useParam.ts index b276b56a8b1..a077d9f0424 100644 --- a/packages/platform/platform-params/src/decorators/useParam.ts +++ b/packages/platform/platform-params/src/decorators/useParam.ts @@ -1,6 +1,6 @@ import {useDecorators} from "@tsed/core"; -import {ParamOptions} from "../domain/ParamOptions.js"; +import type {ParamOptions} from "../domain/ParamOptions.js"; import {ParamTypes} from "../domain/ParamTypes.js"; import {UseDeserialization} from "./useDeserialization.js"; import {UseParamType} from "./useParamType.js"; diff --git a/packages/platform/platform-params/src/decorators/useParamType.ts b/packages/platform/platform-params/src/decorators/useParamType.ts index 3cd9dde2a9f..f6afb089b61 100644 --- a/packages/platform/platform-params/src/decorators/useParamType.ts +++ b/packages/platform/platform-params/src/decorators/useParamType.ts @@ -1,7 +1,7 @@ import {isBuffer, useDecorators} from "@tsed/core"; import {isParameterType, Name} from "@tsed/schema"; -import {ParamOptions} from "../domain/ParamOptions.js"; +import type {ParamOptions} from "../domain/ParamOptions.js"; import {PARAM_TYPES_DATA_PATH, ParamTypes} from "../domain/ParamTypes.js"; import {ParamFn} from "./paramFn.js"; import {UseParamExpression} from "./useParamExpression.js"; diff --git a/packages/platform/platform-params/src/decorators/usePipe.ts b/packages/platform/platform-params/src/decorators/usePipe.ts index 5a1587a874f..8d8aa8e340b 100644 --- a/packages/platform/platform-params/src/decorators/usePipe.ts +++ b/packages/platform/platform-params/src/decorators/usePipe.ts @@ -1,5 +1,5 @@ -import {Type} from "@tsed/core"; -import {PipeMethods} from "@tsed/schema"; +import type {Type} from "@tsed/core"; +import type {PipeMethods} from "@tsed/schema"; import {ParamFn} from "./paramFn.js"; diff --git a/packages/platform/platform-params/src/decorators/useType.ts b/packages/platform/platform-params/src/decorators/useType.ts index 709dc06a771..4d19a0833db 100644 --- a/packages/platform/platform-params/src/decorators/useType.ts +++ b/packages/platform/platform-params/src/decorators/useType.ts @@ -1,4 +1,4 @@ -import {Type} from "@tsed/core"; +import type {Type} from "@tsed/core"; import {Any, CollectionOf, type JsonParameterStore} from "@tsed/schema"; import {ParamFn} from "./paramFn.js"; diff --git a/packages/platform/platform-params/src/domain/ParamOptions.ts b/packages/platform/platform-params/src/domain/ParamOptions.ts index 102ed6cbe66..a50d6415ea8 100644 --- a/packages/platform/platform-params/src/domain/ParamOptions.ts +++ b/packages/platform/platform-params/src/domain/ParamOptions.ts @@ -1,4 +1,4 @@ -import {Type} from "@tsed/core"; +import type {Type} from "@tsed/core"; export interface ParamOptions { dataPath: string; diff --git a/packages/platform/platform-params/src/errors/ParamValidationError.ts b/packages/platform/platform-params/src/errors/ParamValidationError.ts index 062559eb87e..798a7336422 100644 --- a/packages/platform/platform-params/src/errors/ParamValidationError.ts +++ b/packages/platform/platform-params/src/errors/ParamValidationError.ts @@ -1,6 +1,6 @@ import {nameOf} from "@tsed/core"; import {BadRequest} from "@tsed/exceptions"; -import {JsonParameterStore} from "@tsed/schema"; +import type {JsonParameterStore} from "@tsed/schema"; import {ValidationError} from "./ValidationError.js"; diff --git a/packages/platform/platform-params/src/errors/RequiredValidationError.ts b/packages/platform/platform-params/src/errors/RequiredValidationError.ts index 4a3b2c97795..d8a1625ea5c 100644 --- a/packages/platform/platform-params/src/errors/RequiredValidationError.ts +++ b/packages/platform/platform-params/src/errors/RequiredValidationError.ts @@ -1,5 +1,5 @@ import {nameOf} from "@tsed/core"; -import {JsonParameterStore} from "@tsed/schema"; +import type {JsonParameterStore} from "@tsed/schema"; import {ValidationError} from "./ValidationError.js"; diff --git a/packages/platform/platform-params/src/exports.ts b/packages/platform/platform-params/src/exports.ts index 6e2ea476601..182fcff84e8 100644 --- a/packages/platform/platform-params/src/exports.ts +++ b/packages/platform/platform-params/src/exports.ts @@ -1 +1 @@ -export {PipeMethods} from "@tsed/schema"; +export {type PipeMethods} from "@tsed/schema"; diff --git a/packages/platform/platform-params/src/pipes/DeserializerPipe.ts b/packages/platform/platform-params/src/pipes/DeserializerPipe.ts index b4676259ebb..3a5f8413b2c 100644 --- a/packages/platform/platform-params/src/pipes/DeserializerPipe.ts +++ b/packages/platform/platform-params/src/pipes/DeserializerPipe.ts @@ -1,6 +1,6 @@ import {Injectable} from "@tsed/di"; import {deserialize} from "@tsed/json-mapper"; -import {JsonParameterStore, PipeMethods} from "@tsed/schema"; +import type {JsonParameterStore, PipeMethods} from "@tsed/schema"; @Injectable() export class DeserializerPipe implements PipeMethods { diff --git a/packages/platform/platform-params/src/pipes/ParseExpressionPipe.ts b/packages/platform/platform-params/src/pipes/ParseExpressionPipe.ts index 2a780993138..4e49c4524d9 100644 --- a/packages/platform/platform-params/src/pipes/ParseExpressionPipe.ts +++ b/packages/platform/platform-params/src/pipes/ParseExpressionPipe.ts @@ -1,8 +1,8 @@ import {getValue} from "@tsed/core"; import {Injectable} from "@tsed/di"; -import {JsonParameterStore, PipeMethods} from "@tsed/schema"; +import type {JsonParameterStore, PipeMethods} from "@tsed/schema"; -import {PlatformParamsScope} from "../builder/PlatformParams.js"; +import type {PlatformParamsScope} from "../builder/PlatformParams.js"; import {ParamTypes} from "../domain/ParamTypes.js"; @Injectable({ diff --git a/packages/platform/platform-params/src/pipes/ValidationPipe.ts b/packages/platform/platform-params/src/pipes/ValidationPipe.ts index 5d6da2aa777..cf2e96fc959 100644 --- a/packages/platform/platform-params/src/pipes/ValidationPipe.ts +++ b/packages/platform/platform-params/src/pipes/ValidationPipe.ts @@ -1,6 +1,7 @@ import {Inject, Injectable} from "@tsed/di"; import {deserialize} from "@tsed/json-mapper"; -import {getJsonSchema, JsonParameterStore, PipeMethods} from "@tsed/schema"; +import type {JsonParameterStore, PipeMethods} from "@tsed/schema"; +import {getJsonSchema} from "@tsed/schema"; import {ParamTypes} from "../domain/ParamTypes.js"; import {RequiredValidationError} from "../errors/RequiredValidationError.js"; diff --git a/packages/platform/platform-params/src/utils/mapParamsOptions.ts b/packages/platform/platform-params/src/utils/mapParamsOptions.ts index ee4375f84ea..53bab4a9a7f 100644 --- a/packages/platform/platform-params/src/utils/mapParamsOptions.ts +++ b/packages/platform/platform-params/src/utils/mapParamsOptions.ts @@ -1,6 +1,6 @@ import {isObject} from "@tsed/core"; -import {ParamOptions} from "../domain/ParamOptions.js"; +import type {ParamOptions} from "../domain/ParamOptions.js"; /** * @ignore diff --git a/packages/platform/platform-params/test/helpers/buildPlatformParams.ts b/packages/platform/platform-params/test/helpers/buildPlatformParams.ts index 697ec23f647..4b84ba93451 100644 --- a/packages/platform/platform-params/test/helpers/buildPlatformParams.ts +++ b/packages/platform/platform-params/test/helpers/buildPlatformParams.ts @@ -1,4 +1,5 @@ -import {ParamOptions, PlatformParams, PlatformTest} from "@tsed/common"; +import type {ParamOptions} from "@tsed/common"; +import {PlatformParams, PlatformTest} from "@tsed/common"; import {DecoratorTypes} from "@tsed/core"; import {JsonParameterStore} from "@tsed/schema"; diff --git a/packages/platform/platform-params/tsconfig.esm.json b/packages/platform/platform-params/tsconfig.esm.json index 82292550ddb..8954049da4a 100644 --- a/packages/platform/platform-params/tsconfig.esm.json +++ b/packages/platform/platform-params/tsconfig.esm.json @@ -2,7 +2,6 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", diff --git a/packages/platform/platform-params/tsconfig.spec.json b/packages/platform/platform-params/tsconfig.spec.json index 4f386c836b6..381e722f7fa 100644 --- a/packages/platform/platform-params/tsconfig.spec.json +++ b/packages/platform/platform-params/tsconfig.spec.json @@ -3,30 +3,30 @@ "compilerOptions": { "baseUrl": ".", "rootDir": "../..", - "outDir": "./lib/cjs", "declaration": false, "composite": false, "noEmit": true, "paths": { - "@tsed/openspec": ["../../specs/openspec/src"], - "@tsed/schema": ["../../specs/schema/src"], - "@tsed/di": ["../../di/src"], - "@tsed/exceptions": ["../../specs/exceptions/src"], - "@tsed/json-mapper": ["../../specs/json-mapper/src"], - "@tsed/platform-exceptions": ["../platform-exceptions/src"], - "@tsed/platform-middlewares": ["../platform-middlewares/src"], - "@tsed/platform-log-middleware": ["../platform-log-middleware/src"], - "@tsed/platform-response-filter": ["../platform-response-filter/src"], - "@tsed/platform-router": ["../platform-router/src"], - "@tsed/platform-views": ["../platform-views/src"], - "@tsed/components-scan": ["../../third-parties/components-scan/src"], - "@tsed/common": ["../common/src"], - "@tsed/ajv": ["../../specs/ajv/src"], - "@tsed/platform-cache": ["../platform-cache/src"], - "@tsed/swagger": ["../../specs/swagger/src"], - "@tsed/platform-test-sdk": ["../platform-test-sdk/src"], - "@tsed/platform-express": ["../platform-express/src"], - "@tsed/platform-koa": ["../platform-koa/src"] + "@tsed/openspec": ["../../specs/openspec/src/index.ts"], + "@tsed/schema": ["../../specs/schema/src/index.ts"], + "@tsed/di": ["../../di/src/index.ts"], + "@tsed/exceptions": ["../../specs/exceptions/src/index.ts"], + "@tsed/json-mapper": ["../../specs/json-mapper/src/index.ts"], + "@tsed/platform-exceptions": ["../platform-exceptions/src/index.ts"], + "@tsed/platform-middlewares": ["../platform-middlewares/src/index.ts"], + "@tsed/platform-log-middleware": ["../platform-log-middleware/src/index.ts"], + "@tsed/platform-response-filter": ["../platform-response-filter/src/index.ts"], + "@tsed/platform-router": ["../platform-router/src/index.ts"], + "@tsed/platform-views": ["../platform-views/src/index.ts"], + "@tsed/normalize-path": ["../../utils/normalize-path/src/index.ts"], + "@tsed/components-scan": ["../../third-parties/components-scan/src/index.ts"], + "@tsed/common": ["../common/src/index.ts"], + "@tsed/ajv": ["../../specs/ajv/src/index.ts"], + "@tsed/platform-cache": ["../platform-cache/src/index.ts"], + "@tsed/swagger": ["../../specs/swagger/src/index.ts"], + "@tsed/platform-test-sdk": ["../platform-test-sdk/src/index.ts"], + "@tsed/platform-express": ["../platform-express/src/index.ts"], + "@tsed/platform-koa": ["../platform-koa/src/index.ts"] }, "types": ["vite/client", "vitest/globals"] }, diff --git a/packages/platform/platform-response-filter/package.json b/packages/platform/platform-response-filter/package.json index 4718ec43c39..aea798029c2 100644 --- a/packages/platform/platform-response-filter/package.json +++ b/packages/platform/platform-response-filter/package.json @@ -11,7 +11,7 @@ ".": { "types": "./lib/types/index.d.ts", "import": "./lib/esm/index.js", - "default": "./lib/cjs/index.js" + "default": "./lib/esm/index.js" } }, "scripts": { diff --git a/packages/platform/platform-response-filter/src/decorators/responseFilter.ts b/packages/platform/platform-response-filter/src/decorators/responseFilter.ts index d47f4d7d71f..7c061637569 100644 --- a/packages/platform/platform-response-filter/src/decorators/responseFilter.ts +++ b/packages/platform/platform-response-filter/src/decorators/responseFilter.ts @@ -1,7 +1,8 @@ -import {Type} from "@tsed/core"; +import type {Type} from "@tsed/core"; import {registerProvider} from "@tsed/di"; -import {registerResponseFilter, ResponseFilterKey} from "../domain/ResponseFiltersContainer.js"; +import type {ResponseFilterKey} from "../domain/ResponseFiltersContainer.js"; +import {registerResponseFilter} from "../domain/ResponseFiltersContainer.js"; /** * Register a response filter service. diff --git a/packages/platform/platform-response-filter/src/domain/ResponseFiltersContainer.ts b/packages/platform/platform-response-filter/src/domain/ResponseFiltersContainer.ts index dec531642e1..7889c7a93ab 100644 --- a/packages/platform/platform-response-filter/src/domain/ResponseFiltersContainer.ts +++ b/packages/platform/platform-response-filter/src/domain/ResponseFiltersContainer.ts @@ -1,6 +1,6 @@ -import {Type} from "@tsed/core"; +import type {Type} from "@tsed/core"; -import {ResponseFilterMethods} from "../interfaces/ResponseFilterMethods.js"; +import type {ResponseFilterMethods} from "../interfaces/ResponseFilterMethods.js"; /** * @ignore */ diff --git a/packages/platform/platform-response-filter/src/errors/TemplateRenderError.ts b/packages/platform/platform-response-filter/src/errors/TemplateRenderError.ts index bb5ef43bff1..16b913da072 100644 --- a/packages/platform/platform-response-filter/src/errors/TemplateRenderError.ts +++ b/packages/platform/platform-response-filter/src/errors/TemplateRenderError.ts @@ -1,4 +1,5 @@ -import {nameOf, Type} from "@tsed/core"; +import type {Type} from "@tsed/core"; +import {nameOf} from "@tsed/core"; import {InternalServerError} from "@tsed/exceptions"; /** diff --git a/packages/platform/platform-response-filter/src/interfaces/ResponseFilterMethods.ts b/packages/platform/platform-response-filter/src/interfaces/ResponseFilterMethods.ts index 6603ebcdabe..4cbd6d6961a 100644 --- a/packages/platform/platform-response-filter/src/interfaces/ResponseFilterMethods.ts +++ b/packages/platform/platform-response-filter/src/interfaces/ResponseFilterMethods.ts @@ -1,4 +1,4 @@ -import {Type} from "@tsed/core"; +import type {Type} from "@tsed/core"; import type {BaseContext} from "@tsed/di"; declare global { diff --git a/packages/platform/platform-response-filter/src/services/PlatformResponseFilter.spec.ts b/packages/platform/platform-response-filter/src/services/PlatformResponseFilter.spec.ts index 752ad92bccc..022bb18eab0 100644 --- a/packages/platform/platform-response-filter/src/services/PlatformResponseFilter.spec.ts +++ b/packages/platform/platform-response-filter/src/services/PlatformResponseFilter.spec.ts @@ -1,9 +1,10 @@ -import {Context, EndpointMetadata, Get, PlatformContext, PlatformTest, View} from "@tsed/common"; +import type {Context, PlatformContext} from "@tsed/common"; +import {EndpointMetadata, Get, PlatformTest, View} from "@tsed/common"; import {catchAsyncError} from "@tsed/core"; import {Returns} from "@tsed/schema"; import {ResponseFilter} from "../decorators/responseFilter.js"; -import {ResponseFilterMethods} from "../interfaces/ResponseFilterMethods.js"; +import type {ResponseFilterMethods} from "../interfaces/ResponseFilterMethods.js"; import {PlatformResponseFilter} from "./PlatformResponseFilter.js"; @ResponseFilter("custom/json") diff --git a/packages/platform/platform-response-filter/src/services/PlatformResponseFilter.ts b/packages/platform/platform-response-filter/src/services/PlatformResponseFilter.ts index 26cb64c1756..5bd8b9b58f7 100644 --- a/packages/platform/platform-response-filter/src/services/PlatformResponseFilter.ts +++ b/packages/platform/platform-response-filter/src/services/PlatformResponseFilter.ts @@ -1,9 +1,11 @@ -import {isSerializable, Type} from "@tsed/core"; -import {BaseContext, Constant, Inject, Injectable, InjectorService} from "@tsed/di"; +import type {Type} from "@tsed/core"; +import {isSerializable} from "@tsed/core"; +import {type BaseContext, Constant, Inject, Injectable, InjectorService} from "@tsed/di"; import {serialize} from "@tsed/json-mapper"; -import {ResponseFilterKey, ResponseFiltersContainer} from "../domain/ResponseFiltersContainer.js"; -import {ResponseFilterMethods} from "../interfaces/ResponseFilterMethods.js"; +import type {ResponseFilterKey} from "../domain/ResponseFiltersContainer.js"; +import {ResponseFiltersContainer} from "../domain/ResponseFiltersContainer.js"; +import type {ResponseFilterMethods} from "../interfaces/ResponseFilterMethods.js"; import {ANY_CONTENT_TYPE, getContentType} from "../utils/getContentType.js"; import {renderView} from "../utils/renderView.js"; @@ -14,7 +16,7 @@ import {renderView} from "../utils/renderView.js"; export class PlatformResponseFilter { protected types: Map = new Map(); - @Inject() + @Inject(InjectorService) protected injector: InjectorService; @Constant("responseFilters", []) diff --git a/packages/platform/platform-response-filter/src/utils/renderView.ts b/packages/platform/platform-response-filter/src/utils/renderView.ts index 280d463c326..ef71d76a398 100644 --- a/packages/platform/platform-response-filter/src/utils/renderView.ts +++ b/packages/platform/platform-response-filter/src/utils/renderView.ts @@ -1,4 +1,4 @@ -import {BaseContext} from "@tsed/di"; +import type {BaseContext} from "@tsed/di"; import {TemplateRenderError} from "../errors/TemplateRenderError.js"; diff --git a/packages/platform/platform-response-filter/tsconfig.esm.json b/packages/platform/platform-response-filter/tsconfig.esm.json index 82292550ddb..8954049da4a 100644 --- a/packages/platform/platform-response-filter/tsconfig.esm.json +++ b/packages/platform/platform-response-filter/tsconfig.esm.json @@ -2,7 +2,6 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", diff --git a/packages/platform/platform-response-filter/tsconfig.spec.json b/packages/platform/platform-response-filter/tsconfig.spec.json index cf76421f464..fa46276de37 100644 --- a/packages/platform/platform-response-filter/tsconfig.spec.json +++ b/packages/platform/platform-response-filter/tsconfig.spec.json @@ -3,30 +3,30 @@ "compilerOptions": { "baseUrl": ".", "rootDir": "../..", - "outDir": "./lib/cjs", "declaration": false, "composite": false, "noEmit": true, "paths": { - "@tsed/openspec": ["../../specs/openspec/src"], - "@tsed/schema": ["../../specs/schema/src"], - "@tsed/di": ["../../di/src"], - "@tsed/exceptions": ["../../specs/exceptions/src"], - "@tsed/json-mapper": ["../../specs/json-mapper/src"], - "@tsed/platform-exceptions": ["../platform-exceptions/src"], - "@tsed/platform-middlewares": ["../platform-middlewares/src"], - "@tsed/platform-params": ["../platform-params/src"], - "@tsed/platform-log-middleware": ["../platform-log-middleware/src"], - "@tsed/platform-router": ["../platform-router/src"], - "@tsed/platform-views": ["../platform-views/src"], - "@tsed/components-scan": ["../../third-parties/components-scan/src"], - "@tsed/common": ["../common/src"], - "@tsed/ajv": ["../../specs/ajv/src"], - "@tsed/platform-cache": ["../platform-cache/src"], - "@tsed/swagger": ["../../specs/swagger/src"], - "@tsed/platform-test-sdk": ["../platform-test-sdk/src"], - "@tsed/platform-express": ["../platform-express/src"], - "@tsed/platform-koa": ["../platform-koa/src"] + "@tsed/openspec": ["../../specs/openspec/src/index.ts"], + "@tsed/schema": ["../../specs/schema/src/index.ts"], + "@tsed/di": ["../../di/src/index.ts"], + "@tsed/exceptions": ["../../specs/exceptions/src/index.ts"], + "@tsed/json-mapper": ["../../specs/json-mapper/src/index.ts"], + "@tsed/platform-exceptions": ["../platform-exceptions/src/index.ts"], + "@tsed/platform-middlewares": ["../platform-middlewares/src/index.ts"], + "@tsed/platform-params": ["../platform-params/src/index.ts"], + "@tsed/platform-log-middleware": ["../platform-log-middleware/src/index.ts"], + "@tsed/platform-router": ["../platform-router/src/index.ts"], + "@tsed/platform-views": ["../platform-views/src/index.ts"], + "@tsed/normalize-path": ["../../utils/normalize-path/src/index.ts"], + "@tsed/components-scan": ["../../third-parties/components-scan/src/index.ts"], + "@tsed/common": ["../common/src/index.ts"], + "@tsed/ajv": ["../../specs/ajv/src/index.ts"], + "@tsed/platform-cache": ["../platform-cache/src/index.ts"], + "@tsed/swagger": ["../../specs/swagger/src/index.ts"], + "@tsed/platform-test-sdk": ["../platform-test-sdk/src/index.ts"], + "@tsed/platform-express": ["../platform-express/src/index.ts"], + "@tsed/platform-koa": ["../platform-koa/src/index.ts"] }, "types": ["vite/client", "vitest/globals"] }, diff --git a/packages/platform/platform-router/package.json b/packages/platform/platform-router/package.json index a7e0e24fdd0..58edbc716f5 100644 --- a/packages/platform/platform-router/package.json +++ b/packages/platform/platform-router/package.json @@ -11,7 +11,7 @@ ".": { "types": "./lib/types/index.d.ts", "import": "./lib/esm/index.js", - "default": "./lib/cjs/index.js" + "default": "./lib/esm/index.js" } }, "scripts": { diff --git a/packages/platform/platform-router/src/domain/PlatformHandlerMetadata.ts b/packages/platform/platform-router/src/domain/PlatformHandlerMetadata.ts index c6803a167c3..93f93b79717 100644 --- a/packages/platform/platform-router/src/domain/PlatformHandlerMetadata.ts +++ b/packages/platform/platform-router/src/domain/PlatformHandlerMetadata.ts @@ -1,10 +1,11 @@ import {nameOf} from "@tsed/core"; -import {DIContext, InjectorService, Provider, ProviderScope, TokenProvider} from "@tsed/di"; +import type {DIContext, InjectorService, Provider, TokenProvider} from "@tsed/di"; +import {ProviderScope} from "@tsed/di"; import {ParamTypes} from "@tsed/platform-params"; import {EndpointMetadata, JsonEntityStore, JsonParameterStore} from "@tsed/schema"; import {PlatformHandlerType} from "./PlatformHandlerType.js"; -import {SinglePathType} from "./SinglePathType.js"; +import type {SinglePathType} from "./SinglePathType.js"; export interface PlatformHandlerMetadataOpts extends Record { token?: TokenProvider; diff --git a/packages/platform/platform-router/src/domain/PlatformLayer.ts b/packages/platform/platform-router/src/domain/PlatformLayer.ts index f61d9ac3c40..aa771ee25a6 100644 --- a/packages/platform/platform-router/src/domain/PlatformLayer.ts +++ b/packages/platform/platform-router/src/domain/PlatformLayer.ts @@ -1,11 +1,12 @@ -import {isPrimitive, nameOf, Type} from "@tsed/core"; -import {Provider} from "@tsed/di"; +import type {Type} from "@tsed/core"; +import {isPrimitive, nameOf} from "@tsed/core"; +import type {Provider} from "@tsed/di"; import type {PlatformParamsCallback} from "@tsed/platform-params"; import {concatPath} from "@tsed/schema"; -import {PlatformHandlerMetadata} from "./PlatformHandlerMetadata.js"; +import type {PlatformHandlerMetadata} from "./PlatformHandlerMetadata.js"; import type {PlatformRouter} from "./PlatformRouter.js"; -import {SinglePathType} from "./SinglePathType.js"; +import type {SinglePathType} from "./SinglePathType.js"; export interface PlatformLayerOptions extends Record { token?: Type; diff --git a/packages/platform/platform-router/src/domain/PlatformRouter.ts b/packages/platform/platform-router/src/domain/PlatformRouter.ts index c8011fc0247..6693f2a521a 100644 --- a/packages/platform/platform-router/src/domain/PlatformRouter.ts +++ b/packages/platform/platform-router/src/domain/PlatformRouter.ts @@ -1,11 +1,12 @@ import {isString} from "@tsed/core"; -import {Injectable, InjectorService, Provider, ProviderScope, Scope} from "@tsed/di"; +import {Inject, Injectable, InjectorService, type Provider, ProviderScope, Scope} from "@tsed/di"; import {concatPath} from "@tsed/schema"; import {formatMethod} from "../utils/formatMethod.js"; import {PlatformHandlerMetadata} from "./PlatformHandlerMetadata.js"; -import {PlatformLayer, PlatformLayerOptions} from "./PlatformLayer.js"; -import {SinglePathType} from "./SinglePathType.js"; +import type {PlatformLayerOptions} from "./PlatformLayer.js"; +import {PlatformLayer} from "./PlatformLayer.js"; +import type {SinglePathType} from "./SinglePathType.js"; function printHandler(handler: any) { return handler.toString().split("{")[0].trim(); @@ -18,7 +19,7 @@ export class PlatformRouter { provider: Provider; #isBuilt = false; - constructor(protected readonly injector: InjectorService) {} + constructor(@Inject(InjectorService) protected readonly injector: InjectorService) {} use(...handlers: any[]) { const layer = handlers.reduce( diff --git a/packages/platform/platform-router/src/domain/PlatformRouters.ts b/packages/platform/platform-router/src/domain/PlatformRouters.ts index 2c019ea4fd4..f4ecacb007e 100644 --- a/packages/platform/platform-router/src/domain/PlatformRouters.ts +++ b/packages/platform/platform-router/src/domain/PlatformRouters.ts @@ -1,10 +1,21 @@ -import {getValue, Hooks, Type} from "@tsed/core"; -import {ControllerProvider, GlobalProviders, Injectable, InjectorService, Provider, ProviderType, TokenProvider} from "@tsed/di"; -import {PlatformParamsCallback} from "@tsed/platform-params"; -import {concatPath, getOperationsRoutes, JsonMethodStore, OPERATION_HTTP_VERBS} from "@tsed/schema"; +import type {Type} from "@tsed/core"; +import {getValue, Hooks} from "@tsed/core"; +import { + ControllerProvider, + GlobalProviders, + Inject, + Injectable, + InjectorService, + type Provider, + ProviderType, + type TokenProvider +} from "@tsed/di"; +import type {PlatformParamsCallback} from "@tsed/platform-params"; +import type {JsonMethodStore} from "@tsed/schema"; +import {concatPath, getOperationsRoutes, OPERATION_HTTP_VERBS} from "@tsed/schema"; import {useContextHandler} from "../utils/useContextHandler.js"; -import {PlatformHandlerMetadata} from "./PlatformHandlerMetadata.js"; +import type {PlatformHandlerMetadata} from "./PlatformHandlerMetadata.js"; import {PlatformLayer} from "./PlatformLayer.js"; import {PlatformRouter} from "./PlatformRouter.js"; @@ -53,7 +64,7 @@ export class PlatformRouters { readonly hooks = new Hooks(); readonly allowedVerbs = OPERATION_HTTP_VERBS; - constructor(protected readonly injector: InjectorService) {} + constructor(@Inject(InjectorService) protected readonly injector: InjectorService) {} prebuild() { this.injector.getProviders(ProviderType.CONTROLLER).forEach((provider: ControllerProvider) => { diff --git a/packages/platform/platform-router/src/utils/useContextHandler.ts b/packages/platform/platform-router/src/utils/useContextHandler.ts index f361183fcd8..ae3ae5a1102 100644 --- a/packages/platform/platform-router/src/utils/useContextHandler.ts +++ b/packages/platform/platform-router/src/utils/useContextHandler.ts @@ -1,4 +1,4 @@ -import {DIContext} from "@tsed/di"; +import type {DIContext} from "@tsed/di"; import {PlatformHandlerType} from "../domain/PlatformHandlerType.js"; diff --git a/packages/platform/platform-router/test/routers-alter-endpoint-handlers.integration.spec.ts b/packages/platform/platform-router/test/routers-alter-endpoint-handlers.integration.spec.ts index b404382768a..9f902679dc0 100644 --- a/packages/platform/platform-router/test/routers-alter-endpoint-handlers.integration.spec.ts +++ b/packages/platform/platform-router/test/routers-alter-endpoint-handlers.integration.spec.ts @@ -1,11 +1,15 @@ -import {PlatformHandlerMetadata, PlatformParamsScope, PlatformTest} from "@tsed/common"; -import {Controller, DIContext, InjectorService} from "@tsed/di"; +import type {PlatformHandlerMetadata, PlatformParamsScope} from "@tsed/common"; +import {PlatformTest} from "@tsed/common"; +import type {DIContext} from "@tsed/di"; +import {Controller, InjectorService} from "@tsed/di"; import {UseBefore} from "@tsed/platform-middlewares"; import {Context, PlatformParams} from "@tsed/platform-params"; -import {EndpointMetadata, Get, JsonOperationRoute} from "@tsed/schema"; +import type {JsonOperationRoute} from "@tsed/schema"; +import {EndpointMetadata, Get} from "@tsed/schema"; import {PlatformRouter} from "../src/domain/PlatformRouter.js"; -import {AlterEndpointHandlersArg, PlatformRouters} from "../src/domain/PlatformRouters.js"; +import type {AlterEndpointHandlersArg} from "../src/domain/PlatformRouters.js"; +import {PlatformRouters} from "../src/domain/PlatformRouters.js"; import {useContextHandler} from "../src/index.js"; @Controller("/controller") diff --git a/packages/platform/platform-router/test/routers-injection.integration.spec.ts b/packages/platform/platform-router/test/routers-injection.integration.spec.ts index 07282438774..d87d907fda0 100644 --- a/packages/platform/platform-router/test/routers-injection.integration.spec.ts +++ b/packages/platform/platform-router/test/routers-injection.integration.spec.ts @@ -1,4 +1,5 @@ -import {Controller, ControllerProvider, InjectorService} from "@tsed/di"; +import type {ControllerProvider} from "@tsed/di"; +import {Controller, InjectorService} from "@tsed/di"; import {PlatformParams} from "@tsed/platform-params"; import {PlatformRouter} from "../src/domain/PlatformRouter.js"; diff --git a/packages/platform/platform-router/test/routers.integration.spec.ts b/packages/platform/platform-router/test/routers.integration.spec.ts index 1041aff9d67..588f5e5545a 100644 --- a/packages/platform/platform-router/test/routers.integration.spec.ts +++ b/packages/platform/platform-router/test/routers.integration.spec.ts @@ -1,4 +1,5 @@ -import {PlatformContext, PlatformHandlerMetadata, PlatformTest, useResponseHandler} from "@tsed/common"; +import type {PlatformHandlerMetadata} from "@tsed/common"; +import {PlatformContext, PlatformTest, useResponseHandler} from "@tsed/common"; import {catchError} from "@tsed/core"; import {Controller, InjectorService} from "@tsed/di"; import {UseBefore} from "@tsed/platform-middlewares"; @@ -6,7 +7,8 @@ import {Context, PlatformParams} from "@tsed/platform-params"; import {Delete, Get, Head, Options, Patch, Post, Publish, Put, Subscribe} from "@tsed/schema"; import {PlatformRouter} from "../src/domain/PlatformRouter.js"; -import {AlterEndpointHandlersArg, PlatformRouters} from "../src/domain/PlatformRouters.js"; +import type {AlterEndpointHandlersArg} from "../src/domain/PlatformRouters.js"; +import {PlatformRouters} from "../src/domain/PlatformRouters.js"; @Controller("/nested") class NestedController { diff --git a/packages/platform/platform-router/tsconfig.esm.json b/packages/platform/platform-router/tsconfig.esm.json index 82292550ddb..8954049da4a 100644 --- a/packages/platform/platform-router/tsconfig.esm.json +++ b/packages/platform/platform-router/tsconfig.esm.json @@ -2,7 +2,6 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", diff --git a/packages/platform/platform-router/tsconfig.spec.json b/packages/platform/platform-router/tsconfig.spec.json index 5715f3d0d5c..330df296299 100644 --- a/packages/platform/platform-router/tsconfig.spec.json +++ b/packages/platform/platform-router/tsconfig.spec.json @@ -3,30 +3,30 @@ "compilerOptions": { "baseUrl": ".", "rootDir": "../..", - "outDir": "./lib/cjs", "declaration": false, "composite": false, "noEmit": true, "paths": { - "@tsed/openspec": ["../../specs/openspec/src"], - "@tsed/schema": ["../../specs/schema/src"], - "@tsed/di": ["../../di/src"], - "@tsed/exceptions": ["../../specs/exceptions/src"], - "@tsed/json-mapper": ["../../specs/json-mapper/src"], - "@tsed/platform-exceptions": ["../platform-exceptions/src"], - "@tsed/platform-middlewares": ["../platform-middlewares/src"], - "@tsed/platform-params": ["../platform-params/src"], - "@tsed/platform-log-middleware": ["../platform-log-middleware/src"], - "@tsed/platform-response-filter": ["../platform-response-filter/src"], - "@tsed/platform-views": ["../platform-views/src"], - "@tsed/components-scan": ["../../third-parties/components-scan/src"], - "@tsed/common": ["../common/src"], - "@tsed/ajv": ["../../specs/ajv/src"], - "@tsed/platform-cache": ["../platform-cache/src"], - "@tsed/swagger": ["../../specs/swagger/src"], - "@tsed/platform-test-sdk": ["../platform-test-sdk/src"], - "@tsed/platform-express": ["../platform-express/src"], - "@tsed/platform-koa": ["../platform-koa/src"] + "@tsed/openspec": ["../../specs/openspec/src/index.ts"], + "@tsed/schema": ["../../specs/schema/src/index.ts"], + "@tsed/di": ["../../di/src/index.ts"], + "@tsed/exceptions": ["../../specs/exceptions/src/index.ts"], + "@tsed/json-mapper": ["../../specs/json-mapper/src/index.ts"], + "@tsed/platform-exceptions": ["../platform-exceptions/src/index.ts"], + "@tsed/platform-middlewares": ["../platform-middlewares/src/index.ts"], + "@tsed/platform-params": ["../platform-params/src/index.ts"], + "@tsed/platform-log-middleware": ["../platform-log-middleware/src/index.ts"], + "@tsed/platform-response-filter": ["../platform-response-filter/src/index.ts"], + "@tsed/platform-views": ["../platform-views/src/index.ts"], + "@tsed/normalize-path": ["../../utils/normalize-path/src/index.ts"], + "@tsed/components-scan": ["../../third-parties/components-scan/src/index.ts"], + "@tsed/common": ["../common/src/index.ts"], + "@tsed/ajv": ["../../specs/ajv/src/index.ts"], + "@tsed/platform-cache": ["../platform-cache/src/index.ts"], + "@tsed/swagger": ["../../specs/swagger/src/index.ts"], + "@tsed/platform-test-sdk": ["../platform-test-sdk/src/index.ts"], + "@tsed/platform-express": ["../platform-express/src/index.ts"], + "@tsed/platform-koa": ["../platform-koa/src/index.ts"] }, "types": ["vite/client", "vitest/globals"] }, diff --git a/packages/platform/platform-serverless-http/package.json b/packages/platform/platform-serverless-http/package.json index 8b479a8c6ed..d893c9f89cf 100644 --- a/packages/platform/platform-serverless-http/package.json +++ b/packages/platform/platform-serverless-http/package.json @@ -11,7 +11,7 @@ ".": { "types": "./lib/types/index.d.ts", "import": "./lib/esm/index.js", - "default": "./lib/cjs/index.js" + "default": "./lib/esm/index.js" } }, "scripts": { diff --git a/packages/platform/platform-serverless-http/src/builder/PlatformServerlessHttp.ts b/packages/platform/platform-serverless-http/src/builder/PlatformServerlessHttp.ts index 0c0ed314918..3660a914196 100644 --- a/packages/platform/platform-serverless-http/src/builder/PlatformServerlessHttp.ts +++ b/packages/platform/platform-serverless-http/src/builder/PlatformServerlessHttp.ts @@ -1,5 +1,6 @@ -import {PlatformBuilder, PlatformBuilderSettings} from "@tsed/common"; -import {Type} from "@tsed/core"; +import type {PlatformBuilderSettings} from "@tsed/common"; +import {PlatformBuilder} from "@tsed/common"; +import type {Type} from "@tsed/core"; import type {Handler} from "aws-lambda"; import serverless from "serverless-http"; diff --git a/packages/platform/platform-serverless-http/src/decorators/serverlessContext.ts b/packages/platform/platform-serverless-http/src/decorators/serverlessContext.ts index d966a32faf5..b9d829bf8ad 100644 --- a/packages/platform/platform-serverless-http/src/decorators/serverlessContext.ts +++ b/packages/platform/platform-serverless-http/src/decorators/serverlessContext.ts @@ -1,5 +1,5 @@ import {Req} from "@tsed/common"; -import {Context} from "aws-lambda"; +import type {Context} from "aws-lambda"; /** * Return the Serverless context diff --git a/packages/platform/platform-serverless-http/test/integration/aws-basic/package.json b/packages/platform/platform-serverless-http/test/integration/aws-basic/package.json index 2c9f73aaeb7..529366232b0 100644 --- a/packages/platform/platform-serverless-http/test/integration/aws-basic/package.json +++ b/packages/platform/platform-serverless-http/test/integration/aws-basic/package.json @@ -16,6 +16,6 @@ "terser-webpack-plugin": "^5.2.5", "fork-ts-checker-webpack-plugin": "^6.4.0", "tsconfig-paths-webpack-plugin": "^3.5.2", - "typescript": "^4.9.5" + "typescript": "^5.6.2" } } diff --git a/packages/platform/platform-serverless-http/test/integration/aws-basic/src/Server.ts b/packages/platform/platform-serverless-http/test/integration/aws-basic/src/Server.ts index d21396888c7..8edc31e4d95 100644 --- a/packages/platform/platform-serverless-http/test/integration/aws-basic/src/Server.ts +++ b/packages/platform/platform-serverless-http/test/integration/aws-basic/src/Server.ts @@ -16,7 +16,7 @@ import {TimeslotsController} from "./TimeslotsController.js"; } }) export class Server { - @Inject() + @Inject(PlatformApplication) app: PlatformApplication; public $beforeRoutesInit(): void { diff --git a/packages/platform/platform-serverless-http/tsconfig.esm.json b/packages/platform/platform-serverless-http/tsconfig.esm.json index 82292550ddb..8954049da4a 100644 --- a/packages/platform/platform-serverless-http/tsconfig.esm.json +++ b/packages/platform/platform-serverless-http/tsconfig.esm.json @@ -2,7 +2,6 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", diff --git a/packages/platform/platform-serverless-http/tsconfig.spec.json b/packages/platform/platform-serverless-http/tsconfig.spec.json index e4a7187922c..75681d74473 100644 --- a/packages/platform/platform-serverless-http/tsconfig.spec.json +++ b/packages/platform/platform-serverless-http/tsconfig.spec.json @@ -3,31 +3,31 @@ "compilerOptions": { "baseUrl": ".", "rootDir": "../..", - "outDir": "./lib/cjs", "declaration": false, "composite": false, "noEmit": true, "paths": { - "@tsed/openspec": ["../../specs/openspec/src"], - "@tsed/schema": ["../../specs/schema/src"], - "@tsed/di": ["../../di/src"], - "@tsed/exceptions": ["../../specs/exceptions/src"], - "@tsed/json-mapper": ["../../specs/json-mapper/src"], - "@tsed/platform-exceptions": ["../platform-exceptions/src"], - "@tsed/platform-middlewares": ["../platform-middlewares/src"], - "@tsed/platform-params": ["../platform-params/src"], - "@tsed/platform-log-middleware": ["../platform-log-middleware/src"], - "@tsed/platform-response-filter": ["../platform-response-filter/src"], - "@tsed/platform-router": ["../platform-router/src"], - "@tsed/platform-views": ["../platform-views/src"], - "@tsed/components-scan": ["../../third-parties/components-scan/src"], - "@tsed/common": ["../common/src"], - "@tsed/ajv": ["../../specs/ajv/src"], - "@tsed/platform-cache": ["../platform-cache/src"], - "@tsed/swagger": ["../../specs/swagger/src"], - "@tsed/platform-test-sdk": ["../platform-test-sdk/src"], - "@tsed/platform-express": ["../platform-express/src"], - "@tsed/platform-koa": ["../platform-koa/src"] + "@tsed/openspec": ["../../specs/openspec/src/index.ts"], + "@tsed/schema": ["../../specs/schema/src/index.ts"], + "@tsed/di": ["../../di/src/index.ts"], + "@tsed/exceptions": ["../../specs/exceptions/src/index.ts"], + "@tsed/json-mapper": ["../../specs/json-mapper/src/index.ts"], + "@tsed/platform-exceptions": ["../platform-exceptions/src/index.ts"], + "@tsed/platform-middlewares": ["../platform-middlewares/src/index.ts"], + "@tsed/platform-params": ["../platform-params/src/index.ts"], + "@tsed/platform-log-middleware": ["../platform-log-middleware/src/index.ts"], + "@tsed/platform-response-filter": ["../platform-response-filter/src/index.ts"], + "@tsed/platform-router": ["../platform-router/src/index.ts"], + "@tsed/platform-views": ["../platform-views/src/index.ts"], + "@tsed/normalize-path": ["../../utils/normalize-path/src/index.ts"], + "@tsed/components-scan": ["../../third-parties/components-scan/src/index.ts"], + "@tsed/common": ["../common/src/index.ts"], + "@tsed/ajv": ["../../specs/ajv/src/index.ts"], + "@tsed/platform-cache": ["../platform-cache/src/index.ts"], + "@tsed/swagger": ["../../specs/swagger/src/index.ts"], + "@tsed/platform-test-sdk": ["../platform-test-sdk/src/index.ts"], + "@tsed/platform-express": ["../platform-express/src/index.ts"], + "@tsed/platform-koa": ["../platform-koa/src/index.ts"] }, "types": ["vite/client", "vitest/globals"] }, diff --git a/packages/platform/platform-serverless-testing/package.json b/packages/platform/platform-serverless-testing/package.json index 33eac3f6056..70da40f4eba 100644 --- a/packages/platform/platform-serverless-testing/package.json +++ b/packages/platform/platform-serverless-testing/package.json @@ -11,7 +11,7 @@ ".": { "types": "./lib/types/index.d.ts", "import": "./lib/esm/index.js", - "default": "./lib/cjs/index.js" + "default": "./lib/esm/index.js" } }, "scripts": { diff --git a/packages/platform/platform-serverless-testing/src/PlatformServerlessTest.ts b/packages/platform/platform-serverless-testing/src/PlatformServerlessTest.ts index d33203121ea..0cc8bbe152f 100644 --- a/packages/platform/platform-serverless-testing/src/PlatformServerlessTest.ts +++ b/packages/platform/platform-serverless-testing/src/PlatformServerlessTest.ts @@ -1,8 +1,9 @@ -import {PlatformBuilder, PlatformBuilderSettings} from "@tsed/common"; -import {nameOf, Type} from "@tsed/core"; +import type {PlatformBuilder, PlatformBuilderSettings} from "@tsed/common"; +import type {Type} from "@tsed/core"; +import {nameOf} from "@tsed/core"; import {DITest} from "@tsed/di"; -import {APIGatewayEventDefaultAuthorizerContext, APIGatewayProxyEventBase, APIGatewayProxyHandler} from "aws-lambda"; -import {APIGatewayProxyResult} from "aws-lambda/trigger/api-gateway-proxy.js"; +import type {APIGatewayEventDefaultAuthorizerContext, APIGatewayProxyEventBase, APIGatewayProxyHandler} from "aws-lambda"; +import type {APIGatewayProxyResult} from "aws-lambda/trigger/api-gateway-proxy.js"; import {createFakeContext} from "./createFakeContext.js"; import {createFakeEvent} from "./createFakeEvent.js"; diff --git a/packages/platform/platform-serverless-testing/src/createFakeContext.ts b/packages/platform/platform-serverless-testing/src/createFakeContext.ts index 2f1dda08d1b..443b2337e7d 100644 --- a/packages/platform/platform-serverless-testing/src/createFakeContext.ts +++ b/packages/platform/platform-serverless-testing/src/createFakeContext.ts @@ -1,4 +1,4 @@ -import {Context} from "aws-lambda"; +import type {Context} from "aws-lambda"; export function createFakeContext(context?: Context): Context { return { diff --git a/packages/platform/platform-serverless-testing/src/createFakeEvent.ts b/packages/platform/platform-serverless-testing/src/createFakeEvent.ts index 5232d6399ef..670e3e4186b 100644 --- a/packages/platform/platform-serverless-testing/src/createFakeEvent.ts +++ b/packages/platform/platform-serverless-testing/src/createFakeEvent.ts @@ -1,4 +1,4 @@ -import {APIGatewayEventDefaultAuthorizerContext, APIGatewayProxyEventBase} from "aws-lambda"; +import type {APIGatewayEventDefaultAuthorizerContext, APIGatewayProxyEventBase} from "aws-lambda"; export function createFakeEvent(event: Partial> = {}) { return { diff --git a/packages/platform/platform-serverless-testing/tsconfig.esm.json b/packages/platform/platform-serverless-testing/tsconfig.esm.json index 82292550ddb..8954049da4a 100644 --- a/packages/platform/platform-serverless-testing/tsconfig.esm.json +++ b/packages/platform/platform-serverless-testing/tsconfig.esm.json @@ -2,7 +2,6 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", diff --git a/packages/platform/platform-serverless/package.json b/packages/platform/platform-serverless/package.json index f505c2c0989..500c7ee7abc 100644 --- a/packages/platform/platform-serverless/package.json +++ b/packages/platform/platform-serverless/package.json @@ -11,7 +11,7 @@ ".": { "types": "./lib/types/index.d.ts", "import": "./lib/esm/index.js", - "default": "./lib/cjs/index.js" + "default": "./lib/esm/index.js" } }, "scripts": { @@ -40,6 +40,7 @@ "@types/aws-lambda": "^8.10.136", "@types/encodeurl": "^1.0.2", "@types/mime": "^3.0.4", + "aws-lambda": "1.0.7", "eslint": "^8.57.0", "find-my-way": "^8.2.0", "typescript": "5.6.2", diff --git a/packages/platform/platform-serverless/src/builder/PlatformServerless.ts b/packages/platform/platform-serverless/src/builder/PlatformServerless.ts index e9f8fb6a4d9..0bfdd30e140 100644 --- a/packages/platform/platform-serverless/src/builder/PlatformServerless.ts +++ b/packages/platform/platform-serverless/src/builder/PlatformServerless.ts @@ -1,6 +1,8 @@ -import {Env, Type} from "@tsed/core"; +import type {Type} from "@tsed/core"; +import {Env} from "@tsed/core"; import {createContainer, InjectorService, setLoggerConfiguration} from "@tsed/di"; -import {$log, Logger} from "@tsed/logger"; +import type {Logger} from "@tsed/logger"; +import {$log} from "@tsed/logger"; import {getOperationsRoutes, JsonEntityStore} from "@tsed/schema"; import type {Handler} from "aws-lambda"; import type {Context} from "aws-lambda/handler.js"; diff --git a/packages/platform/platform-serverless/src/builder/PlatformServerlessHandler.ts b/packages/platform/platform-serverless/src/builder/PlatformServerlessHandler.ts index c39b79e0cba..c52ecfc3520 100644 --- a/packages/platform/platform-serverless/src/builder/PlatformServerlessHandler.ts +++ b/packages/platform/platform-serverless/src/builder/PlatformServerlessHandler.ts @@ -1,12 +1,13 @@ import {pipeline} from "node:stream/promises"; -import {AnyPromiseResult, AnyToPromise, isSerializable, isStream} from "@tsed/core"; -import {BaseContext, Inject, Injectable, InjectorService, LazyInject, ProviderScope, TokenProvider} from "@tsed/di"; +import type {AnyPromiseResult} from "@tsed/core"; +import {AnyToPromise, isSerializable, isStream} from "@tsed/core"; +import {type BaseContext, Inject, Injectable, InjectorService, LazyInject, ProviderScope, type TokenProvider} from "@tsed/di"; import {serialize} from "@tsed/json-mapper"; import type {PlatformExceptions} from "@tsed/platform-exceptions"; import {DeserializerPipe, PlatformParams, ValidationPipe} from "@tsed/platform-params"; -import {ServerlessContext} from "../domain/ServerlessContext.js"; +import type {ServerlessContext} from "../domain/ServerlessContext.js"; import type {ServerlessEvent} from "../domain/ServerlessEvent.js"; import {ServerlessResponseStream} from "../domain/ServerlessResponseStream.js"; import {setResponseHeaders} from "../utils/setResponseHeaders.js"; @@ -16,10 +17,10 @@ import {setResponseHeaders} from "../utils/setResponseHeaders.js"; imports: [DeserializerPipe, ValidationPipe] }) export class PlatformServerlessHandler { - @Inject() + @Inject(InjectorService) protected injector: InjectorService; - @Inject() + @Inject(PlatformParams) protected params: PlatformParams; @LazyInject("PlatformExceptions", () => import("@tsed/platform-exceptions")) diff --git a/packages/platform/platform-serverless/src/domain/ServerlessContext.ts b/packages/platform/platform-serverless/src/domain/ServerlessContext.ts index 598b6ce6a03..69b9e332b9a 100644 --- a/packages/platform/platform-serverless/src/domain/ServerlessContext.ts +++ b/packages/platform/platform-serverless/src/domain/ServerlessContext.ts @@ -1,6 +1,7 @@ -import {DIContext, DIContextOptions} from "@tsed/di"; -import {JsonEntityStore} from "@tsed/schema"; -import {type APIGatewayProxyEvent, Context} from "aws-lambda"; +import type {DIContextOptions} from "@tsed/di"; +import {DIContext} from "@tsed/di"; +import type {JsonEntityStore} from "@tsed/schema"; +import type {APIGatewayProxyEvent, Context} from "aws-lambda"; import {ServerlessRequest} from "./ServerlessRequest.js"; import {ServerlessResponse} from "./ServerlessResponse.js"; diff --git a/packages/platform/platform-serverless/src/domain/ServerlessRequest.ts b/packages/platform/platform-serverless/src/domain/ServerlessRequest.ts index eeaf3a4ac4f..6a02ad58c28 100644 --- a/packages/platform/platform-serverless/src/domain/ServerlessRequest.ts +++ b/packages/platform/platform-serverless/src/domain/ServerlessRequest.ts @@ -1,7 +1,7 @@ import {getValue} from "@tsed/core"; import type {APIGatewayProxyEvent} from "aws-lambda"; -import {ServerlessContext} from "./ServerlessContext.js"; +import type {ServerlessContext} from "./ServerlessContext.js"; /** * @platform diff --git a/packages/platform/platform-serverless/src/domain/ServerlessResponse.ts b/packages/platform/platform-serverless/src/domain/ServerlessResponse.ts index a53d9d23dcb..d024fbaeb9f 100644 --- a/packages/platform/platform-serverless/src/domain/ServerlessResponse.ts +++ b/packages/platform/platform-serverless/src/domain/ServerlessResponse.ts @@ -4,7 +4,7 @@ import type {APIGatewayProxyEvent} from "aws-lambda"; import encodeUrl from "encodeurl"; import mime from "mime"; -import {ServerlessContext} from "./ServerlessContext.js"; +import type {ServerlessContext} from "./ServerlessContext.js"; export type HeaderValue = boolean | number | string; diff --git a/packages/platform/platform-serverless/src/utils/getRequestId.ts b/packages/platform/platform-serverless/src/utils/getRequestId.ts index c62c261ade5..d443fbbcbd8 100644 --- a/packages/platform/platform-serverless/src/utils/getRequestId.ts +++ b/packages/platform/platform-serverless/src/utils/getRequestId.ts @@ -1,4 +1,4 @@ -import {Context} from "aws-lambda"; +import type {Context} from "aws-lambda"; import {v4} from "uuid"; import type {ServerlessEvent} from "../domain/ServerlessEvent.js"; diff --git a/packages/platform/platform-serverless/src/utils/setResponseHeaders.ts b/packages/platform/platform-serverless/src/utils/setResponseHeaders.ts index aaf76d2ba51..968a9742003 100644 --- a/packages/platform/platform-serverless/src/utils/setResponseHeaders.ts +++ b/packages/platform/platform-serverless/src/utils/setResponseHeaders.ts @@ -1,8 +1,8 @@ -import {JsonHeader, JsonOperation} from "@tsed/schema"; +import type {JsonHeader, JsonOperation} from "@tsed/schema"; -import {ServerlessContext} from "../domain/ServerlessContext.js"; +import type {ServerlessContext} from "../domain/ServerlessContext.js"; import type {ServerlessEvent} from "../domain/ServerlessEvent.js"; -import {HeaderValue} from "../domain/ServerlessResponse.js"; +import type {HeaderValue} from "../domain/ServerlessResponse.js"; function mergeHeaders(specHeaders: Record, headers: Record) { return Object.entries(specHeaders).reduce((headers, [key, item]) => { diff --git a/packages/platform/platform-serverless/test/response.integration.spec.ts b/packages/platform/platform-serverless/test/response.integration.spec.ts index e1d9bc62c24..b72f0f8699b 100644 --- a/packages/platform/platform-serverless/test/response.integration.spec.ts +++ b/packages/platform/platform-serverless/test/response.integration.spec.ts @@ -2,7 +2,7 @@ import {Injectable} from "@tsed/di"; import {PlatformServerlessTest} from "@tsed/platform-serverless-testing"; import {MinLength, Post, Property} from "@tsed/schema"; -import {BodyParams, PlatformServerless} from ".."; +import {BodyParams, PlatformServerless} from "../src/index.js"; class Model { @Property() diff --git a/packages/platform/platform-serverless/test/utils/createServerlessContext.ts b/packages/platform/platform-serverless/test/utils/createServerlessContext.ts index b163ac8a8e7..cf743fea43e 100644 --- a/packages/platform/platform-serverless/test/utils/createServerlessContext.ts +++ b/packages/platform/platform-serverless/test/utils/createServerlessContext.ts @@ -1,6 +1,6 @@ -import {Logger} from "@tsed/logger"; +import type {Logger} from "@tsed/logger"; import {createFakeContext, createFakeEvent, PlatformServerlessTest} from "@tsed/platform-serverless-testing"; -import {JsonEntityStore} from "@tsed/schema"; +import type {JsonEntityStore} from "@tsed/schema"; import {ServerlessContext} from "../../src/domain/ServerlessContext.js"; diff --git a/packages/platform/platform-serverless/tsconfig.esm.json b/packages/platform/platform-serverless/tsconfig.esm.json index 82292550ddb..8954049da4a 100644 --- a/packages/platform/platform-serverless/tsconfig.esm.json +++ b/packages/platform/platform-serverless/tsconfig.esm.json @@ -2,7 +2,6 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", diff --git a/packages/platform/platform-serverless/tsconfig.spec.json b/packages/platform/platform-serverless/tsconfig.spec.json index e4a7187922c..75681d74473 100644 --- a/packages/platform/platform-serverless/tsconfig.spec.json +++ b/packages/platform/platform-serverless/tsconfig.spec.json @@ -3,31 +3,31 @@ "compilerOptions": { "baseUrl": ".", "rootDir": "../..", - "outDir": "./lib/cjs", "declaration": false, "composite": false, "noEmit": true, "paths": { - "@tsed/openspec": ["../../specs/openspec/src"], - "@tsed/schema": ["../../specs/schema/src"], - "@tsed/di": ["../../di/src"], - "@tsed/exceptions": ["../../specs/exceptions/src"], - "@tsed/json-mapper": ["../../specs/json-mapper/src"], - "@tsed/platform-exceptions": ["../platform-exceptions/src"], - "@tsed/platform-middlewares": ["../platform-middlewares/src"], - "@tsed/platform-params": ["../platform-params/src"], - "@tsed/platform-log-middleware": ["../platform-log-middleware/src"], - "@tsed/platform-response-filter": ["../platform-response-filter/src"], - "@tsed/platform-router": ["../platform-router/src"], - "@tsed/platform-views": ["../platform-views/src"], - "@tsed/components-scan": ["../../third-parties/components-scan/src"], - "@tsed/common": ["../common/src"], - "@tsed/ajv": ["../../specs/ajv/src"], - "@tsed/platform-cache": ["../platform-cache/src"], - "@tsed/swagger": ["../../specs/swagger/src"], - "@tsed/platform-test-sdk": ["../platform-test-sdk/src"], - "@tsed/platform-express": ["../platform-express/src"], - "@tsed/platform-koa": ["../platform-koa/src"] + "@tsed/openspec": ["../../specs/openspec/src/index.ts"], + "@tsed/schema": ["../../specs/schema/src/index.ts"], + "@tsed/di": ["../../di/src/index.ts"], + "@tsed/exceptions": ["../../specs/exceptions/src/index.ts"], + "@tsed/json-mapper": ["../../specs/json-mapper/src/index.ts"], + "@tsed/platform-exceptions": ["../platform-exceptions/src/index.ts"], + "@tsed/platform-middlewares": ["../platform-middlewares/src/index.ts"], + "@tsed/platform-params": ["../platform-params/src/index.ts"], + "@tsed/platform-log-middleware": ["../platform-log-middleware/src/index.ts"], + "@tsed/platform-response-filter": ["../platform-response-filter/src/index.ts"], + "@tsed/platform-router": ["../platform-router/src/index.ts"], + "@tsed/platform-views": ["../platform-views/src/index.ts"], + "@tsed/normalize-path": ["../../utils/normalize-path/src/index.ts"], + "@tsed/components-scan": ["../../third-parties/components-scan/src/index.ts"], + "@tsed/common": ["../common/src/index.ts"], + "@tsed/ajv": ["../../specs/ajv/src/index.ts"], + "@tsed/platform-cache": ["../platform-cache/src/index.ts"], + "@tsed/swagger": ["../../specs/swagger/src/index.ts"], + "@tsed/platform-test-sdk": ["../platform-test-sdk/src/index.ts"], + "@tsed/platform-express": ["../platform-express/src/index.ts"], + "@tsed/platform-koa": ["../platform-koa/src/index.ts"] }, "types": ["vite/client", "vitest/globals"] }, diff --git a/packages/platform/platform-test-sdk/package.json b/packages/platform/platform-test-sdk/package.json index 660c1e31fb9..442339727e8 100644 --- a/packages/platform/platform-test-sdk/package.json +++ b/packages/platform/platform-test-sdk/package.json @@ -11,7 +11,7 @@ ".": { "types": "./lib/types/index.d.ts", "import": "./lib/esm/index.js", - "default": "./lib/cjs/index.js" + "default": "./lib/esm/index.js" } }, "scripts": { diff --git a/packages/platform/platform-test-sdk/src/components/PlatformTestSdk.ts b/packages/platform/platform-test-sdk/src/components/PlatformTestSdk.ts index d1571d394cf..2555684eaa3 100644 --- a/packages/platform/platform-test-sdk/src/components/PlatformTestSdk.ts +++ b/packages/platform/platform-test-sdk/src/components/PlatformTestSdk.ts @@ -1,6 +1,6 @@ import {PlatformTest} from "@tsed/common"; -import {PlatformTestingSdkOpts} from "../interfaces/index.js"; +import type {PlatformTestingSdkOpts} from "../interfaces/index.js"; import {specsContainer} from "../tests/exports.js"; export class PlatformTestSdk { diff --git a/packages/platform/platform-test-sdk/src/errors/CustomBadRequest.ts b/packages/platform/platform-test-sdk/src/errors/CustomBadRequest.ts index 4a956c775a6..0609c826b54 100644 --- a/packages/platform/platform-test-sdk/src/errors/CustomBadRequest.ts +++ b/packages/platform/platform-test-sdk/src/errors/CustomBadRequest.ts @@ -1,4 +1,4 @@ -import {ResponseErrorObject} from "@tsed/common"; +import type {ResponseErrorObject} from "@tsed/common"; import {BadRequest} from "@tsed/exceptions"; export class CustomBadRequest extends BadRequest implements ResponseErrorObject { diff --git a/packages/platform/platform-test-sdk/src/errors/CustomInternalError.ts b/packages/platform/platform-test-sdk/src/errors/CustomInternalError.ts index 77e3b6e78d1..a87d9957e6c 100644 --- a/packages/platform/platform-test-sdk/src/errors/CustomInternalError.ts +++ b/packages/platform/platform-test-sdk/src/errors/CustomInternalError.ts @@ -1,4 +1,4 @@ -import {ResponseErrorObject} from "@tsed/common"; +import type {ResponseErrorObject} from "@tsed/common"; import {InternalServerError} from "@tsed/exceptions"; export class CustomInternalError extends InternalServerError implements ResponseErrorObject { diff --git a/packages/platform/platform-test-sdk/src/interfaces/PlatformTestingSdkOpts.ts b/packages/platform/platform-test-sdk/src/interfaces/PlatformTestingSdkOpts.ts index 06ac709e636..48f3d473998 100644 --- a/packages/platform/platform-test-sdk/src/interfaces/PlatformTestingSdkOpts.ts +++ b/packages/platform/platform-test-sdk/src/interfaces/PlatformTestingSdkOpts.ts @@ -1,5 +1,5 @@ -import {PlatformAdapter} from "@tsed/common"; -import {Type} from "@tsed/core"; +import type {PlatformAdapter} from "@tsed/common"; +import type {Type} from "@tsed/core"; export interface PlatformTestingSdkOpts { rootDir: string; diff --git a/packages/platform/platform-test-sdk/src/tests/exports.ts b/packages/platform/platform-test-sdk/src/tests/exports.ts index bbcf38f05b0..b05de6e81e6 100644 --- a/packages/platform/platform-test-sdk/src/tests/exports.ts +++ b/packages/platform/platform-test-sdk/src/tests/exports.ts @@ -1,4 +1,4 @@ -import {PlatformTestingSdkOpts} from "../interfaces/index.js"; +import type {PlatformTestingSdkOpts} from "../interfaces/index.js"; import {testAcceptMime} from "./testAcceptMime.js"; import {testAuth} from "./testAuth.js"; import {testBodyParams} from "./testBodyParams.js"; diff --git a/packages/platform/platform-test-sdk/src/tests/testAcceptMime.ts b/packages/platform/platform-test-sdk/src/tests/testAcceptMime.ts index a8168cf5b24..5eb4f445133 100644 --- a/packages/platform/platform-test-sdk/src/tests/testAcceptMime.ts +++ b/packages/platform/platform-test-sdk/src/tests/testAcceptMime.ts @@ -3,7 +3,7 @@ import {ContentType} from "@tsed/schema"; import SuperTest from "supertest"; import {afterAll, beforeAll, describe, expect, it} from "vitest"; -import {PlatformTestingSdkOpts} from "../interfaces/index.js"; +import type {PlatformTestingSdkOpts} from "../interfaces/index.js"; @Controller("/accept-mime") class TestAcceptMimeCtrl { diff --git a/packages/platform/platform-test-sdk/src/tests/testAuth.ts b/packages/platform/platform-test-sdk/src/tests/testAuth.ts index 2896c7a2c62..902bd5a17a2 100644 --- a/packages/platform/platform-test-sdk/src/tests/testAuth.ts +++ b/packages/platform/platform-test-sdk/src/tests/testAuth.ts @@ -6,7 +6,7 @@ import SuperTest from "supertest"; import {afterAll, beforeAll, describe, expect, it} from "vitest"; import baseSpec from "../data/swagger.json"; -import {PlatformTestingSdkOpts} from "../interfaces/index.js"; +import type {PlatformTestingSdkOpts} from "../interfaces/index.js"; @Injectable() export class TokenService { diff --git a/packages/platform/platform-test-sdk/src/tests/testBodyParams.ts b/packages/platform/platform-test-sdk/src/tests/testBodyParams.ts index f170b0017fd..424eada4590 100644 --- a/packages/platform/platform-test-sdk/src/tests/testBodyParams.ts +++ b/packages/platform/platform-test-sdk/src/tests/testBodyParams.ts @@ -18,7 +18,7 @@ import { import SuperTest from "supertest"; import {afterAll, beforeAll, describe, expect, it} from "vitest"; -import {PlatformTestingSdkOpts} from "../interfaces/index.js"; +import type {PlatformTestingSdkOpts} from "../interfaces/index.js"; enum MyEnum { TITLE, diff --git a/packages/platform/platform-test-sdk/src/tests/testCache.ts b/packages/platform/platform-test-sdk/src/tests/testCache.ts index 06a5f063628..0f046a2c003 100644 --- a/packages/platform/platform-test-sdk/src/tests/testCache.ts +++ b/packages/platform/platform-test-sdk/src/tests/testCache.ts @@ -4,7 +4,7 @@ import {Property} from "@tsed/schema"; import SuperTest from "supertest"; import {afterEach, beforeEach, describe, expect, it} from "vitest"; -import {PlatformTestingSdkOpts} from "../interfaces/index.js"; +import type {PlatformTestingSdkOpts} from "../interfaces/index.js"; let increment = 0; diff --git a/packages/platform/platform-test-sdk/src/tests/testChildrenControllers.ts b/packages/platform/platform-test-sdk/src/tests/testChildrenControllers.ts index 847659a6a2c..9644dc9a862 100644 --- a/packages/platform/platform-test-sdk/src/tests/testChildrenControllers.ts +++ b/packages/platform/platform-test-sdk/src/tests/testChildrenControllers.ts @@ -2,7 +2,7 @@ import {Controller, Get, PlatformTest} from "@tsed/common"; import SuperTest from "supertest"; import {afterEach, beforeEach, describe, expect, it} from "vitest"; -import {PlatformTestingSdkOpts} from "../interfaces/index.js"; +import type {PlatformTestingSdkOpts} from "../interfaces/index.js"; export function testChildrenControllers(options: PlatformTestingSdkOpts) { let request: SuperTest.Agent; diff --git a/packages/platform/platform-test-sdk/src/tests/testCookies.ts b/packages/platform/platform-test-sdk/src/tests/testCookies.ts index 4a0550246a3..cdd63fcc8a2 100644 --- a/packages/platform/platform-test-sdk/src/tests/testCookies.ts +++ b/packages/platform/platform-test-sdk/src/tests/testCookies.ts @@ -2,7 +2,7 @@ import {Controller, CookiesParams, Get, PlatformTest} from "@tsed/common"; import SuperTest from "supertest"; import {afterAll, beforeAll, expect, it} from "vitest"; -import {PlatformTestingSdkOpts} from "../interfaces/index.js"; +import type {PlatformTestingSdkOpts} from "../interfaces/index.js"; @Controller("/cookies") export class CookiesCtrl { diff --git a/packages/platform/platform-test-sdk/src/tests/testCustom404.ts b/packages/platform/platform-test-sdk/src/tests/testCustom404.ts index 2a419f8b990..aaac3a5e540 100644 --- a/packages/platform/platform-test-sdk/src/tests/testCustom404.ts +++ b/packages/platform/platform-test-sdk/src/tests/testCustom404.ts @@ -2,7 +2,7 @@ import {PlatformTest} from "@tsed/common"; import SuperTest from "supertest"; import {afterAll, beforeAll, expect, it} from "vitest"; -import {PlatformTestingSdkOpts} from "../interfaces/index.js"; +import type {PlatformTestingSdkOpts} from "../interfaces/index.js"; export function testCustom404(options: PlatformTestingSdkOpts) { class CustomServer extends options.server {} diff --git a/packages/platform/platform-test-sdk/src/tests/testDeepQueryParams.ts b/packages/platform/platform-test-sdk/src/tests/testDeepQueryParams.ts index 146f714ae94..528e2ceee84 100644 --- a/packages/platform/platform-test-sdk/src/tests/testDeepQueryParams.ts +++ b/packages/platform/platform-test-sdk/src/tests/testDeepQueryParams.ts @@ -5,7 +5,7 @@ import {Default, GenericOf, Generics, Maximum, Minimum, Property} from "@tsed/sc import SuperTest from "supertest"; import {afterAll, beforeAll, describe, expect, it} from "vitest"; -import {PlatformTestingSdkOpts} from "../interfaces/index.js"; +import type {PlatformTestingSdkOpts} from "../interfaces/index.js"; class FindQuery { @Property() diff --git a/packages/platform/platform-test-sdk/src/tests/testErrors.ts b/packages/platform/platform-test-sdk/src/tests/testErrors.ts index a1a59c3bfde..96b3943ebad 100644 --- a/packages/platform/platform-test-sdk/src/tests/testErrors.ts +++ b/packages/platform/platform-test-sdk/src/tests/testErrors.ts @@ -9,7 +9,7 @@ import {afterAll, beforeAll, expect, it} from "vitest"; import {CustomBadRequest} from "../errors/CustomBadRequest.js"; import {CustomInternalError} from "../errors/CustomInternalError.js"; -import {PlatformTestingSdkOpts} from "../interfaces/index.js"; +import type {PlatformTestingSdkOpts} from "../interfaces/index.js"; class CustomModel { @Required() name: string; diff --git a/packages/platform/platform-test-sdk/src/tests/testHandlers.ts b/packages/platform/platform-test-sdk/src/tests/testHandlers.ts index 6f44f3d5f33..42bbda7ea0e 100644 --- a/packages/platform/platform-test-sdk/src/tests/testHandlers.ts +++ b/packages/platform/platform-test-sdk/src/tests/testHandlers.ts @@ -3,7 +3,7 @@ import {Property, Required, Title} from "@tsed/schema"; import SuperTest from "supertest"; import {afterAll, beforeAll, expect, it} from "vitest"; -import {PlatformTestingSdkOpts} from "../interfaces/index.js"; +import type {PlatformTestingSdkOpts} from "../interfaces/index.js"; export class MyModel { @Title("ID") diff --git a/packages/platform/platform-test-sdk/src/tests/testHeaderParams.ts b/packages/platform/platform-test-sdk/src/tests/testHeaderParams.ts index 6ad991a1d83..974581d028c 100644 --- a/packages/platform/platform-test-sdk/src/tests/testHeaderParams.ts +++ b/packages/platform/platform-test-sdk/src/tests/testHeaderParams.ts @@ -3,7 +3,7 @@ import {Enum, Required} from "@tsed/schema"; import SuperTest from "supertest"; import {afterAll, beforeAll, describe, expect, it} from "vitest"; -import {PlatformTestingSdkOpts} from "../interfaces/index.js"; +import type {PlatformTestingSdkOpts} from "../interfaces/index.js"; @Middleware() class SetId { diff --git a/packages/platform/platform-test-sdk/src/tests/testHeaders.ts b/packages/platform/platform-test-sdk/src/tests/testHeaders.ts index 3155e180dd4..fdcb06774d7 100644 --- a/packages/platform/platform-test-sdk/src/tests/testHeaders.ts +++ b/packages/platform/platform-test-sdk/src/tests/testHeaders.ts @@ -3,7 +3,7 @@ import {Returns} from "@tsed/schema"; import SuperTest from "supertest"; import {afterAll, beforeAll, expect, it} from "vitest"; -import {PlatformTestingSdkOpts} from "../interfaces/index.js"; +import type {PlatformTestingSdkOpts} from "../interfaces/index.js"; @Controller("/headers") export class HeadersCtrl { diff --git a/packages/platform/platform-test-sdk/src/tests/testInheritanceController.ts b/packages/platform/platform-test-sdk/src/tests/testInheritanceController.ts index 1fa99e32658..35ff1d6fb93 100644 --- a/packages/platform/platform-test-sdk/src/tests/testInheritanceController.ts +++ b/packages/platform/platform-test-sdk/src/tests/testInheritanceController.ts @@ -5,7 +5,7 @@ import SuperTest from "supertest"; import {v4} from "uuid"; import {afterAll, beforeAll, describe, expect, it} from "vitest"; -import {PlatformTestingSdkOpts} from "../interfaces/index.js"; +import type {PlatformTestingSdkOpts} from "../interfaces/index.js"; export class Resource { @Property() diff --git a/packages/platform/platform-test-sdk/src/tests/testLocals.ts b/packages/platform/platform-test-sdk/src/tests/testLocals.ts index 16450e341f9..ec992db3b1a 100644 --- a/packages/platform/platform-test-sdk/src/tests/testLocals.ts +++ b/packages/platform/platform-test-sdk/src/tests/testLocals.ts @@ -1,8 +1,9 @@ -import {Context, Controller, Get, Locals, Middleware, PlatformContext, PlatformTest, Req, Use} from "@tsed/common"; +import type {PlatformContext} from "@tsed/common"; +import {Context, Controller, Get, Locals, Middleware, PlatformTest, Req, Use} from "@tsed/common"; import SuperTest from "supertest"; import {afterAll, beforeAll, describe, expect, it} from "vitest"; -import {PlatformTestingSdkOpts} from "../interfaces/index.js"; +import type {PlatformTestingSdkOpts} from "../interfaces/index.js"; @Middleware() class LocalsMiddleware { diff --git a/packages/platform/platform-test-sdk/src/tests/testLocation.ts b/packages/platform/platform-test-sdk/src/tests/testLocation.ts index 1105bd56e94..5297ea70793 100644 --- a/packages/platform/platform-test-sdk/src/tests/testLocation.ts +++ b/packages/platform/platform-test-sdk/src/tests/testLocation.ts @@ -3,7 +3,7 @@ import {Location} from "@tsed/schema"; import SuperTest from "supertest"; import {afterAll, beforeAll, expect, it} from "vitest"; -import {PlatformTestingSdkOpts} from "../interfaces/index.js"; +import type {PlatformTestingSdkOpts} from "../interfaces/index.js"; @Controller("/location") class LocationCtrl { diff --git a/packages/platform/platform-test-sdk/src/tests/testMiddlewares.ts b/packages/platform/platform-test-sdk/src/tests/testMiddlewares.ts index f7dd74a9725..6a9061e3c5d 100644 --- a/packages/platform/platform-test-sdk/src/tests/testMiddlewares.ts +++ b/packages/platform/platform-test-sdk/src/tests/testMiddlewares.ts @@ -1,23 +1,13 @@ import "@tsed/ajv"; -import { - Context, - Controller, - Err, - Get, - Middleware, - MiddlewareMethods, - PlatformTest, - QueryParams, - Use, - UseAfter, - UseBefore -} from "@tsed/common"; -import {BadRequest, Exception, Unauthorized} from "@tsed/exceptions"; +import type {MiddlewareMethods} from "@tsed/common"; +import {Context, Controller, Err, Get, Middleware, PlatformTest, QueryParams, Use, UseAfter, UseBefore} from "@tsed/common"; +import type {Exception} from "@tsed/exceptions"; +import {BadRequest, Unauthorized} from "@tsed/exceptions"; import SuperTest from "supertest"; import {afterAll, beforeAll, describe, expect, it} from "vitest"; -import {PlatformTestingSdkOpts} from "../interfaces/index.js"; +import type {PlatformTestingSdkOpts} from "../interfaces/index.js"; @Middleware() class BeforeCustomMiddleware { diff --git a/packages/platform/platform-test-sdk/src/tests/testModule.ts b/packages/platform/platform-test-sdk/src/tests/testModule.ts index 706a280b5ae..ee044419dae 100644 --- a/packages/platform/platform-test-sdk/src/tests/testModule.ts +++ b/packages/platform/platform-test-sdk/src/tests/testModule.ts @@ -2,7 +2,7 @@ import {Controller, Get, PlatformTest} from "@tsed/common"; import SuperTest from "supertest"; import {afterAll, beforeAll, describe, expect, it} from "vitest"; -import {PlatformTestingSdkOpts} from "../interfaces/index.js"; +import type {PlatformTestingSdkOpts} from "../interfaces/index.js"; import {FeatureModule} from "../modules/feature/FeatureModule.js"; @Controller("/root") diff --git a/packages/platform/platform-test-sdk/src/tests/testMulter.ts b/packages/platform/platform-test-sdk/src/tests/testMulter.ts index 1428fd4d6ca..209c59111b9 100644 --- a/packages/platform/platform-test-sdk/src/tests/testMulter.ts +++ b/packages/platform/platform-test-sdk/src/tests/testMulter.ts @@ -1,12 +1,14 @@ -import {BodyParams, Controller, MulterOptions, MultipartFile, PlatformMulterFile, PlatformTest} from "@tsed/common"; +import type {PlatformMulterFile} from "@tsed/common"; +import {BodyParams, Controller, MulterOptions, MultipartFile, PlatformTest} from "@tsed/common"; import {CollectionOf, Post, Property, Required, Status} from "@tsed/schema"; -import multer, {FileFilterCallback} from "multer"; +import type {FileFilterCallback} from "multer"; +import multer 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"; -import {PlatformTestingSdkOpts} from "../interfaces/index.js"; +import type {PlatformTestingSdkOpts} from "../interfaces/index.js"; const rootDir = import.meta.dirname; diff --git a/packages/platform/platform-test-sdk/src/tests/testPathParams.ts b/packages/platform/platform-test-sdk/src/tests/testPathParams.ts index 7f6a4f4ea6c..23b01da17ec 100644 --- a/packages/platform/platform-test-sdk/src/tests/testPathParams.ts +++ b/packages/platform/platform-test-sdk/src/tests/testPathParams.ts @@ -3,7 +3,7 @@ import {Pattern} from "@tsed/schema"; import SuperTest from "supertest"; import {afterAll, beforeAll, expect, it} from "vitest"; -import {PlatformTestingSdkOpts} from "../interfaces/index.js"; +import type {PlatformTestingSdkOpts} from "../interfaces/index.js"; @Controller("/path-params") class TestPathParamsCtrl { diff --git a/packages/platform/platform-test-sdk/src/tests/testQueryParams.ts b/packages/platform/platform-test-sdk/src/tests/testQueryParams.ts index 1177b0cb705..adf8e353cf7 100644 --- a/packages/platform/platform-test-sdk/src/tests/testQueryParams.ts +++ b/packages/platform/platform-test-sdk/src/tests/testQueryParams.ts @@ -5,7 +5,7 @@ import {Maximum, Minimum, Required} from "@tsed/schema"; import SuperTest from "supertest"; import {afterAll, beforeAll, describe, expect, it} from "vitest"; -import {PlatformTestingSdkOpts} from "../interfaces/index.js"; +import type {PlatformTestingSdkOpts} from "../interfaces/index.js"; export class RandomStringModel { @Maximum(250) diff --git a/packages/platform/platform-test-sdk/src/tests/testRedirect.ts b/packages/platform/platform-test-sdk/src/tests/testRedirect.ts index c31cc4fd111..af51f0b4716 100644 --- a/packages/platform/platform-test-sdk/src/tests/testRedirect.ts +++ b/packages/platform/platform-test-sdk/src/tests/testRedirect.ts @@ -2,7 +2,7 @@ import {Context, Controller, Get, Location, PlatformTest, Redirect} from "@tsed/ import SuperTest from "supertest"; import {afterAll, beforeAll, expect, it} from "vitest"; -import {PlatformTestingSdkOpts} from "../interfaces/index.js"; +import type {PlatformTestingSdkOpts} from "../interfaces/index.js"; @Controller("/redirect") class RedirectCtrl { diff --git a/packages/platform/platform-test-sdk/src/tests/testResponse.ts b/packages/platform/platform-test-sdk/src/tests/testResponse.ts index 6d2fda9b072..419238308a5 100644 --- a/packages/platform/platform-test-sdk/src/tests/testResponse.ts +++ b/packages/platform/platform-test-sdk/src/tests/testResponse.ts @@ -1,4 +1,5 @@ -import {Context, Controller, Get, getContext, PathParams, PlatformResponse, PlatformTest, Post, Res} from "@tsed/common"; +import type {PlatformResponse} from "@tsed/common"; +import {Context, Controller, Get, getContext, PathParams, PlatformTest, Post, Res} from "@tsed/common"; import {CollectionOf, Enum, ForwardGroups, Groups, Ignore, Name, Property, Required, Returns, Status} from "@tsed/schema"; import axios from "axios"; import {of} from "rxjs"; @@ -6,7 +7,7 @@ import {agent} from "superagent"; import SuperTest from "supertest"; import {afterAll, beforeAll, describe, expect, it} from "vitest"; -import {PlatformTestingSdkOpts} from "../interfaces/index.js"; +import type {PlatformTestingSdkOpts} from "../interfaces/index.js"; class Base { @Ignore() diff --git a/packages/platform/platform-test-sdk/src/tests/testResponseFilter.ts b/packages/platform/platform-test-sdk/src/tests/testResponseFilter.ts index a419929050a..3c267a37589 100644 --- a/packages/platform/platform-test-sdk/src/tests/testResponseFilter.ts +++ b/packages/platform/platform-test-sdk/src/tests/testResponseFilter.ts @@ -1,9 +1,10 @@ -import {Controller, Get, PlatformContext, PlatformTest, ResponseFilter, ResponseFilterMethods} from "@tsed/common"; +import type {PlatformContext, ResponseFilterMethods} from "@tsed/common"; +import {Controller, Get, PlatformTest, ResponseFilter} from "@tsed/common"; import {Property, Returns} from "@tsed/schema"; import SuperTest from "supertest"; import {afterAll, beforeAll, describe, expect, it} from "vitest"; -import {PlatformTestingSdkOpts} from "../interfaces/index.js"; +import type {PlatformTestingSdkOpts} from "../interfaces/index.js"; class ResponseFilterModel { @Property() diff --git a/packages/platform/platform-test-sdk/src/tests/testRouting.ts b/packages/platform/platform-test-sdk/src/tests/testRouting.ts index c743889fd4a..46ac1339203 100644 --- a/packages/platform/platform-test-sdk/src/tests/testRouting.ts +++ b/packages/platform/platform-test-sdk/src/tests/testRouting.ts @@ -2,7 +2,7 @@ import {Controller, Get, PlatformTest, Put} from "@tsed/common"; import SuperTest from "supertest"; import {afterAll, afterEach, beforeAll, expect, it, vi} from "vitest"; -import {PlatformTestingSdkOpts} from "../interfaces/index.js"; +import type {PlatformTestingSdkOpts} from "../interfaces/index.js"; const stub = vi.fn(); diff --git a/packages/platform/platform-test-sdk/src/tests/testScopeRequest.ts b/packages/platform/platform-test-sdk/src/tests/testScopeRequest.ts index 68132c1aced..6d18c4c9053 100644 --- a/packages/platform/platform-test-sdk/src/tests/testScopeRequest.ts +++ b/packages/platform/platform-test-sdk/src/tests/testScopeRequest.ts @@ -2,7 +2,7 @@ import {Controller, Get, PathParams, PlatformTest, ProviderScope, Scope, Service import SuperTest from "supertest"; import {afterAll, beforeAll, describe, expect, it} from "vitest"; -import {PlatformTestingSdkOpts} from "../interfaces/index.js"; +import type {PlatformTestingSdkOpts} from "../interfaces/index.js"; @Service() @Scope(ProviderScope.REQUEST) diff --git a/packages/platform/platform-test-sdk/src/tests/testSession.ts b/packages/platform/platform-test-sdk/src/tests/testSession.ts index be38bbf313a..dbef768bdfa 100644 --- a/packages/platform/platform-test-sdk/src/tests/testSession.ts +++ b/packages/platform/platform-test-sdk/src/tests/testSession.ts @@ -5,7 +5,7 @@ import SuperTest from "supertest"; import {promisify} from "util"; import {afterAll, beforeAll, describe, expect, it} from "vitest"; -import {PlatformTestingSdkOpts} from "../interfaces/index.js"; +import type {PlatformTestingSdkOpts} from "../interfaces/index.js"; export class UserCreation { @Property() diff --git a/packages/platform/platform-test-sdk/src/tests/testStatics.ts b/packages/platform/platform-test-sdk/src/tests/testStatics.ts index eeb223c4b6c..6ccef2deba0 100644 --- a/packages/platform/platform-test-sdk/src/tests/testStatics.ts +++ b/packages/platform/platform-test-sdk/src/tests/testStatics.ts @@ -1,16 +1,16 @@ import {Controller, PlatformTest} from "@tsed/common"; import {getValue} from "@tsed/core"; -import {Configuration} from "@tsed/di"; +import {Configuration, Inject} from "@tsed/di"; import {PlatformRouter} from "@tsed/platform-router"; import {readFileSync} from "fs"; import SuperTest from "supertest"; import {afterEach, beforeEach, expect, it} from "vitest"; -import {PlatformTestingSdkOpts} from "../interfaces/index.js"; +import type {PlatformTestingSdkOpts} from "../interfaces/index.js"; @Controller("/statics") class CustomStaticsCtrl { - constructor(router: PlatformRouter, @Configuration() config: Configuration) { + constructor(@Inject(PlatformRouter) router: PlatformRouter, @Configuration() config: Configuration) { router.statics("/", { root: String(getValue(config, "statics./")) }); diff --git a/packages/platform/platform-test-sdk/src/tests/testStream.ts b/packages/platform/platform-test-sdk/src/tests/testStream.ts index dab58eca59e..02845f8c673 100644 --- a/packages/platform/platform-test-sdk/src/tests/testStream.ts +++ b/packages/platform/platform-test-sdk/src/tests/testStream.ts @@ -5,7 +5,7 @@ import {join} from "path"; import SuperTest from "supertest"; import {afterAll, beforeAll, describe, expect, it} from "vitest"; -import {PlatformTestingSdkOpts} from "../interfaces/index.js"; +import type {PlatformTestingSdkOpts} from "../interfaces/index.js"; const rootDir = import.meta.dirname; diff --git a/packages/platform/platform-test-sdk/src/tests/testView.ts b/packages/platform/platform-test-sdk/src/tests/testView.ts index 6e304e14531..d206e32e3ed 100644 --- a/packages/platform/platform-test-sdk/src/tests/testView.ts +++ b/packages/platform/platform-test-sdk/src/tests/testView.ts @@ -4,7 +4,7 @@ import {EOL} from "os"; import SuperTest from "supertest"; import {afterAll, beforeAll, describe, expect, it} from "vitest"; -import {PlatformTestingSdkOpts} from "../interfaces/index.js"; +import type {PlatformTestingSdkOpts} from "../interfaces/index.js"; @Middleware() class LocalsMiddleware { diff --git a/packages/platform/platform-test-sdk/tsconfig.esm.json b/packages/platform/platform-test-sdk/tsconfig.esm.json index 82292550ddb..8954049da4a 100644 --- a/packages/platform/platform-test-sdk/tsconfig.esm.json +++ b/packages/platform/platform-test-sdk/tsconfig.esm.json @@ -2,7 +2,6 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", diff --git a/packages/platform/platform-views/package.json b/packages/platform/platform-views/package.json index 10742d46af1..f35b5b990d6 100644 --- a/packages/platform/platform-views/package.json +++ b/packages/platform/platform-views/package.json @@ -11,7 +11,7 @@ ".": { "types": "./lib/types/index.d.ts", "import": "./lib/esm/index.js", - "default": "./lib/cjs/index.js" + "default": "./lib/esm/index.js" } }, "scripts": { diff --git a/packages/platform/platform-views/src/domain/PlatformViewsSettings.ts b/packages/platform/platform-views/src/domain/PlatformViewsSettings.ts index e938850ac98..c0104d70c80 100644 --- a/packages/platform/platform-views/src/domain/PlatformViewsSettings.ts +++ b/packages/platform/platform-views/src/domain/PlatformViewsSettings.ts @@ -1,5 +1,5 @@ -import {BaseContext} from "@tsed/di"; -import {Writable} from "stream"; +import type {BaseContext} from "@tsed/di"; +import type {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 a08a1655a76..1ae12ad7ef1 100644 --- a/packages/platform/platform-views/src/services/PlatformViews.ts +++ b/packages/platform/platform-views/src/services/PlatformViews.ts @@ -1,16 +1,17 @@ import {Env, getValue} from "@tsed/core"; -import {Constant, Inject, InjectorService, Module} from "@tsed/di"; +import {InjectorService} from "@tsed/di"; +import {Constant, Inject, Module} from "@tsed/di"; import {engines, getEngine, requires} from "@tsed/engines"; import Fs from "fs"; import {extname, join, resolve} from "path"; -import { - PLATFORM_VIEWS_EXTENSIONS, +import type { PlatformViewEngine, PlatformViewsEngineOptions, PlatformViewsExtensionsTypes, PlatformViewWritableStream } from "../domain/PlatformViewsSettings.js"; +import {PLATFORM_VIEWS_EXTENSIONS} from "../domain/PlatformViewsSettings.js"; async function patchEJS(ejs: any) { if (!ejs) { @@ -55,7 +56,7 @@ export class PlatformViews { @Constant("views.options", {}) protected engineOptions: Record; - @Inject() + @Inject(InjectorService) protected injector: InjectorService; #extensions: Map; diff --git a/packages/platform/platform-views/tsconfig.esm.json b/packages/platform/platform-views/tsconfig.esm.json index 82292550ddb..8954049da4a 100644 --- a/packages/platform/platform-views/tsconfig.esm.json +++ b/packages/platform/platform-views/tsconfig.esm.json @@ -2,7 +2,6 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", diff --git a/packages/platform/platform-views/tsconfig.spec.json b/packages/platform/platform-views/tsconfig.spec.json index c6e9f98ef8f..bf3dd5969dd 100644 --- a/packages/platform/platform-views/tsconfig.spec.json +++ b/packages/platform/platform-views/tsconfig.spec.json @@ -3,30 +3,30 @@ "compilerOptions": { "baseUrl": ".", "rootDir": "../..", - "outDir": "./lib/cjs", "declaration": false, "composite": false, "noEmit": true, "paths": { - "@tsed/openspec": ["../../specs/openspec/src"], - "@tsed/schema": ["../../specs/schema/src"], - "@tsed/di": ["../../di/src"], - "@tsed/exceptions": ["../../specs/exceptions/src"], - "@tsed/json-mapper": ["../../specs/json-mapper/src"], - "@tsed/platform-exceptions": ["../platform-exceptions/src"], - "@tsed/platform-middlewares": ["../platform-middlewares/src"], - "@tsed/platform-params": ["../platform-params/src"], - "@tsed/platform-log-middleware": ["../platform-log-middleware/src"], - "@tsed/platform-response-filter": ["../platform-response-filter/src"], - "@tsed/platform-router": ["../platform-router/src"], - "@tsed/components-scan": ["../../third-parties/components-scan/src"], - "@tsed/common": ["../common/src"], - "@tsed/ajv": ["../../specs/ajv/src"], - "@tsed/platform-cache": ["../platform-cache/src"], - "@tsed/swagger": ["../../specs/swagger/src"], - "@tsed/platform-test-sdk": ["../platform-test-sdk/src"], - "@tsed/platform-express": ["../platform-express/src"], - "@tsed/platform-koa": ["../platform-koa/src"] + "@tsed/openspec": ["../../specs/openspec/src/index.ts"], + "@tsed/schema": ["../../specs/schema/src/index.ts"], + "@tsed/di": ["../../di/src/index.ts"], + "@tsed/exceptions": ["../../specs/exceptions/src/index.ts"], + "@tsed/json-mapper": ["../../specs/json-mapper/src/index.ts"], + "@tsed/platform-exceptions": ["../platform-exceptions/src/index.ts"], + "@tsed/platform-middlewares": ["../platform-middlewares/src/index.ts"], + "@tsed/platform-params": ["../platform-params/src/index.ts"], + "@tsed/platform-log-middleware": ["../platform-log-middleware/src/index.ts"], + "@tsed/platform-response-filter": ["../platform-response-filter/src/index.ts"], + "@tsed/platform-router": ["../platform-router/src/index.ts"], + "@tsed/normalize-path": ["../../utils/normalize-path/src/index.ts"], + "@tsed/components-scan": ["../../third-parties/components-scan/src/index.ts"], + "@tsed/common": ["../common/src/index.ts"], + "@tsed/ajv": ["../../specs/ajv/src/index.ts"], + "@tsed/platform-cache": ["../platform-cache/src/index.ts"], + "@tsed/swagger": ["../../specs/swagger/src/index.ts"], + "@tsed/platform-test-sdk": ["../platform-test-sdk/src/index.ts"], + "@tsed/platform-express": ["../platform-express/src/index.ts"], + "@tsed/platform-koa": ["../platform-koa/src/index.ts"] }, "types": ["vite/client", "vitest/globals"] }, diff --git a/packages/security/jwks/package.json b/packages/security/jwks/package.json index a2856db7337..be4f4de68c9 100644 --- a/packages/security/jwks/package.json +++ b/packages/security/jwks/package.json @@ -11,7 +11,7 @@ ".": { "types": "./lib/types/index.d.ts", "import": "./lib/esm/index.js", - "default": "./lib/cjs/index.js" + "default": "./lib/esm/index.js" } }, "scripts": { diff --git a/packages/security/jwks/src/getJwks.ts b/packages/security/jwks/src/getJwks.ts index f26b520123b..421180d4765 100644 --- a/packages/security/jwks/src/getJwks.ts +++ b/packages/security/jwks/src/getJwks.ts @@ -2,7 +2,7 @@ import {dirname} from "node:path"; import fs from "fs-extra"; // @ts-ignore -import {JWK, JWKS, KeyParameters} from "jose2"; +import {JWK, JWKS, type KeyParameters} from "jose2"; export interface JwksKeyParameters extends KeyParameters { path: string; diff --git a/packages/security/jwks/tsconfig.esm.json b/packages/security/jwks/tsconfig.esm.json index 82292550ddb..8954049da4a 100644 --- a/packages/security/jwks/tsconfig.esm.json +++ b/packages/security/jwks/tsconfig.esm.json @@ -2,7 +2,6 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", diff --git a/packages/security/jwks/tsconfig.spec.json b/packages/security/jwks/tsconfig.spec.json index 2e917f4b39d..fdb41369c3a 100644 --- a/packages/security/jwks/tsconfig.spec.json +++ b/packages/security/jwks/tsconfig.spec.json @@ -3,31 +3,31 @@ "compilerOptions": { "baseUrl": ".", "rootDir": "../..", - "outDir": "./lib/cjs", "declaration": false, "composite": false, "noEmit": true, "paths": { - "@tsed/openspec": ["../../specs/openspec/src"], - "@tsed/schema": ["../../specs/schema/src"], - "@tsed/di": ["../../di/src"], - "@tsed/exceptions": ["../../specs/exceptions/src"], - "@tsed/json-mapper": ["../../specs/json-mapper/src"], - "@tsed/platform-exceptions": ["../../platform/platform-exceptions/src"], - "@tsed/platform-middlewares": ["../../platform/platform-middlewares/src"], - "@tsed/platform-params": ["../../platform/platform-params/src"], - "@tsed/platform-log-middleware": ["../../platform/platform-log-middleware/src"], - "@tsed/platform-response-filter": ["../../platform/platform-response-filter/src"], - "@tsed/platform-router": ["../../platform/platform-router/src"], - "@tsed/platform-views": ["../../platform/platform-views/src"], - "@tsed/components-scan": ["../../third-parties/components-scan/src"], - "@tsed/common": ["../../platform/common/src"], - "@tsed/ajv": ["../../specs/ajv/src"], - "@tsed/platform-cache": ["../../platform/platform-cache/src"], - "@tsed/swagger": ["../../specs/swagger/src"], - "@tsed/platform-test-sdk": ["../../platform/platform-test-sdk/src"], - "@tsed/platform-express": ["../../platform/platform-express/src"], - "@tsed/platform-koa": ["../../platform/platform-koa/src"] + "@tsed/openspec": ["../../specs/openspec/src/index.ts"], + "@tsed/schema": ["../../specs/schema/src/index.ts"], + "@tsed/di": ["../../di/src/index.ts"], + "@tsed/exceptions": ["../../specs/exceptions/src/index.ts"], + "@tsed/json-mapper": ["../../specs/json-mapper/src/index.ts"], + "@tsed/platform-exceptions": ["../../platform/platform-exceptions/src/index.ts"], + "@tsed/platform-middlewares": ["../../platform/platform-middlewares/src/index.ts"], + "@tsed/platform-params": ["../../platform/platform-params/src/index.ts"], + "@tsed/platform-log-middleware": ["../../platform/platform-log-middleware/src/index.ts"], + "@tsed/platform-response-filter": ["../../platform/platform-response-filter/src/index.ts"], + "@tsed/platform-router": ["../../platform/platform-router/src/index.ts"], + "@tsed/platform-views": ["../../platform/platform-views/src/index.ts"], + "@tsed/normalize-path": ["../../utils/normalize-path/src/index.ts"], + "@tsed/components-scan": ["../../third-parties/components-scan/src/index.ts"], + "@tsed/common": ["../../platform/common/src/index.ts"], + "@tsed/ajv": ["../../specs/ajv/src/index.ts"], + "@tsed/platform-cache": ["../../platform/platform-cache/src/index.ts"], + "@tsed/swagger": ["../../specs/swagger/src/index.ts"], + "@tsed/platform-test-sdk": ["../../platform/platform-test-sdk/src/index.ts"], + "@tsed/platform-express": ["../../platform/platform-express/src/index.ts"], + "@tsed/platform-koa": ["../../platform/platform-koa/src/index.ts"] }, "types": ["vite/client", "vitest/globals"] }, diff --git a/packages/security/oidc-provider-plugin-wildcard-redirect-uri/package.json b/packages/security/oidc-provider-plugin-wildcard-redirect-uri/package.json index cb1fda6cd9a..a470e943032 100644 --- a/packages/security/oidc-provider-plugin-wildcard-redirect-uri/package.json +++ b/packages/security/oidc-provider-plugin-wildcard-redirect-uri/package.json @@ -16,7 +16,7 @@ ".": { "types": "./lib/types/index.d.ts", "import": "./lib/esm/index.js", - "default": "./lib/cjs/index.js" + "default": "./lib/esm/index.js" } }, "scripts": { diff --git a/packages/security/oidc-provider-plugin-wildcard-redirect-uri/src/OidcWildcardRedirectUriModule.spec.ts b/packages/security/oidc-provider-plugin-wildcard-redirect-uri/src/OidcWildcardRedirectUriModule.spec.ts index d5980d01781..7b42c14fa84 100644 --- a/packages/security/oidc-provider-plugin-wildcard-redirect-uri/src/OidcWildcardRedirectUriModule.spec.ts +++ b/packages/security/oidc-provider-plugin-wildcard-redirect-uri/src/OidcWildcardRedirectUriModule.spec.ts @@ -1,6 +1,7 @@ import {PlatformTest} from "@tsed/common"; import {catchError} from "@tsed/core"; -import {errors, KoaContextWithOIDC} from "oidc-provider"; +import type {KoaContextWithOIDC} from "oidc-provider"; +import {errors} from "oidc-provider"; import {OidcWildcardRedirectUriModule} from "./OidcWildcardRedirectUriModule.js"; import InvalidClientMetadata = errors.InvalidClientMetadata; diff --git a/packages/security/oidc-provider-plugin-wildcard-redirect-uri/src/OidcWildcardRedirectUriModule.ts b/packages/security/oidc-provider-plugin-wildcard-redirect-uri/src/OidcWildcardRedirectUriModule.ts index 6d05fb8d5c7..527053beb52 100644 --- a/packages/security/oidc-provider-plugin-wildcard-redirect-uri/src/OidcWildcardRedirectUriModule.ts +++ b/packages/security/oidc-provider-plugin-wildcard-redirect-uri/src/OidcWildcardRedirectUriModule.ts @@ -1,6 +1,7 @@ import {Constant, Inject, Module} from "@tsed/di"; import {Logger} from "@tsed/logger"; -import {OIDC_PROVIDER_NODE_MODULE, OidcSettings} from "@tsed/oidc-provider"; +import type {OidcSettings} from "@tsed/oidc-provider"; +import {OIDC_PROVIDER_NODE_MODULE} from "@tsed/oidc-provider"; // @ts-ignore import type {default as Provider, KoaContextWithOIDC} from "oidc-provider"; // @ts-ignore diff --git a/packages/security/oidc-provider-plugin-wildcard-redirect-uri/tsconfig.esm.json b/packages/security/oidc-provider-plugin-wildcard-redirect-uri/tsconfig.esm.json index 82292550ddb..8954049da4a 100644 --- a/packages/security/oidc-provider-plugin-wildcard-redirect-uri/tsconfig.esm.json +++ b/packages/security/oidc-provider-plugin-wildcard-redirect-uri/tsconfig.esm.json @@ -2,7 +2,6 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", diff --git a/packages/security/oidc-provider-plugin-wildcard-redirect-uri/tsconfig.spec.json b/packages/security/oidc-provider-plugin-wildcard-redirect-uri/tsconfig.spec.json index 2e917f4b39d..fdb41369c3a 100644 --- a/packages/security/oidc-provider-plugin-wildcard-redirect-uri/tsconfig.spec.json +++ b/packages/security/oidc-provider-plugin-wildcard-redirect-uri/tsconfig.spec.json @@ -3,31 +3,31 @@ "compilerOptions": { "baseUrl": ".", "rootDir": "../..", - "outDir": "./lib/cjs", "declaration": false, "composite": false, "noEmit": true, "paths": { - "@tsed/openspec": ["../../specs/openspec/src"], - "@tsed/schema": ["../../specs/schema/src"], - "@tsed/di": ["../../di/src"], - "@tsed/exceptions": ["../../specs/exceptions/src"], - "@tsed/json-mapper": ["../../specs/json-mapper/src"], - "@tsed/platform-exceptions": ["../../platform/platform-exceptions/src"], - "@tsed/platform-middlewares": ["../../platform/platform-middlewares/src"], - "@tsed/platform-params": ["../../platform/platform-params/src"], - "@tsed/platform-log-middleware": ["../../platform/platform-log-middleware/src"], - "@tsed/platform-response-filter": ["../../platform/platform-response-filter/src"], - "@tsed/platform-router": ["../../platform/platform-router/src"], - "@tsed/platform-views": ["../../platform/platform-views/src"], - "@tsed/components-scan": ["../../third-parties/components-scan/src"], - "@tsed/common": ["../../platform/common/src"], - "@tsed/ajv": ["../../specs/ajv/src"], - "@tsed/platform-cache": ["../../platform/platform-cache/src"], - "@tsed/swagger": ["../../specs/swagger/src"], - "@tsed/platform-test-sdk": ["../../platform/platform-test-sdk/src"], - "@tsed/platform-express": ["../../platform/platform-express/src"], - "@tsed/platform-koa": ["../../platform/platform-koa/src"] + "@tsed/openspec": ["../../specs/openspec/src/index.ts"], + "@tsed/schema": ["../../specs/schema/src/index.ts"], + "@tsed/di": ["../../di/src/index.ts"], + "@tsed/exceptions": ["../../specs/exceptions/src/index.ts"], + "@tsed/json-mapper": ["../../specs/json-mapper/src/index.ts"], + "@tsed/platform-exceptions": ["../../platform/platform-exceptions/src/index.ts"], + "@tsed/platform-middlewares": ["../../platform/platform-middlewares/src/index.ts"], + "@tsed/platform-params": ["../../platform/platform-params/src/index.ts"], + "@tsed/platform-log-middleware": ["../../platform/platform-log-middleware/src/index.ts"], + "@tsed/platform-response-filter": ["../../platform/platform-response-filter/src/index.ts"], + "@tsed/platform-router": ["../../platform/platform-router/src/index.ts"], + "@tsed/platform-views": ["../../platform/platform-views/src/index.ts"], + "@tsed/normalize-path": ["../../utils/normalize-path/src/index.ts"], + "@tsed/components-scan": ["../../third-parties/components-scan/src/index.ts"], + "@tsed/common": ["../../platform/common/src/index.ts"], + "@tsed/ajv": ["../../specs/ajv/src/index.ts"], + "@tsed/platform-cache": ["../../platform/platform-cache/src/index.ts"], + "@tsed/swagger": ["../../specs/swagger/src/index.ts"], + "@tsed/platform-test-sdk": ["../../platform/platform-test-sdk/src/index.ts"], + "@tsed/platform-express": ["../../platform/platform-express/src/index.ts"], + "@tsed/platform-koa": ["../../platform/platform-koa/src/index.ts"] }, "types": ["vite/client", "vitest/globals"] }, diff --git a/packages/security/oidc-provider/package.json b/packages/security/oidc-provider/package.json index 17cb5015fd5..3b378c44ed4 100644 --- a/packages/security/oidc-provider/package.json +++ b/packages/security/oidc-provider/package.json @@ -22,7 +22,7 @@ ".": { "types": "./lib/types/index.d.ts", "import": "./lib/esm/index.js", - "default": "./lib/cjs/index.js" + "default": "./lib/esm/index.js" } }, "scripts": { diff --git a/packages/security/oidc-provider/src/OidcModule.ts b/packages/security/oidc-provider/src/OidcModule.ts index a6510617980..8c8602ddb70 100644 --- a/packages/security/oidc-provider/src/OidcModule.ts +++ b/packages/security/oidc-provider/src/OidcModule.ts @@ -1,5 +1,5 @@ -import {Inject, InjectorService, PlatformApplication} from "@tsed/common"; -import {Constant, Module} from "@tsed/di"; +import {PlatformApplication} from "@tsed/common"; +import {Constant, Inject, InjectorService, Module} from "@tsed/di"; import koaMount from "koa-mount"; import {OidcAdapters} from "./services/OidcAdapters.js"; @@ -10,19 +10,19 @@ import {OidcProvider} from "./services/OidcProvider.js"; imports: [OidcProvider, OidcAdapters, OidcJwks] }) export class OidcModule { - @Inject() - protected app: PlatformApplication; - @Constant("PLATFORM_NAME") protected platformName: string; @Constant("oidc.path", "/oidc") protected basePath: string; - @Inject() + @Inject(PlatformApplication) + protected app: PlatformApplication; + + @Inject(OidcProvider) protected oidcProvider: OidcProvider; - @Inject() + @Inject(InjectorService) protected injector: InjectorService; async $onInit() { diff --git a/packages/security/oidc-provider/src/decorators/interaction.spec.ts b/packages/security/oidc-provider/src/decorators/interaction.spec.ts index d1823d44ffd..f3b276dab16 100644 --- a/packages/security/oidc-provider/src/decorators/interaction.spec.ts +++ b/packages/security/oidc-provider/src/decorators/interaction.spec.ts @@ -2,7 +2,7 @@ import {Store} from "@tsed/core"; import {GlobalProviders} from "@tsed/di"; import {INTERACTION_OPTIONS} from "../constants/constants.js"; -import {OidcInteractionMethods} from "../domain/OidcInteractionMethods.js"; +import type {OidcInteractionMethods} from "../domain/OidcInteractionMethods.js"; import {Interaction} from "./interaction.js"; describe("@Interaction", () => { diff --git a/packages/security/oidc-provider/src/decorators/interaction.ts b/packages/security/oidc-provider/src/decorators/interaction.ts index 360daf5959c..a19a7d38af2 100644 --- a/packages/security/oidc-provider/src/decorators/interaction.ts +++ b/packages/security/oidc-provider/src/decorators/interaction.ts @@ -2,7 +2,7 @@ import {Controller} from "@tsed/common"; import {StoreMerge, useDecorators} from "@tsed/core"; import {INTERACTION, INTERACTION_OPTIONS} from "../constants/constants.js"; -import {OidcInteractionOptions} from "../domain/OidcInteractionOptions.js"; +import type {OidcInteractionOptions} from "../domain/OidcInteractionOptions.js"; /** * @Oidc diff --git a/packages/security/oidc-provider/src/decorators/interactions.ts b/packages/security/oidc-provider/src/decorators/interactions.ts index 02ba1abb8af..1c6f2edf61a 100644 --- a/packages/security/oidc-provider/src/decorators/interactions.ts +++ b/packages/security/oidc-provider/src/decorators/interactions.ts @@ -1,5 +1,6 @@ import {Controller, UseBefore} from "@tsed/common"; -import {Type, useDecorators} from "@tsed/core"; +import type {Type} from "@tsed/core"; +import {useDecorators} from "@tsed/core"; import {INTERACTIONS} from "../constants/constants.js"; import {OidcInteractionMiddleware} from "../middlewares/OidcInteractionMiddleware.js"; diff --git a/packages/security/oidc-provider/src/decorators/oidcCtx.ts b/packages/security/oidc-provider/src/decorators/oidcCtx.ts index 3ded3f94ea6..6f321df89dc 100644 --- a/packages/security/oidc-provider/src/decorators/oidcCtx.ts +++ b/packages/security/oidc-provider/src/decorators/oidcCtx.ts @@ -2,7 +2,7 @@ import {Context} from "@tsed/common"; import {useDecorators} from "@tsed/core"; import {INTERACTION_CONTEXT} from "../constants/constants.js"; -import {OidcInteractionContext} from "../services/OidcInteractionContext.js"; +import type {OidcInteractionContext} from "../services/OidcInteractionContext.js"; export function OidcCtx(): ParameterDecorator { return useDecorators(Context(INTERACTION_CONTEXT)); diff --git a/packages/security/oidc-provider/src/domain/OidcAccountsMethods.ts b/packages/security/oidc-provider/src/domain/OidcAccountsMethods.ts index f1dc6b4b1e8..8ad4d9478ae 100644 --- a/packages/security/oidc-provider/src/domain/OidcAccountsMethods.ts +++ b/packages/security/oidc-provider/src/domain/OidcAccountsMethods.ts @@ -1,7 +1,7 @@ // @ts-ignore import type {Account, default as Provider} from "oidc-provider"; -import {AccessToken, AuthorizationCode, BackchannelAuthenticationRequest, DeviceCode} from "./interfaces.js"; +import type {AccessToken, AuthorizationCode, BackchannelAuthenticationRequest, DeviceCode} from "./interfaces.js"; export interface OidcAccountsMethods { findAccount( diff --git a/packages/security/oidc-provider/src/domain/OidcInteractionPromptProps.ts b/packages/security/oidc-provider/src/domain/OidcInteractionPromptProps.ts index da847986482..e794b69c70c 100644 --- a/packages/security/oidc-provider/src/domain/OidcInteractionPromptProps.ts +++ b/packages/security/oidc-provider/src/domain/OidcInteractionPromptProps.ts @@ -1,7 +1,7 @@ // @ts-ignore import type {UnknownObject} from "oidc-provider"; -import {OidcClient} from "./interfaces.js"; +import type {OidcClient} from "./interfaces.js"; export type OidcInteractionPromptProps> = { client: OidcClient; diff --git a/packages/security/oidc-provider/src/middlewares/OidcInteractionMiddleware.ts b/packages/security/oidc-provider/src/middlewares/OidcInteractionMiddleware.ts index d13423c24ad..5c415538cbc 100644 --- a/packages/security/oidc-provider/src/middlewares/OidcInteractionMiddleware.ts +++ b/packages/security/oidc-provider/src/middlewares/OidcInteractionMiddleware.ts @@ -1,6 +1,6 @@ import {Inject, Middleware} from "@tsed/common"; -import {OidcInteractionContext} from "../services/OidcInteractionContext.js"; +import type {OidcInteractionContext} from "../services/OidcInteractionContext.js"; @Middleware() export class OidcInteractionMiddleware { diff --git a/packages/security/oidc-provider/src/middlewares/OidcNoCacheMiddleware.ts b/packages/security/oidc-provider/src/middlewares/OidcNoCacheMiddleware.ts index e6bef5df994..6e9af7bbd7c 100644 --- a/packages/security/oidc-provider/src/middlewares/OidcNoCacheMiddleware.ts +++ b/packages/security/oidc-provider/src/middlewares/OidcNoCacheMiddleware.ts @@ -1,4 +1,5 @@ -import {Context, Middleware, MiddlewareMethods} from "@tsed/common"; +import type {MiddlewareMethods} from "@tsed/common"; +import {Context, Middleware} from "@tsed/common"; @Middleware() export class OidcNoCacheMiddleware implements MiddlewareMethods { diff --git a/packages/security/oidc-provider/src/middlewares/OidcSecureMiddleware.ts b/packages/security/oidc-provider/src/middlewares/OidcSecureMiddleware.ts index d97b930cb0f..3b765d6124c 100644 --- a/packages/security/oidc-provider/src/middlewares/OidcSecureMiddleware.ts +++ b/packages/security/oidc-provider/src/middlewares/OidcSecureMiddleware.ts @@ -1,4 +1,5 @@ -import {Context, Middleware, MiddlewareMethods} from "@tsed/common"; +import type {MiddlewareMethods} from "@tsed/common"; +import {Context, Middleware} from "@tsed/common"; import {BadRequest} from "@tsed/exceptions"; import url from "url"; diff --git a/packages/security/oidc-provider/src/services/OidcAdapters.ts b/packages/security/oidc-provider/src/services/OidcAdapters.ts index 46347dd1e76..5145730a478 100644 --- a/packages/security/oidc-provider/src/services/OidcAdapters.ts +++ b/packages/security/oidc-provider/src/services/OidcAdapters.ts @@ -1,4 +1,4 @@ -import {Adapter, Adapters} from "@tsed/adapters"; +import type {Adapter, Adapters} from "@tsed/adapters"; import {Configuration, Inject, Injectable} from "@tsed/di"; // @ts-ignore import type {Adapter as OidcAdapter, AdapterConstructor} from "oidc-provider"; diff --git a/packages/security/oidc-provider/src/services/OidcInteractionContext.ts b/packages/security/oidc-provider/src/services/OidcInteractionContext.ts index 2261f1e6716..f507373d980 100644 --- a/packages/security/oidc-provider/src/services/OidcInteractionContext.ts +++ b/packages/security/oidc-provider/src/services/OidcInteractionContext.ts @@ -1,8 +1,8 @@ -import {Constant, InjectContext, PlatformContext} from "@tsed/common"; +import type {PlatformContext} from "@tsed/common"; +import {Constant, InjectContext} from "@tsed/common"; import {Env} from "@tsed/core"; import {Inject, Injectable} from "@tsed/di"; import {Unauthorized} from "@tsed/exceptions"; -import {serialize} from "@tsed/json-mapper"; import omit from "lodash/omit.js"; // @ts-ignore import type {Account, default as Provider, InteractionResults, PromptDetail} from "oidc-provider"; @@ -16,13 +16,13 @@ import { INTERACTION_SESSION, INTERACTION_UID } from "../constants/constants.js"; -import {OidcSession} from "../decorators/oidcSession.js"; -import {OidcClient, OidcInteraction} from "../domain/interfaces.js"; +import type {OidcSession} from "../decorators/oidcSession.js"; +import type {OidcClient, OidcInteraction} from "../domain/interfaces.js"; import {OidcBadInteractionName} from "../domain/OidcBadInteractionName.js"; -import {OidcInteractionPromptProps} from "../domain/OidcInteractionPromptProps.js"; +import type {OidcInteractionPromptProps} from "../domain/OidcInteractionPromptProps.js"; import {debug} from "../utils/debug.js"; -import {OidcInteractions} from "./OidcInteractions.js"; -import {OidcProvider} from "./OidcProvider.js"; +import type {OidcInteractions} from "./OidcInteractions.js"; +import type {OidcProvider} from "./OidcProvider.js"; @Injectable() export class OidcInteractionContext { diff --git a/packages/security/oidc-provider/src/services/OidcInteractions.ts b/packages/security/oidc-provider/src/services/OidcInteractions.ts index 47cd2ca8084..1aa51b5d13d 100644 --- a/packages/security/oidc-provider/src/services/OidcInteractions.ts +++ b/packages/security/oidc-provider/src/services/OidcInteractions.ts @@ -1,14 +1,15 @@ -import {Constant, EndpointMetadata, PlatformContext, PlatformHandler, Provider, TokenProvider} from "@tsed/common"; -import {Env} from "@tsed/core"; +import type {PlatformContext, Provider, TokenProvider} from "@tsed/common"; +import {Constant, EndpointMetadata, PlatformHandler} from "@tsed/common"; +import type {Env} from "@tsed/core"; import {Inject, Injectable, InjectorService} from "@tsed/di"; import {INTERACTION, INTERACTION_OPTIONS, INTERACTIONS} from "../constants/constants.js"; -import {OidcInteractionOptions} from "../domain/OidcInteractionOptions.js"; -import {OidcSettings} from "../domain/OidcSettings.js"; +import type {OidcInteractionOptions} from "../domain/OidcInteractionOptions.js"; +import type {OidcSettings} from "../domain/OidcSettings.js"; @Injectable() export class OidcInteractions { - @Inject() + @Inject(InjectorService) protected injector: InjectorService; @Constant("env") diff --git a/packages/security/oidc-provider/src/services/OidcJwks.ts b/packages/security/oidc-provider/src/services/OidcJwks.ts index 270b5d37037..cdbc21d39fd 100644 --- a/packages/security/oidc-provider/src/services/OidcJwks.ts +++ b/packages/security/oidc-provider/src/services/OidcJwks.ts @@ -1,5 +1,6 @@ import {Constant, Injectable} from "@tsed/di"; -import {getJwks, JwksKeyParameters} from "@tsed/jwks"; +import type {JwksKeyParameters} from "@tsed/jwks"; +import {getJwks} from "@tsed/jwks"; import {join} from "path"; @Injectable() diff --git a/packages/security/oidc-provider/src/services/OidcPolicy.ts b/packages/security/oidc-provider/src/services/OidcPolicy.ts index 33c870c54cb..17fab463ef6 100644 --- a/packages/security/oidc-provider/src/services/OidcPolicy.ts +++ b/packages/security/oidc-provider/src/services/OidcPolicy.ts @@ -1,19 +1,19 @@ -import {Inject, Injectable, InjectorService, Provider} from "@tsed/di"; +import {Inject, Injectable, InjectorService, type Provider} from "@tsed/di"; // @ts-ignore import {interactionPolicy} from "oidc-provider"; -import {InteractionMethods} from "../domain/InteractionMethods.js"; -import {OidcInteractionOptions} from "../domain/OidcInteractionOptions.js"; +import type {InteractionMethods} from "../domain/InteractionMethods.js"; +import type {OidcInteractionOptions} from "../domain/OidcInteractionOptions.js"; import {OidcInteractions} from "./OidcInteractions.js"; import {OIDC_PROVIDER_NODE_MODULE} from "./OidcProviderNodeModule.js"; import Prompt = interactionPolicy.Prompt; @Injectable() export class OidcPolicy { - @Inject() + @Inject(InjectorService) protected injector: InjectorService; - @Inject() + @Inject(OidcInteractions) protected oidcInteractions: OidcInteractions; constructor(@Inject(OIDC_PROVIDER_NODE_MODULE) protected module: OIDC_PROVIDER_NODE_MODULE) {} diff --git a/packages/security/oidc-provider/src/services/OidcProvider.ts b/packages/security/oidc-provider/src/services/OidcProvider.ts index 57deaf8ef5f..0907cde05ec 100644 --- a/packages/security/oidc-provider/src/services/OidcProvider.ts +++ b/packages/security/oidc-provider/src/services/OidcProvider.ts @@ -1,18 +1,18 @@ -import {InjectContext, PlatformApplication, PlatformContext} from "@tsed/common"; +import {PlatformApplication, type PlatformContext} from "@tsed/common"; import {Env, setValue} from "@tsed/core"; -import {Constant, Inject, Injectable, InjectorService} from "@tsed/di"; -// @ts-ignore -import type {Configuration, default as OIDCProvider, KoaContextWithOIDC} from "oidc-provider"; +import {Constant, Inject, Injectable, InjectContext, InjectorService} from "@tsed/di"; +import type {Configuration, KoaContextWithOIDC} from "oidc-provider"; import {INTERACTIONS} from "../constants/constants.js"; -import {OidcAccountsMethods} from "../domain/OidcAccountsMethods.js"; -import {OidcSettings} from "../domain/OidcSettings.js"; +import type {OidcAccountsMethods} from "../domain/OidcAccountsMethods.js"; +import type {OidcSettings} from "../domain/OidcSettings.js"; import {OIDC_ERROR_EVENTS} from "../utils/events.js"; import {OidcAdapters} from "./OidcAdapters.js"; import {OidcInteractions} from "./OidcInteractions.js"; import {OidcJwks} from "./OidcJwks.js"; import {OidcPolicy} from "./OidcPolicy.js"; -import {OIDC_PROVIDER_NODE_MODULE, Provider} from "./OidcProviderNodeModule.js"; +import type {Provider} from "./OidcProviderNodeModule.js"; +import {OIDC_PROVIDER_NODE_MODULE} from "./OidcProviderNodeModule.js"; function mapError(error: any) { return Object.getOwnPropertyNames(error).reduce((obj: any, key) => { @@ -45,22 +45,22 @@ export class OidcProvider { @Constant("PLATFORM_NAME") protected platformName: string; - @Inject() + @Inject(OidcJwks) protected oidcJwks: OidcJwks; - @Inject() + @Inject(OidcInteractions) protected oidcInteractions: OidcInteractions; - @Inject() + @Inject(OidcPolicy) protected oidcPolicy: OidcPolicy; - @Inject() + @Inject(OidcAdapters) protected adapters: OidcAdapters; - @Inject() + @Inject(InjectorService) protected injector: InjectorService; - @Inject() + @Inject(PlatformApplication) protected app: PlatformApplication; @InjectContext() diff --git a/packages/security/oidc-provider/src/services/OidcProviderNodeModule.ts b/packages/security/oidc-provider/src/services/OidcProviderNodeModule.ts index b9e3da142f6..11b8b3e7794 100644 --- a/packages/security/oidc-provider/src/services/OidcProviderNodeModule.ts +++ b/packages/security/oidc-provider/src/services/OidcProviderNodeModule.ts @@ -1,4 +1,4 @@ -import {Type} from "@tsed/core"; +import type {Type} from "@tsed/core"; import {registerProvider} from "@tsed/di"; // @ts-ignore import type Provider from "oidc-provider"; @@ -7,7 +7,7 @@ export const OIDC_PROVIDER_NODE_MODULE = Symbol.for("oidc:provider:node:module") // @ts-ignore export type OIDC_PROVIDER_NODE_MODULE = {Provider: Type} & typeof import("oidc-provider"); -export {Provider}; +export {type Provider}; registerProvider({ provide: OIDC_PROVIDER_NODE_MODULE, diff --git a/packages/security/oidc-provider/test/app/Server.ts b/packages/security/oidc-provider/test/app/Server.ts index 162ec14197e..253ffa7b966 100644 --- a/packages/security/oidc-provider/test/app/Server.ts +++ b/packages/security/oidc-provider/test/app/Server.ts @@ -67,7 +67,7 @@ export {rootDir}; ] }) export class Server { - @Inject() + @Inject(PlatformApplication) app: PlatformApplication; @Constant("viewsDir") diff --git a/packages/security/oidc-provider/test/app/controllers/pages/IndexCtrl.ts b/packages/security/oidc-provider/test/app/controllers/pages/IndexCtrl.ts index acbbb0ab9db..e090b2fda6c 100644 --- a/packages/security/oidc-provider/test/app/controllers/pages/IndexCtrl.ts +++ b/packages/security/oidc-provider/test/app/controllers/pages/IndexCtrl.ts @@ -1,7 +1,8 @@ import {Constant, Controller, Get, HeaderParams} from "@tsed/common"; import {View} from "@tsed/platform-views"; import {Returns} from "@tsed/schema"; -import {Hidden, SwaggerSettings} from "@tsed/swagger"; +import type {SwaggerSettings} from "@tsed/swagger"; +import {Hidden} from "@tsed/swagger"; @Hidden() @Controller("/") diff --git a/packages/security/oidc-provider/test/app/interactions/AbortInteraction.ts b/packages/security/oidc-provider/test/app/interactions/AbortInteraction.ts index 846e085b89c..d662863780c 100644 --- a/packages/security/oidc-provider/test/app/interactions/AbortInteraction.ts +++ b/packages/security/oidc-provider/test/app/interactions/AbortInteraction.ts @@ -2,14 +2,14 @@ import {Inject} from "@tsed/common"; import {View} from "@tsed/platform-views"; import {Name} from "@tsed/schema"; -import {Interaction, InteractionMethods, OidcCtx, OidcProvider} from "../../../src/index.js"; +import {Interaction, type InteractionMethods, OidcCtx, OidcProvider} from "../../../src/index.js"; @Interaction({ name: "abort" }) @Name("Oidc") export class AbortInteraction implements InteractionMethods { - @Inject() + @Inject(OidcProvider) oidc: OidcProvider; @View("interaction") diff --git a/packages/security/oidc-provider/test/app/interactions/ConsentInteraction.ts b/packages/security/oidc-provider/test/app/interactions/ConsentInteraction.ts index 99b1165bf6c..42c492bbc0b 100644 --- a/packages/security/oidc-provider/test/app/interactions/ConsentInteraction.ts +++ b/packages/security/oidc-provider/test/app/interactions/ConsentInteraction.ts @@ -2,7 +2,7 @@ import {Inject, Post} from "@tsed/common"; import {View} from "@tsed/platform-views"; import {Name} from "@tsed/schema"; -import {Interaction, InteractionMethods, OidcCtx, OidcProvider, Prompt} from "../../../src/index.js"; +import {Interaction, type InteractionMethods, OidcCtx, OidcProvider, Prompt} from "../../../src/index.js"; @Interaction({ name: "consent", @@ -10,7 +10,7 @@ import {Interaction, InteractionMethods, OidcCtx, OidcProvider, Prompt} from ".. }) @Name("Oidc") export class ConsentInteraction implements InteractionMethods { - @Inject() + @Inject(OidcProvider) oidc: OidcProvider; @View("interaction") diff --git a/packages/security/oidc-provider/test/app/interactions/CustomInteraction.ts b/packages/security/oidc-provider/test/app/interactions/CustomInteraction.ts index 223a888f33b..849b08ecbe9 100644 --- a/packages/security/oidc-provider/test/app/interactions/CustomInteraction.ts +++ b/packages/security/oidc-provider/test/app/interactions/CustomInteraction.ts @@ -1,10 +1,12 @@ import {View} from "@tsed/common"; -import {Env} from "@tsed/core"; +import type {Env} from "@tsed/core"; import {Constant} from "@tsed/di"; import {Name} from "@tsed/schema"; -import {interactionPolicy, KoaContextWithOIDC} from "oidc-provider"; +import type {KoaContextWithOIDC} from "oidc-provider"; +import {interactionPolicy} from "oidc-provider"; -import {Interaction, InteractionMethods, OidcCtx, OidcSession, Params, Prompt, Uid} from "../../../src/index.js"; +import type {InteractionMethods} from "../../../src/index.js"; +import {Interaction, OidcCtx, OidcSession, Params, Prompt, Uid} from "../../../src/index.js"; import Check = interactionPolicy.Check; @Interaction({ diff --git a/packages/security/oidc-provider/test/app/interactions/LoginInteraction.ts b/packages/security/oidc-provider/test/app/interactions/LoginInteraction.ts index 5ae9739e9ac..4b154613844 100644 --- a/packages/security/oidc-provider/test/app/interactions/LoginInteraction.ts +++ b/packages/security/oidc-provider/test/app/interactions/LoginInteraction.ts @@ -1,10 +1,11 @@ import {BodyParams, Inject, Post} from "@tsed/common"; -import {Env} from "@tsed/core"; +import type {Env} from "@tsed/core"; import {Constant} from "@tsed/di"; import {View} from "@tsed/platform-views"; import {Name} from "@tsed/schema"; -import {Interaction, InteractionMethods, OidcCtx, OidcSession, Params, Prompt, Uid} from "../../../src/index.js"; +import type {InteractionMethods} from "../../../src/index.js"; +import {Interaction, OidcCtx, OidcSession, Params, Prompt, Uid} from "../../../src/index.js"; import {Accounts} from "../services/Accounts.js"; @Interaction({ @@ -16,7 +17,7 @@ export class LoginInteraction implements InteractionMethods { @Constant("env") env: Env; - @Inject() + @Inject(Accounts) accounts: Accounts; $onCreate() {} diff --git a/packages/security/oidc-provider/test/app/services/Accounts.ts b/packages/security/oidc-provider/test/app/services/Accounts.ts index 744fce44c11..d589a6a846c 100644 --- a/packages/security/oidc-provider/test/app/services/Accounts.ts +++ b/packages/security/oidc-provider/test/app/services/Accounts.ts @@ -1,8 +1,9 @@ -import {Adapter, InjectAdapter} from "@tsed/adapters"; +import type {Adapter} from "@tsed/adapters"; +import {InjectAdapter} from "@tsed/adapters"; import {Injectable} from "@tsed/di"; import {deserialize} from "@tsed/json-mapper"; -import {AccessToken, AuthorizationCode, DeviceCode, OidcAccountsMethods} from "../../../src/index.js"; +import type {AccessToken, AuthorizationCode, DeviceCode, OidcAccountsMethods} from "../../../src/index.js"; import {Account} from "../models/Account.js"; @Injectable() diff --git a/packages/security/oidc-provider/tsconfig.esm.json b/packages/security/oidc-provider/tsconfig.esm.json index 82292550ddb..8954049da4a 100644 --- a/packages/security/oidc-provider/tsconfig.esm.json +++ b/packages/security/oidc-provider/tsconfig.esm.json @@ -2,7 +2,6 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", diff --git a/packages/security/oidc-provider/tsconfig.spec.json b/packages/security/oidc-provider/tsconfig.spec.json index 2e917f4b39d..fdb41369c3a 100644 --- a/packages/security/oidc-provider/tsconfig.spec.json +++ b/packages/security/oidc-provider/tsconfig.spec.json @@ -3,31 +3,31 @@ "compilerOptions": { "baseUrl": ".", "rootDir": "../..", - "outDir": "./lib/cjs", "declaration": false, "composite": false, "noEmit": true, "paths": { - "@tsed/openspec": ["../../specs/openspec/src"], - "@tsed/schema": ["../../specs/schema/src"], - "@tsed/di": ["../../di/src"], - "@tsed/exceptions": ["../../specs/exceptions/src"], - "@tsed/json-mapper": ["../../specs/json-mapper/src"], - "@tsed/platform-exceptions": ["../../platform/platform-exceptions/src"], - "@tsed/platform-middlewares": ["../../platform/platform-middlewares/src"], - "@tsed/platform-params": ["../../platform/platform-params/src"], - "@tsed/platform-log-middleware": ["../../platform/platform-log-middleware/src"], - "@tsed/platform-response-filter": ["../../platform/platform-response-filter/src"], - "@tsed/platform-router": ["../../platform/platform-router/src"], - "@tsed/platform-views": ["../../platform/platform-views/src"], - "@tsed/components-scan": ["../../third-parties/components-scan/src"], - "@tsed/common": ["../../platform/common/src"], - "@tsed/ajv": ["../../specs/ajv/src"], - "@tsed/platform-cache": ["../../platform/platform-cache/src"], - "@tsed/swagger": ["../../specs/swagger/src"], - "@tsed/platform-test-sdk": ["../../platform/platform-test-sdk/src"], - "@tsed/platform-express": ["../../platform/platform-express/src"], - "@tsed/platform-koa": ["../../platform/platform-koa/src"] + "@tsed/openspec": ["../../specs/openspec/src/index.ts"], + "@tsed/schema": ["../../specs/schema/src/index.ts"], + "@tsed/di": ["../../di/src/index.ts"], + "@tsed/exceptions": ["../../specs/exceptions/src/index.ts"], + "@tsed/json-mapper": ["../../specs/json-mapper/src/index.ts"], + "@tsed/platform-exceptions": ["../../platform/platform-exceptions/src/index.ts"], + "@tsed/platform-middlewares": ["../../platform/platform-middlewares/src/index.ts"], + "@tsed/platform-params": ["../../platform/platform-params/src/index.ts"], + "@tsed/platform-log-middleware": ["../../platform/platform-log-middleware/src/index.ts"], + "@tsed/platform-response-filter": ["../../platform/platform-response-filter/src/index.ts"], + "@tsed/platform-router": ["../../platform/platform-router/src/index.ts"], + "@tsed/platform-views": ["../../platform/platform-views/src/index.ts"], + "@tsed/normalize-path": ["../../utils/normalize-path/src/index.ts"], + "@tsed/components-scan": ["../../third-parties/components-scan/src/index.ts"], + "@tsed/common": ["../../platform/common/src/index.ts"], + "@tsed/ajv": ["../../specs/ajv/src/index.ts"], + "@tsed/platform-cache": ["../../platform/platform-cache/src/index.ts"], + "@tsed/swagger": ["../../specs/swagger/src/index.ts"], + "@tsed/platform-test-sdk": ["../../platform/platform-test-sdk/src/index.ts"], + "@tsed/platform-express": ["../../platform/platform-express/src/index.ts"], + "@tsed/platform-koa": ["../../platform/platform-koa/src/index.ts"] }, "types": ["vite/client", "vitest/globals"] }, diff --git a/packages/security/passport/package.json b/packages/security/passport/package.json index 0f4b865fc00..5622efe5a22 100644 --- a/packages/security/passport/package.json +++ b/packages/security/passport/package.json @@ -11,11 +11,11 @@ ".": { "types": "./lib/types/index.d.ts", "import": "./lib/esm/index.js", - "default": "./lib/cjs/index.js" + "default": "./lib/esm/index.js" } }, "scripts": { - "clean": "rm -rf lib", + "clean": "rm -rf lib tsconfig.spec.buildinfo", "build": "yarn clean && yarn barrels && yarn build:ts", "barrels": "barrels", "test": "vitest run", diff --git a/packages/security/passport/src/PassportModule.ts b/packages/security/passport/src/PassportModule.ts index 62c69131ad1..73db8feaf68 100644 --- a/packages/security/passport/src/PassportModule.ts +++ b/packages/security/passport/src/PassportModule.ts @@ -1,4 +1,14 @@ -import {BeforeRoutesInit, Constant, Inject, Logger, Module, OnInit, PlatformApplication, Provider, ProviderScope} from "@tsed/common"; +import { + type BeforeRoutesInit, + Constant, + Inject, + Logger, + Module, + type OnInit, + PlatformApplication, + type Provider, + ProviderScope +} from "@tsed/common"; import Passport from "passport"; import {PassportSerializerService} from "./services/PassportSerializerService.js"; @@ -23,14 +33,17 @@ export class PassportModule implements OnInit, BeforeRoutesInit { @Constant("PLATFORM_NAME") platformName: string; - @Inject() + @Inject(Logger) logger: Logger; - constructor( - private app: PlatformApplication, - private protocolsService: ProtocolsService, - private passportSerializer: PassportSerializerService - ) {} + @Inject(PlatformApplication) + private app: PlatformApplication; + + @Inject(ProtocolsService) + private protocolsService: ProtocolsService; + + @Inject(PassportSerializerService) + private passportSerializer: PassportSerializerService; async $onInit(): Promise { Passport.serializeUser(this.passportSerializer.serialize.bind(this.passportSerializer)); diff --git a/packages/security/passport/src/decorators/authenticate.ts b/packages/security/passport/src/decorators/authenticate.ts index 0a7e050fb3c..1a28c657ae1 100644 --- a/packages/security/passport/src/decorators/authenticate.ts +++ b/packages/security/passport/src/decorators/authenticate.ts @@ -1,7 +1,7 @@ import {useDecorators} from "@tsed/core"; import {UseAuth} from "@tsed/platform-middlewares"; import {Security} from "@tsed/schema"; -import {AuthenticateOptions as PassportAuthenticateOptions} from "passport"; +import type {AuthenticateOptions as PassportAuthenticateOptions} from "passport"; import {PassportMiddleware} from "../middlewares/PassportMiddleware.js"; diff --git a/packages/security/passport/src/decorators/authorize.ts b/packages/security/passport/src/decorators/authorize.ts index d241b46955e..4d2fe14203a 100644 --- a/packages/security/passport/src/decorators/authorize.ts +++ b/packages/security/passport/src/decorators/authorize.ts @@ -1,7 +1,7 @@ import {useDecorators} from "@tsed/core"; import {UseAuth} from "@tsed/platform-middlewares"; import {Security} from "@tsed/schema"; -import {AuthenticateOptions} from "passport"; +import type {AuthenticateOptions} from "passport"; import {PassportMiddleware} from "../middlewares/PassportMiddleware.js"; diff --git a/packages/security/passport/src/decorators/protocol.ts b/packages/security/passport/src/decorators/protocol.ts index 78d597dbb26..ffaec958fac 100644 --- a/packages/security/passport/src/decorators/protocol.ts +++ b/packages/security/passport/src/decorators/protocol.ts @@ -2,7 +2,7 @@ import {StoreSet, useDecorators} from "@tsed/core"; import {Configuration, Injectable} from "@tsed/di"; import {PROVIDER_TYPE_PROTOCOL} from "../contants/constants.js"; -import {ProtocolOptions} from "../interfaces/ProtocolOptions.js"; +import type {ProtocolOptions} from "../interfaces/ProtocolOptions.js"; /** * Declare a new Protocol base on a Passport Strategy diff --git a/packages/security/passport/src/interfaces/OnInstall.ts b/packages/security/passport/src/interfaces/OnInstall.ts index 35464638497..8032e40927e 100644 --- a/packages/security/passport/src/interfaces/OnInstall.ts +++ b/packages/security/passport/src/interfaces/OnInstall.ts @@ -1,4 +1,4 @@ -import {Strategy} from "passport"; +import type {Strategy} from "passport"; export interface OnInstall { $onInstall(strategy: Strategy): void | Promise; diff --git a/packages/security/passport/src/interfaces/ProtocolMethods.ts b/packages/security/passport/src/interfaces/ProtocolMethods.ts index 45f39988e82..79bae1bd8be 100644 --- a/packages/security/passport/src/interfaces/ProtocolMethods.ts +++ b/packages/security/passport/src/interfaces/ProtocolMethods.ts @@ -1,5 +1,5 @@ -import {BeforeInstall} from "./BeforeInstall.js"; -import {OnInstall} from "./OnInstall.js"; -import {OnVerify} from "./OnVerify.js"; +import type {BeforeInstall} from "./BeforeInstall.js"; +import type {OnInstall} from "./OnInstall.js"; +import type {OnVerify} from "./OnVerify.js"; export interface ProtocolMethods extends OnVerify, OnInstall, BeforeInstall {} diff --git a/packages/security/passport/src/interfaces/ProtocolOptions.ts b/packages/security/passport/src/interfaces/ProtocolOptions.ts index e62aaf1bcc2..92be285c287 100644 --- a/packages/security/passport/src/interfaces/ProtocolOptions.ts +++ b/packages/security/passport/src/interfaces/ProtocolOptions.ts @@ -1,5 +1,5 @@ -import {Type} from "@tsed/core"; -import {Strategy} from "passport"; +import type {Type} from "@tsed/core"; +import type {Strategy} from "passport"; export interface ProtocolOptions { name: string; diff --git a/packages/security/passport/src/interfaces/interfaces.ts b/packages/security/passport/src/interfaces/interfaces.ts index e5f1da412db..8d7295585ea 100644 --- a/packages/security/passport/src/interfaces/interfaces.ts +++ b/packages/security/passport/src/interfaces/interfaces.ts @@ -1,7 +1,7 @@ -import {Type} from "@tsed/core"; -import {PassportStatic} from "passport"; +import type {Type} from "@tsed/core"; +import type {PassportStatic} from "passport"; -import {ProtocolOptions} from "./ProtocolOptions.js"; +import type {ProtocolOptions} from "./ProtocolOptions.js"; declare global { namespace TsED { diff --git a/packages/security/passport/src/services/PassportSerializerService.ts b/packages/security/passport/src/services/PassportSerializerService.ts index ad80889e704..f6950664285 100644 --- a/packages/security/passport/src/services/PassportSerializerService.ts +++ b/packages/security/passport/src/services/PassportSerializerService.ts @@ -1,4 +1,4 @@ -import {Type} from "@tsed/core"; +import type {Type} from "@tsed/core"; import {Constant, Service} from "@tsed/di"; import {deserialize, serialize} from "@tsed/json-mapper"; diff --git a/packages/security/passport/src/services/ProtocolsService.ts b/packages/security/passport/src/services/ProtocolsService.ts index 31b8dd4fe3c..16618b41877 100644 --- a/packages/security/passport/src/services/ProtocolsService.ts +++ b/packages/security/passport/src/services/ProtocolsService.ts @@ -1,6 +1,6 @@ -import {PlatformContext, PlatformHandler} from "@tsed/common"; +import {type PlatformContext, PlatformHandler} from "@tsed/common"; import {ancestorsOf} from "@tsed/core"; -import {Inject, Injectable, InjectorService, Provider} from "@tsed/di"; +import {Inject, Injectable, InjectorService, type Provider} from "@tsed/di"; import {Unauthorized} from "@tsed/exceptions"; import Passport, {Strategy} from "passport"; import {promisify} from "util"; @@ -18,10 +18,10 @@ import type {ProtocolOptions} from "../interfaces/ProtocolOptions.js"; export class ProtocolsService { readonly strategies: Map = new Map(); - @Inject() + @Inject(PlatformHandler) protected platformHandler: PlatformHandler; - @Inject() + @Inject(InjectorService) private injector: InjectorService; public getProtocols(): Provider[] { diff --git a/packages/security/passport/test/app/Server.ts b/packages/security/passport/test/app/Server.ts index 68932ea7187..39539d0cd4a 100644 --- a/packages/security/passport/test/app/Server.ts +++ b/packages/security/passport/test/app/Server.ts @@ -4,7 +4,8 @@ import "@tsed/swagger"; import "./protocols/LoginLocalProtocol.js"; import {MemoryAdapter} from "@tsed/adapters"; -import {Configuration, Inject, PlatformApplication} from "@tsed/common"; +import {PlatformApplication} from "@tsed/common"; +import {Configuration, Inject} from "@tsed/common"; import bodyParser from "body-parser"; import compress from "compression"; import cookieParser from "cookie-parser"; @@ -32,7 +33,7 @@ export {rootDir}; } }) export class Server { - @Inject() + @Inject(PlatformApplication) app: PlatformApplication; public $beforeRoutesInit(): void { diff --git a/packages/security/passport/test/app/controllers/rest/auth/AuthCtrl.ts b/packages/security/passport/test/app/controllers/rest/auth/AuthCtrl.ts index 222a2d867ae..5349f796502 100644 --- a/packages/security/passport/test/app/controllers/rest/auth/AuthCtrl.ts +++ b/packages/security/passport/test/app/controllers/rest/auth/AuthCtrl.ts @@ -3,7 +3,7 @@ import {Returns} from "@tsed/schema"; import {Authenticate} from "../../../../.."; import {Account} from "../../../models/Account.js"; -import {Credentials} from "../../../models/Credentials.js"; +import type {Credentials} from "../../../models/Credentials.js"; @Controller("/auth") @Scope(ProviderScope.SINGLETON) diff --git a/packages/security/passport/test/app/protocols/LoginLocalProtocol.ts b/packages/security/passport/test/app/protocols/LoginLocalProtocol.ts index 8d9132b2b9e..b9c14cad5a7 100644 --- a/packages/security/passport/test/app/protocols/LoginLocalProtocol.ts +++ b/packages/security/passport/test/app/protocols/LoginLocalProtocol.ts @@ -1,9 +1,11 @@ import {BodyParams, Inject, Req} from "@tsed/common"; import {Unauthorized} from "@tsed/exceptions"; -import {IStrategyOptions, Strategy} from "passport-local"; +import type {IStrategyOptions} from "passport-local"; +import {Strategy} from "passport-local"; -import {OnInstall, OnVerify, Protocol} from "../../.."; -import {Credentials} from "../models/Credentials.js"; +import type {OnInstall, OnVerify} from "../../../src/index.js"; +import {Protocol} from "../../../src/index.js"; +import type {Credentials} from "../models/Credentials.js"; import {UsersRepository} from "../services/UsersRepository.js"; @Protocol({ @@ -15,7 +17,7 @@ import {UsersRepository} from "../services/UsersRepository.js"; } }) export class LoginLocalProtocol implements OnVerify, OnInstall { - @Inject() + @Inject(UsersRepository) private usersService: UsersRepository; async $onVerify(@Req() request: Req, @BodyParams() credentials: Credentials) { diff --git a/packages/security/passport/test/app/services/UsersRepository.ts b/packages/security/passport/test/app/services/UsersRepository.ts index e09d68b56ae..5671faa9759 100644 --- a/packages/security/passport/test/app/services/UsersRepository.ts +++ b/packages/security/passport/test/app/services/UsersRepository.ts @@ -1,4 +1,5 @@ -import {Adapter, InjectAdapter} from "@tsed/adapters"; +import type {Adapter} from "@tsed/adapters"; +import {InjectAdapter} from "@tsed/adapters"; import {Injectable} from "@tsed/di"; import {deserialize} from "@tsed/json-mapper"; diff --git a/packages/security/passport/tsconfig.esm.json b/packages/security/passport/tsconfig.esm.json index 82292550ddb..8954049da4a 100644 --- a/packages/security/passport/tsconfig.esm.json +++ b/packages/security/passport/tsconfig.esm.json @@ -2,7 +2,6 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", diff --git a/packages/security/passport/tsconfig.spec.json b/packages/security/passport/tsconfig.spec.json index 2e917f4b39d..fdb41369c3a 100644 --- a/packages/security/passport/tsconfig.spec.json +++ b/packages/security/passport/tsconfig.spec.json @@ -3,31 +3,31 @@ "compilerOptions": { "baseUrl": ".", "rootDir": "../..", - "outDir": "./lib/cjs", "declaration": false, "composite": false, "noEmit": true, "paths": { - "@tsed/openspec": ["../../specs/openspec/src"], - "@tsed/schema": ["../../specs/schema/src"], - "@tsed/di": ["../../di/src"], - "@tsed/exceptions": ["../../specs/exceptions/src"], - "@tsed/json-mapper": ["../../specs/json-mapper/src"], - "@tsed/platform-exceptions": ["../../platform/platform-exceptions/src"], - "@tsed/platform-middlewares": ["../../platform/platform-middlewares/src"], - "@tsed/platform-params": ["../../platform/platform-params/src"], - "@tsed/platform-log-middleware": ["../../platform/platform-log-middleware/src"], - "@tsed/platform-response-filter": ["../../platform/platform-response-filter/src"], - "@tsed/platform-router": ["../../platform/platform-router/src"], - "@tsed/platform-views": ["../../platform/platform-views/src"], - "@tsed/components-scan": ["../../third-parties/components-scan/src"], - "@tsed/common": ["../../platform/common/src"], - "@tsed/ajv": ["../../specs/ajv/src"], - "@tsed/platform-cache": ["../../platform/platform-cache/src"], - "@tsed/swagger": ["../../specs/swagger/src"], - "@tsed/platform-test-sdk": ["../../platform/platform-test-sdk/src"], - "@tsed/platform-express": ["../../platform/platform-express/src"], - "@tsed/platform-koa": ["../../platform/platform-koa/src"] + "@tsed/openspec": ["../../specs/openspec/src/index.ts"], + "@tsed/schema": ["../../specs/schema/src/index.ts"], + "@tsed/di": ["../../di/src/index.ts"], + "@tsed/exceptions": ["../../specs/exceptions/src/index.ts"], + "@tsed/json-mapper": ["../../specs/json-mapper/src/index.ts"], + "@tsed/platform-exceptions": ["../../platform/platform-exceptions/src/index.ts"], + "@tsed/platform-middlewares": ["../../platform/platform-middlewares/src/index.ts"], + "@tsed/platform-params": ["../../platform/platform-params/src/index.ts"], + "@tsed/platform-log-middleware": ["../../platform/platform-log-middleware/src/index.ts"], + "@tsed/platform-response-filter": ["../../platform/platform-response-filter/src/index.ts"], + "@tsed/platform-router": ["../../platform/platform-router/src/index.ts"], + "@tsed/platform-views": ["../../platform/platform-views/src/index.ts"], + "@tsed/normalize-path": ["../../utils/normalize-path/src/index.ts"], + "@tsed/components-scan": ["../../third-parties/components-scan/src/index.ts"], + "@tsed/common": ["../../platform/common/src/index.ts"], + "@tsed/ajv": ["../../specs/ajv/src/index.ts"], + "@tsed/platform-cache": ["../../platform/platform-cache/src/index.ts"], + "@tsed/swagger": ["../../specs/swagger/src/index.ts"], + "@tsed/platform-test-sdk": ["../../platform/platform-test-sdk/src/index.ts"], + "@tsed/platform-express": ["../../platform/platform-express/src/index.ts"], + "@tsed/platform-koa": ["../../platform/platform-koa/src/index.ts"] }, "types": ["vite/client", "vitest/globals"] }, diff --git a/packages/specs/ajv/package.json b/packages/specs/ajv/package.json index 30a961b39bc..2553f397071 100644 --- a/packages/specs/ajv/package.json +++ b/packages/specs/ajv/package.json @@ -11,7 +11,7 @@ ".": { "types": "./lib/types/index.d.ts", "import": "./lib/esm/index.js", - "default": "./lib/cjs/index.js" + "default": "./lib/esm/index.js" } }, "scripts": { diff --git a/packages/specs/ajv/src/decorators/formats.ts b/packages/specs/ajv/src/decorators/formats.ts index 173bc89461f..dddac77078a 100644 --- a/packages/specs/ajv/src/decorators/formats.ts +++ b/packages/specs/ajv/src/decorators/formats.ts @@ -1,6 +1,6 @@ import {StoreSet, useDecorators} from "@tsed/core"; import {Injectable} from "@tsed/di"; -import {AsyncFormatDefinition, FormatDefinition} from "ajv"; +import type {AsyncFormatDefinition, FormatDefinition} from "ajv"; export type FormatsOptions = Omit, "validate" | "compare"> | Omit, "validate" | "compare">; diff --git a/packages/specs/ajv/src/decorators/keyword.ts b/packages/specs/ajv/src/decorators/keyword.ts index 68d4f873f03..5fff3e7003b 100644 --- a/packages/specs/ajv/src/decorators/keyword.ts +++ b/packages/specs/ajv/src/decorators/keyword.ts @@ -1,7 +1,7 @@ import {StoreSet, useDecorators} from "@tsed/core"; import {Injectable} from "@tsed/di"; -import {JsonSchema} from "@tsed/schema"; -import {AnySchemaObject, KeywordDefinition} from "ajv"; +import type {JsonSchema} from "@tsed/schema"; +import type {AnySchemaObject, KeywordDefinition} from "ajv"; export type KeywordOptions = Partial> & { metaSchema?: AnySchemaObject | JsonSchema; diff --git a/packages/specs/ajv/src/interfaces/IAjvSettings.ts b/packages/specs/ajv/src/interfaces/IAjvSettings.ts index c10951942d3..0d6b77c2c5c 100644 --- a/packages/specs/ajv/src/interfaces/IAjvSettings.ts +++ b/packages/specs/ajv/src/interfaces/IAjvSettings.ts @@ -1,4 +1,4 @@ -import {ErrorObject, Options} from "ajv"; +import type {ErrorObject, Options} from "ajv"; /** * diff --git a/packages/specs/ajv/src/interfaces/KeywordMethods.ts b/packages/specs/ajv/src/interfaces/KeywordMethods.ts index a4816b7e830..7285f348f66 100644 --- a/packages/specs/ajv/src/interfaces/KeywordMethods.ts +++ b/packages/specs/ajv/src/interfaces/KeywordMethods.ts @@ -1,4 +1,4 @@ -import {AnySchemaObject, KeywordCxt, SchemaObjCxt, ValidateFunction} from "ajv"; +import type {AnySchemaObject, KeywordCxt, SchemaObjCxt, ValidateFunction} from "ajv"; export interface AjvDataValidationCtx { dataPath: string; diff --git a/packages/specs/ajv/src/interfaces/interfaces.ts b/packages/specs/ajv/src/interfaces/interfaces.ts index 80f3ee295bf..84f26b259f1 100644 --- a/packages/specs/ajv/src/interfaces/interfaces.ts +++ b/packages/specs/ajv/src/interfaces/interfaces.ts @@ -1,4 +1,4 @@ -import {IAjvSettings} from "./IAjvSettings.js"; +import type {IAjvSettings} from "./IAjvSettings.js"; declare global { namespace TsED { diff --git a/packages/specs/ajv/src/services/Ajv.ts b/packages/specs/ajv/src/services/Ajv.ts index 306327d5f17..4f22d8848b2 100644 --- a/packages/specs/ajv/src/services/Ajv.ts +++ b/packages/specs/ajv/src/services/Ajv.ts @@ -1,11 +1,12 @@ import {cleanObject} from "@tsed/core"; import {Configuration, InjectorService, ProviderScope, registerProvider} from "@tsed/di"; -import {Ajv, Format, KeywordDefinition, Options, Vocabulary} from "ajv"; +import type {Format, KeywordDefinition, Options, Vocabulary} from "ajv"; +import {Ajv} from "ajv"; import AjvErrors from "ajv-errors"; import AjvFormats from "ajv-formats"; -import {FormatsMethods} from "../interfaces/FormatsMethods.js"; -import {IAjvSettings} from "../interfaces/IAjvSettings.js"; +import type {FormatsMethods} from "../interfaces/FormatsMethods.js"; +import type {IAjvSettings} from "../interfaces/IAjvSettings.js"; function getHandler(key: string, service: any) { if (service[key]) { diff --git a/packages/specs/ajv/src/services/AjvService.ts b/packages/specs/ajv/src/services/AjvService.ts index b7d0531d61f..c0d8f987fc4 100644 --- a/packages/specs/ajv/src/services/AjvService.ts +++ b/packages/specs/ajv/src/services/AjvService.ts @@ -1,12 +1,14 @@ import "./Ajv.js"; -import {deepClone, getValue, nameOf, prototypeOf, setValue, Type} from "@tsed/core"; +import type {Type} from "@tsed/core"; +import {deepClone, getValue, nameOf, prototypeOf, setValue} from "@tsed/core"; import {Constant, Inject, Injectable} from "@tsed/di"; -import {getJsonSchema, JsonEntityStore, JsonSchema, JsonSchemaObject} from "@tsed/schema"; +import type {JsonSchemaObject} from "@tsed/schema"; +import {getJsonSchema, JsonEntityStore, JsonSchema} from "@tsed/schema"; import {Ajv, type ErrorObject} from "ajv"; import {AjvValidationError} from "../errors/AjvValidationError.js"; -import {AjvErrorObject, ErrorFormatter} from "../interfaces/IAjvSettings.js"; +import type {AjvErrorObject, ErrorFormatter} from "../interfaces/IAjvSettings.js"; import {defaultErrorFormatter} from "../utils/defaultErrorFormatter.js"; import {getPath} from "../utils/getPath.js"; diff --git a/packages/specs/ajv/src/utils/defaultErrorFormatter.ts b/packages/specs/ajv/src/utils/defaultErrorFormatter.ts index c9dc76db4ce..706d8c76ca3 100644 --- a/packages/specs/ajv/src/utils/defaultErrorFormatter.ts +++ b/packages/specs/ajv/src/utils/defaultErrorFormatter.ts @@ -1,4 +1,4 @@ -import {AjvErrorObject} from "../interfaces/IAjvSettings.js"; +import type {AjvErrorObject} from "../interfaces/IAjvSettings.js"; import {getInstancePath, getPath} from "./getPath.js"; export function defaultErrorFormatter(error: AjvErrorObject & {dataPath: string}) { diff --git a/packages/specs/ajv/test/integration/formats.integration.spec.ts b/packages/specs/ajv/test/integration/formats.integration.spec.ts index 64b46115815..f9e2338af6d 100644 --- a/packages/specs/ajv/test/integration/formats.integration.spec.ts +++ b/packages/specs/ajv/test/integration/formats.integration.spec.ts @@ -2,7 +2,7 @@ import {PlatformTest} from "@tsed/common"; import {Format, getJsonSchema} from "@tsed/schema"; import {Formats} from "../../src/decorators/formats.js"; -import {FormatsMethods} from "../../src/interfaces/FormatsMethods.js"; +import type {FormatsMethods} from "../../src/interfaces/FormatsMethods.js"; import {AjvService} from "../../src/services/AjvService.js"; const NOT_URI_FRAGMENT = /\/|:/; diff --git a/packages/specs/ajv/test/integration/keywords.integration.spec.ts b/packages/specs/ajv/test/integration/keywords.integration.spec.ts index fabdb605f34..01aad023ebe 100644 --- a/packages/specs/ajv/test/integration/keywords.integration.spec.ts +++ b/packages/specs/ajv/test/integration/keywords.integration.spec.ts @@ -2,10 +2,11 @@ import "../.."; import {PlatformTest} from "@tsed/common"; import {array, CustomKey, getJsonSchema, number} from "@tsed/schema"; -import Ajv, {_, KeywordCxt} from "ajv"; +import type {KeywordCxt} from "ajv"; +import Ajv, {_} from "ajv"; import {Keyword} from "../../src/decorators/keyword.js"; -import {KeywordMethods} from "../../src/interfaces/KeywordMethods.js"; +import type {KeywordMethods} from "../../src/interfaces/KeywordMethods.js"; @Keyword({ keyword: "range", diff --git a/packages/specs/ajv/tsconfig.spec.json b/packages/specs/ajv/tsconfig.spec.json index 10b1f26d4bb..f8220d80266 100644 --- a/packages/specs/ajv/tsconfig.spec.json +++ b/packages/specs/ajv/tsconfig.spec.json @@ -3,30 +3,30 @@ "compilerOptions": { "baseUrl": ".", "rootDir": "../..", - "outDir": "./lib/cjs", "declaration": false, "composite": false, "noEmit": true, "paths": { - "@tsed/openspec": ["../openspec/src"], - "@tsed/schema": ["../schema/src"], - "@tsed/di": ["../../di/src"], - "@tsed/exceptions": ["../exceptions/src"], - "@tsed/json-mapper": ["../json-mapper/src"], - "@tsed/platform-exceptions": ["../../platform/platform-exceptions/src"], - "@tsed/platform-middlewares": ["../../platform/platform-middlewares/src"], - "@tsed/platform-params": ["../../platform/platform-params/src"], - "@tsed/platform-log-middleware": ["../../platform/platform-log-middleware/src"], - "@tsed/platform-response-filter": ["../../platform/platform-response-filter/src"], - "@tsed/platform-router": ["../../platform/platform-router/src"], - "@tsed/platform-views": ["../../platform/platform-views/src"], - "@tsed/components-scan": ["../../third-parties/components-scan/src"], - "@tsed/common": ["../../platform/common/src"], - "@tsed/platform-cache": ["../../platform/platform-cache/src"], - "@tsed/swagger": ["../swagger/src"], - "@tsed/platform-test-sdk": ["../../platform/platform-test-sdk/src"], - "@tsed/platform-express": ["../../platform/platform-express/src"], - "@tsed/platform-koa": ["../../platform/platform-koa/src"] + "@tsed/openspec": ["../openspec/src/index.ts"], + "@tsed/schema": ["../schema/src/index.ts"], + "@tsed/di": ["../../di/src/index.ts"], + "@tsed/exceptions": ["../exceptions/src/index.ts"], + "@tsed/json-mapper": ["../json-mapper/src/index.ts"], + "@tsed/platform-exceptions": ["../../platform/platform-exceptions/src/index.ts"], + "@tsed/platform-middlewares": ["../../platform/platform-middlewares/src/index.ts"], + "@tsed/platform-params": ["../../platform/platform-params/src/index.ts"], + "@tsed/platform-log-middleware": ["../../platform/platform-log-middleware/src/index.ts"], + "@tsed/platform-response-filter": ["../../platform/platform-response-filter/src/index.ts"], + "@tsed/platform-router": ["../../platform/platform-router/src/index.ts"], + "@tsed/platform-views": ["../../platform/platform-views/src/index.ts"], + "@tsed/normalize-path": ["../../utils/normalize-path/src/index.ts"], + "@tsed/components-scan": ["../../third-parties/components-scan/src/index.ts"], + "@tsed/common": ["../../platform/common/src/index.ts"], + "@tsed/platform-cache": ["../../platform/platform-cache/src/index.ts"], + "@tsed/swagger": ["../swagger/src/index.ts"], + "@tsed/platform-test-sdk": ["../../platform/platform-test-sdk/src/index.ts"], + "@tsed/platform-express": ["../../platform/platform-express/src/index.ts"], + "@tsed/platform-koa": ["../../platform/platform-koa/src/index.ts"] }, "types": ["vite/client", "vitest/globals"] }, diff --git a/packages/specs/exceptions/package.json b/packages/specs/exceptions/package.json index ff36180b398..edf32d52e0f 100644 --- a/packages/specs/exceptions/package.json +++ b/packages/specs/exceptions/package.json @@ -11,7 +11,7 @@ ".": { "types": "./lib/types/index.d.ts", "import": "./lib/esm/index.js", - "default": "./lib/cjs/index.js" + "default": "./lib/esm/index.js" } }, "scripts": { diff --git a/packages/specs/exceptions/src/core/Exception.ts b/packages/specs/exceptions/src/core/Exception.ts index d1f8ae6a341..247211b8ff7 100644 --- a/packages/specs/exceptions/src/core/Exception.ts +++ b/packages/specs/exceptions/src/core/Exception.ts @@ -2,7 +2,7 @@ import {classOf, nameOf} from "@tsed/core"; import {constantCase} from "change-case"; import statuses from "statuses"; -import {StatusFamily} from "./StatusFamily.js"; +import type {StatusFamily} from "./StatusFamily.js"; export class Exception extends Error { /** diff --git a/packages/specs/exceptions/tsconfig.esm.json b/packages/specs/exceptions/tsconfig.esm.json index 82292550ddb..8954049da4a 100644 --- a/packages/specs/exceptions/tsconfig.esm.json +++ b/packages/specs/exceptions/tsconfig.esm.json @@ -2,7 +2,6 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", diff --git a/packages/specs/exceptions/tsconfig.spec.json b/packages/specs/exceptions/tsconfig.spec.json index 641bcc59bbc..80b62f783fa 100644 --- a/packages/specs/exceptions/tsconfig.spec.json +++ b/packages/specs/exceptions/tsconfig.spec.json @@ -3,30 +3,30 @@ "compilerOptions": { "baseUrl": ".", "rootDir": "../..", - "outDir": "./lib/cjs", "declaration": false, "composite": false, "noEmit": true, "paths": { - "@tsed/openspec": ["../openspec/src"], - "@tsed/schema": ["../schema/src"], - "@tsed/di": ["../../di/src"], - "@tsed/json-mapper": ["../json-mapper/src"], - "@tsed/platform-exceptions": ["../../platform/platform-exceptions/src"], - "@tsed/platform-middlewares": ["../../platform/platform-middlewares/src"], - "@tsed/platform-params": ["../../platform/platform-params/src"], - "@tsed/platform-log-middleware": ["../../platform/platform-log-middleware/src"], - "@tsed/platform-response-filter": ["../../platform/platform-response-filter/src"], - "@tsed/platform-router": ["../../platform/platform-router/src"], - "@tsed/platform-views": ["../../platform/platform-views/src"], - "@tsed/components-scan": ["../../third-parties/components-scan/src"], - "@tsed/common": ["../../platform/common/src"], - "@tsed/ajv": ["../ajv/src"], - "@tsed/platform-cache": ["../../platform/platform-cache/src"], - "@tsed/swagger": ["../swagger/src"], - "@tsed/platform-test-sdk": ["../../platform/platform-test-sdk/src"], - "@tsed/platform-express": ["../../platform/platform-express/src"], - "@tsed/platform-koa": ["../../platform/platform-koa/src"] + "@tsed/openspec": ["../openspec/src/index.ts"], + "@tsed/schema": ["../schema/src/index.ts"], + "@tsed/di": ["../../di/src/index.ts"], + "@tsed/json-mapper": ["../json-mapper/src/index.ts"], + "@tsed/platform-exceptions": ["../../platform/platform-exceptions/src/index.ts"], + "@tsed/platform-middlewares": ["../../platform/platform-middlewares/src/index.ts"], + "@tsed/platform-params": ["../../platform/platform-params/src/index.ts"], + "@tsed/platform-log-middleware": ["../../platform/platform-log-middleware/src/index.ts"], + "@tsed/platform-response-filter": ["../../platform/platform-response-filter/src/index.ts"], + "@tsed/platform-router": ["../../platform/platform-router/src/index.ts"], + "@tsed/platform-views": ["../../platform/platform-views/src/index.ts"], + "@tsed/normalize-path": ["../../utils/normalize-path/src/index.ts"], + "@tsed/components-scan": ["../../third-parties/components-scan/src/index.ts"], + "@tsed/common": ["../../platform/common/src/index.ts"], + "@tsed/ajv": ["../ajv/src/index.ts"], + "@tsed/platform-cache": ["../../platform/platform-cache/src/index.ts"], + "@tsed/swagger": ["../swagger/src/index.ts"], + "@tsed/platform-test-sdk": ["../../platform/platform-test-sdk/src/index.ts"], + "@tsed/platform-express": ["../../platform/platform-express/src/index.ts"], + "@tsed/platform-koa": ["../../platform/platform-koa/src/index.ts"] }, "types": ["vite/client", "vitest/globals"] }, diff --git a/packages/specs/json-mapper/package.json b/packages/specs/json-mapper/package.json index 20d809dc435..92c278f1106 100644 --- a/packages/specs/json-mapper/package.json +++ b/packages/specs/json-mapper/package.json @@ -13,11 +13,11 @@ "types": "./lib/types/index.d.ts", "browser": "./lib/browser/json-mapper.umd.min.js", "import": "./lib/esm/index.js", - "default": "./lib/cjs/index.js" + "default": "./lib/esm/index.js" } }, "scripts": { - "clean": "rm -rf lib", + "clean": "rm -rf lib tsconfig.spec.buildinfo", "build": "yarn clean && yarn barrels && yarn build:ts && yarn run build:browser", "build:browser": "webpack", "barrels": "barrels", diff --git a/packages/specs/json-mapper/src/components/DateMapper.ts b/packages/specs/json-mapper/src/components/DateMapper.ts index 39a622c8396..3c2a4da1020 100644 --- a/packages/specs/json-mapper/src/components/DateMapper.ts +++ b/packages/specs/json-mapper/src/components/DateMapper.ts @@ -1,7 +1,7 @@ import {isBoolean} from "@tsed/core"; import {JsonMapper} from "../decorators/jsonMapper.js"; -import {JsonMapperMethods} from "../interfaces/JsonMapperMethods.js"; +import type {JsonMapperMethods} from "../interfaces/JsonMapperMethods.js"; /** * Mapper for `Date` type. diff --git a/packages/specs/json-mapper/src/components/PrimitiveMapper.ts b/packages/specs/json-mapper/src/components/PrimitiveMapper.ts index c9ff007d6aa..3fceca9f702 100644 --- a/packages/specs/json-mapper/src/components/PrimitiveMapper.ts +++ b/packages/specs/json-mapper/src/components/PrimitiveMapper.ts @@ -1,7 +1,7 @@ import {nameOf} from "@tsed/core"; import {JsonMapper} from "../decorators/jsonMapper.js"; -import {JsonMapperCtx, JsonMapperMethods} from "../interfaces/JsonMapperMethods.js"; +import type {JsonMapperCtx, JsonMapperMethods} from "../interfaces/JsonMapperMethods.js"; function isNullish(data: any) { return [null, "null"].includes(data); diff --git a/packages/specs/json-mapper/src/components/SymbolMapper.ts b/packages/specs/json-mapper/src/components/SymbolMapper.ts index a2d39177bb3..340b9e07d8e 100644 --- a/packages/specs/json-mapper/src/components/SymbolMapper.ts +++ b/packages/specs/json-mapper/src/components/SymbolMapper.ts @@ -1,5 +1,5 @@ import {JsonMapper} from "../decorators/jsonMapper.js"; -import {JsonMapperMethods} from "../interfaces/JsonMapperMethods.js"; +import type {JsonMapperMethods} from "../interfaces/JsonMapperMethods.js"; /** * Mapper for the `Symbol` type. diff --git a/packages/specs/json-mapper/src/decorators/afterDeserialize.ts b/packages/specs/json-mapper/src/decorators/afterDeserialize.ts index 68deea59c7f..2343167e15f 100644 --- a/packages/specs/json-mapper/src/decorators/afterDeserialize.ts +++ b/packages/specs/json-mapper/src/decorators/afterDeserialize.ts @@ -1,4 +1,5 @@ -import {JsonEntityFn, JsonHookContext} from "@tsed/schema"; +import type {JsonHookContext} from "@tsed/schema"; +import {JsonEntityFn} from "@tsed/schema"; export interface AfterDeserializeCallback { (value: any, ctx: JsonHookContext): any; diff --git a/packages/specs/json-mapper/src/decorators/beforeDeserialize.ts b/packages/specs/json-mapper/src/decorators/beforeDeserialize.ts index 727fd4523e5..a2968b968e6 100644 --- a/packages/specs/json-mapper/src/decorators/beforeDeserialize.ts +++ b/packages/specs/json-mapper/src/decorators/beforeDeserialize.ts @@ -1,4 +1,5 @@ -import {JsonEntityFn, JsonHookContext} from "@tsed/schema"; +import type {JsonHookContext} from "@tsed/schema"; +import {JsonEntityFn} from "@tsed/schema"; export interface BeforeDeserializeCallback { (value: any, ctx: JsonHookContext): any; diff --git a/packages/specs/json-mapper/src/decorators/jsonMapper.ts b/packages/specs/json-mapper/src/decorators/jsonMapper.ts index b5bcbc99028..a0c73e50871 100644 --- a/packages/specs/json-mapper/src/decorators/jsonMapper.ts +++ b/packages/specs/json-mapper/src/decorators/jsonMapper.ts @@ -1,4 +1,4 @@ -import {Type} from "@tsed/core"; +import type {Type} from "@tsed/core"; import {registerJsonTypeMapper} from "../domain/JsonMapperTypesContainer.js"; diff --git a/packages/specs/json-mapper/src/decorators/onDeserialize.ts b/packages/specs/json-mapper/src/decorators/onDeserialize.ts index a4ae53e8c13..dd73c2b1a0d 100644 --- a/packages/specs/json-mapper/src/decorators/onDeserialize.ts +++ b/packages/specs/json-mapper/src/decorators/onDeserialize.ts @@ -1,4 +1,5 @@ -import {JsonEntityFn, JsonHookContext} from "@tsed/schema"; +import type {JsonHookContext} from "@tsed/schema"; +import {JsonEntityFn} from "@tsed/schema"; export interface OnDeserializeCallback { (value: any, ctx: JsonHookContext): any; diff --git a/packages/specs/json-mapper/src/decorators/onSerialize.ts b/packages/specs/json-mapper/src/decorators/onSerialize.ts index 924f4883928..6bae1a3fd5e 100644 --- a/packages/specs/json-mapper/src/decorators/onSerialize.ts +++ b/packages/specs/json-mapper/src/decorators/onSerialize.ts @@ -1,4 +1,5 @@ -import {JsonEntityFn, JsonHookContext} from "@tsed/schema"; +import type {JsonHookContext} from "@tsed/schema"; +import {JsonEntityFn} from "@tsed/schema"; export interface OnSerializeCallback { (value: any, ctx: JsonHookContext): any; diff --git a/packages/specs/json-mapper/src/domain/JsonDeserializer.spec.ts b/packages/specs/json-mapper/src/domain/JsonDeserializer.spec.ts index c25bcaa817c..e90dbc14d12 100644 --- a/packages/specs/json-mapper/src/domain/JsonDeserializer.spec.ts +++ b/packages/specs/json-mapper/src/domain/JsonDeserializer.spec.ts @@ -5,6 +5,7 @@ import "../components/SymbolMapper.js"; import {faker} from "@faker-js/faker"; // @ts-ignore import {QueryParams} from "@tsed/platform-params"; +import type {JsonHookContext} from "@tsed/schema"; import { AdditionalProperties, CollectionOf, @@ -18,7 +19,6 @@ import { Ignore, In, JsonEntityStore, - JsonHookContext, JsonParameterStore, MinLength, Name, diff --git a/packages/specs/json-mapper/src/domain/JsonDeserializer.ts b/packages/specs/json-mapper/src/domain/JsonDeserializer.ts index cb1a3b76772..a5413c64dbc 100644 --- a/packages/specs/json-mapper/src/domain/JsonDeserializer.ts +++ b/packages/specs/json-mapper/src/domain/JsonDeserializer.ts @@ -1,11 +1,14 @@ -import {classOf, isArray, isBoolean, isClass, isEmpty, isNil, nameOf, objectKeys, Type} from "@tsed/core"; -import {getPropertiesStores, JsonClassStore, JsonEntityStore, JsonParameterStore, JsonPropertyStore} from "@tsed/schema"; +import type {Type} from "@tsed/core"; +import {classOf, isArray, isBoolean, isClass, isEmpty, isNil, nameOf, objectKeys} from "@tsed/core"; +import type {JsonClassStore, JsonPropertyStore} from "@tsed/schema"; +import {getPropertiesStores, JsonEntityStore, JsonParameterStore} from "@tsed/schema"; import {alterAfterDeserialize} from "../hooks/alterAfterDeserialize.js"; import {alterBeforeDeserialize} from "../hooks/alterBeforeDeserialize.js"; import {alterOnDeserialize} from "../hooks/alterOnDeserialize.js"; -import {JsonDeserializerOptions} from "./JsonDeserializerOptions.js"; -import {CachedJsonMapper, JsonMapperCompiler} from "./JsonMapperCompiler.js"; +import type {JsonDeserializerOptions} from "./JsonDeserializerOptions.js"; +import type {CachedJsonMapper} from "./JsonMapperCompiler.js"; +import {JsonMapperCompiler} from "./JsonMapperCompiler.js"; import {JsonMapperSettings} from "./JsonMapperSettings.js"; import {getJsonMapperTypes} from "./JsonMapperTypesContainer.js"; import {Writer} from "./Writer.js"; diff --git a/packages/specs/json-mapper/src/domain/JsonDeserializerOptions.ts b/packages/specs/json-mapper/src/domain/JsonDeserializerOptions.ts index 21e8d88d7b7..4067b71f17f 100644 --- a/packages/specs/json-mapper/src/domain/JsonDeserializerOptions.ts +++ b/packages/specs/json-mapper/src/domain/JsonDeserializerOptions.ts @@ -1,8 +1,8 @@ -import {MetadataTypes, Type} from "@tsed/core"; -import {JsonEntityStore} from "@tsed/schema"; +import type {MetadataTypes, Type} from "@tsed/core"; +import type {JsonEntityStore} from "@tsed/schema"; -import {JsonMapperMethods} from "../interfaces/JsonMapperMethods.js"; -import {JsonMapperGlobalOptions} from "./JsonMapperGlobalOptions.js"; +import type {JsonMapperMethods} from "../interfaces/JsonMapperMethods.js"; +import type {JsonMapperGlobalOptions} from "./JsonMapperGlobalOptions.js"; export interface JsonDeserializerOptions extends MetadataTypes, JsonMapperGlobalOptions { /** diff --git a/packages/specs/json-mapper/src/domain/JsonMapperCompiler.ts b/packages/specs/json-mapper/src/domain/JsonMapperCompiler.ts index d5fce376559..824294ace7c 100644 --- a/packages/specs/json-mapper/src/domain/JsonMapperCompiler.ts +++ b/packages/specs/json-mapper/src/domain/JsonMapperCompiler.ts @@ -1,3 +1,4 @@ +import type {Type} from "@tsed/core"; import { ancestorsOf, classOf, @@ -13,10 +14,9 @@ import { isObjectID, isString, nameOf, - objectKeys, - Type + objectKeys } from "@tsed/core"; -import {JsonSchema} from "@tsed/schema"; +import type {JsonSchema} from "@tsed/schema"; export type JsonMapperCallback = (input: any, options?: Options) => any; export type CachedJsonMapper = { diff --git a/packages/specs/json-mapper/src/domain/JsonMapperTypesContainer.ts b/packages/specs/json-mapper/src/domain/JsonMapperTypesContainer.ts index 99df8193935..ddc5631dce6 100644 --- a/packages/specs/json-mapper/src/domain/JsonMapperTypesContainer.ts +++ b/packages/specs/json-mapper/src/domain/JsonMapperTypesContainer.ts @@ -1,6 +1,6 @@ -import {Type} from "@tsed/core"; +import type {Type} from "@tsed/core"; -import {JsonMapperMethods} from "../interfaces/JsonMapperMethods.js"; +import type {JsonMapperMethods} from "../interfaces/JsonMapperMethods.js"; /** * @ignore */ diff --git a/packages/specs/json-mapper/src/domain/JsonSerializer.spec.ts b/packages/specs/json-mapper/src/domain/JsonSerializer.spec.ts index 37a0f4bd063..7332d1dbd1d 100644 --- a/packages/specs/json-mapper/src/domain/JsonSerializer.spec.ts +++ b/packages/specs/json-mapper/src/domain/JsonSerializer.spec.ts @@ -3,6 +3,7 @@ import "../components/PrimitiveMapper.js"; import "../components/SymbolMapper.js"; import {cleanObject, isBoolean, isNumber, isObjectID, useDecorators} from "@tsed/core"; +import type {JsonHookContext} from "@tsed/schema"; import { AdditionalProperties, Allow, @@ -13,7 +14,6 @@ import { Email, Groups, Ignore, - JsonHookContext, MinLength, Name, Nullable, diff --git a/packages/specs/json-mapper/src/domain/JsonSerializer.ts b/packages/specs/json-mapper/src/domain/JsonSerializer.ts index 091b8b172e1..68b8ceca8f5 100644 --- a/packages/specs/json-mapper/src/domain/JsonSerializer.ts +++ b/packages/specs/json-mapper/src/domain/JsonSerializer.ts @@ -1,3 +1,4 @@ +import type {Type} from "@tsed/core"; import { classOf, hasJsonMethod, @@ -11,17 +12,17 @@ import { isNil, isObject, isPrimitive, - nameOf, - Type + nameOf } from "@tsed/core"; -import {getPropertiesStores, JsonClassStore, JsonEntityStore, JsonPropertyStore} from "@tsed/schema"; +import type {JsonClassStore, JsonPropertyStore} from "@tsed/schema"; +import {getPropertiesStores, JsonEntityStore} from "@tsed/schema"; import {alterOnSerialize} from "../hooks/alterOnSerialize.js"; import {getObjectProperties} from "../utils/getObjectProperties.js"; import {JsonMapperCompiler} from "./JsonMapperCompiler.js"; import {JsonMapperSettings} from "./JsonMapperSettings.js"; import {getJsonMapperTypes} from "./JsonMapperTypesContainer.js"; -import {JsonSerializerOptions} from "./JsonSerializerOptions.js"; +import type {JsonSerializerOptions} from "./JsonSerializerOptions.js"; import {Writer} from "./Writer.js"; const getCollectionType = (input: any) => { diff --git a/packages/specs/json-mapper/src/domain/JsonSerializerOptions.ts b/packages/specs/json-mapper/src/domain/JsonSerializerOptions.ts index 009773e7c6c..5ffc61f91e5 100644 --- a/packages/specs/json-mapper/src/domain/JsonSerializerOptions.ts +++ b/packages/specs/json-mapper/src/domain/JsonSerializerOptions.ts @@ -1,7 +1,7 @@ -import {MetadataTypes, Type} from "@tsed/core"; +import type {MetadataTypes, Type} from "@tsed/core"; -import {JsonMapperMethods} from "../interfaces/JsonMapperMethods.js"; -import {JsonMapperGlobalOptions} from "./JsonMapperGlobalOptions.js"; +import type {JsonMapperMethods} from "../interfaces/JsonMapperMethods.js"; +import type {JsonMapperGlobalOptions} from "./JsonMapperGlobalOptions.js"; export interface JsonSerializerOptions extends MetadataTypes, Pick { /** diff --git a/packages/specs/json-mapper/src/hooks/alterAfterDeserialize.ts b/packages/specs/json-mapper/src/hooks/alterAfterDeserialize.ts index 7237af2b0f6..9aabb62d937 100644 --- a/packages/specs/json-mapper/src/hooks/alterAfterDeserialize.ts +++ b/packages/specs/json-mapper/src/hooks/alterAfterDeserialize.ts @@ -1,4 +1,4 @@ -import {Hooks} from "@tsed/core"; +import type {Hooks} from "@tsed/core"; export function alterAfterDeserialize(data: any, schema: {$hooks: Hooks}, options: any) { return schema?.$hooks?.alter("afterDeserialize", data, [options]); diff --git a/packages/specs/json-mapper/src/hooks/alterBeforeDeserialize.ts b/packages/specs/json-mapper/src/hooks/alterBeforeDeserialize.ts index 44fdcba488d..443aee1aeb8 100644 --- a/packages/specs/json-mapper/src/hooks/alterBeforeDeserialize.ts +++ b/packages/specs/json-mapper/src/hooks/alterBeforeDeserialize.ts @@ -1,4 +1,4 @@ -import {Hooks} from "@tsed/core"; +import type {Hooks} from "@tsed/core"; export function alterBeforeDeserialize(data: any, schema: {$hooks: Hooks}, options: any) { return schema?.$hooks?.alter("beforeDeserialize", data, [options]); diff --git a/packages/specs/json-mapper/src/hooks/alterOnDeserialize.ts b/packages/specs/json-mapper/src/hooks/alterOnDeserialize.ts index 5389118261d..34ebe7b5cd2 100644 --- a/packages/specs/json-mapper/src/hooks/alterOnDeserialize.ts +++ b/packages/specs/json-mapper/src/hooks/alterOnDeserialize.ts @@ -1,4 +1,4 @@ -import {JsonHookContext, JsonSchema} from "@tsed/schema"; +import type {JsonHookContext, JsonSchema} from "@tsed/schema"; export function alterOnDeserialize(schema: JsonSchema, value: any, options: JsonHookContext) { return schema.$hooks.alter("onDeserialize", value, [options]); diff --git a/packages/specs/json-mapper/src/hooks/alterOnSerialize.ts b/packages/specs/json-mapper/src/hooks/alterOnSerialize.ts index f42db447906..dd453a8b917 100644 --- a/packages/specs/json-mapper/src/hooks/alterOnSerialize.ts +++ b/packages/specs/json-mapper/src/hooks/alterOnSerialize.ts @@ -1,4 +1,4 @@ -import {JsonHookContext, JsonSchema} from "@tsed/schema"; +import type {JsonHookContext, JsonSchema} from "@tsed/schema"; export function alterOnSerialize(schema: JsonSchema, value: any, options: JsonHookContext) { return schema.$hooks.alter("onSerialize", value, [options]); diff --git a/packages/specs/json-mapper/src/interfaces/JsonMapperMethods.ts b/packages/specs/json-mapper/src/interfaces/JsonMapperMethods.ts index 65fc095473f..ef1ce68d5bf 100644 --- a/packages/specs/json-mapper/src/interfaces/JsonMapperMethods.ts +++ b/packages/specs/json-mapper/src/interfaces/JsonMapperMethods.ts @@ -1,4 +1,4 @@ -import {Type} from "@tsed/core"; +import type {Type} from "@tsed/core"; export interface JsonMapperCtx { collectionType: Type | undefined; diff --git a/packages/specs/json-mapper/src/utils/deserialize.ts b/packages/specs/json-mapper/src/utils/deserialize.ts index 894d74c16d9..7e03a9eb1a0 100644 --- a/packages/specs/json-mapper/src/utils/deserialize.ts +++ b/packages/specs/json-mapper/src/utils/deserialize.ts @@ -3,7 +3,7 @@ import "../components/PrimitiveMapper.js"; import "../components/SymbolMapper.js"; import {JsonDeserializer} from "../domain/JsonDeserializer.js"; -import {JsonDeserializerOptions} from "../domain/JsonDeserializerOptions.js"; +import type {JsonDeserializerOptions} from "../domain/JsonDeserializerOptions.js"; const deserializer = new JsonDeserializer(); diff --git a/packages/specs/json-mapper/src/utils/serialize.ts b/packages/specs/json-mapper/src/utils/serialize.ts index c666b4c62d3..c708be225f8 100644 --- a/packages/specs/json-mapper/src/utils/serialize.ts +++ b/packages/specs/json-mapper/src/utils/serialize.ts @@ -3,7 +3,7 @@ import "../components/PrimitiveMapper.js"; import "../components/SymbolMapper.js"; import {JsonSerializer} from "../domain/JsonSerializer.js"; -import {JsonSerializerOptions} from "../domain/JsonSerializerOptions.js"; +import type {JsonSerializerOptions} from "../domain/JsonSerializerOptions.js"; const serializer = new JsonSerializer(); diff --git a/packages/specs/json-mapper/test/helpers/Post.ts b/packages/specs/json-mapper/test/helpers/Post.ts index c0d38fc5686..8748c90ca52 100644 --- a/packages/specs/json-mapper/test/helpers/Post.ts +++ b/packages/specs/json-mapper/test/helpers/Post.ts @@ -1,6 +1,6 @@ import {Property} from "@tsed/schema"; -import {User} from "./User.js"; +import type {User} from "./User.js"; export class Post { @Property() id: string; diff --git a/packages/specs/json-mapper/test/integration/date.integration.spec.ts b/packages/specs/json-mapper/test/integration/date.integration.spec.ts index add7fccae25..82e4c4bd427 100644 --- a/packages/specs/json-mapper/test/integration/date.integration.spec.ts +++ b/packages/specs/json-mapper/test/integration/date.integration.spec.ts @@ -1,7 +1,8 @@ import {isBoolean} from "@tsed/core"; import {DateFormat} from "@tsed/schema"; -import {JsonMapper, JsonMapperCtx, JsonMapperMethods, serialize} from "../../src/index.js"; +import type {JsonMapperCtx, JsonMapperMethods} from "../../src/index.js"; +import {JsonMapper, serialize} from "../../src/index.js"; @JsonMapper(Date) export class DateMapper implements JsonMapperMethods { diff --git a/packages/specs/json-mapper/test/integration/moment.integration.spec.ts b/packages/specs/json-mapper/test/integration/moment.integration.spec.ts index 58ecb2c7ed6..f3eec6fb08d 100644 --- a/packages/specs/json-mapper/test/integration/moment.integration.spec.ts +++ b/packages/specs/json-mapper/test/integration/moment.integration.spec.ts @@ -1,10 +1,11 @@ import {DateFormat} from "@tsed/schema"; -import moment, {Moment} from "moment"; +import type {Moment} from "moment"; +import moment from "moment"; import {JsonMapper} from "../../src/decorators/jsonMapper.js"; import {getJsonMapperTypes} from "../../src/domain/JsonMapperTypesContainer.js"; import {JsonSerializer} from "../../src/index.js"; -import {JsonMapperMethods} from "../../src/interfaces/JsonMapperMethods.js"; +import type {JsonMapperMethods} from "../../src/interfaces/JsonMapperMethods.js"; class MyModel { @DateFormat() diff --git a/packages/specs/json-mapper/tsconfig.esm.json b/packages/specs/json-mapper/tsconfig.esm.json index 82292550ddb..8954049da4a 100644 --- a/packages/specs/json-mapper/tsconfig.esm.json +++ b/packages/specs/json-mapper/tsconfig.esm.json @@ -2,7 +2,6 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", diff --git a/packages/specs/json-mapper/tsconfig.spec.json b/packages/specs/json-mapper/tsconfig.spec.json index 08e82f1997c..d493db24736 100644 --- a/packages/specs/json-mapper/tsconfig.spec.json +++ b/packages/specs/json-mapper/tsconfig.spec.json @@ -3,30 +3,30 @@ "compilerOptions": { "baseUrl": ".", "rootDir": "../..", - "outDir": "./lib/cjs", "declaration": false, "composite": false, "noEmit": true, "paths": { - "@tsed/openspec": ["../openspec/src"], - "@tsed/schema": ["../schema/src"], - "@tsed/di": ["../../di/src"], - "@tsed/exceptions": ["../exceptions/src"], - "@tsed/platform-exceptions": ["../../platform/platform-exceptions/src"], - "@tsed/platform-middlewares": ["../../platform/platform-middlewares/src"], - "@tsed/platform-params": ["../../platform/platform-params/src"], - "@tsed/platform-log-middleware": ["../../platform/platform-log-middleware/src"], - "@tsed/platform-response-filter": ["../../platform/platform-response-filter/src"], - "@tsed/platform-router": ["../../platform/platform-router/src"], - "@tsed/platform-views": ["../../platform/platform-views/src"], - "@tsed/components-scan": ["../../third-parties/components-scan/src"], - "@tsed/common": ["../../platform/common/src"], - "@tsed/ajv": ["../ajv/src"], - "@tsed/platform-cache": ["../../platform/platform-cache/src"], - "@tsed/swagger": ["../swagger/src"], - "@tsed/platform-test-sdk": ["../../platform/platform-test-sdk/src"], - "@tsed/platform-express": ["../../platform/platform-express/src"], - "@tsed/platform-koa": ["../../platform/platform-koa/src"] + "@tsed/openspec": ["../openspec/src/index.ts"], + "@tsed/schema": ["../schema/src/index.ts"], + "@tsed/di": ["../../di/src/index.ts"], + "@tsed/exceptions": ["../exceptions/src/index.ts"], + "@tsed/platform-exceptions": ["../../platform/platform-exceptions/src/index.ts"], + "@tsed/platform-middlewares": ["../../platform/platform-middlewares/src/index.ts"], + "@tsed/platform-params": ["../../platform/platform-params/src/index.ts"], + "@tsed/platform-log-middleware": ["../../platform/platform-log-middleware/src/index.ts"], + "@tsed/platform-response-filter": ["../../platform/platform-response-filter/src/index.ts"], + "@tsed/platform-router": ["../../platform/platform-router/src/index.ts"], + "@tsed/platform-views": ["../../platform/platform-views/src/index.ts"], + "@tsed/normalize-path": ["../../utils/normalize-path/src/index.ts"], + "@tsed/components-scan": ["../../third-parties/components-scan/src/index.ts"], + "@tsed/common": ["../../platform/common/src/index.ts"], + "@tsed/ajv": ["../ajv/src/index.ts"], + "@tsed/platform-cache": ["../../platform/platform-cache/src/index.ts"], + "@tsed/swagger": ["../swagger/src/index.ts"], + "@tsed/platform-test-sdk": ["../../platform/platform-test-sdk/src/index.ts"], + "@tsed/platform-express": ["../../platform/platform-express/src/index.ts"], + "@tsed/platform-koa": ["../../platform/platform-koa/src/index.ts"] }, "types": ["vite/client", "vitest/globals"] }, diff --git a/packages/specs/openspec/package.json b/packages/specs/openspec/package.json index 123e786f997..543b8b1132d 100644 --- a/packages/specs/openspec/package.json +++ b/packages/specs/openspec/package.json @@ -11,7 +11,7 @@ ".": { "types": "./lib/types/index.d.ts", "import": "./lib/esm/index.js", - "default": "./lib/cjs/index.js" + "default": "./lib/esm/index.js" } }, "scripts": { diff --git a/packages/specs/openspec/src/common/OpenSpecJsonSchema.ts b/packages/specs/openspec/src/common/OpenSpecJsonSchema.ts index e45deac9a8d..822e19e2dc6 100644 --- a/packages/specs/openspec/src/common/OpenSpecJsonSchema.ts +++ b/packages/specs/openspec/src/common/OpenSpecJsonSchema.ts @@ -1,6 +1,6 @@ -import {OpenSpecHash} from "./OpenSpecHash.js"; -import {OpenSpecRef} from "./OpenSpecRef.js"; -import {OpenSpecTypes} from "./OpenSpecTypes.js"; +import type {OpenSpecHash} from "./OpenSpecHash.js"; +import type {OpenSpecRef} from "./OpenSpecRef.js"; +import type {OpenSpecTypes} from "./OpenSpecTypes.js"; export interface OpenSpecBaseJsonSchema { $ref?: string; diff --git a/packages/specs/openspec/src/common/OpenSpecSecurity.ts b/packages/specs/openspec/src/common/OpenSpecSecurity.ts index 0f26e2513a0..9aab2f49e85 100644 --- a/packages/specs/openspec/src/common/OpenSpecSecurity.ts +++ b/packages/specs/openspec/src/common/OpenSpecSecurity.ts @@ -1,3 +1,3 @@ -import {OpenSpecHash} from "./OpenSpecHash.js"; +import type {OpenSpecHash} from "./OpenSpecHash.js"; export type OpenSpecSecurity = OpenSpecHash[]; diff --git a/packages/specs/openspec/src/common/OpenSpecTag.ts b/packages/specs/openspec/src/common/OpenSpecTag.ts index b7209b327d9..49cfa92028f 100644 --- a/packages/specs/openspec/src/common/OpenSpecTag.ts +++ b/packages/specs/openspec/src/common/OpenSpecTag.ts @@ -1,4 +1,4 @@ -import {OpenSpecExternalDocs} from "./OpenSpecExternalDocs.js"; +import type {OpenSpecExternalDocs} from "./OpenSpecExternalDocs.js"; export interface OpenSpecTag { name: string; diff --git a/packages/specs/openspec/src/openspec2/OS2Header.ts b/packages/specs/openspec/src/openspec2/OS2Header.ts index 9c6f0a560f7..b26fa7e46bd 100644 --- a/packages/specs/openspec/src/openspec2/OS2Header.ts +++ b/packages/specs/openspec/src/openspec2/OS2Header.ts @@ -1,4 +1,4 @@ -import {OS2BaseSchema} from "./OS2Schema.js"; +import type {OS2BaseSchema} from "./OS2Schema.js"; export interface OS2Header extends OS2BaseSchema { /** diff --git a/packages/specs/openspec/src/openspec2/OS2Operation.ts b/packages/specs/openspec/src/openspec2/OS2Operation.ts index e762ca2854d..b2d00ed22f4 100644 --- a/packages/specs/openspec/src/openspec2/OS2Operation.ts +++ b/packages/specs/openspec/src/openspec2/OS2Operation.ts @@ -1,9 +1,9 @@ -import {OpenSpecExternalDocs} from "../common/OpenSpecExternalDocs.js"; -import {OpenSpecHash} from "../common/OpenSpecHash.js"; -import {OpenSpecRef} from "../common/OpenSpecRef.js"; -import {OpenSpecSecurity} from "../common/OpenSpecSecurity.js"; -import {OS2Parameter} from "./OS2Parameter.js"; -import {OS2Response} from "./OS2Response.js"; +import type {OpenSpecExternalDocs} from "../common/OpenSpecExternalDocs.js"; +import type {OpenSpecHash} from "../common/OpenSpecHash.js"; +import type {OpenSpecRef} from "../common/OpenSpecRef.js"; +import type {OpenSpecSecurity} from "../common/OpenSpecSecurity.js"; +import type {OS2Parameter} from "./OS2Parameter.js"; +import type {OS2Response} from "./OS2Response.js"; export interface OS2Operation { /** diff --git a/packages/specs/openspec/src/openspec2/OS2Parameter.ts b/packages/specs/openspec/src/openspec2/OS2Parameter.ts index 7ad9c778d7d..b3bd19c1125 100644 --- a/packages/specs/openspec/src/openspec2/OS2Parameter.ts +++ b/packages/specs/openspec/src/openspec2/OS2Parameter.ts @@ -1,5 +1,5 @@ -import {OpenSpecTypes} from "../common/OpenSpecTypes.js"; -import {OS2BaseSchema, OS2Schema} from "./OS2Schema.js"; +import type {OpenSpecTypes} from "../common/OpenSpecTypes.js"; +import type {OS2BaseSchema, OS2Schema} from "./OS2Schema.js"; export type OS2BaseParameter = { name: string; diff --git a/packages/specs/openspec/src/openspec2/OS2Paths.ts b/packages/specs/openspec/src/openspec2/OS2Paths.ts index 15630d95acc..685c35b8090 100644 --- a/packages/specs/openspec/src/openspec2/OS2Paths.ts +++ b/packages/specs/openspec/src/openspec2/OS2Paths.ts @@ -1,7 +1,7 @@ -import {OpenSpecPath} from "../common/OpenSpecPath.js"; -import {OpenSpecRef} from "../common/OpenSpecRef.js"; -import {OS2Operation} from "./OS2Operation.js"; -import {OS2Parameter} from "./OS2Parameter.js"; +import type {OpenSpecPath} from "../common/OpenSpecPath.js"; +import type {OpenSpecRef} from "../common/OpenSpecRef.js"; +import type {OS2Operation} from "./OS2Operation.js"; +import type {OS2Parameter} from "./OS2Parameter.js"; export interface OS2Paths extends OpenSpecPath { parameters?: (OS2Parameter | OpenSpecRef)[]; diff --git a/packages/specs/openspec/src/openspec2/OS2Response.ts b/packages/specs/openspec/src/openspec2/OS2Response.ts index 735641981bb..4a1d6f5cdbf 100644 --- a/packages/specs/openspec/src/openspec2/OS2Response.ts +++ b/packages/specs/openspec/src/openspec2/OS2Response.ts @@ -1,6 +1,6 @@ -import {OpenSpecHash} from "../common/OpenSpecHash.js"; -import {OS2Header} from "./OS2Header.js"; -import {OS2Schema} from "./OS2Schema.js"; +import type {OpenSpecHash} from "../common/OpenSpecHash.js"; +import type {OS2Header} from "./OS2Header.js"; +import type {OS2Schema} from "./OS2Schema.js"; export interface OS2Response { /** diff --git a/packages/specs/openspec/src/openspec2/OS2Schema.ts b/packages/specs/openspec/src/openspec2/OS2Schema.ts index a507b2dd4b5..9d7ea923ecc 100644 --- a/packages/specs/openspec/src/openspec2/OS2Schema.ts +++ b/packages/specs/openspec/src/openspec2/OS2Schema.ts @@ -1,7 +1,7 @@ -import {OpenSpecExternalDocs} from "../common/OpenSpecExternalDocs.js"; -import {OpenSpecBaseJsonSchema, OpenSpecJsonSchema} from "../common/OpenSpecJsonSchema.js"; -import {OpenSpecRef} from "../common/OpenSpecRef.js"; -import {OpenSpecXML} from "../common/OpenSpecXML.js"; +import type {OpenSpecExternalDocs} from "../common/OpenSpecExternalDocs.js"; +import type {OpenSpecBaseJsonSchema, OpenSpecJsonSchema} from "../common/OpenSpecJsonSchema.js"; +import type {OpenSpecRef} from "../common/OpenSpecRef.js"; +import type {OpenSpecXML} from "../common/OpenSpecXML.js"; export interface OS2XML { name?: string; diff --git a/packages/specs/openspec/src/openspec2/OS2Security.ts b/packages/specs/openspec/src/openspec2/OS2Security.ts index 9271002b866..63503711b46 100644 --- a/packages/specs/openspec/src/openspec2/OS2Security.ts +++ b/packages/specs/openspec/src/openspec2/OS2Security.ts @@ -1,4 +1,4 @@ -import {OpenSpecHash} from "../common/OpenSpecHash.js"; +import type {OpenSpecHash} from "../common/OpenSpecHash.js"; export interface OS2SecurityBase { /** diff --git a/packages/specs/openspec/src/openspec2/OpenSpec2.ts b/packages/specs/openspec/src/openspec2/OpenSpec2.ts index 3cc9d900f00..554b12ddd77 100644 --- a/packages/specs/openspec/src/openspec2/OpenSpec2.ts +++ b/packages/specs/openspec/src/openspec2/OpenSpec2.ts @@ -1,13 +1,13 @@ -import {OpenSpecExternalDocs} from "../common/OpenSpecExternalDocs.js"; -import {OpenSpecHash} from "../common/OpenSpecHash.js"; -import {OpenSpecInfo} from "../common/OpenSpecInfo.js"; -import {OpenSpecSecurity} from "../common/OpenSpecSecurity.js"; -import {OpenSpecTag} from "../common/OpenSpecTag.js"; -import {OS2BodyParameter, OS2QueryParameter} from "./OS2Parameter.js"; -import {OS2Paths} from "./OS2Paths.js"; -import {OS2Response} from "./OS2Response.js"; -import {OS2Schema} from "./OS2Schema.js"; -import {OS2Security} from "./OS2Security.js"; +import type {OpenSpecExternalDocs} from "../common/OpenSpecExternalDocs.js"; +import type {OpenSpecHash} from "../common/OpenSpecHash.js"; +import type {OpenSpecInfo} from "../common/OpenSpecInfo.js"; +import type {OpenSpecSecurity} from "../common/OpenSpecSecurity.js"; +import type {OpenSpecTag} from "../common/OpenSpecTag.js"; +import type {OS2BodyParameter, OS2QueryParameter} from "./OS2Parameter.js"; +import type {OS2Paths} from "./OS2Paths.js"; +import type {OS2Response} from "./OS2Response.js"; +import type {OS2Schema} from "./OS2Schema.js"; +import type {OS2Security} from "./OS2Security.js"; export interface OpenSpec2 { /** diff --git a/packages/specs/openspec/src/openspec3/OS3Callbacks.ts b/packages/specs/openspec/src/openspec3/OS3Callbacks.ts index 7e2ccbe2ae2..97040a56ede 100644 --- a/packages/specs/openspec/src/openspec3/OS3Callbacks.ts +++ b/packages/specs/openspec/src/openspec3/OS3Callbacks.ts @@ -1,5 +1,5 @@ -import {OpenSpecHash} from "../common/OpenSpecHash.js"; -import {OS3Paths} from "./OS3Paths.js"; -import {OS3Schema} from "./OS3Schema.js"; +import type {OpenSpecHash} from "../common/OpenSpecHash.js"; +import type {OS3Paths} from "./OS3Paths.js"; +import type {OS3Schema} from "./OS3Schema.js"; export type OS3Callbacks = OpenSpecHash>>; diff --git a/packages/specs/openspec/src/openspec3/OS3Components.ts b/packages/specs/openspec/src/openspec3/OS3Components.ts index f1f9af0ced1..9048e6c140c 100644 --- a/packages/specs/openspec/src/openspec3/OS3Components.ts +++ b/packages/specs/openspec/src/openspec3/OS3Components.ts @@ -1,13 +1,13 @@ -import {OpenSpecHash} from "../common/OpenSpecHash.js"; -import {OS3Callbacks} from "./OS3Callbacks.js"; -import {OS3Example} from "./OS3Example.js"; -import {OS3Header} from "./OS3Header.js"; -import {OS3Link} from "./OS3Link.js"; -import {OS3Parameter} from "./OS3Parameter.js"; -import {OS3RequestBody} from "./OS3RequestBody.js"; -import {OS3Response} from "./OS3Response.js"; -import {OS3Schema} from "./OS3Schema.js"; -import {OS3Security} from "./OS3Security.js"; +import type {OpenSpecHash} from "../common/OpenSpecHash.js"; +import type {OS3Callbacks} from "./OS3Callbacks.js"; +import type {OS3Example} from "./OS3Example.js"; +import type {OS3Header} from "./OS3Header.js"; +import type {OS3Link} from "./OS3Link.js"; +import type {OS3Parameter} from "./OS3Parameter.js"; +import type {OS3RequestBody} from "./OS3RequestBody.js"; +import type {OS3Response} from "./OS3Response.js"; +import type {OS3Schema} from "./OS3Schema.js"; +import type {OS3Security} from "./OS3Security.js"; export interface OS3Components { /** diff --git a/packages/specs/openspec/src/openspec3/OS3Encoding.ts b/packages/specs/openspec/src/openspec3/OS3Encoding.ts index 3c4f935629a..97b54c889c1 100644 --- a/packages/specs/openspec/src/openspec3/OS3Encoding.ts +++ b/packages/specs/openspec/src/openspec3/OS3Encoding.ts @@ -1,5 +1,5 @@ -import {OpenSpecHash} from "../common/OpenSpecHash.js"; -import {OS3Header} from "./OS3Header.js"; +import type {OpenSpecHash} from "../common/OpenSpecHash.js"; +import type {OS3Header} from "./OS3Header.js"; export interface OS3Encoding { /** diff --git a/packages/specs/openspec/src/openspec3/OS3Header.ts b/packages/specs/openspec/src/openspec3/OS3Header.ts index c3aaee194ae..db491a8cc8c 100644 --- a/packages/specs/openspec/src/openspec3/OS3Header.ts +++ b/packages/specs/openspec/src/openspec3/OS3Header.ts @@ -1,6 +1,6 @@ -import {OpenSpecExternalDocs} from "../common/OpenSpecExternalDocs.js"; -import {OpenSpecRef} from "../common/OpenSpecRef.js"; -import {OS3Schema} from "./OS3Schema.js"; +import type {OpenSpecExternalDocs} from "../common/OpenSpecExternalDocs.js"; +import type {OpenSpecRef} from "../common/OpenSpecRef.js"; +import type {OS3Schema} from "./OS3Schema.js"; export interface OS3Header { /** diff --git a/packages/specs/openspec/src/openspec3/OS3Link.ts b/packages/specs/openspec/src/openspec3/OS3Link.ts index c8c85a84a65..3bd249f2602 100644 --- a/packages/specs/openspec/src/openspec3/OS3Link.ts +++ b/packages/specs/openspec/src/openspec3/OS3Link.ts @@ -1,5 +1,5 @@ -import {OpenSpecHash} from "../common/OpenSpecHash.js"; -import {OS3Server} from "./OS3Server.js"; +import type {OpenSpecHash} from "../common/OpenSpecHash.js"; +import type {OS3Server} from "./OS3Server.js"; export interface OS3Link { /** diff --git a/packages/specs/openspec/src/openspec3/OS3MediaType.ts b/packages/specs/openspec/src/openspec3/OS3MediaType.ts index 3b97c3408c7..d09799095d3 100644 --- a/packages/specs/openspec/src/openspec3/OS3MediaType.ts +++ b/packages/specs/openspec/src/openspec3/OS3MediaType.ts @@ -1,8 +1,8 @@ -import {OpenSpecHash} from "../common/OpenSpecHash.js"; -import {OpenSpecRef} from "../common/OpenSpecRef.js"; -import {OS3Encoding} from "./OS3Encoding.js"; -import {OS3Example} from "./OS3Example.js"; -import {OS3Schema} from "./OS3Schema.js"; +import type {OpenSpecHash} from "../common/OpenSpecHash.js"; +import type {OpenSpecRef} from "../common/OpenSpecRef.js"; +import type {OS3Encoding} from "./OS3Encoding.js"; +import type {OS3Example} from "./OS3Example.js"; +import type {OS3Schema} from "./OS3Schema.js"; export interface OS3MediaType { /** diff --git a/packages/specs/openspec/src/openspec3/OS3Operation.ts b/packages/specs/openspec/src/openspec3/OS3Operation.ts index 4608be35564..7509ebc7dc4 100644 --- a/packages/specs/openspec/src/openspec3/OS3Operation.ts +++ b/packages/specs/openspec/src/openspec3/OS3Operation.ts @@ -1,12 +1,12 @@ -import {OpenSpecExternalDocs} from "../common/OpenSpecExternalDocs.js"; -import {OpenSpecHash} from "../common/OpenSpecHash.js"; -import {OpenSpecSecurity} from "../common/OpenSpecSecurity.js"; -import {OS3Callbacks} from "./OS3Callbacks.js"; -import {OS3Parameter} from "./OS3Parameter.js"; -import {OS3RequestBody} from "./OS3RequestBody.js"; -import {OS3Response} from "./OS3Response.js"; -import {OS3Schema} from "./OS3Schema.js"; -import {OS3Server} from "./OS3Server.js"; +import type {OpenSpecExternalDocs} from "../common/OpenSpecExternalDocs.js"; +import type {OpenSpecHash} from "../common/OpenSpecHash.js"; +import type {OpenSpecSecurity} from "../common/OpenSpecSecurity.js"; +import type {OS3Callbacks} from "./OS3Callbacks.js"; +import type {OS3Parameter} from "./OS3Parameter.js"; +import type {OS3RequestBody} from "./OS3RequestBody.js"; +import type {OS3Response} from "./OS3Response.js"; +import type {OS3Schema} from "./OS3Schema.js"; +import type {OS3Server} from "./OS3Server.js"; export interface OS3Operation, Response = OpenSpecHash>> { /** diff --git a/packages/specs/openspec/src/openspec3/OS3Parameter.ts b/packages/specs/openspec/src/openspec3/OS3Parameter.ts index 28cc19e382d..6f9bc0e7c63 100644 --- a/packages/specs/openspec/src/openspec3/OS3Parameter.ts +++ b/packages/specs/openspec/src/openspec3/OS3Parameter.ts @@ -1,8 +1,8 @@ -import {OpenSpecHash} from "../common/OpenSpecHash.js"; -import {OpenSpecRef} from "../common/OpenSpecRef.js"; -import {OS3Example} from "./OS3Example.js"; -import {OS3MediaType} from "./OS3MediaType.js"; -import {OS3Schema} from "./OS3Schema.js"; +import type {OpenSpecHash} from "../common/OpenSpecHash.js"; +import type {OpenSpecRef} from "../common/OpenSpecRef.js"; +import type {OS3Example} from "./OS3Example.js"; +import type {OS3MediaType} from "./OS3MediaType.js"; +import type {OS3Schema} from "./OS3Schema.js"; export type OS3StyleParameter = "matrix" | "label" | "form" | "simple" | "spaceDelimited" | "pipeDelimited" | "deepObject"; diff --git a/packages/specs/openspec/src/openspec3/OS3Paths.ts b/packages/specs/openspec/src/openspec3/OS3Paths.ts index 036fc6564d8..9ad8a70dbdd 100644 --- a/packages/specs/openspec/src/openspec3/OS3Paths.ts +++ b/packages/specs/openspec/src/openspec3/OS3Paths.ts @@ -1,9 +1,9 @@ -import {OpenSpecPath} from "../common/OpenSpecPath.js"; -import {OpenSpecRef} from "../common/OpenSpecRef.js"; -import {OS3Operation} from "./OS3Operation.js"; -import {OS3Parameter} from "./OS3Parameter.js"; -import {OS3Schema} from "./OS3Schema.js"; -import {OS3Server} from "./OS3Server.js"; +import type {OpenSpecPath} from "../common/OpenSpecPath.js"; +import type {OpenSpecRef} from "../common/OpenSpecRef.js"; +import type {OS3Operation} from "./OS3Operation.js"; +import type {OS3Parameter} from "./OS3Parameter.js"; +import type {OS3Schema} from "./OS3Schema.js"; +import type {OS3Server} from "./OS3Server.js"; export interface OS3Paths extends OpenSpecPath> { /** diff --git a/packages/specs/openspec/src/openspec3/OS3RequestBody.ts b/packages/specs/openspec/src/openspec3/OS3RequestBody.ts index 38e3ebd60be..0af3ee53bd7 100644 --- a/packages/specs/openspec/src/openspec3/OS3RequestBody.ts +++ b/packages/specs/openspec/src/openspec3/OS3RequestBody.ts @@ -1,8 +1,8 @@ -import {OpenSpecHash} from "../common/OpenSpecHash.js"; -import {OpenSpecRef} from "../common/OpenSpecRef.js"; -import {OS3Example} from "./OS3Example.js"; -import {OS3MediaType} from "./OS3MediaType.js"; -import {OS3Schema} from "./OS3Schema.js"; +import type {OpenSpecHash} from "../common/OpenSpecHash.js"; +import type {OpenSpecRef} from "../common/OpenSpecRef.js"; +import type {OS3Example} from "./OS3Example.js"; +import type {OS3MediaType} from "./OS3MediaType.js"; +import type {OS3Schema} from "./OS3Schema.js"; export interface OS3RequestBody { /** diff --git a/packages/specs/openspec/src/openspec3/OS3Response.ts b/packages/specs/openspec/src/openspec3/OS3Response.ts index 7d963c9c894..6a89bbeb23b 100644 --- a/packages/specs/openspec/src/openspec3/OS3Response.ts +++ b/packages/specs/openspec/src/openspec3/OS3Response.ts @@ -1,9 +1,9 @@ -import {OpenSpecHash} from "../common/OpenSpecHash.js"; -import {OpenSpecRef} from "../common/OpenSpecRef.js"; -import {OS3Header} from "./OS3Header.js"; -import {OS3Link} from "./OS3Link.js"; -import {OS3MediaType} from "./OS3MediaType.js"; -import {OS3Schema} from "./OS3Schema.js"; +import type {OpenSpecHash} from "../common/OpenSpecHash.js"; +import type {OpenSpecRef} from "../common/OpenSpecRef.js"; +import type {OS3Header} from "./OS3Header.js"; +import type {OS3Link} from "./OS3Link.js"; +import type {OS3MediaType} from "./OS3MediaType.js"; +import type {OS3Schema} from "./OS3Schema.js"; export interface OS3Response> { /** diff --git a/packages/specs/openspec/src/openspec3/OS3Schema.ts b/packages/specs/openspec/src/openspec3/OS3Schema.ts index 101f7275e6b..72a5fa169aa 100644 --- a/packages/specs/openspec/src/openspec3/OS3Schema.ts +++ b/packages/specs/openspec/src/openspec3/OS3Schema.ts @@ -1,7 +1,7 @@ -import {OpenSpecExternalDocs} from "../common/OpenSpecExternalDocs.js"; -import {OpenSpecBaseJsonSchema, OpenSpecJsonSchema} from "../common/OpenSpecJsonSchema.js"; -import {OpenSpecRef} from "../common/OpenSpecRef.js"; -import {OpenSpecXML} from "../common/OpenSpecXML.js"; +import type {OpenSpecExternalDocs} from "../common/OpenSpecExternalDocs.js"; +import type {OpenSpecBaseJsonSchema, OpenSpecJsonSchema} from "../common/OpenSpecJsonSchema.js"; +import type {OpenSpecRef} from "../common/OpenSpecRef.js"; +import type {OpenSpecXML} from "../common/OpenSpecXML.js"; export interface OS3BaseSchema extends OpenSpecBaseJsonSchema { /** diff --git a/packages/specs/openspec/src/openspec3/OS3Security.ts b/packages/specs/openspec/src/openspec3/OS3Security.ts index a5259bd26ef..9ab36b45ac2 100644 --- a/packages/specs/openspec/src/openspec3/OS3Security.ts +++ b/packages/specs/openspec/src/openspec3/OS3Security.ts @@ -1,4 +1,4 @@ -import {OS3Flows} from "./OS3Flows.js"; +import type {OS3Flows} from "./OS3Flows.js"; export interface OS3SecurityBase { /** diff --git a/packages/specs/openspec/src/openspec3/OS3Server.ts b/packages/specs/openspec/src/openspec3/OS3Server.ts index 39c2962ade7..346b26535d4 100644 --- a/packages/specs/openspec/src/openspec3/OS3Server.ts +++ b/packages/specs/openspec/src/openspec3/OS3Server.ts @@ -1,4 +1,4 @@ -import {OpenSpecHash} from "../common/OpenSpecHash.js"; +import type {OpenSpecHash} from "../common/OpenSpecHash.js"; export interface OpenSpecServerVariable { /** diff --git a/packages/specs/openspec/src/openspec3/OpenSpec3.ts b/packages/specs/openspec/src/openspec3/OpenSpec3.ts index 4fa3336e47c..8c6a9dca7fe 100644 --- a/packages/specs/openspec/src/openspec3/OpenSpec3.ts +++ b/packages/specs/openspec/src/openspec3/OpenSpec3.ts @@ -1,12 +1,12 @@ -import {OpenSpecExternalDocs} from "../common/OpenSpecExternalDocs.js"; -import {OpenSpecHash} from "../common/OpenSpecHash.js"; -import {OpenSpecInfo} from "../common/OpenSpecInfo.js"; -import {OpenSpecSecurity} from "../common/OpenSpecSecurity.js"; -import {OpenSpecTag} from "../common/OpenSpecTag.js"; -import {OS3Components} from "./OS3Components.js"; -import {OS3Paths} from "./OS3Paths.js"; -import {OS3Schema} from "./OS3Schema.js"; -import {OS3Server} from "./OS3Server.js"; +import type {OpenSpecExternalDocs} from "../common/OpenSpecExternalDocs.js"; +import type {OpenSpecHash} from "../common/OpenSpecHash.js"; +import type {OpenSpecInfo} from "../common/OpenSpecInfo.js"; +import type {OpenSpecSecurity} from "../common/OpenSpecSecurity.js"; +import type {OpenSpecTag} from "../common/OpenSpecTag.js"; +import type {OS3Components} from "./OS3Components.js"; +import type {OS3Paths} from "./OS3Paths.js"; +import type {OS3Schema} from "./OS3Schema.js"; +import type {OS3Server} from "./OS3Server.js"; export interface OpenSpec3 { /** diff --git a/packages/specs/openspec/tsconfig.esm.json b/packages/specs/openspec/tsconfig.esm.json index 82292550ddb..8954049da4a 100644 --- a/packages/specs/openspec/tsconfig.esm.json +++ b/packages/specs/openspec/tsconfig.esm.json @@ -2,7 +2,6 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", diff --git a/packages/specs/schema/package.json b/packages/specs/schema/package.json index 512c362a763..0636e358d3c 100644 --- a/packages/specs/schema/package.json +++ b/packages/specs/schema/package.json @@ -13,11 +13,11 @@ "types": "./lib/types/index.d.ts", "browser": "./lib/browser/schema.umd.min.js", "import": "./lib/esm/index.js", - "default": "./lib/cjs/index.js" + "default": "./lib/esm/index.js" } }, "scripts": { - "clean": "rm -rf lib", + "clean": "rm -rf lib tsconfig.spec.buildinfo", "build": "yarn clean && yarn barrels && yarn build:ts && yarn run build:browser", "build:browser": "webpack", "barrels": "barrels", diff --git a/packages/specs/schema/src/components/async-api/channelsMapper.ts b/packages/specs/schema/src/components/async-api/channelsMapper.ts index 007ffec8cd3..05ba2462325 100644 --- a/packages/specs/schema/src/components/async-api/channelsMapper.ts +++ b/packages/specs/schema/src/components/async-api/channelsMapper.ts @@ -1,9 +1,9 @@ import {camelCase} from "change-case"; import {OperationVerbs} from "../../constants/OperationVerbs.js"; -import {JsonMethodStore} from "../../domain/JsonMethodStore.js"; -import {JsonMethodPath} from "../../domain/JsonOperation.js"; -import {JsonSchemaOptions} from "../../interfaces/JsonSchemaOptions.js"; +import type {JsonMethodStore} from "../../domain/JsonMethodStore.js"; +import type {JsonMethodPath} from "../../domain/JsonOperation.js"; +import type {JsonSchemaOptions} from "../../interfaces/JsonSchemaOptions.js"; import {execMapper, registerJsonSchemaMapper} from "../../registries/JsonSchemaMapperContainer.js"; import {buildPath} from "../../utils/buildPath.js"; import {getJsonEntityStore} from "../../utils/getJsonEntityStore.js"; diff --git a/packages/specs/schema/src/components/async-api/generate.ts b/packages/specs/schema/src/components/async-api/generate.ts index 002cff06f1d..777c2e7e538 100644 --- a/packages/specs/schema/src/components/async-api/generate.ts +++ b/packages/specs/schema/src/components/async-api/generate.ts @@ -1,8 +1,9 @@ -import {getValue, Type, uniqBy} from "@tsed/core"; +import type {Type} from "@tsed/core"; +import {getValue, uniqBy} from "@tsed/core"; import {SpecTypes} from "../../domain/SpecTypes.js"; import {execMapper, registerJsonSchemaMapper} from "../../registries/JsonSchemaMapperContainer.js"; -import {SpecSerializerOptions} from "../../utils/getSpec.js"; +import type {SpecSerializerOptions} from "../../utils/getSpec.js"; function generate(model: Type, options: SpecSerializerOptions) { const specJson: any = { diff --git a/packages/specs/schema/src/components/async-api/messageMapper.ts b/packages/specs/schema/src/components/async-api/messageMapper.ts index 2d9b742a124..4148ee8b05b 100644 --- a/packages/specs/schema/src/components/async-api/messageMapper.ts +++ b/packages/specs/schema/src/components/async-api/messageMapper.ts @@ -1,10 +1,10 @@ import {cleanObject, getValue} from "@tsed/core"; import {OperationVerbs} from "../../constants/OperationVerbs.js"; -import {JsonMethodStore} from "../../domain/JsonMethodStore.js"; -import {JsonMethodPath} from "../../domain/JsonOperation.js"; +import type {JsonMethodStore} from "../../domain/JsonMethodStore.js"; +import type {JsonMethodPath} from "../../domain/JsonOperation.js"; import {SpecTypes} from "../../domain/SpecTypes.js"; -import {JsonSchemaOptions} from "../../interfaces/JsonSchemaOptions.js"; +import type {JsonSchemaOptions} from "../../interfaces/JsonSchemaOptions.js"; import {execMapper, registerJsonSchemaMapper} from "../../registries/JsonSchemaMapperContainer.js"; import {makeOf} from "../../utils/somethingOf.js"; diff --git a/packages/specs/schema/src/components/async-api/payloadMapper.ts b/packages/specs/schema/src/components/async-api/payloadMapper.ts index 61a6bba8d3c..7b7ae289d04 100644 --- a/packages/specs/schema/src/components/async-api/payloadMapper.ts +++ b/packages/specs/schema/src/components/async-api/payloadMapper.ts @@ -1,12 +1,12 @@ import {setValue} from "@tsed/core"; import {pascalCase} from "change-case"; -import {JsonMethodStore} from "../../domain/JsonMethodStore.js"; -import {JsonMethodPath, JsonOperation} from "../../domain/JsonOperation.js"; -import {JsonParameter} from "../../domain/JsonParameter.js"; +import type {JsonMethodStore} from "../../domain/JsonMethodStore.js"; +import type {JsonMethodPath, JsonOperation} from "../../domain/JsonOperation.js"; +import type {JsonParameter} from "../../domain/JsonParameter.js"; import {isParameterType, JsonParameterTypes} from "../../domain/JsonParameterTypes.js"; import {SpecTypes} from "../../domain/SpecTypes.js"; -import {JsonSchemaOptions} from "../../interfaces/JsonSchemaOptions.js"; +import type {JsonSchemaOptions} from "../../interfaces/JsonSchemaOptions.js"; import {execMapper, registerJsonSchemaMapper} from "../../registries/JsonSchemaMapperContainer.js"; import {popGenerics} from "../../utils/generics.js"; import {makeOf} from "../../utils/somethingOf.js"; diff --git a/packages/specs/schema/src/components/async-api/responseMapper.ts b/packages/specs/schema/src/components/async-api/responseMapper.ts index d4073ec3369..deebfa68908 100644 --- a/packages/specs/schema/src/components/async-api/responseMapper.ts +++ b/packages/specs/schema/src/components/async-api/responseMapper.ts @@ -1,10 +1,10 @@ import {setValue} from "@tsed/core"; import {pascalCase} from "change-case"; -import {JsonMethodStore} from "../../domain/JsonMethodStore.js"; -import {JsonMethodPath} from "../../domain/JsonOperation.js"; +import type {JsonMethodStore} from "../../domain/JsonMethodStore.js"; +import type {JsonMethodPath} from "../../domain/JsonOperation.js"; import {SpecTypes} from "../../domain/SpecTypes.js"; -import {JsonSchemaOptions} from "../../interfaces/JsonSchemaOptions.js"; +import type {JsonSchemaOptions} from "../../interfaces/JsonSchemaOptions.js"; import {execMapper, registerJsonSchemaMapper} from "../../registries/JsonSchemaMapperContainer.js"; import {makeOf} from "../../utils/somethingOf.js"; diff --git a/packages/specs/schema/src/components/default/anyMapper.ts b/packages/specs/schema/src/components/default/anyMapper.ts index d17591f2df9..d6f92edcc8c 100644 --- a/packages/specs/schema/src/components/default/anyMapper.ts +++ b/packages/specs/schema/src/components/default/anyMapper.ts @@ -1,6 +1,6 @@ import {JsonLazyRef} from "../../domain/JsonLazyRef.js"; import {JsonSchema} from "../../domain/JsonSchema.js"; -import {JsonSchemaOptions} from "../../interfaces/JsonSchemaOptions.js"; +import type {JsonSchemaOptions} from "../../interfaces/JsonSchemaOptions.js"; import {execMapper, oneOfMapper, registerJsonSchemaMapper} from "../../registries/JsonSchemaMapperContainer.js"; import {mapGenericsOptions} from "../../utils/generics.js"; import {toRef} from "../../utils/ref.js"; diff --git a/packages/specs/schema/src/components/default/classMapper.ts b/packages/specs/schema/src/components/default/classMapper.ts index e8c93892b6a..36168239858 100644 --- a/packages/specs/schema/src/components/default/classMapper.ts +++ b/packages/specs/schema/src/components/default/classMapper.ts @@ -1,8 +1,8 @@ import {getValue, setValue} from "@tsed/core"; import {JsonEntityStore} from "../../domain/JsonEntityStore.js"; -import {JsonSchema} from "../../domain/JsonSchema.js"; -import {JsonSchemaOptions} from "../../interfaces/JsonSchemaOptions.js"; +import type {JsonSchema} from "../../domain/JsonSchema.js"; +import type {JsonSchemaOptions} from "../../interfaces/JsonSchemaOptions.js"; import {execMapper, registerJsonSchemaMapper} from "../../registries/JsonSchemaMapperContainer.js"; import {mapGenericsOptions, popGenerics} from "../../utils/generics.js"; import {createRef, createRefName} from "../../utils/ref.js"; diff --git a/packages/specs/schema/src/components/default/genericsMapper.ts b/packages/specs/schema/src/components/default/genericsMapper.ts index 14c38511b90..0e5f4637b4e 100644 --- a/packages/specs/schema/src/components/default/genericsMapper.ts +++ b/packages/specs/schema/src/components/default/genericsMapper.ts @@ -2,7 +2,8 @@ import {isClass, isPrimitiveClass} from "@tsed/core"; import {JsonEntityStore} from "../../domain/JsonEntityStore.js"; import {execMapper, registerJsonSchemaMapper} from "../../registries/JsonSchemaMapperContainer.js"; -import {GenericsContext, popGenerics} from "../../utils/generics.js"; +import type {GenericsContext} from "../../utils/generics.js"; +import {popGenerics} from "../../utils/generics.js"; import {getJsonType} from "../../utils/getJsonType.js"; /** diff --git a/packages/specs/schema/src/components/default/inheritedClassMapper.ts b/packages/specs/schema/src/components/default/inheritedClassMapper.ts index 2d82b72ed63..e069bd07988 100644 --- a/packages/specs/schema/src/components/default/inheritedClassMapper.ts +++ b/packages/specs/schema/src/components/default/inheritedClassMapper.ts @@ -1,6 +1,6 @@ import {classOf, deepMerge} from "@tsed/core"; -import {JsonSchemaOptions} from "../../interfaces/JsonSchemaOptions.js"; +import type {JsonSchemaOptions} from "../../interfaces/JsonSchemaOptions.js"; import {execMapper, registerJsonSchemaMapper} from "../../registries/JsonSchemaMapperContainer.js"; import {getInheritedStores} from "../../utils/getInheritedStores.js"; diff --git a/packages/specs/schema/src/components/default/inlineEnumsMapper.ts b/packages/specs/schema/src/components/default/inlineEnumsMapper.ts index c3813303497..ece2ed56287 100644 --- a/packages/specs/schema/src/components/default/inlineEnumsMapper.ts +++ b/packages/specs/schema/src/components/default/inlineEnumsMapper.ts @@ -1,5 +1,5 @@ -import {JsonSchema} from "../../domain/JsonSchema.js"; -import {JsonSchemaOptions} from "../../interfaces/JsonSchemaOptions.js"; +import type {JsonSchema} from "../../domain/JsonSchema.js"; +import type {JsonSchemaOptions} from "../../interfaces/JsonSchemaOptions.js"; import {registerJsonSchemaMapper} from "../../registries/JsonSchemaMapperContainer.js"; export function inlineEnumsMapper(obj: any, schema: JsonSchema, options: JsonSchemaOptions) { diff --git a/packages/specs/schema/src/components/default/itemMapper.ts b/packages/specs/schema/src/components/default/itemMapper.ts index a2bdaba7480..ca583307c58 100644 --- a/packages/specs/schema/src/components/default/itemMapper.ts +++ b/packages/specs/schema/src/components/default/itemMapper.ts @@ -1,4 +1,4 @@ -import {JsonSchemaOptions} from "../../interfaces/JsonSchemaOptions.js"; +import type {JsonSchemaOptions} from "../../interfaces/JsonSchemaOptions.js"; import {execMapper, registerJsonSchemaMapper} from "../../registries/JsonSchemaMapperContainer.js"; export function itemMapper(value: any, options: JsonSchemaOptions) { diff --git a/packages/specs/schema/src/components/default/lazyRefMapper.ts b/packages/specs/schema/src/components/default/lazyRefMapper.ts index ceefd1eea22..1a496e5d898 100644 --- a/packages/specs/schema/src/components/default/lazyRefMapper.ts +++ b/packages/specs/schema/src/components/default/lazyRefMapper.ts @@ -1,5 +1,5 @@ -import {JsonLazyRef} from "../../domain/JsonLazyRef.js"; -import {JsonSchemaOptions} from "../../interfaces/JsonSchemaOptions.js"; +import type {JsonLazyRef} from "../../domain/JsonLazyRef.js"; +import type {JsonSchemaOptions} from "../../interfaces/JsonSchemaOptions.js"; import {execMapper, registerJsonSchemaMapper} from "../../registries/JsonSchemaMapperContainer.js"; import {mapGenericsOptions} from "../../utils/generics.js"; import {createRef, toRef} from "../../utils/ref.js"; diff --git a/packages/specs/schema/src/components/default/mapMapper.ts b/packages/specs/schema/src/components/default/mapMapper.ts index 72ef2b0656d..d0f97e3c54d 100644 --- a/packages/specs/schema/src/components/default/mapMapper.ts +++ b/packages/specs/schema/src/components/default/mapMapper.ts @@ -1,4 +1,4 @@ -import {JsonSchemaOptions} from "../../interfaces/JsonSchemaOptions.js"; +import type {JsonSchemaOptions} from "../../interfaces/JsonSchemaOptions.js"; import {execMapper, registerJsonSchemaMapper} from "../../registries/JsonSchemaMapperContainer.js"; import {mapGenericsOptions} from "../../utils/generics.js"; diff --git a/packages/specs/schema/src/components/default/objectMapper.ts b/packages/specs/schema/src/components/default/objectMapper.ts index e4c8e4c5cc7..bbd707bfcd9 100644 --- a/packages/specs/schema/src/components/default/objectMapper.ts +++ b/packages/specs/schema/src/components/default/objectMapper.ts @@ -1,8 +1,8 @@ import {isArray} from "@tsed/core"; -import {JsonSchema} from "../../domain/JsonSchema.js"; +import type {JsonSchema} from "../../domain/JsonSchema.js"; import {alterIgnore} from "../../hooks/alterIgnore.js"; -import {JsonSchemaOptions} from "../../interfaces/JsonSchemaOptions.js"; +import type {JsonSchemaOptions} from "../../interfaces/JsonSchemaOptions.js"; import {execMapper, registerJsonSchemaMapper} from "../../registries/JsonSchemaMapperContainer.js"; /** diff --git a/packages/specs/schema/src/components/default/schemaMapper.ts b/packages/specs/schema/src/components/default/schemaMapper.ts index 3a6939c917b..de8459533ec 100644 --- a/packages/specs/schema/src/components/default/schemaMapper.ts +++ b/packages/specs/schema/src/components/default/schemaMapper.ts @@ -1,10 +1,10 @@ import {getValue, isObject} from "@tsed/core"; import {mapAliasedProperties} from "../../domain/JsonAliasMap.js"; -import {JsonSchema} from "../../domain/JsonSchema.js"; +import type {JsonSchema} from "../../domain/JsonSchema.js"; import {SpecTypes} from "../../domain/SpecTypes.js"; import {alterOneOf} from "../../hooks/alterOneOf.js"; -import {JsonSchemaOptions} from "../../interfaces/JsonSchemaOptions.js"; +import type {JsonSchemaOptions} from "../../interfaces/JsonSchemaOptions.js"; import {execMapper, hasMapper, registerJsonSchemaMapper} from "../../registries/JsonSchemaMapperContainer.js"; /** diff --git a/packages/specs/schema/src/components/open-spec/generate.ts b/packages/specs/schema/src/components/open-spec/generate.ts index 1626bae7803..0250b8256f8 100644 --- a/packages/specs/schema/src/components/open-spec/generate.ts +++ b/packages/specs/schema/src/components/open-spec/generate.ts @@ -1,8 +1,9 @@ -import {getValue, Type, uniqBy} from "@tsed/core"; +import type {Type} from "@tsed/core"; +import {getValue, uniqBy} from "@tsed/core"; import {SpecTypes} from "../../domain/SpecTypes.js"; import {execMapper, registerJsonSchemaMapper} from "../../registries/JsonSchemaMapperContainer.js"; -import {SpecSerializerOptions} from "../../utils/getSpec.js"; +import type {SpecSerializerOptions} from "../../utils/getSpec.js"; function generate(model: Type, options: SpecSerializerOptions) { options = { diff --git a/packages/specs/schema/src/components/open-spec/operationInParameterMapper.ts b/packages/specs/schema/src/components/open-spec/operationInParameterMapper.ts index e0e79915f38..edf37222324 100644 --- a/packages/specs/schema/src/components/open-spec/operationInParameterMapper.ts +++ b/packages/specs/schema/src/components/open-spec/operationInParameterMapper.ts @@ -1,10 +1,10 @@ -import {OS3Schema} from "@tsed/openspec"; +import type {OS3Schema} from "@tsed/openspec"; import {camelCase} from "change-case"; import type {JSONSchema6} from "json-schema"; -import {JsonParameter} from "../../domain/JsonParameter.js"; +import type {JsonParameter} from "../../domain/JsonParameter.js"; import {JsonParameterTypes} from "../../domain/JsonParameterTypes.js"; -import {JsonSchemaOptions} from "../../interfaces/JsonSchemaOptions.js"; +import type {JsonSchemaOptions} from "../../interfaces/JsonSchemaOptions.js"; import {execMapper, hasMapper, registerJsonSchemaMapper} from "../../registries/JsonSchemaMapperContainer.js"; import {popGenerics} from "../../utils/generics.js"; diff --git a/packages/specs/schema/src/components/open-spec/operationInParametersMapper.ts b/packages/specs/schema/src/components/open-spec/operationInParametersMapper.ts index 7dd70490a67..c3f3d558dc3 100644 --- a/packages/specs/schema/src/components/open-spec/operationInParametersMapper.ts +++ b/packages/specs/schema/src/components/open-spec/operationInParametersMapper.ts @@ -1,5 +1,5 @@ -import {JsonParameter} from "../../domain/JsonParameter.js"; -import {JsonSchemaOptions} from "../../interfaces/JsonSchemaOptions.js"; +import type {JsonParameter} from "../../domain/JsonParameter.js"; +import type {JsonSchemaOptions} from "../../interfaces/JsonSchemaOptions.js"; import {execMapper, registerJsonSchemaMapper} from "../../registries/JsonSchemaMapperContainer.js"; export function operationInParametersMapper(parameters: JsonParameter[], options: JsonSchemaOptions) { diff --git a/packages/specs/schema/src/components/open-spec/operationInQueryMapper.ts b/packages/specs/schema/src/components/open-spec/operationInQueryMapper.ts index d5e41d81858..a51a932cd21 100644 --- a/packages/specs/schema/src/components/open-spec/operationInQueryMapper.ts +++ b/packages/specs/schema/src/components/open-spec/operationInQueryMapper.ts @@ -1,7 +1,7 @@ import {cleanObject} from "@tsed/core"; -import {OS3Example} from "@tsed/openspec"; +import type {OS3Example} from "@tsed/openspec"; -import {JsonSchemaOptions} from "../../interfaces/JsonSchemaOptions.js"; +import type {JsonSchemaOptions} from "../../interfaces/JsonSchemaOptions.js"; import {registerJsonSchemaMapper} from "../../registries/JsonSchemaMapperContainer.js"; import {createRefName} from "../../utils/ref.js"; import type {JsonParameterOptions} from "./operationInParameterMapper.js"; diff --git a/packages/specs/schema/src/components/open-spec/operationMapper.ts b/packages/specs/schema/src/components/open-spec/operationMapper.ts index 045111b1249..8e5bece75be 100644 --- a/packages/specs/schema/src/components/open-spec/operationMapper.ts +++ b/packages/specs/schema/src/components/open-spec/operationMapper.ts @@ -1,8 +1,8 @@ import {getStatusMessage} from "../../constants/httpStatusMessages.js"; -import {JsonOperation} from "../../domain/JsonOperation.js"; -import {JsonParameter} from "../../domain/JsonParameter.js"; +import type {JsonOperation} from "../../domain/JsonOperation.js"; +import type {JsonParameter} from "../../domain/JsonParameter.js"; import {isParameterType, JsonParameterTypes} from "../../domain/JsonParameterTypes.js"; -import {JsonSchemaOptions} from "../../interfaces/JsonSchemaOptions.js"; +import type {JsonSchemaOptions} from "../../interfaces/JsonSchemaOptions.js"; import {execMapper, registerJsonSchemaMapper} from "../../registries/JsonSchemaMapperContainer.js"; function extractParameters(jsonOperation: JsonOperation, options: JsonSchemaOptions) { diff --git a/packages/specs/schema/src/components/open-spec/operationMediaMapper.ts b/packages/specs/schema/src/components/open-spec/operationMediaMapper.ts index 1305a7e5d5e..99b5de9b064 100644 --- a/packages/specs/schema/src/components/open-spec/operationMediaMapper.ts +++ b/packages/specs/schema/src/components/open-spec/operationMediaMapper.ts @@ -1,5 +1,5 @@ -import {JsonMedia} from "../../domain/JsonMedia.js"; -import {JsonSchemaOptions} from "../../interfaces/JsonSchemaOptions.js"; +import type {JsonMedia} from "../../domain/JsonMedia.js"; +import type {JsonSchemaOptions} from "../../interfaces/JsonSchemaOptions.js"; import {execMapper, registerJsonSchemaMapper} from "../../registries/JsonSchemaMapperContainer.js"; export function operationMediaMapper(jsonMedia: JsonMedia, options: JsonSchemaOptions) { diff --git a/packages/specs/schema/src/components/open-spec/operationRequestBodyMapper.ts b/packages/specs/schema/src/components/open-spec/operationRequestBodyMapper.ts index bd3a79b80cd..d5e6ae53269 100644 --- a/packages/specs/schema/src/components/open-spec/operationRequestBodyMapper.ts +++ b/packages/specs/schema/src/components/open-spec/operationRequestBodyMapper.ts @@ -1,7 +1,7 @@ -import {JsonParameter} from "../../domain/JsonParameter.js"; +import type {JsonParameter} from "../../domain/JsonParameter.js"; import {JsonRequestBody} from "../../domain/JsonRequestBody.js"; import {JsonSchema} from "../../domain/JsonSchema.js"; -import {JsonSchemaOptions} from "../../interfaces/JsonSchemaOptions.js"; +import type {JsonSchemaOptions} from "../../interfaces/JsonSchemaOptions.js"; import {execMapper, registerJsonSchemaMapper} from "../../registries/JsonSchemaMapperContainer.js"; function buildSchemaFromBodyParameters(parameters: JsonParameter[], options: JsonSchemaOptions) { diff --git a/packages/specs/schema/src/components/open-spec/operationResponseMapper.ts b/packages/specs/schema/src/components/open-spec/operationResponseMapper.ts index 5850efa8450..16df2b1df71 100644 --- a/packages/specs/schema/src/components/open-spec/operationResponseMapper.ts +++ b/packages/specs/schema/src/components/open-spec/operationResponseMapper.ts @@ -1,5 +1,5 @@ -import {JsonResponse} from "../../domain/JsonResponse.js"; -import {JsonSchemaOptions} from "../../interfaces/JsonSchemaOptions.js"; +import type {JsonResponse} from "../../domain/JsonResponse.js"; +import type {JsonSchemaOptions} from "../../interfaces/JsonSchemaOptions.js"; import {execMapper, registerJsonSchemaMapper} from "../../registries/JsonSchemaMapperContainer.js"; export function operationResponseMapper(jsonResponse: JsonResponse, options: JsonSchemaOptions = {}) { diff --git a/packages/specs/schema/src/components/open-spec/pathsMapper.ts b/packages/specs/schema/src/components/open-spec/pathsMapper.ts index 5e3e51cea67..e757cc7149b 100644 --- a/packages/specs/schema/src/components/open-spec/pathsMapper.ts +++ b/packages/specs/schema/src/components/open-spec/pathsMapper.ts @@ -1,9 +1,9 @@ -import {OS3Operation, OS3Paths} from "@tsed/openspec"; +import type {OS3Operation, OS3Paths} from "@tsed/openspec"; import {OperationVerbs} from "../../constants/OperationVerbs.js"; -import {JsonMethodStore} from "../../domain/JsonMethodStore.js"; -import {JsonMethodPath} from "../../domain/JsonOperation.js"; -import {JsonSchemaOptions} from "../../interfaces/JsonSchemaOptions.js"; +import type {JsonMethodStore} from "../../domain/JsonMethodStore.js"; +import type {JsonMethodPath} from "../../domain/JsonOperation.js"; +import type {JsonSchemaOptions} from "../../interfaces/JsonSchemaOptions.js"; import {execMapper, registerJsonSchemaMapper} from "../../registries/JsonSchemaMapperContainer.js"; import {buildPath} from "../../utils/buildPath.js"; import {concatParameters} from "../../utils/concatParameters.js"; diff --git a/packages/specs/schema/src/decorators/class/children.ts b/packages/specs/schema/src/decorators/class/children.ts index 227db78d644..bda8ab6e927 100644 --- a/packages/specs/schema/src/decorators/class/children.ts +++ b/packages/specs/schema/src/decorators/class/children.ts @@ -1,4 +1,5 @@ -import {Store, Type} from "@tsed/core"; +import type {Type} from "@tsed/core"; +import {Store} from "@tsed/core"; import {JsonEntityFn} from "../common/jsonEntityFn.js"; diff --git a/packages/specs/schema/src/decorators/collections/uniqueItems.ts b/packages/specs/schema/src/decorators/collections/uniqueItems.ts index 0542674ab45..64106ebc52e 100644 --- a/packages/specs/schema/src/decorators/collections/uniqueItems.ts +++ b/packages/specs/schema/src/decorators/collections/uniqueItems.ts @@ -1,4 +1,4 @@ -import {JsonEntityStore} from "../../domain/JsonEntityStore.js"; +import type {JsonEntityStore} from "../../domain/JsonEntityStore.js"; import {withErrorMsg} from "../../utils/withErrorMsg.js"; import {JsonEntityFn} from "../common/jsonEntityFn.js"; diff --git a/packages/specs/schema/src/decorators/common/additionalProperties.ts b/packages/specs/schema/src/decorators/common/additionalProperties.ts index 8b579e3560b..c7af61627ce 100644 --- a/packages/specs/schema/src/decorators/common/additionalProperties.ts +++ b/packages/specs/schema/src/decorators/common/additionalProperties.ts @@ -1,4 +1,4 @@ -import {AnyJsonSchema} from "../../domain/JsonSchema.js"; +import type {AnyJsonSchema} from "../../domain/JsonSchema.js"; import {JsonEntityFn} from "./jsonEntityFn.js"; /** diff --git a/packages/specs/schema/src/decorators/common/allOf.ts b/packages/specs/schema/src/decorators/common/allOf.ts index 1051e12ba59..8dff6e16fd7 100644 --- a/packages/specs/schema/src/decorators/common/allOf.ts +++ b/packages/specs/schema/src/decorators/common/allOf.ts @@ -1,4 +1,4 @@ -import {AnyJsonSchema} from "../../domain/JsonSchema.js"; +import type {AnyJsonSchema} from "../../domain/JsonSchema.js"; import {JsonEntityFn} from "./jsonEntityFn.js"; /** diff --git a/packages/specs/schema/src/decorators/common/any.ts b/packages/specs/schema/src/decorators/common/any.ts index 41521de87d7..d592b4638de 100644 --- a/packages/specs/schema/src/decorators/common/any.ts +++ b/packages/specs/schema/src/decorators/common/any.ts @@ -1,4 +1,4 @@ -import {Type} from "@tsed/core"; +import type {Type} from "@tsed/core"; import type {JSONSchema6TypeName} from "json-schema"; import {JsonEntityFn} from "./jsonEntityFn.js"; diff --git a/packages/specs/schema/src/decorators/common/anyOf.ts b/packages/specs/schema/src/decorators/common/anyOf.ts index dc459dbd927..6227b083089 100644 --- a/packages/specs/schema/src/decorators/common/anyOf.ts +++ b/packages/specs/schema/src/decorators/common/anyOf.ts @@ -1,4 +1,4 @@ -import {AnyJsonSchema} from "../../domain/JsonSchema.js"; +import type {AnyJsonSchema} from "../../domain/JsonSchema.js"; import {JsonEntityFn} from "./jsonEntityFn.js"; /** diff --git a/packages/specs/schema/src/decorators/common/customKey.ts b/packages/specs/schema/src/decorators/common/customKey.ts index 986ac09d287..21c84bb5bfb 100644 --- a/packages/specs/schema/src/decorators/common/customKey.ts +++ b/packages/specs/schema/src/decorators/common/customKey.ts @@ -1,4 +1,4 @@ -import {JsonEntityStore} from "../../domain/JsonEntityStore.js"; +import type {JsonEntityStore} from "../../domain/JsonEntityStore.js"; import {JsonEntityFn} from "./jsonEntityFn.js"; /** diff --git a/packages/specs/schema/src/decorators/common/description.ts b/packages/specs/schema/src/decorators/common/description.ts index 4c95f9de061..7f51bd154fc 100644 --- a/packages/specs/schema/src/decorators/common/description.ts +++ b/packages/specs/schema/src/decorators/common/description.ts @@ -1,6 +1,7 @@ -import {DecoratorParameters, decoratorTypeOf, DecoratorTypes} from "@tsed/core"; +import type {DecoratorParameters} from "@tsed/core"; +import {decoratorTypeOf, DecoratorTypes} from "@tsed/core"; -import {JsonEntityStore} from "../../domain/JsonEntityStore.js"; +import type {JsonEntityStore} from "../../domain/JsonEntityStore.js"; import type {JsonMethodStore} from "../../domain/JsonMethodStore.js"; import type {JsonParameterStore} from "../../domain/JsonParameterStore.js"; import {JsonEntityFn} from "./jsonEntityFn.js"; diff --git a/packages/specs/schema/src/decorators/common/discriminatorKey.ts b/packages/specs/schema/src/decorators/common/discriminatorKey.ts index b5274cc7d3b..924e776a5e1 100644 --- a/packages/specs/schema/src/decorators/common/discriminatorKey.ts +++ b/packages/specs/schema/src/decorators/common/discriminatorKey.ts @@ -1,6 +1,6 @@ import {useDecorators} from "@tsed/core"; -import {JsonPropertyStore} from "../../domain/JsonPropertyStore.js"; +import type {JsonPropertyStore} from "../../domain/JsonPropertyStore.js"; import {JsonEntityFn} from "./jsonEntityFn.js"; import {Property} from "./property.js"; diff --git a/packages/specs/schema/src/decorators/common/example.ts b/packages/specs/schema/src/decorators/common/example.ts index f4d27c377b8..2905ea24e90 100644 --- a/packages/specs/schema/src/decorators/common/example.ts +++ b/packages/specs/schema/src/decorators/common/example.ts @@ -1,4 +1,4 @@ -import {JsonEntityStore} from "../../domain/JsonEntityStore.js"; +import type {JsonEntityStore} from "../../domain/JsonEntityStore.js"; import {JsonEntityFn} from "./jsonEntityFn.js"; /** diff --git a/packages/specs/schema/src/decorators/common/examples.ts b/packages/specs/schema/src/decorators/common/examples.ts index 3752e6e45da..af261be8708 100644 --- a/packages/specs/schema/src/decorators/common/examples.ts +++ b/packages/specs/schema/src/decorators/common/examples.ts @@ -1,6 +1,6 @@ -import {OpenSpecHash, OpenSpecRef, OS3Example} from "@tsed/openspec"; +import type {OpenSpecHash, OpenSpecRef, OS3Example} from "@tsed/openspec"; -import {JsonParameterStore} from "../../domain/JsonParameterStore.js"; +import type {JsonParameterStore} from "../../domain/JsonParameterStore.js"; import {JsonEntityFn} from "./jsonEntityFn.js"; /** diff --git a/packages/specs/schema/src/decorators/common/format.ts b/packages/specs/schema/src/decorators/common/format.ts index a55dba31a49..b072971e84a 100644 --- a/packages/specs/schema/src/decorators/common/format.ts +++ b/packages/specs/schema/src/decorators/common/format.ts @@ -1,4 +1,4 @@ -import {ValueOf} from "@tsed/core"; +import type {ValueOf} from "@tsed/core"; import {JsonFormatTypes} from "../../domain/JsonFormatTypes.js"; import {withErrorMsg} from "../../utils/withErrorMsg.js"; diff --git a/packages/specs/schema/src/decorators/common/ignore.ts b/packages/specs/schema/src/decorators/common/ignore.ts index be996f93245..f3286804ee6 100644 --- a/packages/specs/schema/src/decorators/common/ignore.ts +++ b/packages/specs/schema/src/decorators/common/ignore.ts @@ -1,4 +1,4 @@ -import {IgnoreCallback} from "../../interfaces/IgnoreCallback.js"; +import type {IgnoreCallback} from "../../interfaces/IgnoreCallback.js"; import {JsonEntityFn} from "./jsonEntityFn.js"; /** diff --git a/packages/specs/schema/src/decorators/common/jsonEntityFn.ts b/packages/specs/schema/src/decorators/common/jsonEntityFn.ts index 8a7a709e2a1..b90f7700bdf 100644 --- a/packages/specs/schema/src/decorators/common/jsonEntityFn.ts +++ b/packages/specs/schema/src/decorators/common/jsonEntityFn.ts @@ -1,4 +1,4 @@ -import {DecoratorParameters} from "@tsed/core"; +import type {DecoratorParameters} from "@tsed/core"; import type {JsonEntityStore} from "../../domain/JsonEntityStore.js"; import {getJsonEntityStore} from "../../utils/getJsonEntityStore.js"; diff --git a/packages/specs/schema/src/decorators/common/name.ts b/packages/specs/schema/src/decorators/common/name.ts index b33f8f910ae..f8ae2c6876b 100644 --- a/packages/specs/schema/src/decorators/common/name.ts +++ b/packages/specs/schema/src/decorators/common/name.ts @@ -1,6 +1,7 @@ -import {DecoratorParameters, decoratorTypeOf, DecoratorTypes} from "@tsed/core"; +import type {DecoratorParameters} from "@tsed/core"; +import {decoratorTypeOf, DecoratorTypes} from "@tsed/core"; -import {JsonEntityStore} from "../../domain/JsonEntityStore.js"; +import type {JsonEntityStore} from "../../domain/JsonEntityStore.js"; import {JsonEntityFn} from "../common/jsonEntityFn.js"; /** diff --git a/packages/specs/schema/src/decorators/common/nullable.ts b/packages/specs/schema/src/decorators/common/nullable.ts index 9c3a64837a7..213e5460a8c 100644 --- a/packages/specs/schema/src/decorators/common/nullable.ts +++ b/packages/specs/schema/src/decorators/common/nullable.ts @@ -1,4 +1,5 @@ -import {Type, useDecorators} from "@tsed/core"; +import type {Type} from "@tsed/core"; +import {useDecorators} from "@tsed/core"; import type {JSONSchema6TypeName} from "json-schema"; import {Any} from "./any.js"; diff --git a/packages/specs/schema/src/decorators/common/oneOf.ts b/packages/specs/schema/src/decorators/common/oneOf.ts index ad16c37dbb3..050268eb5ed 100644 --- a/packages/specs/schema/src/decorators/common/oneOf.ts +++ b/packages/specs/schema/src/decorators/common/oneOf.ts @@ -1,4 +1,4 @@ -import {AnyJsonSchema} from "../../domain/JsonSchema.js"; +import type {AnyJsonSchema} from "../../domain/JsonSchema.js"; import {JsonEntityFn} from "./jsonEntityFn.js"; /** diff --git a/packages/specs/schema/src/decorators/common/pattern.ts b/packages/specs/schema/src/decorators/common/pattern.ts index 7fbc996270f..d85f1b9c0c7 100644 --- a/packages/specs/schema/src/decorators/common/pattern.ts +++ b/packages/specs/schema/src/decorators/common/pattern.ts @@ -1,4 +1,4 @@ -import {JsonEntityStore} from "../../domain/JsonEntityStore.js"; +import type {JsonEntityStore} from "../../domain/JsonEntityStore.js"; import {withErrorMsg} from "../../utils/withErrorMsg.js"; import {JsonEntityFn} from "./jsonEntityFn.js"; diff --git a/packages/specs/schema/src/decorators/common/readOnly.ts b/packages/specs/schema/src/decorators/common/readOnly.ts index 093e58d1997..24d4551d6ad 100644 --- a/packages/specs/schema/src/decorators/common/readOnly.ts +++ b/packages/specs/schema/src/decorators/common/readOnly.ts @@ -1,4 +1,4 @@ -import {JsonEntityStore} from "../../domain/JsonEntityStore.js"; +import type {JsonEntityStore} from "../../domain/JsonEntityStore.js"; import {JsonEntityFn} from "./jsonEntityFn.js"; /** * Set the property as readOnly. diff --git a/packages/specs/schema/src/decorators/common/schema.ts b/packages/specs/schema/src/decorators/common/schema.ts index 77c71ea6882..92a497768b0 100644 --- a/packages/specs/schema/src/decorators/common/schema.ts +++ b/packages/specs/schema/src/decorators/common/schema.ts @@ -1,5 +1,5 @@ -import {JsonSchema, JsonSchemaObject} from "../../domain/JsonSchema.js"; -import {SpecTypes} from "../../domain/SpecTypes.js"; +import type {JsonSchema, JsonSchemaObject} from "../../domain/JsonSchema.js"; +import type {SpecTypes} from "../../domain/SpecTypes.js"; import {JsonEntityFn} from "./jsonEntityFn.js"; /** diff --git a/packages/specs/schema/src/decorators/common/writeOnly.ts b/packages/specs/schema/src/decorators/common/writeOnly.ts index 5eeeb60a40b..53fc06af498 100644 --- a/packages/specs/schema/src/decorators/common/writeOnly.ts +++ b/packages/specs/schema/src/decorators/common/writeOnly.ts @@ -1,4 +1,4 @@ -import {JsonEntityStore} from "../../domain/JsonEntityStore.js"; +import type {JsonEntityStore} from "../../domain/JsonEntityStore.js"; import {JsonEntityFn} from "./jsonEntityFn.js"; /** * Set the property as WriteOnly. diff --git a/packages/specs/schema/src/decorators/config/jsonEntityComponent.ts b/packages/specs/schema/src/decorators/config/jsonEntityComponent.ts index 30603480843..251d2304304 100644 --- a/packages/specs/schema/src/decorators/config/jsonEntityComponent.ts +++ b/packages/specs/schema/src/decorators/config/jsonEntityComponent.ts @@ -1,6 +1,7 @@ -import {DecoratorTypes, Type} from "@tsed/core"; +import type {DecoratorTypes, Type} from "@tsed/core"; -import {JsonEntitiesContainer, JsonEntityStore} from "../../domain/JsonEntityStore.js"; +import type {JsonEntityStore} from "../../domain/JsonEntityStore.js"; +import {JsonEntitiesContainer} from "../../domain/JsonEntityStore.js"; /** * Declare a new JsonEntityStore class for a specific decorator type. diff --git a/packages/specs/schema/src/decorators/generics/genericOf.ts b/packages/specs/schema/src/decorators/generics/genericOf.ts index 98028de783b..0cd877f28b3 100644 --- a/packages/specs/schema/src/decorators/generics/genericOf.ts +++ b/packages/specs/schema/src/decorators/generics/genericOf.ts @@ -2,7 +2,7 @@ import {isObject, Type} from "@tsed/core"; import {JsonEntityStore} from "../../domain/JsonEntityStore.js"; import {string} from "../../utils/from.js"; -import {GenericValue} from "../../utils/generics.js"; +import type {GenericValue} from "../../utils/generics.js"; /** * @ignore diff --git a/packages/specs/schema/src/decorators/operations/deprecated.ts b/packages/specs/schema/src/decorators/operations/deprecated.ts index c44c4d00c5d..129212aedc3 100644 --- a/packages/specs/schema/src/decorators/operations/deprecated.ts +++ b/packages/specs/schema/src/decorators/operations/deprecated.ts @@ -1,7 +1,7 @@ import {decorateMethodsOf, decoratorTypeOf, DecoratorTypes, UnsupportedDecoratorType} from "@tsed/core"; -import {JsonParameterStore} from "../../domain/JsonParameterStore.js"; -import {JsonPropertyStore} from "../../domain/JsonPropertyStore.js"; +import type {JsonParameterStore} from "../../domain/JsonParameterStore.js"; +import type {JsonPropertyStore} from "../../domain/JsonPropertyStore.js"; import {JsonEntityFn} from "../common/jsonEntityFn.js"; /** diff --git a/packages/specs/schema/src/decorators/operations/header.ts b/packages/specs/schema/src/decorators/operations/header.ts index c92d91720a0..51150ba1768 100644 --- a/packages/specs/schema/src/decorators/operations/header.ts +++ b/packages/specs/schema/src/decorators/operations/header.ts @@ -1,6 +1,6 @@ import {isString} from "@tsed/core"; -import {JsonHeader, JsonHeaders} from "../../interfaces/JsonOpenSpec.js"; +import type {JsonHeader, JsonHeaders} from "../../interfaces/JsonOpenSpec.js"; import {Returns} from "./returns.js"; /** diff --git a/packages/specs/schema/src/decorators/operations/in.ts b/packages/specs/schema/src/decorators/operations/in.ts index cc95da9fe96..32f2a2d9da4 100644 --- a/packages/specs/schema/src/decorators/operations/in.ts +++ b/packages/specs/schema/src/decorators/operations/in.ts @@ -1,11 +1,13 @@ -import {decorateMethodsOf, DecoratorTypes, Type, UnsupportedDecoratorType} from "@tsed/core"; +import type {Type} from "@tsed/core"; +import {decorateMethodsOf, DecoratorTypes, UnsupportedDecoratorType} from "@tsed/core"; import {JsonEntityStore} from "../../domain/JsonEntityStore.js"; -import {JsonMethodStore} from "../../domain/JsonMethodStore.js"; +import type {JsonMethodStore} from "../../domain/JsonMethodStore.js"; import {JsonParameter} from "../../domain/JsonParameter.js"; -import {JsonParameterStore} from "../../domain/JsonParameterStore.js"; -import {JsonParameterTypes} from "../../domain/JsonParameterTypes.js"; -import {JsonSchema, JsonSchemaObject} from "../../domain/JsonSchema.js"; +import type {JsonParameterStore} from "../../domain/JsonParameterStore.js"; +import type {JsonParameterTypes} from "../../domain/JsonParameterTypes.js"; +import type {JsonSchemaObject} from "../../domain/JsonSchema.js"; +import {JsonSchema} from "../../domain/JsonSchema.js"; export interface InChainedDecorators { (target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor): TypedPropertyDescriptor | void; diff --git a/packages/specs/schema/src/decorators/operations/inFile.ts b/packages/specs/schema/src/decorators/operations/inFile.ts index 4b3e2918eea..4b2456ad6b0 100644 --- a/packages/specs/schema/src/decorators/operations/inFile.ts +++ b/packages/specs/schema/src/decorators/operations/inFile.ts @@ -1,4 +1,5 @@ -import {DecoratorParameters, Metadata, useDecorators, useMethodDecorators} from "@tsed/core"; +import type {DecoratorParameters} from "@tsed/core"; +import {Metadata, useDecorators, useMethodDecorators} from "@tsed/core"; import {JsonParameterTypes} from "../../domain/JsonParameterTypes.js"; import {Name} from "../common/name.js"; diff --git a/packages/specs/schema/src/decorators/operations/location.ts b/packages/specs/schema/src/decorators/operations/location.ts index 7b09517b4a7..dbce3f19e62 100644 --- a/packages/specs/schema/src/decorators/operations/location.ts +++ b/packages/specs/schema/src/decorators/operations/location.ts @@ -1,4 +1,4 @@ -import {JsonHeader} from "../../interfaces/JsonOpenSpec.js"; +import type {JsonHeader} from "../../interfaces/JsonOpenSpec.js"; import {Returns} from "./returns.js"; /** diff --git a/packages/specs/schema/src/decorators/operations/operation.ts b/packages/specs/schema/src/decorators/operations/operation.ts index 42d21094277..c15f7a5481c 100644 --- a/packages/specs/schema/src/decorators/operations/operation.ts +++ b/packages/specs/schema/src/decorators/operations/operation.ts @@ -1,6 +1,6 @@ import {OperationVerbs} from "../../constants/OperationVerbs.js"; import {DecoratorContext} from "../../domain/DecoratorContext.js"; -import {JsonMethodStore} from "../../domain/JsonMethodStore.js"; +import type {JsonMethodStore} from "../../domain/JsonMethodStore.js"; import {mapOperationOptions} from "../../utils/mapOperationOptions.js"; export interface RouteChainedDecorators { diff --git a/packages/specs/schema/src/decorators/operations/operationPath.ts b/packages/specs/schema/src/decorators/operations/operationPath.ts index bfe3b03fa1e..1d632a5be73 100644 --- a/packages/specs/schema/src/decorators/operations/operationPath.ts +++ b/packages/specs/schema/src/decorators/operations/operationPath.ts @@ -1,6 +1,6 @@ import {DecoratorTypes, UnsupportedDecoratorType} from "@tsed/core"; -import {OperationVerbs} from "../../constants/OperationVerbs.js"; +import type {OperationVerbs} from "../../constants/OperationVerbs.js"; import {JsonEntityFn} from "../common/jsonEntityFn.js"; /** diff --git a/packages/specs/schema/src/decorators/operations/redirect.ts b/packages/specs/schema/src/decorators/operations/redirect.ts index 2db2caefc57..2c52c8a13ed 100644 --- a/packages/specs/schema/src/decorators/operations/redirect.ts +++ b/packages/specs/schema/src/decorators/operations/redirect.ts @@ -1,6 +1,6 @@ import {isNumber, isString, useDecorators} from "@tsed/core"; -import {JsonHeader} from "../../interfaces/JsonOpenSpec.js"; +import type {JsonHeader} from "../../interfaces/JsonOpenSpec.js"; import {JsonEntityFn} from "../common/jsonEntityFn.js"; import {Returns} from "./returns.js"; diff --git a/packages/specs/schema/src/decorators/operations/returns.spec.ts b/packages/specs/schema/src/decorators/operations/returns.spec.ts index e61b709d7c3..b6d58d5b700 100644 --- a/packages/specs/schema/src/decorators/operations/returns.spec.ts +++ b/packages/specs/schema/src/decorators/operations/returns.spec.ts @@ -1,6 +1,6 @@ import "@tsed/platform-exceptions"; -import {OpenSpec3} from "@tsed/openspec"; +import type {OpenSpec3} from "@tsed/openspec"; import {SpecTypes} from "../../domain/SpecTypes.js"; import {getSpec} from "../../utils/getSpec.js"; diff --git a/packages/specs/schema/src/decorators/operations/returns.ts b/packages/specs/schema/src/decorators/operations/returns.ts index a446378f22c..ab58f6d9d6c 100644 --- a/packages/specs/schema/src/decorators/operations/returns.ts +++ b/packages/specs/schema/src/decorators/operations/returns.ts @@ -1,3 +1,4 @@ +import type {Type} from "@tsed/core"; import { decorateMethodsOf, decoratorTypeOf, @@ -7,21 +8,21 @@ import { isObject, isPlainObject, isPrimitiveOrPrimitiveClass, - isString, - Type + isString } from "@tsed/core"; -import {OS3Example} from "@tsed/openspec"; +import type {OS3Example} from "@tsed/openspec"; import {getStatusMessage} from "../../constants/httpStatusMessages.js"; import {DecoratorContext} from "../../domain/DecoratorContext.js"; import {JsonEntityStore} from "../../domain/JsonEntityStore.js"; import {JsonParameter} from "../../domain/JsonParameter.js"; -import {JsonResponse} from "../../domain/JsonResponse.js"; -import {JsonSchema, JsonSchemaObject} from "../../domain/JsonSchema.js"; -import {JsonHeader, JsonHeaders} from "../../interfaces/JsonOpenSpec.js"; +import type {JsonResponse} from "../../domain/JsonResponse.js"; +import type {JsonSchemaObject} from "../../domain/JsonSchema.js"; +import {JsonSchema} from "../../domain/JsonSchema.js"; +import type {JsonHeader, JsonHeaders} from "../../interfaces/JsonOpenSpec.js"; import {getStatusModel} from "../../utils/defineStatusModel.js"; import {string} from "../../utils/from.js"; -import {GenericValue} from "../../utils/generics.js"; +import type {GenericValue} from "../../utils/generics.js"; import {isSuccessStatus} from "../../utils/isSuccessStatus.js"; import {mapHeaders} from "../../utils/mapHeaders.js"; diff --git a/packages/specs/schema/src/decorators/operations/security.ts b/packages/specs/schema/src/decorators/operations/security.ts index 7d8aed9fd30..4df905dfd48 100644 --- a/packages/specs/schema/src/decorators/operations/security.ts +++ b/packages/specs/schema/src/decorators/operations/security.ts @@ -1,5 +1,5 @@ import {decorateMethodsOf, DecoratorTypes, UnsupportedDecoratorType} from "@tsed/core"; -import {OpenSpecSecurity} from "@tsed/openspec"; +import type {OpenSpecSecurity} from "@tsed/openspec"; import {JsonEntityFn} from "../common/jsonEntityFn.js"; diff --git a/packages/specs/schema/src/decorators/operations/status.ts b/packages/specs/schema/src/decorators/operations/status.ts index 21a8de69148..e37527b6b19 100644 --- a/packages/specs/schema/src/decorators/operations/status.ts +++ b/packages/specs/schema/src/decorators/operations/status.ts @@ -1,6 +1,7 @@ -import {Type} from "@tsed/core"; +import type {Type} from "@tsed/core"; -import {Returns, ReturnsChainedDecorators} from "./returns.js"; +import type {ReturnsChainedDecorators} from "./returns.js"; +import {Returns} from "./returns.js"; /** * Add responses documentation for a specific status code. diff --git a/packages/specs/schema/src/decorators/operations/tags.ts b/packages/specs/schema/src/decorators/operations/tags.ts index 11e934ed99f..507e47f6537 100644 --- a/packages/specs/schema/src/decorators/operations/tags.ts +++ b/packages/specs/schema/src/decorators/operations/tags.ts @@ -1,5 +1,5 @@ import {decorateMethodsOf, DecoratorTypes, UnsupportedDecoratorType} from "@tsed/core"; -import {OpenSpecTag} from "@tsed/openspec"; +import type {OpenSpecTag} from "@tsed/openspec"; import {JsonEntityFn} from "../common/jsonEntityFn.js"; diff --git a/packages/specs/schema/src/domain/DecoratorContext.ts b/packages/specs/schema/src/domain/DecoratorContext.ts index f112770ce14..23a59c6f3cc 100644 --- a/packages/specs/schema/src/domain/DecoratorContext.ts +++ b/packages/specs/schema/src/domain/DecoratorContext.ts @@ -1,4 +1,5 @@ -import {DecoratorParameters, DecoratorTypes} from "@tsed/core"; +import type {DecoratorParameters} from "@tsed/core"; +import {DecoratorTypes} from "@tsed/core"; import {pascalCase} from "change-case"; import {JsonEntityStore} from "./JsonEntityStore.js"; diff --git a/packages/specs/schema/src/domain/JsonClassStore.ts b/packages/specs/schema/src/domain/JsonClassStore.ts index 152769d4b7c..204cc89d98d 100644 --- a/packages/specs/schema/src/domain/JsonClassStore.ts +++ b/packages/specs/schema/src/domain/JsonClassStore.ts @@ -1,7 +1,7 @@ import {DecoratorTypes} from "@tsed/core"; import {JsonEntityComponent} from "../decorators/config/jsonEntityComponent.js"; -import {JsonEntityStore, JsonEntityStoreOptions} from "./JsonEntityStore.js"; +import {JsonEntityStore} from "./JsonEntityStore.js"; import type {JsonMethodStore} from "./JsonMethodStore.js"; import type {JsonPropertyStore} from "./JsonPropertyStore.js"; import {JsonSchema} from "./JsonSchema.js"; diff --git a/packages/specs/schema/src/domain/JsonDiscriminator.ts b/packages/specs/schema/src/domain/JsonDiscriminator.ts index a6899a07579..d059be80935 100644 --- a/packages/specs/schema/src/domain/JsonDiscriminator.ts +++ b/packages/specs/schema/src/domain/JsonDiscriminator.ts @@ -1,4 +1,5 @@ -import {cleanObject, Type} from "@tsed/core"; +import type {Type} from "@tsed/core"; +import {cleanObject} from "@tsed/core"; export class Discriminator { propertyName: string; diff --git a/packages/specs/schema/src/domain/JsonEntityStore.spec.ts b/packages/specs/schema/src/domain/JsonEntityStore.spec.ts index 65b0dc495b0..454bcb435a2 100644 --- a/packages/specs/schema/src/domain/JsonEntityStore.spec.ts +++ b/packages/specs/schema/src/domain/JsonEntityStore.spec.ts @@ -1,15 +1,5 @@ -import { - Allow, - In, - JsonEntityStore, - JsonMethodStore, - JsonOperation, - JsonParameter, - JsonParameterStore, - JsonPropertyStore, - Property, - Required -} from "../index.js"; +import type {JsonMethodStore, JsonParameterStore, JsonPropertyStore} from "../index.js"; +import {Allow, In, JsonEntityStore, JsonOperation, JsonParameter, Property, Required} from "../index.js"; describe("JsonEntityStore", () => { it("should create JsonEntityStore", () => { diff --git a/packages/specs/schema/src/domain/JsonEntityStore.ts b/packages/specs/schema/src/domain/JsonEntityStore.ts index 6743a578720..4047b3ef492 100644 --- a/packages/specs/schema/src/domain/JsonEntityStore.ts +++ b/packages/specs/schema/src/domain/JsonEntityStore.ts @@ -1,8 +1,8 @@ +import type {DecoratorTypes, Type} from "@tsed/core"; import { ancestorsOf, classOf, decoratorTypeOf, - DecoratorTypes, descriptorOf, isArrayOrArrayClass, isArrowFn, @@ -15,8 +15,7 @@ import { isPrimitiveOrPrimitiveClass, nameOf, prototypeOf, - Store, - Type + Store } from "@tsed/core"; import type {JsonClassStore} from "./JsonClassStore.js"; diff --git a/packages/specs/schema/src/domain/JsonLazyRef.ts b/packages/specs/schema/src/domain/JsonLazyRef.ts index e93cba3fa59..270bc478b41 100644 --- a/packages/specs/schema/src/domain/JsonLazyRef.ts +++ b/packages/specs/schema/src/domain/JsonLazyRef.ts @@ -1,4 +1,5 @@ -import {nameOf, Type} from "@tsed/core"; +import type {Type} from "@tsed/core"; +import {nameOf} from "@tsed/core"; import {getJsonEntityStore} from "../utils/getJsonEntityStore.js"; diff --git a/packages/specs/schema/src/domain/JsonMap.ts b/packages/specs/schema/src/domain/JsonMap.ts index 21711746bd5..07d48b3da74 100644 --- a/packages/specs/schema/src/domain/JsonMap.ts +++ b/packages/specs/schema/src/domain/JsonMap.ts @@ -1,6 +1,6 @@ import {isFunction} from "@tsed/core"; -import {JsonSchemaOptions} from "../interfaces/JsonSchemaOptions.js"; +import type {JsonSchemaOptions} from "../interfaces/JsonSchemaOptions.js"; import {execMapper} from "../registries/JsonSchemaMapperContainer.js"; export class JsonMap extends Map { diff --git a/packages/specs/schema/src/domain/JsonMedia.ts b/packages/specs/schema/src/domain/JsonMedia.ts index 80884adbf89..c22b8fd5bbc 100644 --- a/packages/specs/schema/src/domain/JsonMedia.ts +++ b/packages/specs/schema/src/domain/JsonMedia.ts @@ -1,7 +1,7 @@ -import {OS3MediaType} from "@tsed/openspec"; +import type {OS3MediaType} from "@tsed/openspec"; import {JsonMap} from "./JsonMap.js"; -import {JsonSchema} from "./JsonSchema.js"; +import type {JsonSchema} from "./JsonSchema.js"; export class JsonMedia extends JsonMap> { $kind: string = "operationMedia"; diff --git a/packages/specs/schema/src/domain/JsonMethodStore.ts b/packages/specs/schema/src/domain/JsonMethodStore.ts index e3f5d6ed1b9..3906b9051b7 100644 --- a/packages/specs/schema/src/domain/JsonMethodStore.ts +++ b/packages/specs/schema/src/domain/JsonMethodStore.ts @@ -1,8 +1,10 @@ -import {DecoratorTypes, deepMerge, descriptorOf, isCollection, isFunction, isPromise, Metadata, prototypeOf, Store, Type} from "@tsed/core"; +import type {Type} from "@tsed/core"; +import {DecoratorTypes, deepMerge, descriptorOf, isCollection, isFunction, isPromise, Metadata, prototypeOf, Store} from "@tsed/core"; import {JsonEntityComponent} from "../decorators/config/jsonEntityComponent.js"; import type {JsonClassStore} from "./JsonClassStore.js"; -import {JsonEntityStore, JsonEntityStoreOptions} from "./JsonEntityStore.js"; +import type {JsonEntityStoreOptions} from "./JsonEntityStore.js"; +import {JsonEntityStore} from "./JsonEntityStore.js"; import {JsonOperation} from "./JsonOperation.js"; import type {JsonParameterStore} from "./JsonParameterStore.js"; import {JsonSchema} from "./JsonSchema.js"; diff --git a/packages/specs/schema/src/domain/JsonOperation.ts b/packages/specs/schema/src/domain/JsonOperation.ts index d671e60b45d..536b23e73de 100644 --- a/packages/specs/schema/src/domain/JsonOperation.ts +++ b/packages/specs/schema/src/domain/JsonOperation.ts @@ -1,12 +1,12 @@ import {deepMerge, uniq, uniqBy} from "@tsed/core"; -import {OpenSpecSecurity, OpenSpecTag, OS3Operation} from "@tsed/openspec"; +import type {OpenSpecSecurity, OpenSpecTag, OS3Operation} from "@tsed/openspec"; -import {JsonHeader} from "../interfaces/JsonOpenSpec.js"; +import type {JsonHeader} from "../interfaces/JsonOpenSpec.js"; import {isRedirectionStatus, isSuccessStatus} from "../utils/isSuccessStatus.js"; import {JsonMap} from "./JsonMap.js"; -import {JsonParameter} from "./JsonParameter.js"; +import type {JsonParameter} from "./JsonParameter.js"; import {JsonResponse} from "./JsonResponse.js"; -import {JsonSchema} from "./JsonSchema.js"; +import type {JsonSchema} from "./JsonSchema.js"; export interface JsonMethodPath { path: string | RegExp; diff --git a/packages/specs/schema/src/domain/JsonOperationPathsMap.ts b/packages/specs/schema/src/domain/JsonOperationPathsMap.ts index 1609450684f..786e835845c 100644 --- a/packages/specs/schema/src/domain/JsonOperationPathsMap.ts +++ b/packages/specs/schema/src/domain/JsonOperationPathsMap.ts @@ -1,5 +1,5 @@ import {OperationVerbs} from "../constants/OperationVerbs.js"; -import {JsonMethodPath} from "./JsonOperation.js"; +import type {JsonMethodPath} from "./JsonOperation.js"; export class JsonOperationPathsMap extends Map { $kind: string = "operationPaths"; diff --git a/packages/specs/schema/src/domain/JsonOperationRoute.ts b/packages/specs/schema/src/domain/JsonOperationRoute.ts index e1c4db9b1bc..74fafd6450c 100644 --- a/packages/specs/schema/src/domain/JsonOperationRoute.ts +++ b/packages/specs/schema/src/domain/JsonOperationRoute.ts @@ -1,8 +1,8 @@ -import {Type} from "@tsed/core"; +import type {Type} from "@tsed/core"; import {concatPath} from "../utils/concatPath.js"; -import {JsonMethodStore} from "./JsonMethodStore.js"; -import {JsonMethodPath, JsonOperation} from "./JsonOperation.js"; +import type {JsonMethodStore} from "./JsonMethodStore.js"; +import type {JsonMethodPath, JsonOperation} from "./JsonOperation.js"; export class JsonOperationRoute { readonly token: Type; diff --git a/packages/specs/schema/src/domain/JsonParameter.ts b/packages/specs/schema/src/domain/JsonParameter.ts index 4fb0dfe6f8b..e6d059a6294 100644 --- a/packages/specs/schema/src/domain/JsonParameter.ts +++ b/packages/specs/schema/src/domain/JsonParameter.ts @@ -1,12 +1,12 @@ -import {Type} from "@tsed/core"; -import {OpenSpecHash, OpenSpecRef, OS3Example, OS3Parameter} from "@tsed/openspec"; +import type {Type} from "@tsed/core"; +import type {OpenSpecHash, OpenSpecRef, OS3Example, OS3Parameter} from "@tsed/openspec"; -import {JsonSchemaOptions} from "../interfaces/JsonSchemaOptions.js"; +import type {JsonSchemaOptions} from "../interfaces/JsonSchemaOptions.js"; import {execMapper} from "../registries/JsonSchemaMapperContainer.js"; -import {NestedGenerics} from "../utils/generics.js"; +import type {NestedGenerics} from "../utils/generics.js"; import {JsonMap} from "./JsonMap.js"; import {formatParameterType} from "./JsonParameterTypes.js"; -import {JsonSchema} from "./JsonSchema.js"; +import type {JsonSchema} from "./JsonSchema.js"; export class JsonParameter extends JsonMap> implements NestedGenerics { $kind = "operationInParameter"; diff --git a/packages/specs/schema/src/domain/JsonParameterStore.ts b/packages/specs/schema/src/domain/JsonParameterStore.ts index 9721bea1f52..bf7bb4aa1cb 100644 --- a/packages/specs/schema/src/domain/JsonParameterStore.ts +++ b/packages/specs/schema/src/domain/JsonParameterStore.ts @@ -1,7 +1,9 @@ -import {ancestorsOf, DecoratorTypes, isClass, isCollection, isMethodDescriptor, Metadata, prototypeOf, Type} from "@tsed/core"; +import type {Type} from "@tsed/core"; +import {ancestorsOf, DecoratorTypes, isClass, isCollection, isMethodDescriptor, Metadata, prototypeOf} from "@tsed/core"; import {JsonEntityComponent} from "../decorators/config/jsonEntityComponent.js"; -import {JsonEntityStore, JsonEntityStoreOptions} from "./JsonEntityStore.js"; +import type {JsonEntityStoreOptions} from "./JsonEntityStore.js"; +import {JsonEntityStore} from "./JsonEntityStore.js"; import type {JsonMethodStore} from "./JsonMethodStore.js"; import {JsonParameter} from "./JsonParameter.js"; import {JsonSchema} from "./JsonSchema.js"; diff --git a/packages/specs/schema/src/domain/JsonPropertyStore.ts b/packages/specs/schema/src/domain/JsonPropertyStore.ts index 6439521539f..88dfff320da 100644 --- a/packages/specs/schema/src/domain/JsonPropertyStore.ts +++ b/packages/specs/schema/src/domain/JsonPropertyStore.ts @@ -1,4 +1,5 @@ -import {DecoratorTypes, Metadata, prototypeOf, Type} from "@tsed/core"; +import type {Type} from "@tsed/core"; +import {DecoratorTypes, Metadata, prototypeOf} from "@tsed/core"; import {JsonEntityComponent} from "../decorators/config/jsonEntityComponent.js"; import type {JsonClassStore} from "./JsonClassStore.js"; diff --git a/packages/specs/schema/src/domain/JsonRequestBody.ts b/packages/specs/schema/src/domain/JsonRequestBody.ts index 411456d54fa..7bc83f6b1c9 100644 --- a/packages/specs/schema/src/domain/JsonRequestBody.ts +++ b/packages/specs/schema/src/domain/JsonRequestBody.ts @@ -1,8 +1,8 @@ -import {OpenSpecHash, OS3MediaType, OS3RequestBody} from "@tsed/openspec"; +import type {OpenSpecHash, OS3MediaType, OS3RequestBody} from "@tsed/openspec"; import {toJsonMapCollection} from "../utils/toJsonMapCollection.js"; import {JsonMap} from "./JsonMap.js"; -import {JsonSchema} from "./JsonSchema.js"; +import type {JsonSchema} from "./JsonSchema.js"; export type JsonRequestBodyOptions = OS3RequestBody; diff --git a/packages/specs/schema/src/domain/JsonResponse.ts b/packages/specs/schema/src/domain/JsonResponse.ts index fbf24f113ad..7bc0c6ec467 100644 --- a/packages/specs/schema/src/domain/JsonResponse.ts +++ b/packages/specs/schema/src/domain/JsonResponse.ts @@ -1,11 +1,11 @@ -import {OS3MediaType, OS3Response} from "@tsed/openspec"; +import type {OS3MediaType, OS3Response} from "@tsed/openspec"; -import {JsonHeader} from "../interfaces/JsonOpenSpec.js"; +import type {JsonHeader} from "../interfaces/JsonOpenSpec.js"; import {mapHeaders} from "../utils/mapHeaders.js"; import {toJsonMapCollection} from "../utils/toJsonMapCollection.js"; import {JsonMap} from "./JsonMap.js"; import {JsonMedia} from "./JsonMedia.js"; -import {JsonSchema} from "./JsonSchema.js"; +import type {JsonSchema} from "./JsonSchema.js"; export type JsonResponseOptions = OS3Response; diff --git a/packages/specs/schema/src/domain/JsonSchema.ts b/packages/specs/schema/src/domain/JsonSchema.ts index 2c9670f4f1c..bbcadb6e258 100644 --- a/packages/specs/schema/src/domain/JsonSchema.ts +++ b/packages/specs/schema/src/domain/JsonSchema.ts @@ -1,33 +1,21 @@ -import { - ancestorsOf, - classOf, - Hooks, - isArray, - isClass, - isFunction, - isObject, - isPrimitiveClass, - nameOf, - Type, - uniq, - ValueOf -} from "@tsed/core"; +import type {Type, ValueOf} from "@tsed/core"; +import {ancestorsOf, classOf, Hooks, isArray, isClass, isFunction, isObject, isPrimitiveClass, nameOf, uniq} from "@tsed/core"; import type {JSONSchema6, JSONSchema6Definition, JSONSchema6Type, JSONSchema6TypeName, JSONSchema6Version} from "json-schema"; -import {IgnoreCallback} from "../interfaces/IgnoreCallback.js"; -import {JsonSchemaOptions} from "../interfaces/JsonSchemaOptions.js"; +import type {IgnoreCallback} from "../interfaces/IgnoreCallback.js"; +import type {JsonSchemaOptions} from "../interfaces/JsonSchemaOptions.js"; import {enumsRegistry} from "../registries/enumRegistries.js"; import {execMapper} from "../registries/JsonSchemaMapperContainer.js"; -import {NestedGenerics} from "../utils/generics.js"; +import type {NestedGenerics} from "../utils/generics.js"; import {getComputedType} from "../utils/getComputedType.js"; import {getJsonType} from "../utils/getJsonType.js"; import {serializeEnumValues} from "../utils/serializeEnumValues.js"; import {toJsonRegex} from "../utils/toJsonRegex.js"; -import {AliasMap, AliasType} from "./JsonAliasMap.js"; +import type {AliasMap, AliasType} from "./JsonAliasMap.js"; import {Discriminator} from "./JsonDiscriminator.js"; import {JsonEntityStore} from "./JsonEntityStore.js"; -import {JsonFormatTypes} from "./JsonFormatTypes.js"; -import {JsonLazyRef} from "./JsonLazyRef.js"; +import type {JsonFormatTypes} from "./JsonFormatTypes.js"; +import type {JsonLazyRef} from "./JsonLazyRef.js"; export interface JsonSchemaObject extends JSONSchema6, Record { type: (any | JSONSchema6TypeName) | (any | JSONSchema6TypeName)[]; diff --git a/packages/specs/schema/src/hooks/alterIgnore.ts b/packages/specs/schema/src/hooks/alterIgnore.ts index 928bdb55e2f..65ae1b40c1e 100644 --- a/packages/specs/schema/src/hooks/alterIgnore.ts +++ b/packages/specs/schema/src/hooks/alterIgnore.ts @@ -1,4 +1,5 @@ -import {Hooks, isBoolean} from "@tsed/core"; +import type {Hooks} from "@tsed/core"; +import {isBoolean} from "@tsed/core"; /** * @ignore diff --git a/packages/specs/schema/src/interfaces/IgnoreCallback.ts b/packages/specs/schema/src/interfaces/IgnoreCallback.ts index 219f76ea8e7..402fd53496c 100644 --- a/packages/specs/schema/src/interfaces/IgnoreCallback.ts +++ b/packages/specs/schema/src/interfaces/IgnoreCallback.ts @@ -1,4 +1,4 @@ -import {JsonHookContext} from "./JsonHookContext.js"; +import type {JsonHookContext} from "./JsonHookContext.js"; export interface IgnoreCallback { (value: boolean, ctx: JsonHookContext): boolean; diff --git a/packages/specs/schema/src/interfaces/JsonOpenSpec.ts b/packages/specs/schema/src/interfaces/JsonOpenSpec.ts index d003cba67d0..7bbd26e482c 100644 --- a/packages/specs/schema/src/interfaces/JsonOpenSpec.ts +++ b/packages/specs/schema/src/interfaces/JsonOpenSpec.ts @@ -1,4 +1,4 @@ -import {OS3Header} from "@tsed/openspec"; +import type {OS3Header} from "@tsed/openspec"; export interface JsonHeader extends OS3Header {} diff --git a/packages/specs/schema/src/interfaces/JsonSchemaOptions.ts b/packages/specs/schema/src/interfaces/JsonSchemaOptions.ts index 7b389754e3e..a078231a716 100644 --- a/packages/specs/schema/src/interfaces/JsonSchemaOptions.ts +++ b/packages/specs/schema/src/interfaces/JsonSchemaOptions.ts @@ -1,4 +1,4 @@ -import {SpecTypes} from "../domain/SpecTypes.js"; +import type {SpecTypes} from "../domain/SpecTypes.js"; export interface JsonSchemaOptions { /** diff --git a/packages/specs/schema/src/registries/JsonSchemaMapperContainer.ts b/packages/specs/schema/src/registries/JsonSchemaMapperContainer.ts index a480620e27e..9804f581d4b 100644 --- a/packages/specs/schema/src/registries/JsonSchemaMapperContainer.ts +++ b/packages/specs/schema/src/registries/JsonSchemaMapperContainer.ts @@ -1,4 +1,4 @@ -import {SpecTypes} from "../domain/SpecTypes.js"; +import type {SpecTypes} from "../domain/SpecTypes.js"; /** * @ignore diff --git a/packages/specs/schema/src/registries/enumRegistries.ts b/packages/specs/schema/src/registries/enumRegistries.ts index f105e125083..a72a50108ea 100644 --- a/packages/specs/schema/src/registries/enumRegistries.ts +++ b/packages/specs/schema/src/registries/enumRegistries.ts @@ -1,3 +1,3 @@ -import {JsonSchema} from "../domain/JsonSchema.js"; +import type {JsonSchema} from "../domain/JsonSchema.js"; export const enumsRegistry = new Map(); diff --git a/packages/specs/schema/src/utils/defineStatusModel.ts b/packages/specs/schema/src/utils/defineStatusModel.ts index bca334ee5c1..4eb9fbf68f5 100644 --- a/packages/specs/schema/src/utils/defineStatusModel.ts +++ b/packages/specs/schema/src/utils/defineStatusModel.ts @@ -1,4 +1,4 @@ -import {Type} from "@tsed/core"; +import type {Type} from "@tsed/core"; const statusesModel: Map> = new Map(); diff --git a/packages/specs/schema/src/utils/from.ts b/packages/specs/schema/src/utils/from.ts index fa62f3de4a7..5f91c25117e 100644 --- a/packages/specs/schema/src/utils/from.ts +++ b/packages/specs/schema/src/utils/from.ts @@ -1,4 +1,5 @@ -import {isClass, Type} from "@tsed/core"; +import type {Type} from "@tsed/core"; +import {isClass} from "@tsed/core"; import {JsonEntityStore} from "../domain/JsonEntityStore.js"; import {JsonFormatTypes} from "../domain/JsonFormatTypes.js"; diff --git a/packages/specs/schema/src/utils/generateSpec.ts b/packages/specs/schema/src/utils/generateSpec.ts index 4863bf79870..164610757c5 100644 --- a/packages/specs/schema/src/utils/generateSpec.ts +++ b/packages/specs/schema/src/utils/generateSpec.ts @@ -1,8 +1,9 @@ import {getValue} from "@tsed/core"; -import {OpenSpec2, OpenSpec3} from "@tsed/openspec"; +import type {OpenSpec2, OpenSpec3} from "@tsed/openspec"; import {SpecTypes} from "../domain/SpecTypes.js"; -import {getSpec, JsonTokenOptions, SpecSerializerOptions} from "./getSpec.js"; +import type {JsonTokenOptions, SpecSerializerOptions} from "./getSpec.js"; +import {getSpec} from "./getSpec.js"; import {getSpecTypeFromSpec} from "./getSpecType.js"; import {mapOpenSpec} from "./mapOpenSpec.js"; import {mergeSpec} from "./mergeSpec.js"; diff --git a/packages/specs/schema/src/utils/generics.ts b/packages/specs/schema/src/utils/generics.ts index 031e1741d77..a0b94c4e4ac 100644 --- a/packages/specs/schema/src/utils/generics.ts +++ b/packages/specs/schema/src/utils/generics.ts @@ -1,6 +1,6 @@ -import {Type} from "@tsed/core"; +import type {Type} from "@tsed/core"; -import {JsonSchema} from "../domain/JsonSchema.js"; +import type {JsonSchema} from "../domain/JsonSchema.js"; export type GenericValue = Type | JsonSchema | any; diff --git a/packages/specs/schema/src/utils/getComputedType.ts b/packages/specs/schema/src/utils/getComputedType.ts index c42d1eebd25..e14467b8b24 100644 --- a/packages/specs/schema/src/utils/getComputedType.ts +++ b/packages/specs/schema/src/utils/getComputedType.ts @@ -1,3 +1,4 @@ +import type {Type} from "@tsed/core"; import { classOf, isArrowFn, @@ -8,8 +9,7 @@ import { isFunction, isPrimitiveOrPrimitiveClass, isPromise, - isSymbol, - Type + isSymbol } from "@tsed/core"; /** diff --git a/packages/specs/schema/src/utils/getInheritedStores.ts b/packages/specs/schema/src/utils/getInheritedStores.ts index 50f7842dece..dda06fae537 100644 --- a/packages/specs/schema/src/utils/getInheritedStores.ts +++ b/packages/specs/schema/src/utils/getInheritedStores.ts @@ -1,4 +1,5 @@ -import {ancestorsOf, Type} from "@tsed/core"; +import type {Type} from "@tsed/core"; +import {ancestorsOf} from "@tsed/core"; import type {JsonClassStore} from "../domain/JsonClassStore.js"; import {getJsonEntityStore} from "./getJsonEntityStore.js"; diff --git a/packages/specs/schema/src/utils/getJsonEntityStore.ts b/packages/specs/schema/src/utils/getJsonEntityStore.ts index e348ec1aea8..5a118af36f1 100644 --- a/packages/specs/schema/src/utils/getJsonEntityStore.ts +++ b/packages/specs/schema/src/utils/getJsonEntityStore.ts @@ -1,4 +1,5 @@ -import {DecoratorTypes, Type} from "@tsed/core"; +import type {Type} from "@tsed/core"; +import {DecoratorTypes} from "@tsed/core"; import {JsonClassStore} from "../domain/JsonClassStore.js"; import {JsonEntitiesContainer, JsonEntityStore} from "../domain/JsonEntityStore.js"; diff --git a/packages/specs/schema/src/utils/getJsonSchema.spec.ts b/packages/specs/schema/src/utils/getJsonSchema.spec.ts index 25945521119..f4cd93f537c 100644 --- a/packages/specs/schema/src/utils/getJsonSchema.spec.ts +++ b/packages/specs/schema/src/utils/getJsonSchema.spec.ts @@ -1,4 +1,5 @@ -import {ancestorsOf, nameOf, Type} from "@tsed/core"; +import type {Type} from "@tsed/core"; +import {ancestorsOf, nameOf} from "@tsed/core"; import {Post} from "../../test/helpers/Post.js"; import {CollectionOf, Email, Format, getJsonSchema, JsonEntityStore, MinLength, Name, Property, Required} from "../index.js"; diff --git a/packages/specs/schema/src/utils/getJsonSchema.ts b/packages/specs/schema/src/utils/getJsonSchema.ts index 6e3f525546a..381a87b30fe 100644 --- a/packages/specs/schema/src/utils/getJsonSchema.ts +++ b/packages/specs/schema/src/utils/getJsonSchema.ts @@ -1,10 +1,11 @@ import "../components/index.js"; -import {getValue, Type} from "@tsed/core"; +import type {Type} from "@tsed/core"; +import {getValue} from "@tsed/core"; import type {JsonEntityStore} from "../domain/JsonEntityStore.js"; import {SpecTypes} from "../domain/SpecTypes.js"; -import {JsonSchemaOptions} from "../interfaces/JsonSchemaOptions.js"; +import type {JsonSchemaOptions} from "../interfaces/JsonSchemaOptions.js"; import {execMapper} from "../registries/JsonSchemaMapperContainer.js"; import {getJsonEntityStore} from "./getJsonEntityStore.js"; diff --git a/packages/specs/schema/src/utils/getOperationsRoutes.spec.ts b/packages/specs/schema/src/utils/getOperationsRoutes.spec.ts index ad8725c9056..be9e4b33ec8 100644 --- a/packages/specs/schema/src/utils/getOperationsRoutes.spec.ts +++ b/packages/specs/schema/src/utils/getOperationsRoutes.spec.ts @@ -4,7 +4,7 @@ import {Children} from "../decorators/class/children.js"; import {In} from "../decorators/operations/in.js"; import {Path} from "../decorators/operations/path.js"; import {All, Get} from "../decorators/operations/route.js"; -import {JsonOperationRoute} from "../domain/JsonOperationRoute.js"; +import type {JsonOperationRoute} from "../domain/JsonOperationRoute.js"; import {getOperationsRoutes} from "./getOperationsRoutes.js"; function getData(operationRoute: JsonOperationRoute) { diff --git a/packages/specs/schema/src/utils/getOperationsRoutes.ts b/packages/specs/schema/src/utils/getOperationsRoutes.ts index 45d7d5f2b4f..ed7f3447941 100644 --- a/packages/specs/schema/src/utils/getOperationsRoutes.ts +++ b/packages/specs/schema/src/utils/getOperationsRoutes.ts @@ -1,8 +1,8 @@ -import {Type} from "@tsed/core"; +import type {Type} from "@tsed/core"; -import {OperationVerbs} from "../constants/OperationVerbs.js"; -import {JsonEntityStore} from "../domain/JsonEntityStore.js"; -import {JsonMethodStore} from "../domain/JsonMethodStore.js"; +import type {OperationVerbs} from "../constants/OperationVerbs.js"; +import type {JsonEntityStore} from "../domain/JsonEntityStore.js"; +import type {JsonMethodStore} from "../domain/JsonMethodStore.js"; import {JsonOperationRoute} from "../domain/JsonOperationRoute.js"; import {concatPath} from "./concatPath.js"; import {getJsonEntityStore} from "./getJsonEntityStore.js"; diff --git a/packages/specs/schema/src/utils/getOperationsStores.ts b/packages/specs/schema/src/utils/getOperationsStores.ts index 80f3f722102..7651130a90f 100644 --- a/packages/specs/schema/src/utils/getOperationsStores.ts +++ b/packages/specs/schema/src/utils/getOperationsStores.ts @@ -1,4 +1,4 @@ -import {Type} from "@tsed/core"; +import type {Type} from "@tsed/core"; import type {JsonClassStore} from "../domain/JsonClassStore.js"; import {JsonMethodStore} from "../domain/JsonMethodStore.js"; diff --git a/packages/specs/schema/src/utils/getPropertiesStores.ts b/packages/specs/schema/src/utils/getPropertiesStores.ts index b82a00aaff0..4b66d61ad8b 100644 --- a/packages/specs/schema/src/utils/getPropertiesStores.ts +++ b/packages/specs/schema/src/utils/getPropertiesStores.ts @@ -1,4 +1,5 @@ -import {isBoolean, Type} from "@tsed/core"; +import type {Type} from "@tsed/core"; +import {isBoolean} from "@tsed/core"; import type {JsonClassStore} from "../domain/JsonClassStore.js"; import type {JsonPropertyStore} from "../domain/JsonPropertyStore.js"; diff --git a/packages/specs/schema/src/utils/getSpec.ts b/packages/specs/schema/src/utils/getSpec.ts index a02f240635d..2f730e6dcc2 100644 --- a/packages/specs/schema/src/utils/getSpec.ts +++ b/packages/specs/schema/src/utils/getSpec.ts @@ -1,8 +1,9 @@ -import {cleanObject, isArray, Type, uniqBy} from "@tsed/core"; -import {OpenSpec3} from "@tsed/openspec"; +import type {Type} from "@tsed/core"; +import {cleanObject, isArray, uniqBy} from "@tsed/core"; +import type {OpenSpec3} from "@tsed/openspec"; import {SpecTypes} from "../domain/SpecTypes.js"; -import {JsonSchemaOptions} from "../interfaces/JsonSchemaOptions.js"; +import type {JsonSchemaOptions} from "../interfaces/JsonSchemaOptions.js"; import {execMapper} from "../registries/JsonSchemaMapperContainer.js"; import {getJsonEntityStore} from "./getJsonEntityStore.js"; import {mergeSpec} from "./mergeSpec.js"; diff --git a/packages/specs/schema/src/utils/getSpecType.ts b/packages/specs/schema/src/utils/getSpecType.ts index be191b28229..f5728580370 100644 --- a/packages/specs/schema/src/utils/getSpecType.ts +++ b/packages/specs/schema/src/utils/getSpecType.ts @@ -1,4 +1,4 @@ -import {OpenSpec2, OpenSpec3} from "@tsed/openspec"; +import type {OpenSpec2, OpenSpec3} from "@tsed/openspec"; import {SpecTypes} from "../domain/SpecTypes.js"; diff --git a/packages/specs/schema/src/utils/mapHeaders.ts b/packages/specs/schema/src/utils/mapHeaders.ts index f809a958c45..fb1d994da1b 100644 --- a/packages/specs/schema/src/utils/mapHeaders.ts +++ b/packages/specs/schema/src/utils/mapHeaders.ts @@ -1,6 +1,6 @@ import {cleanObject} from "@tsed/core"; -import {JsonHeader, JsonHeaders} from "../interfaces/JsonOpenSpec.js"; +import type {JsonHeader, JsonHeaders} from "../interfaces/JsonOpenSpec.js"; /** * Map input header to a standard open spec header diff --git a/packages/specs/schema/src/utils/mapOpenSpec.ts b/packages/specs/schema/src/utils/mapOpenSpec.ts index b0977a2c13f..268d15844e5 100644 --- a/packages/specs/schema/src/utils/mapOpenSpec.ts +++ b/packages/specs/schema/src/utils/mapOpenSpec.ts @@ -1,5 +1,5 @@ import {getValue, setValue} from "@tsed/core"; -import {OpenSpec2, OpenSpec3, OpenSpecVersions} from "@tsed/openspec"; +import type {OpenSpec2, OpenSpec3, OpenSpecVersions} from "@tsed/openspec"; import {SpecTypes} from "../domain/SpecTypes.js"; import {getSpecType} from "./getSpecType.js"; diff --git a/packages/specs/schema/src/utils/mapOpenSpec2.ts b/packages/specs/schema/src/utils/mapOpenSpec2.ts index 49490b8ab61..dad70e66f1f 100644 --- a/packages/specs/schema/src/utils/mapOpenSpec2.ts +++ b/packages/specs/schema/src/utils/mapOpenSpec2.ts @@ -1,5 +1,5 @@ import {getValue, uniq} from "@tsed/core"; -import {OpenSpec2} from "@tsed/openspec"; +import type {OpenSpec2} from "@tsed/openspec"; import {mapOpenSpecInfo} from "./mapOpenSpecInfo.js"; diff --git a/packages/specs/schema/src/utils/mapOpenSpec3.ts b/packages/specs/schema/src/utils/mapOpenSpec3.ts index 6b5831f32dc..659e52fd9f2 100644 --- a/packages/specs/schema/src/utils/mapOpenSpec3.ts +++ b/packages/specs/schema/src/utils/mapOpenSpec3.ts @@ -1,5 +1,5 @@ import {getValue} from "@tsed/core"; -import {OpenSpec3} from "@tsed/openspec"; +import type {OpenSpec3} from "@tsed/openspec"; import {mapOpenSpecInfo} from "./mapOpenSpecInfo.js"; diff --git a/packages/specs/schema/src/utils/mapOpenSpecInfo.ts b/packages/specs/schema/src/utils/mapOpenSpecInfo.ts index b2f03b2a930..13739261f9b 100644 --- a/packages/specs/schema/src/utils/mapOpenSpecInfo.ts +++ b/packages/specs/schema/src/utils/mapOpenSpecInfo.ts @@ -1,5 +1,5 @@ import {cleanObject} from "@tsed/core"; -import {OpenSpecInfo} from "@tsed/openspec"; +import type {OpenSpecInfo} from "@tsed/openspec"; /** * @ignore diff --git a/packages/specs/schema/src/utils/mergeSpec.spec.ts b/packages/specs/schema/src/utils/mergeSpec.spec.ts index b75724ccee1..c91c2d8c2f1 100644 --- a/packages/specs/schema/src/utils/mergeSpec.spec.ts +++ b/packages/specs/schema/src/utils/mergeSpec.spec.ts @@ -1,4 +1,4 @@ -import {OpenSpec2, OpenSpec3} from "@tsed/openspec"; +import type {OpenSpec2, OpenSpec3} from "@tsed/openspec"; import {mergeSpec} from "./mergeSpec.js"; diff --git a/packages/specs/schema/src/utils/mergeSpec.ts b/packages/specs/schema/src/utils/mergeSpec.ts index a103bba71e6..42c26003cfb 100644 --- a/packages/specs/schema/src/utils/mergeSpec.ts +++ b/packages/specs/schema/src/utils/mergeSpec.ts @@ -1,5 +1,5 @@ import {deepMerge, mergeReducerBuilder} from "@tsed/core"; -import {OpenSpec2, OpenSpec3} from "@tsed/openspec"; +import type {OpenSpec2, OpenSpec3} from "@tsed/openspec"; /** * @ignore diff --git a/packages/specs/schema/src/utils/operationIdFormatter.ts b/packages/specs/schema/src/utils/operationIdFormatter.ts index ae1529ca252..7bb4edb4b45 100644 --- a/packages/specs/schema/src/utils/operationIdFormatter.ts +++ b/packages/specs/schema/src/utils/operationIdFormatter.ts @@ -1,6 +1,6 @@ import {camelCase} from "change-case"; -import {JsonSchemaOptions} from "../interfaces/JsonSchemaOptions.js"; +import type {JsonSchemaOptions} from "../interfaces/JsonSchemaOptions.js"; const DEFAULT_PATTERN = "%c.%m"; diff --git a/packages/specs/schema/src/utils/ref.ts b/packages/specs/schema/src/utils/ref.ts index 5c67089844d..00b8f3980cd 100644 --- a/packages/specs/schema/src/utils/ref.ts +++ b/packages/specs/schema/src/utils/ref.ts @@ -3,7 +3,7 @@ import {pascalCase} from "change-case"; import type {JsonSchema} from "../domain/JsonSchema.js"; import {SpecTypes} from "../domain/SpecTypes.js"; -import {JsonSchemaOptions} from "../interfaces/JsonSchemaOptions.js"; +import type {JsonSchemaOptions} from "../interfaces/JsonSchemaOptions.js"; import {anyOf} from "./from.js"; /** diff --git a/packages/specs/schema/src/utils/removeHiddenOperation.ts b/packages/specs/schema/src/utils/removeHiddenOperation.ts index 7787d742386..86227f28e86 100644 --- a/packages/specs/schema/src/utils/removeHiddenOperation.ts +++ b/packages/specs/schema/src/utils/removeHiddenOperation.ts @@ -1,4 +1,4 @@ -import {JsonMethodStore} from "../domain/JsonMethodStore.js"; +import type {JsonMethodStore} from "../domain/JsonMethodStore.js"; export function removeHiddenOperation(operationStore: JsonMethodStore) { return !operationStore.store.get("hidden"); diff --git a/packages/specs/schema/src/utils/transformToOS2.ts b/packages/specs/schema/src/utils/transformToOS2.ts index cc1dea7b17c..e543195a034 100644 --- a/packages/specs/schema/src/utils/transformToOS2.ts +++ b/packages/specs/schema/src/utils/transformToOS2.ts @@ -1,6 +1,6 @@ "use strict"; import {cleanObject} from "@tsed/core"; -import {OpenSpec2, OpenSpec3, OS3Operation} from "@tsed/openspec"; +import type {OpenSpec2, OpenSpec3, OS3Operation} from "@tsed/openspec"; const HTTP_METHODS = ["get", "put", "post", "delete", "options", "head", "patch", "trace"]; const SCHEMA_PROPERTIES = [ diff --git a/packages/specs/schema/test/helpers/Post.ts b/packages/specs/schema/test/helpers/Post.ts index e5eb081daa0..b31008d9594 100644 --- a/packages/specs/schema/test/helpers/Post.ts +++ b/packages/specs/schema/test/helpers/Post.ts @@ -1,5 +1,5 @@ import {Property} from "../../src/index.js"; -import {User} from "./User.js"; +import type {User} from "./User.js"; export class Post { @Property() diff --git a/packages/specs/schema/test/helpers/validateModel.ts b/packages/specs/schema/test/helpers/validateModel.ts index facb32f1f90..55e279d982e 100644 --- a/packages/specs/schema/test/helpers/validateModel.ts +++ b/packages/specs/schema/test/helpers/validateModel.ts @@ -1,4 +1,5 @@ -import Ajv, {Options} from "ajv"; +import type {Options} from "ajv"; +import Ajv from "ajv"; import AjvErrors from "ajv-errors"; import AjvFormats from "ajv-formats"; diff --git a/packages/specs/schema/test/integrations/body-params-any.integration.spec.ts b/packages/specs/schema/test/integrations/body-params-any.integration.spec.ts index 9737b219160..32ddd04108d 100644 --- a/packages/specs/schema/test/integrations/body-params-any.integration.spec.ts +++ b/packages/specs/schema/test/integrations/body-params-any.integration.spec.ts @@ -1,4 +1,5 @@ -import {MultipartFile, PlatformMulterFile} from "@tsed/common"; +import type {PlatformMulterFile} from "@tsed/common"; +import {MultipartFile} from "@tsed/common"; import {Controller} from "@tsed/di"; // @ts-ignore import {BodyParams} from "@tsed/platform-params"; diff --git a/packages/specs/schema/test/integrations/inheritance.integration.spec.ts b/packages/specs/schema/test/integrations/inheritance.integration.spec.ts index 21bddd5c11d..06de4206b8c 100644 --- a/packages/specs/schema/test/integrations/inheritance.integration.spec.ts +++ b/packages/specs/schema/test/integrations/inheritance.integration.spec.ts @@ -1,4 +1,5 @@ -import {decorateMethodsOf, DecoratorParameters, decoratorTypeOf, DecoratorTypes, StoreMerge, UnsupportedDecoratorType} from "@tsed/core"; +import type {DecoratorParameters} from "@tsed/core"; +import {decorateMethodsOf, decoratorTypeOf, DecoratorTypes, StoreMerge, UnsupportedDecoratorType} from "@tsed/core"; import {getSpec, In, Name, OperationPath, Path, SpecTypes} from "../../src/index.js"; diff --git a/packages/specs/schema/test/integrations/lazyref.integration.spec.ts b/packages/specs/schema/test/integrations/lazyref.integration.spec.ts index 1582b74f1e1..0cf3d403073 100644 --- a/packages/specs/schema/test/integrations/lazyref.integration.spec.ts +++ b/packages/specs/schema/test/integrations/lazyref.integration.spec.ts @@ -1,4 +1,5 @@ -import {isArrowFn, Type, useDecorators} from "@tsed/core"; +import type {Type} from "@tsed/core"; +import {isArrowFn, useDecorators} from "@tsed/core"; import {getJsonSchema, JsonEntityFn, lazyRef, Property, string} from "../../src/index.js"; diff --git a/packages/specs/schema/test/integrations/multipart.integration.spec.ts b/packages/specs/schema/test/integrations/multipart.integration.spec.ts index ffa27747fd2..899665c84b4 100644 --- a/packages/specs/schema/test/integrations/multipart.integration.spec.ts +++ b/packages/specs/schema/test/integrations/multipart.integration.spec.ts @@ -1,4 +1,5 @@ -import {MultipartFile, PlatformMulterFile} from "@tsed/common"; +import type {PlatformMulterFile} from "@tsed/common"; +import {MultipartFile} from "@tsed/common"; import {Controller} from "@tsed/di"; // @ts-ignore import {BodyParams} from "@tsed/platform-params"; diff --git a/packages/specs/schema/tsconfig.esm.json b/packages/specs/schema/tsconfig.esm.json index 82292550ddb..8954049da4a 100644 --- a/packages/specs/schema/tsconfig.esm.json +++ b/packages/specs/schema/tsconfig.esm.json @@ -2,7 +2,6 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", diff --git a/packages/specs/schema/tsconfig.spec.json b/packages/specs/schema/tsconfig.spec.json index 9ef235f9036..fe78d4ebf76 100644 --- a/packages/specs/schema/tsconfig.spec.json +++ b/packages/specs/schema/tsconfig.spec.json @@ -3,30 +3,30 @@ "compilerOptions": { "baseUrl": ".", "rootDir": "../..", - "outDir": "./lib/cjs", "declaration": false, "composite": false, "noEmit": true, "paths": { - "@tsed/openspec": ["../openspec/src"], - "@tsed/di": ["../../di/src"], - "@tsed/exceptions": ["../exceptions/src"], - "@tsed/json-mapper": ["../json-mapper/src"], - "@tsed/platform-exceptions": ["../../platform/platform-exceptions/src"], - "@tsed/platform-middlewares": ["../../platform/platform-middlewares/src"], - "@tsed/platform-params": ["../../platform/platform-params/src"], - "@tsed/platform-log-middleware": ["../../platform/platform-log-middleware/src"], - "@tsed/platform-response-filter": ["../../platform/platform-response-filter/src"], - "@tsed/platform-router": ["../../platform/platform-router/src"], - "@tsed/platform-views": ["../../platform/platform-views/src"], - "@tsed/components-scan": ["../../third-parties/components-scan/src"], - "@tsed/common": ["../../platform/common/src"], - "@tsed/ajv": ["../ajv/src"], - "@tsed/platform-cache": ["../../platform/platform-cache/src"], - "@tsed/swagger": ["../swagger/src"], - "@tsed/platform-test-sdk": ["../../platform/platform-test-sdk/src"], - "@tsed/platform-express": ["../../platform/platform-express/src"], - "@tsed/platform-koa": ["../../platform/platform-koa/src"] + "@tsed/openspec": ["../openspec/src/index.ts"], + "@tsed/di": ["../../di/src/index.ts"], + "@tsed/exceptions": ["../exceptions/src/index.ts"], + "@tsed/json-mapper": ["../json-mapper/src/index.ts"], + "@tsed/platform-exceptions": ["../../platform/platform-exceptions/src/index.ts"], + "@tsed/platform-middlewares": ["../../platform/platform-middlewares/src/index.ts"], + "@tsed/platform-params": ["../../platform/platform-params/src/index.ts"], + "@tsed/platform-log-middleware": ["../../platform/platform-log-middleware/src/index.ts"], + "@tsed/platform-response-filter": ["../../platform/platform-response-filter/src/index.ts"], + "@tsed/platform-router": ["../../platform/platform-router/src/index.ts"], + "@tsed/platform-views": ["../../platform/platform-views/src/index.ts"], + "@tsed/normalize-path": ["../../utils/normalize-path/src/index.ts"], + "@tsed/components-scan": ["../../third-parties/components-scan/src/index.ts"], + "@tsed/common": ["../../platform/common/src/index.ts"], + "@tsed/ajv": ["../ajv/src/index.ts"], + "@tsed/platform-cache": ["../../platform/platform-cache/src/index.ts"], + "@tsed/swagger": ["../swagger/src/index.ts"], + "@tsed/platform-test-sdk": ["../../platform/platform-test-sdk/src/index.ts"], + "@tsed/platform-express": ["../../platform/platform-express/src/index.ts"], + "@tsed/platform-koa": ["../../platform/platform-koa/src/index.ts"] }, "types": ["vite/client", "vitest/globals"] }, diff --git a/packages/specs/swagger/package.json b/packages/specs/swagger/package.json index 4fe9cfc3c62..5f7258c2448 100644 --- a/packages/specs/swagger/package.json +++ b/packages/specs/swagger/package.json @@ -11,11 +11,11 @@ ".": { "types": "./lib/types/index.d.ts", "import": "./lib/esm/index.js", - "default": "./lib/cjs/index.js" + "default": "./lib/esm/index.js" } }, "scripts": { - "clean": "rm -rf lib", + "clean": "rm -rf lib tsconfig.spec.buildinfo", "build": "yarn clean && yarn barrels && yarn build:ts && yarn copy:views && monorepo build-hybrid", "copy:views": "cp -r ./views ./lib/views", "barrels": "barrels", diff --git a/packages/specs/swagger/src/SwaggerModule.ts b/packages/specs/swagger/src/SwaggerModule.ts index a4531895422..019c8699270 100644 --- a/packages/specs/swagger/src/SwaggerModule.ts +++ b/packages/specs/swagger/src/SwaggerModule.ts @@ -1,22 +1,13 @@ -import { - Configuration, - Constant, - Inject, - InjectorService, - Module, - OnReady, - OnRoutesInit, - PlatformApplication, - PlatformContext -} from "@tsed/common"; +import {Configuration, Constant, Inject, Module, type OnReady, type OnRoutesInit, PlatformApplication, PlatformContext} from "@tsed/common"; import {Env} from "@tsed/core"; +import {InjectorService} from "@tsed/di"; import {normalizePath} from "@tsed/normalize-path"; import {PlatformRouter, useContextHandler} from "@tsed/platform-router"; import Fs from "fs"; import {join} from "path"; import {ROOT_DIR, SWAGGER_UI_DIST} from "./constants.js"; -import {SwaggerSettings} from "./interfaces/SwaggerSettings.js"; +import type {SwaggerSettings} from "./interfaces/SwaggerSettings.js"; import {cssMiddleware} from "./middlewares/cssMiddleware.js"; import {indexMiddleware} from "./middlewares/indexMiddleware.js"; import {jsMiddleware} from "./middlewares/jsMiddleware.js"; @@ -28,16 +19,16 @@ import {SwaggerService} from "./services/SwaggerService.js"; */ @Module() export class SwaggerModule implements OnRoutesInit, OnReady { - @Inject() + @Inject(InjectorService) injector: InjectorService; - @Inject() + @Inject(PlatformApplication) app: PlatformApplication; @Configuration() configuration: Configuration; - @Inject() + @Inject(SwaggerService) swaggerService: SwaggerService; @Constant("env") diff --git a/packages/specs/swagger/src/interfaces/SwaggerSettings.ts b/packages/specs/swagger/src/interfaces/SwaggerSettings.ts index 99af4f77289..83dc4e95f86 100644 --- a/packages/specs/swagger/src/interfaces/SwaggerSettings.ts +++ b/packages/specs/swagger/src/interfaces/SwaggerSettings.ts @@ -1,4 +1,4 @@ -import {OpenSpec2, OpenSpec3, OpenSpecVersions, OS2Versions, OS3Versions} from "@tsed/openspec"; +import type {OpenSpec2, OpenSpec3, OpenSpecVersions, OS2Versions, OS3Versions} from "@tsed/openspec"; export interface SwaggerUIOptions { configUrl?: string; diff --git a/packages/specs/swagger/src/interfaces/interfaces.ts b/packages/specs/swagger/src/interfaces/interfaces.ts index 8458959bbf2..d2cdddaf1fe 100644 --- a/packages/specs/swagger/src/interfaces/interfaces.ts +++ b/packages/specs/swagger/src/interfaces/interfaces.ts @@ -1,4 +1,4 @@ -import {SwaggerSettings} from "./SwaggerSettings.js"; +import type {SwaggerSettings} from "./SwaggerSettings.js"; declare global { namespace TsED { diff --git a/packages/specs/swagger/src/middlewares/cssMiddleware.ts b/packages/specs/swagger/src/middlewares/cssMiddleware.ts index a56c76bd5e0..e26df5386ed 100644 --- a/packages/specs/swagger/src/middlewares/cssMiddleware.ts +++ b/packages/specs/swagger/src/middlewares/cssMiddleware.ts @@ -1,4 +1,4 @@ -import {PlatformContext} from "@tsed/common"; +import type {PlatformContext} from "@tsed/common"; import Fs from "fs"; import {resolve} from "path"; diff --git a/packages/specs/swagger/src/middlewares/indexMiddleware.ts b/packages/specs/swagger/src/middlewares/indexMiddleware.ts index a965db2d495..efc89d40081 100644 --- a/packages/specs/swagger/src/middlewares/indexMiddleware.ts +++ b/packages/specs/swagger/src/middlewares/indexMiddleware.ts @@ -1,6 +1,6 @@ -import {PlatformContext} from "@tsed/common"; +import type {PlatformContext} from "@tsed/common"; -import {SwaggerSettings} from "../interfaces/SwaggerSettings.js"; +import type {SwaggerSettings} from "../interfaces/SwaggerSettings.js"; /** * @ignore diff --git a/packages/specs/swagger/src/middlewares/jsMiddleware.ts b/packages/specs/swagger/src/middlewares/jsMiddleware.ts index f03913168db..731a60e52b4 100644 --- a/packages/specs/swagger/src/middlewares/jsMiddleware.ts +++ b/packages/specs/swagger/src/middlewares/jsMiddleware.ts @@ -1,4 +1,4 @@ -import {PlatformContext} from "@tsed/common"; +import type {PlatformContext} from "@tsed/common"; import Fs from "fs"; import {resolve} from "path"; diff --git a/packages/specs/swagger/src/middlewares/redirectMiddleware.ts b/packages/specs/swagger/src/middlewares/redirectMiddleware.ts index ce85458d9f4..ef58986ead8 100644 --- a/packages/specs/swagger/src/middlewares/redirectMiddleware.ts +++ b/packages/specs/swagger/src/middlewares/redirectMiddleware.ts @@ -1,4 +1,4 @@ -import {PlatformContext} from "@tsed/common"; +import type {PlatformContext} from "@tsed/common"; /** * @ignore diff --git a/packages/specs/swagger/src/services/SwaggerService.ts b/packages/specs/swagger/src/services/SwaggerService.ts index 518b669f748..d46bd83ad04 100644 --- a/packages/specs/swagger/src/services/SwaggerService.ts +++ b/packages/specs/swagger/src/services/SwaggerService.ts @@ -1,9 +1,10 @@ -import {Configuration, Injectable, InjectorService, Platform} from "@tsed/common"; +import {Platform} from "@tsed/common"; +import {Configuration, Inject, Injectable, InjectorService} from "@tsed/common"; import type {Type} from "@tsed/core"; -import {OpenSpec2, OpenSpec3} from "@tsed/openspec"; +import type {OpenSpec2, OpenSpec3} from "@tsed/openspec"; import {generateSpec} from "@tsed/schema"; -import {SwaggerOS2Settings, SwaggerOS3Settings, SwaggerSettings} from "../interfaces/SwaggerSettings.js"; +import type {SwaggerOS2Settings, SwaggerOS3Settings, SwaggerSettings} from "../interfaces/SwaggerSettings.js"; import {includeRoute} from "../utils/includeRoute.js"; @Injectable() @@ -11,8 +12,8 @@ export class SwaggerService { #specs: Map = new Map(); constructor( - private injectorService: InjectorService, - private platform: Platform, + @Inject(InjectorService) private injectorService: InjectorService, + @Inject(Platform) private platform: Platform, @Configuration() private configuration: Configuration ) {} diff --git a/packages/specs/swagger/src/utils/includeRoute.ts b/packages/specs/swagger/src/utils/includeRoute.ts index 3fe2d922d59..f5a644b95ef 100644 --- a/packages/specs/swagger/src/utils/includeRoute.ts +++ b/packages/specs/swagger/src/utils/includeRoute.ts @@ -1,6 +1,6 @@ -import {Provider} from "@tsed/di"; +import type {Provider} from "@tsed/di"; -import {SwaggerSettings} from "../interfaces/SwaggerSettings.js"; +import type {SwaggerSettings} from "../interfaces/SwaggerSettings.js"; import {matchPath} from "./matchPath.js"; export function includeRoute(route: string, provider: Provider, conf: SwaggerSettings): boolean { diff --git a/packages/specs/swagger/test/app/Server.ts b/packages/specs/swagger/test/app/Server.ts index b72db5f93f5..859fd48f2c3 100644 --- a/packages/specs/swagger/test/app/Server.ts +++ b/packages/specs/swagger/test/app/Server.ts @@ -1,5 +1,5 @@ import "@tsed/platform-express"; -import "../.."; +import "../../src/index.js"; import {Configuration, Inject, PlatformApplication} from "@tsed/common"; import bodyParser from "body-parser"; @@ -30,7 +30,7 @@ const rootDir = import.meta.dirname; ] }) export class Server { - @Inject() + @Inject(PlatformApplication) app: PlatformApplication; public $beforeRoutesInit(): void { diff --git a/packages/specs/swagger/tsconfig.esm.json b/packages/specs/swagger/tsconfig.esm.json index 82292550ddb..8954049da4a 100644 --- a/packages/specs/swagger/tsconfig.esm.json +++ b/packages/specs/swagger/tsconfig.esm.json @@ -2,7 +2,6 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", diff --git a/packages/specs/swagger/tsconfig.spec.json b/packages/specs/swagger/tsconfig.spec.json index 8d9c26b5d5a..0b84235cd63 100644 --- a/packages/specs/swagger/tsconfig.spec.json +++ b/packages/specs/swagger/tsconfig.spec.json @@ -3,30 +3,30 @@ "compilerOptions": { "baseUrl": ".", "rootDir": "../..", - "outDir": "./lib/cjs", "declaration": false, "composite": false, "noEmit": true, "paths": { - "@tsed/openspec": ["../openspec/src"], - "@tsed/schema": ["../schema/src"], - "@tsed/di": ["../../di/src"], - "@tsed/exceptions": ["../exceptions/src"], - "@tsed/json-mapper": ["../json-mapper/src"], - "@tsed/platform-exceptions": ["../../platform/platform-exceptions/src"], - "@tsed/platform-middlewares": ["../../platform/platform-middlewares/src"], - "@tsed/platform-params": ["../../platform/platform-params/src"], - "@tsed/platform-log-middleware": ["../../platform/platform-log-middleware/src"], - "@tsed/platform-response-filter": ["../../platform/platform-response-filter/src"], - "@tsed/platform-router": ["../../platform/platform-router/src"], - "@tsed/platform-views": ["../../platform/platform-views/src"], - "@tsed/components-scan": ["../../third-parties/components-scan/src"], - "@tsed/common": ["../../platform/common/src"], - "@tsed/ajv": ["../ajv/src"], - "@tsed/platform-cache": ["../../platform/platform-cache/src"], - "@tsed/platform-test-sdk": ["../../platform/platform-test-sdk/src"], - "@tsed/platform-express": ["../../platform/platform-express/src"], - "@tsed/platform-koa": ["../../platform/platform-koa/src"] + "@tsed/openspec": ["../openspec/src/index.ts"], + "@tsed/schema": ["../schema/src/index.ts"], + "@tsed/di": ["../../di/src/index.ts"], + "@tsed/exceptions": ["../exceptions/src/index.ts"], + "@tsed/json-mapper": ["../json-mapper/src/index.ts"], + "@tsed/platform-exceptions": ["../../platform/platform-exceptions/src/index.ts"], + "@tsed/platform-middlewares": ["../../platform/platform-middlewares/src/index.ts"], + "@tsed/platform-params": ["../../platform/platform-params/src/index.ts"], + "@tsed/platform-log-middleware": ["../../platform/platform-log-middleware/src/index.ts"], + "@tsed/platform-response-filter": ["../../platform/platform-response-filter/src/index.ts"], + "@tsed/platform-router": ["../../platform/platform-router/src/index.ts"], + "@tsed/platform-views": ["../../platform/platform-views/src/index.ts"], + "@tsed/normalize-path": ["../../utils/normalize-path/src/index.ts"], + "@tsed/components-scan": ["../../third-parties/components-scan/src/index.ts"], + "@tsed/common": ["../../platform/common/src/index.ts"], + "@tsed/ajv": ["../ajv/src/index.ts"], + "@tsed/platform-cache": ["../../platform/platform-cache/src/index.ts"], + "@tsed/platform-test-sdk": ["../../platform/platform-test-sdk/src/index.ts"], + "@tsed/platform-express": ["../../platform/platform-express/src/index.ts"], + "@tsed/platform-koa": ["../../platform/platform-koa/src/index.ts"] }, "types": ["vite/client", "vitest/globals"] }, diff --git a/packages/third-parties/agenda/package.json b/packages/third-parties/agenda/package.json index f88dc71ca7a..7becfde2b62 100644 --- a/packages/third-parties/agenda/package.json +++ b/packages/third-parties/agenda/package.json @@ -11,7 +11,7 @@ ".": { "types": "./lib/types/index.d.ts", "import": "./lib/esm/index.js", - "default": "./lib/cjs/index.js" + "default": "./lib/esm/index.js" } }, "scripts": { diff --git a/packages/third-parties/agenda/src/AgendaModule.ts b/packages/third-parties/agenda/src/AgendaModule.ts index 18439c96a92..0036e3e260c 100644 --- a/packages/third-parties/agenda/src/AgendaModule.ts +++ b/packages/third-parties/agenda/src/AgendaModule.ts @@ -1,21 +1,22 @@ -import {AfterListen, DIContext, Logger, OnDestroy, runInContext} from "@tsed/common"; -import {Constant, Inject, InjectorService, Module, Provider} from "@tsed/di"; -import {Job, Processor} from "agenda"; +import type {AfterListen} from "@tsed/common"; +import {Constant, DIContext, Inject, InjectorService, Module, type OnDestroy, type Provider, runInContext} from "@tsed/di"; +import {Logger} from "@tsed/logger"; +import type {Job, Processor} from "agenda"; import {v4 as uuid} from "uuid"; import {PROVIDER_TYPE_AGENDA} from "./constants/constants.js"; -import {AgendaStore} from "./interfaces/AgendaStore.js"; +import type {AgendaStore} from "./interfaces/AgendaStore.js"; import {AgendaService} from "./services/AgendaFactory.js"; @Module() export class AgendaModule implements OnDestroy, AfterListen { - @Inject() + @Inject(Logger) protected logger: Logger; - @Inject() + @Inject(InjectorService) protected injector: InjectorService; - @Inject() + @Inject(AgendaService) protected agenda: AgendaService; @Constant("agenda.enabled", false) diff --git a/packages/third-parties/agenda/src/decorators/define.ts b/packages/third-parties/agenda/src/decorators/define.ts index 84658741e6a..c50745aa6c4 100644 --- a/packages/third-parties/agenda/src/decorators/define.ts +++ b/packages/third-parties/agenda/src/decorators/define.ts @@ -1,6 +1,6 @@ import {Store} from "@tsed/core"; -import {AgendaStore, DefineOptions} from "../interfaces/AgendaStore.js"; +import type {AgendaStore, DefineOptions} from "../interfaces/AgendaStore.js"; export function Define(options: DefineOptions = {}): MethodDecorator { return (target: any, propertyKey: string) => { diff --git a/packages/third-parties/agenda/src/decorators/every.ts b/packages/third-parties/agenda/src/decorators/every.ts index 44b03def70f..b1a88f741e2 100644 --- a/packages/third-parties/agenda/src/decorators/every.ts +++ b/packages/third-parties/agenda/src/decorators/every.ts @@ -1,6 +1,6 @@ import {Store, useDecorators} from "@tsed/core"; -import {AgendaStore, EveryOptions} from "../interfaces/AgendaStore.js"; +import type {AgendaStore, EveryOptions} from "../interfaces/AgendaStore.js"; import {Define} from "./define.js"; export function Every(interval: string, options: EveryOptions = {}): MethodDecorator { diff --git a/packages/third-parties/agenda/src/interfaces/AgendaStore.ts b/packages/third-parties/agenda/src/interfaces/AgendaStore.ts index 0bb98649596..d3b02314191 100644 --- a/packages/third-parties/agenda/src/interfaces/AgendaStore.ts +++ b/packages/third-parties/agenda/src/interfaces/AgendaStore.ts @@ -1,4 +1,4 @@ -import {DefineOptions as AgendaDefineOptions, JobOptions} from "agenda"; +import type {DefineOptions as AgendaDefineOptions, JobOptions} from "agenda"; export interface DefineOptions extends AgendaDefineOptions { name?: string; diff --git a/packages/third-parties/agenda/src/interfaces/interfaces.ts b/packages/third-parties/agenda/src/interfaces/interfaces.ts index 6b5be429074..9e1461a0b34 100644 --- a/packages/third-parties/agenda/src/interfaces/interfaces.ts +++ b/packages/third-parties/agenda/src/interfaces/interfaces.ts @@ -1,4 +1,4 @@ -import {AgendaConfig} from "agenda"; +import type {AgendaConfig} from "agenda"; declare global { namespace TsED { diff --git a/packages/third-parties/agenda/src/services/AgendaFactory.ts b/packages/third-parties/agenda/src/services/AgendaFactory.ts index caa9be68c7d..4806575dfb7 100644 --- a/packages/third-parties/agenda/src/services/AgendaFactory.ts +++ b/packages/third-parties/agenda/src/services/AgendaFactory.ts @@ -1,5 +1,6 @@ import {Configuration, registerProvider} from "@tsed/di"; -import {Agenda, AgendaConfig} from "agenda"; +import type {AgendaConfig} from "agenda"; +import {Agenda} from "agenda"; // create Alias to avoid confusing import between Agenda from "agenda" and Agenda decorator export const AgendaService = Agenda; diff --git a/packages/third-parties/agenda/test/agenda-define-manually.integration.spec.ts b/packages/third-parties/agenda/test/agenda-define-manually.integration.spec.ts index 3b61c57c716..907ee3c20b6 100644 --- a/packages/third-parties/agenda/test/agenda-define-manually.integration.spec.ts +++ b/packages/third-parties/agenda/test/agenda-define-manually.integration.spec.ts @@ -3,12 +3,12 @@ import {Inject} from "@tsed/di"; import {TestContainersMongo} from "@tsed/testcontainers-mongo"; import type {Job} from "agenda"; -import {Agenda, AgendaModule, AgendaService, Define} from ".."; +import {Agenda, AgendaModule, AgendaService, Define} from "../src/index.js"; import {Server} from "./helpers/Server.js"; @Agenda({namespace: "test-nsp"}) class Test { - @Inject() + @Inject(AgendaModule) agenda: AgendaModule; jobs: Job[]; diff --git a/packages/third-parties/agenda/test/helpers/Server.ts b/packages/third-parties/agenda/test/helpers/Server.ts index 8540e323d19..a89985a9b27 100644 --- a/packages/third-parties/agenda/test/helpers/Server.ts +++ b/packages/third-parties/agenda/test/helpers/Server.ts @@ -1,5 +1,5 @@ import "@tsed/platform-express"; -import "../.."; +import "../../index.ts"; import {Configuration, Inject, PlatformApplication} from "@tsed/common"; import bodyParser from "body-parser"; @@ -16,7 +16,7 @@ const rootDir = import.meta.dirname; httpsPort: false }) export class Server { - @Inject() + @Inject(PlatformApplication) app: PlatformApplication; public $beforeRoutesInit(): void { diff --git a/packages/third-parties/agenda/tsconfig.esm.json b/packages/third-parties/agenda/tsconfig.esm.json index 82292550ddb..8954049da4a 100644 --- a/packages/third-parties/agenda/tsconfig.esm.json +++ b/packages/third-parties/agenda/tsconfig.esm.json @@ -2,7 +2,6 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", diff --git a/packages/third-parties/agenda/tsconfig.spec.json b/packages/third-parties/agenda/tsconfig.spec.json index 9835f975711..0ea8df58648 100644 --- a/packages/third-parties/agenda/tsconfig.spec.json +++ b/packages/third-parties/agenda/tsconfig.spec.json @@ -3,31 +3,31 @@ "compilerOptions": { "baseUrl": ".", "rootDir": "../..", - "outDir": "./lib/cjs", "declaration": false, "composite": false, "noEmit": true, "paths": { - "@tsed/openspec": ["../../specs/openspec/src"], - "@tsed/schema": ["../../specs/schema/src"], - "@tsed/di": ["../../di/src"], - "@tsed/exceptions": ["../../specs/exceptions/src"], - "@tsed/json-mapper": ["../../specs/json-mapper/src"], - "@tsed/platform-exceptions": ["../../platform/platform-exceptions/src"], - "@tsed/platform-middlewares": ["../../platform/platform-middlewares/src"], - "@tsed/platform-params": ["../../platform/platform-params/src"], - "@tsed/platform-log-middleware": ["../../platform/platform-log-middleware/src"], - "@tsed/platform-response-filter": ["../../platform/platform-response-filter/src"], - "@tsed/platform-router": ["../../platform/platform-router/src"], - "@tsed/platform-views": ["../../platform/platform-views/src"], - "@tsed/components-scan": ["../components-scan/src"], - "@tsed/common": ["../../platform/common/src"], - "@tsed/ajv": ["../../specs/ajv/src"], - "@tsed/platform-cache": ["../../platform/platform-cache/src"], - "@tsed/swagger": ["../../specs/swagger/src"], - "@tsed/platform-test-sdk": ["../../platform/platform-test-sdk/src"], - "@tsed/platform-express": ["../../platform/platform-express/src"], - "@tsed/platform-koa": ["../../platform/platform-koa/src"] + "@tsed/openspec": ["../../specs/openspec/src/index.ts"], + "@tsed/schema": ["../../specs/schema/src/index.ts"], + "@tsed/di": ["../../di/src/index.ts"], + "@tsed/exceptions": ["../../specs/exceptions/src/index.ts"], + "@tsed/json-mapper": ["../../specs/json-mapper/src/index.ts"], + "@tsed/platform-exceptions": ["../../platform/platform-exceptions/src/index.ts"], + "@tsed/platform-middlewares": ["../../platform/platform-middlewares/src/index.ts"], + "@tsed/platform-params": ["../../platform/platform-params/src/index.ts"], + "@tsed/platform-log-middleware": ["../../platform/platform-log-middleware/src/index.ts"], + "@tsed/platform-response-filter": ["../../platform/platform-response-filter/src/index.ts"], + "@tsed/platform-router": ["../../platform/platform-router/src/index.ts"], + "@tsed/platform-views": ["../../platform/platform-views/src/index.ts"], + "@tsed/normalize-path": ["../../utils/normalize-path/src/index.ts"], + "@tsed/components-scan": ["../components-scan/src/index.ts"], + "@tsed/common": ["../../platform/common/src/index.ts"], + "@tsed/ajv": ["../../specs/ajv/src/index.ts"], + "@tsed/platform-cache": ["../../platform/platform-cache/src/index.ts"], + "@tsed/swagger": ["../../specs/swagger/src/index.ts"], + "@tsed/platform-test-sdk": ["../../platform/platform-test-sdk/src/index.ts"], + "@tsed/platform-express": ["../../platform/platform-express/src/index.ts"], + "@tsed/platform-koa": ["../../platform/platform-koa/src/index.ts"] }, "types": ["vite/client", "vitest/globals"] }, diff --git a/packages/third-parties/bullmq/package.json b/packages/third-parties/bullmq/package.json index 53d4eb4894a..b6fcb92dc5f 100644 --- a/packages/third-parties/bullmq/package.json +++ b/packages/third-parties/bullmq/package.json @@ -15,7 +15,7 @@ ".": { "types": "./lib/types/index.d.ts", "import": "./lib/esm/index.js", - "default": "./lib/cjs/index.js" + "default": "./lib/esm/index.js" } }, "scripts": { diff --git a/packages/third-parties/bullmq/src/BullMQModule.spec.ts b/packages/third-parties/bullmq/src/BullMQModule.spec.ts index db652544f17..f723b84dc97 100644 --- a/packages/third-parties/bullmq/src/BullMQModule.spec.ts +++ b/packages/third-parties/bullmq/src/BullMQModule.spec.ts @@ -7,7 +7,7 @@ import {anything, instance, mock, verify, when} from "ts-mockito"; import {BullMQModule} from "./BullMQModule.js"; import {type BullMQConfig} from "./config/config.js"; -import {JobMethods} from "./contracts/index.js"; +import type {JobMethods} from "./contracts/index.js"; import {FallbackJobController, JobController} from "./decorators/index.js"; import {InjectQueue} from "./decorators/InjectQueue.js"; import {InjectWorker} from "./decorators/InjectWorker.js"; diff --git a/packages/third-parties/bullmq/src/BullMQModule.ts b/packages/third-parties/bullmq/src/BullMQModule.ts index 3a91b3c714e..eb9bfd944a5 100644 --- a/packages/third-parties/bullmq/src/BullMQModule.ts +++ b/packages/third-parties/bullmq/src/BullMQModule.ts @@ -1,13 +1,13 @@ -import {BeforeInit, DIContext, OnDestroy, runInContext} from "@tsed/common"; -import {InjectorService, Module} from "@tsed/di"; +import type {BeforeInit} from "@tsed/common"; +import {DIContext, Inject, InjectorService, Module, type OnDestroy, runInContext} from "@tsed/di"; import {getComputedType} from "@tsed/schema"; -import {Job, Queue, Worker} from "bullmq"; +import type {Job, Queue, Worker} from "bullmq"; import {v4} from "uuid"; -import {BullMQConfig} from "./config/config.js"; +import type {BullMQConfig} from "./config/config.js"; import {BullMQTypes} from "./constants/BullMQTypes.js"; import {BULLMQ} from "./constants/constants.js"; -import {JobMethods, JobStore} from "./contracts/index.js"; +import type {JobMethods, JobStore} from "./contracts/index.js"; import {JobDispatcher} from "./dispatchers/index.js"; import {createQueueProvider} from "./utils/createQueueProvider.js"; import {createWorkerProvider} from "./utils/createWorkerProvider.js"; @@ -17,10 +17,13 @@ import {mapWorkerOptions} from "./utils/mapWorkerOptions.js"; @Module() export class BullMQModule implements BeforeInit, OnDestroy { - constructor( - private readonly injector: InjectorService, - private readonly dispatcher: JobDispatcher - ) { + @Inject(InjectorService) + private readonly injector: InjectorService; + + @Inject(JobDispatcher) + private readonly dispatcher: JobDispatcher; + + constructor() { // build providers allow @Inject(queue) usage in JobController instance if (this.isEnabled()) { const queues = [...this.getUniqQueueNames()]; diff --git a/packages/third-parties/bullmq/src/contracts/JobMethods.ts b/packages/third-parties/bullmq/src/contracts/JobMethods.ts index 2eeec56d9c6..241cd68e52b 100644 --- a/packages/third-parties/bullmq/src/contracts/JobMethods.ts +++ b/packages/third-parties/bullmq/src/contracts/JobMethods.ts @@ -1,4 +1,4 @@ -import {Job} from "bullmq"; +import type {Job} from "bullmq"; export interface JobMethods { handle(payload: DataType, job: Job): ReturnType | Promise; diff --git a/packages/third-parties/bullmq/src/contracts/JobStore.ts b/packages/third-parties/bullmq/src/contracts/JobStore.ts index 2fd654421ee..9afe878fed6 100644 --- a/packages/third-parties/bullmq/src/contracts/JobStore.ts +++ b/packages/third-parties/bullmq/src/contracts/JobStore.ts @@ -1,4 +1,4 @@ -import {JobsOptions} from "bullmq"; +import type {JobsOptions} from "bullmq"; export interface JobStore { name: string; diff --git a/packages/third-parties/bullmq/src/decorators/JobController.ts b/packages/third-parties/bullmq/src/decorators/JobController.ts index 6ea87966c7c..decae64621e 100644 --- a/packages/third-parties/bullmq/src/decorators/JobController.ts +++ b/packages/third-parties/bullmq/src/decorators/JobController.ts @@ -1,6 +1,6 @@ import {StoreMerge, useDecorators} from "@tsed/core"; import {Injectable} from "@tsed/di"; -import {JobsOptions} from "bullmq"; +import type {JobsOptions} from "bullmq"; import {BullMQTypes} from "../constants/BullMQTypes.js"; import {BULLMQ} from "../constants/constants.js"; diff --git a/packages/third-parties/bullmq/src/dispatchers/JobDispatcher.spec.ts b/packages/third-parties/bullmq/src/dispatchers/JobDispatcher.spec.ts index 679f69d273b..ff597659c88 100644 --- a/packages/third-parties/bullmq/src/dispatchers/JobDispatcher.spec.ts +++ b/packages/third-parties/bullmq/src/dispatchers/JobDispatcher.spec.ts @@ -2,7 +2,7 @@ import {InjectorService} from "@tsed/di"; import {Queue} from "bullmq"; import {anything, capture, instance, mock, objectContaining, spy, verify, when} from "ts-mockito"; -import {JobMethods} from "../contracts/index.js"; +import type {JobMethods} from "../contracts/index.js"; import {JobController} from "../decorators/index.js"; import {JobDispatcher} from "./JobDispatcher.js"; @@ -32,6 +32,9 @@ describe("JobDispatcher", () => { let queue: Queue; let dispatcher: JobDispatcher; beforeEach(() => { + // TODO rewrite all test to avoid mockito usage. Isn't easy to maintain it! + // Also mock injector service isn't a good idea. We should use a PlatformTest.invoke to create test context correctly. + injector = mock(InjectorService); queue = mock(Queue); when(queue.name).thenReturn("default"); diff --git a/packages/third-parties/bullmq/src/dispatchers/JobDispatcher.ts b/packages/third-parties/bullmq/src/dispatchers/JobDispatcher.ts index 355158ccf76..b02454b0cef 100644 --- a/packages/third-parties/bullmq/src/dispatchers/JobDispatcher.ts +++ b/packages/third-parties/bullmq/src/dispatchers/JobDispatcher.ts @@ -1,16 +1,21 @@ -import {Store, Type} from "@tsed/core"; -import {Injectable, InjectorService} from "@tsed/di"; -import {Job as BullMQJob, JobsOptions, Queue} from "bullmq"; +import type {Type} from "@tsed/core"; +import {Store} from "@tsed/core"; +import {Inject, Injectable, InjectorService} from "@tsed/di"; +import type {Job as BullMQJob, JobsOptions, Queue} from "bullmq"; import {BULLMQ} from "../constants/constants.js"; -import {JobMethods, type JobStore} from "../contracts/index.js"; +import type {JobMethods} from "../contracts/index.js"; +import {type JobStore} from "../contracts/index.js"; import {getJobToken} from "../utils/getJobToken.js"; import {getQueueToken} from "../utils/getQueueToken.js"; import type {JobDispatcherOptions} from "./JobDispatcherOptions.js"; @Injectable() export class JobDispatcher { - constructor(private readonly injector: InjectorService) {} + constructor( + @Inject(InjectorService) + private readonly injector: InjectorService + ) {} public async dispatch( job: Type, diff --git a/packages/third-parties/bullmq/src/utils/createQueueProvider.ts b/packages/third-parties/bullmq/src/utils/createQueueProvider.ts index 29aa7ae655c..47dd8887fe2 100644 --- a/packages/third-parties/bullmq/src/utils/createQueueProvider.ts +++ b/packages/third-parties/bullmq/src/utils/createQueueProvider.ts @@ -1,5 +1,6 @@ -import {InjectorService} from "@tsed/di"; -import {Queue, QueueOptions} from "bullmq"; +import type {InjectorService} from "@tsed/di"; +import type {QueueOptions} from "bullmq"; +import {Queue} from "bullmq"; import {BullMQTypes} from "../constants/BullMQTypes.js"; import {getQueueToken} from "./getQueueToken.js"; diff --git a/packages/third-parties/bullmq/src/utils/createWorkerProvider.ts b/packages/third-parties/bullmq/src/utils/createWorkerProvider.ts index 4b9fa3aac51..7df0c7dabcb 100644 --- a/packages/third-parties/bullmq/src/utils/createWorkerProvider.ts +++ b/packages/third-parties/bullmq/src/utils/createWorkerProvider.ts @@ -1,5 +1,6 @@ -import {InjectorService} from "@tsed/di"; -import {Job, Worker, WorkerOptions} from "bullmq"; +import type {InjectorService} from "@tsed/di"; +import type {Job, WorkerOptions} from "bullmq"; +import {Worker} from "bullmq"; import {BullMQTypes} from "../constants/BullMQTypes.js"; import {getWorkerToken} from "./getWorkerToken.js"; diff --git a/packages/third-parties/bullmq/src/utils/mapQueueOptions.ts b/packages/third-parties/bullmq/src/utils/mapQueueOptions.ts index a8bf5dd757f..cb0e0a39888 100644 --- a/packages/third-parties/bullmq/src/utils/mapQueueOptions.ts +++ b/packages/third-parties/bullmq/src/utils/mapQueueOptions.ts @@ -1,7 +1,7 @@ import {deepMerge} from "@tsed/core"; import type {QueueOptions} from "bullmq"; -import {BullMQConfig} from "../config/config.js"; +import type {BullMQConfig} from "../config/config.js"; export function mapQueueOptions(queue: string, bullMQConfig: BullMQConfig): QueueOptions { return deepMerge( diff --git a/packages/third-parties/bullmq/src/utils/mapWorkerOptions.ts b/packages/third-parties/bullmq/src/utils/mapWorkerOptions.ts index ca8440c371c..e7224f8e941 100644 --- a/packages/third-parties/bullmq/src/utils/mapWorkerOptions.ts +++ b/packages/third-parties/bullmq/src/utils/mapWorkerOptions.ts @@ -1,7 +1,7 @@ import {deepMerge} from "@tsed/core"; import type {WorkerOptions} from "bullmq"; -import {BullMQConfig} from "../config/config.js"; +import type {BullMQConfig} from "../config/config.js"; export function mapWorkerOptions(queue: string, bullMQConfig: BullMQConfig): WorkerOptions { return deepMerge( diff --git a/packages/third-parties/bullmq/tsconfig.esm.json b/packages/third-parties/bullmq/tsconfig.esm.json index 82292550ddb..8954049da4a 100644 --- a/packages/third-parties/bullmq/tsconfig.esm.json +++ b/packages/third-parties/bullmq/tsconfig.esm.json @@ -2,7 +2,6 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", diff --git a/packages/third-parties/bullmq/tsconfig.spec.json b/packages/third-parties/bullmq/tsconfig.spec.json index 9835f975711..0ea8df58648 100644 --- a/packages/third-parties/bullmq/tsconfig.spec.json +++ b/packages/third-parties/bullmq/tsconfig.spec.json @@ -3,31 +3,31 @@ "compilerOptions": { "baseUrl": ".", "rootDir": "../..", - "outDir": "./lib/cjs", "declaration": false, "composite": false, "noEmit": true, "paths": { - "@tsed/openspec": ["../../specs/openspec/src"], - "@tsed/schema": ["../../specs/schema/src"], - "@tsed/di": ["../../di/src"], - "@tsed/exceptions": ["../../specs/exceptions/src"], - "@tsed/json-mapper": ["../../specs/json-mapper/src"], - "@tsed/platform-exceptions": ["../../platform/platform-exceptions/src"], - "@tsed/platform-middlewares": ["../../platform/platform-middlewares/src"], - "@tsed/platform-params": ["../../platform/platform-params/src"], - "@tsed/platform-log-middleware": ["../../platform/platform-log-middleware/src"], - "@tsed/platform-response-filter": ["../../platform/platform-response-filter/src"], - "@tsed/platform-router": ["../../platform/platform-router/src"], - "@tsed/platform-views": ["../../platform/platform-views/src"], - "@tsed/components-scan": ["../components-scan/src"], - "@tsed/common": ["../../platform/common/src"], - "@tsed/ajv": ["../../specs/ajv/src"], - "@tsed/platform-cache": ["../../platform/platform-cache/src"], - "@tsed/swagger": ["../../specs/swagger/src"], - "@tsed/platform-test-sdk": ["../../platform/platform-test-sdk/src"], - "@tsed/platform-express": ["../../platform/platform-express/src"], - "@tsed/platform-koa": ["../../platform/platform-koa/src"] + "@tsed/openspec": ["../../specs/openspec/src/index.ts"], + "@tsed/schema": ["../../specs/schema/src/index.ts"], + "@tsed/di": ["../../di/src/index.ts"], + "@tsed/exceptions": ["../../specs/exceptions/src/index.ts"], + "@tsed/json-mapper": ["../../specs/json-mapper/src/index.ts"], + "@tsed/platform-exceptions": ["../../platform/platform-exceptions/src/index.ts"], + "@tsed/platform-middlewares": ["../../platform/platform-middlewares/src/index.ts"], + "@tsed/platform-params": ["../../platform/platform-params/src/index.ts"], + "@tsed/platform-log-middleware": ["../../platform/platform-log-middleware/src/index.ts"], + "@tsed/platform-response-filter": ["../../platform/platform-response-filter/src/index.ts"], + "@tsed/platform-router": ["../../platform/platform-router/src/index.ts"], + "@tsed/platform-views": ["../../platform/platform-views/src/index.ts"], + "@tsed/normalize-path": ["../../utils/normalize-path/src/index.ts"], + "@tsed/components-scan": ["../components-scan/src/index.ts"], + "@tsed/common": ["../../platform/common/src/index.ts"], + "@tsed/ajv": ["../../specs/ajv/src/index.ts"], + "@tsed/platform-cache": ["../../platform/platform-cache/src/index.ts"], + "@tsed/swagger": ["../../specs/swagger/src/index.ts"], + "@tsed/platform-test-sdk": ["../../platform/platform-test-sdk/src/index.ts"], + "@tsed/platform-express": ["../../platform/platform-express/src/index.ts"], + "@tsed/platform-koa": ["../../platform/platform-koa/src/index.ts"] }, "types": ["vite/client", "vitest/globals"] }, diff --git a/packages/third-parties/components-scan/package.json b/packages/third-parties/components-scan/package.json index 10a41594783..9f1fd2b1270 100644 --- a/packages/third-parties/components-scan/package.json +++ b/packages/third-parties/components-scan/package.json @@ -11,7 +11,7 @@ ".": { "types": "./lib/types/index.d.ts", "import": "./lib/esm/index.js", - "default": "./lib/cjs/index.js" + "default": "./lib/esm/index.js" } }, "scripts": { diff --git a/packages/third-parties/components-scan/tsconfig.esm.json b/packages/third-parties/components-scan/tsconfig.esm.json index 82292550ddb..8954049da4a 100644 --- a/packages/third-parties/components-scan/tsconfig.esm.json +++ b/packages/third-parties/components-scan/tsconfig.esm.json @@ -2,7 +2,6 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", diff --git a/packages/third-parties/components-scan/tsconfig.spec.json b/packages/third-parties/components-scan/tsconfig.spec.json index e98b907f173..ca17668db5b 100644 --- a/packages/third-parties/components-scan/tsconfig.spec.json +++ b/packages/third-parties/components-scan/tsconfig.spec.json @@ -3,30 +3,30 @@ "compilerOptions": { "baseUrl": ".", "rootDir": "../..", - "outDir": "./lib/cjs", "declaration": false, "composite": false, "noEmit": true, "paths": { - "@tsed/openspec": ["../../specs/openspec/src"], - "@tsed/schema": ["../../specs/schema/src"], - "@tsed/di": ["../../di/src"], - "@tsed/exceptions": ["../../specs/exceptions/src"], - "@tsed/json-mapper": ["../../specs/json-mapper/src"], - "@tsed/platform-exceptions": ["../../platform/platform-exceptions/src"], - "@tsed/platform-middlewares": ["../../platform/platform-middlewares/src"], - "@tsed/platform-params": ["../../platform/platform-params/src"], - "@tsed/platform-log-middleware": ["../../platform/platform-log-middleware/src"], - "@tsed/platform-response-filter": ["../../platform/platform-response-filter/src"], - "@tsed/platform-router": ["../../platform/platform-router/src"], - "@tsed/platform-views": ["../../platform/platform-views/src"], - "@tsed/common": ["../../platform/common/src"], - "@tsed/ajv": ["../../specs/ajv/src"], - "@tsed/platform-cache": ["../../platform/platform-cache/src"], - "@tsed/swagger": ["../../specs/swagger/src"], - "@tsed/platform-test-sdk": ["../../platform/platform-test-sdk/src"], - "@tsed/platform-express": ["../../platform/platform-express/src"], - "@tsed/platform-koa": ["../../platform/platform-koa/src"] + "@tsed/openspec": ["../../specs/openspec/src/index.ts"], + "@tsed/schema": ["../../specs/schema/src/index.ts"], + "@tsed/di": ["../../di/src/index.ts"], + "@tsed/exceptions": ["../../specs/exceptions/src/index.ts"], + "@tsed/json-mapper": ["../../specs/json-mapper/src/index.ts"], + "@tsed/platform-exceptions": ["../../platform/platform-exceptions/src/index.ts"], + "@tsed/platform-middlewares": ["../../platform/platform-middlewares/src/index.ts"], + "@tsed/platform-params": ["../../platform/platform-params/src/index.ts"], + "@tsed/platform-log-middleware": ["../../platform/platform-log-middleware/src/index.ts"], + "@tsed/platform-response-filter": ["../../platform/platform-response-filter/src/index.ts"], + "@tsed/platform-router": ["../../platform/platform-router/src/index.ts"], + "@tsed/platform-views": ["../../platform/platform-views/src/index.ts"], + "@tsed/normalize-path": ["../../utils/normalize-path/src/index.ts"], + "@tsed/common": ["../../platform/common/src/index.ts"], + "@tsed/ajv": ["../../specs/ajv/src/index.ts"], + "@tsed/platform-cache": ["../../platform/platform-cache/src/index.ts"], + "@tsed/swagger": ["../../specs/swagger/src/index.ts"], + "@tsed/platform-test-sdk": ["../../platform/platform-test-sdk/src/index.ts"], + "@tsed/platform-express": ["../../platform/platform-express/src/index.ts"], + "@tsed/platform-koa": ["../../platform/platform-koa/src/index.ts"] }, "types": ["vite/client", "vitest/globals"] }, diff --git a/packages/third-parties/event-emitter/package.json b/packages/third-parties/event-emitter/package.json index 398af29fac5..20ed6636cda 100644 --- a/packages/third-parties/event-emitter/package.json +++ b/packages/third-parties/event-emitter/package.json @@ -18,7 +18,7 @@ "types": "./lib/types/index.d.ts", "browser": "./lib/browser/event-emitter.umd.min.js", "import": "./lib/esm/index.js", - "default": "./lib/cjs/index.js" + "default": "./lib/esm/index.js" } }, "scripts": { diff --git a/packages/third-parties/event-emitter/src/EventEmitterModule.ts b/packages/third-parties/event-emitter/src/EventEmitterModule.ts index fe0aefddf7a..443edae19b6 100644 --- a/packages/third-parties/event-emitter/src/EventEmitterModule.ts +++ b/packages/third-parties/event-emitter/src/EventEmitterModule.ts @@ -1,7 +1,7 @@ -import {Constant, Inject, InjectorService, LOGGER, Module, Provider} from "@tsed/di"; -import {ListenerFn} from "eventemitter2"; +import {Constant, Inject, InjectorService, LOGGER, Module, type Provider} from "@tsed/di"; +import type {ListenerFn} from "eventemitter2"; -import {EventEmitterStore} from "./interfaces/EventEmitterStore.js"; +import type {EventEmitterStore} from "./interfaces/EventEmitterStore.js"; import {EventEmitterService} from "./services/EventEmitterFactory.js"; @Module() @@ -9,10 +9,10 @@ export class EventEmitterModule { @Inject(LOGGER) protected logger: LOGGER; - @Inject() + @Inject(InjectorService) protected injector: InjectorService; - @Inject() + @Inject(EventEmitterService) protected eventEmitter: EventEmitterService; @Constant("eventEmitter.disableSummary", false) diff --git a/packages/third-parties/event-emitter/src/decorators/onAny.ts b/packages/third-parties/event-emitter/src/decorators/onAny.ts index 877bfc23e90..317928341a2 100644 --- a/packages/third-parties/event-emitter/src/decorators/onAny.ts +++ b/packages/third-parties/event-emitter/src/decorators/onAny.ts @@ -1,6 +1,6 @@ import {Store} from "@tsed/core"; -import {EventEmitterStore} from "../interfaces/EventEmitterStore.js"; +import type {EventEmitterStore} from "../interfaces/EventEmitterStore.js"; export function OnAny(): MethodDecorator { return (target: any, propertyKey: string) => { diff --git a/packages/third-parties/event-emitter/src/decorators/onEvent.ts b/packages/third-parties/event-emitter/src/decorators/onEvent.ts index 1d58809a3ad..6951605b979 100644 --- a/packages/third-parties/event-emitter/src/decorators/onEvent.ts +++ b/packages/third-parties/event-emitter/src/decorators/onEvent.ts @@ -1,7 +1,7 @@ import {Store} from "@tsed/core"; -import {event, eventNS, OnOptions} from "eventemitter2"; +import type {event, eventNS, OnOptions} from "eventemitter2"; -import {EventEmitterStore} from "../interfaces/EventEmitterStore.js"; +import type {EventEmitterStore} from "../interfaces/EventEmitterStore.js"; export function OnEvent(event: event | eventNS, options?: boolean | OnOptions): MethodDecorator { return (target: any, propertyKey: string) => { diff --git a/packages/third-parties/event-emitter/src/interfaces/EventEmitterStore.ts b/packages/third-parties/event-emitter/src/interfaces/EventEmitterStore.ts index 31b799809e4..7072702c158 100644 --- a/packages/third-parties/event-emitter/src/interfaces/EventEmitterStore.ts +++ b/packages/third-parties/event-emitter/src/interfaces/EventEmitterStore.ts @@ -1,4 +1,4 @@ -import {event, eventNS, OnOptions} from "eventemitter2"; +import type {event, eventNS, OnOptions} from "eventemitter2"; export interface EventEmitterStore { onEvent?: {[propertyKey: string]: {event: event | eventNS; options?: boolean | OnOptions}}; diff --git a/packages/third-parties/event-emitter/src/interfaces/interfaces.ts b/packages/third-parties/event-emitter/src/interfaces/interfaces.ts index 1b27de57fd6..0dbc954a72d 100644 --- a/packages/third-parties/event-emitter/src/interfaces/interfaces.ts +++ b/packages/third-parties/event-emitter/src/interfaces/interfaces.ts @@ -1,4 +1,4 @@ -import {ConstructorOptions} from "eventemitter2"; +import type {ConstructorOptions} from "eventemitter2"; declare global { namespace TsED { diff --git a/packages/third-parties/event-emitter/test/helpers/Server.ts b/packages/third-parties/event-emitter/test/helpers/Server.ts index a9f408cc517..44da2544908 100644 --- a/packages/third-parties/event-emitter/test/helpers/Server.ts +++ b/packages/third-parties/event-emitter/test/helpers/Server.ts @@ -1,7 +1,8 @@ import "@tsed/platform-express"; import "../../src/EventEmitterModule.js"; -import {Configuration, Inject, PlatformApplication} from "@tsed/common"; +import {PlatformApplication} from "@tsed/common"; +import {Configuration, Inject} from "@tsed/common"; import bodyParser from "body-parser"; import compress from "compression"; import cookieParser from "cookie-parser"; @@ -16,7 +17,7 @@ const rootDir = import.meta.dirname; httpsPort: false }) export class Server { - @Inject() + @Inject(PlatformApplication) app: PlatformApplication; public $beforeRoutesInit(): void { diff --git a/packages/third-parties/event-emitter/tsconfig.esm.json b/packages/third-parties/event-emitter/tsconfig.esm.json index 82292550ddb..8954049da4a 100644 --- a/packages/third-parties/event-emitter/tsconfig.esm.json +++ b/packages/third-parties/event-emitter/tsconfig.esm.json @@ -2,7 +2,6 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", diff --git a/packages/third-parties/event-emitter/tsconfig.spec.json b/packages/third-parties/event-emitter/tsconfig.spec.json index 9835f975711..0ea8df58648 100644 --- a/packages/third-parties/event-emitter/tsconfig.spec.json +++ b/packages/third-parties/event-emitter/tsconfig.spec.json @@ -3,31 +3,31 @@ "compilerOptions": { "baseUrl": ".", "rootDir": "../..", - "outDir": "./lib/cjs", "declaration": false, "composite": false, "noEmit": true, "paths": { - "@tsed/openspec": ["../../specs/openspec/src"], - "@tsed/schema": ["../../specs/schema/src"], - "@tsed/di": ["../../di/src"], - "@tsed/exceptions": ["../../specs/exceptions/src"], - "@tsed/json-mapper": ["../../specs/json-mapper/src"], - "@tsed/platform-exceptions": ["../../platform/platform-exceptions/src"], - "@tsed/platform-middlewares": ["../../platform/platform-middlewares/src"], - "@tsed/platform-params": ["../../platform/platform-params/src"], - "@tsed/platform-log-middleware": ["../../platform/platform-log-middleware/src"], - "@tsed/platform-response-filter": ["../../platform/platform-response-filter/src"], - "@tsed/platform-router": ["../../platform/platform-router/src"], - "@tsed/platform-views": ["../../platform/platform-views/src"], - "@tsed/components-scan": ["../components-scan/src"], - "@tsed/common": ["../../platform/common/src"], - "@tsed/ajv": ["../../specs/ajv/src"], - "@tsed/platform-cache": ["../../platform/platform-cache/src"], - "@tsed/swagger": ["../../specs/swagger/src"], - "@tsed/platform-test-sdk": ["../../platform/platform-test-sdk/src"], - "@tsed/platform-express": ["../../platform/platform-express/src"], - "@tsed/platform-koa": ["../../platform/platform-koa/src"] + "@tsed/openspec": ["../../specs/openspec/src/index.ts"], + "@tsed/schema": ["../../specs/schema/src/index.ts"], + "@tsed/di": ["../../di/src/index.ts"], + "@tsed/exceptions": ["../../specs/exceptions/src/index.ts"], + "@tsed/json-mapper": ["../../specs/json-mapper/src/index.ts"], + "@tsed/platform-exceptions": ["../../platform/platform-exceptions/src/index.ts"], + "@tsed/platform-middlewares": ["../../platform/platform-middlewares/src/index.ts"], + "@tsed/platform-params": ["../../platform/platform-params/src/index.ts"], + "@tsed/platform-log-middleware": ["../../platform/platform-log-middleware/src/index.ts"], + "@tsed/platform-response-filter": ["../../platform/platform-response-filter/src/index.ts"], + "@tsed/platform-router": ["../../platform/platform-router/src/index.ts"], + "@tsed/platform-views": ["../../platform/platform-views/src/index.ts"], + "@tsed/normalize-path": ["../../utils/normalize-path/src/index.ts"], + "@tsed/components-scan": ["../components-scan/src/index.ts"], + "@tsed/common": ["../../platform/common/src/index.ts"], + "@tsed/ajv": ["../../specs/ajv/src/index.ts"], + "@tsed/platform-cache": ["../../platform/platform-cache/src/index.ts"], + "@tsed/swagger": ["../../specs/swagger/src/index.ts"], + "@tsed/platform-test-sdk": ["../../platform/platform-test-sdk/src/index.ts"], + "@tsed/platform-express": ["../../platform/platform-express/src/index.ts"], + "@tsed/platform-koa": ["../../platform/platform-koa/src/index.ts"] }, "types": ["vite/client", "vitest/globals"] }, diff --git a/packages/third-parties/formio-types/package.json b/packages/third-parties/formio-types/package.json index ca8920ac303..1d9f90b7809 100644 --- a/packages/third-parties/formio-types/package.json +++ b/packages/third-parties/formio-types/package.json @@ -19,7 +19,7 @@ ".": { "types": "./lib/types/index.d.ts", "import": "./lib/esm/index.js", - "default": "./lib/cjs/index.js" + "default": "./lib/esm/index.js" } }, "scripts": { diff --git a/packages/third-parties/formio-types/src/domain/FormioComponent.ts b/packages/third-parties/formio-types/src/domain/FormioComponent.ts index 721e8495a40..ff807b417e5 100644 --- a/packages/third-parties/formio-types/src/domain/FormioComponent.ts +++ b/packages/third-parties/formio-types/src/domain/FormioComponent.ts @@ -1,6 +1,6 @@ import type {ExtendedComponentSchema} from "formiojs"; -import {FormioForm} from "./FormioForm.js"; +import type {FormioForm} from "./FormioForm.js"; export interface FormioComponent extends ExtendedComponentSchema { type: string; diff --git a/packages/third-parties/formio-types/src/domain/FormioForm.ts b/packages/third-parties/formio-types/src/domain/FormioForm.ts index 5e1b02e7a35..e3e872f857f 100644 --- a/packages/third-parties/formio-types/src/domain/FormioForm.ts +++ b/packages/third-parties/formio-types/src/domain/FormioForm.ts @@ -1,5 +1,5 @@ -import {FormioComponent} from "./FormioComponent.js"; -import {FormioPermission} from "./FormioPermission.js"; +import type {FormioComponent} from "./FormioComponent.js"; +import type {FormioPermission} from "./FormioPermission.js"; export interface FormioForm extends Record { _id: string | undefined; diff --git a/packages/third-parties/formio-types/src/domain/FormioSubmission.ts b/packages/third-parties/formio-types/src/domain/FormioSubmission.ts index 81f70ecbd93..7817a990f7f 100644 --- a/packages/third-parties/formio-types/src/domain/FormioSubmission.ts +++ b/packages/third-parties/formio-types/src/domain/FormioSubmission.ts @@ -1,4 +1,4 @@ -import {FormioAccess} from "./FormioAccess.js"; +import type {FormioAccess} from "./FormioAccess.js"; export interface FormioSubmission extends Record { _id: string | undefined; diff --git a/packages/third-parties/formio-types/tsconfig.esm.json b/packages/third-parties/formio-types/tsconfig.esm.json index 82292550ddb..8954049da4a 100644 --- a/packages/third-parties/formio-types/tsconfig.esm.json +++ b/packages/third-parties/formio-types/tsconfig.esm.json @@ -2,7 +2,6 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", diff --git a/packages/third-parties/formio/package.json b/packages/third-parties/formio/package.json index 4d1c24a8b57..6d130ec67d1 100644 --- a/packages/third-parties/formio/package.json +++ b/packages/third-parties/formio/package.json @@ -19,7 +19,7 @@ ".": { "types": "./lib/types/index.d.ts", "import": "./lib/esm/index.js", - "default": "./lib/cjs/index.js" + "default": "./lib/esm/index.js" } }, "scripts": { diff --git a/packages/third-parties/formio/src/FormioModule.spec.ts b/packages/third-parties/formio/src/FormioModule.spec.ts index cfbd16c09ca..038cbfbc7a7 100644 --- a/packages/third-parties/formio/src/FormioModule.spec.ts +++ b/packages/third-parties/formio/src/FormioModule.spec.ts @@ -1,5 +1,6 @@ import {faker} from "@faker-js/faker"; -import {PlatformApplication, PlatformRouteDetails, PlatformTest} from "@tsed/common"; +import type {PlatformRouteDetails} from "@tsed/common"; +import {PlatformApplication, PlatformTest} from "@tsed/common"; import {FormioModule} from "./FormioModule.js"; import {FormioInstaller} from "./services/FormioInstaller.js"; diff --git a/packages/third-parties/formio/src/FormioModule.ts b/packages/third-parties/formio/src/FormioModule.ts index 4da3b0e8a89..66a64f032f1 100644 --- a/packages/third-parties/formio/src/FormioModule.ts +++ b/packages/third-parties/formio/src/FormioModule.ts @@ -1,6 +1,6 @@ -import {Constant, Inject, InjectorService, OnReady, OnRoutesInit, PlatformApplication, PlatformRouteDetails} from "@tsed/common"; +import {type OnReady, type OnRoutesInit, PlatformApplication, type PlatformRouteDetails} from "@tsed/common"; import {deepClone} from "@tsed/core"; -import {Module} from "@tsed/di"; +import {Constant, Inject, InjectorService, Module} from "@tsed/di"; import {normalizePath} from "@tsed/normalize-path"; import {AlterActions} from "./components/AlterActions.js"; @@ -10,8 +10,8 @@ import {AlterLog} from "./components/AlterLog.js"; import {AlterSkip} from "./components/AlterSkip.js"; import {AlterTemplateExportSteps} from "./components/AlterTemplateExportSteps.js"; import {AlterTemplateImportSteps} from "./components/AlterTemplateImportSteps.js"; -import {FormioConfig} from "./domain/FormioConfig.js"; -import {FormioTemplate} from "./domain/FormioTemplate.js"; +import type {FormioConfig} from "./domain/FormioConfig.js"; +import type {FormioTemplate} from "./domain/FormioTemplate.js"; import {FormioAuthService} from "./services/FormioAuthService.js"; import {FormioHooksService} from "./services/FormioHooksService.js"; import {FormioInstaller} from "./services/FormioInstaller.js"; @@ -32,19 +32,19 @@ import {FormioService} from "./services/FormioService.js"; ] }) export class FormioModule implements OnRoutesInit, OnReady { - @Inject() + @Inject(FormioService) protected formio: FormioService; - @Inject() + @Inject(FormioHooksService) protected hooks: FormioHooksService; - @Inject() + @Inject(FormioInstaller) protected installer: FormioInstaller; - @Inject() + @Inject(PlatformApplication) protected app: PlatformApplication; - @Inject() + @Inject(InjectorService) protected injector: InjectorService; @Constant("formio", {}) diff --git a/packages/third-parties/formio/src/builder/FormioMapper.spec.ts b/packages/third-parties/formio/src/builder/FormioMapper.spec.ts index 555efd39736..12bd8903e21 100644 --- a/packages/third-parties/formio/src/builder/FormioMapper.spec.ts +++ b/packages/third-parties/formio/src/builder/FormioMapper.spec.ts @@ -1,5 +1,5 @@ import {toMap as tMap} from "@tsed/core"; -import {MongooseDocument} from "@tsed/mongoose"; +import type {MongooseDocument} from "@tsed/mongoose"; import {FormioMapper} from "./FormioMapper.js"; diff --git a/packages/third-parties/formio/src/builder/FormioMapper.ts b/packages/third-parties/formio/src/builder/FormioMapper.ts index 983ab82507f..e89a740aa6a 100644 --- a/packages/third-parties/formio/src/builder/FormioMapper.ts +++ b/packages/third-parties/formio/src/builder/FormioMapper.ts @@ -1,4 +1,4 @@ -import {FormioCtxMapper} from "../domain/FormioCtxMapper.js"; +import type {FormioCtxMapper} from "../domain/FormioCtxMapper.js"; export class FormioMapper { constructor(readonly ctxData: FormioCtxMapper) {} diff --git a/packages/third-parties/formio/src/components/AlterActions.spec.ts b/packages/third-parties/formio/src/components/AlterActions.spec.ts index c389612cbae..47768442f33 100644 --- a/packages/third-parties/formio/src/components/AlterActions.spec.ts +++ b/packages/third-parties/formio/src/components/AlterActions.spec.ts @@ -1,11 +1,12 @@ -import {Context, PlatformContext, PlatformTest} from "@tsed/common"; +import type {PlatformContext} from "@tsed/common"; +import {Context, PlatformTest} from "@tsed/common"; import {BadRequest} from "@tsed/exceptions"; -import {FormioActionInfo, FormioComponent} from "@tsed/formio-types"; +import type {FormioActionInfo, FormioComponent} from "@tsed/formio-types"; import {Action} from "../decorators/action.js"; import {ActionCtx} from "../decorators/actionCtx.js"; -import {ActionMethods} from "../domain/FormioAction.js"; -import {FormioActions} from "../domain/FormioActionsIndex.js"; +import type {ActionMethods} from "../domain/FormioAction.js"; +import type {FormioActions} from "../domain/FormioActionsIndex.js"; import {FormioService} from "../services/FormioService.js"; import {AlterActions} from "./AlterActions.js"; diff --git a/packages/third-parties/formio/src/components/AlterActions.ts b/packages/third-parties/formio/src/components/AlterActions.ts index 6d4f5110327..2c6cfd18ea2 100644 --- a/packages/third-parties/formio/src/components/AlterActions.ts +++ b/packages/third-parties/formio/src/components/AlterActions.ts @@ -1,29 +1,30 @@ -import {PlatformContext, setResponseHeaders} from "@tsed/common"; +import type {PlatformContext} from "@tsed/common"; +import {setResponseHeaders} from "@tsed/common"; import {AnyToPromise, AnyToPromiseStatus} from "@tsed/core"; -import {Inject, InjectorService, Provider} from "@tsed/di"; -import {FormioActionInfo} from "@tsed/formio-types"; +import {Inject, InjectorService, type Provider} from "@tsed/di"; +import type {FormioActionInfo} from "@tsed/formio-types"; import {PlatformParams} from "@tsed/platform-params"; import {PlatformResponseFilter} from "@tsed/platform-response-filter"; import {EndpointMetadata} from "@tsed/schema"; import {Alter} from "../decorators/alter.js"; -import {AlterHook} from "../domain/AlterHook.js"; -import {SetActionItemMessage} from "../domain/FormioAction.js"; -import {FormioActions} from "../domain/FormioActionsIndex.js"; +import type {AlterHook} from "../domain/AlterHook.js"; +import type {SetActionItemMessage} from "../domain/FormioAction.js"; +import type {FormioActions} from "../domain/FormioActionsIndex.js"; import {FormioService} from "../services/FormioService.js"; @Alter("actions") export class AlterActions implements AlterHook { - @Inject() + @Inject(InjectorService) protected injector: InjectorService; - @Inject() + @Inject(FormioService) protected formio: FormioService; - @Inject() + @Inject(PlatformParams) protected params: PlatformParams; - @Inject() + @Inject(PlatformResponseFilter) protected responseFilter: PlatformResponseFilter; transform(actions: FormioActions): FormioActions { diff --git a/packages/third-parties/formio/src/components/AlterAudit.ts b/packages/third-parties/formio/src/components/AlterAudit.ts index 157de179f5f..f6392ffdc08 100644 --- a/packages/third-parties/formio/src/components/AlterAudit.ts +++ b/packages/third-parties/formio/src/components/AlterAudit.ts @@ -1,7 +1,7 @@ -import {DIContext} from "@tsed/di"; +import type {DIContext} from "@tsed/di"; import {Alter} from "../decorators/alter.js"; -import {AlterHook} from "../domain/AlterHook.js"; +import type {AlterHook} from "../domain/AlterHook.js"; @Alter("audit") export class AlterAudit implements AlterHook { diff --git a/packages/third-parties/formio/src/components/AlterHost.ts b/packages/third-parties/formio/src/components/AlterHost.ts index 47360232fed..5f654212062 100644 --- a/packages/third-parties/formio/src/components/AlterHost.ts +++ b/packages/third-parties/formio/src/components/AlterHost.ts @@ -1,7 +1,7 @@ -import {PlatformContext} from "@tsed/common"; +import type {PlatformContext} from "@tsed/common"; import {Alter} from "../decorators/alter.js"; -import {AlterHook} from "../domain/AlterHook.js"; +import type {AlterHook} from "../domain/AlterHook.js"; @Alter("host") export class AlterHost implements AlterHook { diff --git a/packages/third-parties/formio/src/components/AlterLog.ts b/packages/third-parties/formio/src/components/AlterLog.ts index f1e56e12399..768b4b07633 100644 --- a/packages/third-parties/formio/src/components/AlterLog.ts +++ b/packages/third-parties/formio/src/components/AlterLog.ts @@ -1,7 +1,7 @@ -import {PlatformContext} from "@tsed/common"; +import type {PlatformContext} from "@tsed/common"; import {Alter} from "../decorators/alter.js"; -import {AlterHook} from "../domain/AlterHook.js"; +import type {AlterHook} from "../domain/AlterHook.js"; @Alter("log") export class AlterLog implements AlterHook { diff --git a/packages/third-parties/formio/src/components/AlterSkip.ts b/packages/third-parties/formio/src/components/AlterSkip.ts index 7ee91a15f7d..47b6d143d58 100644 --- a/packages/third-parties/formio/src/components/AlterSkip.ts +++ b/packages/third-parties/formio/src/components/AlterSkip.ts @@ -1,8 +1,9 @@ -import {Constant, PlatformContext} from "@tsed/common"; +import type {PlatformContext} from "@tsed/common"; +import {Constant} from "@tsed/common"; import {normalizePath} from "@tsed/normalize-path"; import {Alter} from "../decorators/alter.js"; -import {AlterHook} from "../domain/AlterHook.js"; +import type {AlterHook} from "../domain/AlterHook.js"; @Alter("skip") export class AlterSkip implements AlterHook { diff --git a/packages/third-parties/formio/src/components/AlterTemplateExportSteps.ts b/packages/third-parties/formio/src/components/AlterTemplateExportSteps.ts index d55d84e8eec..7ebe32772bd 100644 --- a/packages/third-parties/formio/src/components/AlterTemplateExportSteps.ts +++ b/packages/third-parties/formio/src/components/AlterTemplateExportSteps.ts @@ -1,18 +1,18 @@ import {getValue} from "@tsed/core"; import {Inject} from "@tsed/di"; -import {MongooseDocument} from "@tsed/mongoose"; +import type {MongooseDocument} from "@tsed/mongoose"; import async from "async"; -import {FormioMapper} from "../builder/FormioMapper.js"; +import type {FormioMapper} from "../builder/FormioMapper.js"; import {Alter} from "../decorators/alter.js"; -import {AlterHook} from "../domain/AlterHook.js"; -import {FormioSubmission} from "../domain/FormioModels.js"; -import {FormioTemplate} from "../domain/FormioTemplate.js"; +import type {AlterHook} from "../domain/AlterHook.js"; +import type {FormioSubmission} from "../domain/FormioModels.js"; +import type {FormioTemplate} from "../domain/FormioTemplate.js"; import {FormioDatabase} from "../services/FormioDatabase.js"; @Alter("templateExportSteps") export class AlterTemplateExportSteps implements AlterHook { - @Inject() + @Inject(FormioDatabase) protected database: FormioDatabase; transform(queue: any[], template: FormioTemplate, map: any, options: any): any { diff --git a/packages/third-parties/formio/src/components/AlterTemplateImportSteps.ts b/packages/third-parties/formio/src/components/AlterTemplateImportSteps.ts index 4cbd5627b24..6bcf33eaece 100644 --- a/packages/third-parties/formio/src/components/AlterTemplateImportSteps.ts +++ b/packages/third-parties/formio/src/components/AlterTemplateImportSteps.ts @@ -1,16 +1,16 @@ import {Inject} from "@tsed/di"; import async from "async"; -import {FormioMapper} from "../builder/FormioMapper.js"; +import type {FormioMapper} from "../builder/FormioMapper.js"; import {Alter} from "../decorators/alter.js"; -import {AlterHook} from "../domain/AlterHook.js"; -import {FormioSubmission} from "../domain/FormioModels.js"; -import {FormioTemplate} from "../domain/FormioTemplate.js"; +import type {AlterHook} from "../domain/AlterHook.js"; +import type {FormioSubmission} from "../domain/FormioModels.js"; +import type {FormioTemplate} from "../domain/FormioTemplate.js"; import {FormioDatabase} from "../services/FormioDatabase.js"; @Alter("templateImportSteps") export class AlterTemplateImportSteps implements AlterHook { - @Inject() + @Inject(FormioDatabase) protected database: FormioDatabase; transform(queue: any[], install: Function, template: Partial): any { diff --git a/packages/third-parties/formio/src/decorators/action.ts b/packages/third-parties/formio/src/decorators/action.ts index 407b0cf1b28..d13bccaef51 100644 --- a/packages/third-parties/formio/src/decorators/action.ts +++ b/packages/third-parties/formio/src/decorators/action.ts @@ -1,6 +1,6 @@ import {StoreSet, useDecorators} from "@tsed/core"; import {registerProvider} from "@tsed/di"; -import {FormioActionInfo} from "@tsed/formio-types"; +import type {FormioActionInfo} from "@tsed/formio-types"; /** * Create a new FormIO Action. diff --git a/packages/third-parties/formio/src/decorators/actionCtx.ts b/packages/third-parties/formio/src/decorators/actionCtx.ts index e026b237dc5..c4e6fa5e010 100644 --- a/packages/third-parties/formio/src/decorators/actionCtx.ts +++ b/packages/third-parties/formio/src/decorators/actionCtx.ts @@ -1,7 +1,7 @@ import {Context} from "@tsed/common"; -import {FormioAction} from "@tsed/formio-types"; +import type {FormioAction} from "@tsed/formio-types"; -import {SetActionItemMessage} from "../domain/FormioAction.js"; +import type {SetActionItemMessage} from "../domain/FormioAction.js"; /** * Return the current action context with the following data: diff --git a/packages/third-parties/formio/src/decorators/alter.spec.ts b/packages/third-parties/formio/src/decorators/alter.spec.ts index a18a810974a..90771b207fa 100644 --- a/packages/third-parties/formio/src/decorators/alter.spec.ts +++ b/packages/third-parties/formio/src/decorators/alter.spec.ts @@ -1,6 +1,6 @@ import {Store} from "@tsed/core"; -import {AlterHook} from "../domain/AlterHook.js"; +import type {AlterHook} from "../domain/AlterHook.js"; import {Alter} from "./alter.js"; describe("@Alter", () => { diff --git a/packages/third-parties/formio/src/decorators/on.spec.ts b/packages/third-parties/formio/src/decorators/on.spec.ts index 076972dbf02..326c0c3fe2b 100644 --- a/packages/third-parties/formio/src/decorators/on.spec.ts +++ b/packages/third-parties/formio/src/decorators/on.spec.ts @@ -1,6 +1,6 @@ import {Store} from "@tsed/core"; -import {OnHook} from "../domain/OnHook.js"; +import type {OnHook} from "../domain/OnHook.js"; import {On} from "./on.js"; describe("@On", () => { diff --git a/packages/third-parties/formio/src/domain/Formio.ts b/packages/third-parties/formio/src/domain/Formio.ts index a3f3531926e..482add6c158 100644 --- a/packages/third-parties/formio/src/domain/Formio.ts +++ b/packages/third-parties/formio/src/domain/Formio.ts @@ -1,18 +1,18 @@ -import {EventEmitter} from "events"; -import {NextFunction, Request, Response} from "express"; -import {Db} from "mongodb"; -import {Mongoose, Schema} from "mongoose"; +import type {EventEmitter} from "events"; +import type {NextFunction, Request, Response} from "express"; +import type {Db} from "mongodb"; +import type {Mongoose, Schema} from "mongoose"; -import {FormioActionModelCtor} from "./FormioAction.js"; -import {FormioActionsIndex} from "./FormioActionsIndex.js"; -import {FormioAuth} from "./FormioAuth.js"; -import {FormioBaseModel} from "./FormioBaseModel.js"; -import {FormioConfig} from "./FormioConfig.js"; -import {FormioHook, FormioHooks} from "./FormioHooks.js"; -import {FormioModels, FormioSchemas} from "./FormioModels.js"; -import {FormioTemplateUtil} from "./FormioTemplateUtil.js"; -import {FormioUpdate} from "./FormioUpdate.js"; -import {FormioUtil} from "./FormioUtils.js"; +import type {FormioActionModelCtor} from "./FormioAction.js"; +import type {FormioActionsIndex} from "./FormioActionsIndex.js"; +import type {FormioAuth} from "./FormioAuth.js"; +import type {FormioBaseModel} from "./FormioBaseModel.js"; +import type {FormioConfig} from "./FormioConfig.js"; +import type {FormioHook, FormioHooks} from "./FormioHooks.js"; +import type {FormioModels, FormioSchemas} from "./FormioModels.js"; +import type {FormioTemplateUtil} from "./FormioTemplateUtil.js"; +import type {FormioUpdate} from "./FormioUpdate.js"; +import type {FormioUtil} from "./FormioUtils.js"; export interface FormioBase { /** diff --git a/packages/third-parties/formio/src/domain/FormioAction.ts b/packages/third-parties/formio/src/domain/FormioAction.ts index dfe49716d52..279357dc55d 100644 --- a/packages/third-parties/formio/src/domain/FormioAction.ts +++ b/packages/third-parties/formio/src/domain/FormioAction.ts @@ -1,8 +1,8 @@ -import {FormioAction, FormioActionInfo} from "@tsed/formio-types"; -import {Request, Response} from "express"; +import type {FormioAction, FormioActionInfo} from "@tsed/formio-types"; +import type {Request, Response} from "express"; -import {FormioMongooseSchema} from "./FormioBaseModel.js"; -import {FormioComponent} from "./FormioModels.js"; +import type {FormioMongooseSchema} from "./FormioBaseModel.js"; +import type {FormioComponent} from "./FormioModels.js"; export interface FormioActionModel extends FormioAction { resolve(handler: string, method: string, req: Request, res: Response, next: Function, setActionItemMessage: SetActionItemMessage): void; diff --git a/packages/third-parties/formio/src/domain/FormioActionsIndex.ts b/packages/third-parties/formio/src/domain/FormioActionsIndex.ts index 11e872ca0fd..2cd6a5a372c 100644 --- a/packages/third-parties/formio/src/domain/FormioActionsIndex.ts +++ b/packages/third-parties/formio/src/domain/FormioActionsIndex.ts @@ -1,6 +1,6 @@ -import {Type} from "@tsed/core"; +import type {Type} from "@tsed/core"; -import {FormioActionModelCtor} from "./FormioAction.js"; +import type {FormioActionModelCtor} from "./FormioAction.js"; export interface FormioActions { email: FormioActionModelCtor; diff --git a/packages/third-parties/formio/src/domain/FormioAuth.ts b/packages/third-parties/formio/src/domain/FormioAuth.ts index a577c5c374f..5883160af83 100644 --- a/packages/third-parties/formio/src/domain/FormioAuth.ts +++ b/packages/third-parties/formio/src/domain/FormioAuth.ts @@ -1,7 +1,7 @@ -import {Next, Req, Res} from "@tsed/common"; +import type {Next, Req, Res} from "@tsed/common"; -import {FormioDecodedToken, FormioPayloadToken} from "./FormioDecodedToken.js"; -import {FormioForm} from "./FormioModels.js"; +import type {FormioDecodedToken, FormioPayloadToken} from "./FormioDecodedToken.js"; +import type {FormioForm} from "./FormioModels.js"; export interface FormioAuth { /** diff --git a/packages/third-parties/formio/src/domain/FormioBaseModel.ts b/packages/third-parties/formio/src/domain/FormioBaseModel.ts index b11d52c053e..a314c25ed94 100644 --- a/packages/third-parties/formio/src/domain/FormioBaseModel.ts +++ b/packages/third-parties/formio/src/domain/FormioBaseModel.ts @@ -1,5 +1,5 @@ -import {MongooseDocument} from "@tsed/mongoose"; -import {Document, Schema} from "mongoose"; +import type {MongooseDocument} from "@tsed/mongoose"; +import type {Document, Schema} from "mongoose"; export type FormioMongooseSchema = Schema> & { machineName(document: MongooseDocument, done: Function): void; diff --git a/packages/third-parties/formio/src/domain/FormioConfig.ts b/packages/third-parties/formio/src/domain/FormioConfig.ts index bafb65778d3..e208084cd08 100644 --- a/packages/third-parties/formio/src/domain/FormioConfig.ts +++ b/packages/third-parties/formio/src/domain/FormioConfig.ts @@ -1,5 +1,5 @@ -import {FormioSettings} from "./FormioSettings.js"; -import {FormioTemplate} from "./FormioTemplate.js"; +import type {FormioSettings} from "./FormioSettings.js"; +import type {FormioTemplate} from "./FormioTemplate.js"; export interface FormioJwtConfig { secret: string; diff --git a/packages/third-parties/formio/src/domain/FormioCtxMapper.ts b/packages/third-parties/formio/src/domain/FormioCtxMapper.ts index 7d1e1e22909..691657a037e 100644 --- a/packages/third-parties/formio/src/domain/FormioCtxMapper.ts +++ b/packages/third-parties/formio/src/domain/FormioCtxMapper.ts @@ -1,5 +1,5 @@ -import {FormioAction, FormioForm, FormioRole} from "@tsed/formio-types"; -import {MongooseDocument} from "@tsed/mongoose"; +import type {FormioAction, FormioForm, FormioRole} from "@tsed/formio-types"; +import type {MongooseDocument} from "@tsed/mongoose"; export interface FormioCtxMapper { forms: Map>; diff --git a/packages/third-parties/formio/src/domain/FormioHooks.ts b/packages/third-parties/formio/src/domain/FormioHooks.ts index a213490db94..2b550d2a38d 100644 --- a/packages/third-parties/formio/src/domain/FormioHooks.ts +++ b/packages/third-parties/formio/src/domain/FormioHooks.ts @@ -1,15 +1,15 @@ -import {MongooseDocument} from "@tsed/mongoose"; -import {Request, Response} from "express"; -import {FilterQuery, Schema, SchemaDefinition} from "mongoose"; - -import {Formio} from "./Formio.js"; -import {FormioActions} from "./FormioActionsIndex.js"; -import {FormioConfig} from "./FormioConfig.js"; -import {FormioDecodedToken} from "./FormioDecodedToken.js"; -import {FormioJs} from "./FormioJs.js"; -import {FormioActionItem, FormioForm, FormioModelsModels, FormioSubmission} from "./FormioModels.js"; -import {FormioSettings} from "./FormioSettings.js"; -import {ResourceRestOptions} from "./Resource.js"; +import type {MongooseDocument} from "@tsed/mongoose"; +import type {Request, Response} from "express"; +import type {FilterQuery, Schema, SchemaDefinition} from "mongoose"; + +import type {Formio} from "./Formio.js"; +import type {FormioActions} from "./FormioActionsIndex.js"; +import type {FormioConfig} from "./FormioConfig.js"; +import type {FormioDecodedToken} from "./FormioDecodedToken.js"; +import type {FormioJs} from "./FormioJs.js"; +import type {FormioActionItem, FormioForm, FormioModelsModels, FormioSubmission} from "./FormioModels.js"; +import type {FormioSettings} from "./FormioSettings.js"; +import type {ResourceRestOptions} from "./Resource.js"; export type FormioInitEvent = "alias" | "params" | "token" | "getTempToken" | "logout" | "current" | "access" | "perms"; diff --git a/packages/third-parties/formio/src/domain/FormioModels.ts b/packages/third-parties/formio/src/domain/FormioModels.ts index cafa948e474..41237d67b77 100644 --- a/packages/third-parties/formio/src/domain/FormioModels.ts +++ b/packages/third-parties/formio/src/domain/FormioModels.ts @@ -1,9 +1,9 @@ -import {FormioActionItem, FormioForm, FormioRole, FormioSchema, FormioSubmission, FormioToken} from "@tsed/formio-types"; -import {MongooseDocument} from "@tsed/mongoose"; -import {Schema} from "mongoose"; +import type {FormioActionItem, FormioForm, FormioRole, FormioSchema, FormioSubmission, FormioToken} from "@tsed/formio-types"; +import type {MongooseDocument} from "@tsed/mongoose"; +import type {Schema} from "mongoose"; -import {FormioActionModelCtor, FormioActionMongooseSchema} from "./FormioAction.js"; -import {FormioBaseModel, FormioModel, FormioMongooseSchema} from "./FormioBaseModel.js"; +import type {FormioActionModelCtor, FormioActionMongooseSchema} from "./FormioAction.js"; +import type {FormioBaseModel, FormioModel, FormioMongooseSchema} from "./FormioBaseModel.js"; export * from "@tsed/formio-types"; diff --git a/packages/third-parties/formio/src/domain/FormioRouter.ts b/packages/third-parties/formio/src/domain/FormioRouter.ts index 60f03ee444a..db62cccfdb2 100644 --- a/packages/third-parties/formio/src/domain/FormioRouter.ts +++ b/packages/third-parties/formio/src/domain/FormioRouter.ts @@ -1,7 +1,7 @@ -import {Router} from "express"; +import type {Router} from "express"; -import {Formio, FormioBase} from "./Formio.js"; -import {FormioHooks} from "./FormioHooks.js"; +import type {Formio, FormioBase} from "./Formio.js"; +import type {FormioHooks} from "./FormioHooks.js"; export interface FormioRouter extends Router { formio: FormioBase; diff --git a/packages/third-parties/formio/src/domain/FormioTemplate.ts b/packages/third-parties/formio/src/domain/FormioTemplate.ts index a0362efedf8..65e8b27a2ea 100644 --- a/packages/third-parties/formio/src/domain/FormioTemplate.ts +++ b/packages/third-parties/formio/src/domain/FormioTemplate.ts @@ -1,4 +1,4 @@ -import {FormioActionItem, FormioForm, FormioRole, FormioSubmission} from "./FormioModels.js"; +import type {FormioActionItem, FormioForm, FormioRole, FormioSubmission} from "./FormioModels.js"; export interface FormioTemplate { roles?: Record; diff --git a/packages/third-parties/formio/src/domain/FormioTemplateUtil.ts b/packages/third-parties/formio/src/domain/FormioTemplateUtil.ts index a51b4332303..f366d3afc1e 100644 --- a/packages/third-parties/formio/src/domain/FormioTemplateUtil.ts +++ b/packages/third-parties/formio/src/domain/FormioTemplateUtil.ts @@ -1,4 +1,4 @@ -import {FormioTemplate} from "./FormioTemplate.js"; +import type {FormioTemplate} from "./FormioTemplate.js"; export interface FormioExportOptions { title: string; diff --git a/packages/third-parties/formio/src/domain/FormioUpdate.ts b/packages/third-parties/formio/src/domain/FormioUpdate.ts index c14fdb69e05..5419d354fa2 100644 --- a/packages/third-parties/formio/src/domain/FormioUpdate.ts +++ b/packages/third-parties/formio/src/domain/FormioUpdate.ts @@ -1,7 +1,7 @@ -import {NextFunction, Request, Response} from "express"; -import {Db} from "mongodb"; +import type {NextFunction, Request, Response} from "express"; +import type {Db} from "mongodb"; -import {Formio} from "./Formio.js"; +import type {Formio} from "./Formio.js"; export interface FormioUpdate { db: Db; diff --git a/packages/third-parties/formio/src/domain/FormioUtils.ts b/packages/third-parties/formio/src/domain/FormioUtils.ts index b52fefc833a..9159c51a1c8 100644 --- a/packages/third-parties/formio/src/domain/FormioUtils.ts +++ b/packages/third-parties/formio/src/domain/FormioUtils.ts @@ -1,7 +1,7 @@ -import {Request, Response} from "express"; +import type {Request, Response} from "express"; -import {FormioErrors} from "./FormioErrors.js"; -import {FormioJs} from "./FormioJs.js"; +import type {FormioErrors} from "./FormioErrors.js"; +import type {FormioJs} from "./FormioJs.js"; export interface FormioUtil { Formio: FormioJs; diff --git a/packages/third-parties/formio/src/domain/Resource.ts b/packages/third-parties/formio/src/domain/Resource.ts index b1ef06b0e1f..09ddcc1183d 100644 --- a/packages/third-parties/formio/src/domain/Resource.ts +++ b/packages/third-parties/formio/src/domain/Resource.ts @@ -1,4 +1,4 @@ -import {NextFunction, Request, Response} from "express"; +import type {NextFunction, Request, Response} from "express"; export type ResourceHttpHandler = (req: Request, res: Response, next: NextFunction) => void; diff --git a/packages/third-parties/formio/src/middlewares/FormioAuthMiddleware.ts b/packages/third-parties/formio/src/middlewares/FormioAuthMiddleware.ts index 539dbbd4788..e7d71269efd 100644 --- a/packages/third-parties/formio/src/middlewares/FormioAuthMiddleware.ts +++ b/packages/third-parties/formio/src/middlewares/FormioAuthMiddleware.ts @@ -11,7 +11,7 @@ import {FormioService} from "../services/FormioService.js"; */ @Middleware() export class FormioAuthMiddleware { - @Inject() + @Inject(FormioService) protected formio: FormioService; get tokenHandler(): any { diff --git a/packages/third-parties/formio/src/services/FormioAuthService.ts b/packages/third-parties/formio/src/services/FormioAuthService.ts index 0a5838c2e11..2c159bd9d4b 100644 --- a/packages/third-parties/formio/src/services/FormioAuthService.ts +++ b/packages/third-parties/formio/src/services/FormioAuthService.ts @@ -1,24 +1,24 @@ -import {PlatformContext, Req} from "@tsed/common"; +import type {PlatformContext, Req} from "@tsed/common"; import {isFunction} from "@tsed/core"; import {Inject, Injectable} from "@tsed/di"; import {BadRequest, NotFound, Unauthorized} from "@tsed/exceptions"; import {promisify} from "util"; -import {FormioPayloadToken} from "../domain/FormioDecodedToken.js"; -import {FormioForm, FormioSubmission, WithID} from "../domain/FormioModels.js"; +import type {FormioPayloadToken} from "../domain/FormioDecodedToken.js"; +import type {FormioForm, FormioSubmission, WithID} from "../domain/FormioModels.js"; import {FormioDatabase} from "./FormioDatabase.js"; import {FormioHooksService} from "./FormioHooksService.js"; import {FormioService} from "./FormioService.js"; @Injectable() export class FormioAuthService { - @Inject() + @Inject(FormioService) formio: FormioService; - @Inject() + @Inject(FormioHooksService) hooks: FormioHooksService; - @Inject() + @Inject(FormioDatabase) db: FormioDatabase; get currentUser() { diff --git a/packages/third-parties/formio/src/services/FormioDatabase.ts b/packages/third-parties/formio/src/services/FormioDatabase.ts index 482a8b8361a..1347a0ca1df 100644 --- a/packages/third-parties/formio/src/services/FormioDatabase.ts +++ b/packages/third-parties/formio/src/services/FormioDatabase.ts @@ -1,7 +1,7 @@ import {isArray, isObject, isString, toMap as tMap} from "@tsed/core"; import {Inject, Injectable} from "@tsed/di"; -import {FormioAction, FormioActionItem, FormioForm, FormioRole, FormioSubmission, FormioToken} from "@tsed/formio-types"; -import {MongooseDocument, MongooseModel} from "@tsed/mongoose"; +import type {FormioAction, FormioActionItem, FormioForm, FormioRole, FormioSubmission, FormioToken} from "@tsed/formio-types"; +import type {MongooseDocument, MongooseModel} from "@tsed/mongoose"; import omit from "lodash/omit.js"; import type {FilterQuery} from "mongoose"; @@ -15,7 +15,7 @@ function toMap(list: any[]) { @Injectable() export class FormioDatabase { - @Inject() + @Inject(FormioService) protected formio: FormioService; get models() { diff --git a/packages/third-parties/formio/src/services/FormioHooksService.ts b/packages/third-parties/formio/src/services/FormioHooksService.ts index 9ecafa5a74e..e28148e1204 100644 --- a/packages/third-parties/formio/src/services/FormioHooksService.ts +++ b/packages/third-parties/formio/src/services/FormioHooksService.ts @@ -1,13 +1,13 @@ -import {Inject, Injectable, InjectorService} from "@tsed/common"; -import {Request} from "express"; +import {Inject, Injectable, InjectorService} from "@tsed/di"; +import type {Request} from "express"; import {promisify} from "util"; -import {FormioHooks} from "../domain/FormioHooks.js"; +import type {FormioHooks} from "../domain/FormioHooks.js"; import {FormioService} from "./FormioService.js"; @Injectable() export class FormioHooksService { - @Inject() + @Inject(InjectorService) protected injector: InjectorService; @Inject(FormioService) diff --git a/packages/third-parties/formio/src/services/FormioInstaller.ts b/packages/third-parties/formio/src/services/FormioInstaller.ts index bd7a2fccb20..c9eb2f049b9 100644 --- a/packages/third-parties/formio/src/services/FormioInstaller.ts +++ b/packages/third-parties/formio/src/services/FormioInstaller.ts @@ -1,13 +1,13 @@ import {Inject, Injectable} from "@tsed/di"; import {Logger} from "@tsed/logger"; -import {FormioSubmission} from "../domain/FormioModels.js"; -import {FormioTemplate} from "../domain/FormioTemplate.js"; +import type {FormioSubmission} from "../domain/FormioModels.js"; +import type {FormioTemplate} from "../domain/FormioTemplate.js"; import {FormioDatabase} from "./FormioDatabase.js"; @Injectable() export class FormioInstaller extends FormioDatabase { - @Inject() + @Inject(Logger) protected logger: Logger; async install(template: FormioTemplate, root: any) { diff --git a/packages/third-parties/formio/src/services/FormioRepository.ts b/packages/third-parties/formio/src/services/FormioRepository.ts index 6e8044c7e06..088150558b3 100644 --- a/packages/third-parties/formio/src/services/FormioRepository.ts +++ b/packages/third-parties/formio/src/services/FormioRepository.ts @@ -1,12 +1,12 @@ import {Inject} from "@tsed/di"; -import {MongooseDocument, MongooseModel} from "@tsed/mongoose"; +import type {MongooseDocument, MongooseModel} from "@tsed/mongoose"; import type {FilterQuery} from "mongoose"; -import {FormioSubmission} from "../domain/FormioModels.js"; +import type {FormioSubmission} from "../domain/FormioModels.js"; import {FormioDatabase} from "./FormioDatabase.js"; export abstract class FormioRepository { - @Inject() + @Inject(FormioDatabase) protected formioDatabase: FormioDatabase; protected abstract formName: string; diff --git a/packages/third-parties/formio/src/services/FormioService.ts b/packages/third-parties/formio/src/services/FormioService.ts index a74449a3cbe..d5ed67e309b 100644 --- a/packages/third-parties/formio/src/services/FormioService.ts +++ b/packages/third-parties/formio/src/services/FormioService.ts @@ -1,28 +1,28 @@ -import {Inject, Injectable, InjectorService} from "@tsed/common"; -import {MongooseConnectionOptions} from "@tsed/mongoose"; +import {Inject, Injectable, InjectorService} from "@tsed/di"; +import type {MongooseConnectionOptions} from "@tsed/mongoose"; // @ts-ignore import createRouter from "formio"; // @ts-ignore import swagger from "formio/src/util/swagger.js"; // @ts-ignore import util from "formio/src/util/util.js"; -import {Db} from "mongodb"; -import {Mongoose} from "mongoose"; +import type {Db} from "mongodb"; +import type {Mongoose} from "mongoose"; import {promisify} from "util"; -import {Formio} from "../domain/Formio.js"; -import {FormioConfig} from "../domain/FormioConfig.js"; -import {FormioHook, FormioHooks} from "../domain/FormioHooks.js"; -import {FormioSchemas} from "../domain/FormioModels.js"; -import {FormioRouter} from "../domain/FormioRouter.js"; -import {FormioTemplate} from "../domain/FormioTemplate.js"; -import {FormioExportOptions} from "../domain/FormioTemplateUtil.js"; +import type {Formio} from "../domain/Formio.js"; +import type {FormioConfig} from "../domain/FormioConfig.js"; +import type {FormioHook, FormioHooks} from "../domain/FormioHooks.js"; +import type {FormioSchemas} from "../domain/FormioModels.js"; +import type {FormioRouter} from "../domain/FormioRouter.js"; +import type {FormioTemplate} from "../domain/FormioTemplate.js"; +import type {FormioExportOptions} from "../domain/FormioTemplateUtil.js"; @Injectable() export class FormioService { router: FormioRouter; - @Inject() + @Inject(InjectorService) protected injector: InjectorService; get audit(): Function { diff --git a/packages/third-parties/formio/test/app/Server.ts b/packages/third-parties/formio/test/app/Server.ts index 1d1b27d6c4b..99877fc7c30 100644 --- a/packages/third-parties/formio/test/app/Server.ts +++ b/packages/third-parties/formio/test/app/Server.ts @@ -4,7 +4,8 @@ import "@tsed/swagger"; import "../../src/index.js"; import {FileSyncAdapter} from "@tsed/adapters"; -import {Constant, PlatformApplication} from "@tsed/common"; +import {PlatformApplication} from "@tsed/common"; +import {Constant} from "@tsed/common"; import {Configuration, Inject} from "@tsed/di"; import bodyParser from "body-parser"; import compress from "compression"; @@ -62,7 +63,7 @@ export {rootDir}; ] }) export class Server { - @Inject() + @Inject(PlatformApplication) app: PlatformApplication; @Constant("viewsDir") diff --git a/packages/third-parties/formio/test/app/controllers/pages/IndexCtrl.ts b/packages/third-parties/formio/test/app/controllers/pages/IndexCtrl.ts index a814b305d48..f5e527ff6f9 100644 --- a/packages/third-parties/formio/test/app/controllers/pages/IndexCtrl.ts +++ b/packages/third-parties/formio/test/app/controllers/pages/IndexCtrl.ts @@ -1,6 +1,7 @@ import {Constant, Controller, Get, HeaderParams, View} from "@tsed/common"; import {Returns} from "@tsed/schema"; -import {Hidden, SwaggerSettings} from "@tsed/swagger"; +import type {SwaggerSettings} from "@tsed/swagger"; +import {Hidden} from "@tsed/swagger"; @Hidden() @Controller("/") diff --git a/packages/third-parties/formio/tsconfig.esm.json b/packages/third-parties/formio/tsconfig.esm.json index 82292550ddb..8954049da4a 100644 --- a/packages/third-parties/formio/tsconfig.esm.json +++ b/packages/third-parties/formio/tsconfig.esm.json @@ -2,7 +2,6 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", diff --git a/packages/third-parties/formio/tsconfig.spec.json b/packages/third-parties/formio/tsconfig.spec.json index 9835f975711..0ea8df58648 100644 --- a/packages/third-parties/formio/tsconfig.spec.json +++ b/packages/third-parties/formio/tsconfig.spec.json @@ -3,31 +3,31 @@ "compilerOptions": { "baseUrl": ".", "rootDir": "../..", - "outDir": "./lib/cjs", "declaration": false, "composite": false, "noEmit": true, "paths": { - "@tsed/openspec": ["../../specs/openspec/src"], - "@tsed/schema": ["../../specs/schema/src"], - "@tsed/di": ["../../di/src"], - "@tsed/exceptions": ["../../specs/exceptions/src"], - "@tsed/json-mapper": ["../../specs/json-mapper/src"], - "@tsed/platform-exceptions": ["../../platform/platform-exceptions/src"], - "@tsed/platform-middlewares": ["../../platform/platform-middlewares/src"], - "@tsed/platform-params": ["../../platform/platform-params/src"], - "@tsed/platform-log-middleware": ["../../platform/platform-log-middleware/src"], - "@tsed/platform-response-filter": ["../../platform/platform-response-filter/src"], - "@tsed/platform-router": ["../../platform/platform-router/src"], - "@tsed/platform-views": ["../../platform/platform-views/src"], - "@tsed/components-scan": ["../components-scan/src"], - "@tsed/common": ["../../platform/common/src"], - "@tsed/ajv": ["../../specs/ajv/src"], - "@tsed/platform-cache": ["../../platform/platform-cache/src"], - "@tsed/swagger": ["../../specs/swagger/src"], - "@tsed/platform-test-sdk": ["../../platform/platform-test-sdk/src"], - "@tsed/platform-express": ["../../platform/platform-express/src"], - "@tsed/platform-koa": ["../../platform/platform-koa/src"] + "@tsed/openspec": ["../../specs/openspec/src/index.ts"], + "@tsed/schema": ["../../specs/schema/src/index.ts"], + "@tsed/di": ["../../di/src/index.ts"], + "@tsed/exceptions": ["../../specs/exceptions/src/index.ts"], + "@tsed/json-mapper": ["../../specs/json-mapper/src/index.ts"], + "@tsed/platform-exceptions": ["../../platform/platform-exceptions/src/index.ts"], + "@tsed/platform-middlewares": ["../../platform/platform-middlewares/src/index.ts"], + "@tsed/platform-params": ["../../platform/platform-params/src/index.ts"], + "@tsed/platform-log-middleware": ["../../platform/platform-log-middleware/src/index.ts"], + "@tsed/platform-response-filter": ["../../platform/platform-response-filter/src/index.ts"], + "@tsed/platform-router": ["../../platform/platform-router/src/index.ts"], + "@tsed/platform-views": ["../../platform/platform-views/src/index.ts"], + "@tsed/normalize-path": ["../../utils/normalize-path/src/index.ts"], + "@tsed/components-scan": ["../components-scan/src/index.ts"], + "@tsed/common": ["../../platform/common/src/index.ts"], + "@tsed/ajv": ["../../specs/ajv/src/index.ts"], + "@tsed/platform-cache": ["../../platform/platform-cache/src/index.ts"], + "@tsed/swagger": ["../../specs/swagger/src/index.ts"], + "@tsed/platform-test-sdk": ["../../platform/platform-test-sdk/src/index.ts"], + "@tsed/platform-express": ["../../platform/platform-express/src/index.ts"], + "@tsed/platform-koa": ["../../platform/platform-koa/src/index.ts"] }, "types": ["vite/client", "vitest/globals"] }, diff --git a/packages/third-parties/pulse/package.json b/packages/third-parties/pulse/package.json index 1c94efecdb1..177a8976077 100644 --- a/packages/third-parties/pulse/package.json +++ b/packages/third-parties/pulse/package.json @@ -11,7 +11,7 @@ ".": { "types": "./lib/types/index.d.ts", "import": "./lib/esm/index.js", - "default": "./lib/cjs/index.js" + "default": "./lib/esm/index.js" } }, "scripts": { diff --git a/packages/third-parties/pulse/src/PulseModule.ts b/packages/third-parties/pulse/src/PulseModule.ts index b1c12fc7930..8ebe81865b9 100644 --- a/packages/third-parties/pulse/src/PulseModule.ts +++ b/packages/third-parties/pulse/src/PulseModule.ts @@ -1,21 +1,22 @@ -import {DefineOptions, Job, JobAttributesData, Processor} from "@pulsecron/pulse"; -import {AfterListen, DIContext, Logger, OnDestroy, runInContext} from "@tsed/common"; -import {Constant, Inject, InjectorService, Module, Provider} from "@tsed/di"; +import type {DefineOptions, Job, JobAttributesData, Processor} from "@pulsecron/pulse"; +import type {AfterListen} from "@tsed/common"; +import {Constant, DIContext, Inject, InjectorService, Module, type OnDestroy, type Provider, runInContext} from "@tsed/di"; +import {Logger} from "@tsed/logger"; import {v4 as uuid} from "uuid"; import {PROVIDER_TYPE_PULSE} from "./constants/constants.js"; -import {PulseStore} from "./interfaces/PulseStore.js"; +import type {PulseStore} from "./interfaces/PulseStore.js"; import {PulseService} from "./services/PulseFactory.js"; @Module() export class PulseModule implements OnDestroy, AfterListen { - @Inject() + @Inject(Logger) protected logger: Logger; - @Inject() + @Inject(InjectorService) protected injector: InjectorService; - @Inject() + @Inject(PulseService) protected pulse: PulseService; @Constant("pulse.enabled", false) diff --git a/packages/third-parties/pulse/src/decorators/define.ts b/packages/third-parties/pulse/src/decorators/define.ts index 154fc6eca1f..2cdc823624c 100644 --- a/packages/third-parties/pulse/src/decorators/define.ts +++ b/packages/third-parties/pulse/src/decorators/define.ts @@ -1,6 +1,6 @@ import {Store} from "@tsed/core"; -import {DefineOptions, PulseStore} from "../interfaces/PulseStore.js"; +import type {DefineOptions, PulseStore} from "../interfaces/PulseStore.js"; export function Define(options: DefineOptions = {}): MethodDecorator { return (target: any, propertyKey: string) => { diff --git a/packages/third-parties/pulse/src/decorators/every.ts b/packages/third-parties/pulse/src/decorators/every.ts index f2438d07b90..d71605c9b97 100644 --- a/packages/third-parties/pulse/src/decorators/every.ts +++ b/packages/third-parties/pulse/src/decorators/every.ts @@ -1,6 +1,6 @@ import {Store, useDecorators} from "@tsed/core"; -import {EveryOptions, PulseStore} from "../interfaces/PulseStore.js"; +import type {EveryOptions, PulseStore} from "../interfaces/PulseStore.js"; import {Define} from "./define.js"; export function Every(interval: string, options: EveryOptions = {}): MethodDecorator { diff --git a/packages/third-parties/pulse/src/interfaces/PulseStore.ts b/packages/third-parties/pulse/src/interfaces/PulseStore.ts index 4c1431c009e..f1991b346fc 100644 --- a/packages/third-parties/pulse/src/interfaces/PulseStore.ts +++ b/packages/third-parties/pulse/src/interfaces/PulseStore.ts @@ -1,4 +1,4 @@ -import {DefineOptions as PulseDefineOptions, JobOptions} from "@pulsecron/pulse"; +import type {DefineOptions as PulseDefineOptions, JobOptions} from "@pulsecron/pulse"; export interface DefineOptions extends PulseDefineOptions { name?: string; diff --git a/packages/third-parties/pulse/src/interfaces/interfaces.ts b/packages/third-parties/pulse/src/interfaces/interfaces.ts index 646e4c80f79..3305d6d437d 100644 --- a/packages/third-parties/pulse/src/interfaces/interfaces.ts +++ b/packages/third-parties/pulse/src/interfaces/interfaces.ts @@ -1,4 +1,4 @@ -import {PulseConfig} from "@pulsecron/pulse"; +import type {PulseConfig} from "@pulsecron/pulse"; declare global { namespace TsED { diff --git a/packages/third-parties/pulse/src/services/PulseFactory.ts b/packages/third-parties/pulse/src/services/PulseFactory.ts index 2a481b2c7c9..4c439440f97 100644 --- a/packages/third-parties/pulse/src/services/PulseFactory.ts +++ b/packages/third-parties/pulse/src/services/PulseFactory.ts @@ -1,4 +1,5 @@ -import {Pulse, PulseConfig} from "@pulsecron/pulse"; +import type {PulseConfig} from "@pulsecron/pulse"; +import {Pulse} from "@pulsecron/pulse"; import {Configuration, registerProvider} from "@tsed/di"; // create Alias to avoid confusing import between Pulse from "@pulsecron/pulse" and Pulse decorator diff --git a/packages/third-parties/pulse/test/helpers/Server.ts b/packages/third-parties/pulse/test/helpers/Server.ts index 8540e323d19..3d12a92b275 100644 --- a/packages/third-parties/pulse/test/helpers/Server.ts +++ b/packages/third-parties/pulse/test/helpers/Server.ts @@ -1,7 +1,8 @@ import "@tsed/platform-express"; -import "../.."; +import "../../src/index.js"; -import {Configuration, Inject, PlatformApplication} from "@tsed/common"; +import {PlatformApplication} from "@tsed/common"; +import {Configuration, Inject} from "@tsed/common"; import bodyParser from "body-parser"; import compress from "compression"; import cookieParser from "cookie-parser"; @@ -16,7 +17,7 @@ const rootDir = import.meta.dirname; httpsPort: false }) export class Server { - @Inject() + @Inject(PlatformApplication) app: PlatformApplication; public $beforeRoutesInit(): void { diff --git a/packages/third-parties/pulse/test/pulse-define-manually.integration.spec.ts b/packages/third-parties/pulse/test/pulse-define-manually.integration.spec.ts index 30134add76c..c5ead9eb0fa 100644 --- a/packages/third-parties/pulse/test/pulse-define-manually.integration.spec.ts +++ b/packages/third-parties/pulse/test/pulse-define-manually.integration.spec.ts @@ -1,14 +1,15 @@ -import {Job} from "@pulsecron/pulse"; +import type {Job} from "@pulsecron/pulse"; import {PlatformTest} from "@tsed/common"; import {Inject} from "@tsed/di"; import {TestContainersMongo} from "@tsed/testcontainers-mongo"; -import {Define, Pulse, PulseModule, PulseService} from "../src/index.js"; +import {PulseModule} from "../src/index.js"; +import {Define, Pulse, PulseService} from "../src/index.js"; import {Server} from "./helpers/Server.js"; @Pulse({namespace: "test-nsp"}) class Test { - @Inject() + @Inject(PulseModule) pulse: PulseModule; jobs: Job[]; diff --git a/packages/third-parties/pulse/tsconfig.esm.json b/packages/third-parties/pulse/tsconfig.esm.json index 82292550ddb..8954049da4a 100644 --- a/packages/third-parties/pulse/tsconfig.esm.json +++ b/packages/third-parties/pulse/tsconfig.esm.json @@ -2,7 +2,6 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", diff --git a/packages/third-parties/pulse/tsconfig.spec.json b/packages/third-parties/pulse/tsconfig.spec.json index 9835f975711..0ea8df58648 100644 --- a/packages/third-parties/pulse/tsconfig.spec.json +++ b/packages/third-parties/pulse/tsconfig.spec.json @@ -3,31 +3,31 @@ "compilerOptions": { "baseUrl": ".", "rootDir": "../..", - "outDir": "./lib/cjs", "declaration": false, "composite": false, "noEmit": true, "paths": { - "@tsed/openspec": ["../../specs/openspec/src"], - "@tsed/schema": ["../../specs/schema/src"], - "@tsed/di": ["../../di/src"], - "@tsed/exceptions": ["../../specs/exceptions/src"], - "@tsed/json-mapper": ["../../specs/json-mapper/src"], - "@tsed/platform-exceptions": ["../../platform/platform-exceptions/src"], - "@tsed/platform-middlewares": ["../../platform/platform-middlewares/src"], - "@tsed/platform-params": ["../../platform/platform-params/src"], - "@tsed/platform-log-middleware": ["../../platform/platform-log-middleware/src"], - "@tsed/platform-response-filter": ["../../platform/platform-response-filter/src"], - "@tsed/platform-router": ["../../platform/platform-router/src"], - "@tsed/platform-views": ["../../platform/platform-views/src"], - "@tsed/components-scan": ["../components-scan/src"], - "@tsed/common": ["../../platform/common/src"], - "@tsed/ajv": ["../../specs/ajv/src"], - "@tsed/platform-cache": ["../../platform/platform-cache/src"], - "@tsed/swagger": ["../../specs/swagger/src"], - "@tsed/platform-test-sdk": ["../../platform/platform-test-sdk/src"], - "@tsed/platform-express": ["../../platform/platform-express/src"], - "@tsed/platform-koa": ["../../platform/platform-koa/src"] + "@tsed/openspec": ["../../specs/openspec/src/index.ts"], + "@tsed/schema": ["../../specs/schema/src/index.ts"], + "@tsed/di": ["../../di/src/index.ts"], + "@tsed/exceptions": ["../../specs/exceptions/src/index.ts"], + "@tsed/json-mapper": ["../../specs/json-mapper/src/index.ts"], + "@tsed/platform-exceptions": ["../../platform/platform-exceptions/src/index.ts"], + "@tsed/platform-middlewares": ["../../platform/platform-middlewares/src/index.ts"], + "@tsed/platform-params": ["../../platform/platform-params/src/index.ts"], + "@tsed/platform-log-middleware": ["../../platform/platform-log-middleware/src/index.ts"], + "@tsed/platform-response-filter": ["../../platform/platform-response-filter/src/index.ts"], + "@tsed/platform-router": ["../../platform/platform-router/src/index.ts"], + "@tsed/platform-views": ["../../platform/platform-views/src/index.ts"], + "@tsed/normalize-path": ["../../utils/normalize-path/src/index.ts"], + "@tsed/components-scan": ["../components-scan/src/index.ts"], + "@tsed/common": ["../../platform/common/src/index.ts"], + "@tsed/ajv": ["../../specs/ajv/src/index.ts"], + "@tsed/platform-cache": ["../../platform/platform-cache/src/index.ts"], + "@tsed/swagger": ["../../specs/swagger/src/index.ts"], + "@tsed/platform-test-sdk": ["../../platform/platform-test-sdk/src/index.ts"], + "@tsed/platform-express": ["../../platform/platform-express/src/index.ts"], + "@tsed/platform-koa": ["../../platform/platform-koa/src/index.ts"] }, "types": ["vite/client", "vitest/globals"] }, diff --git a/packages/third-parties/schema-formio/package.json b/packages/third-parties/schema-formio/package.json index aaf28130747..2c947c8cef5 100644 --- a/packages/third-parties/schema-formio/package.json +++ b/packages/third-parties/schema-formio/package.json @@ -13,11 +13,11 @@ "types": "./lib/types/index.d.ts", "browser": "./lib/browser/schema-formio.umd.min.js", "import": "./lib/esm/index.js", - "default": "./lib/cjs/index.js" + "default": "./lib/esm/index.js" } }, "scripts": { - "clean": "rm -rf lib", + "clean": "rm -rf lib tsconfig.spec.buildinfo", "build": "yarn clean && yarn barrels && yarn build:ts && yarn run build:browser", "build:browser": "webpack", "barrels": "barrels", @@ -50,7 +50,7 @@ "@tsed/typescript": "workspace:*", "eslint": "^8.57.0", "typescript": "5.6.2", - "vitest": "2.0.4" + "vitest": "2.1.1" }, "peerDependencies": { "@tsed/core": "8.0.0-alpha.5", diff --git a/packages/third-parties/schema-formio/src/components/propertiesToComponents.ts b/packages/third-parties/schema-formio/src/components/propertiesToComponents.ts index dd1cb3aee81..ce165e8f4d3 100644 --- a/packages/third-parties/schema-formio/src/components/propertiesToComponents.ts +++ b/packages/third-parties/schema-formio/src/components/propertiesToComponents.ts @@ -1,5 +1,5 @@ import {cleanObject, isFunction} from "@tsed/core"; -import {FormioComponent, FormioForm} from "@tsed/formio-types"; +import type {FormioComponent, FormioForm} from "@tsed/formio-types"; import {sentenceCase} from "change-case"; import {execMapper, registerFormioMapper} from "../registries/FormioMappersContainer.js"; diff --git a/packages/third-parties/schema-formio/src/decorators/component.ts b/packages/third-parties/schema-formio/src/decorators/component.ts index 86b9e8e162b..11240d2f8a5 100644 --- a/packages/third-parties/schema-formio/src/decorators/component.ts +++ b/packages/third-parties/schema-formio/src/decorators/component.ts @@ -1,4 +1,5 @@ -import {JsonEntityFn, JsonEntityStore} from "@tsed/schema"; +import type {JsonEntityStore} from "@tsed/schema"; +import {JsonEntityFn} from "@tsed/schema"; /** * Declare a formio Component schema on the decorated propertyKey. diff --git a/packages/third-parties/schema-formio/src/decorators/customConditional.ts b/packages/third-parties/schema-formio/src/decorators/customConditional.ts index d18a6d9d190..bc6a475af63 100644 --- a/packages/third-parties/schema-formio/src/decorators/customConditional.ts +++ b/packages/third-parties/schema-formio/src/decorators/customConditional.ts @@ -1,5 +1,5 @@ import {isArrowFn} from "@tsed/core"; -import {FormioComponent, FormioForm, FormioSubmission} from "@tsed/formio-types"; +import type {FormioComponent, FormioForm, FormioSubmission} from "@tsed/formio-types"; import type {Utils} from "formiojs"; import type {LoDashStatic} from "lodash"; import type {Moment} from "moment"; diff --git a/packages/third-parties/schema-formio/src/decorators/dataSourceJson.ts b/packages/third-parties/schema-formio/src/decorators/dataSourceJson.ts index 64b9bc161b9..9d1c29d7273 100644 --- a/packages/third-parties/schema-formio/src/decorators/dataSourceJson.ts +++ b/packages/third-parties/schema-formio/src/decorators/dataSourceJson.ts @@ -1,6 +1,6 @@ import {isFunction} from "@tsed/core"; -import {FormioDataResolver, FormioDataResolverCtx} from "../domain/FormioDataResolver.js"; +import type {FormioDataResolver, FormioDataResolverCtx} from "../domain/FormioDataResolver.js"; import {Component} from "./component.js"; const wrap = (resolver: FormioDataResolver) => async (opts: FormioDataResolverCtx) => { diff --git a/packages/third-parties/schema-formio/src/decorators/dataSourceUrl.ts b/packages/third-parties/schema-formio/src/decorators/dataSourceUrl.ts index 50a534f4155..0c9138a1d57 100644 --- a/packages/third-parties/schema-formio/src/decorators/dataSourceUrl.ts +++ b/packages/third-parties/schema-formio/src/decorators/dataSourceUrl.ts @@ -1,4 +1,4 @@ -import {FormioDataResolver} from "../domain/FormioDataResolver.js"; +import type {FormioDataResolver} from "../domain/FormioDataResolver.js"; import {Component} from "./component.js"; /** diff --git a/packages/third-parties/schema-formio/src/decorators/form.ts b/packages/third-parties/schema-formio/src/decorators/form.ts index ffb6bb4e6e5..612d5e96d4e 100644 --- a/packages/third-parties/schema-formio/src/decorators/form.ts +++ b/packages/third-parties/schema-formio/src/decorators/form.ts @@ -1,5 +1,5 @@ import {nameOf, StoreSet, useDecorators} from "@tsed/core"; -import {FormioForm} from "@tsed/formio-types"; +import type {FormioForm} from "@tsed/formio-types"; import {Name} from "@tsed/schema"; import {paramCase} from "change-case"; diff --git a/packages/third-parties/schema-formio/src/decorators/tabs.ts b/packages/third-parties/schema-formio/src/decorators/tabs.ts index 476a261976d..9980e62d471 100644 --- a/packages/third-parties/schema-formio/src/decorators/tabs.ts +++ b/packages/third-parties/schema-formio/src/decorators/tabs.ts @@ -1,4 +1,5 @@ -import {JsonEntityFn, JsonEntityStore} from "@tsed/schema"; +import type {JsonEntityStore} from "@tsed/schema"; +import {JsonEntityFn} from "@tsed/schema"; import {camelCase} from "change-case"; /** diff --git a/packages/third-parties/schema-formio/src/domain/FormioDataResolver.ts b/packages/third-parties/schema-formio/src/domain/FormioDataResolver.ts index d7f7f70cabf..c004071096d 100644 --- a/packages/third-parties/schema-formio/src/domain/FormioDataResolver.ts +++ b/packages/third-parties/schema-formio/src/domain/FormioDataResolver.ts @@ -1,5 +1,5 @@ -import {FormioComponent, FormioForm} from "@tsed/formio-types"; -import {JsonSchemaOptions} from "@tsed/schema"; +import type {FormioComponent, FormioForm} from "@tsed/formio-types"; +import type {JsonSchemaOptions} from "@tsed/schema"; export type FormioDataResolverCtx = {component: FormioComponent; form: FormioForm} & JsonSchemaOptions; export type FormioDataResolver = (ctx: FormioDataResolverCtx) => Promise | any; diff --git a/packages/third-parties/schema-formio/src/registries/FormsContainer.ts b/packages/third-parties/schema-formio/src/registries/FormsContainer.ts index 6b96ec02e64..0da9c701b0e 100644 --- a/packages/third-parties/schema-formio/src/registries/FormsContainer.ts +++ b/packages/third-parties/schema-formio/src/registries/FormsContainer.ts @@ -1,4 +1,4 @@ -import {Type} from "@tsed/core"; +import type {Type} from "@tsed/core"; // tslint:disable-next-line:variable-name export const FormsContainer: Map = new Map(); diff --git a/packages/third-parties/schema-formio/src/utils/getFormioSchema.ts b/packages/third-parties/schema-formio/src/utils/getFormioSchema.ts index 0b688f708a2..434eb10c6a4 100644 --- a/packages/third-parties/schema-formio/src/utils/getFormioSchema.ts +++ b/packages/third-parties/schema-formio/src/utils/getFormioSchema.ts @@ -12,9 +12,11 @@ import "../components/panelToComponent.js"; import "../components/propertiesToComponents.js"; import "../components/stringToComponent.js"; -import {isString, Type} from "@tsed/core"; -import {FormioForm} from "@tsed/formio-types"; -import {getJsonSchema, JsonEntityStore, JsonSchemaOptions} from "@tsed/schema"; +import type {Type} from "@tsed/core"; +import {isString} from "@tsed/core"; +import type {FormioForm} from "@tsed/formio-types"; +import type {JsonSchemaOptions} from "@tsed/schema"; +import {getJsonSchema, JsonEntityStore} from "@tsed/schema"; import {paramCase} from "change-case"; import {execMapper} from "../registries/FormioMappersContainer.js"; diff --git a/packages/third-parties/schema-formio/tsconfig.esm.json b/packages/third-parties/schema-formio/tsconfig.esm.json index 82292550ddb..8954049da4a 100644 --- a/packages/third-parties/schema-formio/tsconfig.esm.json +++ b/packages/third-parties/schema-formio/tsconfig.esm.json @@ -2,7 +2,6 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", diff --git a/packages/third-parties/schema-formio/tsconfig.spec.json b/packages/third-parties/schema-formio/tsconfig.spec.json index 9835f975711..0ea8df58648 100644 --- a/packages/third-parties/schema-formio/tsconfig.spec.json +++ b/packages/third-parties/schema-formio/tsconfig.spec.json @@ -3,31 +3,31 @@ "compilerOptions": { "baseUrl": ".", "rootDir": "../..", - "outDir": "./lib/cjs", "declaration": false, "composite": false, "noEmit": true, "paths": { - "@tsed/openspec": ["../../specs/openspec/src"], - "@tsed/schema": ["../../specs/schema/src"], - "@tsed/di": ["../../di/src"], - "@tsed/exceptions": ["../../specs/exceptions/src"], - "@tsed/json-mapper": ["../../specs/json-mapper/src"], - "@tsed/platform-exceptions": ["../../platform/platform-exceptions/src"], - "@tsed/platform-middlewares": ["../../platform/platform-middlewares/src"], - "@tsed/platform-params": ["../../platform/platform-params/src"], - "@tsed/platform-log-middleware": ["../../platform/platform-log-middleware/src"], - "@tsed/platform-response-filter": ["../../platform/platform-response-filter/src"], - "@tsed/platform-router": ["../../platform/platform-router/src"], - "@tsed/platform-views": ["../../platform/platform-views/src"], - "@tsed/components-scan": ["../components-scan/src"], - "@tsed/common": ["../../platform/common/src"], - "@tsed/ajv": ["../../specs/ajv/src"], - "@tsed/platform-cache": ["../../platform/platform-cache/src"], - "@tsed/swagger": ["../../specs/swagger/src"], - "@tsed/platform-test-sdk": ["../../platform/platform-test-sdk/src"], - "@tsed/platform-express": ["../../platform/platform-express/src"], - "@tsed/platform-koa": ["../../platform/platform-koa/src"] + "@tsed/openspec": ["../../specs/openspec/src/index.ts"], + "@tsed/schema": ["../../specs/schema/src/index.ts"], + "@tsed/di": ["../../di/src/index.ts"], + "@tsed/exceptions": ["../../specs/exceptions/src/index.ts"], + "@tsed/json-mapper": ["../../specs/json-mapper/src/index.ts"], + "@tsed/platform-exceptions": ["../../platform/platform-exceptions/src/index.ts"], + "@tsed/platform-middlewares": ["../../platform/platform-middlewares/src/index.ts"], + "@tsed/platform-params": ["../../platform/platform-params/src/index.ts"], + "@tsed/platform-log-middleware": ["../../platform/platform-log-middleware/src/index.ts"], + "@tsed/platform-response-filter": ["../../platform/platform-response-filter/src/index.ts"], + "@tsed/platform-router": ["../../platform/platform-router/src/index.ts"], + "@tsed/platform-views": ["../../platform/platform-views/src/index.ts"], + "@tsed/normalize-path": ["../../utils/normalize-path/src/index.ts"], + "@tsed/components-scan": ["../components-scan/src/index.ts"], + "@tsed/common": ["../../platform/common/src/index.ts"], + "@tsed/ajv": ["../../specs/ajv/src/index.ts"], + "@tsed/platform-cache": ["../../platform/platform-cache/src/index.ts"], + "@tsed/swagger": ["../../specs/swagger/src/index.ts"], + "@tsed/platform-test-sdk": ["../../platform/platform-test-sdk/src/index.ts"], + "@tsed/platform-express": ["../../platform/platform-express/src/index.ts"], + "@tsed/platform-koa": ["../../platform/platform-koa/src/index.ts"] }, "types": ["vite/client", "vitest/globals"] }, diff --git a/packages/third-parties/socketio-testing/package.json b/packages/third-parties/socketio-testing/package.json index d0d1546816b..4635d75f065 100644 --- a/packages/third-parties/socketio-testing/package.json +++ b/packages/third-parties/socketio-testing/package.json @@ -11,7 +11,7 @@ ".": { "types": "./lib/types/index.d.ts", "import": "./lib/esm/index.js", - "default": "./lib/cjs/index.js" + "default": "./lib/esm/index.js" } }, "scripts": { diff --git a/packages/third-parties/socketio-testing/src/services/SocketClientService.ts b/packages/third-parties/socketio-testing/src/services/SocketClientService.ts index c7a81e607fe..854ae2dc35d 100644 --- a/packages/third-parties/socketio-testing/src/services/SocketClientService.ts +++ b/packages/third-parties/socketio-testing/src/services/SocketClientService.ts @@ -1,13 +1,15 @@ -import {Inject, Logger, OnDestroy} from "@tsed/common"; -import {Configuration, Injectable} from "@tsed/di"; -import {io, Socket} from "socket.io-client"; +import {Inject} from "@tsed/common"; +import {Configuration, Injectable, type OnDestroy} from "@tsed/di"; +import {Logger} from "@tsed/logger"; +import type {Socket} from "socket.io-client"; +import {io} from "socket.io-client"; @Injectable() export class SocketClientService implements OnDestroy { @Configuration() private settings: Configuration; - @Inject() + @Inject(Logger) private logger: Logger; private clients: Map = new Map(); diff --git a/packages/third-parties/socketio-testing/tsconfig.esm.json b/packages/third-parties/socketio-testing/tsconfig.esm.json index 82292550ddb..8954049da4a 100644 --- a/packages/third-parties/socketio-testing/tsconfig.esm.json +++ b/packages/third-parties/socketio-testing/tsconfig.esm.json @@ -2,7 +2,6 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", diff --git a/packages/third-parties/socketio/package.json b/packages/third-parties/socketio/package.json index 4ce6ea8dded..41bd652a175 100644 --- a/packages/third-parties/socketio/package.json +++ b/packages/third-parties/socketio/package.json @@ -18,7 +18,7 @@ ".": { "types": "./lib/types/index.d.ts", "import": "./lib/esm/index.js", - "default": "./lib/cjs/index.js" + "default": "./lib/esm/index.js" } }, "scripts": { diff --git a/packages/third-parties/socketio/src/SocketIOModule.ts b/packages/third-parties/socketio/src/SocketIOModule.ts index 8db51d0e6ab..298e908c2c9 100644 --- a/packages/third-parties/socketio/src/SocketIOModule.ts +++ b/packages/third-parties/socketio/src/SocketIOModule.ts @@ -1,9 +1,10 @@ -import {$log, AfterListen, Constant, InjectorService, Module, OnDestroy, Provider} from "@tsed/common"; +import type {AfterListen} from "@tsed/common"; import {nameOf} from "@tsed/core"; -import {Inject} from "@tsed/di"; +import {Constant, Inject, InjectorService, Module, type OnDestroy, type Provider} from "@tsed/di"; +import {$log} from "@tsed/logger"; import Http from "http"; import Https from "https"; -import {Server, ServerOptions} from "socket.io"; +import type {Server, ServerOptions} from "socket.io"; import {SocketProviderMetadata} from "./class/SocketProviderMetadata.js"; // tslint:disable-line: no-unused-variable import {PROVIDER_TYPE_SOCKET_SERVICE} from "./constants/constants.js"; @@ -21,7 +22,7 @@ export class SocketIOModule implements AfterListen, OnDestroy { @Constant("socketIO", {}) protected settings: Partial; - @Inject() + @Inject(InjectorService) protected injector: InjectorService; @Inject(Http.Server) @@ -33,7 +34,7 @@ export class SocketIOModule implements AfterListen, OnDestroy { @IO() private io: Server; - @Inject() + @Inject(SocketIOService) private socketIOService: SocketIOService; $afterListen() { diff --git a/packages/third-parties/socketio/src/class/SocketHandlersBuilder.spec.ts b/packages/third-parties/socketio/src/class/SocketHandlersBuilder.spec.ts index dff9e1d0293..b2c8e48f248 100644 --- a/packages/third-parties/socketio/src/class/SocketHandlersBuilder.spec.ts +++ b/packages/third-parties/socketio/src/class/SocketHandlersBuilder.spec.ts @@ -1,4 +1,5 @@ -import {DIContext, getContext, PlatformTest} from "@tsed/common"; +import type {DIContext} from "@tsed/common"; +import {getContext, PlatformTest} from "@tsed/common"; import {Store} from "@tsed/core"; import {InjectorService, ProviderType} from "@tsed/di"; diff --git a/packages/third-parties/socketio/src/class/SocketHandlersBuilder.ts b/packages/third-parties/socketio/src/class/SocketHandlersBuilder.ts index 5053f62f88c..487677cfde4 100644 --- a/packages/third-parties/socketio/src/class/SocketHandlersBuilder.ts +++ b/packages/third-parties/socketio/src/class/SocketHandlersBuilder.ts @@ -1,14 +1,15 @@ import {isFunction, Store} from "@tsed/core"; -import {DIContext, InjectorService, Provider, runInContext} from "@tsed/di"; +import type {InjectorService, Provider} from "@tsed/di"; +import {DIContext, runInContext} from "@tsed/di"; import {deserialize} from "@tsed/json-mapper"; import {$log} from "@tsed/logger"; -import {Namespace, Socket} from "socket.io"; +import type {Namespace, Socket} from "socket.io"; import {v4} from "uuid"; import {SocketFilters} from "../interfaces/SocketFilters.js"; -import {SocketHandlerMetadata} from "../interfaces/SocketHandlerMetadata.js"; -import {SocketInjectableNsp} from "../interfaces/SocketInjectableNsp.js"; -import {SocketParamMetadata} from "../interfaces/SocketParamMetadata.js"; +import type {SocketHandlerMetadata} from "../interfaces/SocketHandlerMetadata.js"; +import type {SocketInjectableNsp} from "../interfaces/SocketInjectableNsp.js"; +import type {SocketParamMetadata} from "../interfaces/SocketParamMetadata.js"; import {SocketProviderTypes} from "../interfaces/SocketProviderTypes.js"; import {SocketReturnsTypes} from "../interfaces/SocketReturnsTypes.js"; import {SocketProviderMetadata} from "./SocketProviderMetadata.js"; diff --git a/packages/third-parties/socketio/src/class/SocketProviderMetadata.ts b/packages/third-parties/socketio/src/class/SocketProviderMetadata.ts index 44043559f58..747e84b351b 100644 --- a/packages/third-parties/socketio/src/class/SocketProviderMetadata.ts +++ b/packages/third-parties/socketio/src/class/SocketProviderMetadata.ts @@ -1,6 +1,6 @@ -import {SocketHandlerMetadata} from "../interfaces/SocketHandlerMetadata.js"; -import {SocketInjectableNsp} from "../interfaces/SocketInjectableNsp.js"; -import {SocketProviderTypes} from "../interfaces/SocketProviderTypes.js"; +import type {SocketHandlerMetadata} from "../interfaces/SocketHandlerMetadata.js"; +import type {SocketInjectableNsp} from "../interfaces/SocketInjectableNsp.js"; +import type {SocketProviderTypes} from "../interfaces/SocketProviderTypes.js"; export class SocketProviderMetadata { public type: SocketProviderTypes; diff --git a/packages/third-parties/socketio/src/decorators/io.ts b/packages/third-parties/socketio/src/decorators/io.ts index add57f8c1b5..db3d484be83 100644 --- a/packages/third-parties/socketio/src/decorators/io.ts +++ b/packages/third-parties/socketio/src/decorators/io.ts @@ -1,4 +1,4 @@ -import {Type} from "@tsed/core"; +import type {Type} from "@tsed/core"; import {Inject} from "@tsed/di"; import {Server} from "../services/SocketIOServer.js"; diff --git a/packages/third-parties/socketio/src/decorators/nsp.ts b/packages/third-parties/socketio/src/decorators/nsp.ts index 7ef5fa89635..84cea4e7cf5 100644 --- a/packages/third-parties/socketio/src/decorators/nsp.ts +++ b/packages/third-parties/socketio/src/decorators/nsp.ts @@ -1,5 +1,5 @@ import {decoratorTypeOf, DecoratorTypes, isRegExp, Store} from "@tsed/core"; -import {Namespace as NamespaceType} from "socket.io"; +import type {Namespace as NamespaceType} from "socket.io"; import {SocketFilters} from "../interfaces/SocketFilters.js"; import {SocketFilter} from "./socketFilter.js"; diff --git a/packages/third-parties/socketio/src/decorators/socket.ts b/packages/third-parties/socketio/src/decorators/socket.ts index bcf81e67976..6804980f03c 100644 --- a/packages/third-parties/socketio/src/decorators/socket.ts +++ b/packages/third-parties/socketio/src/decorators/socket.ts @@ -1,4 +1,4 @@ -import {Socket as SocketType} from "socket.io"; +import type {Socket as SocketType} from "socket.io"; import {SocketFilters} from "../interfaces/SocketFilters.js"; import {SocketFilter} from "./socketFilter.js"; diff --git a/packages/third-parties/socketio/src/decorators/socketFilter.ts b/packages/third-parties/socketio/src/decorators/socketFilter.ts index 385fd4047ee..249aba573b3 100644 --- a/packages/third-parties/socketio/src/decorators/socketFilter.ts +++ b/packages/third-parties/socketio/src/decorators/socketFilter.ts @@ -1,6 +1,6 @@ import {Store} from "@tsed/core"; -import {SocketFilters} from "../interfaces/SocketFilters.js"; +import type {SocketFilters} from "../interfaces/SocketFilters.js"; /** * diff --git a/packages/third-parties/socketio/src/decorators/socketMiddleware.ts b/packages/third-parties/socketio/src/decorators/socketMiddleware.ts index f070661a02b..0ef8af3bb19 100644 --- a/packages/third-parties/socketio/src/decorators/socketMiddleware.ts +++ b/packages/third-parties/socketio/src/decorators/socketMiddleware.ts @@ -1,4 +1,5 @@ -import {Store, Type} from "@tsed/core"; +import type {Type} from "@tsed/core"; +import {Store} from "@tsed/core"; import {Middleware} from "@tsed/platform-middlewares"; import {SocketProviderTypes} from "../interfaces/SocketProviderTypes.js"; diff --git a/packages/third-parties/socketio/src/decorators/socketMiddlewareError.ts b/packages/third-parties/socketio/src/decorators/socketMiddlewareError.ts index 9cb0c178be0..e21a4baab6d 100644 --- a/packages/third-parties/socketio/src/decorators/socketMiddlewareError.ts +++ b/packages/third-parties/socketio/src/decorators/socketMiddlewareError.ts @@ -1,4 +1,5 @@ -import {Store, Type} from "@tsed/core"; +import type {Type} from "@tsed/core"; +import {Store} from "@tsed/core"; import {Middleware} from "@tsed/platform-middlewares"; import {SocketProviderTypes} from "../interfaces/SocketProviderTypes.js"; diff --git a/packages/third-parties/socketio/src/decorators/socketNsp.ts b/packages/third-parties/socketio/src/decorators/socketNsp.ts index 639779a46f3..8557fa02ead 100644 --- a/packages/third-parties/socketio/src/decorators/socketNsp.ts +++ b/packages/third-parties/socketio/src/decorators/socketNsp.ts @@ -1,5 +1,5 @@ import {SocketFilters} from "../interfaces/SocketFilters.js"; -import {Namespace} from "./nsp.js"; +import type {Namespace} from "./nsp.js"; import {SocketFilter} from "./socketFilter.js"; export type SocketNsp = Namespace; diff --git a/packages/third-parties/socketio/src/decorators/socketReturns.ts b/packages/third-parties/socketio/src/decorators/socketReturns.ts index fba726c5670..3aa7bae2f77 100644 --- a/packages/third-parties/socketio/src/decorators/socketReturns.ts +++ b/packages/third-parties/socketio/src/decorators/socketReturns.ts @@ -1,6 +1,6 @@ import {Store} from "@tsed/core"; -import {SocketReturnsTypes} from "../interfaces/SocketReturnsTypes.js"; +import type {SocketReturnsTypes} from "../interfaces/SocketReturnsTypes.js"; /** * diff --git a/packages/third-parties/socketio/src/decorators/socketUseAfter.ts b/packages/third-parties/socketio/src/decorators/socketUseAfter.ts index 1d1b7fd1a5f..cdd705aaf3c 100644 --- a/packages/third-parties/socketio/src/decorators/socketUseAfter.ts +++ b/packages/third-parties/socketio/src/decorators/socketUseAfter.ts @@ -1,4 +1,5 @@ -import {Store, Type} from "@tsed/core"; +import type {Type} from "@tsed/core"; +import {Store} from "@tsed/core"; /** * Attach a Socket Middleware to a method or a class. diff --git a/packages/third-parties/socketio/src/decorators/socketUseBefore.ts b/packages/third-parties/socketio/src/decorators/socketUseBefore.ts index 996edfd460d..0f6f1ff9258 100644 --- a/packages/third-parties/socketio/src/decorators/socketUseBefore.ts +++ b/packages/third-parties/socketio/src/decorators/socketUseBefore.ts @@ -1,4 +1,5 @@ -import {Store, Type} from "@tsed/core"; +import type {Type} from "@tsed/core"; +import {Store} from "@tsed/core"; /** * Attach a Socket Middleware to a method or a class. diff --git a/packages/third-parties/socketio/src/interfaces/OnNamespaceInit.ts b/packages/third-parties/socketio/src/interfaces/OnNamespaceInit.ts index 69d4f0b437b..4e975f751a5 100644 --- a/packages/third-parties/socketio/src/interfaces/OnNamespaceInit.ts +++ b/packages/third-parties/socketio/src/interfaces/OnNamespaceInit.ts @@ -1,4 +1,4 @@ -import {Namespace} from "socket.io"; +import type {Namespace} from "socket.io"; /** * diff --git a/packages/third-parties/socketio/src/interfaces/SocketHandlerMetadata.ts b/packages/third-parties/socketio/src/interfaces/SocketHandlerMetadata.ts index 8e295773b7b..f68c72de4a6 100644 --- a/packages/third-parties/socketio/src/interfaces/SocketHandlerMetadata.ts +++ b/packages/third-parties/socketio/src/interfaces/SocketHandlerMetadata.ts @@ -1,5 +1,5 @@ -import {SocketParamMetadata} from "./SocketParamMetadata.js"; -import {SocketReturnsTypes} from "./SocketReturnsTypes.js"; +import type {SocketParamMetadata} from "./SocketParamMetadata.js"; +import type {SocketReturnsTypes} from "./SocketReturnsTypes.js"; /** * diff --git a/packages/third-parties/socketio/src/interfaces/SocketParamMetadata.ts b/packages/third-parties/socketio/src/interfaces/SocketParamMetadata.ts index d88d575ada9..42f93b060ec 100644 --- a/packages/third-parties/socketio/src/interfaces/SocketParamMetadata.ts +++ b/packages/third-parties/socketio/src/interfaces/SocketParamMetadata.ts @@ -1,6 +1,6 @@ -import {MetadataTypes} from "@tsed/core"; +import type {MetadataTypes} from "@tsed/core"; -import {SocketFilters} from "./SocketFilters.js"; +import type {SocketFilters} from "./SocketFilters.js"; export interface SocketParamMetadata extends Partial { filter: SocketFilters; diff --git a/packages/third-parties/socketio/src/interfaces/interfaces.ts b/packages/third-parties/socketio/src/interfaces/interfaces.ts index e30e2969aa2..a07737c3e48 100644 --- a/packages/third-parties/socketio/src/interfaces/interfaces.ts +++ b/packages/third-parties/socketio/src/interfaces/interfaces.ts @@ -1,4 +1,4 @@ -import SocketIO from "socket.io"; +import type SocketIO from "socket.io"; declare global { namespace TsED { diff --git a/packages/third-parties/socketio/src/services/SocketIOService.ts b/packages/third-parties/socketio/src/services/SocketIOService.ts index a8930c423bc..7a36dc220bc 100644 --- a/packages/third-parties/socketio/src/services/SocketIOService.ts +++ b/packages/third-parties/socketio/src/services/SocketIOService.ts @@ -1,5 +1,6 @@ -import {InjectorService, Provider, Service} from "@tsed/common"; -import * as SocketIO from "socket.io"; // tslint:disable-line: no-unused-variable +import {Service} from "@tsed/common"; +import {Inject, InjectorService, type Provider} from "@tsed/di"; +import type * as SocketIO from "socket.io"; // tslint:disable-line: no-unused-variable import {SocketHandlersBuilder} from "../class/SocketHandlersBuilder.js"; import {SocketProviderMetadata} from "../class/SocketProviderMetadata.js"; @@ -17,7 +18,7 @@ export class SocketIOService { private namespaces: Map = new Map(); constructor( - private injector: InjectorService, + @Inject(InjectorService) private injector: InjectorService, @IO private io: SocketIO.Server ) {} diff --git a/packages/third-parties/socketio/test/app/Server.ts b/packages/third-parties/socketio/test/app/Server.ts index 4df1e682861..a61fb2f68b3 100644 --- a/packages/third-parties/socketio/test/app/Server.ts +++ b/packages/third-parties/socketio/test/app/Server.ts @@ -1,8 +1,9 @@ import "@tsed/ajv"; import "@tsed/platform-express"; -import "../.."; +import "../../src/index.js"; -import {Configuration, Inject, PlatformApplication} from "@tsed/common"; +import {PlatformApplication} from "@tsed/common"; +import {Configuration, Inject} from "@tsed/common"; import bodyParser from "body-parser"; import compress from "compression"; import cookieParser from "cookie-parser"; @@ -38,7 +39,7 @@ export {rootDir}; socketIO: {} }) export class Server { - @Inject() + @Inject(PlatformApplication) app: PlatformApplication; /** diff --git a/packages/third-parties/socketio/test/app/middlewares/InitSessionMiddleware.ts b/packages/third-parties/socketio/test/app/middlewares/InitSessionMiddleware.ts index 98717badd3f..26eadfd0eea 100644 --- a/packages/third-parties/socketio/test/app/middlewares/InitSessionMiddleware.ts +++ b/packages/third-parties/socketio/test/app/middlewares/InitSessionMiddleware.ts @@ -1,6 +1,6 @@ import {Middleware, Request} from "@tsed/common"; -import {IUser} from "../models/User.js"; +import type {IUser} from "../models/User.js"; declare global { namespace Express { diff --git a/packages/third-parties/socketio/test/app/services/RoomWS.ts b/packages/third-parties/socketio/test/app/services/RoomWS.ts index c550f1b2e16..3f249c4c0a3 100644 --- a/packages/third-parties/socketio/test/app/services/RoomWS.ts +++ b/packages/third-parties/socketio/test/app/services/RoomWS.ts @@ -1,11 +1,11 @@ import {getClass, nameOf} from "@tsed/core"; -import {Namespace, Server, Socket as IOSocket} from "socket.io"; +import type {Namespace, Server, Socket as IOSocket} from "socket.io"; import {Args, Emit, Input, IO, Nsp, Socket, SocketService, SocketSession, SocketUseAfter, SocketUseBefore} from "../../.."; import {AuthSocketMiddleware} from "../middlewares/AuthSocketMiddleware.js"; import {ConverterUserSocketMiddleware} from "../middlewares/ConverterUserSocketMiddleware.js"; import {ErrorHandlerSocketMiddleware} from "../middlewares/ErrorHandlerSocketMiddleware.js"; -import {User} from "../models/User.js"; +import type {User} from "../models/User.js"; @SocketService("/room") @SocketUseBefore(AuthSocketMiddleware) diff --git a/packages/third-parties/socketio/test/socket.integration.spec.ts b/packages/third-parties/socketio/test/socket.integration.spec.ts index 85c56f3df03..7bc0eac0057 100644 --- a/packages/third-parties/socketio/test/socket.integration.spec.ts +++ b/packages/third-parties/socketio/test/socket.integration.spec.ts @@ -1,15 +1,15 @@ import {Inject, PlatformTest} from "@tsed/common"; import {PlatformExpress} from "@tsed/platform-express"; import {SocketClientService} from "@tsed/socketio-testing"; -import {Namespace, Socket as IOSocket} from "socket.io"; +import type {Namespace, Socket as IOSocket} from "socket.io"; -import {Emit, Input, Nsp, SocketIOServer, SocketNsp, SocketService, SocketSession, SocketUseBefore} from "../src/index.js"; +import {Emit, Input, Nsp, SocketNsp, SocketService, SocketSession, SocketUseBefore} from "../src/index.js"; import {ConverterUserSocketMiddleware} from "./app/middlewares/ConverterUserSocketMiddleware.js"; import {Server} from "./app/Server.js"; @SocketService("/test") export class TestWS { - @Inject() + @Inject(SocketIOServer) private io: SocketIOServer; $onConnection(socket: IOSocket, nsp: Namespace) {} @@ -31,7 +31,7 @@ export class TestWS { @SocketService(/test-.+/) export class TestWS2 { - @Inject() + @Inject(SocketIOServer) private io: SocketIOServer; @Nsp nsp: Namespace; diff --git a/packages/third-parties/socketio/tsconfig.esm.json b/packages/third-parties/socketio/tsconfig.esm.json index 82292550ddb..8954049da4a 100644 --- a/packages/third-parties/socketio/tsconfig.esm.json +++ b/packages/third-parties/socketio/tsconfig.esm.json @@ -2,7 +2,6 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", diff --git a/packages/third-parties/socketio/tsconfig.spec.json b/packages/third-parties/socketio/tsconfig.spec.json index 9835f975711..0ea8df58648 100644 --- a/packages/third-parties/socketio/tsconfig.spec.json +++ b/packages/third-parties/socketio/tsconfig.spec.json @@ -3,31 +3,31 @@ "compilerOptions": { "baseUrl": ".", "rootDir": "../..", - "outDir": "./lib/cjs", "declaration": false, "composite": false, "noEmit": true, "paths": { - "@tsed/openspec": ["../../specs/openspec/src"], - "@tsed/schema": ["../../specs/schema/src"], - "@tsed/di": ["../../di/src"], - "@tsed/exceptions": ["../../specs/exceptions/src"], - "@tsed/json-mapper": ["../../specs/json-mapper/src"], - "@tsed/platform-exceptions": ["../../platform/platform-exceptions/src"], - "@tsed/platform-middlewares": ["../../platform/platform-middlewares/src"], - "@tsed/platform-params": ["../../platform/platform-params/src"], - "@tsed/platform-log-middleware": ["../../platform/platform-log-middleware/src"], - "@tsed/platform-response-filter": ["../../platform/platform-response-filter/src"], - "@tsed/platform-router": ["../../platform/platform-router/src"], - "@tsed/platform-views": ["../../platform/platform-views/src"], - "@tsed/components-scan": ["../components-scan/src"], - "@tsed/common": ["../../platform/common/src"], - "@tsed/ajv": ["../../specs/ajv/src"], - "@tsed/platform-cache": ["../../platform/platform-cache/src"], - "@tsed/swagger": ["../../specs/swagger/src"], - "@tsed/platform-test-sdk": ["../../platform/platform-test-sdk/src"], - "@tsed/platform-express": ["../../platform/platform-express/src"], - "@tsed/platform-koa": ["../../platform/platform-koa/src"] + "@tsed/openspec": ["../../specs/openspec/src/index.ts"], + "@tsed/schema": ["../../specs/schema/src/index.ts"], + "@tsed/di": ["../../di/src/index.ts"], + "@tsed/exceptions": ["../../specs/exceptions/src/index.ts"], + "@tsed/json-mapper": ["../../specs/json-mapper/src/index.ts"], + "@tsed/platform-exceptions": ["../../platform/platform-exceptions/src/index.ts"], + "@tsed/platform-middlewares": ["../../platform/platform-middlewares/src/index.ts"], + "@tsed/platform-params": ["../../platform/platform-params/src/index.ts"], + "@tsed/platform-log-middleware": ["../../platform/platform-log-middleware/src/index.ts"], + "@tsed/platform-response-filter": ["../../platform/platform-response-filter/src/index.ts"], + "@tsed/platform-router": ["../../platform/platform-router/src/index.ts"], + "@tsed/platform-views": ["../../platform/platform-views/src/index.ts"], + "@tsed/normalize-path": ["../../utils/normalize-path/src/index.ts"], + "@tsed/components-scan": ["../components-scan/src/index.ts"], + "@tsed/common": ["../../platform/common/src/index.ts"], + "@tsed/ajv": ["../../specs/ajv/src/index.ts"], + "@tsed/platform-cache": ["../../platform/platform-cache/src/index.ts"], + "@tsed/swagger": ["../../specs/swagger/src/index.ts"], + "@tsed/platform-test-sdk": ["../../platform/platform-test-sdk/src/index.ts"], + "@tsed/platform-express": ["../../platform/platform-express/src/index.ts"], + "@tsed/platform-koa": ["../../platform/platform-koa/src/index.ts"] }, "types": ["vite/client", "vitest/globals"] }, diff --git a/packages/third-parties/sse/package.json b/packages/third-parties/sse/package.json index 74097585c10..ea8d3521727 100644 --- a/packages/third-parties/sse/package.json +++ b/packages/third-parties/sse/package.json @@ -18,7 +18,7 @@ ".": { "types": "./lib/types/index.d.ts", "import": "./lib/esm/index.js", - "default": "./lib/cjs/index.js" + "default": "./lib/esm/index.js" } }, "scripts": { diff --git a/packages/third-parties/sse/src/domain/EventStreamContext.ts b/packages/third-parties/sse/src/domain/EventStreamContext.ts index 52845ff05ee..8ff14a19dbc 100644 --- a/packages/third-parties/sse/src/domain/EventStreamContext.ts +++ b/packages/third-parties/sse/src/domain/EventStreamContext.ts @@ -1,4 +1,4 @@ -import {PlatformContext} from "@tsed/common"; +import type {PlatformContext} from "@tsed/common"; import {isBoolean, isDate, isNumber, isString} from "@tsed/core"; import {PlatformResponseFilter} from "@tsed/platform-response-filter"; import type {EventEmitter} from "events"; diff --git a/packages/third-parties/sse/src/interceptors/EventStreamInterceptor.ts b/packages/third-parties/sse/src/interceptors/EventStreamInterceptor.ts index a071a5efb2e..f0b14989715 100644 --- a/packages/third-parties/sse/src/interceptors/EventStreamInterceptor.ts +++ b/packages/third-parties/sse/src/interceptors/EventStreamInterceptor.ts @@ -5,7 +5,7 @@ import type {InterceptorContext, InterceptorMethods} from "@tsed/di"; import {Injectable} from "@tsed/di"; import type {Observable} from "rxjs"; -import {EventStreamContext} from "../domain/EventStreamContext.js"; +import type {EventStreamContext} from "../domain/EventStreamContext.js"; @Injectable() export class EventStreamInterceptor implements InterceptorMethods { diff --git a/packages/third-parties/sse/src/middlewares/EventStreamMiddleware.ts b/packages/third-parties/sse/src/middlewares/EventStreamMiddleware.ts index 326df27cc9a..0fba67ed033 100644 --- a/packages/third-parties/sse/src/middlewares/EventStreamMiddleware.ts +++ b/packages/third-parties/sse/src/middlewares/EventStreamMiddleware.ts @@ -1,4 +1,5 @@ -import {Context, PlatformContext} from "@tsed/common"; +import type {PlatformContext} from "@tsed/common"; +import {Context} from "@tsed/common"; import {Middleware} from "@tsed/platform-middlewares"; import {EventStreamContext} from "../domain/EventStreamContext.js"; diff --git a/packages/third-parties/sse/src/sse.integration.spec.ts b/packages/third-parties/sse/src/sse.integration.spec.ts index 1e3a273f944..d1b11c5ca54 100644 --- a/packages/third-parties/sse/src/sse.integration.spec.ts +++ b/packages/third-parties/sse/src/sse.integration.spec.ts @@ -1,4 +1,5 @@ -import {Context, PlatformContext, PlatformTest} from "@tsed/common"; +import type {PlatformContext} from "@tsed/common"; +import {Context, PlatformTest} from "@tsed/common"; import {Controller} from "@tsed/di"; import {Get, getSpec, JsonEntityStore, Name, Returns} from "@tsed/schema"; diff --git a/packages/third-parties/sse/tsconfig.esm.json b/packages/third-parties/sse/tsconfig.esm.json index 82292550ddb..8954049da4a 100644 --- a/packages/third-parties/sse/tsconfig.esm.json +++ b/packages/third-parties/sse/tsconfig.esm.json @@ -2,7 +2,6 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", diff --git a/packages/third-parties/sse/tsconfig.spec.json b/packages/third-parties/sse/tsconfig.spec.json index 9835f975711..0ea8df58648 100644 --- a/packages/third-parties/sse/tsconfig.spec.json +++ b/packages/third-parties/sse/tsconfig.spec.json @@ -3,31 +3,31 @@ "compilerOptions": { "baseUrl": ".", "rootDir": "../..", - "outDir": "./lib/cjs", "declaration": false, "composite": false, "noEmit": true, "paths": { - "@tsed/openspec": ["../../specs/openspec/src"], - "@tsed/schema": ["../../specs/schema/src"], - "@tsed/di": ["../../di/src"], - "@tsed/exceptions": ["../../specs/exceptions/src"], - "@tsed/json-mapper": ["../../specs/json-mapper/src"], - "@tsed/platform-exceptions": ["../../platform/platform-exceptions/src"], - "@tsed/platform-middlewares": ["../../platform/platform-middlewares/src"], - "@tsed/platform-params": ["../../platform/platform-params/src"], - "@tsed/platform-log-middleware": ["../../platform/platform-log-middleware/src"], - "@tsed/platform-response-filter": ["../../platform/platform-response-filter/src"], - "@tsed/platform-router": ["../../platform/platform-router/src"], - "@tsed/platform-views": ["../../platform/platform-views/src"], - "@tsed/components-scan": ["../components-scan/src"], - "@tsed/common": ["../../platform/common/src"], - "@tsed/ajv": ["../../specs/ajv/src"], - "@tsed/platform-cache": ["../../platform/platform-cache/src"], - "@tsed/swagger": ["../../specs/swagger/src"], - "@tsed/platform-test-sdk": ["../../platform/platform-test-sdk/src"], - "@tsed/platform-express": ["../../platform/platform-express/src"], - "@tsed/platform-koa": ["../../platform/platform-koa/src"] + "@tsed/openspec": ["../../specs/openspec/src/index.ts"], + "@tsed/schema": ["../../specs/schema/src/index.ts"], + "@tsed/di": ["../../di/src/index.ts"], + "@tsed/exceptions": ["../../specs/exceptions/src/index.ts"], + "@tsed/json-mapper": ["../../specs/json-mapper/src/index.ts"], + "@tsed/platform-exceptions": ["../../platform/platform-exceptions/src/index.ts"], + "@tsed/platform-middlewares": ["../../platform/platform-middlewares/src/index.ts"], + "@tsed/platform-params": ["../../platform/platform-params/src/index.ts"], + "@tsed/platform-log-middleware": ["../../platform/platform-log-middleware/src/index.ts"], + "@tsed/platform-response-filter": ["../../platform/platform-response-filter/src/index.ts"], + "@tsed/platform-router": ["../../platform/platform-router/src/index.ts"], + "@tsed/platform-views": ["../../platform/platform-views/src/index.ts"], + "@tsed/normalize-path": ["../../utils/normalize-path/src/index.ts"], + "@tsed/components-scan": ["../components-scan/src/index.ts"], + "@tsed/common": ["../../platform/common/src/index.ts"], + "@tsed/ajv": ["../../specs/ajv/src/index.ts"], + "@tsed/platform-cache": ["../../platform/platform-cache/src/index.ts"], + "@tsed/swagger": ["../../specs/swagger/src/index.ts"], + "@tsed/platform-test-sdk": ["../../platform/platform-test-sdk/src/index.ts"], + "@tsed/platform-express": ["../../platform/platform-express/src/index.ts"], + "@tsed/platform-koa": ["../../platform/platform-koa/src/index.ts"] }, "types": ["vite/client", "vitest/globals"] }, diff --git a/packages/third-parties/stripe/package.json b/packages/third-parties/stripe/package.json index baddbc309b6..0b7ce1c3b59 100644 --- a/packages/third-parties/stripe/package.json +++ b/packages/third-parties/stripe/package.json @@ -20,7 +20,7 @@ ".": { "types": "./lib/types/index.d.ts", "import": "./lib/esm/index.js", - "default": "./lib/cjs/index.js" + "default": "./lib/esm/index.js" } }, "scripts": { diff --git a/packages/third-parties/stripe/src/decorators/webhookEvent.ts b/packages/third-parties/stripe/src/decorators/webhookEvent.ts index 6c5a6fee78a..90638b25d00 100644 --- a/packages/third-parties/stripe/src/decorators/webhookEvent.ts +++ b/packages/third-parties/stripe/src/decorators/webhookEvent.ts @@ -4,7 +4,8 @@ import {Context} from "@tsed/platform-params"; import {In} from "@tsed/schema"; import {STRIPE_WEBHOOK_EVENT} from "../constants/constants.js"; -import {WebhookEventMiddleware, WebhookEventOptions} from "../middlewares/WebhookEventMiddleware.js"; +import type {WebhookEventOptions} from "../middlewares/WebhookEventMiddleware.js"; +import {WebhookEventMiddleware} from "../middlewares/WebhookEventMiddleware.js"; /** * Get the stripe webhook event. diff --git a/packages/third-parties/stripe/src/domain/StripeSettings.ts b/packages/third-parties/stripe/src/domain/StripeSettings.ts index 78c40d328b0..3162056becf 100644 --- a/packages/third-parties/stripe/src/domain/StripeSettings.ts +++ b/packages/third-parties/stripe/src/domain/StripeSettings.ts @@ -1,4 +1,4 @@ -import {Stripe} from "stripe"; +import type {Stripe} from "stripe"; export interface StripeSettings extends Stripe.StripeConfig { /** diff --git a/packages/third-parties/stripe/src/middlewares/WebhookEventMiddleware.ts b/packages/third-parties/stripe/src/middlewares/WebhookEventMiddleware.ts index b9b297f30f6..f48f05adcb7 100644 --- a/packages/third-parties/stripe/src/middlewares/WebhookEventMiddleware.ts +++ b/packages/third-parties/stripe/src/middlewares/WebhookEventMiddleware.ts @@ -2,7 +2,8 @@ import "../services/StripeFactory.js"; import {Constant, Inject} from "@tsed/di"; import {BadRequest, InternalServerError} from "@tsed/exceptions"; -import {Middleware, MiddlewareMethods} from "@tsed/platform-middlewares"; +import type {MiddlewareMethods} from "@tsed/platform-middlewares"; +import {Middleware} from "@tsed/platform-middlewares"; import {Context, HeaderParams, RawBodyParams} from "@tsed/platform-params"; import {Stripe} from "stripe"; @@ -15,7 +16,7 @@ export interface WebhookEventOptions { @Middleware() export class WebhookEventMiddleware implements MiddlewareMethods { - @Inject() + @Inject(Stripe) protected stripe: Stripe; @Constant("stripe.webhooks") diff --git a/packages/third-parties/stripe/src/services/StripeFactory.ts b/packages/third-parties/stripe/src/services/StripeFactory.ts index 43afcc6f141..5c872cfb744 100644 --- a/packages/third-parties/stripe/src/services/StripeFactory.ts +++ b/packages/third-parties/stripe/src/services/StripeFactory.ts @@ -1,7 +1,7 @@ import {Configuration, registerProvider} from "@tsed/di"; import {Stripe} from "stripe"; -import {StripeSettings} from "../domain/StripeSettings.js"; +import type {StripeSettings} from "../domain/StripeSettings.js"; export const StripeFactory = Stripe; diff --git a/packages/third-parties/stripe/test/app/controllers/pages/IndexCtrl.ts b/packages/third-parties/stripe/test/app/controllers/pages/IndexCtrl.ts index a814b305d48..f5e527ff6f9 100644 --- a/packages/third-parties/stripe/test/app/controllers/pages/IndexCtrl.ts +++ b/packages/third-parties/stripe/test/app/controllers/pages/IndexCtrl.ts @@ -1,6 +1,7 @@ import {Constant, Controller, Get, HeaderParams, View} from "@tsed/common"; import {Returns} from "@tsed/schema"; -import {Hidden, SwaggerSettings} from "@tsed/swagger"; +import type {SwaggerSettings} from "@tsed/swagger"; +import {Hidden} from "@tsed/swagger"; @Hidden() @Controller("/") diff --git a/packages/third-parties/stripe/test/app/controllers/rest/StripeWebhooksCtrl.ts b/packages/third-parties/stripe/test/app/controllers/rest/StripeWebhooksCtrl.ts index 7a75cbfcfae..7f299acae09 100644 --- a/packages/third-parties/stripe/test/app/controllers/rest/StripeWebhooksCtrl.ts +++ b/packages/third-parties/stripe/test/app/controllers/rest/StripeWebhooksCtrl.ts @@ -1,7 +1,7 @@ import {Controller, Post} from "@tsed/common"; -import Stripe from "stripe"; +import type Stripe from "stripe"; -import {WebhookEvent} from "../../../.."; +import {WebhookEvent} from "../../../../src/index.js"; @Controller("/webhooks") export class StripeWebhooksCtrl { diff --git a/packages/third-parties/stripe/tsconfig.esm.json b/packages/third-parties/stripe/tsconfig.esm.json index 82292550ddb..8954049da4a 100644 --- a/packages/third-parties/stripe/tsconfig.esm.json +++ b/packages/third-parties/stripe/tsconfig.esm.json @@ -2,7 +2,6 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", diff --git a/packages/third-parties/stripe/tsconfig.spec.json b/packages/third-parties/stripe/tsconfig.spec.json index 9835f975711..0ea8df58648 100644 --- a/packages/third-parties/stripe/tsconfig.spec.json +++ b/packages/third-parties/stripe/tsconfig.spec.json @@ -3,31 +3,31 @@ "compilerOptions": { "baseUrl": ".", "rootDir": "../..", - "outDir": "./lib/cjs", "declaration": false, "composite": false, "noEmit": true, "paths": { - "@tsed/openspec": ["../../specs/openspec/src"], - "@tsed/schema": ["../../specs/schema/src"], - "@tsed/di": ["../../di/src"], - "@tsed/exceptions": ["../../specs/exceptions/src"], - "@tsed/json-mapper": ["../../specs/json-mapper/src"], - "@tsed/platform-exceptions": ["../../platform/platform-exceptions/src"], - "@tsed/platform-middlewares": ["../../platform/platform-middlewares/src"], - "@tsed/platform-params": ["../../platform/platform-params/src"], - "@tsed/platform-log-middleware": ["../../platform/platform-log-middleware/src"], - "@tsed/platform-response-filter": ["../../platform/platform-response-filter/src"], - "@tsed/platform-router": ["../../platform/platform-router/src"], - "@tsed/platform-views": ["../../platform/platform-views/src"], - "@tsed/components-scan": ["../components-scan/src"], - "@tsed/common": ["../../platform/common/src"], - "@tsed/ajv": ["../../specs/ajv/src"], - "@tsed/platform-cache": ["../../platform/platform-cache/src"], - "@tsed/swagger": ["../../specs/swagger/src"], - "@tsed/platform-test-sdk": ["../../platform/platform-test-sdk/src"], - "@tsed/platform-express": ["../../platform/platform-express/src"], - "@tsed/platform-koa": ["../../platform/platform-koa/src"] + "@tsed/openspec": ["../../specs/openspec/src/index.ts"], + "@tsed/schema": ["../../specs/schema/src/index.ts"], + "@tsed/di": ["../../di/src/index.ts"], + "@tsed/exceptions": ["../../specs/exceptions/src/index.ts"], + "@tsed/json-mapper": ["../../specs/json-mapper/src/index.ts"], + "@tsed/platform-exceptions": ["../../platform/platform-exceptions/src/index.ts"], + "@tsed/platform-middlewares": ["../../platform/platform-middlewares/src/index.ts"], + "@tsed/platform-params": ["../../platform/platform-params/src/index.ts"], + "@tsed/platform-log-middleware": ["../../platform/platform-log-middleware/src/index.ts"], + "@tsed/platform-response-filter": ["../../platform/platform-response-filter/src/index.ts"], + "@tsed/platform-router": ["../../platform/platform-router/src/index.ts"], + "@tsed/platform-views": ["../../platform/platform-views/src/index.ts"], + "@tsed/normalize-path": ["../../utils/normalize-path/src/index.ts"], + "@tsed/components-scan": ["../components-scan/src/index.ts"], + "@tsed/common": ["../../platform/common/src/index.ts"], + "@tsed/ajv": ["../../specs/ajv/src/index.ts"], + "@tsed/platform-cache": ["../../platform/platform-cache/src/index.ts"], + "@tsed/swagger": ["../../specs/swagger/src/index.ts"], + "@tsed/platform-test-sdk": ["../../platform/platform-test-sdk/src/index.ts"], + "@tsed/platform-express": ["../../platform/platform-express/src/index.ts"], + "@tsed/platform-koa": ["../../platform/platform-koa/src/index.ts"] }, "types": ["vite/client", "vitest/globals"] }, diff --git a/packages/third-parties/temporal/package.json b/packages/third-parties/temporal/package.json index e9de3973178..d6a5009f1c7 100644 --- a/packages/third-parties/temporal/package.json +++ b/packages/third-parties/temporal/package.json @@ -11,7 +11,7 @@ ".": { "types": "./lib/types/index.d.ts", "import": "./lib/esm/index.js", - "default": "./lib/cjs/index.js" + "default": "./lib/esm/index.js" } }, "scripts": { diff --git a/packages/third-parties/temporal/src/TemporalModule.ts b/packages/third-parties/temporal/src/TemporalModule.ts index 5925720f1ae..029b75b003a 100644 --- a/packages/third-parties/temporal/src/TemporalModule.ts +++ b/packages/third-parties/temporal/src/TemporalModule.ts @@ -1,20 +1,21 @@ -import {Logger} from "@tsed/common"; import {classOf} from "@tsed/core"; -import {Inject, InjectorService, Module, Provider} from "@tsed/di"; +import {Inject, InjectorService, Module} from "@tsed/di"; +import {Logger} from "@tsed/logger"; import {PROVIDER_TYPE_TEMPORAL} from "./constants.js"; -import {TEMPORAL_STORE_KEY, TemporalStore} from "./interfaces/TemporalStore.js"; +import type {TemporalStore} from "./interfaces/TemporalStore.js"; +import {TEMPORAL_STORE_KEY} from "./interfaces/TemporalStore.js"; import {TemporalClient} from "./services/TemporalFactory.js"; @Module() export class TemporalModule { - @Inject() + @Inject(Logger) protected logger!: Logger; - @Inject() + @Inject(InjectorService) protected injector!: InjectorService; - @Inject() + @Inject(TemporalClient) protected client!: TemporalClient; constructor(@Inject(PROVIDER_TYPE_TEMPORAL) private temporalServices: any[]) {} diff --git a/packages/third-parties/temporal/src/decorators/activity.ts b/packages/third-parties/temporal/src/decorators/activity.ts index b5fc3ca94d5..90e01f587fd 100644 --- a/packages/third-parties/temporal/src/decorators/activity.ts +++ b/packages/third-parties/temporal/src/decorators/activity.ts @@ -1,6 +1,7 @@ import {Store} from "@tsed/core"; -import {ActivityOptions, TEMPORAL_STORE_KEY, TemporalStore} from "../interfaces/TemporalStore.js"; +import type {ActivityOptions, TemporalStore} from "../interfaces/TemporalStore.js"; +import {TEMPORAL_STORE_KEY} from "../interfaces/TemporalStore.js"; export function Activity(options: ActivityOptions = {}): MethodDecorator { return (target: any, propertyKey: string | symbol) => { diff --git a/packages/third-parties/temporal/src/interfaces/interfaces.ts b/packages/third-parties/temporal/src/interfaces/interfaces.ts index e81a3d46c28..9051a1b9e0b 100644 --- a/packages/third-parties/temporal/src/interfaces/interfaces.ts +++ b/packages/third-parties/temporal/src/interfaces/interfaces.ts @@ -1,4 +1,4 @@ -import {ClientOptions, ConnectionOptions} from "@temporalio/client"; +import type {ClientOptions, ConnectionOptions} from "@temporalio/client"; declare global { namespace TsED { diff --git a/packages/third-parties/temporal/src/utils/worker.ts b/packages/third-parties/temporal/src/utils/worker.ts index b3b9fdc4304..481b7a36ace 100644 --- a/packages/third-parties/temporal/src/utils/worker.ts +++ b/packages/third-parties/temporal/src/utils/worker.ts @@ -1,5 +1,7 @@ -import {NativeConnection, NativeConnectionOptions, Worker, WorkerOptions} from "@temporalio/worker"; -import {PlatformBuilderSettings, PlatformTest} from "@tsed/common"; +import type {NativeConnectionOptions, WorkerOptions} from "@temporalio/worker"; +import {NativeConnection, Worker} from "@temporalio/worker"; +import type {PlatformBuilderSettings} from "@tsed/common"; +import {PlatformTest} from "@tsed/common"; import {$log} from "@tsed/logger"; import {TemporalModule} from "../TemporalModule.js"; diff --git a/packages/third-parties/temporal/test/helpers/Server.ts b/packages/third-parties/temporal/test/helpers/Server.ts index 8540e323d19..f86352f1857 100644 --- a/packages/third-parties/temporal/test/helpers/Server.ts +++ b/packages/third-parties/temporal/test/helpers/Server.ts @@ -1,7 +1,8 @@ import "@tsed/platform-express"; -import "../.."; +import "../../index.js"; -import {Configuration, Inject, PlatformApplication} from "@tsed/common"; +import {PlatformApplication} from "@tsed/common"; +import {Configuration, Inject} from "@tsed/common"; import bodyParser from "body-parser"; import compress from "compression"; import cookieParser from "cookie-parser"; @@ -16,7 +17,7 @@ const rootDir = import.meta.dirname; httpsPort: false }) export class Server { - @Inject() + @Inject(PlatformApplication) app: PlatformApplication; public $beforeRoutesInit(): void { diff --git a/packages/third-parties/temporal/tsconfig.esm.json b/packages/third-parties/temporal/tsconfig.esm.json index 82292550ddb..8954049da4a 100644 --- a/packages/third-parties/temporal/tsconfig.esm.json +++ b/packages/third-parties/temporal/tsconfig.esm.json @@ -2,7 +2,6 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", diff --git a/packages/third-parties/temporal/tsconfig.spec.json b/packages/third-parties/temporal/tsconfig.spec.json index 9835f975711..0ea8df58648 100644 --- a/packages/third-parties/temporal/tsconfig.spec.json +++ b/packages/third-parties/temporal/tsconfig.spec.json @@ -3,31 +3,31 @@ "compilerOptions": { "baseUrl": ".", "rootDir": "../..", - "outDir": "./lib/cjs", "declaration": false, "composite": false, "noEmit": true, "paths": { - "@tsed/openspec": ["../../specs/openspec/src"], - "@tsed/schema": ["../../specs/schema/src"], - "@tsed/di": ["../../di/src"], - "@tsed/exceptions": ["../../specs/exceptions/src"], - "@tsed/json-mapper": ["../../specs/json-mapper/src"], - "@tsed/platform-exceptions": ["../../platform/platform-exceptions/src"], - "@tsed/platform-middlewares": ["../../platform/platform-middlewares/src"], - "@tsed/platform-params": ["../../platform/platform-params/src"], - "@tsed/platform-log-middleware": ["../../platform/platform-log-middleware/src"], - "@tsed/platform-response-filter": ["../../platform/platform-response-filter/src"], - "@tsed/platform-router": ["../../platform/platform-router/src"], - "@tsed/platform-views": ["../../platform/platform-views/src"], - "@tsed/components-scan": ["../components-scan/src"], - "@tsed/common": ["../../platform/common/src"], - "@tsed/ajv": ["../../specs/ajv/src"], - "@tsed/platform-cache": ["../../platform/platform-cache/src"], - "@tsed/swagger": ["../../specs/swagger/src"], - "@tsed/platform-test-sdk": ["../../platform/platform-test-sdk/src"], - "@tsed/platform-express": ["../../platform/platform-express/src"], - "@tsed/platform-koa": ["../../platform/platform-koa/src"] + "@tsed/openspec": ["../../specs/openspec/src/index.ts"], + "@tsed/schema": ["../../specs/schema/src/index.ts"], + "@tsed/di": ["../../di/src/index.ts"], + "@tsed/exceptions": ["../../specs/exceptions/src/index.ts"], + "@tsed/json-mapper": ["../../specs/json-mapper/src/index.ts"], + "@tsed/platform-exceptions": ["../../platform/platform-exceptions/src/index.ts"], + "@tsed/platform-middlewares": ["../../platform/platform-middlewares/src/index.ts"], + "@tsed/platform-params": ["../../platform/platform-params/src/index.ts"], + "@tsed/platform-log-middleware": ["../../platform/platform-log-middleware/src/index.ts"], + "@tsed/platform-response-filter": ["../../platform/platform-response-filter/src/index.ts"], + "@tsed/platform-router": ["../../platform/platform-router/src/index.ts"], + "@tsed/platform-views": ["../../platform/platform-views/src/index.ts"], + "@tsed/normalize-path": ["../../utils/normalize-path/src/index.ts"], + "@tsed/components-scan": ["../components-scan/src/index.ts"], + "@tsed/common": ["../../platform/common/src/index.ts"], + "@tsed/ajv": ["../../specs/ajv/src/index.ts"], + "@tsed/platform-cache": ["../../platform/platform-cache/src/index.ts"], + "@tsed/swagger": ["../../specs/swagger/src/index.ts"], + "@tsed/platform-test-sdk": ["../../platform/platform-test-sdk/src/index.ts"], + "@tsed/platform-express": ["../../platform/platform-express/src/index.ts"], + "@tsed/platform-koa": ["../../platform/platform-koa/src/index.ts"] }, "types": ["vite/client", "vitest/globals"] }, diff --git a/packages/third-parties/terminus/package.json b/packages/third-parties/terminus/package.json index d5593a7ac05..d83ec9f6d0a 100644 --- a/packages/third-parties/terminus/package.json +++ b/packages/third-parties/terminus/package.json @@ -12,7 +12,7 @@ ".": { "types": "./lib/types/index.d.ts", "import": "./lib/esm/index.js", - "default": "./lib/cjs/index.js" + "default": "./lib/esm/index.js" } }, "scripts": { diff --git a/packages/third-parties/terminus/src/TerminusModule.ts b/packages/third-parties/terminus/src/TerminusModule.ts index e6a40e208cd..6070dba2d76 100644 --- a/packages/third-parties/terminus/src/TerminusModule.ts +++ b/packages/third-parties/terminus/src/TerminusModule.ts @@ -1,11 +1,11 @@ import {createTerminus} from "@godaddy/terminus"; import type {PlatformRouteDetails} from "@tsed/common"; -import {Constant, Inject, InjectorService, Module, OnInit, Provider} from "@tsed/di"; +import {Constant, Inject, InjectorService, Module, type OnInit, type Provider} from "@tsed/di"; import {concatPath} from "@tsed/schema"; import Http from "http"; import Https from "https"; -import {TerminusSettings} from "./interfaces/TerminusSettings.js"; +import type {TerminusSettings} from "./interfaces/TerminusSettings.js"; @Module() export class TerminusModule implements OnInit { @@ -15,7 +15,7 @@ export class TerminusModule implements OnInit { @Constant("terminus.path", "/health") private basePath: string; - @Inject() + @Inject(InjectorService) private injector: InjectorService; @Inject(Http.Server) diff --git a/packages/third-parties/terminus/src/interfaces/TerminusSettings.ts b/packages/third-parties/terminus/src/interfaces/TerminusSettings.ts index edb048ad4ac..012832d01b8 100644 --- a/packages/third-parties/terminus/src/interfaces/TerminusSettings.ts +++ b/packages/third-parties/terminus/src/interfaces/TerminusSettings.ts @@ -1,4 +1,4 @@ -import {TerminusOptions} from "@godaddy/terminus"; +import type {TerminusOptions} from "@godaddy/terminus"; export type TerminusSettings = Omit< TerminusOptions, diff --git a/packages/third-parties/terminus/src/interfaces/interfaces.ts b/packages/third-parties/terminus/src/interfaces/interfaces.ts index 655ad4cbc68..fc74dc89b48 100644 --- a/packages/third-parties/terminus/src/interfaces/interfaces.ts +++ b/packages/third-parties/terminus/src/interfaces/interfaces.ts @@ -1,4 +1,4 @@ -import {TerminusSettings} from "./TerminusSettings.js"; +import type {TerminusSettings} from "./TerminusSettings.js"; declare global { namespace TsED { diff --git a/packages/third-parties/terminus/test/app/Server.ts b/packages/third-parties/terminus/test/app/Server.ts index 4a408c76bc9..23395075dba 100644 --- a/packages/third-parties/terminus/test/app/Server.ts +++ b/packages/third-parties/terminus/test/app/Server.ts @@ -7,7 +7,7 @@ import {PlatformApplication} from "@tsed/common"; import {Configuration, Inject} from "@tsed/di"; import bodyParser from "body-parser"; import cookieParser from "cookie-parser"; -import {Application} from "express"; +import type {Application} from "express"; const rootDir = import.meta.dirname; export {rootDir}; @@ -28,6 +28,6 @@ export {rootDir}; ] }) export class Server { - @Inject() + @Inject(PlatformApplication) app: PlatformApplication; } diff --git a/packages/third-parties/terminus/tsconfig.esm.json b/packages/third-parties/terminus/tsconfig.esm.json index 82292550ddb..8954049da4a 100644 --- a/packages/third-parties/terminus/tsconfig.esm.json +++ b/packages/third-parties/terminus/tsconfig.esm.json @@ -2,7 +2,6 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", diff --git a/packages/third-parties/terminus/tsconfig.spec.json b/packages/third-parties/terminus/tsconfig.spec.json index 9835f975711..0ea8df58648 100644 --- a/packages/third-parties/terminus/tsconfig.spec.json +++ b/packages/third-parties/terminus/tsconfig.spec.json @@ -3,31 +3,31 @@ "compilerOptions": { "baseUrl": ".", "rootDir": "../..", - "outDir": "./lib/cjs", "declaration": false, "composite": false, "noEmit": true, "paths": { - "@tsed/openspec": ["../../specs/openspec/src"], - "@tsed/schema": ["../../specs/schema/src"], - "@tsed/di": ["../../di/src"], - "@tsed/exceptions": ["../../specs/exceptions/src"], - "@tsed/json-mapper": ["../../specs/json-mapper/src"], - "@tsed/platform-exceptions": ["../../platform/platform-exceptions/src"], - "@tsed/platform-middlewares": ["../../platform/platform-middlewares/src"], - "@tsed/platform-params": ["../../platform/platform-params/src"], - "@tsed/platform-log-middleware": ["../../platform/platform-log-middleware/src"], - "@tsed/platform-response-filter": ["../../platform/platform-response-filter/src"], - "@tsed/platform-router": ["../../platform/platform-router/src"], - "@tsed/platform-views": ["../../platform/platform-views/src"], - "@tsed/components-scan": ["../components-scan/src"], - "@tsed/common": ["../../platform/common/src"], - "@tsed/ajv": ["../../specs/ajv/src"], - "@tsed/platform-cache": ["../../platform/platform-cache/src"], - "@tsed/swagger": ["../../specs/swagger/src"], - "@tsed/platform-test-sdk": ["../../platform/platform-test-sdk/src"], - "@tsed/platform-express": ["../../platform/platform-express/src"], - "@tsed/platform-koa": ["../../platform/platform-koa/src"] + "@tsed/openspec": ["../../specs/openspec/src/index.ts"], + "@tsed/schema": ["../../specs/schema/src/index.ts"], + "@tsed/di": ["../../di/src/index.ts"], + "@tsed/exceptions": ["../../specs/exceptions/src/index.ts"], + "@tsed/json-mapper": ["../../specs/json-mapper/src/index.ts"], + "@tsed/platform-exceptions": ["../../platform/platform-exceptions/src/index.ts"], + "@tsed/platform-middlewares": ["../../platform/platform-middlewares/src/index.ts"], + "@tsed/platform-params": ["../../platform/platform-params/src/index.ts"], + "@tsed/platform-log-middleware": ["../../platform/platform-log-middleware/src/index.ts"], + "@tsed/platform-response-filter": ["../../platform/platform-response-filter/src/index.ts"], + "@tsed/platform-router": ["../../platform/platform-router/src/index.ts"], + "@tsed/platform-views": ["../../platform/platform-views/src/index.ts"], + "@tsed/normalize-path": ["../../utils/normalize-path/src/index.ts"], + "@tsed/components-scan": ["../components-scan/src/index.ts"], + "@tsed/common": ["../../platform/common/src/index.ts"], + "@tsed/ajv": ["../../specs/ajv/src/index.ts"], + "@tsed/platform-cache": ["../../platform/platform-cache/src/index.ts"], + "@tsed/swagger": ["../../specs/swagger/src/index.ts"], + "@tsed/platform-test-sdk": ["../../platform/platform-test-sdk/src/index.ts"], + "@tsed/platform-express": ["../../platform/platform-express/src/index.ts"], + "@tsed/platform-koa": ["../../platform/platform-koa/src/index.ts"] }, "types": ["vite/client", "vitest/globals"] }, diff --git a/packages/third-parties/vike/package.json b/packages/third-parties/vike/package.json index 2132e1704c5..a59ccde0de4 100644 --- a/packages/third-parties/vike/package.json +++ b/packages/third-parties/vike/package.json @@ -16,7 +16,7 @@ ".": { "types": "./lib/types/index.d.ts", "import": "./lib/esm/index.js", - "default": "./lib/cjs/index.js" + "default": "./lib/esm/index.js" } }, "scripts": { diff --git a/packages/third-parties/vike/src/ViteModule.ts b/packages/third-parties/vike/src/ViteModule.ts index a43bb9a7b61..158aa615646 100644 --- a/packages/third-parties/vike/src/ViteModule.ts +++ b/packages/third-parties/vike/src/ViteModule.ts @@ -1,6 +1,6 @@ import {PlatformApplication} from "@tsed/common"; import {Inject, Module} from "@tsed/di"; -import {PlatformRenderOptions, PlatformViews} from "@tsed/platform-views"; +import {type PlatformRenderOptions, PlatformViews} from "@tsed/platform-views"; import compress from "compression"; import {ViteRendererMiddleware} from "./middlewares/ViteRendererMiddleware.js"; @@ -11,13 +11,13 @@ import {ViteService} from "./services/ViteService.js"; imports: [] }) export class ViteModule { - @Inject() + @Inject(PlatformApplication) protected app: PlatformApplication; - @Inject() + @Inject(PlatformViews) protected platformView: PlatformViews; - @Inject() + @Inject(ViteService) protected viteService: ViteService; @Inject(VITE_SERVER) diff --git a/packages/third-parties/vike/src/interfaces/ViteConfig.ts b/packages/third-parties/vike/src/interfaces/ViteConfig.ts index dc11d36d9a6..9312910c522 100644 --- a/packages/third-parties/vike/src/interfaces/ViteConfig.ts +++ b/packages/third-parties/vike/src/interfaces/ViteConfig.ts @@ -1,4 +1,4 @@ -import {Options} from "sirv"; +import type {Options} from "sirv"; // @ts-ignore import type {InlineConfig} from "vite"; diff --git a/packages/third-parties/vike/src/interfaces/interfaces.ts b/packages/third-parties/vike/src/interfaces/interfaces.ts index effb48aa42d..3f16e89677e 100644 --- a/packages/third-parties/vike/src/interfaces/interfaces.ts +++ b/packages/third-parties/vike/src/interfaces/interfaces.ts @@ -1,4 +1,4 @@ -import {ViteConfig} from "./ViteConfig.js"; +import type {ViteConfig} from "./ViteConfig.js"; declare global { namespace TsED { diff --git a/packages/third-parties/vike/src/middlewares/ViteRendererMiddleware.ts b/packages/third-parties/vike/src/middlewares/ViteRendererMiddleware.ts index 0d4f66ab2de..441e8e1c7aa 100644 --- a/packages/third-parties/vike/src/middlewares/ViteRendererMiddleware.ts +++ b/packages/third-parties/vike/src/middlewares/ViteRendererMiddleware.ts @@ -1,7 +1,7 @@ import {Context, Middleware} from "@tsed/common"; import {Inject} from "@tsed/di"; -import {ViteService} from "../services/ViteService.js"; +import type {ViteService} from "../services/ViteService.js"; @Middleware() export class ViteRendererMiddleware { diff --git a/packages/third-parties/vike/src/services/ViteServer.ts b/packages/third-parties/vike/src/services/ViteServer.ts index e4dba55276f..87e93e23a21 100644 --- a/packages/third-parties/vike/src/services/ViteServer.ts +++ b/packages/third-parties/vike/src/services/ViteServer.ts @@ -4,7 +4,7 @@ import {Configuration, registerProvider} from "@tsed/di"; // @ts-ignore import type {InlineConfig, ViteDevServer} from "vite"; -import {ViteConfig} from "../interfaces/ViteConfig.js"; +import type {ViteConfig} from "../interfaces/ViteConfig.js"; export const VITE_SERVER = Symbol.for("VITE_DEV_SERVER"); export type VITE_SERVER = ViteDevServer; diff --git a/packages/third-parties/vike/src/services/ViteService.ts b/packages/third-parties/vike/src/services/ViteService.ts index 31932bf843f..22c5182d0b0 100644 --- a/packages/third-parties/vike/src/services/ViteService.ts +++ b/packages/third-parties/vike/src/services/ViteService.ts @@ -1,9 +1,10 @@ -import {Constant, PlatformContext} from "@tsed/common"; +import type {PlatformContext} from "@tsed/common"; +import {Constant} from "@tsed/common"; import {Injectable} from "@tsed/di"; -import {Writable} from "stream"; +import type {Writable} from "stream"; -import {ViteConfig} from "../interfaces/ViteConfig.js"; -import {ViteRenderContext} from "../interfaces/ViteRenderContext.js"; +import type {ViteConfig} from "../interfaces/ViteConfig.js"; +import type {ViteRenderContext} from "../interfaces/ViteRenderContext.js"; @Injectable() export class ViteService { diff --git a/packages/third-parties/vike/tsconfig.esm.json b/packages/third-parties/vike/tsconfig.esm.json index 82292550ddb..8954049da4a 100644 --- a/packages/third-parties/vike/tsconfig.esm.json +++ b/packages/third-parties/vike/tsconfig.esm.json @@ -2,7 +2,6 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", diff --git a/packages/third-parties/vike/tsconfig.spec.json b/packages/third-parties/vike/tsconfig.spec.json index 9835f975711..0ea8df58648 100644 --- a/packages/third-parties/vike/tsconfig.spec.json +++ b/packages/third-parties/vike/tsconfig.spec.json @@ -3,31 +3,31 @@ "compilerOptions": { "baseUrl": ".", "rootDir": "../..", - "outDir": "./lib/cjs", "declaration": false, "composite": false, "noEmit": true, "paths": { - "@tsed/openspec": ["../../specs/openspec/src"], - "@tsed/schema": ["../../specs/schema/src"], - "@tsed/di": ["../../di/src"], - "@tsed/exceptions": ["../../specs/exceptions/src"], - "@tsed/json-mapper": ["../../specs/json-mapper/src"], - "@tsed/platform-exceptions": ["../../platform/platform-exceptions/src"], - "@tsed/platform-middlewares": ["../../platform/platform-middlewares/src"], - "@tsed/platform-params": ["../../platform/platform-params/src"], - "@tsed/platform-log-middleware": ["../../platform/platform-log-middleware/src"], - "@tsed/platform-response-filter": ["../../platform/platform-response-filter/src"], - "@tsed/platform-router": ["../../platform/platform-router/src"], - "@tsed/platform-views": ["../../platform/platform-views/src"], - "@tsed/components-scan": ["../components-scan/src"], - "@tsed/common": ["../../platform/common/src"], - "@tsed/ajv": ["../../specs/ajv/src"], - "@tsed/platform-cache": ["../../platform/platform-cache/src"], - "@tsed/swagger": ["../../specs/swagger/src"], - "@tsed/platform-test-sdk": ["../../platform/platform-test-sdk/src"], - "@tsed/platform-express": ["../../platform/platform-express/src"], - "@tsed/platform-koa": ["../../platform/platform-koa/src"] + "@tsed/openspec": ["../../specs/openspec/src/index.ts"], + "@tsed/schema": ["../../specs/schema/src/index.ts"], + "@tsed/di": ["../../di/src/index.ts"], + "@tsed/exceptions": ["../../specs/exceptions/src/index.ts"], + "@tsed/json-mapper": ["../../specs/json-mapper/src/index.ts"], + "@tsed/platform-exceptions": ["../../platform/platform-exceptions/src/index.ts"], + "@tsed/platform-middlewares": ["../../platform/platform-middlewares/src/index.ts"], + "@tsed/platform-params": ["../../platform/platform-params/src/index.ts"], + "@tsed/platform-log-middleware": ["../../platform/platform-log-middleware/src/index.ts"], + "@tsed/platform-response-filter": ["../../platform/platform-response-filter/src/index.ts"], + "@tsed/platform-router": ["../../platform/platform-router/src/index.ts"], + "@tsed/platform-views": ["../../platform/platform-views/src/index.ts"], + "@tsed/normalize-path": ["../../utils/normalize-path/src/index.ts"], + "@tsed/components-scan": ["../components-scan/src/index.ts"], + "@tsed/common": ["../../platform/common/src/index.ts"], + "@tsed/ajv": ["../../specs/ajv/src/index.ts"], + "@tsed/platform-cache": ["../../platform/platform-cache/src/index.ts"], + "@tsed/swagger": ["../../specs/swagger/src/index.ts"], + "@tsed/platform-test-sdk": ["../../platform/platform-test-sdk/src/index.ts"], + "@tsed/platform-express": ["../../platform/platform-express/src/index.ts"], + "@tsed/platform-koa": ["../../platform/platform-koa/src/index.ts"] }, "types": ["vite/client", "vitest/globals"] }, diff --git a/packages/utils/normalize-path/package.json b/packages/utils/normalize-path/package.json index f46283d9ce6..d966108ddcb 100644 --- a/packages/utils/normalize-path/package.json +++ b/packages/utils/normalize-path/package.json @@ -11,7 +11,7 @@ ".": { "types": "./lib/types/index.d.ts", "import": "./lib/esm/index.js", - "default": "./lib/cjs/index.js" + "default": "./lib/esm/index.js" } }, "scripts": { diff --git a/packages/utils/normalize-path/tsconfig.esm.json b/packages/utils/normalize-path/tsconfig.esm.json index 82292550ddb..8954049da4a 100644 --- a/packages/utils/normalize-path/tsconfig.esm.json +++ b/packages/utils/normalize-path/tsconfig.esm.json @@ -2,7 +2,6 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", diff --git a/packages/utils/normalize-path/tsconfig.spec.json b/packages/utils/normalize-path/tsconfig.spec.json index 2e917f4b39d..d85cc8e5c3b 100644 --- a/packages/utils/normalize-path/tsconfig.spec.json +++ b/packages/utils/normalize-path/tsconfig.spec.json @@ -3,31 +3,30 @@ "compilerOptions": { "baseUrl": ".", "rootDir": "../..", - "outDir": "./lib/cjs", "declaration": false, "composite": false, "noEmit": true, "paths": { - "@tsed/openspec": ["../../specs/openspec/src"], - "@tsed/schema": ["../../specs/schema/src"], - "@tsed/di": ["../../di/src"], - "@tsed/exceptions": ["../../specs/exceptions/src"], - "@tsed/json-mapper": ["../../specs/json-mapper/src"], - "@tsed/platform-exceptions": ["../../platform/platform-exceptions/src"], - "@tsed/platform-middlewares": ["../../platform/platform-middlewares/src"], - "@tsed/platform-params": ["../../platform/platform-params/src"], - "@tsed/platform-log-middleware": ["../../platform/platform-log-middleware/src"], - "@tsed/platform-response-filter": ["../../platform/platform-response-filter/src"], - "@tsed/platform-router": ["../../platform/platform-router/src"], - "@tsed/platform-views": ["../../platform/platform-views/src"], - "@tsed/components-scan": ["../../third-parties/components-scan/src"], - "@tsed/common": ["../../platform/common/src"], - "@tsed/ajv": ["../../specs/ajv/src"], - "@tsed/platform-cache": ["../../platform/platform-cache/src"], - "@tsed/swagger": ["../../specs/swagger/src"], - "@tsed/platform-test-sdk": ["../../platform/platform-test-sdk/src"], - "@tsed/platform-express": ["../../platform/platform-express/src"], - "@tsed/platform-koa": ["../../platform/platform-koa/src"] + "@tsed/openspec": ["../../specs/openspec/src/index.ts"], + "@tsed/schema": ["../../specs/schema/src/index.ts"], + "@tsed/di": ["../../di/src/index.ts"], + "@tsed/exceptions": ["../../specs/exceptions/src/index.ts"], + "@tsed/json-mapper": ["../../specs/json-mapper/src/index.ts"], + "@tsed/platform-exceptions": ["../../platform/platform-exceptions/src/index.ts"], + "@tsed/platform-middlewares": ["../../platform/platform-middlewares/src/index.ts"], + "@tsed/platform-params": ["../../platform/platform-params/src/index.ts"], + "@tsed/platform-log-middleware": ["../../platform/platform-log-middleware/src/index.ts"], + "@tsed/platform-response-filter": ["../../platform/platform-response-filter/src/index.ts"], + "@tsed/platform-router": ["../../platform/platform-router/src/index.ts"], + "@tsed/platform-views": ["../../platform/platform-views/src/index.ts"], + "@tsed/components-scan": ["../../third-parties/components-scan/src/index.ts"], + "@tsed/common": ["../../platform/common/src/index.ts"], + "@tsed/ajv": ["../../specs/ajv/src/index.ts"], + "@tsed/platform-cache": ["../../platform/platform-cache/src/index.ts"], + "@tsed/swagger": ["../../specs/swagger/src/index.ts"], + "@tsed/platform-test-sdk": ["../../platform/platform-test-sdk/src/index.ts"], + "@tsed/platform-express": ["../../platform/platform-express/src/index.ts"], + "@tsed/platform-koa": ["../../platform/platform-koa/src/index.ts"] }, "types": ["vite/client", "vitest/globals"] }, diff --git a/tools/integration/src/Server.ts b/tools/integration/src/Server.ts index a38385c9a9b..80f1abb5399 100644 --- a/tools/integration/src/Server.ts +++ b/tools/integration/src/Server.ts @@ -50,7 +50,7 @@ import * as rest from "./controllers/rest/index.js"; exclude: ["**/*.spec.ts"] }) export class Server { - @Inject() + @Inject(PlatformApplication) protected app: PlatformApplication; @Configuration() diff --git a/tools/integration/src/controllers/pages/IndexController.ts b/tools/integration/src/controllers/pages/IndexController.ts index 6e7d2b66983..222d8e104f9 100644 --- a/tools/integration/src/controllers/pages/IndexController.ts +++ b/tools/integration/src/controllers/pages/IndexController.ts @@ -2,7 +2,7 @@ import {Constant, Controller} from "@tsed/di"; import {HeaderParams} from "@tsed/platform-params"; import {View} from "@tsed/platform-views"; import {Get, Hidden, Returns} from "@tsed/schema"; -import {SwaggerSettings} from "@tsed/swagger"; +import type {SwaggerSettings} from "@tsed/swagger"; @Hidden() @Controller("/") diff --git a/tools/integration/tsconfig.esm.json b/tools/integration/tsconfig.esm.json index 82292550ddb..8954049da4a 100644 --- a/tools/integration/tsconfig.esm.json +++ b/tools/integration/tsconfig.esm.json @@ -2,7 +2,6 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", diff --git a/tools/typescript/index.js b/tools/typescript/index.js index 78734015678..08dc7a398c7 100644 --- a/tools/typescript/index.js +++ b/tools/typescript/index.js @@ -90,13 +90,14 @@ async function main() { ((dep.path.includes("/platform") && !dep.path.includes("serverless")) || dep.path.includes("/components-scan") || dep.path.includes("/spec") || + dep.path.includes("/normalize-path") || dep.path.includes("/di")) && !deps.has(dep.name) && pkg.name !== dep.name ); }) .forEach((dep) => { - paths["@tsed/" + dep.name] = [relative(dirname(pkg.path), dirname(dep.path)) + "/src"]; + paths["@tsed/" + dep.name] = [relative(dirname(pkg.path), dirname(dep.path)) + "/src/index.ts"]; }); const tsCopy = cloneDeep(tsConfigTemplateSpec); tsCopy.compilerOptions.paths = paths; diff --git a/tools/typescript/tsconfig.node.json b/tools/typescript/tsconfig.node.json index d33c15321b4..fa2761b4794 100644 --- a/tools/typescript/tsconfig.node.json +++ b/tools/typescript/tsconfig.node.json @@ -23,6 +23,7 @@ "noResolve": false, "preserveConstEnums": true, "sourceMap": true, + "verbatimModuleSyntax": true, "noEmit": true } } diff --git a/tools/typescript/tsconfig.template.esm.json b/tools/typescript/tsconfig.template.esm.json index 82292550ddb..8954049da4a 100644 --- a/tools/typescript/tsconfig.template.esm.json +++ b/tools/typescript/tsconfig.template.esm.json @@ -2,7 +2,6 @@ "extends": "@tsed/typescript/tsconfig.node.json", "compilerOptions": { "baseUrl": ".", - "rootDir": "src", "outDir": "./lib/esm", "declarationDir": "./lib/types", diff --git a/tools/typescript/tsconfig.template.spec.json b/tools/typescript/tsconfig.template.spec.json index 1a39a6f0aa9..79d6f7bf2d7 100644 --- a/tools/typescript/tsconfig.template.spec.json +++ b/tools/typescript/tsconfig.template.spec.json @@ -3,7 +3,6 @@ "compilerOptions": { "baseUrl": ".", "rootDir": ".", - "outDir": "./lib/cjs", "declaration": false, "composite": false, "noEmit": true diff --git a/tsconfig.json b/tsconfig.json index 2b837b02ee7..06ee5a2e129 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -17,6 +17,9 @@ { "path": "./packages/core/tsconfig.json" }, + { + "path": "./packages/engines/tsconfig.json" + }, { "path": "./packages/specs/openspec/tsconfig.json" }, @@ -26,9 +29,6 @@ { "path": "./packages/di/tsconfig.json" }, - { - "path": "./packages/engines/tsconfig.json" - }, { "path": "./packages/perf/tsconfig.json" }, @@ -71,9 +71,6 @@ { "path": "./packages/graphql/apollo/tsconfig.json" }, - { - "path": "./packages/graphql/graphql-ws/tsconfig.json" - }, { "path": "./packages/specs/ajv/tsconfig.json" }, @@ -92,6 +89,9 @@ { "path": "./packages/graphql/typegraphql/tsconfig.json" }, + { + "path": "./packages/graphql/graphql-ws/tsconfig.json" + }, { "path": "./packages/orm/adapters/tsconfig.json" }, @@ -108,10 +108,10 @@ "path": "./packages/orm/mikro-orm/tsconfig.json" }, { - "path": "./packages/orm/mongoose/tsconfig.json" + "path": "./packages/orm/objection/tsconfig.json" }, { - "path": "./packages/orm/objection/tsconfig.json" + "path": "./packages/orm/mongoose/tsconfig.json" }, { "path": "./packages/orm/prisma/tsconfig.json" @@ -123,10 +123,10 @@ "path": "./packages/platform/platform-serverless-testing/tsconfig.json" }, { - "path": "./packages/platform/platform-serverless/tsconfig.json" + "path": "./packages/platform/platform-serverless-http/tsconfig.json" }, { - "path": "./packages/platform/platform-serverless-http/tsconfig.json" + "path": "./packages/platform/platform-serverless/tsconfig.json" }, { "path": "./packages/security/jwks/tsconfig.json" @@ -134,17 +134,14 @@ { "path": "./packages/security/oidc-provider/tsconfig.json" }, - { - "path": "./packages/security/oidc-provider-plugin-wildcard-redirect-uri/tsconfig.json" - }, { "path": "./packages/security/passport/tsconfig.json" }, { - "path": "./packages/third-parties/agenda/tsconfig.json" + "path": "./packages/security/oidc-provider-plugin-wildcard-redirect-uri/tsconfig.json" }, { - "path": "./packages/third-parties/bullmq/tsconfig.json" + "path": "./packages/third-parties/agenda/tsconfig.json" }, { "path": "./packages/third-parties/event-emitter/tsconfig.json" @@ -156,11 +153,14 @@ "path": "./packages/third-parties/formio/tsconfig.json" }, { - "path": "./packages/third-parties/pulse/tsconfig.json" + "path": "./packages/third-parties/bullmq/tsconfig.json" }, { "path": "./packages/third-parties/schema-formio/tsconfig.json" }, + { + "path": "./packages/third-parties/pulse/tsconfig.json" + }, { "path": "./packages/third-parties/socketio-testing/tsconfig.json" }, @@ -168,16 +168,16 @@ "path": "./packages/third-parties/socketio/tsconfig.json" }, { - "path": "./packages/third-parties/sse/tsconfig.json" + "path": "./packages/third-parties/stripe/tsconfig.json" }, { - "path": "./packages/third-parties/temporal/tsconfig.json" + "path": "./packages/third-parties/sse/tsconfig.json" }, { "path": "./packages/third-parties/terminus/tsconfig.json" }, { - "path": "./packages/third-parties/stripe/tsconfig.json" + "path": "./packages/third-parties/temporal/tsconfig.json" }, { "path": "./packages/third-parties/vike/tsconfig.json" diff --git a/yarn.lock b/yarn.lock index 775b871748c..1806a97072a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8063,6 +8063,7 @@ __metadata: "@types/aws-lambda": "npm:^8.10.136" "@types/encodeurl": "npm:^1.0.2" "@types/mime": "npm:^3.0.4" + aws-lambda: "npm:1.0.7" encodeurl: "npm:^2.0.0" eslint: "npm:^8.57.0" find-my-way: "npm:^8.2.0" @@ -11578,6 +11579,47 @@ __metadata: languageName: node linkType: hard +"available-typed-arrays@npm:^1.0.7": + version: 1.0.7 + resolution: "available-typed-arrays@npm:1.0.7" + dependencies: + possible-typed-array-names: "npm:^1.0.0" + checksum: 10/6c9da3a66caddd83c875010a1ca8ef11eac02ba15fb592dc9418b2b5e7b77b645fa7729380a92d9835c2f05f2ca1b6251f39b993e0feb3f1517c74fa1af02cab + languageName: node + linkType: hard + +"aws-lambda@npm:1.0.7": + version: 1.0.7 + resolution: "aws-lambda@npm:1.0.7" + dependencies: + aws-sdk: "npm:^2.814.0" + commander: "npm:^3.0.2" + js-yaml: "npm:^3.14.1" + watchpack: "npm:^2.0.0-beta.10" + bin: + lambda: bin/lambda + checksum: 10/71fd8d4e57efb93dab5252e38cdeb2a90ccbe95346c5d7b63bbee7a3123cebe3873a4a930a7cd39afcbfaabd70ebb00e66fb0d5aca55cd9363f850d024c0980b + languageName: node + linkType: hard + +"aws-sdk@npm:^2.814.0": + version: 2.1691.0 + resolution: "aws-sdk@npm:2.1691.0" + dependencies: + buffer: "npm:4.9.2" + events: "npm:1.1.1" + ieee754: "npm:1.1.13" + jmespath: "npm:0.16.0" + querystring: "npm:0.2.0" + sax: "npm:1.2.1" + url: "npm:0.10.3" + util: "npm:^0.12.4" + uuid: "npm:8.0.0" + xml2js: "npm:0.6.2" + checksum: 10/387de8206cc134516aea8d7357a3c9a07317c0976bbc70f346981261fe57130eaecc4b74ca7feddc5c09a588a8cc2bd7d5cf13115c3a9f3ea76ce4c07992cbd8 + languageName: node + linkType: hard + "aws-serverless-express@npm:^3.4.0": version: 3.4.0 resolution: "aws-serverless-express@npm:3.4.0" @@ -11748,7 +11790,7 @@ __metadata: languageName: node linkType: hard -"base64-js@npm:^1.3.1": +"base64-js@npm:^1.0.2, base64-js@npm:^1.3.1": version: 1.5.1 resolution: "base64-js@npm:1.5.1" checksum: 10/669632eb3745404c2f822a18fc3a0122d2f9a7a13f7fb8b5823ee19d1d2ff9ee5b52c53367176ea4ad093c332fd5ab4bd0ebae5a8e27917a4105a4cfc86b1005 @@ -12113,6 +12155,17 @@ __metadata: languageName: node linkType: hard +"buffer@npm:4.9.2": + version: 4.9.2 + resolution: "buffer@npm:4.9.2" + dependencies: + base64-js: "npm:^1.0.2" + ieee754: "npm:^1.1.4" + isarray: "npm:^1.0.0" + checksum: 10/4852a455e167bc8ca580c3c585176bbe0931c9929aeb68f3e0b49adadcb4e513fd0922a43efdf67ddb2e8785bbe8254ae17f4b69038dd06329ee9e3283c8508f + languageName: node + linkType: hard + "buffer@npm:^5.1.0, buffer@npm:^5.5.0, buffer@npm:^5.6.0": version: 5.7.1 resolution: "buffer@npm:5.7.1" @@ -13330,6 +13383,13 @@ __metadata: languageName: node linkType: hard +"commander@npm:^3.0.2": + version: 3.0.2 + resolution: "commander@npm:3.0.2" + checksum: 10/f42053569f5954498246783465b39139917a51284bf3361574c9f731fea27a4bd6452dbb1755cc2d923c7b47dfea67930037c7b7e862288f2c397cec9a74da87 + languageName: node + linkType: hard + "commander@npm:^5.0.0, commander@npm:^5.1.0": version: 5.1.0 resolution: "commander@npm:5.1.0" @@ -16016,6 +16076,13 @@ __metadata: languageName: node linkType: hard +"events@npm:1.1.1": + version: 1.1.1 + resolution: "events@npm:1.1.1" + checksum: 10/524355c4364b4851d53ccf4fdab9570e3953e1f64ebca15554f33e50bebb4e71ab947ac0dee6f4ed5a567ff2eda54b0489b278b4fb7c8ec1f4982150079dfd40 + languageName: node + linkType: hard + "events@npm:^3.2.0, events@npm:^3.3.0": version: 3.3.0 resolution: "events@npm:3.3.0" @@ -18073,6 +18140,15 @@ __metadata: languageName: node linkType: hard +"has-tostringtag@npm:^1.0.2": + version: 1.0.2 + resolution: "has-tostringtag@npm:1.0.2" + dependencies: + has-symbols: "npm:^1.0.3" + checksum: 10/c74c5f5ceee3c8a5b8bc37719840dc3749f5b0306d818974141dda2471a1a2ca6c8e46b9d6ac222c5345df7a901c9b6f350b1e6d62763fec877e26609a401bfe + languageName: node + linkType: hard + "has-unicode@npm:2.0.1, has-unicode@npm:^2.0.1": version: 2.0.1 resolution: "has-unicode@npm:2.0.1" @@ -18652,7 +18728,14 @@ __metadata: languageName: node linkType: hard -"ieee754@npm:^1.1.13, ieee754@npm:^1.2.1": +"ieee754@npm:1.1.13": + version: 1.1.13 + resolution: "ieee754@npm:1.1.13" + checksum: 10/5c2f365168e629b164f6b8863c399af03e4515cafb690fe143039c9bd76b8f670af6539a43859bbfbe7df707eac755478515319a357a29f8c5f17ec2daa24a4c + languageName: node + linkType: hard + +"ieee754@npm:^1.1.13, ieee754@npm:^1.1.4, ieee754@npm:^1.2.1": version: 1.2.1 resolution: "ieee754@npm:1.2.1" checksum: 10/d9f2557a59036f16c282aaeb107832dc957a93d73397d89bbad4eb1130560560eb695060145e8e6b3b498b15ab95510226649a0b8f52ae06583575419fe10fc4 @@ -19641,6 +19724,15 @@ __metadata: languageName: node linkType: hard +"is-typed-array@npm:^1.1.3": + version: 1.1.13 + resolution: "is-typed-array@npm:1.1.13" + dependencies: + which-typed-array: "npm:^1.1.14" + checksum: 10/f850ba08286358b9a11aee6d93d371a45e3c59b5953549ee1c1a9a55ba5c1dd1bd9952488ae194ad8f32a9cf5e79c8fa5f0cc4d78c00720aa0bbcf238b38062d + languageName: node + linkType: hard + "is-typed-array@npm:^1.1.7": version: 1.1.8 resolution: "is-typed-array@npm:1.1.8" @@ -19733,7 +19825,7 @@ __metadata: languageName: node linkType: hard -"isarray@npm:1.0.0, isarray@npm:~1.0.0": +"isarray@npm:1.0.0, isarray@npm:^1.0.0, isarray@npm:~1.0.0": version: 1.0.0 resolution: "isarray@npm:1.0.0" checksum: 10/f032df8e02dce8ec565cf2eb605ea939bdccea528dbcf565cdf92bfa2da9110461159d86a537388ef1acef8815a330642d7885b29010e8f7eac967c9993b65ab @@ -20025,6 +20117,13 @@ __metadata: languageName: node linkType: hard +"jmespath@npm:0.16.0": + version: 0.16.0 + resolution: "jmespath@npm:0.16.0" + checksum: 10/cc8b4a5cd2a22a79fc2695d66e5a43bc0020ec1ebdbe648440e796764751af2f495771ce877dea45ee6545530f0a1528450c3c3026bc0e9d976a93447af9fb74 + languageName: node + linkType: hard + "jose2@npm:jose@^2.0.4": version: 2.0.5 resolution: "jose@npm:2.0.5" @@ -20073,7 +20172,7 @@ __metadata: languageName: node linkType: hard -"js-yaml@npm:^3.10.0, js-yaml@npm:^3.13.1, js-yaml@npm:^3.7.0": +"js-yaml@npm:^3.10.0, js-yaml@npm:^3.13.1, js-yaml@npm:^3.14.1, js-yaml@npm:^3.7.0": version: 3.14.1 resolution: "js-yaml@npm:3.14.1" dependencies: @@ -25247,6 +25346,13 @@ __metadata: languageName: node linkType: hard +"possible-typed-array-names@npm:^1.0.0": + version: 1.0.0 + resolution: "possible-typed-array-names@npm:1.0.0" + checksum: 10/8ed3e96dfeea1c5880c1f4c9cb707e5fb26e8be22f14f82ef92df20fd2004e635c62ba47fbe8f2bb63bfd80dac1474be2fb39798da8c2feba2815435d1f749af + languageName: node + linkType: hard + "postcss-selector-parser@npm:^6.0.10": version: 6.0.15 resolution: "postcss-selector-parser@npm:6.0.15" @@ -25722,6 +25828,13 @@ __metadata: languageName: node linkType: hard +"punycode@npm:1.3.2": + version: 1.3.2 + resolution: "punycode@npm:1.3.2" + checksum: 10/5c57d588c60679fd1b9400c75de06e327723f2b38e21e195027ba7a59006725f7b817dce5b26d47c7f8c1c842d28275aa59955a06d2e467cffeba70b7e0576bb + languageName: node + linkType: hard + "punycode@npm:^2.1.0, punycode@npm:^2.3.0": version: 2.3.1 resolution: "punycode@npm:2.3.1" @@ -25779,6 +25892,13 @@ __metadata: languageName: node linkType: hard +"querystring@npm:0.2.0": + version: 0.2.0 + resolution: "querystring@npm:0.2.0" + checksum: 10/37b91720be8c8de87b49d1a68f0ceafbbeda6efe6334ce7aad080b0b4111f933a40650b8a6669c1bc629cd8bb37c67cb7b5a42ec0758662efbce44b8faa1766d + languageName: node + linkType: hard + "queue-microtask@npm:^1.2.2": version: 1.2.3 resolution: "queue-microtask@npm:1.2.3" @@ -26947,6 +27067,20 @@ __metadata: languageName: node linkType: hard +"sax@npm:1.2.1": + version: 1.2.1 + resolution: "sax@npm:1.2.1" + checksum: 10/d64f65291ce127f191eb2c22012f8f608736e306db6a28306e618bb1324cfbc19f6783c49ce0d88e5628fde30878c29189c8fb3c62c83f079b471734e4df455d + languageName: node + linkType: hard + +"sax@npm:>=0.6.0": + version: 1.4.1 + resolution: "sax@npm:1.4.1" + checksum: 10/b1c784b545019187b53a0c28edb4f6314951c971e2963a69739c6ce222bfbc767e54d320e689352daba79b7d5e06d22b5d7113b99336219d6e93718e2f99d335 + languageName: node + linkType: hard + "scheduler@npm:^0.23.0": version: 0.23.0 resolution: "scheduler@npm:0.23.0" @@ -30190,6 +30324,16 @@ __metadata: languageName: node linkType: hard +"url@npm:0.10.3": + version: 0.10.3 + resolution: "url@npm:0.10.3" + dependencies: + punycode: "npm:1.3.2" + querystring: "npm:0.2.0" + checksum: 10/8c04e30d65907a1e01569cead632c74ea3af99d1b9b63dfbb2cf636640fe210f7a1bc16990aac04914dbb63ad2bd50effee3e782e0170d5938a11e8aa38358a5 + languageName: node + linkType: hard + "use@npm:^3.1.0": version: 3.1.1 resolution: "use@npm:3.1.1" @@ -30226,6 +30370,19 @@ __metadata: languageName: node linkType: hard +"util@npm:^0.12.4": + version: 0.12.5 + resolution: "util@npm:0.12.5" + dependencies: + inherits: "npm:^2.0.3" + is-arguments: "npm:^1.0.4" + is-generator-function: "npm:^1.0.7" + is-typed-array: "npm:^1.1.3" + which-typed-array: "npm:^1.1.2" + checksum: 10/61a10de7753353dd4d744c917f74cdd7d21b8b46379c1e48e1c4fd8e83f8190e6bd9978fc4e5102ab6a10ebda6019d1b36572fa4a325e175ec8b789a121f6147 + languageName: node + linkType: hard + "utila@npm:~0.4": version: 0.4.0 resolution: "utila@npm:0.4.0" @@ -30240,6 +30397,15 @@ __metadata: languageName: node linkType: hard +"uuid@npm:8.0.0": + version: 8.0.0 + resolution: "uuid@npm:8.0.0" + bin: + uuid: dist/bin/uuid + checksum: 10/5086c43bbe11e2337d9bb9a3b3a156311e5f5ba5da2de8152da9e00cfd5fbbf626d36e6a2838dde06e2105ac563bc298470acc0e4800c96fa2d50565c5782f8a + languageName: node + linkType: hard + "uuid@npm:9.0.0, uuid@npm:^9.0.0": version: 9.0.0 resolution: "uuid@npm:9.0.0" @@ -30691,6 +30857,16 @@ __metadata: languageName: node linkType: hard +"watchpack@npm:^2.0.0-beta.10": + version: 2.4.2 + resolution: "watchpack@npm:2.4.2" + dependencies: + glob-to-regexp: "npm:^0.4.1" + graceful-fs: "npm:^4.1.2" + checksum: 10/6bd4c051d9af189a6c781c3158dcb3069f432a0c144159eeb0a44117412105c61b2b683a5c9eebc4324625e0e9b76536387d0ba354594fa6cbbdf1ef60bee4c3 + languageName: node + linkType: hard + "watchpack@npm:^2.4.0": version: 2.4.0 resolution: "watchpack@npm:2.4.0" @@ -30983,6 +31159,19 @@ __metadata: languageName: node linkType: hard +"which-typed-array@npm:^1.1.14": + version: 1.1.15 + resolution: "which-typed-array@npm:1.1.15" + dependencies: + available-typed-arrays: "npm:^1.0.7" + call-bind: "npm:^1.0.7" + for-each: "npm:^0.3.3" + gopd: "npm:^1.0.1" + has-tostringtag: "npm:^1.0.2" + checksum: 10/c3b6a99beadc971baa53c3ee5b749f2b9bdfa3b3b9a70650dd8511a48b61d877288b498d424712e9991d16019633086bd8b5923369460d93463c5825fa36c448 + languageName: node + linkType: hard + "which-typed-array@npm:^1.1.2": version: 1.1.7 resolution: "which-typed-array@npm:1.1.7" @@ -31283,6 +31472,23 @@ __metadata: languageName: node linkType: hard +"xml2js@npm:0.6.2": + version: 0.6.2 + resolution: "xml2js@npm:0.6.2" + dependencies: + sax: "npm:>=0.6.0" + xmlbuilder: "npm:~11.0.0" + checksum: 10/df29de8eeedb762c367d87945c39bcf54db19a2c522607491c266ed6184b5a749e37ff29cfaed0ac149da9ba332ac3dcf8e5ff2bd0a206be3343eca95faa941d + languageName: node + linkType: hard + +"xmlbuilder@npm:~11.0.0": + version: 11.0.1 + resolution: "xmlbuilder@npm:11.0.1" + checksum: 10/c8c3d208783718db5b285101a736cd8e6b69a5c265199a0739abaa93d1a1b7de5489fd16df4e776e18b2c98cb91f421a7349e99fd8c1ebeb44ecfed72a25091a + languageName: node + linkType: hard + "xmlhttprequest-ssl@npm:~2.0.0": version: 2.0.0 resolution: "xmlhttprequest-ssl@npm:2.0.0" From 4badb3b1d032f3911d44393dd2835dc03a1bce4f Mon Sep 17 00:00:00 2001 From: Romain Lenzotti Date: Fri, 27 Sep 2024 13:47:50 +0200 Subject: [PATCH 5/6] chore: reset all coverage --- packages/core/vitest.config.mts | 10 +++++----- packages/di/vitest.config.mts | 8 ++++---- packages/engines/vitest.config.mts | 10 +++++----- packages/graphql/apollo/vitest.config.mts | 10 +++++----- packages/graphql/typegraphql/vitest.config.mts | 10 +++++----- packages/orm/adapters-redis/vitest.config.mts | 10 +++++----- packages/orm/adapters/vitest.config.mts | 10 +++++----- packages/orm/mikro-orm/vitest.config.mts | 8 ++++---- packages/orm/mongoose/vitest.config.mts | 8 ++++---- packages/orm/objection/vitest.config.mts | 10 +++++----- packages/orm/prisma/vitest.config.mts | 8 ++++---- packages/platform/common/vitest.config.mts | 8 ++++---- packages/platform/platform-cache/vitest.config.mts | 8 ++++---- .../platform/platform-exceptions/vitest.config.mts | 10 +++++----- packages/platform/platform-express/vitest.config.mts | 10 +++++----- packages/platform/platform-koa/vitest.config.mts | 8 ++++---- .../platform/platform-log-middleware/vitest.config.mts | 10 +++++----- .../platform/platform-middlewares/vitest.config.mts | 10 +++++----- packages/platform/platform-params/vitest.config.mts | 8 ++++---- .../platform-response-filter/vitest.config.mts | 10 +++++----- packages/platform/platform-router/vitest.config.mts | 8 ++++---- .../platform-serverless-http/vitest.config.mts | 10 +++++----- .../platform/platform-serverless/vitest.config.mts | 10 +++++----- packages/platform/platform-views/vitest.config.mts | 10 +++++----- packages/security/jwks/vitest.config.mts | 10 +++++----- .../vitest.config.mts | 10 +++++----- packages/security/oidc-provider/vitest.config.mts | 10 +++++----- packages/security/passport/vitest.config.mts | 10 +++++----- packages/third-parties/agenda/vitest.config.mts | 8 ++++---- packages/third-parties/bullmq/vitest.config.mts | 10 +++++----- .../third-parties/components-scan/vitest.config.mts | 10 +++++----- packages/third-parties/event-emitter/vitest.config.mts | 10 +++++----- packages/third-parties/formio/vitest.config.mts | 10 +++++----- packages/third-parties/pulse/vitest.config.mts | 10 +++++----- packages/third-parties/schema-formio/vitest.config.mts | 10 +++++----- packages/third-parties/socketio/vitest.config.mts | 10 +++++----- packages/third-parties/sse/vitest.config.mts | 10 +++++----- packages/third-parties/stripe/vitest.config.mts | 10 +++++----- packages/third-parties/temporal/vitest.config.mts | 8 ++++---- packages/third-parties/terminus/vitest.config.mts | 10 +++++----- packages/third-parties/vike/vitest.config.mts | 10 +++++----- packages/utils/normalize-path/vitest.config.mts | 10 +++++----- 42 files changed, 199 insertions(+), 199 deletions(-) diff --git a/packages/core/vitest.config.mts b/packages/core/vitest.config.mts index 8c50528d122..d759e817941 100644 --- a/packages/core/vitest.config.mts +++ b/packages/core/vitest.config.mts @@ -10,12 +10,12 @@ export default defineConfig( coverage: { ...presets.test.coverage, thresholds: { - statements: 97.85, - branches: 94.12, - functions: 94.54, - lines: 97.85 + statements: 0, + branches: 0, + functions: 0, + lines: 0 } } } } -); \ No newline at end of file +); diff --git a/packages/di/vitest.config.mts b/packages/di/vitest.config.mts index 862be1ef730..d759e817941 100644 --- a/packages/di/vitest.config.mts +++ b/packages/di/vitest.config.mts @@ -10,10 +10,10 @@ export default defineConfig( coverage: { ...presets.test.coverage, thresholds: { - statements: 98.75, - branches: 97.05, - functions: 98.67, - lines: 98.75 + statements: 0, + branches: 0, + functions: 0, + lines: 0 } } } diff --git a/packages/engines/vitest.config.mts b/packages/engines/vitest.config.mts index 8d1dfa9a238..d759e817941 100644 --- a/packages/engines/vitest.config.mts +++ b/packages/engines/vitest.config.mts @@ -10,12 +10,12 @@ export default defineConfig( coverage: { ...presets.test.coverage, thresholds: { - statements: 81.55, - branches: 85.29, - functions: 78.4, - lines: 81.55 + statements: 0, + branches: 0, + functions: 0, + lines: 0 } } } } -); \ No newline at end of file +); diff --git a/packages/graphql/apollo/vitest.config.mts b/packages/graphql/apollo/vitest.config.mts index 1d11c029c94..d759e817941 100644 --- a/packages/graphql/apollo/vitest.config.mts +++ b/packages/graphql/apollo/vitest.config.mts @@ -10,12 +10,12 @@ export default defineConfig( coverage: { ...presets.test.coverage, thresholds: { - statements: 80.91, - branches: 80.95, - functions: 94.11, - lines: 80.91 + statements: 0, + branches: 0, + functions: 0, + lines: 0 } } } } -); \ No newline at end of file +); diff --git a/packages/graphql/typegraphql/vitest.config.mts b/packages/graphql/typegraphql/vitest.config.mts index e2b1733b8f9..d759e817941 100644 --- a/packages/graphql/typegraphql/vitest.config.mts +++ b/packages/graphql/typegraphql/vitest.config.mts @@ -10,12 +10,12 @@ export default defineConfig( coverage: { ...presets.test.coverage, thresholds: { - statements: 95.34, - branches: 61.53, - functions: 100, - lines: 95.34 + statements: 0, + branches: 0, + functions: 0, + lines: 0 } } } } -); \ No newline at end of file +); diff --git a/packages/orm/adapters-redis/vitest.config.mts b/packages/orm/adapters-redis/vitest.config.mts index d72bd1ef5ce..d759e817941 100644 --- a/packages/orm/adapters-redis/vitest.config.mts +++ b/packages/orm/adapters-redis/vitest.config.mts @@ -10,12 +10,12 @@ export default defineConfig( coverage: { ...presets.test.coverage, thresholds: { - statements: 99.62, - branches: 91.66, - functions: 100, - lines: 99.62 + statements: 0, + branches: 0, + functions: 0, + lines: 0 } } } } -); \ No newline at end of file +); diff --git a/packages/orm/adapters/vitest.config.mts b/packages/orm/adapters/vitest.config.mts index 0917bce122d..d759e817941 100644 --- a/packages/orm/adapters/vitest.config.mts +++ b/packages/orm/adapters/vitest.config.mts @@ -10,12 +10,12 @@ export default defineConfig( coverage: { ...presets.test.coverage, thresholds: { - statements: 100, - branches: 87.5, - functions: 100, - lines: 100 + statements: 0, + branches: 0, + functions: 0, + lines: 0 } } } } -); \ No newline at end of file +); diff --git a/packages/orm/mikro-orm/vitest.config.mts b/packages/orm/mikro-orm/vitest.config.mts index acee1f791bc..f8dc9b023ac 100644 --- a/packages/orm/mikro-orm/vitest.config.mts +++ b/packages/orm/mikro-orm/vitest.config.mts @@ -12,10 +12,10 @@ export default defineConfig( coverage: { ...presets.test.coverage, thresholds: { - statements: 97.78, - branches: 85.05, - functions: 100, - lines: 97.78 + statements: 0, + branches: 0, + functions: 0, + lines: 0 } } } diff --git a/packages/orm/mongoose/vitest.config.mts b/packages/orm/mongoose/vitest.config.mts index 7043b1b2b30..f8dc9b023ac 100644 --- a/packages/orm/mongoose/vitest.config.mts +++ b/packages/orm/mongoose/vitest.config.mts @@ -12,10 +12,10 @@ export default defineConfig( coverage: { ...presets.test.coverage, thresholds: { - statements: 96.29, - branches: 93.72, - functions: 100, - lines: 96.29 + statements: 0, + branches: 0, + functions: 0, + lines: 0 } } } diff --git a/packages/orm/objection/vitest.config.mts b/packages/orm/objection/vitest.config.mts index 0bf8d0223f6..d759e817941 100644 --- a/packages/orm/objection/vitest.config.mts +++ b/packages/orm/objection/vitest.config.mts @@ -10,12 +10,12 @@ export default defineConfig( coverage: { ...presets.test.coverage, thresholds: { - statements: 94.37, - branches: 98.66, - functions: 92.3, - lines: 94.37 + statements: 0, + branches: 0, + functions: 0, + lines: 0 } } } } -); \ No newline at end of file +); diff --git a/packages/orm/prisma/vitest.config.mts b/packages/orm/prisma/vitest.config.mts index 3a9805f7496..d759e817941 100644 --- a/packages/orm/prisma/vitest.config.mts +++ b/packages/orm/prisma/vitest.config.mts @@ -10,10 +10,10 @@ export default defineConfig( coverage: { ...presets.test.coverage, thresholds: { - statements: 90.48, - branches: 90.56, - functions: 92.59, - lines: 90.48 + statements: 0, + branches: 0, + functions: 0, + lines: 0 } } } diff --git a/packages/platform/common/vitest.config.mts b/packages/platform/common/vitest.config.mts index efdda8d63a7..d759e817941 100644 --- a/packages/platform/common/vitest.config.mts +++ b/packages/platform/common/vitest.config.mts @@ -10,10 +10,10 @@ export default defineConfig( coverage: { ...presets.test.coverage, thresholds: { - statements: 97.01, - branches: 90.74, - functions: 94.89, - lines: 97.01 + statements: 0, + branches: 0, + functions: 0, + lines: 0 } } } diff --git a/packages/platform/platform-cache/vitest.config.mts b/packages/platform/platform-cache/vitest.config.mts index b42ac08c19d..d759e817941 100644 --- a/packages/platform/platform-cache/vitest.config.mts +++ b/packages/platform/platform-cache/vitest.config.mts @@ -10,10 +10,10 @@ export default defineConfig( coverage: { ...presets.test.coverage, thresholds: { - statements: 100, - branches: 94.16, - functions: 100, - lines: 100 + statements: 0, + branches: 0, + functions: 0, + lines: 0 } } } diff --git a/packages/platform/platform-exceptions/vitest.config.mts b/packages/platform/platform-exceptions/vitest.config.mts index 1d90c48cb77..d759e817941 100644 --- a/packages/platform/platform-exceptions/vitest.config.mts +++ b/packages/platform/platform-exceptions/vitest.config.mts @@ -10,12 +10,12 @@ export default defineConfig( coverage: { ...presets.test.coverage, thresholds: { - statements: 100, - branches: 94.73, - functions: 100, - lines: 100 + statements: 0, + branches: 0, + functions: 0, + lines: 0 } } } } -); \ No newline at end of file +); diff --git a/packages/platform/platform-express/vitest.config.mts b/packages/platform/platform-express/vitest.config.mts index c450cf30d7d..027498ce15e 100644 --- a/packages/platform/platform-express/vitest.config.mts +++ b/packages/platform/platform-express/vitest.config.mts @@ -10,12 +10,12 @@ export default defineConfig( coverage: { ...presets.test.coverage, thresholds: { - statements: 96.65, - branches: 93.44, - functions: 100, - lines: 96.65 + statements: 0, + branches: 0, + functions: 0, + lines: 0 } } } } -); \ No newline at end of file +); diff --git a/packages/platform/platform-koa/vitest.config.mts b/packages/platform/platform-koa/vitest.config.mts index 510b341b8f9..d759e817941 100644 --- a/packages/platform/platform-koa/vitest.config.mts +++ b/packages/platform/platform-koa/vitest.config.mts @@ -10,10 +10,10 @@ export default defineConfig( coverage: { ...presets.test.coverage, thresholds: { - statements: 99.15, - branches: 95.6, - functions: 100, - lines: 99.15 + statements: 0, + branches: 0, + functions: 0, + lines: 0 } } } diff --git a/packages/platform/platform-log-middleware/vitest.config.mts b/packages/platform/platform-log-middleware/vitest.config.mts index 6e6fd30849d..d759e817941 100644 --- a/packages/platform/platform-log-middleware/vitest.config.mts +++ b/packages/platform/platform-log-middleware/vitest.config.mts @@ -10,12 +10,12 @@ export default defineConfig( coverage: { ...presets.test.coverage, thresholds: { - statements: 100, - branches: 92.85, - functions: 100, - lines: 100 + statements: 0, + branches: 0, + functions: 0, + lines: 0 } } } } -); \ No newline at end of file +); diff --git a/packages/platform/platform-middlewares/vitest.config.mts b/packages/platform/platform-middlewares/vitest.config.mts index d2598fb346b..d759e817941 100644 --- a/packages/platform/platform-middlewares/vitest.config.mts +++ b/packages/platform/platform-middlewares/vitest.config.mts @@ -10,12 +10,12 @@ export default defineConfig( coverage: { ...presets.test.coverage, thresholds: { - statements: 100, - branches: 100, - functions: 100, - lines: 100 + statements: 0, + branches: 0, + functions: 0, + lines: 0 } } } } -); \ No newline at end of file +); diff --git a/packages/platform/platform-params/vitest.config.mts b/packages/platform/platform-params/vitest.config.mts index 34aaae24bc3..d759e817941 100644 --- a/packages/platform/platform-params/vitest.config.mts +++ b/packages/platform/platform-params/vitest.config.mts @@ -10,10 +10,10 @@ export default defineConfig( coverage: { ...presets.test.coverage, thresholds: { - statements: 99.25, - branches: 89.84, - functions: 100, - lines: 99.25 + statements: 0, + branches: 0, + functions: 0, + lines: 0 } } } diff --git a/packages/platform/platform-response-filter/vitest.config.mts b/packages/platform/platform-response-filter/vitest.config.mts index c140383e59e..d759e817941 100644 --- a/packages/platform/platform-response-filter/vitest.config.mts +++ b/packages/platform/platform-response-filter/vitest.config.mts @@ -10,12 +10,12 @@ export default defineConfig( coverage: { ...presets.test.coverage, thresholds: { - statements: 100, - branches: 97.5, - functions: 100, - lines: 100 + statements: 0, + branches: 0, + functions: 0, + lines: 0 } } } } -); \ No newline at end of file +); diff --git a/packages/platform/platform-router/vitest.config.mts b/packages/platform/platform-router/vitest.config.mts index 3c95f4d74e3..d759e817941 100644 --- a/packages/platform/platform-router/vitest.config.mts +++ b/packages/platform/platform-router/vitest.config.mts @@ -10,10 +10,10 @@ export default defineConfig( coverage: { ...presets.test.coverage, thresholds: { - statements: 100, - branches: 93.57, - functions: 100, - lines: 100 + statements: 0, + branches: 0, + functions: 0, + lines: 0 } } } diff --git a/packages/platform/platform-serverless-http/vitest.config.mts b/packages/platform/platform-serverless-http/vitest.config.mts index d2598fb346b..d759e817941 100644 --- a/packages/platform/platform-serverless-http/vitest.config.mts +++ b/packages/platform/platform-serverless-http/vitest.config.mts @@ -10,12 +10,12 @@ export default defineConfig( coverage: { ...presets.test.coverage, thresholds: { - statements: 100, - branches: 100, - functions: 100, - lines: 100 + statements: 0, + branches: 0, + functions: 0, + lines: 0 } } } } -); \ No newline at end of file +); diff --git a/packages/platform/platform-serverless/vitest.config.mts b/packages/platform/platform-serverless/vitest.config.mts index f18e99502c6..d759e817941 100644 --- a/packages/platform/platform-serverless/vitest.config.mts +++ b/packages/platform/platform-serverless/vitest.config.mts @@ -10,12 +10,12 @@ export default defineConfig( coverage: { ...presets.test.coverage, thresholds: { - statements: 98.56, - branches: 95.23, - functions: 100, - lines: 98.56 + statements: 0, + branches: 0, + functions: 0, + lines: 0 } } } } -); \ No newline at end of file +); diff --git a/packages/platform/platform-views/vitest.config.mts b/packages/platform/platform-views/vitest.config.mts index 1287ee6b294..d759e817941 100644 --- a/packages/platform/platform-views/vitest.config.mts +++ b/packages/platform/platform-views/vitest.config.mts @@ -10,12 +10,12 @@ export default defineConfig( coverage: { ...presets.test.coverage, thresholds: { - statements: 92.9, - branches: 78.26, - functions: 76.92, - lines: 92.9 + statements: 0, + branches: 0, + functions: 0, + lines: 0 } } } } -); \ No newline at end of file +); diff --git a/packages/security/jwks/vitest.config.mts b/packages/security/jwks/vitest.config.mts index d2598fb346b..d759e817941 100644 --- a/packages/security/jwks/vitest.config.mts +++ b/packages/security/jwks/vitest.config.mts @@ -10,12 +10,12 @@ export default defineConfig( coverage: { ...presets.test.coverage, thresholds: { - statements: 100, - branches: 100, - functions: 100, - lines: 100 + statements: 0, + branches: 0, + functions: 0, + lines: 0 } } } } -); \ No newline at end of file +); diff --git a/packages/security/oidc-provider-plugin-wildcard-redirect-uri/vitest.config.mts b/packages/security/oidc-provider-plugin-wildcard-redirect-uri/vitest.config.mts index eb2c431d9c9..d759e817941 100644 --- a/packages/security/oidc-provider-plugin-wildcard-redirect-uri/vitest.config.mts +++ b/packages/security/oidc-provider-plugin-wildcard-redirect-uri/vitest.config.mts @@ -10,12 +10,12 @@ export default defineConfig( coverage: { ...presets.test.coverage, thresholds: { - statements: 98.83, - branches: 80, - functions: 100, - lines: 98.83 + statements: 0, + branches: 0, + functions: 0, + lines: 0 } } } } -); \ No newline at end of file +); diff --git a/packages/security/oidc-provider/vitest.config.mts b/packages/security/oidc-provider/vitest.config.mts index f8dee6e9fe1..d759e817941 100644 --- a/packages/security/oidc-provider/vitest.config.mts +++ b/packages/security/oidc-provider/vitest.config.mts @@ -10,12 +10,12 @@ export default defineConfig( coverage: { ...presets.test.coverage, thresholds: { - statements: 97.55, - branches: 77.47, - functions: 98.63, - lines: 97.55 + statements: 0, + branches: 0, + functions: 0, + lines: 0 } } } } -); \ No newline at end of file +); diff --git a/packages/security/passport/vitest.config.mts b/packages/security/passport/vitest.config.mts index 289a82f9f38..d759e817941 100644 --- a/packages/security/passport/vitest.config.mts +++ b/packages/security/passport/vitest.config.mts @@ -10,12 +10,12 @@ export default defineConfig( coverage: { ...presets.test.coverage, thresholds: { - statements: 98.76, - branches: 83.72, - functions: 100, - lines: 98.76 + statements: 0, + branches: 0, + functions: 0, + lines: 0 } } } } -); \ No newline at end of file +); diff --git a/packages/third-parties/agenda/vitest.config.mts b/packages/third-parties/agenda/vitest.config.mts index 9ea7bba1c84..f8dc9b023ac 100644 --- a/packages/third-parties/agenda/vitest.config.mts +++ b/packages/third-parties/agenda/vitest.config.mts @@ -12,10 +12,10 @@ export default defineConfig( coverage: { ...presets.test.coverage, thresholds: { - statements: 100, - branches: 93.02, - functions: 100, - lines: 100 + statements: 0, + branches: 0, + functions: 0, + lines: 0 } } } diff --git a/packages/third-parties/bullmq/vitest.config.mts b/packages/third-parties/bullmq/vitest.config.mts index 8616aad7f8b..d759e817941 100644 --- a/packages/third-parties/bullmq/vitest.config.mts +++ b/packages/third-parties/bullmq/vitest.config.mts @@ -10,12 +10,12 @@ export default defineConfig( coverage: { ...presets.test.coverage, thresholds: { - statements: 98.96, - branches: 94.44, - functions: 100, - lines: 98.96 + statements: 0, + branches: 0, + functions: 0, + lines: 0 } } } } -); \ No newline at end of file +); diff --git a/packages/third-parties/components-scan/vitest.config.mts b/packages/third-parties/components-scan/vitest.config.mts index 4e5a86d4720..d759e817941 100644 --- a/packages/third-parties/components-scan/vitest.config.mts +++ b/packages/third-parties/components-scan/vitest.config.mts @@ -10,12 +10,12 @@ export default defineConfig( coverage: { ...presets.test.coverage, thresholds: { - statements: 97.77, - branches: 88.46, - functions: 100, - lines: 97.77 + statements: 0, + branches: 0, + functions: 0, + lines: 0 } } } } -); \ No newline at end of file +); diff --git a/packages/third-parties/event-emitter/vitest.config.mts b/packages/third-parties/event-emitter/vitest.config.mts index 995296ee91a..d759e817941 100644 --- a/packages/third-parties/event-emitter/vitest.config.mts +++ b/packages/third-parties/event-emitter/vitest.config.mts @@ -10,12 +10,12 @@ export default defineConfig( coverage: { ...presets.test.coverage, thresholds: { - statements: 81.73, - branches: 89.28, - functions: 91.66, - lines: 81.73 + statements: 0, + branches: 0, + functions: 0, + lines: 0 } } } } -); \ No newline at end of file +); diff --git a/packages/third-parties/formio/vitest.config.mts b/packages/third-parties/formio/vitest.config.mts index 6822f5f8cc2..d759e817941 100644 --- a/packages/third-parties/formio/vitest.config.mts +++ b/packages/third-parties/formio/vitest.config.mts @@ -10,12 +10,12 @@ export default defineConfig( coverage: { ...presets.test.coverage, thresholds: { - statements: 96.01, - branches: 86.75, - functions: 96.85, - lines: 96.01 + statements: 0, + branches: 0, + functions: 0, + lines: 0 } } } } -); \ No newline at end of file +); diff --git a/packages/third-parties/pulse/vitest.config.mts b/packages/third-parties/pulse/vitest.config.mts index 4e99294b35e..f8dc9b023ac 100644 --- a/packages/third-parties/pulse/vitest.config.mts +++ b/packages/third-parties/pulse/vitest.config.mts @@ -12,12 +12,12 @@ export default defineConfig( coverage: { ...presets.test.coverage, thresholds: { - statements: 100, - branches: 93.02, - functions: 100, - lines: 100 + statements: 0, + branches: 0, + functions: 0, + lines: 0 } } } } -); \ No newline at end of file +); diff --git a/packages/third-parties/schema-formio/vitest.config.mts b/packages/third-parties/schema-formio/vitest.config.mts index 22f0e9e31bb..d759e817941 100644 --- a/packages/third-parties/schema-formio/vitest.config.mts +++ b/packages/third-parties/schema-formio/vitest.config.mts @@ -10,12 +10,12 @@ export default defineConfig( coverage: { ...presets.test.coverage, thresholds: { - statements: 99.62, - branches: 98.71, - functions: 100, - lines: 99.62 + statements: 0, + branches: 0, + functions: 0, + lines: 0 } } } } -); \ No newline at end of file +); diff --git a/packages/third-parties/socketio/vitest.config.mts b/packages/third-parties/socketio/vitest.config.mts index 0d438c85a2a..d759e817941 100644 --- a/packages/third-parties/socketio/vitest.config.mts +++ b/packages/third-parties/socketio/vitest.config.mts @@ -10,12 +10,12 @@ export default defineConfig( coverage: { ...presets.test.coverage, thresholds: { - statements: 99.61, - branches: 96.23, - functions: 100, - lines: 99.61 + statements: 0, + branches: 0, + functions: 0, + lines: 0 } } } } -); \ No newline at end of file +); diff --git a/packages/third-parties/sse/vitest.config.mts b/packages/third-parties/sse/vitest.config.mts index 02430daf957..d759e817941 100644 --- a/packages/third-parties/sse/vitest.config.mts +++ b/packages/third-parties/sse/vitest.config.mts @@ -10,12 +10,12 @@ export default defineConfig( coverage: { ...presets.test.coverage, thresholds: { - statements: 50.94, - branches: 72, - functions: 64.28, - lines: 50.94 + statements: 0, + branches: 0, + functions: 0, + lines: 0 } } } } -); \ No newline at end of file +); diff --git a/packages/third-parties/stripe/vitest.config.mts b/packages/third-parties/stripe/vitest.config.mts index 5c8bc5b1bd5..d759e817941 100644 --- a/packages/third-parties/stripe/vitest.config.mts +++ b/packages/third-parties/stripe/vitest.config.mts @@ -10,12 +10,12 @@ export default defineConfig( coverage: { ...presets.test.coverage, thresholds: { - statements: 100, - branches: 66.66, - functions: 100, - lines: 100 + statements: 0, + branches: 0, + functions: 0, + lines: 0 } } } } -); \ No newline at end of file +); diff --git a/packages/third-parties/temporal/vitest.config.mts b/packages/third-parties/temporal/vitest.config.mts index 62dea5b443f..d759e817941 100644 --- a/packages/third-parties/temporal/vitest.config.mts +++ b/packages/third-parties/temporal/vitest.config.mts @@ -10,10 +10,10 @@ export default defineConfig( coverage: { ...presets.test.coverage, thresholds: { - statements: 92.36, - branches: 69.23, - functions: 88.88, - lines: 92.36 + statements: 0, + branches: 0, + functions: 0, + lines: 0 } } } diff --git a/packages/third-parties/terminus/vitest.config.mts b/packages/third-parties/terminus/vitest.config.mts index 8cdab8ee15e..d759e817941 100644 --- a/packages/third-parties/terminus/vitest.config.mts +++ b/packages/third-parties/terminus/vitest.config.mts @@ -10,12 +10,12 @@ export default defineConfig( coverage: { ...presets.test.coverage, thresholds: { - statements: 99.19, - branches: 92.3, - functions: 100, - lines: 99.19 + statements: 0, + branches: 0, + functions: 0, + lines: 0 } } } } -); \ No newline at end of file +); diff --git a/packages/third-parties/vike/vitest.config.mts b/packages/third-parties/vike/vitest.config.mts index c0de689fb68..d759e817941 100644 --- a/packages/third-parties/vike/vitest.config.mts +++ b/packages/third-parties/vike/vitest.config.mts @@ -10,12 +10,12 @@ export default defineConfig( coverage: { ...presets.test.coverage, thresholds: { - statements: 98.65, - branches: 78.12, - functions: 100, - lines: 98.65 + statements: 0, + branches: 0, + functions: 0, + lines: 0 } } } } -); \ No newline at end of file +); diff --git a/packages/utils/normalize-path/vitest.config.mts b/packages/utils/normalize-path/vitest.config.mts index d2598fb346b..d759e817941 100644 --- a/packages/utils/normalize-path/vitest.config.mts +++ b/packages/utils/normalize-path/vitest.config.mts @@ -10,12 +10,12 @@ export default defineConfig( coverage: { ...presets.test.coverage, thresholds: { - statements: 100, - branches: 100, - functions: 100, - lines: 100 + statements: 0, + branches: 0, + functions: 0, + lines: 0 } } } } -); \ No newline at end of file +); From 5bc4d1c1efd83cc2d36a73f5fe00cae1793296c3 Mon Sep 17 00:00:00 2001 From: Romain Lenzotti Date: Fri, 27 Sep 2024 13:49:23 +0200 Subject: [PATCH 6/6] chore: update eslint config to ignore files --- eslint.config.mjs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/eslint.config.mjs b/eslint.config.mjs index bce1e64c6d8..473f0a86fc9 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -9,11 +9,10 @@ import {join} from "node:path"; export default [ { - ignores: ["coverage", "dist", "processes.config.js", "**/templates"] + ignores: ["**/coverage", "**/lib", "**/dist", "processes.config.js", "**/templates", "**/docs/**", "**/docs-references/**"] }, { files: ["**/*.{js,mjs,cjs,jsx,mjsx,ts,tsx,mtsx}"], - ignores: ["**/lib/**", "**/dist/**", "**/coverage/**", "**/docs/**", "**/docs-references/**"], languageOptions: { ecmaVersion: "latest", sourceType: "module",