Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
3a8513d3a0 | |||
d425e290dd | |||
483aafd371 | |||
2a2a6fe461 | |||
843453f9d4 | |||
9b6e3e49f4 |
1111
package-lock.json
generated
1111
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
27
package.json
27
package.json
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@gitzone/tswatch",
|
"name": "@gitzone/tswatch",
|
||||||
"version": "1.0.3",
|
"version": "1.0.6",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "watch typescript projects during development",
|
"description": "watch typescript projects during development",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
@@ -14,18 +14,21 @@
|
|||||||
"format": "(gitzone format)"
|
"format": "(gitzone format)"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@gitzone/tsbuild": "^2.0.22",
|
"@gitzone/tsbuild": "^2.1.11",
|
||||||
"@gitzone/tstest": "^1.0.15",
|
"@gitzone/tstest": "^1.0.20",
|
||||||
"@pushrocks/tapbundle": "^3.0.7",
|
"@pushrocks/tapbundle": "^3.0.9",
|
||||||
"@types/node": "^10.11.7",
|
"@types/node": "^12.0.0",
|
||||||
"tslint": "^5.11.0",
|
"tslint": "^5.16.0",
|
||||||
"tslint-config-prettier": "^1.15.0"
|
"tslint-config-prettier": "^1.18.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@gitzone/tsrun": "^1.1.13",
|
"@gitzone/tsrun": "^1.2.6",
|
||||||
"@pushrocks/smartcli": "^3.0.6",
|
"@pushrocks/early": "^3.0.3",
|
||||||
"@pushrocks/smartdelay": "^2.0.2",
|
"@pushrocks/smartchok": "^1.0.18",
|
||||||
"@pushrocks/smartshell": "^2.0.8",
|
"@pushrocks/smartcli": "^3.0.7",
|
||||||
"filewatcher": "^3.0.1"
|
"@pushrocks/smartdelay": "^2.0.3",
|
||||||
|
"@pushrocks/smartlog": "^2.0.19",
|
||||||
|
"@pushrocks/smartlog-destination-local": "^7.0.5",
|
||||||
|
"@pushrocks/smartshell": "^2.0.13"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,3 +1,5 @@
|
|||||||
|
import * as early from '@pushrocks/early';
|
||||||
|
early.start('tswatch');
|
||||||
export * from './tswatch.classes.tswatch';
|
export * from './tswatch.classes.tswatch';
|
||||||
|
import './tswatch.cli';
|
||||||
import './tswatch.cli';
|
early.stop();
|
@@ -14,7 +14,7 @@ export class TsWatch {
|
|||||||
executor: 'bash'
|
executor: 'bash'
|
||||||
});
|
});
|
||||||
private currentExecution: plugins.smartshell.IExecResultStreaming;
|
private currentExecution: plugins.smartshell.IExecResultStreaming;
|
||||||
private watcher = plugins.fileWatcher();
|
private watcher = new plugins.smartchok.Smartchok([], {});
|
||||||
private options: ITsWatchConstructorOptions;
|
private options: ITsWatchConstructorOptions;
|
||||||
|
|
||||||
constructor(optionsArg: ITsWatchConstructorOptions) {
|
constructor(optionsArg: ITsWatchConstructorOptions) {
|
||||||
@@ -27,14 +27,11 @@ export class TsWatch {
|
|||||||
public async start() {
|
public async start() {
|
||||||
this.setupCleanup();
|
this.setupCleanup();
|
||||||
console.log(`Looking at ${this.options.filePathToWatch} for changes`);
|
console.log(`Looking at ${this.options.filePathToWatch} for changes`);
|
||||||
this.watcher.add(this.options.filePathToWatch); // __dirname refers to the directory of this very file
|
this.watcher.add([this.options.filePathToWatch]); // __dirname refers to the directory of this very file
|
||||||
this.watcher.on('change', async (file, stat) => {
|
const changeObservable = await this.watcher.getObservableFor('change');
|
||||||
console.log('Noticed change!');
|
changeObservable.subscribe(() => {
|
||||||
if (!stat) {
|
|
||||||
console.log('deleted');
|
|
||||||
}
|
|
||||||
this.updateCurrentExecution();
|
this.updateCurrentExecution();
|
||||||
});
|
})
|
||||||
this.updateCurrentExecution();
|
this.updateCurrentExecution();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,11 +1,15 @@
|
|||||||
import * as plugins from './tswatch.plugins';
|
import * as plugins from './tswatch.plugins';
|
||||||
import * as paths from './tswatch.paths';
|
import * as paths from './tswatch.paths';
|
||||||
|
import { logger } from './tswatch.logging';
|
||||||
|
|
||||||
import { TsWatch } from './tswatch.classes.tswatch';
|
import { TsWatch } from './tswatch.classes.tswatch';
|
||||||
|
|
||||||
const tswatchCli = new plugins.smartcli.Smartcli();
|
const tswatchCli = new plugins.smartcli.Smartcli();
|
||||||
|
|
||||||
|
// standard behaviour will assume gitzone setup
|
||||||
|
|
||||||
tswatchCli.addCommand('test').subscribe(argvArg => {
|
tswatchCli.addCommand('test').subscribe(argvArg => {
|
||||||
|
logger.log('info', `running test task`);
|
||||||
const tsWatch = new TsWatch({
|
const tsWatch = new TsWatch({
|
||||||
filePathToWatch: paths.cwd,
|
filePathToWatch: paths.cwd,
|
||||||
commandToExecute: 'npm run test2',
|
commandToExecute: 'npm run test2',
|
||||||
|
15
ts/tswatch.logging.ts
Normal file
15
ts/tswatch.logging.ts
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
import * as plugins from './tswatch.plugins';
|
||||||
|
|
||||||
|
export const logger = new plugins.smartlog.Smartlog({
|
||||||
|
logContext: {
|
||||||
|
company: 'Some Company',
|
||||||
|
companyunit: 'Some CompanyUnit',
|
||||||
|
containerName: 'Some Containername',
|
||||||
|
environment: "local",
|
||||||
|
runtime: 'node',
|
||||||
|
zone: 'gitzone'
|
||||||
|
},
|
||||||
|
minimumLogLevel: 'silly'
|
||||||
|
});
|
||||||
|
|
||||||
|
logger.addLogDestination(new plugins.smartlogDestinationLocal.DestinationLocal());
|
@@ -2,13 +2,11 @@ import * as path from 'path';
|
|||||||
export { path };
|
export { path };
|
||||||
|
|
||||||
// @pushrocks scope
|
// @pushrocks scope
|
||||||
|
import * as smartchok from '@pushrocks/smartchok';
|
||||||
import * as smartcli from '@pushrocks/smartcli';
|
import * as smartcli from '@pushrocks/smartcli';
|
||||||
import * as smartdelay from '@pushrocks/smartdelay';
|
import * as smartdelay from '@pushrocks/smartdelay';
|
||||||
|
import * as smartlog from '@pushrocks/smartlog';
|
||||||
|
import * as smartlogDestinationLocal from '@pushrocks/smartlog-destination-local';
|
||||||
import * as smartshell from '@pushrocks/smartshell';
|
import * as smartshell from '@pushrocks/smartshell';
|
||||||
|
|
||||||
export { smartdelay, smartshell, smartcli };
|
export { smartchok, smartcli, smartdelay, smartlog, smartlogDestinationLocal, smartshell, };
|
||||||
|
|
||||||
// Third Pary
|
|
||||||
import * as fileWatcher from 'filewatcher';
|
|
||||||
|
|
||||||
export { fileWatcher };
|
|
||||||
|
Reference in New Issue
Block a user