Files
EpicNext-Cms/scripts/merge-config.cjs
T
openhands e5ff7ec9e5
CI / check (push) Successful in 33s
CI / release (push) Skipped
CI / deploy (push) Successful in 1m25s
chore: clean up biome lint warnings — all non- intentional resolved
- Remove 25 unused imports across 14 test files
- Remove 1 unused variable (rename with _ prefix)
- Fix 2 noBannedTypes (Function → (...args: unknown[]) => unknown)
- Fix 1 useTemplate lint (string concat → template literal in merge-config.cjs)
- Fix 1 useNodejsImportProtocol (merge-config.cjs)
- Fix 2 noTemplateCurlyInString (generate-drizzle-schema.mjs generator code)
- Auto-fix formatting + import sorting across modified files
- 221 remaining warnings: intentional noExplicitAny in prisma-facade.ts (Prisma compat layer)
- 0 tsc errors, 583 tests passing
2026-07-31 15:26:39 +02:00

54 lines
1.1 KiB
JavaScript

const fs = require("node:fs");
const JSON5 = require("json5");
const exampleFile = process.argv[2];
const targetFile = process.argv[3];
if (!exampleFile || !targetFile) {
process.exit(1);
}
function deepMerge(target, source) {
const result = { ...target };
for (const key of Object.keys(source)) {
if (
source[key] !== null &&
typeof source[key] === "object" &&
!Array.isArray(source[key])
) {
result[key] = deepMerge(target[key] || {}, source[key]);
} else {
if (!(key in result)) {
result[key] = source[key];
}
}
}
return result;
}
let example;
try {
const content = fs.readFileSync(exampleFile, "utf-8");
example = JSON5.parse(content);
} catch {
process.exit(1);
}
let current = {};
try {
if (fs.existsSync(targetFile)) {
const content = fs.readFileSync(targetFile, "utf-8");
current = JSON5.parse(content);
}
} catch {
current = {};
}
const merged = deepMerge(current, example);
const isJson5 = targetFile.endsWith(".json5");
const output = isJson5
? JSON5.stringify(merged, null, 4)
: JSON.stringify(merged, null, 4);
fs.writeFileSync(targetFile, `${output}\n`);