From b28375f6b2f07918508d38270a1a2b1c74729981 Mon Sep 17 00:00:00 2001 From: Alex H Date: Tue, 14 Oct 2025 20:54:16 +0200 Subject: [PATCH 1/3] chore: migrate to vitest --- .gitignore | 5 + .vscode/launch.json | 23 + .vscode/settings.json | 3 + apps/json-api-front/jest.config.ts | 22 - apps/json-api-front/project.json | 7 +- apps/json-api-front/proxy.conf.json | 4 + apps/json-api-front/src/test-setup.ts | 8 - apps/json-api-front/tsconfig.app.json | 2 +- apps/json-api-front/tsconfig.editor.json | 2 +- apps/json-api-front/tsconfig.spec.json | 16 - apps/json-api-server-e2e/jest.config.ts | 32 - apps/json-api-server-e2e/project.json | 12 +- .../src/support/global-setup.ts | 6 +- .../src/support/global-teardown.ts | 4 +- apps/json-api-server-e2e/tsconfig.spec.json | 56 +- apps/json-api-server-e2e/vite.config.mts | 85 + apps/json-api-server/.eslintrc.json | 18 - apps/json-api-server/jest.config.ts | 11 - apps/json-api-server/project.json | 48 +- apps/json-api-server/tsconfig.app.json | 16 +- apps/json-api-server/tsconfig.json | 34 +- apps/json-api-server/tsconfig.spec.json | 14 - apps/json-api-server/webpack.config.js | 15 +- .../json-api-nestjs-microorm/README.md | 13 +- .../json-api-nestjs-microorm/jest.config.ts | 10 - .../json-api-nestjs-microorm/package.json | 3 +- .../json-api-nestjs-microorm/project.json | 17 +- .../src/lib/mock-utils/index.ts | 2 +- .../src/lib/mock-utils/utils/init-db.ts | 6 +- .../orm-methods/delete-one/delete-one.spec.ts | 4 +- .../delete-relationship.spec.ts | 4 +- .../lib/orm-methods/get-all/get-all.spec.ts | 4 +- .../get-all/get-query-for-count.spec.ts | 4 +- .../lib/orm-methods/get-one/get-one.spec.ts | 4 +- .../get-relationship/get-relationship.spec.ts | 4 +- .../orm-methods/patch-one/patch-one.spec.ts | 4 +- .../patch-relationship.spec.ts | 4 +- .../lib/orm-methods/post-one/post-one.spec.ts | 4 +- .../post-relationship.spec.ts | 4 +- .../service/micro-orm-util.service.spec.ts | 4 +- .../json-api-nestjs-microorm/tsconfig.json | 3 +- .../tsconfig.lib.json | 9 +- .../tsconfig.spec.json | 32 +- .../json-api-nestjs-microorm/vite.config.mts | 54 + .../json-api-nestjs-sdk/jest.config.ts | 10 - .../json-api/json-api-nestjs-sdk/project.json | 14 - .../service/atomic-operations.service.spec.ts | 10 +- .../lib/service/fetch-inner-client.spec.ts | 55 +- .../lib/service/json-api-sdk.service.spec.ts | 140 +- .../service/json-api-utils.service.spec.ts | 10 +- .../json-api-nestjs-sdk/tsconfig-mjs.lib.json | 7 +- .../json-api-nestjs-sdk/tsconfig.lib.json | 2 +- .../json-api-nestjs-sdk/tsconfig.spec.json | 32 +- .../json-api-nestjs-sdk/vite.config.mts | 45 + .../json-api-nestjs-shared/jest.config.ts | 10 - .../json-api-nestjs-shared/package.json | 1 + .../json-api-nestjs-shared/project.json | 43 +- .../json-api-nestjs-shared/src/index.d.ts | 3 + .../json-api-nestjs-shared/src/index.js | 7 + .../json-api-nestjs-shared/src/index.js.map | 1 + .../src/lib/constants/index.d.ts | 2 + .../src/lib/constants/index.js | 6 + .../src/lib/constants/index.js.map | 1 + .../src/lib/types/entity-type.d.ts | 19 + .../src/lib/types/entity-type.js | 3 + .../src/lib/types/entity-type.js.map | 1 + .../src/lib/types/index.d.ts | 3 + .../src/lib/types/index.js | 7 + .../src/lib/types/index.js.map | 1 + .../src/lib/types/query-type.d.ts | 39 + .../src/lib/types/query-type.js | 48 + .../src/lib/types/query-type.js.map | 1 + .../src/lib/types/response-body.d.ts | 53 + .../src/lib/types/response-body.js | 3 + .../src/lib/types/response-body.js.map | 1 + .../src/lib/utils/index.d.ts | 1 + .../src/lib/utils/index.js | 5 + .../src/lib/utils/index.js.map | 1 + .../src/lib/utils/object-utils.d.ts | 10 + .../src/lib/utils/object-utils.js | 46 + .../src/lib/utils/object-utils.js.map | 1 + .../tsconfig-mjs.lib.json | 7 +- .../json-api-nestjs-shared/tsconfig.lib.json | 8 +- .../json-api-nestjs-shared/tsconfig.spec.json | 25 +- .../json-api-nestjs-shared/vite.config.mts | 45 + .../json-api-nestjs-typeorm/jest.config.ts | 10 - .../json-api-nestjs-typeorm/project.json | 9 - .../delete-relationship.spec.ts | 4 +- .../lib/orm-methods/get-all/get-all.spec.ts | 22 +- .../lib/orm-methods/get-one/get-one.spec.ts | 8 +- .../get-relationship/get-relationship.spec.ts | 6 +- .../orm-methods/patch-one/patch-one.spec.ts | 10 +- .../patch-relationship.spec.ts | 6 +- .../lib/orm-methods/post-one/post-one.spec.ts | 10 +- .../post-relationship.spec.ts | 4 +- .../type-orm-format.error.service.spec.ts | 4 +- .../lib/service/typeorm-utils.service.spec.ts | 4 +- .../json-api-nestjs-typeorm/tsconfig.lib.json | 2 +- .../tsconfig.spec.json | 33 +- .../json-api-nestjs-typeorm/vite.config.mts | 54 + libs/json-api/json-api-nestjs/jest.config.ts | 11 - libs/json-api/json-api-nestjs/project.json | 13 +- .../controllers/operation.controller.spec.ts | 20 +- .../pipes/input-operation.pipe.spec.ts | 10 +- .../service/execute.service.spec.ts | 63 +- .../utils/zod/zod-helper.spec.ts | 4 +- .../check-item-entity.pipe.spec.ts | 7 +- .../parse-relationship-name.pipe.spec.ts | 7 +- .../pipe/patch-input/patch-input.pipe.spec.ts | 8 +- .../patch-relationship.pipe.spec.ts | 10 +- .../pipe/post-input/post-input.pipe.spec.ts | 8 +- .../post-relationship.pipe.spec.ts | 10 +- .../query-check-select-field.spec.ts | 6 +- .../pipe/query-input/query-input.pipe.spec.ts | 6 +- .../mixin/pipe/query/query.pipe.spec.ts | 8 +- .../src/lib/utils/module-helper.spec.ts | 4 +- .../json-api-nestjs/tsconfig.lib.json | 2 +- .../json-api-nestjs/tsconfig.spec.json | 32 +- libs/json-api/json-api-nestjs/vite.config.mts | 45 + .../nestjs-json-rpc-sdk/jest.config.ts | 11 - .../json-rpc/nestjs-json-rpc-sdk/project.json | 25 - .../src/lib/utils/rpc-batch.spec.ts | 22 +- .../src/lib/utils/rpc-proxy.spec.ts | 12 +- .../src/lib/utils/wrapper-call.spec.ts | 20 +- .../nestjs-json-rpc-sdk/tsconfig-mjs.lib.json | 2 +- .../nestjs-json-rpc-sdk/tsconfig.lib.json | 2 +- .../nestjs-json-rpc-sdk/tsconfig.spec.json | 26 +- .../nestjs-json-rpc-sdk/vite.config.mts | 45 + libs/json-rpc/nestjs-json-rpc/jest.config.ts | 11 - libs/json-rpc/nestjs-json-rpc/project.json | 9 - .../controllers/json-rpc.controller.spec.ts | 2 +- .../filter/rpc-error-exception.filter.spec.ts | 4 +- .../util/service/handler.service.spec.ts | 20 +- .../src/lib/modules/util/util.module.spec.ts | 2 +- .../rpc-ws-error-exception.filter.spec.ts | 8 +- .../nestjs-json-rpc/tsconfig.lib.json | 2 +- .../nestjs-json-rpc/tsconfig.spec.json | 25 +- libs/json-rpc/nestjs-json-rpc/vite.config.mts | 45 + libs/microorm-database/jest.config.ts | 10 - libs/microorm-database/tsconfig.lib.json | 2 +- libs/microorm-database/tsconfig.spec.json | 15 - libs/type-for-rpc/jest.config.ts | 11 - libs/type-for-rpc/project.json | 10 - libs/type-for-rpc/tsconfig.lib.json | 2 +- libs/type-for-rpc/tsconfig.spec.json | 27 +- libs/type-for-rpc/vite.config.mts | 46 + libs/typeorm-database/jest.config.ts | 11 - libs/typeorm-database/src/lib/config-cli.ts | 6 +- libs/typeorm-database/tsconfig.lib.json | 2 +- libs/typeorm-database/tsconfig.spec.json | 14 - nx.json | 27 +- package-lock.json | 3088 +++++++++-------- package.json | 18 +- tools/scripts/prepare-package-json.mjs | 2 +- tsconfig.base.json | 10 +- vitest.workspace.ts | 4 + 156 files changed, 3082 insertions(+), 2339 deletions(-) create mode 100644 .vscode/launch.json create mode 100644 .vscode/settings.json delete mode 100644 apps/json-api-front/jest.config.ts delete mode 100644 apps/json-api-front/src/test-setup.ts delete mode 100644 apps/json-api-front/tsconfig.spec.json delete mode 100644 apps/json-api-server-e2e/jest.config.ts create mode 100644 apps/json-api-server-e2e/vite.config.mts delete mode 100644 apps/json-api-server/.eslintrc.json delete mode 100644 apps/json-api-server/jest.config.ts delete mode 100644 apps/json-api-server/tsconfig.spec.json delete mode 100644 libs/json-api/json-api-nestjs-microorm/jest.config.ts create mode 100644 libs/json-api/json-api-nestjs-microorm/vite.config.mts delete mode 100644 libs/json-api/json-api-nestjs-sdk/jest.config.ts create mode 100644 libs/json-api/json-api-nestjs-sdk/vite.config.mts delete mode 100644 libs/json-api/json-api-nestjs-shared/jest.config.ts create mode 100644 libs/json-api/json-api-nestjs-shared/src/index.d.ts create mode 100644 libs/json-api/json-api-nestjs-shared/src/index.js create mode 100644 libs/json-api/json-api-nestjs-shared/src/index.js.map create mode 100644 libs/json-api/json-api-nestjs-shared/src/lib/constants/index.d.ts create mode 100644 libs/json-api/json-api-nestjs-shared/src/lib/constants/index.js create mode 100644 libs/json-api/json-api-nestjs-shared/src/lib/constants/index.js.map create mode 100644 libs/json-api/json-api-nestjs-shared/src/lib/types/entity-type.d.ts create mode 100644 libs/json-api/json-api-nestjs-shared/src/lib/types/entity-type.js create mode 100644 libs/json-api/json-api-nestjs-shared/src/lib/types/entity-type.js.map create mode 100644 libs/json-api/json-api-nestjs-shared/src/lib/types/index.d.ts create mode 100644 libs/json-api/json-api-nestjs-shared/src/lib/types/index.js create mode 100644 libs/json-api/json-api-nestjs-shared/src/lib/types/index.js.map create mode 100644 libs/json-api/json-api-nestjs-shared/src/lib/types/query-type.d.ts create mode 100644 libs/json-api/json-api-nestjs-shared/src/lib/types/query-type.js create mode 100644 libs/json-api/json-api-nestjs-shared/src/lib/types/query-type.js.map create mode 100644 libs/json-api/json-api-nestjs-shared/src/lib/types/response-body.d.ts create mode 100644 libs/json-api/json-api-nestjs-shared/src/lib/types/response-body.js create mode 100644 libs/json-api/json-api-nestjs-shared/src/lib/types/response-body.js.map create mode 100644 libs/json-api/json-api-nestjs-shared/src/lib/utils/index.d.ts create mode 100644 libs/json-api/json-api-nestjs-shared/src/lib/utils/index.js create mode 100644 libs/json-api/json-api-nestjs-shared/src/lib/utils/index.js.map create mode 100644 libs/json-api/json-api-nestjs-shared/src/lib/utils/object-utils.d.ts create mode 100644 libs/json-api/json-api-nestjs-shared/src/lib/utils/object-utils.js create mode 100644 libs/json-api/json-api-nestjs-shared/src/lib/utils/object-utils.js.map create mode 100644 libs/json-api/json-api-nestjs-shared/vite.config.mts delete mode 100644 libs/json-api/json-api-nestjs-typeorm/jest.config.ts create mode 100644 libs/json-api/json-api-nestjs-typeorm/vite.config.mts delete mode 100644 libs/json-api/json-api-nestjs/jest.config.ts create mode 100644 libs/json-api/json-api-nestjs/vite.config.mts delete mode 100644 libs/json-rpc/nestjs-json-rpc-sdk/jest.config.ts create mode 100644 libs/json-rpc/nestjs-json-rpc-sdk/vite.config.mts delete mode 100644 libs/json-rpc/nestjs-json-rpc/jest.config.ts create mode 100644 libs/json-rpc/nestjs-json-rpc/vite.config.mts delete mode 100644 libs/microorm-database/jest.config.ts delete mode 100644 libs/microorm-database/tsconfig.spec.json delete mode 100644 libs/type-for-rpc/jest.config.ts create mode 100644 libs/type-for-rpc/vite.config.mts delete mode 100644 libs/typeorm-database/jest.config.ts delete mode 100644 libs/typeorm-database/tsconfig.spec.json create mode 100644 vitest.workspace.ts diff --git a/.gitignore b/.gitignore index f52a366b..1e9e5ebb 100644 --- a/.gitignore +++ b/.gitignore @@ -42,3 +42,8 @@ Thumbs.db .nx/workspace-data .angular .dev.env + +vite.config.*.timestamp* +vitest.config.*.timestamp* +.cursor/rules/nx-rules.mdc +.github/instructions/nx.instructions.md diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 00000000..654eeee6 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,23 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "type": "node", + "request": "launch", + "name": "Debug json-api-server with Nx", + "runtimeExecutable": "npx", + "runtimeArgs": ["nx", "serve", "json-api-server"], + "env": { + "NODE_OPTIONS": "--inspect=9229" + }, + "console": "integratedTerminal", + "internalConsoleOptions": "neverOpen", + "skipFiles": ["/**"], + "sourceMaps": true, + "outFiles": [ + "${workspaceFolder}/apps/json-api-server/dist/**/*.(m|c|)js", + "!**/node_modules/**" + ] + } + ] +} diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 00000000..1471fb96 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "eslint.validate": ["json"] +} diff --git a/apps/json-api-front/jest.config.ts b/apps/json-api-front/jest.config.ts deleted file mode 100644 index 8e6d28b8..00000000 --- a/apps/json-api-front/jest.config.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* eslint-disable */ -export default { - displayName: 'json-api-front', - preset: '../../jest.preset.js', - setupFilesAfterEnv: ['/src/test-setup.ts'], - coverageDirectory: '../../coverage/apps/json-api-front', - transform: { - '^.+\\.(ts|mjs|js|html)$': [ - 'jest-preset-angular', - { - tsconfig: '/tsconfig.spec.json', - stringifyContentPathRegex: '\\.(html|svg)$', - }, - ], - }, - transformIgnorePatterns: ['node_modules/(?!.*\\.mjs$)'], - snapshotSerializers: [ - 'jest-preset-angular/build/serializers/no-ng-attributes', - 'jest-preset-angular/build/serializers/ng-snapshot', - 'jest-preset-angular/build/serializers/html-comment', - ], -}; diff --git a/apps/json-api-front/project.json b/apps/json-api-front/project.json index 9f92b9d0..18a1b470 100644 --- a/apps/json-api-front/project.json +++ b/apps/json-api-front/project.json @@ -5,6 +5,7 @@ "prefix": "nestjs-json-api", "sourceRoot": "apps/json-api-front/src", "tags": [], + "implicitDependencies": ["json-api-nestjs-sdk"], "targets": { "build": { "executor": "@angular-devkit/build-angular:application", @@ -60,7 +61,8 @@ "buildTarget": "json-api-front:build:development" } }, - "defaultConfiguration": "development" + "defaultConfiguration": "development", + "dependsOn": ["json-api-server:serve"] }, "extract-i18n": { "executor": "@angular-devkit/build-angular:extract-i18n", @@ -68,6 +70,5 @@ "buildTarget": "json-api-front:build" } } - }, - "implicitDependencies": ["json-api-nestjs-sdk"] + } } diff --git a/apps/json-api-front/proxy.conf.json b/apps/json-api-front/proxy.conf.json index 6974fc0e..e2c9a30e 100644 --- a/apps/json-api-front/proxy.conf.json +++ b/apps/json-api-front/proxy.conf.json @@ -7,5 +7,9 @@ "target": "http://localhost:3000", "secure": false, "ws": true + }, + "/json-api-server-api": { + "target": "http://localhost:3000", + "secure": false } } diff --git a/apps/json-api-front/src/test-setup.ts b/apps/json-api-front/src/test-setup.ts deleted file mode 100644 index ab1eeeb3..00000000 --- a/apps/json-api-front/src/test-setup.ts +++ /dev/null @@ -1,8 +0,0 @@ -// @ts-expect-error https://thymikee.github.io/jest-preset-angular/docs/getting-started/test-environment -globalThis.ngJest = { - testEnvironmentOptions: { - errorOnUnknownElements: true, - errorOnUnknownProperties: true, - }, -}; -import 'jest-preset-angular/setup-jest'; diff --git a/apps/json-api-front/tsconfig.app.json b/apps/json-api-front/tsconfig.app.json index 9e23a423..aab00174 100644 --- a/apps/json-api-front/tsconfig.app.json +++ b/apps/json-api-front/tsconfig.app.json @@ -7,5 +7,5 @@ }, "files": ["src/main.ts"], "include": ["src/**/*.d.ts"], - "exclude": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts"] + "exclude": ["src/**/*.test.ts", "src/**/*.spec.ts"] } diff --git a/apps/json-api-front/tsconfig.editor.json b/apps/json-api-front/tsconfig.editor.json index 8ae117d9..b927bb69 100644 --- a/apps/json-api-front/tsconfig.editor.json +++ b/apps/json-api-front/tsconfig.editor.json @@ -2,6 +2,6 @@ "extends": "./tsconfig.json", "include": ["src/**/*.ts"], "compilerOptions": { - "types": ["jest", "node"] + "types": ["node"] } } diff --git a/apps/json-api-front/tsconfig.spec.json b/apps/json-api-front/tsconfig.spec.json deleted file mode 100644 index 53fbfcdc..00000000 --- a/apps/json-api-front/tsconfig.spec.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "outDir": "../../dist/out-tsc", - "module": "commonjs", - "target": "es2016", - "types": ["jest", "node"] - }, - "files": ["src/test-setup.ts"], - "include": [ - "jest.config.ts", - "src/**/*.test.ts", - "src/**/*.spec.ts", - "src/**/*.d.ts" - ] -} diff --git a/apps/json-api-server-e2e/jest.config.ts b/apps/json-api-server-e2e/jest.config.ts deleted file mode 100644 index 5c75a2f7..00000000 --- a/apps/json-api-server-e2e/jest.config.ts +++ /dev/null @@ -1,32 +0,0 @@ -/* eslint-disable */ -export default { - displayName: 'json-api-server-e2e', - preset: '../../jest.preset.js', - globalSetup: '/src/support/global-setup.ts', - globalTeardown: '/src/support/global-teardown.ts', - setupFiles: ['/src/support/test-setup.ts'], - testEnvironment: 'node', - maxWorkers: 1, - transform: { - '^.+\\.[tj]s$': [ - 'ts-jest', - { - tsconfig: '/tsconfig.spec.json', - }, - ], - }, - moduleFileExtensions: ['ts', 'js', 'html'], - coverageDirectory: '../../coverage/json-api-server-e2e', - moduleNameMapper: { - '^@klerick/json-api-nestjs$': - '/../../dist/libs/json-api/json-api-nestjs', - '^@klerick/json-api-nestjs-microorm$': - '/../../dist/libs/json-api/json-api-nestjs-microorm', - '^@klerick/json-api-nestjs-shared$': - '/../../dist/libs/json-api/json-api-nestjs-shared', - '^@klerick/json-api-nestjs-typeorm$': - '/../../dist/libs/json-api/json-api-nestjs-typeorm', - '^@klerick/json-api-nestjs-sdk$': - '/../../dist/libs/json-api/json-api-nestjs-sdk', - }, -}; diff --git a/apps/json-api-server-e2e/project.json b/apps/json-api-server-e2e/project.json index c702eb4b..9a612596 100644 --- a/apps/json-api-server-e2e/project.json +++ b/apps/json-api-server-e2e/project.json @@ -12,14 +12,14 @@ "target": "build", "params": "ignore" }], - "executor": "@nx/jest:jest", + "executor": "@nx/vite:test", "outputs": [ "{workspaceRoot}/coverage/{e2eProjectRoot}" ], "options": { - "jestConfig": "apps/json-api-server-e2e/jest.config.ts", + "config": "apps/json-api-server-e2e/vite.config.mts", "passWithNoTests": true, - "parallel": 1 + "reportsDirectory": "../../coverage/apps/json-api-server-e2e" } }, "e2e-micro": { @@ -28,14 +28,14 @@ "target": "build", "params": "ignore" }], - "executor": "@nx/jest:jest", + "executor": "@nx/vite:test", "outputs": [ "{workspaceRoot}/coverage/{e2eProjectRoot}" ], "options": { - "jestConfig": "apps/json-api-server-e2e/jest.config.ts", + "config": "apps/json-api-server-e2e/vite.config.mts", "passWithNoTests": true, - "parallel": 1 + "reportsDirectory": "../../coverage/apps/json-api-server-e2e" } } } diff --git a/apps/json-api-server-e2e/src/support/global-setup.ts b/apps/json-api-server-e2e/src/support/global-setup.ts index d18e0f29..fe8392d2 100644 --- a/apps/json-api-server-e2e/src/support/global-setup.ts +++ b/apps/json-api-server-e2e/src/support/global-setup.ts @@ -1,11 +1,9 @@ /* eslint-disable */ -var __TEARDOWN_MESSAGE__: string; - -module.exports = async function() { +export default async function() { // Start services that that the app needs to run (e.g. database, docker-compose, etc.). console.log('\nSetting up...\n'); // Hint: Use `globalThis` to pass variables to global teardown. globalThis.__TEARDOWN_MESSAGE__ = '\nTearing down...\n'; -}; +} diff --git a/apps/json-api-server-e2e/src/support/global-teardown.ts b/apps/json-api-server-e2e/src/support/global-teardown.ts index 67746ceb..cfb0bdfe 100644 --- a/apps/json-api-server-e2e/src/support/global-teardown.ts +++ b/apps/json-api-server-e2e/src/support/global-teardown.ts @@ -1,7 +1,7 @@ /* eslint-disable */ -module.exports = async function() { +export default async function() { // Put clean up logic here (e.g. stopping services, docker-compose, etc.). // Hint: `globalThis` is shared between setup and teardown. console.log(globalThis.__TEARDOWN_MESSAGE__); -}; +} diff --git a/apps/json-api-server-e2e/tsconfig.spec.json b/apps/json-api-server-e2e/tsconfig.spec.json index 98c05597..f6ea399e 100644 --- a/apps/json-api-server-e2e/tsconfig.spec.json +++ b/apps/json-api-server-e2e/tsconfig.spec.json @@ -1,20 +1,60 @@ { "extends": "./tsconfig.json", "compilerOptions": { - "outDir": "../../dist/out-tsc", - "module": "commonjs", - "types": ["jest", "node"], + "outDir": "../../../dist/out-tsc", + "module": "ES2022", + "moduleResolution": "node10", + "experimentalDecorators": true, "emitDecoratorMetadata": true, - "target": "es2021", - "strictBindCallApply": true, "strictNullChecks": true, "noImplicitAny": true, + "strictBindCallApply": true, "forceConsistentCasingInFileNames": true, "noFallthroughCasesInSwitch": true, - "allowJs": true + "types": [ + "vitest/globals", + "vitest/importMeta", + "vite/client", + "node", + "vitest" + ], + "allowSyntheticDefaultImports": true, + "esModuleInterop": true, + "paths": { + "@nestjs-json-api/microorm-database": [ + "libs/microorm-database/src/index.ts" + ], + "@nestjs-json-api/type-for-rpc": ["libs/type-for-rpc/src/index.ts"], + "@nestjs-json-api/typeorm-database": ["libs/typeorm-database/src/index.ts"], + "@klerick/json-api-nestjs": ["dist/libs/json-api/json-api-nestjs"], + "@klerick/json-api-nestjs-microorm": [ + "dist/libs/json-api/json-api-nestjs-microorm" + ], + "@klerick/json-api-nestjs-sdk": ["dist/libs/json-api/json-api-nestjs-sdk"], + "@klerick/json-api-nestjs-shared": [ + "dist/libs/json-api/json-api-nestjs-shared" + ], + "@klerick/json-api-nestjs-typeorm": [ + "dist/libs/json-api/json-api-nestjs-typeorm" + ], + "@klerick/nestjs-json-rpc": [ + "libs/json-rpc/nestjs-json-rpc/src/index.ts" + ], + "@klerick/nestjs-json-rpc-sdk": [ + "libs/json-rpc/nestjs-json-rpc-sdk/src/index.ts" + ], + "@klerick/nestjs-json-rpc-sdk/ngModule": [ + "libs/json-rpc/nestjs-json-rpc-sdk/src/ngModule.ts" + ] + } }, "include": [ - "jest.config.ts", - "src/**/*.ts" + "vite.config.ts", + "vite.config.mts", + "vitest.config.ts", + "vitest.config.mts", + "src/**/*.test.ts", + "src/**/*.spec.ts", + "src/**/*.d.ts" ] } diff --git a/apps/json-api-server-e2e/vite.config.mts b/apps/json-api-server-e2e/vite.config.mts new file mode 100644 index 00000000..4b6babdf --- /dev/null +++ b/apps/json-api-server-e2e/vite.config.mts @@ -0,0 +1,85 @@ +/// +import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin'; + +import swc from 'unplugin-swc'; +import { defineConfig } from 'vite'; +import path from 'node:path'; + +export default defineConfig(() => ({ + root: __dirname, + cacheDir: '../../node_modules/.vite/apps/json-api-server-e2e', + // resolve: { + // alias: { + // '@klerick/json-api-nestjs': path.resolve( + // __dirname, + // '../../dist/libs/json-api/json-api-nestjs' + // ), + // '@klerick/json-api-nestjs-microorm': path.resolve( + // __dirname, + // '../../dist/libs/json-api/json-api-nestjs-microorm' + // ), + // '@klerick/json-api-nestjs-shared': path.resolve( + // __dirname, + // '../../dist/libs/json-api/json-api-nestjs-shared' + // ), + // '@klerick/json-api-nestjs-typeorm': path.resolve( + // __dirname, + // '../../dist/libs/json-api/json-api-nestjs-typeorm' + // ), + // '@klerick/json-api-nestjs-sdk': path.resolve( + // __dirname, + // '../../dist/libs/json-api/json-api-nestjs-sdk' + // ), + // }, + // }, + plugins: [ + nxViteTsPaths(), + swc.vite({ + module: { type: 'es6' }, + jsc: { + target: 'es2022', + parser: { + syntax: 'typescript', + decorators: true, + }, + transform: { + decoratorMetadata: true, + legacyDecorator: true, + }, + keepClassNames: true, + externalHelpers: true, + loose: true, + }, + }), + ], + test: { + name: 'json-api-server-e2e', + watch: false, + globals: true, + environment: 'node', + include: ['src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'], + setupFiles: ['src/support/test-setup.ts'], + globalSetup: ['src/support/global-setup.ts'], + globalTeardown: ['src/support/global-teardown.ts'], + reporters: ['default'], + coverage: { + enabled: true, + reporter: ['json'], + reportsDirectory: '../../coverage/json-api-server-e2e', + provider: 'v8' as const, + }, + fileParallelism: false, + pool: 'threads', + singleThread: true, + sequence: { + concurrent: false, + shuffle: false, + }, + maxWorkers: 1, + minWorkers: 1, + env: { + VITEST: 'true', + NODE_ENV: 'test', + }, + }, +})); diff --git a/apps/json-api-server/.eslintrc.json b/apps/json-api-server/.eslintrc.json deleted file mode 100644 index 9d9c0db5..00000000 --- a/apps/json-api-server/.eslintrc.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "extends": ["../../.eslintrc.json"], - "ignorePatterns": ["!**/*"], - "overrides": [ - { - "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], - "rules": {} - }, - { - "files": ["*.ts", "*.tsx"], - "rules": {} - }, - { - "files": ["*.js", "*.jsx"], - "rules": {} - } - ] -} diff --git a/apps/json-api-server/jest.config.ts b/apps/json-api-server/jest.config.ts deleted file mode 100644 index a0ec9d5c..00000000 --- a/apps/json-api-server/jest.config.ts +++ /dev/null @@ -1,11 +0,0 @@ -/* eslint-disable */ -export default { - displayName: 'json-api-server', - preset: '../../jest.preset.js', - testEnvironment: 'node', - transform: { - '^.+\\.[tj]s$': ['ts-jest', { tsconfig: '/tsconfig.spec.json' }] - }, - moduleFileExtensions: ['ts', 'js', 'html'], - coverageDirectory: '../../coverage/apps/json-api-server' -}; diff --git a/apps/json-api-server/project.json b/apps/json-api-server/project.json index d05092b4..2d9dd3e8 100644 --- a/apps/json-api-server/project.json +++ b/apps/json-api-server/project.json @@ -4,11 +4,54 @@ "sourceRoot": "apps/json-api-server/src", "projectType": "application", "targets": { + "build": { + "executor": "nx:run-commands", + "options": { + "command": "webpack-cli build", + "args": ["--node-env=production"], + "cwd": "apps/json-api-server" + }, + "configurations": { + "development": { + "args": ["--node-env=development"] + } + } + }, + "prune-lockfile": { + "dependsOn": ["build"], + "cache": true, + "executor": "@nx/js:prune-lockfile", + "outputs": [ + "{workspaceRoot}/dist/apps/json-api-server/package.json", + "{workspaceRoot}/dist/apps/json-api-server/package-lock.json" + ], + "options": { + "buildTarget": "build" + } + }, + "copy-workspace-modules": { + "dependsOn": ["build"], + "cache": true, + "outputs": [ + "{workspaceRoot}/dist/apps/json-api-server/workspace_modules" + ], + "executor": "@nx/js:copy-workspace-modules", + "options": { + "buildTarget": "build" + } + }, + "prune": { + "dependsOn": ["prune-lockfile", "copy-workspace-modules"], + "executor": "nx:noop" + }, "serve": { + "continuous": true, "executor": "@nx/js:node", "defaultConfiguration": "development", + "dependsOn": ["build"], "options": { - "buildTarget": "json-api-server:build" + "buildTarget": "json-api-server:build", + "runBuildTargetDependencies": false }, "configurations": { "development": { @@ -20,6 +63,5 @@ } } }, - "tags": [], - "implicitDependencies": ["json-api-nestjs-typeorm", "json-api-nestjs-microorm", "json-api-nestjs-sdk"] + "tags": [] } diff --git a/apps/json-api-server/tsconfig.app.json b/apps/json-api-server/tsconfig.app.json index 94727a51..9be508be 100644 --- a/apps/json-api-server/tsconfig.app.json +++ b/apps/json-api-server/tsconfig.app.json @@ -3,9 +3,8 @@ "compilerOptions": { "outDir": "../../dist/out-tsc", "module": "commonjs", - "types": [ - "node" - ], + "types": ["node"], + "experimentalDecorators": true, "emitDecoratorMetadata": true, "target": "es2021", "strictBindCallApply": true, @@ -14,14 +13,5 @@ "forceConsistentCasingInFileNames": true, "noFallthroughCasesInSwitch": true }, - "exclude": [ - "jest.config.ts", - "src/**/*.spec.ts", - "src/**/*.test.ts", - "**/*.test-d.ts" - ], - "include": [ - "src/**/*.ts", - "*.test-d.ts" - ] + "include": ["src/**/*.ts"] } diff --git a/apps/json-api-server/tsconfig.json b/apps/json-api-server/tsconfig.json index c1e2dd4e..9af9a764 100644 --- a/apps/json-api-server/tsconfig.json +++ b/apps/json-api-server/tsconfig.json @@ -5,12 +5,36 @@ "references": [ { "path": "./tsconfig.app.json" - }, - { - "path": "./tsconfig.spec.json" } ], "compilerOptions": { - "esModuleInterop": true - } + "esModuleInterop": true, + "paths": { + "@nestjs-json-api/microorm-database": [ + "libs/microorm-database/src/index.ts" + ], + "@nestjs-json-api/type-for-rpc": ["libs/type-for-rpc/src/index.ts"], + "@nestjs-json-api/typeorm-database": ["libs/typeorm-database/src/index.ts"], + "@klerick/json-api-nestjs": ["dist/libs/json-api/json-api-nestjs"], + "@klerick/json-api-nestjs-microorm": [ + "dist/libs/json-api/json-api-nestjs-microorm" + ], + "@klerick/json-api-nestjs-sdk": ["dist/libs/json-api/json-api-nestjs-sdk"], + "@klerick/json-api-nestjs-shared": [ + "dist/libs/json-api/json-api-nestjs-shared" + ], + "@klerick/json-api-nestjs-typeorm": [ + "dist/libs/json-api/json-api-nestjs-typeorm" + ], + "@klerick/nestjs-json-rpc": [ + "libs/json-rpc/nestjs-json-rpc/src/index.ts" + ], + "@klerick/nestjs-json-rpc-sdk": [ + "libs/json-rpc/nestjs-json-rpc-sdk/src/index.ts" + ], + "@klerick/nestjs-json-rpc-sdk/ngModule": [ + "libs/json-rpc/nestjs-json-rpc-sdk/src/ngModule.ts" + ] + } + }, } diff --git a/apps/json-api-server/tsconfig.spec.json b/apps/json-api-server/tsconfig.spec.json deleted file mode 100644 index 9b2a121d..00000000 --- a/apps/json-api-server/tsconfig.spec.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "outDir": "../../dist/out-tsc", - "module": "commonjs", - "types": ["jest", "node"] - }, - "include": [ - "jest.config.ts", - "src/**/*.test.ts", - "src/**/*.spec.ts", - "src/**/*.d.ts" - ] -} diff --git a/apps/json-api-server/webpack.config.js b/apps/json-api-server/webpack.config.js index 39529d6d..1e0e78b8 100644 --- a/apps/json-api-server/webpack.config.js +++ b/apps/json-api-server/webpack.config.js @@ -1,21 +1,24 @@ - -const { NxWebpackPlugin } = require('@nx/webpack'); +const { NxAppWebpackPlugin } = require('@nx/webpack/app-plugin'); const { join } = require('path'); module.exports = { output: { path: join(__dirname, '../../dist/apps/json-api-server'), + ...(process.env.NODE_ENV !== 'production' && { + devtoolModuleFilenameTemplate: '[absolute-resource-path]', + }), }, plugins: [ - new NxWebpackPlugin({ + new NxAppWebpackPlugin({ target: 'node', compiler: 'tsc', main: './src/main.ts', tsConfig: './tsconfig.app.json', - assets: ["./src/assets"], + assets: ['./src/assets'], optimization: false, outputHashing: 'none', - }) + generatePackageJson: true, + sourceMaps: true, + }), ], }; - diff --git a/libs/json-api/json-api-nestjs-microorm/README.md b/libs/json-api/json-api-nestjs-microorm/README.md index ab6c3127..705dc7a2 100644 --- a/libs/json-api/json-api-nestjs-microorm/README.md +++ b/libs/json-api/json-api-nestjs-microorm/README.md @@ -1,11 +1,12 @@ # json-api-nestjs-microorm + MocroOrm adapter for **[json-api-nestjs](https://github.com/klerick/nestjs-json-api/tree/master/libs/json-api/json-api-nestjs)** ## Installation -```bash +```bash $ npm install @klerick/json-api-nestjs-microorm -``` +``` ## Configuration params @@ -15,17 +16,16 @@ The following interface is using for the configuration: export type MicroOrmParam = { arrayType?: string[]; //Custom type for indicate of array }; - ``` ## NOTE: MikroORM Default Named Context Issue in NestJS [@mikro-orm/nestjs](https://github.com/mikro-orm/nestjs) does not create a [default named context](https://github.com/mikro-orm/nestjs/discussions/214). -As a result, the module initialization behaves differently depending on whether a single or multiple connections are used. +As a result, the module initialization behaves differently depending on whether a single or multiple connections are used. More specifically, the [dependency injection token for MikroORM differs](https://github.com/mikro-orm/nestjs/issues/213) between one and multiple database connections. -To maintain a consistent JSON:API module configuration across different database adapters, +To maintain a consistent JSON:API module configuration across different database adapters, I decided **not to add extra conditional checks** in the setup. For everything to work correctly, @mikro-orm/nestjs should be integrated using the following module: @@ -47,6 +47,3 @@ export const config: Options = { }) export class MicroOrmDatabaseModule {} ``` - - - diff --git a/libs/json-api/json-api-nestjs-microorm/jest.config.ts b/libs/json-api/json-api-nestjs-microorm/jest.config.ts deleted file mode 100644 index 840ada7c..00000000 --- a/libs/json-api/json-api-nestjs-microorm/jest.config.ts +++ /dev/null @@ -1,10 +0,0 @@ -export default { - displayName: 'json-api-nestjs-microorm', - preset: '../../../jest.preset.js', - testEnvironment: 'node', - transform: { - '^.+\\.[tj]s$': ['ts-jest', { tsconfig: '/tsconfig.spec.json' }], - }, - moduleFileExtensions: ['ts', 'js', 'html'], - coverageDirectory: '../../../coverage/libs/json-api/json-api-nestjs-microorm', -}; diff --git a/libs/json-api/json-api-nestjs-microorm/package.json b/libs/json-api/json-api-nestjs-microorm/package.json index 3e52ee27..e68a4883 100644 --- a/libs/json-api/json-api-nestjs-microorm/package.json +++ b/libs/json-api/json-api-nestjs-microorm/package.json @@ -17,6 +17,5 @@ "peerDependencies": { "@klerick/json-api-nestjs": "0.0.0", "@mikro-orm/nestjs": "^6.1.0" - }, - "dependencies": {} + } } diff --git a/libs/json-api/json-api-nestjs-microorm/project.json b/libs/json-api/json-api-nestjs-microorm/project.json index cb865651..0e207c53 100644 --- a/libs/json-api/json-api-nestjs-microorm/project.json +++ b/libs/json-api/json-api-nestjs-microorm/project.json @@ -12,13 +12,7 @@ "implicitDependencies": ["json-api-nestjs"], "targets": { "build-common": { - "dependsOn": [ - { - "projects": ["json-api-nestjs"], - "target": "build", - "params": "ignore" - } - ], + "dependsOn": ["^build", "^build-cjs", "^build-mjs"], "executor": "@nx/js:tsc", "outputs": ["{options.outputPath}"], "options": { @@ -55,15 +49,6 @@ "parallel": false } }, - "test": { - "executor": "@nx/jest:jest", - "outputs": ["{workspaceRoot}/coverage/{projectRoot}"], - "options": { - "jestConfig": "{projectRoot}/jest.config.ts", - "codeCoverage": true, - "coverageReporters": ["json-summary"] - } - }, "upload-badge": { "executor": "nx:run-commands", "dependsOn": [ diff --git a/libs/json-api/json-api-nestjs-microorm/src/lib/mock-utils/index.ts b/libs/json-api/json-api-nestjs-microorm/src/lib/mock-utils/index.ts index 80dc335d..985a6a5c 100644 --- a/libs/json-api/json-api-nestjs-microorm/src/lib/mock-utils/index.ts +++ b/libs/json-api/json-api-nestjs-microorm/src/lib/mock-utils/index.ts @@ -39,7 +39,7 @@ export const entities = [Users, UserGroups, Roles, Comments, Addresses, Notes]; export function mockDbPgLiteTestModule(dbName = `test_db_${Date.now()}`) { const mikroORM = { provide: MikroORM, - useFactory: async () => { + useFactory: async function () { const knexInst = await sharedConnect(); return initMikroOrm(knexInst, dbName); }, diff --git a/libs/json-api/json-api-nestjs-microorm/src/lib/mock-utils/utils/init-db.ts b/libs/json-api/json-api-nestjs-microorm/src/lib/mock-utils/utils/init-db.ts index a213e21c..abf9d327 100644 --- a/libs/json-api/json-api-nestjs-microorm/src/lib/mock-utils/utils/init-db.ts +++ b/libs/json-api/json-api-nestjs-microorm/src/lib/mock-utils/utils/init-db.ts @@ -4,7 +4,7 @@ import { PostgreSqlDriver } from '@mikro-orm/postgresql'; import { SqlHighlighter } from '@mikro-orm/sql-highlighter'; import Knex from 'knex'; -import * as ClientPgLite from 'knex-pglite'; +import ClientPgLite from 'knex-pglite'; import { Addresses, @@ -18,9 +18,6 @@ import { let knexInst: TypeKnex; export async function sharedConnect(): Promise { - // @ts-ignore - // return globalThis.pgLite; - if (knexInst) { return knexInst; } @@ -37,7 +34,6 @@ export async function sharedConnect(): Promise { ); knexInst = Knex({ - // @ts-ignore client: ClientPgLite, dialect: 'postgres', // @ts-ignore diff --git a/libs/json-api/json-api-nestjs-microorm/src/lib/orm-methods/delete-one/delete-one.spec.ts b/libs/json-api/json-api-nestjs-microorm/src/lib/orm-methods/delete-one/delete-one.spec.ts index 46b6676d..cad93724 100644 --- a/libs/json-api/json-api-nestjs-microorm/src/lib/orm-methods/delete-one/delete-one.spec.ts +++ b/libs/json-api/json-api-nestjs-microorm/src/lib/orm-methods/delete-one/delete-one.spec.ts @@ -26,8 +26,8 @@ describe('delete-one', () => { }); afterEach(() => { - jest.clearAllMocks(); - jest.restoreAllMocks(); + vi.clearAllMocks(); + vi.restoreAllMocks(); }); afterAll(() => { diff --git a/libs/json-api/json-api-nestjs-microorm/src/lib/orm-methods/delete-relationship/delete-relationship.spec.ts b/libs/json-api/json-api-nestjs-microorm/src/lib/orm-methods/delete-relationship/delete-relationship.spec.ts index fb8bd829..6901ce73 100644 --- a/libs/json-api/json-api-nestjs-microorm/src/lib/orm-methods/delete-relationship/delete-relationship.spec.ts +++ b/libs/json-api/json-api-nestjs-microorm/src/lib/orm-methods/delete-relationship/delete-relationship.spec.ts @@ -88,8 +88,8 @@ describe('delete-relationship', () => { }); afterEach(() => { - jest.clearAllMocks(); - jest.restoreAllMocks(); + vi.clearAllMocks(); + vi.restoreAllMocks(); }); afterAll(() => { diff --git a/libs/json-api/json-api-nestjs-microorm/src/lib/orm-methods/get-all/get-all.spec.ts b/libs/json-api/json-api-nestjs-microorm/src/lib/orm-methods/get-all/get-all.spec.ts index 7d7b6289..f60af96b 100644 --- a/libs/json-api/json-api-nestjs-microorm/src/lib/orm-methods/get-all/get-all.spec.ts +++ b/libs/json-api/json-api-nestjs-microorm/src/lib/orm-methods/get-all/get-all.spec.ts @@ -33,8 +33,8 @@ describe('get-all', () => { }); afterEach(() => { - jest.clearAllMocks(); - jest.restoreAllMocks(); + vi.clearAllMocks(); + vi.restoreAllMocks(); }); afterAll(() => { diff --git a/libs/json-api/json-api-nestjs-microorm/src/lib/orm-methods/get-all/get-query-for-count.spec.ts b/libs/json-api/json-api-nestjs-microorm/src/lib/orm-methods/get-all/get-query-for-count.spec.ts index 5fd1e311..de30fca4 100644 --- a/libs/json-api/json-api-nestjs-microorm/src/lib/orm-methods/get-all/get-query-for-count.spec.ts +++ b/libs/json-api/json-api-nestjs-microorm/src/lib/orm-methods/get-all/get-query-for-count.spec.ts @@ -35,8 +35,8 @@ describe('get-query-for-count', () => { }); afterEach(() => { - jest.clearAllMocks(); - jest.restoreAllMocks(); + vi.clearAllMocks(); + vi.restoreAllMocks(); }); afterAll(() => { diff --git a/libs/json-api/json-api-nestjs-microorm/src/lib/orm-methods/get-one/get-one.spec.ts b/libs/json-api/json-api-nestjs-microorm/src/lib/orm-methods/get-one/get-one.spec.ts index 7aa063b9..5f8135ad 100644 --- a/libs/json-api/json-api-nestjs-microorm/src/lib/orm-methods/get-one/get-one.spec.ts +++ b/libs/json-api/json-api-nestjs-microorm/src/lib/orm-methods/get-one/get-one.spec.ts @@ -29,8 +29,8 @@ describe('get-one', () => { }); afterEach(() => { - jest.clearAllMocks(); - jest.restoreAllMocks(); + vi.clearAllMocks(); + vi.restoreAllMocks(); }); afterAll(() => { diff --git a/libs/json-api/json-api-nestjs-microorm/src/lib/orm-methods/get-relationship/get-relationship.spec.ts b/libs/json-api/json-api-nestjs-microorm/src/lib/orm-methods/get-relationship/get-relationship.spec.ts index 8cfb373f..cca420a2 100644 --- a/libs/json-api/json-api-nestjs-microorm/src/lib/orm-methods/get-relationship/get-relationship.spec.ts +++ b/libs/json-api/json-api-nestjs-microorm/src/lib/orm-methods/get-relationship/get-relationship.spec.ts @@ -92,8 +92,8 @@ describe('get-relationship', () => { }); afterEach(() => { - jest.clearAllMocks(); - jest.restoreAllMocks(); + vi.clearAllMocks(); + vi.restoreAllMocks(); }); afterAll(() => { diff --git a/libs/json-api/json-api-nestjs-microorm/src/lib/orm-methods/patch-one/patch-one.spec.ts b/libs/json-api/json-api-nestjs-microorm/src/lib/orm-methods/patch-one/patch-one.spec.ts index 539545d6..58919686 100644 --- a/libs/json-api/json-api-nestjs-microorm/src/lib/orm-methods/patch-one/patch-one.spec.ts +++ b/libs/json-api/json-api-nestjs-microorm/src/lib/orm-methods/patch-one/patch-one.spec.ts @@ -100,8 +100,8 @@ describe('patch-one', () => { }); afterEach(() => { - jest.clearAllMocks(); - jest.restoreAllMocks(); + vi.clearAllMocks(); + vi.restoreAllMocks(); }); afterAll(() => { diff --git a/libs/json-api/json-api-nestjs-microorm/src/lib/orm-methods/patch-relationship/patch-relationship.spec.ts b/libs/json-api/json-api-nestjs-microorm/src/lib/orm-methods/patch-relationship/patch-relationship.spec.ts index 32caa80c..b52a9beb 100644 --- a/libs/json-api/json-api-nestjs-microorm/src/lib/orm-methods/patch-relationship/patch-relationship.spec.ts +++ b/libs/json-api/json-api-nestjs-microorm/src/lib/orm-methods/patch-relationship/patch-relationship.spec.ts @@ -77,8 +77,8 @@ describe('patch-relationship', () => { }); afterEach(() => { - jest.clearAllMocks(); - jest.restoreAllMocks(); + vi.clearAllMocks(); + vi.restoreAllMocks(); }); afterAll(() => { diff --git a/libs/json-api/json-api-nestjs-microorm/src/lib/orm-methods/post-one/post-one.spec.ts b/libs/json-api/json-api-nestjs-microorm/src/lib/orm-methods/post-one/post-one.spec.ts index 77c158c1..38ab3b75 100644 --- a/libs/json-api/json-api-nestjs-microorm/src/lib/orm-methods/post-one/post-one.spec.ts +++ b/libs/json-api/json-api-nestjs-microorm/src/lib/orm-methods/post-one/post-one.spec.ts @@ -96,8 +96,8 @@ describe('post-one', () => { }); afterEach(() => { - jest.clearAllMocks(); - jest.restoreAllMocks(); + vi.clearAllMocks(); + vi.restoreAllMocks(); }); afterAll(() => { diff --git a/libs/json-api/json-api-nestjs-microorm/src/lib/orm-methods/post-relationship/post-relationship.spec.ts b/libs/json-api/json-api-nestjs-microorm/src/lib/orm-methods/post-relationship/post-relationship.spec.ts index b97fbfc6..103a8615 100644 --- a/libs/json-api/json-api-nestjs-microorm/src/lib/orm-methods/post-relationship/post-relationship.spec.ts +++ b/libs/json-api/json-api-nestjs-microorm/src/lib/orm-methods/post-relationship/post-relationship.spec.ts @@ -77,8 +77,8 @@ describe('post-relationshipa', () => { }); afterEach(() => { - jest.clearAllMocks(); - jest.restoreAllMocks(); + vi.clearAllMocks(); + vi.restoreAllMocks(); }); afterAll(() => mikroORMUsers.close(true)); diff --git a/libs/json-api/json-api-nestjs-microorm/src/lib/service/micro-orm-util.service.spec.ts b/libs/json-api/json-api-nestjs-microorm/src/lib/service/micro-orm-util.service.spec.ts index 4c146c32..66e64903 100644 --- a/libs/json-api/json-api-nestjs-microorm/src/lib/service/micro-orm-util.service.spec.ts +++ b/libs/json-api/json-api-nestjs-microorm/src/lib/service/micro-orm-util.service.spec.ts @@ -47,8 +47,8 @@ describe('MicroOrmUtilService', () => { }); afterEach(() => { - jest.clearAllMocks(); - jest.restoreAllMocks(); + vi.clearAllMocks(); + vi.restoreAllMocks(); }); afterAll(async () => { diff --git a/libs/json-api/json-api-nestjs-microorm/tsconfig.json b/libs/json-api/json-api-nestjs-microorm/tsconfig.json index 86622aca..65cd89a0 100644 --- a/libs/json-api/json-api-nestjs-microorm/tsconfig.json +++ b/libs/json-api/json-api-nestjs-microorm/tsconfig.json @@ -8,7 +8,8 @@ "noImplicitOverride": true, "noImplicitReturns": true, "noFallthroughCasesInSwitch": true, - "noPropertyAccessFromIndexSignature": true + "noPropertyAccessFromIndexSignature": true, + "esModuleInterop": true }, "files": [], "include": [], diff --git a/libs/json-api/json-api-nestjs-microorm/tsconfig.lib.json b/libs/json-api/json-api-nestjs-microorm/tsconfig.lib.json index e78fe67e..1dcf41c2 100644 --- a/libs/json-api/json-api-nestjs-microorm/tsconfig.lib.json +++ b/libs/json-api/json-api-nestjs-microorm/tsconfig.lib.json @@ -4,7 +4,7 @@ "outDir": "../../../dist/out-tsc", "declaration": true, "types": ["node"], - "target": "es2021", + "target": "es2023", "strictNullChecks": true, "noImplicitAny": true, "strictBindCallApply": true, @@ -12,5 +12,10 @@ "noFallthroughCasesInSwitch": true }, "include": ["src/**/*.ts"], - "exclude": ["jest.config.ts", "src/**/*.spec.ts", "src/**/*.test.ts", "/src/lib/mock-utils/**/*"] + "exclude": ["src/**/*.spec.ts", "src/**/*.test.ts", "src/**/*.test-d.ts"], + "paths": { + "@klerick/json-api-nestjs-shared": [ + "dist/libs/json-api/json-api-nestjs-shared" + ] + } } diff --git a/libs/json-api/json-api-nestjs-microorm/tsconfig.spec.json b/libs/json-api/json-api-nestjs-microorm/tsconfig.spec.json index 0e95750a..d50edb42 100644 --- a/libs/json-api/json-api-nestjs-microorm/tsconfig.spec.json +++ b/libs/json-api/json-api-nestjs-microorm/tsconfig.spec.json @@ -2,24 +2,30 @@ "extends": "./tsconfig.json", "compilerOptions": { "outDir": "../../../dist/out-tsc", - "module": "commonjs", + "module": "ES2022", "moduleResolution": "node10", + "experimentalDecorators": true, + "emitDecoratorMetadata": true, + "strictNullChecks": true, + "noImplicitAny": true, + "strictBindCallApply": true, + "forceConsistentCasingInFileNames": true, + "noFallthroughCasesInSwitch": true, "types": [ - "jest", - "node" + "vitest/globals", + "vitest/importMeta", + "vite/client", + "node", + "vitest" ], - "paths": { - "@klerick/json-api-nestjs-shared": [ - "libs/json-api/json-api-nestjs-shared/src/index.ts" - ], - "@klerick/json-api-nestjs": [ - "libs/json-api/json-api-nestjs/src/index.ts" - ] - }, - "allowJs": true + "allowSyntheticDefaultImports": true, + "esModuleInterop": true }, "include": [ - "jest.config.ts", + "vite.config.ts", + "vite.config.mts", + "vitest.config.ts", + "vitest.config.mts", "src/**/*.test.ts", "src/**/*.spec.ts", "src/**/*.d.ts" diff --git a/libs/json-api/json-api-nestjs-microorm/vite.config.mts b/libs/json-api/json-api-nestjs-microorm/vite.config.mts new file mode 100644 index 00000000..0df9b006 --- /dev/null +++ b/libs/json-api/json-api-nestjs-microorm/vite.config.mts @@ -0,0 +1,54 @@ +/// +import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin'; + +import swc from 'unplugin-swc'; +import { defineConfig } from 'vite'; + +export default defineConfig(() => ({ + root: __dirname, + cacheDir: '../../../node_modules/.vite/libs/json-api-nestjs-microorm', + plugins: [ + nxViteTsPaths(), + swc.vite({ + module: { type: 'es6' }, + jsc: { + target: 'es2022', + parser: { + syntax: 'typescript', + decorators: true, + }, + transform: { + decoratorMetadata: true, + legacyDecorator: true, + }, + keepClassNames: true, + externalHelpers: true, + loose: true, + }, + }), + ], + test: { + fileParallelism: false, + pool: 'threads', + singleThread: true, + sequence: { + concurrent: false, + shuffle: false, + }, + maxWorkers: 1, + minWorkers: 1, + name: 'json-api-nestjs-microorm', + watch: false, + globals: true, + environment: 'node', + include: ['{src,tests}/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'], + setupFiles: [], + reporters: ['default'], + coverage: { + enabled: true, + reporter: ['json'], + reportsDirectory: '../../../coverage/json-api-nestjs-microorm', + provider: 'v8' as const, + }, + }, +})); diff --git a/libs/json-api/json-api-nestjs-sdk/jest.config.ts b/libs/json-api/json-api-nestjs-sdk/jest.config.ts deleted file mode 100644 index 167a2eaa..00000000 --- a/libs/json-api/json-api-nestjs-sdk/jest.config.ts +++ /dev/null @@ -1,10 +0,0 @@ -export default { - displayName: 'json-api-nestjs-sdk', - preset: '../../../jest.preset.js', - testEnvironment: 'node', - transform: { - '^.+\\.[tj]s$': ['ts-jest', { tsconfig: '/tsconfig.spec.json' }], - }, - moduleFileExtensions: ['ts', 'js', 'html'], - coverageDirectory: '../../../coverage/libs/json-api/json-api-nestjs-sdk', -}; diff --git a/libs/json-api/json-api-nestjs-sdk/project.json b/libs/json-api/json-api-nestjs-sdk/project.json index bbf3350d..7778bdb7 100644 --- a/libs/json-api/json-api-nestjs-sdk/project.json +++ b/libs/json-api/json-api-nestjs-sdk/project.json @@ -114,20 +114,6 @@ "parallel": false } }, - "test": { - "executor": "@nx/jest:jest", - "outputs": [ - "{workspaceRoot}/coverage/{projectRoot}" - ], - "options": { - "jestConfig": "{projectRoot}/jest.config.ts", - "codeCoverage": true, - "coverageReporters": [ - "json-summary" - ], - "tsConfig": "libs/json-api/json-api-nestjs-sdk/tsconfig.spec.json" - } - }, "upload-badge": { "executor": "nx:run-commands", "dependsOn": [ diff --git a/libs/json-api/json-api-nestjs-sdk/src/lib/service/atomic-operations.service.spec.ts b/libs/json-api/json-api-nestjs-sdk/src/lib/service/atomic-operations.service.spec.ts index bc995b71..3095a3e9 100644 --- a/libs/json-api/json-api-nestjs-sdk/src/lib/service/atomic-operations.service.spec.ts +++ b/libs/json-api/json-api-nestjs-sdk/src/lib/service/atomic-operations.service.spec.ts @@ -69,7 +69,7 @@ describe('atomicOperationService', () => { beforeEach(() => { httpInnerClient = { - post: jest.fn(), + post: vi.fn(), } as any; jsonApiUtilsService = new JsonApiUtilsService(jsonApiSdkConfig); @@ -81,7 +81,7 @@ describe('atomicOperationService', () => { }); afterEach(() => { - jest.clearAllMocks(); + vi.clearAllMocks(); }); describe('Check atomicFactory', () => { @@ -103,7 +103,7 @@ describe('atomicOperationService', () => { patchUser.addresses = postAddress; - const spyHttpInnerClient = jest + const spyHttpInnerClient = vi .spyOn(httpInnerClient, 'post') .mockImplementation(() => of({ @@ -184,7 +184,7 @@ describe('atomicOperationService', () => { patchUser.addresses = postAddress; - const spyHttpInnerClient = jest + const spyHttpInnerClient = vi .spyOn(httpInnerClient, 'post') .mockImplementation(() => of({ @@ -267,7 +267,7 @@ describe('atomicOperationService', () => { patchUser.addresses = postAddress; - const spyHttpInnerClient = jest + const spyHttpInnerClient = vi .spyOn(httpInnerClient, 'post') .mockImplementation(() => of({ diff --git a/libs/json-api/json-api-nestjs-sdk/src/lib/service/fetch-inner-client.spec.ts b/libs/json-api/json-api-nestjs-sdk/src/lib/service/fetch-inner-client.spec.ts index b1cb4757..4a89bc56 100644 --- a/libs/json-api/json-api-nestjs-sdk/src/lib/service/fetch-inner-client.spec.ts +++ b/libs/json-api/json-api-nestjs-sdk/src/lib/service/fetch-inner-client.spec.ts @@ -1,9 +1,10 @@ -import { of } from 'rxjs'; +import { lastValueFrom, of } from 'rxjs'; import { fromFetch } from 'rxjs/fetch'; import { FetchInnerClient } from './fetch-inner-client'; +import { Mock } from 'vitest'; -jest.mock('rxjs/fetch'); +vi.mock('rxjs/fetch'); describe('FetchInnerClient', () => { let fetchInnerClient: FetchInnerClient; @@ -13,7 +14,7 @@ describe('FetchInnerClient', () => { }); afterEach(() => { - jest.clearAllMocks(); + vi.clearAllMocks(); }); describe('delete', () => { @@ -22,7 +23,7 @@ describe('FetchInnerClient', () => { const expectedRequestInit: RequestInit = { method: 'delete', }; - const requestSpy = jest + const requestSpy = vi .spyOn(fetchInnerClient as any, 'request') .mockReturnValue(of(null)); @@ -39,7 +40,7 @@ describe('FetchInnerClient', () => { body: JSON.stringify(body), }; - const requestSpy = jest + const requestSpy = vi .spyOn(fetchInnerClient as any, 'request') .mockReturnValue(of(null)); // Mock request method return @@ -54,7 +55,7 @@ describe('FetchInnerClient', () => { const expectedParams = { params: { key: 'value' } }; // please update these params based on your test case const expectedResult = 'test'; // please update this based on your expect result - const requestSpy = jest + const requestSpy = vi .spyOn(fetchInnerClient as any, 'request') .mockReturnValue(of(expectedResult)); @@ -75,7 +76,7 @@ describe('FetchInnerClient', () => { const expectedBody = { key: 'value' } as any; // update this with your test body data const expectedResult = 'test'; // update this with your expected result - const requestSpy = jest + const requestSpy = vi .spyOn(fetchInnerClient as any, 'request') .mockReturnValue(of(expectedResult)); @@ -92,50 +93,42 @@ describe('FetchInnerClient', () => { }); }); - it('should call the request method with the correct URL, method and body when post is called', (done) => { + it('should call the request method with the correct URL, method and body when post is called', async () => { const expectedURL = 'https://yourtesturl.com/path'; // update this with your test URL const expectedBody = { key: 'value' } as any; // update this with your test body data const expectedResult = 'test'; // update this with your expected result - const requestSpy = jest + const requestSpy = vi .spyOn(fetchInnerClient as any, 'request') .mockReturnValue(of(expectedResult)); - fetchInnerClient.post(expectedURL, expectedBody).subscribe({ - next: (res) => { - expect(res).toBe(expectedResult); - }, - complete: () => { - expect(requestSpy).toBeCalledWith(expectedURL, { - method: 'post', - body: JSON.stringify(expectedBody), - }); - done(); - }, + const stream$ = fetchInnerClient.post(expectedURL, expectedBody); + const res = await lastValueFrom(stream$); + expect(res).toBe(expectedResult); + expect(requestSpy).toBeCalledWith(expectedURL, { + method: 'post', + body: JSON.stringify(expectedBody), }); }); - it('should correctly call fromFetch function with the provided url and request data when request is called', (done) => { + it('should correctly call fromFetch function with the provided url and request data when request is called', async () => { const expectedURL = 'https://yourtesturl.com/path'; // update with your test URL const expectedInitData: RequestInit = { method: 'get' }; // update with your test request data - const mockResponse = { json: jest.fn() }; // a mock response object, modify as needed. + const mockResponse = { json: vi.fn() }; // a mock response object, modify as needed. - (fromFetch as jest.Mock).mockReturnValue(of(mockResponse)); + (fromFetch as Mock).mockReturnValue(of(mockResponse)); const observable = (fetchInnerClient as any).request( expectedURL, expectedInitData ); - observable.subscribe({ - complete: () => { - expect(fromFetch).toHaveBeenCalledWith(expectedURL, { - ...expectedInitData, - selector: expect.any(Function), - }); - done(); - }, + + await lastValueFrom(observable); + expect(fromFetch).toHaveBeenCalledWith(expectedURL, { + ...expectedInitData, + selector: expect.any(Function), }); }); diff --git a/libs/json-api/json-api-nestjs-sdk/src/lib/service/json-api-sdk.service.spec.ts b/libs/json-api/json-api-nestjs-sdk/src/lib/service/json-api-sdk.service.spec.ts index 23644f33..ee3ef856 100644 --- a/libs/json-api/json-api-nestjs-sdk/src/lib/service/json-api-sdk.service.spec.ts +++ b/libs/json-api/json-api-nestjs-sdk/src/lib/service/json-api-sdk.service.spec.ts @@ -1,4 +1,4 @@ -import { BehaviorSubject, of, take } from 'rxjs'; +import { BehaviorSubject, lastValueFrom, of, take } from 'rxjs'; import { JsonApiSdkService } from './json-api-sdk.service'; import { HttpInnerClient, JsonApiSdkConfig } from '../types'; import { JsonApiUtilsService } from './index'; @@ -36,10 +36,10 @@ describe('JsonApiSdkService', () => { }); afterEach(() => { - jest.clearAllMocks(); + vi.clearAllMocks(); }); - it('should call getList and return result', (done) => { + it('should call getList and return result', async () => { const mockResult = { data: [ { @@ -55,39 +55,32 @@ describe('JsonApiSdkService', () => { ], meta: { totalItems: 2, pageSize: 1, pageNumber: 1 }, }; - const spyHttpGet = jest.spyOn(http, 'get').mockImplementation(() => { + const spyHttpGet = vi.spyOn(http, 'get').mockImplementation(() => { return new BehaviorSubject(mockResult).pipe(take(1)); }); - const spyConvertResponseData = jest + const spyConvertResponseData = vi .spyOn(jsonApiUtilsService, 'convertResponseData') .mockReturnValue(mockResult.data); - const spyGetQueryStringParams = jest.spyOn( + const spyGetQueryStringParams = vi.spyOn( jsonApiUtilsService, 'getQueryStringParams' ); - const spyGetUrlForResource = jest.spyOn( + const spyGetUrlForResource = vi.spyOn( jsonApiUtilsService, 'getUrlForResource' ); class TestKlass {} - service.getList(TestKlass).subscribe({ - next: (result) => { - expect(result).toEqual( - new EntityArray(mockResult.data, mockResult.meta) - ); - }, - complete: () => { - expect(spyGetQueryStringParams).toHaveBeenCalled(); - expect(spyGetUrlForResource).toHaveBeenCalledWith(TestKlass.name); - expect(spyHttpGet).toHaveBeenCalled(); - expect(spyConvertResponseData).toHaveBeenCalledWith(mockResult); - done(); - }, - }); + const stream$ = service.getList(TestKlass); + const result = await lastValueFrom(stream$); + expect(result).toEqual(new EntityArray(mockResult.data, mockResult.meta)); + expect(spyGetQueryStringParams).toHaveBeenCalled(); + expect(spyGetUrlForResource).toHaveBeenCalledWith(TestKlass.name); + expect(spyHttpGet).toHaveBeenCalled(); + expect(spyConvertResponseData).toHaveBeenCalledWith(mockResult); }); - it('should call getAll and return result', (done) => { + it('should call getAll and return result', async () => { class TestKlass {} const mock1 = { id: 1, @@ -102,7 +95,7 @@ describe('JsonApiSdkService', () => { let callCount = 0; - const spyHttpGet = jest.spyOn(http, 'get').mockImplementation(() => { + const spyHttpGet = vi.spyOn(http, 'get').mockImplementation(() => { const result = mockResults( callCount === 0 ? mock1 : mock2, callCount + 1 @@ -111,36 +104,38 @@ describe('JsonApiSdkService', () => { return new BehaviorSubject(result).pipe(take(1)); }); - const spyGetList = jest.spyOn(service, 'getList'); + const spyGetList = vi.spyOn(service, 'getList'); let callCountResult = 0; - service.getAll(TestKlass).subscribe({ - next: (result) => { - const resultMock = mockResults( - callCountResult === 0 ? mock1 : mock2, - callCountResult + 1 - ); - callCountResult++; - expect(result).toEqual( - new EntityArray( - [ - { - id: resultMock.data[0].id, - ...resultMock.data[0].attributes, - }, - ], - resultMock.meta - ) - ); - }, - complete: () => { - expect(spyGetList).toHaveBeenCalledTimes(2); - expect(spyHttpGet).toHaveBeenCalledTimes(2); - done(); - }, + await new Promise((resolve) => { + service.getAll(TestKlass).subscribe({ + next: (result) => { + const resultMock = mockResults( + callCountResult === 0 ? mock1 : mock2, + callCountResult + 1 + ); + callCountResult++; + expect(result).toEqual( + new EntityArray( + [ + { + id: resultMock.data[0].id, + ...resultMock.data[0].attributes, + }, + ], + resultMock.meta + ) + ); + }, + complete: () => { + resolve(void 0); + }, + }); }); + expect(spyGetList).toHaveBeenCalledTimes(2); + expect(spyHttpGet).toHaveBeenCalledTimes(2); }); - it('should call getAll with push=false and return result', (done) => { + it('should call getAll with push=false and return result', async () => { class TestKlass {} const mockResults = [ { @@ -153,31 +148,30 @@ describe('JsonApiSdkService', () => { }, ]; let callCount = 0; - jest - .spyOn(service, 'getList') - .mockImplementation(() => - of( - new EntityArray( - mockResults[callCount].data, - mockResults[callCount++].meta - ) + vi.spyOn(service, 'getList').mockImplementation(() => + of( + new EntityArray( + mockResults[callCount].data, + mockResults[callCount++].meta ) - ); - - service.getAll(TestKlass, undefined, false).subscribe({ - next: (result) => { - expect(result).toEqual( - new EntityArray([...mockResults[0].data, ...mockResults[1].data], { - totalItems: 2, - pageSize: 2, - pageNumber: 1, - }) - ); - }, - complete: () => { - expect(service.getList).toHaveBeenCalledTimes(2); - done(); - }, + ) + ); + await new Promise((resolve) => { + service.getAll(TestKlass, undefined, false).subscribe({ + next: (result) => { + expect(result).toEqual( + new EntityArray([...mockResults[0].data, ...mockResults[1].data], { + totalItems: 2, + pageSize: 2, + pageNumber: 1, + }) + ); + }, + complete: () => { + resolve(void 0); + }, + }); }); + expect(service.getList).toHaveBeenCalledTimes(2); }); }); diff --git a/libs/json-api/json-api-nestjs-sdk/src/lib/service/json-api-utils.service.spec.ts b/libs/json-api/json-api-nestjs-sdk/src/lib/service/json-api-utils.service.spec.ts index b9d588f1..bcc95fad 100644 --- a/libs/json-api/json-api-nestjs-sdk/src/lib/service/json-api-utils.service.spec.ts +++ b/libs/json-api/json-api-nestjs-sdk/src/lib/service/json-api-utils.service.spec.ts @@ -25,31 +25,31 @@ describe('JsonApiUtilsService', () => { it('should call all helper functions with correct parameters', () => { // Mock the helper functions - const includeSpy = jest + const includeSpy = vi // @ts-ignore .spyOn(service, 'getIncludeParam') // @ts-ignore .mockReturnValue(new HttpParams()); - const sortSpy = jest + const sortSpy = vi // @ts-ignore .spyOn(service, 'getSortParam') // @ts-ignore .mockReturnValue(new HttpParams()); - const pageSpy = jest + const pageSpy = vi // @ts-ignore .spyOn(service, 'getPageParam') // @ts-ignore .mockReturnValue(new HttpParams()); - const fieldSpy = jest + const fieldSpy = vi // @ts-ignore .spyOn(service, 'getFieldParam') // @ts-ignore .mockReturnValue(new HttpParams()); - const filterSpy = jest + const filterSpy = vi // @ts-ignore .spyOn(service, 'getFilterParam') // @ts-ignore diff --git a/libs/json-api/json-api-nestjs-sdk/tsconfig-mjs.lib.json b/libs/json-api/json-api-nestjs-sdk/tsconfig-mjs.lib.json index 4d5f66e7..e99bfa51 100644 --- a/libs/json-api/json-api-nestjs-sdk/tsconfig-mjs.lib.json +++ b/libs/json-api/json-api-nestjs-sdk/tsconfig-mjs.lib.json @@ -9,10 +9,5 @@ "moduleResolution": "bundler" }, "include": ["src/**/*.ts"], - "exclude": [ - "jest.config.ts", - "src/**/*.spec.ts", - "src/**/*.test-d.ts", - "src/**/___test___/**/*.ts" - ] + "exclude": ["src/**/*.spec.ts", "src/**/*.test.ts"] } diff --git a/libs/json-api/json-api-nestjs-sdk/tsconfig.lib.json b/libs/json-api/json-api-nestjs-sdk/tsconfig.lib.json index 1a4d1a2b..62cf5c74 100644 --- a/libs/json-api/json-api-nestjs-sdk/tsconfig.lib.json +++ b/libs/json-api/json-api-nestjs-sdk/tsconfig.lib.json @@ -7,5 +7,5 @@ "target": "es2021" }, "include": ["src/**/*.ts"], - "exclude": ["jest.config.ts", "src/**/*.spec.ts", "src/**/*.test.ts"] + "exclude": ["src/**/*.spec.ts", "src/**/*.test.ts"] } diff --git a/libs/json-api/json-api-nestjs-sdk/tsconfig.spec.json b/libs/json-api/json-api-nestjs-sdk/tsconfig.spec.json index e4d0aea6..169abbcd 100644 --- a/libs/json-api/json-api-nestjs-sdk/tsconfig.spec.json +++ b/libs/json-api/json-api-nestjs-sdk/tsconfig.spec.json @@ -2,18 +2,30 @@ "extends": "./tsconfig.json", "compilerOptions": { "outDir": "../../../dist/out-tsc", - "module": "commonjs", - "moduleResolution": "bundler", - "types": ["jest", "node"], - "paths": { - "@klerick/json-api-nestjs-shared": [ - "libs/json-api/json-api-nestjs-shared/src/index.ts" - ] - }, - "allowJs": true + "module": "ES2022", + "moduleResolution": "node10", + "experimentalDecorators": true, + "emitDecoratorMetadata": true, + "strictNullChecks": true, + "noImplicitAny": true, + "strictBindCallApply": true, + "forceConsistentCasingInFileNames": true, + "noFallthroughCasesInSwitch": true, + "types": [ + "vitest/globals", + "vitest/importMeta", + "vite/client", + "node", + "vitest" + ], + "allowSyntheticDefaultImports": true, + "esModuleInterop": true, }, "include": [ - "jest.config.ts", + "vite.config.ts", + "vite.config.mts", + "vitest.config.ts", + "vitest.config.mts", "src/**/*.test.ts", "src/**/*.spec.ts", "src/**/*.d.ts" diff --git a/libs/json-api/json-api-nestjs-sdk/vite.config.mts b/libs/json-api/json-api-nestjs-sdk/vite.config.mts new file mode 100644 index 00000000..8eef6bc8 --- /dev/null +++ b/libs/json-api/json-api-nestjs-sdk/vite.config.mts @@ -0,0 +1,45 @@ +/// +import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin'; + +import swc from 'unplugin-swc'; +import { defineConfig } from 'vite'; + +export default defineConfig(() => ({ + root: __dirname, + cacheDir: '../../../node_modules/.vite/libs/json-api-nestjs-sdk', + plugins: [ + nxViteTsPaths(), + swc.vite({ + module: { type: 'es6' }, + jsc: { + target: 'es2022', + parser: { + syntax: 'typescript', + decorators: true, + }, + transform: { + decoratorMetadata: true, + legacyDecorator: true, + }, + keepClassNames: true, + externalHelpers: true, + loose: true, + }, + }), + ], + test: { + name: 'json-api-nestjs-sdk', + watch: false, + globals: true, + environment: 'node', + include: ['{src,tests}/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'], + setupFiles: [], + reporters: ['default'], + coverage: { + enabled: true, + reporter: ['json'], + reportsDirectory: '../../../coverage/json-api-nestjs-sdk', + provider: 'v8' as const, + }, + }, +})); diff --git a/libs/json-api/json-api-nestjs-shared/jest.config.ts b/libs/json-api/json-api-nestjs-shared/jest.config.ts deleted file mode 100644 index 67ade3e9..00000000 --- a/libs/json-api/json-api-nestjs-shared/jest.config.ts +++ /dev/null @@ -1,10 +0,0 @@ -export default { - displayName: 'json-api-nestjs-shared', - preset: '../../../jest.preset.js', - testEnvironment: 'node', - transform: { - '^.+\\.[tj]s$': ['ts-jest', { tsconfig: '/tsconfig.spec.json' }], - }, - moduleFileExtensions: ['ts', 'js', 'html'], - coverageDirectory: '../../../coverage/libs/json-api/json-api-nestjs-shared', -}; diff --git a/libs/json-api/json-api-nestjs-shared/package.json b/libs/json-api/json-api-nestjs-shared/package.json index df31936e..88f1f3c4 100644 --- a/libs/json-api/json-api-nestjs-shared/package.json +++ b/libs/json-api/json-api-nestjs-shared/package.json @@ -12,6 +12,7 @@ "CRUD" ], "dependencies": {}, + "peerDependencies": {}, "type": "commonjs", "main": "./cjs/src/index.js", "types": "./cjs/src/index.d.ts", diff --git a/libs/json-api/json-api-nestjs-shared/project.json b/libs/json-api/json-api-nestjs-shared/project.json index 4c54fd2b..419fa97e 100644 --- a/libs/json-api/json-api-nestjs-shared/project.json +++ b/libs/json-api/json-api-nestjs-shared/project.json @@ -80,23 +80,48 @@ "parallel": false } }, - "ts-test": { + "build-common": { "executor": "nx:run-commands", + "dependsOn": ["build-cjs", "build-mjs"], "options": { + "outputPath": "dist/{projectRoot}", "commands": [ - "tsd --files \"src/**/*.test-d.ts\" -t src/lib/types/index.ts" + { + "command": "[ ! -f dist/{projectRoot}/cjs/package.json ] || cp dist/{projectRoot}/cjs/package.json dist/{projectRoot}/package.json", + "forwardAllArgs": false + }, + { + "command": "rm -f dist/{projectRoot}/mjs/package.json", + "forwardAllArgs": false + }, + { + "command": "rm -f dist/{projectRoot}/cjs/package.json", + "forwardAllArgs": false + }, + { + "command": "node tools/scripts/prepare-package-json.mjs json-api-nestjs-shared" + }, + { + "command": "mkdir -p node_modules/@klerick && rm -rf node_modules/@klerick/json-api-nestjs-shared", + "forwardAllArgs": false + }, + { + "command": "ln -s $(pwd)/dist/{projectRoot} node_modules/@klerick/json-api-nestjs-shared", + "forwardAllArgs": false + } ], - "cwd": "{workspaceRoot}/{projectRoot}", + "cwd": "./", "parallel": false } }, - "test": { - "executor": "@nx/jest:jest", - "outputs": ["{workspaceRoot}/coverage/{projectRoot}"], + "ts-test": { + "executor": "nx:run-commands", "options": { - "jestConfig": "{projectRoot}/jest.config.ts", - "codeCoverage": true, - "coverageReporters": ["json-summary"] + "commands": [ + "tsd --files \"src/**/*.test-d.ts\" -t src/lib/types/index.ts" + ], + "cwd": "{workspaceRoot}/{projectRoot}", + "parallel": false } }, "upload-badge": { diff --git a/libs/json-api/json-api-nestjs-shared/src/index.d.ts b/libs/json-api/json-api-nestjs-shared/src/index.d.ts new file mode 100644 index 00000000..e54953b8 --- /dev/null +++ b/libs/json-api/json-api-nestjs-shared/src/index.d.ts @@ -0,0 +1,3 @@ +export * from './lib/utils'; +export * from './lib/types'; +export * from './lib/constants'; diff --git a/libs/json-api/json-api-nestjs-shared/src/index.js b/libs/json-api/json-api-nestjs-shared/src/index.js new file mode 100644 index 00000000..a93f08cd --- /dev/null +++ b/libs/json-api/json-api-nestjs-shared/src/index.js @@ -0,0 +1,7 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./lib/utils"), exports); +tslib_1.__exportStar(require("./lib/types"), exports); +tslib_1.__exportStar(require("./lib/constants"), exports); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/libs/json-api/json-api-nestjs-shared/src/index.js.map b/libs/json-api/json-api-nestjs-shared/src/index.js.map new file mode 100644 index 00000000..cd73a18f --- /dev/null +++ b/libs/json-api/json-api-nestjs-shared/src/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;AAAA,sDAA4B;AAC5B,sDAA4B;AAC5B,0DAAgC"} \ No newline at end of file diff --git a/libs/json-api/json-api-nestjs-shared/src/lib/constants/index.d.ts b/libs/json-api/json-api-nestjs-shared/src/lib/constants/index.d.ts new file mode 100644 index 00000000..8d168210 --- /dev/null +++ b/libs/json-api/json-api-nestjs-shared/src/lib/constants/index.d.ts @@ -0,0 +1,2 @@ +export declare const KEY_MAIN_INPUT_SCHEMA = "atomic:operations"; +export declare const KEY_MAIN_OUTPUT_SCHEMA = "atomic:results"; diff --git a/libs/json-api/json-api-nestjs-shared/src/lib/constants/index.js b/libs/json-api/json-api-nestjs-shared/src/lib/constants/index.js new file mode 100644 index 00000000..e83fc1cb --- /dev/null +++ b/libs/json-api/json-api-nestjs-shared/src/lib/constants/index.js @@ -0,0 +1,6 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.KEY_MAIN_OUTPUT_SCHEMA = exports.KEY_MAIN_INPUT_SCHEMA = void 0; +exports.KEY_MAIN_INPUT_SCHEMA = 'atomic:operations'; +exports.KEY_MAIN_OUTPUT_SCHEMA = 'atomic:results'; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/libs/json-api/json-api-nestjs-shared/src/lib/constants/index.js.map b/libs/json-api/json-api-nestjs-shared/src/lib/constants/index.js.map new file mode 100644 index 00000000..678787ba --- /dev/null +++ b/libs/json-api/json-api-nestjs-shared/src/lib/constants/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;AAAa,QAAA,qBAAqB,GAAG,mBAAmB,CAAC;AAC5C,QAAA,sBAAsB,GAAG,gBAAgB,CAAC"} \ No newline at end of file diff --git a/libs/json-api/json-api-nestjs-shared/src/lib/types/entity-type.d.ts b/libs/json-api/json-api-nestjs-shared/src/lib/types/entity-type.d.ts new file mode 100644 index 00000000..8b7a3526 --- /dev/null +++ b/libs/json-api/json-api-nestjs-shared/src/lib/types/entity-type.d.ts @@ -0,0 +1,19 @@ +import { Any } from 'ts-toolbelt'; +export type HasId = Any.At extends undefined ? 0 : 1; +export type CastIteratorType = T extends { + [Symbol.iterator](): Iterator; +} ? U : T; +type RelationCheck = T extends never ? 0 : T extends Promise ? HasId : HasId, IdKey>; +export type RelationKeys = { + [K in keyof E]: Exclude extends never ? never : RelationCheck, IdKey> extends 1 ? K : never; +}[keyof E]; +export type PropertyKeys = keyof Omit>; +export type IsIterator = T extends { + [Symbol.iterator](): Iterator; +} ? 1 : 0; +export type TypeOfArray = T extends (infer U)[] ? U : T; +export type ValueOf = T[keyof T]; +export type Constructor = new (...args: any[]) => T; +export type AnyEntity = T; +export type EntityClass = Constructor; +export {}; diff --git a/libs/json-api/json-api-nestjs-shared/src/lib/types/entity-type.js b/libs/json-api/json-api-nestjs-shared/src/lib/types/entity-type.js new file mode 100644 index 00000000..2763b80d --- /dev/null +++ b/libs/json-api/json-api-nestjs-shared/src/lib/types/entity-type.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=entity-type.js.map \ No newline at end of file diff --git a/libs/json-api/json-api-nestjs-shared/src/lib/types/entity-type.js.map b/libs/json-api/json-api-nestjs-shared/src/lib/types/entity-type.js.map new file mode 100644 index 00000000..5a42aaf1 --- /dev/null +++ b/libs/json-api/json-api-nestjs-shared/src/lib/types/entity-type.js.map @@ -0,0 +1 @@ +{"version":3,"file":"entity-type.js","sourceRoot":"","sources":["entity-type.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/libs/json-api/json-api-nestjs-shared/src/lib/types/index.d.ts b/libs/json-api/json-api-nestjs-shared/src/lib/types/index.d.ts new file mode 100644 index 00000000..e092f90f --- /dev/null +++ b/libs/json-api/json-api-nestjs-shared/src/lib/types/index.d.ts @@ -0,0 +1,3 @@ +export * from './query-type'; +export * from './entity-type'; +export * from './response-body'; diff --git a/libs/json-api/json-api-nestjs-shared/src/lib/types/index.js b/libs/json-api/json-api-nestjs-shared/src/lib/types/index.js new file mode 100644 index 00000000..f456fa6d --- /dev/null +++ b/libs/json-api/json-api-nestjs-shared/src/lib/types/index.js @@ -0,0 +1,7 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./query-type"), exports); +tslib_1.__exportStar(require("./entity-type"), exports); +tslib_1.__exportStar(require("./response-body"), exports); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/libs/json-api/json-api-nestjs-shared/src/lib/types/index.js.map b/libs/json-api/json-api-nestjs-shared/src/lib/types/index.js.map new file mode 100644 index 00000000..42a3ee24 --- /dev/null +++ b/libs/json-api/json-api-nestjs-shared/src/lib/types/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;AAAA,uDAA6B;AAC7B,wDAA8B;AAC9B,0DAAgC"} \ No newline at end of file diff --git a/libs/json-api/json-api-nestjs-shared/src/lib/types/query-type.d.ts b/libs/json-api/json-api-nestjs-shared/src/lib/types/query-type.d.ts new file mode 100644 index 00000000..d615ce22 --- /dev/null +++ b/libs/json-api/json-api-nestjs-shared/src/lib/types/query-type.d.ts @@ -0,0 +1,39 @@ +export declare enum QueryField { + filter = "filter", + sort = "sort", + include = "include", + page = "page", + fields = "fields" +} +export declare enum FilterOperand { + eq = "eq", + gt = "gt", + gte = "gte", + like = "like", + lt = "lt", + lte = "lte", + ne = "ne", + regexp = "regexp", + in = "in", + nin = "nin", + some = "some" +} +export declare enum FilterOperandOnlyInNin { + in = "in", + nin = "nin" +} +export declare enum FilterOperandOnlySimple { + eq = "eq", + gt = "gt", + gte = "gte", + like = "like", + lt = "lt", + lte = "lte", + ne = "ne", + regexp = "regexp" +} +export declare enum Operation { + add = "add", + update = "update", + remove = "remove" +} diff --git a/libs/json-api/json-api-nestjs-shared/src/lib/types/query-type.js b/libs/json-api/json-api-nestjs-shared/src/lib/types/query-type.js new file mode 100644 index 00000000..6c0ac2d4 --- /dev/null +++ b/libs/json-api/json-api-nestjs-shared/src/lib/types/query-type.js @@ -0,0 +1,48 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Operation = exports.FilterOperandOnlySimple = exports.FilterOperandOnlyInNin = exports.FilterOperand = exports.QueryField = void 0; +var QueryField; +(function (QueryField) { + QueryField["filter"] = "filter"; + QueryField["sort"] = "sort"; + QueryField["include"] = "include"; + QueryField["page"] = "page"; + QueryField["fields"] = "fields"; +})(QueryField || (exports.QueryField = QueryField = {})); +var FilterOperand; +(function (FilterOperand) { + FilterOperand["eq"] = "eq"; + FilterOperand["gt"] = "gt"; + FilterOperand["gte"] = "gte"; + FilterOperand["like"] = "like"; + FilterOperand["lt"] = "lt"; + FilterOperand["lte"] = "lte"; + FilterOperand["ne"] = "ne"; + FilterOperand["regexp"] = "regexp"; + FilterOperand["in"] = "in"; + FilterOperand["nin"] = "nin"; + FilterOperand["some"] = "some"; +})(FilterOperand || (exports.FilterOperand = FilterOperand = {})); +var FilterOperandOnlyInNin; +(function (FilterOperandOnlyInNin) { + FilterOperandOnlyInNin["in"] = "in"; + FilterOperandOnlyInNin["nin"] = "nin"; +})(FilterOperandOnlyInNin || (exports.FilterOperandOnlyInNin = FilterOperandOnlyInNin = {})); +var FilterOperandOnlySimple; +(function (FilterOperandOnlySimple) { + FilterOperandOnlySimple["eq"] = "eq"; + FilterOperandOnlySimple["gt"] = "gt"; + FilterOperandOnlySimple["gte"] = "gte"; + FilterOperandOnlySimple["like"] = "like"; + FilterOperandOnlySimple["lt"] = "lt"; + FilterOperandOnlySimple["lte"] = "lte"; + FilterOperandOnlySimple["ne"] = "ne"; + FilterOperandOnlySimple["regexp"] = "regexp"; +})(FilterOperandOnlySimple || (exports.FilterOperandOnlySimple = FilterOperandOnlySimple = {})); +var Operation; +(function (Operation) { + Operation["add"] = "add"; + Operation["update"] = "update"; + Operation["remove"] = "remove"; +})(Operation || (exports.Operation = Operation = {})); +//# sourceMappingURL=query-type.js.map \ No newline at end of file diff --git a/libs/json-api/json-api-nestjs-shared/src/lib/types/query-type.js.map b/libs/json-api/json-api-nestjs-shared/src/lib/types/query-type.js.map new file mode 100644 index 00000000..bd735bd2 --- /dev/null +++ b/libs/json-api/json-api-nestjs-shared/src/lib/types/query-type.js.map @@ -0,0 +1 @@ +{"version":3,"file":"query-type.js","sourceRoot":"","sources":["query-type.ts"],"names":[],"mappings":";;;AAAA,IAAY,UAMX;AAND,WAAY,UAAU;IACpB,+BAAiB,CAAA;IACjB,2BAAa,CAAA;IACb,iCAAmB,CAAA;IACnB,2BAAa,CAAA;IACb,+BAAiB,CAAA;AACnB,CAAC,EANW,UAAU,0BAAV,UAAU,QAMrB;AAED,IAAY,aAYX;AAZD,WAAY,aAAa;IACvB,0BAAS,CAAA;IACT,0BAAS,CAAA;IACT,4BAAW,CAAA;IACX,8BAAa,CAAA;IACb,0BAAS,CAAA;IACT,4BAAW,CAAA;IACX,0BAAS,CAAA;IACT,kCAAiB,CAAA;IACjB,0BAAS,CAAA;IACT,4BAAW,CAAA;IACX,8BAAa,CAAA;AACf,CAAC,EAZW,aAAa,6BAAb,aAAa,QAYxB;AAED,IAAY,sBAGX;AAHD,WAAY,sBAAsB;IAChC,mCAAS,CAAA;IACT,qCAAW,CAAA;AACb,CAAC,EAHW,sBAAsB,sCAAtB,sBAAsB,QAGjC;AACD,IAAY,uBASX;AATD,WAAY,uBAAuB;IACjC,oCAAS,CAAA;IACT,oCAAS,CAAA;IACT,sCAAW,CAAA;IACX,wCAAa,CAAA;IACb,oCAAS,CAAA;IACT,sCAAW,CAAA;IACX,oCAAS,CAAA;IACT,4CAAiB,CAAA;AACnB,CAAC,EATW,uBAAuB,uCAAvB,uBAAuB,QASlC;AAED,IAAY,SAIX;AAJD,WAAY,SAAS;IACnB,wBAAW,CAAA;IACX,8BAAiB,CAAA;IACjB,8BAAiB,CAAA;AACnB,CAAC,EAJW,SAAS,yBAAT,SAAS,QAIpB"} \ No newline at end of file diff --git a/libs/json-api/json-api-nestjs-shared/src/lib/types/response-body.d.ts b/libs/json-api/json-api-nestjs-shared/src/lib/types/response-body.d.ts new file mode 100644 index 00000000..7243f613 --- /dev/null +++ b/libs/json-api/json-api-nestjs-shared/src/lib/types/response-body.d.ts @@ -0,0 +1,53 @@ +import { PropertyKeys, RelationKeys, IsIterator, CastIteratorType } from './entity-type'; +import { ValueOf } from './entity-type'; +export type DebugMetaProps = Partial<{ + time: number; +}>; +export type PageProps = { + totalItems: number; + pageNumber: number; + pageSize: number; +}; +export type MainData = { + type: T; + id: string; +}; +export type BaseMainData> = { + data: IsIterator extends 1 ? MainData[] : [Extract] extends [never] ? MainData : MainData | null; +}; +export type MetaProps = R extends null ? T : T & R; +export type MetaPropsForArrayResourceObject = MetaProps; +export type Links = { + self: string; +}; +export type BaseLinks = { + links: Links; +}; +export type Attributes = { + [P in Exclude, IdKey>]?: Entity[P]; +}; +export type BaseAttribute = { + attributes?: Attributes; +}; +export type Relationships = { + [P in RelationKeys]?: BaseLinks | (BaseLinks & BaseMainData); +}; +export type BaseRelationships = { + relationships?: Relationships; +}; +export type Meta = Type extends 'array' ? MetaProps : MetaProps; +export type BaseMeta = { + meta: Meta; +}; +export type BaseResourceData = { + data: Type extends 'array' ? ResourceData[] : ResourceData; +}; +export type Include = ValueOf<{ + [Rel in RelationKeys]: CastIteratorType extends object ? ResourceData> : never; +}>; +export type BaseIncluded = { + included?: Include[]; +}; +export type ResourceData = MainData & BaseAttribute & BaseRelationships & BaseLinks; +export type ResourceObject = BaseMeta & BaseResourceData & BaseIncluded; +export type ResourceObjectRelationships> = BaseMeta & BaseMainData; diff --git a/libs/json-api/json-api-nestjs-shared/src/lib/types/response-body.js b/libs/json-api/json-api-nestjs-shared/src/lib/types/response-body.js new file mode 100644 index 00000000..8c538e64 --- /dev/null +++ b/libs/json-api/json-api-nestjs-shared/src/lib/types/response-body.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=response-body.js.map \ No newline at end of file diff --git a/libs/json-api/json-api-nestjs-shared/src/lib/types/response-body.js.map b/libs/json-api/json-api-nestjs-shared/src/lib/types/response-body.js.map new file mode 100644 index 00000000..6887a347 --- /dev/null +++ b/libs/json-api/json-api-nestjs-shared/src/lib/types/response-body.js.map @@ -0,0 +1 @@ +{"version":3,"file":"response-body.js","sourceRoot":"","sources":["response-body.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/libs/json-api/json-api-nestjs-shared/src/lib/utils/index.d.ts b/libs/json-api/json-api-nestjs-shared/src/lib/utils/index.d.ts new file mode 100644 index 00000000..53a4561e --- /dev/null +++ b/libs/json-api/json-api-nestjs-shared/src/lib/utils/index.d.ts @@ -0,0 +1 @@ +export * from './object-utils'; diff --git a/libs/json-api/json-api-nestjs-shared/src/lib/utils/index.js b/libs/json-api/json-api-nestjs-shared/src/lib/utils/index.js new file mode 100644 index 00000000..15edc53f --- /dev/null +++ b/libs/json-api/json-api-nestjs-shared/src/lib/utils/index.js @@ -0,0 +1,5 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./object-utils"), exports); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/libs/json-api/json-api-nestjs-shared/src/lib/utils/index.js.map b/libs/json-api/json-api-nestjs-shared/src/lib/utils/index.js.map new file mode 100644 index 00000000..ca17f033 --- /dev/null +++ b/libs/json-api/json-api-nestjs-shared/src/lib/utils/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;AAAA,yDAA+B"} \ No newline at end of file diff --git a/libs/json-api/json-api-nestjs-shared/src/lib/utils/object-utils.d.ts b/libs/json-api/json-api-nestjs-shared/src/lib/utils/object-utils.d.ts new file mode 100644 index 00000000..af3380f7 --- /dev/null +++ b/libs/json-api/json-api-nestjs-shared/src/lib/utils/object-utils.d.ts @@ -0,0 +1,10 @@ +export declare const ObjectTyped: { + keys: (yourObject: T) => Array; + values: (yourObject: U) => Array; + entries: (yourObject: O) => Array<[keyof O, O[keyof O]]>; + fromEntries: (yourObjectEntries: [K, V][]) => Record; +}; +export declare function isObject(item: unknown): item is object; +export declare function isString(value: T): value is P; +export declare function createEntityInstance(name: string): E; +export declare const getEntityName: (entity: unknown) => string; diff --git a/libs/json-api/json-api-nestjs-shared/src/lib/utils/object-utils.js b/libs/json-api/json-api-nestjs-shared/src/lib/utils/object-utils.js new file mode 100644 index 00000000..af450ff2 --- /dev/null +++ b/libs/json-api/json-api-nestjs-shared/src/lib/utils/object-utils.js @@ -0,0 +1,46 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getEntityName = exports.ObjectTyped = void 0; +exports.isObject = isObject; +exports.isString = isString; +exports.createEntityInstance = createEntityInstance; +const change_case_commonjs_1 = require("change-case-commonjs"); +exports.ObjectTyped = { + keys: Object.keys, + values: Object.values, + entries: Object.entries, + fromEntries: Object.fromEntries, +}; +function isObject(item) { + return typeof item === 'object' && !Array.isArray(item) && item !== null; +} +function isString(value) { + return typeof value === 'string' || value instanceof String; +} +function createEntityInstance(name) { + const entityName = (0, change_case_commonjs_1.pascalCase)(name); + return Function('return new class ' + entityName + '{}')(); +} +const getEntityName = (entity) => { + if (entity === null) + throw new Error('Entity is null'); + if (typeof entity === 'string') { + return entity; + } + if (typeof entity === 'object' && 'name' in entity) { + return `${entity['name']}`; + } + if (typeof entity === 'object' && + 'constructor' in entity && + 'name' in entity.constructor) { + return entity['constructor']['name']; + } + if (typeof entity === 'function' && + 'constructor' in entity.prototype && + 'name' in entity.prototype.constructor) { + return entity.prototype.constructor.name; + } + throw new Error('Entity is not object'); +}; +exports.getEntityName = getEntityName; +//# sourceMappingURL=object-utils.js.map \ No newline at end of file diff --git a/libs/json-api/json-api-nestjs-shared/src/lib/utils/object-utils.js.map b/libs/json-api/json-api-nestjs-shared/src/lib/utils/object-utils.js.map new file mode 100644 index 00000000..bcbe195a --- /dev/null +++ b/libs/json-api/json-api-nestjs-shared/src/lib/utils/object-utils.js.map @@ -0,0 +1 @@ +{"version":3,"file":"object-utils.js","sourceRoot":"","sources":["object-utils.ts"],"names":[],"mappings":";;;AAaA,4BAEC;AAED,4BAEC;AAED,oDAGC;AAxBD,+DAAkD;AAErC,QAAA,WAAW,GAAG;IACzB,IAAI,EAAE,MAAM,CAAC,IAAuD;IACpE,MAAM,EAAE,MAAM,CAAC,MAA4D;IAC3E,OAAO,EAAE,MAAM,CAAC,OAEiB;IACjC,WAAW,EAAE,MAAM,CAAC,WAEH;CAClB,CAAC;AAEF,SAAgB,QAAQ,CAAC,IAAa;IACpC,OAAO,OAAO,IAAI,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,IAAI,KAAK,IAAI,CAAC;AAC3E,CAAC;AAED,SAAgB,QAAQ,CAAiB,KAAQ;IAC/C,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,YAAY,MAAM,CAAC;AAC9D,CAAC;AAED,SAAgB,oBAAoB,CAAI,IAAY;IAClD,MAAM,UAAU,GAAG,IAAA,iCAAU,EAAC,IAAI,CAAC,CAAC;IACpC,OAAO,QAAQ,CAAC,mBAAmB,GAAG,UAAU,GAAG,IAAI,CAAC,EAAE,CAAC;AAC7D,CAAC;AAEM,MAAM,aAAa,GAAG,CAAC,MAAe,EAAU,EAAE;IACvD,IAAI,MAAM,KAAK,IAAI;QAAE,MAAM,IAAI,KAAK,CAAC,gBAAgB,CAAC,CAAC;IAEvD,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;QAC/B,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,IAAI,MAAM,EAAE,CAAC;QACnD,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;IAC7B,CAAC;IAED,IACE,OAAO,MAAM,KAAK,QAAQ;QAC1B,aAAa,IAAI,MAAM;QACvB,MAAM,IAAI,MAAM,CAAC,WAAW,EAC5B,CAAC;QACD,OAAO,MAAM,CAAC,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;IACvC,CAAC;IAED,IACE,OAAO,MAAM,KAAK,UAAU;QAC5B,aAAa,IAAI,MAAM,CAAC,SAAS;QACjC,MAAM,IAAI,MAAM,CAAC,SAAS,CAAC,WAAW,EACtC,CAAC;QACD,OAAO,MAAM,CAAC,SAAS,CAAC,WAAW,CAAC,IAAI,CAAC;IAC3C,CAAC;IAED,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;AAC1C,CAAC,CAAC;AA5BW,QAAA,aAAa,iBA4BxB"} \ No newline at end of file diff --git a/libs/json-api/json-api-nestjs-shared/tsconfig-mjs.lib.json b/libs/json-api/json-api-nestjs-shared/tsconfig-mjs.lib.json index 4259d741..3621ee4c 100644 --- a/libs/json-api/json-api-nestjs-shared/tsconfig-mjs.lib.json +++ b/libs/json-api/json-api-nestjs-shared/tsconfig-mjs.lib.json @@ -12,10 +12,5 @@ "include": [ "src/**/*.ts" ], - "exclude": [ - "jest.config.ts", - "src/**/*.spec.ts", - "src/**/*.test-d.ts", - "src/**/___test___/**/*.ts" - ] + "exclude": ["src/**/*.spec.ts", "src/**/*.test.ts"] } diff --git a/libs/json-api/json-api-nestjs-shared/tsconfig.lib.json b/libs/json-api/json-api-nestjs-shared/tsconfig.lib.json index 0acc1f8f..51d840aa 100644 --- a/libs/json-api/json-api-nestjs-shared/tsconfig.lib.json +++ b/libs/json-api/json-api-nestjs-shared/tsconfig.lib.json @@ -16,11 +16,5 @@ "include": [ "src/**/*.ts" ], - "exclude": [ - "jest.config.ts", - "src/**/*.spec.ts", - "src/**/*.test.ts", - "src/**/*.test-d.ts", - "src/lib/utils/___test___/**/*.ts" - ] + "exclude": ["src/**/*.spec.ts", "src/**/*.test.ts"] } diff --git a/libs/json-api/json-api-nestjs-shared/tsconfig.spec.json b/libs/json-api/json-api-nestjs-shared/tsconfig.spec.json index cfccf319..169abbcd 100644 --- a/libs/json-api/json-api-nestjs-shared/tsconfig.spec.json +++ b/libs/json-api/json-api-nestjs-shared/tsconfig.spec.json @@ -2,13 +2,30 @@ "extends": "./tsconfig.json", "compilerOptions": { "outDir": "../../../dist/out-tsc", - "module": "commonjs", + "module": "ES2022", "moduleResolution": "node10", - "types": ["jest", "node"], - "allowJs": true + "experimentalDecorators": true, + "emitDecoratorMetadata": true, + "strictNullChecks": true, + "noImplicitAny": true, + "strictBindCallApply": true, + "forceConsistentCasingInFileNames": true, + "noFallthroughCasesInSwitch": true, + "types": [ + "vitest/globals", + "vitest/importMeta", + "vite/client", + "node", + "vitest" + ], + "allowSyntheticDefaultImports": true, + "esModuleInterop": true, }, "include": [ - "jest.config.ts", + "vite.config.ts", + "vite.config.mts", + "vitest.config.ts", + "vitest.config.mts", "src/**/*.test.ts", "src/**/*.spec.ts", "src/**/*.d.ts" diff --git a/libs/json-api/json-api-nestjs-shared/vite.config.mts b/libs/json-api/json-api-nestjs-shared/vite.config.mts new file mode 100644 index 00000000..214acd26 --- /dev/null +++ b/libs/json-api/json-api-nestjs-shared/vite.config.mts @@ -0,0 +1,45 @@ +/// +import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin'; + +import swc from 'unplugin-swc'; +import { defineConfig } from 'vite'; + +export default defineConfig(() => ({ + root: __dirname, + cacheDir: '../../../node_modules/.vite/libs/json-api-nestjs-shared', + plugins: [ + nxViteTsPaths(), + swc.vite({ + module: { type: 'es6' }, + jsc: { + target: 'es2022', + parser: { + syntax: 'typescript', + decorators: true, + }, + transform: { + decoratorMetadata: true, + legacyDecorator: true, + }, + keepClassNames: true, + externalHelpers: true, + loose: true, + }, + }), + ], + test: { + name: 'json-api-nestjs-shared', + watch: false, + globals: true, + environment: 'node', + include: ['{src,tests}/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'], + setupFiles: [], + reporters: ['default'], + coverage: { + enabled: true, + reporter: ['json'], + reportsDirectory: '../../../coverage/json-api-nestjs-shared', + provider: 'v8' as const, + }, + }, +})); diff --git a/libs/json-api/json-api-nestjs-typeorm/jest.config.ts b/libs/json-api/json-api-nestjs-typeorm/jest.config.ts deleted file mode 100644 index 51695ffd..00000000 --- a/libs/json-api/json-api-nestjs-typeorm/jest.config.ts +++ /dev/null @@ -1,10 +0,0 @@ -export default { - displayName: 'json-api-nestjs-typeorm', - preset: '../../../jest.preset.js', - testEnvironment: 'node', - transform: { - '^.+\\.[tj]s$': ['ts-jest', { tsconfig: '/tsconfig.spec.json' }], - }, - moduleFileExtensions: ['ts', 'js', 'html'], - coverageDirectory: '../../../coverage/libs/json-api/json-api-nestjs-typeorm', -}; diff --git a/libs/json-api/json-api-nestjs-typeorm/project.json b/libs/json-api/json-api-nestjs-typeorm/project.json index cb42c60c..7f73b8ad 100644 --- a/libs/json-api/json-api-nestjs-typeorm/project.json +++ b/libs/json-api/json-api-nestjs-typeorm/project.json @@ -49,15 +49,6 @@ "packageRoot": "dist/{projectRoot}" } }, - "test": { - "executor": "@nx/jest:jest", - "outputs": ["{workspaceRoot}/coverage/{projectRoot}"], - "options": { - "jestConfig": "{projectRoot}/jest.config.ts", - "codeCoverage": true, - "coverageReporters": ["json-summary"] - } - }, "upload-badge": { "executor": "nx:run-commands", "dependsOn": [ diff --git a/libs/json-api/json-api-nestjs-typeorm/src/lib/orm-methods/delete-relationship/delete-relationship.spec.ts b/libs/json-api/json-api-nestjs-typeorm/src/lib/orm-methods/delete-relationship/delete-relationship.spec.ts index c23c3430..80434bb9 100644 --- a/libs/json-api/json-api-nestjs-typeorm/src/lib/orm-methods/delete-relationship/delete-relationship.spec.ts +++ b/libs/json-api/json-api-nestjs-typeorm/src/lib/orm-methods/delete-relationship/delete-relationship.spec.ts @@ -62,8 +62,8 @@ describe('deleteRelationship', () => { }); afterEach(() => { - jest.clearAllMocks(); - jest.restoreAllMocks(); + vi.clearAllMocks(); + vi.restoreAllMocks(); }); it('Should be ok', async () => { diff --git a/libs/json-api/json-api-nestjs-typeorm/src/lib/orm-methods/get-all/get-all.spec.ts b/libs/json-api/json-api-nestjs-typeorm/src/lib/orm-methods/get-all/get-all.spec.ts index c736c1e9..ddc58952 100644 --- a/libs/json-api/json-api-nestjs-typeorm/src/lib/orm-methods/get-all/get-all.spec.ts +++ b/libs/json-api/json-api-nestjs-typeorm/src/lib/orm-methods/get-all/get-all.spec.ts @@ -63,12 +63,12 @@ describe('getAll', () => { }); afterEach(() => { - jest.clearAllMocks(); - jest.restoreAllMocks(); + vi.clearAllMocks(); + vi.restoreAllMocks(); }); it('order', async () => { - const spyOnTransformData = jest.spyOn( + const spyOnTransformData = vi.spyOn( transformDataService, 'transformData' ); @@ -101,7 +101,7 @@ describe('getAll', () => { }); it('include', async () => { - const spyOnTransformData = jest.spyOn( + const spyOnTransformData = vi.spyOn( transformDataService, 'transformData' ); @@ -128,7 +128,7 @@ describe('getAll', () => { }); it('select', async () => { - const spyOnTransformData = jest.spyOn( + const spyOnTransformData = vi.spyOn( transformDataService, 'transformData' ); @@ -189,7 +189,7 @@ describe('getAll', () => { }); it('Target props with null', async () => { - const spyOnTransformData = jest.spyOn( + const spyOnTransformData = vi.spyOn( transformDataService, 'transformData' ); @@ -204,7 +204,7 @@ describe('getAll', () => { }); it('Target props', async () => { - const spyOnTransformData = jest.spyOn( + const spyOnTransformData = vi.spyOn( transformDataService, 'transformData' ); @@ -222,7 +222,7 @@ describe('getAll', () => { }); it('Check relation with the same Entity', async () => { - const spyOnTransformData = jest.spyOn( + const spyOnTransformData = vi.spyOn( transformDataService, 'transformData' ); @@ -260,7 +260,7 @@ describe('getAll', () => { // }); it('Relation many-to-one', async () => { - const spyOnTransformData = jest.spyOn( + const spyOnTransformData = vi.spyOn( transformDataService, 'transformData' ); @@ -292,7 +292,7 @@ describe('getAll', () => { }); it('Relation one-to-many', async () => { - const spyOnTransformData = jest.spyOn( + const spyOnTransformData = vi.spyOn( transformDataService, 'transformData' ); @@ -320,7 +320,7 @@ describe('getAll', () => { }); it('Relation many-to-many', async () => { - const spyOnTransformData = jest.spyOn( + const spyOnTransformData = vi.spyOn( transformDataService, 'transformData' ); diff --git a/libs/json-api/json-api-nestjs-typeorm/src/lib/orm-methods/get-one/get-one.spec.ts b/libs/json-api/json-api-nestjs-typeorm/src/lib/orm-methods/get-one/get-one.spec.ts index a6b296e1..b31bceb7 100644 --- a/libs/json-api/json-api-nestjs-typeorm/src/lib/orm-methods/get-one/get-one.spec.ts +++ b/libs/json-api/json-api-nestjs-typeorm/src/lib/orm-methods/get-one/get-one.spec.ts @@ -63,12 +63,12 @@ describe('getOne', () => { }); afterEach(() => { - jest.clearAllMocks(); - jest.restoreAllMocks(); + vi.clearAllMocks(); + vi.restoreAllMocks(); }); it('Get one item', async () => { - const spyOnTransformData = jest.spyOn( + const spyOnTransformData = vi.spyOn( transformDataService, 'transformData' ); @@ -87,7 +87,7 @@ describe('getOne', () => { expect(spyOnTransformData).toBeCalledWith(checkData, query); }); it('Get one item with select', async () => { - const spyOnTransformData = jest.spyOn( + const spyOnTransformData = vi.spyOn( transformDataService, 'transformData' ); diff --git a/libs/json-api/json-api-nestjs-typeorm/src/lib/orm-methods/get-relationship/get-relationship.spec.ts b/libs/json-api/json-api-nestjs-typeorm/src/lib/orm-methods/get-relationship/get-relationship.spec.ts index 2d6bac98..7f977d4b 100644 --- a/libs/json-api/json-api-nestjs-typeorm/src/lib/orm-methods/get-relationship/get-relationship.spec.ts +++ b/libs/json-api/json-api-nestjs-typeorm/src/lib/orm-methods/get-relationship/get-relationship.spec.ts @@ -61,12 +61,12 @@ describe('getRelationship', () => { }); afterEach(() => { - jest.clearAllMocks(); - jest.restoreAllMocks(); + vi.clearAllMocks(); + vi.restoreAllMocks(); }); it('Should be ok', async () => { - const spyOnTransformData = jest.spyOn(transformDataService, 'transformRel'); + const spyOnTransformData = vi.spyOn(transformDataService, 'transformRel'); const id = 1; const rel = 'roles'; const check = await userRepository.findOne({ diff --git a/libs/json-api/json-api-nestjs-typeorm/src/lib/orm-methods/patch-one/patch-one.spec.ts b/libs/json-api/json-api-nestjs-typeorm/src/lib/orm-methods/patch-one/patch-one.spec.ts index 94e7183e..d931d7fc 100644 --- a/libs/json-api/json-api-nestjs-typeorm/src/lib/orm-methods/patch-one/patch-one.spec.ts +++ b/libs/json-api/json-api-nestjs-typeorm/src/lib/orm-methods/patch-one/patch-one.spec.ts @@ -194,12 +194,12 @@ describe('patchOne', () => { }); afterEach(() => { - jest.clearAllMocks(); - jest.restoreAllMocks(); + vi.clearAllMocks(); + vi.restoreAllMocks(); }); it('should be ok without relation', async () => { - const spyOnTransformData = jest + const spyOnTransformData = vi .spyOn(transformDataService, 'transformData') .mockImplementationOnce(() => ({ data: {} as any, @@ -223,7 +223,7 @@ describe('patchOne', () => { }); it('should be ok with relation', async () => { - const spyOnTransformData = jest + const spyOnTransformData = vi .spyOn(transformDataService, 'transformData') .mockImplementationOnce(() => ({ data: {} as any, @@ -256,7 +256,7 @@ describe('patchOne', () => { }); it('should be ok with relation nulling relation', async () => { - const spyOnTransformData = jest + const spyOnTransformData = vi .spyOn(transformDataService, 'transformData') .mockImplementationOnce(() => ({ data: {} as any, diff --git a/libs/json-api/json-api-nestjs-typeorm/src/lib/orm-methods/patch-relationship/patch-relationship.spec.ts b/libs/json-api/json-api-nestjs-typeorm/src/lib/orm-methods/patch-relationship/patch-relationship.spec.ts index 27256569..47a3158b 100644 --- a/libs/json-api/json-api-nestjs-typeorm/src/lib/orm-methods/patch-relationship/patch-relationship.spec.ts +++ b/libs/json-api/json-api-nestjs-typeorm/src/lib/orm-methods/patch-relationship/patch-relationship.spec.ts @@ -62,12 +62,12 @@ describe('patchRelationship', () => { }); afterEach(() => { - jest.clearAllMocks(); - jest.restoreAllMocks(); + vi.clearAllMocks(); + vi.restoreAllMocks(); }); it('Should be ok', async () => { - jest + vi .spyOn(transformDataService, 'transformRel') // @ts-ignore .mockImplementation((item, rel) => { diff --git a/libs/json-api/json-api-nestjs-typeorm/src/lib/orm-methods/post-one/post-one.spec.ts b/libs/json-api/json-api-nestjs-typeorm/src/lib/orm-methods/post-one/post-one.spec.ts index d5b4a27d..269f80c2 100644 --- a/libs/json-api/json-api-nestjs-typeorm/src/lib/orm-methods/post-one/post-one.spec.ts +++ b/libs/json-api/json-api-nestjs-typeorm/src/lib/orm-methods/post-one/post-one.spec.ts @@ -146,12 +146,12 @@ describe('postOne', () => { }); afterEach(() => { - jest.clearAllMocks(); - jest.restoreAllMocks(); + vi.clearAllMocks(); + vi.restoreAllMocks(); }); it('should be ok without relation and with id', async () => { - const spyOnTransformData = jest + const spyOnTransformData = vi .spyOn(transformDataServicePods, 'transformData') .mockImplementationOnce(() => ({ data: {} as any, @@ -180,7 +180,7 @@ describe('postOne', () => { }); it('should be ok without relation', async () => { - const spyOnTransformData = jest + const spyOnTransformData = vi .spyOn(transformDataService, 'transformData') .mockImplementationOnce(() => ({ data: {} as any, @@ -199,7 +199,7 @@ describe('postOne', () => { }); it('should be ok with relation', async () => { - const spyOnTransformData = jest + const spyOnTransformData = vi .spyOn(transformDataService, 'transformData') .mockImplementationOnce(() => ({ data: {} as any, diff --git a/libs/json-api/json-api-nestjs-typeorm/src/lib/orm-methods/post-relationship/post-relationship.spec.ts b/libs/json-api/json-api-nestjs-typeorm/src/lib/orm-methods/post-relationship/post-relationship.spec.ts index 980b99fb..db2408b8 100644 --- a/libs/json-api/json-api-nestjs-typeorm/src/lib/orm-methods/post-relationship/post-relationship.spec.ts +++ b/libs/json-api/json-api-nestjs-typeorm/src/lib/orm-methods/post-relationship/post-relationship.spec.ts @@ -63,8 +63,8 @@ describe('postRelationship', () => { }); afterEach(() => { - jest.clearAllMocks(); - jest.restoreAllMocks(); + vi.clearAllMocks(); + vi.restoreAllMocks(); }); it('Should be ok', async () => { diff --git a/libs/json-api/json-api-nestjs-typeorm/src/lib/service/type-orm-format.error.service.spec.ts b/libs/json-api/json-api-nestjs-typeorm/src/lib/service/type-orm-format.error.service.spec.ts index 834bc14c..97d3a2f9 100644 --- a/libs/json-api/json-api-nestjs-typeorm/src/lib/service/type-orm-format.error.service.spec.ts +++ b/libs/json-api/json-api-nestjs-typeorm/src/lib/service/type-orm-format.error.service.spec.ts @@ -81,8 +81,8 @@ describe('getOne', () => { }); afterEach(() => { - jest.clearAllMocks(); - jest.restoreAllMocks(); + vi.clearAllMocks(); + vi.restoreAllMocks(); }); it('Format error duplicate error', async () => { diff --git a/libs/json-api/json-api-nestjs-typeorm/src/lib/service/typeorm-utils.service.spec.ts b/libs/json-api/json-api-nestjs-typeorm/src/lib/service/typeorm-utils.service.spec.ts index 09a08cdd..3617beea 100644 --- a/libs/json-api/json-api-nestjs-typeorm/src/lib/service/typeorm-utils.service.spec.ts +++ b/libs/json-api/json-api-nestjs-typeorm/src/lib/service/typeorm-utils.service.spec.ts @@ -118,8 +118,8 @@ describe('TypeormUtilsService', () => { }); afterEach(() => { - jest.clearAllMocks(); - jest.restoreAllMocks(); + vi.clearAllMocks(); + vi.restoreAllMocks(); }); it('TypeormUtilsService.currentAlias', () => { diff --git a/libs/json-api/json-api-nestjs-typeorm/tsconfig.lib.json b/libs/json-api/json-api-nestjs-typeorm/tsconfig.lib.json index 08408448..8faf96da 100644 --- a/libs/json-api/json-api-nestjs-typeorm/tsconfig.lib.json +++ b/libs/json-api/json-api-nestjs-typeorm/tsconfig.lib.json @@ -12,5 +12,5 @@ "noFallthroughCasesInSwitch": true }, "include": ["src/**/*.ts"], - "exclude": ["jest.config.ts", "src/**/*.spec.ts", "src/**/*.test.ts", "src/lib/mock-utils/**/*.ts"] + "exclude": ["src/**/*.spec.ts", "src/**/*.test.ts", "src/lib/mock-utils/**/*.ts"] } diff --git a/libs/json-api/json-api-nestjs-typeorm/tsconfig.spec.json b/libs/json-api/json-api-nestjs-typeorm/tsconfig.spec.json index 07100034..d50edb42 100644 --- a/libs/json-api/json-api-nestjs-typeorm/tsconfig.spec.json +++ b/libs/json-api/json-api-nestjs-typeorm/tsconfig.spec.json @@ -2,21 +2,30 @@ "extends": "./tsconfig.json", "compilerOptions": { "outDir": "../../../dist/out-tsc", - "module": "commonjs", + "module": "ES2022", "moduleResolution": "node10", - "types": ["jest", "node"], - "paths": { - "@klerick/json-api-nestjs-shared": [ - "libs/json-api/json-api-nestjs-shared/src/index.ts" - ], - "@klerick/json-api-nestjs": [ - "libs/json-api/json-api-nestjs/src/index.ts" - ] - }, - "allowJs": true + "experimentalDecorators": true, + "emitDecoratorMetadata": true, + "strictNullChecks": true, + "noImplicitAny": true, + "strictBindCallApply": true, + "forceConsistentCasingInFileNames": true, + "noFallthroughCasesInSwitch": true, + "types": [ + "vitest/globals", + "vitest/importMeta", + "vite/client", + "node", + "vitest" + ], + "allowSyntheticDefaultImports": true, + "esModuleInterop": true }, "include": [ - "jest.config.ts", + "vite.config.ts", + "vite.config.mts", + "vitest.config.ts", + "vitest.config.mts", "src/**/*.test.ts", "src/**/*.spec.ts", "src/**/*.d.ts" diff --git a/libs/json-api/json-api-nestjs-typeorm/vite.config.mts b/libs/json-api/json-api-nestjs-typeorm/vite.config.mts new file mode 100644 index 00000000..fe84e7d1 --- /dev/null +++ b/libs/json-api/json-api-nestjs-typeorm/vite.config.mts @@ -0,0 +1,54 @@ +/// +import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin'; + +import swc from 'unplugin-swc'; +import { defineConfig } from 'vite'; + +export default defineConfig(() => ({ + root: __dirname, + cacheDir: '../../../node_modules/.vite/libs/json-api-nestjs-typeorm', + plugins: [ + nxViteTsPaths(), + swc.vite({ + module: { type: 'es6' }, + jsc: { + target: 'es2022', + parser: { + syntax: 'typescript', + decorators: true, + }, + transform: { + decoratorMetadata: true, + legacyDecorator: true, + }, + keepClassNames: true, + externalHelpers: true, + loose: true, + }, + }), + ], + test: { + fileParallelism: false, + pool: 'threads', + singleThread: true, + sequence: { + concurrent: false, + shuffle: false, + }, + maxWorkers: 1, + minWorkers: 1, + name: 'json-api-nestjs-typeorm', + watch: false, + globals: true, + environment: 'node', + include: ['{src,tests}/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'], + setupFiles: [], + reporters: ['default'], + coverage: { + enabled: true, + reporter: ['json'], + reportsDirectory: '../../../coverage/json-api-nestjs-typeorm', + provider: 'v8' as const, + }, + }, +})); diff --git a/libs/json-api/json-api-nestjs/jest.config.ts b/libs/json-api/json-api-nestjs/jest.config.ts deleted file mode 100644 index 6302a99b..00000000 --- a/libs/json-api/json-api-nestjs/jest.config.ts +++ /dev/null @@ -1,11 +0,0 @@ -/* eslint-disable */ -export default { - displayName: 'json-api-nestjs', - preset: '../../../jest.preset.js', - testEnvironment: 'node', - transform: { - '^.+\\.[tj]s$': ['ts-jest', { tsconfig: '/tsconfig.spec.json' }], - }, - moduleFileExtensions: ['ts', 'js', 'html'], - coverageDirectory: '../../../coverage/libs/json-api/json-api-nestjs', -}; diff --git a/libs/json-api/json-api-nestjs/project.json b/libs/json-api/json-api-nestjs/project.json index 14da33c5..79b38137 100644 --- a/libs/json-api/json-api-nestjs/project.json +++ b/libs/json-api/json-api-nestjs/project.json @@ -49,16 +49,9 @@ }, "publish": { "command": "node tools/scripts/publish.mjs json-api-nestjs {args.ver} {args.tag}", - "dependsOn": ["build"] - }, - "test": { - "executor": "@nx/jest:jest", - "outputs": ["{workspaceRoot}/coverage/{projectRoot}"], - "options": { - "jestConfig": "{projectRoot}/jest.config.ts", - "codeCoverage": true, - "coverageReporters": ["json-summary"] - } + "dependsOn": [ + "build" + ] }, "ts-test": { "dependsOn": [ diff --git a/libs/json-api/json-api-nestjs/src/lib/modules/atomic-operation/controllers/operation.controller.spec.ts b/libs/json-api/json-api-nestjs/src/lib/modules/atomic-operation/controllers/operation.controller.spec.ts index 164ea78d..f7c8ecde 100644 --- a/libs/json-api/json-api-nestjs/src/lib/modules/atomic-operation/controllers/operation.controller.spec.ts +++ b/libs/json-api/json-api-nestjs/src/lib/modules/atomic-operation/controllers/operation.controller.spec.ts @@ -75,8 +75,8 @@ describe('OperationController', () => { }); afterEach(() => { - jest.clearAllMocks(); - jest.restoreAllMocks(); + vi.clearAllMocks(); + vi.restoreAllMocks(); }); describe('index', () => { @@ -102,25 +102,25 @@ describe('OperationController', () => { const mockReturnData = { data: { someData: '' } }; - const getControllerByEntityNameSpy = jest + const getControllerByEntityNameSpy = vi .spyOn(explorerService, 'getControllerByEntityName') .mockReturnValue(paramsForExecuteMock[0].controller); - const getMethodNameByParamSpy = jest + const getMethodNameByParamSpy = vi .spyOn(explorerService, 'getMethodNameByParam') .mockReturnValue( paramsForExecuteMock[0].methodName as OperationMethode ); - const getModulesByControllerSpy = jest + const getModulesByControllerSpy = vi .spyOn(explorerService, 'getParamsForMethod') .mockReturnValue( paramsForExecuteMock[0].params as Parameters< JsonBaseController['deleteOne'] > ); - const getParamsForMethodSpy = jest + const getParamsForMethodSpy = vi .spyOn(explorerService, 'getModulesByController') .mockReturnValue(paramsForExecuteMock[0].module); - const runSpy = jest + const runSpy = vi .spyOn(executeService, 'run') .mockResolvedValue([mockReturnData] as never); @@ -157,7 +157,7 @@ describe('OperationController', () => { }, ]; - jest + vi .spyOn(explorerService, 'getControllerByEntityName') .mockImplementationOnce(() => { throw new HttpException('Resource does not exist', 404); @@ -182,11 +182,11 @@ describe('OperationController', () => { }, ]; - jest + vi .spyOn(explorerService, 'getControllerByEntityName') .mockReturnValue(Promise.resolve({}) as any); - jest + vi .spyOn(explorerService, 'getMethodNameByParam') .mockImplementationOnce(() => { throw new HttpException('Operation not allowed', 405); diff --git a/libs/json-api/json-api-nestjs/src/lib/modules/atomic-operation/pipes/input-operation.pipe.spec.ts b/libs/json-api/json-api-nestjs/src/lib/modules/atomic-operation/pipes/input-operation.pipe.spec.ts index d2b55af2..44be05ed 100644 --- a/libs/json-api/json-api-nestjs/src/lib/modules/atomic-operation/pipes/input-operation.pipe.spec.ts +++ b/libs/json-api/json-api-nestjs/src/lib/modules/atomic-operation/pipes/input-operation.pipe.spec.ts @@ -33,8 +33,8 @@ describe('PatchInputPipe', () => { }); afterEach(() => { - jest.clearAllMocks(); - jest.restoreAllMocks(); + vi.clearAllMocks(); + vi.restoreAllMocks(); }); it('It should be ok', () => { @@ -44,14 +44,14 @@ describe('PatchInputPipe', () => { const check = { [KEY_MAIN_INPUT_SCHEMA]: data, }; - jest + vi .spyOn(zodInputOperation, 'parse') .mockImplementationOnce(() => check as any); expect(patchInputPipe.transform(check)).toEqual(data); }); it('Should be not ok', () => { - jest.spyOn(zodInputOperation, 'parse').mockImplementationOnce(() => { + vi.spyOn(zodInputOperation, 'parse').mockImplementationOnce(() => { throw new ZodError([]); }); expect.assertions(1); @@ -63,7 +63,7 @@ describe('PatchInputPipe', () => { }); it('Should be 500', () => { - jest.spyOn(zodInputOperation, 'parse').mockImplementationOnce(() => { + vi.spyOn(zodInputOperation, 'parse').mockImplementationOnce(() => { throw new Error('Error mock'); }); expect.assertions(1); diff --git a/libs/json-api/json-api-nestjs/src/lib/modules/atomic-operation/service/execute.service.spec.ts b/libs/json-api/json-api-nestjs/src/lib/modules/atomic-operation/service/execute.service.spec.ts index 361bd497..28c03693 100644 --- a/libs/json-api/json-api-nestjs/src/lib/modules/atomic-operation/service/execute.service.spec.ts +++ b/libs/json-api/json-api-nestjs/src/lib/modules/atomic-operation/service/execute.service.spec.ts @@ -18,10 +18,11 @@ import { import { ParamsForExecute } from '../types'; import { AsyncLocalStorage } from 'async_hooks'; import { RUN_IN_TRANSACTION_FUNCTION } from '../../../constants'; +import { Mock } from 'vitest'; describe('ExecuteService', () => { let service: ExecuteService; - let runInTransaction: jest.Mock; + let runInTransaction: Mock; let moduleRef: ModuleRef; let asyncIteratorFactory: IterateFactory; const mapControllerInterceptors = new Map(); @@ -31,18 +32,18 @@ describe('ExecuteService', () => { ExecuteService, { provide: RUN_IN_TRANSACTION_FUNCTION, - useValue: jest.fn(), + useValue: vi.fn(), }, { provide: ModuleRef, useValue: { - get() {}, + get: () => void 0, }, }, { provide: ASYNC_ITERATOR_FACTORY, useValue: { - createIterator: () => {}, + createIterator: () => void 0, }, }, { @@ -57,7 +58,7 @@ describe('ExecuteService', () => { }).compile(); service = module.get(ExecuteService); - runInTransaction = module.get(RUN_IN_TRANSACTION_FUNCTION); + runInTransaction = module.get(RUN_IN_TRANSACTION_FUNCTION); moduleRef = module.get(ModuleRef); asyncIteratorFactory = module.get(ASYNC_ITERATOR_FACTORY); mapControllerInterceptors.clear(); @@ -78,7 +79,7 @@ describe('ExecuteService', () => { runInTransaction.mockImplementationOnce((args: () => {}) => args()); - jest.spyOn(service as any, 'executeOperations').mockImplementation(() => { + vi.spyOn(service as any, 'executeOperations').mockImplementation(() => { throw new NotFoundException(); }); @@ -91,7 +92,7 @@ describe('ExecuteService', () => { const params: ParamsForExecute[] = []; runInTransaction.mockImplementationOnce((args: () => {}) => args()); - jest.spyOn(service as any, 'executeOperations').mockReturnValue([]); + vi.spyOn(service as any, 'executeOperations').mockReturnValue([]); const result = await service.run(params, []); expect(result).toEqual([]); @@ -107,17 +108,17 @@ describe('ExecuteService', () => { methodName: 'someMethod', }, ] as unknown as ParamsForExecute[]; - const callback = jest.fn().mockReturnValue({ value: 'test' }); + const callback = vi.fn().mockReturnValue({ value: 'test' }); const mapController = { someMethod: callback, }; - jest + vi .spyOn(service as any, 'getControllerInstance') .mockReturnValue(mapController); mapControllerInterceptors.set(mapController, new Map([[callback, []]])); let callCount = 0; - jest.spyOn(asyncIteratorFactory, 'createIterator').mockReturnValue({ + vi.spyOn(asyncIteratorFactory, 'createIterator').mockReturnValue({ [Symbol.asyncIterator]: () => ({ next: () => { @@ -144,18 +145,18 @@ describe('ExecuteService', () => { }, ] as unknown as ParamsForExecute[]; - const callback = jest.fn().mockReturnValue('not an object'); + const callback = vi.fn().mockReturnValue('not an object'); const mapController = { someMethod: callback, }; - jest + vi .spyOn(service as any, 'getControllerInstance') .mockReturnValue(mapController); mapControllerInterceptors.set(mapController, new Map([[callback, []]])); let callCount = 0; - jest.spyOn(asyncIteratorFactory, 'createIterator').mockReturnValue({ + vi.spyOn(asyncIteratorFactory, 'createIterator').mockReturnValue({ [Symbol.asyncIterator]: () => ({ next: () => { @@ -182,20 +183,20 @@ describe('ExecuteService', () => { }, ] as unknown as ParamsForExecute[]; - const callback = jest.fn().mockImplementation(() => { + const callback = vi.fn().mockImplementation(() => { throw new HttpException('Test exception', 400); }); const mapController = { someMethod: callback, }; - jest + vi .spyOn(service as any, 'getControllerInstance') .mockReturnValue(mapController); mapControllerInterceptors.set(mapController, new Map([[callback, []]])); let callCount = 0; - jest.spyOn(asyncIteratorFactory, 'createIterator').mockReturnValue({ + vi.spyOn(asyncIteratorFactory, 'createIterator').mockReturnValue({ [Symbol.asyncIterator]: () => ({ next: () => { @@ -209,7 +210,7 @@ describe('ExecuteService', () => { } as any), }); - const processExceptionSpy = jest.spyOn( + const processExceptionSpy = vi.spyOn( service as any, 'processException' ); @@ -236,7 +237,7 @@ describe('ExecuteService', () => { it('should return controller instance if controller is found', () => { const controllerInstance = { - someMethod: jest.fn().mockReturnValue('test'), + someMethod: vi.fn().mockReturnValue('test'), }; function TestController() {} const params: ParamsForExecute = { @@ -276,10 +277,10 @@ describe('ExecuteService', () => { 'test', ]); } else { - fail('Exception response is not a ZodError'); + assert.fail('Exception response is not a ZodError'); } } else { - fail('Caught exception is not a HttpException'); + assert.fail('Caught exception is not a HttpException'); } } }); @@ -296,7 +297,7 @@ describe('ExecuteService', () => { describe('runOneOperation', () => { it('should correctly run operation', async () => { const controllerInstance = { - someMethod: jest.fn().mockReturnValue('test'), + someMethod: vi.fn().mockReturnValue('test'), }; function TestController() {} const pipes = [ @@ -321,7 +322,7 @@ describe('ExecuteService', () => { 'someMethod' ); - const runPipesSpy = jest + const runPipesSpy = vi .spyOn(service as any, 'runPipes') .mockImplementation((param) => `modified_${param}`); @@ -341,7 +342,7 @@ describe('ExecuteService', () => { it('should not call runPipes if metadata is empty', async () => { const controllerInstance = { - someMethod: jest.fn().mockReturnValue('test'), + someMethod: vi.fn().mockReturnValue('test'), }; function TestController() {} const params: ParamsForExecute = { @@ -362,7 +363,7 @@ describe('ExecuteService', () => { 'someMethod' ); - const runPipesSpy = jest + const runPipesSpy = vi .spyOn(service as any, 'runPipes') .mockImplementation((param) => `modified_${param}`); @@ -378,16 +379,16 @@ describe('ExecuteService', () => { const pipes = [new ParseBoolPipe(), new ParseIntPipe()]; const module = {} as any; - jest + vi .spyOn(pipes[0], 'transform') // @ts-ignore .mockImplementation((val) => `validated_${val}`); - jest + vi .spyOn(pipes[1], 'transform') // @ts-ignore .mockImplementation((val) => `parsed_${val}`); - const getPipeInstanceSpy = jest + const getPipeInstanceSpy = vi .spyOn(service as any, 'getPipeInstance') .mockImplementation((pipe) => pipe instanceof ParseBoolPipe ? pipes[0] : pipes[1] @@ -408,7 +409,7 @@ describe('ExecuteService', () => { const value = 'test'; const module = {} as any; - const getPipeInstanceSpy = jest.spyOn(service as any, 'getPipeInstance'); + const getPipeInstanceSpy = vi.spyOn(service as any, 'getPipeInstance'); const result = await (service as any).runPipes(value, module, []); @@ -421,7 +422,7 @@ describe('ExecuteService', () => { it('should return pipe instance from module if it exists', () => { const pipe = new ParseBoolPipe(); const module = { - getProviderByKey: jest.fn().mockReturnValue({ instance: pipe }), + getProviderByKey: vi.fn().mockReturnValue({ instance: pipe }), } as any; const result = (service as any).getPipeInstance(ParseBoolPipe, module); @@ -433,9 +434,9 @@ describe('ExecuteService', () => { it('should return pipe instance from moduleRef if it does not exist in module', () => { const pipe = new ParseBoolPipe(); const module = { - getProviderByKey: jest.fn().mockReturnValue(null), + getProviderByKey: vi.fn().mockReturnValue(null), } as any; - jest.spyOn(service['moduleRef'], 'get').mockReturnValue(pipe); + vi.spyOn(service['moduleRef'], 'get').mockReturnValue(pipe); const result = (service as any).getPipeInstance(ParseBoolPipe, module); diff --git a/libs/json-api/json-api-nestjs/src/lib/modules/atomic-operation/utils/zod/zod-helper.spec.ts b/libs/json-api/json-api-nestjs/src/lib/modules/atomic-operation/utils/zod/zod-helper.spec.ts index 32660915..7d0f4ba0 100644 --- a/libs/json-api/json-api-nestjs/src/lib/modules/atomic-operation/utils/zod/zod-helper.spec.ts +++ b/libs/json-api/json-api-nestjs/src/lib/modules/atomic-operation/utils/zod/zod-helper.spec.ts @@ -30,8 +30,8 @@ import { UnionToTuple } from '../../../../types'; describe('ZodHelperSpec', () => { afterEach(() => { - jest.clearAllMocks(); - jest.restoreAllMocks(); + vi.clearAllMocks(); + vi.restoreAllMocks(); }); describe('zodAdd', () => { diff --git a/libs/json-api/json-api-nestjs/src/lib/modules/mixin/pipe/check-item-entity/check-item-entity.pipe.spec.ts b/libs/json-api/json-api-nestjs/src/lib/modules/mixin/pipe/check-item-entity/check-item-entity.pipe.spec.ts index 64de13f0..0efe7a78 100644 --- a/libs/json-api/json-api-nestjs/src/lib/modules/mixin/pipe/check-item-entity/check-item-entity.pipe.spec.ts +++ b/libs/json-api/json-api-nestjs/src/lib/modules/mixin/pipe/check-item-entity/check-item-entity.pipe.spec.ts @@ -3,10 +3,11 @@ import { NotFoundException } from '@nestjs/common'; import { EntityClass } from '@klerick/json-api-nestjs-shared'; import { CheckItemEntityPipe } from './check-item-entity.pipe'; import { CURRENT_ENTITY, FIND_ONE_ROW_ENTITY } from '../../../../constants'; +import { Mock } from 'vitest'; describe('CheckItemEntityPipe', () => { let pipe: CheckItemEntityPipe; - let mockFindOneRowEntity: jest.Mock; + let mockFindOneRowEntity: Mock; let mockEntityTarget: EntityClass; beforeEach(async () => { @@ -14,13 +15,13 @@ describe('CheckItemEntityPipe', () => { providers: [ CheckItemEntityPipe, { provide: CURRENT_ENTITY, useValue: {} }, - { provide: FIND_ONE_ROW_ENTITY, useValue: jest.fn() }, + { provide: FIND_ONE_ROW_ENTITY, useValue: vi.fn() }, ], }).compile(); pipe = module.get>(CheckItemEntityPipe); mockEntityTarget = module.get>(CURRENT_ENTITY); - mockFindOneRowEntity = module.get(FIND_ONE_ROW_ENTITY); + mockFindOneRowEntity = module.get(FIND_ONE_ROW_ENTITY); }); it('should call findOneRowEntity and return the entity', async () => { diff --git a/libs/json-api/json-api-nestjs/src/lib/modules/mixin/pipe/parse-relationship-name/parse-relationship-name.pipe.spec.ts b/libs/json-api/json-api-nestjs/src/lib/modules/mixin/pipe/parse-relationship-name/parse-relationship-name.pipe.spec.ts index 247fb82c..e7bab78b 100644 --- a/libs/json-api/json-api-nestjs/src/lib/modules/mixin/pipe/parse-relationship-name/parse-relationship-name.pipe.spec.ts +++ b/libs/json-api/json-api-nestjs/src/lib/modules/mixin/pipe/parse-relationship-name/parse-relationship-name.pipe.spec.ts @@ -4,13 +4,14 @@ import { EntityClass } from '@klerick/json-api-nestjs-shared'; import { ParseRelationshipNamePipe } from './parse-relationship-name.pipe'; import { CURRENT_ENTITY, CHECK_RELATION_NAME } from '../../../../constants'; import { EntityParam } from '../../../../types'; +import { Mock, vi } from 'vitest'; describe('CheckItemEntityPipe', () => { let pipe: ParseRelationshipNamePipe< object, keyof EntityParam['relationProperty'] >; - let checkRelationNameMock: jest.Mock; + let checkRelationNameMock: Mock; let mockEntityTarget: EntityClass; beforeEach(async () => { @@ -18,7 +19,7 @@ describe('CheckItemEntityPipe', () => { providers: [ ParseRelationshipNamePipe, { provide: CURRENT_ENTITY, useValue: {} }, - { provide: CHECK_RELATION_NAME, useValue: jest.fn() }, + { provide: CHECK_RELATION_NAME, useValue: vi.fn() }, ], }).compile(); @@ -29,7 +30,7 @@ describe('CheckItemEntityPipe', () => { > >(ParseRelationshipNamePipe); mockEntityTarget = module.get>(CURRENT_ENTITY); - checkRelationNameMock = module.get(CHECK_RELATION_NAME); + checkRelationNameMock = module.get(CHECK_RELATION_NAME); }); it('should call findOneRowEntity and return the entity', async () => { diff --git a/libs/json-api/json-api-nestjs/src/lib/modules/mixin/pipe/patch-input/patch-input.pipe.spec.ts b/libs/json-api/json-api-nestjs/src/lib/modules/mixin/pipe/patch-input/patch-input.pipe.spec.ts index 98765ab7..b5e70e9e 100644 --- a/libs/json-api/json-api-nestjs/src/lib/modules/mixin/pipe/patch-input/patch-input.pipe.spec.ts +++ b/libs/json-api/json-api-nestjs/src/lib/modules/mixin/pipe/patch-input/patch-input.pipe.spec.ts @@ -23,7 +23,7 @@ describe('PostInputPipe', () => { { provide: ZOD_PATCH_SCHEMA, useValue: { - parse: jest.fn(), + parse: vi.fn(), }, }, ], @@ -37,7 +37,7 @@ describe('PostInputPipe', () => { const input: JSONValue = { key: 'value' } as any; const expectedData: PostData = { id: 1, key: 'value' } as any; - jest + vi .spyOn(mockSchema, 'parse') .mockReturnValue({ data: expectedData } as any); @@ -48,7 +48,7 @@ describe('PostInputPipe', () => { it('should throw BadRequestException if ZodError occurs', () => { const input: JSONValue = { key: 'value' }; - jest.spyOn(mockSchema, 'parse').mockImplementation(() => { + vi.spyOn(mockSchema, 'parse').mockImplementation(() => { throw new ZodError([]); }); @@ -58,7 +58,7 @@ describe('PostInputPipe', () => { it('should throw InternalServerErrorException for non-Zod errors', () => { const input: JSONValue = { key: 'value' }; - jest.spyOn(mockSchema, 'parse').mockImplementation(() => { + vi.spyOn(mockSchema, 'parse').mockImplementation(() => { throw new Error('Unexpected Error'); }); diff --git a/libs/json-api/json-api-nestjs/src/lib/modules/mixin/pipe/patch-relationship/patch-relationship.pipe.spec.ts b/libs/json-api/json-api-nestjs/src/lib/modules/mixin/pipe/patch-relationship/patch-relationship.pipe.spec.ts index 0454ce2b..67d9561a 100644 --- a/libs/json-api/json-api-nestjs/src/lib/modules/mixin/pipe/patch-relationship/patch-relationship.pipe.spec.ts +++ b/libs/json-api/json-api-nestjs/src/lib/modules/mixin/pipe/patch-relationship/patch-relationship.pipe.spec.ts @@ -35,8 +35,8 @@ describe('PatchInputPipe', () => { }); afterEach(() => { - jest.clearAllMocks(); - jest.restoreAllMocks(); + vi.clearAllMocks(); + vi.restoreAllMocks(); }); it('It should be ok', () => { @@ -46,14 +46,14 @@ describe('PatchInputPipe', () => { const check = { data, }; - jest + vi .spyOn(zodInputPatchRelationshipSchema, 'parse') .mockImplementationOnce(() => check as any); expect(patchRelationshipPipe.transform(check)).toEqual(data); }); it('Should be not ok', () => { - jest + vi .spyOn(zodInputPatchRelationshipSchema, 'parse') .mockImplementationOnce(() => { throw new ZodError([]); @@ -67,7 +67,7 @@ describe('PatchInputPipe', () => { }); it('Should be 500', () => { - jest + vi .spyOn(zodInputPatchRelationshipSchema, 'parse') .mockImplementationOnce(() => { throw new Error('Error mock'); diff --git a/libs/json-api/json-api-nestjs/src/lib/modules/mixin/pipe/post-input/post-input.pipe.spec.ts b/libs/json-api/json-api-nestjs/src/lib/modules/mixin/pipe/post-input/post-input.pipe.spec.ts index 6fb707f2..c8b43a25 100644 --- a/libs/json-api/json-api-nestjs/src/lib/modules/mixin/pipe/post-input/post-input.pipe.spec.ts +++ b/libs/json-api/json-api-nestjs/src/lib/modules/mixin/pipe/post-input/post-input.pipe.spec.ts @@ -22,7 +22,7 @@ describe('PostInputPipe', () => { { provide: ZOD_POST_SCHEMA, useValue: { - parse: jest.fn(), + parse: vi.fn(), }, }, ], @@ -36,7 +36,7 @@ describe('PostInputPipe', () => { const input: JSONValue = { key: 'value' } as any; const expectedData: PostData = { id: 1, key: 'value' } as any; - jest + vi .spyOn(mockSchema, 'parse') .mockReturnValue({ data: expectedData } as any); @@ -47,7 +47,7 @@ describe('PostInputPipe', () => { it('should throw BadRequestException if ZodError occurs', () => { const input: JSONValue = { key: 'value' }; - jest.spyOn(mockSchema, 'parse').mockImplementation(() => { + vi.spyOn(mockSchema, 'parse').mockImplementation(() => { throw new ZodError([]); }); @@ -57,7 +57,7 @@ describe('PostInputPipe', () => { it('should throw InternalServerErrorException for non-Zod errors', () => { const input: JSONValue = { key: 'value' }; - jest.spyOn(mockSchema, 'parse').mockImplementation(() => { + vi.spyOn(mockSchema, 'parse').mockImplementation(() => { throw new Error('Unexpected Error'); }); diff --git a/libs/json-api/json-api-nestjs/src/lib/modules/mixin/pipe/post-relationship/post-relationship.pipe.spec.ts b/libs/json-api/json-api-nestjs/src/lib/modules/mixin/pipe/post-relationship/post-relationship.pipe.spec.ts index 038529c1..1b9b3a7b 100644 --- a/libs/json-api/json-api-nestjs/src/lib/modules/mixin/pipe/post-relationship/post-relationship.pipe.spec.ts +++ b/libs/json-api/json-api-nestjs/src/lib/modules/mixin/pipe/post-relationship/post-relationship.pipe.spec.ts @@ -34,8 +34,8 @@ describe('PostInputPipe', () => { }); afterEach(() => { - jest.clearAllMocks(); - jest.restoreAllMocks(); + vi.clearAllMocks(); + vi.restoreAllMocks(); }); it('It should be ok', () => { @@ -45,14 +45,14 @@ describe('PostInputPipe', () => { const check = { data, }; - jest + vi .spyOn(zodInputPostRelationshipSchema, 'parse') .mockImplementationOnce(() => check as any); expect(postRelationshipPipe.transform(check)).toEqual(data); }); it('Should be not ok', () => { - jest + vi .spyOn(zodInputPostRelationshipSchema, 'parse') .mockImplementationOnce(() => { throw new ZodError([]); @@ -66,7 +66,7 @@ describe('PostInputPipe', () => { }); it('Should be 500', () => { - jest + vi .spyOn(zodInputPostRelationshipSchema, 'parse') .mockImplementationOnce(() => { throw new Error('Error mock'); diff --git a/libs/json-api/json-api-nestjs/src/lib/modules/mixin/pipe/query-check-select-field/query-check-select-field.spec.ts b/libs/json-api/json-api-nestjs/src/lib/modules/mixin/pipe/query-check-select-field/query-check-select-field.spec.ts index f877b959..9afc8284 100644 --- a/libs/json-api/json-api-nestjs/src/lib/modules/mixin/pipe/query-check-select-field/query-check-select-field.spec.ts +++ b/libs/json-api/json-api-nestjs/src/lib/modules/mixin/pipe/query-check-select-field/query-check-select-field.spec.ts @@ -57,7 +57,7 @@ describe('QueryCheckSelectField', () => { it('Is invalid', () => { const query = getDefaultQuery(); - jest.mocked(configParam).requiredSelectField = true; + vi.mocked(configParam).requiredSelectField = true; expect.assertions(1); try { queryCheckSelectField.transform(query); @@ -67,7 +67,7 @@ describe('QueryCheckSelectField', () => { }); afterEach(() => { - jest.clearAllMocks(); - jest.restoreAllMocks(); + vi.clearAllMocks(); + vi.restoreAllMocks(); }); }); diff --git a/libs/json-api/json-api-nestjs/src/lib/modules/mixin/pipe/query-input/query-input.pipe.spec.ts b/libs/json-api/json-api-nestjs/src/lib/modules/mixin/pipe/query-input/query-input.pipe.spec.ts index 75367b4c..d5b000d0 100644 --- a/libs/json-api/json-api-nestjs/src/lib/modules/mixin/pipe/query-input/query-input.pipe.spec.ts +++ b/libs/json-api/json-api-nestjs/src/lib/modules/mixin/pipe/query-input/query-input.pipe.spec.ts @@ -32,7 +32,7 @@ describe('QueryInputPipe', () => { it('should parse the input successfully', () => { const input = { key: 'value' }; - jest.spyOn(zodSchemaMock, 'parse').mockReturnValue(input); + vi.spyOn(zodSchemaMock, 'parse').mockReturnValue(input); const result = pipe.transform(input); expect(result).toBe(input); @@ -43,7 +43,7 @@ describe('QueryInputPipe', () => { const input = { invalid: 'data' }; const mockZodError = new ZodError([]); - jest.spyOn(zodSchemaMock, 'parse').mockImplementation(() => { + vi.spyOn(zodSchemaMock, 'parse').mockImplementation(() => { throw mockZodError; }); @@ -54,7 +54,7 @@ describe('QueryInputPipe', () => { const input = { key: 'value' }; const mockError = new Error('Unexpected error'); - jest.spyOn(zodSchemaMock, 'parse').mockImplementation(() => { + vi.spyOn(zodSchemaMock, 'parse').mockImplementation(() => { throw mockError; }); diff --git a/libs/json-api/json-api-nestjs/src/lib/modules/mixin/pipe/query/query.pipe.spec.ts b/libs/json-api/json-api-nestjs/src/lib/modules/mixin/pipe/query/query.pipe.spec.ts index 09e30934..c85aded6 100644 --- a/libs/json-api/json-api-nestjs/src/lib/modules/mixin/pipe/query/query.pipe.spec.ts +++ b/libs/json-api/json-api-nestjs/src/lib/modules/mixin/pipe/query/query.pipe.spec.ts @@ -22,7 +22,7 @@ describe('QueryPipe', () => { { provide: ZOD_QUERY_SCHEMA, useValue: { - parse: jest.fn(), + parse: vi.fn(), }, }, ], @@ -71,7 +71,7 @@ describe('QueryPipe', () => { [QueryField.page]: { number: 1, size: 10 }, }; - jest.spyOn(zodQuerySchemaMock, 'parse').mockReturnValue(parsedQuery); + vi.spyOn(zodQuerySchemaMock, 'parse').mockReturnValue(parsedQuery); const result = queryPipe.transform(inputQuery); @@ -86,7 +86,7 @@ describe('QueryPipe', () => { } as unknown as InputQuery; const zodError = new ZodError([]); - jest.spyOn(zodQuerySchemaMock, 'parse').mockImplementation(() => { + vi.spyOn(zodQuerySchemaMock, 'parse').mockImplementation(() => { throw zodError; }); @@ -100,7 +100,7 @@ describe('QueryPipe', () => { } as unknown as InputQuery; const unexpectedError = new Error('Unexpected error'); - jest.spyOn(zodQuerySchemaMock, 'parse').mockImplementation(() => { + vi.spyOn(zodQuerySchemaMock, 'parse').mockImplementation(() => { throw unexpectedError; }); diff --git a/libs/json-api/json-api-nestjs/src/lib/utils/module-helper.spec.ts b/libs/json-api/json-api-nestjs/src/lib/utils/module-helper.spec.ts index 027216f5..e378638e 100644 --- a/libs/json-api/json-api-nestjs/src/lib/utils/module-helper.spec.ts +++ b/libs/json-api/json-api-nestjs/src/lib/utils/module-helper.spec.ts @@ -10,8 +10,8 @@ import { Params } from '../types'; describe('module-helper', () => { describe('getController', () => { beforeAll(() => { - Reflect.defineMetadata = jest.fn(); - Reflect.getMetadata = jest.fn((key, target) => { + Reflect.defineMetadata = vi.fn(); + Reflect.getMetadata = vi.fn((key, target) => { if (key === JSON_API_DECORATOR_ENTITY && (target as any).entity) { return (target as any).entity; } diff --git a/libs/json-api/json-api-nestjs/tsconfig.lib.json b/libs/json-api/json-api-nestjs/tsconfig.lib.json index 0d157409..4de8955d 100644 --- a/libs/json-api/json-api-nestjs/tsconfig.lib.json +++ b/libs/json-api/json-api-nestjs/tsconfig.lib.json @@ -12,5 +12,5 @@ "noFallthroughCasesInSwitch": true, }, "include": ["src/**/*.ts"], - "exclude": ["jest.config.ts", "src/**/*.spec.ts", "src/**/*.test.ts", "src/**/*.test-d.ts", "src/lib/utils/___test___/**/*.ts"] + "exclude": ["src/**/*.spec.ts", "src/**/*.test.ts", "src/**/*.test-d.ts", "src/lib/utils/___test___/**/*.ts"] } diff --git a/libs/json-api/json-api-nestjs/tsconfig.spec.json b/libs/json-api/json-api-nestjs/tsconfig.spec.json index 807e943f..169abbcd 100644 --- a/libs/json-api/json-api-nestjs/tsconfig.spec.json +++ b/libs/json-api/json-api-nestjs/tsconfig.spec.json @@ -2,18 +2,30 @@ "extends": "./tsconfig.json", "compilerOptions": { "outDir": "../../../dist/out-tsc", - "module": "commonjs", - "moduleResolution": "node16", - "types": ["jest", "node"], - "paths": { - "@klerick/json-api-nestjs-shared": [ - "libs/json-api/json-api-nestjs-shared/src/index.ts" - ] - }, - "allowJs": true + "module": "ES2022", + "moduleResolution": "node10", + "experimentalDecorators": true, + "emitDecoratorMetadata": true, + "strictNullChecks": true, + "noImplicitAny": true, + "strictBindCallApply": true, + "forceConsistentCasingInFileNames": true, + "noFallthroughCasesInSwitch": true, + "types": [ + "vitest/globals", + "vitest/importMeta", + "vite/client", + "node", + "vitest" + ], + "allowSyntheticDefaultImports": true, + "esModuleInterop": true, }, "include": [ - "jest.config.ts", + "vite.config.ts", + "vite.config.mts", + "vitest.config.ts", + "vitest.config.mts", "src/**/*.test.ts", "src/**/*.spec.ts", "src/**/*.d.ts" diff --git a/libs/json-api/json-api-nestjs/vite.config.mts b/libs/json-api/json-api-nestjs/vite.config.mts new file mode 100644 index 00000000..299f1d36 --- /dev/null +++ b/libs/json-api/json-api-nestjs/vite.config.mts @@ -0,0 +1,45 @@ +/// +import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin'; + +import swc from 'unplugin-swc'; +import { defineConfig } from 'vite'; + +export default defineConfig(() => ({ + root: __dirname, + cacheDir: '../../../node_modules/.vite/libs/json-api-nestjs', + plugins: [ + nxViteTsPaths(), + swc.vite({ + module: { type: 'es6' }, + jsc: { + target: 'es2022', + parser: { + syntax: 'typescript', + decorators: true, + }, + transform: { + decoratorMetadata: true, + legacyDecorator: true, + }, + keepClassNames: true, + externalHelpers: true, + loose: true, + }, + }), + ], + test: { + name: 'json-api-nestjs', + watch: false, + globals: true, + environment: 'node', + include: ['{src,tests}/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'], + setupFiles: [], + reporters: ['default'], + coverage: { + enabled: true, + reporter: ['json'], + reportsDirectory: '../../../coverage/json-api-nestjs', + provider: 'v8' as const, + }, + }, +})); diff --git a/libs/json-rpc/nestjs-json-rpc-sdk/jest.config.ts b/libs/json-rpc/nestjs-json-rpc-sdk/jest.config.ts deleted file mode 100644 index 3ea00a7c..00000000 --- a/libs/json-rpc/nestjs-json-rpc-sdk/jest.config.ts +++ /dev/null @@ -1,11 +0,0 @@ -/* eslint-disable */ -export default { - displayName: 'nestjs-json-rpc-sdk', - preset: '../../../jest.preset.js', - testEnvironment: 'node', - transform: { - '^.+\\.[tj]s$': ['ts-jest', { tsconfig: '/tsconfig.spec.json' }], - }, - moduleFileExtensions: ['ts', 'js', 'html'], - coverageDirectory: '../../../coverage/libs/json-rpc/nestjs-json-rpc-sdk', -}; diff --git a/libs/json-rpc/nestjs-json-rpc-sdk/project.json b/libs/json-rpc/nestjs-json-rpc-sdk/project.json index f2f9152a..3bd07a18 100644 --- a/libs/json-rpc/nestjs-json-rpc-sdk/project.json +++ b/libs/json-rpc/nestjs-json-rpc-sdk/project.json @@ -10,21 +10,6 @@ "type:publish" ], "targets": { - "compile-for-angular": { - "executor": "@nx/angular:package", - "outputs": ["{workspaceRoot}/dist/{projectRoot}"], - "options": { - "project": "libs/json-rpc/nestjs-json-rpc-sdk/ng-package.json", - "tsConfig": "libs/json-rpc/nestjs-json-rpc-sdk/tsconfig-mjs.lib.json" - }, - "configurations": { - "production": { - "tsConfig": "libs/json-rpc/nestjs-json-rpc-sdk/tsconfig-mjs.lib.json" - }, - "development": {} - }, - "defaultConfiguration": "production" - }, "build": { "executor": "nx:run-commands", "dependsOn": ["build-cjs"], @@ -91,16 +76,6 @@ "options": { "packageRoot": "dist/libs/json-rpc/nestjs-json-rpc-sdk" } - }, - "test": { - "executor": "@nx/jest:jest", - "outputs": ["{workspaceRoot}/coverage/{projectRoot}"], - "options": { - "jestConfig": "libs/json-rpc/nestjs-json-rpc-sdk/jest.config.ts", - "codeCoverage": true, - "coverageReporters": ["json-summary"], - "tsConfig": "libs/json-rpc/nestjs-json-rpc-sdk/tsconfig.spec.json" - } } } } diff --git a/libs/json-rpc/nestjs-json-rpc-sdk/src/lib/utils/rpc-batch.spec.ts b/libs/json-rpc/nestjs-json-rpc-sdk/src/lib/utils/rpc-batch.spec.ts index fdb45b16..a3ac0348 100644 --- a/libs/json-rpc/nestjs-json-rpc-sdk/src/lib/utils/rpc-batch.spec.ts +++ b/libs/json-rpc/nestjs-json-rpc-sdk/src/lib/utils/rpc-batch.spec.ts @@ -1,11 +1,11 @@ import { RpcBatchFactory, RpcBatchFactoryPromise } from './rpc-batch'; import { WrapperCall } from './wrapper-call'; import { RpcError } from '../types'; -import { of } from 'rxjs'; +import { lastValueFrom, of } from 'rxjs'; describe('rpc-batch', () => { - it('RpcBatchFactory', (done) => { - const transport = jest.fn().mockImplementationOnce((data) => { + it('RpcBatchFactory', async () => { + const transport = vi.fn().mockImplementationOnce((data) => { expect(data.map((i: any) => i.id)).toEqual([1, 2, 3]); const errorObj = { error: { @@ -47,17 +47,17 @@ describe('rpc-batch', () => { transport ) as any; - rpcBatch(call3, call1, call2).subscribe((result) => { - const [r3, r1, r2] = result; - expect(r3).toBeInstanceOf(RpcError); - expect(r2).toEqual(call2.arg); - expect(r1).toEqual(call1.arg); - done(); - }); + const result = await lastValueFrom(rpcBatch(call3, call1, call2)) + const [r3, r1, r2] = result; + expect(r3).toBeInstanceOf(RpcError); + expect(r2).toEqual(call2.arg); + expect(r1).toEqual(call1.arg); + + }); it('RpcBatchFactoryPromise', async () => { - const transport = jest.fn().mockImplementationOnce((data) => { + const transport = vi.fn().mockImplementationOnce((data) => { expect(data.map((i: any) => i.id)).toEqual([4, 5, 6]); const errorObj = { error: { diff --git a/libs/json-rpc/nestjs-json-rpc-sdk/src/lib/utils/rpc-proxy.spec.ts b/libs/json-rpc/nestjs-json-rpc-sdk/src/lib/utils/rpc-proxy.spec.ts index 059634c6..933d2f40 100644 --- a/libs/json-rpc/nestjs-json-rpc-sdk/src/lib/utils/rpc-proxy.spec.ts +++ b/libs/json-rpc/nestjs-json-rpc-sdk/src/lib/utils/rpc-proxy.spec.ts @@ -15,14 +15,14 @@ describe('rpc-proxy', () => { it('should be return Observable', () => { const arg: [number, number] = [1, 2]; const resultRpc = 1; - const transport = jest.fn().mockImplementationOnce((data) => ({ + const transport = vi.fn().mockImplementationOnce((data) => ({ result: resultRpc, id: data.id, })) as Transport; const usePromise = false; const rpc = rpcProxy>(transport, usePromise); - expect(rpc).toHaveProperty('TestRpc'); - expect(rpc.TestRpc).toHaveProperty('test'); + expect(rpc.TestRpc).not.toBe(undefined); + expect(rpc.TestRpc.test).not.toBe(undefined); const result = rpc.TestRpc.test(...arg); expect(result).toBeInstanceOf(Observable); }); @@ -30,7 +30,7 @@ describe('rpc-proxy', () => { it('should be return Promise', async () => { const arg: [number, number] = [1, 2]; const resultRpc = 1; - const transport = jest.fn().mockImplementationOnce((data) => + const transport = vi.fn().mockImplementationOnce((data) => of({ result: resultRpc, id: data.id, @@ -38,8 +38,8 @@ describe('rpc-proxy', () => { ) as Transport; const usePromise = true; const rpc = rpcProxy>(transport, usePromise); - expect(rpc).toHaveProperty('TestRpc'); - expect(rpc.TestRpc).toHaveProperty('test'); + expect(rpc.TestRpc).not.toBe(undefined); + expect(rpc.TestRpc.test).not.toBe(undefined); const result = rpc.TestRpc.test(...arg); expect(result).toBeInstanceOf(Promise); const resultRpcCheck = await result; diff --git a/libs/json-rpc/nestjs-json-rpc-sdk/src/lib/utils/wrapper-call.spec.ts b/libs/json-rpc/nestjs-json-rpc-sdk/src/lib/utils/wrapper-call.spec.ts index c258529c..4d007463 100644 --- a/libs/json-rpc/nestjs-json-rpc-sdk/src/lib/utils/wrapper-call.spec.ts +++ b/libs/json-rpc/nestjs-json-rpc-sdk/src/lib/utils/wrapper-call.spec.ts @@ -1,6 +1,6 @@ import { WrapperCall } from './wrapper-call'; import { Transport } from '../types'; -import { of } from 'rxjs'; +import { lastValueFrom, of } from 'rxjs'; function mockRPC(a: number, b: string): number { return 1; @@ -18,22 +18,16 @@ describe('wrapper-call', () => { arg = [1, 'test']; }); - it('should be init Observable', (done) => { + it('should be init Observable', async () => { const result = { result: 'result' }; - transport = jest.fn().mockImplementationOnce((input) => { + transport = vi.fn().mockImplementationOnce((input) => { return of(result); }); expect.assertions(2); const instWrapperCall = new WrapperCall(nameSpace, method, arg, transport); - instWrapperCall.subscribe({ - next: (r) => { - expect(r).toEqual(result.result); - }, - complete: () => { - expect(transport).toHaveBeenCalledWith(instWrapperCall.body); - done(); - }, - error: (err) => done(err), - }); + const r = await lastValueFrom(instWrapperCall); + expect(r).toEqual(result.result); + expect(transport).toHaveBeenCalledWith(instWrapperCall.body); + }); }); diff --git a/libs/json-rpc/nestjs-json-rpc-sdk/tsconfig-mjs.lib.json b/libs/json-rpc/nestjs-json-rpc-sdk/tsconfig-mjs.lib.json index aede39b0..fbc9e966 100644 --- a/libs/json-rpc/nestjs-json-rpc-sdk/tsconfig-mjs.lib.json +++ b/libs/json-rpc/nestjs-json-rpc-sdk/tsconfig-mjs.lib.json @@ -9,7 +9,7 @@ "moduleResolution": "bundler" }, "include": ["src/**/*.ts"], - "exclude": ["jest.config.ts", "src/**/*.spec.ts", "src/**/*.test.ts"], + "exclude": ["src/**/*.spec.ts", "src/**/*.test.ts"], "angularCompilerOptions": { "compilationMode": "partial", "enableI18nLegacyMessageIdFormat": false, diff --git a/libs/json-rpc/nestjs-json-rpc-sdk/tsconfig.lib.json b/libs/json-rpc/nestjs-json-rpc-sdk/tsconfig.lib.json index 81ec818a..104d1b27 100644 --- a/libs/json-rpc/nestjs-json-rpc-sdk/tsconfig.lib.json +++ b/libs/json-rpc/nestjs-json-rpc-sdk/tsconfig.lib.json @@ -6,5 +6,5 @@ "types": ["node"] }, "include": ["src/**/*.ts"], - "exclude": ["jest.config.ts", "src/**/*.spec.ts", "src/**/*.test.ts"] + "exclude": ["src/**/*.spec.ts", "src/**/*.test.ts"] } diff --git a/libs/json-rpc/nestjs-json-rpc-sdk/tsconfig.spec.json b/libs/json-rpc/nestjs-json-rpc-sdk/tsconfig.spec.json index f87838c3..169abbcd 100644 --- a/libs/json-rpc/nestjs-json-rpc-sdk/tsconfig.spec.json +++ b/libs/json-rpc/nestjs-json-rpc-sdk/tsconfig.spec.json @@ -2,12 +2,30 @@ "extends": "./tsconfig.json", "compilerOptions": { "outDir": "../../../dist/out-tsc", - "module": "commonjs", - "types": ["jest", "node"], - "moduleResolution": "bundler" + "module": "ES2022", + "moduleResolution": "node10", + "experimentalDecorators": true, + "emitDecoratorMetadata": true, + "strictNullChecks": true, + "noImplicitAny": true, + "strictBindCallApply": true, + "forceConsistentCasingInFileNames": true, + "noFallthroughCasesInSwitch": true, + "types": [ + "vitest/globals", + "vitest/importMeta", + "vite/client", + "node", + "vitest" + ], + "allowSyntheticDefaultImports": true, + "esModuleInterop": true, }, "include": [ - "jest.config.ts", + "vite.config.ts", + "vite.config.mts", + "vitest.config.ts", + "vitest.config.mts", "src/**/*.test.ts", "src/**/*.spec.ts", "src/**/*.d.ts" diff --git a/libs/json-rpc/nestjs-json-rpc-sdk/vite.config.mts b/libs/json-rpc/nestjs-json-rpc-sdk/vite.config.mts new file mode 100644 index 00000000..a4c39565 --- /dev/null +++ b/libs/json-rpc/nestjs-json-rpc-sdk/vite.config.mts @@ -0,0 +1,45 @@ +/// +import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin'; + +import swc from 'unplugin-swc'; +import { defineConfig } from 'vite'; + +export default defineConfig(() => ({ + root: __dirname, + cacheDir: '../../../node_modules/.vite/libs/nestjs-json-rpc-sdk', + plugins: [ + nxViteTsPaths(), + swc.vite({ + module: { type: 'es6' }, + jsc: { + target: 'es2022', + parser: { + syntax: 'typescript', + decorators: true, + }, + transform: { + decoratorMetadata: true, + legacyDecorator: true, + }, + keepClassNames: true, + externalHelpers: true, + loose: true, + }, + }), + ], + test: { + name: 'nestjs-json-rpc-sdk', + watch: false, + globals: true, + environment: 'node', + include: ['{src,tests}/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'], + setupFiles: [], + reporters: ['default'], + coverage: { + enabled: true, + reporter: ['json'], + reportsDirectory: '../../../coverage/nestjs-json-rpc-sdk', + provider: 'v8' as const, + }, + }, +})); diff --git a/libs/json-rpc/nestjs-json-rpc/jest.config.ts b/libs/json-rpc/nestjs-json-rpc/jest.config.ts deleted file mode 100644 index f77fba82..00000000 --- a/libs/json-rpc/nestjs-json-rpc/jest.config.ts +++ /dev/null @@ -1,11 +0,0 @@ -/* eslint-disable */ -export default { - displayName: 'nestjs-json-rpc', - preset: '../../../jest.preset.js', - testEnvironment: 'node', - transform: { - '^.+\\.[tj]s$': ['ts-jest', { tsconfig: '/tsconfig.spec.json' }], - }, - moduleFileExtensions: ['ts', 'js', 'html'], - coverageDirectory: '../../../coverage/libs/json-rpc/nestjs-json-rpc', -}; diff --git a/libs/json-rpc/nestjs-json-rpc/project.json b/libs/json-rpc/nestjs-json-rpc/project.json index cc17c471..4e2fe856 100644 --- a/libs/json-rpc/nestjs-json-rpc/project.json +++ b/libs/json-rpc/nestjs-json-rpc/project.json @@ -22,15 +22,6 @@ "command": "node tools/scripts/publish.mjs nestjs-json-rpc {args.ver} {args.tag}", "dependsOn": ["build"] }, - "test": { - "executor": "@nx/jest:jest", - "outputs": ["{workspaceRoot}/coverage/{projectRoot}"], - "options": { - "jestConfig": "libs/json-rpc/nestjs-json-rpc/jest.config.ts", - "codeCoverage": true, - "coverageReporters": ["json-summary"] - } - }, "upload-badge": { "executor": "nx:run-commands", "dependsOn": [ diff --git a/libs/json-rpc/nestjs-json-rpc/src/lib/modules/http-transport/controllers/json-rpc.controller.spec.ts b/libs/json-rpc/nestjs-json-rpc/src/lib/modules/http-transport/controllers/json-rpc.controller.spec.ts index 6b9d59ee..61c09016 100644 --- a/libs/json-rpc/nestjs-json-rpc/src/lib/modules/http-transport/controllers/json-rpc.controller.spec.ts +++ b/libs/json-rpc/nestjs-json-rpc/src/lib/modules/http-transport/controllers/json-rpc.controller.spec.ts @@ -31,7 +31,7 @@ describe('json-rpc.controller', () => { spaceName: 'test', }, }; - const spyHandlerServiceCallHandler = jest + const spyHandlerServiceCallHandler = vi .spyOn(handlerService, 'callHandler') .mockResolvedValue(result as any); const resultController = jsonRpcController.handler(input as any); diff --git a/libs/json-rpc/nestjs-json-rpc/src/lib/modules/http-transport/filter/rpc-error-exception.filter.spec.ts b/libs/json-rpc/nestjs-json-rpc/src/lib/modules/http-transport/filter/rpc-error-exception.filter.spec.ts index e4b95dec..5b7bafc8 100644 --- a/libs/json-rpc/nestjs-json-rpc/src/lib/modules/http-transport/filter/rpc-error-exception.filter.spec.ts +++ b/libs/json-rpc/nestjs-json-rpc/src/lib/modules/http-transport/filter/rpc-error-exception.filter.spec.ts @@ -35,7 +35,7 @@ describe('rpc-error-exception.filter', () => { ErrorCodeType.InvalidRequest, 'InvalidRequest' ); - const spySend = jest.spyOn(response, 'send'); + const spySend = vi.spyOn(response, 'send'); filter.catch(exception, argumentsHost); expect(spySend).toHaveBeenCalledWith( fromRpcErrorToRpcErrorObject(exception) @@ -45,7 +45,7 @@ describe('rpc-error-exception.filter', () => { it('should catch Error and transform it to RpcErrorObject', () => { const filter = new RpcErrorExceptionFilter(); const exception = new Error('Test Error'); - const spySend = jest.spyOn(response, 'send'); + const spySend = vi.spyOn(response, 'send'); filter.catch(exception, argumentsHost); expect(spySend).toHaveBeenCalledWith( fromRpcErrorToRpcErrorObject( diff --git a/libs/json-rpc/nestjs-json-rpc/src/lib/modules/util/service/handler.service.spec.ts b/libs/json-rpc/nestjs-json-rpc/src/lib/modules/util/service/handler.service.spec.ts index 1a4f90c9..d56721a0 100644 --- a/libs/json-rpc/nestjs-json-rpc/src/lib/modules/util/service/handler.service.spec.ts +++ b/libs/json-rpc/nestjs-json-rpc/src/lib/modules/util/service/handler.service.spec.ts @@ -44,7 +44,7 @@ describe('handler.service', () => { it('Should be result', async () => { const params = ['1', '2']; const jsonrpc = '2.0'; - const handlerServiceCallHandlerSpy = jest + const handlerServiceCallHandlerSpy = vi .spyOn(handlerService, 'callHandler') .mockResolvedValue({ jsonrpc, @@ -93,7 +93,7 @@ describe('handler.service', () => { }, ]; let i = 0; - const handlerServiceCallHandlerSpy = jest + const handlerServiceCallHandlerSpy = vi .spyOn(handlerService, 'callHandler') .mockImplementation(() => { return Promise.resolve({ @@ -123,7 +123,7 @@ describe('handler.service', () => { const jsonrpc = '2.0'; const title = 'Title Error'; const description = 'Describe Error'; - const handlerServiceCallHandlerSpy = jest + const handlerServiceCallHandlerSpy = vi .spyOn(handlerService, 'callHandler') .mockRejectedValue( createError(ErrorCodeType.InvalidRequest, title, description) @@ -153,7 +153,7 @@ describe('handler.service', () => { const params = ['1', '2']; const jsonrpc = '2.0'; const title = 'Title Error'; - const handlerServiceCallHandlerSpy = jest + const handlerServiceCallHandlerSpy = vi .spyOn(handlerService, 'callHandler') .mockRejectedValue(new Error(title)); const rpcData: PayloadRpcData = { @@ -327,8 +327,8 @@ describe('handler.service', () => { }); it('should return the pipe from pipe type has in provider', async () => { - const moduleRefGetSoy = jest.spyOn(moduleRef, 'get'); - const moduleRefCreateSoy = jest.spyOn(moduleRef, 'create'); + const moduleRefGetSoy = vi.spyOn(moduleRef, 'get'); + const moduleRefCreateSoy = vi.spyOn(moduleRef, 'create'); const result = await handlerService.getPipeByType(ParseIntPipe); expect(result).toBeInstanceOf(ParseIntPipe); expect(moduleRefCreateSoy).toHaveBeenCalledTimes(0); @@ -336,8 +336,8 @@ describe('handler.service', () => { }); it('should return the pipe from pipe type has not in provider', async () => { - const moduleRefGetSoy = jest.spyOn(moduleRef, 'get'); - const moduleRefCreateSoy = jest.spyOn(moduleRef, 'create'); + const moduleRefGetSoy = vi.spyOn(moduleRef, 'get'); + const moduleRefCreateSoy = vi.spyOn(moduleRef, 'create'); const result = await handlerService.getPipeByType(ParseBoolPipe); expect(result).toBeInstanceOf(ParseBoolPipe); expect(moduleRefCreateSoy).toHaveBeenCalledTimes(1); @@ -345,8 +345,8 @@ describe('handler.service', () => { }); it('should return the pipe from pipe type has not in provider twice', async () => { - const moduleRefGetSoy = jest.spyOn(moduleRef, 'get'); - const moduleRefCreateSoy = jest.spyOn(moduleRef, 'create'); + const moduleRefGetSoy = vi.spyOn(moduleRef, 'get'); + const moduleRefCreateSoy = vi.spyOn(moduleRef, 'create'); const result = await handlerService.getPipeByType(ParseBoolPipe); expect(result).toBeInstanceOf(ParseBoolPipe); const result2 = await handlerService.getPipeByType(ParseBoolPipe); diff --git a/libs/json-rpc/nestjs-json-rpc/src/lib/modules/util/util.module.spec.ts b/libs/json-rpc/nestjs-json-rpc/src/lib/modules/util/util.module.spec.ts index b27de31b..c2fcf47d 100644 --- a/libs/json-rpc/nestjs-json-rpc/src/lib/modules/util/util.module.spec.ts +++ b/libs/json-rpc/nestjs-json-rpc/src/lib/modules/util/util.module.spec.ts @@ -22,7 +22,7 @@ describe('Check util module', () => { }); it('onApplicationBootstrap', async () => { - jest + vi .spyOn(explorerService, 'explore') .mockReturnValue([TestClass, Test2Class]); utilModule.onApplicationBootstrap(); diff --git a/libs/json-rpc/nestjs-json-rpc/src/lib/modules/ws-socket-transport/filter/rpc-ws-error-exception.filter.spec.ts b/libs/json-rpc/nestjs-json-rpc/src/lib/modules/ws-socket-transport/filter/rpc-ws-error-exception.filter.spec.ts index 9ea44a8a..2844a559 100644 --- a/libs/json-rpc/nestjs-json-rpc/src/lib/modules/ws-socket-transport/filter/rpc-ws-error-exception.filter.spec.ts +++ b/libs/json-rpc/nestjs-json-rpc/src/lib/modules/ws-socket-transport/filter/rpc-ws-error-exception.filter.spec.ts @@ -46,7 +46,7 @@ describe('rpc-ws-error-exception.filter', () => { 'InvalidRequest' ); - const spySend = jest.spyOn(WebSocketInst, 'send').mockImplementation(); + const spySend = vi.spyOn(WebSocketInst, 'send').mockImplementation(() => true); filter.catch(exception, argumentsHost); expect(spySend).toHaveBeenCalledWith( JSON.stringify({ @@ -59,7 +59,7 @@ describe('rpc-ws-error-exception.filter', () => { it('should catch Error and transform it to RpcErrorObject', () => { const filter = new RpcWsErrorExceptionFilter(); const exception = new Error('Test Error'); - const spySend = jest.spyOn(WebSocketInst, 'send').mockImplementation(); + const spySend = vi.spyOn(WebSocketInst, 'send').mockImplementation(() => true); filter.catch(exception, argumentsHost); expect(spySend).toHaveBeenCalledWith( JSON.stringify({ @@ -109,7 +109,7 @@ describe('rpc-ws-error-exception.filter', () => { 'InvalidRequest' ); - const spySend = jest.spyOn(WebSocketInst, 'emit').mockImplementation(); + const spySend = vi.spyOn(WebSocketInst, 'emit').mockImplementation(() => true); filter.catch(exception, argumentsHost); expect(spySend).toHaveBeenCalledWith( WS_EVENT_NAME, @@ -120,7 +120,7 @@ describe('rpc-ws-error-exception.filter', () => { it('should catch Error and transform it to RpcErrorObject', () => { const filter = new RpcWsErrorExceptionFilter(); const exception = new Error('Test Error'); - const spySend = jest.spyOn(WebSocketInst, 'emit').mockImplementation(); + const spySend = vi.spyOn(WebSocketInst, 'emit').mockImplementation(() => true); filter.catch(exception, argumentsHost); expect(spySend).toHaveBeenCalledWith( WS_EVENT_NAME, diff --git a/libs/json-rpc/nestjs-json-rpc/tsconfig.lib.json b/libs/json-rpc/nestjs-json-rpc/tsconfig.lib.json index dbf54fd7..11030679 100644 --- a/libs/json-rpc/nestjs-json-rpc/tsconfig.lib.json +++ b/libs/json-rpc/nestjs-json-rpc/tsconfig.lib.json @@ -12,5 +12,5 @@ "noFallthroughCasesInSwitch": true }, "include": ["src/**/*.ts"], - "exclude": ["jest.config.ts", "src/**/*.spec.ts", "src/**/*.test.ts"] + "exclude": ["src/**/*.spec.ts", "src/**/*.test.ts"] } diff --git a/libs/json-rpc/nestjs-json-rpc/tsconfig.spec.json b/libs/json-rpc/nestjs-json-rpc/tsconfig.spec.json index 69a251f3..169abbcd 100644 --- a/libs/json-rpc/nestjs-json-rpc/tsconfig.spec.json +++ b/libs/json-rpc/nestjs-json-rpc/tsconfig.spec.json @@ -2,11 +2,30 @@ "extends": "./tsconfig.json", "compilerOptions": { "outDir": "../../../dist/out-tsc", - "module": "commonjs", - "types": ["jest", "node"] + "module": "ES2022", + "moduleResolution": "node10", + "experimentalDecorators": true, + "emitDecoratorMetadata": true, + "strictNullChecks": true, + "noImplicitAny": true, + "strictBindCallApply": true, + "forceConsistentCasingInFileNames": true, + "noFallthroughCasesInSwitch": true, + "types": [ + "vitest/globals", + "vitest/importMeta", + "vite/client", + "node", + "vitest" + ], + "allowSyntheticDefaultImports": true, + "esModuleInterop": true, }, "include": [ - "jest.config.ts", + "vite.config.ts", + "vite.config.mts", + "vitest.config.ts", + "vitest.config.mts", "src/**/*.test.ts", "src/**/*.spec.ts", "src/**/*.d.ts" diff --git a/libs/json-rpc/nestjs-json-rpc/vite.config.mts b/libs/json-rpc/nestjs-json-rpc/vite.config.mts new file mode 100644 index 00000000..78b0989a --- /dev/null +++ b/libs/json-rpc/nestjs-json-rpc/vite.config.mts @@ -0,0 +1,45 @@ +/// +import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin'; + +import swc from 'unplugin-swc'; +import { defineConfig } from 'vite'; + +export default defineConfig(() => ({ + root: __dirname, + cacheDir: '../../../node_modules/.vite/libs/nestjs-json-rpc', + plugins: [ + nxViteTsPaths(), + swc.vite({ + module: { type: 'es6' }, + jsc: { + target: 'es2022', + parser: { + syntax: 'typescript', + decorators: true, + }, + transform: { + decoratorMetadata: true, + legacyDecorator: true, + }, + keepClassNames: true, + externalHelpers: true, + loose: true, + }, + }), + ], + test: { + name: 'nestjs-json-rpc', + watch: false, + globals: true, + environment: 'node', + include: ['{src,tests}/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'], + setupFiles: [], + reporters: ['default'], + coverage: { + enabled: true, + reporter: ['json'], + reportsDirectory: '../../../coverage/nestjs-json-rpc', + provider: 'v8' as const, + }, + }, +})); diff --git a/libs/microorm-database/jest.config.ts b/libs/microorm-database/jest.config.ts deleted file mode 100644 index 2f7137c0..00000000 --- a/libs/microorm-database/jest.config.ts +++ /dev/null @@ -1,10 +0,0 @@ -export default { - displayName: 'microorm-database', - preset: '../../jest.preset.js', - testEnvironment: 'node', - transform: { - '^.+\\.[tj]s$': ['ts-jest', { tsconfig: '/tsconfig.spec.json' }], - }, - moduleFileExtensions: ['ts', 'js', 'html'], - coverageDirectory: '../../coverage/libs/microorm-database', -}; diff --git a/libs/microorm-database/tsconfig.lib.json b/libs/microorm-database/tsconfig.lib.json index c297a248..aca1dbc4 100644 --- a/libs/microorm-database/tsconfig.lib.json +++ b/libs/microorm-database/tsconfig.lib.json @@ -12,5 +12,5 @@ "noFallthroughCasesInSwitch": true }, "include": ["src/**/*.ts"], - "exclude": ["jest.config.ts", "src/**/*.spec.ts", "src/**/*.test.ts"] + "exclude": ["src/**/*.spec.ts", "src/**/*.test.ts"] } diff --git a/libs/microorm-database/tsconfig.spec.json b/libs/microorm-database/tsconfig.spec.json deleted file mode 100644 index 0d3c604e..00000000 --- a/libs/microorm-database/tsconfig.spec.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "outDir": "../../dist/out-tsc", - "module": "commonjs", - "moduleResolution": "node10", - "types": ["jest", "node"] - }, - "include": [ - "jest.config.ts", - "src/**/*.test.ts", - "src/**/*.spec.ts", - "src/**/*.d.ts" - ] -} diff --git a/libs/type-for-rpc/jest.config.ts b/libs/type-for-rpc/jest.config.ts deleted file mode 100644 index d5f4a6af..00000000 --- a/libs/type-for-rpc/jest.config.ts +++ /dev/null @@ -1,11 +0,0 @@ -/* eslint-disable */ -export default { - displayName: 'type-for-rpc', - preset: '../../jest.preset.js', - testEnvironment: 'node', - transform: { - '^.+\\.[tj]s$': ['ts-jest', { tsconfig: '/tsconfig.spec.json' }], - }, - moduleFileExtensions: ['ts', 'js', 'html'], - coverageDirectory: '../../coverage/libs/type-for-rpc', -}; diff --git a/libs/type-for-rpc/project.json b/libs/type-for-rpc/project.json index 4dc6fb00..29b8ca1d 100644 --- a/libs/type-for-rpc/project.json +++ b/libs/type-for-rpc/project.json @@ -4,16 +4,6 @@ "sourceRoot": "libs/type-for-rpc/src", "projectType": "library", "targets": { - "build": { - "executor": "@nx/js:tsc", - "outputs": ["{options.outputPath}"], - "options": { - "outputPath": "dist/libs/type-for-rpc", - "main": "libs/type-for-rpc/src/index.ts", - "tsConfig": "libs/type-for-rpc/tsconfig.lib.json", - "assets": ["libs/type-for-rpc/*.md"] - } - } }, "tags": [] } diff --git a/libs/type-for-rpc/tsconfig.lib.json b/libs/type-for-rpc/tsconfig.lib.json index 33eca2c2..faa09cc1 100644 --- a/libs/type-for-rpc/tsconfig.lib.json +++ b/libs/type-for-rpc/tsconfig.lib.json @@ -6,5 +6,5 @@ "types": ["node"] }, "include": ["src/**/*.ts"], - "exclude": ["jest.config.ts", "src/**/*.spec.ts", "src/**/*.test.ts"] + "exclude": ["src/**/*.spec.ts", "src/**/*.test.ts"] } diff --git a/libs/type-for-rpc/tsconfig.spec.json b/libs/type-for-rpc/tsconfig.spec.json index 9b2a121d..169abbcd 100644 --- a/libs/type-for-rpc/tsconfig.spec.json +++ b/libs/type-for-rpc/tsconfig.spec.json @@ -1,12 +1,31 @@ { "extends": "./tsconfig.json", "compilerOptions": { - "outDir": "../../dist/out-tsc", - "module": "commonjs", - "types": ["jest", "node"] + "outDir": "../../../dist/out-tsc", + "module": "ES2022", + "moduleResolution": "node10", + "experimentalDecorators": true, + "emitDecoratorMetadata": true, + "strictNullChecks": true, + "noImplicitAny": true, + "strictBindCallApply": true, + "forceConsistentCasingInFileNames": true, + "noFallthroughCasesInSwitch": true, + "types": [ + "vitest/globals", + "vitest/importMeta", + "vite/client", + "node", + "vitest" + ], + "allowSyntheticDefaultImports": true, + "esModuleInterop": true, }, "include": [ - "jest.config.ts", + "vite.config.ts", + "vite.config.mts", + "vitest.config.ts", + "vitest.config.mts", "src/**/*.test.ts", "src/**/*.spec.ts", "src/**/*.d.ts" diff --git a/libs/type-for-rpc/vite.config.mts b/libs/type-for-rpc/vite.config.mts new file mode 100644 index 00000000..6214443b --- /dev/null +++ b/libs/type-for-rpc/vite.config.mts @@ -0,0 +1,46 @@ +/// +import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin'; + +import swc from 'unplugin-swc'; +import { defineConfig } from 'vite'; + +export default defineConfig(() => ({ + root: __dirname, + cacheDir: '../../../node_modules/.vite/libs/type-for-rpc', + plugins: [ + nxViteTsPaths(), + swc.vite({ + module: { type: 'es6' }, + jsc: { + target: 'es2022', + parser: { + syntax: 'typescript', + decorators: true, + }, + transform: { + decoratorMetadata: true, + legacyDecorator: true, + }, + keepClassNames: true, + externalHelpers: true, + loose: true, + }, + }), + ], + test: { + name: 'type-for-rpc', + watch: false, + globals: true, + environment: 'node', + include: ['{src,tests}/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'], + setupFiles: [], + reporters: ['default'], + passWithNoTests: true, + coverage: { + enabled: false, + reporter: ['json'], + reportsDirectory: '../../coverage/type-for-rpc', + provider: 'v8' as const, + }, + }, +})); diff --git a/libs/typeorm-database/jest.config.ts b/libs/typeorm-database/jest.config.ts deleted file mode 100644 index f4c0c3b5..00000000 --- a/libs/typeorm-database/jest.config.ts +++ /dev/null @@ -1,11 +0,0 @@ -/* eslint-disable */ -export default { - displayName: 'typeorm-database', - preset: '../../jest.preset.js', - testEnvironment: 'node', - transform: { - '^.+\\.[tj]s$': ['ts-jest', { tsconfig: '/tsconfig.spec.json' }], - }, - moduleFileExtensions: ['ts', 'js', 'html'], - coverageDirectory: '../../coverage/libs/typeorm-database', -}; diff --git a/libs/typeorm-database/src/lib/config-cli.ts b/libs/typeorm-database/src/lib/config-cli.ts index 9ca9bd1b..b2709439 100644 --- a/libs/typeorm-database/src/lib/config-cli.ts +++ b/libs/typeorm-database/src/lib/config-cli.ts @@ -2,6 +2,8 @@ import { DataSource, DataSourceOptions } from 'typeorm'; import { join } from 'path'; import * as process from 'process'; +const isTest = process.env['NODE_ENV'] === 'test' || process.env['VITEST'] === 'true'; + const configPg: DataSourceOptions = { type: process.env['DB_TYPE'] as 'mysql' | 'postgres', host: process.env['DB_HOST'], @@ -10,7 +12,7 @@ const configPg: DataSourceOptions = { password: process.env['DB_PASSWORD'], database: process.env['DB_NAME'], logging: process.env['DB_LOGGING'] === '1', - migrations: [join(__dirname, '/migrations/**/*{.ts,.js}')], + migrations: isTest ? [] : [join(__dirname, '/migrations/**/*{.ts,.js}')], entities: [join(__dirname, '/entities/**/*{.ts,.js}')], ...(process.env['DB_TYPE'] === 'mysql' ? { connectorPackage: 'mysql2' } : {}), }; @@ -23,7 +25,7 @@ const configMysql: DataSourceOptions = { password: process.env['DB_PASSWORD'], database: process.env['DB_NAME'], logging: process.env['DB_LOGGING'] === '1', - migrations: [join(__dirname, '/migrations-mysql/**/*{.ts,.js}')], + migrations: isTest ? [] : [join(__dirname, '/migrations-mysql/**/*{.ts,.js}')], entities: [join(__dirname, '/entities-mysql/**/*{.ts,.js}')], connectorPackage: 'mysql2', }; diff --git a/libs/typeorm-database/tsconfig.lib.json b/libs/typeorm-database/tsconfig.lib.json index 33eca2c2..faa09cc1 100644 --- a/libs/typeorm-database/tsconfig.lib.json +++ b/libs/typeorm-database/tsconfig.lib.json @@ -6,5 +6,5 @@ "types": ["node"] }, "include": ["src/**/*.ts"], - "exclude": ["jest.config.ts", "src/**/*.spec.ts", "src/**/*.test.ts"] + "exclude": ["src/**/*.spec.ts", "src/**/*.test.ts"] } diff --git a/libs/typeorm-database/tsconfig.spec.json b/libs/typeorm-database/tsconfig.spec.json deleted file mode 100644 index 9b2a121d..00000000 --- a/libs/typeorm-database/tsconfig.spec.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "outDir": "../../dist/out-tsc", - "module": "commonjs", - "types": ["jest", "node"] - }, - "include": [ - "jest.config.ts", - "src/**/*.test.ts", - "src/**/*.spec.ts", - "src/**/*.d.ts" - ] -} diff --git a/nx.json b/nx.json index 495e0a2a..58c159ea 100644 --- a/nx.json +++ b/nx.json @@ -30,9 +30,17 @@ } }, { - "plugin": "@nx/jest/plugin", + "plugin": "@nx/vite/plugin", "options": { - "targetName": "test" + "buildTargetName": "build", + "testTargetName": "test", + "serveTargetName": "serve", + "devTargetName": "dev", + "previewTargetName": "preview", + "serveStaticTargetName": "serve-static", + "typecheckTargetName": "typecheck", + "buildDepsTargetName": "build-deps", + "watchDepsTargetName": "watch-deps" } } ], @@ -48,7 +56,13 @@ "inputs": ["production", "^production"] }, "test": { - "cache": true + "cache": true, + "executor": "@nx/vite:test", + "options": { + "reportsDirectory": "{projectRoot}/coverage", + "codeCoverage": true, + "coverageReporters": ["json-summary"] + } }, "@nx/angular:ng-packagr-lite": { "cache": true, @@ -131,13 +145,12 @@ } }, "projectsRelationship": "independent", - "projects": "tag:type:publish", + "projects": ["tag:type:publish", "test"], "version": { "preVersionCommand": "npx nx run-many --projects=tag:type:publish --target=build --parallel", "conventionalCommits": true, - "generatorOptions": { - "fallbackCurrentVersionResolver": "disk" - } + "fallbackCurrentVersionResolver": "disk", + "preserveLocalDependencyProtocols": false }, "releaseTagPattern": "{projectName}@{version}" }, diff --git a/package-lock.json b/package-lock.json index 267b97d9..e5a3e696 100644 --- a/package-lock.json +++ b/package-lock.json @@ -70,11 +70,11 @@ "@nx/angular": "21.6.2", "@nx/eslint": "21.6.2", "@nx/eslint-plugin": "21.6.2", - "@nx/jest": "21.6.2", "@nx/js": "21.6.2", "@nx/nest": "21.6.2", "@nx/node": "21.6.2", "@nx/plugin": "^21.6.2", + "@nx/vite": "^21.6.2", "@nx/web": "21.6.2", "@nx/webpack": "21.6.2", "@nx/workspace": "21.6.2", @@ -83,20 +83,19 @@ "@swc/cli": "~0.6.0", "@swc/core": "1.11.7", "@swc/helpers": "0.5.15", - "@types/jest": "29.5.12", "@types/node": "20.19.9", "@types/uuid": "^9.0.8", "@typescript-eslint/eslint-plugin": "7.18.0", "@typescript-eslint/parser": "7.18.0", "@typescript-eslint/utils": "7.18.0", + "@vitest/coverage-v8": "^3.2.4", + "@vitest/ui": "^3.0.0", + "ajv": "^8.0.0", "autoprefixer": "^10.4.0", "eslint": "8.57.0", "eslint-config-prettier": "10.1.5", - "jest": "29.7.0", - "jest-environment-jsdom": "29.7.0", - "jest-environment-node": "^29.7.0", - "jest-preset-angular": "14.6.1", - "jest-util": "^29.7.0", + "jiti": "2.4.2", + "jsdom": "~22.1.0", "jsonc-eslint-parser": "^2.1.0", "knex-pglite": "^0.11.0", "ng-packagr": "20.3.0", @@ -106,12 +105,15 @@ "postcss-url": "~10.1.3", "prettier": "^2.6.2", "rollup": "^4.14.0", - "ts-jest": "29.4.5", "ts-node": "10.9.1", "tsd": "^0.31.2", "typeorm-pglite": "^0.3.2", "typescript": "5.9.3", + "unplugin-swc": "^1.5.7", "verdaccio": "6.0.5", + "vite": "^7.0.0", + "vite-plugin-dts": "~4.5.0", + "vitest": "^3.0.0", "webpack-cli": "^5.1.4" }, "engines": { @@ -5154,11 +5156,6 @@ "js-yaml": "bin/js-yaml.js" } }, - "node_modules/@istanbuljs/load-nyc-config/node_modules/sprintf-js": { - "version": "1.0.3", - "dev": true, - "license": "BSD-3-Clause" - }, "node_modules/@istanbuljs/schema": { "version": "0.1.3", "dev": true, @@ -5190,98 +5187,6 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/@jest/console": { - "version": "29.7.0", - "dev": true, - "license": "MIT", - "dependencies": { - "@jest/types": "^29.6.3", - "@types/node": "*", - "chalk": "^4.0.0", - "jest-message-util": "^29.7.0", - "jest-util": "^29.7.0", - "slash": "^3.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/@jest/console/node_modules/chalk": { - "version": "4.1.2", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/@jest/core": { - "version": "29.7.0", - "dev": true, - "license": "MIT", - "dependencies": { - "@jest/console": "^29.7.0", - "@jest/reporters": "^29.7.0", - "@jest/test-result": "^29.7.0", - "@jest/transform": "^29.7.0", - "@jest/types": "^29.6.3", - "@types/node": "*", - "ansi-escapes": "^4.2.1", - "chalk": "^4.0.0", - "ci-info": "^3.2.0", - "exit": "^0.1.2", - "graceful-fs": "^4.2.9", - "jest-changed-files": "^29.7.0", - "jest-config": "^29.7.0", - "jest-haste-map": "^29.7.0", - "jest-message-util": "^29.7.0", - "jest-regex-util": "^29.6.3", - "jest-resolve": "^29.7.0", - "jest-resolve-dependencies": "^29.7.0", - "jest-runner": "^29.7.0", - "jest-runtime": "^29.7.0", - "jest-snapshot": "^29.7.0", - "jest-util": "^29.7.0", - "jest-validate": "^29.7.0", - "jest-watcher": "^29.7.0", - "micromatch": "^4.0.4", - "pretty-format": "^29.7.0", - "slash": "^3.0.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - }, - "peerDependencies": { - "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" - }, - "peerDependenciesMeta": { - "node-notifier": { - "optional": true - } - } - }, - "node_modules/@jest/core/node_modules/chalk": { - "version": "4.1.2", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, "node_modules/@jest/diff-sequences": { "version": "30.0.1", "resolved": "https://registry.npmjs.org/@jest/diff-sequences/-/diff-sequences-30.0.1.tgz", @@ -5291,59 +5196,6 @@ "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, - "node_modules/@jest/environment": { - "version": "29.7.0", - "dev": true, - "license": "MIT", - "dependencies": { - "@jest/fake-timers": "^29.7.0", - "@jest/types": "^29.6.3", - "@types/node": "*", - "jest-mock": "^29.7.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/@jest/expect": { - "version": "29.7.0", - "dev": true, - "license": "MIT", - "dependencies": { - "expect": "^29.7.0", - "jest-snapshot": "^29.7.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/@jest/expect-utils": { - "version": "29.7.0", - "dev": true, - "license": "MIT", - "dependencies": { - "jest-get-type": "^29.6.3" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/@jest/fake-timers": { - "version": "29.7.0", - "dev": true, - "license": "MIT", - "dependencies": { - "@jest/types": "^29.6.3", - "@sinonjs/fake-timers": "^10.0.2", - "@types/node": "*", - "jest-message-util": "^29.7.0", - "jest-mock": "^29.7.0", - "jest-util": "^29.7.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, "node_modules/@jest/get-type": { "version": "30.1.0", "resolved": "https://registry.npmjs.org/@jest/get-type/-/get-type-30.1.0.tgz", @@ -5353,20 +5205,6 @@ "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, - "node_modules/@jest/globals": { - "version": "29.7.0", - "dev": true, - "license": "MIT", - "dependencies": { - "@jest/environment": "^29.7.0", - "@jest/expect": "^29.7.0", - "@jest/types": "^29.6.3", - "jest-mock": "^29.7.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, "node_modules/@jest/pattern": { "version": "30.0.1", "resolved": "https://registry.npmjs.org/@jest/pattern/-/pattern-30.0.1.tgz", @@ -5391,63 +5229,6 @@ "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, - "node_modules/@jest/reporters": { - "version": "29.7.0", - "dev": true, - "license": "MIT", - "dependencies": { - "@bcoe/v8-coverage": "^0.2.3", - "@jest/console": "^29.7.0", - "@jest/test-result": "^29.7.0", - "@jest/transform": "^29.7.0", - "@jest/types": "^29.6.3", - "@jridgewell/trace-mapping": "^0.3.18", - "@types/node": "*", - "chalk": "^4.0.0", - "collect-v8-coverage": "^1.0.0", - "exit": "^0.1.2", - "glob": "^7.1.3", - "graceful-fs": "^4.2.9", - "istanbul-lib-coverage": "^3.0.0", - "istanbul-lib-instrument": "^6.0.0", - "istanbul-lib-report": "^3.0.0", - "istanbul-lib-source-maps": "^4.0.0", - "istanbul-reports": "^3.1.3", - "jest-message-util": "^29.7.0", - "jest-util": "^29.7.0", - "jest-worker": "^29.7.0", - "slash": "^3.0.0", - "string-length": "^4.0.1", - "strip-ansi": "^6.0.0", - "v8-to-istanbul": "^9.0.1" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - }, - "peerDependencies": { - "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" - }, - "peerDependenciesMeta": { - "node-notifier": { - "optional": true - } - } - }, - "node_modules/@jest/reporters/node_modules/chalk": { - "version": "4.1.2", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, "node_modules/@jest/schemas": { "version": "29.6.3", "dev": true, @@ -5531,92 +5312,6 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/@jest/source-map": { - "version": "29.6.3", - "dev": true, - "license": "MIT", - "dependencies": { - "@jridgewell/trace-mapping": "^0.3.18", - "callsites": "^3.0.0", - "graceful-fs": "^4.2.9" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/@jest/test-result": { - "version": "29.7.0", - "dev": true, - "license": "MIT", - "dependencies": { - "@jest/console": "^29.7.0", - "@jest/types": "^29.6.3", - "@types/istanbul-lib-coverage": "^2.0.0", - "collect-v8-coverage": "^1.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/@jest/test-sequencer": { - "version": "29.7.0", - "dev": true, - "license": "MIT", - "dependencies": { - "@jest/test-result": "^29.7.0", - "graceful-fs": "^4.2.9", - "jest-haste-map": "^29.7.0", - "slash": "^3.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/@jest/transform": { - "version": "29.7.0", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/core": "^7.11.6", - "@jest/types": "^29.6.3", - "@jridgewell/trace-mapping": "^0.3.18", - "babel-plugin-istanbul": "^6.1.1", - "chalk": "^4.0.0", - "convert-source-map": "^2.0.0", - "fast-json-stable-stringify": "^2.1.0", - "graceful-fs": "^4.2.9", - "jest-haste-map": "^29.7.0", - "jest-regex-util": "^29.6.3", - "jest-util": "^29.7.0", - "micromatch": "^4.0.4", - "pirates": "^4.0.4", - "slash": "^3.0.0", - "write-file-atomic": "^4.0.2" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/@jest/transform/node_modules/chalk": { - "version": "4.1.2", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/@jest/transform/node_modules/convert-source-map": { - "version": "2.0.0", - "dev": true, - "license": "MIT" - }, "node_modules/@jest/types": { "version": "29.6.3", "dev": true, @@ -5756,6 +5451,17 @@ "@jridgewell/trace-mapping": "^0.3.24" } }, + "node_modules/@jridgewell/remapping": { + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/remapping/-/remapping-2.3.5.tgz", + "integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, "node_modules/@jridgewell/resolve-uri": { "version": "3.1.2", "devOptional": true, @@ -6037,10 +5743,381 @@ "node": ">=8" } }, + "node_modules/@microsoft/api-extractor": { + "version": "7.53.1", + "resolved": "https://registry.npmjs.org/@microsoft/api-extractor/-/api-extractor-7.53.1.tgz", + "integrity": "sha512-bul5eTNxijLdDBqLye74u9494sRmf+9QULtec9Od0uHnifahGeNt8CC4/xCdn7mVyEBrXIQyQ5+sc4Uc0QfBSA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@microsoft/api-extractor-model": "7.31.1", + "@microsoft/tsdoc": "~0.15.1", + "@microsoft/tsdoc-config": "~0.17.1", + "@rushstack/node-core-library": "5.17.0", + "@rushstack/rig-package": "0.6.0", + "@rushstack/terminal": "0.19.1", + "@rushstack/ts-command-line": "5.1.1", + "lodash": "~4.17.15", + "minimatch": "10.0.3", + "resolve": "~1.22.1", + "semver": "~7.5.4", + "source-map": "~0.6.1", + "typescript": "5.8.2" + }, + "bin": { + "api-extractor": "bin/api-extractor" + } + }, + "node_modules/@microsoft/api-extractor-model": { + "version": "7.31.1", + "resolved": "https://registry.npmjs.org/@microsoft/api-extractor-model/-/api-extractor-model-7.31.1.tgz", + "integrity": "sha512-Dhnip5OFKbl85rq/ICHBFGhV4RA5UQSl8AC/P/zoGvs+CBudPkatt5kIhMGiYgVPnUWmfR6fcp38+1AFLYNtUw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@microsoft/tsdoc": "~0.15.1", + "@microsoft/tsdoc-config": "~0.17.1", + "@rushstack/node-core-library": "5.17.0" + } + }, + "node_modules/@microsoft/api-extractor-model/node_modules/@rushstack/node-core-library": { + "version": "5.17.0", + "resolved": "https://registry.npmjs.org/@rushstack/node-core-library/-/node-core-library-5.17.0.tgz", + "integrity": "sha512-24vt1GbHN6kyIglRMTVpyEiNRRRJK8uZHc1XoGAhmnTDKnrWet8OmOpImMswJIe6gM78eV8cMg1HXwuUHkSSgg==", + "dev": true, + "license": "MIT", + "dependencies": { + "ajv": "~8.13.0", + "ajv-draft-04": "~1.0.0", + "ajv-formats": "~3.0.1", + "fs-extra": "~11.3.0", + "import-lazy": "~4.0.0", + "jju": "~1.4.0", + "resolve": "~1.22.1", + "semver": "~7.5.4" + }, + "peerDependencies": { + "@types/node": "*" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + } + } + }, + "node_modules/@microsoft/api-extractor-model/node_modules/ajv": { + "version": "8.13.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.13.0.tgz", + "integrity": "sha512-PRA911Blj99jR5RMeTunVbNXMF6Lp4vZXnk5GQjcnUWUTsrXtekg/pnmFFI2u/I36Y/2bITGS30GZCXei6uNkA==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.3", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.4.1" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/@microsoft/api-extractor-model/node_modules/ajv-formats": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-3.0.1.tgz", + "integrity": "sha512-8iUql50EUR+uUcdRQ3HDqa6EVyo3docL8g5WJ3FNcWmu62IbkGUue/pEyLBW8VGKKucTPgqeks4fIU1DA4yowQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ajv": "^8.0.0" + }, + "peerDependencies": { + "ajv": "^8.0.0" + }, + "peerDependenciesMeta": { + "ajv": { + "optional": true + } + } + }, + "node_modules/@microsoft/api-extractor-model/node_modules/fs-extra": { + "version": "11.3.2", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.3.2.tgz", + "integrity": "sha512-Xr9F6z6up6Ws+NjzMCZc6WXg2YFRlrLP9NQDO3VQrWrfiojdhS56TzueT88ze0uBdCTwEIhQ3ptnmKeWGFAe0A==", + "dev": true, + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=14.14" + } + }, + "node_modules/@microsoft/api-extractor-model/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "license": "ISC", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@microsoft/api-extractor-model/node_modules/semver": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "dev": true, + "license": "ISC", + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@microsoft/api-extractor-model/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true, + "license": "ISC" + }, + "node_modules/@microsoft/api-extractor/node_modules/@rushstack/node-core-library": { + "version": "5.17.0", + "resolved": "https://registry.npmjs.org/@rushstack/node-core-library/-/node-core-library-5.17.0.tgz", + "integrity": "sha512-24vt1GbHN6kyIglRMTVpyEiNRRRJK8uZHc1XoGAhmnTDKnrWet8OmOpImMswJIe6gM78eV8cMg1HXwuUHkSSgg==", + "dev": true, + "license": "MIT", + "dependencies": { + "ajv": "~8.13.0", + "ajv-draft-04": "~1.0.0", + "ajv-formats": "~3.0.1", + "fs-extra": "~11.3.0", + "import-lazy": "~4.0.0", + "jju": "~1.4.0", + "resolve": "~1.22.1", + "semver": "~7.5.4" + }, + "peerDependencies": { + "@types/node": "*" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + } + } + }, + "node_modules/@microsoft/api-extractor/node_modules/@rushstack/terminal": { + "version": "0.19.1", + "resolved": "https://registry.npmjs.org/@rushstack/terminal/-/terminal-0.19.1.tgz", + "integrity": "sha512-jsBuSad67IDVMO2yp0hDfs0OdE4z3mDIjIL2pclDT3aEJboeZXE85e1HjuD0F6JoW3XgHvDwoX+WOV+AVTDQeA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@rushstack/node-core-library": "5.17.0", + "@rushstack/problem-matcher": "0.1.1", + "supports-color": "~8.1.1" + }, + "peerDependencies": { + "@types/node": "*" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + } + } + }, + "node_modules/@microsoft/api-extractor/node_modules/@rushstack/ts-command-line": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/@rushstack/ts-command-line/-/ts-command-line-5.1.1.tgz", + "integrity": "sha512-HPzFsUcr+wZ3oQI08Ec/E6cuiAVHKzrXZGHhwiwIGygAFiqN5QzX+ff30n70NU2WyE26CykgMwBZZSSyHCJrzA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@rushstack/terminal": "0.19.1", + "@types/argparse": "1.0.38", + "argparse": "~1.0.9", + "string-argv": "~0.3.1" + } + }, + "node_modules/@microsoft/api-extractor/node_modules/ajv": { + "version": "8.13.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.13.0.tgz", + "integrity": "sha512-PRA911Blj99jR5RMeTunVbNXMF6Lp4vZXnk5GQjcnUWUTsrXtekg/pnmFFI2u/I36Y/2bITGS30GZCXei6uNkA==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.3", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.4.1" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/@microsoft/api-extractor/node_modules/ajv-formats": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-3.0.1.tgz", + "integrity": "sha512-8iUql50EUR+uUcdRQ3HDqa6EVyo3docL8g5WJ3FNcWmu62IbkGUue/pEyLBW8VGKKucTPgqeks4fIU1DA4yowQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ajv": "^8.0.0" + }, + "peerDependencies": { + "ajv": "^8.0.0" + }, + "peerDependenciesMeta": { + "ajv": { + "optional": true + } + } + }, + "node_modules/@microsoft/api-extractor/node_modules/argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "license": "MIT", + "dependencies": { + "sprintf-js": "~1.0.2" + } + }, + "node_modules/@microsoft/api-extractor/node_modules/fs-extra": { + "version": "11.3.2", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.3.2.tgz", + "integrity": "sha512-Xr9F6z6up6Ws+NjzMCZc6WXg2YFRlrLP9NQDO3VQrWrfiojdhS56TzueT88ze0uBdCTwEIhQ3ptnmKeWGFAe0A==", + "dev": true, + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=14.14" + } + }, + "node_modules/@microsoft/api-extractor/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "license": "ISC", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@microsoft/api-extractor/node_modules/minimatch": { + "version": "10.0.3", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.0.3.tgz", + "integrity": "sha512-IPZ167aShDZZUMdRk66cyQAW3qr0WzbHkPdMYa8bzZhlHhO3jALbKdxcaak7W9FfT2rZNpQuUu4Od7ILEpXSaw==", + "dev": true, + "license": "ISC", + "dependencies": { + "@isaacs/brace-expansion": "^5.0.0" + }, + "engines": { + "node": "20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@microsoft/api-extractor/node_modules/semver": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "dev": true, + "license": "ISC", + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@microsoft/api-extractor/node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/@microsoft/api-extractor/node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/@microsoft/api-extractor/node_modules/typescript": { + "version": "5.8.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.2.tgz", + "integrity": "sha512-aJn6wq13/afZp/jT9QZmwEjDqqvSGp1VT5GVg+f/t6/oVyrgXM6BY1h9BRh/O5p3PlUPAe+WuiEZOmb/49RqoQ==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/@microsoft/api-extractor/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true, + "license": "ISC" + }, "node_modules/@microsoft/tsdoc": { "version": "0.15.1", "license": "MIT" }, + "node_modules/@microsoft/tsdoc-config": { + "version": "0.17.1", + "resolved": "https://registry.npmjs.org/@microsoft/tsdoc-config/-/tsdoc-config-0.17.1.tgz", + "integrity": "sha512-UtjIFe0C6oYgTnad4q1QP4qXwLhe6tIpNTRStJ2RZEPIkqQPREAwE5spzVxsdn9UaEMUqhh0AqSx3X4nWAKXWw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@microsoft/tsdoc": "0.15.1", + "ajv": "~8.12.0", + "jju": "~1.4.0", + "resolve": "~1.22.2" + } + }, "node_modules/@mikro-orm/cli": { "version": "6.4.3", "license": "MIT", @@ -11253,6 +11330,28 @@ } } }, + "node_modules/@nx/vite": { + "version": "21.6.2", + "resolved": "https://registry.npmjs.org/@nx/vite/-/vite-21.6.2.tgz", + "integrity": "sha512-b862hJN9Fx+DsqM+NUQBfXCJew4Xv6x7LNRTaQI2EW8WwFsYjVVonub2hFfwptndJttVaaRt+9J3f+zxkDH03w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@nx/devkit": "21.6.2", + "@nx/js": "21.6.2", + "@phenomnomnominal/tsquery": "~5.0.1", + "ajv": "^8.0.0", + "enquirer": "~2.3.6", + "picomatch": "4.0.2", + "semver": "^7.6.3", + "tsconfig-paths": "^4.1.2", + "tslib": "^2.3.0" + }, + "peerDependencies": { + "vite": "^5.0.0 || ^6.0.0 || ^7.0.0", + "vitest": "^1.3.1 || ^2.0.0 || ^3.0.0" + } + }, "node_modules/@nx/web": { "version": "21.6.2", "resolved": "https://registry.npmjs.org/@nx/web/-/web-21.6.2.tgz", @@ -11889,6 +11988,13 @@ "url": "https://opencollective.com/pkgr" } }, + "node_modules/@polka/url": { + "version": "1.0.0-next.29", + "resolved": "https://registry.npmjs.org/@polka/url/-/url-1.0.0-next.29.tgz", + "integrity": "sha512-wwQAWhWSuHaag8c4q/KN/vCoeOJYshAIvMQwD4GpSb3OiZklFfvAgmj0VCBBImRpuF/aFgIRzllXlVX93Jevww==", + "dev": true, + "license": "MIT" + }, "node_modules/@rollup/plugin-json": { "version": "6.1.0", "dev": true, @@ -11909,13 +12015,15 @@ } }, "node_modules/@rollup/pluginutils": { - "version": "5.1.0", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.3.0.tgz", + "integrity": "sha512-5EdhGZtnu3V88ces7s53hhfK5KSASnJZv8Lulpc04cWO3REESroJXg73DFsOmgbU2BhwV0E20bu2IDZb3VKW4Q==", "dev": true, "license": "MIT", "dependencies": { "@types/estree": "^1.0.0", "estree-walker": "^2.0.2", - "picomatch": "^2.3.1" + "picomatch": "^4.0.2" }, "engines": { "node": ">=14.0.0" @@ -11929,17 +12037,6 @@ } } }, - "node_modules/@rollup/pluginutils/node_modules/picomatch": { - "version": "2.3.1", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8.6" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, "node_modules/@rollup/rollup-android-arm-eabi": { "version": "4.52.3", "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.52.3.tgz", @@ -12761,6 +12858,32 @@ "version": "4.0.0", "license": "ISC" }, + "node_modules/@rushstack/problem-matcher": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@rushstack/problem-matcher/-/problem-matcher-0.1.1.tgz", + "integrity": "sha512-Fm5XtS7+G8HLcJHCWpES5VmeMyjAKaWeyZU5qPzZC+22mPlJzAsOxymHiWIfuirtPckX3aptWws+K2d0BzniJA==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "@types/node": "*" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + } + } + }, + "node_modules/@rushstack/rig-package": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/@rushstack/rig-package/-/rig-package-0.6.0.tgz", + "integrity": "sha512-ZQmfzsLE2+Y91GF15c65L/slMRVhF6Hycq04D4TwtdGaUAbIXXg9c5pKA5KFU7M4QMaihoobp9JJYpYcaY3zOw==", + "dev": true, + "license": "MIT", + "dependencies": { + "resolve": "~1.22.1", + "strip-json-comments": "~3.1.1" + } + }, "node_modules/@rushstack/terminal": { "version": "0.14.5", "license": "MIT", @@ -12807,10 +12930,6 @@ "sprintf-js": "~1.0.2" } }, - "node_modules/@rushstack/ts-command-line/node_modules/sprintf-js": { - "version": "1.0.3", - "license": "BSD-3-Clause" - }, "node_modules/@scarf/scarf": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/@scarf/scarf/-/scarf-1.4.0.tgz", @@ -12950,14 +13069,6 @@ "type-detect": "4.0.8" } }, - "node_modules/@sinonjs/fake-timers": { - "version": "10.3.0", - "dev": true, - "license": "BSD-3-Clause", - "dependencies": { - "@sinonjs/commons": "^3.0.0" - } - }, "node_modules/@socket.io/component-emitter": { "version": "3.1.0", "license": "MIT" @@ -13527,6 +13638,16 @@ "@types/node": "*" } }, + "node_modules/@types/chai": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-5.2.2.tgz", + "integrity": "sha512-8kB30R7Hwqf40JPiKhVzodJs2Qc1ZJ5zuT3uzw5Hq/dhNCl3G3l83jfpdI1e20BP348+fV7VIL/+FxaXkqBmWg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/deep-eql": "*" + } + }, "node_modules/@types/connect": { "version": "3.4.38", "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.38.tgz", @@ -13555,6 +13676,13 @@ "@types/node": "*" } }, + "node_modules/@types/deep-eql": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@types/deep-eql/-/deep-eql-4.0.2.tgz", + "integrity": "sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==", + "dev": true, + "license": "MIT" + }, "node_modules/@types/eslint": { "version": "9.6.1", "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-9.6.1.tgz", @@ -13608,14 +13736,6 @@ "@types/send": "*" } }, - "node_modules/@types/graceful-fs": { - "version": "4.1.9", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/node": "*" - } - }, "node_modules/@types/http-cache-semantics": { "version": "4.0.4", "resolved": "https://registry.npmjs.org/@types/http-cache-semantics/-/http-cache-semantics-4.0.4.tgz", @@ -13661,36 +13781,6 @@ "@types/istanbul-lib-report": "*" } }, - "node_modules/@types/jest": { - "version": "29.5.12", - "dev": true, - "license": "MIT", - "dependencies": { - "expect": "^29.0.0", - "pretty-format": "^29.0.0" - } - }, - "node_modules/@types/jsdom": { - "version": "20.0.1", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/node": "*", - "@types/tough-cookie": "*", - "parse5": "^7.0.0" - } - }, - "node_modules/@types/jsdom/node_modules/parse5": { - "version": "7.1.2", - "dev": true, - "license": "MIT", - "dependencies": { - "entities": "^4.4.0" - }, - "funding": { - "url": "https://github.com/inikulin/parse5?sponsor=1" - } - }, "node_modules/@types/json-schema": { "version": "7.0.15", "dev": true, @@ -13823,11 +13913,6 @@ "dev": true, "license": "MIT" }, - "node_modules/@types/tough-cookie": { - "version": "4.0.5", - "dev": true, - "license": "MIT" - }, "node_modules/@types/uuid": { "version": "9.0.8", "dev": true, @@ -15241,6 +15326,402 @@ "vite": "^6.0.0 || ^7.0.0" } }, + "node_modules/@vitest/coverage-v8": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/@vitest/coverage-v8/-/coverage-v8-3.2.4.tgz", + "integrity": "sha512-EyF9SXU6kS5Ku/U82E259WSnvg6c8KTjppUncuNdm5QHpe17mwREHnjDzozC8x9MZ0xfBUFSaLkRv4TMA75ALQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@ampproject/remapping": "^2.3.0", + "@bcoe/v8-coverage": "^1.0.2", + "ast-v8-to-istanbul": "^0.3.3", + "debug": "^4.4.1", + "istanbul-lib-coverage": "^3.2.2", + "istanbul-lib-report": "^3.0.1", + "istanbul-lib-source-maps": "^5.0.6", + "istanbul-reports": "^3.1.7", + "magic-string": "^0.30.17", + "magicast": "^0.3.5", + "std-env": "^3.9.0", + "test-exclude": "^7.0.1", + "tinyrainbow": "^2.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "@vitest/browser": "3.2.4", + "vitest": "3.2.4" + }, + "peerDependenciesMeta": { + "@vitest/browser": { + "optional": true + } + } + }, + "node_modules/@vitest/coverage-v8/node_modules/@bcoe/v8-coverage": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-1.0.2.tgz", + "integrity": "sha512-6zABk/ECA/QYSCQ1NGiVwwbQerUCZ+TQbp64Q3AgmfNvurHH0j8TtXa1qbShXA6qqkpAj4V5W8pP6mLe1mcMqA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/@vitest/coverage-v8/node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/@vitest/coverage-v8/node_modules/glob": { + "version": "10.4.5", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", + "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", + "dev": true, + "license": "ISC", + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^1.11.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@vitest/coverage-v8/node_modules/istanbul-lib-source-maps": { + "version": "5.0.6", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-5.0.6.tgz", + "integrity": "sha512-yg2d+Em4KizZC5niWhQaIomgf5WlL4vOOjZ5xGCmF8SnPE/mDWWXgvRExdcpCgh9lLRRa1/fSYp2ymmbJ1pI+A==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.23", + "debug": "^4.1.1", + "istanbul-lib-coverage": "^3.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@vitest/coverage-v8/node_modules/jackspeak": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", + "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "@isaacs/cliui": "^8.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "optionalDependencies": { + "@pkgjs/parseargs": "^0.11.0" + } + }, + "node_modules/@vitest/coverage-v8/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@vitest/coverage-v8/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@vitest/coverage-v8/node_modules/test-exclude": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-7.0.1.tgz", + "integrity": "sha512-pFYqmTw68LXVjeWJMST4+borgQP2AyMNbg1BpZh9LbyhUeNkeaPF9gzfPGUAnSMV3qPYdWUwDIjjCLiSDOl7vg==", + "dev": true, + "license": "ISC", + "dependencies": { + "@istanbuljs/schema": "^0.1.2", + "glob": "^10.4.1", + "minimatch": "^9.0.4" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@vitest/expect": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-3.2.4.tgz", + "integrity": "sha512-Io0yyORnB6sikFlt8QW5K7slY4OjqNX9jmJQ02QDda8lyM6B5oNgVWoSoKPac8/kgnCUzuHQKrSLtu/uOqqrig==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/chai": "^5.2.2", + "@vitest/spy": "3.2.4", + "@vitest/utils": "3.2.4", + "chai": "^5.2.0", + "tinyrainbow": "^2.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/mocker": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-3.2.4.tgz", + "integrity": "sha512-46ryTE9RZO/rfDd7pEqFl7etuyzekzEhUbTW3BvmeO/BcCMEgq59BKhek3dXDWgAj4oMK6OZi+vRr1wPW6qjEQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/spy": "3.2.4", + "estree-walker": "^3.0.3", + "magic-string": "^0.30.17" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "msw": "^2.4.9", + "vite": "^5.0.0 || ^6.0.0 || ^7.0.0-0" + }, + "peerDependenciesMeta": { + "msw": { + "optional": true + }, + "vite": { + "optional": true + } + } + }, + "node_modules/@vitest/mocker/node_modules/estree-walker": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", + "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0" + } + }, + "node_modules/@vitest/pretty-format": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-3.2.4.tgz", + "integrity": "sha512-IVNZik8IVRJRTr9fxlitMKeJeXFFFN0JaB9PHPGQ8NKQbGpfjlTx9zO4RefN8gp7eqjNy8nyK3NZmBzOPeIxtA==", + "dev": true, + "license": "MIT", + "dependencies": { + "tinyrainbow": "^2.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/runner": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-3.2.4.tgz", + "integrity": "sha512-oukfKT9Mk41LreEW09vt45f8wx7DordoWUZMYdY/cyAk7w5TWkTRCNZYF7sX7n2wB7jyGAl74OxgwhPgKaqDMQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/utils": "3.2.4", + "pathe": "^2.0.3", + "strip-literal": "^3.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/snapshot": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-3.2.4.tgz", + "integrity": "sha512-dEYtS7qQP2CjU27QBC5oUOxLE/v5eLkGqPE0ZKEIDGMs4vKWe7IjgLOeauHsR0D5YuuycGRO5oSRXnwnmA78fQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/pretty-format": "3.2.4", + "magic-string": "^0.30.17", + "pathe": "^2.0.3" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/spy": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-3.2.4.tgz", + "integrity": "sha512-vAfasCOe6AIK70iP5UD11Ac4siNUNJ9i/9PZ3NKx07sG6sUxeag1LWdNrMWeKKYBLlzuK+Gn65Yd5nyL6ds+nw==", + "dev": true, + "license": "MIT", + "dependencies": { + "tinyspy": "^4.0.3" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/ui": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/@vitest/ui/-/ui-3.2.4.tgz", + "integrity": "sha512-hGISOaP18plkzbWEcP/QvtRW1xDXF2+96HbEX6byqQhAUbiS5oH6/9JwW+QsQCIYON2bI6QZBF+2PvOmrRZ9wA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/utils": "3.2.4", + "fflate": "^0.8.2", + "flatted": "^3.3.3", + "pathe": "^2.0.3", + "sirv": "^3.0.1", + "tinyglobby": "^0.2.14", + "tinyrainbow": "^2.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "vitest": "3.2.4" + } + }, + "node_modules/@vitest/utils": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-3.2.4.tgz", + "integrity": "sha512-fB2V0JFrQSMsCo9HiSq3Ezpdv4iYaXRG1Sx8edX3MwxfyNn83mKiGzOcH+Fkxt4MHxr3y42fQi1oeAInqgX2QA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/pretty-format": "3.2.4", + "loupe": "^3.1.4", + "tinyrainbow": "^2.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@volar/language-core": { + "version": "2.4.23", + "resolved": "https://registry.npmjs.org/@volar/language-core/-/language-core-2.4.23.tgz", + "integrity": "sha512-hEEd5ET/oSmBC6pi1j6NaNYRWoAiDhINbT8rmwtINugR39loROSlufGdYMF9TaKGfz+ViGs1Idi3mAhnuPcoGQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@volar/source-map": "2.4.23" + } + }, + "node_modules/@volar/source-map": { + "version": "2.4.23", + "resolved": "https://registry.npmjs.org/@volar/source-map/-/source-map-2.4.23.tgz", + "integrity": "sha512-Z1Uc8IB57Lm6k7q6KIDu/p+JWtf3xsXJqAX/5r18hYOTpJyBn0KXUR8oTJ4WFYOcDzWC9n3IflGgHowx6U6z9Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/@volar/typescript": { + "version": "2.4.23", + "resolved": "https://registry.npmjs.org/@volar/typescript/-/typescript-2.4.23.tgz", + "integrity": "sha512-lAB5zJghWxVPqfcStmAP1ZqQacMpe90UrP5RJ3arDyrhy4aCUQqmxPPLB2PWDKugvylmO41ljK7vZ+t6INMTag==", + "dev": true, + "license": "MIT", + "dependencies": { + "@volar/language-core": "2.4.23", + "path-browserify": "^1.0.1", + "vscode-uri": "^3.0.8" + } + }, + "node_modules/@vue/compiler-core": { + "version": "3.5.22", + "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.5.22.tgz", + "integrity": "sha512-jQ0pFPmZwTEiRNSb+i9Ow/I/cHv2tXYqsnHKKyCQ08irI2kdF5qmYedmF8si8mA7zepUFmJ2hqzS8CQmNOWOkQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.28.4", + "@vue/shared": "3.5.22", + "entities": "^4.5.0", + "estree-walker": "^2.0.2", + "source-map-js": "^1.2.1" + } + }, + "node_modules/@vue/compiler-dom": { + "version": "3.5.22", + "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.5.22.tgz", + "integrity": "sha512-W8RknzUM1BLkypvdz10OVsGxnMAuSIZs9Wdx1vzA3mL5fNMN15rhrSCLiTm6blWeACwUwizzPVqGJgOGBEN/hA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vue/compiler-core": "3.5.22", + "@vue/shared": "3.5.22" + } + }, + "node_modules/@vue/compiler-vue2": { + "version": "2.7.16", + "resolved": "https://registry.npmjs.org/@vue/compiler-vue2/-/compiler-vue2-2.7.16.tgz", + "integrity": "sha512-qYC3Psj9S/mfu9uVi5WvNZIzq+xnXMhOwbTFKKDD7b1lhpnn71jXSFdTQ+WsIEk0ONCd7VV2IMm7ONl6tbQ86A==", + "dev": true, + "license": "MIT", + "dependencies": { + "de-indent": "^1.0.2", + "he": "^1.2.0" + } + }, + "node_modules/@vue/language-core": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@vue/language-core/-/language-core-2.2.0.tgz", + "integrity": "sha512-O1ZZFaaBGkKbsRfnVH1ifOK1/1BUkyK+3SQsfnh6PmMmD4qJcTU8godCeA96jjDRTL6zgnK7YzCHfaUlH2r0Mw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@volar/language-core": "~2.4.11", + "@vue/compiler-dom": "^3.5.0", + "@vue/compiler-vue2": "^2.7.16", + "@vue/shared": "^3.5.0", + "alien-signals": "^0.4.9", + "minimatch": "^9.0.3", + "muggle-string": "^0.4.1", + "path-browserify": "^1.0.1" + }, + "peerDependencies": { + "typescript": "*" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@vue/shared": { + "version": "3.5.22", + "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.5.22.tgz", + "integrity": "sha512-F4yc6palwq3TT0u+FYf0Ns4Tfl9GRFURDN2gWG7L1ecIaS/4fCIuFOjMTnCyjsu/OK6vaDKLCrGAa+KvvH+h4w==", + "dev": true, + "license": "MIT" + }, "node_modules/@webassemblyjs/ast": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.14.1.tgz", @@ -15678,12 +16159,6 @@ "js-yaml": "bin/js-yaml.js" } }, - "node_modules/@yarnpkg/parsers/node_modules/sprintf-js": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", - "license": "BSD-3-Clause" - }, "node_modules/@zkochan/js-yaml": { "version": "0.0.7", "resolved": "https://registry.npmjs.org/@zkochan/js-yaml/-/js-yaml-0.0.7.tgz", @@ -15698,6 +16173,9 @@ }, "node_modules/abab": { "version": "2.0.6", + "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.6.tgz", + "integrity": "sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA==", + "deprecated": "Use your platform's native atob() and btoa() methods instead", "dev": true, "license": "BSD-3-Clause" }, @@ -15747,15 +16225,6 @@ "node": ">=0.4.0" } }, - "node_modules/acorn-globals": { - "version": "7.0.1", - "dev": true, - "license": "MIT", - "dependencies": { - "acorn": "^8.1.0", - "acorn-walk": "^8.0.2" - } - }, "node_modules/acorn-import-phases": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/acorn-import-phases/-/acorn-import-phases-1.0.4.tgz", @@ -15919,6 +16388,13 @@ "node": ">= 14.0.0" } }, + "node_modules/alien-signals": { + "version": "0.4.14", + "resolved": "https://registry.npmjs.org/alien-signals/-/alien-signals-0.4.14.tgz", + "integrity": "sha512-itUAVzhczTmP2U5yX67xVpsbbOiquusbWVyA9N+sy6+r6YVbFkahXvNCeEPWEOMhwDYwbVbGHFkVL03N9I5g+Q==", + "dev": true, + "license": "MIT" + }, "node_modules/ansi-colors": { "version": "4.1.3", "license": "MIT", @@ -16104,6 +16580,45 @@ "node": ">=0.8" } }, + "node_modules/assertion-error": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-2.0.1.tgz", + "integrity": "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + } + }, + "node_modules/ast-v8-to-istanbul": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/ast-v8-to-istanbul/-/ast-v8-to-istanbul-0.3.5.tgz", + "integrity": "sha512-9SdXjNheSiE8bALAQCQQuT6fgQaoxJh7IRYrRGZ8/9nv8WhJeC1aXAwN8TbaOssGOukUvyvnkgD9+Yuykvl1aA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.30", + "estree-walker": "^3.0.3", + "js-tokens": "^9.0.1" + } + }, + "node_modules/ast-v8-to-istanbul/node_modules/estree-walker": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", + "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0" + } + }, + "node_modules/ast-v8-to-istanbul/node_modules/js-tokens": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-9.0.1.tgz", + "integrity": "sha512-mxa9E9ITFOt0ban3j6L5MpjwegGz6lBQmM1IJkWeBZGcMxto50+eWdjC/52xDbS2vy0k7vIMK0Fe2wfL9OQSpQ==", + "dev": true, + "license": "MIT" + }, "node_modules/async": { "version": "3.2.6", "resolved": "https://registry.npmjs.org/async/-/async-3.2.6.tgz", @@ -16215,41 +16730,6 @@ "integrity": "sha512-OnAYlL5b7LEkALw87fUVafQw5rVR9RjwGd4KUwNQ6DrrNmaVaUCgLipfVlzrPQ4tWOR9P0IXGNOx50jYCCdSJg==", "dev": true }, - "node_modules/babel-jest": { - "version": "29.7.0", - "dev": true, - "license": "MIT", - "dependencies": { - "@jest/transform": "^29.7.0", - "@types/babel__core": "^7.1.14", - "babel-plugin-istanbul": "^6.1.1", - "babel-preset-jest": "^29.6.3", - "chalk": "^4.0.0", - "graceful-fs": "^4.2.9", - "slash": "^3.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - }, - "peerDependencies": { - "@babel/core": "^7.8.0" - } - }, - "node_modules/babel-jest/node_modules/chalk": { - "version": "4.1.2", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, "node_modules/babel-loader": { "version": "10.0.0", "resolved": "https://registry.npmjs.org/babel-loader/-/babel-loader-10.0.0.tgz", @@ -16329,58 +16809,6 @@ "@babel/core": "^7.0.0-0" } }, - "node_modules/babel-plugin-istanbul": { - "version": "6.1.1", - "dev": true, - "license": "BSD-3-Clause", - "dependencies": { - "@babel/helper-plugin-utils": "^7.0.0", - "@istanbuljs/load-nyc-config": "^1.0.0", - "@istanbuljs/schema": "^0.1.2", - "istanbul-lib-instrument": "^5.0.4", - "test-exclude": "^6.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/babel-plugin-istanbul/node_modules/istanbul-lib-instrument": { - "version": "5.2.1", - "dev": true, - "license": "BSD-3-Clause", - "dependencies": { - "@babel/core": "^7.12.3", - "@babel/parser": "^7.14.7", - "@istanbuljs/schema": "^0.1.2", - "istanbul-lib-coverage": "^3.2.0", - "semver": "^6.3.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/babel-plugin-istanbul/node_modules/semver": { - "version": "6.3.1", - "dev": true, - "license": "ISC", - "bin": { - "semver": "bin/semver.js" - } - }, - "node_modules/babel-plugin-jest-hoist": { - "version": "29.6.3", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/template": "^7.3.3", - "@babel/types": "^7.3.3", - "@types/babel__core": "^7.1.14", - "@types/babel__traverse": "^7.0.6" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, "node_modules/babel-plugin-macros": { "version": "3.1.0", "dev": true, @@ -16482,21 +16910,6 @@ "@babel/core": "^7.0.0 || ^8.0.0-0" } }, - "node_modules/babel-preset-jest": { - "version": "29.6.3", - "dev": true, - "license": "MIT", - "dependencies": { - "babel-plugin-jest-hoist": "^29.6.3", - "babel-preset-current-node-syntax": "^1.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0" - } - }, "node_modules/balanced-match": { "version": "1.0.2", "license": "MIT" @@ -16879,19 +17292,6 @@ "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" } }, - "node_modules/bs-logger": { - "version": "0.2.6", - "resolved": "https://registry.npmjs.org/bs-logger/-/bs-logger-0.2.6.tgz", - "integrity": "sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog==", - "dev": true, - "license": "MIT", - "dependencies": { - "fast-json-stable-stringify": "2.x" - }, - "engines": { - "node": ">= 6" - } - }, "node_modules/bser": { "version": "2.1.1", "dev": true, @@ -17011,6 +17411,16 @@ "node": ">= 0.8" } }, + "node_modules/cac": { + "version": "6.7.14", + "resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz", + "integrity": "sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/cacache": { "version": "19.0.1", "resolved": "https://registry.npmjs.org/cacache/-/cacache-19.0.1.tgz", @@ -17289,6 +17699,23 @@ "integrity": "sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==", "dev": true }, + "node_modules/chai": { + "version": "5.3.3", + "resolved": "https://registry.npmjs.org/chai/-/chai-5.3.3.tgz", + "integrity": "sha512-4zNhdJD/iOjSH0A05ea+Ke6MU5mmpQcbQsSOkgdaUMJ9zTlDTD/GYlwohmIE2u0gaxHYiVHEn1Fw9mZ/ktJWgw==", + "dev": true, + "license": "MIT", + "dependencies": { + "assertion-error": "^2.0.1", + "check-error": "^2.1.1", + "deep-eql": "^5.0.1", + "loupe": "^3.1.0", + "pathval": "^2.0.0" + }, + "engines": { + "node": ">=18" + } + }, "node_modules/chalk": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", @@ -17322,6 +17749,16 @@ "dev": true, "license": "MIT" }, + "node_modules/check-error": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-2.1.1.tgz", + "integrity": "sha512-OAlb+T7V4Op9OwdkjmguYRqncdlx5JiofwOAUkmTF+jNdHwzTaTs4sRAGpzLF3oOz5xAyDGrPgeIDFQmDOTiJw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 16" + } + }, "node_modules/chokidar": { "version": "4.0.1", "dev": true, @@ -17370,11 +17807,6 @@ "node": ">=8" } }, - "node_modules/cjs-module-lexer": { - "version": "1.2.3", - "dev": true, - "license": "MIT" - }, "node_modules/class-transformer": { "version": "0.5.1", "license": "MIT" @@ -17719,6 +18151,13 @@ "dev": true, "license": "ISC" }, + "node_modules/compare-versions": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/compare-versions/-/compare-versions-6.1.1.tgz", + "integrity": "sha512-4hm4VPpIecmlg59CHXnRDnqGplJFrbLG4aFEl5vl6cK1u76ws3LLvX7ikFnTDl5vo39sjWD6AaDPYodJp/NNHg==", + "dev": true, + "license": "MIT" + }, "node_modules/compressible": { "version": "2.0.18", "dev": true, @@ -17789,6 +18228,13 @@ "typedarray": "^0.0.6" } }, + "node_modules/confbox": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/confbox/-/confbox-0.2.2.tgz", + "integrity": "sha512-1NB+BKqhtNipMsov4xI/NnhCKp9XG9NamYp5PVm9klAT0fsrNPjaFICsCFhNhwZJKNh7zB/3q8qXz0E9oaMNtQ==", + "dev": true, + "license": "MIT" + }, "node_modules/confusing-browser-globals": { "version": "1.0.11", "dev": true, @@ -17983,41 +18429,6 @@ "node": ">= 6" } }, - "node_modules/create-jest": { - "version": "29.7.0", - "dev": true, - "license": "MIT", - "dependencies": { - "@jest/types": "^29.6.3", - "chalk": "^4.0.0", - "exit": "^0.1.2", - "graceful-fs": "^4.2.9", - "jest-config": "^29.7.0", - "jest-util": "^29.7.0", - "prompts": "^2.0.1" - }, - "bin": { - "create-jest": "bin/create-jest.js" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/create-jest/node_modules/chalk": { - "version": "4.1.2", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, "node_modules/create-require": { "version": "1.1.1", "devOptional": true, @@ -18312,27 +18723,19 @@ "dev": true, "license": "CC0-1.0" }, - "node_modules/cssom": { - "version": "0.5.0", - "dev": true, - "license": "MIT" - }, "node_modules/cssstyle": { - "version": "2.3.0", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-3.0.0.tgz", + "integrity": "sha512-N4u2ABATi3Qplzf0hWbVCdjenim8F3ojEXpBDF5hBpjzW182MjNGLqfmQ0SkSPeQ+V86ZXgeH8aXj6kayd4jgg==", "dev": true, "license": "MIT", "dependencies": { - "cssom": "~0.3.6" + "rrweb-cssom": "^0.6.0" }, "engines": { - "node": ">=8" + "node": ">=14" } }, - "node_modules/cssstyle/node_modules/cssom": { - "version": "0.3.8", - "dev": true, - "license": "MIT" - }, "node_modules/cuint": { "version": "0.2.2", "dev": true, @@ -18351,16 +18754,18 @@ } }, "node_modules/data-urls": { - "version": "3.0.2", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-4.0.0.tgz", + "integrity": "sha512-/mMTei/JXPqvFqQtfyTowxmJVwr2PVAeCcDxyFf6LhoOu/09TX2OX3kb2wzi4DMXcfj4OItwDOnhl5oziPnT6g==", "dev": true, "license": "MIT", "dependencies": { "abab": "^2.0.6", "whatwg-mimetype": "^3.0.0", - "whatwg-url": "^11.0.0" + "whatwg-url": "^12.0.0" }, "engines": { - "node": ">=12" + "node": ">=14" } }, "node_modules/dataloader": { @@ -18382,6 +18787,13 @@ "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.13.tgz", "integrity": "sha512-oaMBel6gjolK862uaPQOVTA7q3TZhuSvuMQAAglQDOWYO9A91IrAOUJEyKVlqJlHE0vq5p5UXxzdPfMH/x6xNg==" }, + "node_modules/de-indent": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/de-indent/-/de-indent-1.0.2.tgz", + "integrity": "sha512-e/1zu3xH5MQryN2zdVaF0OrdNLUbvWxzMbi+iNA6Bky7l1RoP8a2fIbRocyHclXt/arDrrR6lL3TqFD9pMQTsg==", + "dev": true, + "license": "MIT" + }, "node_modules/debug": { "version": "4.3.4", "license": "MIT", @@ -18477,6 +18889,16 @@ } } }, + "node_modules/deep-eql": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-5.0.2.tgz", + "integrity": "sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, "node_modules/deep-equal": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.0.1.tgz", @@ -19251,35 +19673,6 @@ "node": ">=0.8.0" } }, - "node_modules/escodegen": { - "version": "2.1.0", - "dev": true, - "license": "BSD-2-Clause", - "dependencies": { - "esprima": "^4.0.1", - "estraverse": "^5.2.0", - "esutils": "^2.0.2" - }, - "bin": { - "escodegen": "bin/escodegen.js", - "esgenerate": "bin/esgenerate.js" - }, - "engines": { - "node": ">=6.0" - }, - "optionalDependencies": { - "source-map": "~0.6.1" - } - }, - "node_modules/escodegen/node_modules/source-map": { - "version": "0.6.1", - "dev": true, - "license": "BSD-3-Clause", - "optional": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/eslint": { "version": "8.57.0", "dev": true, @@ -19739,13 +20132,6 @@ "url": "https://github.com/sindresorhus/execa?sponsor=1" } }, - "node_modules/exit": { - "version": "0.1.2", - "dev": true, - "engines": { - "node": ">= 0.8.0" - } - }, "node_modules/exit-x": { "version": "0.2.2", "resolved": "https://registry.npmjs.org/exit-x/-/exit-x-0.2.2.tgz", @@ -19769,19 +20155,14 @@ "node": ">=0.10.0" } }, - "node_modules/expect": { - "version": "29.7.0", + "node_modules/expect-type": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/expect-type/-/expect-type-1.2.2.tgz", + "integrity": "sha512-JhFGDVJ7tmDJItKhYgJCGLOWjuK9vPxiXoUFLwLDc99NlmklilbiQJwoctZtt13+xMw91MCk/REan6MWHqDjyA==", "dev": true, - "license": "MIT", - "dependencies": { - "@jest/expect-utils": "^29.7.0", - "jest-get-type": "^29.6.3", - "jest-matcher-utils": "^29.7.0", - "jest-message-util": "^29.7.0", - "jest-util": "^29.7.0" - }, + "license": "Apache-2.0", "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": ">=12.0.0" } }, "node_modules/exponential-backoff": { @@ -19888,6 +20269,13 @@ "integrity": "sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ==", "dev": true }, + "node_modules/exsolve": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/exsolve/-/exsolve-1.0.7.tgz", + "integrity": "sha512-VO5fQUzZtI6C+vx4w/4BWJpg3s/5l+6pRQEHzFRM8WFi4XffSP1Z+4qi7GbjWbvRQEbdIco5mIMq+zX4rPuLrw==", + "dev": true, + "license": "MIT" + }, "node_modules/ext-list": { "version": "2.2.2", "resolved": "https://registry.npmjs.org/ext-list/-/ext-list-2.2.2.tgz", @@ -20427,7 +20815,9 @@ } }, "node_modules/flatted": { - "version": "3.3.1", + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.3.tgz", + "integrity": "sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg==", "dev": true, "license": "ISC" }, @@ -20761,12 +21151,6 @@ "js-yaml": "bin/js-yaml.js" } }, - "node_modules/front-matter/node_modules/sprintf-js": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", - "license": "BSD-3-Clause" - }, "node_modules/fs-constants": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", @@ -22276,27 +22660,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/istanbul-lib-source-maps": { - "version": "4.0.1", - "dev": true, - "license": "BSD-3-Clause", - "dependencies": { - "debug": "^4.1.1", - "istanbul-lib-coverage": "^3.0.0", - "source-map": "^0.6.1" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/istanbul-lib-source-maps/node_modules/source-map": { - "version": "0.6.1", - "dev": true, - "license": "BSD-3-Clause", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/istanbul-reports": { "version": "3.1.7", "dev": true, @@ -22349,195 +22712,6 @@ "node": ">=10" } }, - "node_modules/jest": { - "version": "29.7.0", - "dev": true, - "license": "MIT", - "dependencies": { - "@jest/core": "^29.7.0", - "@jest/types": "^29.6.3", - "import-local": "^3.0.2", - "jest-cli": "^29.7.0" - }, - "bin": { - "jest": "bin/jest.js" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - }, - "peerDependencies": { - "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" - }, - "peerDependenciesMeta": { - "node-notifier": { - "optional": true - } - } - }, - "node_modules/jest-changed-files": { - "version": "29.7.0", - "dev": true, - "license": "MIT", - "dependencies": { - "execa": "^5.0.0", - "jest-util": "^29.7.0", - "p-limit": "^3.1.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-circus": { - "version": "29.7.0", - "dev": true, - "license": "MIT", - "dependencies": { - "@jest/environment": "^29.7.0", - "@jest/expect": "^29.7.0", - "@jest/test-result": "^29.7.0", - "@jest/types": "^29.6.3", - "@types/node": "*", - "chalk": "^4.0.0", - "co": "^4.6.0", - "dedent": "^1.0.0", - "is-generator-fn": "^2.0.0", - "jest-each": "^29.7.0", - "jest-matcher-utils": "^29.7.0", - "jest-message-util": "^29.7.0", - "jest-runtime": "^29.7.0", - "jest-snapshot": "^29.7.0", - "jest-util": "^29.7.0", - "p-limit": "^3.1.0", - "pretty-format": "^29.7.0", - "pure-rand": "^6.0.0", - "slash": "^3.0.0", - "stack-utils": "^2.0.3" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-circus/node_modules/chalk": { - "version": "4.1.2", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/jest-cli": { - "version": "29.7.0", - "dev": true, - "license": "MIT", - "dependencies": { - "@jest/core": "^29.7.0", - "@jest/test-result": "^29.7.0", - "@jest/types": "^29.6.3", - "chalk": "^4.0.0", - "create-jest": "^29.7.0", - "exit": "^0.1.2", - "import-local": "^3.0.2", - "jest-config": "^29.7.0", - "jest-util": "^29.7.0", - "jest-validate": "^29.7.0", - "yargs": "^17.3.1" - }, - "bin": { - "jest": "bin/jest.js" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - }, - "peerDependencies": { - "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" - }, - "peerDependenciesMeta": { - "node-notifier": { - "optional": true - } - } - }, - "node_modules/jest-cli/node_modules/chalk": { - "version": "4.1.2", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/jest-config": { - "version": "29.7.0", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/core": "^7.11.6", - "@jest/test-sequencer": "^29.7.0", - "@jest/types": "^29.6.3", - "babel-jest": "^29.7.0", - "chalk": "^4.0.0", - "ci-info": "^3.2.0", - "deepmerge": "^4.2.2", - "glob": "^7.1.3", - "graceful-fs": "^4.2.9", - "jest-circus": "^29.7.0", - "jest-environment-node": "^29.7.0", - "jest-get-type": "^29.6.3", - "jest-regex-util": "^29.6.3", - "jest-resolve": "^29.7.0", - "jest-runner": "^29.7.0", - "jest-util": "^29.7.0", - "jest-validate": "^29.7.0", - "micromatch": "^4.0.4", - "parse-json": "^5.2.0", - "pretty-format": "^29.7.0", - "slash": "^3.0.0", - "strip-json-comments": "^3.1.1" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - }, - "peerDependencies": { - "@types/node": "*", - "ts-node": ">=9.0.0" - }, - "peerDependenciesMeta": { - "@types/node": { - "optional": true - }, - "ts-node": { - "optional": true - } - } - }, - "node_modules/jest-config/node_modules/chalk": { - "version": "4.1.2", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, "node_modules/jest-diff": { "version": "29.7.0", "dev": true, @@ -22567,89 +22741,6 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/jest-docblock": { - "version": "29.7.0", - "dev": true, - "license": "MIT", - "dependencies": { - "detect-newline": "^3.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-each": { - "version": "29.7.0", - "dev": true, - "license": "MIT", - "dependencies": { - "@jest/types": "^29.6.3", - "chalk": "^4.0.0", - "jest-get-type": "^29.6.3", - "jest-util": "^29.7.0", - "pretty-format": "^29.7.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-each/node_modules/chalk": { - "version": "4.1.2", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/jest-environment-jsdom": { - "version": "29.7.0", - "dev": true, - "license": "MIT", - "dependencies": { - "@jest/environment": "^29.7.0", - "@jest/fake-timers": "^29.7.0", - "@jest/types": "^29.6.3", - "@types/jsdom": "^20.0.0", - "@types/node": "*", - "jest-mock": "^29.7.0", - "jest-util": "^29.7.0", - "jsdom": "^20.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - }, - "peerDependencies": { - "canvas": "^2.5.0" - }, - "peerDependenciesMeta": { - "canvas": { - "optional": true - } - } - }, - "node_modules/jest-environment-node": { - "version": "29.7.0", - "dev": true, - "license": "MIT", - "dependencies": { - "@jest/environment": "^29.7.0", - "@jest/fake-timers": "^29.7.0", - "@jest/types": "^29.6.3", - "@types/node": "*", - "jest-mock": "^29.7.0", - "jest-util": "^29.7.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, "node_modules/jest-get-type": { "version": "29.6.3", "dev": true, @@ -22658,118 +22749,6 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/jest-haste-map": { - "version": "29.7.0", - "dev": true, - "license": "MIT", - "dependencies": { - "@jest/types": "^29.6.3", - "@types/graceful-fs": "^4.1.3", - "@types/node": "*", - "anymatch": "^3.0.3", - "fb-watchman": "^2.0.0", - "graceful-fs": "^4.2.9", - "jest-regex-util": "^29.6.3", - "jest-util": "^29.7.0", - "jest-worker": "^29.7.0", - "micromatch": "^4.0.4", - "walker": "^1.0.8" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - }, - "optionalDependencies": { - "fsevents": "^2.3.2" - } - }, - "node_modules/jest-leak-detector": { - "version": "29.7.0", - "dev": true, - "license": "MIT", - "dependencies": { - "jest-get-type": "^29.6.3", - "pretty-format": "^29.7.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-matcher-utils": { - "version": "29.7.0", - "dev": true, - "license": "MIT", - "dependencies": { - "chalk": "^4.0.0", - "jest-diff": "^29.7.0", - "jest-get-type": "^29.6.3", - "pretty-format": "^29.7.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-matcher-utils/node_modules/chalk": { - "version": "4.1.2", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/jest-message-util": { - "version": "29.7.0", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/code-frame": "^7.12.13", - "@jest/types": "^29.6.3", - "@types/stack-utils": "^2.0.0", - "chalk": "^4.0.0", - "graceful-fs": "^4.2.9", - "micromatch": "^4.0.4", - "pretty-format": "^29.7.0", - "slash": "^3.0.0", - "stack-utils": "^2.0.3" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-message-util/node_modules/chalk": { - "version": "4.1.2", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/jest-mock": { - "version": "29.7.0", - "dev": true, - "license": "MIT", - "dependencies": { - "@jest/types": "^29.6.3", - "@types/node": "*", - "jest-util": "^29.7.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, "node_modules/jest-pnp-resolver": { "version": "1.2.3", "dev": true, @@ -22786,249 +22765,6 @@ } } }, - "node_modules/jest-preset-angular": { - "version": "14.6.1", - "resolved": "https://registry.npmjs.org/jest-preset-angular/-/jest-preset-angular-14.6.1.tgz", - "integrity": "sha512-7q5x42wKrsF2ykOwGVzcXpr9p1X4FQJMU/DnH1tpvCmeOm5XqENdwD/xDZug+nP6G8SJPdioauwdsK/PMY/MpQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "bs-logger": "^0.2.6", - "esbuild-wasm": ">=0.15.13", - "jest-environment-jsdom": "^29.7.0", - "jest-util": "^29.7.0", - "pretty-format": "^29.7.0", - "ts-jest": "^29.3.0" - }, - "engines": { - "node": "^14.15.0 || >=16.10.0" - }, - "optionalDependencies": { - "esbuild": ">=0.15.13" - }, - "peerDependencies": { - "@angular/compiler-cli": ">=15.0.0 <21.0.0", - "@angular/core": ">=15.0.0 <21.0.0", - "@angular/platform-browser-dynamic": ">=15.0.0 <21.0.0", - "jest": "^29.0.0", - "jsdom": ">=20.0.0", - "typescript": ">=4.8" - }, - "peerDependenciesMeta": { - "jsdom": { - "optional": true - } - } - }, - "node_modules/jest-regex-util": { - "version": "29.6.3", - "dev": true, - "license": "MIT", - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-resolve": { - "version": "29.7.0", - "dev": true, - "license": "MIT", - "dependencies": { - "chalk": "^4.0.0", - "graceful-fs": "^4.2.9", - "jest-haste-map": "^29.7.0", - "jest-pnp-resolver": "^1.2.2", - "jest-util": "^29.7.0", - "jest-validate": "^29.7.0", - "resolve": "^1.20.0", - "resolve.exports": "^2.0.0", - "slash": "^3.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-resolve-dependencies": { - "version": "29.7.0", - "dev": true, - "license": "MIT", - "dependencies": { - "jest-regex-util": "^29.6.3", - "jest-snapshot": "^29.7.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-resolve/node_modules/chalk": { - "version": "4.1.2", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/jest-runner": { - "version": "29.7.0", - "dev": true, - "license": "MIT", - "dependencies": { - "@jest/console": "^29.7.0", - "@jest/environment": "^29.7.0", - "@jest/test-result": "^29.7.0", - "@jest/transform": "^29.7.0", - "@jest/types": "^29.6.3", - "@types/node": "*", - "chalk": "^4.0.0", - "emittery": "^0.13.1", - "graceful-fs": "^4.2.9", - "jest-docblock": "^29.7.0", - "jest-environment-node": "^29.7.0", - "jest-haste-map": "^29.7.0", - "jest-leak-detector": "^29.7.0", - "jest-message-util": "^29.7.0", - "jest-resolve": "^29.7.0", - "jest-runtime": "^29.7.0", - "jest-util": "^29.7.0", - "jest-watcher": "^29.7.0", - "jest-worker": "^29.7.0", - "p-limit": "^3.1.0", - "source-map-support": "0.5.13" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-runner/node_modules/chalk": { - "version": "4.1.2", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/jest-runner/node_modules/source-map": { - "version": "0.6.1", - "dev": true, - "license": "BSD-3-Clause", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/jest-runner/node_modules/source-map-support": { - "version": "0.5.13", - "dev": true, - "license": "MIT", - "dependencies": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" - } - }, - "node_modules/jest-runtime": { - "version": "29.7.0", - "dev": true, - "license": "MIT", - "dependencies": { - "@jest/environment": "^29.7.0", - "@jest/fake-timers": "^29.7.0", - "@jest/globals": "^29.7.0", - "@jest/source-map": "^29.6.3", - "@jest/test-result": "^29.7.0", - "@jest/transform": "^29.7.0", - "@jest/types": "^29.6.3", - "@types/node": "*", - "chalk": "^4.0.0", - "cjs-module-lexer": "^1.0.0", - "collect-v8-coverage": "^1.0.0", - "glob": "^7.1.3", - "graceful-fs": "^4.2.9", - "jest-haste-map": "^29.7.0", - "jest-message-util": "^29.7.0", - "jest-mock": "^29.7.0", - "jest-regex-util": "^29.6.3", - "jest-resolve": "^29.7.0", - "jest-snapshot": "^29.7.0", - "jest-util": "^29.7.0", - "slash": "^3.0.0", - "strip-bom": "^4.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-runtime/node_modules/chalk": { - "version": "4.1.2", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/jest-snapshot": { - "version": "29.7.0", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/core": "^7.11.6", - "@babel/generator": "^7.7.2", - "@babel/plugin-syntax-jsx": "^7.7.2", - "@babel/plugin-syntax-typescript": "^7.7.2", - "@babel/types": "^7.3.3", - "@jest/expect-utils": "^29.7.0", - "@jest/transform": "^29.7.0", - "@jest/types": "^29.6.3", - "babel-preset-current-node-syntax": "^1.0.0", - "chalk": "^4.0.0", - "expect": "^29.7.0", - "graceful-fs": "^4.2.9", - "jest-diff": "^29.7.0", - "jest-get-type": "^29.6.3", - "jest-matcher-utils": "^29.7.0", - "jest-message-util": "^29.7.0", - "jest-util": "^29.7.0", - "natural-compare": "^1.4.0", - "pretty-format": "^29.7.0", - "semver": "^7.5.3" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-snapshot/node_modules/chalk": { - "version": "4.1.2", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, "node_modules/jest-util": { "version": "29.7.0", "dev": true, @@ -23071,81 +22807,6 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, - "node_modules/jest-validate": { - "version": "29.7.0", - "dev": true, - "license": "MIT", - "dependencies": { - "@jest/types": "^29.6.3", - "camelcase": "^6.2.0", - "chalk": "^4.0.0", - "jest-get-type": "^29.6.3", - "leven": "^3.1.0", - "pretty-format": "^29.7.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-validate/node_modules/camelcase": { - "version": "6.3.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/jest-validate/node_modules/chalk": { - "version": "4.1.2", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/jest-watcher": { - "version": "29.7.0", - "dev": true, - "license": "MIT", - "dependencies": { - "@jest/test-result": "^29.7.0", - "@jest/types": "^29.6.3", - "@types/node": "*", - "ansi-escapes": "^4.2.1", - "chalk": "^4.0.0", - "emittery": "^0.13.1", - "jest-util": "^29.7.0", - "string-length": "^4.0.1" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-watcher/node_modules/chalk": { - "version": "4.1.2", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, "node_modules/jest-worker": { "version": "29.7.0", "dev": true, @@ -23175,11 +22836,13 @@ } }, "node_modules/jiti": { - "version": "1.21.3", + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/jiti/-/jiti-2.4.2.tgz", + "integrity": "sha512-rg9zJN+G4n2nfJl5MW3BMygZX56zKPNVEYYqq7adpmMh4Jn2QNEwhvQlFy6jPVdcod7txZtKHWnyZiA3a0zP7A==", "dev": true, "license": "MIT", "bin": { - "jiti": "bin/jiti.js" + "jiti": "lib/jiti-cli.mjs" } }, "node_modules/jju": { @@ -23202,26 +22865,25 @@ } }, "node_modules/jsdom": { - "version": "20.0.3", + "version": "22.1.0", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-22.1.0.tgz", + "integrity": "sha512-/9AVW7xNbsBv6GfWho4TTNjEo9fe6Zhf9O7s0Fhhr3u+awPwAJMKwAMXnkk5vBxflqLW9hTHX/0cs+P3gW+cQw==", "dev": true, "license": "MIT", "dependencies": { "abab": "^2.0.6", - "acorn": "^8.8.1", - "acorn-globals": "^7.0.0", - "cssom": "^0.5.0", - "cssstyle": "^2.3.0", - "data-urls": "^3.0.2", - "decimal.js": "^10.4.2", + "cssstyle": "^3.0.0", + "data-urls": "^4.0.0", + "decimal.js": "^10.4.3", "domexception": "^4.0.0", - "escodegen": "^2.0.0", "form-data": "^4.0.0", "html-encoding-sniffer": "^3.0.0", "http-proxy-agent": "^5.0.0", "https-proxy-agent": "^5.0.1", "is-potential-custom-element-name": "^1.0.1", - "nwsapi": "^2.2.2", - "parse5": "^7.1.1", + "nwsapi": "^2.2.4", + "parse5": "^7.1.2", + "rrweb-cssom": "^0.6.0", "saxes": "^6.0.0", "symbol-tree": "^3.2.4", "tough-cookie": "^4.1.2", @@ -23229,12 +22891,12 @@ "webidl-conversions": "^7.0.0", "whatwg-encoding": "^2.0.0", "whatwg-mimetype": "^3.0.0", - "whatwg-url": "^11.0.0", - "ws": "^8.11.0", + "whatwg-url": "^12.0.1", + "ws": "^8.13.0", "xml-name-validator": "^4.0.0" }, "engines": { - "node": ">=14" + "node": ">=16" }, "peerDependencies": { "canvas": "^2.5.0" @@ -23525,14 +23187,6 @@ "node": ">=0.10.0" } }, - "node_modules/kleur": { - "version": "3.0.3", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, "node_modules/klona": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/klona/-/klona-2.0.6.tgz", @@ -23704,6 +23358,13 @@ "node": ">= 0.6" } }, + "node_modules/kolorist": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/kolorist/-/kolorist-1.8.0.tgz", + "integrity": "sha512-Y+60/zizpJ3HRH8DCss+q95yr6145JXZo46OTpFvDZWLfRCE4qChOyk1b26nMaNpfHHgxagk9dXT5OP0Tfe+dQ==", + "dev": true, + "license": "MIT" + }, "node_modules/launch-editor": { "version": "2.11.1", "resolved": "https://registry.npmjs.org/launch-editor/-/launch-editor-2.11.1.tgz", @@ -24027,6 +23688,16 @@ "node": ">=13.2.0" } }, + "node_modules/load-tsconfig": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/load-tsconfig/-/load-tsconfig-0.2.5.tgz", + "integrity": "sha512-IXO6OCs9yg8tMKzfPZ1YmheJbZCiEsnBdcB03l0OcfK9prKnJb96siuHCr5Fl37/yo9DnKU+TLpxzTUspw9shg==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + } + }, "node_modules/loader-runner": { "version": "4.3.1", "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.3.1.tgz", @@ -24049,6 +23720,24 @@ "node": ">= 12.13.0" } }, + "node_modules/local-pkg": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/local-pkg/-/local-pkg-1.1.2.tgz", + "integrity": "sha512-arhlxbFRmoQHl33a0Zkle/YWlmNwoyt6QNZEIJcqNbdrsix5Lvc4HyyI3EnwxTYlZYc32EbYrQ8SzEZ7dqgg9A==", + "dev": true, + "license": "MIT", + "dependencies": { + "mlly": "^1.7.4", + "pkg-types": "^2.3.0", + "quansync": "^0.2.11" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, "node_modules/locate-path": { "version": "5.0.0", "dev": true, @@ -24392,6 +24081,13 @@ "dev": true, "license": "MIT" }, + "node_modules/loupe": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/loupe/-/loupe-3.2.1.tgz", + "integrity": "sha512-CdzqowRJCeLU72bHvWqwRBBlLcMEtIvGrlvef74kMnV2AolS9Y8xUv1I0U/MNAWMhBlKIoyuEgoJ0t/bbwHbLQ==", + "dev": true, + "license": "MIT" + }, "node_modules/lowdb": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/lowdb/-/lowdb-1.0.0.tgz", @@ -24471,6 +24167,18 @@ "@jridgewell/sourcemap-codec": "^1.5.0" } }, + "node_modules/magicast": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/magicast/-/magicast-0.3.5.tgz", + "integrity": "sha512-L0WhttDl+2BOsybvEOLK7fW3UA0OQ0IQ2d6Zl2x/a6vVRs3bAY0ECOSHHeL5jD+SbOpOCUEi0y1DgHEn9Qn1AQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.25.4", + "@babel/types": "^7.25.4", + "source-map-js": "^1.2.0" + } + }, "node_modules/make-dir": { "version": "3.1.0", "dev": true, @@ -25032,6 +24740,38 @@ "mkdirp": "bin/cmd.js" } }, + "node_modules/mlly": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.8.0.tgz", + "integrity": "sha512-l8D9ODSRWLe2KHJSifWGwBqpTZXIXTeo8mlKjY+E2HAakaTeNpqAyBZ8GSqLzHgw4XmHmC8whvpjJNMbFZN7/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "acorn": "^8.15.0", + "pathe": "^2.0.3", + "pkg-types": "^1.3.1", + "ufo": "^1.6.1" + } + }, + "node_modules/mlly/node_modules/confbox": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/confbox/-/confbox-0.1.8.tgz", + "integrity": "sha512-RMtmw0iFkeR4YV+fUOSucriAQNb9g8zFR52MWCtl+cCZOFRNL6zeB395vPzFhEjjn4fMxXudmELnl/KF/WrK6w==", + "dev": true, + "license": "MIT" + }, + "node_modules/mlly/node_modules/pkg-types": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.3.1.tgz", + "integrity": "sha512-/Jm5M4RvtBFVkKWRu2BLUTNP8/M2a+UwuAX+ae4770q1qVGtfjG+WTCupoZixokjmHiry8uI+dlY8KXYV5HVVQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "confbox": "^0.1.8", + "mlly": "^1.7.4", + "pathe": "^2.0.1" + } + }, "node_modules/moment": { "version": "2.30.1", "dev": true, @@ -25093,6 +24833,13 @@ "@msgpackr-extract/msgpackr-extract-win32-x64": "3.0.3" } }, + "node_modules/muggle-string": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/muggle-string/-/muggle-string-0.4.1.tgz", + "integrity": "sha512-VNTrAak/KhO2i8dqqnqnAHOa3cYBwXEZe9h+D5h/1ZqFSTEFHdM65lR7RoIqq3tBBYavsOXV84NoHXZ0AkPyqQ==", + "dev": true, + "license": "MIT" + }, "node_modules/multer": { "version": "1.4.5-lts.2", "resolved": "https://registry.npmjs.org/multer/-/multer-1.4.5-lts.2.tgz", @@ -26886,6 +26633,13 @@ "node": ">= 0.8" } }, + "node_modules/path-browserify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz", + "integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==", + "dev": true, + "license": "MIT" + }, "node_modules/path-exists": { "version": "4.0.0", "dev": true, @@ -26948,6 +26702,23 @@ "node": ">=8" } }, + "node_modules/pathe": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz", + "integrity": "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==", + "dev": true, + "license": "MIT" + }, + "node_modules/pathval": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-2.0.1.tgz", + "integrity": "sha512-//nshmD55c46FuFw26xV/xFAaB5HF9Xdap7HJBBnrKdAd6/GxDBaNA1870O79+9ueg61cZLSVc+OaFlfmObYVQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 14.16" + } + }, "node_modules/peek-readable": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/peek-readable/-/peek-readable-7.0.0.tgz", @@ -27251,6 +27022,18 @@ "node": ">=8" } }, + "node_modules/pkg-types": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-2.3.0.tgz", + "integrity": "sha512-SIqCzDRg0s9npO5XQ3tNZioRY1uK06lA41ynBC1YmFTmnY6FjUjVt6s4LoADmwoig1qqD0oK8h1p/8mlMx8Oig==", + "dev": true, + "license": "MIT", + "dependencies": { + "confbox": "^0.2.2", + "exsolve": "^1.0.7", + "pathe": "^2.0.3" + } + }, "node_modules/pkginfo": { "version": "0.4.1", "dev": true, @@ -27534,6 +27317,16 @@ } } }, + "node_modules/postcss-loader/node_modules/jiti": { + "version": "1.21.7", + "resolved": "https://registry.npmjs.org/jiti/-/jiti-1.21.7.tgz", + "integrity": "sha512-/imKNG4EbWNrVjoNC/1H5/9GFy+tqjGBHCaSsN+P2RnPqjsLmv6UD3Ej+Kj8nBWaRAwyk7kK5ZUc+OEatnTR3A==", + "dev": true, + "license": "MIT", + "bin": { + "jiti": "bin/jiti.js" + } + }, "node_modules/postcss-media-query-parser": { "version": "0.2.3", "resolved": "https://registry.npmjs.org/postcss-media-query-parser/-/postcss-media-query-parser-0.2.3.tgz", @@ -28116,18 +27909,6 @@ "node": ">=10" } }, - "node_modules/prompts": { - "version": "2.4.2", - "dev": true, - "license": "MIT", - "dependencies": { - "kleur": "^3.0.3", - "sisteransi": "^1.0.5" - }, - "engines": { - "node": ">= 6" - } - }, "node_modules/proxy-addr": { "version": "2.0.7", "license": "MIT", @@ -28182,21 +27963,6 @@ "node": ">=6" } }, - "node_modules/pure-rand": { - "version": "6.0.4", - "dev": true, - "funding": [ - { - "type": "individual", - "url": "https://github.com/sponsors/dubzzz" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/fast-check" - } - ], - "license": "MIT" - }, "node_modules/qs": { "version": "6.13.0", "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", @@ -28212,6 +27978,23 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/quansync": { + "version": "0.2.11", + "resolved": "https://registry.npmjs.org/quansync/-/quansync-0.2.11.tgz", + "integrity": "sha512-AifT7QEbW9Nri4tAwR5M/uzpBuqfZf+zwaEM/QkzEjj7NBuFD2rBuy0K3dE+8wltbezDV7JMA0WfnCPYRSYbXA==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/antfu" + }, + { + "type": "individual", + "url": "https://github.com/sponsors/sxzz" + } + ], + "license": "MIT" + }, "node_modules/querystringify": { "version": "2.2.0", "dev": true, @@ -28845,6 +28628,13 @@ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" }, + "node_modules/rrweb-cssom": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/rrweb-cssom/-/rrweb-cssom-0.6.0.tgz", + "integrity": "sha512-APM0Gt1KoXBz0iIkkdB/kfvGOwC4UuJFeG/c+yV7wSc7q96cG/kJ0HiYCnzivD9SB53cLV1MlHFNfOuPaadYSw==", + "dev": true, + "license": "MIT" + }, "node_modules/rslog": { "version": "1.2.11", "resolved": "https://registry.npmjs.org/rslog/-/rslog-1.2.11.tgz", @@ -29867,6 +29657,13 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/siginfo": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz", + "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==", + "dev": true, + "license": "ISC" + }, "node_modules/signal-exit": { "version": "3.0.7", "license": "ISC" @@ -29889,10 +29686,20 @@ "node": "^18.17.0 || >=20.5.0" } }, - "node_modules/sisteransi": { - "version": "1.0.5", + "node_modules/sirv": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/sirv/-/sirv-3.0.2.tgz", + "integrity": "sha512-2wcC/oGxHis/BoHkkPwldgiPSYcpZK3JU28WoMVv55yHJgcZ8rlXvuG9iZggz+sU1d4bRgIGASwyWqjxu3FM0g==", "dev": true, - "license": "MIT" + "license": "MIT", + "dependencies": { + "@polka/url": "^1.0.0-next.24", + "mrmime": "^2.0.0", + "totalist": "^3.0.0" + }, + "engines": { + "node": ">=18" + } }, "node_modules/slash": { "version": "3.0.0", @@ -30265,6 +30072,12 @@ "node": ">= 10.x" } }, + "node_modules/sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", + "license": "BSD-3-Clause" + }, "node_modules/sqlstring": { "version": "2.3.3", "license": "MIT", @@ -30335,6 +30148,13 @@ "node": ">=8" } }, + "node_modules/stackback": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz", + "integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==", + "dev": true, + "license": "MIT" + }, "node_modules/stackframe": { "version": "1.3.4", "resolved": "https://registry.npmjs.org/stackframe/-/stackframe-1.3.4.tgz", @@ -30349,6 +30169,13 @@ "node": ">= 0.8" } }, + "node_modules/std-env": { + "version": "3.10.0", + "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.10.0.tgz", + "integrity": "sha512-5GS12FdOZNliM5mAOxFRg7Ir0pWz8MdpYm6AY6VPkGpbA7ZzmbzNcBJQ0GPvvyWgcY7QAhCgf9Uy89I03faLkg==", + "dev": true, + "license": "MIT" + }, "node_modules/stdin-discarder": { "version": "0.2.2", "resolved": "https://registry.npmjs.org/stdin-discarder/-/stdin-discarder-0.2.2.tgz", @@ -30583,6 +30410,26 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/strip-literal": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/strip-literal/-/strip-literal-3.1.0.tgz", + "integrity": "sha512-8r3mkIM/2+PpjHoOtiAW8Rg3jJLHaV7xPwG+YRGrv6FP0wwk/toTpATxWYOW0BKdWwl82VT2tFYi5DlROa0Mxg==", + "dev": true, + "license": "MIT", + "dependencies": { + "js-tokens": "^9.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, + "node_modules/strip-literal/node_modules/js-tokens": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-9.0.1.tgz", + "integrity": "sha512-mxa9E9ITFOt0ban3j6L5MpjwegGz6lBQmM1IJkWeBZGcMxto50+eWdjC/52xDbS2vy0k7vIMK0Fe2wfL9OQSpQ==", + "dev": true, + "license": "MIT" + }, "node_modules/strtok3": { "version": "10.2.2", "resolved": "https://registry.npmjs.org/strtok3/-/strtok3-10.2.2.tgz", @@ -31166,6 +31013,20 @@ "node": ">=8" } }, + "node_modules/tinybench": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.9.0.tgz", + "integrity": "sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==", + "dev": true, + "license": "MIT" + }, + "node_modules/tinyexec": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-0.3.2.tgz", + "integrity": "sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA==", + "dev": true, + "license": "MIT" + }, "node_modules/tinyglobby": { "version": "0.2.14", "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.14.tgz", @@ -31183,6 +31044,36 @@ "url": "https://github.com/sponsors/SuperchupuDev" } }, + "node_modules/tinypool": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-1.1.1.tgz", + "integrity": "sha512-Zba82s87IFq9A9XmjiX5uZA/ARWDrB03OHlq+Vw1fSdt0I+4/Kutwy8BP4Y/y/aORMo61FQ0vIb5j44vSo5Pkg==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.0.0 || >=20.0.0" + } + }, + "node_modules/tinyrainbow": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/tinyrainbow/-/tinyrainbow-2.0.0.tgz", + "integrity": "sha512-op4nsTR47R6p0vMUUoYl/a+ljLFVtlfaXkLQmqfLR1qHma1h/ysYk4hEXZ880bf2CYgTskvTa/e196Vd5dDQXw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/tinyspy": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-4.0.4.tgz", + "integrity": "sha512-azl+t0z7pw/z958Gy9svOTuzqIk6xq+NSheJzn5MMWtWTFywIacg2wUlzKFGtt3cthx0r2SxMK0yzJOR0IES7Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14.0.0" + } + }, "node_modules/tldts": { "version": "6.1.83", "resolved": "https://registry.npmjs.org/tldts/-/tldts-6.1.83.tgz", @@ -31248,6 +31139,16 @@ "url": "https://github.com/sponsors/Borewit" } }, + "node_modules/totalist": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/totalist/-/totalist-3.0.1.tgz", + "integrity": "sha512-sf4i37nQ2LBx4m3wB74y+ubopq6W/dIzXg0FDGjsYnZHVa1Da8FH853wlL2gtUhg+xJXjfk3kUZS3BRoQeoQBQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, "node_modules/tough-cookie": { "version": "4.1.3", "dev": true, @@ -31271,14 +31172,16 @@ } }, "node_modules/tr46": { - "version": "3.0.0", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-4.1.1.tgz", + "integrity": "sha512-2lv/66T7e5yNyhAAC4NaKe5nVavzuGJQVVtRYLyQ2OI8tsJ61PMLlelehb0wi2Hx6+hT/OJUWZcw8MjlSRnxvw==", "dev": true, "license": "MIT", "dependencies": { - "punycode": "^2.1.1" + "punycode": "^2.3.0" }, "engines": { - "node": ">=12" + "node": ">=14" } }, "node_modules/tree-dump": { @@ -31435,85 +31338,6 @@ "node": ">=8.10.0" } }, - "node_modules/ts-jest": { - "version": "29.4.5", - "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.4.5.tgz", - "integrity": "sha512-HO3GyiWn2qvTQA4kTgjDcXiMwYQt68a1Y8+JuLRVpdIzm+UOLSHgl/XqR4c6nzJkq5rOkjc02O2I7P7l/Yof0Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "bs-logger": "^0.2.6", - "fast-json-stable-stringify": "^2.1.0", - "handlebars": "^4.7.8", - "json5": "^2.2.3", - "lodash.memoize": "^4.1.2", - "make-error": "^1.3.6", - "semver": "^7.7.3", - "type-fest": "^4.41.0", - "yargs-parser": "^21.1.1" - }, - "bin": { - "ts-jest": "cli.js" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || ^18.0.0 || >=20.0.0" - }, - "peerDependencies": { - "@babel/core": ">=7.0.0-beta.0 <8", - "@jest/transform": "^29.0.0 || ^30.0.0", - "@jest/types": "^29.0.0 || ^30.0.0", - "babel-jest": "^29.0.0 || ^30.0.0", - "jest": "^29.0.0 || ^30.0.0", - "jest-util": "^29.0.0 || ^30.0.0", - "typescript": ">=4.3 <6" - }, - "peerDependenciesMeta": { - "@babel/core": { - "optional": true - }, - "@jest/transform": { - "optional": true - }, - "@jest/types": { - "optional": true - }, - "babel-jest": { - "optional": true - }, - "esbuild": { - "optional": true - }, - "jest-util": { - "optional": true - } - } - }, - "node_modules/ts-jest/node_modules/semver": { - "version": "7.7.3", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.3.tgz", - "integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==", - "dev": true, - "license": "ISC", - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/ts-jest/node_modules/type-fest": { - "version": "4.41.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.41.0.tgz", - "integrity": "sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA==", - "dev": true, - "license": "(MIT OR CC0-1.0)", - "engines": { - "node": ">=16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/ts-loader": { "version": "9.5.4", "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-9.5.4.tgz", @@ -32012,6 +31836,13 @@ "node": ">=14.17" } }, + "node_modules/ufo": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.6.1.tgz", + "integrity": "sha512-9a4/uxlTWJ4+a5i0ooc1rU7C7YOw3wT+UGqdeNNHWnOF9qcMBgLRS+4IYUqbczewFx4mLEig6gawh7X6mFlEkA==", + "dev": true, + "license": "MIT" + }, "node_modules/uglify-js": { "version": "3.17.4", "dev": true, @@ -32180,6 +32011,50 @@ "node": ">= 0.8" } }, + "node_modules/unplugin": { + "version": "2.3.10", + "resolved": "https://registry.npmjs.org/unplugin/-/unplugin-2.3.10.tgz", + "integrity": "sha512-6NCPkv1ClwH+/BGE9QeoTIl09nuiAt0gS28nn1PvYXsGKRwM2TCbFA2QiilmehPDTXIe684k4rZI1yl3A1PCUw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/remapping": "^2.3.5", + "acorn": "^8.15.0", + "picomatch": "^4.0.3", + "webpack-virtual-modules": "^0.6.2" + }, + "engines": { + "node": ">=18.12.0" + } + }, + "node_modules/unplugin-swc": { + "version": "1.5.7", + "resolved": "https://registry.npmjs.org/unplugin-swc/-/unplugin-swc-1.5.7.tgz", + "integrity": "sha512-Ng4uuLAodZToA0kQk3+oY8b0C/Q9oV0ohRMixH2nqWMhCF/wNuMYZXZznYpwRLmF7wC36TFIOywBAxCLOReoeg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@rollup/pluginutils": "^5.2.0", + "load-tsconfig": "^0.2.5", + "unplugin": "^2.3.8" + }, + "peerDependencies": { + "@swc/core": "^1.2.108" + } + }, + "node_modules/unplugin/node_modules/picomatch": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", + "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, "node_modules/unrs-resolver": { "version": "1.11.1", "resolved": "https://registry.npmjs.org/unrs-resolver/-/unrs-resolver-1.11.1.tgz", @@ -32686,6 +32561,106 @@ } } }, + "node_modules/vite-node": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-3.2.4.tgz", + "integrity": "sha512-EbKSKh+bh1E1IFxeO0pg1n4dvoOTt0UDiXMd/qn++r98+jPO1xtJilvXldeuQ8giIB5IkpjCgMleHMNEsGH6pg==", + "dev": true, + "license": "MIT", + "dependencies": { + "cac": "^6.7.14", + "debug": "^4.4.1", + "es-module-lexer": "^1.7.0", + "pathe": "^2.0.3", + "vite": "^5.0.0 || ^6.0.0 || ^7.0.0-0" + }, + "bin": { + "vite-node": "vite-node.mjs" + }, + "engines": { + "node": "^18.0.0 || ^20.0.0 || >=22.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/vite-node/node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/vite-node/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/vite-plugin-dts": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/vite-plugin-dts/-/vite-plugin-dts-4.5.4.tgz", + "integrity": "sha512-d4sOM8M/8z7vRXHHq/ebbblfaxENjogAAekcfcDCCwAyvGqnPrc7f4NZbvItS+g4WTgerW0xDwSz5qz11JT3vg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@microsoft/api-extractor": "^7.50.1", + "@rollup/pluginutils": "^5.1.4", + "@volar/typescript": "^2.4.11", + "@vue/language-core": "2.2.0", + "compare-versions": "^6.1.1", + "debug": "^4.4.0", + "kolorist": "^1.8.0", + "local-pkg": "^1.0.0", + "magic-string": "^0.30.17" + }, + "peerDependencies": { + "typescript": "*", + "vite": "*" + }, + "peerDependenciesMeta": { + "vite": { + "optional": true + } + } + }, + "node_modules/vite-plugin-dts/node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/vite-plugin-dts/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, "node_modules/vite/node_modules/picomatch": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", @@ -32716,6 +32691,111 @@ "url": "https://github.com/sponsors/SuperchupuDev" } }, + "node_modules/vitest": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-3.2.4.tgz", + "integrity": "sha512-LUCP5ev3GURDysTWiP47wRRUpLKMOfPh+yKTx3kVIEiu5KOMeqzpnYNsKyOoVrULivR8tLcks4+lga33Whn90A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/chai": "^5.2.2", + "@vitest/expect": "3.2.4", + "@vitest/mocker": "3.2.4", + "@vitest/pretty-format": "^3.2.4", + "@vitest/runner": "3.2.4", + "@vitest/snapshot": "3.2.4", + "@vitest/spy": "3.2.4", + "@vitest/utils": "3.2.4", + "chai": "^5.2.0", + "debug": "^4.4.1", + "expect-type": "^1.2.1", + "magic-string": "^0.30.17", + "pathe": "^2.0.3", + "picomatch": "^4.0.2", + "std-env": "^3.9.0", + "tinybench": "^2.9.0", + "tinyexec": "^0.3.2", + "tinyglobby": "^0.2.14", + "tinypool": "^1.1.1", + "tinyrainbow": "^2.0.0", + "vite": "^5.0.0 || ^6.0.0 || ^7.0.0-0", + "vite-node": "3.2.4", + "why-is-node-running": "^2.3.0" + }, + "bin": { + "vitest": "vitest.mjs" + }, + "engines": { + "node": "^18.0.0 || ^20.0.0 || >=22.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "@edge-runtime/vm": "*", + "@types/debug": "^4.1.12", + "@types/node": "^18.0.0 || ^20.0.0 || >=22.0.0", + "@vitest/browser": "3.2.4", + "@vitest/ui": "3.2.4", + "happy-dom": "*", + "jsdom": "*" + }, + "peerDependenciesMeta": { + "@edge-runtime/vm": { + "optional": true + }, + "@types/debug": { + "optional": true + }, + "@types/node": { + "optional": true + }, + "@vitest/browser": { + "optional": true + }, + "@vitest/ui": { + "optional": true + }, + "happy-dom": { + "optional": true + }, + "jsdom": { + "optional": true + } + } + }, + "node_modules/vitest/node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/vitest/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/vscode-uri": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/vscode-uri/-/vscode-uri-3.1.0.tgz", + "integrity": "sha512-/BpdSx+yCQGnCvecbyXdxHDkuk55/G3xwnC0GqY4gmQ3j+A+g8kzzgB4Nk/SINjqn6+waqw3EgbVF2QKExkRxQ==", + "dev": true, + "license": "MIT" + }, "node_modules/w3c-xmlserializer": { "version": "4.0.0", "dev": true, @@ -33126,6 +33206,13 @@ } } }, + "node_modules/webpack-virtual-modules": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/webpack-virtual-modules/-/webpack-virtual-modules-0.6.2.tgz", + "integrity": "sha512-66/V2i5hQanC51vBQKPH4aI8NMAcBW59FVBs+rC7eGHupMyfn34q7rZIE+ETlJ+XTevqfUhVVBgSUNSW2flEUQ==", + "dev": true, + "license": "MIT" + }, "node_modules/webpack/node_modules/@types/estree": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz", @@ -33213,6 +33300,8 @@ }, "node_modules/whatwg-mimetype": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-3.0.0.tgz", + "integrity": "sha512-nt+N2dzIutVRxARx1nghPKGv1xHikU7HKdfafKkLNLindmPU/ch3U31NOCGGA/dmPcmb1VlofO0vnKAcsm0o/Q==", "dev": true, "license": "MIT", "engines": { @@ -33220,15 +33309,17 @@ } }, "node_modules/whatwg-url": { - "version": "11.0.0", + "version": "12.0.1", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-12.0.1.tgz", + "integrity": "sha512-Ed/LrqB8EPlGxjS+TrsXcpUond1mhccS3pchLhzSgPCnTimUCKj3IZE75pAs5m6heB2U2TMerKFUXheyHY+VDQ==", "dev": true, "license": "MIT", "dependencies": { - "tr46": "^3.0.0", + "tr46": "^4.1.1", "webidl-conversions": "^7.0.0" }, "engines": { - "node": ">=12" + "node": ">=14" } }, "node_modules/which": { @@ -33244,6 +33335,23 @@ "node": ">= 8" } }, + "node_modules/why-is-node-running": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.3.0.tgz", + "integrity": "sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w==", + "dev": true, + "license": "MIT", + "dependencies": { + "siginfo": "^2.0.0", + "stackback": "0.0.2" + }, + "bin": { + "why-is-node-running": "cli.js" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/wildcard": { "version": "2.0.1", "dev": true, @@ -33287,18 +33395,6 @@ "version": "1.0.2", "license": "ISC" }, - "node_modules/write-file-atomic": { - "version": "4.0.2", - "dev": true, - "license": "ISC", - "dependencies": { - "imurmurhash": "^0.1.4", - "signal-exit": "^3.0.7" - }, - "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" - } - }, "node_modules/ws": { "version": "8.18.0", "dev": true, diff --git a/package.json b/package.json index e1bc0c8f..4c06c7ce 100644 --- a/package.json +++ b/package.json @@ -92,11 +92,11 @@ "@nx/angular": "21.6.2", "@nx/eslint": "21.6.2", "@nx/eslint-plugin": "21.6.2", - "@nx/jest": "21.6.2", "@nx/js": "21.6.2", "@nx/nest": "21.6.2", "@nx/node": "21.6.2", "@nx/plugin": "^21.6.2", + "@nx/vite": "^21.6.2", "@nx/web": "21.6.2", "@nx/webpack": "21.6.2", "@nx/workspace": "21.6.2", @@ -105,20 +105,19 @@ "@swc/cli": "~0.6.0", "@swc/core": "1.11.7", "@swc/helpers": "0.5.15", - "@types/jest": "29.5.12", "@types/node": "20.19.9", "@types/uuid": "^9.0.8", "@typescript-eslint/eslint-plugin": "7.18.0", "@typescript-eslint/parser": "7.18.0", "@typescript-eslint/utils": "7.18.0", + "@vitest/coverage-v8": "^3.2.4", + "@vitest/ui": "^3.0.0", + "ajv": "^8.0.0", "autoprefixer": "^10.4.0", "eslint": "8.57.0", "eslint-config-prettier": "10.1.5", - "jest": "29.7.0", - "jest-environment-jsdom": "29.7.0", - "jest-environment-node": "^29.7.0", - "jest-preset-angular": "14.6.1", - "jest-util": "^29.7.0", + "jiti": "2.4.2", + "jsdom": "~22.1.0", "jsonc-eslint-parser": "^2.1.0", "knex-pglite": "^0.11.0", "ng-packagr": "20.3.0", @@ -128,12 +127,15 @@ "postcss-url": "~10.1.3", "prettier": "^2.6.2", "rollup": "^4.14.0", - "ts-jest": "29.4.5", "ts-node": "10.9.1", "tsd": "^0.31.2", "typeorm-pglite": "^0.3.2", "typescript": "5.9.3", + "unplugin-swc": "^1.5.7", "verdaccio": "6.0.5", + "vite": "^7.0.0", + "vite-plugin-dts": "~4.5.0", + "vitest": "^3.0.0", "webpack-cli": "^5.1.4" }, "nx": { diff --git a/tools/scripts/prepare-package-json.mjs b/tools/scripts/prepare-package-json.mjs index d635e78a..4b1351f3 100644 --- a/tools/scripts/prepare-package-json.mjs +++ b/tools/scripts/prepare-package-json.mjs @@ -54,7 +54,7 @@ function removeDepFromOtherLib(graph, name, json) { return acum; }, {}); - for (const [name] of Object.entries(json.peerDependencies)) { + for (const [name] of Object.entries(json.peerDependencies || {})) { if (!Object.keys(libsName).includes(name)) { continue; } diff --git a/tsconfig.base.json b/tsconfig.base.json index 5afe9edd..26156e96 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -15,11 +15,17 @@ "skipDefaultLibCheck": true, "baseUrl": ".", "paths": { + "@klerick/json-api-nestjs": [ + "libs/json-api/json-api-nestjs/src/index.ts" + ], "@klerick/json-api-nestjs-microorm": [ - "dist/libs/json-api/json-api-nestjs-microorm" + "libs/json-api/json-api-nestjs-microorm/src/index.ts" + ], + "@klerick/json-api-nestjs-shared": [ + "libs/json-api/json-api-nestjs-shared/src/index.ts" ], "@klerick/json-api-nestjs-typeorm": [ - "dist/libs/json-api/json-api-nestjs-typeorm" + "libs/json-api/json-api-nestjs-typeorm/src/index.ts" ], "@klerick/nestjs-json-rpc": [ "libs/json-rpc/nestjs-json-rpc/src/index.ts" diff --git a/vitest.workspace.ts b/vitest.workspace.ts new file mode 100644 index 00000000..de0e49dc --- /dev/null +++ b/vitest.workspace.ts @@ -0,0 +1,4 @@ +export default [ + '**/*/vite.config.{mjs,js,ts,mts}', + '**/*/vitest.config.{mjs,js,ts,mts}', +]; From 4201c40ba3a0ad259cfc95c0a629ef5fb287c6c5 Mon Sep 17 00:00:00 2001 From: Alex H Date: Wed, 15 Oct 2025 07:13:39 +0200 Subject: [PATCH 2/3] chore: change tsconfig and test of type --- .../json-api-nestjs-shared/src/index.d.ts | 3 -- .../json-api-nestjs-shared/src/index.js | 7 --- .../json-api-nestjs-shared/src/index.js.map | 1 - .../src/lib/constants/index.d.ts | 2 - .../src/lib/constants/index.js | 6 --- .../src/lib/constants/index.js.map | 1 - .../src/lib/types/entity-type.d.ts | 19 ------- .../src/lib/types/entity-type.js | 3 -- .../src/lib/types/entity-type.js.map | 1 - .../src/lib/types/index.d.ts | 3 -- .../src/lib/types/index.js | 7 --- .../src/lib/types/index.js.map | 1 - .../src/lib/types/query-type.d.ts | 39 -------------- .../src/lib/types/query-type.js | 48 ----------------- .../src/lib/types/query-type.js.map | 1 - .../src/lib/types/response-body.d.ts | 53 ------------------- .../src/lib/types/response-body.js | 3 -- .../src/lib/types/response-body.js.map | 1 - .../src/lib/utils/index.d.ts | 1 - .../src/lib/utils/index.js | 5 -- .../src/lib/utils/index.js.map | 1 - .../src/lib/utils/object-utils.d.ts | 10 ---- .../src/lib/utils/object-utils.js | 46 ---------------- .../src/lib/utils/object-utils.js.map | 1 - .../mixin/zod/map-transform-to-json-shema.ts | 20 ++++++- .../mixin/zod/zod-share/attributes.test-d.ts | 6 +-- .../modules/mixin/zod/zod-share/attributes.ts | 2 +- .../json-api-nestjs/tsconfig.lib.json | 2 +- tsconfig.base.json | 2 + 29 files changed, 25 insertions(+), 270 deletions(-) delete mode 100644 libs/json-api/json-api-nestjs-shared/src/index.d.ts delete mode 100644 libs/json-api/json-api-nestjs-shared/src/index.js delete mode 100644 libs/json-api/json-api-nestjs-shared/src/index.js.map delete mode 100644 libs/json-api/json-api-nestjs-shared/src/lib/constants/index.d.ts delete mode 100644 libs/json-api/json-api-nestjs-shared/src/lib/constants/index.js delete mode 100644 libs/json-api/json-api-nestjs-shared/src/lib/constants/index.js.map delete mode 100644 libs/json-api/json-api-nestjs-shared/src/lib/types/entity-type.d.ts delete mode 100644 libs/json-api/json-api-nestjs-shared/src/lib/types/entity-type.js delete mode 100644 libs/json-api/json-api-nestjs-shared/src/lib/types/entity-type.js.map delete mode 100644 libs/json-api/json-api-nestjs-shared/src/lib/types/index.d.ts delete mode 100644 libs/json-api/json-api-nestjs-shared/src/lib/types/index.js delete mode 100644 libs/json-api/json-api-nestjs-shared/src/lib/types/index.js.map delete mode 100644 libs/json-api/json-api-nestjs-shared/src/lib/types/query-type.d.ts delete mode 100644 libs/json-api/json-api-nestjs-shared/src/lib/types/query-type.js delete mode 100644 libs/json-api/json-api-nestjs-shared/src/lib/types/query-type.js.map delete mode 100644 libs/json-api/json-api-nestjs-shared/src/lib/types/response-body.d.ts delete mode 100644 libs/json-api/json-api-nestjs-shared/src/lib/types/response-body.js delete mode 100644 libs/json-api/json-api-nestjs-shared/src/lib/types/response-body.js.map delete mode 100644 libs/json-api/json-api-nestjs-shared/src/lib/utils/index.d.ts delete mode 100644 libs/json-api/json-api-nestjs-shared/src/lib/utils/index.js delete mode 100644 libs/json-api/json-api-nestjs-shared/src/lib/utils/index.js.map delete mode 100644 libs/json-api/json-api-nestjs-shared/src/lib/utils/object-utils.d.ts delete mode 100644 libs/json-api/json-api-nestjs-shared/src/lib/utils/object-utils.js delete mode 100644 libs/json-api/json-api-nestjs-shared/src/lib/utils/object-utils.js.map diff --git a/libs/json-api/json-api-nestjs-shared/src/index.d.ts b/libs/json-api/json-api-nestjs-shared/src/index.d.ts deleted file mode 100644 index e54953b8..00000000 --- a/libs/json-api/json-api-nestjs-shared/src/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './lib/utils'; -export * from './lib/types'; -export * from './lib/constants'; diff --git a/libs/json-api/json-api-nestjs-shared/src/index.js b/libs/json-api/json-api-nestjs-shared/src/index.js deleted file mode 100644 index a93f08cd..00000000 --- a/libs/json-api/json-api-nestjs-shared/src/index.js +++ /dev/null @@ -1,7 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const tslib_1 = require("tslib"); -tslib_1.__exportStar(require("./lib/utils"), exports); -tslib_1.__exportStar(require("./lib/types"), exports); -tslib_1.__exportStar(require("./lib/constants"), exports); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/libs/json-api/json-api-nestjs-shared/src/index.js.map b/libs/json-api/json-api-nestjs-shared/src/index.js.map deleted file mode 100644 index cd73a18f..00000000 --- a/libs/json-api/json-api-nestjs-shared/src/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;AAAA,sDAA4B;AAC5B,sDAA4B;AAC5B,0DAAgC"} \ No newline at end of file diff --git a/libs/json-api/json-api-nestjs-shared/src/lib/constants/index.d.ts b/libs/json-api/json-api-nestjs-shared/src/lib/constants/index.d.ts deleted file mode 100644 index 8d168210..00000000 --- a/libs/json-api/json-api-nestjs-shared/src/lib/constants/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare const KEY_MAIN_INPUT_SCHEMA = "atomic:operations"; -export declare const KEY_MAIN_OUTPUT_SCHEMA = "atomic:results"; diff --git a/libs/json-api/json-api-nestjs-shared/src/lib/constants/index.js b/libs/json-api/json-api-nestjs-shared/src/lib/constants/index.js deleted file mode 100644 index e83fc1cb..00000000 --- a/libs/json-api/json-api-nestjs-shared/src/lib/constants/index.js +++ /dev/null @@ -1,6 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.KEY_MAIN_OUTPUT_SCHEMA = exports.KEY_MAIN_INPUT_SCHEMA = void 0; -exports.KEY_MAIN_INPUT_SCHEMA = 'atomic:operations'; -exports.KEY_MAIN_OUTPUT_SCHEMA = 'atomic:results'; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/libs/json-api/json-api-nestjs-shared/src/lib/constants/index.js.map b/libs/json-api/json-api-nestjs-shared/src/lib/constants/index.js.map deleted file mode 100644 index 678787ba..00000000 --- a/libs/json-api/json-api-nestjs-shared/src/lib/constants/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;AAAa,QAAA,qBAAqB,GAAG,mBAAmB,CAAC;AAC5C,QAAA,sBAAsB,GAAG,gBAAgB,CAAC"} \ No newline at end of file diff --git a/libs/json-api/json-api-nestjs-shared/src/lib/types/entity-type.d.ts b/libs/json-api/json-api-nestjs-shared/src/lib/types/entity-type.d.ts deleted file mode 100644 index 8b7a3526..00000000 --- a/libs/json-api/json-api-nestjs-shared/src/lib/types/entity-type.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { Any } from 'ts-toolbelt'; -export type HasId = Any.At extends undefined ? 0 : 1; -export type CastIteratorType = T extends { - [Symbol.iterator](): Iterator; -} ? U : T; -type RelationCheck = T extends never ? 0 : T extends Promise ? HasId : HasId, IdKey>; -export type RelationKeys = { - [K in keyof E]: Exclude extends never ? never : RelationCheck, IdKey> extends 1 ? K : never; -}[keyof E]; -export type PropertyKeys = keyof Omit>; -export type IsIterator = T extends { - [Symbol.iterator](): Iterator; -} ? 1 : 0; -export type TypeOfArray = T extends (infer U)[] ? U : T; -export type ValueOf = T[keyof T]; -export type Constructor = new (...args: any[]) => T; -export type AnyEntity = T; -export type EntityClass = Constructor; -export {}; diff --git a/libs/json-api/json-api-nestjs-shared/src/lib/types/entity-type.js b/libs/json-api/json-api-nestjs-shared/src/lib/types/entity-type.js deleted file mode 100644 index 2763b80d..00000000 --- a/libs/json-api/json-api-nestjs-shared/src/lib/types/entity-type.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -//# sourceMappingURL=entity-type.js.map \ No newline at end of file diff --git a/libs/json-api/json-api-nestjs-shared/src/lib/types/entity-type.js.map b/libs/json-api/json-api-nestjs-shared/src/lib/types/entity-type.js.map deleted file mode 100644 index 5a42aaf1..00000000 --- a/libs/json-api/json-api-nestjs-shared/src/lib/types/entity-type.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"entity-type.js","sourceRoot":"","sources":["entity-type.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/libs/json-api/json-api-nestjs-shared/src/lib/types/index.d.ts b/libs/json-api/json-api-nestjs-shared/src/lib/types/index.d.ts deleted file mode 100644 index e092f90f..00000000 --- a/libs/json-api/json-api-nestjs-shared/src/lib/types/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './query-type'; -export * from './entity-type'; -export * from './response-body'; diff --git a/libs/json-api/json-api-nestjs-shared/src/lib/types/index.js b/libs/json-api/json-api-nestjs-shared/src/lib/types/index.js deleted file mode 100644 index f456fa6d..00000000 --- a/libs/json-api/json-api-nestjs-shared/src/lib/types/index.js +++ /dev/null @@ -1,7 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const tslib_1 = require("tslib"); -tslib_1.__exportStar(require("./query-type"), exports); -tslib_1.__exportStar(require("./entity-type"), exports); -tslib_1.__exportStar(require("./response-body"), exports); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/libs/json-api/json-api-nestjs-shared/src/lib/types/index.js.map b/libs/json-api/json-api-nestjs-shared/src/lib/types/index.js.map deleted file mode 100644 index 42a3ee24..00000000 --- a/libs/json-api/json-api-nestjs-shared/src/lib/types/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;AAAA,uDAA6B;AAC7B,wDAA8B;AAC9B,0DAAgC"} \ No newline at end of file diff --git a/libs/json-api/json-api-nestjs-shared/src/lib/types/query-type.d.ts b/libs/json-api/json-api-nestjs-shared/src/lib/types/query-type.d.ts deleted file mode 100644 index d615ce22..00000000 --- a/libs/json-api/json-api-nestjs-shared/src/lib/types/query-type.d.ts +++ /dev/null @@ -1,39 +0,0 @@ -export declare enum QueryField { - filter = "filter", - sort = "sort", - include = "include", - page = "page", - fields = "fields" -} -export declare enum FilterOperand { - eq = "eq", - gt = "gt", - gte = "gte", - like = "like", - lt = "lt", - lte = "lte", - ne = "ne", - regexp = "regexp", - in = "in", - nin = "nin", - some = "some" -} -export declare enum FilterOperandOnlyInNin { - in = "in", - nin = "nin" -} -export declare enum FilterOperandOnlySimple { - eq = "eq", - gt = "gt", - gte = "gte", - like = "like", - lt = "lt", - lte = "lte", - ne = "ne", - regexp = "regexp" -} -export declare enum Operation { - add = "add", - update = "update", - remove = "remove" -} diff --git a/libs/json-api/json-api-nestjs-shared/src/lib/types/query-type.js b/libs/json-api/json-api-nestjs-shared/src/lib/types/query-type.js deleted file mode 100644 index 6c0ac2d4..00000000 --- a/libs/json-api/json-api-nestjs-shared/src/lib/types/query-type.js +++ /dev/null @@ -1,48 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.Operation = exports.FilterOperandOnlySimple = exports.FilterOperandOnlyInNin = exports.FilterOperand = exports.QueryField = void 0; -var QueryField; -(function (QueryField) { - QueryField["filter"] = "filter"; - QueryField["sort"] = "sort"; - QueryField["include"] = "include"; - QueryField["page"] = "page"; - QueryField["fields"] = "fields"; -})(QueryField || (exports.QueryField = QueryField = {})); -var FilterOperand; -(function (FilterOperand) { - FilterOperand["eq"] = "eq"; - FilterOperand["gt"] = "gt"; - FilterOperand["gte"] = "gte"; - FilterOperand["like"] = "like"; - FilterOperand["lt"] = "lt"; - FilterOperand["lte"] = "lte"; - FilterOperand["ne"] = "ne"; - FilterOperand["regexp"] = "regexp"; - FilterOperand["in"] = "in"; - FilterOperand["nin"] = "nin"; - FilterOperand["some"] = "some"; -})(FilterOperand || (exports.FilterOperand = FilterOperand = {})); -var FilterOperandOnlyInNin; -(function (FilterOperandOnlyInNin) { - FilterOperandOnlyInNin["in"] = "in"; - FilterOperandOnlyInNin["nin"] = "nin"; -})(FilterOperandOnlyInNin || (exports.FilterOperandOnlyInNin = FilterOperandOnlyInNin = {})); -var FilterOperandOnlySimple; -(function (FilterOperandOnlySimple) { - FilterOperandOnlySimple["eq"] = "eq"; - FilterOperandOnlySimple["gt"] = "gt"; - FilterOperandOnlySimple["gte"] = "gte"; - FilterOperandOnlySimple["like"] = "like"; - FilterOperandOnlySimple["lt"] = "lt"; - FilterOperandOnlySimple["lte"] = "lte"; - FilterOperandOnlySimple["ne"] = "ne"; - FilterOperandOnlySimple["regexp"] = "regexp"; -})(FilterOperandOnlySimple || (exports.FilterOperandOnlySimple = FilterOperandOnlySimple = {})); -var Operation; -(function (Operation) { - Operation["add"] = "add"; - Operation["update"] = "update"; - Operation["remove"] = "remove"; -})(Operation || (exports.Operation = Operation = {})); -//# sourceMappingURL=query-type.js.map \ No newline at end of file diff --git a/libs/json-api/json-api-nestjs-shared/src/lib/types/query-type.js.map b/libs/json-api/json-api-nestjs-shared/src/lib/types/query-type.js.map deleted file mode 100644 index bd735bd2..00000000 --- a/libs/json-api/json-api-nestjs-shared/src/lib/types/query-type.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"query-type.js","sourceRoot":"","sources":["query-type.ts"],"names":[],"mappings":";;;AAAA,IAAY,UAMX;AAND,WAAY,UAAU;IACpB,+BAAiB,CAAA;IACjB,2BAAa,CAAA;IACb,iCAAmB,CAAA;IACnB,2BAAa,CAAA;IACb,+BAAiB,CAAA;AACnB,CAAC,EANW,UAAU,0BAAV,UAAU,QAMrB;AAED,IAAY,aAYX;AAZD,WAAY,aAAa;IACvB,0BAAS,CAAA;IACT,0BAAS,CAAA;IACT,4BAAW,CAAA;IACX,8BAAa,CAAA;IACb,0BAAS,CAAA;IACT,4BAAW,CAAA;IACX,0BAAS,CAAA;IACT,kCAAiB,CAAA;IACjB,0BAAS,CAAA;IACT,4BAAW,CAAA;IACX,8BAAa,CAAA;AACf,CAAC,EAZW,aAAa,6BAAb,aAAa,QAYxB;AAED,IAAY,sBAGX;AAHD,WAAY,sBAAsB;IAChC,mCAAS,CAAA;IACT,qCAAW,CAAA;AACb,CAAC,EAHW,sBAAsB,sCAAtB,sBAAsB,QAGjC;AACD,IAAY,uBASX;AATD,WAAY,uBAAuB;IACjC,oCAAS,CAAA;IACT,oCAAS,CAAA;IACT,sCAAW,CAAA;IACX,wCAAa,CAAA;IACb,oCAAS,CAAA;IACT,sCAAW,CAAA;IACX,oCAAS,CAAA;IACT,4CAAiB,CAAA;AACnB,CAAC,EATW,uBAAuB,uCAAvB,uBAAuB,QASlC;AAED,IAAY,SAIX;AAJD,WAAY,SAAS;IACnB,wBAAW,CAAA;IACX,8BAAiB,CAAA;IACjB,8BAAiB,CAAA;AACnB,CAAC,EAJW,SAAS,yBAAT,SAAS,QAIpB"} \ No newline at end of file diff --git a/libs/json-api/json-api-nestjs-shared/src/lib/types/response-body.d.ts b/libs/json-api/json-api-nestjs-shared/src/lib/types/response-body.d.ts deleted file mode 100644 index 7243f613..00000000 --- a/libs/json-api/json-api-nestjs-shared/src/lib/types/response-body.d.ts +++ /dev/null @@ -1,53 +0,0 @@ -import { PropertyKeys, RelationKeys, IsIterator, CastIteratorType } from './entity-type'; -import { ValueOf } from './entity-type'; -export type DebugMetaProps = Partial<{ - time: number; -}>; -export type PageProps = { - totalItems: number; - pageNumber: number; - pageSize: number; -}; -export type MainData = { - type: T; - id: string; -}; -export type BaseMainData> = { - data: IsIterator extends 1 ? MainData[] : [Extract] extends [never] ? MainData : MainData | null; -}; -export type MetaProps = R extends null ? T : T & R; -export type MetaPropsForArrayResourceObject = MetaProps; -export type Links = { - self: string; -}; -export type BaseLinks = { - links: Links; -}; -export type Attributes = { - [P in Exclude, IdKey>]?: Entity[P]; -}; -export type BaseAttribute = { - attributes?: Attributes; -}; -export type Relationships = { - [P in RelationKeys]?: BaseLinks | (BaseLinks & BaseMainData); -}; -export type BaseRelationships = { - relationships?: Relationships; -}; -export type Meta = Type extends 'array' ? MetaProps : MetaProps; -export type BaseMeta = { - meta: Meta; -}; -export type BaseResourceData = { - data: Type extends 'array' ? ResourceData[] : ResourceData; -}; -export type Include = ValueOf<{ - [Rel in RelationKeys]: CastIteratorType extends object ? ResourceData> : never; -}>; -export type BaseIncluded = { - included?: Include[]; -}; -export type ResourceData = MainData & BaseAttribute & BaseRelationships & BaseLinks; -export type ResourceObject = BaseMeta & BaseResourceData & BaseIncluded; -export type ResourceObjectRelationships> = BaseMeta & BaseMainData; diff --git a/libs/json-api/json-api-nestjs-shared/src/lib/types/response-body.js b/libs/json-api/json-api-nestjs-shared/src/lib/types/response-body.js deleted file mode 100644 index 8c538e64..00000000 --- a/libs/json-api/json-api-nestjs-shared/src/lib/types/response-body.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -//# sourceMappingURL=response-body.js.map \ No newline at end of file diff --git a/libs/json-api/json-api-nestjs-shared/src/lib/types/response-body.js.map b/libs/json-api/json-api-nestjs-shared/src/lib/types/response-body.js.map deleted file mode 100644 index 6887a347..00000000 --- a/libs/json-api/json-api-nestjs-shared/src/lib/types/response-body.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"response-body.js","sourceRoot":"","sources":["response-body.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/libs/json-api/json-api-nestjs-shared/src/lib/utils/index.d.ts b/libs/json-api/json-api-nestjs-shared/src/lib/utils/index.d.ts deleted file mode 100644 index 53a4561e..00000000 --- a/libs/json-api/json-api-nestjs-shared/src/lib/utils/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './object-utils'; diff --git a/libs/json-api/json-api-nestjs-shared/src/lib/utils/index.js b/libs/json-api/json-api-nestjs-shared/src/lib/utils/index.js deleted file mode 100644 index 15edc53f..00000000 --- a/libs/json-api/json-api-nestjs-shared/src/lib/utils/index.js +++ /dev/null @@ -1,5 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const tslib_1 = require("tslib"); -tslib_1.__exportStar(require("./object-utils"), exports); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/libs/json-api/json-api-nestjs-shared/src/lib/utils/index.js.map b/libs/json-api/json-api-nestjs-shared/src/lib/utils/index.js.map deleted file mode 100644 index ca17f033..00000000 --- a/libs/json-api/json-api-nestjs-shared/src/lib/utils/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;AAAA,yDAA+B"} \ No newline at end of file diff --git a/libs/json-api/json-api-nestjs-shared/src/lib/utils/object-utils.d.ts b/libs/json-api/json-api-nestjs-shared/src/lib/utils/object-utils.d.ts deleted file mode 100644 index af3380f7..00000000 --- a/libs/json-api/json-api-nestjs-shared/src/lib/utils/object-utils.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -export declare const ObjectTyped: { - keys: (yourObject: T) => Array; - values: (yourObject: U) => Array; - entries: (yourObject: O) => Array<[keyof O, O[keyof O]]>; - fromEntries: (yourObjectEntries: [K, V][]) => Record; -}; -export declare function isObject(item: unknown): item is object; -export declare function isString(value: T): value is P; -export declare function createEntityInstance(name: string): E; -export declare const getEntityName: (entity: unknown) => string; diff --git a/libs/json-api/json-api-nestjs-shared/src/lib/utils/object-utils.js b/libs/json-api/json-api-nestjs-shared/src/lib/utils/object-utils.js deleted file mode 100644 index af450ff2..00000000 --- a/libs/json-api/json-api-nestjs-shared/src/lib/utils/object-utils.js +++ /dev/null @@ -1,46 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.getEntityName = exports.ObjectTyped = void 0; -exports.isObject = isObject; -exports.isString = isString; -exports.createEntityInstance = createEntityInstance; -const change_case_commonjs_1 = require("change-case-commonjs"); -exports.ObjectTyped = { - keys: Object.keys, - values: Object.values, - entries: Object.entries, - fromEntries: Object.fromEntries, -}; -function isObject(item) { - return typeof item === 'object' && !Array.isArray(item) && item !== null; -} -function isString(value) { - return typeof value === 'string' || value instanceof String; -} -function createEntityInstance(name) { - const entityName = (0, change_case_commonjs_1.pascalCase)(name); - return Function('return new class ' + entityName + '{}')(); -} -const getEntityName = (entity) => { - if (entity === null) - throw new Error('Entity is null'); - if (typeof entity === 'string') { - return entity; - } - if (typeof entity === 'object' && 'name' in entity) { - return `${entity['name']}`; - } - if (typeof entity === 'object' && - 'constructor' in entity && - 'name' in entity.constructor) { - return entity['constructor']['name']; - } - if (typeof entity === 'function' && - 'constructor' in entity.prototype && - 'name' in entity.prototype.constructor) { - return entity.prototype.constructor.name; - } - throw new Error('Entity is not object'); -}; -exports.getEntityName = getEntityName; -//# sourceMappingURL=object-utils.js.map \ No newline at end of file diff --git a/libs/json-api/json-api-nestjs-shared/src/lib/utils/object-utils.js.map b/libs/json-api/json-api-nestjs-shared/src/lib/utils/object-utils.js.map deleted file mode 100644 index bcbe195a..00000000 --- a/libs/json-api/json-api-nestjs-shared/src/lib/utils/object-utils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"object-utils.js","sourceRoot":"","sources":["object-utils.ts"],"names":[],"mappings":";;;AAaA,4BAEC;AAED,4BAEC;AAED,oDAGC;AAxBD,+DAAkD;AAErC,QAAA,WAAW,GAAG;IACzB,IAAI,EAAE,MAAM,CAAC,IAAuD;IACpE,MAAM,EAAE,MAAM,CAAC,MAA4D;IAC3E,OAAO,EAAE,MAAM,CAAC,OAEiB;IACjC,WAAW,EAAE,MAAM,CAAC,WAEH;CAClB,CAAC;AAEF,SAAgB,QAAQ,CAAC,IAAa;IACpC,OAAO,OAAO,IAAI,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,IAAI,KAAK,IAAI,CAAC;AAC3E,CAAC;AAED,SAAgB,QAAQ,CAAiB,KAAQ;IAC/C,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,YAAY,MAAM,CAAC;AAC9D,CAAC;AAED,SAAgB,oBAAoB,CAAI,IAAY;IAClD,MAAM,UAAU,GAAG,IAAA,iCAAU,EAAC,IAAI,CAAC,CAAC;IACpC,OAAO,QAAQ,CAAC,mBAAmB,GAAG,UAAU,GAAG,IAAI,CAAC,EAAE,CAAC;AAC7D,CAAC;AAEM,MAAM,aAAa,GAAG,CAAC,MAAe,EAAU,EAAE;IACvD,IAAI,MAAM,KAAK,IAAI;QAAE,MAAM,IAAI,KAAK,CAAC,gBAAgB,CAAC,CAAC;IAEvD,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;QAC/B,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,IAAI,MAAM,EAAE,CAAC;QACnD,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;IAC7B,CAAC;IAED,IACE,OAAO,MAAM,KAAK,QAAQ;QAC1B,aAAa,IAAI,MAAM;QACvB,MAAM,IAAI,MAAM,CAAC,WAAW,EAC5B,CAAC;QACD,OAAO,MAAM,CAAC,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;IACvC,CAAC;IAED,IACE,OAAO,MAAM,KAAK,UAAU;QAC5B,aAAa,IAAI,MAAM,CAAC,SAAS;QACjC,MAAM,IAAI,MAAM,CAAC,SAAS,CAAC,WAAW,EACtC,CAAC;QACD,OAAO,MAAM,CAAC,SAAS,CAAC,WAAW,CAAC,IAAI,CAAC;IAC3C,CAAC;IAED,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;AAC1C,CAAC,CAAC;AA5BW,QAAA,aAAa,iBA4BxB"} \ No newline at end of file diff --git a/libs/json-api/json-api-nestjs/src/lib/modules/mixin/zod/map-transform-to-json-shema.ts b/libs/json-api/json-api-nestjs/src/lib/modules/mixin/zod/map-transform-to-json-shema.ts index 7a834e93..2caa934d 100644 --- a/libs/json-api/json-api-nestjs/src/lib/modules/mixin/zod/map-transform-to-json-shema.ts +++ b/libs/json-api/json-api-nestjs/src/lib/modules/mixin/zod/map-transform-to-json-shema.ts @@ -1,7 +1,23 @@ import type { JSONSchema } from 'zod/v4/core'; -export function transformDateString(i: string | null | undefined) { - return i === null || i === undefined ? i : new Date(i); +type DateStringTransform< + Null extends true | false, + isPatch extends true | false +> = isPatch extends true + ? + Null extends true ? Date | null | undefined : Date | undefined + : + Null extends true ? Date | null | undefined : Date; + +export function transformDateString< + Null extends true | false, + isPatch extends true | false +>(i: string | null | undefined): DateStringTransform { + + if (i === null || i === undefined) { + return i as DateStringTransform; + } + return new Date(i) } export function transformStringToArray(input: string | undefined) { diff --git a/libs/json-api/json-api-nestjs/src/lib/modules/mixin/zod/zod-share/attributes.test-d.ts b/libs/json-api/json-api-nestjs/src/lib/modules/mixin/zod/zod-share/attributes.test-d.ts index cbe90b95..244c078b 100644 --- a/libs/json-api/json-api-nestjs/src/lib/modules/mixin/zod/zod-share/attributes.test-d.ts +++ b/libs/json-api/json-api-nestjs/src/lib/modules/mixin/zod/zod-share/attributes.test-d.ts @@ -34,9 +34,9 @@ type CheckAttrPatch = { login?: string | undefined; firstName?: string | undefined; testArrayNull?: number[] | null | undefined; - testDate?: Date | undefined; - createdAt?: Date | undefined; - updatedAt?: Date | undefined; + testDate: Date | undefined; + createdAt: Date | undefined; + updatedAt: Date | undefined; lastName?: string | null | undefined; isActive?: string | null | undefined; }; diff --git a/libs/json-api/json-api-nestjs/src/lib/modules/mixin/zod/zod-share/attributes.ts b/libs/json-api/json-api-nestjs/src/lib/modules/mixin/zod/zod-share/attributes.ts index bdb8ffe9..c765d89d 100644 --- a/libs/json-api/json-api-nestjs/src/lib/modules/mixin/zod/zod-share/attributes.ts +++ b/libs/json-api/json-api-nestjs/src/lib/modules/mixin/zod/zod-share/attributes.ts @@ -26,7 +26,7 @@ function getZodRulesForDate< Null extends true | false, isPatch extends true | false >(isNullable: Null, isPatch: isPatch) { - return setOptionalOrNot(z.iso.datetime(), isNullable, isPatch).transform(transformDateString); + return setOptionalOrNot(z.iso.datetime(), isNullable, isPatch).transform(transformDateString); } function getZodRulesForBoolean< diff --git a/libs/json-api/json-api-nestjs/tsconfig.lib.json b/libs/json-api/json-api-nestjs/tsconfig.lib.json index 4de8955d..11b0e56d 100644 --- a/libs/json-api/json-api-nestjs/tsconfig.lib.json +++ b/libs/json-api/json-api-nestjs/tsconfig.lib.json @@ -9,7 +9,7 @@ "noImplicitAny": true, "strictBindCallApply": true, "forceConsistentCasingInFileNames": true, - "noFallthroughCasesInSwitch": true, + "strict": true, }, "include": ["src/**/*.ts"], "exclude": ["src/**/*.spec.ts", "src/**/*.test.ts", "src/**/*.test-d.ts", "src/lib/utils/___test___/**/*.ts"] diff --git a/tsconfig.base.json b/tsconfig.base.json index 26156e96..1247f331 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -13,6 +13,8 @@ "lib": ["es2020", "dom"], "skipLibCheck": true, "skipDefaultLibCheck": true, + "strict": true, + "strictNullChecks": true, "baseUrl": ".", "paths": { "@klerick/json-api-nestjs": [ From 90f06ca855a26a98f5720053d6828cf469d3d15c Mon Sep 17 00:00:00 2001 From: Alex H Date: Wed, 15 Oct 2025 07:39:23 +0200 Subject: [PATCH 3/3] chore: fix type for server --- .gitignore | 1 + apps/json-api-server-e2e/project.json | 2 +- .../controllers/extend-user/extend-user.controller.ts | 4 ++-- .../controllers/extend-user/extend-user.controller.ts | 4 ++-- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 1e9e5ebb..b8b5b251 100644 --- a/.gitignore +++ b/.gitignore @@ -42,6 +42,7 @@ Thumbs.db .nx/workspace-data .angular .dev.env +.env.local vite.config.*.timestamp* vitest.config.*.timestamp* diff --git a/apps/json-api-server-e2e/project.json b/apps/json-api-server-e2e/project.json index 9a612596..07acaf38 100644 --- a/apps/json-api-server-e2e/project.json +++ b/apps/json-api-server-e2e/project.json @@ -2,7 +2,7 @@ "name": "json-api-server-e2e", "$schema": "../../node_modules/nx/schemas/project-schema.json", "implicitDependencies": [ - "json-api-server" + "json-api-server", "json-api-nestjs-sdk" ], "projectType": "application", "targets": { diff --git a/apps/json-api-server/src/app/resources/micro-orm/controllers/extend-user/extend-user.controller.ts b/apps/json-api-server/src/app/resources/micro-orm/controllers/extend-user/extend-user.controller.ts index de2bd612..52ba4dac 100644 --- a/apps/json-api-server/src/app/resources/micro-orm/controllers/extend-user/extend-user.controller.ts +++ b/apps/json-api-server/src/app/resources/micro-orm/controllers/extend-user/extend-user.controller.ts @@ -41,8 +41,8 @@ import { AtomicInterceptor } from '../../service/atomic.interceptor'; @UseInterceptors(ControllerInterceptor) @JsonApi(Users) export class ExtendUserController extends JsonBaseController { - @InjectService() public service: JsonApiService; - @Inject(ExampleService) protected exampleService: ExampleService; + @InjectService() public service!: JsonApiService; + @Inject(ExampleService) protected exampleService!: ExampleService; override getOne( id: string | number, query: QueryOne diff --git a/apps/json-api-server/src/app/resources/type-orm/controllers/extend-user/extend-user.controller.ts b/apps/json-api-server/src/app/resources/type-orm/controllers/extend-user/extend-user.controller.ts index faa1ae08..e83234fb 100644 --- a/apps/json-api-server/src/app/resources/type-orm/controllers/extend-user/extend-user.controller.ts +++ b/apps/json-api-server/src/app/resources/type-orm/controllers/extend-user/extend-user.controller.ts @@ -41,8 +41,8 @@ import { AtomicInterceptor } from '../../service/atomic.interceptor'; @UseInterceptors(ControllerInterceptor) @JsonApi(Users) export class ExtendUserController extends JsonBaseController { - @InjectService() public service: JsonApiService; - @Inject(ExampleService) protected exampleService: ExampleService; + @InjectService() public service!: JsonApiService; + @Inject(ExampleService) protected exampleService!: ExampleService; override getOne( id: string | number, query: QueryOne