electrobun 0.0.19-beta.69 → 0.0.19-beta.70

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 +15 -40
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "electrobun",
3
- "version": "0.0.19-beta.69",
3
+ "version": "0.0.19-beta.70",
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
@@ -58,7 +58,7 @@ const configPath = join(projectRoot, configName);
58
58
  const indexOfElectrobun = process.argv.findIndex((arg) =>
59
59
  arg.includes("electrobun")
60
60
  );
61
- const commandArg = process.argv[indexOfElectrobun + 1] || "launcher";
61
+ const commandArg = process.argv[indexOfElectrobun + 1] || "build";
62
62
 
63
63
  const ELECTROBUN_DEP_PATH = join(projectRoot, "node_modules", "electrobun");
64
64
 
@@ -404,10 +404,6 @@ const commandDefaults = {
404
404
  projectRoot,
405
405
  config: "electrobun.config",
406
406
  },
407
- launcher: {
408
- projectRoot,
409
- config: "electrobun.config",
410
- },
411
407
  };
412
408
 
413
409
  // todo (yoav): add types for config
@@ -817,39 +813,21 @@ if (commandArg === "init") {
817
813
  // mkdirSync(destLauncherFolder, {recursive: true});
818
814
  // }
819
815
  // cpSync(zigLauncherBinarySource, zigLauncherDestination, {recursive: true, dereference: true});
820
- // For dev builds, use the actual CLI binary that's currently running
821
- // It could be in .cache (npm install) or bin (local dev)
822
- let devLauncherPath = targetPaths.LAUNCHER_DEV;
823
- if (buildEnvironment === "dev" && !existsSync(devLauncherPath)) {
824
- // Check .cache location (npm installed)
825
- const cachePath = join(ELECTROBUN_DEP_PATH, ".cache", "electrobun") + binExt;
826
- if (existsSync(cachePath)) {
827
- devLauncherPath = cachePath;
828
- } else {
829
- // Check bin location (local dev)
830
- const binPath = join(ELECTROBUN_DEP_PATH, "bin", "electrobun") + binExt;
831
- if (existsSync(binPath)) {
832
- devLauncherPath = binPath;
833
- }
816
+ // Only copy launcher for non-dev builds
817
+ if (buildEnvironment !== "dev") {
818
+ const bunCliLauncherBinarySource = targetPaths.LAUNCHER_RELEASE;
819
+ const bunCliLauncherDestination = join(appBundleMacOSPath, "launcher") + binExt;
820
+ const destLauncherFolder = dirname(bunCliLauncherDestination);
821
+ if (!existsSync(destLauncherFolder)) {
822
+ // console.info('creating folder: ', destFolder);
823
+ mkdirSync(destLauncherFolder, { recursive: true });
834
824
  }
835
- }
836
-
837
- const bunCliLauncherBinarySource =
838
- buildEnvironment === "dev"
839
- ? devLauncherPath
840
- : // Note: for release use the zig launcher optimized for smol size
841
- targetPaths.LAUNCHER_RELEASE;
842
- const bunCliLauncherDestination = join(appBundleMacOSPath, "launcher") + binExt;
843
- const destLauncherFolder = dirname(bunCliLauncherDestination);
844
- if (!existsSync(destLauncherFolder)) {
845
- // console.info('creating folder: ', destFolder);
846
- mkdirSync(destLauncherFolder, { recursive: true });
847
- }
848
825
 
849
- cpSync(bunCliLauncherBinarySource, bunCliLauncherDestination, {
850
- recursive: true,
851
- dereference: true,
852
- });
826
+ cpSync(bunCliLauncherBinarySource, bunCliLauncherDestination, {
827
+ recursive: true,
828
+ dereference: true,
829
+ });
830
+ }
853
831
 
854
832
  cpSync(targetPaths.MAIN_JS, join(appBundleMacOSPath, 'main.js'));
855
833
 
@@ -1624,10 +1602,7 @@ if (commandArg === "init") {
1624
1602
  // todo (yoav): rename to start
1625
1603
 
1626
1604
  // run the project in dev mode
1627
- // this runs the cli in debug mode, on macos executes the app bundle,
1628
- // there is another copy of the cli in the app bundle that will execute the app
1629
- // the two cli processes communicate via named pipes and together manage the dev
1630
- // lifecycle and debug functionality
1605
+ // this runs the bundled bun binary with main.js directly
1631
1606
 
1632
1607
  // Note: this cli will be a bun single-file-executable
1633
1608
  // Note: we want to use the version of bun that's packaged with electrobun