Skip to content

Commit 07da886

Browse files
authored
Chore/bg common common tsconfig (#537)
* tsconfig adjusted * adjusting package json * Lint fix * More lint fixes * More lint fixes * Fixing build issue with redis-semaphore
1 parent 1cccc07 commit 07da886

69 files changed

Lines changed: 284 additions & 298 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

packages/app/background-jobs-common/biome.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"$schema": "../../../node_modules/@biomejs/biome/configuration_schema.json",
33
"extends": [
44
"../../../node_modules/@lokalise/biome-config/configs/biome-base.jsonc",
5-
"../../../node_modules/@lokalise/biome-config/configs/biome-package.jsonc"
5+
"../../../node_modules/@lokalise/biome-config/configs/biome-package.jsonc",
6+
"../../../node_modules/@lokalise/biome-config/configs/biome-esm.jsonc"
67
]
78
}

packages/app/background-jobs-common/package.json

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,16 @@
1313
},
1414
"private": false,
1515
"license": "Apache-2.0",
16-
"type": "commonjs",
16+
"type": "module",
1717
"main": "./dist/index.js",
18-
"types": "./dist/index.d.ts",
18+
"exports": {
19+
".": "./dist/index.js",
20+
"./package.json": "./package.json"
21+
},
1922
"scripts": {
2023
"build": "rimraf dist && tsc --project tsconfig.build.json",
2124
"clean": "rimraf dist",
22-
"lint": "biome check . && tsc --noEmit",
25+
"lint": "biome check . && tsc",
2326
"lint:fix": "biome check --write",
2427
"docker:start:ci": "docker compose up -d --quiet-pull redis",
2528
"test": "vitest run",
@@ -31,7 +34,7 @@
3134
"postversion": "biome check --write package.json"
3235
},
3336
"dependencies": {
34-
"@lokalise/id-utils": "^2.2.0",
37+
"@lokalise/id-utils": "^3.0.0",
3538
"@lokalise/node-core": "^13.1.0",
3639
"pino": "^9.5.0",
3740
"redis-semaphore": "^5.6.1",
@@ -46,8 +49,8 @@
4649
"devDependencies": {
4750
"@biomejs/biome": "^1.9.4",
4851
"@lokalise/biome-config": "^1.5.0",
52+
"@lokalise/tsconfig": "^1.0.2",
4953
"@types/node": "^22.10.1",
50-
"@lokalise/package-vite-config": "latest",
5154
"@vitest/coverage-v8": "^3.0.7",
5255
"bullmq": "^5.31.2",
5356
"ioredis": "^5.4.1",

packages/app/background-jobs-common/src/background-job-processor/barrier/JobQueueSizeThrottlingBarrier.spec.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { setTimeout } from 'node:timers/promises'
22
import { afterEach, beforeEach, describe, expect, it } from 'vitest'
3-
import { TestDependencyFactory } from '../../../test/TestDependencyFactory'
4-
import { TestQueueSizeJobBarrierBackgroundJobProcessor } from '../../../test/processors/TestQueueSizeJobBarrierBackgroundJobProcessor'
5-
import type { BackgroundJobProcessorDependencies } from '../processors/types'
6-
import type { BaseJobPayload } from '../types'
7-
import { createJobQueueSizeThrottlingBarrier } from './JobQueueSizeThrottlingBarrier'
3+
import { TestDependencyFactory } from '../../../test/TestDependencyFactory.js'
4+
import { TestQueueSizeJobBarrierBackgroundJobProcessor } from '../../../test/processors/TestQueueSizeJobBarrierBackgroundJobProcessor.js'
5+
import type { BackgroundJobProcessorDependencies } from '../processors/types.js'
6+
import type { BaseJobPayload } from '../types.js'
7+
import { createJobQueueSizeThrottlingBarrier } from './JobQueueSizeThrottlingBarrier.js'
88

99
type JobData = {
1010
id: string

packages/app/background-jobs-common/src/background-job-processor/barrier/JobQueueSizeThrottlingBarrier.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import type { AbstractBackgroundJobProcessor } from '../processors/AbstractBackgroundJobProcessor'
2-
import type { BaseJobPayload } from '../types'
3-
import type { BarrierCallback } from './barrier'
1+
import type { AbstractBackgroundJobProcessor } from '../processors/AbstractBackgroundJobProcessor.js'
2+
import type { BaseJobPayload } from '../types.js'
3+
import type { BarrierCallback } from './barrier.js'
44

55
export type ChildJobThrottlingBarrierConfig = {
66
retryPeriodInMsecs: number

packages/app/background-jobs-common/src/background-job-processor/barrier/barrier.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { Job } from 'bullmq'
2-
import type { BaseJobPayload, SafeJob } from '../types'
2+
import type { BaseJobPayload, SafeJob } from '../types.js'
33

44
export type BarrierResult = BarrierResultPositive | BarrierResultNegative
55

packages/app/background-jobs-common/src/background-job-processor/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { JobsOptions, QueueOptions, WorkerOptions } from 'bullmq'
22

3-
import { daysToSeconds } from './utils'
3+
import { daysToSeconds } from './utils.js'
44

55
/**
66
* How many days we retain completed jobs

packages/app/background-jobs-common/src/background-job-processor/factories/AbstractBullmqFactory.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { Queue, QueueOptions, Worker, WorkerOptions } from 'bullmq'
22

3-
import type { BullmqProcessor, SafeJob } from '../types'
3+
import type { BullmqProcessor, SafeJob } from '../types.js'
44

55
export abstract class AbstractBullmqFactory<
66
QueueType extends Queue<JobPayload, JobReturn, string, JobPayload, JobReturn, string>,

packages/app/background-jobs-common/src/background-job-processor/factories/BullmqWorkerFactory.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { Worker, WorkerOptions } from 'bullmq'
22

3-
import type { BullmqProcessor, SafeJob } from '../types'
3+
import type { BullmqProcessor, SafeJob } from '../types.js'
44

55
export interface BullmqWorkerFactory<
66
WorkerType extends Worker,

packages/app/background-jobs-common/src/background-job-processor/factories/CommonBullmqFactory.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { Queue, Worker } from 'bullmq'
22
import type { Job, Processor, QueueOptions, WorkerOptions } from 'bullmq'
33

4-
import type { BullmqProcessor } from '../types'
4+
import type { BullmqProcessor } from '../types.js'
55

6-
import type { AbstractBullmqFactory } from './AbstractBullmqFactory'
6+
import type { AbstractBullmqFactory } from './AbstractBullmqFactory.js'
77

88
export class CommonBullmqFactory<JobPayload extends object, JobReturn = void>
99
implements

packages/app/background-jobs-common/src/background-job-processor/factories/CommonBullmqFactoryNew.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { type Job, Queue, Worker } from 'bullmq'
22
import type { Processor, QueueOptions, WorkerOptions } from 'bullmq'
3-
import type { BullmqProcessor } from '../types'
4-
import type { BullmqQueueFactory } from './BullmqQueueFactory'
5-
import type { BullmqWorkerFactory } from './BullmqWorkerFactory'
3+
import type { BullmqProcessor } from '../types.js'
4+
import type { BullmqQueueFactory } from './BullmqQueueFactory.js'
5+
import type { BullmqWorkerFactory } from './BullmqWorkerFactory.js'
66

77
export class CommonBullmqFactoryNew
88
implements

0 commit comments

Comments
 (0)