Skip to content

Commit 5bc7b84

Browse files
authored
update vite to v5 (#3657)
* aa * update vite to v5 * aa * fix tests * fix * Update .changeset/fifty-swans-care.md
1 parent 93c7e9f commit 5bc7b84

File tree

21 files changed

+791
-546
lines changed

21 files changed

+791
-546
lines changed

.changeset/fifty-swans-care.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
"@graphiql/plugin-code-exporter": patch
3+
"@graphiql/plugin-explorer": patch
4+
"@graphiql/react": minor
5+
---
6+
7+
update vite to v5

.eslintrc.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ module.exports = {
3535
overrides: [
3636
{
3737
// Rules for all code files
38-
files: ['**/*.{js,jsx,ts,tsx}'],
38+
files: ['**/*.{js,jsx,ts,tsx,mts,cts}'],
3939
parserOptions: {
4040
ecmaVersion: 6,
4141
},
@@ -342,7 +342,10 @@ module.exports = {
342342
'sonar/prefer-promise-shorthand': 'error',
343343
'sonar/no-dead-store': 'error',
344344
'unicorn/prefer-node-protocol': 'error',
345-
'import/no-unresolved': ['error', { ignore: ['^node:'] }],
345+
'import/no-unresolved': [
346+
'error',
347+
{ ignore: ['^node:', '\\.svg\\?react$'] },
348+
],
346349
'unicorn/prefer-string-replace-all': 'error',
347350
'unicorn/no-hex-escape': 'off', // TODO: enable
348351
// doesn't catch a lot of cases; we use ESLint builtin `no-restricted-syntax` to forbid `.keyCode`
@@ -357,7 +360,7 @@ module.exports = {
357360
},
358361
{
359362
// Rules that requires type information
360-
files: ['**/*.{ts,tsx}'],
363+
files: ['**/*.{ts,tsx,mts,cts}'],
361364
excludedFiles: ['**/*.{md,mdx}/*.{ts,tsx}'],
362365
// extends: ['plugin:@typescript-eslint/recommended-type-checked'],
363366
rules: {

examples/monaco-graphql-react-vite/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
"react-dom": "^18.2.0"
1515
},
1616
"devDependencies": {
17-
"@vitejs/plugin-react": "^4.0.1",
18-
"vite": "^4.3.9",
17+
"@vitejs/plugin-react": "^4.3.1",
18+
"vite": "^5.3.4",
1919
"vite-plugin-monaco-editor": "^1.1.0"
2020
},
2121
"scripts": {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@
135135
"ts-jest": "^27.1.5",
136136
"typedoc": "^0.19.2",
137137
"typescript": "^4.6.3",
138-
"vitest": "^0.32.2",
138+
"vitest": "^2.0.4",
139139
"wgutils": "^0.1.7",
140140
"wsrun": "^5.2.4"
141141
},

packages/graphiql-plugin-code-exporter/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@
4040
},
4141
"devDependencies": {
4242
"@graphiql/react": "^0.22.4",
43-
"@vitejs/plugin-react": "^4.0.1",
43+
"@vitejs/plugin-react": "^4.3.1",
4444
"graphql": "^16.8.1",
4545
"postcss-nesting": "^10.1.7",
4646
"react": "^18.2.0",
4747
"react-dom": "^18.2.0",
4848
"typescript": "^4.6.3",
49-
"vite": "^4.3.9"
49+
"vite": "^5.3.4"
5050
}
5151
}

packages/graphiql-plugin-explorer/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,12 @@
3939
},
4040
"devDependencies": {
4141
"@graphiql/react": "^0.22.4",
42-
"@vitejs/plugin-react": "^4.0.1",
42+
"@vitejs/plugin-react": "^4.3.1",
4343
"graphql": "^16.8.1",
4444
"react": "^18.2.0",
4545
"react-dom": "^18.2.0",
4646
"typescript": "^4.6.3",
47-
"vite": "^4.3.9",
48-
"vite-plugin-svgr": "^3.2.0"
47+
"vite": "^5.3.4",
48+
"vite-plugin-svgr": "^4.2.0"
4949
}
5050
}

packages/graphiql-plugin-explorer/src/index.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ import {
1212
GraphiQLExplorerProps,
1313
} from 'graphiql-explorer';
1414

15-
import ArrowIcon from './icons/arrow.svg';
16-
import FolderPlusIcon from './icons/folder-plus.svg';
17-
import CheckboxUncheckedIcon from './icons/checkbox-unchecked.svg';
18-
import CheckboxCheckedIcon from './icons/checkbox-checked.svg';
15+
import ArrowIcon from './icons/arrow.svg?react';
16+
import FolderPlusIcon from './icons/folder-plus.svg?react';
17+
import CheckboxUncheckedIcon from './icons/checkbox-unchecked.svg?react';
18+
import CheckboxCheckedIcon from './icons/checkbox-checked.svg?react';
1919

2020
import './graphiql-explorer.d.ts';
2121
import './index.css';
Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,2 @@
1-
declare module '*.svg' {
2-
import { FC, SVGProps } from 'react';
3-
const ReactComponent: FC<SVGProps<SVGSVGElement>>;
4-
export default ReactComponent;
5-
}
6-
1+
/// <reference types="vite-plugin-svgr/client" />
72
/// <reference types="vite/client" />

0 commit comments

Comments
 (0)