@tthr/vue 0.0.54 → 0.0.55
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 +6 -7
- package/nuxt/module.ts +2 -1
- package/package.json +1 -1
package/nuxt/module.js
CHANGED
|
@@ -120,11 +120,6 @@ export default defineNuxtModule({
|
|
|
120
120
|
// Ensure the runtime files are transpiled
|
|
121
121
|
nuxt.options.build.transpile = nuxt.options.build.transpile || [];
|
|
122
122
|
nuxt.options.build.transpile.push('@tthr/vue');
|
|
123
|
-
// Set up Nitro alias for user's tether functions BEFORE hooks run
|
|
124
|
-
// This must be set early so Nitro can resolve the import during bundling
|
|
125
|
-
nuxt.options.nitro = nuxt.options.nitro || {};
|
|
126
|
-
nuxt.options.nitro.alias = nuxt.options.nitro.alias || {};
|
|
127
|
-
nuxt.options.nitro.alias['tether-user-functions'] = `${nuxt.options.rootDir}/tether/functions`;
|
|
128
123
|
// Add Nitro plugin for cron WebSocket connection
|
|
129
124
|
// This auto-connects to Tether when the server starts
|
|
130
125
|
nuxt.hook('nitro:config', (nitroConfig) => {
|
|
@@ -135,6 +130,8 @@ export default defineNuxtModule({
|
|
|
135
130
|
nitroConfig.externals = nitroConfig.externals || {};
|
|
136
131
|
nitroConfig.externals.inline = nitroConfig.externals.inline || [];
|
|
137
132
|
nitroConfig.externals.inline.push('@tthr/vue');
|
|
133
|
+
// Also inline the user's tether/functions directory so Nitro transpiles TypeScript
|
|
134
|
+
nitroConfig.externals.inline.push(`${nuxt.options.rootDir}/tether`);
|
|
138
135
|
});
|
|
139
136
|
// Generate a server plugin to auto-register cron handlers from tether/functions
|
|
140
137
|
// This runs at build time and creates a plugin that imports user's functions
|
|
@@ -150,8 +147,10 @@ export default defineNuxtModule({
|
|
|
150
147
|
import { defineNitroPlugin, registerCronHandler } from '@tthr/vue/nuxt/runtime/server/plugins/cron.js';
|
|
151
148
|
import { useTetherServer } from '@tthr/vue/nuxt/runtime/server/utils/tether.js';
|
|
152
149
|
|
|
153
|
-
// Import all functions from tether/functions using
|
|
154
|
-
|
|
150
|
+
// Import all functions from tether/functions using relative path
|
|
151
|
+
// Generated plugin is at .nuxt/server/plugins/, so ../../../ gets to project root
|
|
152
|
+
// Using .ts extension explicitly for Nitro's bundler to resolve
|
|
153
|
+
import * as tetherFunctions from '../../../tether/functions/index.ts';
|
|
155
154
|
|
|
156
155
|
/**
|
|
157
156
|
* Create a simple logger for function execution
|
package/nuxt/module.ts
CHANGED
|
@@ -175,7 +175,8 @@ import { useTetherServer } from '@tthr/vue/nuxt/runtime/server/utils/tether.js';
|
|
|
175
175
|
|
|
176
176
|
// Import all functions from tether/functions using relative path
|
|
177
177
|
// Generated plugin is at .nuxt/server/plugins/, so ../../../ gets to project root
|
|
178
|
-
|
|
178
|
+
// Using .ts extension explicitly for Nitro's bundler to resolve
|
|
179
|
+
import * as tetherFunctions from '../../../tether/functions/index.ts';
|
|
179
180
|
|
|
180
181
|
/**
|
|
181
182
|
* Create a simple logger for function execution
|