tutanota/buildSrc/fixFdroidDeps.js
paw 1e53ef7c5e Remove winreg, use WindowsRegistryFacade
We use the REG command to manipulate/query the Windows registry.

Also adds CommandExecutor so that we have a nice, unit-testable way to
execute commands.

Closes #9398
2025-08-29 10:26:11 +02:00

34 lines
971 B
JavaScript

// Script which removes dependencies with binaries which raise F-Droid alarms.
import fs from "node:fs"
const packageJson = JSON.parse(fs.readFileSync("./package.json", "utf8"))
const devDependencies = [
"electron",
"electron-builder",
"electron-localshortcut",
"electron-packager",
"electron-updater",
"@electron/notarize",
"electron-rebuild",
"express",
"request",
"chokidar",
"body-parser",
"rcedit",
"node-forge",
]
for (const dep of devDependencies) {
delete packageJson.devDependencies[dep]
}
delete packageJson.scripts["postinstall"]
fs.writeFileSync("package.json", JSON.stringify(packageJson, null, "\t"))
// The project doesn't typecheck because removing dependencies also removes type definitions that are required by TS
// SO we just ignore that
const tsConfig = JSON.parse(fs.readFileSync("./tsconfig.json", "utf8"))
tsConfig.compilerOptions.noEmitOnError = false
fs.writeFileSync("./tsconfig.json", JSON.stringify(tsConfig, null, "\t"))