Skip to content

Commit

Permalink
fix vscode-graphql bundling, update vsce, remove escape-html (#2802) …
Browse files Browse the repository at this point in the history
…solves #2801
  • Loading branch information
acao authored Oct 10, 2022
1 parent 082da7d commit d291b76
Show file tree
Hide file tree
Showing 10 changed files with 161 additions and 137 deletions.
6 changes: 6 additions & 0 deletions .changeset/fresh-starfishes-rhyme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'vscode-graphql': patch
'vscode-graphql-execution': patch
---

fix bug with vscode-graphql-execution
14 changes: 14 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,20 @@
"kind": "build",
"isDefault": true
}
},
{
"label": "watch-vscode-exec",
"type": "npm",
"script": "watch-vscode-exec",
"problemMatcher": ["$tsc-watch"],
"isBackground": true,
"presentation": {
"reveal": "always"
},
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@
"build:packages": "yarn tsc",
"build:watch": "yarn tsc --watch",
"watch": "yarn build:watch",
"watch-vscode": "concurrently --raw \"yarn tsc && yarn tsc --watch\" \"yarn workspace vscode-graphql run compile --watch\"",
"watch-vscode-exec": "concurrently --raw \"yarn tsc && yarn tsc --watch\" \"yarn workspace vscode-graphql-exec run compile --watch\"",
"check": "yarn tsc --dry",
"watch-vscode": "concurrently --raw \"yarn tsc && yarn build:watch\" \"yarn workspace vscode-graphql run compile --watch\"",
"watch-vscode-exec": "yarn build:watch",
"check": "yarn tsc --noEmit",
"cypress-open": "yarn workspace graphiql cypress-open",
"dev-graphiql": "yarn workspace graphiql dev",
"e2e": "yarn run e2e:build && yarn workspace graphiql e2e",
Expand Down
5 changes: 5 additions & 0 deletions packages/vscode-graphql-execution/.vscodeignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
src/
tsconfig.json
yarn-error.log
**/*.tsbuildinfo
**/*.d.ts
10 changes: 3 additions & 7 deletions packages/vscode-graphql-execution/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,8 @@
"url": "https://github.com/graphql/graphiql",
"directory": "packages/vscode-graphql-execution"
},
"homepage": "https://github.com/graphql/graphiql/blob/main/packages/vscode-graphql-inline-exec/README.md",
"homepage": "https://github.com/graphql/graphiql/blob/main/packages/vscode-graphql-execution/README.md",
"scripts": {
"compile": "yarn tsc",
"vsce:package": "vsce package --yarn",
"vsce:prepublish": "npm run vsce:package",
"vsce:publish": "vsce publish --yarn",
Expand All @@ -98,18 +97,15 @@
"@types/node": "16.11.26",
"@types/node-fetch": "3.0.3",
"@types/vscode": "1.62.0",
"@types/escape-html": "^1.0.2",
"@types/ws": "8.2.2",
"esbuild": "0.15.1",
"esbuild": "0.15.10",
"ovsx": "0.3.0",
"vsce": "2.6.7"
"vsce": "^2.11.0"
},
"dependencies": {
"@urql/core": "2.6.1",
"babel-polyfill": "6.26.0",
"capitalize": "2.0.4",
"dotenv": "10.0.0",
"escape-html": "1.0.3",
"graphql-config": "4.3.0",
"graphql-tag": "2.12.6",
"graphql-ws": "5.10.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/vscode-graphql-execution/src/helpers/source.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export class SourceHelper {
JSON.parse(value);
return null;
} catch {
return false;
return undefined;
}
}
} catch {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {
WebviewPanel,
WorkspaceFolder,
} from 'vscode';
import escapeHtml from 'escape-html';
import type { ExtractedTemplateLiteral } from '../helpers/source';
import { loadConfig, GraphQLProjectConfig } from 'graphql-config';
import { visit, VariableDefinitionNode } from 'graphql';
Expand Down Expand Up @@ -202,9 +201,9 @@ export class GraphQLContentProvider implements TextDocumentContentProvider {

const updateCallback = (data: string, operation: string) => {
if (operation === 'subscription') {
this.html = `<pre>${escapeHtml(data)}</pre>` + this.html;
this.html = `<pre>${data}</pre>` + this.html;
} else {
this.html += `<pre>${escapeHtml(data)}</pre>`;
this.html += `<pre>${data}</pre>`;
}
this.update(this.uri);
this.updatePanel();
Expand Down
4 changes: 2 additions & 2 deletions packages/vscode-graphql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,9 @@
"devDependencies": {
"@types/capitalize": "2.0.0",
"@types/vscode": "1.62.0",
"esbuild": "0.15.1",
"esbuild": "0.15.10",
"ovsx": "0.3.0",
"vsce": "^2.7.0"
"vsce": "^2.11.0"
},
"dependencies": {
"graphql": "^16.4.0",
Expand Down
3 changes: 3 additions & 0 deletions resources/tsconfig.build.cjs.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
},
{
"path": "../packages/vscode-graphql"
},
{
"path": "../packages/vscode-graphql-execution"
}
]
}
243 changes: 122 additions & 121 deletions yarn.lock

Large diffs are not rendered by default.

0 comments on commit d291b76

Please sign in to comment.