Skip to content

Commit cd82c7a

Browse files
Merge e7484ab into a7eab3e
2 parents a7eab3e + e7484ab commit cd82c7a

File tree

12 files changed

+154
-117
lines changed

12 files changed

+154
-117
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"uploadthing": patch
3+
"@uploadthing/shared": patch
4+
---
5+
6+
chore: bump internal effect version

.changeset/six-dodos-brush.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@uploadthing/nuxt": patch
3+
---
4+
5+
fix module options not honored due to static analysis

examples/backend-adapters/server/package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,15 @@
1212
"dev:effect": "NODE_ENV=development PORT=3003 tsx watch src/effect-platform.ts"
1313
},
1414
"dependencies": {
15-
"@effect/platform": "0.69.8",
16-
"@effect/platform-node": "0.64.9",
15+
"@effect/platform": "0.69.24",
16+
"@effect/platform-node": "0.64.26",
1717
"@elysiajs/cors": "^1.1.1",
1818
"@fastify/cors": "^9.0.1",
1919
"@hono/node-server": "^1.8.2",
20+
"@sinclair/typebox": "^0.34.3",
2021
"cors": "^2.8.5",
2122
"dotenv": "^16.4.5",
22-
"effect": "3.10.3",
23+
"effect": "3.10.15",
2324
"elysia": "^1.1.16",
2425
"express": "^4.18.2",
2526
"fastify": "^4.26.1",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"@actions/github": "^6.0.0",
3939
"@changesets/changelog-github": "^0.5.0",
4040
"@changesets/cli": "^2.27.1",
41-
"@effect/vitest": "0.13.3",
41+
"@effect/vitest": "0.13.15",
4242
"@ianvs/prettier-plugin-sort-imports": "^4.2.1",
4343
"@manypkg/cli": "^0.21.3",
4444
"@playwright/test": "1.45.0",

packages/nuxt/src/module.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,13 @@ export default defineNuxtModule<ModuleOptions>({
4646
defaults: {
4747
routerPath: "~/server/uploadthing",
4848
injectStyles: true,
49+
// Need to manually set these for static analysis to work, even if they're set to undefined
50+
token: undefined,
51+
isDev: undefined,
52+
logLevel: undefined,
53+
logFormat: undefined,
54+
ingestUrl: undefined,
55+
callbackUrl: undefined,
4956
},
5057
async setup(options, nuxt) {
5158
const logger = useLogger("uploadthing");
Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,27 @@
1-
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
2-
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
31
import { useRuntimeConfig } from "#imports";
42
import { uploadRouter } from "#uploadthing-router";
53
import { defineEventHandler } from "h3";
64

75
import { createRouteHandler } from "uploadthing/h3";
6+
import type { RouteHandlerConfig } from "uploadthing/types";
7+
8+
const emptyStringToUndefined = (obj: Record<string, unknown>) => {
9+
const newObj: Record<string, unknown> = {};
10+
for (const key in obj) {
11+
if (obj[key] === "") newObj[key] = undefined;
12+
else newObj[key] = obj[key];
13+
}
14+
return newObj;
15+
};
816

917
export default defineEventHandler((event) => {
10-
const runtime = useRuntimeConfig() as any;
18+
const runtime = useRuntimeConfig() as { uploadthing?: RouteHandlerConfig };
19+
const config = emptyStringToUndefined(runtime.uploadthing ?? {});
20+
21+
console.log(config);
1122

1223
return createRouteHandler({
1324
router: uploadRouter,
14-
config: runtime.uploadthing,
25+
config,
1526
})(event);
1627
});

packages/shared/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
},
3737
"dependencies": {
3838
"@uploadthing/mime-types": "workspace:*",
39-
"effect": "3.10.3",
39+
"effect": "3.10.15",
4040
"sqids": "^0.3.0"
4141
},
4242
"devDependencies": {

packages/uploadthing/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,10 +150,10 @@
150150
"typecheck": "tsc --noEmit"
151151
},
152152
"dependencies": {
153-
"@effect/platform": "0.69.8",
153+
"@effect/platform": "0.69.24",
154154
"@uploadthing/mime-types": "workspace:*",
155155
"@uploadthing/shared": "workspace:*",
156-
"effect": "3.10.3"
156+
"effect": "3.10.15"
157157
},
158158
"devDependencies": {
159159
"@remix-run/server-runtime": "^2.12.0",

packages/uploadthing/src/sdk/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ export class UTApi {
9494
(e) => this.runtime.runPromise(e, signal ? { signal } : undefined),
9595
);
9696

97-
await this.runtime.dispose();
9897
return result;
9998
};
10099

playground-v6/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"dependencies": {
1212
"@uploadthing/react": "npm:@uploadthing/react@6",
1313
"clsx": "2.1.1",
14-
"effect": "3.10.3",
14+
"effect": "3.10.15",
1515
"next": "canary",
1616
"react": "18.3.1",
1717
"react-dom": "18.3.1",

0 commit comments

Comments
 (0)