Skip to content

Commit d5781a4

Browse files
authored
chore(integrations): convert to TypeScript and add 'test:types' so each integration type checks against the published types (#12516)
* chore(integrations): convert to TypeScript and add 'test:types' so each integration type checks against the published types * chore(integrations/react/webpack-4): use 'Node10' module resolution so 'test:types' checks the 'legacy' types webpack 4 resolves
1 parent e877443 commit d5781a4

56 files changed

Lines changed: 459 additions & 179 deletions

Some content is hidden

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

‎integrations/lit/vite/package.json‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
"private": true,
44
"type": "module",
55
"scripts": {
6-
"build": "tsc --noEmit && vite build"
6+
"build": "vite build",
7+
"test:types": "tsc --noEmit"
78
},
89
"dependencies": {
910
"@tanstack/lit-query": "workspace:*",

‎integrations/preact/vite/index.html‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
</head>
77
<body>
88
<div id="root"></div>
9-
<script type="module" src="/src/main.jsx"></script>
9+
<script type="module" src="/src/main.tsx"></script>
1010
</body>
1111
</html>

‎integrations/preact/vite/package.json‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,17 @@
33
"private": true,
44
"type": "module",
55
"scripts": {
6-
"build": "vite build"
6+
"build": "vite build",
7+
"test:types": "tsc --noEmit"
78
},
89
"dependencies": {
910
"@preact/preset-vite": "^2.10.6",
1011
"@tanstack/preact-query": "workspace:*",
1112
"@tanstack/preact-query-devtools": "workspace:*",
1213
"preact": "^11.0.1",
1314
"vite": "^8.3.5"
15+
},
16+
"devDependencies": {
17+
"typescript": "^6.0.3"
1418
}
1519
}
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { render } from 'preact'
22
import { QueryClient, QueryClientProvider } from '@tanstack/preact-query'
33
import { PreactQueryDevtools } from '@tanstack/preact-query-devtools'
4-
import App from './App.jsx'
4+
import App from './App'
55

66
const queryClient = new QueryClient()
77

@@ -10,5 +10,5 @@ render(
1010
<App />
1111
<PreactQueryDevtools />
1212
</QueryClientProvider>,
13-
document.getElementById('root'),
13+
document.getElementById('root')!,
1414
)
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"compilerOptions": {
3+
"target": "ES2020",
4+
"useDefineForClassFields": true,
5+
"module": "ESNext",
6+
"lib": ["ES2020", "DOM", "DOM.Iterable"],
7+
"skipLibCheck": true,
8+
"moduleResolution": "Bundler",
9+
"resolveJsonModule": true,
10+
"isolatedModules": true,
11+
"noEmit": true,
12+
"jsx": "react-jsx",
13+
"jsxImportSource": "preact",
14+
"strict": true,
15+
"noUnusedLocals": true,
16+
"noUnusedParameters": true,
17+
"noFallthroughCasesInSwitch": true
18+
},
19+
"include": ["src", "*.config.ts"]
20+
}

‎integrations/react/vite/index.html‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
</head>
77
<body>
88
<div id="root"></div>
9-
<script type="module" src="/src/main.jsx"></script>
9+
<script type="module" src="/src/main.tsx"></script>
1010
</body>
1111
</html>

‎integrations/react/vite/package.json‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
"private": true,
44
"type": "module",
55
"scripts": {
6-
"build": "vite build"
6+
"build": "vite build",
7+
"test:types": "tsc --noEmit"
78
},
89
"dependencies": {
910
"@tanstack/react-query": "workspace:*",
@@ -12,5 +13,10 @@
1213
"react": "^19.3.1",
1314
"react-dom": "^19.3.1",
1415
"vite": "^8.3.5"
16+
},
17+
"devDependencies": {
18+
"@types/react": "^19.3.0",
19+
"@types/react-dom": "^19.3.0",
20+
"typescript": "^6.0.3"
1521
}
1622
}
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import React from 'react'
21
import { useQuery } from '@tanstack/react-query'
32

43
const App = () => {

0 commit comments

Comments
 (0)