electrobun 0.0.19-beta.104 → 0.0.19-beta.105

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/cli/index.ts +57 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "electrobun",
3
- "version": "0.0.19-beta.104",
3
+ "version": "0.0.19-beta.105",
4
4
  "description": "Build ultra fast, tiny, and cross-platform desktop apps with Typescript.",
5
5
  "license": "MIT",
6
6
  "author": "Blackboard Technologies Inc.",
package/src/cli/index.ts CHANGED
@@ -2213,7 +2213,7 @@ function codesignAppBundle(
2213
2213
  Bun.write(entitlementsFilePath, entitlementsFileContents);
2214
2214
  }
2215
2215
 
2216
- // Sign frameworks first (CEF framework if it exists)
2216
+ // Sign frameworks first (CEF framework requires special handling)
2217
2217
  const frameworksPath = join(contentsPath, 'Frameworks');
2218
2218
  if (existsSync(frameworksPath)) {
2219
2219
  try {
@@ -2221,14 +2221,68 @@ function codesignAppBundle(
2221
2221
  for (const framework of frameworks) {
2222
2222
  if (framework.endsWith('.framework')) {
2223
2223
  const frameworkPath = join(frameworksPath, framework);
2224
- console.log(`Signing framework: ${framework}`);
2224
+
2225
+ if (framework === 'Chromium Embedded Framework.framework') {
2226
+ console.log(`Signing CEF framework components: ${framework}`);
2227
+
2228
+ // Sign CEF libraries first
2229
+ const librariesPath = join(frameworkPath, 'Libraries');
2230
+ if (existsSync(librariesPath)) {
2231
+ const libraries = readdirSync(librariesPath);
2232
+ for (const library of libraries) {
2233
+ if (library.endsWith('.dylib')) {
2234
+ const libraryPath = join(librariesPath, library);
2235
+ console.log(`Signing CEF library: ${library}`);
2236
+ execSync(
2237
+ `codesign --force --verbose --timestamp --sign "${ELECTROBUN_DEVELOPER_ID}" --options runtime ${escapePathForTerminal(libraryPath)}`
2238
+ );
2239
+ }
2240
+ }
2241
+ }
2242
+
2243
+ // CEF helper apps are in the main Frameworks directory, not inside the CEF framework
2244
+ // We'll sign them after signing all frameworks
2245
+ }
2246
+
2247
+ // Sign the framework bundle itself (for CEF and any other frameworks)
2248
+ console.log(`Signing framework bundle: ${framework}`);
2225
2249
  execSync(
2226
2250
  `codesign --force --verbose --timestamp --sign "${ELECTROBUN_DEVELOPER_ID}" --options runtime ${escapePathForTerminal(frameworkPath)}`
2227
2251
  );
2228
2252
  }
2229
2253
  }
2230
2254
  } catch (err) {
2231
- console.log("No frameworks to sign or error signing frameworks:", err);
2255
+ console.log("Error signing frameworks:", err);
2256
+ throw err; // Re-throw to fail the build since framework signing is critical
2257
+ }
2258
+ }
2259
+
2260
+ // Sign CEF helper apps (they're in the main Frameworks directory, not inside CEF framework)
2261
+ const cefHelperApps = [
2262
+ 'bun Helper.app',
2263
+ 'bun Helper (GPU).app',
2264
+ 'bun Helper (Plugin).app',
2265
+ 'bun Helper (Alerts).app',
2266
+ 'bun Helper (Renderer).app'
2267
+ ];
2268
+
2269
+ for (const helperApp of cefHelperApps) {
2270
+ const helperPath = join(frameworksPath, helperApp);
2271
+ if (existsSync(helperPath)) {
2272
+ const helperExecutablePath = join(helperPath, 'Contents', 'MacOS', helperApp.replace('.app', ''));
2273
+ if (existsSync(helperExecutablePath)) {
2274
+ console.log(`Signing CEF helper executable: ${helperApp}`);
2275
+ const entitlementFlag = entitlementsFilePath ? `--entitlements ${entitlementsFilePath}` : '';
2276
+ execSync(
2277
+ `codesign --force --verbose --timestamp --sign "${ELECTROBUN_DEVELOPER_ID}" --options runtime ${entitlementFlag} ${escapePathForTerminal(helperExecutablePath)}`
2278
+ );
2279
+ }
2280
+
2281
+ console.log(`Signing CEF helper bundle: ${helperApp}`);
2282
+ const entitlementFlag = entitlementsFilePath ? `--entitlements ${entitlementsFilePath}` : '';
2283
+ execSync(
2284
+ `codesign --force --verbose --timestamp --sign "${ELECTROBUN_DEVELOPER_ID}" --options runtime ${entitlementFlag} ${escapePathForTerminal(helperPath)}`
2285
+ );
2232
2286
  }
2233
2287
  }
2234
2288