Skip to content
This repository has been archived by the owner on Jan 12, 2024. It is now read-only.

Commit

Permalink
Launch Yeoman Generator in separate thread (#6)
Browse files Browse the repository at this point in the history
* Run Yeoman generator in separate node instance

Signed-off-by: Vitaliy Gulyy <[email protected]>
  • Loading branch information
vitaliy-guliy authored and benoitf committed Jan 13, 2020
1 parent 914502c commit 7a0f742
Show file tree
Hide file tree
Showing 8 changed files with 762 additions and 532 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"prepare": "yarn run clean && yarn run build",
"clean": "rimraf lib",
"format-code": "tsfmt -r",
"build": "yarn run format-code && yarn run compile && yarn run tslint-fix && theia:plugin pack",
"build": "yarn run format-code && yarn run compile && yarn run tslint-fix && theia-plugin pack",
"compile": "tsc",
"watch": "tsc -watch",
"tslint-fix": "tslint --fix --project .",
Expand All @@ -34,7 +34,7 @@
"theiaPlugin": "latest"
},
"theiaPlugin": {
"backend": "lib/theia-yeoman-plugin-backend-plugin.js"
"backend": "lib/theia-yeoman-backend-plugin.js"
},
"dependencies": {
"yeoman-environment": "2.3.0"
Expand Down
180 changes: 0 additions & 180 deletions src/theia-yeoman-adapter.ts

This file was deleted.

38 changes: 38 additions & 0 deletions src/theia-yeoman-backend-plugin.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*********************************************************************
* Copyright (c) 2019 Red Hat, Inc.
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
* which is available at https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
**********************************************************************/

import * as theia from '@theia/plugin';

import { YeomanProcessAdapter } from './yeoman-process-adapter';

/**
* Entry point of the plug-in.
* Once starting the plug-in, register a command to start Yeoman wizard.
*/
export function start(context: theia.PluginContext) {
const yeomanWizardCommand = {
id: 'theia-yeoman-plugin-wizard',
label: "Yeoman Wizard"
};

theia.commands.registerCommand(yeomanWizardCommand, (...args: any[]) => {
showWizard(context);
});
}

let yeoman: YeomanProcessAdapter | undefined;

function showWizard(context: theia.PluginContext) {
if (yeoman) {
yeoman.destroy();
}

yeoman = new YeomanProcessAdapter((context as any).extensionPath);
}
2 changes: 1 addition & 1 deletion src/theia-yeoman-environment.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*********************************************************************
* Copyright (c) 2018 Red Hat, Inc.
* Copyright (c) 2019 Red Hat, Inc.
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
Expand Down
99 changes: 0 additions & 99 deletions src/theia-yeoman-plugin-backend-plugin.ts

This file was deleted.

Loading

0 comments on commit 7a0f742

Please sign in to comment.