fix(core): update
This commit is contained in:
@ -3,6 +3,6 @@
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@gitzone/tswatch',
|
||||
version: '2.0.5',
|
||||
version: '2.0.6',
|
||||
description: 'watch typescript projects during development'
|
||||
}
|
||||
|
@ -7,7 +7,7 @@ import { Watcher } from './tswatch.classes.watcher.js';
|
||||
export class TsWatch {
|
||||
public watchmode: interfaces.TWatchModes;
|
||||
public watcherMap = new plugins.lik.ObjectMap<Watcher>();
|
||||
public smartserve: plugins.smartserve.SmartServe;
|
||||
public typedserver: plugins.typedserver.TypedServer;
|
||||
|
||||
constructor(watchmodeArg: interfaces.TWatchModes) {
|
||||
this.watchmode = watchmodeArg;
|
||||
@ -43,7 +43,8 @@ export class TsWatch {
|
||||
console.log(
|
||||
'bundling TypeScript files to "dist_watch" Note: This is for development only!'
|
||||
);
|
||||
const smartserve = new plugins.smartserve.SmartServe({
|
||||
this.typedserver = new plugins.typedserver.TypedServer({
|
||||
cors: true,
|
||||
injectReload: true,
|
||||
serveDir: plugins.path.join(paths.cwd, './dist_watch/'),
|
||||
port: 3002,
|
||||
@ -53,7 +54,7 @@ export class TsWatch {
|
||||
await tsbundle.build(paths.cwd, './html/index.ts', './dist_watch/bundle.js', {
|
||||
bundler: 'esbuild',
|
||||
});
|
||||
await smartserve.reload();
|
||||
await this.typedserver.reload();
|
||||
};
|
||||
this.watcherMap.add(
|
||||
new Watcher({
|
||||
@ -78,7 +79,7 @@ export class TsWatch {
|
||||
timeout: null,
|
||||
})
|
||||
);
|
||||
await smartserve.start();
|
||||
await this.typedserver.start();
|
||||
break;
|
||||
case 'gitzone_website':
|
||||
this.watcherMap.add(
|
||||
@ -140,8 +141,8 @@ export class TsWatch {
|
||||
this.watcherMap.forEach(async (watcher) => {
|
||||
await watcher.start();
|
||||
});
|
||||
if (this.smartserve) {
|
||||
await this.smartserve.start();
|
||||
if (this.typedserver) {
|
||||
await this.typedserver.start();
|
||||
}
|
||||
}
|
||||
|
||||
@ -149,8 +150,8 @@ export class TsWatch {
|
||||
* stops the execution of any active Watchers
|
||||
*/
|
||||
public async stop() {
|
||||
if (this.smartserve) {
|
||||
await this.smartserve.stop();
|
||||
if (this.typedserver) {
|
||||
await this.typedserver.stop();
|
||||
}
|
||||
this.watcherMap.forEach(async (watcher) => {
|
||||
await watcher.stop();
|
||||
|
@ -8,6 +8,13 @@ export {
|
||||
tsbundle
|
||||
}
|
||||
|
||||
// @apiglobal scope
|
||||
import * as typedserver from '@apiglobal/typedserver';
|
||||
|
||||
export {
|
||||
typedserver,
|
||||
}
|
||||
|
||||
// @pushrocks scope
|
||||
import * as lik from '@pushrocks/lik';
|
||||
import * as smartchok from '@pushrocks/smartchok';
|
||||
@ -15,7 +22,6 @@ import * as smartcli from '@pushrocks/smartcli';
|
||||
import * as smartdelay from '@pushrocks/smartdelay';
|
||||
import * as smartlog from '@pushrocks/smartlog';
|
||||
import * as smartlogDestinationLocal from '@pushrocks/smartlog-destination-local';
|
||||
import * as smartserve from '@pushrocks/smartserve';
|
||||
import * as smartshell from '@pushrocks/smartshell';
|
||||
import * as taskbuffer from '@pushrocks/taskbuffer';
|
||||
|
||||
@ -26,7 +32,6 @@ export {
|
||||
smartdelay,
|
||||
smartlog,
|
||||
smartlogDestinationLocal,
|
||||
smartserve,
|
||||
smartshell,
|
||||
taskbuffer,
|
||||
};
|
||||
|
Reference in New Issue
Block a user