@wordpress-flow/cli 1.2.4 → 1.2.5

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 +14 -3
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -116132,7 +116132,7 @@ class DockerEnvManager {
116132
116132
  // package.json
116133
116133
  var package_default = {
116134
116134
  name: "@wordpress-flow/cli",
116135
- version: "1.2.4",
116135
+ version: "1.2.5",
116136
116136
  type: "module",
116137
116137
  description: "TypeScript-based WordPress block creation system",
116138
116138
  main: "dist/index.js",
@@ -116688,6 +116688,8 @@ class DevModeOrchestrator {
116688
116688
  this.watchers.push(watcher);
116689
116689
  watcher.on("add", (filePath2) => this.handlePageFileEvent("add", filePath2)).on("change", (filePath2) => this.handlePageFileEvent("change", filePath2)).on("unlink", (filePath2) => this.handlePageFileEvent("unlink", filePath2)).on("error", (error) => logger.error("Page watcher error:", error));
116690
116690
  }
116691
+ rescanTimeout = null;
116692
+ rescanDebounceMs = 500;
116691
116693
  handleBlockFileEvent(eventType, filePath2) {
116692
116694
  const fullPath = path17.resolve(this.blocksDir, filePath2);
116693
116695
  const fileName = path17.basename(filePath2, path17.extname(filePath2));
@@ -116697,9 +116699,18 @@ class DevModeOrchestrator {
116697
116699
  this.changeQueue.queueBlockChange(fileName, fullPath, eventType);
116698
116700
  } else if (parentBlock) {
116699
116701
  this.changeQueue.queueBlockImportChange(parentBlock, fullPath, eventType);
116700
- } else if (eventType === "add") {
116701
- this.rescanBlocks();
116702
+ } else if (eventType === "add" || eventType === "change") {
116703
+ this.scheduleRescan();
116704
+ }
116705
+ }
116706
+ scheduleRescan() {
116707
+ if (this.rescanTimeout) {
116708
+ clearTimeout(this.rescanTimeout);
116702
116709
  }
116710
+ this.rescanTimeout = setTimeout(() => {
116711
+ this.rescanTimeout = null;
116712
+ this.rescanBlocks();
116713
+ }, this.rescanDebounceMs);
116703
116714
  }
116704
116715
  handleTemplateFileEvent(eventType, filePath2) {
116705
116716
  const fullPath = path17.resolve(this.templatesDir, filePath2);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress-flow/cli",
3
- "version": "1.2.4",
3
+ "version": "1.2.5",
4
4
  "type": "module",
5
5
  "description": "TypeScript-based WordPress block creation system",
6
6
  "main": "dist/index.js",