@samva/vite 0.4.0 → 0.5.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/AGENTS.md CHANGED
@@ -7,6 +7,11 @@ programmatic template builds and `@samva/vite/emit` only for module-preview inte
7
7
  The CLI loads `@samva/vite/build` from the current project. Keep these authoring dependencies in the
8
8
  project lockfile so local preview, check, and build use the same compiler version as the project.
9
9
 
10
+ This package is plain TypeScript like `@samva/markup`, and adds no runtime framework of its own to
11
+ a template project. `@samva/vite/build` and the preview surfaces answer with discriminated results
12
+ carrying an `ok` field, and `@samva/vite/emit` passes the compiler's better-result `Result`
13
+ through. A missing `vite`, or an entry that does not default-export a template definition, throws.
14
+
10
15
  Hosted synchronization is ordinary Git. A CLI-created project has a repository-local Samva
11
16
  credential helper, and `samva templates publish` accepts only a clean exact commit reachable from
12
17
  the fetched `origin` default branch. Publish creates an immutable receipt; it does not push or
package/dist/build.js CHANGED
@@ -152,8 +152,15 @@ const createTemplateBuildSession = async (dir, options = {}) => {
152
152
  }
153
153
  return { files: entries };
154
154
  };
155
+ const fileEvents = /* @__PURE__ */ new Set([
156
+ "add",
157
+ "change",
158
+ "unlink"
159
+ ]);
155
160
  const subscribe = (listener) => {
156
- const onChange = (_event, path) => listener(path);
161
+ const onChange = (event, path) => {
162
+ if (fileEvents.has(event)) listener(path);
163
+ };
157
164
  server.watcher.on("all", onChange);
158
165
  return () => server.watcher.off("all", onChange);
159
166
  };