fix(core): Improve async handling in TsWatch class for element and website modes

This commit is contained in:
Philipp Kunz 2024-12-04 23:09:54 +01:00
parent 62d1fe0a35
commit 17ee959980
3 changed files with 11 additions and 4 deletions

View File

@ -1,5 +1,11 @@
# Changelog # 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) ## 2024-12-04 - 2.0.32 - fix(core)
Minor improvements and dependency updates Minor improvements and dependency updates

View File

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

View File

@ -43,12 +43,13 @@ export class TsWatch {
); );
break; break;
case 'element': case 'element':
(async () => { await (async () => {
/** /**
* this strategy runs a standard server and bundles the ts files to a dist_watch directory * this strategy runs a standard server and bundles the ts files to a dist_watch directory
*/ */
// lets create a standard server // lets create a standard server
console.log( logger.log(
'info',
'bundling TypeScript files to "dist_watch" Note: This is for development only!' 'bundling TypeScript files to "dist_watch" Note: This is for development only!'
); );
this.typedserver = new plugins.typedserver.TypedServer({ this.typedserver = new plugins.typedserver.TypedServer({
@ -116,7 +117,7 @@ export class TsWatch {
})(); })();
break; break;
case 'website': case 'website':
(async () => { await (async () => {
const bundleAndReloadWebsite = async () => { const bundleAndReloadWebsite = async () => {
await tsbundle.build(paths.cwd, './ts_web/index.ts', './dist_serve/bundle.js', { await tsbundle.build(paths.cwd, './ts_web/index.ts', './dist_serve/bundle.js', {
bundler: 'esbuild', bundler: 'esbuild',