Skip to content

Commit

Permalink
feat(storage-uploadthing)!: upgrade to v7 (#8346)
Browse files Browse the repository at this point in the history
Upgrade uploadthing to v7

The `options` that can be passed to the plugin now mirror the
`UTApiOptions` of v7.

The most notable change is to pass `token` with
`process.env.UPLOADTHING_TOKEN` instead of `apiKey` with
`process.env.UPLOADTHING_SECRET`.

```diff
options: {
- apiKey: process.env.UPLOADTHING_SECRET,
+ token: process.env.UPLOADTHING_TOKEN,
  acl: 'public-read',
},
  • Loading branch information
denolfe authored Nov 13, 2024
1 parent afd69c4 commit 4690cd8
Show file tree
Hide file tree
Showing 6 changed files with 312 additions and 120 deletions.
2 changes: 1 addition & 1 deletion packages/storage-uploadthing/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default buildConfig({
[mediaSlug]: true,
},
options: {
apiKey: process.env.UPLOADTHING_SECRET,
token: process.env.UPLOADTHING_TOKEN,
acl: 'public-read',
},
}),
Expand Down
2 changes: 1 addition & 1 deletion packages/storage-uploadthing/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
},
"dependencies": {
"@payloadcms/plugin-cloud-storage": "workspace:*",
"uploadthing": "^6.10.1"
"uploadthing": "7.3.0"
},
"devDependencies": {
"payload": "workspace:*"
Expand Down
80 changes: 45 additions & 35 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"test": "pnpm -C \"../\" run test",
"test:e2e": "pnpm -C \"../\" run test:e2e",
"test:int": "pnpm -C \"../\" run test:int",
"typecheck": "pnpm turbo build --filter test && tsc --project tsconfig.typecheck.json"
"typecheck": "pnpm turbo build --filter payload-test-suite && tsc --project tsconfig.typecheck.json"
},
"lint-staged": {
"**/package.json": "sort-package-json",
Expand Down Expand Up @@ -81,7 +81,6 @@
"tempy": "^1.0.1",
"ts-essentials": "10.0.3",
"typescript": "5.6.3",
"uploadthing": "^6.10.1",
"uuid": "10.0.0"
},
"overrides": {
Expand Down
2 changes: 1 addition & 1 deletion test/storage-uploadthing/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export default buildConfigWithDefaults({
[mediaSlug]: true,
},
options: {
apiKey: process.env.UPLOADTHING_SECRET,
token: process.env.UPLOADTHING_TOKEN,
acl: 'public-read',
},
}),
Expand Down
Loading

0 comments on commit 4690cd8

Please sign in to comment.