From e502c41e68440e7331cfc74d8c78fd092f3354a8 Mon Sep 17 00:00:00 2001 From: Phil Pluckthun Date: Fri, 1 Mar 2024 15:27:34 +0100 Subject: [PATCH 01/81] =?UTF-8?q?fix:=20Fix=20vscode-graphql-syntax?= =?UTF-8?q?=E2=80=99s=20grammar=20to=20support=20string=20literals=20on=20?= =?UTF-8?q?separate=20lines=20(#3518)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Allow newlines after `graphql(` before start of query string * Fix mistaken reverse order of optional `(` and generic `<.*>` * Replace `(` in second match with newline one * Match graphql calls separately for string literals inside calls * Add missing endCaptures to new rule --- .changeset/famous-games-begin.md | 5 + .../grammars/graphql.js.json | 49 +- .../tests/__fixtures__/test-js.md | 44 ++ .../tests/__fixtures__/test.js | 13 +- .../tests/__fixtures__/test.ts | 20 +- .../__snapshots__/js-grammar.spec.ts.snap | 500 +++++++++++------- .../markdown-grammar.spec.ts.snap | 44 ++ 7 files changed, 459 insertions(+), 216 deletions(-) create mode 100644 .changeset/famous-games-begin.md diff --git a/.changeset/famous-games-begin.md b/.changeset/famous-games-begin.md new file mode 100644 index 00000000000..ae10f9af58d --- /dev/null +++ b/.changeset/famous-games-begin.md @@ -0,0 +1,5 @@ +--- +'vscode-graphql-syntax': patch +--- + +Fix TextMate grammar to support string literals that don’t immediately follow a function call's left-parenthesis (`(`). diff --git a/packages/vscode-graphql-syntax/grammars/graphql.js.json b/packages/vscode-graphql-syntax/grammars/graphql.js.json index 9c65649db9d..89704e30495 100644 --- a/packages/vscode-graphql-syntax/grammars/graphql.js.json +++ b/packages/vscode-graphql-syntax/grammars/graphql.js.json @@ -4,39 +4,33 @@ "patterns": [ { "contentName": "meta.embedded.block.graphql", - "begin": "\\s*+(?:(?:(Relay)\\??\\.)(QL)|(gql|graphql|graphql\\.experimental)|(/\\* GraphQL \\*/))\\s*\\(?\\s*(`|')", - "beginCaptures": { - "1": { - "name": "variable.other.class.js" - }, - "2": { - "name": "entity.name.function.tagged-template.js" - }, - "3": { - "name": "entity.name.function.tagged-template.js" - }, - "4": { - "name": "comment.graphql.js" - }, - "5": { - "name": "punctuation.definition.string.template.begin.js" - } - }, - "end": "(`|')", - "endCaptures": { - "0": { - "name": "punctuation.definition.string.template.end.js" - } - }, + "begin": "(?<=(?:(?:Relay\\??\\.)QL|gql|graphql|graphql\\.experimental)\\s*(?:<.*>)?\\s*)\\(", + "end": "\\)", "patterns": [ { - "include": "source.graphql" + "begin": "(`|')", + "end": "(`|')", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.template.begin.js" + } + }, + "endCaptures": { + "0": { + "name": "punctuation.definition.string.template.end.js" + } + }, + "patterns": [ + { + "include": "source.graphql" + } + ] } ] }, { "contentName": "meta.embedded.block.graphql", - "begin": "\\s*+(?:(?:(Relay)\\??\\.)(QL)|(gql|graphql|graphql\\.experimental))\\s*\\(?\\s*(?:<.*>)(`|')", + "begin": "\\s*+(?:(?:(?:(Relay)\\??\\.)(QL)|(gql|graphql|graphql\\.experimental)\\s*(?:<.*>)?\\s*)|(/\\* GraphQL \\*/))\\s*(`|')", "beginCaptures": { "1": { "name": "variable.other.class.js" @@ -48,6 +42,9 @@ "name": "entity.name.function.tagged-template.js" }, "4": { + "name": "comment.graphql.js" + }, + "5": { "name": "punctuation.definition.string.template.begin.js" } }, diff --git a/packages/vscode-graphql-syntax/tests/__fixtures__/test-js.md b/packages/vscode-graphql-syntax/tests/__fixtures__/test-js.md index 76601d15497..71ab2138dda 100644 --- a/packages/vscode-graphql-syntax/tests/__fixtures__/test-js.md +++ b/packages/vscode-graphql-syntax/tests/__fixtures__/test-js.md @@ -26,6 +26,50 @@ const Component = () => { }; ``` +```js +const variable = 1; + +const queryA = graphql(` + query { + something(arg: ${variable}) + } +`); + +const queryB = graphql( + ` + query { + something(arg: ${variable}) + } + ` +); + +const queryC = graphql( + 'query { something(arg: ${variable}) }' +); +``` + +```ts +const variable: number = 1; + +const queryA = graphql(` + query { + something(arg: ${variable}) + } +`); + +const queryB = graphql( + ` + query { + something(arg: ${variable}) + } + ` +); + +const queryC = graphql( + 'query { something(arg: ${variable}) }' +); +``` + ### svelte ```svelte diff --git a/packages/vscode-graphql-syntax/tests/__fixtures__/test.js b/packages/vscode-graphql-syntax/tests/__fixtures__/test.js index 1112c7adbfa..616f41dd27e 100644 --- a/packages/vscode-graphql-syntax/tests/__fixtures__/test.js +++ b/packages/vscode-graphql-syntax/tests/__fixtures__/test.js @@ -37,8 +37,18 @@ const graphql = graphql(` } `); +const graphql = graphql( + ` + query($id: ID!) { test } + `, + [var1, var2] +); + const query = /* GraphQL */ 'query { id } '; -const query = graphql('query { id } '); +const query = graphql('query($id: ID!) { id } '); +const query = graphql( + 'query($id: ID!) { test }' +); const queryWithInlineComment = `#graphql query { @@ -59,7 +69,6 @@ const queryWithInlineComment = `#graphql } } `; -// TODO: fix this const queryWithInlineComment = ` #graphql query { diff --git a/packages/vscode-graphql-syntax/tests/__fixtures__/test.ts b/packages/vscode-graphql-syntax/tests/__fixtures__/test.ts index b8e507901b6..5ae8cefaad3 100644 --- a/packages/vscode-graphql-syntax/tests/__fixtures__/test.ts +++ b/packages/vscode-graphql-syntax/tests/__fixtures__/test.ts @@ -25,9 +25,27 @@ const query = graphql` } `; -// TODO: Fix this const query = graphql('query { id }'); +const query = graphql( + 'query { id }' +); + +const query = graphql( + 'query { id }' +); + +const query = graphql(` + query { id } +`); + +const query = graphql( + ` + query { id } + `, + [var1, var2] +); + const queryWithInlineComment = `#graphql query { user(id: "5", name: boolean) { diff --git a/packages/vscode-graphql-syntax/tests/__snapshots__/js-grammar.spec.ts.snap b/packages/vscode-graphql-syntax/tests/__snapshots__/js-grammar.spec.ts.snap index 1be3ebd280f..3921a4178b3 100644 --- a/packages/vscode-graphql-syntax/tests/__snapshots__/js-grammar.spec.ts.snap +++ b/packages/vscode-graphql-syntax/tests/__snapshots__/js-grammar.spec.ts.snap @@ -108,11 +108,9 @@ something | meta.embedded.block.graphql meta.select \` | punctuation.definition.string.template.end.js ; | | -const graphql = | - | -graphql | entity.name.function.tagged-template.js +const graphql = graphql | ( | -\` | punctuation.definition.string.template.begin.js +\` | meta.embedded.block.graphql punctuation.definition.string.template.begin.js | meta.embedded.block.graphql """ | meta.embedded.block.graphql comment.line.graphql.js punctuation.whitespace.comment.leading.graphql this is a comment | meta.embedded.block.graphql comment.line.graphql.js @@ -147,8 +145,35 @@ something | meta.embedded.block.graphql meta.select } | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql punctuation.operation.graphql | meta.embedded.block.graphql meta.selectionset.graphql } | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql -\` | punctuation.definition.string.template.end.js -); | +\` | meta.embedded.block.graphql punctuation.definition.string.template.end.js +) | +; | + | +const graphql = graphql | +( | + | meta.embedded.block.graphql +\` | meta.embedded.block.graphql punctuation.definition.string.template.begin.js + | meta.embedded.block.graphql +query | meta.embedded.block.graphql keyword.operation.graphql +( | meta.embedded.block.graphql meta.brace.round.graphql +$id | meta.embedded.block.graphql meta.variables.graphql variable.parameter.graphql +: | meta.embedded.block.graphql meta.variables.graphql punctuation.colon.graphql + | meta.embedded.block.graphql meta.variables.graphql +ID | meta.embedded.block.graphql meta.variables.graphql support.type.builtin.graphql +! | meta.embedded.block.graphql meta.variables.graphql keyword.operator.nulltype.graphql +) | meta.embedded.block.graphql meta.brace.round.graphql + | meta.embedded.block.graphql meta.selectionset.graphql +{ | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql + | meta.embedded.block.graphql meta.selectionset.graphql +test | meta.embedded.block.graphql meta.selectionset.graphql variable.graphql + | meta.embedded.block.graphql meta.selectionset.graphql +} | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql + | meta.embedded.block.graphql +\` | meta.embedded.block.graphql punctuation.definition.string.template.end.js +, | meta.embedded.block.graphql + [var1, var2] | meta.embedded.block.graphql +) | +; | | const query = | | @@ -165,12 +190,17 @@ id | meta.embedded.block.graphql meta.select | meta.embedded.block.graphql ' | punctuation.definition.string.template.end.js ; | -const query = | - | -graphql | entity.name.function.tagged-template.js +const query = graphql | ( | -' | punctuation.definition.string.template.begin.js +' | meta.embedded.block.graphql punctuation.definition.string.template.begin.js query | meta.embedded.block.graphql keyword.operation.graphql +( | meta.embedded.block.graphql meta.brace.round.graphql +$id | meta.embedded.block.graphql meta.variables.graphql variable.parameter.graphql +: | meta.embedded.block.graphql meta.variables.graphql punctuation.colon.graphql + | meta.embedded.block.graphql meta.variables.graphql +ID | meta.embedded.block.graphql meta.variables.graphql support.type.builtin.graphql +! | meta.embedded.block.graphql meta.variables.graphql keyword.operator.nulltype.graphql +) | meta.embedded.block.graphql meta.brace.round.graphql | meta.embedded.block.graphql meta.selectionset.graphql { | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql | meta.embedded.block.graphql meta.selectionset.graphql @@ -178,8 +208,30 @@ id | meta.embedded.block.graphql meta.select | meta.embedded.block.graphql meta.selectionset.graphql } | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql | meta.embedded.block.graphql -' | punctuation.definition.string.template.end.js -); | +' | meta.embedded.block.graphql punctuation.definition.string.template.end.js +) | +; | +const query = graphql | +( | + | meta.embedded.block.graphql +' | meta.embedded.block.graphql punctuation.definition.string.template.begin.js +query | meta.embedded.block.graphql keyword.operation.graphql +( | meta.embedded.block.graphql meta.brace.round.graphql +$id | meta.embedded.block.graphql meta.variables.graphql variable.parameter.graphql +: | meta.embedded.block.graphql meta.variables.graphql punctuation.colon.graphql + | meta.embedded.block.graphql meta.variables.graphql +ID | meta.embedded.block.graphql meta.variables.graphql support.type.builtin.graphql +! | meta.embedded.block.graphql meta.variables.graphql keyword.operator.nulltype.graphql +) | meta.embedded.block.graphql meta.brace.round.graphql + | meta.embedded.block.graphql meta.selectionset.graphql +{ | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql + | meta.embedded.block.graphql meta.selectionset.graphql +test | meta.embedded.block.graphql meta.selectionset.graphql variable.graphql + | meta.embedded.block.graphql meta.selectionset.graphql +} | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql +' | meta.embedded.block.graphql punctuation.definition.string.template.end.js +) | +; | | const queryWithInlineComment = | \` | taggedTemplates punctuation.definition.string.template.begin.js @@ -276,7 +328,6 @@ something | taggedTemplates meta.embedded.block.gra } | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql \` | taggedTemplates punctuation.definition.string.template.end.js ; | -// TODO: fix this | const queryWithInlineComment = \` | #graphql | query { | @@ -364,180 +415,255 @@ hello | meta.embedded.block.graphql meta.selectionset.graphql v `; exports[`inline.graphql grammar > should tokenize a simple typescript file 1`] = ` -/* eslint-disable */ | -// @ts-nocheck | - | -gql | entity.name.function.tagged-template.js -\` | punctuation.definition.string.template.begin.js - | meta.embedded.block.graphql -query | meta.embedded.block.graphql keyword.operation.graphql - | meta.embedded.block.graphql meta.selectionset.graphql -{ | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql - | meta.embedded.block.graphql meta.selectionset.graphql -user | meta.embedded.block.graphql meta.selectionset.graphql variable.graphql -( | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql meta.brace.round.directive.graphql -id | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql variable.parameter.graphql -: | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql punctuation.colon.graphql - | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql -" | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql string.quoted.double.graphql punctuation.definition.string.begin.graphql -5 | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql string.quoted.double.graphql -" | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql string.quoted.double.graphql punctuation.definition.string.end.graphql -, | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql punctuation.comma.graphql - | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql -name | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql variable.parameter.graphql -: | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql punctuation.colon.graphql - boolean | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql constant.character.enum.graphql -) | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql meta.brace.round.directive.graphql - | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql -{ | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql punctuation.operation.graphql - | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql -something | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql variable.graphql - | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql -} | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql punctuation.operation.graphql - | meta.embedded.block.graphql meta.selectionset.graphql -} | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql -\` | punctuation.definition.string.template.end.js -; | - | -graphql | entity.name.function.tagged-template.js - | -\` | punctuation.definition.string.template.begin.js - | meta.embedded.block.graphql -query | meta.embedded.block.graphql keyword.operation.graphql - | meta.embedded.block.graphql meta.selectionset.graphql -{ | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql - | meta.embedded.block.graphql meta.selectionset.graphql -user | meta.embedded.block.graphql meta.selectionset.graphql variable.graphql -( | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql meta.brace.round.directive.graphql -id | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql variable.parameter.graphql -: | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql punctuation.colon.graphql - | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql -" | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql string.quoted.double.graphql punctuation.definition.string.begin.graphql -5 | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql string.quoted.double.graphql -" | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql string.quoted.double.graphql punctuation.definition.string.end.graphql -, | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql punctuation.comma.graphql - | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql -name | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql variable.parameter.graphql -: | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql punctuation.colon.graphql - boolean | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql constant.character.enum.graphql -) | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql meta.brace.round.directive.graphql - | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql -{ | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql punctuation.operation.graphql - | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql -something | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql variable.graphql - | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql -} | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql punctuation.operation.graphql - | meta.embedded.block.graphql meta.selectionset.graphql -} | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql -\` | punctuation.definition.string.template.end.js -; | - | -const query = | - | -graphql | entity.name.function.tagged-template.js - | -\` | punctuation.definition.string.template.begin.js - | meta.embedded.block.graphql -query | meta.embedded.block.graphql keyword.operation.graphql - | meta.embedded.block.graphql meta.selectionset.graphql -{ | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql - | meta.embedded.block.graphql meta.selectionset.graphql -user | meta.embedded.block.graphql meta.selectionset.graphql variable.graphql -( | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql meta.brace.round.directive.graphql -id | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql variable.parameter.graphql -: | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql punctuation.colon.graphql - | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql -" | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql string.quoted.double.graphql punctuation.definition.string.begin.graphql -5 | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql string.quoted.double.graphql -" | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql string.quoted.double.graphql punctuation.definition.string.end.graphql -, | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql punctuation.comma.graphql - | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql -name | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql variable.parameter.graphql -: | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql punctuation.colon.graphql - boolean | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql constant.character.enum.graphql -) | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql meta.brace.round.directive.graphql - | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql -{ | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql punctuation.operation.graphql - | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql -something | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql variable.graphql - | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql -} | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql punctuation.operation.graphql - | meta.embedded.block.graphql meta.selectionset.graphql -} | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql -\` | punctuation.definition.string.template.end.js -; | - | -// TODO: Fix this | -const query = graphql('query { id }'); | - | -const queryWithInlineComment = | -\` | taggedTemplates punctuation.definition.string.template.begin.js -#graphql | taggedTemplates comment.line.graphql.js - | taggedTemplates meta.embedded.block.graphql -query | taggedTemplates meta.embedded.block.graphql keyword.operation.graphql - | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql -{ | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql - | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql -user | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql variable.graphql -( | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql meta.brace.round.directive.graphql -id | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql variable.parameter.graphql -: | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql punctuation.colon.graphql - | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql -" | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql string.quoted.double.graphql punctuation.definition.string.begin.graphql -5 | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql string.quoted.double.graphql -" | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql string.quoted.double.graphql punctuation.definition.string.end.graphql -, | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql punctuation.comma.graphql - | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql -name | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql variable.parameter.graphql -: | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql punctuation.colon.graphql - boolean | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql constant.character.enum.graphql -) | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql meta.brace.round.directive.graphql - | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql -{ | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql punctuation.operation.graphql - | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql -something | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql variable.graphql - | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql -} | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql punctuation.operation.graphql - | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql -} | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql -\` | taggedTemplates punctuation.definition.string.template.end.js -; | - | -const queryWithLeadingComment = | - | -/* GraphQL */ | comment.graphql.js - | -\` | punctuation.definition.string.template.begin.js - | meta.embedded.block.graphql -query | meta.embedded.block.graphql keyword.operation.graphql - | meta.embedded.block.graphql meta.selectionset.graphql -{ | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql - | meta.embedded.block.graphql meta.selectionset.graphql -user | meta.embedded.block.graphql meta.selectionset.graphql variable.graphql -( | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql meta.brace.round.directive.graphql -id | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql variable.parameter.graphql -: | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql punctuation.colon.graphql - | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql -" | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql string.quoted.double.graphql punctuation.definition.string.begin.graphql -5 | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql string.quoted.double.graphql -" | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql string.quoted.double.graphql punctuation.definition.string.end.graphql -, | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql punctuation.comma.graphql - | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql -name | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql variable.parameter.graphql -: | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql punctuation.colon.graphql - boolean | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql constant.character.enum.graphql -) | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql meta.brace.round.directive.graphql - | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql -{ | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql punctuation.operation.graphql - | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql -something | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql variable.graphql - | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql -} | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql punctuation.operation.graphql - | meta.embedded.block.graphql meta.selectionset.graphql -} | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql -\` | punctuation.definition.string.template.end.js -; | - | +/* eslint-disable */ | +// @ts-nocheck | + | +gql | entity.name.function.tagged-template.js +\` | punctuation.definition.string.template.begin.js + | meta.embedded.block.graphql +query | meta.embedded.block.graphql keyword.operation.graphql + | meta.embedded.block.graphql meta.selectionset.graphql +{ | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql + | meta.embedded.block.graphql meta.selectionset.graphql +user | meta.embedded.block.graphql meta.selectionset.graphql variable.graphql +( | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql meta.brace.round.directive.graphql +id | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql variable.parameter.graphql +: | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql punctuation.colon.graphql + | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql +" | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql string.quoted.double.graphql punctuation.definition.string.begin.graphql +5 | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql string.quoted.double.graphql +" | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql string.quoted.double.graphql punctuation.definition.string.end.graphql +, | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql punctuation.comma.graphql + | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql +name | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql variable.parameter.graphql +: | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql punctuation.colon.graphql + boolean | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql constant.character.enum.graphql +) | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql meta.brace.round.directive.graphql + | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql +{ | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql punctuation.operation.graphql + | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql +something | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql variable.graphql + | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql +} | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql punctuation.operation.graphql + | meta.embedded.block.graphql meta.selectionset.graphql +} | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql +\` | punctuation.definition.string.template.end.js +; | + | +graphql | entity.name.function.tagged-template.js + | +\` | punctuation.definition.string.template.begin.js + | meta.embedded.block.graphql +query | meta.embedded.block.graphql keyword.operation.graphql + | meta.embedded.block.graphql meta.selectionset.graphql +{ | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql + | meta.embedded.block.graphql meta.selectionset.graphql +user | meta.embedded.block.graphql meta.selectionset.graphql variable.graphql +( | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql meta.brace.round.directive.graphql +id | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql variable.parameter.graphql +: | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql punctuation.colon.graphql + | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql +" | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql string.quoted.double.graphql punctuation.definition.string.begin.graphql +5 | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql string.quoted.double.graphql +" | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql string.quoted.double.graphql punctuation.definition.string.end.graphql +, | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql punctuation.comma.graphql + | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql +name | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql variable.parameter.graphql +: | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql punctuation.colon.graphql + boolean | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql constant.character.enum.graphql +) | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql meta.brace.round.directive.graphql + | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql +{ | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql punctuation.operation.graphql + | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql +something | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql variable.graphql + | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql +} | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql punctuation.operation.graphql + | meta.embedded.block.graphql meta.selectionset.graphql +} | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql +\` | punctuation.definition.string.template.end.js +; | + | +const query = | + | +graphql | entity.name.function.tagged-template.js + | +\` | punctuation.definition.string.template.begin.js + | meta.embedded.block.graphql +query | meta.embedded.block.graphql keyword.operation.graphql + | meta.embedded.block.graphql meta.selectionset.graphql +{ | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql + | meta.embedded.block.graphql meta.selectionset.graphql +user | meta.embedded.block.graphql meta.selectionset.graphql variable.graphql +( | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql meta.brace.round.directive.graphql +id | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql variable.parameter.graphql +: | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql punctuation.colon.graphql + | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql +" | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql string.quoted.double.graphql punctuation.definition.string.begin.graphql +5 | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql string.quoted.double.graphql +" | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql string.quoted.double.graphql punctuation.definition.string.end.graphql +, | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql punctuation.comma.graphql + | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql +name | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql variable.parameter.graphql +: | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql punctuation.colon.graphql + boolean | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql constant.character.enum.graphql +) | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql meta.brace.round.directive.graphql + | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql +{ | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql punctuation.operation.graphql + | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql +something | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql variable.graphql + | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql +} | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql punctuation.operation.graphql + | meta.embedded.block.graphql meta.selectionset.graphql +} | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql +\` | punctuation.definition.string.template.end.js +; | + | +const query = graphql | +( | +' | meta.embedded.block.graphql punctuation.definition.string.template.begin.js +query | meta.embedded.block.graphql keyword.operation.graphql + | meta.embedded.block.graphql meta.selectionset.graphql +{ | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql + | meta.embedded.block.graphql meta.selectionset.graphql +id | meta.embedded.block.graphql meta.selectionset.graphql variable.graphql + | meta.embedded.block.graphql meta.selectionset.graphql +} | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql +' | meta.embedded.block.graphql punctuation.definition.string.template.end.js +) | +; | + | +const query = graphql | +( | + | meta.embedded.block.graphql +' | meta.embedded.block.graphql punctuation.definition.string.template.begin.js +query | meta.embedded.block.graphql keyword.operation.graphql + | meta.embedded.block.graphql meta.selectionset.graphql +{ | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql + | meta.embedded.block.graphql meta.selectionset.graphql +id | meta.embedded.block.graphql meta.selectionset.graphql variable.graphql + | meta.embedded.block.graphql meta.selectionset.graphql +} | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql +' | meta.embedded.block.graphql punctuation.definition.string.template.end.js +) | +; | + | +const query = graphql | +( | + | meta.embedded.block.graphql +' | meta.embedded.block.graphql punctuation.definition.string.template.begin.js +query | meta.embedded.block.graphql keyword.operation.graphql + | meta.embedded.block.graphql meta.selectionset.graphql +{ | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql + | meta.embedded.block.graphql meta.selectionset.graphql +id | meta.embedded.block.graphql meta.selectionset.graphql variable.graphql + | meta.embedded.block.graphql meta.selectionset.graphql +} | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql +' | meta.embedded.block.graphql punctuation.definition.string.template.end.js +) | +; | + | +const query = graphql | +( | +\` | meta.embedded.block.graphql punctuation.definition.string.template.begin.js + | meta.embedded.block.graphql +query | meta.embedded.block.graphql keyword.operation.graphql + | meta.embedded.block.graphql meta.selectionset.graphql +{ | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql + | meta.embedded.block.graphql meta.selectionset.graphql +id | meta.embedded.block.graphql meta.selectionset.graphql variable.graphql + | meta.embedded.block.graphql meta.selectionset.graphql +} | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql +\` | meta.embedded.block.graphql punctuation.definition.string.template.end.js +) | +; | + | +const query = graphql | +( | + | meta.embedded.block.graphql +\` | meta.embedded.block.graphql punctuation.definition.string.template.begin.js + | meta.embedded.block.graphql +query | meta.embedded.block.graphql keyword.operation.graphql + | meta.embedded.block.graphql meta.selectionset.graphql +{ | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql + | meta.embedded.block.graphql meta.selectionset.graphql +id | meta.embedded.block.graphql meta.selectionset.graphql variable.graphql + | meta.embedded.block.graphql meta.selectionset.graphql +} | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql + | meta.embedded.block.graphql +\` | meta.embedded.block.graphql punctuation.definition.string.template.end.js +, | meta.embedded.block.graphql + [var1, var2] | meta.embedded.block.graphql +) | +; | + | +const queryWithInlineComment = | +\` | taggedTemplates punctuation.definition.string.template.begin.js +#graphql | taggedTemplates comment.line.graphql.js + | taggedTemplates meta.embedded.block.graphql +query | taggedTemplates meta.embedded.block.graphql keyword.operation.graphql + | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql +{ | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql + | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql +user | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql variable.graphql +( | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql meta.brace.round.directive.graphql +id | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql variable.parameter.graphql +: | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql punctuation.colon.graphql + | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql +" | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql string.quoted.double.graphql punctuation.definition.string.begin.graphql +5 | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql string.quoted.double.graphql +" | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql string.quoted.double.graphql punctuation.definition.string.end.graphql +, | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql punctuation.comma.graphql + | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql +name | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql variable.parameter.graphql +: | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql punctuation.colon.graphql + boolean | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql constant.character.enum.graphql +) | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql meta.brace.round.directive.graphql + | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql +{ | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql punctuation.operation.graphql + | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql +something | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql variable.graphql + | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql +} | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql punctuation.operation.graphql + | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql +} | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql +\` | taggedTemplates punctuation.definition.string.template.end.js +; | + | +const queryWithLeadingComment = | + | +/* GraphQL */ | comment.graphql.js + | +\` | punctuation.definition.string.template.begin.js + | meta.embedded.block.graphql +query | meta.embedded.block.graphql keyword.operation.graphql + | meta.embedded.block.graphql meta.selectionset.graphql +{ | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql + | meta.embedded.block.graphql meta.selectionset.graphql +user | meta.embedded.block.graphql meta.selectionset.graphql variable.graphql +( | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql meta.brace.round.directive.graphql +id | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql variable.parameter.graphql +: | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql punctuation.colon.graphql + | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql +" | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql string.quoted.double.graphql punctuation.definition.string.begin.graphql +5 | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql string.quoted.double.graphql +" | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql string.quoted.double.graphql punctuation.definition.string.end.graphql +, | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql punctuation.comma.graphql + | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql +name | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql variable.parameter.graphql +: | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql punctuation.colon.graphql + boolean | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql constant.character.enum.graphql +) | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql meta.brace.round.directive.graphql + | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql +{ | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql punctuation.operation.graphql + | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql +something | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql variable.graphql + | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql +} | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql punctuation.operation.graphql + | meta.embedded.block.graphql meta.selectionset.graphql +} | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql +\` | punctuation.definition.string.template.end.js +; | + | `; exports[`inline.graphql grammar > should tokenize a simple vue sfc comp file 1`] = ` diff --git a/packages/vscode-graphql-syntax/tests/__snapshots__/markdown-grammar.spec.ts.snap b/packages/vscode-graphql-syntax/tests/__snapshots__/markdown-grammar.spec.ts.snap index cb1a88a0b80..02b0aafc8b8 100644 --- a/packages/vscode-graphql-syntax/tests/__snapshots__/markdown-grammar.spec.ts.snap +++ b/packages/vscode-graphql-syntax/tests/__snapshots__/markdown-grammar.spec.ts.snap @@ -107,6 +107,50 @@ graphql\` | const Component = () => { | return
; | }; | +\`\`\` | + | +\`\`\`js | +const variable = 1; | + | +const queryA = graphql(\` | + query { | + something(arg: \${variable}) | + } | +\`); | + | +const queryB = graphql( | + \` | + query { | + something(arg: \${variable}) | + } | + \` | +); | + | +const queryC = graphql( | + 'query { something(arg: \${variable}) }' | +); | +\`\`\` | + | +\`\`\`ts | +const variable: number = 1; | + | +const queryA = graphql(\` | + query { | + something(arg: \${variable}) | + } | +\`); | + | +const queryB = graphql( | + \` | + query { | + something(arg: \${variable}) | + } | + \` | +); | + | +const queryC = graphql( | + 'query { something(arg: \${variable}) }' | +); | \`\`\` | | ### svelte | From f4c98c1f7c6df5a918479e641631e8fbc5b5a92e Mon Sep 17 00:00:00 2001 From: John Collett <92598453+johndcollett@users.noreply.github.com> Date: Fri, 1 Mar 2024 09:34:37 -0500 Subject: [PATCH 02/81] multiple argument syntax highlighting (#3534) --- .changeset/green-houses-raise.md | 5 +++++ packages/cm6-graphql/__tests__/cases.txt | 10 ++++++++++ packages/cm6-graphql/src/syntax.grammar | 2 +- 3 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 .changeset/green-houses-raise.md diff --git a/.changeset/green-houses-raise.md b/.changeset/green-houses-raise.md new file mode 100644 index 00000000000..dab16a796a6 --- /dev/null +++ b/.changeset/green-houses-raise.md @@ -0,0 +1,5 @@ +--- +'cm6-graphql': patch +--- + +fix: multiple argument syntax highlighting diff --git a/packages/cm6-graphql/__tests__/cases.txt b/packages/cm6-graphql/__tests__/cases.txt index 241700a124d..dbd41900c01 100644 --- a/packages/cm6-graphql/__tests__/cases.txt +++ b/packages/cm6-graphql/__tests__/cases.txt @@ -145,3 +145,13 @@ Document( ) ) ) + +# multiple arguments separated by a commas + +{ + picture(width: 200, height: 100) +} + +==> + +Document(OperationDefinition(SelectionSet("{",Selection(Field(FieldName,Arguments("(",Argument(ArgumentAttributeName,IntValue),Argument(ArgumentAttributeName,IntValue),")"))),"}"))) diff --git a/packages/cm6-graphql/src/syntax.grammar b/packages/cm6-graphql/src/syntax.grammar index 71c1c0838aa..1a61dda1d53 100644 --- a/packages/cm6-graphql/src/syntax.grammar +++ b/packages/cm6-graphql/src/syntax.grammar @@ -291,7 +291,7 @@ Directive { DirectiveName Arguments? } Arguments { "(" Argument+ ")"} // https://spec.graphql.org/October2021/#Argument -Argument { ArgumentAttributeName ":" value } +Argument { ArgumentAttributeName ":" value comma? } ArgumentAttributeName { name } From 04b44fab2b74da6de12b12c84be50ab666991467 Mon Sep 17 00:00:00 2001 From: Rikki Schulte Date: Fri, 1 Mar 2024 19:25:41 +0100 Subject: [PATCH 03/81] Version Packages (#3540) Co-authored-by: github-actions[bot] --- .changeset/famous-games-begin.md | 5 ----- .changeset/green-houses-raise.md | 5 ----- packages/cm6-graphql/CHANGELOG.md | 6 ++++++ packages/cm6-graphql/package.json | 2 +- packages/vscode-graphql-syntax/CHANGELOG.md | 6 ++++++ packages/vscode-graphql-syntax/package.json | 2 +- 6 files changed, 14 insertions(+), 12 deletions(-) delete mode 100644 .changeset/famous-games-begin.md delete mode 100644 .changeset/green-houses-raise.md diff --git a/.changeset/famous-games-begin.md b/.changeset/famous-games-begin.md deleted file mode 100644 index ae10f9af58d..00000000000 --- a/.changeset/famous-games-begin.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'vscode-graphql-syntax': patch ---- - -Fix TextMate grammar to support string literals that don’t immediately follow a function call's left-parenthesis (`(`). diff --git a/.changeset/green-houses-raise.md b/.changeset/green-houses-raise.md deleted file mode 100644 index dab16a796a6..00000000000 --- a/.changeset/green-houses-raise.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'cm6-graphql': patch ---- - -fix: multiple argument syntax highlighting diff --git a/packages/cm6-graphql/CHANGELOG.md b/packages/cm6-graphql/CHANGELOG.md index fa7947f02f7..2ca0b97375d 100644 --- a/packages/cm6-graphql/CHANGELOG.md +++ b/packages/cm6-graphql/CHANGELOG.md @@ -1,5 +1,11 @@ # 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 diff --git a/packages/cm6-graphql/package.json b/packages/cm6-graphql/package.json index 6337050e0fd..2bccde915c4 100644 --- a/packages/cm6-graphql/package.json +++ b/packages/cm6-graphql/package.json @@ -1,6 +1,6 @@ { "name": "cm6-graphql", - "version": "0.0.13", + "version": "0.0.14", "description": "GraphQL language support for CodeMirror 6", "scripts": { "build": "cm-buildhelper src/index.ts", diff --git a/packages/vscode-graphql-syntax/CHANGELOG.md b/packages/vscode-graphql-syntax/CHANGELOG.md index fc7560540fb..c90bde05047 100644 --- a/packages/vscode-graphql-syntax/CHANGELOG.md +++ b/packages/vscode-graphql-syntax/CHANGELOG.md @@ -1,5 +1,11 @@ # vscode-graphql-syntax +## 1.3.3 + +### Patch Changes + +- [#3518](https://github.com/graphql/graphiql/pull/3518) [`e502c41e`](https://github.com/graphql/graphiql/commit/e502c41e68440e7331cfc74d8c78fd092f3354a8) Thanks [@kitten](https://github.com/kitten)! - Fix TextMate grammar to support string literals that don’t immediately follow a function call's left-parenthesis (`(`). + ## 1.3.2 ### Patch Changes diff --git a/packages/vscode-graphql-syntax/package.json b/packages/vscode-graphql-syntax/package.json index 59eea43e2c7..3a4ab1141b2 100644 --- a/packages/vscode-graphql-syntax/package.json +++ b/packages/vscode-graphql-syntax/package.json @@ -1,6 +1,6 @@ { "name": "vscode-graphql-syntax", - "version": "1.3.2", + "version": "1.3.3", "displayName": "GraphQL: Syntax Highlighting", "description": "Adds syntax highlighting support for .graphql & embedded support for javascript, typescript, vue, markdown, python, php, reason, ocaml and rescript", "publisher": "GraphQL", From defc126b107961d7a4ba093b35b1d77bb7018a79 Mon Sep 17 00:00:00 2001 From: Rikki Schulte Date: Sat, 2 Mar 2024 14:38:47 +0100 Subject: [PATCH 04/81] =?UTF-8?q?Revert=20"fix:=20Fix=20vscode-graphql-syn?= =?UTF-8?q?tax=E2=80=99s=20grammar=20to=20support=20string=20literals=20on?= =?UTF-8?q?=20separate=20lines"=20(#3543)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Revert "fix: Fix vscode-graphql-syntax’s grammar to support string literals o…" This reverts commit e502c41e68440e7331cfc74d8c78fd092f3354a8. --- .changeset/famous-ads-jam.md | 6 + .../grammars/graphql.js.json | 49 +- .../tests/__fixtures__/test-js.md | 44 -- .../tests/__fixtures__/test.js | 13 +- .../tests/__fixtures__/test.ts | 20 +- .../__snapshots__/js-grammar.spec.ts.snap | 500 +++++++----------- .../markdown-grammar.spec.ts.snap | 44 -- 7 files changed, 222 insertions(+), 454 deletions(-) create mode 100644 .changeset/famous-ads-jam.md diff --git a/.changeset/famous-ads-jam.md b/.changeset/famous-ads-jam.md new file mode 100644 index 00000000000..c79c7b8e89a --- /dev/null +++ b/.changeset/famous-ads-jam.md @@ -0,0 +1,6 @@ +--- +"vscode-graphql-syntax": patch +"vscode-graphql": patch +--- + +Temporarily revert a syntax highlighting bugfix that caused more bugs diff --git a/packages/vscode-graphql-syntax/grammars/graphql.js.json b/packages/vscode-graphql-syntax/grammars/graphql.js.json index 89704e30495..9c65649db9d 100644 --- a/packages/vscode-graphql-syntax/grammars/graphql.js.json +++ b/packages/vscode-graphql-syntax/grammars/graphql.js.json @@ -4,33 +4,39 @@ "patterns": [ { "contentName": "meta.embedded.block.graphql", - "begin": "(?<=(?:(?:Relay\\??\\.)QL|gql|graphql|graphql\\.experimental)\\s*(?:<.*>)?\\s*)\\(", - "end": "\\)", + "begin": "\\s*+(?:(?:(Relay)\\??\\.)(QL)|(gql|graphql|graphql\\.experimental)|(/\\* GraphQL \\*/))\\s*\\(?\\s*(`|')", + "beginCaptures": { + "1": { + "name": "variable.other.class.js" + }, + "2": { + "name": "entity.name.function.tagged-template.js" + }, + "3": { + "name": "entity.name.function.tagged-template.js" + }, + "4": { + "name": "comment.graphql.js" + }, + "5": { + "name": "punctuation.definition.string.template.begin.js" + } + }, + "end": "(`|')", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.template.end.js" + } + }, "patterns": [ { - "begin": "(`|')", - "end": "(`|')", - "beginCaptures": { - "0": { - "name": "punctuation.definition.string.template.begin.js" - } - }, - "endCaptures": { - "0": { - "name": "punctuation.definition.string.template.end.js" - } - }, - "patterns": [ - { - "include": "source.graphql" - } - ] + "include": "source.graphql" } ] }, { "contentName": "meta.embedded.block.graphql", - "begin": "\\s*+(?:(?:(?:(Relay)\\??\\.)(QL)|(gql|graphql|graphql\\.experimental)\\s*(?:<.*>)?\\s*)|(/\\* GraphQL \\*/))\\s*(`|')", + "begin": "\\s*+(?:(?:(Relay)\\??\\.)(QL)|(gql|graphql|graphql\\.experimental))\\s*\\(?\\s*(?:<.*>)(`|')", "beginCaptures": { "1": { "name": "variable.other.class.js" @@ -42,9 +48,6 @@ "name": "entity.name.function.tagged-template.js" }, "4": { - "name": "comment.graphql.js" - }, - "5": { "name": "punctuation.definition.string.template.begin.js" } }, diff --git a/packages/vscode-graphql-syntax/tests/__fixtures__/test-js.md b/packages/vscode-graphql-syntax/tests/__fixtures__/test-js.md index 71ab2138dda..76601d15497 100644 --- a/packages/vscode-graphql-syntax/tests/__fixtures__/test-js.md +++ b/packages/vscode-graphql-syntax/tests/__fixtures__/test-js.md @@ -26,50 +26,6 @@ const Component = () => { }; ``` -```js -const variable = 1; - -const queryA = graphql(` - query { - something(arg: ${variable}) - } -`); - -const queryB = graphql( - ` - query { - something(arg: ${variable}) - } - ` -); - -const queryC = graphql( - 'query { something(arg: ${variable}) }' -); -``` - -```ts -const variable: number = 1; - -const queryA = graphql(` - query { - something(arg: ${variable}) - } -`); - -const queryB = graphql( - ` - query { - something(arg: ${variable}) - } - ` -); - -const queryC = graphql( - 'query { something(arg: ${variable}) }' -); -``` - ### svelte ```svelte diff --git a/packages/vscode-graphql-syntax/tests/__fixtures__/test.js b/packages/vscode-graphql-syntax/tests/__fixtures__/test.js index 616f41dd27e..1112c7adbfa 100644 --- a/packages/vscode-graphql-syntax/tests/__fixtures__/test.js +++ b/packages/vscode-graphql-syntax/tests/__fixtures__/test.js @@ -37,18 +37,8 @@ const graphql = graphql(` } `); -const graphql = graphql( - ` - query($id: ID!) { test } - `, - [var1, var2] -); - const query = /* GraphQL */ 'query { id } '; -const query = graphql('query($id: ID!) { id } '); -const query = graphql( - 'query($id: ID!) { test }' -); +const query = graphql('query { id } '); const queryWithInlineComment = `#graphql query { @@ -69,6 +59,7 @@ const queryWithInlineComment = `#graphql } } `; +// TODO: fix this const queryWithInlineComment = ` #graphql query { diff --git a/packages/vscode-graphql-syntax/tests/__fixtures__/test.ts b/packages/vscode-graphql-syntax/tests/__fixtures__/test.ts index 5ae8cefaad3..b8e507901b6 100644 --- a/packages/vscode-graphql-syntax/tests/__fixtures__/test.ts +++ b/packages/vscode-graphql-syntax/tests/__fixtures__/test.ts @@ -25,27 +25,9 @@ const query = graphql` } `; +// TODO: Fix this const query = graphql('query { id }'); -const query = graphql( - 'query { id }' -); - -const query = graphql( - 'query { id }' -); - -const query = graphql(` - query { id } -`); - -const query = graphql( - ` - query { id } - `, - [var1, var2] -); - const queryWithInlineComment = `#graphql query { user(id: "5", name: boolean) { diff --git a/packages/vscode-graphql-syntax/tests/__snapshots__/js-grammar.spec.ts.snap b/packages/vscode-graphql-syntax/tests/__snapshots__/js-grammar.spec.ts.snap index 3921a4178b3..1be3ebd280f 100644 --- a/packages/vscode-graphql-syntax/tests/__snapshots__/js-grammar.spec.ts.snap +++ b/packages/vscode-graphql-syntax/tests/__snapshots__/js-grammar.spec.ts.snap @@ -108,9 +108,11 @@ something | meta.embedded.block.graphql meta.select \` | punctuation.definition.string.template.end.js ; | | -const graphql = graphql | +const graphql = | + | +graphql | entity.name.function.tagged-template.js ( | -\` | meta.embedded.block.graphql punctuation.definition.string.template.begin.js +\` | punctuation.definition.string.template.begin.js | meta.embedded.block.graphql """ | meta.embedded.block.graphql comment.line.graphql.js punctuation.whitespace.comment.leading.graphql this is a comment | meta.embedded.block.graphql comment.line.graphql.js @@ -145,35 +147,8 @@ something | meta.embedded.block.graphql meta.select } | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql punctuation.operation.graphql | meta.embedded.block.graphql meta.selectionset.graphql } | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql -\` | meta.embedded.block.graphql punctuation.definition.string.template.end.js -) | -; | - | -const graphql = graphql | -( | - | meta.embedded.block.graphql -\` | meta.embedded.block.graphql punctuation.definition.string.template.begin.js - | meta.embedded.block.graphql -query | meta.embedded.block.graphql keyword.operation.graphql -( | meta.embedded.block.graphql meta.brace.round.graphql -$id | meta.embedded.block.graphql meta.variables.graphql variable.parameter.graphql -: | meta.embedded.block.graphql meta.variables.graphql punctuation.colon.graphql - | meta.embedded.block.graphql meta.variables.graphql -ID | meta.embedded.block.graphql meta.variables.graphql support.type.builtin.graphql -! | meta.embedded.block.graphql meta.variables.graphql keyword.operator.nulltype.graphql -) | meta.embedded.block.graphql meta.brace.round.graphql - | meta.embedded.block.graphql meta.selectionset.graphql -{ | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql - | meta.embedded.block.graphql meta.selectionset.graphql -test | meta.embedded.block.graphql meta.selectionset.graphql variable.graphql - | meta.embedded.block.graphql meta.selectionset.graphql -} | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql - | meta.embedded.block.graphql -\` | meta.embedded.block.graphql punctuation.definition.string.template.end.js -, | meta.embedded.block.graphql - [var1, var2] | meta.embedded.block.graphql -) | -; | +\` | punctuation.definition.string.template.end.js +); | | const query = | | @@ -190,17 +165,12 @@ id | meta.embedded.block.graphql meta.select | meta.embedded.block.graphql ' | punctuation.definition.string.template.end.js ; | -const query = graphql | +const query = | + | +graphql | entity.name.function.tagged-template.js ( | -' | meta.embedded.block.graphql punctuation.definition.string.template.begin.js +' | punctuation.definition.string.template.begin.js query | meta.embedded.block.graphql keyword.operation.graphql -( | meta.embedded.block.graphql meta.brace.round.graphql -$id | meta.embedded.block.graphql meta.variables.graphql variable.parameter.graphql -: | meta.embedded.block.graphql meta.variables.graphql punctuation.colon.graphql - | meta.embedded.block.graphql meta.variables.graphql -ID | meta.embedded.block.graphql meta.variables.graphql support.type.builtin.graphql -! | meta.embedded.block.graphql meta.variables.graphql keyword.operator.nulltype.graphql -) | meta.embedded.block.graphql meta.brace.round.graphql | meta.embedded.block.graphql meta.selectionset.graphql { | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql | meta.embedded.block.graphql meta.selectionset.graphql @@ -208,30 +178,8 @@ id | meta.embedded.block.graphql meta.select | meta.embedded.block.graphql meta.selectionset.graphql } | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql | meta.embedded.block.graphql -' | meta.embedded.block.graphql punctuation.definition.string.template.end.js -) | -; | -const query = graphql | -( | - | meta.embedded.block.graphql -' | meta.embedded.block.graphql punctuation.definition.string.template.begin.js -query | meta.embedded.block.graphql keyword.operation.graphql -( | meta.embedded.block.graphql meta.brace.round.graphql -$id | meta.embedded.block.graphql meta.variables.graphql variable.parameter.graphql -: | meta.embedded.block.graphql meta.variables.graphql punctuation.colon.graphql - | meta.embedded.block.graphql meta.variables.graphql -ID | meta.embedded.block.graphql meta.variables.graphql support.type.builtin.graphql -! | meta.embedded.block.graphql meta.variables.graphql keyword.operator.nulltype.graphql -) | meta.embedded.block.graphql meta.brace.round.graphql - | meta.embedded.block.graphql meta.selectionset.graphql -{ | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql - | meta.embedded.block.graphql meta.selectionset.graphql -test | meta.embedded.block.graphql meta.selectionset.graphql variable.graphql - | meta.embedded.block.graphql meta.selectionset.graphql -} | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql -' | meta.embedded.block.graphql punctuation.definition.string.template.end.js -) | -; | +' | punctuation.definition.string.template.end.js +); | | const queryWithInlineComment = | \` | taggedTemplates punctuation.definition.string.template.begin.js @@ -328,6 +276,7 @@ something | taggedTemplates meta.embedded.block.gra } | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql \` | taggedTemplates punctuation.definition.string.template.end.js ; | +// TODO: fix this | const queryWithInlineComment = \` | #graphql | query { | @@ -415,255 +364,180 @@ hello | meta.embedded.block.graphql meta.selectionset.graphql v `; exports[`inline.graphql grammar > should tokenize a simple typescript file 1`] = ` -/* eslint-disable */ | -// @ts-nocheck | - | -gql | entity.name.function.tagged-template.js -\` | punctuation.definition.string.template.begin.js - | meta.embedded.block.graphql -query | meta.embedded.block.graphql keyword.operation.graphql - | meta.embedded.block.graphql meta.selectionset.graphql -{ | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql - | meta.embedded.block.graphql meta.selectionset.graphql -user | meta.embedded.block.graphql meta.selectionset.graphql variable.graphql -( | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql meta.brace.round.directive.graphql -id | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql variable.parameter.graphql -: | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql punctuation.colon.graphql - | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql -" | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql string.quoted.double.graphql punctuation.definition.string.begin.graphql -5 | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql string.quoted.double.graphql -" | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql string.quoted.double.graphql punctuation.definition.string.end.graphql -, | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql punctuation.comma.graphql - | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql -name | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql variable.parameter.graphql -: | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql punctuation.colon.graphql - boolean | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql constant.character.enum.graphql -) | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql meta.brace.round.directive.graphql - | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql -{ | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql punctuation.operation.graphql - | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql -something | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql variable.graphql - | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql -} | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql punctuation.operation.graphql - | meta.embedded.block.graphql meta.selectionset.graphql -} | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql -\` | punctuation.definition.string.template.end.js -; | - | -graphql | entity.name.function.tagged-template.js - | -\` | punctuation.definition.string.template.begin.js - | meta.embedded.block.graphql -query | meta.embedded.block.graphql keyword.operation.graphql - | meta.embedded.block.graphql meta.selectionset.graphql -{ | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql - | meta.embedded.block.graphql meta.selectionset.graphql -user | meta.embedded.block.graphql meta.selectionset.graphql variable.graphql -( | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql meta.brace.round.directive.graphql -id | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql variable.parameter.graphql -: | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql punctuation.colon.graphql - | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql -" | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql string.quoted.double.graphql punctuation.definition.string.begin.graphql -5 | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql string.quoted.double.graphql -" | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql string.quoted.double.graphql punctuation.definition.string.end.graphql -, | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql punctuation.comma.graphql - | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql -name | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql variable.parameter.graphql -: | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql punctuation.colon.graphql - boolean | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql constant.character.enum.graphql -) | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql meta.brace.round.directive.graphql - | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql -{ | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql punctuation.operation.graphql - | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql -something | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql variable.graphql - | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql -} | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql punctuation.operation.graphql - | meta.embedded.block.graphql meta.selectionset.graphql -} | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql -\` | punctuation.definition.string.template.end.js -; | - | -const query = | - | -graphql | entity.name.function.tagged-template.js - | -\` | punctuation.definition.string.template.begin.js - | meta.embedded.block.graphql -query | meta.embedded.block.graphql keyword.operation.graphql - | meta.embedded.block.graphql meta.selectionset.graphql -{ | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql - | meta.embedded.block.graphql meta.selectionset.graphql -user | meta.embedded.block.graphql meta.selectionset.graphql variable.graphql -( | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql meta.brace.round.directive.graphql -id | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql variable.parameter.graphql -: | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql punctuation.colon.graphql - | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql -" | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql string.quoted.double.graphql punctuation.definition.string.begin.graphql -5 | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql string.quoted.double.graphql -" | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql string.quoted.double.graphql punctuation.definition.string.end.graphql -, | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql punctuation.comma.graphql - | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql -name | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql variable.parameter.graphql -: | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql punctuation.colon.graphql - boolean | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql constant.character.enum.graphql -) | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql meta.brace.round.directive.graphql - | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql -{ | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql punctuation.operation.graphql - | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql -something | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql variable.graphql - | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql -} | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql punctuation.operation.graphql - | meta.embedded.block.graphql meta.selectionset.graphql -} | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql -\` | punctuation.definition.string.template.end.js -; | - | -const query = graphql | -( | -' | meta.embedded.block.graphql punctuation.definition.string.template.begin.js -query | meta.embedded.block.graphql keyword.operation.graphql - | meta.embedded.block.graphql meta.selectionset.graphql -{ | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql - | meta.embedded.block.graphql meta.selectionset.graphql -id | meta.embedded.block.graphql meta.selectionset.graphql variable.graphql - | meta.embedded.block.graphql meta.selectionset.graphql -} | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql -' | meta.embedded.block.graphql punctuation.definition.string.template.end.js -) | -; | - | -const query = graphql | -( | - | meta.embedded.block.graphql -' | meta.embedded.block.graphql punctuation.definition.string.template.begin.js -query | meta.embedded.block.graphql keyword.operation.graphql - | meta.embedded.block.graphql meta.selectionset.graphql -{ | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql - | meta.embedded.block.graphql meta.selectionset.graphql -id | meta.embedded.block.graphql meta.selectionset.graphql variable.graphql - | meta.embedded.block.graphql meta.selectionset.graphql -} | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql -' | meta.embedded.block.graphql punctuation.definition.string.template.end.js -) | -; | - | -const query = graphql | -( | - | meta.embedded.block.graphql -' | meta.embedded.block.graphql punctuation.definition.string.template.begin.js -query | meta.embedded.block.graphql keyword.operation.graphql - | meta.embedded.block.graphql meta.selectionset.graphql -{ | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql - | meta.embedded.block.graphql meta.selectionset.graphql -id | meta.embedded.block.graphql meta.selectionset.graphql variable.graphql - | meta.embedded.block.graphql meta.selectionset.graphql -} | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql -' | meta.embedded.block.graphql punctuation.definition.string.template.end.js -) | -; | - | -const query = graphql | -( | -\` | meta.embedded.block.graphql punctuation.definition.string.template.begin.js - | meta.embedded.block.graphql -query | meta.embedded.block.graphql keyword.operation.graphql - | meta.embedded.block.graphql meta.selectionset.graphql -{ | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql - | meta.embedded.block.graphql meta.selectionset.graphql -id | meta.embedded.block.graphql meta.selectionset.graphql variable.graphql - | meta.embedded.block.graphql meta.selectionset.graphql -} | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql -\` | meta.embedded.block.graphql punctuation.definition.string.template.end.js -) | -; | - | -const query = graphql | -( | - | meta.embedded.block.graphql -\` | meta.embedded.block.graphql punctuation.definition.string.template.begin.js - | meta.embedded.block.graphql -query | meta.embedded.block.graphql keyword.operation.graphql - | meta.embedded.block.graphql meta.selectionset.graphql -{ | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql - | meta.embedded.block.graphql meta.selectionset.graphql -id | meta.embedded.block.graphql meta.selectionset.graphql variable.graphql - | meta.embedded.block.graphql meta.selectionset.graphql -} | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql - | meta.embedded.block.graphql -\` | meta.embedded.block.graphql punctuation.definition.string.template.end.js -, | meta.embedded.block.graphql - [var1, var2] | meta.embedded.block.graphql -) | -; | - | -const queryWithInlineComment = | -\` | taggedTemplates punctuation.definition.string.template.begin.js -#graphql | taggedTemplates comment.line.graphql.js - | taggedTemplates meta.embedded.block.graphql -query | taggedTemplates meta.embedded.block.graphql keyword.operation.graphql - | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql -{ | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql - | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql -user | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql variable.graphql -( | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql meta.brace.round.directive.graphql -id | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql variable.parameter.graphql -: | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql punctuation.colon.graphql - | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql -" | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql string.quoted.double.graphql punctuation.definition.string.begin.graphql -5 | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql string.quoted.double.graphql -" | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql string.quoted.double.graphql punctuation.definition.string.end.graphql -, | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql punctuation.comma.graphql - | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql -name | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql variable.parameter.graphql -: | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql punctuation.colon.graphql - boolean | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql constant.character.enum.graphql -) | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql meta.brace.round.directive.graphql - | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql -{ | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql punctuation.operation.graphql - | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql -something | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql variable.graphql - | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql -} | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql punctuation.operation.graphql - | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql -} | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql -\` | taggedTemplates punctuation.definition.string.template.end.js -; | - | -const queryWithLeadingComment = | - | -/* GraphQL */ | comment.graphql.js - | -\` | punctuation.definition.string.template.begin.js - | meta.embedded.block.graphql -query | meta.embedded.block.graphql keyword.operation.graphql - | meta.embedded.block.graphql meta.selectionset.graphql -{ | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql - | meta.embedded.block.graphql meta.selectionset.graphql -user | meta.embedded.block.graphql meta.selectionset.graphql variable.graphql -( | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql meta.brace.round.directive.graphql -id | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql variable.parameter.graphql -: | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql punctuation.colon.graphql - | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql -" | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql string.quoted.double.graphql punctuation.definition.string.begin.graphql -5 | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql string.quoted.double.graphql -" | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql string.quoted.double.graphql punctuation.definition.string.end.graphql -, | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql punctuation.comma.graphql - | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql -name | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql variable.parameter.graphql -: | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql punctuation.colon.graphql - boolean | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql constant.character.enum.graphql -) | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql meta.brace.round.directive.graphql - | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql -{ | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql punctuation.operation.graphql - | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql -something | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql variable.graphql - | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql -} | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql punctuation.operation.graphql - | meta.embedded.block.graphql meta.selectionset.graphql -} | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql -\` | punctuation.definition.string.template.end.js -; | - | +/* eslint-disable */ | +// @ts-nocheck | + | +gql | entity.name.function.tagged-template.js +\` | punctuation.definition.string.template.begin.js + | meta.embedded.block.graphql +query | meta.embedded.block.graphql keyword.operation.graphql + | meta.embedded.block.graphql meta.selectionset.graphql +{ | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql + | meta.embedded.block.graphql meta.selectionset.graphql +user | meta.embedded.block.graphql meta.selectionset.graphql variable.graphql +( | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql meta.brace.round.directive.graphql +id | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql variable.parameter.graphql +: | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql punctuation.colon.graphql + | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql +" | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql string.quoted.double.graphql punctuation.definition.string.begin.graphql +5 | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql string.quoted.double.graphql +" | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql string.quoted.double.graphql punctuation.definition.string.end.graphql +, | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql punctuation.comma.graphql + | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql +name | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql variable.parameter.graphql +: | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql punctuation.colon.graphql + boolean | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql constant.character.enum.graphql +) | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql meta.brace.round.directive.graphql + | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql +{ | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql punctuation.operation.graphql + | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql +something | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql variable.graphql + | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql +} | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql punctuation.operation.graphql + | meta.embedded.block.graphql meta.selectionset.graphql +} | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql +\` | punctuation.definition.string.template.end.js +; | + | +graphql | entity.name.function.tagged-template.js + | +\` | punctuation.definition.string.template.begin.js + | meta.embedded.block.graphql +query | meta.embedded.block.graphql keyword.operation.graphql + | meta.embedded.block.graphql meta.selectionset.graphql +{ | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql + | meta.embedded.block.graphql meta.selectionset.graphql +user | meta.embedded.block.graphql meta.selectionset.graphql variable.graphql +( | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql meta.brace.round.directive.graphql +id | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql variable.parameter.graphql +: | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql punctuation.colon.graphql + | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql +" | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql string.quoted.double.graphql punctuation.definition.string.begin.graphql +5 | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql string.quoted.double.graphql +" | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql string.quoted.double.graphql punctuation.definition.string.end.graphql +, | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql punctuation.comma.graphql + | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql +name | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql variable.parameter.graphql +: | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql punctuation.colon.graphql + boolean | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql constant.character.enum.graphql +) | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql meta.brace.round.directive.graphql + | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql +{ | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql punctuation.operation.graphql + | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql +something | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql variable.graphql + | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql +} | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql punctuation.operation.graphql + | meta.embedded.block.graphql meta.selectionset.graphql +} | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql +\` | punctuation.definition.string.template.end.js +; | + | +const query = | + | +graphql | entity.name.function.tagged-template.js + | +\` | punctuation.definition.string.template.begin.js + | meta.embedded.block.graphql +query | meta.embedded.block.graphql keyword.operation.graphql + | meta.embedded.block.graphql meta.selectionset.graphql +{ | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql + | meta.embedded.block.graphql meta.selectionset.graphql +user | meta.embedded.block.graphql meta.selectionset.graphql variable.graphql +( | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql meta.brace.round.directive.graphql +id | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql variable.parameter.graphql +: | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql punctuation.colon.graphql + | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql +" | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql string.quoted.double.graphql punctuation.definition.string.begin.graphql +5 | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql string.quoted.double.graphql +" | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql string.quoted.double.graphql punctuation.definition.string.end.graphql +, | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql punctuation.comma.graphql + | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql +name | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql variable.parameter.graphql +: | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql punctuation.colon.graphql + boolean | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql constant.character.enum.graphql +) | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql meta.brace.round.directive.graphql + | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql +{ | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql punctuation.operation.graphql + | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql +something | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql variable.graphql + | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql +} | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql punctuation.operation.graphql + | meta.embedded.block.graphql meta.selectionset.graphql +} | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql +\` | punctuation.definition.string.template.end.js +; | + | +// TODO: Fix this | +const query = graphql('query { id }'); | + | +const queryWithInlineComment = | +\` | taggedTemplates punctuation.definition.string.template.begin.js +#graphql | taggedTemplates comment.line.graphql.js + | taggedTemplates meta.embedded.block.graphql +query | taggedTemplates meta.embedded.block.graphql keyword.operation.graphql + | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql +{ | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql + | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql +user | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql variable.graphql +( | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql meta.brace.round.directive.graphql +id | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql variable.parameter.graphql +: | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql punctuation.colon.graphql + | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql +" | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql string.quoted.double.graphql punctuation.definition.string.begin.graphql +5 | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql string.quoted.double.graphql +" | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql string.quoted.double.graphql punctuation.definition.string.end.graphql +, | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql punctuation.comma.graphql + | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql +name | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql variable.parameter.graphql +: | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql punctuation.colon.graphql + boolean | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql constant.character.enum.graphql +) | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql meta.brace.round.directive.graphql + | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql +{ | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql punctuation.operation.graphql + | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql +something | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql variable.graphql + | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql +} | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql punctuation.operation.graphql + | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql +} | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql +\` | taggedTemplates punctuation.definition.string.template.end.js +; | + | +const queryWithLeadingComment = | + | +/* GraphQL */ | comment.graphql.js + | +\` | punctuation.definition.string.template.begin.js + | meta.embedded.block.graphql +query | meta.embedded.block.graphql keyword.operation.graphql + | meta.embedded.block.graphql meta.selectionset.graphql +{ | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql + | meta.embedded.block.graphql meta.selectionset.graphql +user | meta.embedded.block.graphql meta.selectionset.graphql variable.graphql +( | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql meta.brace.round.directive.graphql +id | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql variable.parameter.graphql +: | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql punctuation.colon.graphql + | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql +" | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql string.quoted.double.graphql punctuation.definition.string.begin.graphql +5 | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql string.quoted.double.graphql +" | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql string.quoted.double.graphql punctuation.definition.string.end.graphql +, | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql punctuation.comma.graphql + | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql +name | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql variable.parameter.graphql +: | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql punctuation.colon.graphql + boolean | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql constant.character.enum.graphql +) | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql meta.brace.round.directive.graphql + | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql +{ | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql punctuation.operation.graphql + | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql +something | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql variable.graphql + | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql +} | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql punctuation.operation.graphql + | meta.embedded.block.graphql meta.selectionset.graphql +} | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql +\` | punctuation.definition.string.template.end.js +; | + | `; exports[`inline.graphql grammar > should tokenize a simple vue sfc comp file 1`] = ` diff --git a/packages/vscode-graphql-syntax/tests/__snapshots__/markdown-grammar.spec.ts.snap b/packages/vscode-graphql-syntax/tests/__snapshots__/markdown-grammar.spec.ts.snap index 02b0aafc8b8..cb1a88a0b80 100644 --- a/packages/vscode-graphql-syntax/tests/__snapshots__/markdown-grammar.spec.ts.snap +++ b/packages/vscode-graphql-syntax/tests/__snapshots__/markdown-grammar.spec.ts.snap @@ -107,50 +107,6 @@ graphql\` | const Component = () => { | return
; | }; | -\`\`\` | - | -\`\`\`js | -const variable = 1; | - | -const queryA = graphql(\` | - query { | - something(arg: \${variable}) | - } | -\`); | - | -const queryB = graphql( | - \` | - query { | - something(arg: \${variable}) | - } | - \` | -); | - | -const queryC = graphql( | - 'query { something(arg: \${variable}) }' | -); | -\`\`\` | - | -\`\`\`ts | -const variable: number = 1; | - | -const queryA = graphql(\` | - query { | - something(arg: \${variable}) | - } | -\`); | - | -const queryB = graphql( | - \` | - query { | - something(arg: \${variable}) | - } | - \` | -); | - | -const queryC = graphql( | - 'query { something(arg: \${variable}) }' | -); | \`\`\` | | ### svelte | From e29ce847e4506838c5d7672ae152a3ae291908ee Mon Sep 17 00:00:00 2001 From: Rikki Schulte Date: Sat, 2 Mar 2024 15:09:40 +0100 Subject: [PATCH 05/81] Version Packages (#3544) Co-authored-by: github-actions[bot] --- .changeset/famous-ads-jam.md | 6 ------ packages/vscode-graphql-syntax/CHANGELOG.md | 6 ++++++ packages/vscode-graphql-syntax/package.json | 2 +- packages/vscode-graphql/CHANGELOG.md | 6 ++++++ packages/vscode-graphql/package.json | 2 +- 5 files changed, 14 insertions(+), 8 deletions(-) delete mode 100644 .changeset/famous-ads-jam.md diff --git a/.changeset/famous-ads-jam.md b/.changeset/famous-ads-jam.md deleted file mode 100644 index c79c7b8e89a..00000000000 --- a/.changeset/famous-ads-jam.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"vscode-graphql-syntax": patch -"vscode-graphql": patch ---- - -Temporarily revert a syntax highlighting bugfix that caused more bugs diff --git a/packages/vscode-graphql-syntax/CHANGELOG.md b/packages/vscode-graphql-syntax/CHANGELOG.md index c90bde05047..63d04f2f00d 100644 --- a/packages/vscode-graphql-syntax/CHANGELOG.md +++ b/packages/vscode-graphql-syntax/CHANGELOG.md @@ -1,5 +1,11 @@ # vscode-graphql-syntax +## 1.3.4 + +### Patch Changes + +- [#3543](https://github.com/graphql/graphiql/pull/3543) [`defc126b`](https://github.com/graphql/graphiql/commit/defc126b107961d7a4ba093b35b1d77bb7018a79) Thanks [@acao](https://github.com/acao)! - Temporarily revert a syntax highlighting bugfix that caused more bugs + ## 1.3.3 ### Patch Changes diff --git a/packages/vscode-graphql-syntax/package.json b/packages/vscode-graphql-syntax/package.json index 3a4ab1141b2..75640888c8d 100644 --- a/packages/vscode-graphql-syntax/package.json +++ b/packages/vscode-graphql-syntax/package.json @@ -1,6 +1,6 @@ { "name": "vscode-graphql-syntax", - "version": "1.3.3", + "version": "1.3.4", "displayName": "GraphQL: Syntax Highlighting", "description": "Adds syntax highlighting support for .graphql & embedded support for javascript, typescript, vue, markdown, python, php, reason, ocaml and rescript", "publisher": "GraphQL", diff --git a/packages/vscode-graphql/CHANGELOG.md b/packages/vscode-graphql/CHANGELOG.md index 2fe42c7f9e0..6ebfebf484e 100644 --- a/packages/vscode-graphql/CHANGELOG.md +++ b/packages/vscode-graphql/CHANGELOG.md @@ -1,5 +1,11 @@ # Change Log +## 0.9.2 + +### Patch Changes + +- [#3543](https://github.com/graphql/graphiql/pull/3543) [`defc126b`](https://github.com/graphql/graphiql/commit/defc126b107961d7a4ba093b35b1d77bb7018a79) Thanks [@acao](https://github.com/acao)! - Temporarily revert a syntax highlighting bugfix that caused more bugs + ## 0.9.1 ### Patch Changes diff --git a/packages/vscode-graphql/package.json b/packages/vscode-graphql/package.json index 382e28b2a35..c1f1f5e2ad6 100644 --- a/packages/vscode-graphql/package.json +++ b/packages/vscode-graphql/package.json @@ -1,6 +1,6 @@ { "name": "vscode-graphql", - "version": "0.9.1", + "version": "0.9.2", "private": true, "license": "MIT", "displayName": "GraphQL: Language Feature Support", From e5efc97e10ba237d8209859a24cda826b9899832 Mon Sep 17 00:00:00 2001 From: Rikki Schulte Date: Tue, 5 Mar 2024 22:58:41 +0100 Subject: [PATCH 06/81] fix OpenVSX dependency bug by tweaking openvsx publish (#3549) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🤞🏻 hope this works! --- .changeset/warm-cups-explain.md | 5 +++++ packages/vscode-graphql/package.json | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/warm-cups-explain.md diff --git a/.changeset/warm-cups-explain.md b/.changeset/warm-cups-explain.md new file mode 100644 index 00000000000..3011b00a37b --- /dev/null +++ b/.changeset/warm-cups-explain.md @@ -0,0 +1,5 @@ +--- +'vscode-graphql': patch +--- + +Fix OpenVSX build by re-using the vsce build (astro compiler bug) diff --git a/packages/vscode-graphql/package.json b/packages/vscode-graphql/package.json index c1f1f5e2ad6..6d8077195f5 100644 --- a/packages/vscode-graphql/package.json +++ b/packages/vscode-graphql/package.json @@ -161,7 +161,7 @@ "vsce:package": "vsce package --yarn", "env:source": "export $(cat .envrc | xargs)", "vsce:publish": "vsce publish --yarn", - "open-vsx:publish": "ovsx publish --yarn -i . --pat $OVSX_PAT", + "open-vsx:publish": "ovsx publish --extensionFile $(ls -1 *.vsix | tail -n 1) --pat $OVSX_PAT", "release": "npm run vsce:publish && npm run open-vsx:publish" }, "devDependencies": { From ece99f63f5d8d01057b735e90a6957edea3e42b9 Mon Sep 17 00:00:00 2001 From: Rikki Schulte Date: Tue, 5 Mar 2024 23:29:32 +0100 Subject: [PATCH 07/81] Version Packages (#3550) Co-authored-by: github-actions[bot] --- .changeset/warm-cups-explain.md | 5 ----- packages/vscode-graphql/CHANGELOG.md | 6 ++++++ packages/vscode-graphql/package.json | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) delete mode 100644 .changeset/warm-cups-explain.md diff --git a/.changeset/warm-cups-explain.md b/.changeset/warm-cups-explain.md deleted file mode 100644 index 3011b00a37b..00000000000 --- a/.changeset/warm-cups-explain.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'vscode-graphql': patch ---- - -Fix OpenVSX build by re-using the vsce build (astro compiler bug) diff --git a/packages/vscode-graphql/CHANGELOG.md b/packages/vscode-graphql/CHANGELOG.md index 6ebfebf484e..e931025739e 100644 --- a/packages/vscode-graphql/CHANGELOG.md +++ b/packages/vscode-graphql/CHANGELOG.md @@ -1,5 +1,11 @@ # Change Log +## 0.9.3 + +### Patch Changes + +- [#3549](https://github.com/graphql/graphiql/pull/3549) [`e5efc97e`](https://github.com/graphql/graphiql/commit/e5efc97e10ba237d8209859a24cda826b9899832) Thanks [@acao](https://github.com/acao)! - Fix OpenVSX build by re-using the vsce build (astro compiler bug) + ## 0.9.2 ### Patch Changes diff --git a/packages/vscode-graphql/package.json b/packages/vscode-graphql/package.json index 6d8077195f5..767b58a127f 100644 --- a/packages/vscode-graphql/package.json +++ b/packages/vscode-graphql/package.json @@ -1,6 +1,6 @@ { "name": "vscode-graphql", - "version": "0.9.2", + "version": "0.9.3", "private": true, "license": "MIT", "displayName": "GraphQL: Language Feature Support", From e9fc21ab5f403a3e26cec555b29e5fb9db436838 Mon Sep 17 00:00:00 2001 From: Phil Pluckthun Date: Sat, 16 Mar 2024 12:40:14 +0000 Subject: [PATCH 08/81] =?UTF-8?q?fix:=20Fix=20vscode-graphql-syntax?= =?UTF-8?q?=E2=80=99s=20grammar=20to=20support=20string=20literals=20on=20?= =?UTF-8?q?separate=20lines=20[Reapply=20&=20Fix]=20(#3545)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: Fix vscode-graphql-syntax’s grammar to support string literals on separate lines (#3518) * Allow newlines after `graphql(` before start of query string * Fix mistaken reverse order of optional `(` and generic `<.*>` * Replace `(` in second match with newline one * Match graphql calls separately for string literals inside calls * Add missing endCaptures to new rule * Remove lookbehind in grammar and add inner TS/JS source patterns Using a positive lookbehind can subtly break Textmate/VSCode’s syntax highlighting. The positive lookbehind (according to some online sources) can fail unexpectedly when they contain whitespace matches. This means that we should instead match explicitly, like the other patterns do. This means however, that we might match too much and I noticed that arguments to the function aren't highlighted correctly. According to the interpolation rule in `graphql.json` we now include patterns for JS/TS/etc as a fallback pattern. This fixes the issue and prevents the case where the rule was conflicting with normal JS/TS patterns in a different tmLanguage grammar. * Update test and add new “after” variable case * Revert changes to tests/__fixtures__/test-js.md --- .changeset/famous-games-begin.md | 5 + .../grammars/graphql.js.json | 48 +- .../tests/__fixtures__/test.js | 17 +- .../tests/__fixtures__/test.ts | 20 +- .../__snapshots__/js-grammar.spec.ts.snap | 497 +++++++++++------- 5 files changed, 389 insertions(+), 198 deletions(-) create mode 100644 .changeset/famous-games-begin.md diff --git a/.changeset/famous-games-begin.md b/.changeset/famous-games-begin.md new file mode 100644 index 00000000000..ae10f9af58d --- /dev/null +++ b/.changeset/famous-games-begin.md @@ -0,0 +1,5 @@ +--- +'vscode-graphql-syntax': patch +--- + +Fix TextMate grammar to support string literals that don’t immediately follow a function call's left-parenthesis (`(`). diff --git a/packages/vscode-graphql-syntax/grammars/graphql.js.json b/packages/vscode-graphql-syntax/grammars/graphql.js.json index 9c65649db9d..245be94eb77 100644 --- a/packages/vscode-graphql-syntax/grammars/graphql.js.json +++ b/packages/vscode-graphql-syntax/grammars/graphql.js.json @@ -3,8 +3,8 @@ "injectionSelector": "L:(meta.embedded.block.javascript | meta.embedded.block.typescript | source.js | source.ts | source.tsx | source.vue | source.svelte | source.astro) -source.graphql -inline.graphql -string -comment", "patterns": [ { - "contentName": "meta.embedded.block.graphql", - "begin": "\\s*+(?:(?:(Relay)\\??\\.)(QL)|(gql|graphql|graphql\\.experimental)|(/\\* GraphQL \\*/))\\s*\\(?\\s*(`|')", + "begin": "\\s*+(?:(Relay)\\??\\.)(QL)|(gql|graphql|graphql\\.experimental)\\s*(?:<.*>)?\\s*\\(", + "end": "\\)", "beginCaptures": { "1": { "name": "variable.other.class.js" @@ -14,29 +14,42 @@ }, "3": { "name": "entity.name.function.tagged-template.js" - }, - "4": { - "name": "comment.graphql.js" - }, - "5": { - "name": "punctuation.definition.string.template.begin.js" - } - }, - "end": "(`|')", - "endCaptures": { - "0": { - "name": "punctuation.definition.string.template.end.js" } }, "patterns": [ { - "include": "source.graphql" + "contentName": "meta.embedded.block.graphql", + "begin": "(`|')", + "end": "(`|')", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.template.begin.js" + } + }, + "endCaptures": { + "0": { + "name": "punctuation.definition.string.template.end.js" + } + }, + "patterns": [ + { + "include": "source.graphql" + } + ] + }, + { + "patterns": [ + { "include": "source.js" }, + { "include": "source.ts" }, + { "include": "source.js.jsx" }, + { "include": "source.tsx" } + ] } ] }, { "contentName": "meta.embedded.block.graphql", - "begin": "\\s*+(?:(?:(Relay)\\??\\.)(QL)|(gql|graphql|graphql\\.experimental))\\s*\\(?\\s*(?:<.*>)(`|')", + "begin": "\\s*+(?:(?:(?:(Relay)\\??\\.)(QL)|(gql|graphql|graphql\\.experimental)\\s*(?:<.*>)?\\s*)|(/\\* GraphQL \\*/))\\s*(`|')", "beginCaptures": { "1": { "name": "variable.other.class.js" @@ -48,6 +61,9 @@ "name": "entity.name.function.tagged-template.js" }, "4": { + "name": "comment.graphql.js" + }, + "5": { "name": "punctuation.definition.string.template.begin.js" } }, diff --git a/packages/vscode-graphql-syntax/tests/__fixtures__/test.js b/packages/vscode-graphql-syntax/tests/__fixtures__/test.js index 1112c7adbfa..dbf470ebe42 100644 --- a/packages/vscode-graphql-syntax/tests/__fixtures__/test.js +++ b/packages/vscode-graphql-syntax/tests/__fixtures__/test.js @@ -37,8 +37,22 @@ const graphql = graphql(` } `); +const after1 = 'after'; + +const graphql = graphql( + ` + query($id: ID!) { test } + `, + [var1, var2] +); + +const after2 = 'after'; + const query = /* GraphQL */ 'query { id } '; -const query = graphql('query { id } '); +const query = graphql('query($id: ID!) { id } '); +const query = graphql( + 'query($id: ID!) { test }' +); const queryWithInlineComment = `#graphql query { @@ -59,7 +73,6 @@ const queryWithInlineComment = `#graphql } } `; -// TODO: fix this const queryWithInlineComment = ` #graphql query { diff --git a/packages/vscode-graphql-syntax/tests/__fixtures__/test.ts b/packages/vscode-graphql-syntax/tests/__fixtures__/test.ts index b8e507901b6..5ae8cefaad3 100644 --- a/packages/vscode-graphql-syntax/tests/__fixtures__/test.ts +++ b/packages/vscode-graphql-syntax/tests/__fixtures__/test.ts @@ -25,9 +25,27 @@ const query = graphql` } `; -// TODO: Fix this const query = graphql('query { id }'); +const query = graphql( + 'query { id }' +); + +const query = graphql( + 'query { id }' +); + +const query = graphql(` + query { id } +`); + +const query = graphql( + ` + query { id } + `, + [var1, var2] +); + const queryWithInlineComment = `#graphql query { user(id: "5", name: boolean) { diff --git a/packages/vscode-graphql-syntax/tests/__snapshots__/js-grammar.spec.ts.snap b/packages/vscode-graphql-syntax/tests/__snapshots__/js-grammar.spec.ts.snap index 1be3ebd280f..12a88876f2a 100644 --- a/packages/vscode-graphql-syntax/tests/__snapshots__/js-grammar.spec.ts.snap +++ b/packages/vscode-graphql-syntax/tests/__snapshots__/js-grammar.spec.ts.snap @@ -109,7 +109,6 @@ something | meta.embedded.block.graphql meta.select ; | | const graphql = | - | graphql | entity.name.function.tagged-template.js ( | \` | punctuation.definition.string.template.begin.js @@ -148,7 +147,39 @@ something | meta.embedded.block.graphql meta.select | meta.embedded.block.graphql meta.selectionset.graphql } | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql \` | punctuation.definition.string.template.end.js -); | +) | +; | + | +const after1 = 'after'; | + | +const graphql = | +graphql | entity.name.function.tagged-template.js +( | + | +\` | punctuation.definition.string.template.begin.js + | meta.embedded.block.graphql +query | meta.embedded.block.graphql keyword.operation.graphql +( | meta.embedded.block.graphql meta.brace.round.graphql +$id | meta.embedded.block.graphql meta.variables.graphql variable.parameter.graphql +: | meta.embedded.block.graphql meta.variables.graphql punctuation.colon.graphql + | meta.embedded.block.graphql meta.variables.graphql +ID | meta.embedded.block.graphql meta.variables.graphql support.type.builtin.graphql +! | meta.embedded.block.graphql meta.variables.graphql keyword.operator.nulltype.graphql +) | meta.embedded.block.graphql meta.brace.round.graphql + | meta.embedded.block.graphql meta.selectionset.graphql +{ | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql + | meta.embedded.block.graphql meta.selectionset.graphql +test | meta.embedded.block.graphql meta.selectionset.graphql variable.graphql + | meta.embedded.block.graphql meta.selectionset.graphql +} | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql + | meta.embedded.block.graphql +\` | punctuation.definition.string.template.end.js +, | + [var1, var2] | +) | +; | + | +const after2 = 'after'; | | const query = | | @@ -166,11 +197,17 @@ id | meta.embedded.block.graphql meta.select ' | punctuation.definition.string.template.end.js ; | const query = | - | graphql | entity.name.function.tagged-template.js ( | ' | punctuation.definition.string.template.begin.js query | meta.embedded.block.graphql keyword.operation.graphql +( | meta.embedded.block.graphql meta.brace.round.graphql +$id | meta.embedded.block.graphql meta.variables.graphql variable.parameter.graphql +: | meta.embedded.block.graphql meta.variables.graphql punctuation.colon.graphql + | meta.embedded.block.graphql meta.variables.graphql +ID | meta.embedded.block.graphql meta.variables.graphql support.type.builtin.graphql +! | meta.embedded.block.graphql meta.variables.graphql keyword.operator.nulltype.graphql +) | meta.embedded.block.graphql meta.brace.round.graphql | meta.embedded.block.graphql meta.selectionset.graphql { | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql | meta.embedded.block.graphql meta.selectionset.graphql @@ -179,7 +216,30 @@ id | meta.embedded.block.graphql meta.select } | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql | meta.embedded.block.graphql ' | punctuation.definition.string.template.end.js -); | +) | +; | +const query = | +graphql | entity.name.function.tagged-template.js +( | + | +' | punctuation.definition.string.template.begin.js +query | meta.embedded.block.graphql keyword.operation.graphql +( | meta.embedded.block.graphql meta.brace.round.graphql +$id | meta.embedded.block.graphql meta.variables.graphql variable.parameter.graphql +: | meta.embedded.block.graphql meta.variables.graphql punctuation.colon.graphql + | meta.embedded.block.graphql meta.variables.graphql +ID | meta.embedded.block.graphql meta.variables.graphql support.type.builtin.graphql +! | meta.embedded.block.graphql meta.variables.graphql keyword.operator.nulltype.graphql +) | meta.embedded.block.graphql meta.brace.round.graphql + | meta.embedded.block.graphql meta.selectionset.graphql +{ | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql + | meta.embedded.block.graphql meta.selectionset.graphql +test | meta.embedded.block.graphql meta.selectionset.graphql variable.graphql + | meta.embedded.block.graphql meta.selectionset.graphql +} | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql +' | punctuation.definition.string.template.end.js +) | +; | | const queryWithInlineComment = | \` | taggedTemplates punctuation.definition.string.template.begin.js @@ -276,7 +336,6 @@ something | taggedTemplates meta.embedded.block.gra } | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql \` | taggedTemplates punctuation.definition.string.template.end.js ; | -// TODO: fix this | const queryWithInlineComment = \` | #graphql | query { | @@ -364,180 +423,260 @@ hello | meta.embedded.block.graphql meta.selectionset.graphql v `; exports[`inline.graphql grammar > should tokenize a simple typescript file 1`] = ` -/* eslint-disable */ | -// @ts-nocheck | - | -gql | entity.name.function.tagged-template.js -\` | punctuation.definition.string.template.begin.js - | meta.embedded.block.graphql -query | meta.embedded.block.graphql keyword.operation.graphql - | meta.embedded.block.graphql meta.selectionset.graphql -{ | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql - | meta.embedded.block.graphql meta.selectionset.graphql -user | meta.embedded.block.graphql meta.selectionset.graphql variable.graphql -( | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql meta.brace.round.directive.graphql -id | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql variable.parameter.graphql -: | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql punctuation.colon.graphql - | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql -" | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql string.quoted.double.graphql punctuation.definition.string.begin.graphql -5 | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql string.quoted.double.graphql -" | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql string.quoted.double.graphql punctuation.definition.string.end.graphql -, | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql punctuation.comma.graphql - | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql -name | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql variable.parameter.graphql -: | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql punctuation.colon.graphql - boolean | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql constant.character.enum.graphql -) | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql meta.brace.round.directive.graphql - | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql -{ | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql punctuation.operation.graphql - | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql -something | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql variable.graphql - | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql -} | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql punctuation.operation.graphql - | meta.embedded.block.graphql meta.selectionset.graphql -} | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql -\` | punctuation.definition.string.template.end.js -; | - | -graphql | entity.name.function.tagged-template.js - | -\` | punctuation.definition.string.template.begin.js - | meta.embedded.block.graphql -query | meta.embedded.block.graphql keyword.operation.graphql - | meta.embedded.block.graphql meta.selectionset.graphql -{ | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql - | meta.embedded.block.graphql meta.selectionset.graphql -user | meta.embedded.block.graphql meta.selectionset.graphql variable.graphql -( | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql meta.brace.round.directive.graphql -id | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql variable.parameter.graphql -: | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql punctuation.colon.graphql - | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql -" | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql string.quoted.double.graphql punctuation.definition.string.begin.graphql -5 | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql string.quoted.double.graphql -" | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql string.quoted.double.graphql punctuation.definition.string.end.graphql -, | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql punctuation.comma.graphql - | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql -name | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql variable.parameter.graphql -: | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql punctuation.colon.graphql - boolean | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql constant.character.enum.graphql -) | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql meta.brace.round.directive.graphql - | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql -{ | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql punctuation.operation.graphql - | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql -something | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql variable.graphql - | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql -} | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql punctuation.operation.graphql - | meta.embedded.block.graphql meta.selectionset.graphql -} | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql -\` | punctuation.definition.string.template.end.js -; | - | -const query = | - | -graphql | entity.name.function.tagged-template.js - | -\` | punctuation.definition.string.template.begin.js - | meta.embedded.block.graphql -query | meta.embedded.block.graphql keyword.operation.graphql - | meta.embedded.block.graphql meta.selectionset.graphql -{ | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql - | meta.embedded.block.graphql meta.selectionset.graphql -user | meta.embedded.block.graphql meta.selectionset.graphql variable.graphql -( | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql meta.brace.round.directive.graphql -id | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql variable.parameter.graphql -: | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql punctuation.colon.graphql - | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql -" | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql string.quoted.double.graphql punctuation.definition.string.begin.graphql -5 | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql string.quoted.double.graphql -" | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql string.quoted.double.graphql punctuation.definition.string.end.graphql -, | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql punctuation.comma.graphql - | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql -name | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql variable.parameter.graphql -: | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql punctuation.colon.graphql - boolean | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql constant.character.enum.graphql -) | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql meta.brace.round.directive.graphql - | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql -{ | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql punctuation.operation.graphql - | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql -something | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql variable.graphql - | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql -} | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql punctuation.operation.graphql - | meta.embedded.block.graphql meta.selectionset.graphql -} | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql -\` | punctuation.definition.string.template.end.js -; | - | -// TODO: Fix this | -const query = graphql('query { id }'); | - | -const queryWithInlineComment = | -\` | taggedTemplates punctuation.definition.string.template.begin.js -#graphql | taggedTemplates comment.line.graphql.js - | taggedTemplates meta.embedded.block.graphql -query | taggedTemplates meta.embedded.block.graphql keyword.operation.graphql - | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql -{ | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql - | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql -user | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql variable.graphql -( | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql meta.brace.round.directive.graphql -id | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql variable.parameter.graphql -: | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql punctuation.colon.graphql - | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql -" | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql string.quoted.double.graphql punctuation.definition.string.begin.graphql -5 | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql string.quoted.double.graphql -" | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql string.quoted.double.graphql punctuation.definition.string.end.graphql -, | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql punctuation.comma.graphql - | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql -name | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql variable.parameter.graphql -: | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql punctuation.colon.graphql - boolean | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql constant.character.enum.graphql -) | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql meta.brace.round.directive.graphql - | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql -{ | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql punctuation.operation.graphql - | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql -something | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql variable.graphql - | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql -} | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql punctuation.operation.graphql - | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql -} | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql -\` | taggedTemplates punctuation.definition.string.template.end.js -; | - | -const queryWithLeadingComment = | - | -/* GraphQL */ | comment.graphql.js - | -\` | punctuation.definition.string.template.begin.js - | meta.embedded.block.graphql -query | meta.embedded.block.graphql keyword.operation.graphql - | meta.embedded.block.graphql meta.selectionset.graphql -{ | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql - | meta.embedded.block.graphql meta.selectionset.graphql -user | meta.embedded.block.graphql meta.selectionset.graphql variable.graphql -( | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql meta.brace.round.directive.graphql -id | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql variable.parameter.graphql -: | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql punctuation.colon.graphql - | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql -" | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql string.quoted.double.graphql punctuation.definition.string.begin.graphql -5 | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql string.quoted.double.graphql -" | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql string.quoted.double.graphql punctuation.definition.string.end.graphql -, | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql punctuation.comma.graphql - | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql -name | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql variable.parameter.graphql -: | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql punctuation.colon.graphql - boolean | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql constant.character.enum.graphql -) | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql meta.brace.round.directive.graphql - | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql -{ | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql punctuation.operation.graphql - | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql -something | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql variable.graphql - | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql -} | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql punctuation.operation.graphql - | meta.embedded.block.graphql meta.selectionset.graphql -} | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql -\` | punctuation.definition.string.template.end.js -; | - | +/* eslint-disable */ | +// @ts-nocheck | + | +gql | entity.name.function.tagged-template.js +\` | punctuation.definition.string.template.begin.js + | meta.embedded.block.graphql +query | meta.embedded.block.graphql keyword.operation.graphql + | meta.embedded.block.graphql meta.selectionset.graphql +{ | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql + | meta.embedded.block.graphql meta.selectionset.graphql +user | meta.embedded.block.graphql meta.selectionset.graphql variable.graphql +( | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql meta.brace.round.directive.graphql +id | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql variable.parameter.graphql +: | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql punctuation.colon.graphql + | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql +" | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql string.quoted.double.graphql punctuation.definition.string.begin.graphql +5 | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql string.quoted.double.graphql +" | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql string.quoted.double.graphql punctuation.definition.string.end.graphql +, | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql punctuation.comma.graphql + | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql +name | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql variable.parameter.graphql +: | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql punctuation.colon.graphql + boolean | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql constant.character.enum.graphql +) | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql meta.brace.round.directive.graphql + | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql +{ | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql punctuation.operation.graphql + | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql +something | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql variable.graphql + | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql +} | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql punctuation.operation.graphql + | meta.embedded.block.graphql meta.selectionset.graphql +} | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql +\` | punctuation.definition.string.template.end.js +; | + | +graphql | entity.name.function.tagged-template.js + | +\` | punctuation.definition.string.template.begin.js + | meta.embedded.block.graphql +query | meta.embedded.block.graphql keyword.operation.graphql + | meta.embedded.block.graphql meta.selectionset.graphql +{ | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql + | meta.embedded.block.graphql meta.selectionset.graphql +user | meta.embedded.block.graphql meta.selectionset.graphql variable.graphql +( | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql meta.brace.round.directive.graphql +id | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql variable.parameter.graphql +: | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql punctuation.colon.graphql + | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql +" | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql string.quoted.double.graphql punctuation.definition.string.begin.graphql +5 | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql string.quoted.double.graphql +" | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql string.quoted.double.graphql punctuation.definition.string.end.graphql +, | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql punctuation.comma.graphql + | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql +name | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql variable.parameter.graphql +: | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql punctuation.colon.graphql + boolean | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql constant.character.enum.graphql +) | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql meta.brace.round.directive.graphql + | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql +{ | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql punctuation.operation.graphql + | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql +something | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql variable.graphql + | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql +} | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql punctuation.operation.graphql + | meta.embedded.block.graphql meta.selectionset.graphql +} | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql +\` | punctuation.definition.string.template.end.js +; | + | +const query = | + | +graphql | entity.name.function.tagged-template.js + | +\` | punctuation.definition.string.template.begin.js + | meta.embedded.block.graphql +query | meta.embedded.block.graphql keyword.operation.graphql + | meta.embedded.block.graphql meta.selectionset.graphql +{ | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql + | meta.embedded.block.graphql meta.selectionset.graphql +user | meta.embedded.block.graphql meta.selectionset.graphql variable.graphql +( | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql meta.brace.round.directive.graphql +id | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql variable.parameter.graphql +: | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql punctuation.colon.graphql + | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql +" | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql string.quoted.double.graphql punctuation.definition.string.begin.graphql +5 | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql string.quoted.double.graphql +" | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql string.quoted.double.graphql punctuation.definition.string.end.graphql +, | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql punctuation.comma.graphql + | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql +name | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql variable.parameter.graphql +: | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql punctuation.colon.graphql + boolean | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql constant.character.enum.graphql +) | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql meta.brace.round.directive.graphql + | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql +{ | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql punctuation.operation.graphql + | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql +something | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql variable.graphql + | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql +} | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql punctuation.operation.graphql + | meta.embedded.block.graphql meta.selectionset.graphql +} | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql +\` | punctuation.definition.string.template.end.js +; | + | +const query = | +graphql | entity.name.function.tagged-template.js +( | +' | punctuation.definition.string.template.begin.js +query | meta.embedded.block.graphql keyword.operation.graphql + | meta.embedded.block.graphql meta.selectionset.graphql +{ | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql + | meta.embedded.block.graphql meta.selectionset.graphql +id | meta.embedded.block.graphql meta.selectionset.graphql variable.graphql + | meta.embedded.block.graphql meta.selectionset.graphql +} | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql +' | punctuation.definition.string.template.end.js +) | +; | + | +const query = | +graphql | entity.name.function.tagged-template.js +( | + | +' | punctuation.definition.string.template.begin.js +query | meta.embedded.block.graphql keyword.operation.graphql + | meta.embedded.block.graphql meta.selectionset.graphql +{ | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql + | meta.embedded.block.graphql meta.selectionset.graphql +id | meta.embedded.block.graphql meta.selectionset.graphql variable.graphql + | meta.embedded.block.graphql meta.selectionset.graphql +} | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql +' | punctuation.definition.string.template.end.js +) | +; | + | +const query = | +graphql | entity.name.function.tagged-template.js +( | + | +' | punctuation.definition.string.template.begin.js +query | meta.embedded.block.graphql keyword.operation.graphql + | meta.embedded.block.graphql meta.selectionset.graphql +{ | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql + | meta.embedded.block.graphql meta.selectionset.graphql +id | meta.embedded.block.graphql meta.selectionset.graphql variable.graphql + | meta.embedded.block.graphql meta.selectionset.graphql +} | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql +' | punctuation.definition.string.template.end.js +) | +; | + | +const query = | +graphql | entity.name.function.tagged-template.js +( | +\` | punctuation.definition.string.template.begin.js + | meta.embedded.block.graphql +query | meta.embedded.block.graphql keyword.operation.graphql + | meta.embedded.block.graphql meta.selectionset.graphql +{ | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql + | meta.embedded.block.graphql meta.selectionset.graphql +id | meta.embedded.block.graphql meta.selectionset.graphql variable.graphql + | meta.embedded.block.graphql meta.selectionset.graphql +} | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql +\` | punctuation.definition.string.template.end.js +) | +; | + | +const query = | +graphql | entity.name.function.tagged-template.js +( | + | +\` | punctuation.definition.string.template.begin.js + | meta.embedded.block.graphql +query | meta.embedded.block.graphql keyword.operation.graphql + | meta.embedded.block.graphql meta.selectionset.graphql +{ | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql + | meta.embedded.block.graphql meta.selectionset.graphql +id | meta.embedded.block.graphql meta.selectionset.graphql variable.graphql + | meta.embedded.block.graphql meta.selectionset.graphql +} | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql + | meta.embedded.block.graphql +\` | punctuation.definition.string.template.end.js +, | + [var1, var2] | +) | +; | + | +const queryWithInlineComment = | +\` | taggedTemplates punctuation.definition.string.template.begin.js +#graphql | taggedTemplates comment.line.graphql.js + | taggedTemplates meta.embedded.block.graphql +query | taggedTemplates meta.embedded.block.graphql keyword.operation.graphql + | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql +{ | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql + | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql +user | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql variable.graphql +( | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql meta.brace.round.directive.graphql +id | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql variable.parameter.graphql +: | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql punctuation.colon.graphql + | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql +" | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql string.quoted.double.graphql punctuation.definition.string.begin.graphql +5 | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql string.quoted.double.graphql +" | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql string.quoted.double.graphql punctuation.definition.string.end.graphql +, | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql punctuation.comma.graphql + | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql +name | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql variable.parameter.graphql +: | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql punctuation.colon.graphql + boolean | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql constant.character.enum.graphql +) | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql meta.brace.round.directive.graphql + | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql +{ | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql punctuation.operation.graphql + | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql +something | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql variable.graphql + | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql +} | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql punctuation.operation.graphql + | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql +} | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql +\` | taggedTemplates punctuation.definition.string.template.end.js +; | + | +const queryWithLeadingComment = | + | +/* GraphQL */ | comment.graphql.js + | +\` | punctuation.definition.string.template.begin.js + | meta.embedded.block.graphql +query | meta.embedded.block.graphql keyword.operation.graphql + | meta.embedded.block.graphql meta.selectionset.graphql +{ | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql + | meta.embedded.block.graphql meta.selectionset.graphql +user | meta.embedded.block.graphql meta.selectionset.graphql variable.graphql +( | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql meta.brace.round.directive.graphql +id | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql variable.parameter.graphql +: | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql punctuation.colon.graphql + | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql +" | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql string.quoted.double.graphql punctuation.definition.string.begin.graphql +5 | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql string.quoted.double.graphql +" | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql string.quoted.double.graphql punctuation.definition.string.end.graphql +, | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql punctuation.comma.graphql + | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql +name | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql variable.parameter.graphql +: | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql punctuation.colon.graphql + boolean | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql constant.character.enum.graphql +) | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql meta.brace.round.directive.graphql + | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql +{ | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql punctuation.operation.graphql + | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql +something | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql variable.graphql + | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql +} | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql punctuation.operation.graphql + | meta.embedded.block.graphql meta.selectionset.graphql +} | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql +\` | punctuation.definition.string.template.end.js +; | + | `; exports[`inline.graphql grammar > should tokenize a simple vue sfc comp file 1`] = ` From 7e86dc461044c0584cf9b21c509c8ed2a1134985 Mon Sep 17 00:00:00 2001 From: Rikki Schulte Date: Sat, 16 Mar 2024 13:47:31 +0100 Subject: [PATCH 09/81] Version Packages (#3561) Co-authored-by: github-actions[bot] --- .changeset/famous-games-begin.md | 5 ----- packages/vscode-graphql-syntax/CHANGELOG.md | 6 ++++++ packages/vscode-graphql-syntax/package.json | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) delete mode 100644 .changeset/famous-games-begin.md diff --git a/.changeset/famous-games-begin.md b/.changeset/famous-games-begin.md deleted file mode 100644 index ae10f9af58d..00000000000 --- a/.changeset/famous-games-begin.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'vscode-graphql-syntax': patch ---- - -Fix TextMate grammar to support string literals that don’t immediately follow a function call's left-parenthesis (`(`). diff --git a/packages/vscode-graphql-syntax/CHANGELOG.md b/packages/vscode-graphql-syntax/CHANGELOG.md index 63d04f2f00d..d29c6848fcd 100644 --- a/packages/vscode-graphql-syntax/CHANGELOG.md +++ b/packages/vscode-graphql-syntax/CHANGELOG.md @@ -1,5 +1,11 @@ # vscode-graphql-syntax +## 1.3.5 + +### Patch Changes + +- [#3545](https://github.com/graphql/graphiql/pull/3545) [`e9fc21ab`](https://github.com/graphql/graphiql/commit/e9fc21ab5f403a3e26cec555b29e5fb9db436838) Thanks [@kitten](https://github.com/kitten)! - Fix TextMate grammar to support string literals that don’t immediately follow a function call's left-parenthesis (`(`). + ## 1.3.4 ### Patch Changes diff --git a/packages/vscode-graphql-syntax/package.json b/packages/vscode-graphql-syntax/package.json index 75640888c8d..80d8a75a431 100644 --- a/packages/vscode-graphql-syntax/package.json +++ b/packages/vscode-graphql-syntax/package.json @@ -1,6 +1,6 @@ { "name": "vscode-graphql-syntax", - "version": "1.3.4", + "version": "1.3.5", "displayName": "GraphQL: Syntax Highlighting", "description": "Adds syntax highlighting support for .graphql & embedded support for javascript, typescript, vue, markdown, python, php, reason, ocaml and rescript", "publisher": "GraphQL", From fc7de5a75f4b23dd62dd630b705895b5fa5d0a03 Mon Sep 17 00:00:00 2001 From: Lavender Shannon Date: Tue, 26 Mar 2024 06:03:10 -0500 Subject: [PATCH 10/81] fix: Stop a tag with href of 'javascript:void 0' from navigating (#3567) * fix: prevent default behavior of clicking a tag href. Closes graphql/graphiql#3565 * added changeset --- .changeset/sharp-rules-hide.md | 5 +++++ packages/codemirror-graphql/src/info.ts | 3 +++ 2 files changed, 8 insertions(+) create mode 100644 .changeset/sharp-rules-hide.md diff --git a/.changeset/sharp-rules-hide.md b/.changeset/sharp-rules-hide.md new file mode 100644 index 00000000000..c4b5a4ef1f6 --- /dev/null +++ b/.changeset/sharp-rules-hide.md @@ -0,0 +1,5 @@ +--- +'codemirror-graphql': patch +--- + +tooltip a tag's click listener calls event.preventDefault() to stop navigating away from page diff --git a/packages/codemirror-graphql/src/info.ts b/packages/codemirror-graphql/src/info.ts index dedea07e170..4b57bf1fecd 100644 --- a/packages/codemirror-graphql/src/info.ts +++ b/packages/codemirror-graphql/src/info.ts @@ -299,6 +299,9 @@ function text( // want clicking the node to navigate anywhere. node.href = 'javascript:void 0'; // eslint-disable-line no-script-url node.addEventListener('click', (e: MouseEvent) => { + // Although an href of 'javascript:void 0' should never navigate away from the page, + // that is not always the case: https://github.com/graphql/graphiql/issues/3565 + e.preventDefault(); onClick(ref, e); }); } else { From 8584726d96820448abd428a13f3464c19fcdaac2 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 26 Mar 2024 11:06:18 +0000 Subject: [PATCH 11/81] Version Packages --- .changeset/sharp-rules-hide.md | 5 ----- examples/graphiql-webpack/package.json | 8 ++++---- packages/codemirror-graphql/CHANGELOG.md | 6 ++++++ packages/codemirror-graphql/package.json | 2 +- packages/graphiql-plugin-code-exporter/CHANGELOG.md | 7 +++++++ packages/graphiql-plugin-code-exporter/package.json | 6 +++--- packages/graphiql-plugin-explorer/CHANGELOG.md | 7 +++++++ packages/graphiql-plugin-explorer/package.json | 6 +++--- packages/graphiql-react/CHANGELOG.md | 7 +++++++ packages/graphiql-react/package.json | 4 ++-- packages/graphiql/CHANGELOG.md | 7 +++++++ packages/graphiql/package.json | 4 ++-- 12 files changed, 49 insertions(+), 20 deletions(-) delete mode 100644 .changeset/sharp-rules-hide.md diff --git a/.changeset/sharp-rules-hide.md b/.changeset/sharp-rules-hide.md deleted file mode 100644 index c4b5a4ef1f6..00000000000 --- a/.changeset/sharp-rules-hide.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'codemirror-graphql': patch ---- - -tooltip a tag's click listener calls event.preventDefault() to stop navigating away from page diff --git a/examples/graphiql-webpack/package.json b/examples/graphiql-webpack/package.json index 8c3bc3c25bf..3b0929810cf 100644 --- a/examples/graphiql-webpack/package.json +++ b/examples/graphiql-webpack/package.json @@ -9,11 +9,11 @@ "start": "NODE_ENV=development webpack-cli serve" }, "dependencies": { - "@graphiql/plugin-code-exporter": "^1.0.4", - "@graphiql/plugin-explorer": "^1.0.3", + "@graphiql/plugin-code-exporter": "^1.0.5", + "@graphiql/plugin-explorer": "^1.0.4", "@graphiql/toolkit": "^0.9.1", - "@graphiql/react": "^0.20.3", - "graphiql": "^3.1.1", + "@graphiql/react": "^0.20.4", + "graphiql": "^3.1.2", "graphql": "^16.8.1", "graphql-ws": "^5.5.5", "react": "^18.2.0", diff --git a/packages/codemirror-graphql/CHANGELOG.md b/packages/codemirror-graphql/CHANGELOG.md index a68bc3fbada..764d8d84630 100644 --- a/packages/codemirror-graphql/CHANGELOG.md +++ b/packages/codemirror-graphql/CHANGELOG.md @@ -1,5 +1,11 @@ # Change Log +## 2.0.11 + +### Patch Changes + +- [#3567](https://github.com/graphql/graphiql/pull/3567) [`fc7de5a7`](https://github.com/graphql/graphiql/commit/fc7de5a75f4b23dd62dd630b705895b5fa5d0a03) Thanks [@retrodaredevil](https://github.com/retrodaredevil)! - tooltip a tag's click listener calls event.preventDefault() to stop navigating away from page + ## 2.0.10 ### Patch Changes diff --git a/packages/codemirror-graphql/package.json b/packages/codemirror-graphql/package.json index aced6b051e6..378130d9bc5 100644 --- a/packages/codemirror-graphql/package.json +++ b/packages/codemirror-graphql/package.json @@ -1,6 +1,6 @@ { "name": "codemirror-graphql", - "version": "2.0.10", + "version": "2.0.11", "description": "GraphQL mode and helpers for CodeMirror.", "contributors": [ "Hyohyeon Jeong ", diff --git a/packages/graphiql-plugin-code-exporter/CHANGELOG.md b/packages/graphiql-plugin-code-exporter/CHANGELOG.md index c16e5829eee..0689164342e 100644 --- a/packages/graphiql-plugin-code-exporter/CHANGELOG.md +++ b/packages/graphiql-plugin-code-exporter/CHANGELOG.md @@ -1,5 +1,12 @@ # @graphiql/plugin-code-exporter +## 1.0.5 + +### Patch Changes + +- Updated dependencies []: + - @graphiql/react@0.20.4 + ## 1.0.4 ### Patch Changes diff --git a/packages/graphiql-plugin-code-exporter/package.json b/packages/graphiql-plugin-code-exporter/package.json index 931c3db90aa..93ebb92d70f 100644 --- a/packages/graphiql-plugin-code-exporter/package.json +++ b/packages/graphiql-plugin-code-exporter/package.json @@ -1,6 +1,6 @@ { "name": "@graphiql/plugin-code-exporter", - "version": "1.0.4", + "version": "1.0.5", "repository": { "type": "git", "url": "https://github.com/graphql/graphiql", @@ -33,13 +33,13 @@ "graphiql-code-exporter": "^3.0.3" }, "peerDependencies": { - "@graphiql/react": "^0.20.3", + "@graphiql/react": "^0.20.4", "graphql": "^15.5.0 || ^16.0.0", "react": "^16.8.0 || ^17 || ^18", "react-dom": "^16.8.0 || ^17 || ^18" }, "devDependencies": { - "@graphiql/react": "^0.20.3", + "@graphiql/react": "^0.20.4", "@vitejs/plugin-react": "^4.0.1", "graphql": "^16.8.1", "postcss-nesting": "^10.1.7", diff --git a/packages/graphiql-plugin-explorer/CHANGELOG.md b/packages/graphiql-plugin-explorer/CHANGELOG.md index 3060ce25c69..a3b8e5c8100 100644 --- a/packages/graphiql-plugin-explorer/CHANGELOG.md +++ b/packages/graphiql-plugin-explorer/CHANGELOG.md @@ -1,5 +1,12 @@ # @graphiql/plugin-explorer +## 1.0.4 + +### Patch Changes + +- Updated dependencies []: + - @graphiql/react@0.20.4 + ## 1.0.3 ### Patch Changes diff --git a/packages/graphiql-plugin-explorer/package.json b/packages/graphiql-plugin-explorer/package.json index c2d86c8eccd..1289a5aa103 100644 --- a/packages/graphiql-plugin-explorer/package.json +++ b/packages/graphiql-plugin-explorer/package.json @@ -1,6 +1,6 @@ { "name": "@graphiql/plugin-explorer", - "version": "1.0.3", + "version": "1.0.4", "repository": { "type": "git", "url": "https://github.com/graphql/graphiql", @@ -32,13 +32,13 @@ "graphiql-explorer": "^0.9.0" }, "peerDependencies": { - "@graphiql/react": "^0.20.3", + "@graphiql/react": "^0.20.4", "graphql": "^15.5.0 || ^16.0.0", "react": "^16.8.0 || ^17 || ^18", "react-dom": "^16.8.0 || ^17 || ^18" }, "devDependencies": { - "@graphiql/react": "^0.20.3", + "@graphiql/react": "^0.20.4", "@vitejs/plugin-react": "^4.0.1", "graphql": "^16.8.1", "react": "^18.2.0", diff --git a/packages/graphiql-react/CHANGELOG.md b/packages/graphiql-react/CHANGELOG.md index bb8e2d91838..2d7ac8fecbc 100644 --- a/packages/graphiql-react/CHANGELOG.md +++ b/packages/graphiql-react/CHANGELOG.md @@ -1,5 +1,12 @@ # @graphiql/react +## 0.20.4 + +### Patch Changes + +- Updated dependencies [[`fc7de5a7`](https://github.com/graphql/graphiql/commit/fc7de5a75f4b23dd62dd630b705895b5fa5d0a03)]: + - codemirror-graphql@2.0.11 + ## 0.20.3 ### Patch Changes diff --git a/packages/graphiql-react/package.json b/packages/graphiql-react/package.json index 7d48807a3a9..171da58e185 100644 --- a/packages/graphiql-react/package.json +++ b/packages/graphiql-react/package.json @@ -1,6 +1,6 @@ { "name": "@graphiql/react", - "version": "0.20.3", + "version": "0.20.4", "repository": { "type": "git", "url": "https://github.com/graphql/graphiql", @@ -57,7 +57,7 @@ "@types/codemirror": "^5.60.8", "clsx": "^1.2.1", "codemirror": "^5.65.3", - "codemirror-graphql": "^2.0.10", + "codemirror-graphql": "^2.0.11", "copy-to-clipboard": "^3.2.0", "framer-motion": "^6.5.1", "graphql-language-service": "^5.2.0", diff --git a/packages/graphiql/CHANGELOG.md b/packages/graphiql/CHANGELOG.md index 468f934005e..d772828795b 100644 --- a/packages/graphiql/CHANGELOG.md +++ b/packages/graphiql/CHANGELOG.md @@ -1,5 +1,12 @@ # Change Log +## 3.1.2 + +### Patch Changes + +- Updated dependencies []: + - @graphiql/react@0.20.4 + ## 3.1.1 ### Patch Changes diff --git a/packages/graphiql/package.json b/packages/graphiql/package.json index 2a06646b43b..757ee76b7b2 100644 --- a/packages/graphiql/package.json +++ b/packages/graphiql/package.json @@ -1,6 +1,6 @@ { "name": "graphiql", - "version": "3.1.1", + "version": "3.1.2", "description": "An graphical interactive in-browser GraphQL IDE.", "contributors": [ "Hyohyeon Jeong ", @@ -47,7 +47,7 @@ "webpack": "webpack-cli --config resources/webpack.config.js" }, "dependencies": { - "@graphiql/react": "^0.20.3", + "@graphiql/react": "^0.20.4", "@graphiql/toolkit": "^0.9.1", "graphql-language-service": "^5.2.0", "markdown-it": "^12.2.0" From 5d05105469c3f0cbeb5e294da1cf6ff2355e4eb5 Mon Sep 17 00:00:00 2001 From: Aaron Moat <2937187+AaronMoat@users.noreply.github.com> Date: Sat, 6 Apr 2024 07:15:51 +1100 Subject: [PATCH 12/81] Update to markdown-it 14.x (#3569) --- .changeset/smooth-rings-trade.md | 6 ++ packages/graphiql-react/package.json | 2 +- packages/graphiql/package.json | 4 +- yarn.lock | 138 ++++++++++++++++++++++----- 4 files changed, 125 insertions(+), 25 deletions(-) create mode 100644 .changeset/smooth-rings-trade.md diff --git a/.changeset/smooth-rings-trade.md b/.changeset/smooth-rings-trade.md new file mode 100644 index 00000000000..3261d8668cc --- /dev/null +++ b/.changeset/smooth-rings-trade.md @@ -0,0 +1,6 @@ +--- +'graphiql': minor +'@graphiql/react': minor +--- + +Update to markdown-it 14.x diff --git a/packages/graphiql-react/package.json b/packages/graphiql-react/package.json index 171da58e185..cc3ad9e0922 100644 --- a/packages/graphiql-react/package.json +++ b/packages/graphiql-react/package.json @@ -61,7 +61,7 @@ "copy-to-clipboard": "^3.2.0", "framer-motion": "^6.5.1", "graphql-language-service": "^5.2.0", - "markdown-it": "^12.2.0", + "markdown-it": "^14.1.0", "set-value": "^4.1.0" }, "devDependencies": { diff --git a/packages/graphiql/package.json b/packages/graphiql/package.json index 757ee76b7b2..1a1c43ea674 100644 --- a/packages/graphiql/package.json +++ b/packages/graphiql/package.json @@ -50,7 +50,7 @@ "@graphiql/react": "^0.20.4", "@graphiql/toolkit": "^0.9.1", "graphql-language-service": "^5.2.0", - "markdown-it": "^12.2.0" + "markdown-it": "^14.1.0" }, "peerDependencies": { "graphql": "^15.5.0 || ^16.0.0", @@ -62,7 +62,7 @@ "@testing-library/jest-dom": "5.16.5", "@testing-library/react": "14.0.0", "@types/codemirror": "^0.0.90", - "@types/markdown-it": "^12.2.3", + "@types/markdown-it": "^13.0.7", "@types/node": "^16.18.4", "@types/testing-library__jest-dom": "5.14.5", "babel-loader": "^9.1.2", diff --git a/yarn.lock b/yarn.lock index 96831d6a942..91b899addb1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5396,10 +5396,10 @@ resolved "https://registry.yarnpkg.com/@types/linkify-it/-/linkify-it-2.1.0.tgz#ea3dd64c4805597311790b61e872cbd1ed2cd806" integrity sha512-Q7DYAOi9O/+cLLhdaSvKdaumWyHbm7HAk/bFwwyTuU0arR5yyCeW5GOoqt4tJTpDRxhpx9Q8kQL6vMpuw9hDSw== -"@types/markdown-it@^12.2.3": - version "12.2.3" - resolved "https://registry.yarnpkg.com/@types/markdown-it/-/markdown-it-12.2.3.tgz#0d6f6e5e413f8daaa26522904597be3d6cd93b51" - integrity sha512-GKMHFfv3458yYy+v/N8gjufHO6MSZKCOXpZc5GXIWWy8uldwfmPn98vp81gZ5f9SVw8YYBctgfJ22a2d7AOMeQ== +"@types/markdown-it@^13.0.7": + version "13.0.7" + resolved "https://registry.yarnpkg.com/@types/markdown-it/-/markdown-it-13.0.7.tgz#4a495115f470075bd4434a0438ac477a49c2e152" + integrity sha512-U/CBi2YUUcTHBt5tjO2r5QV/x0Po6nsYwQU4Y04fBS6vfoImaiZ6f8bi3CjTCxBPQSO1LMyUqkByzi8AidyxfA== dependencies: "@types/linkify-it" "*" "@types/mdurl" "*" @@ -6050,6 +6050,34 @@ loupe "^2.3.6" pretty-format "^27.5.1" +"@vscode/vsce@^2.19.0", "@vscode/vsce@^2.23.0": + version "2.24.0" + resolved "https://registry.yarnpkg.com/@vscode/vsce/-/vsce-2.24.0.tgz#7f835b9fdd5bfedcecd62a6c4d684841a74974d4" + integrity sha512-p6CIXpH5HXDqmUkgFXvIKTjZpZxy/uDx4d/UsfhS9vQUun43KDNUbYeZocyAHgqcJlPEurgArHz9te1PPiqPyA== + dependencies: + azure-devops-node-api "^11.0.1" + chalk "^2.4.2" + cheerio "^1.0.0-rc.9" + commander "^6.2.1" + glob "^7.0.6" + hosted-git-info "^4.0.2" + jsonc-parser "^3.2.0" + leven "^3.1.0" + markdown-it "^12.3.2" + mime "^1.3.4" + minimatch "^3.0.3" + parse-semver "^1.1.1" + read "^1.0.7" + semver "^7.5.2" + tmp "^0.2.1" + typed-rest-client "^1.8.4" + url-join "^4.0.1" + xml2js "^0.5.0" + yauzl "^2.3.1" + yazl "^2.2.2" + optionalDependencies: + keytar "^7.7.0" + "@vscode/vsce@^2.22.1-2": version "2.22.1-2" resolved "https://registry.yarnpkg.com/@vscode/vsce/-/vsce-2.22.1-2.tgz#0f272f97b23986366ea97e29721cb28410b9af68" @@ -10698,6 +10726,11 @@ follow-redirects@^1.0.0, follow-redirects@^1.14.0: resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.0.tgz#06441868281c86d0dda4ad8bdaead2d02dca89d4" integrity sha512-aExlJShTV4qOUOL7yF1U5tvLCB0xQuudbf6toyYA0E/acBNw71mvjFTnLaRp50aQaYocMR0a/RMMBIHeZnGyjQ== +follow-redirects@^1.13.2: + version "1.15.6" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.6.tgz#7f815c0cda4249c74ff09e95ef97c23b5fd0399b" + integrity sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA== + follow-redirects@^1.14.6: version "1.15.2" resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.2.tgz#b460864144ba63f2681096f274c4e57026da2c13" @@ -13530,6 +13563,13 @@ linkify-it@^3.0.1: dependencies: uc.micro "^1.0.1" +linkify-it@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/linkify-it/-/linkify-it-5.0.0.tgz#9ef238bfa6dc70bd8e7f9572b52d369af569b421" + integrity sha512-5aHCbzQRADcdP+ATqnDuhhJ/MRIqDkZX5pyjFHRRysS8vZ5AbqGEoFIb6pYHPZ+L/OC2Lc+xT8uHVVR5CAK/wQ== + dependencies: + uc.micro "^2.0.0" + lint-staged@^10.1.2: version "10.1.3" resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-10.1.3.tgz#da27713d3ac519da305381b4de87d5f866b1d2f1" @@ -13923,17 +13963,6 @@ map-stream@~0.1.0: resolved "https://registry.yarnpkg.com/map-stream/-/map-stream-0.1.0.tgz#e56aa94c4c8055a16404a0674b78f215f7c8e194" integrity sha1-5WqpTEyAVaFkBKBnS3jyFffI4ZQ= -markdown-it@^12.2.0: - version "12.2.0" - resolved "https://registry.yarnpkg.com/markdown-it/-/markdown-it-12.2.0.tgz#091f720fd5db206f80de7a8d1f1a7035fd0d38db" - integrity sha512-Wjws+uCrVQRqOoJvze4HCqkKl1AsSh95iFAeQDwnyfxM09divCBSXlDR1uTvyUP3Grzpn4Ru8GeCxYPM8vkCQg== - dependencies: - argparse "^2.0.1" - entities "~2.1.0" - linkify-it "^3.0.1" - mdurl "^1.0.1" - uc.micro "^1.0.5" - markdown-it@^12.3.2: version "12.3.2" resolved "https://registry.yarnpkg.com/markdown-it/-/markdown-it-12.3.2.tgz#bf92ac92283fe983fe4de8ff8abfb5ad72cd0c90" @@ -13945,6 +13974,18 @@ markdown-it@^12.3.2: mdurl "^1.0.1" uc.micro "^1.0.5" +markdown-it@^14.1.0: + version "14.1.0" + resolved "https://registry.yarnpkg.com/markdown-it/-/markdown-it-14.1.0.tgz#3c3c5992883c633db4714ccb4d7b5935d98b7d45" + integrity sha512-a54IwgWPaeBCAAsv13YgmALOF1elABB08FxO9i+r4VFk5Vl4pKokRPeX8u5TCgSsPi6ec1otfLjdOpVcgbpshg== + dependencies: + argparse "^2.0.1" + entities "^4.4.0" + linkify-it "^5.0.0" + mdurl "^2.0.0" + punycode.js "^2.3.1" + uc.micro "^2.1.0" + marked@^1.1.1: version "1.2.7" resolved "https://registry.yarnpkg.com/marked/-/marked-1.2.7.tgz#6e14b595581d2319cdcf033a24caaf41455a01fb" @@ -14111,6 +14152,11 @@ mdurl@^1.0.1: resolved "https://registry.yarnpkg.com/mdurl/-/mdurl-1.0.1.tgz#fe85b2ec75a59037f2adfec100fd6c601761152e" integrity sha1-/oWy7HWlkDfyrf7BAP1sYBdhFS4= +mdurl@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/mdurl/-/mdurl-2.0.0.tgz#80676ec0433025dd3e17ee983d0fe8de5a2237e0" + integrity sha512-Lf+9+2r+Tdp5wXDXC4PcIBjTDtq4UKjCPMQhKIuzpJNW0b96kVqSwW0bT7FhRSfmAiFYgP+SCRvdrDozfh0U5w== + media-typer@0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" @@ -15287,15 +15333,28 @@ outdent@^0.5.0: resolved "https://registry.yarnpkg.com/outdent/-/outdent-0.5.0.tgz#9e10982fdc41492bb473ad13840d22f9655be2ff" integrity sha512-/jHxFIzoMXdqPzTaCpFzAAWhpkSjZPF4Vsn6jAfNpmbH/ymsmd7Qc6VE9BGn0L6YMj6uwpQLxCECpus4ukKS9Q== -ovsx@0.5.1: - version "0.5.1" - resolved "https://registry.yarnpkg.com/ovsx/-/ovsx-0.5.1.tgz#3a8c2707ea120d542d1d226a47f24ac47b078710" - integrity sha512-3OWq0l7DuVHi2bd2aQe5+QVQlFIqvrcw3/2vGXL404L6Tr+R4QHtzfnYYghv8CCa85xJHjU0RhcaC7pyXkAUbg== +ovsx@0.8.3: + version "0.8.3" + resolved "https://registry.yarnpkg.com/ovsx/-/ovsx-0.8.3.tgz#3c67a595e423f3f70a3d62da3735dd07dfbca69f" + integrity sha512-LG7wTzy4eYV/KolFeO4AwWPzQSARvCONzd5oHQlNvYOlji2r/zjbdK8pyObZN84uZlk6rQBWrJrAdJfh/SX0Hg== dependencies: + "@vscode/vsce" "^2.19.0" commander "^6.1.0" follow-redirects "^1.14.6" is-ci "^2.0.0" leven "^3.1.0" + semver "^7.5.2" + tmp "^0.2.1" + +ovsx@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/ovsx/-/ovsx-0.3.0.tgz#2f30c80c90fbe3c8fc406730c35371219187ca0a" + integrity sha512-UjZjzLt6Iq7LS/XFvEuBAWyn0zmsZEe8fuy5DsbcsIb0mW7PbVtB5Dhe4HeK7NJM228nyhYXC9WCeyBoMi4M3A== + dependencies: + commander "^6.1.0" + follow-redirects "^1.13.2" + is-ci "^2.0.0" + leven "^3.1.0" tmp "^0.2.1" vsce "^2.6.3" @@ -16512,6 +16571,11 @@ pump@^3.0.0: end-of-stream "^1.1.0" once "^1.3.1" +punycode.js@^2.3.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/punycode.js/-/punycode.js-2.3.1.tgz#6b53e56ad75588234e79f4affa90972c7dd8cdb7" + integrity sha512-uxFIHU0YlHYhDQtV4R9J6a52SLx28BCjT+4ieh7IGbgwVJWO+km431c4yRlREUAsAmt/uMjQUyQHNEPf0M39CA== + punycode@^1.3.2: version "1.4.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" @@ -18110,7 +18174,7 @@ string-length@^4.0.1: char-regex "^1.0.2" strip-ansi "^6.0.0" -"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.2.3: +"string-width-cjs@npm:string-width@^4.2.0": version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -18154,6 +18218,15 @@ string-width@^4.1.0, string-width@^4.2.0: is-fullwidth-code-point "^3.0.0" strip-ansi "^6.0.0" +string-width@^4.2.3: + version "4.2.3" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.1" + string-width@^5.0.0, string-width@^5.0.1, string-width@^5.1.2: version "5.1.2" resolved "https://registry.yarnpkg.com/string-width/-/string-width-5.1.2.tgz#14f8daec6d81e7221d2a357e668cab73bdbca794" @@ -18242,7 +18315,7 @@ stringify-object@^3.3.0: is-obj "^1.0.1" is-regexp "^1.0.0" -"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.1: +"strip-ansi-cjs@npm:strip-ansi@^6.0.1": version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -18277,6 +18350,13 @@ strip-ansi@^6.0.0: dependencies: ansi-regex "^5.0.0" +strip-ansi@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + strip-ansi@^7.0.1: version "7.1.0" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-7.1.0.tgz#d5b6568ca689d8561370b0707685d22434faff45" @@ -19071,6 +19151,11 @@ uc.micro@^1.0.1, uc.micro@^1.0.5: resolved "https://registry.yarnpkg.com/uc.micro/-/uc.micro-1.0.6.tgz#9c411a802a409a91fc6cf74081baba34b24499ac" integrity sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA== +uc.micro@^2.0.0, uc.micro@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/uc.micro/-/uc.micro-2.1.0.tgz#f8d3f7d0ec4c3dea35a7e3c8efa4cb8b45c9e7ee" + integrity sha512-ARDJmphmdvUk6Glw7y9DQ2bFkKBHwQHLi2lsaH6PPmz/Ka9sFOBsBluozhDltWmnv9u/cF6Rt87znRTPV+yp/A== + ufo@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/ufo/-/ufo-1.1.2.tgz#d0d9e0fa09dece0c31ffd57bd363f030a35cfe76" @@ -20341,7 +20426,7 @@ workerpool@6.2.1: resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.2.1.tgz#46fc150c17d826b86a008e5a4508656777e9c343" integrity sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw== -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== @@ -20376,6 +20461,15 @@ wrap-ansi@^6.2.0: string-width "^4.1.0" strip-ansi "^6.0.0" +wrap-ansi@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + wrap-ansi@^8.1.0: version "8.1.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214" From 29e99a86c69457490801d97bb9139499a9fef755 Mon Sep 17 00:00:00 2001 From: Rikki Schulte Date: Fri, 5 Apr 2024 22:21:24 +0200 Subject: [PATCH 13/81] Version Packages (#3577) Co-authored-by: github-actions[bot] --- .changeset/smooth-rings-trade.md | 6 ------ examples/graphiql-webpack/package.json | 8 ++++---- packages/graphiql-plugin-code-exporter/CHANGELOG.md | 7 +++++++ packages/graphiql-plugin-code-exporter/package.json | 6 +++--- packages/graphiql-plugin-explorer/CHANGELOG.md | 7 +++++++ packages/graphiql-plugin-explorer/package.json | 6 +++--- packages/graphiql-react/CHANGELOG.md | 6 ++++++ packages/graphiql-react/package.json | 2 +- packages/graphiql/CHANGELOG.md | 11 +++++++++++ packages/graphiql/package.json | 4 ++-- 10 files changed, 44 insertions(+), 19 deletions(-) delete mode 100644 .changeset/smooth-rings-trade.md diff --git a/.changeset/smooth-rings-trade.md b/.changeset/smooth-rings-trade.md deleted file mode 100644 index 3261d8668cc..00000000000 --- a/.changeset/smooth-rings-trade.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'graphiql': minor -'@graphiql/react': minor ---- - -Update to markdown-it 14.x diff --git a/examples/graphiql-webpack/package.json b/examples/graphiql-webpack/package.json index 3b0929810cf..dd34d1060e2 100644 --- a/examples/graphiql-webpack/package.json +++ b/examples/graphiql-webpack/package.json @@ -9,11 +9,11 @@ "start": "NODE_ENV=development webpack-cli serve" }, "dependencies": { - "@graphiql/plugin-code-exporter": "^1.0.5", - "@graphiql/plugin-explorer": "^1.0.4", + "@graphiql/plugin-code-exporter": "^2.0.0", + "@graphiql/plugin-explorer": "^2.0.0", "@graphiql/toolkit": "^0.9.1", - "@graphiql/react": "^0.20.4", - "graphiql": "^3.1.2", + "@graphiql/react": "^0.21.0", + "graphiql": "^3.2.0", "graphql": "^16.8.1", "graphql-ws": "^5.5.5", "react": "^18.2.0", diff --git a/packages/graphiql-plugin-code-exporter/CHANGELOG.md b/packages/graphiql-plugin-code-exporter/CHANGELOG.md index 0689164342e..9443786fd89 100644 --- a/packages/graphiql-plugin-code-exporter/CHANGELOG.md +++ b/packages/graphiql-plugin-code-exporter/CHANGELOG.md @@ -1,5 +1,12 @@ # @graphiql/plugin-code-exporter +## 2.0.0 + +### Patch Changes + +- Updated dependencies [[`5d051054`](https://github.com/graphql/graphiql/commit/5d05105469c3f0cbeb5e294da1cf6ff2355e4eb5)]: + - @graphiql/react@0.21.0 + ## 1.0.5 ### Patch Changes diff --git a/packages/graphiql-plugin-code-exporter/package.json b/packages/graphiql-plugin-code-exporter/package.json index 93ebb92d70f..6121ccf4ae2 100644 --- a/packages/graphiql-plugin-code-exporter/package.json +++ b/packages/graphiql-plugin-code-exporter/package.json @@ -1,6 +1,6 @@ { "name": "@graphiql/plugin-code-exporter", - "version": "1.0.5", + "version": "2.0.0", "repository": { "type": "git", "url": "https://github.com/graphql/graphiql", @@ -33,13 +33,13 @@ "graphiql-code-exporter": "^3.0.3" }, "peerDependencies": { - "@graphiql/react": "^0.20.4", + "@graphiql/react": "^0.21.0", "graphql": "^15.5.0 || ^16.0.0", "react": "^16.8.0 || ^17 || ^18", "react-dom": "^16.8.0 || ^17 || ^18" }, "devDependencies": { - "@graphiql/react": "^0.20.4", + "@graphiql/react": "^0.21.0", "@vitejs/plugin-react": "^4.0.1", "graphql": "^16.8.1", "postcss-nesting": "^10.1.7", diff --git a/packages/graphiql-plugin-explorer/CHANGELOG.md b/packages/graphiql-plugin-explorer/CHANGELOG.md index a3b8e5c8100..50af337e048 100644 --- a/packages/graphiql-plugin-explorer/CHANGELOG.md +++ b/packages/graphiql-plugin-explorer/CHANGELOG.md @@ -1,5 +1,12 @@ # @graphiql/plugin-explorer +## 2.0.0 + +### Patch Changes + +- Updated dependencies [[`5d051054`](https://github.com/graphql/graphiql/commit/5d05105469c3f0cbeb5e294da1cf6ff2355e4eb5)]: + - @graphiql/react@0.21.0 + ## 1.0.4 ### Patch Changes diff --git a/packages/graphiql-plugin-explorer/package.json b/packages/graphiql-plugin-explorer/package.json index 1289a5aa103..cf93fe0c4a8 100644 --- a/packages/graphiql-plugin-explorer/package.json +++ b/packages/graphiql-plugin-explorer/package.json @@ -1,6 +1,6 @@ { "name": "@graphiql/plugin-explorer", - "version": "1.0.4", + "version": "2.0.0", "repository": { "type": "git", "url": "https://github.com/graphql/graphiql", @@ -32,13 +32,13 @@ "graphiql-explorer": "^0.9.0" }, "peerDependencies": { - "@graphiql/react": "^0.20.4", + "@graphiql/react": "^0.21.0", "graphql": "^15.5.0 || ^16.0.0", "react": "^16.8.0 || ^17 || ^18", "react-dom": "^16.8.0 || ^17 || ^18" }, "devDependencies": { - "@graphiql/react": "^0.20.4", + "@graphiql/react": "^0.21.0", "@vitejs/plugin-react": "^4.0.1", "graphql": "^16.8.1", "react": "^18.2.0", diff --git a/packages/graphiql-react/CHANGELOG.md b/packages/graphiql-react/CHANGELOG.md index 2d7ac8fecbc..d42f80eaa3a 100644 --- a/packages/graphiql-react/CHANGELOG.md +++ b/packages/graphiql-react/CHANGELOG.md @@ -1,5 +1,11 @@ # @graphiql/react +## 0.21.0 + +### Minor Changes + +- [#3569](https://github.com/graphql/graphiql/pull/3569) [`5d051054`](https://github.com/graphql/graphiql/commit/5d05105469c3f0cbeb5e294da1cf6ff2355e4eb5) Thanks [@AaronMoat](https://github.com/AaronMoat)! - Update to markdown-it 14.x + ## 0.20.4 ### Patch Changes diff --git a/packages/graphiql-react/package.json b/packages/graphiql-react/package.json index cc3ad9e0922..361d5d01d61 100644 --- a/packages/graphiql-react/package.json +++ b/packages/graphiql-react/package.json @@ -1,6 +1,6 @@ { "name": "@graphiql/react", - "version": "0.20.4", + "version": "0.21.0", "repository": { "type": "git", "url": "https://github.com/graphql/graphiql", diff --git a/packages/graphiql/CHANGELOG.md b/packages/graphiql/CHANGELOG.md index d772828795b..8eb2f0f9f14 100644 --- a/packages/graphiql/CHANGELOG.md +++ b/packages/graphiql/CHANGELOG.md @@ -1,5 +1,16 @@ # Change Log +## 3.2.0 + +### Minor Changes + +- [#3569](https://github.com/graphql/graphiql/pull/3569) [`5d051054`](https://github.com/graphql/graphiql/commit/5d05105469c3f0cbeb5e294da1cf6ff2355e4eb5) Thanks [@AaronMoat](https://github.com/AaronMoat)! - Update to markdown-it 14.x + +### Patch Changes + +- Updated dependencies [[`5d051054`](https://github.com/graphql/graphiql/commit/5d05105469c3f0cbeb5e294da1cf6ff2355e4eb5)]: + - @graphiql/react@0.21.0 + ## 3.1.2 ### Patch Changes diff --git a/packages/graphiql/package.json b/packages/graphiql/package.json index 1a1c43ea674..a5df7fbf151 100644 --- a/packages/graphiql/package.json +++ b/packages/graphiql/package.json @@ -1,6 +1,6 @@ { "name": "graphiql", - "version": "3.1.2", + "version": "3.2.0", "description": "An graphical interactive in-browser GraphQL IDE.", "contributors": [ "Hyohyeon Jeong ", @@ -47,7 +47,7 @@ "webpack": "webpack-cli --config resources/webpack.config.js" }, "dependencies": { - "@graphiql/react": "^0.20.4", + "@graphiql/react": "^0.21.0", "@graphiql/toolkit": "^0.9.1", "graphql-language-service": "^5.2.0", "markdown-it": "^14.1.0" From 5e52108038d8d5e97f8d21a9c22bb9048fa377f0 Mon Sep 17 00:00:00 2001 From: Rikki Schulte Date: Wed, 1 May 2024 12:31:12 +0200 Subject: [PATCH 14/81] fix: remove the ruby tm grammar for the reccomended ruby-lsp graphql support (#3592) --- .changeset/metal-mayflies-occur.md | 5 ++ .../grammars/graphql.rb.json | 23 --------- packages/vscode-graphql-syntax/package.json | 11 ----- .../tests/__fixtures__/test.md | 11 ----- .../tests/__fixtures__/test.rb | 22 --------- .../markdown-grammar.spec.ts.snap | 11 ----- .../__snapshots__/ruby-grammar.spec.ts.snap | 47 ------------------- .../tests/ruby-grammar.spec.ts | 10 ---- 8 files changed, 5 insertions(+), 135 deletions(-) create mode 100644 .changeset/metal-mayflies-occur.md delete mode 100644 packages/vscode-graphql-syntax/grammars/graphql.rb.json delete mode 100644 packages/vscode-graphql-syntax/tests/__fixtures__/test.rb delete mode 100644 packages/vscode-graphql-syntax/tests/__snapshots__/ruby-grammar.spec.ts.snap delete mode 100644 packages/vscode-graphql-syntax/tests/ruby-grammar.spec.ts diff --git a/.changeset/metal-mayflies-occur.md b/.changeset/metal-mayflies-occur.md new file mode 100644 index 00000000000..f93f0ac738d --- /dev/null +++ b/.changeset/metal-mayflies-occur.md @@ -0,0 +1,5 @@ +--- +'vscode-graphql-syntax': patch +--- + +Remove ruby support for code highlighting, users should use `ruby-lsp` for graphql highlighting instead! diff --git a/packages/vscode-graphql-syntax/grammars/graphql.rb.json b/packages/vscode-graphql-syntax/grammars/graphql.rb.json deleted file mode 100644 index 86ba7787d4c..00000000000 --- a/packages/vscode-graphql-syntax/grammars/graphql.rb.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "scopeName": "inline.graphql.rb", - "injectionSelector": "L:(meta.embedded.block.ruby | source.ruby -string -comment)", - "patterns": [ - { - "name": "taggedTemplates", - "contentName": "meta.embedded.block.graphql", - "begin": "(?=(?><<[-~](['\"]?)((?:[_\\w]+_|)GRAPHQL)\\b\\1))", - "beginCaptures": { - "0": { - "name": "punctuation.definition.string.begin.ruby" - } - }, - "end": "\\s*\\2$\\n?", - "endCaptures": { - "0": { - "name": "punctuation.definition.string.end.ruby" - } - }, - "patterns": [{ "include": "source.graphql" }] - } - ] -} diff --git a/packages/vscode-graphql-syntax/package.json b/packages/vscode-graphql-syntax/package.json index 80d8a75a431..9dc7c3a2387 100644 --- a/packages/vscode-graphql-syntax/package.json +++ b/packages/vscode-graphql-syntax/package.json @@ -136,17 +136,6 @@ "embeddedLanguages": { "meta.embedded.block.graphql": "graphql" } - }, - { - "injectTo": [ - "source.ruby", - "text.html.markdown" - ], - "scopeName": "inline.graphql.rb", - "path": "./grammars/graphql.rb.json", - "embeddedLanguages": { - "meta.embedded.block.graphql": "graphql" - } } ] }, diff --git a/packages/vscode-graphql-syntax/tests/__fixtures__/test.md b/packages/vscode-graphql-syntax/tests/__fixtures__/test.md index bdc1bf01e25..8a025d7c219 100644 --- a/packages/vscode-graphql-syntax/tests/__fixtures__/test.md +++ b/packages/vscode-graphql-syntax/tests/__fixtures__/test.md @@ -37,14 +37,3 @@ type Example { GRAPHQL; ?> ``` - -```ruby - it "Should delimit queries" do - query3 = <<~'GRAPHQL' - { - datasets(q: { idEq: 3 }) { id, daylight } - } - GRAPHQL -end - -``` diff --git a/packages/vscode-graphql-syntax/tests/__fixtures__/test.rb b/packages/vscode-graphql-syntax/tests/__fixtures__/test.rb deleted file mode 100644 index 38cd1759540..00000000000 --- a/packages/vscode-graphql-syntax/tests/__fixtures__/test.rb +++ /dev/null @@ -1,22 +0,0 @@ -it "Should find datasets by ransack" do - dataset = Dataset.last - query = <<~GRAPHQL - { - datasets(q: { idEq: 3 }) { id, daylight } - } - GRAPHQL - data = Util.graphql_query(query) - expect(data['datasets'][0]["daylight"]).to eq dataset.daylight - - query2 = <<-GRAPHQL - { - datasets(q: { idEq: #{dataset.id} }) { id, daylight } - } - GRAPHQL - - query3 = <<~'GRAPHQL' - { - datasets(q: { idEq: #{dataset.id} }) { id, daylight } - } - GRAPHQL -end diff --git a/packages/vscode-graphql-syntax/tests/__snapshots__/markdown-grammar.spec.ts.snap b/packages/vscode-graphql-syntax/tests/__snapshots__/markdown-grammar.spec.ts.snap index cb1a88a0b80..9c758e157df 100644 --- a/packages/vscode-graphql-syntax/tests/__snapshots__/markdown-grammar.spec.ts.snap +++ b/packages/vscode-graphql-syntax/tests/__snapshots__/markdown-grammar.spec.ts.snap @@ -65,17 +65,6 @@ Example | } | GRAPHQL; | ?> | -\`\`\` | - | -\`\`\`ruby | - it "Should delimit queries" do | - query3 = <<~'GRAPHQL' | - { | - datasets(q: { idEq: 3 }) { id, daylight } | - } | - GRAPHQL | -end | - | \`\`\` | | `; diff --git a/packages/vscode-graphql-syntax/tests/__snapshots__/ruby-grammar.spec.ts.snap b/packages/vscode-graphql-syntax/tests/__snapshots__/ruby-grammar.spec.ts.snap deleted file mode 100644 index cec18750b24..00000000000 --- a/packages/vscode-graphql-syntax/tests/__snapshots__/ruby-grammar.spec.ts.snap +++ /dev/null @@ -1,47 +0,0 @@ -// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html - -exports[`inline.graphql.rb grammar > should tokenize a simple ruby file 1`] = ` -it "Should find datasets by ransack" do | - dataset = Dataset.last | - query = | -<<~ | taggedTemplates meta.embedded.block.graphql -GRAPHQL | taggedTemplates punctuation.definition.string.end.ruby - { | - datasets(q: { idEq: 3 }) { id, daylight } | - } | - GRAPHQL | - data = Util.graphql_query(query) | - expect(data['datasets'][0]["daylight"]).to eq dataset.daylight | - | - query2 = | -<<- | taggedTemplates meta.embedded.block.graphql -GRAPHQL | taggedTemplates punctuation.definition.string.end.ruby - { | - datasets(q: { idEq: #{dataset.id} }) { id, daylight } | - } | - GRAPHQL | - | - query3 = | -<<~' | taggedTemplates meta.embedded.block.graphql -GRAPHQL | taggedTemplates meta.embedded.block.graphql entity.name.function.graphql -' | taggedTemplates meta.embedded.block.graphql - | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql -{ | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql - | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql -datasets | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql variable.graphql -( | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql meta.brace.round.directive.graphql -q | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql variable.parameter.graphql -: | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql punctuation.colon.graphql - | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql meta.objectvalues.graphql -{ | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql meta.objectvalues.graphql meta.brace.curly.graphql - | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql meta.objectvalues.graphql -idEq | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql meta.objectvalues.graphql constant.object.key.graphql string.unquoted.graphql -: | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql meta.objectvalues.graphql punctuation.graphql - | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql meta.objectvalues.graphql comment.line.graphql.js punctuation.whitespace.comment.leading.graphql -#{dataset.id} }) { id, daylight } | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql meta.objectvalues.graphql comment.line.graphql.js - | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql meta.objectvalues.graphql -} | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql meta.objectvalues.graphql meta.brace.curly.graphql - GRAPHQL | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql constant.character.enum.graphql -end | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql constant.character.enum.graphql - | taggedTemplates meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql -`; diff --git a/packages/vscode-graphql-syntax/tests/ruby-grammar.spec.ts b/packages/vscode-graphql-syntax/tests/ruby-grammar.spec.ts deleted file mode 100644 index fab8853e748..00000000000 --- a/packages/vscode-graphql-syntax/tests/ruby-grammar.spec.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { tokenizeFile } from './__utilities__/utilities'; - -describe('inline.graphql.rb grammar', () => { - const scope = 'inline.graphql.rb'; - - it('should tokenize a simple ruby file', async () => { - const result = await tokenizeFile('__fixtures__/test.rb', scope); - expect(result).toMatchSnapshot(); - }); -}); From 9d42a25c97d722fd165f97ec806754d792a3de81 Mon Sep 17 00:00:00 2001 From: Rikki Schulte Date: Wed, 1 May 2024 13:32:57 +0200 Subject: [PATCH 15/81] Version Packages (#3593) Co-authored-by: github-actions[bot] --- .changeset/metal-mayflies-occur.md | 5 ----- packages/vscode-graphql-syntax/CHANGELOG.md | 6 ++++++ packages/vscode-graphql-syntax/package.json | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) delete mode 100644 .changeset/metal-mayflies-occur.md diff --git a/.changeset/metal-mayflies-occur.md b/.changeset/metal-mayflies-occur.md deleted file mode 100644 index f93f0ac738d..00000000000 --- a/.changeset/metal-mayflies-occur.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'vscode-graphql-syntax': patch ---- - -Remove ruby support for code highlighting, users should use `ruby-lsp` for graphql highlighting instead! diff --git a/packages/vscode-graphql-syntax/CHANGELOG.md b/packages/vscode-graphql-syntax/CHANGELOG.md index d29c6848fcd..e692ad2c2e3 100644 --- a/packages/vscode-graphql-syntax/CHANGELOG.md +++ b/packages/vscode-graphql-syntax/CHANGELOG.md @@ -1,5 +1,11 @@ # vscode-graphql-syntax +## 1.3.6 + +### Patch Changes + +- [#3592](https://github.com/graphql/graphiql/pull/3592) [`5e521080`](https://github.com/graphql/graphiql/commit/5e52108038d8d5e97f8d21a9c22bb9048fa377f0) Thanks [@acao](https://github.com/acao)! - Remove ruby support for code highlighting, users should use `ruby-lsp` for graphql highlighting instead! + ## 1.3.5 ### Patch Changes diff --git a/packages/vscode-graphql-syntax/package.json b/packages/vscode-graphql-syntax/package.json index 9dc7c3a2387..849d66fdfd6 100644 --- a/packages/vscode-graphql-syntax/package.json +++ b/packages/vscode-graphql-syntax/package.json @@ -1,6 +1,6 @@ { "name": "vscode-graphql-syntax", - "version": "1.3.5", + "version": "1.3.6", "displayName": "GraphQL: Syntax Highlighting", "description": "Adds syntax highlighting support for .graphql & embedded support for javascript, typescript, vue, markdown, python, php, reason, ocaml and rescript", "publisher": "GraphQL", From d48f4ef56578dad7ec90f33458353791e463ef7b Mon Sep 17 00:00:00 2001 From: Thomas Heyenbrock Date: Tue, 7 May 2024 18:16:20 +0200 Subject: [PATCH 16/81] implement correct merging of incremental respones (@defer/@stream) (#3580) * implement correct merging of incremental respones (@defer/@stream) * fix lint error * fix error for real --- .changeset/clean-pets-dance.md | 5 ++ packages/graphiql-react/src/execution.tsx | 102 ++++++++++++++-------- 2 files changed, 71 insertions(+), 36 deletions(-) create mode 100644 .changeset/clean-pets-dance.md diff --git a/.changeset/clean-pets-dance.md b/.changeset/clean-pets-dance.md new file mode 100644 index 00000000000..c37ceaeb48f --- /dev/null +++ b/.changeset/clean-pets-dance.md @@ -0,0 +1,5 @@ +--- +'@graphiql/react': minor +--- + +Implement correct merging of incremental responses (@defer/@stream) diff --git a/packages/graphiql-react/src/execution.tsx b/packages/graphiql-react/src/execution.tsx index d66b4eea78b..be1b8bcaced 100644 --- a/packages/graphiql-react/src/execution.tsx +++ b/packages/graphiql-react/src/execution.tsx @@ -1,13 +1,17 @@ import { Fetcher, - FetcherResultPayload, formatError, formatResult, isAsyncIterable, isObservable, Unsubscribable, } from '@graphiql/toolkit'; -import { ExecutionResult, FragmentDefinitionNode, print } from 'graphql'; +import { + ExecutionResult, + FragmentDefinitionNode, + GraphQLError, + print, +} from 'graphql'; import { getFragmentDependenciesForAST } from 'graphql-language-service'; import { ReactNode, useCallback, useMemo, useRef, useState } from 'react'; import setValue from 'set-value'; @@ -183,7 +187,7 @@ export function ExecutionContextProvider({ }); try { - let fullResponse: FetcherResultPayload = { data: {} }; + const fullResponse: ExecutionResult = {}; const handleResponse = (result: ExecutionResult) => { // A different query was dispatched in the meantime, so don't // show the results of this one. @@ -202,40 +206,8 @@ export function ExecutionContextProvider({ } if (maybeMultipart) { - const payload: FetcherResultPayload = { - data: fullResponse.data, - }; - const maybeErrors = [ - ...(fullResponse?.errors || []), - ...maybeMultipart.flatMap(i => i.errors).filter(Boolean), - ]; - - if (maybeErrors.length) { - payload.errors = maybeErrors; - } - for (const part of maybeMultipart) { - // We pull out errors here, so we dont include it later - const { path, data, errors, ...rest } = part; - if (path) { - if (!data) { - throw new Error( - `Expected part to contain a data property, but got ${part}`, - ); - } - - setValue(payload.data, path, data, { merge: true }); - } else if (data) { - // If there is no path, we don't know what to do with the payload, - // so we just set it. - payload.data = data; - } - - // Ensures we also bring extensions and alike along for the ride - fullResponse = { - ...payload, - ...rest, - }; + mergeIncrementalResult(fullResponse, part); } setIsFetching(false); @@ -361,3 +333,61 @@ function tryParseJsonObject({ } return parsed; } + +type IncrementalResult = { + data?: Record | null; + errors?: ReadonlyArray; + extensions?: Record; + hasNext?: boolean; + path?: ReadonlyArray; + incremental?: ReadonlyArray; + label?: string; + items?: ReadonlyArray> | null; +}; + +/** + * @param executionResult The complete execution result object which will be + * mutated by merging the contents of the incremental result. + * @param incrementalResult The incremental result that will be merged into the + * complete execution result. + */ +function mergeIncrementalResult( + executionResult: ExecutionResult, + incrementalResult: IncrementalResult, +): void { + const path = ['data', ...(incrementalResult.path ?? [])]; + + if (incrementalResult.items) { + for (const item of incrementalResult.items) { + setValue(executionResult, path.join('.'), item); + // Increment the last path segment (the array index) to merge the next item at the next index + // eslint-disable-next-line unicorn/prefer-at -- cannot mutate the array using Array.at() + (path[path.length - 1] as number)++; + } + } + + if (incrementalResult.data) { + setValue(executionResult, path.join('.'), incrementalResult.data, { + merge: true, + }); + } + + if (incrementalResult.errors) { + executionResult.errors ||= []; + (executionResult.errors as GraphQLError[]).push( + ...incrementalResult.errors, + ); + } + + if (incrementalResult.extensions) { + setValue(executionResult, 'extensions', incrementalResult.extensions, { + merge: true, + }); + } + + if (incrementalResult.incremental) { + for (const incrementalSubResult of incrementalResult.incremental) { + mergeIncrementalResult(executionResult, incrementalSubResult); + } + } +} From 79d1d990040ab6430776ee2495dd4e1230bedb18 Mon Sep 17 00:00:00 2001 From: Rikki Schulte Date: Tue, 7 May 2024 18:31:33 +0200 Subject: [PATCH 17/81] Version Packages (#3595) Co-authored-by: github-actions[bot] --- .changeset/clean-pets-dance.md | 5 ----- examples/graphiql-webpack/package.json | 8 ++++---- packages/graphiql-plugin-code-exporter/CHANGELOG.md | 7 +++++++ packages/graphiql-plugin-code-exporter/package.json | 6 +++--- packages/graphiql-plugin-explorer/CHANGELOG.md | 7 +++++++ packages/graphiql-plugin-explorer/package.json | 6 +++--- packages/graphiql-react/CHANGELOG.md | 6 ++++++ packages/graphiql-react/package.json | 2 +- packages/graphiql/CHANGELOG.md | 7 +++++++ packages/graphiql/package.json | 4 ++-- 10 files changed, 40 insertions(+), 18 deletions(-) delete mode 100644 .changeset/clean-pets-dance.md diff --git a/.changeset/clean-pets-dance.md b/.changeset/clean-pets-dance.md deleted file mode 100644 index c37ceaeb48f..00000000000 --- a/.changeset/clean-pets-dance.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@graphiql/react': minor ---- - -Implement correct merging of incremental responses (@defer/@stream) diff --git a/examples/graphiql-webpack/package.json b/examples/graphiql-webpack/package.json index dd34d1060e2..4d4f6b257a6 100644 --- a/examples/graphiql-webpack/package.json +++ b/examples/graphiql-webpack/package.json @@ -9,11 +9,11 @@ "start": "NODE_ENV=development webpack-cli serve" }, "dependencies": { - "@graphiql/plugin-code-exporter": "^2.0.0", - "@graphiql/plugin-explorer": "^2.0.0", + "@graphiql/plugin-code-exporter": "^3.0.0", + "@graphiql/plugin-explorer": "^3.0.0", "@graphiql/toolkit": "^0.9.1", - "@graphiql/react": "^0.21.0", - "graphiql": "^3.2.0", + "@graphiql/react": "^0.22.0", + "graphiql": "^3.2.1", "graphql": "^16.8.1", "graphql-ws": "^5.5.5", "react": "^18.2.0", diff --git a/packages/graphiql-plugin-code-exporter/CHANGELOG.md b/packages/graphiql-plugin-code-exporter/CHANGELOG.md index 9443786fd89..0d1768cf5f1 100644 --- a/packages/graphiql-plugin-code-exporter/CHANGELOG.md +++ b/packages/graphiql-plugin-code-exporter/CHANGELOG.md @@ -1,5 +1,12 @@ # @graphiql/plugin-code-exporter +## 3.0.0 + +### Patch Changes + +- Updated dependencies [[`d48f4ef5`](https://github.com/graphql/graphiql/commit/d48f4ef56578dad7ec90f33458353791e463ef7b)]: + - @graphiql/react@0.22.0 + ## 2.0.0 ### Patch Changes diff --git a/packages/graphiql-plugin-code-exporter/package.json b/packages/graphiql-plugin-code-exporter/package.json index 6121ccf4ae2..98fc44b86c0 100644 --- a/packages/graphiql-plugin-code-exporter/package.json +++ b/packages/graphiql-plugin-code-exporter/package.json @@ -1,6 +1,6 @@ { "name": "@graphiql/plugin-code-exporter", - "version": "2.0.0", + "version": "3.0.0", "repository": { "type": "git", "url": "https://github.com/graphql/graphiql", @@ -33,13 +33,13 @@ "graphiql-code-exporter": "^3.0.3" }, "peerDependencies": { - "@graphiql/react": "^0.21.0", + "@graphiql/react": "^0.22.0", "graphql": "^15.5.0 || ^16.0.0", "react": "^16.8.0 || ^17 || ^18", "react-dom": "^16.8.0 || ^17 || ^18" }, "devDependencies": { - "@graphiql/react": "^0.21.0", + "@graphiql/react": "^0.22.0", "@vitejs/plugin-react": "^4.0.1", "graphql": "^16.8.1", "postcss-nesting": "^10.1.7", diff --git a/packages/graphiql-plugin-explorer/CHANGELOG.md b/packages/graphiql-plugin-explorer/CHANGELOG.md index 50af337e048..2a5d8f1a3e0 100644 --- a/packages/graphiql-plugin-explorer/CHANGELOG.md +++ b/packages/graphiql-plugin-explorer/CHANGELOG.md @@ -1,5 +1,12 @@ # @graphiql/plugin-explorer +## 3.0.0 + +### Patch Changes + +- Updated dependencies [[`d48f4ef5`](https://github.com/graphql/graphiql/commit/d48f4ef56578dad7ec90f33458353791e463ef7b)]: + - @graphiql/react@0.22.0 + ## 2.0.0 ### Patch Changes diff --git a/packages/graphiql-plugin-explorer/package.json b/packages/graphiql-plugin-explorer/package.json index cf93fe0c4a8..a03d9c33d57 100644 --- a/packages/graphiql-plugin-explorer/package.json +++ b/packages/graphiql-plugin-explorer/package.json @@ -1,6 +1,6 @@ { "name": "@graphiql/plugin-explorer", - "version": "2.0.0", + "version": "3.0.0", "repository": { "type": "git", "url": "https://github.com/graphql/graphiql", @@ -32,13 +32,13 @@ "graphiql-explorer": "^0.9.0" }, "peerDependencies": { - "@graphiql/react": "^0.21.0", + "@graphiql/react": "^0.22.0", "graphql": "^15.5.0 || ^16.0.0", "react": "^16.8.0 || ^17 || ^18", "react-dom": "^16.8.0 || ^17 || ^18" }, "devDependencies": { - "@graphiql/react": "^0.21.0", + "@graphiql/react": "^0.22.0", "@vitejs/plugin-react": "^4.0.1", "graphql": "^16.8.1", "react": "^18.2.0", diff --git a/packages/graphiql-react/CHANGELOG.md b/packages/graphiql-react/CHANGELOG.md index d42f80eaa3a..054c6d3a53e 100644 --- a/packages/graphiql-react/CHANGELOG.md +++ b/packages/graphiql-react/CHANGELOG.md @@ -1,5 +1,11 @@ # @graphiql/react +## 0.22.0 + +### Minor Changes + +- [#3580](https://github.com/graphql/graphiql/pull/3580) [`d48f4ef5`](https://github.com/graphql/graphiql/commit/d48f4ef56578dad7ec90f33458353791e463ef7b) Thanks [@thomasheyenbrock](https://github.com/thomasheyenbrock)! - Implement correct merging of incremental responses (@defer/@stream) + ## 0.21.0 ### Minor Changes diff --git a/packages/graphiql-react/package.json b/packages/graphiql-react/package.json index 361d5d01d61..fe8b9d67875 100644 --- a/packages/graphiql-react/package.json +++ b/packages/graphiql-react/package.json @@ -1,6 +1,6 @@ { "name": "@graphiql/react", - "version": "0.21.0", + "version": "0.22.0", "repository": { "type": "git", "url": "https://github.com/graphql/graphiql", diff --git a/packages/graphiql/CHANGELOG.md b/packages/graphiql/CHANGELOG.md index 8eb2f0f9f14..9013a60141a 100644 --- a/packages/graphiql/CHANGELOG.md +++ b/packages/graphiql/CHANGELOG.md @@ -1,5 +1,12 @@ # Change Log +## 3.2.1 + +### Patch Changes + +- Updated dependencies [[`d48f4ef5`](https://github.com/graphql/graphiql/commit/d48f4ef56578dad7ec90f33458353791e463ef7b)]: + - @graphiql/react@0.22.0 + ## 3.2.0 ### Minor Changes diff --git a/packages/graphiql/package.json b/packages/graphiql/package.json index a5df7fbf151..3e331d090b9 100644 --- a/packages/graphiql/package.json +++ b/packages/graphiql/package.json @@ -1,6 +1,6 @@ { "name": "graphiql", - "version": "3.2.0", + "version": "3.2.1", "description": "An graphical interactive in-browser GraphQL IDE.", "contributors": [ "Hyohyeon Jeong ", @@ -47,7 +47,7 @@ "webpack": "webpack-cli --config resources/webpack.config.js" }, "dependencies": { - "@graphiql/react": "^0.21.0", + "@graphiql/react": "^0.22.0", "@graphiql/toolkit": "^0.9.1", "graphql-language-service": "^5.2.0", "markdown-it": "^14.1.0" From 224b43f5473456f264a82998d48a34a441537f54 Mon Sep 17 00:00:00 2001 From: Thomas Heyenbrock Date: Sat, 11 May 2024 22:51:17 +0200 Subject: [PATCH 18/81] fix TS type of Tooltip.label prop (#3597) --- .changeset/twenty-chicken-shout.md | 5 +++++ packages/graphiql-react/src/ui/tooltip.tsx | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 .changeset/twenty-chicken-shout.md diff --git a/.changeset/twenty-chicken-shout.md b/.changeset/twenty-chicken-shout.md new file mode 100644 index 00000000000..7c8626b1be3 --- /dev/null +++ b/.changeset/twenty-chicken-shout.md @@ -0,0 +1,5 @@ +--- +'@graphiql/react': patch +--- + +Fix TypeScript type of the `label` prop of the `Tooltip` component diff --git a/packages/graphiql-react/src/ui/tooltip.tsx b/packages/graphiql-react/src/ui/tooltip.tsx index 8bbcaf88ac8..af141a9364c 100644 --- a/packages/graphiql-react/src/ui/tooltip.tsx +++ b/packages/graphiql-react/src/ui/tooltip.tsx @@ -1,4 +1,4 @@ -import { ReactElement } from 'react'; +import { ReactElement, ReactNode } from 'react'; import * as T from '@radix-ui/react-tooltip'; import { createComponentGroup } from '../utility/component-group'; import './tooltip.css'; @@ -9,7 +9,7 @@ export function TooltipRoot({ side = 'bottom', sideOffset = 5, label, -}: T.TooltipContentProps & { label: string }): ReactElement { +}: T.TooltipContentProps & { label: ReactNode }): ReactElement { return ( {children} From e3ca774aba5e14fe45911b368feca5e6b33db309 Mon Sep 17 00:00:00 2001 From: Rikki Schulte Date: Sun, 12 May 2024 22:49:39 +0200 Subject: [PATCH 19/81] Version Packages (#3598) Co-authored-by: github-actions[bot] --- .changeset/twenty-chicken-shout.md | 5 ----- examples/graphiql-webpack/package.json | 8 ++++---- packages/graphiql-plugin-code-exporter/CHANGELOG.md | 7 +++++++ packages/graphiql-plugin-code-exporter/package.json | 6 +++--- packages/graphiql-plugin-explorer/CHANGELOG.md | 7 +++++++ packages/graphiql-plugin-explorer/package.json | 6 +++--- packages/graphiql-react/CHANGELOG.md | 6 ++++++ packages/graphiql-react/package.json | 2 +- packages/graphiql/CHANGELOG.md | 7 +++++++ packages/graphiql/package.json | 4 ++-- 10 files changed, 40 insertions(+), 18 deletions(-) delete mode 100644 .changeset/twenty-chicken-shout.md diff --git a/.changeset/twenty-chicken-shout.md b/.changeset/twenty-chicken-shout.md deleted file mode 100644 index 7c8626b1be3..00000000000 --- a/.changeset/twenty-chicken-shout.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@graphiql/react': patch ---- - -Fix TypeScript type of the `label` prop of the `Tooltip` component diff --git a/examples/graphiql-webpack/package.json b/examples/graphiql-webpack/package.json index 4d4f6b257a6..64bf041cae5 100644 --- a/examples/graphiql-webpack/package.json +++ b/examples/graphiql-webpack/package.json @@ -9,11 +9,11 @@ "start": "NODE_ENV=development webpack-cli serve" }, "dependencies": { - "@graphiql/plugin-code-exporter": "^3.0.0", - "@graphiql/plugin-explorer": "^3.0.0", + "@graphiql/plugin-code-exporter": "^3.0.1", + "@graphiql/plugin-explorer": "^3.0.1", "@graphiql/toolkit": "^0.9.1", - "@graphiql/react": "^0.22.0", - "graphiql": "^3.2.1", + "@graphiql/react": "^0.22.1", + "graphiql": "^3.2.2", "graphql": "^16.8.1", "graphql-ws": "^5.5.5", "react": "^18.2.0", diff --git a/packages/graphiql-plugin-code-exporter/CHANGELOG.md b/packages/graphiql-plugin-code-exporter/CHANGELOG.md index 0d1768cf5f1..78b3b38bf64 100644 --- a/packages/graphiql-plugin-code-exporter/CHANGELOG.md +++ b/packages/graphiql-plugin-code-exporter/CHANGELOG.md @@ -1,5 +1,12 @@ # @graphiql/plugin-code-exporter +## 3.0.1 + +### Patch Changes + +- Updated dependencies [[`224b43f5`](https://github.com/graphql/graphiql/commit/224b43f5473456f264a82998d48a34a441537f54)]: + - @graphiql/react@0.22.1 + ## 3.0.0 ### Patch Changes diff --git a/packages/graphiql-plugin-code-exporter/package.json b/packages/graphiql-plugin-code-exporter/package.json index 98fc44b86c0..7f4b2d55114 100644 --- a/packages/graphiql-plugin-code-exporter/package.json +++ b/packages/graphiql-plugin-code-exporter/package.json @@ -1,6 +1,6 @@ { "name": "@graphiql/plugin-code-exporter", - "version": "3.0.0", + "version": "3.0.1", "repository": { "type": "git", "url": "https://github.com/graphql/graphiql", @@ -33,13 +33,13 @@ "graphiql-code-exporter": "^3.0.3" }, "peerDependencies": { - "@graphiql/react": "^0.22.0", + "@graphiql/react": "^0.22.1", "graphql": "^15.5.0 || ^16.0.0", "react": "^16.8.0 || ^17 || ^18", "react-dom": "^16.8.0 || ^17 || ^18" }, "devDependencies": { - "@graphiql/react": "^0.22.0", + "@graphiql/react": "^0.22.1", "@vitejs/plugin-react": "^4.0.1", "graphql": "^16.8.1", "postcss-nesting": "^10.1.7", diff --git a/packages/graphiql-plugin-explorer/CHANGELOG.md b/packages/graphiql-plugin-explorer/CHANGELOG.md index 2a5d8f1a3e0..33b80a5f6cb 100644 --- a/packages/graphiql-plugin-explorer/CHANGELOG.md +++ b/packages/graphiql-plugin-explorer/CHANGELOG.md @@ -1,5 +1,12 @@ # @graphiql/plugin-explorer +## 3.0.1 + +### Patch Changes + +- Updated dependencies [[`224b43f5`](https://github.com/graphql/graphiql/commit/224b43f5473456f264a82998d48a34a441537f54)]: + - @graphiql/react@0.22.1 + ## 3.0.0 ### Patch Changes diff --git a/packages/graphiql-plugin-explorer/package.json b/packages/graphiql-plugin-explorer/package.json index a03d9c33d57..6af385e41ec 100644 --- a/packages/graphiql-plugin-explorer/package.json +++ b/packages/graphiql-plugin-explorer/package.json @@ -1,6 +1,6 @@ { "name": "@graphiql/plugin-explorer", - "version": "3.0.0", + "version": "3.0.1", "repository": { "type": "git", "url": "https://github.com/graphql/graphiql", @@ -32,13 +32,13 @@ "graphiql-explorer": "^0.9.0" }, "peerDependencies": { - "@graphiql/react": "^0.22.0", + "@graphiql/react": "^0.22.1", "graphql": "^15.5.0 || ^16.0.0", "react": "^16.8.0 || ^17 || ^18", "react-dom": "^16.8.0 || ^17 || ^18" }, "devDependencies": { - "@graphiql/react": "^0.22.0", + "@graphiql/react": "^0.22.1", "@vitejs/plugin-react": "^4.0.1", "graphql": "^16.8.1", "react": "^18.2.0", diff --git a/packages/graphiql-react/CHANGELOG.md b/packages/graphiql-react/CHANGELOG.md index 054c6d3a53e..15895848fcb 100644 --- a/packages/graphiql-react/CHANGELOG.md +++ b/packages/graphiql-react/CHANGELOG.md @@ -1,5 +1,11 @@ # @graphiql/react +## 0.22.1 + +### Patch Changes + +- [#3597](https://github.com/graphql/graphiql/pull/3597) [`224b43f5`](https://github.com/graphql/graphiql/commit/224b43f5473456f264a82998d48a34a441537f54) Thanks [@thomasheyenbrock](https://github.com/thomasheyenbrock)! - Fix TypeScript type of the `label` prop of the `Tooltip` component + ## 0.22.0 ### Minor Changes diff --git a/packages/graphiql-react/package.json b/packages/graphiql-react/package.json index fe8b9d67875..37c2a69330a 100644 --- a/packages/graphiql-react/package.json +++ b/packages/graphiql-react/package.json @@ -1,6 +1,6 @@ { "name": "@graphiql/react", - "version": "0.22.0", + "version": "0.22.1", "repository": { "type": "git", "url": "https://github.com/graphql/graphiql", diff --git a/packages/graphiql/CHANGELOG.md b/packages/graphiql/CHANGELOG.md index 9013a60141a..2cfd2642d34 100644 --- a/packages/graphiql/CHANGELOG.md +++ b/packages/graphiql/CHANGELOG.md @@ -1,5 +1,12 @@ # Change Log +## 3.2.2 + +### Patch Changes + +- Updated dependencies [[`224b43f5`](https://github.com/graphql/graphiql/commit/224b43f5473456f264a82998d48a34a441537f54)]: + - @graphiql/react@0.22.1 + ## 3.2.1 ### Patch Changes diff --git a/packages/graphiql/package.json b/packages/graphiql/package.json index 3e331d090b9..787cb1051d3 100644 --- a/packages/graphiql/package.json +++ b/packages/graphiql/package.json @@ -1,6 +1,6 @@ { "name": "graphiql", - "version": "3.2.1", + "version": "3.2.2", "description": "An graphical interactive in-browser GraphQL IDE.", "contributors": [ "Hyohyeon Jeong ", @@ -47,7 +47,7 @@ "webpack": "webpack-cli --config resources/webpack.config.js" }, "dependencies": { - "@graphiql/react": "^0.22.0", + "@graphiql/react": "^0.22.1", "@graphiql/toolkit": "^0.9.1", "graphql-language-service": "^5.2.0", "markdown-it": "^14.1.0" From 03ab3a6b76378591ef79a828d80cc69b0b8f2842 Mon Sep 17 00:00:00 2001 From: Thomas Heyenbrock Date: Tue, 14 May 2024 15:14:11 -0600 Subject: [PATCH 20/81] avoid Component.defaultProps for icon components (#3602) --- .changeset/nervous-numbers-push.md | 5 +++++ packages/graphiql-react/src/icons/{index.ts => index.tsx} | 7 +++++-- 2 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 .changeset/nervous-numbers-push.md rename packages/graphiql-react/src/icons/{index.ts => index.tsx} (95%) diff --git a/.changeset/nervous-numbers-push.md b/.changeset/nervous-numbers-push.md new file mode 100644 index 00000000000..0ad8006a086 --- /dev/null +++ b/.changeset/nervous-numbers-push.md @@ -0,0 +1,5 @@ +--- +'@graphiql/react': patch +--- + +Avoid using deprecated Component.defaultProps for icon titles diff --git a/packages/graphiql-react/src/icons/index.ts b/packages/graphiql-react/src/icons/index.tsx similarity index 95% rename from packages/graphiql-react/src/icons/index.ts rename to packages/graphiql-react/src/icons/index.tsx index bc4c4ad5758..34c0386ded6 100644 --- a/packages/graphiql-react/src/icons/index.ts +++ b/packages/graphiql-react/src/icons/index.tsx @@ -74,6 +74,9 @@ function generateIcon( .trimStart() .toLowerCase() + ' icon', ): FC> { - RawComponent.defaultProps = { title }; - return RawComponent; + function IconComponent(props: ComponentProps<'svg'>) { + return ; + } + IconComponent.displayName = RawComponent.name; + return IconComponent; } From aa6dbbb45bf51c1966537640fbe5c4f375735c8d Mon Sep 17 00:00:00 2001 From: Rikki Schulte Date: Tue, 28 May 2024 08:27:39 +0200 Subject: [PATCH 21/81] LSP Rewrite: fix many bugs, more LSP test coverage! (#3521) see: changelog entries --- .changeset/rotten-seahorses-fry.md | 46 + .changeset/silly-yaks-bathe.md | 15 + .changeset/wet-toes-mate.md | 72 ++ .github/workflows/pr.yml | 22 +- .nvmrc | 2 +- cspell.json | 2 +- .../monaco-graphql-react-vite/vite.config.ts | 19 + jest.config.base.js | 2 +- package.json | 8 +- packages/cm6-graphql/src/completions.ts | 9 +- packages/cm6-graphql/src/interfaces.ts | 7 +- .../src/__tests__/hint-test.ts | 43 +- packages/codemirror-graphql/src/hint.ts | 12 +- packages/codemirror-graphql/src/info.ts | 5 +- .../src/utils/getTypeInfo.ts | 2 + .../graphiql-react/src/editor/query-editor.ts | 9 +- packages/graphiql/test/afterDevServer.js | 1 + packages/graphiql/test/e2e-server.js | 8 +- .../graphql-language-service-server/README.md | 41 +- .../package.json | 12 +- .../src/GraphQLCache.ts | 261 +++-- .../src/GraphQLLanguageService.ts | 144 ++- .../src/Logger.ts | 24 +- .../src/MessageProcessor.ts | 872 +++++++++------- ...phQLCache-test.ts => GraphQLCache.test.ts} | 0 ...test.ts => GraphQLLanguageService.test.ts} | 52 +- .../src/__tests__/Logger.test.ts | 39 + .../src/__tests__/MessageProcessor-test.ts | 601 ----------- .../src/__tests__/MessageProcessor.spec.ts | 610 +++++++++++ .../src/__tests__/MessageProcessor.test.ts | 981 ++++++++++++++++++ .../src/__tests__/__utils__/MockProject.ts | 197 ++++ .../src/__tests__/__utils__/runServer.js | 1 + .../src/__tests__/__utils__/utils.ts | 4 + ...QLTags-test.ts => findGraphQLTags.test.ts} | 68 +- ...Document-test.ts => parseDocument.test.ts} | 61 +- .../src/__tests__/startServer.spec.ts | 41 + .../src/__tests__/startServer.test.ts | 109 ++ .../src/common.ts | 53 + .../src/findGraphQLTags.ts | 56 +- .../src/index.ts | 1 + .../src/parsers/astro.ts | 9 +- .../src/parsers/babel.ts | 8 +- .../src/parsers/svelte.ts | 4 +- .../src/parsers/vue.ts | 4 +- .../src/startServer.ts | 149 +-- .../src/types.ts | 117 ++- .../graphql-language-service/src/index.ts | 9 +- .../__schema__/HoverTestSchema.graphql | 3 +- .../__schema__/StarWarsSchema.graphql | 8 + .../getAutocompleteSuggestions-test.ts | 414 +++++++- .../__tests__/getHoverInformation-test.ts | 16 + .../src/interface/autocompleteUtils.ts | 142 +-- .../interface/getAutocompleteSuggestions.ts | 615 ++++------- .../src/interface/getDefinition.ts | 73 +- .../src/interface/getHoverInformation.ts | 47 +- .../src/parser/api.ts | 207 ++++ .../src/parser/getTypeInfo.ts | 279 +++++ .../src/parser/index.ts | 11 + .../src/parser/types.ts | 5 +- .../graphql-language-service/src/types.ts | 25 +- .../src/utils/validateWithCustomRules.ts | 8 +- .../monaco-graphql/src/LanguageService.ts | 16 +- packages/monaco-graphql/src/api.ts | 7 +- packages/monaco-graphql/src/typings/index.ts | 27 +- packages/monaco-graphql/src/utils.ts | 11 +- .../monaco-graphql/test/monaco-editor.test.ts | 2 +- .../vscode-graphql-execution/package.json | 2 +- packages/vscode-graphql-syntax/README.md | 1 - packages/vscode-graphql-syntax/package.json | 21 +- .../tests/__fixtures__/test.astro | 30 + .../__snapshots__/js-grammar.spec.ts.snap | 64 ++ .../tests/js-grammar.spec.ts | 4 + packages/vscode-graphql/README.md | 230 ++-- packages/vscode-graphql/package.json | 41 +- .../custom-words.txt | 303 +++--- resources/prettierignore | 3 + yarn.lock | 171 ++- 77 files changed, 5206 insertions(+), 2392 deletions(-) create mode 100644 .changeset/rotten-seahorses-fry.md create mode 100644 .changeset/silly-yaks-bathe.md create mode 100644 .changeset/wet-toes-mate.md rename packages/graphql-language-service-server/src/__tests__/{GraphQLCache-test.ts => GraphQLCache.test.ts} (100%) rename packages/graphql-language-service-server/src/__tests__/{GraphQLLanguageService-test.ts => GraphQLLanguageService.test.ts} (78%) create mode 100644 packages/graphql-language-service-server/src/__tests__/Logger.test.ts delete mode 100644 packages/graphql-language-service-server/src/__tests__/MessageProcessor-test.ts create mode 100644 packages/graphql-language-service-server/src/__tests__/MessageProcessor.spec.ts create mode 100644 packages/graphql-language-service-server/src/__tests__/MessageProcessor.test.ts create mode 100644 packages/graphql-language-service-server/src/__tests__/__utils__/MockProject.ts create mode 100644 packages/graphql-language-service-server/src/__tests__/__utils__/runServer.js create mode 100644 packages/graphql-language-service-server/src/__tests__/__utils__/utils.ts rename packages/graphql-language-service-server/src/__tests__/{findGraphQLTags-test.ts => findGraphQLTags.test.ts} (89%) rename packages/graphql-language-service-server/src/__tests__/{parseDocument-test.ts => parseDocument.test.ts} (90%) create mode 100644 packages/graphql-language-service-server/src/__tests__/startServer.spec.ts create mode 100644 packages/graphql-language-service-server/src/__tests__/startServer.test.ts create mode 100644 packages/graphql-language-service-server/src/common.ts create mode 100644 packages/graphql-language-service/src/parser/api.ts create mode 100644 packages/graphql-language-service/src/parser/getTypeInfo.ts create mode 100644 packages/vscode-graphql-syntax/tests/__fixtures__/test.astro rename custom-words.txt => resources/custom-words.txt (98%) create mode 100644 resources/prettierignore diff --git a/.changeset/rotten-seahorses-fry.md b/.changeset/rotten-seahorses-fry.md new file mode 100644 index 00000000000..7347f6d0a92 --- /dev/null +++ b/.changeset/rotten-seahorses-fry.md @@ -0,0 +1,46 @@ +--- +'graphql-language-service-server': minor +'vscode-graphql': minor +'graphql-language-service-server-cli': minor +--- + +Fix many schema and fragment lifecycle issues, not all of them, but many related to cacheing. +Note: this makes `cacheSchemaForLookup` enabled by default again for schema first contexts. + +This fixes multiple cacheing bugs, upon addomg some in-depth integration test coverage for the LSP server. +It also solves several bugs regarding loading config types, and properly restarts the server and invalidates schema when there are config changes. + +### Bugfix Summary + +- configurable polling updates for network and other code first schema configuration, set to a 30s interval by default. powered by `schemaCacheTTL` which can be configured in the IDE settings (vscode, nvim) or in the graphql config file. (1) +- jump to definition in embedded files offset bug, for both fragments and code files with SDL strings +- cache invalidation for fragments (fragment lookup/autcoomplete data is more accurate, but incomplete/invalid fragments still do not autocomplete or validate, and remember fragment options always filter/validate by the `on` type!) +- schema cache invalidation for schema files - schema updates as you change the SDL files, and the generated file for code first by the `schemaCacheTTL` setting +- schema definition lookups & autocomplete crossing over into the wrong project + +**Notes** + +1. If possible, configuring for your locally running framework or a schema registry client to handle schema updates and output to a `schema.graphql` or `introspection.json` will always provide a better experience. many graphql frameworks have this built in! Otherwise, we must use this new lazy polling approach if you provide a url schema (this includes both introspection URLs and remote file URLs, and the combination of these). + +### Known Bugs Fixed + +- #3318 +- #2357 +- #3469 +- #2422 +- #2820 +- many more! + +### Test Improvements + +- new, high level integration spec suite for the LSP with a matching test utility +- more unit test coverage +- **total increased test coverage of about 25% in the LSP server codebase.** +- many "happy paths" covered for both schema and code first contexts +- many bugs revealed (and their source) + +### What's next? + +Another stage of the rewrite is already almost ready. This will fix even more bugs and improve memory usage, eliminate redundant parsing and ensure that graphql config's loaders do _all_ of the parsing and heavy lifting, thus honoring all the configs as well. It also significantly reduces the code complexity. + +There is also a plan to match Relay LSP's lookup config for either IDE (vscode, nvm, etc) settings as they provide, or by loading modules into your `graphql-config`! diff --git a/.changeset/silly-yaks-bathe.md b/.changeset/silly-yaks-bathe.md new file mode 100644 index 00000000000..d88566186a6 --- /dev/null +++ b/.changeset/silly-yaks-bathe.md @@ -0,0 +1,15 @@ +--- +'graphql-language-service': patch +'graphql-language-service-server': patch +'graphql-language-service-server-cli': patch +'codemirror-graphql': patch +'cm6-graphql': patch +'monaco-graphql': patch +'vscode-graphql': patch +--- + +Fixes several issues with Type System (SDL) completion across the ecosystem: + +- restores completion for object and input type fields when the document context is not detectable or parseable +- correct top-level completions for either of the unknown, type system or executable definitions. this leads to mixed top level completions when the document is unparseable, but now you are not seemingly restricted to only executable top level definitions +- `.graphqls` ad-hoc standard functionality remains, but is not required, as it is not part of the official spec, and the spec also allows mixed mode documents in theory, and this concept is required when the type is unknown diff --git a/.changeset/wet-toes-mate.md b/.changeset/wet-toes-mate.md new file mode 100644 index 00000000000..fa26a5470d6 --- /dev/null +++ b/.changeset/wet-toes-mate.md @@ -0,0 +1,72 @@ +--- +'graphql-language-service-server': minor +'vscode-graphql': patch +--- + +Introduce `locateCommand` based on Relay LSP `pathToLocateCommand`: + +Now with `.extensions.languageService.locateCommand`, you can specify either the [existing signature](https://marketplace.visualstudio.com/items?itemName=meta.relay#relay.pathtolocatecommand-default-null) for relay, with the same callback parameters and return signature. + +Relay LSP currently supports `Type` and `Type.field` for the 2nd argument. Ours also returns `Type.field(argument)` as a point of reference. It works with object types, input types, fragments, executable definitions and their fields, and should work for directive definitions as well. + +In the case of unnamed types such as fragment spreads, they return the name of the implemented type currently, but I'm curious what users prefer here. I assumed that some people may want to not be limited to only using this for SDL type definition lookups. Also look soon to see `locateCommand` support added for symbols, outline, and coming references and implementations. + +The module at the path you specify in relay LSP for `pathToLocateCommand` should work as such + +```ts +// import it +import { locateCommand } from './graphql/tooling/lsp/locate.js'; +export default { + languageService: { + locateCommand, + }, + + projects: { + a: { + schema: 'https://localhost:8000/graphql', + documents: './a/**/*.{ts,tsx,jsx,js,graphql}', + }, + b: { + schema: './schema/ascode.ts', + documents: './b/**/*.{ts,tsx,jsx,js,graphql}', + }, + }, +}; +``` + +```ts +// or define it inline + +import { type LocateCommand } from 'graphql-language-service-server'; + +// relay LSP style +const languageCommand = (projectName: string, typePath: string) => { + const { path, startLine, endLine } = ourLookupUtility(projectName, typePath); + return `${path}:${startLine}:${endLine}`; +}; + +// an example with our alternative return signature +const languageCommand: LocateCommand = (projectName, typePath, info) => { + // pass more info, such as GraphQLType with the ast node. info.project is also available if you need it + const { path, range } = ourLookupUtility( + projectName, + typePath, + info.type.node, + ); + return { uri: path, range }; // range.start.line/range.end.line +}; + +export default { + languageService: { + locateCommand, + }, + schema: 'https://localhost:8000/graphql', + documents: './**/*.{ts,tsx,jsx,js,graphql}', +}; +``` + +Passing a string as a module path to resolve is coming in a follow-up release. Then it can be used with `.yml`, `.toml`, `.json`, `package.json#graphql`, etc + +For now this was a quick baseline for a feature asked for in multiple channels! + +Let us know how this works, and about any other interoperability improvements between our graphql LSP and other language servers (relay, intellij, etc) used by you and colleauges in your engineering organisations. We are trying our best to keep up with the awesome innovations they have 👀! diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index b6c35bd1a43..4748bd5f52a 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -13,7 +13,6 @@ jobs: uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: - node-version: 16 cache: yarn - name: Cache node modules id: cache-modules @@ -37,8 +36,7 @@ jobs: steps: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 - with: - node-version: 16 + - id: cache-modules uses: actions/cache@v3 with: @@ -59,8 +57,6 @@ jobs: steps: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 - with: - node-version: 16 - id: cache-modules uses: actions/cache@v3 with: @@ -76,8 +72,6 @@ jobs: steps: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 - with: - node-version: 16 - id: cache-modules uses: actions/cache@v3 with: @@ -87,14 +81,12 @@ jobs: - run: yarn pretty-check jest: - name: Jest Unit Tests + name: Jest Unit & Integration 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: @@ -117,8 +109,7 @@ jobs: steps: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 - with: - node-version: 16 + - id: cache-modules uses: actions/cache@v3 with: @@ -140,8 +131,7 @@ jobs: steps: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 - with: - node-version: 16 + - id: cache-modules uses: actions/cache@v3 with: @@ -205,8 +195,6 @@ jobs: with: fetch-depth: 0 - uses: actions/setup-node@v3 - with: - node-version: 16 - id: cache-modules uses: actions/cache@v3 with: @@ -264,8 +252,6 @@ jobs: steps: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 - with: - node-version: 16 - id: cache-modules uses: actions/cache@v3 with: diff --git a/.nvmrc b/.nvmrc index 19c7bdba7b1..209e3ef4b62 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -16 \ No newline at end of file +20 diff --git a/cspell.json b/cspell.json index 24ff11ab942..9b714e08196 100644 --- a/cspell.json +++ b/cspell.json @@ -9,7 +9,7 @@ "dictionaryDefinitions": [ { "name": "custom-words", - "path": "./custom-words.txt", + "path": "./resources/custom-words.txt", "addWords": true } ], diff --git a/examples/monaco-graphql-react-vite/vite.config.ts b/examples/monaco-graphql-react-vite/vite.config.ts index 889998bbc5b..0d600ec16f2 100644 --- a/examples/monaco-graphql-react-vite/vite.config.ts +++ b/examples/monaco-graphql-react-vite/vite.config.ts @@ -19,5 +19,24 @@ export default defineConfig({ }, ], }), + watchPackages(['monaco-graphql', 'graphql-language-service']), ], }); + +function watchPackages(packageNames: string[]) { + let isWatching = false; + + return { + name: 'vite-plugin-watch-packages', + + buildStart() { + if (!isWatching) { + for (const packageName of packageNames) { + this.addWatchFile(require.resolve(packageName)); + } + + isWatching = true; + } + }, + }; +} diff --git a/jest.config.base.js b/jest.config.base.js index 15e87eda8f8..62e5eacd442 100644 --- a/jest.config.base.js +++ b/jest.config.base.js @@ -43,7 +43,7 @@ module.exports = (dir, env = 'jsdom') => { 'node_modules', '__tests__', 'resources', - 'test', + 'examples', '.d.ts', 'types.ts', diff --git a/package.json b/package.json index 21399374029..ddf616af046 100644 --- a/package.json +++ b/package.json @@ -15,12 +15,12 @@ "lint-staged": { "*.{js,ts,jsx,tsx}": [ "eslint --cache --fix", - "prettier --write --ignore-path .eslintignore", + "prettier --write --ignore-path .eslintignore --ignore-path resources/prettierignore", "jest --passWithNoTests", "yarn lint-cspell" ], "*.{md,html,json,css}": [ - "prettier --write --ignore-path .eslintignore", + "prettier --write --ignore-path .eslintignore --ignore-path resources/prettierignore", "yarn lint-cspell" ] }, @@ -43,7 +43,7 @@ "build:watch": "yarn tsc --watch", "build-demo": "wsrun -m build-demo", "watch": "yarn build:watch", - "watch-vscode": "yarn workspace vscode-graphql compile", + "watch-vscode": "yarn tsc && yarn workspace vscode-graphql compile", "watch-vscode-exec": "yarn workspace vscode-graphql-execution compile", "check": "yarn tsc --noEmit", "cypress-open": "yarn workspace graphiql cypress-open", @@ -62,7 +62,7 @@ "prepublishOnly": "./scripts/prepublish.sh", "postbuild": "wsrun --exclude-missing postbuild", "pretty": "yarn pretty-check --write", - "pretty-check": "prettier --cache --check --ignore-path .gitignore --ignore-path .eslintignore .", + "pretty-check": "prettier --cache --check --ignore-path .gitignore --ignore-path resources/prettierignore --ignore-path .eslintignore .", "ci:version": "yarn changeset version && yarn build && yarn format", "release": "yarn build && yarn build-bundles && (wsrun release --exclude-missing --serial --recursive --changedSince main -- || true) && yarn changeset publish", "release:canary": "(node scripts/canary-release.js && yarn build-bundles && yarn changeset publish --tag canary) || echo Skipping Canary...", diff --git a/packages/cm6-graphql/src/completions.ts b/packages/cm6-graphql/src/completions.ts index 27131cf6975..383c69eb7c3 100644 --- a/packages/cm6-graphql/src/completions.ts +++ b/packages/cm6-graphql/src/completions.ts @@ -26,7 +26,14 @@ export const completion = graphqlLanguage.data.of({ } const val = ctx.state.doc.toString(); const pos = offsetToPos(ctx.state.doc, ctx.pos); - const results = getAutocompleteSuggestions(schema, val, pos); + const results = getAutocompleteSuggestions( + schema, + val, + pos, + undefined, + undefined, + opts?.autocompleteOptions, + ); if (results.length === 0) { return null; diff --git a/packages/cm6-graphql/src/interfaces.ts b/packages/cm6-graphql/src/interfaces.ts index f4128928dba..10ab2f2a153 100644 --- a/packages/cm6-graphql/src/interfaces.ts +++ b/packages/cm6-graphql/src/interfaces.ts @@ -1,7 +1,11 @@ import { Completion, CompletionContext } from '@codemirror/autocomplete'; import { EditorView } from '@codemirror/view'; import { GraphQLSchema } from 'graphql'; -import { ContextToken, CompletionItem } from 'graphql-language-service'; +import { + ContextToken, + CompletionItem, + AutocompleteSuggestionOptions, +} from 'graphql-language-service'; import { Position } from './helpers'; export interface GqlExtensionsOptions { showErrorOnInvalidSchema?: boolean; @@ -18,4 +22,5 @@ export interface GqlExtensionsOptions { ctx: CompletionContext, item: Completion, ) => Node | Promise | null; + autocompleteOptions?: AutocompleteSuggestionOptions; } diff --git a/packages/codemirror-graphql/src/__tests__/hint-test.ts b/packages/codemirror-graphql/src/__tests__/hint-test.ts index c71d70a0798..4324ce5eef7 100644 --- a/packages/codemirror-graphql/src/__tests__/hint-test.ts +++ b/packages/codemirror-graphql/src/__tests__/hint-test.ts @@ -32,6 +32,7 @@ import { UnionFirst, UnionSecond, } from './testSchema'; +import { GraphQLDocumentMode } from 'graphql-language-service'; function createEditorWithHint() { return CodeMirror(document.createElement('div'), { @@ -45,7 +46,11 @@ function createEditorWithHint() { }); } -function getHintSuggestions(queryString: string, cursor: CodeMirror.Position) { +function getHintSuggestions( + queryString: string, + cursor: CodeMirror.Position, + opts?: GraphQLHintOptions, +) { const editor = createEditorWithHint(); return new Promise(resolve => { @@ -54,7 +59,7 @@ function getHintSuggestions(queryString: string, cursor: CodeMirror.Position) { cm: CodeMirror.Editor, options: GraphQLHintOptions, ) => { - const result = graphqlHint(cm, options); + const result = graphqlHint(cm, { ...opts, ...options }); resolve(result); CodeMirror.hint.graphql = graphqlHint; return result; @@ -82,14 +87,38 @@ describe('graphql-hint', () => { expect(editor.getHelpers(editor.getCursor(), 'hint')).not.toHaveLength(0); }); - it('provides correct initial keywords', async () => { + it('provides correct initial keywords for executable definitions', async () => { + const suggestions = await getHintSuggestions( + '', + { line: 0, ch: 0 }, + { autocompleteOptions: { mode: GraphQLDocumentMode.EXECUTABLE } }, + ); + const list = [ + { text: 'query' }, + { text: 'mutation' }, + { text: 'subscription' }, + { text: 'fragment' }, + { text: '{' }, + ]; + const expectedSuggestions = getExpectedSuggestions(list); + expect(suggestions?.list).toEqual(expectedSuggestions); + }); + + it('provides correct initial keywords for unknown definitions', async () => { const suggestions = await getHintSuggestions('', { line: 0, ch: 0 }); const list = [ + { text: 'extend' }, { text: 'query' }, { text: 'mutation' }, { text: 'subscription' }, { text: 'fragment' }, { text: '{' }, + { text: 'type' }, + { text: 'interface' }, + { text: 'union' }, + { text: 'input' }, + { text: 'scalar' }, + { text: 'schema' }, ]; const expectedSuggestions = getExpectedSuggestions(list); expect(suggestions?.list).toEqual(expectedSuggestions); @@ -946,8 +975,8 @@ describe('graphql-hint', () => { description: 'The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID.', }, - { text: 'TestEnum' }, - { text: 'TestInput' }, + { text: 'TestEnum', description: '' }, + { text: 'TestInput', description: '' }, { text: '__TypeKind', description: @@ -993,8 +1022,8 @@ describe('graphql-hint', () => { description: 'The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID.', }, - { text: 'TestEnum' }, - { text: 'TestInput' }, + { text: 'TestEnum', description: '' }, + { text: 'TestInput', description: '' }, { text: '__TypeKind', description: diff --git a/packages/codemirror-graphql/src/hint.ts b/packages/codemirror-graphql/src/hint.ts index a3a0ae0e308..e3606c94cf1 100644 --- a/packages/codemirror-graphql/src/hint.ts +++ b/packages/codemirror-graphql/src/hint.ts @@ -13,12 +13,16 @@ import CodeMirror, { Hints, Hint } from 'codemirror'; import 'codemirror/addon/hint/show-hint'; import { FragmentDefinitionNode, GraphQLSchema, GraphQLType } from 'graphql'; -import type { Maybe } from 'graphql-language-service'; +import type { + AutocompleteSuggestionOptions, + Maybe, +} from 'graphql-language-service'; import { getAutocompleteSuggestions, Position } from 'graphql-language-service'; export interface GraphQLHintOptions { schema?: GraphQLSchema; externalFragments?: string | FragmentDefinitionNode[]; + autocompleteOptions?: AutocompleteSuggestionOptions; } interface IHint extends Hint { @@ -70,7 +74,7 @@ CodeMirror.registerHelper( editor: CodeMirror.Editor, options: GraphQLHintOptions, ): IHints | undefined => { - const { schema, externalFragments } = options; + const { schema, externalFragments, autocompleteOptions } = options; if (!schema) { return; } @@ -91,11 +95,13 @@ CodeMirror.registerHelper( position, token, externalFragments, + autocompleteOptions, ); const results = { list: rawResults.map(item => ({ - text: item.label, + // important! for when the label is different from the insert text + text: item?.rawInsert ?? item.label, type: item.type, description: item.documentation, isDeprecated: item.isDeprecated, diff --git a/packages/codemirror-graphql/src/info.ts b/packages/codemirror-graphql/src/info.ts index 4b57bf1fecd..4f6352969a8 100644 --- a/packages/codemirror-graphql/src/info.ts +++ b/packages/codemirror-graphql/src/info.ts @@ -63,13 +63,13 @@ CodeMirror.registerHelper( } const { kind, step } = token.state; const typeInfo = getTypeInfo(options.schema, token.state); - // Given a Schema and a Token, produce the contents of an info tooltip. // To do this, create a div element that we will render "into" and then pass // it to various rendering functions. if ( (kind === 'Field' && step === 0 && typeInfo.fieldDef) || - (kind === 'AliasedField' && step === 2 && typeInfo.fieldDef) + (kind === 'AliasedField' && step === 2 && typeInfo.fieldDef) || + (kind === 'ObjectField' && step === 0 && typeInfo.fieldDef) ) { const header = document.createElement('div'); header.className = 'CodeMirror-info-header'; @@ -79,6 +79,7 @@ CodeMirror.registerHelper( renderDescription(into, options, typeInfo.fieldDef as any); return into; } + if (kind === 'Directive' && step === 1 && typeInfo.directiveDef) { const header = document.createElement('div'); header.className = 'CodeMirror-info-header'; diff --git a/packages/codemirror-graphql/src/utils/getTypeInfo.ts b/packages/codemirror-graphql/src/utils/getTypeInfo.ts index d61d172e126..6e14588d4d9 100644 --- a/packages/codemirror-graphql/src/utils/getTypeInfo.ts +++ b/packages/codemirror-graphql/src/utils/getTypeInfo.ts @@ -147,6 +147,8 @@ export default function getTypeInfo(schema: GraphQLSchema, tokenState: State) { ? info.objectFieldDefs[state.name] : null; info.inputType = objectField?.type; + // @ts-expect-error + info.fieldDef = objectField; break; case 'NamedType': info.type = state.name ? schema.getType(state.name) : null; diff --git a/packages/graphiql-react/src/editor/query-editor.ts b/packages/graphiql-react/src/editor/query-editor.ts index 33147427dd2..48c8aec4f97 100644 --- a/packages/graphiql-react/src/editor/query-editor.ts +++ b/packages/graphiql-react/src/editor/query-editor.ts @@ -6,7 +6,10 @@ import type { GraphQLSchema, ValidationRule, } from 'graphql'; -import { getOperationFacts } from 'graphql-language-service'; +import { + getOperationFacts, + GraphQLDocumentMode, +} from 'graphql-language-service'; import { MutableRefObject, useCallback, @@ -186,6 +189,10 @@ export function useQueryEditor( completeSingle: false, container, externalFragments: undefined, + autocompleteOptions: { + // for the query editor, restrict to executable type definitions + mode: GraphQLDocumentMode.EXECUTABLE, + }, }, info: { schema: undefined, diff --git a/packages/graphiql/test/afterDevServer.js b/packages/graphiql/test/afterDevServer.js index d47ef13f274..cf055ee66be 100644 --- a/packages/graphiql/test/afterDevServer.js +++ b/packages/graphiql/test/afterDevServer.js @@ -10,4 +10,5 @@ module.exports = function afterDevServer(_app, _server, _compiler) { }); // eslint-disable-next-line react-hooks/rules-of-hooks useServer({ schema }, wsServer); + return wsServer; }; diff --git a/packages/graphiql/test/e2e-server.js b/packages/graphiql/test/e2e-server.js index a714e5be590..d3847bcad4e 100644 --- a/packages/graphiql/test/e2e-server.js +++ b/packages/graphiql/test/e2e-server.js @@ -43,7 +43,9 @@ app.post('/graphql-error/graphql', (_req, res, next) => { app.use(express.static(path.resolve(__dirname, '../'))); app.use('index.html', express.static(path.resolve(__dirname, '../dev.html'))); -app.listen(process.env.PORT || 0, function () { +// messy but it allows close +const server = require('node:http').createServer(app); +server.listen(process.env.PORT || 3100, function () { const { port } = this.address(); console.log(`Started on http://localhost:${port}/`); @@ -56,5 +58,7 @@ app.listen(process.env.PORT || 0, function () { process.exit(); }); }); +const wsServer = WebSocketsServer(); -WebSocketsServer(); +module.exports.server = server; +module.exports.wsServer = wsServer; diff --git a/packages/graphql-language-service-server/README.md b/packages/graphql-language-service-server/README.md index d0f5388cd9a..cff8af15e0d 100644 --- a/packages/graphql-language-service-server/README.md +++ b/packages/graphql-language-service-server/README.md @@ -123,6 +123,9 @@ further customization: ```ts import { loadConfig } from 'graphql-config'; // 3.0.0 or later! +// with required params +const config = await loadConfig(); + await startServer({ method: 'node', // or instead of configName, an exact path (relative from rootDir or absolute) @@ -131,7 +134,7 @@ await startServer({ // configDir: '', loadConfigOptions: { // any of the options for graphql-config@3 `loadConfig()` - + schema: await config.getSchema(), // rootDir is same as `configDir` before, the path where the graphql config file would be found by cosmic-config rootDir: 'config/', // or - the relative or absolute path to your file @@ -157,11 +160,29 @@ module.exports = { // note that this file will be loaded by the vscode runtime, so the node version and other factors will come into play customValidationRules: require('./config/customValidationRules'), languageService: { - // should the language service read schema for definition lookups from a cached file based on graphql config output? + // this is enabled by default if non-local files are specified in the project `schema` // NOTE: this will disable all definition lookup for local SDL files cacheSchemaFileForLookup: true, // undefined by default which has the same effect as `true`, set to `false` if you are already using // `graphql-eslint` or some other tool for validating graphql in your IDE. Must be explicitly `false` to disable this feature, not just "falsy" enableValidation: true, + // (experimental) enhanced auto expansion of graphql leaf fields and arguments + fillLeafsOnComplete: true, + // instead of jumping directly to the SDL file, you can override definition peek/jump results to point to different files or locations + // (for example, source files for your schema in any language!) + // based on Relay vscode's pathToLocateCommand + // see LocateCommand type! + locateCommand(projectName, typePath, info) { + // pass more info, such as GraphQLType with the ast node. info.project is also available if you need it + const { path, range } = ourLookupUtility( + projectName, + typePath, + info.type.node, + ); + return { uri: path, range }; // range.start.line/range.end.character/etc, base 1 + // you can also return relay LSP style + // return '/path/to/file.py:20:23'; // (range: 20:1 ) + // return '/path/to/file.py'; // (range: 1:1 1:1) + }, }, }, }; @@ -237,14 +258,14 @@ via `initializationOptions` in nvim.coc. The options are mostly designed to configure graphql-config's load parameters, the only thing we can't configure with graphql config. The final option can be set in `graphql-config` as well -| Parameter | Default | Description | -| ----------------------------------------- | ------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `graphql-config.load.baseDir` | workspace root or process.cwd() | the path where graphql config looks for config files | -| `graphql-config.load.filePath` | `null` | exact filepath of the config file. | -| `graphql-config.load.configName` | `graphql` | config name prefix instead of `graphql` | -| `graphql-config.load.legacy` | `true` | backwards compatibility with `graphql-config@2` | -| `graphql-config.dotEnvPath` | `null` | backwards compatibility with `graphql-config@2` | -| `vscode-graphql.cacheSchemaFileForLookup` | `false` | generate an SDL file based on your graphql-config schema configuration for schema definition lookup and other features. useful when your `schema` config are urls | +| Parameter | Default | Description | +| ----------------------------------------- | ------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `graphql-config.load.baseDir` | workspace root or process.cwd() | the path where graphql config looks for config files | +| `graphql-config.load.filePath` | `null` | exact filepath of the config file. | +| `graphql-config.load.configName` | `graphql` | config name prefix instead of `graphql` | +| `graphql-config.load.legacy` | `true` | backwards compatibility with `graphql-config@2` | +| `graphql-config.dotEnvPath` | `null` | backwards compatibility with `graphql-config@2` | +| `vscode-graphql.cacheSchemaFileForLookup` | `true` if `schema` contains non-sdl files or urls | generate an SDL file based on your graphql-config schema configuration for schema definition lookup and other features. enabled by default when your `schema` config are urls or introspection json, or if you have any non-local SDL files in `schema` | all the `graphql-config.load.*` configuration values come from static `loadConfig()` options in graphql config. diff --git a/packages/graphql-language-service-server/package.json b/packages/graphql-language-service-server/package.json index d4cd4eaceff..c7eba908a12 100644 --- a/packages/graphql-language-service-server/package.json +++ b/packages/graphql-language-service-server/package.json @@ -36,35 +36,37 @@ "peerDependencies": { "graphql": "^15.5.0 || ^16.0.0" }, - "COMMENT": "please do not remove depenencies without thorough testing. many dependencies are not imported directly, as they are peer dependencies", + "COMMENT": "please do not remove dependencies without thorough testing. many dependencies are not imported directly, as they are peer dependencies", "dependencies": { - "@astrojs/compiler": "^2.5.0", + "@astrojs/compiler": "^2.8.0", "@babel/parser": "^7.23.6", "@babel/types": "^7.23.5", "@graphql-tools/code-file-loader": "8.0.3", "@vue/compiler-sfc": "^3.4.5", - "astrojs-compiler-sync": "^0.3.5", + "astrojs-compiler-sync": "^1.0.0", "cosmiconfig-toml-loader": "^1.0.0", "dotenv": "10.0.0", "fast-glob": "^3.2.7", "glob": "^7.2.0", "graphql-config": "5.0.3", "graphql-language-service": "^5.2.0", + "lru-cache": "^10.2.0", "mkdirp": "^1.0.4", "node-abort-controller": "^3.0.1", "nullthrows": "^1.0.0", "source-map-js": "1.0.2", "svelte": "^4.1.1", "svelte2tsx": "^0.7.0", + "typescript": "^5.3.3", "vscode-jsonrpc": "^8.0.1", "vscode-languageserver": "^8.0.1", "vscode-languageserver-types": "^3.17.2", - "vscode-uri": "^3.0.2", - "typescript": "^5.3.3" + "vscode-uri": "^3.0.2" }, "devDependencies": { "@types/glob": "^8.1.0", "@types/mkdirp": "^1.0.1", + "@types/mock-fs": "^4.13.4", "cross-env": "^7.0.2", "graphql": "^16.8.1", "mock-fs": "^5.2.0" diff --git a/packages/graphql-language-service-server/src/GraphQLCache.ts b/packages/graphql-language-service-server/src/GraphQLCache.ts index f7b043e5676..fb3c367b755 100644 --- a/packages/graphql-language-service-server/src/GraphQLCache.ts +++ b/packages/graphql-language-service-server/src/GraphQLCache.ts @@ -20,7 +20,6 @@ import { } from 'graphql'; import type { CachedContent, - GraphQLCache as GraphQLCacheInterface, GraphQLFileMetadata, GraphQLFileInfo, FragmentInfo, @@ -46,18 +45,29 @@ import stringToHash from './stringToHash'; import glob from 'glob'; import { LoadConfigOptions } from './types'; import { URI } from 'vscode-uri'; -import { CodeFileLoader } from '@graphql-tools/code-file-loader'; +import { + CodeFileLoader, + CodeFileLoaderConfig, +} from '@graphql-tools/code-file-loader'; import { DEFAULT_SUPPORTED_EXTENSIONS, DEFAULT_SUPPORTED_GRAPHQL_EXTENSIONS, } from './constants'; import { NoopLogger, Logger } from './Logger'; +import { LRUCache } from 'lru-cache'; + +const codeLoaderConfig: CodeFileLoaderConfig = { + noSilentErrors: false, + pluckConfig: { + skipIndent: true, + }, +}; const LanguageServiceExtension: GraphQLExtensionDeclaration = api => { // For schema - api.loaders.schema.register(new CodeFileLoader()); + api.loaders.schema.register(new CodeFileLoader(codeLoaderConfig)); // For documents - api.loaders.documents.register(new CodeFileLoader()); + api.loaders.documents.register(new CodeFileLoader(codeLoaderConfig)); return { name: 'languageService' }; }; @@ -65,16 +75,20 @@ const LanguageServiceExtension: GraphQLExtensionDeclaration = api => { // Maximum files to read when processing GraphQL files. const MAX_READS = 200; +export type OnSchemaChange = (project: GraphQLProjectConfig) => void; + export async function getGraphQLCache({ parser, logger, loadConfigOptions, config, + onSchemaChange, }: { parser: typeof parseDocument; logger: Logger | NoopLogger; loadConfigOptions: LoadConfigOptions; config?: GraphQLConfig; + onSchemaChange?: OnSchemaChange; }): Promise { const graphQLConfig = config || @@ -90,10 +104,11 @@ export async function getGraphQLCache({ config: graphQLConfig!, parser, logger, + onSchemaChange, }); } -export class GraphQLCache implements GraphQLCacheInterface { +export class GraphQLCache { _configDir: Uri; _graphQLFileListCache: Map>; _graphQLConfig: GraphQLConfig; @@ -103,34 +118,51 @@ export class GraphQLCache implements GraphQLCacheInterface { _typeDefinitionsCache: Map>; _parser: typeof parseDocument; _logger: Logger | NoopLogger; + _onSchemaChange?: OnSchemaChange; constructor({ configDir, config, parser, logger, + onSchemaChange, }: { configDir: Uri; config: GraphQLConfig; parser: typeof parseDocument; logger: Logger | NoopLogger; + onSchemaChange?: OnSchemaChange; }) { this._configDir = configDir; this._graphQLConfig = config; this._graphQLFileListCache = new Map(); - this._schemaMap = new Map(); + this._schemaMap = new LRUCache({ + max: 20, + ttl: 1000 * 30, + ttlAutopurge: true, + updateAgeOnGet: false, + }); this._fragmentDefinitionsCache = new Map(); this._typeDefinitionsCache = new Map(); this._typeExtensionMap = new Map(); this._parser = parser; this._logger = logger; + this._onSchemaChange = onSchemaChange; } getGraphQLConfig = (): GraphQLConfig => this._graphQLConfig; getProjectForFile = (uri: string): GraphQLProjectConfig | void => { try { - return this._graphQLConfig.getProjectForFile(URI.parse(uri).fsPath); + const project = this._graphQLConfig.getProjectForFile( + URI.parse(uri).fsPath, + ); + if (!project.documents) { + this._logger.warn( + `No documents configured for project ${project.name}. Many features will not work correctly.`, + ); + } + return project; } catch (err) { this._logger.error( `there was an error loading the project config for this file ${err}`, @@ -236,29 +268,6 @@ export class GraphQLCache implements GraphQLCacheInterface { return fragmentDefinitions; }; - getObjectTypeDependencies = async ( - query: string, - objectTypeDefinitions?: Map, - ): Promise> => { - // If there isn't context for object type references, - // return an empty array. - if (!objectTypeDefinitions) { - return []; - } - // If the query cannot be parsed, validations cannot happen yet. - // Return an empty array. - let parsedQuery; - try { - parsedQuery = parse(query); - } catch { - return []; - } - return this.getObjectTypeDependenciesForAST( - parsedQuery, - objectTypeDefinitions, - ); - }; - getObjectTypeDependenciesForAST = async ( parsedQuery: ASTNode, objectTypeDefinitions: Map, @@ -424,38 +433,12 @@ export class GraphQLCache implements GraphQLCacheInterface { return patterns; }; - async _updateGraphQLFileListCache( - graphQLFileMap: Map, - metrics: { size: number; mtime: number }, - filePath: Uri, - exists: boolean, - ): Promise> { - const fileAndContent = exists - ? await this.promiseToReadGraphQLFile(filePath) - : null; - - const existingFile = graphQLFileMap.get(filePath); - - // 3 cases for the cache invalidation: create/modify/delete. - // For create/modify, swap the existing entry if available; - // otherwise, just push in the new entry created. - // For delete, check `exists` and splice the file out. - if (existingFile && !exists) { - graphQLFileMap.delete(filePath); - } else if (fileAndContent) { - const graphQLFileInfo = { ...fileAndContent, ...metrics }; - graphQLFileMap.set(filePath, graphQLFileInfo); - } - - return graphQLFileMap; - } - async updateFragmentDefinition( - rootDir: Uri, + projectCacheKey: Uri, filePath: Uri, contents: Array, ): Promise { - const cache = this._fragmentDefinitionsCache.get(rootDir); + const cache = this._fragmentDefinitionsCache.get(projectCacheKey); const asts = contents.map(({ query }) => { try { return { @@ -473,55 +456,44 @@ export class GraphQLCache implements GraphQLCacheInterface { cache.delete(key); } } - for (const { ast, query } of asts) { - if (!ast) { - continue; - } - for (const definition of ast.definitions) { - if (definition.kind === Kind.FRAGMENT_DEFINITION) { - cache.set(definition.name.value, { - filePath, - content: query, - definition, - }); - } - } - } + this._setFragmentCache(asts, cache, filePath); + } else { + const newFragmentCache = this._setFragmentCache( + asts, + new Map(), + filePath, + ); + this._fragmentDefinitionsCache.set(projectCacheKey, newFragmentCache); } } - - async updateFragmentDefinitionCache( - rootDir: Uri, - filePath: Uri, - exists: boolean, - ): Promise { - const fileAndContent = exists - ? await this.promiseToReadGraphQLFile(filePath) - : null; - // In the case of fragment definitions, the cache could just map the - // definition name to the parsed ast, whether or not it existed - // previously. - // For delete, remove the entry from the set. - if (!exists) { - const cache = this._fragmentDefinitionsCache.get(rootDir); - if (cache) { - cache.delete(filePath); + _setFragmentCache( + asts: { ast: DocumentNode | null; query: string }[], + fragmentCache: Map, + filePath: string | undefined, + ) { + for (const { ast, query } of asts) { + if (!ast) { + continue; + } + for (const definition of ast.definitions) { + if (definition.kind === Kind.FRAGMENT_DEFINITION) { + fragmentCache.set(definition.name.value, { + filePath, + content: query, + definition, + }); + } } - } else if (fileAndContent?.queries) { - await this.updateFragmentDefinition( - rootDir, - filePath, - fileAndContent.queries, - ); } + return fragmentCache; } async updateObjectTypeDefinition( - rootDir: Uri, + projectCacheKey: Uri, filePath: Uri, contents: Array, ): Promise { - const cache = this._typeDefinitionsCache.get(rootDir); + const cache = this._typeDefinitionsCache.get(projectCacheKey); const asts = contents.map(({ query }) => { try { return { @@ -539,47 +511,32 @@ export class GraphQLCache implements GraphQLCacheInterface { cache.delete(key); } } - for (const { ast, query } of asts) { - if (!ast) { - continue; - } - for (const definition of ast.definitions) { - if (isTypeDefinitionNode(definition)) { - cache.set(definition.name.value, { - filePath, - content: query, - definition, - }); - } - } - } + this._setDefinitionCache(asts, cache, filePath); + } else { + const newTypeCache = this._setDefinitionCache(asts, new Map(), filePath); + this._typeDefinitionsCache.set(projectCacheKey, newTypeCache); } } - - async updateObjectTypeDefinitionCache( - rootDir: Uri, - filePath: Uri, - exists: boolean, - ): Promise { - const fileAndContent = exists - ? await this.promiseToReadGraphQLFile(filePath) - : null; - // In the case of type definitions, the cache could just map the - // definition name to the parsed ast, whether or not it existed - // previously. - // For delete, remove the entry from the set. - if (!exists) { - const cache = this._typeDefinitionsCache.get(rootDir); - if (cache) { - cache.delete(filePath); + _setDefinitionCache( + asts: { ast: DocumentNode | null; query: string }[], + typeCache: Map, + filePath: string | undefined, + ) { + for (const { ast, query } of asts) { + if (!ast) { + continue; + } + for (const definition of ast.definitions) { + if (isTypeDefinitionNode(definition)) { + typeCache.set(definition.name.value, { + filePath, + content: query, + definition, + }); + } } - } else if (fileAndContent?.queries) { - await this.updateObjectTypeDefinition( - rootDir, - filePath, - fileAndContent.queries, - ); } + return typeCache; } _extendSchema( @@ -645,10 +602,10 @@ export class GraphQLCache implements GraphQLCacheInterface { } getSchema = async ( - appName?: string, + projectName: string, queryHasExtensions?: boolean | null, ): Promise => { - const projectConfig = this._graphQLConfig.getProject(appName); + const projectConfig = this._graphQLConfig.getProject(projectName); if (!projectConfig) { return null; @@ -663,18 +620,35 @@ export class GraphQLCache implements GraphQLCacheInterface { if (schemaPath && schemaKey) { schemaCacheKey = schemaKey as string; - // Maybe use cache + try { + // Read from disk + schema = await projectConfig.loadSchema( + projectConfig.schema, + 'GraphQLSchema', + { + assumeValid: true, + assumeValidSDL: true, + experimentalFragmentVariables: true, + sort: false, + includeSources: true, + allowLegacySDLEmptyFields: true, + allowLegacySDLImplementsInterfaces: true, + }, + ); + } catch { + // // if there is an error reading the schema, just use the last valid schema + schema = this._schemaMap.get(schemaCacheKey); + } + if (this._schemaMap.has(schemaCacheKey)) { schema = this._schemaMap.get(schemaCacheKey); + if (schema) { return queryHasExtensions ? this._extendSchema(schema, schemaPath, schemaCacheKey) : schema; } } - - // Read from disk - schema = await projectConfig.getSchema(); } const customDirectives = projectConfig?.extensions?.customDirectives; @@ -693,6 +667,7 @@ export class GraphQLCache implements GraphQLCacheInterface { if (schemaCacheKey) { this._schemaMap.set(schemaCacheKey, schema); + await this._onSchemaChange?.(projectConfig); } return schema; }; @@ -713,7 +688,7 @@ export class GraphQLCache implements GraphQLCacheInterface { } _getProjectName(projectConfig: GraphQLProjectConfig) { - return projectConfig || 'default'; + return projectConfig?.name || 'default'; } /** @@ -825,13 +800,13 @@ export class GraphQLCache implements GraphQLCacheInterface { promiseToReadGraphQLFile = async ( filePath: Uri, ): Promise => { - const content = await readFile(URI.parse(filePath).fsPath, 'utf8'); + const content = await readFile(URI.parse(filePath).fsPath, 'utf-8'); const asts: DocumentNode[] = []; let queries: CachedContent[] = []; if (content.trim().length !== 0) { try { - queries = this._parser( + queries = await this._parser( content, filePath, DEFAULT_SUPPORTED_EXTENSIONS, diff --git a/packages/graphql-language-service-server/src/GraphQLLanguageService.ts b/packages/graphql-language-service-server/src/GraphQLLanguageService.ts index aeaa4c92a8e..e2b8c9a31bd 100644 --- a/packages/graphql-language-service-server/src/GraphQLLanguageService.ts +++ b/packages/graphql-language-service-server/src/GraphQLLanguageService.ts @@ -20,6 +20,8 @@ import { parse, print, isTypeDefinitionNode, + ArgumentNode, + typeFromAST, } from 'graphql'; import { @@ -29,7 +31,6 @@ import { IPosition, Outline, OutlineTree, - GraphQLCache, getAutocompleteSuggestions, getHoverInformation, HoverConfig, @@ -41,12 +42,15 @@ import { getDefinitionQueryResultForDefinitionNode, getDefinitionQueryResultForNamedType, getDefinitionQueryResultForField, - DefinitionQueryResult, getASTNodeAtPosition, getTokenAtPosition, getTypeInfo, + DefinitionQueryResponse, + getDefinitionQueryResultForArgument, } from 'graphql-language-service'; +import type { GraphQLCache } from './GraphQLCache'; + import { GraphQLConfig, GraphQLProjectConfig } from 'graphql-config'; import type { Logger } from 'vscode-languageserver'; @@ -223,30 +227,31 @@ export class GraphQLLanguageService { return []; } const schema = await this._graphQLCache.getSchema(projectConfig.name); - const fragmentDefinitions = await this._graphQLCache.getFragmentDefinitions( - projectConfig, - ); + if (!schema) { + return []; + } + let fragmentInfo = [] as Array; + try { + const fragmentDefinitions = + await this._graphQLCache.getFragmentDefinitions(projectConfig); + fragmentInfo = Array.from(fragmentDefinitions).map( + ([, info]) => info.definition, + ); + } catch {} - const fragmentInfo = Array.from(fragmentDefinitions).map( - ([, info]) => info.definition, + return getAutocompleteSuggestions( + schema, + query, + position, + undefined, + fragmentInfo, + { + uri: filePath, + fillLeafsOnComplete: + projectConfig?.extensions?.languageService?.fillLeafsOnComplete ?? + false, + }, ); - - if (schema) { - return getAutocompleteSuggestions( - schema, - query, - position, - undefined, - fragmentInfo, - { - uri: filePath, - fillLeafsOnComplete: - projectConfig?.extensions?.languageService?.fillLeafsOnComplete ?? - false, - }, - ); - } - return []; } public async getHoverInformation( @@ -271,12 +276,17 @@ export class GraphQLLanguageService { query: string, position: IPosition, filePath: Uri, - ): Promise { + ): Promise { const projectConfig = this.getConfigForURI(filePath); + if (!projectConfig) { return null; } + const schema = await this._graphQLCache.getSchema(projectConfig.name); + if (!schema) { + return null; + } let ast; try { ast = parse(query); @@ -285,36 +295,50 @@ export class GraphQLLanguageService { } const node = getASTNodeAtPosition(query, ast, position); + // @ts-expect-error + const type = node && typeFromAST(schema, node); + + let queryResult: DefinitionQueryResponse | null = null; if (node) { switch (node.kind) { case Kind.FRAGMENT_SPREAD: - return this._getDefinitionForFragmentSpread( + queryResult = await this._getDefinitionForFragmentSpread( query, ast, node, filePath, projectConfig, ); - + break; case Kind.FRAGMENT_DEFINITION: case Kind.OPERATION_DEFINITION: - return getDefinitionQueryResultForDefinitionNode( + queryResult = getDefinitionQueryResultForDefinitionNode( filePath, query, node, ); - + break; case Kind.NAMED_TYPE: - return this._getDefinitionForNamedType( + queryResult = await this._getDefinitionForNamedType( query, ast, node, filePath, projectConfig, ); - + break; case Kind.FIELD: - return this._getDefinitionForField( + queryResult = await this._getDefinitionForField( + query, + ast, + node, + filePath, + projectConfig, + position, + ); + break; + case Kind.ARGUMENT: + queryResult = await this._getDefinitionForArgument( query, ast, node, @@ -322,8 +346,16 @@ export class GraphQLLanguageService { projectConfig, position, ); + break; } } + if (queryResult) { + return { + ...queryResult, + node, + type, + }; + } return null; } @@ -382,7 +414,7 @@ export class GraphQLLanguageService { node: NamedTypeNode, filePath: Uri, projectConfig: GraphQLProjectConfig, - ): Promise { + ): Promise { const objectTypeDefinitions = await this._graphQLCache.getObjectTypeDefinitions(projectConfig); @@ -400,13 +432,11 @@ export class GraphQLLanguageService { definition, })); - const result = await getDefinitionQueryResultForNamedType( + return getDefinitionQueryResultForNamedType( query, node, dependencies.concat(localOperationDefinitionInfos), ); - - return result; } async _getDefinitionForField( @@ -432,13 +462,44 @@ export class GraphQLLanguageService { // TODO: need something like getObjectTypeDependenciesForAST? const dependencies = [...objectTypeDefinitions.values()]; - const result = await getDefinitionQueryResultForField( + return getDefinitionQueryResultForField( fieldName, parentTypeName, dependencies, ); + } + + return null; + } + + async _getDefinitionForArgument( + query: string, + _ast: DocumentNode, + _node: ArgumentNode, + _filePath: Uri, + projectConfig: GraphQLProjectConfig, + position: IPosition, + ) { + const token = getTokenAtPosition(query, position); + const schema = await this._graphQLCache.getSchema(projectConfig.name); + + const typeInfo = getTypeInfo(schema!, token.state); + const fieldName = typeInfo.fieldDef?.name; + const argumentName = typeInfo.argDef?.name; + if (typeInfo && fieldName && argumentName) { + const objectTypeDefinitions = + await this._graphQLCache.getObjectTypeDefinitions(projectConfig); - return result; + // TODO: need something like getObjectTypeDependenciesForAST? + const dependencies = [...objectTypeDefinitions.values()]; + + return getDefinitionQueryResultForArgument( + argumentName, + fieldName, + // @ts-expect-error - typeInfo is not typed correctly + typeInfo.argDef?.type?.name, + dependencies, + ); } return null; @@ -450,7 +511,7 @@ export class GraphQLLanguageService { node: FragmentSpreadNode, filePath: Uri, projectConfig: GraphQLProjectConfig, - ): Promise { + ): Promise { const fragmentDefinitions = await this._graphQLCache.getFragmentDefinitions( projectConfig, ); @@ -475,14 +536,13 @@ export class GraphQLLanguageService { }), ); - const result = await getDefinitionQueryResultForFragmentSpread( + return getDefinitionQueryResultForFragmentSpread( query, node, dependencies.concat(localFragInfos), ); - - return result; } + async getOutline(documentText: string): Promise { return getOutline(documentText); } diff --git a/packages/graphql-language-service-server/src/Logger.ts b/packages/graphql-language-service-server/src/Logger.ts index ccc58defa81..85f530f1fd0 100644 --- a/packages/graphql-language-service-server/src/Logger.ts +++ b/packages/graphql-language-service-server/src/Logger.ts @@ -11,7 +11,15 @@ import { Logger as VSCodeLogger } from 'vscode-jsonrpc'; import { Connection } from 'vscode-languageserver'; export class Logger implements VSCodeLogger { - constructor(private _connection: Connection) {} + // TODO: allow specifying exact log level? + // for now this is to handle the debug setting + private logLevel: number; + constructor( + private _connection: Connection, + debug?: boolean, + ) { + this.logLevel = debug ? 1 : 0; + } error(message: string): void { this._connection.console.error(message); @@ -26,7 +34,15 @@ export class Logger implements VSCodeLogger { } log(message: string): void { - this._connection.console.log(message); + if (this.logLevel > 0) { + this._connection.console.log(message); + } + } + set level(level: number) { + this.logLevel = level; + } + get level() { + return this.logLevel; } } @@ -35,4 +51,8 @@ export class NoopLogger implements VSCodeLogger { warn() {} info() {} log() {} + set level(_level: number) {} + get level() { + return 0; + } } diff --git a/packages/graphql-language-service-server/src/MessageProcessor.ts b/packages/graphql-language-service-server/src/MessageProcessor.ts index e871ba4e340..9b8a6e25a09 100644 --- a/packages/graphql-language-service-server/src/MessageProcessor.ts +++ b/packages/graphql-language-service-server/src/MessageProcessor.ts @@ -7,11 +7,9 @@ * */ -import mkdirp from 'mkdirp'; -import { readFileSync, existsSync, writeFileSync } from 'node:fs'; -import { writeFile } from 'node:fs/promises'; +import { existsSync, mkdirSync } from 'node:fs'; +import { mkdir, readFile, writeFile } from 'node:fs/promises'; import * as path from 'node:path'; -import glob from 'fast-glob'; import { URI } from 'vscode-uri'; import { CachedContent, @@ -34,7 +32,6 @@ import type { DidOpenTextDocumentParams, DidChangeConfigurationParams, Diagnostic, - CompletionItem, CompletionList, CancellationToken, Hover, @@ -66,16 +63,18 @@ import { ConfigEmptyError, ConfigInvalidError, ConfigNotFoundError, - GraphQLExtensionDeclaration, LoaderNoResultError, ProjectNotFoundError, } from 'graphql-config'; -import type { LoadConfigOptions } from './types'; +import type { LoadConfigOptions, LocateCommand } from './types'; import { DEFAULT_SUPPORTED_EXTENSIONS, SupportedExtensionsEnum, } from './constants'; import { NoopLogger, Logger } from './Logger'; +import glob from 'fast-glob'; +import { isProjectSDLOnly, unwrapProjectSchema } from './common'; +import { DefinitionQueryResponse } from 'graphql-language-service/src/interface'; const configDocLink = 'https://www.npmjs.com/package/graphql-language-service-server#user-content-graphql-configuration-file'; @@ -84,29 +83,27 @@ type CachedDocumentType = { version: number; contents: CachedContent[]; }; + function toPosition(position: VscodePosition): IPosition { return new Position(position.line, position.character); } export class MessageProcessor { - _connection: Connection; - _graphQLCache!: GraphQLCache; - _graphQLConfig: GraphQLConfig | undefined; - _languageService!: GraphQLLanguageService; - _textDocumentCache = new Map(); - _isInitialized = false; - _isGraphQLConfigMissing: boolean | null = null; - _willShutdown = false; - _logger: Logger | NoopLogger; - _extensions?: GraphQLExtensionDeclaration[]; - _parser: (text: string, uri: string) => CachedContent[]; - _tmpDir: string; - _tmpUriBase: string; - _tmpDirBase: string; - _loadConfigOptions: LoadConfigOptions; - _schemaCacheInit = false; - _rootPath: string = process.cwd(); - _settings: any; + private _connection: Connection; + private _graphQLCache!: GraphQLCache; + private _languageService!: GraphQLLanguageService; + private _textDocumentCache = new Map(); + private _isInitialized = false; + private _isGraphQLConfigMissing: boolean | null = null; + private _willShutdown = false; + private _logger: Logger | NoopLogger; + private _parser: (text: string, uri: string) => CachedContent[]; + private _tmpDir: string; + private _tmpDirBase: string; + private _loadConfigOptions: LoadConfigOptions; + private _rootPath: string = process.cwd(); + private _settings: any; + private _providedConfig?: GraphQLConfig; constructor({ logger, @@ -127,27 +124,22 @@ export class MessageProcessor { tmpDir?: string; connection: Connection; }) { + if (config) { + this._providedConfig = config; + } this._connection = connection; this._logger = logger; - this._graphQLConfig = config; this._parser = (text, uri) => { const p = parser ?? parseDocument; return p(text, uri, fileExtensions, graphqlFileExtensions, this._logger); }; this._tmpDir = tmpDir || tmpdir(); this._tmpDirBase = path.join(this._tmpDir, 'graphql-language-service'); - this._tmpUriBase = URI.file(this._tmpDirBase).toString(); // use legacy mode by default for backwards compatibility this._loadConfigOptions = { legacy: true, ...loadConfigOptions }; - if ( - loadConfigOptions.extensions && - loadConfigOptions.extensions?.length > 0 - ) { - this._extensions = loadConfigOptions.extensions; - } if (!existsSync(this._tmpDirBase)) { - void mkdirp(this._tmpDirBase); + void mkdirSync(this._tmpDirBase); } } get connection(): Connection { @@ -157,7 +149,7 @@ export class MessageProcessor { this._connection = connection; } - async handleInitializeRequest( + public async handleInitializeRequest( params: InitializeParams, _token?: CancellationToken, configDir?: string, @@ -172,7 +164,7 @@ export class MessageProcessor { documentSymbolProvider: true, completionProvider: { resolveProvider: true, - triggerCharacters: [' ', ':', '$', '(', '@'], + triggerCharacters: [' ', ':', '$', '(', '@', '\n'], }, definitionProvider: true, textDocumentSync: 1, @@ -194,9 +186,6 @@ export class MessageProcessor { 'no rootPath configured in extension or server, defaulting to cwd', ); } - if (!serverCapabilities) { - throw new Error('GraphQL Language Server is not initialized.'); - } this._logger.info( JSON.stringify({ @@ -207,8 +196,8 @@ export class MessageProcessor { return serverCapabilities; } - - async _updateGraphQLConfig() { + // TODO next: refactor (most of) this into the `GraphQLCache` class + async _initializeGraphQLCaches() { const settings = await this._connection.workspace.getConfiguration({ section: 'graphql-config', }); @@ -216,13 +205,18 @@ export class MessageProcessor { const vscodeSettings = await this._connection.workspace.getConfiguration({ section: 'vscode-graphql', }); - if (settings?.dotEnvPath) { - require('dotenv').config({ path: settings.dotEnvPath }); - } + + // TODO: eventually we will instantiate an instance of this per workspace, + // so rootDir should become that workspace's rootDir this._settings = { ...settings, ...vscodeSettings }; const rootDir = this._settings?.load?.rootDir.length ? this._settings?.load?.rootDir : this._rootPath; + if (settings?.dotEnvPath) { + require('dotenv').config({ + path: path.resolve(rootDir, settings.dotEnvPath), + }); + } this._rootPath = rootDir; this._loadConfigOptions = { ...Object.keys(this._settings?.load ?? {}).reduce((agg, key) => { @@ -234,30 +228,68 @@ export class MessageProcessor { }, this._settings.load ?? {}), rootDir, }; - try { - // reload the graphql cache - this._graphQLCache = await getGraphQLCache({ - parser: this._parser, - loadConfigOptions: this._loadConfigOptions, - logger: this._logger, - }); - this._languageService = new GraphQLLanguageService( - this._graphQLCache, - this._logger, - ); - if (this._graphQLConfig || this._graphQLCache?.getGraphQLConfig) { - const config = - this._graphQLConfig ?? this._graphQLCache.getGraphQLConfig(); + const onSchemaChange = async (project: GraphQLProjectConfig) => { + const { cacheSchemaFileForLookup } = + this.getCachedSchemaSettings(project); + if (!cacheSchemaFileForLookup) { + return; + } + const unwrappedSchema = unwrapProjectSchema(project); + const sdlOnly = isProjectSDLOnly(unwrappedSchema); + if (sdlOnly) { + return; + } + return this.cacheConfigSchemaFile(project); + }; + + try { + // now we have the settings so we can re-build the logger + this._logger.level = this._settings?.debug === true ? 1 : 0; + // createServer() can be called with a custom config object, and + // this is a public interface that may be used by customized versions of the server + if (this._providedConfig) { + this._graphQLCache = new GraphQLCache({ + config: this._providedConfig, + logger: this._logger, + parser: this._parser, + configDir: rootDir, + onSchemaChange, + }); + this._languageService = new GraphQLLanguageService( + this._graphQLCache, + this._logger, + ); + } else { + // reload the graphql cache + this._graphQLCache = await getGraphQLCache({ + parser: this._parser, + loadConfigOptions: this._loadConfigOptions, + logger: this._logger, + onSchemaChange, + }); + this._languageService = new GraphQLLanguageService( + this._graphQLCache, + this._logger, + ); + } + const config = this._graphQLCache.getGraphQLConfig(); + if (config) { await this._cacheAllProjectFiles(config); + // TODO: per project lazy instantiation. + // we had it working before, but it seemed like it caused bugs + // which were caused by something else. + // thus. _isInitialized should be replaced with something like + // projectHasInitialized: (projectName: string) => boolean + this._isInitialized = true; + this._isGraphQLConfigMissing = false; + this._logger.info('GraphQL Language Server caches initialized'); } - this._isInitialized = true; } catch (err) { this._handleConfigError({ err }); } } - _handleConfigError({ err }: { err: unknown; uri?: string }) { - // console.log(err, typeof err); + private _handleConfigError({ err }: { err: unknown; uri?: string }) { if (err instanceof ConfigNotFoundError || err instanceof ConfigEmptyError) { // TODO: obviously this needs to become a map by workspace from uri // for workspaces support @@ -267,7 +299,7 @@ export class MessageProcessor { // this is the only case where we don't invalidate config; // TODO: per-project schema initialization status (PR is almost ready) this._logConfigError( - 'Project not found for this file - make sure that a schema is present', + 'Project not found for this file - make sure that a schema is present in the config file or for the project', ); } else if (err instanceof ConfigInvalidError) { this._isGraphQLConfigMissing = true; @@ -288,14 +320,14 @@ export class MessageProcessor { } } - _logConfigError(errorMessage: string) { + private _logConfigError(errorMessage: string) { this._logger.error( 'WARNING: graphql-config error, only highlighting is enabled:\n' + errorMessage + `\nfor more information on using 'graphql-config' with 'graphql-language-service-server', \nsee the documentation at ${configDocLink}`, ); } - async _isGraphQLConfigFile(uri: string) { + private async _isGraphQLConfigFile(uri: string) { const configMatchers = ['graphql.config', 'graphqlrc', 'graphqlconfig']; if (this._settings?.load?.fileName?.length) { configMatchers.push(this._settings.load.fileName); @@ -308,34 +340,54 @@ export class MessageProcessor { return fileMatch; } if (uri.match('package.json')?.length) { - const graphqlConfig = await import(URI.parse(uri).fsPath); - return Boolean(graphqlConfig?.graphql); + try { + const pkgConfig = await readFile(URI.parse(uri).fsPath, 'utf-8'); + return Boolean(JSON.parse(pkgConfig)?.graphql); + } catch {} } return false; } - - async handleDidOpenOrSaveNotification( - params: DidSaveTextDocumentParams | DidOpenTextDocumentParams, - ): Promise { - /** - * Initialize the LSP server when the first file is opened or saved, - * so that we can access the user settings for config rootDir, etc - */ - const isGraphQLConfigFile = await this._isGraphQLConfigFile( - params.textDocument.uri, - ); + private async _loadConfigOrSkip(uri: string) { try { - if (!this._isInitialized || !this._graphQLCache) { - // don't try to initialize again if we've already tried - // and the graphql config file or package.json entry isn't even there + const isGraphQLConfigFile = await this._isGraphQLConfigFile(uri); + + if (!this._isInitialized) { if (this._isGraphQLConfigMissing === true && !isGraphQLConfigFile) { - return null; + return true; } - // then initial call to update graphql config - await this._updateGraphQLConfig(); + // don't try to initialize again if we've already tried + // and the graphql config file or package.json entry isn't even there + await this._initializeGraphQLCaches(); + return isGraphQLConfigFile; + } + // if it has initialized, but this is another config file change, then let's handle it + if (isGraphQLConfigFile) { + await this._initializeGraphQLCaches(); } + return isGraphQLConfigFile; } catch (err) { this._logger.error(String(err)); + // return true if it's a graphql config file so we don't treat + // this as a non-config file if it is one + return true; + } + } + + public async handleDidOpenOrSaveNotification( + params: DidSaveTextDocumentParams | DidOpenTextDocumentParams, + ): Promise { + const { textDocument } = params; + const { uri } = textDocument; + + /** + * Initialize the LSP server when the first file is opened or saved, + * so that we can access the user settings for config rootDir, etc + */ + const shouldSkip = await this._loadConfigOrSkip(uri); + // if we're loading config or the config is missing or there's an error + // don't do anything else + if (shouldSkip) { + return { uri, diagnostics: [] }; } // Here, we set the workspace settings in memory, @@ -344,55 +396,46 @@ export class MessageProcessor { // We aren't able to use initialization event for this // and the config change event is after the fact. - if (!params?.textDocument) { + if (!textDocument) { throw new Error('`textDocument` argument is required.'); } - const { textDocument } = params; - const { uri } = textDocument; const diagnostics: Diagnostic[] = []; - let contents: CachedContent[] = []; - const text = 'text' in textDocument && textDocument.text; - // Create/modify the cached entry if text is provided. - // Otherwise, try searching the cache to perform diagnostics. - if (text) { - // textDocument/didSave does not pass in the text content. - // Only run the below function if text is passed in. - contents = this._parser(text, uri); - - await this._invalidateCache(textDocument, uri, contents); - } else { - if (isGraphQLConfigFile) { - this._logger.info('updating graphql config'); - await this._updateGraphQLConfig(); - return { uri, diagnostics: [] }; - } - return null; - } - if (!this._graphQLCache) { + if (!this._isInitialized) { return { uri, diagnostics }; } try { const project = this._graphQLCache.getProjectForFile(uri); - if ( - this._isInitialized && - project?.extensions?.languageService?.enableValidation !== false - ) { - await Promise.all( - contents.map(async ({ query, range }) => { - const results = await this._languageService.getDiagnostics( - query, - uri, - this._isRelayCompatMode(query), - ); - if (results && results.length > 0) { - diagnostics.push( - ...processDiagnosticsMessage(results, query, range), - ); - } - }), + + if (project) { + const text = 'text' in textDocument && textDocument.text; + // for some reason if i try to tell to not parse empty files, it breaks :shrug: + // i think this is because if the file change is empty, it doesn't get parsed + // TODO: this could be related to a bug in how we are calling didOpenOrSave in our tests + // that doesn't reflect the real runtime behavior + + const { contents } = await this._parseAndCacheFile( + uri, + project, + text as string, ); + if (project?.extensions?.languageService?.enableValidation !== false) { + await Promise.all( + contents.map(async ({ query, range }) => { + const results = await this._languageService.getDiagnostics( + query, + uri, + this._isRelayCompatMode(query), + ); + if (results && results.length > 0) { + diagnostics.push( + ...processDiagnosticsMessage(results, query, range), + ); + } + }), + ); + } } this._logger.log( @@ -403,14 +446,14 @@ export class MessageProcessor { fileName: uri, }), ); + return { uri, diagnostics }; } catch (err) { this._handleConfigError({ err, uri }); + return { uri, diagnostics }; } - - return { uri, diagnostics }; } - async handleDidChangeNotification( + public async handleDidChangeNotification( params: DidChangeTextDocumentParams, ): Promise { if ( @@ -431,46 +474,47 @@ export class MessageProcessor { } const { textDocument, contentChanges } = params; const { uri } = textDocument; - const project = this._graphQLCache.getProjectForFile(uri); + try { - const contentChange = contentChanges.at(-1)!; + const project = this._graphQLCache.getProjectForFile(uri); + if (!project) { + return { uri, diagnostics: [] }; + } // As `contentChanges` is an array, and we just want the // latest update to the text, grab the last entry from the array. // If it's a .js file, try parsing the contents to see if GraphQL queries // exist. If not found, delete from the cache. - const contents = this._parser(contentChange.text, uri); - // If it's a .graphql file, proceed normally and invalidate the cache. - await this._invalidateCache(textDocument, uri, contents); - - const cachedDocument = this._getCachedDocument(uri); - - if (!cachedDocument) { - return null; - } - - await this._updateFragmentDefinition(uri, contents); - await this._updateObjectTypeDefinition(uri, contents); + const { contents } = await this._parseAndCacheFile( + uri, + project, + contentChanges.at(-1)!.text, + ); + // // If it's a .graphql file, proceed normally and invalidate the cache. + // await this._invalidateCache(textDocument, uri, contents); const diagnostics: Diagnostic[] = []; if (project?.extensions?.languageService?.enableValidation !== false) { // Send the diagnostics onChange as well - await Promise.all( - contents.map(async ({ query, range }) => { - const results = await this._languageService.getDiagnostics( - query, - uri, - this._isRelayCompatMode(query), - ); - if (results && results.length > 0) { - diagnostics.push( - ...processDiagnosticsMessage(results, query, range), + try { + await Promise.all( + contents.map(async ({ query, range }) => { + const results = await this._languageService.getDiagnostics( + query, + uri, + this._isRelayCompatMode(query), ); - } - }), - ); + if (results && results.length > 0) { + diagnostics.push( + ...processDiagnosticsMessage(results, query, range), + ); + } + // skip diagnostic errors, usually related to parsing incomplete fragments + }), + ); + } catch {} } this._logger.log( @@ -491,7 +535,7 @@ export class MessageProcessor { async handleDidChangeConfiguration( _params: DidChangeConfigurationParams, ): Promise { - await this._updateGraphQLConfig(); + await this._initializeGraphQLCaches(); this._logger.log( JSON.stringify({ type: 'usage', @@ -501,8 +545,8 @@ export class MessageProcessor { return {}; } - handleDidCloseNotification(params: DidCloseTextDocumentParams): void { - if (!this._isInitialized || !this._graphQLCache) { + public handleDidCloseNotification(params: DidCloseTextDocumentParams): void { + if (!this._isInitialized) { return; } // For every `textDocument/didClose` event, delete the cached entry. @@ -529,15 +573,15 @@ export class MessageProcessor { ); } - handleShutdownRequest(): void { + public handleShutdownRequest(): void { this._willShutdown = true; } - handleExitNotification(): void { + public handleExitNotification(): void { process.exit(this._willShutdown ? 0 : 1); } - validateDocumentAndPosition(params: CompletionParams): void { + private validateDocumentAndPosition(params: CompletionParams): void { if (!params?.textDocument?.uri || !params.position) { throw new Error( '`textDocument.uri` and `position` arguments are required.', @@ -545,11 +589,11 @@ export class MessageProcessor { } } - async handleCompletionRequest( + public async handleCompletionRequest( params: CompletionParams, - ): Promise> { - if (!this._isInitialized || !this._graphQLCache) { - return []; + ): Promise { + if (!this._isInitialized) { + return { items: [], isIncomplete: false }; } this.validateDocumentAndPosition(params); @@ -563,7 +607,7 @@ export class MessageProcessor { const cachedDocument = this._getCachedDocument(textDocument.uri); if (!cachedDocument) { - return []; + return { items: [], isIncomplete: false }; } const found = cachedDocument.contents.find(content => { @@ -575,7 +619,7 @@ export class MessageProcessor { // If there is no GraphQL query in this file, return an empty result. if (!found) { - return []; + return { items: [], isIncomplete: false }; } const { query, range } = found; @@ -583,6 +627,7 @@ export class MessageProcessor { if (range) { position.line -= range.start.line; } + const result = await this._languageService.getAutocompleteSuggestions( query, toPosition(position), @@ -603,8 +648,10 @@ export class MessageProcessor { return { items: result, isIncomplete: false }; } - async handleHoverRequest(params: TextDocumentPositionParams): Promise { - if (!this._isInitialized || !this._graphQLCache) { + public async handleHoverRequest( + params: TextDocumentPositionParams, + ): Promise { + if (!this._isInitialized) { return { contents: [] }; } @@ -646,26 +693,34 @@ export class MessageProcessor { }; } - async handleWatchedFilesChangedNotification( - params: DidChangeWatchedFilesParams, - ): Promise | null> { - if ( - this._isGraphQLConfigMissing || - !this._isInitialized || - !this._graphQLCache - ) { - return null; + private async _parseAndCacheFile( + uri: string, + project: GraphQLProjectConfig, + text?: string, + ) { + try { + const fileText = text || (await readFile(URI.parse(uri).fsPath, 'utf-8')); + const contents = await this._parser(fileText, uri); + const cachedDocument = this._textDocumentCache.get(uri); + const version = cachedDocument ? cachedDocument.version++ : 0; + await this._invalidateCache({ uri, version }, uri, contents); + await this._updateFragmentDefinition(uri, contents); + await this._updateObjectTypeDefinition(uri, contents, project); + await this._updateSchemaIfChanged(project, uri); + return { contents, version }; + } catch { + return { contents: [], version: 0 }; } + } - return Promise.all( + public async handleWatchedFilesChangedNotification( + params: DidChangeWatchedFilesParams, + ): Promise | null> { + const resultsForChanges = Promise.all( params.changes.map(async (change: FileEvent) => { - if ( - this._isGraphQLConfigMissing || - !this._isInitialized || - !this._graphQLCache - ) { - this._logger.warn('No cache available for handleWatchedFilesChanged'); - return; + const shouldSkip = await this._loadConfigOrSkip(change.uri); + if (shouldSkip) { + return { uri: change.uri, diagnostics: [] }; } if ( change.type === FileChangeTypeKind.Created || @@ -673,75 +728,60 @@ export class MessageProcessor { ) { const { uri } = change; - const text = readFileSync(URI.parse(uri).fsPath, 'utf-8'); - const contents = this._parser(text, uri); - - await this._updateFragmentDefinition(uri, contents); - await this._updateObjectTypeDefinition(uri, contents); - try { + let diagnostics: Diagnostic[] = []; const project = this._graphQLCache.getProjectForFile(uri); if (project) { - await this._updateSchemaIfChanged(project, uri); + // Important! Use system file uri not file path here!!!! + const { contents } = await this._parseAndCacheFile(uri, project); + if ( + project?.extensions?.languageService?.enableValidation !== false + ) { + diagnostics = ( + await Promise.all( + contents.map(async ({ query, range }) => { + const results = + await this._languageService.getDiagnostics( + query, + uri, + this._isRelayCompatMode(query), + ); + if (results && results.length > 0) { + return processDiagnosticsMessage(results, query, range); + } + return []; + }), + ) + ).reduce((left, right) => left.concat(right), diagnostics); + } + + return { uri, diagnostics }; } - - let diagnostics: Diagnostic[] = []; - - if ( - project?.extensions?.languageService?.enableValidation !== false - ) { - diagnostics = ( - await Promise.all( - contents.map(async ({ query, range }) => { - const results = await this._languageService.getDiagnostics( - query, - uri, - this._isRelayCompatMode(query), - ); - if (results && results.length > 0) { - return processDiagnosticsMessage(results, query, range); - } - return []; - }), - ) - ).reduce((left, right) => left.concat(right), diagnostics); - } - - this._logger.log( - JSON.stringify({ - type: 'usage', - messageType: 'workspace/didChangeWatchedFiles', - projectName: project?.name, - fileName: uri, - }), - ); - return { uri, diagnostics }; - } catch (err) { - this._handleConfigError({ err, uri }); - return { uri, diagnostics: [] }; - } + // skip diagnostics errors usually from incomplete files + } catch {} + return { uri, diagnostics: [] }; } if (change.type === FileChangeTypeKind.Deleted) { - await this._graphQLCache.updateFragmentDefinitionCache( - this._graphQLCache.getGraphQLConfig().dirpath, - change.uri, - false, - ); - await this._graphQLCache.updateObjectTypeDefinitionCache( - this._graphQLCache.getGraphQLConfig().dirpath, - change.uri, - false, - ); + await this._updateFragmentDefinition(change.uri, []); + await this._updateObjectTypeDefinition(change.uri, []); } }), ); + this._logger.log( + JSON.stringify({ + type: 'usage', + messageType: 'workspace/didChangeWatchedFiles', + files: params.changes.map(change => change.uri), + }), + ); + return resultsForChanges; } - async handleDefinitionRequest( + public async handleDefinitionRequest( params: TextDocumentPositionParams, _token?: CancellationToken, ): Promise> { - if (!this._isInitialized || !this._graphQLCache) { + if (!this._isInitialized) { return []; } @@ -750,11 +790,8 @@ export class MessageProcessor { } const { textDocument, position } = params; const project = this._graphQLCache.getProjectForFile(textDocument.uri); - if (project) { - await this._cacheSchemaFilesForProject(project); - } const cachedDocument = this._getCachedDocument(textDocument.uri); - if (!cachedDocument) { + if (!cachedDocument || !project) { return []; } @@ -775,7 +812,7 @@ export class MessageProcessor { position.line -= parentRange.start.line; } - let result = null; + let result: DefinitionQueryResponse | null = null; try { result = await this._languageService.getDefinition( @@ -796,17 +833,26 @@ export class MessageProcessor { }); } catch {} + const locateCommand = project?.extensions?.languageService + ?.locateCommand as LocateCommand | undefined; + const formatted = result ? result.definitions.map(res => { const defRange = res.range as Range; - if (parentRange && res.name) { const isInline = inlineFragments.includes(res.name); const isEmbedded = DEFAULT_SUPPORTED_EXTENSIONS.includes( - path.extname(textDocument.uri) as SupportedExtensionsEnum, + path.extname(res.path) as SupportedExtensionsEnum, ); - if (isInline && isEmbedded) { - const vOffset = parentRange.start.line; + + if (isEmbedded || isInline) { + const cachedDoc = this._getCachedDocument( + URI.parse(res.path).toString(), + ); + const vOffset = isEmbedded + ? cachedDoc?.contents[0].range?.start.line ?? 0 + : parentRange.start.line; + defRange.setStart( (defRange.start.line += vOffset), defRange.start.character, @@ -817,10 +863,22 @@ export class MessageProcessor { ); } } + + if (locateCommand && result && result?.printedName) { + const locateResult = this._getCustomLocateResult( + project, + result, + locateCommand, + ); + + if (locateResult) { + return locateResult; + } + } return { uri: res.path, range: defRange, - } as Location; + }; }) : []; @@ -834,11 +892,44 @@ export class MessageProcessor { ); return formatted; } + _getCustomLocateResult( + project: GraphQLProjectConfig, + result: DefinitionQueryResponse, + locateCommand: LocateCommand, + ) { + if (!result.printedName) { + return null; + } + try { + const locateResult = locateCommand(project.name, result.printedName, { + node: result.node, + type: result.type, + project, + }); + if (typeof locateResult === 'string') { + const [uri, startLine = '1', endLine = '1'] = locateResult.split(':'); + return { + uri, + range: new Range( + new Position(parseInt(startLine, 10), 0), + new Position(parseInt(endLine, 10), 0), + ), + }; + } + return locateResult; + } catch (error) { + this._logger.error( + 'There was an error executing user defined locateCommand\n\n' + + (error as Error).toString(), + ); + return null; + } + } - async handleDocumentSymbolRequest( + public async handleDocumentSymbolRequest( params: DocumentSymbolParams, ): Promise> { - if (!this._isInitialized || !this._graphQLCache) { + if (!this._isInitialized) { return []; } @@ -895,14 +986,12 @@ export class MessageProcessor { // ); // } - async handleWorkspaceSymbolRequest( + public async handleWorkspaceSymbolRequest( params: WorkspaceSymbolParams, ): Promise> { - if (!this._isInitialized || !this._graphQLCache) { + if (!this._isInitialized) { return []; } - // const config = await this._graphQLCache.getGraphQLConfig(); - // await this._cacheAllProjectFiles(config); if (params.query !== '') { const documents = this._getTextDocuments(); @@ -910,6 +999,7 @@ export class MessageProcessor { await Promise.all( documents.map(async ([uri]) => { const cachedDocument = this._getCachedDocument(uri); + if (!cachedDocument) { return []; } @@ -928,41 +1018,54 @@ export class MessageProcessor { return []; } - _getTextDocuments() { + private _getTextDocuments() { return Array.from(this._textDocumentCache); } - async _cacheSchemaText(uri: string, text: string, version: number) { + private async _cacheSchemaText( + uri: string, + text: string, + version: number, + project?: GraphQLProjectConfig, + ) { try { - const contents = this._parser(text, uri); + const contents = await this._parser(text, uri); if (contents.length > 0) { await this._invalidateCache({ version, uri }, uri, contents); - await this._updateObjectTypeDefinition(uri, contents); + await this._updateObjectTypeDefinition(uri, contents, project); } } catch (err) { this._logger.error(String(err)); } } - async _cacheSchemaFile( - _uri: UnnormalizedTypeDefPointer, + private async _cacheSchemaFile( + fileUri: UnnormalizedTypeDefPointer, project: GraphQLProjectConfig, ) { - const uri = _uri.toString(); - - const isFileUri = existsSync(uri); - let version = 1; - if (isFileUri) { - const schemaUri = URI.file(path.join(project.dirpath, uri)).toString(); - const schemaDocument = this._getCachedDocument(schemaUri); - - if (schemaDocument) { - version = schemaDocument.version++; + try { + // const parsedUri = URI.file(fileUri.toString()); + // @ts-expect-error + const matches = await glob(fileUri, { + cwd: project.dirpath, + absolute: true, + }); + const uri = matches[0]; + let version = 1; + if (uri) { + const schemaUri = URI.file(uri).toString(); + const schemaDocument = this._getCachedDocument(schemaUri); + + if (schemaDocument) { + version = schemaDocument.version++; + } + const schemaText = await readFile(uri, 'utf-8'); + await this._cacheSchemaText(schemaUri, schemaText, version); } - const schemaText = readFileSync(uri, 'utf8'); - await this._cacheSchemaText(schemaUri, schemaText, version); + } catch (err) { + this._logger.error(String(err)); } } - _getTmpProjectPath( + private _getTmpProjectPath( project: GraphQLProjectConfig, prependWithProtocol = true, appendPath?: string, @@ -972,7 +1075,9 @@ export class MessageProcessor { const basePath = path.join(this._tmpDirBase, workspaceName); let projectTmpPath = path.join(basePath, 'projects', project.name); if (!existsSync(projectTmpPath)) { - void mkdirp(projectTmpPath); + mkdirSync(projectTmpPath, { + recursive: true, + }); } if (appendPath) { projectTmpPath = path.join(projectTmpPath, appendPath); @@ -982,57 +1087,30 @@ export class MessageProcessor { } return path.resolve(projectTmpPath); } - /** - * Safely attempts to cache schema files based on a glob or path - * Exits without warning in several cases because these strings can be almost - * anything! - * @param uri - * @param project - */ - async _cacheSchemaPath(uri: string, project: GraphQLProjectConfig) { - try { - const files = await glob(uri); - if (files && files.length > 0) { - await Promise.all( - files.map(uriPath => this._cacheSchemaFile(uriPath, project)), - ); - } else { - try { - await this._cacheSchemaFile(uri, project); - } catch { - // this string may be an SDL string even, how do we even evaluate this? - } - } - } catch {} - } - async _cacheObjectSchema( - pointer: { [key: string]: any }, - project: GraphQLProjectConfig, - ) { - await Promise.all( - Object.keys(pointer).map(async schemaUri => - this._cacheSchemaPath(schemaUri, project), - ), - ); - } - async _cacheArraySchema( - pointers: UnnormalizedTypeDefPointer[], - project: GraphQLProjectConfig, - ) { - await Promise.all( - pointers.map(async schemaEntry => { - if (typeof schemaEntry === 'string') { - await this._cacheSchemaPath(schemaEntry, project); - } else if (schemaEntry) { - await this._cacheObjectSchema(schemaEntry, project); - } - }), - ); - } - async _cacheSchemaFilesForProject(project: GraphQLProjectConfig) { - const schema = project?.schema; + private getCachedSchemaSettings(project: GraphQLProjectConfig) { const config = project?.extensions?.languageService; + let cacheSchemaFileForLookup = true; + let schemaCacheTTL = 1000 * 30; + + if ( + config?.cacheSchemaFileForLookup === false || + this?._settings?.cacheSchemaFileForLookup === false + ) { + cacheSchemaFileForLookup = false; + } + // nullish coalescing allows 0 to be a valid value here + if (config?.schemaCacheTTL) { + schemaCacheTTL = config.schemaCacheTTL; + } + if (this?._settings?.schemaCacheTTL) { + schemaCacheTTL = this._settings.schemaCacheTTL; + } + return { cacheSchemaFileForLookup, schemaCacheTTL }; + } + + private async _cacheSchemaFilesForProject(project: GraphQLProjectConfig) { + // const config = project?.extensions?.languageService; /** * By default, we look for schema definitions in SDL files * @@ -1047,18 +1125,39 @@ export class MessageProcessor { * * it is disabled by default */ - const cacheSchemaFileForLookup = - config?.cacheSchemaFileForLookup ?? - this?._settings?.cacheSchemaFileForLookup ?? - false; - if (cacheSchemaFileForLookup) { - await this._cacheConfigSchema(project); - } else if (typeof schema === 'string') { - await this._cacheSchemaPath(schema, project); - } else if (Array.isArray(schema)) { - await this._cacheArraySchema(schema, project); - } else if (schema) { - await this._cacheObjectSchema(schema, project); + const { cacheSchemaFileForLookup } = this.getCachedSchemaSettings(project); + const unwrappedSchema = unwrapProjectSchema(project); + + // only local schema lookups if all of the schema entries are local files + const sdlOnly = isProjectSDLOnly(unwrappedSchema); + + // const uri = this._getTmpProjectPath( + // project, + // true, + // 'generated-schema.graphql', + // ); + // const fsPath = this._getTmpProjectPath( + // project, + // false, + // 'generated-schema.graphql', + // ); + // invalidate the cache for the generated schema file + // whether or not the user will continue using this feature + // because sdlOnly needs this file to be removed as well if the user is switching schemas + // this._textDocumentCache.delete(uri); + // skip exceptions if the file doesn't exist + try { + // await rm(fsPath, { force: true }); + } catch {} + // if we are caching the config schema, and it isn't a .graphql file, cache it + if (cacheSchemaFileForLookup && !sdlOnly) { + await this.cacheConfigSchemaFile(project); + } else if (sdlOnly) { + await Promise.all( + unwrappedSchema.map(async schemaEntry => + this._cacheSchemaFile(schemaEntry, project), + ), + ); } } /** @@ -1066,7 +1165,7 @@ export class MessageProcessor { * from GraphQLCache.getSchema() * @param project {GraphQLProjectConfig} */ - async _cacheConfigSchema(project: GraphQLProjectConfig) { + private async cacheConfigSchemaFile(project: GraphQLProjectConfig) { try { const schema = await this._graphQLCache.getSchema(project.name); if (schema) { @@ -1087,18 +1186,25 @@ export class MessageProcessor { schemaText = `# This is an automatically generated representation of your schema.\n# Any changes to this file will be overwritten and will not be\n# reflected in the resulting GraphQL schema\n\n${schemaText}`; const cachedSchemaDoc = this._getCachedDocument(uri); + this._graphQLCache._schemaMap.set(project.name, schema); + try { + await mkdir(path.dirname(fsPath), { recursive: true }); + } catch {} if (!cachedSchemaDoc) { - await writeFile(fsPath, schemaText, 'utf8'); - await this._cacheSchemaText(uri, schemaText, 1); + await writeFile(fsPath, schemaText, { + encoding: 'utf-8', + }); + await this._cacheSchemaText(uri, schemaText, 0, project); } // do we have a change in the getSchema result? if so, update schema cache if (cachedSchemaDoc) { - writeFileSync(fsPath, schemaText, 'utf8'); + await writeFile(fsPath, schemaText, 'utf-8'); await this._cacheSchemaText( uri, schemaText, cachedSchemaDoc.version++, + project, ); } } @@ -1113,7 +1219,7 @@ export class MessageProcessor { * * @param project {GraphQLProjectConfig} */ - async _cacheDocumentFilesforProject(project: GraphQLProjectConfig) { + private async _cacheDocumentFilesforProject(project: GraphQLProjectConfig) { try { const documents = await project.getDocuments(); return Promise.all( @@ -1131,7 +1237,7 @@ export class MessageProcessor { const uri = URI.file(filePath).toString(); // I would use the already existing graphql-config AST, but there are a few reasons we can't yet - const contents = this._parser(document.rawSDL, uri); + const contents = await this._parser(document.rawSDL, uri); if (!contents[0]?.query) { return; } @@ -1152,13 +1258,24 @@ export class MessageProcessor { * Caching all the document files upfront could be expensive. * @param config {GraphQLConfig} */ - async _cacheAllProjectFiles(config: GraphQLConfig) { + private async _cacheAllProjectFiles(config: GraphQLConfig) { if (config?.projects) { return Promise.all( Object.keys(config.projects).map(async projectName => { const project = config.getProject(projectName); + await this._cacheSchemaFilesForProject(project); - await this._cacheDocumentFilesforProject(project); + if (project.documents?.length) { + await this._cacheDocumentFilesforProject(project); + } else { + this._logger.warn( + [ + `No 'documents' config found for project: ${projectName}.`, + 'Fragments and query documents cannot be detected.', + 'LSP server will only perform some partial validation and SDL features.', + ].join('\n'), + ); + } }), ); } @@ -1169,61 +1286,60 @@ export class MessageProcessor { ); } - async _updateFragmentDefinition( + private async _updateFragmentDefinition( uri: Uri, contents: CachedContent[], ): Promise { - const rootDir = this._graphQLCache.getGraphQLConfig().dirpath; - - await this._graphQLCache.updateFragmentDefinition(rootDir, uri, contents); + const project = this._graphQLCache.getProjectForFile(uri); + if (project) { + const cacheKey = this._graphQLCache._cacheKeyForProject(project); + await this._graphQLCache.updateFragmentDefinition( + cacheKey, + uri, + contents, + ); + } } - async _updateSchemaIfChanged( + private async _updateSchemaIfChanged( project: GraphQLProjectConfig, uri: Uri, ): Promise { await Promise.all( - this._unwrapProjectSchema(project).map(async schema => { + unwrapProjectSchema(project).map(async schema => { const schemaFilePath = path.resolve(project.dirpath, schema); const uriFilePath = URI.parse(uri).fsPath; if (uriFilePath === schemaFilePath) { - await this._graphQLCache.invalidateSchemaCacheForProject(project); + try { + const file = await readFile(schemaFilePath, 'utf-8'); + // only invalidate the schema cache if we can actually parse the file + // otherwise, leave the last valid one in place + parse(file, { noLocation: true }); + this._graphQLCache.invalidateSchemaCacheForProject(project); + } catch {} } }), ); } - _unwrapProjectSchema(project: GraphQLProjectConfig): string[] { - const projectSchema = project.schema; - - const schemas: string[] = []; - if (typeof projectSchema === 'string') { - schemas.push(projectSchema); - } else if (Array.isArray(projectSchema)) { - for (const schemaEntry of projectSchema) { - if (typeof schemaEntry === 'string') { - schemas.push(schemaEntry); - } else if (schemaEntry) { - schemas.push(...Object.keys(schemaEntry)); - } - } - } else { - schemas.push(...Object.keys(projectSchema)); - } - - return schemas; - } - - async _updateObjectTypeDefinition( + private async _updateObjectTypeDefinition( uri: Uri, contents: CachedContent[], + project?: GraphQLProjectConfig, ): Promise { - const rootDir = this._graphQLCache.getGraphQLConfig().dirpath; - - await this._graphQLCache.updateObjectTypeDefinition(rootDir, uri, contents); + const resolvedProject = + project ?? (await this._graphQLCache.getProjectForFile(uri)); + if (resolvedProject) { + const cacheKey = this._graphQLCache._cacheKeyForProject(resolvedProject); + await this._graphQLCache.updateObjectTypeDefinition( + cacheKey, + uri, + contents, + ); + } } - _getCachedDocument(uri: string): CachedDocumentType | null { + private _getCachedDocument(uri: string): CachedDocumentType | null { if (this._textDocumentCache.has(uri)) { const cachedDocument = this._textDocumentCache.get(uri); if (cachedDocument) { @@ -1233,7 +1349,7 @@ export class MessageProcessor { return null; } - async _invalidateCache( + private async _invalidateCache( textDocument: VersionedTextDocumentIdentifier, uri: Uri, contents: CachedContent[], @@ -1261,7 +1377,7 @@ export class MessageProcessor { } } -function processDiagnosticsMessage( +export function processDiagnosticsMessage( results: Diagnostic[], query: string, range: RangeType | null, diff --git a/packages/graphql-language-service-server/src/__tests__/GraphQLCache-test.ts b/packages/graphql-language-service-server/src/__tests__/GraphQLCache.test.ts similarity index 100% rename from packages/graphql-language-service-server/src/__tests__/GraphQLCache-test.ts rename to packages/graphql-language-service-server/src/__tests__/GraphQLCache.test.ts diff --git a/packages/graphql-language-service-server/src/__tests__/GraphQLLanguageService-test.ts b/packages/graphql-language-service-server/src/__tests__/GraphQLLanguageService.test.ts similarity index 78% rename from packages/graphql-language-service-server/src/__tests__/GraphQLLanguageService-test.ts rename to packages/graphql-language-service-server/src/__tests__/GraphQLLanguageService.test.ts index 0283c277174..93dc8e4525e 100644 --- a/packages/graphql-language-service-server/src/__tests__/GraphQLLanguageService-test.ts +++ b/packages/graphql-language-service-server/src/__tests__/GraphQLLanguageService.test.ts @@ -14,6 +14,7 @@ import { GraphQLLanguageService } from '../GraphQLLanguageService'; import { SymbolKind } from 'vscode-languageserver-protocol'; import { Position } from 'graphql-language-service'; import { NoopLogger } from '../Logger'; +import { GraphQLEnumType } from 'graphql'; const MOCK_CONFIG = { filepath: join(__dirname, '.graphqlrc.yml'), @@ -37,7 +38,29 @@ describe('GraphQLLanguageService', () => { getProjectForFile(uri: string) { return this.getGraphQLConfig().getProjectForFile(uri); }, - + getFragmentDefinitions() { + const definitions = new Map(); + definitions.set('TestFragment', { + filePath: 'fake file path', + content: 'fake file content', + definition: { + kind: 'FragmentDefinition', + name: { + value: 'TestFragment', + }, + loc: { + start: 293, + end: 335, + }, + }, + }); + return definitions; + }, + // setting the defs here in duplicate as with object types below + // leads to duplicates, perhaps related to a bug, or perhaps just a test bug? + getFragmentDependenciesForAST() { + return []; + }, getObjectTypeDefinitions() { const definitions = new Map(); @@ -71,6 +94,16 @@ describe('GraphQLLanguageService', () => { start: 293, end: 335, }, + arguments: [ + { + name: { value: 'arg' }, + loc: { + start: 293, + end: 335, + }, + type: GraphQLEnumType, + }, + ], }, ], @@ -166,6 +199,23 @@ describe('GraphQLLanguageService', () => { expect(definitionQueryResult?.definitions.length).toEqual(1); }); + it('runs definition service on fragment definition', async () => { + const definitionQueryResult = await languageService.getDefinition( + 'fragment TestFragment on Human { name }', + { line: 0, character: 14 } as Position, + './queries/definitionQuery.graphql', + ); + expect(definitionQueryResult?.definitions.length).toEqual(1); + }); + it('runs definition service on fragment spread', async () => { + const definitionQueryResult = await languageService.getDefinition( + 'fragment TestFragment on Human { name }\nquery { ...TestFragment }', + { line: 1, character: 14 } as Position, + './queries/definitionQuery.graphql', + ); + expect(definitionQueryResult?.definitions.length).toEqual(1); + }); + it('runs definition service on field as expected', async () => { const definitionQueryResult = await languageService.getDefinition( 'query XXX { human { name } }', diff --git a/packages/graphql-language-service-server/src/__tests__/Logger.test.ts b/packages/graphql-language-service-server/src/__tests__/Logger.test.ts new file mode 100644 index 00000000000..82ac05fd097 --- /dev/null +++ b/packages/graphql-language-service-server/src/__tests__/Logger.test.ts @@ -0,0 +1,39 @@ +import { Logger } from '../Logger'; + +describe('Logger', () => { + const connection = { + console: { + error: jest.fn(), + warn: jest.fn(), + info: jest.fn(), + log: jest.fn(), + }, + onDidChangeConfiguration: jest.fn(), + workspace: { + getConfiguration: jest.fn(), + }, + }; + + beforeEach(() => { + jest.clearAllMocks(); + }); + + it('should initialize with default log level, and ignore .log intentionally', () => { + const logger = new Logger(connection as any); + expect(logger).toBeDefined(); + expect(logger.logLevel).toBe(0); + logger.log('test'); + expect(connection.console.log).toHaveBeenCalledTimes(0); + }); + + it('should not change log level when settings are not passed', () => { + const logger = new Logger(connection as any, true); + expect(logger).toBeDefined(); + expect(logger.logLevel).toBe(1); + logger.log('test'); + expect(connection.console.log).toHaveBeenCalledTimes(1); + expect(logger.logLevel).toBe(1); + logger.log('test'); + expect(connection.console.log).toHaveBeenCalledTimes(2); + }); +}); diff --git a/packages/graphql-language-service-server/src/__tests__/MessageProcessor-test.ts b/packages/graphql-language-service-server/src/__tests__/MessageProcessor-test.ts deleted file mode 100644 index e2c2ecdaaf9..00000000000 --- a/packages/graphql-language-service-server/src/__tests__/MessageProcessor-test.ts +++ /dev/null @@ -1,601 +0,0 @@ -/** - * Copyright (c) 2021 GraphQL Contributors - * All rights reserved. - * - * This source code is licensed under the license found in the - * LICENSE file in the root directory of this source tree. - * - */ -import { SymbolKind } from 'vscode-languageserver'; -import { FileChangeType } from 'vscode-languageserver-protocol'; -import { Position, Range } from 'graphql-language-service'; - -import { MessageProcessor } from '../MessageProcessor'; -import { parseDocument } from '../parseDocument'; - -jest.mock('../Logger'); - -import { GraphQLCache } from '../GraphQLCache'; - -import { loadConfig } from 'graphql-config'; - -import type { DefinitionQueryResult, Outline } from 'graphql-language-service'; - -import { NoopLogger } from '../Logger'; -import { pathToFileURL } from 'node:url'; -import mockfs from 'mock-fs'; -import { join } from 'node:path'; - -jest.mock('node:fs', () => ({ - ...jest.requireActual('fs'), - readFileSync: jest.fn(jest.requireActual('fs').readFileSync), -})); - -describe('MessageProcessor', () => { - const logger = new NoopLogger(); - const messageProcessor = new MessageProcessor({ - // @ts-ignore - connection: {}, - logger, - graphqlFileExtensions: ['graphql'], - loadConfigOptions: { rootDir: __dirname }, - }); - - const queryPathUri = pathToFileURL(`${__dirname}/__queries__`); - const textDocumentTestString = ` - { - hero(episode: NEWHOPE){ - } - } - `; - - beforeEach(async () => { - const gqlConfig = await loadConfig({ rootDir: __dirname, extensions: [] }); - // loadConfig.mockRestore(); - messageProcessor._settings = { load: {} }; - messageProcessor._graphQLCache = new GraphQLCache({ - configDir: __dirname, - config: gqlConfig, - parser: parseDocument, - logger: new NoopLogger(), - }); - messageProcessor._languageService = { - // @ts-ignore - getAutocompleteSuggestions(query, position, uri) { - return [{ label: `${query} at ${uri}` }]; - }, - // @ts-ignore - getDiagnostics(_query, _uri) { - return []; - }, - async getDocumentSymbols(_query: string, uri: string) { - return [ - { - name: 'item', - kind: SymbolKind.Field, - location: { - uri, - range: { - start: { line: 1, character: 2 }, - end: { line: 1, character: 4 }, - }, - }, - }, - ]; - }, - async getOutline(_query: string): Promise { - return { - outlineTrees: [ - { - representativeName: 'item', - kind: 'Field', - startPosition: new Position(1, 2), - endPosition: new Position(1, 4), - children: [], - }, - ], - }; - }, - async getDefinition( - _query, - position, - uri, - ): Promise { - return { - queryRange: [new Range(position, position)], - definitions: [ - { - position, - path: uri, - }, - ], - }; - }, - }; - }); - - let getConfigurationReturnValue = {}; - // @ts-ignore - messageProcessor._connection = { - // @ts-ignore - get workspace() { - return { - async getConfiguration() { - return [getConfigurationReturnValue]; - }, - }; - }, - }; - - const initialDocument = { - textDocument: { - text: textDocumentTestString, - uri: `${queryPathUri}/test.graphql`, - version: 0, - }, - }; - - messageProcessor._isInitialized = true; - - it('initializes properly and opens a file', async () => { - const { capabilities } = await messageProcessor.handleInitializeRequest( - // @ts-ignore - { - rootPath: __dirname, - }, - null, - __dirname, - ); - expect(capabilities.definitionProvider).toEqual(true); - expect(capabilities.workspaceSymbolProvider).toEqual(true); - expect(capabilities.completionProvider.resolveProvider).toEqual(true); - expect(capabilities.textDocumentSync).toEqual(1); - }); - - it('runs completion requests properly', async () => { - const uri = `${queryPathUri}/test2.graphql`; - const query = 'test'; - messageProcessor._textDocumentCache.set(uri, { - version: 0, - contents: [ - { - query, - range: new Range(new Position(0, 0), new Position(0, 0)), - }, - ], - }); - - const test = { - position: new Position(0, 0), - textDocument: { uri }, - }; - const result = await messageProcessor.handleCompletionRequest(test); - expect(result).toEqual({ - items: [{ label: `${query} at ${uri}` }], - isIncomplete: false, - }); - }); - - it('runs document symbol requests', async () => { - const uri = `${queryPathUri}/test3.graphql`; - const validQuery = ` - { - hero(episode: EMPIRE){ - ...testFragment - } - } - `; - - const newDocument = { - textDocument: { - text: validQuery, - uri, - version: 0, - }, - }; - - messageProcessor._textDocumentCache.set(uri, { - version: 0, - contents: [ - { - query: validQuery, - range: new Range(new Position(0, 0), new Position(0, 0)), - }, - ], - }); - - const test = { - textDocument: newDocument.textDocument, - }; - - const result = await messageProcessor.handleDocumentSymbolRequest(test); - - expect(result).not.toBeUndefined(); - expect(result.length).toEqual(1); - expect(result[0].name).toEqual('item'); - expect(result[0].kind).toEqual(SymbolKind.Field); - expect(result[0].location.range).toEqual({ - start: { line: 1, character: 2 }, - end: { line: 1, character: 4 }, - }); - }); - - it('properly changes the file cache with the didChange handler', async () => { - const uri = `${queryPathUri}/test.graphql`; - messageProcessor._textDocumentCache.set(uri, { - version: 1, - contents: [ - { - query: '', - range: new Range(new Position(0, 0), new Position(0, 0)), - }, - ], - }); - const textDocumentChangedString = ` - { - hero(episode: NEWHOPE){ - name - } - } - `; - - const result = await messageProcessor.handleDidChangeNotification({ - textDocument: { - // @ts-ignore - text: textDocumentTestString, - uri, - version: 1, - }, - contentChanges: [ - { text: textDocumentTestString }, - { text: textDocumentChangedString }, - ], - }); - // Query fixed, no more errors - expect(result.diagnostics.length).toEqual(0); - }); - - it('does not crash on null value returned in response to workspace configuration', async () => { - const previousConfigurationValue = getConfigurationReturnValue; - getConfigurationReturnValue = null; - await expect( - messageProcessor.handleDidChangeConfiguration(), - ).resolves.toStrictEqual({}); - getConfigurationReturnValue = previousConfigurationValue; - }); - - it('properly removes from the file cache with the didClose handler', async () => { - await messageProcessor.handleDidCloseNotification(initialDocument); - - const position = { line: 4, character: 5 }; - const params = { textDocument: initialDocument.textDocument, position }; - - // Should throw because file has been deleted from cache - try { - const result = await messageProcessor.handleCompletionRequest(params); - expect(result).toEqual(null); - } catch {} - }); - - // modified to work with jest.mock() of WatchmanClient - it('runs definition requests', async () => { - jest.setTimeout(10000); - const validQuery = ` - { - hero(episode: EMPIRE){ - ...testFragment - } - } - `; - - const newDocument = { - textDocument: { - text: validQuery, - uri: `${queryPathUri}/test3.graphql`, - version: 1, - }, - }; - messageProcessor._getCachedDocument = (_uri: string) => ({ - version: 1, - contents: [ - { - query: validQuery, - range: new Range(new Position(0, 0), new Position(20, 4)), - }, - ], - }); - - await messageProcessor.handleDidOpenOrSaveNotification(newDocument); - - const test = { - position: new Position(3, 15), - textDocument: newDocument.textDocument, - }; - - const result = await messageProcessor.handleDefinitionRequest(test); - await expect(result[0].uri).toEqual(`${queryPathUri}/test3.graphql`); - }); - - describe('handleDidOpenOrSaveNotification', () => { - const mockReadFileSync: jest.Mock = - jest.requireMock('node:fs').readFileSync; - - beforeEach(() => { - mockReadFileSync.mockReturnValue(''); - messageProcessor._updateGraphQLConfig = jest.fn(); - }); - it('updates config for standard config filename changes', async () => { - await messageProcessor.handleDidOpenOrSaveNotification({ - textDocument: { - uri: `${pathToFileURL('.')}/.graphql.config.js`, - languageId: 'js', - version: 0, - text: '', - }, - }); - - expect(messageProcessor._updateGraphQLConfig).toHaveBeenCalled(); - }); - - it('updates config for custom config filename changes', async () => { - const customConfigName = 'custom-config-name.yml'; - messageProcessor._settings = { load: { fileName: customConfigName } }; - - await messageProcessor.handleDidOpenOrSaveNotification({ - textDocument: { - uri: `${pathToFileURL('.')}/${customConfigName}`, - languageId: 'js', - version: 0, - text: '', - }, - }); - - expect(messageProcessor._updateGraphQLConfig).toHaveBeenCalled(); - }); - - it('handles config requests with no config', async () => { - messageProcessor._settings = {}; - - await messageProcessor.handleDidChangeConfiguration({ - settings: [], - }); - - expect(messageProcessor._updateGraphQLConfig).toHaveBeenCalled(); - - await messageProcessor.handleDidOpenOrSaveNotification({ - textDocument: { - uri: `${pathToFileURL('.')}/.graphql.config.js`, - languageId: 'js', - version: 0, - text: '', - }, - }); - - expect(messageProcessor._updateGraphQLConfig).toHaveBeenCalled(); - }); - }); - - describe('handleWatchedFilesChangedNotification', () => { - const mockReadFileSync: jest.Mock = - jest.requireMock('node:fs').readFileSync; - - beforeEach(() => { - mockReadFileSync.mockReturnValue(''); - messageProcessor._updateGraphQLConfig = jest.fn(); - }); - - it('skips config updates for normal file changes', async () => { - await messageProcessor.handleWatchedFilesChangedNotification({ - changes: [ - { - uri: `${pathToFileURL('.')}/foo.graphql`, - type: FileChangeType.Changed, - }, - ], - }); - - expect(messageProcessor._updateGraphQLConfig).not.toHaveBeenCalled(); - }); - }); - - describe('handleWatchedFilesChangedNotification without graphql config', () => { - const mockReadFileSync: jest.Mock = - jest.requireMock('node:fs').readFileSync; - - beforeEach(() => { - mockReadFileSync.mockReturnValue(''); - messageProcessor._graphQLConfig = undefined; - messageProcessor._isGraphQLConfigMissing = true; - messageProcessor._parser = jest.fn(); - }); - - it('skips config updates for normal file changes', async () => { - await messageProcessor.handleWatchedFilesChangedNotification({ - changes: [ - { - uri: `${pathToFileURL('.')}/foo.js`, - type: FileChangeType.Changed, - }, - ], - }); - expect(messageProcessor._parser).not.toHaveBeenCalled(); - }); - }); - - describe('handleDidChangedNotification without graphql config', () => { - const mockReadFileSync: jest.Mock = - jest.requireMock('node:fs').readFileSync; - - beforeEach(() => { - mockReadFileSync.mockReturnValue(''); - messageProcessor._graphQLConfig = undefined; - messageProcessor._isGraphQLConfigMissing = true; - messageProcessor._parser = jest.fn(); - }); - - it('skips config updates for normal file changes', async () => { - await messageProcessor.handleDidChangeNotification({ - textDocument: { - uri: `${pathToFileURL('.')}/foo.js`, - version: 1, - }, - contentChanges: [{ text: 'var something' }], - }); - expect(messageProcessor._parser).not.toHaveBeenCalled(); - }); - }); -}); - -describe('MessageProcessor with no config', () => { - let messageProcessor: MessageProcessor; - const mockRoot = join('/tmp', 'test'); - let loggerSpy: jest.SpyInstance; - - const mockProcessor = (query: string, config?: string) => { - const items = { - 'query.graphql': query, - 'node_modules/parse-json': mockfs.load('node_modules/parse-json'), - }; - if (config) { - items['graphql.config.js'] = config; - } - const files: Record> = { - [mockRoot]: mockfs.directory({ - items, - }), - // node_modules: mockfs.load('node_modules'), - }; - mockfs(files); - const logger = new NoopLogger(); - loggerSpy = jest.spyOn(logger, 'error'); - messageProcessor = new MessageProcessor({ - // @ts-ignore - connection: { - // @ts-ignore - get workspace() { - return { - async getConfiguration() { - return []; - }, - }; - }, - }, - logger, - graphqlFileExtensions: ['graphql'], - loadConfigOptions: { rootDir: mockRoot }, - }); - }; - - beforeEach(() => {}); - - afterEach(() => { - mockfs.restore(); - }); - it('fails to initialize with empty config file', async () => { - mockProcessor('query { foo }', ''); - await messageProcessor.handleInitializeRequest( - // @ts-ignore - { - rootPath: mockRoot, - }, - null, - mockRoot, - ); - await messageProcessor.handleDidOpenOrSaveNotification({ - textDocument: { - text: 'query { foo }', - uri: `${mockRoot}/query.graphql`, - version: 1, - }, - }); - expect(messageProcessor._isInitialized).toEqual(false); - expect(messageProcessor._isGraphQLConfigMissing).toEqual(true); - expect(loggerSpy).toHaveBeenCalledTimes(1); - expect(loggerSpy).toHaveBeenCalledWith( - expect.stringMatching( - /GraphQL Config file is not available in the provided config directory/, - ), - ); - }); - it('fails to initialize with no config file present', async () => { - mockProcessor('query { foo }'); - await messageProcessor.handleInitializeRequest( - // @ts-ignore - { - rootPath: mockRoot, - }, - null, - mockRoot, - ); - await messageProcessor.handleDidOpenOrSaveNotification({ - textDocument: { - text: 'query { foo }', - uri: `${mockRoot}/query.graphql`, - version: 1, - }, - }); - expect(messageProcessor._isInitialized).toEqual(false); - expect(messageProcessor._isGraphQLConfigMissing).toEqual(true); - expect(loggerSpy).toHaveBeenCalledTimes(1); - expect(loggerSpy).toHaveBeenCalledWith( - expect.stringMatching( - /GraphQL Config file is not available in the provided config directory/, - ), - ); - }); - it('initializes when presented with a valid config later', async () => { - mockProcessor('query { foo }'); - await messageProcessor.handleInitializeRequest( - // @ts-ignore - { - rootPath: mockRoot, - }, - null, - mockRoot, - ); - await messageProcessor.handleDidOpenOrSaveNotification({ - textDocument: { - text: 'query { foo }', - uri: `${mockRoot}/query.graphql`, - version: 1, - }, - }); - expect(messageProcessor._isInitialized).toEqual(false); - expect(loggerSpy).toHaveBeenCalledTimes(1); - // todo: get mockfs working with in-test file changes - // mockfs.restore(); - // mockfs({ - // [mockRoot]: mockfs.directory({ - // mode: 0o755, - // items: { - // 'schema.graphql': - // 'type Query { foo: String }\nschema { query: Query }', - // 'graphql.config.js': mockfs.file({ - // content: 'module.exports = { schema: "schema.graphql" };', - // mode: 0o644, - // }), - // 'query.graphql': 'query { foo }', - // // 'node_modules/graphql-config/node_modules': mockfs.load( - // // 'node_modules/graphql-config/node_modules', - // // ), - // }, - // }), - // }); - // // console.log(readdirSync(`${mockRoot}`)); - // await messageProcessor.handleDidOpenOrSaveNotification({ - // textDocument: { - // text: 'module.exports = { schema: `schema.graphql` }', - // uri: `${mockRoot}/graphql.config.js`, - // version: 2, - // }, - // }); - - // expect(messageProcessor._isGraphQLConfigMissing).toEqual(false); - - // expect(loggerSpy).toHaveBeenCalledWith( - // expect.stringMatching( - // /GraphQL Config file is not available in the provided config directory/, - // ), - // ); - }); -}); diff --git a/packages/graphql-language-service-server/src/__tests__/MessageProcessor.spec.ts b/packages/graphql-language-service-server/src/__tests__/MessageProcessor.spec.ts new file mode 100644 index 00000000000..f5a9a091160 --- /dev/null +++ b/packages/graphql-language-service-server/src/__tests__/MessageProcessor.spec.ts @@ -0,0 +1,610 @@ +import mockfs from 'mock-fs'; +import { join } from 'node:path'; +import { MockFile, MockProject } from './__utils__/MockProject'; +// import { readFileSync } from 'node:fs'; +import { FileChangeType } from 'vscode-languageserver'; +import { serializeRange } from './__utils__/utils'; +import { readFile } from 'node:fs/promises'; +import { existsSync } from 'node:fs'; +import { URI } from 'vscode-uri'; +import { GraphQLSchema, introspectionFromSchema } from 'graphql'; +import fetchMock from 'fetch-mock'; + +jest.mock('@whatwg-node/fetch', () => { + const { AbortController } = require('node-abort-controller'); + + return { + fetch: require('fetch-mock').fetchHandler, + AbortController, + TextDecoder: global.TextDecoder, + }; +}); + +const mockSchema = (schema: GraphQLSchema) => { + const introspectionResult = { + data: introspectionFromSchema(schema, { + descriptions: true, + }), + }; + fetchMock.mock({ + matcher: '*', + response: { + headers: { + 'Content-Type': 'application/json', + }, + body: introspectionResult, + }, + }); +}; + +const defaultFiles = [ + ['query.graphql', 'query { bar ...B }'], + ['fragments.graphql', 'fragment B on Foo { bar }'], +] as MockFile[]; +const schemaFile: MockFile = [ + 'schema.graphql', + 'type Query { foo: Foo, test: Test }\n\ntype Foo { bar: String }\n\ntype Test { test: Foo }', +]; + +const fooTypePosition = { + start: { line: 2, character: 0 }, + end: { line: 2, character: 24 }, +}; + +const fooInlineTypePosition = { + start: { line: 5, character: 0 }, + end: { line: 5, character: 24 }, +}; + +const genSchemaPath = + '/tmp/graphql-language-service/test/projects/default/generated-schema.graphql'; + +// TODO: +// - reorganize into multiple files +// - potentially a high level abstraction and/or it.each() for a pathway across configs, file extensions, etc. +// this may be cumbersome with offset position assertions but possible +// if we can create consistency that doesn't limit variability +// - convert each it() into a nested describe() block (or a top level describe() in another file), and sprinkle in it() statements to replace comments +// - fix TODO comments where bugs were found that couldn't be resolved quickly (2-4hr time box) + +describe('MessageProcessor with no config', () => { + afterEach(() => { + mockfs.restore(); + fetchMock.restore(); + }); + it('fails to initialize with empty config file', async () => { + const project = new MockProject({ + files: [...defaultFiles, ['graphql.config.json', '']], + }); + await project.init(); + + expect(project.lsp._logger.info).toHaveBeenCalledTimes(1); + expect(project.lsp._logger.error).toHaveBeenCalledTimes(1); + expect(project.lsp._logger.error).toHaveBeenCalledWith( + expect.stringMatching( + /GraphQL Config file is not available in the provided config directory/, + ), + ); + expect(project.lsp._isInitialized).toEqual(false); + expect(project.lsp._isGraphQLConfigMissing).toEqual(true); + project.lsp.handleShutdownRequest(); + }); + it('fails to initialize with no config file present', async () => { + const project = new MockProject({ + files: [...defaultFiles], + }); + await project.init(); + + expect(project.lsp._logger.error).toHaveBeenCalledTimes(1); + expect(project.lsp._logger.error).toHaveBeenCalledWith( + expect.stringMatching( + /GraphQL Config file is not available in the provided config directory/, + ), + ); + expect(project.lsp._isInitialized).toEqual(false); + expect(project.lsp._isGraphQLConfigMissing).toEqual(true); + project.lsp.handleShutdownRequest(); + }); + it('initializes when presented with a valid config later', async () => { + const project = new MockProject({ + files: [...defaultFiles], + }); + await project.init(); + expect(project.lsp._isInitialized).toEqual(false); + expect(project.lsp._isGraphQLConfigMissing).toEqual(true); + expect(project.lsp._logger.error).toHaveBeenCalledTimes(1); + + project.changeFile( + 'graphql.config.json', + '{ "schema": "./schema.graphql" }', + ); + // TODO: this should work for on watched file changes as well! + await project.lsp.handleDidOpenOrSaveNotification({ + textDocument: { + uri: project.uri('graphql.config.json'), + }, + }); + expect(project.lsp._isInitialized).toEqual(true); + expect(project.lsp._isGraphQLConfigMissing).toEqual(false); + expect(project.lsp._graphQLCache).toBeDefined(); + project.lsp.handleShutdownRequest(); + }); +}); + +describe('MessageProcessor with config', () => { + afterEach(() => { + mockfs.restore(); + fetchMock.restore(); + }); + // beforeAll(async () => { + // app = await import('../../../graphiql/test/e2e-server'); + // }); + // afterAll(() => { + // app.server.close(); + // app.wsServer.close(); + // }); + it('caches files and schema with .graphql file config, and the schema updates with watched file changes', async () => { + const project = new MockProject({ + files: [ + schemaFile, + [ + 'graphql.config.json', + '{ "schema": "./schema.graphql", "documents": "./**.graphql" }', + ], + ...defaultFiles, + ], + }); + const results = await project.init('query.graphql'); + expect(results.diagnostics[0].message).toEqual( + 'Cannot query field "bar" on type "Query".', + ); + expect(results.diagnostics[1].message).toEqual( + 'Fragment "B" cannot be spread here as objects of type "Query" can never be of type "Foo".', + ); + const initSchemaDefRequest = await project.lsp.handleDefinitionRequest({ + textDocument: { uri: project.uri('schema.graphql') }, + position: { character: 19, line: 0 }, + }); + expect(initSchemaDefRequest.length).toEqual(1); + expect(initSchemaDefRequest[0].uri).toEqual(project.uri('schema.graphql')); + expect(serializeRange(initSchemaDefRequest[0].range)).toEqual( + fooTypePosition, + ); + expect(project.lsp._logger.error).not.toHaveBeenCalled(); + expect(await project.lsp._graphQLCache.getSchema('default')).toBeDefined(); + // TODO: for some reason the cache result formats the graphql query?? + const docCache = project.lsp._textDocumentCache; + expect( + docCache.get(project.uri('query.graphql'))!.contents[0].query, + ).toContain('...B'); + const schemaDefinitions = await project.lsp.handleDefinitionRequest({ + textDocument: { uri: project.uri('fragments.graphql') }, + position: { character: 16, line: 0 }, + }); + expect(schemaDefinitions[0].uri).toEqual(project.uri('schema.graphql')); + + expect(serializeRange(schemaDefinitions[0].range)).toEqual(fooTypePosition); + + // query definition request of fragment name jumps to the fragment definition + const firstQueryDefRequest = await project.lsp.handleDefinitionRequest({ + textDocument: { uri: project.uri('query.graphql') }, + position: { character: 16, line: 0 }, + }); + + expect(firstQueryDefRequest[0].uri).toEqual( + project.uri('fragments.graphql'), + ); + expect(serializeRange(firstQueryDefRequest[0].range)).toEqual({ + start: { + line: 0, + character: 0, + }, + end: { + line: 2, + character: 1, + }, + }); + + // change the file to make the fragment invalid + project.changeFile( + 'schema.graphql', + // now Foo has a bad field, the fragment should be invalid + 'type Query { foo: Foo, test: Test }\n\n type Test { test: String }\n\n\n\n\ntype Foo { bad: Int }', + ); + await project.lsp.handleWatchedFilesChangedNotification({ + changes: [ + { uri: project.uri('schema.graphql'), type: FileChangeType.Changed }, + ], + }); + const typeCache = + project.lsp._graphQLCache._typeDefinitionsCache.get('/tmp/test-default'); + expect(typeCache?.get('Test')?.definition.name.value).toEqual('Test'); + + // test in-file schema defs! important! + const schemaDefRequest = await project.lsp.handleDefinitionRequest({ + textDocument: { uri: project.uri('schema.graphql') }, + position: { character: 19, line: 0 }, + }); + + const fooLaterTypePosition = { + start: { line: 7, character: 0 }, + end: { line: 7, character: 21 }, + }; + expect(schemaDefRequest.length).toEqual(1); + expect(schemaDefRequest[0].uri).toEqual(project.uri('schema.graphql')); + expect(serializeRange(schemaDefRequest[0].range)).toEqual( + fooLaterTypePosition, + ); + expect(project.lsp._logger.error).not.toHaveBeenCalled(); + // change the file to make the fragment invalid + project.changeFile( + 'schema.graphql', + // now Foo has a bad field, the fragment should be invalid + 'type Query { foo: Foo, test: Test }\n\n type Test { test: String }\n\n\n\n\n\ntype Foo { bad: Int }', + ); + // await project.lsp.handleWatchedFilesChangedNotification({ + // changes: [ + // { + // type: FileChangeType.Changed, + // uri: project.uri('schema.graphql'), + // }, + // ], + // }); + await project.lsp.handleDidChangeNotification({ + contentChanges: [ + { + type: FileChangeType.Changed, + text: 'type Query { foo: Foo, test: Test }\n\n type Test { test: String }\n\n\n\n\n\ntype Foo { bad: Int }', + }, + ], + textDocument: { uri: project.uri('schema.graphql'), version: 1 }, + }); + + const schemaDefRequest2 = await project.lsp.handleDefinitionRequest({ + textDocument: { uri: project.uri('schema.graphql') }, + position: { character: 19, line: 0 }, + }); + + const fooLaterTypePosition2 = { + start: { line: 8, character: 0 }, + end: { line: 8, character: 21 }, + }; + expect(schemaDefRequest2.length).toEqual(1); + expect(schemaDefRequest2[0].uri).toEqual(project.uri('schema.graphql')); + expect(serializeRange(schemaDefRequest2[0].range)).toEqual( + fooLaterTypePosition2, + ); + + // TODO: this fragment should now be invalid + const result = await project.lsp.handleDidOpenOrSaveNotification({ + textDocument: { uri: project.uri('fragments.graphql') }, + }); + expect(result.diagnostics[0].message).toEqual( + 'Cannot query field "bar" on type "Foo". Did you mean "bad"?', + ); + const generatedFile = existsSync(join(genSchemaPath)); + // this generated file should not exist because the schema is local! + expect(generatedFile).toEqual(false); + // simulating codegen + project.changeFile( + 'fragments.graphql', + 'fragment A on Foo { bad }\n\nfragment B on Test { test }', + ); + await project.lsp.handleWatchedFilesChangedNotification({ + changes: [ + { uri: project.uri('fragments.graphql'), type: FileChangeType.Changed }, + ], + }); + + // TODO: this interface should maybe not be tested here but in unit tests + const fragCache = + project.lsp._graphQLCache._fragmentDefinitionsCache.get( + '/tmp/test-default', + ); + expect(fragCache?.get('A')?.definition.name.value).toEqual('A'); + expect(fragCache?.get('B')?.definition.name.value).toEqual('B'); + const queryFieldDefRequest = await project.lsp.handleDefinitionRequest({ + textDocument: { uri: project.uri('fragments.graphql') }, + position: { character: 22, line: 0 }, + }); + expect(queryFieldDefRequest[0].uri).toEqual(project.uri('schema.graphql')); + expect(serializeRange(queryFieldDefRequest[0].range)).toEqual({ + start: { + line: 8, + character: 11, + }, + end: { + line: 8, + character: 19, + }, + }); + + // on the second request, the position has changed + const secondQueryDefRequest = await project.lsp.handleDefinitionRequest({ + textDocument: { uri: project.uri('query.graphql') }, + position: { character: 16, line: 0 }, + }); + expect(secondQueryDefRequest[0].uri).toEqual( + project.uri('fragments.graphql'), + ); + expect(serializeRange(secondQueryDefRequest[0].range)).toEqual({ + start: { + line: 2, + character: 0, + }, + end: { + line: 2, + character: 27, + }, + }); + // definitions request for fragments jumps to a different place in schema.graphql now + const schemaDefinitionsAgain = await project.lsp.handleDefinitionRequest({ + textDocument: { uri: project.uri('fragments.graphql') }, + position: { character: 16, line: 0 }, + }); + expect(schemaDefinitionsAgain[0].uri).toEqual( + project.uri('schema.graphql'), + ); + + expect(serializeRange(schemaDefinitionsAgain[0].range)).toEqual( + fooLaterTypePosition2, + ); + expect(project.lsp._logger.error).not.toHaveBeenCalled(); + project.lsp.handleShutdownRequest(); + }); + + it('caches files and schema with a URL config', async () => { + mockSchema(require('../../../graphiql/test/schema')); + + const project = new MockProject({ + files: [ + ['query.graphql', 'query { test { isTest, ...T } }'], + ['fragments.graphql', 'fragment T on Test {\n isTest \n}'], + [ + 'graphql.config.json', + '{ "schema": "http://localhost:3100/graphql", "documents": "./**" }', + ], + ], + }); + + const initParams = await project.init('query.graphql'); + expect(project.lsp._logger.error).not.toHaveBeenCalled(); + + expect(initParams.diagnostics).toEqual([]); + + const changeParams = await project.lsp.handleDidChangeNotification({ + textDocument: { uri: project.uri('query.graphql'), version: 1 }, + contentChanges: [{ text: 'query { test { isTest, ...T or } }' }], + }); + expect(changeParams?.diagnostics[0].message).toEqual( + 'Cannot query field "or" on type "Test".', + ); + expect(await project.lsp._graphQLCache.getSchema('default')).toBeDefined(); + + // schema file is present and contains schema + const file = await readFile(join(genSchemaPath), { encoding: 'utf-8' }); + expect(file.split('\n').length).toBeGreaterThan(10); + + // hover works + const hover = await project.lsp.handleHoverRequest({ + position: { + character: 10, + line: 0, + }, + textDocument: { uri: project.uri('query.graphql') }, + }); + expect(hover.contents).toContain('`test` field from `Test` type.'); + + // ensure that fragment definitions work + const definitions = await project.lsp.handleDefinitionRequest({ + textDocument: { uri: project.uri('query.graphql') }, // console.log(project.uri('query.graphql')) + position: { character: 26, line: 0 }, + }); + expect(definitions[0].uri).toEqual(project.uri('fragments.graphql')); + expect(serializeRange(definitions[0].range)).toEqual({ + start: { + line: 0, + character: 0, + }, + end: { + line: 2, + character: 1, + }, + }); + + const typeDefinitions = await project.lsp.handleDefinitionRequest({ + textDocument: { uri: project.uri('fragments.graphql') }, + position: { character: 15, line: 0 }, + }); + + expect(typeDefinitions[0].uri).toEqual(URI.parse(genSchemaPath).toString()); + + expect(serializeRange(typeDefinitions[0].range)).toEqual({ + start: { + line: 11, + character: 0, + }, + end: { + line: 102, + character: 1, + }, + }); + + const schemaDefs = await project.lsp.handleDefinitionRequest({ + textDocument: { uri: URI.parse(genSchemaPath).toString() }, + position: { character: 20, line: 18 }, + }); + expect(schemaDefs[0].uri).toEqual(URI.parse(genSchemaPath).toString()); + // note: if the graphiql test schema changes, + // this might break, please adjust if you see a failure here + expect(serializeRange(schemaDefs[0].range)).toEqual({ + start: { + line: 104, + character: 0, + }, + end: { + line: 112, + character: 1, + }, + }); + // lets remove the fragments file + await project.deleteFile('fragments.graphql'); + // and add a fragments.ts file, watched + await project.addFile( + 'fragments.ts', + '\n\n\nexport const fragment = gql`\n\n fragment T on Test { isTest } \n query { hasArgs(string: "") }\n`', + true, + ); + + await project.lsp.handleWatchedFilesChangedNotification({ + changes: [ + { uri: project.uri('fragments.ts'), type: FileChangeType.Created }, + ], + }); + const defsForTs = await project.lsp.handleDefinitionRequest({ + textDocument: { uri: project.uri('query.graphql') }, + position: { character: 26, line: 0 }, + }); + // this one is really important + expect(defsForTs[0].uri).toEqual(project.uri('fragments.ts')); + expect(serializeRange(defsForTs[0].range)).toEqual({ + start: { + line: 5, + character: 2, + }, + end: { + line: 5, + character: 31, + }, + }); + const defsForArgs = await project.lsp.handleDefinitionRequest({ + textDocument: { uri: project.uri('fragments.ts') }, + position: { character: 19, line: 6 }, + }); + + expect(defsForArgs[0].uri).toEqual(URI.parse(genSchemaPath).toString()); + expect(project.lsp._logger.error).not.toHaveBeenCalled(); + project.lsp.handleShutdownRequest(); + }); + + it('caches multiple projects with files and schema with a URL config and a local schema', async () => { + mockSchema(require('../../../graphiql/test/schema')); + + const project = new MockProject({ + files: [ + [ + 'a/fragments.ts', + '\n\n\nexport const fragment = gql`\n\n fragment TestFragment on Test { isTest }\n`', + ], + [ + 'a/query.ts', + '\n\n\nexport const query = graphql`query { test { isTest ...T } }`', + ], + + [ + 'b/query.ts', + 'import graphql from "graphql"\n\n\nconst a = graphql` query example { test() { isTest ...T } }`', + ], + [ + 'b/fragments.ts', + '\n\n\nexport const fragment = gql`\n\n fragment T on Test { isTest }\n`', + ], + [ + 'b/schema.ts', + `\n\nexport const schema = gql(\`\n${schemaFile[1]}\`)`, + ], + [ + 'package.json', + `{ "graphql": { "projects": { + "a": { "schema": "http://localhost:3100/graphql", "documents": "./a/**" }, + "b": { "schema": "./b/schema.ts", "documents": "./b/**" } } + } + }`, + ], + schemaFile, + ], + }); + + const initParams = await project.init('a/query.ts'); + expect(initParams.diagnostics[0].message).toEqual('Unknown fragment "T".'); + + expect(project.lsp._logger.error).not.toHaveBeenCalled(); + expect(await project.lsp._graphQLCache.getSchema('a')).toBeDefined(); + const file = await readFile(join(genSchemaPath.replace('default', 'a')), { + encoding: 'utf-8', + }); + expect(file.split('\n').length).toBeGreaterThan(10); + // add a new typescript file with empty query to the b project + // and expect autocomplete to only show options for project b + await project.addFile( + 'b/empty.ts', + 'import gql from "graphql-tag"\ngql`query a { }`', + ); + const completion = await project.lsp.handleCompletionRequest({ + textDocument: { uri: project.uri('b/empty.ts') }, + position: { character: 13, line: 1 }, + }); + + expect(completion.items?.length).toEqual(5); + expect(completion.items.map(i => i.label)).toEqual([ + 'foo', + 'test', + '__typename', + '__schema', + '__type', + ]); + // this confirms that autocomplete respects cross-project boundaries for types. + // it performs a definition request for the foo field in Query + const schemaCompletion1 = await project.lsp.handleCompletionRequest({ + textDocument: { uri: project.uri('b/schema.ts') }, + position: { character: 21, line: 3 }, + }); + expect(schemaCompletion1.items.map(i => i.label)).toEqual(['Foo']); + // it performs a definition request for the Foo type in Test.test + const schemaDefinition = await project.lsp.handleDefinitionRequest({ + textDocument: { uri: project.uri('b/schema.ts') }, + position: { character: 21, line: 6 }, + }); + expect(serializeRange(schemaDefinition[0].range)).toEqual( + fooInlineTypePosition, + ); + expect(project.lsp._logger.error).not.toHaveBeenCalled(); + // simulate a watched schema file change (codegen, etc) + project.changeFile( + 'b/schema.ts', + `\n\nexport const schema = gql(\`\n${ + schemaFile[1] + '\ntype Example1 { field: }' + }\`\n)`, + ); + await project.lsp.handleWatchedFilesChangedNotification({ + changes: [ + { uri: project.uri('b/schema.ts'), type: FileChangeType.Changed }, + ], + }); + // TODO: repeat this with other changes to the schema file and use a + // didChange event to see if the schema updates properly as well + // await project.lsp.handleDidChangeNotification({ + // textDocument: { uri: project.uri('b/schema.graphql'), version: 1 }, + // contentChanges: [ + // { text: schemaFile[1] + '\ntype Example1 { field: }' }, + // ], + // }); + // console.log(project.fileCache.get('b/schema.graphql')); + const schemaCompletion = await project.lsp.handleCompletionRequest({ + textDocument: { uri: project.uri('b/schema.ts') }, + position: { character: 25, line: 8 }, + }); + // TODO: SDL completion still feels incomplete here... where is Int? + // where is self-referential Example1? + expect(schemaCompletion.items.map(i => i.label)).toEqual([ + 'Query', + 'Foo', + 'String', + 'Test', + 'Boolean', + ]); + + expect(project.lsp._logger.error).not.toHaveBeenCalled(); + project.lsp.handleShutdownRequest(); + }); +}); diff --git a/packages/graphql-language-service-server/src/__tests__/MessageProcessor.test.ts b/packages/graphql-language-service-server/src/__tests__/MessageProcessor.test.ts new file mode 100644 index 00000000000..381d7755b87 --- /dev/null +++ b/packages/graphql-language-service-server/src/__tests__/MessageProcessor.test.ts @@ -0,0 +1,981 @@ +/** + * Copyright (c) 2021 GraphQL Contributors + * All rights reserved. + * + * This source code is licensed under the license found in the + * LICENSE file in the root directory of this source tree. + * + */ +import { SymbolKind } from 'vscode-languageserver'; +import { FileChangeType } from 'vscode-languageserver-protocol'; +import { Position, Range } from 'graphql-language-service'; + +import { + MessageProcessor, + processDiagnosticsMessage, +} from '../MessageProcessor'; +import { parseDocument } from '../parseDocument'; + +jest.mock('../Logger'); + +jest.setTimeout(20000); + +import { GraphQLCache } from '../GraphQLCache'; + +import { + ConfigInvalidError, + ConfigNotFoundError, + LoaderNoResultError, + ProjectNotFoundError, + loadConfig, +} from 'graphql-config'; + +import type { DefinitionQueryResult, Outline } from 'graphql-language-service'; + +import { NoopLogger } from '../Logger'; +import { pathToFileURL } from 'node:url'; +import mockfs from 'mock-fs'; +import { join } from 'node:path'; + +jest.mock('node:fs', () => ({ + ...jest.requireActual('fs'), + readFileSync: jest.fn(jest.requireActual('fs').readFileSync), +})); + +describe('MessageProcessor', () => { + const logger = new NoopLogger(); + const messageProcessor = new MessageProcessor({ + // @ts-ignore + connection: {}, + logger, + graphqlFileExtensions: ['graphql'], + loadConfigOptions: { rootDir: __dirname }, + config: null, + }); + + const queryPathUri = pathToFileURL(`${__dirname}/__queries__`); + const textDocumentTestString = ` + { + hero(episode: NEWHOPE){ + } + } + `; + let gqlConfig; + beforeEach(async () => { + gqlConfig = await loadConfig({ rootDir: __dirname, extensions: [] }); + + // loadConfig.mockRestore(); + messageProcessor._settings = { load: {} }; + messageProcessor._graphQLCache = new GraphQLCache({ + configDir: __dirname, + config: gqlConfig, + parser: parseDocument, + logger: new NoopLogger(), + }); + messageProcessor._languageService = { + // @ts-ignore + getAutocompleteSuggestions(query, position, uri) { + return [{ label: `${query} at ${uri}` }]; + }, + // @ts-ignore + getDiagnostics(_query, _uri) { + return []; + }, + async getHoverInformation(_query, position, _uri) { + return { + contents: '```graphql\nField: hero\n```', + range: new Range(position, position), + }; + }, + async getDocumentSymbols(_query: string, uri: string) { + return [ + { + name: 'item', + kind: SymbolKind.Field, + location: { + uri, + range: { + start: { line: 1, character: 2 }, + end: { line: 1, character: 4 }, + }, + }, + }, + ]; + }, + async getOutline(_query: string): Promise { + return { + outlineTrees: [ + { + representativeName: 'item', + kind: 'Field', + startPosition: new Position(1, 2), + endPosition: new Position(1, 4), + children: [], + }, + ], + }; + }, + async getDefinition( + _query, + position, + uri, + ): Promise { + return { + queryRange: [new Range(position, position)], + printedName: 'example', + definitions: [ + { + position, + path: uri, + }, + ], + }; + }, + }; + }); + + let getConfigurationReturnValue = {}; + // @ts-ignore + messageProcessor._connection = { + // @ts-ignore + get workspace() { + return { + async getConfiguration() { + return [getConfigurationReturnValue]; + }, + }; + }, + }; + + const initialDocument = { + textDocument: { + text: textDocumentTestString, + uri: `${queryPathUri}/test.graphql`, + version: 0, + }, + }; + + messageProcessor._isInitialized = true; + + it('initializes properly and opens a file', async () => { + const { capabilities } = await messageProcessor.handleInitializeRequest( + // @ts-ignore + { + rootPath: __dirname, + }, + null, + __dirname, + ); + expect(capabilities.definitionProvider).toEqual(true); + expect(capabilities.workspaceSymbolProvider).toEqual(true); + expect(capabilities.completionProvider.resolveProvider).toEqual(true); + expect(capabilities.textDocumentSync).toEqual(1); + }); + it('detects a config file', async () => { + const result = await messageProcessor._isGraphQLConfigFile( + 'graphql.config.js', + ); + expect(result).toEqual(true); + const falseResult = await messageProcessor._isGraphQLConfigFile( + 'graphql.js', + ); + expect(falseResult).toEqual(false); + + mockfs({ [`${__dirname}/package.json`]: '{"graphql": {}}' }); + const pkgResult = await messageProcessor._isGraphQLConfigFile( + `file://${__dirname}/package.json`, + ); + mockfs.restore(); + expect(pkgResult).toEqual(true); + + mockfs({ [`${__dirname}/package.json`]: '{ }' }); + const pkgFalseResult = await messageProcessor._isGraphQLConfigFile( + `file://${__dirname}/package.json`, + ); + mockfs.restore(); + expect(pkgFalseResult).toEqual(false); + }); + it('runs completion requests properly', async () => { + const uri = `${queryPathUri}/test2.graphql`; + const query = 'test'; + messageProcessor._textDocumentCache.set(uri, { + version: 0, + contents: [ + { + query, + range: new Range(new Position(0, 0), new Position(0, 0)), + }, + ], + }); + + const test = { + position: new Position(0, 0), + textDocument: { uri }, + }; + const result = await messageProcessor.handleCompletionRequest(test); + expect(result).toEqual({ + items: [{ label: `${query} at ${uri}` }], + isIncomplete: false, + }); + }); + it('runs completion requests properly with no file present', async () => { + const test = { + position: new Position(0, 0), + textDocument: { uri: `${queryPathUri}/test13.graphql` }, + }; + const result = await messageProcessor.handleCompletionRequest(test); + expect(result).toEqual({ + items: [], + isIncomplete: false, + }); + }); + it('runs completion requests properly when not initialized', async () => { + const test = { + position: new Position(0, 3), + textDocument: { uri: `${queryPathUri}/test2.graphql` }, + }; + messageProcessor._isInitialized = false; + const result = await messageProcessor.handleCompletionRequest(test); + expect(result).toEqual({ + items: [], + isIncomplete: false, + }); + }); + + it('runs document symbol requests', async () => { + messageProcessor._isInitialized = true; + const uri = `${queryPathUri}/test3.graphql`; + const validQuery = ` + { + hero(episode: EMPIRE){ + ...testFragment + } + } + `; + + const newDocument = { + textDocument: { + text: validQuery, + uri, + version: 0, + }, + }; + + messageProcessor._textDocumentCache.set(uri, { + version: 0, + contents: [ + { + query: validQuery, + range: new Range(new Position(0, 0), new Position(0, 0)), + }, + ], + }); + + const test = { + textDocument: newDocument.textDocument, + }; + + const result = await messageProcessor.handleDocumentSymbolRequest(test); + + expect(result).not.toBeUndefined(); + expect(result.length).toEqual(1); + expect(result[0].name).toEqual('item'); + expect(result[0].kind).toEqual(SymbolKind.Field); + expect(result[0].location.range).toEqual({ + start: { line: 1, character: 2 }, + end: { line: 1, character: 4 }, + }); + }); + it('runs document symbol requests with no file present', async () => { + const test = { + textDocument: { + uri: `${queryPathUri}/test4.graphql`, + version: 0, + }, + }; + + const result = await messageProcessor.handleDocumentSymbolRequest(test); + expect(result).toEqual([]); + }); + it('runs document symbol requests when not initialized', async () => { + const test = { + textDocument: { + uri: `${queryPathUri}/test3.graphql`, + version: 0, + }, + }; + messageProcessor._isInitialized = false; + const result = await messageProcessor.handleDocumentSymbolRequest(test); + expect(result).toEqual([]); + messageProcessor._isInitialized = true; + const nextResult = await messageProcessor.handleDocumentSymbolRequest(test); + expect(nextResult[0].location.uri).toContain('test3.graphql'); + expect(nextResult[0].name).toEqual('item'); + expect(nextResult.length).toEqual(1); + }); + + it('properly changes the file cache with the didChange handler', async () => { + const uri = `${queryPathUri}/test.graphql`; + messageProcessor._textDocumentCache.set(uri, { + version: 1, + contents: [ + { + query: '', + range: new Range(new Position(0, 0), new Position(0, 0)), + }, + ], + }); + const textDocumentChangedString = ` + { + hero(episode: NEWHOPE){ + name + } + } + `; + + const result = await messageProcessor.handleDidChangeNotification({ + textDocument: { + // @ts-ignore + text: textDocumentTestString, + uri, + version: 1, + }, + contentChanges: [ + { text: textDocumentTestString }, + { text: textDocumentChangedString }, + ], + }); + // Query fixed, no more errors + expect(result.diagnostics.length).toEqual(0); + }); + + it('does not crash on null value returned in response to workspace configuration', async () => { + // for some reason this is needed? can't be a good thing... must have done something to cause a performance hit on + // loading config schema.. + jest.setTimeout(10000); + const previousConfigurationValue = getConfigurationReturnValue; + getConfigurationReturnValue = null; + const result = await messageProcessor.handleDidChangeConfiguration({}); + expect(result).toEqual({}); + getConfigurationReturnValue = previousConfigurationValue; + }); + + it('properly removes from the file cache with the didClose handler', async () => { + await messageProcessor.handleDidCloseNotification(initialDocument); + + const position = { line: 4, character: 5 }; + const params = { textDocument: initialDocument.textDocument, position }; + + // Should throw because file has been deleted from cache + try { + const result = await messageProcessor.handleCompletionRequest(params); + expect(result).toEqual(null); + } catch {} + }); + + // modified to work with jest.mock() of WatchmanClient + it('runs definition requests', async () => { + jest.setTimeout(10000); + const validQuery = ` + { + hero(episode: EMPIRE){ + ...testFragment + } + } + `; + + const newDocument = { + textDocument: { + text: validQuery, + uri: `${queryPathUri}/test3.graphql`, + version: 1, + }, + }; + messageProcessor._getCachedDocument = (_uri: string) => ({ + version: 1, + contents: [ + { + query: validQuery, + range: new Range(new Position(0, 0), new Position(20, 4)), + }, + ], + }); + + await messageProcessor.handleDidOpenOrSaveNotification(newDocument); + + const test = { + position: new Position(3, 15), + textDocument: newDocument.textDocument, + }; + + const result = await messageProcessor.handleDefinitionRequest(test); + await expect(result[0].uri).toEqual(`${queryPathUri}/test3.graphql`); + }); + + it('retrieves custom results from locateCommand', async () => { + jest.setTimeout(10000); + const validQuery = ` + { + hero(episode: EMPIRE){ + ...testFragment + } + } + `; + + const newDocument = { + textDocument: { + text: validQuery, + uri: `${queryPathUri}/test3.graphql`, + version: 1, + }, + }; + messageProcessor._getCachedDocument = (_uri: string) => ({ + version: 1, + contents: [ + { + query: validQuery, + range: new Range(new Position(0, 0), new Position(20, 4)), + }, + ], + }); + + await messageProcessor.handleDidOpenOrSaveNotification(newDocument); + + const test = { + position: new Position(3, 15), + textDocument: newDocument.textDocument, + }; + const result = await messageProcessor._languageService.getDefinition( + validQuery, + test.position, + test.textDocument.uri, + ); + const project = messageProcessor._graphQLCache.getProjectForFile( + test.textDocument.uri, + )!; + + const customResult = messageProcessor._getCustomLocateResult( + project, + { definitions: result, printedName: 'example' }, + () => 'hello', + ); + expect(customResult.uri).toEqual('hello'); + + const customResult2 = messageProcessor._getCustomLocateResult( + project, + { definitions: result, printedName: 'example' }, + () => 'hello:2:4', + ); + expect(customResult2.uri).toEqual('hello'); + expect(customResult2.range.start.line).toEqual(2); + expect(customResult2.range.start.character).toEqual(0); + expect(customResult2.range.end.line).toEqual(4); + + const customResult3 = messageProcessor._getCustomLocateResult( + project, + { definitions: result, printedName: 'example' }, + () => ({ + uri: 'hello1', + range: { + start: { character: 2, line: 2 }, + end: { character: 4, line: 4 }, + }, + }), + ); + expect(customResult3.uri).toEqual('hello1'); + expect(customResult3.range.start.line).toEqual(2); + expect(customResult3.range.start.character).toEqual(2); + expect(customResult3.range.end.line).toEqual(4); + expect(customResult3.range.end.character).toEqual(4); + const oldGetProject = messageProcessor._graphQLCache.getProjectForFile; + + messageProcessor._graphQLCache.getProjectForFile = jest.fn(() => ({ + schema: project.schema, + documents: project.documents, + dirpath: project.dirpath, + extensions: { + languageService: { locateCommand: () => 'foo:3:4' }, + }, + })); + const result2 = await messageProcessor.handleDefinitionRequest(test); + expect(result2[0].range.start.line).toBe(3); + expect(result2[0].range.end.line).toBe(4); + expect(result2[0].range.end.character).toBe(0); + messageProcessor._graphQLCache.getProjectForFile = oldGetProject; + }); + it('runs hover requests', async () => { + const validQuery = ` + { + hero(episode: EMPIRE){ + ...testFragment + } + } + `; + + const newDocument = { + textDocument: { + text: validQuery, + uri: `${queryPathUri}/test4.graphql`, + version: 1, + }, + }; + messageProcessor._getCachedDocument = (_uri: string) => ({ + version: 1, + contents: [ + { + query: validQuery, + range: new Range(new Position(0, 0), new Position(20, 4)), + }, + ], + }); + + await messageProcessor.handleDidOpenOrSaveNotification(newDocument); + + const test = { + position: new Position(3, 15), + textDocument: newDocument.textDocument, + }; + + const result = await messageProcessor.handleHoverRequest(test); + expect(JSON.stringify(result.contents)).toEqual( + JSON.stringify({ + contents: '```graphql\nField: hero\n```', + range: new Range(new Position(3, 15), new Position(3, 15)), + }), + ); + }); + it('runs hover request with no file present', async () => { + const test = { + position: new Position(3, 15), + textDocument: { + uri: `${queryPathUri}/test5.graphql`, + version: 1, + }, + }; + messageProcessor._getCachedDocument = (_uri: string) => null; + + const result = await messageProcessor.handleHoverRequest(test); + expect(result).toEqual({ contents: [] }); + }); + it('handles provided config', async () => { + const msgProcessor = new MessageProcessor({ + // @ts-ignore + connection: { + workspace: { + getConfiguration() { + return {}; + }, + }, + }, + logger, + graphqlFileExtensions: ['graphql'], + loadConfigOptions: { rootDir: __dirname }, + config: gqlConfig, + }); + expect(msgProcessor._providedConfig).toBeTruthy(); + await msgProcessor.handleInitializeRequest( + // @ts-ignore + { + rootPath: __dirname, + }, + null, + __dirname, + ); + await msgProcessor.handleDidChangeConfiguration({ + settings: {}, + }); + expect(msgProcessor._graphQLCache).toBeTruthy(); + }); + + it('runs workspace symbol requests', async () => { + const msgProcessor = new MessageProcessor({ + // @ts-ignore + connection: {}, + logger, + graphqlFileExtensions: ['graphql'], + loadConfigOptions: { rootDir: __dirname }, + }); + await msgProcessor.handleInitializeRequest( + // @ts-ignore + { + rootPath: __dirname, + }, + null, + __dirname, + ); + const uri = `${queryPathUri}/test6.graphql`; + const docUri = `${queryPathUri}/test7.graphql`; + const validQuery = ` + { + hero(episode: EMPIRE){ + ...testFragment + } + } + `; + const validDocument = ` + fragment testFragment on Character { + name + }`; + msgProcessor._graphQLCache = new GraphQLCache({ + configDir: __dirname, + config: await loadConfig({ rootDir: __dirname }), + parser: parseDocument, + logger: new NoopLogger(), + }); + msgProcessor._languageService = { + getDocumentSymbols: async () => [ + { + name: 'testFragment', + kind: SymbolKind.Field, + location: { + uri, + range: { + start: { line: 1, character: 2 }, + end: { line: 1, character: 4 }, + }, + }, + }, + ], + }; + msgProcessor._isInitialized = true; + msgProcessor._textDocumentCache.set(uri, { + version: 0, + contents: [ + { + query: validQuery, + range: new Range(new Position(0, 0), new Position(6, 0)), + }, + ], + }); + + await msgProcessor._graphQLCache.updateFragmentDefinition( + __dirname, + docUri, + [ + { + query: validDocument, + range: new Range(new Position(0, 0), new Position(4, 0)), + }, + ], + ); + + const test = { + query: 'testFragment', + }; + + const result = await msgProcessor.handleWorkspaceSymbolRequest(test); + expect(result).not.toBeUndefined(); + expect(result.length).toEqual(1); + expect(result[0].name).toEqual('testFragment'); + expect(result[0].kind).toEqual(SymbolKind.Field); + expect(result[0].location.range).toEqual({ + start: { line: 1, character: 2 }, + end: { line: 1, character: 4 }, + }); + }); + + describe('_loadConfigOrSkip', () => { + const mockReadFileSync: jest.Mock = + jest.requireMock('node:fs').readFileSync; + + beforeEach(() => { + mockReadFileSync.mockReturnValue(''); + messageProcessor._initializeGraphQLCaches = jest.fn(); + }); + + it('loads config if not initialized', async () => { + messageProcessor._isInitialized = false; + + const result = await messageProcessor._loadConfigOrSkip( + `${pathToFileURL('.')}/graphql.config.js`, + ); + expect(messageProcessor._initializeGraphQLCaches).toHaveBeenCalledTimes( + 1, + ); + // we want to return true here to skip further processing, because it's just a config file change + expect(result).toEqual(true); + }); + + it('loads config if a file change occurs and the server is not initialized', async () => { + messageProcessor._isInitialized = false; + + const result = await messageProcessor._loadConfigOrSkip( + `${pathToFileURL('.')}/file.ts`, + ); + expect(messageProcessor._initializeGraphQLCaches).toHaveBeenCalledTimes( + 1, + ); + // here we have a non-config file, so we don't want to skip, because we need to run diagnostics etc + expect(result).toEqual(false); + }); + it('config file change updates server config even if the server is already initialized', async () => { + messageProcessor._isInitialized = true; + const result = await messageProcessor._loadConfigOrSkip( + `${pathToFileURL('.')}/graphql.config.ts`, + ); + expect(messageProcessor._initializeGraphQLCaches).toHaveBeenCalledTimes( + 1, + ); + expect(result).toEqual(true); + }); + it('skips if the server is already initialized', async () => { + messageProcessor._isInitialized = true; + const result = await messageProcessor._loadConfigOrSkip( + `${pathToFileURL('.')}/myFile.ts`, + ); + expect(messageProcessor._initializeGraphQLCaches).not.toHaveBeenCalled(); + expect(result).toEqual(false); + }); + }); + + describe('handleDidOpenOrSaveNotification', () => { + const mockReadFileSync: jest.Mock = + jest.requireMock('node:fs').readFileSync; + + beforeEach(() => { + mockReadFileSync.mockReturnValue(''); + messageProcessor._initializeGraphQLCaches = jest.fn(); + messageProcessor._loadConfigOrSkip = jest.fn(); + }); + it('updates config for standard config filename changes', async () => { + await messageProcessor.handleDidOpenOrSaveNotification({ + textDocument: { + uri: `${pathToFileURL('.')}/.graphql.config.js`, + languageId: 'js', + version: 0, + text: '', + }, + }); + expect(messageProcessor._loadConfigOrSkip).toHaveBeenCalled(); + }); + + it('updates config for custom config filename changes', async () => { + const customConfigName = 'custom-config-name.yml'; + messageProcessor._settings = { load: { fileName: customConfigName } }; + + await messageProcessor.handleDidOpenOrSaveNotification({ + textDocument: { + uri: `${pathToFileURL('.')}/${customConfigName}`, + languageId: 'js', + version: 0, + text: '', + }, + }); + + expect(messageProcessor._loadConfigOrSkip).toHaveBeenCalledWith( + expect.stringContaining(customConfigName), + ); + }); + + it('handles config requests with no config', async () => { + messageProcessor._settings = {}; + + await messageProcessor.handleDidChangeConfiguration({ + settings: [], + }); + + expect(messageProcessor._initializeGraphQLCaches).toHaveBeenCalled(); + + await messageProcessor.handleDidOpenOrSaveNotification({ + textDocument: { + uri: `${pathToFileURL('.')}/.graphql.config.js`, + languageId: 'js', + version: 0, + text: '', + }, + }); + + expect(messageProcessor._initializeGraphQLCaches).toHaveBeenCalled(); + }); + }); + + describe('_handleConfigErrors', () => { + it('handles missing config errors', async () => { + messageProcessor._handleConfigError({ + err: new ConfigNotFoundError('test missing-config'), + uri: 'test', + }); + + expect(messageProcessor._initializeGraphQLCaches).not.toHaveBeenCalled(); + expect(logger.error).toHaveBeenCalledWith( + expect.stringContaining('test missing-config'), + ); + }); + it('handles missing project errors', async () => { + messageProcessor._handleConfigError({ + err: new ProjectNotFoundError('test missing-project'), + uri: 'test', + }); + + expect(messageProcessor._initializeGraphQLCaches).not.toHaveBeenCalled(); + expect(logger.error).toHaveBeenCalledWith( + expect.stringContaining('Project not found for this file'), + ); + }); + it('handles invalid config errors', async () => { + messageProcessor._handleConfigError({ + err: new ConfigInvalidError('test invalid error'), + uri: 'test', + }); + + expect(messageProcessor._initializeGraphQLCaches).not.toHaveBeenCalled(); + expect(logger.error).toHaveBeenCalledWith( + expect.stringContaining('Invalid configuration'), + ); + }); + it('handles empty loader result errors', async () => { + messageProcessor._handleConfigError({ + err: new LoaderNoResultError('test loader-error'), + uri: 'test', + }); + + expect(messageProcessor._initializeGraphQLCaches).not.toHaveBeenCalled(); + expect(logger.error).toHaveBeenCalledWith( + expect.stringContaining('test loader-error'), + ); + }); + it('handles generic errors', async () => { + messageProcessor._handleConfigError({ + err: new Error('test loader-error'), + uri: 'test', + }); + + expect(messageProcessor._initializeGraphQLCaches).not.toHaveBeenCalled(); + expect(logger.error).toHaveBeenCalledWith( + expect.stringContaining('test loader-error'), + ); + }); + }); + describe('handleWatchedFilesChangedNotification', () => { + const mockReadFileSync: jest.Mock = + jest.requireMock('node:fs').readFileSync; + + beforeEach(() => { + mockReadFileSync.mockReturnValue(' query { id }'); + messageProcessor._initializeGraphQLCaches = jest.fn(); + messageProcessor._updateFragmentDefinition = jest.fn(); + messageProcessor._isGraphQLConfigMissing = false; + messageProcessor._isInitialized = true; + }); + + it('skips config updates for normal file changes', async () => { + await messageProcessor.handleWatchedFilesChangedNotification({ + changes: [ + { + uri: `${pathToFileURL( + join(__dirname, '__queries__'), + )}/test.graphql`, + type: FileChangeType.Changed, + }, + ], + }); + + expect(messageProcessor._initializeGraphQLCaches).not.toHaveBeenCalled(); + expect(messageProcessor._updateFragmentDefinition).toHaveBeenCalled(); + }); + }); + + describe('handleWatchedFilesChangedNotification without graphql config', () => { + const mockReadFileSync: jest.Mock = + jest.requireMock('node:fs').readFileSync; + + beforeEach(() => { + mockReadFileSync.mockReturnValue(''); + messageProcessor._isGraphQLConfigMissing = true; + messageProcessor._parser = jest.fn(); + }); + + it('skips config updates for normal file changes', async () => { + await messageProcessor.handleWatchedFilesChangedNotification({ + changes: [ + { + uri: `${pathToFileURL('.')}/foo.js`, + type: FileChangeType.Changed, + }, + ], + }); + expect(messageProcessor._parser).not.toHaveBeenCalled(); + }); + }); + + describe('handleDidChangedNotification without graphql config', () => { + const mockReadFileSync: jest.Mock = + jest.requireMock('node:fs').readFileSync; + + beforeEach(() => { + mockReadFileSync.mockReturnValue(''); + messageProcessor._isGraphQLConfigMissing = true; + messageProcessor._parser = jest.fn(); + }); + + it('skips config updates for normal file changes', async () => { + await messageProcessor.handleDidChangeNotification({ + textDocument: { + uri: `${pathToFileURL('.')}/foo.js`, + version: 1, + }, + contentChanges: [{ text: 'var something' }], + }); + expect(messageProcessor._parser).not.toHaveBeenCalled(); + }); + }); +}); + +describe('processDiagnosticsMessage', () => { + it('processes diagnostics messages', () => { + const query = 'query { foo }'; + const inputRange = new Range(new Position(1, 1), new Position(1, 1)); + + const diagnostics = processDiagnosticsMessage( + [ + { + severity: 1, + message: 'test', + source: 'GraphQL: Validation', + range: inputRange, + }, + ], + query, + inputRange, + ); + + expect(JSON.stringify(diagnostics)).toEqual( + JSON.stringify([ + { + severity: 1, + message: 'test', + source: 'GraphQL: Validation', + range: new Range(new Position(2, 1), new Position(2, 1)), + }, + ]), + ); + }); + it('processes diagnostics messages with null range', () => { + const query = 'query { foo }'; + const inputRange = new Range(new Position(1, 1), new Position(1, 1)); + + const diagnostics = processDiagnosticsMessage( + [ + { + severity: 1, + message: 'test', + source: 'GraphQL: Validation', + range: inputRange, + }, + ], + query, + null, + ); + + expect(JSON.stringify(diagnostics)).toEqual( + JSON.stringify([ + { + severity: 1, + message: 'test', + source: 'GraphQL: Validation', + range: inputRange, + }, + ]), + ); + }); +}); diff --git a/packages/graphql-language-service-server/src/__tests__/__utils__/MockProject.ts b/packages/graphql-language-service-server/src/__tests__/__utils__/MockProject.ts new file mode 100644 index 00000000000..f0cd000e329 --- /dev/null +++ b/packages/graphql-language-service-server/src/__tests__/__utils__/MockProject.ts @@ -0,0 +1,197 @@ +import mockfs from 'mock-fs'; +import { MessageProcessor } from '../../MessageProcessor'; +import { Logger as VSCodeLogger } from 'vscode-jsonrpc'; +import { URI } from 'vscode-uri'; +import { FileChangeType } from 'vscode-languageserver'; +import { FileChangeTypeKind } from 'graphql-language-service'; + +export type MockFile = [filename: string, text: string]; + +export class MockLogger implements VSCodeLogger { + error = jest.fn(); + warn = jest.fn(); + info = jest.fn(); + log = jest.fn(); +} + +// when using mockfs with cosmic-config, a dynamic inline +// require of parse-json creates the necessity for loading in the actual +// modules to the mocked filesystem +const modules = [ + 'parse-json', + 'error-ex', + 'is-arrayish', + 'json-parse-even-better-errors', + 'lines-and-columns', + '@babel/code-frame', + '@babel/highlight', + // these i think are just required by jest when you console log from a test + 'jest-message-util', + 'stack-utils', + 'pretty-format', + 'ansi-regex', + 'js-tokens', + 'escape-string-regexp', + 'jest-worker', + 'jiti', + 'cosmiconfig', + 'minimatch', + 'tslib', +]; +const defaultMocks = modules.reduce((acc, module) => { + acc[`node_modules/${module}`] = mockfs.load(`node_modules/${module}`); + return acc; +}, {}); + +type File = [filename: string, text: string]; +type Files = File[]; + +export class MockProject { + private root: string; + private fileCache: Map; + private messageProcessor: MessageProcessor; + constructor({ + files = [], + root = '/tmp/test', + settings, + }: { + files: Files; + root?: string; + settings?: [name: string, vale: any][]; + }) { + this.root = root; + this.fileCache = new Map(files); + + this.mockFiles(); + this.messageProcessor = new MessageProcessor({ + connection: { + get workspace() { + return { + async getConfiguration() { + return settings; + }, + }; + }, + }, + logger: new MockLogger(), + loadConfigOptions: { + rootDir: root, + }, + }); + } + + public async init(filename?: string, fileText?: string) { + await this.lsp.handleInitializeRequest({ + rootPath: this.root, + rootUri: this.root, + capabilities: {}, + processId: 200, + workspaceFolders: null, + }); + return this.lsp.handleDidOpenOrSaveNotification({ + textDocument: { + uri: this.uri(filename || 'query.graphql'), + version: 1, + text: + this.fileCache.get('query.graphql') || + (filename && this.fileCache.get(filename)) || + fileText, + }, + }); + } + private mockFiles() { + const mockFiles = { ...defaultMocks }; + Array.from(this.fileCache).map(([filename, text]) => { + mockFiles[this.filePath(filename)] = text; + }); + mockfs(mockFiles); + } + public filePath(filename: string) { + return `${this.root}/${filename}`; + } + public uri(filename: string) { + return URI.file(this.filePath(filename)).toString(); + } + changeFile(filename: string, text: string) { + this.fileCache.set(filename, text); + this.mockFiles(); + } + async addFile(filename: string, text: string, watched = false) { + this.fileCache.set(filename, text); + this.mockFiles(); + if (watched) { + await this.lsp.handleWatchedFilesChangedNotification({ + changes: [ + { + uri: this.uri(filename), + type: FileChangeTypeKind.Created, + }, + ], + }); + } + await this.lsp.handleDidChangeNotification({ + contentChanges: [ + { + type: FileChangeTypeKind.Created, + text, + }, + ], + textDocument: { + uri: this.uri(filename), + version: 2, + }, + }); + } + async changeWatchedFile(filename: string, text: string) { + this.changeFile(filename, text); + await this.lsp.handleWatchedFilesChangedNotification({ + changes: [ + { + uri: this.uri(filename), + type: FileChangeType.Changed, + }, + ], + }); + } + async saveOpenFile(filename: string, text: string) { + this.changeFile(filename, text); + await this.lsp.handleDidOpenOrSaveNotification({ + textDocument: { + uri: this.uri(filename), + version: 2, + text, + }, + }); + } + async addWatchedFile(filename: string, text: string) { + this.changeFile(filename, text); + await this.lsp.handleDidChangeNotification({ + contentChanges: [ + { + type: FileChangeTypeKind.Created, + text, + }, + ], + textDocument: { + uri: this.uri(filename), + version: 2, + }, + }); + } + async deleteFile(filename: string) { + mockfs.restore(); + this.fileCache.delete(filename); + this.mockFiles(); + await this.lsp.handleWatchedFilesChangedNotification({ + changes: [ + { + type: FileChangeType.Deleted, + uri: this.uri(filename), + }, + ], + }); + } + get lsp() { + return this.messageProcessor; + } +} diff --git a/packages/graphql-language-service-server/src/__tests__/__utils__/runServer.js b/packages/graphql-language-service-server/src/__tests__/__utils__/runServer.js new file mode 100644 index 00000000000..0e328a55450 --- /dev/null +++ b/packages/graphql-language-service-server/src/__tests__/__utils__/runServer.js @@ -0,0 +1 @@ +exports.default = require('../../../../graphiql/test/e2e-server.js'); diff --git a/packages/graphql-language-service-server/src/__tests__/__utils__/utils.ts b/packages/graphql-language-service-server/src/__tests__/__utils__/utils.ts new file mode 100644 index 00000000000..4ad1eff2c26 --- /dev/null +++ b/packages/graphql-language-service-server/src/__tests__/__utils__/utils.ts @@ -0,0 +1,4 @@ +import { Range } from 'vscode-languageserver'; + +export const serializeRange = (range: Range) => + JSON.parse(JSON.stringify(range)); diff --git a/packages/graphql-language-service-server/src/__tests__/findGraphQLTags-test.ts b/packages/graphql-language-service-server/src/__tests__/findGraphQLTags.test.ts similarity index 89% rename from packages/graphql-language-service-server/src/__tests__/findGraphQLTags-test.ts rename to packages/graphql-language-service-server/src/__tests__/findGraphQLTags.test.ts index 6bb5c1062bf..bbc1872dfac 100644 --- a/packages/graphql-language-service-server/src/__tests__/findGraphQLTags-test.ts +++ b/packages/graphql-language-service-server/src/__tests__/findGraphQLTags.test.ts @@ -83,6 +83,36 @@ query Test { ...FragmentsComment } } + + `); + }); + + it('finds queries in call expressions with with newlines preceding the template', async () => { + const text = ` + import {gql} from 'react-apollo'; + import type {B} from 'B'; + import A from './A'; + + const QUERY = gql( + \` + query Test { + test { + value + ...FragmentsComment + } + } + \`); + + export function Example(arg: string) {}`; + + const contents = findGraphQLTags(text, '.ts'); + expect(contents[0].template).toEqual(` + query Test { + test { + value + ...FragmentsComment + } + } `); }); @@ -112,6 +142,7 @@ query Test { ...FragmentsComment } } + `); }); @@ -122,9 +153,7 @@ import {B} from 'B'; import A from './A'; -const QUERY: string = -/* GraphQL */ -\` +const QUERY: string = /* GraphQL */ \` query Test { test { value @@ -144,6 +173,7 @@ query Test { ...FragmentsComment } } + `); }); @@ -529,4 +559,36 @@ export function Example(arg: string) {}`; const contents = findGraphQLTags(text, '.svelte'); expect(contents.length).toEqual(1); }); + it('handles full astro example', () => { + const text = ` + --- + const gql = String.raw; + const response = await fetch("https://swapi-graphql.netlify.app/.netlify/functions/index", + { + method: 'POST', + headers: {'Content-Type':'application/json'}, + body: JSON.stringify({ + query: gql\` + query getFilm ($id:ID!) { + film(id: $id) { + title + releaseDate + } + } + \`, + variables: { + id: "XM6MQ==", + }, + }), + }); + + const json = await response.json(); + const { film } = json.data; + --- +

Fetching information about Star Wars: A New Hope

+

Title: {film.title}

+

Year: {film.releaseDate}

`; + const contents = findGraphQLTags(text, '.astro'); + expect(contents.length).toEqual(1); + }); }); diff --git a/packages/graphql-language-service-server/src/__tests__/parseDocument-test.ts b/packages/graphql-language-service-server/src/__tests__/parseDocument.test.ts similarity index 90% rename from packages/graphql-language-service-server/src/__tests__/parseDocument-test.ts rename to packages/graphql-language-service-server/src/__tests__/parseDocument.test.ts index 0020f76d47e..e62ac3473a1 100644 --- a/packages/graphql-language-service-server/src/__tests__/parseDocument-test.ts +++ b/packages/graphql-language-service-server/src/__tests__/parseDocument.test.ts @@ -1,7 +1,7 @@ import { parseDocument } from '../parseDocument'; describe('parseDocument', () => { - it('parseDocument finds queries in tagged templates', async () => { + it('parseDocument finds queries in tagged templates', () => { const text = ` // @flow import {gql} from 'react-apollo'; @@ -32,7 +32,7 @@ describe('parseDocument', () => { `); }); - it('parseDocument finds queries in tagged templates in leaf', async () => { + it('parseDocument finds queries in tagged templates in leaf', () => { const text = ` import {gql} from 'react-apollo'; import type {B} from 'B'; @@ -52,13 +52,13 @@ describe('parseDocument', () => { expect(contents[0].query).toEqual(` query Test { test { - + __typename } } `); }); - it('parseDocument finds queries in tagged templates using typescript', async () => { + it('parseDocument finds queries in tagged templates using typescript', () => { const text = ` import {gql} from 'react-apollo'; import {B} from 'B'; @@ -88,7 +88,7 @@ describe('parseDocument', () => { `); }); - it('parseDocument finds queries in tagged templates using tsx', async () => { + it('parseDocument finds queries in tagged templates using tsx', () => { const text = ` import {gql} from 'react-apollo'; import {B} from 'B'; @@ -120,7 +120,7 @@ describe('parseDocument', () => { `); }); - it('parseDocument finds queries in multi-expression tagged templates using tsx', async () => { + it('parseDocument finds queries in multi-expression tagged templates using tsx', () => { const text = ` import {gql} from 'react-apollo'; import {B} from 'B'; @@ -153,7 +153,7 @@ describe('parseDocument', () => { }`); }); // TODO: why an extra line here? - it('parseDocument finds queries in multi-expression tagged template with declarations with using tsx', async () => { + it('parseDocument finds queries in multi-expression tagged template with declarations with using tsx', () => { const text = ` import {gql} from 'react-apollo'; import {B} from 'B'; @@ -186,7 +186,7 @@ describe('parseDocument', () => { }`); }); - it('parseDocument finds queries in multi-expression template strings using tsx', async () => { + it('parseDocument finds queries in multi-expression template strings using tsx', () => { const text = ` import {gql} from 'react-apollo'; import {B} from 'B'; @@ -218,10 +218,11 @@ describe('parseDocument', () => { ...FragmentsComment } } + `); }); - it('parseDocument finds queries in call expressions with template literals', async () => { + it('parseDocument finds queries in call expressions with template literals', () => { const text = ` // @flow import {gql} from 'react-apollo'; @@ -248,10 +249,11 @@ describe('parseDocument', () => { ...FragmentsComment } } + `); }); - it('parseDocument finds queries in #graphql-annotated templates', async () => { + it('parseDocument finds queries in #graphql-annotated templates', () => { const text = ` import {gql} from 'react-apollo'; import {B} from 'B'; @@ -277,39 +279,42 @@ describe('parseDocument', () => { ...FragmentsComment } } + `); }); - it('parseDocument finds queries in /*GraphQL*/-annotated templates', async () => { + it('parseDocument finds queries in /*GraphQL*/-annotated templates', () => { const text = ` import {gql} from 'react-apollo'; import {B} from 'B'; import A from './A'; const QUERY: string = /* GraphQL */ \` - query Test { - test { - value - ...FragmentsComment + query Test { + test { + value + ...FragmentsComment + } } - } \${A.fragments.test} \` export function Example(arg: string) {}`; const contents = parseDocument(text, 'test.ts'); - expect(contents[0].query).toEqual(` - query Test { - test { - value - ...FragmentsComment + // please let me keep this whitespace prettier! + expect(contents[0].query).toEqual(/* GraphQL */ ` + query Test { + test { + value + ...FragmentsComment + } } - } + `); }); - it('parseDocument ignores non gql tagged templates', async () => { + it('parseDocument ignores non gql tagged templates', () => { const text = ` // @flow import randomThing from 'package'; @@ -332,7 +337,7 @@ describe('parseDocument', () => { expect(contents.length).toEqual(0); }); - it('parseDocument ignores non gql call expressions with template literals', async () => { + it('parseDocument ignores non gql call expressions with template literals', () => { const text = ` // @flow import randomthing from 'package'; @@ -355,7 +360,7 @@ describe('parseDocument', () => { expect(contents.length).toEqual(0); }); - it('an unparsable JS/TS file does not throw and bring down the server', async () => { + it('an unparsable JS/TS file does not throw and bring down the server', () => { const text = ` // @flow import type randomThing fro 'package'; @@ -375,14 +380,14 @@ describe('parseDocument', () => { expect(contents.length).toEqual(0); }); - it('an empty file is ignored', async () => { + it('an empty file is ignored', () => { const text = ''; const contents = parseDocument(text, 'test.js'); expect(contents.length).toEqual(0); }); - it('a whitespace only file with empty asts is ignored', async () => { + it('a whitespace only file with empty asts is ignored', () => { const text = ` `; @@ -391,7 +396,7 @@ describe('parseDocument', () => { expect(contents.length).toEqual(0); }); - it('an ignored file is ignored', async () => { + it('an ignored file is ignored', () => { const text = ` something `; diff --git a/packages/graphql-language-service-server/src/__tests__/startServer.spec.ts b/packages/graphql-language-service-server/src/__tests__/startServer.spec.ts new file mode 100644 index 00000000000..6e7c700a260 --- /dev/null +++ b/packages/graphql-language-service-server/src/__tests__/startServer.spec.ts @@ -0,0 +1,41 @@ +import startServer from '../startServer'; + +describe('startServer', () => { + let c; + afterEach(async () => { + if (c) { + try { + await c.sendNotification('exit'); + } catch {} + } + }); + it('should start the server', async () => { + c = await startServer(); + // if the server starts, we're good + expect(true).toBe(true); + }); + // TODO: this one fails to exit the astro workers, perhaps a bug? + // eslint-disable-next-line jest/no-disabled-tests + it.skip('should start the server with stream', async () => { + c = await startServer({ + method: 'stream', + }); + // if the server starts, we're good + expect(true).toBe(true); + }); + it('should start the server with ipc', async () => { + c = await startServer({ + method: 'node', + }); + // if the server starts, we're good + expect(true).toBe(true); + }); + it('should start the server with websockets', async () => { + c = await startServer({ + method: 'socket', + port: 4000, + }); + // if the server starts, we're good + expect(true).toBe(true); + }); +}); diff --git a/packages/graphql-language-service-server/src/__tests__/startServer.test.ts b/packages/graphql-language-service-server/src/__tests__/startServer.test.ts new file mode 100644 index 00000000000..dea290df0fa --- /dev/null +++ b/packages/graphql-language-service-server/src/__tests__/startServer.test.ts @@ -0,0 +1,109 @@ +import { IPCMessageReader, IPCMessageWriter } from 'vscode-jsonrpc/node'; +import { addHandlers, buildOptions, initializeHandlers } from '../startServer'; + +describe('buildOptions', () => { + it('should build options', () => { + const options = buildOptions({}); + expect(options).toEqual({ + loadConfigOptions: { + extensions: [], + rootDir: process.cwd(), + }, + }); + }); + it('should build options with loadConfigOptions', () => { + const options = buildOptions({ loadConfigOptions: { rootDir: '/root' } }); + expect(options).toEqual({ + loadConfigOptions: { + rootDir: '/root', + }, + }); + }); + it('should build options with loadConfigOptions without rootDir', () => { + const options = buildOptions({ loadConfigOptions: { extensions: [] } }); + expect(options).toEqual({ + loadConfigOptions: { + rootDir: process.cwd(), + extensions: [], + }, + }); + }); + it('should build options with just extensions', () => { + const options = buildOptions({ extensions: [] }); + expect(options).toEqual({ + extensions: [], + loadConfigOptions: { + rootDir: process.cwd(), + extensions: [], + }, + }); + }); +}); + +describe('initializeHandlers', () => { + beforeEach(() => { + jest.resetModules(); + }); + it('should initialize handlers', async () => { + const reader = new IPCMessageReader(process); + const writer = new IPCMessageWriter(process); + const handlers = await initializeHandlers({ + reader, + writer, + options: { + loadConfigOptions: { rootDir: '/root' }, + }, + }); + expect(handlers).toBeDefined(); + }); +}); + +describe('addHandlers', () => { + it('should add handlers', async () => { + const connection = { + onInitialize: jest.fn(), + onInitialized: jest.fn(), + onShutdown: jest.fn(), + onExit: jest.fn(), + onNotification: jest.fn(), + onRequest: jest.fn(), + sendNotification: jest.fn(), + sendRequest: jest.fn(), + console: { + error: jest.fn(), + warn: jest.fn(), + info: jest.fn(), + log: jest.fn(), + }, + }; + + await addHandlers({ + connection, + options: { loadConfigOptions: { rootDir: '/root' } }, + }); + expect( + connection.onNotification.mock.calls.map(c => c[0].method ?? c[0]), + ).toEqual([ + 'textDocument/didOpen', + 'textDocument/didSave', + 'textDocument/didChange', + 'textDocument/didClose', + 'exit', + '$/cancelRequest', + 'workspace/didChangeWatchedFiles', + 'workspace/didChangeConfiguration', + ]); + expect( + connection.onRequest.mock.calls.map(c => c[0].method ?? c[0]), + ).toEqual([ + 'shutdown', + 'initialize', + 'textDocument/completion', + 'completionItem/resolve', + 'textDocument/definition', + 'textDocument/hover', + 'textDocument/documentSymbol', + 'workspace/symbol', + ]); + }); +}); diff --git a/packages/graphql-language-service-server/src/common.ts b/packages/graphql-language-service-server/src/common.ts new file mode 100644 index 00000000000..dfc3a8d7823 --- /dev/null +++ b/packages/graphql-language-service-server/src/common.ts @@ -0,0 +1,53 @@ +import { glob } from 'glob'; +import { GraphQLProjectConfig } from 'graphql-config'; +import { + DEFAULT_SUPPORTED_EXTENSIONS, + DEFAULT_SUPPORTED_GRAPHQL_EXTENSIONS, +} from './constants'; + +export function unwrapProjectSchema(project: GraphQLProjectConfig): string[] { + const projectSchema = project.schema; + + const schemas: string[] = []; + if (typeof projectSchema === 'string') { + schemas.push(projectSchema); + } else if (Array.isArray(projectSchema)) { + for (const schemaEntry of projectSchema) { + if (typeof schemaEntry === 'string') { + schemas.push(schemaEntry); + } else if (schemaEntry) { + schemas.push(...Object.keys(schemaEntry)); + } + } + } else { + schemas.push(...Object.keys(projectSchema)); + } + + return schemas.reduce((agg, schema) => { + const results = globIfFilePattern(schema); + return [...agg, ...results]; + }, []); +} +function globIfFilePattern(pattern: string) { + if (pattern.includes('*')) { + try { + return glob.sync(pattern); + // URLs may contain * characters + } catch {} + } + return [pattern]; +} +const allExtensions = [ + ...DEFAULT_SUPPORTED_EXTENSIONS, + ...DEFAULT_SUPPORTED_GRAPHQL_EXTENSIONS, +]; +// only local schema lookups if all of the schema entries are local files +export function isProjectSDLOnly(unwrappedSchema: string[]): boolean { + return unwrappedSchema.every(schemaEntry => + allExtensions.some( + // local schema file URIs for lookup don't start with http, and end with an extension. + // though it isn't often used, technically schema config could include a remote .graphql file + ext => !schemaEntry.startsWith('http') && schemaEntry.endsWith(ext), + ), + ); +} diff --git a/packages/graphql-language-service-server/src/findGraphQLTags.ts b/packages/graphql-language-service-server/src/findGraphQLTags.ts index 4db6d001aed..a155df5bc3e 100644 --- a/packages/graphql-language-service-server/src/findGraphQLTags.ts +++ b/packages/graphql-language-service-server/src/findGraphQLTags.ts @@ -83,7 +83,12 @@ export function findGraphQLTags( 'arguments' in node ) { const templateLiteral = node.arguments[0]; - if (templateLiteral && templateLiteral.type === 'TemplateLiteral') { + if ( + templateLiteral && + (templateLiteral.type === 'TemplateLiteral' || + templateLiteral.type === 'TaggedTemplateExpression') + ) { + // @ts-expect-error const parsed = parseTemplateLiteral(templateLiteral, rangeMapper); if (parsed) { result.push(parsed); @@ -97,9 +102,19 @@ export function findGraphQLTags( const tagName = getGraphQLTagName(node.tag); if (tagName) { const { loc } = node.quasi.quasis[0]; + const template = node.quasi.quasis.length > 1 - ? node.quasi.quasis.map(quasi => quasi.value.raw).join('') + ? node.quasi.quasis + .map((quasi, i) => + i === node.quasi.quasis?.length - 1 + ? quasi.value.raw + : getReplacementString( + quasi.value.raw, + node.quasi.quasis[i + 1].value.raw, + ), + ) + .join('') : node.quasi.quasis[0].value.raw; // handle template literals with N line expressions if (loc && node.quasi.quasis.length > 1) { @@ -148,6 +163,28 @@ export function findGraphQLTags( return result; } +/* + Here we inject replacements for template tag literal expressions, + so that graphql parse & thus validation can be performed, + and we don't get or expected name parse errors + + TODO: other user reported cases to consider: + 1. operation field argument values - though we recommend graphql variables + 2. fragment spreads (maybe fragment variables will help solve this?) + + these might be extra difficult because they may require type introspection + 3. directive argument default values + 5. default argument values for input types +*/ +const getReplacementString = (quasi: string, nextQuasi: string) => { + const trimmed = quasi.trimEnd(); + const trimmedNext = nextQuasi.trimStart(); + // only actually empty leaf field expressions + if (trimmed.endsWith('{') && trimmedNext.startsWith('}')) { + return quasi + '__typename'; + } + return quasi; +}; /** * Parses a Babel AST template literal into a GraphQL tag. */ @@ -157,15 +194,20 @@ function parseTemplateLiteral(node: TemplateLiteral, rangeMapper: RangeMapper) { // handle template literals with N line expressions if (node.quasis.length > 1) { - const last = node.quasis.pop(); + const quasis = [...node.quasis]; + const last = quasis.pop(); if (last?.loc?.end) { loc.end = last.loc.end; } } - const template = - node.quasis.length > 1 - ? node.quasis.map(quasi => quasi.value.raw).join('') - : node.quasis[0].value.raw; + const template = node.quasis + .map((quasi, i) => + i === node.quasis?.length - 1 + ? quasi.value.raw + : getReplacementString(quasi.value.raw, node.quasis[i + 1].value.raw), + ) + .join(''); + const range = rangeMapper( new Range( new Position(loc.start.line - 1, loc.start.column), diff --git a/packages/graphql-language-service-server/src/index.ts b/packages/graphql-language-service-server/src/index.ts index a1be21b2e92..4dad43d2045 100644 --- a/packages/graphql-language-service-server/src/index.ts +++ b/packages/graphql-language-service-server/src/index.ts @@ -14,3 +14,4 @@ export { default as startServer } from './startServer'; export * from './GraphQLCache'; export * from './parseDocument'; export * from './findGraphQLTags'; +export * from './types'; diff --git a/packages/graphql-language-service-server/src/parsers/astro.ts b/packages/graphql-language-service-server/src/parsers/astro.ts index 0b870fdaa30..f00c412f331 100644 --- a/packages/graphql-language-service-server/src/parsers/astro.ts +++ b/packages/graphql-language-service-server/src/parsers/astro.ts @@ -1,7 +1,9 @@ -import { parse } from 'astrojs-compiler-sync'; import { Position, Range } from 'graphql-language-service'; import { RangeMapper, SourceParser } from './types'; import { babelParser } from './babel'; +import { parse } from 'astrojs-compiler-sync'; + +// import { teardown } from '@astrojs/compiler/dist/node'; type ParseAstroResult = | { type: 'error'; errors: string[] } @@ -14,6 +16,7 @@ type ParseAstroResult = function parseAstro(source: string): ParseAstroResult { // eslint-disable-next-line unicorn/no-useless-undefined const { ast, diagnostics } = parse(source, undefined); + if (diagnostics.some(d => d.severity === /* Error */ 1)) { return { type: 'error', @@ -44,11 +47,11 @@ function parseAstro(source: string): ParseAstroResult { export const astroParser: SourceParser = (text, uri, logger) => { const parseAstroResult = parseAstro(text); if (parseAstroResult.type === 'error') { - logger.error( + logger.info( `Could not parse the astro file at ${uri} to extract the graphql tags:`, ); for (const error of parseAstroResult.errors) { - logger.error(String(error)); + logger.info(String(error)); } return null; } diff --git a/packages/graphql-language-service-server/src/parsers/babel.ts b/packages/graphql-language-service-server/src/parsers/babel.ts index aa2c37bd33a..4216c11a50e 100644 --- a/packages/graphql-language-service-server/src/parsers/babel.ts +++ b/packages/graphql-language-service-server/src/parsers/babel.ts @@ -15,10 +15,10 @@ export const ecmaParser: SourceParser = (text, uri, logger) => { try { return { asts: [babelParser(text, ['flow', 'flowComments'])] }; } catch (error) { - logger.error( + logger.info( `Could not parse the JavaScript file at ${uri} to extract the graphql tags:`, ); - logger.error(String(error)); + logger.info(String(error)); return null; } }; @@ -27,10 +27,10 @@ export const tsParser: SourceParser = (text, uri, logger) => { try { return { asts: [babelParser(text, ['typescript'])] }; } catch (error) { - logger.error( + logger.info( `Could not parse the TypeScript file at ${uri} to extract the graphql tags:`, ); - logger.error(String(error)); + logger.info(String(error)); return null; } }; diff --git a/packages/graphql-language-service-server/src/parsers/svelte.ts b/packages/graphql-language-service-server/src/parsers/svelte.ts index f19178b6239..e838271ff29 100644 --- a/packages/graphql-language-service-server/src/parsers/svelte.ts +++ b/packages/graphql-language-service-server/src/parsers/svelte.ts @@ -36,10 +36,10 @@ export const svelteParser: SourceParser = (text, uri, logger) => { rangeMapper, }; } catch (error) { - logger.error( + logger.info( `Could not parse the Svelte file at ${uri} to extract the graphql tags:`, ); - logger.error(String(error)); + logger.info(String(error)); return null; } }; diff --git a/packages/graphql-language-service-server/src/parsers/vue.ts b/packages/graphql-language-service-server/src/parsers/vue.ts index cdcb30de263..a1a80be2d52 100644 --- a/packages/graphql-language-service-server/src/parsers/vue.ts +++ b/packages/graphql-language-service-server/src/parsers/vue.ts @@ -49,11 +49,11 @@ export const vueParser: SourceParser = (text, uri, logger) => { const asts = []; const parseVueSFCResult = parseVueSFC(text); if (parseVueSFCResult.type === 'error') { - logger.error( + logger.info( `Could not parse the vue file at ${uri} to extract the graphql tags:`, ); for (const error of parseVueSFCResult.errors) { - logger.error(String(error)); + logger.info(String(error)); } return null; } diff --git a/packages/graphql-language-service-server/src/startServer.ts b/packages/graphql-language-service-server/src/startServer.ts index 69924e2ac98..eb0c999bc5c 100644 --- a/packages/graphql-language-service-server/src/startServer.ts +++ b/packages/graphql-language-service-server/src/startServer.ts @@ -6,9 +6,8 @@ * LICENSE file in the root directory of this source tree. * */ -import * as net from 'node:net'; import { MessageProcessor } from './MessageProcessor'; -import { GraphQLConfig, GraphQLExtensionDeclaration } from 'graphql-config'; +import { GraphQLConfig } from 'graphql-config'; import { IPCMessageReader, IPCMessageWriter, @@ -36,7 +35,7 @@ import { DocumentSymbolRequest, PublishDiagnosticsParams, WorkspaceSymbolRequest, - createConnection, + createConnection as createLanguageServerConnection, Connection, } from 'vscode-languageserver/node'; @@ -47,62 +46,8 @@ import { DEFAULT_SUPPORTED_GRAPHQL_EXTENSIONS, SupportedExtensionsEnum, } from './constants'; -import { LoadConfigOptions } from './types'; - -export interface ServerOptions { - /** - * port for the LSP server to run on. required if using method socket - */ - port?: number; - /** - * hostname if using socker - */ - hostname?: string; - /** - * socket, streams, or node (ipc). `node` by default. - */ - method?: 'socket' | 'stream' | 'node'; - /** - * `LoadConfigOptions` from `graphql-config@3` to use when we `loadConfig()` - * uses process.cwd() by default for `rootDir` option. - * you can also pass explicit `filepath`, add extensions, etc - */ - loadConfigOptions?: LoadConfigOptions; - /** - * (deprecated: use loadConfigOptions.rootDir now) the directory where graphql-config is found - */ - configDir?: string; - /** - * (deprecated: use loadConfigOptions.extensions now) array of functions to transform the graphql-config and add extensions dynamically - */ - extensions?: GraphQLExtensionDeclaration[]; - /** - * default: ['.js', '.jsx', '.tsx', '.ts', '.mjs'] - * allowed file extensions for embedded graphql, used by the parser. - * note that with vscode, this is also controlled by manifest and client configurations. - * do not put full-file graphql extensions here! - */ - fileExtensions?: ReadonlyArray; - /** - * default: ['graphql'] - allowed file extensions for graphql, used by the parser - */ - graphqlFileExtensions?: string[]; - /** - * pre-existing GraphQLConfig primitive, to override `loadConfigOptions` and related deprecated fields - */ - config?: GraphQLConfig; - /** - * custom, multi-language parser used by the LSP server. - * detects extension from uri and decides how to parse it. - * uses graphql.parse() by default - * response format is designed to assist with developing LSP tooling around embedded language support - */ - parser?: typeof parseDocument; - /** - * the temporary directory that the server writes to for logs and caching schema - */ - tmpDir?: string; -} +import { LoadConfigOptions, ServerOptions } from './types'; +import { createConnection } from 'node:net'; /** * Make loadConfigOptions @@ -115,10 +60,14 @@ export type MappedServerOptions = Omit & { * Legacy mappings for < 2.5.0 * @param options {ServerOptions} */ -const buildOptions = (options: ServerOptions): MappedServerOptions => { +export const buildOptions = (options: ServerOptions): MappedServerOptions => { const serverOptions = { ...options } as MappedServerOptions; + if (serverOptions.loadConfigOptions) { const { extensions, rootDir } = serverOptions.loadConfigOptions; + if (extensions) { + serverOptions.loadConfigOptions.extensions = extensions; + } if (!rootDir) { if (serverOptions.configDir) { serverOptions.loadConfigOptions.rootDir = serverOptions.configDir; @@ -126,16 +75,10 @@ const buildOptions = (options: ServerOptions): MappedServerOptions => { serverOptions.loadConfigOptions.rootDir = process.cwd(); } } - if (serverOptions.extensions) { - serverOptions.loadConfigOptions.extensions = [ - ...serverOptions.extensions, - ...(extensions || []), - ]; - } } else { serverOptions.loadConfigOptions = { rootDir: options.configDir || process.cwd(), - extensions: [], + extensions: serverOptions.extensions || [], }; } return serverOptions; @@ -148,61 +91,54 @@ const buildOptions = (options: ServerOptions): MappedServerOptions => { * @returns {Promise} */ export default async function startServer( - options: ServerOptions, -): Promise { - if (!options?.method) { - return; - } - const finalOptions = buildOptions(options); + options?: ServerOptions, +): Promise { + const finalOptions = buildOptions({ method: 'node', ...options }); let reader; let writer; - switch (options.method) { + switch (finalOptions.method) { case 'socket': // For socket connection, the message connection needs to be // established before the server socket starts listening. // Do that, and return at the end of this block. - if (!options.port) { + if (!finalOptions.port) { process.stderr.write( '--port is required to establish socket connection.', ); process.exit(1); } - const { port, hostname } = options; - const socket = net - .createServer(async client => { - client.setEncoding('utf8'); - reader = new SocketMessageReader(client); - writer = new SocketMessageWriter(client); - client.on('end', () => { - socket.close(); - process.exit(0); - }); - const s = await initializeHandlers({ - reader, - writer, - options: finalOptions, - }); - s.listen(); - }) - .listen(port, hostname); - return; - case 'stream': - reader = new StreamMessageReader(process.stdin); - writer = new StreamMessageWriter(process.stdout); + const { port, hostname, encoding } = finalOptions; + const socket = createConnection(port, hostname ?? '127.0.01'); + + reader = new SocketMessageReader(socket, encoding ?? 'utf-8'); + writer = new SocketMessageWriter(socket, encoding ?? 'utf-8'); + break; + case 'stream': + const server = createLanguageServerConnection( + // @ts-expect-error this still works, just a type mismatch + process.stdin, + process.stderr, + { + connectionStrategy: 'stdio', + }, + ); + server.listen(); + return server; + default: reader = new IPCMessageReader(process); writer = new IPCMessageWriter(process); break; } - - const serverWithHandlers = await initializeHandlers({ + const streamServer = await initializeHandlers({ reader, writer, options: finalOptions, }); - serverWithHandlers.listen(); + streamServer.listen(); + return streamServer; } type InitializerParams = { @@ -211,13 +147,13 @@ type InitializerParams = { options: MappedServerOptions; }; -async function initializeHandlers({ +export async function initializeHandlers({ reader, writer, options, }: InitializerParams): Promise { - const connection = createConnection(reader, writer); - const logger = new Logger(connection); + const connection = createLanguageServerConnection(reader, writer); + const logger = new Logger(connection, options.debug); try { await addHandlers({ connection, logger, ...options }); @@ -258,7 +194,7 @@ type HandlerOptions = { * * @param options {HandlerOptions} */ -async function addHandlers({ +export async function addHandlers({ connection, logger, config, @@ -306,8 +242,9 @@ async function addHandlers({ }, ); - connection.onNotification(DidCloseTextDocumentNotification.type, params => - messageProcessor.handleDidCloseNotification(params), + connection.onNotification( + DidCloseTextDocumentNotification.type, + messageProcessor.handleDidCloseNotification, ); connection.onRequest(ShutdownRequest.type, () => messageProcessor.handleShutdownRequest(), diff --git a/packages/graphql-language-service-server/src/types.ts b/packages/graphql-language-service-server/src/types.ts index 39aafe88dc7..cc3c6044121 100644 --- a/packages/graphql-language-service-server/src/types.ts +++ b/packages/graphql-language-service-server/src/types.ts @@ -1,2 +1,117 @@ -import type { loadConfig } from 'graphql-config'; +import type { + GraphQLExtensionDeclaration, + loadConfig, + GraphQLProjectConfig, +} from 'graphql-config'; export type LoadConfigOptions = Parameters[0]; +import { GraphQLConfig } from 'graphql-config'; +import { ASTNode, GraphQLType } from 'graphql'; +import { parseDocument } from './parseDocument'; +import { SupportedExtensionsEnum } from './constants'; + +// base 1 +type RangeType = { + start: { + line: number; + character: number; + }; + end: { + line: number; + character: number; + }; +}; + +type AdditionalLocateInfo = { + node?: ASTNode | null; + type?: GraphQLType | null; + project: GraphQLProjectConfig; +}; + +type RelayLSPLocateCommand = ( + // either Type, Type.field or Type.field(argument) + projectName: string, + typeName: string, + info: AdditionalLocateInfo, +) => `${string}:${string}:${string}` | `${string}:${string}` | string; + +type GraphQLLocateCommand = ( + projectName: string, + typeName: string, + info: AdditionalLocateInfo, +) => { + range: RangeType; + uri: string; +}; + +export type LocateCommand = RelayLSPLocateCommand | GraphQLLocateCommand; + +export interface ServerOptions { + /** + * socket, streams, or node (ipc). + * @default 'node' + */ + method?: 'socket' | 'stream' | 'node'; + /** + * (socket only) port for the LSP server to run on. required if using method socket + */ + port?: number; + /** + * (socket only) hostname for the LSP server to run on. + * @default '127.0.0.1' + */ + hostname?: string; + /** + * (socket only) encoding for the LSP server to use. + * @default 'utf-8' + */ + encoding?: 'utf-8' | 'ascii'; + /** + * `LoadConfigOptions` from `graphql-config@3` to use when we `loadConfig()` + * uses process.cwd() by default for `rootDir` option. + * you can also pass explicit `filepath`, add extensions, etc + */ + loadConfigOptions?: LoadConfigOptions; + /** + * @deprecated use loadConfigOptions.rootDir now) the directory where graphql-config is found + */ + configDir?: string; + /** + * @deprecated use loadConfigOptions.extensions + */ + extensions?: GraphQLExtensionDeclaration[]; + /** + * allowed file extensions for embedded graphql, used by the parser. + * note that with vscode, this is also controlled by manifest and client configurations. + * do not put full-file graphql extensions here! + * @default ['.js', '.jsx', '.tsx', '.ts', '.mjs'] + */ + fileExtensions?: ReadonlyArray; + /** + * allowed file extensions for full-file graphql, used by the parser. + * @default ['graphql', 'graphqls', 'gql' ] + */ + graphqlFileExtensions?: string[]; + /** + * pre-existing GraphQLConfig primitive, to override `loadConfigOptions` and related deprecated fields + */ + config?: GraphQLConfig; + /** + * custom, multi-language parser used by the LSP server. + * detects extension from uri and decides how to parse it. + * uses graphql.parse() by default + * response format is designed to assist with developing LSP tooling around embedded language support + */ + parser?: typeof parseDocument; + /** + * the temporary directory that the server writes to for logs and caching schema + */ + tmpDir?: string; + + /** + * debug mode + * + * same as with the client reference implementation, the debug setting controls logging output + * this allows all logger.info() messages to come through. by default, the highest level is warn + */ + debug?: true; +} diff --git a/packages/graphql-language-service/src/index.ts b/packages/graphql-language-service/src/index.ts index 9dad5cbdfab..e19879eeb5e 100644 --- a/packages/graphql-language-service/src/index.ts +++ b/packages/graphql-language-service/src/index.ts @@ -21,14 +21,12 @@ export { getDefinitionQueryResultForFragmentSpread, getDefinitionQueryResultForNamedType, getDefinitionQueryResultForField, - getDefinitionState, + getDefinitionQueryResultForArgument, getDiagnostics, - getFieldDef, getFragmentDefinitions, getHoverInformation, getOutline, getRange, - getTokenAtPosition, getTypeInfo, getVariableCompletions, SEVERITY, @@ -37,6 +35,7 @@ export { SeverityEnum, DIAGNOSTIC_SEVERITY, DefinitionQueryResult, + DefinitionQueryResponse, canUseDirective, SuggestionCommand, AutocompleteSuggestionOptions, @@ -57,6 +56,10 @@ export { list, t, opt, + getTokenAtPosition, + GraphQLDocumentMode, + getDefinitionState, + getFieldDef, } from './parser'; export type { diff --git a/packages/graphql-language-service/src/interface/__tests__/__schema__/HoverTestSchema.graphql b/packages/graphql-language-service/src/interface/__tests__/__schema__/HoverTestSchema.graphql index 4ab0c7de37e..3a03252fe25 100644 --- a/packages/graphql-language-service/src/interface/__tests__/__schema__/HoverTestSchema.graphql +++ b/packages/graphql-language-service/src/interface/__tests__/__schema__/HoverTestSchema.graphql @@ -19,6 +19,7 @@ enum Color { union UnionType = String | Float | Boolean interface TestInterface { + # hello id: String! } @@ -40,7 +41,7 @@ type Query { """ thing: TestType listOfThing: [TestType!] - parameterizedField(id: String!): TestType + parameterizedField(id: String!, enum: Color): TestType cluck: Chicken unionField: UnionType } diff --git a/packages/graphql-language-service/src/interface/__tests__/__schema__/StarWarsSchema.graphql b/packages/graphql-language-service/src/interface/__tests__/__schema__/StarWarsSchema.graphql index ba9fe3a55b4..c16bdf63983 100644 --- a/packages/graphql-language-service/src/interface/__tests__/__schema__/StarWarsSchema.graphql +++ b/packages/graphql-language-service/src/interface/__tests__/__schema__/StarWarsSchema.graphql @@ -14,6 +14,7 @@ enum Episode { interface Character { id: String! + # hello name: String friends: [Character] appearsIn: [Episode] @@ -30,6 +31,7 @@ type Human implements Character { type Droid implements Character { id: String! + # yes name: String friends: [Character] appearsIn: [Episode] @@ -41,13 +43,18 @@ type Droid implements Character { input InputType { key: String! value: Int = 42 + obj: InputType } interface TestInterface { + """ + example + """ testField: String! } interface AnotherInterface implements TestInterface { + # hello testField: String! } @@ -61,6 +68,7 @@ type Query { droid(id: String!): Droid inputTypeTest(args: InputType = { key: "key" }): TestType deprecatedField: TestType @deprecated(reason: "Use test instead.") + union: TestUnion } union TestUnion = Droid | TestType diff --git a/packages/graphql-language-service/src/interface/__tests__/getAutocompleteSuggestions-test.ts b/packages/graphql-language-service/src/interface/__tests__/getAutocompleteSuggestions-test.ts index f7daabfe2f5..e784200f9b4 100644 --- a/packages/graphql-language-service/src/interface/__tests__/getAutocompleteSuggestions-test.ts +++ b/packages/graphql-language-service/src/interface/__tests__/getAutocompleteSuggestions-test.ts @@ -19,11 +19,18 @@ import { GraphQLSchema, parse, version as graphQLVersion, + GraphQLString, + GraphQLInt, + GraphQLBoolean, + GraphQLDeprecatedDirective, + GraphQLSkipDirective, + GraphQLIncludeDirective, } from 'graphql'; import { Position } from '../../utils'; import path from 'node:path'; import { getAutocompleteSuggestions } from '../getAutocompleteSuggestions'; +// import { InsertTextFormat } from 'vscode-languageserver-types'; const expectedResults = { droid: { @@ -50,6 +57,15 @@ const expectedResults = { label: 'friends', detail: '[Character]', }, + union: { + label: 'union', + detail: 'TestUnion', + }, + __typename: { + label: '__typename', + detail: 'String!', + documentation: 'The name of the current Object type at runtime.', + }, }; const suggestionCommand = { @@ -74,7 +90,7 @@ describe('getAutocompleteSuggestions', () => { query: string, point: Position, externalFragments?: FragmentDefinitionNode[], - options?: AutocompleteSuggestionOptions, + options?: AutocompleteSuggestionOptions & { ignoreInsert?: boolean }, ): Array { return getAutocompleteSuggestions( schema, @@ -93,30 +109,40 @@ describe('getAutocompleteSuggestions', () => { if (suggestion.detail) { response.detail = String(suggestion.detail); } - if (suggestion.insertText) { + if (suggestion.insertText && !options?.ignoreInsert) { response.insertText = suggestion.insertText; } - if (suggestion.insertTextFormat) { + if (suggestion.insertTextFormat && !options?.ignoreInsert) { response.insertTextFormat = suggestion.insertTextFormat; } - if (suggestion.command) { + if (suggestion.command && !options?.ignoreInsert) { response.command = suggestion.command; } + if (suggestion.documentation?.length) { + response.documentation = suggestion.documentation; + } + if (suggestion.labelDetails && !options?.ignoreInsert) { + response.labelDetails = suggestion.labelDetails; + } + return response; }); } describe('with Operation types', () => { const expectedDirectiveSuggestions = [ - { label: 'include' }, - { label: 'skip' }, + { label: 'include', documentation: GraphQLIncludeDirective.description }, + { label: 'skip', documentation: GraphQLSkipDirective.description }, ]; // TODO: remove this once defer and stream are merged to `graphql` if (graphQLVersion.startsWith('16.0.0-experimental-stream-defer')) { + // @ts-expect-error expectedDirectiveSuggestions.push({ label: 'stream' }, { label: 'test' }); } else { + // @ts-expect-error expectedDirectiveSuggestions.push({ label: 'test' }); } + it('provides correct sortText response', () => { const result = getAutocompleteSuggestions( schema, @@ -137,7 +163,7 @@ describe('getAutocompleteSuggestions', () => { }, { - sortText: '6__schema', + sortText: '7__schema', label: '__schema', detail: '__Schema!', }, @@ -147,10 +173,17 @@ describe('getAutocompleteSuggestions', () => { it('provides correct initial keywords', () => { expect(testSuggestions('', new Position(0, 0))).toEqual([ { label: '{' }, + { label: 'extend' }, { label: 'fragment' }, + { label: 'input' }, + { label: 'interface' }, { label: 'mutation' }, { label: 'query' }, + { label: 'scalar' }, + { label: 'schema' }, { label: 'subscription' }, + { label: 'type' }, + { label: 'union' }, ]); expect(testSuggestions('q', new Position(0, 1))).toEqual([ @@ -159,9 +192,9 @@ describe('getAutocompleteSuggestions', () => { ]); }); - it('provides correct suggestions at where the cursor is', () => { + it('provides correct top level suggestions when a simple query is already present', () => { // Below should provide initial keywords - expect(testSuggestions(' {}', new Position(0, 0))).toEqual([ + expect(testSuggestions(' { id }', new Position(0, 0))).toEqual([ { label: '{' }, { label: 'fragment' }, { label: 'mutation' }, @@ -170,12 +203,17 @@ describe('getAutocompleteSuggestions', () => { ]); // Below should provide root field names - expect(testSuggestions(' {}', new Position(0, 2))).toEqual([ - { label: '__typename', detail: 'String!' }, + expect( + testSuggestions(' {}', new Position(0, 2), [], { + ignoreInsert: true, + }), + ).toEqual([ + expectedResults.__typename, expectedResults.droid, expectedResults.hero, expectedResults.human, expectedResults.inputTypeTest, + expectedResults.union, ]); // Test for query text with empty lines @@ -187,29 +225,39 @@ describe('getAutocompleteSuggestions', () => { } `, new Position(2, 0), + [], + { + ignoreInsert: true, + }, ), ).toEqual([ - { label: '__typename', detail: 'String!' }, + expectedResults.__typename, expectedResults.droid, expectedResults.hero, expectedResults.human, expectedResults.inputTypeTest, + expectedResults.union, ]); }); it('provides correct field name suggestions', () => { - const result = testSuggestions('{ ', new Position(0, 2)); + const result = testSuggestions('{ ', new Position(0, 2), [], { + ignoreInsert: true, + }); expect(result).toEqual([ - { label: '__typename', detail: 'String!' }, + expectedResults.__typename, expectedResults.droid, expectedResults.hero, expectedResults.human, expectedResults.inputTypeTest, + expectedResults.union, ]); }); it('provides correct field name suggestions after filtered', () => { - const result = testSuggestions('{ h ', new Position(0, 3)); + const result = testSuggestions('{ h ', new Position(0, 3), [], { + ignoreInsert: true, + }); expect(result).toEqual([expectedResults.hero, expectedResults.human]); }); @@ -217,10 +265,14 @@ describe('getAutocompleteSuggestions', () => { const result = testSuggestions( '{ alias: human(id: "1") { ', new Position(0, 26), + [], + { + ignoreInsert: true, + }, ); expect(result).toEqual([ - { label: '__typename', detail: 'String!' }, + expectedResults.__typename, expectedResults.appearsIn, expectedResults.friends, { label: 'id', detail: 'String!' }, @@ -229,6 +281,59 @@ describe('getAutocompleteSuggestions', () => { ]); }); + it('provides correct field name suggestions with insertText', () => { + const result = testSuggestions('{ ', new Position(0, 2), [], { + ignoreInsert: false, + fillLeafsOnComplete: true, + }); + expect(result).toEqual([ + { + ...expectedResults.__typename, + command: suggestionCommand, + insertTextFormat: 2, + insertText: '__typename\n', + labelDetails: { detail: ' String!' }, + }, + { + ...expectedResults.droid, + command: suggestionCommand, + insertTextFormat: 2, + insertText: 'droid(id: $1) {\n $1\n}', + labelDetails: { detail: ' Droid' }, + }, + { + ...expectedResults.hero, + command: suggestionCommand, + insertTextFormat: 2, + insertText: 'hero {\n $1\n}', + labelDetails: { detail: ' Character' }, + }, + { + ...expectedResults.human, + command: suggestionCommand, + insertTextFormat: 2, + insertText: 'human(id: $1) {\n $1\n}', + labelDetails: { detail: ' Human' }, + }, + { + ...expectedResults.inputTypeTest, + command: suggestionCommand, + insertTextFormat: 2, + insertText: 'inputTypeTest {\n $1\n}', + labelDetails: { detail: ' TestType' }, + }, + { + label: 'union', + insertTextFormat: 2, + insertText: 'union {\n $1\n}', + detail: 'TestUnion', + command: suggestionCommand, + labelDetails: { + detail: ' TestUnion', + }, + }, + ]); + }); it('provides correct type suggestions for fragments', () => { const result = testSuggestions('fragment test on ', new Position(0, 17)); @@ -248,10 +353,14 @@ describe('getAutocompleteSuggestions', () => { const result = testSuggestions( 'fragment test on Human { ', new Position(0, 25), + [], + { + ignoreInsert: true, + }, ); expect(result).toEqual([ - { label: '__typename', detail: 'String!' }, + expectedResults.__typename, expectedResults.appearsIn, expectedResults.friends, { label: 'id', detail: 'String!' }, @@ -265,9 +374,10 @@ describe('getAutocompleteSuggestions', () => { expect(result).toEqual([ { label: 'id', - detail: 'String!', insertText: 'id: ', command: suggestionCommand, + insertTextFormat: 2, + labelDetails: { detail: ' String!' }, }, ]); }); @@ -280,26 +390,37 @@ describe('getAutocompleteSuggestions', () => { expect(result).toEqual([ { label: 'id', - detail: 'String!', command: suggestionCommand, insertText: 'id: ', + insertTextFormat: 2, + labelDetails: { detail: ' String!' }, }, ]); }); - + const metaArgs = [ + { + label: '__DirectiveLocation', + documentation: + 'A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.', + }, + { + label: '__TypeKind', + documentation: + 'An enum describing what kind of type a given `__Type` is.', + }, + ]; it('provides correct input type suggestions', () => { const result = testSuggestions( 'query($exampleVariable: ) { ', new Position(0, 24), ); expect(result).toEqual([ - { label: '__DirectiveLocation' }, - { label: '__TypeKind' }, - { label: 'Boolean' }, + ...metaArgs, + { label: 'Boolean', documentation: GraphQLBoolean.description }, { label: 'Episode' }, { label: 'InputType' }, - { label: 'Int' }, - { label: 'String' }, + { label: 'Int', documentation: GraphQLInt.description }, + { label: 'String', documentation: GraphQLString.description }, ]); }); @@ -309,11 +430,11 @@ describe('getAutocompleteSuggestions', () => { new Position(0, 26), ); expect(result).toEqual([ - { label: '__DirectiveLocation' }, - { label: '__TypeKind' }, + ...metaArgs, + { label: 'InputType' }, - { label: 'Int' }, - { label: 'String' }, + { label: 'Int', documentation: GraphQLInt.description }, + { label: 'String', documentation: GraphQLString.description }, ]); }); @@ -378,7 +499,7 @@ describe('getAutocompleteSuggestions', () => { new Position(0, 51), ); expect(result).toEqual([ - { label: 'ep', insertText: '$ep', detail: 'Episode' }, + { label: '$ep', insertText: 'ep', detail: 'Episode' }, ]); }); @@ -388,8 +509,9 @@ describe('getAutocompleteSuggestions', () => { new Position(0, 55), ); expect(result).toEqual([ + { label: '$episode', detail: 'Episode', insertText: '$episode' }, { label: 'EMPIRE', detail: 'Episode' }, - { label: 'episode', detail: 'Episode', insertText: '$episode' }, + { label: 'JEDI', detail: 'Episode' }, { label: 'NEWHOPE', detail: 'Episode' }, // no $id here, it's not compatible :P @@ -405,13 +527,27 @@ describe('getAutocompleteSuggestions', () => { `${fragmentDef} query { human(id: "1") { ...`, new Position(0, 57), ), - ).toEqual([{ label: 'Foo', detail: 'Human' }]); + ).toEqual([ + { + label: 'Foo', + detail: 'Human', + documentation: 'fragment Foo on Human', + labelDetails: { detail: 'fragment Foo on Human' }, + }, + ]); expect( testSuggestions( `query { human(id: "1") { ... }} ${fragmentDef}`, new Position(0, 28), ), - ).toEqual([{ label: 'Foo', detail: 'Human' }]); + ).toEqual([ + { + label: 'Foo', + detail: 'Human', + documentation: 'fragment Foo on Human', + labelDetails: { detail: 'fragment Foo on Human' }, + }, + ]); // Test on abstract type expect( @@ -419,7 +555,14 @@ describe('getAutocompleteSuggestions', () => { `${fragmentDef} query { hero(episode: JEDI) { ...`, new Position(0, 62), ), - ).toEqual([{ label: 'Foo', detail: 'Human' }]); + ).toEqual([ + { + label: 'Foo', + detail: 'Human', + documentation: 'fragment Foo on Human', + labelDetails: { detail: 'fragment Foo on Human' }, + }, + ]); }); it('provides correct fragment name suggestions for external fragments', () => { @@ -439,8 +582,18 @@ describe('getAutocompleteSuggestions', () => { ); expect(result).toEqual([ - { label: 'CharacterDetails', detail: 'Human' }, - { label: 'CharacterDetails2', detail: 'Human' }, + { + label: 'CharacterDetails', + detail: 'Human', + documentation: 'fragment CharacterDetails on Human', + labelDetails: { detail: 'fragment CharacterDetails on Human' }, + }, + { + label: 'CharacterDetails2', + detail: 'Human', + documentation: 'fragment CharacterDetails2 on Human', + labelDetails: { detail: 'fragment CharacterDetails2 on Human' }, + }, ]); }); @@ -460,23 +613,69 @@ describe('getAutocompleteSuggestions', () => { expect(testSuggestions('query @', new Position(0, 7))).toEqual([]); }); - it('provides correct testInput suggestions', () => { + it('provides correct directive field suggestions', () => { expect( - testSuggestions('{ inputTypeTest(args: {', new Position(0, 23)), + testSuggestions('{ test @deprecated(', new Position(0, 19)), ).toEqual([ - { label: 'key', detail: 'String!' }, - { label: 'value', detail: 'Int' }, + { + command: suggestionCommand, + label: 'reason', + insertTextFormat: 2, + insertText: 'reason: ', + documentation: GraphQLDeprecatedDirective.args[0].description, + labelDetails: { + detail: ' String', + }, + }, ]); }); + const inputArgs = [ + { + label: 'key', + detail: 'String!', + insertText: 'key: ', + insertTextFormat: 2, + command: suggestionCommand, + }, + { + detail: 'InputType', + label: 'obj', + insertText: 'obj: {\n $1\n}', + command: suggestionCommand, + insertTextFormat: 2, + }, + { + label: 'value', + detail: 'Int', + insertText: 'value: ', + insertTextFormat: 2, + command: suggestionCommand, + }, + ]; + it('provides correct testInput type field suggestions', () => { + expect( + testSuggestions('{ inputTypeTest(args: {', new Position(0, 23)), + ).toEqual(inputArgs); + }); + + it('provides correct nested testInput type field suggestions', () => { + expect( + testSuggestions('{ inputTypeTest(args: { obj: {', new Position(0, 30)), + ).toEqual(inputArgs); + }); it('provides correct field name suggestion inside inline fragment', () => { expect( testSuggestions( 'fragment Foo on Character { ... on Human { }}', new Position(0, 42), + [], + { + ignoreInsert: true, + }, ), ).toEqual([ - { label: '__typename', detail: 'String!' }, + expectedResults.__typename, expectedResults.appearsIn, expectedResults.friends, { label: 'id', detail: 'String!' }, @@ -486,9 +685,16 @@ describe('getAutocompleteSuggestions', () => { // Type-less inline fragment assumes the type automatically expect( - testSuggestions('fragment Foo on Droid { ... { ', new Position(0, 30)), + testSuggestions( + 'fragment Foo on Droid { ... { ', + new Position(0, 30), + [], + { + ignoreInsert: true, + }, + ), ).toEqual([ - { label: '__typename', detail: 'String!' }, + expectedResults.__typename, expectedResults.appearsIn, expectedResults.friends, { label: 'id', detail: 'String!' }, @@ -501,7 +707,7 @@ describe('getAutocompleteSuggestions', () => { }); describe('with SDL types', () => { - it('provides correct initial keywords', () => { + it('provides correct initial keywords w/ graphqls', () => { expect( testSuggestions('', new Position(0, 0), [], { uri: 'schema.graphqls' }), ).toEqual([ @@ -515,6 +721,25 @@ describe('getAutocompleteSuggestions', () => { ]); }); + it('provides correct initial keywords w/out graphqls', () => { + expect( + testSuggestions('', new Position(0, 0), [], { uri: 'schema.graphql' }), + ).toEqual([ + { label: '{' }, + { label: 'extend' }, + { label: 'fragment' }, + { label: 'input' }, + { label: 'interface' }, + { label: 'mutation' }, + { label: 'query' }, + { label: 'scalar' }, + { label: 'schema' }, + { label: 'subscription' }, + { label: 'type' }, + { label: 'union' }, + ]); + }); + it('provides correct initial definition keywords', () => { expect( testSuggestions('type Type { field: String }\n\n', new Position(0, 31)), @@ -595,13 +820,81 @@ describe('getAutocompleteSuggestions', () => { expect(testSuggestions('type Type @', new Position(0, 11))).toEqual([ { label: 'onAllDefs' }, ])); - it('provides correct suggestions on object fields', () => + it('provides correct suggestions on object field w/ .graphqls', () => expect( testSuggestions('type Type {\n aField: s', new Position(0, 23), [], { uri: 'schema.graphqls', + ignoreInsert: true, + }), + ).toEqual([ + { label: 'Episode' }, + { label: 'String' }, + { label: 'TestInterface' }, + { label: 'TestType' }, + { label: 'TestUnion' }, + ])); + + it('provides correct argument type suggestions on directive definitions', () => + expect( + testSuggestions( + 'directive @skip(if: ) on FIELD | FRAGMENT_SPREAD | INLINE_FRAGMENT', + new Position(0, 19), + [], + { + ignoreInsert: true, + }, + ), + ).toEqual([ + { label: 'Boolean' }, + { label: 'Episode' }, + { label: 'InputType' }, + { label: 'Int' }, + { label: 'String' }, + ])); + + it('provides correct suggestions on object fields', () => + expect( + testSuggestions('type Type {\n aField: s', new Position(0, 23), [], { + uri: 'schema.graphql', + ignoreInsert: true, + }), + ).toEqual([ + { label: 'Episode' }, + { label: 'String' }, + { label: 'TestInterface' }, + { label: 'TestType' }, + { label: 'TestUnion' }, + ])); + // TODO: shouldn't TestType and TestUnion be available here? + it('provides correct filtered suggestions on object fields in regular SDL files', () => + expect( + testSuggestions('type Type {\n aField: s', new Position(0, 23), [], { + uri: 'schema.graphql', + ignoreInsert: true, + }), + ).toEqual([ + { label: 'Episode' }, + { label: 'String' }, + { label: 'TestInterface' }, + { label: 'TestType' }, + { label: 'TestUnion' }, + ])); + it('provides correct unfiltered suggestions on object fields in regular SDL files', () => + expect( + testSuggestions('type Type {\n aField: ', new Position(0, 22), [], { + uri: 'schema.graphql', + ignoreInsert: true, }), ).toEqual([ + { label: 'AnotherInterface' }, + { label: 'Boolean' }, + { label: 'Character' }, + { label: 'Droid' }, { label: 'Episode' }, + { label: 'Human' }, + { label: 'Int' }, + // TODO: maybe filter out types attached to top level schema? + { label: 'Query' }, { label: 'String' }, { label: 'TestInterface' }, { label: 'TestType' }, @@ -611,6 +904,27 @@ describe('getAutocompleteSuggestions', () => { expect( testSuggestions('type Type {\n aField: []', new Position(0, 25), [], { uri: 'schema.graphqls', + ignoreInsert: true, + }), + ).toEqual([ + { label: 'AnotherInterface' }, + { label: 'Boolean' }, + { label: 'Character' }, + { label: 'Droid' }, + { label: 'Episode' }, + { label: 'Human' }, + { label: 'Int' }, + { label: 'Query' }, + { label: 'String' }, + { label: 'TestInterface' }, + { label: 'TestType' }, + { label: 'TestUnion' }, + ])); + it('provides correct suggestions on object fields that are arrays in SDL context', () => + expect( + testSuggestions('type Type {\n aField: []', new Position(0, 25), [], { + uri: 'schema.graphql', + ignoreInsert: true, }), ).toEqual([ { label: 'AnotherInterface' }, @@ -631,12 +945,18 @@ describe('getAutocompleteSuggestions', () => { testSuggestions('input Type {\n aField: s', new Position(0, 23), [], { uri: 'schema.graphqls', }), - ).toEqual([{ label: 'Episode' }, { label: 'String' }])); + ).toEqual([ + { label: 'Episode' }, + { label: 'String', documentation: GraphQLString.description }, + ])); it('provides correct directive suggestions on args definitions', () => expect( testSuggestions('type Type { field(arg: String @', new Position(0, 31)), ).toEqual([ - { label: 'deprecated' }, + { + label: 'deprecated', + documentation: GraphQLDeprecatedDirective.description, + }, { label: 'onAllDefs' }, { label: 'onArg' }, ])); diff --git a/packages/graphql-language-service/src/interface/__tests__/getHoverInformation-test.ts b/packages/graphql-language-service/src/interface/__tests__/getHoverInformation-test.ts index 450df17fe3c..21880895cef 100644 --- a/packages/graphql-language-service/src/interface/__tests__/getHoverInformation-test.ts +++ b/packages/graphql-language-service/src/interface/__tests__/getHoverInformation-test.ts @@ -101,6 +101,22 @@ describe('getHoverInformation', () => { expect(actual).toEqual('Query.parameterizedField(id: String!)'); }); + it('provides enum parameter type information', () => { + const actual = testHover( + 'query { parameterizedField(id: "foo", enum: GREEN) { testField } }', + new Position(0, 46), + ); + expect(actual).toEqual('Color.GREEN'); + }); + + it('provides variable type information', () => { + const actual = testHover( + 'query($who: String!) { parameterizedField(id: $who) { testField } }', + new Position(0, 48), + ); + expect(actual).toEqual('String!'); + }); + it('provides directive information', () => { const actual = testHover( 'query { thing { testField @skip(if:true) } }', diff --git a/packages/graphql-language-service/src/interface/autocompleteUtils.ts b/packages/graphql-language-service/src/interface/autocompleteUtils.ts index afd645e0153..ea482c02a92 100644 --- a/packages/graphql-language-service/src/interface/autocompleteUtils.ts +++ b/packages/graphql-language-service/src/interface/autocompleteUtils.ts @@ -9,76 +9,15 @@ import { GraphQLField, - GraphQLSchema, GraphQLType, - isCompositeType, - SchemaMetaFieldDef, - TypeMetaFieldDef, - TypeNameMetaFieldDef, + isListType, + isObjectType, + isInputObjectType, + getNamedType, + isAbstractType, } from 'graphql'; -import { CompletionItemBase, AllTypeInfo } from '../types'; -import { ContextTokenUnion, State } from '../parser'; - -// Utility for returning the state representing the Definition this token state -// is within, if any. -export function getDefinitionState( - tokenState: State, -): State | null | undefined { - let definitionState; - - // TODO - couldn't figure this one out - forEachState(tokenState, (state: State): void => { - switch (state.kind) { - case 'Query': - case 'ShortQuery': - case 'Mutation': - case 'Subscription': - case 'FragmentDefinition': - definitionState = state; - break; - } - }); - - return definitionState; -} - -// Gets the field definition given a type and field name -export function getFieldDef( - schema: GraphQLSchema, - type: GraphQLType, - fieldName: string, -): GraphQLField | null | undefined { - if (fieldName === SchemaMetaFieldDef.name && schema.getQueryType() === type) { - return SchemaMetaFieldDef; - } - if (fieldName === TypeMetaFieldDef.name && schema.getQueryType() === type) { - return TypeMetaFieldDef; - } - if (fieldName === TypeNameMetaFieldDef.name && isCompositeType(type)) { - return TypeNameMetaFieldDef; - } - if ('getFields' in type) { - return type.getFields()[fieldName] as any; - } - - return null; -} - -// Utility for iterating through a CodeMirror parse state stack bottom-up. -export function forEachState( - stack: State, - fn: (state: State) => AllTypeInfo | null | void, -): void { - const reverseStateStack = []; - let state: State | null | undefined = stack; - while (state?.kind) { - reverseStateStack.push(state); - state = state.prevState; - } - for (let i = reverseStateStack.length - 1; i >= 0; i--) { - fn(reverseStateStack[i]); - } -} +import { CompletionItemBase } from '../types'; +import { ContextTokenUnion } from '../parser'; export function objectValues(object: Record): Array { const keys = Object.keys(object); @@ -104,7 +43,12 @@ function filterAndSortList( list: Array, text: string, ): Array { - if (!text) { + if ( + !text || + text.trim() === '' || + text.trim() === ':' || + text.trim() === '{' + ) { return filterNonEmpty(list, entry => !entry.isDeprecated); } @@ -200,3 +144,63 @@ function lexicalDistance(a: string, b: string): number { return d[aLength][bLength]; } + +const insertSuffix = (n?: number) => ` {\n $${n ?? 1}\n}`; + +export const getInsertText = ( + prefix: string, + type?: GraphQLType, + fallback?: string, +): string => { + if (!type) { + return fallback ?? prefix; + } + + const namedType = getNamedType(type); + if ( + isObjectType(namedType) || + isInputObjectType(namedType) || + isListType(namedType) || + isAbstractType(namedType) + ) { + return prefix + insertSuffix(); + } + + return fallback ?? prefix; +}; + +export const getInputInsertText = ( + prefix: string, + type: GraphQLType, + fallback?: string, +): string => { + // if (isScalarType(type) && type.name === GraphQLString.name) { + // return prefix + '"$1"'; + // } + if (isListType(type)) { + const baseType = getNamedType(type.ofType); + return prefix + `[${getInsertText('', baseType, '$1')}]`; + } + return getInsertText(prefix, type, fallback); +}; + +/** + * generates a TextSnippet for a field with possible required arguments + * that dynamically adjusts to the number of required arguments + * @param field + * @returns + */ +export const getFieldInsertText = (field: GraphQLField) => { + const requiredArgs = field.args.filter(arg => + arg.type.toString().endsWith('!'), + ); + if (!requiredArgs.length) { + return; + } + return ( + field.name + + `(${requiredArgs.map( + (arg, i) => `${arg.name}: $${i + 1}`, + )}) ${getInsertText('', field.type, '\n')}` + ); +}; diff --git a/packages/graphql-language-service/src/interface/getAutocompleteSuggestions.ts b/packages/graphql-language-service/src/interface/getAutocompleteSuggestions.ts index 5c01896a22d..4038fae331e 100644 --- a/packages/graphql-language-service/src/interface/getAutocompleteSuggestions.ts +++ b/packages/graphql-language-service/src/interface/getAutocompleteSuggestions.ts @@ -23,8 +23,7 @@ import { Kind, DirectiveLocation, GraphQLArgument, - isListType, - isNonNullType, + // isNonNullType, isScalarType, isObjectType, isUnionType, @@ -34,19 +33,16 @@ import { GraphQLBoolean, GraphQLEnumType, GraphQLInputObjectType, - GraphQLList, SchemaMetaFieldDef, TypeMetaFieldDef, TypeNameMetaFieldDef, assertAbstractType, doTypesOverlap, getNamedType, - getNullableType, isAbstractType, isCompositeType, isInputType, visit, - BREAK, parse, } from 'graphql'; @@ -58,24 +54,32 @@ import { InsertTextFormat, } from '../types'; -import { - CharacterStream, - onlineParser, +import type { ContextToken, State, - RuleKinds, RuleKind, ContextTokenForCodeMirror, } from '../parser'; - import { - forEachState, + getTypeInfo, + runOnlineParser, + RuleKinds, + getContextAtPosition, getDefinitionState, - getFieldDef, + GraphQLDocumentMode, +} from '../parser'; +import { hintList, objectValues, + getInputInsertText, + getFieldInsertText, + getInsertText, } from './autocompleteUtils'; +import { InsertTextMode } from 'vscode-languageserver-types'; + +export { runOnlineParser, getTypeInfo }; + export const SuggestionCommand = { command: 'editor.action.triggerSuggest', title: 'Suggestions', @@ -97,57 +101,30 @@ const collectFragmentDefs = (op: string | undefined) => { return externalFragments; }; -const typeSystemKinds: Kind[] = [ - // TypeSystemDefinition - Kind.SCHEMA_DEFINITION, - Kind.OPERATION_TYPE_DEFINITION, - Kind.SCALAR_TYPE_DEFINITION, - Kind.OBJECT_TYPE_DEFINITION, - Kind.INTERFACE_TYPE_DEFINITION, - Kind.UNION_TYPE_DEFINITION, - Kind.ENUM_TYPE_DEFINITION, - Kind.INPUT_OBJECT_TYPE_DEFINITION, - Kind.DIRECTIVE_DEFINITION, - // TypeSystemExtension - Kind.SCHEMA_EXTENSION, - Kind.SCALAR_TYPE_EXTENSION, - Kind.OBJECT_TYPE_EXTENSION, - Kind.INTERFACE_TYPE_EXTENSION, - Kind.UNION_TYPE_EXTENSION, - Kind.ENUM_TYPE_EXTENSION, - Kind.INPUT_OBJECT_TYPE_EXTENSION, -]; - -const hasTypeSystemDefinitions = (sdl: string | undefined) => { - let hasTypeSystemDef = false; - if (sdl) { - try { - visit(parse(sdl), { - enter(node) { - if (node.kind === 'Document') { - return; - } - if (typeSystemKinds.includes(node.kind)) { - hasTypeSystemDef = true; - return BREAK; - } - return false; - }, - }); - } catch { - return hasTypeSystemDef; - } - } - return hasTypeSystemDef; -}; - export type AutocompleteSuggestionOptions = { + /** + * EXPERIMENTAL: Automatically fill required leaf nodes recursively + * upon triggering code completion events. + * + * + * - [x] fills required nodes + * - [x] automatically expands relay-style node/edge fields + * - [ ] automatically jumps to first required argument field + * - then, continues to prompt for required argument fields + * - (fixing this will make it non-experimental) + * - when it runs out of arguments, or you choose `{` as a completion option + * that appears when all required arguments are supplied, the argument + * selection closes `)` and the leaf field expands again `{ \n| }` + */ fillLeafsOnComplete?: boolean; - schema?: GraphQLSchema; uri?: string; mode?: GraphQLDocumentMode; }; +type InternalAutocompleteOptions = AutocompleteSuggestionOptions & { + schema?: GraphQLSchema; +}; + /** * Given GraphQLSchema, queryText, and context of the current position within * the source text, provide a list of typeahead entries. @@ -163,29 +140,31 @@ export function getAutocompleteSuggestions( const opts = { ...options, schema, - }; - const token: ContextToken = - contextToken || getTokenAtPosition(queryText, cursor, 1); - - const state = - token.state.kind === 'Invalid' ? token.state.prevState : token.state; - - const mode = options?.mode || getDocumentMode(queryText, options?.uri); + } as InternalAutocompleteOptions; - // relieve flow errors by checking if `state` exists - if (!state) { + const context = getContextAtPosition( + queryText, + cursor, + schema, + contextToken, + options, + ); + if (!context) { return []; } + const { state, typeInfo, mode, token } = context; const { kind, step, prevState } = state; - const typeInfo = getTypeInfo(schema, token.state); // Definition kinds if (kind === RuleKinds.DOCUMENT) { if (mode === GraphQLDocumentMode.TYPE_SYSTEM) { return getSuggestionsForTypeSystemDefinitions(token); } - return getSuggestionsForExecutableDefinitions(token); + if (mode === GraphQLDocumentMode.EXECUTABLE) { + return getSuggestionsForExecutableDefinitions(token); + } + return getSuggestionsForUnknownDocumentMode(token); } if (kind === RuleKinds.EXTEND_DEF) { @@ -311,9 +290,13 @@ export function getAutocompleteSuggestions( argDefs.map( (argDef: GraphQLArgument): CompletionItem => ({ label: argDef.name, - insertText: argDef.name + ': ', + insertText: getInputInsertText(argDef.name + ': ', argDef.type), + insertTextMode: InsertTextMode.adjustIndentation, + insertTextFormat: InsertTextFormat.Snippet, command: SuggestionCommand, - detail: String(argDef.type), + labelDetails: { + detail: ' ' + String(argDef.type), + }, documentation: argDef.description ?? undefined, kind: CompletionItemKind.Variable, type: argDef.type, @@ -339,9 +322,13 @@ export function getAutocompleteSuggestions( objectFields.map(field => ({ label: field.name, detail: String(field.type), - documentation: field.description ?? undefined, + documentation: field?.description ?? undefined, kind: completionKind, type: field.type, + insertText: getInputInsertText(field.name + ': ', field.type), + insertTextMode: InsertTextMode.adjustIndentation, + insertTextFormat: InsertTextFormat.Snippet, + command: SuggestionCommand, })), ); } @@ -355,7 +342,7 @@ export function getAutocompleteSuggestions( ) { return getSuggestionsForInputValues(token, typeInfo, queryText, schema); } - // complete for all variables available in the query + // complete for all variables available in the query scoped to this if (kind === RuleKinds.VARIABLE && step === 1) { const namedInputType = getNamedType(typeInfo.inputType!); const variableDefinitions = getVariableCompletions( @@ -399,34 +386,36 @@ export function getAutocompleteSuggestions( const unwrappedState = unwrapType(state); - if ( - (mode === GraphQLDocumentMode.TYPE_SYSTEM && - !unwrappedState.needsAdvance && - kind === RuleKinds.NAMED_TYPE) || - kind === RuleKinds.LIST_TYPE - ) { - if (unwrappedState.kind === RuleKinds.FIELD_DEF) { - return hintList( - token, - Object.values(schema.getTypeMap()) - .filter(type => isOutputType(type) && !type.name.startsWith('__')) - .map(type => ({ - label: type.name, - kind: CompletionItemKind.Function, - })), - ); - } - if (unwrappedState.kind === RuleKinds.INPUT_VALUE_DEF) { - return hintList( - token, - Object.values(schema.getTypeMap()) - .filter(type => isInputType(type) && !type.name.startsWith('__')) - .map(type => ({ - label: type.name, - kind: CompletionItemKind.Function, - })), - ); - } + if (unwrappedState.kind === RuleKinds.FIELD_DEF) { + return hintList( + token, + Object.values(schema.getTypeMap()) + .filter(type => isOutputType(type) && !type.name.startsWith('__')) + .map(type => ({ + label: type.name, + kind: CompletionItemKind.Function, + insertText: options?.fillLeafsOnComplete + ? type.name + '\n' + : type.name, + insertTextMode: InsertTextMode.adjustIndentation, + })), + ); + } + if (unwrappedState.kind === RuleKinds.INPUT_VALUE_DEF && step === 2) { + return hintList( + token, + Object.values(schema.getTypeMap()) + .filter(type => isInputType(type) && !type.name.startsWith('__')) + .map(type => ({ + label: type.name, + kind: CompletionItemKind.Function, + insertText: options?.fillLeafsOnComplete + ? type.name + '\n$1' + : type.name, + insertTextMode: InsertTextMode.adjustIndentation, + insertTextFormat: InsertTextFormat.Snippet, + })), + ); } // Variable definition types @@ -446,77 +435,62 @@ export function getAutocompleteSuggestions( if (kind === RuleKinds.DIRECTIVE) { return getSuggestionsForDirective(token, state, schema, kind); } + if (kind === RuleKinds.DIRECTIVE_DEF) { + return getSuggestionsForDirectiveArguments(token, state, schema, kind); + } return []; } -const insertSuffix = ' {\n $1\n}'; +const typeSystemCompletionItems = [ + { label: 'type', kind: CompletionItemKind.Function }, + { label: 'interface', kind: CompletionItemKind.Function }, + { label: 'union', kind: CompletionItemKind.Function }, + { label: 'input', kind: CompletionItemKind.Function }, + { label: 'scalar', kind: CompletionItemKind.Function }, + { label: 'schema', kind: CompletionItemKind.Function }, +]; -/** - * Choose carefully when to insert the `insertText`! - * @param field - * @returns - */ -const getInsertText = (field: GraphQLField) => { - const { type } = field; - if (isCompositeType(type)) { - return insertSuffix; - } - if (isListType(type) && isCompositeType(type.ofType)) { - return insertSuffix; - } - if (isNonNullType(type)) { - if (isCompositeType(type.ofType)) { - return insertSuffix; - } - if (isListType(type.ofType) && isCompositeType(type.ofType.ofType)) { - return insertSuffix; - } - } - return null; -}; +const executableCompletionItems = [ + { label: 'query', kind: CompletionItemKind.Function }, + { label: 'mutation', kind: CompletionItemKind.Function }, + { label: 'subscription', kind: CompletionItemKind.Function }, + { label: 'fragment', kind: CompletionItemKind.Function }, + { label: '{', kind: CompletionItemKind.Constructor }, +]; // Helper functions to get suggestions for each kinds function getSuggestionsForTypeSystemDefinitions(token: ContextToken) { return hintList(token, [ { label: 'extend', kind: CompletionItemKind.Function }, - { label: 'type', kind: CompletionItemKind.Function }, - { label: 'interface', kind: CompletionItemKind.Function }, - { label: 'union', kind: CompletionItemKind.Function }, - { label: 'input', kind: CompletionItemKind.Function }, - { label: 'scalar', kind: CompletionItemKind.Function }, - { label: 'schema', kind: CompletionItemKind.Function }, + ...typeSystemCompletionItems, ]); } function getSuggestionsForExecutableDefinitions(token: ContextToken) { + return hintList(token, executableCompletionItems); +} + +function getSuggestionsForUnknownDocumentMode(token: ContextToken) { return hintList(token, [ - { label: 'query', kind: CompletionItemKind.Function }, - { label: 'mutation', kind: CompletionItemKind.Function }, - { label: 'subscription', kind: CompletionItemKind.Function }, - { label: 'fragment', kind: CompletionItemKind.Function }, - { label: '{', kind: CompletionItemKind.Constructor }, + { label: 'extend', kind: CompletionItemKind.Function }, + ...executableCompletionItems, + ...typeSystemCompletionItems, ]); } function getSuggestionsForExtensionDefinitions(token: ContextToken) { - return hintList(token, [ - { label: 'type', kind: CompletionItemKind.Function }, - { label: 'interface', kind: CompletionItemKind.Function }, - { label: 'union', kind: CompletionItemKind.Function }, - { label: 'input', kind: CompletionItemKind.Function }, - { label: 'scalar', kind: CompletionItemKind.Function }, - { label: 'schema', kind: CompletionItemKind.Function }, - ]); + return hintList(token, typeSystemCompletionItems); } function getSuggestionsForFieldNames( token: ContextToken, typeInfo: AllTypeInfo, - options?: AutocompleteSuggestionOptions, + options?: InternalAutocompleteOptions, ): Array { if (typeInfo.parentType) { const { parentType } = typeInfo; + // const { parentType, fieldDef, argDefs } = typeInfo; let fields: GraphQLField[] = []; if ('getFields' in parentType) { fields = objectValues>( @@ -531,6 +505,7 @@ function getSuggestionsForFieldNames( if (parentType === options?.schema?.getQueryType()) { fields.push(SchemaMetaFieldDef, TypeMetaFieldDef); } + return hintList( token, fields.map((field, index) => { @@ -539,20 +514,39 @@ function getSuggestionsForFieldNames( sortText: String(index) + field.name, label: field.name, detail: String(field.type), + documentation: field.description ?? undefined, deprecated: Boolean(field.deprecationReason), isDeprecated: Boolean(field.deprecationReason), deprecationReason: field.deprecationReason, kind: CompletionItemKind.Field, + labelDetails: { + detail: ' ' + field.type.toString(), + }, + type: field.type, }; - if (options?.fillLeafsOnComplete) { - // TODO: fillLeafs capability - const insertText = getInsertText(field); - if (insertText) { - suggestion.insertText = field.name + insertText; + // const hasArgs = + // // token.state.needsAdvance && + // // @ts-expect-error + // parentType?._fields[field?.name]; + + suggestion.insertText = getFieldInsertText(field); + + // eslint-disable-next-line logical-assignment-operators + if (!suggestion.insertText) { + suggestion.insertText = getInsertText( + field.name, + field.type, + // if we are replacing a field with arguments, we don't want the extra line + field.name + (token.state.needsAdvance ? '' : '\n'), + ); + } + + if (suggestion.insertText) { suggestion.insertTextFormat = InsertTextFormat.Snippet; + suggestion.insertTextMode = InsertTextMode.adjustIndentation; suggestion.command = SuggestionCommand; } } @@ -576,7 +570,7 @@ function getSuggestionsForInputValues( queryText, schema, token, - ).filter(v => v.detail === namedInputType.name); + ).filter(v => v.detail === namedInputType?.name); if (namedInputType instanceof GraphQLEnumType) { const values = namedInputType.getValues(); @@ -769,7 +763,7 @@ function getSuggestionsForFragmentTypeConditions( const namedType = getNamedType(type); return { label: String(type), - documentation: namedType?.description || '', + documentation: (namedType?.description as string | undefined) || '', kind: CompletionItemKind.Field, }; }), @@ -821,6 +815,9 @@ function getSuggestionsForFragmentSpread( label: frag.name.value, detail: String(typeMap[frag.typeCondition.name.value]), documentation: `fragment ${frag.name.value} on ${frag.typeCondition.name.value}`, + labelDetails: { + detail: `fragment ${frag.name.value} on ${frag.typeCondition.name.value}`, + }, kind: CompletionItemKind.Field, type: typeMap[frag.typeCondition.name.value], })), @@ -851,6 +848,7 @@ export function getVariableCompletions( let variableName: null | string = null; let variableType: GraphQLInputObjectType | undefined | null; const definitions: Record = Object.create({}); + runOnlineParser(queryText, (_, state: State) => { // TODO: gather this as part of `AllTypeInfo`, as I don't think it's optimal to re-run the parser like this if (state?.kind === RuleKinds.VARIABLE && state.name) { @@ -866,12 +864,17 @@ export function getVariableCompletions( } if (variableName && variableType && !definitions[variableName]) { - // append `$` if the `token.string` is not already `$` - + // append `$` if the `token.string` is not already `$`, or describing a variable + // this appears to take care of it everywhere + const replaceString = + token.string === '$' || token?.state?.kind === 'Variable' + ? variableName + : '$' + variableName; definitions[variableName] = { detail: variableType.toString(), - insertText: token.string === '$' ? variableName : '$' + variableName, - label: variableName, // keep label the same for `codemirror-graphql` + insertText: replaceString, + label: '$' + variableName, + rawInsert: replaceString, type: variableType, kind: CompletionItemKind.Variable, } as CompletionItem; @@ -932,7 +935,7 @@ function getSuggestionsForVariableDefinition( // TODO: couldn't get Exclude<> working here inputTypes.map((type: GraphQLNamedType) => ({ label: type.name, - documentation: type.description!, + documentation: type?.description || '', kind: CompletionItemKind.Variable, })), ); @@ -952,7 +955,7 @@ function getSuggestionsForDirective( token, directives.map(directive => ({ label: directive.name, - documentation: directive.description || '', + documentation: directive?.description || '', kind: CompletionItemKind.Function, })), ); @@ -960,89 +963,23 @@ function getSuggestionsForDirective( return []; } -export function getTokenAtPosition( - queryText: string, - cursor: IPosition, - offset = 0, -): ContextToken { - let styleAtCursor = null; - let stateAtCursor = null; - let stringAtCursor = null; - const token = runOnlineParser(queryText, (stream, state, style, index) => { - if ( - index !== cursor.line || - stream.getCurrentPosition() + offset < cursor.character + 1 - ) { - return; - } - styleAtCursor = style; - stateAtCursor = { ...state }; - stringAtCursor = stream.current(); - return 'BREAK'; - }); - - // Return the state/style of parsed token in case those at cursor aren't - // available. - return { - start: token.start, - end: token.end, - string: stringAtCursor || token.string, - state: stateAtCursor || token.state, - style: styleAtCursor || token.style, - }; -} - -/** - * Provides an utility function to parse a given query text and construct a - * `token` context object. - * A token context provides useful information about the token/style that - * CharacterStream currently possesses, as well as the end state and style - * of the token. - */ -type callbackFnType = ( - stream: CharacterStream, +// I thought this added functionality somewhere, but I couldn't write any tests +// to execute it. I think it's handled as Arguments +function getSuggestionsForDirectiveArguments( + token: ContextToken, state: State, - style: string, - index: number, -) => void | 'BREAK'; - -export function runOnlineParser( - queryText: string, - callback: callbackFnType, -): ContextToken { - const lines = queryText.split('\n'); - const parser = onlineParser(); - let state = parser.startState(); - let style = ''; - - let stream: CharacterStream = new CharacterStream(''); - - for (let i = 0; i < lines.length; i++) { - stream = new CharacterStream(lines[i]); - while (!stream.eol()) { - style = parser.token(stream, state); - const code = callback(stream, state, style, i); - if (code === 'BREAK') { - break; - } - } - - // Above while loop won't run if there is an empty line. - // Run the callback one more time to catch this. - callback(stream, state, style, i); - - if (!state.kind) { - state = parser.startState(); - } - } - - return { - start: stream.getStartOfToken(), - end: stream.getCurrentPosition(), - string: stream.current(), - state, - style, - }; + schema: GraphQLSchema, + _kind: string, +): Array { + const directive = schema.getDirectives().find(d => d.name === state.name); + return hintList( + token, + directive?.args.map(arg => ({ + label: arg.name, + documentation: arg.description || '', + kind: CompletionItemKind.Field, + })) || [], + ); } export function canUseDirective( @@ -1103,204 +1040,6 @@ export function canUseDirective( return false; } -// Utility for collecting rich type information given any token's state -// from the graphql-mode parser. -export function getTypeInfo( - schema: GraphQLSchema, - tokenState: State, -): AllTypeInfo { - let argDef: AllTypeInfo['argDef']; - let argDefs: AllTypeInfo['argDefs']; - let directiveDef: AllTypeInfo['directiveDef']; - let enumValue: AllTypeInfo['enumValue']; - let fieldDef: AllTypeInfo['fieldDef']; - let inputType: AllTypeInfo['inputType']; - let objectTypeDef: AllTypeInfo['objectTypeDef']; - let objectFieldDefs: AllTypeInfo['objectFieldDefs']; - let parentType: AllTypeInfo['parentType']; - let type: AllTypeInfo['type']; - let interfaceDef: AllTypeInfo['interfaceDef']; - forEachState(tokenState, state => { - switch (state.kind) { - case RuleKinds.QUERY: - case 'ShortQuery': - type = schema.getQueryType(); - break; - case RuleKinds.MUTATION: - type = schema.getMutationType(); - break; - case RuleKinds.SUBSCRIPTION: - type = schema.getSubscriptionType(); - break; - case RuleKinds.INLINE_FRAGMENT: - case RuleKinds.FRAGMENT_DEFINITION: - if (state.type) { - type = schema.getType(state.type); - } - break; - case RuleKinds.FIELD: - case RuleKinds.ALIASED_FIELD: { - if (!type || !state.name) { - fieldDef = null; - } else { - fieldDef = parentType - ? getFieldDef(schema, parentType, state.name) - : null; - type = fieldDef ? fieldDef.type : null; - } - break; - } - case RuleKinds.SELECTION_SET: - parentType = getNamedType(type!); - break; - case RuleKinds.DIRECTIVE: - directiveDef = state.name ? schema.getDirective(state.name) : null; - break; - - case RuleKinds.INTERFACE_DEF: - if (state.name) { - objectTypeDef = null; - interfaceDef = new GraphQLInterfaceType({ - name: state.name, - interfaces: [], - fields: {}, - }); - } - - break; - - case RuleKinds.OBJECT_TYPE_DEF: - if (state.name) { - interfaceDef = null; - objectTypeDef = new GraphQLObjectType({ - name: state.name, - interfaces: [], - fields: {}, - }); - } - - break; - case RuleKinds.ARGUMENTS: { - if (state.prevState) { - switch (state.prevState.kind) { - case RuleKinds.FIELD: - argDefs = fieldDef && (fieldDef.args as GraphQLArgument[]); - break; - case RuleKinds.DIRECTIVE: - argDefs = - directiveDef && (directiveDef.args as GraphQLArgument[]); - break; - // TODO: needs more tests - case RuleKinds.ALIASED_FIELD: { - const name = state.prevState?.name; - if (!name) { - argDefs = null; - break; - } - const field = parentType - ? getFieldDef(schema, parentType, name) - : null; - if (!field) { - argDefs = null; - break; - } - argDefs = field.args as GraphQLArgument[]; - break; - } - default: - argDefs = null; - break; - } - } else { - argDefs = null; - } - break; - } - case RuleKinds.ARGUMENT: - if (argDefs) { - for (let i = 0; i < argDefs.length; i++) { - if (argDefs[i].name === state.name) { - argDef = argDefs[i]; - break; - } - } - } - inputType = argDef?.type; - break; - // TODO: needs tests - case RuleKinds.ENUM_VALUE: - const enumType = getNamedType(inputType!); - enumValue = - enumType instanceof GraphQLEnumType - ? enumType - .getValues() - .find((val: GraphQLEnumValue) => val.value === state.name) - : null; - break; - // TODO: needs tests - case RuleKinds.LIST_VALUE: - const nullableType = getNullableType(inputType!); - inputType = - nullableType instanceof GraphQLList ? nullableType.ofType : null; - break; - case RuleKinds.OBJECT_VALUE: - const objectType = getNamedType(inputType!); - objectFieldDefs = - objectType instanceof GraphQLInputObjectType - ? objectType.getFields() - : null; - break; - // TODO: needs tests - case RuleKinds.OBJECT_FIELD: - const objectField = - state.name && objectFieldDefs ? objectFieldDefs[state.name] : null; - inputType = objectField?.type; - - break; - case RuleKinds.NAMED_TYPE: - if (state.name) { - type = schema.getType(state.name); - } - // TODO: collect already extended interfaces of the type/interface we're extending - // here to eliminate them from the completion list - // because "type A extends B & C &" should not show completion options for B & C still. - - break; - } - }); - - return { - argDef, - argDefs, - directiveDef, - enumValue, - fieldDef, - inputType, - objectFieldDefs, - parentType, - type, - interfaceDef, - objectTypeDef, - }; -} - -export enum GraphQLDocumentMode { - TYPE_SYSTEM = 'TYPE_SYSTEM', - EXECUTABLE = 'EXECUTABLE', -} - -function getDocumentMode( - documentText: string, - uri?: string, -): GraphQLDocumentMode { - if (uri?.endsWith('.graphqls')) { - return GraphQLDocumentMode.TYPE_SYSTEM; - } - return hasTypeSystemDefinitions(documentText) - ? GraphQLDocumentMode.TYPE_SYSTEM - : GraphQLDocumentMode.EXECUTABLE; -} - function unwrapType(state: State): State { if ( state.prevState && diff --git a/packages/graphql-language-service/src/interface/getDefinition.ts b/packages/graphql-language-service/src/interface/getDefinition.ts index 952ca33db47..6b50d429d34 100644 --- a/packages/graphql-language-service/src/interface/getDefinition.ts +++ b/packages/graphql-language-service/src/interface/getDefinition.ts @@ -16,15 +16,27 @@ import { TypeDefinitionNode, ObjectTypeDefinitionNode, FieldDefinitionNode, + // printType, + // isNamedType, + // ArgumentNode, + InputValueDefinitionNode, + GraphQLType, } from 'graphql'; import { Definition, FragmentInfo, Uri, ObjectTypeInfo } from '../types'; import { locToRange, offsetToPosition, Range, Position } from '../utils'; +// import { getTypeInfo } from './getAutocompleteSuggestions'; export type DefinitionQueryResult = { queryRange: Range[]; definitions: Definition[]; + printedName?: string; +}; + +export type DefinitionQueryResponse = DefinitionQueryResult & { + node?: ASTNode | null; + type?: GraphQLType | null; }; export const LANGUAGE = 'GraphQL'; @@ -68,6 +80,7 @@ export async function getDefinitionQueryResultForNamedType( return { definitions, queryRange: definitions.map(_ => getRange(text, node)), + printedName: name, }; } @@ -104,6 +117,43 @@ export async function getDefinitionQueryResultForField( definitions, // TODO: seems like it's not using queryRange: [], + printedName: [typeName, fieldName].join('.'), + }; +} + +export async function getDefinitionQueryResultForArgument( + argumentName: string, + fieldName: string, + typeName: string, + dependencies: Array, +): Promise { + dependencies.filter( + ({ definition }) => definition.name && definition.name.value === typeName, + ); + + const definitions: Array = []; + + for (const { filePath, content, definition } of dependencies) { + const argDefinition = (definition as ObjectTypeDefinitionNode).fields + ?.find(item => item.name.value === fieldName) + ?.arguments?.find(item => item.name.value === argumentName); + if (argDefinition == null) { + continue; + } + + definitions.push( + getDefinitionForArgumentDefinition( + filePath || '', + content, + argDefinition, + ), + ); + } + return { + definitions, + // TODO: seems like it's not using + queryRange: [], + printedName: `${[typeName, fieldName].join('.')}(${argumentName})`, }; } @@ -124,10 +174,10 @@ export async function getDefinitionQueryResultForFragmentSpread( ({ filePath, content, definition }) => getDefinitionForFragmentDefinition(filePath || '', content, definition), ); - return { definitions, queryRange: definitions.map(_ => getRange(text, fragment)), + printedName: name, }; } @@ -139,6 +189,7 @@ export function getDefinitionQueryResultForDefinitionNode( return { definitions: [getDefinitionForFragmentDefinition(path, text, definition)], queryRange: definition.name ? [getRange(text, definition.name)] : [], + printedName: definition.name?.value, }; } @@ -201,3 +252,23 @@ function getDefinitionForFieldDefinition( projectRoot: path, }; } +// GraphQLString, +// eslint-disable-next-line sonarjs/no-identical-functions +function getDefinitionForArgumentDefinition( + path: Uri, + text: string, + definition: InputValueDefinitionNode, +): Definition { + const { name } = definition; + assert(name, 'Expected ASTNode to have a Name.'); + return { + path, + position: getPosition(text, definition), + range: getRange(text, definition), + name: name.value || '', + language: LANGUAGE, + // This is a file inside the project root, good enough for now + projectRoot: path, + }; +} +// GraphQLString, diff --git a/packages/graphql-language-service/src/interface/getHoverInformation.ts b/packages/graphql-language-service/src/interface/getHoverInformation.ts index 3b971231e99..1961f6ca0c5 100644 --- a/packages/graphql-language-service/src/interface/getHoverInformation.ts +++ b/packages/graphql-language-service/src/interface/getHoverInformation.ts @@ -20,11 +20,11 @@ import { GraphQLField, GraphQLFieldConfig, } from 'graphql'; -import { ContextToken } from '../parser'; +import type { ContextToken } from '../parser'; import { AllTypeInfo, IPosition } from '../types'; import { Hover } from 'vscode-languageserver-types'; -import { getTokenAtPosition, getTypeInfo } from './getAutocompleteSuggestions'; +import { getContextAtPosition } from '../parser'; export type HoverConfig = { useMarkdown?: boolean }; @@ -35,22 +35,21 @@ export function getHoverInformation( contextToken?: ContextToken, config?: HoverConfig, ): Hover['contents'] { - const token = contextToken || getTokenAtPosition(queryText, cursor); - - if (!schema || !token || !token.state) { + const options = { ...config, schema }; + const context = getContextAtPosition(queryText, cursor, schema, contextToken); + if (!context) { return ''; } - + const { typeInfo, token } = context; const { kind, step } = token.state; - const typeInfo = getTypeInfo(schema, token.state); - const options = { ...config, schema }; // Given a Schema and a Token, produce the contents of an info tooltip. // To do this, create a div element that we will render "into" and then pass // it to various rendering functions. if ( (kind === 'Field' && step === 0 && typeInfo.fieldDef) || - (kind === 'AliasedField' && step === 2 && typeInfo.fieldDef) + (kind === 'AliasedField' && step === 2 && typeInfo.fieldDef) || + (kind === 'ObjectField' && step === 0 && typeInfo.fieldDef) ) { const into: string[] = []; renderMdCodeStart(into, options); @@ -67,6 +66,14 @@ export function getHoverInformation( renderDescription(into, options, typeInfo.directiveDef); return into.join('').trim(); } + if (kind === 'Variable' && typeInfo.type) { + const into: string[] = []; + renderMdCodeStart(into, options); + renderType(into, typeInfo, options, typeInfo.type); + renderMdCodeEnd(into, options); + renderDescription(into, options, typeInfo.type); + return into.join('').trim(); + } if (kind === 'Argument' && step === 0 && typeInfo.argDef) { const into: string[] = []; renderMdCodeStart(into, options); @@ -109,7 +116,11 @@ function renderMdCodeEnd(into: string[], options: any) { } } -function renderField(into: string[], typeInfo: AllTypeInfo, options: any) { +export function renderField( + into: string[], + typeInfo: AllTypeInfo, + options: any, +) { renderQualifiedField(into, typeInfo, options); renderTypeAnnotation(into, typeInfo, options, typeInfo.type!); } @@ -130,7 +141,11 @@ function renderQualifiedField( text(into, fieldName); } -function renderDirective(into: string[], typeInfo: AllTypeInfo, _options: any) { +export function renderDirective( + into: string[], + typeInfo: AllTypeInfo, + _options: any, +) { if (!typeInfo.directiveDef) { return; } @@ -138,7 +153,7 @@ function renderDirective(into: string[], typeInfo: AllTypeInfo, _options: any) { text(into, name); } -function renderArg(into: string[], typeInfo: AllTypeInfo, options: any) { +export function renderArg(into: string[], typeInfo: AllTypeInfo, options: any) { if (typeInfo.directiveDef) { renderDirective(into, typeInfo, options); } else if (typeInfo.fieldDef) { @@ -166,7 +181,11 @@ function renderTypeAnnotation( renderType(into, typeInfo, options, t); } -function renderEnumValue(into: string[], typeInfo: AllTypeInfo, options: any) { +export function renderEnumValue( + into: string[], + typeInfo: AllTypeInfo, + options: any, +) { if (!typeInfo.enumValue) { return; } @@ -176,7 +195,7 @@ function renderEnumValue(into: string[], typeInfo: AllTypeInfo, options: any) { text(into, name); } -function renderType( +export function renderType( into: string[], typeInfo: AllTypeInfo, options: any, diff --git a/packages/graphql-language-service/src/parser/api.ts b/packages/graphql-language-service/src/parser/api.ts new file mode 100644 index 00000000000..f5fd4bf0675 --- /dev/null +++ b/packages/graphql-language-service/src/parser/api.ts @@ -0,0 +1,207 @@ +/** + * Copyright (c) 2021 GraphQL Contributors + * All rights reserved. + * + * This source code is licensed under the license found in the + * LICENSE file in the root directory of this source tree. + * + */ + +import { IPosition } from '..'; +import { + CharacterStream, + onlineParser, + ContextToken, + State, + getTypeInfo, +} from '.'; +import { BREAK, GraphQLSchema, Kind, parse, visit } from 'graphql'; + +export type ParserCallbackFn = ( + stream: CharacterStream, + state: State, + style: string, + index: number, +) => void | 'BREAK'; + +/** + * Provides an utility function to parse a given query text and construct a + * `token` context object. + * A token context provides useful information about the token/style that + * CharacterStream currently possesses, as well as the end state and style + * of the token. + */ +export function runOnlineParser( + queryText: string, + callback: ParserCallbackFn, +): ContextToken { + const lines = queryText.split('\n'); + const parser = onlineParser(); + let state = parser.startState(); + let style = ''; + + let stream: CharacterStream = new CharacterStream(''); + + for (let i = 0; i < lines.length; i++) { + stream = new CharacterStream(lines[i]); + while (!stream.eol()) { + style = parser.token(stream, state); + const code = callback(stream, state, style, i); + if (code === 'BREAK') { + break; + } + } + + // Above while loop won't run if there is an empty line. + // Run the callback one more time to catch this. + callback(stream, state, style, i); + + if (!state.kind) { + state = parser.startState(); + } + } + + return { + start: stream.getStartOfToken(), + end: stream.getCurrentPosition(), + string: stream.current(), + state, + style, + }; +} + +export enum GraphQLDocumentMode { + TYPE_SYSTEM = 'TYPE_SYSTEM', + EXECUTABLE = 'EXECUTABLE', + UNKNOWN = 'UNKNOWN', +} + +export const TYPE_SYSTEM_KINDS: Kind[] = [ + // TypeSystemDefinition + Kind.SCHEMA_DEFINITION, + Kind.OPERATION_TYPE_DEFINITION, + Kind.SCALAR_TYPE_DEFINITION, + Kind.OBJECT_TYPE_DEFINITION, + Kind.INTERFACE_TYPE_DEFINITION, + Kind.UNION_TYPE_DEFINITION, + Kind.ENUM_TYPE_DEFINITION, + Kind.INPUT_OBJECT_TYPE_DEFINITION, + Kind.DIRECTIVE_DEFINITION, + // TypeSystemExtension + Kind.SCHEMA_EXTENSION, + Kind.SCALAR_TYPE_EXTENSION, + Kind.OBJECT_TYPE_EXTENSION, + Kind.INTERFACE_TYPE_EXTENSION, + Kind.UNION_TYPE_EXTENSION, + Kind.ENUM_TYPE_EXTENSION, + Kind.INPUT_OBJECT_TYPE_EXTENSION, +]; + +const getParsedMode = (sdl: string | undefined): GraphQLDocumentMode => { + let mode = GraphQLDocumentMode.UNKNOWN; + if (sdl) { + try { + visit(parse(sdl), { + enter(node) { + if (node.kind === 'Document') { + mode = GraphQLDocumentMode.EXECUTABLE; + return; + } + if (TYPE_SYSTEM_KINDS.includes(node.kind)) { + mode = GraphQLDocumentMode.TYPE_SYSTEM; + return BREAK; + } + return false; + }, + }); + } catch { + return mode; + } + } + return mode; +}; + +export function getDocumentMode( + documentText: string, + uri?: string, +): GraphQLDocumentMode { + if (uri?.endsWith('.graphqls')) { + return GraphQLDocumentMode.TYPE_SYSTEM; + } + return getParsedMode(documentText); +} + +/** + * Given a query text and a cursor position, return the context token + */ +export function getTokenAtPosition( + queryText: string, + cursor: IPosition, + offset = 0, +): ContextToken { + let styleAtCursor = null; + let stateAtCursor = null; + let stringAtCursor = null; + const token = runOnlineParser(queryText, (stream, state, style, index) => { + if ( + index !== cursor.line || + stream.getCurrentPosition() + offset < cursor.character + 1 + ) { + return; + } + styleAtCursor = style; + stateAtCursor = { ...state }; + stringAtCursor = stream.current(); + return 'BREAK'; + }); + + // Return the state/style of parsed token in case those at cursor aren't + // available. + return { + start: token.start, + end: token.end, + string: stringAtCursor || token.string, + state: stateAtCursor || token.state, + style: styleAtCursor || token.style, + }; +} + +/** + * Returns the token, state, typeInfo and mode at the cursor position + * Used by getAutocompleteSuggestions + */ +export function getContextAtPosition( + queryText: string, + cursor: IPosition, + schema: GraphQLSchema, + contextToken?: ContextToken, + options?: { mode?: GraphQLDocumentMode; uri?: string }, +): { + token: ContextToken; + state: State; + typeInfo: ReturnType; + mode: GraphQLDocumentMode; +} | null { + const token: ContextToken = + contextToken || getTokenAtPosition(queryText, cursor, 1); + if (!token) { + return null; + } + + const state = + token.state.kind === 'Invalid' ? token.state.prevState : token.state; + if (!state) { + return null; + } + + // relieve flow errors by checking if `state` exists + + const typeInfo = getTypeInfo(schema, token.state); + const mode = options?.mode || getDocumentMode(queryText, options?.uri); + return { + token, + state, + typeInfo, + mode, + }; +} diff --git a/packages/graphql-language-service/src/parser/getTypeInfo.ts b/packages/graphql-language-service/src/parser/getTypeInfo.ts new file mode 100644 index 00000000000..f0f8d1ae8d7 --- /dev/null +++ b/packages/graphql-language-service/src/parser/getTypeInfo.ts @@ -0,0 +1,279 @@ +/** + * Copyright (c) 2021 GraphQL Contributors + * All rights reserved. + * + * This source code is licensed under the license found in the + * LICENSE file in the root directory of this source tree. + * + */ + +import { + GraphQLSchema, + GraphQLEnumValue, + GraphQLField, + GraphQLInterfaceType, + GraphQLObjectType, + GraphQLArgument, + GraphQLEnumType, + GraphQLInputObjectType, + GraphQLList, + getNamedType, + getNullableType, + SchemaMetaFieldDef, + GraphQLType, + TypeMetaFieldDef, + TypeNameMetaFieldDef, + isCompositeType, +} from 'graphql'; + +import { AllTypeInfo } from '../types'; + +import { State, RuleKinds } from '.'; + +// Gets the field definition given a type and field name +export function getFieldDef( + schema: GraphQLSchema, + type: GraphQLType, + fieldName: string, +): GraphQLField | null | undefined { + if (fieldName === SchemaMetaFieldDef.name && schema.getQueryType() === type) { + return SchemaMetaFieldDef; + } + if (fieldName === TypeMetaFieldDef.name && schema.getQueryType() === type) { + return TypeMetaFieldDef; + } + if (fieldName === TypeNameMetaFieldDef.name && isCompositeType(type)) { + return TypeNameMetaFieldDef; + } + if ('getFields' in type) { + return type.getFields()[fieldName] as any; + } + + return null; +} + +// Utility for iterating through a CodeMirror parse state stack bottom-up. +export function forEachState( + stack: State, + fn: (state: State) => AllTypeInfo | null | void, +): void { + const reverseStateStack = []; + let state: State | null | undefined = stack; + while (state?.kind) { + reverseStateStack.push(state); + state = state.prevState; + } + for (let i = reverseStateStack.length - 1; i >= 0; i--) { + fn(reverseStateStack[i]); + } +} + +// Utility for returning the state representing the Definition this token state +// is within, if any. +export function getDefinitionState( + tokenState: State, +): State | null | undefined { + let definitionState; + + // TODO - couldn't figure this one out + forEachState(tokenState, (state: State): void => { + switch (state.kind) { + case 'Query': + case 'ShortQuery': + case 'Mutation': + case 'Subscription': + case 'FragmentDefinition': + definitionState = state; + break; + } + }); + + return definitionState; +} + +// Utility for collecting rich type information given any token's state +// from the graphql-mode parser. +export function getTypeInfo( + schema: GraphQLSchema, + tokenState: State, +): AllTypeInfo { + let argDef: AllTypeInfo['argDef']; + let argDefs: AllTypeInfo['argDefs']; + let directiveDef: AllTypeInfo['directiveDef']; + let enumValue: AllTypeInfo['enumValue']; + let fieldDef: AllTypeInfo['fieldDef']; + let inputType: AllTypeInfo['inputType']; + let objectTypeDef: AllTypeInfo['objectTypeDef']; + let objectFieldDefs: AllTypeInfo['objectFieldDefs']; + let parentType: AllTypeInfo['parentType']; + let type: AllTypeInfo['type']; + let interfaceDef: AllTypeInfo['interfaceDef']; + forEachState(tokenState, state => { + switch (state.kind) { + case RuleKinds.QUERY: + case 'ShortQuery': + type = schema.getQueryType(); + break; + case RuleKinds.MUTATION: + type = schema.getMutationType(); + break; + case RuleKinds.SUBSCRIPTION: + type = schema.getSubscriptionType(); + break; + case RuleKinds.INLINE_FRAGMENT: + case RuleKinds.FRAGMENT_DEFINITION: + if (state.type) { + type = schema.getType(state.type); + } + break; + case RuleKinds.FIELD: + case RuleKinds.ALIASED_FIELD: { + if (!type || !state.name) { + fieldDef = null; + } else { + fieldDef = parentType + ? getFieldDef(schema, parentType, state.name) + : null; + type = fieldDef ? fieldDef.type : null; + } + break; + } + case RuleKinds.SELECTION_SET: + parentType = getNamedType(type!); + break; + case RuleKinds.DIRECTIVE: + directiveDef = state.name ? schema.getDirective(state.name) : null; + break; + + case RuleKinds.INTERFACE_DEF: + if (state.name) { + objectTypeDef = null; + interfaceDef = new GraphQLInterfaceType({ + name: state.name, + interfaces: [], + fields: {}, + }); + } + + break; + + case RuleKinds.OBJECT_TYPE_DEF: + if (state.name) { + interfaceDef = null; + objectTypeDef = new GraphQLObjectType({ + name: state.name, + interfaces: [], + fields: {}, + }); + } + + break; + case RuleKinds.ARGUMENTS: { + if (state.prevState) { + switch (state.prevState.kind) { + case RuleKinds.FIELD: + argDefs = fieldDef && (fieldDef.args as GraphQLArgument[]); + break; + case RuleKinds.DIRECTIVE: + argDefs = + directiveDef && (directiveDef.args as GraphQLArgument[]); + break; + // TODO: needs more tests + case RuleKinds.ALIASED_FIELD: { + const name = state.prevState?.name; + if (!name) { + argDefs = null; + break; + } + const field = parentType + ? getFieldDef(schema, parentType, name) + : null; + if (!field) { + argDefs = null; + break; + } + argDefs = field.args as GraphQLArgument[]; + break; + } + default: + argDefs = null; + break; + } + } else { + argDefs = null; + } + break; + } + case RuleKinds.ARGUMENT: + if (argDefs) { + for (let i = 0; i < argDefs.length; i++) { + if (argDefs[i].name === state.name) { + argDef = argDefs[i]; + break; + } + } + } + inputType = argDef?.type; + break; + case RuleKinds.VARIABLE_DEFINITION: + case RuleKinds.VARIABLE: + type = inputType; + break; + // TODO: needs tests + case RuleKinds.ENUM_VALUE: + const enumType = getNamedType(inputType!); + enumValue = + enumType instanceof GraphQLEnumType + ? enumType + .getValues() + .find((val: GraphQLEnumValue) => val.value === state.name) + : null; + break; + // TODO: needs tests + case RuleKinds.LIST_VALUE: + const nullableType = getNullableType(inputType!); + inputType = + nullableType instanceof GraphQLList ? nullableType.ofType : null; + break; + case RuleKinds.OBJECT_VALUE: + const objectType = getNamedType(inputType!); + objectFieldDefs = + objectType instanceof GraphQLInputObjectType + ? objectType.getFields() + : null; + break; + // TODO: needs tests + case RuleKinds.OBJECT_FIELD: + const objectField = + state.name && objectFieldDefs ? objectFieldDefs[state.name] : null; + inputType = objectField?.type; + // @ts-expect-error + fieldDef = objectField as GraphQLField; + type = fieldDef ? fieldDef.type : null; + break; + case RuleKinds.NAMED_TYPE: + if (state.name) { + type = schema.getType(state.name); + } + // TODO: collect already extended interfaces of the type/interface we're extending + // here to eliminate them from the completion list + // because "type A extends B & C &" should not show completion options for B & C still. + + break; + } + }); + + return { + argDef, + argDefs, + directiveDef, + enumValue, + fieldDef, + inputType, + objectFieldDefs, + parentType, + type, + interfaceDef, + objectTypeDef, + }; +} diff --git a/packages/graphql-language-service/src/parser/index.ts b/packages/graphql-language-service/src/parser/index.ts index 913d7fb31b1..cb1352ae0c1 100644 --- a/packages/graphql-language-service/src/parser/index.ts +++ b/packages/graphql-language-service/src/parser/index.ts @@ -15,4 +15,15 @@ export { butNot, list, opt, p, t } from './RuleHelpers'; export { default as onlineParser, ParserOptions } from './onlineParser'; +export { + runOnlineParser, + type ParserCallbackFn, + getTokenAtPosition, + getContextAtPosition, + GraphQLDocumentMode, + getDocumentMode, +} from './api'; + +export { getTypeInfo, getDefinitionState, getFieldDef } from './getTypeInfo'; + export * from './types'; diff --git a/packages/graphql-language-service/src/parser/types.ts b/packages/graphql-language-service/src/parser/types.ts index 31010e39561..9d80ad795c3 100644 --- a/packages/graphql-language-service/src/parser/types.ts +++ b/packages/graphql-language-service/src/parser/types.ts @@ -84,6 +84,7 @@ export const AdditionalRuleKinds: _AdditionalRuleKinds = { IMPLEMENTS: 'Implements', VARIABLE_DEFINITIONS: 'VariableDefinitions', TYPE: 'Type', + VARIABLE: 'Variable', }; export type _AdditionalRuleKinds = { @@ -115,6 +116,7 @@ export type _AdditionalRuleKinds = { IMPLEMENTS: 'Implements'; VARIABLE_DEFINITIONS: 'VariableDefinitions'; TYPE: 'Type'; + VARIABLE: 'Variable'; }; export const RuleKinds = { @@ -122,7 +124,8 @@ export const RuleKinds = { ...AdditionalRuleKinds, }; -export type _RuleKinds = typeof Kind & typeof AdditionalRuleKinds; +export type _RuleKinds = Omit & + typeof AdditionalRuleKinds; export type RuleKind = _RuleKinds[keyof _RuleKinds]; export type RuleKindEnum = RuleKind; diff --git a/packages/graphql-language-service/src/types.ts b/packages/graphql-language-service/src/types.ts index 6e4d8c47626..6f014e87215 100644 --- a/packages/graphql-language-service/src/types.ts +++ b/packages/graphql-language-service/src/types.ts @@ -39,6 +39,8 @@ import type { GraphQLExtensionDeclaration, } from 'graphql-config'; +export { GraphQLDocumentMode } from './parser'; + export type { GraphQLConfig, GraphQLProjectConfig, @@ -50,11 +52,6 @@ export interface GraphQLCache { getProjectForFile: (uri: string) => GraphQLProjectConfig | void; - getObjectTypeDependencies: ( - query: string, - fragmentDefinitions: Map, - ) => Promise; - getObjectTypeDependenciesForAST: ( parsedQuery: ASTNode, fragmentDefinitions: Map, @@ -70,12 +67,6 @@ export interface GraphQLCache { contents: CachedContent[], ) => Promise; - updateObjectTypeDefinitionCache: ( - rootDir: Uri, - filePath: Uri, - exists: boolean, - ) => Promise; - getFragmentDependencies: ( query: string, fragmentDefinitions: Maybe>, @@ -95,15 +86,8 @@ export interface GraphQLCache { filePath: Uri, contents: CachedContent[], ) => Promise; - - updateFragmentDefinitionCache: ( - rootDir: Uri, - filePath: Uri, - exists: boolean, - ) => Promise; - getSchema: ( - appName?: string, + appName: string, queryHasExtensions?: boolean, ) => Promise; } @@ -192,6 +176,8 @@ export type CompletionItem = CompletionItemType & { deprecationReason?: string | null; type?: GraphQLType; command?: CompletionItemType['command']; + // if label differs from what should be inserted + rawInsert?: string; }; // Below are basically a copy-paste from Nuclide rpc types for definitions. @@ -204,6 +190,7 @@ export type Definition = { name?: string; language?: string; projectRoot?: Uri; + locator?: string; }; // Outline view diff --git a/packages/graphql-language-service/src/utils/validateWithCustomRules.ts b/packages/graphql-language-service/src/utils/validateWithCustomRules.ts index 4f4f2ecac69..00e39a2396a 100644 --- a/packages/graphql-language-service/src/utils/validateWithCustomRules.ts +++ b/packages/graphql-language-service/src/utils/validateWithCustomRules.ts @@ -32,7 +32,9 @@ import { // KnownArgumentNamesOnDirectivesRule, UniqueArgumentNamesRule, UniqueInputFieldNamesRule, - // ProvidedRequiredArgumentsOnDirectivesRule, + UniqueVariableNamesRule, + FragmentsOnCompositeTypesRule, + ProvidedRequiredArgumentsRule, } from 'graphql'; const specifiedSDLRules = [ @@ -49,7 +51,9 @@ const specifiedSDLRules = [ // KnownArgumentNamesOnDirectivesRule, UniqueArgumentNamesRule, UniqueInputFieldNamesRule, - // ProvidedRequiredArgumentsOnDirectivesRule, + UniqueVariableNamesRule, + FragmentsOnCompositeTypesRule, + ProvidedRequiredArgumentsRule, ]; /** diff --git a/packages/monaco-graphql/src/LanguageService.ts b/packages/monaco-graphql/src/LanguageService.ts index 259c699e853..1fff9fd6a91 100644 --- a/packages/monaco-graphql/src/LanguageService.ts +++ b/packages/monaco-graphql/src/LanguageService.ts @@ -15,7 +15,10 @@ import { Source, } from 'graphql'; import picomatch from 'picomatch-browser'; -import type { IPosition } from 'graphql-language-service'; +import type { + AutocompleteSuggestionOptions, + IPosition, +} from 'graphql-language-service'; import { getAutocompleteSuggestions, getDiagnostics, @@ -46,7 +49,7 @@ export class LanguageService { private _externalFragmentDefinitionNodes: FragmentDefinitionNode[] | null = null; private _externalFragmentDefinitionsString: string | null = null; - private _fillLeafsOnComplete?: boolean = false; + private _completionSettings: AutocompleteSuggestionOptions; constructor({ parser, schemas, @@ -54,6 +57,7 @@ export class LanguageService { externalFragmentDefinitions, customValidationRules, fillLeafsOnComplete, + completionSettings, }: GraphQLLanguageConfig) { this._schemaLoader = defaultSchemaLoader; if (schemas) { @@ -63,7 +67,11 @@ export class LanguageService { if (parser) { this._parser = parser; } - this._fillLeafsOnComplete = fillLeafsOnComplete; + this._completionSettings = { + ...completionSettings, + fillLeafsOnComplete: + completionSettings?.fillLeafsOnComplete ?? fillLeafsOnComplete, + }; if (parseOptions) { this._parseOptions = parseOptions; @@ -214,7 +222,7 @@ export class LanguageService { position, undefined, this.getExternalFragmentDefinitions(), - { uri, fillLeafsOnComplete: this._fillLeafsOnComplete }, + { uri, ...this._completionSettings }, ); }; /** diff --git a/packages/monaco-graphql/src/api.ts b/packages/monaco-graphql/src/api.ts index 9dcd2631c51..444950288a5 100644 --- a/packages/monaco-graphql/src/api.ts +++ b/packages/monaco-graphql/src/api.ts @@ -90,7 +90,12 @@ export class MonacoGraphQLAPI { return this._diagnosticSettings; } public get completionSettings(): CompletionSettings { - return this._completionSettings; + return { + ...this._completionSettings, + fillLeafsOnComplete: + this._completionSettings?.__experimental__fillLeafsOnComplete ?? + this._completionSettings?.fillLeafsOnComplete, + }; } public get externalFragmentDefinitions() { return this._externalFragmentDefinitions; diff --git a/packages/monaco-graphql/src/typings/index.ts b/packages/monaco-graphql/src/typings/index.ts index 630907fd843..856a06483bd 100644 --- a/packages/monaco-graphql/src/typings/index.ts +++ b/packages/monaco-graphql/src/typings/index.ts @@ -9,7 +9,10 @@ import { ValidationRule, FragmentDefinitionNode, } from 'graphql'; -import { JSONSchema6 } from 'graphql-language-service'; +import { + AutocompleteSuggestionOptions, + JSONSchema6, +} from 'graphql-language-service'; import type { Options as PrettierConfig } from 'prettier'; export type BaseSchemaConfig = { @@ -127,10 +130,12 @@ export type GraphQLLanguageConfig = { * Custom validation rules following `graphql` `ValidationRule` signature */ customValidationRules?: ValidationRule[]; + completionSettings?: Omit; /** * Should field leafs be automatically expanded & filled on autocomplete? * * NOTE: this can be annoying with required arguments + * @deprecated use `completionSettings.fillLeafsOnComplete` instead */ fillLeafsOnComplete?: boolean; }; @@ -225,24 +230,18 @@ export type DiagnosticSettings = { jsonDiagnosticSettings?: monaco.languages.json.DiagnosticsOptions; }; -export type CompletionSettings = { +export type CompletionSettings = AutocompleteSuggestionOptions & { /** - * EXPERIMENTAL: Automatically fill required leaf nodes recursively - * upon triggering code completion events. - * - * - * - [x] fills required nodes - * - [x] automatically expands relay-style node/edge fields - * - [ ] automatically jumps to first required argument field - * - then, continues to prompt for required argument fields - * - (fixing this will make it non-experimental) - * - when it runs out of arguments, or you choose `{` as a completion option - * that appears when all required arguments are supplied, the argument - * selection closes `)` and the leaf field expands again `{ \n| }` + * @deprecated use fillLeafsOnComplete for parity. still experimental */ __experimental__fillLeafsOnComplete?: boolean; }; +// export type CompletionSettings = { + +// __experimental__fillLeafsOnComplete?: boolean; +// }; + /** * Configuration to initialize the editor with */ diff --git a/packages/monaco-graphql/src/utils.ts b/packages/monaco-graphql/src/utils.ts index add6efd99fa..15de6e4b3e4 100644 --- a/packages/monaco-graphql/src/utils.ts +++ b/packages/monaco-graphql/src/utils.ts @@ -55,10 +55,9 @@ export function toCompletion( ): GraphQLWorkerCompletionItem { const results: GraphQLWorkerCompletionItem = { label: entry.label, - insertText: entry.insertText, - insertTextFormat: entry.insertTextFormat, + insertText: entry?.insertText, sortText: entry.sortText, - filterText: entry.filterText, + filterText: entry?.filterText, documentation: entry.documentation, detail: entry.detail, range: range ? toMonacoRange(range) : undefined, @@ -67,10 +66,16 @@ export function toCompletion( if (entry.insertTextFormat) { results.insertTextFormat = entry.insertTextFormat; } + if (entry.insertTextMode) { + results.insertTextMode = entry.insertTextMode; + } if (entry.command) { results.command = { ...entry.command, id: entry.command.command }; } + if (entry.labelDetails) { + results.labelDetails = entry.labelDetails; + } return results; } diff --git a/packages/monaco-graphql/test/monaco-editor.test.ts b/packages/monaco-graphql/test/monaco-editor.test.ts index c4ef749b517..018c5c05a52 100644 --- a/packages/monaco-graphql/test/monaco-editor.test.ts +++ b/packages/monaco-graphql/test/monaco-editor.test.ts @@ -13,7 +13,7 @@ describe('monaco-editor', () => { // expect(lines[0]).toBe('$ vite build'); // expect(lines[1]).toMatch(' building for production...'); // expect(lines[2]).toBe('transforming...'); - expect(lines[3]).toMatch('✓ 841 modules transformed.'); + expect(lines[3]).toMatch('✓ 843 modules transformed.'); // expect(lines[4]).toBe('rendering chunks...'); // expect(lines[5]).toBe('computing gzip size...'); // expect(lines[6]).toMatch('dist/index.html'); diff --git a/packages/vscode-graphql-execution/package.json b/packages/vscode-graphql-execution/package.json index 73ef2bb2048..038d7f770f1 100644 --- a/packages/vscode-graphql-execution/package.json +++ b/packages/vscode-graphql-execution/package.json @@ -87,7 +87,7 @@ "vsce:package": "yarn compile && vsce package --yarn", "vsce:prepublish": "yarn run vsce:package", "vsce:publish": "vsce publish --yarn", - "open-vsx:publish": "ovsx publish --yarn -i . --pat $OVSX_PAT", + "open-vsx:publish": "ovsx publish $(ls -1 *.vsix | sort -V | tail -n 1) --pat $OVSX_PAT", "release": "yarn run compile && yarn run vsce:publish && yarn run open-vsx:publish" }, "devDependencies": { diff --git a/packages/vscode-graphql-syntax/README.md b/packages/vscode-graphql-syntax/README.md index a4040b662c2..19643a53794 100644 --- a/packages/vscode-graphql-syntax/README.md +++ b/packages/vscode-graphql-syntax/README.md @@ -12,7 +12,6 @@ matching. - PHP (example: [test.php](https://github.com/graphql/graphiql/blob/main/packages/vscode-graphql-syntax/tests/__fixtures__/test.php)) - Markdown (examples: [test.md](https://github.com/graphql/graphiql/blob/main/packages/vscode-graphql-syntax/tests/__fixtures__/test.md) & [test-py.md](https://github.com/graphql/graphiql/blob/main/packages/vscode-graphql-syntax/tests/__fixtures__/test-py.md)) - Scala (example: [test.scala](https://github.com/graphql/graphiql/blob/main/packages/vscode-graphql-syntax/tests/__fixtures__/test.scala)) -- ruby (example: [test.rb](https://github.com/graphql/graphiql/blob/main/packages/vscode-graphql-syntax/tests/__fixtures__/test.rb)) You'll want to install this if you do not use `graphql-config`, or want to use the highlighting with other extensions than `vscode-graphql` diff --git a/packages/vscode-graphql-syntax/package.json b/packages/vscode-graphql-syntax/package.json index 849d66fdfd6..9fdf376267f 100644 --- a/packages/vscode-graphql-syntax/package.json +++ b/packages/vscode-graphql-syntax/package.json @@ -63,7 +63,8 @@ "source.vue", "source.svelte", "source.astro", - "text.html.markdown" + "text.html.markdown", + "text.html.derivative" ], "scopeName": "inline.graphql", "path": "./grammars/graphql.js.json", @@ -75,7 +76,8 @@ "injectTo": [ "source.reason", "source.ocaml", - "text.html.markdown" + "text.html.markdown", + "text.html.derivative" ], "scopeName": "inline.graphql.re", "path": "./grammars/graphql.re.json", @@ -86,7 +88,8 @@ { "injectTo": [ "source.rescript", - "text.html.markdown" + "text.html.markdown", + "text.html.derivative" ], "scopeName": "inline.graphql.res", "path": "./grammars/graphql.rescript.json", @@ -96,7 +99,8 @@ }, { "injectTo": [ - "text.html.markdown" + "text.html.markdown", + "text.html.derivative" ], "scopeName": "inline.graphql.markdown.codeblock", "path": "./grammars/graphql.markdown.codeblock.json", @@ -107,7 +111,8 @@ { "injectTo": [ "source.python", - "text.html.markdown" + "text.html.markdown", + "text.html.derivative" ], "scopeName": "inline.graphql.python", "path": "./grammars/graphql.python.json", @@ -118,7 +123,8 @@ { "injectTo": [ "text.html.php", - "text.html.markdown" + "text.html.markdown", + "text.html.derivative" ], "scopeName": "inline.graphql.php", "path": "./grammars/graphql.php.json", @@ -129,7 +135,8 @@ { "injectTo": [ "source.scala", - "text.html.markdown" + "text.html.markdown", + "text.html.derivative" ], "scopeName": "inline.graphql.scala", "path": "./grammars/graphql.scala.json", diff --git a/packages/vscode-graphql-syntax/tests/__fixtures__/test.astro b/packages/vscode-graphql-syntax/tests/__fixtures__/test.astro new file mode 100644 index 00000000000..8698868eec3 --- /dev/null +++ b/packages/vscode-graphql-syntax/tests/__fixtures__/test.astro @@ -0,0 +1,30 @@ +--- +const gql = String.raw; +const response = await fetch( + 'https://swapi-graphql.netlify.app/.netlify/functions/index', + { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ + query: gql` + query getFilm($id: ID!) { + film(id: $id) { + title + releaseDate + } + } + `, + variables: { + id: 'ZmlsbXM6MQ==', + }, + }), + }, +); + +const json = await response.json(); +const { film } = json.data; +--- + +

Fetching information about Star Wars: A New Hope

+

Title: {film.title}

+

Year: {film.releaseDate}

diff --git a/packages/vscode-graphql-syntax/tests/__snapshots__/js-grammar.spec.ts.snap b/packages/vscode-graphql-syntax/tests/__snapshots__/js-grammar.spec.ts.snap index 12a88876f2a..8cc2f5ead73 100644 --- a/packages/vscode-graphql-syntax/tests/__snapshots__/js-grammar.spec.ts.snap +++ b/packages/vscode-graphql-syntax/tests/__snapshots__/js-grammar.spec.ts.snap @@ -1,5 +1,69 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html +exports[`inline.graphql grammar > should tokenize a simple astro file 1`] = ` +--- | +const gql = String.raw; | +const response = await fetch( | + 'https://swapi-graphql.netlify.app/.netlify/functions/index', | + { | + method: 'POST', | + headers: { 'Content-Type': 'application/json' }, | + body: JSON.stringify({ | + query: | + | +gql | entity.name.function.tagged-template.js +\` | punctuation.definition.string.template.begin.js + | meta.embedded.block.graphql +query | meta.embedded.block.graphql keyword.operation.graphql + | meta.embedded.block.graphql +getFilm | meta.embedded.block.graphql entity.name.function.graphql +( | meta.embedded.block.graphql meta.brace.round.graphql +$id | meta.embedded.block.graphql meta.variables.graphql variable.parameter.graphql +: | meta.embedded.block.graphql meta.variables.graphql punctuation.colon.graphql + | meta.embedded.block.graphql meta.variables.graphql +ID | meta.embedded.block.graphql meta.variables.graphql support.type.builtin.graphql +! | meta.embedded.block.graphql meta.variables.graphql keyword.operator.nulltype.graphql +) | meta.embedded.block.graphql meta.brace.round.graphql + | meta.embedded.block.graphql meta.selectionset.graphql +{ | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql + | meta.embedded.block.graphql meta.selectionset.graphql +film | meta.embedded.block.graphql meta.selectionset.graphql variable.graphql +( | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql meta.brace.round.directive.graphql +id | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql variable.parameter.graphql +: | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql punctuation.colon.graphql + | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql +$id | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql variable.graphql +) | meta.embedded.block.graphql meta.selectionset.graphql meta.arguments.graphql meta.brace.round.directive.graphql + | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql +{ | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql punctuation.operation.graphql + | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql +title | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql variable.graphql + | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql +releaseDate | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql variable.graphql + | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql +} | meta.embedded.block.graphql meta.selectionset.graphql meta.selectionset.graphql punctuation.operation.graphql + | meta.embedded.block.graphql meta.selectionset.graphql +} | meta.embedded.block.graphql meta.selectionset.graphql punctuation.operation.graphql + | meta.embedded.block.graphql +\` | punctuation.definition.string.template.end.js +, | + variables: { | + id: 'ZmlsbXM6MQ==', | + }, | + }), | + }, | +); | + | +const json = await response.json(); | +const { film } = json.data; | +--- | + | +

Fetching information about Star Wars: A New Hope

| +

Title: {film.title}

| +

Year: {film.releaseDate}

| + | +`; + exports[`inline.graphql grammar > should tokenize a simple ecmascript file 1`] = ` /* eslint-disable */ | /* prettier-ignore */ | diff --git a/packages/vscode-graphql-syntax/tests/js-grammar.spec.ts b/packages/vscode-graphql-syntax/tests/js-grammar.spec.ts index 91332e32551..786018e4562 100644 --- a/packages/vscode-graphql-syntax/tests/js-grammar.spec.ts +++ b/packages/vscode-graphql-syntax/tests/js-grammar.spec.ts @@ -23,4 +23,8 @@ describe('inline.graphql grammar', () => { const result = await tokenizeFile('__fixtures__/test.svelte', scope); expect(result).toMatchSnapshot(); }); + it('should tokenize a simple astro file', async () => { + const result = await tokenizeFile('__fixtures__/test.astro', scope); + expect(result).toMatchSnapshot(); + }); }); diff --git a/packages/vscode-graphql/README.md b/packages/vscode-graphql/README.md index 6cad22385da..3666f171184 100644 --- a/packages/vscode-graphql/README.md +++ b/packages/vscode-graphql/README.md @@ -7,28 +7,9 @@ Ecosystem with VSCode for an awesome developer experience. ![](https://camo.githubusercontent.com/97dc1080d5e6883c4eec3eaa6b7d0f29802e6b4b/687474703a2f2f672e7265636f726469742e636f2f497379504655484e5a342e676966) -### General features - -> _Operation Execution will be re-introduced in a new extension_ - -- Load the extension on detecting `graphql-config file` at root level or in a - parent level directory -- Load the extension in `.graphql`, `.gql files` -- Load the extension detecting `gql` tag in js, ts, jsx, tsx, vue files -- Load the extension inside `gql`/`graphql` fenced code blocks in markdown files -- NO LONGER SUPPORTED - execute query/mutation/subscription operations, embedded - or in graphql files - we will be recommending other extensions for this. -- pre-load schema and document definitions -- Support [`graphql-config`](https://graphql-config.com/) files with one project - and multiple projects (multi-workspace roots with multiple graphql config - files not yet supported) -- the language service re-starts on saved changes to vscode settings and/or - graphql config! - -### `.graphql`, `.gql` file extension support +### `.graphql`, `.gql` file extension support and `gql`/`graphql` tagged template literal support for tsx, jsx, ts, js -- syntax highlighting (type, query, mutation, interface, union, enum, scalar, - fragments, directives) +- syntax highlighting (provided by `vscode-graphql-syntax`) - autocomplete suggestions - validation against schema - snippets (interface, type, input, enum, union) @@ -36,59 +17,51 @@ Ecosystem with VSCode for an awesome developer experience. - go to definition support (input, enum, type) - outline support -### `gql`/`graphql` tagged template literal support for tsx, jsx, ts, js +## Getting Started -- syntax highlighting (type, query, mutation, interface, union, enum, scalar, - fragments, directives) -- autocomplete suggestions -- validation against schema -- snippets -- hover support -- go to definition for fragments and input types -- outline support +> **This extension requires a graphql-config file**. -## Usage +To support language features like completion and "go-to definition" across multiple files, +please include `documents` in the `graphql-config` file default or per-project -**This extension requires a graphql-config file**. +### Simplest Config Example -Install the -[VSCode GraphQL Extension](https://marketplace.visualstudio.com/items?itemName=GraphQL.vscode-graphql). - -(Watchman is no longer required, you can uninstall it now) +```yaml +# .graphqlrc.yml or graphql.config.yml +schema: 'schema.graphql' +documents: 'src/**/*.{graphql,js,ts,jsx,tsx}' +``` -As of `vscode-graphql@0.3.0` we support `graphql-config@3`. You can read more -about that [here](https://www.graphql-config.com/docs/user/user-usage). Because -it now uses `cosmiconfig` there are plenty of new options for loading config -files: +`package.json`: -``` -graphql.config.json -graphql.config.js -graphql.config.yaml -graphql.config.yml -.graphqlrc (YAML or JSON) -.graphqlrc.json -.graphqlrc.yaml -.graphqlrc.yml -.graphqlrc.js -graphql property in package.json +```json +"graphql": { + "schema": "https://localhost:3001", + "documents": "**/*.{graphql,js,ts,jsx,tsx}" +}, ``` -the file needs to be placed at the project root by default, but you can -configure paths per project. see the FAQ below for details. +```ts +// .graphqlrc.ts or graphql.config.ts +export default { + schema: 'schema.graphql', + documents: '**/*.{graphql,js,ts,jsx,tsx}', +}; +``` -Previous versions of this extension support `graphql-config@2` format, which -follows -[legacy configuration patterns](https://github.com/kamilkisiela/graphql-config/tree/legacy#usage) +same for .json, .toml, etc -If you need legacy support for `.graphqlconfig` files or older graphql-config -formats, see [this FAQ answer](#legacy). If you are missing legacy -`graphql-config` features, please consult -[the `graphql-config` repository](https://github.com/kamilkisiela/graphql-config). +## Additional Features -To support language features like "go-to definition" across multiple files, -please include `documents` key in the `graphql-config` file default or -per-project (this was `include` in 2.0). +- Loads the LSP server upon detecting a `graphql-config` file at root level or in a + parent level directory, or a `package.json` file with `graphql` config +- Loads `.graphql`, `.gql` files, and detects `gql`, `graphql` tags and `/** GraphQL */` and `#graphql` comments in js, ts, jsx, tsx, vue files +- pre-load schema and fragment definitions +- Support [`graphql-config`](https://graphql-config.com/) files with one project + and multiple projects (multi-workspace roots with multiple graphql config + files not yet supported) +- the language service re-starts on saved changes to vscode settings and/or + graphql config! ## Configuration Examples @@ -97,19 +70,22 @@ For more help with configuring the language server, is the source of truth for all settings used by all editors which use the language server. -### Simple Example +This includes LSP settings provided by extensions like `vscode-graphql`, nvim, etc. -```yaml -# .graphqlrc.yml -schema: 'schema.graphql' -documents: 'src/**/*.{graphql,js,ts,jsx,tsx}' -``` +There are a number of configurations that can be provided from both editor settings or the graphql config file, and the editor setting takes precedence, to allow users to override their graphql config file settings in a user context as needed. + +The [`graphql-config`](https://graphql-config.com/) docs are also very helpful for the config file. ### Advanced Example -```js -// graphql.config.js -module.exports = { +Multi-project can be used for both local files, URL defined schema, or both + +```ts +import dotenv from 'dotenv'; +dotenv.config(); + +// .graphqlrc.ts or graphql.config.ts +export default { projects: { app: { schema: ['src/schema.graphql', 'directives.graphql'], @@ -119,15 +95,15 @@ module.exports = { schema: 'src/generated/db.graphql', documents: ['src/db/**/*.graphql', 'my/fragments.graphql'], extensions: { - codegen: [ - { - generator: 'graphql-binding', - language: 'typescript', - output: { - binding: 'src/generated/db.ts', + // for use with `vscode-graphql-execution`, for example: + endpoints: { + default: { + url: 'https://localhost:3001/graphql/', + headers: { + Authorization: `Bearer ${process.env.API_TOKEN}`, }, }, - ], + }, }, }, }, @@ -139,66 +115,9 @@ is also valid. ## Frequently Asked Questions - - -### I can't load `.graphqlconfig` files anymore - -> Note: this option has been set to be enabled by default, however -> `graphql-config` maintainers do not want to continue to support the legacy -> format (mostly kept for companies where intellij users are stuck on the old -> config format), so please migrate to the new `graphql-config` format as soon -> as possible! - -If you need to use a legacy config file, then you just need to enable legacy -mode for `graphql-config`: - -```json -"graphql-config.load.legacy": true -``` - -### Go to definition is not working for my URL - -You can try the new experimental `cacheSchemaFileForLookup` option. NOTE: this -will disable all definition lookup for local SDL graphql schema files, and -_only_ perform lookup of the result an SDL result of `graphql-config` -`getSchema()` - -To enable, add this to your settings: - -```json -"vscode-graphql.cacheSchemaFileForLookup": true, -``` - -you can also use graphql config if you need to mix and match these settings: - -```yml -schema: 'http://myschema.com/graphql' -extensions: - languageService: - cacheSchemaFileForLookup: true -projects: - project1: - schema: 'project1/schema/schema.graphql' - documents: 'project1/queries/**/*.{graphql,tsx,jsx,ts,js}' - extensions: - languageService: - cacheSchemaFileForLookup: false - - project2: - schema: 'https://api.spacex.land/graphql/' - documents: 'project2/queries.graphql' - extensions: - endpoints: - default: - url: 'https://api.spacex.land/graphql/' - languageService: - # Do project configs inherit parent config? - cacheSchemaFileForLookup: true -``` - ### The extension fails with errors about duplicate types -Make sure that you aren't including schema files in the `documents` blob +Your object types must be unique per project (as they must be unique per schema), and your fragment names must also be unique per project. ### The extension fails with errors about missing scalars, directives, etc @@ -232,6 +151,7 @@ You can search a folder for any of the matching config file names listed above: ```json "graphql-config.load.rootDir": "./config" +"graphql-config.envFilePath": "./config/.dev.env" ``` Or a specific filepath: @@ -253,39 +173,15 @@ which would search for `./config/.acmerc`, `.config/.acmerc.js`, If you have multiple projects, you need to define one top-level config that defines all project configs using `projects` -### How do I highlight an embedded graphql string? - -If you aren't using a template tag function such as `gql` or `graphql`, and just -want to use a plain string, you can use an inline `#graphql` comment: +### How do I enable language features for an embedded graphql string? -```ts -const myQuery = `#graphql - query { - something - } -`; -``` - -or - -```ts -const myQuery = - /* GraphQL */ - - ` - query { - something - } - `; -``` +Please refer to the `vscode-graphql-syntax` reference files ([js](https://github.com/graphql/graphiql/blob/main/packages/vscode-graphql-syntax/tests/__fixtures__/test.js),[ts](https://github.com/graphql/graphiql/blob/main/packages/vscode-graphql-syntax/tests/__fixtures__/test.ts),[svelte](https://github.com/graphql/graphiql/blob/main/packages/vscode-graphql-syntax/tests/__fixtures__/test.svelte),[vue](https://github.com/graphql/graphiql/blob/main/packages/vscode-graphql-syntax/tests/__fixtures__/test.vue)) to learn our template tag, comment and other graphql delimiter patterns for the file types that the language server supports. The syntax highlighter currently supports more languages than the language server. If you notice any places where one or the other doesn't work, please report it! ## Known Issues -- the output channel occasionally shows "definition not found" when you first - start the language service, but once the definition cache is built for each - project, definition lookup will work. so if a "peek definition" fails when you - first start the editor or when you first install the extension, just try the - definition lookup again. +- the locally generated schema file for definition lookup currently does not re-generate on schema changes. this will be fixed soon. +- multi-root workspaces support will be added soon as well. +- some graphql-config options aren't always honored, this will also be fixed soon ## Attribution @@ -312,7 +208,7 @@ This plugin uses the ### Contributing back to this project This repository is managed by EasyCLA. Project participants must sign the free -([GraphQL Specification Membership agreement](https://preview-spec-membership.graphql.org) +([GraphQL Specification Membership agreement](https://preview-spec-membership.graphql.org)) before making a contribution. You only need to do this one time, and it can be signed by [individual contributors](http://individual-spec-membership.graphql.org/) or diff --git a/packages/vscode-graphql/package.json b/packages/vscode-graphql/package.json index 767b58a127f..876b65103ef 100644 --- a/packages/vscode-graphql/package.json +++ b/packages/vscode-graphql/package.json @@ -1,6 +1,6 @@ { "name": "vscode-graphql", - "version": "0.9.3", + "version": "0.10.2", "private": true, "license": "MIT", "displayName": "GraphQL: Language Feature Support", @@ -85,13 +85,13 @@ "null" ], "default": false, - "description": "Enable debug logs" + "description": "Enable debug logs and node debugger for client" }, "vscode-graphql.cacheSchemaFileForLookup": { "type": [ "boolean" ], - "description": "Use a cached file output of your graphql-config schema result for definition lookups, symbols, outline, etc. Disabled by default." + "description": "Use a cached file output of your graphql-config schema result for definition lookups, symbols, outline, etc. Enabled by default when one or more schema entry is not a local file with SDL in it. Disable if you want to use SDL with a generated schema." }, "vscode-graphql.largeFileThreshold": { "type": [ @@ -107,40 +107,47 @@ "description": "Fail the request on invalid certificate", "default": true }, - "graphql-config.load.rootDir": { + "vscode-graphql.schemaCacheTTL": { "type": [ - "string" + "number" ], - "description": "Base dir for graphql config loadConfig()" + "description": "Schema cache ttl in milliseconds - the interval before requesting a fresh schema when caching the local schema file is enabled. Defaults to 30000 (30 seconds).", + "default": 30000 }, - "graphql-config.load.filePath": { + "graphql-config.load.rootDir": { "type": [ "string" ], - "description": "filePath for graphql config loadConfig()", - "default": null + "description": "Base dir for graphql config loadConfig(), to look for config files or package.json" }, - "graphql-config.load.legacy": { + "graphql-config.load.filePath": { "type": [ - "boolean" + "string" ], - "description": "legacy mode for graphql config v2 config", + "description": "exact filePath for a `graphql-config` file `loadConfig()`", "default": null }, "graphql-config.load.configName": { "type": [ "string" ], - "description": "optional .config.js instead of default `graphql`", + "description": "optional .config.{js,ts,toml,yaml,json} & rc* instead of default `graphql`", "default": null }, - "graphql-config.dotEnvPath": { + "graphql-config.load.legacy": { "type": [ - "string" + "boolean" ], - "description": "optional .env load path, if not the default", + "description": "legacy mode for graphql config v2 config", "default": null } + }, + "graphql-config.dotEnvPath": { + "type": [ + "string" + ], + "description": "optional .env load file path, if not the default. specify a relative path to the .env file to be loaded by dotenv module. you can also import dotenv in the config file.", + "default": null } }, "commands": [ @@ -161,7 +168,7 @@ "vsce:package": "vsce package --yarn", "env:source": "export $(cat .envrc | xargs)", "vsce:publish": "vsce publish --yarn", - "open-vsx:publish": "ovsx publish --extensionFile $(ls -1 *.vsix | tail -n 1) --pat $OVSX_PAT", + "open-vsx:publish": "ovsx publish $(ls -1 *.vsix | sort -V | tail -n 1) --pat $OVSX_PAT", "release": "npm run vsce:publish && npm run open-vsx:publish" }, "devDependencies": { diff --git a/custom-words.txt b/resources/custom-words.txt similarity index 98% rename from custom-words.txt rename to resources/custom-words.txt index 297692fd04b..2bbbb473dee 100644 --- a/custom-words.txt +++ b/resources/custom-words.txt @@ -1,235 +1,228 @@ +// short for "developer experience": +// short for "maintainers": +// short for "platform as a service": +// these pop up when writing "GraphQL___" // (user-)names -arthurgeron -Divyendu -Leko -LekoArts +// abbreviations +// companies and organizations +// cspell en-us/en-gb edgecases? +// fonts +// identifiers used in code and configs +// locations +// other +// other languages +// packages and tools +// phonetic notation +ˈɡrafək acao +acmerc aivazis akshat alexey alok +amfoss +architecting +argparse arminio +arrayish +arthurgeron asiandrummer +astro +astrojs aumy +Autopurge +behaviour benjie +binti +blockstring bobbybobby borggreve bram -cshaver -dhanani -divy -divyenduz -dotan -dotansimha -gillam -goldshtein -goncharov -graphi -harshith -heyenbrock -hurrell -hyohyeon -imolorhe -jeong -jonathanawesome -kumar -leebyron -lostplan -nauroze -nishchit -nowdoc -orta -pabbati -pratap -ravikoti -rikki -rodionov -rohit -saihaj -saihajpreet -scheer -schulte -schuster -sgrove -simha -stonexer -suchanek -tanay -tanaypratap -therox -thomasheyenbrock -timsuchanek -urigo -wincent -yoshiakis - -// packages and tools -argparse -astro -astrojs +browserslistrc +calar +chainable changesets clsx +codebases +codegen codemirror codesandbox +codespaces +codicon +colmena combobox +cshaver +dedenting delivr +devx +dhanani +dirpath +divy +Divyendu +divyenduz dompurify +dotan +dotansimha +edcore +envrc esbuild execa -GraphiQL -headlessui -inno -intellij -jsdelivr -lezer -manypkg -modulemap -mockfs -meros -nullthrows -onig -ovsx -picomatch -pnpm -snyk -sonarjs -svgr -typedoc -vite -vitest -vitejs -vsix -wonka -urql -tsup -usememo - -// identifiers used in code and configs -acmerc -binti -blockstring -browserslistrc -calar -chainable -codegen -dirpath -envrc +exfiltrate filesfor +fira +firecamp flowtests foldgutter foldmarker +gdezerno ghapi +gillam +givatayim +goldshtein +goncharov +grafbase +graphi +graphile +GraphiQL graphqlconfig graphqlrc graphqls +harshith +headlessui +heyenbrock +hola htmling +hurrell +hyohyeon +imolorhe +inno +intellij invalidchar +jammu +jeong +jiti +jonathanawesome +jsdelivr +kumar languageservice +leebyron +Leko +LekoArts +lezer linenumber linenumbers linkify listbox listvalues +lostplan +maint +manypkg marko matchingbracket +medellín +menlo +meros middlewares +mockfs +modulemap +nauroze newhope nextjs +nishchit nocheck nocursor nonmatchingbracket +novvum +nowdoc nrtbf +nullthrows nulltype nvim objectvalues +onig +ooops orche +orta outdir outlineable +ovsx +paas +pabbati +picomatch +pieas +pnpm postbuild +pratap prebuild +proto +qlapi +qlid +qlide quasis ractive +randomthing +ravikoti resi resizer +rikki +roadmap +roboto +rodionov +rohit runmode +runtimes +saihaj +saihajpreet +scheer +schulte +schuster searchcursor selectionset sfc's +sgrove +simha singleline +snyk socker +sonarjs +sorare squirrelly +stonexer streamable subword +suchanek +svgr +tanay +tanaypratap testid testonly +therox +thomasheyenbrock +timsuchanek +tokenizes +tsup +typeahead +typeaheads +typedoc unfocus unnormalized +unparsable unsubscribable +urigo +urql +usememo vash -websockets - -// fonts -fira -menlo -roboto - -// locations -givatayim -jammu -medellín +vite +vitejs +vitest vizag - -// companies and organizations -amfoss -colmena -firecamp -gdezerno -grafbase -graphile -novvum -pieas -sorare - -// other languages -hola +vsix +websockets +wincent +wonka +yoshiakis zdravo Здорово أهلاً سلام हेलो - -// phonetic notation -ˈɡrafək - -// abbreviations -// short for "developer experience": -devx -// short for "maintainers": -maint -// short for "platform as a service": -paas -// these pop up when writing "GraphQL___" -qlapi -qlid -qlide - -// cspell en-us/en-gb edgecases? -behaviour - -// other -architecting -codebases -codespaces -dedenting -exfiltrate -ooops -proto -roadmap -runtimes -typeahead -typeaheads -unparsable -randomthing -codicon -edcore -tokenizes diff --git a/resources/prettierignore b/resources/prettierignore new file mode 100644 index 00000000000..bd6c60530a5 --- /dev/null +++ b/resources/prettierignore @@ -0,0 +1,3 @@ +# this file contains delicate whitespace character assertions that i could not get prettier to ignore +# if removed it will cause the tests to fail +../packages/graphql-language-service-server/src/__tests__/parseDocument.test.ts diff --git a/yarn.lock b/yarn.lock index 91b899addb1..015c4a808f7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -51,10 +51,10 @@ resolved "https://registry.yarnpkg.com/@arthurgeron/eslint-plugin-react-usememo/-/eslint-plugin-react-usememo-1.1.4.tgz#7c92ef49813191f5af18339242b60f4beddabc86" integrity sha512-OIjOhplz6MT+HgJjKZT1SDGzhofSRZaYfNBc7yRl/eeuh2VfUlRQP9ulReBLmfwuQWyRLr0wcdazQNKq35MaEw== -"@astrojs/compiler@^2.5.0": - version "2.5.0" - resolved "https://registry.yarnpkg.com/@astrojs/compiler/-/compiler-2.5.0.tgz#dba7a7a936aed98089b93505dda1c1011ba82746" - integrity sha512-ZDluNgMIJT+z+HJcZ6QEJ/KqaFkTkrb+Za6c6VZs8G/nb1LBErL14/iU5EVJ9yu25i4QCLweuBJ3m5df34gZJg== +"@astrojs/compiler@^2.8.0": + version "2.8.0" + resolved "https://registry.yarnpkg.com/@astrojs/compiler/-/compiler-2.8.0.tgz#acbe2abbf640c238cbfe6c9d886a4d0c6921f172" + integrity sha512-yrpD1WRGqsJwANaDIdtHo+YVjvIOFAjC83lu5qENIgrafwZcJgSXDuwVMXOgok4tFzpeKLsFQ6c3FoUdloLWBQ== "@babel/cli@^7.21.0": version "7.21.0" @@ -108,6 +108,14 @@ "@babel/highlight" "^7.23.4" chalk "^2.4.2" +"@babel/code-frame@^7.24.2": + version "7.24.2" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.24.2.tgz#718b4b19841809a58b29b68cde80bc5e1aa6d9ae" + integrity sha512-y5+tLQyV8pg3fsiln67BVLD1P13Eg4lh5RW9mF0zUuvLrv9uIQ4MCL+CRT+FTsBlBjcIan6PGsLcBN0m3ClUyQ== + dependencies: + "@babel/highlight" "^7.24.2" + picocolors "^1.0.0" + "@babel/compat-data@^7.17.7": version "7.17.7" resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.17.7.tgz#078d8b833fbbcc95286613be8c716cef2b519fa2" @@ -308,6 +316,16 @@ "@jridgewell/trace-mapping" "^0.3.17" jsesc "^2.5.1" +"@babel/generator@^7.24.5": + version "7.24.5" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.24.5.tgz#e5afc068f932f05616b66713e28d0f04e99daeb3" + integrity sha512-x32i4hEXvr+iI0NEoEfDKzlemF8AmtOP8CcrRaEcpzysWuoEb1KknpcvMsHKPONoKZiDuItklgWhB18xEhr9PA== + dependencies: + "@babel/types" "^7.24.5" + "@jridgewell/gen-mapping" "^0.3.5" + "@jridgewell/trace-mapping" "^0.3.25" + jsesc "^2.5.1" + "@babel/generator@^7.7.2": version "7.18.9" resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.18.9.tgz#68337e9ea8044d6ddc690fb29acae39359cca0a5" @@ -822,6 +840,13 @@ dependencies: "@babel/types" "^7.22.5" +"@babel/helper-split-export-declaration@^7.24.5": + version "7.24.5" + resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.24.5.tgz#b9a67f06a46b0b339323617c8c6213b9055a78b6" + integrity sha512-5CHncttXohrHk8GWOFCcCl4oRD9fKosWlIRgWm4ql9VYioKm52Mk2xsmoohvm7f3JoiLSM5ZgJuRaf5QZZYd3Q== + dependencies: + "@babel/types" "^7.24.5" + "@babel/helper-string-parser@^7.19.4": version "7.19.4" resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.19.4.tgz#38d3acb654b4701a9b77fb0615a96f775c3a9e63" @@ -837,6 +862,11 @@ resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.23.4.tgz#9478c707febcbbe1ddb38a3d91a2e054ae622d83" integrity sha512-803gmbQdqwdf4olxrX4AJyFBV/RTr3rSmOj0rKwesmzlfhYNDEs+/iOcznzpNWlJlIlTJC2QfPFcHB6DlzdVLQ== +"@babel/helper-string-parser@^7.24.1": + version "7.24.1" + resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.24.1.tgz#f99c36d3593db9540705d0739a1f10b5e20c696e" + integrity sha512-2ofRCjnnA9y+wk8b9IAREroeUP02KHp431N2mhKniy2yKIDKpbrHv9eXwm8cBeWQYcJmzv5qKCu65P47eCF7CQ== + "@babel/helper-validator-identifier@^7.12.11": version "7.12.11" resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.12.11.tgz#c9a1f021917dcb5ccf0d4e453e399022981fc9ed" @@ -867,6 +897,11 @@ resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.5.tgz#9544ef6a33999343c8740fa51350f30eeaaaf193" integrity sha512-aJXu+6lErq8ltp+JhkJUfk1MTGyuA4v7f3pA+BJ5HLfNC6nAQ0Cpi9uOquUj8Hehg0aUiHzWQbOVJGao6ztBAQ== +"@babel/helper-validator-identifier@^7.24.5": + version "7.24.5" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.5.tgz#918b1a7fa23056603506370089bd990d8720db62" + integrity sha512-3q93SSKX2TWCG30M2G2kwaKeTYgEUp5Snjuj8qm729SObL6nbtUldAi37qbxkD5gg3xnBio+f9nqpSepGZMvxA== + "@babel/helper-validator-option@^7.16.7": version "7.16.7" resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.16.7.tgz#b203ce62ce5fe153899b617c08957de860de4d23" @@ -1001,6 +1036,16 @@ chalk "^2.4.2" js-tokens "^4.0.0" +"@babel/highlight@^7.24.2": + version "7.24.5" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.24.5.tgz#bc0613f98e1dd0720e99b2a9ee3760194a704b6e" + integrity sha512-8lLmua6AVh/8SLJRRVD6V8p73Hir9w5mJrhE+IPpILG31KKlI9iz5zmBYKcWPS59qSfgP9RaSBQSHHE81WKuEw== + dependencies: + "@babel/helper-validator-identifier" "^7.24.5" + chalk "^2.4.2" + js-tokens "^4.0.0" + picocolors "^1.0.0" + "@babel/parser@^7.1.0", "@babel/parser@^7.12.13": version "7.13.13" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.13.13.tgz#42f03862f4aed50461e543270916b47dd501f0df" @@ -1036,6 +1081,11 @@ resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.22.7.tgz#df8cf085ce92ddbdbf668a7f186ce848c9036cae" integrity sha512-7NF8pOkHP5o2vpmGgNGcfAeCvOYhGLyA3Z4eBQkT1RJlWu47n63bCs93QfJ2hIAFCil7L5P2IWhs1oToVgrL0Q== +"@babel/parser@^7.24.5": + version "7.24.5" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.24.5.tgz#4a4d5ab4315579e5398a82dcf636ca80c3392790" + integrity sha512-EOv5IK8arwh3LI47dz1b0tKUb/1uhHAnHJOrjgtQMIpu1uXd9mlFrJg9IUgGUgZ41Ch0K8REPTYpO7B76b4vJg== + "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@^7.18.6": version "7.18.6" resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.18.6.tgz#da5b8f9a580acdfbe53494dba45ea389fb09a4d2" @@ -2388,18 +2438,18 @@ "@babel/types" "^7.12.13" "@babel/traverse@^7.16.8", "@babel/traverse@^7.17.3", "@babel/traverse@^7.20.5", "@babel/traverse@^7.20.7", "@babel/traverse@^7.21.0", "@babel/traverse@^7.21.2", "@babel/traverse@^7.22.5", "@babel/traverse@^7.22.6", "@babel/traverse@^7.22.8", "@babel/traverse@^7.23.2", "@babel/traverse@^7.23.7", "@babel/traverse@^7.7.2": - version "7.23.7" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.23.7.tgz#9a7bf285c928cb99b5ead19c3b1ce5b310c9c305" - integrity sha512-tY3mM8rH9jM0YHFGyfC0/xf+SB5eKUu7HPj7/k3fpi9dAlsMc5YbQvDi0Sh2QTPXqMhyaAtzAr807TIyfQrmyg== + version "7.24.5" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.24.5.tgz#972aa0bc45f16983bf64aa1f877b2dd0eea7e6f8" + integrity sha512-7aaBLeDQ4zYcUFDUD41lJc1fG8+5IU9DaNSJAgal866FGvmD5EbWQgnEC6kO1gGLsX0esNkfnJSndbTXA3r7UA== dependencies: - "@babel/code-frame" "^7.23.5" - "@babel/generator" "^7.23.6" + "@babel/code-frame" "^7.24.2" + "@babel/generator" "^7.24.5" "@babel/helper-environment-visitor" "^7.22.20" "@babel/helper-function-name" "^7.23.0" "@babel/helper-hoist-variables" "^7.22.5" - "@babel/helper-split-export-declaration" "^7.22.6" - "@babel/parser" "^7.23.6" - "@babel/types" "^7.23.6" + "@babel/helper-split-export-declaration" "^7.24.5" + "@babel/parser" "^7.24.5" + "@babel/types" "^7.24.5" debug "^4.3.1" globals "^11.1.0" @@ -2455,6 +2505,15 @@ "@babel/helper-validator-identifier" "^7.22.20" to-fast-properties "^2.0.0" +"@babel/types@^7.24.5": + version "7.24.5" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.24.5.tgz#7661930afc638a5383eb0c4aee59b74f38db84d7" + integrity sha512-6mQNsaLeXTw0nxYUYu+NSa4Hx4BlF1x1x8/PMFbiR+GBSr+2DkECc69b8hgy2frEodNcvPffeH8YfWd3LI6jhQ== + dependencies: + "@babel/helper-string-parser" "^7.24.1" + "@babel/helper-validator-identifier" "^7.24.5" + to-fast-properties "^2.0.0" + "@bcoe/v8-coverage@^0.2.3": version "0.2.3" resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" @@ -4047,6 +4106,15 @@ "@jridgewell/sourcemap-codec" "^1.4.10" "@jridgewell/trace-mapping" "^0.3.9" +"@jridgewell/gen-mapping@^0.3.5": + version "0.3.5" + resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz#dcce6aff74bdf6dad1a95802b69b04a2fcb1fb36" + integrity sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg== + dependencies: + "@jridgewell/set-array" "^1.2.1" + "@jridgewell/sourcemap-codec" "^1.4.10" + "@jridgewell/trace-mapping" "^0.3.24" + "@jridgewell/resolve-uri@3.1.0": version "3.1.0" resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz#2203b118c157721addfe69d47b70465463066d78" @@ -4057,6 +4125,11 @@ resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.0.5.tgz#68eb521368db76d040a6315cdb24bf2483037b9c" integrity sha512-VPeQ7+wH0itvQxnG+lIzWgkysKIr3L9sslimFW55rHMdGu/qCQ5z5h9zq4gI8uBtqkpHhsF4Z/OwExufUCThew== +"@jridgewell/resolve-uri@^3.1.0": + version "3.1.2" + resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz#7a0ee601f60f99a20c7c7c5ff0c80388c1189bd6" + integrity sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw== + "@jridgewell/set-array@^1.0.0": version "1.1.1" resolved "https://registry.yarnpkg.com/@jridgewell/set-array/-/set-array-1.1.1.tgz#36a6acc93987adcf0ba50c66908bd0b70de8afea" @@ -4067,6 +4140,11 @@ resolved "https://registry.yarnpkg.com/@jridgewell/set-array/-/set-array-1.1.2.tgz#7c6cf998d6d20b914c0a55a91ae928ff25965e72" integrity sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw== +"@jridgewell/set-array@^1.2.1": + version "1.2.1" + resolved "https://registry.yarnpkg.com/@jridgewell/set-array/-/set-array-1.2.1.tgz#558fb6472ed16a4c850b889530e6b36438c49280" + integrity sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A== + "@jridgewell/source-map@^0.3.2": version "0.3.2" resolved "https://registry.yarnpkg.com/@jridgewell/source-map/-/source-map-0.3.2.tgz#f45351aaed4527a298512ec72f81040c998580fb" @@ -4122,6 +4200,14 @@ "@jridgewell/resolve-uri" "3.1.0" "@jridgewell/sourcemap-codec" "1.4.14" +"@jridgewell/trace-mapping@^0.3.24", "@jridgewell/trace-mapping@^0.3.25": + version "0.3.25" + resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz#15f190e98895f3fc23276ee14bc76b675c2e50f0" + integrity sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ== + dependencies: + "@jridgewell/resolve-uri" "^3.1.0" + "@jridgewell/sourcemap-codec" "^1.4.14" + "@jridgewell/trace-mapping@^0.3.9": version "0.3.14" resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.14.tgz#b231a081d8f66796e475ad588a1ef473112701ed" @@ -5453,6 +5539,13 @@ resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-9.1.1.tgz#e7c4f1001eefa4b8afbd1eee27a237fee3bf29c4" integrity sha512-Z61JK7DKDtdKTWwLeElSEBcWGRLY8g95ic5FoQqI9CMx0ns/Ghep3B4DfcEimiKMvtamNVULVNKEsiwV3aQmXw== +"@types/mock-fs@^4.13.4": + version "4.13.4" + resolved "https://registry.yarnpkg.com/@types/mock-fs/-/mock-fs-4.13.4.tgz#e73edb4b4889d44d23f1ea02d6eebe50aa30b09a" + integrity sha512-mXmM0o6lULPI8z3XNnQCpL0BGxPwx1Ul1wXYEPBGl4efShyxW2Rln0JOPEWGyZaYZMM6OVXM/15zUuFMY52ljg== + dependencies: + "@types/node" "*" + "@types/ms@*": version "0.7.31" resolved "https://registry.yarnpkg.com/@types/ms/-/ms-0.7.31.tgz#31b7ca6407128a3d2bbc27fe2d21b345397f6197" @@ -6051,14 +6144,15 @@ pretty-format "^27.5.1" "@vscode/vsce@^2.19.0", "@vscode/vsce@^2.23.0": - version "2.24.0" - resolved "https://registry.yarnpkg.com/@vscode/vsce/-/vsce-2.24.0.tgz#7f835b9fdd5bfedcecd62a6c4d684841a74974d4" - integrity sha512-p6CIXpH5HXDqmUkgFXvIKTjZpZxy/uDx4d/UsfhS9vQUun43KDNUbYeZocyAHgqcJlPEurgArHz9te1PPiqPyA== + version "2.23.0" + resolved "https://registry.yarnpkg.com/@vscode/vsce/-/vsce-2.23.0.tgz#280ce82356c59efda97d3ba14bcdd9e3e22ddb7f" + integrity sha512-Wf9yN8feZf4XmUW/erXyKQvCL577u72AQv4AI4Cwt5o5NyE49C5mpfw3pN78BJYYG3qnSIxwRo7JPvEurkQuNA== dependencies: azure-devops-node-api "^11.0.1" chalk "^2.4.2" cheerio "^1.0.0-rc.9" commander "^6.2.1" + find-yarn-workspace-root "^2.0.0" glob "^7.0.6" hosted-git-info "^4.0.2" jsonc-parser "^3.2.0" @@ -6854,10 +6948,10 @@ astral-regex@^2.0.0: resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-2.0.0.tgz#483143c567aeed4785759c0865786dc77d7d2e31" integrity sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ== -astrojs-compiler-sync@^0.3.5: - version "0.3.5" - resolved "https://registry.yarnpkg.com/astrojs-compiler-sync/-/astrojs-compiler-sync-0.3.5.tgz#bdfeb511b30c908104375cdfe04545f56c8ade3f" - integrity sha512-y420rhIIJ2HHDkYeqKArBHSdJNIIGMztLH90KGIX3zjcJyt/cr9Z2wYA8CP5J1w6KE7xqMh0DAkhfjhNDpQb2Q== +astrojs-compiler-sync@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/astrojs-compiler-sync/-/astrojs-compiler-sync-1.0.0.tgz#9991bd4cd09b60f41687e86b137171012722dbf3" + integrity sha512-IM6FxpMoBxkGGdKppkFHNQIC9Wge7jspG2MIJff8DOhG41USNJLxJfxRm7wnkTKWlYK5Y1YFFNYr2vUUKkI8sw== dependencies: synckit "^0.9.0" @@ -7531,30 +7625,10 @@ caniuse-api@^3.0.0: lodash.memoize "^4.1.2" lodash.uniq "^4.5.0" -caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001317, caniuse-lite@^1.0.30001328: - version "1.0.30001450" - resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001450.tgz" - integrity sha512-qMBmvmQmFXaSxexkjjfMvD5rnDL0+m+dUMZKoDYsGG8iZN29RuYh9eRoMvKsT6uMAWlyUUGDEQGJJYjzCIO9ew== - -caniuse-lite@^1.0.30001406: - version "1.0.30001507" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001507.tgz#fae53f6286e7564783eadea9b447819410a59534" - integrity sha512-SFpUDoSLCaE5XYL2jfqe9ova/pbQHEmbheDf5r4diNwbAgR3qxM9NQtfsiSscjqoya5K7kFcHPUQ+VsUkIJR4A== - -caniuse-lite@^1.0.30001426, caniuse-lite@^1.0.30001449: - version "1.0.30001457" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001457.tgz#6af34bb5d720074e2099432aa522c21555a18301" - integrity sha512-SDIV6bgE1aVbK6XyxdURbUE89zY7+k1BBBaOwYwkNCglXlel/E7mELiHC64HQ+W0xSKlqWhV9Wh7iHxUjMs4fA== - -caniuse-lite@^1.0.30001517: - version "1.0.30001518" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001518.tgz#b3ca93904cb4699c01218246c4d77a71dbe97150" - integrity sha512-rup09/e3I0BKjncL+FesTayKtPrdwKhUufQFd3riFw1hHg8JmIFoInYfB102cFcY/pPgGmdyl/iy+jgiDi2vdA== - -caniuse-lite@^1.0.30001565: - version "1.0.30001574" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001574.tgz#fb4f1359c77f6af942510493672e1ec7ec80230c" - integrity sha512-BtYEK4r/iHt/txm81KBudCUcTy7t+s9emrIaHqjYurQ10x71zJ5VQ9x1dYPcz/b+pKSp4y/v1xSI67A+LzpNyg== +caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001317, caniuse-lite@^1.0.30001328, caniuse-lite@^1.0.30001406, caniuse-lite@^1.0.30001426, caniuse-lite@^1.0.30001449, caniuse-lite@^1.0.30001517, caniuse-lite@^1.0.30001565: + version "1.0.30001588" + resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001588.tgz" + integrity sha512-+hVY9jE44uKLkH0SrUTqxjxqNTOWHsbnQDIKjwkZ3lNTzUUVdBLBGXtj/q5Mp5u98r3droaZAewQuEDzjQdZlQ== capital-case@^1.0.4: version "1.0.4" @@ -10727,9 +10801,9 @@ follow-redirects@^1.0.0, follow-redirects@^1.14.0: integrity sha512-aExlJShTV4qOUOL7yF1U5tvLCB0xQuudbf6toyYA0E/acBNw71mvjFTnLaRp50aQaYocMR0a/RMMBIHeZnGyjQ== follow-redirects@^1.13.2: - version "1.15.6" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.6.tgz#7f815c0cda4249c74ff09e95ef97c23b5fd0399b" - integrity sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA== + version "1.15.5" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.5.tgz#54d4d6d062c0fa7d9d17feb008461550e3ba8020" + integrity sha512-vSFWUON1B+yAw1VN4xMfxgn5fTUiaOzAJCKBwIIgT/+7CuGy9+r+5gITvP62j3RmaD5Ph65UaERdOSRGUzZtgw== follow-redirects@^1.14.6: version "1.15.2" @@ -13849,6 +13923,11 @@ lowercase-keys@^2.0.0: resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-2.0.0.tgz#2603e78b7b4b0006cbca2fbcc8a3202558ac9479" integrity sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA== +lru-cache@^10.2.0: + version "10.2.0" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-10.2.0.tgz#0bd445ca57363465900f4d1f9bd8db343a4d95c3" + integrity sha512-2bIM8x+VAf6JT4bKAljS1qUWgMsqZRPGJS6FSahIMPVvctcNhyVp7AJu7quxOW9jwkryBReKZY5tY5JYv2n/7Q== + lru-cache@^4.0.1: version "4.1.5" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.5.tgz#8bbe50ea85bed59bc9e33dcab8235ee9bcf443cd" From 85fd98939147fa9b774479a63e8116c67f0f7715 Mon Sep 17 00:00:00 2001 From: Rikki Schulte Date: Tue, 28 May 2024 08:49:16 +0200 Subject: [PATCH 22/81] configure more gh actions for node LTS (#3613) * finish upgrading to node 18 * fix: node version --- .github/workflows/main-test.yml | 4 +--- .github/workflows/pr-graphql-compat-check.yml | 1 - .github/workflows/release.yml | 1 - packages/graphql-language-service-server/README.md | 9 ++++----- 4 files changed, 5 insertions(+), 10 deletions(-) diff --git a/.github/workflows/main-test.yml b/.github/workflows/main-test.yml index 7a93be632ca..657a8ee5d94 100644 --- a/.github/workflows/main-test.yml +++ b/.github/workflows/main-test.yml @@ -13,7 +13,6 @@ jobs: uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: - node-version: 16 cache: yarn - name: Cache node modules id: cache-modules @@ -36,8 +35,7 @@ jobs: steps: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 - with: - node-version: 16 + - id: cache-modules uses: actions/cache@v3 with: diff --git a/.github/workflows/pr-graphql-compat-check.yml b/.github/workflows/pr-graphql-compat-check.yml index 7c2d7ead6f0..2bd0ecb8d88 100644 --- a/.github/workflows/pr-graphql-compat-check.yml +++ b/.github/workflows/pr-graphql-compat-check.yml @@ -31,7 +31,6 @@ jobs: - uses: actions/setup-node@v3 with: cache: yarn - node-version: 16 - name: Cache node modules uses: actions/cache@v3 with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a84a1e070be..6fde5149a4f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,7 +19,6 @@ jobs: fetch-depth: 0 - uses: actions/setup-node@v3 with: - node-version: 16 cache: yarn - name: Cache node modules uses: actions/cache@v3 diff --git a/packages/graphql-language-service-server/README.md b/packages/graphql-language-service-server/README.md index cff8af15e0d..f9c18bb4120 100644 --- a/packages/graphql-language-service-server/README.md +++ b/packages/graphql-language-service-server/README.md @@ -34,11 +34,10 @@ Supported features include: ### Dependencies -An LSP compatible client with its own file watcher, that sends watch -notifications to the server. - -**DROPPED**: GraphQL Language Service no longer depends on -[Watchman](https://facebook.github.io/watchman/) +- An LSP compatible client with its own file watcher, that sends watch + notifications to the server, such as vscode, nvim, or sublime-lsp. +- Node.js `^18.18.0 || >=20.9.0` or later is required. +- (for now) a graphql config file is required ### Installation From 4fa615db259f1e6b618577c7ddfd9765c29184fa Mon Sep 17 00:00:00 2001 From: Rikki Schulte Date: Tue, 28 May 2024 08:54:34 +0200 Subject: [PATCH 23/81] fix changeset pkg scope (#3614) --- .changeset/rotten-seahorses-fry.md | 2 +- .changeset/wet-toes-mate.md | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.changeset/rotten-seahorses-fry.md b/.changeset/rotten-seahorses-fry.md index 7347f6d0a92..0de3cf444b1 100644 --- a/.changeset/rotten-seahorses-fry.md +++ b/.changeset/rotten-seahorses-fry.md @@ -1,7 +1,7 @@ --- 'graphql-language-service-server': minor 'vscode-graphql': minor -'graphql-language-service-server-cli': minor +'graphql-language-service-cli': minor --- Fix many schema and fragment lifecycle issues, not all of them, but many related to cacheing. diff --git a/.changeset/wet-toes-mate.md b/.changeset/wet-toes-mate.md index fa26a5470d6..df368994594 100644 --- a/.changeset/wet-toes-mate.md +++ b/.changeset/wet-toes-mate.md @@ -1,5 +1,6 @@ --- 'graphql-language-service-server': minor +'graphql-language-service-cli': patch 'vscode-graphql': patch --- @@ -40,13 +41,13 @@ export default { import { type LocateCommand } from 'graphql-language-service-server'; // relay LSP style -const languageCommand = (projectName: string, typePath: string) => { +const locateCommand = (projectName: string, typePath: string) => { const { path, startLine, endLine } = ourLookupUtility(projectName, typePath); return `${path}:${startLine}:${endLine}`; }; // an example with our alternative return signature -const languageCommand: LocateCommand = (projectName, typePath, info) => { +const locateCommand: LocateCommand = (projectName, typePath, info) => { // pass more info, such as GraphQLType with the ast node. info.project is also available if you need it const { path, range } = ourLookupUtility( projectName, From c63d14e351da2981b8fa857abf1f121257f164dd Mon Sep 17 00:00:00 2001 From: Rikki Schulte Date: Tue, 28 May 2024 09:00:27 +0200 Subject: [PATCH 24/81] changeset typo (#3615) --- .changeset/silly-yaks-bathe.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/silly-yaks-bathe.md b/.changeset/silly-yaks-bathe.md index d88566186a6..6985c27c4ad 100644 --- a/.changeset/silly-yaks-bathe.md +++ b/.changeset/silly-yaks-bathe.md @@ -1,7 +1,7 @@ --- 'graphql-language-service': patch 'graphql-language-service-server': patch -'graphql-language-service-server-cli': patch +'graphql-language-service-cli': patch 'codemirror-graphql': patch 'cm6-graphql': patch 'monaco-graphql': patch From cef97aaa78e49feffa8f814d9fd2436bce62bb24 Mon Sep 17 00:00:00 2001 From: Rikki Schulte Date: Tue, 28 May 2024 09:09:32 +0200 Subject: [PATCH 25/81] fix locateCommand changset notes (#3616) --- .changeset/wet-toes-mate.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.changeset/wet-toes-mate.md b/.changeset/wet-toes-mate.md index df368994594..e15788d5968 100644 --- a/.changeset/wet-toes-mate.md +++ b/.changeset/wet-toes-mate.md @@ -6,13 +6,13 @@ Introduce `locateCommand` based on Relay LSP `pathToLocateCommand`: -Now with `.extensions.languageService.locateCommand`, you can specify either the [existing signature](https://marketplace.visualstudio.com/items?itemName=meta.relay#relay.pathtolocatecommand-default-null) for relay, with the same callback parameters and return signature. +Now with `.extensions.languageService.locateCommand`, you can specify either the [existing signature](https://marketplace.visualstudio.com/items?itemName=meta.relay#relay.pathtolocatecommand-default-null) for relay, with the same callback parameters and return signature (of a string delimited by `:` characters), or you can return an object with {uri, range} for the exact set of coordinates for the destination range. the function can be sync or async. Relay LSP currently supports `Type` and `Type.field` for the 2nd argument. Ours also returns `Type.field(argument)` as a point of reference. It works with object types, input types, fragments, executable definitions and their fields, and should work for directive definitions as well. In the case of unnamed types such as fragment spreads, they return the name of the implemented type currently, but I'm curious what users prefer here. I assumed that some people may want to not be limited to only using this for SDL type definition lookups. Also look soon to see `locateCommand` support added for symbols, outline, and coming references and implementations. -The module at the path you specify in relay LSP for `pathToLocateCommand` should work as such +The module at the path you specify in relay LSP for `pathToLocateCommand` should work as such. ```ts // import it From fa0e7f7a141d10a78e8773cf723781e265fba470 Mon Sep 17 00:00:00 2001 From: Jake Harclerode Date: Tue, 28 May 2024 00:20:40 -0700 Subject: [PATCH 26/81] remove unused useState import (#3604) --- packages/graphiql-plugin-explorer/README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/graphiql-plugin-explorer/README.md b/packages/graphiql-plugin-explorer/README.md index 232d8fd1554..2341b549efb 100644 --- a/packages/graphiql-plugin-explorer/README.md +++ b/packages/graphiql-plugin-explorer/README.md @@ -25,7 +25,6 @@ npm i -S react react-dom graphql import { explorerPlugin } from '@graphiql/plugin-explorer'; import { createGraphiQLFetcher } from '@graphiql/toolkit'; import { GraphiQL } from 'graphiql'; -import { useState } from 'react'; import 'graphiql/graphiql.css'; import '@graphiql/plugin-explorer/dist/style.css'; From c1268783c2fe1ca40d61e52cdd3b360ba5868768 Mon Sep 17 00:00:00 2001 From: Rikki Schulte Date: Fri, 31 May 2024 21:37:37 +0200 Subject: [PATCH 27/81] Version Packages (#3603) Co-authored-by: github-actions[bot] --- .changeset/nervous-numbers-push.md | 5 - .changeset/rotten-seahorses-fry.md | 46 ------- .changeset/silly-yaks-bathe.md | 15 --- .changeset/wet-toes-mate.md | 73 ---------- examples/graphiql-webpack/package.json | 8 +- examples/monaco-graphql-nextjs/package.json | 2 +- .../monaco-graphql-react-vite/package.json | 4 +- examples/monaco-graphql-webpack/package.json | 4 +- packages/cm6-graphql/CHANGELOG.md | 13 ++ packages/cm6-graphql/package.json | 4 +- packages/codemirror-graphql/CHANGELOG.md | 13 ++ packages/codemirror-graphql/package.json | 4 +- .../CHANGELOG.md | 7 + .../package.json | 6 +- .../graphiql-plugin-explorer/CHANGELOG.md | 7 + .../graphiql-plugin-explorer/package.json | 6 +- packages/graphiql-react/CHANGELOG.md | 10 ++ packages/graphiql-react/package.json | 6 +- packages/graphiql/CHANGELOG.md | 8 ++ packages/graphiql/package.json | 6 +- .../graphql-language-service-cli/CHANGELOG.md | 126 ++++++++++++++++++ .../graphql-language-service-cli/package.json | 6 +- .../CHANGELOG.md | 125 +++++++++++++++++ .../package.json | 4 +- .../graphql-language-service/CHANGELOG.md | 10 ++ .../graphql-language-service/package.json | 2 +- packages/monaco-graphql/CHANGELOG.md | 13 ++ packages/monaco-graphql/package.json | 4 +- packages/vscode-graphql/CHANGELOG.md | 125 +++++++++++++++++ packages/vscode-graphql/package.json | 4 +- 30 files changed, 492 insertions(+), 174 deletions(-) delete mode 100644 .changeset/nervous-numbers-push.md delete mode 100644 .changeset/rotten-seahorses-fry.md delete mode 100644 .changeset/silly-yaks-bathe.md delete mode 100644 .changeset/wet-toes-mate.md diff --git a/.changeset/nervous-numbers-push.md b/.changeset/nervous-numbers-push.md deleted file mode 100644 index 0ad8006a086..00000000000 --- a/.changeset/nervous-numbers-push.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@graphiql/react': patch ---- - -Avoid using deprecated Component.defaultProps for icon titles diff --git a/.changeset/rotten-seahorses-fry.md b/.changeset/rotten-seahorses-fry.md deleted file mode 100644 index 0de3cf444b1..00000000000 --- a/.changeset/rotten-seahorses-fry.md +++ /dev/null @@ -1,46 +0,0 @@ ---- -'graphql-language-service-server': minor -'vscode-graphql': minor -'graphql-language-service-cli': minor ---- - -Fix many schema and fragment lifecycle issues, not all of them, but many related to cacheing. -Note: this makes `cacheSchemaForLookup` enabled by default again for schema first contexts. - -This fixes multiple cacheing bugs, upon addomg some in-depth integration test coverage for the LSP server. -It also solves several bugs regarding loading config types, and properly restarts the server and invalidates schema when there are config changes. - -### Bugfix Summary - -- configurable polling updates for network and other code first schema configuration, set to a 30s interval by default. powered by `schemaCacheTTL` which can be configured in the IDE settings (vscode, nvim) or in the graphql config file. (1) -- jump to definition in embedded files offset bug, for both fragments and code files with SDL strings -- cache invalidation for fragments (fragment lookup/autcoomplete data is more accurate, but incomplete/invalid fragments still do not autocomplete or validate, and remember fragment options always filter/validate by the `on` type!) -- schema cache invalidation for schema files - schema updates as you change the SDL files, and the generated file for code first by the `schemaCacheTTL` setting -- schema definition lookups & autocomplete crossing over into the wrong project - -**Notes** - -1. If possible, configuring for your locally running framework or a schema registry client to handle schema updates and output to a `schema.graphql` or `introspection.json` will always provide a better experience. many graphql frameworks have this built in! Otherwise, we must use this new lazy polling approach if you provide a url schema (this includes both introspection URLs and remote file URLs, and the combination of these). - -### Known Bugs Fixed - -- #3318 -- #2357 -- #3469 -- #2422 -- #2820 -- many more! - -### Test Improvements - -- new, high level integration spec suite for the LSP with a matching test utility -- more unit test coverage -- **total increased test coverage of about 25% in the LSP server codebase.** -- many "happy paths" covered for both schema and code first contexts -- many bugs revealed (and their source) - -### What's next? - -Another stage of the rewrite is already almost ready. This will fix even more bugs and improve memory usage, eliminate redundant parsing and ensure that graphql config's loaders do _all_ of the parsing and heavy lifting, thus honoring all the configs as well. It also significantly reduces the code complexity. - -There is also a plan to match Relay LSP's lookup config for either IDE (vscode, nvm, etc) settings as they provide, or by loading modules into your `graphql-config`! diff --git a/.changeset/silly-yaks-bathe.md b/.changeset/silly-yaks-bathe.md deleted file mode 100644 index 6985c27c4ad..00000000000 --- a/.changeset/silly-yaks-bathe.md +++ /dev/null @@ -1,15 +0,0 @@ ---- -'graphql-language-service': patch -'graphql-language-service-server': patch -'graphql-language-service-cli': patch -'codemirror-graphql': patch -'cm6-graphql': patch -'monaco-graphql': patch -'vscode-graphql': patch ---- - -Fixes several issues with Type System (SDL) completion across the ecosystem: - -- restores completion for object and input type fields when the document context is not detectable or parseable -- correct top-level completions for either of the unknown, type system or executable definitions. this leads to mixed top level completions when the document is unparseable, but now you are not seemingly restricted to only executable top level definitions -- `.graphqls` ad-hoc standard functionality remains, but is not required, as it is not part of the official spec, and the spec also allows mixed mode documents in theory, and this concept is required when the type is unknown diff --git a/.changeset/wet-toes-mate.md b/.changeset/wet-toes-mate.md deleted file mode 100644 index e15788d5968..00000000000 --- a/.changeset/wet-toes-mate.md +++ /dev/null @@ -1,73 +0,0 @@ ---- -'graphql-language-service-server': minor -'graphql-language-service-cli': patch -'vscode-graphql': patch ---- - -Introduce `locateCommand` based on Relay LSP `pathToLocateCommand`: - -Now with `.extensions.languageService.locateCommand`, you can specify either the [existing signature](https://marketplace.visualstudio.com/items?itemName=meta.relay#relay.pathtolocatecommand-default-null) for relay, with the same callback parameters and return signature (of a string delimited by `:` characters), or you can return an object with {uri, range} for the exact set of coordinates for the destination range. the function can be sync or async. - -Relay LSP currently supports `Type` and `Type.field` for the 2nd argument. Ours also returns `Type.field(argument)` as a point of reference. It works with object types, input types, fragments, executable definitions and their fields, and should work for directive definitions as well. - -In the case of unnamed types such as fragment spreads, they return the name of the implemented type currently, but I'm curious what users prefer here. I assumed that some people may want to not be limited to only using this for SDL type definition lookups. Also look soon to see `locateCommand` support added for symbols, outline, and coming references and implementations. - -The module at the path you specify in relay LSP for `pathToLocateCommand` should work as such. - -```ts -// import it -import { locateCommand } from './graphql/tooling/lsp/locate.js'; -export default { - languageService: { - locateCommand, - }, - - projects: { - a: { - schema: 'https://localhost:8000/graphql', - documents: './a/**/*.{ts,tsx,jsx,js,graphql}', - }, - b: { - schema: './schema/ascode.ts', - documents: './b/**/*.{ts,tsx,jsx,js,graphql}', - }, - }, -}; -``` - -```ts -// or define it inline - -import { type LocateCommand } from 'graphql-language-service-server'; - -// relay LSP style -const locateCommand = (projectName: string, typePath: string) => { - const { path, startLine, endLine } = ourLookupUtility(projectName, typePath); - return `${path}:${startLine}:${endLine}`; -}; - -// an example with our alternative return signature -const locateCommand: LocateCommand = (projectName, typePath, info) => { - // pass more info, such as GraphQLType with the ast node. info.project is also available if you need it - const { path, range } = ourLookupUtility( - projectName, - typePath, - info.type.node, - ); - return { uri: path, range }; // range.start.line/range.end.line -}; - -export default { - languageService: { - locateCommand, - }, - schema: 'https://localhost:8000/graphql', - documents: './**/*.{ts,tsx,jsx,js,graphql}', -}; -``` - -Passing a string as a module path to resolve is coming in a follow-up release. Then it can be used with `.yml`, `.toml`, `.json`, `package.json#graphql`, etc - -For now this was a quick baseline for a feature asked for in multiple channels! - -Let us know how this works, and about any other interoperability improvements between our graphql LSP and other language servers (relay, intellij, etc) used by you and colleauges in your engineering organisations. We are trying our best to keep up with the awesome innovations they have 👀! diff --git a/examples/graphiql-webpack/package.json b/examples/graphiql-webpack/package.json index 64bf041cae5..ae50adf54c4 100644 --- a/examples/graphiql-webpack/package.json +++ b/examples/graphiql-webpack/package.json @@ -9,11 +9,11 @@ "start": "NODE_ENV=development webpack-cli serve" }, "dependencies": { - "@graphiql/plugin-code-exporter": "^3.0.1", - "@graphiql/plugin-explorer": "^3.0.1", + "@graphiql/plugin-code-exporter": "^3.0.2", + "@graphiql/plugin-explorer": "^3.0.2", "@graphiql/toolkit": "^0.9.1", - "@graphiql/react": "^0.22.1", - "graphiql": "^3.2.2", + "@graphiql/react": "^0.22.2", + "graphiql": "^3.2.3", "graphql": "^16.8.1", "graphql-ws": "^5.5.5", "react": "^18.2.0", diff --git a/examples/monaco-graphql-nextjs/package.json b/examples/monaco-graphql-nextjs/package.json index 05cef35efbf..15fffa52554 100644 --- a/examples/monaco-graphql-nextjs/package.json +++ b/examples/monaco-graphql-nextjs/package.json @@ -16,7 +16,7 @@ "marked": "^4.2.12", "monaco-editor": "^0.39.0", "monaco-editor-webpack-plugin": "^7.0.1", - "monaco-graphql": "^1.5.1", + "monaco-graphql": "^1.5.2", "next": "13.4.7", "prettier": "3.0.0-alpha.12", "react": "^18.2.0", diff --git a/examples/monaco-graphql-react-vite/package.json b/examples/monaco-graphql-react-vite/package.json index 6d526a81da8..1d4b73d15c0 100644 --- a/examples/monaco-graphql-react-vite/package.json +++ b/examples/monaco-graphql-react-vite/package.json @@ -5,10 +5,10 @@ "dependencies": { "@graphiql/toolkit": "^0.9.1", "graphql": "^16.8.1", - "graphql-language-service": "^5.2.0", + "graphql-language-service": "^5.2.1", "jsonc-parser": "^3.2.0", "monaco-editor": "^0.39.0", - "monaco-graphql": "^1.5.1", + "monaco-graphql": "^1.5.2", "prettier": "3.0.0-alpha.12", "react": "^18.2.0", "react-dom": "^18.2.0" diff --git a/examples/monaco-graphql-webpack/package.json b/examples/monaco-graphql-webpack/package.json index 326e255d60e..c02fd42949c 100644 --- a/examples/monaco-graphql-webpack/package.json +++ b/examples/monaco-graphql-webpack/package.json @@ -10,11 +10,11 @@ }, "dependencies": { "graphql": "^16.8.1", - "graphql-language-service": "^5.2.0", + "graphql-language-service": "^5.2.1", "json-schema": "^0.4.0", "jsonc-parser": "^3.2.0", "monaco-editor": "^0.39.0", - "monaco-graphql": "^1.5.1", + "monaco-graphql": "^1.5.2", "prettier": "3.0.0-alpha.12" }, "devDependencies": { diff --git a/packages/cm6-graphql/CHANGELOG.md b/packages/cm6-graphql/CHANGELOG.md index 2ca0b97375d..840ee2a0c4d 100644 --- a/packages/cm6-graphql/CHANGELOG.md +++ b/packages/cm6-graphql/CHANGELOG.md @@ -1,5 +1,18 @@ # cm6-graphql +## 0.0.15 + +### Patch Changes + +- [#3521](https://github.com/graphql/graphiql/pull/3521) [`aa6dbbb4`](https://github.com/graphql/graphiql/commit/aa6dbbb45bf51c1966537640fbe5c4f375735c8d) Thanks [@acao](https://github.com/acao)! - Fixes several issues with Type System (SDL) completion across the ecosystem: + + - restores completion for object and input type fields when the document context is not detectable or parseable + - correct top-level completions for either of the unknown, type system or executable definitions. this leads to mixed top level completions when the document is unparseable, but now you are not seemingly restricted to only executable top level definitions + - `.graphqls` ad-hoc standard functionality remains, but is not required, as it is not part of the official spec, and the spec also allows mixed mode documents in theory, and this concept is required when the type is unknown + +- Updated dependencies [[`aa6dbbb4`](https://github.com/graphql/graphiql/commit/aa6dbbb45bf51c1966537640fbe5c4f375735c8d)]: + - graphql-language-service@5.2.1 + ## 0.0.14 ### Patch Changes diff --git a/packages/cm6-graphql/package.json b/packages/cm6-graphql/package.json index 2bccde915c4..74a3fb5832c 100644 --- a/packages/cm6-graphql/package.json +++ b/packages/cm6-graphql/package.json @@ -1,6 +1,6 @@ { "name": "cm6-graphql", - "version": "0.0.14", + "version": "0.0.15", "description": "GraphQL language support for CodeMirror 6", "scripts": { "build": "cm-buildhelper src/index.ts", @@ -16,7 +16,7 @@ "types": "dist/index.d.ts", "sideEffects": false, "dependencies": { - "graphql-language-service": "^5.2.0" + "graphql-language-service": "^5.2.1" }, "devDependencies": { "@codemirror/autocomplete": "6.2.0", diff --git a/packages/codemirror-graphql/CHANGELOG.md b/packages/codemirror-graphql/CHANGELOG.md index 764d8d84630..5d9c7a482b8 100644 --- a/packages/codemirror-graphql/CHANGELOG.md +++ b/packages/codemirror-graphql/CHANGELOG.md @@ -1,5 +1,18 @@ # Change Log +## 2.0.12 + +### Patch Changes + +- [#3521](https://github.com/graphql/graphiql/pull/3521) [`aa6dbbb4`](https://github.com/graphql/graphiql/commit/aa6dbbb45bf51c1966537640fbe5c4f375735c8d) Thanks [@acao](https://github.com/acao)! - Fixes several issues with Type System (SDL) completion across the ecosystem: + + - restores completion for object and input type fields when the document context is not detectable or parseable + - correct top-level completions for either of the unknown, type system or executable definitions. this leads to mixed top level completions when the document is unparseable, but now you are not seemingly restricted to only executable top level definitions + - `.graphqls` ad-hoc standard functionality remains, but is not required, as it is not part of the official spec, and the spec also allows mixed mode documents in theory, and this concept is required when the type is unknown + +- Updated dependencies [[`aa6dbbb4`](https://github.com/graphql/graphiql/commit/aa6dbbb45bf51c1966537640fbe5c4f375735c8d)]: + - graphql-language-service@5.2.1 + ## 2.0.11 ### Patch Changes diff --git a/packages/codemirror-graphql/package.json b/packages/codemirror-graphql/package.json index 378130d9bc5..2d0f1e79f23 100644 --- a/packages/codemirror-graphql/package.json +++ b/packages/codemirror-graphql/package.json @@ -1,6 +1,6 @@ { "name": "codemirror-graphql", - "version": "2.0.11", + "version": "2.0.12", "description": "GraphQL mode and helpers for CodeMirror.", "contributors": [ "Hyohyeon Jeong ", @@ -45,7 +45,7 @@ "// TEMPORARILY PINNED until we fix graphql 15 support": "", "dependencies": { "@types/codemirror": "^0.0.90", - "graphql-language-service": "5.2.0" + "graphql-language-service": "5.2.1" }, "devDependencies": { "@codemirror/language": "^6.0.0", diff --git a/packages/graphiql-plugin-code-exporter/CHANGELOG.md b/packages/graphiql-plugin-code-exporter/CHANGELOG.md index 78b3b38bf64..dcf374850fb 100644 --- a/packages/graphiql-plugin-code-exporter/CHANGELOG.md +++ b/packages/graphiql-plugin-code-exporter/CHANGELOG.md @@ -1,5 +1,12 @@ # @graphiql/plugin-code-exporter +## 3.0.2 + +### Patch Changes + +- Updated dependencies [[`03ab3a6b`](https://github.com/graphql/graphiql/commit/03ab3a6b76378591ef79a828d80cc69b0b8f2842)]: + - @graphiql/react@0.22.2 + ## 3.0.1 ### Patch Changes diff --git a/packages/graphiql-plugin-code-exporter/package.json b/packages/graphiql-plugin-code-exporter/package.json index 7f4b2d55114..37e6628d68a 100644 --- a/packages/graphiql-plugin-code-exporter/package.json +++ b/packages/graphiql-plugin-code-exporter/package.json @@ -1,6 +1,6 @@ { "name": "@graphiql/plugin-code-exporter", - "version": "3.0.1", + "version": "3.0.2", "repository": { "type": "git", "url": "https://github.com/graphql/graphiql", @@ -33,13 +33,13 @@ "graphiql-code-exporter": "^3.0.3" }, "peerDependencies": { - "@graphiql/react": "^0.22.1", + "@graphiql/react": "^0.22.2", "graphql": "^15.5.0 || ^16.0.0", "react": "^16.8.0 || ^17 || ^18", "react-dom": "^16.8.0 || ^17 || ^18" }, "devDependencies": { - "@graphiql/react": "^0.22.1", + "@graphiql/react": "^0.22.2", "@vitejs/plugin-react": "^4.0.1", "graphql": "^16.8.1", "postcss-nesting": "^10.1.7", diff --git a/packages/graphiql-plugin-explorer/CHANGELOG.md b/packages/graphiql-plugin-explorer/CHANGELOG.md index 33b80a5f6cb..77ad2a056dc 100644 --- a/packages/graphiql-plugin-explorer/CHANGELOG.md +++ b/packages/graphiql-plugin-explorer/CHANGELOG.md @@ -1,5 +1,12 @@ # @graphiql/plugin-explorer +## 3.0.2 + +### Patch Changes + +- Updated dependencies [[`03ab3a6b`](https://github.com/graphql/graphiql/commit/03ab3a6b76378591ef79a828d80cc69b0b8f2842)]: + - @graphiql/react@0.22.2 + ## 3.0.1 ### Patch Changes diff --git a/packages/graphiql-plugin-explorer/package.json b/packages/graphiql-plugin-explorer/package.json index 6af385e41ec..52cb8104603 100644 --- a/packages/graphiql-plugin-explorer/package.json +++ b/packages/graphiql-plugin-explorer/package.json @@ -1,6 +1,6 @@ { "name": "@graphiql/plugin-explorer", - "version": "3.0.1", + "version": "3.0.2", "repository": { "type": "git", "url": "https://github.com/graphql/graphiql", @@ -32,13 +32,13 @@ "graphiql-explorer": "^0.9.0" }, "peerDependencies": { - "@graphiql/react": "^0.22.1", + "@graphiql/react": "^0.22.2", "graphql": "^15.5.0 || ^16.0.0", "react": "^16.8.0 || ^17 || ^18", "react-dom": "^16.8.0 || ^17 || ^18" }, "devDependencies": { - "@graphiql/react": "^0.22.1", + "@graphiql/react": "^0.22.2", "@vitejs/plugin-react": "^4.0.1", "graphql": "^16.8.1", "react": "^18.2.0", diff --git a/packages/graphiql-react/CHANGELOG.md b/packages/graphiql-react/CHANGELOG.md index 15895848fcb..173d9b1079e 100644 --- a/packages/graphiql-react/CHANGELOG.md +++ b/packages/graphiql-react/CHANGELOG.md @@ -1,5 +1,15 @@ # @graphiql/react +## 0.22.2 + +### Patch Changes + +- [#3602](https://github.com/graphql/graphiql/pull/3602) [`03ab3a6b`](https://github.com/graphql/graphiql/commit/03ab3a6b76378591ef79a828d80cc69b0b8f2842) Thanks [@thomasheyenbrock](https://github.com/thomasheyenbrock)! - Avoid using deprecated Component.defaultProps for icon titles + +- Updated dependencies [[`aa6dbbb4`](https://github.com/graphql/graphiql/commit/aa6dbbb45bf51c1966537640fbe5c4f375735c8d)]: + - graphql-language-service@5.2.1 + - codemirror-graphql@2.0.12 + ## 0.22.1 ### Patch Changes diff --git a/packages/graphiql-react/package.json b/packages/graphiql-react/package.json index 37c2a69330a..fe982ae5dab 100644 --- a/packages/graphiql-react/package.json +++ b/packages/graphiql-react/package.json @@ -1,6 +1,6 @@ { "name": "@graphiql/react", - "version": "0.22.1", + "version": "0.22.2", "repository": { "type": "git", "url": "https://github.com/graphql/graphiql", @@ -57,10 +57,10 @@ "@types/codemirror": "^5.60.8", "clsx": "^1.2.1", "codemirror": "^5.65.3", - "codemirror-graphql": "^2.0.11", + "codemirror-graphql": "^2.0.12", "copy-to-clipboard": "^3.2.0", "framer-motion": "^6.5.1", - "graphql-language-service": "^5.2.0", + "graphql-language-service": "^5.2.1", "markdown-it": "^14.1.0", "set-value": "^4.1.0" }, diff --git a/packages/graphiql/CHANGELOG.md b/packages/graphiql/CHANGELOG.md index 2cfd2642d34..1b252105180 100644 --- a/packages/graphiql/CHANGELOG.md +++ b/packages/graphiql/CHANGELOG.md @@ -1,5 +1,13 @@ # Change Log +## 3.2.3 + +### Patch Changes + +- Updated dependencies [[`03ab3a6b`](https://github.com/graphql/graphiql/commit/03ab3a6b76378591ef79a828d80cc69b0b8f2842), [`aa6dbbb4`](https://github.com/graphql/graphiql/commit/aa6dbbb45bf51c1966537640fbe5c4f375735c8d)]: + - @graphiql/react@0.22.2 + - graphql-language-service@5.2.1 + ## 3.2.2 ### Patch Changes diff --git a/packages/graphiql/package.json b/packages/graphiql/package.json index 787cb1051d3..75af4899c98 100644 --- a/packages/graphiql/package.json +++ b/packages/graphiql/package.json @@ -1,6 +1,6 @@ { "name": "graphiql", - "version": "3.2.2", + "version": "3.2.3", "description": "An graphical interactive in-browser GraphQL IDE.", "contributors": [ "Hyohyeon Jeong ", @@ -47,9 +47,9 @@ "webpack": "webpack-cli --config resources/webpack.config.js" }, "dependencies": { - "@graphiql/react": "^0.22.1", + "@graphiql/react": "^0.22.2", "@graphiql/toolkit": "^0.9.1", - "graphql-language-service": "^5.2.0", + "graphql-language-service": "^5.2.1", "markdown-it": "^14.1.0" }, "peerDependencies": { diff --git a/packages/graphql-language-service-cli/CHANGELOG.md b/packages/graphql-language-service-cli/CHANGELOG.md index 7434288d1e4..d2f63744376 100644 --- a/packages/graphql-language-service-cli/CHANGELOG.md +++ b/packages/graphql-language-service-cli/CHANGELOG.md @@ -1,5 +1,131 @@ # graphql-language-service-cli +## 3.4.0 + +### Minor Changes + +- [#3521](https://github.com/graphql/graphiql/pull/3521) [`aa6dbbb4`](https://github.com/graphql/graphiql/commit/aa6dbbb45bf51c1966537640fbe5c4f375735c8d) Thanks [@acao](https://github.com/acao)! - Fix many schema and fragment lifecycle issues, not all of them, but many related to cacheing. Note: this makes `cacheSchemaForLookup` enabled by default again for schema first contexts. + + This fixes multiple cacheing bugs, upon addomg some in-depth integration test coverage for the LSP server. It also solves several bugs regarding loading config types, and properly restarts the server and invalidates schema when there are config changes. + + ### Bugfix Summary + + - configurable polling updates for network and other code first schema configuration, set to a 30s interval by default. powered by `schemaCacheTTL` which can be configured in the IDE settings (vscode, nvim) or in the graphql config file. (1) + - jump to definition in embedded files offset bug, for both fragments and code files with SDL strings + - cache invalidation for fragments (fragment lookup/autcoomplete data is more accurate, but incomplete/invalid fragments still do not autocomplete or validate, and remember fragment options always filter/validate by the `on` type!) + - schema cache invalidation for schema files - schema updates as you change the SDL files, and the generated file for code first by the `schemaCacheTTL` setting + - schema definition lookups & autocomplete crossing over into the wrong project + + **Notes** + + 1. If possible, configuring for your locally running framework or a schema registry client to handle schema updates and output to a `schema.graphql` or `introspection.json` will always provide a better experience. many graphql frameworks have this built in! Otherwise, we must use this new lazy polling approach if you provide a url schema (this includes both introspection URLs and remote file URLs, and the combination of these). + + ### Known Bugs Fixed + + - #3318 + - #2357 + - #3469 + - #2422 + - #2820 + - many more! + + ### Test Improvements + + - new, high level integration spec suite for the LSP with a matching test utility + - more unit test coverage + - **total increased test coverage of about 25% in the LSP server codebase.** + - many "happy paths" covered for both schema and code first contexts + - many bugs revealed (and their source) + + ### What's next? + + Another stage of the rewrite is already almost ready. This will fix even more bugs and improve memory usage, eliminate redundant parsing and ensure that graphql config's loaders do _all_ of the parsing and heavy lifting, thus honoring all the configs as well. It also significantly reduces the code complexity. + + There is also a plan to match Relay LSP's lookup config for either IDE (vscode, nvm, etc) settings as they provide, or by loading modules into your `graphql-config`! + +### Patch Changes + +- [#3521](https://github.com/graphql/graphiql/pull/3521) [`aa6dbbb4`](https://github.com/graphql/graphiql/commit/aa6dbbb45bf51c1966537640fbe5c4f375735c8d) Thanks [@acao](https://github.com/acao)! - Fixes several issues with Type System (SDL) completion across the ecosystem: + + - restores completion for object and input type fields when the document context is not detectable or parseable + - correct top-level completions for either of the unknown, type system or executable definitions. this leads to mixed top level completions when the document is unparseable, but now you are not seemingly restricted to only executable top level definitions + - `.graphqls` ad-hoc standard functionality remains, but is not required, as it is not part of the official spec, and the spec also allows mixed mode documents in theory, and this concept is required when the type is unknown + +- [#3521](https://github.com/graphql/graphiql/pull/3521) [`aa6dbbb4`](https://github.com/graphql/graphiql/commit/aa6dbbb45bf51c1966537640fbe5c4f375735c8d) Thanks [@acao](https://github.com/acao)! - Introduce `locateCommand` based on Relay LSP `pathToLocateCommand`: + + Now with `.extensions.languageService.locateCommand`, you can specify either the [existing signature](https://marketplace.visualstudio.com/items?itemName=meta.relay#relay.pathtolocatecommand-default-null) for relay, with the same callback parameters and return signature (of a string delimited by `:` characters), or you can return an object with {uri, range} for the exact set of coordinates for the destination range. the function can be sync or async. + + Relay LSP currently supports `Type` and `Type.field` for the 2nd argument. Ours also returns `Type.field(argument)` as a point of reference. It works with object types, input types, fragments, executable definitions and their fields, and should work for directive definitions as well. + + In the case of unnamed types such as fragment spreads, they return the name of the implemented type currently, but I'm curious what users prefer here. I assumed that some people may want to not be limited to only using this for SDL type definition lookups. Also look soon to see `locateCommand` support added for symbols, outline, and coming references and implementations. + + The module at the path you specify in relay LSP for `pathToLocateCommand` should work as such. + + ```ts + // import it + import { locateCommand } from './graphql/tooling/lsp/locate.js'; + export default { + languageService: { + locateCommand, + }, + + projects: { + a: { + schema: 'https://localhost:8000/graphql', + documents: './a/**/*.{ts,tsx,jsx,js,graphql}', + }, + b: { + schema: './schema/ascode.ts', + documents: './b/**/*.{ts,tsx,jsx,js,graphql}', + }, + }, + }; + ``` + + ```ts + // or define it inline + + import { type LocateCommand } from 'graphql-language-service-server'; + + // relay LSP style + const locateCommand = (projectName: string, typePath: string) => { + const { path, startLine, endLine } = ourLookupUtility( + projectName, + typePath, + ); + return `${path}:${startLine}:${endLine}`; + }; + + // an example with our alternative return signature + const locateCommand: LocateCommand = (projectName, typePath, info) => { + // pass more info, such as GraphQLType with the ast node. info.project is also available if you need it + const { path, range } = ourLookupUtility( + projectName, + typePath, + info.type.node, + ); + return { uri: path, range }; // range.start.line/range.end.line + }; + + export default { + languageService: { + locateCommand, + }, + schema: 'https://localhost:8000/graphql', + documents: './**/*.{ts,tsx,jsx,js,graphql}', + }; + ``` + + Passing a string as a module path to resolve is coming in a follow-up release. Then it can be used with `.yml`, `.toml`, `.json`, `package.json#graphql`, etc + + For now this was a quick baseline for a feature asked for in multiple channels! + + Let us know how this works, and about any other interoperability improvements between our graphql LSP and other language servers (relay, intellij, etc) used by you and colleauges in your engineering organisations. We are trying our best to keep up with the awesome innovations they have 👀! + +- Updated dependencies [[`aa6dbbb4`](https://github.com/graphql/graphiql/commit/aa6dbbb45bf51c1966537640fbe5c4f375735c8d), [`aa6dbbb4`](https://github.com/graphql/graphiql/commit/aa6dbbb45bf51c1966537640fbe5c4f375735c8d), [`aa6dbbb4`](https://github.com/graphql/graphiql/commit/aa6dbbb45bf51c1966537640fbe5c4f375735c8d)]: + - graphql-language-service-server@2.13.0 + - graphql-language-service@5.2.1 + ## 3.3.33 ### Patch Changes diff --git a/packages/graphql-language-service-cli/package.json b/packages/graphql-language-service-cli/package.json index 01983e5cf36..fee9a466fd3 100644 --- a/packages/graphql-language-service-cli/package.json +++ b/packages/graphql-language-service-cli/package.json @@ -1,6 +1,6 @@ { "name": "graphql-language-service-cli", - "version": "3.3.33", + "version": "3.4.0", "description": "An interface for building GraphQL language services for IDEs", "contributors": [ "Hyohyeon Jeong ", @@ -37,8 +37,8 @@ "dependencies": { "@babel/polyfill": "^7.12.1", "@types/yargs": "16.0.5", - "graphql-language-service": "^5.2.0", - "graphql-language-service-server": "^2.12.0", + "graphql-language-service": "^5.2.1", + "graphql-language-service-server": "^2.13.0", "yargs": "^16.2.0" }, "devDependencies": { diff --git a/packages/graphql-language-service-server/CHANGELOG.md b/packages/graphql-language-service-server/CHANGELOG.md index 52f894a5908..7fcb3ca71dc 100644 --- a/packages/graphql-language-service-server/CHANGELOG.md +++ b/packages/graphql-language-service-server/CHANGELOG.md @@ -1,5 +1,130 @@ # graphql-language-service-server +## 2.13.0 + +### Minor Changes + +- [#3521](https://github.com/graphql/graphiql/pull/3521) [`aa6dbbb4`](https://github.com/graphql/graphiql/commit/aa6dbbb45bf51c1966537640fbe5c4f375735c8d) Thanks [@acao](https://github.com/acao)! - Fix many schema and fragment lifecycle issues, not all of them, but many related to cacheing. Note: this makes `cacheSchemaForLookup` enabled by default again for schema first contexts. + + This fixes multiple cacheing bugs, upon addomg some in-depth integration test coverage for the LSP server. It also solves several bugs regarding loading config types, and properly restarts the server and invalidates schema when there are config changes. + + ### Bugfix Summary + + - configurable polling updates for network and other code first schema configuration, set to a 30s interval by default. powered by `schemaCacheTTL` which can be configured in the IDE settings (vscode, nvim) or in the graphql config file. (1) + - jump to definition in embedded files offset bug, for both fragments and code files with SDL strings + - cache invalidation for fragments (fragment lookup/autcoomplete data is more accurate, but incomplete/invalid fragments still do not autocomplete or validate, and remember fragment options always filter/validate by the `on` type!) + - schema cache invalidation for schema files - schema updates as you change the SDL files, and the generated file for code first by the `schemaCacheTTL` setting + - schema definition lookups & autocomplete crossing over into the wrong project + + **Notes** + + 1. If possible, configuring for your locally running framework or a schema registry client to handle schema updates and output to a `schema.graphql` or `introspection.json` will always provide a better experience. many graphql frameworks have this built in! Otherwise, we must use this new lazy polling approach if you provide a url schema (this includes both introspection URLs and remote file URLs, and the combination of these). + + ### Known Bugs Fixed + + - #3318 + - #2357 + - #3469 + - #2422 + - #2820 + - many more! + + ### Test Improvements + + - new, high level integration spec suite for the LSP with a matching test utility + - more unit test coverage + - **total increased test coverage of about 25% in the LSP server codebase.** + - many "happy paths" covered for both schema and code first contexts + - many bugs revealed (and their source) + + ### What's next? + + Another stage of the rewrite is already almost ready. This will fix even more bugs and improve memory usage, eliminate redundant parsing and ensure that graphql config's loaders do _all_ of the parsing and heavy lifting, thus honoring all the configs as well. It also significantly reduces the code complexity. + + There is also a plan to match Relay LSP's lookup config for either IDE (vscode, nvm, etc) settings as they provide, or by loading modules into your `graphql-config`! + +- [#3521](https://github.com/graphql/graphiql/pull/3521) [`aa6dbbb4`](https://github.com/graphql/graphiql/commit/aa6dbbb45bf51c1966537640fbe5c4f375735c8d) Thanks [@acao](https://github.com/acao)! - Introduce `locateCommand` based on Relay LSP `pathToLocateCommand`: + + Now with `.extensions.languageService.locateCommand`, you can specify either the [existing signature](https://marketplace.visualstudio.com/items?itemName=meta.relay#relay.pathtolocatecommand-default-null) for relay, with the same callback parameters and return signature (of a string delimited by `:` characters), or you can return an object with {uri, range} for the exact set of coordinates for the destination range. the function can be sync or async. + + Relay LSP currently supports `Type` and `Type.field` for the 2nd argument. Ours also returns `Type.field(argument)` as a point of reference. It works with object types, input types, fragments, executable definitions and their fields, and should work for directive definitions as well. + + In the case of unnamed types such as fragment spreads, they return the name of the implemented type currently, but I'm curious what users prefer here. I assumed that some people may want to not be limited to only using this for SDL type definition lookups. Also look soon to see `locateCommand` support added for symbols, outline, and coming references and implementations. + + The module at the path you specify in relay LSP for `pathToLocateCommand` should work as such. + + ```ts + // import it + import { locateCommand } from './graphql/tooling/lsp/locate.js'; + export default { + languageService: { + locateCommand, + }, + + projects: { + a: { + schema: 'https://localhost:8000/graphql', + documents: './a/**/*.{ts,tsx,jsx,js,graphql}', + }, + b: { + schema: './schema/ascode.ts', + documents: './b/**/*.{ts,tsx,jsx,js,graphql}', + }, + }, + }; + ``` + + ```ts + // or define it inline + + import { type LocateCommand } from 'graphql-language-service-server'; + + // relay LSP style + const locateCommand = (projectName: string, typePath: string) => { + const { path, startLine, endLine } = ourLookupUtility( + projectName, + typePath, + ); + return `${path}:${startLine}:${endLine}`; + }; + + // an example with our alternative return signature + const locateCommand: LocateCommand = (projectName, typePath, info) => { + // pass more info, such as GraphQLType with the ast node. info.project is also available if you need it + const { path, range } = ourLookupUtility( + projectName, + typePath, + info.type.node, + ); + return { uri: path, range }; // range.start.line/range.end.line + }; + + export default { + languageService: { + locateCommand, + }, + schema: 'https://localhost:8000/graphql', + documents: './**/*.{ts,tsx,jsx,js,graphql}', + }; + ``` + + Passing a string as a module path to resolve is coming in a follow-up release. Then it can be used with `.yml`, `.toml`, `.json`, `package.json#graphql`, etc + + For now this was a quick baseline for a feature asked for in multiple channels! + + Let us know how this works, and about any other interoperability improvements between our graphql LSP and other language servers (relay, intellij, etc) used by you and colleauges in your engineering organisations. We are trying our best to keep up with the awesome innovations they have 👀! + +### Patch Changes + +- [#3521](https://github.com/graphql/graphiql/pull/3521) [`aa6dbbb4`](https://github.com/graphql/graphiql/commit/aa6dbbb45bf51c1966537640fbe5c4f375735c8d) Thanks [@acao](https://github.com/acao)! - Fixes several issues with Type System (SDL) completion across the ecosystem: + + - restores completion for object and input type fields when the document context is not detectable or parseable + - correct top-level completions for either of the unknown, type system or executable definitions. this leads to mixed top level completions when the document is unparseable, but now you are not seemingly restricted to only executable top level definitions + - `.graphqls` ad-hoc standard functionality remains, but is not required, as it is not part of the official spec, and the spec also allows mixed mode documents in theory, and this concept is required when the type is unknown + +- Updated dependencies [[`aa6dbbb4`](https://github.com/graphql/graphiql/commit/aa6dbbb45bf51c1966537640fbe5c4f375735c8d)]: + - graphql-language-service@5.2.1 + ## 2.12.0 ### Minor Changes diff --git a/packages/graphql-language-service-server/package.json b/packages/graphql-language-service-server/package.json index c7eba908a12..c05661ed8cd 100644 --- a/packages/graphql-language-service-server/package.json +++ b/packages/graphql-language-service-server/package.json @@ -1,6 +1,6 @@ { "name": "graphql-language-service-server", - "version": "2.12.0", + "version": "2.13.0", "description": "Server process backing the GraphQL Language Service", "contributors": [ "Greg Hurrell (https://greg.hurrell.net/)", @@ -49,7 +49,7 @@ "fast-glob": "^3.2.7", "glob": "^7.2.0", "graphql-config": "5.0.3", - "graphql-language-service": "^5.2.0", + "graphql-language-service": "^5.2.1", "lru-cache": "^10.2.0", "mkdirp": "^1.0.4", "node-abort-controller": "^3.0.1", diff --git a/packages/graphql-language-service/CHANGELOG.md b/packages/graphql-language-service/CHANGELOG.md index d8589296583..00a9cd70ddf 100644 --- a/packages/graphql-language-service/CHANGELOG.md +++ b/packages/graphql-language-service/CHANGELOG.md @@ -1,5 +1,15 @@ # graphql-language-service +## 5.2.1 + +### Patch Changes + +- [#3521](https://github.com/graphql/graphiql/pull/3521) [`aa6dbbb4`](https://github.com/graphql/graphiql/commit/aa6dbbb45bf51c1966537640fbe5c4f375735c8d) Thanks [@acao](https://github.com/acao)! - Fixes several issues with Type System (SDL) completion across the ecosystem: + + - restores completion for object and input type fields when the document context is not detectable or parseable + - correct top-level completions for either of the unknown, type system or executable definitions. this leads to mixed top level completions when the document is unparseable, but now you are not seemingly restricted to only executable top level definitions + - `.graphqls` ad-hoc standard functionality remains, but is not required, as it is not part of the official spec, and the spec also allows mixed mode documents in theory, and this concept is required when the type is unknown + ## 5.2.0 ### Minor Changes diff --git a/packages/graphql-language-service/package.json b/packages/graphql-language-service/package.json index d83127558bf..14543d361d7 100644 --- a/packages/graphql-language-service/package.json +++ b/packages/graphql-language-service/package.json @@ -1,6 +1,6 @@ { "name": "graphql-language-service", - "version": "5.2.0", + "version": "5.2.1", "description": "The official, runtime independent Language Service for GraphQL", "contributors": [ "GraphQL Contributors" diff --git a/packages/monaco-graphql/CHANGELOG.md b/packages/monaco-graphql/CHANGELOG.md index a031ae46d7c..91eefdf320a 100644 --- a/packages/monaco-graphql/CHANGELOG.md +++ b/packages/monaco-graphql/CHANGELOG.md @@ -1,5 +1,18 @@ # Change Log +## 1.5.2 + +### Patch Changes + +- [#3521](https://github.com/graphql/graphiql/pull/3521) [`aa6dbbb4`](https://github.com/graphql/graphiql/commit/aa6dbbb45bf51c1966537640fbe5c4f375735c8d) Thanks [@acao](https://github.com/acao)! - Fixes several issues with Type System (SDL) completion across the ecosystem: + + - restores completion for object and input type fields when the document context is not detectable or parseable + - correct top-level completions for either of the unknown, type system or executable definitions. this leads to mixed top level completions when the document is unparseable, but now you are not seemingly restricted to only executable top level definitions + - `.graphqls` ad-hoc standard functionality remains, but is not required, as it is not part of the official spec, and the spec also allows mixed mode documents in theory, and this concept is required when the type is unknown + +- Updated dependencies [[`aa6dbbb4`](https://github.com/graphql/graphiql/commit/aa6dbbb45bf51c1966537640fbe5c4f375735c8d)]: + - graphql-language-service@5.2.1 + ## 1.5.1 ### Patch Changes diff --git a/packages/monaco-graphql/package.json b/packages/monaco-graphql/package.json index c9b32464ba4..fc5e3333719 100644 --- a/packages/monaco-graphql/package.json +++ b/packages/monaco-graphql/package.json @@ -1,7 +1,7 @@ { "name": "monaco-graphql", "description": "full service, official monaco mode for GraphQL", - "version": "1.5.1", + "version": "1.5.2", "license": "MIT", "main": "dist/monaco.contribution.js", "module": "esm/monaco.contribution.js", @@ -66,7 +66,7 @@ "test": "vitest run" }, "dependencies": { - "graphql-language-service": "^5.2.0", + "graphql-language-service": "^5.2.1", "picomatch-browser": "^2.2.6" }, "devDependencies": { diff --git a/packages/vscode-graphql/CHANGELOG.md b/packages/vscode-graphql/CHANGELOG.md index e931025739e..e8d51c0a0c6 100644 --- a/packages/vscode-graphql/CHANGELOG.md +++ b/packages/vscode-graphql/CHANGELOG.md @@ -1,5 +1,130 @@ # Change Log +## 0.11.0 + +### Minor Changes + +- [#3521](https://github.com/graphql/graphiql/pull/3521) [`aa6dbbb4`](https://github.com/graphql/graphiql/commit/aa6dbbb45bf51c1966537640fbe5c4f375735c8d) Thanks [@acao](https://github.com/acao)! - Fix many schema and fragment lifecycle issues, not all of them, but many related to cacheing. Note: this makes `cacheSchemaForLookup` enabled by default again for schema first contexts. + + This fixes multiple cacheing bugs, upon addomg some in-depth integration test coverage for the LSP server. It also solves several bugs regarding loading config types, and properly restarts the server and invalidates schema when there are config changes. + + ### Bugfix Summary + + - configurable polling updates for network and other code first schema configuration, set to a 30s interval by default. powered by `schemaCacheTTL` which can be configured in the IDE settings (vscode, nvim) or in the graphql config file. (1) + - jump to definition in embedded files offset bug, for both fragments and code files with SDL strings + - cache invalidation for fragments (fragment lookup/autcoomplete data is more accurate, but incomplete/invalid fragments still do not autocomplete or validate, and remember fragment options always filter/validate by the `on` type!) + - schema cache invalidation for schema files - schema updates as you change the SDL files, and the generated file for code first by the `schemaCacheTTL` setting + - schema definition lookups & autocomplete crossing over into the wrong project + + **Notes** + + 1. If possible, configuring for your locally running framework or a schema registry client to handle schema updates and output to a `schema.graphql` or `introspection.json` will always provide a better experience. many graphql frameworks have this built in! Otherwise, we must use this new lazy polling approach if you provide a url schema (this includes both introspection URLs and remote file URLs, and the combination of these). + + ### Known Bugs Fixed + + - #3318 + - #2357 + - #3469 + - #2422 + - #2820 + - many more! + + ### Test Improvements + + - new, high level integration spec suite for the LSP with a matching test utility + - more unit test coverage + - **total increased test coverage of about 25% in the LSP server codebase.** + - many "happy paths" covered for both schema and code first contexts + - many bugs revealed (and their source) + + ### What's next? + + Another stage of the rewrite is already almost ready. This will fix even more bugs and improve memory usage, eliminate redundant parsing and ensure that graphql config's loaders do _all_ of the parsing and heavy lifting, thus honoring all the configs as well. It also significantly reduces the code complexity. + + There is also a plan to match Relay LSP's lookup config for either IDE (vscode, nvm, etc) settings as they provide, or by loading modules into your `graphql-config`! + +### Patch Changes + +- [#3521](https://github.com/graphql/graphiql/pull/3521) [`aa6dbbb4`](https://github.com/graphql/graphiql/commit/aa6dbbb45bf51c1966537640fbe5c4f375735c8d) Thanks [@acao](https://github.com/acao)! - Fixes several issues with Type System (SDL) completion across the ecosystem: + + - restores completion for object and input type fields when the document context is not detectable or parseable + - correct top-level completions for either of the unknown, type system or executable definitions. this leads to mixed top level completions when the document is unparseable, but now you are not seemingly restricted to only executable top level definitions + - `.graphqls` ad-hoc standard functionality remains, but is not required, as it is not part of the official spec, and the spec also allows mixed mode documents in theory, and this concept is required when the type is unknown + +- [#3521](https://github.com/graphql/graphiql/pull/3521) [`aa6dbbb4`](https://github.com/graphql/graphiql/commit/aa6dbbb45bf51c1966537640fbe5c4f375735c8d) Thanks [@acao](https://github.com/acao)! - Introduce `locateCommand` based on Relay LSP `pathToLocateCommand`: + + Now with `.extensions.languageService.locateCommand`, you can specify either the [existing signature](https://marketplace.visualstudio.com/items?itemName=meta.relay#relay.pathtolocatecommand-default-null) for relay, with the same callback parameters and return signature (of a string delimited by `:` characters), or you can return an object with {uri, range} for the exact set of coordinates for the destination range. the function can be sync or async. + + Relay LSP currently supports `Type` and `Type.field` for the 2nd argument. Ours also returns `Type.field(argument)` as a point of reference. It works with object types, input types, fragments, executable definitions and their fields, and should work for directive definitions as well. + + In the case of unnamed types such as fragment spreads, they return the name of the implemented type currently, but I'm curious what users prefer here. I assumed that some people may want to not be limited to only using this for SDL type definition lookups. Also look soon to see `locateCommand` support added for symbols, outline, and coming references and implementations. + + The module at the path you specify in relay LSP for `pathToLocateCommand` should work as such. + + ```ts + // import it + import { locateCommand } from './graphql/tooling/lsp/locate.js'; + export default { + languageService: { + locateCommand, + }, + + projects: { + a: { + schema: 'https://localhost:8000/graphql', + documents: './a/**/*.{ts,tsx,jsx,js,graphql}', + }, + b: { + schema: './schema/ascode.ts', + documents: './b/**/*.{ts,tsx,jsx,js,graphql}', + }, + }, + }; + ``` + + ```ts + // or define it inline + + import { type LocateCommand } from 'graphql-language-service-server'; + + // relay LSP style + const locateCommand = (projectName: string, typePath: string) => { + const { path, startLine, endLine } = ourLookupUtility( + projectName, + typePath, + ); + return `${path}:${startLine}:${endLine}`; + }; + + // an example with our alternative return signature + const locateCommand: LocateCommand = (projectName, typePath, info) => { + // pass more info, such as GraphQLType with the ast node. info.project is also available if you need it + const { path, range } = ourLookupUtility( + projectName, + typePath, + info.type.node, + ); + return { uri: path, range }; // range.start.line/range.end.line + }; + + export default { + languageService: { + locateCommand, + }, + schema: 'https://localhost:8000/graphql', + documents: './**/*.{ts,tsx,jsx,js,graphql}', + }; + ``` + + Passing a string as a module path to resolve is coming in a follow-up release. Then it can be used with `.yml`, `.toml`, `.json`, `package.json#graphql`, etc + + For now this was a quick baseline for a feature asked for in multiple channels! + + Let us know how this works, and about any other interoperability improvements between our graphql LSP and other language servers (relay, intellij, etc) used by you and colleauges in your engineering organisations. We are trying our best to keep up with the awesome innovations they have 👀! + +- Updated dependencies [[`aa6dbbb4`](https://github.com/graphql/graphiql/commit/aa6dbbb45bf51c1966537640fbe5c4f375735c8d), [`aa6dbbb4`](https://github.com/graphql/graphiql/commit/aa6dbbb45bf51c1966537640fbe5c4f375735c8d), [`aa6dbbb4`](https://github.com/graphql/graphiql/commit/aa6dbbb45bf51c1966537640fbe5c4f375735c8d)]: + - graphql-language-service-server@2.13.0 + ## 0.9.3 ### Patch Changes diff --git a/packages/vscode-graphql/package.json b/packages/vscode-graphql/package.json index 876b65103ef..3038b1dea03 100644 --- a/packages/vscode-graphql/package.json +++ b/packages/vscode-graphql/package.json @@ -1,6 +1,6 @@ { "name": "vscode-graphql", - "version": "0.10.2", + "version": "0.11.0", "private": true, "license": "MIT", "displayName": "GraphQL: Language Feature Support", @@ -180,7 +180,7 @@ }, "dependencies": { "graphql": "^16.8.1", - "graphql-language-service-server": "^2.12.0", + "graphql-language-service-server": "^2.13.0", "vscode-languageclient": "8.0.2", "typescript": "^5.3.3" } From 115c1c0281b3bcba6d2ae13f0df51e2cb1d0c24c Mon Sep 17 00:00:00 2001 From: Tuval Simha Date: Mon, 17 Jun 2024 17:33:24 +0300 Subject: [PATCH 28/81] GraphiQL component: `forcedTheme ` (#3407) * GraphiQL component: `showThemeSettings` changeset change prop to enforceTheme clean change prop name cypress theme tests delete onEditForceTheme fix some new changeset fix fix Update packages/graphiql/cypress/e2e/theme.cy.ts Co-authored-by: Dimitri POSTOLOV Update packages/graphiql/cypress/e2e/theme.cy.ts Co-authored-by: Dimitri POSTOLOV Update packages/graphiql/cypress/e2e/theme.cy.ts Co-authored-by: Dimitri POSTOLOV Update packages/graphiql/resources/renderExample.js Co-authored-by: Dimitri POSTOLOV Update packages/graphiql/src/components/GraphiQL.tsx Co-authored-by: Dimitri POSTOLOV Update packages/graphiql/src/components/GraphiQL.tsx Co-authored-by: Dimitri POSTOLOV Update packages/graphiql/cypress/e2e/theme.cy.ts Co-authored-by: Dimitri POSTOLOV Update .changeset/famous-shirts-mate.md Co-authored-by: Dimitri POSTOLOV Update packages/graphiql/cypress/e2e/theme.cy.ts Co-authored-by: Dimitri POSTOLOV Update packages/graphiql/cypress/e2e/theme.cy.ts Co-authored-by: Dimitri POSTOLOV Update packages/graphiql/cypress/e2e/theme.cy.ts Co-authored-by: Dimitri POSTOLOV * Update packages/graphiql/src/components/GraphiQL.tsx Co-authored-by: Ted Thibodeau Jr * Update packages/graphiql/src/components/GraphiQL.tsx Co-authored-by: Ted Thibodeau Jr * simplify * fix cypress --------- Co-authored-by: Dimitri POSTOLOV Co-authored-by: Ted Thibodeau Jr Co-authored-by: Dimitri POSTOLOV --- .changeset/famous-shirts-mate.md | 5 + .eslintrc.js | 1 + packages/graphiql/cypress/e2e/theme.cy.ts | 17 ++++ packages/graphiql/resources/renderExample.js | 1 + packages/graphiql/src/components/GraphiQL.tsx | 94 ++++++++++++------- 5 files changed, 85 insertions(+), 33 deletions(-) create mode 100644 .changeset/famous-shirts-mate.md create mode 100644 packages/graphiql/cypress/e2e/theme.cy.ts diff --git a/.changeset/famous-shirts-mate.md b/.changeset/famous-shirts-mate.md new file mode 100644 index 00000000000..72bf718cdd4 --- /dev/null +++ b/.changeset/famous-shirts-mate.md @@ -0,0 +1,5 @@ +--- +'graphiql': minor +--- + +Add a new prop to GraphiQL component: `forcedTheme` to force the theme and hide the theme switcher. diff --git a/.eslintrc.js b/.eslintrc.js index f9f7e78023c..15097833cb4 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -359,6 +359,7 @@ module.exports = { '@typescript-eslint/no-floating-promises': 'error', '@typescript-eslint/non-nullable-type-assertion-style': 'error', '@typescript-eslint/consistent-type-assertions': 'error', + '@typescript-eslint/no-duplicate-type-constituents': 'error', // TODO: Fix all errors for the following rules included in recommended config '@typescript-eslint/no-explicit-any': 'off', '@typescript-eslint/no-non-null-assertion': 'off', diff --git a/packages/graphiql/cypress/e2e/theme.cy.ts b/packages/graphiql/cypress/e2e/theme.cy.ts new file mode 100644 index 00000000000..456b99511de --- /dev/null +++ b/packages/graphiql/cypress/e2e/theme.cy.ts @@ -0,0 +1,17 @@ +describe('Theme', () => { + it('Switches to light theme when `forcedTheme` is light', () => { + cy.visit('/?query={test}&forcedTheme=light'); + cy.get('body').should('have.class', 'graphiql-light'); + }); + + it('Switches to dark theme when `forcedTheme` is dark', () => { + cy.visit('/?query={test}&forcedTheme=dark'); + cy.get('body').should('have.class', 'graphiql-dark'); + }); + + it('Defaults to light theme when `forcedTheme` value is invalid', () => { + cy.visit('/?query={test}&forcedTheme=invalid'); + cy.get('[data-value=settings]').click(); + cy.get('.graphiql-dialog-section-title').eq(1).should('have.text', 'Theme'); // Check for the presence of the theme dialog + }); +}); diff --git a/packages/graphiql/resources/renderExample.js b/packages/graphiql/resources/renderExample.js index f78403dde30..b2fc32c7d25 100644 --- a/packages/graphiql/resources/renderExample.js +++ b/packages/graphiql/resources/renderExample.js @@ -102,5 +102,6 @@ root.render( shouldPersistHeaders: true, inputValueDeprecation: GraphQLVersion.includes('15.5') ? undefined : true, onTabChange, + forcedTheme: parameters.forcedTheme, }), ); diff --git a/packages/graphiql/src/components/GraphiQL.tsx b/packages/graphiql/src/components/GraphiQL.tsx index fb2a44522ff..5067d344515 100644 --- a/packages/graphiql/src/components/GraphiQL.tsx +++ b/packages/graphiql/src/components/GraphiQL.tsx @@ -14,6 +14,8 @@ import React, { ReactElement, useCallback, useState, + useEffect, + useMemo, } from 'react'; import { @@ -168,6 +170,7 @@ export function GraphiQL({ @@ -216,8 +219,16 @@ export type GraphiQLInterfaceProps = WriteableEditorProps & */ showPersistHeadersSettings?: boolean; disableTabs?: boolean; + /** + * forcedTheme allows enforcement of a specific theme for GraphiQL. + * This is useful when you want to make sure that GraphiQL is always + * rendered with a specific theme + */ + forcedTheme?: (typeof THEMES)[number]; }; +const THEMES = ['light', 'dark', 'system'] as const; + export function GraphiQLInterface(props: GraphiQLInterfaceProps) { const isHeadersEditorEnabled = props.isHeadersEditorEnabled ?? true; const editorContext = useEditorContext({ nonNull: true }); @@ -225,6 +236,13 @@ export function GraphiQLInterface(props: GraphiQLInterfaceProps) { const schemaContext = useSchemaContext({ nonNull: true }); const storageContext = useStorageContext(); const pluginContext = usePluginContext(); + const forcedTheme = useMemo( + () => + props.forcedTheme && THEMES.includes(props.forcedTheme) + ? props.forcedTheme + : undefined, + [props.forcedTheme], + ); const copy = useCopyQuery({ onCopyQuery: props.onCopyQuery }); const merge = useMergeQuery(); @@ -232,6 +250,14 @@ export function GraphiQLInterface(props: GraphiQLInterfaceProps) { const { theme, setTheme } = useTheme(); + useEffect(() => { + if (forcedTheme === 'system') { + setTheme(null); + } else if (forcedTheme === 'light' || forcedTheme === 'dark') { + setTheme(forcedTheme); + } + }, [forcedTheme, setTheme]); + const PluginContent = pluginContext?.visiblePlugin?.content; const pluginResize = useDragResize({ @@ -317,7 +343,7 @@ export function GraphiQLInterface(props: GraphiQLInterfaceProps) { - {props.toolbar?.additionalContent && props.toolbar.additionalContent} + {props.toolbar?.additionalContent} {props.toolbar?.additionalComponent && ( )} @@ -520,7 +546,7 @@ export function GraphiQLInterface(props: GraphiQLInterfaceProps) { )}
- {props.disableTabs ? null : ( + {!props.disableTabs && (
) : null} -
-
-
Theme
-
- Adjust how the interface looks like. + {!forcedTheme && ( +
+
+
Theme
+
+ Adjust how the interface appears. +
+ + + + +
- - - - - -
+ )} {storageContext ? (
From 69c8c265dce59a0aa45396c00c678891c5455eb9 Mon Sep 17 00:00:00 2001 From: Rikki Schulte Date: Mon, 17 Jun 2024 16:43:28 +0200 Subject: [PATCH 29/81] Version Packages (#3623) Co-authored-by: github-actions[bot] --- .changeset/famous-shirts-mate.md | 5 ----- examples/graphiql-webpack/package.json | 2 +- packages/graphiql/CHANGELOG.md | 6 ++++++ packages/graphiql/package.json | 2 +- 4 files changed, 8 insertions(+), 7 deletions(-) delete mode 100644 .changeset/famous-shirts-mate.md diff --git a/.changeset/famous-shirts-mate.md b/.changeset/famous-shirts-mate.md deleted file mode 100644 index 72bf718cdd4..00000000000 --- a/.changeset/famous-shirts-mate.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'graphiql': minor ---- - -Add a new prop to GraphiQL component: `forcedTheme` to force the theme and hide the theme switcher. diff --git a/examples/graphiql-webpack/package.json b/examples/graphiql-webpack/package.json index ae50adf54c4..1019817ca21 100644 --- a/examples/graphiql-webpack/package.json +++ b/examples/graphiql-webpack/package.json @@ -13,7 +13,7 @@ "@graphiql/plugin-explorer": "^3.0.2", "@graphiql/toolkit": "^0.9.1", "@graphiql/react": "^0.22.2", - "graphiql": "^3.2.3", + "graphiql": "^3.3.0", "graphql": "^16.8.1", "graphql-ws": "^5.5.5", "react": "^18.2.0", diff --git a/packages/graphiql/CHANGELOG.md b/packages/graphiql/CHANGELOG.md index 1b252105180..f243774186f 100644 --- a/packages/graphiql/CHANGELOG.md +++ b/packages/graphiql/CHANGELOG.md @@ -1,5 +1,11 @@ # Change Log +## 3.3.0 + +### Minor Changes + +- [#3407](https://github.com/graphql/graphiql/pull/3407) [`115c1c02`](https://github.com/graphql/graphiql/commit/115c1c0281b3bcba6d2ae13f0df51e2cb1d0c24c) Thanks [@TuvalSimha](https://github.com/TuvalSimha)! - Add a new prop to GraphiQL component: `forcedTheme` to force the theme and hide the theme switcher. + ## 3.2.3 ### Patch Changes diff --git a/packages/graphiql/package.json b/packages/graphiql/package.json index 75af4899c98..566ebd71b6f 100644 --- a/packages/graphiql/package.json +++ b/packages/graphiql/package.json @@ -1,6 +1,6 @@ { "name": "graphiql", - "version": "3.2.3", + "version": "3.3.0", "description": "An graphical interactive in-browser GraphQL IDE.", "contributors": [ "Hyohyeon Jeong ", From 335d830c2a4e551ef97fbeff8ed7c538ff5cd4af Mon Sep 17 00:00:00 2001 From: Dimitri POSTOLOV Date: Mon, 17 Jun 2024 18:32:46 +0200 Subject: [PATCH 30/81] fix doc explorer search input is cut off while clicking on autocomplete results (#3624) --- .changeset/blue-points-taste.md | 5 +++++ .../graphiql-react/src/explorer/components/doc-explorer.css | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/blue-points-taste.md diff --git a/.changeset/blue-points-taste.md b/.changeset/blue-points-taste.md new file mode 100644 index 00000000000..acc49c24071 --- /dev/null +++ b/.changeset/blue-points-taste.md @@ -0,0 +1,5 @@ +--- +'@graphiql/react': patch +--- + +fix doc explorer search input is cut off while clicking on autocomplete results diff --git a/packages/graphiql-react/src/explorer/components/doc-explorer.css b/packages/graphiql-react/src/explorer/components/doc-explorer.css index 87c81282175..9cab5ffb4a0 100644 --- a/packages/graphiql-react/src/explorer/components/doc-explorer.css +++ b/packages/graphiql-react/src/explorer/components/doc-explorer.css @@ -36,7 +36,7 @@ left: 0; } - & [role='combobox'] { + &:not(:focus-within) [role='combobox'] { height: 24px; width: 4ch; } From 9ab39d88cc91a56fb1266b6ef94abfe46c668798 Mon Sep 17 00:00:00 2001 From: Rikki Schulte Date: Mon, 17 Jun 2024 18:39:15 +0200 Subject: [PATCH 31/81] Version Packages (#3625) Co-authored-by: github-actions[bot] --- .changeset/blue-points-taste.md | 5 ----- examples/graphiql-webpack/package.json | 8 ++++---- packages/graphiql-plugin-code-exporter/CHANGELOG.md | 7 +++++++ packages/graphiql-plugin-code-exporter/package.json | 6 +++--- packages/graphiql-plugin-explorer/CHANGELOG.md | 7 +++++++ packages/graphiql-plugin-explorer/package.json | 6 +++--- packages/graphiql-react/CHANGELOG.md | 6 ++++++ packages/graphiql-react/package.json | 2 +- packages/graphiql/CHANGELOG.md | 7 +++++++ packages/graphiql/package.json | 4 ++-- 10 files changed, 40 insertions(+), 18 deletions(-) delete mode 100644 .changeset/blue-points-taste.md diff --git a/.changeset/blue-points-taste.md b/.changeset/blue-points-taste.md deleted file mode 100644 index acc49c24071..00000000000 --- a/.changeset/blue-points-taste.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@graphiql/react': patch ---- - -fix doc explorer search input is cut off while clicking on autocomplete results diff --git a/examples/graphiql-webpack/package.json b/examples/graphiql-webpack/package.json index 1019817ca21..83277a9af33 100644 --- a/examples/graphiql-webpack/package.json +++ b/examples/graphiql-webpack/package.json @@ -9,11 +9,11 @@ "start": "NODE_ENV=development webpack-cli serve" }, "dependencies": { - "@graphiql/plugin-code-exporter": "^3.0.2", - "@graphiql/plugin-explorer": "^3.0.2", + "@graphiql/plugin-code-exporter": "^3.0.3", + "@graphiql/plugin-explorer": "^3.0.3", "@graphiql/toolkit": "^0.9.1", - "@graphiql/react": "^0.22.2", - "graphiql": "^3.3.0", + "@graphiql/react": "^0.22.3", + "graphiql": "^3.3.1", "graphql": "^16.8.1", "graphql-ws": "^5.5.5", "react": "^18.2.0", diff --git a/packages/graphiql-plugin-code-exporter/CHANGELOG.md b/packages/graphiql-plugin-code-exporter/CHANGELOG.md index dcf374850fb..70d30de1abc 100644 --- a/packages/graphiql-plugin-code-exporter/CHANGELOG.md +++ b/packages/graphiql-plugin-code-exporter/CHANGELOG.md @@ -1,5 +1,12 @@ # @graphiql/plugin-code-exporter +## 3.0.3 + +### Patch Changes + +- Updated dependencies [[`335d830c`](https://github.com/graphql/graphiql/commit/335d830c2a4e551ef97fbeff8ed7c538ff5cd4af)]: + - @graphiql/react@0.22.3 + ## 3.0.2 ### Patch Changes diff --git a/packages/graphiql-plugin-code-exporter/package.json b/packages/graphiql-plugin-code-exporter/package.json index 37e6628d68a..638230dfa9a 100644 --- a/packages/graphiql-plugin-code-exporter/package.json +++ b/packages/graphiql-plugin-code-exporter/package.json @@ -1,6 +1,6 @@ { "name": "@graphiql/plugin-code-exporter", - "version": "3.0.2", + "version": "3.0.3", "repository": { "type": "git", "url": "https://github.com/graphql/graphiql", @@ -33,13 +33,13 @@ "graphiql-code-exporter": "^3.0.3" }, "peerDependencies": { - "@graphiql/react": "^0.22.2", + "@graphiql/react": "^0.22.3", "graphql": "^15.5.0 || ^16.0.0", "react": "^16.8.0 || ^17 || ^18", "react-dom": "^16.8.0 || ^17 || ^18" }, "devDependencies": { - "@graphiql/react": "^0.22.2", + "@graphiql/react": "^0.22.3", "@vitejs/plugin-react": "^4.0.1", "graphql": "^16.8.1", "postcss-nesting": "^10.1.7", diff --git a/packages/graphiql-plugin-explorer/CHANGELOG.md b/packages/graphiql-plugin-explorer/CHANGELOG.md index 77ad2a056dc..da52836204a 100644 --- a/packages/graphiql-plugin-explorer/CHANGELOG.md +++ b/packages/graphiql-plugin-explorer/CHANGELOG.md @@ -1,5 +1,12 @@ # @graphiql/plugin-explorer +## 3.0.3 + +### Patch Changes + +- Updated dependencies [[`335d830c`](https://github.com/graphql/graphiql/commit/335d830c2a4e551ef97fbeff8ed7c538ff5cd4af)]: + - @graphiql/react@0.22.3 + ## 3.0.2 ### Patch Changes diff --git a/packages/graphiql-plugin-explorer/package.json b/packages/graphiql-plugin-explorer/package.json index 52cb8104603..16e5b270f56 100644 --- a/packages/graphiql-plugin-explorer/package.json +++ b/packages/graphiql-plugin-explorer/package.json @@ -1,6 +1,6 @@ { "name": "@graphiql/plugin-explorer", - "version": "3.0.2", + "version": "3.0.3", "repository": { "type": "git", "url": "https://github.com/graphql/graphiql", @@ -32,13 +32,13 @@ "graphiql-explorer": "^0.9.0" }, "peerDependencies": { - "@graphiql/react": "^0.22.2", + "@graphiql/react": "^0.22.3", "graphql": "^15.5.0 || ^16.0.0", "react": "^16.8.0 || ^17 || ^18", "react-dom": "^16.8.0 || ^17 || ^18" }, "devDependencies": { - "@graphiql/react": "^0.22.2", + "@graphiql/react": "^0.22.3", "@vitejs/plugin-react": "^4.0.1", "graphql": "^16.8.1", "react": "^18.2.0", diff --git a/packages/graphiql-react/CHANGELOG.md b/packages/graphiql-react/CHANGELOG.md index 173d9b1079e..28db055021e 100644 --- a/packages/graphiql-react/CHANGELOG.md +++ b/packages/graphiql-react/CHANGELOG.md @@ -1,5 +1,11 @@ # @graphiql/react +## 0.22.3 + +### Patch Changes + +- [#3624](https://github.com/graphql/graphiql/pull/3624) [`335d830c`](https://github.com/graphql/graphiql/commit/335d830c2a4e551ef97fbeff8ed7c538ff5cd4af) Thanks [@dimaMachina](https://github.com/dimaMachina)! - fix doc explorer search input is cut off while clicking on autocomplete results + ## 0.22.2 ### Patch Changes diff --git a/packages/graphiql-react/package.json b/packages/graphiql-react/package.json index fe982ae5dab..af35f6cb010 100644 --- a/packages/graphiql-react/package.json +++ b/packages/graphiql-react/package.json @@ -1,6 +1,6 @@ { "name": "@graphiql/react", - "version": "0.22.2", + "version": "0.22.3", "repository": { "type": "git", "url": "https://github.com/graphql/graphiql", diff --git a/packages/graphiql/CHANGELOG.md b/packages/graphiql/CHANGELOG.md index f243774186f..72e7d5abd57 100644 --- a/packages/graphiql/CHANGELOG.md +++ b/packages/graphiql/CHANGELOG.md @@ -1,5 +1,12 @@ # Change Log +## 3.3.1 + +### Patch Changes + +- Updated dependencies [[`335d830c`](https://github.com/graphql/graphiql/commit/335d830c2a4e551ef97fbeff8ed7c538ff5cd4af)]: + - @graphiql/react@0.22.3 + ## 3.3.0 ### Minor Changes diff --git a/packages/graphiql/package.json b/packages/graphiql/package.json index 566ebd71b6f..32b47abc6da 100644 --- a/packages/graphiql/package.json +++ b/packages/graphiql/package.json @@ -1,6 +1,6 @@ { "name": "graphiql", - "version": "3.3.0", + "version": "3.3.1", "description": "An graphical interactive in-browser GraphQL IDE.", "contributors": [ "Hyohyeon Jeong ", @@ -47,7 +47,7 @@ "webpack": "webpack-cli --config resources/webpack.config.js" }, "dependencies": { - "@graphiql/react": "^0.22.2", + "@graphiql/react": "^0.22.3", "@graphiql/toolkit": "^0.9.1", "graphql-language-service": "^5.2.1", "markdown-it": "^14.1.0" From 7fad662f77eae9f842bb55cb93cb98df33bbc1ed Mon Sep 17 00:00:00 2001 From: Rikki Schulte Date: Sat, 22 Jun 2024 21:31:18 +0200 Subject: [PATCH 32/81] fix: lsp stdin/stdout interface (neovim, etc) (#3628) --- .changeset/dull-numbers-run.md | 6 ++++++ .../src/startServer.ts | 13 +++---------- 2 files changed, 9 insertions(+), 10 deletions(-) create mode 100644 .changeset/dull-numbers-run.md diff --git a/.changeset/dull-numbers-run.md b/.changeset/dull-numbers-run.md new file mode 100644 index 00000000000..1212c86ebdb --- /dev/null +++ b/.changeset/dull-numbers-run.md @@ -0,0 +1,6 @@ +--- +'graphql-language-service-server': patch +'graphql-language-service-cli': patch +--- + +fix the lsp stream interface for stdin/out (neovim, etc) diff --git a/packages/graphql-language-service-server/src/startServer.ts b/packages/graphql-language-service-server/src/startServer.ts index eb0c999bc5c..b3a3b054c85 100644 --- a/packages/graphql-language-service-server/src/startServer.ts +++ b/packages/graphql-language-service-server/src/startServer.ts @@ -116,16 +116,9 @@ export default async function startServer( break; case 'stream': - const server = createLanguageServerConnection( - // @ts-expect-error this still works, just a type mismatch - process.stdin, - process.stderr, - { - connectionStrategy: 'stdio', - }, - ); - server.listen(); - return server; + reader = new StreamMessageReader(process.stdin); + writer = new StreamMessageWriter(process.stdout); + break; default: reader = new IPCMessageReader(process); From b52c39143a4269cd899b16d06de5c7fe024fae2d Mon Sep 17 00:00:00 2001 From: Rikki Schulte Date: Sat, 22 Jun 2024 21:42:46 +0200 Subject: [PATCH 33/81] Version Packages (#3629) Co-authored-by: github-actions[bot] --- .changeset/dull-numbers-run.md | 6 ------ packages/graphql-language-service-cli/CHANGELOG.md | 9 +++++++++ packages/graphql-language-service-cli/package.json | 4 ++-- packages/graphql-language-service-server/CHANGELOG.md | 6 ++++++ packages/graphql-language-service-server/package.json | 2 +- packages/vscode-graphql/CHANGELOG.md | 7 +++++++ packages/vscode-graphql/package.json | 4 ++-- 7 files changed, 27 insertions(+), 11 deletions(-) delete mode 100644 .changeset/dull-numbers-run.md diff --git a/.changeset/dull-numbers-run.md b/.changeset/dull-numbers-run.md deleted file mode 100644 index 1212c86ebdb..00000000000 --- a/.changeset/dull-numbers-run.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'graphql-language-service-server': patch -'graphql-language-service-cli': patch ---- - -fix the lsp stream interface for stdin/out (neovim, etc) diff --git a/packages/graphql-language-service-cli/CHANGELOG.md b/packages/graphql-language-service-cli/CHANGELOG.md index d2f63744376..bc03e1480a5 100644 --- a/packages/graphql-language-service-cli/CHANGELOG.md +++ b/packages/graphql-language-service-cli/CHANGELOG.md @@ -1,5 +1,14 @@ # graphql-language-service-cli +## 3.4.1 + +### Patch Changes + +- [#3628](https://github.com/graphql/graphiql/pull/3628) [`7fad662f`](https://github.com/graphql/graphiql/commit/7fad662f77eae9f842bb55cb93cb98df33bbc1ed) Thanks [@acao](https://github.com/acao)! - fix the lsp stream interface for stdin/out (neovim, etc) + +- Updated dependencies [[`7fad662f`](https://github.com/graphql/graphiql/commit/7fad662f77eae9f842bb55cb93cb98df33bbc1ed)]: + - graphql-language-service-server@2.13.1 + ## 3.4.0 ### Minor Changes diff --git a/packages/graphql-language-service-cli/package.json b/packages/graphql-language-service-cli/package.json index fee9a466fd3..c8bb60d6f4f 100644 --- a/packages/graphql-language-service-cli/package.json +++ b/packages/graphql-language-service-cli/package.json @@ -1,6 +1,6 @@ { "name": "graphql-language-service-cli", - "version": "3.4.0", + "version": "3.4.1", "description": "An interface for building GraphQL language services for IDEs", "contributors": [ "Hyohyeon Jeong ", @@ -38,7 +38,7 @@ "@babel/polyfill": "^7.12.1", "@types/yargs": "16.0.5", "graphql-language-service": "^5.2.1", - "graphql-language-service-server": "^2.13.0", + "graphql-language-service-server": "^2.13.1", "yargs": "^16.2.0" }, "devDependencies": { diff --git a/packages/graphql-language-service-server/CHANGELOG.md b/packages/graphql-language-service-server/CHANGELOG.md index 7fcb3ca71dc..d361148802c 100644 --- a/packages/graphql-language-service-server/CHANGELOG.md +++ b/packages/graphql-language-service-server/CHANGELOG.md @@ -1,5 +1,11 @@ # graphql-language-service-server +## 2.13.1 + +### Patch Changes + +- [#3628](https://github.com/graphql/graphiql/pull/3628) [`7fad662f`](https://github.com/graphql/graphiql/commit/7fad662f77eae9f842bb55cb93cb98df33bbc1ed) Thanks [@acao](https://github.com/acao)! - fix the lsp stream interface for stdin/out (neovim, etc) + ## 2.13.0 ### Minor Changes diff --git a/packages/graphql-language-service-server/package.json b/packages/graphql-language-service-server/package.json index c05661ed8cd..c6c5f329778 100644 --- a/packages/graphql-language-service-server/package.json +++ b/packages/graphql-language-service-server/package.json @@ -1,6 +1,6 @@ { "name": "graphql-language-service-server", - "version": "2.13.0", + "version": "2.13.1", "description": "Server process backing the GraphQL Language Service", "contributors": [ "Greg Hurrell (https://greg.hurrell.net/)", diff --git a/packages/vscode-graphql/CHANGELOG.md b/packages/vscode-graphql/CHANGELOG.md index e8d51c0a0c6..0ca84f1eb6f 100644 --- a/packages/vscode-graphql/CHANGELOG.md +++ b/packages/vscode-graphql/CHANGELOG.md @@ -1,5 +1,12 @@ # Change Log +## 0.11.1 + +### Patch Changes + +- Updated dependencies [[`7fad662f`](https://github.com/graphql/graphiql/commit/7fad662f77eae9f842bb55cb93cb98df33bbc1ed)]: + - graphql-language-service-server@2.13.1 + ## 0.11.0 ### Minor Changes diff --git a/packages/vscode-graphql/package.json b/packages/vscode-graphql/package.json index 3038b1dea03..e32a9c81cfb 100644 --- a/packages/vscode-graphql/package.json +++ b/packages/vscode-graphql/package.json @@ -1,6 +1,6 @@ { "name": "vscode-graphql", - "version": "0.11.0", + "version": "0.11.1", "private": true, "license": "MIT", "displayName": "GraphQL: Language Feature Support", @@ -180,7 +180,7 @@ }, "dependencies": { "graphql": "^16.8.1", - "graphql-language-service-server": "^2.13.0", + "graphql-language-service-server": "^2.13.1", "vscode-languageclient": "8.0.2", "typescript": "^5.3.3" } From adf0ba019902dcac2e49ccee69b79a6665c4766d Mon Sep 17 00:00:00 2001 From: Dimitri POSTOLOV Date: Mon, 1 Jul 2024 11:39:52 +0200 Subject: [PATCH 34/81] use `hsl` instead `hsla` when alpha is `1` (#3634) * prefer `hsl` * add changeset * Update .changeset/fair-cups-cry.md Co-authored-by: Ted Thibodeau Jr * Update packages/graphiql-react/src/ui/markdown.css Co-authored-by: Ted Thibodeau Jr --------- Co-authored-by: Ted Thibodeau Jr --- .changeset/fair-cups-cry.md | 7 +++++++ examples/graphiql-webpack/src/index.css | 6 +++--- .../src/select-server-plugin.css | 6 +++--- packages/cm6-graphql/README.md | 2 +- packages/codemirror-graphql/README.md | 2 +- .../graphiql-plugin-code-exporter/README.md | 21 +++++++++---------- .../examples/index.html | 16 +++++++------- .../src/index.css | 2 +- .../graphiql-react/src/editor/style/info.css | 2 +- .../src/explorer/components/search.css | 2 +- packages/graphiql-react/src/history/style.css | 4 ++-- packages/graphiql-react/src/icons/close.svg | 6 +++--- packages/graphiql-react/src/icons/plus.svg | 4 ++-- packages/graphiql-react/src/style/root.css | 6 +++--- packages/graphiql-react/src/ui/button.css | 2 +- packages/graphiql-react/src/ui/markdown.css | 8 +++---- .../graphiql-toolkit/docs/create-fetcher.md | 6 +++--- packages/graphiql/src/style.css | 4 ++-- .../graphql-language-service-cli/README.md | 2 +- .../graphql-language-service-server/README.md | 2 +- 20 files changed, 58 insertions(+), 52 deletions(-) create mode 100644 .changeset/fair-cups-cry.md diff --git a/.changeset/fair-cups-cry.md b/.changeset/fair-cups-cry.md new file mode 100644 index 00000000000..b78d9034905 --- /dev/null +++ b/.changeset/fair-cups-cry.md @@ -0,0 +1,7 @@ +--- +'graphiql': patch +'@graphiql/plugin-code-exporter': patch +'@graphiql/react': patch +--- + +when alpha is `1`, use `hsl` instead of `hsla` diff --git a/examples/graphiql-webpack/src/index.css b/examples/graphiql-webpack/src/index.css index 986c0b8a9ad..179e59ca66e 100644 --- a/examples/graphiql-webpack/src/index.css +++ b/examples/graphiql-webpack/src/index.css @@ -97,10 +97,10 @@ li.select-server--previous-entry button:hover { li.select-server--previous-entry button { background-color: transparent; - border: hsla(var(--color-neutral), 1); + border: hsl(var(--color-neutral)); display: flex; - color: hsla(var(--color-neutral), 1); + color: hsl(var(--color-neutral)); font-size: 1rem; - cursor: pinter; + cursor: pointer; padding: 0.5rem; } diff --git a/examples/graphiql-webpack/src/select-server-plugin.css b/examples/graphiql-webpack/src/select-server-plugin.css index 824246116e8..ba07e45a698 100644 --- a/examples/graphiql-webpack/src/select-server-plugin.css +++ b/examples/graphiql-webpack/src/select-server-plugin.css @@ -96,10 +96,10 @@ li.select-server--previous-entry button:hover { li.select-server--previous-entry button { background-color: transparent; - border: hsla(var(--color-neutral), 1); + border: hsl(var(--color-neutral)); display: flex; - color: hsla(var(--color-neutral), 1); + color: hsl(var(--color-neutral)); font-size: 1rem; - cursor: pinter; + cursor: pointer; padding: 0.5rem; } diff --git a/packages/cm6-graphql/README.md b/packages/cm6-graphql/README.md index a23f718dbff..4ce0fbf2d9a 100644 --- a/packages/cm6-graphql/README.md +++ b/packages/cm6-graphql/README.md @@ -11,7 +11,7 @@ autocomplete and linting powered by your GraphQL Schema. ### Getting Started ```sh -npm install --save cm6-graphql +npm install cm6-graphql ``` [CodeMirror 6](https://codemirror.net/) customization is done through diff --git a/packages/codemirror-graphql/README.md b/packages/codemirror-graphql/README.md index ac0ef31d5be..3fa4e98b42d 100644 --- a/packages/codemirror-graphql/README.md +++ b/packages/codemirror-graphql/README.md @@ -15,7 +15,7 @@ typeahead hinter powered by your GraphQL Schema. ### Getting Started ```sh -npm install --save codemirror-graphql +npm install codemirror-graphql ``` CodeMirror helpers install themselves to the global CodeMirror when they are diff --git a/packages/graphiql-plugin-code-exporter/README.md b/packages/graphiql-plugin-code-exporter/README.md index f7ce70c8948..40764460285 100644 --- a/packages/graphiql-plugin-code-exporter/README.md +++ b/packages/graphiql-plugin-code-exporter/README.md @@ -9,14 +9,14 @@ into the GraphiQL UI. Use your favorite package manager to install the package: ```sh -npm i -S @graphiql/plugin-code-exporter +npm install @graphiql/plugin-code-exporter ``` The following packages are peer dependencies, so make sure you have them installed as well: ```sh -npm i -S react react-dom graphql +npm install react react-dom graphql ``` ## Usage @@ -27,11 +27,10 @@ for all details on available `props` and how to [create snippets](https://github.com/OneGraph/graphiql-code-exporter#snippets). ```jsx -import { codeExporterPlugin } from '@graphiql/plugin-code-exporter'; -import { createGraphiQLFetcher } from '@graphiql/toolkit'; -import { GraphiQL } from 'graphiql'; import { useState } from 'react'; - +import { GraphiQL } from 'graphiql'; +import { createGraphiQLFetcher } from '@graphiql/toolkit'; +import { codeExporterPlugin } from '@graphiql/plugin-code-exporter'; import 'graphiql/graphiql.css'; import '@graphiql/plugin-code-exporter/dist/style.css'; @@ -39,10 +38,10 @@ const fetcher = createGraphiQLFetcher({ url: 'https://swapi-graphql.netlify.app/.netlify/functions/index', }); -/* -Example code for snippets. See https://github.com/OneGraph/graphiql-code-exporter#snippets for details -*/ - +/** + * Example code for snippets. See https://github.com/OneGraph/graphiql-code-exporter#snippets for + * details + */ const removeQueryName = query => query.replace( /^[^{(]+([{(])/, @@ -91,7 +90,7 @@ const exporter = codeExporterPlugin({ codeMirrorTheme: 'graphiql', }); -function GraphiQLWithExplorer() { +function GraphiQLWithCodeExporter() { return ( ); diff --git a/packages/graphiql-plugin-code-exporter/examples/index.html b/packages/graphiql-plugin-code-exporter/examples/index.html index d4dce712ec5..c1929dedd43 100644 --- a/packages/graphiql-plugin-code-exporter/examples/index.html +++ b/packages/graphiql-plugin-code-exporter/examples/index.html @@ -76,9 +76,9 @@ } var exampleSnippetOne = { - name: `Example One`, - language: `JavaScript`, - codeMirrorMode: `jsx`, + name: 'Example One', + language: 'JavaScript', + codeMirrorMode: 'jsx', options: [], generate: arg => `export const query = graphql\` ${getQuery(arg, 2)} @@ -87,9 +87,9 @@ }; var exampleSnippetTwo = { - name: `Example Two`, - language: `JavaScript`, - codeMirrorMode: `jsx`, + name: 'Example Two', + language: 'JavaScript', + codeMirrorMode: 'jsx', options: [], generate: arg => `import { graphql } from 'graphql' @@ -107,7 +107,7 @@ var query = 'query AllFilms {\n allFilms {\n films {\n title\n }\n }\n}'; - function GraphiQLWithExporter() { + function GraphiQLWithCodeExporter() { return React.createElement(GraphiQL, { fetcher: fetcher, defaultEditorToolsVisibility: true, @@ -117,7 +117,7 @@ } const root = ReactDOM.createRoot(document.getElementById('graphiql')); - root.render(React.createElement(GraphiQLWithExporter)); + root.render(React.createElement(GraphiQLWithCodeExporter)); diff --git a/packages/graphiql-plugin-code-exporter/src/index.css b/packages/graphiql-plugin-code-exporter/src/index.css index a4b88eaccf8..716d01d954c 100644 --- a/packages/graphiql-plugin-code-exporter/src/index.css +++ b/packages/graphiql-plugin-code-exporter/src/index.css @@ -82,7 +82,7 @@ cursor: pointer; text-decoration: none; padding: var(--px-8) var(--px-12); - color: hsla(var(--color-neutral), 1) !important; + color: hsl(var(--color-neutral)) !important; border-radius: var(--border-radius-4) !important; &:hover { background-color: hsla( diff --git a/packages/graphiql-react/src/editor/style/info.css b/packages/graphiql-react/src/editor/style/info.css index 82a8414326e..a1a84335c92 100644 --- a/packages/graphiql-react/src/editor/style/info.css +++ b/packages/graphiql-react/src/editor/style/info.css @@ -4,7 +4,7 @@ border: var(--popover-border); border-radius: var(--border-radius-8); box-shadow: var(--popover-box-shadow); - color: hsla(var(--color-neutral), 1); + color: hsl(var(--color-neutral)); max-height: 300px; max-width: 400px; opacity: 0; diff --git a/packages/graphiql-react/src/explorer/components/search.css b/packages/graphiql-react/src/explorer/components/search.css index 236f6106588..8d1a4d02b1e 100644 --- a/packages/graphiql-react/src/explorer/components/search.css +++ b/packages/graphiql-react/src/explorer/components/search.css @@ -5,7 +5,7 @@ border: var(--popover-border); border-radius: var(--border-radius-4); box-shadow: var(--popover-box-shadow); - color: hsla(var(--color-neutral), 1); + color: hsl(var(--color-neutral)); & .graphiql-doc-explorer-search-input { background: hsl(var(--color-base)); diff --git a/packages/graphiql-react/src/history/style.css b/packages/graphiql-react/src/history/style.css index c12302d0301..ac536135f29 100644 --- a/packages/graphiql-react/src/history/style.css +++ b/packages/graphiql-react/src/history/style.css @@ -26,7 +26,7 @@ height: 34px; &:hover { - color: hsla(var(--color-neutral), 1); + color: hsl(var(--color-neutral)); background-color: hsla(var(--color-neutral), var(--alpha-background-light)); } @@ -91,7 +91,7 @@ button.graphiql-history-item-action { padding: var(--px-8) var(--px-6); &:hover { - color: hsla(var(--color-neutral), 1); + color: hsl(var(--color-neutral)); } & > svg { diff --git a/packages/graphiql-react/src/icons/close.svg b/packages/graphiql-react/src/icons/close.svg index 229315632b3..4e88a636b66 100644 --- a/packages/graphiql-react/src/icons/close.svg +++ b/packages/graphiql-react/src/icons/close.svg @@ -1,4 +1,4 @@ - - - + + + diff --git a/packages/graphiql-react/src/icons/plus.svg b/packages/graphiql-react/src/icons/plus.svg index 5d02b3c4a5f..22d8581a201 100644 --- a/packages/graphiql-react/src/icons/plus.svg +++ b/packages/graphiql-react/src/icons/plus.svg @@ -1,3 +1,3 @@ - - + + diff --git a/packages/graphiql-react/src/style/root.css b/packages/graphiql-react/src/style/root.css index adf9e2f002a..5f18fa336c6 100644 --- a/packages/graphiql-react/src/style/root.css +++ b/packages/graphiql-react/src/style/root.css @@ -121,15 +121,15 @@ body.graphiql-dark [data-radix-popper-content-wrapper] { .graphiql-dialog { &, &:is(button) { - color: hsla(var(--color-neutral), 1); + color: hsl(var(--color-neutral)); font-family: var(--font-family); font-size: var(--font-size-body); - font-weight: var(----font-weight-regular); + font-weight: var(--font-weight-regular); line-height: var(--line-height); } & input { - color: hsla(var(--color-neutral), 1); + color: hsl(var(--color-neutral)); font-family: var(--font-family); font-size: var(--font-size-caption); diff --git a/packages/graphiql-react/src/ui/button.css b/packages/graphiql-react/src/ui/button.css index f8ff4d575cf..f9cf0a668b8 100644 --- a/packages/graphiql-react/src/ui/button.css +++ b/packages/graphiql-react/src/ui/button.css @@ -25,7 +25,7 @@ button.graphiql-button { background-color: hsla(var(--color-neutral), var(--alpha-background-light)); border: none; border-radius: var(--border-radius-4); - color: hsla(var(--color-neutral), 1); + color: hsl(var(--color-neutral)); cursor: pointer; font-size: var(--font-size-body); padding: var(--px-8) var(--px-12); diff --git a/packages/graphiql-react/src/ui/markdown.css b/packages/graphiql-react/src/ui/markdown.css index 902c10ae746..c08f0866c17 100644 --- a/packages/graphiql-react/src/ui/markdown.css +++ b/packages/graphiql-react/src/ui/markdown.css @@ -1,9 +1,9 @@ /** * We render markdown in the following places: - * - In the hint tooltip when typing in the query editor (field description - * and optionally deprecation reason). + * - In the hint tooltip when typing in the query editor (field description + * and, optionally, deprecation reason). * - In the info tooltip when hovering over a field in the query editor - * (field description any optionally deprecation reason). + * (field description and, optionally, deprecation reason). */ .graphiql-markdown-description, @@ -87,7 +87,7 @@ & code, & pre { background-color: hsla(var(--color-neutral), var(--alpha-background-light)); - color: hsla(var(--color-neutral), 1); + color: hsl(var(--color-neutral)); } & > * { diff --git a/packages/graphiql-toolkit/docs/create-fetcher.md b/packages/graphiql-toolkit/docs/create-fetcher.md index 2d101afd1bd..b0bf5072acf 100644 --- a/packages/graphiql-toolkit/docs/create-fetcher.md +++ b/packages/graphiql-toolkit/docs/create-fetcher.md @@ -15,7 +15,7 @@ specification, and the most popular transport spec proposals. You can install `@graphiql/toolkit` using your favorite package manager: ```bash -npm install --save @graphiql/toolkit +npm install @graphiql/toolkit ``` ## Getting Started @@ -50,7 +50,7 @@ root.render(); First you'll need to install `graphql-ws` as a peer dependency: ```bash -npm install --save graphql-ws +npm install graphql-ws ``` Just by providing the `subscriptionUrl`, you can also generate a `graphql-ws` @@ -193,7 +193,7 @@ root.render(); Note that you will need to install the client separately: ```bash -npm install --save subscriptions-transport-ws +npm install subscriptions-transport-ws ``` ### Custom `fetcher` Example diff --git a/packages/graphiql/src/style.css b/packages/graphiql/src/style.css index aa3120e4a59..ed695eac028 100644 --- a/packages/graphiql/src/style.css +++ b/packages/graphiql/src/style.css @@ -33,7 +33,7 @@ } .graphiql-container .graphiql-sidebar button.active { - color: hsla(var(--color-neutral), 1); + color: hsl(var(--color-neutral)); } .graphiql-container .graphiql-sidebar button:not(:first-child) { @@ -169,7 +169,7 @@ button.graphiql-tab-add > svg { } .graphiql-container .graphiql-editor-tools button.active { - color: hsla(var(--color-neutral), 1); + color: hsl(var(--color-neutral)); } /* The tab buttons to switch between editor tools */ diff --git a/packages/graphql-language-service-cli/README.md b/packages/graphql-language-service-cli/README.md index b36a7adbe01..6114cbeb7b6 100644 --- a/packages/graphql-language-service-cli/README.md +++ b/packages/graphql-language-service-cli/README.md @@ -53,7 +53,7 @@ yarn global add graphql-language-service-cli with `npm`: ```sh -npm i -g graphql-language-service-cli +npm install -g graphql-language-service-cli ``` either will install the `graphql-lsp` bin globally diff --git a/packages/graphql-language-service-server/README.md b/packages/graphql-language-service-server/README.md index f9c18bb4120..652d604d791 100644 --- a/packages/graphql-language-service-server/README.md +++ b/packages/graphql-language-service-server/README.md @@ -42,7 +42,7 @@ Supported features include: ### Installation ```bash -npm install --save graphql-language-service-server +npm install graphql-language-service-server # or yarn add graphql-language-service-server ``` From 8849a15b6e80fe1b34e8250e74a56b85ccdb6ac6 Mon Sep 17 00:00:00 2001 From: Dimitri POSTOLOV Date: Mon, 1 Jul 2024 11:40:43 +0200 Subject: [PATCH 35/81] adjust `@graphiql/plugin-explorer` styles (#3633) --- .changeset/cuddly-plants-report.md | 5 + packages/graphiql-plugin-explorer/README.md | 15 +-- .../graphiql-plugin-explorer/package.json | 3 +- .../src/graphiql-explorer.d.ts | 6 +- .../src/icons/arrow.svg | 11 ++ .../src/icons/checkbox-checked.svg | 14 +++ .../src/icons/checkbox-unchecked.svg | 10 ++ .../src/icons/folder-plus.svg | 24 ++++ .../graphiql-plugin-explorer/src/index.css | 40 ++++-- .../graphiql-plugin-explorer/src/index.tsx | 119 ++++-------------- .../src/vite-env.d.ts | 6 + .../graphiql-plugin-explorer/vite.config.ts | 11 +- 12 files changed, 147 insertions(+), 117 deletions(-) create mode 100644 .changeset/cuddly-plants-report.md create mode 100644 packages/graphiql-plugin-explorer/src/icons/arrow.svg create mode 100644 packages/graphiql-plugin-explorer/src/icons/checkbox-checked.svg create mode 100644 packages/graphiql-plugin-explorer/src/icons/checkbox-unchecked.svg create mode 100644 packages/graphiql-plugin-explorer/src/icons/folder-plus.svg diff --git a/.changeset/cuddly-plants-report.md b/.changeset/cuddly-plants-report.md new file mode 100644 index 00000000000..0f44c6f0f91 --- /dev/null +++ b/.changeset/cuddly-plants-report.md @@ -0,0 +1,5 @@ +--- +'@graphiql/plugin-explorer': minor +--- + +adjust `@graphiql/plugin-explorer` styles diff --git a/packages/graphiql-plugin-explorer/README.md b/packages/graphiql-plugin-explorer/README.md index 2341b549efb..69bcbad7eb6 100644 --- a/packages/graphiql-plugin-explorer/README.md +++ b/packages/graphiql-plugin-explorer/README.md @@ -9,23 +9,22 @@ GraphiQL UI. Use your favorite package manager to install the package: ```sh -npm i -S @graphiql/plugin-explorer +npm install @graphiql/plugin-explorer ``` The following packages are peer dependencies, so make sure you have them installed as well: ```sh -npm i -S react react-dom graphql +npm install react react-dom graphql ``` ## Usage ```jsx -import { explorerPlugin } from '@graphiql/plugin-explorer'; -import { createGraphiQLFetcher } from '@graphiql/toolkit'; import { GraphiQL } from 'graphiql'; - +import { createGraphiQLFetcher } from '@graphiql/toolkit'; +import { explorerPlugin } from '@graphiql/plugin-explorer'; import 'graphiql/graphiql.css'; import '@graphiql/plugin-explorer/dist/style.css'; @@ -33,10 +32,12 @@ const fetcher = createGraphiQLFetcher({ url: 'https://swapi-graphql.netlify.app/.netlify/functions/index', }); -// pass the explorer props here if you want +// Pass the explorer props here if you want const explorer = explorerPlugin(); -return ; +function GraphiQLWithExplorer() { + return ; +} ``` ## CDN bundles diff --git a/packages/graphiql-plugin-explorer/package.json b/packages/graphiql-plugin-explorer/package.json index 16e5b270f56..fe7c8475cdd 100644 --- a/packages/graphiql-plugin-explorer/package.json +++ b/packages/graphiql-plugin-explorer/package.json @@ -44,6 +44,7 @@ "react": "^18.2.0", "react-dom": "^18.2.0", "typescript": "^4.6.3", - "vite": "^4.3.9" + "vite": "^4.3.9", + "vite-plugin-svgr": "^3.2.0" } } diff --git a/packages/graphiql-plugin-explorer/src/graphiql-explorer.d.ts b/packages/graphiql-plugin-explorer/src/graphiql-explorer.d.ts index 66fffce659a..089b3331a0f 100644 --- a/packages/graphiql-plugin-explorer/src/graphiql-explorer.d.ts +++ b/packages/graphiql-plugin-explorer/src/graphiql-explorer.d.ts @@ -42,7 +42,7 @@ declare module 'graphiql-explorer' { string2: string; variable: string; atom: string; - } | null; + }; arrowOpen?: ReactNode; arrowClosed?: ReactNode; checkboxChecked?: ReactNode; @@ -51,8 +51,8 @@ declare module 'graphiql-explorer' { explorerActionsStyle?: CSSProperties; buttonStyle?: CSSProperties; actionButtonStyle?: CSSProperties; - } | null; - showAttribution: boolean; + }; + showAttribution?: boolean; hideActions?: boolean; externalFragments?: FragmentDefinitionNode[]; }; diff --git a/packages/graphiql-plugin-explorer/src/icons/arrow.svg b/packages/graphiql-plugin-explorer/src/icons/arrow.svg new file mode 100644 index 00000000000..245d49ea178 --- /dev/null +++ b/packages/graphiql-plugin-explorer/src/icons/arrow.svg @@ -0,0 +1,11 @@ + + + diff --git a/packages/graphiql-plugin-explorer/src/icons/checkbox-checked.svg b/packages/graphiql-plugin-explorer/src/icons/checkbox-checked.svg new file mode 100644 index 00000000000..c77bb4d2447 --- /dev/null +++ b/packages/graphiql-plugin-explorer/src/icons/checkbox-checked.svg @@ -0,0 +1,14 @@ + + + + diff --git a/packages/graphiql-plugin-explorer/src/icons/checkbox-unchecked.svg b/packages/graphiql-plugin-explorer/src/icons/checkbox-unchecked.svg new file mode 100644 index 00000000000..64652f54408 --- /dev/null +++ b/packages/graphiql-plugin-explorer/src/icons/checkbox-unchecked.svg @@ -0,0 +1,10 @@ + + + diff --git a/packages/graphiql-plugin-explorer/src/icons/folder-plus.svg b/packages/graphiql-plugin-explorer/src/icons/folder-plus.svg new file mode 100644 index 00000000000..d6714651b81 --- /dev/null +++ b/packages/graphiql-plugin-explorer/src/icons/folder-plus.svg @@ -0,0 +1,24 @@ + + + + + diff --git a/packages/graphiql-plugin-explorer/src/index.css b/packages/graphiql-plugin-explorer/src/index.css index 96e578497e8..0c096caf793 100644 --- a/packages/graphiql-plugin-explorer/src/index.css +++ b/packages/graphiql-plugin-explorer/src/index.css @@ -4,6 +4,10 @@ width: unset !important; } +.docExplorerWrap svg { + display: unset; +} + .doc-explorer-title { font-size: var(--font-size-h2); font-weight: var(--font-weight-medium); @@ -19,20 +23,42 @@ padding: 0 !important; } -.graphiql-explorer-root > div:first-child { - padding-left: var(--px-8); - overflow: hidden !important; +.graphiql-explorer-root > div > div { + border-color: hsla( + var(--color-neutral), + var(--alpha-background-heavy) + ) !important; + padding-top: var(--px-16); } .graphiql-explorer-root input { - background: hsl(var(--color-base)); + background: unset; } .graphiql-explorer-root select { - background-color: hsl(var(--color-base)); + background: hsl(var(--color-base)) !important; border: 1px solid hsla(var(--color-neutral), var(--alpha-secondary)); border-radius: var(--border-radius-4); - color: hsl(var(--color-neutral)); - margin: 0 var(--px-4); + color: hsl(var(--color-neutral)) !important; + margin: 0 var(--px-8); padding: var(--px-4) var(--px-6); } + +.graphiql-operation-title-bar .toolbar-button { + line-height: 0; + margin-left: var(--px-8); + color: hsla(var(--color-neutral), var(--alpha-secondary, 0.6)); + font-size: var(--font-size-h3); + vertical-align: middle; +} + +.graphiql-explorer-graphql-arguments input { + line-height: 0; +} + +.graphiql-explorer-actions { + border-color: hsla( + var(--color-neutral), + var(--alpha-background-heavy) + ) !important; +} diff --git a/packages/graphiql-plugin-explorer/src/index.tsx b/packages/graphiql-plugin-explorer/src/index.tsx index c7b4bb625fd..f9908dc0456 100644 --- a/packages/graphiql-plugin-explorer/src/index.tsx +++ b/packages/graphiql-plugin-explorer/src/index.tsx @@ -1,3 +1,4 @@ +import React, { CSSProperties, useCallback } from 'react'; import { GraphiQLPlugin, useEditorContext, @@ -10,7 +11,11 @@ import { Explorer as GraphiQLExplorer, GraphiQLExplorerProps, } from 'graphiql-explorer'; -import React, { useCallback } from 'react'; + +import ArrowIcon from './icons/arrow.svg'; +import FolderPlusIcon from './icons/folder-plus.svg'; +import CheckboxUncheckedIcon from './icons/checkbox-unchecked.svg'; +import CheckboxCheckedIcon from './icons/checkbox-checked.svg'; import './graphiql-explorer.d.ts'; import './index.css'; @@ -29,92 +34,31 @@ const colors = { atom: 'hsl(var(--color-tertiary))', }; +/* eslint-disable @arthurgeron/react-usememo/require-usememo */ const arrowOpen = ( - - - -); - -const arrowClosed = ( - - - + ); - +const arrowClosed = ; const checkboxUnchecked = ( - - - + ); - const checkboxChecked = ( - - - - + ); +/* eslint-enable @arthurgeron/react-usememo/require-usememo */ -const styles = { +const styles: Record = { buttonStyle: { - backgroundColor: 'transparent', - border: 'none', - color: 'hsla(var(--color-neutral), var(--alpha-secondary, 0.6))', cursor: 'pointer', - fontSize: '1em', + fontSize: '2em', + lineHeight: 0, }, explorerActionsStyle: { - padding: 'var(--px-8) var(--px-4)', - }, - actionButtonStyle: { - backgroundColor: 'transparent', - border: 'none', - color: 'hsla(var(--color-neutral), var(--alpha-secondary, 0.6))', - cursor: 'pointer', - fontSize: '1em', + paddingTop: 'var(--px-16)', }, + actionButtonStyle: {}, }; export type GraphiQLExplorerPluginProps = Omit< @@ -163,32 +107,11 @@ function ExplorerPlugin(props: GraphiQLExplorerPluginProps) { } export function explorerPlugin( - props: GraphiQLExplorerPluginProps, + props?: GraphiQLExplorerPluginProps, ): GraphiQLPlugin { return { title: 'GraphiQL Explorer', - icon: () => ( - - - - - - ), + icon: FolderPlusIcon, content: () => , }; } diff --git a/packages/graphiql-plugin-explorer/src/vite-env.d.ts b/packages/graphiql-plugin-explorer/src/vite-env.d.ts index 11f02fe2a00..5fd9fd7b028 100644 --- a/packages/graphiql-plugin-explorer/src/vite-env.d.ts +++ b/packages/graphiql-plugin-explorer/src/vite-env.d.ts @@ -1 +1,7 @@ +declare module '*.svg' { + import { FC, SVGProps } from 'react'; + const ReactComponent: FC>; + export default ReactComponent; +} + /// diff --git a/packages/graphiql-plugin-explorer/vite.config.ts b/packages/graphiql-plugin-explorer/vite.config.ts index cd4a63c8c99..1d5c67ddf62 100644 --- a/packages/graphiql-plugin-explorer/vite.config.ts +++ b/packages/graphiql-plugin-explorer/vite.config.ts @@ -1,11 +1,20 @@ import { defineConfig } from 'vite'; import react from '@vitejs/plugin-react'; +import svgr from 'vite-plugin-svgr'; import packageJSON from './package.json'; const IS_UMD = process.env.UMD === 'true'; export default defineConfig({ - plugins: [react({ jsxRuntime: 'classic' })], + plugins: [ + react({ jsxRuntime: 'classic' }), + svgr({ + exportAsDefault: true, + svgrOptions: { + titleProp: true, + }, + }), + ], build: { // avoid clean cjs/es builds emptyOutDir: !IS_UMD, From 1acb442a3ed4c0f0bcbc2c8d0a2a26ce4a87c470 Mon Sep 17 00:00:00 2001 From: Rikki Schulte Date: Mon, 1 Jul 2024 12:01:31 +0200 Subject: [PATCH 36/81] Version Packages (#3635) Co-authored-by: github-actions[bot] --- .changeset/cuddly-plants-report.md | 5 ----- .changeset/fair-cups-cry.md | 7 ------- examples/graphiql-webpack/package.json | 8 ++++---- packages/graphiql-plugin-code-exporter/CHANGELOG.md | 9 +++++++++ packages/graphiql-plugin-code-exporter/package.json | 6 +++--- packages/graphiql-plugin-explorer/CHANGELOG.md | 11 +++++++++++ packages/graphiql-plugin-explorer/package.json | 6 +++--- packages/graphiql-react/CHANGELOG.md | 6 ++++++ packages/graphiql-react/package.json | 2 +- packages/graphiql/CHANGELOG.md | 9 +++++++++ packages/graphiql/package.json | 4 ++-- 11 files changed, 48 insertions(+), 25 deletions(-) delete mode 100644 .changeset/cuddly-plants-report.md delete mode 100644 .changeset/fair-cups-cry.md diff --git a/.changeset/cuddly-plants-report.md b/.changeset/cuddly-plants-report.md deleted file mode 100644 index 0f44c6f0f91..00000000000 --- a/.changeset/cuddly-plants-report.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@graphiql/plugin-explorer': minor ---- - -adjust `@graphiql/plugin-explorer` styles diff --git a/.changeset/fair-cups-cry.md b/.changeset/fair-cups-cry.md deleted file mode 100644 index b78d9034905..00000000000 --- a/.changeset/fair-cups-cry.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'graphiql': patch -'@graphiql/plugin-code-exporter': patch -'@graphiql/react': patch ---- - -when alpha is `1`, use `hsl` instead of `hsla` diff --git a/examples/graphiql-webpack/package.json b/examples/graphiql-webpack/package.json index 83277a9af33..7c7fa22f1fb 100644 --- a/examples/graphiql-webpack/package.json +++ b/examples/graphiql-webpack/package.json @@ -9,11 +9,11 @@ "start": "NODE_ENV=development webpack-cli serve" }, "dependencies": { - "@graphiql/plugin-code-exporter": "^3.0.3", - "@graphiql/plugin-explorer": "^3.0.3", + "@graphiql/plugin-code-exporter": "^3.0.4", + "@graphiql/plugin-explorer": "^3.1.0", "@graphiql/toolkit": "^0.9.1", - "@graphiql/react": "^0.22.3", - "graphiql": "^3.3.1", + "@graphiql/react": "^0.22.4", + "graphiql": "^3.3.2", "graphql": "^16.8.1", "graphql-ws": "^5.5.5", "react": "^18.2.0", diff --git a/packages/graphiql-plugin-code-exporter/CHANGELOG.md b/packages/graphiql-plugin-code-exporter/CHANGELOG.md index 70d30de1abc..c82a7b3a90e 100644 --- a/packages/graphiql-plugin-code-exporter/CHANGELOG.md +++ b/packages/graphiql-plugin-code-exporter/CHANGELOG.md @@ -1,5 +1,14 @@ # @graphiql/plugin-code-exporter +## 3.0.4 + +### Patch Changes + +- [#3634](https://github.com/graphql/graphiql/pull/3634) [`adf0ba01`](https://github.com/graphql/graphiql/commit/adf0ba019902dcac2e49ccee69b79a6665c4766d) Thanks [@dimaMachina](https://github.com/dimaMachina)! - when alpha is `1`, use `hsl` instead of `hsla` + +- Updated dependencies [[`adf0ba01`](https://github.com/graphql/graphiql/commit/adf0ba019902dcac2e49ccee69b79a6665c4766d)]: + - @graphiql/react@0.22.4 + ## 3.0.3 ### Patch Changes diff --git a/packages/graphiql-plugin-code-exporter/package.json b/packages/graphiql-plugin-code-exporter/package.json index 638230dfa9a..b8d14aedfb3 100644 --- a/packages/graphiql-plugin-code-exporter/package.json +++ b/packages/graphiql-plugin-code-exporter/package.json @@ -1,6 +1,6 @@ { "name": "@graphiql/plugin-code-exporter", - "version": "3.0.3", + "version": "3.0.4", "repository": { "type": "git", "url": "https://github.com/graphql/graphiql", @@ -33,13 +33,13 @@ "graphiql-code-exporter": "^3.0.3" }, "peerDependencies": { - "@graphiql/react": "^0.22.3", + "@graphiql/react": "^0.22.4", "graphql": "^15.5.0 || ^16.0.0", "react": "^16.8.0 || ^17 || ^18", "react-dom": "^16.8.0 || ^17 || ^18" }, "devDependencies": { - "@graphiql/react": "^0.22.3", + "@graphiql/react": "^0.22.4", "@vitejs/plugin-react": "^4.0.1", "graphql": "^16.8.1", "postcss-nesting": "^10.1.7", diff --git a/packages/graphiql-plugin-explorer/CHANGELOG.md b/packages/graphiql-plugin-explorer/CHANGELOG.md index da52836204a..4ba4b13d777 100644 --- a/packages/graphiql-plugin-explorer/CHANGELOG.md +++ b/packages/graphiql-plugin-explorer/CHANGELOG.md @@ -1,5 +1,16 @@ # @graphiql/plugin-explorer +## 3.1.0 + +### Minor Changes + +- [#3633](https://github.com/graphql/graphiql/pull/3633) [`8849a15b`](https://github.com/graphql/graphiql/commit/8849a15b6e80fe1b34e8250e74a56b85ccdb6ac6) Thanks [@dimaMachina](https://github.com/dimaMachina)! - adjust `@graphiql/plugin-explorer` styles + +### Patch Changes + +- Updated dependencies [[`adf0ba01`](https://github.com/graphql/graphiql/commit/adf0ba019902dcac2e49ccee69b79a6665c4766d)]: + - @graphiql/react@0.22.4 + ## 3.0.3 ### Patch Changes diff --git a/packages/graphiql-plugin-explorer/package.json b/packages/graphiql-plugin-explorer/package.json index fe7c8475cdd..94753463bd7 100644 --- a/packages/graphiql-plugin-explorer/package.json +++ b/packages/graphiql-plugin-explorer/package.json @@ -1,6 +1,6 @@ { "name": "@graphiql/plugin-explorer", - "version": "3.0.3", + "version": "3.1.0", "repository": { "type": "git", "url": "https://github.com/graphql/graphiql", @@ -32,13 +32,13 @@ "graphiql-explorer": "^0.9.0" }, "peerDependencies": { - "@graphiql/react": "^0.22.3", + "@graphiql/react": "^0.22.4", "graphql": "^15.5.0 || ^16.0.0", "react": "^16.8.0 || ^17 || ^18", "react-dom": "^16.8.0 || ^17 || ^18" }, "devDependencies": { - "@graphiql/react": "^0.22.3", + "@graphiql/react": "^0.22.4", "@vitejs/plugin-react": "^4.0.1", "graphql": "^16.8.1", "react": "^18.2.0", diff --git a/packages/graphiql-react/CHANGELOG.md b/packages/graphiql-react/CHANGELOG.md index 28db055021e..63b6185f5a5 100644 --- a/packages/graphiql-react/CHANGELOG.md +++ b/packages/graphiql-react/CHANGELOG.md @@ -1,5 +1,11 @@ # @graphiql/react +## 0.22.4 + +### Patch Changes + +- [#3634](https://github.com/graphql/graphiql/pull/3634) [`adf0ba01`](https://github.com/graphql/graphiql/commit/adf0ba019902dcac2e49ccee69b79a6665c4766d) Thanks [@dimaMachina](https://github.com/dimaMachina)! - when alpha is `1`, use `hsl` instead of `hsla` + ## 0.22.3 ### Patch Changes diff --git a/packages/graphiql-react/package.json b/packages/graphiql-react/package.json index af35f6cb010..bc5e49240d4 100644 --- a/packages/graphiql-react/package.json +++ b/packages/graphiql-react/package.json @@ -1,6 +1,6 @@ { "name": "@graphiql/react", - "version": "0.22.3", + "version": "0.22.4", "repository": { "type": "git", "url": "https://github.com/graphql/graphiql", diff --git a/packages/graphiql/CHANGELOG.md b/packages/graphiql/CHANGELOG.md index 72e7d5abd57..a4d5333c76b 100644 --- a/packages/graphiql/CHANGELOG.md +++ b/packages/graphiql/CHANGELOG.md @@ -1,5 +1,14 @@ # Change Log +## 3.3.2 + +### Patch Changes + +- [#3634](https://github.com/graphql/graphiql/pull/3634) [`adf0ba01`](https://github.com/graphql/graphiql/commit/adf0ba019902dcac2e49ccee69b79a6665c4766d) Thanks [@dimaMachina](https://github.com/dimaMachina)! - when alpha is `1`, use `hsl` instead of `hsla` + +- Updated dependencies [[`adf0ba01`](https://github.com/graphql/graphiql/commit/adf0ba019902dcac2e49ccee69b79a6665c4766d)]: + - @graphiql/react@0.22.4 + ## 3.3.1 ### Patch Changes diff --git a/packages/graphiql/package.json b/packages/graphiql/package.json index 32b47abc6da..eae04d5b517 100644 --- a/packages/graphiql/package.json +++ b/packages/graphiql/package.json @@ -1,6 +1,6 @@ { "name": "graphiql", - "version": "3.3.1", + "version": "3.3.2", "description": "An graphical interactive in-browser GraphQL IDE.", "contributors": [ "Hyohyeon Jeong ", @@ -47,7 +47,7 @@ "webpack": "webpack-cli --config resources/webpack.config.js" }, "dependencies": { - "@graphiql/react": "^0.22.3", + "@graphiql/react": "^0.22.4", "@graphiql/toolkit": "^0.9.1", "graphql-language-service": "^5.2.1", "markdown-it": "^14.1.0" From ef57ce50d5bbf2f37bb74b3018e5a9004b70f2f2 Mon Sep 17 00:00:00 2001 From: Dimitri POSTOLOV Date: Mon, 1 Jul 2024 12:19:14 +0200 Subject: [PATCH 37/81] update prettier, prettify `*.svg` (#3636) --- .prettierrc | 6 +++ examples/graphiql-webpack/public/logo.svg | 28 ++++++++++- examples/monaco-graphql-nextjs/package.json | 2 +- .../monaco-graphql-react-vite/package.json | 2 +- examples/monaco-graphql-webpack/package.json | 2 +- package.json | 4 +- .../src/utils/getTypeInfo.ts | 10 ++-- .../src/utils/info-addon.ts | 4 +- .../graphiql-react/src/icons/argument.svg | 15 ++++-- .../graphiql-react/src/icons/chevron-down.svg | 9 +++- .../graphiql-react/src/icons/chevron-left.svg | 13 ++++- .../graphiql-react/src/icons/chevron-up.svg | 9 +++- packages/graphiql-react/src/icons/close.svg | 12 +++-- packages/graphiql-react/src/icons/copy.svg | 23 +++++++-- .../src/icons/deprecated-argument.svg | 17 +++++-- .../src/icons/deprecated-enum-value.svg | 18 +++++-- .../src/icons/deprecated-field.svg | 21 +++++++-- .../graphiql-react/src/icons/directive.svg | 17 ++++++- .../graphiql-react/src/icons/docs-filled.svg | 26 ++++++++-- packages/graphiql-react/src/icons/docs.svg | 22 +++++++-- .../graphiql-react/src/icons/enum-value.svg | 16 +++++-- packages/graphiql-react/src/icons/field.svg | 19 ++++++-- packages/graphiql-react/src/icons/history.svg | 27 +++++++++-- .../graphiql-react/src/icons/implements.svg | 20 ++++++-- .../src/icons/keyboard-shortcut.svg | 47 ++++++++++++++++--- .../src/icons/magnifying-glass.svg | 18 +++++-- packages/graphiql-react/src/icons/merge.svg | 23 +++++++-- packages/graphiql-react/src/icons/pen.svg | 28 +++++++++-- packages/graphiql-react/src/icons/play.svg | 12 ++++- packages/graphiql-react/src/icons/plus.svg | 13 ++++- .../graphiql-react/src/icons/prettify.svg | 40 +++++++++++++--- packages/graphiql-react/src/icons/reload.svg | 33 +++++++++++-- .../graphiql-react/src/icons/root-type.svg | 23 +++++++-- .../graphiql-react/src/icons/settings.svg | 14 +++++- .../graphiql-react/src/icons/star-filled.svg | 13 ++++- packages/graphiql-react/src/icons/star.svg | 13 ++++- packages/graphiql-react/src/icons/stop.svg | 9 +++- packages/graphiql-react/src/icons/trash.svg | 21 +++++++-- packages/graphiql-react/src/icons/type.svg | 19 ++++++-- packages/graphiql/test/images/logo.svg | 28 ++++++++++- .../src/GraphQLLanguageService.ts | 10 ++-- .../src/__tests__/MessageProcessor.test.ts | 10 ++-- .../src/startServer.ts | 5 +- .../benchmark/fixtures/github.graphql | 16 +++---- .../src/interface/getDiagnostics.ts | 4 +- .../src/parser/Rules.ts | 4 +- packages/monaco-graphql/package.json | 2 +- .../src/helpers/network.ts | 5 +- yarn.lock | 46 +++++------------- 49 files changed, 620 insertions(+), 178 deletions(-) diff --git a/.prettierrc b/.prettierrc index a219e18edf6..d0ab7b6eb11 100644 --- a/.prettierrc +++ b/.prettierrc @@ -10,6 +10,12 @@ "printWidth": 80, "proseWrap": "preserve" } + }, + { + "files": "*.svg", + "options": { + "parser": "html" + } } ] } diff --git a/examples/graphiql-webpack/public/logo.svg b/examples/graphiql-webpack/public/logo.svg index 337843aca18..43e513e06ca 100644 --- a/examples/graphiql-webpack/public/logo.svg +++ b/examples/graphiql-webpack/public/logo.svg @@ -1 +1,27 @@ - + + + + + + + + + diff --git a/examples/monaco-graphql-nextjs/package.json b/examples/monaco-graphql-nextjs/package.json index 15fffa52554..1c3c7ed64e4 100644 --- a/examples/monaco-graphql-nextjs/package.json +++ b/examples/monaco-graphql-nextjs/package.json @@ -18,7 +18,7 @@ "monaco-editor-webpack-plugin": "^7.0.1", "monaco-graphql": "^1.5.2", "next": "13.4.7", - "prettier": "3.0.0-alpha.12", + "prettier": "3.3.2", "react": "^18.2.0", "react-dom": "^18.2.0" }, diff --git a/examples/monaco-graphql-react-vite/package.json b/examples/monaco-graphql-react-vite/package.json index 1d4b73d15c0..b794e520d5f 100644 --- a/examples/monaco-graphql-react-vite/package.json +++ b/examples/monaco-graphql-react-vite/package.json @@ -9,7 +9,7 @@ "jsonc-parser": "^3.2.0", "monaco-editor": "^0.39.0", "monaco-graphql": "^1.5.2", - "prettier": "3.0.0-alpha.12", + "prettier": "3.3.2", "react": "^18.2.0", "react-dom": "^18.2.0" }, diff --git a/examples/monaco-graphql-webpack/package.json b/examples/monaco-graphql-webpack/package.json index c02fd42949c..d42ce071b6e 100644 --- a/examples/monaco-graphql-webpack/package.json +++ b/examples/monaco-graphql-webpack/package.json @@ -15,7 +15,7 @@ "jsonc-parser": "^3.2.0", "monaco-editor": "^0.39.0", "monaco-graphql": "^1.5.2", - "prettier": "3.0.0-alpha.12" + "prettier": "3.3.2" }, "devDependencies": { "@babel/core": "^7.21.0", diff --git a/package.json b/package.json index ddf616af046..2fbeec0c3bb 100644 --- a/package.json +++ b/package.json @@ -108,7 +108,7 @@ "copy": "^0.3.2", "cspell": "^5.15.2", "eslint": "^8.43.0", - "eslint-config-prettier": "^8.8.0", + "eslint-config-prettier": "^9.1.0", "eslint-import-resolver-typescript": "^3.5.5", "eslint-plugin-cypress": "^2.13.3", "eslint-plugin-import": "^2.27.5", @@ -129,7 +129,7 @@ "mkdirp": "^1.0.4", "patch-package": "^7.0.2", "postinstall-postinstall": "^2.1.0", - "prettier": "3.0.0-alpha.12", + "prettier": "3.3.2", "rimraf": "^3.0.2", "ts-jest": "^27.1.5", "typedoc": "^0.19.2", diff --git a/packages/codemirror-graphql/src/utils/getTypeInfo.ts b/packages/codemirror-graphql/src/utils/getTypeInfo.ts index 6e14588d4d9..410cf4db288 100644 --- a/packages/codemirror-graphql/src/utils/getTypeInfo.ts +++ b/packages/codemirror-graphql/src/utils/getTypeInfo.ts @@ -97,11 +97,11 @@ export default function getTypeInfo(schema: GraphQLSchema, tokenState: State) { ? state.prevState.kind === 'Field' ? info.fieldDef : state.prevState.kind === 'Directive' - ? info.directiveDef - : state.prevState.kind === 'AliasedField' - ? state.prevState.name && - getFieldDef(schema, info.parentType, state.prevState.name) - : null + ? info.directiveDef + : state.prevState.kind === 'AliasedField' + ? state.prevState.name && + getFieldDef(schema, info.parentType, state.prevState.name) + : null : null; info.argDefs = parentDef ? (parentDef.args as GraphQLArgument[]) : null; break; diff --git a/packages/codemirror-graphql/src/utils/info-addon.ts b/packages/codemirror-graphql/src/utils/info-addon.ts index 5b017faae8d..cff916607ce 100644 --- a/packages/codemirror-graphql/src/utils/info-addon.ts +++ b/packages/codemirror-graphql/src/utils/info-addon.ts @@ -39,8 +39,8 @@ function createState(options: GraphQLInfoOptions) { options instanceof Function ? { render: options } : options === true - ? {} - : options, + ? {} + : options, }; } diff --git a/packages/graphiql-react/src/icons/argument.svg b/packages/graphiql-react/src/icons/argument.svg index 3a981c90c84..5fd2025608a 100644 --- a/packages/graphiql-react/src/icons/argument.svg +++ b/packages/graphiql-react/src/icons/argument.svg @@ -1,4 +1,13 @@ - - - + + + diff --git a/packages/graphiql-react/src/icons/chevron-down.svg b/packages/graphiql-react/src/icons/chevron-down.svg index d02fbfb48c2..1bf38d47c2a 100644 --- a/packages/graphiql-react/src/icons/chevron-down.svg +++ b/packages/graphiql-react/src/icons/chevron-down.svg @@ -1,3 +1,8 @@ - - + + diff --git a/packages/graphiql-react/src/icons/chevron-left.svg b/packages/graphiql-react/src/icons/chevron-left.svg index b740c1d21df..0f5a0f2af42 100644 --- a/packages/graphiql-react/src/icons/chevron-left.svg +++ b/packages/graphiql-react/src/icons/chevron-left.svg @@ -1,3 +1,12 @@ - - + + diff --git a/packages/graphiql-react/src/icons/chevron-up.svg b/packages/graphiql-react/src/icons/chevron-up.svg index 617bf886d24..ff4486e1de7 100644 --- a/packages/graphiql-react/src/icons/chevron-up.svg +++ b/packages/graphiql-react/src/icons/chevron-up.svg @@ -1,3 +1,8 @@ - - + + diff --git a/packages/graphiql-react/src/icons/close.svg b/packages/graphiql-react/src/icons/close.svg index 4e88a636b66..2d835365a1e 100644 --- a/packages/graphiql-react/src/icons/close.svg +++ b/packages/graphiql-react/src/icons/close.svg @@ -1,4 +1,10 @@ - - - + + + diff --git a/packages/graphiql-react/src/icons/copy.svg b/packages/graphiql-react/src/icons/copy.svg index c18b6e78a00..578e644ee4d 100644 --- a/packages/graphiql-react/src/icons/copy.svg +++ b/packages/graphiql-react/src/icons/copy.svg @@ -1,4 +1,21 @@ - - - + + + diff --git a/packages/graphiql-react/src/icons/deprecated-argument.svg b/packages/graphiql-react/src/icons/deprecated-argument.svg index 5da9ce09f52..87752fe5ffe 100644 --- a/packages/graphiql-react/src/icons/deprecated-argument.svg +++ b/packages/graphiql-react/src/icons/deprecated-argument.svg @@ -1,5 +1,14 @@ - - - - + + + + diff --git a/packages/graphiql-react/src/icons/deprecated-enum-value.svg b/packages/graphiql-react/src/icons/deprecated-enum-value.svg index 8e44d419817..4b1a81034fe 100644 --- a/packages/graphiql-react/src/icons/deprecated-enum-value.svg +++ b/packages/graphiql-react/src/icons/deprecated-enum-value.svg @@ -1,5 +1,15 @@ - - - - + + + + diff --git a/packages/graphiql-react/src/icons/deprecated-field.svg b/packages/graphiql-react/src/icons/deprecated-field.svg index fd07672d975..8fd99c896a0 100644 --- a/packages/graphiql-react/src/icons/deprecated-field.svg +++ b/packages/graphiql-react/src/icons/deprecated-field.svg @@ -1,5 +1,18 @@ - - - - + + + + diff --git a/packages/graphiql-react/src/icons/directive.svg b/packages/graphiql-react/src/icons/directive.svg index 5cdd18314ff..14b8ed1ff38 100644 --- a/packages/graphiql-react/src/icons/directive.svg +++ b/packages/graphiql-react/src/icons/directive.svg @@ -1,4 +1,17 @@ - - + + diff --git a/packages/graphiql-react/src/icons/docs-filled.svg b/packages/graphiql-react/src/icons/docs-filled.svg index 15e197e760d..56938f94158 100644 --- a/packages/graphiql-react/src/icons/docs-filled.svg +++ b/packages/graphiql-react/src/icons/docs-filled.svg @@ -1,5 +1,23 @@ - - - - + + + + diff --git a/packages/graphiql-react/src/icons/docs.svg b/packages/graphiql-react/src/icons/docs.svg index 4c2bf68a40c..55869ef615b 100644 --- a/packages/graphiql-react/src/icons/docs.svg +++ b/packages/graphiql-react/src/icons/docs.svg @@ -1,4 +1,20 @@ - - - + + + diff --git a/packages/graphiql-react/src/icons/enum-value.svg b/packages/graphiql-react/src/icons/enum-value.svg index d677ef519f0..5132bb75308 100644 --- a/packages/graphiql-react/src/icons/enum-value.svg +++ b/packages/graphiql-react/src/icons/enum-value.svg @@ -1,4 +1,14 @@ - - - + + + diff --git a/packages/graphiql-react/src/icons/field.svg b/packages/graphiql-react/src/icons/field.svg index 58bfbfa987f..ab8c7f6390f 100644 --- a/packages/graphiql-react/src/icons/field.svg +++ b/packages/graphiql-react/src/icons/field.svg @@ -1,4 +1,17 @@ - - - + + + diff --git a/packages/graphiql-react/src/icons/history.svg b/packages/graphiql-react/src/icons/history.svg index 3a632094812..ef69e5c9b70 100644 --- a/packages/graphiql-react/src/icons/history.svg +++ b/packages/graphiql-react/src/icons/history.svg @@ -1,5 +1,24 @@ - - - - + + + + diff --git a/packages/graphiql-react/src/icons/implements.svg b/packages/graphiql-react/src/icons/implements.svg index 31b7ba1c310..43b3374052a 100644 --- a/packages/graphiql-react/src/icons/implements.svg +++ b/packages/graphiql-react/src/icons/implements.svg @@ -1,4 +1,18 @@ - - - + + + diff --git a/packages/graphiql-react/src/icons/keyboard-shortcut.svg b/packages/graphiql-react/src/icons/keyboard-shortcut.svg index c578c7715ed..03beab5acc6 100644 --- a/packages/graphiql-react/src/icons/keyboard-shortcut.svg +++ b/packages/graphiql-react/src/icons/keyboard-shortcut.svg @@ -1,7 +1,42 @@ - - - - - - + + + + + + diff --git a/packages/graphiql-react/src/icons/magnifying-glass.svg b/packages/graphiql-react/src/icons/magnifying-glass.svg index b2593871633..67ee280f9f0 100644 --- a/packages/graphiql-react/src/icons/magnifying-glass.svg +++ b/packages/graphiql-react/src/icons/magnifying-glass.svg @@ -1,4 +1,16 @@ - - - + + + diff --git a/packages/graphiql-react/src/icons/merge.svg b/packages/graphiql-react/src/icons/merge.svg index c4db221b4d8..e007c1df3c5 100644 --- a/packages/graphiql-react/src/icons/merge.svg +++ b/packages/graphiql-react/src/icons/merge.svg @@ -1,6 +1,19 @@ - - - - - + + + + + diff --git a/packages/graphiql-react/src/icons/pen.svg b/packages/graphiql-react/src/icons/pen.svg index 365a3b2431a..9f252d9ba54 100644 --- a/packages/graphiql-react/src/icons/pen.svg +++ b/packages/graphiql-react/src/icons/pen.svg @@ -1,5 +1,25 @@ - - - - + + + + diff --git a/packages/graphiql-react/src/icons/play.svg b/packages/graphiql-react/src/icons/play.svg index 9f194110940..b5bd34659f0 100644 --- a/packages/graphiql-react/src/icons/play.svg +++ b/packages/graphiql-react/src/icons/play.svg @@ -1,3 +1,11 @@ - - + + diff --git a/packages/graphiql-react/src/icons/plus.svg b/packages/graphiql-react/src/icons/plus.svg index 22d8581a201..886a1b4e572 100644 --- a/packages/graphiql-react/src/icons/plus.svg +++ b/packages/graphiql-react/src/icons/plus.svg @@ -1,3 +1,12 @@ - - + + diff --git a/packages/graphiql-react/src/icons/prettify.svg b/packages/graphiql-react/src/icons/prettify.svg index 490de60576e..516ffa5d95b 100644 --- a/packages/graphiql-react/src/icons/prettify.svg +++ b/packages/graphiql-react/src/icons/prettify.svg @@ -1,7 +1,35 @@ - - - - - - + + + + + + diff --git a/packages/graphiql-react/src/icons/reload.svg b/packages/graphiql-react/src/icons/reload.svg index 853c18128fa..553b4e16f54 100644 --- a/packages/graphiql-react/src/icons/reload.svg +++ b/packages/graphiql-react/src/icons/reload.svg @@ -1,6 +1,29 @@ - - - - - + + + + + diff --git a/packages/graphiql-react/src/icons/root-type.svg b/packages/graphiql-react/src/icons/root-type.svg index 29ffd5a325a..30b0e69f5f8 100644 --- a/packages/graphiql-react/src/icons/root-type.svg +++ b/packages/graphiql-react/src/icons/root-type.svg @@ -1,4 +1,21 @@ - - - + + + diff --git a/packages/graphiql-react/src/icons/settings.svg b/packages/graphiql-react/src/icons/settings.svg index f7cf68be0a1..9c0b128fdb2 100644 --- a/packages/graphiql-react/src/icons/settings.svg +++ b/packages/graphiql-react/src/icons/settings.svg @@ -1,3 +1,13 @@ - - + + diff --git a/packages/graphiql-react/src/icons/star-filled.svg b/packages/graphiql-react/src/icons/star-filled.svg index 3c71764a882..27c2cd13ab4 100644 --- a/packages/graphiql-react/src/icons/star-filled.svg +++ b/packages/graphiql-react/src/icons/star-filled.svg @@ -1,3 +1,12 @@ - - + + diff --git a/packages/graphiql-react/src/icons/star.svg b/packages/graphiql-react/src/icons/star.svg index 8399e72b0d7..b9fdcffa594 100644 --- a/packages/graphiql-react/src/icons/star.svg +++ b/packages/graphiql-react/src/icons/star.svg @@ -1,3 +1,12 @@ - - + + diff --git a/packages/graphiql-react/src/icons/stop.svg b/packages/graphiql-react/src/icons/stop.svg index 02d9a7b321a..defca5fb2eb 100644 --- a/packages/graphiql-react/src/icons/stop.svg +++ b/packages/graphiql-react/src/icons/stop.svg @@ -1,3 +1,8 @@ - - + + diff --git a/packages/graphiql-react/src/icons/trash.svg b/packages/graphiql-react/src/icons/trash.svg index 91917ac8f29..68d993d4566 100644 --- a/packages/graphiql-react/src/icons/trash.svg +++ b/packages/graphiql-react/src/icons/trash.svg @@ -1,5 +1,18 @@ -
+
{pluginContext?.plugins.map((plugin, index) => { From 93c7e9fd224cb4f1e9a86b3391efc1e0ef6e1e3f Mon Sep 17 00:00:00 2001 From: Dimitri POSTOLOV Date: Thu, 25 Jul 2024 11:19:21 +0200 Subject: [PATCH 47/81] [vite] set `build.minify: false` for cjs/esm builds (#3656) * aa * Update .changeset/tidy-fans-reflect.md --- .changeset/tidy-fans-reflect.md | 7 +++++++ packages/graphiql-plugin-code-exporter/vite.config.ts | 1 + packages/graphiql-plugin-explorer/vite.config.ts | 1 + packages/graphiql-react/vite.config.ts | 6 +----- 4 files changed, 10 insertions(+), 5 deletions(-) create mode 100644 .changeset/tidy-fans-reflect.md diff --git a/.changeset/tidy-fans-reflect.md b/.changeset/tidy-fans-reflect.md new file mode 100644 index 00000000000..3f08a9261e2 --- /dev/null +++ b/.changeset/tidy-fans-reflect.md @@ -0,0 +1,7 @@ +--- +"@graphiql/plugin-code-exporter": patch +"@graphiql/plugin-explorer": patch +"@graphiql/react": patch +--- + +set `build.minify: false` for cjs/esm builds since minified variable names change every build time diff --git a/packages/graphiql-plugin-code-exporter/vite.config.ts b/packages/graphiql-plugin-code-exporter/vite.config.ts index 7db8ba68dcc..b963a34933f 100644 --- a/packages/graphiql-plugin-code-exporter/vite.config.ts +++ b/packages/graphiql-plugin-code-exporter/vite.config.ts @@ -7,6 +7,7 @@ const IS_UMD = process.env.UMD === 'true'; export default defineConfig({ plugins: [react({ jsxRuntime: 'classic' })], build: { + minify: IS_UMD ? 'esbuild' : false, // avoid clean cjs/es builds emptyOutDir: !IS_UMD, lib: { diff --git a/packages/graphiql-plugin-explorer/vite.config.ts b/packages/graphiql-plugin-explorer/vite.config.ts index 1d5c67ddf62..e47ea748b70 100644 --- a/packages/graphiql-plugin-explorer/vite.config.ts +++ b/packages/graphiql-plugin-explorer/vite.config.ts @@ -16,6 +16,7 @@ export default defineConfig({ }), ], build: { + minify: IS_UMD ? 'esbuild' : false, // avoid clean cjs/es builds emptyOutDir: !IS_UMD, lib: { diff --git a/packages/graphiql-react/vite.config.ts b/packages/graphiql-react/vite.config.ts index 08df2c79573..fb552395aaf 100644 --- a/packages/graphiql-react/vite.config.ts +++ b/packages/graphiql-react/vite.config.ts @@ -19,12 +19,8 @@ export default defineConfig({ plugins: [postCssNestingPlugin()], }, }, - esbuild: { - // We use function names for generating readable error messages, so we want - // them to be preserved when building and minifying. - keepNames: true, - }, build: { + minify: false, sourcemap: true, lib: { entry: 'src/index.ts', From 5bc7b84531b6404553787615d61a5cbcc96c1d6f Mon Sep 17 00:00:00 2001 From: Dimitri POSTOLOV Date: Thu, 25 Jul 2024 12:17:00 +0200 Subject: [PATCH 48/81] update vite to v5 (#3657) * aa * update vite to v5 * aa * fix tests * fix * Update .changeset/fifty-swans-care.md --- .changeset/fifty-swans-care.md | 7 + .eslintrc.js | 9 +- .../monaco-graphql-react-vite/package.json | 4 +- package.json | 2 +- .../package.json | 4 +- .../{vite.config.ts => vite.config.mts} | 0 .../graphiql-plugin-explorer/package.json | 6 +- .../graphiql-plugin-explorer/src/index.tsx | 8 +- .../src/vite-env.d.ts | 7 +- .../{vite.config.ts => vite.config.mts} | 0 packages/graphiql-react/jest.config.js | 2 +- packages/graphiql-react/package.json | 6 +- packages/graphiql-react/src/icons/index.tsx | 89 +- packages/graphiql-react/src/icons/trash.svg | 3 +- packages/graphiql-react/src/vite-env.d.ts | 1 + .../{vite.config.ts => vite.config.mts} | 0 packages/graphiql/jest.config.js | 2 +- .../{vite.config.ts => vitest.config.mts} | 0 .../{vite.config.ts => vitest.config.mts} | 0 tsconfig.eslint.json | 3 +- yarn.lock | 1184 ++++++++++------- 21 files changed, 791 insertions(+), 546 deletions(-) create mode 100644 .changeset/fifty-swans-care.md rename packages/graphiql-plugin-code-exporter/{vite.config.ts => vite.config.mts} (100%) rename packages/graphiql-plugin-explorer/{vite.config.ts => vite.config.mts} (100%) rename packages/graphiql-react/{vite.config.ts => vite.config.mts} (100%) rename packages/monaco-graphql/{vite.config.ts => vitest.config.mts} (100%) rename packages/vscode-graphql-syntax/{vite.config.ts => vitest.config.mts} (100%) diff --git a/.changeset/fifty-swans-care.md b/.changeset/fifty-swans-care.md new file mode 100644 index 00000000000..a43a3692a8e --- /dev/null +++ b/.changeset/fifty-swans-care.md @@ -0,0 +1,7 @@ +--- +"@graphiql/plugin-code-exporter": patch +"@graphiql/plugin-explorer": patch +"@graphiql/react": minor +--- + +update vite to v5 diff --git a/.eslintrc.js b/.eslintrc.js index 521e132c476..497392296af 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -35,7 +35,7 @@ module.exports = { overrides: [ { // Rules for all code files - files: ['**/*.{js,jsx,ts,tsx}'], + files: ['**/*.{js,jsx,ts,tsx,mts,cts}'], parserOptions: { ecmaVersion: 6, }, @@ -342,7 +342,10 @@ module.exports = { 'sonar/prefer-promise-shorthand': 'error', 'sonar/no-dead-store': 'error', 'unicorn/prefer-node-protocol': 'error', - 'import/no-unresolved': ['error', { ignore: ['^node:'] }], + 'import/no-unresolved': [ + 'error', + { ignore: ['^node:', '\\.svg\\?react$'] }, + ], 'unicorn/prefer-string-replace-all': 'error', 'unicorn/no-hex-escape': 'off', // TODO: enable // doesn't catch a lot of cases; we use ESLint builtin `no-restricted-syntax` to forbid `.keyCode` @@ -357,7 +360,7 @@ module.exports = { }, { // Rules that requires type information - files: ['**/*.{ts,tsx}'], + files: ['**/*.{ts,tsx,mts,cts}'], excludedFiles: ['**/*.{md,mdx}/*.{ts,tsx}'], // extends: ['plugin:@typescript-eslint/recommended-type-checked'], rules: { diff --git a/examples/monaco-graphql-react-vite/package.json b/examples/monaco-graphql-react-vite/package.json index b794e520d5f..d535ec3b329 100644 --- a/examples/monaco-graphql-react-vite/package.json +++ b/examples/monaco-graphql-react-vite/package.json @@ -14,8 +14,8 @@ "react-dom": "^18.2.0" }, "devDependencies": { - "@vitejs/plugin-react": "^4.0.1", - "vite": "^4.3.9", + "@vitejs/plugin-react": "^4.3.1", + "vite": "^5.3.4", "vite-plugin-monaco-editor": "^1.1.0" }, "scripts": { diff --git a/package.json b/package.json index 2bd67965311..2b4c136221f 100644 --- a/package.json +++ b/package.json @@ -135,7 +135,7 @@ "ts-jest": "^27.1.5", "typedoc": "^0.19.2", "typescript": "^4.6.3", - "vitest": "^0.32.2", + "vitest": "^2.0.4", "wgutils": "^0.1.7", "wsrun": "^5.2.4" }, diff --git a/packages/graphiql-plugin-code-exporter/package.json b/packages/graphiql-plugin-code-exporter/package.json index b8d14aedfb3..6e6b555f37e 100644 --- a/packages/graphiql-plugin-code-exporter/package.json +++ b/packages/graphiql-plugin-code-exporter/package.json @@ -40,12 +40,12 @@ }, "devDependencies": { "@graphiql/react": "^0.22.4", - "@vitejs/plugin-react": "^4.0.1", + "@vitejs/plugin-react": "^4.3.1", "graphql": "^16.8.1", "postcss-nesting": "^10.1.7", "react": "^18.2.0", "react-dom": "^18.2.0", "typescript": "^4.6.3", - "vite": "^4.3.9" + "vite": "^5.3.4" } } diff --git a/packages/graphiql-plugin-code-exporter/vite.config.ts b/packages/graphiql-plugin-code-exporter/vite.config.mts similarity index 100% rename from packages/graphiql-plugin-code-exporter/vite.config.ts rename to packages/graphiql-plugin-code-exporter/vite.config.mts diff --git a/packages/graphiql-plugin-explorer/package.json b/packages/graphiql-plugin-explorer/package.json index 94753463bd7..e69c18e3fe0 100644 --- a/packages/graphiql-plugin-explorer/package.json +++ b/packages/graphiql-plugin-explorer/package.json @@ -39,12 +39,12 @@ }, "devDependencies": { "@graphiql/react": "^0.22.4", - "@vitejs/plugin-react": "^4.0.1", + "@vitejs/plugin-react": "^4.3.1", "graphql": "^16.8.1", "react": "^18.2.0", "react-dom": "^18.2.0", "typescript": "^4.6.3", - "vite": "^4.3.9", - "vite-plugin-svgr": "^3.2.0" + "vite": "^5.3.4", + "vite-plugin-svgr": "^4.2.0" } } diff --git a/packages/graphiql-plugin-explorer/src/index.tsx b/packages/graphiql-plugin-explorer/src/index.tsx index f9908dc0456..5b419acda0e 100644 --- a/packages/graphiql-plugin-explorer/src/index.tsx +++ b/packages/graphiql-plugin-explorer/src/index.tsx @@ -12,10 +12,10 @@ import { GraphiQLExplorerProps, } from 'graphiql-explorer'; -import ArrowIcon from './icons/arrow.svg'; -import FolderPlusIcon from './icons/folder-plus.svg'; -import CheckboxUncheckedIcon from './icons/checkbox-unchecked.svg'; -import CheckboxCheckedIcon from './icons/checkbox-checked.svg'; +import ArrowIcon from './icons/arrow.svg?react'; +import FolderPlusIcon from './icons/folder-plus.svg?react'; +import CheckboxUncheckedIcon from './icons/checkbox-unchecked.svg?react'; +import CheckboxCheckedIcon from './icons/checkbox-checked.svg?react'; import './graphiql-explorer.d.ts'; import './index.css'; diff --git a/packages/graphiql-plugin-explorer/src/vite-env.d.ts b/packages/graphiql-plugin-explorer/src/vite-env.d.ts index 5fd9fd7b028..ee9857a625d 100644 --- a/packages/graphiql-plugin-explorer/src/vite-env.d.ts +++ b/packages/graphiql-plugin-explorer/src/vite-env.d.ts @@ -1,7 +1,2 @@ -declare module '*.svg' { - import { FC, SVGProps } from 'react'; - const ReactComponent: FC>; - export default ReactComponent; -} - +/// /// diff --git a/packages/graphiql-plugin-explorer/vite.config.ts b/packages/graphiql-plugin-explorer/vite.config.mts similarity index 100% rename from packages/graphiql-plugin-explorer/vite.config.ts rename to packages/graphiql-plugin-explorer/vite.config.mts diff --git a/packages/graphiql-react/jest.config.js b/packages/graphiql-react/jest.config.js index 22b3f1af305..4b9d01d0279 100644 --- a/packages/graphiql-react/jest.config.js +++ b/packages/graphiql-react/jest.config.js @@ -3,7 +3,7 @@ const base = require('../../jest.config.base')(__dirname); module.exports = { ...base, moduleNameMapper: { - '\\.svg$': `${__dirname}/__mocks__/svg`, + '\\.svg\\?react$': `${__dirname}/__mocks__/svg`, ...base.moduleNameMapper, }, }; diff --git a/packages/graphiql-react/package.json b/packages/graphiql-react/package.json index bc5e49240d4..1a5c98cf822 100644 --- a/packages/graphiql-react/package.json +++ b/packages/graphiql-react/package.json @@ -68,13 +68,13 @@ "@babel/helper-string-parser": "^7.19.4", "@testing-library/react": "14.0.0", "@types/set-value": "^4.0.1", - "@vitejs/plugin-react": "^4.0.1", + "@vitejs/plugin-react": "^4.3.1", "graphql": "^16.8.1", "postcss-nesting": "^10.1.7", "react": "^18.2.0", "react-dom": "^18.2.0", "typescript": "^4.6.3", - "vite": "^4.3.9", - "vite-plugin-svgr": "^3.2.0" + "vite": "^5.3.4", + "vite-plugin-svgr": "^4.2.0" } } diff --git a/packages/graphiql-react/src/icons/index.tsx b/packages/graphiql-react/src/icons/index.tsx index 34c0386ded6..097ae61541e 100644 --- a/packages/graphiql-react/src/icons/index.tsx +++ b/packages/graphiql-react/src/icons/index.tsx @@ -1,36 +1,36 @@ -import { ComponentProps, FC } from 'react'; +import { ComponentProps, FC, SVGProps } from 'react'; -import _ArgumentIcon from './argument.svg'; -import _ChevronDownIcon from './chevron-down.svg'; -import _ChevronLeftIcon from './chevron-left.svg'; -import _ChevronUpIcon from './chevron-up.svg'; -import _CloseIcon from './close.svg'; -import _CopyIcon from './copy.svg'; -import _DeprecatedArgumentIcon from './deprecated-argument.svg'; -import _DeprecatedEnumValueIcon from './deprecated-enum-value.svg'; -import _DeprecatedFieldIcon from './deprecated-field.svg'; -import _DirectiveIcon from './directive.svg'; -import _DocsFilledIcon from './docs-filled.svg'; -import _DocsIcon from './docs.svg'; -import _EnumValueIcon from './enum-value.svg'; -import _FieldIcon from './field.svg'; -import _HistoryIcon from './history.svg'; -import _ImplementsIcon from './implements.svg'; -import _KeyboardShortcutIcon from './keyboard-shortcut.svg'; -import _MagnifyingGlassIcon from './magnifying-glass.svg'; -import _MergeIcon from './merge.svg'; -import _PenIcon from './pen.svg'; -import _PlayIcon from './play.svg'; -import _PlusIcon from './plus.svg'; -import _PrettifyIcon from './prettify.svg'; -import _ReloadIcon from './reload.svg'; -import _RootTypeIcon from './root-type.svg'; -import _SettingsIcon from './settings.svg'; -import _StarFilledIcon from './star-filled.svg'; -import _StarIcon from './star.svg'; -import _StopIcon from './stop.svg'; -import _TrashIcon from './trash.svg'; -import _TypeIcon from './type.svg'; +import _ArgumentIcon from './argument.svg?react'; +import _ChevronDownIcon from './chevron-down.svg?react'; +import _ChevronLeftIcon from './chevron-left.svg?react'; +import _ChevronUpIcon from './chevron-up.svg?react'; +import _CloseIcon from './close.svg?react'; +import _CopyIcon from './copy.svg?react'; +import _DeprecatedArgumentIcon from './deprecated-argument.svg?react'; +import _DeprecatedEnumValueIcon from './deprecated-enum-value.svg?react'; +import _DeprecatedFieldIcon from './deprecated-field.svg?react'; +import _DirectiveIcon from './directive.svg?react'; +import _DocsFilledIcon from './docs-filled.svg?react'; +import _DocsIcon from './docs.svg?react'; +import _EnumValueIcon from './enum-value.svg?react'; +import _FieldIcon from './field.svg?react'; +import _HistoryIcon from './history.svg?react'; +import _ImplementsIcon from './implements.svg?react'; +import _KeyboardShortcutIcon from './keyboard-shortcut.svg?react'; +import _MagnifyingGlassIcon from './magnifying-glass.svg?react'; +import _MergeIcon from './merge.svg?react'; +import _PenIcon from './pen.svg?react'; +import _PlayIcon from './play.svg?react'; +import _PlusIcon from './plus.svg?react'; +import _PrettifyIcon from './prettify.svg?react'; +import _ReloadIcon from './reload.svg?react'; +import _RootTypeIcon from './root-type.svg?react'; +import _SettingsIcon from './settings.svg?react'; +import _StarFilledIcon from './star-filled.svg?react'; +import _StarIcon from './star.svg?react'; +import _StopIcon from './stop.svg?react'; +import _TrashIcon from './trash.svg?react'; +import _TypeIcon from './type.svg?react'; export const ArgumentIcon = generateIcon(_ArgumentIcon); export const ChevronDownIcon = generateIcon(_ChevronDownIcon); @@ -42,7 +42,7 @@ export const DeprecatedArgumentIcon = generateIcon(_DeprecatedArgumentIcon); export const DeprecatedEnumValueIcon = generateIcon(_DeprecatedEnumValueIcon); export const DeprecatedFieldIcon = generateIcon(_DeprecatedFieldIcon); export const DirectiveIcon = generateIcon(_DirectiveIcon); -export const DocsFilledIcon = generateIcon(_DocsFilledIcon, 'filled docs icon'); +export const DocsFilledIcon = generateIcon(_DocsFilledIcon); export const DocsIcon = generateIcon(_DocsIcon); export const EnumValueIcon = generateIcon(_EnumValueIcon); export const FieldIcon = generateIcon(_FieldIcon); @@ -58,25 +58,28 @@ export const PrettifyIcon = generateIcon(_PrettifyIcon); export const ReloadIcon = generateIcon(_ReloadIcon); export const RootTypeIcon = generateIcon(_RootTypeIcon); export const SettingsIcon = generateIcon(_SettingsIcon); -export const StarFilledIcon = generateIcon(_StarFilledIcon, 'filled star icon'); +export const StarFilledIcon = generateIcon(_StarFilledIcon); export const StarIcon = generateIcon(_StarIcon); export const StopIcon = generateIcon(_StopIcon); -export const TrashIcon = generateIcon(_TrashIcon, 'trash icon'); +export const TrashIcon = generateIcon(_TrashIcon); export const TypeIcon = generateIcon(_TypeIcon); function generateIcon( - RawComponent: any, - title = RawComponent.name - // Icon component name starts with `Svg${CamelCaseFilename without .svg}` - .replace('Svg', '') - // Insert a space before all caps - .replaceAll(/([A-Z])/g, ' $1') - .trimStart() - .toLowerCase() + ' icon', + RawComponent: FC & { title?: string }>, ): FC> { + const title = + RawComponent.name + // Icon component name starts with `Svg${CamelCaseFilename without .svg}` + .replace('Svg', '') + // Insert a space before all caps + .replaceAll(/([A-Z])/g, ' $1') + .trimStart() + .toLowerCase() + ' icon'; + function IconComponent(props: ComponentProps<'svg'>) { return ; } + IconComponent.displayName = RawComponent.name; return IconComponent; } diff --git a/packages/graphiql-react/src/icons/trash.svg b/packages/graphiql-react/src/icons/trash.svg index 68d993d4566..9cd42408f9c 100644 --- a/packages/graphiql-react/src/icons/trash.svg +++ b/packages/graphiql-react/src/icons/trash.svg @@ -8,11 +8,10 @@ style="height: 1.5em" clip-rule="evenodd" > - trash icon + /> diff --git a/packages/graphiql-react/src/vite-env.d.ts b/packages/graphiql-react/src/vite-env.d.ts index 11f02fe2a00..ee9857a625d 100644 --- a/packages/graphiql-react/src/vite-env.d.ts +++ b/packages/graphiql-react/src/vite-env.d.ts @@ -1 +1,2 @@ +/// /// diff --git a/packages/graphiql-react/vite.config.ts b/packages/graphiql-react/vite.config.mts similarity index 100% rename from packages/graphiql-react/vite.config.ts rename to packages/graphiql-react/vite.config.mts diff --git a/packages/graphiql/jest.config.js b/packages/graphiql/jest.config.js index 22b3f1af305..4b9d01d0279 100644 --- a/packages/graphiql/jest.config.js +++ b/packages/graphiql/jest.config.js @@ -3,7 +3,7 @@ const base = require('../../jest.config.base')(__dirname); module.exports = { ...base, moduleNameMapper: { - '\\.svg$': `${__dirname}/__mocks__/svg`, + '\\.svg\\?react$': `${__dirname}/__mocks__/svg`, ...base.moduleNameMapper, }, }; diff --git a/packages/monaco-graphql/vite.config.ts b/packages/monaco-graphql/vitest.config.mts similarity index 100% rename from packages/monaco-graphql/vite.config.ts rename to packages/monaco-graphql/vitest.config.mts diff --git a/packages/vscode-graphql-syntax/vite.config.ts b/packages/vscode-graphql-syntax/vitest.config.mts similarity index 100% rename from packages/vscode-graphql-syntax/vite.config.ts rename to packages/vscode-graphql-syntax/vitest.config.mts diff --git a/tsconfig.eslint.json b/tsconfig.eslint.json index 007c65012ec..02f48fa5514 100644 --- a/tsconfig.eslint.json +++ b/tsconfig.eslint.json @@ -9,7 +9,8 @@ "include": [ "packages/*/src/*/__tests__/**/*.ts", "packages/*/src/__tests__/**/*.ts", - "packages/*/vite.config.ts", + "packages/*/vite.config.mts", + "packages/*/vitest.config.mts", "examples/*/vite.config.ts", "packages/graphiql/src/components/__tests__/**/*.ts", "packages/graphiql/src/components/__tests__/**/*.tsx", diff --git a/yarn.lock b/yarn.lock index c2133d0dd67..2b2d530db0b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -15,6 +15,14 @@ "@jridgewell/gen-mapping" "^0.3.0" "@jridgewell/trace-mapping" "^0.3.9" +"@ampproject/remapping@^2.3.0": + version "2.3.0" + resolved "https://registry.yarnpkg.com/@ampproject/remapping/-/remapping-2.3.0.tgz#ed441b6fa600072520ce18b43d2c8cc8caecc7f4" + integrity sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw== + dependencies: + "@jridgewell/gen-mapping" "^0.3.5" + "@jridgewell/trace-mapping" "^0.3.24" + "@apideck/better-ajv-errors@^0.3.1": version "0.3.6" resolved "https://registry.yarnpkg.com/@apideck/better-ajv-errors/-/better-ajv-errors-0.3.6.tgz#957d4c28e886a64a8141f7522783be65733ff097" @@ -186,7 +194,12 @@ resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.23.5.tgz#ffb878728bb6bdcb6f4510aa51b1be9afb8cfd98" integrity sha512-uU27kfDRlhfKl+w1U6vp16IuvSLtjAxdArVXPa9BvLkrr7CYIsxH5adpHObeAGY/41+syctUWOZ140a2Rvkgjw== -"@babel/core@^7.1.0", "@babel/core@^7.11.1", "@babel/core@^7.11.6", "@babel/core@^7.12.3", "@babel/core@^7.21.0", "@babel/core@^7.21.3", "@babel/core@^7.22.5", "@babel/core@^7.22.9", "@babel/core@^7.7.2", "@babel/core@^7.8.0": +"@babel/compat-data@^7.24.8": + version "7.24.9" + resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.24.9.tgz#53eee4e68f1c1d0282aa0eb05ddb02d033fc43a0" + integrity sha512-e701mcfApCJqMMueQI0Fb68Amflj83+dvAvHawoBpAz+GDjCIyGHzNwnefjsWJ3xiYAqqiQFoWbspGYBdb2/ng== + +"@babel/core@^7.1.0", "@babel/core@^7.11.1", "@babel/core@^7.11.6", "@babel/core@^7.12.3", "@babel/core@^7.21.0", "@babel/core@^7.21.3", "@babel/core@^7.22.9", "@babel/core@^7.7.2", "@babel/core@^7.8.0": version "7.23.7" resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.23.7.tgz#4d8016e06a14b5f92530a13ed0561730b5c6483f" integrity sha512-+UpDgowcmqe36d4NwqvKsyPMlOLNGMsfMmQ5WGCu+siCe3t3dfe9njrzGfdN4qq+bcNUt0+Vw6haRxBOycs4dw== @@ -207,6 +220,27 @@ json5 "^2.2.3" semver "^6.3.1" +"@babel/core@^7.24.5": + version "7.24.9" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.24.9.tgz#dc07c9d307162c97fa9484ea997ade65841c7c82" + integrity sha512-5e3FI4Q3M3Pbr21+5xJwCv6ZT6KmGkI0vw3Tozy5ODAQFTIWe37iT8Cr7Ice2Ntb+M3iSKCEWMB1MBgKrW3whg== + dependencies: + "@ampproject/remapping" "^2.2.0" + "@babel/code-frame" "^7.24.7" + "@babel/generator" "^7.24.9" + "@babel/helper-compilation-targets" "^7.24.8" + "@babel/helper-module-transforms" "^7.24.9" + "@babel/helpers" "^7.24.8" + "@babel/parser" "^7.24.8" + "@babel/template" "^7.24.7" + "@babel/traverse" "^7.24.8" + "@babel/types" "^7.24.9" + convert-source-map "^2.0.0" + debug "^4.1.0" + gensync "^1.0.0-beta.2" + json5 "^2.2.3" + semver "^6.3.1" + "@babel/eslint-parser@^7.16.3", "@babel/eslint-parser@^7.24.5": version "7.24.7" resolved "https://registry.yarnpkg.com/@babel/eslint-parser/-/eslint-parser-7.24.7.tgz#27ebab1a1ec21f48ae191a8aaac5b82baf80d9c7" @@ -243,6 +277,16 @@ "@jridgewell/trace-mapping" "^0.3.25" jsesc "^2.5.1" +"@babel/generator@^7.24.9": + version "7.24.10" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.24.10.tgz#a4ab681ec2a78bbb9ba22a3941195e28a81d8e76" + integrity sha512-o9HBZL1G2129luEUlG1hB4N/nlYNWHnpwlND9eOMclRqqu1YDy2sSYVCFUZwl8I1Gxh+QSRrP2vD7EpUmFVXxg== + dependencies: + "@babel/types" "^7.24.9" + "@jridgewell/gen-mapping" "^0.3.5" + "@jridgewell/trace-mapping" "^0.3.25" + jsesc "^2.5.1" + "@babel/helper-annotate-as-pure@^7.18.6", "@babel/helper-annotate-as-pure@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.22.5.tgz#e7f06737b197d580a01edf75d97e2c8be99d3882" @@ -268,6 +312,17 @@ lru-cache "^5.1.1" semver "^6.3.1" +"@babel/helper-compilation-targets@^7.24.8": + version "7.24.8" + resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.24.8.tgz#b607c3161cd9d1744977d4f97139572fe778c271" + integrity sha512-oU+UoqCHdp+nWVDkpldqIQL/i/bvAv53tRqLG/s+cOXxe66zOYLU7ar/Xs3LdmBihrUMEUhwu6dMZwbNOYDwvw== + dependencies: + "@babel/compat-data" "^7.24.8" + "@babel/helper-validator-option" "^7.24.8" + browserslist "^4.23.1" + lru-cache "^5.1.1" + semver "^6.3.1" + "@babel/helper-create-class-features-plugin@^7.18.6", "@babel/helper-create-class-features-plugin@^7.21.0", "@babel/helper-create-class-features-plugin@^7.22.5": version "7.22.9" resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.22.9.tgz#c36ea240bb3348f942f08b0fbe28d6d979fab236" @@ -359,6 +414,14 @@ dependencies: "@babel/types" "^7.22.15" +"@babel/helper-module-imports@^7.24.7": + version "7.24.7" + resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.24.7.tgz#f2f980392de5b84c3328fc71d38bd81bbb83042b" + integrity sha512-8AyH3C+74cgCVVXow/myrynrAGv+nTVg5vKu2nZph9x7RcRwzmh0VFallJuFTZ9mx6u4eSdXZfcOzSqTUm0HCA== + dependencies: + "@babel/traverse" "^7.24.7" + "@babel/types" "^7.24.7" + "@babel/helper-module-transforms@^7.22.5", "@babel/helper-module-transforms@^7.23.3": version "7.23.3" resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.23.3.tgz#d7d12c3c5d30af5b3c0fcab2a6d5217773e2d0f1" @@ -370,6 +433,17 @@ "@babel/helper-split-export-declaration" "^7.22.6" "@babel/helper-validator-identifier" "^7.22.20" +"@babel/helper-module-transforms@^7.24.9": + version "7.24.9" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.24.9.tgz#e13d26306b89eea569180868e652e7f514de9d29" + integrity sha512-oYbh+rtFKj/HwBQkFlUzvcybzklmVdVV3UU+mN7n2t/q3yGHbuVdNxyFvSBO1tfvjyArpHNcWMAzsSPdyI46hw== + dependencies: + "@babel/helper-environment-visitor" "^7.24.7" + "@babel/helper-module-imports" "^7.24.7" + "@babel/helper-simple-access" "^7.24.7" + "@babel/helper-split-export-declaration" "^7.24.7" + "@babel/helper-validator-identifier" "^7.24.7" + "@babel/helper-optimise-call-expression@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.22.5.tgz#f21531a9ccbff644fdd156b4077c16ff0c3f609e" @@ -382,6 +456,11 @@ resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.22.5.tgz#dd7ee3735e8a313b9f7b05a773d892e88e6d7295" integrity sha512-uLls06UVKgFG9QD4OeFYLEGteMIAa5kpTPcFL28yuCIIzsf6ZyKZMllKVOCZFhiZ5ptnwX4mtKdWCBE/uT4amg== +"@babel/helper-plugin-utils@^7.24.7": + version "7.24.8" + resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.24.8.tgz#94ee67e8ec0e5d44ea7baeb51e571bd26af07878" + integrity sha512-FFWx5142D8h2Mgr/iPVGH5G7w6jDn4jUSpZTyDnQO0Yn7Ks2Kuz6Pci8H6MPCoUJegd/UZQ3tAvfLCxQSnWWwg== + "@babel/helper-remap-async-to-generator@^7.22.5": version "7.22.9" resolved "https://registry.yarnpkg.com/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.22.9.tgz#53a25b7484e722d7efb9c350c75c032d4628de82" @@ -407,6 +486,14 @@ dependencies: "@babel/types" "^7.22.5" +"@babel/helper-simple-access@^7.24.7": + version "7.24.7" + resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.24.7.tgz#bcade8da3aec8ed16b9c4953b74e506b51b5edb3" + integrity sha512-zBAIvbCMh5Ts+b86r/CjU+4XGYIs+R1j951gxI3KmmxBMhCg4oQMsv6ZXQ64XOm/cvzfU1FmoCyt6+owc5QMYg== + dependencies: + "@babel/traverse" "^7.24.7" + "@babel/types" "^7.24.7" + "@babel/helper-skip-transparent-expression-wrappers@^7.20.0", "@babel/helper-skip-transparent-expression-wrappers@^7.22.5": version "7.24.7" resolved "https://registry.yarnpkg.com/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.24.7.tgz#5f8fa83b69ed5c27adc56044f8be2b3ea96669d9" @@ -434,6 +521,11 @@ resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.24.7.tgz#4d2d0f14820ede3b9807ea5fc36dfc8cd7da07f2" integrity sha512-7MbVt6xrwFQbunH2DNQsAP5sTGxfqQtErvBIvIMi6EQnbgUOuVYanvREcmFrOPhoXBrTtjhhP+lW+o5UfK+tDg== +"@babel/helper-string-parser@^7.24.8": + version "7.24.8" + resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.24.8.tgz#5b3329c9a58803d5df425e5785865881a81ca48d" + integrity sha512-pO9KhhRcuUyGnJWwyEgnRJTSIZHiT+vMD0kPeD+so0l7mxkMT19g3pjY9GTnHySck/hDzq+dtW/4VgnMkippsQ== + "@babel/helper-validator-identifier@^7.22.20", "@babel/helper-validator-identifier@^7.22.5", "@babel/helper-validator-identifier@^7.24.5", "@babel/helper-validator-identifier@^7.24.7": version "7.24.7" resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.7.tgz#75b889cfaf9e35c2aaf42cf0d72c8e91719251db" @@ -444,6 +536,11 @@ resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.23.5.tgz#907a3fbd4523426285365d1206c423c4c5520307" integrity sha512-85ttAOMLsr53VgXkTbkx8oA6YTfT4q7/HzXSLEYmjcSTJPMPQtvq1BD79Byep5xMUYbGRzEpDsjUf3dyp54IKw== +"@babel/helper-validator-option@^7.24.8": + version "7.24.8" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.24.8.tgz#3725cdeea8b480e86d34df15304806a06975e33d" + integrity sha512-xb8t9tD1MHLungh/AIoWYN+gVHaB9kwlu8gffXGSt3FFEIT7RjS+xWbc2vUD1UTZdIpKj/ab3rdqJ7ufngyi2Q== + "@babel/helper-wrap-function@^7.22.9": version "7.22.9" resolved "https://registry.yarnpkg.com/@babel/helper-wrap-function/-/helper-wrap-function-7.22.9.tgz#189937248c45b0182c1dcf32f3444ca153944cb9" @@ -462,6 +559,14 @@ "@babel/traverse" "^7.23.7" "@babel/types" "^7.23.6" +"@babel/helpers@^7.24.8": + version "7.24.8" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.24.8.tgz#2820d64d5d6686cca8789dd15b074cd862795873" + integrity sha512-gV2265Nkcz7weJJfvDoAEVzC1e2OTDpkGbEsebse8koXUJUXPsCMi7sRo/+SPMuMZ9MtUPnGwITTnQnU5YjyaQ== + dependencies: + "@babel/template" "^7.24.7" + "@babel/types" "^7.24.8" + "@babel/highlight@^7.24.7": version "7.24.7" resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.24.7.tgz#a05ab1df134b286558aae0ed41e6c5f731bf409d" @@ -482,6 +587,11 @@ resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.24.7.tgz#9a5226f92f0c5c8ead550b750f5608e766c8ce85" integrity sha512-9uUYRm6OqQrCqQdG1iCBwBPZgN8ciDBro2nIOFaiRz1/BCxaI7CNvQbDHvsArAC7Tw9Hda/B3U+6ui9u4HWXPw== +"@babel/parser@^7.24.8": + version "7.24.8" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.24.8.tgz#58a4dbbcad7eb1d48930524a3fd93d93e9084c6f" + integrity sha512-WzfbgXOkGzZiXXCqk43kKwZjzwx4oulxZi3nq2TYL9mOjQv6kYwul9mz6ID36njuL7Xkp6nJEfok848Zj10j/w== + "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.22.5.tgz#87245a21cd69a73b0b81bcda98d443d6df08f05e" @@ -1004,19 +1114,19 @@ dependencies: "@babel/plugin-transform-react-jsx" "^7.18.6" -"@babel/plugin-transform-react-jsx-self@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx-self/-/plugin-transform-react-jsx-self-7.22.5.tgz#ca2fdc11bc20d4d46de01137318b13d04e481d8e" - integrity sha512-nTh2ogNUtxbiSbxaT4Ds6aXnXEipHweN9YRgOX/oNXdf0cCrGn/+2LozFa3lnPV5D90MkjhgckCPBrsoSc1a7g== +"@babel/plugin-transform-react-jsx-self@^7.24.5": + version "7.24.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx-self/-/plugin-transform-react-jsx-self-7.24.7.tgz#66bff0248ea0b549972e733516ffad577477bdab" + integrity sha512-fOPQYbGSgH0HUp4UJO4sMBFjY6DuWq+2i8rixyUMb3CdGixs/gccURvYOAhajBdKDoGajFr3mUq5rH3phtkGzw== dependencies: - "@babel/helper-plugin-utils" "^7.22.5" + "@babel/helper-plugin-utils" "^7.24.7" -"@babel/plugin-transform-react-jsx-source@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx-source/-/plugin-transform-react-jsx-source-7.22.5.tgz#49af1615bfdf6ed9d3e9e43e425e0b2b65d15b6c" - integrity sha512-yIiRO6yobeEIaI0RTbIr8iAK9FcBHLtZq0S89ZPjDLQXBA4xvghaKqI0etp/tF3htTM0sazJKKLz9oEiGRtu7w== +"@babel/plugin-transform-react-jsx-source@^7.24.1": + version "7.24.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx-source/-/plugin-transform-react-jsx-source-7.24.7.tgz#1198aab2548ad19582013815c938d3ebd8291ee3" + integrity sha512-J2z+MWzZHVOemyLweMqngXrgGC42jQ//R0KdxqkIz/OrbVIIlhFI3WigZ5fO+nwFvBlncr4MGapd8vTyc7RPNQ== dependencies: - "@babel/helper-plugin-utils" "^7.22.5" + "@babel/helper-plugin-utils" "^7.24.7" "@babel/plugin-transform-react-jsx@^7.18.6": version "7.21.0" @@ -1302,7 +1412,7 @@ "@babel/parser" "^7.24.7" "@babel/types" "^7.24.7" -"@babel/traverse@^7.16.8", "@babel/traverse@^7.23.2", "@babel/traverse@^7.23.7", "@babel/traverse@^7.24.7", "@babel/traverse@^7.7.2": +"@babel/traverse@^7.16.8", "@babel/traverse@^7.23.2", "@babel/traverse@^7.23.7", "@babel/traverse@^7.24.7", "@babel/traverse@^7.24.8", "@babel/traverse@^7.7.2": version "7.24.7" resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.24.7.tgz#de2b900163fa741721ba382163fe46a936c40cf5" integrity sha512-yb65Ed5S/QAcewNPh0nZczy9JdYXkkAbIsEo+P7BE7yO3txAY30Y/oPa3QkQ5It3xVG2kpKMg9MsdxZaO31uKA== @@ -1327,6 +1437,15 @@ "@babel/helper-validator-identifier" "^7.24.7" to-fast-properties "^2.0.0" +"@babel/types@^7.24.8", "@babel/types@^7.24.9": + version "7.24.9" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.24.9.tgz#228ce953d7b0d16646e755acf204f4cf3d08cc73" + integrity sha512-xm8XrMKz0IlUdocVbYJe0Z9xEgidU7msskG8BbhnTPK/HZ2z/7FP7ykqPgrUH+C+r414mNfNWam1f2vqOjqjYQ== + dependencies: + "@babel/helper-string-parser" "^7.24.8" + "@babel/helper-validator-identifier" "^7.24.7" + to-fast-properties "^2.0.0" + "@bcoe/v8-coverage@^0.2.3": version "0.2.3" resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" @@ -2098,226 +2217,231 @@ resolved "https://registry.yarnpkg.com/@emotion/memoize/-/memoize-0.7.4.tgz#19bf0f5af19149111c40d98bb0cf82119f5d9eeb" integrity sha512-Ja/Vfqe3HpuzRsG1oBtWTHk2PGZ7GR+2Vz5iYGelAw8dx32K0y7PjVuxK6z1nMpZOqAFsRUPCkK1YjJ56qJlgw== -"@esbuild/android-arm64@0.17.19": - version "0.17.19" - resolved "https://registry.yarnpkg.com/@esbuild/android-arm64/-/android-arm64-0.17.19.tgz#bafb75234a5d3d1b690e7c2956a599345e84a2fd" - integrity sha512-KBMWvEZooR7+kzY0BtbTQn0OAYY7CsiydT63pVEaPtVYF0hXbUaOyZog37DKxK7NF3XacBJOpYT4adIJh+avxA== +"@esbuild/aix-ppc64@0.21.5": + version "0.21.5" + resolved "https://registry.yarnpkg.com/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz#c7184a326533fcdf1b8ee0733e21c713b975575f" + integrity sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ== "@esbuild/android-arm64@0.18.10": version "0.18.10" resolved "https://registry.yarnpkg.com/@esbuild/android-arm64/-/android-arm64-0.18.10.tgz#a416286e6271a8f050869df76ecfc4b822103bbe" integrity sha512-ynm4naLbNbK0ajf9LUWtQB+6Vfg1Z/AplArqr4tGebC00Z6m9Y91OVIcjDa461wGcZwcaHYaZAab4yJxfhisTQ== -"@esbuild/android-arm@0.17.19": - version "0.17.19" - resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.17.19.tgz#5898f7832c2298bc7d0ab53701c57beb74d78b4d" - integrity sha512-rIKddzqhmav7MSmoFCmDIb6e2W57geRsM94gV2l38fzhXMwq7hZoClug9USI2pFRGL06f4IOPHHpFNOkWieR8A== +"@esbuild/android-arm64@0.21.5": + version "0.21.5" + resolved "https://registry.yarnpkg.com/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz#09d9b4357780da9ea3a7dfb833a1f1ff439b4052" + integrity sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A== "@esbuild/android-arm@0.18.10": version "0.18.10" resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.18.10.tgz#aff8cfebd2ed3a52f4d4a923360e7abd0817c34c" integrity sha512-3KClmVNd+Fku82uZJz5C4Rx8m1PPmWUFz5Zkw8jkpZPOmsq+EG1TTOtw1OXkHuX3WczOFQigrtf60B1ijKwNsg== -"@esbuild/android-x64@0.17.19": - version "0.17.19" - resolved "https://registry.yarnpkg.com/@esbuild/android-x64/-/android-x64-0.17.19.tgz#658368ef92067866d95fb268719f98f363d13ae1" - integrity sha512-uUTTc4xGNDT7YSArp/zbtmbhO0uEEK9/ETW29Wk1thYUJBz3IVnvgEiEwEa9IeLyvnpKrWK64Utw2bgUmDveww== +"@esbuild/android-arm@0.21.5": + version "0.21.5" + resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.21.5.tgz#9b04384fb771926dfa6d7ad04324ecb2ab9b2e28" + integrity sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg== "@esbuild/android-x64@0.18.10": version "0.18.10" resolved "https://registry.yarnpkg.com/@esbuild/android-x64/-/android-x64-0.18.10.tgz#f3b1f52fd6bfdf79d5b9b5965798ff3a8afa584d" integrity sha512-vFfXj8P9Yfjh54yqUDEHKzqzYuEfPyAOl3z7R9hjkwt+NCvbn9VMxX+IILnAfdImRBfYVItgSUsqGKhJFnBwZw== -"@esbuild/darwin-arm64@0.17.19": - version "0.17.19" - resolved "https://registry.yarnpkg.com/@esbuild/darwin-arm64/-/darwin-arm64-0.17.19.tgz#584c34c5991b95d4d48d333300b1a4e2ff7be276" - integrity sha512-80wEoCfF/hFKM6WE1FyBHc9SfUblloAWx6FJkFWTWiCoht9Mc0ARGEM47e67W9rI09YoUxJL68WHfDRYEAvOhg== +"@esbuild/android-x64@0.21.5": + version "0.21.5" + resolved "https://registry.yarnpkg.com/@esbuild/android-x64/-/android-x64-0.21.5.tgz#29918ec2db754cedcb6c1b04de8cd6547af6461e" + integrity sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA== "@esbuild/darwin-arm64@0.18.10": version "0.18.10" resolved "https://registry.yarnpkg.com/@esbuild/darwin-arm64/-/darwin-arm64-0.18.10.tgz#70644fc5f41bfe90079df449506de2a568f4c08f" integrity sha512-k2OJQ7ZxE6sVc91+MQeZH9gFeDAH2uIYALPAwTjTCvcPy9Dzrf7V7gFUQPYkn09zloWhQ+nvxWHia2x2ZLR0sQ== -"@esbuild/darwin-x64@0.17.19": - version "0.17.19" - resolved "https://registry.yarnpkg.com/@esbuild/darwin-x64/-/darwin-x64-0.17.19.tgz#7751d236dfe6ce136cce343dce69f52d76b7f6cb" - integrity sha512-IJM4JJsLhRYr9xdtLytPLSH9k/oxR3boaUIYiHkAawtwNOXKE8KoU8tMvryogdcT8AU+Bflmh81Xn6Q0vTZbQw== +"@esbuild/darwin-arm64@0.21.5": + version "0.21.5" + resolved "https://registry.yarnpkg.com/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz#e495b539660e51690f3928af50a76fb0a6ccff2a" + integrity sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ== "@esbuild/darwin-x64@0.18.10": version "0.18.10" resolved "https://registry.yarnpkg.com/@esbuild/darwin-x64/-/darwin-x64-0.18.10.tgz#a8a8466559af303db881c7a760553bfc00593a62" integrity sha512-tnz/mdZk1L1Z3WpGjin/L2bKTe8/AKZpI8fcCLtH+gq8WXWsCNJSxlesAObV4qbtTl6pG5vmqFXfWUQ5hV8PAQ== -"@esbuild/freebsd-arm64@0.17.19": - version "0.17.19" - resolved "https://registry.yarnpkg.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.17.19.tgz#cacd171665dd1d500f45c167d50c6b7e539d5fd2" - integrity sha512-pBwbc7DufluUeGdjSU5Si+P3SoMF5DQ/F/UmTSb8HXO80ZEAJmrykPyzo1IfNbAoaqw48YRpv8shwd1NoI0jcQ== +"@esbuild/darwin-x64@0.21.5": + version "0.21.5" + resolved "https://registry.yarnpkg.com/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz#c13838fa57372839abdddc91d71542ceea2e1e22" + integrity sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw== "@esbuild/freebsd-arm64@0.18.10": version "0.18.10" resolved "https://registry.yarnpkg.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.18.10.tgz#eda518b8d9b38b6c17c2c58600f8b97ff7acd73b" integrity sha512-QJluV0LwBrbHnYYwSKC+K8RGz0g/EyhpQH1IxdoFT0nM7PfgjE+aS8wxq/KFEsU0JkL7U/EEKd3O8xVBxXb2aA== -"@esbuild/freebsd-x64@0.17.19": - version "0.17.19" - resolved "https://registry.yarnpkg.com/@esbuild/freebsd-x64/-/freebsd-x64-0.17.19.tgz#0769456eee2a08b8d925d7c00b79e861cb3162e4" - integrity sha512-4lu+n8Wk0XlajEhbEffdy2xy53dpR06SlzvhGByyg36qJw6Kpfk7cp45DR/62aPH9mtJRmIyrXAS5UWBrJT6TQ== +"@esbuild/freebsd-arm64@0.21.5": + version "0.21.5" + resolved "https://registry.yarnpkg.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz#646b989aa20bf89fd071dd5dbfad69a3542e550e" + integrity sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g== "@esbuild/freebsd-x64@0.18.10": version "0.18.10" resolved "https://registry.yarnpkg.com/@esbuild/freebsd-x64/-/freebsd-x64-0.18.10.tgz#e96ba0a380ec38055fd4654dd7a96c90e32e4bbb" integrity sha512-Hi/ycUkS6KTw+U9G5PK5NoK7CZboicaKUSVs0FSiPNtuCTzK6HNM4DIgniH7hFaeuszDS9T4dhAHWiLSt/Y5Ng== -"@esbuild/linux-arm64@0.17.19": - version "0.17.19" - resolved "https://registry.yarnpkg.com/@esbuild/linux-arm64/-/linux-arm64-0.17.19.tgz#38e162ecb723862c6be1c27d6389f48960b68edb" - integrity sha512-ct1Tg3WGwd3P+oZYqic+YZF4snNl2bsnMKRkb3ozHmnM0dGWuxcPTTntAF6bOP0Sp4x0PjSF+4uHQ1xvxfRKqg== +"@esbuild/freebsd-x64@0.21.5": + version "0.21.5" + resolved "https://registry.yarnpkg.com/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz#aa615cfc80af954d3458906e38ca22c18cf5c261" + integrity sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ== "@esbuild/linux-arm64@0.18.10": version "0.18.10" resolved "https://registry.yarnpkg.com/@esbuild/linux-arm64/-/linux-arm64-0.18.10.tgz#63255f396ab465081bf37e4751bfade9578a8ff0" integrity sha512-Nz6XcfRBOO7jSrVpKAyEyFOPGhySPNlgumSDhWAspdQQ11ub/7/NZDMhWDFReE9QH/SsCOCLQbdj0atAk/HMOQ== -"@esbuild/linux-arm@0.17.19": - version "0.17.19" - resolved "https://registry.yarnpkg.com/@esbuild/linux-arm/-/linux-arm-0.17.19.tgz#1a2cd399c50040184a805174a6d89097d9d1559a" - integrity sha512-cdmT3KxjlOQ/gZ2cjfrQOtmhG4HJs6hhvm3mWSRDPtZ/lP5oe8FWceS10JaSJC13GBd4eH/haHnqf7hhGNLerA== +"@esbuild/linux-arm64@0.21.5": + version "0.21.5" + resolved "https://registry.yarnpkg.com/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz#70ac6fa14f5cb7e1f7f887bcffb680ad09922b5b" + integrity sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q== "@esbuild/linux-arm@0.18.10": version "0.18.10" resolved "https://registry.yarnpkg.com/@esbuild/linux-arm/-/linux-arm-0.18.10.tgz#9a589ffb96837b7536cfa6739dd2e666cc5e548e" integrity sha512-HfFoxY172tVHPIvJy+FHxzB4l8xU7e5cxmNS11cQ2jt4JWAukn/7LXaPdZid41UyTweqa4P/1zs201gRGCTwHw== -"@esbuild/linux-ia32@0.17.19": - version "0.17.19" - resolved "https://registry.yarnpkg.com/@esbuild/linux-ia32/-/linux-ia32-0.17.19.tgz#e28c25266b036ce1cabca3c30155222841dc035a" - integrity sha512-w4IRhSy1VbsNxHRQpeGCHEmibqdTUx61Vc38APcsRbuVgK0OPEnQ0YD39Brymn96mOx48Y2laBQGqgZ0j9w6SQ== +"@esbuild/linux-arm@0.21.5": + version "0.21.5" + resolved "https://registry.yarnpkg.com/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz#fc6fd11a8aca56c1f6f3894f2bea0479f8f626b9" + integrity sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA== "@esbuild/linux-ia32@0.18.10": version "0.18.10" resolved "https://registry.yarnpkg.com/@esbuild/linux-ia32/-/linux-ia32-0.18.10.tgz#291aba2de93e8cdf77d607f54e554ce4ffd2f5ef" integrity sha512-otMdmSmkMe+pmiP/bZBjfphyAsTsngyT9RCYwoFzqrveAbux9nYitDTpdgToG0Z0U55+PnH654gCH2GQ1aB6Yw== -"@esbuild/linux-loong64@0.17.19": - version "0.17.19" - resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.17.19.tgz#0f887b8bb3f90658d1a0117283e55dbd4c9dcf72" - integrity sha512-2iAngUbBPMq439a+z//gE+9WBldoMp1s5GWsUSgqHLzLJ9WoZLZhpwWuym0u0u/4XmZ3gpHmzV84PonE+9IIdQ== +"@esbuild/linux-ia32@0.21.5": + version "0.21.5" + resolved "https://registry.yarnpkg.com/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz#3271f53b3f93e3d093d518d1649d6d68d346ede2" + integrity sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg== "@esbuild/linux-loong64@0.18.10": version "0.18.10" resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.18.10.tgz#ff0fe68c137dc165277b559a747c5debe6a8baec" integrity sha512-t8tjFuON1koxskzQ4VFoh0T5UDUMiLYjwf9Wktd0tx8AoK6xgU+5ubKOpWpcnhEQ2tESS5u0v6QuN8PX/ftwcQ== -"@esbuild/linux-mips64el@0.17.19": - version "0.17.19" - resolved "https://registry.yarnpkg.com/@esbuild/linux-mips64el/-/linux-mips64el-0.17.19.tgz#f5d2a0b8047ea9a5d9f592a178ea054053a70289" - integrity sha512-LKJltc4LVdMKHsrFe4MGNPp0hqDFA1Wpt3jE1gEyM3nKUvOiO//9PheZZHfYRfYl6AwdTH4aTcXSqBerX0ml4A== +"@esbuild/linux-loong64@0.21.5": + version "0.21.5" + resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz#ed62e04238c57026aea831c5a130b73c0f9f26df" + integrity sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg== "@esbuild/linux-mips64el@0.18.10": version "0.18.10" resolved "https://registry.yarnpkg.com/@esbuild/linux-mips64el/-/linux-mips64el-0.18.10.tgz#99801b17fe2bffcce5cf9375731adf3025e7aee9" integrity sha512-+dUkcVzcfEJHz3HEnVpIJu8z8Wdn2n/nWMWdl6FVPFGJAVySO4g3+XPzNKFytVFwf8hPVDwYXzVcu8GMFqsqZw== -"@esbuild/linux-ppc64@0.17.19": - version "0.17.19" - resolved "https://registry.yarnpkg.com/@esbuild/linux-ppc64/-/linux-ppc64-0.17.19.tgz#876590e3acbd9fa7f57a2c7d86f83717dbbac8c7" - integrity sha512-/c/DGybs95WXNS8y3Ti/ytqETiW7EU44MEKuCAcpPto3YjQbyK3IQVKfF6nbghD7EcLUGl0NbiL5Rt5DMhn5tg== +"@esbuild/linux-mips64el@0.21.5": + version "0.21.5" + resolved "https://registry.yarnpkg.com/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz#e79b8eb48bf3b106fadec1ac8240fb97b4e64cbe" + integrity sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg== "@esbuild/linux-ppc64@0.18.10": version "0.18.10" resolved "https://registry.yarnpkg.com/@esbuild/linux-ppc64/-/linux-ppc64-0.18.10.tgz#b5d179a6271d123b20694402364162bfa583b35b" integrity sha512-sO3PjjxEGy+PY2qkGe2gwJbXdZN9wAYpVBZWFD0AwAoKuXRkWK0/zaMQ5ekUFJDRDCRm8x5U0Axaub7ynH/wVg== -"@esbuild/linux-riscv64@0.17.19": - version "0.17.19" - resolved "https://registry.yarnpkg.com/@esbuild/linux-riscv64/-/linux-riscv64-0.17.19.tgz#7f49373df463cd9f41dc34f9b2262d771688bf09" - integrity sha512-FC3nUAWhvFoutlhAkgHf8f5HwFWUL6bYdvLc/TTuxKlvLi3+pPzdZiFKSWz/PF30TB1K19SuCxDTI5KcqASJqA== +"@esbuild/linux-ppc64@0.21.5": + version "0.21.5" + resolved "https://registry.yarnpkg.com/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz#5f2203860a143b9919d383ef7573521fb154c3e4" + integrity sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w== "@esbuild/linux-riscv64@0.18.10": version "0.18.10" resolved "https://registry.yarnpkg.com/@esbuild/linux-riscv64/-/linux-riscv64-0.18.10.tgz#c34b55bcc71d07685e4b836659f299cd4f6889ec" integrity sha512-JDtdbJg3yjDeXLv4lZYE1kiTnxv73/8cbPHY9T/dUKi8rYOM/k5b3W4UJLMUksuQ6nTm5c89W1nADsql6FW75A== -"@esbuild/linux-s390x@0.17.19": - version "0.17.19" - resolved "https://registry.yarnpkg.com/@esbuild/linux-s390x/-/linux-s390x-0.17.19.tgz#e2afd1afcaf63afe2c7d9ceacd28ec57c77f8829" - integrity sha512-IbFsFbxMWLuKEbH+7sTkKzL6NJmG2vRyy6K7JJo55w+8xDk7RElYn6xvXtDW8HCfoKBFK69f3pgBJSUSQPr+4Q== +"@esbuild/linux-riscv64@0.21.5": + version "0.21.5" + resolved "https://registry.yarnpkg.com/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz#07bcafd99322d5af62f618cb9e6a9b7f4bb825dc" + integrity sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA== "@esbuild/linux-s390x@0.18.10": version "0.18.10" resolved "https://registry.yarnpkg.com/@esbuild/linux-s390x/-/linux-s390x-0.18.10.tgz#84318e86ee1e377c603c7b5359f5f67771eddd99" integrity sha512-NLuSKcp8WckjD2a7z5kzLiCywFwBTMlIxDNuud1AUGVuwBBJSkuubp6cNjJ0p5c6CZaA3QqUGwjHJBiG1SoOFw== -"@esbuild/linux-x64@0.17.19": - version "0.17.19" - resolved "https://registry.yarnpkg.com/@esbuild/linux-x64/-/linux-x64-0.17.19.tgz#8a0e9738b1635f0c53389e515ae83826dec22aa4" - integrity sha512-68ngA9lg2H6zkZcyp22tsVt38mlhWde8l3eJLWkyLrp4HwMUr3c1s/M2t7+kHIhvMjglIBrFpncX1SzMckomGw== +"@esbuild/linux-s390x@0.21.5": + version "0.21.5" + resolved "https://registry.yarnpkg.com/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz#b7ccf686751d6a3e44b8627ababc8be3ef62d8de" + integrity sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A== "@esbuild/linux-x64@0.18.10": version "0.18.10" resolved "https://registry.yarnpkg.com/@esbuild/linux-x64/-/linux-x64-0.18.10.tgz#631650dc12f902535dea84b356709ba4ca893071" integrity sha512-wj2KRsCsFusli+6yFgNO/zmmLslislAWryJnodteRmGej7ZzinIbMdsyp13rVGde88zxJd5vercNYK9kuvlZaQ== -"@esbuild/netbsd-x64@0.17.19": - version "0.17.19" - resolved "https://registry.yarnpkg.com/@esbuild/netbsd-x64/-/netbsd-x64-0.17.19.tgz#c29fb2453c6b7ddef9a35e2c18b37bda1ae5c462" - integrity sha512-CwFq42rXCR8TYIjIfpXCbRX0rp1jo6cPIUPSaWwzbVI4aOfX96OXY8M6KNmtPcg7QjYeDmN+DD0Wp3LaBOLf4Q== +"@esbuild/linux-x64@0.21.5": + version "0.21.5" + resolved "https://registry.yarnpkg.com/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz#6d8f0c768e070e64309af8004bb94e68ab2bb3b0" + integrity sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ== "@esbuild/netbsd-x64@0.18.10": version "0.18.10" resolved "https://registry.yarnpkg.com/@esbuild/netbsd-x64/-/netbsd-x64-0.18.10.tgz#436c8c8590eb7638e9d811ce5aae5e44b7dd2e45" integrity sha512-pQ9QqxEPI3cVRZyUtCoZxhZK3If+7RzR8L2yz2+TDzdygofIPOJFaAPkEJ5rYIbUO101RaiYxfdOBahYexLk5A== -"@esbuild/openbsd-x64@0.17.19": - version "0.17.19" - resolved "https://registry.yarnpkg.com/@esbuild/openbsd-x64/-/openbsd-x64-0.17.19.tgz#95e75a391403cb10297280d524d66ce04c920691" - integrity sha512-cnq5brJYrSZ2CF6c35eCmviIN3k3RczmHz8eYaVlNasVqsNY+JKohZU5MKmaOI+KkllCdzOKKdPs762VCPC20g== +"@esbuild/netbsd-x64@0.21.5": + version "0.21.5" + resolved "https://registry.yarnpkg.com/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz#bbe430f60d378ecb88decb219c602667387a6047" + integrity sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg== "@esbuild/openbsd-x64@0.18.10": version "0.18.10" resolved "https://registry.yarnpkg.com/@esbuild/openbsd-x64/-/openbsd-x64-0.18.10.tgz#69945ceeecfb30c20b64068d14a2cf9853254035" integrity sha512-k8GTIIW9I8pEEfoOUm32TpPMgSg06JhL5DO+ql66aLTkOQUs0TxCA67Wi7pv6z8iF8STCGcNbm3UWFHLuci+ag== -"@esbuild/sunos-x64@0.17.19": - version "0.17.19" - resolved "https://registry.yarnpkg.com/@esbuild/sunos-x64/-/sunos-x64-0.17.19.tgz#722eaf057b83c2575937d3ffe5aeb16540da7273" - integrity sha512-vCRT7yP3zX+bKWFeP/zdS6SqdWB8OIpaRq/mbXQxTGHnIxspRtigpkUcDMlSCOejlHowLqII7K2JKevwyRP2rg== +"@esbuild/openbsd-x64@0.21.5": + version "0.21.5" + resolved "https://registry.yarnpkg.com/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz#99d1cf2937279560d2104821f5ccce220cb2af70" + integrity sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow== "@esbuild/sunos-x64@0.18.10": version "0.18.10" resolved "https://registry.yarnpkg.com/@esbuild/sunos-x64/-/sunos-x64-0.18.10.tgz#2ad291b87225f82490d3ffd7c8b643e45fe0d616" integrity sha512-vIGYJIdEI6d4JBucAx8py792G8J0GP40qSH+EvSt80A4zvGd6jph+5t1g+eEXcS2aRpgZw6CrssNCFZxTdEsxw== -"@esbuild/win32-arm64@0.17.19": - version "0.17.19" - resolved "https://registry.yarnpkg.com/@esbuild/win32-arm64/-/win32-arm64-0.17.19.tgz#9aa9dc074399288bdcdd283443e9aeb6b9552b6f" - integrity sha512-yYx+8jwowUstVdorcMdNlzklLYhPxjniHWFKgRqH7IFlUEa0Umu3KuYplf1HUZZ422e3NU9F4LGb+4O0Kdcaag== +"@esbuild/sunos-x64@0.21.5": + version "0.21.5" + resolved "https://registry.yarnpkg.com/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz#08741512c10d529566baba837b4fe052c8f3487b" + integrity sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg== "@esbuild/win32-arm64@0.18.10": version "0.18.10" resolved "https://registry.yarnpkg.com/@esbuild/win32-arm64/-/win32-arm64-0.18.10.tgz#f12fcff13b9dbd3e80481f4cb6282708ce7794bb" integrity sha512-kRhNcMZFGMW+ZHCarAM1ypr8OZs0k688ViUCetVCef9p3enFxzWeBg9h/575Y0nsFu0ZItluCVF5gMR2pwOEpA== -"@esbuild/win32-ia32@0.17.19": - version "0.17.19" - resolved "https://registry.yarnpkg.com/@esbuild/win32-ia32/-/win32-ia32-0.17.19.tgz#95ad43c62ad62485e210f6299c7b2571e48d2b03" - integrity sha512-eggDKanJszUtCdlVs0RB+h35wNlb5v4TWEkq4vZcmVt5u/HiDZrTXe2bWFQUez3RgNHwx/x4sk5++4NSSicKkw== +"@esbuild/win32-arm64@0.21.5": + version "0.21.5" + resolved "https://registry.yarnpkg.com/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz#675b7385398411240735016144ab2e99a60fc75d" + integrity sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A== "@esbuild/win32-ia32@0.18.10": version "0.18.10" resolved "https://registry.yarnpkg.com/@esbuild/win32-ia32/-/win32-ia32-0.18.10.tgz#e369e9bedf6b548a62b284320c6de08982d045da" integrity sha512-AR9PX1whYaYh9p0EOaKna0h48F/A101Mt/ag72+kMkkBZXPQ7cjbz2syXI/HI3OlBdUytSdHneljfjvUoqwqiQ== -"@esbuild/win32-x64@0.17.19": - version "0.17.19" - resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.17.19.tgz#8cfaf2ff603e9aabb910e9c0558c26cf32744061" - integrity sha512-lAhycmKnVOuRYNtRtatQR1LPQf2oYCkRGkSFnseDAKPl8lu5SOsK/e1sXe5a0Pc5kHIHe6P2I/ilntNv2xf3cA== +"@esbuild/win32-ia32@0.21.5": + version "0.21.5" + resolved "https://registry.yarnpkg.com/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz#1bfc3ce98aa6ca9a0969e4d2af72144c59c1193b" + integrity sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA== "@esbuild/win32-x64@0.18.10": version "0.18.10" resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.18.10.tgz#141d8e73b74252eef46a5433f69d15890d82b5e3" integrity sha512-5sTkYhAGHNRr6bVf4RM0PsscqVr6/DBYdrlMh168oph3usid3lKHcHEEHmr34iZ9GHeeg2juFOxtpl6XyC3tpw== +"@esbuild/win32-x64@0.21.5": + version "0.21.5" + resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz#acad351d582d157bb145535db2a6ff53dd514b5c" + integrity sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw== + "@eslint-community/eslint-utils@^4.2.0", "@eslint-community/eslint-utils@^4.4.0": version "4.4.0" resolved "https://registry.yarnpkg.com/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz#a23514e8fb9af1269d5f7788aa556798d61c6b59" @@ -3523,15 +3647,95 @@ estree-walker "^2.0.1" picomatch "^2.2.2" -"@rollup/pluginutils@^5.0.2": - version "5.0.2" - resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-5.0.2.tgz#012b8f53c71e4f6f9cb317e311df1404f56e7a33" - integrity sha512-pTd9rIsP92h+B6wWwFbW8RkZv4hiR/xKsqre4SIuAOaOEQRxi0lqLke9k2/7WegC85GgUs9pjmOjCUi3In4vwA== +"@rollup/pluginutils@^5.0.5": + version "5.1.0" + resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-5.1.0.tgz#7e53eddc8c7f483a4ad0b94afb1f7f5fd3c771e0" + integrity sha512-XTIWOPPcpvyKI6L1NHo0lFlCyznUEyPmPY1mc3KpPVDYulHSTvyeLNVW00QTLIAFNhR3kYnJTQHeGqU4M3n09g== dependencies: "@types/estree" "^1.0.0" estree-walker "^2.0.2" picomatch "^2.3.1" +"@rollup/rollup-android-arm-eabi@4.19.0": + version "4.19.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.19.0.tgz#3d9fd50164b94964f5de68c3c4ce61933b3a338d" + integrity sha512-JlPfZ/C7yn5S5p0yKk7uhHTTnFlvTgLetl2VxqE518QgyM7C9bSfFTYvB/Q/ftkq0RIPY4ySxTz+/wKJ/dXC0w== + +"@rollup/rollup-android-arm64@4.19.0": + version "4.19.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.19.0.tgz#e1a6d4bca2eb08c84fd996a4bf896ce4b6f4014c" + integrity sha512-RDxUSY8D1tWYfn00DDi5myxKgOk6RvWPxhmWexcICt/MEC6yEMr4HNCu1sXXYLw8iAsg0D44NuU+qNq7zVWCrw== + +"@rollup/rollup-darwin-arm64@4.19.0": + version "4.19.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.19.0.tgz#0a3fffea69489a24a96079af414b0be78df8abbc" + integrity sha512-emvKHL4B15x6nlNTBMtIaC9tLPRpeA5jMvRLXVbl/W9Ie7HhkrE7KQjvgS9uxgatL1HmHWDXk5TTS4IaNJxbAA== + +"@rollup/rollup-darwin-x64@4.19.0": + version "4.19.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.19.0.tgz#13fbdb15f58f090871b0ffff047ece06ad6ad74c" + integrity sha512-fO28cWA1dC57qCd+D0rfLC4VPbh6EOJXrreBmFLWPGI9dpMlER2YwSPZzSGfq11XgcEpPukPTfEVFtw2q2nYJg== + +"@rollup/rollup-linux-arm-gnueabihf@4.19.0": + version "4.19.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.19.0.tgz#e9d9219ddf6f6e946e2ee322198af12466d2c868" + integrity sha512-2Rn36Ubxdv32NUcfm0wB1tgKqkQuft00PtM23VqLuCUR4N5jcNWDoV5iBC9jeGdgS38WK66ElncprqgMUOyomw== + +"@rollup/rollup-linux-arm-musleabihf@4.19.0": + version "4.19.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.19.0.tgz#4ba804a00b5e793196a622f6977e05f23e01f59a" + integrity sha512-gJuzIVdq/X1ZA2bHeCGCISe0VWqCoNT8BvkQ+BfsixXwTOndhtLUpOg0A1Fcx/+eA6ei6rMBzlOz4JzmiDw7JQ== + +"@rollup/rollup-linux-arm64-gnu@4.19.0": + version "4.19.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.19.0.tgz#d871e3f41de759a6db27fc99235b782ba47c15cc" + integrity sha512-0EkX2HYPkSADo9cfeGFoQ7R0/wTKb7q6DdwI4Yn/ULFE1wuRRCHybxpl2goQrx4c/yzK3I8OlgtBu4xvted0ug== + +"@rollup/rollup-linux-arm64-musl@4.19.0": + version "4.19.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.19.0.tgz#6e63f7ad4cc51bd2c693a2826fd279de9eaa05b5" + integrity sha512-GlIQRj9px52ISomIOEUq/IojLZqzkvRpdP3cLgIE1wUWaiU5Takwlzpz002q0Nxxr1y2ZgxC2obWxjr13lvxNQ== + +"@rollup/rollup-linux-powerpc64le-gnu@4.19.0": + version "4.19.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.19.0.tgz#1540b284d91c440bc9fa7a1714cfb71a5597e94d" + integrity sha512-N6cFJzssruDLUOKfEKeovCKiHcdwVYOT1Hs6dovDQ61+Y9n3Ek4zXvtghPPelt6U0AH4aDGnDLb83uiJMkWYzQ== + +"@rollup/rollup-linux-riscv64-gnu@4.19.0": + version "4.19.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.19.0.tgz#70ae58103b5bc7ba2e2235738b51d97022c8ef92" + integrity sha512-2DnD3mkS2uuam/alF+I7M84koGwvn3ZVD7uG+LEWpyzo/bq8+kKnus2EVCkcvh6PlNB8QPNFOz6fWd5N8o1CYg== + +"@rollup/rollup-linux-s390x-gnu@4.19.0": + version "4.19.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.19.0.tgz#579ca5f271421a961d3c73d221202c79e02ff03a" + integrity sha512-D6pkaF7OpE7lzlTOFCB2m3Ngzu2ykw40Nka9WmKGUOTS3xcIieHe82slQlNq69sVB04ch73thKYIWz/Ian8DUA== + +"@rollup/rollup-linux-x64-gnu@4.19.0": + version "4.19.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.19.0.tgz#f0282d761b8b4e7b92b236813475248e37231849" + integrity sha512-HBndjQLP8OsdJNSxpNIN0einbDmRFg9+UQeZV1eiYupIRuZsDEoeGU43NQsS34Pp166DtwQOnpcbV/zQxM+rWA== + +"@rollup/rollup-linux-x64-musl@4.19.0": + version "4.19.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.19.0.tgz#65da807ac66c505ad14b76f1e5976006cb67dd5f" + integrity sha512-HxfbvfCKJe/RMYJJn0a12eiOI9OOtAUF4G6ozrFUK95BNyoJaSiBjIOHjZskTUffUrB84IPKkFG9H9nEvJGW6A== + +"@rollup/rollup-win32-arm64-msvc@4.19.0": + version "4.19.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.19.0.tgz#1eed24b91f421c2eea8bb7ca8889ba0c867e1780" + integrity sha512-HxDMKIhmcguGTiP5TsLNolwBUK3nGGUEoV/BO9ldUBoMLBssvh4J0X8pf11i1fTV7WShWItB1bKAKjX4RQeYmg== + +"@rollup/rollup-win32-ia32-msvc@4.19.0": + version "4.19.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.19.0.tgz#1ed93c9cdc84e185359797a686f4d1576afcea58" + integrity sha512-xItlIAZZaiG/u0wooGzRsx11rokP4qyc/79LkAOdznGRAbOFc+SfEdfUOszG1odsHNgwippUJavag/+W/Etc6Q== + +"@rollup/rollup-win32-x64-msvc@4.19.0": + version "4.19.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.19.0.tgz#baf9b65023ea2ecc5e6ec68f787a0fecfd8ee84c" + integrity sha512-xNo5fV5ycvCCKqiZcpB65VMR11NJB+StnxHz20jdqRAktfdfzhgjTiJ2doTDQE/7dqGaV5I7ZGqKpgph6lCIag== + "@samverschueren/stream-to-observable@^0.3.0": version "0.3.0" resolved "https://registry.yarnpkg.com/@samverschueren/stream-to-observable/-/stream-to-observable-0.3.0.tgz#ecdf48d532c58ea477acfcab80348424f8d0662f" @@ -3626,86 +3830,87 @@ magic-string "^0.25.0" string.prototype.matchall "^4.0.6" -"@svgr/babel-plugin-add-jsx-attribute@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@svgr/babel-plugin-add-jsx-attribute/-/babel-plugin-add-jsx-attribute-7.0.0.tgz#80856c1b7a3b7422d232f6e079f0beb90c4a13e9" - integrity sha512-khWbXesWIP9v8HuKCl2NU2HNAyqpSQ/vkIl36Nbn4HIwEYSRWL0H7Gs6idJdha2DkpFDWlsqMELvoCE8lfFY6Q== +"@svgr/babel-plugin-add-jsx-attribute@8.0.0": + version "8.0.0" + resolved "https://registry.yarnpkg.com/@svgr/babel-plugin-add-jsx-attribute/-/babel-plugin-add-jsx-attribute-8.0.0.tgz#4001f5d5dd87fa13303e36ee106e3ff3a7eb8b22" + integrity sha512-b9MIk7yhdS1pMCZM8VeNfUlSKVRhsHZNMl5O9SfaX0l0t5wjdgu4IDzGB8bpnGBBOjGST3rRFVsaaEtI4W6f7g== -"@svgr/babel-plugin-remove-jsx-attribute@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@svgr/babel-plugin-remove-jsx-attribute/-/babel-plugin-remove-jsx-attribute-7.0.0.tgz#91da77a009dc38e8d30da45d9b62ef8736f2d90a" - integrity sha512-iiZaIvb3H/c7d3TH2HBeK91uI2rMhZNwnsIrvd7ZwGLkFw6mmunOCoVnjdYua662MqGFxlN9xTq4fv9hgR4VXQ== +"@svgr/babel-plugin-remove-jsx-attribute@8.0.0": + version "8.0.0" + resolved "https://registry.yarnpkg.com/@svgr/babel-plugin-remove-jsx-attribute/-/babel-plugin-remove-jsx-attribute-8.0.0.tgz#69177f7937233caca3a1afb051906698f2f59186" + integrity sha512-BcCkm/STipKvbCl6b7QFrMh/vx00vIP63k2eM66MfHJzPr6O2U0jYEViXkHJWqXqQYjdeA9cuCl5KWmlwjDvbA== -"@svgr/babel-plugin-remove-jsx-empty-expression@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@svgr/babel-plugin-remove-jsx-empty-expression/-/babel-plugin-remove-jsx-empty-expression-7.0.0.tgz#5154ff1213509e36ab315974c8c2fd48dafb827b" - integrity sha512-sQQmyo+qegBx8DfFc04PFmIO1FP1MHI1/QEpzcIcclo5OAISsOJPW76ZIs0bDyO/DBSJEa/tDa1W26pVtt0FRw== +"@svgr/babel-plugin-remove-jsx-empty-expression@8.0.0": + version "8.0.0" + resolved "https://registry.yarnpkg.com/@svgr/babel-plugin-remove-jsx-empty-expression/-/babel-plugin-remove-jsx-empty-expression-8.0.0.tgz#c2c48104cfd7dcd557f373b70a56e9e3bdae1d44" + integrity sha512-5BcGCBfBxB5+XSDSWnhTThfI9jcO5f0Ai2V24gZpG+wXF14BzwxxdDb4g6trdOux0rhibGs385BeFMSmxtS3uA== -"@svgr/babel-plugin-replace-jsx-attribute-value@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@svgr/babel-plugin-replace-jsx-attribute-value/-/babel-plugin-replace-jsx-attribute-value-7.0.0.tgz#7e72f44ee57fdbcb02fb0d4a7629466c5242725e" - integrity sha512-i6MaAqIZXDOJeikJuzocByBf8zO+meLwfQ/qMHIjCcvpnfvWf82PFvredEZElErB5glQFJa2KVKk8N2xV6tRRA== +"@svgr/babel-plugin-replace-jsx-attribute-value@8.0.0": + version "8.0.0" + resolved "https://registry.yarnpkg.com/@svgr/babel-plugin-replace-jsx-attribute-value/-/babel-plugin-replace-jsx-attribute-value-8.0.0.tgz#8fbb6b2e91fa26ac5d4aa25c6b6e4f20f9c0ae27" + integrity sha512-KVQ+PtIjb1BuYT3ht8M5KbzWBhdAjjUPdlMtpuw/VjT8coTrItWX6Qafl9+ji831JaJcu6PJNKCV0bp01lBNzQ== -"@svgr/babel-plugin-svg-dynamic-title@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@svgr/babel-plugin-svg-dynamic-title/-/babel-plugin-svg-dynamic-title-7.0.0.tgz#8caf0449c678ea29be756b89960b2b16c9f33f00" - integrity sha512-BoVSh6ge3SLLpKC0pmmN9DFlqgFy4NxNgdZNLPNJWBUU7TQpDWeBuyVuDW88iXydb5Cv0ReC+ffa5h3VrKfk1w== +"@svgr/babel-plugin-svg-dynamic-title@8.0.0": + version "8.0.0" + resolved "https://registry.yarnpkg.com/@svgr/babel-plugin-svg-dynamic-title/-/babel-plugin-svg-dynamic-title-8.0.0.tgz#1d5ba1d281363fc0f2f29a60d6d936f9bbc657b0" + integrity sha512-omNiKqwjNmOQJ2v6ge4SErBbkooV2aAWwaPFs2vUY7p7GhVkzRkJ00kILXQvRhA6miHnNpXv7MRnnSjdRjK8og== -"@svgr/babel-plugin-svg-em-dimensions@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@svgr/babel-plugin-svg-em-dimensions/-/babel-plugin-svg-em-dimensions-7.0.0.tgz#4db6b5af6d29e93db236b1a013fa953754071d41" - integrity sha512-tNDcBa+hYn0gO+GkP/AuNKdVtMufVhU9fdzu+vUQsR18RIJ9RWe7h/pSBY338RO08wArntwbDk5WhQBmhf2PaA== +"@svgr/babel-plugin-svg-em-dimensions@8.0.0": + version "8.0.0" + resolved "https://registry.yarnpkg.com/@svgr/babel-plugin-svg-em-dimensions/-/babel-plugin-svg-em-dimensions-8.0.0.tgz#35e08df300ea8b1d41cb8f62309c241b0369e501" + integrity sha512-mURHYnu6Iw3UBTbhGwE/vsngtCIbHE43xCRK7kCw4t01xyGqb2Pd+WXekRRoFOBIY29ZoOhUCTEweDMdrjfi9g== -"@svgr/babel-plugin-transform-react-native-svg@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@svgr/babel-plugin-transform-react-native-svg/-/babel-plugin-transform-react-native-svg-7.0.0.tgz#236995e58b5e36ff06365d5310509ce5391aeec9" - integrity sha512-qw54u8ljCJYL2KtBOjI5z7Nzg8LnSvQOP5hPKj77H4VQL4+HdKbAT5pnkkZLmHKYwzsIHSYKXxHouD8zZamCFQ== +"@svgr/babel-plugin-transform-react-native-svg@8.1.0": + version "8.1.0" + resolved "https://registry.yarnpkg.com/@svgr/babel-plugin-transform-react-native-svg/-/babel-plugin-transform-react-native-svg-8.1.0.tgz#90a8b63998b688b284f255c6a5248abd5b28d754" + integrity sha512-Tx8T58CHo+7nwJ+EhUwx3LfdNSG9R2OKfaIXXs5soiy5HtgoAEkDay9LIimLOcG8dJQH1wPZp/cnAv6S9CrR1Q== -"@svgr/babel-plugin-transform-svg-component@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@svgr/babel-plugin-transform-svg-component/-/babel-plugin-transform-svg-component-7.0.0.tgz#a9b62730acf10d22a2aa57e0f701c0ecbc270430" - integrity sha512-CcFECkDj98daOg9jE3Bh3uyD9kzevCAnZ+UtzG6+BQG/jOQ2OA3jHnX6iG4G1MCJkUQFnUvEv33NvQfqrb/F3A== +"@svgr/babel-plugin-transform-svg-component@8.0.0": + version "8.0.0" + resolved "https://registry.yarnpkg.com/@svgr/babel-plugin-transform-svg-component/-/babel-plugin-transform-svg-component-8.0.0.tgz#013b4bfca88779711f0ed2739f3f7efcefcf4f7e" + integrity sha512-DFx8xa3cZXTdb/k3kfPeaixecQLgKh5NVBMwD0AQxOzcZawK4oo1Jh9LbrcACUivsCA7TLG8eeWgrDXjTMhRmw== -"@svgr/babel-preset@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@svgr/babel-preset/-/babel-preset-7.0.0.tgz#55aaca4cec2ff6515a571715b6b6fa98675b66d9" - integrity sha512-EX/NHeFa30j5UjldQGVQikuuQNHUdGmbh9kEpBKofGUtF0GUPJ4T4rhoYiqDAOmBOxojyot36JIFiDUHUK1ilQ== - dependencies: - "@svgr/babel-plugin-add-jsx-attribute" "^7.0.0" - "@svgr/babel-plugin-remove-jsx-attribute" "^7.0.0" - "@svgr/babel-plugin-remove-jsx-empty-expression" "^7.0.0" - "@svgr/babel-plugin-replace-jsx-attribute-value" "^7.0.0" - "@svgr/babel-plugin-svg-dynamic-title" "^7.0.0" - "@svgr/babel-plugin-svg-em-dimensions" "^7.0.0" - "@svgr/babel-plugin-transform-react-native-svg" "^7.0.0" - "@svgr/babel-plugin-transform-svg-component" "^7.0.0" - -"@svgr/core@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@svgr/core/-/core-7.0.0.tgz#def863d2670c682615583c80b408e83c095c2233" - integrity sha512-ztAoxkaKhRVloa3XydohgQQCb0/8x9T63yXovpmHzKMkHO6pkjdsIAWKOS4bE95P/2quVh1NtjSKlMRNzSBffw== +"@svgr/babel-preset@8.1.0": + version "8.1.0" + resolved "https://registry.yarnpkg.com/@svgr/babel-preset/-/babel-preset-8.1.0.tgz#0e87119aecdf1c424840b9d4565b7137cabf9ece" + integrity sha512-7EYDbHE7MxHpv4sxvnVPngw5fuR6pw79SkcrILHJ/iMpuKySNCl5W1qcwPEpU+LgyRXOaAFgH0KhwD18wwg6ug== + dependencies: + "@svgr/babel-plugin-add-jsx-attribute" "8.0.0" + "@svgr/babel-plugin-remove-jsx-attribute" "8.0.0" + "@svgr/babel-plugin-remove-jsx-empty-expression" "8.0.0" + "@svgr/babel-plugin-replace-jsx-attribute-value" "8.0.0" + "@svgr/babel-plugin-svg-dynamic-title" "8.0.0" + "@svgr/babel-plugin-svg-em-dimensions" "8.0.0" + "@svgr/babel-plugin-transform-react-native-svg" "8.1.0" + "@svgr/babel-plugin-transform-svg-component" "8.0.0" + +"@svgr/core@^8.1.0": + version "8.1.0" + resolved "https://registry.yarnpkg.com/@svgr/core/-/core-8.1.0.tgz#41146f9b40b1a10beaf5cc4f361a16a3c1885e88" + integrity sha512-8QqtOQT5ACVlmsvKOJNEaWmRPmcojMOzCz4Hs2BGG/toAp/K38LcsMRyLp349glq5AzJbCEeimEoxaX6v/fLrA== dependencies: "@babel/core" "^7.21.3" - "@svgr/babel-preset" "^7.0.0" + "@svgr/babel-preset" "8.1.0" camelcase "^6.2.0" cosmiconfig "^8.1.3" + snake-case "^3.0.4" -"@svgr/hast-util-to-babel-ast@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@svgr/hast-util-to-babel-ast/-/hast-util-to-babel-ast-7.0.0.tgz#d457dfbe74ebc1e5a6daf97ded49e9576a3a00cf" - integrity sha512-42Ej9sDDEmsJKjrfQ1PHmiDiHagh/u9AHO9QWbeNx4KmD9yS5d1XHmXUNINfUcykAU+4431Cn+k6Vn5mWBYimQ== +"@svgr/hast-util-to-babel-ast@8.0.0": + version "8.0.0" + resolved "https://registry.yarnpkg.com/@svgr/hast-util-to-babel-ast/-/hast-util-to-babel-ast-8.0.0.tgz#6952fd9ce0f470e1aded293b792a2705faf4ffd4" + integrity sha512-EbDKwO9GpfWP4jN9sGdYwPBU0kdomaPIL2Eu4YwmgP+sJeXT+L7bMwJUBnhzfH8Q2qMBqZ4fJwpCyYsAN3mt2Q== dependencies: "@babel/types" "^7.21.3" entities "^4.4.0" -"@svgr/plugin-jsx@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@svgr/plugin-jsx/-/plugin-jsx-7.0.0.tgz#b9e0c7d05bc890d70163ac0490ba8c41f1afab90" - integrity sha512-SWlTpPQmBUtLKxXWgpv8syzqIU8XgFRvyhfkam2So8b3BE0OS0HPe5UfmlJ2KIC+a7dpuuYovPR2WAQuSyMoPw== +"@svgr/plugin-jsx@^8.1.0": + version "8.1.0" + resolved "https://registry.yarnpkg.com/@svgr/plugin-jsx/-/plugin-jsx-8.1.0.tgz#96969f04a24b58b174ee4cd974c60475acbd6928" + integrity sha512-0xiIyBsLlr8quN+WyuxooNW9RJ0Dpr8uOnH/xrCVO8GLUcwHISwj1AG0k+LFzteTkAA0GbX0kj9q6Dk70PTiPA== dependencies: "@babel/core" "^7.21.3" - "@svgr/babel-preset" "^7.0.0" - "@svgr/hast-util-to-babel-ast" "^7.0.0" + "@svgr/babel-preset" "8.1.0" + "@svgr/hast-util-to-babel-ast" "8.0.0" svg-parser "^2.0.4" "@swc/helpers@0.5.1": @@ -3793,6 +3998,17 @@ "@types/babel__template" "*" "@types/babel__traverse" "*" +"@types/babel__core@^7.20.5": + version "7.20.5" + resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.20.5.tgz#3df15f27ba85319caa07ba08d0721889bb39c017" + integrity sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA== + dependencies: + "@babel/parser" "^7.20.7" + "@babel/types" "^7.20.7" + "@types/babel__generator" "*" + "@types/babel__template" "*" + "@types/babel__traverse" "*" + "@types/babel__generator@*": version "7.6.2" resolved "https://registry.yarnpkg.com/@types/babel__generator/-/babel__generator-7.6.2.tgz#f3d71178e187858f7c45e30380f8f1b7415a12d8" @@ -3850,18 +4066,6 @@ resolved "https://registry.yarnpkg.com/@types/capitalize/-/capitalize-2.0.0.tgz#8efa550b70c7d05bd5a323d39ba762f3f058cdfb" integrity sha512-Jxz08Zch+/J+R3DUcPGmXZ4hNzZImd/FXXij32ByTfclrCQr15+geQjV5teTyFQb3zYPi7O5pRv2/YsyDfRmjA== -"@types/chai-subset@^1.3.3": - version "1.3.3" - resolved "https://registry.yarnpkg.com/@types/chai-subset/-/chai-subset-1.3.3.tgz#97893814e92abd2c534de422cb377e0e0bdaac94" - integrity sha512-frBecisrNGz+F4T6bcc+NLeolfiojh5FxW2klu669+8BARtyQv2C/GkNW6FUodVe4BroGMP/wER/YDGc7rEllw== - dependencies: - "@types/chai" "*" - -"@types/chai@*", "@types/chai@^4.3.5": - version "4.3.5" - resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.3.5.tgz#ae69bcbb1bebb68c4ac0b11e9d8ed04526b3562b" - integrity sha512-mEo1sAde+UCE6b2hxn332f1g1E8WfYRu6p5SvTKr2ZKC1f7gFJXk4h5PyGP9Dt6gCaG8y8XhwnXWC6Iy2cmBng== - "@types/codemirror@^0.0.90": version "0.0.90" resolved "https://registry.yarnpkg.com/@types/codemirror/-/codemirror-0.0.90.tgz#9c5edafce2a780b4f8bc5e3b699fe1f4727c8f17" @@ -3950,6 +4154,11 @@ resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.39.tgz#e177e699ee1b8c22d23174caaa7422644389509f" integrity sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw== +"@types/estree@1.0.5": + version "1.0.5" + resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.5.tgz#a6ce3e556e00fd9895dd872dd172ad0d4bd687f4" + integrity sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw== + "@types/estree@^0.0.51": version "0.0.51" resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.51.tgz#cfd70924a25a3fd32b218e5e420e6897e1ac4f40" @@ -4587,59 +4796,67 @@ "@graphql-typed-document-node/core" "^3.1.1" wonka "^4.0.14" -"@vitejs/plugin-react@^4.0.1": - version "4.0.1" - resolved "https://registry.yarnpkg.com/@vitejs/plugin-react/-/plugin-react-4.0.1.tgz#793aa790633433558da7ac0a38c58ddf47dff518" - integrity sha512-g25lL98essfeSj43HJ0o4DMp0325XK0ITkxpgChzJU/CyemgyChtlxfnRbjfwxDGCTRxTiXtQAsdebQXKMRSOA== - dependencies: - "@babel/core" "^7.22.5" - "@babel/plugin-transform-react-jsx-self" "^7.22.5" - "@babel/plugin-transform-react-jsx-source" "^7.22.5" - react-refresh "^0.14.0" - -"@vitest/expect@0.32.2": - version "0.32.2" - resolved "https://registry.yarnpkg.com/@vitest/expect/-/expect-0.32.2.tgz#8111f6ab1ff3b203efbe3a25e8bb2d160ce4b720" - integrity sha512-6q5yzweLnyEv5Zz1fqK5u5E83LU+gOMVBDuxBl2d2Jfx1BAp5M+rZgc5mlyqdnxquyoiOXpXmFNkcGcfFnFH3Q== - dependencies: - "@vitest/spy" "0.32.2" - "@vitest/utils" "0.32.2" - chai "^4.3.7" - -"@vitest/runner@0.32.2": - version "0.32.2" - resolved "https://registry.yarnpkg.com/@vitest/runner/-/runner-0.32.2.tgz#18dd979ce4e8766bcc90948d11b4c8ae6ed90b89" - integrity sha512-06vEL0C1pomOEktGoLjzZw+1Fb+7RBRhmw/06WkDrd1akkT9i12su0ku+R/0QM69dfkIL/rAIDTG+CSuQVDcKw== - dependencies: - "@vitest/utils" "0.32.2" - concordance "^5.0.4" - p-limit "^4.0.0" - pathe "^1.1.0" - -"@vitest/snapshot@0.32.2": - version "0.32.2" - resolved "https://registry.yarnpkg.com/@vitest/snapshot/-/snapshot-0.32.2.tgz#500b6453e88e4c50a0aded39839352c16b519b9e" - integrity sha512-JwhpeH/PPc7GJX38vEfCy9LtRzf9F4er7i4OsAJyV7sjPwjj+AIR8cUgpMTWK4S3TiamzopcTyLsZDMuldoi5A== +"@vitejs/plugin-react@^4.3.1": + version "4.3.1" + resolved "https://registry.yarnpkg.com/@vitejs/plugin-react/-/plugin-react-4.3.1.tgz#d0be6594051ded8957df555ff07a991fb618b48e" + integrity sha512-m/V2syj5CuVnaxcUJOQRel/Wr31FFXRFlnOoq1TVtkCxsY5veGMTEmpWHndrhB2U8ScHtCQB1e+4hWYExQc6Lg== dependencies: - magic-string "^0.30.0" - pathe "^1.1.0" - pretty-format "^27.5.1" + "@babel/core" "^7.24.5" + "@babel/plugin-transform-react-jsx-self" "^7.24.5" + "@babel/plugin-transform-react-jsx-source" "^7.24.1" + "@types/babel__core" "^7.20.5" + react-refresh "^0.14.2" + +"@vitest/expect@2.0.4": + version "2.0.4" + resolved "https://registry.yarnpkg.com/@vitest/expect/-/expect-2.0.4.tgz#d365c106c84f2a3aae96000e95be21956acc099c" + integrity sha512-39jr5EguIoanChvBqe34I8m1hJFI4+jxvdOpD7gslZrVQBKhh8H9eD7J/LJX4zakrw23W+dITQTDqdt43xVcJw== + dependencies: + "@vitest/spy" "2.0.4" + "@vitest/utils" "2.0.4" + chai "^5.1.1" + tinyrainbow "^1.2.0" -"@vitest/spy@0.32.2": - version "0.32.2" - resolved "https://registry.yarnpkg.com/@vitest/spy/-/spy-0.32.2.tgz#f3ef7afe0d34e863b90df7c959fa5af540a6aaf9" - integrity sha512-Q/ZNILJ4ca/VzQbRM8ur3Si5Sardsh1HofatG9wsJY1RfEaw0XKP8IVax2lI1qnrk9YPuG9LA2LkZ0EI/3d4ug== +"@vitest/pretty-format@2.0.4", "@vitest/pretty-format@^2.0.4": + version "2.0.4" + resolved "https://registry.yarnpkg.com/@vitest/pretty-format/-/pretty-format-2.0.4.tgz#9a3934932e7f8ddd836b38c34ddaeec91bd0f82e" + integrity sha512-RYZl31STbNGqf4l2eQM1nvKPXE0NhC6Eq0suTTePc4mtMQ1Fn8qZmjV4emZdEdG2NOWGKSCrHZjmTqDCDoeFBw== dependencies: - tinyspy "^2.1.0" + tinyrainbow "^1.2.0" -"@vitest/utils@0.32.2": - version "0.32.2" - resolved "https://registry.yarnpkg.com/@vitest/utils/-/utils-0.32.2.tgz#809c720cafbf4b35ce651deb8570d57785e77819" - integrity sha512-lnJ0T5i03j0IJaeW73hxe2AuVnZ/y1BhhCOuIcl9LIzXnbpXJT9Lrt6brwKHXLOiA7MZ6N5hSJjt0xE1dGNCzQ== +"@vitest/runner@2.0.4": + version "2.0.4" + resolved "https://registry.yarnpkg.com/@vitest/runner/-/runner-2.0.4.tgz#0b1edb8ab5f81a1c7dfd50090e5e7e971a117891" + integrity sha512-Gk+9Su/2H2zNfNdeJR124gZckd5st4YoSuhF1Rebi37qTXKnqYyFCd9KP4vl2cQHbtuVKjfEKrNJxHHCW8thbQ== dependencies: - diff-sequences "^29.4.3" - loupe "^2.3.6" - pretty-format "^27.5.1" + "@vitest/utils" "2.0.4" + pathe "^1.1.2" + +"@vitest/snapshot@2.0.4": + version "2.0.4" + resolved "https://registry.yarnpkg.com/@vitest/snapshot/-/snapshot-2.0.4.tgz#7d7dea9df17c5c13386f1a7a433b99dc0ffe3c14" + integrity sha512-or6Mzoz/pD7xTvuJMFYEtso1vJo1S5u6zBTinfl+7smGUhqybn6VjzCDMhmTyVOFWwkCMuNjmNNxnyXPgKDoPw== + dependencies: + "@vitest/pretty-format" "2.0.4" + magic-string "^0.30.10" + pathe "^1.1.2" + +"@vitest/spy@2.0.4": + version "2.0.4" + resolved "https://registry.yarnpkg.com/@vitest/spy/-/spy-2.0.4.tgz#19083386a741a158c2f142beffe43be68b1375cf" + integrity sha512-uTXU56TNoYrTohb+6CseP8IqNwlNdtPwEO0AWl+5j7NelS6x0xZZtP0bDWaLvOfUbaYwhhWp1guzXUxkC7mW7Q== + dependencies: + tinyspy "^3.0.0" + +"@vitest/utils@2.0.4": + version "2.0.4" + resolved "https://registry.yarnpkg.com/@vitest/utils/-/utils-2.0.4.tgz#2db1df35aaeb5caa932770a190df636a68d284d5" + integrity sha512-Zc75QuuoJhOBnlo99ZVUkJIuq4Oj0zAkrQ2VzCqNCx6wAwViHEh5Fnp4fiJTE9rA+sAoXRf00Z9xGgfEzV6fzQ== + dependencies: + "@vitest/pretty-format" "2.0.4" + estree-walker "^3.0.3" + loupe "^3.1.1" + tinyrainbow "^1.2.0" "@vscode/vsce-sign-alpine-arm64@2.0.2": version "2.0.2" @@ -5057,7 +5274,7 @@ acorn-walk@^7.1.1: resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-7.2.0.tgz#0de889a601203909b0fbe07b8938dc21d2e967bc" integrity sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA== -acorn-walk@^8.0.0, acorn-walk@^8.0.2, acorn-walk@^8.2.0: +acorn-walk@^8.0.0, acorn-walk@^8.0.2: version "8.2.0" resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.2.0.tgz#741210f2e2426454508853a2f44d0ab83b7f69c1" integrity sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA== @@ -5497,10 +5714,10 @@ assert-plus@1.0.0, assert-plus@^1.0.0: resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" integrity sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU= -assertion-error@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/assertion-error/-/assertion-error-1.1.0.tgz#e60b6b0e8f301bd97e5375215bda406c85118c0b" - integrity sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw== +assertion-error@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/assertion-error/-/assertion-error-2.0.1.tgz#f641a196b335690b1070bf00b6e7593fec190bf7" + integrity sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA== ast-types-flow@^0.0.8: version "0.0.8" @@ -5863,11 +6080,6 @@ bluebird@3.7.2, bluebird@^3.4.1, bluebird@^3.5.1, bluebird@^3.5.5, bluebird@^3.7 resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.7.2.tgz#9f229c15be272454ffa973ace0dbee79a1b0c36f" integrity sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg== -blueimp-md5@^2.10.0: - version "2.19.0" - resolved "https://registry.yarnpkg.com/blueimp-md5/-/blueimp-md5-2.19.0.tgz#b53feea5498dcb53dc6ec4b823adb84b729c4af0" - integrity sha512-DRQrD6gJyy8FbiE4s+bDoXS9hiW3Vbx5uCdwvcCf3zLHL+Iv7LtGHLpr+GZV8rHG8tK766FGYBwRbu8pELTt+w== - body-parser@1.20.1: version "1.20.1" resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.20.1.tgz#b1812a8912c195cd371a3ee5e66faa2338a5c668" @@ -5999,6 +6211,16 @@ browserslist@^4.0.0, browserslist@^4.14.5, browserslist@^4.20.2, browserslist@^4 node-releases "^2.0.14" update-browserslist-db "^1.0.16" +browserslist@^4.23.1: + version "4.23.2" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.23.2.tgz#244fe803641f1c19c28c48c4b6ec9736eb3d32ed" + integrity sha512-qkqSyistMYdxAcw+CzbZwlBy8AGmS/eEWs+sEV5TnLRGDOL+C5M2EnH6tlZyg0YoAxGJAFKh61En9BR941GnHA== + dependencies: + caniuse-lite "^1.0.30001640" + electron-to-chromium "^1.4.820" + node-releases "^2.0.14" + update-browserslist-db "^1.1.0" + bs-logger@0.x: version "0.2.6" resolved "https://registry.yarnpkg.com/bs-logger/-/bs-logger-0.2.6.tgz#eb7d365307a72cf974cc6cda76b68354ad336bd8" @@ -6154,6 +6376,11 @@ caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001317, caniuse-lite@^1.0.30001328, can resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001639.tgz#972b3a6adeacdd8f46af5fc7f771e9639f6c1521" integrity sha512-eFHflNTBIlFwP2AIKaYuBQN/apnUoKNhBdza8ZnW/h2di4LCZ4xFqYlxUxo+LQ76KFI1PGcC1QDxMbxTZpSCAg== +caniuse-lite@^1.0.30001640: + version "1.0.30001643" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001643.tgz#9c004caef315de9452ab970c3da71085f8241dbd" + integrity sha512-ERgWGNleEilSrHM6iUz/zJNSQTP8Mr21wDWpdgvRwcTXGAq6jMtOUPP4dqFPTdKqZ2wKTdtB+uucZ3MRpAUSmg== + capital-case@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/capital-case/-/capital-case-1.0.4.tgz#9d130292353c9249f6b00fa5852bee38a717e669" @@ -6178,18 +6405,16 @@ ccount@^2.0.0: resolved "https://registry.yarnpkg.com/ccount/-/ccount-2.0.1.tgz#17a3bf82302e0870d6da43a01311a8bc02a3ecf5" integrity sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg== -chai@^4.3.7: - version "4.3.7" - resolved "https://registry.yarnpkg.com/chai/-/chai-4.3.7.tgz#ec63f6df01829088e8bf55fca839bcd464a8ec51" - integrity sha512-HLnAzZ2iupm25PlN0xFreAlBA5zaBSv3og0DdeGA4Ar6h6rJ3A0rolRUKJhSF2V10GZKDgWF/VmAEsNWjCRB+A== +chai@^5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/chai/-/chai-5.1.1.tgz#f035d9792a22b481ead1c65908d14bb62ec1c82c" + integrity sha512-pT1ZgP8rPNqUgieVaEY+ryQr6Q4HXNg8Ei9UnLUrjN4IA7dvQC5JB+/kxVcPNDHyBcc/26CXPkbNzq3qwrOEKA== dependencies: - assertion-error "^1.1.0" - check-error "^1.0.2" - deep-eql "^4.1.2" - get-func-name "^2.0.0" - loupe "^2.3.1" - pathval "^1.1.1" - type-detect "^4.0.5" + assertion-error "^2.0.1" + check-error "^2.1.1" + deep-eql "^5.0.1" + loupe "^3.1.0" + pathval "^2.0.0" chalk@2.4.1: version "2.4.1" @@ -6299,10 +6524,10 @@ chardet@^0.7.0: resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA== -check-error@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/check-error/-/check-error-1.0.2.tgz#574d312edd88bb5dd8912e9286dd6c0aed4aac82" - integrity sha512-BrgHpW9NURQgzoNyjfq0Wu6VFO6D7IZEmJNdtgNqpzGG8RuNFHt2jQxWlAs4HMe119chBnv+34syEZtc6IhLtA== +check-error@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/check-error/-/check-error-2.1.1.tgz#87eb876ae71ee388fa0471fe423f494be1d96ccc" + integrity sha512-OAlb+T7V4Op9OwdkjmguYRqncdlx5JiofwOAUkmTF+jNdHwzTaTs4sRAGpzLF3oOz5xAyDGrPgeIDFQmDOTiJw== check-more-types@2.24.0, check-more-types@^2.24.0: version "2.24.0" @@ -6729,20 +6954,6 @@ concat-stream@^2.0.0: readable-stream "^3.0.2" typedarray "^0.0.6" -concordance@^5.0.4: - version "5.0.4" - resolved "https://registry.yarnpkg.com/concordance/-/concordance-5.0.4.tgz#9896073261adced72f88d60e4d56f8efc4bbbbd2" - integrity sha512-OAcsnTEYu1ARJqWVGwf4zh4JDfHZEaSNlNccFmt8YjB2l/n19/PF2viLINHc57vO4FKIAFl2FWASIGZZWZ2Kxw== - dependencies: - date-time "^3.1.0" - esutils "^2.0.3" - fast-diff "^1.2.0" - js-string-escape "^1.0.1" - lodash "^4.17.15" - md5-hex "^3.0.1" - semver "^7.3.2" - well-known-symbols "^2.0.0" - concurrently@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/concurrently/-/concurrently-7.0.0.tgz#78d31b441cec338dab03316c221a2f9a67c529b0" @@ -7367,13 +7578,6 @@ date-fns@^2.16.1: resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-2.28.0.tgz#9570d656f5fc13143e50c975a3b6bbeb46cd08b2" integrity sha512-8d35hViGYx/QH0icHYCeLmsLmMUheMmTyV9Fcm6gvNwdw31yXXH+O85sOBJ+OLnLQMKZowvpKb6FgMIQjcpvQw== -date-time@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/date-time/-/date-time-3.1.0.tgz#0d1e934d170579f481ed8df1e2b8ff70ee845e1e" - integrity sha512-uqCUKXE5q1PNBXjPqvwhwJf9SwMoAHBgWJ6DcrnS5o+W2JOiIILl0JEdVD8SGujrNS02GGxgwAg2PN2zONgtjg== - dependencies: - time-zone "^1.0.0" - dayjs@^1.10.4: version "1.11.7" resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.11.7.tgz#4b296922642f70999544d1144a2c25730fce63e2" @@ -7412,6 +7616,13 @@ debug@^3.1.0, debug@^3.2.7: dependencies: ms "^2.1.1" +debug@^4.3.5: + version "4.3.5" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.5.tgz#e83444eceb9fedd4a1da56d671ae2446a01a6e1e" + integrity sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg== + dependencies: + ms "2.1.2" + decamelize-keys@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/decamelize-keys/-/decamelize-keys-1.1.0.tgz#d171a87933252807eb3cb61dc1c1445d078df2d9" @@ -7459,12 +7670,10 @@ dedent@^0.7.0: resolved "https://registry.yarnpkg.com/dedent/-/dedent-0.7.0.tgz#2495ddbaf6eb874abb0e1be9df22d2e5a544326c" integrity sha1-JJXduvbrh0q7Dhvp3yLS5aVEMmw= -deep-eql@^4.1.2: - version "4.1.3" - resolved "https://registry.yarnpkg.com/deep-eql/-/deep-eql-4.1.3.tgz#7c7775513092f7df98d8df9996dd085eb668cc6d" - integrity sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw== - dependencies: - type-detect "^4.0.0" +deep-eql@^5.0.1: + version "5.0.2" + resolved "https://registry.yarnpkg.com/deep-eql/-/deep-eql-5.0.2.tgz#4b756d8d770a9257300825d52a2c2cff99c3a341" + integrity sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q== deep-equal@^2.0.5: version "2.1.0" @@ -7807,6 +8016,11 @@ electron-to-chromium@^1.4.796, electron-to-chromium@^1.4.84: resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.815.tgz#e901b195c57c3e0fae8dc6d596e4188a33c3e82c" integrity sha512-OvpTT2ItpOXJL7IGcYakRjHCt8L5GrrN/wHCQsRB4PQa1X9fe+X9oen245mIId7s14xvArCGSTIq644yPUKKLg== +electron-to-chromium@^1.4.820: + version "1.5.1" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.1.tgz#24640bd4dcfaccb6d82bb4c3f4c7311503241581" + integrity sha512-FKbOCOQ5QRB3VlIbl1LZQefWIYwszlBloaXcY2rbfpu9ioJnNh3TK03YtIDKDo3WKBi8u+YV4+Fn2CkEozgf4w== + elegant-spinner@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/elegant-spinner/-/elegant-spinner-1.0.1.tgz#db043521c95d7e303fd8f345bedc3349cfb0729e" @@ -8059,33 +8273,34 @@ esbuild@0.18.10: "@esbuild/win32-ia32" "0.18.10" "@esbuild/win32-x64" "0.18.10" -esbuild@^0.17.5: - version "0.17.19" - resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.17.19.tgz#087a727e98299f0462a3d0bcdd9cd7ff100bd955" - integrity sha512-XQ0jAPFkK/u3LcVRcvVHQcTIqD6E2H1fvZMA5dQPSOWb3suUbWbfbRf94pjc0bNzRYLfIrDRQXr7X+LHIm5oHw== +esbuild@^0.21.3: + version "0.21.5" + resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.21.5.tgz#9ca301b120922959b766360d8ac830da0d02997d" + integrity sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw== optionalDependencies: - "@esbuild/android-arm" "0.17.19" - "@esbuild/android-arm64" "0.17.19" - "@esbuild/android-x64" "0.17.19" - "@esbuild/darwin-arm64" "0.17.19" - "@esbuild/darwin-x64" "0.17.19" - "@esbuild/freebsd-arm64" "0.17.19" - "@esbuild/freebsd-x64" "0.17.19" - "@esbuild/linux-arm" "0.17.19" - "@esbuild/linux-arm64" "0.17.19" - "@esbuild/linux-ia32" "0.17.19" - "@esbuild/linux-loong64" "0.17.19" - "@esbuild/linux-mips64el" "0.17.19" - "@esbuild/linux-ppc64" "0.17.19" - "@esbuild/linux-riscv64" "0.17.19" - "@esbuild/linux-s390x" "0.17.19" - "@esbuild/linux-x64" "0.17.19" - "@esbuild/netbsd-x64" "0.17.19" - "@esbuild/openbsd-x64" "0.17.19" - "@esbuild/sunos-x64" "0.17.19" - "@esbuild/win32-arm64" "0.17.19" - "@esbuild/win32-ia32" "0.17.19" - "@esbuild/win32-x64" "0.17.19" + "@esbuild/aix-ppc64" "0.21.5" + "@esbuild/android-arm" "0.21.5" + "@esbuild/android-arm64" "0.21.5" + "@esbuild/android-x64" "0.21.5" + "@esbuild/darwin-arm64" "0.21.5" + "@esbuild/darwin-x64" "0.21.5" + "@esbuild/freebsd-arm64" "0.21.5" + "@esbuild/freebsd-x64" "0.21.5" + "@esbuild/linux-arm" "0.21.5" + "@esbuild/linux-arm64" "0.21.5" + "@esbuild/linux-ia32" "0.21.5" + "@esbuild/linux-loong64" "0.21.5" + "@esbuild/linux-mips64el" "0.21.5" + "@esbuild/linux-ppc64" "0.21.5" + "@esbuild/linux-riscv64" "0.21.5" + "@esbuild/linux-s390x" "0.21.5" + "@esbuild/linux-x64" "0.21.5" + "@esbuild/netbsd-x64" "0.21.5" + "@esbuild/openbsd-x64" "0.21.5" + "@esbuild/sunos-x64" "0.21.5" + "@esbuild/win32-arm64" "0.21.5" + "@esbuild/win32-ia32" "0.21.5" + "@esbuild/win32-x64" "0.21.5" escalade@^3.1.1, escalade@^3.1.2: version "3.1.2" @@ -8564,7 +8779,7 @@ estree-walker@^3.0.0, estree-walker@^3.0.3: dependencies: "@types/estree" "^1.0.0" -esutils@^2.0.2, esutils@^2.0.3: +esutils@^2.0.2: version "2.0.3" resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== @@ -8724,6 +8939,21 @@ execa@^7.1.1: signal-exit "^3.0.7" strip-final-newline "^3.0.0" +execa@^8.0.1: + version "8.0.1" + resolved "https://registry.yarnpkg.com/execa/-/execa-8.0.1.tgz#51f6a5943b580f963c3ca9c6321796db8cc39b8c" + integrity sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg== + dependencies: + cross-spawn "^7.0.3" + get-stream "^8.0.1" + human-signals "^5.0.0" + is-stream "^3.0.0" + merge-stream "^2.0.0" + npm-run-path "^5.1.0" + onetime "^6.0.0" + signal-exit "^4.1.0" + strip-final-newline "^3.0.0" + executable@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/executable/-/executable-4.1.1.tgz#41532bff361d3e57af4d763b70582db18f5d133c" @@ -8894,7 +9124,7 @@ fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== -fast-diff@^1.1.2, fast-diff@^1.2.0: +fast-diff@^1.1.2: version "1.3.0" resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.3.0.tgz#ece407fa550a64d638536cd727e129c61616e0f0" integrity sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw== @@ -9413,6 +9643,11 @@ fsevents@^2.3.2, fsevents@~2.3.2: resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== +fsevents@~2.3.3: + version "2.3.3" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6" + integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw== + function-bind@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.2.tgz#2c02d864d97f3ea6c8830c464cbd11ab6eab7a1c" @@ -9477,10 +9712,10 @@ get-caller-file@^2.0.1, get-caller-file@^2.0.5: resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== -get-func-name@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/get-func-name/-/get-func-name-2.0.0.tgz#ead774abee72e20409433a066366023dd6887a41" - integrity sha512-Hm0ixYtaSZ/V7C8FJrtZIuBBI+iSgL+1Aq82zSu8VQNB4S3Gk8e7Qs3VwBDJAhmRZcFqkl3tQu36g/Foh5I5ig== +get-func-name@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/get-func-name/-/get-func-name-2.0.2.tgz#0d7cf20cd13fda808669ffa88f4ffc7a3943fc41" + integrity sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ== get-intrinsic@^1.1.0, get-intrinsic@^1.1.1, get-intrinsic@^1.1.3, get-intrinsic@^1.2.1, get-intrinsic@^1.2.3, get-intrinsic@^1.2.4: version "1.2.4" @@ -9537,6 +9772,11 @@ get-stream@^6.0.0, get-stream@^6.0.1: resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-6.0.1.tgz#a262d8eef67aced57c2852ad6167526a43cbf7b7" integrity sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg== +get-stream@^8.0.1: + version "8.0.1" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-8.0.1.tgz#def9dfd71742cd7754a7761ed43749a27d02eca2" + integrity sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA== + get-symbol-description@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/get-symbol-description/-/get-symbol-description-1.0.2.tgz#533744d5aa20aca4e079c8e5daf7fd44202821f5" @@ -10188,6 +10428,11 @@ human-signals@^4.3.0: resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-4.3.1.tgz#ab7f811e851fca97ffbd2c1fe9a958964de321b2" integrity sha512-nZXjEF2nbo7lIw3mgYjItAfgQXog3OjJogSbKa2CQIIvSGWcKgeJnQlNXip6NglNzYH45nSRiEVimMvYL8DDqQ== +human-signals@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-5.0.0.tgz#42665a284f9ae0dade3ba41ebc37eb4b852f3a28" + integrity sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ== + husky@^4.2.3: version "4.3.8" resolved "https://registry.yarnpkg.com/husky/-/husky-4.3.8.tgz#31144060be963fd6850e5cc8f019a1dfe194296d" @@ -11552,11 +11797,6 @@ js-green-licenses@4.0.0: spdx-satisfies "^5.0.0" strip-json-comments "^3.0.0" -js-string-escape@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/js-string-escape/-/js-string-escape-1.0.1.tgz#e2625badbc0d67c7533e9edc1068c587ae4137ef" - integrity sha512-Smw4xcfIQ5LVjAOuJCvN/zIodzA/BBSsluuoSykP+lUvScIi4U6RJLfwHet5cxFnCswUjISV8oAXaqaJDY3chg== - "js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" @@ -12046,11 +12286,6 @@ loader-utils@^2.0.0, loader-utils@^2.0.2: emojis-list "^3.0.0" json5 "^2.1.2" -local-pkg@^0.4.3: - version "0.4.3" - resolved "https://registry.yarnpkg.com/local-pkg/-/local-pkg-0.4.3.tgz#0ff361ab3ae7f1c19113d9bb97b98b905dbc4963" - integrity sha512-SFppqq5p42fe2qcZQqqEOiVRXl+WCP1MdT6k7BDEW1j++sp5fIY+/fdRQitvKgB5BrBcmrs5m/L0v2FrU5MY1g== - locate-character@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/locate-character/-/locate-character-3.0.0.tgz#0305c5b8744f61028ef5d01f444009e00779f974" @@ -12209,12 +12444,12 @@ loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.4.0: dependencies: js-tokens "^3.0.0 || ^4.0.0" -loupe@^2.3.1, loupe@^2.3.6: - version "2.3.6" - resolved "https://registry.yarnpkg.com/loupe/-/loupe-2.3.6.tgz#76e4af498103c532d1ecc9be102036a21f787b53" - integrity sha512-RaPMZKiMy8/JruncMU5Bt6na1eftNoo++R4Y+N2FrxkDVTrGvcyzFTsaGif4QTeKESheMGegbhw6iUAq+5A8zA== +loupe@^3.1.0, loupe@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/loupe/-/loupe-3.1.1.tgz#71d038d59007d890e3247c5db97c1ec5a92edc54" + integrity sha512-edNu/8D5MKVfGVFRhFf8aAxiTM6Wumfz5XsaatSxlD3w4R1d/WEKUTydCdPGbl9K7QG/Ca3GnDV2sIKIpXRQcw== dependencies: - get-func-name "^2.0.0" + get-func-name "^2.0.1" lower-case@^2.0.2: version "2.0.2" @@ -12286,6 +12521,13 @@ magic-string@^0.30.0, magic-string@^0.30.5: dependencies: "@jridgewell/sourcemap-codec" "^1.4.15" +magic-string@^0.30.10: + version "0.30.10" + resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.30.10.tgz#123d9c41a0cb5640c892b041d4cfb3bd0aa4b39e" + integrity sha512-iIRwTIf0QKV3UAnYK4PU8uiEc4SRh5jX0mwpIwETPpHdhVM4f53RSwS/vXvN1JhGX+Cs7B8qIq3d6AH49O5fAQ== + dependencies: + "@jridgewell/sourcemap-codec" "^1.4.15" + make-dir@^2.0.0, make-dir@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-2.1.0.tgz#5f0310e18b8be898cc07009295a30ae41e91e6f5" @@ -12381,13 +12623,6 @@ math-random@^1.0.1: resolved "https://registry.yarnpkg.com/math-random/-/math-random-1.0.4.tgz#5dd6943c938548267016d4e34f057583080c514c" integrity sha512-rUxjysqif/BZQH2yhd5Aaq7vXMSx9NdEsQcyA07uEzIvxgI7zIr33gGsh+RU0/XjmQpCW7RsVof1vlkvQVCK5A== -md5-hex@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/md5-hex/-/md5-hex-3.0.1.tgz#be3741b510591434b2784d79e556eefc2c9a8e5c" - integrity sha512-BUiRtTtV39LIJwinWBjqVsU9xhdnz7/i889V859IBFpuqGAj6LuOvHv5XLbgZ2R7ptJoJaEcxkv88/h25T7Ciw== - dependencies: - blueimp-md5 "^2.10.0" - mdast-util-from-markdown@^0.8.5: version "0.8.5" resolved "https://registry.yarnpkg.com/mdast-util-from-markdown/-/mdast-util-from-markdown-0.8.5.tgz#d1ef2ca42bc377ecb0463a987910dae89bd9a28c" @@ -13093,16 +13328,6 @@ mkdirp@^1.0.4: resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e" integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw== -mlly@^1.2.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/mlly/-/mlly-1.4.0.tgz#830c10d63f1f97bd8785377b24dc2a15d972832b" - integrity sha512-ua8PAThnTwpprIaU47EPeZ/bPUVp2QYBbWMphUQpVdBI3Lgqzm5KZQ45Agm3YJedHXaIHl6pBGabaLSUPPSptg== - dependencies: - acorn "^8.9.0" - pathe "^1.1.1" - pkg-types "^1.0.3" - ufo "^1.1.2" - mocha@^10.0.0: version "10.0.0" resolved "https://registry.yarnpkg.com/mocha/-/mocha-10.0.0.tgz#205447d8993ec755335c4b13deba3d3a13c4def9" @@ -13687,13 +13912,6 @@ p-limit@^2.0.0, p-limit@^2.2.0: dependencies: p-try "^2.0.0" -p-limit@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-4.0.0.tgz#914af6544ed32bfa54670b061cafcbd04984b644" - integrity sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ== - dependencies: - yocto-queue "^1.0.0" - p-locate@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-3.0.0.tgz#322d69a05c0264b25997d9f40cd8a891ab0064a4" @@ -13972,15 +14190,15 @@ path-type@^4.0.0: resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== -pathe@^1.1.0, pathe@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/pathe/-/pathe-1.1.1.tgz#1dd31d382b974ba69809adc9a7a347e65d84829a" - integrity sha512-d+RQGp0MAYTIaDBIMmOfMwz3E+LOZnxx1HZd5R18mmCZY0QBlK0LDZfPc8FW8Ed2DlvsuE6PRjroDY+wg4+j/Q== +pathe@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/pathe/-/pathe-1.1.2.tgz#6c4cb47a945692e48a1ddd6e4094d170516437ec" + integrity sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ== -pathval@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/pathval/-/pathval-1.1.1.tgz#8534e77a77ce7ac5a2512ea21e0fdb8fcf6c3d8d" - integrity sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ== +pathval@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/pathval/-/pathval-2.0.0.tgz#7e2550b422601d4f6b8e26f1301bc8f15a741a25" + integrity sha512-vE7JKRyES09KiunauX7nd2Q9/L7lhok4smP9RZTDeD4MVs72Dp2qNFVz39Nz5a0FVEW0BJR6C0DYrq6unoziZA== pause-stream@0.0.11: version "0.0.11" @@ -14059,15 +14277,6 @@ pkg-dir@^5.0.0: dependencies: find-up "^5.0.0" -pkg-types@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/pkg-types/-/pkg-types-1.0.3.tgz#988b42ab19254c01614d13f4f65a2cfc7880f868" - integrity sha512-nN7pYi0AQqJnoLPC9eHFQ8AcyaixBUOwvqc5TDnIKCMEE6I0y8P7OKA7fPexsXGCGxQDl/cmrLAp26LhcwxZ4A== - dependencies: - jsonc-parser "^3.2.0" - mlly "^1.2.0" - pathe "^1.1.0" - platform@^1.3.3, platform@^1.3.5: version "1.3.6" resolved "https://registry.yarnpkg.com/platform/-/platform-1.3.6.tgz#48b4ce983164b209c2d45a107adb31f473a6e7a7" @@ -14629,7 +14838,7 @@ postcss@8.4.21: picocolors "^1.0.0" source-map-js "^1.0.2" -postcss@^8.4.19, postcss@^8.4.23, postcss@^8.4.32: +postcss@^8.4.19, postcss@^8.4.32: version "8.4.33" resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.33.tgz#1378e859c9f69bf6f638b990a0212f43e2aaa742" integrity sha512-Kkpbhhdjw2qQs2O2DGX+8m5OVqEcbB9HRBvuYM9pgrjEFUg30A9LmXNlTAUj4S9kgtGyrMbTzVjH7E+s5Re2yg== @@ -14638,6 +14847,15 @@ postcss@^8.4.19, postcss@^8.4.23, postcss@^8.4.32: picocolors "^1.0.0" source-map-js "^1.0.2" +postcss@^8.4.39: + version "8.4.40" + resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.40.tgz#eb81f2a4dd7668ed869a6db25999e02e9ad909d8" + integrity sha512-YF2kKIUzAofPMpfH6hOi2cGnv/HrUlfucspc7pDyvv7kGdqXrfj8SCl/t8owkEgKEuu8ZcRjSOxFxVLqwChZ2Q== + dependencies: + nanoid "^3.3.7" + picocolors "^1.0.1" + source-map-js "^1.2.0" + postinstall-postinstall@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/postinstall-postinstall/-/postinstall-postinstall-2.1.0.tgz#4f7f77441ef539d1512c40bd04c71b06a4704ca3" @@ -14968,10 +15186,10 @@ react-lifecycles-compat@^3.0.4: resolved "https://registry.yarnpkg.com/react-lifecycles-compat/-/react-lifecycles-compat-3.0.4.tgz#4f1a273afdfc8f3488a8c516bfda78f872352362" integrity sha512-fBASbA6LnOU9dOU2eW7aQ8xmYBSXUIWr+UmF9b1efZBazGNO+rcXT/icdKnYm2pTwcRylVUYwW7H1PHfLekVzA== -react-refresh@^0.14.0: - version "0.14.0" - resolved "https://registry.yarnpkg.com/react-refresh/-/react-refresh-0.14.0.tgz#4e02825378a5f227079554d4284889354e5f553e" - integrity sha512-wViHqhAd8OHeLS/IRMJjTSDHF3U9eWi62F/MledQGPdJGDhodXJ9PBLNGr6WWL7qlH12Mt3TyTpbS+hGXMjCzQ== +react-refresh@^0.14.2: + version "0.14.2" + resolved "https://registry.yarnpkg.com/react-refresh/-/react-refresh-0.14.2.tgz#3833da01ce32da470f1f936b9d477da5c7028bf9" + integrity sha512-jCvmsr+1IUSMUyzOkRcvnVbX3ZYC6g9TDrDbFuFmRDq7PD4yaGbLKNQL6k2jnArV8hjYxh7hVhAZB6s9HDGpZA== react-remove-scroll-bar@^2.3.3: version "2.3.3" @@ -15552,11 +15770,29 @@ rollup@^2.35.1, rollup@^2.43.1, rollup@^2.60.2: optionalDependencies: fsevents "~2.3.2" -rollup@^3.21.0: - version "3.25.1" - resolved "https://registry.yarnpkg.com/rollup/-/rollup-3.25.1.tgz#9fff79d22ff1a904b2b595a2fb9bc3793cb987d8" - integrity sha512-tywOR+rwIt5m2ZAWSe5AIJcTat8vGlnPFAv15ycCrw33t6iFsXZ6mzHVFh2psSjxQPmI+xgzMZZizUAukBI4aQ== +rollup@^4.13.0: + version "4.19.0" + resolved "https://registry.yarnpkg.com/rollup/-/rollup-4.19.0.tgz#83b08cc0b2bc38c26c194cb7f2cdabd84a2a8c02" + integrity sha512-5r7EYSQIowHsK4eTZ0Y81qpZuJz+MUuYeqmmYmRMl1nwhdmbiYqt5jwzf6u7wyOzJgYqtCRMtVRKOtHANBz7rA== + dependencies: + "@types/estree" "1.0.5" optionalDependencies: + "@rollup/rollup-android-arm-eabi" "4.19.0" + "@rollup/rollup-android-arm64" "4.19.0" + "@rollup/rollup-darwin-arm64" "4.19.0" + "@rollup/rollup-darwin-x64" "4.19.0" + "@rollup/rollup-linux-arm-gnueabihf" "4.19.0" + "@rollup/rollup-linux-arm-musleabihf" "4.19.0" + "@rollup/rollup-linux-arm64-gnu" "4.19.0" + "@rollup/rollup-linux-arm64-musl" "4.19.0" + "@rollup/rollup-linux-powerpc64le-gnu" "4.19.0" + "@rollup/rollup-linux-riscv64-gnu" "4.19.0" + "@rollup/rollup-linux-s390x-gnu" "4.19.0" + "@rollup/rollup-linux-x64-gnu" "4.19.0" + "@rollup/rollup-linux-x64-musl" "4.19.0" + "@rollup/rollup-win32-arm64-msvc" "4.19.0" + "@rollup/rollup-win32-ia32-msvc" "4.19.0" + "@rollup/rollup-win32-x64-msvc" "4.19.0" fsevents "~2.3.2" run-parallel@^1.1.9: @@ -15965,6 +16201,11 @@ signal-exit@^4.0.1: resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-4.0.2.tgz#ff55bb1d9ff2114c13b400688fa544ac63c36967" integrity sha512-MY2/qGx4enyjprQnFaZsHib3Yadh3IXyV2C321GY0pjGfVBu4un0uDJkwgdxqO+Rdx8JMT8IfJIRwbYVz3Ob3Q== +signal-exit@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-4.1.0.tgz#952188c1cbd546070e2dd20d0f41c0ae0530cb04" + integrity sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw== + simple-concat@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/simple-concat/-/simple-concat-1.0.1.tgz#f46976082ba35c2263f1c8ab5edfe26c41c9552f" @@ -16061,6 +16302,11 @@ source-map-js@1.0.2, source-map-js@^1.0.1, source-map-js@^1.0.2: resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.0.2.tgz#adbc361d9c62df380125e7f161f71c826f1e490c" integrity sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw== +source-map-js@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.2.0.tgz#16b809c162517b5b8c3e7dcd315a2a5c2612b2af" + integrity sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg== + source-map-support@^0.5.16, source-map-support@^0.5.17, source-map-support@^0.5.6, source-map-support@~0.5.20: version "0.5.21" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.21.tgz#04fe7c7f9e1ed2d662233c28cb2b35b9f63f6e4f" @@ -16250,10 +16496,10 @@ statuses@2.0.1: resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" integrity sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow= -std-env@^3.3.2: - version "3.3.3" - resolved "https://registry.yarnpkg.com/std-env/-/std-env-3.3.3.tgz#a54f06eb245fdcfef53d56f3c0251f1d5c3d01fe" - integrity sha512-Rz6yejtVyWnVjC1RFvNmYL10kgjC49EOghxWn0RFqlCHGFpQx+Xe7yW3I4ceK1SGrWIGMjD5Kbue8W/udkbMJg== +std-env@^3.7.0: + version "3.7.0" + resolved "https://registry.yarnpkg.com/std-env/-/std-env-3.7.0.tgz#c9f7386ced6ecf13360b6c6c55b8aaa4ef7481d2" + integrity sha512-JPbdCEQLj1w5GilpiHAx3qJvFndqybBysA3qUOnznweH4QbNYUsW/ea8QzSrnh0vNsezMMw5bcVool8lM0gwzg== stoppable@^1.1.0: version "1.1.0" @@ -16546,13 +16792,6 @@ strip-json-comments@~2.0.1: resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo= -strip-literal@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/strip-literal/-/strip-literal-1.0.1.tgz#0115a332710c849b4e46497891fb8d585e404bd2" - integrity sha512-QZTsipNpa2Ppr6v1AmJHESqJ3Uz247MUS0OjrnnZjFAvEoWqxuyFuXn2xLgMtRnijJShAa1HL0gtJyUs7u7n3Q== - dependencies: - acorn "^8.8.2" - style-loader@^3.3.1: version "3.3.1" resolved "https://registry.yarnpkg.com/style-loader/-/style-loader-3.3.1.tgz#057dfa6b3d4d7c7064462830f9113ed417d38575" @@ -16854,25 +17093,25 @@ thunky@^1.0.2: resolved "https://registry.yarnpkg.com/thunky/-/thunky-1.1.0.tgz#5abaf714a9405db0504732bbccd2cedd9ef9537d" integrity sha512-eHY7nBftgThBqOyHGVN+l8gF0BucP09fMo0oO/Lb0w1OF80dJv+lDVpXG60WMQvkcxAkNybKsrEIE3ZtKGmPrA== -time-zone@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/time-zone/-/time-zone-1.0.0.tgz#99c5bf55958966af6d06d83bdf3800dc82faec5d" - integrity sha512-TIsDdtKo6+XrPtiTm1ssmMngN1sAhyKnTO2kunQWqNPWIVvCm15Wmw4SWInwTVgJ5u/Tr04+8Ei9TNcw4x4ONA== +tinybench@^2.8.0: + version "2.8.0" + resolved "https://registry.yarnpkg.com/tinybench/-/tinybench-2.8.0.tgz#30e19ae3a27508ee18273ffed9ac7018949acd7b" + integrity sha512-1/eK7zUnIklz4JUUlL+658n58XO2hHLQfSk1Zf2LKieUjxidN16eKFEoDEfjHc3ohofSSqK3X5yO6VGb6iW8Lw== -tinybench@^2.5.0: - version "2.5.0" - resolved "https://registry.yarnpkg.com/tinybench/-/tinybench-2.5.0.tgz#4711c99bbf6f3e986f67eb722fed9cddb3a68ba5" - integrity sha512-kRwSG8Zx4tjF9ZiyH4bhaebu+EDz1BOx9hOigYHlUW4xxI/wKIUQUqo018UlU4ar6ATPBsaMrdbKZ+tmPdohFA== +tinypool@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/tinypool/-/tinypool-1.0.0.tgz#a68965218e04f4ad9de037d2a1cd63cda9afb238" + integrity sha512-KIKExllK7jp3uvrNtvRBYBWBOAXSX8ZvoaD8T+7KB/QHIuoJW3Pmr60zucywjAlMb5TeXUkcs/MWeWLu0qvuAQ== -tinypool@^0.5.0: - version "0.5.0" - resolved "https://registry.yarnpkg.com/tinypool/-/tinypool-0.5.0.tgz#3861c3069bf71e4f1f5aa2d2e6b3aaacc278961e" - integrity sha512-paHQtnrlS1QZYKF/GnLoOM/DN9fqaGOFbCbxzAhwniySnzl9Ebk8w73/dd34DAhe/obUbPAOldTyYXQZxnPBPQ== +tinyrainbow@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/tinyrainbow/-/tinyrainbow-1.2.0.tgz#5c57d2fc0fb3d1afd78465c33ca885d04f02abb5" + integrity sha512-weEDEq7Z5eTHPDh4xjX789+fHfF+P8boiFB+0vbWzpbnbsEr/GRaohi/uMKxg8RZMXnl1ItAi/IUHWMsjDV7kQ== -tinyspy@^2.1.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/tinyspy/-/tinyspy-2.1.1.tgz#9e6371b00c259e5c5b301917ca18c01d40ae558c" - integrity sha512-XPJL2uSzcOyBMky6OFrusqWlzfFrXtE0hPuMgW8A2HmaqrPo4ZQHRN/V0QXN3FSjKxpsbRrFc5LI7KOwBsT1/w== +tinyspy@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/tinyspy/-/tinyspy-3.0.0.tgz#cb61644f2713cd84dee184863f4642e06ddf0585" + integrity sha512-q5nmENpTHgiPVd1cJDDc9cVoYN5x4vCvwT3FMilvKPKneCBZAxn2YWQjDF0UMcE9k0Cay1gBiDfTMU0g+mPMQA== tmp@^0.0.33: version "0.0.33" @@ -17092,7 +17331,7 @@ type-check@~0.3.2: dependencies: prelude-ls "~1.1.2" -type-detect@4.0.8, type-detect@^4.0.0, type-detect@^4.0.5: +type-detect@4.0.8: version "4.0.8" resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c" integrity sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g== @@ -17257,11 +17496,6 @@ uc.micro@^2.0.0, uc.micro@^2.1.0: resolved "https://registry.yarnpkg.com/uc.micro/-/uc.micro-2.1.0.tgz#f8d3f7d0ec4c3dea35a7e3c8efa4cb8b45c9e7ee" integrity sha512-ARDJmphmdvUk6Glw7y9DQ2bFkKBHwQHLi2lsaH6PPmz/Ka9sFOBsBluozhDltWmnv9u/cF6Rt87znRTPV+yp/A== -ufo@^1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/ufo/-/ufo-1.1.2.tgz#d0d9e0fa09dece0c31ffd57bd363f030a35cfe76" - integrity sha512-TrY6DsjTQQgyS3E3dBaOXf0TpPD8u9FVrVYmKVegJuFw51n/YB9XPt+U6ydzFG5ZIN7+DIjPbNmXoBj9esYhgQ== - uglify-js@^3.1.4: version "3.8.1" resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.8.1.tgz#43bb15ce6f545eaa0a64c49fd29375ea09fa0f93" @@ -17482,6 +17716,14 @@ update-browserslist-db@^1.0.16: escalade "^3.1.2" picocolors "^1.0.1" +update-browserslist-db@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.1.0.tgz#7ca61c0d8650766090728046e416a8cde682859e" + integrity sha512-EdRAaAyk2cUE1wOf2DkEhzxqOQvFOoRJFNS6NeyJ01Gp2beMRpBAINjM2iDXE3KCuKhwnvHIQCJm6ThL2Z+HzQ== + dependencies: + escalade "^3.1.2" + picocolors "^1.0.1" + update-check@1.5.2: version "1.5.2" resolved "https://registry.yarnpkg.com/update-check/-/update-check-1.5.2.tgz#2fe09f725c543440b3d7dabe8971f2d5caaedc28" @@ -17678,73 +17920,77 @@ vinyl@^1.1.1: clone-stats "^0.0.1" replace-ext "0.0.1" -vite-node@0.32.2: - version "0.32.2" - resolved "https://registry.yarnpkg.com/vite-node/-/vite-node-0.32.2.tgz#bfccdfeb708b2309ea9e5fe424951c75bb9c0096" - integrity sha512-dTQ1DCLwl2aEseov7cfQ+kDMNJpM1ebpyMMMwWzBvLbis8Nla/6c9WQcqpPssTwS6Rp/+U6KwlIj8Eapw4bLdA== +vite-node@2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/vite-node/-/vite-node-2.0.4.tgz#5600cc9f0d9c3ff9a64050c6858e7e1b62fb3fcd" + integrity sha512-ZpJVkxcakYtig5iakNeL7N3trufe3M6vGuzYAr4GsbCTwobDeyPJpE4cjDhhPluv8OvQCFzu2LWp6GkoKRITXA== dependencies: cac "^6.7.14" - debug "^4.3.4" - mlly "^1.2.0" - pathe "^1.1.0" - picocolors "^1.0.0" - vite "^3.0.0 || ^4.0.0" + debug "^4.3.5" + pathe "^1.1.2" + tinyrainbow "^1.2.0" + vite "^5.0.0" vite-plugin-monaco-editor@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/vite-plugin-monaco-editor/-/vite-plugin-monaco-editor-1.1.0.tgz#a6238c2e13d5e98dd54a1bc51f6f189325219de3" integrity sha512-IvtUqZotrRoVqwT0PBBDIZPNraya3BxN/bfcNfnxZ5rkJiGcNtO5eAOWWSgT7zullIAEqQwxMU83yL9J5k7gww== -vite-plugin-svgr@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/vite-plugin-svgr/-/vite-plugin-svgr-3.2.0.tgz#920375aaf6635091c9ac8e467825f92d32544476" - integrity sha512-Uvq6niTvhqJU6ga78qLKBFJSDvxWhOnyfQSoKpDPMAGxJPo5S3+9hyjExE5YDj6Lpa4uaLkGc1cBgxXov+LjSw== +vite-plugin-svgr@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/vite-plugin-svgr/-/vite-plugin-svgr-4.2.0.tgz#9f3bf5206b0ec510287e56d16f1915e729bb4e6b" + integrity sha512-SC7+FfVtNQk7So0XMjrrtLAbEC8qjFPifyD7+fs/E6aaNdVde6umlVVh0QuwDLdOMu7vp5RiGFsB70nj5yo0XA== dependencies: - "@rollup/pluginutils" "^5.0.2" - "@svgr/core" "^7.0.0" - "@svgr/plugin-jsx" "^7.0.0" + "@rollup/pluginutils" "^5.0.5" + "@svgr/core" "^8.1.0" + "@svgr/plugin-jsx" "^8.1.0" -"vite@^3.0.0 || ^4.0.0", vite@^4.3.9: - version "4.3.9" - resolved "https://registry.yarnpkg.com/vite/-/vite-4.3.9.tgz#db896200c0b1aa13b37cdc35c9e99ee2fdd5f96d" - integrity sha512-qsTNZjO9NoJNW7KnOrgYwczm0WctJ8m/yqYAMAK9Lxt4SoySUfS5S8ia9K7JHpa3KEeMfyF8LoJ3c5NeBJy6pg== +vite@^5.0.0: + version "5.3.5" + resolved "https://registry.yarnpkg.com/vite/-/vite-5.3.5.tgz#b847f846fb2b6cb6f6f4ed50a830186138cb83d8" + integrity sha512-MdjglKR6AQXQb9JGiS7Rc2wC6uMjcm7Go/NHNO63EwiJXfuk9PgqiP/n5IDJCziMkfw9n4Ubp7lttNwz+8ZVKA== dependencies: - esbuild "^0.17.5" - postcss "^8.4.23" - rollup "^3.21.0" + esbuild "^0.21.3" + postcss "^8.4.39" + rollup "^4.13.0" optionalDependencies: - fsevents "~2.3.2" + fsevents "~2.3.3" -vitest@^0.32.2: - version "0.32.2" - resolved "https://registry.yarnpkg.com/vitest/-/vitest-0.32.2.tgz#758ce2220f609e240ac054eca7ad11a5140679ab" - integrity sha512-hU8GNNuQfwuQmqTLfiKcqEhZY72Zxb7nnN07koCUNmntNxbKQnVbeIS6sqUgR3eXSlbOpit8+/gr1KpqoMgWCQ== +vite@^5.3.4: + version "5.3.4" + resolved "https://registry.yarnpkg.com/vite/-/vite-5.3.4.tgz#b36ebd47c8a5e3a8727046375d5f10bf9fdf8715" + integrity sha512-Cw+7zL3ZG9/NZBB8C+8QbQZmR54GwqIz+WMI4b3JgdYJvX+ny9AjJXqkGQlDXSXRP9rP0B4tbciRMOVEKulVOA== dependencies: - "@types/chai" "^4.3.5" - "@types/chai-subset" "^1.3.3" - "@types/node" "*" - "@vitest/expect" "0.32.2" - "@vitest/runner" "0.32.2" - "@vitest/snapshot" "0.32.2" - "@vitest/spy" "0.32.2" - "@vitest/utils" "0.32.2" - acorn "^8.8.2" - acorn-walk "^8.2.0" - cac "^6.7.14" - chai "^4.3.7" - concordance "^5.0.4" - debug "^4.3.4" - local-pkg "^0.4.3" - magic-string "^0.30.0" - pathe "^1.1.0" - picocolors "^1.0.0" - std-env "^3.3.2" - strip-literal "^1.0.1" - tinybench "^2.5.0" - tinypool "^0.5.0" - vite "^3.0.0 || ^4.0.0" - vite-node "0.32.2" - why-is-node-running "^2.2.2" + esbuild "^0.21.3" + postcss "^8.4.39" + rollup "^4.13.0" + optionalDependencies: + fsevents "~2.3.3" + +vitest@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/vitest/-/vitest-2.0.4.tgz#ac6bfbaee53e502cee864b07a5b2edf1fcba793e" + integrity sha512-luNLDpfsnxw5QSW4bISPe6tkxVvv5wn2BBs/PuDRkhXZ319doZyLOBr1sjfB5yCEpTiU7xCAdViM8TNVGPwoog== + dependencies: + "@ampproject/remapping" "^2.3.0" + "@vitest/expect" "2.0.4" + "@vitest/pretty-format" "^2.0.4" + "@vitest/runner" "2.0.4" + "@vitest/snapshot" "2.0.4" + "@vitest/spy" "2.0.4" + "@vitest/utils" "2.0.4" + chai "^5.1.1" + debug "^4.3.5" + execa "^8.0.1" + magic-string "^0.30.10" + pathe "^1.1.2" + std-env "^3.7.0" + tinybench "^2.8.0" + tinypool "^1.0.0" + tinyrainbow "^1.2.0" + vite "^5.0.0" + vite-node "2.0.4" + why-is-node-running "^2.3.0" vsce@^2.6.3: version "2.15.0" @@ -18109,11 +18355,6 @@ websocket-extensions@>=0.1.1: resolved "https://registry.yarnpkg.com/websocket-extensions/-/websocket-extensions-0.1.4.tgz#7f8473bc839dfd87608adb95d7eb075211578a42" integrity sha512-OqedPIGOfsDlo31UNwYbCFMSaO9m9G/0faIHj5/dZFDMFqPTcx6UwqyOy3COEaEOg/9VsGIpdqn62W5KhoKSpg== -well-known-symbols@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/well-known-symbols/-/well-known-symbols-2.0.0.tgz#e9c7c07dbd132b7b84212c8174391ec1f9871ba5" - integrity sha512-ZMjC3ho+KXo0BfJb7JgtQ5IBuvnShdlACNkKkdsqBmYw3bPAaJfPeYUo6tLUaT5tG/Gkh7xkpBhKRQ9e7pyg9Q== - wgutils@^0.1.7: version "0.1.7" resolved "https://registry.yarnpkg.com/wgutils/-/wgutils-0.1.7.tgz#17082c4bcacde23216c8ee3f3c6d92df0e6adaf8" @@ -18249,10 +18490,10 @@ which@^2.0.1: dependencies: isexe "^2.0.0" -why-is-node-running@^2.2.2: - version "2.2.2" - resolved "https://registry.yarnpkg.com/why-is-node-running/-/why-is-node-running-2.2.2.tgz#4185b2b4699117819e7154594271e7e344c9973e" - integrity sha512-6tSwToZxTOcotxHeA+qGCq1mVzKR3CwcJGmVcY+QE8SHy6TnpFnh8PAvPNHYr7EcuVeG0QSMxtYCuO1ta/G/oA== +why-is-node-running@^2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/why-is-node-running/-/why-is-node-running-2.3.0.tgz#a3f69a97107f494b3cdc3bdddd883a7d65cebf04" + integrity sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w== dependencies: siginfo "^2.0.0" stackback "0.0.2" @@ -18800,11 +19041,6 @@ yocto-queue@^0.1.0: resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== -yocto-queue@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-1.0.0.tgz#7f816433fb2cbc511ec8bf7d263c3b58a1a3c251" - integrity sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g== - zod@3.21.4: version "3.21.4" resolved "https://registry.yarnpkg.com/zod/-/zod-3.21.4.tgz#10882231d992519f0a10b5dd58a38c9dabbb64db" From eec0340dad57c0c13902bc3857a4f3281853e4a2 Mon Sep 17 00:00:00 2001 From: Dimitri POSTOLOV Date: Thu, 25 Jul 2024 12:40:47 +0200 Subject: [PATCH 49/81] update eslint to 9 (#3658) * aa * update vite to v5 * aa * fix tests * fix * aa * aa * bump changesets --- .eslintrc.js | 42 +- examples/graphiql-webpack/src/index.jsx | 1 - package.json | 27 +- .../graphiql-plugin-explorer/src/index.tsx | 2 - packages/graphiql/test/afterDevServer.js | 2 +- .../src/parsers/babel.ts | 2 +- packages/monaco-graphql/src/GraphQLWorker.ts | 2 +- packages/monaco-graphql/vitest.config.mts | 2 +- .../src/helpers/network.ts | 2 +- .../vscode-graphql-syntax/vitest.config.mts | 2 +- ...angesets+assemble-release-plan+5.2.2.patch | 26 - ...angesets+assemble-release-plan+6.0.3.patch | 22 + yarn.lock | 815 +++++++++--------- 13 files changed, 468 insertions(+), 479 deletions(-) delete mode 100644 resources/patches/@changesets+assemble-release-plan+5.2.2.patch create mode 100644 resources/patches/@changesets+assemble-release-plan+6.0.3.patch diff --git a/.eslintrc.js b/.eslintrc.js index 497392296af..0a9cdf1f0ec 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -54,21 +54,14 @@ module.exports = { extends: [ 'eslint:recommended', 'plugin:@typescript-eslint/recommended', - 'plugin:import/recommended', - 'plugin:import/typescript', + 'plugin:import-x/recommended', + 'plugin:import-x/typescript', 'plugin:react/recommended', 'plugin:react-hooks/recommended', 'plugin:react/jsx-runtime', 'prettier', ], - plugins: [ - 'promise', - 'sonarjs', - 'unicorn', - '@arthurgeron/react-usememo', - 'sonar', - '@shopify', - ], + plugins: ['promise', 'sonarjs', 'unicorn', 'sonar', '@shopify'], globals: { atom: false, document: false, @@ -81,10 +74,6 @@ module.exports = { '@shopify/prefer-early-return': ['error', { maximumStatements: 2 }], '@shopify/prefer-class-properties': 'off', // enable after https://github.com/Shopify/web-configs/issues/387 will be fixed 'sonarjs/no-inverted-boolean-check': 'error', - '@arthurgeron/react-usememo/require-usememo': [ - 'error', - { checkHookCalls: false }, - ], // Possible Errors (http://eslint.org/docs/rules/#possible-errors) 'no-console': 'error', 'no-constant-binary-expression': 'error', @@ -287,9 +276,9 @@ module.exports = { 'sonarjs/no-ignored-return': 'error', 'unicorn/no-array-push-push': 'error', - 'import/no-extraneous-dependencies': 'error', - 'import/no-duplicates': 'error', - 'import/no-named-as-default': 'error', + 'import-x/no-extraneous-dependencies': 'error', + 'import-x/no-duplicates': 'error', + 'import-x/no-named-as-default': 'error', 'prefer-object-spread': 'error', // React rules 'react/no-unused-state': 'error', @@ -342,10 +331,15 @@ module.exports = { 'sonar/prefer-promise-shorthand': 'error', 'sonar/no-dead-store': 'error', 'unicorn/prefer-node-protocol': 'error', - 'import/no-unresolved': [ + 'import-x/no-unresolved': [ 'error', { ignore: ['^node:', '\\.svg\\?react$'] }, ], + 'no-extra-boolean-cast': [ + 'error', + { enforceForInnerExpressions: true }, + ], + 'unicorn/no-length-as-slice-end': 'error', 'unicorn/prefer-string-replace-all': 'error', 'unicorn/no-hex-escape': 'off', // TODO: enable // doesn't catch a lot of cases; we use ESLint builtin `no-restricted-syntax` to forbid `.keyCode` @@ -409,7 +403,6 @@ module.exports = { rules: { 'jest/no-conditional-expect': 'off', 'jest/expect-expect': ['error', { assertFunctionNames: ['expect*'] }], - '@arthurgeron/react-usememo/require-usememo': 'off', }, }, { @@ -426,14 +419,14 @@ module.exports = { 'no-console': 'off', 'no-new': 'off', 'no-alert': 'off', - 'import/no-unresolved': 'off', + 'import-x/no-unresolved': 'off', }, }, { // Rule for ignoring imported dependencies from tests files files: ['**/__tests__/**', 'webpack.config.js', '**/tests/**'], rules: { - 'import/no-extraneous-dependencies': 'off', + 'import-x/no-extraneous-dependencies': 'off', }, }, { @@ -443,7 +436,7 @@ module.exports = { 'packages/vscode-graphql-execution/**', ], rules: { - 'import/no-unresolved': ['error', { ignore: ['^node:', 'vscode'] }], + 'import-x/no-unresolved': ['error', { ignore: ['^node:', 'vscode'] }], }, }, { @@ -484,14 +477,13 @@ module.exports = { // Rules for codeblocks inside Markdown/MDX files: ['**/*.{md,mdx}/*.{js,jsx,ts,tsx}'], rules: { - 'import/no-extraneous-dependencies': 'off', + 'import-x/no-extraneous-dependencies': 'off', '@typescript-eslint/no-unused-vars': 'off', - 'import/no-unresolved': 'off', + 'import-x/no-unresolved': 'off', 'no-console': 'off', 'no-undef': 'off', 'react/jsx-no-undef': 'off', 'react-hooks/rules-of-hooks': 'off', - '@arthurgeron/react-usememo/require-usememo': 'off', 'sonar/no-dead-store': 'off', '@typescript-eslint/no-restricted-imports': 'off', }, diff --git a/examples/graphiql-webpack/src/index.jsx b/examples/graphiql-webpack/src/index.jsx index 455f6540093..ea0adb4c667 100644 --- a/examples/graphiql-webpack/src/index.jsx +++ b/examples/graphiql-webpack/src/index.jsx @@ -84,7 +84,6 @@ const App = () => { return ( ); @@ -47,7 +46,6 @@ const checkboxChecked = ( style={{ fill: 'hsl(var(--color-info))', marginRight: 'var(--px-4)' }} /> ); -/* eslint-enable @arthurgeron/react-usememo/require-usememo */ const styles: Record = { buttonStyle: { diff --git a/packages/graphiql/test/afterDevServer.js b/packages/graphiql/test/afterDevServer.js index cf055ee66be..6d54fa923fa 100644 --- a/packages/graphiql/test/afterDevServer.js +++ b/packages/graphiql/test/afterDevServer.js @@ -1,4 +1,4 @@ -// eslint-disable-next-line import/no-extraneous-dependencies +// eslint-disable-next-line import-x/no-extraneous-dependencies const { useServer } = require('graphql-ws/lib/use/ws'); const { Server: WebSocketServer } = require('ws'); const schema = require('./schema'); diff --git a/packages/graphql-language-service-server/src/parsers/babel.ts b/packages/graphql-language-service-server/src/parsers/babel.ts index 4216c11a50e..cb27756f3ad 100644 --- a/packages/graphql-language-service-server/src/parsers/babel.ts +++ b/packages/graphql-language-service-server/src/parsers/babel.ts @@ -3,7 +3,7 @@ import { BABEL_PLUGINS, PARSER_OPTIONS } from '../constants'; import { SourceParser } from './types'; export const babelParser = (text: string, plugins?: ParserPlugin[]) => { - const babelPlugins = BABEL_PLUGINS.slice(0, BABEL_PLUGINS.length); + const babelPlugins = [...BABEL_PLUGINS]; if (plugins) { babelPlugins.push(...plugins); } diff --git a/packages/monaco-graphql/src/GraphQLWorker.ts b/packages/monaco-graphql/src/GraphQLWorker.ts index 9ffcf7e44b4..2d47f8b9154 100644 --- a/packages/monaco-graphql/src/GraphQLWorker.ts +++ b/packages/monaco-graphql/src/GraphQLWorker.ts @@ -135,7 +135,7 @@ export class GraphQLWorker { return null; } const prettierStandalone = await import('prettier/standalone'); - // eslint-disable-next-line import/no-unresolved -- should be fixed by pnpm migration (points to @types/prettier rather owns prettier types) + // eslint-disable-next-line import-x/no-unresolved -- should be fixed by pnpm migration (points to @types/prettier rather owns prettier types) const prettierGraphqlParser = await import('prettier/parser-graphql'); return prettierStandalone.format(document, { diff --git a/packages/monaco-graphql/vitest.config.mts b/packages/monaco-graphql/vitest.config.mts index 8348b7c84a1..50d382d83f8 100644 --- a/packages/monaco-graphql/vitest.config.mts +++ b/packages/monaco-graphql/vitest.config.mts @@ -1,4 +1,4 @@ -// eslint-disable-next-line import/no-unresolved -- todo: try to fix better rather ignoring here? +// eslint-disable-next-line import-x/no-unresolved -- todo: try to fix better rather ignoring here? import { defineConfig } from 'vitest/config'; export default defineConfig({ diff --git a/packages/vscode-graphql-execution/src/helpers/network.ts b/packages/vscode-graphql-execution/src/helpers/network.ts index 15cf60ab09a..a92f90b985b 100644 --- a/packages/vscode-graphql-execution/src/helpers/network.ts +++ b/packages/vscode-graphql-execution/src/helpers/network.ts @@ -3,7 +3,7 @@ import { gql } from 'graphql-tag'; import { fetch } from '@whatwg-node/fetch'; import { Agent } from 'node:https'; import * as ws from 'ws'; -// eslint-disable-next-line import/no-extraneous-dependencies +// eslint-disable-next-line import-x/no-extraneous-dependencies import { pipe, subscribe } from 'wonka'; import { Endpoint } from './extensions'; diff --git a/packages/vscode-graphql-syntax/vitest.config.mts b/packages/vscode-graphql-syntax/vitest.config.mts index 067aa813a40..3444fdd8e6e 100644 --- a/packages/vscode-graphql-syntax/vitest.config.mts +++ b/packages/vscode-graphql-syntax/vitest.config.mts @@ -1,4 +1,4 @@ -// eslint-disable-next-line import/no-unresolved -- fix later +// eslint-disable-next-line import-x/no-unresolved -- fix later import { defineConfig } from 'vitest/config'; export default defineConfig({ diff --git a/resources/patches/@changesets+assemble-release-plan+5.2.2.patch b/resources/patches/@changesets+assemble-release-plan+5.2.2.patch deleted file mode 100644 index 00aeff808a3..00000000000 --- a/resources/patches/@changesets+assemble-release-plan+5.2.2.patch +++ /dev/null @@ -1,26 +0,0 @@ -diff --git a/node_modules/@changesets/assemble-release-plan/dist/assemble-release-plan.cjs.dev.js b/node_modules/@changesets/assemble-release-plan/dist/assemble-release-plan.cjs.dev.js -index 3a37c62..a352a93 100644 ---- a/node_modules/@changesets/assemble-release-plan/dist/assemble-release-plan.cjs.dev.js -+++ b/node_modules/@changesets/assemble-release-plan/dist/assemble-release-plan.cjs.dev.js -@@ -251,7 +251,7 @@ function shouldBumpMajor({ - // we check if it is a peerDependency because if it is, our dependent bump type might need to be major. - return depType === "peerDependencies" && nextRelease.type !== "none" && nextRelease.type !== "patch" && ( // 1. If onlyUpdatePeerDependentsWhenOutOfRange set to true, bump major if the version is leaving the range. - // 2. If onlyUpdatePeerDependentsWhenOutOfRange set to false, bump major regardless whether or not the version is leaving the range. -- !onlyUpdatePeerDependentsWhenOutOfRange || !semver__default['default'].satisfies(incrementVersion(nextRelease, preInfo), versionRange)) && ( // bump major only if the dependent doesn't already has a major release. -+ !onlyUpdatePeerDependentsWhenOutOfRange) && ( // bump major only if the dependent doesn't already has a major release. - !releases.has(dependent) || releases.has(dependent) && releases.get(dependent).type !== "major"); - } - -diff --git a/node_modules/@changesets/assemble-release-plan/dist/assemble-release-plan.cjs.prod.js b/node_modules/@changesets/assemble-release-plan/dist/assemble-release-plan.cjs.prod.js -index 87b4c10..80a6364 100644 ---- a/node_modules/@changesets/assemble-release-plan/dist/assemble-release-plan.cjs.prod.js -+++ b/node_modules/@changesets/assemble-release-plan/dist/assemble-release-plan.cjs.prod.js -@@ -130,7 +130,7 @@ function getDependencyVersionRanges(dependentPkgJSON, dependencyRelease) { - } - - function shouldBumpMajor({dependent: dependent, depType: depType, versionRange: versionRange, releases: releases, nextRelease: nextRelease, preInfo: preInfo, onlyUpdatePeerDependentsWhenOutOfRange: onlyUpdatePeerDependentsWhenOutOfRange}) { -- return "peerDependencies" === depType && "none" !== nextRelease.type && "patch" !== nextRelease.type && (!onlyUpdatePeerDependentsWhenOutOfRange || !semver__default.default.satisfies(incrementVersion(nextRelease, preInfo), versionRange)) && (!releases.has(dependent) || releases.has(dependent) && "major" !== releases.get(dependent).type); -+ return "peerDependencies" === depType && "none" !== nextRelease.type && "patch" !== nextRelease.type && !onlyUpdatePeerDependentsWhenOutOfRange && (!releases.has(dependent) || releases.has(dependent) && "major" !== releases.get(dependent).type); - } - - function flattenReleases(changesets, packagesByName, ignoredPackages) { diff --git a/resources/patches/@changesets+assemble-release-plan+6.0.3.patch b/resources/patches/@changesets+assemble-release-plan+6.0.3.patch new file mode 100644 index 00000000000..8c3e21030f4 --- /dev/null +++ b/resources/patches/@changesets+assemble-release-plan+6.0.3.patch @@ -0,0 +1,22 @@ +diff --git a/node_modules/@changesets/assemble-release-plan/dist/changesets-assemble-release-plan.cjs.js b/node_modules/@changesets/assemble-release-plan/dist/changesets-assemble-release-plan.cjs.js +index 60427457c887f2d72168fecec83d79088c68e3a4..07565f3336140470e8ea0d7c1a9b09586f8e946e 100644 +--- a/node_modules/@changesets/assemble-release-plan/dist/changesets-assemble-release-plan.cjs.js ++++ b/node_modules/@changesets/assemble-release-plan/dist/changesets-assemble-release-plan.cjs.js +@@ -299,7 +299,7 @@ function shouldBumpMajor({ + // we check if it is a peerDependency because if it is, our dependent bump type might need to be major. + return depType === "peerDependencies" && nextRelease.type !== "none" && nextRelease.type !== "patch" && ( // 1. If onlyUpdatePeerDependentsWhenOutOfRange set to true, bump major if the version is leaving the range. + // 2. If onlyUpdatePeerDependentsWhenOutOfRange set to false, bump major regardless whether or not the version is leaving the range. +- !onlyUpdatePeerDependentsWhenOutOfRange || !semverSatisfies__default["default"](incrementVersion(nextRelease, preInfo), versionRange)) && ( // bump major only if the dependent doesn't already has a major release. ++ !onlyUpdatePeerDependentsWhenOutOfRange) && ( // bump major only if the dependent doesn't already has a major release. + !releases.has(dependent) || releases.has(dependent) && releases.get(dependent).type !== "major"); + } + +@@ -396,7 +396,7 @@ function matchFixedConstraint(releases, packagesByName, config) { + + function getPreVersion(version) { + let parsed = semverParse__default["default"](version); +- let preVersion = parsed.prerelease[1] === undefined ? -1 : parsed.prerelease[1]; ++ let preVersion = parsed?.prerelease[1] === undefined ? -1 : parsed.prerelease[1]; + + if (typeof preVersion !== "number") { + throw new errors.InternalError("preVersion is not a number"); diff --git a/yarn.lock b/yarn.lock index 2b2d530db0b..51cd2fdb141 100644 --- a/yarn.lock +++ b/yarn.lock @@ -39,14 +39,6 @@ dependencies: node-fetch "^2.6.1" -"@arthurgeron/eslint-plugin-react-usememo@^2.4.0": - version "2.4.0" - resolved "https://registry.yarnpkg.com/@arthurgeron/eslint-plugin-react-usememo/-/eslint-plugin-react-usememo-2.4.0.tgz#1941efed123d129422818d00a74da65be93c9278" - integrity sha512-tjnLR1j+c+akj+hxMpruFFykmL3Kglz8XKFUQ4gx9u42jzOE6yDveCtirANdXtMTdqSXQmId/8yAcjp/6obQuQ== - dependencies: - minimatch "9.0.3" - uuid "9.0.1" - "@astrojs/compiler@^2.8.0": version "2.8.0" resolved "https://registry.yarnpkg.com/@astrojs/compiler/-/compiler-2.8.0.tgz#acbe2abbf640c238cbfe6c9d886a4d0c6921f172" @@ -1380,13 +1372,20 @@ resolved "https://registry.yarnpkg.com/@babel/regjsgen/-/regjsgen-0.8.0.tgz#f0ba69b075e1f05fb2825b7fad991e7adbb18310" integrity sha512-x/rqGMdzj+fWZvCOYForTghzbtqPDZ5gPwaoNGHdgDfF2QA/XZbCBp4Moo5scrkAMPhB7z26XM/AaHuIJdgauA== -"@babel/runtime@^7.10.4", "@babel/runtime@^7.11.2", "@babel/runtime@^7.12.5", "@babel/runtime@^7.13.10", "@babel/runtime@^7.5.5", "@babel/runtime@^7.8.4", "@babel/runtime@^7.9.2": +"@babel/runtime@^7.11.2", "@babel/runtime@^7.12.5", "@babel/runtime@^7.13.10", "@babel/runtime@^7.5.5", "@babel/runtime@^7.8.4", "@babel/runtime@^7.9.2": version "7.22.6" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.22.6.tgz#57d64b9ae3cff1d67eb067ae117dac087f5bd438" integrity sha512-wDb5pWm4WDdF6LFUde3Jl8WzPA+3ZbxYqkC6xAXuD3irdEHN1k0NfTRrJD8ZD378SJ61miMLCqIOXYhd8x+AJQ== dependencies: regenerator-runtime "^0.13.11" +"@babel/runtime@^7.20.1": + version "7.24.8" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.24.8.tgz#5d958c3827b13cc6d05e038c07fb2e5e3420d82e" + integrity sha512-5F7SDGs1T72ZczbRwbGO9lQi0NLjQxzl6i4lJxLxfW9U5UluCSyEJeniWvnhl3/euNiqQVbo8zruhsDfid0esA== + dependencies: + regenerator-runtime "^0.14.0" + "@babel/runtime@^7.21.0": version "7.24.7" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.24.7.tgz#f4f0d5530e8dbdf59b3451b9b3e594b6ba082e12" @@ -1451,16 +1450,17 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@changesets/apply-release-plan@^6.1.2": - version "6.1.2" - resolved "https://registry.yarnpkg.com/@changesets/apply-release-plan/-/apply-release-plan-6.1.2.tgz#cfb7da323f34e9e9173ffd9bf9f03c0b8cecc8fe" - integrity sha512-H8TV9E/WtJsDfoDVbrDGPXmkZFSv7W2KLqp4xX4MKZXshb0hsQZUNowUa8pnus9qb/5OZrFFRVsUsDCVHNW/AQ== - dependencies: - "@babel/runtime" "^7.10.4" - "@changesets/config" "^2.2.0" - "@changesets/get-version-range-type" "^0.3.2" - "@changesets/git" "^1.5.0" - "@changesets/types" "^5.2.0" +"@changesets/apply-release-plan@^7.0.4": + version "7.0.4" + resolved "https://registry.yarnpkg.com/@changesets/apply-release-plan/-/apply-release-plan-7.0.4.tgz#f963e11848efa24c53abd10713662f2012b6082b" + integrity sha512-HLFwhKWayKinWAul0Vj+76jVx1Pc2v55MGPVjZ924Y/ROeSsBMFutv9heHmCUj48lJyRfOTJG5+ar+29FUky/A== + dependencies: + "@babel/runtime" "^7.20.1" + "@changesets/config" "^3.0.2" + "@changesets/get-version-range-type" "^0.4.0" + "@changesets/git" "^3.0.0" + "@changesets/should-skip-package" "^0.1.0" + "@changesets/types" "^6.0.0" "@manypkg/get-packages" "^1.1.3" detect-indent "^6.0.0" fs-extra "^7.0.1" @@ -1468,201 +1468,211 @@ outdent "^0.5.0" prettier "^2.7.1" resolve-from "^5.0.0" - semver "^5.4.1" + semver "^7.5.3" -"@changesets/assemble-release-plan@^5.2.2": - version "5.2.2" - resolved "https://registry.yarnpkg.com/@changesets/assemble-release-plan/-/assemble-release-plan-5.2.2.tgz#9824f14a7a6e411c7153f1ccc2a42bbe35688129" - integrity sha512-B1qxErQd85AeZgZFZw2bDKyOfdXHhG+X5S+W3Da2yCem8l/pRy4G/S7iOpEcMwg6lH8q2ZhgbZZwZ817D+aLuQ== - dependencies: - "@babel/runtime" "^7.10.4" - "@changesets/errors" "^0.1.4" - "@changesets/get-dependents-graph" "^1.3.4" - "@changesets/types" "^5.2.0" +"@changesets/assemble-release-plan@6.0.3", "@changesets/assemble-release-plan@^6.0.3": + version "6.0.3" + resolved "https://registry.yarnpkg.com/@changesets/assemble-release-plan/-/assemble-release-plan-6.0.3.tgz#911ab27d0e4b8e732c7a03a09707b66b38ba48e5" + integrity sha512-bLNh9/Lgl1VwkjWZTq8JmRqH+hj7/Yzfz0jsQ/zJJ+FTmVqmqPj3szeKOri8O/hEM8JmHW019vh2gTO9iq5Cuw== + dependencies: + "@babel/runtime" "^7.20.1" + "@changesets/errors" "^0.2.0" + "@changesets/get-dependents-graph" "^2.1.1" + "@changesets/should-skip-package" "^0.1.0" + "@changesets/types" "^6.0.0" "@manypkg/get-packages" "^1.1.3" - semver "^5.4.1" + semver "^7.5.3" -"@changesets/changelog-git@^0.1.13": - version "0.1.13" - resolved "https://registry.yarnpkg.com/@changesets/changelog-git/-/changelog-git-0.1.13.tgz#182e130add456255d8ee2b4c8eaf88048944aaaf" - integrity sha512-zvJ50Q+EUALzeawAxax6nF2WIcSsC5PwbuLeWkckS8ulWnuPYx8Fn/Sjd3rF46OzeKA8t30loYYV6TIzp4DIdg== +"@changesets/changelog-git@^0.2.0": + version "0.2.0" + resolved "https://registry.yarnpkg.com/@changesets/changelog-git/-/changelog-git-0.2.0.tgz#1f3de11becafff5a38ebe295038a602403c93a86" + integrity sha512-bHOx97iFI4OClIT35Lok3sJAwM31VbUM++gnMBV16fdbtBhgYu4dxsphBF/0AZZsyAHMrnM0yFcj5gZM1py6uQ== dependencies: - "@changesets/types" "^5.2.0" + "@changesets/types" "^6.0.0" -"@changesets/changelog-github@0.4.7": - version "0.4.7" - resolved "https://registry.yarnpkg.com/@changesets/changelog-github/-/changelog-github-0.4.7.tgz#4da67472eaa0dc1ccff91fe8ecd9846ce818ec7b" - integrity sha512-UUG5sKwShs5ha1GFnayUpZNcDGWoY7F5XxhOEHS62sDPOtoHQZsG3j1nC5RxZ3M1URHA321cwVZHeXgu99Y3ew== +"@changesets/changelog-github@0.5.0": + version "0.5.0" + resolved "https://registry.yarnpkg.com/@changesets/changelog-github/-/changelog-github-0.5.0.tgz#ae96e5029209f7386527b3821d9c988b1ab16662" + integrity sha512-zoeq2LJJVcPJcIotHRJEEA2qCqX0AQIeFE+L21L8sRLPVqDhSXY8ZWAt2sohtBpFZkBwu+LUwMSKRr2lMy3LJA== dependencies: - "@changesets/get-github-info" "^0.5.1" - "@changesets/types" "^5.2.0" + "@changesets/get-github-info" "^0.6.0" + "@changesets/types" "^6.0.0" dotenv "^8.1.0" -"@changesets/cli@2.25.2": - version "2.25.2" - resolved "https://registry.yarnpkg.com/@changesets/cli/-/cli-2.25.2.tgz#fc5e894aa6f85c60749a035352dec3dcbd275c71" - integrity sha512-ACScBJXI3kRyMd2R8n8SzfttDHi4tmKSwVwXBazJOylQItSRSF4cGmej2E4FVf/eNfGy6THkL9GzAahU9ErZrA== - dependencies: - "@babel/runtime" "^7.10.4" - "@changesets/apply-release-plan" "^6.1.2" - "@changesets/assemble-release-plan" "^5.2.2" - "@changesets/changelog-git" "^0.1.13" - "@changesets/config" "^2.2.0" - "@changesets/errors" "^0.1.4" - "@changesets/get-dependents-graph" "^1.3.4" - "@changesets/get-release-plan" "^3.0.15" - "@changesets/git" "^1.5.0" - "@changesets/logger" "^0.0.5" - "@changesets/pre" "^1.0.13" - "@changesets/read" "^0.5.8" - "@changesets/types" "^5.2.0" - "@changesets/write" "^0.2.2" +"@changesets/cli@2.27.7": + version "2.27.7" + resolved "https://registry.yarnpkg.com/@changesets/cli/-/cli-2.27.7.tgz#275f546fa138799d7fea080a1bd90849b2407207" + integrity sha512-6lr8JltiiXPIjDeYg4iM2MeePP6VN/JkmqBsVA5XRiy01hGS3y629LtSDvKcycj/w/5Eur1rEwby/MjcYS+e2A== + dependencies: + "@babel/runtime" "^7.20.1" + "@changesets/apply-release-plan" "^7.0.4" + "@changesets/assemble-release-plan" "^6.0.3" + "@changesets/changelog-git" "^0.2.0" + "@changesets/config" "^3.0.2" + "@changesets/errors" "^0.2.0" + "@changesets/get-dependents-graph" "^2.1.1" + "@changesets/get-release-plan" "^4.0.3" + "@changesets/git" "^3.0.0" + "@changesets/logger" "^0.1.0" + "@changesets/pre" "^2.0.0" + "@changesets/read" "^0.6.0" + "@changesets/should-skip-package" "^0.1.0" + "@changesets/types" "^6.0.0" + "@changesets/write" "^0.3.1" "@manypkg/get-packages" "^1.1.3" - "@types/is-ci" "^3.0.0" - "@types/semver" "^6.0.0" + "@types/semver" "^7.5.0" ansi-colors "^4.1.3" chalk "^2.1.0" + ci-info "^3.7.0" enquirer "^2.3.0" external-editor "^3.1.0" fs-extra "^7.0.1" human-id "^1.0.2" - is-ci "^3.0.1" - meow "^6.0.0" + mri "^1.2.0" outdent "^0.5.0" p-limit "^2.2.0" preferred-pm "^3.0.0" resolve-from "^5.0.0" - semver "^5.4.1" + semver "^7.5.3" spawndamnit "^2.0.0" term-size "^2.1.0" - tty-table "^4.1.5" -"@changesets/config@^2.2.0": - version "2.2.0" - resolved "https://registry.yarnpkg.com/@changesets/config/-/config-2.2.0.tgz#382f6cd801fa56273942659114c8060378dfe066" - integrity sha512-GGaokp3nm5FEDk/Fv2PCRcQCOxGKKPRZ7prcMqxEr7VSsG75MnChQE8plaW1k6V8L2bJE+jZWiRm19LbnproOw== +"@changesets/config@^3.0.2": + version "3.0.2" + resolved "https://registry.yarnpkg.com/@changesets/config/-/config-3.0.2.tgz#45b16bf911937afbfa418b87ca4bcebeea1bec47" + integrity sha512-cdEhS4t8woKCX2M8AotcV2BOWnBp09sqICxKapgLHf9m5KdENpWjyrFNMjkLqGJtUys9U+w93OxWT0czorVDfw== dependencies: - "@changesets/errors" "^0.1.4" - "@changesets/get-dependents-graph" "^1.3.4" - "@changesets/logger" "^0.0.5" - "@changesets/types" "^5.2.0" + "@changesets/errors" "^0.2.0" + "@changesets/get-dependents-graph" "^2.1.1" + "@changesets/logger" "^0.1.0" + "@changesets/types" "^6.0.0" "@manypkg/get-packages" "^1.1.3" fs-extra "^7.0.1" micromatch "^4.0.2" -"@changesets/errors@^0.1.4": - version "0.1.4" - resolved "https://registry.yarnpkg.com/@changesets/errors/-/errors-0.1.4.tgz#f79851746c43679a66b383fdff4c012f480f480d" - integrity sha512-HAcqPF7snsUJ/QzkWoKfRfXushHTu+K5KZLJWPb34s4eCZShIf8BFO3fwq6KU8+G7L5KdtN2BzQAXOSXEyiY9Q== +"@changesets/errors@^0.2.0": + version "0.2.0" + resolved "https://registry.yarnpkg.com/@changesets/errors/-/errors-0.2.0.tgz#3c545e802b0f053389cadcf0ed54e5636ff9026a" + integrity sha512-6BLOQUscTpZeGljvyQXlWOItQyU71kCdGz7Pi8H8zdw6BI0g3m43iL4xKUVPWtG+qrrL9DTjpdn8eYuCQSRpow== dependencies: extendable-error "^0.1.5" -"@changesets/get-dependents-graph@^1.3.4": - version "1.3.4" - resolved "https://registry.yarnpkg.com/@changesets/get-dependents-graph/-/get-dependents-graph-1.3.4.tgz#d8bf537f45a7ff773da99143675f49e250996838" - integrity sha512-+C4AOrrFY146ydrgKOo5vTZfj7vetNu1tWshOID+UjPUU9afYGDXI8yLnAeib1ffeBXV3TuGVcyphKpJ3cKe+A== +"@changesets/get-dependents-graph@^2.1.1": + version "2.1.1" + resolved "https://registry.yarnpkg.com/@changesets/get-dependents-graph/-/get-dependents-graph-2.1.1.tgz#7d459c1fa453c21bc71e88d58d504fbb32b55750" + integrity sha512-LRFjjvigBSzfnPU2n/AhFsuWR5DK++1x47aq6qZ8dzYsPtS/I5mNhIGAS68IAxh1xjO9BTtz55FwefhANZ+FCA== dependencies: - "@changesets/types" "^5.2.0" + "@changesets/types" "^6.0.0" "@manypkg/get-packages" "^1.1.3" chalk "^2.1.0" fs-extra "^7.0.1" - semver "^5.4.1" + semver "^7.5.3" -"@changesets/get-github-info@^0.5.1": - version "0.5.1" - resolved "https://registry.yarnpkg.com/@changesets/get-github-info/-/get-github-info-0.5.1.tgz#5a20328b26f301b2193717abb32e73651e8811b7" - integrity sha512-w2yl3AuG+hFuEEmT6j1zDlg7GQLM/J2UxTmk0uJBMdRqHni4zXGe/vUlPfLom5KfX3cRfHc0hzGvloDPjWFNZw== +"@changesets/get-github-info@^0.6.0": + version "0.6.0" + resolved "https://registry.yarnpkg.com/@changesets/get-github-info/-/get-github-info-0.6.0.tgz#faba66a20a3a5a0cbabea28efd43c9ede7429f11" + integrity sha512-v/TSnFVXI8vzX9/w3DU2Ol+UlTZcu3m0kXTjTT4KlAdwSvwutcByYwyYn9hwerPWfPkT2JfpoX0KgvCEi8Q/SA== dependencies: dataloader "^1.4.0" node-fetch "^2.5.0" -"@changesets/get-release-plan@^3.0.15": - version "3.0.15" - resolved "https://registry.yarnpkg.com/@changesets/get-release-plan/-/get-release-plan-3.0.15.tgz#55577b235b785125a462d5d2a2dffe4dbf94e590" - integrity sha512-W1tFwxE178/en+zSj/Nqbc3mvz88mcdqUMJhRzN1jDYqN3QI4ifVaRF9mcWUU+KI0gyYEtYR65tour690PqTcA== - dependencies: - "@babel/runtime" "^7.10.4" - "@changesets/assemble-release-plan" "^5.2.2" - "@changesets/config" "^2.2.0" - "@changesets/pre" "^1.0.13" - "@changesets/read" "^0.5.8" - "@changesets/types" "^5.2.0" +"@changesets/get-release-plan@^4.0.3": + version "4.0.3" + resolved "https://registry.yarnpkg.com/@changesets/get-release-plan/-/get-release-plan-4.0.3.tgz#f2ebab1fe59ce9e89be3caf819ac16f24fcf4b8b" + integrity sha512-6PLgvOIwTSdJPTtpdcr3sLtGatT+Jr22+cQwEBJBy6wP0rjB4yJ9lv583J9fVpn1bfQlBkDa8JxbS2g/n9lIyA== + dependencies: + "@babel/runtime" "^7.20.1" + "@changesets/assemble-release-plan" "^6.0.3" + "@changesets/config" "^3.0.2" + "@changesets/pre" "^2.0.0" + "@changesets/read" "^0.6.0" + "@changesets/types" "^6.0.0" "@manypkg/get-packages" "^1.1.3" -"@changesets/get-version-range-type@^0.3.2": - version "0.3.2" - resolved "https://registry.yarnpkg.com/@changesets/get-version-range-type/-/get-version-range-type-0.3.2.tgz#8131a99035edd11aa7a44c341cbb05e668618c67" - integrity sha512-SVqwYs5pULYjYT4op21F2pVbcrca4qA/bAA3FmFXKMN7Y+HcO8sbZUTx3TAy2VXulP2FACd1aC7f2nTuqSPbqg== +"@changesets/get-version-range-type@^0.4.0": + version "0.4.0" + resolved "https://registry.yarnpkg.com/@changesets/get-version-range-type/-/get-version-range-type-0.4.0.tgz#429a90410eefef4368502c41c63413e291740bf5" + integrity sha512-hwawtob9DryoGTpixy1D3ZXbGgJu1Rhr+ySH2PvTLHvkZuQ7sRT4oQwMh0hbqZH1weAooedEjRsbrWcGLCeyVQ== -"@changesets/git@^1.5.0": - version "1.5.0" - resolved "https://registry.yarnpkg.com/@changesets/git/-/git-1.5.0.tgz#71bbcf11f3b346d56eeaf3d3201e6dc3e270ea5a" - integrity sha512-Xo8AT2G7rQJSwV87c8PwMm6BAc98BnufRMsML7m7Iw8Or18WFvFmxqG5aOL5PBvhgq9KrKvaeIBNIymracSuHg== +"@changesets/git@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@changesets/git/-/git-3.0.0.tgz#e71d003752a97bc27988db6d410e0038a4a88055" + integrity sha512-vvhnZDHe2eiBNRFHEgMiGd2CT+164dfYyrJDhwwxTVD/OW0FUD6G7+4DIx1dNwkwjHyzisxGAU96q0sVNBns0w== dependencies: - "@babel/runtime" "^7.10.4" - "@changesets/errors" "^0.1.4" - "@changesets/types" "^5.2.0" + "@babel/runtime" "^7.20.1" + "@changesets/errors" "^0.2.0" + "@changesets/types" "^6.0.0" "@manypkg/get-packages" "^1.1.3" is-subdir "^1.1.1" + micromatch "^4.0.2" spawndamnit "^2.0.0" -"@changesets/logger@^0.0.5": - version "0.0.5" - resolved "https://registry.yarnpkg.com/@changesets/logger/-/logger-0.0.5.tgz#68305dd5a643e336be16a2369cb17cdd8ed37d4c" - integrity sha512-gJyZHomu8nASHpaANzc6bkQMO9gU/ib20lqew1rVx753FOxffnCrJlGIeQVxNWCqM+o6OOleCo/ivL8UAO5iFw== +"@changesets/logger@^0.1.0": + version "0.1.0" + resolved "https://registry.yarnpkg.com/@changesets/logger/-/logger-0.1.0.tgz#2d2a58536c5beeeaef52ab464931d99fcf24f17b" + integrity sha512-pBrJm4CQm9VqFVwWnSqKEfsS2ESnwqwH+xR7jETxIErZcfd1u2zBSqrHbRHR7xjhSgep9x2PSKFKY//FAshA3g== dependencies: chalk "^2.1.0" -"@changesets/parse@^0.3.15": - version "0.3.15" - resolved "https://registry.yarnpkg.com/@changesets/parse/-/parse-0.3.15.tgz#1bc74f8c43b0861d71f4fccf78950411004ba308" - integrity sha512-3eDVqVuBtp63i+BxEWHPFj2P1s3syk0PTrk2d94W9JD30iG+OER0Y6n65TeLlY8T2yB9Fvj6Ev5Gg0+cKe/ZUA== +"@changesets/parse@^0.4.0": + version "0.4.0" + resolved "https://registry.yarnpkg.com/@changesets/parse/-/parse-0.4.0.tgz#5cabbd9844b3b213cb83f5edb5768454c70dd2b4" + integrity sha512-TS/9KG2CdGXS27S+QxbZXgr8uPsP4yNJYb4BC2/NeFUj80Rni3TeD2qwWmabymxmrLo7JEsytXH1FbpKTbvivw== dependencies: - "@changesets/types" "^5.2.0" + "@changesets/types" "^6.0.0" js-yaml "^3.13.1" -"@changesets/pre@^1.0.13": - version "1.0.13" - resolved "https://registry.yarnpkg.com/@changesets/pre/-/pre-1.0.13.tgz#49c3ae8bb444a1ce3e0fe4cb21f238318b6763e9" - integrity sha512-jrZc766+kGZHDukjKhpBXhBJjVQMied4Fu076y9guY1D3H622NOw8AQaLV3oQsDtKBTrT2AUFjt9Z2Y9Qx+GfA== +"@changesets/pre@^2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@changesets/pre/-/pre-2.0.0.tgz#ad3edf3d6ac287991d7ef5e26cf280d03c9e3764" + integrity sha512-HLTNYX/A4jZxc+Sq8D1AMBsv+1qD6rmmJtjsCJa/9MSRybdxh0mjbTvE6JYZQ/ZiQ0mMlDOlGPXTm9KLTU3jyw== dependencies: - "@babel/runtime" "^7.10.4" - "@changesets/errors" "^0.1.4" - "@changesets/types" "^5.2.0" + "@babel/runtime" "^7.20.1" + "@changesets/errors" "^0.2.0" + "@changesets/types" "^6.0.0" "@manypkg/get-packages" "^1.1.3" fs-extra "^7.0.1" -"@changesets/read@^0.5.8": - version "0.5.8" - resolved "https://registry.yarnpkg.com/@changesets/read/-/read-0.5.8.tgz#84e24fd12e6759cef090088261c08b1dfe0f350e" - integrity sha512-eYaNfxemgX7f7ELC58e7yqQICW5FB7V+bd1lKt7g57mxUrTveYME+JPaBPpYx02nP53XI6CQp6YxnR9NfmFPKw== - dependencies: - "@babel/runtime" "^7.10.4" - "@changesets/git" "^1.5.0" - "@changesets/logger" "^0.0.5" - "@changesets/parse" "^0.3.15" - "@changesets/types" "^5.2.0" +"@changesets/read@^0.6.0": + version "0.6.0" + resolved "https://registry.yarnpkg.com/@changesets/read/-/read-0.6.0.tgz#27e13b58d0b0eb3b0a5cba48a3f4f71f05ef4610" + integrity sha512-ZypqX8+/im1Fm98K4YcZtmLKgjs1kDQ5zHpc2U1qdtNBmZZfo/IBiG162RoP0CUF05tvp2y4IspH11PLnPxuuw== + dependencies: + "@babel/runtime" "^7.20.1" + "@changesets/git" "^3.0.0" + "@changesets/logger" "^0.1.0" + "@changesets/parse" "^0.4.0" + "@changesets/types" "^6.0.0" chalk "^2.1.0" fs-extra "^7.0.1" p-filter "^2.1.0" +"@changesets/should-skip-package@^0.1.0": + version "0.1.0" + resolved "https://registry.yarnpkg.com/@changesets/should-skip-package/-/should-skip-package-0.1.0.tgz#12bb8de00476718e9fbc8a4e783aeea1f632e927" + integrity sha512-FxG6Mhjw7yFStlSM7Z0Gmg3RiyQ98d/9VpQAZ3Fzr59dCOM9G6ZdYbjiSAt0XtFr9JR5U2tBaJWPjrkGGc618g== + dependencies: + "@babel/runtime" "^7.20.1" + "@changesets/types" "^6.0.0" + "@manypkg/get-packages" "^1.1.3" + "@changesets/types@^4.0.1": version "4.0.2" resolved "https://registry.yarnpkg.com/@changesets/types/-/types-4.0.2.tgz#d20e1e45bdc96a97cc509c655e708b53a9292465" integrity sha512-OeDaB7D+WVy/ErymPzFm58IeGvz4DOl+oedyZETfnkfMezF/Uhrm1Ub6MHrO5LcAaQTW+ptDmr0fmaVyoTxgHw== -"@changesets/types@^5.2.0": - version "5.2.0" - resolved "https://registry.yarnpkg.com/@changesets/types/-/types-5.2.0.tgz#c4927f5bf9668f778c12b4226cfd07a1f5b79c9b" - integrity sha512-km/66KOqJC+eicZXsm2oq8A8bVTSpkZJ60iPV/Nl5Z5c7p9kk8xxh6XGRTlnludHldxOOfudhnDN2qPxtHmXzA== +"@changesets/types@^6.0.0": + version "6.0.0" + resolved "https://registry.yarnpkg.com/@changesets/types/-/types-6.0.0.tgz#e46abda9890610dd1fbe1617730173d2267544bd" + integrity sha512-b1UkfNulgKoWfqyHtzKS5fOZYSJO+77adgL7DLRDr+/7jhChN+QcHnbjiQVOz/U+Ts3PGNySq7diAItzDgugfQ== -"@changesets/write@^0.2.2": - version "0.2.2" - resolved "https://registry.yarnpkg.com/@changesets/write/-/write-0.2.2.tgz#f3ffb1be06f7c31265eb4ec3d7166b91f9c25c9b" - integrity sha512-kCYNHyF3xaId1Q/QE+DF3UTrHTyg3Cj/f++T8S8/EkC+jh1uK2LFnM9h+EzV+fsmnZDrs7r0J4LLpeI/VWC5Hg== +"@changesets/write@^0.3.1": + version "0.3.1" + resolved "https://registry.yarnpkg.com/@changesets/write/-/write-0.3.1.tgz#438ef1dabc790cca35ce9fd36d26643b0f1786c9" + integrity sha512-SyGtMXzH3qFqlHKcvFY2eX+6b0NGiFcNav8AFsYwy5l8hejOeoeTDemu5Yjmke2V5jpzY+pBvM0vCCQ3gdZpfw== dependencies: - "@babel/runtime" "^7.10.4" - "@changesets/types" "^5.2.0" + "@babel/runtime" "^7.20.1" + "@changesets/types" "^6.0.0" fs-extra "^7.0.1" human-id "^1.0.2" prettier "^2.7.1" @@ -2449,27 +2459,21 @@ dependencies: eslint-visitor-keys "^3.3.0" -"@eslint-community/regexpp@^4.10.0", "@eslint-community/regexpp@^4.5.1", "@eslint-community/regexpp@^4.6.1", "@eslint-community/regexpp@^4.8.0": +"@eslint-community/regexpp@^4.10.0", "@eslint-community/regexpp@^4.11.0", "@eslint-community/regexpp@^4.5.1", "@eslint-community/regexpp@^4.8.0": version "4.11.0" resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.11.0.tgz#b0ffd0312b4a3fd2d6f77237e7248a5ad3a680ae" integrity sha512-G/M/tIiMrTAxEWRfLfQJMmGNX28IxBg4PBz8XqQhqUHLFI6TL2htpIB1iQCj144V5ee/JaKyT9/WZ0MGZWfA7A== -"@eslint/eslintrc@^2.1.4": - version "2.1.4" - resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-2.1.4.tgz#388a269f0f25c1b6adc317b5a2c55714894c70ad" - integrity sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ== +"@eslint/config-array@^0.17.0": + version "0.17.1" + resolved "https://registry.yarnpkg.com/@eslint/config-array/-/config-array-0.17.1.tgz#d9b8b8b6b946f47388f32bedfd3adf29ca8f8910" + integrity sha512-BlYOpej8AQ8Ev9xVqroV7a02JK3SkBAaN9GfMMH9W6Ch8FlQlkjGw4Ir7+FgYwfirivAf4t+GtzuAxqfukmISA== dependencies: - ajv "^6.12.4" - debug "^4.3.2" - espree "^9.6.0" - globals "^13.19.0" - ignore "^5.2.0" - import-fresh "^3.2.1" - js-yaml "^4.1.0" + "@eslint/object-schema" "^2.1.4" + debug "^4.3.1" minimatch "^3.1.2" - strip-json-comments "^3.1.1" -"@eslint/eslintrc@^3.0.2": +"@eslint/eslintrc@^3.1.0": version "3.1.0" resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-3.1.0.tgz#dbd3482bfd91efa663cbe7aa1f506839868207b6" integrity sha512-4Bfj15dVJdoy3RfZmmo86RK1Fwzn6SstsvK9JS+BaVKqC6QQQQyXekNaC+g+LKNgkQ+2VhGAzm6hO40AhMR3zQ== @@ -2484,10 +2488,15 @@ minimatch "^3.1.2" strip-json-comments "^3.1.1" -"@eslint/js@8.57.0": - version "8.57.0" - resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.57.0.tgz#a5417ae8427873f1dd08b70b3574b453e67b5f7f" - integrity sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g== +"@eslint/js@9.7.0": + version "9.7.0" + resolved "https://registry.yarnpkg.com/@eslint/js/-/js-9.7.0.tgz#b712d802582f02b11cfdf83a85040a296afec3f0" + integrity sha512-ChuWDQenef8OSFnvuxv0TCVxEwmu3+hPNKvM9B34qpM0rDRbjL8t5QkQeHHeAfsKQjuH9wS82WeCi1J/owatng== + +"@eslint/object-schema@^2.1.4": + version "2.1.4" + resolved "https://registry.yarnpkg.com/@eslint/object-schema/-/object-schema-2.1.4.tgz#9e69f8bb4031e11df79e03db09f9dbbae1740843" + integrity sha512-BsWiH1yFGjXXS2yvrf5LyuoSIIbPrGUWob917o+BTKuZ7qJdxX8aJLRxs1fS9n6r7vESrq1OUqb68dANcFXuQQ== "@floating-ui/core@^1.3.0": version "1.3.0" @@ -2724,24 +2733,15 @@ dependencies: client-only "^0.0.1" -"@humanwhocodes/config-array@^0.11.14": - version "0.11.14" - resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.11.14.tgz#d78e481a039f7566ecc9660b4ea7fe6b1fec442b" - integrity sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg== - dependencies: - "@humanwhocodes/object-schema" "^2.0.2" - debug "^4.3.1" - minimatch "^3.0.5" - "@humanwhocodes/module-importer@^1.0.1": version "1.0.1" resolved "https://registry.yarnpkg.com/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz#af5b2691a22b44be847b0ca81641c5fb6ad0172c" integrity sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA== -"@humanwhocodes/object-schema@^2.0.2": - version "2.0.3" - resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz#4a2868d75d6d6963e423bcf90b7fd1be343409d3" - integrity sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA== +"@humanwhocodes/retry@^0.3.0": + version "0.3.0" + resolved "https://registry.yarnpkg.com/@humanwhocodes/retry/-/retry-0.3.0.tgz#6d86b8cb322660f03d3f0aa94b99bdd8e172d570" + integrity sha512-d2CGZR2o7fS6sWB7DG/3a95bGKQyHMACZ5aW8qGkkqQpUoZV6C0X7Pc7l4ZNMZkfNBf4VWNe9E1jRsf0G146Ew== "@iarna/toml@^2.2.5": version "2.2.5" @@ -4227,13 +4227,6 @@ dependencies: "@types/node" "*" -"@types/is-ci@^3.0.0": - version "3.0.0" - resolved "https://registry.yarnpkg.com/@types/is-ci/-/is-ci-3.0.0.tgz#7e8910af6857601315592436f030aaa3ed9783c3" - integrity sha512-Q0Op0hdWbYd1iahB+IFNQcWXFq4O0Q5MwQP7uN0souuQ4rPg1vEYcnIOfr1gY+M+6rc8FGoRaBO1mOOvL29sEQ== - dependencies: - ci-info "^3.1.0" - "@types/is-empty@^1.0.0": version "1.2.1" resolved "https://registry.yarnpkg.com/@types/is-empty/-/is-empty-1.2.1.tgz#18d7256a73e43ec51f8b75c25fbdc31350be52a6" @@ -4474,11 +4467,6 @@ resolved "https://registry.yarnpkg.com/@types/scheduler/-/scheduler-0.16.2.tgz#1a62f89525723dde24ba1b01b092bf5df8ad4d39" integrity sha512-hppQEBDmlwhFAXKJX2KnWLYu5yMfi91yazPb2l+lbJiwW+wdo1gNeRA+3RgNSO39WYX2euey41KEwnqesU2Jew== -"@types/semver@^6.0.0": - version "6.2.2" - resolved "https://registry.yarnpkg.com/@types/semver/-/semver-6.2.2.tgz#5c27df09ca39e3c9beb4fae6b95f4d71426df0a9" - integrity sha512-RxAwYt4rGwK5GyoRwuP0jT6ZHAVTdz2EqgsHmX0PYNjGsko+OeT4WFXXTs/lM3teJUJodM+SNtAL5/pXIJ61IQ== - "@types/semver@^7.3.9", "@types/semver@^7.5.0": version "7.5.8" resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.5.8.tgz#8268a8c57a3e4abd25c165ecd36237db7948a55e" @@ -4639,7 +4627,22 @@ semver "^7.5.4" ts-api-utils "^1.0.1" -"@typescript-eslint/eslint-plugin@^7.14.1", "@typescript-eslint/eslint-plugin@^7.9.0": +"@typescript-eslint/eslint-plugin@^7.17.0": + version "7.17.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.17.0.tgz#c8ed1af1ad2928ede5cdd207f7e3090499e1f77b" + integrity sha512-pyiDhEuLM3PuANxH7uNYan1AaFs5XE0zw1hq69JBvGvE7gSuEoQl1ydtEe/XQeoC3GQxLXyOVa5kNOATgM638A== + dependencies: + "@eslint-community/regexpp" "^4.10.0" + "@typescript-eslint/scope-manager" "7.17.0" + "@typescript-eslint/type-utils" "7.17.0" + "@typescript-eslint/utils" "7.17.0" + "@typescript-eslint/visitor-keys" "7.17.0" + graphemer "^1.4.0" + ignore "^5.3.1" + natural-compare "^1.4.0" + ts-api-utils "^1.3.0" + +"@typescript-eslint/eslint-plugin@^7.9.0": version "7.14.1" resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.14.1.tgz#90e2f76a5930d553ede124e1f541a39b4417465e" integrity sha512-aAJd6bIf2vvQRjUG3ZkNXkmBpN+J7Wd0mfQiiVCJMu9Z5GcZZdcc0j8XwN/BM97Fl7e3SkTXODSk4VehUv7CGw== @@ -4654,7 +4657,18 @@ natural-compare "^1.4.0" ts-api-utils "^1.3.0" -"@typescript-eslint/parser@^7.14.1", "@typescript-eslint/parser@^7.9.0": +"@typescript-eslint/parser@^7.17.0": + version "7.17.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-7.17.0.tgz#be8e32c159190cd40a305a2121220eadea5a88e7" + integrity sha512-puiYfGeg5Ydop8eusb/Hy1k7QmOU6X3nvsqCgzrB2K4qMavK//21+PzNE8qeECgNOIoertJPUC1SpegHDI515A== + dependencies: + "@typescript-eslint/scope-manager" "7.17.0" + "@typescript-eslint/types" "7.17.0" + "@typescript-eslint/typescript-estree" "7.17.0" + "@typescript-eslint/visitor-keys" "7.17.0" + debug "^4.3.4" + +"@typescript-eslint/parser@^7.9.0": version "7.14.1" resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-7.14.1.tgz#13d97f357aed3c5719f259a6cc3d1a1f065d3692" integrity sha512-8lKUOebNLcR0D7RvlcloOacTOWzOqemWEWkKSVpMZVF/XVcwjPR+3MD08QzbW9TCGJ+DwIc6zUSGZ9vd8cO1IA== @@ -4681,6 +4695,14 @@ "@typescript-eslint/types" "7.14.1" "@typescript-eslint/visitor-keys" "7.14.1" +"@typescript-eslint/scope-manager@7.17.0": + version "7.17.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-7.17.0.tgz#e072d0f914662a7bfd6c058165e3c2b35ea26b9d" + integrity sha512-0P2jTTqyxWp9HiKLu/Vemr2Rg1Xb5B7uHItdVZ6iAenXmPo4SZ86yOPCJwMqpCyaMiEHTNqizHfsbmCFT1x9SA== + dependencies: + "@typescript-eslint/types" "7.17.0" + "@typescript-eslint/visitor-keys" "7.17.0" + "@typescript-eslint/type-utils@6.21.0": version "6.21.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-6.21.0.tgz#6473281cfed4dacabe8004e8521cee0bd9d4c01e" @@ -4701,6 +4723,16 @@ debug "^4.3.4" ts-api-utils "^1.3.0" +"@typescript-eslint/type-utils@7.17.0": + version "7.17.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-7.17.0.tgz#c5da78feb134c9c9978cbe89e2b1a589ed22091a" + integrity sha512-XD3aaBt+orgkM/7Cei0XNEm1vwUxQ958AOLALzPlbPqb8C1G8PZK85tND7Jpe69Wualri81PLU+Zc48GVKIMMA== + dependencies: + "@typescript-eslint/typescript-estree" "7.17.0" + "@typescript-eslint/utils" "7.17.0" + debug "^4.3.4" + ts-api-utils "^1.3.0" + "@typescript-eslint/types@6.21.0": version "6.21.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-6.21.0.tgz#205724c5123a8fef7ecd195075fa6e85bac3436d" @@ -4711,6 +4743,11 @@ resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-7.14.1.tgz#a43a540dbe5df7f2a11269683d777fc50b4350aa" integrity sha512-mL7zNEOQybo5R3AavY+Am7KLv8BorIv7HCYS5rKoNZKQD9tsfGUpO4KdAn3sSUvTiS4PQkr2+K0KJbxj8H9NDg== +"@typescript-eslint/types@7.17.0": + version "7.17.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-7.17.0.tgz#7ce8185bdf06bc3494e73d143dbf3293111b9cff" + integrity sha512-a29Ir0EbyKTKHnZWbNsrc/gqfIBqYPwj3F2M+jWE/9bqfEHg0AMtXzkbUkOG6QgEScxh2+Pz9OXe11jHDnHR7A== + "@typescript-eslint/typescript-estree@6.21.0": version "6.21.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-6.21.0.tgz#c47ae7901db3b8bddc3ecd73daff2d0895688c46" @@ -4739,6 +4776,20 @@ semver "^7.6.0" ts-api-utils "^1.3.0" +"@typescript-eslint/typescript-estree@7.17.0": + version "7.17.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-7.17.0.tgz#dcab3fea4c07482329dd6107d3c6480e228e4130" + integrity sha512-72I3TGq93t2GoSBWI093wmKo0n6/b7O4j9o8U+f65TVD0FS6bI2180X5eGEr8MA8PhKMvYe9myZJquUT2JkCZw== + dependencies: + "@typescript-eslint/types" "7.17.0" + "@typescript-eslint/visitor-keys" "7.17.0" + debug "^4.3.4" + globby "^11.1.0" + is-glob "^4.0.3" + minimatch "^9.0.4" + semver "^7.6.0" + ts-api-utils "^1.3.0" + "@typescript-eslint/utils@6.21.0": version "6.21.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-6.21.0.tgz#4714e7a6b39e773c1c8e97ec587f520840cd8134" @@ -4762,6 +4813,16 @@ "@typescript-eslint/types" "7.14.1" "@typescript-eslint/typescript-estree" "7.14.1" +"@typescript-eslint/utils@7.17.0", "@typescript-eslint/utils@^7.4.0": + version "7.17.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-7.17.0.tgz#815cd85b9001845d41b699b0ce4f92d6dfb84902" + integrity sha512-r+JFlm5NdB+JXc7aWWZ3fKSm1gn0pkswEwIYsrGPdsT2GjsRATAKXiNtp3vgAAO1xZhX8alIOEQnNMl3kbTgJw== + dependencies: + "@eslint-community/eslint-utils" "^4.4.0" + "@typescript-eslint/scope-manager" "7.17.0" + "@typescript-eslint/types" "7.17.0" + "@typescript-eslint/typescript-estree" "7.17.0" + "@typescript-eslint/visitor-keys@6.21.0": version "6.21.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-6.21.0.tgz#87a99d077aa507e20e238b11d56cc26ade45fe47" @@ -4778,16 +4839,19 @@ "@typescript-eslint/types" "7.14.1" eslint-visitor-keys "^3.4.3" +"@typescript-eslint/visitor-keys@7.17.0": + version "7.17.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-7.17.0.tgz#680465c734be30969e564b4647f38d6cdf49bfb0" + integrity sha512-RVGC9UhPOCsfCdI9pU++K4nD7to+jTcMIbXTSOcrLqUEW6gF2pU1UUbYJKc9cvcRSK1UDeMJ7pdMxf4bhMpV/A== + dependencies: + "@typescript-eslint/types" "7.17.0" + eslint-visitor-keys "^3.4.3" + "@ungap/promise-all-settled@1.1.2": version "1.1.2" resolved "https://registry.yarnpkg.com/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz#aa58042711d6e3275dd37dc597e5d31e8c290a44" integrity sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q== -"@ungap/structured-clone@^1.2.0": - version "1.2.0" - resolved "https://registry.yarnpkg.com/@ungap/structured-clone/-/structured-clone-1.2.0.tgz#756641adb587851b5ccb3e095daf27ae581c8406" - integrity sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ== - "@urql/core@2.6.1": version "2.6.1" resolved "https://registry.yarnpkg.com/@urql/core/-/core-2.6.1.tgz#c10ee972c5e81df6d7bf1e778ef1b5d30e2906e5" @@ -5633,7 +5697,7 @@ array.prototype.findlastindex@^1.2.3: es-object-atoms "^1.0.0" es-shim-unscopables "^1.0.2" -array.prototype.flat@^1.2.3, array.prototype.flat@^1.3.1, array.prototype.flat@^1.3.2: +array.prototype.flat@^1.3.1, array.prototype.flat@^1.3.2: version "1.3.2" resolved "https://registry.yarnpkg.com/array.prototype.flat/-/array.prototype.flat-1.3.2.tgz#1476217df8cff17d72ee8f3ba06738db5b387d18" integrity sha512-djYB+Zx2vLewY8RWlNCUdHjDXs2XOgm602S9E7P/UpHgfeHL00cRiIF+IN/G/aUJ7kGPb6yO/ErDI5V2s8iycA== @@ -6157,13 +6221,6 @@ braces@^3.0.1, braces@~3.0.2: dependencies: fill-range "^7.0.1" -breakword@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/breakword/-/breakword-1.0.5.tgz#fd420a417f55016736b5b615161cae1c8f819810" - integrity sha512-ex5W9DoOQ/LUEU3PMdLs9ua/CYZl1678NUkKOdUSi8Aw5F1idieaiRURCBFJCwVcrD1J8Iy3vfWSloaMwO2qFg== - dependencies: - wcwidth "^1.0.1" - browser-process-hrtime@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz#3c9b4b7d782c8121e56f10106d84c0d0ffc94626" @@ -6595,7 +6652,7 @@ ci-info@^2.0.0: resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-2.0.0.tgz#67a9e964be31a51e15e5010d58e6f12834002f46" integrity sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ== -ci-info@^3.1.0, ci-info@^3.2.0, ci-info@^3.7.0: +ci-info@^3.2.0, ci-info@^3.7.0: version "3.8.0" resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.8.0.tgz#81408265a5380c929f0bc665d62256628ce9ef91" integrity sha512-eXTggHWSooYhq49F2opQhuHWgzucfF2YgODK4e1566GQs5BIfP30B0oenwBJHfWxAs2fyPB1s7Mg949zLf61Yw== @@ -6703,15 +6760,6 @@ cliui@^5.0.0: strip-ansi "^5.2.0" wrap-ansi "^5.1.0" -cliui@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-6.0.0.tgz#511d702c0c4e41ca156d7d0e96021f23e13225b1" - integrity sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ== - dependencies: - string-width "^4.2.0" - strip-ansi "^6.0.0" - wrap-ansi "^6.2.0" - cliui@^7.0.2: version "7.0.4" resolved "https://registry.yarnpkg.com/cliui/-/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f" @@ -6751,7 +6799,7 @@ clone-stats@^0.0.1: resolved "https://registry.yarnpkg.com/clone-stats/-/clone-stats-0.0.1.tgz#b88f94a82cf38b8791d58046ea4029ad88ca99d1" integrity sha1-uI+UqCzzi4eR1YBG6kAprYjKmdE= -clone@^1.0.0, clone@^1.0.2: +clone@^1.0.0: version "1.0.4" resolved "https://registry.yarnpkg.com/clone/-/clone-1.0.4.tgz#da309cc263df15994c688ca902179ca3c7cd7c7e" integrity sha1-2jCcwmPfFZlMaIypAheco8fNfH4= @@ -7425,31 +7473,6 @@ csstype@^3.0.2: resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.0.10.tgz#2ad3a7bed70f35b965707c092e5f30b327c290e5" integrity sha512-2u44ZG2OcNUO9HDp/Jl8C07x6pU/eTR3ncV91SiK3dhG9TWvRVsCoJw14Ckx5DgWkzGA3waZWO3d7pgqpUI/XA== -csv-generate@^3.4.3: - version "3.4.3" - resolved "https://registry.yarnpkg.com/csv-generate/-/csv-generate-3.4.3.tgz#bc42d943b45aea52afa896874291da4b9108ffff" - integrity sha512-w/T+rqR0vwvHqWs/1ZyMDWtHHSJaN06klRqJXBEpDJaM/+dZkso0OKh1VcuuYvK3XM53KysVNq8Ko/epCK8wOw== - -csv-parse@^4.16.3: - version "4.16.3" - resolved "https://registry.yarnpkg.com/csv-parse/-/csv-parse-4.16.3.tgz#7ca624d517212ebc520a36873c3478fa66efbaf7" - integrity sha512-cO1I/zmz4w2dcKHVvpCr7JVRu8/FymG5OEpmvsZYlccYolPBLoVGKUHgNoc4ZGkFeFlWGEDmMyBM+TTqRdW/wg== - -csv-stringify@^5.6.5: - version "5.6.5" - resolved "https://registry.yarnpkg.com/csv-stringify/-/csv-stringify-5.6.5.tgz#c6d74badda4b49a79bf4e72f91cce1e33b94de00" - integrity sha512-PjiQ659aQ+fUTQqSrd1XEDnOr52jh30RBurfzkscaE2tPaFsDH5wOAHJiw8XAHphRknCwMUE9KRayc4K/NbO8A== - -csv@^5.5.0: - version "5.5.3" - resolved "https://registry.yarnpkg.com/csv/-/csv-5.5.3.tgz#cd26c1e45eae00ce6a9b7b27dcb94955ec95207d" - integrity sha512-QTaY0XjjhTQOdguARF0lGKm5/mEq9PD9/VhZZegHDIBq2tQwgNpHc3dneD4mGo2iJs+fTKv5Bp0fZ+BRuY3Z0g== - dependencies: - csv-generate "^3.4.3" - csv-parse "^4.16.3" - csv-stringify "^5.6.5" - stream-transform "^2.1.3" - cypress@^12.6.0: version "12.6.0" resolved "https://registry.yarnpkg.com/cypress/-/cypress-12.6.0.tgz#d71a82639756173c0682b3d467eb9f0523460e91" @@ -7718,13 +7741,6 @@ default-gateway@^6.0.3: dependencies: execa "^5.0.0" -defaults@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/defaults/-/defaults-1.0.3.tgz#c656051e9817d9ff08ed881477f3fe4019f3ef7d" - integrity sha1-xlYFHpgX2f8I7YgUd/P+QBnz730= - dependencies: - clone "^1.0.2" - defer-to-connect@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/defer-to-connect/-/defer-to-connect-2.0.1.tgz#8016bdb4143e4632b77a3449c6236277de520587" @@ -8393,10 +8409,10 @@ eslint-module-utils@^2.7.4, eslint-module-utils@^2.8.0, eslint-module-utils@^2.8 dependencies: debug "^3.2.7" -eslint-plugin-cypress@^3.3.0: - version "3.3.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-cypress/-/eslint-plugin-cypress-3.3.0.tgz#4ab963193d21ad22aca8379e1d15ba02619ae8db" - integrity sha512-HPHMPzYBIshzJM8wqgKSKHG2p/8R0Gbg4Pb3tcdC9WrmkuqxiKxSKbjunUrajhV5l7gCIFrh1P7C7GuBqH6YuQ== +eslint-plugin-cypress@^3.4.0: + version "3.4.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-cypress/-/eslint-plugin-cypress-3.4.0.tgz#6a7f508cda7579184265b50129b853e0c06c9944" + integrity sha512-Rrrr3Ri6wHqzrRr+TyUV7bDS4UnMMrFY1R1PP2F7XdGfe9txDC6lQEshyoNOWqGoPkbbeDm1x1XPc/adxemsnA== dependencies: globals "^13.20.0" @@ -8416,6 +8432,22 @@ eslint-plugin-eslint-comments@^3.2.0: escape-string-regexp "^1.0.5" ignore "^5.0.5" +eslint-plugin-import-x@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-import-x/-/eslint-plugin-import-x-3.1.0.tgz#e1d132bde47c431b37f3b294d9ff813098375e7d" + integrity sha512-/UbPA+bYY7nIxcjL3kpcDY3UNdoLHFhyBFzHox2M0ypcUoueTn6woZUUmzzi5et/dXChksasYYFeKE2wshOrhg== + dependencies: + "@typescript-eslint/utils" "^7.4.0" + debug "^4.3.4" + doctrine "^3.0.0" + eslint-import-resolver-node "^0.3.9" + get-tsconfig "^4.7.3" + is-glob "^4.0.3" + minimatch "^9.0.3" + semver "^7.6.0" + stable-hash "^0.0.4" + tslib "^2.6.2" + eslint-plugin-import@^2.29.1: version "2.29.1" resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.29.1.tgz#d45b37b5ef5901d639c15270d74d46d161150643" @@ -8514,17 +8546,27 @@ eslint-plugin-prettier@^5.1.3: prettier-linter-helpers "^1.0.0" synckit "^0.8.6" -eslint-plugin-promise@^6.1.1, eslint-plugin-promise@^6.4.0: +eslint-plugin-promise@^6.1.1: version "6.4.0" resolved "https://registry.yarnpkg.com/eslint-plugin-promise/-/eslint-plugin-promise-6.4.0.tgz#54926d53c79541efe9cea6ac1d823a58bbed1106" integrity sha512-/KWWRaD3fGkVCZsdR0RU53PSthFmoHVhZl+y9+6DqeDLSikLdlUVpVEAmI6iCRR5QyOjBYBqHZV/bdv4DJ4Gtw== +eslint-plugin-promise@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-promise/-/eslint-plugin-promise-7.0.0.tgz#2d54cf6e92213cb2915be62abf338b64c089431d" + integrity sha512-wb1ECT+b90ndBdAujhIdAU8oQ3Vt5gKqP/t78KOmg0ifynrvc2jGR9f6ndbOVNFpKf6jLUBlBBDF3H3Wk0JICg== + eslint-plugin-react-hooks@^4.6.2: version "4.6.2" resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-4.6.2.tgz#c829eb06c0e6f484b3fbb85a97e57784f328c596" integrity sha512-QzliNJq4GinDBcD8gPB5v0wh6g8q3SUi6EFF0x8N/BL9PoVs0atuGc47ozMRyOWAKdwaZ5OnbOEa3WR+dSGKuQ== -eslint-plugin-react@^7.33.2, eslint-plugin-react@^7.34.1, eslint-plugin-react@^7.34.3: +eslint-plugin-react-hooks@^5.1.0-rc-76002254-20240724: + version "5.1.0-rc-fb9a90fa48-20240614" + resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-5.1.0-rc-fb9a90fa48-20240614.tgz#206a7ec005f0b286aaf7091f4e566083d310b189" + integrity sha512-xsiRwaDNF5wWNC4ZHLut+x/YcAxksUd9Rizt7LaEn3bV8VyYRpXnRJQlLOfYaVy9esk4DFP4zPPnoNVjq5Gc0w== + +eslint-plugin-react@^7.33.2, eslint-plugin-react@^7.34.1: version "7.34.3" resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.34.3.tgz#9965f27bd1250a787b5d4cfcc765e5a5d58dcb7b" integrity sha512-aoW4MV891jkUulwDApQbPYTVZmeuSyFrudpbTAQuj5Fv8VL+o6df2xIGpw8B0hPjAaih1/Fb0om9grCdyFYemA== @@ -8548,6 +8590,30 @@ eslint-plugin-react@^7.33.2, eslint-plugin-react@^7.34.1, eslint-plugin-react@^7 semver "^6.3.1" string.prototype.matchall "^4.0.11" +eslint-plugin-react@^7.35.0: + version "7.35.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.35.0.tgz#00b1e4559896710e58af6358898f2ff917ea4c41" + integrity sha512-v501SSMOWv8gerHkk+IIQBkcGRGrO2nfybfj5pLxuJNFTPxxA3PSryhXTK+9pNbtkggheDdsC0E9Q8CuPk6JKA== + dependencies: + array-includes "^3.1.8" + array.prototype.findlast "^1.2.5" + array.prototype.flatmap "^1.3.2" + array.prototype.tosorted "^1.1.4" + doctrine "^2.1.0" + es-iterator-helpers "^1.0.19" + estraverse "^5.3.0" + hasown "^2.0.2" + jsx-ast-utils "^2.4.1 || ^3.0.0" + minimatch "^3.1.2" + object.entries "^1.1.8" + object.fromentries "^2.0.8" + object.values "^1.2.0" + prop-types "^15.8.1" + resolve "^2.0.0-next.5" + semver "^6.3.1" + string.prototype.matchall "^4.0.11" + string.prototype.repeat "^1.0.0" + eslint-plugin-sonar@^0.14.1: version "0.14.1" resolved "https://registry.yarnpkg.com/eslint-plugin-sonar/-/eslint-plugin-sonar-0.14.1.tgz#18e6286c5b4799aaa860344197ad10a70cf92cc9" @@ -8573,23 +8639,28 @@ eslint-plugin-sonarjs@^1.0.3: resolved "https://registry.yarnpkg.com/eslint-plugin-sonarjs/-/eslint-plugin-sonarjs-1.0.3.tgz#423de6f9244c886633ff36183c6fbc9fb1ed867d" integrity sha512-6s41HLPYPyDrp+5+7Db5yFYbod6h9pC7yx+xfcNwHRcLe1EZwbbQT/tdOAkR7ekVUkNGEvN3GmYakIoQUX7dEg== +eslint-plugin-sonarjs@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/eslint-plugin-sonarjs/-/eslint-plugin-sonarjs-1.0.4.tgz#9a3b0221911050e3c93f83535bd87ef915d5b5dc" + integrity sha512-jF0eGCUsq/HzMub4ExAyD8x1oEgjOyB9XVytYGyWgSFvdiJQJp6IuP7RmtauCf06o6N/kZErh+zW4b10y1WZ+Q== + eslint-plugin-sort-class-members@^1.20.0: version "1.20.0" resolved "https://registry.yarnpkg.com/eslint-plugin-sort-class-members/-/eslint-plugin-sort-class-members-1.20.0.tgz#88ea3d53b2ffb319dba1049c28e20797685a0b9e" integrity sha512-xNaik4GQ/pRwd1soIVI28HEXZbrWoLR5krau2+E8YcHj7N09UviPg5mYhf/rELG29bIFJdXDOFJazN90+luMOw== -eslint-plugin-unicorn@^54.0.0: - version "54.0.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-unicorn/-/eslint-plugin-unicorn-54.0.0.tgz#ce3ea853e8fd7ca2bda2fd6065bf065adb5d8b6d" - integrity sha512-XxYLRiYtAWiAjPv6z4JREby1TAE2byBC7wlh0V4vWDCpccOSU1KovWV//jqPXF6bq3WKxqX9rdjoRQ1EhdmNdQ== +eslint-plugin-unicorn@^55.0.0: + version "55.0.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-unicorn/-/eslint-plugin-unicorn-55.0.0.tgz#e2aeb397914799895702480970e7d148df5bcc7b" + integrity sha512-n3AKiVpY2/uDcGrS3+QsYDkjPfaOrNrsfQxU9nt5nitd9KuvVXrfAvgCO9DYPSfap+Gqjw9EOrXIsBp5tlHZjA== dependencies: "@babel/helper-validator-identifier" "^7.24.5" "@eslint-community/eslint-utils" "^4.4.0" - "@eslint/eslintrc" "^3.0.2" ci-info "^4.0.0" clean-regexp "^1.0.0" core-js-compat "^3.37.0" esquery "^1.5.0" + globals "^15.7.0" indent-string "^4.0.0" is-builtin-module "^3.2.1" jsesc "^3.0.2" @@ -8613,10 +8684,10 @@ eslint-scope@5.1.1: esrecurse "^4.3.0" estraverse "^4.1.1" -eslint-scope@^7.2.2: - version "7.2.2" - resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-7.2.2.tgz#deb4f92563390f32006894af62a22dba1c46423f" - integrity sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg== +eslint-scope@^8.0.2: + version "8.0.2" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-8.0.2.tgz#5cbb33d4384c9136083a71190d548158fe128f94" + integrity sha512-6E4xmrTw5wtxnLA5wYL3WDfhZ/1bUBGOXV0zQvVRDOtrR8D0p6W7fs3JweNYhwRYeGvd/1CKX2se0/2s7Q/nJA== dependencies: esrecurse "^4.3.0" estraverse "^5.2.0" @@ -8648,41 +8719,37 @@ eslint-visitor-keys@^4.0.0: resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-4.0.0.tgz#e3adc021aa038a2a8e0b2f8b0ce8f66b9483b1fb" integrity sha512-OtIRv/2GyiF6o/d8K7MYKKbXrOUBIK6SfkIRM4Z0dY3w+LiQ0vy3F57m0Z71bjbyeiWFiHJ8brqnmE6H6/jEuw== -eslint@^8.57.0: - version "8.57.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.57.0.tgz#c786a6fd0e0b68941aaf624596fb987089195668" - integrity sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ== +eslint@^9.7.0: + version "9.7.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-9.7.0.tgz#bedb48e1cdc2362a0caaa106a4c6ed943e8b09e4" + integrity sha512-FzJ9D/0nGiCGBf8UXO/IGLTgLVzIxze1zpfA8Ton2mjLovXdAPlYDv+MQDcqj3TmrhAGYfOpz9RfR+ent0AgAw== dependencies: "@eslint-community/eslint-utils" "^4.2.0" - "@eslint-community/regexpp" "^4.6.1" - "@eslint/eslintrc" "^2.1.4" - "@eslint/js" "8.57.0" - "@humanwhocodes/config-array" "^0.11.14" + "@eslint-community/regexpp" "^4.11.0" + "@eslint/config-array" "^0.17.0" + "@eslint/eslintrc" "^3.1.0" + "@eslint/js" "9.7.0" "@humanwhocodes/module-importer" "^1.0.1" + "@humanwhocodes/retry" "^0.3.0" "@nodelib/fs.walk" "^1.2.8" - "@ungap/structured-clone" "^1.2.0" ajv "^6.12.4" chalk "^4.0.0" cross-spawn "^7.0.2" debug "^4.3.2" - doctrine "^3.0.0" escape-string-regexp "^4.0.0" - eslint-scope "^7.2.2" - eslint-visitor-keys "^3.4.3" - espree "^9.6.1" - esquery "^1.4.2" + eslint-scope "^8.0.2" + eslint-visitor-keys "^4.0.0" + espree "^10.1.0" + esquery "^1.5.0" esutils "^2.0.2" fast-deep-equal "^3.1.3" - file-entry-cache "^6.0.1" + file-entry-cache "^8.0.0" find-up "^5.0.0" glob-parent "^6.0.2" - globals "^13.19.0" - graphemer "^1.4.0" ignore "^5.2.0" imurmurhash "^0.1.4" is-glob "^4.0.0" is-path-inside "^3.0.3" - js-yaml "^4.1.0" json-stable-stringify-without-jsonify "^1.0.1" levn "^0.4.1" lodash.merge "^4.6.2" @@ -8702,7 +8769,7 @@ esmoduleserve@^0.2.0: resolve "^1.15.1" serve-static "^1.14.1" -espree@^10.0.1: +espree@^10.0.1, espree@^10.1.0: version "10.1.0" resolved "https://registry.yarnpkg.com/espree/-/espree-10.1.0.tgz#8788dae611574c0f070691f522e4116c5a11fc56" integrity sha512-M1M6CpiE6ffoigIOWYO9UDP8TMUw9kqb21tf+08IgDYjCsOvCuDt4jQcZmoYxx+w7zlKw9/N0KXfto+I8/FrXA== @@ -8711,7 +8778,7 @@ espree@^10.0.1: acorn-jsx "^5.3.2" eslint-visitor-keys "^4.0.0" -espree@^9.6.0, espree@^9.6.1: +espree@^9.6.1: version "9.6.1" resolved "https://registry.yarnpkg.com/espree/-/espree-9.6.1.tgz#a2a17b8e434690a5432f2f8018ce71d331a48c6f" integrity sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ== @@ -8725,7 +8792,7 @@ esprima@^4.0.0, esprima@^4.0.1: resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== -esquery@^1.4.2, esquery@^1.5.0: +esquery@^1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.5.0.tgz#6ce17738de8577694edd7361c57182ac8cb0db0b" integrity sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg== @@ -9266,6 +9333,13 @@ file-entry-cache@^6.0.1: dependencies: flat-cache "^3.0.4" +file-entry-cache@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-8.0.0.tgz#7787bddcf1131bffb92636c69457bbc0edd6d81f" + integrity sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ== + dependencies: + flat-cache "^4.0.0" + file-loader@6.2.0: version "6.2.0" resolved "https://registry.yarnpkg.com/file-loader/-/file-loader-6.2.0.tgz#baef7cf8e1840df325e4390b4484879480eebe4d" @@ -9417,6 +9491,14 @@ flat-cache@^3.0.4: flatted "^3.1.0" rimraf "^3.0.2" +flat-cache@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-4.0.1.tgz#0ece39fcb14ee012f4b0410bd33dd9c1f011127c" + integrity sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw== + dependencies: + flatted "^3.2.9" + keyv "^4.5.4" + flat@^5.0.2: version "5.0.2" resolved "https://registry.yarnpkg.com/flat/-/flat-5.0.2.tgz#8ca6fe332069ffa9d324c327198c598259ceb241" @@ -9427,6 +9509,11 @@ flatted@^3.1.0: resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.4.tgz#28d9969ea90661b5134259f312ab6aa7929ac5e2" integrity sha512-8/sOawo8tJ4QOBX8YlQBMxL8+RLZfxMQOif9o0KUKTNTjMYElWPE0r/m5VNFxTRd0NSw8qSy8dajrwX4RYI1Hw== +flatted@^3.2.9: + version "3.3.1" + resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.3.1.tgz#21db470729a6734d4997002f439cb308987f567a" + integrity sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw== + follow-redirects@^1.0.0, follow-redirects@^1.14.0, follow-redirects@^1.14.6: version "1.15.5" resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.5.tgz#54d4d6d062c0fa7d9d17feb008461550e3ba8020" @@ -9793,6 +9880,13 @@ get-tsconfig@^4.5.0: dependencies: resolve-pkg-maps "^1.0.0" +get-tsconfig@^4.7.3: + version "4.7.6" + resolved "https://registry.yarnpkg.com/get-tsconfig/-/get-tsconfig-4.7.6.tgz#118fd5b7b9bae234cc7705a00cd771d7eb65d62a" + integrity sha512-ZAqrLlu18NbDdRaHq+AKXzAmqIUPswPWKUchfytdAjiRFnCe5ojG2bstg6mRiZabkKfCoL/e98pbBELIV/YCeA== + dependencies: + resolve-pkg-maps "^1.0.0" + getos@^3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/getos/-/getos-3.2.1.tgz#0134d1f4e00eb46144c5a9c0ac4dc087cbb27dc5" @@ -9927,7 +10021,7 @@ globals@^11.1.0: resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== -globals@^13.19.0, globals@^13.20.0: +globals@^13.20.0: version "13.24.0" resolved "https://registry.yarnpkg.com/globals/-/globals-13.24.0.tgz#8432a19d78ce0c1e833949c36adb345400bb1171" integrity sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ== @@ -9939,6 +10033,11 @@ globals@^14.0.0: resolved "https://registry.yarnpkg.com/globals/-/globals-14.0.0.tgz#898d7413c29babcf6bafe56fcadded858ada724e" integrity sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ== +globals@^15.7.0: + version "15.8.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-15.8.0.tgz#e64bb47b619dd8cbf32b3c1a0a61714e33cbbb41" + integrity sha512-VZAJ4cewHTExBWDHR6yptdIBlx9YSSZuwojj9Nt5mBRXQzrKakDsVKQ1J63sklLvzAJm0X5+RpO4i3Y2hcOnFw== + globalthis@^1.0.3: version "1.0.4" resolved "https://registry.yarnpkg.com/globalthis/-/globalthis-1.0.4.tgz#7430ed3a975d97bfb59bcce41f5cabbafa651236" @@ -9999,11 +10098,6 @@ graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.4, graceful-fs@^4.1.5, resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3" integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ== -grapheme-splitter@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz#9cf3a665c6247479896834af35cf1dbb4400767e" - integrity sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ== - graphemer@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/graphemer/-/graphemer-1.4.0.tgz#fb2f1d55e0e3a1849aeffc90c4fa0dd53a0e66c6" @@ -10705,7 +10799,7 @@ is-ci@^2.0.0: dependencies: ci-info "^2.0.0" -is-ci@^3.0.0, is-ci@^3.0.1: +is-ci@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-3.0.1.tgz#db6ecbed1bd659c43dac0f45661e7674103d1867" integrity sha512-ZYvCgrefwqoQ6yTyYUbQu64HsITZ3NfKX1lzaEYdkTDcfKzzCI/wthRRYKkdjHKFVgNiXKAKm65Zo1pk2as/QQ== @@ -12043,6 +12137,13 @@ keyv@^4.0.0: dependencies: json-buffer "3.0.1" +keyv@^4.5.4: + version "4.5.4" + resolved "https://registry.yarnpkg.com/keyv/-/keyv-4.5.4.tgz#a879a99e29452f942439f2a405e3af8b31d4de93" + integrity sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw== + dependencies: + json-buffer "3.0.1" + kind-of@^3.0.2: version "3.2.2" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" @@ -12072,7 +12173,7 @@ kleur@^3.0.3: resolved "https://registry.yarnpkg.com/kleur/-/kleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e" integrity sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w== -kleur@^4.0.3, kleur@^4.1.4: +kleur@^4.0.3: version "4.1.5" resolved "https://registry.yarnpkg.com/kleur/-/kleur-4.1.5.tgz#95106101795f7050c6c650f350c683febddb1780" integrity sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ== @@ -12772,23 +12873,6 @@ memfs@^3.4.1, memfs@^3.4.3: dependencies: fs-monkey "^1.0.3" -meow@^6.0.0: - version "6.1.1" - resolved "https://registry.yarnpkg.com/meow/-/meow-6.1.1.tgz#1ad64c4b76b2a24dfb2f635fddcadf320d251467" - integrity sha512-3YffViIt2QWgTy6Pale5QpopX/IvU3LPL03jOTqp6pGj3VjesdO/U8CuHMKpnQr4shCNCM5fd5XFFvIIl6JBHg== - dependencies: - "@types/minimist" "^1.2.0" - camelcase-keys "^6.2.2" - decamelize-keys "^1.1.0" - hard-rejection "^2.1.0" - minimist-options "^4.0.2" - normalize-package-data "^2.5.0" - read-pkg-up "^7.0.1" - redent "^3.0.0" - trim-newlines "^3.0.0" - type-fest "^0.13.1" - yargs-parser "^18.1.3" - meow@^9.0.0: version "9.0.0" resolved "https://registry.yarnpkg.com/meow/-/meow-9.0.0.tgz#cd9510bc5cac9dee7d03c73ee1f9ad959f4ea364" @@ -13259,7 +13343,7 @@ minimatch@9.0.3: dependencies: brace-expansion "^2.0.1" -minimatch@^3.0.0, minimatch@^3.0.2, minimatch@^3.0.3, minimatch@^3.0.4, minimatch@^3.0.5, minimatch@^3.1.1, minimatch@^3.1.2: +minimatch@^3.0.0, minimatch@^3.0.2, minimatch@^3.0.3, minimatch@^3.0.4, minimatch@^3.1.1, minimatch@^3.1.2: version "3.1.2" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== @@ -13287,7 +13371,7 @@ minimatch@^9.0.0, minimatch@^9.0.3, minimatch@^9.0.4: dependencies: brace-expansion "^2.0.1" -minimist-options@4.1.0, minimist-options@^4.0.2: +minimist-options@4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/minimist-options/-/minimist-options-4.1.0.tgz#c0655713c53a8a2ebd77ffa247d342c40f010619" integrity sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A== @@ -13306,11 +13390,6 @@ minimist@^1.1.1, minimist@^1.2.0, minimist@^1.2.3, minimist@^1.2.5, minimist@^1. resolved "https://registry.yarnpkg.com/minipass/-/minipass-7.1.2.tgz#93a9626ce5e5e66bd4db86849e7515e92340a707" integrity sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw== -mixme@^0.5.1: - version "0.5.4" - resolved "https://registry.yarnpkg.com/mixme/-/mixme-0.5.4.tgz#8cb3bd0cd32a513c161bf1ca99d143f0bcf2eff3" - integrity sha512-3KYa4m4Vlqx98GPdOHghxSdNtTvcP8E0kkaJ5Dlh+h2DRzF7zpuVVcA8B0QpKd11YJeP9QQ7ASkKzOeu195Wzw== - mkdirp-classic@^0.5.2, mkdirp-classic@^0.5.3: version "0.5.3" resolved "https://registry.yarnpkg.com/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz#fa10c9115cc6d8865be221ba47ee9bed78601113" @@ -13373,7 +13452,7 @@ monaco-editor@^0.39.0: resolved "https://registry.yarnpkg.com/monaco-editor/-/monaco-editor-0.39.0.tgz#3cf8e3718d6aac347d374516a6837d1c13d967d2" integrity sha512-zhbZ2Nx93tLR8aJmL2zI1mhJpsl87HMebNBM6R8z4pLfs8pj604pIVIVwyF1TivcfNtIPpMXL+nb3DsBmE/x6Q== -mri@^1.1.0: +mri@^1.1.0, mri@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/mri/-/mri-1.2.0.tgz#6721480fec2a11a4889861115a48b6cbe7cc8f0b" integrity sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA== @@ -15958,7 +16037,7 @@ semver-regex@^3.1.2: resolved "https://registry.yarnpkg.com/semver-regex/-/semver-regex-3.1.4.tgz#13053c0d4aa11d070a2f2872b6b1e3ae1e1971b4" integrity sha512-6IiqeZNgq01qGf0TId0t3NvKzSvUsjcpdEO3AQNeIjR6A2+ckTnQlDpl4qu1bjRv0RzN3FP9hzFmws3lKqRWkA== -"semver@2 || 3 || 4 || 5", semver@^5.1.0, semver@^5.4.1, semver@^5.5.0, semver@^5.6.0: +"semver@2 || 3 || 4 || 5", semver@^5.1.0, semver@^5.5.0, semver@^5.6.0: version "5.7.1" resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== @@ -16263,18 +16342,6 @@ slice-ansi@^4.0.0: astral-regex "^2.0.0" is-fullwidth-code-point "^3.0.0" -smartwrap@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/smartwrap/-/smartwrap-2.0.2.tgz#7e25d3dd58b51c6ca4aba3a9e391650ea62698a4" - integrity sha512-vCsKNQxb7PnCNd2wY1WClWifAc2lwqsG8OaswpJkVJsvMGcnEntdTCDajZCkk93Ay1U3t/9puJmb525Rg5MZBA== - dependencies: - array.prototype.flat "^1.2.3" - breakword "^1.0.5" - grapheme-splitter "^1.0.4" - strip-ansi "^6.0.0" - wcwidth "^1.0.1" - yargs "^15.1.0" - snake-case@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/snake-case/-/snake-case-3.0.4.tgz#4f2bbd568e9935abdfd593f34c691dadb49c452c" @@ -16456,6 +16523,11 @@ sshpk@^1.14.1: safer-buffer "^2.0.2" tweetnacl "~0.14.0" +stable-hash@^0.0.4: + version "0.0.4" + resolved "https://registry.yarnpkg.com/stable-hash/-/stable-hash-0.0.4.tgz#55ae7dadc13e4b3faed13601587cec41859b42f7" + integrity sha512-LjdcbuBeLcdETCrPn9i8AYAZ1eCtu4ECAWtP7UleOiZ9LzVxRzzUZEoZ8zB24nhkQnDWyET0I+3sWokSDS3E7g== + stable@^0.1.8: version "0.1.8" resolved "https://registry.yarnpkg.com/stable/-/stable-0.1.8.tgz#836eb3c8382fe2936feaf544631017ce7d47a3cf" @@ -16513,13 +16585,6 @@ stream-combiner@~0.0.4: dependencies: duplexer "~0.1.1" -stream-transform@^2.1.3: - version "2.1.3" - resolved "https://registry.yarnpkg.com/stream-transform/-/stream-transform-2.1.3.tgz#a1c3ecd72ddbf500aa8d342b0b9df38f5aa598e3" - integrity sha512-9GHUiM5hMiCi6Y03jD2ARC1ettBXkQBoQAe7nJsPknnI0ow10aXjTnew8QtYQmLjzn974BnmWEAJgCY6ZP1DeQ== - dependencies: - mixme "^0.5.1" - streamsearch@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/streamsearch/-/streamsearch-1.1.0.tgz#404dd1e2247ca94af554e841a8ef0eaa238da764" @@ -16631,6 +16696,14 @@ string.prototype.matchall@^4.0.11, string.prototype.matchall@^4.0.6: set-function-name "^2.0.2" side-channel "^1.0.6" +string.prototype.repeat@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/string.prototype.repeat/-/string.prototype.repeat-1.0.0.tgz#e90872ee0308b29435aa26275f6e1b762daee01a" + integrity sha512-0u/TldDbKD8bFCQ/4f5+mNRrXwZ8hg2w7ZR8wa16e8z9XpePWl3eGEcUD0OXpEH/VJH/2G3gjUtR3ZOiBe2S/w== + dependencies: + define-properties "^1.1.3" + es-abstract "^1.17.5" + string.prototype.trim@^1.2.9: version "1.2.9" resolved "https://registry.yarnpkg.com/string.prototype.trim/-/string.prototype.trim-1.2.9.tgz#b6fa326d72d2c78b6df02f7759c73f8f6274faa4" @@ -17287,19 +17360,6 @@ tslib@^2.0.0, tslib@^2.0.3, tslib@^2.1.0, tslib@^2.2.0, tslib@^2.3.1, tslib@^2.4 resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.2.tgz#703ac29425e7b37cd6fd456e92404d46d1f3e4ae" integrity sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q== -tty-table@^4.1.5: - version "4.1.6" - resolved "https://registry.yarnpkg.com/tty-table/-/tty-table-4.1.6.tgz#6bd58338f36c94cce478c3337934d8a65ab40a73" - integrity sha512-kRj5CBzOrakV4VRRY5kUWbNYvo/FpOsz65DzI5op9P+cHov3+IqPbo1JE1ZnQGkHdZgNFDsrEjrfqqy/Ply9fw== - dependencies: - chalk "^4.1.2" - csv "^5.5.0" - kleur "^4.1.4" - smartwrap "^2.0.2" - strip-ansi "^6.0.0" - wcwidth "^1.0.1" - yargs "^17.1.1" - tunnel-agent@^0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" @@ -17336,11 +17396,6 @@ type-detect@4.0.8: resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c" integrity sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g== -type-fest@^0.13.1: - version "0.13.1" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.13.1.tgz#0172cb5bce80b0bd542ea348db50c7e21834d934" - integrity sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg== - type-fest@^0.16.0: version "0.16.0" resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.16.0.tgz#3240b891a78b0deae910dbeb86553e552a148860" @@ -17801,11 +17856,6 @@ utils-merge@1.0.1: resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" integrity sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM= -uuid@9.0.1: - version "9.0.1" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-9.0.1.tgz#e188d4c8853cc722220392c424cd637f32293f30" - integrity sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA== - uuid@^8.3.0, uuid@^8.3.2: version "8.3.2" resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" @@ -18142,13 +18192,6 @@ wbuf@^1.1.0, wbuf@^1.7.3: dependencies: minimalistic-assert "^1.0.0" -wcwidth@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/wcwidth/-/wcwidth-1.0.1.tgz#f0b0dcf915bc5ff1528afadb2c0e17b532da2fe8" - integrity sha1-8LDc+RW8X/FSivrbLA4XtTLaL+g= - dependencies: - defaults "^1.0.3" - web-streams-polyfill@4.0.0-beta.1: version "4.0.0-beta.1" resolved "https://registry.yarnpkg.com/web-streams-polyfill/-/web-streams-polyfill-4.0.0-beta.1.tgz#3b19b9817374b7cee06d374ba7eeb3aeb80e8c95" @@ -18921,15 +18964,7 @@ yargs-parser@^13.1.2: camelcase "^5.0.0" decamelize "^1.2.0" -yargs-parser@^18.1.2, yargs-parser@^18.1.3: - version "18.1.3" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-18.1.3.tgz#be68c4975c6b2abf469236b0c870362fab09a7b0" - integrity sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ== - dependencies: - camelcase "^5.0.0" - decamelize "^1.2.0" - -yargs-parser@^21.0.0, yargs-parser@^21.1.1: +yargs-parser@^21.1.1: version "21.1.1" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-21.1.1.tgz#9096bceebf990d21bb31fa9516e0ede294a77d35" integrity sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw== @@ -18973,36 +19008,6 @@ yargs@^13.0.0: y18n "^4.0.0" yargs-parser "^13.1.2" -yargs@^15.1.0: - version "15.4.1" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-15.4.1.tgz#0d87a16de01aee9d8bec2bfbf74f67851730f4f8" - integrity sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A== - dependencies: - cliui "^6.0.0" - decamelize "^1.2.0" - find-up "^4.1.0" - get-caller-file "^2.0.1" - require-directory "^2.1.1" - require-main-filename "^2.0.0" - set-blocking "^2.0.0" - string-width "^4.2.0" - which-module "^2.0.0" - y18n "^4.0.0" - yargs-parser "^18.1.2" - -yargs@^17.1.1: - version "17.5.1" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.5.1.tgz#e109900cab6fcb7fd44b1d8249166feb0b36e58e" - integrity sha512-t6YAJcxDkNX7NFYiVtKvWUz8l+PaKTLiL63mJYWR2GnHq2gjEWISzsLp9wg3aY36dY1j+gfIEL3pIF+XlJJfbA== - dependencies: - cliui "^7.0.2" - escalade "^3.1.1" - get-caller-file "^2.0.5" - require-directory "^2.1.1" - string-width "^4.2.3" - y18n "^5.0.5" - yargs-parser "^21.0.0" - yargs@^17.7.2: version "17.7.2" resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.7.2.tgz#991df39aca675a192b816e1e0363f9d75d2aa269" From dd36fcdbd3bccb71eb9bfa6b5b1262106bd225de Mon Sep 17 00:00:00 2001 From: Dimitri POSTOLOV Date: Thu, 25 Jul 2024 12:50:04 +0200 Subject: [PATCH 50/81] fix unexpected changesets bump to major (#3659) --- .changeset/config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/config.json b/.changeset/config.json index 4a40bb63b8e..1deb8111ccb 100644 --- a/.changeset/config.json +++ b/.changeset/config.json @@ -8,6 +8,6 @@ "ignore": ["example-*"], "updateInternalDependencies": "patch", "___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH": { - "updateInternalDependents": "always" + "onlyUpdatePeerDependentsWhenOutOfRange": true } } From 1f2b084b28378c1d4293820dee04744ef4f386f2 Mon Sep 17 00:00:00 2001 From: Dimitri POSTOLOV Date: Thu, 25 Jul 2024 13:06:02 +0200 Subject: [PATCH 51/81] add ESLINT_USE_FLAT_CONFIG=false to lint-staged (#3660) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 1ebac5a5a36..ba8fb01db7c 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ }, "lint-staged": { "*.{js,ts,jsx,tsx}": [ - "eslint --cache --fix", + "ESLINT_USE_FLAT_CONFIG=false eslint --cache --fix", "prettier --write --ignore-path .eslintignore --ignore-path resources/prettierignore", "jest --passWithNoTests", "yarn lint-cspell" From 4cfd89fe5dbacaf378ffb44fc77ae79fbdd1703b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Jul 2024 22:30:45 +0200 Subject: [PATCH 52/81] Bump follow-redirects from 1.15.0 to 1.15.6 (#3560) Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.15.0 to 1.15.6. - [Release notes](https://github.com/follow-redirects/follow-redirects/releases) - [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.15.0...v1.15.6) --- updated-dependencies: - dependency-name: follow-redirects dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- yarn.lock | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/yarn.lock b/yarn.lock index 51cd2fdb141..f8e0f022b5e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1470,7 +1470,7 @@ resolve-from "^5.0.0" semver "^7.5.3" -"@changesets/assemble-release-plan@6.0.3", "@changesets/assemble-release-plan@^6.0.3": +"@changesets/assemble-release-plan@^6.0.3": version "6.0.3" resolved "https://registry.yarnpkg.com/@changesets/assemble-release-plan/-/assemble-release-plan-6.0.3.tgz#911ab27d0e4b8e732c7a03a09707b66b38ba48e5" integrity sha512-bLNh9/Lgl1VwkjWZTq8JmRqH+hj7/Yzfz0jsQ/zJJ+FTmVqmqPj3szeKOri8O/hEM8JmHW019vh2gTO9iq5Cuw== @@ -9514,12 +9514,7 @@ flatted@^3.2.9: resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.3.1.tgz#21db470729a6734d4997002f439cb308987f567a" integrity sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw== -follow-redirects@^1.0.0, follow-redirects@^1.14.0, follow-redirects@^1.14.6: - version "1.15.5" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.5.tgz#54d4d6d062c0fa7d9d17feb008461550e3ba8020" - integrity sha512-vSFWUON1B+yAw1VN4xMfxgn5fTUiaOzAJCKBwIIgT/+7CuGy9+r+5gITvP62j3RmaD5Ph65UaERdOSRGUzZtgw== - -follow-redirects@^1.13.2: +follow-redirects@^1.0.0, follow-redirects@^1.13.2, follow-redirects@^1.14.0, follow-redirects@^1.14.6: version "1.15.6" resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.6.tgz#7f815c0cda4249c74ff09e95ef97c23b5fd0399b" integrity sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA== From dcd678a01e3ce7806d89dfcafc85e714d2f550b7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Jul 2024 22:31:11 +0200 Subject: [PATCH 53/81] Bump express from 4.18.2 to 4.19.2 (#3572) Bumps [express](https://github.com/expressjs/express) from 4.18.2 to 4.19.2. - [Release notes](https://github.com/expressjs/express/releases) - [Changelog](https://github.com/expressjs/express/blob/master/History.md) - [Commits](https://github.com/expressjs/express/compare/4.18.2...4.19.2) --- updated-dependencies: - dependency-name: express dependency-type: direct:development ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- packages/graphiql/package.json | 2 +- yarn.lock | 145 +++++++++++++++++---------------- 2 files changed, 76 insertions(+), 71 deletions(-) diff --git a/packages/graphiql/package.json b/packages/graphiql/package.json index eae04d5b517..fc2d1522a57 100644 --- a/packages/graphiql/package.json +++ b/packages/graphiql/package.json @@ -71,7 +71,7 @@ "css-loader": "^6.7.3", "cssnano": "^5.1.15", "cypress": "^12.6.0", - "express": "^4.18.2", + "express": "^4.19.2", "fork-ts-checker-webpack-plugin": "7.3.0", "graphql": "^16.8.1", "graphql-http": "^1.19.0", diff --git a/yarn.lock b/yarn.lock index f8e0f022b5e..39b3f454031 100644 --- a/yarn.lock +++ b/yarn.lock @@ -259,16 +259,6 @@ "@jridgewell/trace-mapping" "^0.3.25" jsesc "^2.5.1" -"@babel/generator@^7.24.7": - version "7.24.7" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.24.7.tgz#1654d01de20ad66b4b4d99c135471bc654c55e6d" - integrity sha512-oipXieGC3i45Y1A41t4tAqpnEZWgB/lC6Ehh6+rOviR5XWpTtMmLN+fGjz9vOiNRt0p6RtO6DtD0pdU3vpqdSA== - dependencies: - "@babel/types" "^7.24.7" - "@jridgewell/gen-mapping" "^0.3.5" - "@jridgewell/trace-mapping" "^0.3.25" - jsesc "^2.5.1" - "@babel/generator@^7.24.9": version "7.24.10" resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.24.10.tgz#a4ab681ec2a78bbb9ba22a3941195e28a81d8e76" @@ -279,6 +269,16 @@ "@jridgewell/trace-mapping" "^0.3.25" jsesc "^2.5.1" +"@babel/generator@^7.25.0": + version "7.25.0" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.25.0.tgz#f858ddfa984350bc3d3b7f125073c9af6988f18e" + integrity sha512-3LEEcj3PVW8pW2R1SR1M89g/qrYk/m/mB/tLqn7dn4sbBUQyTqnlod+II2U4dqiGtUmkcnAmkMDralTFZttRiw== + dependencies: + "@babel/types" "^7.25.0" + "@jridgewell/gen-mapping" "^0.3.5" + "@jridgewell/trace-mapping" "^0.3.25" + jsesc "^2.5.1" + "@babel/helper-annotate-as-pure@^7.18.6", "@babel/helper-annotate-as-pure@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.22.5.tgz#e7f06737b197d580a01edf75d97e2c8be99d3882" @@ -370,14 +370,6 @@ "@babel/template" "^7.22.15" "@babel/types" "^7.23.0" -"@babel/helper-function-name@^7.24.7": - version "7.24.7" - resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.24.7.tgz#75f1e1725742f39ac6584ee0b16d94513da38dd2" - integrity sha512-FyoJTsj/PEUWu1/TYRiXTIHc8lbw+TDYkZuoE43opPS5TrI7MyONBE1oNvfguEXAD9yhQRrVBnXdXzSLQl9XnA== - dependencies: - "@babel/template" "^7.24.7" - "@babel/types" "^7.24.7" - "@babel/helper-hoist-variables@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz#c01a007dac05c085914e8fb652b339db50d823bb" @@ -385,13 +377,6 @@ dependencies: "@babel/types" "^7.22.5" -"@babel/helper-hoist-variables@^7.24.7": - version "7.24.7" - resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.24.7.tgz#b4ede1cde2fd89436397f30dc9376ee06b0f25ee" - integrity sha512-MJJwhkoGy5c4ehfoRyrJ/owKeMl19U54h27YYftT0o2teQ3FJ3nQUf/I3LlJsX4l3qlw7WRXUmiyajvHXoTubQ== - dependencies: - "@babel/types" "^7.24.7" - "@babel/helper-member-expression-to-functions@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.22.5.tgz#0a7c56117cad3372fbf8d2fb4bf8f8d64a1e76b2" @@ -584,6 +569,11 @@ resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.24.8.tgz#58a4dbbcad7eb1d48930524a3fd93d93e9084c6f" integrity sha512-WzfbgXOkGzZiXXCqk43kKwZjzwx4oulxZi3nq2TYL9mOjQv6kYwul9mz6ID36njuL7Xkp6nJEfok848Zj10j/w== +"@babel/parser@^7.25.0": + version "7.25.0" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.25.0.tgz#9fdc9237504d797b6e7b8f66e78ea7f570d256ad" + integrity sha512-CzdIU9jdP0dg7HdyB+bHvDJGagUv+qtzZt5rYCWwW6tITNqV9odjp6Qu41gkG0ca5UfdDUWrKkiAnHHdGRnOrA== + "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.22.5.tgz#87245a21cd69a73b0b81bcda98d443d6df08f05e" @@ -1411,19 +1401,25 @@ "@babel/parser" "^7.24.7" "@babel/types" "^7.24.7" +"@babel/template@^7.25.0": + version "7.25.0" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.25.0.tgz#e733dc3134b4fede528c15bc95e89cb98c52592a" + integrity sha512-aOOgh1/5XzKvg1jvVz7AVrx2piJ2XBi227DHmbY6y+bM9H2FlN+IfecYu4Xl0cNiiVejlsCri89LUsbj8vJD9Q== + dependencies: + "@babel/code-frame" "^7.24.7" + "@babel/parser" "^7.25.0" + "@babel/types" "^7.25.0" + "@babel/traverse@^7.16.8", "@babel/traverse@^7.23.2", "@babel/traverse@^7.23.7", "@babel/traverse@^7.24.7", "@babel/traverse@^7.24.8", "@babel/traverse@^7.7.2": - version "7.24.7" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.24.7.tgz#de2b900163fa741721ba382163fe46a936c40cf5" - integrity sha512-yb65Ed5S/QAcewNPh0nZczy9JdYXkkAbIsEo+P7BE7yO3txAY30Y/oPa3QkQ5It3xVG2kpKMg9MsdxZaO31uKA== + version "7.25.1" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.25.1.tgz#64dbc31effc5f3fa3cf10d19df0e6310214743f5" + integrity sha512-LrHHoWq08ZpmmFqBAzN+hUdWwy5zt7FGa/hVwMcOqW6OVtwqaoD5utfuGYU87JYxdZgLUvktAsn37j/sYR9siA== dependencies: "@babel/code-frame" "^7.24.7" - "@babel/generator" "^7.24.7" - "@babel/helper-environment-visitor" "^7.24.7" - "@babel/helper-function-name" "^7.24.7" - "@babel/helper-hoist-variables" "^7.24.7" - "@babel/helper-split-export-declaration" "^7.24.7" - "@babel/parser" "^7.24.7" - "@babel/types" "^7.24.7" + "@babel/generator" "^7.25.0" + "@babel/parser" "^7.25.0" + "@babel/template" "^7.25.0" + "@babel/types" "^7.25.0" debug "^4.3.1" globals "^11.1.0" @@ -1445,6 +1441,15 @@ "@babel/helper-validator-identifier" "^7.24.7" to-fast-properties "^2.0.0" +"@babel/types@^7.25.0": + version "7.25.0" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.25.0.tgz#e6e3656c581f28da8452ed4f69e38008ec0ba41b" + integrity sha512-LcnxQSsd9aXOIgmmSpvZ/1yo46ra2ESYyqLcryaBZOghxy5qqOBjvCWP5JfkI8yl9rlxRgdLTTMCQQRcN2hdCg== + dependencies: + "@babel/helper-string-parser" "^7.24.8" + "@babel/helper-validator-identifier" "^7.24.7" + to-fast-properties "^2.0.0" + "@bcoe/v8-coverage@^0.2.3": version "0.2.3" resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" @@ -6144,13 +6149,13 @@ bluebird@3.7.2, bluebird@^3.4.1, bluebird@^3.5.1, bluebird@^3.5.5, bluebird@^3.7 resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.7.2.tgz#9f229c15be272454ffa973ace0dbee79a1b0c36f" integrity sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg== -body-parser@1.20.1: - version "1.20.1" - resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.20.1.tgz#b1812a8912c195cd371a3ee5e66faa2338a5c668" - integrity sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw== +body-parser@1.20.2: + version "1.20.2" + resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.20.2.tgz#6feb0e21c4724d06de7ff38da36dad4f57a747fd" + integrity sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA== dependencies: bytes "3.1.2" - content-type "~1.0.4" + content-type "~1.0.5" debug "2.6.9" depd "2.0.0" destroy "1.2.0" @@ -6158,7 +6163,7 @@ body-parser@1.20.1: iconv-lite "0.4.24" on-finished "2.4.1" qs "6.11.0" - raw-body "2.5.1" + raw-body "2.5.2" type-is "~1.6.18" unpipe "1.0.0" @@ -7059,10 +7064,10 @@ content-disposition@0.5.4: dependencies: safe-buffer "5.2.1" -content-type@~1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.4.tgz#e138cc75e040c727b1966fe5e5f8c9aee256fe3b" - integrity sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA== +content-type@~1.0.4, content-type@~1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.5.tgz#8b773162656d1d1086784c8f23a54ce6d73d7918" + integrity sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA== convert-source-map@^1.1.0, convert-source-map@^1.4.0, convert-source-map@^1.6.0: version "1.9.0" @@ -7079,10 +7084,10 @@ cookie-signature@1.0.6: resolved "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c" integrity sha1-4wOogrNCzD7oylE6eZmXNNqzriw= -cookie@0.5.0: - version "0.5.0" - resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.5.0.tgz#d1f5d71adec6558c58f389987c366aa47e994f8b" - integrity sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw== +cookie@0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.6.0.tgz#2798b04b071b0ecbff0dbb62a505a8efa4e19051" + integrity sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw== copy-to-clipboard@^3.0.8, copy-to-clipboard@^3.2.0: version "3.3.2" @@ -7618,10 +7623,10 @@ debug@2.6.9: dependencies: ms "2.0.0" -debug@4, debug@4.3.4, debug@^4.0.0, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2, debug@^4.3.3, debug@^4.3.4: - version "4.3.4" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" - integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== +debug@4, debug@^4.0.0, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2, debug@^4.3.3, debug@^4.3.4, debug@^4.3.5: + version "4.3.5" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.5.tgz#e83444eceb9fedd4a1da56d671ae2446a01a6e1e" + integrity sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg== dependencies: ms "2.1.2" @@ -7632,6 +7637,13 @@ debug@4.3.1: dependencies: ms "2.1.2" +debug@4.3.4: + version "4.3.4" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" + integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== + dependencies: + ms "2.1.2" + debug@^3.1.0, debug@^3.2.7: version "3.2.7" resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.7.tgz#72580b7e9145fb39b6676f9c5e5fb100b934179a" @@ -7639,13 +7651,6 @@ debug@^3.1.0, debug@^3.2.7: dependencies: ms "^2.1.1" -debug@^4.3.5: - version "4.3.5" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.5.tgz#e83444eceb9fedd4a1da56d671ae2446a01a6e1e" - integrity sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg== - dependencies: - ms "2.1.2" - decamelize-keys@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/decamelize-keys/-/decamelize-keys-1.1.0.tgz#d171a87933252807eb3cb61dc1c1445d078df2d9" @@ -9080,17 +9085,17 @@ expect@^29.0.0: jest-message-util "^29.5.0" jest-util "^29.5.0" -express@^4.16.3, express@^4.17.3, express@^4.18.2: - version "4.18.2" - resolved "https://registry.yarnpkg.com/express/-/express-4.18.2.tgz#3fabe08296e930c796c19e3c516979386ba9fd59" - integrity sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ== +express@^4.16.3, express@^4.17.3, express@^4.19.2: + version "4.19.2" + resolved "https://registry.yarnpkg.com/express/-/express-4.19.2.tgz#e25437827a3aa7f2a827bc8171bbbb664a356465" + integrity sha512-5T6nhjsT+EOMzuck8JjBHARTHfMht0POzlA60WV2pMD3gyXw2LZnZ+ueGdNxG+0calOJcWKbpFcuzLZ91YWq9Q== dependencies: accepts "~1.3.8" array-flatten "1.1.1" - body-parser "1.20.1" + body-parser "1.20.2" content-disposition "0.5.4" content-type "~1.0.4" - cookie "0.5.0" + cookie "0.6.0" cookie-signature "1.0.6" debug "2.6.9" depd "2.0.0" @@ -15198,10 +15203,10 @@ range-parser@^1.2.1, range-parser@~1.2.1: resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.1.tgz#3cf37023d199e1c24d1a55b84800c2f3e6468031" integrity sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg== -raw-body@2.5.1: - version "2.5.1" - resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.5.1.tgz#fe1b1628b181b700215e5fd42389f98b71392857" - integrity sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig== +raw-body@2.5.2: + version "2.5.2" + resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.5.2.tgz#99febd83b90e08975087e8f1f9419a149366b68a" + integrity sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA== dependencies: bytes "3.1.2" http-errors "2.0.0" From 9b1c30be0a31b006db778afdfaea822a40c729ac Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Jul 2024 22:31:46 +0200 Subject: [PATCH 54/81] Bump postcss from 8.4.21 to 8.4.31 in /packages/graphiql (#3482) Bumps [postcss](https://github.com/postcss/postcss) from 8.4.21 to 8.4.31. - [Release notes](https://github.com/postcss/postcss/releases) - [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md) - [Commits](https://github.com/postcss/postcss/compare/8.4.21...8.4.31) --- updated-dependencies: - dependency-name: postcss dependency-type: direct:development ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- packages/graphiql/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/graphiql/package.json b/packages/graphiql/package.json index fc2d1522a57..d6fb4a81660 100644 --- a/packages/graphiql/package.json +++ b/packages/graphiql/package.json @@ -79,7 +79,7 @@ "html-webpack-plugin": "^5.5.0", "identity-obj-proxy": "^3.0.0", "mini-css-extract-plugin": "^2.7.2", - "postcss": "8.4.21", + "postcss": "8.4.31", "postcss-import": "15.1.0", "postcss-loader": "7.0.2", "postcss-preset-env": "^8.0.1", From 475dd52fa6d3f8ff72ec0c0f87a6ceffebbcb931 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Jul 2024 22:32:24 +0200 Subject: [PATCH 55/81] Bump undici from 5.20.0 to 5.28.4 (#3576) Bumps [undici](https://github.com/nodejs/undici) from 5.20.0 to 5.28.4. - [Release notes](https://github.com/nodejs/undici/releases) - [Commits](https://github.com/nodejs/undici/compare/v5.20.0...v5.28.4) --- updated-dependencies: - dependency-name: undici dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- yarn.lock | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/yarn.lock b/yarn.lock index 39b3f454031..41947936c02 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2503,6 +2503,11 @@ resolved "https://registry.yarnpkg.com/@eslint/object-schema/-/object-schema-2.1.4.tgz#9e69f8bb4031e11df79e03db09f9dbbae1740843" integrity sha512-BsWiH1yFGjXXS2yvrf5LyuoSIIbPrGUWob917o+BTKuZ7qJdxX8aJLRxs1fS9n6r7vESrq1OUqb68dANcFXuQQ== +"@fastify/busboy@^2.0.0": + version "2.1.1" + resolved "https://registry.yarnpkg.com/@fastify/busboy/-/busboy-2.1.1.tgz#b9da6a878a371829a0502c9b6c1c143ef6663f4d" + integrity sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA== + "@floating-ui/core@^1.3.0": version "1.3.0" resolved "https://registry.yarnpkg.com/@floating-ui/core/-/core-1.3.0.tgz#113bc85fa102cf890ae801668f43ee265c547a09" @@ -17585,11 +17590,11 @@ undici-types@~5.26.4: integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== undici@^5.8.0: - version "5.20.0" - resolved "https://registry.yarnpkg.com/undici/-/undici-5.20.0.tgz#6327462f5ce1d3646bcdac99da7317f455bcc263" - integrity sha512-J3j60dYzuo6Eevbawwp1sdg16k5Tf768bxYK4TUJRH7cBM4kFCbf3mOnM/0E3vQYXvpxITbbWmBafaDbxLDz3g== + version "5.28.4" + resolved "https://registry.yarnpkg.com/undici/-/undici-5.28.4.tgz#6b280408edb6a1a604a9b20340f45b422e373068" + integrity sha512-72RFADWFqKmUb2hmmvNODKL3p9hcB6Gt2DOQMis1SEBaV6a4MH8soBvzg+95CYhCKPFedut2JY9bMfrDl9D23g== dependencies: - busboy "^1.6.0" + "@fastify/busboy" "^2.0.0" unicode-canonical-property-names-ecmascript@^2.0.0: version "2.0.0" From d87babafce7209bfe02dcccd866a1da23c3aabee Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Jul 2024 22:32:49 +0200 Subject: [PATCH 56/81] Bump @adobe/css-tools from 4.0.1 to 4.4.0 (#3664) Bumps [@adobe/css-tools](https://github.com/adobe/css-tools) from 4.0.1 to 4.4.0. - [Changelog](https://github.com/adobe/css-tools/blob/main/History.md) - [Commits](https://github.com/adobe/css-tools/commits) --- updated-dependencies: - dependency-name: "@adobe/css-tools" dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 41947936c02..f8d7288be64 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3,9 +3,9 @@ "@adobe/css-tools@^4.0.1": - version "4.0.1" - resolved "https://registry.yarnpkg.com/@adobe/css-tools/-/css-tools-4.0.1.tgz#b38b444ad3aa5fedbb15f2f746dcd934226a12dd" - integrity sha512-+u76oB43nOHrF4DDWRLWDCtci7f3QJoEBigemIdIeTi1ODqjx6Tad9NCVnPRwewWlKkVab5PlK8DCtPTyX7S8g== + version "4.4.0" + resolved "https://registry.yarnpkg.com/@adobe/css-tools/-/css-tools-4.4.0.tgz#728c484f4e10df03d5a3acd0d8adcbbebff8ad63" + integrity sha512-Ff9+ksdQQB3rMncgqDK78uLznstjyfIf2Arnh22pW8kBpLs6rpKDwgnZT46hin5Hl1WzazzK64DOrhSwYpS7bQ== "@ampproject/remapping@^2.2.0", "@ampproject/remapping@^2.2.1": version "2.2.1" From 440b13d972cea8b31a2338ac9da092ea1935d029 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Jul 2024 22:33:04 +0200 Subject: [PATCH 57/81] Bump webpack-dev-middleware from 5.3.3 to 5.3.4 (#3566) Bumps [webpack-dev-middleware](https://github.com/webpack/webpack-dev-middleware) from 5.3.3 to 5.3.4. - [Release notes](https://github.com/webpack/webpack-dev-middleware/releases) - [Changelog](https://github.com/webpack/webpack-dev-middleware/blob/v5.3.4/CHANGELOG.md) - [Commits](https://github.com/webpack/webpack-dev-middleware/compare/v5.3.3...v5.3.4) --- updated-dependencies: - dependency-name: webpack-dev-middleware dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index f8d7288be64..e6000fb9263 100644 --- a/yarn.lock +++ b/yarn.lock @@ -18277,9 +18277,9 @@ webpack-cli@^5.0.1: webpack-merge "^5.7.3" webpack-dev-middleware@^5.3.1: - version "5.3.3" - resolved "https://registry.yarnpkg.com/webpack-dev-middleware/-/webpack-dev-middleware-5.3.3.tgz#efae67c2793908e7311f1d9b06f2a08dcc97e51f" - integrity sha512-hj5CYrY0bZLB+eTO+x/j67Pkrquiy7kWepMHmUMoPsmcUaeEnQJqFzHJOyxgWlq746/wUuA64p9ta34Kyb01pA== + version "5.3.4" + resolved "https://registry.yarnpkg.com/webpack-dev-middleware/-/webpack-dev-middleware-5.3.4.tgz#eb7b39281cbce10e104eb2b8bf2b63fce49a3517" + integrity sha512-BVdTqhhs+0IfoeAf7EoH5WE+exCmqGerHfDM0IL096Px60Tq2Mn9MAbnaGUe6HiMa41KMCYF19gyzZmBcq/o4Q== dependencies: colorette "^2.0.10" memfs "^3.4.3" From 60746a7e3d469833de0295650cdc03db511a6464 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Jul 2024 22:44:46 +0200 Subject: [PATCH 58/81] Bump ws from 8.8.1 to 8.17.1 (#3666) Bumps [ws](https://github.com/websockets/ws) from 8.8.1 to 8.17.1. - [Release notes](https://github.com/websockets/ws/releases) - [Commits](https://github.com/websockets/ws/compare/8.8.1...8.17.1) --- updated-dependencies: - dependency-name: ws dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- packages/graphiql/package.json | 2 +- packages/vscode-graphql-execution/package.json | 2 +- yarn.lock | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/graphiql/package.json b/packages/graphiql/package.json index d6fb4a81660..85f9c0724e1 100644 --- a/packages/graphiql/package.json +++ b/packages/graphiql/package.json @@ -99,6 +99,6 @@ "webpack-bundle-analyzer": "^3.6.1", "webpack-cli": "^5.0.1", "webpack-dev-server": "^4.11.1", - "ws": "8.8.1" + "ws": "8.17.1" } } diff --git a/packages/vscode-graphql-execution/package.json b/packages/vscode-graphql-execution/package.json index 038d7f770f1..655e6dcd5f1 100644 --- a/packages/vscode-graphql-execution/package.json +++ b/packages/vscode-graphql-execution/package.json @@ -115,7 +115,7 @@ "graphql-ws": "5.10.0", "svelte": "^4.1.1", "svelte2tsx": "^0.6.16", - "ws": "8.8.1", + "ws": "8.17.1", "nullthrows": "1.1.1" } } diff --git a/yarn.lock b/yarn.lock index e6000fb9263..dc42df37e56 100644 --- a/yarn.lock +++ b/yarn.lock @@ -18838,15 +18838,15 @@ write-file-atomic@^4.0.2: imurmurhash "^0.1.4" signal-exit "^3.0.7" -ws@8.13.0, ws@>=8.7.0, ws@^8.12.0, ws@^8.4.2: +ws@8.13.0: version "8.13.0" resolved "https://registry.yarnpkg.com/ws/-/ws-8.13.0.tgz#9a9fb92f93cf41512a0735c8f4dd09b8a1211cd0" integrity sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA== -ws@8.8.1: - version "8.8.1" - resolved "https://registry.yarnpkg.com/ws/-/ws-8.8.1.tgz#5dbad0feb7ade8ecc99b830c1d77c913d4955ff0" - integrity sha512-bGy2JzvzkPowEJV++hF07hAD6niYSr0JzBNo/J29WsB57A2r7Wlc1UFcTR9IzrPvuNVO4B8LGqF8qcpsVOhJCA== +ws@8.17.1, ws@>=8.7.0, ws@^8.12.0, ws@^8.4.2: + version "8.17.1" + resolved "https://registry.yarnpkg.com/ws/-/ws-8.17.1.tgz#9293da530bb548febc95371d90f9c878727d919b" + integrity sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ== "ws@^5.2.0 || ^6.0.0 || ^7.0.0", ws@^7.4.6: version "7.5.9" From e2c04c7c2dc5109ff0446d9a6a010ffdffed1e44 Mon Sep 17 00:00:00 2001 From: Rikki Schulte Date: Thu, 1 Aug 2024 13:15:04 +0200 Subject: [PATCH 59/81] fix: astro parsing in LSP by allowing async parsers (#3671) --- .changeset/seven-scissors-guess.md | 8 + .eslintignore | 1 + .prettierignore | 2 + babel.config.js | 5 +- jest.config.base.js | 1 + package.json | 2 + .../package.json | 7 +- .../src/MessageProcessor.ts | 4 +- .../src/__tests__/GraphQLCache.test.ts | 2 +- .../src/__tests__/findGraphQLTags.test.ts | 73 +++-- .../src/__tests__/parseDocument.test.ts | 67 ++--- .../src/__tests__/startServer.spec.ts | 2 +- .../src/constants.ts | 3 +- .../src/findGraphQLTags.ts | 29 +- .../src/parseDocument.ts | 6 +- .../src/parsers/astro.ts | 129 ++++---- .../src/parsers/index.ts | 28 ++ .../src/parsers/types.ts | 7 +- .../src/parsers/vue.ts | 2 +- packages/vscode-graphql/esbuild.js | 3 - resources/custom-words.txt | 1 + yarn.lock | 276 ++++++++++++------ 22 files changed, 401 insertions(+), 257 deletions(-) create mode 100644 .changeset/seven-scissors-guess.md create mode 100644 .prettierignore create mode 100644 packages/graphql-language-service-server/src/parsers/index.ts diff --git a/.changeset/seven-scissors-guess.md b/.changeset/seven-scissors-guess.md new file mode 100644 index 00000000000..be242962983 --- /dev/null +++ b/.changeset/seven-scissors-guess.md @@ -0,0 +1,8 @@ +--- +'graphql-language-service-server': patch +--- + +- switch to using just @astrojs/compiler instead of the more complex "sync" adaptation using workers +- upgrade vue SFC parser to use the new reccomended import from vue package itself +- fix prettier config related to prettier & format on save for parseDocument tests +- fix jest/babel config related to some of the parsers diff --git a/.eslintignore b/.eslintignore index ac46f475f89..33b863f7bba 100644 --- a/.eslintignore +++ b/.eslintignore @@ -6,3 +6,4 @@ packages/codemirror-graphql/src/__tests__/schema-kitchen-sink.graphql CHANGELOG.md **/CHANGELOG.md packages/vscode-graphql-syntax/tests/__fixtures__/ +packages/graphql-language-service-server/src/__tests__/parseDocument.test.ts diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 00000000000..5ded8c95b13 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,2 @@ +# removing this will break tests b/c of whitespace changes + format on save/commit, etc +packages/graphql-language-service-server/src/__tests__/parseDocument.test.ts diff --git a/babel.config.js b/babel.config.js index 56fedcc08d2..50347139e3d 100644 --- a/babel.config.js +++ b/babel.config.js @@ -6,7 +6,7 @@ const envConfig = { if (process.env.ESM) { envConfig.modules = false; - envConfig.targets = { node: true }; + envConfig.targets = { node: 'current' }; envConfig.bugfixes = true; } @@ -36,7 +36,10 @@ module.exports = { }, plugins: [ require.resolve('@babel/plugin-proposal-class-properties'), + require.resolve('@babel/plugin-proposal-nullish-coalescing-operator'), require.resolve('@babel/plugin-proposal-optional-chaining'), + require.resolve('@babel/plugin-transform-private-methods'), + ['babel-plugin-transform-import-meta', { module: 'ES6' }], ], }; diff --git a/jest.config.base.js b/jest.config.base.js index 62e5eacd442..029f7e79290 100644 --- a/jest.config.base.js +++ b/jest.config.base.js @@ -37,6 +37,7 @@ module.exports = (dir, env = 'jsdom') => { testEnvironment: env, testPathIgnorePatterns: ['node_modules', 'dist', 'cypress'], collectCoverageFrom: ['**/src/**/*.{js,jsx,ts,tsx}'], + transformIgnorePatterns: ['node_modules/(!@astrojs/compiler)'], coveragePathIgnorePatterns: [ 'dist', 'esm', diff --git a/package.json b/package.json index ba8fb01db7c..15928d37ecd 100644 --- a/package.json +++ b/package.json @@ -84,6 +84,7 @@ "@babel/plugin-proposal-nullish-coalescing-operator": "^7.18.6", "@babel/plugin-proposal-optional-chaining": "^7.21.0", "@babel/plugin-syntax-dynamic-import": "^7.8.3", + "@babel/plugin-transform-private-methods": "^7.24.7", "@babel/polyfill": "^7.12.1", "@babel/preset-env": "^7.20.2", "@babel/preset-react": "^7.18.6", @@ -104,6 +105,7 @@ "@typescript-eslint/eslint-plugin": "^7.17.0", "@typescript-eslint/parser": "^7.17.0", "babel-jest": "^29.4.3", + "babel-plugin-transform-import-meta": "^2.2.1", "concurrently": "^7.0.0", "copy": "^0.3.2", "cspell": "^5.15.2", diff --git a/packages/graphql-language-service-server/package.json b/packages/graphql-language-service-server/package.json index 3076e31b7f3..e11b6f2a220 100644 --- a/packages/graphql-language-service-server/package.json +++ b/packages/graphql-language-service-server/package.json @@ -38,12 +38,10 @@ }, "COMMENT": "please do not remove dependencies without thorough testing. many dependencies are not imported directly, as they are peer dependencies", "dependencies": { - "@astrojs/compiler": "^2.8.0", + "@astrojs/compiler": "^2.10.1", "@babel/parser": "^7.23.6", "@babel/types": "^7.23.5", "@graphql-tools/code-file-loader": "8.0.3", - "@vue/compiler-sfc": "^3.4.5", - "astrojs-compiler-sync": "^1.0.0", "cosmiconfig-toml-loader": "^1.0.0", "dotenv": "10.0.0", "fast-glob": "^3.2.7", @@ -61,7 +59,8 @@ "vscode-jsonrpc": "^8.0.1", "vscode-languageserver": "^8.0.1", "vscode-languageserver-types": "^3.17.2", - "vscode-uri": "^3.0.2" + "vscode-uri": "^3.0.2", + "vue": "^3.2.0" }, "devDependencies": { "@types/glob": "^8.1.0", diff --git a/packages/graphql-language-service-server/src/MessageProcessor.ts b/packages/graphql-language-service-server/src/MessageProcessor.ts index b9708da9603..817e178c237 100644 --- a/packages/graphql-language-service-server/src/MessageProcessor.ts +++ b/packages/graphql-language-service-server/src/MessageProcessor.ts @@ -98,7 +98,7 @@ export class MessageProcessor { private _isGraphQLConfigMissing: boolean | null = null; private _willShutdown = false; private _logger: Logger | NoopLogger; - private _parser: (text: string, uri: string) => CachedContent[]; + private _parser: (text: string, uri: string) => Promise; private _tmpDir: string; private _tmpDirBase: string; private _loadConfigOptions: LoadConfigOptions; @@ -130,7 +130,7 @@ export class MessageProcessor { } this._connection = connection; this._logger = logger; - this._parser = (text, uri) => { + this._parser = async (text, uri) => { const p = parser ?? parseDocument; return p(text, uri, fileExtensions, graphqlFileExtensions, this._logger); }; diff --git a/packages/graphql-language-service-server/src/__tests__/GraphQLCache.test.ts b/packages/graphql-language-service-server/src/__tests__/GraphQLCache.test.ts index 54082249e3f..10c87d5e367 100644 --- a/packages/graphql-language-service-server/src/__tests__/GraphQLCache.test.ts +++ b/packages/graphql-language-service-server/src/__tests__/GraphQLCache.test.ts @@ -177,7 +177,7 @@ describe('GraphQLCache', () => { ' `,\n' + ' },\n' + '});'; - const contents = parseDocument(text, 'test.js'); + const contents = await parseDocument(text, 'test.js'); const result = await cache.getFragmentDependenciesForAST( parse(contents[0].query), fragmentDefinitions, diff --git a/packages/graphql-language-service-server/src/__tests__/findGraphQLTags.test.ts b/packages/graphql-language-service-server/src/__tests__/findGraphQLTags.test.ts index c16f35a0e58..15759d8cc30 100644 --- a/packages/graphql-language-service-server/src/__tests__/findGraphQLTags.test.ts +++ b/packages/graphql-language-service-server/src/__tests__/findGraphQLTags.test.ts @@ -20,9 +20,9 @@ describe('findGraphQLTags', () => { const findGraphQLTags = (text: string, ext: SupportedExtensionsEnum) => baseFindGraphQLTags(text, ext, '', logger); - it('returns empty for files without asts', () => { + it('returns empty for files without asts', async () => { const text = '// just a comment'; - const contents = findGraphQLTags(text, '.js'); + const contents = await findGraphQLTags(text, '.js'); expect(contents.length).toEqual(0); }); @@ -45,7 +45,7 @@ query Test { export function Example(arg: string) {}`; - const contents = findGraphQLTags(text, '.js'); + const contents = await findGraphQLTags(text, '.js'); expect(contents[0].template).toEqual(` query Test { test { @@ -75,7 +75,7 @@ query Test { export function Example(arg: string) {}`; - const contents = findGraphQLTags(text, '.js'); + const contents = await findGraphQLTags(text, '.js'); expect(contents[0].template).toEqual(` query Test { test { @@ -105,7 +105,7 @@ query Test { export function Example(arg: string) {}`; - const contents = findGraphQLTags(text, '.ts'); + const contents = await findGraphQLTags(text, '.ts'); expect(contents[0].template).toEqual(` query Test { test { @@ -134,7 +134,7 @@ query Test { export function Example(arg: string) {}`; - const contents = findGraphQLTags(text, '.ts'); + const contents = await findGraphQLTags(text, '.ts'); expect(contents[0].template).toEqual(`#graphql query Test { test { @@ -165,7 +165,7 @@ query Test { export function Example(arg: string) {}`; - const contents = findGraphQLTags(text, '.ts'); + const contents = await findGraphQLTags(text, '.ts'); expect(contents[0].template).toEqual(` query Test { test { @@ -180,7 +180,7 @@ query Test { it('finds queries with nested graphql.experimental template tag expression', async () => { const text = 'const query = graphql.experimental` query {} `'; - const contents = findGraphQLTags(text, '.ts'); + const contents = await findGraphQLTags(text, '.ts'); expect(contents[0].template).toEqual(' query {} '); }); @@ -191,7 +191,7 @@ query Test { const query = graphql\` query {} \` `; - const contents = findGraphQLTags(text, '.ts'); + const contents = await findGraphQLTags(text, '.ts'); expect(contents[0].template).toEqual(' query {} '); }); @@ -242,7 +242,7 @@ class Todo2{} class AppModule {} const query = graphql\` query {} \` `; - const contents = findGraphQLTags(text, '.ts'); + const contents = await findGraphQLTags(text, '.ts'); expect(contents[0].template).toEqual(' query {} '); }); @@ -252,7 +252,7 @@ class Todo2{} else: () => gql\` query {} \` }`; - const contents = findGraphQLTags(text, '.ts'); + const contents = await findGraphQLTags(text, '.ts'); expect(contents[0].template).toEqual(' query {} '); }); @@ -261,7 +261,7 @@ class Todo2{} else: () => graphql\` query {} \` })`; - const contents = findGraphQLTags(text, '.ts'); + const contents = await findGraphQLTags(text, '.ts'); expect(contents[0].template).toEqual(' query {} '); }); @@ -273,7 +273,7 @@ query {id} \`; `; - const contents = findGraphQLTags(text, '.vue'); + const contents = await findGraphQLTags(text, '.vue'); expect(contents[0].template).toEqual(` query {id}`); expect(contents[0].range.start.line).toEqual(2); @@ -290,7 +290,7 @@ query {id} \`; `; - const contents = findGraphQLTags(text, '.vue'); + const contents = await findGraphQLTags(text, '.vue'); expect(contents[0].template).toEqual(` query {id}`); expect(contents[0].range.start.line).toEqual(4); @@ -305,7 +305,7 @@ query {id} \`; `; - const contents = findGraphQLTags(text, '.vue'); + const contents = await findGraphQLTags(text, '.vue'); expect(contents[0].template).toEqual(` query {id}`); expect(contents[0].range.start.line).toEqual(2); @@ -322,7 +322,7 @@ query {id} \`; `; - const contents = findGraphQLTags(text, '.vue'); + const contents = await findGraphQLTags(text, '.vue'); expect(contents[0].template).toEqual(` query {id}`); expect(contents[0].range.start.line).toEqual(4); @@ -346,7 +346,7 @@ export default defineComponent({ `; - const contents = findGraphQLTags(text, '.vue'); + const contents = await findGraphQLTags(text, '.vue'); expect(contents[0].template).toEqual(` query {id}`); }); @@ -377,7 +377,7 @@ query {id}`); `; - const contents = findGraphQLTags(text, '.svelte'); + const contents = await findGraphQLTags(text, '.svelte'); expect(contents[0].template).toEqual(` query AllCharacters { characters { @@ -402,7 +402,12 @@ query {id}`); .spyOn(process.stderr, 'write') .mockImplementation(() => true); - const contents = baseFindGraphQLTags(text, '.svelte', '', new NoopLogger()); + const contents = await baseFindGraphQLTags( + text, + '.svelte', + '', + new NoopLogger(), + ); // We should have no contents expect(contents).toMatchObject([]); @@ -419,7 +424,12 @@ query {id}`); .spyOn(process.stderr, 'write') .mockImplementation(() => true); - const contents = baseFindGraphQLTags(text, '.svelte', '', new NoopLogger()); + const contents = await baseFindGraphQLTags( + text, + '.svelte', + '', + new NoopLogger(), + ); // We should have no contents expect(contents).toMatchObject([]); @@ -436,7 +446,12 @@ query {id}`); .spyOn(process.stderr, 'write') .mockImplementation(() => true); - const contents = baseFindGraphQLTags(text, '.svelte', '', new NoopLogger()); + const contents = await baseFindGraphQLTags( + text, + '.svelte', + '', + new NoopLogger(), + ); // We should have no contents expect(contents).toMatchObject([]); @@ -452,7 +467,7 @@ query {id}`); }) const query = graphql\`query myQuery {}\``; - const contents = findGraphQLTags(text, '.ts'); + const contents = await findGraphQLTags(text, '.ts'); expect(contents.length).toEqual(2); @@ -491,7 +506,7 @@ query Test { export function Example(arg: string) {}`; - const contents = findGraphQLTags(text, '.js'); + const contents = await findGraphQLTags(text, '.js'); expect(contents.length).toEqual(0); }); @@ -514,10 +529,10 @@ query Test { export function Example(arg: string) {}`; - const contents = findGraphQLTags(text, '.js'); + const contents = await findGraphQLTags(text, '.js'); expect(contents.length).toEqual(0); }); - it('handles full svelte example', () => { + it('handles full svelte example', async () => { const text = `