@commercebuild/extension 0.0.10 → 0.0.12

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@commercebuild/extension",
3
- "version": "0.0.10",
3
+ "version": "0.0.12",
4
4
  "types": "./types/index.d.ts",
5
5
  "exports": {
6
6
  ".": {
@@ -19,8 +19,13 @@ export default function ViteHMRNotifierPlugin() {
19
19
  });
20
20
  console.debug("[hmr-notifier] WebSocket mounted at /hmr-notifier");
21
21
  let building = false;
22
+ let pendingChanges = false;
23
+
22
24
  server.watcher.on("change", async (file) => {
23
- if (building) return;
25
+ if (building) {
26
+ pendingChanges = true;
27
+ return;
28
+ }
24
29
  building = true;
25
30
  console.debug(`[hmr-notifier] File changed: ${file}, Rebuilding...`);
26
31
  try {
@@ -36,8 +41,14 @@ export default function ViteHMRNotifierPlugin() {
36
41
  });
37
42
  } catch (err) {
38
43
  console.error(`[hmr-notifier] Build failed:`, err);
44
+ } finally {
45
+ building = false;
46
+ if (pendingChanges) {
47
+ pendingChanges = false;
48
+ // Emit change event to re-trigger build after current build completes
49
+ server.watcher.emit("change", file);
50
+ }
39
51
  }
40
- building = false;
41
52
  });
42
53
  },
43
54
  };
package/types/global.d.ts CHANGED
@@ -100,6 +100,8 @@ declare global {
100
100
  router;
101
101
  displayMoney;
102
102
  cn;
103
+ revalidateTag;
104
+ revalidatePath;
103
105
  };
104
106
  com: {
105
107
  Cart: {