Skip to content

[wip] migrate graphql-language-service-server to vitest #3834

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 91 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
f590ae4
aa
dimaMachina Dec 11, 2024
810b0b2
aa
dimaMachina Dec 11, 2024
8066724
aa
dimaMachina Dec 11, 2024
4039e39
aa
dimaMachina Dec 11, 2024
4b7e458
aa
dimaMachina Dec 11, 2024
777eac5
aa
dimaMachina Dec 11, 2024
3786aca
aa
dimaMachina Dec 11, 2024
e1260f4
aa
dimaMachina Dec 11, 2024
1c5c46f
aa
dimaMachina Dec 11, 2024
16424ae
aa
dimaMachina Dec 11, 2024
dae03ba
aa
dimaMachina Dec 11, 2024
e1b3cc5
aa
dimaMachina Dec 11, 2024
67a2250
aa
dimaMachina Dec 11, 2024
2be769b
[skip ci]
dimaMachina Dec 13, 2024
785c103
fix
dimaMachina Dec 13, 2024
9a0a3cd
migrate `graphiql` from `jest` to `vitest`
dimaMachina Dec 13, 2024
a862023
add .js extension
dimaMachina Dec 13, 2024
3f3472a
add .js extension
dimaMachina Dec 13, 2024
5fd2901
Merge branch 'do-not-bundle-codemirror' into graphiql-vitest
dimaMachina Dec 13, 2024
be801e4
upd
dimaMachina Dec 13, 2024
398b087
upd
dimaMachina Dec 13, 2024
a337e82
Merge branch 'do-not-bundle-codemirror' into graphiql-vitest
dimaMachina Dec 13, 2024
731082d
upd
dimaMachina Dec 13, 2024
f69cd78
upd
dimaMachina Dec 13, 2024
ce223e3
upd
dimaMachina Dec 13, 2024
6f6f481
upd
dimaMachina Dec 13, 2024
a04d46d
upd
dimaMachina Dec 13, 2024
1be7078
Merge branch 'do-not-bundle-codemirror' into react-compiler
dimaMachina Dec 13, 2024
adf7725
Merge branch 'graphiql-vitest' into react-compiler
dimaMachina Dec 13, 2024
d6f62d4
upd
dimaMachina Dec 13, 2024
3ecae05
upd
dimaMachina Dec 13, 2024
8092f10
upd
dimaMachina Dec 13, 2024
ab2fec8
add
dimaMachina Dec 13, 2024
63bb7b4
upd
dimaMachina Dec 14, 2024
25129f5
upd
dimaMachina Dec 14, 2024
d2fb423
upd
dimaMachina Dec 14, 2024
1968198
upd
dimaMachina Dec 14, 2024
d7e2434
upd
dimaMachina Dec 14, 2024
57348be
upd
dimaMachina Dec 14, 2024
b28be43
upd
dimaMachina Dec 14, 2024
3546a58
upd
dimaMachina Dec 14, 2024
cc537f6
clean up deps
dimaMachina Dec 14, 2024
4031182
clean up deps
dimaMachina Dec 14, 2024
1878a0b
clean up deps
dimaMachina Dec 14, 2024
7453fe4
clean up deps
dimaMachina Dec 14, 2024
63674ed
clean up deps
dimaMachina Dec 14, 2024
dfb7578
upd
dimaMachina Dec 14, 2024
4993c1c
upd
dimaMachina Dec 14, 2024
12cd0b6
more changes from graphiql v4
dimaMachina Dec 14, 2024
1b91371
more
dimaMachina Dec 14, 2024
2f829f8
fix path isn't exported
dimaMachina Dec 14, 2024
4a23084
fix integration tests
dimaMachina Dec 14, 2024
6e95096
fix e2e
dimaMachina Dec 14, 2024
948fef0
bump
dimaMachina Dec 14, 2024
8c34ceb
add changeset
dimaMachina Dec 14, 2024
8410fed
remove unneeded beforeDevServer.js
dimaMachina Dec 14, 2024
d89dc49
found case which was not optimized
dimaMachina Dec 14, 2024
346a936
Merge branch 'main' into react-compiler2
dimaMachina Dec 14, 2024
460b51e
Delete .changeset/sour-onions-rhyme.md
dimaMachina Dec 14, 2024
42f65cc
Delete .changeset/silly-nails-double.md
dimaMachina Dec 14, 2024
65778d2
Merge branch 'main' into react-compiler2
dimaMachina Dec 14, 2024
d4d9062
polish graphiql tests setup
dimaMachina Dec 14, 2024
107e0b6
polish graphiql tests setup
dimaMachina Dec 14, 2024
22c4e7a
upd
dimaMachina Dec 14, 2024
dc8a6a5
upd
dimaMachina Dec 14, 2024
935cd6c
upd
dimaMachina Dec 14, 2024
130ee12
more
dimaMachina Dec 14, 2024
7f2fa66
more
dimaMachina Dec 14, 2024
20fa910
more
dimaMachina Dec 14, 2024
5d93679
more
dimaMachina Dec 14, 2024
009f8d8
more
dimaMachina Dec 14, 2024
403de21
more
dimaMachina Dec 14, 2024
79a5061
more
dimaMachina Dec 14, 2024
13304f0
more [skip ci]
dimaMachina Dec 14, 2024
69f401d
more [skip ci]
dimaMachina Dec 14, 2024
f252dcd
more
dimaMachina Dec 14, 2024
f5742e9
more
dimaMachina Dec 14, 2024
b60581e
more
dimaMachina Dec 14, 2024
05b8540
rm
dimaMachina Dec 14, 2024
fbca258
rm
dimaMachina Dec 14, 2024
0dc6f86
rm
dimaMachina Dec 14, 2024
439e7a5
rm babel
dimaMachina Dec 14, 2024
2c9d960
rm
dimaMachina Dec 14, 2024
a88a00b
rollback
dimaMachina Dec 14, 2024
c080231
fix build
dimaMachina Dec 14, 2024
8cc4fcf
Merge branch 'main' into react-compiler2
dimaMachina Dec 14, 2024
e0949ac
should be good
dimaMachina Dec 14, 2024
ad75cda
prettier
dimaMachina Dec 14, 2024
fe75b41
Merge branch 'react-compiler2' into gls-server
dimaMachina Dec 14, 2024
75b6457
fix ci
dimaMachina Dec 14, 2024
21d467d
polish
dimaMachina Dec 14, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/stupid-lamps-search.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'graphiql': minor
---

