@tthr/vue 0.0.35 → 0.0.37

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
@@ -18,7 +18,7 @@
18
18
  * Environment variables (in .env):
19
19
  * - TETHER_API_KEY: Your project's API key (required, kept server-side)
20
20
  */
21
- import { defineNuxtModule, addPlugin, createResolver, addImports, addComponent, addServerHandler, addServerImports } from '@nuxt/kit';
21
+ import { defineNuxtModule, addPlugin, createResolver, addImports, addComponent, addServerHandler, addServerImports, addTemplate } from '@nuxt/kit';
22
22
  export default defineNuxtModule({
23
23
  meta: {
24
24
  name: '@tthr/vue',
@@ -117,12 +117,24 @@ export default defineNuxtModule({
117
117
  // Ensure the runtime files are transpiled
118
118
  nuxt.options.build.transpile = nuxt.options.build.transpile || [];
119
119
  nuxt.options.build.transpile.push('@tthr/vue');
120
+ // Create a virtual wrapper for the cron plugin to avoid absolute path issues in production
121
+ // The wrapper imports from the package export which gets resolved correctly at build time
122
+ const cronPluginWrapper = addTemplate({
123
+ filename: 'tether/cron-plugin.mjs',
124
+ write: true,
125
+ getContents: () => `
126
+ // Virtual wrapper for Tether cron plugin
127
+ // This ensures the import path is resolved correctly in production builds
128
+ import cronPlugin from '@tthr/vue/nuxt/cron-plugin';
129
+ export default cronPlugin;
130
+ `.trim(),
131
+ });
120
132
  // Add Nitro plugin for cron WebSocket connection
121
133
  // This auto-connects to Tether when the server starts
122
- // Use .js extension to ensure the pre-built file is used
123
134
  nuxt.hook('nitro:config', (nitroConfig) => {
124
135
  nitroConfig.plugins = nitroConfig.plugins || [];
125
- nitroConfig.plugins.push(resolver.resolve('./runtime/server/plugins/cron.js'));
136
+ // Use the generated wrapper file instead of direct path
137
+ nitroConfig.plugins.push(cronPluginWrapper.dst);
126
138
  // Ensure Nitro inlines and transpiles the plugin from node_modules
127
139
  nitroConfig.externals = nitroConfig.externals || {};
128
140
  nitroConfig.externals.inline = nitroConfig.externals.inline || [];
@@ -130,4 +142,3 @@ export default defineNuxtModule({
130
142
  });
131
143
  },
132
144
  });
133
- //# sourceMappingURL=module.js.map
@@ -317,6 +317,7 @@ export default defineEventHandler(async (event) => {
317
317
 
318
318
  return { data: result };
319
319
  } catch (error) {
320
+ console.error(`[Tether] Function ${body.function} failed:`, error.message || error);
320
321
  throw createError({
321
322
  statusCode: 500,
322
323
  message: error.message || 'Function execution failed',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tthr/vue",
3
- "version": "0.0.35",
3
+ "version": "0.0.37",
4
4
  "description": "Tether Vue/Nuxt SDK",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -46,7 +46,7 @@
46
46
  "vue": "^3.0.0"
47
47
  },
48
48
  "scripts": {
49
- "build": "tsc",
49
+ "build": "tsc && tsc -p nuxt/tsconfig.json",
50
50
  "dev": "tsc --watch",
51
51
  "typecheck": "tsc --noEmit"
52
52
  }