@tthr/vue 0.0.53 → 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 CHANGED
@@ -130,10 +130,8 @@ 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 them
134
- // Using bare module name (not # prefix which triggers Node subpath imports)
135
- nitroConfig.alias = nitroConfig.alias || {};
136
- nitroConfig.alias['tether-user-functions'] = `${nuxt.options.rootDir}/tether/functions`;
133
+ // Also inline the user's tether/functions directory so Nitro transpiles TypeScript
134
+ nitroConfig.externals.inline.push(`${nuxt.options.rootDir}/tether`);
137
135
  });
138
136
  // Generate a server plugin to auto-register cron handlers from tether/functions
139
137
  // This runs at build time and creates a plugin that imports user's functions
@@ -149,8 +147,10 @@ export default defineNuxtModule({
149
147
  import { defineNitroPlugin, registerCronHandler } from '@tthr/vue/nuxt/runtime/server/plugins/cron.js';
150
148
  import { useTetherServer } from '@tthr/vue/nuxt/runtime/server/utils/tether.js';
151
149
 
152
- // Import all functions from tether/functions using Nitro alias
153
- import * as tetherFunctions from 'tether-user-functions';
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';
154
154
 
155
155
  /**
156
156
  * Create a simple logger for function execution
package/nuxt/module.ts CHANGED
@@ -143,12 +143,6 @@ 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
-
152
146
  // Add Nitro plugin for cron WebSocket connection
153
147
  // This auto-connects to Tether when the server starts
154
148
  nuxt.hook('nitro:config' as any, (nitroConfig: any) => {
@@ -160,6 +154,9 @@ export default defineNuxtModule<TetherModuleOptions>({
160
154
  nitroConfig.externals = nitroConfig.externals || {};
161
155
  nitroConfig.externals.inline = nitroConfig.externals.inline || [];
162
156
  nitroConfig.externals.inline.push('@tthr/vue');
157
+
158
+ // Also inline the user's tether/functions directory so Nitro transpiles TypeScript
159
+ nitroConfig.externals.inline.push(`${nuxt.options.rootDir}/tether`);
163
160
  });
164
161
 
165
162
  // Generate a server plugin to auto-register cron handlers from tether/functions
@@ -176,8 +173,10 @@ export default defineNuxtModule<TetherModuleOptions>({
176
173
  import { defineNitroPlugin, registerCronHandler } from '@tthr/vue/nuxt/runtime/server/plugins/cron.js';
177
174
  import { useTetherServer } from '@tthr/vue/nuxt/runtime/server/utils/tether.js';
178
175
 
179
- // Import all functions from tether/functions using Nitro alias
180
- import * as tetherFunctions from 'tether-user-functions';
176
+ // Import all functions from tether/functions using relative path
177
+ // Generated plugin is at .nuxt/server/plugins/, so ../../../ gets to project root
178
+ // Using .ts extension explicitly for Nitro's bundler to resolve
179
+ import * as tetherFunctions from '../../../tether/functions/index.ts';
181
180
 
182
181
  /**
183
182
  * Create a simple logger for function execution
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tthr/vue",
3
- "version": "0.0.53",
3
+ "version": "0.0.55",
4
4
  "description": "Tether Vue/Nuxt SDK",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",