fix(tswatch): Add logging to notify folder watcher creation and building processes

This commit is contained in:
Philipp Kunz 2024-12-04 22:04:41 +01:00
parent de4d7d3a2d
commit 8ad26eb358
3 changed files with 10 additions and 1 deletions

View File

@ -1,5 +1,11 @@
# Changelog
## 2024-12-04 - 2.0.28 - fix(tswatch)
Add logging to notify folder watcher creation and building processes
- Logging added to notify the creation of folder watchers.
- Logging added to indicate the start of the building process for folders.
## 2024-12-04 - 2.0.27 - fix(core)
Refactor watch mode commands and exports

View File

@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@git.zone/tswatch',
version: '2.0.27',
version: '2.0.28',
description: 'watch typescript projects during development'
}

View File

@ -3,6 +3,7 @@ import * as paths from './tswatch.paths.js';
import * as interfaces from './interfaces/index.js';
import { Watcher } from './tswatch.classes.watcher.js';
import { logger } from './tswatch.logging.js';
export class TsWatch {
public watchmode: interfaces.TWatchModes;
@ -84,10 +85,12 @@ export class TsWatch {
executor: 'bash',
});
for (const tsfolder of tsfolders) {
logger.log('info', `creating watcher for folder ${tsfolder}`);
this.watcherMap.add(
new Watcher({
filePathToWatch: plugins.path.join(paths.cwd, `./${tsfolder}/`),
functionToCall: async () => {
logger.log('info', `building ${tsfolder}`);
await smartshellInstance.exec(`npm run build`);
await this.typedserver.reload();
},