@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/dist/cli.mjs
CHANGED
|
@@ -1330,7 +1330,7 @@ function watchScaffold(cwd, options = {}) {
|
|
|
1330
1330
|
// we already resolved scaffoldDir for watcher; pass it down
|
|
1331
1331
|
scaffoldDir
|
|
1332
1332
|
});
|
|
1333
|
-
logger6.info("Scaffold run completed
|
|
1333
|
+
logger6.info("Scaffold run completed");
|
|
1334
1334
|
} catch (err) {
|
|
1335
1335
|
logger6.error("Scaffold run failed:", err);
|
|
1336
1336
|
} finally {
|
|
@@ -1345,27 +1345,21 @@ function watchScaffold(cwd, options = {}) {
|
|
|
1345
1345
|
if (timer) clearTimeout(timer);
|
|
1346
1346
|
timer = setTimeout(run, debounceMs);
|
|
1347
1347
|
}
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
)
|
|
1361
|
-
|
|
1362
|
-
logger6.debug(`
|
|
1363
|
-
scheduleRun();
|
|
1364
|
-
}).on("change", (filePath) => {
|
|
1365
|
-
logger6.debug(`File changed: ${filePath}`);
|
|
1366
|
-
scheduleRun();
|
|
1367
|
-
}).on("unlink", (filePath) => {
|
|
1368
|
-
logger6.debug(`File removed: ${filePath}`);
|
|
1348
|
+
function isInteresting(filePath) {
|
|
1349
|
+
const rel = path2.relative(scaffoldDir, filePath);
|
|
1350
|
+
if (rel.startsWith("..")) return false;
|
|
1351
|
+
const base = path2.basename(filePath).toLowerCase();
|
|
1352
|
+
if (base.startsWith("config.")) return true;
|
|
1353
|
+
const ext = path2.extname(base);
|
|
1354
|
+
return ext === ".txt" || ext === ".tss" || ext === ".stx";
|
|
1355
|
+
}
|
|
1356
|
+
const watcher = chokidar.watch(scaffoldDir, {
|
|
1357
|
+
ignoreInitial: false,
|
|
1358
|
+
persistent: true
|
|
1359
|
+
});
|
|
1360
|
+
watcher.on("all", (event, filePath) => {
|
|
1361
|
+
if (!isInteresting(filePath)) return;
|
|
1362
|
+
logger6.debug(`Event ${event} on ${filePath}`);
|
|
1369
1363
|
scheduleRun();
|
|
1370
1364
|
}).on("error", (error) => {
|
|
1371
1365
|
logger6.error("Watcher error:", error);
|