From 17ee959980490f39a42f5190963fbf7b5eb0e395 Mon Sep 17 00:00:00 2001 From: Philipp Kunz Date: Wed, 4 Dec 2024 23:09:54 +0100 Subject: [PATCH] fix(core): Improve async handling in TsWatch class for element and website modes --- changelog.md | 6 ++++++ ts/00_commitinfo_data.ts | 2 +- ts/tswatch.classes.tswatch.ts | 7 ++++--- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/changelog.md b/changelog.md index dfc00d5..2a78c88 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,11 @@ # Changelog +## 2024-12-04 - 2.0.33 - fix(core) +Improve async handling in TsWatch class for element and website modes + +- Ensured proper asynchronous execution for 'element' and 'website' watch modes. +- Replaced console log with logger for consistency. + ## 2024-12-04 - 2.0.32 - fix(core) Minor improvements and dependency updates diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index 19d8fd0..4cfa27f 100644 --- a/ts/00_commitinfo_data.ts +++ b/ts/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { name: '@git.zone/tswatch', - version: '2.0.32', + version: '2.0.33', description: 'watch typescript projects during development' } diff --git a/ts/tswatch.classes.tswatch.ts b/ts/tswatch.classes.tswatch.ts index 9311b3c..cb93b66 100644 --- a/ts/tswatch.classes.tswatch.ts +++ b/ts/tswatch.classes.tswatch.ts @@ -43,12 +43,13 @@ export class TsWatch { ); break; case 'element': - (async () => { + await (async () => { /** * this strategy runs a standard server and bundles the ts files to a dist_watch directory */ // lets create a standard server - console.log( + logger.log( + 'info', 'bundling TypeScript files to "dist_watch" Note: This is for development only!' ); this.typedserver = new plugins.typedserver.TypedServer({ @@ -116,7 +117,7 @@ export class TsWatch { })(); break; case 'website': - (async () => { + await (async () => { const bundleAndReloadWebsite = async () => { await tsbundle.build(paths.cwd, './ts_web/index.ts', './dist_serve/bundle.js', { bundler: 'esbuild',