tthr 0.2.1 → 0.2.2
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/dist/index.js +6 -34
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -161,41 +161,9 @@ async function bundleFunctionFile(filePath) {
|
|
|
161
161
|
format: "esm",
|
|
162
162
|
platform: "neutral",
|
|
163
163
|
write: false,
|
|
164
|
-
// Target modern JS — the Deno runtime handles it
|
|
165
164
|
target: "es2022",
|
|
166
|
-
//
|
|
167
|
-
|
|
168
|
-
name: "tether-shims",
|
|
169
|
-
setup(build2) {
|
|
170
|
-
build2.onResolve({ filter: /^@tthr\/server$/ }, () => ({
|
|
171
|
-
path: "@tthr/server",
|
|
172
|
-
namespace: "tether-shim"
|
|
173
|
-
}));
|
|
174
|
-
build2.onLoad({ filter: /.*/, namespace: "tether-shim" }, () => ({
|
|
175
|
-
contents: `
|
|
176
|
-
export function query(def) { return def; }
|
|
177
|
-
export function mutation(def) { return def; }
|
|
178
|
-
export { z } from "zod";
|
|
179
|
-
`,
|
|
180
|
-
loader: "js",
|
|
181
|
-
resolveDir: path.dirname(filePath)
|
|
182
|
-
}));
|
|
183
|
-
build2.onResolve({ filter: /^@tthr\/client$/ }, () => ({
|
|
184
|
-
path: "@tthr/client",
|
|
185
|
-
namespace: "tether-client-shim"
|
|
186
|
-
}));
|
|
187
|
-
build2.onLoad({ filter: /.*/, namespace: "tether-client-shim" }, () => ({
|
|
188
|
-
contents: `
|
|
189
|
-
export function createDatabaseProxy() { return {}; }
|
|
190
|
-
`,
|
|
191
|
-
loader: "js"
|
|
192
|
-
}));
|
|
193
|
-
build2.onResolve({ filter: /^zod$/ }, () => ({
|
|
194
|
-
path: "https://esm.sh/zod@3.24.4",
|
|
195
|
-
external: true
|
|
196
|
-
}));
|
|
197
|
-
}
|
|
198
|
-
}],
|
|
165
|
+
// Keep Tether packages and zod as external — Deno resolves them via import map
|
|
166
|
+
external: ["@tthr/server", "@tthr/client", "zod"],
|
|
199
167
|
logLevel: "silent"
|
|
200
168
|
});
|
|
201
169
|
if (result.errors.length > 0) {
|
|
@@ -232,6 +200,7 @@ async function deployFunctionsToServer(projectId, token, functionsDir, environme
|
|
|
232
200
|
const bundledSource = await bundleFunctionFile(filePath);
|
|
233
201
|
for (const fn of parsedFunctions) {
|
|
234
202
|
fn.source = bundledSource;
|
|
203
|
+
fn.rawSource = source;
|
|
235
204
|
}
|
|
236
205
|
functions.push(...parsedFunctions);
|
|
237
206
|
}
|
|
@@ -259,6 +228,7 @@ async function deployFunctionsToServer(projectId, token, functionsDir, environme
|
|
|
259
228
|
name: fn.name,
|
|
260
229
|
type: fn.type,
|
|
261
230
|
source: fn.source,
|
|
231
|
+
raw_source: fn.rawSource,
|
|
262
232
|
args: fn.args
|
|
263
233
|
}))
|
|
264
234
|
})
|
|
@@ -487,6 +457,8 @@ function parseFunctions(moduleName, source) {
|
|
|
487
457
|
file: `${moduleName}.ts`,
|
|
488
458
|
source: "",
|
|
489
459
|
// Set by caller from bundled output
|
|
460
|
+
rawSource: "",
|
|
461
|
+
// Set by caller from raw file content
|
|
490
462
|
args
|
|
491
463
|
});
|
|
492
464
|
}
|