nuxt-processor 0.0.8 → 0.0.9

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/README.md CHANGED
@@ -33,7 +33,7 @@ Note: This package is under very active development! Please consider creating is
33
33
  ## Install
34
34
 
35
35
  ```bash
36
- npm i -D nuxt-processor
36
+ npx nuxi@latest module add nuxt-processor
37
37
  ```
38
38
 
39
39
  Add the module in `nuxt.config.ts` and set your Redis connection.
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.CSspK4r-.cjs');
11
+ const _package = require('./shared/nuxt-processor.gTQ3Cgq_.cjs');
12
12
 
13
13
  const ensureNuxtProject = async (args) => {
14
14
  const dir = pathe.resolve(args.dir);
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.Blgdjku5.mjs';
9
+ import { v as version, d as description, n as name } from './shared/nuxt-processor.DyQoQGHF.mjs';
10
10
 
11
11
  const ensureNuxtProject = async (args) => {
12
12
  const dir = resolve(args.dir);
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.CSspK4r-.cjs');
4
+ const _package = require('./shared/nuxt-processor.gTQ3Cgq_.cjs');
5
5
  const node_path = require('node:path');
6
6
  const fg = require('fast-glob');
7
7
 
@@ -47,6 +47,19 @@ const module$1 = kit.defineNuxtModule({
47
47
  },
48
48
  async setup(_options, nuxt) {
49
49
  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)));
50
+ const nitroPlugin = `
51
+ import { $workers } from '#processor-utils'
52
+
53
+ export default defineNitroPlugin(() => {
54
+ $workers().setConnection(${JSON.stringify(_options.redis)})
55
+ })
56
+ `;
57
+ const tpl = kit.addTemplate({
58
+ filename: "0.processor-nuxt-plugin.ts",
59
+ write: true,
60
+ getContents: () => nitroPlugin
61
+ });
62
+ kit.addServerPlugin(tpl.dst);
50
63
  function generateWorkersEntryContent(workerFiles) {
51
64
  const redisInline = JSON.stringify(_options.redis ?? {});
52
65
  const toImportArray = workerFiles.map((id) => `() => import(${JSON.stringify(id)})`).join(",\n ");
package/dist/module.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nuxt-processor",
3
- "version": "0.0.8",
3
+ "version": "0.0.9",
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, addTypeTemplate } from '@nuxt/kit';
2
- import { c as configKey, a as compatibility, v as version, n as name } from './shared/nuxt-processor.Blgdjku5.mjs';
1
+ import { useNuxt, createResolver, defineNuxtModule, addTemplate, addServerPlugin, addTypeTemplate } from '@nuxt/kit';
2
+ import { c as configKey, a as compatibility, v as version, n as name } from './shared/nuxt-processor.DyQoQGHF.mjs';
3
3
  import { relative } from 'node:path';
4
4
  import fg from 'fast-glob';
5
5
 
@@ -40,6 +40,19 @@ const module = defineNuxtModule({
40
40
  },
41
41
  async setup(_options, nuxt) {
42
42
  const { resolve } = createResolver(import.meta.url);
43
+ const nitroPlugin = `
44
+ import { $workers } from '#processor-utils'
45
+
46
+ export default defineNitroPlugin(() => {
47
+ $workers().setConnection(${JSON.stringify(_options.redis)})
48
+ })
49
+ `;
50
+ const tpl = addTemplate({
51
+ filename: "0.processor-nuxt-plugin.ts",
52
+ write: true,
53
+ getContents: () => nitroPlugin
54
+ });
55
+ addServerPlugin(tpl.dst);
43
56
  function generateWorkersEntryContent(workerFiles) {
44
57
  const redisInline = JSON.stringify(_options.redis ?? {});
45
58
  const toImportArray = workerFiles.map((id) => `() => import(${JSON.stringify(id)})`).join(",\n ");
@@ -1,5 +1,5 @@
1
1
  const name = "nuxt-processor";
2
- const version = "0.0.8";
2
+ const version = "0.0.9";
3
3
  const description = "Nuxt Processor";
4
4
  const configKey = "processor";
5
5
  const compatibility = {
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  const name = "nuxt-processor";
4
- const version = "0.0.8";
4
+ const version = "0.0.9";
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": "0.0.8",
3
+ "version": "0.0.9",
4
4
  "description": "Nuxt Processor",
5
5
  "repository": "https://github.com/aidanhibbard/nuxt-processor",
6
6
  "license": "MIT",