vscode-apollo 1.19.3 → 1.20.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.changeset/README.md +8 -0
- package/.changeset/config.json +14 -0
- package/.circleci/config.yml +82 -0
- package/.eslintrc.js +10 -0
- package/.gitattributes +1 -0
- package/.github/workflows/build-prs.yml +57 -0
- package/.github/workflows/release.yml +114 -0
- package/.gitleaks.toml +26 -0
- package/.nvmrc +1 -0
- package/.prettierrc +5 -0
- package/.vscode/launch.json +61 -0
- package/.vscode/settings.json +16 -0
- package/.vscode/tasks.json +18 -0
- package/.vscodeignore +17 -1
- package/CHANGELOG.md +178 -1
- package/LICENSE +2 -2
- package/README.md +9 -9
- package/codegen.yml +12 -0
- package/images/IconRun.svg +8 -0
- package/jest.config.ts +11 -0
- package/package.json +102 -22
- package/renovate.json +23 -0
- package/src/__mocks__/fs.js +3 -0
- package/src/__tests__/statusBar.test.ts +8 -7
- package/src/debug.ts +2 -5
- package/src/env/fetch/fetch.ts +32 -0
- package/src/env/fetch/global.ts +30 -0
- package/src/env/fetch/index.d.ts +2 -0
- package/src/env/fetch/index.ts +2 -0
- package/src/env/fetch/url.ts +9 -0
- package/src/env/index.ts +4 -0
- package/src/env/polyfills/array.ts +17 -0
- package/src/env/polyfills/index.ts +2 -0
- package/src/env/polyfills/object.ts +7 -0
- package/src/env/typescript-utility-types.ts +2 -0
- package/src/extension.ts +106 -37
- package/src/language-server/__tests__/diagnostics.test.ts +86 -0
- package/src/language-server/__tests__/document.test.ts +187 -0
- package/src/language-server/__tests__/fileSet.test.ts +46 -0
- package/src/language-server/__tests__/fixtures/starwarsSchema.ts +1917 -0
- package/src/language-server/config/__tests__/config.ts +128 -0
- package/src/language-server/config/__tests__/loadConfig.ts +508 -0
- package/src/language-server/config/__tests__/utils.ts +106 -0
- package/src/language-server/config/config.ts +219 -0
- package/src/language-server/config/index.ts +3 -0
- package/src/language-server/config/loadConfig.ts +228 -0
- package/src/language-server/config/utils.ts +56 -0
- package/src/language-server/diagnostics.ts +109 -0
- package/src/language-server/document.ts +277 -0
- package/src/language-server/engine/GraphQLDataSource.ts +124 -0
- package/src/language-server/engine/index.ts +105 -0
- package/src/language-server/engine/operations/frontendUrlRoot.ts +7 -0
- package/src/language-server/engine/operations/schemaTagsAndFieldStats.ts +24 -0
- package/src/language-server/errors/__tests__/NoMissingClientDirectives.test.ts +220 -0
- package/src/language-server/errors/logger.ts +58 -0
- package/src/language-server/errors/validation.ts +277 -0
- package/src/language-server/fileSet.ts +65 -0
- package/src/language-server/format.ts +48 -0
- package/src/language-server/graphqlTypes.ts +7176 -0
- package/src/language-server/index.ts +29 -0
- package/src/language-server/languageProvider.ts +798 -0
- package/src/language-server/loadingHandler.ts +64 -0
- package/src/language-server/project/base.ts +399 -0
- package/src/language-server/project/client.ts +602 -0
- package/src/language-server/project/defaultClientSchema.ts +45 -0
- package/src/language-server/project/service.ts +48 -0
- package/src/language-server/providers/schema/__tests__/file.ts +150 -0
- package/src/language-server/providers/schema/base.ts +15 -0
- package/src/language-server/providers/schema/endpoint.ts +157 -0
- package/src/language-server/providers/schema/engine.ts +197 -0
- package/src/language-server/providers/schema/file.ts +167 -0
- package/src/language-server/providers/schema/index.ts +75 -0
- package/src/language-server/server.ts +252 -0
- package/src/language-server/typings/codemirror.d.ts +4 -0
- package/src/language-server/typings/graphql.d.ts +27 -0
- package/src/language-server/utilities/__tests__/graphql.test.ts +411 -0
- package/src/language-server/utilities/__tests__/uri.ts +55 -0
- package/src/language-server/utilities/debouncer.ts +8 -0
- package/src/language-server/utilities/debug.ts +89 -0
- package/src/language-server/utilities/graphql.ts +432 -0
- package/src/language-server/utilities/index.ts +3 -0
- package/src/language-server/utilities/source.ts +182 -0
- package/src/language-server/utilities/uri.ts +19 -0
- package/src/language-server/workspace.ts +262 -0
- package/src/languageServerClient.ts +19 -12
- package/src/messages.ts +84 -0
- package/src/statusBar.ts +5 -5
- package/src/tools/__tests__/buildServiceDefinition.test.ts +491 -0
- package/src/tools/__tests__/snapshotSerializers/astSerializer.ts +19 -0
- package/src/tools/__tests__/snapshotSerializers/graphQLTypeSerializer.ts +14 -0
- package/src/tools/buildServiceDefinition.ts +241 -0
- package/src/tools/index.ts +6 -0
- package/src/tools/schema/index.ts +2 -0
- package/src/tools/schema/resolveObject.ts +18 -0
- package/src/tools/schema/resolverMap.ts +23 -0
- package/src/tools/utilities/graphql.ts +22 -0
- package/src/tools/utilities/index.ts +3 -0
- package/src/tools/utilities/invariant.ts +5 -0
- package/src/tools/utilities/predicates.ts +5 -0
- package/src/utils.ts +1 -16
- package/syntaxes/graphql.js.json +3 -3
- package/syntaxes/graphql.json +13 -9
- package/syntaxes/graphql.lua.json +51 -0
- package/syntaxes/graphql.rb.json +1 -1
- package/tsconfig.build.json +4 -0
- package/tsconfig.json +20 -7
- package/create-server-symlink.js +0 -8
- package/lib/debug.d.ts +0 -11
- package/lib/debug.d.ts.map +0 -1
- package/lib/debug.js +0 -48
- package/lib/debug.js.map +0 -1
- package/lib/extension.d.ts +0 -4
- package/lib/extension.d.ts.map +0 -1
- package/lib/extension.js +0 -187
- package/lib/extension.js.map +0 -1
- package/lib/languageServerClient.d.ts +0 -4
- package/lib/languageServerClient.d.ts.map +0 -1
- package/lib/languageServerClient.js +0 -57
- package/lib/languageServerClient.js.map +0 -1
- package/lib/statusBar.d.ts +0 -24
- package/lib/statusBar.d.ts.map +0 -1
- package/lib/statusBar.js +0 -46
- package/lib/statusBar.js.map +0 -1
- package/lib/testRunner/index.d.ts +0 -3
- package/lib/testRunner/index.d.ts.map +0 -1
- package/lib/testRunner/index.js +0 -49
- package/lib/testRunner/index.js.map +0 -1
- package/lib/testRunner/jest-config.d.ts +0 -14
- package/lib/testRunner/jest-config.d.ts.map +0 -1
- package/lib/testRunner/jest-config.js +0 -18
- package/lib/testRunner/jest-config.js.map +0 -1
- package/lib/testRunner/jest-vscode-environment.d.ts +0 -2
- package/lib/testRunner/jest-vscode-environment.d.ts.map +0 -1
- package/lib/testRunner/jest-vscode-environment.js +0 -19
- package/lib/testRunner/jest-vscode-environment.js.map +0 -1
- package/lib/testRunner/jest-vscode-framework-setup.d.ts +0 -1
- package/lib/testRunner/jest-vscode-framework-setup.d.ts.map +0 -1
- package/lib/testRunner/jest-vscode-framework-setup.js +0 -3
- package/lib/testRunner/jest-vscode-framework-setup.js.map +0 -1
- package/lib/testRunner/vscode-test-script.d.ts +0 -2
- package/lib/testRunner/vscode-test-script.d.ts.map +0 -1
- package/lib/testRunner/vscode-test-script.js +0 -23
- package/lib/testRunner/vscode-test-script.js.map +0 -1
- package/lib/utils.d.ts +0 -18
- package/lib/utils.d.ts.map +0 -1
- package/lib/utils.js +0 -52
- package/lib/utils.js.map +0 -1
- package/src/testRunner/README.md +0 -23
- package/src/testRunner/index.ts +0 -72
- package/src/testRunner/jest-config.ts +0 -17
- package/src/testRunner/jest-vscode-environment.ts +0 -25
- package/src/testRunner/jest-vscode-framework-setup.ts +0 -10
- package/src/testRunner/jest.d.ts +0 -37
- package/src/testRunner/vscode-test-script.ts +0 -38
- package/tsconfig.test.json +0 -4
- package/tsconfig.tsbuildinfo +0 -2486
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
GraphQL has the potential to create incredible developer experiences, thanks to its strongly typed schema and query language. The Apollo platform brings these possibilities to life by enhancing your editor with rich metadata from your graph API.
|
|
4
4
|
|
|
5
|
-

