nuxt-processor 1.0.0 → 1.1.0

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/dist/cli.cjs CHANGED
@@ -5,7 +5,7 @@ const node_fs = require('node:fs');
5
5
  const pathe = require('pathe');
6
6
  const citty = require('citty');
7
7
  const kit = require('@nuxt/kit');
8
- const logger = require('./shared/nuxt-processor.BbReXIMn.cjs');
8
+ const logger = require('./shared/nuxt-processor.BrcyjXeL.cjs');
9
9
  const promises = require('node:readline/promises');
10
10
  const node_process = require('node:process');
11
11
  require('consola');
package/dist/cli.mjs CHANGED
@@ -3,7 +3,7 @@ import { existsSync, readFileSync, writeFileSync } from 'node:fs';
3
3
  import { resolve } from 'pathe';
4
4
  import { createMain, defineCommand } from 'citty';
5
5
  import { loadNuxtConfig } from '@nuxt/kit';
6
- import { l as logger, v as version, d as description, n as name } from './shared/nuxt-processor.DCy15jfQ.mjs';
6
+ import { l as logger, v as version, d as description, n as name } from './shared/nuxt-processor.CEsc8O4P.mjs';
7
7
  import { createInterface } from 'node:readline/promises';
8
8
  import { stdout, stdin } from 'node:process';
9
9
  import 'consola';
package/dist/module.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  const kit = require('@nuxt/kit');
4
- const logger = require('./shared/nuxt-processor.BbReXIMn.cjs');
4
+ const logger = require('./shared/nuxt-processor.BrcyjXeL.cjs');
5
5
  const node_path = require('node:path');
6
6
  const fg = require('fast-glob');
7
7
  require('consola');
package/dist/module.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nuxt-processor",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "compatibility": {
5
5
  "nuxt": "^4.0.0 || ^3.0.0"
6
6
  },
package/dist/module.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { useNuxt, createResolver, defineNuxtModule, addTemplate, addServerPlugin, addTypeTemplate } from '@nuxt/kit';
2
- import { l as logger, c as configKey, a as compatibility, v as version, n as name } from './shared/nuxt-processor.DCy15jfQ.mjs';
2
+ import { l as logger, c as configKey, a as compatibility, v as version, n as name } from './shared/nuxt-processor.CEsc8O4P.mjs';
3
3
  import { relative } from 'node:path';
4
4
  import fg from 'fast-glob';
5
5
  import 'consola';
@@ -1,18 +1,7 @@
1
1
  import type { Job, JobsOptions, QueueOptions, WorkerOptions, Processor } from 'bullmq';
2
2
  import { Queue, Worker } from 'bullmq';
3
3
  export declare function $workers(): {
4
- setConnection: (connection: string | import("bullmq").ConnectionOptions | (import("ioredis").CommonRedisOptions & import("ioredis").SentinelConnectionOptions & Partial<{
5
- port: number;
6
- host?: string | undefined | undefined;
7
- family?: number | undefined | undefined;
8
- } & {
9
- path: string;
10
- }> & {
11
- disconnectTimeout?: number | undefined;
12
- tls?: import("node:tls").ConnectionOptions | undefined;
13
- } & {
14
- url?: string;
15
- })) => void;
4
+ setConnection: (connection: string | import("bullmq").ConnectionOptions) => void;
16
5
  createQueue: <DataTypeOrJob = any, DefaultResultType = any, DefaultNameType extends string = string>(name: DefaultNameType, options?: Omit<QueueOptions, "connection"> & {
17
6
  defaultJobOptions?: JobsOptions;
18
7
  }) => Queue<DataTypeOrJob, DefaultResultType, DefaultNameType>;
@@ -1,5 +1,4 @@
1
1
  import { Queue, Worker } from "bullmq";
2
- import IORedis from "ioredis";
3
2
  const registry = {
4
3
  connection: void 0,
5
4
  queues: [],
@@ -8,16 +7,20 @@ const registry = {
8
7
  export function $workers() {
9
8
  function setConnection(connection) {
10
9
  if (connection && typeof connection === "object" && "url" in connection && connection.url) {
11
- const { url, ...rest } = connection;
12
- const opts = { ...rest, maxRetriesPerRequest: null };
13
- registry.connection = new IORedis(url, opts);
10
+ registry.connection = connection;
14
11
  } else if (typeof connection === "string") {
15
- registry.connection = new IORedis(connection, { maxRetriesPerRequest: null });
12
+ registry.connection = { url: connection };
16
13
  } else {
17
- const normalized = { ...connection, maxRetriesPerRequest: null };
18
- registry.connection = normalized;
14
+ registry.connection = connection;
19
15
  }
20
16
  }
17
+ function getWorkerConnection() {
18
+ if (!registry.connection) return registry.connection;
19
+ return {
20
+ ...registry.connection,
21
+ maxRetriesPerRequest: null
22
+ };
23
+ }
21
24
  function createQueue(name, options) {
22
25
  const queue = new Queue(name, {
23
26
  connection: registry.connection,
@@ -28,7 +31,7 @@ export function $workers() {
28
31
  }
29
32
  function createWorker(name, processor, options) {
30
33
  const worker = new Worker(name, processor, {
31
- connection: registry.connection,
34
+ connection: getWorkerConnection(),
32
35
  ...options,
33
36
  autorun: false
34
37
  });
@@ -3,7 +3,7 @@
3
3
  const consola = require('consola');
4
4
 
5
5
  const name = "nuxt-processor";
6
- const version = "1.0.0";
6
+ const version = "1.1.0";
7
7
  const description = "Nuxt Processor";
8
8
  const configKey = "processor";
9
9
  const compatibility = {
@@ -1,7 +1,7 @@
1
1
  import { createConsola } from 'consola';
2
2
 
3
3
  const name = "nuxt-processor";
4
- const version = "1.0.0";
4
+ const version = "1.1.0";
5
5
  const description = "Nuxt Processor";
6
6
  const configKey = "processor";
7
7
  const compatibility = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nuxt-processor",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "Nuxt Processor",
5
5
  "repository": "https://github.com/aidanhibbard/nuxt-processor",
6
6
  "license": "MIT",
@@ -54,7 +54,6 @@
54
54
  "citty": "^0.2.2",
55
55
  "consola": "^3.4.2",
56
56
  "fast-glob": "^3.3.3",
57
- "ioredis": "^5.10.1",
58
57
  "pathe": "^2.0.3"
59
58
  },
60
59
  "devDependencies": {