This branch snapshots the in-progress desktop workspace so GitHub-hosted Windows and Linux runners can package the same source tree that already passes local verification on macOS. Constraint: Local Apple Silicon Docker/Wine packaging crashes before Windows artifacts are produced Rejected: Publish from the incomplete base repo state | remote typecheck failed because current source additions were missing Confidence: medium Scope-risk: broad Directive: Treat this branch as a build snapshot only; do not merge it without reviewing the unrelated workspace changes it contains Tested: local typecheck, lint, workspace typecheck, unit tests, integration tests, e2e smoke, macOS signed release upload Not-tested: Native Windows/Linux artifacts before this CI run
47 lines
1.2 KiB
TypeScript
47 lines
1.2 KiB
TypeScript
import { createRequire } from "node:module";
|
|
import { dirname, resolve } from "node:path";
|
|
import { fileURLToPath } from "node:url";
|
|
|
|
const require = createRequire(import.meta.url);
|
|
const repoRoot = resolve(dirname(fileURLToPath(import.meta.url)), "..", "..");
|
|
|
|
const EXPERIMENTAL_WARNING_FLAG = "--disable-warning=ExperimentalWarning";
|
|
|
|
export function getElectronExecutablePath() {
|
|
return require("electron");
|
|
}
|
|
|
|
export function getMainEntryPath() {
|
|
return resolve(repoRoot, "out/main/index.js");
|
|
}
|
|
|
|
export function createElectronLaunchEnv(
|
|
overrides: Record<string, string>,
|
|
) : Record<string, string> {
|
|
const env: Record<string, string> = {};
|
|
|
|
for (const [key, value] of Object.entries(process.env)) {
|
|
if (typeof value === "string") {
|
|
env[key] = value;
|
|
}
|
|
}
|
|
|
|
Object.assign(env, overrides);
|
|
|
|
if (env.FORCE_COLOR && env.NO_COLOR) {
|
|
delete env.NO_COLOR;
|
|
}
|
|
|
|
const existingNodeOptions = env.NODE_OPTIONS?.trim();
|
|
if (!existingNodeOptions) {
|
|
env.NODE_OPTIONS = EXPERIMENTAL_WARNING_FLAG;
|
|
return env;
|
|
}
|
|
|
|
if (!existingNodeOptions.includes(EXPERIMENTAL_WARNING_FLAG)) {
|
|
env.NODE_OPTIONS = `${existingNodeOptions} ${EXPERIMENTAL_WARNING_FLAG}`;
|
|
}
|
|
|
|
return env;
|
|
}
|