How to use the @theia/application-package.environment.electron function in @theia/application-package

To help you get started, we’ve selected a few @theia/application-package examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github eclipse-theia / theia / packages / json / src / node / json-contribution.ts View on Github external
async start(clientConnection: IConnection): Promise {
        // Same as https://github.com/eclipse-theia/theia/commit/de45794a90fc1a1a590578026f8ad527127afa0a
        const command = process.execPath;
        const args: string[] = [
            path.resolve(__dirname, './json-starter'),
            '--stdio'
        ];
        const serverConnection = await this.createProcessStreamConnectionAsync(command, args, { env: environment.electron.runAsNodeEnv() });
        this.forward(clientConnection, serverConnection);
    }
github eclipse-theia / theia / packages / debug / src / node / debug-adapter-factory.ts View on Github external
private childProcess(executable: DebugAdapterExecutable): RawProcess {
        // tslint:disable-next-line:no-any
        const isForkOptions = (forkOptions: RawForkOptions | any): forkOptions is RawForkOptions =>
            !!forkOptions && !!forkOptions.modulePath;

        const processOptions: RawProcessOptions | RawForkOptions = { ...executable };
        const options: { stdio: (string | number)[], env?: object, execArgv?: string[] } = { stdio: ['pipe', 'pipe', 2] };

        if (isForkOptions(processOptions)) {
            options.stdio.push('ipc');
            options.env = environment.electron.runAsNodeEnv();
            options.execArgv = (executable as DebugAdapterForkExecutable).execArgv;
        }

        processOptions.options = options;
        return this.processFactory(processOptions);
    }
github eclipse-theia / theia / packages / typescript / src / node / typescript-contribution.ts View on Github external
async start(clientConnection: IConnection, { parameters }: TypeScriptStartOptions): Promise {
        // Re-use the same tool used to launch Theia. e.g. for an Electron Theia packaging,
        // this will be "electron" executable that is bundled with the application.
        const command = process.execPath;
        const args: string[] = [
            path.join(__dirname, 'startserver.js'),
            '--stdio'
        ];
        const tsServerPath = TypescriptVersionURI.getTsServerPath(parameters && parameters.version);
        if (tsServerPath) {
            args.push(`--tsserver-path=${tsServerPath}`);
        }
        const serverConnection = await this.createProcessStreamConnectionAsync(command, args, { env: environment.electron.runAsNodeEnv() });
        this.forward(clientConnection, serverConnection);
    }

@theia/application-package

Theia application package API.

EPL-2.0
Latest version published 14 days ago

Package Health Score

93 / 100
Full package analysis

Similar packages