@nuasite/cms 0.22.2 → 0.23.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/editor.js CHANGED
@@ -381,7 +381,7 @@ function CS(t, e) {
381
381
  function ES(t, e) {
382
382
  return typeof e == "function" ? e(t) : e;
383
383
  }
384
- const J_ = "0.22.2", j_ = J_, ct = {
384
+ const J_ = "0.23.0", j_ = J_, ct = {
385
385
  /** Highlight overlay for hovered elements */
386
386
  HIGHLIGHT: 2147483644,
387
387
  /** Hover outline for elements/components */
package/package.json CHANGED
@@ -14,7 +14,7 @@
14
14
  "directory": "packages/astro-cms"
15
15
  },
16
16
  "license": "Apache-2.0",
17
- "version": "0.22.2",
17
+ "version": "0.23.0",
18
18
  "module": "src/index.ts",
19
19
  "types": "src/index.ts",
20
20
  "type": "module",
@@ -94,13 +94,23 @@ export function createVitePlugin(context: VitePluginContext): Plugin[] {
94
94
  let fsWatcher: ReturnType<typeof watch> | undefined
95
95
  let debounce: ReturnType<typeof setTimeout> | undefined
96
96
 
97
+ const invalidate = () => {
98
+ // Replicate Astro's invalidateDataStore which never fires because
99
+ // Vite's bundled chokidar 3.6.0 misses atomic-write changes.
100
+ const ssr = server.environments.ssr
101
+ const mod = ssr.moduleGraph.getModuleById('\0astro:data-store')
102
+ if (mod) {
103
+ ssr.moduleGraph.invalidateModule(mod, undefined, Date.now(), true)
104
+ }
105
+ ssr.hot.send('astro:content-changed', {})
106
+ server.environments.client.hot.send({ type: 'full-reload', path: '*' })
107
+ }
108
+
97
109
  const startWatching = () => {
98
110
  try {
99
111
  fsWatcher = watch(dataStorePath, () => {
100
112
  clearTimeout(debounce)
101
- debounce = setTimeout(() => {
102
- server.environments.client.hot.send({ type: 'full-reload', path: '*' })
103
- }, 80)
113
+ debounce = setTimeout(invalidate, 80)
104
114
  })
105
115
  } catch {
106
116
  // File doesn't exist yet — retry when it appears