@tthr/vue 0.0.52 → 0.0.53
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/nuxt/module.js +4 -3
- package/nuxt/module.ts +6 -5
- package/package.json +1 -1
package/nuxt/module.js
CHANGED
|
@@ -130,9 +130,10 @@ export default defineNuxtModule({
|
|
|
130
130
|
nitroConfig.externals = nitroConfig.externals || {};
|
|
131
131
|
nitroConfig.externals.inline = nitroConfig.externals.inline || [];
|
|
132
132
|
nitroConfig.externals.inline.push('@tthr/vue');
|
|
133
|
-
// Add alias for user's tether functions so Nitro can resolve
|
|
133
|
+
// Add alias for user's tether functions so Nitro can resolve them
|
|
134
|
+
// Using bare module name (not # prefix which triggers Node subpath imports)
|
|
134
135
|
nitroConfig.alias = nitroConfig.alias || {};
|
|
135
|
-
nitroConfig.alias['
|
|
136
|
+
nitroConfig.alias['tether-user-functions'] = `${nuxt.options.rootDir}/tether/functions`;
|
|
136
137
|
});
|
|
137
138
|
// Generate a server plugin to auto-register cron handlers from tether/functions
|
|
138
139
|
// This runs at build time and creates a plugin that imports user's functions
|
|
@@ -149,7 +150,7 @@ import { defineNitroPlugin, registerCronHandler } from '@tthr/vue/nuxt/runtime/s
|
|
|
149
150
|
import { useTetherServer } from '@tthr/vue/nuxt/runtime/server/utils/tether.js';
|
|
150
151
|
|
|
151
152
|
// Import all functions from tether/functions using Nitro alias
|
|
152
|
-
import * as tetherFunctions from '
|
|
153
|
+
import * as tetherFunctions from 'tether-user-functions';
|
|
153
154
|
|
|
154
155
|
/**
|
|
155
156
|
* Create a simple logger for function execution
|
package/nuxt/module.ts
CHANGED
|
@@ -143,6 +143,12 @@ export default defineNuxtModule<TetherModuleOptions>({
|
|
|
143
143
|
nuxt.options.build.transpile = nuxt.options.build.transpile || [];
|
|
144
144
|
nuxt.options.build.transpile.push('@tthr/vue');
|
|
145
145
|
|
|
146
|
+
// Set up Nitro alias for user's tether functions BEFORE hooks run
|
|
147
|
+
// This must be set early so Nitro can resolve the import during bundling
|
|
148
|
+
nuxt.options.nitro = nuxt.options.nitro || {};
|
|
149
|
+
nuxt.options.nitro.alias = nuxt.options.nitro.alias || {};
|
|
150
|
+
nuxt.options.nitro.alias['tether-user-functions'] = `${nuxt.options.rootDir}/tether/functions`;
|
|
151
|
+
|
|
146
152
|
// Add Nitro plugin for cron WebSocket connection
|
|
147
153
|
// This auto-connects to Tether when the server starts
|
|
148
154
|
nuxt.hook('nitro:config' as any, (nitroConfig: any) => {
|
|
@@ -154,11 +160,6 @@ export default defineNuxtModule<TetherModuleOptions>({
|
|
|
154
160
|
nitroConfig.externals = nitroConfig.externals || {};
|
|
155
161
|
nitroConfig.externals.inline = nitroConfig.externals.inline || [];
|
|
156
162
|
nitroConfig.externals.inline.push('@tthr/vue');
|
|
157
|
-
|
|
158
|
-
// Add alias for user's tether functions so Nitro can resolve them
|
|
159
|
-
// Using bare module name (not # prefix which triggers Node subpath imports)
|
|
160
|
-
nitroConfig.alias = nitroConfig.alias || {};
|
|
161
|
-
nitroConfig.alias['tether-user-functions'] = `${nuxt.options.rootDir}/tether/functions`;
|
|
162
163
|
});
|
|
163
164
|
|
|
164
165
|
// Generate a server plugin to auto-register cron handlers from tether/functions
|