avo 3.3.0-alpha.1 → 3.3.0-alpha.2
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/cli.js +17 -1
- package/package.json +1 -1
package/cli.js
CHANGED
|
@@ -1281,10 +1281,12 @@ function status(source, json, argv) {
|
|
|
1281
1281
|
if (argv.verbose) {
|
|
1282
1282
|
console.log('Looking in files with extensions:', sourcePathExts);
|
|
1283
1283
|
}
|
|
1284
|
+
const eventsDir = getEventsDirectoryPath(source.path, moduleName);
|
|
1284
1285
|
const globs = [
|
|
1285
1286
|
new Minimatch(source.analysis?.glob ??
|
|
1286
1287
|
`**/*.+(${sourcePathExts.join('|')})`, {}),
|
|
1287
1288
|
new Minimatch(`!${source.path}`, {}),
|
|
1289
|
+
new Minimatch(`!${eventsDir}/**`, {}),
|
|
1288
1290
|
];
|
|
1289
1291
|
const lookup = {};
|
|
1290
1292
|
Object.entries(cache).forEach(([cachePath, value]) => {
|
|
@@ -1301,8 +1303,22 @@ function status(source, json, argv) {
|
|
|
1301
1303
|
report.info(`Looking in module: ${moduleName}`);
|
|
1302
1304
|
report.info(`Looking in files: ${combinedPaths.join('\n')}`);
|
|
1303
1305
|
}
|
|
1306
|
+
// Check if file-per-event mode is active
|
|
1307
|
+
const isFilePerEvent = isFilePerEventMode(source.path, moduleName);
|
|
1304
1308
|
return Promise.all(eventMap.map((eventName) => {
|
|
1305
|
-
|
|
1309
|
+
// Build regex pattern based on mode
|
|
1310
|
+
// In file-per-event mode, events can be called without module prefix
|
|
1311
|
+
let pattern;
|
|
1312
|
+
if (isFilePerEvent) {
|
|
1313
|
+
// File-per-event mode: support both with and without module prefix
|
|
1314
|
+
// Pattern matches: Module.eventName, [Module eventName, eventName(, [eventName
|
|
1315
|
+
pattern = `(${moduleName}\\.${eventName}|\\[${moduleName} ${eventName}|${eventName}\\(|\\[${eventName})`;
|
|
1316
|
+
}
|
|
1317
|
+
else {
|
|
1318
|
+
// Legacy mode: only match with module prefix
|
|
1319
|
+
pattern = `(${moduleName}\\.${eventName}|\\[${moduleName} ${eventName})`;
|
|
1320
|
+
}
|
|
1321
|
+
const re = new RegExp(pattern);
|
|
1306
1322
|
const results = Object.entries(lookup)
|
|
1307
1323
|
.map(([path, data]) => {
|
|
1308
1324
|
const results = findMatches(data, re);
|