Skip to content

Commit 9203196

Browse files
feat: trpc v11 (#6)
* feat: upgrade to trpc v11 * chore: bump to v0.5.0-rc.0 * build(deps): upgrade deps * feat: useInfiniteQuery() * style: lint * ci(deploy): publish with --no-git-checks * chore: bump to v0.5.0-rc.1 * chore(peerDeps): set trpc to v11 * feat(types): use exact input types (don't allow not defined properties) * ci(release): run deploy with new ref * chore: release v0.5.0-rc.2 * fix(types): case where input is void * chore: release v0.5.0-rc.3 * fix(exact): improve Exact type * chore: release v0.5.0-rc.4 * fix(types): improve exact safety * chore: release v0.5.0-rc.5 * fix(types): add inferAsyncIterableYield for subscription data * chore: release v0.5.0-rc.6 * feat: useQueries() * ci: use `simple-dist-tag` for automatic dist tag for npm publish * chore: release v0.5.0-rc.7 * build: fix trpc peer-dependency version tags Fixes #7 * chore: release v0.5.0-rc.8 * feat: make input available in useQueries() combine() * chore: release v0.5.0-rc.9 * fix: types for useQueries() * chore: release v0.5.0-rc.10 * fix: only include input in useQueries() * chore: release v0.5.0-rc.11 * fix: input change did not retrigger query * chore: release v0.5.0-rc.12 * fix: cache collision with useQuery & useQueries * chore: release v0.5.0-rc.13 * build(deps): upgrade deps * feat: support skipToken in useQuery() * chore: release v0.5.0-rc.14 * fix: actually skip request on skipToken * chore: release v0.5.0-rc.15 * fix: don't return undefined, return skipToken instead * chore: release v0.5.0-rc.16 * fix: set skipToken as queryFn, not as return value * chore: release v0.5.0-rc.17 * test: fix skipToken tests * ci(cd-cd): add test * ci(deploy): update node * ci(deploy): use inputs * fix(types): using Exact in generic breaks it * chore: release v0.5.0-rc.18 * style: lint * refactor: use trpc v11 release * chore: release v0.5.0-rc.19 * ci(deploy): use pnpm 10 * chore: release v0.5.0-rc.20 --------- Co-authored-by: Julian Meinking <12785972+DrJume@users.noreply.github.com>
1 parent fa020c0 commit 9203196

File tree

21 files changed

+7184
-5704
lines changed

21 files changed

+7184
-5704
lines changed

.github/workflows/ci-cd.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,13 @@ jobs:
3535
uses: falcondev-it/.github/actions/pnpm-install@master
3636

3737
- run: pnpm run type-check
38+
39+
test:
40+
name: 🧪 Unit Tests
41+
needs: [type-check]
42+
runs-on: ubuntu-latest
43+
steps:
44+
- name: pnpm install
45+
uses: falcondev-it/.github/actions/pnpm-install@master
46+
47+
- run: pnpm run test

.github/workflows/deploy.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,23 +20,25 @@ jobs:
2020

2121
steps:
2222
- uses: actions/checkout@v4
23+
with:
24+
ref: ${{ inputs.ref }}
2325

2426
- uses: pnpm/action-setup@v3
2527
with:
26-
version: 9
28+
version: 10
2729

2830
- uses: actions/setup-node@v4
2931
with:
30-
node-version: 20.x
32+
node-version: 22.x
3133
cache: pnpm
3234
registry-url: https://registry.npmjs.org
3335

3436
- run: pnpm install --frozen-lockfile
3537

36-
- name: build
38+
- name: Build
3739
run: pnpm build
3840

3941
- name: Publish
40-
run: pnpm publish
42+
run: pnpm publish --no-git-checks --tag $(npx simple-dist-tag)
4143
env:
4244
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/release.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,5 @@ jobs:
5959
needs: [release]
6060
uses: ./.github/workflows/deploy.yml
6161
secrets: inherit
62+
with:
63+
ref: ${{ needs.release.outputs.RELEASE_REF }}

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,6 @@
2323
{
2424
"mode": "auto"
2525
}
26-
]
26+
],
27+
"typescript.tsdk": "node_modules/typescript/lib"
2728
}

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,10 @@ pnpm add @falcondev-oss/trpc-vue-query
2020

