@eventra_dev/eventra-cli 0.1.13 → 0.1.15
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/commands/watch.js +7 -1
- package/package.json +1 -1
- package/src/commands/watch.ts +9 -2
package/dist/commands/watch.js
CHANGED
|
@@ -58,12 +58,18 @@ async function watch() {
|
|
|
58
58
|
const raw = await promises_1.default.readFile(abs, "utf-8");
|
|
59
59
|
const { content, virtualFile } = (0, processFile_1.processFile)(abs, raw);
|
|
60
60
|
engine["ts"].updateFile(virtualFile, content);
|
|
61
|
-
engine.updateFile(virtualFile, content, config);
|
|
62
61
|
}
|
|
63
62
|
catch {
|
|
64
63
|
console.log(chalk_1.default.gray(`skip: ${file}`));
|
|
65
64
|
}
|
|
66
65
|
}
|
|
66
|
+
const allFiles = [...engine["ts"]["fileNames"]];
|
|
67
|
+
for (const file of allFiles) {
|
|
68
|
+
const content = engine["ts"].getFileContent(file);
|
|
69
|
+
if (!content)
|
|
70
|
+
continue;
|
|
71
|
+
engine.scanFile(file, content, config);
|
|
72
|
+
}
|
|
67
73
|
const next = engine.getAllEvents();
|
|
68
74
|
const added = next.filter(e => !config.events.includes(e));
|
|
69
75
|
const removed = config.events.filter(e => !next.includes(e));
|
package/package.json
CHANGED
package/src/commands/watch.ts
CHANGED
|
@@ -66,19 +66,26 @@ export async function watch() {
|
|
|
66
66
|
for (const file of batch) {
|
|
67
67
|
try {
|
|
68
68
|
const abs = path.resolve(file);
|
|
69
|
-
|
|
70
69
|
const raw = await fs.readFile(abs, "utf-8");
|
|
71
70
|
|
|
72
71
|
const { content, virtualFile } = processFile(abs, raw);
|
|
73
72
|
|
|
74
73
|
engine["ts"].updateFile(virtualFile, content);
|
|
75
|
-
engine.updateFile(virtualFile, content, config);
|
|
76
74
|
|
|
77
75
|
} catch {
|
|
78
76
|
console.log(chalk.gray(`skip: ${file}`));
|
|
79
77
|
}
|
|
80
78
|
}
|
|
81
79
|
|
|
80
|
+
const allFiles = [...engine["ts"]["fileNames"]];
|
|
81
|
+
|
|
82
|
+
for (const file of allFiles) {
|
|
83
|
+
const content = engine["ts"].getFileContent(file);
|
|
84
|
+
if (!content) continue;
|
|
85
|
+
|
|
86
|
+
engine.scanFile(file, content, config);
|
|
87
|
+
}
|
|
88
|
+
|
|
82
89
|
const next = engine.getAllEvents();
|
|
83
90
|
|
|
84
91
|
const added = next.filter(e => !config.events.includes(e));
|