diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index c26ec585..0646302f 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -4,13 +4,13 @@ Make sure you've read the contributing guidelines (CONTRIBUTING.md) | Question | Answer | | --------------- | ------ | -| Bug fix | ✔/✖ | -| New feature | ✔/✖ | -| Breaking change | ✔/✖ | -| Deprecations | ✔/✖ | -| Documentation | ✔/✖ | -| Tests added | ✔/✖ | -| Chore | ✔/✖ | +| Bug fix | ✔/✖ | +| New feature | ✔/✖ | +| Breaking change | ✔/✖ | +| Deprecations | ✔/✖ | +| Documentation | ✔/✖ | +| Tests added | ✔/✖ | +| Chore | ✔/✖ | Related issues: #XXX , #XXX ... Closes #XXX ... diff --git a/apps/auth-cron/eslint.config.mjs b/apps/auth-cron/eslint.config.mjs index b73c9aa8..71f38a4c 100644 --- a/apps/auth-cron/eslint.config.mjs +++ b/apps/auth-cron/eslint.config.mjs @@ -1,4 +1,5 @@ -import { config } from '@map-colonies/eslint-config/helpers'; -import baseConfig from '../../eslint.config.mjs'; +import { defineConfig, globalIgnores } from 'eslint/config'; +import tsBaseConfig from '@map-colonies/eslint-config/ts-base'; +import vitestConfig from '@map-colonies/eslint-config/vitest'; -export default config(baseConfig, {}); +export default defineConfig(tsBaseConfig, vitestConfig, globalIgnores(['vitest.config.mts', 'ui/**/*', 'drizzle.config.mts'])); diff --git a/apps/auth-cron/package.json b/apps/auth-cron/package.json index cc69d396..116527ad 100644 --- a/apps/auth-cron/package.json +++ b/apps/auth-cron/package.json @@ -12,8 +12,6 @@ "url": "git+https://github.com/MapColonies/opa-la.git" }, "scripts": { - "format": "prettier --check .", - "format:fix": "prettier --write .", "lint": "eslint .", "lint:fix": "eslint --fix .", "migration:run": "npm run typeorm migration:run -- ", diff --git a/apps/auth-cron/src/index.ts b/apps/auth-cron/src/index.ts index 617c75d5..99aca2f5 100644 --- a/apps/auth-cron/src/index.ts +++ b/apps/auth-cron/src/index.ts @@ -5,9 +5,11 @@ import { env } from 'node:process'; import { createServer } from 'node:http'; import express from 'express'; import { createTerminus } from '@godaddy/terminus'; -import { CatchCallbackFn, Cron } from 'croner'; -import { DataSource, Repository } from 'typeorm'; -import { Bundle, Environments, initConnection } from '@map-colonies/auth-core'; +import type { CatchCallbackFn } from 'croner'; +import { Cron } from 'croner'; +import type { DataSource, Repository } from 'typeorm'; +import type { Environments } from '@map-colonies/auth-core'; +import { Bundle, initConnection } from '@map-colonies/auth-core'; import type { commonDbFullV1Type } from '@map-colonies/schemas'; import { BundleDatabase } from '@map-colonies/auth-bundler'; import { collectMetricsExpressMiddleware } from '@map-colonies/telemetry/prom-metrics'; @@ -66,5 +68,4 @@ const main = async (): Promise => { }); }; -// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment main().catch((err) => logger?.error({ msg: 'program terminated with an error', err })); diff --git a/apps/auth-cron/src/job.ts b/apps/auth-cron/src/job.ts index c7d35311..cfaaf6f5 100644 --- a/apps/auth-cron/src/job.ts +++ b/apps/auth-cron/src/job.ts @@ -1,7 +1,8 @@ import path from 'node:path'; -import { BundleDatabase, createBundle, getVersionCommand } from '@map-colonies/auth-bundler'; -import { Bundle, Environments } from '@map-colonies/auth-core'; -import { Repository } from 'typeorm'; +import type { BundleDatabase } from '@map-colonies/auth-bundler'; +import { createBundle, getVersionCommand } from '@map-colonies/auth-bundler'; +import type { Bundle, Environments } from '@map-colonies/auth-core'; +import type { Repository } from 'typeorm'; import { getS3Client } from './s3'; import { compareVersionsToBundle } from './util'; import { logger } from './telemetry/logger'; diff --git a/apps/auth-cron/src/s3.ts b/apps/auth-cron/src/s3.ts index 164b7757..6f1015a9 100644 --- a/apps/auth-cron/src/s3.ts +++ b/apps/auth-cron/src/s3.ts @@ -1,7 +1,7 @@ import { readFileSync } from 'node:fs'; import { StatusCodes } from 'http-status-codes'; import { HeadBucketCommand, HeadObjectCommand, NotFound, PutObjectCommand, S3Client } from '@aws-sdk/client-s3'; -import { Environments } from '@map-colonies/auth-core'; +import type { Environments } from '@map-colonies/auth-core'; import type { infraOpalaCronV1Type } from '@map-colonies/schemas'; import { getConfig } from './config'; import { logger } from './telemetry/logger'; diff --git a/apps/auth-cron/src/telemetry/logger.ts b/apps/auth-cron/src/telemetry/logger.ts index 30380af7..5e8f1842 100644 --- a/apps/auth-cron/src/telemetry/logger.ts +++ b/apps/auth-cron/src/telemetry/logger.ts @@ -1,4 +1,5 @@ -import { Logger, jsLogger } from '@map-colonies/js-logger'; +import type { Logger } from '@map-colonies/js-logger'; +import { jsLogger } from '@map-colonies/js-logger'; import { setLogger } from '@map-colonies/auth-bundler'; import { getConfig } from '../config'; diff --git a/apps/auth-cron/src/util.ts b/apps/auth-cron/src/util.ts index d202bd47..4c33e4c8 100644 --- a/apps/auth-cron/src/util.ts +++ b/apps/auth-cron/src/util.ts @@ -1,8 +1,8 @@ import assert from 'node:assert'; import { readdir, rm } from 'node:fs/promises'; import path from 'node:path'; -import { Bundle } from '@map-colonies/auth-core'; -import { BundleContentVersions } from '@map-colonies/auth-bundler/dist/types'; +import type { Bundle } from '@map-colonies/auth-core'; +import type { BundleContentVersions } from '@map-colonies/auth-bundler/dist/types'; import { logger } from './telemetry/logger'; export function compareVersionsToBundle(bundle: Bundle, versions: BundleContentVersions): boolean { diff --git a/apps/auth-cron/src/validators.ts b/apps/auth-cron/src/validators.ts index 48ba1364..a321c751 100644 --- a/apps/auth-cron/src/validators.ts +++ b/apps/auth-cron/src/validators.ts @@ -1,4 +1,4 @@ -import { Environments } from '@map-colonies/auth-core'; +import type { Environments } from '@map-colonies/auth-core'; import { getS3Client } from './s3'; import { logger } from './telemetry/logger'; diff --git a/apps/auth-cron/tests/config.spec.ts b/apps/auth-cron/tests/config.spec.ts index 7ce6685d..3ad96740 100644 --- a/apps/auth-cron/tests/config.spec.ts +++ b/apps/auth-cron/tests/config.spec.ts @@ -1,5 +1,7 @@ import { vi, describe, it, expect } from 'vitest'; -import { ConfigErrors } from '@map-colonies/config'; +import type * as configType from '@map-colonies/config'; +import type { ConfigErrors } from '@map-colonies/config'; +import type * as localConfigType from '@src/config'; import { getConfig } from '@src/config'; describe('config.ts', function () { @@ -10,11 +12,11 @@ describe('config.ts', function () { it('should throw if no cron is configured', async function () { expect.assertions(2); + vi.resetModules(); - // await vi.isolateModulesAsync(async () => { /* eslint-disable @typescript-eslint/no-require-imports */ - const { initConfig } = (await import('../src/config.js')) as typeof import('../src/config'); - const configModule = require('@map-colonies/config') as typeof import('@map-colonies/config'); + const { initConfig } = (await import('../src/config.js')) as typeof localConfigType; + const configModule = require('@map-colonies/config') as typeof configType; /* eslint-enable @typescript-eslint/no-require-imports */ const configSpy = vi.spyOn(configModule, 'config'); @@ -24,13 +26,16 @@ describe('config.ts', function () { }); const action = initConfig(true); + await expect(action).rejects.toThrow('Config validation error'); + await action.catch((err) => { const validationErr = err as ConfigErrors['configValidationError']; const filtered = validationErr.payload.filter((error) => error.message === "property 'cron' must match a schema in anyOf"); + + // eslint-disable-next-line vitest/no-conditional-expect expect(filtered).toHaveLength(1); - // }); }); }); }); diff --git a/apps/auth-cron/tests/job.spec.ts b/apps/auth-cron/tests/job.spec.ts index dcaed9ba..ace46a19 100644 --- a/apps/auth-cron/tests/job.spec.ts +++ b/apps/auth-cron/tests/job.spec.ts @@ -1,13 +1,16 @@ import { tmpdir } from 'node:os'; import { writeFile } from 'node:fs/promises'; import path from 'node:path'; -import { BundleDatabase, createBundle } from '@map-colonies/auth-bundler'; +import type { BundleDatabase } from '@map-colonies/auth-bundler'; +import { createBundle } from '@map-colonies/auth-bundler'; import * as authBundler from '@map-colonies/auth-bundler'; -import { Bundle, Environment } from '@map-colonies/auth-core'; -import { Repository } from 'typeorm'; -import { vi, describe, Mock, beforeEach, afterEach, afterAll, it, expect, beforeAll } from 'vitest'; +import type { Bundle } from '@map-colonies/auth-core'; +import { Environment } from '@map-colonies/auth-core'; +import type { Repository } from 'typeorm'; +import type { Mock } from 'vitest'; +import { vi, describe, beforeEach, afterEach, afterAll, it, expect, beforeAll } from 'vitest'; import { jsLogger } from '@map-colonies/js-logger'; -import { infraOpalaCronV1Type } from '@map-colonies/schemas'; +import type { infraOpalaCronV1Type } from '@map-colonies/schemas'; import { PutObjectCommand, S3Client } from '@aws-sdk/client-s3'; import { getJob } from '@src/job'; import { getConfig, initConfig } from '@src/config'; diff --git a/apps/auth-cron/tests/s3.spec.ts b/apps/auth-cron/tests/s3.spec.ts index 7ecd112a..98b67de9 100644 --- a/apps/auth-cron/tests/s3.spec.ts +++ b/apps/auth-cron/tests/s3.spec.ts @@ -1,17 +1,18 @@ // /// -import { createHash } from 'crypto'; +import { createHash } from 'node:crypto'; import { tmpdir } from 'node:os'; import path from 'node:path'; import { writeFileSync } from 'node:fs'; import { vi, describe, beforeAll, it, expect } from 'vitest'; import { GetObjectCommand, PutObjectCommand, S3Client } from '@aws-sdk/client-s3'; -import { Environment, Environments } from '@map-colonies/auth-core'; -import { infraOpalaCronV1Type } from '@map-colonies/schemas'; +import type { Environments } from '@map-colonies/auth-core'; +import { Environment } from '@map-colonies/auth-core'; +import type { infraOpalaCronV1Type } from '@map-colonies/schemas'; import { jsLogger } from '@map-colonies/js-logger'; import { initConfig, getConfig } from '@src/config'; import { getS3Client } from '@src/s3'; -import * as appConfig from '@src/config'; +import type * as appConfig from '@src/config'; vi.mock('../src/telemetry/logger', () => { return { @@ -66,6 +67,7 @@ describe('s3.ts', function () { expect(() => getS3Client('avi' as Environments)).toThrow(); }); }); + describe('#getObjectHash', function () { it('should return the hash if the object exists', async function () { // eslint-disable-next-line @typescript-eslint/naming-convention @@ -121,7 +123,7 @@ describe('s3.ts', function () { const res = await s3client.send(new GetObjectCommand({ Bucket: cronOptions.s3.bucket, Key: 'xd' })); expect(res.ETag).toBe(hash); - expect(await res.Body?.transformToString()).toBe('abcdefg'); + await expect(res.Body?.transformToString()).resolves.toBe('abcdefg'); }); it('should throw if something is wrong', async function () { diff --git a/apps/auth-cron/tests/util.spec.ts b/apps/auth-cron/tests/util.spec.ts index 774b13ec..f25ed2ba 100644 --- a/apps/auth-cron/tests/util.spec.ts +++ b/apps/auth-cron/tests/util.spec.ts @@ -1,9 +1,9 @@ import { existsSync, mkdirSync, writeFileSync } from 'node:fs'; import { tmpdir } from 'node:os'; import path from 'node:path'; -import { BundleContentVersions } from '@map-colonies/auth-bundler'; +import type { BundleContentVersions } from '@map-colonies/auth-bundler'; import { describe, expect, it, vi } from 'vitest'; -import { Bundle } from '@map-colonies/auth-core'; +import type { Bundle } from '@map-colonies/auth-core'; import { jsLogger } from '@map-colonies/js-logger'; import { compareVersionsToBundle, emptyDir } from '@src/util'; import { getFakeBundle } from './utils/bundle'; diff --git a/apps/auth-cron/tests/utils/asset.ts b/apps/auth-cron/tests/utils/asset.ts index f501b337..5a8affc1 100644 --- a/apps/auth-cron/tests/utils/asset.ts +++ b/apps/auth-cron/tests/utils/asset.ts @@ -1,5 +1,6 @@ import { faker } from '@faker-js/faker'; -import { AssetType, Environment, IAsset } from '@map-colonies/auth-core'; +import type { IAsset } from '@map-colonies/auth-core'; +import { AssetType, Environment } from '@map-colonies/auth-core'; const EIGHT = 8; diff --git a/apps/auth-cron/tests/utils/bundle.ts b/apps/auth-cron/tests/utils/bundle.ts index 45dd6432..9a4701cd 100644 --- a/apps/auth-cron/tests/utils/bundle.ts +++ b/apps/auth-cron/tests/utils/bundle.ts @@ -1,6 +1,7 @@ import { faker } from '@faker-js/faker'; -import { BundleContent } from '@map-colonies/auth-bundler'; -import { AssetType, Environment, IBundle } from '@map-colonies/auth-core'; +import type { BundleContent } from '@map-colonies/auth-bundler'; +import type { IBundle } from '@map-colonies/auth-core'; +import { AssetType, Environment } from '@map-colonies/auth-core'; const EIGHT = 8; diff --git a/apps/auth-cron/tests/utils/connection.ts b/apps/auth-cron/tests/utils/connection.ts index 8d05fcd4..20ca4359 100644 --- a/apps/auth-cron/tests/utils/connection.ts +++ b/apps/auth-cron/tests/utils/connection.ts @@ -1,5 +1,6 @@ import { faker } from '@faker-js/faker'; -import { Connection, Environment, IConnection } from '@map-colonies/auth-core'; +import type { Connection, IConnection } from '@map-colonies/auth-core'; +import { Environment } from '@map-colonies/auth-core'; const EIGHT = 8; diff --git a/apps/auth-cron/tests/utils/key.ts b/apps/auth-cron/tests/utils/key.ts index ad7e5df1..8cd0cd53 100644 --- a/apps/auth-cron/tests/utils/key.ts +++ b/apps/auth-cron/tests/utils/key.ts @@ -1,5 +1,5 @@ import { faker } from '@faker-js/faker'; -import { JWKPrivateKey, JWKPublicKey } from '@map-colonies/auth-core'; +import type { JWKPrivateKey, JWKPublicKey } from '@map-colonies/auth-core'; const LENGTH_OF_STRING = 3; diff --git a/apps/auth-cron/tests/validators.spec.ts b/apps/auth-cron/tests/validators.spec.ts index 7d1ce2dd..e50f553c 100644 --- a/apps/auth-cron/tests/validators.spec.ts +++ b/apps/auth-cron/tests/validators.spec.ts @@ -16,9 +16,11 @@ describe('validators.ts', function () { beforeAll(async function () { await initConfig(true); }); + describe('#validateS3', function () { it('should not throw if the bucket exists', async function () { const promise = validateS3([Environment.NP]); + await expect(promise).resolves.not.toThrow(); }); diff --git a/apps/auth-cron/tsconfig.lint.json b/apps/auth-cron/tsconfig.lint.json deleted file mode 100644 index c22e08fd..00000000 --- a/apps/auth-cron/tsconfig.lint.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "../../tsconfig.lint.json" -} diff --git a/apps/auth-manager/eslint.config.mjs b/apps/auth-manager/eslint.config.mjs index 308db405..71f38a4c 100644 --- a/apps/auth-manager/eslint.config.mjs +++ b/apps/auth-manager/eslint.config.mjs @@ -1,9 +1,5 @@ -import { config } from '@map-colonies/eslint-config/helpers'; -import { defineConfig } from 'eslint/config'; -import baseConfig from '../../eslint.config.mjs'; +import { defineConfig, globalIgnores } from 'eslint/config'; +import tsBaseConfig from '@map-colonies/eslint-config/ts-base'; +import vitestConfig from '@map-colonies/eslint-config/vitest'; -export default defineConfig(baseConfig, {}); - -// export default { -// rules: {} -// } +export default defineConfig(tsBaseConfig, vitestConfig, globalIgnores(['vitest.config.mts', 'ui/**/*', 'drizzle.config.mts'])); diff --git a/apps/auth-manager/package.json b/apps/auth-manager/package.json index 6bae00aa..4880092d 100644 --- a/apps/auth-manager/package.json +++ b/apps/auth-manager/package.json @@ -18,8 +18,6 @@ "test": "vitest run", "test:watch": "vitest watch", "test:ui": "vitest --ui", - "format": "prettier --check .", - "format:fix": "prettier --write .", "typeorm": "node ../../node_modules/typeorm/cli.js -d ./dataSource.mjs", "migration:create": "npm run typeorm migration:generate --", "migration:run": "npm run typeorm migration:run -- ", diff --git a/apps/auth-manager/src/app.ts b/apps/auth-manager/src/app.ts index 90797c7a..ba8a8049 100644 --- a/apps/auth-manager/src/app.ts +++ b/apps/auth-manager/src/app.ts @@ -1,6 +1,7 @@ -import { Application } from 'express'; -import { DependencyContainer } from 'tsyringe'; -import { registerExternalValues, RegisterOptions } from './containerConfig'; +import type { Application } from 'express'; +import type { DependencyContainer } from 'tsyringe'; +import type { RegisterOptions } from './containerConfig'; +import { registerExternalValues } from './containerConfig'; import { ServerBuilder } from './serverBuilder'; async function getApp(registerOptions?: RegisterOptions): Promise<[Application, DependencyContainer]> { diff --git a/apps/auth-manager/src/asset/DAL/assetRepository.ts b/apps/auth-manager/src/asset/DAL/assetRepository.ts index cce4e7c9..cfa9da77 100644 --- a/apps/auth-manager/src/asset/DAL/assetRepository.ts +++ b/apps/auth-manager/src/asset/DAL/assetRepository.ts @@ -1,6 +1,7 @@ import { Asset } from '@map-colonies/auth-core'; -import { FactoryFunction } from 'tsyringe'; -import { DataSource, Repository } from 'typeorm'; +import type { FactoryFunction } from 'tsyringe'; +import type { Repository } from 'typeorm'; +import { DataSource } from 'typeorm'; export type AssetRepository = Repository & { getMaxVersionWithLock: (name: string) => Promise; diff --git a/apps/auth-manager/src/asset/routes/assetRouter.ts b/apps/auth-manager/src/asset/routes/assetRouter.ts index 8f99af98..3f85487f 100644 --- a/apps/auth-manager/src/asset/routes/assetRouter.ts +++ b/apps/auth-manager/src/asset/routes/assetRouter.ts @@ -1,5 +1,5 @@ import { Router } from 'express'; -import { FactoryFunction } from 'tsyringe'; +import type { FactoryFunction } from 'tsyringe'; import { AssetController } from '../controllers/assetController'; export const assetRouterFactory: FactoryFunction = (dependencyContainer) => { diff --git a/apps/auth-manager/src/bundle/models/bundle.ts b/apps/auth-manager/src/bundle/models/bundle.ts index d29380c8..55ef87c7 100644 --- a/apps/auth-manager/src/bundle/models/bundle.ts +++ b/apps/auth-manager/src/bundle/models/bundle.ts @@ -1,4 +1,4 @@ -import { IBundle } from '@map-colonies/auth-core'; +import type { IBundle } from '@map-colonies/auth-core'; export interface BundleSearchParams { environment?: IBundle['environment'][]; diff --git a/apps/auth-manager/src/bundle/routes/bundleRouter.ts b/apps/auth-manager/src/bundle/routes/bundleRouter.ts index 2b1a6578..28833878 100644 --- a/apps/auth-manager/src/bundle/routes/bundleRouter.ts +++ b/apps/auth-manager/src/bundle/routes/bundleRouter.ts @@ -1,5 +1,5 @@ import { Router } from 'express'; -import { FactoryFunction } from 'tsyringe'; +import type { FactoryFunction } from 'tsyringe'; import { BundleController } from '../controllers/bundleController'; const bundleRouterFactory: FactoryFunction = (dependencyContainer) => { diff --git a/apps/auth-manager/src/client/DAL/clientRepository.ts b/apps/auth-manager/src/client/DAL/clientRepository.ts index 96ff80b3..2d4301c8 100644 --- a/apps/auth-manager/src/client/DAL/clientRepository.ts +++ b/apps/auth-manager/src/client/DAL/clientRepository.ts @@ -1,6 +1,7 @@ import { Client } from '@map-colonies/auth-core'; -import { FactoryFunction } from 'tsyringe'; -import { DataSource, Repository } from 'typeorm'; +import type { FactoryFunction } from 'tsyringe'; +import type { Repository } from 'typeorm'; +import { DataSource } from 'typeorm'; export type ClientRepository = Repository & { updateAndReturn: (client: Client) => Promise }; diff --git a/apps/auth-manager/src/client/routes/clientRouter.ts b/apps/auth-manager/src/client/routes/clientRouter.ts index 875cd433..a4729569 100644 --- a/apps/auth-manager/src/client/routes/clientRouter.ts +++ b/apps/auth-manager/src/client/routes/clientRouter.ts @@ -1,5 +1,5 @@ import { Router } from 'express'; -import { FactoryFunction } from 'tsyringe'; +import type { FactoryFunction } from 'tsyringe'; import { ConnectionController } from '@connection/controllers/connectionController'; import { ClientController } from '../controllers/clientController'; diff --git a/apps/auth-manager/src/common/crypto.ts b/apps/auth-manager/src/common/crypto.ts index 617184ea..f0bd7307 100644 --- a/apps/auth-manager/src/common/crypto.ts +++ b/apps/auth-manager/src/common/crypto.ts @@ -1,4 +1,5 @@ -import { importJWK, JWK, SignJWT } from 'jose'; +import type { JWK } from 'jose'; +import { importJWK, SignJWT } from 'jose'; import { TOKENS_ISSUER } from './constants'; /** diff --git a/apps/auth-manager/src/common/db/utils.ts b/apps/auth-manager/src/common/db/utils.ts index cf7a0cda..914a569a 100644 --- a/apps/auth-manager/src/common/db/utils.ts +++ b/apps/auth-manager/src/common/db/utils.ts @@ -1,4 +1,5 @@ -import { Between, FindOperator, LessThan, MoreThan } from 'typeorm'; +import type { FindOperator } from 'typeorm'; +import { Between, LessThan, MoreThan } from 'typeorm'; export function createDatesComparison(earlyDate?: Date, laterDate?: Date): FindOperator | undefined { if (earlyDate !== undefined && laterDate !== undefined) { diff --git a/apps/auth-manager/src/common/dependencyRegistration.ts b/apps/auth-manager/src/common/dependencyRegistration.ts index a591ff93..6b35ae1d 100644 --- a/apps/auth-manager/src/common/dependencyRegistration.ts +++ b/apps/auth-manager/src/common/dependencyRegistration.ts @@ -1,5 +1,6 @@ -import { ClassProvider, container as defaultContainer, FactoryProvider, InjectionToken, ValueProvider } from 'tsyringe'; -import { constructor, DependencyContainer } from 'tsyringe/dist/typings/types'; +import type { ClassProvider, FactoryProvider, InjectionToken, ValueProvider } from 'tsyringe'; +import { container as defaultContainer } from 'tsyringe'; +import type { constructor, DependencyContainer } from 'tsyringe/dist/typings/types'; export type Providers = ValueProvider | FactoryProvider | ClassProvider | constructor; diff --git a/apps/auth-manager/src/connection/DAL/connectionRepository.ts b/apps/auth-manager/src/connection/DAL/connectionRepository.ts index eac16947..68e45d8f 100644 --- a/apps/auth-manager/src/connection/DAL/connectionRepository.ts +++ b/apps/auth-manager/src/connection/DAL/connectionRepository.ts @@ -1,6 +1,8 @@ -import { Connection, Environments } from '@map-colonies/auth-core'; -import { FactoryFunction } from 'tsyringe'; -import { DataSource, Repository, SelectQueryBuilder } from 'typeorm'; +import type { Environments } from '@map-colonies/auth-core'; +import { Connection } from '@map-colonies/auth-core'; +import type { FactoryFunction } from 'tsyringe'; +import type { Repository, SelectQueryBuilder } from 'typeorm'; +import { DataSource } from 'typeorm'; const maxVersionSubQuery = (qb: SelectQueryBuilder): string => { const subQuery = qb diff --git a/apps/auth-manager/src/connection/models/connectionManager.ts b/apps/auth-manager/src/connection/models/connectionManager.ts index a07f8dce..1635b069 100644 --- a/apps/auth-manager/src/connection/models/connectionManager.ts +++ b/apps/auth-manager/src/connection/models/connectionManager.ts @@ -191,10 +191,10 @@ export class ConnectionManager { try { return await generateToken(key.privateKey as JWK, connection.name, key.privateKey.kid); - } catch (error) { - this.logger.error({ msg: 'could not generate token', error }); + } catch (err) { + this.logger.error({ msg: 'could not generate token', err }); if (throwOnError === true) { - throw error; + throw err; } return ''; } diff --git a/apps/auth-manager/src/connection/routes/connectionRouter.ts b/apps/auth-manager/src/connection/routes/connectionRouter.ts index bc6d1251..8b29fc25 100644 --- a/apps/auth-manager/src/connection/routes/connectionRouter.ts +++ b/apps/auth-manager/src/connection/routes/connectionRouter.ts @@ -1,5 +1,5 @@ import { Router } from 'express'; -import { FactoryFunction } from 'tsyringe'; +import type { FactoryFunction } from 'tsyringe'; import { ConnectionController } from '../controllers/connectionController'; export const connectionRouterFactory: FactoryFunction = (dependencyContainer) => { diff --git a/apps/auth-manager/src/containerConfig.ts b/apps/auth-manager/src/containerConfig.ts index 610272da..6be71c10 100644 --- a/apps/auth-manager/src/containerConfig.ts +++ b/apps/auth-manager/src/containerConfig.ts @@ -1,15 +1,16 @@ import { getOtelMixin } from '@map-colonies/telemetry'; import { trace } from '@opentelemetry/api'; import { instanceCachingFactory } from 'tsyringe'; -import { DependencyContainer } from 'tsyringe/dist/typings/types'; +import type { DependencyContainer } from 'tsyringe/dist/typings/types'; import { jsLogger } from '@map-colonies/js-logger'; import { DataSource } from 'typeorm'; -import { HealthCheck } from '@godaddy/terminus'; +import type { HealthCheck } from '@godaddy/terminus'; import { Bundle, initConnection } from '@map-colonies/auth-core'; import { Registry } from 'prom-client'; import { DB_CONNECTION_TIMEOUT, SERVICES, SERVICE_NAME } from './common/constants'; import { domainRouterFactory, DOMAIN_ROUTER_SYMBOL } from './domain/routes/domainRouter'; -import { InjectionObject, registerDependencies } from './common/dependencyRegistration'; +import type { InjectionObject } from './common/dependencyRegistration'; +import { registerDependencies } from './common/dependencyRegistration'; import { promiseTimeout } from './common/utils/promiseTimeout'; import { clientRouterFactory, CLIENT_ROUTER_SYMBOL } from './client/routes/clientRouter'; import { clientRepositoryFactory } from './client/DAL/clientRepository'; diff --git a/apps/auth-manager/src/domain/DAL/domainRepository.ts b/apps/auth-manager/src/domain/DAL/domainRepository.ts index 0d3eb76e..8e950938 100644 --- a/apps/auth-manager/src/domain/DAL/domainRepository.ts +++ b/apps/auth-manager/src/domain/DAL/domainRepository.ts @@ -1,6 +1,7 @@ import { Domain } from '@map-colonies/auth-core'; -import { FactoryFunction } from 'tsyringe'; -import { DataSource, Repository } from 'typeorm'; +import type { FactoryFunction } from 'tsyringe'; +import type { Repository } from 'typeorm'; +import { DataSource } from 'typeorm'; export type DomainRepository = Repository & { checkInputForNonExistingDomains: (domainNames: string[]) => Promise; diff --git a/apps/auth-manager/src/domain/routes/domainRouter.ts b/apps/auth-manager/src/domain/routes/domainRouter.ts index 518a24ed..2b93c993 100644 --- a/apps/auth-manager/src/domain/routes/domainRouter.ts +++ b/apps/auth-manager/src/domain/routes/domainRouter.ts @@ -1,5 +1,5 @@ import { Router } from 'express'; -import { FactoryFunction } from 'tsyringe'; +import type { FactoryFunction } from 'tsyringe'; import { DomainController } from '../controllers/domainController'; const domainRouterFactory: FactoryFunction = (dependencyContainer) => { diff --git a/apps/auth-manager/src/index.ts b/apps/auth-manager/src/index.ts index 197090b9..f989f0cd 100644 --- a/apps/auth-manager/src/index.ts +++ b/apps/auth-manager/src/index.ts @@ -1,11 +1,12 @@ // this import must be called before the first import of tsyringe import 'reflect-metadata'; -import { createServer } from 'http'; -import { createTerminus, HealthCheck } from '@godaddy/terminus'; -import { Logger } from '@map-colonies/js-logger'; +import { createServer } from 'node:http'; +import type { HealthCheck } from '@godaddy/terminus'; +import { createTerminus } from '@godaddy/terminus'; +import type { Logger } from '@map-colonies/js-logger'; import { SERVICES } from './common/constants'; import { getApp } from './app'; -import { ConfigType } from './common/config'; +import type { ConfigType } from './common/config'; void getApp() .then(([app, container]) => { diff --git a/apps/auth-manager/src/key/DAL/keyRepository.ts b/apps/auth-manager/src/key/DAL/keyRepository.ts index 664e1ae7..97cf1d8b 100644 --- a/apps/auth-manager/src/key/DAL/keyRepository.ts +++ b/apps/auth-manager/src/key/DAL/keyRepository.ts @@ -1,6 +1,8 @@ -import { Environments, Key } from '@map-colonies/auth-core'; -import { FactoryFunction } from 'tsyringe'; -import { DataSource, Repository } from 'typeorm'; +import type { Environments } from '@map-colonies/auth-core'; +import { Key } from '@map-colonies/auth-core'; +import type { FactoryFunction } from 'tsyringe'; +import type { Repository } from 'typeorm'; +import { DataSource } from 'typeorm'; export type KeyRepository = Repository & { getMaxVersionWithLock: (env: Environments) => Promise; diff --git a/apps/auth-manager/src/key/routes/keyRouter.ts b/apps/auth-manager/src/key/routes/keyRouter.ts index 46033357..b6edd0fd 100644 --- a/apps/auth-manager/src/key/routes/keyRouter.ts +++ b/apps/auth-manager/src/key/routes/keyRouter.ts @@ -1,5 +1,5 @@ import { Router } from 'express'; -import { FactoryFunction } from 'tsyringe'; +import type { FactoryFunction } from 'tsyringe'; import { KeyController } from '../controllers/keyController'; export const keyRouterFactory: FactoryFunction = (dependencyContainer) => { diff --git a/apps/auth-manager/src/serverBuilder.ts b/apps/auth-manager/src/serverBuilder.ts index 136154ac..5e20f455 100644 --- a/apps/auth-manager/src/serverBuilder.ts +++ b/apps/auth-manager/src/serverBuilder.ts @@ -2,7 +2,7 @@ import express, { Router } from 'express'; import bodyParser from 'body-parser'; import compression, { CompressionOptions } from 'compression'; import cors from 'cors'; -import { OpenapiViewerRouter, OpenapiRouterConfig } from '@map-colonies/openapi-express-viewer'; +import { OpenapiViewerRouter } from '@map-colonies/openapi-express-viewer'; import { getErrorHandlerMiddleware } from '@map-colonies/error-express-handler'; import { middleware as OpenApiMiddleware } from 'express-openapi-validator'; import { inject, injectable } from 'tsyringe'; diff --git a/apps/auth-manager/tests/integration/asset/asset.spec.ts b/apps/auth-manager/tests/integration/asset/asset.spec.ts index 9deb5a6d..121fdea4 100644 --- a/apps/auth-manager/tests/integration/asset/asset.spec.ts +++ b/apps/auth-manager/tests/integration/asset/asset.spec.ts @@ -3,16 +3,18 @@ import { describe, expect, it, vi, beforeAll, afterAll, afterEach } from 'vitest import { jsLogger } from '@map-colonies/js-logger'; import { trace } from '@opentelemetry/api'; import httpStatusCodes from 'http-status-codes'; -import { DependencyContainer } from 'tsyringe'; +import type { DependencyContainer } from 'tsyringe'; import 'jest-openapi'; import { DataSource } from 'typeorm'; -import { Asset, AssetType, Environment, IAsset } from '@map-colonies/auth-core'; +import type { IAsset } from '@map-colonies/auth-core'; +import { Asset, AssetType, Environment } from '@map-colonies/auth-core'; import { faker } from '@faker-js/faker'; -import { createRequestSender, RequestSender } from '@map-colonies/openapi-helpers/requestSender'; -import { paths, operations } from '@openapi'; +import type { RequestSender } from '@map-colonies/openapi-helpers/requestSender'; +import { createRequestSender } from '@map-colonies/openapi-helpers/requestSender'; +import type { paths, operations } from '@openapi'; import { getApp } from '@src/app'; import { SERVICES } from '@common/constants'; -import { AssetRepository } from '@src/asset/DAL/assetRepository'; +import type { AssetRepository } from '@src/asset/DAL/assetRepository'; import { getFakeAsset } from '@tests/utils/asset'; import { initConfig } from '@common/config'; @@ -272,6 +274,7 @@ describe('client', function () { expect(res).toSatisfyApiSpec(); }); }); + describe('POST /asset', function () { it('should return 500 status code if db throws an error', async function () { const repo = depContainer.resolve(SERVICES.ASSET_REPOSITORY); diff --git a/apps/auth-manager/tests/integration/bundle/bundle.spec.ts b/apps/auth-manager/tests/integration/bundle/bundle.spec.ts index 9e366905..c4132dc6 100644 --- a/apps/auth-manager/tests/integration/bundle/bundle.spec.ts +++ b/apps/auth-manager/tests/integration/bundle/bundle.spec.ts @@ -4,12 +4,15 @@ import { jsLogger } from '@map-colonies/js-logger'; import { trace } from '@opentelemetry/api'; import { faker } from '@faker-js/faker'; import httpStatusCodes from 'http-status-codes'; -import { DependencyContainer } from 'tsyringe'; -import { DataSource, Repository } from 'typeorm'; -import { Bundle, Environment, Environments, IBundle } from '@map-colonies/auth-core'; +import type { DependencyContainer } from 'tsyringe'; +import type { Repository } from 'typeorm'; +import { DataSource } from 'typeorm'; +import type { Environments, IBundle } from '@map-colonies/auth-core'; +import { Bundle, Environment } from '@map-colonies/auth-core'; import 'jest-openapi'; -import { createRequestSender, RequestSender } from '@map-colonies/openapi-helpers/requestSender'; -import { paths, operations } from '@openapi'; +import type { RequestSender } from '@map-colonies/openapi-helpers/requestSender'; +import { createRequestSender } from '@map-colonies/openapi-helpers/requestSender'; +import type { paths, operations } from '@openapi'; import { getApp } from '@src/app'; import { SERVICES } from '@common/constants'; import { getFakeBundle } from '@tests/utils/bundle'; diff --git a/apps/auth-manager/tests/integration/client/client.spec.ts b/apps/auth-manager/tests/integration/client/client.spec.ts index 2529a771..50efa1e5 100644 --- a/apps/auth-manager/tests/integration/client/client.spec.ts +++ b/apps/auth-manager/tests/integration/client/client.spec.ts @@ -3,18 +3,20 @@ import { beforeAll, describe, expect, it, afterAll, afterEach, vi } from 'vitest import { jsLogger } from '@map-colonies/js-logger'; import { trace } from '@opentelemetry/api'; import httpStatusCodes from 'http-status-codes'; -import { DependencyContainer } from 'tsyringe'; +import type { DependencyContainer } from 'tsyringe'; import { faker } from '@faker-js/faker'; import 'jest-openapi'; import { DataSource } from 'typeorm'; -import { Client, IClient } from '@map-colonies/auth-core'; -import { createRequestSender, RequestSender } from '@map-colonies/openapi-helpers/requestSender'; -import { paths, operations } from '@openapi'; +import type { IClient } from '@map-colonies/auth-core'; +import { Client } from '@map-colonies/auth-core'; +import type { RequestSender } from '@map-colonies/openapi-helpers/requestSender'; +import { createRequestSender } from '@map-colonies/openapi-helpers/requestSender'; +import type { paths, operations } from '@openapi'; import { getApp } from '@src/app'; import { SERVICES } from '@common/constants'; import { getFakeClient } from '@tests/utils/client'; import { initConfig } from '@common/config'; -import { ClientRepository } from '@src/client/DAL/clientRepository'; +import type { ClientRepository } from '@src/client/DAL/clientRepository'; describe('client', function () { let requestSender: RequestSender; @@ -64,7 +66,7 @@ describe('client', function () { { name: 'aviiiiii', searchParam: 'av', matchType: 'prefix' }, { name: 'blaviabla', searchParam: 'avi', matchType: 'middle' }, { name: 'avi', searchParam: 'AV', matchType: 'case-insensitive' }, - ])('type: $matchType - find the user $name with search string $searchParam', async function ({ name, searchParam }) { + ])('should find the user $name with search string $searchParam with match type $matchType', async function ({ name, searchParam }) { const client = { ...getFakeClient(false), name }; const connection = depContainer.resolve(DataSource); await connection.getRepository(Client).insert(client); @@ -112,6 +114,7 @@ describe('client', function () { createdBefore: new Date('2023-03-31').toISOString(), }, }); + expect(res).toHaveProperty('status', httpStatusCodes.OK); expect(res).toSatisfyApiSpec(); // @ts-expect-error need to solve as openapi-helpers is not typed correctly @@ -262,8 +265,10 @@ describe('client', function () { expect(res).toHaveProperty('status', httpStatusCodes.OK); expect(res).toSatisfyApiSpec(); + // @ts-expect-error need to solve as openapi-helpers is not typed correctly const items = res.body.items as IClient[]; + expect(items).toHaveLength(clientNames.length); // Check if items are sorted correctly in descending order @@ -312,6 +317,7 @@ describe('client', function () { const currentDate = new Date(currentItem.createdAt); const nextDate = new Date(nextItem.createdAt); + expect(currentDate.getTime()).toBeLessThanOrEqual(nextDate.getTime()); } }); @@ -341,11 +347,14 @@ describe('client', function () { expect(res).toHaveProperty('status', httpStatusCodes.OK); expect(res).toSatisfyApiSpec(); + // @ts-expect-error need to solve as openapi-helpers is not typed correctly const returnedItems = res.body.items as IClient[]; + expect(returnedItems).toBeArrayOfSize(PAGE_SIZE); // @ts-expect-error need to solve as openapi-helpers is not typed correctly expect(res.body.total).toBe(TOTAL_CLIENTS); // Verify the specific items on page 2 with sorting + const isFirstItemCorrect = returnedItems[0]?.name === 'combo-client-02'; const isSecondItemCorrect = returnedItems[1]?.name === 'combo-client-03'; @@ -466,6 +475,7 @@ describe('client', function () { expect(res2.body).toStrictEqual({ message: 'client already exists' }); }); }); + describe('GET /client/:clientName', function () { it('should return 404 status code if the client was not found', async function () { const res = await requestSender.getClient({ pathParams: { clientName: 'lol' } }); @@ -491,6 +501,7 @@ describe('client', function () { }); }); }); + describe('Sad Path', function () { afterEach(function () { vi.restoreAllMocks(); @@ -507,6 +518,7 @@ describe('client', function () { expect(res).toSatisfyApiSpec(); }); }); + describe('POST /client', function () { it('should return 500 status code if db throws an error', async function () { const repo = depContainer.resolve(SERVICES.CLIENT_REPOSITORY); diff --git a/apps/auth-manager/tests/integration/connection/connection.spec.ts b/apps/auth-manager/tests/integration/connection/connection.spec.ts index 3e382d16..9df2906d 100644 --- a/apps/auth-manager/tests/integration/connection/connection.spec.ts +++ b/apps/auth-manager/tests/integration/connection/connection.spec.ts @@ -3,19 +3,21 @@ import { beforeEach, describe, expect, it, vi, beforeAll, afterEach, afterAll } import { jsLogger } from '@map-colonies/js-logger'; import { trace } from '@opentelemetry/api'; import httpStatusCodes from 'http-status-codes'; -import { DependencyContainer } from 'tsyringe'; +import type { DependencyContainer } from 'tsyringe'; import 'jest-openapi'; import { DataSource } from 'typeorm'; -import { Client, Connection, Domain, Environment, Environments, IConnection, Key } from '@map-colonies/auth-core'; +import type { Environments, IConnection } from '@map-colonies/auth-core'; +import { Client, Connection, Domain, Environment, Key } from '@map-colonies/auth-core'; import { faker } from '@faker-js/faker'; -import { createRequestSender, RequestSender } from '@map-colonies/openapi-helpers/requestSender'; -import { paths, operations } from '@openapi'; +import type { RequestSender } from '@map-colonies/openapi-helpers/requestSender'; +import { createRequestSender } from '@map-colonies/openapi-helpers/requestSender'; +import type { paths, operations } from '@openapi'; import { getApp } from '@src/app'; import { SERVICES } from '@common/constants'; -import { ConnectionRepository } from '@src/connection/DAL/connectionRepository'; +import type { ConnectionRepository } from '@src/connection/DAL/connectionRepository'; import { getFakeConnection, getFakeIConnection } from '@tests/utils/connection'; -import { KeyRepository } from '@src/key/DAL/keyRepository'; -import { DomainRepository } from '@src/domain/DAL/domainRepository'; +import type { KeyRepository } from '@src/key/DAL/keyRepository'; +import type { DomainRepository } from '@src/domain/DAL/domainRepository'; import { getFakeClient } from '@tests/utils/client'; import { getRealKeys } from '@tests/utils/key'; import { initConfig } from '@common/config'; @@ -45,6 +47,7 @@ describe('connection', function () { requestSender = await createRequestSender(OPENAPI_SPEC_PATH, app); depContainer = container; }); + beforeEach(async function () { await depContainer.resolve(DataSource).getRepository(Client).save(clients); await depContainer.resolve(DataSource).getRepository(Connection).save(connections); @@ -74,6 +77,7 @@ describe('connection', function () { // @ts-expect-error need to solve as openapi-helpers is not typed correctly const returnedItems = res.body.items as IConnection[]; + expect(returnedItems).toBeArray(); }); @@ -83,7 +87,7 @@ describe('connection', function () { { name: 'aviiiiii', searchParam: 'av', matchType: 'prefix' }, { name: 'blaviabla', searchParam: 'avi', matchType: 'middle' }, { name: 'avi', searchParam: 'AV', matchType: 'case-insensitive' }, - ])('type: $matchType - find the connection of $name with search string $searchParam', async function ({ name, searchParam }) { + ])('should find the connection of $name with search string $searchParam with match type $matchType', async function ({ name, searchParam }) { const client = { ...getFakeClient(false), name }; const connection = getFakeIConnection(); connection.name = client.name; @@ -184,8 +188,10 @@ describe('connection', function () { expect(res).toHaveProperty('status', httpStatusCodes.OK); expect(res).toSatisfyApiSpec(); + // @ts-expect-error need to solve as openapi-helpers is not typed correctly const returnedItems = res.body.items as IConnection[]; + expect(returnedItems).toSatisfyAll((c: IConnection) => c.environment.includes(Environment.PRODUCTION)); }); @@ -194,8 +200,10 @@ describe('connection', function () { expect(res).toHaveProperty('status', httpStatusCodes.OK); expect(res).toSatisfyApiSpec(); + // @ts-expect-error need to solve as openapi-helpers is not typed correctly const returnedItems = res.body.items as IConnection[]; + expect(returnedItems).toSatisfyAll((c: IConnection) => c.domains.includes('test')); }); }); @@ -283,6 +291,7 @@ describe('connection', function () { expect(res.body).toHaveProperty('origins', ['http://example.com', 'http://foo.com', 'https://*.test.com']); }); }); + describe('GET /client/:clientName/connection', function () { it('should return 200 status code all the connections with the specific name', async function () { const res = await requestSender.getClientConnections({ pathParams: { clientName: connections[0]!.name } }); diff --git a/apps/auth-manager/tests/integration/docs/docs.spec.ts b/apps/auth-manager/tests/integration/docs/docs.spec.ts index b1044914..791862f7 100644 --- a/apps/auth-manager/tests/integration/docs/docs.spec.ts +++ b/apps/auth-manager/tests/integration/docs/docs.spec.ts @@ -2,7 +2,7 @@ import { beforeEach, describe, expect, it, beforeAll, afterEach } from 'vitest'; import { jsLogger } from '@map-colonies/js-logger'; import { trace } from '@opentelemetry/api'; import httpStatusCodes from 'http-status-codes'; -import { DependencyContainer } from 'tsyringe'; +import type { DependencyContainer } from 'tsyringe'; import { DataSource } from 'typeorm'; import { getApp } from '../../../src/app'; @@ -13,9 +13,11 @@ import { DocsRequestSender } from './helpers/docsRequestSender'; describe('docs', function () { let requestSender: DocsRequestSender; let depContainer: DependencyContainer; + beforeAll(async function () { await initConfig(true); }); + beforeEach(async function () { const [app, container] = await getApp({ override: [ diff --git a/apps/auth-manager/tests/integration/docs/helpers/docsRequestSender.ts b/apps/auth-manager/tests/integration/docs/helpers/docsRequestSender.ts index ed5a4c46..775bb8f0 100644 --- a/apps/auth-manager/tests/integration/docs/helpers/docsRequestSender.ts +++ b/apps/auth-manager/tests/integration/docs/helpers/docsRequestSender.ts @@ -1,5 +1,5 @@ import supertest from 'supertest'; -import { Application } from 'express'; +import type { Application } from 'express'; export class DocsRequestSender { public constructor(private readonly app: Application) {} diff --git a/apps/auth-manager/tests/integration/domain/domain.spec.ts b/apps/auth-manager/tests/integration/domain/domain.spec.ts index b4799012..1527b45c 100644 --- a/apps/auth-manager/tests/integration/domain/domain.spec.ts +++ b/apps/auth-manager/tests/integration/domain/domain.spec.ts @@ -2,13 +2,15 @@ import { beforeEach, describe, expect, it, beforeAll, afterAll, vi } from 'vites import { jsLogger } from '@map-colonies/js-logger'; import { trace } from '@opentelemetry/api'; import httpStatusCodes from 'http-status-codes'; -import { DependencyContainer } from 'tsyringe'; +import type { DependencyContainer } from 'tsyringe'; import { DataSource } from 'typeorm'; import { faker } from '@faker-js/faker'; import 'jest-openapi'; -import { Domain, IDomain } from '@map-colonies/auth-core'; -import { createRequestSender, RequestSender } from '@map-colonies/openapi-helpers/requestSender'; -import { paths, operations } from '@openapi'; +import type { IDomain } from '@map-colonies/auth-core'; +import { Domain } from '@map-colonies/auth-core'; +import type { RequestSender } from '@map-colonies/openapi-helpers/requestSender'; +import { createRequestSender } from '@map-colonies/openapi-helpers/requestSender'; +import type { paths, operations } from '@openapi'; import { getApp } from '@src/app'; import { SERVICES } from '@src/common/constants'; import { initConfig } from '@src/common/config'; @@ -47,8 +49,10 @@ describe('domain', function () { expect(res).toHaveProperty('status', httpStatusCodes.OK); expect(res).toSatisfyApiSpec(); + // @ts-expect-error need to solve as openapi-helpers is not typed correctly const returnedItems = res.body.items as IDomain[]; + expect(returnedItems).toEqual(expect.arrayContaining([{ name: 'avi' }, { name: 'iva' }])); }); }); @@ -65,6 +69,7 @@ describe('domain', function () { }); }); }); + describe('Bad Path', function () { describe('POST /domain', function () { it('should return 400 status code if the name is too short', async function () { @@ -102,9 +107,11 @@ describe('domain', function () { }); }); }); + describe('Sad Path', function () { const MockProvider = { insert: vi.fn(), find: vi.fn() }; let mockedSender: RequestSender; + beforeEach(async function () { const [app, container] = await getApp({ override: [ @@ -118,6 +125,7 @@ describe('domain', function () { await container.resolve(DataSource).destroy(); vi.resetAllMocks(); }); + describe('GET /domain', function () { it('should return 500 status code if db throws an error', async function () { MockProvider.find.mockRejectedValue(new Error('')); @@ -128,6 +136,7 @@ describe('domain', function () { expect(res).toSatisfyApiSpec(); }); }); + describe('POST /domain', function () { it('should return 500 status code if db throws an error', async function () { MockProvider.insert.mockRejectedValue(new Error('')); diff --git a/apps/auth-manager/tests/integration/key/key.spec.ts b/apps/auth-manager/tests/integration/key/key.spec.ts index df8218e1..b88ce58a 100644 --- a/apps/auth-manager/tests/integration/key/key.spec.ts +++ b/apps/auth-manager/tests/integration/key/key.spec.ts @@ -3,15 +3,17 @@ import { beforeEach, describe, expect, it, vi, beforeAll, afterEach } from 'vite import { jsLogger } from '@map-colonies/js-logger'; import { trace } from '@opentelemetry/api'; import httpStatusCodes from 'http-status-codes'; -import { DependencyContainer } from 'tsyringe'; +import type { DependencyContainer } from 'tsyringe'; import 'jest-openapi'; import { DataSource } from 'typeorm'; -import { createRequestSender, RequestSender } from '@map-colonies/openapi-helpers/requestSender'; -import { IKey, Environments, Key, Environment } from '@map-colonies/auth-core'; -import { paths, operations, components } from '@openapi'; +import type { RequestSender } from '@map-colonies/openapi-helpers/requestSender'; +import { createRequestSender } from '@map-colonies/openapi-helpers/requestSender'; +import type { IKey, Environments } from '@map-colonies/auth-core'; +import { Key, Environment } from '@map-colonies/auth-core'; +import type { paths, operations, components } from '@openapi'; import { getApp } from '@src/app'; import { SERVICES } from '@src/common/constants'; -import { KeyRepository } from '@src/key/DAL/keyRepository'; +import type { KeyRepository } from '@src/key/DAL/keyRepository'; import { getMockKeys } from '@tests/utils/key'; import { initConfig } from '@src/common/config'; @@ -237,6 +239,7 @@ describe('key', function () { }); }); }); + describe('Sad Path', function () { afterEach(function () { vi.restoreAllMocks(); @@ -253,6 +256,7 @@ describe('key', function () { expect(res).toSatisfyApiSpec(); }); }); + describe('POST /key', function () { it('should return 500 status code if db throws an error', async function () { const repo = depContainer.resolve(SERVICES.KEY_REPOSITORY); diff --git a/apps/auth-manager/tests/unit/asset/models/assetManager.spec.ts b/apps/auth-manager/tests/unit/asset/models/assetManager.spec.ts index a8355a90..cf9e61fb 100644 --- a/apps/auth-manager/tests/unit/asset/models/assetManager.spec.ts +++ b/apps/auth-manager/tests/unit/asset/models/assetManager.spec.ts @@ -3,7 +3,7 @@ import { jsLogger } from '@map-colonies/js-logger'; import { Environment } from '@map-colonies/auth-core'; import { AssetManager } from '@src/asset/models/assetManager'; import { AssetNotFoundError, AssetVersionMismatchError } from '@src/asset/models/errors'; -import { AssetRepository } from '@src/asset/DAL/assetRepository'; +import type { AssetRepository } from '@src/asset/DAL/assetRepository'; import { getFakeAsset } from '@tests/utils/asset'; const logger = jsLogger({ enabled: false }); @@ -15,10 +15,12 @@ describe('AssetManager', () => { findOne: vi.fn(), transaction: vi.fn(), }; + beforeEach(function () { assetManager = new AssetManager(logger, mockedRepository as unknown as AssetRepository); vi.resetAllMocks(); }); + describe('#getAssets', () => { it('should return the array of assets', async function () { const asset = getFakeAsset(); @@ -37,6 +39,7 @@ describe('AssetManager', () => { await expect(assetPromise).rejects.toThrow(); }); }); + describe('#getNamedAssets', () => { it('should return the array of assets', async function () { const asset = getFakeAsset(); @@ -55,6 +58,7 @@ describe('AssetManager', () => { await expect(assetPromise).rejects.toThrow(); }); }); + describe('#getAsset', () => { it('should return the asset', async function () { const asset = getFakeAsset(); @@ -81,12 +85,14 @@ describe('AssetManager', () => { await expect(assetPromise).rejects.toThrow(AssetNotFoundError); }); }); + describe('#upsertAsset', () => { let manager: AssetManager; const transactionRepo = { getMaxVersionWithLock: vi.fn(), save: vi.fn(), }; + beforeEach(function () { vi.resetAllMocks(); const repo = { manager: { transaction: vi.fn() } }; diff --git a/apps/auth-manager/tests/unit/bundle/models/bundleModel.spec.ts b/apps/auth-manager/tests/unit/bundle/models/bundleModel.spec.ts index c1abe40e..b503bac6 100644 --- a/apps/auth-manager/tests/unit/bundle/models/bundleModel.spec.ts +++ b/apps/auth-manager/tests/unit/bundle/models/bundleModel.spec.ts @@ -1,7 +1,7 @@ import { beforeEach, describe, expect, it, vi } from 'vitest'; import { jsLogger } from '@map-colonies/js-logger'; -import { Bundle } from '@map-colonies/auth-core'; -import { Repository } from 'typeorm'; +import type { Bundle } from '@map-colonies/auth-core'; +import type { Repository } from 'typeorm'; import { BundleManager } from '@src/bundle/models/bundleManager'; import { BundleNotFoundError } from '@src/bundle/models/errors'; import { getFakeBundle } from '@tests/utils/bundle'; @@ -14,10 +14,12 @@ describe('BundleManager', () => { findBy: vi.fn(), findOneBy: vi.fn(), }; + beforeEach(function () { bundleManager = new BundleManager(logger, mockedRepository as unknown as Repository); vi.resetAllMocks(); }); + describe('#getBundles', () => { it('should return the array of bundles', async function () { const bundle = getFakeBundle(); @@ -36,6 +38,7 @@ describe('BundleManager', () => { await expect(bundlePromise).rejects.toThrow(); }); }); + describe('#getBundle', () => { it('should return the bundle', async function () { const bundle = getFakeBundle(); diff --git a/apps/auth-manager/tests/unit/client/models/clientManager.spec.ts b/apps/auth-manager/tests/unit/client/models/clientManager.spec.ts index 869b5344..e7313c3e 100644 --- a/apps/auth-manager/tests/unit/client/models/clientManager.spec.ts +++ b/apps/auth-manager/tests/unit/client/models/clientManager.spec.ts @@ -2,7 +2,7 @@ import { beforeEach, describe, expect, it, vi } from 'vitest'; import { jsLogger } from '@map-colonies/js-logger'; import { DatabaseError } from 'pg'; import { QueryFailedError } from 'typeorm'; -import { ClientRepository } from '@src/client/DAL/clientRepository'; +import type { ClientRepository } from '@src/client/DAL/clientRepository'; import { ClientManager } from '@src/client/models/clientManager'; import { ClientAlreadyExistsError, ClientNotFoundError } from '@src/client/models/errors'; import { PgErrorCodes } from '@src/common/db/constants'; @@ -18,10 +18,12 @@ describe('ClientManager', () => { findOne: vi.fn(), updateAndReturn: vi.fn(), }; + beforeEach(function () { clientManager = new ClientManager(logger, mockedRepository as unknown as ClientRepository); vi.resetAllMocks(); }); + describe('#getClients', () => { it('should return the array of clients', async function () { const client = getFakeClient(true); @@ -67,6 +69,7 @@ describe('ClientManager', () => { await expect(clientPromise).rejects.toThrow(ClientNotFoundError); }); }); + describe('#createClient', () => { it('should insert into the db and return the client', async function () { const client = getFakeClient(false); diff --git a/apps/auth-manager/tests/unit/connection/models/connectionManager.spec.ts b/apps/auth-manager/tests/unit/connection/models/connectionManager.spec.ts index cd125cb6..3fed8512 100644 --- a/apps/auth-manager/tests/unit/connection/models/connectionManager.spec.ts +++ b/apps/auth-manager/tests/unit/connection/models/connectionManager.spec.ts @@ -3,12 +3,12 @@ import { jsLogger } from '@map-colonies/js-logger'; import { Environment } from '@map-colonies/auth-core'; import { ConnectionManager } from '@src/connection/models/connectionManager'; import { ConnectionNotFoundError, ConnectionVersionMismatchError } from '@src/connection/models/errors'; -import { ConnectionRepository } from '@src/connection/DAL/connectionRepository'; +import type { ConnectionRepository } from '@src/connection/DAL/connectionRepository'; import { getFakeConnection } from '@tests/utils/connection'; -import { DomainRepository } from '@src/domain/DAL/domainRepository'; +import type { DomainRepository } from '@src/domain/DAL/domainRepository'; import { ClientNotFoundError } from '@src/client/models/errors'; import { DomainNotFoundError } from '@src/domain/models/errors'; -import { KeyRepository } from '@src/key/DAL/keyRepository'; +import type { KeyRepository } from '@src/key/DAL/keyRepository'; import { getRealKeys } from '@tests/utils/key'; import { KeyNotFoundError } from '@src/key/models/errors'; @@ -24,6 +24,7 @@ describe('ConnectionManager', () => { }; const mockedDomainRepository = {}; const mockedKeysRepository = {}; + beforeEach(function () { connectionManager = new ConnectionManager( logger, @@ -33,6 +34,7 @@ describe('ConnectionManager', () => { ); vi.resetAllMocks(); }); + describe('#getConnections', () => { it('should throw an error if one is thrown by the repository', async function () { mockedConnectionRepository.findAndCount.mockRejectedValue(new Error()); @@ -69,6 +71,7 @@ describe('ConnectionManager', () => { await expect(connectionPromise).rejects.toThrow(ConnectionNotFoundError); }); }); + describe('#upsertConnection', () => { let manager: ConnectionManager; const connectionTransactionRepo = { @@ -84,6 +87,7 @@ describe('ConnectionManager', () => { const keyTransactionRepo = { getLatestKeys: vi.fn(), }; + beforeEach(function () { vi.resetAllMocks(); clientTransactionRepo.findOneBy.mockResolvedValue({}); diff --git a/apps/auth-manager/tests/unit/domain/models/domainModel.spec.ts b/apps/auth-manager/tests/unit/domain/models/domainModel.spec.ts index 7241b3d4..f0b6a55f 100644 --- a/apps/auth-manager/tests/unit/domain/models/domainModel.spec.ts +++ b/apps/auth-manager/tests/unit/domain/models/domainModel.spec.ts @@ -1,6 +1,6 @@ import { beforeEach, describe, expect, it, vi } from 'vitest'; import { jsLogger } from '@map-colonies/js-logger'; -import { DomainRepository } from '@src/domain/DAL/domainRepository'; +import type { DomainRepository } from '@src/domain/DAL/domainRepository'; import { DomainManager } from '@src/domain/models/domainManager'; import { DomainAlreadyExistsError } from '@src/domain/models/errors'; @@ -10,10 +10,12 @@ describe('DomainManager', () => { findAndCount: vi.fn(), insert: vi.fn(), }; + beforeEach(function () { domainManager = new DomainManager(jsLogger({ enabled: false }), mockedRepository as unknown as DomainRepository); vi.resetAllMocks(); }); + describe('#getDomains', () => { it('should return the array of domains', async function () { mockedRepository.findAndCount.mockResolvedValue([{ name: 'avi' }]); @@ -31,6 +33,7 @@ describe('DomainManager', () => { await expect(domainPromise).rejects.toThrow(); }); }); + describe('#createDomain', () => { it('should insert into the db and return the domain', async function () { mockedRepository.insert.mockResolvedValue(undefined); diff --git a/apps/auth-manager/tests/unit/utils/utils.spec.ts b/apps/auth-manager/tests/unit/utils/utils.spec.ts index 289cc19a..c522c5dc 100644 --- a/apps/auth-manager/tests/unit/utils/utils.spec.ts +++ b/apps/auth-manager/tests/unit/utils/utils.spec.ts @@ -5,25 +5,26 @@ describe('asteriskStringComparatorLast', () => { const comparator = asteriskStringComparatorLast(); describe('Happy Path', () => { - it('returns 1 when a has asterisk and b does not', () => { + it('should return 1 when a has asterisk and b does not', () => { expect(comparator('foo*', 'bar')).toBe(1); }); - it('returns -1 when a does not have asterisk and b does', () => { + it('should return -1 when a does not have asterisk and b does', () => { expect(comparator('foo', 'bar*')).toBe(-1); }); - it('returns 0 when both have asterisk', () => { + it('should return 0 when both have asterisk', () => { expect(comparator('foo*', 'bar*')).toBe(0); }); - it('returns 0 when neither have asterisk', () => { + it('should return 0 when neither have asterisk', () => { expect(comparator('foo', 'bar')).toBe(0); }); - it('sorts array with asterisk strings last', () => { + it('should sort array with asterisk strings last', () => { const arr = ['foo*', 'bar', 'baz*', 'qux']; const sorted = arr.sort(comparator); + expect(sorted).toEqual(['bar', 'qux', 'foo*', 'baz*']); }); }); diff --git a/apps/auth-manager/tests/utils/asset.ts b/apps/auth-manager/tests/utils/asset.ts index f501b337..5a8affc1 100644 --- a/apps/auth-manager/tests/utils/asset.ts +++ b/apps/auth-manager/tests/utils/asset.ts @@ -1,5 +1,6 @@ import { faker } from '@faker-js/faker'; -import { AssetType, Environment, IAsset } from '@map-colonies/auth-core'; +import type { IAsset } from '@map-colonies/auth-core'; +import { AssetType, Environment } from '@map-colonies/auth-core'; const EIGHT = 8; diff --git a/apps/auth-manager/tests/utils/bundle.ts b/apps/auth-manager/tests/utils/bundle.ts index 1df7e8e3..f0944864 100644 --- a/apps/auth-manager/tests/utils/bundle.ts +++ b/apps/auth-manager/tests/utils/bundle.ts @@ -1,5 +1,6 @@ import { faker } from '@faker-js/faker'; -import { Environment, IBundle } from '@map-colonies/auth-core'; +import type { IBundle } from '@map-colonies/auth-core'; +import { Environment } from '@map-colonies/auth-core'; const EIGHT = 8; diff --git a/apps/auth-manager/tests/utils/client.ts b/apps/auth-manager/tests/utils/client.ts index 231cd100..62266c44 100644 --- a/apps/auth-manager/tests/utils/client.ts +++ b/apps/auth-manager/tests/utils/client.ts @@ -1,5 +1,5 @@ import { faker } from '@faker-js/faker'; -import { IClient } from '@map-colonies/auth-core'; +import type { IClient } from '@map-colonies/auth-core'; export function getFakeClient(includeGeneratedFields: boolean): IClient { const firstName = faker.person.firstName(); diff --git a/apps/auth-manager/tests/utils/connection.ts b/apps/auth-manager/tests/utils/connection.ts index a64ffd45..035b53b5 100644 --- a/apps/auth-manager/tests/utils/connection.ts +++ b/apps/auth-manager/tests/utils/connection.ts @@ -1,5 +1,6 @@ import { faker } from '@faker-js/faker'; -import { Connection, Environment, IConnection } from '@map-colonies/auth-core'; +import type { Connection, IConnection } from '@map-colonies/auth-core'; +import { Environment } from '@map-colonies/auth-core'; const EIGHT = 8; diff --git a/apps/auth-manager/tests/utils/key.ts b/apps/auth-manager/tests/utils/key.ts index 0ccc01fc..95b04c9c 100644 --- a/apps/auth-manager/tests/utils/key.ts +++ b/apps/auth-manager/tests/utils/key.ts @@ -1,5 +1,5 @@ import { faker } from '@faker-js/faker'; -import { JWKPrivateKey, JWKPublicKey } from '@map-colonies/auth-core'; +import type { JWKPrivateKey, JWKPublicKey } from '@map-colonies/auth-core'; const THREE = 3; diff --git a/apps/kiosk-ui/src/components/snake-game.tsx b/apps/kiosk-ui/src/components/snake-game.tsx index dd9e91ce..3cae7067 100644 --- a/apps/kiosk-ui/src/components/snake-game.tsx +++ b/apps/kiosk-ui/src/components/snake-game.tsx @@ -37,7 +37,7 @@ export function SnakeGame({ isVisible }: SnakeGameProps) { interpolationProgress: 0, lastUpdateTime: 0, }); - const gameLoopRef = useRef(null); + const gameLoopRef = useRef(null); const [displayScore, setDisplayScore] = useState(0); const [displayGameOver, setDisplayGameOver] = useState(false); const [displayIsPlaying, setDisplayIsPlaying] = useState(false); diff --git a/apps/kiosk-ui/src/hooks/use-token-generation.ts b/apps/kiosk-ui/src/hooks/use-token-generation.ts index d46782fd..8f0395de 100644 --- a/apps/kiosk-ui/src/hooks/use-token-generation.ts +++ b/apps/kiosk-ui/src/hooks/use-token-generation.ts @@ -15,7 +15,7 @@ export function useTokenGeneration() { // Simulate progress bar for UX when fetching useEffect(() => { let active = true; - let timeoutId: NodeJS.Timeout; + let timeoutId: number; if (isLoading) { setProgress(0); diff --git a/apps/token-kiosk/eslint.config.mjs b/apps/token-kiosk/eslint.config.mjs index a45ca768..71f38a4c 100644 --- a/apps/token-kiosk/eslint.config.mjs +++ b/apps/token-kiosk/eslint.config.mjs @@ -1,4 +1,5 @@ -import { config } from '@map-colonies/eslint-config/helpers'; -import baseConfig from '../../eslint.config.mjs'; +import { defineConfig, globalIgnores } from 'eslint/config'; +import tsBaseConfig from '@map-colonies/eslint-config/ts-base'; +import vitestConfig from '@map-colonies/eslint-config/vitest'; -export default config(baseConfig, { ignores: ['vitest.config.mts', 'ui/**/*', 'drizzle.config.mts'] }); +export default defineConfig(tsBaseConfig, vitestConfig, globalIgnores(['vitest.config.mts', 'ui/**/*', 'drizzle.config.mts'])); diff --git a/apps/token-kiosk/package.json b/apps/token-kiosk/package.json index abb309fd..6b270266 100644 --- a/apps/token-kiosk/package.json +++ b/apps/token-kiosk/package.json @@ -7,8 +7,6 @@ "test": "vitest run", "test:watch": "vitest watch", "test:ui": "vitest --ui", - "format": "prettier --check .", - "format:fix": "prettier --write .", "lint:openapi": "redocly lint openapi3.yaml", "lint": "eslint .", "lint:fix": "eslint --fix .", @@ -66,9 +64,7 @@ "devDependencies": { "@commitlint/cli": "^19.8.0", "@map-colonies/commitlint-config": "^1.1.1", - "@map-colonies/eslint-config": "^6.0.0", "@map-colonies/openapi-helpers": "catalog:", - "@map-colonies/prettier-config": "0.0.1", "@map-colonies/tsconfig": "^1.0.1", "config": "4.4.1", "@types/compression": "^1.7.5", @@ -81,17 +77,13 @@ "@vitest/coverage-v8": "catalog:", "@vitest/ui": "catalog:", "@types/body-parser": "1.19.6", + "@types/lodash": "^4.17.24", "@types/pg": "^8.20.0", "copyfiles": "^2.4.1", "cross-env": "^7.0.3", "drizzle-kit": "^0.31.4", - "eslint": "^9.23.0", - "eslint-plugin-jest": "^28.11.0", - "husky": "^9.1.7", "jest-openapi": "^0.14.2", "nock": "^14.0.5", - "prettier": "^3.5.3", - "pretty-quick": "^4.1.1", "rimraf": "^6.0.1", "supertest": "^7.1.0", "tsc-alias": "^1.8.11", diff --git a/apps/token-kiosk/src/app.ts b/apps/token-kiosk/src/app.ts index 90797c7a..ba8a8049 100644 --- a/apps/token-kiosk/src/app.ts +++ b/apps/token-kiosk/src/app.ts @@ -1,6 +1,7 @@ -import { Application } from 'express'; -import { DependencyContainer } from 'tsyringe'; -import { registerExternalValues, RegisterOptions } from './containerConfig'; +import type { Application } from 'express'; +import type { DependencyContainer } from 'tsyringe'; +import type { RegisterOptions } from './containerConfig'; +import { registerExternalValues } from './containerConfig'; import { ServerBuilder } from './serverBuilder'; async function getApp(registerOptions?: RegisterOptions): Promise<[Application, DependencyContainer]> { diff --git a/apps/token-kiosk/src/auth/controllers/authController.ts b/apps/token-kiosk/src/auth/controllers/authController.ts index fbd0a0b7..f7e1bd9e 100644 --- a/apps/token-kiosk/src/auth/controllers/authController.ts +++ b/apps/token-kiosk/src/auth/controllers/authController.ts @@ -24,14 +24,14 @@ export class AuthController { // eslint-disable-next-line @typescript-eslint/no-unsafe-argument res.status(httpStatus.OK).json(userInfo); /* eslint-enable @typescript-eslint/no-unsafe-assignment */ - } catch (error) { - this.logger.error({ msg: 'Failed to fetch user info', error }); - if (typeof error === 'object' && error !== null && 'error' in error && error.error === 'invalid_token') { + } catch (err) { + this.logger.error({ msg: 'Failed to fetch user info', err }); + if (typeof err === 'object' && err !== null && 'error' in err && err.error === 'invalid_token') { return res.status(httpStatus.UNAUTHORIZED).json({ message: 'Invalid or expired token', }); } - next(error); + next(err); } }; } diff --git a/apps/token-kiosk/src/auth/middlewares/openid.ts b/apps/token-kiosk/src/auth/middlewares/openid.ts index cc79bcd3..7d9ef394 100644 --- a/apps/token-kiosk/src/auth/middlewares/openid.ts +++ b/apps/token-kiosk/src/auth/middlewares/openid.ts @@ -1,6 +1,6 @@ -import { RequestHandler } from 'express'; +import type { RequestHandler } from 'express'; import { auth, type SessionStore } from 'express-openid-connect'; -import { DependencyContainer } from 'tsyringe'; +import type { DependencyContainer } from 'tsyringe'; import session from 'express-session'; import createMemoryStore from 'memorystore'; import { SERVICES } from '@src/common/constants'; diff --git a/apps/token-kiosk/src/auth/routes/authRouter.ts b/apps/token-kiosk/src/auth/routes/authRouter.ts index 1160ff5a..d3b08cba 100644 --- a/apps/token-kiosk/src/auth/routes/authRouter.ts +++ b/apps/token-kiosk/src/auth/routes/authRouter.ts @@ -1,5 +1,5 @@ import { Router } from 'express'; -import { FactoryFunction } from 'tsyringe'; +import type { FactoryFunction } from 'tsyringe'; import { AuthController } from '../controllers/authController'; const authRouterFactory: FactoryFunction = (dependencyContainer) => { diff --git a/apps/token-kiosk/src/common/dependencyRegistration.ts b/apps/token-kiosk/src/common/dependencyRegistration.ts index a591ff93..6b35ae1d 100644 --- a/apps/token-kiosk/src/common/dependencyRegistration.ts +++ b/apps/token-kiosk/src/common/dependencyRegistration.ts @@ -1,5 +1,6 @@ -import { ClassProvider, container as defaultContainer, FactoryProvider, InjectionToken, ValueProvider } from 'tsyringe'; -import { constructor, DependencyContainer } from 'tsyringe/dist/typings/types'; +import type { ClassProvider, FactoryProvider, InjectionToken, ValueProvider } from 'tsyringe'; +import { container as defaultContainer } from 'tsyringe'; +import type { constructor, DependencyContainer } from 'tsyringe/dist/typings/types'; export type Providers = ValueProvider | FactoryProvider | ClassProvider | constructor; diff --git a/apps/token-kiosk/src/containerConfig.ts b/apps/token-kiosk/src/containerConfig.ts index 6fc72c0d..b45637f9 100644 --- a/apps/token-kiosk/src/containerConfig.ts +++ b/apps/token-kiosk/src/containerConfig.ts @@ -1,11 +1,12 @@ import { getOtelMixin } from '@map-colonies/telemetry'; import { trace } from '@opentelemetry/api'; import { Registry } from 'prom-client'; -import { DependencyContainer } from 'tsyringe/dist/typings/types'; +import type { DependencyContainer } from 'tsyringe/dist/typings/types'; import { jsLogger } from '@map-colonies/js-logger'; -import { Pool } from 'pg'; +import type { Pool } from 'pg'; import { instanceCachingFactory, instancePerContainerCachingFactory } from 'tsyringe'; -import { InjectionObject, registerDependencies } from '@common/dependencyRegistration'; +import type { InjectionObject } from '@common/dependencyRegistration'; +import { registerDependencies } from '@common/dependencyRegistration'; import { SERVICES, SERVICE_NAME } from '@common/constants'; import { getTracing } from '@common/tracing'; import { tokenRouterFactory, TOKEN_ROUTER_SYMBOL } from './tokens/routes/tokenRouter'; diff --git a/apps/token-kiosk/src/db/createConnection.ts b/apps/token-kiosk/src/db/createConnection.ts index 52fc137a..6d78b956 100644 --- a/apps/token-kiosk/src/db/createConnection.ts +++ b/apps/token-kiosk/src/db/createConnection.ts @@ -5,7 +5,7 @@ import type { commonDbFullV1Type } from '@map-colonies/schemas'; import { drizzle } from 'drizzle-orm/node-postgres'; import { migrate } from 'drizzle-orm/node-postgres/migrator'; import { Pool, type PoolConfig } from 'pg'; -import { HealthCheck } from '@godaddy/terminus'; +import type { HealthCheck } from '@godaddy/terminus'; import { promiseTimeout } from '../common/utils'; import { DB_CONNECTION_TIMEOUT } from '../common/constants'; import { users } from '../users/user'; diff --git a/apps/token-kiosk/src/files/models/lyrxCreator.ts b/apps/token-kiosk/src/files/models/lyrxCreator.ts index 9953246a..bb0e8530 100644 --- a/apps/token-kiosk/src/files/models/lyrxCreator.ts +++ b/apps/token-kiosk/src/files/models/lyrxCreator.ts @@ -1,4 +1,4 @@ -import { CatalogRecord } from './catalogManager'; +import type { CatalogRecord } from './catalogManager'; function createLayerDefinition(record: CatalogRecord, token: string): object { return { diff --git a/apps/token-kiosk/src/files/routes/filesRouter.ts b/apps/token-kiosk/src/files/routes/filesRouter.ts index ac1ca8bc..b2b913b6 100644 --- a/apps/token-kiosk/src/files/routes/filesRouter.ts +++ b/apps/token-kiosk/src/files/routes/filesRouter.ts @@ -1,5 +1,5 @@ import { Router } from 'express'; -import { FactoryFunction } from 'tsyringe'; +import type { FactoryFunction } from 'tsyringe'; import { FileController } from '../controllers/filesController'; const filesRouterFactory: FactoryFunction = (dependencyContainer) => { diff --git a/apps/token-kiosk/src/guides/routes/guidesRouter.ts b/apps/token-kiosk/src/guides/routes/guidesRouter.ts index c5dfe79e..ebff470e 100644 --- a/apps/token-kiosk/src/guides/routes/guidesRouter.ts +++ b/apps/token-kiosk/src/guides/routes/guidesRouter.ts @@ -1,5 +1,5 @@ import { Router } from 'express'; -import { FactoryFunction } from 'tsyringe'; +import type { FactoryFunction } from 'tsyringe'; import { GuidesController } from '../controllers/guidesController'; const guidesRouterFactory: FactoryFunction = (dependencyContainer) => { diff --git a/apps/token-kiosk/src/index.ts b/apps/token-kiosk/src/index.ts index 0dbe32bf..d50ae7d3 100644 --- a/apps/token-kiosk/src/index.ts +++ b/apps/token-kiosk/src/index.ts @@ -1,10 +1,11 @@ // this import must be called before the first import of tsyringe import 'reflect-metadata'; -import { createServer } from 'http'; -import { createTerminus, HealthCheck } from '@godaddy/terminus'; -import { Logger } from '@map-colonies/js-logger'; +import { createServer } from 'node:http'; +import type { HealthCheck } from '@godaddy/terminus'; +import { createTerminus } from '@godaddy/terminus'; +import type { Logger } from '@map-colonies/js-logger'; import { SERVICES } from '@common/constants'; -import { ConfigType } from '@common/config'; +import type { ConfigType } from '@common/config'; import { getApp } from './app'; void getApp() diff --git a/apps/token-kiosk/src/tokens/controllers/tokenController.ts b/apps/token-kiosk/src/tokens/controllers/tokenController.ts index 4104f9a1..4ebe7211 100644 --- a/apps/token-kiosk/src/tokens/controllers/tokenController.ts +++ b/apps/token-kiosk/src/tokens/controllers/tokenController.ts @@ -39,7 +39,7 @@ export class TokenController { message: 'user is banned', }); } - this.logger.error({ msg: 'Error while getting token', error: err }); + this.logger.error({ msg: 'Error while getting token', err }); return next(err); } }; diff --git a/apps/token-kiosk/src/tokens/models/authManagerClient.ts b/apps/token-kiosk/src/tokens/models/authManagerClient.ts index 558bd387..69223124 100644 --- a/apps/token-kiosk/src/tokens/models/authManagerClient.ts +++ b/apps/token-kiosk/src/tokens/models/authManagerClient.ts @@ -1,7 +1,8 @@ -import createClient, { Client } from 'openapi-fetch'; +import type { Client } from 'openapi-fetch'; +import createClient from 'openapi-fetch'; import type { DependencyContainer } from 'tsyringe'; import type { paths } from '@src/auth-manager'; -import { ConfigType } from '@src/common/config'; +import type { ConfigType } from '@src/common/config'; import { SERVICES } from '@src/common/constants'; export type AuthManagerClient = Client; diff --git a/apps/token-kiosk/src/tokens/models/tokenManager.ts b/apps/token-kiosk/src/tokens/models/tokenManager.ts index 97562b14..6c3f09d6 100644 --- a/apps/token-kiosk/src/tokens/models/tokenManager.ts +++ b/apps/token-kiosk/src/tokens/models/tokenManager.ts @@ -112,7 +112,7 @@ export class TokenManager { params: { path: { environment: env } }, }); if (privateKey.error) { - this.logger.error({ msg: 'failed to fetch private key', env, error: privateKey.error }); + this.logger.error({ msg: 'failed to fetch private key', env, err: privateKey.error }); throw new Error(`Failed to fetch private key for environment ${env}`, { cause: privateKey.error }); } this.logger.info({ msg: 'private key fetched successfully', env }); diff --git a/apps/token-kiosk/src/tokens/routes/tokenRouter.ts b/apps/token-kiosk/src/tokens/routes/tokenRouter.ts index 4a5d087a..c999833d 100644 --- a/apps/token-kiosk/src/tokens/routes/tokenRouter.ts +++ b/apps/token-kiosk/src/tokens/routes/tokenRouter.ts @@ -1,5 +1,5 @@ import { Router } from 'express'; -import { FactoryFunction } from 'tsyringe'; +import type { FactoryFunction } from 'tsyringe'; import { TokenController } from '../controllers/tokenController'; const tokenRouterFactory: FactoryFunction = (dependencyContainer) => { diff --git a/apps/token-kiosk/tests/files/files.spec.ts b/apps/token-kiosk/tests/files/files.spec.ts index 002e4ba0..90f4479c 100644 --- a/apps/token-kiosk/tests/files/files.spec.ts +++ b/apps/token-kiosk/tests/files/files.spec.ts @@ -4,12 +4,13 @@ import { jsLogger } from '@map-colonies/js-logger'; import nock, { abortPendingRequests, cleanAll } from 'nock'; import { trace } from '@opentelemetry/api'; import httpStatusCodes from 'http-status-codes'; -import { createRequestSender, RequestSender } from '@map-colonies/openapi-helpers/requestSender'; +import type { RequestSender } from '@map-colonies/openapi-helpers/requestSender'; +import { createRequestSender } from '@map-colonies/openapi-helpers/requestSender'; import type { RequestContext } from 'express-openid-connect'; import type { RequestHandler } from 'express'; -import { paths, operations } from '@openapi'; +import type { paths, operations } from '@openapi'; import { getApp } from '@src/app'; -import { Drizzle } from '@src/db/createConnection'; +import type { Drizzle } from '@src/db/createConnection'; import { users } from '@src/users/user'; import { SERVICES } from '@common/constants'; import { initConfig } from '@src/common/config'; @@ -174,6 +175,7 @@ describe('guides', function () { nock('http://localhost:8085').post('/api/raster/v1').reply(httpStatusCodes.OK, ''); const res = await requestSender.getFile({ pathParams: { type: 'qlr' } }); + expect(res).toSatisfyApiSpec(); expect(res).toHaveProperty('statusCode', httpStatusCodes.INTERNAL_SERVER_ERROR); }); @@ -191,6 +193,7 @@ describe('guides', function () { nock('http://localhost:8085').post('/api/raster/v1').reply(httpStatusCodes.OK, emptyResponse); const res = await requestSender.getFile({ pathParams: { type: 'qlr' } }); + expect(res).toSatisfyApiSpec(); expect(res).toHaveProperty('statusCode', httpStatusCodes.INTERNAL_SERVER_ERROR); }); diff --git a/apps/token-kiosk/tests/guides/guides.spec.ts b/apps/token-kiosk/tests/guides/guides.spec.ts index 3e60c189..bb10d1b0 100644 --- a/apps/token-kiosk/tests/guides/guides.spec.ts +++ b/apps/token-kiosk/tests/guides/guides.spec.ts @@ -2,10 +2,11 @@ import { describe, beforeEach, it, expect, beforeAll, afterEach, vi } from 'vite import { jsLogger } from '@map-colonies/js-logger'; import { trace } from '@opentelemetry/api'; import httpStatusCodes from 'http-status-codes'; -import { createRequestSender, RequestSender } from '@map-colonies/openapi-helpers/requestSender'; +import type { RequestSender } from '@map-colonies/openapi-helpers/requestSender'; +import { createRequestSender } from '@map-colonies/openapi-helpers/requestSender'; import type { RequestContext } from 'express-openid-connect'; import type { RequestHandler } from 'express'; -import { paths, operations } from '@openapi'; +import type { paths, operations } from '@openapi'; import { getApp } from '@src/app'; import { SERVICES } from '@common/constants'; import { initConfig } from '@src/common/config'; diff --git a/apps/token-kiosk/tests/token/token.spec.ts b/apps/token-kiosk/tests/token/token.spec.ts index 795a1836..a3366a86 100644 --- a/apps/token-kiosk/tests/token/token.spec.ts +++ b/apps/token-kiosk/tests/token/token.spec.ts @@ -1,27 +1,28 @@ -import { setTimeout as sleep } from 'timers/promises'; +import { setTimeout as sleep } from 'node:timers/promises'; import { describe, beforeEach, it, expect, beforeAll, afterEach, vi } from 'vitest'; import { jsLogger } from '@map-colonies/js-logger'; import nock, { abortPendingRequests, cleanAll } from 'nock'; import { trace } from '@opentelemetry/api'; import httpStatusCodes from 'http-status-codes'; -import { createRequestSender, RequestSender } from '@map-colonies/openapi-helpers/requestSender'; +import { createRequestSender, type RequestSender } from '@map-colonies/openapi-helpers/requestSender'; import type { RequestContext } from 'express-openid-connect'; import type { RequestHandler } from 'express'; import { eq } from 'drizzle-orm'; import { subWeeks } from 'date-fns'; -import { paths, operations } from '@openapi'; +import type { paths, operations } from '@openapi'; import { getApp } from '@src/app'; -import { Drizzle } from '@src/db/createConnection'; +import type { Drizzle } from '@src/db/createConnection'; import { users } from '@src/users/user'; import { SERVICES } from '@common/constants'; import { initConfig } from '@src/common/config'; import privateKey from '../data/key'; import mockUser from '../data/user'; -// Type guard for token response -const isTokenResponse = (body: unknown): body is { token: string; expiration: string } => { - return typeof body === 'object' && body !== null && 'token' in body && 'expiration' in body; -}; +function assertIsTokenResponse(body: unknown): asserts body is { token: string; expiration: string } { + if (!(typeof body === 'object' && body !== null && 'token' in body && 'expiration' in body)) { + throw new Error('Expected body to contain token and expiration fields'); + } +} describe('token', function () { let requestSender: RequestSender; @@ -72,9 +73,9 @@ describe('token', function () { expect(res).toSatisfyApiSpec(); - if (isTokenResponse(res.body)) { - expect(res.body.token).not.toBe(''); - } + assertIsTokenResponse(res.body); + + expect(res.body.token).not.toBe(''); }); it('should return the same token if requested again while still valid', async function () { @@ -93,9 +94,10 @@ describe('token', function () { expect(firstRes).toSatisfyApiSpec(); expect(secondRes).toSatisfyApiSpec(); - if (isTokenResponse(firstRes.body) && isTokenResponse(secondRes.body)) { - expect(firstRes.body.token).toBe(secondRes.body.token); - } + assertIsTokenResponse(firstRes.body); + assertIsTokenResponse(secondRes.body); + + expect(firstRes.body.token).toBe(secondRes.body.token); }); it('should return valid token structure with proper expiration format', async function () { @@ -105,11 +107,11 @@ describe('token', function () { expect(res).toSatisfyApiSpec(); - if (isTokenResponse(res.body)) { - // Check that expiration is a valid ISO date string - const expiration = new Date(res.body.expiration); - expect(expiration.getTime()).toBeGreaterThan(Date.now()); - } + assertIsTokenResponse(res.body); + // Check that expiration is a valid ISO date string + const expiration = new Date(res.body.expiration); + + expect(expiration.getTime()).toBeGreaterThan(Date.now()); }); it('should return a new token after expiration', async function () { @@ -125,6 +127,7 @@ describe('token', function () { const firstRes = await requestSender.getToken(); expect(firstRes).toHaveProperty('statusCode', httpStatusCodes.OK); + await drizzle .update(users) .set({ @@ -136,11 +139,13 @@ describe('token', function () { await sleep(1000); // Wait for a short period to ensure the token is considered expired const secondRes = await requestSender.getToken(); + expect(secondRes).toHaveProperty('statusCode', httpStatusCodes.OK); - if (isTokenResponse(firstRes.body) && isTokenResponse(secondRes.body)) { - expect(secondRes.body.token).not.toEqual(firstRes.body.token); // Ensure a new token is generated - } + assertIsTokenResponse(firstRes.body); + assertIsTokenResponse(secondRes.body); + + expect(secondRes.body.token).not.toEqual(firstRes.body.token); // Ensure a new token is generated }); }); diff --git a/apps/token-kiosk/tsconfig.json b/apps/token-kiosk/tsconfig.json index 9e8d3180..5f4c3e18 100644 --- a/apps/token-kiosk/tsconfig.json +++ b/apps/token-kiosk/tsconfig.json @@ -8,7 +8,8 @@ "@tests/*": ["tests/*"], "@common/*": ["src/common/*"], "@openapi": ["src/openapi"] - } + }, + "types": ["jest-openapi", "lodash"] }, "include": ["src", "tests"], "exclude": ["node_modules", "dist"] diff --git a/eslint.config.mjs b/eslint.config.mjs deleted file mode 100644 index 240f44ec..00000000 --- a/eslint.config.mjs +++ /dev/null @@ -1,6 +0,0 @@ -import { globalIgnores } from 'eslint/config'; -import tsBaseConfig from '@map-colonies/eslint-config/ts-base'; -import jestConfig from '@map-colonies/eslint-config/jest'; -import { config } from '@map-colonies/eslint-config/helpers'; - -export default config(jestConfig, tsBaseConfig, globalIgnores(['**/dist', '**/dataSource.ts'])); diff --git a/package.json b/package.json index eca76190..07d8290c 100644 --- a/package.json +++ b/package.json @@ -9,10 +9,10 @@ "format": "prettier -c .", "format:fix": "prettier --write .", "test": "turbo run test", - "prelint": "npm run format", - "prelint:fix": "npm run format:fix", - "lint": "lerna run lint", - "lint:fix": "lerna run lint:fix", + "prelint": "pnpm run format", + "prelint:fix": "pnpm run format:fix", + "lint": "turbo run lint", + "lint:fix": "turbo run lint:fix", "version": "node scripts/version-bump.mjs", "release": "npx lerna version --conventional-commits", "build": "turbo run build" @@ -21,15 +21,15 @@ "@commitlint/cli": "^19.8.0", "@commitlint/config-lerna-scopes": "^19.7.0", "@faker-js/faker": "^9.7.0", - "@map-colonies/commitlint-config": "^1.1.1", - "@map-colonies/eslint-config": "^6.0.0", + "@map-colonies/commitlint-config": "^2.0.0", + "@map-colonies/eslint-config": "catalog:", + "@commitlint/config-pnpm-scopes": "^20.4.3", "@map-colonies/infra-copilot-instructions": "^1.1.0", "@map-colonies/prettier-config": "^0.0.1", - "@map-colonies/tsconfig": "^1.0.1", + "@map-colonies/tsconfig": "^2.0.0", "@redocly/cli": "^1.34.2", "cross-env": "^7.0.3", - "eslint": "^9.25.1", - "eslint-plugin-jest": "^28.11.0", + "eslint": "catalog:", "husky": "^9.1.7", "just-safe-set": "4.2.1", "prettier": "^3.5.3", @@ -40,7 +40,8 @@ "typescript": "^5.8.3", "yaml": "2.3.0", "zx": "^7.2.2", - "turbo": "^2.8.20" + "turbo": "^2.8.20", + "@vitest/eslint-plugin": "^1.6.15" }, "engines": { "node": ">=24", diff --git a/packages/auth-bundler/eslint.config.mjs b/packages/auth-bundler/eslint.config.mjs index b73c9aa8..1d75c568 100644 --- a/packages/auth-bundler/eslint.config.mjs +++ b/packages/auth-bundler/eslint.config.mjs @@ -1,4 +1,5 @@ -import { config } from '@map-colonies/eslint-config/helpers'; -import baseConfig from '../../eslint.config.mjs'; +import tsBaseConfig from '@map-colonies/eslint-config/ts-base'; +import vitestConfig from '@map-colonies/eslint-config/vitest'; +import { defineConfig, globalIgnores } from 'eslint/config'; -export default config(baseConfig, {}); +export default defineConfig(tsBaseConfig, vitestConfig, globalIgnores(['drizzle.config.ts', 'vitest.config.mts', 'dataSource.ts'])); diff --git a/packages/auth-bundler/package.json b/packages/auth-bundler/package.json index f9e1228a..fdb40466 100644 --- a/packages/auth-bundler/package.json +++ b/packages/auth-bundler/package.json @@ -11,8 +11,6 @@ "url": "git+https://github.com/MapColonies/opa-la.git" }, "scripts": { - "format": "prettier --check .", - "format:fix": "prettier --write .", "lint": "eslint .", "lint:fix": "eslint --fix .", "migration:run": "npm run typeorm migration:run -- ", diff --git a/packages/auth-bundler/src/bundler.ts b/packages/auth-bundler/src/bundler.ts index 85372615..a6fcae3b 100644 --- a/packages/auth-bundler/src/bundler.ts +++ b/packages/auth-bundler/src/bundler.ts @@ -6,9 +6,9 @@ import { mkdir, writeFile } from 'node:fs/promises'; import path from 'node:path'; -import { Asset, type AssetTypes, Key } from '@map-colonies/auth-core'; +import type { Asset, AssetTypes, Key } from '@map-colonies/auth-core'; import { render } from './templating'; -import { BundleContent } from './types'; +import type { BundleContent } from './types'; import { logger } from './logger'; import { MissingPolicyFilesError } from './errors'; diff --git a/packages/auth-bundler/src/db.ts b/packages/auth-bundler/src/db.ts index c373dfb6..53a89991 100644 --- a/packages/auth-bundler/src/db.ts +++ b/packages/auth-bundler/src/db.ts @@ -1,6 +1,6 @@ -import { DataSource, Repository } from 'typeorm'; -import { Asset, Bundle, Connection, Environments, Key } from '@map-colonies/auth-core'; -import { BundleContent, BundleContentVersions } from './types'; +import type { DataSource, Repository } from 'typeorm'; +import { Asset, Bundle, Connection, type Environments, Key } from '@map-colonies/auth-core'; +import type { BundleContent, BundleContentVersions } from './types'; import { extractNameAndVersion } from './util'; import { logger } from './logger'; import { ConnectionNotInitializedError, KeyNotFoundError } from './errors'; diff --git a/packages/auth-bundler/src/index.ts b/packages/auth-bundler/src/index.ts index 7cec4ad9..b3fe4d6a 100644 --- a/packages/auth-bundler/src/index.ts +++ b/packages/auth-bundler/src/index.ts @@ -10,7 +10,7 @@ import { existsSync } from 'node:fs'; import { createBundleCommand, testCommand, validateBinaryExistCommand, testCoverageCommand } from './opa'; import { createBundleDirectoryStructure } from './bundler'; -import { BundleContent, TestOptions } from './types'; +import type { BundleContent, TestOptions } from './types'; import { logger } from './logger'; import { OpaBundleCreationError, OpaCoverageTooLowError, OpaNotFoundError, OpaTestsFailedError, WorkdirNotFoundError } from './errors'; diff --git a/packages/auth-bundler/src/logger.ts b/packages/auth-bundler/src/logger.ts index 201f0d8f..ab1340a2 100644 --- a/packages/auth-bundler/src/logger.ts +++ b/packages/auth-bundler/src/logger.ts @@ -1,4 +1,4 @@ -import { Logger } from '@map-colonies/js-logger'; +import type { Logger } from '@map-colonies/js-logger'; /** * The optional logger instance for any logging required in this package diff --git a/packages/auth-bundler/src/opa.ts b/packages/auth-bundler/src/opa.ts index fa32134b..1c292ee3 100644 --- a/packages/auth-bundler/src/opa.ts +++ b/packages/auth-bundler/src/opa.ts @@ -92,13 +92,13 @@ export async function getVersionCommand(): Promise { // Extract version from first line: "Version: X.Y.Z" const versionLine = res.stdout.split('\n')[0]; - if (!versionLine) { + if (versionLine === undefined || versionLine === '') { throw new Error('Unable to read OPA version output'); } const versionMatch = versionLine.match(/Version:\s*(\d+\.\d+\.\d+)/); - if (!versionMatch?.[1]) { + if (versionMatch?.[1] === undefined) { throw new Error('Unable to parse OPA version from output'); } diff --git a/packages/auth-bundler/src/templating.ts b/packages/auth-bundler/src/templating.ts index 97b25a28..c6d0ebd6 100644 --- a/packages/auth-bundler/src/templating.ts +++ b/packages/auth-bundler/src/templating.ts @@ -1,4 +1,4 @@ -import handleBars, { HelperOptions } from 'handlebars'; +import handleBars, { type HelperOptions } from 'handlebars'; import { logger } from './logger'; handleBars.registerHelper('escapeJson', (value: string) => { diff --git a/packages/auth-bundler/src/types.ts b/packages/auth-bundler/src/types.ts index 4de96f93..2a9f6b2c 100644 --- a/packages/auth-bundler/src/types.ts +++ b/packages/auth-bundler/src/types.ts @@ -1,4 +1,4 @@ -import { Asset, Connection, Environments, Key } from '@map-colonies/auth-core'; +import type { Asset, Connection, Environments, Key } from '@map-colonies/auth-core'; /** * Interface for describing bundle versions diff --git a/packages/auth-bundler/tests/bundler.spec.ts b/packages/auth-bundler/tests/bundler.spec.ts index 034cbc31..f7483cb0 100644 --- a/packages/auth-bundler/tests/bundler.spec.ts +++ b/packages/auth-bundler/tests/bundler.spec.ts @@ -8,7 +8,7 @@ import { jsLogger } from '@map-colonies/js-logger'; import { Environment } from '@map-colonies/auth-core'; import { createBundleDirectoryStructure } from '@src/bundler'; import { setLogger } from '@src/logger'; -import { BundleContent } from '@src/types'; +import type { BundleContent } from '@src/types'; import { MissingPolicyFilesError } from '@src/errors'; import { getFakeBundleContent } from './utils/bundle'; diff --git a/packages/auth-bundler/tests/db.spec.ts b/packages/auth-bundler/tests/db.spec.ts index dab07a68..8da4c92b 100644 --- a/packages/auth-bundler/tests/db.spec.ts +++ b/packages/auth-bundler/tests/db.spec.ts @@ -77,6 +77,7 @@ describe('db.ts', function () { const res = await db.saveBundle({ assets: [], connections: [], environment: Environment.PRODUCTION, keyVersion: 3 }, 'xdxd'); expect(res).toBeGreaterThan(0); + const bundle = await dataSource.getRepository(Bundle).findOneByOrFail({ id: res }); expect(bundle).toMatchObject({ @@ -98,10 +99,12 @@ describe('db.ts', function () { expect(keyVersion).toBe(1); const asset = assets.filter((a) => a.name === 'aviaviavi'); + expect(asset).toHaveLength(1); expect(asset[0]).toHaveProperty('version', 2); const connection = connections.filter((c) => c.name === 'xd'); + expect(connection).toHaveLength(1); expect(connection[0]).toHaveProperty('version', 2); }); diff --git a/packages/auth-bundler/tests/util.spec.ts b/packages/auth-bundler/tests/util.spec.ts index 0f861d54..7ef8d2fc 100644 --- a/packages/auth-bundler/tests/util.spec.ts +++ b/packages/auth-bundler/tests/util.spec.ts @@ -3,7 +3,7 @@ import { extractNameAndVersion } from '@src/util'; describe('util.ts', function () { describe('#extractNameAndVersion', function () { - it('extract only the name and version from the object', function () { + it('should extract only the name and version from the object', function () { const input = [ { name: 'avi', version: 1, x: 'd' }, { name: 'iva', version: 1, x: 'd' }, diff --git a/packages/auth-bundler/tests/utils/asset.ts b/packages/auth-bundler/tests/utils/asset.ts index 8b2f6985..add7903d 100644 --- a/packages/auth-bundler/tests/utils/asset.ts +++ b/packages/auth-bundler/tests/utils/asset.ts @@ -1,5 +1,5 @@ import { faker } from '@faker-js/faker'; -import { AssetType, Environment, IAsset } from '@map-colonies/auth-core'; +import { AssetType, Environment, type IAsset } from '@map-colonies/auth-core'; const EIGHT = 8; diff --git a/packages/auth-bundler/tests/utils/bundle.ts b/packages/auth-bundler/tests/utils/bundle.ts index d22d7a65..4f2d04bd 100644 --- a/packages/auth-bundler/tests/utils/bundle.ts +++ b/packages/auth-bundler/tests/utils/bundle.ts @@ -1,6 +1,6 @@ import { faker } from '@faker-js/faker'; -import { AssetType, Environment, IBundle } from '@map-colonies/auth-core'; -import { BundleContent } from '@src'; +import { AssetType, Environment, type IBundle } from '@map-colonies/auth-core'; +import type { BundleContent } from '@src/index'; const EIGHT = 8; diff --git a/packages/auth-bundler/tests/utils/connection.ts b/packages/auth-bundler/tests/utils/connection.ts index ad10c278..5598a42d 100644 --- a/packages/auth-bundler/tests/utils/connection.ts +++ b/packages/auth-bundler/tests/utils/connection.ts @@ -1,4 +1,4 @@ -import { Connection, Environment, IConnection } from '@map-colonies/auth-core'; +import { type Connection, Environment, type IConnection } from '@map-colonies/auth-core'; import { faker } from '@faker-js/faker'; const EIGHT = 8; diff --git a/packages/auth-bundler/tests/utils/key.ts b/packages/auth-bundler/tests/utils/key.ts index ad7e5df1..8cd0cd53 100644 --- a/packages/auth-bundler/tests/utils/key.ts +++ b/packages/auth-bundler/tests/utils/key.ts @@ -1,5 +1,5 @@ import { faker } from '@faker-js/faker'; -import { JWKPrivateKey, JWKPublicKey } from '@map-colonies/auth-core'; +import type { JWKPrivateKey, JWKPublicKey } from '@map-colonies/auth-core'; const LENGTH_OF_STRING = 3; diff --git a/packages/auth-bundler/tsconfig.lint.json b/packages/auth-bundler/tsconfig.lint.json deleted file mode 100644 index c22e08fd..00000000 --- a/packages/auth-bundler/tsconfig.lint.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "../../tsconfig.lint.json" -} diff --git a/packages/auth-core/eslint.config.mjs b/packages/auth-core/eslint.config.mjs index b73c9aa8..5338ece2 100644 --- a/packages/auth-core/eslint.config.mjs +++ b/packages/auth-core/eslint.config.mjs @@ -1,4 +1,4 @@ -import { config } from '@map-colonies/eslint-config/helpers'; -import baseConfig from '../../eslint.config.mjs'; +import tsBaseConfig from '@map-colonies/eslint-config/ts-base'; +import { defineConfig, globalIgnores } from 'eslint/config'; -export default config(baseConfig, {}); +export default defineConfig(tsBaseConfig, globalIgnores(['drizzle.config.ts', 'vitest.config.mts', '**/migrations/**'])); diff --git a/packages/auth-core/package.json b/packages/auth-core/package.json index c432c8a6..052749db 100644 --- a/packages/auth-core/package.json +++ b/packages/auth-core/package.json @@ -11,8 +11,6 @@ "url": "git+https://github.com/MapColonies/opa-la.git" }, "scripts": { - "format": "prettier --check .", - "format:fix": "prettier --write .", "typeorm": "node ../../node_modules/typeorm/cli.js -d ./dataSource.mjs", "migration:create": "npm run typeorm migration:generate --", "migration:run": "npm run typeorm migration:run -- ", diff --git a/packages/auth-core/src/db/entities/asset.ts b/packages/auth-core/src/db/entities/asset.ts index 972956a8..43fb1da4 100644 --- a/packages/auth-core/src/db/entities/asset.ts +++ b/packages/auth-core/src/db/entities/asset.ts @@ -1,5 +1,6 @@ import { Column, CreateDateColumn, Entity, PrimaryColumn } from 'typeorm'; -import { AssetType, type AssetTypes, Environment, type Environments, IAsset } from '../../model'; +import type { AssetTypes, Environments, IAsset } from '../../model'; +import { Environment, AssetType } from '../../model'; /** * The typeorm implementation of the IAsset interface. diff --git a/packages/auth-core/src/db/entities/bundle.ts b/packages/auth-core/src/db/entities/bundle.ts index 67a14c30..1f31ac48 100644 --- a/packages/auth-core/src/db/entities/bundle.ts +++ b/packages/auth-core/src/db/entities/bundle.ts @@ -1,5 +1,5 @@ import { Column, CreateDateColumn, Entity, PrimaryColumn } from 'typeorm'; -import { Environment, type Environments, IBundle } from '../../model'; +import { Environment, type Environments, type IBundle } from '../../model'; /** * The typeorm implementation of the IBundle interface. diff --git a/packages/auth-core/src/db/entities/client.ts b/packages/auth-core/src/db/entities/client.ts index a8453781..5f80ea0b 100644 --- a/packages/auth-core/src/db/entities/client.ts +++ b/packages/auth-core/src/db/entities/client.ts @@ -1,5 +1,5 @@ import { Column, CreateDateColumn, Entity, PrimaryColumn, UpdateDateColumn } from 'typeorm'; -import { IClient, type PointOfContact } from '../../model'; +import type { IClient, PointOfContact } from '../../model'; /** * The typeorm implementation of the IClient interface. diff --git a/packages/auth-core/src/db/entities/connection.ts b/packages/auth-core/src/db/entities/connection.ts index 1899b429..3c186e92 100644 --- a/packages/auth-core/src/db/entities/connection.ts +++ b/packages/auth-core/src/db/entities/connection.ts @@ -1,5 +1,5 @@ import { Column, CreateDateColumn, Entity, PrimaryColumn } from 'typeorm'; -import { Environment, IConnection, type Environments } from '../../model'; +import { Environment, type IConnection, type Environments } from '../../model'; /** * The typeorm implementation of the IConnection interface. diff --git a/packages/auth-core/src/db/entities/domain.ts b/packages/auth-core/src/db/entities/domain.ts index ba036ebc..02e4c77d 100644 --- a/packages/auth-core/src/db/entities/domain.ts +++ b/packages/auth-core/src/db/entities/domain.ts @@ -1,5 +1,5 @@ import { Entity, PrimaryColumn } from 'typeorm'; -import { IDomain } from '../../model'; +import type { IDomain } from '../../model'; /** * The typeorm implementation of the IDomain interface. diff --git a/packages/auth-core/src/db/entities/key.ts b/packages/auth-core/src/db/entities/key.ts index cddb8a06..88f3a7cf 100644 --- a/packages/auth-core/src/db/entities/key.ts +++ b/packages/auth-core/src/db/entities/key.ts @@ -1,5 +1,5 @@ import { Column, Entity, PrimaryColumn } from 'typeorm'; -import { Environment, type Environments, IKey, type JWKPrivateKey, type JWKPublicKey } from '../../model'; +import { Environment, type Environments, type IKey, type JWKPrivateKey, type JWKPublicKey } from '../../model'; /** * The typeorm implementation of the IKey interface. diff --git a/packages/auth-core/src/db/types/interfaces.ts b/packages/auth-core/src/db/types/interfaces.ts index 0447f945..6c707815 100644 --- a/packages/auth-core/src/db/types/interfaces.ts +++ b/packages/auth-core/src/db/types/interfaces.ts @@ -1,5 +1,5 @@ -import { PostgresConnectionOptions } from 'typeorm/driver/postgres/PostgresConnectionOptions'; -import { commonDbFullV1Type } from '@map-colonies/schemas'; +import type { PostgresConnectionOptions } from 'typeorm/driver/postgres/PostgresConnectionOptions'; +import type { commonDbFullV1Type } from '@map-colonies/schemas'; /** * An object describing all the necessary configuration to authenticate to a postgresql database. * It is an extension of the {@link https://typeorm.io/data-source-options#postgres--cockroachdb-data-source-options | PostgresConnectionOptions} diff --git a/packages/auth-core/src/db/utils/createConnection.ts b/packages/auth-core/src/db/utils/createConnection.ts index 955c9a19..f8a68c6c 100644 --- a/packages/auth-core/src/db/utils/createConnection.ts +++ b/packages/auth-core/src/db/utils/createConnection.ts @@ -1,7 +1,7 @@ import { hostname } from 'node:os'; import { readFileSync } from 'node:fs'; -import { TlsOptions } from 'node:tls'; -import { DataSource, DataSourceOptions } from 'typeorm'; +import type { TlsOptions } from 'node:tls'; +import { DataSource, type DataSourceOptions } from 'typeorm'; import type { commonDbFullV1Type } from '@map-colonies/schemas'; import { migrations } from '../migrations'; import { Asset, Bundle, Client, Connection, Domain, Key } from '../entities'; diff --git a/packages/auth-core/src/model/asset.ts b/packages/auth-core/src/model/asset.ts index 6ee463dd..43f4c296 100644 --- a/packages/auth-core/src/model/asset.ts +++ b/packages/auth-core/src/model/asset.ts @@ -1,4 +1,4 @@ -import { Environments } from './common'; +import type { Environments } from './common'; /* eslint-disable @typescript-eslint/naming-convention */ export const AssetType = { diff --git a/packages/auth-core/src/model/bundle.ts b/packages/auth-core/src/model/bundle.ts index 0b0e7210..d6a1d38e 100644 --- a/packages/auth-core/src/model/bundle.ts +++ b/packages/auth-core/src/model/bundle.ts @@ -1,4 +1,4 @@ -import { Environments } from './common'; +import type { Environments } from './common'; /** * Describes the metadata of contents of bundles that were created. diff --git a/packages/auth-core/src/model/connection.ts b/packages/auth-core/src/model/connection.ts index e31a0bb8..5bc0ddab 100644 --- a/packages/auth-core/src/model/connection.ts +++ b/packages/auth-core/src/model/connection.ts @@ -1,4 +1,4 @@ -import { Environments } from './common'; +import type { Environments } from './common'; /** * A connection is the object describing the details of diff --git a/packages/auth-core/src/model/key.ts b/packages/auth-core/src/model/key.ts index 50e95dfd..61b77d27 100644 --- a/packages/auth-core/src/model/key.ts +++ b/packages/auth-core/src/model/key.ts @@ -1,4 +1,4 @@ -import { Environments } from './common'; +import type { Environments } from './common'; /** * JSON representation of a public key diff --git a/packages/auth-core/tsconfig.lint.json b/packages/auth-core/tsconfig.lint.json deleted file mode 100644 index c22e08fd..00000000 --- a/packages/auth-core/tsconfig.lint.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "../../tsconfig.lint.json" -} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7d268e49..b41194dd 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -6,6 +6,9 @@ settings: catalogs: default: + '@map-colonies/eslint-config': + specifier: ^8.0.0 + version: 8.0.0 '@map-colonies/js-logger': specifier: ^4.1.0 version: 4.1.0 @@ -27,6 +30,9 @@ catalogs: '@vitest/ui': specifier: 4.1.4 version: 4.1.4 + eslint: + specifier: ^9.39.2 + version: 9.39.4 jest-extended: specifier: ^7.0.0 version: 7.0.0 @@ -53,8 +59,8 @@ importers: specifier: ^1.1.1 version: 1.1.1 '@map-colonies/eslint-config': - specifier: ^6.0.0 - version: 6.0.0(@typescript-eslint/utils@8.57.2(eslint@9.39.4(jiti@2.6.1))(typescript@5.8.3))(eslint-plugin-jest@28.14.0(@typescript-eslint/eslint-plugin@8.57.2(@typescript-eslint/parser@8.57.2(eslint@9.39.4(jiti@2.6.1))(typescript@5.8.3))(eslint@9.39.4(jiti@2.6.1))(typescript@5.8.3))(eslint@9.39.4(jiti@2.6.1))(jest@29.7.0(@types/node@24.12.0)(ts-node@10.9.2(@swc/core@1.15.21)(@types/node@24.12.0)(typescript@5.8.3)))(typescript@5.8.3))(eslint-plugin-react-hooks@5.2.0(eslint@9.39.4(jiti@2.6.1)))(eslint@9.39.4(jiti@2.6.1))(globals@15.15.0)(typescript@5.8.3) + specifier: 'catalog:' + version: 8.0.0(@typescript-eslint/utils@8.58.1(eslint@9.39.4(jiti@2.6.1))(typescript@5.8.3))(@vitest/eslint-plugin@1.6.15(@typescript-eslint/eslint-plugin@8.57.2(@typescript-eslint/parser@8.57.2(eslint@9.39.4(jiti@2.6.1))(typescript@5.8.3))(eslint@9.39.4(jiti@2.6.1))(typescript@5.8.3))(eslint@9.39.4(jiti@2.6.1))(typescript@5.8.3)(vitest@4.1.4))(eslint-plugin-jest@28.14.0(@typescript-eslint/eslint-plugin@8.57.2(@typescript-eslint/parser@8.57.2(eslint@9.39.4(jiti@2.6.1))(typescript@5.8.3))(eslint@9.39.4(jiti@2.6.1))(typescript@5.8.3))(eslint@9.39.4(jiti@2.6.1))(jest@29.7.0(@types/node@24.12.0)(ts-node@10.9.2(@swc/core@1.15.21)(@types/node@24.12.0)(typescript@5.8.3)))(typescript@5.8.3))(eslint-plugin-react-hooks@5.2.0(eslint@9.39.4(jiti@2.6.1)))(eslint@9.39.4(jiti@2.6.1))(globals@15.15.0)(typescript@5.8.3) '@map-colonies/infra-copilot-instructions': specifier: ^1.1.0 version: 1.2.0 @@ -67,15 +73,15 @@ importers: '@redocly/cli': specifier: ^1.34.2 version: 1.34.11(ajv@8.18.0)(encoding@0.1.13) + '@vitest/eslint-plugin': + specifier: ^1.6.15 + version: 1.6.15(@typescript-eslint/eslint-plugin@8.57.2(@typescript-eslint/parser@8.57.2(eslint@9.39.4(jiti@2.6.1))(typescript@5.8.3))(eslint@9.39.4(jiti@2.6.1))(typescript@5.8.3))(eslint@9.39.4(jiti@2.6.1))(typescript@5.8.3)(vitest@4.1.4) cross-env: specifier: ^7.0.3 version: 7.0.3 eslint: - specifier: ^9.25.1 + specifier: 'catalog:' version: 9.39.4(jiti@2.6.1) - eslint-plugin-jest: - specifier: ^28.11.0 - version: 28.14.0(@typescript-eslint/eslint-plugin@8.57.2(@typescript-eslint/parser@8.57.2(eslint@9.39.4(jiti@2.6.1))(typescript@5.8.3))(eslint@9.39.4(jiti@2.6.1))(typescript@5.8.3))(eslint@9.39.4(jiti@2.6.1))(jest@29.7.0(@types/node@24.12.0)(ts-node@10.9.2(@swc/core@1.15.21)(@types/node@24.12.0)(typescript@5.8.3)))(typescript@5.8.3) husky: specifier: ^9.1.7 version: 9.1.7 @@ -750,15 +756,9 @@ importers: '@map-colonies/commitlint-config': specifier: ^1.1.1 version: 1.1.1 - '@map-colonies/eslint-config': - specifier: ^6.0.0 - version: 6.0.0(@typescript-eslint/utils@8.57.2(eslint@9.39.4(jiti@2.6.1))(typescript@5.9.3))(eslint-plugin-jest@28.14.0(@typescript-eslint/eslint-plugin@8.57.2(@typescript-eslint/parser@8.57.2(eslint@9.39.4(jiti@2.6.1))(typescript@5.9.3))(eslint@9.39.4(jiti@2.6.1))(typescript@5.9.3))(eslint@9.39.4(jiti@2.6.1))(jest@29.7.0(@types/node@24.12.0)(ts-node@10.9.2(@swc/core@1.15.21)(@types/node@24.12.0)(typescript@5.9.3)))(typescript@5.9.3))(eslint-plugin-react-hooks@5.2.0(eslint@9.39.4(jiti@2.6.1)))(eslint@9.39.4(jiti@2.6.1))(globals@15.15.0)(typescript@5.9.3) '@map-colonies/openapi-helpers': specifier: 'catalog:' version: 5.1.0(@types/express@4.17.25)(@types/json-schema@7.0.15)(encoding@0.1.13)(openapi-typescript@7.13.0(typescript@5.9.3))(prettier@3.8.1)(supertest@7.2.2)(typescript@5.9.3) - '@map-colonies/prettier-config': - specifier: 0.0.1 - version: 0.0.1 '@map-colonies/tsconfig': specifier: ^1.0.1 version: 1.0.1(typescript@5.9.3) @@ -777,6 +777,9 @@ importers: '@types/express-session': specifier: ^1.18.2 version: 1.18.2 + '@types/lodash': + specifier: ^4.17.24 + version: 4.17.24 '@types/multer': specifier: ^1.4.12 version: 1.4.13 @@ -810,27 +813,12 @@ importers: drizzle-kit: specifier: ^0.31.4 version: 0.31.10 - eslint: - specifier: ^9.23.0 - version: 9.39.4(jiti@2.6.1) - eslint-plugin-jest: - specifier: ^28.11.0 - version: 28.14.0(@typescript-eslint/eslint-plugin@8.57.2(@typescript-eslint/parser@8.57.2(eslint@9.39.4(jiti@2.6.1))(typescript@5.9.3))(eslint@9.39.4(jiti@2.6.1))(typescript@5.9.3))(eslint@9.39.4(jiti@2.6.1))(jest@29.7.0(@types/node@24.12.0)(ts-node@10.9.2(@swc/core@1.15.21)(@types/node@24.12.0)(typescript@5.9.3)))(typescript@5.9.3) - husky: - specifier: ^9.1.7 - version: 9.1.7 jest-openapi: specifier: ^0.14.2 version: 0.14.2 nock: specifier: ^14.0.5 version: 14.0.11 - prettier: - specifier: ^3.5.3 - version: 3.8.1 - pretty-quick: - specifier: ^4.1.1 - version: 4.2.2(prettier@3.8.1) rimraf: specifier: ^6.0.1 version: 6.1.3 @@ -2393,16 +2381,19 @@ packages: resolution: { integrity: sha512-8E2tNLGtmJcG/wpS0rkBbGpDyHJVbU50/pCXNf65u6hSCDTJYTSHcINfl3snMyLmgrug1oTSX8A9qZLHjb82mg== } engines: { node: '>=20' } - '@map-colonies/eslint-config@6.0.0': - resolution: { integrity: sha512-yXh/bMsDnDa1pbMBpBqIe+iySAygiXdSgFMvCDZwr/+y7JUgODikDCMD2LfdP7n+2DDNTNmCc+qu70361wVzfg== } - engines: { node: '>=20' } + '@map-colonies/eslint-config@8.0.0': + resolution: { integrity: sha512-680PEx+d6dQCGRF0oSJz7miAsp8JqDndxe7MNpXGHJbyVqQg2CEFjxD18fF0K9w58trZkWFfELgOcy0pUfBPrg== } + engines: { node: '>=24' } peerDependencies: + '@vitest/eslint-plugin': ^1.6.7 eslint: ^9.19.0 - eslint-plugin-jest: ^28.11.0 + eslint-plugin-jest: ^28.11.0 || ^29.0.0 eslint-plugin-react: ^7.37.4 - eslint-plugin-react-hooks: ^5.1.0 - globals: ^15.14.0 + eslint-plugin-react-hooks: ^5.1.0 || ^7.0.0 + globals: ^15.14.0 || ^17.0.0 peerDependenciesMeta: + '@vitest/eslint-plugin': + optional: true eslint-plugin-jest: optional: true eslint-plugin-react: @@ -2412,6 +2403,12 @@ packages: globals: optional: true + '@map-colonies/eslint-plugin@0.1.0': + resolution: { integrity: sha512-huiwOJS8YbgCfORIzzXdQjtoC8VdsPhYx0/pu+uPqfML2RfO8wjzkWfIrVo6vyFS2YnnaSUR6tkTy0YwEr620g== } + engines: { node: '>=24' } + peerDependencies: + eslint: ^9.39.0 + '@map-colonies/express-access-log-middleware@4.1.0': resolution: { integrity: sha512-qtuKfNOE9WmEkLD175SI26xO+X8mloxlTE8JrR/gypaqIa8+XdGYNynDKrQK+83t5vMfToMLXhTzmGtT8HgXAg== } engines: { node: '>=24' } @@ -2535,10 +2532,6 @@ packages: resolution: { integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg== } engines: { node: '>= 8' } - '@nolyfill/is-core-module@1.0.39': - resolution: { integrity: sha512-nn5ozdjYQpUCZlWGuxcJY/KpxkWQs4DcbMCmKojjyrYDEAGy4Ce19NN4v5MduafTwJlbKc99UA8YhSVqq9yPZA== } - engines: { node: '>=12.4.0' } - '@npmcli/agent@2.2.2': resolution: { integrity: sha512-OrcNPXdpSl9UX7qPVRWbmWMCSXrcDa2M9DvrbOTj7ao1S4PlqVFYv9/yLKMkrJKZ/V5A/kDBC690or307i26Og== } engines: { node: ^16.14.0 || >=18.0.0 } @@ -4637,16 +4630,32 @@ packages: peerDependencies: typescript: '>=4.8.4 <6.0.0' + '@typescript-eslint/project-service@8.58.1': + resolution: { integrity: sha512-gfQ8fk6cxhtptek+/8ZIqw8YrRW5048Gug8Ts5IYcMLCw18iUgrZAEY/D7s4hkI0FxEfGakKuPK/XUMPzPxi5g== } + engines: { node: ^18.18.0 || ^20.9.0 || >=21.1.0 } + peerDependencies: + typescript: '>=4.8.4 <6.1.0' + '@typescript-eslint/scope-manager@8.57.2': resolution: { integrity: sha512-snZKH+W4WbWkrBqj4gUNRIGb/jipDW3qMqVJ4C9rzdFc+wLwruxk+2a5D+uoFcKPAqyqEnSb4l2ULuZf95eSkw== } engines: { node: ^18.18.0 || ^20.9.0 || >=21.1.0 } + '@typescript-eslint/scope-manager@8.58.1': + resolution: { integrity: sha512-TPYUEqJK6avLcEjumWsIuTpuYODTTDAtoMdt8ZZa93uWMTX13Nb8L5leSje1NluammvU+oI3QRr5lLXPgihX3w== } + engines: { node: ^18.18.0 || ^20.9.0 || >=21.1.0 } + '@typescript-eslint/tsconfig-utils@8.57.2': resolution: { integrity: sha512-3Lm5DSM+DCowsUOJC+YqHHnKEfFh5CoGkj5Z31NQSNF4l5wdOwqGn99wmwN/LImhfY3KJnmordBq/4+VDe2eKw== } engines: { node: ^18.18.0 || ^20.9.0 || >=21.1.0 } peerDependencies: typescript: '>=4.8.4 <6.0.0' + '@typescript-eslint/tsconfig-utils@8.58.1': + resolution: { integrity: sha512-JAr2hOIct2Q+qk3G+8YFfqkqi7sC86uNryT+2i5HzMa2MPjw4qNFvtjnw1IiA1rP7QhNKVe21mSSLaSjwA1Olw== } + engines: { node: ^18.18.0 || ^20.9.0 || >=21.1.0 } + peerDependencies: + typescript: '>=4.8.4 <6.1.0' + '@typescript-eslint/type-utils@8.57.2': resolution: { integrity: sha512-Co6ZCShm6kIbAM/s+oYVpKFfW7LBc6FXoPXjTRQ449PPNBY8U0KZXuevz5IFuuUj2H9ss40atTaf9dlGLzbWZg== } engines: { node: ^18.18.0 || ^20.9.0 || >=21.1.0 } @@ -4658,12 +4667,22 @@ packages: resolution: { integrity: sha512-/iZM6FnM4tnx9csuTxspMW4BOSegshwX5oBDznJ7S4WggL7Vczz5d2W11ecc4vRrQMQHXRSxzrCsyG5EsPPTbA== } engines: { node: ^18.18.0 || ^20.9.0 || >=21.1.0 } + '@typescript-eslint/types@8.58.1': + resolution: { integrity: sha512-io/dV5Aw5ezwzfPBBWLoT+5QfVtP8O7q4Kftjn5azJ88bYyp/ZMCsyW1lpKK46EXJcaYMZ1JtYj+s/7TdzmQMw== } + engines: { node: ^18.18.0 || ^20.9.0 || >=21.1.0 } + '@typescript-eslint/typescript-estree@8.57.2': resolution: { integrity: sha512-2MKM+I6g8tJxfSmFKOnHv2t8Sk3T6rF20A1Puk0svLK+uVapDZB/4pfAeB7nE83uAZrU6OxW+HmOd5wHVdXwXA== } engines: { node: ^18.18.0 || ^20.9.0 || >=21.1.0 } peerDependencies: typescript: '>=4.8.4 <6.0.0' + '@typescript-eslint/typescript-estree@8.58.1': + resolution: { integrity: sha512-w4w7WR7GHOjqqPnvAYbazq+Y5oS68b9CzasGtnd6jIeOIeKUzYzupGTB2T4LTPSv4d+WPeccbxuneTFHYgAAWg== } + engines: { node: ^18.18.0 || ^20.9.0 || >=21.1.0 } + peerDependencies: + typescript: '>=4.8.4 <6.1.0' + '@typescript-eslint/utils@8.57.2': resolution: { integrity: sha512-krRIbvPK1ju1WBKIefiX+bngPs+odIQUtR7kymzPfo1POVw3jlF+nLkmexdSSd4UCbDcQn+wMBATOOmpBbqgKg== } engines: { node: ^18.18.0 || ^20.9.0 || >=21.1.0 } @@ -4671,10 +4690,21 @@ packages: eslint: ^8.57.0 || ^9.0.0 || ^10.0.0 typescript: '>=4.8.4 <6.0.0' + '@typescript-eslint/utils@8.58.1': + resolution: { integrity: sha512-Ln8R0tmWC7pTtLOzgJzYTXSCjJ9rDNHAqTaVONF4FEi2qwce8mD9iSOxOpLFFvWp/wBFlew0mjM1L1ihYWfBdQ== } + engines: { node: ^18.18.0 || ^20.9.0 || >=21.1.0 } + peerDependencies: + eslint: ^8.57.0 || ^9.0.0 || ^10.0.0 + typescript: '>=4.8.4 <6.1.0' + '@typescript-eslint/visitor-keys@8.57.2': resolution: { integrity: sha512-zhahknjobV2FiD6Ee9iLbS7OV9zi10rG26odsQdfBO/hjSzUQbkIYgda+iNKK1zNiW2ey+Lf8MU5btN17V3dUw== } engines: { node: ^18.18.0 || ^20.9.0 || >=21.1.0 } + '@typescript-eslint/visitor-keys@8.58.1': + resolution: { integrity: sha512-y+vH7QE8ycjoa0bWciFg7OpFcipUuem1ujhrdLtq1gByKwfbC7bPeKsiny9e0urg93DqwGcHey+bGRKCnF1nZQ== } + engines: { node: ^18.18.0 || ^20.9.0 || >=21.1.0 } + '@unrs/resolver-binding-android-arm-eabi@1.11.1': resolution: { integrity: sha512-ppLRUgHVaGRWUx0R0Ut06Mjo9gBaBkg3v/8AxusGLhsIotbBLuRk51rAzqLC8gq6NyyAojEXglNjzf6R948DNw== } cpu: [arm] @@ -4790,6 +4820,22 @@ packages: '@vitest/browser': optional: true + '@vitest/eslint-plugin@1.6.15': + resolution: { integrity: sha512-dTMjrdngmcB+DxomlKQ+SUubCTvd0m2hQQFpv5sx+GRodmeoxr2PVbphk57SVp250vpxphk9Ccwyv6fQ6+2gkA== } + engines: { node: '>=18' } + peerDependencies: + '@typescript-eslint/eslint-plugin': '*' + eslint: '>=8.57.0' + typescript: '>=5.0.0' + vitest: '*' + peerDependenciesMeta: + '@typescript-eslint/eslint-plugin': + optional: true + typescript: + optional: true + vitest: + optional: true + '@vitest/expect@4.1.4': resolution: { integrity: sha512-iPBpra+VDuXmBFI3FMKHSFXp3Gx5HfmSCE8X67Dn+bwephCnQCaB7qWK2ldHa+8ncN8hJU8VTMcxjPpyMkUjww== } @@ -5174,6 +5220,10 @@ packages: buffer@6.0.3: resolution: { integrity: sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA== } + builtin-modules@5.1.0: + resolution: { integrity: sha512-c5JxaDrzwRjq3WyJkI1AGR5xy6Gr6udlt7sQPbl09+3ckB+Zo2qqQ2KhCTBr7Q8dHB43bENGYEk4xddrFH/b7A== } + engines: { node: '>=18.20' } + bundle-name@4.1.0: resolution: { integrity: sha512-tjwM5exMg6BGRI+kNmTntNsvdZS1X8BFYS6tnJ2hdH0kVxM6/eVZ2xy+FqStSWvYmtfFMDLIxurorHwDKfDz5Q== } engines: { node: '>=18' } @@ -5303,6 +5353,10 @@ packages: classnames@2.5.1: resolution: { integrity: sha512-saHYOzhIQs6wy2sVxTM6bUDsQO4F50V9RQ22qBpEdCW+I+/Wmke2HOl6lS6dTpdxVhb88/I6+Hs+438c3lfUow== } + clean-regexp@1.0.0: + resolution: { integrity: sha512-GfisEZEJvzKrmGWkvfhgzcz/BllN1USeqD2V6tg14OAOgaCD2Z/PUEuxnAZ/nPvmaHRG7a8y77p1T/IRQ4D1Hw== } + engines: { node: '>=4' } + clean-stack@2.2.0: resolution: { integrity: sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A== } engines: { node: '>=6' } @@ -5537,6 +5591,9 @@ packages: resolution: { integrity: sha512-fereAvAvxDrQDOXybk3Qu3dPbOoKoysFMWtkY3mv5BsL8//OSZVL5DCLYqgRfY5cWirgRzlC+WSrxp6Bo3eNZg== } hasBin: true + core-js-compat@3.49.0: + resolution: { integrity: sha512-VQXt1jr9cBz03b331DFDCCP90b3fanciLkgiOoy8SBHy06gNf+vQ1A3WFLqG7I8TipYIKeYK9wxd0tUrvHcOZA== } + core-js@3.32.1: resolution: { integrity: sha512-lqufgNn9NLnESg5mQeYsxQP5w7wrViSj0jr/kv6ECQiByzQkrn1MKvV0L3acttpDqfQrHLwr2KCMgX5b8X+lyQ== } @@ -6080,9 +6137,9 @@ packages: unrs-resolver: optional: true - eslint-import-resolver-typescript@3.10.1: - resolution: { integrity: sha512-A1rHYb06zjMGAxdLSkN2fXPBwuSaQ0iO5M/hdyS0Ajj1VBaRp0sPD3dn1FhME3c/JluGFbwSxyCfqdSbtQLAHQ== } - engines: { node: ^14.18.0 || >=16.0.0 } + eslint-import-resolver-typescript@4.4.4: + resolution: { integrity: sha512-1iM2zeBvrYmUNTj2vSC/90JTHDth+dfOfiNKkxApWRsTJYNrc8rOdxxIf5vazX+BiAXTeOT0UvWpGI/7qIWQOw== } + engines: { node: ^16.17.0 || >=18.6.0 } peerDependencies: eslint: '*' eslint-plugin-import: '*' @@ -6130,6 +6187,12 @@ packages: peerDependencies: eslint: '>=8.40' + eslint-plugin-unicorn@63.0.0: + resolution: { integrity: sha512-Iqecl9118uQEXYh7adylgEmGfkn5es3/mlQTLLkd4pXkIk9CTGrAbeUux+YljSa2ohXCBmQQ0+Ej1kZaFgcfkA== } + engines: { node: ^20.10.0 || >=21.0.0 } + peerDependencies: + eslint: '>=9.38.0' + eslint-scope@8.4.0: resolution: { integrity: sha512-sNXOfKCn74rt8RICKMvJS7XKV/Xk9kA7DyJr8mJik3S7Cwgy3qlkkmyS2uQB3jiJg6VNdZd/pDBJu0nvG2NlTg== } engines: { node: ^18.18.0 || ^20.9.0 || >=21.1.0 } @@ -6344,6 +6407,10 @@ packages: resolution: { integrity: sha512-S8KoZgRZN+a5rNwqTxlZZePjT/4cnm0ROV70LedRHZ0p8u9fRID0hJUZQpkKLzro8LfmC8sx23bY6tVNxv8pQA== } engines: { node: '>= 18.0.0' } + find-up-simple@1.0.1: + resolution: { integrity: sha512-afd4O7zpqHeRyg4PfDQsXmlDe2PfdHtJt6Akt8jOWaApLOZk5JXs6VMR29lz03pRe9mpykrRCYIYxaJYcfpncQ== } + engines: { node: '>=18' } + find-up@2.1.0: resolution: { integrity: sha512-NWzkk0jSJtTt08+FBFMvXoeZnOJD+jTtsRmBYbAIzJdX6l7dLgR7CTubCM5/eDdPUBvLCeVasP1brfVR/9/EZQ== } engines: { node: '>=4' } @@ -6824,6 +6891,10 @@ packages: resolution: { integrity: sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg== } engines: { node: '>=8' } + indent-string@5.0.0: + resolution: { integrity: sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg== } + engines: { node: '>=12' } + index-to-position@1.2.0: resolution: { integrity: sha512-Yg7+ztRkqslMAS2iFaU+Oa4KTSidr63OsFGlOrJoW981kIYO3CGCS3wA95P1mUi/IVSJkn0D479KTJpVpvFNuw== } engines: { node: '>=18' } @@ -6896,6 +6967,10 @@ packages: resolution: { integrity: sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ== } engines: { node: '>=4' } + is-builtin-module@5.0.0: + resolution: { integrity: sha512-f4RqJKBUe5rQkJ2eJEJBXSticB3hGbN9j0yxxMQFqIW89Jp9WYFtzfTcRlstDKVUTRzSOTLKRfO9vIztenwtxA== } + engines: { node: '>=18.20' } + is-bun-module@2.0.0: resolution: { integrity: sha512-gNCGbnnnnFAUGKeZ9PdbyeGYJqewpmc2aKHUEMO5nQPWU9lOmv7jcmQIv+qHD8fXW6W7qfuCwX4rY9LNRjXrkQ== } @@ -9131,10 +9206,18 @@ packages: reftools@1.1.9: resolution: { integrity: sha512-OVede/NQE13xBQ+ob5CKd5KyeJYU2YInb1bmV4nRoOfquZPkAkxuOXicSe1PvqIuZZ4kD13sPKBbR7UFDmli6w== } + regexp-tree@0.1.27: + resolution: { integrity: sha512-iETxpjK6YoRWJG5o6hXLwvjYAoW+FEZn9os0PD/b6AP6xQwsa/Y7lCVgIixBbUPMfhu+i2LtdeAqVTgGlQarfA== } + hasBin: true + regexp.prototype.flags@1.5.4: resolution: { integrity: sha512-dYqgNSZbDwkaJ2ceRd9ojCGjBq+mOm9LmtXnAnEGyHhN/5R7iDW2TRw3h+o/jCFxus3P2LfWIIiwowAjANm7IA== } engines: { node: '>= 0.4' } + regjsparser@0.13.1: + resolution: { integrity: sha512-dLsljMd9sqwRkby8zhO1gSg3PnJIBFid8f4CQj/sXx+7cKx+E7u0PKhZ+U4wmhx7EfmtvnA318oVaIkAB1lRJw== } + hasBin: true + remark-gfm@3.0.1: resolution: { integrity: sha512-lEFDoi2PICJyNrACFOfDD3JlLkuSbOa5Wd8EPt06HUdptv8Gn0bxYTdbU/XXQ3swAPkEaGxxPN9cbnMHvVu1Ig== } @@ -9501,9 +9584,6 @@ packages: resolution: { integrity: sha512-o3yWv49B/o4QZk5ZcsALc6t0+eCelPc44zZsLtCQnZPDwFpDYSWcDnrv2TtMmMbQ7uKo3J0HTURCqckw23czNQ== } engines: { node: '>=12.0.0' } - stable-hash@0.0.5: - resolution: { integrity: sha512-+L3ccpzibovGXFK+Ap/f8LOS0ahMrHTf3xu7mMLSpEGU0EO9ucaysSylKo9eRDFNhWve/y275iPmIZ4z39a9iA== } - stack-utils@2.0.6: resolution: { integrity: sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ== } engines: { node: '>=10' } @@ -9615,6 +9695,10 @@ packages: resolution: { integrity: sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ== } engines: { node: '>=8' } + strip-indent@4.1.1: + resolution: { integrity: sha512-SlyRoSkdh1dYP0PzclLE7r0M9sgbFKKMFXpFRUMNuKhQSbC6VQIGzq3E0qsfvGJaUFJPGv6Ws1NZ/haTAjfbMA== } + engines: { node: '>=12' } + strip-json-comments@3.1.1: resolution: { integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== } engines: { node: '>=8' } @@ -12486,15 +12570,19 @@ snapshots: dependencies: http-status-codes: 2.3.0 - '@map-colonies/eslint-config@6.0.0(@typescript-eslint/utils@8.57.2(eslint@9.39.4(jiti@2.6.1))(typescript@5.8.3))(eslint-plugin-jest@28.14.0(@typescript-eslint/eslint-plugin@8.57.2(@typescript-eslint/parser@8.57.2(eslint@9.39.4(jiti@2.6.1))(typescript@5.8.3))(eslint@9.39.4(jiti@2.6.1))(typescript@5.8.3))(eslint@9.39.4(jiti@2.6.1))(jest@29.7.0(@types/node@24.12.0)(ts-node@10.9.2(@swc/core@1.15.21)(@types/node@24.12.0)(typescript@5.8.3)))(typescript@5.8.3))(eslint-plugin-react-hooks@5.2.0(eslint@9.39.4(jiti@2.6.1)))(eslint@9.39.4(jiti@2.6.1))(globals@15.15.0)(typescript@5.8.3)': + '@map-colonies/eslint-config@8.0.0(@typescript-eslint/utils@8.58.1(eslint@9.39.4(jiti@2.6.1))(typescript@5.8.3))(@vitest/eslint-plugin@1.6.15(@typescript-eslint/eslint-plugin@8.57.2(@typescript-eslint/parser@8.57.2(eslint@9.39.4(jiti@2.6.1))(typescript@5.8.3))(eslint@9.39.4(jiti@2.6.1))(typescript@5.8.3))(eslint@9.39.4(jiti@2.6.1))(typescript@5.8.3)(vitest@4.1.4))(eslint-plugin-jest@28.14.0(@typescript-eslint/eslint-plugin@8.57.2(@typescript-eslint/parser@8.57.2(eslint@9.39.4(jiti@2.6.1))(typescript@5.8.3))(eslint@9.39.4(jiti@2.6.1))(typescript@5.8.3))(eslint@9.39.4(jiti@2.6.1))(jest@29.7.0(@types/node@24.12.0)(ts-node@10.9.2(@swc/core@1.15.21)(@types/node@24.12.0)(typescript@5.8.3)))(typescript@5.8.3))(eslint-plugin-react-hooks@5.2.0(eslint@9.39.4(jiti@2.6.1)))(eslint@9.39.4(jiti@2.6.1))(globals@15.15.0)(typescript@5.8.3)': dependencies: '@eslint/js': 9.39.4 + '@map-colonies/eslint-plugin': 0.1.0(eslint@9.39.4(jiti@2.6.1))(typescript@5.8.3) + '@typescript-eslint/parser': 8.57.2(eslint@9.39.4(jiti@2.6.1))(typescript@5.8.3) eslint: 9.39.4(jiti@2.6.1) eslint-config-prettier: 10.1.8(eslint@9.39.4(jiti@2.6.1)) - eslint-import-resolver-typescript: 3.10.1(eslint-plugin-import-x@4.16.2(@typescript-eslint/utils@8.57.2(eslint@9.39.4(jiti@2.6.1))(typescript@5.8.3))(eslint@9.39.4(jiti@2.6.1)))(eslint@9.39.4(jiti@2.6.1)) - eslint-plugin-import-x: 4.16.2(@typescript-eslint/utils@8.57.2(eslint@9.39.4(jiti@2.6.1))(typescript@5.8.3))(eslint@9.39.4(jiti@2.6.1)) + eslint-import-resolver-typescript: 4.4.4(eslint-plugin-import-x@4.16.2(@typescript-eslint/utils@8.58.1(eslint@9.39.4(jiti@2.6.1))(typescript@5.8.3))(eslint@9.39.4(jiti@2.6.1)))(eslint@9.39.4(jiti@2.6.1)) + eslint-plugin-import-x: 4.16.2(@typescript-eslint/utils@8.58.1(eslint@9.39.4(jiti@2.6.1))(typescript@5.8.3))(eslint@9.39.4(jiti@2.6.1)) + eslint-plugin-unicorn: 63.0.0(eslint@9.39.4(jiti@2.6.1)) typescript-eslint: 8.57.2(eslint@9.39.4(jiti@2.6.1))(typescript@5.8.3) optionalDependencies: + '@vitest/eslint-plugin': 1.6.15(@typescript-eslint/eslint-plugin@8.57.2(@typescript-eslint/parser@8.57.2(eslint@9.39.4(jiti@2.6.1))(typescript@5.8.3))(eslint@9.39.4(jiti@2.6.1))(typescript@5.8.3))(eslint@9.39.4(jiti@2.6.1))(typescript@5.8.3)(vitest@4.1.4) eslint-plugin-jest: 28.14.0(@typescript-eslint/eslint-plugin@8.57.2(@typescript-eslint/parser@8.57.2(eslint@9.39.4(jiti@2.6.1))(typescript@5.8.3))(eslint@9.39.4(jiti@2.6.1))(typescript@5.8.3))(eslint@9.39.4(jiti@2.6.1))(jest@29.7.0(@types/node@24.12.0)(ts-node@10.9.2(@swc/core@1.15.21)(@types/node@24.12.0)(typescript@5.8.3)))(typescript@5.8.3) eslint-plugin-react-hooks: 5.2.0(eslint@9.39.4(jiti@2.6.1)) globals: 15.15.0 @@ -12505,22 +12593,11 @@ snapshots: - supports-color - typescript - '@map-colonies/eslint-config@6.0.0(@typescript-eslint/utils@8.57.2(eslint@9.39.4(jiti@2.6.1))(typescript@5.9.3))(eslint-plugin-jest@28.14.0(@typescript-eslint/eslint-plugin@8.57.2(@typescript-eslint/parser@8.57.2(eslint@9.39.4(jiti@2.6.1))(typescript@5.9.3))(eslint@9.39.4(jiti@2.6.1))(typescript@5.9.3))(eslint@9.39.4(jiti@2.6.1))(jest@29.7.0(@types/node@24.12.0)(ts-node@10.9.2(@swc/core@1.15.21)(@types/node@24.12.0)(typescript@5.9.3)))(typescript@5.9.3))(eslint-plugin-react-hooks@5.2.0(eslint@9.39.4(jiti@2.6.1)))(eslint@9.39.4(jiti@2.6.1))(globals@15.15.0)(typescript@5.9.3)': + '@map-colonies/eslint-plugin@0.1.0(eslint@9.39.4(jiti@2.6.1))(typescript@5.8.3)': dependencies: - '@eslint/js': 9.39.4 + '@typescript-eslint/utils': 8.58.1(eslint@9.39.4(jiti@2.6.1))(typescript@5.8.3) eslint: 9.39.4(jiti@2.6.1) - eslint-config-prettier: 10.1.8(eslint@9.39.4(jiti@2.6.1)) - eslint-import-resolver-typescript: 3.10.1(eslint-plugin-import-x@4.16.2(@typescript-eslint/utils@8.57.2(eslint@9.39.4(jiti@2.6.1))(typescript@5.9.3))(eslint@9.39.4(jiti@2.6.1)))(eslint@9.39.4(jiti@2.6.1)) - eslint-plugin-import-x: 4.16.2(@typescript-eslint/utils@8.57.2(eslint@9.39.4(jiti@2.6.1))(typescript@5.9.3))(eslint@9.39.4(jiti@2.6.1)) - typescript-eslint: 8.57.2(eslint@9.39.4(jiti@2.6.1))(typescript@5.9.3) - optionalDependencies: - eslint-plugin-jest: 28.14.0(@typescript-eslint/eslint-plugin@8.57.2(@typescript-eslint/parser@8.57.2(eslint@9.39.4(jiti@2.6.1))(typescript@5.9.3))(eslint@9.39.4(jiti@2.6.1))(typescript@5.9.3))(eslint@9.39.4(jiti@2.6.1))(jest@29.7.0(@types/node@24.12.0)(ts-node@10.9.2(@swc/core@1.15.21)(@types/node@24.12.0)(typescript@5.9.3)))(typescript@5.9.3) - eslint-plugin-react-hooks: 5.2.0(eslint@9.39.4(jiti@2.6.1)) - globals: 15.15.0 transitivePeerDependencies: - - '@typescript-eslint/utils' - - eslint-import-resolver-node - - eslint-plugin-import - supports-color - typescript @@ -12691,8 +12768,6 @@ snapshots: '@nodelib/fs.scandir': 2.1.5 fastq: 1.20.1 - '@nolyfill/is-core-module@1.0.39': {} - '@npmcli/agent@2.2.2': dependencies: agent-base: 7.1.4 @@ -15137,22 +15212,6 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/eslint-plugin@8.57.2(@typescript-eslint/parser@8.57.2(eslint@9.39.4(jiti@2.6.1))(typescript@5.9.3))(eslint@9.39.4(jiti@2.6.1))(typescript@5.9.3)': - dependencies: - '@eslint-community/regexpp': 4.12.2 - '@typescript-eslint/parser': 8.57.2(eslint@9.39.4(jiti@2.6.1))(typescript@5.9.3) - '@typescript-eslint/scope-manager': 8.57.2 - '@typescript-eslint/type-utils': 8.57.2(eslint@9.39.4(jiti@2.6.1))(typescript@5.9.3) - '@typescript-eslint/utils': 8.57.2(eslint@9.39.4(jiti@2.6.1))(typescript@5.9.3) - '@typescript-eslint/visitor-keys': 8.57.2 - eslint: 9.39.4(jiti@2.6.1) - ignore: 7.0.5 - natural-compare: 1.4.0 - ts-api-utils: 2.5.0(typescript@5.9.3) - typescript: 5.9.3 - transitivePeerDependencies: - - supports-color - '@typescript-eslint/parser@8.57.2(eslint@9.39.4(jiti@2.6.1))(typescript@5.8.3)': dependencies: '@typescript-eslint/scope-manager': 8.57.2 @@ -15165,18 +15224,6 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/parser@8.57.2(eslint@9.39.4(jiti@2.6.1))(typescript@5.9.3)': - dependencies: - '@typescript-eslint/scope-manager': 8.57.2 - '@typescript-eslint/types': 8.57.2 - '@typescript-eslint/typescript-estree': 8.57.2(typescript@5.9.3) - '@typescript-eslint/visitor-keys': 8.57.2 - debug: 4.4.3(supports-color@10.2.2) - eslint: 9.39.4(jiti@2.6.1) - typescript: 5.9.3 - transitivePeerDependencies: - - supports-color - '@typescript-eslint/project-service@8.57.2(typescript@5.8.3)': dependencies: '@typescript-eslint/tsconfig-utils': 8.57.2(typescript@5.8.3) @@ -15186,12 +15233,12 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/project-service@8.57.2(typescript@5.9.3)': + '@typescript-eslint/project-service@8.58.1(typescript@5.8.3)': dependencies: - '@typescript-eslint/tsconfig-utils': 8.57.2(typescript@5.9.3) - '@typescript-eslint/types': 8.57.2 + '@typescript-eslint/tsconfig-utils': 8.58.1(typescript@5.8.3) + '@typescript-eslint/types': 8.58.1 debug: 4.4.3(supports-color@10.2.2) - typescript: 5.9.3 + typescript: 5.8.3 transitivePeerDependencies: - supports-color @@ -15200,13 +15247,18 @@ snapshots: '@typescript-eslint/types': 8.57.2 '@typescript-eslint/visitor-keys': 8.57.2 + '@typescript-eslint/scope-manager@8.58.1': + dependencies: + '@typescript-eslint/types': 8.58.1 + '@typescript-eslint/visitor-keys': 8.58.1 + '@typescript-eslint/tsconfig-utils@8.57.2(typescript@5.8.3)': dependencies: typescript: 5.8.3 - '@typescript-eslint/tsconfig-utils@8.57.2(typescript@5.9.3)': + '@typescript-eslint/tsconfig-utils@8.58.1(typescript@5.8.3)': dependencies: - typescript: 5.9.3 + typescript: 5.8.3 '@typescript-eslint/type-utils@8.57.2(eslint@9.39.4(jiti@2.6.1))(typescript@5.8.3)': dependencies: @@ -15220,20 +15272,10 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/type-utils@8.57.2(eslint@9.39.4(jiti@2.6.1))(typescript@5.9.3)': - dependencies: - '@typescript-eslint/types': 8.57.2 - '@typescript-eslint/typescript-estree': 8.57.2(typescript@5.9.3) - '@typescript-eslint/utils': 8.57.2(eslint@9.39.4(jiti@2.6.1))(typescript@5.9.3) - debug: 4.4.3(supports-color@10.2.2) - eslint: 9.39.4(jiti@2.6.1) - ts-api-utils: 2.5.0(typescript@5.9.3) - typescript: 5.9.3 - transitivePeerDependencies: - - supports-color - '@typescript-eslint/types@8.57.2': {} + '@typescript-eslint/types@8.58.1': {} + '@typescript-eslint/typescript-estree@8.57.2(typescript@5.8.3)': dependencies: '@typescript-eslint/project-service': 8.57.2(typescript@5.8.3) @@ -15249,18 +15291,18 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/typescript-estree@8.57.2(typescript@5.9.3)': + '@typescript-eslint/typescript-estree@8.58.1(typescript@5.8.3)': dependencies: - '@typescript-eslint/project-service': 8.57.2(typescript@5.9.3) - '@typescript-eslint/tsconfig-utils': 8.57.2(typescript@5.9.3) - '@typescript-eslint/types': 8.57.2 - '@typescript-eslint/visitor-keys': 8.57.2 + '@typescript-eslint/project-service': 8.58.1(typescript@5.8.3) + '@typescript-eslint/tsconfig-utils': 8.58.1(typescript@5.8.3) + '@typescript-eslint/types': 8.58.1 + '@typescript-eslint/visitor-keys': 8.58.1 debug: 4.4.3(supports-color@10.2.2) minimatch: 10.2.4 semver: 7.7.4 tinyglobby: 0.2.15 - ts-api-utils: 2.5.0(typescript@5.9.3) - typescript: 5.9.3 + ts-api-utils: 2.5.0(typescript@5.8.3) + typescript: 5.8.3 transitivePeerDependencies: - supports-color @@ -15275,14 +15317,14 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/utils@8.57.2(eslint@9.39.4(jiti@2.6.1))(typescript@5.9.3)': + '@typescript-eslint/utils@8.58.1(eslint@9.39.4(jiti@2.6.1))(typescript@5.8.3)': dependencies: '@eslint-community/eslint-utils': 4.9.1(eslint@9.39.4(jiti@2.6.1)) - '@typescript-eslint/scope-manager': 8.57.2 - '@typescript-eslint/types': 8.57.2 - '@typescript-eslint/typescript-estree': 8.57.2(typescript@5.9.3) + '@typescript-eslint/scope-manager': 8.58.1 + '@typescript-eslint/types': 8.58.1 + '@typescript-eslint/typescript-estree': 8.58.1(typescript@5.8.3) eslint: 9.39.4(jiti@2.6.1) - typescript: 5.9.3 + typescript: 5.8.3 transitivePeerDependencies: - supports-color @@ -15291,6 +15333,11 @@ snapshots: '@typescript-eslint/types': 8.57.2 eslint-visitor-keys: 5.0.1 + '@typescript-eslint/visitor-keys@8.58.1': + dependencies: + '@typescript-eslint/types': 8.58.1 + eslint-visitor-keys: 5.0.1 + '@unrs/resolver-binding-android-arm-eabi@1.11.1': optional: true @@ -15392,6 +15439,18 @@ snapshots: tinyrainbow: 3.1.0 vitest: 4.1.4(@opentelemetry/api@1.9.0)(@types/node@24.12.0)(@vitest/coverage-v8@4.1.4)(@vitest/ui@4.1.4)(vite@7.3.1(@types/node@24.12.0)(jiti@2.6.1)(lightningcss@1.32.0)(tsx@4.21.0)(yaml@2.8.3)) + '@vitest/eslint-plugin@1.6.15(@typescript-eslint/eslint-plugin@8.57.2(@typescript-eslint/parser@8.57.2(eslint@9.39.4(jiti@2.6.1))(typescript@5.8.3))(eslint@9.39.4(jiti@2.6.1))(typescript@5.8.3))(eslint@9.39.4(jiti@2.6.1))(typescript@5.8.3)(vitest@4.1.4)': + dependencies: + '@typescript-eslint/scope-manager': 8.58.1 + '@typescript-eslint/utils': 8.58.1(eslint@9.39.4(jiti@2.6.1))(typescript@5.8.3) + eslint: 9.39.4(jiti@2.6.1) + optionalDependencies: + '@typescript-eslint/eslint-plugin': 8.57.2(@typescript-eslint/parser@8.57.2(eslint@9.39.4(jiti@2.6.1))(typescript@5.8.3))(eslint@9.39.4(jiti@2.6.1))(typescript@5.8.3) + typescript: 5.8.3 + vitest: 4.1.4(@opentelemetry/api@1.9.0)(@types/node@24.12.0)(@vitest/coverage-v8@4.1.4)(@vitest/ui@4.1.4)(vite@7.3.1(@types/node@24.12.0)(jiti@2.6.1)(lightningcss@1.32.0)(tsx@4.21.0)(yaml@2.3.0)) + transitivePeerDependencies: + - supports-color + '@vitest/expect@4.1.4': dependencies: '@standard-schema/spec': 1.1.0 @@ -15401,6 +15460,15 @@ snapshots: chai: 6.2.2 tinyrainbow: 3.1.0 + '@vitest/mocker@4.1.4(vite@7.3.1(@types/node@24.12.0)(jiti@2.6.1)(lightningcss@1.32.0)(tsx@4.21.0)(yaml@2.3.0))': + dependencies: + '@vitest/spy': 4.1.4 + estree-walker: 3.0.3 + magic-string: 0.30.21 + optionalDependencies: + vite: 7.3.1(@types/node@24.12.0)(jiti@2.6.1)(lightningcss@1.32.0)(tsx@4.21.0)(yaml@2.3.0) + optional: true + '@vitest/mocker@4.1.4(vite@7.3.1(@types/node@24.12.0)(jiti@2.6.1)(lightningcss@1.32.0)(tsx@4.21.0)(yaml@2.8.3))': dependencies: '@vitest/spy': 4.1.4 @@ -15843,6 +15911,8 @@ snapshots: base64-js: 1.5.1 ieee754: 1.2.1 + builtin-modules@5.1.0: {} + bundle-name@4.1.0: dependencies: run-applescript: 7.1.0 @@ -15981,8 +16051,7 @@ snapshots: ci-info@3.9.0: {} - ci-info@4.4.0: - optional: true + ci-info@4.4.0: {} cjs-module-lexer@1.4.3: {} @@ -15992,6 +16061,10 @@ snapshots: classnames@2.5.1: {} + clean-regexp@1.0.0: + dependencies: + escape-string-regexp: 1.0.5 + clean-stack@2.2.0: {} cli-cursor@3.1.0: @@ -16251,6 +16324,10 @@ snapshots: untildify: 4.0.0 yargs: 16.2.0 + core-js-compat@3.49.0: + dependencies: + browserslist: 4.28.1 + core-js@3.32.1: {} core-util-is@1.0.3: {} @@ -16773,8 +16850,7 @@ snapshots: escape-html@1.0.3: {} - escape-string-regexp@1.0.5: - optional: true + escape-string-regexp@1.0.5: {} escape-string-regexp@2.0.0: {} @@ -16793,55 +16869,22 @@ snapshots: optionalDependencies: unrs-resolver: 1.11.1 - eslint-import-resolver-typescript@3.10.1(eslint-plugin-import-x@4.16.2(@typescript-eslint/utils@8.57.2(eslint@9.39.4(jiti@2.6.1))(typescript@5.8.3))(eslint@9.39.4(jiti@2.6.1)))(eslint@9.39.4(jiti@2.6.1)): + eslint-import-resolver-typescript@4.4.4(eslint-plugin-import-x@4.16.2(@typescript-eslint/utils@8.58.1(eslint@9.39.4(jiti@2.6.1))(typescript@5.8.3))(eslint@9.39.4(jiti@2.6.1)))(eslint@9.39.4(jiti@2.6.1)): dependencies: - '@nolyfill/is-core-module': 1.0.39 - debug: 4.4.3(supports-color@10.2.2) - eslint: 9.39.4(jiti@2.6.1) - get-tsconfig: 4.13.7 - is-bun-module: 2.0.0 - stable-hash: 0.0.5 - tinyglobby: 0.2.15 - unrs-resolver: 1.11.1 - optionalDependencies: - eslint-plugin-import-x: 4.16.2(@typescript-eslint/utils@8.57.2(eslint@9.39.4(jiti@2.6.1))(typescript@5.8.3))(eslint@9.39.4(jiti@2.6.1)) - transitivePeerDependencies: - - supports-color - - eslint-import-resolver-typescript@3.10.1(eslint-plugin-import-x@4.16.2(@typescript-eslint/utils@8.57.2(eslint@9.39.4(jiti@2.6.1))(typescript@5.9.3))(eslint@9.39.4(jiti@2.6.1)))(eslint@9.39.4(jiti@2.6.1)): - dependencies: - '@nolyfill/is-core-module': 1.0.39 debug: 4.4.3(supports-color@10.2.2) eslint: 9.39.4(jiti@2.6.1) + eslint-import-context: 0.1.9(unrs-resolver@1.11.1) get-tsconfig: 4.13.7 is-bun-module: 2.0.0 - stable-hash: 0.0.5 - tinyglobby: 0.2.15 - unrs-resolver: 1.11.1 - optionalDependencies: - eslint-plugin-import-x: 4.16.2(@typescript-eslint/utils@8.57.2(eslint@9.39.4(jiti@2.6.1))(typescript@5.9.3))(eslint@9.39.4(jiti@2.6.1)) - transitivePeerDependencies: - - supports-color - - eslint-plugin-import-x@4.16.2(@typescript-eslint/utils@8.57.2(eslint@9.39.4(jiti@2.6.1))(typescript@5.8.3))(eslint@9.39.4(jiti@2.6.1)): - dependencies: - '@package-json/types': 0.0.12 - '@typescript-eslint/types': 8.57.2 - comment-parser: 1.4.5 - debug: 4.4.3(supports-color@10.2.2) - eslint: 9.39.4(jiti@2.6.1) - eslint-import-context: 0.1.9(unrs-resolver@1.11.1) - is-glob: 4.0.3 - minimatch: 10.2.4 - semver: 7.7.4 stable-hash-x: 0.2.0 + tinyglobby: 0.2.15 unrs-resolver: 1.11.1 optionalDependencies: - '@typescript-eslint/utils': 8.57.2(eslint@9.39.4(jiti@2.6.1))(typescript@5.8.3) + eslint-plugin-import-x: 4.16.2(@typescript-eslint/utils@8.58.1(eslint@9.39.4(jiti@2.6.1))(typescript@5.8.3))(eslint@9.39.4(jiti@2.6.1)) transitivePeerDependencies: - supports-color - eslint-plugin-import-x@4.16.2(@typescript-eslint/utils@8.57.2(eslint@9.39.4(jiti@2.6.1))(typescript@5.9.3))(eslint@9.39.4(jiti@2.6.1)): + eslint-plugin-import-x@4.16.2(@typescript-eslint/utils@8.58.1(eslint@9.39.4(jiti@2.6.1))(typescript@5.8.3))(eslint@9.39.4(jiti@2.6.1)): dependencies: '@package-json/types': 0.0.12 '@typescript-eslint/types': 8.57.2 @@ -16855,13 +16898,13 @@ snapshots: stable-hash-x: 0.2.0 unrs-resolver: 1.11.1 optionalDependencies: - '@typescript-eslint/utils': 8.57.2(eslint@9.39.4(jiti@2.6.1))(typescript@5.9.3) + '@typescript-eslint/utils': 8.58.1(eslint@9.39.4(jiti@2.6.1))(typescript@5.8.3) transitivePeerDependencies: - supports-color eslint-plugin-jest@28.14.0(@typescript-eslint/eslint-plugin@8.57.2(@typescript-eslint/parser@8.57.2(eslint@9.39.4(jiti@2.6.1))(typescript@5.8.3))(eslint@9.39.4(jiti@2.6.1))(typescript@5.8.3))(eslint@9.39.4(jiti@2.6.1))(jest@29.7.0(@types/node@24.12.0)(ts-node@10.9.2(@swc/core@1.15.21)(@types/node@24.12.0)(typescript@5.8.3)))(typescript@5.8.3): dependencies: - '@typescript-eslint/utils': 8.57.2(eslint@9.39.4(jiti@2.6.1))(typescript@5.8.3) + '@typescript-eslint/utils': 8.58.1(eslint@9.39.4(jiti@2.6.1))(typescript@5.8.3) eslint: 9.39.4(jiti@2.6.1) optionalDependencies: '@typescript-eslint/eslint-plugin': 8.57.2(@typescript-eslint/parser@8.57.2(eslint@9.39.4(jiti@2.6.1))(typescript@5.8.3))(eslint@9.39.4(jiti@2.6.1))(typescript@5.8.3) @@ -16869,25 +16912,35 @@ snapshots: transitivePeerDependencies: - supports-color - typescript + optional: true - eslint-plugin-jest@28.14.0(@typescript-eslint/eslint-plugin@8.57.2(@typescript-eslint/parser@8.57.2(eslint@9.39.4(jiti@2.6.1))(typescript@5.9.3))(eslint@9.39.4(jiti@2.6.1))(typescript@5.9.3))(eslint@9.39.4(jiti@2.6.1))(jest@29.7.0(@types/node@24.12.0)(ts-node@10.9.2(@swc/core@1.15.21)(@types/node@24.12.0)(typescript@5.9.3)))(typescript@5.9.3): + eslint-plugin-react-hooks@5.2.0(eslint@9.39.4(jiti@2.6.1)): dependencies: - '@typescript-eslint/utils': 8.57.2(eslint@9.39.4(jiti@2.6.1))(typescript@5.9.3) eslint: 9.39.4(jiti@2.6.1) - optionalDependencies: - '@typescript-eslint/eslint-plugin': 8.57.2(@typescript-eslint/parser@8.57.2(eslint@9.39.4(jiti@2.6.1))(typescript@5.9.3))(eslint@9.39.4(jiti@2.6.1))(typescript@5.9.3) - jest: 29.7.0(@types/node@24.12.0)(ts-node@10.9.2(@swc/core@1.15.21)(@types/node@24.12.0)(typescript@5.9.3)) - transitivePeerDependencies: - - supports-color - - typescript - eslint-plugin-react-hooks@5.2.0(eslint@9.39.4(jiti@2.6.1)): + eslint-plugin-react-refresh@0.4.26(eslint@9.39.4(jiti@2.6.1)): dependencies: eslint: 9.39.4(jiti@2.6.1) - eslint-plugin-react-refresh@0.4.26(eslint@9.39.4(jiti@2.6.1)): + eslint-plugin-unicorn@63.0.0(eslint@9.39.4(jiti@2.6.1)): dependencies: + '@babel/helper-validator-identifier': 7.28.5 + '@eslint-community/eslint-utils': 4.9.1(eslint@9.39.4(jiti@2.6.1)) + change-case: 5.4.4 + ci-info: 4.4.0 + clean-regexp: 1.0.0 + core-js-compat: 3.49.0 eslint: 9.39.4(jiti@2.6.1) + find-up-simple: 1.0.1 + globals: 16.5.0 + indent-string: 5.0.0 + is-builtin-module: 5.0.0 + jsesc: 3.1.0 + pluralize: 8.0.0 + regexp-tree: 0.1.27 + regjsparser: 0.13.1 + semver: 7.7.4 + strip-indent: 4.1.1 eslint-scope@8.4.0: dependencies: @@ -17266,6 +17319,8 @@ snapshots: transitivePeerDependencies: - supports-color + find-up-simple@1.0.1: {} + find-up@2.1.0: dependencies: locate-path: 2.0.0 @@ -17804,6 +17859,8 @@ snapshots: indent-string@4.0.0: {} + indent-string@5.0.0: {} + index-to-position@1.2.0: {} inflight@1.0.6: @@ -17899,6 +17956,10 @@ snapshots: is-buffer@2.0.5: {} + is-builtin-module@5.0.0: + dependencies: + builtin-modules: 5.1.0 + is-bun-module@2.0.0: dependencies: semver: 7.7.4 @@ -20884,6 +20945,8 @@ snapshots: reftools@1.1.9: {} + regexp-tree@0.1.27: {} + regexp.prototype.flags@1.5.4: dependencies: call-bind: 1.0.8 @@ -20893,6 +20956,10 @@ snapshots: gopd: 1.2.0 set-function-name: 2.0.2 + regjsparser@0.13.1: + dependencies: + jsesc: 3.1.0 + remark-gfm@3.0.1: dependencies: '@types/mdast': 3.0.15 @@ -21373,8 +21440,6 @@ snapshots: stable-hash-x@0.2.0: {} - stable-hash@0.0.5: {} - stack-utils@2.0.6: dependencies: escape-string-regexp: 2.0.0 @@ -21485,6 +21550,8 @@ snapshots: min-indent: 1.0.1 optional: true + strip-indent@4.1.1: {} + strip-json-comments@3.1.1: {} strip-json-comments@5.0.3: {} @@ -21686,10 +21753,6 @@ snapshots: dependencies: typescript: 5.8.3 - ts-api-utils@2.5.0(typescript@5.9.3): - dependencies: - typescript: 5.9.3 - ts-essentials@10.1.1(typescript@5.9.3): optionalDependencies: typescript: 5.9.3 @@ -21927,17 +21990,6 @@ snapshots: transitivePeerDependencies: - supports-color - typescript-eslint@8.57.2(eslint@9.39.4(jiti@2.6.1))(typescript@5.9.3): - dependencies: - '@typescript-eslint/eslint-plugin': 8.57.2(@typescript-eslint/parser@8.57.2(eslint@9.39.4(jiti@2.6.1))(typescript@5.9.3))(eslint@9.39.4(jiti@2.6.1))(typescript@5.9.3) - '@typescript-eslint/parser': 8.57.2(eslint@9.39.4(jiti@2.6.1))(typescript@5.9.3) - '@typescript-eslint/typescript-estree': 8.57.2(typescript@5.9.3) - '@typescript-eslint/utils': 8.57.2(eslint@9.39.4(jiti@2.6.1))(typescript@5.9.3) - eslint: 9.39.4(jiti@2.6.1) - typescript: 5.9.3 - transitivePeerDependencies: - - supports-color - typescript@5.8.3: {} typescript@5.9.3: {} @@ -22157,6 +22209,23 @@ snapshots: tsx: 4.21.0 yaml: 2.8.3 + vite@7.3.1(@types/node@24.12.0)(jiti@2.6.1)(lightningcss@1.32.0)(tsx@4.21.0)(yaml@2.3.0): + dependencies: + esbuild: 0.27.4 + fdir: 6.5.0(picomatch@4.0.4) + picomatch: 4.0.4 + postcss: 8.5.8 + rollup: 4.60.0 + tinyglobby: 0.2.15 + optionalDependencies: + '@types/node': 24.12.0 + fsevents: 2.3.3 + jiti: 2.6.1 + lightningcss: 1.32.0 + tsx: 4.21.0 + yaml: 2.3.0 + optional: true + vite@7.3.1(@types/node@24.12.0)(jiti@2.6.1)(lightningcss@1.32.0)(tsx@4.21.0)(yaml@2.8.3): dependencies: esbuild: 0.27.4 @@ -22173,6 +22242,37 @@ snapshots: tsx: 4.21.0 yaml: 2.8.3 + vitest@4.1.4(@opentelemetry/api@1.9.0)(@types/node@24.12.0)(@vitest/coverage-v8@4.1.4)(@vitest/ui@4.1.4)(vite@7.3.1(@types/node@24.12.0)(jiti@2.6.1)(lightningcss@1.32.0)(tsx@4.21.0)(yaml@2.3.0)): + dependencies: + '@vitest/expect': 4.1.4 + '@vitest/mocker': 4.1.4(vite@7.3.1(@types/node@24.12.0)(jiti@2.6.1)(lightningcss@1.32.0)(tsx@4.21.0)(yaml@2.3.0)) + '@vitest/pretty-format': 4.1.4 + '@vitest/runner': 4.1.4 + '@vitest/snapshot': 4.1.4 + '@vitest/spy': 4.1.4 + '@vitest/utils': 4.1.4 + es-module-lexer: 2.0.0 + expect-type: 1.3.0 + magic-string: 0.30.21 + obug: 2.1.1 + pathe: 2.0.3 + picomatch: 4.0.4 + std-env: 4.0.0 + tinybench: 2.9.0 + tinyexec: 1.0.4 + tinyglobby: 0.2.15 + tinyrainbow: 3.1.0 + vite: 7.3.1(@types/node@24.12.0)(jiti@2.6.1)(lightningcss@1.32.0)(tsx@4.21.0)(yaml@2.3.0) + why-is-node-running: 2.3.0 + optionalDependencies: + '@opentelemetry/api': 1.9.0 + '@types/node': 24.12.0 + '@vitest/coverage-v8': 4.1.4(vitest@4.1.4) + '@vitest/ui': 4.1.4(vitest@4.1.4) + transitivePeerDependencies: + - msw + optional: true + vitest@4.1.4(@opentelemetry/api@1.9.0)(@types/node@24.12.0)(@vitest/coverage-v8@4.1.4)(@vitest/ui@4.1.4)(vite@7.3.1(@types/node@24.12.0)(jiti@2.6.1)(lightningcss@1.32.0)(tsx@4.21.0)(yaml@2.8.3)): dependencies: '@vitest/expect': 4.1.4 diff --git a/tsconfig.build.json b/tsconfig.build.json deleted file mode 100644 index 44769df7..00000000 --- a/tsconfig.build.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "extends": "./tsconfig.json", - "exclude": ["${configDir}/tests"] -} diff --git a/tsconfig.json b/tsconfig.json deleted file mode 100644 index 1be24e90..00000000 --- a/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "extends": "@map-colonies/tsconfig/tsconfig-app", - "include": ["${configDir}/src", "${configDir}/tests"], - "exclude": ["${configDir}/node_modules", "${configDir}/dist"] -} diff --git a/tsconfig.lint.json b/tsconfig.lint.json deleted file mode 100644 index b1ae428a..00000000 --- a/tsconfig.lint.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "noEmit": true - }, - - "include": ["."], - "exclude": ["node_modules", "dist", "config"] -} diff --git a/turbo.json b/turbo.json index 88ffbf8c..da617dfd 100644 --- a/turbo.json +++ b/turbo.json @@ -14,6 +14,9 @@ "lint": { "dependsOn": [] }, + "lint:fix": { + "dependsOn": [] + }, "test": { "dependsOn": [] },