первй коммит

This commit is contained in:
2026-02-27 21:26:26 +03:00
parent e400b44732
commit ca00e6bbc8
19 changed files with 2701 additions and 257 deletions

View File

@@ -4,6 +4,7 @@ export class ProjectLimitsPolicy {
this.hardFileLimit = 10000;
this.softSizeLimitBytes = 1 * 1024 * 1024;
this.hardSizeLimitBytes = 10 * 1024 * 1024;
this.ignoredDirectoryNames = new Set(["app-data", "build", "grafana", "__pycache__"]);
}
summarizeFileList(fileList) {
@@ -12,7 +13,7 @@ export class ProjectLimitsPolicy {
for (const file of fileList) {
const relPath = (file.webkitRelativePath || file.name || "").replaceAll("\\", "/");
if (this.#isHiddenPath(relPath)) continue;
if (this.#isIgnoredPath(relPath)) continue;
totalFiles += 1;
totalBytes += Number(file.size || 0);
}
@@ -43,11 +44,11 @@ export class ProjectLimitsPolicy {
return { softWarnings, hardErrors };
}
#isHiddenPath(path) {
#isIgnoredPath(path) {
const parts = String(path || "")
.split("/")
.filter(Boolean);
return parts.some((segment) => segment.startsWith("."));
return parts.some((segment) => segment.startsWith(".") || this.ignoredDirectoryNames.has(segment));
}
#formatBytes(bytes) {