nuxt-processor 0.0.4 → 0.0.5

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Aidan Hibbard
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/dist/cli.cjs CHANGED
@@ -8,7 +8,7 @@ const pathe = require('pathe');
8
8
  const consola = require('consola');
9
9
  const citty = require('citty');
10
10
  const kit = require('@nuxt/kit');
11
- const _package = require('./shared/nuxt-processor.BqsFQtIQ.cjs');
11
+ const _package = require('./shared/nuxt-processor.BkxOOpC5.cjs');
12
12
 
13
13
  const ensureNuxtProject = async (args) => {
14
14
  const dir = pathe.resolve(args.dir);
@@ -64,7 +64,7 @@ const main = citty.createMain({
64
64
  const updated = {
65
65
  ...pkg,
66
66
  scripts: {
67
- ...pkg.scripts || {},
67
+ ...pkg.scripts ?? {},
68
68
  "processor:dev": "nuxt-processor dev"
69
69
  }
70
70
  };
package/dist/cli.mjs CHANGED
@@ -6,7 +6,7 @@ import { resolve } from 'pathe';
6
6
  import { consola } from 'consola';
7
7
  import { createMain, defineCommand } from 'citty';
8
8
  import { loadNuxtConfig } from '@nuxt/kit';
9
- import { v as version, d as description, n as name } from './shared/nuxt-processor.BDPWtq8T.mjs';
9
+ import { v as version, d as description, n as name } from './shared/nuxt-processor.CIK-4owC.mjs';
10
10
 
11
11
  const ensureNuxtProject = async (args) => {
12
12
  const dir = resolve(args.dir);
@@ -62,7 +62,7 @@ const main = createMain({
62
62
  const updated = {
63
63
  ...pkg,
64
64
  scripts: {
65
- ...pkg.scripts || {},
65
+ ...pkg.scripts ?? {},
66
66
  "processor:dev": "nuxt-processor dev"
67
67
  }
68
68
  };
package/dist/module.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  const kit = require('@nuxt/kit');
4
- const _package = require('./shared/nuxt-processor.BqsFQtIQ.cjs');
4
+ const _package = require('./shared/nuxt-processor.BkxOOpC5.cjs');
5
5
  const node_path = require('node:path');
6
6
  const fg = require('fast-glob');
7
7
 
@@ -40,9 +40,8 @@ const module$1 = kit.defineNuxtModule({
40
40
  },
41
41
  workers: "server/workers"
42
42
  },
43
- async setup(_options, _nuxt) {
43
+ async setup(_options, nuxt) {
44
44
  const { resolve } = kit.createResolver((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('module.cjs', document.baseURI).href)));
45
- const buildDir = _nuxt.options.buildDir;
46
45
  function generateWorkersEntryContent(workerFiles) {
47
46
  const redisInline = JSON.stringify(_options.redis ?? {});
48
47
  const toImportArray = workerFiles.map((id) => `() => import(${JSON.stringify(id)})`).join(",\n ");
@@ -135,16 +134,15 @@ if (isMain) {
135
134
  export default { createWorkersApp }
136
135
  `;
137
136
  }
138
- _nuxt.options.alias = _nuxt.options.alias ?? {};
139
- _nuxt.options.alias["nuxt-processor"] = resolve("./runtime/server/handlers");
140
- _nuxt.options.alias["#processor"] = resolve("./runtime/server/handlers");
141
- _nuxt.options.alias["#processor-utils"] = resolve("./runtime/server/utils/workers");
142
- if (!_nuxt.options.alias["#bullmq"]) {
143
- _nuxt.options.alias["#bullmq"] = "bullmq";
137
+ nuxt.options.alias = nuxt.options.alias ?? {};
138
+ nuxt.options.alias["nuxt-processor"] = resolve("./runtime/server/handlers");
139
+ nuxt.options.alias["#processor"] = resolve("./runtime/server/handlers");
140
+ nuxt.options.alias["#processor-utils"] = resolve("./runtime/server/utils/workers");
141
+ if (!nuxt.options.alias["#bullmq"]) {
142
+ nuxt.options.alias["#bullmq"] = "bullmq";
144
143
  }
145
- const typesDtsPath = kit.addTemplate({
144
+ kit.addTypeTemplate({
146
145
  filename: "types/nuxt-processor.d.ts",
147
- write: true,
148
146
  getContents: () => `
149
147
  declare module 'nuxt-processor' {
150
148
  export { defineQueue } from '${resolve("./runtime/server/handlers/defineQueue")}'
@@ -164,10 +162,6 @@ declare module '#bullmq' {
164
162
  export * from 'bullmq'
165
163
  }
166
164
  `
167
- }).dst;
168
- _nuxt.hooks.hook("prepare:types", (opts) => {
169
- if (!opts.tsConfig.include) opts.tsConfig.include = [];
170
- opts.tsConfig.include.push(resolve(buildDir, typesDtsPath));
171
165
  });
172
166
  function createWorkersRollupPlugin() {
173
167
  const VIRTUAL_ID = "\0nuxt-processor-entry";
@@ -191,7 +185,7 @@ declare module '#bullmq' {
191
185
  if (id === VIRTUAL_ID) return VIRTUAL_ID;
192
186
  },
193
187
  load(id) {
194
- if (id === VIRTUAL_ID) return virtualCode || "export {}\n";
188
+ if (id === VIRTUAL_ID) return virtualCode ?? "export {}\n";
195
189
  },
196
190
  generateBundle() {
197
191
  if (!virtualCode || !entryRefId) return;
@@ -211,7 +205,7 @@ process.on('beforeExit', () => shutdown('beforeExit'))
211
205
  }
212
206
  };
213
207
  }
214
- _nuxt.hooks.hook("nitro:config", (nitroConfig) => {
208
+ nuxt.hooks.hook("nitro:config", (nitroConfig) => {
215
209
  nitroConfig.rollupConfig = nitroConfig.rollupConfig ?? {};
216
210
  const plugin = createWorkersRollupPlugin();
217
211
  const current = nitroConfig.rollupConfig.plugins;
package/dist/module.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nuxt-processor",
3
- "version": "0.0.4",
3
+ "version": "0.0.5",
4
4
  "compatibility": {
5
5
  "nuxt": "^4.0.0 || ^3.0.0"
6
6
  },
package/dist/module.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import { useNuxt, createResolver, defineNuxtModule, addTemplate } from '@nuxt/kit';
2
- import { c as configKey, a as compatibility, v as version, n as name } from './shared/nuxt-processor.BDPWtq8T.mjs';
1
+ import { useNuxt, createResolver, defineNuxtModule, addTypeTemplate } from '@nuxt/kit';
2
+ import { c as configKey, a as compatibility, v as version, n as name } from './shared/nuxt-processor.CIK-4owC.mjs';
3
3
  import { relative } from 'node:path';
4
4
  import fg from 'fast-glob';
5
5
 
@@ -33,9 +33,8 @@ const module = defineNuxtModule({
33
33
  },
34
34
  workers: "server/workers"
35
35
  },
36
- async setup(_options, _nuxt) {
36
+ async setup(_options, nuxt) {
37
37
  const { resolve } = createResolver(import.meta.url);
38
- const buildDir = _nuxt.options.buildDir;
39
38
  function generateWorkersEntryContent(workerFiles) {
40
39
  const redisInline = JSON.stringify(_options.redis ?? {});
41
40
  const toImportArray = workerFiles.map((id) => `() => import(${JSON.stringify(id)})`).join(",\n ");
@@ -128,16 +127,15 @@ if (isMain) {
128
127
  export default { createWorkersApp }
129
128
  `;
130
129
  }
131
- _nuxt.options.alias = _nuxt.options.alias ?? {};
132
- _nuxt.options.alias["nuxt-processor"] = resolve("./runtime/server/handlers");
133
- _nuxt.options.alias["#processor"] = resolve("./runtime/server/handlers");
134
- _nuxt.options.alias["#processor-utils"] = resolve("./runtime/server/utils/workers");
135
- if (!_nuxt.options.alias["#bullmq"]) {
136
- _nuxt.options.alias["#bullmq"] = "bullmq";
130
+ nuxt.options.alias = nuxt.options.alias ?? {};
131
+ nuxt.options.alias["nuxt-processor"] = resolve("./runtime/server/handlers");
132
+ nuxt.options.alias["#processor"] = resolve("./runtime/server/handlers");
133
+ nuxt.options.alias["#processor-utils"] = resolve("./runtime/server/utils/workers");
134
+ if (!nuxt.options.alias["#bullmq"]) {
135
+ nuxt.options.alias["#bullmq"] = "bullmq";
137
136
  }
138
- const typesDtsPath = addTemplate({
137
+ addTypeTemplate({
139
138
  filename: "types/nuxt-processor.d.ts",
140
- write: true,
141
139
  getContents: () => `
142
140
  declare module 'nuxt-processor' {
143
141
  export { defineQueue } from '${resolve("./runtime/server/handlers/defineQueue")}'
@@ -157,10 +155,6 @@ declare module '#bullmq' {
157
155
  export * from 'bullmq'
158
156
  }
159
157
  `
160
- }).dst;
161
- _nuxt.hooks.hook("prepare:types", (opts) => {
162
- if (!opts.tsConfig.include) opts.tsConfig.include = [];
163
- opts.tsConfig.include.push(resolve(buildDir, typesDtsPath));
164
158
  });
165
159
  function createWorkersRollupPlugin() {
166
160
  const VIRTUAL_ID = "\0nuxt-processor-entry";
@@ -184,7 +178,7 @@ declare module '#bullmq' {
184
178
  if (id === VIRTUAL_ID) return VIRTUAL_ID;
185
179
  },
186
180
  load(id) {
187
- if (id === VIRTUAL_ID) return virtualCode || "export {}\n";
181
+ if (id === VIRTUAL_ID) return virtualCode ?? "export {}\n";
188
182
  },
189
183
  generateBundle() {
190
184
  if (!virtualCode || !entryRefId) return;
@@ -204,7 +198,7 @@ process.on('beforeExit', () => shutdown('beforeExit'))
204
198
  }
205
199
  };
206
200
  }
207
- _nuxt.hooks.hook("nitro:config", (nitroConfig) => {
201
+ nuxt.hooks.hook("nitro:config", (nitroConfig) => {
208
202
  nitroConfig.rollupConfig = nitroConfig.rollupConfig ?? {};
209
203
  const plugin = createWorkersRollupPlugin();
210
204
  const current = nitroConfig.rollupConfig.plugins;
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  const name = "nuxt-processor";
4
- const version = "0.0.4";
4
+ const version = "0.0.5";
5
5
  const description = "Nuxt Processor";
6
6
  const configKey = "processor";
7
7
  const compatibility = {
@@ -1,5 +1,5 @@
1
1
  const name = "nuxt-processor";
2
- const version = "0.0.4";
2
+ const version = "0.0.5";
3
3
  const description = "Nuxt Processor";
4
4
  const configKey = "processor";
5
5
  const compatibility = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nuxt-processor",
3
- "version": "0.0.4",
3
+ "version": "0.0.5",
4
4
  "description": "Nuxt Processor",
5
5
  "repository": "https://github.com/aidanhibbard/nuxt-processor",
6
6
  "license": "MIT",