Skip to content

Commit 6c79808

Browse files
docs(examples): Clean-up example config (TanStack#6817)
* docs(examples): Clean-up example config * Add missing skipLibCheck * Quick fix * Add any * Use default vite tsconfig
1 parent da5f40e commit 6c79808

File tree

44 files changed

+176
-175
lines changed

Some content is hidden

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

44 files changed

+176
-175
lines changed

examples/angular/basic/package.json

+2-3
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,11 @@
33
"private": true,
44
"type": "module",
55
"scripts": {
6-
"start": "vite",
76
"dev": "vite",
87
"build": "vite build",
9-
"serve": "vite preview"
8+
"preview": "vite preview",
9+
"test:types": "tsc"
1010
},
11-
"license": "MIT",
1211
"dependencies": {
1312
"@angular/common": "^17.0.8",
1413
"@angular/compiler": "^17.0.8",

examples/angular/cli-standalone-17/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
"name": "@tanstack/query-example-angular-cli-standalone-17",
33
"private": true,
44
"scripts": {
5-
"build": "ng build"
5+
"build": "ng build",
6+
"test:types": "tsc"
67
},
78
"dependencies": {
89
"@angular/animations": "^17.0.8",

examples/angular/default-query-function/package.json

+2-3
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,11 @@
33
"private": true,
44
"type": "module",
55
"scripts": {
6-
"start": "vite",
76
"dev": "vite",
87
"build": "vite build",
9-
"serve": "vite preview"
8+
"preview": "vite preview",
9+
"test:types": "tsc"
1010
},
11-
"license": "MIT",
1211
"dependencies": {
1312
"@angular/common": "^17.0.8",
1413
"@angular/compiler": "^17.0.8",

examples/angular/simple/package.json

+2-3
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,11 @@
33
"private": true,
44
"type": "module",
55
"scripts": {
6-
"start": "vite",
76
"dev": "vite",
87
"build": "vite build",
9-
"serve": "vite preview"
8+
"preview": "vite preview",
9+
"test:types": "tsc"
1010
},
11-
"license": "MIT",
1211
"dependencies": {
1312
"@angular/common": "^17.0.8",
1413
"@angular/compiler": "^17.0.8",

examples/react/algolia/tsconfig.json

+14-10
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,24 @@
11
{
22
"compilerOptions": {
33
"target": "ES2020",
4-
"lib": ["dom", "dom.iterable", "esnext"],
5-
"allowJs": true,
4+
"useDefineForClassFields": true,
5+
"lib": ["ES2020", "DOM", "DOM.Iterable"],
6+
"module": "ESNext",
67
"skipLibCheck": true,
7-
"esModuleInterop": true,
8-
"allowSyntheticDefaultImports": true,
9-
"strict": true,
10-
"forceConsistentCasingInFileNames": true,
11-
"noFallthroughCasesInSwitch": true,
12-
"module": "esnext",
13-
"moduleResolution": "node",
8+
9+
/* Bundler mode */
10+
"moduleResolution": "bundler",
11+
"allowImportingTsExtensions": true,
1412
"resolveJsonModule": true,
1513
"isolatedModules": true,
1614
"noEmit": true,
17-
"jsx": "react-jsx"
15+
"jsx": "react-jsx",
16+
17+
/* Linting */
18+
"strict": true,
19+
"noUnusedLocals": true,
20+
"noUnusedParameters": true,
21+
"noFallthroughCasesInSwitch": true
1822
},
1923
"include": ["src"]
2024
}
+5-7
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
{
22
"name": "@tanstack/query-example-react-auto-refetching",
33
"private": true,
4-
"main": "index.js",
5-
"license": "MIT",
4+
"scripts": {
5+
"dev": "next",
6+
"build": "next build",
7+
"start": "next start"
8+
},
69
"dependencies": {
710
"@tanstack/react-query": "^5.18.1",
811
"@tanstack/react-query-devtools": "^5.18.1",
@@ -11,10 +14,5 @@
1114
"next": "^14.0.0",
1215
"react": "^18.2.0",
1316
"react-dom": "^18.2.0"
14-
},
15-
"scripts": {
16-
"dev": "next",
17-
"start": "next start",
18-
"build": "next build"
1917
}
2018
}
+14-10
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,24 @@
11
{
22
"compilerOptions": {
33
"target": "ES2020",
4-
"lib": ["dom", "dom.iterable", "esnext"],
5-
"allowJs": true,
4+
"useDefineForClassFields": true,
5+
"lib": ["ES2020", "DOM", "DOM.Iterable"],
6+
"module": "ESNext",
67
"skipLibCheck": true,
7-
"esModuleInterop": true,
8-
"allowSyntheticDefaultImports": true,
9-
"strict": true,
10-
"forceConsistentCasingInFileNames": true,
11-
"noFallthroughCasesInSwitch": true,
12-
"module": "esnext",
13-
"moduleResolution": "node",
8+
9+
/* Bundler mode */
10+
"moduleResolution": "bundler",
11+
"allowImportingTsExtensions": true,
1412
"resolveJsonModule": true,
1513
"isolatedModules": true,
1614
"noEmit": true,
17-
"jsx": "react-jsx"
15+
"jsx": "react-jsx",
16+
17+
/* Linting */
18+
"strict": true,
19+
"noUnusedLocals": true,
20+
"noUnusedParameters": true,
21+
"noFallthroughCasesInSwitch": true
1822
},
1923
"include": ["src"]
2024
}
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { defineConfig } from 'vite'
22
import react from '@vitejs/plugin-react'
33

4-
// https://vitejs.dev/config/
54
export default defineConfig({
65
plugins: [react()],
76
})
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
{
22
"name": "@tanstack/query-example-react-infinite-query-with-max-pages",
33
"private": true,
4-
"main": "index.js",
5-
"license": "MIT",
4+
"scripts": {
5+
"dev": "next",
6+
"build": "next build",
7+
"start": "next start"
8+
},
69
"dependencies": {
710
"@tanstack/react-query": "^5.18.1",
811
"@tanstack/react-query-devtools": "^5.18.1",
@@ -12,10 +15,5 @@
1215
"react": "^18.2.0",
1316
"react-dom": "^18.2.0",
1417
"react-intersection-observer": "^8.34.0"
15-
},
16-
"scripts": {
17-
"dev": "next",
18-
"start": "next start",
19-
"build": "next build"
2018
}
2119
}
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
{
22
"name": "@tanstack/query-example-react-load-more-infinite-scroll",
33
"private": true,
4-
"main": "index.js",
5-
"license": "MIT",
4+
"scripts": {
5+
"dev": "next",
6+
"build": "next build",
7+
"start": "next start"
8+
},
69
"dependencies": {
710
"@tanstack/react-query": "^5.18.1",
811
"@tanstack/react-query-devtools": "^5.18.1",
@@ -12,10 +15,5 @@
1215
"react": "^18.2.0",
1316
"react-dom": "^18.2.0",
1417
"react-intersection-observer": "^8.34.0"
15-
},
16-
"scripts": {
17-
"dev": "next",
18-
"start": "next start",
19-
"build": "next build"
2018
}
2119
}

examples/react/nextjs-suspense-streaming/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
22
"name": "@tanstack/query-example-nextjs-suspense-streaming",
33
"private": true,
4-
"license": "MIT",
54
"scripts": {
65
"dev": "next dev",
76
"build": "next build",
8-
"start": "next start"
7+
"start": "next start",
8+
"test:types": "tsc"
99
},
1010
"dependencies": {
1111
"@tanstack/react-query": "^5.18.1",

examples/react/nextjs/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"name": "@tanstack/query-example-react-nextjs",
33
"private": true,
4-
"license": "MIT",
54
"scripts": {
65
"dev": "next",
76
"build": "next build",
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
{
22
"name": "@tanstack/query-example-react-optimistic-updates-cache",
33
"private": true,
4-
"main": "pages/index.tsx",
5-
"license": "MIT",
4+
"scripts": {
5+
"dev": "next",
6+
"build": "next build",
7+
"start": "next start",
8+
"test:types": "tsc"
9+
},
610
"dependencies": {
711
"@tanstack/react-query": "^5.18.1",
812
"@tanstack/react-query-devtools": "^5.18.1",
@@ -17,10 +21,5 @@
1721
"@types/react": "^18.2.45",
1822
"@types/react-dom": "^18.2.18",
1923
"typescript": "5.2.2"
20-
},
21-
"scripts": {
22-
"dev": "next",
23-
"start": "next start",
24-
"build": "next build"
2524
}
2625
}
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
{
22
"name": "@tanstack/query-example-react-optimistic-updates-ui",
33
"private": true,
4-
"main": "pages/index.tsx",
5-
"license": "MIT",
4+
"scripts": {
5+
"dev": "next",
6+
"build": "next build",
7+
"start": "next start"
8+
},
69
"dependencies": {
710
"@tanstack/react-query": "^5.18.1",
811
"@tanstack/react-query-devtools": "^5.18.1",
@@ -17,10 +20,5 @@
1720
"@types/react": "^18.2.45",
1821
"@types/react-dom": "^18.2.18",
1922
"typescript": "5.2.2"
20-
},
21-
"scripts": {
22-
"dev": "next",
23-
"start": "next start",
24-
"build": "next build"
2523
}
2624
}
+5-7
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
{
22
"name": "@tanstack/query-example-react-pagination",
33
"private": true,
4-
"main": "index.js",
5-
"license": "MIT",
4+
"scripts": {
5+
"dev": "next",
6+
"build": "next build",
7+
"start": "next start"
8+
},
69
"dependencies": {
710
"@tanstack/react-query": "^5.18.1",
811
"@tanstack/react-query-devtools": "^5.18.1",
@@ -11,10 +14,5 @@
1114
"next": "^14.0.0",
1215
"react": "^18.2.0",
1316
"react-dom": "^18.2.0"
14-
},
15-
"scripts": {
16-
"dev": "next",
17-
"start": "next start",
18-
"build": "next build"
1917
}
2018
}
+5-7
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
{
22
"name": "@tanstack/query-example-react-prefetching",
33
"private": true,
4-
"main": "index.js",
5-
"license": "MIT",
4+
"scripts": {
5+
"dev": "next",
6+
"build": "next build",
7+
"start": "next start"
8+
},
69
"dependencies": {
710
"@tanstack/react-query": "^5.18.1",
811
"@tanstack/react-query-devtools": "^5.18.1",
@@ -11,10 +14,5 @@
1114
"next": "^14.0.0",
1215
"react": "^18.2.0",
1316
"react-dom": "^18.2.0"
14-
},
15-
"scripts": {
16-
"dev": "next",
17-
"start": "next start",
18-
"build": "next build"
1917
}
2018
}

examples/solid/README.md

-22
This file was deleted.

examples/solid/basic-graphql-request/package.json

+2-3
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,11 @@
33
"private": true,
44
"type": "module",
55
"scripts": {
6-
"start": "vite",
76
"dev": "vite",
87
"build": "vite build",
9-
"serve": "vite preview"
8+
"preview": "vite preview",
9+
"test:types": "tsc"
1010
},
11-
"license": "MIT",
1211
"dependencies": {
1312
"@tanstack/solid-query": "^5.18.1",
1413
"@tanstack/solid-query-devtools": "^5.18.1",

examples/solid/basic-graphql-request/src/index.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ function createPosts() {
4545
queryFn: async () => {
4646
const {
4747
posts: { data },
48-
} = await request(
48+
} = await request<any>(
4949
endpoint,
5050
gql`
5151
query {
@@ -114,7 +114,7 @@ function createPost(postId: Accessor<number>) {
114114
return createQuery(() => ({
115115
queryKey: ['post', postId()],
116116
queryFn: async (context) => {
117-
const { post } = await request(
117+
const { post } = await request<any>(
118118
endpoint,
119119
gql`
120120
query {

0 commit comments

Comments
 (0)