Compare commits
8 Commits
Author | SHA1 | Date | |
---|---|---|---|
88d4bf6be0 | |||
d4f8215f35 | |||
85f72feeb9 | |||
bd4ccbd215 | |||
79940cec3f | |||
e20508ffbc | |||
21b962b9a8 | |||
f673e8577b |
2158
package-lock.json
generated
2158
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
20
package.json
20
package.json
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@gitzone/tswatch",
|
||||
"version": "1.0.27",
|
||||
"version": "1.0.31",
|
||||
"private": false,
|
||||
"description": "watch typescript projects during development",
|
||||
"main": "dist/index.js",
|
||||
@@ -17,24 +17,24 @@
|
||||
"devDependencies": {
|
||||
"@gitzone/tsbuild": "^2.1.17",
|
||||
"@gitzone/tstest": "^1.0.28",
|
||||
"@pushrocks/tapbundle": "^3.0.13",
|
||||
"@types/node": "^12.7.12",
|
||||
"tslint": "^5.20.0",
|
||||
"@pushrocks/tapbundle": "^3.2.0",
|
||||
"@types/node": "^13.7.7",
|
||||
"tslint": "^6.0.0",
|
||||
"tslint-config-prettier": "^1.18.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@gitzone/tsbundle": "^1.0.47",
|
||||
"@gitzone/tsbundle": "^1.0.50",
|
||||
"@gitzone/tsrun": "^1.2.8",
|
||||
"@pushrocks/early": "^3.0.3",
|
||||
"@pushrocks/lik": "^3.0.11",
|
||||
"@pushrocks/lik": "^3.0.19",
|
||||
"@pushrocks/smartchok": "^1.0.23",
|
||||
"@pushrocks/smartcli": "^3.0.7",
|
||||
"@pushrocks/smartdelay": "^2.0.3",
|
||||
"@pushrocks/smartlog": "^2.0.19",
|
||||
"@pushrocks/smartdelay": "^2.0.6",
|
||||
"@pushrocks/smartlog": "^2.0.21",
|
||||
"@pushrocks/smartlog-destination-local": "^8.0.2",
|
||||
"@pushrocks/smartserve": "^1.1.37",
|
||||
"@pushrocks/smartserve": "^1.1.39",
|
||||
"@pushrocks/smartshell": "^2.0.25",
|
||||
"@pushrocks/taskbuffer": "^2.0.15"
|
||||
"@pushrocks/taskbuffer": "^2.1.1"
|
||||
},
|
||||
"files": [
|
||||
"ts/**/*",
|
||||
|
@@ -7,6 +7,7 @@ import { Watcher } from './tswatch.classes.watcher';
|
||||
export class TsWatch {
|
||||
public watchmode: interfaces.TWatchModes;
|
||||
public watcherMap = new plugins.lik.Objectmap<Watcher>();
|
||||
public smartserve: plugins.smartserve.SmartServe;
|
||||
|
||||
constructor(watchmodeArg: interfaces.TWatchModes) {
|
||||
this.watchmode = watchmodeArg;
|
||||
@@ -36,12 +37,12 @@ export class TsWatch {
|
||||
);
|
||||
break;
|
||||
case 'gitzone_element':
|
||||
const smartserve = new plugins.smartserve.SmartServe({
|
||||
// lets create a standard server
|
||||
this.smartserve = new plugins.smartserve.SmartServe({
|
||||
port: 3001,
|
||||
injectReload: true,
|
||||
serveDir: './dist_web/'
|
||||
serveDir: plugins.path.join(paths.cwd, './dist_web/')
|
||||
});
|
||||
await smartserve.start();
|
||||
this.watcherMap.add(
|
||||
new Watcher({
|
||||
filePathToWatch: plugins.path.join(paths.cwd, './ts_web/'),
|
||||
@@ -73,6 +74,15 @@ export class TsWatch {
|
||||
})
|
||||
);
|
||||
break;
|
||||
case 'gitzone_service':
|
||||
this.watcherMap.add(
|
||||
new Watcher({
|
||||
filePathToWatch: plugins.path.join(paths.cwd, './ts/'),
|
||||
commandToExecute: 'npm run startTs',
|
||||
timeout: null
|
||||
})
|
||||
);
|
||||
break;
|
||||
case 'echoSomething':
|
||||
const tsWatchInstanceEchoSomething = new Watcher({
|
||||
filePathToWatch: plugins.path.join(paths.cwd, './ts'),
|
||||
@@ -87,12 +97,18 @@ export class TsWatch {
|
||||
this.watcherMap.forEach(async watcher => {
|
||||
await watcher.start();
|
||||
});
|
||||
if (this.smartserve) {
|
||||
await this.smartserve.start();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* stops the execution of any active Watchers
|
||||
*/
|
||||
public async stop() {
|
||||
if (this.smartserve) {
|
||||
await this.smartserve.stop();
|
||||
}
|
||||
this.watcherMap.forEach(async watcher => {
|
||||
await watcher.stop();
|
||||
});
|
||||
|
@@ -55,7 +55,7 @@ export class Watcher {
|
||||
changeObservable.subscribe(() => {
|
||||
this.updateCurrentExecution();
|
||||
});
|
||||
this.updateCurrentExecution();
|
||||
await this.updateCurrentExecution();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -8,6 +8,24 @@ const tswatchCli = new plugins.smartcli.Smartcli();
|
||||
|
||||
// standard behaviour will assume gitzone setup
|
||||
|
||||
tswatchCli.addCommand('element').subscribe(async argvArg => {
|
||||
logger.log('info', `running watch task for a gitzone element project`);
|
||||
const tsWatch = new TsWatch('gitzone_element');
|
||||
await tsWatch.start();
|
||||
});
|
||||
|
||||
tswatchCli.addCommand('npm').subscribe(async argvArg => {
|
||||
logger.log('info', `running watch task for a gitzone element project`);
|
||||
const tsWatch = new TsWatch('gitzone_npm');
|
||||
await tsWatch.start();
|
||||
});
|
||||
|
||||
tswatchCli.addCommand('service').subscribe(async argvArg => {
|
||||
logger.log('info', `running test task`);
|
||||
const tsWatch = new TsWatch('gitzone_service');
|
||||
await tsWatch.start();
|
||||
});
|
||||
|
||||
tswatchCli.addCommand('test').subscribe(async argvArg => {
|
||||
logger.log('info', `running test task`);
|
||||
const tsWatch = new TsWatch('test');
|
||||
@@ -20,10 +38,4 @@ tswatchCli.addCommand('website').subscribe(async argvArg => {
|
||||
await tsWatch.start();
|
||||
});
|
||||
|
||||
tswatchCli.addCommand('element').subscribe(async argvArg => {
|
||||
logger.log('info', `running watch task for a gitzone element project`);
|
||||
const tsWatch = new TsWatch('gitzone_element');
|
||||
await tsWatch.start();
|
||||
});
|
||||
|
||||
tswatchCli.startParse();
|
||||
|
Reference in New Issue
Block a user