How to use @theia/application-package - 8 common examples

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);
    }
github eclipse-theia / theia / packages / filesystem / src / browser / download / file-download-command-contribution.ts View on Github external
protected isDownloadEnabled(uris: URI[]): boolean {
        return !environment.electron.is() && uris.length > 0 && uris.every(u => u.scheme === 'file');
    }
github eclipse-theia / theia / packages / extension-manager / src / node / node-extension-server.ts View on Github external
async search(param: SearchParam): Promise {
        const manager = this.project.createPackageManager();
        const query = this.prepareQuery(param.query);
        const packages = await npms.search(query, param.from, param.size);
        const extensions = [];
        for (const raw of packages) {
            if (PublishedNodePackage.is(raw)) {
                const extensionPackage = await manager.pck.findExtensionPackage(raw.name);
                if (extensionPackage) {
                    const extension = this.toRawExtension(extensionPackage);
                    extensions.push(extension);
                }
            }
        }
        return extensions;
    }
    protected prepareQuery(query: string): string {
github eclipse-theia / theia / dev-packages / application-manager / src / application-package-manager.ts View on Github external
constructor(options: ApplicationPackageOptions) {
        this.pck = new ApplicationPackage(options);
        this.process = new ApplicationProcess(this.pck, options.projectPath);
        this.__process = new ApplicationProcess(this.pck, path.join(__dirname, '..'));
        this.webpack = new WebpackGenerator(this.pck);
        this.backend = new BackendGenerator(this.pck);
        this.frontend = new FrontendGenerator(this.pck);
    }
github eclipse-theia / theia / packages / extension-manager / src / node / application-project.ts View on Github external
constructor(
        @inject(ApplicationProjectOptions) readonly options: ApplicationProjectOptions,
        @inject(FileSystemWatcherServer) protected readonly fileSystemWatcher: FileSystemWatcherServer,
        @inject(ILogger) protected readonly logger: ILogger,
        @inject(NpmClient) protected readonly npmClient: NpmClient,
    ) {
        logger.debug('AppProjectOptions', options);
        this.registry = new NpmRegistry({
            watchChanges: this.options.watchRegistry
        });
        this.backup();
        this.packageUri = FileUri.create(this.packagePath).toString();
        this.toDispose.push(this.fileSystemWatcher);
        this.fileSystemWatcher.setClient({
            onDidFilesChanged: changes => this.onDidFilesChanged(changes)
        });
        this.fileSystemWatcher.watchFileChanges(this.packageUri).then(watcher =>
            this.toDispose.push(Disposable.create(() =>
                this.fileSystemWatcher.unwatchFileChanges(watcher)
            ))
        );
        this.toDispose.push(this.onWillInstallEmitter);
        this.toDispose.push(this.onDidInstallEmitter);
    }

@theia/application-package

Theia application package API.

EPL-2.0
Latest version published 21 days ago

Package Health Score

89 / 100
Full package analysis

Similar packages