Some checks reported errors
farmcontrol/farmcontrol-ui/pipeline/head Something is wrong with the build of this commit
- Created electrobun.config.ts to define application settings and build parameters. - Added build-macos.mjs script to handle macOS builds, including architecture targeting. - Introduced finalize-desktop-artifacts.mjs for managing post-build processes and artifact publishing. - Implemented pre-build.mjs for validating required files before the build process. - Added utility scripts for managing release artifacts and syncing views. - Established desktop-specific functionalities in the src/desktop directory, including app update handling and menu management. - Updated .gitignore to include dist directory and test results for cleaner repository management. - Introduced bun.lock for dependency management with Bun.
39 lines
1.1 KiB
JavaScript
39 lines
1.1 KiB
JavaScript
import { existsSync } from "node:fs";
|
|
import path from "node:path";
|
|
import { fileURLToPath } from "node:url";
|
|
|
|
const rootDir = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
|
|
const buildEnv = process.env.ELECTROBUN_BUILD_ENV || "dev";
|
|
|
|
const requiredFiles = [
|
|
"src/bun/index.js",
|
|
"electrobun.config.ts",
|
|
"package.json",
|
|
];
|
|
|
|
for (const relativePath of requiredFiles) {
|
|
const filePath = path.join(rootDir, relativePath);
|
|
if (!existsSync(filePath)) {
|
|
console.error(`pre-build: required file not found: ${relativePath}`);
|
|
process.exit(1);
|
|
}
|
|
}
|
|
|
|
if (buildEnv === "stable" && process.env.ELECTROBUN_OS === "macos") {
|
|
const codesignVars = [
|
|
"ELECTROBUN_DEVELOPER_ID",
|
|
"ELECTROBUN_APPLEID",
|
|
"ELECTROBUN_APPLEIDPASS",
|
|
"ELECTROBUN_TEAMID",
|
|
];
|
|
const missing = codesignVars.filter((name) => !process.env[name]);
|
|
|
|
if (missing.length > 0) {
|
|
console.warn(
|
|
`pre-build: stable macOS build without code signing credentials (${missing.join(", ")}); Electrobun will skip signing.`,
|
|
);
|
|
}
|
|
}
|
|
|
|
console.log(`pre-build: validation passed (${buildEnv})`);
|