Skip to content

Commit 190130b

Browse files
committed
Merge branch 'main' into v4-6
2 parents 3412b7f + fdc0a4f commit 190130b

File tree

26 files changed

+82
-50
lines changed

26 files changed

+82
-50
lines changed

.github/workflows/pr.yml

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,9 @@ jobs:
3636
name: Build
3737
runs-on: ubuntu-latest
3838
needs: [install]
39-
4039
steps:
4140
- uses: actions/checkout@v4
4241
- uses: actions/setup-node@v4
43-
4442
- id: cache-modules
4543
uses: actions/cache@v4
4644
with:
@@ -109,18 +107,15 @@ jobs:
109107
name: Vitest Unit Tests
110108
runs-on: ubuntu-latest
111109
needs: [build]
112-
113110
steps:
114111
- uses: actions/checkout@v4
115112
- uses: actions/setup-node@v4
116-
117113
- id: cache-modules
118114
uses: actions/cache@v4
119115
with:
120116
path: |
121117
**/node_modules
122118
key: modules-${{ github.sha }}
123-
124119
- uses: actions/cache@v4
125120
with:
126121
key: build-${{ github.sha }}
@@ -131,11 +126,9 @@ jobs:
131126
name: ESLint
132127
runs-on: ubuntu-latest
133128
needs: [build]
134-
135129
steps:
136130
- uses: actions/checkout@v4
137131
- uses: actions/setup-node@v4
138-
139132
- id: cache-modules
140133
uses: actions/cache@v4
141134
with:
@@ -148,11 +141,29 @@ jobs:
148141
path: ${{ env.BUILD-CACHE-LIST }}
149142
- run: yarn eslint
150143

144+
types-check:
145+
name: Types Check
146+
runs-on: ubuntu-latest
147+
needs: [build]
148+
steps:
149+
- uses: actions/checkout@v4
150+
- uses: actions/setup-node@v4
151+
- id: cache-modules
152+
uses: actions/cache@v4
153+
with:
154+
path: |
155+
**/node_modules
156+
key: modules-${{ github.sha }}
157+
- uses: actions/cache@v4
158+
with:
159+
key: build-${{ github.sha }}
160+
path: ${{ env.BUILD-CACHE-LIST }}
161+
- run: yarn types:check
162+
151163
e2e:
152164
name: Cypress
153165
runs-on: ubuntu-latest
154166
needs: [build]
155-
156167
steps:
157168
- uses: actions/checkout@v4
158169
- id: cache-modules

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@
1111
"coverage.xml",
1212
"jacoco.xml",
1313
"coverage.cobertura.xml"
14-
]
14+
],
15+
"typescript.tsdk": "node_modules/typescript/lib"
1516
}

packages/cm6-graphql/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "0.2.1",
44
"description": "GraphQL language support for CodeMirror 6",
55
"scripts": {
6+
"types:check": "tsc --noEmit",
67
"build": "cm-buildhelper src/index.ts",
78
"prepare": "yarn build",
89
"test": "vitest run"

packages/codemirror-graphql/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
"!jest.config.js"
3636
],
3737
"scripts": {
38+
"types:check": "tsc --noEmit",
3839
"build": "node ../../scripts/renameFileExtensions.js './esm/{**,!**/__tests__/}/*.js' . .esm.js",
3940
"test": "vitest"
4041
},

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,10 @@
2727
".": "./dist/index.js"
2828
},
2929
"scripts": {
30+
"types:check": "tsc --noEmit",
3031
"dev": "vite build --watch",
3132
"build": "vite build && UMD=true vite build",
32-
"prebuild": "yarn types:check",
33-
"postbuild": "cp src/graphiql-code-exporter.d.ts dist/graphiql-code-exporter.d.ts",
34-
"types:check": "tsc --noEmit"
33+
"postbuild": "cp src/graphiql-code-exporter.d.ts dist/graphiql-code-exporter.d.ts"
3534
},
3635
"dependencies": {
3736
"graphiql-code-exporter": "^3.0.3"

packages/graphiql-plugin-doc-explorer/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@
3030
"dist"
3131
],
3232
"scripts": {
33+
"types:check": "tsc --noEmit",
3334
"dev": "vite build --watch",
3435
"build": "vite build",
35-
"test": "vitest",
36-
"types:check": "tsc --noEmit"
36+
"test": "vitest"
3737
},
3838
"peerDependencies": {
3939
"react": "^18 || ^19",

packages/graphiql-plugin-doc-explorer/src/components/__tests__/doc-explorer.spec.tsx

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { act, render } from '@testing-library/react';
22
import { GraphQLInt, GraphQLObjectType, GraphQLSchema } from 'graphql';
33
import { FC, useEffect } from 'react';
4-
import type { SchemaContextType } from '@graphiql/react';
54
import {
65
DocExplorerContextProvider,
76
useDocExplorer,
@@ -29,22 +28,17 @@ function makeSchema(fieldName = 'field') {
2928
});
3029
}
3130

32-
const defaultSchemaContext: SchemaContextType = {
33-
fetchError: null,
31+
const defaultSchemaContext = {
32+
...schemaStore.getInitialState(),
3433
introspect() {},
35-
isFetching: false,
3634
schema: makeSchema(),
37-
validationErrors: [],
3835
};
3936

40-
const withErrorSchemaContext: SchemaContextType = {
37+
const withErrorSchemaContext = {
38+
...schemaStore.getInitialState(),
4139
fetchError: 'Error fetching schema',
4240
introspect() {},
43-
isFetching: false,
4441
schema: new GraphQLSchema({ description: 'GraphQL Schema for testing' }),
45-
validationErrors: [],
46-
schemaReference: null!,
47-
setSchemaReference: null!,
4842
};
4943

5044
const DocExplorerWithContext: FC = () => {

packages/graphiql-plugin-doc-explorer/src/context.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ export const docExplorerStore = createStore<DocExplorerContextType>(
154154
set(state => {
155155
const oldNavStack = state.explorerNavStack;
156156
if (oldNavStack.length === 1) {
157-
return oldNavStack;
157+
return state;
158158
}
159159
// Spread is needed
160160
const newNavStack: DocExplorerNavStack = [...INITIAL_NAV_STACK];

packages/graphiql-plugin-explorer/package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,10 @@
2626
".": "./dist/index.js"
2727
},
2828
"scripts": {
29+
"types:check": "tsc --noEmit",
2930
"dev": "vite build --watch",
3031
"build": "vite build && UMD=true vite build",
31-
"postbuild": "cp src/graphiql-explorer.d.ts dist/graphiql-explorer.d.ts",
32-
"prebuild": "yarn types:check",
33-
"types:check": "tsc --noEmit"
32+
"postbuild": "cp src/graphiql-explorer.d.ts dist/graphiql-explorer.d.ts"
3433
},
3534
"dependencies": {
3635
"graphiql-explorer": "^0.9.0"

packages/graphiql-plugin-history/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@
2929
"dist"
3030
],
3131
"scripts": {
32+
"types:check": "tsc --noEmit",
3233
"dev": "vite build --watch",
3334
"build": "vite build",
34-
"test": "vitest",
35-
"types:check": "tsc --noEmit"
35+
"test": "vitest"
3636
},
3737
"peerDependencies": {
3838
"react": "^18 || ^19",

0 commit comments

Comments
 (0)