electrobun 0.0.19-beta.17 → 0.0.19-beta.19

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 +20 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "electrobun",
3
- "version": "0.0.19-beta.17",
3
+ "version": "0.0.19-beta.19",
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
@@ -92,12 +92,26 @@ const PATHS = {
92
92
  };
93
93
 
94
94
  async function ensureCoreDependencies() {
95
- // Check if core dependencies already exist
96
- if (existsSync(PATHS.BUN_BINARY) && existsSync(PATHS.LAUNCHER_RELEASE)) {
95
+ // Check if all core dependencies exist
96
+ const requiredFiles = [
97
+ PATHS.BUN_BINARY,
98
+ PATHS.LAUNCHER_RELEASE,
99
+ PATHS.MAIN_JS,
100
+ // Platform-specific native wrapper
101
+ OS === 'macos' ? PATHS.NATIVE_WRAPPER_MACOS :
102
+ OS === 'win' ? PATHS.NATIVE_WRAPPER_WIN :
103
+ PATHS.NATIVE_WRAPPER_LINUX
104
+ ];
105
+
106
+ const allFilesExist = requiredFiles.every(file => existsSync(file));
107
+ if (allFilesExist) {
97
108
  return;
98
109
  }
99
110
 
100
- console.log('Core dependencies not found, downloading...');
111
+ // Show which files are missing
112
+ const missingFiles = requiredFiles.filter(file => !existsSync(file));
113
+ console.log('Core dependencies not found. Missing files:', missingFiles.map(f => f.replace(ELECTROBUN_DEP_PATH, '.')).join(', '));
114
+ console.log('Downloading core binaries...');
101
115
 
102
116
  // Get the current Electrobun version from package.json
103
117
  const packageJsonPath = join(ELECTROBUN_DEP_PATH, 'package.json');
@@ -384,6 +398,9 @@ if (commandArg === "init") {
384
398
  // todo (yoav): init a repo folder structure
385
399
  console.log("initializing electrobun project");
386
400
  } else if (commandArg === "build") {
401
+ // Ensure core binaries are available before starting build
402
+ await ensureCoreDependencies();
403
+
387
404
  // refresh build folder
388
405
  if (existsSync(buildFolder)) {
389
406
  rmdirSync(buildFolder, { recursive: true });
@@ -567,8 +584,6 @@ if (commandArg === "init") {
567
584
  }
568
585
  }
569
586
 
570
- // Ensure core binaries are available
571
- await ensureCoreDependencies();
572
587
 
573
588
  // Download CEF binaries if needed when bundleCEF is enabled
574
589
  if ((OS === 'macos' && config.build.mac?.bundleCEF) ||