Skip to content

Commit ceb6be3

Browse files
authored
chore: fix tanstack-query tests (#2210)
1 parent 6d11737 commit ceb6be3

File tree

43 files changed

+118
-104
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+118
-104
lines changed

packages/misc/redwood/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"listr2": "^6.0.0",
4747
"semver": "^7.5.2",
4848
"terminal-link": "^2.0.0",
49-
"ts-morph": "^16.0.0",
49+
"ts-morph": "^26.0.0",
5050
"yargs": "^17.7.2"
5151
},
5252
"devDependencies": {

packages/plugins/swr/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"@zenstackhq/sdk": "workspace:*",
4343
"cross-fetch": "^4.0.0",
4444
"semver": "^7.5.2",
45-
"ts-morph": "^16.0.0",
45+
"ts-morph": "^26.0.0",
4646
"ts-pattern": "^4.3.0"
4747
},
4848
"peerDependencies": {

packages/plugins/tanstack-query/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
"@zenstackhq/sdk": "workspace:*",
8585
"cross-fetch": "^4.0.0",
8686
"semver": "^7.5.2",
87-
"ts-morph": "^16.0.0",
87+
"ts-morph": "^26.0.0",
8888
"ts-pattern": "^4.3.0"
8989
},
9090
"devDependencies": {

packages/plugins/tanstack-query/tests/plugin.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ model Foo {
6565
useInfiniteFindManypost_Item({ where: { published: true } });
6666
useInfiniteFindManypost_Item(undefined, { enabled: true, getNextPageParam: () => null });
6767
console.log(queryKey);
68-
console.log(data?.pages[0][0].published);
68+
console.log(data?.pages[0]?.[0]?.published);
6969
console.log(data?.pageParams[0]);
7070
}
7171
@@ -130,7 +130,7 @@ ${sharedModel}
130130
useSuspenseInfiniteFindManypost_Item({ where: { published: true } });
131131
useSuspenseInfiniteFindManypost_Item(undefined, { getNextPageParam: () => null });
132132
console.log(queryKey);
133-
console.log(data?.pages[0][0].published);
133+
console.log(data?.pages[0]?.[0]?.published);
134134
console.log(data?.pageParams[0]);
135135
}
136136
`,
@@ -157,7 +157,7 @@ ${sharedModel}
157157
useInfiniteFindManypost_Item({ where: { published: true } }, { enabled: true, getNextPageParam: () => null });
158158
useInfiniteFindManypost_Item(undefined, { getNextPageParam: () => null });
159159
console.log(queryKey);
160-
console.log(data.value?.pages[0][0].published);
160+
console.log(data.value?.pages[0]?.[0]?.published);
161161
console.log(data.value?.pageParams[0]);
162162
}
163163
@@ -233,7 +233,7 @@ ${sharedModel}
233233
useInfiniteFindManypost_Item({ where: { published: true } });
234234
useInfiniteFindManypost_Item(undefined, { enabled: true, getNextPageParam: () => null });
235235
console.log(queryKey);
236-
console.log(data?.pages[0][0].published);
236+
console.log(data?.pages[0]?.[0]?.published);
237237
console.log(data?.pageParams[0]);
238238
}
239239

packages/plugins/tanstack-query/tests/portable.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ describe('Tanstack Query Plugin Portable Tests', () => {
4141
import { useFindUniqueUser } from './hooks';
4242
const { data } = useFindUniqueUser({ where: { id: 1 }, include: { posts: true } });
4343
console.log(data?.email);
44-
console.log(data?.posts[0].title);
44+
console.log(data?.posts[0]?.title);
4545
`,
4646
},
4747
],
@@ -101,7 +101,7 @@ console.log(data?.posts[0].title);
101101
import { useFindUniqueUser } from './hooks';
102102
const { data } = useFindUniqueUser({ where: { id: 1 }, include: { posts: true } });
103103
console.log(data?.email);
104-
console.log(data?.posts[0].title);
104+
console.log(data?.posts[0]?.title);
105105
`,
106106
},
107107
],

packages/plugins/trpc/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"dependencies": {
2929
"@zenstackhq/runtime": "workspace:*",
3030
"@zenstackhq/sdk": "workspace:*",
31-
"ts-morph": "^16.0.0",
31+
"ts-morph": "^26.0.0",
3232
"tslib": "^2.4.1"
3333
},
3434
"peerDependencies": {

packages/plugins/trpc/tests/projects/nuxt-trpc-v10/server/trpc/routers/generated/client/Post.nuxt.type.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/******************************************************************************
2-
* This file was generated by ZenStack CLI 2.9.0.
3-
******************************************************************************/
2+
* This file was generated by ZenStack CLI.
3+
******************************************************************************/
44

55
/* eslint-disable */
66
// @ts-nocheck

packages/plugins/trpc/tests/projects/nuxt-trpc-v10/server/trpc/routers/generated/client/User.nuxt.type.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/******************************************************************************
2-
* This file was generated by ZenStack CLI 2.9.0.
3-
******************************************************************************/
2+
* This file was generated by ZenStack CLI.
3+
******************************************************************************/
44

55
/* eslint-disable */
66
// @ts-nocheck

packages/plugins/trpc/tests/projects/nuxt-trpc-v10/server/trpc/routers/generated/client/nuxt.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/******************************************************************************
2-
* This file was generated by ZenStack CLI 2.9.0.
3-
******************************************************************************/
2+
* This file was generated by ZenStack CLI.
3+
******************************************************************************/
44

55
/* eslint-disable */
66
// @ts-nocheck

packages/plugins/trpc/tests/projects/nuxt-trpc-v10/server/trpc/routers/generated/client/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/******************************************************************************
2-
* This file was generated by ZenStack CLI 2.9.0.
3-
******************************************************************************/
2+
* This file was generated by ZenStack CLI.
3+
******************************************************************************/
44

55
/* eslint-disable */
66
// @ts-nocheck

0 commit comments

Comments
 (0)