Skip to content

Commit

Permalink
Merge branch 'graphql:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
cimdalli authored May 11, 2024
2 parents ef4b1f7 + 79d1d99 commit 00aba1d
Show file tree
Hide file tree
Showing 103 changed files with 3,821 additions and 1,524 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ working-group/
packages/codemirror-graphql/src/__tests__/schema-kitchen-sink.graphql
CHANGELOG.md
**/CHANGELOG.md
packages/vscode-graphql-syntax/tests/__fixtures__/
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ module.exports = {
'changesets/**/*.md',
'**/CHANGELOG.md',
'functions/*',
'packages/vscode-graphql-syntax/tests/__fixtures__/*',
],
overrides: [
{
Expand Down
53 changes: 53 additions & 0 deletions .github/workflows/main-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Main Tests
# report coverage on main for codecov baseline
on:
push:
branches: [main]
jobs:
install:
name: Install
runs-on: ubuntu-latest

steps:
- name: Checkout Code
uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
cache: yarn
- name: Cache node modules
id: cache-modules
uses: actions/cache@v3
with:
path: |
**/node_modules
key: modules-${{ github.sha }}
- uses: actions/cache@v3
with:
path: |
~/.cache/Cypress
key: cypress-${{ runner.os }}
- run: yarn install --frozen-lockfile --immutable

jest:
name: Jest Unit Tests
runs-on: ubuntu-latest
needs: [install]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- id: cache-modules
uses: actions/cache@v3
with:
path: |
**/node_modules
key: modules-${{ github.sha }}
- run: yarn test --coverage
- uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage/lcov.info
fail_ci_if_error: true
verbose: true
12 changes: 11 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
{
"npm.packageManager": "yarn",
"editor.formatOnSave": true,
"files.insertFinalNewline": true
"files.insertFinalNewline": true,
"editor.trimAutoWhitespace": false,
"coverage-gutters.showLineCoverage": true,
"coverage-gutters.coverageBaseDir": "coverage",
"coverage-gutters.coverageFileNames": [
"lcov.info",
"cov.xml",
"coverage.xml",
"jacoco.xml",
"coverage.cobertura.xml"
]
}
4 changes: 2 additions & 2 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ this repo._
If you are focused on GraphiQL development, you can run —
```sh
yarn start-graphiql
yarn dev-graphiql
```
5. Get coding! If you've added code, add tests. If you've changed APIs, update
Expand Down Expand Up @@ -89,7 +89,7 @@ First, you'll need to `yarn build` all the packages from the root.
Then, you can run these commands:
- `yarn start-graphiql` — which will launch `webpack` dev server for graphiql
- `yarn dev-graphiql` — which will launch `webpack` dev server for graphiql
from the root
> The GraphiQL UI is available at http://localhost:8080/dev.html
Expand Down
7 changes: 6 additions & 1 deletion custom-words.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ yoshiakis

// packages and tools
argparse
astro
astrojs
changesets
clsx
codemirror
Expand All @@ -81,6 +83,8 @@ intellij
jsdelivr
lezer
manypkg
modulemap
mockfs
meros
nullthrows
onig
Expand All @@ -94,6 +98,7 @@ typedoc
vite
vitest
vitejs
vsix
wonka
urql
tsup
Expand Down Expand Up @@ -128,7 +133,6 @@ listvalues
marko
matchingbracket
middlewares
modulemap
newhope
nextjs
nocheck
Expand Down Expand Up @@ -228,3 +232,4 @@ unparsable
randomthing
codicon
edcore
tokenizes
2 changes: 1 addition & 1 deletion examples/cm6-graphql-legacy-parcel/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"@codemirror/basic-setup": "^0.20.0",
"@codemirror/language": "^0.20.0",
"codemirror-graphql": "^2.0.2",
"graphql": "^16.4.0"
"graphql": "^16.8.1"
},
"devDependencies": {
"parcel-bundler": "^1.12.4",
Expand Down
2 changes: 1 addition & 1 deletion examples/cm6-graphql-parcel/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"@codemirror/theme-one-dark": "6.0.0",
"@codemirror/view": "6.1.2",
"cm6-graphql": "0.0.1",
"graphql": "^16.4.0"
"graphql": "^16.8.1"
},
"devDependencies": {
"parcel": "^2.6.2",
Expand Down
2 changes: 1 addition & 1 deletion examples/graphiql-create-react-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"private": true,
"dependencies": {
"graphiql": "^2.2.0",
"graphql": "^16.4.0",
"graphql": "^16.8.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-scripts": "5.0.1"
Expand Down
2 changes: 1 addition & 1 deletion examples/graphiql-parcel/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
},
"dependencies": {
"graphiql": "^2.2.0",
"graphql": "^16.4.0",
"graphql": "^16.8.1",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
Expand Down
10 changes: 5 additions & 5 deletions examples/graphiql-webpack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
"start": "NODE_ENV=development webpack-cli serve"
},
"dependencies": {
"@graphiql/plugin-code-exporter": "^1.0.1",
"@graphiql/plugin-explorer": "^1.0.1",
"@graphiql/plugin-code-exporter": "^3.0.0",
"@graphiql/plugin-explorer": "^3.0.0",
"@graphiql/toolkit": "^0.9.1",
"@graphiql/react": "^0.20.1",
"graphiql": "^3.0.8",
"graphql": "^16.4.0",
"@graphiql/react": "^0.22.0",
"graphiql": "^3.2.1",
"graphql": "^16.8.1",
"graphql-ws": "^5.5.5",
"react": "^18.2.0",
"regenerator-runtime": "^0.13.9"
Expand Down
4 changes: 2 additions & 2 deletions examples/monaco-graphql-nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
},
"dependencies": {
"@graphiql/toolkit": "^0.9.1",
"graphql": "^16.4.0",
"graphql": "^16.8.1",
"graphql-ws": "^5.5.5",
"jsonc-parser": "^3.2.0",
"marked": "^4.2.12",
"monaco-editor": "^0.39.0",
"monaco-editor-webpack-plugin": "^7.0.1",
"monaco-graphql": "^1.4.0",
"monaco-graphql": "^1.5.1",
"next": "13.4.7",
"prettier": "3.0.0-alpha.12",
"react": "^18.2.0",
Expand Down
4 changes: 2 additions & 2 deletions examples/monaco-graphql-react-vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
"version": "0.0.0",
"dependencies": {
"@graphiql/toolkit": "^0.9.1",
"graphql": "^16.4.0",
"graphql": "^16.8.1",
"graphql-language-service": "^5.2.0",
"jsonc-parser": "^3.2.0",
"monaco-editor": "^0.39.0",
"monaco-graphql": "^1.4.0",
"monaco-graphql": "^1.5.1",
"prettier": "3.0.0-alpha.12",
"react": "^18.2.0",
"react-dom": "^18.2.0"
Expand Down
4 changes: 2 additions & 2 deletions examples/monaco-graphql-webpack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
"start": "cross-env NODE_ENV=development webpack-cli serve"
},
"dependencies": {
"graphql": "^16.4.0",
"graphql": "^16.8.1",
"graphql-language-service": "^5.2.0",
"json-schema": "^0.4.0",
"jsonc-parser": "^3.2.0",
"monaco-editor": "^0.39.0",
"monaco-graphql": "^1.4.0",
"monaco-graphql": "^1.5.1",
"prettier": "3.0.0-alpha.12"
},
"devDependencies": {
Expand Down
2 changes: 2 additions & 0 deletions jest.config.base.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ module.exports = (dir, env = 'jsdom') => {
'^cm6-graphql\\/src\\/([^]+)': `${__dirname}/packages/cm6-graphql/dist/$1`,
'^example-([^/]+)': `${__dirname}/examples/$1/src`,
'^-!svg-react-loader.*$': '<rootDir>/resources/jest/svgImportMock.js',
// because of the svelte compiler's export patterns i guess?
'svelte/compiler': `${__dirname}/node_modules/svelte/compiler.cjs`,
},
testMatch: ['**/*[-.](spec|test).[jt]s?(x)', '!**/cypress/**'],
testEnvironment: env,
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -136,5 +136,8 @@
"typescript": "^4.6.3",
"vitest": "^0.32.2",
"wsrun": "^5.2.4"
},
"resolutions": {
"@babel/traverse": "^7.23.2"
}
}
24 changes: 24 additions & 0 deletions packages/cm6-graphql/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,29 @@
# cm6-graphql

## 0.0.14

### Patch Changes

- [#3534](https://github.com/graphql/graphiql/pull/3534) [`f4c98c1f`](https://github.com/graphql/graphiql/commit/f4c98c1f7c6df5a918479e641631e8fbc5b5a92e) Thanks [@johndcollett](https://github.com/johndcollett)! - fix: multiple argument syntax highlighting

## 0.0.13

### Patch Changes

- [#3505](https://github.com/graphql/graphiql/pull/3505) [`a562c96f`](https://github.com/graphql/graphiql/commit/a562c96fa3953d0301ad7b610028fa6c4a779bf6) Thanks [@Gasser-Aly](https://github.com/Gasser-Aly)! - fix: block strings syntax highlighting

## 0.0.12

### Patch Changes

- [#3463](https://github.com/graphql/graphiql/pull/3463) [`e45ba17c`](https://github.com/graphql/graphiql/commit/e45ba17cb2f13e5a79d3e87b0f30ef92ec55d861) Thanks [@imolorhe](https://github.com/imolorhe)! - Create a lint diagnostic from invalid schema

## 0.0.11

### Patch Changes

- [#3461](https://github.com/graphql/graphiql/pull/3461) [`129666a9`](https://github.com/graphql/graphiql/commit/129666a9a86690bb72226674d40215f24dc5f7ea) Thanks [@imolorhe](https://github.com/imolorhe)! - Wrap cm6-graphql lint logic in try..catch

## 0.0.10

### Patch Changes
Expand Down
42 changes: 42 additions & 0 deletions packages/cm6-graphql/__tests__/cases.txt
Original file line number Diff line number Diff line change
Expand Up @@ -113,3 +113,45 @@ Document(
Document(
OperationDefinition(SelectionSet("{",Selection(Field(FieldName)),Selection(Field(FieldName,SelectionSet("{",Selection(Field(FieldName)),"}"))),"}"))
)



# Test case for blockStringCharacter in a Description

"""
This is a block string description
with multiple lines.
It can contain any character except for \""".
"""
type Example {
id: ID
}

==>

Document(
TypeSystemDefinition(
TypeDefinition(
ObjectTypeDefinition(
Description(StringValue),
TypeKeyword(type),
Name,
FieldsDefinition(
"{",
FieldDefinition(Name, NamedType(Name)),
"}"
)
)
)
)
)

# multiple arguments separated by a commas

{
picture(width: 200, height: 100)
}

==>

Document(OperationDefinition(SelectionSet("{",Selection(Field(FieldName,Arguments("(",Argument(ArgumentAttributeName,IntValue),Argument(ArgumentAttributeName,IntValue),")"))),"}")))
4 changes: 2 additions & 2 deletions packages/cm6-graphql/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cm6-graphql",
"version": "0.0.10",
"version": "0.0.14",
"description": "GraphQL language support for CodeMirror 6",
"scripts": {
"build": "cm-buildhelper src/index.ts",
Expand Down Expand Up @@ -30,7 +30,7 @@
"@lezer/highlight": "^1.0.0",
"@lezer/lr": "^1.1.0",
"esbuild": "0.18.10",
"graphql": "^16.4.0",
"graphql": "^16.8.1",
"rollup": "^2.60.2",
"rollup-plugin-dts": "^4.0.1",
"rollup-plugin-esbuild": "^4.9.1",
Expand Down
1 change: 1 addition & 0 deletions packages/cm6-graphql/src/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { GraphQLSchema } from 'graphql';
import { ContextToken, CompletionItem } from 'graphql-language-service';
import { Position } from './helpers';
export interface GqlExtensionsOptions {
showErrorOnInvalidSchema?: boolean;
onShowInDocs?: (field?: string, type?: string, parentType?: string) => void;
onFillAllFields?: (
view: EditorView,
Expand Down
1 change: 1 addition & 0 deletions packages/cm6-graphql/src/language.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export const graphqlLanguage = LRLanguage.define({
styleTags({
Variable: t.variableName,
BooleanValue: t.bool,
Description: t.string,
StringValue: t.string,
Comment: t.lineComment,
IntValue: t.integer,
Expand Down
Loading

0 comments on commit 00aba1d

Please sign in to comment.