Skip to content
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.

Commit

Permalink
Move sidecar fs init out of che API init
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Mäder <[email protected]>
  • Loading branch information
tsmaeder committed Aug 25, 2021
1 parent 24f40bb commit 26b9d52
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 15 deletions.
4 changes: 0 additions & 4 deletions extensions/eclipse-che-theia-plugin-ext/src/plugin/che-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ import { CheK8SImpl } from './che-k8s';
import { CheOauthImpl } from './che-oauth';
import { CheOpenshiftImpl } from './che-openshift';
import { CheProductImpl } from './che-product';
import { CheSideCarContentReaderImpl } from './che-sidecar-content-reader';
import { CheSideCarFileSystemImpl } from './che-sidecar-file-system';
import { CheSshImpl } from './che-ssh';
import { CheTelemetryImpl } from './che-telemetry';
import { CheUserImpl } from './che-user';
Expand Down Expand Up @@ -53,8 +51,6 @@ export function createAPIFactory(rpc: RPCProtocol): CheApiFactory {
const cheK8SImpl = rpc.set(PLUGIN_RPC_CONTEXT.CHE_K8S, new CheK8SImpl(rpc));
const cheUserImpl = rpc.set(PLUGIN_RPC_CONTEXT.CHE_USER, new CheUserImpl(rpc));
const cheHttpImpl = rpc.set(PLUGIN_RPC_CONTEXT.CHE_HTTP, new CheHttpImpl(rpc));
rpc.set(PLUGIN_RPC_CONTEXT.CHE_SIDERCAR_CONTENT_READER, new CheSideCarContentReaderImpl(rpc));
rpc.set(PLUGIN_RPC_CONTEXT.CHE_SIDECAR_FILE_SYSTEM, new CheSideCarFileSystemImpl(rpc));

const cheProductImpl = rpc.set(PLUGIN_RPC_CONTEXT.CHE_PRODUCT, new CheProductImpl(rpc));
const cheTelemetryImpl = rpc.set(PLUGIN_RPC_CONTEXT.CHE_TELEMETRY, new CheTelemetryImpl(rpc));
Expand Down
15 changes: 4 additions & 11 deletions extensions/eclipse-che-theia-plugin-ext/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,24 +37,17 @@ module.exports = {
],
resolve: {
fallback: {
'child_process': false,
'crypto': false,
'net': false,
'fs': false,
'crypto': false,
'os': false,
'path': false,
'constants': false,
'stream': false,
'assert': false,
'util': false

'path': false
},
extensions: ['.ts', '.js']
},
output: {
filename: 'che-api-worker-provider.js',
libraryTarget: "var",
library: "che_api_provider",
libraryTarget: 'var',
library: 'che_api_provider',
path: path.resolve(__dirname, 'lib/webworker')
}
};
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ import { LogCallback, RemoteHostTraceLogger } from './remote-trace-logger';
import { MAIN_RPC_CONTEXT, PluginDependencies, PluginDeployer, PluginDeployerEntry } from '@theia/plugin-ext';
import { OutputChannelRegistryExt, PluginDeployerHandler } from '@theia/plugin-ext/lib/common';

import { PLUGIN_RPC_CONTEXT as CHE_PLUGIN_RPC_CONTEXT } from '@eclipse-che/theia-plugin-ext/lib/common/che-protocol';
import { CheEnvVariablesServerImpl } from '@eclipse-che/theia-plugin-ext/lib/node/che-env-variables-server';
import { CheSideCarContentReaderImpl } from '@eclipse-che/theia-plugin-ext/lib/plugin/che-sidecar-content-reader';
import { CheSideCarFileSystemImpl } from '@eclipse-che/theia-plugin-ext/lib/plugin/che-sidecar-file-system';
import { Deferred } from '@theia/core/lib/common/promise-util';
import { DocumentContainerAware } from './document-container-aware';
import { Emitter } from '@theia/core/lib/common/event';
Expand Down Expand Up @@ -263,6 +266,15 @@ to pick-up automatically a free port`)
const pluginRemoteNodeImplt = new PluginRemoteNodeImpl(pluginRemoteBrowser);
webSocketClient.rpc.set(MAIN_REMOTE_RPC_CONTEXT.PLUGIN_REMOTE_NODE, pluginRemoteNodeImplt);

webSocketClient.rpc.set(
CHE_PLUGIN_RPC_CONTEXT.CHE_SIDERCAR_CONTENT_READER,
new CheSideCarContentReaderImpl(webSocketClient.rpc)
);
webSocketClient.rpc.set(
CHE_PLUGIN_RPC_CONTEXT.CHE_SIDECAR_FILE_SYSTEM,
new CheSideCarFileSystemImpl(webSocketClient.rpc)
);

const pluginHostRPC = new PluginHostRPC(webSocketClient.rpc);
pluginHostRPC.initialize();
// eslint-disable-next-line @typescript-eslint/no-explicit-any
Expand Down

0 comments on commit 26b9d52

Please sign in to comment.