Skip to content

Commit 4ede1dd

Browse files
authored
Merge pull request #133 from hmousavin/main
#11392 Migrate docs example sandboxes to use Vite instead of CRA
2 parents 7c9ed4e + 85db125 commit 4ede1dd

32 files changed

+13780
-44832
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
4+
<head>
5+
<meta charset="utf-8" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
7+
<meta name="theme-color" content="#000000" />
8+
<title>AC Docs > Get started with Apollo Client</title>
9+
</head>
10+
11+
<body>
12+
<noscript> You need to enable JavaScript to run this app. </noscript>
13+
<div id="root"></div>
14+
<script type="module" src="src/index.tsx"></script>
15+
</body>
16+
17+
</html>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/** @type {import('ts-jest').JestConfigWithTsJest} **/
2+
module.exports = {
3+
testEnvironment: "node",
4+
transform: {
5+
"^.+.tsx?$": ["ts-jest",{}],
6+
},
7+
preset: "ts-jest"
8+
};

apollo-client/v3/getting-started/package-lock.json

Lines changed: 4267 additions & 14891 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apollo-client/v3/getting-started/package.json

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,18 @@
77
"main": "src/index.js",
88
"dependencies": {
99
"@apollo/client": "3.7.17",
10+
"@vitejs/plugin-react": "^4.3.1",
1011
"graphql": "16.8.1",
1112
"react": "18.2.0",
1213
"react-dom": "18.2.0",
13-
"react-scripts": "5.0.1"
14+
"vite": "^5.3.4",
15+
"vite-tsconfig-paths": "^4.3.2"
1416
},
1517
"scripts": {
16-
"start": "react-scripts start",
17-
"build": "react-scripts build",
18-
"test": "react-scripts test --env=jsdom",
19-
"eject": "react-scripts eject"
18+
"start": "vite",
19+
"build": "vite build",
20+
"test": "jest",
21+
"eject": "vite eject"
2022
},
2123
"browserslist": {
2224
"production": [
@@ -29,5 +31,11 @@
2931
"last 1 firefox version",
3032
"last 1 safari version"
3133
]
34+
},
35+
"devDependencies": {
36+
"@types/jest": "^29.5.12",
37+
"jest": "^29.7.0",
38+
"ts-jest": "^29.2.3",
39+
"typescript": "^5.5.4"
3240
}
33-
}
41+
}

apollo-client/v3/getting-started/public/index.html

Lines changed: 0 additions & 16 deletions
This file was deleted.
Lines changed: 1 addition & 0 deletions
Loading

apollo-client/v3/getting-started/src/App.js renamed to apollo-client/v3/getting-started/src/App.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { useQuery, gql } from "@apollo/client";
2+
import React from "react";
23

34
const GET_LOCATIONS = gql`
45
query getLocations {
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/// <reference types="vite/client" />
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { defineConfig } from 'vite'
2+
import react from '@vitejs/plugin-react'
3+
import viteTsconfigPaths from 'vite-tsconfig-paths'
4+
5+
export default defineConfig({
6+
base: '',
7+
plugins: [react(), viteTsconfigPaths()],
8+
server: {
9+
open: true,
10+
port: 3000,
11+
},
12+
})

0 commit comments

Comments
 (0)