|
|
6
6
|
|
|
7
7
|
The Apollo GraphQL extension for VS Code brings an all-in-one tooling experience for developing apps with Apollo.
|
|
8
8
|
|
|
@@ -17,7 +17,7 @@ The Apollo GraphQL extension for VS Code brings an all-in-one tooling experience
|
|
|
17
17
|
|
|
18
18
|
<h2 id="getting-started">Getting started</h2>
|
|
19
19
|
|
|
20
|
-
Some features of this extension (like syntax highlighting) will work without any configuration, but to get all of the benefits of the VS Code experience, it's best to link the schema that is being developed against **before** installing the extension. The best way to do that is by [publishing a schema](https://www.apollographql.com/docs/
|
|
20
|
+
Some features of this extension (like syntax highlighting) will work without any configuration, but to get all of the benefits of the VS Code experience, it's best to link the schema that is being developed against **before** installing the extension. The best way to do that is by [publishing a schema](https://www.apollographql.com/docs/graphos/delivery/) to the Apollo schema registry. Once that is done, two steps are needed:
|
|
21
21
|
|
|
22
22
|
1. Create an `apollo.config.js` at the root of the project
|
|
23
23
|
2. Copy an API key from the Apollo Studio dashboard of the published graph
|
|
@@ -94,7 +94,7 @@ Once you have a config set up and a schema published, **install the Apollo Graph
|
|
|
94
94
|
|
|
95
95
|
When a file open, clicking the status bar icon will open the output window and print stats about the project associated with that file. This is helpful when confirming the project is setup properly.
|
|
96
96
|
|
|
97
|
-
<img src="https://raw.githubusercontent.com/apollographql/
|
|
97
|
+
<img src="https://raw.githubusercontent.com/apollographql/vscode-graphql/main/images/marketplace/stats.gif" alt="Clicking the status bar icon to open the output pane">
|
|
98
98
|
|
|
99
99
|
<h2 id="features">Features</h2>
|
|
100
100
|
|
|
@@ -104,19 +104,19 @@ Apollo for VS Code brings many helpful features for working on a GraphQL project
|
|
|
104
104
|
|
|
105
105
|
Once configured, VS Code has full knowledge of the schema clients are running operations against, including client-only schemas (for things like local state mutations). Because of this, it have the ability to autocomplete fields and arguments as you type.
|
|
106
106
|
|
|
107
|
-
<img src="https://raw.githubusercontent.com/apollographql/
|
|
107
|
+
<img src="https://raw.githubusercontent.com/apollographql/vscode-graphql/main/images/marketplace/autocomplete.gif" alt="vscode completing a field when typing">
|
|
108
108
|
|
|
109
109
|
<h3 id="errors-and-warnings">Inline errors and warnings</h3>
|
|
110
110
|
|
|
111
111
|
VS Code can use local or published schemas to validate operations before running them. **Syntax errors**, **invalid fields or arguments**, and even **deprecated fields** instantly appear as errors or warnings right in your editor, ensuring all developers are working with the most up-to-date production schemas.
|
|
112
112
|
|
|
113
|
-
<img src="https://raw.githubusercontent.com/apollographql/
|
|
113
|
+
<img src="https://raw.githubusercontent.com/apollographql/vscode-graphql/main/images/marketplace/warnings-and-errors.gif" alt="tooltip showing a field deprecation warning and error">
|
|
114
114
|
|
|
115
115
|
<h3 id="field-type-info">Inline field type information</h3>
|
|
116
116
|
|
|
117
117
|
Because of GraphQL's strongly-typed schema, VS Code not only know about which fields and arguments are valid, but also what types are expected. Hover over any type in a valid GraphQL operation to see what type that field returns and whether or not it can be null.
|
|
118
118
|
|
|
119
|
-
<img src="https://raw.githubusercontent.com/apollographql/
|
|
119
|
+
<img src="https://raw.githubusercontent.com/apollographql/vscode-graphql/main/images/marketplace/type-info.png" style="max-width:800px;" alt="a tooltip showing a Boolean type for a field">
|
|
120
120
|
|
|
121
121
|
<h3 id="performance-insights">Performance insights</h3>
|
|
122
122
|
|
|
@@ -126,7 +126,7 @@ To turn on tracing for your GraphQL server, please visit our [guide](https://www
|
|
|
126
126
|
|
|
127
127
|
The VS Code extension will show inline performance diagnostics when connected to a service with reported metrics in Apollo Studio. As operations are typed, any fields that take longer than 1ms to respond will be annotated to the right of the field inline! This gives team members a picture of how long the operation will take as more and more fields are added to operations or fragments.
|
|
128
128
|
|
|
129
|
-
<img src="https://raw.githubusercontent.com/apollographql/
|
|
129
|
+
<img src="https://raw.githubusercontent.com/apollographql/vscode-graphql/main/images/marketplace/perf-annotation.png" style="max-width:800px;" alt="Performance annotation next to a field">
|
|
130
130
|
|
|
131
131
|
<h3 id="syntax">Syntax highlighting</h3>
|
|
132
132
|
|
|
@@ -136,7 +136,7 @@ Apollo's editor extension provides syntax highlighting for all things GraphQL, i
|
|
|
136
136
|
|
|
137
137
|
Navigating large codebases can be difficult, but the Apollo GraphQL extension makes this easier than ever. Right-clicking on any field in operations or schemas gives you the ability to jump to (or peek at) definitions, as well as find any other references to that field in your project. Searching a project for any occurrence of a certain field is now a thing of the past!
|
|
138
138
|
|
|
139
|
-
<img src="https://raw.githubusercontent.com/apollographql/
|
|
139
|
+
<img src="https://raw.githubusercontent.com/apollographql/vscode-graphql/main/images/marketplace/jump-to-def.gif" alt="Using jump to definition on a fragment">
|
|
140
140
|
|
|
141
141
|
<h3 id="commands">Schema tag switching</h3>
|
|
142
142
|
|
|
@@ -151,6 +151,6 @@ Other errors may be caused from an old version of a published schema. To reload
|
|
|
151
151
|
|
|
152
152
|
Sometimes errors will show up as a notification at the bottom of your editor. Other, less critical messages may be shown in the output pane of the editor. To open the output pane and get diagnostic information about the extension and the current service loaded (if working with a client project), just click the "Apollo GraphQL" icon in the status bar at the bottom.
|
|
153
153
|
|
|
154
|
-
<img src="https://raw.githubusercontent.com/apollographql/
|
|
154
|
+
<img src="https://raw.githubusercontent.com/apollographql/vscode-graphql/main/images/marketplace/stats.gif" alt="Clicking the status bar icon to open the output pane">
|
|
155
155
|
|
|
156
156
|
If problems persist or the error messages are unhelpful, an [issue](https://github.com/apollographql/apollo-tooling/issues) can be opened on the `apollo-tooling` repository.
|
package/codegen.yml
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# Would be better to get the schema from the Studio registry once it can be a public variant.
|
|
2
|
+
schema: https://graphql.api.apollographql.com/api/graphql
|
|
3
|
+
generates:
|
|
4
|
+
./src/language-server/graphqlTypes.ts:
|
|
5
|
+
documents:
|
|
6
|
+
- src/**/*.ts
|
|
7
|
+
- "!src/**/__tests__**/*.ts"
|
|
8
|
+
plugins:
|
|
9
|
+
- typescript
|
|
10
|
+
- typescript-operations
|
|
11
|
+
config:
|
|
12
|
+
avoidOptionals: true
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svgjs="http://svgjs.com/svgjs" viewBox="0 0 20 20" width="7" height="7">
|
|
2
|
+
<title>
|
|
3
|
+
Exported from Streamline App (https://app.streamlineicons.com)
|
|
4
|
+
</title>
|
|
5
|
+
<g transform="matrix(2.54 0 0 2.54 10 9.97)" id="LVKu-U2gXNoh456TxJx47" >
|
|
6
|
+
<path style="stroke: rgb(255,255,255); stroke-width: 1; stroke-dasharray: none; stroke-linecap: round; stroke-dashoffset: 0; stroke-linejoin: round; stroke-miterlimit: 4; fill: #2075D6; fill-rule: evenodd; opacity: 1;" vector-effect="non-scaling-stroke" transform=" translate(-10.25, -9.71)" d="M 7 6.502 L 7 12.926 C 7 13.293 7.317 13.534 7.592 13.379 L 13.259 10.166 C 13.408058725855952 10.063593398311438 13.49712261259461 9.89434694032026 13.49712261259461 9.7135 C 13.49712261259461 9.532653059679742 13.408058725855952 9.363406601688563 13.259 9.261000000000001 L 7.592 6.047 C 7.317 5.893 7 6.135 7 6.502 Z" stroke-linecap="round" />
|
|
7
|
+
</g>
|
|
8
|
+
</svg>
|
package/jest.config.ts
ADDED
package/package.json
CHANGED
|
@@ -2,36 +2,93 @@
|
|
|
2
2
|
"name": "vscode-apollo",
|
|
3
3
|
"displayName": "Apollo GraphQL",
|
|
4
4
|
"description": "Rich editor support for GraphQL client and server development that seamlessly integrates with the Apollo platform",
|
|
5
|
-
"version": "1.
|
|
5
|
+
"version": "1.20.1",
|
|
6
6
|
"referenceID": "87197759-7617-40d0-b32e-46d378e907c7",
|
|
7
7
|
"author": "Apollo GraphQL <opensource@apollographql.com>",
|
|
8
8
|
"license": "MIT",
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
11
|
-
"url": "https://github.com/apollographql/
|
|
11
|
+
"url": "https://github.com/apollographql/vscode-graphql"
|
|
12
12
|
},
|
|
13
|
-
"homepage": "https://github.com/apollographql/
|
|
14
|
-
"bugs": "https://github.com/apollographql/
|
|
13
|
+
"homepage": "https://github.com/apollographql/vscode-graphql",
|
|
14
|
+
"bugs": "https://github.com/apollographql/vscode-graphql/issues",
|
|
15
15
|
"main": "./lib/extension",
|
|
16
16
|
"types": "lib/index.d.ts",
|
|
17
17
|
"scripts": {
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"test": "
|
|
18
|
+
"build": "tsc --build tsconfig.build.json",
|
|
19
|
+
"build:clean": "npm run build -- --clean",
|
|
20
|
+
"watch": "npm run build -- --watch",
|
|
21
|
+
"postinstall": "curl https://raw.githubusercontent.com/Microsoft/vscode/c6e592b2b5770e40a98cb9c2715a8ef89aec3d74/src/vs/vscode.d.ts -o node_modules/vscode/vscode.d.ts",
|
|
22
|
+
"changeset-version": "changeset version && npm ci --ignore-scripts",
|
|
23
|
+
"changeset-publish": "npm run build && changeset publish",
|
|
24
|
+
"typecheck": "tsc --noEmit",
|
|
25
|
+
"lint": "eslint src --ext .ts",
|
|
26
|
+
"test-unit": "jest",
|
|
27
|
+
"codegen": "graphql-codegen"
|
|
27
28
|
},
|
|
28
29
|
"engines": {
|
|
29
30
|
"vscode": "^1.30.0"
|
|
30
31
|
},
|
|
31
32
|
"dependencies": {
|
|
32
|
-
"apollo
|
|
33
|
-
"
|
|
34
|
-
"
|
|
33
|
+
"@apollo/federation": "^0.23.1",
|
|
34
|
+
"@endemolshinegroup/cosmiconfig-typescript-loader": "^1.0.0",
|
|
35
|
+
"@types/lz-string": "^1.3.34",
|
|
36
|
+
"@types/node-fetch": "2.5.10",
|
|
37
|
+
"apollo-datasource": "^0.8.0",
|
|
38
|
+
"apollo-link": "^1.2.3",
|
|
39
|
+
"apollo-link-context": "^1.0.9",
|
|
40
|
+
"apollo-link-error": "^1.1.1",
|
|
41
|
+
"apollo-link-http": "^1.5.5",
|
|
42
|
+
"apollo-server-errors": "^2.0.2",
|
|
43
|
+
"await-to-js": "^2.0.1",
|
|
44
|
+
"codemirror": "^5.63.3",
|
|
45
|
+
"core-js": "^3.0.1",
|
|
46
|
+
"cosmiconfig": "^5.0.6",
|
|
47
|
+
"dotenv": "^10.0.0",
|
|
48
|
+
"glob": "^7.1.3",
|
|
49
|
+
"graphql": "^15.5.0",
|
|
50
|
+
"graphql-language-service-interface": "^2.8.4",
|
|
51
|
+
"graphql-tag": "^2.10.1",
|
|
52
|
+
"lodash.debounce": "^4.0.8",
|
|
53
|
+
"lodash.merge": "^4.6.1",
|
|
54
|
+
"lz-string": "^1.4.4",
|
|
55
|
+
"minimatch": "^3.0.4",
|
|
56
|
+
"moment": "^2.29.1",
|
|
57
|
+
"node-fetch": "^2.2.0",
|
|
58
|
+
"query-string": "^7.0.1",
|
|
59
|
+
"resolve-from": "^5.0.0",
|
|
60
|
+
"sha.js": "^2.4.11",
|
|
61
|
+
"vscode-languageclient": "^5.2.1",
|
|
62
|
+
"vscode-languageserver": "^5.1.0",
|
|
63
|
+
"vscode-uri": "1.0.6"
|
|
64
|
+
},
|
|
65
|
+
"devDependencies": {
|
|
66
|
+
"@changesets/changelog-github": "^0.4.8",
|
|
67
|
+
"@changesets/cli": "^2.26.2",
|
|
68
|
+
"@graphql-codegen/cli": "^2.2.0",
|
|
69
|
+
"@graphql-codegen/typescript-operations": "^2.1.3",
|
|
70
|
+
"@types/cosmiconfig": "5.0.3",
|
|
71
|
+
"@types/glob": "7.1.1",
|
|
72
|
+
"@types/jest": "^26.0.24",
|
|
73
|
+
"@types/lodash.debounce": "4.0.6",
|
|
74
|
+
"@types/lodash.merge": "4.6.6",
|
|
75
|
+
"@types/node": "^14.14.41",
|
|
76
|
+
"@types/node-fetch": "2.5.10",
|
|
77
|
+
"@typescript-eslint/eslint-plugin": "^4.29.0",
|
|
78
|
+
"@typescript-eslint/parser": "^4.29.0",
|
|
79
|
+
"eslint": "^7.32.0",
|
|
80
|
+
"eslint-config-prettier": "^8.3.0",
|
|
81
|
+
"eslint-plugin-prettier": "^3.4.0",
|
|
82
|
+
"jest": "^27.0.6",
|
|
83
|
+
"jest-environment-node": "^26.6.2",
|
|
84
|
+
"jest-junit": "^12.2.0",
|
|
85
|
+
"memfs": "^3.2.2",
|
|
86
|
+
"prettier": "^2.3.2",
|
|
87
|
+
"rimraf": "^3.0.2",
|
|
88
|
+
"ts-jest": "^27.0.4",
|
|
89
|
+
"typescript": "^4.3.5",
|
|
90
|
+
"vsce": "^1.87.1",
|
|
91
|
+
"vscode": "^1.1.37"
|
|
35
92
|
},
|
|
36
93
|
"publisher": "apollographql",
|
|
37
94
|
"categories": [
|
|
@@ -40,12 +97,13 @@
|
|
|
40
97
|
],
|
|
41
98
|
"icon": "images/icon-apollo-blue-400x400.png",
|
|
42
99
|
"activationEvents": [
|
|
43
|
-
"workspaceContains:**/apollo.config.[jt]s"
|
|
100
|
+
"workspaceContains:**/apollo.config.[jt]s",
|
|
101
|
+
"workspaceContains:**/apollo.config.cjs"
|
|
44
102
|
],
|
|
45
103
|
"contributes": {
|
|
46
104
|
"configuration": {
|
|
47
105
|
"type": "object",
|
|
48
|
-
"title": "
|
|
106
|
+
"title": "Apollo GraphQL",
|
|
49
107
|
"properties": {
|
|
50
108
|
"apollographql.trace.server": {
|
|
51
109
|
"scope": "window",
|
|
@@ -57,6 +115,18 @@
|
|
|
57
115
|
],
|
|
58
116
|
"default": "off",
|
|
59
117
|
"description": "Traces the communication between VS Code and the language server."
|
|
118
|
+
},
|
|
119
|
+
"apollographql.debug.revealOutputOnLanguageServerError": {
|
|
120
|
+
"type": "boolean",
|
|
121
|
+
"default": true,
|
|
122
|
+
"markdownDescription": "Switches to the \"Output\" tab whenever an error occurs in the language server.",
|
|
123
|
+
"scope": "window"
|
|
124
|
+
},
|
|
125
|
+
"apollographql.display.showRunInStudioButton": {
|
|
126
|
+
"type": "boolean",
|
|
127
|
+
"default": true,
|
|
128
|
+
"markdownDescription": "Show a \"Run in Studio\" button to the right of Operation Signatures.",
|
|
129
|
+
"scope": "window"
|
|
60
130
|
}
|
|
61
131
|
}
|
|
62
132
|
},
|
|
@@ -84,9 +154,10 @@
|
|
|
84
154
|
"injectTo": [
|
|
85
155
|
"source.js",
|
|
86
156
|
"source.ts",
|
|
87
|
-
"source.
|
|
157
|
+
"source.jsx",
|
|
88
158
|
"source.tsx",
|
|
89
|
-
"source.vue"
|
|
159
|
+
"source.vue",
|
|
160
|
+
"source.svelte"
|
|
90
161
|
],
|
|
91
162
|
"scopeName": "inline.graphql",
|
|
92
163
|
"path": "./syntaxes/graphql.js.json",
|
|
@@ -104,6 +175,16 @@
|
|
|
104
175
|
"meta.embedded.block.graphql": "graphql"
|
|
105
176
|
}
|
|
106
177
|
},
|
|
178
|
+
{
|
|
179
|
+
"injectTo": [
|
|
180
|
+
"source.lua"
|
|
181
|
+
],
|
|
182
|
+
"scopeName": "inline.graphql.lua",
|
|
183
|
+
"path": "./syntaxes/graphql.lua.json",
|
|
184
|
+
"embeddedLanguages": {
|
|
185
|
+
"meta.embedded.block.graphql": "graphql"
|
|
186
|
+
}
|
|
187
|
+
},
|
|
107
188
|
{
|
|
108
189
|
"injectTo": [
|
|
109
190
|
"source.ruby"
|
|
@@ -166,6 +247,5 @@
|
|
|
166
247
|
"galleryBanner": {
|
|
167
248
|
"color": "#1d127d",
|
|
168
249
|
"theme": "dark"
|
|
169
|
-
}
|
|
170
|
-
"gitHead": "7f77a11e5c3123137af9235b4a32ac76ec1aad39"
|
|
250
|
+
}
|
|
171
251
|
}
|
package/renovate.json
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": ["apollo-open-source"],
|
|
3
|
+
"dependencyDashboard": true,
|
|
4
|
+
"packageRules": [
|
|
5
|
+
{
|
|
6
|
+
"groupName": "all @types",
|
|
7
|
+
"groupSlug": "all-types",
|
|
8
|
+
"matchPackagePatterns": ["@types/*"]
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"groupName": "all devDependencies",
|
|
12
|
+
"groupSlug": "all-dev",
|
|
13
|
+
"matchPackagePatterns": ["*"],
|
|
14
|
+
"matchDepTypes": ["devDependencies"]
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"groupName": "all dependencies - patch updates",
|
|
18
|
+
"groupSlug": "all-patch",
|
|
19
|
+
"matchPackagePatterns": ["*"],
|
|
20
|
+
"matchUpdateTypes": ["patch"]
|
|
21
|
+
}
|
|
22
|
+
]
|
|
23
|
+
}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import StatusBar from "../statusBar";
|
|
1
|
+
// import StatusBar from "../statusBar";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// TODO (jgzuke) disable this until we migrate away from `vscode`.
|
|
4
|
+
// https://code.visualstudio.com/api/working-with-extensions/testing-extension#migrating-from-vscode
|
|
5
|
+
describe.skip("statusBar", () => {
|
|
4
6
|
it("only shows loaded state when it's supposed to", () => {
|
|
5
|
-
const statusBar = new StatusBar({ hasActiveTextEditor: true });
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
statusBar.
|
|
9
|
-
expect(statusBar.statusBarItem.text).toEqual(StatusBar.loadedStateText);
|
|
7
|
+
// const statusBar = new StatusBar({ hasActiveTextEditor: true });
|
|
8
|
+
// expect(statusBar.statusBarItem.text).toEqual(StatusBar.loadingStateText);
|
|
9
|
+
// statusBar.showLoadedState({ hasActiveTextEditor: true });
|
|
10
|
+
// expect(statusBar.statusBarItem.text).toEqual(StatusBar.loadedStateText);
|
|
10
11
|
});
|
|
11
12
|
});
|
package/src/debug.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { OutputChannel } from "vscode";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* for errors (and other logs in debug mode) we want to print
|
|
@@ -10,10 +10,7 @@ const createAndTrimStackTrace = () => {
|
|
|
10
10
|
let stack: string | undefined = new Error().stack;
|
|
11
11
|
// remove the lines in the stack from _this_ function and the caller (in this file) and shorten the trace
|
|
12
12
|
return stack && stack.split("\n").length > 2
|
|
13
|
-
? stack
|
|
14
|
-
.split("\n")
|
|
15
|
-
.slice(3, 7)
|
|
16
|
-
.join("\n")
|
|
13
|
+
? stack.split("\n").slice(3, 7).join("\n")
|
|
17
14
|
: stack;
|
|
18
15
|
};
|
|
19
16
|
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Agent as HttpAgent } from "http";
|
|
2
|
+
import { Agent as HttpsAgent } from "https";
|
|
3
|
+
|
|
4
|
+
export type RequestAgent = HttpAgent | HttpsAgent;
|
|
5
|
+
|
|
6
|
+
export type ReferrerPolicy =
|
|
7
|
+
| ""
|
|
8
|
+
| "no-referrer"
|
|
9
|
+
| "no-referrer-when-downgrade"
|
|
10
|
+
| "same-origin"
|
|
11
|
+
| "origin"
|
|
12
|
+
| "strict-origin"
|
|
13
|
+
| "origin-when-cross-origin"
|
|
14
|
+
| "strict-origin-when-cross-origin"
|
|
15
|
+
| "unsafe-url";
|
|
16
|
+
|
|
17
|
+
export {
|
|
18
|
+
default as fetch,
|
|
19
|
+
Request,
|
|
20
|
+
Response,
|
|
21
|
+
Headers,
|
|
22
|
+
ResponseInit,
|
|
23
|
+
BodyInit,
|
|
24
|
+
RequestInfo,
|
|
25
|
+
HeadersInit,
|
|
26
|
+
Body,
|
|
27
|
+
RequestInit,
|
|
28
|
+
RequestMode,
|
|
29
|
+
RequestCredentials,
|
|
30
|
+
RequestCache,
|
|
31
|
+
RequestRedirect,
|
|
32
|
+
} from "node-fetch";
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
declare function fetch(
|
|
2
|
+
input?: RequestInfo,
|
|
3
|
+
init?: RequestInit
|
|
4
|
+
): Promise<Response>;
|
|
5
|
+
|
|
6
|
+
declare interface GlobalFetch {
|
|
7
|
+
fetch(input: RequestInfo, init?: RequestInit): Promise<Response>;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
declare interface WindowOrWorkerGlobalScope {
|
|
11
|
+
fetch(input: RequestInfo, init?: RequestInit): Promise<Response>;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
type RequestInfo = import("./fetch").RequestInfo;
|
|
15
|
+
type Headers = import("./fetch").Headers;
|
|
16
|
+
type HeadersInit = import("./fetch").HeadersInit;
|
|
17
|
+
type Body = import("./fetch").Body;
|
|
18
|
+
type Request = import("./fetch").Request;
|
|
19
|
+
type RequestAgent = import("./fetch").RequestAgent;
|
|
20
|
+
type RequestInit = import("./fetch").RequestInit;
|
|
21
|
+
type RequestMode = import("./fetch").RequestMode;
|
|
22
|
+
type RequestCredentials = import("./fetch").RequestCredentials;
|
|
23
|
+
type RequestCache = import("./fetch").RequestCache;
|
|
24
|
+
type RequestRedirect = import("./fetch").RequestRedirect;
|
|
25
|
+
type ReferrerPolicy = import("./fetch").ReferrerPolicy;
|
|
26
|
+
type Response = import("./fetch").Response;
|
|
27
|
+
type ResponseInit = import("./fetch").ResponseInit;
|
|
28
|
+
type BodyInit = import("./fetch").BodyInit;
|
|
29
|
+
type URLSearchParams = import("./url").URLSearchParams;
|
|
30
|
+
type URLSearchParamsInit = import("./url").URLSearchParamsInit;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { URLSearchParams } from "url";
|
|
2
|
+
export { URL, URLSearchParams } from "url";
|
|
3
|
+
|
|
4
|
+
export type URLSearchParamsInit =
|
|
5
|
+
| URLSearchParams
|
|
6
|
+
| string
|
|
7
|
+
| { [key: string]: Object | Object[] | undefined }
|
|
8
|
+
| Iterable<[string, Object]>
|
|
9
|
+
| Array<[string, Object]>;
|
package/src/env/index.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/// <reference lib="esnext.array" />
|
|
2
|
+
import "core-js/features/array/flat";
|
|
3
|
+
import "core-js/features/array/flat-map";
|
|
4
|
+
|
|
5
|
+
// The built-in Array.flat typings don't contain an overload for ReadonlyArray<U>[],
|
|
6
|
+
// which means the return type is inferred to be any[] instead of U[], hence this augmentation.
|
|
7
|
+
declare global {
|
|
8
|
+
interface Array<T> {
|
|
9
|
+
/**
|
|
10
|
+
* Returns a new array with all sub-array elements concatenated into it recursively up to the
|
|
11
|
+
* specified depth.
|
|
12
|
+
*
|
|
13
|
+
* @param depth The maximum recursion depth
|
|
14
|
+
*/
|
|
15
|
+
flat<U>(this: ReadonlyArray<U>[], depth?: 1): U[];
|
|
16
|
+
}
|
|
17
|
+
}
|