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

Move sidecar fs init out of che API init #1202

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
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