From 7fb38712629d99ed63d39ee5dfb46afd5d4c21d1 Mon Sep 17 00:00:00 2001 From: Oleksandr Andriienko Date: Wed, 2 Oct 2019 15:22:18 +0300 Subject: [PATCH] Use theia-plugin-ext from node_modules. Signed-off-by: Oleksandr Andriienko --- .../src/node/che-plugin-api-provider.ts | 2 +- .../src/node/plugin-remote-backend-module.ts | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/extensions/eclipse-che-theia-plugin-ext/src/node/che-plugin-api-provider.ts b/extensions/eclipse-che-theia-plugin-ext/src/node/che-plugin-api-provider.ts index f90a293d3..a56b85065 100644 --- a/extensions/eclipse-che-theia-plugin-ext/src/node/che-plugin-api-provider.ts +++ b/extensions/eclipse-che-theia-plugin-ext/src/node/che-plugin-api-provider.ts @@ -22,7 +22,7 @@ export class ChePluginApiProvider implements ExtPluginApiProvider { initFunction: 'initializeApi', initVariable: 'che_api_provider' }, - backendInitPath: path.join(__dirname, '../plugin/node/che-api-node-provider.js') + backendInitPath: path.join('@eclipse-che/theia-plugin-ext/lib/plugin/node/che-api-node-provider.js') }; } diff --git a/extensions/eclipse-che-theia-plugin-remote/src/node/plugin-remote-backend-module.ts b/extensions/eclipse-che-theia-plugin-remote/src/node/plugin-remote-backend-module.ts index a33b9623c..d88d26a10 100644 --- a/extensions/eclipse-che-theia-plugin-remote/src/node/plugin-remote-backend-module.ts +++ b/extensions/eclipse-che-theia-plugin-remote/src/node/plugin-remote-backend-module.ts @@ -27,6 +27,12 @@ const localModule = ConnectionContainerModule.create(({ bind }) => { }); export default new ContainerModule(bind => { + try { + // Force to include theia-plugin-ext inside node_modules + require('@eclipse-che/theia-plugin-ext/lib/node/che-plugin-api-provider.js'); + } catch (err) { + console.log('Unable to set up che theia plugin api: ', err); + } bind(HostedPluginMapping).toSelf().inSingletonScope(); bind(MetadataProcessor).to(RemoteMetadataProcessor).inSingletonScope(); bind(PluginReaderExtension).toSelf().inSingletonScope();