@timeax/scaffold 0.0.11 → 0.0.13
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/.vscode/settings.json +0 -1
- package/dist/cli.cjs +16 -22
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.mjs +16 -22
- package/dist/cli.mjs.map +1 -1
- package/package.json +4 -2
- package/scripts/postpublish.mjs +16 -6
- package/src/core/watcher.ts +29 -32
package/.vscode/settings.json
CHANGED
package/dist/cli.cjs
CHANGED
|
@@ -1341,7 +1341,7 @@ function watchScaffold(cwd, options = {}) {
|
|
|
1341
1341
|
// we already resolved scaffoldDir for watcher; pass it down
|
|
1342
1342
|
scaffoldDir
|
|
1343
1343
|
});
|
|
1344
|
-
logger6.info("Scaffold run completed
|
|
1344
|
+
logger6.info("Scaffold run completed");
|
|
1345
1345
|
} catch (err) {
|
|
1346
1346
|
logger6.error("Scaffold run failed:", err);
|
|
1347
1347
|
} finally {
|
|
@@ -1356,27 +1356,21 @@ function watchScaffold(cwd, options = {}) {
|
|
|
1356
1356
|
if (timer) clearTimeout(timer);
|
|
1357
1357
|
timer = setTimeout(run, debounceMs);
|
|
1358
1358
|
}
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
)
|
|
1372
|
-
|
|
1373
|
-
logger6.debug(`
|
|
1374
|
-
scheduleRun();
|
|
1375
|
-
}).on("change", (filePath) => {
|
|
1376
|
-
logger6.debug(`File changed: ${filePath}`);
|
|
1377
|
-
scheduleRun();
|
|
1378
|
-
}).on("unlink", (filePath) => {
|
|
1379
|
-
logger6.debug(`File removed: ${filePath}`);
|
|
1359
|
+
function isInteresting(filePath) {
|
|
1360
|
+
const rel = path2__default.default.relative(scaffoldDir, filePath);
|
|
1361
|
+
if (rel.startsWith("..")) return false;
|
|
1362
|
+
const base = path2__default.default.basename(filePath).toLowerCase();
|
|
1363
|
+
if (base.startsWith("config.")) return true;
|
|
1364
|
+
const ext = path2__default.default.extname(base);
|
|
1365
|
+
return ext === ".txt" || ext === ".tss" || ext === ".stx";
|
|
1366
|
+
}
|
|
1367
|
+
const watcher = chokidar__default.default.watch(scaffoldDir, {
|
|
1368
|
+
ignoreInitial: false,
|
|
1369
|
+
persistent: true
|
|
1370
|
+
});
|
|
1371
|
+
watcher.on("all", (event, filePath) => {
|
|
1372
|
+
if (!isInteresting(filePath)) return;
|
|
1373
|
+
logger6.debug(`Event ${event} on ${filePath}`);
|
|
1380
1374
|
scheduleRun();
|
|
1381
1375
|
}).on("error", (error) => {
|
|
1382
1376
|
logger6.error("Watcher error:", error);
|