Skip to content

Commit 77bd2c3

Browse files
chore: Bundler integration tests (#5756)
* Add react-cra5 test * Add react-cra4 test * Add react-vite test * Add svelte-vite test * Add solid-vite test * Run prettier * Rename script to test:bundle * Add vue-vite test * Run prettier
1 parent b167883 commit 77bd2c3

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

+20624
-8927
lines changed

.github/workflows/pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
with:
4646
timeout_minutes: 5
4747
max_attempts: 3
48-
command: npx nx affected --targets=test:eslint,test:lib,test:types,test:build
48+
command: npx nx affected --targets=test:eslint,test:lib,test:types,test:build,test:bundle
4949
- name: Stop Agents
5050
run: npx nx-cloud stop-all-agents
5151
- name: Upload coverage to Codecov

integrations/react-cra4/.gitignore

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
8+
# testing
9+
/coverage
10+
11+
# production
12+
/build
13+
14+
# misc
15+
.DS_Store
16+
.env.local
17+
.env.development.local
18+
.env.test.local
19+
.env.production.local
20+
21+
npm-debug.log*
22+
yarn-debug.log*
23+
yarn-error.log*
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"name": "react-cra4",
3+
"private": true,
4+
"scripts": {
5+
"test:bundle": "cross-env DISABLE_ESLINT_PLUGIN=true SKIP_PREFLIGHT_CHECK=true NODE_OPTIONS=--openssl-legacy-provider react-scripts build"
6+
},
7+
"dependencies": {
8+
"@tanstack/react-query": "workspace:*",
9+
"@tanstack/react-query-devtools": "workspace:*",
10+
"react": "^18.2.0",
11+
"react-dom": "^18.2.0",
12+
"react-scripts": "^4.0.3"
13+
},
14+
"browserslist": {
15+
"production": [
16+
">0.2%",
17+
"not dead",
18+
"not op_mini all"
19+
],
20+
"development": [
21+
"last 1 chrome version",
22+
"last 1 firefox version",
23+
"last 1 safari version"
24+
]
25+
}
26+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<title>React App</title>
6+
</head>
7+
<body>
8+
<noscript>You need to enable JavaScript to run this app.</noscript>
9+
<div id="root"></div>
10+
</body>
11+
</html>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { useQuery } from '@tanstack/react-query'
2+
3+
export const App = () => {
4+
const query = useQuery({
5+
queryKey: ['test'],
6+
queryFn: async () => {
7+
await new Promise((r) => setTimeout(r, 1000))
8+
return 'Success'
9+
},
10+
})
11+
12+
if (query.isPending) {
13+
return <div>Loading...</div>
14+
}
15+
16+
if (query.isError) {
17+
return <div>An error has occurred!</div>
18+
}
19+
20+
return <div>{query.data}</div>
21+
}
22+
23+
export default App
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import React from 'react'
2+
import ReactDOM from 'react-dom/client'
3+
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
4+
import { ReactQueryDevtools } from '@tanstack/react-query-devtools'
5+
import App from './App'
6+
7+
const queryClient = new QueryClient()
8+
9+
const root = ReactDOM.createRoot(document.getElementById('root'))
10+
11+
root.render(
12+
<React.StrictMode>
13+
<QueryClientProvider client={queryClient}>
14+
<App />
15+
<ReactQueryDevtools />
16+
</QueryClientProvider>
17+
</React.StrictMode>,
18+
)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/// <reference types="react-scripts" />

integrations/react-cra5/.gitignore

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
8+
# testing
9+
/coverage
10+
11+
# production
12+
/build
13+
14+
# misc
15+
.DS_Store
16+
.env.local
17+
.env.development.local
18+
.env.test.local
19+
.env.production.local
20+
21+
npm-debug.log*
22+
yarn-debug.log*
23+
yarn-error.log*
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"name": "react-cra5",
3+
"private": true,
4+
"scripts": {
5+
"test:bundle": "cross-env DISABLE_ESLINT_PLUGIN=true react-scripts build"
6+
},
7+
"dependencies": {
8+
"@tanstack/react-query": "workspace:*",
9+
"@tanstack/react-query-devtools": "workspace:*",
10+
"react": "^18.2.0",
11+
"react-dom": "^18.2.0",
12+
"react-scripts": "^5.0.1"
13+
},
14+
"browserslist": {
15+
"production": [
16+
">0.2%",
17+
"not dead",
18+
"not op_mini all"
19+
],
20+
"development": [
21+
"last 1 chrome version",
22+
"last 1 firefox version",
23+
"last 1 safari version"
24+
]
25+
}
26+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<title>React App</title>
6+
</head>
7+
<body>
8+
<noscript>You need to enable JavaScript to run this app.</noscript>
9+
<div id="root"></div>
10+
</body>
11+
</html>

0 commit comments

Comments
 (0)