From e5298bacb52c24ec4efc0b9ca3bf2b7dca5610d2 Mon Sep 17 00:00:00 2001 From: Igor Savin Date: Fri, 16 Aug 2024 17:54:00 +0300 Subject: [PATCH] Update dependencies --- biome.json | 10 +- .../bull-mq-metrics/queueDiscoverers.ts | 4 +- package.json | 165 ++++++++---------- tsconfig.json | 50 +++--- tsconfig.lint.json | 6 +- vitest.config.mts | 60 +++---- 6 files changed, 140 insertions(+), 155 deletions(-) diff --git a/biome.json b/biome.json index ece7e30..d3a692f 100644 --- a/biome.json +++ b/biome.json @@ -1,7 +1,7 @@ { - "$schema": "./node_modules/@biomejs/biome/configuration_schema.json", - "extends": [ - "./node_modules/@lokalise/biome-config/configs/biome-base.jsonc", - "./node_modules/@lokalise/biome-config/configs/biome-package.jsonc" - ] + "$schema": "./node_modules/@biomejs/biome/configuration_schema.json", + "extends": [ + "./node_modules/@lokalise/biome-config/configs/biome-base.jsonc", + "./node_modules/@lokalise/biome-config/configs/biome-package.jsonc" + ] } diff --git a/lib/plugins/bull-mq-metrics/queueDiscoverers.ts b/lib/plugins/bull-mq-metrics/queueDiscoverers.ts index cfc607e..fd0bffc 100644 --- a/lib/plugins/bull-mq-metrics/queueDiscoverers.ts +++ b/lib/plugins/bull-mq-metrics/queueDiscoverers.ts @@ -1,4 +1,4 @@ -import { AbstractBackgroundJobProcessor } from '@lokalise/background-jobs-common' +import { backgroundJobProcessorGetActiveQueueIds } from '@lokalise/background-jobs-common' import type { Redis } from 'ioredis' export type QueueDiscoverer = { @@ -33,6 +33,6 @@ export class BackgroundJobsBasedQueueDiscoverer implements QueueDiscoverer { constructor(private readonly redis: Redis) {} async discoverQueues(): Promise { - return await AbstractBackgroundJobProcessor.getActiveQueueIds(this.redis) + return await backgroundJobProcessorGetActiveQueueIds(this.redis) } } diff --git a/package.json b/package.json index 6ad2166..7bffac1 100644 --- a/package.json +++ b/package.json @@ -1,90 +1,79 @@ { - "name": "@lokalise/fastify-extras", - "version": "21.6.0", - "description": "Opinionated set of fastify plugins, commonly used in Lokalise", - "author": { - "name": "Lokalise", - "url": "https://lokalise.com/" - }, - "license": "Apache-2.0", - "repository": { - "type": "git", - "url": "git://github.com/lokalise/fastify-extras.git" - }, - "keywords": [ - "fastify", - "newrelic", - "bugsnag", - "request-context", - "request-id", - "split-io" - ], - "homepage": "https://github.com/lokalise/fastify-extras", - "files": [ - "dist/**", - "LICENSE", - "README.md" - ], - "main": "dist/index.js", - "types": "dist/index.d.ts", - "type": "commonjs", - "publishConfig": { - "access": "public" - }, - "scripts": { - "build": "shx rm -rf ./dist && tsc", - "test": "vitest", - "test:coverage": "vitest --coverage", - "test:ci": "npm run lint && npm run test:coverage", - "lint": "biome check . && tsc --project tsconfig.lint.json --noEmit", - "lint:fix": "biome check --write", - "docker:start": "docker compose -f docker-compose.yml up --build -d redis && docker compose -f docker-compose.yml up --build -d wait_for_redis", - "docker:stop": "docker compose -f docker-compose.yml down", - "version": "auto-changelog -p && git add CHANGELOG.md" - }, - "dependencies": { - "@bugsnag/js": "^7.22.7", - "@supercharge/promise-pool": "^3.2.0", - "@lokalise/error-utils": "^1.4.0", - "@lokalise/background-jobs-common": "^4.0.1", - "@splitsoftware/splitio": "^10.25.2", - "@amplitude/analytics-node": "^1.3.5", - "fastify-metrics": "^11.0.0", - "fastify-plugin": "^4.5.1", - "toad-cache": "^3.7.0", - "tslib": "^2.6.2" - }, - "peerDependencies": { - "fastify": "^4.24.3", - "@fastify/jwt": "^8.0.1", - "newrelic": ">=11.13.0", - "pino": "^9.0.0", - "zod": "^3.22.4", - "bullmq": "^5.8.4", - "ioredis": "^5.4.1" - }, - "devDependencies": { - "@lokalise/backend-http-client": "^2.0.1", - "@biomejs/biome": "^1.8.3", - "@lokalise/biome-config": "^1.3.0", - "@lokalise/node-core": "^11.2.0", - "@types/newrelic": "^9.14.4", - "@types/node": "^22.1.0", - "@amplitude/analytics-types": "^2.5.0", - "@vitest/coverage-v8": "^2.0.5", - "auto-changelog": "^2.4.0", - "bullmq": "^5.12.0", - "ioredis": "^5.4.1", - "fastify": "^4.28.1", - "newrelic": "12.0.0", - "pino": "^9.1.0", - "pino-pretty": "^11.2.1", - "shx": "^0.3.4", - "typescript": "^5.5.4", - "vitest": "^2.0.5", - "zod": "^3.23.8" - }, - "engines": { - "node": ">=18" - } + "name": "@lokalise/fastify-extras", + "version": "21.6.0", + "description": "Opinionated set of fastify plugins, commonly used in Lokalise", + "author": { + "name": "Lokalise", + "url": "https://lokalise.com/" + }, + "license": "Apache-2.0", + "repository": { + "type": "git", + "url": "git://github.com/lokalise/fastify-extras.git" + }, + "keywords": ["fastify", "newrelic", "bugsnag", "request-context", "request-id", "split-io"], + "homepage": "https://github.com/lokalise/fastify-extras", + "files": ["dist/**", "LICENSE", "README.md"], + "main": "dist/index.js", + "types": "dist/index.d.ts", + "type": "commonjs", + "publishConfig": { + "access": "public" + }, + "scripts": { + "build": "shx rm -rf ./dist && tsc", + "test": "vitest", + "test:coverage": "vitest --coverage", + "test:ci": "npm run lint && npm run test:coverage", + "lint": "biome check . && tsc --project tsconfig.lint.json --noEmit", + "lint:fix": "biome check --write", + "docker:start": "docker compose -f docker-compose.yml up --build -d redis && docker compose -f docker-compose.yml up --build -d wait_for_redis", + "docker:stop": "docker compose -f docker-compose.yml down", + "version": "auto-changelog -p && git add CHANGELOG.md" + }, + "dependencies": { + "@bugsnag/js": "^7.25.0", + "@supercharge/promise-pool": "^3.2.0", + "@lokalise/error-utils": "^2.0.0", + "@lokalise/background-jobs-common": "^7.0.0", + "@splitsoftware/splitio": "^10.27.0", + "@amplitude/analytics-node": "^1.3.5", + "fastify-metrics": "^11.0.0", + "fastify-plugin": "^4.5.1", + "toad-cache": "^3.7.0", + "tslib": "^2.6.3" + }, + "peerDependencies": { + "fastify": "^4.24.3", + "@fastify/jwt": "^8.0.1", + "newrelic": ">=11.13.0", + "pino": "^9.0.0", + "zod": "^3.22.4", + "bullmq": "^5.8.4", + "ioredis": "^5.4.1" + }, + "devDependencies": { + "@lokalise/backend-http-client": "^2.0.1", + "@biomejs/biome": "^1.8.3", + "@lokalise/biome-config": "^1.4.0", + "@lokalise/node-core": "^11.2.0", + "@types/newrelic": "^9.14.4", + "@types/node": "^22.1.0", + "@amplitude/analytics-types": "^2.5.0", + "@vitest/coverage-v8": "^2.0.5", + "auto-changelog": "^2.4.0", + "bullmq": "^5.12.0", + "ioredis": "^5.4.1", + "fastify": "^4.28.1", + "newrelic": "12.0.0", + "pino": "^9.1.0", + "pino-pretty": "^11.2.1", + "shx": "^0.3.4", + "typescript": "^5.5.4", + "vitest": "^2.0.5", + "zod": "^3.23.8" + }, + "engines": { + "node": ">=18" + } } diff --git a/tsconfig.json b/tsconfig.json index da6594f..0c8044f 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,27 +1,27 @@ { - "compilerOptions": { - "outDir": "dist", - "module": "commonjs", - "target": "ES2022", - "lib": ["ES2022", "dom"], - "sourceMap": true, - "declaration": true, - "declarationMap": false, - "types": ["node", "vitest/globals"], - "strict": true, - "skipLibCheck": true, - "moduleResolution": "node", - "noUnusedLocals": false, - "noUnusedParameters": false, - "noFallthroughCasesInSwitch": true, - "strictNullChecks": true, - "importHelpers": true, - "baseUrl": ".", - "allowSyntheticDefaultImports": true, - "esModuleInterop": true, - "forceConsistentCasingInFileNames": true, - "resolveJsonModule": true - }, - "include": ["lib/**/*.ts"], - "exclude": ["lib/**/*.spec.ts", "lib/**/*.test.ts"] + "compilerOptions": { + "outDir": "dist", + "module": "commonjs", + "target": "ES2022", + "lib": ["ES2022", "dom"], + "sourceMap": true, + "declaration": true, + "declarationMap": false, + "types": ["node", "vitest/globals"], + "strict": true, + "skipLibCheck": true, + "moduleResolution": "node", + "noUnusedLocals": false, + "noUnusedParameters": false, + "noFallthroughCasesInSwitch": true, + "strictNullChecks": true, + "importHelpers": true, + "baseUrl": ".", + "allowSyntheticDefaultImports": true, + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "resolveJsonModule": true + }, + "include": ["lib/**/*.ts"], + "exclude": ["lib/**/*.spec.ts", "lib/**/*.test.ts"] } diff --git a/tsconfig.lint.json b/tsconfig.lint.json index 5e07b01..97a6177 100644 --- a/tsconfig.lint.json +++ b/tsconfig.lint.json @@ -1,5 +1,5 @@ { - "extends": ["./tsconfig.json"], - "include": ["lib/**/*", "test/**/*", "vitest.config.mts"], - "exclude": [] + "extends": ["./tsconfig.json"], + "include": ["lib/**/*", "test/**/*", "vitest.config.mts"], + "exclude": [] } diff --git a/vitest.config.mts b/vitest.config.mts index 94951d9..d2119d4 100644 --- a/vitest.config.mts +++ b/vitest.config.mts @@ -1,34 +1,30 @@ -import { defineConfig } from "vitest/config"; +import { defineConfig } from 'vitest/config' +// biome-ignore lint/style/noDefaultExport: vite expects default export export default defineConfig({ - test: { - globals: true, - watch: false, - poolOptions: { - threads: { - singleThread: true, - }, - }, - pool: 'threads', - environment: "node", - reporters: ["verbose"], - coverage: { - provider: "v8", - include: ["lib/**/*.ts"], - exclude: [ - "lib/**/*.spec.ts", - "lib/types.ts", - "lib/index.ts", - "lib/errors/publicErrors.ts", - ], - reporter: ["text"], - all: true, - thresholds: { - lines: 65, - functions: 80, - branches: 85, - statements: 65, - }, - }, - }, -}); + test: { + globals: true, + watch: false, + poolOptions: { + threads: { + singleThread: true, + }, + }, + pool: 'threads', + environment: 'node', + reporters: ['verbose'], + coverage: { + provider: 'v8', + include: ['lib/**/*.ts'], + exclude: ['lib/**/*.spec.ts', 'lib/types.ts', 'lib/index.ts', 'lib/errors/publicErrors.ts'], + reporter: ['text'], + all: true, + thresholds: { + lines: 65, + functions: 80, + branches: 85, + statements: 65, + }, + }, + }, +})