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 +1 -1
- package/dist/cli.mjs +1 -1
- package/dist/module.cjs +1 -1
- package/dist/module.json +1 -1
- package/dist/module.mjs +1 -1
- package/dist/runtime/server/utils/workers.d.ts +1 -12
- package/dist/runtime/server/utils/workers.js +11 -8
- package/dist/shared/{nuxt-processor.BbReXIMn.cjs → nuxt-processor.BrcyjXeL.cjs} +1 -1
- package/dist/shared/{nuxt-processor.DCy15jfQ.mjs → nuxt-processor.CEsc8O4P.mjs} +1 -1
- package/package.json +1 -2
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.
|
|
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.
|
|
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.
|
|
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
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.
|
|
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
|
|
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
|
-
|
|
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 =
|
|
12
|
+
registry.connection = { url: connection };
|
|
16
13
|
} else {
|
|
17
|
-
|
|
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:
|
|
34
|
+
connection: getWorkerConnection(),
|
|
32
35
|
...options,
|
|
33
36
|
autorun: false
|
|
34
37
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nuxt-processor",
|
|
3
|
-
"version": "1.
|
|
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": {
|