@tthr/vue 0.0.53 → 0.0.54

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
@@ -120,6 +120,11 @@ 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`;
123
128
  // Add Nitro plugin for cron WebSocket connection
124
129
  // This auto-connects to Tether when the server starts
125
130
  nuxt.hook('nitro:config', (nitroConfig) => {
@@ -130,10 +135,6 @@ export default defineNuxtModule({
130
135
  nitroConfig.externals = nitroConfig.externals || {};
131
136
  nitroConfig.externals.inline = nitroConfig.externals.inline || [];
132
137
  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`;
137
138
  });
138
139
  // Generate a server plugin to auto-register cron handlers from tether/functions
139
140
  // This runs at build time and creates a plugin that imports user's functions
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,9 @@ 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
+ import * as tetherFunctions from '../../../tether/functions/index';
181
179
 
182
180
  /**
183
181
  * 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.54",
4
4
  "description": "Tether Vue/Nuxt SDK",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",