Compare commits

...

11 Commits

Author SHA1 Message Date
wobsoriano
76fbd59525 chore: release v0.6.0 2023-02-04 21:01:26 -08:00
wobsoriano
57faf8749a feat(deps): bump h3 to 1.1.0 2023-02-04 21:00:25 -08:00
wobsoriano
9456342d58 remove unused deps 2023-02-04 20:59:51 -08:00
wobsoriano
f89c8e44ef feat(deps): bump @trpc/client and @trpc/server to 10.10.0 2023-02-04 20:59:39 -08:00
wobsoriano
7f156806d8 add Acknowledgements section 2023-02-01 08:49:10 -08:00
wobsoriano
bd33589d2f add funding.yml 2023-01-31 20:03:14 -08:00
Robert Soriano
16b6ed315a Merge pull request #68 from CodyBontecou/patch-1
Update 1.simple.md
2023-01-25 22:42:38 -05:00
Cody Bontecou
6e74e44233 Update 1.simple.md
Updated to use destructuring syntax.
2023-01-25 15:18:16 -10:00
Cody Bontecou
6485aa42a7 Update 1.simple.md
Walking through the setup with Nuxt v3.1.0 requires accessing `.value` within the template.
2023-01-25 13:00:50 -10:00
Robert Soriano
051d5bb325 Update 1.composables.md 2023-01-09 10:33:17 -08:00
Robert Soriano
b7d4dc7642 Update 1.composables.md 2023-01-09 10:33:07 -08:00
8 changed files with 119 additions and 130 deletions

1
.github/FUNDING.yml vendored Normal file
View File

@@ -0,0 +1 @@
github: wobsoriano

View File

