From 98a16dd181fb4e24967fb2b867a902079742fe1d Mon Sep 17 00:00:00 2001 From: Philipp Kunz Date: Mon, 9 Dec 2024 02:44:35 +0100 Subject: [PATCH] fix(core): Fixed website watch mode execution method --- changelog.md | 6 ++++++ package.json | 2 +- pnpm-lock.yaml | 28 ++++++++++++++-------------- ts/00_commitinfo_data.ts | 2 +- ts/tswatch.classes.tswatch.ts | 5 ++++- 5 files changed, 26 insertions(+), 17 deletions(-) diff --git a/changelog.md b/changelog.md index 77e7905..bc04237 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,11 @@ # Changelog +## 2024-12-09 - 2.0.35 - fix(core) +Fixed website watch mode execution method + +- Replaced direct shell command execution with SmartExecution instance for website mode. +- Updated dependency version for @push.rocks/smartshell to ^3.1.0. + ## 2024-12-04 - 2.0.34 - fix(TsWatch) Fix reloading issue for tsfolder changes in element mode. diff --git a/package.json b/package.json index 0b8e65a..da95972 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "@push.rocks/smartfile": "^11.0.21", "@push.rocks/smartlog": "^3.0.7", "@push.rocks/smartlog-destination-local": "^9.0.2", - "@push.rocks/smartshell": "^3.0.6", + "@push.rocks/smartshell": "^3.1.0", "@push.rocks/taskbuffer": "^3.1.7" }, "files": [ diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 34f4c3a..7c63e1e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -42,8 +42,8 @@ importers: specifier: ^9.0.2 version: 9.0.2 '@push.rocks/smartshell': - specifier: ^3.0.6 - version: 3.0.6 + specifier: ^3.1.0 + version: 3.1.0 '@push.rocks/taskbuffer': specifier: ^3.1.7 version: 3.1.7 @@ -848,8 +848,8 @@ packages: '@push.rocks/smarts3@2.2.5': resolution: {integrity: sha512-OZjD0jBCUTJCLnwraxBcyZ3he5buXf2OEM1zipiTBChA2EcKUZWKk/a6KR5WT+NlFCIIuB23UG+U+cxsIWM91Q==} - '@push.rocks/smartshell@3.0.6': - resolution: {integrity: sha512-j3SgNyq1K3i7NVk5a2+5QkG/9ac30eC3OsOAMXVxOczYceMXRiXIr9yow3t/+na14/zSYd8He2N0vYPtYqKeSQ==} + '@push.rocks/smartshell@3.1.0': + resolution: {integrity: sha512-j0gNSReRaOszjLQ0bCEvF1PxYc/df9BTvNaHCB/lEK9PfDVijE4aTPiMdIXWmcF0q/4M1ko73vgcN/VNuhM/Mw==} '@push.rocks/smartsitemap@2.0.3': resolution: {integrity: sha512-jIcms8V1b2mt3dS4PKNlLR1DRC8pCDWMRVbnyM/2+snZOJZonQRlQzAyX8No0EfLbfdrfnxv2IjPX13X29Re6g==} @@ -3945,9 +3945,9 @@ packages: engines: {node: '>= 8'} hasBin: true - which@4.0.0: - resolution: {integrity: sha512-GlaYyEb07DPxYCKhKzplCWBJtvxZcZMrL+4UkrTSJHHPyZU4mYYTv3qaOe77H7EODLSSopAUFAc6W8U4yqvscg==} - engines: {node: ^16.13.0 || >=18.0.0} + which@5.0.0: + resolution: {integrity: sha512-JEdGzHwwkrbWoGOlIHqQ5gtprKGOenpDHpxE9zVR1bWbOtYRyPPHMe9FaP6x61CmNaTThSkb0DAJte5jD+DmzQ==} + engines: {node: ^18.17.0 || >=20.5.0} hasBin: true winston-transport@4.9.0: @@ -4991,14 +4991,14 @@ snapshots: '@push.rocks/smartlog': 3.0.7 '@push.rocks/smartnpm': 2.0.4 '@push.rocks/smartpath': 5.0.18 - '@push.rocks/smartshell': 3.0.6 + '@push.rocks/smartshell': 3.1.0 transitivePeerDependencies: - aws-crt '@git.zone/tsrun@1.3.3': dependencies: '@push.rocks/smartfile': 11.0.21 - '@push.rocks/smartshell': 3.0.6 + '@push.rocks/smartshell': 3.1.0 tsx: 4.19.2 '@git.zone/tstest@1.0.90(@aws-sdk/client-sso-oidc@3.699.0(@aws-sdk/client-sts@3.699.0))(@aws-sdk/credential-providers@3.699.0(@aws-sdk/client-sso-oidc@3.699.0(@aws-sdk/client-sts@3.699.0)))(socks@2.8.3)': @@ -5012,7 +5012,7 @@ snapshots: '@push.rocks/smartfile': 11.0.21 '@push.rocks/smartlog': 3.0.7 '@push.rocks/smartpromise': 4.0.4 - '@push.rocks/smartshell': 3.0.6 + '@push.rocks/smartshell': 3.1.0 '@push.rocks/tapbundle': 5.5.3(@aws-sdk/client-sso-oidc@3.699.0(@aws-sdk/client-sts@3.699.0))(@aws-sdk/credential-providers@3.699.0(@aws-sdk/client-sso-oidc@3.699.0(@aws-sdk/client-sts@3.699.0)))(socks@2.8.3) '@types/ws': 8.5.12 figures: 6.1.0 @@ -5606,14 +5606,14 @@ snapshots: - aws-crt - supports-color - '@push.rocks/smartshell@3.0.6': + '@push.rocks/smartshell@3.1.0': dependencies: '@push.rocks/smartdelay': 3.0.5 '@push.rocks/smartexit': 1.0.23 '@push.rocks/smartpromise': 4.0.4 '@types/which': 3.0.4 tree-kill: 1.2.2 - which: 4.0.0 + which: 5.0.0 '@push.rocks/smartsitemap@2.0.3': dependencies: @@ -5746,7 +5746,7 @@ snapshots: '@push.rocks/smartpromise': 4.0.4 '@push.rocks/smartrequest': 2.0.23 '@push.rocks/smarts3': 2.2.5 - '@push.rocks/smartshell': 3.0.6 + '@push.rocks/smartshell': 3.1.0 '@push.rocks/smarttime': 4.0.8 expect: 29.7.0 transitivePeerDependencies: @@ -9476,7 +9476,7 @@ snapshots: dependencies: isexe: 2.0.0 - which@4.0.0: + which@5.0.0: dependencies: isexe: 3.1.1 diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index 601b17a..e6a33ff 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.34', + version: '2.0.35', description: 'watch typescript projects during development' } diff --git a/ts/tswatch.classes.tswatch.ts b/ts/tswatch.classes.tswatch.ts index dcc02d8..04c0b16 100644 --- a/ts/tswatch.classes.tswatch.ts +++ b/ts/tswatch.classes.tswatch.ts @@ -118,6 +118,7 @@ export class TsWatch { break; case 'website': await (async () => { + const websiteExecution = new plugins.smartshell.SmartExecution('npm run startTs'); const bundleAndReloadWebsite = async () => { await tsbundle.build(paths.cwd, './ts_web/index.ts', './dist_serve/bundle.js', { bundler: 'esbuild', @@ -134,7 +135,9 @@ export class TsWatch { this.watcherMap.add( new Watcher({ filePathToWatch: plugins.path.join(paths.cwd, `./${tsfolder}/`), - commandToExecute: `npm run startTs`, + functionToCall: async () => { + await websiteExecution.restart(); + }, timeout: null, }) );