vovk-cli 0.0.1-beta.21 → 0.0.1-beta.22
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/watcher/index.mjs +6 -1
- package/package.json +1 -1
package/dist/watcher/index.mjs
CHANGED
|
@@ -163,8 +163,10 @@ export class VovkCLIWatcher {
|
|
|
163
163
|
#processControllerChange = async (filePath) => {
|
|
164
164
|
const { log } = this.#projectInfo;
|
|
165
165
|
const code = await fs.readFile(filePath, 'utf-8').catch(() => null);
|
|
166
|
-
if (typeof code !== 'string')
|
|
166
|
+
if (typeof code !== 'string') {
|
|
167
|
+
log.error(`Error reading file ${filePath}`);
|
|
167
168
|
return;
|
|
169
|
+
}
|
|
168
170
|
const nameOfClasReg = /\bclass\s+([A-Za-z_]\w*)(?:\s*<[^>]*>)?\s*\{/g;
|
|
169
171
|
const namesOfClasses = [...code.matchAll(nameOfClasReg)].map((match) => match[1]);
|
|
170
172
|
const importRegex = /import\s*{[^}]*\b(get|post|put|del|head|options|worker)\b[^}]*}\s*from\s*['"]vovk['"]/;
|
|
@@ -187,6 +189,9 @@ export class VovkCLIWatcher {
|
|
|
187
189
|
}
|
|
188
190
|
}
|
|
189
191
|
}
|
|
192
|
+
else {
|
|
193
|
+
log.debug(`File ${filePath} does not contain any vovk controller or worker`);
|
|
194
|
+
}
|
|
190
195
|
};
|
|
191
196
|
#requestSchema = debounceWithArgs(async (segmentName) => {
|
|
192
197
|
const { apiEntryPoint, log, port } = this.#projectInfo;
|