Compare commits
12 Commits
Author | SHA1 | Date | |
---|---|---|---|
54aa225880 | |||
98a16dd181 | |||
d4414638b6 | |||
5cd5085f05 | |||
0b8f3d317c | |||
17ee959980 | |||
62d1fe0a35 | |||
915bd67b6a | |||
9e0765ce0b | |||
abde25211a | |||
e8ae4c8341 | |||
dc6bb93349 |
24
.vscode/launch.json
vendored
24
.vscode/launch.json
vendored
@@ -2,28 +2,10 @@
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "current file",
|
||||
"type": "node",
|
||||
"command": "npm test",
|
||||
"name": "Run npm test",
|
||||
"request": "launch",
|
||||
"args": [
|
||||
"${relativeFile}"
|
||||
],
|
||||
"runtimeArgs": ["-r", "@git.zone/tsrun"],
|
||||
"cwd": "${workspaceRoot}",
|
||||
"protocol": "inspector",
|
||||
"internalConsoleOptions": "openOnSessionStart"
|
||||
},
|
||||
{
|
||||
"name": "test.ts",
|
||||
"type": "node",
|
||||
"request": "launch",
|
||||
"args": [
|
||||
"test/test.ts"
|
||||
],
|
||||
"runtimeArgs": ["-r", "@git.zone/tsrun"],
|
||||
"cwd": "${workspaceRoot}",
|
||||
"protocol": "inspector",
|
||||
"internalConsoleOptions": "openOnSessionStart"
|
||||
"type": "node-terminal"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
34
changelog.md
34
changelog.md
@@ -1,5 +1,39 @@
|
||||
# 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.
|
||||
|
||||
- Adjusted the function call from 'this.typedserver.reload()' to 'bundleAndReloadElement()' to ensure proper bundle handling in 'element' mode.
|
||||
|
||||
## 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
|
||||
|
||||
- Updated dependencies for improved performance
|
||||
- Refined TypeScript project watching logic
|
||||
|
||||
## 2024-12-04 - 2.0.31 - fix(Watcher)
|
||||
Add missing logger message in Watcher class for start method
|
||||
|
||||
- Added a log message when starting a watcher to track file path being watched
|
||||
|
||||
## 2024-12-04 - 2.0.30 - fix(cli)
|
||||
Fix incorrect watch mode and update npm test command.
|
||||
|
||||
- Updated the npm test command in .vscode/launch.json for streamlined launching.
|
||||
- Corrected the watch mode from 'echoSomething' to 'echo' in test/test.ts.
|
||||
|
||||
## 2024-12-04 - 2.0.29 - fix(core)
|
||||
No changes detected in the codebase.
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@git.zone/tswatch",
|
||||
"version": "2.0.29",
|
||||
"version": "2.0.35",
|
||||
"private": false,
|
||||
"description": "watch typescript projects during development",
|
||||
"main": "dist_ts/index.js",
|
||||
@@ -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": [
|
||||
|
28
pnpm-lock.yaml
generated
28
pnpm-lock.yaml
generated
@@ -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
|
||||
|
||||
|
@@ -5,7 +5,7 @@ import * as tswatch from '../ts/index.js';
|
||||
let testTsWatchInstance: tswatch.TsWatch;
|
||||
|
||||
tap.test('should create a valid TsWatch instance', async () => {
|
||||
testTsWatchInstance = new tswatch.TsWatch('echoSomething');
|
||||
testTsWatchInstance = new tswatch.TsWatch('echo');
|
||||
});
|
||||
|
||||
tap.test('should start the tswatch instance', async () => {
|
||||
|
@@ -3,6 +3,6 @@
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@git.zone/tswatch',
|
||||
version: '2.0.29',
|
||||
version: '2.0.35',
|
||||
description: 'watch typescript projects during development'
|
||||
}
|
||||
|
@@ -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({
|
||||
@@ -92,7 +93,7 @@ export class TsWatch {
|
||||
functionToCall: async () => {
|
||||
logger.log('info', `building ${tsfolder}`);
|
||||
await smartshellInstance.exec(`(cd ${paths.cwd} && npm run build)`);
|
||||
await this.typedserver.reload();
|
||||
await bundleAndReloadElement();
|
||||
},
|
||||
timeout: null,
|
||||
})
|
||||
@@ -116,7 +117,8 @@ export class TsWatch {
|
||||
})();
|
||||
break;
|
||||
case 'website':
|
||||
(async () => {
|
||||
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',
|
||||
@@ -133,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,
|
||||
})
|
||||
);
|
||||
|
@@ -31,6 +31,7 @@ export class Watcher {
|
||||
* start the file
|
||||
*/
|
||||
public async start() {
|
||||
logger.log('info', `trying to start watcher for ${this.options.filePathToWatch}`);
|
||||
await this.setupCleanup();
|
||||
console.log(`Looking at ${this.options.filePathToWatch} for changes`);
|
||||
this.smartchokWatcher.add([this.options.filePathToWatch]); // __dirname refers to the directory of this very file
|
||||
@@ -40,6 +41,7 @@ export class Watcher {
|
||||
this.updateCurrentExecution();
|
||||
});
|
||||
await this.updateCurrentExecution();
|
||||
logger.log('info', `watcher started for ${this.options.filePathToWatch}`);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user