Compare commits
9 Commits
Author | SHA1 | Date | |
---|---|---|---|
fcd2029744 | |||
d89e0a13d5 | |||
64c7815bca | |||
f3e69eb15e | |||
386e4c07c6 | |||
82557c96d6 | |||
c94d89fa8a | |||
639a5eebea | |||
fb88d3384e |
@@ -1,7 +0,0 @@
|
|||||||
{
|
|
||||||
"compilerOptions": {
|
|
||||||
"esModuleInterop": true,
|
|
||||||
"lib": ["es2015"],
|
|
||||||
"target": "ES2017"
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,3 +0,0 @@
|
|||||||
[Trash Info]
|
|
||||||
Path=/home/coder/project/tsconfig.json
|
|
||||||
DeletionDate=2019-05-08T21:54:46.502Z
|
|
2
package-lock.json
generated
2
package-lock.json
generated
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@gitzone/tswatch",
|
"name": "@gitzone/tswatch",
|
||||||
"version": "1.0.8",
|
"version": "1.0.13",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
@@ -1,12 +1,15 @@
|
|||||||
{
|
{
|
||||||
"name": "@gitzone/tswatch",
|
"name": "@gitzone/tswatch",
|
||||||
"version": "1.0.8",
|
"version": "1.0.13",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "watch typescript projects during development",
|
"description": "watch typescript projects during development",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"typings": "dist/index.d.ts",
|
"typings": "dist/index.d.ts",
|
||||||
"author": "Lossless GmbH",
|
"author": "Lossless GmbH",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"bin": {
|
||||||
|
"tswatch": "cli.js"
|
||||||
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "(tstest test/)",
|
"test": "(tstest test/)",
|
||||||
"build": "(tsbuild)",
|
"build": "(tsbuild)",
|
||||||
|
@@ -15,31 +15,38 @@ export class TsWatch {
|
|||||||
/**
|
/**
|
||||||
* starts the TsWatch instance
|
* starts the TsWatch instance
|
||||||
*/
|
*/
|
||||||
public async start () {
|
public async start() {
|
||||||
switch (this.watchmode) {
|
switch (this.watchmode) {
|
||||||
case 'test':
|
case 'test':
|
||||||
const tsWatchInstanceTest = new Watcher({
|
this.watcherMap.add(new Watcher({
|
||||||
filePathToWatch: paths.cwd,
|
filePathToWatch: paths.cwd,
|
||||||
commandToExecute: 'npm run test2',
|
commandToExecute: 'npm run test2',
|
||||||
timeout: null
|
timeout: null
|
||||||
});
|
}));
|
||||||
this.watcherMap.add(tsWatchInstanceTest);
|
|
||||||
break;
|
break;
|
||||||
case 'gitzone_npm':
|
case 'gitzone_npm':
|
||||||
const tsWatchInstanceGitzoneNpm = new Watcher({
|
this.watcherMap.add(new Watcher({
|
||||||
filePathToWatch: paths.cwd,
|
filePathToWatch: paths.cwd,
|
||||||
commandToExecute: 'npm run test',
|
commandToExecute: 'npm run test',
|
||||||
timeout: null
|
timeout: null
|
||||||
});
|
}));
|
||||||
this.watcherMap.add(tsWatchInstanceGitzoneNpm);
|
|
||||||
break;
|
break;
|
||||||
case 'gitzone_website':
|
case 'gitzone_website':
|
||||||
const tsWatchInstanceGitzoneWebsite = new Watcher({
|
// server directory
|
||||||
filePathToWatch: paths.cwd,
|
this.watcherMap.add(
|
||||||
commandToExecute: 'npm run test',
|
new Watcher({
|
||||||
|
filePathToWatch: plugins.path.join(paths.cwd, './ts/'),
|
||||||
|
commandToExecute: 'npm run start',
|
||||||
timeout: null
|
timeout: null
|
||||||
});
|
})
|
||||||
this.watcherMap.add(tsWatchInstanceGitzoneWebsite);
|
);
|
||||||
|
|
||||||
|
// client directory
|
||||||
|
this.watcherMap.add(new Watcher({
|
||||||
|
filePathToWatch: plugins.path.join(paths.cwd, './ts_web/'),
|
||||||
|
commandToExecute: 'npm run build',
|
||||||
|
timeout: null
|
||||||
|
}));
|
||||||
break;
|
break;
|
||||||
case 'echoSomething':
|
case 'echoSomething':
|
||||||
const tsWatchInstanceEchoSomething = new Watcher({
|
const tsWatchInstanceEchoSomething = new Watcher({
|
||||||
@@ -60,9 +67,9 @@ export class TsWatch {
|
|||||||
/**
|
/**
|
||||||
* stops the execution of any active Watchers
|
* stops the execution of any active Watchers
|
||||||
*/
|
*/
|
||||||
public async stop () {
|
public async stop() {
|
||||||
this.watcherMap.forEach(async watcher => {
|
this.watcherMap.forEach(async watcher => {
|
||||||
await watcher.stop();
|
await watcher.stop();
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -14,4 +14,10 @@ tswatchCli.addCommand('test').subscribe(async argvArg => {
|
|||||||
await tsWatch.start();
|
await tsWatch.start();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
tswatchCli.addCommand('website').subscribe(async argvArg => {
|
||||||
|
logger.log('info', `running watch task for a gitzone website project`);
|
||||||
|
const tsWatch = new TsWatch('gitzone_website');
|
||||||
|
await tsWatch.start();
|
||||||
|
});
|
||||||
|
|
||||||
tswatchCli.startParse();
|
tswatchCli.startParse();
|
||||||
|
Reference in New Issue
Block a user