Compare commits

...

6 Commits

Author SHA1 Message Date
wobsoriano
4289dcbfab chore(release): v0.10.8 2023-08-20 22:30:24 -07:00
wobsoriano
dc317c2ded build: bump local deps 2023-08-20 21:57:59 -07:00
wobsoriano
3db0b31d31 refactor: use stand-alone getErrorShape 2023-08-20 21:55:25 -07:00
wobsoriano
f86ebcd6d6 docs: add handler param description 2023-08-20 21:48:39 -07:00
wobsoriano
252f6108cf refactor: use built-in getRequestURL from h3 instead of ufo 2023-08-20 21:41:57 -07:00
wobsoriano
3a395a7d4a build(deps): bump h3 to 1.8.0 2023-08-20 21:36:23 -07:00
5 changed files with 239 additions and 99 deletions

View File

@@ -1,6 +1,28 @@
# Changelog
## v0.10.8
[compare changes](https://github.com/wobsoriano/trpc-nuxt/compare/v0.10.7...v0.10.8)
### 💅 Refactors
- Use built-in getRequestURL from h3 instead of ufo ([252f610](https://github.com/wobsoriano/trpc-nuxt/commit/252f610))
- Use stand-alone getErrorShape ([3db0b31](https://github.com/wobsoriano/trpc-nuxt/commit/3db0b31))
### 📖 Documentation
- Add handler param description ([f86ebcd](https://github.com/wobsoriano/trpc-nuxt/commit/f86ebcd))
### 📦 Build
- **deps:** Bump h3 to 1.8.0 ([3a395a7](https://github.com/wobsoriano/trpc-nuxt/commit/3a395a7))
- Bump local deps ([dc317c2](https://github.com/wobsoriano/trpc-nuxt/commit/dc317c2))
### ❤️ Contributors
- Wobsoriano ([@wobsoriano](http://github.com/wobsoriano))
## v0.10.7
[compare changes](https://github.com/wobsoriano/trpc-nuxt/compare/v0.10.6...v0.10.7)

View File

@@ -3,7 +3,7 @@
"description": "End-to-end typesafe APIs in Nuxt applications.",
"type": "module",
"packageManager": "pnpm@8.6.9",
"version": "0.10.7",
"version": "0.10.8",
"license": "MIT",
"sideEffects": false,
"exports": {
@@ -39,19 +39,18 @@
"@trpc/server": "^10.26.0"
},
"dependencies": {
"h3": "^1.7.1",
"h3": "^1.8.0",
"ofetch": "^1.1.1",
"ohash": "^1.1.2",
"ufo": "^1.1.2"
"ohash": "^1.1.2"
},
"devDependencies": {
"@nuxt/eslint-config": "^0.1.1",
"@trpc/client": "^10.35.0",
"@trpc/server": "^10.35.0",
"@trpc/client": "^10.37.1",
"@trpc/server": "^10.37.1",
"changelogen": "^0.5.4",
"eslint": "^8.45.0",
"taze": "^0.11.2",
"tsup": "7.1.0",
"tsup": "7.2.0",
"typescript": "^5.1.6"
},
"eslintConfig": {
@@ -75,7 +74,9 @@
],
"pnpm": {
"overrides": {
"nuxt": "3.6.5"
"nuxt": "3.6.5",
"@trpc/client": "10.37.1",
"@trpc/server": "10.37.1"
}
}
}

View File

@@ -9,8 +9,8 @@
"postinstall": "nuxt prepare"
},
"dependencies": {
"@trpc/client": "^10.35.0",
"@trpc/server": "^10.35.0",
"@trpc/client": "^10.37.1",
"@trpc/server": "^10.37.1",
"superjson": "^1.13.1",
"trpc-nuxt": "workspace:*",
"zod": "^3.21.4"

268
pnpm-lock.yaml generated
View File

@@ -6,33 +6,32 @@ settings:
overrides:
nuxt: 3.6.5
'@trpc/client': 10.37.1
'@trpc/server': 10.37.1
importers:
.:
dependencies:
h3:
specifier: ^1.7.1
version: 1.7.1
specifier: ^1.8.0
version: 1.8.0
ofetch:
specifier: ^1.1.1
version: 1.1.1
ohash:
specifier: ^1.1.2
version: 1.1.2
ufo:
specifier: ^1.1.2
version: 1.1.2
devDependencies:
'@nuxt/eslint-config':
specifier: ^0.1.1
version: 0.1.1(eslint@8.45.0)
'@trpc/client':
specifier: ^10.35.0
version: 10.35.0(@trpc/server@10.35.0)
specifier: 10.37.1
version: 10.37.1(@trpc/server@10.37.1)
'@trpc/server':
specifier: ^10.35.0
version: 10.35.0
specifier: 10.37.1
version: 10.37.1
changelogen:
specifier: ^0.5.4
version: 0.5.4
@@ -43,8 +42,8 @@ importers:
specifier: ^0.11.2
version: 0.11.2
tsup:
specifier: 7.1.0
version: 7.1.0(typescript@5.1.6)
specifier: 7.2.0
version: 7.2.0(typescript@5.1.6)
typescript:
specifier: ^5.1.6
version: 5.1.6
@@ -64,11 +63,11 @@ importers:
examples/basic-example:
dependencies:
'@trpc/client':
specifier: ^10.35.0
version: 10.35.0(@trpc/server@10.35.0)
specifier: 10.37.1
version: 10.37.1(@trpc/server@10.37.1)
'@trpc/server':
specifier: ^10.35.0
version: 10.35.0
specifier: 10.37.1
version: 10.37.1
trpc-nuxt:
specifier: workspace:*
version: link:../..
@@ -78,7 +77,7 @@ importers:
devDependencies:
'@nuxt/devtools':
specifier: latest
version: 0.6.7(nuxt@3.6.5)(vite@4.3.9)
version: 0.8.0(nuxt@3.6.5)(vite@4.3.9)
'@types/node':
specifier: ^20.4.2
version: 20.4.2
@@ -89,11 +88,11 @@ importers:
playground:
dependencies:
'@trpc/client':
specifier: ^10.35.0
version: 10.35.0(@trpc/server@10.35.0)
specifier: 10.37.1
version: 10.37.1(@trpc/server@10.37.1)
'@trpc/server':
specifier: ^10.35.0
version: 10.35.0
specifier: 10.37.1
version: 10.37.1
superjson:
specifier: ^1.13.1
version: 1.13.1
@@ -1298,7 +1297,7 @@ packages:
nuxt-config-schema: 0.4.6(rollup@3.26.2)
nuxt-icon: 0.3.3(rollup@3.26.2)(vue@3.3.4)
pinceau: 0.18.8(postcss@8.4.25)
ufo: 1.1.2
ufo: 1.2.0
transitivePeerDependencies:
- postcss
- rollup
@@ -1338,7 +1337,7 @@ packages:
shiki-es: 0.2.0
slugify: 1.6.6
socket.io-client: 4.7.1
ufo: 1.1.2
ufo: 1.2.0
unified: 10.1.2
unist-builder: 3.0.1
unist-util-position: 4.0.4
@@ -1366,15 +1365,15 @@ packages:
resolution: {integrity: sha512-GBzP8zOc7CGWyFQS6dv1lQz8VVpz5C2yRszbXufwG/9zhStTIH50EtD87NmWbTMwXDvZLNg8GIpb1UFdH93JCA==}
dev: true
/@nuxt/devtools-kit@0.6.7(nuxt@3.6.5)(vite@4.3.9):
resolution: {integrity: sha512-DEJBLspLRr3zFu/DAHs8Q1o9tgzELt24qDqsuqTEKqcw/2j1iu1TefvUdmXkJo6s8Qk3GI6e3QxrvtEE3mwKqA==}
/@nuxt/devtools-kit@0.8.0(nuxt@3.6.5)(vite@4.3.9):
resolution: {integrity: sha512-zHwotLFwmYPFDg0JHyInn0L3i2gZK24JYDfgOzqBuvCD/Q3ytQVyAMrX2Mp4iIrHjwToZBJ0dlyV+UYXCiWwSg==}
peerDependencies:
nuxt: ^3.6.1
nuxt: ^3.6.5
vite: '*'
dependencies:
'@nuxt/kit': 3.6.5(rollup@3.26.2)
'@nuxt/schema': 3.6.5(rollup@3.26.2)
execa: 7.1.1
execa: 7.2.0
nuxt: 3.6.5(@types/node@20.4.2)(eslint@8.45.0)(rollup@3.26.2)(typescript@5.1.6)
vite: 4.3.9(@types/node@20.4.2)
transitivePeerDependencies:
@@ -1382,15 +1381,15 @@ packages:
- supports-color
dev: true
/@nuxt/devtools-wizard@0.6.7:
resolution: {integrity: sha512-dN+3UVxsGk3Vx0T6tN+UQ1b7FjWHk3N4WWmnKOACa4pHt77RYHFzndk60KDlKq9I/bn905pghsqwvXmPfbSpJA==}
/@nuxt/devtools-wizard@0.8.0:
resolution: {integrity: sha512-nxYAB4TQgeaoYY3xBEzrYVpXzXUAwoeCui0vqu1oTeeuKnl62uXFGsY4vXMHQtnibvbQVZzNFVFoXggKM3MBGw==}
hasBin: true
dependencies:
consola: 3.2.3
diff: 5.1.0
execa: 7.1.1
execa: 7.2.0
global-dirs: 3.0.1
magicast: 0.2.9
magicast: 0.2.10
pathe: 1.1.1
picocolors: 1.0.0
pkg-types: 1.0.3
@@ -1399,31 +1398,32 @@ packages:
semver: 7.5.4
dev: true
/@nuxt/devtools@0.6.7(nuxt@3.6.5)(vite@4.3.9):
resolution: {integrity: sha512-ATjkNfceG+8DQ8kR6O3UC9MjFfUd39aeFgKA+Z6pjG8Z7e3vwK92oZCSeQ8DQRi4/2kwa/UPjN8pNclyc6FlbQ==}
/@nuxt/devtools@0.8.0(nuxt@3.6.5)(vite@4.3.9):
resolution: {integrity: sha512-w48eqZ52NLVB8C0Q1E/eY0xsokMr9diOaxUptO08UYNhyj+MKKBrhIBTePYO7GlxabXOaHM62zi+iN8AT1qXoA==}
hasBin: true
peerDependencies:
nuxt: ^3.6.1
nuxt: ^3.6.5
vite: '*'
dependencies:
'@nuxt/devtools-kit': 0.6.7(nuxt@3.6.5)(vite@4.3.9)
'@nuxt/devtools-wizard': 0.6.7
'@nuxt/devtools-kit': 0.8.0(nuxt@3.6.5)(vite@4.3.9)
'@nuxt/devtools-wizard': 0.8.0
'@nuxt/kit': 3.6.5(rollup@3.26.2)
birpc: 0.2.12
boxen: 7.1.1
consola: 3.2.3
execa: 7.1.1
error-stack-parser-es: 0.1.1
execa: 7.2.0
fast-folder-size: 2.1.0
fast-glob: 3.3.0
fast-glob: 3.3.1
get-port-please: 3.0.1
global-dirs: 3.0.1
h3: 1.7.1
h3: 1.8.0
hookable: 5.5.3
image-meta: 0.1.1
is-installed-globally: 0.4.0
launch-editor: 2.6.0
local-pkg: 0.4.3
magicast: 0.2.9
magicast: 0.2.10
nuxt: 3.6.5(@types/node@20.4.2)(eslint@8.45.0)(rollup@3.26.2)(typescript@5.1.6)
nypm: 0.2.2
pacote: 15.2.0
@@ -1434,10 +1434,10 @@ packages:
rc9: 2.1.1
semver: 7.5.4
sirv: 2.0.3
unimport: 3.0.14(rollup@3.26.2)
unimport: 3.1.3
vite: 4.3.9(@types/node@20.4.2)
vite-plugin-inspect: 0.7.33(vite@4.3.9)
vite-plugin-vue-inspector: 3.4.2(vite@4.3.9)
vite-plugin-inspect: 0.7.38(@nuxt/kit@3.6.5)(vite@4.3.9)
vite-plugin-vue-inspector: 3.6.0(vite@4.3.9)
wait-on: 7.0.1
which: 3.0.1
ws: 8.13.0
@@ -1558,7 +1558,7 @@ packages:
postcss-import-resolver: 2.0.0
scule: 1.0.0
std-env: 3.3.2
ufo: 1.1.2
ufo: 1.2.0
unimport: 3.0.4(rollup@3.26.2)
untyped: 1.3.2
transitivePeerDependencies:
@@ -1576,7 +1576,7 @@ packages:
pkg-types: 1.0.3
postcss-import-resolver: 2.0.0
std-env: 3.3.3
ufo: 1.1.2
ufo: 1.2.0
unimport: 3.0.14(rollup@3.26.2)
untyped: 1.3.2
transitivePeerDependencies:
@@ -1594,7 +1594,7 @@ packages:
pkg-types: 1.0.3
postcss-import-resolver: 2.0.0
std-env: 3.3.3
ufo: 1.1.2
ufo: 1.2.0
unimport: 3.0.14(rollup@3.26.2)
untyped: 1.3.2
transitivePeerDependencies:
@@ -1669,7 +1669,7 @@ packages:
rollup-plugin-visualizer: 5.9.2(rollup@3.26.2)
std-env: 3.3.3
strip-literal: 1.0.1
ufo: 1.1.2
ufo: 1.2.0
unplugin: 1.3.2
vite: 4.3.9(@types/node@20.4.2)
vite-node: 0.33.0(@types/node@20.4.2)
@@ -1703,7 +1703,7 @@ packages:
nuxt-component-meta: 0.5.1(rollup@3.26.2)
nuxt-config-schema: 0.4.6(rollup@3.26.2)
socket.io-client: 4.7.1
ufo: 1.1.2
ufo: 1.2.0
transitivePeerDependencies:
- bufferutil
- rollup
@@ -2080,15 +2080,15 @@ packages:
engines: {node: '>= 10'}
dev: true
/@trpc/client@10.35.0(@trpc/server@10.35.0):
resolution: {integrity: sha512-FyVNQGLLsNourpYq7bojvvvpM63woCPL9c+lJo9x1Yheop5fng2GEyiVcVjCmBNk5tVARHjG9bTG1UeNF5t8OQ==}
/@trpc/client@10.37.1(@trpc/server@10.37.1):
resolution: {integrity: sha512-OSblNfeI0Z9ERn3usgLV2x63CwwPoNOHf1FQK85cOT7F8MNaWyEHoEv7tHUwNGJwyzKXmpU+ockZ0movzX3D0g==}
peerDependencies:
'@trpc/server': 10.35.0
'@trpc/server': 10.37.1
dependencies:
'@trpc/server': 10.35.0
'@trpc/server': 10.37.1
/@trpc/server@10.35.0:
resolution: {integrity: sha512-UntbE9gG+kB2nEwuJ0hw7AmQuRWw67voKaVBPBA7Ow6+aGZc00gva7015Ey5BT7Qf1wq7xJMLUdgw4QiVU+VpQ==}
/@trpc/server@10.37.1:
resolution: {integrity: sha512-r3VeA319/braYMBIzj+XLgLKQ9lJSVglvPvP9HUv4kr5w6Y5grQMxMcExhTiZWltE9bnSJHKtBBzHafOo7KC8A==}
/@trysound/sax@0.2.0:
resolution: {integrity: sha512-L7z9BgrNEcYyUYtF+HaEfiS5ebkh9jXqbszz7pC0hRBPaatV0XjSD3+eHrpqFemQfgwiFF0QPIarnIihIDn7OA==}
@@ -3604,7 +3604,6 @@ packages:
/consola@3.2.3:
resolution: {integrity: sha512-I5qxpzLv+sJhTVEoLYNcTW+bThDCPsit0vLNKShZx6rLtpilNpmmeTPaeqJb9ZE9dV3DGaeby6Vuhrw38WjeyQ==}
engines: {node: ^14.18.0 || >=16.10.0}
dev: true
/console-control-strings@1.1.0:
resolution: {integrity: sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==}
@@ -3965,6 +3964,9 @@ packages:
/destr@2.0.0:
resolution: {integrity: sha512-FJ9RDpf3GicEBvzI3jxc2XhHzbqD8p4ANw/1kPsFBfTvP1b7Gn/Lg1vO7R9J4IVgoMbyUmFrFGZafJ1hPZpvlg==}
/destr@2.0.1:
resolution: {integrity: sha512-M1Ob1zPSIvlARiJUkKqvAZ3VAqQY6Jcuth/pBKQ2b1dX/Qx0OnJ8Vux6J2H5PTMQeRzWrrbTu70VxBfv/OPDJA==}
/destroy@1.2.0:
resolution: {integrity: sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==}
engines: {node: '>= 0.8', npm: 1.2.8000 || >= 1.4.16}
@@ -4162,6 +4164,10 @@ packages:
prr: 1.0.1
dev: true
/error-stack-parser-es@0.1.1:
resolution: {integrity: sha512-g/9rfnvnagiNf+DRMHEVGuGuIBlCIMDFoTA616HaP2l9PlCjGjVhD98PNbVSJvmK4TttqT5mV5tInMhoFgi+aA==}
dev: true
/es6-object-assign@1.1.0:
resolution: {integrity: sha512-MEl9uirslVwqQU369iHNWZXsI8yaZYGg/D65aOgZkeyFJwHYSxilf7rQzXKI7DdDuBPrBXbfk3sl9hJhmd5AUw==}
dev: true
@@ -4450,6 +4456,21 @@ packages:
strip-final-newline: 3.0.0
dev: true
/execa@7.2.0:
resolution: {integrity: sha512-UduyVP7TLB5IcAQl+OzLyLcS/l32W/GLg+AhHJ+ow40FOk2U3SAllPwR44v4vmdFwIWqpdwxxpQbF1n5ta9seA==}
engines: {node: ^14.18.0 || ^16.14.0 || >=18.0.0}
dependencies:
cross-spawn: 7.0.3
get-stream: 6.0.1
human-signals: 4.3.1
is-stream: 3.0.0
merge-stream: 2.0.0
npm-run-path: 5.1.0
onetime: 6.0.0
signal-exit: 3.0.7
strip-final-newline: 3.0.0
dev: true
/extend@3.0.2:
resolution: {integrity: sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==}
dev: true
@@ -4460,7 +4481,7 @@ packages:
enhanced-resolve: 5.15.0
mlly: 1.4.0
pathe: 1.1.1
ufo: 1.1.2
ufo: 1.2.0
dev: true
/fast-deep-equal@3.1.3:
@@ -4500,6 +4521,17 @@ packages:
micromatch: 4.0.5
dev: true
/fast-glob@3.3.1:
resolution: {integrity: sha512-kNFPyjhh5cKjrUltxs+wFx+ZkbRaxxmZ+X0ZU31SOsxCEtP9VPgtq2teZw1DebupL5GmDaNQ6yKMMVcM41iqDg==}
engines: {node: '>=8.6.0'}
dependencies:
'@nodelib/fs.stat': 2.0.5
'@nodelib/fs.walk': 1.2.8
glob-parent: 5.1.2
merge2: 1.4.1
micromatch: 4.0.5
dev: true
/fast-json-stable-stringify@2.1.0:
resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==}
dev: true
@@ -4947,8 +4979,21 @@ packages:
destr: 2.0.0
iron-webcrypto: 0.7.0
radix3: 1.0.1
ufo: 1.1.2
ufo: 1.2.0
uncrypto: 0.1.3
dev: true
/h3@1.8.0:
resolution: {integrity: sha512-057VY83X7Tg5n4XU2GV9M3dsCWUU4jtw2Lc/r4GjAcf9Jb6GI1mD5F8TCQHUcvLMEgtx6lbfobOFu7Vdmejihg==}
dependencies:
cookie-es: 1.0.0
defu: 6.1.2
destr: 2.0.1
iron-webcrypto: 0.8.0
radix3: 1.0.1
ufo: 1.2.0
uncrypto: 0.1.3
unenv: 1.7.1
/has-flag@3.0.0:
resolution: {integrity: sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==}
@@ -5206,6 +5251,7 @@ packages:
/iconv-lite@0.6.3:
resolution: {integrity: sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==}
engines: {node: '>=0.10.0'}
requiresBuild: true
dependencies:
safer-buffer: 2.1.2
dev: true
@@ -5311,6 +5357,10 @@ packages:
/iron-webcrypto@0.7.0:
resolution: {integrity: sha512-WkX32iTcwd79ZsWRPP5wq1Jq6XXfPwO783ZiUBY8uMw4/AByx5WvBmxvYGnpVt6AOVJ0F41Qo420r8lIneT9Wg==}
dev: true
/iron-webcrypto@0.8.0:
resolution: {integrity: sha512-gScdcWHjTGclCU15CIv2r069NoQrys1UeUFFfaO1hL++ytLHkVw7N5nXJmFf3J2LEDMz1PkrvC0m62JEeu1axQ==}
/is-absolute-url@4.0.1:
resolution: {integrity: sha512-/51/TKE88Lmm7Gc4/8btclNXWS+g50wXhYJq8HWIBAGUBnoAdRu1aXeh364t/O7wXDAcTJDP8PNuNKWUDWie+A==}
@@ -5684,7 +5734,7 @@ packages:
http-shutdown: 1.2.2
ip-regex: 5.0.0
node-forge: 1.3.1
ufo: 1.1.2
ufo: 1.2.0
dev: true
/load-tsconfig@0.2.3:
@@ -5839,8 +5889,15 @@ packages:
'@jridgewell/sourcemap-codec': 1.4.15
dev: true
/magicast@0.2.9:
resolution: {integrity: sha512-S1WBXLSVKa34X+Bv7pfA8Umqc1BoglsqzWaQcyuexDc0cjgnERaFTSHbne2OfT27lXYxt/B/sV/2Kh0HaSQkfg==}
/magic-string@0.30.2:
resolution: {integrity: sha512-lNZdu7pewtq/ZvWUp9Wpf/x7WzMTsR26TWV03BRZrXFsv+BI6dy8RAiKgm1uM/kyR0rCfUcqvOlXKG66KhIGug==}
engines: {node: '>=12'}
dependencies:
'@jridgewell/sourcemap-codec': 1.4.15
dev: true
/magicast@0.2.10:
resolution: {integrity: sha512-Ah2qatigknxwmoYCd9hx/mmVyrRNhDKiaWZIuW4gL6dWrAGMoOpCVkQ3VpGWARtkaJVFhe8uIphcsxDzLPQUyg==}
dependencies:
'@babel/parser': 7.22.7
'@babel/types': 7.22.5
@@ -6355,7 +6412,6 @@ packages:
resolution: {integrity: sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A==}
engines: {node: '>=10.0.0'}
hasBin: true
dev: true
/mimic-fn@2.1.0:
resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==}
@@ -6535,7 +6591,7 @@ packages:
acorn: 8.8.2
pathe: 1.1.0
pkg-types: 1.0.2
ufo: 1.1.2
ufo: 1.2.0
dev: true
/mlly@1.4.0:
@@ -6544,7 +6600,7 @@ packages:
acorn: 8.10.0
pathe: 1.1.1
pkg-types: 1.0.3
ufo: 1.1.2
ufo: 1.2.0
dev: true
/mri@1.2.0:
@@ -6670,7 +6726,7 @@ packages:
serve-static: 1.15.0
source-map-support: 0.5.21
std-env: 3.3.3
ufo: 1.1.2
ufo: 1.2.0
uncrypto: 0.1.3
unenv: 1.5.2
unimport: 3.0.14(rollup@3.26.2)
@@ -7082,7 +7138,7 @@ packages:
dependencies:
destr: 2.0.0
node-fetch-native: 1.2.0
ufo: 1.1.2
ufo: 1.2.0
/ohash@1.1.2:
resolution: {integrity: sha512-9CIOSq5945rI045GFtcO3uudyOkYVY1nyfFxVQp+9BRgslr8jPNiSSrsFGg/BNTUFOLqx0P5tng6G32brIPw0w==}
@@ -7328,7 +7384,6 @@ packages:
/pathe@1.1.1:
resolution: {integrity: sha512-d+RQGp0MAYTIaDBIMmOfMwz3E+LOZnxx1HZd5R18mmCZY0QBlK0LDZfPc8FW8Ed2DlvsuE6PRjroDY+wg4+j/Q==}
dev: true
/pend@1.2.0:
resolution: {integrity: sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg==}
@@ -7892,7 +7947,7 @@ packages:
resolution: {integrity: sha512-lNeOl38Ws0eNxpO3+wD1I9rkHGQyj1NU1jlzv4go2CtEnEQEUfqnIvZG7W+bC/aXdJ27n5x/yUjb6RoT9tko+Q==}
dependencies:
defu: 6.1.2
destr: 2.0.0
destr: 2.0.1
flat: 5.0.2
dev: true
@@ -8200,14 +8255,6 @@ packages:
yargs: 17.7.2
dev: true
/rollup@3.23.0:
resolution: {integrity: sha512-h31UlwEi7FHihLe1zbk+3Q7z1k/84rb9BSwmBSr/XjOCEaBJ2YyedQDuM0t/kfOS0IxM+vk1/zI9XxYj9V+NJQ==}
engines: {node: '>=14.18.0', npm: '>=8.0.0'}
hasBin: true
optionalDependencies:
fsevents: 2.3.2
dev: true
/rollup@3.26.2:
resolution: {integrity: sha512-6umBIGVz93er97pMgQO08LuH3m6PUb3jlDUUGFsNJB6VgTCUaDFpupf5JfU30529m/UKOgmiX+uY6Sx8cOYpLA==}
engines: {node: '>=14.18.0', npm: '>=8.0.0'}
@@ -8252,6 +8299,7 @@ packages:
/safer-buffer@2.1.2:
resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==}
requiresBuild: true
dev: true
optional: true
@@ -8645,6 +8693,12 @@ packages:
acorn: 8.8.2
dev: true
/strip-literal@1.3.0:
resolution: {integrity: sha512-PugKzOsyXpArk0yWmUwqOZecSO0GH0bPoctLcqNDH9J04pVW3lflYE0ujElBGTloevcxF5MofAOZ7C5l2b+wLg==}
dependencies:
acorn: 8.10.0
dev: true
/style-dictionary-esm@1.3.7:
resolution: {integrity: sha512-xO2o8sKGera0SMLCLtix1dPvgD2ZyX2VohZ09cGRRuXBb8HQObqhgDQw4dLW+qJy4gj7r4Mdhz9J1rS2p50xDw==}
engines: {node: '>=12.0.0'}
@@ -8914,8 +8968,8 @@ packages:
resolution: {integrity: sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==}
dev: true
/tsup@7.1.0(typescript@5.1.6):
resolution: {integrity: sha512-mazl/GRAk70j8S43/AbSYXGgvRP54oQeX8Un4iZxzATHt0roW0t6HYDVZIXMw0ZQIpvr1nFMniIVnN5186lW7w==}
/tsup@7.2.0(typescript@5.1.6):
resolution: {integrity: sha512-vDHlczXbgUvY3rWvqFEbSqmC1L7woozbzngMqTtL2PGBODTtWlRwGDDawhvWzr5c1QjKe4OAKqJGfE1xeXUvtQ==}
engines: {node: '>=16.14'}
hasBin: true
peerDependencies:
@@ -8940,7 +8994,7 @@ packages:
joycon: 3.1.1
postcss-load-config: 4.0.1
resolve-from: 5.0.0
rollup: 3.23.0
rollup: 3.26.2
source-map: 0.8.0-beta.0
sucrase: 3.29.0
tree-kill: 1.2.2
@@ -9032,6 +9086,10 @@ packages:
/ufo@1.1.2:
resolution: {integrity: sha512-TrY6DsjTQQgyS3E3dBaOXf0TpPD8u9FVrVYmKVegJuFw51n/YB9XPt+U6ydzFG5ZIN7+DIjPbNmXoBj9esYhgQ==}
dev: true
/ufo@1.2.0:
resolution: {integrity: sha512-RsPyTbqORDNDxqAdQPQBpgqhWle1VcTSou/FraClYlHf6TZnQcGslpLcAphNR+sQW4q5lLWLbOsRlh9j24baQg==}
/ultrahtml@1.2.0:
resolution: {integrity: sha512-vxZM2yNvajRmCj/SknRYGNXk2tqiy6kRNvZjJLaleG3zJbSh/aNkOqD1/CVzypw8tyHyhpzYuwQgMMhUB4ZVNQ==}
@@ -9124,6 +9182,15 @@ packages:
pathe: 1.1.1
dev: true
/unenv@1.7.1:
resolution: {integrity: sha512-iINrdDcqoAjGqoIeOW85TIfI13KGgW1VWwqNO/IzcvvZ/JGBApMAQPZhWcKhE5oC/woFSpCSXg5lc7r1UaLPng==}
dependencies:
consola: 3.2.3
defu: 6.1.2
mime: 3.0.0
node-fetch-native: 1.2.0
pathe: 1.1.1
/unhead@1.1.30:
resolution: {integrity: sha512-25N/P1GnnC8EYCDerzE0hl2nOdRqS1NOFh1STEyKWRo/Bi5dXn8Z2NTaqzkbr5ExJTZEAiDfZ+eALvMTmvlXlA==}
dependencies:
@@ -9181,6 +9248,24 @@ packages:
- rollup
dev: true
/unimport@3.1.3:
resolution: {integrity: sha512-up4TE2yA+nMyyErGTjbYGVw95MriGa2hVRXQ3/JRp7984cwwqULcnBjHaovVpsO8tZc2j0fvgGu9yiBKOyxvYw==}
dependencies:
'@rollup/pluginutils': 5.0.2(rollup@3.26.2)
escape-string-regexp: 5.0.0
fast-glob: 3.3.1
local-pkg: 0.4.3
magic-string: 0.30.2
mlly: 1.4.0
pathe: 1.1.1
pkg-types: 1.0.3
scule: 1.0.0
strip-literal: 1.3.0
unplugin: 1.4.0
transitivePeerDependencies:
- rollup
dev: true
/unique-filename@2.0.1:
resolution: {integrity: sha512-ODWHtkkdx3IAR+veKxFV+VBkUMcN+FaqzUUd7IZzt+0zhDZFPFxhlqwPF3YQvMHx1TD0tdgYl+kuPnJ8E6ql7A==}
engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0}
@@ -9318,6 +9403,15 @@ packages:
webpack-virtual-modules: 0.5.0
dev: true
/unplugin@1.4.0:
resolution: {integrity: sha512-5x4eIEL6WgbzqGtF9UV8VEC/ehKptPXDS6L2b0mv4FRMkJxRtjaJfOWDd6a8+kYbqsjklix7yWP0N3SUepjXcg==}
dependencies:
acorn: 8.10.0
chokidar: 3.5.3
webpack-sources: 3.2.3
webpack-virtual-modules: 0.5.0
dev: true
/unstorage@1.8.0:
resolution: {integrity: sha512-Wl6a0fYIIPx8yWIHAVNzsNRcIpagVnBV05UXeIFCNqPZ5tu0w0MPE+eTjpRe/yxCD60K7qX55K5Px/PeKvNntw==}
peerDependencies:
@@ -9360,7 +9454,7 @@ packages:
mri: 1.2.0
node-fetch-native: 1.2.0
ofetch: 1.1.1
ufo: 1.1.2
ufo: 1.2.0
transitivePeerDependencies:
- supports-color
dev: true
@@ -9550,15 +9644,21 @@ packages:
vscode-uri: 3.0.7
dev: true
/vite-plugin-inspect@0.7.33(vite@4.3.9):
resolution: {integrity: sha512-cQRLQKa/+Ua++5hN0IZfqNn1JYXBg2eCQOSUatPTwhXMO7nwfSvhhSc45E1nXfBBEhzLLOxgr1OdbDu55PiDDA==}
/vite-plugin-inspect@0.7.38(@nuxt/kit@3.6.5)(vite@4.3.9):
resolution: {integrity: sha512-+p6pJVtBOLGv+RBrcKAFUdx+euizg0bjL35HhPyM0MjtKlqoC5V9xkCmO9Ctc8JrTyXqODbHqiLWJKumu5zJ7g==}
engines: {node: '>=14'}
peerDependencies:
'@nuxt/kit': '*'
vite: ^3.1.0 || ^4.0.0
peerDependenciesMeta:
'@nuxt/kit':
optional: true
dependencies:
'@antfu/utils': 0.7.5
'@nuxt/kit': 3.6.5(rollup@3.26.2)
'@rollup/pluginutils': 5.0.2(rollup@3.26.2)
debug: 4.3.4
error-stack-parser-es: 0.1.1
fs-extra: 11.1.1
open: 9.1.0
picocolors: 1.0.0
@@ -9569,8 +9669,8 @@ packages:
- supports-color
dev: true
/vite-plugin-vue-inspector@3.4.2(vite@4.3.9):
resolution: {integrity: sha512-q5OTkcZJqL78bwGJl1Zk8CNqtxZ9wP2udJYqyFIZzL1lTax0/oq7DhNkLrnPTxkJuf0QPZKdunb1vDyCByn4dQ==}
/vite-plugin-vue-inspector@3.6.0(vite@4.3.9):
resolution: {integrity: sha512-Fi+9JaMx/reuic+MWbrdw8g5TwZM5a/BmdBT8OKKZi3rK4Qw3wND9smT+Ld+Daitbgly17uvuCiull2KV/hEBQ==}
peerDependencies:
vite: ^3.0.0-0 || ^4.0.0-0
dependencies:
@@ -9581,7 +9681,7 @@ packages:
'@vue/compiler-dom': 3.3.4
esno: 0.16.3
kolorist: 1.8.0
magic-string: 0.30.1
magic-string: 0.30.2
shell-quote: 1.8.1
vite: 4.3.9(@types/node@20.4.2)
transitivePeerDependencies:
@@ -9664,7 +9764,7 @@ packages:
/vue-bundle-renderer@1.0.3:
resolution: {integrity: sha512-EfjX+5TTUl70bki9hPuVp+54JiZOvFIfoWBcfXsSwLzKEiDYyHNi5iX8srnqLIv3YRnvxgbntdcG1WPq0MvffQ==}
dependencies:
ufo: 1.1.2
ufo: 1.2.0
dev: true
/vue-component-meta@1.2.0(typescript@5.1.6):

View File

@@ -9,10 +9,10 @@ import type {
import {
TRPCError
} from '@trpc/server'
import { createURL } from 'ufo'
import type { H3Event } from 'h3'
import { createError, defineEventHandler, isMethod, readBody } from 'h3'
import { createError, defineEventHandler, getRequestURL, isMethod, readBody } from 'h3'
import type { TRPCResponse } from '@trpc/server/rpc'
import { getErrorShape } from '@trpc/server/shared'
type MaybePromise<T> = T | Promise<T>
@@ -40,9 +40,25 @@ export interface OnErrorPayload<TRouter extends AnyRouter> {
export type OnErrorFn<TRouter extends AnyRouter> = (opts: OnErrorPayload<TRouter>) => void
export interface ResolveHTTPRequestOptions<TRouter extends AnyRouter> {
/**
* The tRPC router to use.
* @see https://trpc.io/docs/router
*/
router: TRouter
/**
* An async function that returns the tRPC context.
* @see https://trpc.io/docs/context
*/
createContext?: CreateContextFn<TRouter>
/**
* A function that returns the response meta.
* @see https://trpc.io/docs/caching#using-responsemeta-to-cache-responses
*/
responseMeta?: ResponseMetaFn<TRouter>
/**
* A function that is called when an error occurs.
* @see https://trpc.io/docs/error-handling#handling-errors
*/
onError?: OnErrorFn<TRouter>
batching?: {
enabled: boolean
@@ -74,15 +90,16 @@ export function createNuxtApiHandler<TRouter extends AnyRouter> ({
res
} = event.node
const $url = createURL(req.url!)
const $url = getRequestURL(event)
const path = getPath(event)
if (path === null) {
const error = router.getErrorShape({
const error = getErrorShape({
config: router._def._config,
error: new TRPCError({
message:
'Param "trpc" not found - is the file named `[trpc]`.ts or `[...trpc].ts`?',
'Query "trpc" not found - is the file named `[trpc]`.ts or `[...trpc].ts`?',
code: 'INTERNAL_SERVER_ERROR'
}),
type: 'unknown',