electrobun 0.0.19-beta.15 → 0.0.19-beta.17

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.
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "electrobun",
3
- "version": "0.0.19-beta.15",
3
+ "version": "0.0.19-beta.17",
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
@@ -114,13 +114,13 @@ async function ensureCoreDependencies() {
114
114
 
115
115
  const platformName = OS === 'macos' ? 'darwin' : OS === 'win' ? 'win32' : 'linux';
116
116
  const archName = ARCH;
117
- const mainTarballUrl = `https://github.com/blackboardsh/electrobun/releases/download/${version}/electrobun-${platformName}-${archName}.tar.gz`;
117
+ const coreTarballUrl = `https://github.com/blackboardsh/electrobun/releases/download/${version}/electrobun-core-${platformName}-${archName}.tar.gz`;
118
118
 
119
- console.log(`Downloading core binaries from: ${mainTarballUrl}`);
119
+ console.log(`Downloading core binaries from: ${coreTarballUrl}`);
120
120
 
121
121
  try {
122
- // Download main tarball
123
- const response = await fetch(mainTarballUrl);
122
+ // Download core binaries tarball
123
+ const response = await fetch(coreTarballUrl);
124
124
  if (!response.ok) {
125
125
  throw new Error(`Failed to download binaries: ${response.status} ${response.statusText}`);
126
126
  }
@@ -249,7 +249,6 @@ const commandDefaults = {
249
249
 
250
250
  // todo (yoav): add types for config
251
251
  const defaultConfig = {
252
- entrypoint: "src/bun/index.ts",
253
252
  app: {
254
253
  name: "MyApp",
255
254
  identifier: "com.example.myapp",
@@ -268,6 +267,10 @@ const defaultConfig = {
268
267
  },
269
268
  icons: "icon.iconset",
270
269
  },
270
+ bun: {
271
+ entrypoint: "src/bun/index.ts",
272
+ external: [],
273
+ },
271
274
  },
272
275
  scripts: {
273
276
  postBuild: "",
@@ -474,10 +477,26 @@ if (commandArg === "init") {
474
477
  // mkdirSync(destLauncherFolder, {recursive: true});
475
478
  // }
476
479
  // cpSync(zigLauncherBinarySource, zigLauncherDestination, {recursive: true, dereference: true});
480
+ // For dev builds, use the actual CLI binary that's currently running
481
+ // It could be in .cache (npm install) or bin (local dev)
482
+ let devLauncherPath = PATHS.LAUNCHER_DEV;
483
+ if (buildEnvironment === "dev" && !existsSync(devLauncherPath)) {
484
+ // Check .cache location (npm installed)
485
+ const cachePath = join(ELECTROBUN_DEP_PATH, ".cache", "electrobun") + binExt;
486
+ if (existsSync(cachePath)) {
487
+ devLauncherPath = cachePath;
488
+ } else {
489
+ // Check bin location (local dev)
490
+ const binPath = join(ELECTROBUN_DEP_PATH, "bin", "electrobun") + binExt;
491
+ if (existsSync(binPath)) {
492
+ devLauncherPath = binPath;
493
+ }
494
+ }
495
+ }
496
+
477
497
  const bunCliLauncherBinarySource =
478
498
  buildEnvironment === "dev"
479
- ? // Note: in dev use the cli as the launcher
480
- PATHS.LAUNCHER_DEV
499
+ ? devLauncherPath
481
500
  : // Note: for release use the zig launcher optimized for smol size
482
501
  PATHS.LAUNCHER_RELEASE;
483
502
  const bunCliLauncherDestination = join(appBundleMacOSPath, "launcher") + binExt;
@@ -1318,6 +1337,10 @@ function getConfig() {
1318
1337
  ...(loadedConfig?.build?.mac?.entitlements || {}),
1319
1338
  },
1320
1339
  },
1340
+ bun: {
1341
+ ...defaultConfig.build.bun,
1342
+ ...(loadedConfig?.build?.bun || {}),
1343
+ }
1321
1344
  },
1322
1345
  scripts: {
1323
1346
  ...defaultConfig.scripts,