Compare commits

...

16 Commits

Author SHA1 Message Date
Robert Soriano
019bb20e50 release v0.2.6 2022-08-20 00:10:00 -07:00
Robert Soriano
695ce4c56e feat(deps): bump @trpc/server from 9.27.0 to 9.27.1 2022-08-20 00:09:39 -07:00
Robert Soriano
38649b7023 feat(deps): bump @trpc/client from 9.27.0 to 9.27.1 2022-08-20 00:09:17 -07:00
Robert Soriano
5cfef32baa release v0.2.5 2022-08-14 12:38:56 -07:00
Robert Soriano
8497289c65 update readme 2022-08-14 12:38:31 -07:00
Robert Soriano
224c4b317b move ohash to deps 2022-08-14 12:29:04 -07:00
Robert Soriano
d5d6780ca8 bump ohash 2022-08-14 12:28:03 -07:00
Robert Soriano
252d0f6692 feat(deps): bump vueuse from 8.9.3 to 9.1.0 2022-08-14 12:27:10 -07:00
Robert Soriano
d022710591 bump dev deps 2022-08-14 12:26:33 -07:00
Robert Soriano
a926968f13 feat(deps): bump @nuxt/kit from 3.0.0-rc.5 to 3.0.0-rc.8 2022-08-14 12:25:48 -07:00
Robert Soriano
a8eba5ab8d feat(deps): bump @trpc/server from 9.26.0 to 9.27.0 2022-08-14 12:25:14 -07:00
Robert Soriano
5871528d67 feat(deps): bump @trpc/client from 9.26.0 to 9.27.0 2022-08-14 12:24:52 -07:00
Robert Soriano
def9d0b19d volta pin node@16 2022-08-14 12:24:20 -07:00
Robert Soriano
34f50fc4d6 chore(deps): bump pnpm to 7.5.0 2022-07-14 19:04:19 -07:00
Robert Soriano
9fe1469eba release v0.2.4 2022-07-14 19:03:09 -07:00
Robert Soriano
e48d7cd42c feat(deps): bump @nuxt/kit from 3.0.0-rc.4 to 3.0.0-rc.5 2022-07-14 19:02:54 -07:00
4 changed files with 1396 additions and 1547 deletions

View File

@@ -15,6 +15,8 @@ End-to-end typesafe APIs with [tRPC.io](https://trpc.io/) in Nuxt applications.
</figure> </figure>
</p> </p>
**⚠️ Currently works on Node v16 until [this issue](https://github.com/trpc/trpc/issues/2420) gets fixed.**
## Install ## Install
```bash ```bash

View File

@@ -1,8 +1,8 @@
{ {
"name": "trpc-nuxt", "name": "trpc-nuxt",
"type": "module", "type": "module",
"version": "0.2.3", "version": "0.2.6",
"packageManager": "pnpm@7.1.1", "packageManager": "pnpm@7.5.0",
"license": "MIT", "license": "MIT",
"main": "./dist/module.cjs", "main": "./dist/module.cjs",
"types": "./dist/types.d.ts", "types": "./dist/types.d.ts",
@@ -32,27 +32,27 @@
"prepare": "nuxi prepare playground" "prepare": "nuxi prepare playground"
}, },
"dependencies": { "dependencies": {
"@nuxt/kit": "^3.0.0-rc.4", "@nuxt/kit": "3.0.0-rc.8",
"@trpc/client": "^9.26.0", "@trpc/client": "^9.27.1",
"@trpc/server": "^9.26.0", "@trpc/server": "^9.27.1",
"@vueuse/core": "^8.9.3", "@vueuse/core": "^9.1.0",
"@vueuse/nuxt": "^8.9.3", "@vueuse/nuxt": "^9.1.0",
"dedent": "^0.7.0", "dedent": "^0.7.0",
"defu": "^6.0.0", "defu": "^6.0.0",
"h3": "^0.7.10", "h3": "^0.7.10",
"ohash": "^0.1.5",
"pathe": "^0.3.0", "pathe": "^0.3.0",
"ufo": "^0.8.5" "ufo": "^0.8.5"
}, },
"devDependencies": { "devDependencies": {
"@antfu/eslint-config": "^0.23.1", "@antfu/eslint-config": "^0.23.1",
"@antfu/ni": "^0.16.2", "@antfu/ni": "^0.16.2",
"@nuxt/module-builder": "latest", "@nuxt/module-builder": "^0.1.7",
"@types/dedent": "^0.7.0", "@types/dedent": "^0.7.0",
"bumpp": "^7.2.0", "bumpp": "^7.2.0",
"eslint": "^8.14.0", "eslint": "^8.14.0",
"nuxt": "3.0.0-rc.4", "nuxt": "3.0.0-rc.8",
"ohash": "^0.1.0", "pnpm": "^7.5.0",
"pnpm": "^7.1.1",
"trpc-nuxt": "workspace:*", "trpc-nuxt": "workspace:*",
"zod": "^3.16.0" "zod": "^3.16.0"
}, },
@@ -61,5 +61,8 @@
"rules": { "rules": {
"no-console": "warn" "no-console": "warn"
} }
},
"volta": {
"node": "16.14.2"
} }
} }

2907
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@@ -13,10 +13,13 @@ export default defineNuxtPlugin((nuxtApp) => {
const client = trpc.createTRPCClient<AppRouter>({ const client = trpc.createTRPCClient<AppRouter>({
url: `${config.baseURL}${config.endpoint}`, url: `${config.baseURL}${config.endpoint}`,
headers: () => { headers: () => {
return { if (nuxtApp.ssrContext) {
...unref(otherHeaders), return {
...headers, ...unref(otherHeaders),
...headers,
}
} }
return {}
}, },
}) })