fix(number-fields): избегаем потери точности длинных чисел
- number-поля теперь рендерятся как text + inputMode=numeric, чтобы браузер не округлял значения через input type=number - пробелы при вставке в number-поля удаляются - бэкенд нормализует значения number-полей в строку перед сохранением - добавлен хелпер normalizeFieldValueForStorage Closes: искажение расчётного счёта и других длинных числовых полей
This commit is contained in:
29
scripts/check-file-sizes.ts
Normal file
29
scripts/check-file-sizes.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import { readdirSync, readFileSync } from "fs";
|
||||
import { join } from "path";
|
||||
|
||||
const ROUTES_DIR = "server/routes";
|
||||
const LINE_LIMIT = 650;
|
||||
|
||||
const files = readdirSync(ROUTES_DIR).filter((f) => f.endsWith(".ts"));
|
||||
|
||||
let violations = 0;
|
||||
|
||||
for (const file of files) {
|
||||
const filePath = join(ROUTES_DIR, file);
|
||||
const lines = readFileSync(filePath, "utf-8").split("\n").length;
|
||||
if (lines > LINE_LIMIT) {
|
||||
console.error(
|
||||
`❌ ${filePath}: ${lines} lines (limit is ${LINE_LIMIT})`
|
||||
);
|
||||
violations++;
|
||||
}
|
||||
}
|
||||
|
||||
if (violations > 0) {
|
||||
console.error(
|
||||
`\n${violations} file(s) exceed the ${LINE_LIMIT}-line limit. Split them into smaller modules before merging.`
|
||||
);
|
||||
process.exit(1);
|
||||
} else {
|
||||
console.log(`✅ All ${files.length} route files are within the ${LINE_LIMIT}-line limit.`);
|
||||
}
|
||||
Reference in New Issue
Block a user