2121
```ts
2222
import { createTRPCVueQueryClient } from '@falcondev-oss/trpc-vue-query'
23-
import type { AppRouter } from '../your_server/trpc'
2423
import { VueQueryPlugin, useQueryClient } from '@tanstack/vue-query'
2524

25+
import type { AppRouter } from '../your_server/trpc'
26+
2627
app.use(VueQueryPlugin)
2728
app.use({
2829
install(app) {
@@ -45,6 +46,7 @@ app.use({
4546

4647
```ts
4748
import { createTRPCVueQueryClient } from '@falcondev-oss/trpc-vue-query'
49+
4850
import type { AppRouter } from '../your_server/trpc'
4951

5052
export function useTRPC() {
@@ -116,6 +118,7 @@ Setup `trpc-nuxt` as described in their [documentation](https://trpc-nuxt.vercel
116118
import { createTRPCVueQueryClient } from '@falcondev-oss/trpc-vue-query'
117119
import { useQueryClient } from '@tanstack/vue-query'
118120
import { httpBatchLink } from 'trpc-nuxt/client'
121+
119122
import type { AppRouter } from '~/server/trpc/routers'
120123

121124
export default defineNuxtPlugin(() => {

docs/content/1.getting-started/1.index.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ import { VueQueryPlugin, useQueryClient } from '@tanstack/vue-query'
3333
import { httpBatchLink } from '@trpc/client'
3434
import type { AppRouter } from '../your_server/trpc'
3535

36+
import type { AppRouter } from '../your_server/trpc'
37+
3638
app.use(VueQueryPlugin)
3739
app.use({
3840
install(app) {
@@ -55,6 +57,7 @@ app.use({
5557

5658
```ts [composables/useTRPC.ts]
5759
import { createTRPCVueQueryClient } from '@falcondev-oss/trpc-vue-query'
60+
5861
import type { AppRouter } from '../your_server/trpc'
5962

6063
export function useTRPC() {
@@ -70,6 +73,7 @@ Setup `trpc-nuxt` as described in their [documentation](https://trpc-nuxt.vercel
7073
import { createTRPCVueQueryClient } from '@falcondev-oss/trpc-vue-query'
7174
import { useQueryClient } from '@tanstack/vue-query'
7275
import { httpBatchLink } from 'trpc-nuxt/client'
76+
7377
import type { AppRouter } from '~/server/trpc/routers'
7478

7579
export default defineNuxtPlugin(() => {

docs/content/1.getting-started/2.usage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ You can pass options as the second argument to the `useQuery` function.
3131
```vue
3232
<script lang="ts" setup>
3333
const { data: notifications } = useTRPC().notifications.get.useQuery(undefined, {
34-
refetchInterval: 30000,
34+
refetchInterval: 30_000,
3535
})
3636
</script>
3737
```

docs/content/composables/1.useQuery.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ You can pass any `@tanstack/vue-query` options as the second argument to the `us
2929
```vue
3030
<script lang="ts" setup>
3131
const { data: notifications } = useTRPC().notifications.get.useQuery(undefined, {
32-
refetchInterval: 30000,
32+
refetchInterval: 30_000,
3333
})
3434
</script>
3535
```

docs/error.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<script setup lang="ts">
22
import type { NuxtError } from '#app'
3-
import type { ParsedContent } from '@nuxt/content/dist/runtime/types'
3+
import type { ParsedContent } from '@nuxt/content'
44
55
defineProps({
66
error: {

docs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@
1818
"nuxt": "^3.14.1592"
1919
},
2020
"devDependencies": {
21-
"@nuxthq/studio": "^1.1.2"
21+
"@nuxthq/studio": "^2.1.1"
2222
}
2323
}

0 commit comments

Comments
 (0)