@@ -27,6 +27,10 @@ For version 3 of this module (tRPC v9, auto-imports, auto handlers), [go here](h
- [VS Code](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar)
## Acknowledgements
Huge thanks to [Alex / KATT](https://github.com/KATT), the author of [tRPC](https://trpc.io/), for being the first sponsor of this project! 🎉
## License
MIT

View File

@@ -107,12 +107,12 @@ export default defineNuxtPlugin(() => {
<script setup lang="ts">
const { $client } = useNuxtApp()
const hello = await $client.hello.useQuery({ text: 'client' })
const { data: hello } = await $client.hello.useQuery({ text: 'client' })
</script>
<template>
<div>
<p>{{ hello.data?.greeting }}</p>
<p>{{ hello?.greeting }}</p>
</div>
</template>
```

View File

@@ -7,7 +7,7 @@ title: Composables
It is often useful to wrap functionality of your `@trpc/client` api within other functions. For this purpose, it's necessary to be able to infer input types and output types generated by your `@trpc/server` router.
::alert{type="info"}
[createTRPCNuxtClient](/get-started/client/create) adds a `useQuery` method built on top of [useAsyncData](https://nuxt.com/docs/api/composables/use-async-data/).
[createTRPCNuxtClient](/get-started/client/create) already adds a `useQuery` method built on top of [useAsyncData](https://nuxt.com/docs/api/composables/use-async-data/). You might not need this.
::
## Inference Helpers

View File

@@ -3,7 +3,7 @@
"description": "End-to-end typesafe APIs in Nuxt applications.",
"type": "module",
"packageManager": "pnpm@7.18.2",
"version": "0.5.0",
"version": "0.6.0",
"license": "MIT",
"sideEffects": false,
"exports": {
@@ -25,7 +25,7 @@
"client.d.ts"
],
"scripts": {
"dev": "concurrently \"pnpm build --watch\" \"pnpm --filter playground dev\"",
"dev": "tsup --watch --onSuccess \"pnpm --filter playground dev\"",
"dev:prepare": "pnpm build && nuxt prepare playground",
"prepublishOnly": "pnpm build",
"build": "tsup",
@@ -35,25 +35,24 @@
"update-deps": "taze -w && pnpm i"
},
"peerDependencies": {
"@trpc/client": "^10.8.0",
"@trpc/server": "^10.8.0"
"@trpc/client": "^10.10.0",
"@trpc/server": "^10.10.0"
},
"dependencies": {
"h3": "^1.0.2",
"h3": "^1.1.0",
"ofetch": "^1.0.0",
"ohash": "^1.0.0",
"ufo": "^1.0.1"
},
"devDependencies": {
"@nuxt/eslint-config": "^0.1.1",
"@trpc/client": "^10.8.1",
"@trpc/server": "^10.8.1",
"@trpc/client": "^10.10.0",
"@trpc/server": "^10.10.0",
"bumpp": "^8.2.1",
"concurrently": "^7.6.0",
"eslint": "^8.30.0",
"eslint": "^8.33.0",
"taze": "^0.8.5",
"tsup": "6.4.0",
"typescript": "^4.9.4"
"typescript": "^4.9.5"
},
"eslintConfig": {
"extends": [

212
pnpm-lock.yaml generated
View File

@@ -8,33 +8,31 @@ importers:
.:
specifiers:
'@nuxt/eslint-config': ^0.1.1
'@trpc/client': ^10.8.1
'@trpc/server': ^10.8.1
'@trpc/client': ^10.10.0
'@trpc/server': ^10.10.0
bumpp: ^8.2.1
concurrently: ^7.6.0
eslint: ^8.30.0
h3: ^1.0.2
eslint: ^8.33.0
h3: ^1.1.0
ofetch: ^1.0.0
ohash: ^1.0.0
taze: ^0.8.5
tsup: 6.4.0
typescript: ^4.9.4
typescript: ^4.9.5
ufo: ^1.0.1
dependencies:
h3: 1.0.2
h3: 1.1.0
ofetch: 1.0.0
ohash: 1.0.0
ufo: 1.0.1
devDependencies:
'@nuxt/eslint-config': 0.1.1_eslint@8.30.0
'@trpc/client': 10.8.1_@trpc+server@10.8.1
'@trpc/server': 10.8.1
'@nuxt/eslint-config': 0.1.1_eslint@8.33.0
'@trpc/client': 10.10.0_@trpc+server@10.10.0
'@trpc/server': 10.10.0
bumpp: 8.2.1
concurrently: 7.6.0
eslint: 8.30.0
eslint: 8.33.0
taze: 0.8.5
tsup: 6.4.0_typescript@4.9.4
typescript: 4.9.4
tsup: 6.4.0_typescript@4.9.5
typescript: 4.9.5
docs:
specifiers:
@@ -361,8 +359,8 @@ packages:
requiresBuild: true
optional: true
/@eslint/eslintrc/1.4.0:
resolution: {integrity: sha512-7yfvXy6MWLgWSFsLhz5yH3iQ52St8cdUY6FoGieKkRDVxuxmrNuUetIuu6cmjNWwniUHiWXjxCr5tTXDrbYS5A==}
/@eslint/eslintrc/1.4.1:
resolution: {integrity: sha512-XXrH9Uarn0stsyldqDYq8r++mROmWRI1xKMXa640Bb//SY1+ECYX6VzT6Lcx5frD0V30XieqJ0oX9I2Xj5aoMA==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
dependencies:
ajv: 6.12.6
@@ -718,17 +716,17 @@ packages:
/@nuxt/devalue/2.0.0:
resolution: {integrity: sha512-YBI/6o2EBz02tdEJRBK8xkt3zvOFOWlLBf7WKYGBsSYSRtjjgrqPe2skp6VLLmKx5WbHHDNcW+6oACaurxGzeA==}
/@nuxt/eslint-config/0.1.1_eslint@8.30.0:
/@nuxt/eslint-config/0.1.1_eslint@8.33.0:
resolution: {integrity: sha512-znm1xlbhldUubB2XGx6Ca5uarwlIieKf0o8CtxtF6eEauDbpa3T2p3JnTcdguMW2nj1YPneoGmhshANfOlghiQ==}
peerDependencies:
eslint: ^8.29.0
dependencies:
'@rushstack/eslint-patch': 1.2.0
'@typescript-eslint/eslint-plugin': 5.46.1_mqzxmroayievgzgel6yrqgih5i
'@typescript-eslint/parser': 5.46.1_lzzuuodtsqwxnvqeq4g4likcqa
eslint: 8.30.0
eslint-plugin-vue: 9.8.0_eslint@8.30.0
typescript: 4.9.4
'@typescript-eslint/eslint-plugin': 5.46.1_6keo6vt5qskgv7uzbtvjhrraue
'@typescript-eslint/parser': 5.46.1_4vsywjlpuriuw3tl5oq6zy5a64
eslint: 8.33.0
eslint-plugin-vue: 9.8.0_eslint@8.33.0
typescript: 4.9.5
transitivePeerDependencies:
- supports-color
dev: true
@@ -876,7 +874,7 @@ packages:
externality: 1.0.0
fs-extra: 10.1.0
get-port-please: 2.6.1
h3: 1.0.2
h3: 1.1.0
knitwork: 1.0.0
magic-string: 0.26.7
mlly: 1.0.0
@@ -1304,15 +1302,29 @@ packages:
engines: {node: '>= 10'}
dev: true
/@trpc/client/10.10.0_@trpc+server@10.10.0:
resolution: {integrity: sha512-HRVGkOsR4FIYpyQILP84HLbj6pRnLKgxy4AIelTf9d9TxD60M5bNhbR2Uz3hqNSb9a2ppaRJBLv7twlV9b4qHQ==}
peerDependencies:
'@trpc/server': 10.10.0
dependencies:
'@trpc/server': 10.10.0
dev: true
/@trpc/client/10.8.1_@trpc+server@10.8.1:
resolution: {integrity: sha512-DQ+Y3ek/rjCYaI8ifeeVPVW/KIO6ryye32Xdm9VAkdhd1humYD/4rN2CQ7K1zPTeNpbIpuckEAMEadeB4ItcMQ==}
peerDependencies:
'@trpc/server': 10.8.1
dependencies:
'@trpc/server': 10.8.1
dev: false
/@trpc/server/10.10.0:
resolution: {integrity: sha512-tCTqcqBT+3nebYFTHtwM877qo5xQPtVlptxKdUzMVWleWT4lFTL4oddk45qVURToci2iMbVJjd4jQU9y9/XwlQ==}
dev: true
/@trpc/server/10.8.1:
resolution: {integrity: sha512-oSNYgFNJbjki4jBByJ/SKHasB/X7kTsEbVGaONNH1DHMz638xlYXPQucV+2bWbhCm5HlXhQTaVN7Or0lsCuUUQ==}
dev: false
/@trysound/sax/0.2.0:
resolution: {integrity: sha512-L7z9BgrNEcYyUYtF+HaEfiS5ebkh9jXqbszz7pC0hRBPaatV0XjSD3+eHrpqFemQfgwiFF0QPIarnIihIDn7OA==}
@@ -1369,7 +1381,7 @@ packages:
resolution: {integrity: sha512-oh8q2Zc32S6gd/j50GowEjKLoOVOwHP/bWVjKJInBwQqdOYMdPrf1oVlelTlyfFK3CKxL1uahMDAr+vy8T7yMQ==}
dev: true
/@typescript-eslint/eslint-plugin/5.46.1_mqzxmroayievgzgel6yrqgih5i:
/@typescript-eslint/eslint-plugin/5.46.1_6keo6vt5qskgv7uzbtvjhrraue:
resolution: {integrity: sha512-YpzNv3aayRBwjs4J3oz65eVLXc9xx0PDbIRisHj+dYhvBn02MjYOD96P8YGiWEIFBrojaUjxvkaUpakD82phsA==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
peerDependencies:
@@ -1380,23 +1392,23 @@ packages:
typescript:
optional: true
dependencies:
'@typescript-eslint/parser': 5.46.1_lzzuuodtsqwxnvqeq4g4likcqa
'@typescript-eslint/parser': 5.46.1_4vsywjlpuriuw3tl5oq6zy5a64
'@typescript-eslint/scope-manager': 5.46.1
'@typescript-eslint/type-utils': 5.46.1_lzzuuodtsqwxnvqeq4g4likcqa
'@typescript-eslint/utils': 5.46.1_lzzuuodtsqwxnvqeq4g4likcqa
'@typescript-eslint/type-utils': 5.46.1_4vsywjlpuriuw3tl5oq6zy5a64
'@typescript-eslint/utils': 5.46.1_4vsywjlpuriuw3tl5oq6zy5a64
debug: 4.3.4
eslint: 8.30.0
eslint: 8.33.0
ignore: 5.2.2
natural-compare-lite: 1.4.0
regexpp: 3.2.0
semver: 7.3.8
tsutils: 3.21.0_typescript@4.9.4
typescript: 4.9.4
tsutils: 3.21.0_typescript@4.9.5
typescript: 4.9.5
transitivePeerDependencies:
- supports-color
dev: true
/@typescript-eslint/parser/5.46.1_lzzuuodtsqwxnvqeq4g4likcqa:
/@typescript-eslint/parser/5.46.1_4vsywjlpuriuw3tl5oq6zy5a64:
resolution: {integrity: sha512-RelQ5cGypPh4ySAtfIMBzBGyrNerQcmfA1oJvPj5f+H4jI59rl9xxpn4bonC0tQvUKOEN7eGBFWxFLK3Xepneg==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
peerDependencies:
@@ -1408,10 +1420,10 @@ packages:
dependencies:
'@typescript-eslint/scope-manager': 5.46.1
'@typescript-eslint/types': 5.46.1
'@typescript-eslint/typescript-estree': 5.46.1_typescript@4.9.4
'@typescript-eslint/typescript-estree': 5.46.1_typescript@4.9.5
debug: 4.3.4
eslint: 8.30.0
typescript: 4.9.4
eslint: 8.33.0
typescript: 4.9.5
transitivePeerDependencies:
- supports-color
dev: true
@@ -1424,7 +1436,7 @@ packages:
'@typescript-eslint/visitor-keys': 5.46.1
dev: true
/@typescript-eslint/type-utils/5.46.1_lzzuuodtsqwxnvqeq4g4likcqa:
/@typescript-eslint/type-utils/5.46.1_4vsywjlpuriuw3tl5oq6zy5a64:
resolution: {integrity: sha512-V/zMyfI+jDmL1ADxfDxjZ0EMbtiVqj8LUGPAGyBkXXStWmCUErMpW873zEHsyguWCuq2iN4BrlWUkmuVj84yng==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
peerDependencies:
@@ -1434,12 +1446,12 @@ packages:
typescript:
optional: true
dependencies:
'@typescript-eslint/typescript-estree': 5.46.1_typescript@4.9.4
'@typescript-eslint/utils': 5.46.1_lzzuuodtsqwxnvqeq4g4likcqa
'@typescript-eslint/typescript-estree': 5.46.1_typescript@4.9.5
'@typescript-eslint/utils': 5.46.1_4vsywjlpuriuw3tl5oq6zy5a64
debug: 4.3.4
eslint: 8.30.0
tsutils: 3.21.0_typescript@4.9.4
typescript: 4.9.4
eslint: 8.33.0
tsutils: 3.21.0_typescript@4.9.5
typescript: 4.9.5
transitivePeerDependencies:
- supports-color
dev: true
@@ -1449,7 +1461,7 @@ packages:
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
dev: true
/@typescript-eslint/typescript-estree/5.46.1_typescript@4.9.4:
/@typescript-eslint/typescript-estree/5.46.1_typescript@4.9.5:
resolution: {integrity: sha512-j9W4t67QiNp90kh5Nbr1w92wzt+toiIsaVPnEblB2Ih2U9fqBTyqV9T3pYWZBRt6QoMh/zVWP59EpuCjc4VRBg==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
peerDependencies:
@@ -1464,13 +1476,13 @@ packages:
globby: 11.1.0
is-glob: 4.0.3
semver: 7.3.8
tsutils: 3.21.0_typescript@4.9.4
typescript: 4.9.4
tsutils: 3.21.0_typescript@4.9.5
typescript: 4.9.5
transitivePeerDependencies:
- supports-color
dev: true
/@typescript-eslint/utils/5.46.1_lzzuuodtsqwxnvqeq4g4likcqa:
/@typescript-eslint/utils/5.46.1_4vsywjlpuriuw3tl5oq6zy5a64:
resolution: {integrity: sha512-RBdBAGv3oEpFojaCYT4Ghn4775pdjvwfDOfQ2P6qzNVgQOVrnSPe5/Pb88kv7xzYQjoio0eKHKB9GJ16ieSxvA==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
peerDependencies:
@@ -1480,10 +1492,10 @@ packages:
'@types/semver': 7.3.13
'@typescript-eslint/scope-manager': 5.46.1
'@typescript-eslint/types': 5.46.1
'@typescript-eslint/typescript-estree': 5.46.1_typescript@4.9.4
eslint: 8.30.0
'@typescript-eslint/typescript-estree': 5.46.1_typescript@4.9.5
eslint: 8.33.0
eslint-scope: 5.1.1
eslint-utils: 3.0.0_eslint@8.30.0
eslint-utils: 3.0.0_eslint@8.33.0
semver: 7.3.8
transitivePeerDependencies:
- supports-color
@@ -2364,22 +2376,6 @@ packages:
/concat-map/0.0.1:
resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==}
/concurrently/7.6.0:
resolution: {integrity: sha512-BKtRgvcJGeZ4XttiDiNcFiRlxoAeZOseqUvyYRUp/Vtd+9p1ULmeoSqGsDA+2ivdeDFpqrJvGvmI+StKfKl5hw==}
engines: {node: ^12.20.0 || ^14.13.0 || >=16.0.0}
hasBin: true
dependencies:
chalk: 4.1.2
date-fns: 2.29.3
lodash: 4.17.21
rxjs: 7.8.0
shell-quote: 1.7.4
spawn-command: 0.0.2-1
supports-color: 8.1.1
tree-kill: 1.2.2
yargs: 17.6.2
dev: true
/consola/2.15.3:
resolution: {integrity: sha512-9vAdYbHj6x2fLKC4+oPH0kFzY/orMZyG2Aj+kNylHxKGJ/Ed4dpNyAQYwJOdqO4zdM7XpVHmyejQDcQHrnuXbw==}
@@ -2542,11 +2538,6 @@ packages:
resolution: {integrity: sha512-Vr3mLBA8qWmcuschSLAOogKgQ/Jwxulv3RNE4FXnYWRGujzrRWQI4m12fQqRkwX06C0KanhLr4hK+GydchZsaA==}
engines: {node: '>= 12'}
/date-fns/2.29.3:
resolution: {integrity: sha512-dDCnyH2WnnKusqvZZ6+jA1O51Ibt8ZMRNkDZdyAyK4YfbDwa/cEmuztzG5pk6hqlp9aSBPYcjOlktquahGwGeA==}
engines: {node: '>=0.11'}
dev: true
/de-indent/1.0.2:
resolution: {integrity: sha512-e/1zu3xH5MQryN2zdVaF0OrdNLUbvWxzMbi+iNA6Bky7l1RoP8a2fIbRocyHclXt/arDrrR6lL3TqFD9pMQTsg==}
dev: true
@@ -3013,19 +3004,19 @@ packages:
resolution: {integrity: sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==}
engines: {node: '>=12'}
/eslint-plugin-vue/9.8.0_eslint@8.30.0:
/eslint-plugin-vue/9.8.0_eslint@8.33.0:
resolution: {integrity: sha512-E/AXwcTzunyzM83C2QqDHxepMzvI2y6x+mmeYHbVDQlKFqmKYvRrhaVixEeeG27uI44p9oKDFiyCRw4XxgtfHA==}
engines: {node: ^14.17.0 || >=16.0.0}
peerDependencies:
eslint: ^6.2.0 || ^7.0.0 || ^8.0.0
dependencies:
eslint: 8.30.0
eslint-utils: 3.0.0_eslint@8.30.0
eslint: 8.33.0
eslint-utils: 3.0.0_eslint@8.33.0
natural-compare: 1.4.0
nth-check: 2.1.1
postcss-selector-parser: 6.0.11
semver: 7.3.8
vue-eslint-parser: 9.1.0_eslint@8.30.0
vue-eslint-parser: 9.1.0_eslint@8.33.0
xml-name-validator: 4.0.0
transitivePeerDependencies:
- supports-color
@@ -3047,13 +3038,13 @@ packages:
estraverse: 5.3.0
dev: true
/eslint-utils/3.0.0_eslint@8.30.0:
/eslint-utils/3.0.0_eslint@8.33.0:
resolution: {integrity: sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==}
engines: {node: ^10.0.0 || ^12.0.0 || >= 14.0.0}
peerDependencies:
eslint: '>=5'
dependencies:
eslint: 8.30.0
eslint: 8.33.0
eslint-visitor-keys: 2.1.0
dev: true
@@ -3067,12 +3058,12 @@ packages:
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
dev: true
/eslint/8.30.0:
resolution: {integrity: sha512-MGADB39QqYuzEGov+F/qb18r4i7DohCDOfatHaxI2iGlPuC65bwG2gxgO+7DkyL38dRFaRH7RaRAgU6JKL9rMQ==}
/eslint/8.33.0:
resolution: {integrity: sha512-WjOpFQgKK8VrCnAtl8We0SUOy/oVZ5NHykyMiagV1M9r8IFpIJX7DduK6n1mpfhlG7T1NLWm2SuD8QB7KFySaA==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
hasBin: true
dependencies:
'@eslint/eslintrc': 1.4.0
'@eslint/eslintrc': 1.4.1
'@humanwhocodes/config-array': 0.11.8
'@humanwhocodes/module-importer': 1.0.1
'@nodelib/fs.walk': 1.2.8
@@ -3083,7 +3074,7 @@ packages:
doctrine: 3.0.0
escape-string-regexp: 4.0.0
eslint-scope: 7.1.1
eslint-utils: 3.0.0_eslint@8.30.0
eslint-utils: 3.0.0_eslint@8.33.0
eslint-visitor-keys: 3.3.0
espree: 9.4.1
esquery: 1.4.0
@@ -3538,6 +3529,14 @@ packages:
radix3: 1.0.0
ufo: 1.0.1
/h3/1.1.0:
resolution: {integrity: sha512-kx3u+RMzY963fU8NNT2ePWgsryAn9DNztPqbHia/M7HgA+rtXKjHjED9/uidcYPmImNwAfJsCachCzh2T3QH2A==}
dependencies:
cookie-es: 0.5.0
destr: 1.2.2
radix3: 1.0.0
ufo: 1.0.1
/has-flag/3.0.0:
resolution: {integrity: sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==}
engines: {node: '>=4'}
@@ -4840,7 +4839,7 @@ packages:
engines: {node: '>=10'}
hasBin: true
/mkdist/1.0.0_typescript@4.9.4:
/mkdist/1.0.0_typescript@4.9.5:
resolution: {integrity: sha512-aJke+yvXwwcrOh+3KfAdDgDA+MPe7c+R8hQ7IPfp0gqL1/WPZZUS9rwS6CNjdwDJmHm6DTMA9KwX1FNjZG3I1Q==}
hasBin: true
peerDependencies:
@@ -4859,7 +4858,7 @@ packages:
jiti: 1.16.0
mri: 1.2.0
pathe: 1.0.0
typescript: 4.9.4
typescript: 4.9.5
dev: true
/mlly/1.0.0:
@@ -4952,7 +4951,7 @@ packages:
fs-extra: 10.1.0
globby: 13.1.3
gzip-size: 7.0.0
h3: 1.0.2
h3: 1.1.0
hookable: 5.4.2
http-proxy: 1.18.1
is-primitive: 3.0.1
@@ -5231,8 +5230,8 @@ packages:
dependencies:
'@nuxt/kit': 3.0.0
scule: 1.0.0
typescript: 4.9.4
vue-component-meta: 1.0.14_typescript@4.9.4
typescript: 4.9.5
vue-component-meta: 1.0.14_typescript@4.9.5
transitivePeerDependencies:
- rollup
- supports-color
@@ -6304,7 +6303,7 @@ packages:
dependencies:
glob: 7.2.3
/rollup-plugin-dts/5.0.0_oj4jlwi3mkekxo3vucumcwebnq:
/rollup-plugin-dts/5.0.0_3v3dsijcu3m7igmuftt7nmvxbu:
resolution: {integrity: sha512-OO8ayCvuJCKaQSShyVTARxGurVVk4ulzbuvz+0zFd1f93vlnWFU5pBMT7HFeS6uj7MvvZLx4kUAarGATSU1+Ng==}
engines: {node: '>=v14'}
peerDependencies:
@@ -6313,7 +6312,7 @@ packages:
dependencies:
magic-string: 0.26.7
rollup: 3.7.5
typescript: 4.9.4
typescript: 4.9.5
optionalDependencies:
'@babel/code-frame': 7.18.6
dev: true
@@ -6469,10 +6468,6 @@ packages:
resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==}
engines: {node: '>=8'}
/shell-quote/1.7.4:
resolution: {integrity: sha512-8o/QEhSSRb1a5i7TFR0iM4G16Z0vYB2OQVs4G3aAFXjn3T6yEx8AZxy1PgDF7I00LZHYA3WxaSYIf5e5sAX8Rw==}
dev: true
/shiki-es/0.1.2:
resolution: {integrity: sha512-eqtfk8idlYlSLAn0gp0Ly2+FbKc2d78IddigHSS4iHAnpXoY2kdRzyFGZOdi6TvemYMnRhZBi1HsSqZc5eNKqg==}
dev: true
@@ -6586,10 +6581,6 @@ packages:
resolution: {integrity: sha512-PEGlAwrG8yXGXRjW32fGbg66JAlOAwbObuqVoJpv/mRgoWDQfgH1wDPvtzWyUSNAXBGSk8h755YDbbcEy3SH2Q==}
dev: true
/spawn-command/0.0.2-1:
resolution: {integrity: sha512-n98l9E2RMSJ9ON1AKisHzz7V42VDiBQGY6PB1BwRglz99wpVsSuGzQ+jOi6lFXBGVTCrRpltvjm+/XA+tpeJrg==}
dev: true
/spdx-correct/3.1.1:
resolution: {integrity: sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==}
dependencies:
@@ -6767,13 +6758,6 @@ packages:
dependencies:
has-flag: 4.0.0
/supports-color/8.1.1:
resolution: {integrity: sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==}
engines: {node: '>=10'}
dependencies:
has-flag: 4.0.0
dev: true
/supports-preserve-symlinks-flag/1.0.0:
resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==}
engines: {node: '>= 0.4'}
@@ -6930,7 +6914,7 @@ packages:
/tslib/2.4.1:
resolution: {integrity: sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==}
/tsup/6.4.0_typescript@4.9.4:
/tsup/6.4.0_typescript@4.9.5:
resolution: {integrity: sha512-4OlbqIK/SF+cJp0mMqPM2pKULvgj/1S2Gm3I1aFoFGIryUOyIqPZBoqKkqVQT6uFtWJ5AHftIv0riXKfHox1zQ==}
engines: {node: '>=14'}
hasBin: true
@@ -6960,20 +6944,20 @@ packages:
source-map: 0.8.0-beta.0
sucrase: 3.29.0
tree-kill: 1.2.2
typescript: 4.9.4
typescript: 4.9.5
transitivePeerDependencies:
- supports-color
- ts-node
dev: true
/tsutils/3.21.0_typescript@4.9.4:
/tsutils/3.21.0_typescript@4.9.5:
resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==}
engines: {node: '>= 6'}
peerDependencies:
typescript: '>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta'
dependencies:
tslib: 1.14.1
typescript: 4.9.4
typescript: 4.9.5
dev: true
/type-check/0.4.0:
@@ -7009,8 +6993,8 @@ packages:
resolution: {integrity: sha512-OJabfkAg1WLZSqJAJ0Z6Sdt3utnbzr/jh+NAHoyWHJe8CMSy79Gm085094M9nvTPy22KzTVn5Zq5mbapCI/hPA==}
dev: true
/typescript/4.9.4:
resolution: {integrity: sha512-Uz+dTXYzxXXbsFpM86Wh3dKCxrQqUcVMxwU54orwlJjOpO3ao8L7j5lH+dWfTwgCwIuM9GQ2kvVotzYJMXTBZg==}
/typescript/4.9.5:
resolution: {integrity: sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==}
engines: {node: '>=4.2.0'}
hasBin: true
dev: true
@@ -7043,7 +7027,7 @@ packages:
jiti: 1.16.0
magic-string: 0.27.0
mkdirp: 1.0.4
mkdist: 1.0.0_typescript@4.9.4
mkdist: 1.0.0_typescript@4.9.5
mlly: 1.0.0
mri: 1.2.0
pathe: 1.0.0
@@ -7051,9 +7035,9 @@ packages:
pretty-bytes: 6.0.0
rimraf: 3.0.2
rollup: 3.7.5
rollup-plugin-dts: 5.0.0_oj4jlwi3mkekxo3vucumcwebnq
rollup-plugin-dts: 5.0.0_3v3dsijcu3m7igmuftt7nmvxbu
scule: 1.0.0
typescript: 4.9.4
typescript: 4.9.5
untyped: 1.2.0
transitivePeerDependencies:
- sass
@@ -7228,7 +7212,7 @@ packages:
anymatch: 3.1.3
chokidar: 3.5.3
destr: 1.2.2
h3: 1.0.2
h3: 1.1.0
ioredis: 5.2.4
listhen: 1.0.1
mkdir: 0.0.2
@@ -7475,7 +7459,7 @@ packages:
dependencies:
ufo: 1.0.1
/vue-component-meta/1.0.14_typescript@4.9.4:
/vue-component-meta/1.0.14_typescript@4.9.5:
resolution: {integrity: sha512-fUxV2ZujwxYwFw8q0hyOEn7x37h8Ii/U6B2rjzQ0U2Ayh7kiFwBsbYeO+E7NpbV6OGMWIz23YMhpCXXgqC6BpQ==}
peerDependencies:
typescript: '*'
@@ -7483,7 +7467,7 @@ packages:
'@volar/language-core': 1.0.14
'@volar/vue-language-core': 1.0.14
typesafe-path: 0.2.2
typescript: 4.9.4
typescript: 4.9.5
dev: true
/vue-demi/0.13.11:
@@ -7502,14 +7486,14 @@ packages:
/vue-devtools-stub/0.1.0:
resolution: {integrity: sha512-RutnB7X8c5hjq39NceArgXg28WZtZpGc3+J16ljMiYnFhKvd8hITxSWQSQ5bvldxMDU6gG5mkxl1MTQLXckVSQ==}
/vue-eslint-parser/9.1.0_eslint@8.30.0:
/vue-eslint-parser/9.1.0_eslint@8.33.0:
resolution: {integrity: sha512-NGn/iQy8/Wb7RrRa4aRkokyCZfOUWk19OP5HP6JEozQFX5AoS/t+Z0ZN7FY4LlmWc4FNI922V7cvX28zctN8dQ==}
engines: {node: ^14.17.0 || >=16.0.0}
peerDependencies:
eslint: '>=6.0.0'
dependencies:
debug: 4.3.4
eslint: 8.30.0
eslint: 8.33.0
eslint-scope: 7.1.1
eslint-visitor-keys: 3.3.0
espree: 9.4.1

View File

@@ -69,7 +69,7 @@ export function createTRPCNuxtClient<TRouter extends AnyRouter> (opts: CreateTRP
const client = createTRPCProxyClient<TRouter>(opts)
const decoratedClient = createFlatProxy((key) => {
return createNuxtProxyDecoration(key, client)
return createNuxtProxyDecoration(key, client as any)
}) as DecoratedProcedureRecord<TRouter['_def']['record'], TRouter>
return decoratedClient

View File

@@ -4,6 +4,7 @@ import { FetchError } from 'ofetch'
// @ts-expect-error: Nuxt auto-imports
import { useRequestHeaders } from '#imports'
import { type HTTPLinkOptions as _HTTPLinkOptions } from '@trpc/client/dist/links/internals/httpUtils'
import { type FetchEsque } from '@trpc/client/dist/internals/types'
function customFetch(input: RequestInfo | URL, init?: RequestInit) {
return globalThis.$fetch.raw(input.toString(), init)
@@ -43,7 +44,7 @@ export function httpLink<TRouter extends AnyRouter>(opts?: HTTPLinkOptions) {
headers () {
return headers
},
fetch: customFetch,
fetch: customFetch as FetchEsque,
...opts,
})
}
@@ -72,7 +73,7 @@ export function httpBatchLink<TRouter extends AnyRouter>(opts?: HttpBatchLinkOpt
headers () {
return headers
},
fetch: customFetch,
fetch: customFetch as FetchEsque,
...opts,
})
}