@pikku/queue-bullmq 0.12.5 → 0.12.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ ## 0.12.6
2
+
3
+ ### Patch Changes
4
+
5
+ - 6794681: Publish the ecosystem surface as per-area sub-barrels under `@pikku/core/ecosystem/*`, and point generated code, the CLI, the inspector and the runtime adapters at them.
6
+
7
+ 348 names that only generated code, the toolchain or a runtime adapter ever imports now have a second home on `@pikku/core/ecosystem/<area>` — one sub-barrel per area, matching how core already publishes its entrypoints, so no single barrel grows without bound and a consumer only pulls in the area it uses.
8
+
9
+ This step is additive: every name is still exported from the entrypoint it was published from before, so nothing downstream breaks. Removing them from the app-facing barrels is a later change, and needs a release carrying `./ecosystem/*` first.
10
+
11
+ - Updated dependencies [7406bfe]
12
+ - Updated dependencies [6794681]
13
+ - @pikku/core@0.12.84
14
+
1
15
  ## 0.12.5
2
16
 
3
17
  ### Patch Changes
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2021 - present Yasser Fadl and Pikku contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,29 @@
1
+ # @pikku/queue-bullmq
2
+
3
+ BullMQ queue, worker and scheduler services for Pikku. Backed by Redis, with
4
+ job results, retries and priorities.
5
+
6
+ ## Install
7
+
8
+ ```bash
9
+ npm install @pikku/queue-bullmq
10
+ ```
11
+
12
+ ## Usage
13
+
14
+ ```typescript
15
+ import { BullQueueService, BullQueueWorkers } from '@pikku/queue-bullmq'
16
+
17
+ const queue = new BullQueueService({ host: 'localhost', port: 6379 })
18
+
19
+ const workers = new BullQueueWorkers({ host: 'localhost', port: 6379 })
20
+
21
+ await workers.registerQueues()
22
+ ```
23
+
24
+ Use `BullSchedulerService` for cron wirings. For a Postgres-backed alternative
25
+ see `@pikku/queue-pg-boss`.
26
+
27
+ ## Docs
28
+
29
+ https://pikku.dev/docs
@@ -1,6 +1,7 @@
1
1
  import type { ConnectionOptions, JobsOptions } from 'bullmq';
2
2
  import type Bull from 'bullmq';
3
- import type { QueueService, QueueJob, JobOptions } from '@pikku/core/queue';
3
+ import type { QueueService, QueueJob } from '@pikku/core/queue';
4
+ import type { JobOptions } from '@pikku/core/ecosystem/queue';
4
5
  export declare const mapPikkuJobToBull: (options?: JobOptions) => JobsOptions;
