Compare commits

...

2 Commits

Author SHA1 Message Date
3eb99e1f08 v2.2.3
Some checks failed
Default (tags) / security (push) Successful in 48s
Default (tags) / test (push) Failing after 37s
Default (tags) / release (push) Has been skipped
Default (tags) / metadata (push) Has been skipped
2025-12-04 08:30:05 +00:00
ad41fe876d fix(tswatch.classes.watcher): Convert directory watch paths to glob patterns for smartwatch compatibility 2025-12-04 08:30:05 +00:00
5 changed files with 14 additions and 3 deletions

View File

@@ -1,5 +1,11 @@
# Changelog
## 2025-12-04 - 2.2.3 - fix(tswatch.classes.watcher)
Convert directory watch paths to glob patterns for smartwatch compatibility
- Watcher: convert directory paths to recursive glob patterns before adding them to Smartwatch so directories are watched recursively (e.g. /path/to/dir/ -> /path/to/dir/**/*).
- Readme: added migration note explaining that directory paths are converted to glob patterns for smartwatch compatibility.
## 2025-12-01 - 2.2.2 - fix(core)
Replace smartchok/smartfile with smartwatch/smartfs, update watcher and plugins, and bump dependencies

View File

@@ -1,6 +1,6 @@
{
"name": "@git.zone/tswatch",
"version": "2.2.2",
"version": "2.2.3",
"private": false,
"description": "A development tool for automatically watching and re-compiling TypeScript projects upon detecting file changes, enhancing developer workflows.",
"exports": {

View File

@@ -48,3 +48,4 @@
- Replaced `@push.rocks/smartchok` with `@push.rocks/smartwatch` (v5.x)
- Replaced `@push.rocks/smartfile` with `@push.rocks/smartfs` for directory listing
- Class names: `Smartwatch` for file watching, `SmartFs` + `SmartFsProviderNode` for filesystem ops
- Directory paths are converted to glob patterns (`/path/to/dir/``/path/to/dir/**/*`) for smartwatch compatibility

View File

@@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@git.zone/tswatch',
version: '2.2.2',
version: '2.2.3',
description: 'A development tool for automatically watching and re-compiling TypeScript projects upon detecting file changes, enhancing developer workflows.'
}

View File

@@ -34,7 +34,11 @@ export class Watcher {
logger.log('info', `trying to start watcher for ${this.options.filePathToWatch}`);
await this.setupCleanup();
console.log(`Looking at ${this.options.filePathToWatch} for changes`);
this.smartwatchInstance.add([this.options.filePathToWatch]); // __dirname refers to the directory of this very file
// Convert directory path to glob pattern for smartwatch
const watchPath = this.options.filePathToWatch.endsWith('/')
? `${this.options.filePathToWatch}**/*`
: `${this.options.filePathToWatch}/**/*`;
this.smartwatchInstance.add([watchPath]);
await this.smartwatchInstance.start();
const changeObservable = await this.smartwatchInstance.getObservableFor('change');
changeObservable.subscribe(() => {