migrate `graphiql` to `vite` and `react compiler`
12 changes: 7 additions & 5 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -406,10 +406,13 @@ module.exports = {
'**/__{tests,mocks}__/*.{js,jsx,ts,tsx}',
'**/*.spec.{ts,js.jsx.tsx}',
],
extends: ['plugin:jest/recommended'],
extends: ['plugin:@vitest/legacy-recommended'],
rules: {
'jest/no-conditional-expect': 'off',
'jest/expect-expect': ['error', { assertFunctionNames: ['expect*'] }],
'@vitest/expect-expect': [
'error',
{ assertFunctionNames: ['expect*'] },
],
'@vitest/no-disabled-tests': 'error',
},
},
{
Expand All @@ -435,7 +438,6 @@ module.exports = {
'**/__tests__/**',
'webpack.config.js',
'**/tests/**',
'test.config.js',
'vitest.config.mts',
'setup-files.ts',
],
Expand All @@ -462,7 +464,7 @@ module.exports = {
},
},
{
files: ['packages/graphiql-react/**'],
files: ['packages/{graphiql-react,graphiql}/**'],
plugins: ['react-compiler'],
rules: {
'@typescript-eslint/no-restricted-imports': [
Expand Down
22 changes: 0 additions & 22 deletions .github/workflows/main-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,25 +31,3 @@ jobs:
~/.cache/Cypress
key: cypress-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
- run: yarn install --frozen-lockfile --immutable

jest:
name: Jest Unit Tests
runs-on: ubuntu-latest
needs: [install]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4

- id: cache-modules
uses: actions/cache@v4
with:
path: |
**/node_modules
key: modules-${{ github.sha }}
- run: yarn test --coverage
- uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage/lcov.info
fail_ci_if_error: true
verbose: true
25 changes: 2 additions & 23 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,27 +84,6 @@ jobs:
key: modules-${{ github.sha }}
- run: yarn pretty-check

jest:
name: Jest Unit & Integration Tests
runs-on: ubuntu-latest
needs: [install]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- id: cache-modules
uses: actions/cache@v4
with:
path: |
**/node_modules
key: modules-${{ github.sha }}
- run: yarn test --coverage
- uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage/lcov.info
fail_ci_if_error: true
verbose: true

vitest:
name: Vitest Unit Tests
runs-on: ubuntu-latest
Expand All @@ -125,7 +104,7 @@ jobs:
with:
key: build-${{ github.sha }}
path: ${{ env.BUILD-CACHE-LIST }}
- run: yarn vitest
- run: yarn test

eslint:
name: ESLint
Expand Down Expand Up @@ -192,7 +171,7 @@ jobs:
name: Canary
runs-on: ubuntu-latest
# ensure the basic checks pass before running the canary
needs: [build, jest, eslint, vitest, e2e]
needs: [build, eslint, vitest, e2e]
if: github.event.pull_request.head.repo.full_name == github.repository
steps:
- uses: actions/checkout@v4
Expand Down
6 changes: 1 addition & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ package-lock.json
.eslintcache
.cspellcache

vite.config.d.ts
vitest.config.*.mjs
vite.config.js

.next/
Expand All @@ -41,12 +41,8 @@ packages/codemirror-graphql/*.d.ts
packages/codemirror-graphql/*.map
!packages/codemirror-graphql/*.config.js

packages/graphiql/index.html
packages/graphiql/dev.html
packages/graphiql/analyzer.html
packages/graphiql/graphiql*.js
packages/graphiql/*.css
packages/graphiql/*.map
packages/graphiql/cypress/screenshots/
packages/graphiql/typedoc/
packages/graphiql/webpack/
2 changes: 0 additions & 2 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
.idea
npm-debug.log

.babelrc
CONTRIBUTING.md
node_modules
coverage
Expand All @@ -16,5 +15,4 @@ src
packages
packages/graphiql/*.html
cypress.json
babel.config.js
**/*.tsbuildinfo
17 changes: 0 additions & 17 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,6 @@
"sourceMaps": true,
"preLaunchTask": "watch-vscode"
},
{
"type": "node",
"name": "jest watch",
"request": "launch",
"program": "${workspaceFolder}/node_modules/jest/bin/jest",
"args": [
"--config",
"jest.config.js",
"--color",
"--runInBand",
"--watch",
"${relativeFile}"
],
"cwd": "${workspaceFolder}",
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen"
},
{
"name": "VS Code Exec Extension: Run",
"type": "extensionHost",
Expand Down
2 changes: 1 addition & 1 deletion DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ breaking their implementations.

- `yarn test graphiql` will run all tests for graphiql. You can also run tests
from a workspace, but most tooling is at the root.
- `yarn test --watch` will run `jest` with `--watch`
- `yarn test --watch` will run `vitest` with `--watch`
- `yarn e2e` at the root will run the end-to-end suite
- `yarn start-monaco` will launch `webpack` dev server for the `monaco` editor
example with GitHub API from the root. This is the fastest way to test changes
Expand Down
45 changes: 0 additions & 45 deletions babel.config.js

This file was deleted.

9 changes: 8 additions & 1 deletion examples/graphiql-webpack/babel.config.js
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
module.exports = require('../../resources/babel.config');
module.exports = {
sourceMaps: true,
presets: [
[require.resolve('@babel/preset-env')],
require.resolve('@babel/preset-react'),
],
plugins: [require.resolve('@babel/plugin-proposal-class-properties')],
};
3 changes: 3 additions & 0 deletions examples/monaco-graphql-webpack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"@babel/core": "^7.21.0",
"@babel/plugin-proposal-class-properties": "^7.18.6",
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.18.6",
"@babel/preset-env": "^7.20.2",
"@babel/preset-react": "^7.18.6",
"@babel/preset-typescript": "^7.21.0",
Expand All @@ -30,11 +31,13 @@
"cross-env": "^7.0.2",
"css-loader": "^6.7.3",
"file-loader": "6.2.0",
"fork-ts-checker-webpack-plugin": "7.3.0",
"html-webpack-plugin": "^5.5.0",
"monaco-editor-webpack-plugin": "^7.0.1",
"style-loader": "^3.3.1",
"typescript": "^4.6.3",
"webpack": "5.76.0",
"webpack-bundle-analyzer": "^3.6.1",
"webpack-cli": "^5.0.1",
"webpack-dev-server": "^4.11.1"
}
Expand Down
4 changes: 2 additions & 2 deletions examples/monaco-graphql-webpack/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
"composite": true,
"baseUrl": ".",
"strictPropertyInitialization": false,
"types": ["node", "jest"],
"types": ["node"],
"typeRoots": ["../../node_modules/@types", "node_modules/@types"],
"lib": ["dom", "ESNext"],
"moduleResolution": "node"
},
"references": [{ "path": "../../packages/monaco-graphql" }],
"include": ["src"],
"exclude": ["**/__tests__/**", "**/build/**.*", "../../node_modules"]
"exclude": ["**/build/**.*", "../../node_modules"]
}
54 changes: 0 additions & 54 deletions jest.config.base.js

This file was deleted.

3 changes: 0 additions & 3 deletions jest.config.js

This file was deleted.

Loading
Loading