5
6
  /**
6
7
  * Bull/Redis queue service implementation
@@ -1,5 +1,5 @@
1
1
  import type { ConnectionOptions, WorkerOptions } from 'bullmq';
2
- import type { QueueWorkers, PikkuWorkerConfig, QueueConfigMapping, ConfigValidationResult } from '@pikku/core/queue';
2
+ import type { QueueWorkers, PikkuWorkerConfig, QueueConfigMapping, ConfigValidationResult } from '@pikku/core/ecosystem/queue';
3
3
  export declare const mapPikkuWorkerToBull: (workerConfig?: PikkuWorkerConfig) => Omit<WorkerOptions, "connection">;
4
4
  /**
5
5
  * Bull/Redis queue service implementation
@@ -1,6 +1,7 @@
1
1
  import { Worker } from 'bullmq';
2
- import { registerQueueWorkers, runQueueJob, QueueJobFailedError, QueueJobDiscardedError, } from '@pikku/core/queue';
3
- import { pikkuState } from '@pikku/core/internal';
2
+ import { runQueueJob } from '@pikku/core/queue';
3
+ import { registerQueueWorkers, QueueJobFailedError, QueueJobDiscardedError, } from '@pikku/core/ecosystem/queue';
4
+ import { pikkuState } from '@pikku/core/ecosystem';
4
5
  import { mapBullJobToQueueJob } from './utils.js';
5
6
  export const mapPikkuWorkerToBull = (workerConfig) => {
6
7
  const workerOptions = {};
@@ -1,5 +1,6 @@
1
1
  import type { ConnectionOptions } from 'bullmq';
2
- import type { ScheduledTaskInfo, ScheduledTaskSummary, CoreUserSession } from '@pikku/core';
2
+ import type { CoreUserSession } from '@pikku/core';
3
+ import type { ScheduledTaskInfo, ScheduledTaskSummary } from '@pikku/core/ecosystem/services';
3
4
  import { SchedulerService } from '@pikku/core';
4
5
  export declare class BullSchedulerService extends SchedulerService {
5
6
  private redisConnectionOptions;
@@ -1,7 +1,9 @@
1
1
  import { Queue, Worker } from 'bullmq';
2
- import { SchedulerService, parseDurationString } from '@pikku/core';
3
- import { pikkuState } from '@pikku/core/internal';
4
- import { runScheduledTask, getScheduledTasks } from '@pikku/core/scheduler';
2
+ import { SchedulerService } from '@pikku/core';
3
+ import { parseDurationString } from '@pikku/core/ecosystem/types';
4
+ import { pikkuState } from '@pikku/core/ecosystem';
5
+ import { runScheduledTask } from '@pikku/core/scheduler';
6
+ import { getScheduledTasks } from '@pikku/core/ecosystem/scheduler';
5
7
  const RECURRING_QUEUE_NAME = 'pikku-recurring-scheduled-task';
6
8
  export class BullSchedulerService extends SchedulerService {
7
9
  redisConnectionOptions;
package/dist/index.d.ts CHANGED
@@ -8,4 +8,5 @@ export { BullServiceFactory } from './bull-service-factory.js';
8
8
  export { BullQueueService } from './bull-queue-service.js';
9
9
  export { BullQueueWorkers } from './bull-queue-worker.js';
10
10
  export { BullSchedulerService } from './bull-scheduler-service.js';
11
- export type { QueueService, PikkuWorkerConfig, PikkuJobConfig, QueueJob, JobOptions, } from '@pikku/core/queue';
11
+ export type { QueueService, QueueJob } from '@pikku/core/queue';
12
+ export type { PikkuWorkerConfig, PikkuJobConfig, JobOptions, } from '@pikku/core/ecosystem/queue';
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "@pikku/queue-bullmq",
3
- "version": "0.12.5",
3
+ "version": "0.12.6",
4
+ "description": "BullMQ queue, worker and scheduler services for Pikku",
4
5
  "author": "yasser.fadl@gmail.com",
5
6
  "license": "MIT",
6
7
  "module": "dist/index.js",
@@ -15,7 +16,7 @@
15
16
  "prepublishOnly": "yarn build"
16
17
  },
17
18
  "peerDependencies": {
18
- "@pikku/core": "^0.12.69"
19
+ "@pikku/core": "^0.12.84"
19
20
  },
20
21
  "dependencies": {
21
22
  "bullmq": "^5.70.1",
@@ -1,7 +1,8 @@
1
1
  import type { ConnectionOptions, JobsOptions } from 'bullmq'
2
2
  import type Bull from 'bullmq'
3
3
  import { Queue, QueueEvents, RedisConnection } from 'bullmq'
4
- import type { QueueService, QueueJob, JobOptions } from '@pikku/core/queue'
4
+ import type { QueueService, QueueJob } from '@pikku/core/queue'
5
+ import type { JobOptions } from '@pikku/core/ecosystem/queue'
5
6
  import { mapBullJobToQueueJob } from './utils.js'
6
7
 
7
8
  export const mapPikkuJobToBull = (options?: JobOptions): JobsOptions => {
@@ -6,14 +6,14 @@ import type {
6
6
  PikkuWorkerConfig,
7
7
  QueueConfigMapping,
8
8
  ConfigValidationResult,
9
- } from '@pikku/core/queue'
9
+ } from '@pikku/core/ecosystem/queue'
10
+ import { runQueueJob } from '@pikku/core/queue'
10
11
  import {
11
12
  registerQueueWorkers,
12
- runQueueJob,
13
13
  QueueJobFailedError,
14
14
  QueueJobDiscardedError,
15
- } from '@pikku/core/queue'
16
- import { pikkuState } from '@pikku/core/internal'
15
+ } from '@pikku/core/ecosystem/queue'
16
+ import { pikkuState } from '@pikku/core/ecosystem'
17
17
  import { mapBullJobToQueueJob } from './utils.js'
18
18
 
19
19
  export const mapPikkuWorkerToBull = (
@@ -1,13 +1,15 @@
1
1
  import type { ConnectionOptions } from 'bullmq'
2
2
  import { Queue, Worker } from 'bullmq'
3
+ import type { CoreUserSession } from '@pikku/core'
3
4
  import type {
4
5
  ScheduledTaskInfo,
5
6
  ScheduledTaskSummary,
6
- CoreUserSession,
7
- } from '@pikku/core'
8
- import { SchedulerService, parseDurationString } from '@pikku/core'
9
- import { pikkuState } from '@pikku/core/internal'
10
- import { runScheduledTask, getScheduledTasks } from '@pikku/core/scheduler'
7
+ } from '@pikku/core/ecosystem/services'
8
+ import { SchedulerService } from '@pikku/core'
9
+ import { parseDurationString } from '@pikku/core/ecosystem/types'
10
+ import { pikkuState } from '@pikku/core/ecosystem'
11
+ import { runScheduledTask } from '@pikku/core/scheduler'
12
+ import { getScheduledTasks } from '@pikku/core/ecosystem/scheduler'
11
13
 
12
14
  /**
13
15
  * Data stored in scheduled job
package/src/index.ts CHANGED
@@ -11,10 +11,9 @@ export { BullQueueWorkers } from './bull-queue-worker.js'
11
11
  export { BullSchedulerService } from './bull-scheduler-service.js'
12
12
 
13
13
  // Re-export core queue types for convenience
14
+ export type { QueueService, QueueJob } from '@pikku/core/queue'
14
15
  export type {
15
- QueueService,
16
16
  PikkuWorkerConfig,
17
17
  PikkuJobConfig,
18
- QueueJob,
19
18
  JobOptions,
20
- } from '@pikku/core/queue'
19
+ } from '@pikku/core/ecosystem/queue'