From ee85f3ccd1e14044c64f69648c7516210ed95405 Mon Sep 17 00:00:00 2001 From: wobsoriano Date: Sun, 18 Dec 2022 15:35:56 -0800 Subject: [PATCH 01/17] feat: add custom Nuxt client --- client.d.ts | 1 + package.json | 12 +- playground/package.json | 4 +- playground/pages/index.vue | 12 +- playground/plugins/trpc-client.ts | 55 ++- pnpm-lock.yaml | 754 ++++++++++++++++++++++++++---- src/client/index.ts | 89 ++++ src/client/types.ts | 94 ++++ tsup.config.ts | 4 +- 9 files changed, 901 insertions(+), 124 deletions(-) create mode 100644 client.d.ts create mode 100644 src/client/index.ts create mode 100644 src/client/types.ts diff --git a/client.d.ts b/client.d.ts new file mode 100644 index 0000000..c3ef8ee --- /dev/null +++ b/client.d.ts @@ -0,0 +1 @@ +export * from './dist/client/index' diff --git a/package.json b/package.json index 20a24e7..79c463d 100644 --- a/package.json +++ b/package.json @@ -9,13 +9,19 @@ ".": { "require": "./dist/index.cjs", "import": "./dist/index.mjs" + }, + "./client": { + "types": "./dist/client/index.d.ts", + "require": "./dist/client/index.cjs", + "import": "./dist/client/index.mjs" } }, "main": "./dist/index.mjs", "module": "./dist/index.mjs", "types": "./dist/index.d.ts", "files": [ - "dist" + "dist", + "client.d.ts" ], "scripts": { "dev": "concurrently \"pnpm build -- --watch\" \"pnpm --filter playground dev\"", @@ -38,8 +44,8 @@ }, "devDependencies": { "@nuxtjs/eslint-config-typescript": "^11.0.0", - "@trpc/client": "^10.1.0", - "@trpc/server": "^10.1.0", + "@trpc/client": "^10.5.0", + "@trpc/server": "^10.5.0", "bumpp": "^8.2.1", "concurrently": "^7.5.0", "eslint": "^8.25.0", diff --git a/playground/package.json b/playground/package.json index c24b7ef..907d1bb 100644 --- a/playground/package.json +++ b/playground/package.json @@ -9,8 +9,8 @@ "postinstall": "nuxt prepare" }, "dependencies": { - "@trpc/client": "^10.1.0", - "@trpc/server": "^10.1.0", + "@trpc/client": "^10.5.0", + "@trpc/server": "^10.5.0", "superjson": "^1.11.0", "trpc-nuxt": "workspace:*", "zod": "^3.19.1" diff --git a/playground/pages/index.vue b/playground/pages/index.vue index 07ff363..f2fead8 100644 --- a/playground/pages/index.vue +++ b/playground/pages/index.vue @@ -1,15 +1,12 @@