Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/afraid-nails-trade.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"graphql-language-service": patch
"monaco-graphql": patch
---

fix: export `monaco-graphql` esm with esm modules, also fix issues with worker manager, resolves #1706 & #1791
4 changes: 3 additions & 1 deletion packages/graphql-language-service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@
},
"dependencies": {
"graphql-language-service-interface": "^2.8.2",
"graphql-language-service-types": "^1.8.0"
"graphql-language-service-parser": "^1.9.2",
"graphql-language-service-types": "^1.8.2",
"graphql-language-service-utils": "^2.5.3"
},
"devDependencies": {
"graphql": "experimental-stream-defer"
Expand Down
11 changes: 11 additions & 0 deletions packages/monaco-graphql/src/GraphQLWorker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,3 +124,14 @@ export class GraphQLWorker {
return '';
}
}

export default {
GraphQLWorker,
};

export function create(
ctx: worker.IWorkerContext,
createData: ICreateData,
): GraphQLWorker {
return new GraphQLWorker(ctx, createData);
}
2 changes: 1 addition & 1 deletion packages/monaco-graphql/src/monaco.contribution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
modeConfigurationDefault,
} from './api';

import * as monaco from 'monaco-editor/esm/vs/editor/editor.api';
import * as monaco from 'monaco-editor';

export * from './typings';

Expand Down
6 changes: 3 additions & 3 deletions packages/monaco-graphql/src/workerManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* LICENSE file in the root directory of this source tree.
*/

import { editor as monacoEditor } from 'monaco-editor/esm/vs/editor/editor.api';
import { editor as monacoEditor } from 'monaco-editor';
import { LanguageServiceAPI } from './api';
import { GraphQLWorker } from './GraphQLWorker';

Expand Down Expand Up @@ -68,7 +68,7 @@ export class WorkerManager {
if (!this._client) {
this._worker = monacoEditor.createWebWorker<GraphQLWorker>({
// module that exports the create() method and returns a `GraphQLWorker` instance
moduleId: 'vs/language/graphql/graphqlWorker',
moduleId: 'monaco-graphql/esm/GraphQLWorker.js',

label: this._defaults.languageId,
// passed in to the create() method
Expand All @@ -86,7 +86,7 @@ export class WorkerManager {
try {
this._client = await this._worker.getProxy();
} catch (error) {
throw Error('Error loading serviceworker proxy');
// throw Error(error);
}
}
return this._client as GraphQLWorker;
Expand Down
2 changes: 1 addition & 1 deletion packages/monaco-graphql/tsconfig.esm.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"extends": "../../resources/tsconfig.base.esm.json",
"compilerOptions": {
"module": "amd",
"module": "ESNext",
"moduleResolution": "node",
"baseUrl": ".",
"rootDir": "./src",
Expand Down