@warlock.js/core 4.0.18 → 4.0.21
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/esm/cli/cli-commands.manager.d.ts.map +1 -1
- package/esm/cli/cli-commands.manager.js +5 -4
- package/esm/cli/cli-commands.manager.js.map +1 -1
- package/esm/config/config-loader.d.ts.map +1 -1
- package/esm/config/config-loader.js +3 -2
- package/esm/config/config-loader.js.map +1 -1
- package/esm/dev2-server/development-server.d.ts.map +1 -1
- package/esm/dev2-server/development-server.js +1 -4
- package/esm/dev2-server/development-server.js.map +1 -1
- package/esm/dev2-server/file-event-handler.d.ts +115 -18
- package/esm/dev2-server/file-event-handler.d.ts.map +1 -1
- package/esm/dev2-server/file-event-handler.js +177 -63
- package/esm/dev2-server/file-event-handler.js.map +1 -1
- package/esm/dev2-server/file-manager.d.ts +301 -52
- package/esm/dev2-server/file-manager.d.ts.map +1 -1
- package/esm/dev2-server/file-manager.js +409 -203
- package/esm/dev2-server/file-manager.js.map +1 -1
- package/esm/dev2-server/file-operations.d.ts +161 -23
- package/esm/dev2-server/file-operations.d.ts.map +1 -1
- package/esm/dev2-server/file-operations.js +217 -80
- package/esm/dev2-server/file-operations.js.map +1 -1
- package/esm/dev2-server/files-orchestrator.d.ts +35 -11
- package/esm/dev2-server/files-orchestrator.d.ts.map +1 -1
- package/esm/dev2-server/files-orchestrator.js +51 -63
- package/esm/dev2-server/files-orchestrator.js.map +1 -1
- package/esm/dev2-server/import-transformer.d.ts +6 -5
- package/esm/dev2-server/import-transformer.d.ts.map +1 -1
- package/esm/dev2-server/import-transformer.js +27 -39
- package/esm/dev2-server/import-transformer.js.map +1 -1
- package/esm/dev2-server/layer-executor.js +1 -1
- package/esm/dev2-server/parse-imports.d.ts.map +1 -1
- package/esm/dev2-server/parse-imports.js +1 -0
- package/esm/dev2-server/parse-imports.js.map +1 -1
- package/esm/dev2-server/tsconfig-manager.d.ts +1 -1
- package/esm/dev2-server/tsconfig-manager.d.ts.map +1 -1
- package/esm/dev2-server/tsconfig-manager.js +8 -3
- package/esm/dev2-server/tsconfig-manager.js.map +1 -1
- package/esm/dev2-server/type-generator.d.ts +10 -6
- package/esm/dev2-server/type-generator.d.ts.map +1 -1
- package/esm/dev2-server/type-generator.js +84 -75
- package/esm/dev2-server/type-generator.js.map +1 -1
- package/esm/dev2-server/types.d.ts +15 -1
- package/esm/dev2-server/types.d.ts.map +1 -1
- package/esm/http/errors/resource-not-found.error.d.ts +4 -0
- package/esm/http/errors/resource-not-found.error.d.ts.map +1 -1
- package/esm/http/errors/resource-not-found.error.js +9 -1
- package/esm/http/errors/resource-not-found.error.js.map +1 -1
- package/esm/http/middleware/inject-request-context.d.ts.map +1 -1
- package/esm/http/middleware/inject-request-context.js +8 -2
- package/esm/http/middleware/inject-request-context.js.map +1 -1
- package/esm/index.js +1 -1
- package/package.json +1 -1
|
@@ -1,69 +1,120 @@
|
|
|
1
1
|
import events from'@mongez/events';import {debounce}from'@mongez/reinforcements';import {devLogSuccess}from'./dev-logger.js';import {FILE_PROCESSING_BATCH_SIZE}from'./flags.js';import {clearFileExistsCache}from'./parse-imports.js';import {Path}from'./path.js';/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
2
|
+
* FileEventHandler - Handles runtime file system events
|
|
3
|
+
*
|
|
4
|
+
* This class receives file system events (add, change, delete) from the
|
|
5
|
+
* FilesWatcher and processes them in batches for optimal performance.
|
|
6
|
+
*
|
|
7
|
+
* ## Batching Strategy
|
|
8
|
+
*
|
|
9
|
+
* Events are collected and processed after a debounce period (150ms).
|
|
10
|
+
* This batching is crucial when:
|
|
11
|
+
* - Multiple files are created at once (e.g., VSCode extension creating a module)
|
|
12
|
+
* - A file save triggers multiple filesystem events
|
|
13
|
+
* - Large refactoring operations affect many files
|
|
14
|
+
*
|
|
15
|
+
* ## Processing Order
|
|
16
|
+
*
|
|
17
|
+
* 1. **Added files** - Processed first so they're available for imports
|
|
18
|
+
* 2. **Changed files** - Can reference newly added files
|
|
19
|
+
* 3. **Deleted files** - Processed last, dependents are notified
|
|
20
|
+
*
|
|
21
|
+
* ## Batch Add Strategy
|
|
22
|
+
*
|
|
23
|
+
* When multiple files are added (e.g., creating a Warlock module), they're
|
|
24
|
+
* processed using a two-phase approach with topological sorting:
|
|
25
|
+
*
|
|
26
|
+
* 1. **Parse Phase**: All files are parsed to discover dependencies
|
|
27
|
+
* 2. **Sort Phase**: Files are topologically sorted by dependencies
|
|
28
|
+
* 3. **Complete Phase**: Files are finalized in dependency order
|
|
29
|
+
*
|
|
30
|
+
* This ensures that when file A imports file B, file B is processed first.
|
|
31
|
+
*
|
|
32
|
+
* @class FileEventHandler
|
|
5
33
|
*/
|
|
6
34
|
class FileEventHandler {
|
|
7
35
|
fileOperations;
|
|
8
36
|
manifest;
|
|
37
|
+
dependencyGraph;
|
|
38
|
+
files;
|
|
9
39
|
/**
|
|
10
|
-
* Pending
|
|
40
|
+
* Pending file change events (relative paths)
|
|
11
41
|
*/
|
|
12
42
|
pendingChanges = new Set();
|
|
43
|
+
/**
|
|
44
|
+
* Pending file add events (relative paths)
|
|
45
|
+
*/
|
|
13
46
|
pendingAdds = new Set();
|
|
47
|
+
/**
|
|
48
|
+
* Pending file delete events (relative paths)
|
|
49
|
+
*/
|
|
14
50
|
pendingDeletes = new Set();
|
|
15
51
|
/**
|
|
16
52
|
* Debounced batch processor
|
|
17
|
-
* Waits
|
|
53
|
+
* Waits 150ms after the last event before processing
|
|
18
54
|
*/
|
|
19
55
|
processPendingEvents = debounce(async () => {
|
|
20
56
|
await this.processBatch();
|
|
21
|
-
}, 150);
|
|
57
|
+
}, 150);
|
|
22
58
|
/**
|
|
23
|
-
*
|
|
59
|
+
* Creates a new FileEventHandler
|
|
60
|
+
*
|
|
61
|
+
* @param fileOperations - FileOperations instance for file lifecycle management
|
|
62
|
+
* @param manifest - ManifestManager for persisting file metadata
|
|
63
|
+
* @param dependencyGraph - DependencyGraph for tracking dependencies
|
|
64
|
+
* @param files - Map of all tracked FileManager instances
|
|
24
65
|
*/
|
|
25
|
-
constructor(fileOperations, manifest) {
|
|
66
|
+
constructor(fileOperations, manifest, dependencyGraph, files) {
|
|
26
67
|
this.fileOperations = fileOperations;
|
|
27
68
|
this.manifest = manifest;
|
|
69
|
+
this.dependencyGraph = dependencyGraph;
|
|
70
|
+
this.files = files;
|
|
28
71
|
}
|
|
29
72
|
/**
|
|
30
|
-
* Handle file change event
|
|
31
|
-
*
|
|
73
|
+
* Handle a file change event from the file watcher
|
|
74
|
+
*
|
|
75
|
+
* The event is queued and will be processed in the next batch.
|
|
76
|
+
*
|
|
77
|
+
* @param absolutePath - Absolute path to the changed file
|
|
32
78
|
*/
|
|
33
79
|
handleFileChange(absolutePath) {
|
|
34
80
|
const relativePath = Path.toRelative(absolutePath);
|
|
35
|
-
// Add to pending changes
|
|
36
81
|
this.pendingChanges.add(relativePath);
|
|
37
|
-
// Trigger debounced batch processor
|
|
38
82
|
this.processPendingEvents();
|
|
39
83
|
}
|
|
40
84
|
/**
|
|
41
|
-
* Handle
|
|
42
|
-
*
|
|
85
|
+
* Handle a file add event from the file watcher
|
|
86
|
+
*
|
|
87
|
+
* The event is queued and will be processed in the next batch.
|
|
88
|
+
*
|
|
89
|
+
* @param absolutePath - Absolute path to the new file
|
|
43
90
|
*/
|
|
44
91
|
handleFileAdd(absolutePath) {
|
|
45
92
|
const relativePath = Path.toRelative(absolutePath);
|
|
46
|
-
// Add to pending adds
|
|
47
93
|
this.pendingAdds.add(relativePath);
|
|
48
|
-
// Trigger debounced batch processor
|
|
49
94
|
this.processPendingEvents();
|
|
50
95
|
}
|
|
51
96
|
/**
|
|
52
|
-
* Handle file
|
|
53
|
-
*
|
|
97
|
+
* Handle a file delete event from the file watcher
|
|
98
|
+
*
|
|
99
|
+
* The event is queued and will be processed in the next batch.
|
|
100
|
+
*
|
|
101
|
+
* @param absolutePath - Absolute path to the deleted file
|
|
54
102
|
*/
|
|
55
103
|
handleFileDelete(absolutePath) {
|
|
56
104
|
const relativePath = Path.toRelative(absolutePath);
|
|
57
|
-
// Add to pending deletes
|
|
58
105
|
this.pendingDeletes.add(relativePath);
|
|
59
|
-
// Trigger debounced batch processor
|
|
60
106
|
this.processPendingEvents();
|
|
61
107
|
}
|
|
62
108
|
/**
|
|
63
|
-
* Process all pending events in batch
|
|
109
|
+
* Process all pending events in a batch
|
|
110
|
+
*
|
|
111
|
+
* Events are processed in order: adds → changes → deletes
|
|
112
|
+
* After processing, the dependency graph and manifest are updated.
|
|
113
|
+
*
|
|
114
|
+
* @internal
|
|
64
115
|
*/
|
|
65
116
|
async processBatch() {
|
|
66
|
-
//
|
|
117
|
+
// Snapshot pending events
|
|
67
118
|
const changes = Array.from(this.pendingChanges);
|
|
68
119
|
const adds = Array.from(this.pendingAdds);
|
|
69
120
|
const deletes = Array.from(this.pendingDeletes);
|
|
@@ -75,26 +126,21 @@ class FileEventHandler {
|
|
|
75
126
|
if (changes.length === 0 && adds.length === 0 && deletes.length === 0) {
|
|
76
127
|
return;
|
|
77
128
|
}
|
|
78
|
-
// For batch operations
|
|
129
|
+
// For batch operations, add extra delay to let filesystem settle
|
|
79
130
|
const totalFiles = adds.length + changes.length;
|
|
80
131
|
if (totalFiles > 1) {
|
|
81
|
-
// Wait 500ms for filesystem to fully write all files
|
|
82
132
|
await new Promise((resolve) => setTimeout(resolve, 500));
|
|
83
|
-
// Clear file exists cache so we get fresh lookups
|
|
84
133
|
clearFileExistsCache();
|
|
85
134
|
}
|
|
86
|
-
//
|
|
87
|
-
// Process in order: adds first (so new files are available for import transformation),
|
|
88
|
-
// then changes (can reference newly added files), then deletes
|
|
135
|
+
// Process in order: adds first, then changes, then deletes
|
|
89
136
|
await this.processBatchAdds(adds);
|
|
90
|
-
// TODO: If changed files are just saves, then skip triggering the batch completion event
|
|
91
137
|
await this.processBatchChanges(changes);
|
|
92
138
|
await this.processBatchDeletes(deletes);
|
|
93
139
|
// Update dependency graph and manifest once
|
|
94
140
|
this.fileOperations.updateFileDependents();
|
|
95
141
|
this.fileOperations.syncFilesToManifest();
|
|
96
142
|
await this.manifest.save();
|
|
97
|
-
// Trigger batch completion event (for reload execution)
|
|
143
|
+
// Trigger batch completion event (for HMR/reload execution)
|
|
98
144
|
events.trigger("dev-server:batch-complete", {
|
|
99
145
|
added: adds,
|
|
100
146
|
changed: changes,
|
|
@@ -102,7 +148,13 @@ class FileEventHandler {
|
|
|
102
148
|
});
|
|
103
149
|
}
|
|
104
150
|
/**
|
|
105
|
-
* Process batch of changed files
|
|
151
|
+
* Process a batch of changed files
|
|
152
|
+
*
|
|
153
|
+
* Each file is updated (reprocessed if content changed).
|
|
154
|
+
* Processing is done in parallel batches for performance.
|
|
155
|
+
*
|
|
156
|
+
* @param relativePaths - Array of relative paths to changed files
|
|
157
|
+
* @internal
|
|
106
158
|
*/
|
|
107
159
|
async processBatchChanges(relativePaths) {
|
|
108
160
|
if (relativePaths.length === 0)
|
|
@@ -116,8 +168,17 @@ class FileEventHandler {
|
|
|
116
168
|
}
|
|
117
169
|
}
|
|
118
170
|
/**
|
|
119
|
-
* Process batch of added files
|
|
120
|
-
*
|
|
171
|
+
* Process a batch of added files using topological sort
|
|
172
|
+
*
|
|
173
|
+
* This method uses a two-phase approach:
|
|
174
|
+
* 1. Parse all files to discover dependencies
|
|
175
|
+
* 2. Complete files in topological order (dependencies first)
|
|
176
|
+
*
|
|
177
|
+
* This ensures that when file A imports file B (both in the batch),
|
|
178
|
+
* file B is fully processed before file A tries to resolve the import.
|
|
179
|
+
*
|
|
180
|
+
* @param relativePaths - Array of relative paths to new files
|
|
181
|
+
* @internal
|
|
121
182
|
*/
|
|
122
183
|
async processBatchAdds(relativePaths) {
|
|
123
184
|
if (relativePaths.length === 0)
|
|
@@ -126,54 +187,107 @@ class FileEventHandler {
|
|
|
126
187
|
// PHASE 1: Parse all files in parallel to discover dependencies
|
|
127
188
|
const parsedFiles = await Promise.all(relativePaths.map(async (relativePath) => {
|
|
128
189
|
try {
|
|
129
|
-
|
|
130
|
-
return fileManager;
|
|
190
|
+
return await this.fileOperations.parseNewFile(relativePath);
|
|
131
191
|
}
|
|
132
192
|
catch (error) {
|
|
133
|
-
return null;
|
|
193
|
+
return null;
|
|
134
194
|
}
|
|
135
195
|
}));
|
|
136
|
-
// Filter out nulls
|
|
196
|
+
// Filter out nulls (files that couldn't be parsed)
|
|
137
197
|
const validFiles = parsedFiles.filter((f) => f !== null);
|
|
138
|
-
// PHASE 2:
|
|
139
|
-
const
|
|
140
|
-
|
|
141
|
-
for (const file of validFiles) {
|
|
142
|
-
const dependsOnBatch = [...file.dependencies].some((dep) => batchSet.has(dep));
|
|
143
|
-
if (dependsOnBatch) {
|
|
144
|
-
hasDeps.push(file);
|
|
145
|
-
}
|
|
146
|
-
else {
|
|
147
|
-
noDeps.push(file);
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
// Combine: no-deps first, has-deps last
|
|
151
|
-
const orderedFiles = [...noDeps, ...hasDeps];
|
|
152
|
-
// PHASE 3: Process sequentially with retry for failures
|
|
153
|
-
const failed = [];
|
|
198
|
+
// PHASE 2: Topological sort for proper dependency order
|
|
199
|
+
const orderedFiles = this.topologicalSort(validFiles, batchSet);
|
|
200
|
+
// PHASE 3: Complete processing in dependency order
|
|
154
201
|
for (const file of orderedFiles) {
|
|
155
202
|
try {
|
|
156
203
|
await this.fileOperations.finalizeNewFile(file);
|
|
157
204
|
devLogSuccess(`Added file: ${file.relativePath}`);
|
|
158
205
|
}
|
|
159
206
|
catch (error) {
|
|
160
|
-
|
|
207
|
+
// File may have issues, but we continue with others
|
|
208
|
+
console.error(`Failed to add file ${file.relativePath}:`, error);
|
|
161
209
|
}
|
|
162
210
|
}
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Topologically sort files by their dependencies
|
|
214
|
+
*
|
|
215
|
+
* Uses Kahn's algorithm to produce an ordering where files with
|
|
216
|
+
* no batch dependencies come first, and files that depend on other
|
|
217
|
+
* batch files come after their dependencies.
|
|
218
|
+
*
|
|
219
|
+
* @param files - Array of FileManager instances to sort
|
|
220
|
+
* @param batchSet - Set of relative paths in this batch (for filtering deps)
|
|
221
|
+
* @returns Files in topological order (dependencies first)
|
|
222
|
+
*
|
|
223
|
+
* @example
|
|
224
|
+
* ```typescript
|
|
225
|
+
* // If A imports B, and B imports C, result will be: [C, B, A]
|
|
226
|
+
* const ordered = this.topologicalSort([fileA, fileB, fileC], batchSet);
|
|
227
|
+
* ```
|
|
228
|
+
*
|
|
229
|
+
* @internal
|
|
230
|
+
*/
|
|
231
|
+
topologicalSort(files, batchSet) {
|
|
232
|
+
const fileMap = new Map();
|
|
233
|
+
const inDegree = new Map();
|
|
234
|
+
const graph = new Map();
|
|
235
|
+
// Initialize data structures
|
|
236
|
+
for (const file of files) {
|
|
237
|
+
fileMap.set(file.relativePath, file);
|
|
238
|
+
inDegree.set(file.relativePath, 0);
|
|
239
|
+
graph.set(file.relativePath, []);
|
|
240
|
+
}
|
|
241
|
+
// Build graph: for each file, record which files depend on it
|
|
242
|
+
for (const file of files) {
|
|
243
|
+
for (const dep of file.dependencies) {
|
|
244
|
+
// Only consider dependencies that are in this batch
|
|
245
|
+
if (batchSet.has(dep) && fileMap.has(dep)) {
|
|
246
|
+
// dep → file (file depends on dep)
|
|
247
|
+
graph.get(dep).push(file.relativePath);
|
|
248
|
+
inDegree.set(file.relativePath, (inDegree.get(file.relativePath) || 0) + 1);
|
|
249
|
+
}
|
|
168
250
|
}
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
251
|
+
}
|
|
252
|
+
// Kahn's algorithm: start with files that have no batch dependencies
|
|
253
|
+
const queue = [];
|
|
254
|
+
for (const file of files) {
|
|
255
|
+
if (inDegree.get(file.relativePath) === 0) {
|
|
256
|
+
queue.push(file);
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
const result = [];
|
|
260
|
+
while (queue.length > 0) {
|
|
261
|
+
const file = queue.shift();
|
|
262
|
+
result.push(file);
|
|
263
|
+
// For each file that depends on this one, reduce its in-degree
|
|
264
|
+
for (const dependentPath of graph.get(file.relativePath) || []) {
|
|
265
|
+
const newDegree = (inDegree.get(dependentPath) || 0) - 1;
|
|
266
|
+
inDegree.set(dependentPath, newDegree);
|
|
267
|
+
if (newDegree === 0) {
|
|
268
|
+
const dependentFile = fileMap.get(dependentPath);
|
|
269
|
+
if (dependentFile) {
|
|
270
|
+
queue.push(dependentFile);
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
// Handle any remaining files (cycles or isolated)
|
|
276
|
+
// These are added at the end to ensure all files are processed
|
|
277
|
+
for (const file of files) {
|
|
278
|
+
if (!result.includes(file)) {
|
|
279
|
+
result.push(file);
|
|
172
280
|
}
|
|
173
281
|
}
|
|
282
|
+
return result;
|
|
174
283
|
}
|
|
175
284
|
/**
|
|
176
|
-
* Process batch of deleted files
|
|
285
|
+
* Process a batch of deleted files
|
|
286
|
+
*
|
|
287
|
+
* Each file is removed from the system and its dependents are notified.
|
|
288
|
+
*
|
|
289
|
+
* @param relativePaths - Array of relative paths to deleted files
|
|
290
|
+
* @internal
|
|
177
291
|
*/
|
|
178
292
|
async processBatchDeletes(relativePaths) {
|
|
179
293
|
if (relativePaths.length === 0)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-event-handler.js","sources":["../../src/dev2-server/file-event-handler.ts"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"file-event-handler.js","sources":["../../src/dev2-server/file-event-handler.ts"],"sourcesContent":[null],"names":[],"mappings":"oQAWA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgCG;MACU,gBAAgB,CAAA;AAiCR,IAAA,cAAA,CAAA;AACA,IAAA,QAAA,CAAA;AACA,IAAA,eAAA,CAAA;AACA,IAAA,KAAA,CAAA;A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