@lvce-editor/file-watcher-process 4.6.0 → 4.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +9 -0
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1397,6 +1397,15 @@ const watchFolders = async ({
1397
1397
  } of watcherEntries) {
1398
1398
  watcher.on('all', callback);
1399
1399
  }
1400
+ const controller = new AbortController();
1401
+ controller.signal.addEventListener('abort', () => {
1402
+ void Promise.allSettled(watcherEntries.map(({
1403
+ watcher
1404
+ }) => watcher.close()));
1405
+ }, {
1406
+ once: true
1407
+ });
1408
+ add(id, controller);
1400
1409
  const inotifyWatchCount = await getInotifyWatchCount();
1401
1410
  if (inotifyWatchCount === undefined) {
1402
1411
  return success;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/file-watcher-process",
3
- "version": "4.6.0",
3
+ "version": "4.6.1",
4
4
  "description": "File Watcher Process",
5
5
  "keywords": [
6
6
  "Lvce Editor",