@tuongaz/seeflow 0.1.64 → 0.1.65

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/src/watcher.ts CHANGED
@@ -75,7 +75,7 @@ export interface FlowWatcher {
75
75
  ): void;
76
76
  /**
77
77
  * Relative paths (under the project root) currently being watched because
78
- * they're referenced by a node's `data.path` (imageNode). htmlNode content
78
+ * they're referenced by a node's `data.path` (type:'image' node). type:'html' node content
79
79
  * rides on the file:// resolver via `data.html`, not this list. Sorted for
80
80
  * stable assertion order. Used by tests.
81
81
  */
@@ -96,7 +96,7 @@ interface WatchHandle {
96
96
  filePath: string;
97
97
  /**
98
98
  * Per-directory file watchers for files referenced by node data
99
- * (imageNode `path`). Each directory watcher dispatches to
99
+ * (type:'image' node `path`). Each directory watcher dispatches to
100
100
  * specific basenames in its `files` map.
101
101
  */
102
102
  fileWatchers: Map<string, FileWatchEntry>;
@@ -108,7 +108,7 @@ const resolveFilePath = (repoPath: string, flowPath: string): string =>
108
108
  const isCleanRelativePath = (p: string): boolean => {
109
109
  if (!p) return false;
110
110
  // Reject data URLs early — the pre-launch hard-cut (US-004) replaces
111
- // imageNode.data.image with data.path, but defensively skip any lingering
111
+ // type:'image' node.data.image with data.path, but defensively skip any lingering
112
112
  // base64 payloads so we don't try to fs.watch a 5MB string.
113
113
  if (p.startsWith('data:')) return false;
114
114
  if (isAbsolute(p) || p.startsWith('/') || p.startsWith('\\')) return false;
@@ -119,7 +119,7 @@ const isCleanRelativePath = (p: string): boolean => {
119
119
 
120
120
  /**
121
121
  * Walk raw flow JSON (pre-schema-parse) collecting referenced file paths:
122
- * `nodes[].data.path` (imageNode). htmlNode content now flows through the
122
+ * `nodes[].data.path` (type:'image' node). type:'html' node content now flows through the
123
123
  * `file://nodes/<id>/view.html` ref handled by the file-ref resolver, so it
124
124
  * does NOT need a separate fs.watch entry here. Operates on the raw JSON so
125
125
  * the watcher works before those fields are formally validated.
@@ -152,7 +152,7 @@ export interface ReadMergedFlowResult {
152
152
  error: string | null;
153
153
  /** Sorted relative paths under the project root resolved via file://. */
154
154
  fileRefs: string[];
155
- /** Flow file paths referenced via imageNode.path. */
155
+ /** Flow file paths referenced via type:'image' node.path. */
156
156
  staticRefs: string[];
157
157
  }
158
158
 
@@ -337,7 +337,7 @@ export function createWatcher(deps: WatcherDeps): FlowWatcher {
337
337
 
338
338
  if (!existsSync(dir)) {
339
339
  // Directory hasn't been created on disk yet (e.g. blocks/ before any
340
- // htmlNode is dropped). Skip silently — next reparse will retry.
340
+ // type:'html' node is dropped). Skip silently — next reparse will retry.
341
341
  continue;
342
342
  }
343
343
 
@@ -397,7 +397,7 @@ export function createWatcher(deps: WatcherDeps): FlowWatcher {
397
397
  snapshots.set(flowId, next);
398
398
  lastSeenMtimes.set(flowId, combinedMtimeMs(filePath));
399
399
 
400
- // Reconcile the referenced-file watch set: imageNode.path from
400
+ // Reconcile the referenced-file watch set: type:'image' node.path from
401
401
  // flow + any file:// targets that resolved cleanly. Schema errors
402
402
  // shouldn't drop the watch set — the user is mid-edit and the referenced
403
403
  // files are still valid targets, so this reconciles whenever the JSON