mirror of
https://github.com/ArthurDanjou/trpc-nuxt.git
synced 2026-01-14 20:19:33 +01:00
Compare commits
16 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
019bb20e50 | ||
|
|
695ce4c56e | ||
|
|
38649b7023 | ||
|
|
5cfef32baa | ||
|
|
8497289c65 | ||
|
|
224c4b317b | ||
|
|
d5d6780ca8 | ||
|
|
252d0f6692 | ||
|
|
d022710591 | ||
|
|
a926968f13 | ||
|
|
a8eba5ab8d | ||
|
|
5871528d67 | ||
|
|
def9d0b19d | ||
|
|
34f50fc4d6 | ||
|
|
9fe1469eba | ||
|
|
e48d7cd42c |
@@ -15,6 +15,8 @@ End-to-end typesafe APIs with [tRPC.io](https://trpc.io/) in Nuxt applications.
|
||||
</figure>
|
||||
</p>
|
||||
|
||||
**⚠️ Currently works on Node v16 until [this issue](https://github.com/trpc/trpc/issues/2420) gets fixed.**
|
||||
|
||||
## Install
|
||||
|
||||
```bash
|
||||
|
||||
25
package.json
25
package.json
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"name": "trpc-nuxt",
|
||||
"type": "module",
|
||||
"version": "0.2.3",
|
||||
"packageManager": "pnpm@7.1.1",
|
||||
"version": "0.2.6",
|
||||
"packageManager": "pnpm@7.5.0",
|
||||
"license": "MIT",
|
||||
"main": "./dist/module.cjs",
|
||||
"types": "./dist/types.d.ts",
|
||||
@@ -32,27 +32,27 @@
|
||||
"prepare": "nuxi prepare playground"
|
||||
},
|
||||
"dependencies": {
|
||||
"@nuxt/kit": "^3.0.0-rc.4",
|
||||
"@trpc/client": "^9.26.0",
|
||||
"@trpc/server": "^9.26.0",
|
||||
"@vueuse/core": "^8.9.3",
|
||||
"@vueuse/nuxt": "^8.9.3",
|
||||
"@nuxt/kit": "3.0.0-rc.8",
|
||||
"@trpc/client": "^9.27.1",
|
||||
"@trpc/server": "^9.27.1",
|
||||
"@vueuse/core": "^9.1.0",
|
||||
"@vueuse/nuxt": "^9.1.0",
|
||||
"dedent": "^0.7.0",
|
||||
"defu": "^6.0.0",
|
||||
"h3": "^0.7.10",
|
||||
"ohash": "^0.1.5",
|
||||
"pathe": "^0.3.0",
|
||||
"ufo": "^0.8.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@antfu/eslint-config": "^0.23.1",
|
||||
"@antfu/ni": "^0.16.2",
|
||||
"@nuxt/module-builder": "latest",
|
||||
"@nuxt/module-builder": "^0.1.7",
|
||||
"@types/dedent": "^0.7.0",
|
||||
"bumpp": "^7.2.0",
|
||||
"eslint": "^8.14.0",
|
||||
"nuxt": "3.0.0-rc.4",
|
||||
"ohash": "^0.1.0",
|
||||
"pnpm": "^7.1.1",
|
||||
"nuxt": "3.0.0-rc.8",
|
||||
"pnpm": "^7.5.0",
|
||||
"trpc-nuxt": "workspace:*",
|
||||
"zod": "^3.16.0"
|
||||
},
|
||||
@@ -61,5 +61,8 @@
|
||||
"rules": {
|
||||
"no-console": "warn"
|
||||
}
|
||||
},
|
||||
"volta": {
|
||||
"node": "16.14.2"
|
||||
}
|
||||
}
|
||||
|
||||
2907
pnpm-lock.yaml
generated
2907
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@@ -13,10 +13,13 @@ export default defineNuxtPlugin((nuxtApp) => {
|
||||
const client = trpc.createTRPCClient<AppRouter>({
|
||||
url: `${config.baseURL}${config.endpoint}`,
|
||||
headers: () => {
|
||||
return {
|
||||
...unref(otherHeaders),
|
||||
...headers,
|
||||
if (nuxtApp.ssrContext) {
|
||||
return {
|
||||
...unref(otherHeaders),
|
||||
...headers,
|
||||
}
|
||||
}
|
||||
return {}
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user