@wrongstack/plugins 0.273.1 → 0.275.0
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.
- package/dist/file-watcher.js +17 -12
- package/dist/index.js +17 -12
- package/package.json +2 -2
package/dist/file-watcher.js
CHANGED
|
@@ -57,9 +57,11 @@ var plugin = {
|
|
|
57
57
|
},
|
|
58
58
|
setup(api) {
|
|
59
59
|
for (const handle of watches.values()) {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
60
|
+
for (const w of handle.watchers) {
|
|
61
|
+
try {
|
|
62
|
+
w.close();
|
|
63
|
+
} catch {
|
|
64
|
+
}
|
|
63
65
|
}
|
|
64
66
|
}
|
|
65
67
|
watches.clear();
|
|
@@ -118,7 +120,7 @@ var plugin = {
|
|
|
118
120
|
watcher.on("error", (err) => {
|
|
119
121
|
api.log.warn(`file-watcher: error on ${dirPath}: ${err}`);
|
|
120
122
|
});
|
|
121
|
-
handle.watcher
|
|
123
|
+
handle.watchers.push(watcher);
|
|
122
124
|
} catch (err) {
|
|
123
125
|
api.log.warn(`file-watcher: could not watch ${dirPath}: ${err}`);
|
|
124
126
|
}
|
|
@@ -167,8 +169,7 @@ var plugin = {
|
|
|
167
169
|
paths,
|
|
168
170
|
recursive,
|
|
169
171
|
events,
|
|
170
|
-
|
|
171
|
-
} },
|
|
172
|
+
watchers: [],
|
|
172
173
|
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
173
174
|
};
|
|
174
175
|
for (const p of paths) {
|
|
@@ -204,9 +205,11 @@ var plugin = {
|
|
|
204
205
|
if (!handle) {
|
|
205
206
|
return { ok: false, error: `No active watch with ID: ${watchId}` };
|
|
206
207
|
}
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
208
|
+
for (const w of handle.watchers) {
|
|
209
|
+
try {
|
|
210
|
+
w.close();
|
|
211
|
+
} catch {
|
|
212
|
+
}
|
|
210
213
|
}
|
|
211
214
|
watches.delete(watchId);
|
|
212
215
|
api.metrics.gauge("active_watches", watches.size);
|
|
@@ -243,9 +246,11 @@ var plugin = {
|
|
|
243
246
|
},
|
|
244
247
|
teardown(api) {
|
|
245
248
|
for (const handle of watches.values()) {
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
+
for (const w of handle.watchers) {
|
|
250
|
+
try {
|
|
251
|
+
w.close();
|
|
252
|
+
} catch {
|
|
253
|
+
}
|
|
249
254
|
}
|
|
250
255
|
}
|
|
251
256
|
watches.clear();
|
package/dist/index.js
CHANGED
|
@@ -1133,9 +1133,11 @@ var plugin5 = {
|
|
|
1133
1133
|
},
|
|
1134
1134
|
setup(api) {
|
|
1135
1135
|
for (const handle of watches.values()) {
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1136
|
+
for (const w of handle.watchers) {
|
|
1137
|
+
try {
|
|
1138
|
+
w.close();
|
|
1139
|
+
} catch {
|
|
1140
|
+
}
|
|
1139
1141
|
}
|
|
1140
1142
|
}
|
|
1141
1143
|
watches.clear();
|
|
@@ -1194,7 +1196,7 @@ var plugin5 = {
|
|
|
1194
1196
|
watcher.on("error", (err) => {
|
|
1195
1197
|
api.log.warn(`file-watcher: error on ${dirPath}: ${err}`);
|
|
1196
1198
|
});
|
|
1197
|
-
handle.watcher
|
|
1199
|
+
handle.watchers.push(watcher);
|
|
1198
1200
|
} catch (err) {
|
|
1199
1201
|
api.log.warn(`file-watcher: could not watch ${dirPath}: ${err}`);
|
|
1200
1202
|
}
|
|
@@ -1243,8 +1245,7 @@ var plugin5 = {
|
|
|
1243
1245
|
paths,
|
|
1244
1246
|
recursive,
|
|
1245
1247
|
events,
|
|
1246
|
-
|
|
1247
|
-
} },
|
|
1248
|
+
watchers: [],
|
|
1248
1249
|
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
1249
1250
|
};
|
|
1250
1251
|
for (const p of paths) {
|
|
@@ -1280,9 +1281,11 @@ var plugin5 = {
|
|
|
1280
1281
|
if (!handle) {
|
|
1281
1282
|
return { ok: false, error: `No active watch with ID: ${watchId}` };
|
|
1282
1283
|
}
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1284
|
+
for (const w of handle.watchers) {
|
|
1285
|
+
try {
|
|
1286
|
+
w.close();
|
|
1287
|
+
} catch {
|
|
1288
|
+
}
|
|
1286
1289
|
}
|
|
1287
1290
|
watches.delete(watchId);
|
|
1288
1291
|
api.metrics.gauge("active_watches", watches.size);
|
|
@@ -1319,9 +1322,11 @@ var plugin5 = {
|
|
|
1319
1322
|
},
|
|
1320
1323
|
teardown(api) {
|
|
1321
1324
|
for (const handle of watches.values()) {
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
+
for (const w of handle.watchers) {
|
|
1326
|
+
try {
|
|
1327
|
+
w.close();
|
|
1328
|
+
} catch {
|
|
1329
|
+
}
|
|
1325
1330
|
}
|
|
1326
1331
|
}
|
|
1327
1332
|
watches.clear();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wrongstack/plugins",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.275.0",
|
|
4
4
|
"description": "Official WrongStack plugin collection — auto-doc, git-autocommit, shell-check, cost-tracker, file-watcher, web-search, json-path, cron, template-engine, semver-bump",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "ECOSTACK TECHNOLOGY OÜ",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"vitest": "^4.1.8"
|
|
64
64
|
},
|
|
65
65
|
"dependencies": {
|
|
66
|
-
"@wrongstack/core": "0.
|
|
66
|
+
"@wrongstack/core": "0.275.0"
|
|
67
67
|
},
|
|
68
68
|
"scripts": {
|
|
69
69
|
"build": "tsup",
|